@chift/chift-nodejs 1.0.18 → 1.0.19

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 (73) hide show
  1. package/dist/src/helpers/openapi.d.ts +3 -0
  2. package/dist/src/helpers/openapi.js +18 -0
  3. package/dist/src/helpers/settings.d.ts +4 -0
  4. package/dist/src/helpers/settings.js +5 -0
  5. package/dist/src/index.d.ts +1 -0
  6. package/dist/src/modules/accounting.d.ts +68 -0
  7. package/dist/src/modules/accounting.js +326 -0
  8. package/dist/src/modules/api.d.ts +18351 -0
  9. package/dist/src/modules/api.js +36 -0
  10. package/dist/src/modules/consumer.d.ts +3622 -0
  11. package/dist/src/modules/consumer.js +142 -0
  12. package/dist/src/modules/consumers.d.ts +18237 -0
  13. package/dist/src/modules/consumers.js +51 -0
  14. package/dist/src/modules/custom.d.ts +8 -0
  15. package/dist/src/modules/custom.js +36 -0
  16. package/dist/src/modules/datastores.d.ts +18 -0
  17. package/dist/src/modules/datastores.js +23 -0
  18. package/dist/src/modules/ecommerce.d.ts +24 -0
  19. package/dist/src/modules/ecommerce.js +97 -0
  20. package/dist/src/modules/flow.d.ts +15 -0
  21. package/dist/src/modules/flow.js +156 -0
  22. package/dist/src/modules/integrations.d.ts +23 -0
  23. package/dist/src/modules/integrations.js +23 -0
  24. package/dist/src/modules/internalApi.d.ts +24 -0
  25. package/dist/src/modules/internalApi.js +175 -0
  26. package/dist/src/modules/invoicing.d.ts +20 -0
  27. package/dist/src/modules/invoicing.js +90 -0
  28. package/dist/src/modules/payment.d.ts +14 -0
  29. package/dist/src/modules/payment.js +41 -0
  30. package/dist/src/modules/pms.d.ts +15 -0
  31. package/dist/src/modules/pms.js +47 -0
  32. package/dist/src/modules/pos.d.ts +26 -0
  33. package/dist/src/modules/pos.js +101 -0
  34. package/dist/src/modules/sync.d.ts +14654 -0
  35. package/dist/src/modules/sync.js +73 -0
  36. package/dist/src/modules/syncs.d.ts +11 -0
  37. package/dist/src/modules/syncs.js +39 -0
  38. package/dist/src/modules/webhooks.d.ts +58 -0
  39. package/dist/src/modules/webhooks.js +53 -0
  40. package/{src/types/api.ts → dist/src/types/api.d.ts} +4 -12
  41. package/dist/src/types/api.js +2 -0
  42. package/{src/types/consumers.ts → dist/src/types/consumers.d.ts} +0 -1
  43. package/dist/src/types/consumers.js +2 -0
  44. package/dist/src/types/public-api/mappings.js +2 -0
  45. package/dist/src/types/public-api/schema.d.ts +15294 -0
  46. package/{src/types/sync.ts → dist/src/types/sync.d.ts} +5 -6
  47. package/dist/src/types/sync.js +2 -0
  48. package/dist/test/modules/accounting.test.d.ts +1 -0
  49. package/dist/test/modules/accounting.test.js +590 -0
  50. package/dist/test/modules/consumer.test.d.ts +1 -0
  51. package/dist/test/modules/consumer.test.js +89 -0
  52. package/dist/test/modules/consumers.test.d.ts +1 -0
  53. package/dist/test/modules/consumers.test.js +109 -0
  54. package/dist/test/modules/ecommerce.test.d.ts +1 -0
  55. package/dist/test/modules/ecommerce.test.js +224 -0
  56. package/dist/test/modules/integrations.test.d.ts +1 -0
  57. package/dist/test/modules/integrations.test.js +54 -0
  58. package/dist/test/modules/invoicing.test.d.ts +1 -0
  59. package/dist/test/modules/invoicing.test.js +115 -0
  60. package/dist/test/modules/payment.test.d.ts +1 -0
  61. package/dist/test/modules/payment.test.js +88 -0
  62. package/dist/test/modules/pms.test.d.ts +1 -0
  63. package/dist/test/modules/pms.test.js +90 -0
  64. package/dist/test/modules/pos.test.d.ts +1 -0
  65. package/dist/test/modules/pos.test.js +179 -0
  66. package/dist/test/modules/sync.test.d.ts +1 -0
  67. package/dist/test/modules/sync.test.js +93 -0
  68. package/dist/test/modules/syncs.test.d.ts +1 -0
  69. package/dist/test/modules/syncs.test.js +53 -0
  70. package/dist/test/modules/webhooks.test.d.ts +1 -0
  71. package/dist/test/modules/webhooks.test.js +120 -0
  72. package/package.json +3 -2
  73. /package/{src/types/public-api/mappings.ts → dist/src/types/public-api/mappings.d.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ import { InternalAPI } from '../modules/internalApi';
2
+ import { RequestFactory, ApiFor } from '../types/api';
3
+ export declare function createApiFor<TFactory extends RequestFactory>(factory: TFactory, internalApi: InternalAPI, consumerName: string, consumerId: string): ApiFor<TFactory>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createApiFor = void 0;
4
+ function createApiFor(factory, internalApi, consumerName, consumerId) {
5
+ return new Proxy(factory, {
6
+ get(target, property) {
7
+ return (...args) => {
8
+ const requestData = target[property](...args);
9
+ requestData.property = property;
10
+ requestData.consumerName = consumerName;
11
+ requestData.consumerId = consumerId;
12
+ requestData.url = requestData.url.replace('{consumer_id}', consumerId);
13
+ return internalApi.makeRequest(requestData);
14
+ };
15
+ },
16
+ });
17
+ }
18
+ exports.createApiFor = createApiFor;
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ BASE_URL: string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ BASE_URL: 'https://api.chift.eu',
5
+ };
@@ -0,0 +1 @@
1
+ export * from './modules/api';
@@ -0,0 +1,68 @@
1
+ import { operations, components } from '../types/public-api/schema';
2
+ import { AutoPaginatedParams, RequestData } from '../types/api';
3
+ type GetChartOfAccountsParams = AutoPaginatedParams<operations['accounting_get_chart_of_accounts']['parameters']['query']>;
4
+ type GetMiscOperationsParams = AutoPaginatedParams<operations['accounting_get_miscellaneous_operations']['parameters']['query']>;
5
+ type GetInvoicesByTypeWithMultiplePlansParams = AutoPaginatedParams<operations['accounting_get_invoices_by_type_multi_analytic_plans']['parameters']['query']>;
6
+ type GetInvoicesByTypeParams = AutoPaginatedParams<operations['accounting_get_invoices_by_type']['parameters']['query']>;
7
+ type GetOutstandingsParams = AutoPaginatedParams<operations['accounting_get_outstandings']['parameters']['query']>;
8
+ type GetAnalyticPlansParams = AutoPaginatedParams<operations['accounting_get_analytic_plans']['parameters']['query']>;
9
+ type GetVatCodesParams = AutoPaginatedParams<operations['accounting_get_vat_codes']['parameters']['query']>;
10
+ type GetJournalsParams = AutoPaginatedParams<operations['accounting_get_journals']['parameters']['query']>;
11
+ type GetJournalEntriesParams = AutoPaginatedParams<operations['accounting_get_journal_entries']['parameters']['query']>;
12
+ type GetJournalEntriesWithMultiplePlansParams = AutoPaginatedParams<operations['accounting_get_journal_entries_mutli_plan']['parameters']['query']>;
13
+ type GetEmployeesParams = AutoPaginatedParams<operations['accounting_get_employees']['parameters']['query']>;
14
+ type GetAttachmentsParams = AutoPaginatedParams<operations['accounting_get_attachments']['parameters']['query']>;
15
+ type GetBalanceOfAccountsParams = AutoPaginatedParams<operations['accounting_get_accounts_balances']['parameters']['query']>;
16
+ type GetClientsParams = AutoPaginatedParams<operations['accounting_get_clients']['parameters']['query']>;
17
+ type GetSuppliersParams = AutoPaginatedParams<operations['accounting_get_suppliers']['parameters']['query']>;
18
+ type GetAnalyticAccountsParams = AutoPaginatedParams<operations['accounting_get_analytic_accounts']['parameters']['query']>;
19
+ type GetAnalyticAccountsWithMultiplePlansParams = AutoPaginatedParams<operations['accounting_get_analytic_accounts_multi_plans']['parameters']['query']>;
20
+ declare const accountingFactory: {
21
+ getAnalyticPlans(params?: GetAnalyticPlansParams): RequestData<components['schemas']['AnalyticPlanItem'][]>;
22
+ getClients(params?: GetClientsParams): RequestData<components['schemas']['ClientItemOut'][]>;
23
+ createClient(client: components['schemas']['ClientItemIn'], params?: operations['accounting_create_client']['parameters']['query']): RequestData<components['schemas']['ClientItemOut']>;
24
+ getClient(clientId: string, params?: operations['accounting_get_client']['parameters']['query']): RequestData<components['schemas']['ClientItemOut']>;
25
+ updateClient(clientId: string, client: components['schemas']['ClientItemUpdate'], params?: operations['accounting_update_client']['parameters']['query']): RequestData<components['schemas']['ClientItemOut']>;
26
+ getSuppliers(params?: GetSuppliersParams): RequestData<components['schemas']['SupplierItemOut'][]>;
27
+ createSupplier(supplier: components['schemas']['SupplierItemIn'], params?: operations['accounting_create_supplier']['parameters']['query']): RequestData<components['schemas']['SupplierItemOut']>;
28
+ getSupplier(supplierId: string, params?: operations['accounting_get_supplier']['parameters']['query']): RequestData<components['schemas']['SupplierItemOut']>;
29
+ updateSupplier(supplierId: string, supplier: components['schemas']['SupplierItemUpdate'], params?: operations['accounting_update_supplier']['parameters']['query']): RequestData<components['schemas']['SupplierItemOut']>;
30
+ createInvoice(invoice: components['schemas']['InvoiceItemInMonoAnalyticPlan'], params?: operations['accounting_create_invoice']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan']>;
31
+ createInvoiceWithMultiplePlans(invoice: components['schemas']['InvoiceItemInMultiAnalyticPlans'], params?: operations['accounting_create_invoice_multiple_plans']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans']>;
32
+ getInvoicesByType(invoice_type: components['schemas']['backbone_api__app__routers__accounting__InvoiceType'], params?: GetInvoicesByTypeParams): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan'][]>;
33
+ getInvoice(invoiceId: string, params?: operations['accounting_get_invoice']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMonoAnalyticPlan']>;
34
+ getInvoiceWithMultiplePlans(invoiceId: string, params?: operations['accounting_get_invoice_multi_analytic_plans']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans']>;
35
+ getInvoicesByTypeWithMultiplePlans(invoice_type: components['schemas']['backbone_api__app__routers__accounting__InvoiceType'], params?: GetInvoicesByTypeWithMultiplePlansParams): RequestData<components['schemas']['InvoiceItemOutMultiAnalyticPlans'][]>;
36
+ createAnalyticAccount(analyticAccount: components['schemas']['AnalyticAccountItemIn'], params?: operations['accounting_create_analytic_account']['parameters']['query']): RequestData<components['schemas']['AnalyticAccountItemOut']>;
37
+ getAnalyticAccounts(params?: GetAnalyticAccountsParams): RequestData<components['schemas']['AnalyticAccountItemOut'][]>;
38
+ createAnalyticAccountWithMultiplePlans(analytic_plan: string, analyticAccount: components['schemas']['AnalyticAccountItemIn'], params?: operations['accounting_create_analytic_account_multi_plans']['parameters']['query']): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
39
+ getAnalyticAccount(analytic_account_id: string, params?: operations['accounting_get_analytic_account']['parameters']['query']): RequestData<components['schemas']['AnalyticAccountItemOut']>;
40
+ updateAnalyticAccount(analytic_account_id: string, analyticAccount: components['schemas']['AnalyticAccountItemUpdate'], params?: operations['accounting_update_analytic_account']['parameters']['query']): RequestData<components['schemas']['AnalyticAccountItemOut']>;
41
+ getAnalyticAccountWithMultiplePlans(analytic_account_id: string, analytic_plan: string, params?: operations['accounting_get_analytic_account_multi_plans']['parameters']['query']): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
42
+ updateAnalyticAccountWithMultiplePlans(analytic_account_id: string, analytic_plan: string, analyticAccount: components['schemas']['AnalyticAccountItemUpdate'], params?: operations['accounting_update_analytic_account_multi_plans']['parameters']['query']): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans']>;
43
+ getAnalyticAccountsWithMultiplePlans(params?: GetAnalyticAccountsWithMultiplePlansParams): RequestData<components['schemas']['AnalyticAccountItemOutMultiAnalyticPlans'][]>;
44
+ getJournalEntries(params: GetJournalEntriesParams): RequestData<components['schemas']['JournalEntryMonoAnalyticPlan'][]>;
45
+ getJournalEntriesWithMultiplePlans(params: GetJournalEntriesWithMultiplePlansParams): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan'][]>;
46
+ getPaymentsByInvoiceId(invoice_id: string, params?: operations['accounting_get_payments_by_invoice']['parameters']['query']): RequestData<components['schemas']['Payment'][]>;
47
+ getJournals(params?: GetJournalsParams): RequestData<components['schemas']['Journal'][]>;
48
+ getVatCodes(params?: GetVatCodesParams): RequestData<components['schemas']['backbone_api__app__routers__accounting__VatCode'][]>;
49
+ getMiscOperations(params?: GetMiscOperationsParams): RequestData<components['schemas']['MiscellaneousOperationOut'][]>;
50
+ createMiscOperation(operation: components['schemas']['MiscellaneousOperationIn'], params?: operations['accounting_create_miscellaneous_operation']['parameters']['query']): RequestData<components['schemas']['MiscellaneousOperationOut']>;
51
+ getMiscOperation(operation_id: string, params?: operations['accounting_get_miscellaneous_operation']['parameters']['query']): RequestData<components['schemas']['MiscellaneousOperationOut']>;
52
+ attachPDF(invoice_id: string, attachment: components['schemas']['AttachmentItem'], params?: operations['accounting_add_attachment']['parameters']['query']): RequestData<operations['accounting_add_attachment']['responses'][201]>;
53
+ getAttachments(params: GetAttachmentsParams): RequestData<components['schemas']['AttachmentItem'][]>;
54
+ getChartOfAccounts(params?: GetChartOfAccountsParams): RequestData<components['schemas']['AccountItem'][]>;
55
+ getBalanceOfAccounts(filter: components['schemas']['AccountBalanceFilter'], params?: GetBalanceOfAccountsParams): RequestData<components['schemas']['AccountBalance'][]>;
56
+ getEmployees(params?: GetEmployeesParams): RequestData<components['schemas']['EmployeeItem'][]>;
57
+ getOutstandings(params: GetOutstandingsParams): RequestData<components['schemas']['OutstandingItem'][]>;
58
+ /**
59
+ * @deprecated replaced by createFinancialEntry
60
+ */
61
+ createFinancialEntryOld(financial_entry: components['schemas']['FinancialEntryItemInOld'], params?: operations['accounting_create_financial_entry']['parameters']['query']): RequestData<components['schemas']['FinancialEntryItemOutOld']>;
62
+ createFinancialEntry(financial_entry: components['schemas']['FinancialEntryItemIn'], params?: operations['accounting_create_financial_entries']['parameters']['query']): RequestData<components['schemas']['FinancialEntryItemOut'][]>;
63
+ createJournalEntryOld(journal_entry: components['schemas']['JournalEntryIn']): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan']>;
64
+ createJournalEntry(journal_entry: components['schemas']['GenericJournalEntry'], params?: operations['accounting_create_generic_journal_entry']['parameters']['query']): RequestData<components['schemas']['JournalEntryMultiAnalyticPlan']>;
65
+ matchEntries(body: components['schemas']['MatchingIn'], params?: operations['accounting_match_entries']['parameters']['query']): RequestData<components['schemas']['MatchingOut']>;
66
+ getFolders(): RequestData<components['schemas']['FolderItem'][]>;
67
+ };
68
+ export { accountingFactory };
@@ -0,0 +1,326 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.accountingFactory = void 0;
4
+ const accountingFactory = {
5
+ getAnalyticPlans(params) {
6
+ return {
7
+ params,
8
+ method: 'get',
9
+ url: '/consumers/{consumer_id}/accounting/analytic-plans',
10
+ };
11
+ },
12
+ getClients(params) {
13
+ return {
14
+ params,
15
+ method: 'get',
16
+ url: '/consumers/{consumer_id}/accounting/clients',
17
+ };
18
+ },
19
+ createClient(client, params) {
20
+ return {
21
+ params,
22
+ method: 'post',
23
+ url: '/consumers/{consumer_id}/accounting/clients',
24
+ body: client,
25
+ };
26
+ },
27
+ getClient(clientId, params) {
28
+ return {
29
+ params,
30
+ method: 'get',
31
+ url: `/consumers/{consumer_id}/accounting/clients/${clientId}`,
32
+ };
33
+ },
34
+ updateClient(clientId, client, params) {
35
+ return {
36
+ params,
37
+ method: 'patch',
38
+ url: `/consumers/{consumer_id}/accounting/clients/${clientId}`,
39
+ body: client,
40
+ };
41
+ },
42
+ getSuppliers(params) {
43
+ return {
44
+ params,
45
+ method: 'get',
46
+ url: '/consumers/{consumer_id}/accounting/suppliers',
47
+ };
48
+ },
49
+ createSupplier(supplier, params) {
50
+ return {
51
+ params,
52
+ method: 'post',
53
+ url: '/consumers/{consumer_id}/accounting/suppliers',
54
+ body: supplier,
55
+ };
56
+ },
57
+ getSupplier(supplierId, params) {
58
+ return {
59
+ params,
60
+ method: 'get',
61
+ url: `/consumers/{consumer_id}/accounting/suppliers/${supplierId}`,
62
+ };
63
+ },
64
+ updateSupplier(supplierId, supplier, params) {
65
+ return {
66
+ params,
67
+ method: 'patch',
68
+ url: `/consumers/{consumer_id}/accounting/suppliers/${supplierId}`,
69
+ body: supplier,
70
+ };
71
+ },
72
+ createInvoice(invoice, params) {
73
+ return {
74
+ params,
75
+ method: 'post',
76
+ url: '/consumers/{consumer_id}/accounting/invoices',
77
+ body: invoice,
78
+ };
79
+ },
80
+ createInvoiceWithMultiplePlans(invoice, params) {
81
+ return {
82
+ params,
83
+ method: 'post',
84
+ url: '/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans',
85
+ body: invoice,
86
+ };
87
+ },
88
+ getInvoicesByType(invoice_type, params) {
89
+ return {
90
+ params,
91
+ method: 'get',
92
+ url: `/consumers/{consumer_id}/accounting/invoices/type/${invoice_type}`,
93
+ };
94
+ },
95
+ getInvoice(invoiceId, params) {
96
+ return {
97
+ params,
98
+ method: 'get',
99
+ url: `/consumers/{consumer_id}/accounting/invoices/${invoiceId}`,
100
+ };
101
+ },
102
+ getInvoiceWithMultiplePlans(invoiceId, params) {
103
+ return {
104
+ params,
105
+ method: 'get',
106
+ url: `/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans/${invoiceId}`,
107
+ };
108
+ },
109
+ getInvoicesByTypeWithMultiplePlans(invoice_type, params) {
110
+ return {
111
+ params,
112
+ method: 'get',
113
+ url: `/consumers/{consumer_id}/accounting/invoices/multi-analytic-plans/type/${invoice_type}`,
114
+ };
115
+ },
116
+ createAnalyticAccount(analyticAccount, params) {
117
+ return {
118
+ params,
119
+ method: 'post',
120
+ url: '/consumers/{consumer_id}/accounting/analytic-accounts',
121
+ body: analyticAccount,
122
+ };
123
+ },
124
+ getAnalyticAccounts(params) {
125
+ return {
126
+ params,
127
+ method: 'get',
128
+ url: '/consumers/{consumer_id}/accounting/analytic-accounts',
129
+ };
130
+ },
131
+ createAnalyticAccountWithMultiplePlans(analytic_plan, analyticAccount, params) {
132
+ return {
133
+ params,
134
+ method: 'post',
135
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/multi-analytic-plans/${analytic_plan}`,
136
+ body: analyticAccount,
137
+ };
138
+ },
139
+ getAnalyticAccount(analytic_account_id, params) {
140
+ return {
141
+ params,
142
+ method: 'get',
143
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}`,
144
+ };
145
+ },
146
+ updateAnalyticAccount(analytic_account_id, analyticAccount, params) {
147
+ return {
148
+ params,
149
+ method: 'patch',
150
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}`,
151
+ body: analyticAccount,
152
+ };
153
+ },
154
+ getAnalyticAccountWithMultiplePlans(analytic_account_id, analytic_plan, params) {
155
+ return {
156
+ params,
157
+ method: 'get',
158
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}/multi-analytic-plans/${analytic_plan}`,
159
+ };
160
+ },
161
+ updateAnalyticAccountWithMultiplePlans(analytic_account_id, analytic_plan, analyticAccount, params) {
162
+ return {
163
+ params,
164
+ method: 'patch',
165
+ url: `/consumers/{consumer_id}/accounting/analytic-accounts/${analytic_account_id}/multi-analytic-plans/${analytic_plan}`,
166
+ body: analyticAccount,
167
+ };
168
+ },
169
+ getAnalyticAccountsWithMultiplePlans(params) {
170
+ return {
171
+ params,
172
+ method: 'get',
173
+ url: '/consumers/{consumer_id}/accounting/analytic-accounts/multi-analytic-plans',
174
+ };
175
+ },
176
+ getJournalEntries(params) {
177
+ return {
178
+ params,
179
+ method: 'get',
180
+ url: `/consumers/{consumer_id}/accounting/journal/entries`,
181
+ };
182
+ },
183
+ getJournalEntriesWithMultiplePlans(params) {
184
+ return {
185
+ params,
186
+ method: 'get',
187
+ url: `/consumers/{consumer_id}/accounting/journal/entries/multi-analytic-plans`,
188
+ };
189
+ },
190
+ getPaymentsByInvoiceId(invoice_id, params) {
191
+ return {
192
+ params,
193
+ method: 'get',
194
+ url: `/consumers/{consumer_id}/accounting/invoices/id/${invoice_id}/payments`,
195
+ };
196
+ },
197
+ getJournals(params) {
198
+ return {
199
+ params,
200
+ method: 'get',
201
+ url: `/consumers/{consumer_id}/accounting/journals`,
202
+ };
203
+ },
204
+ getVatCodes(params) {
205
+ return {
206
+ params,
207
+ method: 'get',
208
+ url: `/consumers/{consumer_id}/accounting/vat-codes`,
209
+ };
210
+ },
211
+ getMiscOperations(params) {
212
+ return {
213
+ params,
214
+ method: 'get',
215
+ url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
216
+ };
217
+ },
218
+ createMiscOperation(operation, params) {
219
+ return {
220
+ params,
221
+ method: 'post',
222
+ url: '/consumers/{consumer_id}/accounting/miscellaneous-operation',
223
+ body: operation,
224
+ };
225
+ },
226
+ getMiscOperation(operation_id, params) {
227
+ return {
228
+ params,
229
+ method: 'get',
230
+ url: `/consumers/{consumer_id}/accounting/miscellaneous-operation/${operation_id}`,
231
+ };
232
+ },
233
+ attachPDF(invoice_id, attachment, params) {
234
+ return {
235
+ params,
236
+ method: 'post',
237
+ url: `/consumers/{consumer_id}/accounting/invoices/pdf/${invoice_id}`,
238
+ body: attachment,
239
+ };
240
+ },
241
+ getAttachments(params) {
242
+ return {
243
+ params,
244
+ method: 'get',
245
+ url: `/consumers/{consumer_id}/accounting/attachments`,
246
+ };
247
+ },
248
+ getChartOfAccounts(params) {
249
+ return {
250
+ params,
251
+ method: 'get',
252
+ url: '/consumers/{consumer_id}/accounting/chart-of-accounts',
253
+ };
254
+ },
255
+ getBalanceOfAccounts(filter, params) {
256
+ return {
257
+ params,
258
+ method: 'post',
259
+ url: '/consumers/{consumer_id}/accounting/chart-of-accounts/balance',
260
+ body: filter,
261
+ };
262
+ },
263
+ getEmployees(params) {
264
+ return {
265
+ params,
266
+ method: 'get',
267
+ url: '/consumers/{consumer_id}/accounting/employees',
268
+ };
269
+ },
270
+ getOutstandings(params) {
271
+ return {
272
+ params,
273
+ method: 'get',
274
+ url: '/consumers/{consumer_id}/accounting/outstandings',
275
+ };
276
+ },
277
+ /**
278
+ * @deprecated replaced by createFinancialEntry
279
+ */
280
+ createFinancialEntryOld(financial_entry, params) {
281
+ return {
282
+ params,
283
+ method: 'post',
284
+ url: '/consumers/{consumer_id}/accounting/financial-entry',
285
+ body: financial_entry,
286
+ };
287
+ },
288
+ createFinancialEntry(financial_entry, params) {
289
+ return {
290
+ params,
291
+ method: 'post',
292
+ url: '/consumers/{consumer_id}/accounting/financial-entries',
293
+ body: financial_entry,
294
+ };
295
+ },
296
+ createJournalEntryOld(journal_entry) {
297
+ return {
298
+ method: 'post',
299
+ url: '/consumers/{consumer_id}/accounting/journal/entries',
300
+ body: journal_entry,
301
+ };
302
+ },
303
+ createJournalEntry(journal_entry, params) {
304
+ return {
305
+ params,
306
+ method: 'post',
307
+ url: '/consumers/{consumer_id}/accounting/journal-entries',
308
+ body: journal_entry,
309
+ };
310
+ },
311
+ matchEntries(body, params) {
312
+ return {
313
+ params,
314
+ body,
315
+ method: 'post',
316
+ url: '/consumers/{consumer_id}/accounting/matching',
317
+ };
318
+ },
319
+ getFolders() {
320
+ return {
321
+ method: 'get',
322
+ url: '/consumers/{consumer_id}/accounting/folders',
323
+ };
324
+ },
325
+ };
326
+ exports.accountingFactory = accountingFactory;