xero-node 5.0.0 → 5.1.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.
Files changed (36) hide show
  1. package/README.md +10 -10
  2. package/dist/XeroClient.js.map +1 -1
  3. package/dist/gen/api/accountingApi.d.ts +25 -23
  4. package/dist/gen/api/accountingApi.js +113 -68
  5. package/dist/gen/api/accountingApi.js.map +1 -1
  6. package/dist/gen/api/appStoreApi.d.ts +1 -1
  7. package/dist/gen/api/appStoreApi.js +2 -2
  8. package/dist/gen/api/appStoreApi.js.map +1 -1
  9. package/dist/gen/api/assetApi.d.ts +1 -1
  10. package/dist/gen/api/assetApi.js +2 -2
  11. package/dist/gen/api/assetApi.js.map +1 -1
  12. package/dist/gen/api/bankfeedsApi.d.ts +1 -1
  13. package/dist/gen/api/bankfeedsApi.js +2 -2
  14. package/dist/gen/api/bankfeedsApi.js.map +1 -1
  15. package/dist/gen/api/filesApi.d.ts +5 -3
  16. package/dist/gen/api/filesApi.js +2 -2
  17. package/dist/gen/api/filesApi.js.map +1 -1
  18. package/dist/gen/api/financeApi.d.ts +1 -1
  19. package/dist/gen/api/financeApi.js +2 -2
  20. package/dist/gen/api/financeApi.js.map +1 -1
  21. package/dist/gen/api/payrollAUApi.d.ts +1 -1
  22. package/dist/gen/api/payrollAUApi.js +2 -2
  23. package/dist/gen/api/payrollAUApi.js.map +1 -1
  24. package/dist/gen/api/payrollNZApi.d.ts +1 -1
  25. package/dist/gen/api/payrollNZApi.js +2 -2
  26. package/dist/gen/api/payrollNZApi.js.map +1 -1
  27. package/dist/gen/api/payrollUKApi.d.ts +1 -1
  28. package/dist/gen/api/payrollUKApi.js +2 -2
  29. package/dist/gen/api/payrollUKApi.js.map +1 -1
  30. package/dist/gen/api/projectApi.d.ts +1 -1
  31. package/dist/gen/api/projectApi.js +2 -2
  32. package/dist/gen/api/projectApi.js.map +1 -1
  33. package/dist/gen/model/accounting/payment.d.ts +4 -0
  34. package/dist/gen/model/accounting/payment.js +5 -0
  35. package/dist/gen/model/accounting/payment.js.map +1 -1
  36. package/package.json +8 -10
@@ -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: 3.0.0
6
+ * The version of the OpenAPI document: 3.0.1
7
7
  * Contact: api@xero.com
8
8
  *
9
9
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -27,6 +27,7 @@ exports.AccountingApi = exports.AccountingApiApiKeys = void 0;
27
27
  const models_1 = require("../model/accounting/models");
28
28
  const ApiError_1 = require("../../model/ApiError");
29
29
  const axios_1 = __importDefault(require("axios"));
30
+ const stream_1 = require("stream");
30
31
  const models_2 = require("../model/accounting/models");
31
32
  let defaultBasePath = 'https://api.xero.com/api.xro/2.0';
32
33
  // ===============================================
