oneentry 1.0.124 → 1.0.125

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 (76) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +17 -4
  3. package/dist/admins/adminsApi.js +16 -3
  4. package/dist/admins/adminsInterfaces.d.ts +47 -26
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
  6. package/dist/attribute-sets/attributeSetsApi.js +9 -17
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
  8. package/dist/auth-provider/authProviderApi.d.ts +146 -36
  9. package/dist/auth-provider/authProviderApi.js +163 -37
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
  11. package/dist/base/asyncModules.d.ts +7 -1
  12. package/dist/base/asyncModules.js +127 -21
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +4 -0
  15. package/dist/base/syncModules.js +19 -1
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +7 -17
  18. package/dist/blocks/blocksApi.js +7 -17
  19. package/dist/blocks/blocksInterfaces.d.ts +77 -32
  20. package/dist/events/eventsApi.d.ts +7 -8
  21. package/dist/events/eventsApi.js +12 -7
  22. package/dist/events/eventsInterfaces.d.ts +16 -11
  23. package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
  24. package/dist/file-uploading/fileUploadingApi.js +20 -12
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
  26. package/dist/forms/formsApi.d.ts +3 -7
  27. package/dist/forms/formsApi.js +2 -6
  28. package/dist/forms/formsInterfaces.d.ts +44 -28
  29. package/dist/formsData/formsDataApi.d.ts +21 -9
  30. package/dist/formsData/formsDataApi.js +21 -9
  31. package/dist/formsData/formsDataInterfaces.d.ts +128 -45
  32. package/dist/general-types/generalTypesApi.d.ts +1 -3
  33. package/dist/general-types/generalTypesApi.js +0 -2
  34. package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
  38. package/dist/integration-collections/integrationCollectionsApi.js +64 -45
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
  40. package/dist/locales/localesApi.d.ts +1 -2
  41. package/dist/locales/localesApi.js +1 -2
  42. package/dist/locales/localesInterfaces.d.ts +2 -4
  43. package/dist/menus/menusApi.d.ts +1 -3
  44. package/dist/menus/menusApi.js +1 -3
  45. package/dist/menus/menusInterfaces.d.ts +39 -13
  46. package/dist/orders/ordersApi.d.ts +36 -18
  47. package/dist/orders/ordersApi.js +40 -22
  48. package/dist/orders/ordersInterfaces.d.ts +163 -81
  49. package/dist/pages/pagesApi.d.ts +48 -48
  50. package/dist/pages/pagesApi.js +40 -45
  51. package/dist/pages/pagesInterfaces.d.ts +147 -98
  52. package/dist/payments/paymentsApi.d.ts +25 -45
  53. package/dist/payments/paymentsApi.js +27 -46
  54. package/dist/payments/paymentsInterfaces.d.ts +42 -60
  55. package/dist/product-statuses/productStatusesApi.d.ts +6 -12
  56. package/dist/product-statuses/productStatusesApi.js +5 -11
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
  58. package/dist/products/productsApi.d.ts +256 -104
  59. package/dist/products/productsApi.js +263 -97
  60. package/dist/products/productsInterfaces.d.ts +343 -160
  61. package/dist/system/systemApi.d.ts +21 -10
  62. package/dist/system/systemApi.js +22 -8
  63. package/dist/system/systemInterfaces.d.ts +0 -1
  64. package/dist/templates/templatesApi.d.ts +6 -12
  65. package/dist/templates/templatesApi.js +4 -10
  66. package/dist/templates/templatesInterfaces.d.ts +20 -20
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
  68. package/dist/templates-preview/templatesPreviewApi.js +1 -5
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
  70. package/dist/users/usersApi.d.ts +33 -13
  71. package/dist/users/usersApi.js +38 -15
  72. package/dist/users/usersInterfaces.d.ts +78 -27
  73. package/dist/web-socket/wsApi.d.ts +1 -5
  74. package/dist/web-socket/wsApi.js +1 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +0 -1
  76. package/package.json +18 -16
