oneentry 1.0.141 → 1.0.142

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 (150) hide show
  1. package/configure.js +107 -15
  2. package/package.json +81 -3
  3. package/dist/admins/adminsApi.d.ts +0 -50
  4. package/dist/admins/adminsApi.js +0 -65
  5. package/dist/admins/adminsInterfaces.d.ts +0 -99
  6. package/dist/admins/adminsInterfaces.js +0 -2
  7. package/dist/admins/adminsSchemas.d.ts +0 -30
  8. package/dist/admins/adminsSchemas.js +0 -27
  9. package/dist/attribute-sets/attributeSetsApi.d.ts +0 -63
  10. package/dist/attribute-sets/attributeSetsApi.js +0 -98
  11. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +0 -187
  12. package/dist/attribute-sets/attributeSetsInterfaces.js +0 -2
  13. package/dist/attribute-sets/attributeSetsSchemas.d.ts +0 -90
  14. package/dist/attribute-sets/attributeSetsSchemas.js +0 -74
  15. package/dist/auth-provider/authProviderApi.d.ts +0 -249
  16. package/dist/auth-provider/authProviderApi.js +0 -351
  17. package/dist/auth-provider/authProviderSchemas.d.ts +0 -131
  18. package/dist/auth-provider/authProviderSchemas.js +0 -82
  19. package/dist/auth-provider/authProvidersInterfaces.d.ts +0 -425
  20. package/dist/auth-provider/authProvidersInterfaces.js +0 -2
  21. package/dist/base/asyncModules.d.ts +0 -80
  22. package/dist/base/asyncModules.js +0 -440
  23. package/dist/base/result.d.ts +0 -39
  24. package/dist/base/result.js +0 -154
  25. package/dist/base/stateModule.d.ts +0 -41
  26. package/dist/base/stateModule.js +0 -128
  27. package/dist/base/syncModules.d.ts +0 -149
  28. package/dist/base/syncModules.js +0 -549
  29. package/dist/base/utils.d.ts +0 -197
  30. package/dist/base/utils.js +0 -2
  31. package/dist/base/validation.d.ts +0 -118
  32. package/dist/base/validation.js +0 -132
  33. package/dist/blocks/blocksApi.d.ts +0 -76
  34. package/dist/blocks/blocksApi.js +0 -188
  35. package/dist/blocks/blocksInterfaces.d.ts +0 -173
  36. package/dist/blocks/blocksInterfaces.js +0 -2
  37. package/dist/blocks/blocksSchemas.d.ts +0 -187
  38. package/dist/blocks/blocksSchemas.js +0 -43
  39. package/dist/discounts/discountsApi.d.ts +0 -56
  40. package/dist/discounts/discountsApi.js +0 -82
  41. package/dist/discounts/discountsInterfaces.d.ts +0 -145
  42. package/dist/discounts/discountsInterfaces.js +0 -2
  43. package/dist/events/eventsApi.d.ts +0 -60
  44. package/dist/events/eventsApi.js +0 -97
  45. package/dist/events/eventsInterfaces.d.ts +0 -87
  46. package/dist/events/eventsInterfaces.js +0 -2
  47. package/dist/file-uploading/fileUploadingApi.d.ts +0 -88
  48. package/dist/file-uploading/fileUploadingApi.js +0 -132
  49. package/dist/file-uploading/fileUploadingInterfaces.d.ts +0 -117
  50. package/dist/file-uploading/fileUploadingInterfaces.js +0 -2
  51. package/dist/file-uploading/fileUploadingSchemas.d.ts +0 -22
  52. package/dist/file-uploading/fileUploadingSchemas.js +0 -21
  53. package/dist/forms/formsApi.d.ts +0 -42
  54. package/dist/forms/formsApi.js +0 -57
  55. package/dist/forms/formsInterfaces.d.ts +0 -132
  56. package/dist/forms/formsInterfaces.js +0 -2
  57. package/dist/forms/formsSchemas.d.ts +0 -50
  58. package/dist/forms/formsSchemas.js +0 -31
  59. package/dist/forms-data/formsDataApi.d.ts +0 -106
  60. package/dist/forms-data/formsDataApi.js +0 -189
  61. package/dist/forms-data/formsDataInterfaces.d.ts +0 -525
  62. package/dist/forms-data/formsDataInterfaces.js +0 -2
  63. package/dist/forms-data/formsDataSchemas.d.ts +0 -115
  64. package/dist/forms-data/formsDataSchemas.js +0 -86
  65. package/dist/general-types/generalTypesApi.d.ts +0 -28
  66. package/dist/general-types/generalTypesApi.js +0 -38
  67. package/dist/general-types/generalTypesInterfaces.d.ts +0 -30
  68. package/dist/general-types/generalTypesInterfaces.js +0 -2
  69. package/dist/general-types/generalTypesSchemas.d.ts +0 -50
  70. package/dist/general-types/generalTypesSchemas.js +0 -35
  71. package/dist/index.d.ts +0 -100
  72. package/dist/index.js +0 -103
  73. package/dist/integration-collections/integrationCollectionsApi.d.ts +0 -173
  74. package/dist/integration-collections/integrationCollectionsApi.js +0 -220
  75. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +0 -313
  76. package/dist/integration-collections/integrationCollectionsInterfaces.js +0 -2
  77. package/dist/integration-collections/integrationCollectionsSchemas.d.ts +0 -80
  78. package/dist/integration-collections/integrationCollectionsSchemas.js +0 -61
  79. package/dist/locales/localesApi.d.ts +0 -27
  80. package/dist/locales/localesApi.js +0 -37
  81. package/dist/locales/localesInterfaces.d.ts +0 -41
  82. package/dist/locales/localesInterfaces.js +0 -2
  83. package/dist/locales/localesSchemas.d.ts +0 -32
  84. package/dist/locales/localesSchemas.js +0 -26
  85. package/dist/menus/menusApi.d.ts +0 -29
  86. package/dist/menus/menusApi.js +0 -39
  87. package/dist/menus/menusInterfaces.d.ts +0 -88
  88. package/dist/menus/menusInterfaces.js +0 -4
  89. package/dist/menus/menusSchemas.d.ts +0 -16
  90. package/dist/menus/menusSchemas.js +0 -28
  91. package/dist/orders/ordersApi.d.ts +0 -149
  92. package/dist/orders/ordersApi.js +0 -203
  93. package/dist/orders/ordersInterfaces.d.ts +0 -527
  94. package/dist/orders/ordersInterfaces.js +0 -2
  95. package/dist/orders/ordersSchemas.d.ts +0 -120
  96. package/dist/orders/ordersSchemas.js +0 -101
  97. package/dist/pages/pagesApi.d.ts +0 -151
  98. package/dist/pages/pagesApi.js +0 -390
  99. package/dist/pages/pagesInterfaces.d.ts +0 -292
  100. package/dist/pages/pagesInterfaces.js +0 -2
  101. package/dist/pages/pagesSchemas.d.ts +0 -85
  102. package/dist/pages/pagesSchemas.js +0 -46
  103. package/dist/payments/paymentsApi.d.ts +0 -82
  104. package/dist/payments/paymentsApi.js +0 -121
  105. package/dist/payments/paymentsInterfaces.d.ts +0 -206
  106. package/dist/payments/paymentsInterfaces.js +0 -2
  107. package/dist/payments/paymentsSchemas.d.ts +0 -100
  108. package/dist/payments/paymentsSchemas.js +0 -65
  109. package/dist/product-statuses/productStatusesApi.d.ts +0 -47
  110. package/dist/product-statuses/productStatusesApi.js +0 -70
  111. package/dist/product-statuses/productStatusesInterfaces.d.ts +0 -66
  112. package/dist/product-statuses/productStatusesInterfaces.js +0 -2
  113. package/dist/product-statuses/productStatusesSchemas.d.ts +0 -34
  114. package/dist/product-statuses/productStatusesSchemas.js +0 -30
  115. package/dist/products/productsApi.d.ts +0 -365
  116. package/dist/products/productsApi.js +0 -459
  117. package/dist/products/productsInterfaces.d.ts +0 -586
  118. package/dist/products/productsInterfaces.js +0 -2
  119. package/dist/products/productsSchemas.d.ts +0 -192
  120. package/dist/products/productsSchemas.js +0 -96
  121. package/dist/sitemap/sitemapApi.d.ts +0 -35
  122. package/dist/sitemap/sitemapApi.js +0 -45
  123. package/dist/sitemap/sitemapInterfaces.d.ts +0 -40
  124. package/dist/sitemap/sitemapInterfaces.js +0 -2
  125. package/dist/system/systemApi.d.ts +0 -43
  126. package/dist/system/systemApi.js +0 -58
  127. package/dist/system/systemInterfaces.d.ts +0 -31
  128. package/dist/system/systemInterfaces.js +0 -5
  129. package/dist/templates/templatesApi.d.ts +0 -49
  130. package/dist/templates/templatesApi.js +0 -75
  131. package/dist/templates/templatesInterfaces.d.ts +0 -70
  132. package/dist/templates/templatesInterfaces.js +0 -2
  133. package/dist/templates/templatesSchemas.d.ts +0 -48
  134. package/dist/templates/templatesSchemas.js +0 -31
  135. package/dist/templates-preview/templatesPreviewApi.d.ts +0 -38
  136. package/dist/templates-preview/templatesPreviewApi.js +0 -53
  137. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -121
  138. package/dist/templates-preview/templatesPreviewInterfaces.js +0 -2
  139. package/dist/templates-preview/templatesPreviewSchemas.d.ts +0 -83
  140. package/dist/templates-preview/templatesPreviewSchemas.js +0 -48
  141. package/dist/users/usersApi.d.ts +0 -143
  142. package/dist/users/usersApi.js +0 -173
  143. package/dist/users/usersInterfaces.d.ts +0 -235
  144. package/dist/users/usersInterfaces.js +0 -2
  145. package/dist/users/usersSchemas.d.ts +0 -38
  146. package/dist/users/usersSchemas.js +0 -28
  147. package/dist/web-socket/wsApi.d.ts +0 -25
  148. package/dist/web-socket/wsApi.js +0 -45
  149. package/dist/web-socket/wsInterfaces.d.ts +0 -17
  150. package/dist/web-socket/wsInterfaces.js +0 -2
