@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,1141 @@
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("Activities Crm Activities All", async () => {
10
+ const testHttpClient = createTestHTTPClient("crm.activitiesAll");
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.activities.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ updatedSince: new Date("2020-09-30T07:43:32.000Z"),
24
+ },
25
+ sort: {
26
+ by: "created_at",
27
+ direction: "desc",
28
+ },
29
+ passThrough: {
30
+ "search": "San Francisco",
31
+ },
32
+ fields: "id,updated_at",
33
+ });
34
+ expect(result.httpMeta.response.status).toBe(200);
35
+ expect(result.getActivitiesResponse).toBeDefined();
36
+ expect(result.getActivitiesResponse).toEqual({
37
+ statusCode: 200,
38
+ status: "OK",
39
+ service: "zoho-crm",
40
+ resource: "activities",
41
+ operation: "all",
42
+ data: [
43
+ {
44
+ id: "12345",
45
+ downstreamId: "12345",
46
+ activityDatetime: "2021-05-01T12:00:00.000Z",
47
+ durationSeconds: 1800,
48
+ userId: "12345",
49
+ accountId: "12345",
50
+ contactId: "12345",
51
+ companyId: "12345",
52
+ opportunityId: "12345",
53
+ leadId: "12345",
54
+ ownerId: "12345",
55
+ campaignId: "12345",
56
+ caseId: "12345",
57
+ assetId: "12345",
58
+ contractId: "12345",
59
+ productId: "12345",
60
+ solutionId: "12345",
61
+ customObjectId: "12345",
62
+ type: "meeting",
63
+ title: "Meeting",
64
+ description: "More info about the meeting",
65
+ note: "An internal note about the meeting",
66
+ location: "Space",
67
+ locationAddress: {
68
+ id: "123",
69
+ type: "primary",
70
+ string: "25 Spring Street, Blackburn, VIC 3130",
71
+ name: "HQ US",
72
+ line1: "Main street",
73
+ line2: "apt #",
74
+ line3: "Suite #",
75
+ line4: "delivery instructions",
76
+ streetNumber: "25",
77
+ city: "San Francisco",
78
+ state: "CA",
79
+ postalCode: "94104",
80
+ country: "US",
81
+ latitude: "40.759211",
82
+ longitude: "-73.984638",
83
+ county: "Santa Clara",
84
+ contactName: "Elon Musk",
85
+ salutation: "Mr",
86
+ phoneNumber: "111-111-1111",
87
+ fax: "122-111-1111",
88
+ email: "elon@musk.com",
89
+ website: "https://elonmusk.com",
90
+ notes: "Address notes or delivery instructions.",
91
+ rowVersion: "1-12345",
92
+ },
93
+ allDayEvent: false,
94
+ private: true,
95
+ groupEvent: true,
96
+ eventSubType: "debrief",
97
+ groupEventType: "Proposed",
98
+ child: false,
99
+ archived: false,
100
+ deleted: false,
101
+ showAs: "busy",
102
+ done: false,
103
+ startDatetime: "2021-05-01T12:00:00.000Z",
104
+ endDatetime: "2021-05-01T12:30:00.000Z",
105
+ durationMinutes: 30,
106
+ activityDate: "2021-05-01",
107
+ endDate: "2021-05-01",
108
+ recurrent: false,
109
+ reminderDatetime: "2021-05-01T17:00:00.000Z",
110
+ reminderSet: false,
111
+ videoConferenceUrl: "https://us02web.zoom.us/j/88120759396",
112
+ videoConferenceId: "zoom:88120759396",
113
+ customFields: [
114
+ {
115
+ id: "2389328923893298",
116
+ name: "employee_level",
117
+ description: "Employee Level",
118
+ value: {},
119
+ },
120
+ {
121
+ id: "2389328923893298",
122
+ name: "employee_level",
123
+ description: "Employee Level",
124
+ value: 10,
125
+ },
126
+ ],
127
+ attendees: [
128
+ {
129
+ id: "12345",
130
+ name: "Elon Musk",
131
+ firstName: "Elon",
132
+ middleName: "D.",
133
+ lastName: "Musk",
134
+ prefix: "Mr.",
135
+ suffix: "PhD",
136
+ emailAddress: "elon@musk.com",
137
+ isOrganizer: true,
138
+ status: "accepted",
139
+ userId: "12345",
140
+ contactId: "12345",
141
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
142
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
143
+ },
144
+ ],
145
+ updatedBy: "12345",
146
+ createdBy: "12345",
147
+ updatedAt: "2020-09-30T07:43:32.000Z",
148
+ createdAt: "2020-09-30T07:43:32.000Z",
149
+ passThrough: [
150
+ {
151
+ serviceId: "<id>",
152
+ extendPaths: [
153
+ {
154
+ path: "$.nested.property",
155
+ value: {
156
+ "TaxClassificationRef": {
157
+ "value": "EUC-99990201-V1-00020000",
158
+ },
159
+ },
160
+ },
161
+ {
162
+ path: "$.nested.property",
163
+ value: {
164
+ "TaxClassificationRef": {
165
+ "value": "EUC-99990201-V1-00020000",
166
+ },
167
+ },
168
+ },
169
+ ],
170
+ },
171
+ {
172
+ serviceId: "<id>",
173
+ extendPaths: [
174
+ {
175
+ path: "$.nested.property",
176
+ value: {
177
+ "TaxClassificationRef": {
178
+ "value": "EUC-99990201-V1-00020000",
179
+ },
180
+ },
181
+ },
182
+ ],
183
+ },
184
+ ],
185
+ },
186
+ {
187
+ id: "12345",
188
+ downstreamId: "12345",
189
+ activityDatetime: "2021-05-01T12:00:00.000Z",
190
+ durationSeconds: 1800,
191
+ userId: "12345",
192
+ accountId: "12345",
193
+ contactId: "12345",
194
+ companyId: "12345",
195
+ opportunityId: "12345",
196
+ leadId: "12345",
197
+ ownerId: "12345",
198
+ campaignId: "12345",
199
+ caseId: "12345",
200
+ assetId: "12345",
201
+ contractId: "12345",
202
+ productId: "12345",
203
+ solutionId: "12345",
204
+ customObjectId: "12345",
205
+ type: "meeting",
206
+ title: "Meeting",
207
+ description: "More info about the meeting",
208
+ note: "An internal note about the meeting",
209
+ location: "Space",
210
+ locationAddress: {
211
+ id: "123",
212
+ type: "primary",
213
+ string: "25 Spring Street, Blackburn, VIC 3130",
214
+ name: "HQ US",
215
+ line1: "Main street",
216
+ line2: "apt #",
217
+ line3: "Suite #",
218
+ line4: "delivery instructions",
219
+ streetNumber: "25",
220
+ city: "San Francisco",
221
+ state: "CA",
222
+ postalCode: "94104",
223
+ country: "US",
224
+ latitude: "40.759211",
225
+ longitude: "-73.984638",
226
+ county: "Santa Clara",
227
+ contactName: "Elon Musk",
228
+ salutation: "Mr",
229
+ phoneNumber: "111-111-1111",
230
+ fax: "122-111-1111",
231
+ email: "elon@musk.com",
232
+ website: "https://elonmusk.com",
233
+ notes: "Address notes or delivery instructions.",
234
+ rowVersion: "1-12345",
235
+ },
236
+ allDayEvent: false,
237
+ private: true,
238
+ groupEvent: true,
239
+ eventSubType: "debrief",
240
+ groupEventType: "Proposed",
241
+ child: false,
242
+ archived: false,
243
+ deleted: false,
244
+ showAs: "busy",
245
+ done: false,
246
+ startDatetime: "2021-05-01T12:00:00.000Z",
247
+ endDatetime: "2021-05-01T12:30:00.000Z",
248
+ durationMinutes: 30,
249
+ activityDate: "2021-05-01",
250
+ endDate: "2021-05-01",
251
+ recurrent: false,
252
+ reminderDatetime: "2021-05-01T17:00:00.000Z",
253
+ reminderSet: false,
254
+ videoConferenceUrl: "https://us02web.zoom.us/j/88120759396",
255
+ videoConferenceId: "zoom:88120759396",
256
+ customFields: [
257
+ {
258
+ id: "2389328923893298",
259
+ name: "employee_level",
260
+ description: "Employee Level",
261
+ value: "Uses Salesforce and Marketo",
262
+ },
263
+ {
264
+ id: "2389328923893298",
265
+ name: "employee_level",
266
+ description: "Employee Level",
267
+ value: "Uses Salesforce and Marketo",
268
+ },
269
+ {
270
+ id: "2389328923893298",
271
+ name: "employee_level",
272
+ description: "Employee Level",
273
+ value: {
274
+ "0": "<value>",
275
+ "1": "<value>",
276
+ },
277
+ },
278
+ ],
279
+ attendees: [
280
+ {
281
+ id: "12345",
282
+ name: "Elon Musk",
283
+ firstName: "Elon",
284
+ middleName: "D.",
285
+ lastName: "Musk",
286
+ prefix: "Mr.",
287
+ suffix: "PhD",
288
+ emailAddress: "elon@musk.com",
289
+ isOrganizer: true,
290
+ status: "accepted",
291
+ userId: "12345",
292
+ contactId: "12345",
293
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
294
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
295
+ },
296
+ {
297
+ id: "12345",
298
+ name: "Elon Musk",
299
+ firstName: "Elon",
300
+ middleName: "D.",
301
+ lastName: "Musk",
302
+ prefix: "Mr.",
303
+ suffix: "PhD",
304
+ emailAddress: "elon@musk.com",
305
+ isOrganizer: true,
306
+ status: "accepted",
307
+ userId: "12345",
308
+ contactId: "12345",
309
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
310
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
311
+ },
312
+ ],
313
+ updatedBy: "12345",
314
+ createdBy: "12345",
315
+ updatedAt: "2020-09-30T07:43:32.000Z",
316
+ createdAt: "2020-09-30T07:43:32.000Z",
317
+ passThrough: [
318
+ {
319
+ serviceId: "<id>",
320
+ extendPaths: [
321
+ {
322
+ path: "$.nested.property",
323
+ value: {
324
+ "TaxClassificationRef": {
325
+ "value": "EUC-99990201-V1-00020000",
326
+ },
327
+ },
328
+ },
329
+ ],
330
+ },
331
+ ],
332
+ },
333
+ {
334
+ id: "12345",
335
+ downstreamId: "12345",
336
+ activityDatetime: "2021-05-01T12:00:00.000Z",
337
+ durationSeconds: 1800,
338
+ userId: "12345",
339
+ accountId: "12345",
340
+ contactId: "12345",
341
+ companyId: "12345",
342
+ opportunityId: "12345",
343
+ leadId: "12345",
344
+ ownerId: "12345",
345
+ campaignId: "12345",
346
+ caseId: "12345",
347
+ assetId: "12345",
348
+ contractId: "12345",
349
+ productId: "12345",
350
+ solutionId: "12345",
351
+ customObjectId: "12345",
352
+ type: "meeting",
353
+ title: "Meeting",
354
+ description: "More info about the meeting",
355
+ note: "An internal note about the meeting",
356
+ location: "Space",
357
+ locationAddress: {
358
+ id: "123",
359
+ type: "primary",
360
+ string: "25 Spring Street, Blackburn, VIC 3130",
361
+ name: "HQ US",
362
+ line1: "Main street",
363
+ line2: "apt #",
364
+ line3: "Suite #",
365
+ line4: "delivery instructions",
366
+ streetNumber: "25",
367
+ city: "San Francisco",
368
+ state: "CA",
369
+ postalCode: "94104",
370
+ country: "US",
371
+ latitude: "40.759211",
372
+ longitude: "-73.984638",
373
+ county: "Santa Clara",
374
+ contactName: "Elon Musk",
375
+ salutation: "Mr",
376
+ phoneNumber: "111-111-1111",
377
+ fax: "122-111-1111",
378
+ email: "elon@musk.com",
379
+ website: "https://elonmusk.com",
380
+ notes: "Address notes or delivery instructions.",
381
+ rowVersion: "1-12345",
382
+ },
383
+ allDayEvent: false,
384
+ private: true,
385
+ groupEvent: true,
386
+ eventSubType: "debrief",
387
+ groupEventType: "Proposed",
388
+ child: false,
389
+ archived: false,
390
+ deleted: false,
391
+ showAs: "busy",
392
+ done: false,
393
+ startDatetime: "2021-05-01T12:00:00.000Z",
394
+ endDatetime: "2021-05-01T12:30:00.000Z",
395
+ durationMinutes: 30,
396
+ activityDate: "2021-05-01",
397
+ endDate: "2021-05-01",
398
+ recurrent: false,
399
+ reminderDatetime: "2021-05-01T17:00:00.000Z",
400
+ reminderSet: false,
401
+ videoConferenceUrl: "https://us02web.zoom.us/j/88120759396",
402
+ videoConferenceId: "zoom:88120759396",
403
+ customFields: [
404
+ {
405
+ id: "2389328923893298",
406
+ name: "employee_level",
407
+ description: "Employee Level",
408
+ value: true,
409
+ },
410
+ {
411
+ id: "2389328923893298",
412
+ name: "employee_level",
413
+ description: "Employee Level",
414
+ value: "Uses Salesforce and Marketo",
415
+ },
416
+ ],
417
+ attendees: [
418
+ {
419
+ id: "12345",
420
+ name: "Elon Musk",
421
+ firstName: "Elon",
422
+ middleName: "D.",
423
+ lastName: "Musk",
424
+ prefix: "Mr.",
425
+ suffix: "PhD",
426
+ emailAddress: "elon@musk.com",
427
+ isOrganizer: true,
428
+ status: "accepted",
429
+ userId: "12345",
430
+ contactId: "12345",
431
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
432
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
433
+ },
434
+ {
435
+ id: "12345",
436
+ name: "Elon Musk",
437
+ firstName: "Elon",
438
+ middleName: "D.",
439
+ lastName: "Musk",
440
+ prefix: "Mr.",
441
+ suffix: "PhD",
442
+ emailAddress: "elon@musk.com",
443
+ isOrganizer: true,
444
+ status: "accepted",
445
+ userId: "12345",
446
+ contactId: "12345",
447
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
448
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
449
+ },
450
+ {
451
+ id: "12345",
452
+ name: "Elon Musk",
453
+ firstName: "Elon",
454
+ middleName: "D.",
455
+ lastName: "Musk",
456
+ prefix: "Mr.",
457
+ suffix: "PhD",
458
+ emailAddress: "elon@musk.com",
459
+ isOrganizer: true,
460
+ status: "accepted",
461
+ userId: "12345",
462
+ contactId: "12345",
463
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
464
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
465
+ },
466
+ ],
467
+ updatedBy: "12345",
468
+ createdBy: "12345",
469
+ updatedAt: "2020-09-30T07:43:32.000Z",
470
+ createdAt: "2020-09-30T07:43:32.000Z",
471
+ passThrough: [
472
+ {
473
+ serviceId: "<id>",
474
+ extendPaths: [
475
+ {
476
+ path: "$.nested.property",
477
+ value: {
478
+ "TaxClassificationRef": {
479
+ "value": "EUC-99990201-V1-00020000",
480
+ },
481
+ },
482
+ },
483
+ {
484
+ path: "$.nested.property",
485
+ value: {
486
+ "TaxClassificationRef": {
487
+ "value": "EUC-99990201-V1-00020000",
488
+ },
489
+ },
490
+ },
491
+ {
492
+ path: "$.nested.property",
493
+ value: {
494
+ "TaxClassificationRef": {
495
+ "value": "EUC-99990201-V1-00020000",
496
+ },
497
+ },
498
+ },
499
+ ],
500
+ },
501
+ {
502
+ serviceId: "<id>",
503
+ extendPaths: [
504
+ {
505
+ path: "$.nested.property",
506
+ value: {
507
+ "TaxClassificationRef": {
508
+ "value": "EUC-99990201-V1-00020000",
509
+ },
510
+ },
511
+ },
512
+ {
513
+ path: "$.nested.property",
514
+ value: {
515
+ "TaxClassificationRef": {
516
+ "value": "EUC-99990201-V1-00020000",
517
+ },
518
+ },
519
+ },
520
+ ],
521
+ },
522
+ ],
523
+ },
524
+ ],
525
+ meta: {
526
+ itemsOnPage: 50,
527
+ cursors: {
528
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
529
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
530
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
531
+ },
532
+ },
533
+ links: {
534
+ previous:
535
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
536
+ current: "https://unify.apideck.com/crm/companies",
537
+ next:
538
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
539
+ },
540
+ });
541
+ });
542
+
543
+ test("Activities Crm Activities Add", async () => {
544
+ const testHttpClient = createTestHTTPClient("crm.activitiesAdd");
545
+
546
+ const apideck = new Apideck({
547
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
548
+ httpClient: testHttpClient,
549
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
550
+ });
551
+
552
+ const result = await apideck.crm.activities.create({
553
+ consumerId: "test-consumer",
554
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
555
+ serviceId: "salesforce",
556
+ activity: {
557
+ activityDatetime: "2021-05-01T12:00:00.000Z",
558
+ durationSeconds: 1800,
559
+ userId: "12345",
560
+ accountId: "12345",
561
+ contactId: "12345",
562
+ companyId: "12345",
563
+ opportunityId: "12345",
564
+ leadId: "12345",
565
+ ownerId: "12345",
566
+ campaignId: "12345",
567
+ caseId: "12345",
568
+ assetId: "12345",
569
+ contractId: "12345",
570
+ productId: "12345",
571
+ solutionId: "12345",
572
+ customObjectId: "12345",
573
+ type: "meeting",
574
+ title: "Meeting",
575
+ description: "More info about the meeting",
576
+ note: "An internal note about the meeting",
577
+ location: "Space",
578
+ locationAddress: {
579
+ id: "123",
580
+ type: "primary",
581
+ string: "25 Spring Street, Blackburn, VIC 3130",
582
+ name: "HQ US",
583
+ line1: "Main street",
584
+ line2: "apt #",
585
+ line3: "Suite #",
586
+ line4: "delivery instructions",
587
+ streetNumber: "25",
588
+ city: "San Francisco",
589
+ state: "CA",
590
+ postalCode: "94104",
591
+ country: "US",
592
+ latitude: "40.759211",
593
+ longitude: "-73.984638",
594
+ county: "Santa Clara",
595
+ contactName: "Elon Musk",
596
+ salutation: "Mr",
597
+ phoneNumber: "111-111-1111",
598
+ fax: "122-111-1111",
599
+ email: "elon@musk.com",
600
+ website: "https://elonmusk.com",
601
+ notes: "Address notes or delivery instructions.",
602
+ rowVersion: "1-12345",
603
+ },
604
+ allDayEvent: false,
605
+ private: true,
606
+ groupEvent: true,
607
+ eventSubType: "debrief",
608
+ groupEventType: "Proposed",
609
+ child: false,
610
+ archived: false,
611
+ deleted: false,
612
+ showAs: "busy",
613
+ done: false,
614
+ startDatetime: "2021-05-01T12:00:00.000Z",
615
+ endDatetime: "2021-05-01T12:30:00.000Z",
616
+ activityDate: "2021-05-01",
617
+ endDate: "2021-05-01",
618
+ recurrent: false,
619
+ reminderDatetime: "2021-05-01T17:00:00.000Z",
620
+ reminderSet: false,
621
+ videoConferenceUrl: "https://us02web.zoom.us/j/88120759396",
622
+ videoConferenceId: "zoom:88120759396",
623
+ customFields: [
624
+ {
625
+ id: "2389328923893298",
626
+ name: "employee_level",
627
+ description: "Employee Level",
628
+ value: {},
629
+ },
630
+ {
631
+ id: "2389328923893298",
632
+ name: "employee_level",
633
+ description: "Employee Level",
634
+ value: true,
635
+ },
636
+ ],
637
+ attendees: [
638
+ {
639
+ name: "Elon Musk",
640
+ firstName: "Elon",
641
+ middleName: "D.",
642
+ lastName: "Musk",
643
+ prefix: "Mr.",
644
+ suffix: "PhD",
645
+ emailAddress: "elon@musk.com",
646
+ isOrganizer: true,
647
+ status: "accepted",
648
+ },
649
+ ],
650
+ passThrough: [
651
+ {
652
+ serviceId: "<id>",
653
+ extendPaths: [
654
+ {
655
+ path: "$.nested.property",
656
+ value: {
657
+ "TaxClassificationRef": {
658
+ "value": "EUC-99990201-V1-00020000",
659
+ },
660
+ },
661
+ },
662
+ {
663
+ path: "$.nested.property",
664
+ value: {
665
+ "TaxClassificationRef": {
666
+ "value": "EUC-99990201-V1-00020000",
667
+ },
668
+ },
669
+ },
670
+ {
671
+ path: "$.nested.property",
672
+ value: {
673
+ "TaxClassificationRef": {
674
+ "value": "EUC-99990201-V1-00020000",
675
+ },
676
+ },
677
+ },
678
+ ],
679
+ },
680
+ ],
681
+ },
682
+ });
683
+ expect(result.httpMeta.response.status).toBe(201);
684
+ expect(result.createActivityResponse).toBeDefined();
685
+ expect(result.createActivityResponse).toEqual({
686
+ statusCode: 200,
687
+ status: "OK",
688
+ service: "zoho-crm",
689
+ resource: "activities",
690
+ operation: "add",
691
+ data: {
692
+ id: "12345",
693
+ },
694
+ });
695
+ });
696
+
697
+ test("Activities Crm Activities One", async () => {
698
+ const testHttpClient = createTestHTTPClient("crm.activitiesOne");
699
+
700
+ const apideck = new Apideck({
701
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
702
+ httpClient: testHttpClient,
703
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
704
+ });
705
+
706
+ const result = await apideck.crm.activities.get({
707
+ id: "<id>",
708
+ consumerId: "test-consumer",
709
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
710
+ serviceId: "salesforce",
711
+ fields: "id,updated_at",
712
+ });
713
+ expect(result.httpMeta.response.status).toBe(200);
714
+ expect(result.getActivityResponse).toBeDefined();
715
+ expect(result.getActivityResponse).toEqual({
716
+ statusCode: 200,
717
+ status: "OK",
718
+ service: "zoho-crm",
719
+ resource: "activities",
720
+ operation: "one",
721
+ data: {
722
+ id: "12345",
723
+ downstreamId: "12345",
724
+ activityDatetime: "2021-05-01T12:00:00.000Z",
725
+ durationSeconds: 1800,
726
+ userId: "12345",
727
+ accountId: "12345",
728
+ contactId: "12345",
729
+ companyId: "12345",
730
+ opportunityId: "12345",
731
+ leadId: "12345",
732
+ ownerId: "12345",
733
+ campaignId: "12345",
734
+ caseId: "12345",
735
+ assetId: "12345",
736
+ contractId: "12345",
737
+ productId: "12345",
738
+ solutionId: "12345",
739
+ customObjectId: "12345",
740
+ type: "meeting",
741
+ title: "Meeting",
742
+ description: "More info about the meeting",
743
+ note: "An internal note about the meeting",
744
+ location: "Space",
745
+ locationAddress: {
746
+ id: "123",
747
+ type: "primary",
748
+ string: "25 Spring Street, Blackburn, VIC 3130",
749
+ name: "HQ US",
750
+ line1: "Main street",
751
+ line2: "apt #",
752
+ line3: "Suite #",
753
+ line4: "delivery instructions",
754
+ streetNumber: "25",
755
+ city: "San Francisco",
756
+ state: "CA",
757
+ postalCode: "94104",
758
+ country: "US",
759
+ latitude: "40.759211",
760
+ longitude: "-73.984638",
761
+ county: "Santa Clara",
762
+ contactName: "Elon Musk",
763
+ salutation: "Mr",
764
+ phoneNumber: "111-111-1111",
765
+ fax: "122-111-1111",
766
+ email: "elon@musk.com",
767
+ website: "https://elonmusk.com",
768
+ notes: "Address notes or delivery instructions.",
769
+ rowVersion: "1-12345",
770
+ },
771
+ allDayEvent: false,
772
+ private: true,
773
+ groupEvent: true,
774
+ eventSubType: "debrief",
775
+ groupEventType: "Proposed",
776
+ child: false,
777
+ archived: false,
778
+ deleted: false,
779
+ showAs: "busy",
780
+ done: false,
781
+ startDatetime: "2021-05-01T12:00:00.000Z",
782
+ endDatetime: "2021-05-01T12:30:00.000Z",
783
+ durationMinutes: 30,
784
+ activityDate: "2021-05-01",
785
+ endDate: "2021-05-01",
786
+ recurrent: false,
787
+ reminderDatetime: "2021-05-01T17:00:00.000Z",
788
+ reminderSet: false,
789
+ videoConferenceUrl: "https://us02web.zoom.us/j/88120759396",
790
+ videoConferenceId: "zoom:88120759396",
791
+ customFields: [
792
+ {
793
+ id: "2389328923893298",
794
+ name: "employee_level",
795
+ description: "Employee Level",
796
+ value: {},
797
+ },
798
+ {
799
+ id: "2389328923893298",
800
+ name: "employee_level",
801
+ description: "Employee Level",
802
+ value: {},
803
+ },
804
+ {
805
+ id: "2389328923893298",
806
+ name: "employee_level",
807
+ description: "Employee Level",
808
+ value: {},
809
+ },
810
+ ],
811
+ attendees: [
812
+ {
813
+ id: "12345",
814
+ name: "Elon Musk",
815
+ firstName: "Elon",
816
+ middleName: "D.",
817
+ lastName: "Musk",
818
+ prefix: "Mr.",
819
+ suffix: "PhD",
820
+ emailAddress: "elon@musk.com",
821
+ isOrganizer: true,
822
+ status: "accepted",
823
+ userId: "12345",
824
+ contactId: "12345",
825
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
826
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
827
+ },
828
+ {
829
+ id: "12345",
830
+ name: "Elon Musk",
831
+ firstName: "Elon",
832
+ middleName: "D.",
833
+ lastName: "Musk",
834
+ prefix: "Mr.",
835
+ suffix: "PhD",
836
+ emailAddress: "elon@musk.com",
837
+ isOrganizer: true,
838
+ status: "accepted",
839
+ userId: "12345",
840
+ contactId: "12345",
841
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
842
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
843
+ },
844
+ {
845
+ id: "12345",
846
+ name: "Elon Musk",
847
+ firstName: "Elon",
848
+ middleName: "D.",
849
+ lastName: "Musk",
850
+ prefix: "Mr.",
851
+ suffix: "PhD",
852
+ emailAddress: "elon@musk.com",
853
+ isOrganizer: true,
854
+ status: "accepted",
855
+ userId: "12345",
856
+ contactId: "12345",
857
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
858
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
859
+ },
860
+ ],
861
+ updatedBy: "12345",
862
+ createdBy: "12345",
863
+ updatedAt: "2020-09-30T07:43:32.000Z",
864
+ createdAt: "2020-09-30T07:43:32.000Z",
865
+ passThrough: [
866
+ {
867
+ serviceId: "<id>",
868
+ extendPaths: [
869
+ {
870
+ path: "$.nested.property",
871
+ value: {
872
+ "TaxClassificationRef": {
873
+ "value": "EUC-99990201-V1-00020000",
874
+ },
875
+ },
876
+ },
877
+ {
878
+ path: "$.nested.property",
879
+ value: {
880
+ "TaxClassificationRef": {
881
+ "value": "EUC-99990201-V1-00020000",
882
+ },
883
+ },
884
+ },
885
+ ],
886
+ },
887
+ {
888
+ serviceId: "<id>",
889
+ extendPaths: [
890
+ {
891
+ path: "$.nested.property",
892
+ value: {
893
+ "TaxClassificationRef": {
894
+ "value": "EUC-99990201-V1-00020000",
895
+ },
896
+ },
897
+ },
898
+ ],
899
+ },
900
+ ],
901
+ },
902
+ });
903
+ });
904
+
905
+ test("Activities Crm Activities Update", async () => {
906
+ const testHttpClient = createTestHTTPClient("crm.activitiesUpdate");
907
+
908
+ const apideck = new Apideck({
909
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
910
+ httpClient: testHttpClient,
911
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
912
+ });
913
+
914
+ const result = await apideck.crm.activities.update({
915
+ id: "<id>",
916
+ consumerId: "test-consumer",
917
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
918
+ serviceId: "salesforce",
919
+ activity: {
920
+ activityDatetime: "2021-05-01T12:00:00.000Z",
921
+ durationSeconds: 1800,
922
+ userId: "12345",
923
+ accountId: "12345",
924
+ contactId: "12345",
925
+ companyId: "12345",
926
+ opportunityId: "12345",
927
+ leadId: "12345",
928
+ ownerId: "12345",
929
+ campaignId: "12345",
930
+ caseId: "12345",
931
+ assetId: "12345",
932
+ contractId: "12345",
933
+ productId: "12345",
934
+ solutionId: "12345",
935
+ customObjectId: "12345",
936
+ type: "meeting",
937
+ title: "Meeting",
938
+ description: "More info about the meeting",
939
+ note: "An internal note about the meeting",
940
+ location: "Space",
941
+ locationAddress: {
942
+ id: "123",
943
+ type: "primary",
944
+ string: "25 Spring Street, Blackburn, VIC 3130",
945
+ name: "HQ US",
946
+ line1: "Main street",
947
+ line2: "apt #",
948
+ line3: "Suite #",
949
+ line4: "delivery instructions",
950
+ streetNumber: "25",
951
+ city: "San Francisco",
952
+ state: "CA",
953
+ postalCode: "94104",
954
+ country: "US",
955
+ latitude: "40.759211",
956
+ longitude: "-73.984638",
957
+ county: "Santa Clara",
958
+ contactName: "Elon Musk",
959
+ salutation: "Mr",
960
+ phoneNumber: "111-111-1111",
961
+ fax: "122-111-1111",
962
+ email: "elon@musk.com",
963
+ website: "https://elonmusk.com",
964
+ notes: "Address notes or delivery instructions.",
965
+ rowVersion: "1-12345",
966
+ },
967
+ allDayEvent: false,
968
+ private: true,
969
+ groupEvent: true,
970
+ eventSubType: "debrief",
971
+ groupEventType: "Proposed",
972
+ child: false,
973
+ archived: false,
974
+ deleted: false,
975
+ showAs: "busy",
976
+ done: false,
977
+ startDatetime: "2021-05-01T12:00:00.000Z",
978
+ endDatetime: "2021-05-01T12:30:00.000Z",
979
+ activityDate: "2021-05-01",
980
+ endDate: "2021-05-01",
981
+ recurrent: false,
982
+ reminderDatetime: "2021-05-01T17:00:00.000Z",
983
+ reminderSet: false,
984
+ videoConferenceUrl: "https://us02web.zoom.us/j/88120759396",
985
+ videoConferenceId: "zoom:88120759396",
986
+ customFields: [
987
+ {
988
+ id: "2389328923893298",
989
+ name: "employee_level",
990
+ description: "Employee Level",
991
+ value: {},
992
+ },
993
+ {
994
+ id: "2389328923893298",
995
+ name: "employee_level",
996
+ description: "Employee Level",
997
+ value: true,
998
+ },
999
+ {
1000
+ id: "2389328923893298",
1001
+ name: "employee_level",
1002
+ description: "Employee Level",
1003
+ value: {
1004
+ "0": {},
1005
+ "1": {},
1006
+ },
1007
+ },
1008
+ ],
1009
+ attendees: [
1010
+ {
1011
+ name: "Elon Musk",
1012
+ firstName: "Elon",
1013
+ middleName: "D.",
1014
+ lastName: "Musk",
1015
+ prefix: "Mr.",
1016
+ suffix: "PhD",
1017
+ emailAddress: "elon@musk.com",
1018
+ isOrganizer: true,
1019
+ status: "accepted",
1020
+ },
1021
+ {
1022
+ name: "Elon Musk",
1023
+ firstName: "Elon",
1024
+ middleName: "D.",
1025
+ lastName: "Musk",
1026
+ prefix: "Mr.",
1027
+ suffix: "PhD",
1028
+ emailAddress: "elon@musk.com",
1029
+ isOrganizer: true,
1030
+ status: "accepted",
1031
+ },
1032
+ ],
1033
+ passThrough: [
1034
+ {
1035
+ serviceId: "<id>",
1036
+ extendPaths: [
1037
+ {
1038
+ path: "$.nested.property",
1039
+ value: {
1040
+ "TaxClassificationRef": {
1041
+ "value": "EUC-99990201-V1-00020000",
1042
+ },
1043
+ },
1044
+ },
1045
+ ],
1046
+ },
1047
+ {
1048
+ serviceId: "<id>",
1049
+ extendPaths: [
1050
+ {
1051
+ path: "$.nested.property",
1052
+ value: {
1053
+ "TaxClassificationRef": {
1054
+ "value": "EUC-99990201-V1-00020000",
1055
+ },
1056
+ },
1057
+ },
1058
+ {
1059
+ path: "$.nested.property",
1060
+ value: {
1061
+ "TaxClassificationRef": {
1062
+ "value": "EUC-99990201-V1-00020000",
1063
+ },
1064
+ },
1065
+ },
1066
+ {
1067
+ path: "$.nested.property",
1068
+ value: {
1069
+ "TaxClassificationRef": {
1070
+ "value": "EUC-99990201-V1-00020000",
1071
+ },
1072
+ },
1073
+ },
1074
+ ],
1075
+ },
1076
+ {
1077
+ serviceId: "<id>",
1078
+ extendPaths: [
1079
+ {
1080
+ path: "$.nested.property",
1081
+ value: {
1082
+ "TaxClassificationRef": {
1083
+ "value": "EUC-99990201-V1-00020000",
1084
+ },
1085
+ },
1086
+ },
1087
+ {
1088
+ path: "$.nested.property",
1089
+ value: {
1090
+ "TaxClassificationRef": {
1091
+ "value": "EUC-99990201-V1-00020000",
1092
+ },
1093
+ },
1094
+ },
1095
+ ],
1096
+ },
1097
+ ],
1098
+ },
1099
+ });
1100
+ expect(result.httpMeta.response.status).toBe(200);
1101
+ expect(result.updateActivityResponse).toBeDefined();
1102
+ expect(result.updateActivityResponse).toEqual({
1103
+ statusCode: 200,
1104
+ status: "OK",
1105
+ service: "zoho-crm",
1106
+ resource: "activities",
1107
+ operation: "update",
1108
+ data: {
1109
+ id: "12345",
1110
+ },
1111
+ });
1112
+ });
1113
+
1114
+ test("Activities Crm Activities Delete", async () => {
1115
+ const testHttpClient = createTestHTTPClient("crm.activitiesDelete");
1116
+
1117
+ const apideck = new Apideck({
1118
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1119
+ httpClient: testHttpClient,
1120
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1121
+ });
1122
+
1123
+ const result = await apideck.crm.activities.delete({
1124
+ id: "<id>",
1125
+ consumerId: "test-consumer",
1126
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1127
+ serviceId: "salesforce",
1128
+ });
1129
+ expect(result.httpMeta.response.status).toBe(200);
1130
+ expect(result.deleteActivityResponse).toBeDefined();
1131
+ expect(result.deleteActivityResponse).toEqual({
1132
+ statusCode: 200,
1133
+ status: "OK",
1134
+ service: "zoho-crm",
1135
+ resource: "activities",
1136
+ operation: "delete",
1137
+ data: {
1138
+ id: "12345",
1139
+ },
1140
+ });
1141
+ });