@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,1421 @@
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("Contacts Crm Contacts All", async () => {
10
+ const testHttpClient = createTestHTTPClient("crm.contactsAll");
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.contacts.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ firstName: "Elon",
24
+ lastName: "Musk",
25
+ email: "elon@tesla.com",
26
+ companyId: "12345",
27
+ ownerId: "12345",
28
+ },
29
+ sort: {
30
+ by: "created_at",
31
+ direction: "desc",
32
+ },
33
+ passThrough: {
34
+ "search": "San Francisco",
35
+ },
36
+ fields: "id,updated_at",
37
+ });
38
+ expect(result.httpMeta.response.status).toBe(200);
39
+ expect(result.getContactsResponse).toBeDefined();
40
+ expect(result.getContactsResponse).toEqual({
41
+ statusCode: 200,
42
+ status: "OK",
43
+ service: "zoho-crm",
44
+ resource: "contacts",
45
+ operation: "all",
46
+ data: [
47
+ {
48
+ id: "12345",
49
+ name: "Elon Musk",
50
+ ownerId: "54321",
51
+ type: "personal",
52
+ companyId: "23456",
53
+ companyName: "23456",
54
+ leadId: "34567",
55
+ firstName: "Elon",
56
+ middleName: "D.",
57
+ lastName: "Musk",
58
+ prefix: "Mr.",
59
+ suffix: "PhD",
60
+ title: "CEO",
61
+ department: "Engineering",
62
+ language: "EN",
63
+ gender: "female",
64
+ birthday: "2000-08-12",
65
+ photoUrl: "https://unavatar.io/elon-musk",
66
+ leadSource: "Cold Call",
67
+ fax: "+12129876543",
68
+ description: "Internal champion",
69
+ currentBalance: 10.5,
70
+ status: "open",
71
+ active: true,
72
+ websites: [
73
+ {
74
+ id: "12345",
75
+ url: "http://example.com",
76
+ type: "primary",
77
+ },
78
+ {
79
+ id: "12345",
80
+ url: "http://example.com",
81
+ type: "primary",
82
+ },
83
+ ],
84
+ addresses: [
85
+ {
86
+ id: "123",
87
+ type: "primary",
88
+ string: "25 Spring Street, Blackburn, VIC 3130",
89
+ name: "HQ US",
90
+ line1: "Main street",
91
+ line2: "apt #",
92
+ line3: "Suite #",
93
+ line4: "delivery instructions",
94
+ streetNumber: "25",
95
+ city: "San Francisco",
96
+ state: "CA",
97
+ postalCode: "94104",
98
+ country: "US",
99
+ latitude: "40.759211",
100
+ longitude: "-73.984638",
101
+ county: "Santa Clara",
102
+ contactName: "Elon Musk",
103
+ salutation: "Mr",
104
+ phoneNumber: "111-111-1111",
105
+ fax: "122-111-1111",
106
+ email: "elon@musk.com",
107
+ website: "https://elonmusk.com",
108
+ notes: "Address notes or delivery instructions.",
109
+ rowVersion: "1-12345",
110
+ },
111
+ {
112
+ id: "123",
113
+ type: "primary",
114
+ string: "25 Spring Street, Blackburn, VIC 3130",
115
+ name: "HQ US",
116
+ line1: "Main street",
117
+ line2: "apt #",
118
+ line3: "Suite #",
119
+ line4: "delivery instructions",
120
+ streetNumber: "25",
121
+ city: "San Francisco",
122
+ state: "CA",
123
+ postalCode: "94104",
124
+ country: "US",
125
+ latitude: "40.759211",
126
+ longitude: "-73.984638",
127
+ county: "Santa Clara",
128
+ contactName: "Elon Musk",
129
+ salutation: "Mr",
130
+ phoneNumber: "111-111-1111",
131
+ fax: "122-111-1111",
132
+ email: "elon@musk.com",
133
+ website: "https://elonmusk.com",
134
+ notes: "Address notes or delivery instructions.",
135
+ rowVersion: "1-12345",
136
+ },
137
+ {
138
+ id: "123",
139
+ type: "primary",
140
+ string: "25 Spring Street, Blackburn, VIC 3130",
141
+ name: "HQ US",
142
+ line1: "Main street",
143
+ line2: "apt #",
144
+ line3: "Suite #",
145
+ line4: "delivery instructions",
146
+ streetNumber: "25",
147
+ city: "San Francisco",
148
+ state: "CA",
149
+ postalCode: "94104",
150
+ country: "US",
151
+ latitude: "40.759211",
152
+ longitude: "-73.984638",
153
+ county: "Santa Clara",
154
+ contactName: "Elon Musk",
155
+ salutation: "Mr",
156
+ phoneNumber: "111-111-1111",
157
+ fax: "122-111-1111",
158
+ email: "elon@musk.com",
159
+ website: "https://elonmusk.com",
160
+ notes: "Address notes or delivery instructions.",
161
+ rowVersion: "1-12345",
162
+ },
163
+ ],
164
+ socialLinks: [
165
+ {
166
+ id: "12345",
167
+ url: "https://www.twitter.com/apideck",
168
+ type: "twitter",
169
+ },
170
+ ],
171
+ phoneNumbers: [
172
+ {
173
+ id: "12345",
174
+ countryCode: "1",
175
+ areaCode: "323",
176
+ number: "111-111-1111",
177
+ extension: "105",
178
+ type: "primary",
179
+ },
180
+ ],
181
+ emails: [
182
+ {
183
+ id: "123",
184
+ email: "elon@musk.com",
185
+ type: "primary",
186
+ },
187
+ ],
188
+ emailDomain: "gmail.com",
189
+ customFields: [
190
+ {
191
+ id: "2389328923893298",
192
+ name: "employee_level",
193
+ description: "Employee Level",
194
+ value: {},
195
+ },
196
+ {
197
+ id: "2389328923893298",
198
+ name: "employee_level",
199
+ description: "Employee Level",
200
+ value: "Uses Salesforce and Marketo",
201
+ },
202
+ ],
203
+ tags: [
204
+ "New",
205
+ ],
206
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
207
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
208
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
209
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
210
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
211
+ opportunityIds: [
212
+ "12345",
213
+ ],
214
+ passThrough: [
215
+ {
216
+ serviceId: "<id>",
217
+ extendPaths: [
218
+ {
219
+ path: "$.nested.property",
220
+ value: {
221
+ "TaxClassificationRef": {
222
+ "value": "EUC-99990201-V1-00020000",
223
+ },
224
+ },
225
+ },
226
+ ],
227
+ },
228
+ {
229
+ serviceId: "<id>",
230
+ extendPaths: [
231
+ {
232
+ path: "$.nested.property",
233
+ value: {
234
+ "TaxClassificationRef": {
235
+ "value": "EUC-99990201-V1-00020000",
236
+ },
237
+ },
238
+ },
239
+ ],
240
+ },
241
+ {
242
+ serviceId: "<id>",
243
+ extendPaths: [
244
+ {
245
+ path: "$.nested.property",
246
+ value: {
247
+ "TaxClassificationRef": {
248
+ "value": "EUC-99990201-V1-00020000",
249
+ },
250
+ },
251
+ },
252
+ {
253
+ path: "$.nested.property",
254
+ value: {
255
+ "TaxClassificationRef": {
256
+ "value": "EUC-99990201-V1-00020000",
257
+ },
258
+ },
259
+ },
260
+ {
261
+ path: "$.nested.property",
262
+ value: {
263
+ "TaxClassificationRef": {
264
+ "value": "EUC-99990201-V1-00020000",
265
+ },
266
+ },
267
+ },
268
+ ],
269
+ },
270
+ ],
271
+ },
272
+ {
273
+ id: "12345",
274
+ name: "Elon Musk",
275
+ ownerId: "54321",
276
+ type: "personal",
277
+ companyId: "23456",
278
+ companyName: "23456",
279
+ leadId: "34567",
280
+ firstName: "Elon",
281
+ middleName: "D.",
282
+ lastName: "Musk",
283
+ prefix: "Mr.",
284
+ suffix: "PhD",
285
+ title: "CEO",
286
+ department: "Engineering",
287
+ language: "EN",
288
+ gender: "female",
289
+ birthday: "2000-08-12",
290
+ photoUrl: "https://unavatar.io/elon-musk",
291
+ leadSource: "Cold Call",
292
+ fax: "+12129876543",
293
+ description: "Internal champion",
294
+ currentBalance: 10.5,
295
+ status: "open",
296
+ active: true,
297
+ websites: [
298
+ {
299
+ id: "12345",
300
+ url: "http://example.com",
301
+ type: "primary",
302
+ },
303
+ {
304
+ id: "12345",
305
+ url: "http://example.com",
306
+ type: "primary",
307
+ },
308
+ ],
309
+ addresses: [
310
+ {
311
+ id: "123",
312
+ type: "primary",
313
+ string: "25 Spring Street, Blackburn, VIC 3130",
314
+ name: "HQ US",
315
+ line1: "Main street",
316
+ line2: "apt #",
317
+ line3: "Suite #",
318
+ line4: "delivery instructions",
319
+ streetNumber: "25",
320
+ city: "San Francisco",
321
+ state: "CA",
322
+ postalCode: "94104",
323
+ country: "US",
324
+ latitude: "40.759211",
325
+ longitude: "-73.984638",
326
+ county: "Santa Clara",
327
+ contactName: "Elon Musk",
328
+ salutation: "Mr",
329
+ phoneNumber: "111-111-1111",
330
+ fax: "122-111-1111",
331
+ email: "elon@musk.com",
332
+ website: "https://elonmusk.com",
333
+ notes: "Address notes or delivery instructions.",
334
+ rowVersion: "1-12345",
335
+ },
336
+ {
337
+ id: "123",
338
+ type: "primary",
339
+ string: "25 Spring Street, Blackburn, VIC 3130",
340
+ name: "HQ US",
341
+ line1: "Main street",
342
+ line2: "apt #",
343
+ line3: "Suite #",
344
+ line4: "delivery instructions",
345
+ streetNumber: "25",
346
+ city: "San Francisco",
347
+ state: "CA",
348
+ postalCode: "94104",
349
+ country: "US",
350
+ latitude: "40.759211",
351
+ longitude: "-73.984638",
352
+ county: "Santa Clara",
353
+ contactName: "Elon Musk",
354
+ salutation: "Mr",
355
+ phoneNumber: "111-111-1111",
356
+ fax: "122-111-1111",
357
+ email: "elon@musk.com",
358
+ website: "https://elonmusk.com",
359
+ notes: "Address notes or delivery instructions.",
360
+ rowVersion: "1-12345",
361
+ },
362
+ ],
363
+ socialLinks: [
364
+ {
365
+ id: "12345",
366
+ url: "https://www.twitter.com/apideck",
367
+ type: "twitter",
368
+ },
369
+ ],
370
+ phoneNumbers: [
371
+ {
372
+ id: "12345",
373
+ countryCode: "1",
374
+ areaCode: "323",
375
+ number: "111-111-1111",
376
+ extension: "105",
377
+ type: "primary",
378
+ },
379
+ ],
380
+ emails: [
381
+ {
382
+ id: "123",
383
+ email: "elon@musk.com",
384
+ type: "primary",
385
+ },
386
+ {
387
+ id: "123",
388
+ email: "elon@musk.com",
389
+ type: "primary",
390
+ },
391
+ ],
392
+ emailDomain: "gmail.com",
393
+ customFields: [
394
+ {
395
+ id: "2389328923893298",
396
+ name: "employee_level",
397
+ description: "Employee Level",
398
+ value: "Uses Salesforce and Marketo",
399
+ },
400
+ {
401
+ id: "2389328923893298",
402
+ name: "employee_level",
403
+ description: "Employee Level",
404
+ value: {
405
+ "0": {},
406
+ "1": {},
407
+ },
408
+ },
409
+ ],
410
+ tags: [
411
+ "New",
412
+ ],
413
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
414
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
415
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
416
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
417
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
418
+ opportunityIds: [
419
+ "12345",
420
+ ],
421
+ passThrough: [
422
+ {
423
+ serviceId: "<id>",
424
+ extendPaths: [
425
+ {
426
+ path: "$.nested.property",
427
+ value: {
428
+ "TaxClassificationRef": {
429
+ "value": "EUC-99990201-V1-00020000",
430
+ },
431
+ },
432
+ },
433
+ {
434
+ path: "$.nested.property",
435
+ value: {
436
+ "TaxClassificationRef": {
437
+ "value": "EUC-99990201-V1-00020000",
438
+ },
439
+ },
440
+ },
441
+ ],
442
+ },
443
+ {
444
+ serviceId: "<id>",
445
+ extendPaths: [
446
+ {
447
+ path: "$.nested.property",
448
+ value: {
449
+ "TaxClassificationRef": {
450
+ "value": "EUC-99990201-V1-00020000",
451
+ },
452
+ },
453
+ },
454
+ ],
455
+ },
456
+ {
457
+ serviceId: "<id>",
458
+ extendPaths: [
459
+ {
460
+ path: "$.nested.property",
461
+ value: {
462
+ "TaxClassificationRef": {
463
+ "value": "EUC-99990201-V1-00020000",
464
+ },
465
+ },
466
+ },
467
+ ],
468
+ },
469
+ ],
470
+ },
471
+ {
472
+ id: "12345",
473
+ name: "Elon Musk",
474
+ ownerId: "54321",
475
+ type: "personal",
476
+ companyId: "23456",
477
+ companyName: "23456",
478
+ leadId: "34567",
479
+ firstName: "Elon",
480
+ middleName: "D.",
481
+ lastName: "Musk",
482
+ prefix: "Mr.",
483
+ suffix: "PhD",
484
+ title: "CEO",
485
+ department: "Engineering",
486
+ language: "EN",
487
+ gender: "female",
488
+ birthday: "2000-08-12",
489
+ photoUrl: "https://unavatar.io/elon-musk",
490
+ leadSource: "Cold Call",
491
+ fax: "+12129876543",
492
+ description: "Internal champion",
493
+ currentBalance: 10.5,
494
+ status: "open",
495
+ active: true,
496
+ websites: [
497
+ {
498
+ id: "12345",
499
+ url: "http://example.com",
500
+ type: "primary",
501
+ },
502
+ {
503
+ id: "12345",
504
+ url: "http://example.com",
505
+ type: "primary",
506
+ },
507
+ {
508
+ id: "12345",
509
+ url: "http://example.com",
510
+ type: "primary",
511
+ },
512
+ ],
513
+ addresses: [
514
+ {
515
+ id: "123",
516
+ type: "primary",
517
+ string: "25 Spring Street, Blackburn, VIC 3130",
518
+ name: "HQ US",
519
+ line1: "Main street",
520
+ line2: "apt #",
521
+ line3: "Suite #",
522
+ line4: "delivery instructions",
523
+ streetNumber: "25",
524
+ city: "San Francisco",
525
+ state: "CA",
526
+ postalCode: "94104",
527
+ country: "US",
528
+ latitude: "40.759211",
529
+ longitude: "-73.984638",
530
+ county: "Santa Clara",
531
+ contactName: "Elon Musk",
532
+ salutation: "Mr",
533
+ phoneNumber: "111-111-1111",
534
+ fax: "122-111-1111",
535
+ email: "elon@musk.com",
536
+ website: "https://elonmusk.com",
537
+ notes: "Address notes or delivery instructions.",
538
+ rowVersion: "1-12345",
539
+ },
540
+ ],
541
+ socialLinks: [
542
+ {
543
+ id: "12345",
544
+ url: "https://www.twitter.com/apideck",
545
+ type: "twitter",
546
+ },
547
+ {
548
+ id: "12345",
549
+ url: "https://www.twitter.com/apideck",
550
+ type: "twitter",
551
+ },
552
+ {
553
+ id: "12345",
554
+ url: "https://www.twitter.com/apideck",
555
+ type: "twitter",
556
+ },
557
+ ],
558
+ phoneNumbers: [
559
+ {
560
+ id: "12345",
561
+ countryCode: "1",
562
+ areaCode: "323",
563
+ number: "111-111-1111",
564
+ extension: "105",
565
+ type: "primary",
566
+ },
567
+ {
568
+ id: "12345",
569
+ countryCode: "1",
570
+ areaCode: "323",
571
+ number: "111-111-1111",
572
+ extension: "105",
573
+ type: "primary",
574
+ },
575
+ ],
576
+ emails: [
577
+ {
578
+ id: "123",
579
+ email: "elon@musk.com",
580
+ type: "primary",
581
+ },
582
+ {
583
+ id: "123",
584
+ email: "elon@musk.com",
585
+ type: "primary",
586
+ },
587
+ {
588
+ id: "123",
589
+ email: "elon@musk.com",
590
+ type: "primary",
591
+ },
592
+ ],
593
+ emailDomain: "gmail.com",
594
+ customFields: [
595
+ {
596
+ id: "2389328923893298",
597
+ name: "employee_level",
598
+ description: "Employee Level",
599
+ value: "Uses Salesforce and Marketo",
600
+ },
601
+ ],
602
+ tags: [
603
+ "New",
604
+ ],
605
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
606
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
607
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
608
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
609
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
610
+ opportunityIds: [
611
+ "12345",
612
+ ],
613
+ passThrough: [
614
+ {
615
+ serviceId: "<id>",
616
+ extendPaths: [
617
+ {
618
+ path: "$.nested.property",
619
+ value: {
620
+ "TaxClassificationRef": {
621
+ "value": "EUC-99990201-V1-00020000",
622
+ },
623
+ },
624
+ },
625
+ ],
626
+ },
627
+ {
628
+ serviceId: "<id>",
629
+ extendPaths: [
630
+ {
631
+ path: "$.nested.property",
632
+ value: {
633
+ "TaxClassificationRef": {
634
+ "value": "EUC-99990201-V1-00020000",
635
+ },
636
+ },
637
+ },
638
+ {
639
+ path: "$.nested.property",
640
+ value: {
641
+ "TaxClassificationRef": {
642
+ "value": "EUC-99990201-V1-00020000",
643
+ },
644
+ },
645
+ },
646
+ ],
647
+ },
648
+ {
649
+ serviceId: "<id>",
650
+ extendPaths: [
651
+ {
652
+ path: "$.nested.property",
653
+ value: {
654
+ "TaxClassificationRef": {
655
+ "value": "EUC-99990201-V1-00020000",
656
+ },
657
+ },
658
+ },
659
+ {
660
+ path: "$.nested.property",
661
+ value: {
662
+ "TaxClassificationRef": {
663
+ "value": "EUC-99990201-V1-00020000",
664
+ },
665
+ },
666
+ },
667
+ ],
668
+ },
669
+ ],
670
+ },
671
+ ],
672
+ meta: {
673
+ itemsOnPage: 50,
674
+ cursors: {
675
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
676
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
677
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
678
+ },
679
+ },
680
+ links: {
681
+ previous:
682
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
683
+ current: "https://unify.apideck.com/crm/companies",
684
+ next:
685
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
686
+ },
687
+ });
688
+ });
689
+
690
+ test("Contacts Crm Contacts Add", async () => {
691
+ const testHttpClient = createTestHTTPClient("crm.contactsAdd");
692
+
693
+ const apideck = new Apideck({
694
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
695
+ httpClient: testHttpClient,
696
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
697
+ });
698
+
699
+ const result = await apideck.crm.contacts.create({
700
+ consumerId: "test-consumer",
701
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
702
+ serviceId: "salesforce",
703
+ contact: {
704
+ name: "Elon Musk",
705
+ ownerId: "54321",
706
+ type: "personal",
707
+ companyId: "23456",
708
+ companyName: "23456",
709
+ leadId: "34567",
710
+ firstName: "Elon",
711
+ middleName: "D.",
712
+ lastName: "Musk",
713
+ prefix: "Mr.",
714
+ suffix: "PhD",
715
+ title: "CEO",
716
+ department: "Engineering",
717
+ language: "EN",
718
+ gender: "female",
719
+ birthday: "2000-08-12",
720
+ photoUrl: "https://unavatar.io/elon-musk",
721
+ leadSource: "Cold Call",
722
+ fax: "+12129876543",
723
+ description: "Internal champion",
724
+ currentBalance: 10.5,
725
+ status: "open",
726
+ active: true,
727
+ websites: [
728
+ {
729
+ id: "12345",
730
+ url: "http://example.com",
731
+ type: "primary",
732
+ },
733
+ {
734
+ id: "12345",
735
+ url: "http://example.com",
736
+ type: "primary",
737
+ },
738
+ ],
739
+ addresses: [
740
+ {
741
+ id: "123",
742
+ type: "primary",
743
+ string: "25 Spring Street, Blackburn, VIC 3130",
744
+ name: "HQ US",
745
+ line1: "Main street",
746
+ line2: "apt #",
747
+ line3: "Suite #",
748
+ line4: "delivery instructions",
749
+ streetNumber: "25",
750
+ city: "San Francisco",
751
+ state: "CA",
752
+ postalCode: "94104",
753
+ country: "US",
754
+ latitude: "40.759211",
755
+ longitude: "-73.984638",
756
+ county: "Santa Clara",
757
+ contactName: "Elon Musk",
758
+ salutation: "Mr",
759
+ phoneNumber: "111-111-1111",
760
+ fax: "122-111-1111",
761
+ email: "elon@musk.com",
762
+ website: "https://elonmusk.com",
763
+ notes: "Address notes or delivery instructions.",
764
+ rowVersion: "1-12345",
765
+ },
766
+ {
767
+ id: "123",
768
+ type: "primary",
769
+ string: "25 Spring Street, Blackburn, VIC 3130",
770
+ name: "HQ US",
771
+ line1: "Main street",
772
+ line2: "apt #",
773
+ line3: "Suite #",
774
+ line4: "delivery instructions",
775
+ streetNumber: "25",
776
+ city: "San Francisco",
777
+ state: "CA",
778
+ postalCode: "94104",
779
+ country: "US",
780
+ latitude: "40.759211",
781
+ longitude: "-73.984638",
782
+ county: "Santa Clara",
783
+ contactName: "Elon Musk",
784
+ salutation: "Mr",
785
+ phoneNumber: "111-111-1111",
786
+ fax: "122-111-1111",
787
+ email: "elon@musk.com",
788
+ website: "https://elonmusk.com",
789
+ notes: "Address notes or delivery instructions.",
790
+ rowVersion: "1-12345",
791
+ },
792
+ ],
793
+ socialLinks: [
794
+ {
795
+ id: "12345",
796
+ url: "https://www.twitter.com/apideck",
797
+ type: "twitter",
798
+ },
799
+ {
800
+ id: "12345",
801
+ url: "https://www.twitter.com/apideck",
802
+ type: "twitter",
803
+ },
804
+ ],
805
+ phoneNumbers: [
806
+ {
807
+ id: "12345",
808
+ countryCode: "1",
809
+ areaCode: "323",
810
+ number: "111-111-1111",
811
+ extension: "105",
812
+ type: "primary",
813
+ },
814
+ ],
815
+ emails: [
816
+ {
817
+ id: "123",
818
+ email: "elon@musk.com",
819
+ type: "primary",
820
+ },
821
+ ],
822
+ emailDomain: "gmail.com",
823
+ customFields: [
824
+ {
825
+ id: "2389328923893298",
826
+ name: "employee_level",
827
+ description: "Employee Level",
828
+ value: {},
829
+ },
830
+ {
831
+ id: "2389328923893298",
832
+ name: "employee_level",
833
+ description: "Employee Level",
834
+ value: 10,
835
+ },
836
+ {
837
+ id: "2389328923893298",
838
+ name: "employee_level",
839
+ description: "Employee Level",
840
+ value: "Uses Salesforce and Marketo",
841
+ },
842
+ ],
843
+ tags: [
844
+ "New",
845
+ ],
846
+ opportunityIds: [
847
+ "12345",
848
+ ],
849
+ passThrough: [
850
+ {
851
+ serviceId: "<id>",
852
+ extendPaths: [
853
+ {
854
+ path: "$.nested.property",
855
+ value: {
856
+ "TaxClassificationRef": {
857
+ "value": "EUC-99990201-V1-00020000",
858
+ },
859
+ },
860
+ },
861
+ {
862
+ path: "$.nested.property",
863
+ value: {
864
+ "TaxClassificationRef": {
865
+ "value": "EUC-99990201-V1-00020000",
866
+ },
867
+ },
868
+ },
869
+ {
870
+ path: "$.nested.property",
871
+ value: {
872
+ "TaxClassificationRef": {
873
+ "value": "EUC-99990201-V1-00020000",
874
+ },
875
+ },
876
+ },
877
+ ],
878
+ },
879
+ {
880
+ serviceId: "<id>",
881
+ extendPaths: [
882
+ {
883
+ path: "$.nested.property",
884
+ value: {
885
+ "TaxClassificationRef": {
886
+ "value": "EUC-99990201-V1-00020000",
887
+ },
888
+ },
889
+ },
890
+ {
891
+ path: "$.nested.property",
892
+ value: {
893
+ "TaxClassificationRef": {
894
+ "value": "EUC-99990201-V1-00020000",
895
+ },
896
+ },
897
+ },
898
+ ],
899
+ },
900
+ {
901
+ serviceId: "<id>",
902
+ extendPaths: [
903
+ {
904
+ path: "$.nested.property",
905
+ value: {
906
+ "TaxClassificationRef": {
907
+ "value": "EUC-99990201-V1-00020000",
908
+ },
909
+ },
910
+ },
911
+ {
912
+ path: "$.nested.property",
913
+ value: {
914
+ "TaxClassificationRef": {
915
+ "value": "EUC-99990201-V1-00020000",
916
+ },
917
+ },
918
+ },
919
+ {
920
+ path: "$.nested.property",
921
+ value: {
922
+ "TaxClassificationRef": {
923
+ "value": "EUC-99990201-V1-00020000",
924
+ },
925
+ },
926
+ },
927
+ ],
928
+ },
929
+ ],
930
+ },
931
+ });
932
+ expect(result.httpMeta.response.status).toBe(201);
933
+ expect(result.createContactResponse).toBeDefined();
934
+ expect(result.createContactResponse).toEqual({
935
+ statusCode: 200,
936
+ status: "OK",
937
+ service: "zoho-crm",
938
+ resource: "contacts",
939
+ operation: "add",
940
+ data: {
941
+ id: "12345",
942
+ },
943
+ });
944
+ });
945
+
946
+ test("Contacts Crm Contacts One", async () => {
947
+ const testHttpClient = createTestHTTPClient("crm.contactsOne");
948
+
949
+ const apideck = new Apideck({
950
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
951
+ httpClient: testHttpClient,
952
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
953
+ });
954
+
955
+ const result = await apideck.crm.contacts.get({
956
+ id: "<id>",
957
+ consumerId: "test-consumer",
958
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
959
+ serviceId: "salesforce",
960
+ fields: "id,updated_at",
961
+ filter: {
962
+ firstName: "Elon",
963
+ lastName: "Musk",
964
+ email: "elon@tesla.com",
965
+ companyId: "12345",
966
+ ownerId: "12345",
967
+ },
968
+ });
969
+ expect(result.httpMeta.response.status).toBe(200);
970
+ expect(result.getContactResponse).toBeDefined();
971
+ expect(result.getContactResponse).toEqual({
972
+ statusCode: 200,
973
+ status: "OK",
974
+ service: "zoho-crm",
975
+ resource: "companies",
976
+ operation: "one",
977
+ data: {
978
+ id: "12345",
979
+ name: "Elon Musk",
980
+ ownerId: "54321",
981
+ type: "personal",
982
+ companyId: "23456",
983
+ companyName: "23456",
984
+ leadId: "34567",
985
+ firstName: "Elon",
986
+ middleName: "D.",
987
+ lastName: "Musk",
988
+ prefix: "Mr.",
989
+ suffix: "PhD",
990
+ title: "CEO",
991
+ department: "Engineering",
992
+ language: "EN",
993
+ gender: "female",
994
+ birthday: "2000-08-12",
995
+ photoUrl: "https://unavatar.io/elon-musk",
996
+ leadSource: "Cold Call",
997
+ fax: "+12129876543",
998
+ description: "Internal champion",
999
+ currentBalance: 10.5,
1000
+ status: "open",
1001
+ active: true,
1002
+ websites: [
1003
+ {
1004
+ id: "12345",
1005
+ url: "http://example.com",
1006
+ type: "primary",
1007
+ },
1008
+ {
1009
+ id: "12345",
1010
+ url: "http://example.com",
1011
+ type: "primary",
1012
+ },
1013
+ {
1014
+ id: "12345",
1015
+ url: "http://example.com",
1016
+ type: "primary",
1017
+ },
1018
+ ],
1019
+ addresses: [
1020
+ {
1021
+ id: "123",
1022
+ type: "primary",
1023
+ string: "25 Spring Street, Blackburn, VIC 3130",
1024
+ name: "HQ US",
1025
+ line1: "Main street",
1026
+ line2: "apt #",
1027
+ line3: "Suite #",
1028
+ line4: "delivery instructions",
1029
+ streetNumber: "25",
1030
+ city: "San Francisco",
1031
+ state: "CA",
1032
+ postalCode: "94104",
1033
+ country: "US",
1034
+ latitude: "40.759211",
1035
+ longitude: "-73.984638",
1036
+ county: "Santa Clara",
1037
+ contactName: "Elon Musk",
1038
+ salutation: "Mr",
1039
+ phoneNumber: "111-111-1111",
1040
+ fax: "122-111-1111",
1041
+ email: "elon@musk.com",
1042
+ website: "https://elonmusk.com",
1043
+ notes: "Address notes or delivery instructions.",
1044
+ rowVersion: "1-12345",
1045
+ },
1046
+ {
1047
+ id: "123",
1048
+ type: "primary",
1049
+ string: "25 Spring Street, Blackburn, VIC 3130",
1050
+ name: "HQ US",
1051
+ line1: "Main street",
1052
+ line2: "apt #",
1053
+ line3: "Suite #",
1054
+ line4: "delivery instructions",
1055
+ streetNumber: "25",
1056
+ city: "San Francisco",
1057
+ state: "CA",
1058
+ postalCode: "94104",
1059
+ country: "US",
1060
+ latitude: "40.759211",
1061
+ longitude: "-73.984638",
1062
+ county: "Santa Clara",
1063
+ contactName: "Elon Musk",
1064
+ salutation: "Mr",
1065
+ phoneNumber: "111-111-1111",
1066
+ fax: "122-111-1111",
1067
+ email: "elon@musk.com",
1068
+ website: "https://elonmusk.com",
1069
+ notes: "Address notes or delivery instructions.",
1070
+ rowVersion: "1-12345",
1071
+ },
1072
+ ],
1073
+ socialLinks: [
1074
+ {
1075
+ id: "12345",
1076
+ url: "https://www.twitter.com/apideck",
1077
+ type: "twitter",
1078
+ },
1079
+ {
1080
+ id: "12345",
1081
+ url: "https://www.twitter.com/apideck",
1082
+ type: "twitter",
1083
+ },
1084
+ ],
1085
+ phoneNumbers: [
1086
+ {
1087
+ id: "12345",
1088
+ countryCode: "1",
1089
+ areaCode: "323",
1090
+ number: "111-111-1111",
1091
+ extension: "105",
1092
+ type: "primary",
1093
+ },
1094
+ {
1095
+ id: "12345",
1096
+ countryCode: "1",
1097
+ areaCode: "323",
1098
+ number: "111-111-1111",
1099
+ extension: "105",
1100
+ type: "primary",
1101
+ },
1102
+ ],
1103
+ emails: [
1104
+ {
1105
+ id: "123",
1106
+ email: "elon@musk.com",
1107
+ type: "primary",
1108
+ },
1109
+ {
1110
+ id: "123",
1111
+ email: "elon@musk.com",
1112
+ type: "primary",
1113
+ },
1114
+ {
1115
+ id: "123",
1116
+ email: "elon@musk.com",
1117
+ type: "primary",
1118
+ },
1119
+ ],
1120
+ emailDomain: "gmail.com",
1121
+ customFields: [
1122
+ {
1123
+ id: "2389328923893298",
1124
+ name: "employee_level",
1125
+ description: "Employee Level",
1126
+ value: true,
1127
+ },
1128
+ {
1129
+ id: "2389328923893298",
1130
+ name: "employee_level",
1131
+ description: "Employee Level",
1132
+ value: 10,
1133
+ },
1134
+ ],
1135
+ tags: [
1136
+ "New",
1137
+ ],
1138
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
1139
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
1140
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
1141
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
1142
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
1143
+ opportunityIds: [
1144
+ "12345",
1145
+ ],
1146
+ passThrough: [
1147
+ {
1148
+ serviceId: "<id>",
1149
+ extendPaths: [
1150
+ {
1151
+ path: "$.nested.property",
1152
+ value: {
1153
+ "TaxClassificationRef": {
1154
+ "value": "EUC-99990201-V1-00020000",
1155
+ },
1156
+ },
1157
+ },
1158
+ {
1159
+ path: "$.nested.property",
1160
+ value: {
1161
+ "TaxClassificationRef": {
1162
+ "value": "EUC-99990201-V1-00020000",
1163
+ },
1164
+ },
1165
+ },
1166
+ {
1167
+ path: "$.nested.property",
1168
+ value: {
1169
+ "TaxClassificationRef": {
1170
+ "value": "EUC-99990201-V1-00020000",
1171
+ },
1172
+ },
1173
+ },
1174
+ ],
1175
+ },
1176
+ ],
1177
+ },
1178
+ });
1179
+ });
1180
+
1181
+ test("Contacts Crm Contacts Update", async () => {
1182
+ const testHttpClient = createTestHTTPClient("crm.contactsUpdate");
1183
+
1184
+ const apideck = new Apideck({
1185
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1186
+ httpClient: testHttpClient,
1187
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1188
+ });
1189
+
1190
+ const result = await apideck.crm.contacts.update({
1191
+ id: "<id>",
1192
+ consumerId: "test-consumer",
1193
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1194
+ serviceId: "salesforce",
1195
+ contact: {
1196
+ name: "Elon Musk",
1197
+ ownerId: "54321",
1198
+ type: "personal",
1199
+ companyId: "23456",
1200
+ companyName: "23456",
1201
+ leadId: "34567",
1202
+ firstName: "Elon",
1203
+ middleName: "D.",
1204
+ lastName: "Musk",
1205
+ prefix: "Mr.",
1206
+ suffix: "PhD",
1207
+ title: "CEO",
1208
+ department: "Engineering",
1209
+ language: "EN",
1210
+ gender: "female",
1211
+ birthday: "2000-08-12",
1212
+ photoUrl: "https://unavatar.io/elon-musk",
1213
+ leadSource: "Cold Call",
1214
+ fax: "+12129876543",
1215
+ description: "Internal champion",
1216
+ currentBalance: 10.5,
1217
+ status: "open",
1218
+ active: true,
1219
+ websites: [
1220
+ {
1221
+ id: "12345",
1222
+ url: "http://example.com",
1223
+ type: "primary",
1224
+ },
1225
+ {
1226
+ id: "12345",
1227
+ url: "http://example.com",
1228
+ type: "primary",
1229
+ },
1230
+ {
1231
+ id: "12345",
1232
+ url: "http://example.com",
1233
+ type: "primary",
1234
+ },
1235
+ ],
1236
+ addresses: [
1237
+ {
1238
+ id: "123",
1239
+ type: "primary",
1240
+ string: "25 Spring Street, Blackburn, VIC 3130",
1241
+ name: "HQ US",
1242
+ line1: "Main street",
1243
+ line2: "apt #",
1244
+ line3: "Suite #",
1245
+ line4: "delivery instructions",
1246
+ streetNumber: "25",
1247
+ city: "San Francisco",
1248
+ state: "CA",
1249
+ postalCode: "94104",
1250
+ country: "US",
1251
+ latitude: "40.759211",
1252
+ longitude: "-73.984638",
1253
+ county: "Santa Clara",
1254
+ contactName: "Elon Musk",
1255
+ salutation: "Mr",
1256
+ phoneNumber: "111-111-1111",
1257
+ fax: "122-111-1111",
1258
+ email: "elon@musk.com",
1259
+ website: "https://elonmusk.com",
1260
+ notes: "Address notes or delivery instructions.",
1261
+ rowVersion: "1-12345",
1262
+ },
1263
+ {
1264
+ id: "123",
1265
+ type: "primary",
1266
+ string: "25 Spring Street, Blackburn, VIC 3130",
1267
+ name: "HQ US",
1268
+ line1: "Main street",
1269
+ line2: "apt #",
1270
+ line3: "Suite #",
1271
+ line4: "delivery instructions",
1272
+ streetNumber: "25",
1273
+ city: "San Francisco",
1274
+ state: "CA",
1275
+ postalCode: "94104",
1276
+ country: "US",
1277
+ latitude: "40.759211",
1278
+ longitude: "-73.984638",
1279
+ county: "Santa Clara",
1280
+ contactName: "Elon Musk",
1281
+ salutation: "Mr",
1282
+ phoneNumber: "111-111-1111",
1283
+ fax: "122-111-1111",
1284
+ email: "elon@musk.com",
1285
+ website: "https://elonmusk.com",
1286
+ notes: "Address notes or delivery instructions.",
1287
+ rowVersion: "1-12345",
1288
+ },
1289
+ ],
1290
+ socialLinks: [
1291
+ {
1292
+ id: "12345",
1293
+ url: "https://www.twitter.com/apideck",
1294
+ type: "twitter",
1295
+ },
1296
+ {
1297
+ id: "12345",
1298
+ url: "https://www.twitter.com/apideck",
1299
+ type: "twitter",
1300
+ },
1301
+ ],
1302
+ phoneNumbers: [
1303
+ {
1304
+ id: "12345",
1305
+ countryCode: "1",
1306
+ areaCode: "323",
1307
+ number: "111-111-1111",
1308
+ extension: "105",
1309
+ type: "primary",
1310
+ },
1311
+ {
1312
+ id: "12345",
1313
+ countryCode: "1",
1314
+ areaCode: "323",
1315
+ number: "111-111-1111",
1316
+ extension: "105",
1317
+ type: "primary",
1318
+ },
1319
+ {
1320
+ id: "12345",
1321
+ countryCode: "1",
1322
+ areaCode: "323",
1323
+ number: "111-111-1111",
1324
+ extension: "105",
1325
+ type: "primary",
1326
+ },
1327
+ ],
1328
+ emails: [
1329
+ {
1330
+ id: "123",
1331
+ email: "elon@musk.com",
1332
+ type: "primary",
1333
+ },
1334
+ {
1335
+ id: "123",
1336
+ email: "elon@musk.com",
1337
+ type: "primary",
1338
+ },
1339
+ ],
1340
+ emailDomain: "gmail.com",
1341
+ customFields: [
1342
+ {
1343
+ id: "2389328923893298",
1344
+ name: "employee_level",
1345
+ description: "Employee Level",
1346
+ value: {},
1347
+ },
1348
+ {
1349
+ id: "2389328923893298",
1350
+ name: "employee_level",
1351
+ description: "Employee Level",
1352
+ value: {
1353
+ "0": {},
1354
+ },
1355
+ },
1356
+ ],
1357
+ tags: [
1358
+ "New",
1359
+ ],
1360
+ opportunityIds: [
1361
+ "12345",
1362
+ ],
1363
+ passThrough: [
1364
+ {
1365
+ serviceId: "<id>",
1366
+ extendPaths: [
1367
+ {
1368
+ path: "$.nested.property",
1369
+ value: {
1370
+ "TaxClassificationRef": {
1371
+ "value": "EUC-99990201-V1-00020000",
1372
+ },
1373
+ },
1374
+ },
1375
+ ],
1376
+ },
1377
+ ],
1378
+ },
1379
+ });
1380
+ expect(result.httpMeta.response.status).toBe(200);
1381
+ expect(result.updateContactResponse).toBeDefined();
1382
+ expect(result.updateContactResponse).toEqual({
1383
+ statusCode: 200,
1384
+ status: "OK",
1385
+ service: "zoho-crm",
1386
+ resource: "contacts",
1387
+ operation: "update",
1388
+ data: {
1389
+ id: "12345",
1390
+ },
1391
+ });
1392
+ });
1393
+
1394
+ test("Contacts Crm Contacts Delete", async () => {
1395
+ const testHttpClient = createTestHTTPClient("crm.contactsDelete");
1396
+
1397
+ const apideck = new Apideck({
1398
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1399
+ httpClient: testHttpClient,
1400
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1401
+ });
1402
+
1403
+ const result = await apideck.crm.contacts.delete({
1404
+ id: "<id>",
1405
+ consumerId: "test-consumer",
1406
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1407
+ serviceId: "salesforce",
1408
+ });
1409
+ expect(result.httpMeta.response.status).toBe(200);
1410
+ expect(result.deleteContactResponse).toBeDefined();
1411
+ expect(result.deleteContactResponse).toEqual({
1412
+ statusCode: 200,
1413
+ status: "OK",
1414
+ service: "zoho-crm",
1415
+ resource: "contacts",
1416
+ operation: "delete",
1417
+ data: {
1418
+ id: "12345",
1419
+ },
1420
+ });
1421
+ });