@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,678 @@
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("Quotes Accounting Quotes All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.quotesAll");
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.quotes.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ companyId: "12345",
23
+ });
24
+ expect(result.httpMeta.response.status).toBe(200);
25
+ expect(result.getQuotesResponse).toBeDefined();
26
+ expect(result.getQuotesResponse).toEqual({
27
+ statusCode: 200,
28
+ status: "OK",
29
+ service: "quickbooks",
30
+ resource: "Quotes",
31
+ operation: "all",
32
+ data: [],
33
+ meta: {
34
+ itemsOnPage: 50,
35
+ cursors: {
36
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
37
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
38
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
39
+ },
40
+ },
41
+ links: {
42
+ previous:
43
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
44
+ current: "https://unify.apideck.com/crm/companies",
45
+ next:
46
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
47
+ },
48
+ });
49
+ });
50
+
51
+ test("Quotes Accounting Quotes Add", async () => {
52
+ const testHttpClient = createTestHTTPClient("accounting.quotesAdd");
53
+
54
+ const apideck = new Apideck({
55
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
56
+ httpClient: testHttpClient,
57
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
58
+ });
59
+
60
+ const result = await apideck.accounting.quotes.create({
61
+ consumerId: "test-consumer",
62
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
63
+ serviceId: "salesforce",
64
+ companyId: "12345",
65
+ quote: {
66
+ number: "QT00546",
67
+ customer: {
68
+ id: "12345",
69
+ displayName: "Windsurf Shop",
70
+ email: "boring@boring.com",
71
+ },
72
+ salesOrderId: "123456",
73
+ companyId: "12345",
74
+ departmentId: "12345",
75
+ projectId: "12345",
76
+ quoteDate: new Date("2020-09-30"),
77
+ expiryDate: new Date("2020-10-30"),
78
+ terms: "Valid for 30 days",
79
+ termsId: "12345",
80
+ reference: "INV-2024-001",
81
+ status: "draft",
82
+ currency: "USD",
83
+ currencyRate: 0.69,
84
+ taxInclusive: true,
85
+ subTotal: 27500,
86
+ totalTax: 2500,
87
+ taxCode: "1234",
88
+ discountPercentage: 5.5,
89
+ discountAmount: 25,
90
+ total: 27500,
91
+ customerMemo: "Thank you for considering our services!",
92
+ lineItems: [
93
+ {
94
+ id: "12345",
95
+ rowId: "12345",
96
+ code: "120-C",
97
+ lineNumber: 1,
98
+ description:
99
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
100
+ type: "sales_item",
101
+ taxAmount: 27500,
102
+ totalAmount: 27500,
103
+ quantity: 1,
104
+ unitPrice: 27500.5,
105
+ unitOfMeasure: "pc.",
106
+ discountPercentage: 0.01,
107
+ discountAmount: 19.99,
108
+ categoryId: "12345",
109
+ locationId: "12345",
110
+ departmentId: "12345",
111
+ item: {
112
+ id: "12344",
113
+ code: "120-C",
114
+ name: "Model Y",
115
+ },
116
+ taxRate: {
117
+ id: "123456",
118
+ rate: 10,
119
+ },
120
+ trackingCategories: [
121
+ {
122
+ id: "123456",
123
+ name: "New York",
124
+ parentId: "123456",
125
+ parentName: "New York",
126
+ },
127
+ ],
128
+ ledgerAccount: {
129
+ id: "123456",
130
+ nominalCode: "N091",
131
+ code: "453",
132
+ },
133
+ customFields: [
134
+ {
135
+ id: "2389328923893298",
136
+ name: "employee_level",
137
+ description: "Employee Level",
138
+ value: "Uses Salesforce and Marketo",
139
+ },
140
+ ],
141
+ rowVersion: "1-12345",
142
+ },
143
+ ],
144
+ billingAddress: {
145
+ id: "123",
146
+ type: "primary",
147
+ string: "25 Spring Street, Blackburn, VIC 3130",
148
+ name: "HQ US",
149
+ line1: "Main street",
150
+ line2: "apt #",
151
+ line3: "Suite #",
152
+ line4: "delivery instructions",
153
+ line5: "Attention: Finance Dept",
154
+ streetNumber: "25",
155
+ city: "San Francisco",
156
+ state: "CA",
157
+ postalCode: "94104",
158
+ country: "US",
159
+ latitude: "40.759211",
160
+ longitude: "-73.984638",
161
+ county: "Santa Clara",
162
+ contactName: "Elon Musk",
163
+ salutation: "Mr",
164
+ phoneNumber: "111-111-1111",
165
+ fax: "122-111-1111",
166
+ email: "elon@musk.com",
167
+ website: "https://elonmusk.com",
168
+ notes: "Address notes or delivery instructions.",
169
+ rowVersion: "1-12345",
170
+ },
171
+ shippingAddress: {
172
+ id: "123",
173
+ type: "primary",
174
+ string: "25 Spring Street, Blackburn, VIC 3130",
175
+ name: "HQ US",
176
+ line1: "Main street",
177
+ line2: "apt #",
178
+ line3: "Suite #",
179
+ line4: "delivery instructions",
180
+ line5: "Attention: Finance Dept",
181
+ streetNumber: "25",
182
+ city: "San Francisco",
183
+ state: "CA",
184
+ postalCode: "94104",
185
+ country: "US",
186
+ latitude: "40.759211",
187
+ longitude: "-73.984638",
188
+ county: "Santa Clara",
189
+ contactName: "Elon Musk",
190
+ salutation: "Mr",
191
+ phoneNumber: "111-111-1111",
192
+ fax: "122-111-1111",
193
+ email: "elon@musk.com",
194
+ website: "https://elonmusk.com",
195
+ notes: "Address notes or delivery instructions.",
196
+ rowVersion: "1-12345",
197
+ },
198
+ trackingCategories: [
199
+ {
200
+ id: "123456",
201
+ name: "New York",
202
+ parentId: "123456",
203
+ parentName: "New York",
204
+ },
205
+ ],
206
+ templateId: "123456",
207
+ sourceDocumentUrl: "https://www.quotesolution.com/quote/123456",
208
+ customFields: [
209
+ {
210
+ id: "2389328923893298",
211
+ name: "employee_level",
212
+ description: "Employee Level",
213
+ value: "Uses Salesforce and Marketo",
214
+ },
215
+ ],
216
+ rowVersion: "1-12345",
217
+ passThrough: [
218
+ {
219
+ serviceId: "<id>",
220
+ extendPaths: [
221
+ {
222
+ path: "$.nested.property",
223
+ value: {
224
+ "TaxClassificationRef": {
225
+ "value": "EUC-99990201-V1-00020000",
226
+ },
227
+ },
228
+ },
229
+ ],
230
+ },
231
+ ],
232
+ },
233
+ });
234
+ expect(result.httpMeta.response.status).toBe(201);
235
+ expect(result.createQuoteResponse).toBeDefined();
236
+ expect(result.createQuoteResponse).toEqual({
237
+ statusCode: 200,
238
+ status: "OK",
239
+ service: "quickbooks",
240
+ resource: "Quotes",
241
+ operation: "add",
242
+ data: {
243
+ id: "12345",
244
+ },
245
+ });
246
+ });
247
+
248
+ test("Quotes Accounting Quotes One", async () => {
249
+ const testHttpClient = createTestHTTPClient("accounting.quotesOne");
250
+
251
+ const apideck = new Apideck({
252
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
253
+ httpClient: testHttpClient,
254
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
255
+ });
256
+
257
+ const result = await apideck.accounting.quotes.get({
258
+ id: "<id>",
259
+ consumerId: "test-consumer",
260
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
261
+ serviceId: "salesforce",
262
+ companyId: "12345",
263
+ });
264
+ expect(result.httpMeta.response.status).toBe(200);
265
+ expect(result.getQuoteResponse).toBeDefined();
266
+ expect(result.getQuoteResponse).toEqual({
267
+ statusCode: 200,
268
+ status: "OK",
269
+ service: "quickbooks",
270
+ resource: "Quotes",
271
+ operation: "one",
272
+ data: {
273
+ id: "12345",
274
+ downstreamId: "12345",
275
+ number: "QT00546",
276
+ customer: {
277
+ id: "12345",
278
+ displayId: "CUST00101",
279
+ displayName: "Windsurf Shop",
280
+ companyName: "The boring company",
281
+ email: "boring@boring.com",
282
+ },
283
+ invoiceId: "123456",
284
+ salesOrderId: "123456",
285
+ companyId: "12345",
286
+ departmentId: "12345",
287
+ projectId: "12345",
288
+ quoteDate: new Date("2020-09-30"),
289
+ expiryDate: new Date("2020-10-30"),
290
+ terms: "Valid for 30 days",
291
+ termsId: "12345",
292
+ reference: "INV-2024-001",
293
+ status: "draft",
294
+ currency: "USD",
295
+ currencyRate: 0.69,
296
+ taxInclusive: true,
297
+ subTotal: 27500,
298
+ totalTax: 2500,
299
+ taxCode: "1234",
300
+ discountPercentage: 5.5,
301
+ discountAmount: 25,
302
+ total: 27500,
303
+ customerMemo: "Thank you for considering our services!",
304
+ lineItems: [
305
+ {
306
+ id: "12345",
307
+ rowId: "12345",
308
+ code: "120-C",
309
+ lineNumber: 1,
310
+ description:
311
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
312
+ type: "sales_item",
313
+ taxAmount: 27500,
314
+ totalAmount: 27500,
315
+ quantity: 1,
316
+ unitPrice: 27500.5,
317
+ unitOfMeasure: "pc.",
318
+ discountPercentage: 0.01,
319
+ discountAmount: 19.99,
320
+ categoryId: "12345",
321
+ locationId: "12345",
322
+ departmentId: "12345",
323
+ item: {
324
+ id: "12344",
325
+ code: "120-C",
326
+ name: "Model Y",
327
+ },
328
+ taxRate: {
329
+ id: "123456",
330
+ code: "N-T",
331
+ name: "GST on Purchases",
332
+ rate: 10,
333
+ },
334
+ trackingCategories: [
335
+ {
336
+ id: "123456",
337
+ name: "New York",
338
+ parentId: "123456",
339
+ parentName: "New York",
340
+ },
341
+ ],
342
+ ledgerAccount: {
343
+ id: "123456",
344
+ name: "Bank account",
345
+ nominalCode: "N091",
346
+ code: "453",
347
+ },
348
+ customFields: [
349
+ {
350
+ id: "2389328923893298",
351
+ name: "employee_level",
352
+ description: "Employee Level",
353
+ value: "Uses Salesforce and Marketo",
354
+ },
355
+ ],
356
+ rowVersion: "1-12345",
357
+ updatedBy: "12345",
358
+ createdBy: "12345",
359
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
360
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
361
+ },
362
+ ],
363
+ billingAddress: {
364
+ id: "123",
365
+ type: "primary",
366
+ string: "25 Spring Street, Blackburn, VIC 3130",
367
+ name: "HQ US",
368
+ line1: "Main street",
369
+ line2: "apt #",
370
+ line3: "Suite #",
371
+ line4: "delivery instructions",
372
+ line5: "Attention: Finance Dept",
373
+ streetNumber: "25",
374
+ city: "San Francisco",
375
+ state: "CA",
376
+ postalCode: "94104",
377
+ country: "US",
378
+ latitude: "40.759211",
379
+ longitude: "-73.984638",
380
+ county: "Santa Clara",
381
+ contactName: "Elon Musk",
382
+ salutation: "Mr",
383
+ phoneNumber: "111-111-1111",
384
+ fax: "122-111-1111",
385
+ email: "elon@musk.com",
386
+ website: "https://elonmusk.com",
387
+ notes: "Address notes or delivery instructions.",
388
+ rowVersion: "1-12345",
389
+ },
390
+ shippingAddress: {
391
+ id: "123",
392
+ type: "primary",
393
+ string: "25 Spring Street, Blackburn, VIC 3130",
394
+ name: "HQ US",
395
+ line1: "Main street",
396
+ line2: "apt #",
397
+ line3: "Suite #",
398
+ line4: "delivery instructions",
399
+ line5: "Attention: Finance Dept",
400
+ streetNumber: "25",
401
+ city: "San Francisco",
402
+ state: "CA",
403
+ postalCode: "94104",
404
+ country: "US",
405
+ latitude: "40.759211",
406
+ longitude: "-73.984638",
407
+ county: "Santa Clara",
408
+ contactName: "Elon Musk",
409
+ salutation: "Mr",
410
+ phoneNumber: "111-111-1111",
411
+ fax: "122-111-1111",
412
+ email: "elon@musk.com",
413
+ website: "https://elonmusk.com",
414
+ notes: "Address notes or delivery instructions.",
415
+ rowVersion: "1-12345",
416
+ },
417
+ trackingCategories: [
418
+ {
419
+ id: "123456",
420
+ name: "New York",
421
+ parentId: "123456",
422
+ parentName: "New York",
423
+ },
424
+ ],
425
+ templateId: "123456",
426
+ sourceDocumentUrl: "https://www.quotesolution.com/quote/123456",
427
+ customFields: [
428
+ {
429
+ id: "2389328923893298",
430
+ name: "employee_level",
431
+ description: "Employee Level",
432
+ value: "Uses Salesforce and Marketo",
433
+ },
434
+ ],
435
+ rowVersion: "1-12345",
436
+ updatedBy: "12345",
437
+ createdBy: "12345",
438
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
439
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
440
+ passThrough: [
441
+ {
442
+ serviceId: "<id>",
443
+ extendPaths: [
444
+ {
445
+ path: "$.nested.property",
446
+ value: {
447
+ "TaxClassificationRef": {
448
+ "value": "EUC-99990201-V1-00020000",
449
+ },
450
+ },
451
+ },
452
+ ],
453
+ },
454
+ ],
455
+ },
456
+ });
457
+ });
458
+
459
+ test("Quotes Accounting Quotes Update", async () => {
460
+ const testHttpClient = createTestHTTPClient("accounting.quotesUpdate");
461
+
462
+ const apideck = new Apideck({
463
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
464
+ httpClient: testHttpClient,
465
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
466
+ });
467
+
468
+ const result = await apideck.accounting.quotes.update({
469
+ id: "<id>",
470
+ consumerId: "test-consumer",
471
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
472
+ serviceId: "salesforce",
473
+ companyId: "12345",
474
+ quote: {
475
+ number: "QT00546",
476
+ customer: {
477
+ id: "12345",
478
+ displayName: "Windsurf Shop",
479
+ email: "boring@boring.com",
480
+ },
481
+ salesOrderId: "123456",
482
+ companyId: "12345",
483
+ departmentId: "12345",
484
+ projectId: "12345",
485
+ quoteDate: new Date("2020-09-30"),
486
+ expiryDate: new Date("2020-10-30"),
487
+ terms: "Valid for 30 days",
488
+ termsId: "12345",
489
+ reference: "INV-2024-001",
490
+ status: "draft",
491
+ currency: "USD",
492
+ currencyRate: 0.69,
493
+ taxInclusive: true,
494
+ subTotal: 27500,
495
+ totalTax: 2500,
496
+ taxCode: "1234",
497
+ discountPercentage: 5.5,
498
+ discountAmount: 25,
499
+ total: 27500,
500
+ customerMemo: "Thank you for considering our services!",
501
+ lineItems: [
502
+ {
503
+ id: "12345",
504
+ rowId: "12345",
505
+ code: "120-C",
506
+ lineNumber: 1,
507
+ description:
508
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
509
+ type: "sales_item",
510
+ taxAmount: 27500,
511
+ totalAmount: 27500,
512
+ quantity: 1,
513
+ unitPrice: 27500.5,
514
+ unitOfMeasure: "pc.",
515
+ discountPercentage: 0.01,
516
+ discountAmount: 19.99,
517
+ categoryId: "12345",
518
+ locationId: "12345",
519
+ departmentId: "12345",
520
+ item: {
521
+ id: "12344",
522
+ code: "120-C",
523
+ name: "Model Y",
524
+ },
525
+ taxRate: {
526
+ id: "123456",
527
+ rate: 10,
528
+ },
529
+ trackingCategories: null,
530
+ ledgerAccount: {
531
+ id: "123456",
532
+ nominalCode: "N091",
533
+ code: "453",
534
+ },
535
+ customFields: [
536
+ {
537
+ id: "2389328923893298",
538
+ name: "employee_level",
539
+ description: "Employee Level",
540
+ value: "Uses Salesforce and Marketo",
541
+ },
542
+ ],
543
+ rowVersion: "1-12345",
544
+ },
545
+ ],
546
+ billingAddress: {
547
+ id: "123",
548
+ type: "primary",
549
+ string: "25 Spring Street, Blackburn, VIC 3130",
550
+ name: "HQ US",
551
+ line1: "Main street",
552
+ line2: "apt #",
553
+ line3: "Suite #",
554
+ line4: "delivery instructions",
555
+ line5: "Attention: Finance Dept",
556
+ streetNumber: "25",
557
+ city: "San Francisco",
558
+ state: "CA",
559
+ postalCode: "94104",
560
+ country: "US",
561
+ latitude: "40.759211",
562
+ longitude: "-73.984638",
563
+ county: "Santa Clara",
564
+ contactName: "Elon Musk",
565
+ salutation: "Mr",
566
+ phoneNumber: "111-111-1111",
567
+ fax: "122-111-1111",
568
+ email: "elon@musk.com",
569
+ website: "https://elonmusk.com",
570
+ notes: "Address notes or delivery instructions.",
571
+ rowVersion: "1-12345",
572
+ },
573
+ shippingAddress: {
574
+ id: "123",
575
+ type: "primary",
576
+ string: "25 Spring Street, Blackburn, VIC 3130",
577
+ name: "HQ US",
578
+ line1: "Main street",
579
+ line2: "apt #",
580
+ line3: "Suite #",
581
+ line4: "delivery instructions",
582
+ line5: "Attention: Finance Dept",
583
+ streetNumber: "25",
584
+ city: "San Francisco",
585
+ state: "CA",
586
+ postalCode: "94104",
587
+ country: "US",
588
+ latitude: "40.759211",
589
+ longitude: "-73.984638",
590
+ county: "Santa Clara",
591
+ contactName: "Elon Musk",
592
+ salutation: "Mr",
593
+ phoneNumber: "111-111-1111",
594
+ fax: "122-111-1111",
595
+ email: "elon@musk.com",
596
+ website: "https://elonmusk.com",
597
+ notes: "Address notes or delivery instructions.",
598
+ rowVersion: "1-12345",
599
+ },
600
+ trackingCategories: [
601
+ {
602
+ id: "123456",
603
+ name: "New York",
604
+ parentId: "123456",
605
+ parentName: "New York",
606
+ },
607
+ ],
608
+ templateId: "123456",
609
+ sourceDocumentUrl: "https://www.quotesolution.com/quote/123456",
610
+ customFields: [
611
+ {
612
+ id: "2389328923893298",
613
+ name: "employee_level",
614
+ description: "Employee Level",
615
+ value: "Uses Salesforce and Marketo",
616
+ },
617
+ ],
618
+ rowVersion: "1-12345",
619
+ passThrough: [
620
+ {
621
+ serviceId: "<id>",
622
+ extendPaths: [
623
+ {
624
+ path: "$.nested.property",
625
+ value: {
626
+ "TaxClassificationRef": {
627
+ "value": "EUC-99990201-V1-00020000",
628
+ },
629
+ },
630
+ },
631
+ ],
632
+ },
633
+ ],
634
+ },
635
+ });
636
+ expect(result.httpMeta.response.status).toBe(200);
637
+ expect(result.updateQuoteResponse).toBeDefined();
638
+ expect(result.updateQuoteResponse).toEqual({
639
+ statusCode: 200,
640
+ status: "OK",
641
+ service: "quickbooks",
642
+ resource: "Quotes",
643
+ operation: "update",
644
+ data: {
645
+ id: "12345",
646
+ },
647
+ });
648
+ });
649
+
650
+ test("Quotes Accounting Quotes Delete", async () => {
651
+ const testHttpClient = createTestHTTPClient("accounting.quotesDelete");
652
+
653
+ const apideck = new Apideck({
654
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
655
+ httpClient: testHttpClient,
656
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
657
+ });
658
+
659
+ const result = await apideck.accounting.quotes.delete({
660
+ id: "<id>",
661
+ consumerId: "test-consumer",
662
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
663
+ serviceId: "salesforce",
664
+ companyId: "12345",
665
+ });
666
+ expect(result.httpMeta.response.status).toBe(200);
667
+ expect(result.deleteQuoteResponse).toBeDefined();
668
+ expect(result.deleteQuoteResponse).toEqual({
669
+ statusCode: 200,
670
+ status: "OK",
671
+ service: "quickbooks",
672
+ resource: "Quotes",
673
+ operation: "delete",
674
+ data: {
675
+ id: "12345",
676
+ },
677
+ });
678
+ });