@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,360 @@
|
|
|
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("Apideck Customers Ecommerce Customers All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("ecommerce.customersAll");
|
|
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.ecommerce.customers.list({
|
|
19
|
+
serviceId: "salesforce",
|
|
20
|
+
filter: {
|
|
21
|
+
email: "elon@musk.com",
|
|
22
|
+
phoneNumber: "111-111-1111",
|
|
23
|
+
},
|
|
24
|
+
passThrough: {
|
|
25
|
+
"search": "San Francisco",
|
|
26
|
+
},
|
|
27
|
+
fields: "id,updated_at",
|
|
28
|
+
});
|
|
29
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
30
|
+
expect(result.getEcommerceCustomersResponse).toBeDefined();
|
|
31
|
+
expect(result.getEcommerceCustomersResponse).toEqual({
|
|
32
|
+
statusCode: 200,
|
|
33
|
+
status: "OK",
|
|
34
|
+
service: "shopify",
|
|
35
|
+
resource: "customers",
|
|
36
|
+
operation: "all",
|
|
37
|
+
data: [
|
|
38
|
+
{
|
|
39
|
+
id: "12345",
|
|
40
|
+
name: "John Doe",
|
|
41
|
+
firstName: "John",
|
|
42
|
+
lastName: "Doe",
|
|
43
|
+
companyName: "Acme Inc.",
|
|
44
|
+
status: "active",
|
|
45
|
+
currency: "USD",
|
|
46
|
+
emails: [
|
|
47
|
+
{
|
|
48
|
+
id: "123",
|
|
49
|
+
email: "elon@musk.com",
|
|
50
|
+
type: "primary",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "123",
|
|
54
|
+
email: "elon@musk.com",
|
|
55
|
+
type: "primary",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
phoneNumbers: [
|
|
59
|
+
{
|
|
60
|
+
id: "12345",
|
|
61
|
+
countryCode: "1",
|
|
62
|
+
areaCode: "323",
|
|
63
|
+
number: "111-111-1111",
|
|
64
|
+
extension: "105",
|
|
65
|
+
type: "primary",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "12345",
|
|
69
|
+
countryCode: "1",
|
|
70
|
+
areaCode: "323",
|
|
71
|
+
number: "111-111-1111",
|
|
72
|
+
extension: "105",
|
|
73
|
+
type: "primary",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "12345",
|
|
77
|
+
countryCode: "1",
|
|
78
|
+
areaCode: "323",
|
|
79
|
+
number: "111-111-1111",
|
|
80
|
+
extension: "105",
|
|
81
|
+
type: "primary",
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
addresses: [
|
|
85
|
+
{
|
|
86
|
+
type: "billing",
|
|
87
|
+
id: "12345",
|
|
88
|
+
line1: "Main street",
|
|
89
|
+
line2: "apt #",
|
|
90
|
+
city: "Anytown",
|
|
91
|
+
state: "Ohio",
|
|
92
|
+
postalCode: "12345",
|
|
93
|
+
country: "US",
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
orders: [
|
|
97
|
+
{
|
|
98
|
+
id: "12345",
|
|
99
|
+
total: "199.99",
|
|
100
|
+
status: "active",
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
104
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "12345",
|
|
108
|
+
name: "John Doe",
|
|
109
|
+
firstName: "John",
|
|
110
|
+
lastName: "Doe",
|
|
111
|
+
companyName: "Acme Inc.",
|
|
112
|
+
status: "active",
|
|
113
|
+
currency: "USD",
|
|
114
|
+
emails: [
|
|
115
|
+
{
|
|
116
|
+
id: "123",
|
|
117
|
+
email: "elon@musk.com",
|
|
118
|
+
type: "primary",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
phoneNumbers: [
|
|
122
|
+
{
|
|
123
|
+
id: "12345",
|
|
124
|
+
countryCode: "1",
|
|
125
|
+
areaCode: "323",
|
|
126
|
+
number: "111-111-1111",
|
|
127
|
+
extension: "105",
|
|
128
|
+
type: "primary",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "12345",
|
|
132
|
+
countryCode: "1",
|
|
133
|
+
areaCode: "323",
|
|
134
|
+
number: "111-111-1111",
|
|
135
|
+
extension: "105",
|
|
136
|
+
type: "primary",
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
addresses: [
|
|
140
|
+
{
|
|
141
|
+
type: "billing",
|
|
142
|
+
id: "12345",
|
|
143
|
+
line1: "Main street",
|
|
144
|
+
line2: "apt #",
|
|
145
|
+
city: "Anytown",
|
|
146
|
+
state: "Ohio",
|
|
147
|
+
postalCode: "12345",
|
|
148
|
+
country: "US",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
type: "billing",
|
|
152
|
+
id: "12345",
|
|
153
|
+
line1: "Main street",
|
|
154
|
+
line2: "apt #",
|
|
155
|
+
city: "Anytown",
|
|
156
|
+
state: "Ohio",
|
|
157
|
+
postalCode: "12345",
|
|
158
|
+
country: "US",
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
orders: [
|
|
162
|
+
{
|
|
163
|
+
id: "12345",
|
|
164
|
+
total: "199.99",
|
|
165
|
+
status: "active",
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
169
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: "12345",
|
|
173
|
+
name: "John Doe",
|
|
174
|
+
firstName: "John",
|
|
175
|
+
lastName: "Doe",
|
|
176
|
+
companyName: "Acme Inc.",
|
|
177
|
+
status: "active",
|
|
178
|
+
currency: "USD",
|
|
179
|
+
emails: [
|
|
180
|
+
{
|
|
181
|
+
id: "123",
|
|
182
|
+
email: "elon@musk.com",
|
|
183
|
+
type: "primary",
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "123",
|
|
187
|
+
email: "elon@musk.com",
|
|
188
|
+
type: "primary",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: "123",
|
|
192
|
+
email: "elon@musk.com",
|
|
193
|
+
type: "primary",
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
phoneNumbers: [
|
|
197
|
+
{
|
|
198
|
+
id: "12345",
|
|
199
|
+
countryCode: "1",
|
|
200
|
+
areaCode: "323",
|
|
201
|
+
number: "111-111-1111",
|
|
202
|
+
extension: "105",
|
|
203
|
+
type: "primary",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
addresses: [
|
|
207
|
+
{
|
|
208
|
+
type: "billing",
|
|
209
|
+
id: "12345",
|
|
210
|
+
line1: "Main street",
|
|
211
|
+
line2: "apt #",
|
|
212
|
+
city: "Anytown",
|
|
213
|
+
state: "Ohio",
|
|
214
|
+
postalCode: "12345",
|
|
215
|
+
country: "US",
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
orders: [
|
|
219
|
+
{
|
|
220
|
+
id: "12345",
|
|
221
|
+
total: "199.99",
|
|
222
|
+
status: "active",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "12345",
|
|
226
|
+
total: "199.99",
|
|
227
|
+
status: "active",
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
id: "12345",
|
|
231
|
+
total: "199.99",
|
|
232
|
+
status: "active",
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
236
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
meta: {
|
|
240
|
+
itemsOnPage: 50,
|
|
241
|
+
cursors: {
|
|
242
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
243
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
244
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
links: {
|
|
248
|
+
previous:
|
|
249
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
250
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
251
|
+
next:
|
|
252
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
test("Apideck Customers Ecommerce Customers One", async () => {
|
|
258
|
+
const testHttpClient = createTestHTTPClient("ecommerce.customersOne");
|
|
259
|
+
|
|
260
|
+
const apideck = new Apideck({
|
|
261
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
262
|
+
httpClient: testHttpClient,
|
|
263
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
const result = await apideck.ecommerce.customers.get({
|
|
267
|
+
id: "<id>",
|
|
268
|
+
serviceId: "salesforce",
|
|
269
|
+
fields: "id,updated_at",
|
|
270
|
+
});
|
|
271
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
272
|
+
expect(result.getEcommerceCustomerResponse).toBeDefined();
|
|
273
|
+
expect(result.getEcommerceCustomerResponse).toEqual({
|
|
274
|
+
statusCode: 200,
|
|
275
|
+
status: "OK",
|
|
276
|
+
service: "shopify",
|
|
277
|
+
resource: "customers",
|
|
278
|
+
operation: "one",
|
|
279
|
+
data: {
|
|
280
|
+
id: "12345",
|
|
281
|
+
name: "John Doe",
|
|
282
|
+
firstName: "John",
|
|
283
|
+
lastName: "Doe",
|
|
284
|
+
companyName: "Acme Inc.",
|
|
285
|
+
status: "active",
|
|
286
|
+
currency: "USD",
|
|
287
|
+
emails: [
|
|
288
|
+
{
|
|
289
|
+
id: "123",
|
|
290
|
+
email: "elon@musk.com",
|
|
291
|
+
type: "primary",
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: "123",
|
|
295
|
+
email: "elon@musk.com",
|
|
296
|
+
type: "primary",
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: "123",
|
|
300
|
+
email: "elon@musk.com",
|
|
301
|
+
type: "primary",
|
|
302
|
+
},
|
|
303
|
+
],
|
|
304
|
+
phoneNumbers: [
|
|
305
|
+
{
|
|
306
|
+
id: "12345",
|
|
307
|
+
countryCode: "1",
|
|
308
|
+
areaCode: "323",
|
|
309
|
+
number: "111-111-1111",
|
|
310
|
+
extension: "105",
|
|
311
|
+
type: "primary",
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
id: "12345",
|
|
315
|
+
countryCode: "1",
|
|
316
|
+
areaCode: "323",
|
|
317
|
+
number: "111-111-1111",
|
|
318
|
+
extension: "105",
|
|
319
|
+
type: "primary",
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
addresses: [
|
|
323
|
+
{
|
|
324
|
+
type: "billing",
|
|
325
|
+
id: "12345",
|
|
326
|
+
line1: "Main street",
|
|
327
|
+
line2: "apt #",
|
|
328
|
+
city: "Anytown",
|
|
329
|
+
state: "Ohio",
|
|
330
|
+
postalCode: "12345",
|
|
331
|
+
country: "US",
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
type: "billing",
|
|
335
|
+
id: "12345",
|
|
336
|
+
line1: "Main street",
|
|
337
|
+
line2: "apt #",
|
|
338
|
+
city: "Anytown",
|
|
339
|
+
state: "Ohio",
|
|
340
|
+
postalCode: "12345",
|
|
341
|
+
country: "US",
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
orders: [
|
|
345
|
+
{
|
|
346
|
+
id: "12345",
|
|
347
|
+
total: "199.99",
|
|
348
|
+
status: "active",
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: "12345",
|
|
352
|
+
total: "199.99",
|
|
353
|
+
status: "active",
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
357
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
});
|
|
@@ -0,0 +1,319 @@
|
|
|
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("Apideck Departments Hris Departments All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("hris.departmentsAll");
|
|
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.hris.departments.list({
|
|
19
|
+
serviceId: "salesforce",
|
|
20
|
+
passThrough: {
|
|
21
|
+
"search": "San Francisco",
|
|
22
|
+
},
|
|
23
|
+
fields: "id,updated_at",
|
|
24
|
+
});
|
|
25
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
26
|
+
expect(result.getDepartmentsResponse).toBeDefined();
|
|
27
|
+
expect(result.getDepartmentsResponse).toEqual({
|
|
28
|
+
statusCode: 200,
|
|
29
|
+
status: "OK",
|
|
30
|
+
service: "workday",
|
|
31
|
+
resource: "Departments",
|
|
32
|
+
operation: "all",
|
|
33
|
+
data: [
|
|
34
|
+
{
|
|
35
|
+
id: "12345",
|
|
36
|
+
parentId: "22345",
|
|
37
|
+
name: "R&D",
|
|
38
|
+
code: "2",
|
|
39
|
+
description: "R&D",
|
|
40
|
+
updatedBy: "12345",
|
|
41
|
+
createdBy: "12345",
|
|
42
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
43
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
44
|
+
passThrough: [
|
|
45
|
+
{
|
|
46
|
+
serviceId: "<id>",
|
|
47
|
+
extendPaths: [
|
|
48
|
+
{
|
|
49
|
+
path: "$.nested.property",
|
|
50
|
+
value: {
|
|
51
|
+
"TaxClassificationRef": {
|
|
52
|
+
"value": "EUC-99990201-V1-00020000",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
path: "$.nested.property",
|
|
58
|
+
value: {
|
|
59
|
+
"TaxClassificationRef": {
|
|
60
|
+
"value": "EUC-99990201-V1-00020000",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
path: "$.nested.property",
|
|
66
|
+
value: {
|
|
67
|
+
"TaxClassificationRef": {
|
|
68
|
+
"value": "EUC-99990201-V1-00020000",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
serviceId: "<id>",
|
|
76
|
+
extendPaths: [
|
|
77
|
+
{
|
|
78
|
+
path: "$.nested.property",
|
|
79
|
+
value: {
|
|
80
|
+
"TaxClassificationRef": {
|
|
81
|
+
"value": "EUC-99990201-V1-00020000",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "12345",
|
|
91
|
+
parentId: "22345",
|
|
92
|
+
name: "R&D",
|
|
93
|
+
code: "2",
|
|
94
|
+
description: "R&D",
|
|
95
|
+
updatedBy: "12345",
|
|
96
|
+
createdBy: "12345",
|
|
97
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
98
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
99
|
+
passThrough: [
|
|
100
|
+
{
|
|
101
|
+
serviceId: "<id>",
|
|
102
|
+
extendPaths: [
|
|
103
|
+
{
|
|
104
|
+
path: "$.nested.property",
|
|
105
|
+
value: {
|
|
106
|
+
"TaxClassificationRef": {
|
|
107
|
+
"value": "EUC-99990201-V1-00020000",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "12345",
|
|
117
|
+
parentId: "22345",
|
|
118
|
+
name: "R&D",
|
|
119
|
+
code: "2",
|
|
120
|
+
description: "R&D",
|
|
121
|
+
updatedBy: "12345",
|
|
122
|
+
createdBy: "12345",
|
|
123
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
124
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
125
|
+
passThrough: [
|
|
126
|
+
{
|
|
127
|
+
serviceId: "<id>",
|
|
128
|
+
extendPaths: [
|
|
129
|
+
{
|
|
130
|
+
path: "$.nested.property",
|
|
131
|
+
value: {
|
|
132
|
+
"TaxClassificationRef": {
|
|
133
|
+
"value": "EUC-99990201-V1-00020000",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
path: "$.nested.property",
|
|
139
|
+
value: {
|
|
140
|
+
"TaxClassificationRef": {
|
|
141
|
+
"value": "EUC-99990201-V1-00020000",
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
serviceId: "<id>",
|
|
149
|
+
extendPaths: [
|
|
150
|
+
{
|
|
151
|
+
path: "$.nested.property",
|
|
152
|
+
value: {
|
|
153
|
+
"TaxClassificationRef": {
|
|
154
|
+
"value": "EUC-99990201-V1-00020000",
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
meta: {
|
|
164
|
+
itemsOnPage: 50,
|
|
165
|
+
cursors: {
|
|
166
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
167
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
168
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
links: {
|
|
172
|
+
previous:
|
|
173
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
174
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
175
|
+
next:
|
|
176
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it.skip("Apideck Departments Hris Departments Add", async () => {
|
|
182
|
+
assert.fail(
|
|
183
|
+
"incomplete test found please make sure to address the following errors: [`workflow step hris.departmentsAdd.test referencing operation hris.departmentsAdd with expression in requestBody with type not currently supported`, `workflow step hris.departmentsAdd.test referencing operation hris.departmentsAdd with expression in requestBody with type not currently supported`, `workflow step hris.departmentsAdd.test referencing operation hris.departmentsAdd with expression in requestBody with type not currently supported`, `workflow step hris.departmentsAdd.test referencing operation hris.departmentsAdd with expression in requestBody with type not currently supported`]",
|
|
184
|
+
);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test("Apideck Departments Hris Departments One", async () => {
|
|
188
|
+
const testHttpClient = createTestHTTPClient("hris.departmentsOne");
|
|
189
|
+
|
|
190
|
+
const apideck = new Apideck({
|
|
191
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
192
|
+
httpClient: testHttpClient,
|
|
193
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const result = await apideck.hris.departments.get({
|
|
197
|
+
id: "<id>",
|
|
198
|
+
serviceId: "salesforce",
|
|
199
|
+
fields: "id,updated_at",
|
|
200
|
+
});
|
|
201
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
202
|
+
expect(result.getDepartmentResponse).toBeDefined();
|
|
203
|
+
expect(result.getDepartmentResponse).toEqual({
|
|
204
|
+
statusCode: 200,
|
|
205
|
+
status: "OK",
|
|
206
|
+
service: "workday",
|
|
207
|
+
resource: "Departments",
|
|
208
|
+
operation: "one",
|
|
209
|
+
data: {
|
|
210
|
+
id: "12345",
|
|
211
|
+
parentId: "22345",
|
|
212
|
+
name: "R&D",
|
|
213
|
+
code: "2",
|
|
214
|
+
description: "R&D",
|
|
215
|
+
updatedBy: "12345",
|
|
216
|
+
createdBy: "12345",
|
|
217
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
218
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
219
|
+
passThrough: [
|
|
220
|
+
{
|
|
221
|
+
serviceId: "<id>",
|
|
222
|
+
extendPaths: [
|
|
223
|
+
{
|
|
224
|
+
path: "$.nested.property",
|
|
225
|
+
value: {
|
|
226
|
+
"TaxClassificationRef": {
|
|
227
|
+
"value": "EUC-99990201-V1-00020000",
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
path: "$.nested.property",
|
|
233
|
+
value: {
|
|
234
|
+
"TaxClassificationRef": {
|
|
235
|
+
"value": "EUC-99990201-V1-00020000",
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
serviceId: "<id>",
|
|
243
|
+
extendPaths: [
|
|
244
|
+
{
|
|
245
|
+
path: "$.nested.property",
|
|
246
|
+
value: {
|
|
247
|
+
"TaxClassificationRef": {
|
|
248
|
+
"value": "EUC-99990201-V1-00020000",
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
path: "$.nested.property",
|
|
254
|
+
value: {
|
|
255
|
+
"TaxClassificationRef": {
|
|
256
|
+
"value": "EUC-99990201-V1-00020000",
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
serviceId: "<id>",
|
|
264
|
+
extendPaths: [
|
|
265
|
+
{
|
|
266
|
+
path: "$.nested.property",
|
|
267
|
+
value: {
|
|
268
|
+
"TaxClassificationRef": {
|
|
269
|
+
"value": "EUC-99990201-V1-00020000",
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
path: "$.nested.property",
|
|
275
|
+
value: {
|
|
276
|
+
"TaxClassificationRef": {
|
|
277
|
+
"value": "EUC-99990201-V1-00020000",
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it.skip("Apideck Departments Hris Departments Update", async () => {
|
|
289
|
+
assert.fail(
|
|
290
|
+
"incomplete test found please make sure to address the following errors: [`workflow step hris.departmentsUpdate.test referencing operation hris.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step hris.departmentsUpdate.test referencing operation hris.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step hris.departmentsUpdate.test referencing operation hris.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step hris.departmentsUpdate.test referencing operation hris.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step hris.departmentsUpdate.test referencing operation hris.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step hris.departmentsUpdate.test referencing operation hris.departmentsUpdate with expression in requestBody with type not currently supported`, `workflow step hris.departmentsUpdate.test referencing operation hris.departmentsUpdate with expression in requestBody with type not currently supported`]",
|
|
291
|
+
);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
test("Apideck Departments Hris Departments Delete", async () => {
|
|
295
|
+
const testHttpClient = createTestHTTPClient("hris.departmentsDelete");
|
|
296
|
+
|
|
297
|
+
const apideck = new Apideck({
|
|
298
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
299
|
+
httpClient: testHttpClient,
|
|
300
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
const result = await apideck.hris.departments.delete({
|
|
304
|
+
id: "<id>",
|
|
305
|
+
serviceId: "salesforce",
|
|
306
|
+
});
|
|
307
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
308
|
+
expect(result.deleteDepartmentResponse).toBeDefined();
|
|
309
|
+
expect(result.deleteDepartmentResponse).toEqual({
|
|
310
|
+
statusCode: 200,
|
|
311
|
+
status: "OK",
|
|
312
|
+
service: "workday",
|
|
313
|
+
resource: "Departments",
|
|
314
|
+
operation: "delete",
|
|
315
|
+
data: {
|
|
316
|
+
id: "12345",
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
});
|