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