oneentry 1.0.140 → 1.0.141

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 (149) hide show
  1. package/dist/admins/adminsApi.d.ts +50 -0
  2. package/dist/admins/adminsApi.js +65 -0
  3. package/dist/admins/adminsInterfaces.d.ts +99 -0
  4. package/dist/admins/adminsInterfaces.js +2 -0
  5. package/dist/admins/adminsSchemas.d.ts +30 -0
  6. package/dist/admins/adminsSchemas.js +27 -0
  7. package/dist/attribute-sets/attributeSetsApi.d.ts +63 -0
  8. package/dist/attribute-sets/attributeSetsApi.js +98 -0
  9. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +187 -0
  10. package/dist/attribute-sets/attributeSetsInterfaces.js +2 -0
  11. package/dist/attribute-sets/attributeSetsSchemas.d.ts +90 -0
  12. package/dist/attribute-sets/attributeSetsSchemas.js +74 -0
  13. package/dist/auth-provider/authProviderApi.d.ts +249 -0
  14. package/dist/auth-provider/authProviderApi.js +351 -0
  15. package/dist/auth-provider/authProviderSchemas.d.ts +131 -0
  16. package/dist/auth-provider/authProviderSchemas.js +82 -0
  17. package/dist/auth-provider/authProvidersInterfaces.d.ts +425 -0
  18. package/dist/auth-provider/authProvidersInterfaces.js +2 -0
  19. package/dist/base/asyncModules.d.ts +80 -0
  20. package/dist/base/asyncModules.js +440 -0
  21. package/dist/base/result.d.ts +39 -0
  22. package/dist/base/result.js +154 -0
  23. package/dist/base/stateModule.d.ts +41 -0
  24. package/dist/base/stateModule.js +128 -0
  25. package/dist/base/syncModules.d.ts +149 -0
  26. package/dist/base/syncModules.js +549 -0
  27. package/dist/base/utils.d.ts +197 -0
  28. package/dist/base/utils.js +2 -0
  29. package/dist/base/validation.d.ts +118 -0
  30. package/dist/base/validation.js +132 -0
  31. package/dist/blocks/blocksApi.d.ts +76 -0
  32. package/dist/blocks/blocksApi.js +188 -0
  33. package/dist/blocks/blocksInterfaces.d.ts +173 -0
  34. package/dist/blocks/blocksInterfaces.js +2 -0
  35. package/dist/blocks/blocksSchemas.d.ts +187 -0
  36. package/dist/blocks/blocksSchemas.js +43 -0
  37. package/dist/discounts/discountsApi.d.ts +56 -0
  38. package/dist/discounts/discountsApi.js +82 -0
  39. package/dist/discounts/discountsInterfaces.d.ts +145 -0
  40. package/dist/discounts/discountsInterfaces.js +2 -0
  41. package/dist/events/eventsApi.d.ts +60 -0
  42. package/dist/events/eventsApi.js +97 -0
  43. package/dist/events/eventsInterfaces.d.ts +87 -0
  44. package/dist/events/eventsInterfaces.js +2 -0
  45. package/dist/file-uploading/fileUploadingApi.d.ts +88 -0
  46. package/dist/file-uploading/fileUploadingApi.js +132 -0
  47. package/dist/file-uploading/fileUploadingInterfaces.d.ts +117 -0
  48. package/dist/file-uploading/fileUploadingInterfaces.js +2 -0
  49. package/dist/file-uploading/fileUploadingSchemas.d.ts +22 -0
  50. package/dist/file-uploading/fileUploadingSchemas.js +21 -0
  51. package/dist/forms/formsApi.d.ts +42 -0
  52. package/dist/forms/formsApi.js +57 -0
  53. package/dist/forms/formsInterfaces.d.ts +132 -0
  54. package/dist/forms/formsInterfaces.js +2 -0
  55. package/dist/forms/formsSchemas.d.ts +50 -0
  56. package/dist/forms/formsSchemas.js +31 -0
  57. package/dist/forms-data/formsDataApi.d.ts +106 -0
  58. package/dist/forms-data/formsDataApi.js +189 -0
  59. package/dist/forms-data/formsDataInterfaces.d.ts +525 -0
  60. package/dist/forms-data/formsDataInterfaces.js +2 -0
  61. package/dist/forms-data/formsDataSchemas.d.ts +115 -0
  62. package/dist/forms-data/formsDataSchemas.js +86 -0
  63. package/dist/general-types/generalTypesApi.d.ts +28 -0
  64. package/dist/general-types/generalTypesApi.js +38 -0
  65. package/dist/general-types/generalTypesInterfaces.d.ts +30 -0
  66. package/dist/general-types/generalTypesInterfaces.js +2 -0
  67. package/dist/general-types/generalTypesSchemas.d.ts +50 -0
  68. package/dist/general-types/generalTypesSchemas.js +35 -0
  69. package/dist/index.d.ts +100 -0
  70. package/dist/index.js +103 -0
  71. package/dist/integration-collections/integrationCollectionsApi.d.ts +173 -0
  72. package/dist/integration-collections/integrationCollectionsApi.js +220 -0
  73. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +313 -0
  74. package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
  75. package/dist/integration-collections/integrationCollectionsSchemas.d.ts +80 -0
  76. package/dist/integration-collections/integrationCollectionsSchemas.js +61 -0
  77. package/dist/locales/localesApi.d.ts +27 -0
  78. package/dist/locales/localesApi.js +37 -0
  79. package/dist/locales/localesInterfaces.d.ts +41 -0
  80. package/dist/locales/localesInterfaces.js +2 -0
  81. package/dist/locales/localesSchemas.d.ts +32 -0
  82. package/dist/locales/localesSchemas.js +26 -0
  83. package/dist/menus/menusApi.d.ts +29 -0
  84. package/dist/menus/menusApi.js +39 -0
  85. package/dist/menus/menusInterfaces.d.ts +88 -0
  86. package/dist/menus/menusInterfaces.js +4 -0
  87. package/dist/menus/menusSchemas.d.ts +16 -0
  88. package/dist/menus/menusSchemas.js +28 -0
  89. package/dist/orders/ordersApi.d.ts +149 -0
  90. package/dist/orders/ordersApi.js +203 -0
  91. package/dist/orders/ordersInterfaces.d.ts +527 -0
  92. package/dist/orders/ordersInterfaces.js +2 -0
  93. package/dist/orders/ordersSchemas.d.ts +120 -0
  94. package/dist/orders/ordersSchemas.js +101 -0
  95. package/dist/pages/pagesApi.d.ts +151 -0
  96. package/dist/pages/pagesApi.js +390 -0
  97. package/dist/pages/pagesInterfaces.d.ts +292 -0
  98. package/dist/pages/pagesInterfaces.js +2 -0
  99. package/dist/pages/pagesSchemas.d.ts +85 -0
  100. package/dist/pages/pagesSchemas.js +46 -0
  101. package/dist/payments/paymentsApi.d.ts +82 -0
  102. package/dist/payments/paymentsApi.js +121 -0
  103. package/dist/payments/paymentsInterfaces.d.ts +206 -0
  104. package/dist/payments/paymentsInterfaces.js +2 -0
  105. package/dist/payments/paymentsSchemas.d.ts +100 -0
  106. package/dist/payments/paymentsSchemas.js +65 -0
  107. package/dist/product-statuses/productStatusesApi.d.ts +47 -0
  108. package/dist/product-statuses/productStatusesApi.js +70 -0
  109. package/dist/product-statuses/productStatusesInterfaces.d.ts +66 -0
  110. package/dist/product-statuses/productStatusesInterfaces.js +2 -0
  111. package/dist/product-statuses/productStatusesSchemas.d.ts +34 -0
  112. package/dist/product-statuses/productStatusesSchemas.js +30 -0
  113. package/dist/products/productsApi.d.ts +365 -0
  114. package/dist/products/productsApi.js +459 -0
  115. package/dist/products/productsInterfaces.d.ts +586 -0
  116. package/dist/products/productsInterfaces.js +2 -0
  117. package/dist/products/productsSchemas.d.ts +192 -0
  118. package/dist/products/productsSchemas.js +96 -0
  119. package/dist/sitemap/sitemapApi.d.ts +35 -0
  120. package/dist/sitemap/sitemapApi.js +45 -0
  121. package/dist/sitemap/sitemapInterfaces.d.ts +40 -0
  122. package/dist/sitemap/sitemapInterfaces.js +2 -0
  123. package/dist/system/systemApi.d.ts +43 -0
  124. package/dist/system/systemApi.js +58 -0
  125. package/dist/system/systemInterfaces.d.ts +31 -0
  126. package/dist/system/systemInterfaces.js +5 -0
  127. package/dist/templates/templatesApi.d.ts +49 -0
  128. package/dist/templates/templatesApi.js +75 -0
  129. package/dist/templates/templatesInterfaces.d.ts +70 -0
  130. package/dist/templates/templatesInterfaces.js +2 -0
  131. package/dist/templates/templatesSchemas.d.ts +48 -0
  132. package/dist/templates/templatesSchemas.js +31 -0
  133. package/dist/templates-preview/templatesPreviewApi.d.ts +38 -0
  134. package/dist/templates-preview/templatesPreviewApi.js +53 -0
  135. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +121 -0
  136. package/dist/templates-preview/templatesPreviewInterfaces.js +2 -0
  137. package/dist/templates-preview/templatesPreviewSchemas.d.ts +83 -0
  138. package/dist/templates-preview/templatesPreviewSchemas.js +48 -0
  139. package/dist/users/usersApi.d.ts +143 -0
  140. package/dist/users/usersApi.js +173 -0
  141. package/dist/users/usersInterfaces.d.ts +235 -0
  142. package/dist/users/usersInterfaces.js +2 -0
  143. package/dist/users/usersSchemas.d.ts +38 -0
  144. package/dist/users/usersSchemas.js +28 -0
  145. package/dist/web-socket/wsApi.d.ts +25 -0
  146. package/dist/web-socket/wsApi.js +45 -0
  147. package/dist/web-socket/wsInterfaces.d.ts +17 -0
  148. package/dist/web-socket/wsInterfaces.js +2 -0
  149. package/package.json +3 -81
