@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,472 @@
|
|
|
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("Taxrates Accounting Tax Rates All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("accounting.taxRatesAll");
|
|
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.taxRates.list({
|
|
19
|
+
serviceId: "salesforce",
|
|
20
|
+
filter: {
|
|
21
|
+
assets: true,
|
|
22
|
+
equity: true,
|
|
23
|
+
expenses: true,
|
|
24
|
+
liabilities: true,
|
|
25
|
+
revenue: true,
|
|
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.getTaxRatesResponse).toBeDefined();
|
|
34
|
+
expect(result.getTaxRatesResponse).toEqual({
|
|
35
|
+
statusCode: 200,
|
|
36
|
+
status: "OK",
|
|
37
|
+
service: "xero",
|
|
38
|
+
resource: "tax-rates",
|
|
39
|
+
operation: "all",
|
|
40
|
+
data: [
|
|
41
|
+
{
|
|
42
|
+
id: "1234",
|
|
43
|
+
name: "GST on Purchases",
|
|
44
|
+
code: "ABN",
|
|
45
|
+
description: "Reduced rate GST Purchases",
|
|
46
|
+
effectiveTaxRate: 10,
|
|
47
|
+
totalTaxRate: 10,
|
|
48
|
+
taxPayableAccountId: "123456",
|
|
49
|
+
taxRemittedAccountId: "123456",
|
|
50
|
+
components: [
|
|
51
|
+
{
|
|
52
|
+
id: "10",
|
|
53
|
+
name: "GST",
|
|
54
|
+
rate: 10,
|
|
55
|
+
compound: true,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "10",
|
|
59
|
+
name: "GST",
|
|
60
|
+
rate: 10,
|
|
61
|
+
compound: true,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
type: "NONE",
|
|
65
|
+
reportTaxType: "NONE",
|
|
66
|
+
originalTaxRateId: "12345",
|
|
67
|
+
status: "active",
|
|
68
|
+
rowVersion: "1-12345",
|
|
69
|
+
updatedBy: "12345",
|
|
70
|
+
createdBy: "12345",
|
|
71
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
72
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
73
|
+
passThrough: [
|
|
74
|
+
{
|
|
75
|
+
serviceId: "<id>",
|
|
76
|
+
extendPaths: [
|
|
77
|
+
{
|
|
78
|
+
path: "$.nested.property",
|
|
79
|
+
value: {
|
|
80
|
+
"TaxClassificationRef": {
|
|
81
|
+
"value": "EUC-99990201-V1-00020000",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
serviceId: "<id>",
|
|
89
|
+
extendPaths: [
|
|
90
|
+
{
|
|
91
|
+
path: "$.nested.property",
|
|
92
|
+
value: {
|
|
93
|
+
"TaxClassificationRef": {
|
|
94
|
+
"value": "EUC-99990201-V1-00020000",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
serviceId: "<id>",
|
|
102
|
+
extendPaths: [
|
|
103
|
+
{
|
|
104
|
+
path: "$.nested.property",
|
|
105
|
+
value: {
|
|
106
|
+
"TaxClassificationRef": {
|
|
107
|
+
"value": "EUC-99990201-V1-00020000",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
customFields: [
|
|
115
|
+
{
|
|
116
|
+
id: "2389328923893298",
|
|
117
|
+
name: "employee_level",
|
|
118
|
+
description: "Employee Level",
|
|
119
|
+
value: {},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: "2389328923893298",
|
|
123
|
+
name: "employee_level",
|
|
124
|
+
description: "Employee Level",
|
|
125
|
+
value: "Uses Salesforce and Marketo",
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "1234",
|
|
131
|
+
name: "GST on Purchases",
|
|
132
|
+
code: "ABN",
|
|
133
|
+
description: "Reduced rate GST Purchases",
|
|
134
|
+
effectiveTaxRate: 10,
|
|
135
|
+
totalTaxRate: 10,
|
|
136
|
+
taxPayableAccountId: "123456",
|
|
137
|
+
taxRemittedAccountId: "123456",
|
|
138
|
+
components: [
|
|
139
|
+
{
|
|
140
|
+
id: "10",
|
|
141
|
+
name: "GST",
|
|
142
|
+
rate: 10,
|
|
143
|
+
compound: true,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "10",
|
|
147
|
+
name: "GST",
|
|
148
|
+
rate: 10,
|
|
149
|
+
compound: true,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "10",
|
|
153
|
+
name: "GST",
|
|
154
|
+
rate: 10,
|
|
155
|
+
compound: true,
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
type: "NONE",
|
|
159
|
+
reportTaxType: "NONE",
|
|
160
|
+
originalTaxRateId: "12345",
|
|
161
|
+
status: "active",
|
|
162
|
+
rowVersion: "1-12345",
|
|
163
|
+
updatedBy: "12345",
|
|
164
|
+
createdBy: "12345",
|
|
165
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
166
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
167
|
+
passThrough: [
|
|
168
|
+
{
|
|
169
|
+
serviceId: "<id>",
|
|
170
|
+
extendPaths: [
|
|
171
|
+
{
|
|
172
|
+
path: "$.nested.property",
|
|
173
|
+
value: {
|
|
174
|
+
"TaxClassificationRef": {
|
|
175
|
+
"value": "EUC-99990201-V1-00020000",
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
customFields: [
|
|
183
|
+
{
|
|
184
|
+
id: "2389328923893298",
|
|
185
|
+
name: "employee_level",
|
|
186
|
+
description: "Employee Level",
|
|
187
|
+
value: {},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: "2389328923893298",
|
|
191
|
+
name: "employee_level",
|
|
192
|
+
description: "Employee Level",
|
|
193
|
+
value: {},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: "2389328923893298",
|
|
197
|
+
name: "employee_level",
|
|
198
|
+
description: "Employee Level",
|
|
199
|
+
value: "Uses Salesforce and Marketo",
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "1234",
|
|
205
|
+
name: "GST on Purchases",
|
|
206
|
+
code: "ABN",
|
|
207
|
+
description: "Reduced rate GST Purchases",
|
|
208
|
+
effectiveTaxRate: 10,
|
|
209
|
+
totalTaxRate: 10,
|
|
210
|
+
taxPayableAccountId: "123456",
|
|
211
|
+
taxRemittedAccountId: "123456",
|
|
212
|
+
components: [
|
|
213
|
+
{
|
|
214
|
+
id: "10",
|
|
215
|
+
name: "GST",
|
|
216
|
+
rate: 10,
|
|
217
|
+
compound: true,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
type: "NONE",
|
|
221
|
+
reportTaxType: "NONE",
|
|
222
|
+
originalTaxRateId: "12345",
|
|
223
|
+
status: "active",
|
|
224
|
+
rowVersion: "1-12345",
|
|
225
|
+
updatedBy: "12345",
|
|
226
|
+
createdBy: "12345",
|
|
227
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
228
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
229
|
+
passThrough: [
|
|
230
|
+
{
|
|
231
|
+
serviceId: "<id>",
|
|
232
|
+
extendPaths: [
|
|
233
|
+
{
|
|
234
|
+
path: "$.nested.property",
|
|
235
|
+
value: {
|
|
236
|
+
"TaxClassificationRef": {
|
|
237
|
+
"value": "EUC-99990201-V1-00020000",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
path: "$.nested.property",
|
|
243
|
+
value: {
|
|
244
|
+
"TaxClassificationRef": {
|
|
245
|
+
"value": "EUC-99990201-V1-00020000",
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
serviceId: "<id>",
|
|
253
|
+
extendPaths: [
|
|
254
|
+
{
|
|
255
|
+
path: "$.nested.property",
|
|
256
|
+
value: {
|
|
257
|
+
"TaxClassificationRef": {
|
|
258
|
+
"value": "EUC-99990201-V1-00020000",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
customFields: [
|
|
266
|
+
{
|
|
267
|
+
id: "2389328923893298",
|
|
268
|
+
name: "employee_level",
|
|
269
|
+
description: "Employee Level",
|
|
270
|
+
value: {},
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: "2389328923893298",
|
|
274
|
+
name: "employee_level",
|
|
275
|
+
description: "Employee Level",
|
|
276
|
+
value: [
|
|
277
|
+
{},
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: "2389328923893298",
|
|
282
|
+
name: "employee_level",
|
|
283
|
+
description: "Employee Level",
|
|
284
|
+
value: "Uses Salesforce and Marketo",
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
meta: {
|
|
290
|
+
itemsOnPage: 50,
|
|
291
|
+
cursors: {
|
|
292
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
293
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
294
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
links: {
|
|
298
|
+
previous:
|
|
299
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
300
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
301
|
+
next:
|
|
302
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it.skip("Taxrates Accounting Tax Rates Add", async () => {
|
|
308
|
+
assert.fail(
|
|
309
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.taxRatesAdd.test referencing operation accounting.taxRatesAdd with expression in requestBody with type not currently supported`, `workflow step accounting.taxRatesAdd.test referencing operation accounting.taxRatesAdd with expression in requestBody with type not currently supported`, `workflow step accounting.taxRatesAdd.test referencing operation accounting.taxRatesAdd with expression in requestBody with type not currently supported`]",
|
|
310
|
+
);
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
test("Taxrates Accounting Tax Rates One", async () => {
|
|
314
|
+
const testHttpClient = createTestHTTPClient("accounting.taxRatesOne");
|
|
315
|
+
|
|
316
|
+
const apideck = new Apideck({
|
|
317
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
318
|
+
httpClient: testHttpClient,
|
|
319
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
const result = await apideck.accounting.taxRates.get({
|
|
323
|
+
id: "<id>",
|
|
324
|
+
serviceId: "salesforce",
|
|
325
|
+
fields: "id,updated_at",
|
|
326
|
+
});
|
|
327
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
328
|
+
expect(result.getTaxRateResponse).toBeDefined();
|
|
329
|
+
expect(result.getTaxRateResponse).toEqual({
|
|
330
|
+
statusCode: 200,
|
|
331
|
+
status: "OK",
|
|
332
|
+
service: "xero",
|
|
333
|
+
resource: "tax-rates",
|
|
334
|
+
operation: "one",
|
|
335
|
+
data: {
|
|
336
|
+
id: "1234",
|
|
337
|
+
name: "GST on Purchases",
|
|
338
|
+
code: "ABN",
|
|
339
|
+
description: "Reduced rate GST Purchases",
|
|
340
|
+
effectiveTaxRate: 10,
|
|
341
|
+
totalTaxRate: 10,
|
|
342
|
+
taxPayableAccountId: "123456",
|
|
343
|
+
taxRemittedAccountId: "123456",
|
|
344
|
+
components: [
|
|
345
|
+
{
|
|
346
|
+
id: "10",
|
|
347
|
+
name: "GST",
|
|
348
|
+
rate: 10,
|
|
349
|
+
compound: true,
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: "10",
|
|
353
|
+
name: "GST",
|
|
354
|
+
rate: 10,
|
|
355
|
+
compound: true,
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
id: "10",
|
|
359
|
+
name: "GST",
|
|
360
|
+
rate: 10,
|
|
361
|
+
compound: true,
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
type: "NONE",
|
|
365
|
+
reportTaxType: "NONE",
|
|
366
|
+
originalTaxRateId: "12345",
|
|
367
|
+
status: "active",
|
|
368
|
+
rowVersion: "1-12345",
|
|
369
|
+
updatedBy: "12345",
|
|
370
|
+
createdBy: "12345",
|
|
371
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
372
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
373
|
+
passThrough: [
|
|
374
|
+
{
|
|
375
|
+
serviceId: "<id>",
|
|
376
|
+
extendPaths: [
|
|
377
|
+
{
|
|
378
|
+
path: "$.nested.property",
|
|
379
|
+
value: {
|
|
380
|
+
"TaxClassificationRef": {
|
|
381
|
+
"value": "EUC-99990201-V1-00020000",
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
path: "$.nested.property",
|
|
387
|
+
value: {
|
|
388
|
+
"TaxClassificationRef": {
|
|
389
|
+
"value": "EUC-99990201-V1-00020000",
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
],
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
serviceId: "<id>",
|
|
397
|
+
extendPaths: [
|
|
398
|
+
{
|
|
399
|
+
path: "$.nested.property",
|
|
400
|
+
value: {
|
|
401
|
+
"TaxClassificationRef": {
|
|
402
|
+
"value": "EUC-99990201-V1-00020000",
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
path: "$.nested.property",
|
|
408
|
+
value: {
|
|
409
|
+
"TaxClassificationRef": {
|
|
410
|
+
"value": "EUC-99990201-V1-00020000",
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
},
|
|
416
|
+
],
|
|
417
|
+
customFields: [
|
|
418
|
+
{
|
|
419
|
+
id: "2389328923893298",
|
|
420
|
+
name: "employee_level",
|
|
421
|
+
description: "Employee Level",
|
|
422
|
+
value: true,
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
id: "2389328923893298",
|
|
426
|
+
name: "employee_level",
|
|
427
|
+
description: "Employee Level",
|
|
428
|
+
value: true,
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
id: "2389328923893298",
|
|
432
|
+
name: "employee_level",
|
|
433
|
+
description: "Employee Level",
|
|
434
|
+
value: 10,
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
},
|
|
438
|
+
});
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
it.skip("Taxrates Accounting Tax Rates Update", async () => {
|
|
442
|
+
assert.fail(
|
|
443
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.taxRatesUpdate.test referencing operation accounting.taxRatesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.taxRatesUpdate.test referencing operation accounting.taxRatesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.taxRatesUpdate.test referencing operation accounting.taxRatesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.taxRatesUpdate.test referencing operation accounting.taxRatesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.taxRatesUpdate.test referencing operation accounting.taxRatesUpdate with expression in requestBody with type not currently supported`]",
|
|
444
|
+
);
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
test("Taxrates Accounting Tax Rates Delete", async () => {
|
|
448
|
+
const testHttpClient = createTestHTTPClient("accounting.taxRatesDelete");
|
|
449
|
+
|
|
450
|
+
const apideck = new Apideck({
|
|
451
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
452
|
+
httpClient: testHttpClient,
|
|
453
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
const result = await apideck.accounting.taxRates.delete({
|
|
457
|
+
id: "<id>",
|
|
458
|
+
serviceId: "salesforce",
|
|
459
|
+
});
|
|
460
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
461
|
+
expect(result.deleteTaxRateResponse).toBeDefined();
|
|
462
|
+
expect(result.deleteTaxRateResponse).toEqual({
|
|
463
|
+
statusCode: 200,
|
|
464
|
+
status: "OK",
|
|
465
|
+
service: "xero",
|
|
466
|
+
resource: "tax-rates",
|
|
467
|
+
operation: "delete",
|
|
468
|
+
data: {
|
|
469
|
+
id: "12345",
|
|
470
|
+
},
|
|
471
|
+
});
|
|
472
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { getRandomValues } from "crypto";
|
|
6
|
+
import { HTTPClient } from "../lib/http.js";
|
|
7
|
+
|
|
8
|
+
export function createTestHTTPClient(testName: string): HTTPClient {
|
|
9
|
+
const httpClient = new HTTPClient({
|
|
10
|
+
fetcher: (request: URL | RequestInfo) => {
|
|
11
|
+
return fetch(request);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const testInstanceId = genTestId();
|
|
16
|
+
|
|
17
|
+
httpClient.addHook("beforeRequest", (request: Request) => {
|
|
18
|
+
const nextRequest = new Request(request, {
|
|
19
|
+
signal: request.signal || AbortSignal.timeout(5000),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
nextRequest.headers.set("x-speakeasy-test-name", testName);
|
|
23
|
+
nextRequest.headers.set("x-speakeasy-test-instance-id", testInstanceId);
|
|
24
|
+
|
|
25
|
+
return nextRequest;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return httpClient;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function genTestId(): string {
|
|
32
|
+
const b = new Uint8Array(16);
|
|
33
|
+
getRandomValues(b);
|
|
34
|
+
|
|
35
|
+
return `${buf2hex(b.slice(0, 4))}-${buf2hex(b.slice(4, 6))}-${
|
|
36
|
+
buf2hex(
|
|
37
|
+
b.slice(6, 8),
|
|
38
|
+
)
|
|
39
|
+
}-${buf2hex(b.slice(8, 10))}-${buf2hex(b.slice(10))}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Helper function to convert buffer to hex string
|
|
43
|
+
function buf2hex(buffer: Uint8Array): string {
|
|
44
|
+
return [...buffer]
|
|
45
|
+
.map((x) => x.toString(16).padStart(2, "0"))
|
|
46
|
+
.join("")
|
|
47
|
+
.toUpperCase();
|
|
48
|
+
}
|