@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,561 @@
|
|
|
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("Locations Accounting Locations All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("accounting.locationsAll");
|
|
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.locations.list({
|
|
19
|
+
serviceId: "salesforce",
|
|
20
|
+
fields: "id,updated_at",
|
|
21
|
+
filter: {
|
|
22
|
+
subsidiary: "1",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
26
|
+
expect(result.getAccountingLocationsResponse).toBeDefined();
|
|
27
|
+
expect(result.getAccountingLocationsResponse).toEqual({
|
|
28
|
+
statusCode: 200,
|
|
29
|
+
status: "OK",
|
|
30
|
+
service: "xero",
|
|
31
|
+
resource: "subsidiaries",
|
|
32
|
+
operation: "all",
|
|
33
|
+
data: [
|
|
34
|
+
{
|
|
35
|
+
id: "12345",
|
|
36
|
+
parentId: "12345",
|
|
37
|
+
companyName: "SpaceX",
|
|
38
|
+
displayName: "11 UT - South Jordan",
|
|
39
|
+
status: "active",
|
|
40
|
+
addresses: [
|
|
41
|
+
{
|
|
42
|
+
id: "123",
|
|
43
|
+
type: "primary",
|
|
44
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
45
|
+
name: "HQ US",
|
|
46
|
+
line1: "Main street",
|
|
47
|
+
line2: "apt #",
|
|
48
|
+
line3: "Suite #",
|
|
49
|
+
line4: "delivery instructions",
|
|
50
|
+
streetNumber: "25",
|
|
51
|
+
city: "San Francisco",
|
|
52
|
+
state: "CA",
|
|
53
|
+
postalCode: "94104",
|
|
54
|
+
country: "US",
|
|
55
|
+
latitude: "40.759211",
|
|
56
|
+
longitude: "-73.984638",
|
|
57
|
+
county: "Santa Clara",
|
|
58
|
+
contactName: "Elon Musk",
|
|
59
|
+
salutation: "Mr",
|
|
60
|
+
phoneNumber: "111-111-1111",
|
|
61
|
+
fax: "122-111-1111",
|
|
62
|
+
email: "elon@musk.com",
|
|
63
|
+
website: "https://elonmusk.com",
|
|
64
|
+
notes: "Address notes or delivery instructions.",
|
|
65
|
+
rowVersion: "1-12345",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "123",
|
|
69
|
+
type: "primary",
|
|
70
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
71
|
+
name: "HQ US",
|
|
72
|
+
line1: "Main street",
|
|
73
|
+
line2: "apt #",
|
|
74
|
+
line3: "Suite #",
|
|
75
|
+
line4: "delivery instructions",
|
|
76
|
+
streetNumber: "25",
|
|
77
|
+
city: "San Francisco",
|
|
78
|
+
state: "CA",
|
|
79
|
+
postalCode: "94104",
|
|
80
|
+
country: "US",
|
|
81
|
+
latitude: "40.759211",
|
|
82
|
+
longitude: "-73.984638",
|
|
83
|
+
county: "Santa Clara",
|
|
84
|
+
contactName: "Elon Musk",
|
|
85
|
+
salutation: "Mr",
|
|
86
|
+
phoneNumber: "111-111-1111",
|
|
87
|
+
fax: "122-111-1111",
|
|
88
|
+
email: "elon@musk.com",
|
|
89
|
+
website: "https://elonmusk.com",
|
|
90
|
+
notes: "Address notes or delivery instructions.",
|
|
91
|
+
rowVersion: "1-12345",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
subsidiaries: [
|
|
95
|
+
{
|
|
96
|
+
id: "12345",
|
|
97
|
+
name: "SpaceX",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "12345",
|
|
101
|
+
name: "SpaceX",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "12345",
|
|
105
|
+
name: "SpaceX",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
rowVersion: "1-12345",
|
|
109
|
+
updatedBy: "12345",
|
|
110
|
+
createdBy: "12345",
|
|
111
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
112
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
113
|
+
passThrough: [
|
|
114
|
+
{
|
|
115
|
+
serviceId: "<id>",
|
|
116
|
+
extendPaths: [
|
|
117
|
+
{
|
|
118
|
+
path: "$.nested.property",
|
|
119
|
+
value: {
|
|
120
|
+
"TaxClassificationRef": {
|
|
121
|
+
"value": "EUC-99990201-V1-00020000",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "12345",
|
|
131
|
+
parentId: "12345",
|
|
132
|
+
companyName: "SpaceX",
|
|
133
|
+
displayName: "11 UT - South Jordan",
|
|
134
|
+
status: "active",
|
|
135
|
+
addresses: [
|
|
136
|
+
{
|
|
137
|
+
id: "123",
|
|
138
|
+
type: "primary",
|
|
139
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
140
|
+
name: "HQ US",
|
|
141
|
+
line1: "Main street",
|
|
142
|
+
line2: "apt #",
|
|
143
|
+
line3: "Suite #",
|
|
144
|
+
line4: "delivery instructions",
|
|
145
|
+
streetNumber: "25",
|
|
146
|
+
city: "San Francisco",
|
|
147
|
+
state: "CA",
|
|
148
|
+
postalCode: "94104",
|
|
149
|
+
country: "US",
|
|
150
|
+
latitude: "40.759211",
|
|
151
|
+
longitude: "-73.984638",
|
|
152
|
+
county: "Santa Clara",
|
|
153
|
+
contactName: "Elon Musk",
|
|
154
|
+
salutation: "Mr",
|
|
155
|
+
phoneNumber: "111-111-1111",
|
|
156
|
+
fax: "122-111-1111",
|
|
157
|
+
email: "elon@musk.com",
|
|
158
|
+
website: "https://elonmusk.com",
|
|
159
|
+
notes: "Address notes or delivery instructions.",
|
|
160
|
+
rowVersion: "1-12345",
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
subsidiaries: [
|
|
164
|
+
{
|
|
165
|
+
id: "12345",
|
|
166
|
+
name: "SpaceX",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "12345",
|
|
170
|
+
name: "SpaceX",
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
rowVersion: "1-12345",
|
|
174
|
+
updatedBy: "12345",
|
|
175
|
+
createdBy: "12345",
|
|
176
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
177
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
178
|
+
passThrough: [
|
|
179
|
+
{
|
|
180
|
+
serviceId: "<id>",
|
|
181
|
+
extendPaths: [
|
|
182
|
+
{
|
|
183
|
+
path: "$.nested.property",
|
|
184
|
+
value: {
|
|
185
|
+
"TaxClassificationRef": {
|
|
186
|
+
"value": "EUC-99990201-V1-00020000",
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
serviceId: "<id>",
|
|
194
|
+
extendPaths: [
|
|
195
|
+
{
|
|
196
|
+
path: "$.nested.property",
|
|
197
|
+
value: {
|
|
198
|
+
"TaxClassificationRef": {
|
|
199
|
+
"value": "EUC-99990201-V1-00020000",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
path: "$.nested.property",
|
|
205
|
+
value: {
|
|
206
|
+
"TaxClassificationRef": {
|
|
207
|
+
"value": "EUC-99990201-V1-00020000",
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
path: "$.nested.property",
|
|
213
|
+
value: {
|
|
214
|
+
"TaxClassificationRef": {
|
|
215
|
+
"value": "EUC-99990201-V1-00020000",
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: "12345",
|
|
225
|
+
parentId: "12345",
|
|
226
|
+
companyName: "SpaceX",
|
|
227
|
+
displayName: "11 UT - South Jordan",
|
|
228
|
+
status: "active",
|
|
229
|
+
addresses: [
|
|
230
|
+
{
|
|
231
|
+
id: "123",
|
|
232
|
+
type: "primary",
|
|
233
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
234
|
+
name: "HQ US",
|
|
235
|
+
line1: "Main street",
|
|
236
|
+
line2: "apt #",
|
|
237
|
+
line3: "Suite #",
|
|
238
|
+
line4: "delivery instructions",
|
|
239
|
+
streetNumber: "25",
|
|
240
|
+
city: "San Francisco",
|
|
241
|
+
state: "CA",
|
|
242
|
+
postalCode: "94104",
|
|
243
|
+
country: "US",
|
|
244
|
+
latitude: "40.759211",
|
|
245
|
+
longitude: "-73.984638",
|
|
246
|
+
county: "Santa Clara",
|
|
247
|
+
contactName: "Elon Musk",
|
|
248
|
+
salutation: "Mr",
|
|
249
|
+
phoneNumber: "111-111-1111",
|
|
250
|
+
fax: "122-111-1111",
|
|
251
|
+
email: "elon@musk.com",
|
|
252
|
+
website: "https://elonmusk.com",
|
|
253
|
+
notes: "Address notes or delivery instructions.",
|
|
254
|
+
rowVersion: "1-12345",
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
subsidiaries: [
|
|
258
|
+
{
|
|
259
|
+
id: "12345",
|
|
260
|
+
name: "SpaceX",
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
rowVersion: "1-12345",
|
|
264
|
+
updatedBy: "12345",
|
|
265
|
+
createdBy: "12345",
|
|
266
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
267
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
268
|
+
passThrough: [
|
|
269
|
+
{
|
|
270
|
+
serviceId: "<id>",
|
|
271
|
+
extendPaths: [
|
|
272
|
+
{
|
|
273
|
+
path: "$.nested.property",
|
|
274
|
+
value: {
|
|
275
|
+
"TaxClassificationRef": {
|
|
276
|
+
"value": "EUC-99990201-V1-00020000",
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
path: "$.nested.property",
|
|
282
|
+
value: {
|
|
283
|
+
"TaxClassificationRef": {
|
|
284
|
+
"value": "EUC-99990201-V1-00020000",
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
serviceId: "<id>",
|
|
292
|
+
extendPaths: [
|
|
293
|
+
{
|
|
294
|
+
path: "$.nested.property",
|
|
295
|
+
value: {
|
|
296
|
+
"TaxClassificationRef": {
|
|
297
|
+
"value": "EUC-99990201-V1-00020000",
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
path: "$.nested.property",
|
|
303
|
+
value: {
|
|
304
|
+
"TaxClassificationRef": {
|
|
305
|
+
"value": "EUC-99990201-V1-00020000",
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
serviceId: "<id>",
|
|
313
|
+
extendPaths: [
|
|
314
|
+
{
|
|
315
|
+
path: "$.nested.property",
|
|
316
|
+
value: {
|
|
317
|
+
"TaxClassificationRef": {
|
|
318
|
+
"value": "EUC-99990201-V1-00020000",
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
meta: {
|
|
328
|
+
itemsOnPage: 50,
|
|
329
|
+
cursors: {
|
|
330
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
331
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
332
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
links: {
|
|
336
|
+
previous:
|
|
337
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
338
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
339
|
+
next:
|
|
340
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
341
|
+
},
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it.skip("Locations Accounting Locations Add", async () => {
|
|
346
|
+
assert.fail(
|
|
347
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.locationsAdd.test referencing operation accounting.locationsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.locationsAdd.test referencing operation accounting.locationsAdd with expression in requestBody with type not currently supported`]",
|
|
348
|
+
);
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
test("Locations Accounting Locations One", async () => {
|
|
352
|
+
const testHttpClient = createTestHTTPClient("accounting.locationsOne");
|
|
353
|
+
|
|
354
|
+
const apideck = new Apideck({
|
|
355
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
356
|
+
httpClient: testHttpClient,
|
|
357
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
const result = await apideck.accounting.locations.get({
|
|
361
|
+
id: "<id>",
|
|
362
|
+
serviceId: "salesforce",
|
|
363
|
+
fields: "id,updated_at",
|
|
364
|
+
});
|
|
365
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
366
|
+
expect(result.getAccountingLocationResponse).toBeDefined();
|
|
367
|
+
expect(result.getAccountingLocationResponse).toEqual({
|
|
368
|
+
statusCode: 200,
|
|
369
|
+
status: "OK",
|
|
370
|
+
service: "xero",
|
|
371
|
+
resource: "subsidiaries",
|
|
372
|
+
operation: "one",
|
|
373
|
+
data: {
|
|
374
|
+
id: "12345",
|
|
375
|
+
parentId: "12345",
|
|
376
|
+
companyName: "SpaceX",
|
|
377
|
+
displayName: "11 UT - South Jordan",
|
|
378
|
+
status: "active",
|
|
379
|
+
addresses: [
|
|
380
|
+
{
|
|
381
|
+
id: "123",
|
|
382
|
+
type: "primary",
|
|
383
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
384
|
+
name: "HQ US",
|
|
385
|
+
line1: "Main street",
|
|
386
|
+
line2: "apt #",
|
|
387
|
+
line3: "Suite #",
|
|
388
|
+
line4: "delivery instructions",
|
|
389
|
+
streetNumber: "25",
|
|
390
|
+
city: "San Francisco",
|
|
391
|
+
state: "CA",
|
|
392
|
+
postalCode: "94104",
|
|
393
|
+
country: "US",
|
|
394
|
+
latitude: "40.759211",
|
|
395
|
+
longitude: "-73.984638",
|
|
396
|
+
county: "Santa Clara",
|
|
397
|
+
contactName: "Elon Musk",
|
|
398
|
+
salutation: "Mr",
|
|
399
|
+
phoneNumber: "111-111-1111",
|
|
400
|
+
fax: "122-111-1111",
|
|
401
|
+
email: "elon@musk.com",
|
|
402
|
+
website: "https://elonmusk.com",
|
|
403
|
+
notes: "Address notes or delivery instructions.",
|
|
404
|
+
rowVersion: "1-12345",
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
id: "123",
|
|
408
|
+
type: "primary",
|
|
409
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
410
|
+
name: "HQ US",
|
|
411
|
+
line1: "Main street",
|
|
412
|
+
line2: "apt #",
|
|
413
|
+
line3: "Suite #",
|
|
414
|
+
line4: "delivery instructions",
|
|
415
|
+
streetNumber: "25",
|
|
416
|
+
city: "San Francisco",
|
|
417
|
+
state: "CA",
|
|
418
|
+
postalCode: "94104",
|
|
419
|
+
country: "US",
|
|
420
|
+
latitude: "40.759211",
|
|
421
|
+
longitude: "-73.984638",
|
|
422
|
+
county: "Santa Clara",
|
|
423
|
+
contactName: "Elon Musk",
|
|
424
|
+
salutation: "Mr",
|
|
425
|
+
phoneNumber: "111-111-1111",
|
|
426
|
+
fax: "122-111-1111",
|
|
427
|
+
email: "elon@musk.com",
|
|
428
|
+
website: "https://elonmusk.com",
|
|
429
|
+
notes: "Address notes or delivery instructions.",
|
|
430
|
+
rowVersion: "1-12345",
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
id: "123",
|
|
434
|
+
type: "primary",
|
|
435
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
436
|
+
name: "HQ US",
|
|
437
|
+
line1: "Main street",
|
|
438
|
+
line2: "apt #",
|
|
439
|
+
line3: "Suite #",
|
|
440
|
+
line4: "delivery instructions",
|
|
441
|
+
streetNumber: "25",
|
|
442
|
+
city: "San Francisco",
|
|
443
|
+
state: "CA",
|
|
444
|
+
postalCode: "94104",
|
|
445
|
+
country: "US",
|
|
446
|
+
latitude: "40.759211",
|
|
447
|
+
longitude: "-73.984638",
|
|
448
|
+
county: "Santa Clara",
|
|
449
|
+
contactName: "Elon Musk",
|
|
450
|
+
salutation: "Mr",
|
|
451
|
+
phoneNumber: "111-111-1111",
|
|
452
|
+
fax: "122-111-1111",
|
|
453
|
+
email: "elon@musk.com",
|
|
454
|
+
website: "https://elonmusk.com",
|
|
455
|
+
notes: "Address notes or delivery instructions.",
|
|
456
|
+
rowVersion: "1-12345",
|
|
457
|
+
},
|
|
458
|
+
],
|
|
459
|
+
subsidiaries: [
|
|
460
|
+
{
|
|
461
|
+
id: "12345",
|
|
462
|
+
name: "SpaceX",
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
id: "12345",
|
|
466
|
+
name: "SpaceX",
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
rowVersion: "1-12345",
|
|
470
|
+
updatedBy: "12345",
|
|
471
|
+
createdBy: "12345",
|
|
472
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
473
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
474
|
+
passThrough: [
|
|
475
|
+
{
|
|
476
|
+
serviceId: "<id>",
|
|
477
|
+
extendPaths: [
|
|
478
|
+
{
|
|
479
|
+
path: "$.nested.property",
|
|
480
|
+
value: {
|
|
481
|
+
"TaxClassificationRef": {
|
|
482
|
+
"value": "EUC-99990201-V1-00020000",
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
path: "$.nested.property",
|
|
488
|
+
value: {
|
|
489
|
+
"TaxClassificationRef": {
|
|
490
|
+
"value": "EUC-99990201-V1-00020000",
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
],
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
serviceId: "<id>",
|
|
498
|
+
extendPaths: [
|
|
499
|
+
{
|
|
500
|
+
path: "$.nested.property",
|
|
501
|
+
value: {
|
|
502
|
+
"TaxClassificationRef": {
|
|
503
|
+
"value": "EUC-99990201-V1-00020000",
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
path: "$.nested.property",
|
|
509
|
+
value: {
|
|
510
|
+
"TaxClassificationRef": {
|
|
511
|
+
"value": "EUC-99990201-V1-00020000",
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
path: "$.nested.property",
|
|
517
|
+
value: {
|
|
518
|
+
"TaxClassificationRef": {
|
|
519
|
+
"value": "EUC-99990201-V1-00020000",
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
},
|
|
523
|
+
],
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
},
|
|
527
|
+
});
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
it.skip("Locations Accounting Locations Update", async () => {
|
|
531
|
+
assert.fail(
|
|
532
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.locationsUpdate.test referencing operation accounting.locationsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.locationsUpdate.test referencing operation accounting.locationsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.locationsUpdate.test referencing operation accounting.locationsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.locationsUpdate.test referencing operation accounting.locationsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.locationsUpdate.test referencing operation accounting.locationsUpdate with expression in requestBody with type not currently supported`]",
|
|
533
|
+
);
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
test("Locations Accounting Locations Delete", async () => {
|
|
537
|
+
const testHttpClient = createTestHTTPClient("accounting.locationsDelete");
|
|
538
|
+
|
|
539
|
+
const apideck = new Apideck({
|
|
540
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
541
|
+
httpClient: testHttpClient,
|
|
542
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
const result = await apideck.accounting.locations.delete({
|
|
546
|
+
id: "<id>",
|
|
547
|
+
serviceId: "salesforce",
|
|
548
|
+
});
|
|
549
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
550
|
+
expect(result.deleteAccountingLocationResponse).toBeDefined();
|
|
551
|
+
expect(result.deleteAccountingLocationResponse).toEqual({
|
|
552
|
+
statusCode: 200,
|
|
553
|
+
status: "OK",
|
|
554
|
+
service: "quickbooks",
|
|
555
|
+
resource: "locations",
|
|
556
|
+
operation: "delete",
|
|
557
|
+
data: {
|
|
558
|
+
id: "12345",
|
|
559
|
+
},
|
|
560
|
+
});
|
|
561
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { expect, test } from "vitest";
|
|
6
|
+
import { Apideck } from "../index.js";
|
|
7
|
+
import { createTestHTTPClient } from "./testclient.js";
|
|
8
|
+
|
|
9
|
+
test("Logs Vault Logs All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("vault.logsAll");
|
|
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.vault.logs.list({
|
|
19
|
+
filter: {
|
|
20
|
+
connectorId: "crm+salesforce",
|
|
21
|
+
statusCode: 201,
|
|
22
|
+
excludeUnifiedApis: "vault,proxy",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
26
|
+
expect(result.getLogsResponse).toBeDefined();
|
|
27
|
+
expect(result.getLogsResponse).toEqual({
|
|
28
|
+
statusCode: 200,
|
|
29
|
+
status: "OK",
|
|
30
|
+
data: [
|
|
31
|
+
{
|
|
32
|
+
apiStyle: "REST",
|
|
33
|
+
baseUrl: "unify.apideck.com",
|
|
34
|
+
childRequest: false,
|
|
35
|
+
consumerId: "test-consumer",
|
|
36
|
+
duration: 2220.379304,
|
|
37
|
+
errorMessage: "Refresh token is invalid",
|
|
38
|
+
execution: 2248,
|
|
39
|
+
hasChildren: false,
|
|
40
|
+
httpMethod: "GET",
|
|
41
|
+
id: "0b5f7480-5550-4f5c-a5fc-3c01ac43dd0f",
|
|
42
|
+
latency: 27.620695999999953,
|
|
43
|
+
operation: {
|
|
44
|
+
id: "connectionsAll",
|
|
45
|
+
name: "Get All Connections",
|
|
46
|
+
},
|
|
47
|
+
parentId: "0b5f7480-5550-4f5c-a5fc-3c01ac43dd0f",
|
|
48
|
+
path: "/vault/connections",
|
|
49
|
+
sandbox: false,
|
|
50
|
+
service: {
|
|
51
|
+
id: "apideck-vault",
|
|
52
|
+
name: "Apideck Vault",
|
|
53
|
+
},
|
|
54
|
+
sourceIp: "94.227.131.238",
|
|
55
|
+
statusCode: 200,
|
|
56
|
+
success: true,
|
|
57
|
+
timestamp: "2021-07-12T14:26:17.420Z",
|
|
58
|
+
unifiedApi: "vault",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
apiStyle: "REST",
|
|
62
|
+
baseUrl: "unify.apideck.com",
|
|
63
|
+
childRequest: false,
|
|
64
|
+
consumerId: "test-consumer",
|
|
65
|
+
duration: 2220.379304,
|
|
66
|
+
errorMessage: "Refresh token is invalid",
|
|
67
|
+
execution: 2248,
|
|
68
|
+
hasChildren: false,
|
|
69
|
+
httpMethod: "GET",
|
|
70
|
+
id: "0b5f7480-5550-4f5c-a5fc-3c01ac43dd0f",
|
|
71
|
+
latency: 27.620695999999953,
|
|
72
|
+
operation: {
|
|
73
|
+
id: "connectionsAll",
|
|
74
|
+
name: "Get All Connections",
|
|
75
|
+
},
|
|
76
|
+
parentId: "0b5f7480-5550-4f5c-a5fc-3c01ac43dd0f",
|
|
77
|
+
path: "/vault/connections",
|
|
78
|
+
sandbox: false,
|
|
79
|
+
service: {
|
|
80
|
+
id: "apideck-vault",
|
|
81
|
+
name: "Apideck Vault",
|
|
82
|
+
},
|
|
83
|
+
sourceIp: "94.227.131.238",
|
|
84
|
+
statusCode: 200,
|
|
85
|
+
success: true,
|
|
86
|
+
timestamp: "2021-07-12T14:26:17.420Z",
|
|
87
|
+
unifiedApi: "vault",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
apiStyle: "REST",
|
|
91
|
+
baseUrl: "unify.apideck.com",
|
|
92
|
+
childRequest: false,
|
|
93
|
+
consumerId: "test-consumer",
|
|
94
|
+
duration: 2220.379304,
|
|
95
|
+
errorMessage: "Refresh token is invalid",
|
|
96
|
+
execution: 2248,
|
|
97
|
+
hasChildren: false,
|
|
98
|
+
httpMethod: "GET",
|
|
99
|
+
id: "0b5f7480-5550-4f5c-a5fc-3c01ac43dd0f",
|
|
100
|
+
latency: 27.620695999999953,
|
|
101
|
+
operation: {
|
|
102
|
+
id: "connectionsAll",
|
|
103
|
+
name: "Get All Connections",
|
|
104
|
+
},
|
|
105
|
+
parentId: "0b5f7480-5550-4f5c-a5fc-3c01ac43dd0f",
|
|
106
|
+
path: "/vault/connections",
|
|
107
|
+
sandbox: false,
|
|
108
|
+
service: {
|
|
109
|
+
id: "apideck-vault",
|
|
110
|
+
name: "Apideck Vault",
|
|
111
|
+
},
|
|
112
|
+
sourceIp: "94.227.131.238",
|
|
113
|
+
statusCode: 200,
|
|
114
|
+
success: true,
|
|
115
|
+
timestamp: "2021-07-12T14:26:17.420Z",
|
|
116
|
+
unifiedApi: "vault",
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
meta: {
|
|
120
|
+
itemsOnPage: 50,
|
|
121
|
+
cursors: {
|
|
122
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
123
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
124
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
links: {
|
|
128
|
+
previous:
|
|
129
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
130
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
131
|
+
next:
|
|
132
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
});
|