@apideck/unify 0.23.0 → 0.23.1

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 (93) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/note.d.ts +5 -0
  5. package/models/components/note.d.ts.map +1 -1
  6. package/models/components/note.js +4 -0
  7. package/models/components/note.js.map +1 -1
  8. package/models/components/noteinput.d.ts +5 -0
  9. package/models/components/noteinput.d.ts.map +1 -1
  10. package/models/components/noteinput.js +4 -0
  11. package/models/components/noteinput.js.map +1 -1
  12. package/package.json +5 -1
  13. package/src/__tests__/activities.test.ts +783 -0
  14. package/src/__tests__/agedcreditors.test.ts +279 -0
  15. package/src/__tests__/ageddebtors.test.ts +279 -0
  16. package/src/__tests__/apideckcompanies.test.ts +712 -0
  17. package/src/__tests__/apideckcustomers.test.ts +360 -0
  18. package/src/__tests__/apideckdepartments.test.ts +319 -0
  19. package/src/__tests__/apiresources.test.ts +61 -0
  20. package/src/__tests__/apis.test.ts +214 -0
  21. package/src/__tests__/applicants.test.ts +976 -0
  22. package/src/__tests__/applications.test.ts +329 -0
  23. package/src/__tests__/assertions.ts +13 -0
  24. package/src/__tests__/attachments.test.ts +363 -0
  25. package/src/__tests__/balancesheet.test.ts +451 -0
  26. package/src/__tests__/billpayments.test.ts +666 -0
  27. package/src/__tests__/bills.test.ts +1133 -0
  28. package/src/__tests__/collections.test.ts +115 -0
  29. package/src/__tests__/collectiontags.test.ts +66 -0
  30. package/src/__tests__/collectionticketcomments.test.ts +318 -0
  31. package/src/__tests__/collectiontickets.test.ts +436 -0
  32. package/src/__tests__/collectionusers.test.ts +122 -0
  33. package/src/__tests__/companies.test.ts +1059 -0
  34. package/src/__tests__/companyinfo.test.ts +218 -0
  35. package/src/__tests__/connectioncustommappings.test.ts +67 -0
  36. package/src/__tests__/connections.test.ts +1713 -0
  37. package/src/__tests__/connectionsettings.test.ts +280 -0
  38. package/src/__tests__/connectordocs.test.ts +28 -0
  39. package/src/__tests__/connectors.test.ts +751 -0
  40. package/src/__tests__/consumerrequestcounts.test.ts +41 -0
  41. package/src/__tests__/consumers.test.ts +517 -0
  42. package/src/__tests__/contacts.test.ts +957 -0
  43. package/src/__tests__/createcallback.test.ts +34 -0
  44. package/src/__tests__/creditnotes.test.ts +1362 -0
  45. package/src/__tests__/customers.test.ts +1089 -0
  46. package/src/__tests__/customfields.test.ts +50 -0
  47. package/src/__tests__/custommappings.test.ts +63 -0
  48. package/src/__tests__/departments.test.ts +359 -0
  49. package/src/__tests__/drivegroups.test.ts +318 -0
  50. package/src/__tests__/drives.test.ts +311 -0
  51. package/src/__tests__/employeepayrolls.test.ts +487 -0
  52. package/src/__tests__/employees.test.ts +1682 -0
  53. package/src/__tests__/employeeschedules.test.ts +456 -0
  54. package/src/__tests__/eventlogs.test.ts +157 -0
  55. package/src/__tests__/expenses.test.ts +566 -0
  56. package/src/__tests__/files.test.ts +392 -0
  57. package/src/__tests__/files.ts +56 -0
  58. package/src/__tests__/folders.test.ts +103 -0
  59. package/src/__tests__/invoiceitems.test.ts +586 -0
  60. package/src/__tests__/invoices.test.ts +1561 -0
  61. package/src/__tests__/jobs.test.ts +837 -0
  62. package/src/__tests__/journalentries.test.ts +1053 -0
  63. package/src/__tests__/leads.test.ts +897 -0
  64. package/src/__tests__/ledgeraccounts.test.ts +594 -0
  65. package/src/__tests__/locations.test.ts +561 -0
  66. package/src/__tests__/logs.test.ts +135 -0
  67. package/src/__tests__/messages.test.ts +396 -0
  68. package/src/__tests__/mockserver/README.md +52 -0
  69. package/src/__tests__/notes.test.ts +335 -0
  70. package/src/__tests__/opportunities.test.ts +503 -0
  71. package/src/__tests__/orders.test.ts +849 -0
  72. package/src/__tests__/payments.test.ts +557 -0
  73. package/src/__tests__/payrolls.test.ts +481 -0
  74. package/src/__tests__/pipelines.test.ts +383 -0
  75. package/src/__tests__/products.test.ts +505 -0
  76. package/src/__tests__/profitandloss.test.ts +221 -0
  77. package/src/__tests__/purchaseorders.test.ts +1464 -0
  78. package/src/__tests__/sessions.test.ts +70 -0
  79. package/src/__tests__/sharedlinks.test.ts +331 -0
  80. package/src/__tests__/stores.test.ts +39 -0
  81. package/src/__tests__/subsidiaries.test.ts +316 -0
  82. package/src/__tests__/suppliers.test.ts +1071 -0
  83. package/src/__tests__/taxrates.test.ts +472 -0
  84. package/src/__tests__/testclient.ts +48 -0
  85. package/src/__tests__/timeoffrequests.test.ts +381 -0
  86. package/src/__tests__/trackingcategories.test.ts +329 -0
  87. package/src/__tests__/uploadsessions.test.ts +142 -0
  88. package/src/__tests__/users.test.ts +667 -0
  89. package/src/__tests__/validateconnection.test.ts +32 -0
  90. package/src/__tests__/webhooks.test.ts +248 -0
  91. package/src/lib/config.ts +3 -3
  92. package/src/models/components/note.ts +9 -0
  93. package/src/models/components/noteinput.ts +9 -0
