@apideck/unify 0.23.0 → 0.23.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 (93) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/note.d.ts +5 -0
  5. package/models/components/note.d.ts.map +1 -1
  6. package/models/components/note.js +4 -0
  7. package/models/components/note.js.map +1 -1
  8. package/models/components/noteinput.d.ts +5 -0
  9. package/models/components/noteinput.d.ts.map +1 -1
  10. package/models/components/noteinput.js +4 -0
  11. package/models/components/noteinput.js.map +1 -1
  12. package/package.json +5 -1
  13. package/src/__tests__/activities.test.ts +783 -0
  14. package/src/__tests__/agedcreditors.test.ts +279 -0
  15. package/src/__tests__/ageddebtors.test.ts +279 -0
  16. package/src/__tests__/apideckcompanies.test.ts +712 -0
  17. package/src/__tests__/apideckcustomers.test.ts +360 -0
  18. package/src/__tests__/apideckdepartments.test.ts +319 -0
  19. package/src/__tests__/apiresources.test.ts +61 -0
  20. package/src/__tests__/apis.test.ts +214 -0
  21. package/src/__tests__/applicants.test.ts +976 -0
  22. package/src/__tests__/applications.test.ts +329 -0
  23. package/src/__tests__/assertions.ts +13 -0
  24. package/src/__tests__/attachments.test.ts +363 -0
  25. package/src/__tests__/balancesheet.test.ts +451 -0
  26. package/src/__tests__/billpayments.test.ts +666 -0
  27. package/src/__tests__/bills.test.ts +1133 -0
  28. package/src/__tests__/collections.test.ts +115 -0
  29. package/src/__tests__/collectiontags.test.ts +66 -0
  30. package/src/__tests__/collectionticketcomments.test.ts +318 -0
  31. package/src/__tests__/collectiontickets.test.ts +436 -0
  32. package/src/__tests__/collectionusers.test.ts +122 -0
  33. package/src/__tests__/companies.test.ts +1059 -0
  34. package/src/__tests__/companyinfo.test.ts +218 -0
  35. package/src/__tests__/connectioncustommappings.test.ts +67 -0
  36. package/src/__tests__/connections.test.ts +1713 -0
  37. package/src/__tests__/connectionsettings.test.ts +280 -0
  38. package/src/__tests__/connectordocs.test.ts +28 -0
  39. package/src/__tests__/connectors.test.ts +751 -0
  40. package/src/__tests__/consumerrequestcounts.test.ts +41 -0
  41. package/src/__tests__/consumers.test.ts +517 -0
  42. package/src/__tests__/contacts.test.ts +957 -0
  43. package/src/__tests__/createcallback.test.ts +34 -0
  44. package/src/__tests__/creditnotes.test.ts +1362 -0
  45. package/src/__tests__/customers.test.ts +1089 -0
  46. package/src/__tests__/customfields.test.ts +50 -0
  47. package/src/__tests__/custommappings.test.ts +63 -0
  48. package/src/__tests__/departments.test.ts +359 -0
  49. package/src/__tests__/drivegroups.test.ts +318 -0
  50. package/src/__tests__/drives.test.ts +311 -0
  51. package/src/__tests__/employeepayrolls.test.ts +487 -0
  52. package/src/__tests__/employees.test.ts +1682 -0
  53. package/src/__tests__/employeeschedules.test.ts +456 -0
  54. package/src/__tests__/eventlogs.test.ts +157 -0
  55. package/src/__tests__/expenses.test.ts +566 -0
  56. package/src/__tests__/files.test.ts +392 -0
  57. package/src/__tests__/files.ts +56 -0
  58. package/src/__tests__/folders.test.ts +103 -0
  59. package/src/__tests__/invoiceitems.test.ts +586 -0
  60. package/src/__tests__/invoices.test.ts +1561 -0
  61. package/src/__tests__/jobs.test.ts +837 -0
  62. package/src/__tests__/journalentries.test.ts +1053 -0
  63. package/src/__tests__/leads.test.ts +897 -0
  64. package/src/__tests__/ledgeraccounts.test.ts +594 -0
  65. package/src/__tests__/locations.test.ts +561 -0
  66. package/src/__tests__/logs.test.ts +135 -0
  67. package/src/__tests__/messages.test.ts +396 -0
  68. package/src/__tests__/mockserver/README.md +52 -0
  69. package/src/__tests__/notes.test.ts +335 -0
  70. package/src/__tests__/opportunities.test.ts +503 -0
  71. package/src/__tests__/orders.test.ts +849 -0
  72. package/src/__tests__/payments.test.ts +557 -0
  73. package/src/__tests__/payrolls.test.ts +481 -0
  74. package/src/__tests__/pipelines.test.ts +383 -0
  75. package/src/__tests__/products.test.ts +505 -0
  76. package/src/__tests__/profitandloss.test.ts +221 -0
  77. package/src/__tests__/purchaseorders.test.ts +1464 -0
  78. package/src/__tests__/sessions.test.ts +70 -0
  79. package/src/__tests__/sharedlinks.test.ts +331 -0
  80. package/src/__tests__/stores.test.ts +39 -0
  81. package/src/__tests__/subsidiaries.test.ts +316 -0
  82. package/src/__tests__/suppliers.test.ts +1071 -0
  83. package/src/__tests__/taxrates.test.ts +472 -0
  84. package/src/__tests__/testclient.ts +48 -0
  85. package/src/__tests__/timeoffrequests.test.ts +381 -0
  86. package/src/__tests__/trackingcategories.test.ts +329 -0
  87. package/src/__tests__/uploadsessions.test.ts +142 -0
  88. package/src/__tests__/users.test.ts +667 -0
  89. package/src/__tests__/validateconnection.test.ts +32 -0
  90. package/src/__tests__/webhooks.test.ts +248 -0
  91. package/src/lib/config.ts +3 -3
  92. package/src/models/components/note.ts +9 -0
  93. package/src/models/components/noteinput.ts +9 -0
