@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,496 @@
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("Drivegroups File Storage Drive Groups All", async () => {
10
+ const testHttpClient = createTestHTTPClient("fileStorage.driveGroupsAll");
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.fileStorage.driveGroups.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ parentGroupId: "1234",
24
+ },
25
+ passThrough: {
26
+ "search": "San Francisco",
27
+ },
28
+ fields: "id,updated_at",
29
+ });
30
+ expect(result.httpMeta.response.status).toBe(200);
31
+ expect(result.getDriveGroupsResponse).toBeDefined();
32
+ expect(result.getDriveGroupsResponse).toEqual({
33
+ statusCode: 200,
34
+ status: "OK",
35
+ service: "google-drive",
36
+ resource: "DriveGroups",
37
+ operation: "all",
38
+ data: [
39
+ {
40
+ id: "12345",
41
+ name: "accounting",
42
+ displayName: "accounting",
43
+ description: "A description",
44
+ updatedBy: "12345",
45
+ createdBy: "12345",
46
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
47
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
48
+ passThrough: [
49
+ {
50
+ serviceId: "<id>",
51
+ extendPaths: [
52
+ {
53
+ path: "$.nested.property",
54
+ value: {
55
+ "TaxClassificationRef": {
56
+ "value": "EUC-99990201-V1-00020000",
57
+ },
58
+ },
59
+ },
60
+ {
61
+ path: "$.nested.property",
62
+ value: {
63
+ "TaxClassificationRef": {
64
+ "value": "EUC-99990201-V1-00020000",
65
+ },
66
+ },
67
+ },
68
+ {
69
+ path: "$.nested.property",
70
+ value: {
71
+ "TaxClassificationRef": {
72
+ "value": "EUC-99990201-V1-00020000",
73
+ },
74
+ },
75
+ },
76
+ ],
77
+ },
78
+ {
79
+ serviceId: "<id>",
80
+ extendPaths: [
81
+ {
82
+ path: "$.nested.property",
83
+ value: {
84
+ "TaxClassificationRef": {
85
+ "value": "EUC-99990201-V1-00020000",
86
+ },
87
+ },
88
+ },
89
+ ],
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ id: "12345",
95
+ name: "accounting",
96
+ displayName: "accounting",
97
+ description: "A description",
98
+ updatedBy: "12345",
99
+ createdBy: "12345",
100
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
101
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
102
+ passThrough: [
103
+ {
104
+ serviceId: "<id>",
105
+ extendPaths: [
106
+ {
107
+ path: "$.nested.property",
108
+ value: {
109
+ "TaxClassificationRef": {
110
+ "value": "EUC-99990201-V1-00020000",
111
+ },
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ },
118
+ {
119
+ id: "12345",
120
+ name: "accounting",
121
+ displayName: "accounting",
122
+ description: "A description",
123
+ updatedBy: "12345",
124
+ createdBy: "12345",
125
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
126
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
127
+ passThrough: [
128
+ {
129
+ serviceId: "<id>",
130
+ extendPaths: [
131
+ {
132
+ path: "$.nested.property",
133
+ value: {
134
+ "TaxClassificationRef": {
135
+ "value": "EUC-99990201-V1-00020000",
136
+ },
137
+ },
138
+ },
139
+ {
140
+ path: "$.nested.property",
141
+ value: {
142
+ "TaxClassificationRef": {
143
+ "value": "EUC-99990201-V1-00020000",
144
+ },
145
+ },
146
+ },
147
+ ],
148
+ },
149
+ {
150
+ serviceId: "<id>",
151
+ extendPaths: [
152
+ {
153
+ path: "$.nested.property",
154
+ value: {
155
+ "TaxClassificationRef": {
156
+ "value": "EUC-99990201-V1-00020000",
157
+ },
158
+ },
159
+ },
160
+ ],
161
+ },
162
+ ],
163
+ },
164
+ ],
165
+ meta: {
166
+ itemsOnPage: 50,
167
+ cursors: {
168
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
169
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
170
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
171
+ },
172
+ },
173
+ links: {
174
+ previous:
175
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
176
+ current: "https://unify.apideck.com/crm/companies",
177
+ next:
178
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
179
+ },
180
+ });
181
+ });
182
+
183
+ test("Drivegroups File Storage Drive Groups Add", async () => {
184
+ const testHttpClient = createTestHTTPClient("fileStorage.driveGroupsAdd");
185
+
186
+ const apideck = new Apideck({
187
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
188
+ httpClient: testHttpClient,
189
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
190
+ });
191
+
192
+ const result = await apideck.fileStorage.driveGroups.create({
193
+ consumerId: "test-consumer",
194
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
195
+ serviceId: "salesforce",
196
+ driveGroup: {
197
+ name: "accounting",
198
+ displayName: "accounting",
199
+ description: "A description",
200
+ passThrough: [
201
+ {
202
+ serviceId: "<id>",
203
+ extendPaths: [
204
+ {
205
+ path: "$.nested.property",
206
+ value: {
207
+ "TaxClassificationRef": {
208
+ "value": "EUC-99990201-V1-00020000",
209
+ },
210
+ },
211
+ },
212
+ {
213
+ path: "$.nested.property",
214
+ value: {
215
+ "TaxClassificationRef": {
216
+ "value": "EUC-99990201-V1-00020000",
217
+ },
218
+ },
219
+ },
220
+ ],
221
+ },
222
+ {
223
+ serviceId: "<id>",
224
+ extendPaths: [
225
+ {
226
+ path: "$.nested.property",
227
+ value: {
228
+ "TaxClassificationRef": {
229
+ "value": "EUC-99990201-V1-00020000",
230
+ },
231
+ },
232
+ },
233
+ {
234
+ path: "$.nested.property",
235
+ value: {
236
+ "TaxClassificationRef": {
237
+ "value": "EUC-99990201-V1-00020000",
238
+ },
239
+ },
240
+ },
241
+ ],
242
+ },
243
+ ],
244
+ },
245
+ });
246
+ expect(result.httpMeta.response.status).toBe(201);
247
+ expect(result.createDriveGroupResponse).toBeDefined();
248
+ expect(result.createDriveGroupResponse).toEqual({
249
+ statusCode: 200,
250
+ status: "OK",
251
+ service: "google-drive",
252
+ resource: "DriveGroups",
253
+ operation: "add",
254
+ data: {
255
+ id: "12345",
256
+ },
257
+ });
258
+ });
259
+
260
+ test("Drivegroups File Storage Drive Groups One", async () => {
261
+ const testHttpClient = createTestHTTPClient("fileStorage.driveGroupsOne");
262
+
263
+ const apideck = new Apideck({
264
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
265
+ httpClient: testHttpClient,
266
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
267
+ });
268
+
269
+ const result = await apideck.fileStorage.driveGroups.get({
270
+ id: "<id>",
271
+ consumerId: "test-consumer",
272
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
273
+ serviceId: "salesforce",
274
+ fields: "id,updated_at",
275
+ });
276
+ expect(result.httpMeta.response.status).toBe(200);
277
+ expect(result.getDriveGroupResponse).toBeDefined();
278
+ expect(result.getDriveGroupResponse).toEqual({
279
+ statusCode: 200,
280
+ status: "OK",
281
+ service: "google-drive",
282
+ resource: "DriveGroups",
283
+ operation: "one",
284
+ data: {
285
+ id: "12345",
286
+ name: "accounting",
287
+ displayName: "accounting",
288
+ description: "A description",
289
+ updatedBy: "12345",
290
+ createdBy: "12345",
291
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
292
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
293
+ passThrough: [
294
+ {
295
+ serviceId: "<id>",
296
+ extendPaths: [
297
+ {
298
+ path: "$.nested.property",
299
+ value: {
300
+ "TaxClassificationRef": {
301
+ "value": "EUC-99990201-V1-00020000",
302
+ },
303
+ },
304
+ },
305
+ {
306
+ path: "$.nested.property",
307
+ value: {
308
+ "TaxClassificationRef": {
309
+ "value": "EUC-99990201-V1-00020000",
310
+ },
311
+ },
312
+ },
313
+ ],
314
+ },
315
+ {
316
+ serviceId: "<id>",
317
+ extendPaths: [
318
+ {
319
+ path: "$.nested.property",
320
+ value: {
321
+ "TaxClassificationRef": {
322
+ "value": "EUC-99990201-V1-00020000",
323
+ },
324
+ },
325
+ },
326
+ {
327
+ path: "$.nested.property",
328
+ value: {
329
+ "TaxClassificationRef": {
330
+ "value": "EUC-99990201-V1-00020000",
331
+ },
332
+ },
333
+ },
334
+ ],
335
+ },
336
+ {
337
+ serviceId: "<id>",
338
+ extendPaths: [
339
+ {
340
+ path: "$.nested.property",
341
+ value: {
342
+ "TaxClassificationRef": {
343
+ "value": "EUC-99990201-V1-00020000",
344
+ },
345
+ },
346
+ },
347
+ {
348
+ path: "$.nested.property",
349
+ value: {
350
+ "TaxClassificationRef": {
351
+ "value": "EUC-99990201-V1-00020000",
352
+ },
353
+ },
354
+ },
355
+ ],
356
+ },
357
+ ],
358
+ },
359
+ });
360
+ });
361
+
362
+ test("Drivegroups File Storage Drive Groups Update", async () => {
363
+ const testHttpClient = createTestHTTPClient("fileStorage.driveGroupsUpdate");
364
+
365
+ const apideck = new Apideck({
366
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
367
+ httpClient: testHttpClient,
368
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
369
+ });
370
+
371
+ const result = await apideck.fileStorage.driveGroups.update({
372
+ id: "<id>",
373
+ consumerId: "test-consumer",
374
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
375
+ serviceId: "salesforce",
376
+ driveGroup: {
377
+ name: "accounting",
378
+ displayName: "accounting",
379
+ description: "A description",
380
+ passThrough: [
381
+ {
382
+ serviceId: "<id>",
383
+ extendPaths: [
384
+ {
385
+ path: "$.nested.property",
386
+ value: {
387
+ "TaxClassificationRef": {
388
+ "value": "EUC-99990201-V1-00020000",
389
+ },
390
+ },
391
+ },
392
+ {
393
+ path: "$.nested.property",
394
+ value: {
395
+ "TaxClassificationRef": {
396
+ "value": "EUC-99990201-V1-00020000",
397
+ },
398
+ },
399
+ },
400
+ ],
401
+ },
402
+ {
403
+ serviceId: "<id>",
404
+ extendPaths: [
405
+ {
406
+ path: "$.nested.property",
407
+ value: {
408
+ "TaxClassificationRef": {
409
+ "value": "EUC-99990201-V1-00020000",
410
+ },
411
+ },
412
+ },
413
+ {
414
+ path: "$.nested.property",
415
+ value: {
416
+ "TaxClassificationRef": {
417
+ "value": "EUC-99990201-V1-00020000",
418
+ },
419
+ },
420
+ },
421
+ ],
422
+ },
423
+ {
424
+ serviceId: "<id>",
425
+ extendPaths: [
426
+ {
427
+ path: "$.nested.property",
428
+ value: {
429
+ "TaxClassificationRef": {
430
+ "value": "EUC-99990201-V1-00020000",
431
+ },
432
+ },
433
+ },
434
+ {
435
+ path: "$.nested.property",
436
+ value: {
437
+ "TaxClassificationRef": {
438
+ "value": "EUC-99990201-V1-00020000",
439
+ },
440
+ },
441
+ },
442
+ {
443
+ path: "$.nested.property",
444
+ value: {
445
+ "TaxClassificationRef": {
446
+ "value": "EUC-99990201-V1-00020000",
447
+ },
448
+ },
449
+ },
450
+ ],
451
+ },
452
+ ],
453
+ },
454
+ });
455
+ expect(result.httpMeta.response.status).toBe(200);
456
+ expect(result.updateDriveGroupResponse).toBeDefined();
457
+ expect(result.updateDriveGroupResponse).toEqual({
458
+ statusCode: 200,
459
+ status: "OK",
460
+ service: "google-drive",
461
+ resource: "DriveGroups",
462
+ operation: "update",
463
+ data: {
464
+ id: "12345",
465
+ },
466
+ });
467
+ });
468
+
469
+ test("Drivegroups File Storage Drive Groups Delete", async () => {
470
+ const testHttpClient = createTestHTTPClient("fileStorage.driveGroupsDelete");
471
+
472
+ const apideck = new Apideck({
473
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
474
+ httpClient: testHttpClient,
475
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
476
+ });
477
+
478
+ const result = await apideck.fileStorage.driveGroups.delete({
479
+ id: "<id>",
480
+ consumerId: "test-consumer",
481
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
482
+ serviceId: "salesforce",
483
+ });
484
+ expect(result.httpMeta.response.status).toBe(200);
485
+ expect(result.deleteDriveGroupResponse).toBeDefined();
486
+ expect(result.deleteDriveGroupResponse).toEqual({
487
+ statusCode: 200,
488
+ status: "OK",
489
+ service: "google-drive",
490
+ resource: "DriveGroups",
491
+ operation: "delete",
492
+ data: {
493
+ id: "12345",
494
+ },
495
+ });
496
+ });