@apideck/unify 0.40.0 → 0.41.0

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 (96) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +4 -4
  3. package/lib/config.js +4 -4
  4. package/package.json +6 -2
  5. package/src/__tests__/activities.test.ts +1141 -0
  6. package/src/__tests__/agedcreditors.test.ts +280 -0
  7. package/src/__tests__/ageddebtors.test.ts +280 -0
  8. package/src/__tests__/apideckcompanies.test.ts +1082 -0
  9. package/src/__tests__/apideckcustomers.test.ts +364 -0
  10. package/src/__tests__/apideckdepartments.test.ts +497 -0
  11. package/src/__tests__/apiresources.test.ts +62 -0
  12. package/src/__tests__/apis.test.ts +216 -0
  13. package/src/__tests__/applicants.test.ts +1445 -0
  14. package/src/__tests__/applications.test.ts +515 -0
  15. package/src/__tests__/assertions.ts +13 -0
  16. package/src/__tests__/attachments.test.ts +371 -0
  17. package/src/__tests__/balancesheet.test.ts +453 -0
  18. package/src/__tests__/bankaccounts.test.ts +324 -0
  19. package/src/__tests__/bankfeedaccounts.test.ts +343 -0
  20. package/src/__tests__/bankfeedstatements.test.ts +408 -0
  21. package/src/__tests__/billpayments.test.ts +1031 -0
  22. package/src/__tests__/bills.test.ts +1630 -0
  23. package/src/__tests__/categories.test.ts +127 -0
  24. package/src/__tests__/collections.test.ts +120 -0
  25. package/src/__tests__/collectiontags.test.ts +68 -0
  26. package/src/__tests__/collectionticketcomments.test.ts +501 -0
  27. package/src/__tests__/collectiontickets.test.ts +627 -0
  28. package/src/__tests__/collectionusers.test.ts +126 -0
  29. package/src/__tests__/companies.test.ts +1642 -0
  30. package/src/__tests__/companyinfo.test.ts +219 -0
  31. package/src/__tests__/connectionconsent.test.ts +89 -0
  32. package/src/__tests__/connectionconsents.test.ts +31 -0
  33. package/src/__tests__/connectioncustommappings.test.ts +69 -0
  34. package/src/__tests__/connections.test.ts +2127 -0
  35. package/src/__tests__/connectionsettings.test.ts +687 -0
  36. package/src/__tests__/connectordocs.test.ts +29 -0
  37. package/src/__tests__/connectors.test.ts +753 -0
  38. package/src/__tests__/consumerrequestcounts.test.ts +42 -0
  39. package/src/__tests__/consumers.test.ts +523 -0
  40. package/src/__tests__/contacts.test.ts +1421 -0
  41. package/src/__tests__/createcallback.test.ts +36 -0
  42. package/src/__tests__/creditnotes.test.ts +2040 -0
  43. package/src/__tests__/customers.test.ts +1600 -0
  44. package/src/__tests__/customfields.test.ts +52 -0
  45. package/src/__tests__/custommappings.test.ts +65 -0
  46. package/src/__tests__/customobjects.test.ts +408 -0
  47. package/src/__tests__/customobjectschemas.test.ts +734 -0
  48. package/src/__tests__/departments.test.ts +529 -0
  49. package/src/__tests__/drivegroups.test.ts +496 -0
  50. package/src/__tests__/drives.test.ts +487 -0
  51. package/src/__tests__/employeepayrolls.test.ts +491 -0
  52. package/src/__tests__/employees.test.ts +2968 -0
  53. package/src/__tests__/employeeschedules.test.ts +457 -0
  54. package/src/__tests__/eventlogs.test.ts +158 -0
  55. package/src/__tests__/expensecategories.test.ts +324 -0
  56. package/src/__tests__/expensereports.test.ts +634 -0
  57. package/src/__tests__/expenses.test.ts +867 -0
  58. package/src/__tests__/files.test.ts +506 -0
  59. package/src/__tests__/files.ts +56 -0
  60. package/src/__tests__/folders.test.ts +390 -0
  61. package/src/__tests__/invoiceitems.test.ts +855 -0
  62. package/src/__tests__/invoices.test.ts +2173 -0
  63. package/src/__tests__/jobs.test.ts +1150 -0
  64. package/src/__tests__/journalentries.test.ts +1542 -0
  65. package/src/__tests__/leads.test.ts +1341 -0
  66. package/src/__tests__/ledgeraccounts.test.ts +829 -0
  67. package/src/__tests__/locations.test.ts +856 -0
  68. package/src/__tests__/logs.test.ts +137 -0
  69. package/src/__tests__/messages.test.ts +588 -0
  70. package/src/__tests__/notes.test.ts +523 -0
  71. package/src/__tests__/opportunities.test.ts +718 -0
  72. package/src/__tests__/orders.test.ts +854 -0
  73. package/src/__tests__/payments.test.ts +867 -0
  74. package/src/__tests__/payrolls.test.ts +485 -0
  75. package/src/__tests__/pipelines.test.ts +574 -0
  76. package/src/__tests__/products.test.ts +509 -0
  77. package/src/__tests__/profitandloss.test.ts +223 -0
  78. package/src/__tests__/projects.test.ts +480 -0
  79. package/src/__tests__/proxy.test.ts +41 -0
  80. package/src/__tests__/purchaseorders.test.ts +2139 -0
  81. package/src/__tests__/quotes.test.ts +678 -0
  82. package/src/__tests__/refunds.test.ts +812 -0
  83. package/src/__tests__/sessions.test.ts +72 -0
  84. package/src/__tests__/sharedlinks.test.ts +511 -0
  85. package/src/__tests__/stores.test.ts +41 -0
  86. package/src/__tests__/subsidiaries.test.ts +496 -0
  87. package/src/__tests__/suppliers.test.ts +1574 -0
  88. package/src/__tests__/taxrates.test.ts +701 -0
  89. package/src/__tests__/testclient.ts +48 -0
  90. package/src/__tests__/timeoffrequests.test.ts +588 -0
  91. package/src/__tests__/trackingcategories.test.ts +515 -0
  92. package/src/__tests__/uploadsessions.test.ts +221 -0
  93. package/src/__tests__/users.test.ts +1020 -0
  94. package/src/__tests__/validateconnection.test.ts +34 -0
  95. package/src/__tests__/webhooks.test.ts +254 -0
  96. package/src/lib/config.ts +4 -4
