@chift/chift-nodejs 1.0.6 → 1.0.8
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/.github/workflows/ci.yml +38 -38
- package/CHANGELOG.md +42 -0
- package/dist/src/modules/accounting.d.ts +27 -24
- package/dist/src/modules/accounting.js +76 -31
- package/dist/src/modules/api.d.ts +2119 -28031
- package/dist/src/modules/consumer.d.ts +413 -64
- package/dist/src/modules/consumer.js +10 -0
- package/dist/src/modules/consumers.d.ts +2130 -365
- 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/pos.d.ts +3 -1
- package/dist/src/modules/pos.js +7 -0
- package/dist/src/modules/sync.d.ts +1710 -298
- package/dist/src/modules/syncs.d.ts +8 -27677
- package/dist/src/modules/syncs.js +10 -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 +2 -2
- package/src/modules/accounting.ts +120 -35
- package/src/modules/api.ts +2 -2
- package/src/modules/consumer.ts +21 -0
- package/src/modules/ecommerce.ts +52 -0
- package/src/modules/flow.ts +1 -1
- package/src/modules/pos.ts +15 -1
- package/src/modules/syncs.ts +32 -1
- package/src/types/public-api/schema.d.ts +3624 -2621
- package/test/modules/accounting.test.ts +31 -14
- package/test/modules/ecommerce.test.ts +34 -3
- package/test/modules/pos.test.ts +11 -5
- package/.eslintcache +0 -1
- 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/test/modules/flow.test.d.ts +0 -1
- package/dist/test/modules/flow.test.js +0 -69
package/src/modules/flow.ts
CHANGED
package/src/modules/pos.ts
CHANGED
|
@@ -26,6 +26,11 @@ type getCustomersParams = Omit<
|
|
|
26
26
|
'page' | 'size'
|
|
27
27
|
>;
|
|
28
28
|
|
|
29
|
+
type getAccountingCategoriesParams = Omit<
|
|
30
|
+
operations['pos_get_accounting_categories']['parameters']['query'],
|
|
31
|
+
'page' | 'size'
|
|
32
|
+
>;
|
|
33
|
+
|
|
29
34
|
type getOrdersParams = Omit<operations['pos_get_orders']['parameters']['query'], 'page' | 'size'>;
|
|
30
35
|
|
|
31
36
|
const posFactory = {
|
|
@@ -83,7 +88,7 @@ const posFactory = {
|
|
|
83
88
|
},
|
|
84
89
|
getProductCategories(
|
|
85
90
|
params: getProductCategoriesParams
|
|
86
|
-
): RequestData<components['schemas']['
|
|
91
|
+
): RequestData<components['schemas']['CategoryItem'][]> {
|
|
87
92
|
return {
|
|
88
93
|
params,
|
|
89
94
|
method: 'get',
|
|
@@ -133,6 +138,15 @@ const posFactory = {
|
|
|
133
138
|
body: order,
|
|
134
139
|
};
|
|
135
140
|
},
|
|
141
|
+
getAccountingCategories(
|
|
142
|
+
params: getAccountingCategoriesParams
|
|
143
|
+
): RequestData<components['schemas']['AccountingCategoryItem'][]> {
|
|
144
|
+
return {
|
|
145
|
+
params,
|
|
146
|
+
method: 'get',
|
|
147
|
+
url: `/consumers/{consumer_id}/pos/accounting-categories`,
|
|
148
|
+
};
|
|
149
|
+
},
|
|
136
150
|
};
|
|
137
151
|
|
|
138
152
|
export { posFactory };
|
package/src/modules/syncs.ts
CHANGED
|
@@ -2,7 +2,18 @@ import { components } from '../types/public-api/schema';
|
|
|
2
2
|
import { InternalAPI } from './internalApi';
|
|
3
3
|
import { Sync } from './sync';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
export type SyncsAPI = {
|
|
6
|
+
createSync: (
|
|
7
|
+
body?: components['schemas']['CreateSyncItem']
|
|
8
|
+
) => Promise<ReturnType<typeof Sync>>;
|
|
9
|
+
getSyncs: () => Promise<ReturnType<typeof Sync>[]>;
|
|
10
|
+
getSyncById: (syncid: string) => Promise<ReturnType<typeof Sync>>;
|
|
11
|
+
updateSync: (
|
|
12
|
+
body?: components['schemas']['CreateSyncItem']
|
|
13
|
+
) => Promise<ReturnType<typeof Sync>>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Syncs = (internalApi: InternalAPI): SyncsAPI => {
|
|
6
17
|
const _internalApi: InternalAPI = internalApi;
|
|
7
18
|
|
|
8
19
|
const getSyncs = async () => {
|
|
@@ -19,9 +30,29 @@ const Syncs = (internalApi: InternalAPI) => {
|
|
|
19
30
|
return Sync(_internalApi, data);
|
|
20
31
|
};
|
|
21
32
|
|
|
33
|
+
const createSync = async (body?: components['schemas']['CreateSyncItem']) => {
|
|
34
|
+
const {
|
|
35
|
+
data,
|
|
36
|
+
}: {
|
|
37
|
+
data: components['schemas']['ReadSyncItem'];
|
|
38
|
+
} = await _internalApi.post('/syncs', body);
|
|
39
|
+
return Sync(_internalApi, data);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const updateSync = async (body?: components['schemas']['CreateSyncItem']) => {
|
|
43
|
+
const {
|
|
44
|
+
data,
|
|
45
|
+
}: {
|
|
46
|
+
data: components['schemas']['ReadSyncItem'];
|
|
47
|
+
} = await _internalApi.patch('/syncs', body);
|
|
48
|
+
return Sync(_internalApi, data);
|
|
49
|
+
};
|
|
50
|
+
|
|
22
51
|
return {
|
|
52
|
+
createSync,
|
|
23
53
|
getSyncs,
|
|
24
54
|
getSyncById,
|
|
55
|
+
updateSync,
|
|
25
56
|
};
|
|
26
57
|
};
|
|
27
58
|
|