@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,523 @@
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("Notes Crm Notes All", async () => {
10
+ const testHttpClient = createTestHTTPClient("crm.notesAll");
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.crm.notes.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ passThrough: {
23
+ "search": "San Francisco",
24
+ },
25
+ fields: "id,updated_at",
26
+ });
27
+ expect(result.httpMeta.response.status).toBe(200);
28
+ expect(result.getNotesResponse).toBeDefined();
29
+ expect(result.getNotesResponse).toEqual({
30
+ statusCode: 200,
31
+ status: "OK",
32
+ service: "zoho-crm",
33
+ resource: "notes",
34
+ operation: "all",
35
+ data: [
36
+ {
37
+ id: "12345",
38
+ title: "Meeting Notes",
39
+ content: "Office hours are 9AM-6PM",
40
+ ownerId: "12345",
41
+ contactId: "12345",
42
+ companyId: "12345",
43
+ opportunityId: "12345",
44
+ leadId: "12345",
45
+ active: true,
46
+ updatedBy: "12345",
47
+ createdBy: "12345",
48
+ updatedAt: "2020-09-30T07:43:32.000Z",
49
+ createdAt: "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
+ title: "Meeting Notes",
98
+ content: "Office hours are 9AM-6PM",
99
+ ownerId: "12345",
100
+ contactId: "12345",
101
+ companyId: "12345",
102
+ opportunityId: "12345",
103
+ leadId: "12345",
104
+ active: true,
105
+ updatedBy: "12345",
106
+ createdBy: "12345",
107
+ updatedAt: "2020-09-30T07:43:32.000Z",
108
+ createdAt: "2020-09-30T07:43:32.000Z",
109
+ passThrough: [
110
+ {
111
+ serviceId: "<id>",
112
+ extendPaths: [
113
+ {
114
+ path: "$.nested.property",
115
+ value: {
116
+ "TaxClassificationRef": {
117
+ "value": "EUC-99990201-V1-00020000",
118
+ },
119
+ },
120
+ },
121
+ ],
122
+ },
123
+ ],
124
+ },
125
+ {
126
+ id: "12345",
127
+ title: "Meeting Notes",
128
+ content: "Office hours are 9AM-6PM",
129
+ ownerId: "12345",
130
+ contactId: "12345",
131
+ companyId: "12345",
132
+ opportunityId: "12345",
133
+ leadId: "12345",
134
+ active: true,
135
+ updatedBy: "12345",
136
+ createdBy: "12345",
137
+ updatedAt: "2020-09-30T07:43:32.000Z",
138
+ createdAt: "2020-09-30T07:43:32.000Z",
139
+ passThrough: [
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
+ path: "$.nested.property",
153
+ value: {
154
+ "TaxClassificationRef": {
155
+ "value": "EUC-99990201-V1-00020000",
156
+ },
157
+ },
158
+ },
159
+ ],
160
+ },
161
+ {
162
+ serviceId: "<id>",
163
+ extendPaths: [
164
+ {
165
+ path: "$.nested.property",
166
+ value: {
167
+ "TaxClassificationRef": {
168
+ "value": "EUC-99990201-V1-00020000",
169
+ },
170
+ },
171
+ },
172
+ ],
173
+ },
174
+ ],
175
+ },
176
+ ],
177
+ meta: {
178
+ itemsOnPage: 50,
179
+ cursors: {
180
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
181
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
182
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
183
+ },
184
+ },
185
+ links: {
186
+ previous:
187
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
188
+ current: "https://unify.apideck.com/crm/companies",
189
+ next:
190
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
191
+ },
192
+ });
193
+ });
194
+
195
+ test("Notes Crm Notes Add", async () => {
196
+ const testHttpClient = createTestHTTPClient("crm.notesAdd");
197
+
198
+ const apideck = new Apideck({
199
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
200
+ httpClient: testHttpClient,
201
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
202
+ });
203
+
204
+ const result = await apideck.crm.notes.create({
205
+ consumerId: "test-consumer",
206
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
207
+ serviceId: "salesforce",
208
+ note: {
209
+ title: "Meeting Notes",
210
+ content: "Office hours are 9AM-6PM",
211
+ ownerId: "12345",
212
+ contactId: "12345",
213
+ companyId: "12345",
214
+ opportunityId: "12345",
215
+ leadId: "12345",
216
+ active: true,
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
+ path: "$.nested.property",
231
+ value: {
232
+ "TaxClassificationRef": {
233
+ "value": "EUC-99990201-V1-00020000",
234
+ },
235
+ },
236
+ },
237
+ ],
238
+ },
239
+ {
240
+ serviceId: "<id>",
241
+ extendPaths: [
242
+ {
243
+ path: "$.nested.property",
244
+ value: {
245
+ "TaxClassificationRef": {
246
+ "value": "EUC-99990201-V1-00020000",
247
+ },
248
+ },
249
+ },
250
+ {
251
+ path: "$.nested.property",
252
+ value: {
253
+ "TaxClassificationRef": {
254
+ "value": "EUC-99990201-V1-00020000",
255
+ },
256
+ },
257
+ },
258
+ ],
259
+ },
260
+ ],
261
+ },
262
+ });
263
+ expect(result.httpMeta.response.status).toBe(201);
264
+ expect(result.createNoteResponse).toBeDefined();
265
+ expect(result.createNoteResponse).toEqual({
266
+ statusCode: 200,
267
+ status: "OK",
268
+ service: "zoho-crm",
269
+ resource: "notes",
270
+ operation: "add",
271
+ data: {
272
+ id: "12345",
273
+ },
274
+ });
275
+ });
276
+
277
+ test("Notes Crm Notes One", async () => {
278
+ const testHttpClient = createTestHTTPClient("crm.notesOne");
279
+
280
+ const apideck = new Apideck({
281
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
282
+ httpClient: testHttpClient,
283
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
284
+ });
285
+
286
+ const result = await apideck.crm.notes.get({
287
+ id: "<id>",
288
+ consumerId: "test-consumer",
289
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
290
+ serviceId: "salesforce",
291
+ fields: "id,updated_at",
292
+ });
293
+ expect(result.httpMeta.response.status).toBe(200);
294
+ expect(result.getNoteResponse).toBeDefined();
295
+ expect(result.getNoteResponse).toEqual({
296
+ statusCode: 200,
297
+ status: "OK",
298
+ service: "zoho-crm",
299
+ resource: "notes",
300
+ operation: "one",
301
+ data: {
302
+ id: "12345",
303
+ title: "Meeting Notes",
304
+ content: "Office hours are 9AM-6PM",
305
+ ownerId: "12345",
306
+ contactId: "12345",
307
+ companyId: "12345",
308
+ opportunityId: "12345",
309
+ leadId: "12345",
310
+ active: true,
311
+ updatedBy: "12345",
312
+ createdBy: "12345",
313
+ updatedAt: "2020-09-30T07:43:32.000Z",
314
+ createdAt: "2020-09-30T07:43:32.000Z",
315
+ passThrough: [
316
+ {
317
+ serviceId: "<id>",
318
+ extendPaths: [
319
+ {
320
+ path: "$.nested.property",
321
+ value: {
322
+ "TaxClassificationRef": {
323
+ "value": "EUC-99990201-V1-00020000",
324
+ },
325
+ },
326
+ },
327
+ {
328
+ path: "$.nested.property",
329
+ value: {
330
+ "TaxClassificationRef": {
331
+ "value": "EUC-99990201-V1-00020000",
332
+ },
333
+ },
334
+ },
335
+ ],
336
+ },
337
+ {
338
+ serviceId: "<id>",
339
+ extendPaths: [
340
+ {
341
+ path: "$.nested.property",
342
+ value: {
343
+ "TaxClassificationRef": {
344
+ "value": "EUC-99990201-V1-00020000",
345
+ },
346
+ },
347
+ },
348
+ {
349
+ path: "$.nested.property",
350
+ value: {
351
+ "TaxClassificationRef": {
352
+ "value": "EUC-99990201-V1-00020000",
353
+ },
354
+ },
355
+ },
356
+ ],
357
+ },
358
+ {
359
+ serviceId: "<id>",
360
+ extendPaths: [
361
+ {
362
+ path: "$.nested.property",
363
+ value: {
364
+ "TaxClassificationRef": {
365
+ "value": "EUC-99990201-V1-00020000",
366
+ },
367
+ },
368
+ },
369
+ {
370
+ path: "$.nested.property",
371
+ value: {
372
+ "TaxClassificationRef": {
373
+ "value": "EUC-99990201-V1-00020000",
374
+ },
375
+ },
376
+ },
377
+ ],
378
+ },
379
+ ],
380
+ },
381
+ });
382
+ });
383
+
384
+ test("Notes Crm Notes Update", async () => {
385
+ const testHttpClient = createTestHTTPClient("crm.notesUpdate");
386
+
387
+ const apideck = new Apideck({
388
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
389
+ httpClient: testHttpClient,
390
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
391
+ });
392
+
393
+ const result = await apideck.crm.notes.update({
394
+ id: "<id>",
395
+ consumerId: "test-consumer",
396
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
397
+ serviceId: "salesforce",
398
+ note: {
399
+ title: "Meeting Notes",
400
+ content: "Office hours are 9AM-6PM",
401
+ ownerId: "12345",
402
+ contactId: "12345",
403
+ companyId: "12345",
404
+ opportunityId: "12345",
405
+ leadId: "12345",
406
+ active: true,
407
+ passThrough: [
408
+ {
409
+ serviceId: "<id>",
410
+ extendPaths: [
411
+ {
412
+ path: "$.nested.property",
413
+ value: {
414
+ "TaxClassificationRef": {
415
+ "value": "EUC-99990201-V1-00020000",
416
+ },
417
+ },
418
+ },
419
+ {
420
+ path: "$.nested.property",
421
+ value: {
422
+ "TaxClassificationRef": {
423
+ "value": "EUC-99990201-V1-00020000",
424
+ },
425
+ },
426
+ },
427
+ ],
428
+ },
429
+ {
430
+ serviceId: "<id>",
431
+ extendPaths: [
432
+ {
433
+ path: "$.nested.property",
434
+ value: {
435
+ "TaxClassificationRef": {
436
+ "value": "EUC-99990201-V1-00020000",
437
+ },
438
+ },
439
+ },
440
+ {
441
+ path: "$.nested.property",
442
+ value: {
443
+ "TaxClassificationRef": {
444
+ "value": "EUC-99990201-V1-00020000",
445
+ },
446
+ },
447
+ },
448
+ ],
449
+ },
450
+ {
451
+ serviceId: "<id>",
452
+ extendPaths: [
453
+ {
454
+ path: "$.nested.property",
455
+ value: {
456
+ "TaxClassificationRef": {
457
+ "value": "EUC-99990201-V1-00020000",
458
+ },
459
+ },
460
+ },
461
+ {
462
+ path: "$.nested.property",
463
+ value: {
464
+ "TaxClassificationRef": {
465
+ "value": "EUC-99990201-V1-00020000",
466
+ },
467
+ },
468
+ },
469
+ {
470
+ path: "$.nested.property",
471
+ value: {
472
+ "TaxClassificationRef": {
473
+ "value": "EUC-99990201-V1-00020000",
474
+ },
475
+ },
476
+ },
477
+ ],
478
+ },
479
+ ],
480
+ },
481
+ });
482
+ expect(result.httpMeta.response.status).toBe(200);
483
+ expect(result.updateNoteResponse).toBeDefined();
484
+ expect(result.updateNoteResponse).toEqual({
485
+ statusCode: 200,
486
+ status: "OK",
487
+ service: "zoho-crm",
488
+ resource: "notes",
489
+ operation: "update",
490
+ data: {
491
+ id: "12345",
492
+ },
493
+ });
494
+ });
495
+
496
+ test("Notes Crm Notes Delete", async () => {
497
+ const testHttpClient = createTestHTTPClient("crm.notesDelete");
498
+
499
+ const apideck = new Apideck({
500
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
501
+ httpClient: testHttpClient,
502
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
503
+ });
504
+
505
+ const result = await apideck.crm.notes.delete({
506
+ id: "<id>",
507
+ consumerId: "test-consumer",
508
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
509
+ serviceId: "salesforce",
510
+ });
511
+ expect(result.httpMeta.response.status).toBe(200);
512
+ expect(result.deleteNoteResponse).toBeDefined();
513
+ expect(result.deleteNoteResponse).toEqual({
514
+ statusCode: 200,
515
+ status: "OK",
516
+ service: "zoho-crm",
517
+ resource: "notes",
518
+ operation: "delete",
519
+ data: {
520
+ id: "12345",
521
+ },
522
+ });
523
+ });