@apideck/unify 0.27.0 → 0.28.1

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 (192) hide show
  1. package/README.md +5 -5
  2. package/docs/sdks/categories/README.md +12 -0
  3. package/docs/sdks/companies/README.md +4 -4
  4. package/examples/README.md +26 -0
  5. package/examples/accountingTaxRatesList.example.ts +41 -0
  6. package/examples/package-lock.json +613 -0
  7. package/examples/package.json +18 -0
  8. package/funcs/accountingCategoriesGet.d.ts.map +1 -1
  9. package/funcs/accountingCategoriesGet.js +4 -2
  10. package/funcs/accountingCategoriesGet.js.map +1 -1
  11. package/funcs/accountingCategoriesList.d.ts.map +1 -1
  12. package/funcs/accountingCategoriesList.js +4 -2
  13. package/funcs/accountingCategoriesList.js.map +1 -1
  14. package/funcs/crmCompaniesCreate.js +1 -1
  15. package/funcs/crmCompaniesCreate.js.map +1 -1
  16. package/funcs/crmCompaniesUpdate.js +1 -1
  17. package/funcs/crmCompaniesUpdate.js.map +1 -1
  18. package/jsr.json +1 -1
  19. package/lib/config.d.ts +4 -4
  20. package/lib/config.js +4 -4
  21. package/models/components/balancesheetfilter.d.ts +5 -0
  22. package/models/components/balancesheetfilter.d.ts.map +1 -1
  23. package/models/components/balancesheetfilter.js +4 -0
  24. package/models/components/balancesheetfilter.js.map +1 -1
  25. package/models/components/bankaccount.d.ts +5 -0
  26. package/models/components/bankaccount.d.ts.map +1 -1
  27. package/models/components/bankaccount.js +2 -0
  28. package/models/components/bankaccount.js.map +1 -1
  29. package/models/components/bankaccount1.d.ts +123 -0
  30. package/models/components/bankaccount1.d.ts.map +1 -0
  31. package/models/components/bankaccount1.js +128 -0
  32. package/models/components/bankaccount1.js.map +1 -0
  33. package/models/components/categoriesfilter.d.ts +67 -0
  34. package/models/components/categoriesfilter.d.ts.map +1 -0
  35. package/models/components/categoriesfilter.js +82 -0
  36. package/models/components/categoriesfilter.js.map +1 -0
  37. package/models/components/category.d.ts +39 -0
  38. package/models/components/category.d.ts.map +1 -1
  39. package/models/components/category.js +26 -1
  40. package/models/components/category.js.map +1 -1
  41. package/models/components/{company.d.ts → company1.d.ts} +32 -32
  42. package/models/components/company1.d.ts.map +1 -0
  43. package/models/components/{company.js → company1.js} +37 -37
  44. package/models/components/company1.js.map +1 -0
  45. package/models/components/companyinfo.d.ts +5 -0
  46. package/models/components/companyinfo.d.ts.map +1 -1
  47. package/models/components/companyinfo.js +4 -0
  48. package/models/components/companyinfo.js.map +1 -1
  49. package/models/components/connection.d.ts +13 -13
  50. package/models/components/connection.d.ts.map +1 -1
  51. package/models/components/connection.js +16 -17
  52. package/models/components/connection.js.map +1 -1
  53. package/models/components/customfield.d.ts +37 -38
  54. package/models/components/customfield.d.ts.map +1 -1
  55. package/models/components/customfield.js +25 -54
  56. package/models/components/customfield.js.map +1 -1
  57. package/models/components/getcompaniesresponse.d.ts +3 -3
  58. package/models/components/getcompaniesresponse.d.ts.map +1 -1
  59. package/models/components/getcompaniesresponse.js +3 -3
  60. package/models/components/getcompaniesresponse.js.map +1 -1
  61. package/models/components/getcompanyresponse.d.ts +3 -3
  62. package/models/components/getcompanyresponse.d.ts.map +1 -1
  63. package/models/components/getcompanyresponse.js +3 -3
  64. package/models/components/getcompanyresponse.js.map +1 -1
  65. package/models/components/index.d.ts +3 -1
  66. package/models/components/index.d.ts.map +1 -1
  67. package/models/components/index.js +3 -1
  68. package/models/components/index.js.map +1 -1
  69. package/models/components/invoicelineitem.d.ts +10 -0
  70. package/models/components/invoicelineitem.d.ts.map +1 -1
  71. package/models/components/invoicelineitem.js +8 -0
  72. package/models/components/invoicelineitem.js.map +1 -1
  73. package/models/components/profitandlossfilter.d.ts +5 -0
  74. package/models/components/profitandlossfilter.d.ts.map +1 -1
  75. package/models/components/profitandlossfilter.js +4 -0
  76. package/models/components/profitandlossfilter.js.map +1 -1
  77. package/models/components/simpleformfieldoption.d.ts +13 -13
  78. package/models/components/simpleformfieldoption.d.ts.map +1 -1
  79. package/models/components/simpleformfieldoption.js +16 -16
  80. package/models/components/simpleformfieldoption.js.map +1 -1
  81. package/models/components/supplier.d.ts +10 -0
  82. package/models/components/supplier.d.ts.map +1 -1
  83. package/models/components/supplier.js +4 -0
  84. package/models/components/supplier.js.map +1 -1
  85. package/models/errors/apierror.d.ts.map +1 -1
  86. package/models/errors/apierror.js +8 -2
  87. package/models/errors/apierror.js.map +1 -1
  88. package/models/errors/badrequestresponse.js +1 -1
  89. package/models/errors/badrequestresponse.js.map +1 -1
  90. package/models/errors/notfoundresponse.js +1 -1
  91. package/models/errors/notfoundresponse.js.map +1 -1
  92. package/models/errors/paymentrequiredresponse.js +1 -1
  93. package/models/errors/paymentrequiredresponse.js.map +1 -1
  94. package/models/errors/unauthorizedresponse.js +1 -1
  95. package/models/errors/unauthorizedresponse.js.map +1 -1
  96. package/models/errors/unprocessableresponse.js +1 -1
  97. package/models/errors/unprocessableresponse.js.map +1 -1
  98. package/models/operations/accountingcategoriesall.d.ts +5 -0
  99. package/models/operations/accountingcategoriesall.d.ts.map +1 -1
  100. package/models/operations/accountingcategoriesall.js +2 -0
  101. package/models/operations/accountingcategoriesall.js.map +1 -1
  102. package/models/operations/accountingcategoriesone.d.ts +5 -0
  103. package/models/operations/accountingcategoriesone.d.ts.map +1 -1
  104. package/models/operations/accountingcategoriesone.js +2 -0
  105. package/models/operations/accountingcategoriesone.js.map +1 -1
  106. package/models/operations/crmcompaniesadd.d.ts +2 -2
  107. package/models/operations/crmcompaniesadd.d.ts.map +1 -1
  108. package/models/operations/crmcompaniesadd.js +4 -4
  109. package/models/operations/crmcompaniesadd.js.map +1 -1
  110. package/models/operations/crmcompaniesupdate.d.ts +2 -2
  111. package/models/operations/crmcompaniesupdate.d.ts.map +1 -1
  112. package/models/operations/crmcompaniesupdate.js +4 -4
  113. package/models/operations/crmcompaniesupdate.js.map +1 -1
  114. package/package.json +2 -2
  115. package/src/__tests__/activities.test.ts +364 -13
  116. package/src/__tests__/apideckcompanies.test.ts +373 -9
  117. package/src/__tests__/apideckdepartments.test.ts +181 -9
  118. package/src/__tests__/applicants.test.ts +473 -9
  119. package/src/__tests__/applications.test.ts +189 -9
  120. package/src/__tests__/bankfeedaccounts.test.ts +4 -4
  121. package/src/__tests__/billpayments.test.ts +378 -20
  122. package/src/__tests__/bills.test.ts +500 -9
  123. package/src/__tests__/collectionticketcomments.test.ts +183 -7
  124. package/src/__tests__/collectiontickets.test.ts +191 -7
  125. package/src/__tests__/companies.test.ts +607 -78
  126. package/src/__tests__/connections.test.ts +409 -5
  127. package/src/__tests__/connectionsettings.test.ts +410 -5
  128. package/src/__tests__/contacts.test.ts +470 -13
  129. package/src/__tests__/creditnotes.test.ts +819 -148
  130. package/src/__tests__/customers.test.ts +517 -13
  131. package/src/__tests__/customobjects.test.ts +150 -9
  132. package/src/__tests__/customobjectschemas.test.ts +321 -9
  133. package/src/__tests__/departments.test.ts +173 -9
  134. package/src/__tests__/drivegroups.test.ts +181 -9
  135. package/src/__tests__/drives.test.ts +179 -9
  136. package/src/__tests__/employees.test.ts +829 -94
  137. package/src/__tests__/expenses.test.ts +338 -15
  138. package/src/__tests__/files.test.ts +106 -5
  139. package/src/__tests__/folders.test.ts +296 -13
  140. package/src/__tests__/invoiceitems.test.ts +272 -9
  141. package/src/__tests__/invoices.test.ts +695 -89
  142. package/src/__tests__/journalentries.test.ts +490 -8
  143. package/src/__tests__/leads.test.ts +450 -13
  144. package/src/__tests__/ledgeraccounts.test.ts +248 -19
  145. package/src/__tests__/locations.test.ts +298 -9
  146. package/src/__tests__/messages.test.ts +195 -9
  147. package/src/__tests__/notes.test.ts +191 -9
  148. package/src/__tests__/opportunities.test.ts +218 -9
  149. package/src/__tests__/payments.test.ts +323 -20
  150. package/src/__tests__/pipelines.test.ts +194 -9
  151. package/src/__tests__/purchaseorders.test.ts +847 -178
  152. package/src/__tests__/sharedlinks.test.ts +183 -9
  153. package/src/__tests__/subsidiaries.test.ts +183 -9
  154. package/src/__tests__/suppliers.test.ts +509 -13
  155. package/src/__tests__/taxrates.test.ts +235 -12
  156. package/src/__tests__/timeoffrequests.test.ts +210 -9
  157. package/src/__tests__/trackingcategories.test.ts +187 -7
  158. package/src/__tests__/uploadsessions.test.ts +78 -5
  159. package/src/__tests__/users.test.ts +356 -9
  160. package/src/funcs/accountingCategoriesGet.ts +15 -5
  161. package/src/funcs/accountingCategoriesList.ts +17 -7
  162. package/src/funcs/crmCompaniesCreate.ts +1 -1
  163. package/src/funcs/crmCompaniesUpdate.ts +1 -1
  164. package/src/lib/config.ts +4 -4
  165. package/src/models/components/balancesheetfilter.ts +9 -0
  166. package/src/models/components/bankaccount.ts +7 -0
  167. package/src/models/components/bankaccount1.ts +207 -0
  168. package/src/models/components/categoriesfilter.ts +104 -0
  169. package/src/models/components/category.ts +39 -0
  170. package/src/models/components/{company.ts → company1.ts} +131 -128
  171. package/src/models/components/companyinfo.ts +9 -0
  172. package/src/models/components/connection.ts +27 -20
  173. package/src/models/components/customfield.ts +51 -83
  174. package/src/models/components/getcompaniesresponse.ts +9 -9
  175. package/src/models/components/getcompanyresponse.ts +9 -9
  176. package/src/models/components/index.ts +3 -1
  177. package/src/models/components/invoicelineitem.ts +18 -0
  178. package/src/models/components/profitandlossfilter.ts +9 -0
  179. package/src/models/components/simpleformfieldoption.ts +21 -18
  180. package/src/models/components/supplier.ts +14 -0
  181. package/src/models/errors/apierror.ts +8 -2
  182. package/src/models/errors/badrequestresponse.ts +1 -1
  183. package/src/models/errors/notfoundresponse.ts +1 -1
  184. package/src/models/errors/paymentrequiredresponse.ts +1 -1
  185. package/src/models/errors/unauthorizedresponse.ts +1 -1
  186. package/src/models/errors/unprocessableresponse.ts +1 -1
  187. package/src/models/operations/accountingcategoriesall.ts +7 -0
  188. package/src/models/operations/accountingcategoriesone.ts +7 -0
  189. package/src/models/operations/crmcompaniesadd.ts +6 -6
  190. package/src/models/operations/crmcompaniesupdate.ts +6 -6
  191. package/models/components/company.d.ts.map +0 -1
  192. package/models/components/company.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { assert, expect, it, test } from "vitest";