@@ -0,0 +1,957 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { assert, expect, it, 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
+ serviceId: "salesforce",
20
+ filter: {
21
+ firstName: "Elon",
22
+ lastName: "Musk",
23
+ email: "elon@tesla.com",
24
+ companyId: "12345",
25
+ ownerId: "12345",
26
+ },
27
+ sort: {
28
+ by: "created_at",
29
+ },
30
+ passThrough: {
31
+ "search": "San Francisco",
32
+ },
33
+ fields: "id,updated_at",
34
+ });
35
+ expect(result.httpMeta.response.status).toBe(200);
36
+ expect(result.getContactsResponse).toBeDefined();
37
+ expect(result.getContactsResponse).toEqual({
38
+ statusCode: 200,
39
+ status: "OK",
40
+ service: "zoho-crm",
41
+ resource: "contacts",
42
+ operation: "all",
43
+ data: [
44
+ {
45
+ id: "12345",
46
+ name: "Elon Musk",
47
+ ownerId: "54321",
48
+ type: "personal",
49
+ companyId: "23456",
50
+ companyName: "23456",
51
+ leadId: "34567",
52
+ firstName: "Elon",
53
+ middleName: "D.",
54
+ lastName: "Musk",
55
+ prefix: "Mr.",
56
+ suffix: "PhD",
57
+ title: "CEO",
58
+ department: "Engineering",
59
+ language: "EN",
60
+ gender: "female",
61
+ birthday: "2000-08-12",
62
+ photoUrl: "https://unavatar.io/elon-musk",
63
+ leadSource: "Cold Call",
64
+ fax: "+12129876543",
65
+ description: "Internal champion",
66
+ currentBalance: 10.5,
67
+ status: "open",
68
+ active: true,
69
+ websites: [
70
+ {
71
+ id: "12345",
72
+ url: "http://example.com",
73
+ type: "primary",
74
+ },
75
+ {
76
+ id: "12345",
77
+ url: "http://example.com",
78
+ type: "primary",
79
+ },
80
+ ],
81
+ addresses: [
82
+ {
83
+ id: "123",
84
+ type: "primary",
85
+ string: "25 Spring Street, Blackburn, VIC 3130",
86
+ name: "HQ US",
87
+ line1: "Main street",
88
+ line2: "apt #",
89
+ line3: "Suite #",
90
+ line4: "delivery instructions",
91
+ streetNumber: "25",
92
+ city: "San Francisco",
93
+ state: "CA",
94
+ postalCode: "94104",
95
+ country: "US",
96
+ latitude: "40.759211",
97
+ longitude: "-73.984638",
98
+ county: "Santa Clara",
99
+ contactName: "Elon Musk",
100
+ salutation: "Mr",
101
+ phoneNumber: "111-111-1111",
102
+ fax: "122-111-1111",
103
+ email: "elon@musk.com",
104
+ website: "https://elonmusk.com",
105
+ notes: "Address notes or delivery instructions.",
106
+ rowVersion: "1-12345",
107
+ },
108
+ {
109
+ id: "123",
110
+ type: "primary",
111
+ string: "25 Spring Street, Blackburn, VIC 3130",
112
+ name: "HQ US",
113
+ line1: "Main street",
114
+ line2: "apt #",
115
+ line3: "Suite #",
116
+ line4: "delivery instructions",
117
+ streetNumber: "25",
118
+ city: "San Francisco",
119
+ state: "CA",
120
+ postalCode: "94104",
121
+ country: "US",
122
+ latitude: "40.759211",
123
+ longitude: "-73.984638",
124
+ county: "Santa Clara",
125
+ contactName: "Elon Musk",
126
+ salutation: "Mr",
127
+ phoneNumber: "111-111-1111",
128
+ fax: "122-111-1111",
129
+ email: "elon@musk.com",
130
+ website: "https://elonmusk.com",
131
+ notes: "Address notes or delivery instructions.",
132
+ rowVersion: "1-12345",
133
+ },
134
+ {
135
+ id: "123",
136
+ type: "primary",
137
+ string: "25 Spring Street, Blackburn, VIC 3130",
138
+ name: "HQ US",
139
+ line1: "Main street",
140
+ line2: "apt #",
141
+ line3: "Suite #",
142
+ line4: "delivery instructions",
143
+ streetNumber: "25",
144
+ city: "San Francisco",
145
+ state: "CA",
146
+ postalCode: "94104",
147
+ country: "US",
148
+ latitude: "40.759211",
149
+ longitude: "-73.984638",
150
+ county: "Santa Clara",
151
+ contactName: "Elon Musk",
152
+ salutation: "Mr",
153
+ phoneNumber: "111-111-1111",
154
+ fax: "122-111-1111",
155
+ email: "elon@musk.com",
156
+ website: "https://elonmusk.com",
157
+ notes: "Address notes or delivery instructions.",
158
+ rowVersion: "1-12345",
159
+ },
160
+ ],
161
+ socialLinks: [
162
+ {
163
+ id: "12345",
164
+ url: "https://www.twitter.com/apideck",
165
+ type: "twitter",
166
+ },
167
+ ],
168
+ phoneNumbers: [
169
+ {
170
+ id: "12345",
171
+ countryCode: "1",
172
+ areaCode: "323",
173
+ number: "111-111-1111",
174
+ extension: "105",
175
+ type: "primary",
176
+ },
177
+ ],
178
+ emails: [
179
+ {
180
+ id: "123",
181
+ email: "elon@musk.com",
182
+ type: "primary",
183
+ },
184
+ ],
185
+ emailDomain: "gmail.com",
186
+ customFields: [
187
+ {
188
+ id: "2389328923893298",
189
+ name: "employee_level",
190
+ description: "Employee Level",
191
+ value: {},
192
+ },
193
+ {
194
+ id: "2389328923893298",
195
+ name: "employee_level",
196
+ description: "Employee Level",
197
+ value: "Uses Salesforce and Marketo",
198
+ },
199
+ ],
200
+ tags: [
201
+ "New",
202
+ ],
203
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
204
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
205
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
206
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
207
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
208
+ opportunityIds: [
209
+ "12345",
210
+ ],
211
+ passThrough: [
212
+ {
213
+ serviceId: "<id>",
214
+ extendPaths: [
215
+ {
216
+ path: "$.nested.property",
217
+ value: {
218
+ "TaxClassificationRef": {
219
+ "value": "EUC-99990201-V1-00020000",
220
+ },
221
+ },
222
+ },
223
+ ],
224
+ },
225
+ {
226
+ serviceId: "<id>",
227
+ extendPaths: [
228
+ {
229
+ path: "$.nested.property",
230
+ value: {
231
+ "TaxClassificationRef": {
232
+ "value": "EUC-99990201-V1-00020000",
233
+ },
234
+ },
235
+ },
236
+ ],
237
+ },
238
+ {
239
+ serviceId: "<id>",
240
+ extendPaths: [
241
+ {
242
+ path: "$.nested.property",
243
+ value: {
244
+ "TaxClassificationRef": {
245
+ "value": "EUC-99990201-V1-00020000",
246
+ },
247
+ },
248
+ },
249
+ {
250
+ path: "$.nested.property",
251
+ value: {
252
+ "TaxClassificationRef": {
253
+ "value": "EUC-99990201-V1-00020000",
254
+ },
255
+ },
256
+ },
257
+ {
258
+ path: "$.nested.property",
259
+ value: {
260
+ "TaxClassificationRef": {
261
+ "value": "EUC-99990201-V1-00020000",
262
+ },
263
+ },
264
+ },
265
+ ],
266
+ },
267
+ ],
268
+ },
269
+ {
270
+ id: "12345",
271
+ name: "Elon Musk",
272
+ ownerId: "54321",
273
+ type: "personal",
274
+ companyId: "23456",
275
+ companyName: "23456",
276
+ leadId: "34567",
277
+ firstName: "Elon",
278
+ middleName: "D.",
279
+ lastName: "Musk",
280
+ prefix: "Mr.",
281
+ suffix: "PhD",
282
+ title: "CEO",
283
+ department: "Engineering",
284
+ language: "EN",
285
+ gender: "female",
286
+ birthday: "2000-08-12",
287
+ photoUrl: "https://unavatar.io/elon-musk",
288
+ leadSource: "Cold Call",
289
+ fax: "+12129876543",
290
+ description: "Internal champion",
291
+ currentBalance: 10.5,
292
+ status: "open",
293
+ active: true,
294
+ websites: [
295
+ {
296
+ id: "12345",
297
+ url: "http://example.com",
298
+ type: "primary",
299
+ },
300
+ {
301
+ id: "12345",
302
+ url: "http://example.com",
303
+ type: "primary",
304
+ },
305
+ ],
306
+ addresses: [
307
+ {
308
+ id: "123",
309
+ type: "primary",
310
+ string: "25 Spring Street, Blackburn, VIC 3130",
311
+ name: "HQ US",
312
+ line1: "Main street",
313
+ line2: "apt #",
314
+ line3: "Suite #",
315
+ line4: "delivery instructions",
316
+ streetNumber: "25",
317
+ city: "San Francisco",
318
+ state: "CA",
319
+ postalCode: "94104",
320
+ country: "US",
321
+ latitude: "40.759211",
322
+ longitude: "-73.984638",
323
+ county: "Santa Clara",
324
+ contactName: "Elon Musk",
325
+ salutation: "Mr",
326
+ phoneNumber: "111-111-1111",
327
+ fax: "122-111-1111",
328
+ email: "elon@musk.com",
329
+ website: "https://elonmusk.com",
330
+ notes: "Address notes or delivery instructions.",
331
+ rowVersion: "1-12345",
332
+ },
333
+ {
334
+ id: "123",
335
+ type: "primary",
336
+ string: "25 Spring Street, Blackburn, VIC 3130",
337
+ name: "HQ US",
338
+ line1: "Main street",
339
+ line2: "apt #",
340
+ line3: "Suite #",
341
+ line4: "delivery instructions",
342
+ streetNumber: "25",
343
+ city: "San Francisco",
344
+ state: "CA",
345
+ postalCode: "94104",
346
+ country: "US",
347
+ latitude: "40.759211",
348
+ longitude: "-73.984638",
349
+ county: "Santa Clara",
350
+ contactName: "Elon Musk",
351
+ salutation: "Mr",
352
+ phoneNumber: "111-111-1111",
353
+ fax: "122-111-1111",
354
+ email: "elon@musk.com",
355
+ website: "https://elonmusk.com",
356
+ notes: "Address notes or delivery instructions.",
357
+ rowVersion: "1-12345",
358
+ },
359
+ ],
360
+ socialLinks: [
361
+ {
362
+ id: "12345",
363
+ url: "https://www.twitter.com/apideck",
364
+ type: "twitter",
365
+ },
366
+ ],
367
+ phoneNumbers: [
368
+ {
369
+ id: "12345",
370
+ countryCode: "1",
371
+ areaCode: "323",
372
+ number: "111-111-1111",
373
+ extension: "105",
374
+ type: "primary",
375
+ },
376
+ ],
377
+ emails: [
378
+ {
379
+ id: "123",
380
+ email: "elon@musk.com",
381
+ type: "primary",
382
+ },
383
+ {
384
+ id: "123",
385
+ email: "elon@musk.com",
386
+ type: "primary",
387
+ },
388
+ ],
389
+ emailDomain: "gmail.com",
390
+ customFields: [
391
+ {
392
+ id: "2389328923893298",
393
+ name: "employee_level",
394
+ description: "Employee Level",
395
+ value: "Uses Salesforce and Marketo",
396
+ },
397
+ {
398
+ id: "2389328923893298",
399
+ name: "employee_level",
400
+ description: "Employee Level",
401
+ value: [
402
+ {},
403
+ {},
404
+ ],
405
+ },
406
+ ],
407
+ tags: [
408
+ "New",
409
+ ],
410
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
411
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
412
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
413
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
414
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
415
+ opportunityIds: [
416
+ "12345",
417
+ ],
418
+ passThrough: [
419
+ {
420
+ serviceId: "<id>",
421
+ extendPaths: [
422
+ {
423
+ path: "$.nested.property",
424
+ value: {
425
+ "TaxClassificationRef": {
426
+ "value": "EUC-99990201-V1-00020000",
427
+ },
428
+ },
429
+ },
430
+ {
431
+ path: "$.nested.property",
432
+ value: {
433
+ "TaxClassificationRef": {
434
+ "value": "EUC-99990201-V1-00020000",
435
+ },
436
+ },
437
+ },
438
+ ],
439
+ },
440
+ {
441
+ serviceId: "<id>",
442
+ extendPaths: [
443
+ {
444
+ path: "$.nested.property",
445
+ value: {
446
+ "TaxClassificationRef": {
447
+ "value": "EUC-99990201-V1-00020000",
448
+ },
449
+ },
450
+ },
451
+ ],
452
+ },
453
+ {
454
+ serviceId: "<id>",
455
+ extendPaths: [
456
+ {
457
+ path: "$.nested.property",
458
+ value: {
459
+ "TaxClassificationRef": {
460
+ "value": "EUC-99990201-V1-00020000",
461
+ },
462
+ },
463
+ },
464
+ ],
465
+ },
466
+ ],
467
+ },
468
+ {
469
+ id: "12345",
470
+ name: "Elon Musk",
471
+ ownerId: "54321",
472
+ type: "personal",
473
+ companyId: "23456",
474
+ companyName: "23456",
475
+ leadId: "34567",
476
+ firstName: "Elon",
477
+ middleName: "D.",
478
+ lastName: "Musk",
479
+ prefix: "Mr.",
480
+ suffix: "PhD",
481
+ title: "CEO",
482
+ department: "Engineering",
483
+ language: "EN",
484
+ gender: "female",
485
+ birthday: "2000-08-12",
486
+ photoUrl: "https://unavatar.io/elon-musk",
487
+ leadSource: "Cold Call",
488
+ fax: "+12129876543",
489
+ description: "Internal champion",
490
+ currentBalance: 10.5,
491
+ status: "open",
492
+ active: true,
493
+ websites: [
494
+ {
495
+ id: "12345",
496
+ url: "http://example.com",
497
+ type: "primary",
498
+ },
499
+ {
500
+ id: "12345",
501
+ url: "http://example.com",
502
+ type: "primary",
503
+ },
504
+ {
505
+ id: "12345",
506
+ url: "http://example.com",
507
+ type: "primary",
508
+ },
509
+ ],
510
+ addresses: [
511
+ {
512
+ id: "123",
513
+ type: "primary",
514
+ string: "25 Spring Street, Blackburn, VIC 3130",
515
+ name: "HQ US",
516
+ line1: "Main street",
517
+ line2: "apt #",
518
+ line3: "Suite #",
519
+ line4: "delivery instructions",
520
+ streetNumber: "25",
521
+ city: "San Francisco",
522
+ state: "CA",
523
+ postalCode: "94104",
524
+ country: "US",
525
+ latitude: "40.759211",
526
+ longitude: "-73.984638",
527
+ county: "Santa Clara",
528
+ contactName: "Elon Musk",
529
+ salutation: "Mr",
530
+ phoneNumber: "111-111-1111",
531
+ fax: "122-111-1111",
532
+ email: "elon@musk.com",
533
+ website: "https://elonmusk.com",
534
+ notes: "Address notes or delivery instructions.",
535
+ rowVersion: "1-12345",
536
+ },
537
+ ],
538
+ socialLinks: [
539
+ {
540
+ id: "12345",
541
+ url: "https://www.twitter.com/apideck",
542
+ type: "twitter",
543
+ },
544
+ {
545
+ id: "12345",
546
+ url: "https://www.twitter.com/apideck",
547
+ type: "twitter",
548
+ },
549
+ {
550
+ id: "12345",
551
+ url: "https://www.twitter.com/apideck",
552
+ type: "twitter",
553
+ },
554
+ ],
555
+ phoneNumbers: [
556
+ {
557
+ id: "12345",
558
+ countryCode: "1",
559
+ areaCode: "323",
560
+ number: "111-111-1111",
561
+ extension: "105",
562
+ type: "primary",
563
+ },
564
+ {
565
+ id: "12345",
566
+ countryCode: "1",
567
+ areaCode: "323",
568
+ number: "111-111-1111",
569
+ extension: "105",
570
+ type: "primary",
571
+ },
572
+ ],
573
+ emails: [
574
+ {
575
+ id: "123",
576
+ email: "elon@musk.com",
577
+ type: "primary",
578
+ },
579
+ {
580
+ id: "123",
581
+ email: "elon@musk.com",
582
+ type: "primary",
583
+ },
584
+ {
585
+ id: "123",
586
+ email: "elon@musk.com",
587
+ type: "primary",
588
+ },
589
+ ],
590
+ emailDomain: "gmail.com",
591
+ customFields: [
592
+ {
593
+ id: "2389328923893298",
594
+ name: "employee_level",
595
+ description: "Employee Level",
596
+ value: "Uses Salesforce and Marketo",
597
+ },
598
+ ],
599
+ tags: [
600
+ "New",
601
+ ],
602
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
603
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
604
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
605
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
606
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
607
+ opportunityIds: [
608
+ "12345",
609
+ ],
610
+ passThrough: [
611
+ {
612
+ serviceId: "<id>",
613
+ extendPaths: [
614
+ {
615
+ path: "$.nested.property",
616
+ value: {
617
+ "TaxClassificationRef": {
618
+ "value": "EUC-99990201-V1-00020000",
619
+ },
620
+ },
621
+ },
622
+ ],
623
+ },
624
+ {
625
+ serviceId: "<id>",
626
+ extendPaths: [
627
+ {
628
+ path: "$.nested.property",
629
+ value: {
630
+ "TaxClassificationRef": {
631
+ "value": "EUC-99990201-V1-00020000",
632
+ },
633
+ },
634
+ },
635
+ {
636
+ path: "$.nested.property",
637
+ value: {
638
+ "TaxClassificationRef": {
639
+ "value": "EUC-99990201-V1-00020000",
640
+ },
641
+ },
642
+ },
643
+ ],
644
+ },
645
+ {
646
+ serviceId: "<id>",
647
+ extendPaths: [
648
+ {
649
+ path: "$.nested.property",
650
+ value: {
651
+ "TaxClassificationRef": {
652
+ "value": "EUC-99990201-V1-00020000",
653
+ },
654
+ },
655
+ },
656
+ {
657
+ path: "$.nested.property",
658
+ value: {
659
+ "TaxClassificationRef": {
660
+ "value": "EUC-99990201-V1-00020000",
661
+ },
662
+ },
663
+ },
664
+ ],
665
+ },
666
+ ],
667
+ },
668
+ ],
669
+ meta: {
670
+ itemsOnPage: 50,
671
+ cursors: {
672
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
673
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
674
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
675
+ },
676
+ },
677
+ links: {
678
+ previous:
679
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
680
+ current: "https://unify.apideck.com/crm/companies",
681
+ next:
682
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
683
+ },
684
+ });
685
+ });
686
+
687
+ it.skip("Contacts Crm Contacts Add", async () => {
688
+ assert.fail(
689
+ "incomplete test found please make sure to address the following errors: [`workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`, `workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`, `workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`, `workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`, `workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`, `workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`, `workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`, `workflow step crm.contactsAdd.test referencing operation crm.contactsAdd with expression in requestBody with type not currently supported`]",
690
+ );
691
+ });
692
+
693
+ test("Contacts Crm Contacts One", async () => {
694
+ const testHttpClient = createTestHTTPClient("crm.contactsOne");
695
+
696
+ const apideck = new Apideck({
697
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
698
+ httpClient: testHttpClient,
699
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
700
+ });
701
+
702
+ const result = await apideck.crm.contacts.get({
703
+ id: "<id>",
704
+ serviceId: "salesforce",
705
+ fields: "id,updated_at",
706
+ filter: {
707
+ firstName: "Elon",
708
+ lastName: "Musk",
709
+ email: "elon@tesla.com",
710
+ companyId: "12345",
711
+ ownerId: "12345",
712
+ },
713
+ });
714
+ expect(result.httpMeta.response.status).toBe(200);
715
+ expect(result.getContactResponse).toBeDefined();
716
+ expect(result.getContactResponse).toEqual({
717
+ statusCode: 200,
718
+ status: "OK",
719
+ service: "zoho-crm",
720
+ resource: "companies",
721
+ operation: "one",
722
+ data: {
723
+ id: "12345",
724
+ name: "Elon Musk",
725
+ ownerId: "54321",
726
+ type: "personal",
727
+ companyId: "23456",
728
+ companyName: "23456",
729
+ leadId: "34567",
730
+ firstName: "Elon",
731
+ middleName: "D.",
732
+ lastName: "Musk",
733
+ prefix: "Mr.",
734
+ suffix: "PhD",
735
+ title: "CEO",
736
+ department: "Engineering",
737
+ language: "EN",
738
+ gender: "female",
739
+ birthday: "2000-08-12",
740
+ photoUrl: "https://unavatar.io/elon-musk",
741
+ leadSource: "Cold Call",
742
+ fax: "+12129876543",
743
+ description: "Internal champion",
744
+ currentBalance: 10.5,
745
+ status: "open",
746
+ active: true,
747
+ websites: [
748
+ {
749
+ id: "12345",
750
+ url: "http://example.com",
751
+ type: "primary",
752
+ },
753
+ {
754
+ id: "12345",
755
+ url: "http://example.com",
756
+ type: "primary",
757
+ },
758
+ {
759
+ id: "12345",
760
+ url: "http://example.com",
761
+ type: "primary",
762
+ },
763
+ ],
764
+ addresses: [
765
+ {
766
+ id: "123",
767
+ type: "primary",
768
+ string: "25 Spring Street, Blackburn, VIC 3130",
769
+ name: "HQ US",
770
+ line1: "Main street",
771
+ line2: "apt #",
772
+ line3: "Suite #",
773
+ line4: "delivery instructions",
774
+ streetNumber: "25",
775
+ city: "San Francisco",
776
+ state: "CA",
777
+ postalCode: "94104",
778
+ country: "US",
779
+ latitude: "40.759211",
780
+ longitude: "-73.984638",
781
+ county: "Santa Clara",
782
+ contactName: "Elon Musk",
783
+ salutation: "Mr",
784
+ phoneNumber: "111-111-1111",
785
+ fax: "122-111-1111",
786
+ email: "elon@musk.com",
787
+ website: "https://elonmusk.com",
788
+ notes: "Address notes or delivery instructions.",
789
+ rowVersion: "1-12345",
790
+ },
791
+ {
792
+ id: "123",
793
+ type: "primary",
794
+ string: "25 Spring Street, Blackburn, VIC 3130",
795
+ name: "HQ US",
796
+ line1: "Main street",
797
+ line2: "apt #",
798
+ line3: "Suite #",
799
+ line4: "delivery instructions",
800
+ streetNumber: "25",
801
+ city: "San Francisco",
802
+ state: "CA",
803
+ postalCode: "94104",
804
+ country: "US",
805
+ latitude: "40.759211",
806
+ longitude: "-73.984638",
807
+ county: "Santa Clara",
808
+ contactName: "Elon Musk",
809
+ salutation: "Mr",
810
+ phoneNumber: "111-111-1111",
811
+ fax: "122-111-1111",
812
+ email: "elon@musk.com",
813
+ website: "https://elonmusk.com",
814
+ notes: "Address notes or delivery instructions.",
815
+ rowVersion: "1-12345",
816
+ },
817
+ ],
818
+ socialLinks: [
819
+ {
820
+ id: "12345",
821
+ url: "https://www.twitter.com/apideck",
822
+ type: "twitter",
823
+ },
824
+ {
825
+ id: "12345",
826
+ url: "https://www.twitter.com/apideck",
827
+ type: "twitter",
828
+ },
829
+ ],
830
+ phoneNumbers: [
831
+ {
832
+ id: "12345",
833
+ countryCode: "1",
834
+ areaCode: "323",
835
+ number: "111-111-1111",
836
+ extension: "105",
837
+ type: "primary",
838
+ },
839
+ {
840
+ id: "12345",
841
+ countryCode: "1",
842
+ areaCode: "323",
843
+ number: "111-111-1111",
844
+ extension: "105",
845
+ type: "primary",
846
+ },
847
+ ],
848
+ emails: [
849
+ {
850
+ id: "123",
851
+ email: "elon@musk.com",
852
+ type: "primary",
853
+ },
854
+ {
855
+ id: "123",
856
+ email: "elon@musk.com",
857
+ type: "primary",
858
+ },
859
+ {
860
+ id: "123",
861
+ email: "elon@musk.com",
862
+ type: "primary",
863
+ },
864
+ ],
865
+ emailDomain: "gmail.com",
866
+ customFields: [
867
+ {
868
+ id: "2389328923893298",
869
+ name: "employee_level",
870
+ description: "Employee Level",
871
+ value: true,
872
+ },
873
+ {
874
+ id: "2389328923893298",
875
+ name: "employee_level",
876
+ description: "Employee Level",
877
+ value: 10,
878
+ },
879
+ ],
880
+ tags: [
881
+ "New",
882
+ ],
883
+ firstCallAt: new Date("2020-09-30T07:43:32.000Z"),
884
+ firstEmailAt: new Date("2020-09-30T07:43:32.000Z"),
885
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
886
+ updatedAt: new Date("2017-08-12T20:43:21.291Z"),
887
+ createdAt: new Date("2017-08-12T20:43:21.291Z"),
888
+ opportunityIds: [
889
+ "12345",
890
+ ],
891
+ passThrough: [
892
+ {
893
+ serviceId: "<id>",
894
+ extendPaths: [
895
+ {
896
+ path: "$.nested.property",
897
+ value: {
898
+ "TaxClassificationRef": {
899
+ "value": "EUC-99990201-V1-00020000",
900
+ },
901
+ },
902
+ },
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
+ },
921
+ ],
922
+ },
923
+ });
924
+ });
925
+
926
+ it.skip("Contacts Crm Contacts Update", async () => {
927
+ assert.fail(
928
+ "incomplete test found please make sure to address the following errors: [`workflow step crm.contactsUpdate.test referencing operation crm.contactsUpdate with expression in requestBody with type not currently supported`]",
929
+ );
930
+ });
931
+
932
+ test("Contacts Crm Contacts Delete", async () => {
933
+ const testHttpClient = createTestHTTPClient("crm.contactsDelete");
934
+
935
+ const apideck = new Apideck({
936
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
937
+ httpClient: testHttpClient,
938
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
939
+ });
940
+
941
+ const result = await apideck.crm.contacts.delete({
942
+ id: "<id>",
943
+ serviceId: "salesforce",
944
+ });
945
+ expect(result.httpMeta.response.status).toBe(200);
946
+ expect(result.deleteContactResponse).toBeDefined();
947
+ expect(result.deleteContactResponse).toEqual({
948
+ statusCode: 200,
949
+ status: "OK",
950
+ service: "zoho-crm",
951
+ resource: "contacts",
952
+ operation: "delete",
953
+ data: {
954
+ id: "12345",
955
+ },
956
+ });
957
+ });