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