oneentry 1.0.71 → 1.0.73
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 +651 -938
- package/dist/auth-provider/authProviderApi.d.ts +7 -3
- package/dist/auth-provider/authProviderApi.js +9 -3
- package/dist/auth-provider/authProvidersInterfaces.d.ts +12 -8
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +3 -3
- package/dist/blocks/blocksApi.js +6 -6
- package/dist/blocks/blocksInterfaces.d.ts +2 -2
- package/dist/formsData/formsDataInterfaces.d.ts +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/orders/ordersApi.d.ts +9 -0
- package/dist/orders/ordersApi.js +9 -0
- package/dist/orders/ordersInterfaces.d.ts +5 -5
- package/dist/pages/pagesApi.d.ts +0 -12
- package/dist/pages/pagesApi.js +1 -16
- package/dist/pages/pagesInterfaces.d.ts +4 -3
- package/dist/payments/paymentsApi.d.ts +9 -2
- package/dist/payments/paymentsApi.js +7 -0
- package/dist/payments/paymentsInterfaces.d.ts +11 -33
- package/dist/products/productsInterfaces.d.ts +5 -5
- package/dist/templates-preview/templatesPreviewApi.d.ts +3 -3
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +3 -30
- package/dist/users/usersApi.d.ts +5 -0
- package/dist/users/usersApi.js +5 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AsyncModules from "../base/asyncModules";
|
|
2
|
-
import { IAuthProvider, ISignUpData, ISignUpEntity, IAuthEntity, IAuthProvidersEntity, IAuthPostBody } from "./authProvidersInterfaces";
|
|
2
|
+
import { IAuthProvider, ISignUpData, ISignUpEntity, ICode, IAuthEntity, IAuthProvidersEntity, IAuthPostBody } from "./authProvidersInterfaces";
|
|
3
3
|
import StateModule from "../base/stateModule";
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with auth services.
|
|
@@ -46,8 +46,9 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
46
46
|
* Getting a user activation code. The code is returned via the appropriate user notification method
|
|
47
47
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
48
48
|
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
49
|
+
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated
|
|
49
50
|
*/
|
|
50
|
-
generateCode(marker: string, userIdentifier: string): Promise<
|
|
51
|
+
generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<ICode>;
|
|
51
52
|
/**
|
|
52
53
|
* User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
|
|
53
54
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
@@ -91,9 +92,12 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
91
92
|
*/
|
|
92
93
|
refresh(marker: string, token: string): Promise<IAuthEntity>;
|
|
93
94
|
/**
|
|
94
|
-
*
|
|
95
|
+
*
|
|
96
|
+
* User logout.
|
|
95
97
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
96
98
|
* @param {string} token - Refresh token
|
|
99
|
+
*
|
|
100
|
+
* @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.
|
|
97
101
|
*/
|
|
98
102
|
logout(marker: string, token: string): Promise<boolean>;
|
|
99
103
|
/**
|
|
@@ -52,12 +52,15 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
52
52
|
* Getting a user activation code. The code is returned via the appropriate user notification method
|
|
53
53
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
54
54
|
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
55
|
+
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated
|
|
55
56
|
*/
|
|
56
|
-
async generateCode(marker, userIdentifier) {
|
|
57
|
+
async generateCode(marker, userIdentifier, eventIdentifier) {
|
|
57
58
|
const data = {
|
|
58
|
-
"userIdentifier": userIdentifier
|
|
59
|
+
"userIdentifier": userIdentifier,
|
|
60
|
+
"eventIdentifier": eventIdentifier
|
|
59
61
|
};
|
|
60
62
|
const result = await this._fetchPost(`/marker/${marker}/users/generate-code`, data);
|
|
63
|
+
return result;
|
|
61
64
|
}
|
|
62
65
|
/**
|
|
63
66
|
* User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
|
|
@@ -133,9 +136,12 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
133
136
|
return result;
|
|
134
137
|
}
|
|
135
138
|
/**
|
|
136
|
-
*
|
|
139
|
+
*
|
|
140
|
+
* User logout.
|
|
137
141
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
138
142
|
* @param {string} token - Refresh token
|
|
143
|
+
*
|
|
144
|
+
* @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
145
|
*/
|
|
140
146
|
async logout(marker, token) {
|
|
141
147
|
const data = {
|
|
@@ -15,7 +15,7 @@ import { ILocalizeInfo } from "../base/utils";
|
|
|
15
15
|
*/
|
|
16
16
|
interface IAuthProvider {
|
|
17
17
|
signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity>;
|
|
18
|
-
generateCode(marker: string, userIdentifier: string): Promise<
|
|
18
|
+
generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<ICode>;
|
|
19
19
|
checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean>;
|
|
20
20
|
activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean>;
|
|
21
21
|
auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity>;
|
|
@@ -50,16 +50,16 @@ interface ISignUpEntity {
|
|
|
50
50
|
version: number;
|
|
51
51
|
identifier: string;
|
|
52
52
|
isActive: boolean;
|
|
53
|
-
authProviderId: number;
|
|
54
53
|
formData: Array<{
|
|
55
54
|
marker: string;
|
|
56
55
|
value: string;
|
|
57
56
|
}>;
|
|
58
|
-
notificationData:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
notificationData: {
|
|
58
|
+
email: string;
|
|
59
|
+
phonePush: string;
|
|
60
|
+
phoneSMS: string;
|
|
62
61
|
};
|
|
62
|
+
locale: string;
|
|
63
63
|
}
|
|
64
64
|
interface ICodeEntity {
|
|
65
65
|
code: string;
|
|
@@ -80,7 +80,7 @@ interface IAuthProvidersEntity {
|
|
|
80
80
|
isCheckCode: boolean;
|
|
81
81
|
type: string;
|
|
82
82
|
formIdentifier: string | null;
|
|
83
|
-
|
|
83
|
+
config: Record<string, any>;
|
|
84
84
|
}
|
|
85
85
|
interface IAuthPostBody {
|
|
86
86
|
authData: Array<{
|
|
@@ -88,4 +88,8 @@ interface IAuthPostBody {
|
|
|
88
88
|
value: string | number;
|
|
89
89
|
}>;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
interface ICode {
|
|
92
|
+
"code": string;
|
|
93
|
+
"expiredDate": string;
|
|
94
|
+
}
|
|
95
|
+
export { IAuthProvider, IAuthFormData, ISignUpData, ISignUpEntity, ICodeEntity, IAuthEntity, IAuthProvidersEntity, IAuthPostBody, ICode };
|
package/dist/base/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ type Types = 'forCatalogProducts' | 'forBasketPage' | 'forErrorPage' | 'forCatal
|
|
|
2
2
|
/**
|
|
3
3
|
* @param {string} [token] - If your project is protected by a token, specify this token in this parameter.
|
|
4
4
|
* @param {string} [langCode] - specify the default language to avoid specifying it in every request.
|
|
5
|
-
* @param {boolean} [
|
|
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
6
|
* @param {boolean} [auth] - An object with authorization settings
|
|
7
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
|
|
@@ -12,18 +12,18 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
12
12
|
/**
|
|
13
13
|
* Get blocks by parameters.
|
|
14
14
|
*
|
|
15
|
-
* @param {BlockType}
|
|
15
|
+
* @param {BlockType} type - Available values : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
|
|
16
16
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
17
17
|
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
18
18
|
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
19
19
|
*
|
|
20
20
|
* @returns Return array of BlocksEntity object.
|
|
21
21
|
*/
|
|
22
|
-
getBlocks(type
|
|
22
|
+
getBlocks(type: BlockType, langCode?: string, offset?: number, limit?: number): Promise<Array<IBlockEntity | IBlocksResponse>>;
|
|
23
23
|
/**
|
|
24
24
|
* Get block by marker.
|
|
25
25
|
*
|
|
26
|
-
* @param {string}
|
|
26
|
+
* @param {string} marker - Marker of Block.
|
|
27
27
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
28
28
|
*
|
|
29
29
|
* @returns Return BlocksEntity object.
|
package/dist/blocks/blocksApi.js
CHANGED
|
@@ -12,14 +12,14 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
12
12
|
/**
|
|
13
13
|
* Get blocks by parameters.
|
|
14
14
|
*
|
|
15
|
-
* @param {BlockType}
|
|
15
|
+
* @param {BlockType} type - Available values : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
|
|
16
16
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
17
17
|
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
18
18
|
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
19
19
|
*
|
|
20
20
|
* @returns Return array of BlocksEntity object.
|
|
21
21
|
*/
|
|
22
|
-
async getBlocks(type
|
|
22
|
+
async getBlocks(type, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
23
23
|
const response = await this._fetchGet(`?langCode=${langCode}&type=${type}&offset=${offset}&limit=${limit}`);
|
|
24
24
|
if (this.state.multipleResponse) {
|
|
25
25
|
const normalizeResponse = this._normalizeData(response.items);
|
|
@@ -32,7 +32,7 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
32
32
|
block.countElementsPerRow = 0;
|
|
33
33
|
}
|
|
34
34
|
delete block.customSettings;
|
|
35
|
-
delete block.
|
|
35
|
+
delete block.attributesSetIdentifier;
|
|
36
36
|
delete block.productPageUrls;
|
|
37
37
|
if (block.type === 'forSimilarProductBlock') {
|
|
38
38
|
try {
|
|
@@ -62,14 +62,14 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
62
62
|
/**
|
|
63
63
|
* Get block by marker.
|
|
64
64
|
*
|
|
65
|
-
* @param {string}
|
|
65
|
+
* @param {string} marker - Marker of Block.
|
|
66
66
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
67
67
|
*
|
|
68
68
|
* @returns Return BlocksEntity object.
|
|
69
69
|
*/
|
|
70
70
|
async getBlockByMarker(marker, langCode = this.state.lang) {
|
|
71
71
|
const response = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
72
|
-
const normalizeResponse = this._normalizeData(response
|
|
72
|
+
const normalizeResponse = this._normalizeData(response);
|
|
73
73
|
const customSettings = normalizeResponse.customSettings;
|
|
74
74
|
if (customSettings && customSettings.hasOwnProperty('productConfig')) {
|
|
75
75
|
normalizeResponse.countElementsPerRow = customSettings.productConfig.countElementsPerRow ? (+customSettings.productConfig.countElementsPerRow) : 0;
|
|
@@ -78,7 +78,7 @@ class BlocksApi extends asyncModules_1.default {
|
|
|
78
78
|
normalizeResponse.countElementsPerRow = 0;
|
|
79
79
|
}
|
|
80
80
|
delete normalizeResponse.customSettings;
|
|
81
|
-
delete normalizeResponse.
|
|
81
|
+
delete normalizeResponse.attributesSetIdentifier;
|
|
82
82
|
delete normalizeResponse.productPageUrls;
|
|
83
83
|
if (this.state.multipleResponse) {
|
|
84
84
|
if (normalizeResponse.type === 'forSimilarProductBlock') {
|
|
@@ -9,7 +9,7 @@ import { IProductsEntity } from "../products/productsInterfaces";
|
|
|
9
9
|
* @property {function} searchBlock - Quick search for block objects with limited output.
|
|
10
10
|
*/
|
|
11
11
|
interface IBlocks {
|
|
12
|
-
getBlocks(type: BlockType, langCode
|
|
12
|
+
getBlocks(type: BlockType, langCode?: string, offset?: number, limit?: number): Promise<Array<IBlockEntity | IBlocksResponse>>;
|
|
13
13
|
getBlockByMarker(marker: string, langCode: string): Promise<IBlockEntity>;
|
|
14
14
|
getSimilarProducts(marker: string, langCode?: string, offset?: number, limit?: number): Promise<Array<IProductsEntity>>;
|
|
15
15
|
getProductsByBlockMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<Array<IProductsEntity>>;
|
|
@@ -17,7 +17,7 @@ interface IBlocks {
|
|
|
17
17
|
}
|
|
18
18
|
interface IBlocksResponse {
|
|
19
19
|
id: number;
|
|
20
|
-
|
|
20
|
+
attributesSetIdentifier: string | null;
|
|
21
21
|
localizeInfos: Record<string, any>;
|
|
22
22
|
customSettings: ICustomSetting | null;
|
|
23
23
|
version: number;
|
|
@@ -17,14 +17,14 @@ interface IFormsData {
|
|
|
17
17
|
* @property {number} id - The unique identifier of the form page.
|
|
18
18
|
* @property {string} formIdentifier - The identifier of the page.
|
|
19
19
|
* @property {Date | string} time - The identifier of the form.
|
|
20
|
-
* @property {
|
|
20
|
+
* @property {IFormsPost} formData - The identifier of the position.
|
|
21
21
|
* @property {string} attributeSetIdentifier - Text identifier (marker) of the used attribute set.
|
|
22
22
|
*/
|
|
23
23
|
interface IFormsDataEntity {
|
|
24
24
|
id: number;
|
|
25
25
|
formIdentifier: string;
|
|
26
26
|
time: Date | string;
|
|
27
|
-
formData:
|
|
27
|
+
formData: IFormsPost;
|
|
28
28
|
attributeSetIdentifier?: string;
|
|
29
29
|
}
|
|
30
30
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,11 @@ interface IDefineApi {
|
|
|
47
47
|
* @param {IConfig} config - Custom configuration settings
|
|
48
48
|
* @param {string} [config.token] - Optional token parameter
|
|
49
49
|
* @param {string} [config.langCode] - Optional langCode parameter
|
|
50
|
+
* @param {boolean} [config.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.
|
|
51
|
+
* @param {string} [config.auth] - An object with authorization settings.
|
|
52
|
+
* @param {boolean} [config.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.
|
|
53
|
+
* @param {string} [config.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.
|
|
54
|
+
* @param {string} [config.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.
|
|
50
55
|
* @returns {IDefineApi} - List of methods set.
|
|
51
56
|
*/
|
|
52
57
|
export declare function defineOneEntry(url: string, config: IConfig): IDefineApi;
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,11 @@ const stateModule_1 = require("./base/stateModule");
|
|
|
28
28
|
* @param {IConfig} config - Custom configuration settings
|
|
29
29
|
* @param {string} [config.token] - Optional token parameter
|
|
30
30
|
* @param {string} [config.langCode] - Optional langCode parameter
|
|
31
|
+
* @param {boolean} [config.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.
|
|
32
|
+
* @param {string} [config.auth] - An object with authorization settings.
|
|
33
|
+
* @param {boolean} [config.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.
|
|
34
|
+
* @param {string} [config.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.
|
|
35
|
+
* @param {string} [config.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.
|
|
31
36
|
* @returns {IDefineApi} - List of methods set.
|
|
32
37
|
*/
|
|
33
38
|
function defineOneEntry(url, config) {
|
|
@@ -15,6 +15,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
15
15
|
* @param {IOrderData} data - Object for creating an order
|
|
16
16
|
* @param {String} langCode - Optional language field
|
|
17
17
|
*
|
|
18
|
+
* @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.
|
|
19
|
+
*
|
|
18
20
|
* @example
|
|
19
21
|
* const body = {
|
|
20
22
|
* "formIdentifier": "bar-orders-form",
|
|
@@ -37,6 +39,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
37
39
|
createOrder(marker: string, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity>;
|
|
38
40
|
/**
|
|
39
41
|
* Getting all order storage object by marker
|
|
42
|
+
*
|
|
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.
|
|
40
44
|
* @param {number} marker - Textual identifier of the order storage object
|
|
41
45
|
* @param {string} [langCode] Optional language field
|
|
42
46
|
* @param {number} [limit] Limit parameter. Default 30
|
|
@@ -45,6 +49,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
45
49
|
getAllOrdersByMarker(marker: string, langCode?: string, limit?: number, offset?: number): Promise<Array<IOrdersByMarkersEntity>>;
|
|
46
50
|
/**
|
|
47
51
|
* Changing an order in the order store
|
|
52
|
+
*
|
|
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.
|
|
48
54
|
* @param marker - The text identifier of the order storage object
|
|
49
55
|
* @param id - ID of the order object
|
|
50
56
|
* @param data Object for updating an order
|
|
@@ -71,6 +77,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
71
77
|
updateOrderByMarkerAndId(marker: string, id: number, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity>;
|
|
72
78
|
/**
|
|
73
79
|
* Getting all the order storage objects
|
|
80
|
+
* @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.
|
|
81
|
+
*
|
|
74
82
|
* @param {number} [langCode] Optional language field
|
|
75
83
|
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
76
84
|
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
@@ -79,6 +87,7 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
79
87
|
/**
|
|
80
88
|
* Retrieve one order storage object by marker.
|
|
81
89
|
*
|
|
90
|
+
* @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.
|
|
82
91
|
* @param {string} marker - Marker of the order object
|
|
83
92
|
* @param {string} [langCode] - Language code
|
|
84
93
|
*
|
package/dist/orders/ordersApi.js
CHANGED
|
@@ -16,6 +16,8 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
16
16
|
* @param {IOrderData} data - Object for creating an order
|
|
17
17
|
* @param {String} langCode - Optional language field
|
|
18
18
|
*
|
|
19
|
+
* @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.
|
|
20
|
+
*
|
|
19
21
|
* @example
|
|
20
22
|
* const body = {
|
|
21
23
|
* "formIdentifier": "bar-orders-form",
|
|
@@ -44,6 +46,8 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Getting all order storage object by marker
|
|
49
|
+
*
|
|
50
|
+
* @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.
|
|
47
51
|
* @param {number} marker - Textual identifier of the order storage object
|
|
48
52
|
* @param {string} [langCode] Optional language field
|
|
49
53
|
* @param {number} [limit] Limit parameter. Default 30
|
|
@@ -55,6 +59,8 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* Changing an order in the order store
|
|
62
|
+
*
|
|
63
|
+
* @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.
|
|
58
64
|
* @param marker - The text identifier of the order storage object
|
|
59
65
|
* @param id - ID of the order object
|
|
60
66
|
* @param data Object for updating an order
|
|
@@ -87,6 +93,8 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
87
93
|
}
|
|
88
94
|
/**
|
|
89
95
|
* Getting all the order storage objects
|
|
96
|
+
* @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.
|
|
97
|
+
*
|
|
90
98
|
* @param {number} [langCode] Optional language field
|
|
91
99
|
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
92
100
|
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
@@ -98,6 +106,7 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
98
106
|
/**
|
|
99
107
|
* Retrieve one order storage object by marker.
|
|
100
108
|
*
|
|
109
|
+
* @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.
|
|
101
110
|
* @param {string} marker - Marker of the order object
|
|
102
111
|
* @param {string} [langCode] - Language code
|
|
103
112
|
*
|
|
@@ -90,11 +90,12 @@ interface IOrdersEntity {
|
|
|
90
90
|
identifier: string | null;
|
|
91
91
|
generalTypeId: number | null;
|
|
92
92
|
formIdentifier: string | null;
|
|
93
|
-
paymentAccountIdentifiers: Array<
|
|
94
|
-
identifier: string;
|
|
95
|
-
}>;
|
|
93
|
+
paymentAccountIdentifiers: Array<IPaymentAccountIdentifiers>;
|
|
96
94
|
position: number | null;
|
|
97
95
|
}
|
|
96
|
+
interface IPaymentAccountIdentifiers {
|
|
97
|
+
identifier: string;
|
|
98
|
+
}
|
|
98
99
|
/**
|
|
99
100
|
* @interface
|
|
100
101
|
* @property {string} formIdentifier - Text identifier of the form object linked to the order repository.
|
|
@@ -130,10 +131,9 @@ interface IOrdersByMarkersEntity {
|
|
|
130
131
|
totalSum: string;
|
|
131
132
|
currency: string;
|
|
132
133
|
createdDate: string;
|
|
133
|
-
position: number;
|
|
134
134
|
paymentAccountIdentifier: string;
|
|
135
135
|
paymentAccountLocalizeInfos: Record<string, any>;
|
|
136
136
|
isHistory: boolean;
|
|
137
137
|
id: number;
|
|
138
138
|
}
|
|
139
|
-
export { IOrdersEntity, IBaseOrdersEntity, IOrderProducts, IPicture, IOrdersApi, IOrderData, IOrderProductData, IOrdersFormData, IOrdersByMarkersEntity };
|
|
139
|
+
export { IOrdersEntity, IBaseOrdersEntity, IOrderProducts, IPicture, IOrdersApi, IOrderData, IOrderProductData, IOrdersFormData, IOrdersByMarkersEntity, IPaymentAccountIdentifiers };
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -16,18 +16,6 @@ export default class PageApi extends AsyncModules implements IPageApi {
|
|
|
16
16
|
* @returns Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
17
17
|
*/
|
|
18
18
|
getRootPages(langCode?: string): Promise<Array<IPagesEntity>>;
|
|
19
|
-
/**
|
|
20
|
-
* Get all page objects with product information as an array.
|
|
21
|
-
*
|
|
22
|
-
* @param {string} [langCode] Required parameter lang code
|
|
23
|
-
*
|
|
24
|
-
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
25
|
-
*
|
|
26
|
-
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
27
|
-
*
|
|
28
|
-
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
29
|
-
*/
|
|
30
|
-
getCatalogPages(langCode?: string, limit?: number, offset?: number): Promise<Array<IPagesEntity>>;
|
|
31
19
|
/**
|
|
32
20
|
* Get all page objects with product information as an array.
|
|
33
21
|
*
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -21,21 +21,6 @@ class PageApi extends asyncModules_1.default {
|
|
|
21
21
|
const result = await this._fetchGet(`/root?langCode=${langCode}`);
|
|
22
22
|
return this._normalizeData(result, langCode);
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Get all page objects with product information as an array.
|
|
26
|
-
*
|
|
27
|
-
* @param {string} [langCode] Required parameter lang code
|
|
28
|
-
*
|
|
29
|
-
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
30
|
-
*
|
|
31
|
-
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
32
|
-
*
|
|
33
|
-
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
34
|
-
*/
|
|
35
|
-
async getCatalogPages(langCode = this.state.lang, limit = 30, offset = 0) {
|
|
36
|
-
const result = await this._fetchGet(`/catalog?langCode=${langCode}&limit=${limit}&offset=${offset}`);
|
|
37
|
-
return this._normalizeData(result, langCode);
|
|
38
|
-
}
|
|
39
24
|
/**
|
|
40
25
|
* Get all page objects with product information as an array.
|
|
41
26
|
*
|
|
@@ -120,7 +105,7 @@ class PageApi extends asyncModules_1.default {
|
|
|
120
105
|
item.countElementsPerRow = 0;
|
|
121
106
|
}
|
|
122
107
|
delete item.customSettings;
|
|
123
|
-
delete item.
|
|
108
|
+
delete item.attributesSetIdentifier;
|
|
124
109
|
return item;
|
|
125
110
|
});
|
|
126
111
|
if (this.state.multipleResponse) {
|
|
@@ -22,7 +22,6 @@ import { IAttributes, LangType, Types } from "../base/utils";
|
|
|
22
22
|
*/
|
|
23
23
|
interface IPageApi {
|
|
24
24
|
getRootPages(langCode?: LangType): Promise<Array<IPagesEntity>>;
|
|
25
|
-
getCatalogPages(langCode: LangType, limit: number, offset: number): Promise<Array<IPagesEntity>>;
|
|
26
25
|
getPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
27
26
|
getPageById(id: number, langCode: LangType): Promise<IPagesEntity>;
|
|
28
27
|
getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
@@ -80,6 +79,7 @@ interface IPositionForm {
|
|
|
80
79
|
* @property {number} position - The position of the object.
|
|
81
80
|
* @property {boolean} isSync - Indication of page indexing.
|
|
82
81
|
* @property {Record<string, any>} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
|
|
82
|
+
* @property {string} attributeSetIdentifier
|
|
83
83
|
* @property {Types} type - Page type.
|
|
84
84
|
*/
|
|
85
85
|
interface IPositionBlock {
|
|
@@ -91,6 +91,7 @@ interface IPositionBlock {
|
|
|
91
91
|
isSync: boolean;
|
|
92
92
|
isVisible: boolean;
|
|
93
93
|
attributeValues: Record<string, any>;
|
|
94
|
+
attributeSetIdentifier: string | null;
|
|
94
95
|
type: string;
|
|
95
96
|
templateIdentifier: string | null;
|
|
96
97
|
countElementsPerRow: number;
|
|
@@ -107,7 +108,7 @@ interface IPositionBlock {
|
|
|
107
108
|
* @property {Record<string, any>} localizeInfos - The name of the page, taking into account localization.
|
|
108
109
|
* @property {boolean} isVisible - A sign of page visibility.
|
|
109
110
|
* @property {number} products - The number of products linked to the page.
|
|
110
|
-
* @property {
|
|
111
|
+
* @property {string} attributeSetIdentifier - Set of attributes id.
|
|
111
112
|
* @property {boolean} isSync - Indication of page indexing.
|
|
112
113
|
* @property {string} templateIdentifier - User id of the linked template.
|
|
113
114
|
* @property {Record<string, any>} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
|
|
@@ -116,7 +117,7 @@ interface IPositionBlock {
|
|
|
116
117
|
* @property {number} childrenCount - Children count.
|
|
117
118
|
*/
|
|
118
119
|
interface IPagesEntity {
|
|
119
|
-
|
|
120
|
+
attributeSetIdentifier: string;
|
|
120
121
|
attributeValues: Record<string, any>;
|
|
121
122
|
childrenCount?: number;
|
|
122
123
|
config?: Record<string, number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AsyncModules from "../base/asyncModules";
|
|
2
|
-
import { IPaymentsApi, ISessionEntity, IConnectedEntity, IAccountsEntity } from "./paymentsInterfaces";
|
|
2
|
+
import { IPaymentsApi, ISessionEntity, IConnectedEntity, IAccountsEntity, ICreateSessionEntity } from "./paymentsInterfaces";
|
|
3
3
|
import StateModule from "../base/stateModule";
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with payments
|
|
@@ -11,6 +11,7 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
|
|
|
11
11
|
/**
|
|
12
12
|
* Get list of payment sessions.
|
|
13
13
|
*
|
|
14
|
+
* @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.
|
|
14
15
|
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
15
16
|
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
16
17
|
*
|
|
@@ -19,6 +20,7 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
|
|
|
19
20
|
getSessions(limit?: number, offset?: number): Promise<Array<ISessionEntity>>;
|
|
20
21
|
/**
|
|
21
22
|
* Get a single payment session object by its identifier.
|
|
23
|
+
* @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.
|
|
22
24
|
*
|
|
23
25
|
* @param {number} id - Identifier of the retrieved payment session object
|
|
24
26
|
*
|
|
@@ -27,6 +29,7 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
|
|
|
27
29
|
getSessionById(id: number): Promise<ISessionEntity>;
|
|
28
30
|
/**
|
|
29
31
|
* Creation of payment session.
|
|
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.
|
|
30
33
|
*
|
|
31
34
|
* @param {number} orderId - Order identifier
|
|
32
35
|
* @param {'session' | 'intent'} type - Session type
|
|
@@ -34,21 +37,24 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
|
|
|
34
37
|
*
|
|
35
38
|
* @returns Returns a single payment session object.
|
|
36
39
|
*/
|
|
37
|
-
createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<
|
|
40
|
+
createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ICreateSessionEntity>;
|
|
38
41
|
/**
|
|
39
42
|
* Get payment settings.
|
|
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.
|
|
40
44
|
*
|
|
41
45
|
* @returns Returns object PaymentsConnected or null.
|
|
42
46
|
*/
|
|
43
47
|
getConnected(): Promise<IConnectedEntity | null>;
|
|
44
48
|
/**
|
|
45
49
|
* Get all payment accounts as an array.
|
|
50
|
+
* @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.
|
|
46
51
|
*
|
|
47
52
|
* @returns Returns all created payment accounts as an array of PaymentAccountEntity objects.
|
|
48
53
|
*/
|
|
49
54
|
getAccounts(): Promise<Array<IAccountsEntity>>;
|
|
50
55
|
/**
|
|
51
56
|
* Get a single payment account object by its identifier.
|
|
57
|
+
* @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.
|
|
52
58
|
*
|
|
53
59
|
* @param {number} id - Identifier of the retrieved payment account object
|
|
54
60
|
*
|
|
@@ -57,6 +63,7 @@ export default class PaymentsApi extends AsyncModules implements IPaymentsApi {
|
|
|
57
63
|
getAccountById(id: number): Promise<IAccountsEntity>;
|
|
58
64
|
/**
|
|
59
65
|
* Webhook for Stripe.
|
|
66
|
+
* @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.
|
|
60
67
|
*
|
|
61
68
|
* @returns Returns true (in case of successful execution) or false (in case of unsuccessful execution)
|
|
62
69
|
*/
|
|
@@ -12,6 +12,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
12
12
|
/**
|
|
13
13
|
* Get list of payment sessions.
|
|
14
14
|
*
|
|
15
|
+
* @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.
|
|
15
16
|
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
16
17
|
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
17
18
|
*
|
|
@@ -23,6 +24,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Get a single payment session object by its identifier.
|
|
27
|
+
* @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.
|
|
26
28
|
*
|
|
27
29
|
* @param {number} id - Identifier of the retrieved payment session object
|
|
28
30
|
*
|
|
@@ -34,6 +36,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Creation of payment session.
|
|
39
|
+
* @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.
|
|
37
40
|
*
|
|
38
41
|
* @param {number} orderId - Order identifier
|
|
39
42
|
* @param {'session' | 'intent'} type - Session type
|
|
@@ -50,6 +53,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
50
53
|
}
|
|
51
54
|
/**
|
|
52
55
|
* Get payment settings.
|
|
56
|
+
* @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.
|
|
53
57
|
*
|
|
54
58
|
* @returns Returns object PaymentsConnected or null.
|
|
55
59
|
*/
|
|
@@ -59,6 +63,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
59
63
|
}
|
|
60
64
|
/**
|
|
61
65
|
* Get all payment accounts as an array.
|
|
66
|
+
* @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.
|
|
62
67
|
*
|
|
63
68
|
* @returns Returns all created payment accounts as an array of PaymentAccountEntity objects.
|
|
64
69
|
*/
|
|
@@ -68,6 +73,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
68
73
|
}
|
|
69
74
|
/**
|
|
70
75
|
* Get a single payment account object by its identifier.
|
|
76
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
71
77
|
*
|
|
72
78
|
* @param {number} id - Identifier of the retrieved payment account object
|
|
73
79
|
*
|
|
@@ -79,6 +85,7 @@ class PaymentsApi extends asyncModules_1.default {
|
|
|
79
85
|
}
|
|
80
86
|
/**
|
|
81
87
|
* Webhook for Stripe.
|
|
88
|
+
* @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.
|
|
82
89
|
*
|
|
83
90
|
* @returns Returns true (in case of successful execution) or false (in case of unsuccessful execution)
|
|
84
91
|
*/
|