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