@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.
- package/README.md +3 -3
- package/package.json +5 -2
- package/src/types/public-api/schema.d.ts +4071 -850
- package/src/types/sync.ts +20 -5
- package/.eslintcache +0 -1
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -25
- package/.github/workflows/ci.yml +0 -75
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -1
- package/.prettierrc.json +0 -7
- package/CHANGELOG.md +0 -98
- package/coverage/clover.xml +0 -1645
- package/coverage/coverage-final.json +0 -19
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -146
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/helpers/index.html +0 -131
- package/coverage/lcov-report/src/helpers/openapi.ts.html +0 -151
- package/coverage/lcov-report/src/helpers/settings.ts.html +0 -94
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/index.ts.html +0 -88
- package/coverage/lcov-report/src/modules/accounting.ts.html +0 -1156
- package/coverage/lcov-report/src/modules/api.ts.html +0 -190
- package/coverage/lcov-report/src/modules/consumer.ts.html +0 -616
- package/coverage/lcov-report/src/modules/consumers.ts.html +0 -331
- package/coverage/lcov-report/src/modules/custom.ts.html +0 -193
- package/coverage/lcov-report/src/modules/datastores.ts.html +0 -142
- package/coverage/lcov-report/src/modules/ecommerce.ts.html +0 -331
- package/coverage/lcov-report/src/modules/flow.ts.html +0 -589
- package/coverage/lcov-report/src/modules/index.html +0 -326
- package/coverage/lcov-report/src/modules/integrations.ts.html +0 -151
- package/coverage/lcov-report/src/modules/internalApi.ts.html +0 -586
- package/coverage/lcov-report/src/modules/invoicing.ts.html +0 -391
- package/coverage/lcov-report/src/modules/pos.ts.html +0 -421
- package/coverage/lcov-report/src/modules/sync.ts.html +0 -316
- package/coverage/lcov-report/src/modules/syncs.ts.html +0 -169
- package/coverage/lcov-report/src/modules/webhooks.ts.html +0 -343
- package/coverage/lcov.info +0 -1976
- package/dist/src/helpers/openapi.d.ts +0 -3
- package/dist/src/helpers/openapi.js +0 -18
- package/dist/src/helpers/settings.d.ts +0 -4
- package/dist/src/helpers/settings.js +0 -5
- package/dist/src/index.d.ts +0 -1
- package/dist/src/modules/accounting.d.ts +0 -68
- package/dist/src/modules/accounting.js +0 -326
- package/dist/src/modules/api.d.ts +0 -16795
- package/dist/src/modules/api.js +0 -36
- package/dist/src/modules/consumer.d.ts +0 -3313
- package/dist/src/modules/consumer.js +0 -139
- package/dist/src/modules/consumers.d.ts +0 -16684
- package/dist/src/modules/consumers.js +0 -51
- package/dist/src/modules/custom.d.ts +0 -8
- package/dist/src/modules/custom.js +0 -36
- package/dist/src/modules/datastores.d.ts +0 -18
- package/dist/src/modules/datastores.js +0 -23
- package/dist/src/modules/ecommerce.d.ts +0 -24
- package/dist/src/modules/ecommerce.js +0 -97
- package/dist/src/modules/flow.d.ts +0 -15
- package/dist/src/modules/flow.js +0 -156
- package/dist/src/modules/integrations.d.ts +0 -23
- package/dist/src/modules/integrations.js +0 -23
- package/dist/src/modules/internalApi.d.ts +0 -24
- package/dist/src/modules/internalApi.js +0 -175
- package/dist/src/modules/invoicing.d.ts +0 -20
- package/dist/src/modules/invoicing.js +0 -90
- package/dist/src/modules/pms.d.ts +0 -15
- package/dist/src/modules/pms.js +0 -47
- package/dist/src/modules/pos.d.ts +0 -26
- package/dist/src/modules/pos.js +0 -101
- package/dist/src/modules/sync.d.ts +0 -13414
- package/dist/src/modules/sync.js +0 -73
- package/dist/src/modules/syncs.d.ts +0 -11
- package/dist/src/modules/syncs.js +0 -39
- package/dist/src/modules/webhooks.d.ts +0 -55
- package/dist/src/modules/webhooks.js +0 -53
- package/dist/src/types/api.d.ts +0 -29
- package/dist/src/types/api.js +0 -2
- package/dist/src/types/consumers.d.ts +0 -8
- package/dist/src/types/consumers.js +0 -2
- package/dist/src/types/public-api/mappings.d.ts +0 -21
- package/dist/src/types/public-api/mappings.js +0 -2
- package/dist/src/types/public-api/schema.d.ts +0 -12003
- package/dist/src/types/public-api/schema.js +0 -6
- package/dist/src/types/sync.d.ts +0 -20
- package/dist/src/types/sync.js +0 -2
- package/dist/test/modules/accounting.test.d.ts +0 -1
- package/dist/test/modules/accounting.test.js +0 -582
- package/dist/test/modules/consumer.test.d.ts +0 -1
- package/dist/test/modules/consumer.test.js +0 -89
- package/dist/test/modules/consumers.test.d.ts +0 -1
- package/dist/test/modules/consumers.test.js +0 -109
- package/dist/test/modules/ecommerce.test.d.ts +0 -1
- package/dist/test/modules/ecommerce.test.js +0 -220
- package/dist/test/modules/integrations.test.d.ts +0 -1
- package/dist/test/modules/integrations.test.js +0 -54
- package/dist/test/modules/invoicing.test.d.ts +0 -1
- package/dist/test/modules/invoicing.test.js +0 -108
- package/dist/test/modules/pos.test.d.ts +0 -1
- package/dist/test/modules/pos.test.js +0 -182
- package/dist/test/modules/sync.test.d.ts +0 -1
- package/dist/test/modules/sync.test.js +0 -81
- package/dist/test/modules/syncs.test.d.ts +0 -1
- package/dist/test/modules/syncs.test.js +0 -53
- package/dist/test/modules/webhooks.test.d.ts +0 -1
- package/dist/test/modules/webhooks.test.js +0 -120
- package/jest.config.ts +0 -195
- package/src/helpers/openapi.ts +0 -22
- package/src/helpers/settings.ts +0 -3
- package/src/index.ts +0 -1
- package/src/modules/accounting.ts +0 -510
- package/src/modules/api.ts +0 -35
- package/src/modules/consumer.ts +0 -213
- package/src/modules/consumers.ts +0 -82
- package/src/modules/custom.ts +0 -36
- package/src/modules/datastores.ts +0 -19
- package/src/modules/ecommerce.ts +0 -127
- package/src/modules/flow.ts +0 -168
- package/src/modules/integrations.ts +0 -24
- package/src/modules/internalApi.ts +0 -182
- package/src/modules/invoicing.ts +0 -114
- package/src/modules/pms.ts +0 -67
- package/src/modules/pos.ts +0 -144
- package/src/modules/sync.ts +0 -77
- package/src/modules/syncs.ts +0 -59
- package/src/modules/webhooks.ts +0 -86
- package/src/types/public-api/schema.ts +0 -12073
- package/test/data/accounting_invoice.pdf +0 -0
- package/test/modules/accounting.test.ts +0 -628
- package/test/modules/consumer.test.ts +0 -68
- package/test/modules/consumers.test.ts +0 -85
- package/test/modules/ecommerce.test.ts +0 -208
- package/test/modules/integrations.test.ts +0 -22
- package/test/modules/invoicing.test.ts +0 -88
- package/test/modules/pos.test.ts +0 -166
- package/test/modules/sync.test.ts +0 -60
- package/test/modules/syncs.test.ts +0 -23
- package/test/modules/webhooks.test.ts +0 -92
- package/test/set_envs.sh +0 -14
- package/tsconfig.json +0 -107
|
@@ -1,3 +0,0 @@
|
|
|
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>;
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
package/dist/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './modules/api';
|
|
@@ -1,68 +0,0 @@
|
|
|
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']['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']['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']['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 };
|
|
@@ -1,326 +0,0 @@
|
|
|
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;
|