@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("Bankaccounts Accounting Bank Accounts All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.bankAccountsAll");
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.bankAccounts.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ companyId: "12345",
23
+ filter: {
24
+ name: "Main Operating",
25
+ accountType: "checking",
26
+ status: "active",
27
+ },
28
+ sort: {},
29
+ passThrough: {
30
+ "search": "San Francisco",
31
+ },
32
+ fields: "id,updated_at",
33
+ });
34
+ expect(result.httpMeta.response.status).toBe(200);
35
+ expect(result.getBankAccountsResponse).toBeDefined();
36
+ expect(result.getBankAccountsResponse).toEqual({
37
+ statusCode: 200,
38
+ status: "OK",
39
+ service: "quickbooks",
40
+ resource: "bank-accounts",
41
+ operation: "all",
42
+ data: [
43
+ {
44
+ id: "12345",
45
+ displayId: "BA-001",
46
+ name: "Main Operating Account",
47
+ accountNumber: "1234567890",
48
+ accountType: "checking",
49
+ bankName: "Chase Bank",
50
+ currency: "USD",
51
+ balance: 25000,
52
+ availableBalance: 24500,
53
+ overdraftLimit: 5000,
54
+ routingNumber: "021000021",
55
+ iban: "GB33BUKB20201555555555",
56
+ bic: "CHASUS33",
57
+ bsbNumber: "062-001",
58
+ branchIdentifier: "001",
59
+ bankCode: "BNH",
60
+ country: "US",
61
+ status: "active",
62
+ description: "Primary operating account for daily transactions",
63
+ customFields: [
64
+ {
65
+ id: "2389328923893298",
66
+ name: "employee_level",
67
+ description: "Employee Level",
68
+ value: "Uses Salesforce and Marketo",
69
+ },
70
+ ],
71
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
72
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
73
+ createdBy: "12345",
74
+ updatedBy: "12345",
75
+ },
76
+ ],
77
+ meta: {
78
+ itemsOnPage: 50,
79
+ cursors: {
80
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
81
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
82
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
83
+ },
84
+ },
85
+ links: {
86
+ previous:
87
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
88
+ current: "https://unify.apideck.com/crm/companies",
89
+ next:
90
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
91
+ },
92
+ });
93
+ });
94
+
95
+ test("Bankaccounts Accounting Bank Accounts Add", async () => {
96
+ const testHttpClient = createTestHTTPClient("accounting.bankAccountsAdd");
97
+
98
+ const apideck = new Apideck({
99
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
100
+ httpClient: testHttpClient,
101
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
102
+ });
103
+
104
+ const result = await apideck.accounting.bankAccounts.create({
105
+ consumerId: "test-consumer",
106
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
107
+ serviceId: "salesforce",
108
+ accountingBankAccount: {
109
+ displayId: "BA-001",
110
+ name: "Main Operating Account",
111
+ accountNumber: "123465",
112
+ accountType: "checking",
113
+ ledgerAccount: {
114
+ id: "123456",
115
+ name: "Bank account",
116
+ nominalCode: "N091",
117
+ code: "453",
118
+ parentId: "123456",
119
+ displayId: "123456",
120
+ },
121
+ bankName: "Chase Bank",
122
+ currency: "USD",
123
+ balance: 25000,
124
+ availableBalance: 24500,
125
+ overdraftLimit: 5000,
126
+ routingNumber: "021000021",
127
+ iban: "GB33BUKB20201555555555",
128
+ bic: "CHASUS33",
129
+ bsbNumber: "062-001",
130
+ branchIdentifier: "001",
131
+ bankCode: "BNH",
132
+ country: "US",
133
+ status: "active",
134
+ description: "Primary operating account for daily transactions",
135
+ customFields: [
136
+ {
137
+ id: "2389328923893298",
138
+ name: "employee_level",
139
+ description: "Employee Level",
140
+ value: "Uses Salesforce and Marketo",
141
+ },
142
+ ],
143
+ },
144
+ });
145
+ expect(result.httpMeta.response.status).toBe(201);
146
+ expect(result.createBankAccountResponse).toBeDefined();
147
+ expect(result.createBankAccountResponse).toEqual({
148
+ statusCode: 201,
149
+ status: "Created",
150
+ service: "quickbooks",
151
+ resource: "bank-accounts",
152
+ operation: "add",
153
+ data: {
154
+ id: "12345",
155
+ },
156
+ });
157
+ });
158
+
159
+ test("Bankaccounts Accounting Bank Accounts One", async () => {
160
+ const testHttpClient = createTestHTTPClient("accounting.bankAccountsOne");
161
+
162
+ const apideck = new Apideck({
163
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
164
+ httpClient: testHttpClient,
165
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
166
+ });
167
+
168
+ const result = await apideck.accounting.bankAccounts.get({
169
+ id: "<id>",
170
+ filter: {
171
+ accountType: "checking",
172
+ },
173
+ consumerId: "test-consumer",
174
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
175
+ serviceId: "salesforce",
176
+ companyId: "12345",
177
+ fields: "id,updated_at",
178
+ });
179
+ expect(result.httpMeta.response.status).toBe(200);
180
+ expect(result.getBankAccountResponse).toBeDefined();
181
+ expect(result.getBankAccountResponse).toEqual({
182
+ statusCode: 200,
183
+ status: "OK",
184
+ service: "quickbooks",
185
+ resource: "bank-accounts",
186
+ operation: "one",
187
+ data: {
188
+ id: "12345",
189
+ downstreamId: "12345",
190
+ displayId: "BA-001",
191
+ name: "Main Operating Account",
192
+ accountNumber: "123465",
193
+ accountType: "checking",
194
+ ledgerAccount: {
195
+ id: "123456",
196
+ name: "Bank account",
197
+ nominalCode: "N091",
198
+ code: "453",
199
+ parentId: "123456",
200
+ displayId: "123456",
201
+ },
202
+ bankName: "Chase Bank",
203
+ currency: "USD",
204
+ balance: 25000,
205
+ availableBalance: 24500,
206
+ overdraftLimit: 5000,
207
+ routingNumber: "021000021",
208
+ iban: "GB33BUKB20201555555555",
209
+ bic: "CHASUS33",
210
+ bsbNumber: "062-001",
211
+ branchIdentifier: "001",
212
+ bankCode: "BNH",
213
+ country: "US",
214
+ status: "active",
215
+ description: "Primary operating account for daily transactions",
216
+ customFields: [
217
+ {
218
+ id: "2389328923893298",
219
+ name: "employee_level",
220
+ description: "Employee Level",
221
+ value: "Uses Salesforce and Marketo",
222
+ },
223
+ ],
224
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
225
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
226
+ createdBy: "12345",
227
+ updatedBy: "12345",
228
+ },
229
+ });
230
+ });
231
+
232
+ test("Bankaccounts Accounting Bank Accounts Update", async () => {
233
+ const testHttpClient = createTestHTTPClient("accounting.bankAccountsUpdate");
234
+
235
+ const apideck = new Apideck({
236
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
237
+ httpClient: testHttpClient,
238
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
239
+ });
240
+
241
+ const result = await apideck.accounting.bankAccounts.update({
242
+ id: "<id>",
243
+ consumerId: "test-consumer",
244
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
245
+ serviceId: "salesforce",
246
+ accountingBankAccount: {
247
+ displayId: "BA-001",
248
+ name: "Main Operating Account",
249
+ accountNumber: "123465",
250
+ accountType: "checking",
251
+ ledgerAccount: {
252
+ id: "123456",
253
+ name: "Bank account",
254
+ nominalCode: "N091",
255
+ code: "453",
256
+ parentId: "123456",
257
+ displayId: "123456",
258
+ },
259
+ bankName: "Chase Bank",
260
+ currency: "USD",
261
+ balance: 25000,
262
+ availableBalance: 24500,
263
+ overdraftLimit: 5000,
264
+ routingNumber: "021000021",
265
+ iban: "GB33BUKB20201555555555",
266
+ bic: "CHASUS33",
267
+ bsbNumber: "062-001",
268
+ branchIdentifier: "001",
269
+ bankCode: "BNH",
270
+ country: "US",
271
+ status: "active",
272
+ description: "Primary operating account for daily transactions",
273
+ customFields: [
274
+ {
275
+ id: "2389328923893298",
276
+ name: "employee_level",
277
+ description: "Employee Level",
278
+ value: "Uses Salesforce and Marketo",
279
+ },
280
+ ],
281
+ },
282
+ });
283
+ expect(result.httpMeta.response.status).toBe(200);
284
+ expect(result.updateBankAccountResponse).toBeDefined();
285
+ expect(result.updateBankAccountResponse).toEqual({
286
+ statusCode: 200,
287
+ status: "OK",
288
+ service: "quickbooks",
289
+ resource: "bank-accounts",
290
+ operation: "update",
291
+ data: {
292
+ id: "12345",
293
+ },
294
+ });
295
+ });
296
+
297
+ test("Bankaccounts Accounting Bank Accounts Delete", async () => {
298
+ const testHttpClient = createTestHTTPClient("accounting.bankAccountsDelete");
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.bankAccounts.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.deleteBankAccountResponse).toBeDefined();
314
+ expect(result.deleteBankAccountResponse).toEqual({
315
+ statusCode: 200,
316
+ status: "OK",
317
+ service: "quickbooks",
318
+ resource: "bank-accounts",
319
+ operation: "delete",
320
+ data: {
321
+ id: "12345",
322
+ },
323
+ });
324
+ });
@@ -0,0 +1,343 @@
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("Bankfeedaccounts Accounting Bank Feed Accounts All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.bankFeedAccountsAll");
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.bankFeedAccounts.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ passThrough: {
23
+ "search": "San Francisco",
24
+ },
25
+ fields: "id,updated_at",
26
+ });
27
+ expect(result.httpMeta.response.status).toBe(200);
28
+ expect(result.getBankFeedAccountsResponse).toBeDefined();
29
+ expect(result.getBankFeedAccountsResponse).toEqual({
30
+ statusCode: 200,
31
+ status: "OK",
32
+ service: "quickbooks",
33
+ resource: "bank-feed-accounts",
34
+ operation: "all",
35
+ data: [
36
+ {
37
+ id: "12345",
38
+ bankAccountType: "bank",
39
+ sourceAccountId: "src_456",
40
+ targetAccountId: "tgt_789",
41
+ targetAccountName: "Main Company Checking",
42
+ targetAccountNumber: "NL91ABNA0417164300",
43
+ currency: "USD",
44
+ feedStatus: "pending",
45
+ country: "US",
46
+ customFields: [
47
+ {
48
+ id: "2389328923893298",
49
+ name: "employee_level",
50
+ description: "Employee Level",
51
+ value: {},
52
+ },
53
+ {
54
+ id: "2389328923893298",
55
+ name: "employee_level",
56
+ description: "Employee Level",
57
+ value: 10,
58
+ },
59
+ ],
60
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
61
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
62
+ updatedBy: "12345",
63
+ createdBy: "12345",
64
+ },
65
+ {
66
+ id: "12345",
67
+ bankAccountType: "bank",
68
+ sourceAccountId: "src_456",
69
+ targetAccountId: "tgt_789",
70
+ targetAccountName: "Main Company Checking",
71
+ targetAccountNumber: "NL91ABNA0417164300",
72
+ currency: "USD",
73
+ feedStatus: "pending",
74
+ country: "US",
75
+ customFields: [
76
+ {
77
+ id: "2389328923893298",
78
+ name: "employee_level",
79
+ description: "Employee Level",
80
+ value: {},
81
+ },
82
+ ],
83
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
84
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
85
+ updatedBy: "12345",
86
+ createdBy: "12345",
87
+ },
88
+ {
89
+ id: "12345",
90
+ bankAccountType: "bank",
91
+ sourceAccountId: "src_456",
92
+ targetAccountId: "tgt_789",
93
+ targetAccountName: "Main Company Checking",
94
+ targetAccountNumber: "NL91ABNA0417164300",
95
+ currency: "USD",
96
+ feedStatus: "pending",
97
+ country: "US",
98
+ customFields: [
99
+ {
100
+ id: "2389328923893298",
101
+ name: "employee_level",
102
+ description: "Employee Level",
103
+ value: "Uses Salesforce and Marketo",
104
+ },
105
+ {
106
+ id: "2389328923893298",
107
+ name: "employee_level",
108
+ description: "Employee Level",
109
+ value: {},
110
+ },
111
+ ],
112
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
113
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
114
+ updatedBy: "12345",
115
+ createdBy: "12345",
116
+ },
117
+ ],
118
+ meta: {
119
+ itemsOnPage: 50,
120
+ cursors: {
121
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
122
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
123
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
124
+ },
125
+ },
126
+ links: {
127
+ previous:
128
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
129
+ current: "https://unify.apideck.com/crm/companies",
130
+ next:
131
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
132
+ },
133
+ });
134
+ });
135
+
136
+ test("Bankfeedaccounts Accounting Bank Feed Accounts Add", async () => {
137
+ const testHttpClient = createTestHTTPClient("accounting.bankFeedAccountsAdd");
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.bankFeedAccounts.create({
146
+ consumerId: "test-consumer",
147
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
148
+ serviceId: "salesforce",
149
+ bankFeedAccount: {
150
+ bankAccountType: "bank",
151
+ sourceAccountId: "src_456",
152
+ targetAccountId: "tgt_789",
153
+ targetAccountName: "Main Company Checking",
154
+ targetAccountNumber: "NL91ABNA0417164300",
155
+ currency: "USD",
156
+ feedStatus: "pending",
157
+ country: "US",
158
+ customFields: [
159
+ {
160
+ id: "2389328923893298",
161
+ name: "employee_level",
162
+ description: "Employee Level",
163
+ value: {},
164
+ },
165
+ {
166
+ id: "2389328923893298",
167
+ name: "employee_level",
168
+ description: "Employee Level",
169
+ value: true,
170
+ },
171
+ ],
172
+ },
173
+ });
174
+ expect(result.httpMeta.response.status).toBe(201);
175
+ expect(result.createBankFeedAccountResponse).toBeDefined();
176
+ expect(result.createBankFeedAccountResponse).toEqual({
177
+ statusCode: 200,
178
+ status: "OK",
179
+ service: "xero",
180
+ resource: "bills",
181
+ operation: "add",
182
+ data: {
183
+ id: "12345",
184
+ },
185
+ });
186
+ });
187
+
188
+ test("Bankfeedaccounts Accounting Bank Feed Accounts One", async () => {
189
+ const testHttpClient = createTestHTTPClient("accounting.bankFeedAccountsOne");
190
+
191
+ const apideck = new Apideck({
192
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
193
+ httpClient: testHttpClient,
194
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
195
+ });
196
+
197
+ const result = await apideck.accounting.bankFeedAccounts.get({
198
+ id: "<id>",
199
+ consumerId: "test-consumer",
200
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
201
+ serviceId: "salesforce",
202
+ fields: "id,updated_at",
203
+ });
204
+ expect(result.httpMeta.response.status).toBe(200);
205
+ expect(result.getBankFeedAccountResponse).toBeDefined();
206
+ expect(result.getBankFeedAccountResponse).toEqual({
207
+ statusCode: 200,
208
+ status: "OK",
209
+ service: "quickbooks",
210
+ resource: "bank-feed-accounts",
211
+ operation: "one",
212
+ data: {
213
+ id: "12345",
214
+ bankAccountType: "bank",
215
+ sourceAccountId: "src_456",
216
+ targetAccountId: "tgt_789",
217
+ targetAccountName: "Main Company Checking",
218
+ targetAccountNumber: "NL91ABNA0417164300",
219
+ currency: "USD",
220
+ feedStatus: "pending",
221
+ country: "US",
222
+ customFields: [
223
+ {
224
+ id: "2389328923893298",
225
+ name: "employee_level",
226
+ description: "Employee Level",
227
+ value: {},
228
+ },
229
+ {
230
+ id: "2389328923893298",
231
+ name: "employee_level",
232
+ description: "Employee Level",
233
+ value: {},
234
+ },
235
+ {
236
+ id: "2389328923893298",
237
+ name: "employee_level",
238
+ description: "Employee Level",
239
+ value: {},
240
+ },
241
+ ],
242
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
243
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
244
+ updatedBy: "12345",
245
+ createdBy: "12345",
246
+ },
247
+ });
248
+ });
249
+
250
+ test("Bankfeedaccounts Accounting Bank Feed Accounts Update", async () => {
251
+ const testHttpClient = createTestHTTPClient(
252
+ "accounting.bankFeedAccountsUpdate",
253
+ );
254
+
255
+ const apideck = new Apideck({
256
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
257
+ httpClient: testHttpClient,
258
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
259
+ });
260
+
261
+ const result = await apideck.accounting.bankFeedAccounts.update({
262
+ id: "<id>",
263
+ consumerId: "test-consumer",
264
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
265
+ serviceId: "salesforce",
266
+ bankFeedAccount: {
267
+ bankAccountType: "bank",
268
+ sourceAccountId: "src_456",
269
+ targetAccountId: "tgt_789",
270
+ targetAccountName: "Main Company Checking",
271
+ targetAccountNumber: "NL91ABNA0417164300",
272
+ currency: "USD",
273
+ feedStatus: "pending",
274
+ country: "US",
275
+ customFields: [
276
+ {
277
+ id: "2389328923893298",
278
+ name: "employee_level",
279
+ description: "Employee Level",
280
+ value: {},
281
+ },
282
+ {
283
+ id: "2389328923893298",
284
+ name: "employee_level",
285
+ description: "Employee Level",
286
+ value: true,
287
+ },
288
+ {
289
+ id: "2389328923893298",
290
+ name: "employee_level",
291
+ description: "Employee Level",
292
+ value: {
293
+ "0": {},
294
+ "1": {},
295
+ },
296
+ },
297
+ ],
298
+ },
299
+ });
300
+ expect(result.httpMeta.response.status).toBe(200);
301
+ expect(result.updateBankFeedAccountResponse).toBeDefined();
302
+ expect(result.updateBankFeedAccountResponse).toEqual({
303
+ statusCode: 200,
304
+ status: "OK",
305
+ service: "quickbooks",
306
+ resource: "bank-feed-accounts",
307
+ operation: "update",
308
+ data: {
309
+ id: "12345",
310
+ },
311
+ });
312
+ });
313
+
314
+ test("Bankfeedaccounts Accounting Bank Feed Accounts Delete", async () => {
315
+ const testHttpClient = createTestHTTPClient(
316
+ "accounting.bankFeedAccountsDelete",
317
+ );
318
+
319
+ const apideck = new Apideck({
320
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
321
+ httpClient: testHttpClient,
322
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
323
+ });
324
+
325
+ const result = await apideck.accounting.bankFeedAccounts.delete({
326
+ id: "<id>",
327
+ consumerId: "test-consumer",
328
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
329
+ serviceId: "salesforce",
330
+ });
331
+ expect(result.httpMeta.response.status).toBe(200);
332
+ expect(result.deleteBankFeedAccountResponse).toBeDefined();
333
+ expect(result.deleteBankFeedAccountResponse).toEqual({
334
+ statusCode: 200,
335
+ status: "OK",
336
+ service: "quickbooks",
337
+ resource: "bank-feed-accounts",
338
+ operation: "delete",
339
+ data: {
340
+ id: "12345",
341
+ },
342
+ });
343
+ });