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