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