oneentry 1.0.123 → 1.0.124
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/dist/admins/adminsApi.d.ts +16 -8
- package/dist/admins/adminsApi.js +17 -9
- package/dist/admins/adminsInterfaces.d.ts +49 -25
- package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
- package/dist/attribute-sets/attributeSetsApi.js +49 -25
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
- package/dist/auth-provider/authProviderApi.d.ts +94 -83
- package/dist/auth-provider/authProviderApi.js +96 -83
- package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
- package/dist/base/asyncModules.d.ts +32 -28
- package/dist/base/asyncModules.js +61 -36
- package/dist/base/syncModules.d.ts +44 -44
- package/dist/base/syncModules.js +65 -63
- package/dist/blocks/blocksApi.d.ts +56 -25
- package/dist/blocks/blocksApi.js +56 -25
- package/dist/blocks/blocksInterfaces.d.ts +71 -22
- package/dist/events/eventsApi.d.ts +45 -11
- package/dist/events/eventsApi.js +47 -17
- package/dist/events/eventsInterfaces.d.ts +44 -2
- package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
- package/dist/file-uploading/fileUploadingApi.js +46 -27
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
- package/dist/forms/formsApi.d.ts +23 -8
- package/dist/forms/formsApi.js +23 -8
- package/dist/forms/formsInterfaces.d.ts +62 -15
- package/dist/formsData/formsDataApi.d.ts +33 -33
- package/dist/formsData/formsDataApi.js +33 -33
- package/dist/formsData/formsDataInterfaces.d.ts +123 -35
- package/dist/general-types/generalTypesApi.d.ts +12 -1
- package/dist/general-types/generalTypesApi.js +12 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
- package/dist/integration-collections/integrationCollectionsApi.js +114 -81
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
- package/dist/locales/localesApi.d.ts +6 -1
- package/dist/locales/localesApi.js +6 -1
- package/dist/locales/localesInterfaces.d.ts +20 -11
- package/dist/menus/menusApi.d.ts +8 -3
- package/dist/menus/menusApi.js +8 -3
- package/dist/menus/menusInterfaces.d.ts +30 -17
- package/dist/orders/ordersApi.d.ts +64 -64
- package/dist/orders/ordersApi.js +67 -65
- package/dist/orders/ordersInterfaces.d.ts +174 -60
- package/dist/pages/pagesApi.d.ts +87 -28
- package/dist/pages/pagesApi.js +87 -28
- package/dist/pages/pagesInterfaces.d.ts +117 -23
- package/dist/payments/paymentsApi.d.ts +56 -22
- package/dist/payments/paymentsApi.js +56 -22
- package/dist/payments/paymentsInterfaces.d.ts +119 -36
- package/dist/product-statuses/productStatusesApi.d.ts +21 -15
- package/dist/product-statuses/productStatusesApi.js +21 -18
- package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
- package/dist/products/productsApi.d.ts +137 -157
- package/dist/products/productsApi.js +137 -157
- package/dist/products/productsInterfaces.d.ts +240 -57
- package/dist/system/systemApi.d.ts +29 -10
- package/dist/system/systemApi.js +29 -10
- package/dist/system/systemInterfaces.d.ts +8 -0
- package/dist/templates/templatesApi.d.ts +26 -16
- package/dist/templates/templatesApi.js +26 -19
- package/dist/templates/templatesInterfaces.d.ts +40 -14
- package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
- package/dist/templates-preview/templatesPreviewApi.js +18 -17
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +54 -26
- package/dist/users/usersApi.d.ts +37 -33
- package/dist/users/usersApi.js +37 -33
- package/dist/users/usersInterfaces.d.ts +80 -9
- package/dist/web-socket/wsApi.d.ts +6 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +3 -1
- package/package.json +11 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AttributeType, IError, LangType, Types } from '../base/utils';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* @interface IProductApi
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getProducts - Search for all product page objects with pagination and filtering.
|
|
6
6
|
* @property {function} getProductsEmptyPage - Search for all product page objects with pagination that do not have a category.
|
|
@@ -11,31 +11,190 @@ import type { AttributeType, IError, LangType, Types } from '../base/utils';
|
|
|
11
11
|
* @property {function} getProductById - Retrieve one product object.
|
|
12
12
|
* @property {function} getProductBlockById - Getting a product block object by product id.
|
|
13
13
|
* @property {function} searchProduct - Quick search for product page objects with limited output.
|
|
14
|
+
*
|
|
15
|
+
* @description This interface defines methods for retrieving and managing products in the system.
|
|
14
16
|
*/
|
|
15
17
|
interface IProductApi {
|
|
18
|
+
/**
|
|
19
|
+
* Search for all products with pagination and filter.
|
|
20
|
+
*
|
|
21
|
+
* @param {Array<IFilterParams>} [body] - Request body. Default []. Example: [ { "attributeMarker": "price", "conditionMarker": "mth", "statusMarker": "waiting", "conditionValue": 1, "pageUrls": [ "23-laminat-floorwood-maxima" ], "isNested": false, "title": "" }, { "attributeMarker": "price", "conditionMarker": "lth", "conditionValue": 3, "pageUrls": [ "23-laminat-floorwood-maxima" ], "isNested": false, "title": "" } ].
|
|
22
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
24
|
+
*
|
|
25
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
26
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
27
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC. Example: 'DESC'.
|
|
28
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status). Example: 'id'.
|
|
29
|
+
* @param {number} [userQuery.statusId] - Optional parameter - search by status id. Example: 123.
|
|
30
|
+
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: 'in_stock'.
|
|
31
|
+
* @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: 'new'.
|
|
32
|
+
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: 'equals'.
|
|
33
|
+
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: 'color'.
|
|
34
|
+
*
|
|
35
|
+
* @return {IProductsResponse} Array with ProductEntity objects
|
|
36
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
37
|
+
*
|
|
38
|
+
* @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.
|
|
39
|
+
*/
|
|
16
40
|
getProducts(body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
41
|
+
/**
|
|
42
|
+
* Search for all product page objects with pagination that do not have a category.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
45
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
46
|
+
*
|
|
47
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
48
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
49
|
+
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: 'in_stock'.
|
|
50
|
+
* @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: 'new'.
|
|
51
|
+
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: 'equals'.
|
|
52
|
+
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: 'color'.
|
|
53
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC. Example: 'DESC'.
|
|
54
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status). Example: 'id'.
|
|
55
|
+
*
|
|
56
|
+
* @return {IProductsResponse} Array with ProductEntity objects.
|
|
57
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
58
|
+
*/
|
|
17
59
|
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
60
|
+
/**
|
|
61
|
+
* Search for all products with pagination for the selected category.
|
|
62
|
+
*
|
|
63
|
+
* @param {number} id - Page id. Example: 12345.
|
|
64
|
+
* @param {Array<IFilterParams>} [body] - Request body. Default: [].
|
|
65
|
+
* @param {string} [langCode] - Language code. Default "en_US".
|
|
66
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
67
|
+
*
|
|
68
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0
|
|
69
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30
|
|
70
|
+
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: 'in_stock'.
|
|
71
|
+
* @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: 'new'.
|
|
72
|
+
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: 'equals'.
|
|
73
|
+
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: 'color'.
|
|
74
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC. Example: 'DESC'.
|
|
75
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status). Example: 'id'.
|
|
76
|
+
*
|
|
77
|
+
* @return {IProductsResponse} Array with ProductEntity objects
|
|
78
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
79
|
+
*/
|
|
18
80
|
getProductsByPageId(id: number, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
81
|
+
/**
|
|
82
|
+
* Search for information about products and prices for the selected category.
|
|
83
|
+
*
|
|
84
|
+
* @param {string} [url] - Page url. Example: '23-laminat-floorwood-maxima'.
|
|
85
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
86
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
87
|
+
*
|
|
88
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
89
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
90
|
+
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: 'in_stock'.
|
|
91
|
+
* @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: 'new'.
|
|
92
|
+
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: 'equals'.
|
|
93
|
+
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: 'color'.
|
|
94
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC. Example: 'DESC'.
|
|
95
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status). Example: 'id'.
|
|
96
|
+
*
|
|
97
|
+
* @return {IProductsInfo} Array with ProductInformation objects.
|
|
98
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
99
|
+
*/
|
|
19
100
|
getProductsPriceByPageUrl(url: string, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsInfo | IError>;
|
|
101
|
+
/**
|
|
102
|
+
* Search for all products with pagination for the selected category.
|
|
103
|
+
*
|
|
104
|
+
* @param {string} url - Page url. Example: '23-laminat-floorwood-maxima'.
|
|
105
|
+
* @param {Array<IFilterParams>} [body] - Request body. Default: [].
|
|
106
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
107
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
108
|
+
*
|
|
109
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
110
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
111
|
+
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: 'in_stock'.
|
|
112
|
+
* @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: 'new'.
|
|
113
|
+
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: 'equals'.
|
|
114
|
+
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: 'color'.
|
|
115
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC. Example: 'DESC'.
|
|
116
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status). Example: 'id'.
|
|
117
|
+
*
|
|
118
|
+
* @return {IProductsResponse} Array with ProductEntity objects.
|
|
119
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
120
|
+
*/
|
|
20
121
|
getProductsByPageUrl(url: string, body?: Array<IFilterParams>, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
122
|
+
/**
|
|
123
|
+
* Find all related product page objects.
|
|
124
|
+
*
|
|
125
|
+
* @param {number} [id] - Product page identifier for which to find relationship. Example: 12345.
|
|
126
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
127
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
128
|
+
*
|
|
129
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
130
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
131
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC. Example: 'DESC'.
|
|
132
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status). Example: 'id'.
|
|
133
|
+
*
|
|
134
|
+
* @return {IProductsResponse} Array with ProductEntity objects
|
|
135
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
136
|
+
*/
|
|
21
137
|
getRelatedProductsById(id: number, langCode?: string, userQuery?: IProductsQuery): Promise<IProductsResponse | IError>;
|
|
22
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Find products by its ids.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} [ids] - Product page identifiers for which to find relationships. Example: '12345,67890'.
|
|
142
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
143
|
+
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
144
|
+
*
|
|
145
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
146
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
147
|
+
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC. Default: 'DESC'.
|
|
148
|
+
* @param {string} [userQuery.sortKey] - Optional field to sort by (id, title, date, price, position, status). Default: 'id'.
|
|
149
|
+
*
|
|
150
|
+
* @return {IProductEntity[]} Array with ProductEntity objects
|
|
151
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
152
|
+
*/
|
|
153
|
+
getProductsByIds(ids: string, langCode?: string, userQuery?: IProductsQuery): Promise<Array<IProductEntity> | IError>;
|
|
154
|
+
/**
|
|
155
|
+
* Retrieve one product object.
|
|
156
|
+
*
|
|
157
|
+
* @param {number} id - Product id. Example: 12345.
|
|
158
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
159
|
+
*
|
|
160
|
+
* @return {IProductEntity} ProductEntity object.
|
|
161
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
162
|
+
*/
|
|
163
|
+
getProductById(id: number, langCode?: string): Promise<IProductEntity | IError>;
|
|
164
|
+
/**
|
|
165
|
+
* Getting a product block object by product id.
|
|
166
|
+
*
|
|
167
|
+
* @param {number} id - Product id. Example: 12345.
|
|
168
|
+
*
|
|
169
|
+
* @return {IProductBlock}
|
|
170
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
171
|
+
*/
|
|
23
172
|
getProductBlockById(id: number): Promise<Array<IProductBlock> | IError>;
|
|
173
|
+
/**
|
|
174
|
+
* Quick search for product page objects with limited output.
|
|
175
|
+
*
|
|
176
|
+
* @param {string} name - Text to search product page objects (search is based on the title field of the localizeInfos object with language consideration). Example: 'laminat'.
|
|
177
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
178
|
+
*
|
|
179
|
+
* @return {IProductsEntity[]} Array with ProductEntity objects
|
|
180
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
181
|
+
*/
|
|
24
182
|
searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity> | IError>;
|
|
25
183
|
}
|
|
26
184
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
30
|
-
* @property {number}
|
|
31
|
-
* @property {
|
|
32
|
-
* @property {string
|
|
33
|
-
* @property {string | null}
|
|
34
|
-
* @property {string | null}
|
|
35
|
-
* @property {string | null}
|
|
36
|
-
* @property {string}
|
|
37
|
-
* @property {string}
|
|
38
|
-
*
|
|
185
|
+
* @interface IProductsQuery
|
|
186
|
+
*
|
|
187
|
+
* @property {number} offset - Parameter for pagination. Default: 0.
|
|
188
|
+
* @property {number} limit - Parameter for pagination. Default: 30.
|
|
189
|
+
* @property {string} sortOrder - Sort order 'DESC' | 'ASC'. Default: 'DESC'.
|
|
190
|
+
* @property {string} sortKey - Field for sorting (default - null). Possible values: 'id', 'position', 'title', 'date', 'price'. Default: null.
|
|
191
|
+
* @property {string | null} [templateMarker] - Product page status id, default null. Example: 'template_12345'.
|
|
192
|
+
* @property {string | null} [statusMarker] - Product page status id, default null. Example: 'in_stock'.
|
|
193
|
+
* @property {string | null} [conditionValue] - The value that is being searched for, default null. Example: 'new'.
|
|
194
|
+
* @property {string | null} [attributeMarker] - The text identifier of the indexed attribute by which values are filtered, default null. Example: 'color'.
|
|
195
|
+
* @property {string | null} [conditionMarker] - Id of the filter condition by which the values are filtered, default null. Example: 'equals'.
|
|
196
|
+
*
|
|
197
|
+
* @description This interface defines the structure of a query for retrieving products, including pagination, sorting, and filtering parameters.
|
|
39
198
|
*/
|
|
40
199
|
interface IProductsQuery {
|
|
41
200
|
offset: number;
|
|
@@ -50,15 +209,17 @@ interface IProductsQuery {
|
|
|
50
209
|
[key: string]: any;
|
|
51
210
|
}
|
|
52
211
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @
|
|
56
|
-
* @property {
|
|
57
|
-
* @property {
|
|
58
|
-
* @property {string | null}
|
|
59
|
-
* @property {
|
|
60
|
-
* @property {string | null}
|
|
61
|
-
* @property {
|
|
212
|
+
* @interface IFilterParams
|
|
213
|
+
*
|
|
214
|
+
* @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null. Example: 'color'.
|
|
215
|
+
* @property {string | null} [conditionMarker] - Id of the filter condition by which the values are filtered, default null. Example: 'equals'.
|
|
216
|
+
* @property {number | null} conditionValue - The value that is being searched for, default null. Example: 'new'.
|
|
217
|
+
* @property {Array<string> | null} [pageUrl] - Url of the category page object. Example: ['23-laminat-floorwood-maxima'].
|
|
218
|
+
* @property {string | null} [statusMarker] - Text identifier of the product page status (default not set). Example: 'in_stock'.
|
|
219
|
+
* @property {string | null} [title] - Product name. Example: 'Laminatboden Maxima'.
|
|
220
|
+
* @property {boolean} [isNested] - Flag for nested attributes, default false. Example: true.
|
|
221
|
+
*
|
|
222
|
+
* @description This interface defines the structure of filter parameters used for querying products, including conditions, attributes, and pagination.
|
|
62
223
|
*/
|
|
63
224
|
interface IFilterParams {
|
|
64
225
|
attributeMarker: string;
|
|
@@ -70,23 +231,26 @@ interface IFilterParams {
|
|
|
70
231
|
isNested?: boolean;
|
|
71
232
|
}
|
|
72
233
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* @
|
|
76
|
-
* @property {
|
|
77
|
-
* @property {object} additional - Additional value from the index.
|
|
78
|
-
* @property {Record<string, any>} localizeInfos - The name of the products, taking into account localization.
|
|
79
|
-
* @property {boolean} isVisible - A sign of page visibility.
|
|
80
|
-
* @property {boolean} isPositionLocked - Sorting position lock indicator (optional).
|
|
81
|
-
* @property {number | null} statusIdentifier - Product page status identifiers (may be null).
|
|
82
|
-
* @property {Array<number>} relatedIds - Ids of related product pages.
|
|
83
|
-
* @property {string} attributeSetIdentifier - Set of attributes id.
|
|
84
|
-
* @property {boolean} isSync - Indication of page indexing.
|
|
85
|
-
* @property {number} price - The value of the product page price taken from the index.
|
|
86
|
-
* @property {string} templateIdentifier - User id of the linked template.
|
|
87
|
-
* @property {string} shortDescTemplateIdentifier - User id of the linked template for a short description.
|
|
88
|
-
* @property {Record<string, any>} statusLocalizeInfos - JSON description of the item status object, taking into account the language.
|
|
89
|
-
* @property {number} position - Item number (for sorting).
|
|
234
|
+
* @interface IProductsEntity
|
|
235
|
+
*
|
|
236
|
+
* @property {number} id - The unique identifier. Example: 12345.
|
|
237
|
+
* @property {AttributeType} attributeValues - Array of attribute values from the index, represented. Example: [{ id: 'color', value: 'red' }].
|
|
238
|
+
* @property {object} additional - Additional value from the index. Example: { prices: { min: 100, max: 200 } }.
|
|
239
|
+
* @property {Record<string, any>} localizeInfos - The name of the products, taking into account localization. Example: .
|
|
240
|
+
* @property {boolean} isVisible - A sign of page visibility. Example: true.
|
|
241
|
+
* @property {boolean} isPositionLocked - Sorting position lock indicator (optional). Example: false.
|
|
242
|
+
* @property {number | null} statusIdentifier - Product page status identifiers (may be null). Example: 'in_stock'.
|
|
243
|
+
* @property {Array<number>} relatedIds - Ids of related product pages. Example: [12345, 67890].
|
|
244
|
+
* @property {string} attributeSetIdentifier - Set of attributes id. Example: 'set_12345'.
|
|
245
|
+
* @property {boolean} isSync - Indication of page indexing. Example: true.
|
|
246
|
+
* @property {number} price - The value of the product page price taken from the index. Example: 150.00.
|
|
247
|
+
* @property {string | null} templateIdentifier - User id of the linked template. Example: 'template_12345'.
|
|
248
|
+
* @property {string | null} shortDescTemplateIdentifier - User id of the linked template for a short description. Example: 'short_desc_template_12345'.
|
|
249
|
+
* @property {Record<string, any>} statusLocalizeInfos - JSON description of the item status object, taking into account the language. Example: { en: 'In Stock', de: 'Auf Lager' }.
|
|
250
|
+
* @property {number} position - Item number (for sorting). Example: 1.
|
|
251
|
+
* @property {string | null} sku - Product SKU (Stock Keeping Unit), may be null. Example: 'SKU_12345'.
|
|
252
|
+
*
|
|
253
|
+
* @description This interface defines the structure of a product entity, including its identifiers, attributes, and related information.
|
|
90
254
|
*/
|
|
91
255
|
interface IProductsEntity {
|
|
92
256
|
id: number;
|
|
@@ -111,51 +275,70 @@ interface IProductsEntity {
|
|
|
111
275
|
sku: string | null;
|
|
112
276
|
}
|
|
113
277
|
/**
|
|
114
|
-
* IProductEntity
|
|
278
|
+
* @interface IProductEntity
|
|
115
279
|
*
|
|
116
|
-
* @
|
|
117
|
-
* @property {Array<string>}
|
|
118
|
-
*
|
|
280
|
+
* @property {Array<string>} [blocks] - Array of block identifiers. Example: ['block_12345', 'block_67890'].
|
|
281
|
+
* @property {Array<Record<string, any>> | Record<string, any>} [productPages] - Array of product pages or a single product page object. Example: [{ id: 12345, title: 'Product 1' }, { id: 67890, title: 'Product 2' }].
|
|
282
|
+
*
|
|
283
|
+
* @description This interface extends the IProductsEntity interface to include additional properties specific to product entities, such as blocks and product pages.
|
|
119
284
|
*/
|
|
120
285
|
interface IProductEntity extends IProductsEntity {
|
|
121
286
|
blocks?: Array<string>;
|
|
122
287
|
productPages?: Array<Record<string, any>> | Record<string, any>;
|
|
123
288
|
}
|
|
124
289
|
/**
|
|
125
|
-
* IProductsResponse
|
|
290
|
+
* @interface IProductsResponse
|
|
291
|
+
*
|
|
292
|
+
* @property {number} total - The total number of products found. Example: 100.
|
|
293
|
+
* @property {Array<IProductsEntity>} items - An array of product entities. Example: [{ id: 12345, title: 'Product 1' }, { id: 67890, title: 'Product 2' }].
|
|
126
294
|
*
|
|
127
|
-
* @interface
|
|
128
|
-
* @property {number} total
|
|
129
|
-
* @property {Array<IProductsEntity>} items
|
|
295
|
+
* @description This interface defines the structure of a response containing multiple product entities, including the total count and an array of product items.
|
|
130
296
|
*/
|
|
131
297
|
interface IProductsResponse {
|
|
132
298
|
total: number;
|
|
133
299
|
items: Array<IProductsEntity>;
|
|
134
300
|
}
|
|
135
301
|
/**
|
|
136
|
-
* IProductsInfo
|
|
302
|
+
* @interface IProductsInfo
|
|
303
|
+
*
|
|
304
|
+
* @property {number} total - The total number of products found. Example: 100.
|
|
305
|
+
* @property {Array<IProductInfo>} items - An array of product information objects. Example: [{ id: 12345, price: 150.00 }, { id: 67890, price: 200.00 }].
|
|
137
306
|
*
|
|
138
|
-
* @interface
|
|
139
|
-
* @property {number} total
|
|
140
|
-
* @property {Array<IProductInfo>} items
|
|
307
|
+
* @description This interface defines the structure of a response containing product information, including the total count and an array of product items.
|
|
141
308
|
*/
|
|
142
309
|
interface IProductsInfo {
|
|
143
310
|
total: number;
|
|
144
311
|
items: Array<IProductInfo>;
|
|
145
312
|
}
|
|
146
313
|
/**
|
|
147
|
-
* IProductInfo
|
|
314
|
+
* @interface IProductInfo
|
|
148
315
|
*
|
|
149
|
-
* @
|
|
150
|
-
* @property {number}
|
|
151
|
-
*
|
|
316
|
+
* @property {number} id - The unique identifier of the product. Example: 12345.
|
|
317
|
+
* @property {number} price - The price of the product. Example: 150.00.
|
|
318
|
+
*
|
|
319
|
+
* @description This interface defines the structure of a product information object, including its identifier and price.
|
|
152
320
|
*/
|
|
153
321
|
interface IProductInfo {
|
|
154
322
|
id: number;
|
|
155
323
|
price: number;
|
|
156
324
|
}
|
|
157
325
|
/**
|
|
158
|
-
* IProductBlock
|
|
326
|
+
* @interface IProductBlock
|
|
327
|
+
*
|
|
328
|
+
* @property {number} id - Unique identifier of the product block. Example: 12345.
|
|
329
|
+
* @property {number | null} attributeSetIdentifier - Identifier of the attribute set used in the product block, or null if not applicable. Example: 67890.
|
|
330
|
+
* @property {Record<string, any>} localizeInfos - Localization information for the product block. Example: .
|
|
331
|
+
* @property {number} version - Version of the product block entity. Example: 1.
|
|
332
|
+
* @property {number} position - Position of the product block in a list or layout. Example: 1.
|
|
333
|
+
* @property {string} identifier - Unique string identifier for the product block. Example: 'product_block_12345'.
|
|
334
|
+
* @property {Types} type - Type of the product block, such as 'product', 'error_page', etc. Example: 'product'.
|
|
335
|
+
* @property {object} customSettings - Custom settings for the product block, including slider delay, product configuration, similar product rules, and conditions. Example: .
|
|
336
|
+
* @property {string | null} templateIdentifier - Identifier for the template used by the product block, or null if not applicable. Example: 'template_12345'.
|
|
337
|
+
* @property {boolean} isVisible - Indicates whether the product block is visible. Example: true.
|
|
338
|
+
* @property {boolean} isSync - Indicates whether the product block is synchronized. Example: false.
|
|
339
|
+
* @property {AttributeType} attributeValues - Array of attribute values from the index, represented as a pair of user attribute id and attribute value. Example: [{ id: 'color', value: 'red' }].
|
|
340
|
+
*
|
|
341
|
+
* @description This interface defines the structure of a product block entity, including its identifiers, attributes, and custom settings.
|
|
159
342
|
*/
|
|
160
343
|
interface IProductBlock {
|
|
161
344
|
id: number;
|
|
@@ -11,22 +11,41 @@ export default class SystemApi extends AsyncModules implements ISystem {
|
|
|
11
11
|
protected _url: string;
|
|
12
12
|
constructor(state: StateModule);
|
|
13
13
|
/**
|
|
14
|
-
* test404
|
|
15
|
-
*
|
|
14
|
+
* Sends a GET request to the '/test404' endpoint and returns the result.
|
|
15
|
+
*
|
|
16
|
+
* @handleName test404
|
|
17
|
+
*
|
|
18
|
+
* @return {any} The response from the server after fetching data from the '/test404' endpoint.
|
|
19
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
20
|
+
*
|
|
21
|
+
* @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
|
|
16
22
|
*/
|
|
17
23
|
test404(): Promise<any>;
|
|
18
24
|
/**
|
|
19
|
-
* test500
|
|
20
|
-
*
|
|
25
|
+
* Sends a GET request to the '/test500' endpoint and returns the result.
|
|
26
|
+
*
|
|
27
|
+
* @handleName test500
|
|
28
|
+
*
|
|
29
|
+
* @return {any} The response from the server after fetching data from the '/test500' endpoint.
|
|
30
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
31
|
+
*
|
|
32
|
+
* @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
|
|
21
33
|
*/
|
|
22
34
|
test500(): Promise<any>;
|
|
23
35
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @
|
|
27
|
-
*
|
|
28
|
-
* @param event
|
|
29
|
-
* @
|
|
36
|
+
* Validates a CAPTCHA token by sending it to the server for verification.
|
|
37
|
+
*
|
|
38
|
+
* @handleName validateCapcha
|
|
39
|
+
*
|
|
40
|
+
* @param {Object} event - The event object containing CAPTCHA data.
|
|
41
|
+
* @param {string} event.token - The CAPTCHA token to be validated. Example: '03AGdBq24...'.
|
|
42
|
+
* @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: 'login'.
|
|
43
|
+
* @param {string} event.siteKey - The site key used for the CAPTCHA. Example: '6Lc_aCMTAAAAAB...'.
|
|
44
|
+
*
|
|
45
|
+
* @return {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
|
|
46
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
47
|
+
*
|
|
48
|
+
* @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
|
|
30
49
|
*/
|
|
31
50
|
validateCapcha(event: {
|
|
32
51
|
token: string;
|
package/dist/system/systemApi.js
CHANGED
|
@@ -15,28 +15,47 @@ class SystemApi extends asyncModules_1.default {
|
|
|
15
15
|
this._url = state.url + '/api/content/system';
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* test404
|
|
19
|
-
*
|
|
18
|
+
* Sends a GET request to the '/test404' endpoint and returns the result.
|
|
19
|
+
*
|
|
20
|
+
* @handleName test404
|
|
21
|
+
*
|
|
22
|
+
* @return {any} The response from the server after fetching data from the '/test404' endpoint.
|
|
23
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
24
|
+
*
|
|
25
|
+
* @description This method is used to test the 404 error handling by sending a GET request to a specific endpoint.
|
|
20
26
|
*/
|
|
21
27
|
async test404() {
|
|
22
28
|
const result = await this._fetchGet('/test404');
|
|
23
29
|
return result;
|
|
24
30
|
}
|
|
25
31
|
/**
|
|
26
|
-
* test500
|
|
27
|
-
*
|
|
32
|
+
* Sends a GET request to the '/test500' endpoint and returns the result.
|
|
33
|
+
*
|
|
34
|
+
* @handleName test500
|
|
35
|
+
*
|
|
36
|
+
* @return {any} The response from the server after fetching data from the '/test500' endpoint.
|
|
37
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
38
|
+
*
|
|
39
|
+
* @description This method is used to test the 500 error handling by sending a GET request to a specific endpoint.
|
|
28
40
|
*/
|
|
29
41
|
async test500() {
|
|
30
42
|
const result = await this._fetchGet('/test500');
|
|
31
43
|
return result;
|
|
32
44
|
}
|
|
33
45
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* @
|
|
37
|
-
*
|
|
38
|
-
* @param event
|
|
39
|
-
* @
|
|
46
|
+
* Validates a CAPTCHA token by sending it to the server for verification.
|
|
47
|
+
*
|
|
48
|
+
* @handleName validateCapcha
|
|
49
|
+
*
|
|
50
|
+
* @param {Object} event - The event object containing CAPTCHA data.
|
|
51
|
+
* @param {string} event.token - The CAPTCHA token to be validated. Example: '03AGdBq24...'.
|
|
52
|
+
* @param {string} event.expectedAction - The expected action associated with the CAPTCHA. Example: 'login'.
|
|
53
|
+
* @param {string} event.siteKey - The site key used for the CAPTCHA. Example: '6Lc_aCMTAAAAAB...'.
|
|
54
|
+
*
|
|
55
|
+
* @return {any} The response from the server after validating the CAPTCHA, or an error object if validation fails.
|
|
56
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
57
|
+
*
|
|
58
|
+
* @description This method sends the CAPTCHA token and related information to the server endpoint '/captcha/validate' to verify its validity.
|
|
40
59
|
*/
|
|
41
60
|
async validateCapcha(event) {
|
|
42
61
|
const data = {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @interface ISystem
|
|
3
|
+
*
|
|
4
|
+
* @property {function} test404 - Test 404 error.
|
|
5
|
+
* @property {function} test500 - Test 500 error.
|
|
6
|
+
*
|
|
7
|
+
* @description Represents a interface object of System Api.
|
|
8
|
+
*/
|
|
1
9
|
interface ISystem {
|
|
2
10
|
test404(): Promise<any>;
|
|
3
11
|
test500(): Promise<any>;
|
|
@@ -4,7 +4,11 @@ import type { IError, Types } from '../base/utils';
|
|
|
4
4
|
import type { ITemplateEntity, ITemplatesApi } from './templatesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with template objects
|
|
7
|
+
*
|
|
8
|
+
* @module TemplateController
|
|
7
9
|
* @handle /api/content/templates
|
|
10
|
+
*
|
|
11
|
+
* @description This module provides a set of controllers for handling operations related to template objects.
|
|
8
12
|
*/
|
|
9
13
|
export default class TemplatesPreviewApi extends AsyncModules implements ITemplatesApi {
|
|
10
14
|
protected state: StateModule;
|
|
@@ -13,36 +17,42 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
|
|
|
13
17
|
/**
|
|
14
18
|
* Get all template objects grouped by types.
|
|
15
19
|
*
|
|
16
|
-
* @
|
|
20
|
+
* @handleName getAllTemplates
|
|
17
21
|
*
|
|
18
|
-
* @
|
|
22
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
+
*
|
|
24
|
+
* @return {Record<Types, ITemplateEntity>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
25
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
|
+
*
|
|
27
|
+
* @description This function is designed to fetch organized template objects in groups based on their types.
|
|
19
28
|
*/
|
|
20
29
|
getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity> | IError>;
|
|
21
30
|
/**
|
|
22
31
|
* Get template objects by type.
|
|
23
32
|
*
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
33
|
+
* @handleName getTemplateByType
|
|
34
|
+
*
|
|
35
|
+
* @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: 'product'.
|
|
36
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
26
37
|
*
|
|
27
|
-
* @
|
|
38
|
+
* @return {TemplateEntity[]} Returns a TemplateEntity object.
|
|
39
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
40
|
+
*
|
|
41
|
+
* @description Fetch template objects that belong to a specific type, with an optional filter by language.
|
|
28
42
|
*/
|
|
29
43
|
getTemplateByType(type: Types, langCode?: string): Promise<Array<ITemplateEntity> | IError>;
|
|
30
44
|
/**
|
|
31
|
-
* Get one template object by
|
|
45
|
+
* Get one template object by marker.
|
|
32
46
|
*
|
|
33
|
-
* @
|
|
34
|
-
* @param {string} [langCode] - Optional parameter language code
|
|
47
|
+
* @handleName getTemplateByMarker
|
|
35
48
|
*
|
|
36
|
-
* @
|
|
37
|
-
|
|
38
|
-
getTemplateById(id: number, langCode?: string): Promise<ITemplateEntity | IError>;
|
|
39
|
-
/**
|
|
40
|
-
* Get one template object by id.
|
|
49
|
+
* @param {number} marker - The unique marker of the template to retrieve. Example: 'template_12345'.
|
|
50
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
41
51
|
*
|
|
42
|
-
* @
|
|
43
|
-
* @
|
|
52
|
+
* @return {ITemplateEntity} Returns a TemplateEntity object
|
|
53
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
44
54
|
*
|
|
45
|
-
* @
|
|
55
|
+
* @description Fetch a specific template object based on its unique marker.
|
|
46
56
|
*/
|
|
47
57
|
getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
|
|
48
58
|
}
|