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