diff --git a/docs/accounting/index.html b/docs/accounting/index.html index 7e1e514c..022f9e82 100644 --- a/docs/accounting/index.html +++ b/docs/accounting/index.html @@ -6381,7 +6381,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods createAccount @@ -27196,9 +27196,10 @@ Usage and SDK Samples const unitdp = 4; const summaryOnly = true; const pageSize = 100; +const searchTerm = 'SearchTerm=REF12'; try { - const response = await xero.accountingApi.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp, summaryOnly, pageSize); + const response = await xero.accountingApi.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp, summaryOnly, pageSize, searchTerm); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -27524,6 +27525,26 @@ Parameters + + + searchTerm + + + + + + + + String + + + +Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. + + + + + diff --git a/docs/appstore/index.html b/docs/appstore/index.html index eced9ad2..56c3b5cf 100644 --- a/docs/appstore/index.html +++ b/docs/appstore/index.html @@ -1242,7 +1242,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods getSubscription diff --git a/docs/assets/index.html b/docs/assets/index.html index 6fbd1abf..0f159cba 100644 --- a/docs/assets/index.html +++ b/docs/assets/index.html @@ -1393,7 +1393,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods createAsset diff --git a/docs/bankfeeds/index.html b/docs/bankfeeds/index.html index 4b1637e5..ce33fc2d 100644 --- a/docs/bankfeeds/index.html +++ b/docs/bankfeeds/index.html @@ -1269,7 +1269,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods createFeedConnections diff --git a/docs/files/index.html b/docs/files/index.html index 20b810da..946b9d1b 100644 --- a/docs/files/index.html +++ b/docs/files/index.html @@ -1171,7 +1171,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods createFileAssociation diff --git a/docs/finance/index.html b/docs/finance/index.html index 38ed64c9..5d4eaf15 100644 --- a/docs/finance/index.html +++ b/docs/finance/index.html @@ -2738,7 +2738,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods getAccountingActivityAccountUsage diff --git a/docs/payroll-au/index.html b/docs/payroll-au/index.html index ccf4db9c..ffa93360 100644 --- a/docs/payroll-au/index.html +++ b/docs/payroll-au/index.html @@ -3413,7 +3413,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods approveLeaveApplication diff --git a/docs/payroll-nz/index.html b/docs/payroll-nz/index.html index 935f8e0f..a69334af 100644 --- a/docs/payroll-nz/index.html +++ b/docs/payroll-nz/index.html @@ -3844,7 +3844,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods approveTimesheet diff --git a/docs/payroll-uk/index.html b/docs/payroll-uk/index.html index f1733bc0..e1b51b34 100644 --- a/docs/payroll-uk/index.html +++ b/docs/payroll-uk/index.html @@ -3511,7 +3511,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods approveTimesheet diff --git a/docs/projects/index.html b/docs/projects/index.html index b3c1c15a..220a0ae2 100644 --- a/docs/projects/index.html +++ b/docs/projects/index.html @@ -1463,7 +1463,7 @@ SDK: - VSN: 8.0.0 + VSN: 8.1.0 Methods createProject diff --git a/package.json b/package.json index 16980f7b..42542a2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xero-node", - "version": "8.0.0", + "version": "8.1.0", "description": "Xero NodeJS OAuth 2.0 client for xero-node", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/gen/api/accountingApi.ts b/src/gen/api/accountingApi.ts index c0f013af..bda0121f 100644 --- a/src/gen/api/accountingApi.ts +++ b/src/gen/api/accountingApi.ts @@ -94,7 +94,7 @@ export enum AccountingApiApiKeys { export class AccountingApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; @@ -305,16 +305,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -419,16 +415,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -774,16 +766,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -1213,16 +1201,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -1738,16 +1722,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -2336,16 +2316,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -2859,16 +2835,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -3785,16 +3757,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -4061,16 +4029,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -4417,16 +4381,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -4613,16 +4573,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -6436,11 +6392,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -6849,11 +6800,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -7346,11 +7292,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -8436,11 +8377,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -9326,11 +9262,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -10359,11 +10290,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -10536,8 +10462,9 @@ export class AccountingApi { * @param unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts * @param summaryOnly Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. * @param pageSize Number of records to retrieve per page + * @param searchTerm Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. */ - public async getInvoices (xeroTenantId: string, ifModifiedSince?: Date, where?: string, order?: string, iDs?: Array, invoiceNumbers?: Array, contactIDs?: Array, statuses?: Array, page?: number, includeArchived?: boolean, createdByMyApp?: boolean, unitdp?: number, summaryOnly?: boolean, pageSize?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: GetInvoicesResponse; }> { + public async getInvoices (xeroTenantId: string, ifModifiedSince?: Date, where?: string, order?: string, iDs?: Array, invoiceNumbers?: Array, contactIDs?: Array, statuses?: Array, page?: number, includeArchived?: boolean, createdByMyApp?: boolean, unitdp?: number, summaryOnly?: boolean, pageSize?: number, searchTerm?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: GetInvoicesResponse; }> { const localVarPath = this.basePath + '/Invoices'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -10601,6 +10528,10 @@ export class AccountingApi { localVarQueryParameters['pageSize'] = ObjectSerializer.serialize(pageSize, "number"); } + if (searchTerm !== undefined) { + localVarQueryParameters['searchTerm'] = ObjectSerializer.serialize(searchTerm, "string"); + } + localVarHeaderParams['xero-tenant-id'] = ObjectSerializer.serialize(xeroTenantId, "string"); localVarHeaderParams['If-Modified-Since'] = ObjectSerializer.serialize(ifModifiedSince, "Date"); localVarHeaderParams['Accept'] = acceptHeadersFromSpec.join(); @@ -11593,11 +11524,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -13219,11 +13145,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -13869,11 +13790,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -14391,11 +14307,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -14878,11 +14789,6 @@ export class AccountingApi { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -16679,16 +16585,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -16880,16 +16782,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -16993,16 +16891,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -17188,16 +17082,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -17471,16 +17361,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -17754,16 +17640,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -18119,16 +18001,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -19135,16 +19013,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -19331,16 +19205,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -19532,16 +19402,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); @@ -19728,16 +19594,12 @@ export class AccountingApi { }) }); }).then((fileContents) => { - localVarRequestOptions.data = fileContents; + const file = Buffer.concat(fileContents); + localVarRequestOptions.data = file; return new Promise<{ response: AxiosResponse; body: Attachments; }>(async (resolve, reject) => { let body = null try { const response = await axios(localVarRequestOptions) - try { - body = JSON.parse(response.data) - } catch (err) { - console.log('JSON parse body failed') - } body = ObjectSerializer.deserialize(response.data, "Attachments"); if (response.status && response.status >= 200 && response.status <= 299) { resolve({ response: response, body: body }); diff --git a/src/gen/api/appStoreApi.ts b/src/gen/api/appStoreApi.ts index c4c90366..3330ffe3 100644 --- a/src/gen/api/appStoreApi.ts +++ b/src/gen/api/appStoreApi.ts @@ -38,7 +38,7 @@ export enum AppStoreApiApiKeys { export class AppStoreApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/assetApi.ts b/src/gen/api/assetApi.ts index 04087651..ff04ca75 100644 --- a/src/gen/api/assetApi.ts +++ b/src/gen/api/assetApi.ts @@ -37,7 +37,7 @@ export enum AssetApiApiKeys { export class AssetApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/bankfeedsApi.ts b/src/gen/api/bankfeedsApi.ts index b04f91a6..96ab8448 100644 --- a/src/gen/api/bankfeedsApi.ts +++ b/src/gen/api/bankfeedsApi.ts @@ -36,7 +36,7 @@ export enum BankFeedsApiApiKeys { export class BankFeedsApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/filesApi.ts b/src/gen/api/filesApi.ts index ad0f9e82..1619fca4 100644 --- a/src/gen/api/filesApi.ts +++ b/src/gen/api/filesApi.ts @@ -36,7 +36,7 @@ export enum FilesApiApiKeys { export class FilesApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/financeApi.ts b/src/gen/api/financeApi.ts index ad7b6545..8eea7972 100644 --- a/src/gen/api/financeApi.ts +++ b/src/gen/api/financeApi.ts @@ -44,7 +44,7 @@ export enum FinanceApiApiKeys { export class FinanceApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/payrollAUApi.ts b/src/gen/api/payrollAUApi.ts index eb09f887..05a112e0 100644 --- a/src/gen/api/payrollAUApi.ts +++ b/src/gen/api/payrollAUApi.ts @@ -53,7 +53,7 @@ export enum PayrollAuApiApiKeys { export class PayrollAuApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/payrollNZApi.ts b/src/gen/api/payrollNZApi.ts index 031156b6..ea684197 100644 --- a/src/gen/api/payrollNZApi.ts +++ b/src/gen/api/payrollNZApi.ts @@ -94,7 +94,7 @@ export enum PayrollNzApiApiKeys { export class PayrollNzApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/payrollUKApi.ts b/src/gen/api/payrollUKApi.ts index 2c831ec6..717f1ed6 100644 --- a/src/gen/api/payrollUKApi.ts +++ b/src/gen/api/payrollUKApi.ts @@ -94,7 +94,7 @@ export enum PayrollUkApiApiKeys { export class PayrollUkApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {}; diff --git a/src/gen/api/projectApi.ts b/src/gen/api/projectApi.ts index 8cddc505..f6a5eae2 100644 --- a/src/gen/api/projectApi.ts +++ b/src/gen/api/projectApi.ts @@ -44,7 +44,7 @@ export enum ProjectApiApiKeys { export class ProjectApi { protected _basePath = defaultBasePath; - protected defaultHeaders : any = {'user-agent': 'xero-node-8.0.0'}; + protected defaultHeaders : any = {'user-agent': 'xero-node-8.1.0'}; protected _useQuerystring : boolean = false; protected binaryHeaders : any = {};