@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,1642 @@
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("Companies Crm Companies All", async () => {
10
+ const testHttpClient = createTestHTTPClient("crm.companiesAll");
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.companies.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ filter: {
23
+ name: "SpaceX",
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.getCompaniesResponse1).toBeDefined();
36
+ expect(result.getCompaniesResponse1).toEqual({
37
+ statusCode: 200,
38
+ status: "OK",
39
+ service: "zoho-crm",
40
+ resource: "companies",
41
+ operation: "all",
42
+ data: [
43
+ {
44
+ id: "12345",
45
+ name: "SpaceX",
46
+ interactionCount: 1,
47
+ ownerId: "12345",
48
+ image: "https://www.spacex.com/static/images/share.jpg",
49
+ description:
50
+ "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.",
51
+ vatNumber: "BE0689615164",
52
+ currency: "USD",
53
+ status: "Open",
54
+ fax: "+12129876543",
55
+ annualRevenue: "+$35m",
56
+ numberOfEmployees: "500-1000",
57
+ industry: "Apparel",
58
+ ownership: "Public",
59
+ salesTaxNumber: "12456EN",
60
+ payeeNumber: "78932EN",
61
+ abnOrTfn: "46 115 614 695",
62
+ abnBranch: "123",
63
+ acn: "XXX XXX XXX",
64
+ firstName: "Elon",
65
+ lastName: "Musk",
66
+ parentId: "22345",
67
+ bankAccounts: [
68
+ {
69
+ bankName: "Monzo",
70
+ accountNumber: "123465",
71
+ accountName: "SPACEX LLC",
72
+ accountType: "credit_card",
73
+ iban: "CH2989144532982975332",
74
+ bic: "AUDSCHGGXXX",
75
+ routingNumber: "012345678",
76
+ bsbNumber: "062-001",
77
+ branchIdentifier: "001",
78
+ bankCode: "BNH",
79
+ currency: "USD",
80
+ },
81
+ {
82
+ bankName: "Monzo",
83
+ accountNumber: "123465",
84
+ accountName: "SPACEX LLC",
85
+ accountType: "credit_card",
86
+ iban: "CH2989144532982975332",
87
+ bic: "AUDSCHGGXXX",
88
+ routingNumber: "012345678",
89
+ bsbNumber: "062-001",
90
+ branchIdentifier: "001",
91
+ bankCode: "BNH",
92
+ currency: "USD",
93
+ },
94
+ ],
95
+ websites: [
96
+ {
97
+ id: "12345",
98
+ url: "http://example.com",
99
+ type: "primary",
100
+ },
101
+ {
102
+ id: "12345",
103
+ url: "http://example.com",
104
+ type: "primary",
105
+ },
106
+ {
107
+ id: "12345",
108
+ url: "http://example.com",
109
+ type: "primary",
110
+ },
111
+ ],
112
+ addresses: [
113
+ {
114
+ id: "123",
115
+ type: "primary",
116
+ string: "25 Spring Street, Blackburn, VIC 3130",
117
+ name: "HQ US",
118
+ line1: "Main street",
119
+ line2: "apt #",
120
+ line3: "Suite #",
121
+ line4: "delivery instructions",
122
+ streetNumber: "25",
123
+ city: "San Francisco",
124
+ state: "CA",
125
+ postalCode: "94104",
126
+ country: "US",
127
+ latitude: "40.759211",
128
+ longitude: "-73.984638",
129
+ county: "Santa Clara",
130
+ contactName: "Elon Musk",
131
+ salutation: "Mr",
132
+ phoneNumber: "111-111-1111",
133
+ fax: "122-111-1111",
134
+ email: "elon@musk.com",
135
+ website: "https://elonmusk.com",
136
+ notes: "Address notes or delivery instructions.",
137
+ rowVersion: "1-12345",
138
+ },
139
+ ],
140
+ socialLinks: [
141
+ {
142
+ id: "12345",
143
+ url: "https://www.twitter.com/apideck",
144
+ type: "twitter",
145
+ },
146
+ ],
147
+ phoneNumbers: [
148
+ {
149
+ id: "12345",
150
+ countryCode: "1",
151
+ areaCode: "323",
152
+ number: "111-111-1111",
153
+ extension: "105",
154
+ type: "primary",
155
+ },
156
+ ],
157
+ emails: [
158
+ {
159
+ id: "123",
160
+ email: "elon@musk.com",
161
+ type: "primary",
162
+ },
163
+ {
164
+ id: "123",
165
+ email: "elon@musk.com",
166
+ type: "primary",
167
+ },
168
+ ],
169
+ rowType: {
170
+ id: "12345",
171
+ name: "Customer Account",
172
+ },
173
+ customFields: [
174
+ {
175
+ id: "2389328923893298",
176
+ name: "employee_level",
177
+ description: "Employee Level",
178
+ value: "Uses Salesforce and Marketo",
179
+ },
180
+ {
181
+ id: "2389328923893298",
182
+ name: "employee_level",
183
+ description: "Employee Level",
184
+ value: {},
185
+ },
186
+ ],
187
+ tags: [
188
+ "New",
189
+ ],
190
+ readOnly: false,
191
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
192
+ deleted: false,
193
+ salutation: "Mr",
194
+ birthday: new Date("2000-08-12"),
195
+ updatedBy: "12345",
196
+ createdBy: "12345",
197
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
198
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
199
+ passThrough: [
200
+ {
201
+ serviceId: "<id>",
202
+ extendPaths: [
203
+ {
204
+ path: "$.nested.property",
205
+ value: {
206
+ "TaxClassificationRef": {
207
+ "value": "EUC-99990201-V1-00020000",
208
+ },
209
+ },
210
+ },
211
+ {
212
+ path: "$.nested.property",
213
+ value: {
214
+ "TaxClassificationRef": {
215
+ "value": "EUC-99990201-V1-00020000",
216
+ },
217
+ },
218
+ },
219
+ {
220
+ path: "$.nested.property",
221
+ value: {
222
+ "TaxClassificationRef": {
223
+ "value": "EUC-99990201-V1-00020000",
224
+ },
225
+ },
226
+ },
227
+ ],
228
+ },
229
+ ],
230
+ },
231
+ {
232
+ id: "12345",
233
+ name: "SpaceX",
234
+ interactionCount: 1,
235
+ ownerId: "12345",
236
+ image: "https://www.spacex.com/static/images/share.jpg",
237
+ description:
238
+ "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.",
239
+ vatNumber: "BE0689615164",
240
+ currency: "USD",
241
+ status: "Open",
242
+ fax: "+12129876543",
243
+ annualRevenue: "+$35m",
244
+ numberOfEmployees: "500-1000",
245
+ industry: "Apparel",
246
+ ownership: "Public",
247
+ salesTaxNumber: "12456EN",
248
+ payeeNumber: "78932EN",
249
+ abnOrTfn: "46 115 614 695",
250
+ abnBranch: "123",
251
+ acn: "XXX XXX XXX",
252
+ firstName: "Elon",
253
+ lastName: "Musk",
254
+ parentId: "22345",
255
+ bankAccounts: [
256
+ {
257
+ bankName: "Monzo",
258
+ accountNumber: "123465",
259
+ accountName: "SPACEX LLC",
260
+ accountType: "credit_card",
261
+ iban: "CH2989144532982975332",
262
+ bic: "AUDSCHGGXXX",
263
+ routingNumber: "012345678",
264
+ bsbNumber: "062-001",
265
+ branchIdentifier: "001",
266
+ bankCode: "BNH",
267
+ currency: "USD",
268
+ },
269
+ {
270
+ bankName: "Monzo",
271
+ accountNumber: "123465",
272
+ accountName: "SPACEX LLC",
273
+ accountType: "credit_card",
274
+ iban: "CH2989144532982975332",
275
+ bic: "AUDSCHGGXXX",
276
+ routingNumber: "012345678",
277
+ bsbNumber: "062-001",
278
+ branchIdentifier: "001",
279
+ bankCode: "BNH",
280
+ currency: "USD",
281
+ },
282
+ ],
283
+ websites: [
284
+ {
285
+ id: "12345",
286
+ url: "http://example.com",
287
+ type: "primary",
288
+ },
289
+ {
290
+ id: "12345",
291
+ url: "http://example.com",
292
+ type: "primary",
293
+ },
294
+ ],
295
+ addresses: [
296
+ {
297
+ id: "123",
298
+ type: "primary",
299
+ string: "25 Spring Street, Blackburn, VIC 3130",
300
+ name: "HQ US",
301
+ line1: "Main street",
302
+ line2: "apt #",
303
+ line3: "Suite #",
304
+ line4: "delivery instructions",
305
+ streetNumber: "25",
306
+ city: "San Francisco",
307
+ state: "CA",
308
+ postalCode: "94104",
309
+ country: "US",
310
+ latitude: "40.759211",
311
+ longitude: "-73.984638",
312
+ county: "Santa Clara",
313
+ contactName: "Elon Musk",
314
+ salutation: "Mr",
315
+ phoneNumber: "111-111-1111",
316
+ fax: "122-111-1111",
317
+ email: "elon@musk.com",
318
+ website: "https://elonmusk.com",
319
+ notes: "Address notes or delivery instructions.",
320
+ rowVersion: "1-12345",
321
+ },
322
+ ],
323
+ socialLinks: [
324
+ {
325
+ id: "12345",
326
+ url: "https://www.twitter.com/apideck",
327
+ type: "twitter",
328
+ },
329
+ ],
330
+ phoneNumbers: [
331
+ {
332
+ id: "12345",
333
+ countryCode: "1",
334
+ areaCode: "323",
335
+ number: "111-111-1111",
336
+ extension: "105",
337
+ type: "primary",
338
+ },
339
+ {
340
+ id: "12345",
341
+ countryCode: "1",
342
+ areaCode: "323",
343
+ number: "111-111-1111",
344
+ extension: "105",
345
+ type: "primary",
346
+ },
347
+ ],
348
+ emails: [
349
+ {
350
+ id: "123",
351
+ email: "elon@musk.com",
352
+ type: "primary",
353
+ },
354
+ {
355
+ id: "123",
356
+ email: "elon@musk.com",
357
+ type: "primary",
358
+ },
359
+ ],
360
+ rowType: {
361
+ id: "12345",
362
+ name: "Customer Account",
363
+ },
364
+ customFields: [
365
+ {
366
+ id: "2389328923893298",
367
+ name: "employee_level",
368
+ description: "Employee Level",
369
+ value: {
370
+ "0": {},
371
+ "1": {},
372
+ },
373
+ },
374
+ ],
375
+ tags: [
376
+ "New",
377
+ ],
378
+ readOnly: false,
379
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
380
+ deleted: false,
381
+ salutation: "Mr",
382
+ birthday: new Date("2000-08-12"),
383
+ updatedBy: "12345",
384
+ createdBy: "12345",
385
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
386
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
387
+ passThrough: [
388
+ {
389
+ serviceId: "<id>",
390
+ extendPaths: [
391
+ {
392
+ path: "$.nested.property",
393
+ value: {
394
+ "TaxClassificationRef": {
395
+ "value": "EUC-99990201-V1-00020000",
396
+ },
397
+ },
398
+ },
399
+ {
400
+ path: "$.nested.property",
401
+ value: {
402
+ "TaxClassificationRef": {
403
+ "value": "EUC-99990201-V1-00020000",
404
+ },
405
+ },
406
+ },
407
+ ],
408
+ },
409
+ {
410
+ serviceId: "<id>",
411
+ extendPaths: [
412
+ {
413
+ path: "$.nested.property",
414
+ value: {
415
+ "TaxClassificationRef": {
416
+ "value": "EUC-99990201-V1-00020000",
417
+ },
418
+ },
419
+ },
420
+ ],
421
+ },
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
+ },
435
+ ],
436
+ },
437
+ {
438
+ id: "12345",
439
+ name: "SpaceX",
440
+ interactionCount: 1,
441
+ ownerId: "12345",
442
+ image: "https://www.spacex.com/static/images/share.jpg",
443
+ description:
444
+ "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.",
445
+ vatNumber: "BE0689615164",
446
+ currency: "USD",
447
+ status: "Open",
448
+ fax: "+12129876543",
449
+ annualRevenue: "+$35m",
450
+ numberOfEmployees: "500-1000",
451
+ industry: "Apparel",
452
+ ownership: "Public",
453
+ salesTaxNumber: "12456EN",
454
+ payeeNumber: "78932EN",
455
+ abnOrTfn: "46 115 614 695",
456
+ abnBranch: "123",
457
+ acn: "XXX XXX XXX",
458
+ firstName: "Elon",
459
+ lastName: "Musk",
460
+ parentId: "22345",
461
+ bankAccounts: [
462
+ {
463
+ bankName: "Monzo",
464
+ accountNumber: "123465",
465
+ accountName: "SPACEX LLC",
466
+ accountType: "credit_card",
467
+ iban: "CH2989144532982975332",
468
+ bic: "AUDSCHGGXXX",
469
+ routingNumber: "012345678",
470
+ bsbNumber: "062-001",
471
+ branchIdentifier: "001",
472
+ bankCode: "BNH",
473
+ currency: "USD",
474
+ },
475
+ {
476
+ bankName: "Monzo",
477
+ accountNumber: "123465",
478
+ accountName: "SPACEX LLC",
479
+ accountType: "credit_card",
480
+ iban: "CH2989144532982975332",
481
+ bic: "AUDSCHGGXXX",
482
+ routingNumber: "012345678",
483
+ bsbNumber: "062-001",
484
+ branchIdentifier: "001",
485
+ bankCode: "BNH",
486
+ currency: "USD",
487
+ },
488
+ {
489
+ bankName: "Monzo",
490
+ accountNumber: "123465",
491
+ accountName: "SPACEX LLC",
492
+ accountType: "credit_card",
493
+ iban: "CH2989144532982975332",
494
+ bic: "AUDSCHGGXXX",
495
+ routingNumber: "012345678",
496
+ bsbNumber: "062-001",
497
+ branchIdentifier: "001",
498
+ bankCode: "BNH",
499
+ currency: "USD",
500
+ },
501
+ ],
502
+ websites: [
503
+ {
504
+ id: "12345",
505
+ url: "http://example.com",
506
+ type: "primary",
507
+ },
508
+ ],
509
+ addresses: [
510
+ {
511
+ id: "123",
512
+ type: "primary",
513
+ string: "25 Spring Street, Blackburn, VIC 3130",
514
+ name: "HQ US",
515
+ line1: "Main street",
516
+ line2: "apt #",
517
+ line3: "Suite #",
518
+ line4: "delivery instructions",
519
+ streetNumber: "25",
520
+ city: "San Francisco",
521
+ state: "CA",
522
+ postalCode: "94104",
523
+ country: "US",
524
+ latitude: "40.759211",
525
+ longitude: "-73.984638",
526
+ county: "Santa Clara",
527
+ contactName: "Elon Musk",
528
+ salutation: "Mr",
529
+ phoneNumber: "111-111-1111",
530
+ fax: "122-111-1111",
531
+ email: "elon@musk.com",
532
+ website: "https://elonmusk.com",
533
+ notes: "Address notes or delivery instructions.",
534
+ rowVersion: "1-12345",
535
+ },
536
+ {
537
+ id: "123",
538
+ type: "primary",
539
+ string: "25 Spring Street, Blackburn, VIC 3130",
540
+ name: "HQ US",
541
+ line1: "Main street",
542
+ line2: "apt #",
543
+ line3: "Suite #",
544
+ line4: "delivery instructions",
545
+ streetNumber: "25",
546
+ city: "San Francisco",
547
+ state: "CA",
548
+ postalCode: "94104",
549
+ country: "US",
550
+ latitude: "40.759211",
551
+ longitude: "-73.984638",
552
+ county: "Santa Clara",
553
+ contactName: "Elon Musk",
554
+ salutation: "Mr",
555
+ phoneNumber: "111-111-1111",
556
+ fax: "122-111-1111",
557
+ email: "elon@musk.com",
558
+ website: "https://elonmusk.com",
559
+ notes: "Address notes or delivery instructions.",
560
+ rowVersion: "1-12345",
561
+ },
562
+ {
563
+ id: "123",
564
+ type: "primary",
565
+ string: "25 Spring Street, Blackburn, VIC 3130",
566
+ name: "HQ US",
567
+ line1: "Main street",
568
+ line2: "apt #",
569
+ line3: "Suite #",
570
+ line4: "delivery instructions",
571
+ streetNumber: "25",
572
+ city: "San Francisco",
573
+ state: "CA",
574
+ postalCode: "94104",
575
+ country: "US",
576
+ latitude: "40.759211",
577
+ longitude: "-73.984638",
578
+ county: "Santa Clara",
579
+ contactName: "Elon Musk",
580
+ salutation: "Mr",
581
+ phoneNumber: "111-111-1111",
582
+ fax: "122-111-1111",
583
+ email: "elon@musk.com",
584
+ website: "https://elonmusk.com",
585
+ notes: "Address notes or delivery instructions.",
586
+ rowVersion: "1-12345",
587
+ },
588
+ ],
589
+ socialLinks: [
590
+ {
591
+ id: "12345",
592
+ url: "https://www.twitter.com/apideck",
593
+ type: "twitter",
594
+ },
595
+ {
596
+ id: "12345",
597
+ url: "https://www.twitter.com/apideck",
598
+ type: "twitter",
599
+ },
600
+ ],
601
+ phoneNumbers: [
602
+ {
603
+ id: "12345",
604
+ countryCode: "1",
605
+ areaCode: "323",
606
+ number: "111-111-1111",
607
+ extension: "105",
608
+ type: "primary",
609
+ },
610
+ {
611
+ id: "12345",
612
+ countryCode: "1",
613
+ areaCode: "323",
614
+ number: "111-111-1111",
615
+ extension: "105",
616
+ type: "primary",
617
+ },
618
+ {
619
+ id: "12345",
620
+ countryCode: "1",
621
+ areaCode: "323",
622
+ number: "111-111-1111",
623
+ extension: "105",
624
+ type: "primary",
625
+ },
626
+ ],
627
+ emails: [
628
+ {
629
+ id: "123",
630
+ email: "elon@musk.com",
631
+ type: "primary",
632
+ },
633
+ ],
634
+ rowType: {
635
+ id: "12345",
636
+ name: "Customer Account",
637
+ },
638
+ customFields: [
639
+ {
640
+ id: "2389328923893298",
641
+ name: "employee_level",
642
+ description: "Employee Level",
643
+ value: {},
644
+ },
645
+ ],
646
+ tags: [
647
+ "New",
648
+ ],
649
+ readOnly: false,
650
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
651
+ deleted: false,
652
+ salutation: "Mr",
653
+ birthday: new Date("2000-08-12"),
654
+ updatedBy: "12345",
655
+ createdBy: "12345",
656
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
657
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
658
+ passThrough: [
659
+ {
660
+ serviceId: "<id>",
661
+ extendPaths: [
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
+ serviceId: "<id>",
682
+ extendPaths: [
683
+ {
684
+ path: "$.nested.property",
685
+ value: {
686
+ "TaxClassificationRef": {
687
+ "value": "EUC-99990201-V1-00020000",
688
+ },
689
+ },
690
+ },
691
+ {
692
+ path: "$.nested.property",
693
+ value: {
694
+ "TaxClassificationRef": {
695
+ "value": "EUC-99990201-V1-00020000",
696
+ },
697
+ },
698
+ },
699
+ ],
700
+ },
701
+ ],
702
+ },
703
+ ],
704
+ meta: {
705
+ itemsOnPage: 50,
706
+ cursors: {
707
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
708
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
709
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
710
+ },
711
+ },
712
+ links: {
713
+ previous:
714
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
715
+ current: "https://unify.apideck.com/crm/companies",
716
+ next:
717
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
718
+ },
719
+ });
720
+ });
721
+
722
+ test("Companies Crm Companies Add", async () => {
723
+ const testHttpClient = createTestHTTPClient("crm.companiesAdd");
724
+
725
+ const apideck = new Apideck({
726
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
727
+ httpClient: testHttpClient,
728
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
729
+ });
730
+
731
+ const result = await apideck.crm.companies.create({
732
+ consumerId: "test-consumer",
733
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
734
+ serviceId: "salesforce",
735
+ company1: {
736
+ name: "SpaceX",
737
+ ownerId: "12345",
738
+ image: "https://www.spacex.com/static/images/share.jpg",
739
+ description:
740
+ "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.",
741
+ vatNumber: "BE0689615164",
742
+ currency: "USD",
743
+ status: "Open",
744
+ fax: "+12129876543",
745
+ annualRevenue: "+$35m",
746
+ numberOfEmployees: "500-1000",
747
+ industry: "Apparel",
748
+ ownership: "Public",
749
+ salesTaxNumber: "12456EN",
750
+ payeeNumber: "78932EN",
751
+ abnOrTfn: "46 115 614 695",
752
+ abnBranch: "123",
753
+ acn: "XXX XXX XXX",
754
+ firstName: "Elon",
755
+ lastName: "Musk",
756
+ bankAccounts: [
757
+ {
758
+ bankName: "Monzo",
759
+ accountNumber: "123465",
760
+ accountName: "SPACEX LLC",
761
+ accountType: "credit_card",
762
+ iban: "CH2989144532982975332",
763
+ bic: "AUDSCHGGXXX",
764
+ routingNumber: "012345678",
765
+ bsbNumber: "062-001",
766
+ branchIdentifier: "001",
767
+ bankCode: "BNH",
768
+ currency: "USD",
769
+ },
770
+ {
771
+ bankName: "Monzo",
772
+ accountNumber: "123465",
773
+ accountName: "SPACEX LLC",
774
+ accountType: "credit_card",
775
+ iban: "CH2989144532982975332",
776
+ bic: "AUDSCHGGXXX",
777
+ routingNumber: "012345678",
778
+ bsbNumber: "062-001",
779
+ branchIdentifier: "001",
780
+ bankCode: "BNH",
781
+ currency: "USD",
782
+ },
783
+ ],
784
+ websites: [
785
+ {
786
+ id: "12345",
787
+ url: "http://example.com",
788
+ type: "primary",
789
+ },
790
+ {
791
+ id: "12345",
792
+ url: "http://example.com",
793
+ type: "primary",
794
+ },
795
+ ],
796
+ addresses: [
797
+ {
798
+ id: "123",
799
+ type: "primary",
800
+ string: "25 Spring Street, Blackburn, VIC 3130",
801
+ name: "HQ US",
802
+ line1: "Main street",
803
+ line2: "apt #",
804
+ line3: "Suite #",
805
+ line4: "delivery instructions",
806
+ streetNumber: "25",
807
+ city: "San Francisco",
808
+ state: "CA",
809
+ postalCode: "94104",
810
+ country: "US",
811
+ latitude: "40.759211",
812
+ longitude: "-73.984638",
813
+ county: "Santa Clara",
814
+ contactName: "Elon Musk",
815
+ salutation: "Mr",
816
+ phoneNumber: "111-111-1111",
817
+ fax: "122-111-1111",
818
+ email: "elon@musk.com",
819
+ website: "https://elonmusk.com",
820
+ notes: "Address notes or delivery instructions.",
821
+ rowVersion: "1-12345",
822
+ },
823
+ {
824
+ id: "123",
825
+ type: "primary",
826
+ string: "25 Spring Street, Blackburn, VIC 3130",
827
+ name: "HQ US",
828
+ line1: "Main street",
829
+ line2: "apt #",
830
+ line3: "Suite #",
831
+ line4: "delivery instructions",
832
+ streetNumber: "25",
833
+ city: "San Francisco",
834
+ state: "CA",
835
+ postalCode: "94104",
836
+ country: "US",
837
+ latitude: "40.759211",
838
+ longitude: "-73.984638",
839
+ county: "Santa Clara",
840
+ contactName: "Elon Musk",
841
+ salutation: "Mr",
842
+ phoneNumber: "111-111-1111",
843
+ fax: "122-111-1111",
844
+ email: "elon@musk.com",
845
+ website: "https://elonmusk.com",
846
+ notes: "Address notes or delivery instructions.",
847
+ rowVersion: "1-12345",
848
+ },
849
+ ],
850
+ socialLinks: [
851
+ {
852
+ id: "12345",
853
+ url: "https://www.twitter.com/apideck",
854
+ type: "twitter",
855
+ },
856
+ ],
857
+ phoneNumbers: [
858
+ {
859
+ id: "12345",
860
+ countryCode: "1",
861
+ areaCode: "323",
862
+ number: "111-111-1111",
863
+ extension: "105",
864
+ type: "primary",
865
+ },
866
+ ],
867
+ emails: [
868
+ {
869
+ id: "123",
870
+ email: "elon@musk.com",
871
+ type: "primary",
872
+ },
873
+ {
874
+ id: "123",
875
+ email: "elon@musk.com",
876
+ type: "primary",
877
+ },
878
+ {
879
+ id: "123",
880
+ email: "elon@musk.com",
881
+ type: "primary",
882
+ },
883
+ ],
884
+ rowType: {
885
+ id: "12345",
886
+ name: "Customer Account",
887
+ },
888
+ customFields: [
889
+ {
890
+ id: "2389328923893298",
891
+ name: "employee_level",
892
+ description: "Employee Level",
893
+ value: "Uses Salesforce and Marketo",
894
+ },
895
+ {
896
+ id: "2389328923893298",
897
+ name: "employee_level",
898
+ description: "Employee Level",
899
+ value: 10,
900
+ },
901
+ {
902
+ id: "2389328923893298",
903
+ name: "employee_level",
904
+ description: "Employee Level",
905
+ value: "Uses Salesforce and Marketo",
906
+ },
907
+ ],
908
+ tags: [
909
+ "New",
910
+ ],
911
+ readOnly: false,
912
+ salutation: "Mr",
913
+ birthday: new Date("2000-08-12"),
914
+ passThrough: [
915
+ {
916
+ serviceId: "<id>",
917
+ extendPaths: [
918
+ {
919
+ path: "$.nested.property",
920
+ value: {
921
+ "TaxClassificationRef": {
922
+ "value": "EUC-99990201-V1-00020000",
923
+ },
924
+ },
925
+ },
926
+ {
927
+ path: "$.nested.property",
928
+ value: {
929
+ "TaxClassificationRef": {
930
+ "value": "EUC-99990201-V1-00020000",
931
+ },
932
+ },
933
+ },
934
+ {
935
+ path: "$.nested.property",
936
+ value: {
937
+ "TaxClassificationRef": {
938
+ "value": "EUC-99990201-V1-00020000",
939
+ },
940
+ },
941
+ },
942
+ ],
943
+ },
944
+ {
945
+ serviceId: "<id>",
946
+ extendPaths: [
947
+ {
948
+ path: "$.nested.property",
949
+ value: {
950
+ "TaxClassificationRef": {
951
+ "value": "EUC-99990201-V1-00020000",
952
+ },
953
+ },
954
+ },
955
+ {
956
+ path: "$.nested.property",
957
+ value: {
958
+ "TaxClassificationRef": {
959
+ "value": "EUC-99990201-V1-00020000",
960
+ },
961
+ },
962
+ },
963
+ ],
964
+ },
965
+ {
966
+ serviceId: "<id>",
967
+ extendPaths: [
968
+ {
969
+ path: "$.nested.property",
970
+ value: {
971
+ "TaxClassificationRef": {
972
+ "value": "EUC-99990201-V1-00020000",
973
+ },
974
+ },
975
+ },
976
+ {
977
+ path: "$.nested.property",
978
+ value: {
979
+ "TaxClassificationRef": {
980
+ "value": "EUC-99990201-V1-00020000",
981
+ },
982
+ },
983
+ },
984
+ {
985
+ path: "$.nested.property",
986
+ value: {
987
+ "TaxClassificationRef": {
988
+ "value": "EUC-99990201-V1-00020000",
989
+ },
990
+ },
991
+ },
992
+ ],
993
+ },
994
+ ],
995
+ },
996
+ });
997
+ expect(result.httpMeta.response.status).toBe(201);
998
+ expect(result.createCompanyResponse).toBeDefined();
999
+ expect(result.createCompanyResponse).toEqual({
1000
+ statusCode: 200,
1001
+ status: "OK",
1002
+ service: "zoho-crm",
1003
+ resource: "companies",
1004
+ operation: "add",
1005
+ data: {
1006
+ id: "12345",
1007
+ },
1008
+ });
1009
+ });
1010
+
1011
+ test("Companies Crm Companies One", async () => {
1012
+ const testHttpClient = createTestHTTPClient("crm.companiesOne");
1013
+
1014
+ const apideck = new Apideck({
1015
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1016
+ httpClient: testHttpClient,
1017
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1018
+ });
1019
+
1020
+ const result = await apideck.crm.companies.get({
1021
+ id: "<id>",
1022
+ consumerId: "test-consumer",
1023
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1024
+ serviceId: "salesforce",
1025
+ fields: "id,updated_at",
1026
+ });
1027
+ expect(result.httpMeta.response.status).toBe(200);
1028
+ expect(result.getCompanyResponse).toBeDefined();
1029
+ expect(result.getCompanyResponse).toEqual({
1030
+ statusCode: 200,
1031
+ status: "OK",
1032
+ service: "zoho-crm",
1033
+ resource: "companies",
1034
+ operation: "one",
1035
+ data: {
1036
+ id: "12345",
1037
+ name: "SpaceX",
1038
+ interactionCount: 1,
1039
+ ownerId: "12345",
1040
+ image: "https://www.spacex.com/static/images/share.jpg",
1041
+ description:
1042
+ "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.",
1043
+ vatNumber: "BE0689615164",
1044
+ currency: "USD",
1045
+ status: "Open",
1046
+ fax: "+12129876543",
1047
+ annualRevenue: "+$35m",
1048
+ numberOfEmployees: "500-1000",
1049
+ industry: "Apparel",
1050
+ ownership: "Public",
1051
+ salesTaxNumber: "12456EN",
1052
+ payeeNumber: "78932EN",
1053
+ abnOrTfn: "46 115 614 695",
1054
+ abnBranch: "123",
1055
+ acn: "XXX XXX XXX",
1056
+ firstName: "Elon",
1057
+ lastName: "Musk",
1058
+ parentId: "22345",
1059
+ bankAccounts: [
1060
+ {
1061
+ bankName: "Monzo",
1062
+ accountNumber: "123465",
1063
+ accountName: "SPACEX LLC",
1064
+ accountType: "credit_card",
1065
+ iban: "CH2989144532982975332",
1066
+ bic: "AUDSCHGGXXX",
1067
+ routingNumber: "012345678",
1068
+ bsbNumber: "062-001",
1069
+ branchIdentifier: "001",
1070
+ bankCode: "BNH",
1071
+ currency: "USD",
1072
+ },
1073
+ {
1074
+ bankName: "Monzo",
1075
+ accountNumber: "123465",
1076
+ accountName: "SPACEX LLC",
1077
+ accountType: "credit_card",
1078
+ iban: "CH2989144532982975332",
1079
+ bic: "AUDSCHGGXXX",
1080
+ routingNumber: "012345678",
1081
+ bsbNumber: "062-001",
1082
+ branchIdentifier: "001",
1083
+ bankCode: "BNH",
1084
+ currency: "USD",
1085
+ },
1086
+ {
1087
+ bankName: "Monzo",
1088
+ accountNumber: "123465",
1089
+ accountName: "SPACEX LLC",
1090
+ accountType: "credit_card",
1091
+ iban: "CH2989144532982975332",
1092
+ bic: "AUDSCHGGXXX",
1093
+ routingNumber: "012345678",
1094
+ bsbNumber: "062-001",
1095
+ branchIdentifier: "001",
1096
+ bankCode: "BNH",
1097
+ currency: "USD",
1098
+ },
1099
+ ],
1100
+ websites: [
1101
+ {
1102
+ id: "12345",
1103
+ url: "http://example.com",
1104
+ type: "primary",
1105
+ },
1106
+ {
1107
+ id: "12345",
1108
+ url: "http://example.com",
1109
+ type: "primary",
1110
+ },
1111
+ ],
1112
+ addresses: [
1113
+ {
1114
+ id: "123",
1115
+ type: "primary",
1116
+ string: "25 Spring Street, Blackburn, VIC 3130",
1117
+ name: "HQ US",
1118
+ line1: "Main street",
1119
+ line2: "apt #",
1120
+ line3: "Suite #",
1121
+ line4: "delivery instructions",
1122
+ streetNumber: "25",
1123
+ city: "San Francisco",
1124
+ state: "CA",
1125
+ postalCode: "94104",
1126
+ country: "US",
1127
+ latitude: "40.759211",
1128
+ longitude: "-73.984638",
1129
+ county: "Santa Clara",
1130
+ contactName: "Elon Musk",
1131
+ salutation: "Mr",
1132
+ phoneNumber: "111-111-1111",
1133
+ fax: "122-111-1111",
1134
+ email: "elon@musk.com",
1135
+ website: "https://elonmusk.com",
1136
+ notes: "Address notes or delivery instructions.",
1137
+ rowVersion: "1-12345",
1138
+ },
1139
+ {
1140
+ id: "123",
1141
+ type: "primary",
1142
+ string: "25 Spring Street, Blackburn, VIC 3130",
1143
+ name: "HQ US",
1144
+ line1: "Main street",
1145
+ line2: "apt #",
1146
+ line3: "Suite #",
1147
+ line4: "delivery instructions",
1148
+ streetNumber: "25",
1149
+ city: "San Francisco",
1150
+ state: "CA",
1151
+ postalCode: "94104",
1152
+ country: "US",
1153
+ latitude: "40.759211",
1154
+ longitude: "-73.984638",
1155
+ county: "Santa Clara",
1156
+ contactName: "Elon Musk",
1157
+ salutation: "Mr",
1158
+ phoneNumber: "111-111-1111",
1159
+ fax: "122-111-1111",
1160
+ email: "elon@musk.com",
1161
+ website: "https://elonmusk.com",
1162
+ notes: "Address notes or delivery instructions.",
1163
+ rowVersion: "1-12345",
1164
+ },
1165
+ ],
1166
+ socialLinks: [
1167
+ {
1168
+ id: "12345",
1169
+ url: "https://www.twitter.com/apideck",
1170
+ type: "twitter",
1171
+ },
1172
+ {
1173
+ id: "12345",
1174
+ url: "https://www.twitter.com/apideck",
1175
+ type: "twitter",
1176
+ },
1177
+ ],
1178
+ phoneNumbers: [
1179
+ {
1180
+ id: "12345",
1181
+ countryCode: "1",
1182
+ areaCode: "323",
1183
+ number: "111-111-1111",
1184
+ extension: "105",
1185
+ type: "primary",
1186
+ },
1187
+ {
1188
+ id: "12345",
1189
+ countryCode: "1",
1190
+ areaCode: "323",
1191
+ number: "111-111-1111",
1192
+ extension: "105",
1193
+ type: "primary",
1194
+ },
1195
+ {
1196
+ id: "12345",
1197
+ countryCode: "1",
1198
+ areaCode: "323",
1199
+ number: "111-111-1111",
1200
+ extension: "105",
1201
+ type: "primary",
1202
+ },
1203
+ ],
1204
+ emails: [
1205
+ {
1206
+ id: "123",
1207
+ email: "elon@musk.com",
1208
+ type: "primary",
1209
+ },
1210
+ {
1211
+ id: "123",
1212
+ email: "elon@musk.com",
1213
+ type: "primary",
1214
+ },
1215
+ ],
1216
+ rowType: {
1217
+ id: "12345",
1218
+ name: "Customer Account",
1219
+ },
1220
+ customFields: [
1221
+ {
1222
+ id: "2389328923893298",
1223
+ name: "employee_level",
1224
+ description: "Employee Level",
1225
+ value: 10,
1226
+ },
1227
+ {
1228
+ id: "2389328923893298",
1229
+ name: "employee_level",
1230
+ description: "Employee Level",
1231
+ value: 10,
1232
+ },
1233
+ ],
1234
+ tags: [
1235
+ "New",
1236
+ ],
1237
+ readOnly: false,
1238
+ lastActivityAt: new Date("2020-09-30T07:43:32.000Z"),
1239
+ deleted: false,
1240
+ salutation: "Mr",
1241
+ birthday: new Date("2000-08-12"),
1242
+ updatedBy: "12345",
1243
+ createdBy: "12345",
1244
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1245
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1246
+ passThrough: [
1247
+ {
1248
+ serviceId: "<id>",
1249
+ extendPaths: [
1250
+ {
1251
+ path: "$.nested.property",
1252
+ value: {
1253
+ "TaxClassificationRef": {
1254
+ "value": "EUC-99990201-V1-00020000",
1255
+ },
1256
+ },
1257
+ },
1258
+ {
1259
+ path: "$.nested.property",
1260
+ value: {
1261
+ "TaxClassificationRef": {
1262
+ "value": "EUC-99990201-V1-00020000",
1263
+ },
1264
+ },
1265
+ },
1266
+ ],
1267
+ },
1268
+ {
1269
+ serviceId: "<id>",
1270
+ extendPaths: [
1271
+ {
1272
+ path: "$.nested.property",
1273
+ value: {
1274
+ "TaxClassificationRef": {
1275
+ "value": "EUC-99990201-V1-00020000",
1276
+ },
1277
+ },
1278
+ },
1279
+ {
1280
+ path: "$.nested.property",
1281
+ value: {
1282
+ "TaxClassificationRef": {
1283
+ "value": "EUC-99990201-V1-00020000",
1284
+ },
1285
+ },
1286
+ },
1287
+ {
1288
+ path: "$.nested.property",
1289
+ value: {
1290
+ "TaxClassificationRef": {
1291
+ "value": "EUC-99990201-V1-00020000",
1292
+ },
1293
+ },
1294
+ },
1295
+ ],
1296
+ },
1297
+ {
1298
+ serviceId: "<id>",
1299
+ extendPaths: [
1300
+ {
1301
+ path: "$.nested.property",
1302
+ value: {
1303
+ "TaxClassificationRef": {
1304
+ "value": "EUC-99990201-V1-00020000",
1305
+ },
1306
+ },
1307
+ },
1308
+ ],
1309
+ },
1310
+ ],
1311
+ },
1312
+ });
1313
+ });
1314
+
1315
+ test("Companies Crm Companies Update", async () => {
1316
+ const testHttpClient = createTestHTTPClient("crm.companiesUpdate");
1317
+
1318
+ const apideck = new Apideck({
1319
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1320
+ httpClient: testHttpClient,
1321
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1322
+ });
1323
+
1324
+ const result = await apideck.crm.companies.update({
1325
+ id: "<id>",
1326
+ consumerId: "test-consumer",
1327
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1328
+ serviceId: "salesforce",
1329
+ company1: {
1330
+ name: "SpaceX",
1331
+ ownerId: "12345",
1332
+ image: "https://www.spacex.com/static/images/share.jpg",
1333
+ description:
1334
+ "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.",
1335
+ vatNumber: "BE0689615164",
1336
+ currency: "USD",
1337
+ status: "Open",
1338
+ fax: "+12129876543",
1339
+ annualRevenue: "+$35m",
1340
+ numberOfEmployees: "500-1000",
1341
+ industry: "Apparel",
1342
+ ownership: "Public",
1343
+ salesTaxNumber: "12456EN",
1344
+ payeeNumber: "78932EN",
1345
+ abnOrTfn: "46 115 614 695",
1346
+ abnBranch: "123",
1347
+ acn: "XXX XXX XXX",
1348
+ firstName: "Elon",
1349
+ lastName: "Musk",
1350
+ bankAccounts: [
1351
+ {
1352
+ bankName: "Monzo",
1353
+ accountNumber: "123465",
1354
+ accountName: "SPACEX LLC",
1355
+ accountType: "credit_card",
1356
+ iban: "CH2989144532982975332",
1357
+ bic: "AUDSCHGGXXX",
1358
+ routingNumber: "012345678",
1359
+ bsbNumber: "062-001",
1360
+ branchIdentifier: "001",
1361
+ bankCode: "BNH",
1362
+ currency: "USD",
1363
+ },
1364
+ {
1365
+ bankName: "Monzo",
1366
+ accountNumber: "123465",
1367
+ accountName: "SPACEX LLC",
1368
+ accountType: "credit_card",
1369
+ iban: "CH2989144532982975332",
1370
+ bic: "AUDSCHGGXXX",
1371
+ routingNumber: "012345678",
1372
+ bsbNumber: "062-001",
1373
+ branchIdentifier: "001",
1374
+ bankCode: "BNH",
1375
+ currency: "USD",
1376
+ },
1377
+ {
1378
+ bankName: "Monzo",
1379
+ accountNumber: "123465",
1380
+ accountName: "SPACEX LLC",
1381
+ accountType: "credit_card",
1382
+ iban: "CH2989144532982975332",
1383
+ bic: "AUDSCHGGXXX",
1384
+ routingNumber: "012345678",
1385
+ bsbNumber: "062-001",
1386
+ branchIdentifier: "001",
1387
+ bankCode: "BNH",
1388
+ currency: "USD",
1389
+ },
1390
+ ],
1391
+ websites: [
1392
+ {
1393
+ id: "12345",
1394
+ url: "http://example.com",
1395
+ type: "primary",
1396
+ },
1397
+ {
1398
+ id: "12345",
1399
+ url: "http://example.com",
1400
+ type: "primary",
1401
+ },
1402
+ ],
1403
+ addresses: [
1404
+ {
1405
+ id: "123",
1406
+ type: "primary",
1407
+ string: "25 Spring Street, Blackburn, VIC 3130",
1408
+ name: "HQ US",
1409
+ line1: "Main street",
1410
+ line2: "apt #",
1411
+ line3: "Suite #",
1412
+ line4: "delivery instructions",
1413
+ streetNumber: "25",
1414
+ city: "San Francisco",
1415
+ state: "CA",
1416
+ postalCode: "94104",
1417
+ country: "US",
1418
+ latitude: "40.759211",
1419
+ longitude: "-73.984638",
1420
+ county: "Santa Clara",
1421
+ contactName: "Elon Musk",
1422
+ salutation: "Mr",
1423
+ phoneNumber: "111-111-1111",
1424
+ fax: "122-111-1111",
1425
+ email: "elon@musk.com",
1426
+ website: "https://elonmusk.com",
1427
+ notes: "Address notes or delivery instructions.",
1428
+ rowVersion: "1-12345",
1429
+ },
1430
+ {
1431
+ id: "123",
1432
+ type: "primary",
1433
+ string: "25 Spring Street, Blackburn, VIC 3130",
1434
+ name: "HQ US",
1435
+ line1: "Main street",
1436
+ line2: "apt #",
1437
+ line3: "Suite #",
1438
+ line4: "delivery instructions",
1439
+ streetNumber: "25",
1440
+ city: "San Francisco",
1441
+ state: "CA",
1442
+ postalCode: "94104",
1443
+ country: "US",
1444
+ latitude: "40.759211",
1445
+ longitude: "-73.984638",
1446
+ county: "Santa Clara",
1447
+ contactName: "Elon Musk",
1448
+ salutation: "Mr",
1449
+ phoneNumber: "111-111-1111",
1450
+ fax: "122-111-1111",
1451
+ email: "elon@musk.com",
1452
+ website: "https://elonmusk.com",
1453
+ notes: "Address notes or delivery instructions.",
1454
+ rowVersion: "1-12345",
1455
+ },
1456
+ ],
1457
+ socialLinks: [
1458
+ {
1459
+ id: "12345",
1460
+ url: "https://www.twitter.com/apideck",
1461
+ type: "twitter",
1462
+ },
1463
+ {
1464
+ id: "12345",
1465
+ url: "https://www.twitter.com/apideck",
1466
+ type: "twitter",
1467
+ },
1468
+ {
1469
+ id: "12345",
1470
+ url: "https://www.twitter.com/apideck",
1471
+ type: "twitter",
1472
+ },
1473
+ ],
1474
+ phoneNumbers: [
1475
+ {
1476
+ id: "12345",
1477
+ countryCode: "1",
1478
+ areaCode: "323",
1479
+ number: "111-111-1111",
1480
+ extension: "105",
1481
+ type: "primary",
1482
+ },
1483
+ {
1484
+ id: "12345",
1485
+ countryCode: "1",
1486
+ areaCode: "323",
1487
+ number: "111-111-1111",
1488
+ extension: "105",
1489
+ type: "primary",
1490
+ },
1491
+ ],
1492
+ emails: [
1493
+ {
1494
+ id: "123",
1495
+ email: "elon@musk.com",
1496
+ type: "primary",
1497
+ },
1498
+ {
1499
+ id: "123",
1500
+ email: "elon@musk.com",
1501
+ type: "primary",
1502
+ },
1503
+ ],
1504
+ rowType: {
1505
+ id: "12345",
1506
+ name: "Customer Account",
1507
+ },
1508
+ customFields: [
1509
+ {
1510
+ id: "2389328923893298",
1511
+ name: "employee_level",
1512
+ description: "Employee Level",
1513
+ value: "Uses Salesforce and Marketo",
1514
+ },
1515
+ {
1516
+ id: "2389328923893298",
1517
+ name: "employee_level",
1518
+ description: "Employee Level",
1519
+ value: {
1520
+ "0": {},
1521
+ },
1522
+ },
1523
+ {
1524
+ id: "2389328923893298",
1525
+ name: "employee_level",
1526
+ description: "Employee Level",
1527
+ value: 10,
1528
+ },
1529
+ ],
1530
+ tags: [
1531
+ "New",
1532
+ ],
1533
+ readOnly: false,
1534
+ salutation: "Mr",
1535
+ birthday: new Date("2000-08-12"),
1536
+ passThrough: [
1537
+ {
1538
+ serviceId: "<id>",
1539
+ extendPaths: [
1540
+ {
1541
+ path: "$.nested.property",
1542
+ value: {
1543
+ "TaxClassificationRef": {
1544
+ "value": "EUC-99990201-V1-00020000",
1545
+ },
1546
+ },
1547
+ },
1548
+ ],
1549
+ },
1550
+ ],
1551
+ },
1552
+ });
1553
+ expect(result.httpMeta.response.status).toBe(200);
1554
+ expect(result.updateCompanyResponse).toBeDefined();
1555
+ expect(result.updateCompanyResponse).toEqual({
1556
+ statusCode: 200,
1557
+ status: "OK",
1558
+ service: "zoho-crm",
1559
+ resource: "companies",
1560
+ operation: "update",
1561
+ data: {
1562
+ id: "12345",
1563
+ },
1564
+ });
1565
+ });
1566
+
1567
+ test("Companies Crm Companies Delete", async () => {
1568
+ const testHttpClient = createTestHTTPClient("crm.companiesDelete");
1569
+
1570
+ const apideck = new Apideck({
1571
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1572
+ httpClient: testHttpClient,
1573
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1574
+ });
1575
+
1576
+ const result = await apideck.crm.companies.delete({
1577
+ id: "<id>",
1578
+ consumerId: "test-consumer",
1579
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1580
+ serviceId: "salesforce",
1581
+ });
1582
+ expect(result.httpMeta.response.status).toBe(200);
1583
+ expect(result.deleteCompanyResponse).toBeDefined();
1584
+ expect(result.deleteCompanyResponse).toEqual({
1585
+ statusCode: 200,
1586
+ status: "OK",
1587
+ service: "zoho-crm",
1588
+ resource: "companies",
1589
+ operation: "delete",
1590
+ data: {
1591
+ id: "12345",
1592
+ },
1593
+ });
1594
+ });
1595
+
1596
+ test("Companies Accounting Companies All", async () => {
1597
+ const testHttpClient = createTestHTTPClient("accounting.companiesAll");
1598
+
1599
+ const apideck = new Apideck({
1600
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1601
+ httpClient: testHttpClient,
1602
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1603
+ });
1604
+
1605
+ const result = await apideck.accounting.companies.list({
1606
+ consumerId: "test-consumer",
1607
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1608
+ serviceId: "salesforce",
1609
+ companyId: "12345",
1610
+ fields: "id,updated_at",
1611
+ });
1612
+ expect(result.httpMeta.response.status).toBe(200);
1613
+ expect(result.getCompaniesResponse).toBeDefined();
1614
+ expect(result.getCompaniesResponse).toEqual({
1615
+ statusCode: 200,
1616
+ status: "OK",
1617
+ service: "xero",
1618
+ resource: "companies",
1619
+ operation: "all",
1620
+ data: [
1621
+ {
1622
+ id: "12345",
1623
+ name: "Acme Corporation",
1624
+ },
1625
+ ],
1626
+ meta: {
1627
+ itemsOnPage: 50,
1628
+ cursors: {
1629
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
1630
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
1631
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
1632
+ },
1633
+ },
1634
+ links: {
1635
+ previous:
1636
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
1637
+ current: "https://unify.apideck.com/crm/companies",
1638
+ next:
1639
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
1640
+ },
1641
+ });
1642
+ });