@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.
Files changed (145) hide show
  1. package/README.md +3 -3
  2. package/package.json +5 -2
  3. package/src/types/public-api/schema.d.ts +4071 -850
  4. package/src/types/sync.ts +20 -5
  5. package/.eslintcache +0 -1
  6. package/.eslintignore +0 -1
  7. package/.eslintrc.json +0 -25
  8. package/.github/workflows/ci.yml +0 -75
  9. package/.husky/pre-commit +0 -4
  10. package/.prettierignore +0 -1
  11. package/.prettierrc.json +0 -7
  12. package/CHANGELOG.md +0 -98
  13. package/coverage/clover.xml +0 -1645
  14. package/coverage/coverage-final.json +0 -19
  15. package/coverage/lcov-report/base.css +0 -224
  16. package/coverage/lcov-report/block-navigation.js +0 -87
  17. package/coverage/lcov-report/favicon.png +0 -0
  18. package/coverage/lcov-report/index.html +0 -146
  19. package/coverage/lcov-report/prettify.css +0 -1
  20. package/coverage/lcov-report/prettify.js +0 -2
  21. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  22. package/coverage/lcov-report/sorter.js +0 -196
  23. package/coverage/lcov-report/src/helpers/index.html +0 -131
  24. package/coverage/lcov-report/src/helpers/openapi.ts.html +0 -151
  25. package/coverage/lcov-report/src/helpers/settings.ts.html +0 -94
  26. package/coverage/lcov-report/src/index.html +0 -116
  27. package/coverage/lcov-report/src/index.ts.html +0 -88
  28. package/coverage/lcov-report/src/modules/accounting.ts.html +0 -1156
  29. package/coverage/lcov-report/src/modules/api.ts.html +0 -190
  30. package/coverage/lcov-report/src/modules/consumer.ts.html +0 -616
  31. package/coverage/lcov-report/src/modules/consumers.ts.html +0 -331
  32. package/coverage/lcov-report/src/modules/custom.ts.html +0 -193
  33. package/coverage/lcov-report/src/modules/datastores.ts.html +0 -142
  34. package/coverage/lcov-report/src/modules/ecommerce.ts.html +0 -331
  35. package/coverage/lcov-report/src/modules/flow.ts.html +0 -589
  36. package/coverage/lcov-report/src/modules/index.html +0 -326
  37. package/coverage/lcov-report/src/modules/integrations.ts.html +0 -151
  38. package/coverage/lcov-report/src/modules/internalApi.ts.html +0 -586
  39. package/coverage/lcov-report/src/modules/invoicing.ts.html +0 -391
  40. package/coverage/lcov-report/src/modules/pos.ts.html +0 -421
  41. package/coverage/lcov-report/src/modules/sync.ts.html +0 -316
  42. package/coverage/lcov-report/src/modules/syncs.ts.html +0 -169
  43. package/coverage/lcov-report/src/modules/webhooks.ts.html +0 -343
  44. package/coverage/lcov.info +0 -1976
  45. package/dist/src/helpers/openapi.d.ts +0 -3
  46. package/dist/src/helpers/openapi.js +0 -18
  47. package/dist/src/helpers/settings.d.ts +0 -4
  48. package/dist/src/helpers/settings.js +0 -5
  49. package/dist/src/index.d.ts +0 -1
  50. package/dist/src/modules/accounting.d.ts +0 -68
  51. package/dist/src/modules/accounting.js +0 -326
  52. package/dist/src/modules/api.d.ts +0 -16795
  53. package/dist/src/modules/api.js +0 -36
  54. package/dist/src/modules/consumer.d.ts +0 -3313
  55. package/dist/src/modules/consumer.js +0 -139
  56. package/dist/src/modules/consumers.d.ts +0 -16684
  57. package/dist/src/modules/consumers.js +0 -51
  58. package/dist/src/modules/custom.d.ts +0 -8
  59. package/dist/src/modules/custom.js +0 -36
  60. package/dist/src/modules/datastores.d.ts +0 -18
  61. package/dist/src/modules/datastores.js +0 -23
  62. package/dist/src/modules/ecommerce.d.ts +0 -24
  63. package/dist/src/modules/ecommerce.js +0 -97
  64. package/dist/src/modules/flow.d.ts +0 -15
  65. package/dist/src/modules/flow.js +0 -156
  66. package/dist/src/modules/integrations.d.ts +0 -23
  67. package/dist/src/modules/integrations.js +0 -23
  68. package/dist/src/modules/internalApi.d.ts +0 -24
  69. package/dist/src/modules/internalApi.js +0 -175
  70. package/dist/src/modules/invoicing.d.ts +0 -20
  71. package/dist/src/modules/invoicing.js +0 -90
  72. package/dist/src/modules/pms.d.ts +0 -15
  73. package/dist/src/modules/pms.js +0 -47
  74. package/dist/src/modules/pos.d.ts +0 -26
  75. package/dist/src/modules/pos.js +0 -101
  76. package/dist/src/modules/sync.d.ts +0 -13414
  77. package/dist/src/modules/sync.js +0 -73
  78. package/dist/src/modules/syncs.d.ts +0 -11
  79. package/dist/src/modules/syncs.js +0 -39
  80. package/dist/src/modules/webhooks.d.ts +0 -55
  81. package/dist/src/modules/webhooks.js +0 -53
  82. package/dist/src/types/api.d.ts +0 -29
  83. package/dist/src/types/api.js +0 -2
  84. package/dist/src/types/consumers.d.ts +0 -8
  85. package/dist/src/types/consumers.js +0 -2
  86. package/dist/src/types/public-api/mappings.d.ts +0 -21
  87. package/dist/src/types/public-api/mappings.js +0 -2
  88. package/dist/src/types/public-api/schema.d.ts +0 -12003
  89. package/dist/src/types/public-api/schema.js +0 -6
  90. package/dist/src/types/sync.d.ts +0 -20
  91. package/dist/src/types/sync.js +0 -2
  92. package/dist/test/modules/accounting.test.d.ts +0 -1
  93. package/dist/test/modules/accounting.test.js +0 -582
  94. package/dist/test/modules/consumer.test.d.ts +0 -1
  95. package/dist/test/modules/consumer.test.js +0 -89
  96. package/dist/test/modules/consumers.test.d.ts +0 -1
  97. package/dist/test/modules/consumers.test.js +0 -109
  98. package/dist/test/modules/ecommerce.test.d.ts +0 -1
  99. package/dist/test/modules/ecommerce.test.js +0 -220
  100. package/dist/test/modules/integrations.test.d.ts +0 -1
  101. package/dist/test/modules/integrations.test.js +0 -54
  102. package/dist/test/modules/invoicing.test.d.ts +0 -1
  103. package/dist/test/modules/invoicing.test.js +0 -108
  104. package/dist/test/modules/pos.test.d.ts +0 -1
  105. package/dist/test/modules/pos.test.js +0 -182
  106. package/dist/test/modules/sync.test.d.ts +0 -1
  107. package/dist/test/modules/sync.test.js +0 -81
  108. package/dist/test/modules/syncs.test.d.ts +0 -1
  109. package/dist/test/modules/syncs.test.js +0 -53
  110. package/dist/test/modules/webhooks.test.d.ts +0 -1
  111. package/dist/test/modules/webhooks.test.js +0 -120
  112. package/jest.config.ts +0 -195
  113. package/src/helpers/openapi.ts +0 -22
  114. package/src/helpers/settings.ts +0 -3
  115. package/src/index.ts +0 -1
  116. package/src/modules/accounting.ts +0 -510
  117. package/src/modules/api.ts +0 -35
  118. package/src/modules/consumer.ts +0 -213
  119. package/src/modules/consumers.ts +0 -82
  120. package/src/modules/custom.ts +0 -36
  121. package/src/modules/datastores.ts +0 -19
  122. package/src/modules/ecommerce.ts +0 -127
  123. package/src/modules/flow.ts +0 -168
  124. package/src/modules/integrations.ts +0 -24
  125. package/src/modules/internalApi.ts +0 -182
  126. package/src/modules/invoicing.ts +0 -114
  127. package/src/modules/pms.ts +0 -67
  128. package/src/modules/pos.ts +0 -144
  129. package/src/modules/sync.ts +0 -77
  130. package/src/modules/syncs.ts +0 -59
  131. package/src/modules/webhooks.ts +0 -86
  132. package/src/types/public-api/schema.ts +0 -12073
  133. package/test/data/accounting_invoice.pdf +0 -0
  134. package/test/modules/accounting.test.ts +0 -628
  135. package/test/modules/consumer.test.ts +0 -68
  136. package/test/modules/consumers.test.ts +0 -85
  137. package/test/modules/ecommerce.test.ts +0 -208
  138. package/test/modules/integrations.test.ts +0 -22
  139. package/test/modules/invoicing.test.ts +0 -88
  140. package/test/modules/pos.test.ts +0 -166
  141. package/test/modules/sync.test.ts +0 -60
  142. package/test/modules/syncs.test.ts +0 -23
  143. package/test/modules/webhooks.test.ts +0 -92
  144. package/test/set_envs.sh +0 -14
  145. package/tsconfig.json +0 -107
