@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
package/src/modules/webhooks.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { operations } from '../types/public-api/schema';
|
|
2
|
-
import { InternalAPI } from './internalApi';
|
|
3
|
-
import { chiftOperations } from '../types/public-api/mappings';
|
|
4
|
-
|
|
5
|
-
const Webhooks = (internalApi: InternalAPI) => {
|
|
6
|
-
const _internalApi: InternalAPI = internalApi;
|
|
7
|
-
|
|
8
|
-
const getWebhookTypes = async () => {
|
|
9
|
-
const {
|
|
10
|
-
data,
|
|
11
|
-
}: {
|
|
12
|
-
data: operations[chiftOperations['getWebhookTypes']]['responses'][200]['content']['application/json'];
|
|
13
|
-
} = await _internalApi.get('/webhooks/list');
|
|
14
|
-
return data;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const getWebhooks = async () => {
|
|
18
|
-
const {
|
|
19
|
-
data,
|
|
20
|
-
}: {
|
|
21
|
-
data: operations[chiftOperations['getWebhooks']]['responses'][200]['content']['application/json'];
|
|
22
|
-
} = await _internalApi.get('/webhooks');
|
|
23
|
-
return data;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const registerWebhook = async (
|
|
27
|
-
body: operations[chiftOperations['registerWebhook']]['requestBody']['content']['application/json']
|
|
28
|
-
) => {
|
|
29
|
-
const {
|
|
30
|
-
data,
|
|
31
|
-
}: {
|
|
32
|
-
data: operations[chiftOperations['createConsumer']]['responses'][200]['content']['application/json'];
|
|
33
|
-
} = await _internalApi.post('/webhooks', body);
|
|
34
|
-
return data;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const getWebhookById = async (webhookId: string) => {
|
|
38
|
-
const {
|
|
39
|
-
data,
|
|
40
|
-
}: {
|
|
41
|
-
data: operations[chiftOperations['getWebhookById']]['responses'][200]['content']['application/json'];
|
|
42
|
-
} = await _internalApi.get(`/webhooks/${webhookId}`);
|
|
43
|
-
return data;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const updateWebhookById = async (
|
|
47
|
-
webhookId: string,
|
|
48
|
-
body: operations[chiftOperations['updateWebhookById']]['requestBody']['content']['application/json']
|
|
49
|
-
) => {
|
|
50
|
-
const {
|
|
51
|
-
data,
|
|
52
|
-
}: {
|
|
53
|
-
data: operations[chiftOperations['updateConsumer']]['responses'][200]['content']['application/json'];
|
|
54
|
-
} = await _internalApi.patch(`/webhooks/${webhookId}`, body);
|
|
55
|
-
return data;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const unRegisterWebhook = async (webhookId: string) => {
|
|
59
|
-
const {
|
|
60
|
-
data,
|
|
61
|
-
}: { data: operations[chiftOperations['unRegisterWebhook']]['responses'][204] } =
|
|
62
|
-
await _internalApi.delete(`/webhooks/${webhookId}`);
|
|
63
|
-
return data;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const getWebhookLogsByWebhookId = async (webhookId: string) => {
|
|
67
|
-
const {
|
|
68
|
-
data,
|
|
69
|
-
}: {
|
|
70
|
-
data: operations[chiftOperations['getWebhookLogsByWebhookId']]['responses'][200]['content']['application/json'];
|
|
71
|
-
} = await _internalApi.get(`/webhooks/${webhookId}/logs`);
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
getWebhookTypes,
|
|
77
|
-
registerWebhook,
|
|
78
|
-
getWebhookById,
|
|
79
|
-
updateWebhookById,
|
|
80
|
-
unRegisterWebhook,
|
|
81
|
-
getWebhookLogsByWebhookId,
|
|
82
|
-
getWebhooks,
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export { Webhooks };
|