@chift/chift-nodejs 1.0.23 → 1.0.25

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 (42) hide show
  1. package/README.md +37 -0
  2. package/dist/src/modules/accounting.d.ts +45 -43
  3. package/dist/src/modules/accounting.js +102 -42
  4. package/dist/src/modules/api.d.ts +13247 -11010
  5. package/dist/src/modules/banking.d.ts +13 -0
  6. package/dist/src/modules/banking.js +38 -0
  7. package/dist/src/modules/consumer.d.ts +2594 -2163
  8. package/dist/src/modules/consumer.js +3 -0
  9. package/dist/src/modules/consumers.d.ts +13205 -10980
  10. package/dist/src/modules/custom.d.ts +4 -4
  11. package/dist/src/modules/custom.js +6 -3
  12. package/dist/src/modules/datastores.d.ts +12 -6
  13. package/dist/src/modules/ecommerce.d.ts +18 -15
  14. package/dist/src/modules/ecommerce.js +32 -14
  15. package/dist/src/modules/flow.d.ts +2 -2
  16. package/dist/src/modules/integrations.d.ts +4 -2
  17. package/dist/src/modules/internalApi.js +11 -0
  18. package/dist/src/modules/invoicing.d.ts +16 -16
  19. package/dist/src/modules/invoicing.js +33 -18
  20. package/dist/src/modules/payment.d.ts +6 -6
  21. package/dist/src/modules/payment.js +10 -5
  22. package/dist/src/modules/pms.d.ts +8 -8
  23. package/dist/src/modules/pms.js +16 -8
  24. package/dist/src/modules/pos.d.ts +15 -15
  25. package/dist/src/modules/pos.js +29 -15
  26. package/dist/src/modules/sync.d.ts +10553 -8771
  27. package/dist/src/modules/webhooks.d.ts +12 -12
  28. package/dist/src/types/api.d.ts +9 -0
  29. package/dist/src/types/public-api/mappings.d.ts +128 -1
  30. package/dist/src/types/public-api/schema.d.ts +3856 -2132
  31. package/dist/src/types/public-api/schema.js +6 -0
  32. package/dist/test/modules/banking.test.d.ts +1 -0
  33. package/dist/test/modules/banking.test.js +94 -0
  34. package/dist/test/modules/client-request-id.test.d.ts +1 -0
  35. package/dist/test/modules/client-request-id.test.js +135 -0
  36. package/dist/test/modules/ecommerce.test.js +2 -1
  37. package/dist/test/modules/invoicing-pdf.test.d.ts +1 -0
  38. package/dist/test/modules/invoicing-pdf.test.js +34 -0
  39. package/dist/test/modules/raw-data.test.d.ts +1 -0
  40. package/dist/test/modules/raw-data.test.js +55 -0
  41. package/package.json +1 -1
  42. package/src/types/public-api/schema.d.ts +3856 -2132
