@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,383 @@
|
|
|
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("Pipelines Crm Pipelines All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("crm.pipelinesAll");
|
|
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.crm.pipelines.list({
|
|
19
|
+
serviceId: "salesforce",
|
|
20
|
+
passThrough: {
|
|
21
|
+
"search": "San Francisco",
|
|
22
|
+
},
|
|
23
|
+
fields: "id,updated_at",
|
|
24
|
+
});
|
|
25
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
26
|
+
expect(result.getPipelinesResponse).toBeDefined();
|
|
27
|
+
expect(result.getPipelinesResponse).toEqual({
|
|
28
|
+
statusCode: 200,
|
|
29
|
+
status: "OK",
|
|
30
|
+
service: "zoho-crm",
|
|
31
|
+
resource: "pipelines",
|
|
32
|
+
operation: "all",
|
|
33
|
+
data: [
|
|
34
|
+
{
|
|
35
|
+
id: "default",
|
|
36
|
+
name: "Sales Pipeline",
|
|
37
|
+
currency: "USD",
|
|
38
|
+
archived: false,
|
|
39
|
+
active: false,
|
|
40
|
+
displayOrder: 1,
|
|
41
|
+
winProbabilityEnabled: true,
|
|
42
|
+
stages: [
|
|
43
|
+
{
|
|
44
|
+
id: "contractsent",
|
|
45
|
+
name: "Contract Sent",
|
|
46
|
+
value: "CONTRACT_SENT",
|
|
47
|
+
winProbability: 50,
|
|
48
|
+
displayOrder: 1,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "contractsent",
|
|
52
|
+
name: "Contract Sent",
|
|
53
|
+
value: "CONTRACT_SENT",
|
|
54
|
+
winProbability: 50,
|
|
55
|
+
displayOrder: 1,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
59
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
60
|
+
passThrough: [
|
|
61
|
+
{
|
|
62
|
+
serviceId: "<id>",
|
|
63
|
+
extendPaths: [
|
|
64
|
+
{
|
|
65
|
+
path: "$.nested.property",
|
|
66
|
+
value: {
|
|
67
|
+
"TaxClassificationRef": {
|
|
68
|
+
"value": "EUC-99990201-V1-00020000",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
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
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "default",
|
|
104
|
+
name: "Sales Pipeline",
|
|
105
|
+
currency: "USD",
|
|
106
|
+
archived: false,
|
|
107
|
+
active: false,
|
|
108
|
+
displayOrder: 1,
|
|
109
|
+
winProbabilityEnabled: true,
|
|
110
|
+
stages: [
|
|
111
|
+
{
|
|
112
|
+
id: "contractsent",
|
|
113
|
+
name: "Contract Sent",
|
|
114
|
+
value: "CONTRACT_SENT",
|
|
115
|
+
winProbability: 50,
|
|
116
|
+
displayOrder: 1,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "contractsent",
|
|
120
|
+
name: "Contract Sent",
|
|
121
|
+
value: "CONTRACT_SENT",
|
|
122
|
+
winProbability: 50,
|
|
123
|
+
displayOrder: 1,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
127
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
128
|
+
passThrough: [
|
|
129
|
+
{
|
|
130
|
+
serviceId: "<id>",
|
|
131
|
+
extendPaths: [
|
|
132
|
+
{
|
|
133
|
+
path: "$.nested.property",
|
|
134
|
+
value: {
|
|
135
|
+
"TaxClassificationRef": {
|
|
136
|
+
"value": "EUC-99990201-V1-00020000",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
serviceId: "<id>",
|
|
144
|
+
extendPaths: [
|
|
145
|
+
{
|
|
146
|
+
path: "$.nested.property",
|
|
147
|
+
value: {
|
|
148
|
+
"TaxClassificationRef": {
|
|
149
|
+
"value": "EUC-99990201-V1-00020000",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
path: "$.nested.property",
|
|
155
|
+
value: {
|
|
156
|
+
"TaxClassificationRef": {
|
|
157
|
+
"value": "EUC-99990201-V1-00020000",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
path: "$.nested.property",
|
|
163
|
+
value: {
|
|
164
|
+
"TaxClassificationRef": {
|
|
165
|
+
"value": "EUC-99990201-V1-00020000",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "default",
|
|
175
|
+
name: "Sales Pipeline",
|
|
176
|
+
currency: "USD",
|
|
177
|
+
archived: false,
|
|
178
|
+
active: false,
|
|
179
|
+
displayOrder: 1,
|
|
180
|
+
winProbabilityEnabled: true,
|
|
181
|
+
stages: [
|
|
182
|
+
{
|
|
183
|
+
id: "contractsent",
|
|
184
|
+
name: "Contract Sent",
|
|
185
|
+
value: "CONTRACT_SENT",
|
|
186
|
+
winProbability: 50,
|
|
187
|
+
displayOrder: 1,
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
191
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
192
|
+
passThrough: [
|
|
193
|
+
{
|
|
194
|
+
serviceId: "<id>",
|
|
195
|
+
extendPaths: [
|
|
196
|
+
{
|
|
197
|
+
path: "$.nested.property",
|
|
198
|
+
value: {
|
|
199
|
+
"TaxClassificationRef": {
|
|
200
|
+
"value": "EUC-99990201-V1-00020000",
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
path: "$.nested.property",
|
|
206
|
+
value: {
|
|
207
|
+
"TaxClassificationRef": {
|
|
208
|
+
"value": "EUC-99990201-V1-00020000",
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
path: "$.nested.property",
|
|
214
|
+
value: {
|
|
215
|
+
"TaxClassificationRef": {
|
|
216
|
+
"value": "EUC-99990201-V1-00020000",
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
meta: {
|
|
226
|
+
itemsOnPage: 50,
|
|
227
|
+
cursors: {
|
|
228
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
229
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
230
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
links: {
|
|
234
|
+
previous:
|
|
235
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
236
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
237
|
+
next:
|
|
238
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it.skip("Pipelines Crm Pipelines Add", async () => {
|
|
244
|
+
assert.fail(
|
|
245
|
+
"incomplete test found please make sure to address the following errors: [`workflow step crm.pipelinesAdd.test referencing operation crm.pipelinesAdd with expression in requestBody with type not currently supported`, `workflow step crm.pipelinesAdd.test referencing operation crm.pipelinesAdd with expression in requestBody with type not currently supported`, `workflow step crm.pipelinesAdd.test referencing operation crm.pipelinesAdd with expression in requestBody with type not currently supported`]",
|
|
246
|
+
);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test("Pipelines Crm Pipelines One", async () => {
|
|
250
|
+
const testHttpClient = createTestHTTPClient("crm.pipelinesOne");
|
|
251
|
+
|
|
252
|
+
const apideck = new Apideck({
|
|
253
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
254
|
+
httpClient: testHttpClient,
|
|
255
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
const result = await apideck.crm.pipelines.get({
|
|
259
|
+
id: "<id>",
|
|
260
|
+
serviceId: "salesforce",
|
|
261
|
+
fields: "id,updated_at",
|
|
262
|
+
});
|
|
263
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
264
|
+
expect(result.getPipelineResponse).toBeDefined();
|
|
265
|
+
expect(result.getPipelineResponse).toEqual({
|
|
266
|
+
statusCode: 200,
|
|
267
|
+
status: "OK",
|
|
268
|
+
service: "zoho-crm",
|
|
269
|
+
resource: "pipelines",
|
|
270
|
+
operation: "one",
|
|
271
|
+
data: {
|
|
272
|
+
id: "default",
|
|
273
|
+
name: "Sales Pipeline",
|
|
274
|
+
currency: "USD",
|
|
275
|
+
archived: false,
|
|
276
|
+
active: false,
|
|
277
|
+
displayOrder: 1,
|
|
278
|
+
winProbabilityEnabled: true,
|
|
279
|
+
stages: [
|
|
280
|
+
{
|
|
281
|
+
id: "contractsent",
|
|
282
|
+
name: "Contract Sent",
|
|
283
|
+
value: "CONTRACT_SENT",
|
|
284
|
+
winProbability: 50,
|
|
285
|
+
displayOrder: 1,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: "contractsent",
|
|
289
|
+
name: "Contract Sent",
|
|
290
|
+
value: "CONTRACT_SENT",
|
|
291
|
+
winProbability: 50,
|
|
292
|
+
displayOrder: 1,
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: "contractsent",
|
|
296
|
+
name: "Contract Sent",
|
|
297
|
+
value: "CONTRACT_SENT",
|
|
298
|
+
winProbability: 50,
|
|
299
|
+
displayOrder: 1,
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
303
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
304
|
+
passThrough: [
|
|
305
|
+
{
|
|
306
|
+
serviceId: "<id>",
|
|
307
|
+
extendPaths: [
|
|
308
|
+
{
|
|
309
|
+
path: "$.nested.property",
|
|
310
|
+
value: {
|
|
311
|
+
"TaxClassificationRef": {
|
|
312
|
+
"value": "EUC-99990201-V1-00020000",
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
path: "$.nested.property",
|
|
318
|
+
value: {
|
|
319
|
+
"TaxClassificationRef": {
|
|
320
|
+
"value": "EUC-99990201-V1-00020000",
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
serviceId: "<id>",
|
|
328
|
+
extendPaths: [
|
|
329
|
+
{
|
|
330
|
+
path: "$.nested.property",
|
|
331
|
+
value: {
|
|
332
|
+
"TaxClassificationRef": {
|
|
333
|
+
"value": "EUC-99990201-V1-00020000",
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
path: "$.nested.property",
|
|
339
|
+
value: {
|
|
340
|
+
"TaxClassificationRef": {
|
|
341
|
+
"value": "EUC-99990201-V1-00020000",
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it.skip("Pipelines Crm Pipelines Update", async () => {
|
|
353
|
+
assert.fail(
|
|
354
|
+
"incomplete test found please make sure to address the following errors: [`workflow step crm.pipelinesUpdate.test referencing operation crm.pipelinesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.pipelinesUpdate.test referencing operation crm.pipelinesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.pipelinesUpdate.test referencing operation crm.pipelinesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.pipelinesUpdate.test referencing operation crm.pipelinesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.pipelinesUpdate.test referencing operation crm.pipelinesUpdate with expression in requestBody with type not currently supported`]",
|
|
355
|
+
);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
test("Pipelines Crm Pipelines Delete", async () => {
|
|
359
|
+
const testHttpClient = createTestHTTPClient("crm.pipelinesDelete");
|
|
360
|
+
|
|
361
|
+
const apideck = new Apideck({
|
|
362
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
363
|
+
httpClient: testHttpClient,
|
|
364
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
const result = await apideck.crm.pipelines.delete({
|
|
368
|
+
id: "<id>",
|
|
369
|
+
serviceId: "salesforce",
|
|
370
|
+
});
|
|
371
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
372
|
+
expect(result.deletePipelineResponse).toBeDefined();
|
|
373
|
+
expect(result.deletePipelineResponse).toEqual({
|
|
374
|
+
statusCode: 200,
|
|
375
|
+
status: "OK",
|
|
376
|
+
service: "zoho-crm",
|
|
377
|
+
resource: "companies",
|
|
378
|
+
operation: "delete",
|
|
379
|
+
data: {
|
|
380
|
+
id: "12345",
|
|
381
|
+
},
|
|
382
|
+
});
|
|
383
|
+
});
|