@@ -0,0 +1,324 @@
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("Expensecategories Accounting Expense Categories All", async () => {
10
+ const testHttpClient = createTestHTTPClient(
11
+ "accounting.expenseCategoriesAll",
12
+ );
13
+
14
+ const apideck = new Apideck({
15
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
16
+ httpClient: testHttpClient,
17
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
18
+ });
19
+
20
+ const result = await apideck.accounting.expenseCategories.list({
21
+ consumerId: "test-consumer",
22
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
23
+ serviceId: "salesforce",
24
+ fields: "id,updated_at",
25
+ filter: {
26
+ updatedSince: new Date("2020-09-30T07:43:32.000Z"),
27
+ status: "active",
28
+ },
29
+ });
30
+ expect(result.httpMeta.response.status).toBe(200);
31
+ expect(result.getExpenseCategoriesResponse).toBeDefined();
32
+ expect(result.getExpenseCategoriesResponse).toEqual({
33
+ statusCode: 200,
34
+ status: "OK",
35
+ service: "netsuite",
36
+ resource: "ExpenseCategories",
37
+ operation: "all",
38
+ data: [],
39
+ meta: {
40
+ itemsOnPage: 50,
41
+ cursors: {
42
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
43
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
44
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
45
+ },
46
+ },
47
+ links: {
48
+ previous:
49
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
50
+ current: "https://unify.apideck.com/crm/companies",
51
+ next:
52
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
53
+ },
54
+ });
55
+ });
56
+
57
+ test("Expensecategories Accounting Expense Categories Add", async () => {
58
+ const testHttpClient = createTestHTTPClient(
59
+ "accounting.expenseCategoriesAdd",
60
+ );
61
+
62
+ const apideck = new Apideck({
63
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
64
+ httpClient: testHttpClient,
65
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
66
+ });
67
+
68
+ const result = await apideck.accounting.expenseCategories.create({
69
+ consumerId: "test-consumer",
70
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
71
+ serviceId: "salesforce",
72
+ expenseCategory: {
73
+ displayId: "123456",
74
+ name: "Travel",
75
+ code: "TRAVEL-001",
76
+ description:
77
+ "Travel-related expenses including flights, hotels, and ground transportation.",
78
+ status: "active",
79
+ account: {
80
+ id: "123456",
81
+ name: "Bank account",
82
+ nominalCode: "N091",
83
+ code: "453",
84
+ parentId: "123456",
85
+ displayId: "123456",
86
+ },
87
+ offsetAccount: {
88
+ id: "123456",
89
+ name: "Bank account",
90
+ nominalCode: "N091",
91
+ code: "453",
92
+ parentId: "123456",
93
+ displayId: "123456",
94
+ },
95
+ taxRate: {
96
+ id: "123456",
97
+ code: "N-T",
98
+ rate: 10,
99
+ },
100
+ rateRequired: false,
101
+ defaultRate: 0.67,
102
+ rowVersion: "1-12345",
103
+ passThrough: [
104
+ {
105
+ serviceId: "<id>",
106
+ extendPaths: [
107
+ {
108
+ path: "$.nested.property",
109
+ value: {
110
+ "TaxClassificationRef": {
111
+ "value": "EUC-99990201-V1-00020000",
112
+ },
113
+ },
114
+ },
115
+ ],
116
+ },
117
+ ],
118
+ },
119
+ });
120
+ expect(result.httpMeta.response.status).toBe(201);
121
+ expect(result.createExpenseCategoryResponse).toBeDefined();
122
+ expect(result.createExpenseCategoryResponse).toEqual({
123
+ statusCode: 200,
124
+ status: "OK",
125
+ service: "netsuite",
126
+ resource: "ExpenseCategories",
127
+ operation: "add",
128
+ data: {
129
+ id: "12345",
130
+ },
131
+ });
132
+ });
133
+
134
+ test("Expensecategories Accounting Expense Categories One", async () => {
135
+ const testHttpClient = createTestHTTPClient(
136
+ "accounting.expenseCategoriesOne",
137
+ );
138
+
139
+ const apideck = new Apideck({
140
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
141
+ httpClient: testHttpClient,
142
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
143
+ });
144
+
145
+ const result = await apideck.accounting.expenseCategories.get({
146
+ id: "<id>",
147
+ consumerId: "test-consumer",
148
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
149
+ serviceId: "salesforce",
150
+ fields: "id,updated_at",
151
+ });
152
+ expect(result.httpMeta.response.status).toBe(200);
153
+ expect(result.getExpenseCategoryResponse).toBeDefined();
154
+ expect(result.getExpenseCategoryResponse).toEqual({
155
+ statusCode: 200,
156
+ status: "OK",
157
+ service: "netsuite",
158
+ resource: "ExpenseCategories",
159
+ operation: "one",
160
+ data: {
161
+ id: "12345",
162
+ displayId: "123456",
163
+ name: "Travel",
164
+ code: "TRAVEL-001",
165
+ description:
166
+ "Travel-related expenses including flights, hotels, and ground transportation.",
167
+ status: "active",
168
+ account: {
169
+ id: "123456",
170
+ name: "Bank account",
171
+ nominalCode: "N091",
172
+ code: "453",
173
+ parentId: "123456",
174
+ displayId: "123456",
175
+ },
176
+ offsetAccount: {
177
+ id: "123456",
178
+ name: "Bank account",
179
+ nominalCode: "N091",
180
+ code: "453",
181
+ parentId: "123456",
182
+ displayId: "123456",
183
+ },
184
+ taxRate: {
185
+ id: "123456",
186
+ code: "N-T",
187
+ name: "GST on Purchases",
188
+ rate: 10,
189
+ },
190
+ rateRequired: false,
191
+ defaultRate: 0.67,
192
+ downstreamId: "12345",
193
+ rowVersion: "1-12345",
194
+ updatedBy: "12345",
195
+ createdBy: "12345",
196
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
197
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
198
+ passThrough: [
199
+ {
200
+ serviceId: "<id>",
201
+ extendPaths: [
202
+ {
203
+ path: "$.nested.property",
204
+ value: {
205
+ "TaxClassificationRef": {
206
+ "value": "EUC-99990201-V1-00020000",
207
+ },
208
+ },
209
+ },
210
+ ],
211
+ },
212
+ ],
213
+ },
214
+ });
215
+ });
216
+
217
+ test("Expensecategories Accounting Expense Categories Update", async () => {
218
+ const testHttpClient = createTestHTTPClient(
219
+ "accounting.expenseCategoriesUpdate",
220
+ );
221
+
222
+ const apideck = new Apideck({
223
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
224
+ httpClient: testHttpClient,
225
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
226
+ });
227
+
228
+ const result = await apideck.accounting.expenseCategories.update({
229
+ id: "<id>",
230
+ consumerId: "test-consumer",
231
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
232
+ serviceId: "salesforce",
233
+ expenseCategory: {
234
+ displayId: "123456",
235
+ name: "Travel",
236
+ code: "TRAVEL-001",
237
+ description:
238
+ "Travel-related expenses including flights, hotels, and ground transportation.",
239
+ status: "active",
240
+ account: {
241
+ id: "123456",
242
+ name: "Bank account",
243
+ nominalCode: "N091",
244
+ code: "453",
245
+ parentId: "123456",
246
+ displayId: "123456",
247
+ },
248
+ offsetAccount: {
249
+ id: "123456",
250
+ name: "Bank account",
251
+ nominalCode: "N091",
252
+ code: "453",
253
+ parentId: "123456",
254
+ displayId: "123456",
255
+ },
256
+ taxRate: {
257
+ id: "123456",
258
+ code: "N-T",
259
+ rate: 10,
260
+ },
261
+ rateRequired: false,
262
+ defaultRate: 0.67,
263
+ rowVersion: "1-12345",
264
+ passThrough: [
265
+ {
266
+ serviceId: "<id>",
267
+ extendPaths: [
268
+ {
269
+ path: "$.nested.property",
270
+ value: {
271
+ "TaxClassificationRef": {
272
+ "value": "EUC-99990201-V1-00020000",
273
+ },
274
+ },
275
+ },
276
+ ],
277
+ },
278
+ ],
279
+ },
280
+ });
281
+ expect(result.httpMeta.response.status).toBe(200);
282
+ expect(result.updateExpenseCategoryResponse).toBeDefined();
283
+ expect(result.updateExpenseCategoryResponse).toEqual({
284
+ statusCode: 200,
285
+ status: "OK",
286
+ service: "netsuite",
287
+ resource: "ExpenseCategories",
288
+ operation: "update",
289
+ data: {
290
+ id: "12345",
291
+ },
292
+ });
293
+ });
294
+
295
+ test("Expensecategories Accounting Expense Categories Delete", async () => {
296
+ const testHttpClient = createTestHTTPClient(
297
+ "accounting.expenseCategoriesDelete",
298
+ );
299
+
300
+ const apideck = new Apideck({
301
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
302
+ httpClient: testHttpClient,
303
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
304
+ });
305
+
306
+ const result = await apideck.accounting.expenseCategories.delete({
307
+ id: "<id>",
308
+ consumerId: "test-consumer",
309
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
310
+ serviceId: "salesforce",
311
+ });
312
+ expect(result.httpMeta.response.status).toBe(200);
313
+ expect(result.deleteExpenseCategoryResponse).toBeDefined();
314
+ expect(result.deleteExpenseCategoryResponse).toEqual({
315
+ statusCode: 200,
316
+ status: "OK",
317
+ service: "netsuite",
318
+ resource: "ExpenseCategories",
319
+ operation: "delete",
320
+ data: {
321
+ id: "12345",
322
+ },
323
+ });
324
+ });