@@ -38,7 +39,7 @@ var AccountingApiApiKeys;
38
39
  class AccountingApi {
39
40
  constructor(basePathOrUsername, password, basePath) {
40
41
  this._basePath = defaultBasePath;
41
- this.defaultHeaders = { 'user-agent': 'xero-node-5.0.0' };
42
+ this.defaultHeaders = { 'user-agent': 'xero-node-5.1.0' };
42
43
  this._useQuerystring = false;
43
44
  this.binaryHeaders = {};
44
45
  this.authentications = {
@@ -218,14 +219,16 @@ class AccountingApi {
218
219
  // Reads file stream as chunks so we can put it in body of request.
219
220
  // This collects the whole file into memory, which is why we do it _after_ authentication.
220
221
  return new Promise((resolve, reject) => {
222
+ let bodyStream;
223
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
221
224
  const fileContents = [];
222
- body.on('data', (chunk) => {
225
+ bodyStream.on('data', (chunk) => {
223
226
  fileContents.push(chunk);
224
227
  });
225
- body.on('end', () => {
228
+ bodyStream.on('end', () => {
226
229
  resolve(fileContents);
227
230
  });
228
- body.on('error', (err) => {
231
+ bodyStream.on('error', (err) => {
229
232
  reject(err);
230
233
  });
231
234
  });
@@ -328,14 +331,16 @@ class AccountingApi {
328
331
  // Reads file stream as chunks so we can put it in body of request.
329
332
  // This collects the whole file into memory, which is why we do it _after_ authentication.
330
333
  return new Promise((resolve, reject) => {
334
+ let bodyStream;
335
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
331
336
  const fileContents = [];
332
- body.on('data', (chunk) => {
337
+ bodyStream.on('data', (chunk) => {
333
338
  fileContents.push(chunk);
334
339
  });
335
- body.on('end', () => {
340
+ bodyStream.on('end', () => {
336
341
  resolve(fileContents);
337
342
  });
338
- body.on('error', (err) => {
343
+ bodyStream.on('error', (err) => {
339
344
  reject(err);
340
345
  });
341
346
  });
@@ -670,14 +675,16 @@ class AccountingApi {
670
675
  // Reads file stream as chunks so we can put it in body of request.
671
676
  // This collects the whole file into memory, which is why we do it _after_ authentication.
672
677
  return new Promise((resolve, reject) => {
678
+ let bodyStream;
679
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
673
680
  const fileContents = [];
674
- body.on('data', (chunk) => {
681
+ bodyStream.on('data', (chunk) => {
675
682
  fileContents.push(chunk);
676
683
  });
677
- body.on('end', () => {
684
+ bodyStream.on('end', () => {
678
685
  resolve(fileContents);
679
686
  });
680
- body.on('error', (err) => {
687
+ bodyStream.on('error', (err) => {
681
688
  reject(err);
682
689
  });
683
690
  });
@@ -1093,14 +1100,16 @@ class AccountingApi {
1093
1100
  // Reads file stream as chunks so we can put it in body of request.
1094
1101
  // This collects the whole file into memory, which is why we do it _after_ authentication.
1095
1102
  return new Promise((resolve, reject) => {
1103
+ let bodyStream;
1104
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
1096
1105
  const fileContents = [];
1097
- body.on('data', (chunk) => {
1106
+ bodyStream.on('data', (chunk) => {
1098
1107
  fileContents.push(chunk);
1099
1108
  });
1100
- body.on('end', () => {
1109
+ bodyStream.on('end', () => {
1101
1110
  resolve(fileContents);
1102
1111
  });
1103
- body.on('error', (err) => {
1112
+ bodyStream.on('error', (err) => {
1104
1113
  reject(err);
1105
1114
  });
1106
1115
  });
@@ -1598,14 +1607,16 @@ class AccountingApi {
1598
1607
  // Reads file stream as chunks so we can put it in body of request.
1599
1608
  // This collects the whole file into memory, which is why we do it _after_ authentication.
1600
1609
  return new Promise((resolve, reject) => {
1610
+ let bodyStream;
1611
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
1601
1612
  const fileContents = [];
1602
- body.on('data', (chunk) => {
1613
+ bodyStream.on('data', (chunk) => {
1603
1614
  fileContents.push(chunk);
1604
1615
  });
1605
- body.on('end', () => {
1616
+ bodyStream.on('end', () => {
1606
1617
  resolve(fileContents);
1607
1618
  });
1608
- body.on('error', (err) => {
1619
+ bodyStream.on('error', (err) => {
1609
1620
  reject(err);
1610
1621
  });
1611
1622
  });
@@ -2174,14 +2185,16 @@ class AccountingApi {
2174
2185
  // Reads file stream as chunks so we can put it in body of request.
2175
2186
  // This collects the whole file into memory, which is why we do it _after_ authentication.
2176
2187
  return new Promise((resolve, reject) => {
2188
+ let bodyStream;
2189
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
2177
2190
  const fileContents = [];
2178
- body.on('data', (chunk) => {
2191
+ bodyStream.on('data', (chunk) => {
2179
2192
  fileContents.push(chunk);
2180
2193
  });
2181
- body.on('end', () => {
2194
+ bodyStream.on('end', () => {
2182
2195
  resolve(fileContents);
2183
2196
  });
2184
- body.on('error', (err) => {
2197
+ bodyStream.on('error', (err) => {
2185
2198
  reject(err);
2186
2199
  });
2187
2200
  });
@@ -2677,14 +2690,16 @@ class AccountingApi {
2677
2690
  // Reads file stream as chunks so we can put it in body of request.
2678
2691
  // This collects the whole file into memory, which is why we do it _after_ authentication.
2679
2692
  return new Promise((resolve, reject) => {
2693
+ let bodyStream;
2694
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
2680
2695
  const fileContents = [];
2681
- body.on('data', (chunk) => {
2696
+ bodyStream.on('data', (chunk) => {
2682
2697
  fileContents.push(chunk);
2683
2698
  });
2684
- body.on('end', () => {
2699
+ bodyStream.on('end', () => {
2685
2700
  resolve(fileContents);
2686
2701
  });
2687
- body.on('error', (err) => {
2702
+ bodyStream.on('error', (err) => {
2688
2703
  reject(err);
2689
2704
  });
2690
2705
  });
@@ -3569,14 +3584,16 @@ class AccountingApi {
3569
3584
  // Reads file stream as chunks so we can put it in body of request.
3570
3585
  // This collects the whole file into memory, which is why we do it _after_ authentication.
3571
3586
  return new Promise((resolve, reject) => {
3587
+ let bodyStream;
3588
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
3572
3589
  const fileContents = [];
3573
- body.on('data', (chunk) => {
3590
+ bodyStream.on('data', (chunk) => {
3574
3591
  fileContents.push(chunk);
3575
3592
  });
3576
- body.on('end', () => {
3593
+ bodyStream.on('end', () => {
3577
3594
  resolve(fileContents);
3578
3595
  });
3579
- body.on('error', (err) => {
3596
+ bodyStream.on('error', (err) => {
3580
3597
  reject(err);
3581
3598
  });
3582
3599
  });
@@ -3835,14 +3852,16 @@ class AccountingApi {
3835
3852
  // Reads file stream as chunks so we can put it in body of request.
3836
3853
  // This collects the whole file into memory, which is why we do it _after_ authentication.
3837
3854
  return new Promise((resolve, reject) => {
3855
+ let bodyStream;
3856
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
3838
3857
  const fileContents = [];
3839
- body.on('data', (chunk) => {
3858
+ bodyStream.on('data', (chunk) => {
3840
3859
  fileContents.push(chunk);
3841
3860
  });
3842
- body.on('end', () => {
3861
+ bodyStream.on('end', () => {
3843
3862
  resolve(fileContents);
3844
3863
  });
3845
- body.on('error', (err) => {
3864
+ bodyStream.on('error', (err) => {
3846
3865
  reject(err);
3847
3866
  });
3848
3867
  });
@@ -4178,14 +4197,16 @@ class AccountingApi {
4178
4197
  // Reads file stream as chunks so we can put it in body of request.
4179
4198
  // This collects the whole file into memory, which is why we do it _after_ authentication.
4180
4199
  return new Promise((resolve, reject) => {
4200
+ let bodyStream;
4201
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
4181
4202
  const fileContents = [];
4182
- body.on('data', (chunk) => {
4203
+ bodyStream.on('data', (chunk) => {
4183
4204
  fileContents.push(chunk);
4184
4205
  });
4185
- body.on('end', () => {
4206
+ bodyStream.on('end', () => {
4186
4207
  resolve(fileContents);
4187
4208
  });
4188
- body.on('error', (err) => {
4209
+ bodyStream.on('error', (err) => {
4189
4210
  reject(err);
4190
4211
  });
4191
4212
  });
@@ -4367,14 +4388,16 @@ class AccountingApi {
4367
4388
  // Reads file stream as chunks so we can put it in body of request.
4368
4389
  // This collects the whole file into memory, which is why we do it _after_ authentication.
4369
4390
  return new Promise((resolve, reject) => {
4391
+ let bodyStream;
4392
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
4370
4393
  const fileContents = [];
4371
- body.on('data', (chunk) => {
4394
+ bodyStream.on('data', (chunk) => {
4372
4395
  fileContents.push(chunk);
4373
4396
  });
4374
- body.on('end', () => {
4397
+ bodyStream.on('end', () => {
4375
4398
  resolve(fileContents);
4376
4399
  });
4377
- body.on('error', (err) => {
4400
+ bodyStream.on('error', (err) => {
4378
4401
  reject(err);
4379
4402
  });
4380
4403
  });
@@ -15881,14 +15904,16 @@ class AccountingApi {
15881
15904
  // Reads file stream as chunks so we can put it in body of request.
15882
15905
  // This collects the whole file into memory, which is why we do it _after_ authentication.
15883
15906
  return new Promise((resolve, reject) => {
15907
+ let bodyStream;
15908
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
15884
15909
  const fileContents = [];
15885
- body.on('data', (chunk) => {
15910
+ bodyStream.on('data', (chunk) => {
15886
15911
  fileContents.push(chunk);
15887
15912
  });
15888
- body.on('end', () => {
15913
+ bodyStream.on('end', () => {
15889
15914
  resolve(fileContents);
15890
15915
  });
15891
- body.on('error', (err) => {
15916
+ bodyStream.on('error', (err) => {
15892
15917
  reject(err);
15893
15918
  });
15894
15919
  });
@@ -16074,14 +16099,16 @@ class AccountingApi {
16074
16099
  // Reads file stream as chunks so we can put it in body of request.
16075
16100
  // This collects the whole file into memory, which is why we do it _after_ authentication.
16076
16101
  return new Promise((resolve, reject) => {
16102
+ let bodyStream;
16103
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
16077
16104
  const fileContents = [];
16078
- body.on('data', (chunk) => {
16105
+ bodyStream.on('data', (chunk) => {
16079
16106
  fileContents.push(chunk);
16080
16107
  });
16081
- body.on('end', () => {
16108
+ bodyStream.on('end', () => {
16082
16109
  resolve(fileContents);
16083
16110
  });
16084
- body.on('error', (err) => {
16111
+ bodyStream.on('error', (err) => {
16085
16112
  reject(err);
16086
16113
  });
16087
16114
  });
@@ -16183,14 +16210,16 @@ class AccountingApi {
16183
16210
  // Reads file stream as chunks so we can put it in body of request.
16184
16211
  // This collects the whole file into memory, which is why we do it _after_ authentication.
16185
16212
  return new Promise((resolve, reject) => {
16213
+ let bodyStream;
16214
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
16186
16215
  const fileContents = [];
16187
- body.on('data', (chunk) => {
16216
+ bodyStream.on('data', (chunk) => {
16188
16217
  fileContents.push(chunk);
16189
16218
  });
16190
- body.on('end', () => {
16219
+ bodyStream.on('end', () => {
16191
16220
  resolve(fileContents);
16192
16221
  });
16193
- body.on('error', (err) => {
16222
+ bodyStream.on('error', (err) => {
16194
16223
  reject(err);
16195
16224
  });
16196
16225
  });
@@ -16371,14 +16400,16 @@ class AccountingApi {
16371
16400
  // Reads file stream as chunks so we can put it in body of request.
16372
16401
  // This collects the whole file into memory, which is why we do it _after_ authentication.
16373
16402
  return new Promise((resolve, reject) => {
16403
+ let bodyStream;
16404
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
16374
16405
  const fileContents = [];
16375
- body.on('data', (chunk) => {
16406
+ bodyStream.on('data', (chunk) => {
16376
16407
  fileContents.push(chunk);
16377
16408
  });
16378
- body.on('end', () => {
16409
+ bodyStream.on('end', () => {
16379
16410
  resolve(fileContents);
16380
16411
  });
16381
- body.on('error', (err) => {
16412
+ bodyStream.on('error', (err) => {
16382
16413
  reject(err);
16383
16414
  });
16384
16415
  });
@@ -16643,14 +16674,16 @@ class AccountingApi {
16643
16674
  // Reads file stream as chunks so we can put it in body of request.
16644
16675
  // This collects the whole file into memory, which is why we do it _after_ authentication.
16645
16676
  return new Promise((resolve, reject) => {
16677
+ let bodyStream;
16678
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
16646
16679
  const fileContents = [];
16647
- body.on('data', (chunk) => {
16680
+ bodyStream.on('data', (chunk) => {
16648
16681
  fileContents.push(chunk);
16649
16682
  });
16650
- body.on('end', () => {
16683
+ bodyStream.on('end', () => {
16651
16684
  resolve(fileContents);
16652
16685
  });
16653
- body.on('error', (err) => {
16686
+ bodyStream.on('error', (err) => {
16654
16687
  reject(err);
16655
16688
  });
16656
16689
  });
@@ -16915,14 +16948,16 @@ class AccountingApi {
16915
16948
  // Reads file stream as chunks so we can put it in body of request.
16916
16949
  // This collects the whole file into memory, which is why we do it _after_ authentication.
16917
16950
  return new Promise((resolve, reject) => {
16951
+ let bodyStream;
16952
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
16918
16953
  const fileContents = [];
16919
- body.on('data', (chunk) => {
16954
+ bodyStream.on('data', (chunk) => {
16920
16955
  fileContents.push(chunk);
16921
16956
  });
16922
- body.on('end', () => {
16957
+ bodyStream.on('end', () => {
16923
16958
  resolve(fileContents);
16924
16959
  });
16925
- body.on('error', (err) => {
16960
+ bodyStream.on('error', (err) => {
16926
16961
  reject(err);
16927
16962
  });
16928
16963
  });
@@ -17266,14 +17301,16 @@ class AccountingApi {
17266
17301
  // Reads file stream as chunks so we can put it in body of request.
17267
17302
  // This collects the whole file into memory, which is why we do it _after_ authentication.
17268
17303
  return new Promise((resolve, reject) => {
17304
+ let bodyStream;
17305
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
17269
17306
  const fileContents = [];
17270
- body.on('data', (chunk) => {
17307
+ bodyStream.on('data', (chunk) => {
17271
17308
  fileContents.push(chunk);
17272
17309
  });
17273
- body.on('end', () => {
17310
+ bodyStream.on('end', () => {
17274
17311
  resolve(fileContents);
17275
17312
  });
17276
- body.on('error', (err) => {
17313
+ bodyStream.on('error', (err) => {
17277
17314
  reject(err);
17278
17315
  });
17279
17316
  });
@@ -18241,14 +18278,16 @@ class AccountingApi {
18241
18278
  // Reads file stream as chunks so we can put it in body of request.
18242
18279
  // This collects the whole file into memory, which is why we do it _after_ authentication.
18243
18280
  return new Promise((resolve, reject) => {
18281
+ let bodyStream;
18282
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
18244
18283
  const fileContents = [];
18245
- body.on('data', (chunk) => {
18284
+ bodyStream.on('data', (chunk) => {
18246
18285
  fileContents.push(chunk);
18247
18286
  });
18248
- body.on('end', () => {
18287
+ bodyStream.on('end', () => {
18249
18288
  resolve(fileContents);
18250
18289
  });
18251
- body.on('error', (err) => {
18290
+ bodyStream.on('error', (err) => {
18252
18291
  reject(err);
18253
18292
  });
18254
18293
  });
@@ -18430,14 +18469,16 @@ class AccountingApi {
18430
18469
  // Reads file stream as chunks so we can put it in body of request.
18431
18470
  // This collects the whole file into memory, which is why we do it _after_ authentication.
18432
18471
  return new Promise((resolve, reject) => {
18472
+ let bodyStream;
18473
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
18433
18474
  const fileContents = [];
18434
- body.on('data', (chunk) => {
18475
+ bodyStream.on('data', (chunk) => {
18435
18476
  fileContents.push(chunk);
18436
18477
  });
18437
- body.on('end', () => {
18478
+ bodyStream.on('end', () => {
18438
18479
  resolve(fileContents);
18439
18480
  });
18440
- body.on('error', (err) => {
18481
+ bodyStream.on('error', (err) => {
18441
18482
  reject(err);
18442
18483
  });
18443
18484
  });
@@ -18623,14 +18664,16 @@ class AccountingApi {
18623
18664
  // Reads file stream as chunks so we can put it in body of request.
18624
18665
  // This collects the whole file into memory, which is why we do it _after_ authentication.
18625
18666
  return new Promise((resolve, reject) => {
18667
+ let bodyStream;
18668
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
18626
18669
  const fileContents = [];
18627
- body.on('data', (chunk) => {
18670
+ bodyStream.on('data', (chunk) => {
18628
18671
  fileContents.push(chunk);
18629
18672
  });
18630
- body.on('end', () => {
18673
+ bodyStream.on('end', () => {
18631
18674
  resolve(fileContents);
18632
18675
  });
18633
- body.on('error', (err) => {
18676
+ bodyStream.on('error', (err) => {
18634
18677
  reject(err);
18635
18678
  });
18636
18679
  });
@@ -18812,14 +18855,16 @@ class AccountingApi {
18812
18855
  // Reads file stream as chunks so we can put it in body of request.
18813
18856
  // This collects the whole file into memory, which is why we do it _after_ authentication.
18814
18857
  return new Promise((resolve, reject) => {
18858
+ let bodyStream;
18859
+ bodyStream = Buffer.isBuffer(body) ? stream_1.Readable.from(body) : body;
18815
18860
  const fileContents = [];
18816
- body.on('data', (chunk) => {
18861
+ bodyStream.on('data', (chunk) => {
18817
18862
  fileContents.push(chunk);
18818
18863
  });
18819
- body.on('end', () => {
18864
+ bodyStream.on('end', () => {
18820
18865
  resolve(fileContents);
18821
18866
  });
18822
- body.on('error', (err) => {
18867
+ bodyStream.on('error', (err) => {
18823
18868
  reject(err);
18824
18869
  });
18825
18870
  });