@@ -1,175 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.InternalAPI = void 0;
16
- const axios_1 = __importDefault(require("axios"));
17
- const settings_1 = __importDefault(require("../helpers/settings"));
18
- class InternalAPI {
19
- constructor(auth) {
20
- this.debug = false;
21
- this.getToken = () => __awaiter(this, void 0, void 0, function* () {
22
- try {
23
- const tokenData = {
24
- clientId: this.auth.clientId,
25
- clientSecret: this.auth.clientSecret,
26
- accountId: this.auth.accountId,
27
- };
28
- if (this.auth.envId) {
29
- tokenData['envId'] = this.auth.envId;
30
- }
31
- const res = yield axios_1.default.post(`${this.auth.baseUrl || settings_1.default.BASE_URL}/token`, tokenData);
32
- this.token = res.data;
33
- }
34
- catch (err) {
35
- if (axios_1.default.isAxiosError(err)) {
36
- if (err.response) {
37
- if (err.response.status === 401) {
38
- throw new Error('The provided credentials are not correct');
39
- }
40
- }
41
- }
42
- }
43
- });
44
- this.getPaginationParams = (currPage) => {
45
- return {
46
- page: currPage,
47
- size: 100,
48
- };
49
- };
50
- // add interceptor
51
- this.auth = auth;
52
- this.instance = axios_1.default.create({
53
- baseURL: this.auth.baseUrl || settings_1.default.BASE_URL,
54
- });
55
- this.get = this.instance.get;
56
- this.post = this.instance.post;
57
- this.patch = this.instance.patch;
58
- this.delete = this.instance.delete;
59
- this.instance.interceptors.request.use((config) => {
60
- return new Promise((resolve, reject) => {
61
- var _a, _b;
62
- if (this.connectionId) {
63
- config.headers['X-Chift-ConnectionId'] = this.connectionId;
64
- }
65
- if (this.integrationId) {
66
- config.headers['X-Chift-IntegrationId'] = this.integrationId;
67
- }
68
- if (this.relatedChainExecutionId) {
69
- config.headers['X-Chift-RelatedChainExecutionId'] =
70
- this.relatedChainExecutionId;
71
- }
72
- if (this.token) {
73
- if (((_a = this.token) === null || _a === void 0 ? void 0 : _a.expires_on) < new Date().getTime()) {
74
- return this.getToken()
75
- .then(() => {
76
- var _a;
77
- config.headers['Authorization'] =
78
- 'Bearer ' + ((_a = this.token) === null || _a === void 0 ? void 0 : _a.access_token);
79
- return resolve(config);
80
- })
81
- .catch((err) => {
82
- return reject(err);
83
- });
84
- }
85
- else {
86
- config.headers['Authorization'] = 'Bearer ' + ((_b = this.token) === null || _b === void 0 ? void 0 : _b.access_token);
87
- return resolve(config);
88
- }
89
- }
90
- else {
91
- return this.getToken()
92
- .then(() => {
93
- var _a;
94
- config.headers['Authorization'] =
95
- 'Bearer ' + ((_a = this.token) === null || _a === void 0 ? void 0 : _a.access_token);
96
- return resolve(config);
97
- })
98
- .catch((err) => {
99
- return reject(err);
100
- });
101
- }
102
- });
103
- }, function (error) {
104
- // Do something with request error
105
- return Promise.reject(error);
106
- });
107
- }
108
- setRelatedChainExecutionId(chainExecutionId) {
109
- this.relatedChainExecutionId = chainExecutionId;
110
- }
111
- makeRequest(requestData) {
112
- return __awaiter(this, void 0, void 0, function* () {
113
- try {
114
- if (this.debug) {
115
- console.log(`[DEBUG]: Executing operation ${requestData === null || requestData === void 0 ? void 0 : requestData.property} with url ${requestData.url} for consumer: ${requestData.consumerName}`);
116
- }
117
- let continuePagination = true;
118
- let items = [];
119
- let currentPage = 0;
120
- while (continuePagination) {
121
- currentPage++;
122
- let params = requestData.params || {};
123
- if (requestData.method === 'get') {
124
- params = Object.assign(Object.assign({}, params), this.getPaginationParams(currentPage));
125
- }
126
- const res = yield this.instance({
127
- url: requestData.url,
128
- method: requestData.method,
129
- params: params,
130
- data: requestData.body !== undefined ? requestData.body : undefined,
131
- });
132
- const { data } = res;
133
- if (data) {
134
- if (requestData.method === 'get' && 'total' in data && 'items' in data) {
135
- if (currentPage * 100 > data.total) {
136
- continuePagination = false;
137
- }
138
- }
139
- else {
140
- if (this.debug) {
141
- console.log(`[DEBUG]: Data received: ${JSON.stringify(data)}`);
142
- }
143
- return data;
144
- }
145
- items = items.concat(data.items);
146
- }
147
- else {
148
- return null;
149
- }
150
- }
151
- if (this.debug) {
152
- console.log(`[DEBUG]: Data received: ${JSON.stringify(items)}`);
153
- }
154
- return items;
155
- }
156
- catch (e) {
157
- if (e.response) {
158
- if (e.response.data) {
159
- const error = Object.assign(Object.assign({}, e.response.data), { status_code: e.response.status });
160
- const fullerror = {
161
- error,
162
- consumerId: requestData.consumerId,
163
- consumerName: requestData.consumerName,
164
- url: requestData.url,
165
- };
166
- //return error as TResponse;
167
- throw fullerror;
168
- }
169
- }
170
- throw e;
171
- }
172
- });
173
- }
174
- }
175
- exports.InternalAPI = InternalAPI;
@@ -1,20 +0,0 @@
1
- import { components, operations } from '../types/public-api/schema';
2
- import { AutoPaginatedParams, RequestData } from '../types/api';
3
- type GetInvoicesParams = AutoPaginatedParams<operations['invoicing_get_invoices']['parameters']['query']>;
4
- type GetContactsParams = AutoPaginatedParams<operations['invoicing_get_contacts']['parameters']['query']>;
5
- declare const invoicingFactory: {
6
- getInvoices(params?: GetInvoicesParams): RequestData<components['schemas']['InvoiceItemOut'][]>;
7
- getInvoiceById(invoiceId: string, params?: operations['invoicing_get_invoice']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOut']>;
8
- createInvoice(invoice: components['schemas']['InvoiceItem']): RequestData<components['schemas']['InvoiceItemOut']>;
9
- getProducts(): RequestData<components['schemas']['ProductItemOut'][]>;
10
- getProductById(productId: string): RequestData<components['schemas']['ProductItemOut']>;
11
- createProduct(product: components['schemas']['models__invoicing__ProductItem']): RequestData<components['schemas']['ProductItemOut']>;
12
- getTaxes(): RequestData<components['schemas']['models__invoicing__VatCode'][]>;
13
- getTaxById(taxId: string): RequestData<components['schemas']['models__invoicing__VatCode']>;
14
- getOpportunities(): RequestData<components['schemas']['OpportunityItem'][]>;
15
- getOpportunitiesById(opportunityId: string): RequestData<components['schemas']['OpportunityItem']>;
16
- getContacts(params?: GetContactsParams): RequestData<components['schemas']['ContactItemOut'][]>;
17
- getContactById(contactId: string): RequestData<components['schemas']['ContactItemOut']>;
18
- createContact(contact: components['schemas']['ContactItemIn']): RequestData<components['schemas']['ContactItemOut']>;
19
- };
20
- export { invoicingFactory };
@@ -1,90 +0,0 @@
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;
@@ -1,15 +0,0 @@
1
- import { operations, components } from '../types/public-api/schema';
2
- import { AutoPaginatedParams, RequestData } from '../types/api';
3
- type GetPaymentsParams = AutoPaginatedParams<operations['pms_get_payments']['parameters']['query']>;
4
- type GetPaymentMethodsParams = AutoPaginatedParams<operations['pms_get_payments_methods']['parameters']['query']>;
5
- type GetAccountingCategoriesParams = AutoPaginatedParams<operations['pms_get_accounting_categories']['parameters']['query']>;
6
- type GetOrdersParams = AutoPaginatedParams<operations['pms_get_orders']['parameters']['query']>;
7
- declare const pmsFactory: {
8
- getLocations(): RequestData<components['schemas']['PMSLocationItem'][]>;
9
- getOrders(params: GetOrdersParams): RequestData<components['schemas']['PMSOrderItem'][]>;
10
- getPaymentMethods(params?: GetPaymentMethodsParams): RequestData<components['schemas']['PMSPaymentMethods'][]>;
11
- getClosure(date: string, params?: operations['pms_get_closure']['parameters']['query']): RequestData<components['schemas']['PMSClosureItem']>;
12
- getPayments(params: GetPaymentsParams): RequestData<components['schemas']['PMSPaymentItem'][]>;
13
- getAccountingCategories(params?: GetAccountingCategoriesParams): RequestData<components['schemas']['PMSAccountingCategoryItem'][]>;
14
- };
15
- export { pmsFactory };
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pmsFactory = void 0;
4
- const pmsFactory = {
5
- getLocations() {
6
- return {
7
- method: 'get',
8
- url: '/consumers/{consumer_id}/pms/locations',
9
- };
10
- },
11
- getOrders(params) {
12
- return {
13
- params,
14
- method: 'get',
15
- url: '/consumers/{consumer_id}/pms/orders',
16
- };
17
- },
18
- getPaymentMethods(params) {
19
- return {
20
- params,
21
- method: 'get',
22
- url: `/consumers/{consumer_id}/pms/payment-methods`,
23
- };
24
- },
25
- getClosure(date, params) {
26
- return {
27
- params,
28
- method: 'get',
29
- url: `/consumers/{consumer_id}/pms/closures/${date}`,
30
- };
31
- },
32
- getPayments(params) {
33
- return {
34
- params,
35
- method: 'get',
36
- url: `/consumers/{consumer_id}/pms/payments`,
37
- };
38
- },
39
- getAccountingCategories(params) {
40
- return {
41
- params,
42
- method: 'get',
43
- url: `/consumers/{consumer_id}/pms/accounting-categories`,
44
- };
45
- },
46
- };
47
- exports.pmsFactory = pmsFactory;
@@ -1,26 +0,0 @@
1
- import { operations, components } from '../types/public-api/schema';
2
- import { AutoPaginatedParams, RequestData } from '../types/api';
3
- type GetPaymentsParams = AutoPaginatedParams<operations['pos_get_payments']['parameters']['query']>;
4
- type GetPaymentMethodsParams = AutoPaginatedParams<operations['pos_get_payments_methods']['parameters']['query']>;
5
- type GetProductCategoriesParams = AutoPaginatedParams<operations['pos_get_product_categories']['parameters']['query']>;
6
- type GetProductsParams = AutoPaginatedParams<operations['pos_get_products']['parameters']['query']>;
7
- type GetCustomersParams = AutoPaginatedParams<operations['pos_get_customers']['parameters']['query']>;
8
- type GetAccountingCategoriesParams = AutoPaginatedParams<operations['pos_get_accounting_categories']['parameters']['query']>;
9
- type GetOrdersParams = AutoPaginatedParams<operations['pos_get_orders']['parameters']['query']>;
10
- declare const posFactory: {
11
- getLocations(): RequestData<components['schemas']['POSLocationItem'][]>;
12
- getOrders(params: GetOrdersParams): RequestData<components['schemas']['POSOrderItem'][]>;
13
- getCustomers(params?: GetCustomersParams): RequestData<components['schemas']['POSCustomerItem'][]>;
14
- getOrder(orderId: string): RequestData<components['schemas']['POSOrderItem']>;
15
- getCustomer(customerId: string): RequestData<components['schemas']['POSCustomerItem']>;
16
- createCustomer(customer: components['schemas']['POSCreateCustomerItem']): RequestData<components['schemas']['POSCustomerItem']>;
17
- getPaymentMethods(params?: GetPaymentMethodsParams): RequestData<components['schemas']['PaymentMethods'][]>;
18
- getProductCategories(params?: GetProductCategoriesParams): RequestData<components['schemas']['CategoryItem'][]>;
19
- getProducts(params?: GetProductsParams): RequestData<components['schemas']['POSProductItem'][]>;
20
- getSales(params: operations['pos_get_sales']['parameters']['query']): RequestData<components['schemas']['SalesItem']>;
21
- getClosure(date: string, params?: operations['pos_get_closure']['parameters']['query']): RequestData<components['schemas']['ClosureItem']>;
22
- getPayments(params: GetPaymentsParams): RequestData<components['schemas']['POSPaymentItem'][]>;
23
- updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem']): RequestData<components['schemas']['POSOrderItem']>;
24
- getAccountingCategories(params?: GetAccountingCategoriesParams): RequestData<components['schemas']['AccountingCategoryItem'][]>;
25
- };
26
- export { posFactory };
@@ -1,101 +0,0 @@
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
- getProductCategories(params) {
52
- return {
53
- params,
54
- method: 'get',
55
- url: `/consumers/{consumer_id}/pos/product-categories`,
56
- };
57
- },
58
- getProducts(params) {
59
- return {
60
- params,
61
- method: 'get',
62
- url: `/consumers/{consumer_id}/pos/products`,
63
- };
64
- },
65
- getSales(params) {
66
- return {
67
- params,
68
- method: 'get',
69
- url: `/consumers/{consumer_id}/pos/sales`,
70
- };
71
- },
72
- getClosure(date, params) {
73
- return {
74
- params,
75
- method: 'get',
76
- url: `/consumers/{consumer_id}/pos/closures/${date}`,
77
- };
78
- },
79
- getPayments(params) {
80
- return {
81
- params,
82
- method: 'get',
83
- url: `/consumers/{consumer_id}/pos/payments`,
84
- };
85
- },
86
- updateOrder(orderId, order) {
87
- return {
88
- method: 'patch',
89
- url: `/consumers/{consumer_id}/pos/orders/${orderId}`,
90
- body: order,
91
- };
92
- },
93
- getAccountingCategories(params) {
94
- return {
95
- params,
96
- method: 'get',
97
- url: `/consumers/{consumer_id}/pos/accounting-categories`,
98
- };
99
- },
100
- };
101
- exports.posFactory = posFactory;