@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,594 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { assert, expect, it, test } from "vitest";
|
|
6
|
+
import { Apideck } from "../index.js";
|
|
7
|
+
import { RFCDate } from "../types/index.js";
|
|
8
|
+
import { createTestHTTPClient } from "./testclient.js";
|
|
9
|
+
|
|
10
|
+
test("Ledgeraccounts Accounting Ledger Accounts All", async () => {
|
|
11
|
+
const testHttpClient = createTestHTTPClient("accounting.ledgerAccountsAll");
|
|
12
|
+
|
|
13
|
+
const apideck = new Apideck({
|
|
14
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
15
|
+
httpClient: testHttpClient,
|
|
16
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const result = await apideck.accounting.ledgerAccounts.list({
|
|
20
|
+
serviceId: "salesforce",
|
|
21
|
+
filter: {
|
|
22
|
+
updatedSince: new Date("2020-09-30T07:43:32.000Z"),
|
|
23
|
+
},
|
|
24
|
+
sort: {
|
|
25
|
+
by: "updated_at",
|
|
26
|
+
},
|
|
27
|
+
passThrough: {
|
|
28
|
+
"search": "San Francisco",
|
|
29
|
+
},
|
|
30
|
+
fields: "id,updated_at",
|
|
31
|
+
});
|
|
32
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
33
|
+
expect(result.getLedgerAccountsResponse).toBeDefined();
|
|
34
|
+
expect(result.getLedgerAccountsResponse).toEqual({
|
|
35
|
+
statusCode: 200,
|
|
36
|
+
status: "OK",
|
|
37
|
+
service: "xero",
|
|
38
|
+
resource: "ledger-accounts",
|
|
39
|
+
operation: "all",
|
|
40
|
+
data: [
|
|
41
|
+
{
|
|
42
|
+
id: "12345",
|
|
43
|
+
displayId: "1-12345",
|
|
44
|
+
code: "453",
|
|
45
|
+
classification: "asset",
|
|
46
|
+
type: "bank",
|
|
47
|
+
subType: "CHECKING_ACCOUNT",
|
|
48
|
+
name: "Bank account",
|
|
49
|
+
fullyQualifiedName: "Asset.Bank.Checking_Account",
|
|
50
|
+
description: "Main checking account",
|
|
51
|
+
openingBalance: 75000,
|
|
52
|
+
currentBalance: 20000,
|
|
53
|
+
currency: "USD",
|
|
54
|
+
taxType: "NONE",
|
|
55
|
+
taxRate: {
|
|
56
|
+
id: "123456",
|
|
57
|
+
code: "N-T",
|
|
58
|
+
name: "GST on Purchases",
|
|
59
|
+
rate: 10,
|
|
60
|
+
},
|
|
61
|
+
level: 1,
|
|
62
|
+
active: true,
|
|
63
|
+
status: "active",
|
|
64
|
+
header: true,
|
|
65
|
+
bankAccount: {
|
|
66
|
+
bankName: "Monzo",
|
|
67
|
+
accountNumber: "123465",
|
|
68
|
+
accountName: "SPACEX LLC",
|
|
69
|
+
accountType: "credit_card",
|
|
70
|
+
iban: "CH2989144532982975332",
|
|
71
|
+
bic: "AUDSCHGGXXX",
|
|
72
|
+
routingNumber: "012345678",
|
|
73
|
+
bsbNumber: "062-001",
|
|
74
|
+
branchIdentifier: "001",
|
|
75
|
+
bankCode: "BNH",
|
|
76
|
+
currency: "USD",
|
|
77
|
+
},
|
|
78
|
+
categories: [
|
|
79
|
+
{
|
|
80
|
+
id: "12345",
|
|
81
|
+
name: "Finance Charges Expense",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "12345",
|
|
85
|
+
name: "Finance Charges Expense",
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
parentAccount: {
|
|
89
|
+
id: "12345",
|
|
90
|
+
name: "Bank Accounts",
|
|
91
|
+
displayId: "1-1100",
|
|
92
|
+
},
|
|
93
|
+
subAccount: false,
|
|
94
|
+
subAccounts: [
|
|
95
|
+
{
|
|
96
|
+
id: "12345",
|
|
97
|
+
accountSubName: "Petty Cash",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "12345",
|
|
101
|
+
accountSubName: "Petty Cash",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "12345",
|
|
105
|
+
accountSubName: "Petty Cash",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
lastReconciliationDate: new RFCDate("2020-09-30"),
|
|
109
|
+
customFields: [
|
|
110
|
+
{
|
|
111
|
+
id: "2389328923893298",
|
|
112
|
+
name: "employee_level",
|
|
113
|
+
description: "Employee Level",
|
|
114
|
+
value: 10,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
rowVersion: "1-12345",
|
|
118
|
+
updatedBy: "12345",
|
|
119
|
+
createdBy: "12345",
|
|
120
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
121
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
122
|
+
passThrough: [
|
|
123
|
+
{
|
|
124
|
+
serviceId: "<id>",
|
|
125
|
+
extendPaths: [
|
|
126
|
+
{
|
|
127
|
+
path: "$.nested.property",
|
|
128
|
+
value: {
|
|
129
|
+
"TaxClassificationRef": {
|
|
130
|
+
"value": "EUC-99990201-V1-00020000",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
path: "$.nested.property",
|
|
136
|
+
value: {
|
|
137
|
+
"TaxClassificationRef": {
|
|
138
|
+
"value": "EUC-99990201-V1-00020000",
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "12345",
|
|
148
|
+
displayId: "1-12345",
|
|
149
|
+
code: "453",
|
|
150
|
+
classification: "asset",
|
|
151
|
+
type: "bank",
|
|
152
|
+
subType: "CHECKING_ACCOUNT",
|
|
153
|
+
name: "Bank account",
|
|
154
|
+
fullyQualifiedName: "Asset.Bank.Checking_Account",
|
|
155
|
+
description: "Main checking account",
|
|
156
|
+
openingBalance: 75000,
|
|
157
|
+
currentBalance: 20000,
|
|
158
|
+
currency: "USD",
|
|
159
|
+
taxType: "NONE",
|
|
160
|
+
taxRate: {
|
|
161
|
+
id: "123456",
|
|
162
|
+
code: "N-T",
|
|
163
|
+
name: "GST on Purchases",
|
|
164
|
+
rate: 10,
|
|
165
|
+
},
|
|
166
|
+
level: 1,
|
|
167
|
+
active: true,
|
|
168
|
+
status: "active",
|
|
169
|
+
header: true,
|
|
170
|
+
bankAccount: {
|
|
171
|
+
bankName: "Monzo",
|
|
172
|
+
accountNumber: "123465",
|
|
173
|
+
accountName: "SPACEX LLC",
|
|
174
|
+
accountType: "credit_card",
|
|
175
|
+
iban: "CH2989144532982975332",
|
|
176
|
+
bic: "AUDSCHGGXXX",
|
|
177
|
+
routingNumber: "012345678",
|
|
178
|
+
bsbNumber: "062-001",
|
|
179
|
+
branchIdentifier: "001",
|
|
180
|
+
bankCode: "BNH",
|
|
181
|
+
currency: "USD",
|
|
182
|
+
},
|
|
183
|
+
categories: [
|
|
184
|
+
{
|
|
185
|
+
id: "12345",
|
|
186
|
+
name: "Finance Charges Expense",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: "12345",
|
|
190
|
+
name: "Finance Charges Expense",
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
parentAccount: {
|
|
194
|
+
id: "12345",
|
|
195
|
+
name: "Bank Accounts",
|
|
196
|
+
displayId: "1-1100",
|
|
197
|
+
},
|
|
198
|
+
subAccount: false,
|
|
199
|
+
subAccounts: [
|
|
200
|
+
{
|
|
201
|
+
id: "12345",
|
|
202
|
+
accountSubName: "Petty Cash",
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
lastReconciliationDate: new RFCDate("2020-09-30"),
|
|
206
|
+
customFields: [
|
|
207
|
+
{
|
|
208
|
+
id: "2389328923893298",
|
|
209
|
+
name: "employee_level",
|
|
210
|
+
description: "Employee Level",
|
|
211
|
+
value: "Uses Salesforce and Marketo",
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "2389328923893298",
|
|
215
|
+
name: "employee_level",
|
|
216
|
+
description: "Employee Level",
|
|
217
|
+
value: "Uses Salesforce and Marketo",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "2389328923893298",
|
|
221
|
+
name: "employee_level",
|
|
222
|
+
description: "Employee Level",
|
|
223
|
+
value: [
|
|
224
|
+
"<value>",
|
|
225
|
+
"<value>",
|
|
226
|
+
],
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
rowVersion: "1-12345",
|
|
230
|
+
updatedBy: "12345",
|
|
231
|
+
createdBy: "12345",
|
|
232
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
233
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
234
|
+
passThrough: [
|
|
235
|
+
{
|
|
236
|
+
serviceId: "<id>",
|
|
237
|
+
extendPaths: [
|
|
238
|
+
{
|
|
239
|
+
path: "$.nested.property",
|
|
240
|
+
value: {
|
|
241
|
+
"TaxClassificationRef": {
|
|
242
|
+
"value": "EUC-99990201-V1-00020000",
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
serviceId: "<id>",
|
|
250
|
+
extendPaths: [
|
|
251
|
+
{
|
|
252
|
+
path: "$.nested.property",
|
|
253
|
+
value: {
|
|
254
|
+
"TaxClassificationRef": {
|
|
255
|
+
"value": "EUC-99990201-V1-00020000",
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: "12345",
|
|
265
|
+
displayId: "1-12345",
|
|
266
|
+
code: "453",
|
|
267
|
+
classification: "asset",
|
|
268
|
+
type: "bank",
|
|
269
|
+
subType: "CHECKING_ACCOUNT",
|
|
270
|
+
name: "Bank account",
|
|
271
|
+
fullyQualifiedName: "Asset.Bank.Checking_Account",
|
|
272
|
+
description: "Main checking account",
|
|
273
|
+
openingBalance: 75000,
|
|
274
|
+
currentBalance: 20000,
|
|
275
|
+
currency: "USD",
|
|
276
|
+
taxType: "NONE",
|
|
277
|
+
taxRate: {
|
|
278
|
+
id: "123456",
|
|
279
|
+
code: "N-T",
|
|
280
|
+
name: "GST on Purchases",
|
|
281
|
+
rate: 10,
|
|
282
|
+
},
|
|
283
|
+
level: 1,
|
|
284
|
+
active: true,
|
|
285
|
+
status: "active",
|
|
286
|
+
header: true,
|
|
287
|
+
bankAccount: {
|
|
288
|
+
bankName: "Monzo",
|
|
289
|
+
accountNumber: "123465",
|
|
290
|
+
accountName: "SPACEX LLC",
|
|
291
|
+
accountType: "credit_card",
|
|
292
|
+
iban: "CH2989144532982975332",
|
|
293
|
+
bic: "AUDSCHGGXXX",
|
|
294
|
+
routingNumber: "012345678",
|
|
295
|
+
bsbNumber: "062-001",
|
|
296
|
+
branchIdentifier: "001",
|
|
297
|
+
bankCode: "BNH",
|
|
298
|
+
currency: "USD",
|
|
299
|
+
},
|
|
300
|
+
categories: [
|
|
301
|
+
{
|
|
302
|
+
id: "12345",
|
|
303
|
+
name: "Finance Charges Expense",
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: "12345",
|
|
307
|
+
name: "Finance Charges Expense",
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
parentAccount: {
|
|
311
|
+
id: "12345",
|
|
312
|
+
name: "Bank Accounts",
|
|
313
|
+
displayId: "1-1100",
|
|
314
|
+
},
|
|
315
|
+
subAccount: false,
|
|
316
|
+
subAccounts: [
|
|
317
|
+
{
|
|
318
|
+
id: "12345",
|
|
319
|
+
accountSubName: "Petty Cash",
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
id: "12345",
|
|
323
|
+
accountSubName: "Petty Cash",
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
lastReconciliationDate: new RFCDate("2020-09-30"),
|
|
327
|
+
customFields: [
|
|
328
|
+
{
|
|
329
|
+
id: "2389328923893298",
|
|
330
|
+
name: "employee_level",
|
|
331
|
+
description: "Employee Level",
|
|
332
|
+
value: [
|
|
333
|
+
{},
|
|
334
|
+
{},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
],
|
|
338
|
+
rowVersion: "1-12345",
|
|
339
|
+
updatedBy: "12345",
|
|
340
|
+
createdBy: "12345",
|
|
341
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
342
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
343
|
+
passThrough: [
|
|
344
|
+
{
|
|
345
|
+
serviceId: "<id>",
|
|
346
|
+
extendPaths: [
|
|
347
|
+
{
|
|
348
|
+
path: "$.nested.property",
|
|
349
|
+
value: {
|
|
350
|
+
"TaxClassificationRef": {
|
|
351
|
+
"value": "EUC-99990201-V1-00020000",
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
path: "$.nested.property",
|
|
357
|
+
value: {
|
|
358
|
+
"TaxClassificationRef": {
|
|
359
|
+
"value": "EUC-99990201-V1-00020000",
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
serviceId: "<id>",
|
|
367
|
+
extendPaths: [
|
|
368
|
+
{
|
|
369
|
+
path: "$.nested.property",
|
|
370
|
+
value: {
|
|
371
|
+
"TaxClassificationRef": {
|
|
372
|
+
"value": "EUC-99990201-V1-00020000",
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
serviceId: "<id>",
|
|
380
|
+
extendPaths: [
|
|
381
|
+
{
|
|
382
|
+
path: "$.nested.property",
|
|
383
|
+
value: {
|
|
384
|
+
"TaxClassificationRef": {
|
|
385
|
+
"value": "EUC-99990201-V1-00020000",
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
],
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
},
|
|
393
|
+
],
|
|
394
|
+
meta: {
|
|
395
|
+
itemsOnPage: 50,
|
|
396
|
+
cursors: {
|
|
397
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
398
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
399
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
links: {
|
|
403
|
+
previous:
|
|
404
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
405
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
406
|
+
next:
|
|
407
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
it.skip("Ledgeraccounts Accounting Ledger Accounts Add", async () => {
|
|
413
|
+
assert.fail(
|
|
414
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.ledgerAccountsAdd.test referencing operation accounting.ledgerAccountsAdd with expression in requestBody with type not currently supported`]",
|
|
415
|
+
);
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
test("Ledgeraccounts Accounting Ledger Accounts One", async () => {
|
|
419
|
+
const testHttpClient = createTestHTTPClient("accounting.ledgerAccountsOne");
|
|
420
|
+
|
|
421
|
+
const apideck = new Apideck({
|
|
422
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
423
|
+
httpClient: testHttpClient,
|
|
424
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
const result = await apideck.accounting.ledgerAccounts.get({
|
|
428
|
+
id: "<id>",
|
|
429
|
+
serviceId: "salesforce",
|
|
430
|
+
fields: "id,updated_at",
|
|
431
|
+
});
|
|
432
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
433
|
+
expect(result.getLedgerAccountResponse).toBeDefined();
|
|
434
|
+
expect(result.getLedgerAccountResponse).toEqual({
|
|
435
|
+
statusCode: 200,
|
|
436
|
+
status: "OK",
|
|
437
|
+
service: "xero",
|
|
438
|
+
resource: "ledger-accounts",
|
|
439
|
+
operation: "one",
|
|
440
|
+
data: {
|
|
441
|
+
id: "12345",
|
|
442
|
+
displayId: "1-12345",
|
|
443
|
+
code: "453",
|
|
444
|
+
classification: "asset",
|
|
445
|
+
type: "bank",
|
|
446
|
+
subType: "CHECKING_ACCOUNT",
|
|
447
|
+
name: "Bank account",
|
|
448
|
+
fullyQualifiedName: "Asset.Bank.Checking_Account",
|
|
449
|
+
description: "Main checking account",
|
|
450
|
+
openingBalance: 75000,
|
|
451
|
+
currentBalance: 20000,
|
|
452
|
+
currency: "USD",
|
|
453
|
+
taxType: "NONE",
|
|
454
|
+
taxRate: {
|
|
455
|
+
id: "123456",
|
|
456
|
+
code: "N-T",
|
|
457
|
+
name: "GST on Purchases",
|
|
458
|
+
rate: 10,
|
|
459
|
+
},
|
|
460
|
+
level: 1,
|
|
461
|
+
active: true,
|
|
462
|
+
status: "active",
|
|
463
|
+
header: true,
|
|
464
|
+
bankAccount: {
|
|
465
|
+
bankName: "Monzo",
|
|
466
|
+
accountNumber: "123465",
|
|
467
|
+
accountName: "SPACEX LLC",
|
|
468
|
+
accountType: "credit_card",
|
|
469
|
+
iban: "CH2989144532982975332",
|
|
470
|
+
bic: "AUDSCHGGXXX",
|
|
471
|
+
routingNumber: "012345678",
|
|
472
|
+
bsbNumber: "062-001",
|
|
473
|
+
branchIdentifier: "001",
|
|
474
|
+
bankCode: "BNH",
|
|
475
|
+
currency: "USD",
|
|
476
|
+
},
|
|
477
|
+
categories: [
|
|
478
|
+
{
|
|
479
|
+
id: "12345",
|
|
480
|
+
name: "Finance Charges Expense",
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
id: "12345",
|
|
484
|
+
name: "Finance Charges Expense",
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
id: "12345",
|
|
488
|
+
name: "Finance Charges Expense",
|
|
489
|
+
},
|
|
490
|
+
],
|
|
491
|
+
parentAccount: {
|
|
492
|
+
id: "12345",
|
|
493
|
+
name: "Bank Accounts",
|
|
494
|
+
displayId: "1-1100",
|
|
495
|
+
},
|
|
496
|
+
subAccount: false,
|
|
497
|
+
subAccounts: [
|
|
498
|
+
{
|
|
499
|
+
id: "12345",
|
|
500
|
+
accountSubName: "Petty Cash",
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
id: "12345",
|
|
504
|
+
accountSubName: "Petty Cash",
|
|
505
|
+
},
|
|
506
|
+
],
|
|
507
|
+
lastReconciliationDate: new RFCDate("2020-09-30"),
|
|
508
|
+
customFields: [
|
|
509
|
+
{
|
|
510
|
+
id: "2389328923893298",
|
|
511
|
+
name: "employee_level",
|
|
512
|
+
description: "Employee Level",
|
|
513
|
+
value: {},
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
id: "2389328923893298",
|
|
517
|
+
name: "employee_level",
|
|
518
|
+
description: "Employee Level",
|
|
519
|
+
value: [
|
|
520
|
+
{},
|
|
521
|
+
],
|
|
522
|
+
},
|
|
523
|
+
],
|
|
524
|
+
rowVersion: "1-12345",
|
|
525
|
+
updatedBy: "12345",
|
|
526
|
+
createdBy: "12345",
|
|
527
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
528
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
529
|
+
passThrough: [
|
|
530
|
+
{
|
|
531
|
+
serviceId: "<id>",
|
|
532
|
+
extendPaths: [
|
|
533
|
+
{
|
|
534
|
+
path: "$.nested.property",
|
|
535
|
+
value: {
|
|
536
|
+
"TaxClassificationRef": {
|
|
537
|
+
"value": "EUC-99990201-V1-00020000",
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
],
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
serviceId: "<id>",
|
|
545
|
+
extendPaths: [
|
|
546
|
+
{
|
|
547
|
+
path: "$.nested.property",
|
|
548
|
+
value: {
|
|
549
|
+
"TaxClassificationRef": {
|
|
550
|
+
"value": "EUC-99990201-V1-00020000",
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
],
|
|
555
|
+
},
|
|
556
|
+
],
|
|
557
|
+
},
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
it.skip("Ledgeraccounts Accounting Ledger Accounts Update", async () => {
|
|
562
|
+
assert.fail(
|
|
563
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.ledgerAccountsUpdate.test referencing operation accounting.ledgerAccountsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.ledgerAccountsUpdate.test referencing operation accounting.ledgerAccountsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.ledgerAccountsUpdate.test referencing operation accounting.ledgerAccountsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.ledgerAccountsUpdate.test referencing operation accounting.ledgerAccountsUpdate with expression in requestBody with type not currently supported`]",
|
|
564
|
+
);
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
test("Ledgeraccounts Accounting Ledger Accounts Delete", async () => {
|
|
568
|
+
const testHttpClient = createTestHTTPClient(
|
|
569
|
+
"accounting.ledgerAccountsDelete",
|
|
570
|
+
);
|
|
571
|
+
|
|
572
|
+
const apideck = new Apideck({
|
|
573
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
574
|
+
httpClient: testHttpClient,
|
|
575
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
const result = await apideck.accounting.ledgerAccounts.delete({
|
|
579
|
+
id: "<id>",
|
|
580
|
+
serviceId: "salesforce",
|
|
581
|
+
});
|
|
582
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
583
|
+
expect(result.deleteLedgerAccountResponse).toBeDefined();
|
|
584
|
+
expect(result.deleteLedgerAccountResponse).toEqual({
|
|
585
|
+
statusCode: 200,
|
|
586
|
+
status: "OK",
|
|
587
|
+
service: "xero",
|
|
588
|
+
resource: "ledger-accounts",
|
|
589
|
+
operation: "delete",
|
|
590
|
+
data: {
|
|
591
|
+
id: "12345",
|
|
592
|
+
},
|
|
593
|
+
});
|
|
594
|
+
});
|