Skip to content

Commit

Permalink
Merge pull request #342 from XeroAPI/serializer_bug_fix
Browse files Browse the repository at this point in the history
Serializer bug fix
  • Loading branch information
SerKnight authored Jan 31, 2020
2 parents 6c40fa5 + 4f8615b commit 802c1e7
Show file tree
Hide file tree
Showing 7 changed files with 429 additions and 21 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Change Log
---------

## "version": "4.1.3"

* Adds Quotes CRUD 🥳
* Remove a duplicate Enum
* Improved docs for `unitdp`
* Fix filters and where clause where we expect an array. Serializes to api as a comma sep. string

## "version": "4.1.2"

* Adds OAuth 2 Gateway to fix #https://github.com/XeroAPI/xero-node/issues/328 so that we can get Quotes
** NOTE
* getQuotes only endpoint supported, but rest of CRUD actions coming soon!
* emailInvoice supported

* Adds Fix for serializer for the numerous dates returned by XeroAPI to fix #https://github.com/XeroAPI/xero-node/issues/323

Possible raw date formats
`"Date": "2009-03-29",`
`"DateString": "2016-12-16T00:00:00",`
`"DateUTCString": "2018-02-28T21:02:11",`
`"createdDateUtc": "2020-01-08T17:26:30.5778680",`
MS Format ( this was main problem date )
`"FullyPaidOnDate": "\/Date(1481846400000+0000)\/",`

ref: https://developer.xero.com/documentation/api/requests-and-responses


## "version": "4.1.1"

* Adds OAuth 2 Gateway to fix #https://github.com/XeroAPI/xero-node/issues/328 so that we can get Quotes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xero-node",
"version": "4.1.2",
"version": "4.1.4",
"description": "Xero NodeJS OAuth 2.0 client for xero-node",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
390 changes: 379 additions & 11 deletions src/gen/api/accountingApi.ts

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/gen/model/accounting/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ export namespace Account {
UNPAIDEXPCLM = <any> 'UNPAIDEXPCLM',
UNREALISEDCURRENCYGAIN = <any> 'UNREALISEDCURRENCYGAIN',
WAGEPAYABLES = <any> 'WAGEPAYABLES',
CISASSETS = <any> 'CISASSETS',
CISASSET = <any> 'CISASSET',
CISLABOUR = <any> 'CISLABOUR',
CISLABOUREXPENSE = <any> 'CISLABOUREXPENSE',
CISLABOURINCOME = <any> 'CISLABOURINCOME',
CISLIABILITY = <any> 'CISLIABILITY',
CISMATERIALS = <any> 'CISMATERIALS',
Empty = <any> ''
}
}
6 changes: 4 additions & 2 deletions src/gen/model/accounting/invoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,11 @@ export namespace Invoice {
export enum TypeEnum {
ACCPAY = <any> 'ACCPAY',
ACCPAYCREDIT = <any> 'ACCPAYCREDIT',
AROVERPAYMENT = <any> 'AROVERPAYMENT',
APOVERPAYMENT = <any> 'APOVERPAYMENT',
APPREPAYMENT = <any> 'APPREPAYMENT',
ACCREC = <any> 'ACCREC',
ACCRECCREDIT = <any> 'ACCRECCREDIT'
ACCRECCREDIT = <any> 'ACCRECCREDIT',
AROVERPAYMENT = <any> 'AROVERPAYMENT'
}
export enum StatusEnum {
DRAFT = <any> 'DRAFT',
Expand Down
6 changes: 5 additions & 1 deletion src/gen/model/accounting/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,11 @@ export class ObjectSerializer {
let date = data[index];
transformedData.push(ObjectSerializer.serialize(date, subType));
}
return transformedData;
if(subType === 'string') {
return transformedData.join(',')
} else {
return transformedData
}
} else if (type === "Date") {
return data.toISOString();
} else {
Expand Down
12 changes: 6 additions & 6 deletions src/gen/model/accounting/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import { QuoteStatusCodes } from './quoteStatusCodes';

export class Quote {
/**
* Xero generated unique identifier for quote
* QuoteID GUID is automatically generated and is returned after create or GET.
*/
'quoteID'?: string;
/**
* Unique alpha numeric code identifying quote (when missing will auto-generate from your Organisation Invoice Settings)
* Unique alpha numeric code identifying a quote (Max Length = 255)
*/
'quoteNumber'?: string;
/**
Expand All @@ -35,13 +35,13 @@ export class Quote {
'terms'?: string;
'contact': Contact;
/**
* See LineItems
* The LineItems collection can contain any number of individual LineItem sub-elements. At minimum, a description is required to create a complete quote.
*/
'lineItems'?: Array<LineItem>;
'lineItems': Array<LineItem>;
/**
* Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation
*/
'date'?: string;
'date': string;
/**
* Date the quote was issued (YYYY-MM-DD)
*/
Expand All @@ -57,7 +57,7 @@ export class Quote {
'status'?: QuoteStatusCodes;
'currencyCode'?: CurrencyCode;
/**
* The currency rate for a multicurrency quote. If no rate is specified, the XE.com day rate is used.
* The currency rate for a multicurrency quote
*/
'currencyRate'?: number;
/**
Expand Down

0 comments on commit 802c1e7

Please sign in to comment.