xero-node 15.0.1 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gen/api/accountingApi.d.ts +1 -64
- package/dist/gen/api/accountingApi.js +2 -304
- package/dist/gen/api/accountingApi.js.map +1 -1
- package/dist/gen/api/appStoreApi.d.ts +1 -1
- package/dist/gen/api/appStoreApi.js +2 -2
- package/dist/gen/api/assetApi.d.ts +1 -1
- package/dist/gen/api/assetApi.js +2 -2
- package/dist/gen/api/bankfeedsApi.d.ts +1 -1
- package/dist/gen/api/bankfeedsApi.js +2 -2
- package/dist/gen/api/filesApi.d.ts +2 -2
- package/dist/gen/api/filesApi.js +3 -3
- package/dist/gen/api/filesApi.js.map +1 -1
- package/dist/gen/api/financeApi.d.ts +1 -1
- package/dist/gen/api/financeApi.js +2 -2
- package/dist/gen/api/payrollAUApi.d.ts +1 -1
- package/dist/gen/api/payrollAUApi.js +2 -2
- package/dist/gen/api/payrollAUV2Api.d.ts +1 -1
- package/dist/gen/api/payrollAUV2Api.js +2 -2
- package/dist/gen/api/payrollNZApi.d.ts +1 -1
- package/dist/gen/api/payrollNZApi.js +2 -2
- package/dist/gen/api/payrollUKApi.d.ts +1 -1
- package/dist/gen/api/payrollUKApi.js +2 -2
- package/dist/gen/api/projectApi.d.ts +1 -1
- package/dist/gen/api/projectApi.js +2 -2
- package/dist/gen/model/accounting/organisation.d.ts +2 -1
- package/dist/gen/model/accounting/organisation.js +1 -0
- package/dist/gen/model/accounting/organisation.js.map +1 -1
- package/dist/gen/model/accounting/prepayment.d.ts +4 -0
- package/dist/gen/model/accounting/prepayment.js +5 -0
- package/dist/gen/model/accounting/prepayment.js.map +1 -1
- package/dist/gen/model/files/association.d.ts +8 -0
- package/dist/gen/model/files/association.js +10 -0
- package/dist/gen/model/files/association.js.map +1 -1
- package/dist/gen/model/payroll-nz/employeePayTemplate.d.ts +1 -1
- package/dist/gen/model/payroll-uk/employeePayTemplate.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Xero Accounting API
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document:
|
|
5
|
+
* The version of the OpenAPI document: 14.0.0
|
|
6
6
|
* Contact: api@xero.com
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -30,7 +30,6 @@ import { Contacts } from '../model/accounting/contacts';
|
|
|
30
30
|
import { CreditNotes } from '../model/accounting/creditNotes';
|
|
31
31
|
import { Currencies } from '../model/accounting/currencies';
|
|
32
32
|
import { Currency } from '../model/accounting/currency';
|
|
33
|
-
import { Employees } from '../model/accounting/employees';
|
|
34
33
|
import { ExpenseClaims } from '../model/accounting/expenseClaims';
|
|
35
34
|
import { HistoryRecords } from '../model/accounting/historyRecords';
|
|
36
35
|
import { ImportSummaryObject } from '../model/accounting/importSummaryObject';
|
|
@@ -424,22 +423,6 @@ export declare class AccountingApi {
|
|
|
424
423
|
response: AxiosResponse;
|
|
425
424
|
body: Currencies;
|
|
426
425
|
}>;
|
|
427
|
-
/**
|
|
428
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
429
|
-
* @summary Creates new employees used in Xero payrun
|
|
430
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
431
|
-
* @param employees Employees with array of Employee object in body of request
|
|
432
|
-
* @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors
|
|
433
|
-
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
|
434
|
-
*/
|
|
435
|
-
createEmployees(xeroTenantId: string, employees: Employees, summarizeErrors?: boolean, idempotencyKey?: string, options?: {
|
|
436
|
-
headers: {
|
|
437
|
-
[name: string]: string;
|
|
438
|
-
};
|
|
439
|
-
}): Promise<{
|
|
440
|
-
response: AxiosResponse;
|
|
441
|
-
body: Employees;
|
|
442
|
-
}>;
|
|
443
426
|
/**
|
|
444
427
|
*
|
|
445
428
|
* @summary Creates a history record for a specific expense claim
|
|
@@ -1850,36 +1833,6 @@ export declare class AccountingApi {
|
|
|
1850
1833
|
response: AxiosResponse;
|
|
1851
1834
|
body: Currencies;
|
|
1852
1835
|
}>;
|
|
1853
|
-
/**
|
|
1854
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
1855
|
-
* @summary Retrieves a specific employee used in Xero payrun using a unique employee Id
|
|
1856
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
1857
|
-
* @param employeeID Unique identifier for a Employee
|
|
1858
|
-
*/
|
|
1859
|
-
getEmployee(xeroTenantId: string, employeeID: string, options?: {
|
|
1860
|
-
headers: {
|
|
1861
|
-
[name: string]: string;
|
|
1862
|
-
};
|
|
1863
|
-
}): Promise<{
|
|
1864
|
-
response: AxiosResponse;
|
|
1865
|
-
body: Employees;
|
|
1866
|
-
}>;
|
|
1867
|
-
/**
|
|
1868
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
1869
|
-
* @summary Retrieves employees used in Xero payrun
|
|
1870
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
1871
|
-
* @param ifModifiedSince Only records created or modified since this timestamp will be returned
|
|
1872
|
-
* @param where Filter by an any element
|
|
1873
|
-
* @param order Order by an any element
|
|
1874
|
-
*/
|
|
1875
|
-
getEmployees(xeroTenantId: string, ifModifiedSince?: Date, where?: string, order?: string, options?: {
|
|
1876
|
-
headers: {
|
|
1877
|
-
[name: string]: string;
|
|
1878
|
-
};
|
|
1879
|
-
}): Promise<{
|
|
1880
|
-
response: AxiosResponse;
|
|
1881
|
-
body: Employees;
|
|
1882
|
-
}>;
|
|
1883
1836
|
/**
|
|
1884
1837
|
*
|
|
1885
1838
|
* @summary Retrieves a specific expense claim using a unique expense claim Id
|
|
@@ -3504,22 +3457,6 @@ export declare class AccountingApi {
|
|
|
3504
3457
|
response: AxiosResponse;
|
|
3505
3458
|
body: CreditNotes;
|
|
3506
3459
|
}>;
|
|
3507
|
-
/**
|
|
3508
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
3509
|
-
* @summary Creates a single new employees used in Xero payrun
|
|
3510
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
3511
|
-
* @param employees Employees with array of Employee object in body of request
|
|
3512
|
-
* @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors
|
|
3513
|
-
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
|
3514
|
-
*/
|
|
3515
|
-
updateOrCreateEmployees(xeroTenantId: string, employees: Employees, summarizeErrors?: boolean, idempotencyKey?: string, options?: {
|
|
3516
|
-
headers: {
|
|
3517
|
-
[name: string]: string;
|
|
3518
|
-
};
|
|
3519
|
-
}): Promise<{
|
|
3520
|
-
response: AxiosResponse;
|
|
3521
|
-
body: Employees;
|
|
3522
|
-
}>;
|
|
3523
3460
|
/**
|
|
3524
3461
|
*
|
|
3525
3462
|
* @summary Updates or creates one or more sales invoices or purchase bills
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Xero Accounting API
|
|
4
4
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
*
|
|
6
|
-
* The version of the OpenAPI document:
|
|
6
|
+
* The version of the OpenAPI document: 14.0.0
|
|
7
7
|
* Contact: api@xero.com
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -39,7 +39,7 @@ var AccountingApiApiKeys;
|
|
|
39
39
|
class AccountingApi {
|
|
40
40
|
constructor(basePathOrUsername, password, basePath) {
|
|
41
41
|
this._basePath = defaultBasePath;
|
|
42
|
-
this.defaultHeaders = { 'user-agent': 'xero-node-
|
|
42
|
+
this.defaultHeaders = { 'user-agent': 'xero-node-17.0.0' };
|
|
43
43
|
this._useQuerystring = false;
|
|
44
44
|
this.binaryHeaders = {};
|
|
45
45
|
this.authentications = {
|
|
@@ -1856,83 +1856,6 @@ class AccountingApi {
|
|
|
1856
1856
|
});
|
|
1857
1857
|
});
|
|
1858
1858
|
}
|
|
1859
|
-
/**
|
|
1860
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
1861
|
-
* @summary Creates new employees used in Xero payrun
|
|
1862
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
1863
|
-
* @param employees Employees with array of Employee object in body of request
|
|
1864
|
-
* @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors
|
|
1865
|
-
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
|
1866
|
-
*/
|
|
1867
|
-
createEmployees(xeroTenantId_1, employees_1, summarizeErrors_1, idempotencyKey_1) {
|
|
1868
|
-
return __awaiter(this, arguments, void 0, function* (xeroTenantId, employees, summarizeErrors, idempotencyKey, options = { headers: {} }) {
|
|
1869
|
-
const localVarPath = this.basePath + '/Employees';
|
|
1870
|
-
let localVarQueryParameters = {};
|
|
1871
|
-
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
|
|
1872
|
-
let localVarFormParams = {};
|
|
1873
|
-
let acceptHeadersFromSpec = [
|
|
1874
|
-
"application/json"
|
|
1875
|
-
];
|
|
1876
|
-
const isBufferType = acceptHeadersFromSpec.includes("application/pdf") || acceptHeadersFromSpec.includes("application/octet-stream") || acceptHeadersFromSpec.includes("application/jpg");
|
|
1877
|
-
const responseTypeOption = isBufferType ? "arraybuffer" : "json";
|
|
1878
|
-
// verify required parameter 'xeroTenantId' is not null or undefined
|
|
1879
|
-
if (xeroTenantId === null || xeroTenantId === undefined) {
|
|
1880
|
-
throw new Error('Required parameter xeroTenantId was null or undefined when calling createEmployees.');
|
|
1881
|
-
}
|
|
1882
|
-
// verify required parameter 'employees' is not null or undefined
|
|
1883
|
-
if (employees === null || employees === undefined) {
|
|
1884
|
-
throw new Error('Required parameter employees was null or undefined when calling createEmployees.');
|
|
1885
|
-
}
|
|
1886
|
-
if (summarizeErrors !== undefined) {
|
|
1887
|
-
localVarQueryParameters['summarizeErrors'] = models_1.ObjectSerializer.serialize(summarizeErrors, "boolean");
|
|
1888
|
-
}
|
|
1889
|
-
localVarHeaderParams['xero-tenant-id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
|
|
1890
|
-
localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
|
|
1891
|
-
localVarHeaderParams['Accept'] = acceptHeadersFromSpec.join();
|
|
1892
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
1893
|
-
let localVarUseFormData = false;
|
|
1894
|
-
let localVarRequestOptions = {
|
|
1895
|
-
method: 'PUT',
|
|
1896
|
-
params: localVarQueryParameters,
|
|
1897
|
-
headers: localVarHeaderParams,
|
|
1898
|
-
url: localVarPath,
|
|
1899
|
-
responseType: responseTypeOption,
|
|
1900
|
-
data: models_1.ObjectSerializer.serialize(employees, "Employees"),
|
|
1901
|
-
};
|
|
1902
|
-
let authenticationPromise = Promise.resolve();
|
|
1903
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
|
|
1904
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1905
|
-
return authenticationPromise.then(() => {
|
|
1906
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1907
|
-
if (localVarUseFormData) {
|
|
1908
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
1909
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'Content-Type': 'multipart/form-data' });
|
|
1910
|
-
}
|
|
1911
|
-
else {
|
|
1912
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
1913
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'content-type': 'application/x-www-form-urlencoded' });
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
1917
|
-
let body = null;
|
|
1918
|
-
try {
|
|
1919
|
-
const response = yield (0, axios_1.default)(localVarRequestOptions);
|
|
1920
|
-
body = models_1.ObjectSerializer.deserialize(response.data, "Employees");
|
|
1921
|
-
if (response.status && response.status >= 200 && response.status <= 299) {
|
|
1922
|
-
resolve({ response: response, body: body });
|
|
1923
|
-
}
|
|
1924
|
-
else {
|
|
1925
|
-
reject({ response: response, body: body });
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
catch (error) {
|
|
1929
|
-
const errorResponse = new ApiError_1.ApiError(error);
|
|
1930
|
-
reject(JSON.stringify(errorResponse.generateError()));
|
|
1931
|
-
}
|
|
1932
|
-
}));
|
|
1933
|
-
});
|
|
1934
|
-
});
|
|
1935
|
-
}
|
|
1936
1859
|
/**
|
|
1937
1860
|
*
|
|
1938
1861
|
* @summary Creates a history record for a specific expense claim
|
|
@@ -9116,154 +9039,6 @@ class AccountingApi {
|
|
|
9116
9039
|
});
|
|
9117
9040
|
});
|
|
9118
9041
|
}
|
|
9119
|
-
/**
|
|
9120
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
9121
|
-
* @summary Retrieves a specific employee used in Xero payrun using a unique employee Id
|
|
9122
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
9123
|
-
* @param employeeID Unique identifier for a Employee
|
|
9124
|
-
*/
|
|
9125
|
-
getEmployee(xeroTenantId_1, employeeID_1) {
|
|
9126
|
-
return __awaiter(this, arguments, void 0, function* (xeroTenantId, employeeID, options = { headers: {} }) {
|
|
9127
|
-
const localVarPath = this.basePath + '/Employees/{EmployeeID}'
|
|
9128
|
-
.replace('{' + 'EmployeeID' + '}', encodeURIComponent(String(employeeID)));
|
|
9129
|
-
let localVarQueryParameters = {};
|
|
9130
|
-
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
|
|
9131
|
-
let localVarFormParams = {};
|
|
9132
|
-
let acceptHeadersFromSpec = [
|
|
9133
|
-
"application/json"
|
|
9134
|
-
];
|
|
9135
|
-
const isBufferType = acceptHeadersFromSpec.includes("application/pdf") || acceptHeadersFromSpec.includes("application/octet-stream") || acceptHeadersFromSpec.includes("application/jpg");
|
|
9136
|
-
const responseTypeOption = isBufferType ? "arraybuffer" : "json";
|
|
9137
|
-
// verify required parameter 'xeroTenantId' is not null or undefined
|
|
9138
|
-
if (xeroTenantId === null || xeroTenantId === undefined) {
|
|
9139
|
-
throw new Error('Required parameter xeroTenantId was null or undefined when calling getEmployee.');
|
|
9140
|
-
}
|
|
9141
|
-
// verify required parameter 'employeeID' is not null or undefined
|
|
9142
|
-
if (employeeID === null || employeeID === undefined) {
|
|
9143
|
-
throw new Error('Required parameter employeeID was null or undefined when calling getEmployee.');
|
|
9144
|
-
}
|
|
9145
|
-
localVarHeaderParams['xero-tenant-id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
|
|
9146
|
-
localVarHeaderParams['Accept'] = acceptHeadersFromSpec.join();
|
|
9147
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
9148
|
-
let localVarUseFormData = false;
|
|
9149
|
-
let localVarRequestOptions = {
|
|
9150
|
-
method: 'GET',
|
|
9151
|
-
params: localVarQueryParameters,
|
|
9152
|
-
headers: localVarHeaderParams,
|
|
9153
|
-
url: localVarPath,
|
|
9154
|
-
responseType: responseTypeOption,
|
|
9155
|
-
data: {},
|
|
9156
|
-
};
|
|
9157
|
-
let authenticationPromise = Promise.resolve();
|
|
9158
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
|
|
9159
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
9160
|
-
return authenticationPromise.then(() => {
|
|
9161
|
-
if (Object.keys(localVarFormParams).length) {
|
|
9162
|
-
if (localVarUseFormData) {
|
|
9163
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
9164
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'Content-Type': 'multipart/form-data' });
|
|
9165
|
-
}
|
|
9166
|
-
else {
|
|
9167
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
9168
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'content-type': 'application/x-www-form-urlencoded' });
|
|
9169
|
-
}
|
|
9170
|
-
}
|
|
9171
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
9172
|
-
let body = null;
|
|
9173
|
-
try {
|
|
9174
|
-
const response = yield (0, axios_1.default)(localVarRequestOptions);
|
|
9175
|
-
body = models_1.ObjectSerializer.deserialize(response.data, "Employees");
|
|
9176
|
-
if (response.status && response.status >= 200 && response.status <= 299) {
|
|
9177
|
-
resolve({ response: response, body: body });
|
|
9178
|
-
}
|
|
9179
|
-
else {
|
|
9180
|
-
reject({ response: response, body: body });
|
|
9181
|
-
}
|
|
9182
|
-
}
|
|
9183
|
-
catch (error) {
|
|
9184
|
-
const errorResponse = new ApiError_1.ApiError(error);
|
|
9185
|
-
reject(JSON.stringify(errorResponse.generateError()));
|
|
9186
|
-
}
|
|
9187
|
-
}));
|
|
9188
|
-
});
|
|
9189
|
-
});
|
|
9190
|
-
}
|
|
9191
|
-
/**
|
|
9192
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
9193
|
-
* @summary Retrieves employees used in Xero payrun
|
|
9194
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
9195
|
-
* @param ifModifiedSince Only records created or modified since this timestamp will be returned
|
|
9196
|
-
* @param where Filter by an any element
|
|
9197
|
-
* @param order Order by an any element
|
|
9198
|
-
*/
|
|
9199
|
-
getEmployees(xeroTenantId_1, ifModifiedSince_1, where_1, order_1) {
|
|
9200
|
-
return __awaiter(this, arguments, void 0, function* (xeroTenantId, ifModifiedSince, where, order, options = { headers: {} }) {
|
|
9201
|
-
const localVarPath = this.basePath + '/Employees';
|
|
9202
|
-
let localVarQueryParameters = {};
|
|
9203
|
-
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
|
|
9204
|
-
let localVarFormParams = {};
|
|
9205
|
-
let acceptHeadersFromSpec = [
|
|
9206
|
-
"application/json"
|
|
9207
|
-
];
|
|
9208
|
-
const isBufferType = acceptHeadersFromSpec.includes("application/pdf") || acceptHeadersFromSpec.includes("application/octet-stream") || acceptHeadersFromSpec.includes("application/jpg");
|
|
9209
|
-
const responseTypeOption = isBufferType ? "arraybuffer" : "json";
|
|
9210
|
-
// verify required parameter 'xeroTenantId' is not null or undefined
|
|
9211
|
-
if (xeroTenantId === null || xeroTenantId === undefined) {
|
|
9212
|
-
throw new Error('Required parameter xeroTenantId was null or undefined when calling getEmployees.');
|
|
9213
|
-
}
|
|
9214
|
-
if (where !== undefined) {
|
|
9215
|
-
localVarQueryParameters['where'] = models_1.ObjectSerializer.serialize(where, "string");
|
|
9216
|
-
}
|
|
9217
|
-
if (order !== undefined) {
|
|
9218
|
-
localVarQueryParameters['order'] = models_1.ObjectSerializer.serialize(order, "string");
|
|
9219
|
-
}
|
|
9220
|
-
localVarHeaderParams['xero-tenant-id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
|
|
9221
|
-
localVarHeaderParams['If-Modified-Since'] = models_1.ObjectSerializer.serialize(ifModifiedSince, "Date");
|
|
9222
|
-
localVarHeaderParams['Accept'] = acceptHeadersFromSpec.join();
|
|
9223
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
9224
|
-
let localVarUseFormData = false;
|
|
9225
|
-
let localVarRequestOptions = {
|
|
9226
|
-
method: 'GET',
|
|
9227
|
-
params: localVarQueryParameters,
|
|
9228
|
-
headers: localVarHeaderParams,
|
|
9229
|
-
url: localVarPath,
|
|
9230
|
-
responseType: responseTypeOption,
|
|
9231
|
-
data: {},
|
|
9232
|
-
};
|
|
9233
|
-
let authenticationPromise = Promise.resolve();
|
|
9234
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
|
|
9235
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
9236
|
-
return authenticationPromise.then(() => {
|
|
9237
|
-
if (Object.keys(localVarFormParams).length) {
|
|
9238
|
-
if (localVarUseFormData) {
|
|
9239
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
9240
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'Content-Type': 'multipart/form-data' });
|
|
9241
|
-
}
|
|
9242
|
-
else {
|
|
9243
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
9244
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'content-type': 'application/x-www-form-urlencoded' });
|
|
9245
|
-
}
|
|
9246
|
-
}
|
|
9247
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
9248
|
-
let body = null;
|
|
9249
|
-
try {
|
|
9250
|
-
const response = yield (0, axios_1.default)(localVarRequestOptions);
|
|
9251
|
-
body = models_1.ObjectSerializer.deserialize(response.data, "Employees");
|
|
9252
|
-
if (response.status && response.status >= 200 && response.status <= 299) {
|
|
9253
|
-
resolve({ response: response, body: body });
|
|
9254
|
-
}
|
|
9255
|
-
else {
|
|
9256
|
-
reject({ response: response, body: body });
|
|
9257
|
-
}
|
|
9258
|
-
}
|
|
9259
|
-
catch (error) {
|
|
9260
|
-
const errorResponse = new ApiError_1.ApiError(error);
|
|
9261
|
-
reject(JSON.stringify(errorResponse.generateError()));
|
|
9262
|
-
}
|
|
9263
|
-
}));
|
|
9264
|
-
});
|
|
9265
|
-
});
|
|
9266
|
-
}
|
|
9267
9042
|
/**
|
|
9268
9043
|
*
|
|
9269
9044
|
* @summary Retrieves a specific expense claim using a unique expense claim Id
|
|
@@ -17541,83 +17316,6 @@ class AccountingApi {
|
|
|
17541
17316
|
});
|
|
17542
17317
|
});
|
|
17543
17318
|
}
|
|
17544
|
-
/**
|
|
17545
|
-
* This endpoint is deprecated and will be removed April 28, 2026
|
|
17546
|
-
* @summary Creates a single new employees used in Xero payrun
|
|
17547
|
-
* @param xeroTenantId Xero identifier for Tenant
|
|
17548
|
-
* @param employees Employees with array of Employee object in body of request
|
|
17549
|
-
* @param summarizeErrors If false return 200 OK and mix of successfully created objects and any with validation errors
|
|
17550
|
-
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
|
17551
|
-
*/
|
|
17552
|
-
updateOrCreateEmployees(xeroTenantId_1, employees_1, summarizeErrors_1, idempotencyKey_1) {
|
|
17553
|
-
return __awaiter(this, arguments, void 0, function* (xeroTenantId, employees, summarizeErrors, idempotencyKey, options = { headers: {} }) {
|
|
17554
|
-
const localVarPath = this.basePath + '/Employees';
|
|
17555
|
-
let localVarQueryParameters = {};
|
|
17556
|
-
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
|
|
17557
|
-
let localVarFormParams = {};
|
|
17558
|
-
let acceptHeadersFromSpec = [
|
|
17559
|
-
"application/json"
|
|
17560
|
-
];
|
|
17561
|
-
const isBufferType = acceptHeadersFromSpec.includes("application/pdf") || acceptHeadersFromSpec.includes("application/octet-stream") || acceptHeadersFromSpec.includes("application/jpg");
|
|
17562
|
-
const responseTypeOption = isBufferType ? "arraybuffer" : "json";
|
|
17563
|
-
// verify required parameter 'xeroTenantId' is not null or undefined
|
|
17564
|
-
if (xeroTenantId === null || xeroTenantId === undefined) {
|
|
17565
|
-
throw new Error('Required parameter xeroTenantId was null or undefined when calling updateOrCreateEmployees.');
|
|
17566
|
-
}
|
|
17567
|
-
// verify required parameter 'employees' is not null or undefined
|
|
17568
|
-
if (employees === null || employees === undefined) {
|
|
17569
|
-
throw new Error('Required parameter employees was null or undefined when calling updateOrCreateEmployees.');
|
|
17570
|
-
}
|
|
17571
|
-
if (summarizeErrors !== undefined) {
|
|
17572
|
-
localVarQueryParameters['summarizeErrors'] = models_1.ObjectSerializer.serialize(summarizeErrors, "boolean");
|
|
17573
|
-
}
|
|
17574
|
-
localVarHeaderParams['xero-tenant-id'] = models_1.ObjectSerializer.serialize(xeroTenantId, "string");
|
|
17575
|
-
localVarHeaderParams['Idempotency-Key'] = models_1.ObjectSerializer.serialize(idempotencyKey, "string");
|
|
17576
|
-
localVarHeaderParams['Accept'] = acceptHeadersFromSpec.join();
|
|
17577
|
-
Object.assign(localVarHeaderParams, options.headers);
|
|
17578
|
-
let localVarUseFormData = false;
|
|
17579
|
-
let localVarRequestOptions = {
|
|
17580
|
-
method: 'POST',
|
|
17581
|
-
params: localVarQueryParameters,
|
|
17582
|
-
headers: localVarHeaderParams,
|
|
17583
|
-
url: localVarPath,
|
|
17584
|
-
responseType: responseTypeOption,
|
|
17585
|
-
data: models_1.ObjectSerializer.serialize(employees, "Employees"),
|
|
17586
|
-
};
|
|
17587
|
-
let authenticationPromise = Promise.resolve();
|
|
17588
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
|
|
17589
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
17590
|
-
return authenticationPromise.then(() => {
|
|
17591
|
-
if (Object.keys(localVarFormParams).length) {
|
|
17592
|
-
if (localVarUseFormData) {
|
|
17593
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
17594
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'Content-Type': 'multipart/form-data' });
|
|
17595
|
-
}
|
|
17596
|
-
else {
|
|
17597
|
-
localVarRequestOptions.data = localVarFormParams;
|
|
17598
|
-
localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarRequestOptions.headers), { 'content-type': 'application/x-www-form-urlencoded' });
|
|
17599
|
-
}
|
|
17600
|
-
}
|
|
17601
|
-
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
17602
|
-
let body = null;
|
|
17603
|
-
try {
|
|
17604
|
-
const response = yield (0, axios_1.default)(localVarRequestOptions);
|
|
17605
|
-
body = models_1.ObjectSerializer.deserialize(response.data, "Employees");
|
|
17606
|
-
if (response.status && response.status >= 200 && response.status <= 299) {
|
|
17607
|
-
resolve({ response: response, body: body });
|
|
17608
|
-
}
|
|
17609
|
-
else {
|
|
17610
|
-
reject({ response: response, body: body });
|
|
17611
|
-
}
|
|
17612
|
-
}
|
|
17613
|
-
catch (error) {
|
|
17614
|
-
const errorResponse = new ApiError_1.ApiError(error);
|
|
17615
|
-
reject(JSON.stringify(errorResponse.generateError()));
|
|
17616
|
-
}
|
|
17617
|
-
}));
|
|
17618
|
-
});
|
|
17619
|
-
});
|
|
17620
|
-
}
|
|
17621
17319
|
/**
|
|
17622
17320
|
*
|
|
17623
17321
|
* @summary Updates or creates one or more sales invoices or purchase bills
|