@@ -2,59 +2,67 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pmsFactory = void 0;
4
4
  const pmsFactory = {
5
- getLocations() {
5
+ getLocations(rawData) {
6
6
  return {
7
7
  method: 'get',
8
8
  url: '/consumers/{consumer_id}/pms/locations',
9
+ rawData,
9
10
  };
10
11
  },
11
- getOrders(params) {
12
+ getOrders(params, rawData) {
12
13
  return {
13
14
  params,
14
15
  method: 'get',
15
16
  url: '/consumers/{consumer_id}/pms/orders',
17
+ rawData,
16
18
  };
17
19
  },
18
- getPaymentMethods(params) {
20
+ getPaymentMethods(params, rawData) {
19
21
  return {
20
22
  params,
21
23
  method: 'get',
22
24
  url: `/consumers/{consumer_id}/pms/payment-methods`,
25
+ rawData,
23
26
  };
24
27
  },
25
- getClosure(date, params) {
28
+ getClosure(date, params, rawData) {
26
29
  return {
27
30
  params,
28
31
  method: 'get',
29
32
  url: `/consumers/{consumer_id}/pms/closures/${date}`,
33
+ rawData,
30
34
  };
31
35
  },
32
- getPayments(params) {
36
+ getPayments(params, rawData) {
33
37
  return {
34
38
  params,
35
39
  method: 'get',
36
40
  url: `/consumers/{consumer_id}/pms/payments`,
41
+ rawData,
37
42
  };
38
43
  },
39
- getAccountingCategories(params) {
44
+ getAccountingCategories(params, rawData) {
40
45
  return {
41
46
  params,
42
47
  method: 'get',
43
48
  url: `/consumers/{consumer_id}/pms/accounting-categories`,
49
+ rawData,
44
50
  };
45
51
  },
46
- getCustomers(params) {
52
+ getCustomers(params, rawData) {
47
53
  return {
48
54
  params,
49
55
  method: 'get',
50
56
  url: '/consumers/{consumer_id}/pms/customers',
57
+ rawData,
51
58
  };
52
59
  },
53
- getInvoices(params) {
60
+ getInvoices(params, rawData) {
54
61
  return {
55
62
  params,
56
63
  method: 'get',
57
64
  url: '/consumers/{consumer_id}/pms/invoices',
65
+ rawData,
58
66
  };
59
67
  },
60
68
  };
@@ -1,5 +1,5 @@
1
1
  import { operations, components } from '../types/public-api/schema';
2
- import { AutoPaginatedParams, RequestData } from '../types/api';
2
+ import { AutoPaginatedParams, RequestData, RawDataOption, ClientRequestOption } from '../types/api';
3
3
  type GetPaymentsParams = AutoPaginatedParams<operations['pos_get_payments']['parameters']['query']>;
4
4
  type GetPaymentMethodsParams = AutoPaginatedParams<operations['pos_get_payments_methods']['parameters']['query']>;
5
5
  type GetProductCategoriesParams = AutoPaginatedParams<operations['pos_get_product_categories']['parameters']['query']>;
@@ -8,19 +8,19 @@ type GetCustomersParams = AutoPaginatedParams<operations['pos_get_customers']['p
8
8
  type GetAccountingCategoriesParams = AutoPaginatedParams<operations['pos_get_accounting_categories']['parameters']['query']>;
9
9
  type GetOrdersParams = AutoPaginatedParams<operations['pos_get_orders']['parameters']['query']>;
10
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'][]>;
11
+ getLocations(options?: RawDataOption): RequestData<components['schemas']['POSLocationItem'][]>;
12
+ getOrders(params: GetOrdersParams, options?: RawDataOption): RequestData<components['schemas']['POSOrderItem'][]>;
13
+ getCustomers(params?: GetCustomersParams, options?: RawDataOption): RequestData<components['schemas']['POSCustomerItem'][]>;
14
+ getOrder(orderId: string, options?: RawDataOption): RequestData<components['schemas']['POSOrderItem']>;
15
+ getCustomer(customerId: string, options?: RawDataOption): RequestData<components['schemas']['POSCustomerItem']>;
16
+ createCustomer(customer: components['schemas']['POSCreateCustomerItem'], options?: ClientRequestOption): RequestData<components['schemas']['POSCustomerItem']>;
17
+ getPaymentMethods(params?: GetPaymentMethodsParams, options?: RawDataOption): RequestData<components['schemas']['PaymentMethods'][]>;
18
+ getProductCategories(params?: GetProductCategoriesParams, options?: RawDataOption): RequestData<components['schemas']['backbone_common__models__pos__common__ProductCategoryItem'][]>;
19
+ getProducts(params?: GetProductsParams, options?: RawDataOption): RequestData<components['schemas']['POSProductItem'][]>;
20
+ getSales(params: operations['pos_get_sales']['parameters']['query'], options?: RawDataOption): RequestData<components['schemas']['SalesItem']>;
21
+ getClosure(date: string, params?: operations['pos_get_closure']['parameters']['query'], options?: RawDataOption): RequestData<components['schemas']['ClosureItem']>;
22
+ getPayments(params: GetPaymentsParams, options?: RawDataOption): RequestData<components['schemas']['POSPaymentItem'][]>;
23
+ updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem'], options?: ClientRequestOption): RequestData<components['schemas']['POSOrderItem']>;
24
+ getAccountingCategories(params?: GetAccountingCategoriesParams, options?: RawDataOption): RequestData<components['schemas']['AccountingCategoryItem'][]>;
25
25
  };
26
26
  export { posFactory };
@@ -2,99 +2,113 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.posFactory = void 0;
4
4
  const posFactory = {
5
- getLocations() {
5
+ getLocations(options) {
6
6
  return {
7
7
  method: 'get',
8
8
  url: '/consumers/{consumer_id}/pos/locations',
9
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
9
10
  };
10
11
  },
11
- getOrders(params) {
12
+ getOrders(params, options) {
12
13
  return {
13
14
  params,
14
15
  method: 'get',
15
16
  url: '/consumers/{consumer_id}/pos/orders',
17
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
16
18
  };
17
19
  },
18
- getCustomers(params) {
20
+ getCustomers(params, options) {
19
21
  return {
20
22
  params,
21
23
  method: 'get',
22
24
  url: '/consumers/{consumer_id}/pos/customers',
25
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
23
26
  };
24
27
  },
25
- getOrder(orderId) {
28
+ getOrder(orderId, options) {
26
29
  return {
27
30
  method: 'get',
28
31
  url: `/consumers/{consumer_id}/pos/orders/${orderId}`,
32
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
29
33
  };
30
34
  },
31
- getCustomer(customerId) {
35
+ getCustomer(customerId, options) {
32
36
  return {
33
37
  method: 'get',
34
38
  url: `/consumers/{consumer_id}/pos/customers/${customerId}`,
39
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
35
40
  };
36
41
  },
37
- createCustomer(customer) {
42
+ createCustomer(customer, options) {
38
43
  return {
39
- method: 'create',
44
+ method: 'post',
40
45
  url: `/consumers/{consumer_id}/pos/customers`,
41
46
  body: customer,
47
+ clientRequestId: options === null || options === void 0 ? void 0 : options.clientRequestId,
42
48
  };
43
49
  },
44
- getPaymentMethods(params) {
50
+ getPaymentMethods(params, options) {
45
51
  return {
46
52
  params,
47
53
  method: 'get',
48
54
  url: `/consumers/{consumer_id}/pos/payment-methods`,
55
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
49
56
  };
50
57
  },
51
- getProductCategories(params) {
58
+ getProductCategories(params, options) {
52
59
  return {
53
60
  params,
54
61
  method: 'get',
55
62
  url: `/consumers/{consumer_id}/pos/product-categories`,
63
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
56
64
  };
57
65
  },
58
- getProducts(params) {
66
+ getProducts(params, options) {
59
67
  return {
60
68
  params,
61
69
  method: 'get',
62
70
  url: `/consumers/{consumer_id}/pos/products`,
71
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
63
72
  };
64
73
  },
65
- getSales(params) {
74
+ getSales(params, options) {
66
75
  return {
67
76
  params,
68
77
  method: 'get',
69
78
  url: `/consumers/{consumer_id}/pos/sales`,
79
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
70
80
  };
71
81
  },
72
- getClosure(date, params) {
82
+ getClosure(date, params, options) {
73
83
  return {
74
84
  params,
75
85
  method: 'get',
76
86
  url: `/consumers/{consumer_id}/pos/closures/${date}`,
87
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
77
88
  };
78
89
  },
79
- getPayments(params) {
90
+ getPayments(params, options) {
80
91
  return {
81
92
  params,
82
93
  method: 'get',
83
94
  url: `/consumers/{consumer_id}/pos/payments`,
95
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
84
96
  };
85
97
  },
86
- updateOrder(orderId, order) {
98
+ updateOrder(orderId, order, options) {
87
99
  return {
88
100
  method: 'patch',
89
101
  url: `/consumers/{consumer_id}/pos/orders/${orderId}`,
90
102
  body: order,
103
+ clientRequestId: options === null || options === void 0 ? void 0 : options.clientRequestId,
91
104
  };
92
105
  },
93
- getAccountingCategories(params) {
106
+ getAccountingCategories(params, options) {
94
107
  return {
95
108
  params,
96
109
  method: 'get',
97
110
  url: `/consumers/{consumer_id}/pos/accounting-categories`,
111
+ rawData: options === null || options === void 0 ? void 0 : options.rawData,
98
112
  };
99
113
  },
100
114
  };