@apideck/unify 0.40.0 → 0.41.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 (96) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +4 -4
  3. package/lib/config.js +4 -4
  4. package/package.json +6 -2
  5. package/src/__tests__/activities.test.ts +1141 -0
  6. package/src/__tests__/agedcreditors.test.ts +280 -0
  7. package/src/__tests__/ageddebtors.test.ts +280 -0
  8. package/src/__tests__/apideckcompanies.test.ts +1082 -0
  9. package/src/__tests__/apideckcustomers.test.ts +364 -0
  10. package/src/__tests__/apideckdepartments.test.ts +497 -0
  11. package/src/__tests__/apiresources.test.ts +62 -0
  12. package/src/__tests__/apis.test.ts +216 -0
  13. package/src/__tests__/applicants.test.ts +1445 -0
  14. package/src/__tests__/applications.test.ts +515 -0
  15. package/src/__tests__/assertions.ts +13 -0
  16. package/src/__tests__/attachments.test.ts +371 -0
  17. package/src/__tests__/balancesheet.test.ts +453 -0
  18. package/src/__tests__/bankaccounts.test.ts +324 -0
  19. package/src/__tests__/bankfeedaccounts.test.ts +343 -0
  20. package/src/__tests__/bankfeedstatements.test.ts +408 -0
  21. package/src/__tests__/billpayments.test.ts +1031 -0
  22. package/src/__tests__/bills.test.ts +1630 -0
  23. package/src/__tests__/categories.test.ts +127 -0
  24. package/src/__tests__/collections.test.ts +120 -0
  25. package/src/__tests__/collectiontags.test.ts +68 -0
  26. package/src/__tests__/collectionticketcomments.test.ts +501 -0
  27. package/src/__tests__/collectiontickets.test.ts +627 -0
  28. package/src/__tests__/collectionusers.test.ts +126 -0
  29. package/src/__tests__/companies.test.ts +1642 -0
  30. package/src/__tests__/companyinfo.test.ts +219 -0
  31. package/src/__tests__/connectionconsent.test.ts +89 -0
  32. package/src/__tests__/connectionconsents.test.ts +31 -0
  33. package/src/__tests__/connectioncustommappings.test.ts +69 -0
  34. package/src/__tests__/connections.test.ts +2127 -0
  35. package/src/__tests__/connectionsettings.test.ts +687 -0
  36. package/src/__tests__/connectordocs.test.ts +29 -0
  37. package/src/__tests__/connectors.test.ts +753 -0
  38. package/src/__tests__/consumerrequestcounts.test.ts +42 -0
  39. package/src/__tests__/consumers.test.ts +523 -0
  40. package/src/__tests__/contacts.test.ts +1421 -0
  41. package/src/__tests__/createcallback.test.ts +36 -0
  42. package/src/__tests__/creditnotes.test.ts +2040 -0
  43. package/src/__tests__/customers.test.ts +1600 -0
  44. package/src/__tests__/customfields.test.ts +52 -0
  45. package/src/__tests__/custommappings.test.ts +65 -0
  46. package/src/__tests__/customobjects.test.ts +408 -0
  47. package/src/__tests__/customobjectschemas.test.ts +734 -0
  48. package/src/__tests__/departments.test.ts +529 -0
  49. package/src/__tests__/drivegroups.test.ts +496 -0
  50. package/src/__tests__/drives.test.ts +487 -0
  51. package/src/__tests__/employeepayrolls.test.ts +491 -0
  52. package/src/__tests__/employees.test.ts +2968 -0
  53. package/src/__tests__/employeeschedules.test.ts +457 -0
  54. package/src/__tests__/eventlogs.test.ts +158 -0
  55. package/src/__tests__/expensecategories.test.ts +324 -0
  56. package/src/__tests__/expensereports.test.ts +634 -0
  57. package/src/__tests__/expenses.test.ts +867 -0
  58. package/src/__tests__/files.test.ts +506 -0
  59. package/src/__tests__/files.ts +56 -0
  60. package/src/__tests__/folders.test.ts +390 -0
  61. package/src/__tests__/invoiceitems.test.ts +855 -0
  62. package/src/__tests__/invoices.test.ts +2173 -0
  63. package/src/__tests__/jobs.test.ts +1150 -0
  64. package/src/__tests__/journalentries.test.ts +1542 -0
  65. package/src/__tests__/leads.test.ts +1341 -0
  66. package/src/__tests__/ledgeraccounts.test.ts +829 -0
  67. package/src/__tests__/locations.test.ts +856 -0
  68. package/src/__tests__/logs.test.ts +137 -0
  69. package/src/__tests__/messages.test.ts +588 -0
  70. package/src/__tests__/notes.test.ts +523 -0
  71. package/src/__tests__/opportunities.test.ts +718 -0
  72. package/src/__tests__/orders.test.ts +854 -0
  73. package/src/__tests__/payments.test.ts +867 -0
  74. package/src/__tests__/payrolls.test.ts +485 -0
  75. package/src/__tests__/pipelines.test.ts +574 -0
  76. package/src/__tests__/products.test.ts +509 -0
  77. package/src/__tests__/profitandloss.test.ts +223 -0
  78. package/src/__tests__/projects.test.ts +480 -0
  79. package/src/__tests__/proxy.test.ts +41 -0
  80. package/src/__tests__/purchaseorders.test.ts +2139 -0
  81. package/src/__tests__/quotes.test.ts +678 -0
  82. package/src/__tests__/refunds.test.ts +812 -0
  83. package/src/__tests__/sessions.test.ts +72 -0
  84. package/src/__tests__/sharedlinks.test.ts +511 -0
  85. package/src/__tests__/stores.test.ts +41 -0
  86. package/src/__tests__/subsidiaries.test.ts +496 -0
  87. package/src/__tests__/suppliers.test.ts +1574 -0
  88. package/src/__tests__/taxrates.test.ts +701 -0
  89. package/src/__tests__/testclient.ts +48 -0
  90. package/src/__tests__/timeoffrequests.test.ts +588 -0
  91. package/src/__tests__/trackingcategories.test.ts +515 -0
  92. package/src/__tests__/uploadsessions.test.ts +221 -0
  93. package/src/__tests__/users.test.ts +1020 -0
  94. package/src/__tests__/validateconnection.test.ts +34 -0
  95. package/src/__tests__/webhooks.test.ts +254 -0
  96. package/src/lib/config.ts +4 -4