@@ -0,0 +1,527 @@
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
+ /**
3
+ * @interface IOrdersApi
4
+ * @property {Function} getOrdersStorageByMarker - Retrieve one order storage object by marker.
5
+ * @property {Function} createOrder - Creation of an order in the order storage.
6
+ * @property {Function} updateOrderByMarkerAndId - Changing an order in the order store.
7
+ * @property {Function} getOrderByMarkerAndId - Getting a single order from the order storage object created by the user.
8
+ * @property {Function} getAllOrders - Getting all the order storage objects.
9
+ * @property {Function} getAllOrdersByMarker - Getting one order storage object by marker.
10
+ * @property {Function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
11
+ * @description Represents the API for managing orders in the order storage.
12
+ */
13
+ interface IOrdersApi {
14
+ /**
15
+ * Getting all the order storage objects.
16
+ * @handleName getAllOrdersStorage
17
+ * @param {string} [langCode] - Language code. Default: "en_US".
18
+ * @param {number} [offset] - Optional parameter for pagination. Default: 0.
19
+ * @param {number} [limit] - Optional parameter for pagination. Default: 30.
20
+ * @returns {Promise<IOrdersEntity[] | IError>} Returns an array of order storage objects.
21
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
22
+ * @description This method gets all the order storage objects. This method requires user authorization.
23
+ * @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}.
24
+ */
25
+ getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<IOrdersEntity[] | IError>;
26
+ /**
27
+ * Getting all orders from the orders storage object created by the user.
28
+ * @handleName getAllOrdersByMarker
29
+ * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
30
+ * @param {string} [langCode] - Language code. Default: "en_US".
31
+ * @param {number} [offset] - Offset parameter. Default: 0.
32
+ * @param {number} [limit] - Limit parameter. Default: 30.
33
+ * @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with the orders.
34
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
35
+ * @description This method gets all orders from the orders storage object created by the user. This method requires user authorization.
36
+ * @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}.
37
+ */
38
+ getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
39
+ /**
40
+ * Retrieve one order storage object by marker.
41
+ * @handleName getOrdersStorageByMarker
42
+ * @param {string} marker - Marker of the order object. Example: "order_storage_1".
43
+ * @param {string} [langCode] - Language code. Default: "en_US".
44
+ * @returns {Promise<IOrdersEntity | IError>} Return object of order information.
45
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
46
+ * @description This method retrieves one order storage object by marker. This method requires user authorization.
47
+ * @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}.
48
+ */
49
+ getOrdersStorageByMarker(marker: string, langCode?: string): Promise<IOrdersEntity | IError>;
50
+ /**
51
+ * Getting a single order from the order storage object created by the user.
52
+ * @handleName getOrderByMarkerAndId
53
+ * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
54
+ * @param {number} id - ID of the order object. Example: 12345.
55
+ * @param {string} [langCode] - Language code. Default: "en_US".
56
+ * @returns {Promise<IOrderByMarkerEntity | IError>} Returns an object with the order.
57
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
+ * @description This method gets a single order from the order storage object created by the user. This method requires user authorization.
59
+ * @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}.
60
+ */
61
+ getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrderByMarkerEntity | IError>;
62
+ /**
63
+ * Creation of an order in the order storage.
64
+ * @handleName createOrder
65
+ * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
66
+ * @param {IOrderData} body - Object for creating an order.
67
+ * @example
68
+ {
69
+ "formIdentifier": "bar-orders-form",
70
+ "paymentAccountIdentifier": "usd-payment",
71
+ "formData": {
72
+ "marker": "name_1",
73
+ "value": "Name",
74
+ "type": "string"
75
+ },
76
+ "products": [
77
+ {
78
+ "productId": 1,
79
+ "quantity": 2
80
+ }
81
+ ]
82
+ }
83
+ * @param {string} [langCode] - Language code. Default: "en_US".
84
+ * @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the created order.
85
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
86
+ * @description This method requires user authorization.
87
+ * @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}.
88
+ */
89
+ createOrder(marker: string, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
90
+ /**
91
+ * Changing an order in the orders storage
92
+ * @handleName updateOrderByMarkerAndId
93
+ * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
94
+ * @param {number} id - ID of the order object. Example: 12345.
95
+ * @param {IOrderData} body - Object for updating an order.
96
+ * @example
97
+ {
98
+ "formIdentifier": "bar-orders-form",
99
+ "paymentAccountIdentifier": "usd-payment",
100
+ "formData": {
101
+ "marker": "name_1",
102
+ "value": "Name",
103
+ "type": "string"
104
+ },
105
+ "products": [
106
+ {
107
+ "productId": 1,
108
+ "quantity": 2
109
+ }
110
+ ],
111
+ "currency": "USD"
112
+ }
113
+ * @param {string} [langCode] - Language code. Default: "en_US".
114
+ * @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the updated order.
115
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
116
+ * @description This method requires user authorization.
117
+ * @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}.
118
+ */
119
+ updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
120
+ /**
121
+ * Preview order calculation with discounts and coupons (without saving).
122
+ * @handleName previewOrder
123
+ * @param {ICreateOrderPreview} body - Order preview body.
124
+ * @param {string} [langCode] - Language code. Default: "en_US".
125
+ * @returns {Promise<IOrderPreviewResponse | IError>} Returns an object with the order preview.
126
+ * @throws {IError} When isShell=false and an error occurs during the fetch
127
+ * @description This method requires user authorization ???.
128
+ * @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}.
129
+ */
130
+ previewOrder(body: ICreateOrderPreview, langCode?: string): Promise<IOrderPreviewResponse | IError>;
131
+ /**
132
+ * Get all orders statuses by Storage marker
133
+ * @handleName getAllStatusesByStorageMarker
134
+ * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
135
+ * @param {string} [langCode] - Language code. Default: "en_US".
136
+ * @param {number} [offset] - Offset parameter. Default: 0.
137
+ * @param {number} [limit] - Limit parameter. Default: 30.
138
+ * @returns {Promise<IOrderStatus[] | IError>} Returns an object with the orders statuses.
139
+ * @throws {IError} When isShell=false and an error occurs during the fetch
140
+ * @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}.
141
+ */
142
+ getAllStatusesByStorageMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
143
+ }
144
+ /**
145
+ * Interface for the orders storage object.
146
+ * @interface IOrdersByMarkerEntity
147
+ * @property {IOrderByMarkerEntity[]} items - Array of order storage objects.
148
+ * @example
149
+ [
150
+ {
151
+ "id": 55,
152
+ "storageId": 1,
153
+ "createdDate": "2025-03-22T21:12:42.371Z",
154
+ "statusIdentifier": "inProgress",
155
+ "formIdentifier": "orderForm",
156
+ "formData": [
157
+ {
158
+ "marker": "order_name",
159
+ "value": "Ivan",
160
+ "type": "string"
161
+ }
162
+ ],
163
+ "attributeSetIdentifier": "order_form",
164
+ "totalSum": "300.00",
165
+ "currency": "",
166
+ "paymentAccountIdentifier": "cash",
167
+ "paymentAccountLocalizeInfos": {
168
+ "title": "Cash"
169
+ },
170
+ "products": [
171
+ {
172
+ "id": 2957,
173
+ "title": "Cosmo",
174
+ "sku": null,
175
+ "previewImage": null,
176
+ "price": 150,
177
+ "quantity": 2
178
+ }
179
+ ],
180
+ "isCompleted": false
181
+ }
182
+ ]
183
+ * @property {number} total - Total number of found records. Example: 100.
184
+ * @description Represents a response from the order storage by marker.
185
+ */
186
+ interface IOrdersByMarkerEntity {
187
+ total: number;
188
+ items: IOrderByMarkerEntity[];
189
+ }
190
+ /**
191
+ * Interface representing a picture entity.
192
+ * @interface IPicture
193
+ * @property {string} filename - The name of the file. Example: "image.jpg".
194
+ * @property {string} downloadLink - The URL link to download the picture. Example: "https://example.com/image.jpg".
195
+ * @property {number} size - The size of the picture in bytes. Example: 102400.
196
+ * @property {string} previewLink - The URL link to preview the picture. Example: "https://example.com/image-preview.jpg".
197
+ * @description This interface defines the structure for a picture entity, including its filename, download link, size, and preview link.
198
+ */
199
+ interface IPicture {
200
+ filename: string;
201
+ downloadLink: string;
202
+ size: number;
203
+ previewLink: string;
204
+ }
205
+ /**
206
+ * Interface representing a product in an order.
207
+ * @interface IOrderProducts
208
+ * @property {number} id - Product id. Example: 2957.
209
+ * @property {number} quantity - Product quantity. Example: 1.
210
+ * @property {string} title - Product title. Example: "Cosmo".
211
+ * @property {string | null} sku - Product sku. Example: "SKU".
212
+ * @property {any} previewImage - Product previewImage.
213
+ * @example
214
+ {
215
+ "filename": "image.jpg",
216
+ "downloadLink": "https://example.com/image.jpg",
217
+ "size": 102400,
218
+ "previewLink": "https://example.com/image-preview.jpg"
219
+ }
220
+ * @property {number} price - Product price. Example: 150.
221
+ * @property {boolean} isGift - Whether the product is a gift. Example: false.
222
+ * @description Represents a product in an order.
223
+ */
224
+ interface IOrderProducts {
225
+ id: number;
226
+ quantity: number;
227
+ title: string;
228
+ sku: string | null;
229
+ previewImage: any;
230
+ price: number;
231
+ isGift: boolean;
232
+ }
233
+ /**
234
+ * Interface representing form data for orders.
235
+ * @interface IOrdersFormData
236
+ * @property {string} marker - Marker of form field. Example: "name_1".
237
+ * @property {string} type - Type of value. Example: "string".
238
+ * @property {string} value - Value. Example: "Name".
239
+ * @description Represents a form data for orders.
240
+ */
241
+ interface IOrdersFormData {
242
+ marker: string;
243
+ type: string;
244
+ value: any;
245
+ }
246
+ /**
247
+ * Interface representing product data in an order.
248
+ * @interface IOrderProductData
249
+ * @property {number} productId - Product identifier. Example: 1.
250
+ * @property {number} quantity - Quantity of the product. Example: 2.
251
+ * @description Represents a product data in an order.
252
+ */
253
+ interface IOrderProductData {
254
+ productId: number;
255
+ quantity: number;
256
+ }
257
+ /**
258
+ * Interface representing product data in an order.
259
+ * @interface IOrderProductsData
260
+ * @property {number} productId - Product identifier. Example: 1.
261
+ * @property {number} quantity - Quantity of the product. Example: 2.
262
+ * @description Represents a product data in an order.
263
+ */
264
+ interface IOrderProductsData {
265
+ productId: number;
266
+ quantity: number;
267
+ }
268
+ /**
269
+ * Interface representing an order storage object.
270
+ * @interface IBaseOrdersEntity
271
+ * @property {number} id - Object identifier. Example: 1.
272
+ * @property {string} formIdentifier - Text identifier of the form. Example: "bar-orders-form".
273
+ * @property {string} paymentAccountIdentifier - Text identifier of the order payment. Example: "payment-1".
274
+ * @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store.
275
+ * @example
276
+ [
277
+ {
278
+ "marker": "name_1",
279
+ "value": "Name",
280
+ "type": "string"
281
+ }
282
+ ]
283
+ * @property {IOrderProductsData[]} products - Array of products added to order.
284
+ * @example
285
+ [
286
+ {
287
+ "id": 2957,
288
+ "title": "Cosmo",
289
+ "sku": null,
290
+ "previewImage": null,
291
+ "price": 150,
292
+ "quantity": 2
293
+ }
294
+ ]
295
+ * @property {string} currency - Currency used to pay for the order. Example: "USD".
296
+ * @property {number} totalSum - Total order amount. Example: "150".
297
+ * @property {string} [createdDate] - Order creation date. Example: "2023-10-01T12:00:00Z".
298
+ * @property {string} [statusIdentifier] - Text identifier of order status object (if not set, default status will be assigned). Example: "status-1".
299
+ * @property {string} [couponCode] -
300
+ * @property {string[]} [additionalDiscountsMarkers] -
301
+ * @property {unknown} [discountConfig] -
302
+ */
303
+ interface IBaseOrdersEntity {
304
+ id: number;
305
+ formIdentifier: string;
306
+ paymentAccountIdentifier: string;
307
+ formData: IOrdersFormData[];
308
+ products: IOrderProductsData[];
309
+ currency: string;
310
+ totalSum: number;
311
+ createdDate?: string;
312
+ statusIdentifier?: string;
313
+ couponCode?: string;
314
+ additionalDiscountsMarkers?: string[];
315
+ discountConfig?: unknown;
316
+ }
317
+ /**
318
+ * Interface representing a response from the order storage.
319
+ * @interface IBaseOrdersEntityResponse
320
+ * @property {IBaseOrdersEntity[]} items - Array of order storage objects.
321
+ * @example
322
+ [
323
+ {
324
+ "id": 2957,
325
+ "title": "Cosmo",
326
+ "sku": null,
327
+ "previewImage": null,
328
+ "price": 150,
329
+ "quantity": 2
330
+ }
331
+ ]
332
+ * @property {string | number} total - Total number of found records. Example: 100.
333
+ * @description Represents a response from the order storage.
334
+ */
335
+ interface IBaseOrdersEntityResponse {
336
+ items: IBaseOrdersEntity[];
337
+ total: string | number;
338
+ }
339
+ /**
340
+ * Interface representing an order storage object.
341
+ * @interface IOrdersEntity
342
+ * @property {number} id - Object identifier. Example: 1.
343
+ * @property {ILocalizeInfo} localizeInfos - Name considering localization.
344
+ * @example
345
+ {
346
+ "title": "Cash"
347
+ }
348
+ * @property {number | null} position - Position in orders storage. Example: 1.
349
+ * @property {string} identifier - Textual identifier for the record field. Example: "order_storage_1".
350
+ * @property {string} formIdentifier - Textual identifier for the form used by the order storage. Example: "bar-orders-form".
351
+ * @property {number | null} generalTypeId - Type identifier. Example: 1.
352
+ * @property {IPaymentAccountIdentifiers[]} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage.
353
+ * @example
354
+ [
355
+ {
356
+ "identifier": "payment-1"
357
+ }
358
+ ]
359
+ * @description Represents an order storage object.
360
+ */
361
+ interface IOrdersEntity {
362
+ id: number;
363
+ localizeInfos: ILocalizeInfo;
364
+ position: number | null;
365
+ identifier: string | null;
366
+ formIdentifier: string | null;
367
+ generalTypeId: number | null;
368
+ paymentAccountIdentifiers: IPaymentAccountIdentifiers[];
369
+ }
370
+ /**
371
+ * Interface representing an identifier for a payment account used in an order.
372
+ * @interface IPaymentAccountIdentifiers
373
+ * @property {string} identifier - Textual identifier of the payment account. Example: "payment-1".
374
+ * @description Represents an identifier for a payment account used in an order.
375
+ */
376
+ interface IPaymentAccountIdentifiers {
377
+ identifier: string;
378
+ }
379
+ /**
380
+ * Interface representing the data required to create or update an order in the order storage.
381
+ * @interface IOrderData
382
+ * @property {string} formIdentifier - Text identifier of the form object linked to the order repository. Example: "bar-orders-form".
383
+ * @property {string} paymentAccountIdentifier - Text identifier of the payment object linked to the order repository. Example: "payment-1".
384
+ * @property {IOrdersFormData | IOrdersFormData[]} formData - Form data linked to the order repository.
385
+ * @example
386
+ [
387
+ {
388
+ "marker": "name_1",
389
+ "value": "Name",
390
+ "type": "string"
391
+ }
392
+ ]
393
+ * @property {IOrderProductData[]} products - An array of ordered products. Example: [].
394
+ * @property {string} [couponCode] - Coupon code.
395
+ * @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
396
+ * @description Represents the data required to create or update an order in the order storage.
397
+ */
398
+ interface IOrderData {
399
+ formIdentifier: string;
400
+ paymentAccountIdentifier: string;
401
+ formData: IOrdersFormData | IOrdersFormData[];
402
+ products: IOrderProductData[];
403
+ couponCode?: string;
404
+ additionalDiscountsMarkers?: string[];
405
+ }
406
+ /**
407
+ * Interface representing an order product data.
408
+ * @interface IOrderByMarkerEntity
409
+ * @property {number} id - Object identifier. Example: 125.
410
+ * @property {number} storageId - Identifier of the order storage object. Example: 1.
411
+ * @property {string} createdDate - Date when the order was created. Example: "2023-10-01T12:00:00Z".
412
+ * @property {string} [statusIdentifier] - Text identifier of the order status. Example: "order-status-1".
413
+ * @property {string} [formIdentifier] - Text identifier of the form. Example: "bar-orders-form".
414
+ * @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store.
415
+ * @example
416
+ [
417
+ {
418
+ "marker": "order_name",
419
+ "value": "Ivan",
420
+ "type": "string"
421
+ }
422
+ ]
423
+ * @property {string | null} [attributeSetIdentifier] - Text identifier of the attribute set. Example: "attribute-set-1".
424
+ * @property {string} totalSum - Total order amount. Example: "100.00".
425
+ * @property {string} currency - Currency used to pay for the order. Example: "USD".
426
+ * @property {string | null} [paymentAccountIdentifier] - Textual identifier for the order payment. Example: "payment-1".
427
+ * @property {Record<string, any>} paymentAccountLocalizeInfos - Payment account name considering localization.
428
+ * @example
429
+ {
430
+ "en_US": "USD Payment",
431
+ "ru_RU": "Оплата в долларах США"
432
+ }
433
+ * @property {IOrderProducts[]} products - Array of products added to order.
434
+ * @example
435
+ [
436
+ {
437
+ "id": 1,
438
+ "name": "Product 1",
439
+ "quantity": 2
440
+ }
441
+ ]
442
+ * @property {string | null} paymentUrl - Payment link. Example: "https://example.com/pay/123".
443
+ * @property {boolean | null} isCompleted - Indicates that the order has been completed. Example: true.
444
+ * @property {object} [statusLocalizeInfos] - Localization information.
445
+ * @description Represents an order storage object created by the user.
446
+ */
447
+ interface IOrderByMarkerEntity {
448
+ id: number;
449
+ storageId: number;
450
+ createdDate: string;
451
+ statusIdentifier?: string;
452
+ formIdentifier?: string;
453
+ formData: IOrdersFormData[];
454
+ attributeSetIdentifier?: string;
455
+ totalSum: string;
456
+ currency: string;
457
+ paymentAccountIdentifier?: string;
458
+ paymentAccountLocalizeInfos?: Record<string, any>;
459
+ paymentUrl: string | null;
460
+ products: IOrderProducts[];
461
+ isCompleted: boolean | null;
462
+ statusLocalizeInfos?: object;
463
+ }
464
+ /**
465
+ * Interface representing an order status object.
466
+ * @interface IOrderStatus
467
+ * @property {number} [id] - Status identifier. Example: 1.
468
+ * @property {object} [localizeInfos] - Localized information for the status.
469
+ * @property {string} [identifier] - Text identifier of the status. Example: "inProgress".
470
+ * @property {Record<string, unknown>} [position] - Position of the status.
471
+ * @property {boolean} [isUsed] - Whether the status is in use. Example: true.
472
+ */
473
+ interface IOrderStatus {
474
+ id?: number;
475
+ localizeInfos?: object;
476
+ identifier?: string;
477
+ position?: Record<string, unknown>;
478
+ isUsed?: boolean;
479
+ }
480
+ /**
481
+ * Interface representing a product in an order preview.
482
+ * @interface IPreviewOrderProduct
483
+ * @property {number} [productId] - Product identifier. Example: 1.
484
+ * @property {number} [quantity] - Quantity of the product. Example: 2.
485
+ */
486
+ interface IPreviewOrderProduct {
487
+ productId?: number;
488
+ quantity?: number;
489
+ [key: string]: any;
490
+ }
491
+ /**
492
+ * Interface representing the body for order preview calculation.
493
+ * @interface ICreateOrderPreview
494
+ * @property {IPreviewOrderProduct[]} [products] - Array of products to preview.
495
+ * @property {string} [couponCode] - Coupon code to apply.
496
+ * @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
497
+ */
498
+ interface ICreateOrderPreview {
499
+ products?: IPreviewOrderProduct[];
500
+ couponCode?: string;
501
+ additionalDiscountsMarkers?: string[];
502
+ [key: string]: any;
503
+ }
504
+ /**
505
+ * Interface representing a single item in an order preview.
506
+ * @interface IOrderPreviewItem
507
+ */
508
+ interface IOrderPreviewItem {
509
+ [key: string]: any;
510
+ }
511
+ /**
512
+ * Interface representing the response from an order preview calculation.
513
+ * @interface IOrderPreviewResponse
514
+ * @property {number} totalSum - Total order amount before discounts. Example: 300.
515
+ * @property {number} totalSumWithDiscount - Total order amount after discounts. Example: 250.
516
+ * @property {unknown} discountConfig - Discount configuration applied to the order.
517
+ * @property {string} currency - Currency of the order. Example: "USD".
518
+ * @property {IOrderPreviewItem[]} orderPreview - Array of order preview items.
519
+ */
520
+ interface IOrderPreviewResponse {
521
+ totalSum: number;
522
+ totalSumWithDiscount: number;
523
+ discountConfig: unknown;
524
+ currency: string;
525
+ orderPreview: IOrderPreviewItem[];
526
+ }
527
+ export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, ICreateOrderPreview, IOrderByMarkerEntity, IOrderData, IOrderPreviewItem, IOrderPreviewResponse, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IOrderStatus, IPaymentAccountIdentifiers, IPicture, IPreviewOrderProduct, };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Validation schemas for Orders module
3
+ * @description Zod schemas for validating orders-related API responses
4
+ */
5
+ import { z } from 'zod';
6
+ /**
7
+ * Order item schema
8
+ * @description Order item schema for validating orders-related API responses
9
+ */
10
+ export declare const OrderItemSchema: z.ZodObject<{
11
+ id: z.ZodNumber;
12
+ productId: z.ZodNumber;
13
+ quantity: z.ZodNumber;
14
+ price: z.ZodNumber;
15
+ total: z.ZodNumber;
16
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
17
+ }, z.core.$strip>;
18
+ /**
19
+ * Order entity schema
20
+ * @description Order entity schema for validating orders-related API responses
21
+ */
22
+ export declare const OrderEntitySchema: z.ZodObject<{
23
+ id: z.ZodNumber;
24
+ storageId: z.ZodOptional<z.ZodNumber>;
25
+ createdDate: z.ZodOptional<z.ZodString>;
26
+ statusIdentifier: z.ZodOptional<z.ZodString>;
27
+ formIdentifier: z.ZodOptional<z.ZodString>;
28
+ formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
29
+ attributeSetIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
30
+ totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
31
+ currency: z.ZodOptional<z.ZodString>;
32
+ paymentAccountIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
33
+ paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
34
+ paymentUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
+ products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
36
+ isCompleted: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
37
+ statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
38
+ }, z.core.$strip>;
39
+ /**
40
+ * Orders list response schema
41
+ * @returns Orders list response schema
42
+ */
43
+ export declare const OrdersResponseSchema: z.ZodObject<{
44
+ items: z.ZodArray<z.ZodObject<{
45
+ id: z.ZodNumber;
46
+ storageId: z.ZodOptional<z.ZodNumber>;
47
+ createdDate: z.ZodOptional<z.ZodString>;
48
+ statusIdentifier: z.ZodOptional<z.ZodString>;
49
+ formIdentifier: z.ZodOptional<z.ZodString>;
50
+ formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
51
+ attributeSetIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
52
+ totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
53
+ currency: z.ZodOptional<z.ZodString>;
54
+ paymentAccountIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
55
+ paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
56
+ paymentUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
57
+ products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
58
+ isCompleted: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
59
+ statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
60
+ }, z.core.$strip>>;
61
+ total: z.ZodNumber;
62
+ }, z.core.$strip>;
63
+ /**
64
+ * Order storage schema
65
+ * @returns Order storage validation schema
66
+ */
67
+ export declare const OrderStorageSchema: z.ZodObject<{
68
+ id: z.ZodNumber;
69
+ identifier: z.ZodNullable<z.ZodString>;
70
+ localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
71
+ formIdentifier: z.ZodNullable<z.ZodString>;
72
+ generalTypeId: z.ZodNullable<z.ZodNumber>;
73
+ paymentAccountIdentifiers: z.ZodArray<z.ZodObject<{
74
+ identifier: z.ZodString;
75
+ }, z.core.$strip>>;
76
+ position: z.ZodNullable<z.ZodNumber>;
77
+ }, z.core.$strip>;
78
+ /**
79
+ * Orders storage list response schema
80
+ * @returns Orders storage list response schema
81
+ */
82
+ export declare const OrdersStorageResponseSchema: z.ZodArray<z.ZodObject<{
83
+ id: z.ZodNumber;
84
+ identifier: z.ZodNullable<z.ZodString>;
85
+ localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
86
+ formIdentifier: z.ZodNullable<z.ZodString>;
87
+ generalTypeId: z.ZodNullable<z.ZodNumber>;
88
+ paymentAccountIdentifiers: z.ZodArray<z.ZodObject<{
89
+ identifier: z.ZodString;
90
+ }, z.core.$strip>>;
91
+ position: z.ZodNullable<z.ZodNumber>;
92
+ }, z.core.$strip>>;
93
+ /**
94
+ * Create order response schema
95
+ * API returns a simplified order object after creation
96
+ * @returns Create order response schema
97
+ */
98
+ export declare const CreateOrderResponseSchema: z.ZodObject<{
99
+ id: z.ZodNumber;
100
+ formIdentifier: z.ZodOptional<z.ZodString>;
101
+ paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
102
+ formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
103
+ products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
104
+ currency: z.ZodOptional<z.ZodString>;
105
+ totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
106
+ createdDate: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>;
108
+ /**
109
+ * Update order response schema
110
+ * API returns the full order object after update
111
+ */
112
+ export declare const UpdateOrderResponseSchema: z.ZodObject<{
113
+ id: z.ZodNumber;
114
+ formIdentifier: z.ZodOptional<z.ZodString>;
115
+ paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
116
+ formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
117
+ products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
118
+ currency: z.ZodOptional<z.ZodString>;
119
+ totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
120
+ }, z.core.$strip>;