@chift/chift-nodejs 1.0.16 → 1.0.18

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 (145) hide show
  1. package/README.md +3 -3
  2. package/package.json +5 -2
  3. package/src/types/public-api/schema.d.ts +4071 -850
  4. package/src/types/sync.ts +20 -5
  5. package/.eslintcache +0 -1
  6. package/.eslintignore +0 -1
  7. package/.eslintrc.json +0 -25
  8. package/.github/workflows/ci.yml +0 -75
  9. package/.husky/pre-commit +0 -4
  10. package/.prettierignore +0 -1
  11. package/.prettierrc.json +0 -7
  12. package/CHANGELOG.md +0 -98
  13. package/coverage/clover.xml +0 -1645
  14. package/coverage/coverage-final.json +0 -19
  15. package/coverage/lcov-report/base.css +0 -224
  16. package/coverage/lcov-report/block-navigation.js +0 -87
  17. package/coverage/lcov-report/favicon.png +0 -0
  18. package/coverage/lcov-report/index.html +0 -146
  19. package/coverage/lcov-report/prettify.css +0 -1
  20. package/coverage/lcov-report/prettify.js +0 -2
  21. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  22. package/coverage/lcov-report/sorter.js +0 -196
  23. package/coverage/lcov-report/src/helpers/index.html +0 -131
  24. package/coverage/lcov-report/src/helpers/openapi.ts.html +0 -151
  25. package/coverage/lcov-report/src/helpers/settings.ts.html +0 -94
  26. package/coverage/lcov-report/src/index.html +0 -116
  27. package/coverage/lcov-report/src/index.ts.html +0 -88
  28. package/coverage/lcov-report/src/modules/accounting.ts.html +0 -1156
  29. package/coverage/lcov-report/src/modules/api.ts.html +0 -190
  30. package/coverage/lcov-report/src/modules/consumer.ts.html +0 -616
  31. package/coverage/lcov-report/src/modules/consumers.ts.html +0 -331
  32. package/coverage/lcov-report/src/modules/custom.ts.html +0 -193
  33. package/coverage/lcov-report/src/modules/datastores.ts.html +0 -142
  34. package/coverage/lcov-report/src/modules/ecommerce.ts.html +0 -331
  35. package/coverage/lcov-report/src/modules/flow.ts.html +0 -589
  36. package/coverage/lcov-report/src/modules/index.html +0 -326
  37. package/coverage/lcov-report/src/modules/integrations.ts.html +0 -151
  38. package/coverage/lcov-report/src/modules/internalApi.ts.html +0 -586
  39. package/coverage/lcov-report/src/modules/invoicing.ts.html +0 -391
  40. package/coverage/lcov-report/src/modules/pos.ts.html +0 -421
  41. package/coverage/lcov-report/src/modules/sync.ts.html +0 -316
  42. package/coverage/lcov-report/src/modules/syncs.ts.html +0 -169
  43. package/coverage/lcov-report/src/modules/webhooks.ts.html +0 -343
  44. package/coverage/lcov.info +0 -1976
  45. package/dist/src/helpers/openapi.d.ts +0 -3
  46. package/dist/src/helpers/openapi.js +0 -18
  47. package/dist/src/helpers/settings.d.ts +0 -4
  48. package/dist/src/helpers/settings.js +0 -5
  49. package/dist/src/index.d.ts +0 -1
  50. package/dist/src/modules/accounting.d.ts +0 -68
  51. package/dist/src/modules/accounting.js +0 -326
  52. package/dist/src/modules/api.d.ts +0 -16795
  53. package/dist/src/modules/api.js +0 -36
  54. package/dist/src/modules/consumer.d.ts +0 -3313
  55. package/dist/src/modules/consumer.js +0 -139
  56. package/dist/src/modules/consumers.d.ts +0 -16684
  57. package/dist/src/modules/consumers.js +0 -51
  58. package/dist/src/modules/custom.d.ts +0 -8
  59. package/dist/src/modules/custom.js +0 -36
  60. package/dist/src/modules/datastores.d.ts +0 -18
  61. package/dist/src/modules/datastores.js +0 -23
  62. package/dist/src/modules/ecommerce.d.ts +0 -24
  63. package/dist/src/modules/ecommerce.js +0 -97
  64. package/dist/src/modules/flow.d.ts +0 -15
  65. package/dist/src/modules/flow.js +0 -156
  66. package/dist/src/modules/integrations.d.ts +0 -23
  67. package/dist/src/modules/integrations.js +0 -23
  68. package/dist/src/modules/internalApi.d.ts +0 -24
  69. package/dist/src/modules/internalApi.js +0 -175
  70. package/dist/src/modules/invoicing.d.ts +0 -20
  71. package/dist/src/modules/invoicing.js +0 -90
  72. package/dist/src/modules/pms.d.ts +0 -15
  73. package/dist/src/modules/pms.js +0 -47
  74. package/dist/src/modules/pos.d.ts +0 -26
  75. package/dist/src/modules/pos.js +0 -101
  76. package/dist/src/modules/sync.d.ts +0 -13414
  77. package/dist/src/modules/sync.js +0 -73
  78. package/dist/src/modules/syncs.d.ts +0 -11
  79. package/dist/src/modules/syncs.js +0 -39
  80. package/dist/src/modules/webhooks.d.ts +0 -55
  81. package/dist/src/modules/webhooks.js +0 -53
  82. package/dist/src/types/api.d.ts +0 -29
  83. package/dist/src/types/api.js +0 -2
  84. package/dist/src/types/consumers.d.ts +0 -8
  85. package/dist/src/types/consumers.js +0 -2
  86. package/dist/src/types/public-api/mappings.d.ts +0 -21
  87. package/dist/src/types/public-api/mappings.js +0 -2
  88. package/dist/src/types/public-api/schema.d.ts +0 -12003
  89. package/dist/src/types/public-api/schema.js +0 -6
  90. package/dist/src/types/sync.d.ts +0 -20
  91. package/dist/src/types/sync.js +0 -2
  92. package/dist/test/modules/accounting.test.d.ts +0 -1
  93. package/dist/test/modules/accounting.test.js +0 -582
  94. package/dist/test/modules/consumer.test.d.ts +0 -1
  95. package/dist/test/modules/consumer.test.js +0 -89
  96. package/dist/test/modules/consumers.test.d.ts +0 -1
  97. package/dist/test/modules/consumers.test.js +0 -109
  98. package/dist/test/modules/ecommerce.test.d.ts +0 -1
  99. package/dist/test/modules/ecommerce.test.js +0 -220
  100. package/dist/test/modules/integrations.test.d.ts +0 -1
  101. package/dist/test/modules/integrations.test.js +0 -54
  102. package/dist/test/modules/invoicing.test.d.ts +0 -1
  103. package/dist/test/modules/invoicing.test.js +0 -108
  104. package/dist/test/modules/pos.test.d.ts +0 -1
  105. package/dist/test/modules/pos.test.js +0 -182
  106. package/dist/test/modules/sync.test.d.ts +0 -1
  107. package/dist/test/modules/sync.test.js +0 -81
  108. package/dist/test/modules/syncs.test.d.ts +0 -1
  109. package/dist/test/modules/syncs.test.js +0 -53
  110. package/dist/test/modules/webhooks.test.d.ts +0 -1
  111. package/dist/test/modules/webhooks.test.js +0 -120
  112. package/jest.config.ts +0 -195
  113. package/src/helpers/openapi.ts +0 -22
  114. package/src/helpers/settings.ts +0 -3
  115. package/src/index.ts +0 -1
  116. package/src/modules/accounting.ts +0 -510
  117. package/src/modules/api.ts +0 -35
  118. package/src/modules/consumer.ts +0 -213
  119. package/src/modules/consumers.ts +0 -82
  120. package/src/modules/custom.ts +0 -36
  121. package/src/modules/datastores.ts +0 -19
  122. package/src/modules/ecommerce.ts +0 -127
  123. package/src/modules/flow.ts +0 -168
  124. package/src/modules/integrations.ts +0 -24
  125. package/src/modules/internalApi.ts +0 -182
  126. package/src/modules/invoicing.ts +0 -114
  127. package/src/modules/pms.ts +0 -67
  128. package/src/modules/pos.ts +0 -144
  129. package/src/modules/sync.ts +0 -77
  130. package/src/modules/syncs.ts +0 -59
  131. package/src/modules/webhooks.ts +0 -86
  132. package/src/types/public-api/schema.ts +0 -12073
  133. package/test/data/accounting_invoice.pdf +0 -0
  134. package/test/modules/accounting.test.ts +0 -628
  135. package/test/modules/consumer.test.ts +0 -68
  136. package/test/modules/consumers.test.ts +0 -85
  137. package/test/modules/ecommerce.test.ts +0 -208
  138. package/test/modules/integrations.test.ts +0 -22
  139. package/test/modules/invoicing.test.ts +0 -88
  140. package/test/modules/pos.test.ts +0 -166
  141. package/test/modules/sync.test.ts +0 -60
  142. package/test/modules/syncs.test.ts +0 -23
  143. package/test/modules/webhooks.test.ts +0 -92
  144. package/test/set_envs.sh +0 -14
  145. package/tsconfig.json +0 -107
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './modules/api';
@@ -1,510 +0,0 @@
1
- import { operations, components } from '../types/public-api/schema';
2
- import { AutoPaginatedParams, RequestData } from '../types/api';
3
-
4
- type GetChartOfAccountsParams = AutoPaginatedParams<
5
- operations['accounting_get_chart_of_accounts']['parameters']['query']
6
- >;
7
-
8
- type GetMiscOperationsParams = AutoPaginatedParams<
9
- operations['accounting_get_miscellaneous_operations']['parameters']['query']
10
- >;
11
-
12
- type GetInvoicesByTypeWithMultiplePlansParams = AutoPaginatedParams<
13
- operations['accounting_get_invoices_by_type_multi_analytic_plans']['parameters']['query']
14
- >;
15
-
16
- type GetInvoicesByTypeParams = AutoPaginatedParams<
17
- operations['accounting_get_invoices_by_type']['parameters']['query']
18
- >;
19
-
20
- type GetOutstandingsParams = AutoPaginatedParams<
21
- operations['accounting_get_outstandings']['parameters']['query']
22
- >;
23
-
24
- type GetAnalyticPlansParams = AutoPaginatedParams<
25
- operations['accounting_get_analytic_plans']['parameters']['query']
26
- >;
27
-
28
- type GetVatCodesParams = AutoPaginatedParams<
29
- operations['accounting_get_vat_codes']['parameters']['query']
30
- >;
31
-
32
- type GetJournalsParams = AutoPaginatedParams<
33
- operations['accounting_get_journals']['parameters']['query']
34
- >;
35
-
36
- type GetJournalEntriesParams = AutoPaginatedParams<
37
- operations['accounting_get_journal_entries']['parameters']['query']
38
- >;
39
-
40
- type GetJournalEntriesWithMultiplePlansParams = AutoPaginatedParams<
41
- operations['accounting_get_journal_entries_mutli_plan']['parameters']['query']
42
- >;
43
-
44
- type GetEmployeesParams = AutoPaginatedParams<
45
- operations['accounting_get_employees']['parameters']['query']
46
- >;
47
-
48
- type GetAttachmentsParams = AutoPaginatedParams<
49
- operations['accounting_get_attachments']['parameters']['query']
50
- >;
51
-
52
- type GetBalanceOfAccountsParams = AutoPaginatedParams<
53
- operations['accounting_get_accounts_balances']['parameters']['query']
54
- >;
55
-
56
- type GetClientsParams = AutoPaginatedParams<
57
- operations['accounting_get_clients']['parameters']['query']
58
- >;
59
-
60
- type GetSuppliersParams = AutoPaginatedParams<
61
- operations['accounting_get_suppliers']['parameters']['query']
62
- >;
63
-
64
- type GetAnalyticAccountsParams = AutoPaginatedParams<
65
- operations['accounting_get_analytic_accounts']['parameters']['query']
66
- >;
67
-
68
- type GetAnalyticAccountsWithMultiplePlansParams = AutoPaginatedParams<
69
- operations['accounting_get_analytic_accounts_multi_plans']['parameters']['query']
70
- >;
71
-
72
- const accountingFactory = {
73
- getAnalyticPlans(
74
- params?: GetAnalyticPlansParams
75
- ): RequestData<components['schemas']['AnalyticPlanItem'][]> {
76
- return {
77
- params,
78
- method: 'get',
79
- url: '/consumers/{consumer_id}/accounting/analytic-plans',
80
- };
81
- },
82
- getClients(params?: GetClientsParams): RequestData<components['schemas']['ClientItemOut'][]> {
83
- return {
84
- params,
85
- method: 'get',
86
- url: '/consumers/{consumer_id}/accounting/clients',
87
- };
88
- },
89
- createClient(
90
- client: components['schemas']['ClientItemIn'],
91
- params?: operations['accounting_create_client']['parameters']['query']
92
- ): RequestData<components['schemas']['ClientItemOut']> {
93
- return {
94
- params,
95
- method: 'post',
96
- url: '/consumers/{consumer_id}/accounting/clients',
97
- body: client,
98
- };
99
- },
100
- getClient(
101
- clientId: string,
102
- params?: operations['accounting_get_client']['parameters']['query']
103
- ): RequestData<components['schemas']['ClientItemOut']> {
104
- return {
105
- params,
106
- method: 'get',
107
- url: `/consumers/{consumer_id}/accounting/clients/${clientId}`,
108
- };
109
- },
110
- updateClient(
111
- clientId: string,
112
- client: components['schemas']['ClientItemUpdate'],
113
- params?: operations['accounting_update_client']['parameters']['query']
114
- ): RequestData<components['schemas']['ClientItemOut']> {
115
- return {
116
- params,
117
- method: 'patch',
118
- url: `/consumers/{consumer_id}/accounting/clients/${clientId}`,
119
- body: client,
120
- };
121
- },
122
- getSuppliers(
123
- params?: GetSuppliersParams
124
- ): RequestData<components['schemas']['SupplierItemOut'][]> {
125
- return {
126
- params,
127
- method: 'get',
128
- url: '/consumers/{consumer_id}/accounting/suppliers',
129
- };
130
- },
131
- createSupplier(
132
- supplier: components['schemas']['SupplierItemIn'],
133
- params?: operations['accounting_create_supplier']['parameters']['query']
134
- ): RequestData<components['schemas']['SupplierItemOut']> {
135
- return {
136
- params,
137
- method: 'post',
138
- url: '/consumers/{consumer_id}/accounting/suppliers',
139
- body: supplier,
140
- };
141
- },
142
- getSupplier(
143
- supplierId: string,
144
- params?: operations['accounting_get_supplier']['parameters']['query']
145
- ): RequestData<components['schemas']['SupplierItemOut']> {
146
- return {
147
- params,
148
- method: 'get',
149
- url: `/consumers/{consumer_id}/accounting/suppliers/${supplierId}`,
150
- };
151
- },
152
- updateSupplier(
153
- supplierId: string,
154
- supplier: components['schemas']['SupplierItemUpdate'],
155
- params?: operations['accounting_update_supplier']['parameters']['query']
156
- ): RequestData<components['schemas']['SupplierItemOut']> {
157
- return {
158
- params,
159
- method: 'patch',
160
- url: `/consumers/{consumer_id}/accounting/suppliers/${supplierId}`,
161
- body: supplier,
162
- };
163
- },
164
- createInvoice(
165
- invoice: components['schemas']['InvoiceItemInMonoAnalyticPlan'],
166
- params?: operations['accounting_create_invoice']['parameters']['query']
167
- ): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan']> {
168
- return {
169
- params,
170
- method: 'post',
171
- url: '/consumers/{consumer_id}/accounting/invoices',
172
- body: invoice,
173
- };
174
- },
175
- createInvoiceWithMultiplePlans(
176
- invoice: components['schemas']['InvoiceItemInMultiAnalyticPlans'],
177
- params?: operations['accounting_create_invoice_multiple_plans']['parameters']['query']
178
- ): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans']> {
179
- return {
180
- params,
181
- method: 'post',
182
- url: '/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans',
183
- body: invoice,
184
- };
185
- },
186
- getInvoicesByType(
187
- invoice_type: components['schemas']['app__routers__accounting__InvoiceType'],
188
- params?: GetInvoicesByTypeParams
189
- ): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan'][]> {
190
- return {
191
- params,
192
- method: 'get',
193
- url: `/consumers/{consumer_id}/accounting/invoices/type/${invoice_type}`,
194
- };
195
- },
196
- getInvoice(
197
- invoiceId: string,
198
- params?: operations['accounting_get_invoice']['parameters']['query']
199
- ): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan']> {
200
- return {
201
- params,
202
- method: 'get',
203
- url: `/consumers/{consumer_id}/accounting/invoices/${invoiceId}`,
204
- };
205
- },
206
- getInvoiceWithMultiplePlans(
207
- invoiceId: string,
208
- params?: operations['accounting_get_invoice_multi_analytic_plans']['parameters']['query']
209
- ): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans']> {
210
- return {
211
- params,
212
- method: 'get',
213
- url: `/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans/${invoiceId}`,
214
- };
215
- },
216
- getInvoicesByTypeWithMultiplePlans(
217
- invoice_type: components['schemas']['app__routers__accounting__InvoiceType'],
218
- params?: GetInvoicesByTypeWithMultiplePlansParams
219
- ): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans'][]> {
220
- return {
221
- params,
222
- method: 'get',
223
- url: `/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans/type/${invoice_type}`,
224
- };
225
- },
226
- createAnalyticAccount(
227
- analyticAccount: components['schemas']['AnalyticAccountItemIn'],
228
- params?: operations['accounting_create_analytic_account']['parameters']['query']
229
- ): RequestData<components['schemas']['AnalyticAccountItemOut']> {
230
- return {
231
- params,
232
- method: 'post',
233
- url: '/consumers/{consumer_id}/accounting/analytic-accounts',
234
- body: analyticAccount,
235
- };
236
- },
237
- getAnalyticAccounts(
238
- params?: GetAnalyticAccountsParams
239
- ): RequestData<components['schemas']['AnalyticAccountItemOut'][]> {
240
- return {
241
- params,
242
- method: 'get',
243
- url: '/consumers/{consumer_id}/accounting/analytic-accounts',
244
- };
245
- },
246
- createAnalyticAccountWithMultiplePlans(
247
- analytic_plan: string,
248
- analyticAccount: components['schemas']['AnalyticAccountItemIn'],
249
- params?: operations['accounting_create_analytic_account_multi_plans']['parameters']['query']
250
- ): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']> {
251
- return {
252
- params,
253
- method: 'post',
254
- url: `/consumers/{consumer_id}/accounting/analytic-accounts/multi-analytic-plans/${analytic_plan}`,
255
- body: analyticAccount,
256
- };
257
- },
258
- getAnalyticAccount(
259
- analytic_account_id: string,
260
- params?: operations['accounting_get_analytic_account']['parameters']['query']
261
- ): RequestData<components['schemas']['AnalyticAccountItemOut']> {
262
- return {
263
- params,
264
- method: 'get',
265
- url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}`,
266
- };
267
- },
268
- updateAnalyticAccount(
269
- analytic_account_id: string,
270
- analyticAccount: components['schemas']['AnalyticAccountItemUpdate'],
271
- params?: operations['accounting_update_analytic_account']['parameters']['query']
272
- ): RequestData<components['schemas']['AnalyticAccountItemOut']> {
273
- return {
274
- params,
275
- method: 'patch',
276
- url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}`,
277
- body: analyticAccount,
278
- };
279
- },
280
- getAnalyticAccountWithMultiplePlans(
281
- analytic_account_id: string,
282
- analytic_plan: string,
283
- params?: operations['accounting_get_analytic_account_multi_plans']['parameters']['query']
284
- ): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']> {
285
- return {
286
- params,
287
- method: 'get',
288
- url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}/multi-analytic-plans/${analytic_plan}`,
289
- };
290
- },
291
- updateAnalyticAccountWithMultiplePlans(
292
- analytic_account_id: string,
293
- analytic_plan: string,
294
- analyticAccount: components['schemas']['AnalyticAccountItemUpdate'],
295
- params?: operations['accounting_update_analytic_account_multi_plans']['parameters']['query']
296
- ): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']> {
297
- return {
298
- params,
299
- method: 'patch',
300
- url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}/multi-analytic-plans/${analytic_plan}`,
301
- body: analyticAccount,
302
- };
303
- },
304
- getAnalyticAccountsWithMultiplePlans(
305
- params?: GetAnalyticAccountsWithMultiplePlansParams
306
- ): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans'][]> {
307
- return {
308
- params,
309
- method: 'get',
310
- url: '/consumers/{consumer_id}/accounting/analytic-accounts/multi-analytic-plans',
311
- };
312
- },
313
- getJournalEntries(
314
- params: GetJournalEntriesParams
315
- ): RequestData<components['schemas']['JournalEntryMonoAnalyticPlan'][]> {
316
- return {
317
- params,
318
- method: 'get',
319
- url: `/consumers/{consumer_id}/accounting/journal/entries`,
320
- };
321
- },
322
- getJournalEntriesWithMultiplePlans(
323
- params: GetJournalEntriesWithMultiplePlansParams
324
- ): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan'][]> {
325
- return {
326
- params,
327
- method: 'get',
328
- url: `/consumers/{consumer_id}/accounting/journal/entries/multi-analytic-plans`,
329
- };
330
- },
331
- getPaymentsByInvoiceId(
332
- invoice_id: string,
333
- params?: operations['accounting_get_payments_by_invoice']['parameters']['query']
334
- ): RequestData<components['schemas']['Payment'][]> {
335
- return {
336
- params,
337
- method: 'get',
338
- url: `/consumers/{consumer_id}/accounting/invoices/id/${invoice_id}/payments`,
339
- };
340
- },
341
- getJournals(params?: GetJournalsParams): RequestData<components['schemas']['Journal'][]> {
342
- return {
343
- params,
344
- method: 'get',
345
- url: `/consumers/{consumer_id}/accounting/journals`,
346
- };
347
- },
348
- getVatCodes(
349
- params?: GetVatCodesParams
350
- ): RequestData<components['schemas']['app__routers__accounting__VatCode'][]> {
351
- return {
352
- params,
353
- method: 'get',
354
- url: `/consumers/{consumer_id}/accounting/vat-codes`,
355
- };
356
- },
357
- getMiscOperations(
358
- params?: GetMiscOperationsParams
359
- ): RequestData<components['schemas']['MiscellaneousOperationOut'][]> {
360
- return {
361
- params,
362
- method: 'get',
363
- url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
364
- };
365
- },
366
- createMiscOperation(
367
- operation: components['schemas']['MiscellaneousOperationIn'],
368
- params?: operations['accounting_create_miscellaneous_operation']['parameters']['query']
369
- ): RequestData<components['schemas']['MiscellaneousOperationOut']> {
370
- return {
371
- params,
372
- method: 'post',
373
- url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
374
- body: operation,
375
- };
376
- },
377
- getMiscOperation(
378
- operation_id: string,
379
- params?: operations['accounting_get_miscellaneous_operation']['parameters']['query']
380
- ): RequestData<components['schemas']['MiscellaneousOperationOut']> {
381
- return {
382
- params,
383
- method: 'get',
384
- url: `/consumers/{consumer_id}/accounting/miscellaneous-operation/${operation_id}`,
385
- };
386
- },
387
- attachPDF(
388
- invoice_id: string,
389
- attachment: components['schemas']['AttachmentItem'],
390
- params?: operations['accounting_add_attachment']['parameters']['query']
391
- ): RequestData<operations['accounting_add_attachment']['responses'][201]> {
392
- return {
393
- params,
394
- method: 'post',
395
- url: `/consumers/{consumer_id}/accounting/invoices/pdf/${invoice_id}`,
396
- body: attachment,
397
- };
398
- },
399
- getAttachments(
400
- params: GetAttachmentsParams
401
- ): RequestData<components['schemas']['AttachmentItem'][]> {
402
- return {
403
- params,
404
- method: 'get',
405
- url: `/consumers/{consumer_id}/accounting/attachments`,
406
- };
407
- },
408
- getChartOfAccounts(
409
- params?: GetChartOfAccountsParams
410
- ): RequestData<components['schemas']['AccountItem'][]> {
411
- return {
412
- params,
413
- method: 'get',
414
- url: '/consumers/{consumer_id}/accounting/chart-of-accounts',
415
- };
416
- },
417
- getBalanceOfAccounts(
418
- filter: components['schemas']['AccountBalanceFilter'],
419
- params?: GetBalanceOfAccountsParams
420
- ): RequestData<components['schemas']['AccountBalance'][]> {
421
- return {
422
- params,
423
- method: 'post',
424
- url: '/consumers/{consumer_id}/accounting/chart-of-accounts/balance',
425
- body: filter,
426
- };
427
- },
428
- getEmployees(
429
- params?: GetEmployeesParams
430
- ): RequestData<components['schemas']['EmployeeItem'][]> {
431
- return {
432
- params,
433
- method: 'get',
434
- url: '/consumers/{consumer_id}/accounting/employees',
435
- };
436
- },
437
- getOutstandings(
438
- params: GetOutstandingsParams
439
- ): RequestData<components['schemas']['OutstandingItem'][]> {
440
- return {
441
- params,
442
- method: 'get',
443
- url: '/consumers/{consumer_id}/accounting/outstandings',
444
- };
445
- },
446
- /**
447
- * @deprecated replaced by createFinancialEntry
448
- */
449
- createFinancialEntryOld(
450
- financial_entry: components['schemas']['FinancialEntryItemInOld'],
451
- params?: operations['accounting_create_financial_entry']['parameters']['query']
452
- ): RequestData<components['schemas']['FinancialEntryItemOutOld']> {
453
- return {
454
- params,
455
- method: 'post',
456
- url: '/consumers/{consumer_id}/accounting/financial-entry',
457
- body: financial_entry,
458
- };
459
- },
460
- createFinancialEntry(
461
- financial_entry: components['schemas']['FinancialEntryItemIn'],
462
- params?: operations['accounting_create_financial_entries']['parameters']['query']
463
- ): RequestData<components['schemas']['FinancialEntryItemOut'][]> {
464
- return {
465
- params,
466
- method: 'post',
467
- url: '/consumers/{consumer_id}/accounting/financial-entries',
468
- body: financial_entry,
469
- };
470
- },
471
- createJournalEntryOld(
472
- journal_entry: components['schemas']['JournalEntryIn']
473
- ): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan']> {
474
- return {
475
- method: 'post',
476
- url: '/consumers/{consumer_id}/accounting/journal/entries',
477
- body: journal_entry,
478
- };
479
- },
480
- createJournalEntry(
481
- journal_entry: components['schemas']['GenericJournalEntry'],
482
- params?: operations['accounting_create_generic_journal_entry']['parameters']['query']
483
- ): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan']> {
484
- return {
485
- params,
486
- method: 'post',
487
- url: '/consumers/{consumer_id}/accounting/journal-entries',
488
- body: journal_entry,
489
- };
490
- },
491
- matchEntries(
492
- body: components['schemas']['MatchingIn'],
493
- params?: operations['accounting_match_entries']['parameters']['query']
494
- ): RequestData<components['schemas']['MatchingOut']> {
495
- return {
496
- params,
497
- body,
498
- method: 'post',
499
- url: '/consumers/{consumer_id}/accounting/matching',
500
- };
501
- },
502
- getFolders(): RequestData<components['schemas']['FolderItem'][]> {
503
- return {
504
- method: 'get',
505
- url: '/consumers/{consumer_id}/accounting/folders',
506
- };
507
- },
508
- };
509
-
510
- export { accountingFactory };
@@ -1,35 +0,0 @@
1
- import { AuthType } from '../types/api';
2
- import { InternalAPI } from './internalApi';
3
- import { Consumers } from './consumers';
4
- import { Syncs, SyncsAPI } from './syncs';
5
- import { Integrations } from './integrations';
6
- import { Webhooks } from './webhooks';
7
- import { DataStores } from './datastores';
8
-
9
- export class API {
10
- auth: AuthType;
11
- token?: string;
12
- internalApi?: any;
13
- Consumers;
14
- Syncs: SyncsAPI;
15
- Integrations;
16
- Webhooks;
17
- DataStores;
18
-
19
- constructor(auth: AuthType) {
20
- this.auth = auth;
21
- this._setup();
22
- this.Consumers = Consumers(this.internalApi);
23
- this.Syncs = Syncs(this.internalApi);
24
- this.Integrations = Integrations(this.internalApi);
25
- this.Webhooks = Webhooks(this.internalApi);
26
- this.DataStores = DataStores(this.internalApi);
27
- }
28
-
29
- private _setup = async () => {
30
- if (!this.auth.clientId || !this.auth.clientSecret || !this.auth.accountId) {
31
- throw new Error('Missing mandatory auth parameters');
32
- }
33
- this.internalApi = new InternalAPI(this.auth);
34
- };
35
- }