@@ -1,203 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const asyncModules_1 = __importDefault(require("../base/asyncModules"));
7
- const ordersSchemas_1 = require("./ordersSchemas");
8
- /**
9
- * Controllers for working with orders.
10
- * @handle /api/content/orders-storage
11
- * @module OrdersApi
12
- * @description This module provides methods for working with orders, including retrieving, creating, and updating orders in the order storage.
13
- */
14
- class OrdersApi extends asyncModules_1.default {
15
- /**
16
- * Constructs an instance of the OrdersApi class.
17
- * @param {StateModule} state - The state module containing the necessary information for making API calls.
18
- * @description Constructor initializes the OrdersApi with a given state.
19
- */
20
- constructor(state) {
21
- super(state);
22
- this._url = state.url + '/api/content/orders-storage';
23
- }
24
- /**
25
- * Getting all the order storage objects.
26
- * @handleName getAllOrdersStorage
27
- * @param {string} [langCode] - Language code. Default: "en_US".
28
- * @param {number} [offset] - Optional parameter for pagination. Default: 0.
29
- * @param {number} [limit] - Optional parameter for pagination. Default: 30.
30
- * @returns {Promise<IOrdersEntity[] | IError>} Returns an array of order storage objects.
31
- * @throws {IError} When isShell=false and an error occurs during the fetch
32
- * @description This method requires user authorization.
33
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
34
- */
35
- async getAllOrdersStorage(langCode = this.state.lang, offset = 0, limit = 30) {
36
- const result = await this._fetchGet(`?langCode=${langCode}&limit=${limit}&offset=${offset}`);
37
- return this._normalizeData(result);
38
- }
39
- /**
40
- * Getting all orders from the orders storage object created by the user.
41
- * @handleName getAllOrdersByMarker
42
- * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
43
- * @param {string} [langCode] - Language code. Default: "en_US".
44
- * @param {number} [offset] - Offset parameter. Default: 0.
45
- * @param {number} [limit] - Limit parameter. Default: 30.
46
- * @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with the orders.
47
- * @throws {IError} When isShell=false and an error occurs during the fetch
48
- * @description This method requires user authorization.
49
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
50
- */
51
- async getAllOrdersByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
52
- const result = await this._fetchGet(`/marker/${marker}/orders?langCode=${langCode}&limit=${limit}&offset=${offset}`);
53
- // Validate response if validation is enabled
54
- const validated = this._validateResponse(result, ordersSchemas_1.OrdersResponseSchema);
55
- return this._normalizeData(validated);
56
- }
57
- /**
58
- * Retrieve one order storage object by marker.
59
- * @handleName getOrdersStorageByMarker
60
- * @param {string} marker - Marker of the order object. Example: "order_storage_1".
61
- * @param {string} [langCode] - Language code. Default: "en_US".
62
- * @returns {Promise<IOrdersEntity | IError>} Return object of order information.
63
- * @throws {IError} When isShell=false and an error occurs during the fetch
64
- * @description This method requires user authorization.
65
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
66
- */
67
- async getOrdersStorageByMarker(marker, langCode = this.state.lang) {
68
- const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
69
- return this._normalizeData(result);
70
- }
71
- /**
72
- * Getting a single order from the order storage object created by the user.
73
- * @handleName getOrderByMarkerAndId
74
- * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
75
- * @param {number} id - ID of the order object. Example: 12345.
76
- * @param {string} [langCode] - Language code. Default: "en_US".
77
- * @returns {Promise<IOrderByMarkerEntity | IError>} Returns an object with the order.
78
- * @throws {IError} When isShell=false and an error occurs during the fetch
79
- * @description This method requires user authorization.
80
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
81
- */
82
- async getOrderByMarkerAndId(marker, id, langCode = this.state.lang) {
83
- const result = await this._fetchGet(`/marker/${marker}/orders/${id}?langCode=${langCode}`);
84
- // Validate response if validation is enabled
85
- const validated = this._validateResponse(result, ordersSchemas_1.OrderEntitySchema);
86
- return this._normalizeData(validated);
87
- }
88
- /**
89
- * Preview order calculation with discounts and coupons (without saving).
90
- * @handleName previewOrder
91
- * @param {ICreateOrderPreview} body - Order preview body.
92
- * @param {string} [langCode] - Language code. Default: "en_US".
93
- * @returns {Promise<IOrderPreviewResponse | IError>} Returns an object with the order preview.
94
- * @throws {IError} When isShell=false and an error occurs during the fetch
95
- * @description This method requires user authorization ???.
96
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
97
- */
98
- async previewOrder(body, langCode = this.state.lang) {
99
- const result = await this._fetchPost(`/orders/preview?langCode=${langCode}`, body);
100
- return this._normalizeData(result);
101
- }
102
- /**
103
- * Creation of an order in the order storage.
104
- * @handleName createOrder
105
- * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
106
- * @param {IOrderData} body - Object for creating an order.
107
- * @example
108
- {
109
- "formIdentifier": "bar-orders-form",
110
- "paymentAccountIdentifier": "usd-payment",
111
- "formData": {
112
- "marker": "name_1",
113
- "value": "Name",
114
- "type": "string"
115
- },
116
- "products": [
117
- {
118
- "productId": 1,
119
- "quantity": 2
120
- }
121
- ]
122
- }
123
- * @param {string} [langCode] - Language code. Default: "en_US".
124
- * @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the created order.
125
- * @throws {IError} When isShell=false and an error occurs during the fetch
126
- * @description This method requires user authorization.
127
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
128
- */
129
- async createOrder(marker, body, langCode = this.state.lang) {
130
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
- const formData = {};
132
- formData[langCode] = Array.isArray(body.formData)
133
- ? body.formData
134
- : [body.formData];
135
- body.formData = formData;
136
- const result = await this._fetchPost(`/marker/${marker}/orders`, body);
137
- // Validate response if validation is enabled
138
- const validated = this._validateResponse(result, ordersSchemas_1.CreateOrderResponseSchema);
139
- return this._normalizeData(validated);
140
- }
141
- /**
142
- * Changing an order in the orders storage
143
- * @handleName updateOrderByMarkerAndId
144
- * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
145
- * @param {number} id - ID of the order object. Example: 12345.
146
- * @param {IOrderData} body - Object for updating an order.
147
- * @example
148
- {
149
- "formIdentifier": "bar-orders-form",
150
- "paymentAccountIdentifier": "usd-payment",
151
- "formData": {
152
- "marker": "name_1",
153
- "value": "Name",
154
- "type": "string"
155
- },
156
- "products": [
157
- {
158
- "productId": 1,
159
- "quantity": 2
160
- }
161
- ],
162
- "currency": "USD"
163
- }
164
- * @param {string} [langCode] - Language code. Default: "en_US".
165
- * @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the updated order.
166
- * @throws {IError} When isShell=false and an error occurs during the fetch
167
- * @description This method requires user authorization.
168
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
169
- */
170
- async updateOrderByMarkerAndId(marker, id, body, langCode = this.state.lang) {
171
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
172
- const formData = {};
173
- formData[langCode] = Array.isArray(body.formData)
174
- ? body.formData
175
- : [body.formData];
176
- body.formData = formData;
177
- const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, body);
178
- // Validate response if validation is enabled
179
- const validated = this._validateResponse(result, ordersSchemas_1.UpdateOrderResponseSchema);
180
- return this._normalizeData(validated);
181
- }
182
- /**
183
- * Get all orders statuses by Storage marker
184
- * @handleName getAllStatusesByStorageMarker
185
- * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
186
- * @param {string} [langCode] - Language code. Default: "en_US".
187
- * @param {number} [offset] - Offset parameter. Default: 0.
188
- * @param {number} [limit] - Limit parameter. Default: 30.
189
- * @returns {Promise<IOrderStatus[] | IError>} Returns an object with the orders statuses.
190
- * @throws {IError} When isShell=false and an error occurs during the fetch
191
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
192
- */
193
- async getAllStatusesByStorageMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
194
- const query = {
195
- langCode,
196
- offset,
197
- limit,
198
- };
199
- const data = await this._fetchGet(`/marker/${marker}/order-statuses?` + this._queryParamsToString(query));
200
- return this._normalizeData(data);
201
- }
202
- }
203
- exports.default = OrdersApi;