@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,634 @@
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("Expensereports Accounting Expense Reports All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.expenseReportsAll");
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.expenseReports.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ fields: "id,updated_at",
23
+ filter: {
24
+ updatedSince: new Date("2020-09-30T07:43:32.000Z"),
25
+ status: "submitted",
26
+ },
27
+ });
28
+ expect(result.httpMeta.response.status).toBe(200);
29
+ expect(result.getExpenseReportsResponse).toBeDefined();
30
+ expect(result.getExpenseReportsResponse).toEqual({
31
+ statusCode: 200,
32
+ status: "OK",
33
+ service: "netsuite",
34
+ resource: "ExpenseReports",
35
+ operation: "all",
36
+ data: [
37
+ {
38
+ id: "12345",
39
+ displayId: "123456",
40
+ number: "ER-001",
41
+ title: "Q1 Business Travel",
42
+ employee: {
43
+ id: "12345",
44
+ displayName: "John Doe",
45
+ },
46
+ status: "submitted",
47
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
48
+ postingDate: new Date("2024-06-01"),
49
+ dueDate: new Date("2024-06-15"),
50
+ currency: "USD",
51
+ currencyRate: 0.69,
52
+ subTotal: 250,
53
+ totalTax: 25,
54
+ totalAmount: 1250.75,
55
+ reimbursableAmount: 1100,
56
+ memo: "Business travel expenses for Q1 client meetings",
57
+ department: {
58
+ id: "12345",
59
+ displayId: "123456",
60
+ name: "Acme Inc.",
61
+ downstreamId: "12345",
62
+ },
63
+ location: {
64
+ id: "123456",
65
+ displayId: "123456",
66
+ name: "New York Office",
67
+ downstreamId: "12345",
68
+ },
69
+ account: {
70
+ id: "123456",
71
+ name: "Bank account",
72
+ nominalCode: "N091",
73
+ code: "453",
74
+ parentId: "123456",
75
+ displayId: "123456",
76
+ },
77
+ accountingPeriod: {
78
+ id: "12345",
79
+ name: "Q1 2024",
80
+ },
81
+ lineItems: [
82
+ {
83
+ id: "12345",
84
+ lineNumber: 1,
85
+ expenseCategory: {
86
+ id: "12345",
87
+ downstreamId: "12345",
88
+ displayId: "Airfare",
89
+ name: "Airfare",
90
+ },
91
+ account: null,
92
+ description: "Flight to New York",
93
+ quantity: 1,
94
+ unitPrice: 27500.5,
95
+ amount: 275,
96
+ taxRate: {
97
+ id: "123456",
98
+ code: "N-T",
99
+ name: "GST on Purchases",
100
+ rate: 10,
101
+ },
102
+ taxAmount: 27.5,
103
+ totalAmount: 302.5,
104
+ transactionDate: new Date("2024-05-15"),
105
+ billable: true,
106
+ reimbursable: true,
107
+ customer: {
108
+ id: "12345",
109
+ displayId: "CUST00101",
110
+ displayName: "Windsurf Shop",
111
+ companyName: "The boring company",
112
+ email: "boring@boring.com",
113
+ },
114
+ department: {
115
+ id: "12345",
116
+ displayId: "123456",
117
+ name: "Acme Inc.",
118
+ downstreamId: "12345",
119
+ },
120
+ location: {
121
+ id: "123456",
122
+ displayId: "123456",
123
+ name: "New York Office",
124
+ downstreamId: "12345",
125
+ },
126
+ trackingCategories: [
127
+ {
128
+ id: "123456",
129
+ code: "100",
130
+ name: "New York",
131
+ parentId: "123456",
132
+ parentName: "New York",
133
+ },
134
+ ],
135
+ receiptUrl: "https://example.com/receipts/123.pdf",
136
+ currency: "USD",
137
+ updatedBy: "12345",
138
+ createdBy: "12345",
139
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
140
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
141
+ },
142
+ ],
143
+ subsidiary: {
144
+ id: "12345",
145
+ displayId: "123456",
146
+ name: "Acme Inc.",
147
+ },
148
+ trackingCategories: [
149
+ {
150
+ id: "123456",
151
+ code: "100",
152
+ name: "New York",
153
+ parentId: "123456",
154
+ parentName: "New York",
155
+ },
156
+ ],
157
+ taxInclusive: true,
158
+ approvedBy: {
159
+ id: "12345",
160
+ displayName: "Jane Smith",
161
+ },
162
+ customFields: [
163
+ {
164
+ id: "2389328923893298",
165
+ name: "employee_level",
166
+ description: "Employee Level",
167
+ value: "Uses Salesforce and Marketo",
168
+ },
169
+ ],
170
+ rowVersion: "1-12345",
171
+ updatedBy: "12345",
172
+ createdBy: "12345",
173
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
174
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
175
+ passThrough: [
176
+ {
177
+ serviceId: "<id>",
178
+ extendPaths: [
179
+ {
180
+ path: "$.nested.property",
181
+ value: {
182
+ "TaxClassificationRef": {
183
+ "value": "EUC-99990201-V1-00020000",
184
+ },
185
+ },
186
+ },
187
+ ],
188
+ },
189
+ ],
190
+ },
191
+ ],
192
+ meta: {
193
+ itemsOnPage: 50,
194
+ cursors: {
195
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
196
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
197
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
198
+ },
199
+ },
200
+ links: {
201
+ previous:
202
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
203
+ current: "https://unify.apideck.com/crm/companies",
204
+ next:
205
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
206
+ },
207
+ });
208
+ });
209
+
210
+ test("Expensereports Accounting Expense Reports Add", async () => {
211
+ const testHttpClient = createTestHTTPClient("accounting.expenseReportsAdd");
212
+
213
+ const apideck = new Apideck({
214
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
215
+ httpClient: testHttpClient,
216
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
217
+ });
218
+
219
+ const result = await apideck.accounting.expenseReports.create({
220
+ consumerId: "test-consumer",
221
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
222
+ serviceId: "salesforce",
223
+ expenseReport: {
224
+ displayId: "123456",
225
+ number: "ER-001",
226
+ title: "Q1 Business Travel",
227
+ employee: {
228
+ id: "12345",
229
+ displayName: "John Doe",
230
+ },
231
+ status: "submitted",
232
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
233
+ postingDate: new Date("2024-06-01"),
234
+ dueDate: new Date("2024-06-15"),
235
+ currency: "USD",
236
+ currencyRate: 0.69,
237
+ subTotal: 250,
238
+ totalTax: 25,
239
+ totalAmount: 1250.75,
240
+ reimbursableAmount: 1100,
241
+ memo: "Business travel expenses for Q1 client meetings",
242
+ department: {
243
+ displayId: "123456",
244
+ name: "Acme Inc.",
245
+ },
246
+ location: {
247
+ id: "123456",
248
+ displayId: "123456",
249
+ name: "New York Office",
250
+ },
251
+ account: null,
252
+ accountingPeriod: {
253
+ id: "12345",
254
+ name: "Q1 2024",
255
+ },
256
+ lineItems: [],
257
+ subsidiary: {
258
+ displayId: "123456",
259
+ name: "Acme Inc.",
260
+ },
261
+ trackingCategories: [
262
+ {
263
+ id: "123456",
264
+ code: "100",
265
+ name: "New York",
266
+ parentId: "123456",
267
+ parentName: "New York",
268
+ },
269
+ ],
270
+ taxInclusive: true,
271
+ approvedBy: {
272
+ id: "12345",
273
+ displayName: "Jane Smith",
274
+ },
275
+ customFields: [
276
+ {
277
+ id: "2389328923893298",
278
+ name: "employee_level",
279
+ description: "Employee Level",
280
+ value: "Uses Salesforce and Marketo",
281
+ },
282
+ ],
283
+ rowVersion: "1-12345",
284
+ passThrough: [
285
+ {
286
+ serviceId: "<id>",
287
+ extendPaths: [
288
+ {
289
+ path: "$.nested.property",
290
+ value: {
291
+ "TaxClassificationRef": {
292
+ "value": "EUC-99990201-V1-00020000",
293
+ },
294
+ },
295
+ },
296
+ ],
297
+ },
298
+ ],
299
+ },
300
+ });
301
+ expect(result.httpMeta.response.status).toBe(201);
302
+ expect(result.createExpenseReportResponse).toBeDefined();
303
+ expect(result.createExpenseReportResponse).toEqual({
304
+ statusCode: 200,
305
+ status: "OK",
306
+ service: "netsuite",
307
+ resource: "ExpenseReports",
308
+ operation: "add",
309
+ data: {
310
+ id: "12345",
311
+ },
312
+ });
313
+ });
314
+
315
+ test("Expensereports Accounting Expense Reports One", async () => {
316
+ const testHttpClient = createTestHTTPClient("accounting.expenseReportsOne");
317
+
318
+ const apideck = new Apideck({
319
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
320
+ httpClient: testHttpClient,
321
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
322
+ });
323
+
324
+ const result = await apideck.accounting.expenseReports.get({
325
+ id: "<id>",
326
+ consumerId: "test-consumer",
327
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
328
+ serviceId: "salesforce",
329
+ fields: "id,updated_at",
330
+ });
331
+ expect(result.httpMeta.response.status).toBe(200);
332
+ expect(result.getExpenseReportResponse).toBeDefined();
333
+ expect(result.getExpenseReportResponse).toEqual({
334
+ statusCode: 200,
335
+ status: "OK",
336
+ service: "netsuite",
337
+ resource: "ExpenseReports",
338
+ operation: "one",
339
+ data: {
340
+ id: "12345",
341
+ displayId: "123456",
342
+ number: "ER-001",
343
+ title: "Q1 Business Travel",
344
+ employee: {
345
+ id: "12345",
346
+ displayName: "John Doe",
347
+ },
348
+ status: "submitted",
349
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
350
+ postingDate: new Date("2024-06-01"),
351
+ dueDate: new Date("2024-06-15"),
352
+ currency: "USD",
353
+ currencyRate: 0.69,
354
+ subTotal: 250,
355
+ totalTax: 25,
356
+ totalAmount: 1250.75,
357
+ reimbursableAmount: 1100,
358
+ memo: "Business travel expenses for Q1 client meetings",
359
+ department: {
360
+ id: "12345",
361
+ displayId: "123456",
362
+ name: "Acme Inc.",
363
+ downstreamId: "12345",
364
+ },
365
+ location: {
366
+ id: "123456",
367
+ displayId: "123456",
368
+ name: "New York Office",
369
+ downstreamId: "12345",
370
+ },
371
+ account: {
372
+ id: "123456",
373
+ name: "Bank account",
374
+ nominalCode: "N091",
375
+ code: "453",
376
+ parentId: "123456",
377
+ displayId: "123456",
378
+ },
379
+ accountingPeriod: {
380
+ id: "12345",
381
+ name: "Q1 2024",
382
+ },
383
+ lineItems: [
384
+ {
385
+ id: "12345",
386
+ lineNumber: 1,
387
+ expenseCategory: {
388
+ id: "12345",
389
+ downstreamId: "12345",
390
+ displayId: "Airfare",
391
+ name: "Airfare",
392
+ },
393
+ account: {
394
+ id: "123456",
395
+ name: "Bank account",
396
+ nominalCode: "N091",
397
+ code: "453",
398
+ parentId: "123456",
399
+ displayId: "123456",
400
+ },
401
+ description: "Flight to New York",
402
+ quantity: 1,
403
+ unitPrice: 27500.5,
404
+ amount: 275,
405
+ taxRate: {
406
+ id: "123456",
407
+ code: "N-T",
408
+ name: "GST on Purchases",
409
+ rate: 10,
410
+ },
411
+ taxAmount: 27.5,
412
+ totalAmount: 302.5,
413
+ transactionDate: new Date("2024-05-15"),
414
+ billable: true,
415
+ reimbursable: true,
416
+ customer: {
417
+ id: "12345",
418
+ displayId: "CUST00101",
419
+ displayName: "Windsurf Shop",
420
+ companyName: "The boring company",
421
+ email: "boring@boring.com",
422
+ },
423
+ department: {
424
+ id: "12345",
425
+ displayId: "123456",
426
+ name: "Acme Inc.",
427
+ downstreamId: "12345",
428
+ },
429
+ location: null,
430
+ trackingCategories: [
431
+ {
432
+ id: "123456",
433
+ code: "100",
434
+ name: "New York",
435
+ parentId: "123456",
436
+ parentName: "New York",
437
+ },
438
+ ],
439
+ receiptUrl: "https://example.com/receipts/123.pdf",
440
+ currency: "USD",
441
+ updatedBy: "12345",
442
+ createdBy: "12345",
443
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
444
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
445
+ },
446
+ ],
447
+ subsidiary: {
448
+ id: "12345",
449
+ displayId: "123456",
450
+ name: "Acme Inc.",
451
+ },
452
+ trackingCategories: [
453
+ {
454
+ id: "123456",
455
+ code: "100",
456
+ name: "New York",
457
+ parentId: "123456",
458
+ parentName: "New York",
459
+ },
460
+ ],
461
+ taxInclusive: true,
462
+ approvedBy: {
463
+ id: "12345",
464
+ displayName: "Jane Smith",
465
+ },
466
+ customFields: [
467
+ {
468
+ id: "2389328923893298",
469
+ name: "employee_level",
470
+ description: "Employee Level",
471
+ value: "Uses Salesforce and Marketo",
472
+ },
473
+ ],
474
+ rowVersion: "1-12345",
475
+ updatedBy: "12345",
476
+ createdBy: "12345",
477
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
478
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
479
+ passThrough: [
480
+ {
481
+ serviceId: "<id>",
482
+ extendPaths: [
483
+ {
484
+ path: "$.nested.property",
485
+ value: {
486
+ "TaxClassificationRef": {
487
+ "value": "EUC-99990201-V1-00020000",
488
+ },
489
+ },
490
+ },
491
+ ],
492
+ },
493
+ ],
494
+ },
495
+ });
496
+ });
497
+
498
+ test("Expensereports Accounting Expense Reports Update", async () => {
499
+ const testHttpClient = createTestHTTPClient(
500
+ "accounting.expenseReportsUpdate",
501
+ );
502
+
503
+ const apideck = new Apideck({
504
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
505
+ httpClient: testHttpClient,
506
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
507
+ });
508
+
509
+ const result = await apideck.accounting.expenseReports.update({
510
+ id: "<id>",
511
+ consumerId: "test-consumer",
512
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
513
+ serviceId: "salesforce",
514
+ expenseReport: {
515
+ displayId: "123456",
516
+ number: "ER-001",
517
+ title: "Q1 Business Travel",
518
+ employee: {
519
+ id: "12345",
520
+ displayName: "John Doe",
521
+ },
522
+ status: "submitted",
523
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
524
+ postingDate: new Date("2024-06-01"),
525
+ dueDate: new Date("2024-06-15"),
526
+ currency: "USD",
527
+ currencyRate: 0.69,
528
+ subTotal: 250,
529
+ totalTax: 25,
530
+ totalAmount: 1250.75,
531
+ reimbursableAmount: 1100,
532
+ memo: "Business travel expenses for Q1 client meetings",
533
+ department: {
534
+ displayId: "123456",
535
+ name: "Acme Inc.",
536
+ },
537
+ location: {
538
+ id: "123456",
539
+ displayId: "123456",
540
+ name: "New York Office",
541
+ },
542
+ account: {
543
+ id: "123456",
544
+ name: "Bank account",
545
+ nominalCode: "N091",
546
+ code: "453",
547
+ parentId: "123456",
548
+ displayId: "123456",
549
+ },
550
+ accountingPeriod: {
551
+ id: "12345",
552
+ name: "Q1 2024",
553
+ },
554
+ lineItems: [],
555
+ subsidiary: {
556
+ displayId: "123456",
557
+ name: "Acme Inc.",
558
+ },
559
+ trackingCategories: null,
560
+ taxInclusive: true,
561
+ approvedBy: {
562
+ id: "12345",
563
+ displayName: "Jane Smith",
564
+ },
565
+ customFields: [
566
+ {
567
+ id: "2389328923893298",
568
+ name: "employee_level",
569
+ description: "Employee Level",
570
+ value: "Uses Salesforce and Marketo",
571
+ },
572
+ ],
573
+ rowVersion: "1-12345",
574
+ passThrough: [
575
+ {
576
+ serviceId: "<id>",
577
+ extendPaths: [
578
+ {
579
+ path: "$.nested.property",
580
+ value: {
581
+ "TaxClassificationRef": {
582
+ "value": "EUC-99990201-V1-00020000",
583
+ },
584
+ },
585
+ },
586
+ ],
587
+ },
588
+ ],
589
+ },
590
+ });
591
+ expect(result.httpMeta.response.status).toBe(200);
592
+ expect(result.updateExpenseReportResponse).toBeDefined();
593
+ expect(result.updateExpenseReportResponse).toEqual({
594
+ statusCode: 200,
595
+ status: "OK",
596
+ service: "netsuite",
597
+ resource: "ExpenseReports",
598
+ operation: "update",
599
+ data: {
600
+ id: "12345",
601
+ },
602
+ });
603
+ });
604
+
605
+ test("Expensereports Accounting Expense Reports Delete", async () => {
606
+ const testHttpClient = createTestHTTPClient(
607
+ "accounting.expenseReportsDelete",
608
+ );
609
+
610
+ const apideck = new Apideck({
611
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
612
+ httpClient: testHttpClient,
613
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
614
+ });
615
+
616
+ const result = await apideck.accounting.expenseReports.delete({
617
+ id: "<id>",
618
+ consumerId: "test-consumer",
619
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
620
+ serviceId: "salesforce",
621
+ });
622
+ expect(result.httpMeta.response.status).toBe(200);
623
+ expect(result.deleteExpenseReportResponse).toBeDefined();
624
+ expect(result.deleteExpenseReportResponse).toEqual({
625
+ statusCode: 200,
626
+ status: "OK",
627
+ service: "netsuite",
628
+ resource: "ExpenseReports",
629
+ operation: "delete",
630
+ data: {
631
+ id: "12345",
632
+ },
633
+ });
634
+ });