oneentry 1.0.127 → 1.0.128
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 +20 -20
- package/dist/admins/adminsApi.js +20 -20
- package/dist/admins/adminsInterfaces.d.ts +43 -43
- package/dist/attribute-sets/attributeSetsApi.d.ts +16 -16
- package/dist/attribute-sets/attributeSetsApi.js +16 -16
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +87 -85
- package/dist/auth-provider/authProviderApi.d.ts +126 -126
- package/dist/auth-provider/authProviderApi.js +126 -126
- package/dist/auth-provider/authProvidersInterfaces.d.ts +201 -201
- package/dist/base/asyncModules.d.ts +17 -17
- package/dist/base/asyncModules.js +26 -21
- package/dist/base/result.d.ts +5 -5
- package/dist/base/result.js +5 -9
- package/dist/base/stateModule.d.ts +1 -1
- package/dist/base/stateModule.js +1 -1
- package/dist/base/syncModules.d.ts +35 -35
- package/dist/base/syncModules.js +92 -45
- package/dist/base/utils.d.ts +13 -13
- package/dist/blocks/blocksApi.d.ts +24 -24
- package/dist/blocks/blocksApi.js +24 -24
- package/dist/blocks/blocksInterfaces.d.ts +85 -85
- package/dist/events/eventsApi.d.ts +11 -11
- package/dist/events/eventsApi.js +11 -11
- package/dist/events/eventsInterfaces.d.ts +23 -23
- package/dist/file-uploading/fileUploadingApi.d.ts +38 -38
- package/dist/file-uploading/fileUploadingApi.js +38 -38
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +44 -44
- package/dist/forms/formsApi.d.ts +7 -7
- package/dist/forms/formsApi.js +7 -7
- package/dist/forms/formsInterfaces.d.ts +43 -31
- package/dist/forms-data/formsDataApi.d.ts +37 -37
- package/dist/forms-data/formsDataApi.js +37 -38
- package/dist/forms-data/formsDataInterfaces.d.ts +219 -219
- package/dist/general-types/generalTypesApi.d.ts +1 -1
- package/dist/general-types/generalTypesApi.js +1 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/integration-collections/integrationCollectionsApi.d.ts +76 -80
- package/dist/integration-collections/integrationCollectionsApi.js +76 -80
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +145 -149
- package/dist/locales/localesInterfaces.d.ts +8 -8
- package/dist/menus/menusApi.d.ts +3 -3
- package/dist/menus/menusApi.js +3 -3
- package/dist/menus/menusInterfaces.d.ts +39 -39
- package/dist/orders/ordersApi.d.ts +56 -56
- package/dist/orders/ordersApi.js +56 -56
- package/dist/orders/ordersInterfaces.d.ts +204 -198
- package/dist/pages/pagesApi.d.ts +60 -60
- package/dist/pages/pagesApi.js +60 -60
- package/dist/pages/pagesInterfaces.d.ts +133 -141
- package/dist/payments/paymentsApi.d.ts +15 -15
- package/dist/payments/paymentsApi.js +15 -15
- package/dist/payments/paymentsInterfaces.d.ts +55 -55
- package/dist/product-statuses/productStatusesApi.d.ts +7 -7
- package/dist/product-statuses/productStatusesApi.js +7 -7
- package/dist/product-statuses/productStatusesInterfaces.d.ts +21 -21
- package/dist/products/productsApi.d.ts +240 -240
- package/dist/products/productsApi.js +240 -240
- package/dist/products/productsInterfaces.d.ts +311 -311
- package/dist/system/systemApi.d.ts +10 -10
- package/dist/system/systemApi.js +10 -10
- package/dist/templates/templatesApi.d.ts +8 -8
- package/dist/templates/templatesApi.js +8 -8
- package/dist/templates/templatesInterfaces.d.ts +22 -22
- package/dist/templates-preview/templatesPreviewApi.d.ts +5 -5
- package/dist/templates-preview/templatesPreviewApi.js +5 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +54 -54
- package/dist/users/usersApi.d.ts +29 -29
- package/dist/users/usersApi.js +29 -29
- package/dist/users/usersInterfaces.d.ts +77 -77
- package/package.json +1 -1
package/dist/base/utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type Types = 'product' | 'error_page' | 'catalog_page' | 'product_preview' | 'similar_products_block' | 'product_block' | 'form' | 'common_page' | 'common_block' | 'order' | 'service' | 'none';
|
|
2
2
|
/**
|
|
3
|
-
* @param {string}
|
|
4
|
-
* @param {string}
|
|
5
|
-
* @param {boolean} [traficLimit]
|
|
6
|
-
* @param {boolean} [auth]
|
|
7
|
-
* @param {boolean} [auth.customAuth]
|
|
3
|
+
* @param {string} [token] - If your project is protected by a token, specify this token in this parameter.
|
|
4
|
+
* @param {string} [langCode] - specify the default language to avoid specifying it in every request.
|
|
5
|
+
* @param {boolean} [traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set this parameter to "false" to save traffic and decide for yourself what data you need.
|
|
6
|
+
* @param {boolean} [auth] - An object with authorization settings
|
|
7
|
+
* @param {boolean} [auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal
|
|
8
8
|
* @param {boolean} [auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created
|
|
9
9
|
* @param {boolean} [auth.saveFunction] - If you want to store the token between sessions, for example in local storage, create a custom function that takes refreshToken as a parameter and executes the necessary instructions. This function will be called every time the tokens are updated
|
|
10
10
|
* @example
|
|
@@ -52,14 +52,14 @@ interface IConfig {
|
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* @interface IAttributes
|
|
55
|
-
* @property {Array<object>}
|
|
56
|
-
* @property {ILocalizeInfo}
|
|
57
|
-
* @property {string}
|
|
58
|
-
* @property {number}
|
|
59
|
-
* @property {boolean}
|
|
60
|
-
* @property {string}
|
|
61
|
-
* @property {Record<string, any>} settings
|
|
62
|
-
* @property {Record<string, any>} validators
|
|
55
|
+
* @property {Array<object>} listTitles - List of titles.
|
|
56
|
+
* @property {ILocalizeInfo} localizeInfos - Localization information.
|
|
57
|
+
* @property {string} marker - Attribute marker.
|
|
58
|
+
* @property {number} position - Attribute position.
|
|
59
|
+
* @property {boolean} isVisible - Indicates whether the attribute is visible.
|
|
60
|
+
* @property {string} type - Attribute type.
|
|
61
|
+
* @property {Record<string, any>} settings - Additional settings for the attribute.
|
|
62
|
+
* @property {Record<string, any>} validators - Validators for the attribute.
|
|
63
63
|
* @property {Record<string, any>} additionalFields - Additional fields for the attribute.
|
|
64
64
|
* @description Interface for attributes.
|
|
65
65
|
*/
|
|
@@ -14,17 +14,17 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
14
14
|
protected state: StateModule;
|
|
15
15
|
protected _url: string;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Constructor for BlocksApi class.
|
|
18
18
|
*/
|
|
19
19
|
constructor(state: StateModule);
|
|
20
20
|
/**
|
|
21
21
|
* Get blocks by parameters.
|
|
22
22
|
* @handleName getBlocks
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @returns {IBlocksResponse}
|
|
23
|
+
* @param {BlockType} type - Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". Example: 'product'.
|
|
24
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
26
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
27
|
+
* @returns {IBlocksResponse} Returns BlocksEntity object.
|
|
28
28
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
29
29
|
* @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.
|
|
30
30
|
*/
|
|
@@ -32,11 +32,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
32
32
|
/**
|
|
33
33
|
* Get block by marker.
|
|
34
34
|
* @handleName getBlockByMarker
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @returns {IBlockEntity}
|
|
35
|
+
* @param {string} marker - Marker of Block. Example: "product_block".
|
|
36
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
37
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
38
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
39
|
+
* @returns {IBlockEntity} - Returns a BlockEntity object.
|
|
40
40
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
41
41
|
* @description This method retrieves a block by its marker and includes additional information such as similar products or products associated with the block.
|
|
42
42
|
*/
|
|
@@ -44,11 +44,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
44
44
|
/**
|
|
45
45
|
* Get similar products by block marker.
|
|
46
46
|
* @handleName getSimilarProducts
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @returns {IProductsResponse}
|
|
47
|
+
* @param {string} marker - Block identifier. Example: "similar_products_block".
|
|
48
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
49
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
50
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
51
|
+
* @returns {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
|
|
52
52
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
53
53
|
* @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.
|
|
54
54
|
*/
|
|
@@ -56,11 +56,11 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
56
56
|
/**
|
|
57
57
|
* Get products by block marker.
|
|
58
58
|
* @handleName getProductsByBlockMarker
|
|
59
|
-
* @param
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @returns {IProductsEntity[]}
|
|
59
|
+
* @param {string} marker - Block identifier. Example: "product_block".
|
|
60
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
61
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
62
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
63
|
+
* @returns {IProductsEntity[]} Return array of BlocksEntity object.
|
|
64
64
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
65
65
|
* @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.
|
|
66
66
|
*/
|
|
@@ -68,9 +68,9 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
68
68
|
/**
|
|
69
69
|
* Quick search for block objects with limited output.
|
|
70
70
|
* @handleName searchBlock
|
|
71
|
-
* @param
|
|
72
|
-
* @param
|
|
73
|
-
* @returns {ISearchBlock[]}
|
|
71
|
+
* @param {string} name - Search string. Example: "product_block".
|
|
72
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
73
|
+
* @returns {ISearchBlock[]} Returns an array of ISearchBlock objects.
|
|
74
74
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
75
75
|
* @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.
|
|
76
76
|
*/
|
package/dist/blocks/blocksApi.js
CHANGED
|
@@ -14,7 +14,7 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
|
14
14
|
*/
|
|
15
15
|
class BlocksApi extends asyncModules_1.default {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Constructor for BlocksApi class.
|
|
18
18
|
*/
|
|
19
19
|
constructor(state) {
|
|
20
20
|
super(state);
|
|
@@ -23,11 +23,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
23
23
|
/**
|
|
24
24
|
* Get blocks by parameters.
|
|
25
25
|
* @handleName getBlocks
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @returns {IBlocksResponse}
|
|
26
|
+
* @param {BlockType} type - Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". Example: 'product'.
|
|
27
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
28
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
29
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
30
|
+
* @returns {IBlocksResponse} Returns BlocksEntity object.
|
|
31
31
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
32
32
|
* @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.
|
|
33
33
|
*/
|
|
@@ -79,11 +79,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
79
79
|
/**
|
|
80
80
|
* Get block by marker.
|
|
81
81
|
* @handleName getBlockByMarker
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @param
|
|
86
|
-
* @returns {IBlockEntity}
|
|
82
|
+
* @param {string} marker - Marker of Block. Example: "product_block".
|
|
83
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
84
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
85
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
86
|
+
* @returns {IBlockEntity} - Returns a BlockEntity object.
|
|
87
87
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
88
88
|
* @description This method retrieves a block by its marker and includes additional information such as similar products or products associated with the block.
|
|
89
89
|
*/
|
|
@@ -129,11 +129,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
129
129
|
/**
|
|
130
130
|
* Get similar products by block marker.
|
|
131
131
|
* @handleName getSimilarProducts
|
|
132
|
-
* @param
|
|
133
|
-
* @param
|
|
134
|
-
* @param
|
|
135
|
-
* @param
|
|
136
|
-
* @returns {IProductsResponse}
|
|
132
|
+
* @param {string} marker - Block identifier. Example: "similar_products_block".
|
|
133
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
134
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
135
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
136
|
+
* @returns {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
|
|
137
137
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
138
138
|
* @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.
|
|
139
139
|
*/
|
|
@@ -149,11 +149,11 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
149
149
|
/**
|
|
150
150
|
* Get products by block marker.
|
|
151
151
|
* @handleName getProductsByBlockMarker
|
|
152
|
-
* @param
|
|
153
|
-
* @param
|
|
154
|
-
* @param
|
|
155
|
-
* @param
|
|
156
|
-
* @returns {IProductsEntity[]}
|
|
152
|
+
* @param {string} marker - Block identifier. Example: "product_block".
|
|
153
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
154
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
155
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
156
|
+
* @returns {IProductsEntity[]} Return array of BlocksEntity object.
|
|
157
157
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
158
158
|
* @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.
|
|
159
159
|
*/
|
|
@@ -169,9 +169,9 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
169
169
|
/**
|
|
170
170
|
* Quick search for block objects with limited output.
|
|
171
171
|
* @handleName searchBlock
|
|
172
|
-
* @param
|
|
173
|
-
* @param
|
|
174
|
-
* @returns {ISearchBlock[]}
|
|
172
|
+
* @param {string} name - Search string. Example: "product_block".
|
|
173
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
174
|
+
* @returns {ISearchBlock[]} Returns an array of ISearchBlock objects.
|
|
175
175
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
176
176
|
* @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.
|
|
177
177
|
*/
|
|
@@ -3,22 +3,22 @@ import type { IProductsEntity, IProductsResponse } from '../products/productsInt
|
|
|
3
3
|
/**
|
|
4
4
|
* Interface for managing and retrieving blocks in the system.
|
|
5
5
|
* @interface IBlocks
|
|
6
|
-
* @property {Function} getBlocks
|
|
7
|
-
* @property {Function} getBlockByMarker
|
|
8
|
-
* @property {Function} getSimilarProducts
|
|
6
|
+
* @property {Function} getBlocks - Get all Blocks objects.
|
|
7
|
+
* @property {Function} getBlockByMarker - Get Block object by marker.
|
|
8
|
+
* @property {Function} getSimilarProducts - Get Array of similar products from product-similar block.
|
|
9
9
|
* @property {Function} getProductsByBlockMarker - Get Array of products from product block.
|
|
10
|
-
* @property {Function} searchBlock
|
|
10
|
+
* @property {Function} searchBlock - Quick search for block objects with limited output.
|
|
11
11
|
* @description This interface defines methods for retrieving and managing blocks in the system.
|
|
12
12
|
*/
|
|
13
13
|
interface IBlocks {
|
|
14
14
|
/**
|
|
15
15
|
* Retrieves all block objects of a specific type.
|
|
16
16
|
* @handleName getBlocks
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
21
|
-
* @returns {IBlocksResponse}
|
|
17
|
+
* @param {BlockType} type - The type of blocks to retrieve. Example: "product".
|
|
18
|
+
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
19
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
20
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
21
|
+
* @returns {IBlocksResponse} A promise that resolves to a blocks response or an error.
|
|
22
22
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
23
23
|
* @description This method retrieves all block objects of a specific type.
|
|
24
24
|
*/
|
|
@@ -26,11 +26,11 @@ interface IBlocks {
|
|
|
26
26
|
/**
|
|
27
27
|
* Retrieves a block object by its marker.
|
|
28
28
|
* @handleName getBlockByMarker
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @returns {IBlockEntity}
|
|
29
|
+
* @param {string} marker - The marker identifying the block. Example: "product_block".
|
|
30
|
+
* @param {string} langCode - Language code for localization. Default: "en_US".
|
|
31
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
32
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
33
|
+
* @returns {IBlockEntity} A promise that resolves to a block entity or an error.
|
|
34
34
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
35
35
|
* @description This method retrieves a block object by its marker.
|
|
36
36
|
*/
|
|
@@ -38,9 +38,9 @@ interface IBlocks {
|
|
|
38
38
|
/**
|
|
39
39
|
* Performs a quick search for block objects with limited output.
|
|
40
40
|
* @handleName searchBlock
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @returns {ISearchBlock[]}
|
|
41
|
+
* @param {string} name - The name to search for. Example: "product_block".
|
|
42
|
+
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
43
|
+
* @returns {ISearchBlock[]} A promise that resolves to an array of search blocks or an error.
|
|
44
44
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
45
45
|
* @description This method performs a quick search for block objects with limited output.
|
|
46
46
|
*/
|
|
@@ -49,37 +49,37 @@ interface IBlocks {
|
|
|
49
49
|
/**
|
|
50
50
|
* Represents a response from the blocks API.
|
|
51
51
|
* @interface IBlocksResponse
|
|
52
|
-
* @property {number}
|
|
52
|
+
* @property {number} total - Total number of found records. Example: 100.
|
|
53
53
|
* @property {IBlockEntity[]} items - Array of block entities. Example:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
"attributeValues": [],
|
|
57
|
+
"id": 1,
|
|
58
|
+
"identifier": "block1",
|
|
59
|
+
"isVisible": true,
|
|
60
|
+
"localizeInfos": { "key": "value" },
|
|
61
|
+
"position": 1,
|
|
62
|
+
"templateIdentifier": null,
|
|
63
|
+
"type": "product",
|
|
64
|
+
"version": 1,
|
|
65
|
+
"countElementsPerRow": 3,
|
|
66
|
+
"quantity": 9,
|
|
67
|
+
"similarProducts": {
|
|
68
|
+
"total": 0,
|
|
69
|
+
"items": []
|
|
70
|
+
},
|
|
71
|
+
"products": [
|
|
72
|
+
{
|
|
73
|
+
"id": 1,
|
|
74
|
+
"name": "Product 1"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": 2,
|
|
78
|
+
"name": "Product 2"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
83
|
* @description Represents a response from the blocks API containing a total count and an array of block entities.
|
|
84
84
|
*/
|
|
85
85
|
interface IBlocksResponse {
|
|
@@ -89,42 +89,42 @@ interface IBlocksResponse {
|
|
|
89
89
|
/**
|
|
90
90
|
* Represents a block entity with various attributes and properties.
|
|
91
91
|
* @interface IBlockEntity
|
|
92
|
-
* @property {AttributeType}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* @property {number}
|
|
104
|
-
* @property {ILocalizeInfo}
|
|
105
|
-
* @property {number}
|
|
106
|
-
* @property {string}
|
|
107
|
-
* @property {string}
|
|
108
|
-
* @property {string | null}
|
|
109
|
-
* @property {boolean}
|
|
110
|
-
* @property {number}
|
|
111
|
-
* @property {number}
|
|
112
|
-
* @property {IProductsResponse} [similarProducts]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
* @property {IProductsEntity[]} [products]
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
92
|
+
* @property {AttributeType} attributeValues - Type of attributes used in the block. Example:
|
|
93
|
+
{
|
|
94
|
+
"block-text": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"value": "some text",
|
|
97
|
+
"isIcon": false,
|
|
98
|
+
"position": 0,
|
|
99
|
+
"additionalFields": [],
|
|
100
|
+
"isProductPreview": false
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
* @property {number} id - Unique identifier of the block. Example: 1234.
|
|
104
|
+
* @property {ILocalizeInfo} localizeInfos - Localization information for the block. Example: {"key": "value"}
|
|
105
|
+
* @property {number} version - Version of the block entity. Example: 1.
|
|
106
|
+
* @property {string} identifier - Unique string identifier for the block. Example: "block1".
|
|
107
|
+
* @property {string} type - Type of the block, such as 'product', 'error_page', etc. Example: "product".
|
|
108
|
+
* @property {string | null} templateIdentifier - Identifier for the template used by the block, or null if not applicable. Example: "template1".
|
|
109
|
+
* @property {boolean} isVisible - Indicates whether the block is visible. Example: true.
|
|
110
|
+
* @property {number} [countElementsPerRow] - Number of elements displayed per row in the block, if applicable. Example: 3.
|
|
111
|
+
* @property {number} [quantity] - Quantity of items in the block, if applicable. Example: 5.
|
|
112
|
+
* @property {IProductsResponse} [similarProducts] - Response containing similar products associated with the block. Example:
|
|
113
|
+
{
|
|
114
|
+
"total": 10,
|
|
115
|
+
"items": []
|
|
116
|
+
}
|
|
117
|
+
* @property {IProductsEntity[]} [products] - Array of product entities associated with the block. Example:
|
|
118
|
+
[
|
|
119
|
+
{
|
|
120
|
+
"id": 1,
|
|
121
|
+
"name": "Product 1"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": 2,
|
|
125
|
+
"name": "Product 2"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
128
|
* @description Represents a block entity with various attributes and properties.
|
|
129
129
|
*/
|
|
130
130
|
interface IBlockEntity {
|
|
@@ -145,9 +145,9 @@ interface IBlockEntity {
|
|
|
145
145
|
/**
|
|
146
146
|
* Represents a search block entity with an identifier, name, and ID.
|
|
147
147
|
* @interface ISearchBlock
|
|
148
|
-
* @property {number} id
|
|
148
|
+
* @property {number} id - Unique identifier of the search block. Example: 1.
|
|
149
149
|
* @property {string} identifier - Unique string identifier for the search block. Example: "search_block_1".
|
|
150
|
-
* @property {string} name
|
|
150
|
+
* @property {string} name - Name of the search block. Example: "Search Block 1".
|
|
151
151
|
* @description Represents a search block entity with an identifier, name, and ID.
|
|
152
152
|
*/
|
|
153
153
|
interface ISearchBlock {
|
|
@@ -25,9 +25,9 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
25
25
|
/**
|
|
26
26
|
* Return all subscriptions to product.
|
|
27
27
|
* @handleName getAllSubscriptions
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @returns {ISubscriptions}
|
|
28
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
29
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
30
|
+
* @returns {ISubscriptions} Returns an object containing all subscriptions or an error object if there was an issue.
|
|
31
31
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
32
32
|
* @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.
|
|
33
33
|
*/
|
|
@@ -35,10 +35,10 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
35
35
|
/**
|
|
36
36
|
* Subscribing to an event on a product.
|
|
37
37
|
* @handleName subscribeByMarker
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @returns {Promise<boolean | IError>}
|
|
38
|
+
* @param {string} marker - Event marker. Example: "product_price_change".
|
|
39
|
+
* @param {number} productId - Product id. Example: 12345.
|
|
40
|
+
* @param {string} [langCode] - Language code. Default: "en_US".=
|
|
41
|
+
* @returns {Promise<boolean | IError>} Returns true if subscription was successful, or an error object if there was an issue.
|
|
42
42
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
43
43
|
* @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.
|
|
44
44
|
*/
|
|
@@ -46,10 +46,10 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
46
46
|
/**
|
|
47
47
|
* Unsubscribing to an event on a product.
|
|
48
48
|
* @handleName unsubscribeByMarker
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @returns {any}
|
|
49
|
+
* @param {string} marker - The marker of the event to unsubscribe from. Example: "product_price_change".
|
|
50
|
+
* @param {number} productId - The ID of the product to unsubscribe from. Example: 12345.
|
|
51
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
52
|
+
* @returns {any} - Returns a promise that resolves to the result of the unsubscription operation or an error object if there was an issue.
|
|
53
53
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
54
54
|
* @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.
|
|
55
55
|
*/
|
package/dist/events/eventsApi.js
CHANGED
|
@@ -30,9 +30,9 @@ class EventsApi extends asyncModules_1.default {
|
|
|
30
30
|
/**
|
|
31
31
|
* Return all subscriptions to product.
|
|
32
32
|
* @handleName getAllSubscriptions
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @returns {ISubscriptions}
|
|
33
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
34
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
35
|
+
* @returns {ISubscriptions} Returns an object containing all subscriptions or an error object if there was an issue.
|
|
36
36
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
37
37
|
* @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.
|
|
38
38
|
*/
|
|
@@ -47,10 +47,10 @@ class EventsApi extends asyncModules_1.default {
|
|
|
47
47
|
/**
|
|
48
48
|
* Subscribing to an event on a product.
|
|
49
49
|
* @handleName subscribeByMarker
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @returns {Promise<boolean | IError>}
|
|
50
|
+
* @param {string} marker - Event marker. Example: "product_price_change".
|
|
51
|
+
* @param {number} productId - Product id. Example: 12345.
|
|
52
|
+
* @param {string} [langCode] - Language code. Default: "en_US".=
|
|
53
|
+
* @returns {Promise<boolean | IError>} Returns true if subscription was successful, or an error object if there was an issue.
|
|
54
54
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
55
55
|
* @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.
|
|
56
56
|
*/
|
|
@@ -70,10 +70,10 @@ class EventsApi extends asyncModules_1.default {
|
|
|
70
70
|
/**
|
|
71
71
|
* Unsubscribing to an event on a product.
|
|
72
72
|
* @handleName unsubscribeByMarker
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @returns {any}
|
|
73
|
+
* @param {string} marker - The marker of the event to unsubscribe from. Example: "product_price_change".
|
|
74
|
+
* @param {number} productId - The ID of the product to unsubscribe from. Example: 12345.
|
|
75
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
76
|
+
* @returns {any} - Returns a promise that resolves to the result of the unsubscription operation or an error object if there was an issue.
|
|
77
77
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
78
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
79
|
*/
|
|
@@ -8,9 +8,9 @@ interface IEvents {
|
|
|
8
8
|
/**
|
|
9
9
|
* Retrieves all subscriptions to products.
|
|
10
10
|
* @handleName getAllSubscriptions
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @returns {ISubscriptions}
|
|
11
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
12
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
13
|
+
* @returns {Promise<ISubscriptions | IError>} A promise that resolves to a subscriptions object or an error.
|
|
14
14
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
15
15
|
* @description This method retrieves all subscriptions to products.
|
|
16
16
|
*/
|
|
@@ -18,10 +18,10 @@ interface IEvents {
|
|
|
18
18
|
/**
|
|
19
19
|
* Subscribes to an event on a product by its marker.
|
|
20
20
|
* @handleName subscribeByMarker
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @returns {boolean}
|
|
21
|
+
* @param {string} marker - The marker identifying the event. Example: "product_price_change".
|
|
22
|
+
* @param {number} productId - The ID of the product to subscribe to. Example: 12345.
|
|
23
|
+
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
24
|
+
* @returns {Promise<boolean | IError>} A promise that resolves to any type or an error.
|
|
25
25
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
26
|
* @description This method subscribes to an event on a product by its marker.
|
|
27
27
|
*/
|
|
@@ -29,10 +29,10 @@ interface IEvents {
|
|
|
29
29
|
/**
|
|
30
30
|
* Unsubscribes from an event on a product by its marker.
|
|
31
31
|
* @handleName unsubscribeByMarker
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @returns {boolean}
|
|
32
|
+
* @param {string} marker - The marker identifying the event. Example: "product_price_change".
|
|
33
|
+
* @param {number} productId - The ID of the product to unsubscribe from. Example: 12345.
|
|
34
|
+
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
35
|
+
* @returns {Promise<boolean | IError>} A promise that resolves to any type or an error.
|
|
36
36
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
37
37
|
* @description This method unsubscribes from an event on a product by its marker.
|
|
38
38
|
*/
|
|
@@ -41,18 +41,18 @@ interface IEvents {
|
|
|
41
41
|
/**
|
|
42
42
|
* Represents a response from the events API containing a total count and an array of subscription items.
|
|
43
43
|
* @interface ISubscriptions
|
|
44
|
-
* @property {number}
|
|
44
|
+
* @property {number} total - Total number of found records. Example: 100.
|
|
45
45
|
* @property {{ eventMarker: string; productId: number }[]} items - Array of subscription items, each containing an event marker and a product ID. Example:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
[
|
|
47
|
+
{
|
|
48
|
+
eventMarker: 'product_price_change',
|
|
49
|
+
productId: 12345
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
eventMarker: 'product_stock_update',
|
|
53
|
+
productId: 67890
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
56
|
* @description Represents a response from the events API containing a total count and an array of subscription items.
|
|
57
57
|
*/
|
|
58
58
|
interface ISubscriptions {
|
|
@@ -65,7 +65,7 @@ interface ISubscriptions {
|
|
|
65
65
|
/**
|
|
66
66
|
* Interface for the body of the subscribe methods.
|
|
67
67
|
* @interface ISubscribeBody
|
|
68
|
-
* @property {string} locale
|
|
68
|
+
* @property {string} locale - Locale of the user. Example: "en_US".
|
|
69
69
|
* @property {number} productId - Product ID. Example: 12345.
|
|
70
70
|
* @description Represents a body for the subscribe methods, containing the locale and product ID.
|
|
71
71
|
*/
|