@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.
Files changed (93) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/note.d.ts +5 -0
  5. package/models/components/note.d.ts.map +1 -1
  6. package/models/components/note.js +4 -0
  7. package/models/components/note.js.map +1 -1
  8. package/models/components/noteinput.d.ts +5 -0
  9. package/models/components/noteinput.d.ts.map +1 -1
  10. package/models/components/noteinput.js +4 -0
  11. package/models/components/noteinput.js.map +1 -1
  12. package/package.json +5 -1
  13. package/src/__tests__/activities.test.ts +783 -0
  14. package/src/__tests__/agedcreditors.test.ts +279 -0
  15. package/src/__tests__/ageddebtors.test.ts +279 -0
  16. package/src/__tests__/apideckcompanies.test.ts +712 -0
  17. package/src/__tests__/apideckcustomers.test.ts +360 -0
  18. package/src/__tests__/apideckdepartments.test.ts +319 -0
  19. package/src/__tests__/apiresources.test.ts +61 -0
  20. package/src/__tests__/apis.test.ts +214 -0
  21. package/src/__tests__/applicants.test.ts +976 -0
  22. package/src/__tests__/applications.test.ts +329 -0
  23. package/src/__tests__/assertions.ts +13 -0
  24. package/src/__tests__/attachments.test.ts +363 -0
  25. package/src/__tests__/balancesheet.test.ts +451 -0
  26. package/src/__tests__/billpayments.test.ts +666 -0
  27. package/src/__tests__/bills.test.ts +1133 -0
  28. package/src/__tests__/collections.test.ts +115 -0
  29. package/src/__tests__/collectiontags.test.ts +66 -0
  30. package/src/__tests__/collectionticketcomments.test.ts +318 -0
  31. package/src/__tests__/collectiontickets.test.ts +436 -0
  32. package/src/__tests__/collectionusers.test.ts +122 -0
  33. package/src/__tests__/companies.test.ts +1059 -0
  34. package/src/__tests__/companyinfo.test.ts +218 -0
  35. package/src/__tests__/connectioncustommappings.test.ts +67 -0
  36. package/src/__tests__/connections.test.ts +1713 -0
  37. package/src/__tests__/connectionsettings.test.ts +280 -0
  38. package/src/__tests__/connectordocs.test.ts +28 -0
  39. package/src/__tests__/connectors.test.ts +751 -0
  40. package/src/__tests__/consumerrequestcounts.test.ts +41 -0
  41. package/src/__tests__/consumers.test.ts +517 -0
  42. package/src/__tests__/contacts.test.ts +957 -0
  43. package/src/__tests__/createcallback.test.ts +34 -0
  44. package/src/__tests__/creditnotes.test.ts +1362 -0
  45. package/src/__tests__/customers.test.ts +1089 -0
  46. package/src/__tests__/customfields.test.ts +50 -0
  47. package/src/__tests__/custommappings.test.ts +63 -0
  48. package/src/__tests__/departments.test.ts +359 -0
  49. package/src/__tests__/drivegroups.test.ts +318 -0
  50. package/src/__tests__/drives.test.ts +311 -0
  51. package/src/__tests__/employeepayrolls.test.ts +487 -0
  52. package/src/__tests__/employees.test.ts +1682 -0
  53. package/src/__tests__/employeeschedules.test.ts +456 -0
  54. package/src/__tests__/eventlogs.test.ts +157 -0
  55. package/src/__tests__/expenses.test.ts +566 -0
  56. package/src/__tests__/files.test.ts +392 -0
  57. package/src/__tests__/files.ts +56 -0
  58. package/src/__tests__/folders.test.ts +103 -0
  59. package/src/__tests__/invoiceitems.test.ts +586 -0
  60. package/src/__tests__/invoices.test.ts +1561 -0
  61. package/src/__tests__/jobs.test.ts +837 -0
  62. package/src/__tests__/journalentries.test.ts +1053 -0
  63. package/src/__tests__/leads.test.ts +897 -0
  64. package/src/__tests__/ledgeraccounts.test.ts +594 -0
  65. package/src/__tests__/locations.test.ts +561 -0
  66. package/src/__tests__/logs.test.ts +135 -0
  67. package/src/__tests__/messages.test.ts +396 -0
  68. package/src/__tests__/mockserver/README.md +52 -0
  69. package/src/__tests__/notes.test.ts +335 -0
  70. package/src/__tests__/opportunities.test.ts +503 -0
  71. package/src/__tests__/orders.test.ts +849 -0
  72. package/src/__tests__/payments.test.ts +557 -0
  73. package/src/__tests__/payrolls.test.ts +481 -0
  74. package/src/__tests__/pipelines.test.ts +383 -0
  75. package/src/__tests__/products.test.ts +505 -0
  76. package/src/__tests__/profitandloss.test.ts +221 -0
  77. package/src/__tests__/purchaseorders.test.ts +1464 -0
  78. package/src/__tests__/sessions.test.ts +70 -0
  79. package/src/__tests__/sharedlinks.test.ts +331 -0
  80. package/src/__tests__/stores.test.ts +39 -0
  81. package/src/__tests__/subsidiaries.test.ts +316 -0
  82. package/src/__tests__/suppliers.test.ts +1071 -0
  83. package/src/__tests__/taxrates.test.ts +472 -0
  84. package/src/__tests__/testclient.ts +48 -0
  85. package/src/__tests__/timeoffrequests.test.ts +381 -0
  86. package/src/__tests__/trackingcategories.test.ts +329 -0
  87. package/src/__tests__/uploadsessions.test.ts +142 -0
  88. package/src/__tests__/users.test.ts +667 -0
  89. package/src/__tests__/validateconnection.test.ts +32 -0
  90. package/src/__tests__/webhooks.test.ts +248 -0
  91. package/src/lib/config.ts +3 -3
  92. package/src/models/components/note.ts +9 -0
  93. package/src/models/components/noteinput.ts +9 -0