@@ -1,4 +1,4 @@
1
- import type { IError } from '../base/utils';
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
3
  * @interface IOrdersApi
4
4
  *
@@ -9,7 +9,6 @@ import type { IError } from '../base/utils';
9
9
  * @property {function} getAllOrders - Getting all the order storage objects.
10
10
  * @property {function} getAllOrdersByMarker - Getting one order storage object by marker.
11
11
  * @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
12
- *
13
12
  * @description Represents the API for managing orders in the order storage.
14
13
  */
15
14
  interface IOrdersApi {
@@ -19,11 +18,10 @@ interface IOrdersApi {
19
18
  * @param {number} [langCode] - Language code. Default: "en_US".
20
19
  * @param {number} [offset] - Optional parameter for pagination. Default: 0.
21
20
  * @param {number} [limit] - Optional parameter for pagination. Default: 30.
22
- *
23
21
  * @return {IOrdersEntity[]} Returns an array of order storage objects.
24
22
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
25
23
  */
26
- getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<Array<IOrdersEntity> | IError>;
24
+ getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<IOrdersEntity[] | IError>;
27
25
  /**
28
26
  * Getting all orders from the orders storage object created by the user.
29
27
  *
@@ -31,7 +29,6 @@ interface IOrdersApi {
31
29
  * @param {string} [langCode] - Language code. Default: "en_US".
32
30
  * @param {number} [offset] - Offset parameter. Default: 0.
33
31
  * @param {number} [limit] - Limit parameter. Default: 30.
34
- *
35
32
  * @return {IOrdersByMarkerEntity} Returns an object with the orders.
36
33
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
37
34
  */
@@ -41,7 +38,6 @@ interface IOrdersApi {
41
38
  *
42
39
  * @param {string} marker - Marker of the order object. Example: "order_storage_1".
43
40
  * @param {string} [langCode] - Language code. Default: "en_US".
44
- *
45
41
  * @return {IOrdersEntity} Return object of order information.
46
42
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
47
43
  */
@@ -52,7 +48,6 @@ interface IOrdersApi {
52
48
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
53
49
  * @param {number} id - ID of the order object. Example: 12345.
54
50
  * @param {string} [langCode] - Language code. Default: "en_US".
55
- *
56
51
  * @return {IOrderByMarkerEntity} Returns an object with the order.
57
52
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
53
  */
@@ -61,41 +56,101 @@ interface IOrdersApi {
61
56
  * Creation of an order in the order storage.
62
57
  *
63
58
  * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
64
- * @param {IOrderData} data - Object for creating an order. Example: { "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ] }.
59
+ * @param {IOrderData} body - Object for creating an order. Example:
60
+ {
61
+ "formIdentifier": "bar-orders-form",
62
+ "paymentAccountIdentifier": "usd-payment",
63
+ "formData": {
64
+ "marker": "name_1",
65
+ "value": "Name",
66
+ "type": "string"
67
+ },
68
+ "products": [
69
+ {
70
+ "productId": 1,
71
+ "quantity": 2
72
+ }
73
+ ]
74
+ }
65
75
  * @param {String} [langCode] - Language code. Default: "en_US".
66
- *
67
76
  * @return {IBaseOrdersEntity} Returns an object with the created order.
68
77
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
69
- *
70
78
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
71
79
  */
72
- createOrder(marker: string, data: IOrderData, langCode: string): Promise<IBaseOrdersEntity | IError>;
80
+ createOrder(marker: string, body: IOrderData, langCode: string): Promise<IBaseOrdersEntity | IError>;
73
81
  /**
74
82
  * Changing an order in the orders storage
75
83
  *
76
84
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
77
85
  * @param {number} id - ID of the order object. Example: 12345.
78
- * @param {IOrderData} data - Object for updating an order. Example: { "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ], "currency": "USD" }.
86
+ * @param {IOrderData} body - Object for updating an order. Example:
87
+ {
88
+ "formIdentifier": "bar-orders-form",
89
+ "paymentAccountIdentifier": "usd-payment",
90
+ "formData": {
91
+ "marker": "name_1",
92
+ "value": "Name",
93
+ "type": "string"
94
+ },
95
+ "products": [
96
+ {
97
+ "productId": 1,
98
+ "quantity": 2
99
+ }
100
+ ],
101
+ "currency": "USD"
102
+ }
79
103
  * @param {string} [langCode] - Language code. Default: "en_US".
80
- *
81
104
  * @return {IBaseOrdersEntity} Returns an object with the updated order.
82
105
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
83
- *
84
106
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
85
107
  */
86
- updateOrderByMarkerAndId(marker: string, id: number, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
108
+ updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
87
109
  }
88
110
  /**
89
111
  * @interface IOrdersByMarkerEntity
90
112
  *
113
+ * @property {IOrderByMarkerEntity[]} items - Array of order storage objects. Example:
114
+ [
115
+ {
116
+ "id": 55,
117
+ "storageId": 1,
118
+ "createdDate": "2025-03-22T21:12:42.371Z",
119
+ "statusIdentifier": "inProgress",
120
+ "formIdentifier": "orderForm",
121
+ "formData": [
122
+ {
123
+ "marker": "order_name",
124
+ "value": "Ivan",
125
+ "type": "string"
126
+ }
127
+ ],
128
+ "attributeSetIdentifier": "order_form",
129
+ "totalSum": "300.00",
130
+ "currency": "",
131
+ "paymentAccountIdentifier": "cash",
132
+ "paymentAccountLocalizeInfos": {
133
+ "title": "Cash"
134
+ },
135
+ "products": [
136
+ {
137
+ "id": 2957,
138
+ "title": "Cosmo",
139
+ "sku": null,
140
+ "previewImage": null,
141
+ "price": 150,
142
+ "quantity": 2
143
+ }
144
+ ],
145
+ "isCompleted": false
146
+ }
147
+ ]
91
148
  * @property {number} total - Total number of found records. Example: 100.
92
- * @property {Array<IOrderByMarkerEntity>} items - Array of order storage objects. Example: .
93
- *
94
149
  * @description Represents a response from the order storage by marker.
95
150
  */
96
151
  interface IOrdersByMarkerEntity {
97
152
  total: number;
98
- items: Array<IOrderByMarkerEntity>;
153
+ items: IOrderByMarkerEntity[];
99
154
  }
100
155
  /**
101
156
  * Interface representing a picture entity.
@@ -106,7 +161,6 @@ interface IOrdersByMarkerEntity {
106
161
  * @property {string} downloadLink - The URL link to download the picture. Example: "https://example.com/image.jpg".
107
162
  * @property {number} size - The size of the picture in bytes. Example: 102400.
108
163
  * @property {string} previewLink - The URL link to preview the picture. Example: "https://example.com/image-preview.jpg".
109
- *
110
164
  * @description This interface defines the structure for a picture entity, including its filename, download link, size, and preview link.
111
165
  */
112
166
  interface IPicture {
@@ -118,43 +172,32 @@ interface IPicture {
118
172
  /**
119
173
  * @interface IOrderProducts
120
174
  *
121
- * @property {number} id - Object identifier. Example: 1.
122
- * @property {string} title - Product title. Example: "Product 1".
123
- * @property {string | null} sku - Product SKU. Example: "SKU-123".
124
- * @property {number} price - Product price. Example: 99.99.
125
- * @property {number | null} quantity - Product quantity. Example: 2.
126
- * @property {Array<IPicture>} previewImage - Array of product images.
127
- *
175
+ * @property {number} productId - Product title. Example: 2957.
176
+ * @property {number} quantity - Product quantity. Example: 1.
128
177
  * @description Represents a product in an order.
129
178
  */
130
179
  interface IOrderProducts {
131
- id: number;
132
- title: string;
133
- sku: string | null;
134
- price: number;
135
- quantity: number | null;
136
- previewImage: Array<IPicture> | null;
180
+ productId: number;
181
+ quantity: number;
137
182
  }
138
183
  /**
139
184
  * @interface IOrdersFormData
140
185
  *
141
186
  * @property {string} marker - Marker of form field. Example: "name_1".
142
- * @property {string} value - Value. Example: "Name".
143
187
  * @property {string} type - Type of value. Example: "string".
144
- *
188
+ * @property {string} value - Value. Example: "Name".
145
189
  * @description Represents a form data for orders.
146
190
  */
147
191
  interface IOrdersFormData {
148
192
  marker: string;
149
- value: any;
150
193
  type: string;
194
+ value: any;
151
195
  }
152
196
  /**
153
197
  * @interface IOrderProductData
154
198
  *
155
199
  * @property {number} productId - Product identifier. Example: 1.
156
200
  * @property {number} quantity - Quantity of the product. Example: 2.
157
- *
158
201
  * @description Represents a product data in an order.
159
202
  */
160
203
  interface IOrderProductData {
@@ -165,65 +208,92 @@ interface IOrderProductData {
165
208
  * @interface IBaseOrdersEntity
166
209
  *
167
210
  * @property {number} id - Object identifier. Example: 1.
168
- * @property {string} formIdentifier - Text identifier of the form status. Example: "bar-orders-form".
211
+ * @property {string} formIdentifier - Text identifier of the form. Example: "bar-orders-form".
169
212
  * @property {string} paymentAccountIdentifier - Text identifier of the order payment. Example: "payment-1".
170
- * @property {Array<IOrdersFormData>} formData - Data submitted by the form linked to the order store. Example: [{ marker: "name_1", value: "Name", type: "string" }].
171
- * @property {Array<IOrderProducts>} products - Array of products added to order. Example: .
172
- * @property {string} [createdDate] - Order creation date. Example: "2023-10-01T12:00:00Z".
173
- * @property {string} totalSum - Total order amount. Example: "99.99".
213
+ * @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store. Example:
214
+ [
215
+ {
216
+ "marker": "name_1",
217
+ "value": "Name",
218
+ "type": "string"
219
+ }
220
+ ]
221
+ * @property {IOrderProducts[]} products - Array of products added to order. Example:
222
+ [
223
+ {
224
+ "id": 2957,
225
+ "title": "Cosmo",
226
+ "sku": null,
227
+ "previewImage": null,
228
+ "price": 150,
229
+ "quantity": 2
230
+ }
231
+ ]
174
232
  * @property {string} currency - Currency used to pay for the order. Example: "USD".
233
+ * @property {number} totalSum - Total order amount. Example: "99.99".
234
+ * @property {string} [createdDate] - Order creation date. Example: "2023-10-01T12:00:00Z".
175
235
  * @property {string} [statusIdentifier] - Text identifier of order status object (if not set, default status will be assigned). Example: "status-1".
176
236
  */
177
237
  interface IBaseOrdersEntity {
178
238
  id: number;
179
239
  formIdentifier: string;
180
240
  paymentAccountIdentifier: string;
181
- formData: Array<IOrdersFormData>;
182
- products: Array<IOrderProductData>;
183
- createdDate?: string;
184
- totalSum: number;
241
+ formData: IOrdersFormData[];
242
+ products: IOrderProductData[];
185
243
  currency: string;
244
+ totalSum: number;
245
+ createdDate?: string;
186
246
  statusIdentifier?: string;
187
247
  }
188
248
  /**
189
249
  * @interface IBaseOrdersEntityResponse
190
250
  *
191
- * @property {Array<IBaseOrdersEntity>} items - Array of order storage objects. Example: .
251
+ * @property {IBaseOrdersEntity[]} items - Array of order storage objects. Example:
252
+ [
253
+ {
254
+ "id": 2957,
255
+ "title": "Cosmo",
256
+ "sku": null,
257
+ "previewImage": null,
258
+ "price": 150,
259
+ "quantity": 2
260
+ }
261
+ ]
192
262
  * @property {string | number} total - Total number of found records. Example: 100.
193
- *
194
263
  * @description Represents a response from the order storage.
195
264
  */
196
265
  interface IBaseOrdersEntityResponse {
197
- items: Array<IBaseOrdersEntity>;
266
+ items: IBaseOrdersEntity[];
198
267
  total: string | number;
199
268
  }
200
269
  /**
201
270
  * @interface IOrdersEntity
202
271
  *
203
272
  * @property {number} id - Object identifier. Example: 1.
204
- * @property {Record<string, any>} localizeInfos - Name considering localization. Example: .
273
+ * @property {ILocalizeInfo} localizeInfos - Name considering localization. Example:
274
+ {
275
+ "title": "Cash"
276
+ }
277
+ * @property {number | null} position - Position in orders storage. Example: 1.
205
278
  * @property {string} identifier - Textual identifier for the record field. Example: "order_storage_1".
206
- * @property {number | null} generalTypeId - Type identifier. Example: 1
207
279
  * @property {string} formIdentifier - Textual identifier for the form used by the order storage. Example: "bar-orders-form".
208
- * @property {Array<{identifier:string}>} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage. Example: [{ identifier: "payment-1" }].
209
- * @property {number | null} position - Example: 1.
210
- *
280
+ * @property {number | null} generalTypeId - Type identifier. Example: 1.
281
+ * @property {IPaymentAccountIdentifiers[]} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage. Example: [{ "identifier": "payment-1" }].
211
282
  * @description Represents an order storage object.
212
283
  */
213
284
  interface IOrdersEntity {
214
285
  id: number;
215
- localizeInfos: Record<string, any>;
286
+ localizeInfos: ILocalizeInfo;
287
+ position: number | null;
216
288
  identifier: string | null;
217
- generalTypeId: number | null;
218
289
  formIdentifier: string | null;
219
- paymentAccountIdentifiers: Array<IPaymentAccountIdentifiers>;
220
- position: number | null;
290
+ generalTypeId: number | null;
291
+ paymentAccountIdentifiers: IPaymentAccountIdentifiers[];
221
292
  }
222
293
  /**
223
294
  * @interface IPaymentAccountIdentifiers
224
295
  *
225
296
  * @property {string} identifier - Textual identifier of the payment account. Example: "payment-1".
226
- *
227
297
  * @description Represents an identifier for a payment account used in an order.
228
298
  */
229
299
  interface IPaymentAccountIdentifiers {
@@ -234,49 +304,61 @@ interface IPaymentAccountIdentifiers {
234
304
  *
235
305
  * @property {string} formIdentifier - Text identifier of the form object linked to the order repository. Example: "bar-orders-form".
236
306
  * @property {string} paymentAccountIdentifier - Text identifier of the payment object linked to the order repository. Example: "payment-1".
237
- * @property {IOrdersFormData | Array<IOrdersFormData>} formData - Form data linked to the order repository. Example: [{ marker: "name_1", value: "Name", type: "string" }].
238
- * @property {Array<IOrderProductData>} products - An array of ordered products. Example: .
239
- *
307
+ * @property {IOrdersFormData | IOrdersFormData[]} formData - Form data linked to the order repository. Example:
308
+ [
309
+ {
310
+ "marker": "name_1",
311
+ "value": "Name",
312
+ "type": "string"
313
+ }
314
+ ]
315
+ * @property {IOrderProductData[]} products - An array of ordered products. Example: .
240
316
  * @description Represents the data required to create or update an order in the order storage.
241
317
  */
242
318
  interface IOrderData {
243
319
  formIdentifier: string;
244
320
  paymentAccountIdentifier: string;
245
- formData: IOrdersFormData | Array<IOrdersFormData>;
246
- products: Array<IOrderProductData>;
321
+ formData: IOrdersFormData | IOrdersFormData[];
322
+ products: IOrderProductData[];
247
323
  }
248
324
  /**
249
325
  * @interface IOrderByMarkerEntity
250
326
  *
251
- * @property {string} [attributeSetIdentifier] - Text identifier of the attribute set. Example: "attribute-set-1".
252
- * @property {string} statusIdentifier - Text identifier of the order status. Example: "order-status-1".
253
- * @property {string} formIdentifier - Text identifier of the form status. Example: "bar-orders-form".
254
- * @property {Array<IOrdersFormData>} formData - Data submitted by the form linked to the order store. Example: .
255
- * @property {Array<IOrderProducts>} products - Array of products added to order. Example: [{ id: 1, name: "Product 1", quantity: 2 }].
327
+ * @property {number} id - Object identifier. Example: 125.
328
+ * @property {number} storageId - Identifier of the order storage object. Example: 1.
329
+ * @property {string} createdDate - Date when the order was created. Example: "2023-10-01T12:00:00Z".
330
+ * @property {string} [statusIdentifier] - Text identifier of the order status. Example: "order-status-1".
331
+ * @property {string} [formIdentifier] - Text identifier of the form. Example: "bar-orders-form".
332
+ * @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store. Example:
333
+ [
334
+ {
335
+ "marker": "order_name",
336
+ "value": "Ivan",
337
+ "type": "string"
338
+ }
339
+ ]
340
+ * @property {string | null} [attributeSetIdentifier] - Text identifier of the attribute set. Example: "attribute-set-1".
256
341
  * @property {string} totalSum - Total order amount. Example: "100.00".
257
342
  * @property {string} currency - Currency used to pay for the order. Example: "USD".
258
- * @property {string} createdDate - Date when the order was created. Example: "2023-10-01T12:00:00Z".
259
- * @property {string} paymentAccountIdentifier - Textual identifier for the order payment. Example: "payment-1".
343
+ * @property {string | null} [paymentAccountIdentifier] - Textual identifier for the order payment. Example: "payment-1".
260
344
  * @property {Record<string, any>} paymentAccountLocalizeInfos - Payment account name considering localization. Example: { "en_US": "USD Payment", "ru_RU": "Оплата в долларах США" }.
261
- * @property {number} id - Object identifier.
262
- * @property {number} storageId - Identifier of the order storage object. Example: 1.
345
+ * @property {IOrderProducts[]} products - Array of products added to order. Example: [{ "id": 1, "name": "Product 1", "quantity": 2 }].
263
346
  * @property {boolean} isCompleted - Indicates that the order has been completed. Example: true.
264
- *
265
347
  * @description Represents an order storage object created by the user.
266
348
  */
267
349
  interface IOrderByMarkerEntity {
350
+ id: number;
351
+ storageId: number;
352
+ createdDate: string;
353
+ statusIdentifier?: string;
354
+ formIdentifier?: string;
355
+ formData: IOrdersFormData[];
268
356
  attributeSetIdentifier?: string;
269
- statusIdentifier: string;
270
- formIdentifier: string;
271
- formData: Array<IOrdersFormData>;
272
- products: Array<IOrderProducts>;
273
357
  totalSum: string;
274
358
  currency: string;
275
- createdDate: string;
276
- paymentAccountIdentifier: string;
359
+ paymentAccountIdentifier?: string;
277
360
  paymentAccountLocalizeInfos?: Record<string, any>;
278
- id: number;
279
- storageId: number;
361
+ products: IOrderProducts[];
280
362
  isCompleted: boolean;
281
363
  }
282
364
  export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, IOrderByMarkerEntity, IOrderData, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IPaymentAccountIdentifiers, IPicture, };
@@ -1,7 +1,7 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
- import type { IPageApi, IPageConfig, IPagesEntity, IPositionBlock, IPositionForm } from './pagesInterfaces';
4
+ import type { IPageApi, IPageConfig, IPagesEntity, IPositionBlock } from './pagesInterfaces';
5
5
  /**
6
6
  * Controllers for working with page objects, including catalog pages
7
7
  * @handle /api/content/pages
@@ -16,26 +16,22 @@ export default class PageApi extends AsyncModules implements IPageApi {
16
16
  * @handleName getRootPages
17
17
  *
18
18
  * @param {string} [langCode] - Language code. Default: "en_US".
19
- *
20
19
  * @return {IPagesEntity[]} Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
21
20
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
22
- *
23
- * @description
21
+ * @description Get all top-level page objects.
24
22
  */
25
- getRootPages(langCode?: string): Promise<Array<IPagesEntity> | IError>;
23
+ getRootPages(langCode?: string): Promise<IPagesEntity[] | IError>;
26
24
  /**
27
25
  * Get all page objects with product information as an array.
28
26
  *
29
27
  * @handleName getPages
30
28
  *
31
29
  * @param {string} [langCode] - Language code. Default: "en_US".
32
- *
33
30
  * @return {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data).
34
31
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
35
- *
36
32
  * @description Get all page objects with product information as an array.
37
33
  */
38
- getPages(langCode?: string): Promise<Array<IPagesEntity> | IError>;
34
+ getPages(langCode?: string): Promise<IPagesEntity[] | IError>;
39
35
  /**
40
36
  * Get page object with information about forms, blocks, menus, linked to the page.
41
37
  *
@@ -43,10 +39,8 @@ export default class PageApi extends AsyncModules implements IPageApi {
43
39
  *
44
40
  * @param {number} id - The unique identifier of the page to be fetched. Example: 1.
45
41
  * @param {string} [langCode] - Language code. Default: "en_US".
46
- *
47
42
  * @return {IPagesEntity} Returns PageEntity object
48
43
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
49
- *
50
44
  * @description Get page object with information about forms, blocks, menus, linked to the page.
51
45
  */
52
46
  getPageById(id: number, langCode?: string): Promise<IPagesEntity | IError>;
@@ -57,10 +51,8 @@ export default class PageApi extends AsyncModules implements IPageApi {
57
51
  *
58
52
  * @param {string} url - Page URL. Example: "about".
59
53
  * @param {string} [langCode] - Language code. Default: "en_US".
60
- *
61
54
  * @return {IPagesEntity} Returns PageEntity object
62
55
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
63
- *
64
56
  * @description Get page object with information about forms, blocks, menus, linked to the page by URL.
65
57
  */
66
58
  getPageByUrl(url: string, langCode?: string): Promise<IPagesEntity | IError>;
@@ -71,13 +63,11 @@ export default class PageApi extends AsyncModules implements IPageApi {
71
63
  *
72
64
  * @param {string} url - The URL of the parent page for which child pages are to be fetched. Example: "about/our-team".
73
65
  * @param {string} [langCode] - Language code. Default: "en_US".
74
- *
75
66
  * @return {IPagesEntity} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
76
67
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
77
- *
78
68
  * @description Get child pages object with information as an array.
79
69
  */
80
- getChildPagesByParentUrl(url: string, langCode?: string): Promise<Array<IPagesEntity> | IError>;
70
+ getChildPagesByParentUrl(url: string, langCode?: string): Promise<IPagesEntity[] | IError>;
81
71
  /**
82
72
  * Get all blocks by page url.
83
73
  *
@@ -85,37 +75,19 @@ export default class PageApi extends AsyncModules implements IPageApi {
85
75
  *
86
76
  * @param {string} url - Page URL. Example: "about".
87
77
  * @param {string} [langCode] - Language code. Default: "en_US".
88
- *
89
78
  * @return {IPositionBlock[]} Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
90
79
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
91
- *
92
80
  * @description Get all blocks by page url.
93
81
  */
94
- getBlocksByPageUrl(url: string, langCode?: string): Promise<Array<IPositionBlock> | IError>;
95
- /**
96
- * Get all forms by page url.
97
- *
98
- * @handleName getFormsByPageUrl
99
- *
100
- * @param {string} url - The URL of the page for which forms are to be fetched. Example: "about".
101
- * @param {string} [langCode] - Language code. Default: "en_US".
102
- *
103
- * @return {IPositionForm[]} Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
104
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
105
- *
106
- * @description Get all forms by page url.
107
- */
108
- getFormsByPageUrl(url: string, langCode?: string): Promise<Array<IPositionForm> | IError>;
82
+ getBlocksByPageUrl(url: string, langCode?: string): Promise<IPositionBlock[] | IError>;
109
83
  /**
110
84
  * Get settings for the page.
111
85
  *
112
86
  * @handleName getConfigPageByUrl
113
87
  *
114
88
  * @param {string} url - Page URL. Example: "about".
115
- *
116
89
  * @return {IPageConfig} Returns a ConfigPage object with page display settings
117
90
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
118
- *
119
91
  * @description Get settings for the page.
120
92
  */
121
93
  getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
@@ -126,37 +98,65 @@ export default class PageApi extends AsyncModules implements IPageApi {
126
98
  *
127
99
  * @param {string} name - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account). Example: "About Us".
128
100
  * @param {string} [langCode] - Language code. Default: "en_US".
129
- *
130
101
  * @return {IPagesEntity[]} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
131
102
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
132
- *
133
103
  * @description Quick search for page objects with limited output.
134
104
  */
135
- searchPage(name: string, langCode?: string): Promise<Array<IPagesEntity> | IError>;
105
+ searchPage(name: string, langCode?: string): Promise<IPagesEntity[] | IError>;
136
106
  /**
137
107
  * Add template data to pages
138
108
  *
139
109
  * @handleName addTemplateToPages
140
110
  *
141
- * @param data - An array of page objects (IPagesEntity[]) to which template data will be added. Example: .
142
- *
143
- * @return - An array of page objects with template data added
111
+ * @param {IPagesEntity[]} data - An array of page objects (IPagesEntity[]) to which template data will be added. Example:
112
+ [
113
+ {
114
+ id: 8,
115
+ parentId: null,
116
+ moduleFormConfigs: [],
117
+ pageUrl: 'blog',
118
+ depth: 0,
119
+ localizeInfos: {
120
+ title: 'Blog',
121
+ menuTitle: 'Blog',
122
+ htmlContent: '',
123
+ plainContent: '',
124
+ },
125
+ isVisible: true,
126
+ forms: [],
127
+ blocks: [],
128
+ type: 'common_page',
129
+ templateIdentifier: 'template',
130
+ attributeSetIdentifier: 'page',
131
+ attributeValues: {},
132
+ isSync: true,
133
+ template: {
134
+ id: 4,
135
+ attributeSetIdentifier: null,
136
+ title: 'Template',
137
+ generalTypeId: 4,
138
+ identifier: 'template',
139
+ version: 0,
140
+ generalTypeName: 'catalog_page',
141
+ attributeValues: {},
142
+ position: 1,
143
+ },
144
+ }
145
+ ]
146
+ * @return {any} An array of page objects with template data added
144
147
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
145
- *
146
148
  * @description Add template data to pages
147
149
  */
148
- protected addTemplateToPages(data: IPagesEntity[]): Promise<IPagesEntity[]>;
150
+ protected addTemplateToPages(data: IPagesEntity[]): Promise<any | IError>;
149
151
  /**
150
152
  * Add template data to page by page templateIdentifier
151
153
  *
152
154
  * @handleName addTemplateToPage
153
155
  *
154
- * @param data - An array of page objects (IPagesEntity[]) to which template data will be added. Example: .
155
- *
156
- * @return - An array of page objects with template data added
156
+ * @param {IPagesEntity} data - Page object (IPagesEntity) to which template data will be added.
157
+ * @return {any} An array of page objects with template data added
157
158
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
158
- *
159
- * @description
159
+ * @description Add template data to page by page templateIdentifier
160
160
  */
161
- protected addTemplateToPage(data: IPagesEntity): Promise<IPagesEntity>;
161
+ protected addTemplateToPage(data: IPagesEntity): Promise<any | IError>;
162
162
  }