@@ -0,0 +1,701 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { expect, test } from "vitest";
6
+ import { Apideck } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Taxrates Accounting Tax Rates All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.taxRatesAll");
11
+
12
+ const apideck = new Apideck({
13
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
14
+ httpClient: testHttpClient,
15
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
16
+ });
17
+
18
+ const result = await apideck.accounting.taxRates.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ assets: true,
24
+ equity: true,
25
+ expenses: true,
26
+ liabilities: true,
27
+ revenue: true,
28
+ },
29
+ passThrough: {
30
+ "search": "San Francisco",
31
+ },
32
+ fields: "id,updated_at",
33
+ });
34
+ expect(result.httpMeta.response.status).toBe(200);
35
+ expect(result.getTaxRatesResponse).toBeDefined();
36
+ expect(result.getTaxRatesResponse).toEqual({
37
+ statusCode: 200,
38
+ status: "OK",
39
+ service: "xero",
40
+ resource: "tax-rates",
41
+ operation: "all",
42
+ data: [
43
+ {
44
+ id: "1234",
45
+ name: "GST on Purchases",
46
+ code: "ABN",
47
+ description: "Reduced rate GST Purchases",
48
+ effectiveTaxRate: 10,
49
+ totalTaxRate: 10,
50
+ taxPayableAccountId: "123456",
51
+ taxRemittedAccountId: "123456",
52
+ components: [
53
+ {
54
+ id: "10",
55
+ name: "GST",
56
+ rate: 10,
57
+ compound: true,
58
+ },
59
+ {
60
+ id: "10",
61
+ name: "GST",
62
+ rate: 10,
63
+ compound: true,
64
+ },
65
+ ],
66
+ type: "NONE",
67
+ reportTaxType: "NONE",
68
+ originalTaxRateId: "12345",
69
+ status: "active",
70
+ rowVersion: "1-12345",
71
+ updatedBy: "12345",
72
+ createdBy: "12345",
73
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
74
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
75
+ passThrough: [
76
+ {
77
+ serviceId: "<id>",
78
+ extendPaths: [
79
+ {
80
+ path: "$.nested.property",
81
+ value: {
82
+ "TaxClassificationRef": {
83
+ "value": "EUC-99990201-V1-00020000",
84
+ },
85
+ },
86
+ },
87
+ ],
88
+ },
89
+ {
90
+ serviceId: "<id>",
91
+ extendPaths: [
92
+ {
93
+ path: "$.nested.property",
94
+ value: {
95
+ "TaxClassificationRef": {
96
+ "value": "EUC-99990201-V1-00020000",
97
+ },
98
+ },
99
+ },
100
+ ],
101
+ },
102
+ {
103
+ serviceId: "<id>",
104
+ extendPaths: [
105
+ {
106
+ path: "$.nested.property",
107
+ value: {
108
+ "TaxClassificationRef": {
109
+ "value": "EUC-99990201-V1-00020000",
110
+ },
111
+ },
112
+ },
113
+ ],
114
+ },
115
+ ],
116
+ customFields: [
117
+ {
118
+ id: "2389328923893298",
119
+ name: "employee_level",
120
+ description: "Employee Level",
121
+ value: {},
122
+ },
123
+ {
124
+ id: "2389328923893298",
125
+ name: "employee_level",
126
+ description: "Employee Level",
127
+ value: "Uses Salesforce and Marketo",
128
+ },
129
+ ],
130
+ },
131
+ {
132
+ id: "1234",
133
+ name: "GST on Purchases",
134
+ code: "ABN",
135
+ description: "Reduced rate GST Purchases",
136
+ effectiveTaxRate: 10,
137
+ totalTaxRate: 10,
138
+ taxPayableAccountId: "123456",
139
+ taxRemittedAccountId: "123456",
140
+ components: [
141
+ {
142
+ id: "10",
143
+ name: "GST",
144
+ rate: 10,
145
+ compound: true,
146
+ },
147
+ {
148
+ id: "10",
149
+ name: "GST",
150
+ rate: 10,
151
+ compound: true,
152
+ },
153
+ {
154
+ id: "10",
155
+ name: "GST",
156
+ rate: 10,
157
+ compound: true,
158
+ },
159
+ ],
160
+ type: "NONE",
161
+ reportTaxType: "NONE",
162
+ originalTaxRateId: "12345",
163
+ status: "active",
164
+ rowVersion: "1-12345",
165
+ updatedBy: "12345",
166
+ createdBy: "12345",
167
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
168
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
169
+ passThrough: [
170
+ {
171
+ serviceId: "<id>",
172
+ extendPaths: [
173
+ {
174
+ path: "$.nested.property",
175
+ value: {
176
+ "TaxClassificationRef": {
177
+ "value": "EUC-99990201-V1-00020000",
178
+ },
179
+ },
180
+ },
181
+ ],
182
+ },
183
+ ],
184
+ customFields: [
185
+ {
186
+ id: "2389328923893298",
187
+ name: "employee_level",
188
+ description: "Employee Level",
189
+ value: {},
190
+ },
191
+ {
192
+ id: "2389328923893298",
193
+ name: "employee_level",
194
+ description: "Employee Level",
195
+ value: {},
196
+ },
197
+ {
198
+ id: "2389328923893298",
199
+ name: "employee_level",
200
+ description: "Employee Level",
201
+ value: "Uses Salesforce and Marketo",
202
+ },
203
+ ],
204
+ },
205
+ {
206
+ id: "1234",
207
+ name: "GST on Purchases",
208
+ code: "ABN",
209
+ description: "Reduced rate GST Purchases",
210
+ effectiveTaxRate: 10,
211
+ totalTaxRate: 10,
212
+ taxPayableAccountId: "123456",
213
+ taxRemittedAccountId: "123456",
214
+ components: [
215
+ {
216
+ id: "10",
217
+ name: "GST",
218
+ rate: 10,
219
+ compound: true,
220
+ },
221
+ ],
222
+ type: "NONE",
223
+ reportTaxType: "NONE",
224
+ originalTaxRateId: "12345",
225
+ status: "active",
226
+ rowVersion: "1-12345",
227
+ updatedBy: "12345",
228
+ createdBy: "12345",
229
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
230
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
231
+ passThrough: [
232
+ {
233
+ serviceId: "<id>",
234
+ extendPaths: [
235
+ {
236
+ path: "$.nested.property",
237
+ value: {
238
+ "TaxClassificationRef": {
239
+ "value": "EUC-99990201-V1-00020000",
240
+ },
241
+ },
242
+ },
243
+ {
244
+ path: "$.nested.property",
245
+ value: {
246
+ "TaxClassificationRef": {
247
+ "value": "EUC-99990201-V1-00020000",
248
+ },
249
+ },
250
+ },
251
+ ],
252
+ },
253
+ {
254
+ serviceId: "<id>",
255
+ extendPaths: [
256
+ {
257
+ path: "$.nested.property",
258
+ value: {
259
+ "TaxClassificationRef": {
260
+ "value": "EUC-99990201-V1-00020000",
261
+ },
262
+ },
263
+ },
264
+ ],
265
+ },
266
+ ],
267
+ customFields: [
268
+ {
269
+ id: "2389328923893298",
270
+ name: "employee_level",
271
+ description: "Employee Level",
272
+ value: {},
273
+ },
274
+ {
275
+ id: "2389328923893298",
276
+ name: "employee_level",
277
+ description: "Employee Level",
278
+ value: {
279
+ "0": {},
280
+ },
281
+ },
282
+ {
283
+ id: "2389328923893298",
284
+ name: "employee_level",
285
+ description: "Employee Level",
286
+ value: "Uses Salesforce and Marketo",
287
+ },
288
+ ],
289
+ },
290
+ ],
291
+ meta: {
292
+ itemsOnPage: 50,
293
+ cursors: {
294
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
295
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
296
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
297
+ },
298
+ },
299
+ links: {
300
+ previous:
301
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
302
+ current: "https://unify.apideck.com/crm/companies",
303
+ next:
304
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
305
+ },
306
+ });
307
+ });
308
+
309
+ test("Taxrates Accounting Tax Rates Add", async () => {
310
+ const testHttpClient = createTestHTTPClient("accounting.taxRatesAdd");
311
+
312
+ const apideck = new Apideck({
313
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
314
+ httpClient: testHttpClient,
315
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
316
+ });
317
+
318
+ const result = await apideck.accounting.taxRates.create({
319
+ consumerId: "test-consumer",
320
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
321
+ serviceId: "salesforce",
322
+ taxRate: {
323
+ id: "1234",
324
+ name: "GST on Purchases",
325
+ code: "ABN",
326
+ description: "Reduced rate GST Purchases",
327
+ effectiveTaxRate: 10,
328
+ totalTaxRate: 10,
329
+ taxPayableAccountId: "123456",
330
+ taxRemittedAccountId: "123456",
331
+ components: [
332
+ {
333
+ id: "10",
334
+ name: "GST",
335
+ rate: 10,
336
+ compound: true,
337
+ },
338
+ {
339
+ id: "10",
340
+ name: "GST",
341
+ rate: 10,
342
+ compound: true,
343
+ },
344
+ ],
345
+ type: "NONE",
346
+ reportTaxType: "NONE",
347
+ originalTaxRateId: "12345",
348
+ status: "active",
349
+ rowVersion: "1-12345",
350
+ passThrough: [
351
+ {
352
+ serviceId: "<id>",
353
+ extendPaths: [
354
+ {
355
+ path: "$.nested.property",
356
+ value: {
357
+ "TaxClassificationRef": {
358
+ "value": "EUC-99990201-V1-00020000",
359
+ },
360
+ },
361
+ },
362
+ {
363
+ path: "$.nested.property",
364
+ value: {
365
+ "TaxClassificationRef": {
366
+ "value": "EUC-99990201-V1-00020000",
367
+ },
368
+ },
369
+ },
370
+ ],
371
+ },
372
+ {
373
+ serviceId: "<id>",
374
+ extendPaths: [
375
+ {
376
+ path: "$.nested.property",
377
+ value: {
378
+ "TaxClassificationRef": {
379
+ "value": "EUC-99990201-V1-00020000",
380
+ },
381
+ },
382
+ },
383
+ ],
384
+ },
385
+ ],
386
+ customFields: [
387
+ {
388
+ id: "2389328923893298",
389
+ name: "employee_level",
390
+ description: "Employee Level",
391
+ value: {
392
+ "0": "<value>",
393
+ "1": "<value>",
394
+ "2": "<value>",
395
+ },
396
+ },
397
+ ],
398
+ },
399
+ });
400
+ expect(result.httpMeta.response.status).toBe(201);
401
+ expect(result.createTaxRateResponse).toBeDefined();
402
+ expect(result.createTaxRateResponse).toEqual({
403
+ statusCode: 200,
404
+ status: "OK",
405
+ service: "xero",
406
+ resource: "tax-rates",
407
+ operation: "add",
408
+ data: {
409
+ id: "12345",
410
+ },
411
+ });
412
+ });
413
+
414
+ test("Taxrates Accounting Tax Rates One", async () => {
415
+ const testHttpClient = createTestHTTPClient("accounting.taxRatesOne");
416
+
417
+ const apideck = new Apideck({
418
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
419
+ httpClient: testHttpClient,
420
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
421
+ });
422
+
423
+ const result = await apideck.accounting.taxRates.get({
424
+ id: "<id>",
425
+ consumerId: "test-consumer",
426
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
427
+ serviceId: "salesforce",
428
+ fields: "id,updated_at",
429
+ });
430
+ expect(result.httpMeta.response.status).toBe(200);
431
+ expect(result.getTaxRateResponse).toBeDefined();
432
+ expect(result.getTaxRateResponse).toEqual({
433
+ statusCode: 200,
434
+ status: "OK",
435
+ service: "xero",
436
+ resource: "tax-rates",
437
+ operation: "one",
438
+ data: {
439
+ id: "1234",
440
+ name: "GST on Purchases",
441
+ code: "ABN",
442
+ description: "Reduced rate GST Purchases",
443
+ effectiveTaxRate: 10,
444
+ totalTaxRate: 10,
445
+ taxPayableAccountId: "123456",
446
+ taxRemittedAccountId: "123456",
447
+ components: [
448
+ {
449
+ id: "10",
450
+ name: "GST",
451
+ rate: 10,
452
+ compound: true,
453
+ },
454
+ {
455
+ id: "10",
456
+ name: "GST",
457
+ rate: 10,
458
+ compound: true,
459
+ },
460
+ {
461
+ id: "10",
462
+ name: "GST",
463
+ rate: 10,
464
+ compound: true,
465
+ },
466
+ ],
467
+ type: "NONE",
468
+ reportTaxType: "NONE",
469
+ originalTaxRateId: "12345",
470
+ status: "active",
471
+ rowVersion: "1-12345",
472
+ updatedBy: "12345",
473
+ createdBy: "12345",
474
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
475
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
476
+ passThrough: [
477
+ {
478
+ serviceId: "<id>",
479
+ extendPaths: [
480
+ {
481
+ path: "$.nested.property",
482
+ value: {
483
+ "TaxClassificationRef": {
484
+ "value": "EUC-99990201-V1-00020000",
485
+ },
486
+ },
487
+ },
488
+ {
489
+ path: "$.nested.property",
490
+ value: {
491
+ "TaxClassificationRef": {
492
+ "value": "EUC-99990201-V1-00020000",
493
+ },
494
+ },
495
+ },
496
+ ],
497
+ },
498
+ {
499
+ serviceId: "<id>",
500
+ extendPaths: [
501
+ {
502
+ path: "$.nested.property",
503
+ value: {
504
+ "TaxClassificationRef": {
505
+ "value": "EUC-99990201-V1-00020000",
506
+ },
507
+ },
508
+ },
509
+ {
510
+ path: "$.nested.property",
511
+ value: {
512
+ "TaxClassificationRef": {
513
+ "value": "EUC-99990201-V1-00020000",
514
+ },
515
+ },
516
+ },
517
+ ],
518
+ },
519
+ ],
520
+ customFields: [
521
+ {
522
+ id: "2389328923893298",
523
+ name: "employee_level",
524
+ description: "Employee Level",
525
+ value: true,
526
+ },
527
+ {
528
+ id: "2389328923893298",
529
+ name: "employee_level",
530
+ description: "Employee Level",
531
+ value: true,
532
+ },
533
+ {
534
+ id: "2389328923893298",
535
+ name: "employee_level",
536
+ description: "Employee Level",
537
+ value: 10,
538
+ },
539
+ ],
540
+ },
541
+ });
542
+ });
543
+
544
+ test("Taxrates Accounting Tax Rates Update", async () => {
545
+ const testHttpClient = createTestHTTPClient("accounting.taxRatesUpdate");
546
+
547
+ const apideck = new Apideck({
548
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
549
+ httpClient: testHttpClient,
550
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
551
+ });
552
+
553
+ const result = await apideck.accounting.taxRates.update({
554
+ id: "<id>",
555
+ consumerId: "test-consumer",
556
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
557
+ serviceId: "salesforce",
558
+ taxRate: {
559
+ id: "1234",
560
+ name: "GST on Purchases",
561
+ code: "ABN",
562
+ description: "Reduced rate GST Purchases",
563
+ effectiveTaxRate: 10,
564
+ totalTaxRate: 10,
565
+ taxPayableAccountId: "123456",
566
+ taxRemittedAccountId: "123456",
567
+ components: [
568
+ {
569
+ id: "10",
570
+ name: "GST",
571
+ rate: 10,
572
+ compound: true,
573
+ },
574
+ {
575
+ id: "10",
576
+ name: "GST",
577
+ rate: 10,
578
+ compound: true,
579
+ },
580
+ {
581
+ id: "10",
582
+ name: "GST",
583
+ rate: 10,
584
+ compound: true,
585
+ },
586
+ ],
587
+ type: "NONE",
588
+ reportTaxType: "NONE",
589
+ originalTaxRateId: "12345",
590
+ status: "active",
591
+ rowVersion: "1-12345",
592
+ passThrough: [
593
+ {
594
+ serviceId: "<id>",
595
+ extendPaths: [
596
+ {
597
+ path: "$.nested.property",
598
+ value: {
599
+ "TaxClassificationRef": {
600
+ "value": "EUC-99990201-V1-00020000",
601
+ },
602
+ },
603
+ },
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
+ path: "$.nested.property",
627
+ value: {
628
+ "TaxClassificationRef": {
629
+ "value": "EUC-99990201-V1-00020000",
630
+ },
631
+ },
632
+ },
633
+ {
634
+ path: "$.nested.property",
635
+ value: {
636
+ "TaxClassificationRef": {
637
+ "value": "EUC-99990201-V1-00020000",
638
+ },
639
+ },
640
+ },
641
+ ],
642
+ },
643
+ ],
644
+ customFields: [
645
+ {
646
+ id: "2389328923893298",
647
+ name: "employee_level",
648
+ description: "Employee Level",
649
+ value: true,
650
+ },
651
+ {
652
+ id: "2389328923893298",
653
+ name: "employee_level",
654
+ description: "Employee Level",
655
+ value: {},
656
+ },
657
+ ],
658
+ },
659
+ });
660
+ expect(result.httpMeta.response.status).toBe(200);
661
+ expect(result.updateTaxRateResponse).toBeDefined();
662
+ expect(result.updateTaxRateResponse).toEqual({
663
+ statusCode: 200,
664
+ status: "OK",
665
+ service: "xero",
666
+ resource: "tax-rates",
667
+ operation: "update",
668
+ data: {
669
+ id: "12345",
670
+ },
671
+ });
672
+ });
673
+
674
+ test("Taxrates Accounting Tax Rates Delete", async () => {
675
+ const testHttpClient = createTestHTTPClient("accounting.taxRatesDelete");
676
+
677
+ const apideck = new Apideck({
678
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
679
+ httpClient: testHttpClient,
680
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
681
+ });
682
+
683
+ const result = await apideck.accounting.taxRates.delete({
684
+ id: "<id>",
685
+ consumerId: "test-consumer",
686
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
687
+ serviceId: "salesforce",
688
+ });
689
+ expect(result.httpMeta.response.status).toBe(200);
690
+ expect(result.deleteTaxRateResponse).toBeDefined();
691
+ expect(result.deleteTaxRateResponse).toEqual({
692
+ statusCode: 200,
693
+ status: "OK",
694
+ service: "xero",
695
+ resource: "tax-rates",
696
+ operation: "delete",
697
+ data: {
698
+ id: "12345",
699
+ },
700
+ });
701
+ });