@chift/chift-nodejs 0.0.1
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/.eslintcache +1 -0
- package/.eslintignore +1 -0
- package/.eslintrc.json +25 -0
- package/.github/workflows/ci.yml +73 -0
- package/.husky/pre-commit +4 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +7 -0
- package/CHANGELOG.md +4 -0
- package/LICENSE +201 -0
- package/README.md +48 -0
- package/coverage/clover.xml +1645 -0
- package/coverage/coverage-final.json +19 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/helpers/index.html +131 -0
- package/coverage/lcov-report/src/helpers/openapi.ts.html +151 -0
- package/coverage/lcov-report/src/helpers/settings.ts.html +94 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/index.ts.html +88 -0
- package/coverage/lcov-report/src/modules/accounting.ts.html +1156 -0
- package/coverage/lcov-report/src/modules/api.ts.html +190 -0
- package/coverage/lcov-report/src/modules/consumer.ts.html +616 -0
- package/coverage/lcov-report/src/modules/consumers.ts.html +331 -0
- package/coverage/lcov-report/src/modules/custom.ts.html +193 -0
- package/coverage/lcov-report/src/modules/datastores.ts.html +142 -0
- package/coverage/lcov-report/src/modules/ecommerce.ts.html +331 -0
- package/coverage/lcov-report/src/modules/flow.ts.html +589 -0
- package/coverage/lcov-report/src/modules/index.html +326 -0
- package/coverage/lcov-report/src/modules/integrations.ts.html +151 -0
- package/coverage/lcov-report/src/modules/internalApi.ts.html +586 -0
- package/coverage/lcov-report/src/modules/invoicing.ts.html +391 -0
- package/coverage/lcov-report/src/modules/pos.ts.html +421 -0
- package/coverage/lcov-report/src/modules/sync.ts.html +316 -0
- package/coverage/lcov-report/src/modules/syncs.ts.html +169 -0
- package/coverage/lcov-report/src/modules/webhooks.ts.html +343 -0
- package/coverage/lcov.info +1976 -0
- package/dist/src/helpers/openapi.d.ts +3 -0
- package/dist/src/helpers/openapi.js +18 -0
- package/dist/src/helpers/settings.d.ts +4 -0
- package/dist/src/helpers/settings.js +5 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +17 -0
- package/dist/src/modules/accounting.d.ts +48 -0
- package/dist/src/modules/accounting.js +255 -0
- package/dist/src/modules/api.d.ts +39333 -0
- package/dist/src/modules/api.js +36 -0
- package/dist/src/modules/consumer.d.ts +2588 -0
- package/dist/src/modules/consumer.js +118 -0
- package/dist/src/modules/consumers.d.ts +13034 -0
- package/dist/src/modules/consumers.js +51 -0
- package/dist/src/modules/custom.d.ts +8 -0
- package/dist/src/modules/custom.js +36 -0
- package/dist/src/modules/datastores.d.ts +18 -0
- package/dist/src/modules/datastores.js +23 -0
- package/dist/src/modules/ecommerce.d.ts +16 -0
- package/dist/src/modules/ecommerce.js +69 -0
- package/dist/src/modules/flow.d.ts +15 -0
- package/dist/src/modules/flow.js +156 -0
- package/dist/src/modules/integrations.d.ts +14 -0
- package/dist/src/modules/integrations.js +23 -0
- package/dist/src/modules/internalApi.d.ts +22 -0
- package/dist/src/modules/internalApi.js +160 -0
- package/dist/src/modules/invoicing.d.ts +18 -0
- package/dist/src/modules/invoicing.js +90 -0
- package/dist/src/modules/pos.d.ts +20 -0
- package/dist/src/modules/pos.js +80 -0
- package/dist/src/modules/sync.d.ts +10494 -0
- package/dist/src/modules/sync.js +75 -0
- package/dist/src/modules/syncs.d.ts +26200 -0
- package/dist/src/modules/syncs.js +29 -0
- package/dist/src/modules/webhooks.d.ts +55 -0
- package/dist/src/modules/webhooks.js +53 -0
- package/dist/src/types/api.d.ts +28 -0
- package/dist/src/types/api.js +2 -0
- package/dist/src/types/consumers.d.ts +8 -0
- package/dist/src/types/consumers.js +2 -0
- package/dist/src/types/public-api/mappings.d.ts +21 -0
- package/dist/src/types/public-api/mappings.js +2 -0
- package/dist/src/types/sync.d.ts +20 -0
- package/dist/src/types/sync.js +2 -0
- package/dist/test/modules/accounting.test.d.ts +1 -0
- package/dist/test/modules/accounting.test.js +453 -0
- package/dist/test/modules/consumer.test.d.ts +1 -0
- package/dist/test/modules/consumer.test.js +89 -0
- package/dist/test/modules/consumers.test.d.ts +1 -0
- package/dist/test/modules/consumers.test.js +109 -0
- package/dist/test/modules/ecommerce.test.d.ts +1 -0
- package/dist/test/modules/ecommerce.test.js +193 -0
- package/dist/test/modules/flow.test.d.ts +1 -0
- package/dist/test/modules/flow.test.js +69 -0
- package/dist/test/modules/integrations.test.d.ts +1 -0
- package/dist/test/modules/integrations.test.js +54 -0
- package/dist/test/modules/invoicing.test.d.ts +1 -0
- package/dist/test/modules/invoicing.test.js +108 -0
- package/dist/test/modules/pos.test.d.ts +1 -0
- package/dist/test/modules/pos.test.js +164 -0
- package/dist/test/modules/sync.test.d.ts +1 -0
- package/dist/test/modules/sync.test.js +81 -0
- package/dist/test/modules/syncs.test.d.ts +1 -0
- package/dist/test/modules/syncs.test.js +53 -0
- package/dist/test/modules/webhooks.test.d.ts +1 -0
- package/dist/test/modules/webhooks.test.js +120 -0
- package/jest.config.ts +195 -0
- package/package.json +47 -0
- package/src/helpers/openapi.ts +22 -0
- package/src/helpers/settings.ts +3 -0
- package/src/index.ts +1 -0
- package/src/modules/accounting.ts +357 -0
- package/src/modules/api.ts +35 -0
- package/src/modules/consumer.ts +177 -0
- package/src/modules/consumers.ts +82 -0
- package/src/modules/custom.ts +36 -0
- package/src/modules/datastores.ts +19 -0
- package/src/modules/ecommerce.ts +82 -0
- package/src/modules/flow.ts +168 -0
- package/src/modules/integrations.ts +22 -0
- package/src/modules/internalApi.ts +162 -0
- package/src/modules/invoicing.ts +106 -0
- package/src/modules/pos.ts +112 -0
- package/src/modules/sync.ts +77 -0
- package/src/modules/syncs.ts +28 -0
- package/src/modules/webhooks.ts +86 -0
- package/src/types/api.ts +35 -0
- package/src/types/consumers.ts +9 -0
- package/src/types/public-api/mappings.ts +21 -0
- package/src/types/public-api/schema.d.ts +9436 -0
- package/src/types/sync.ts +23 -0
- package/test/data/accounting_invoice.pdf +0 -0
- package/test/modules/accounting.test.ts +483 -0
- package/test/modules/consumer.test.ts +68 -0
- package/test/modules/consumers.test.ts +83 -0
- package/test/modules/ecommerce.test.ts +177 -0
- package/test/modules/integrations.test.ts +22 -0
- package/test/modules/invoicing.test.ts +88 -0
- package/test/modules/pos.test.ts +145 -0
- package/test/modules/sync.test.ts +60 -0
- package/test/modules/syncs.test.ts +23 -0
- package/test/modules/webhooks.test.ts +92 -0
- package/test/set_envs.sh +14 -0
- package/tsconfig.json +107 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invoicingFactory = void 0;
|
|
4
|
+
const invoicingFactory = {
|
|
5
|
+
getInvoices(params) {
|
|
6
|
+
return {
|
|
7
|
+
method: 'get',
|
|
8
|
+
url: `/consumers/{consumer_id}/invoicing/invoices`,
|
|
9
|
+
params: params,
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
getInvoiceById(invoiceId, params) {
|
|
13
|
+
return {
|
|
14
|
+
method: 'get',
|
|
15
|
+
url: `/consumers/{consumer_id}/invoicing/invoices/${invoiceId}`,
|
|
16
|
+
params: params,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
createInvoice(invoice) {
|
|
20
|
+
return {
|
|
21
|
+
method: 'create',
|
|
22
|
+
url: `/consumers/{consumer_id}/invoicing/invoices`,
|
|
23
|
+
body: invoice,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
getProducts() {
|
|
27
|
+
return {
|
|
28
|
+
method: 'get',
|
|
29
|
+
url: `/consumers/{consumer_id}/invoicing/products`,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
getProductById(productId) {
|
|
33
|
+
return {
|
|
34
|
+
method: 'get',
|
|
35
|
+
url: `/consumers/{consumer_id}/invoicing/products/${productId}`,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
createProduct(product) {
|
|
39
|
+
return {
|
|
40
|
+
method: 'create',
|
|
41
|
+
url: `/consumers/{consumer_id}/invoicing/products`,
|
|
42
|
+
body: product,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
getTaxes() {
|
|
46
|
+
return {
|
|
47
|
+
method: 'get',
|
|
48
|
+
url: `/consumers/{consumer_id}/invoicing/taxes`,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
getTaxById(taxId) {
|
|
52
|
+
return {
|
|
53
|
+
method: 'get',
|
|
54
|
+
url: `/consumers/{consumer_id}/invoicing/taxes/${taxId}`,
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
getOpportunities() {
|
|
58
|
+
return {
|
|
59
|
+
method: 'get',
|
|
60
|
+
url: `/consumers/{consumer_id}/invoicing/opportunities`,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
getOpportunitiesById(opportunityId) {
|
|
64
|
+
return {
|
|
65
|
+
method: 'get',
|
|
66
|
+
url: `/consumers/{consumer_id}/invoicing/opportunities/${opportunityId}`,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
getContacts(params) {
|
|
70
|
+
return {
|
|
71
|
+
method: 'get',
|
|
72
|
+
url: `/consumers/{consumer_id}/invoicing/contacts`,
|
|
73
|
+
params: params,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
getContactById(contactId) {
|
|
77
|
+
return {
|
|
78
|
+
method: 'get',
|
|
79
|
+
url: `/consumers/{consumer_id}/invoicing/contacts/${contactId}`,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
createContact(contact) {
|
|
83
|
+
return {
|
|
84
|
+
method: 'create',
|
|
85
|
+
url: `/consumers/{consumer_id}/invoicing/contacts`,
|
|
86
|
+
body: contact,
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
exports.invoicingFactory = invoicingFactory;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { operations, components } from '../types/public-api/schema';
|
|
2
|
+
import { RequestData } from '../types/api';
|
|
3
|
+
type getPaymentsParams = Omit<operations['pos_get_payments']['parameters']['query'], 'page' | 'size'>;
|
|
4
|
+
type getPaymentMethodsParams = Omit<operations['pos_get_payments_methods']['parameters']['query'], 'page' | 'size'>;
|
|
5
|
+
type getCustomersParams = Omit<operations['pos_get_customers']['parameters']['query'], 'page' | 'size'>;
|
|
6
|
+
type getOrdersParams = Omit<operations['pos_get_orders']['parameters']['query'], 'page' | 'size'>;
|
|
7
|
+
declare const posFactory: {
|
|
8
|
+
getLocations(): RequestData<components['schemas']['POSLocationItem'][]>;
|
|
9
|
+
getOrders(params: getOrdersParams): RequestData<components['schemas']['OrderItem'][]>;
|
|
10
|
+
getCustomers(params: getCustomersParams): RequestData<components['schemas']['POSCustomerItem'][]>;
|
|
11
|
+
getOrder(orderId: string): RequestData<components['schemas']['OrderItem']>;
|
|
12
|
+
getCustomer(customerId: string): RequestData<components['schemas']['POSCustomerItem']>;
|
|
13
|
+
createCustomer(customer: components['schemas']['POSCreateCustomerItem']): RequestData<components['schemas']['POSCustomerItem']>;
|
|
14
|
+
getPaymentMethods(params: getPaymentMethodsParams): RequestData<components['schemas']['PaymentMethods'][]>;
|
|
15
|
+
getSales(params: operations['pos_get_sales']['parameters']['query']): RequestData<components['schemas']['SalesItem']>;
|
|
16
|
+
getClosure(date: string, params: operations['pos_get_closure']['parameters']['query']): RequestData<components['schemas']['ClosureItem']>;
|
|
17
|
+
getPayments(params: getPaymentsParams): RequestData<components['schemas']['PaymentItem'][]>;
|
|
18
|
+
updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem']): RequestData<components['schemas']['OrderItem']>;
|
|
19
|
+
};
|
|
20
|
+
export { posFactory };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.posFactory = void 0;
|
|
4
|
+
const posFactory = {
|
|
5
|
+
getLocations() {
|
|
6
|
+
return {
|
|
7
|
+
method: 'get',
|
|
8
|
+
url: '/consumers/{consumer_id}/pos/locations',
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
getOrders(params) {
|
|
12
|
+
return {
|
|
13
|
+
params,
|
|
14
|
+
method: 'get',
|
|
15
|
+
url: '/consumers/{consumer_id}/pos/orders',
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
getCustomers(params) {
|
|
19
|
+
return {
|
|
20
|
+
params,
|
|
21
|
+
method: 'get',
|
|
22
|
+
url: '/consumers/{consumer_id}/pos/customers',
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
getOrder(orderId) {
|
|
26
|
+
return {
|
|
27
|
+
method: 'get',
|
|
28
|
+
url: `/consumers/{consumer_id}/pos/orders/${orderId}`,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
getCustomer(customerId) {
|
|
32
|
+
return {
|
|
33
|
+
method: 'get',
|
|
34
|
+
url: `/consumers/{consumer_id}/pos/customers/${customerId}`,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
createCustomer(customer) {
|
|
38
|
+
return {
|
|
39
|
+
method: 'create',
|
|
40
|
+
url: `/consumers/{consumer_id}/pos/customers`,
|
|
41
|
+
body: customer,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
getPaymentMethods(params) {
|
|
45
|
+
return {
|
|
46
|
+
params,
|
|
47
|
+
method: 'get',
|
|
48
|
+
url: `/consumers/{consumer_id}/pos/payment-methods`,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
getSales(params) {
|
|
52
|
+
return {
|
|
53
|
+
params,
|
|
54
|
+
method: 'get',
|
|
55
|
+
url: `/consumers/{consumer_id}/pos/sales`,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
getClosure(date, params) {
|
|
59
|
+
return {
|
|
60
|
+
params,
|
|
61
|
+
method: 'get',
|
|
62
|
+
url: `/consumers/{consumer_id}/pos/closures/${date}`,
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
getPayments(params) {
|
|
66
|
+
return {
|
|
67
|
+
params,
|
|
68
|
+
method: 'get',
|
|
69
|
+
url: `/consumers/{consumer_id}/pos/payments`,
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
updateOrder(orderId, order) {
|
|
73
|
+
return {
|
|
74
|
+
method: 'patch',
|
|
75
|
+
url: `/consumers/{consumer_id}/pos/orders/${orderId}`,
|
|
76
|
+
body: order,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
exports.posFactory = posFactory;
|