5
+ import { expect, test } from "vitest";
6
6
  import { Apideck } from "../index.js";
7
7
  import { createTestHTTPClient } from "./testclient.js";
8
8
 
@@ -188,10 +188,85 @@ test("Applications Ats Applications All", async () => {
188
188
  });
189
189
  });
190
190
 
191
- it.skip("Applications Ats Applications Add", async () => {
192
- assert.fail(
193
- "incomplete test found please make sure to address the following errors: [`workflow step ats.applicationsAdd.test referencing operation ats.applicationsAdd with expression in requestBody with type not currently supported`, `workflow step ats.applicationsAdd.test referencing operation ats.applicationsAdd with expression in requestBody with type not currently supported`, `workflow step ats.applicationsAdd.test referencing operation ats.applicationsAdd with expression in requestBody with type not currently supported`, `workflow step ats.applicationsAdd.test referencing operation ats.applicationsAdd with expression in requestBody with type not currently supported`]",
194
- );
191
+ test("Applications Ats Applications Add", async () => {
192
+ const testHttpClient = createTestHTTPClient("ats.applicationsAdd");
193
+
194
+ const apideck = new Apideck({
195
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
196
+ httpClient: testHttpClient,
197
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
198
+ });
199
+
200
+ const result = await apideck.ats.applications.create({
201
+ consumerId: "test-consumer",
202
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
203
+ serviceId: "salesforce",
204
+ application: {
205
+ applicantId: "12345",
206
+ jobId: "12345",
207
+ status: "open",
208
+ stage: {
209
+ id: "12345",
210
+ name: "12345",
211
+ },
212
+ passThrough: [
213
+ {
214
+ serviceId: "<id>",
215
+ extendPaths: [
216
+ {
217
+ path: "$.nested.property",
218
+ value: {
219
+ "TaxClassificationRef": {
220
+ "value": "EUC-99990201-V1-00020000",
221
+ },
222
+ },
223
+ },
224
+ {
225
+ path: "$.nested.property",
226
+ value: {
227
+ "TaxClassificationRef": {
228
+ "value": "EUC-99990201-V1-00020000",
229
+ },
230
+ },
231
+ },
232
+ ],
233
+ },
234
+ {
235
+ serviceId: "<id>",
236
+ extendPaths: [
237
+ {
238
+ path: "$.nested.property",
239
+ value: {
240
+ "TaxClassificationRef": {
241
+ "value": "EUC-99990201-V1-00020000",
242
+ },
243
+ },
244
+ },
245
+ {
246
+ path: "$.nested.property",
247
+ value: {
248
+ "TaxClassificationRef": {
249
+ "value": "EUC-99990201-V1-00020000",
250
+ },
251
+ },
252
+ },
253
+ ],
254
+ },
255
+ ],
256
+ },
257
+ });
258
+ expect(result.httpMeta.response.status).toBe(201);
259
+ expect(result.createApplicationResponse).toBeDefined();
260
+ expect(result.createApplicationResponse).toEqual({
261
+ statusCode: 200,
262
+ status: "OK",
263
+ service: "sap-successfactors",
264
+ resource: "Applications",
265
+ operation: "add",
266
+ data: {
267
+ id: "12345",
268
+ },
269
+ });
195
270
  });
196
271
 
197
272
  test("Applications Ats Applications One", async () => {
@@ -299,10 +374,115 @@ test("Applications Ats Applications One", async () => {
299
374
  });
300
375
  });
301
376
 
302
- it.skip("Applications Ats Applications Update", async () => {
303
- assert.fail(
304
- "incomplete test found please make sure to address the following errors: [`workflow step ats.applicationsUpdate.test referencing operation ats.applicationsUpdate with expression in requestBody with type not currently supported`, `workflow step ats.applicationsUpdate.test referencing operation ats.applicationsUpdate with expression in requestBody with type not currently supported`, `workflow step ats.applicationsUpdate.test referencing operation ats.applicationsUpdate with expression in requestBody with type not currently supported`, `workflow step ats.applicationsUpdate.test referencing operation ats.applicationsUpdate with expression in requestBody with type not currently supported`, `workflow step ats.applicationsUpdate.test referencing operation ats.applicationsUpdate with expression in requestBody with type not currently supported`, `workflow step ats.applicationsUpdate.test referencing operation ats.applicationsUpdate with expression in requestBody with type not currently supported`, `workflow step ats.applicationsUpdate.test referencing operation ats.applicationsUpdate with expression in requestBody with type not currently supported`]",
305
- );
377
+ test("Applications Ats Applications Update", async () => {
378
+ const testHttpClient = createTestHTTPClient("ats.applicationsUpdate");
379
+
380
+ const apideck = new Apideck({
381
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
382
+ httpClient: testHttpClient,
383
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
384
+ });
385
+
386
+ const result = await apideck.ats.applications.update({
387
+ id: "<id>",
388
+ consumerId: "test-consumer",
389
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
390
+ serviceId: "salesforce",
391
+ application: {
392
+ applicantId: "12345",
393
+ jobId: "12345",
394
+ status: "open",
395
+ stage: {
396
+ id: "12345",
397
+ name: "12345",
398
+ },
399
+ passThrough: [
400
+ {
401
+ serviceId: "<id>",
402
+ extendPaths: [
403
+ {
404
+ path: "$.nested.property",
405
+ value: {
406
+ "TaxClassificationRef": {
407
+ "value": "EUC-99990201-V1-00020000",
408
+ },
409
+ },
410
+ },
411
+ {
412
+ path: "$.nested.property",
413
+ value: {
414
+ "TaxClassificationRef": {
415
+ "value": "EUC-99990201-V1-00020000",
416
+ },
417
+ },
418
+ },
419
+ ],
420
+ },
421
+ {
422
+ serviceId: "<id>",
423
+ extendPaths: [
424
+ {
425
+ path: "$.nested.property",
426
+ value: {
427
+ "TaxClassificationRef": {
428
+ "value": "EUC-99990201-V1-00020000",
429
+ },
430
+ },
431
+ },
432
+ {
433
+ path: "$.nested.property",
434
+ value: {
435
+ "TaxClassificationRef": {
436
+ "value": "EUC-99990201-V1-00020000",
437
+ },
438
+ },
439
+ },
440
+ ],
441
+ },
442
+ {
443
+ serviceId: "<id>",
444
+ extendPaths: [
445
+ {
446
+ path: "$.nested.property",
447
+ value: {
448
+ "TaxClassificationRef": {
449
+ "value": "EUC-99990201-V1-00020000",
450
+ },
451
+ },
452
+ },
453
+ {
454
+ path: "$.nested.property",
455
+ value: {
456
+ "TaxClassificationRef": {
457
+ "value": "EUC-99990201-V1-00020000",
458
+ },
459
+ },
460
+ },
461
+ {
462
+ path: "$.nested.property",
463
+ value: {
464
+ "TaxClassificationRef": {
465
+ "value": "EUC-99990201-V1-00020000",
466
+ },
467
+ },
468
+ },
469
+ ],
470
+ },
471
+ ],
472
+ },
473
+ });
474
+ expect(result.httpMeta.response.status).toBe(200);
475
+ expect(result.updateApplicationResponse).toBeDefined();
476
+ expect(result.updateApplicationResponse).toEqual({
477
+ statusCode: 200,
478
+ status: "OK",
479
+ service: "sap-successfactors",
480
+ resource: "Applications",
481
+ operation: "update",
482
+ data: {
483
+ id: "12345",
484
+ },
485
+ });
306
486
  });
307
487
 
308
488
  test("Applications Ats Applications Delete", async () => {
@@ -289,10 +289,10 @@ test("Bankfeedaccounts Accounting Bank Feed Accounts Update", async () => {
289
289
  id: "2389328923893298",
290
290
  name: "employee_level",
291
291
  description: "Employee Level",
292
- value: [
293
- {},
294
- {},
295
- ],
292
+ value: {
293
+ "0": {},
294
+ "1": {},
295
+ },
296
296
  },
297
297
  ],
298
298
  },
@@ -2,7 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { assert, expect, it, test } from "vitest";
5
+ import { expect, test } from "vitest";
6
6
  import { Apideck } from "../index.js";
7
7
  import { createTestHTTPClient } from "./testclient.js";
8
8
 
@@ -257,10 +257,10 @@ test("Billpayments Accounting Bill Payments All", async () => {
257
257
  id: "2389328923893298",
258
258
  name: "employee_level",
259
259
  description: "Employee Level",
260
- value: [
261
- "<value>",
262
- "<value>",
263
- ],
260
+ value: {
261
+ "0": "<value>",
262
+ "1": "<value>",
263
+ },
264
264
  },
265
265
  ],
266
266
  rowVersion: "1-12345",
@@ -384,10 +384,10 @@ test("Billpayments Accounting Bill Payments All", async () => {
384
384
  id: "2389328923893298",
385
385
  name: "employee_level",
386
386
  description: "Employee Level",
387
- value: [
388
- {},
389
- {},
390
- ],
387
+ value: {
388
+ "0": {},
389
+ "1": {},
390
+ },
391
391
  },
392
392
  ],
393
393
  rowVersion: "1-12345",
@@ -465,10 +465,180 @@ test("Billpayments Accounting Bill Payments All", async () => {
465
465
  });
466
466
  });
467
467
 
468
- it.skip("Billpayments Accounting Bill Payments Add", async () => {
469
- assert.fail(
470
- "incomplete test found please make sure to address the following errors: [`workflow step accounting.billPaymentsAdd.test referencing operation accounting.billPaymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsAdd.test referencing operation accounting.billPaymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsAdd.test referencing operation accounting.billPaymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsAdd.test referencing operation accounting.billPaymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsAdd.test referencing operation accounting.billPaymentsAdd with expression in requestBody with type not currently supported`]",
471
- );
468
+ test("Billpayments Accounting Bill Payments Add", async () => {
469
+ const testHttpClient = createTestHTTPClient("accounting.billPaymentsAdd");
470
+
471
+ const apideck = new Apideck({
472
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
473
+ httpClient: testHttpClient,
474
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
475
+ });
476
+
477
+ const result = await apideck.accounting.billPayments.create({
478
+ consumerId: "test-consumer",
479
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
480
+ serviceId: "salesforce",
481
+ billPayment: {
482
+ currency: "USD",
483
+ currencyRate: 0.69,
484
+ totalAmount: 49.99,
485
+ reference: "123456",
486
+ paymentMethod: "cash",
487
+ paymentMethodReference: "123456",
488
+ paymentMethodId: "12345",
489
+ account: {
490
+ id: "123456",
491
+ nominalCode: "N091",
492
+ code: "453",
493
+ },
494
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
495
+ supplier: {
496
+ id: "12345",
497
+ displayName: "Windsurf Shop",
498
+ address: {
499
+ id: "123",
500
+ type: "primary",
501
+ string: "25 Spring Street, Blackburn, VIC 3130",
502
+ name: "HQ US",
503
+ line1: "Main street",
504
+ line2: "apt #",
505
+ line3: "Suite #",
506
+ line4: "delivery instructions",
507
+ streetNumber: "25",
508
+ city: "San Francisco",
509
+ state: "CA",
510
+ postalCode: "94104",
511
+ country: "US",
512
+ latitude: "40.759211",
513
+ longitude: "-73.984638",
514
+ county: "Santa Clara",
515
+ contactName: "Elon Musk",
516
+ salutation: "Mr",
517
+ phoneNumber: "111-111-1111",
518
+ fax: "122-111-1111",
519
+ email: "elon@musk.com",
520
+ website: "https://elonmusk.com",
521
+ notes: "Address notes or delivery instructions.",
522
+ rowVersion: "1-12345",
523
+ },
524
+ },
525
+ companyId: "12345",
526
+ reconciled: true,
527
+ status: "authorised",
528
+ type: "accounts_payable",
529
+ allocations: [
530
+ {
531
+ id: "12345",
532
+ type: "bill",
533
+ amount: 49.99,
534
+ allocationId: "123456",
535
+ },
536
+ {
537
+ id: "12345",
538
+ type: "bill",
539
+ amount: 49.99,
540
+ allocationId: "123456",
541
+ },
542
+ ],
543
+ note: "Some notes about this transaction",
544
+ number: "123456",
545
+ trackingCategories: [
546
+ {
547
+ id: "123456",
548
+ name: "New York",
549
+ },
550
+ {
551
+ id: "123456",
552
+ name: "New York",
553
+ },
554
+ ],
555
+ customFields: [
556
+ {
557
+ id: "2389328923893298",
558
+ name: "employee_level",
559
+ description: "Employee Level",
560
+ value: "Uses Salesforce and Marketo",
561
+ },
562
+ {
563
+ id: "2389328923893298",
564
+ name: "employee_level",
565
+ description: "Employee Level",
566
+ value: "Uses Salesforce and Marketo",
567
+ },
568
+ ],
569
+ rowVersion: "1-12345",
570
+ displayId: "123456",
571
+ passThrough: [
572
+ {
573
+ serviceId: "<id>",
574
+ extendPaths: [
575
+ {
576
+ path: "$.nested.property",
577
+ value: {
578
+ "TaxClassificationRef": {
579
+ "value": "EUC-99990201-V1-00020000",
580
+ },
581
+ },
582
+ },
583
+ {
584
+ path: "$.nested.property",
585
+ value: {
586
+ "TaxClassificationRef": {
587
+ "value": "EUC-99990201-V1-00020000",
588
+ },
589
+ },
590
+ },
591
+ {
592
+ path: "$.nested.property",
593
+ value: {
594
+ "TaxClassificationRef": {
595
+ "value": "EUC-99990201-V1-00020000",
596
+ },
597
+ },
598
+ },
599
+ ],
600
+ },
601
+ {
602
+ serviceId: "<id>",
603
+ extendPaths: [
604
+ {
605
+ path: "$.nested.property",
606
+ value: {
607
+ "TaxClassificationRef": {
608
+ "value": "EUC-99990201-V1-00020000",
609
+ },
610
+ },
611
+ },
612
+ ],
613
+ },
614
+ {
615
+ serviceId: "<id>",
616
+ extendPaths: [
617
+ {
618
+ path: "$.nested.property",
619
+ value: {
620
+ "TaxClassificationRef": {
621
+ "value": "EUC-99990201-V1-00020000",
622
+ },
623
+ },
624
+ },
625
+ ],
626
+ },
627
+ ],
628
+ },
629
+ });
630
+ expect(result.httpMeta.response.status).toBe(201);
631
+ expect(result.createBillPaymentResponse).toBeDefined();
632
+ expect(result.createBillPaymentResponse).toEqual({
633
+ statusCode: 200,
634
+ status: "OK",
635
+ service: "xero",
636
+ resource: "payments",
637
+ operation: "add",
638
+ data: {
639
+ id: "12345",
640
+ },
641
+ });
472
642
  });
473
643
 
474
644
  test("Billpayments Accounting Bill Payments One", async () => {
@@ -594,9 +764,9 @@ test("Billpayments Accounting Bill Payments One", async () => {
594
764
  id: "2389328923893298",
595
765
  name: "employee_level",
596
766
  description: "Employee Level",
597
- value: [
598
- {},
599
- ],
767
+ value: {
768
+ "0": {},
769
+ },
600
770
  },
601
771
  ],
602
772
  rowVersion: "1-12345",
@@ -637,10 +807,198 @@ test("Billpayments Accounting Bill Payments One", async () => {
637
807
  });
638
808
  });
639
809
 
640
- it.skip("Billpayments Accounting Bill Payments Update", async () => {
641
- assert.fail(
642
- "incomplete test found please make sure to address the following errors: [`workflow step accounting.billPaymentsUpdate.test referencing operation accounting.billPaymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsUpdate.test referencing operation accounting.billPaymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsUpdate.test referencing operation accounting.billPaymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsUpdate.test referencing operation accounting.billPaymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsUpdate.test referencing operation accounting.billPaymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.billPaymentsUpdate.test referencing operation accounting.billPaymentsUpdate with expression in requestBody with type not currently supported`]",
643
- );
810
+ test("Billpayments Accounting Bill Payments Update", async () => {
811
+ const testHttpClient = createTestHTTPClient("accounting.billPaymentsUpdate");
812
+
813
+ const apideck = new Apideck({
814
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
815
+ httpClient: testHttpClient,
816
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
817
+ });
818
+
819
+ const result = await apideck.accounting.billPayments.update({
820
+ id: "<id>",
821
+ consumerId: "test-consumer",
822
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
823
+ serviceId: "salesforce",
824
+ billPayment: {
825
+ currency: "USD",
826
+ currencyRate: 0.69,
827
+ totalAmount: 49.99,
828
+ reference: "123456",
829
+ paymentMethod: "cash",
830
+ paymentMethodReference: "123456",
831
+ paymentMethodId: "12345",
832
+ account: {
833
+ id: "123456",
834
+ nominalCode: "N091",
835
+ code: "453",
836
+ },
837
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
838
+ supplier: {
839
+ id: "12345",
840
+ displayName: "Windsurf Shop",
841
+ address: {
842
+ id: "123",
843
+ type: "primary",
844
+ string: "25 Spring Street, Blackburn, VIC 3130",
845
+ name: "HQ US",
846
+ line1: "Main street",
847
+ line2: "apt #",
848
+ line3: "Suite #",
849
+ line4: "delivery instructions",
850
+ streetNumber: "25",
851
+ city: "San Francisco",
852
+ state: "CA",
853
+ postalCode: "94104",
854
+ country: "US",
855
+ latitude: "40.759211",
856
+ longitude: "-73.984638",
857
+ county: "Santa Clara",
858
+ contactName: "Elon Musk",
859
+ salutation: "Mr",
860
+ phoneNumber: "111-111-1111",
861
+ fax: "122-111-1111",
862
+ email: "elon@musk.com",
863
+ website: "https://elonmusk.com",
864
+ notes: "Address notes or delivery instructions.",
865
+ rowVersion: "1-12345",
866
+ },
867
+ },
868
+ companyId: "12345",
869
+ reconciled: true,
870
+ status: "authorised",
871
+ type: "accounts_payable",
872
+ allocations: [
873
+ {
874
+ id: "12345",
875
+ type: "bill",
876
+ amount: 49.99,
877
+ allocationId: "123456",
878
+ },
879
+ {
880
+ id: "12345",
881
+ type: "bill",
882
+ amount: 49.99,
883
+ allocationId: "123456",
884
+ },
885
+ {
886
+ id: "12345",
887
+ type: "bill",
888
+ amount: 49.99,
889
+ allocationId: "123456",
890
+ },
891
+ ],
892
+ note: "Some notes about this transaction",
893
+ number: "123456",
894
+ trackingCategories: [
895
+ {
896
+ id: "123456",
897
+ name: "New York",
898
+ },
899
+ {
900
+ id: "123456",
901
+ name: "New York",
902
+ },
903
+ ],
904
+ customFields: [
905
+ {
906
+ id: "2389328923893298",
907
+ name: "employee_level",
908
+ description: "Employee Level",
909
+ value: {
910
+ "0": {},
911
+ "1": {},
912
+ },
913
+ },
914
+ {
915
+ id: "2389328923893298",
916
+ name: "employee_level",
917
+ description: "Employee Level",
918
+ value: true,
919
+ },
920
+ ],
921
+ rowVersion: "1-12345",
922
+ displayId: "123456",
923
+ passThrough: [
924
+ {
925
+ serviceId: "<id>",
926
+ extendPaths: [
927
+ {
928
+ path: "$.nested.property",
929
+ value: {
930
+ "TaxClassificationRef": {
931
+ "value": "EUC-99990201-V1-00020000",
932
+ },
933
+ },
934
+ },
935
+ ],
936
+ },
937
+ {
938
+ serviceId: "<id>",
939
+ extendPaths: [
940
+ {
941
+ path: "$.nested.property",
942
+ value: {
943
+ "TaxClassificationRef": {
944
+ "value": "EUC-99990201-V1-00020000",
945
+ },
946
+ },
947
+ },
948
+ {
949
+ path: "$.nested.property",
950
+ value: {
951
+ "TaxClassificationRef": {
952
+ "value": "EUC-99990201-V1-00020000",
953
+ },
954
+ },
955
+ },
956
+ {
957
+ path: "$.nested.property",
958
+ value: {
959
+ "TaxClassificationRef": {
960
+ "value": "EUC-99990201-V1-00020000",
961
+ },
962
+ },
963
+ },
964
+ ],
965
+ },
966
+ {
967
+ serviceId: "<id>",
968
+ extendPaths: [
969
+ {
970
+ path: "$.nested.property",
971
+ value: {
972
+ "TaxClassificationRef": {
973
+ "value": "EUC-99990201-V1-00020000",
974
+ },
975
+ },
976
+ },
977
+ {
978
+ path: "$.nested.property",
979
+ value: {
980
+ "TaxClassificationRef": {
981
+ "value": "EUC-99990201-V1-00020000",
982
+ },
983
+ },
984
+ },
985
+ ],
986
+ },
987
+ ],
988
+ },
989
+ });
990
+ expect(result.httpMeta.response.status).toBe(200);
991
+ expect(result.updateBillPaymentResponse).toBeDefined();
992
+ expect(result.updateBillPaymentResponse).toEqual({
993
+ statusCode: 200,
994
+ status: "OK",
995
+ service: "xero",
996
+ resource: "payments",
997
+ operation: "update",
998
+ data: {
999
+ id: "12345",
1000
+ },
1001
+ });
644
1002
  });
645
1003
 
646
1004
  test("Billpayments Accounting Bill Payments Delete", async () => {