@chift/chift-nodejs 1.0.9 → 1.0.11
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/dist/src/modules/accounting.d.ts +27 -24
- package/dist/src/modules/accounting.js +76 -31
- package/dist/src/modules/api.d.ts +2447 -28202
- package/dist/src/modules/consumer.d.ts +478 -98
- package/dist/src/modules/consumer.js +10 -0
- package/dist/src/modules/consumers.d.ts +2475 -555
- package/dist/src/modules/ecommerce.d.ts +8 -0
- package/dist/src/modules/ecommerce.js +28 -0
- package/dist/src/modules/flow.js +1 -1
- package/dist/src/modules/integrations.d.ts +4 -2
- package/dist/src/modules/integrations.js +2 -2
- package/dist/src/modules/pos.d.ts +3 -1
- package/dist/src/modules/pos.js +7 -0
- package/dist/src/modules/sync.d.ts +1950 -414
- package/dist/src/modules/syncs.d.ts +8 -27677
- package/dist/src/modules/syncs.js +10 -0
- package/{src → dist/src}/types/public-api/schema.d.ts +1030 -1071
- package/dist/src/types/public-api/schema.js +6 -0
- package/dist/test/modules/accounting.test.js +28 -11
- package/dist/test/modules/ecommerce.test.js +34 -7
- package/dist/test/modules/pos.test.js +10 -5
- package/package.json +1 -1
- package/src/types/public-api/schema.ts +11275 -0
- package/dist/test/modules/flow.test.d.ts +0 -1
- package/dist/test/modules/flow.test.js +0 -69
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { operations, components } from '../types/public-api/schema';
|
|
2
2
|
import { RequestData } from '../types/api';
|
|
3
3
|
type getOrdersParams = Omit<operations['ecommerce_get_orders']['parameters']['query'], 'page' | 'size'>;
|
|
4
|
+
type getPaymentMethodsParams = Omit<operations['ecommerce_get_payments_methods']['parameters']['query'], 'page' | 'size'>;
|
|
5
|
+
type getProductCategoriesParams = Omit<operations['ecommerce_get_product_categories']['parameters']['query'], 'page' | 'size'>;
|
|
6
|
+
type getTaxesParams = Omit<operations['ecommerce_get_taxes']['parameters']['query'], 'page' | 'size'>;
|
|
7
|
+
type getCountriesParams = Omit<operations['ecommerce_get_countries']['parameters']['query'], 'page' | 'size'>;
|
|
4
8
|
declare const ecommerceFactory: {
|
|
5
9
|
getCustomers(): RequestData<components['schemas']['CommerceCustomerItem'][]>;
|
|
6
10
|
getProducts(): RequestData<components['schemas']['app__routers__commerce__ProductItem'][]>;
|
|
@@ -12,5 +16,9 @@ declare const ecommerceFactory: {
|
|
|
12
16
|
getOrders(params: getOrdersParams): RequestData<components['schemas']['OrderItemOut'][]>;
|
|
13
17
|
createOrder(order: components['schemas']['OrderItemIn']): RequestData<components['schemas']['OrderItemOut']>;
|
|
14
18
|
getOrder(orderId: string): RequestData<components['schemas']['OrderItemOut']>;
|
|
19
|
+
getPaymentMethods(params: getPaymentMethodsParams): RequestData<components['schemas']['PaymentMethodItem'][]>;
|
|
20
|
+
getProductCategories(params: getProductCategoriesParams): RequestData<components['schemas']['CategoryItem'][]>;
|
|
21
|
+
getTaxes(params: getTaxesParams): RequestData<components['schemas']['TaxRateItem'][]>;
|
|
22
|
+
getCountries(params: getCountriesParams): RequestData<components['schemas']['CountryItem'][]>;
|
|
15
23
|
};
|
|
16
24
|
export { ecommerceFactory };
|
|
@@ -65,5 +65,33 @@ const ecommerceFactory = {
|
|
|
65
65
|
url: `/consumers/{consumer_id}/commerce/orders/${orderId}`,
|
|
66
66
|
};
|
|
67
67
|
},
|
|
68
|
+
getPaymentMethods(params) {
|
|
69
|
+
return {
|
|
70
|
+
params,
|
|
71
|
+
method: 'get',
|
|
72
|
+
url: `/consumers/{consumer_id}/commerce/payment-methods`,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
getProductCategories(params) {
|
|
76
|
+
return {
|
|
77
|
+
params,
|
|
78
|
+
method: 'get',
|
|
79
|
+
url: `/consumers/{consumer_id}/commerce/product-categories`,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
getTaxes(params) {
|
|
83
|
+
return {
|
|
84
|
+
params,
|
|
85
|
+
method: 'get',
|
|
86
|
+
url: `/consumers/{consumer_id}/commerce/taxes`,
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
getCountries(params) {
|
|
90
|
+
return {
|
|
91
|
+
params,
|
|
92
|
+
method: 'get',
|
|
93
|
+
url: `/consumers/{consumer_id}/commerce/countries`,
|
|
94
|
+
};
|
|
95
|
+
},
|
|
68
96
|
};
|
|
69
97
|
exports.ecommerceFactory = ecommerceFactory;
|
package/dist/src/modules/flow.js
CHANGED
|
@@ -34,7 +34,7 @@ const Flow = (internalApi, body, syncid, consumers, process) => {
|
|
|
34
34
|
name: data.name,
|
|
35
35
|
description: data.description,
|
|
36
36
|
execution: data.execution,
|
|
37
|
-
|
|
37
|
+
triggers: data.triggers,
|
|
38
38
|
config: data.config,
|
|
39
39
|
});
|
|
40
40
|
// execute locally or remotely by sending an event to execute the flow
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { operations } from '../types/public-api/schema';
|
|
1
2
|
import { InternalAPI } from './internalApi';
|
|
3
|
+
import { chiftOperations } from '../types/public-api/mappings';
|
|
2
4
|
declare const Integrations: (internalApi: InternalAPI) => {
|
|
3
|
-
getIntegrations: () => Promise<{
|
|
5
|
+
getIntegrations: (params?: operations[chiftOperations['getIntegrations']]['parameters']['query']) => Promise<{
|
|
4
6
|
integrationid: number;
|
|
5
7
|
name: string;
|
|
6
8
|
status: "active" | "inactive";
|
|
7
|
-
api: "
|
|
9
|
+
api: "Point of Sale" | "eCommerce" | "Accounting" | "Invoicing" | "Communication" | "Banking" | "Custom" | "Payment";
|
|
8
10
|
logo_url: string;
|
|
9
11
|
icon_url: string;
|
|
10
12
|
credentials?: {
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Integrations = void 0;
|
|
13
13
|
const Integrations = (internalApi) => {
|
|
14
14
|
const _internalApi = internalApi;
|
|
15
|
-
const getIntegrations = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
const { data, } = yield _internalApi.get('/integrations');
|
|
15
|
+
const getIntegrations = (params = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const { data, } = yield _internalApi.get('/integrations', { params });
|
|
17
17
|
return data;
|
|
18
18
|
});
|
|
19
19
|
return {
|
|
@@ -5,6 +5,7 @@ type getPaymentMethodsParams = Omit<operations['pos_get_payments_methods']['para
|
|
|
5
5
|
type getProductCategoriesParams = Omit<operations['pos_get_product_categories']['parameters']['query'], 'page' | 'size'>;
|
|
6
6
|
type getProductsParams = Omit<operations['pos_get_products']['parameters']['query'], 'page' | 'size'>;
|
|
7
7
|
type getCustomersParams = Omit<operations['pos_get_customers']['parameters']['query'], 'page' | 'size'>;
|
|
8
|
+
type getAccountingCategoriesParams = Omit<operations['pos_get_accounting_categories']['parameters']['query'], 'page' | 'size'>;
|
|
8
9
|
type getOrdersParams = Omit<operations['pos_get_orders']['parameters']['query'], 'page' | 'size'>;
|
|
9
10
|
declare const posFactory: {
|
|
10
11
|
getLocations(): RequestData<components['schemas']['POSLocationItem'][]>;
|
|
@@ -14,11 +15,12 @@ declare const posFactory: {
|
|
|
14
15
|
getCustomer(customerId: string): RequestData<components['schemas']['POSCustomerItem']>;
|
|
15
16
|
createCustomer(customer: components['schemas']['POSCreateCustomerItem']): RequestData<components['schemas']['POSCustomerItem']>;
|
|
16
17
|
getPaymentMethods(params: getPaymentMethodsParams): RequestData<components['schemas']['PaymentMethods'][]>;
|
|
17
|
-
getProductCategories(params: getProductCategoriesParams): RequestData<components['schemas']['
|
|
18
|
+
getProductCategories(params: getProductCategoriesParams): RequestData<components['schemas']['CategoryItem'][]>;
|
|
18
19
|
getProducts(params: getProductsParams): RequestData<components['schemas']['POSProductItem'][]>;
|
|
19
20
|
getSales(params: operations['pos_get_sales']['parameters']['query']): RequestData<components['schemas']['SalesItem']>;
|
|
20
21
|
getClosure(date: string, params: operations['pos_get_closure']['parameters']['query']): RequestData<components['schemas']['ClosureItem']>;
|
|
21
22
|
getPayments(params: getPaymentsParams): RequestData<components['schemas']['PaymentItem'][]>;
|
|
22
23
|
updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem']): RequestData<components['schemas']['OrderItem']>;
|
|
24
|
+
getAccountingCategories(params: getAccountingCategoriesParams): RequestData<components['schemas']['AccountingCategoryItem'][]>;
|
|
23
25
|
};
|
|
24
26
|
export { posFactory };
|
package/dist/src/modules/pos.js
CHANGED