oneentry 1.0.142 → 1.0.143

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