@chift/chift-nodejs 1.0.11 → 1.0.14
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 -1
- package/CHANGELOG.md +11 -1
- package/README.md +11 -1
- package/dist/src/modules/accounting.d.ts +59 -49
- package/dist/src/modules/api.d.ts +485 -395
- package/dist/src/modules/consumer.d.ts +97 -79
- package/dist/src/modules/consumer.js +8 -0
- package/dist/src/modules/consumers.d.ts +485 -395
- package/dist/src/modules/ecommerce.d.ts +11 -11
- package/dist/src/modules/internalApi.d.ts +2 -0
- package/dist/src/modules/internalApi.js +6 -0
- package/dist/src/modules/invoicing.d.ts +6 -4
- package/dist/src/modules/pos.d.ts +16 -16
- package/dist/src/modules/sync.d.ts +388 -316
- package/dist/src/types/api.d.ts +1 -0
- package/dist/src/types/public-api/schema.d.ts +1007 -1007
- package/package.json +1 -1
- package/src/modules/accounting.ts +96 -67
- package/src/modules/consumer.ts +10 -0
- package/src/modules/ecommerce.ts +15 -22
- package/src/modules/internalApi.ts +11 -0
- package/src/modules/invoicing.ts +12 -4
- package/src/modules/pos.ts +22 -30
- package/src/types/api.ts +2 -0
- package/src/types/public-api/schema.ts +10835 -10780
package/src/modules/pos.ts
CHANGED
|
@@ -1,37 +1,27 @@
|
|
|
1
1
|
import { operations, components } from '../types/public-api/schema';
|
|
2
|
-
import { RequestData } from '../types/api';
|
|
2
|
+
import { AutoPaginatedParams, RequestData } from '../types/api';
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
operations['pos_get_payments']['parameters']['query'],
|
|
6
|
-
'page' | 'size'
|
|
7
|
-
>;
|
|
4
|
+
type GetPaymentsParams = AutoPaginatedParams<operations['pos_get_payments']['parameters']['query']>;
|
|
8
5
|
|
|
9
|
-
type
|
|
10
|
-
operations['pos_get_payments_methods']['parameters']['query']
|
|
11
|
-
'page' | 'size'
|
|
6
|
+
type GetPaymentMethodsParams = AutoPaginatedParams<
|
|
7
|
+
operations['pos_get_payments_methods']['parameters']['query']
|
|
12
8
|
>;
|
|
13
9
|
|
|
14
|
-
type
|
|
15
|
-
operations['pos_get_product_categories']['parameters']['query']
|
|
16
|
-
'page' | 'size'
|
|
10
|
+
type GetProductCategoriesParams = AutoPaginatedParams<
|
|
11
|
+
operations['pos_get_product_categories']['parameters']['query']
|
|
17
12
|
>;
|
|
18
13
|
|
|
19
|
-
type
|
|
20
|
-
operations['pos_get_products']['parameters']['query'],
|
|
21
|
-
'page' | 'size'
|
|
22
|
-
>;
|
|
14
|
+
type GetProductsParams = AutoPaginatedParams<operations['pos_get_products']['parameters']['query']>;
|
|
23
15
|
|
|
24
|
-
type
|
|
25
|
-
operations['pos_get_customers']['parameters']['query']
|
|
26
|
-
'page' | 'size'
|
|
16
|
+
type GetCustomersParams = AutoPaginatedParams<
|
|
17
|
+
operations['pos_get_customers']['parameters']['query']
|
|
27
18
|
>;
|
|
28
19
|
|
|
29
|
-
type
|
|
30
|
-
operations['pos_get_accounting_categories']['parameters']['query']
|
|
31
|
-
'page' | 'size'
|
|
20
|
+
type GetAccountingCategoriesParams = AutoPaginatedParams<
|
|
21
|
+
operations['pos_get_accounting_categories']['parameters']['query']
|
|
32
22
|
>;
|
|
33
23
|
|
|
34
|
-
type
|
|
24
|
+
type GetOrdersParams = AutoPaginatedParams<operations['pos_get_orders']['parameters']['query']>;
|
|
35
25
|
|
|
36
26
|
const posFactory = {
|
|
37
27
|
getLocations(): RequestData<components['schemas']['POSLocationItem'][]> {
|
|
@@ -40,7 +30,7 @@ const posFactory = {
|
|
|
40
30
|
url: '/consumers/{consumer_id}/pos/locations',
|
|
41
31
|
};
|
|
42
32
|
},
|
|
43
|
-
getOrders(params:
|
|
33
|
+
getOrders(params: GetOrdersParams): RequestData<components['schemas']['OrderItem'][]> {
|
|
44
34
|
return {
|
|
45
35
|
params,
|
|
46
36
|
method: 'get',
|
|
@@ -48,7 +38,7 @@ const posFactory = {
|
|
|
48
38
|
};
|
|
49
39
|
},
|
|
50
40
|
getCustomers(
|
|
51
|
-
params
|
|
41
|
+
params?: GetCustomersParams
|
|
52
42
|
): RequestData<components['schemas']['POSCustomerItem'][]> {
|
|
53
43
|
return {
|
|
54
44
|
params,
|
|
@@ -78,7 +68,7 @@ const posFactory = {
|
|
|
78
68
|
};
|
|
79
69
|
},
|
|
80
70
|
getPaymentMethods(
|
|
81
|
-
params
|
|
71
|
+
params?: GetPaymentMethodsParams
|
|
82
72
|
): RequestData<components['schemas']['PaymentMethods'][]> {
|
|
83
73
|
return {
|
|
84
74
|
params,
|
|
@@ -87,7 +77,7 @@ const posFactory = {
|
|
|
87
77
|
};
|
|
88
78
|
},
|
|
89
79
|
getProductCategories(
|
|
90
|
-
params
|
|
80
|
+
params?: GetProductCategoriesParams
|
|
91
81
|
): RequestData<components['schemas']['CategoryItem'][]> {
|
|
92
82
|
return {
|
|
93
83
|
params,
|
|
@@ -95,7 +85,9 @@ const posFactory = {
|
|
|
95
85
|
url: `/consumers/{consumer_id}/pos/product-categories`,
|
|
96
86
|
};
|
|
97
87
|
},
|
|
98
|
-
getProducts(
|
|
88
|
+
getProducts(
|
|
89
|
+
params?: GetProductsParams
|
|
90
|
+
): RequestData<components['schemas']['POSProductItem'][]> {
|
|
99
91
|
return {
|
|
100
92
|
params,
|
|
101
93
|
method: 'get',
|
|
@@ -113,7 +105,7 @@ const posFactory = {
|
|
|
113
105
|
},
|
|
114
106
|
getClosure(
|
|
115
107
|
date: string,
|
|
116
|
-
params
|
|
108
|
+
params?: operations['pos_get_closure']['parameters']['query']
|
|
117
109
|
): RequestData<components['schemas']['ClosureItem']> {
|
|
118
110
|
return {
|
|
119
111
|
params,
|
|
@@ -121,7 +113,7 @@ const posFactory = {
|
|
|
121
113
|
url: `/consumers/{consumer_id}/pos/closures/${date}`,
|
|
122
114
|
};
|
|
123
115
|
},
|
|
124
|
-
getPayments(params:
|
|
116
|
+
getPayments(params: GetPaymentsParams): RequestData<components['schemas']['PaymentItem'][]> {
|
|
125
117
|
return {
|
|
126
118
|
params,
|
|
127
119
|
method: 'get',
|
|
@@ -139,7 +131,7 @@ const posFactory = {
|
|
|
139
131
|
};
|
|
140
132
|
},
|
|
141
133
|
getAccountingCategories(
|
|
142
|
-
params
|
|
134
|
+
params?: GetAccountingCategoriesParams
|
|
143
135
|
): RequestData<components['schemas']['AccountingCategoryItem'][]> {
|
|
144
136
|
return {
|
|
145
137
|
params,
|