@@ -0,0 +1,566 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { assert, expect, it, test } from "vitest";
6
+ import { Apideck } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Expenses Accounting Expenses All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.expensesAll");
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.expenses.list({
19
+ serviceId: "salesforce",
20
+ });
21
+ expect(result.httpMeta.response.status).toBe(200);
22
+ expect(result.getExpensesResponse).toBeDefined();
23
+ expect(result.getExpensesResponse).toEqual({
24
+ statusCode: 200,
25
+ status: "OK",
26
+ service: "quickbooks",
27
+ resource: "Expenses",
28
+ operation: "all",
29
+ data: [
30
+ {
31
+ id: "12345",
32
+ number: "OIT00546",
33
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
34
+ accountId: "123456",
35
+ customerId: "12345",
36
+ supplierId: "12345",
37
+ companyId: "12345",
38
+ departmentId: "12345",
39
+ paymentType: "cash",
40
+ currency: "USD",
41
+ currencyRate: 0.69,
42
+ type: "expense",
43
+ memo: "For travel expenses incurred on 2024-05-15",
44
+ taxRate: {
45
+ id: "123456",
46
+ code: "N-T",
47
+ name: "GST on Purchases",
48
+ rate: 10,
49
+ },
50
+ totalAmount: 275,
51
+ lineItems: [
52
+ {
53
+ id: "12345",
54
+ trackingCategories: [
55
+ {
56
+ id: "123456",
57
+ name: "New York",
58
+ },
59
+ {
60
+ id: "123456",
61
+ name: "New York",
62
+ },
63
+ {
64
+ id: "123456",
65
+ name: "New York",
66
+ },
67
+ ],
68
+ accountId: "123456",
69
+ customerId: "12345",
70
+ departmentId: "12345",
71
+ locationId: "12345",
72
+ subsidiaryId: "12345",
73
+ taxRate: {
74
+ id: "123456",
75
+ code: "N-T",
76
+ name: "GST on Purchases",
77
+ rate: 10,
78
+ },
79
+ description: "Travel US.",
80
+ totalAmount: 275,
81
+ billable: true,
82
+ },
83
+ {
84
+ id: "12345",
85
+ trackingCategories: [
86
+ {
87
+ id: "123456",
88
+ name: "New York",
89
+ },
90
+ ],
91
+ accountId: "123456",
92
+ customerId: "12345",
93
+ departmentId: "12345",
94
+ locationId: "12345",
95
+ subsidiaryId: "12345",
96
+ taxRate: {
97
+ id: "123456",
98
+ code: "N-T",
99
+ name: "GST on Purchases",
100
+ rate: 10,
101
+ },
102
+ description: "Travel US.",
103
+ totalAmount: 275,
104
+ billable: true,
105
+ },
106
+ ],
107
+ customFields: [
108
+ {
109
+ id: "2389328923893298",
110
+ name: "employee_level",
111
+ description: "Employee Level",
112
+ value: "Uses Salesforce and Marketo",
113
+ },
114
+ ],
115
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
116
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
117
+ rowVersion: "1-12345",
118
+ passThrough: [
119
+ {
120
+ serviceId: "<id>",
121
+ extendPaths: [
122
+ {
123
+ path: "$.nested.property",
124
+ value: {
125
+ "TaxClassificationRef": {
126
+ "value": "EUC-99990201-V1-00020000",
127
+ },
128
+ },
129
+ },
130
+ {
131
+ path: "$.nested.property",
132
+ value: {
133
+ "TaxClassificationRef": {
134
+ "value": "EUC-99990201-V1-00020000",
135
+ },
136
+ },
137
+ },
138
+ ],
139
+ },
140
+ {
141
+ serviceId: "<id>",
142
+ extendPaths: [
143
+ {
144
+ path: "$.nested.property",
145
+ value: {
146
+ "TaxClassificationRef": {
147
+ "value": "EUC-99990201-V1-00020000",
148
+ },
149
+ },
150
+ },
151
+ ],
152
+ },
153
+ ],
154
+ },
155
+ {
156
+ id: "12345",
157
+ number: "OIT00546",
158
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
159
+ accountId: "123456",
160
+ customerId: "12345",
161
+ supplierId: "12345",
162
+ companyId: "12345",
163
+ departmentId: "12345",
164
+ paymentType: "cash",
165
+ currency: "USD",
166
+ currencyRate: 0.69,
167
+ type: "expense",
168
+ memo: "For travel expenses incurred on 2024-05-15",
169
+ taxRate: {
170
+ id: "123456",
171
+ code: "N-T",
172
+ name: "GST on Purchases",
173
+ rate: 10,
174
+ },
175
+ totalAmount: 275,
176
+ lineItems: [
177
+ {
178
+ id: "12345",
179
+ trackingCategories: [
180
+ {
181
+ id: "123456",
182
+ name: "New York",
183
+ },
184
+ ],
185
+ accountId: "123456",
186
+ customerId: "12345",
187
+ departmentId: "12345",
188
+ locationId: "12345",
189
+ subsidiaryId: "12345",
190
+ taxRate: {
191
+ id: "123456",
192
+ code: "N-T",
193
+ name: "GST on Purchases",
194
+ rate: 10,
195
+ },
196
+ description: "Travel US.",
197
+ totalAmount: 275,
198
+ billable: true,
199
+ },
200
+ {
201
+ id: "12345",
202
+ trackingCategories: [
203
+ {
204
+ id: "123456",
205
+ name: "New York",
206
+ },
207
+ ],
208
+ accountId: "123456",
209
+ customerId: "12345",
210
+ departmentId: "12345",
211
+ locationId: "12345",
212
+ subsidiaryId: "12345",
213
+ taxRate: {
214
+ id: "123456",
215
+ code: "N-T",
216
+ name: "GST on Purchases",
217
+ rate: 10,
218
+ },
219
+ description: "Travel US.",
220
+ totalAmount: 275,
221
+ billable: true,
222
+ },
223
+ ],
224
+ customFields: [
225
+ {
226
+ id: "2389328923893298",
227
+ name: "employee_level",
228
+ description: "Employee Level",
229
+ value: {},
230
+ },
231
+ {
232
+ id: "2389328923893298",
233
+ name: "employee_level",
234
+ description: "Employee Level",
235
+ value: {},
236
+ },
237
+ {
238
+ id: "2389328923893298",
239
+ name: "employee_level",
240
+ description: "Employee Level",
241
+ value: "Uses Salesforce and Marketo",
242
+ },
243
+ ],
244
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
245
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
246
+ rowVersion: "1-12345",
247
+ passThrough: [
248
+ {
249
+ serviceId: "<id>",
250
+ extendPaths: [
251
+ {
252
+ path: "$.nested.property",
253
+ value: {
254
+ "TaxClassificationRef": {
255
+ "value": "EUC-99990201-V1-00020000",
256
+ },
257
+ },
258
+ },
259
+ {
260
+ path: "$.nested.property",
261
+ value: {
262
+ "TaxClassificationRef": {
263
+ "value": "EUC-99990201-V1-00020000",
264
+ },
265
+ },
266
+ },
267
+ ],
268
+ },
269
+ ],
270
+ },
271
+ {
272
+ id: "12345",
273
+ number: "OIT00546",
274
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
275
+ accountId: "123456",
276
+ customerId: "12345",
277
+ supplierId: "12345",
278
+ companyId: "12345",
279
+ departmentId: "12345",
280
+ paymentType: "cash",
281
+ currency: "USD",
282
+ currencyRate: 0.69,
283
+ type: "expense",
284
+ memo: "For travel expenses incurred on 2024-05-15",
285
+ taxRate: {
286
+ id: "123456",
287
+ code: "N-T",
288
+ name: "GST on Purchases",
289
+ rate: 10,
290
+ },
291
+ totalAmount: 275,
292
+ lineItems: [
293
+ {
294
+ id: "12345",
295
+ trackingCategories: [
296
+ {
297
+ id: "123456",
298
+ name: "New York",
299
+ },
300
+ ],
301
+ accountId: "123456",
302
+ customerId: "12345",
303
+ departmentId: "12345",
304
+ locationId: "12345",
305
+ subsidiaryId: "12345",
306
+ taxRate: {
307
+ id: "123456",
308
+ code: "N-T",
309
+ name: "GST on Purchases",
310
+ rate: 10,
311
+ },
312
+ description: "Travel US.",
313
+ totalAmount: 275,
314
+ billable: true,
315
+ },
316
+ ],
317
+ customFields: [
318
+ {
319
+ id: "2389328923893298",
320
+ name: "employee_level",
321
+ description: "Employee Level",
322
+ value: {},
323
+ },
324
+ {
325
+ id: "2389328923893298",
326
+ name: "employee_level",
327
+ description: "Employee Level",
328
+ value: [
329
+ {},
330
+ ],
331
+ },
332
+ {
333
+ id: "2389328923893298",
334
+ name: "employee_level",
335
+ description: "Employee Level",
336
+ value: "Uses Salesforce and Marketo",
337
+ },
338
+ ],
339
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
340
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
341
+ rowVersion: "1-12345",
342
+ passThrough: [
343
+ {
344
+ serviceId: "<id>",
345
+ extendPaths: [
346
+ {
347
+ path: "$.nested.property",
348
+ value: {
349
+ "TaxClassificationRef": {
350
+ "value": "EUC-99990201-V1-00020000",
351
+ },
352
+ },
353
+ },
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
+ },
374
+ ],
375
+ meta: {
376
+ itemsOnPage: 50,
377
+ cursors: {
378
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
379
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
380
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
381
+ },
382
+ },
383
+ links: {
384
+ previous:
385
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
386
+ current: "https://unify.apideck.com/crm/companies",
387
+ next:
388
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
389
+ },
390
+ });
391
+ });
392
+
393
+ it.skip("Expenses Accounting Expenses Add", async () => {
394
+ assert.fail(
395
+ "incomplete test found please make sure to address the following errors: [`workflow step accounting.expensesAdd.test referencing operation accounting.expensesAdd with expression in requestBody with type not currently supported`, `workflow step accounting.expensesAdd.test referencing operation accounting.expensesAdd with expression in requestBody with type not currently supported`, `workflow step accounting.expensesAdd.test referencing operation accounting.expensesAdd with expression in requestBody with type not currently supported`, `workflow step accounting.expensesAdd.test referencing operation accounting.expensesAdd with expression in requestBody with type not currently supported`, `workflow step accounting.expensesAdd.test referencing operation accounting.expensesAdd with expression in requestBody with type not currently supported`]",
396
+ );
397
+ });
398
+
399
+ test("Expenses Accounting Expenses One", async () => {
400
+ const testHttpClient = createTestHTTPClient("accounting.expensesOne");
401
+
402
+ const apideck = new Apideck({
403
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
404
+ httpClient: testHttpClient,
405
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
406
+ });
407
+
408
+ const result = await apideck.accounting.expenses.get({
409
+ id: "<id>",
410
+ serviceId: "salesforce",
411
+ });
412
+ expect(result.httpMeta.response.status).toBe(200);
413
+ expect(result.getExpenseResponse).toBeDefined();
414
+ expect(result.getExpenseResponse).toEqual({
415
+ statusCode: 200,
416
+ status: "OK",
417
+ service: "quickbooks",
418
+ resource: "Expenses",
419
+ operation: "one",
420
+ data: {
421
+ id: "12345",
422
+ number: "OIT00546",
423
+ transactionDate: new Date("2021-05-01T12:00:00.000Z"),
424
+ accountId: "123456",
425
+ customerId: "12345",
426
+ supplierId: "12345",
427
+ companyId: "12345",
428
+ departmentId: "12345",
429
+ paymentType: "cash",
430
+ currency: "USD",
431
+ currencyRate: 0.69,
432
+ type: "expense",
433
+ memo: "For travel expenses incurred on 2024-05-15",
434
+ taxRate: {
435
+ id: "123456",
436
+ code: "N-T",
437
+ name: "GST on Purchases",
438
+ rate: 10,
439
+ },
440
+ totalAmount: 275,
441
+ lineItems: [
442
+ {
443
+ id: "12345",
444
+ trackingCategories: [
445
+ {
446
+ id: "123456",
447
+ name: "New York",
448
+ },
449
+ {
450
+ id: "123456",
451
+ name: "New York",
452
+ },
453
+ ],
454
+ accountId: "123456",
455
+ customerId: "12345",
456
+ departmentId: "12345",
457
+ locationId: "12345",
458
+ subsidiaryId: "12345",
459
+ taxRate: {
460
+ id: "123456",
461
+ code: "N-T",
462
+ name: "GST on Purchases",
463
+ rate: 10,
464
+ },
465
+ description: "Travel US.",
466
+ totalAmount: 275,
467
+ billable: true,
468
+ },
469
+ {
470
+ id: "12345",
471
+ trackingCategories: [
472
+ {
473
+ id: "123456",
474
+ name: "New York",
475
+ },
476
+ {
477
+ id: "123456",
478
+ name: "New York",
479
+ },
480
+ ],
481
+ accountId: "123456",
482
+ customerId: "12345",
483
+ departmentId: "12345",
484
+ locationId: "12345",
485
+ subsidiaryId: "12345",
486
+ taxRate: {
487
+ id: "123456",
488
+ code: "N-T",
489
+ name: "GST on Purchases",
490
+ rate: 10,
491
+ },
492
+ description: "Travel US.",
493
+ totalAmount: 275,
494
+ billable: true,
495
+ },
496
+ ],
497
+ customFields: [
498
+ {
499
+ id: "2389328923893298",
500
+ name: "employee_level",
501
+ description: "Employee Level",
502
+ value: [
503
+ {},
504
+ ],
505
+ },
506
+ {
507
+ id: "2389328923893298",
508
+ name: "employee_level",
509
+ description: "Employee Level",
510
+ value: true,
511
+ },
512
+ ],
513
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
514
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
515
+ rowVersion: "1-12345",
516
+ passThrough: [
517
+ {
518
+ serviceId: "<id>",
519
+ extendPaths: [
520
+ {
521
+ path: "$.nested.property",
522
+ value: {
523
+ "TaxClassificationRef": {
524
+ "value": "EUC-99990201-V1-00020000",
525
+ },
526
+ },
527
+ },
528
+ ],
529
+ },
530
+ ],
531
+ },
532
+ });
533
+ });
534
+
535
+ it.skip("Expenses Accounting Expenses Update", async () => {
536
+ assert.fail(
537
+ "incomplete test found please make sure to address the following errors: [`workflow step accounting.expensesUpdate.test referencing operation accounting.expensesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.expensesUpdate.test referencing operation accounting.expensesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.expensesUpdate.test referencing operation accounting.expensesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.expensesUpdate.test referencing operation accounting.expensesUpdate with expression in requestBody with type not currently supported`]",
538
+ );
539
+ });
540
+
541
+ test("Expenses Accounting Expenses Delete", async () => {
542
+ const testHttpClient = createTestHTTPClient("accounting.expensesDelete");
543
+
544
+ const apideck = new Apideck({
545
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
546
+ httpClient: testHttpClient,
547
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
548
+ });
549
+
550
+ const result = await apideck.accounting.expenses.delete({
551
+ id: "<id>",
552
+ serviceId: "salesforce",
553
+ });
554
+ expect(result.httpMeta.response.status).toBe(200);
555
+ expect(result.deleteExpenseResponse).toBeDefined();
556
+ expect(result.deleteExpenseResponse).toEqual({
557
+ statusCode: 200,
558
+ status: "OK",
559
+ service: "quickbooks",
560
+ resource: "Expenses",
561
+ operation: "delete",
562
+ data: {
563
+ id: "12345",
564
+ },
565
+ });
566
+ });