@@ -0,0 +1,335 @@
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("Notes Crm Notes All", async () => {
10
+ const testHttpClient = createTestHTTPClient("crm.notesAll");
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.notes.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.getNotesResponse).toBeDefined();
27
+ expect(result.getNotesResponse).toEqual({
28
+ statusCode: 200,
29
+ status: "OK",
30
+ service: "zoho-crm",
31
+ resource: "notes",
32
+ operation: "all",
33
+ data: [
34
+ {
35
+ id: "12345",
36
+ title: "Meeting Notes",
37
+ content: "Office hours are 9AM-6PM",
38
+ ownerId: "12345",
39
+ contactId: "12345",
40
+ companyId: "12345",
41
+ opportunityId: "12345",
42
+ leadId: "12345",
43
+ active: true,
44
+ updatedBy: "12345",
45
+ createdBy: "12345",
46
+ updatedAt: "2020-09-30T07:43:32.000Z",
47
+ createdAt: "2020-09-30T07:43:32.000Z",
48
+ passThrough: [
49
+ {
50
+ serviceId: "<id>",
51
+ extendPaths: [
52
+ {
53
+ path: "$.nested.property",
54
+ value: {
55
+ "TaxClassificationRef": {
56
+ "value": "EUC-99990201-V1-00020000",
57
+ },
58
+ },
59
+ },
60
+ {
61
+ path: "$.nested.property",
62
+ value: {
63
+ "TaxClassificationRef": {
64
+ "value": "EUC-99990201-V1-00020000",
65
+ },
66
+ },
67
+ },
68
+ {
69
+ path: "$.nested.property",
70
+ value: {
71
+ "TaxClassificationRef": {
72
+ "value": "EUC-99990201-V1-00020000",
73
+ },
74
+ },
75
+ },
76
+ ],
77
+ },
78
+ {
79
+ serviceId: "<id>",
80
+ extendPaths: [
81
+ {
82
+ path: "$.nested.property",
83
+ value: {
84
+ "TaxClassificationRef": {
85
+ "value": "EUC-99990201-V1-00020000",
86
+ },
87
+ },
88
+ },
89
+ ],
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ id: "12345",
95
+ title: "Meeting Notes",
96
+ content: "Office hours are 9AM-6PM",
97
+ ownerId: "12345",
98
+ contactId: "12345",
99
+ companyId: "12345",
100
+ opportunityId: "12345",
101
+ leadId: "12345",
102
+ active: true,
103
+ updatedBy: "12345",
104
+ createdBy: "12345",
105
+ updatedAt: "2020-09-30T07:43:32.000Z",
106
+ createdAt: "2020-09-30T07:43:32.000Z",
107
+ passThrough: [
108
+ {
109
+ serviceId: "<id>",
110
+ extendPaths: [
111
+ {
112
+ path: "$.nested.property",
113
+ value: {
114
+ "TaxClassificationRef": {
115
+ "value": "EUC-99990201-V1-00020000",
116
+ },
117
+ },
118
+ },
119
+ ],
120
+ },
121
+ ],
122
+ },
123
+ {
124
+ id: "12345",
125
+ title: "Meeting Notes",
126
+ content: "Office hours are 9AM-6PM",
127
+ ownerId: "12345",
128
+ contactId: "12345",
129
+ companyId: "12345",
130
+ opportunityId: "12345",
131
+ leadId: "12345",
132
+ active: true,
133
+ updatedBy: "12345",
134
+ createdBy: "12345",
135
+ updatedAt: "2020-09-30T07:43:32.000Z",
136
+ createdAt: "2020-09-30T07:43:32.000Z",
137
+ passThrough: [
138
+ {
139
+ serviceId: "<id>",
140
+ extendPaths: [
141
+ {
142
+ path: "$.nested.property",
143
+ value: {
144
+ "TaxClassificationRef": {
145
+ "value": "EUC-99990201-V1-00020000",
146
+ },
147
+ },
148
+ },
149
+ {
150
+ path: "$.nested.property",
151
+ value: {
152
+ "TaxClassificationRef": {
153
+ "value": "EUC-99990201-V1-00020000",
154
+ },
155
+ },
156
+ },
157
+ ],
158
+ },
159
+ {
160
+ serviceId: "<id>",
161
+ extendPaths: [
162
+ {
163
+ path: "$.nested.property",
164
+ value: {
165
+ "TaxClassificationRef": {
166
+ "value": "EUC-99990201-V1-00020000",
167
+ },
168
+ },
169
+ },
170
+ ],
171
+ },
172
+ ],
173
+ },
174
+ ],
175
+ meta: {
176
+ itemsOnPage: 50,
177
+ cursors: {
178
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
179
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
180
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
181
+ },
182
+ },
183
+ links: {
184
+ previous:
185
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
186
+ current: "https://unify.apideck.com/crm/companies",
187
+ next:
188
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
189
+ },
190
+ });
191
+ });
192
+
193
+ it.skip("Notes Crm Notes Add", async () => {
194
+ assert.fail(
195
+ "incomplete test found please make sure to address the following errors: [`workflow step crm.notesAdd.test referencing operation crm.notesAdd with expression in requestBody with type not currently supported`, `workflow step crm.notesAdd.test referencing operation crm.notesAdd with expression in requestBody with type not currently supported`, `workflow step crm.notesAdd.test referencing operation crm.notesAdd with expression in requestBody with type not currently supported`, `workflow step crm.notesAdd.test referencing operation crm.notesAdd with expression in requestBody with type not currently supported`]",
196
+ );
197
+ });
198
+
199
+ test("Notes Crm Notes One", async () => {
200
+ const testHttpClient = createTestHTTPClient("crm.notesOne");
201
+
202
+ const apideck = new Apideck({
203
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
204
+ httpClient: testHttpClient,
205
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
206
+ });
207
+
208
+ const result = await apideck.crm.notes.get({
209
+ id: "<id>",
210
+ serviceId: "salesforce",
211
+ fields: "id,updated_at",
212
+ });
213
+ expect(result.httpMeta.response.status).toBe(200);
214
+ expect(result.getNoteResponse).toBeDefined();
215
+ expect(result.getNoteResponse).toEqual({
216
+ statusCode: 200,
217
+ status: "OK",
218
+ service: "zoho-crm",
219
+ resource: "notes",
220
+ operation: "one",
221
+ data: {
222
+ id: "12345",
223
+ title: "Meeting Notes",
224
+ content: "Office hours are 9AM-6PM",
225
+ ownerId: "12345",
226
+ contactId: "12345",
227
+ companyId: "12345",
228
+ opportunityId: "12345",
229
+ leadId: "12345",
230
+ active: true,
231
+ updatedBy: "12345",
232
+ createdBy: "12345",
233
+ updatedAt: "2020-09-30T07:43:32.000Z",
234
+ createdAt: "2020-09-30T07:43:32.000Z",
235
+ passThrough: [
236
+ {
237
+ serviceId: "<id>",
238
+ extendPaths: [
239
+ {
240
+ path: "$.nested.property",
241
+ value: {
242
+ "TaxClassificationRef": {
243
+ "value": "EUC-99990201-V1-00020000",
244
+ },
245
+ },
246
+ },
247
+ {
248
+ path: "$.nested.property",
249
+ value: {
250
+ "TaxClassificationRef": {
251
+ "value": "EUC-99990201-V1-00020000",
252
+ },
253
+ },
254
+ },
255
+ ],
256
+ },
257
+ {
258
+ serviceId: "<id>",
259
+ extendPaths: [
260
+ {
261
+ path: "$.nested.property",
262
+ value: {
263
+ "TaxClassificationRef": {
264
+ "value": "EUC-99990201-V1-00020000",
265
+ },
266
+ },
267
+ },
268
+ {
269
+ path: "$.nested.property",
270
+ value: {
271
+ "TaxClassificationRef": {
272
+ "value": "EUC-99990201-V1-00020000",
273
+ },
274
+ },
275
+ },
276
+ ],
277
+ },
278
+ {
279
+ serviceId: "<id>",
280
+ extendPaths: [
281
+ {
282
+ path: "$.nested.property",
283
+ value: {
284
+ "TaxClassificationRef": {
285
+ "value": "EUC-99990201-V1-00020000",
286
+ },
287
+ },
288
+ },
289
+ {
290
+ path: "$.nested.property",
291
+ value: {
292
+ "TaxClassificationRef": {
293
+ "value": "EUC-99990201-V1-00020000",
294
+ },
295
+ },
296
+ },
297
+ ],
298
+ },
299
+ ],
300
+ },
301
+ });
302
+ });
303
+
304
+ it.skip("Notes Crm Notes Update", async () => {
305
+ assert.fail(
306
+ "incomplete test found please make sure to address the following errors: [`workflow step crm.notesUpdate.test referencing operation crm.notesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.notesUpdate.test referencing operation crm.notesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.notesUpdate.test referencing operation crm.notesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.notesUpdate.test referencing operation crm.notesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.notesUpdate.test referencing operation crm.notesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.notesUpdate.test referencing operation crm.notesUpdate with expression in requestBody with type not currently supported`, `workflow step crm.notesUpdate.test referencing operation crm.notesUpdate with expression in requestBody with type not currently supported`]",
307
+ );
308
+ });
309
+
310
+ test("Notes Crm Notes Delete", async () => {
311
+ const testHttpClient = createTestHTTPClient("crm.notesDelete");
312
+
313
+ const apideck = new Apideck({
314
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
315
+ httpClient: testHttpClient,
316
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
317
+ });
318
+
319
+ const result = await apideck.crm.notes.delete({
320
+ id: "<id>",
321
+ serviceId: "salesforce",
322
+ });
323
+ expect(result.httpMeta.response.status).toBe(200);
324
+ expect(result.deleteNoteResponse).toBeDefined();
325
+ expect(result.deleteNoteResponse).toEqual({
326
+ statusCode: 200,
327
+ status: "OK",
328
+ service: "zoho-crm",
329
+ resource: "notes",
330
+ operation: "delete",
331
+ data: {
332
+ id: "12345",
333
+ },
334
+ });
335
+ });