oneentry 1.0.130 → 1.0.133
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 +2 -2
- package/dist/admins/adminsApi.js +2 -2
- package/dist/admins/adminsInterfaces.d.ts +4 -3
- package/dist/attribute-sets/attributeSetsApi.d.ts +0 -4
- package/dist/attribute-sets/attributeSetsApi.js +1 -5
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +43 -32
- package/dist/auth-provider/authProviderApi.d.ts +18 -9
- package/dist/auth-provider/authProviderApi.js +18 -9
- package/dist/auth-provider/authProvidersInterfaces.d.ts +36 -18
- package/dist/base/syncModules.js +7 -3
- package/dist/blocks/blocksApi.d.ts +0 -4
- package/dist/blocks/blocksApi.js +0 -4
- package/dist/blocks/blocksInterfaces.d.ts +25 -17
- package/dist/config.d.ts +1 -1
- package/dist/config.js +3 -1
- package/dist/events/eventsApi.d.ts +6 -3
- package/dist/events/eventsApi.js +6 -3
- package/dist/events/eventsInterfaces.d.ts +2 -1
- package/dist/file-uploading/fileUploadingApi.d.ts +14 -6
- package/dist/file-uploading/fileUploadingApi.js +22 -6
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +21 -13
- package/dist/forms/formsApi.d.ts +0 -2
- package/dist/forms/formsApi.js +0 -2
- package/dist/forms/formsInterfaces.d.ts +12 -3
- package/dist/forms-data/formsDataApi.d.ts +14 -20
- package/dist/forms-data/formsDataApi.js +17 -22
- package/dist/forms-data/formsDataInterfaces.d.ts +46 -37
- package/dist/integration-collections/integrationCollectionsApi.d.ts +10 -10
- package/dist/integration-collections/integrationCollectionsApi.js +10 -10
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +20 -10
- package/dist/menus/menusInterfaces.d.ts +13 -5
- package/dist/orders/ordersApi.d.ts +16 -8
- package/dist/orders/ordersApi.js +16 -8
- package/dist/orders/ordersInterfaces.d.ts +50 -30
- package/dist/pages/pagesApi.d.ts +2 -1
- package/dist/pages/pagesApi.js +2 -1
- package/dist/pages/pagesInterfaces.d.ts +29 -12
- package/dist/payments/paymentsApi.d.ts +20 -12
- package/dist/payments/paymentsApi.js +20 -12
- package/dist/payments/paymentsInterfaces.d.ts +25 -7
- package/dist/product-statuses/productStatusesInterfaces.d.ts +5 -4
- package/dist/products/productsApi.d.ts +28 -15
- package/dist/products/productsApi.js +28 -15
- package/dist/products/productsInterfaces.d.ts +53 -25
- package/dist/system/systemApi.d.ts +2 -1
- package/dist/system/systemApi.js +2 -1
- package/dist/templates/templatesInterfaces.d.ts +3 -2
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +8 -4
- package/dist/users/usersApi.d.ts +65 -14
- package/dist/users/usersApi.js +65 -14
- package/dist/users/usersInterfaces.d.ts +95 -26
- package/dist/web-socket/wsApi.d.ts +2 -1
- package/dist/web-socket/wsApi.js +2 -1
- package/dist/web-socket/wsInterfaces.d.ts +3 -2
- package/package.json +1 -1
|
@@ -23,7 +23,8 @@ export default class AdminsApi extends AsyncModules implements IAdmins {
|
|
|
23
23
|
/**
|
|
24
24
|
* Get all admins objects with filters.
|
|
25
25
|
* @handleName getAdminsInfo
|
|
26
|
-
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
26
|
+
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
27
|
+
* @example
|
|
27
28
|
[
|
|
28
29
|
{
|
|
29
30
|
"attributeMarker": "num",
|
|
@@ -44,7 +45,6 @@ export default class AdminsApi extends AsyncModules implements IAdmins {
|
|
|
44
45
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
45
46
|
* @returns {IAdminEntity[]} Returns an array of admin objects.
|
|
46
47
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
47
|
-
* @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
48
|
*/
|
|
49
49
|
getAdminsInfo(body?: AttributeType[], langCode?: string, offset?: number, limit?: number): Promise<IAdminEntity[] | IError>;
|
|
50
50
|
}
|
package/dist/admins/adminsApi.js
CHANGED
|
@@ -26,7 +26,8 @@ class AdminsApi extends asyncModules_1.default {
|
|
|
26
26
|
/**
|
|
27
27
|
* Get all admins objects with filters.
|
|
28
28
|
* @handleName getAdminsInfo
|
|
29
|
-
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
29
|
+
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
30
|
+
* @example
|
|
30
31
|
[
|
|
31
32
|
{
|
|
32
33
|
"attributeMarker": "num",
|
|
@@ -47,7 +48,6 @@ class AdminsApi extends asyncModules_1.default {
|
|
|
47
48
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
48
49
|
* @returns {IAdminEntity[]} Returns an array of admin objects.
|
|
49
50
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
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.
|
|
51
51
|
*/
|
|
52
52
|
async getAdminsInfo(body = [], langCode = this.state.lang, offset = 0, limit = 30) {
|
|
53
53
|
const query = {
|
|
@@ -8,7 +8,8 @@ interface IAdmins {
|
|
|
8
8
|
/**
|
|
9
9
|
* Get all admins objects with filters.
|
|
10
10
|
* @handleName getAdminsInfo
|
|
11
|
-
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
11
|
+
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
12
|
+
* @example
|
|
12
13
|
[
|
|
13
14
|
{
|
|
14
15
|
"attributeMarker": "num",
|
|
@@ -29,7 +30,6 @@ interface IAdmins {
|
|
|
29
30
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
30
31
|
* @returns {IAdminEntity[]} Returns an array of admin objects.
|
|
31
32
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
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
|
*/
|
|
34
34
|
getAdminsInfo(body: AttributeType[], langCode: string, offset: number, limit: number): Promise<IAdminEntity[] | IError>;
|
|
35
35
|
}
|
|
@@ -61,7 +61,8 @@ interface IPosition {
|
|
|
61
61
|
* @property {string | null} attributeSetIdentifier - The identifier of the attribute set. Example: "admins".
|
|
62
62
|
* @property {number | null} position - Position number (for sorting). Example: 1.
|
|
63
63
|
* @property {boolean} isSync - Page indexing flag (true or false). Example: true.
|
|
64
|
-
* @property {IAttributeValues} attributeValues - Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value).
|
|
64
|
+
* @property {IAttributeValues} attributeValues - Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value).
|
|
65
|
+
* @example
|
|
65
66
|
[
|
|
66
67
|
{
|
|
67
68
|
"marker": {
|
|
@@ -30,7 +30,6 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
30
30
|
* @param {string} [sortBy] - identifier of the attribute set type. Default: "id".
|
|
31
31
|
* @returns {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
|
|
32
32
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
33
|
-
* @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.
|
|
34
33
|
*/
|
|
35
34
|
getAttributes(langCode?: string, offset?: number, limit?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponse | IError>;
|
|
36
35
|
/**
|
|
@@ -40,7 +39,6 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
40
39
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
41
40
|
* @returns {IAttributeSetsEntity[]} Returns an array of Attributes objects.
|
|
42
41
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
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
42
|
*/
|
|
45
43
|
getAttributesByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity[] | IError>;
|
|
46
44
|
/**
|
|
@@ -51,7 +49,6 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
51
49
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
52
50
|
* @returns {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
|
|
53
51
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
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
52
|
*/
|
|
56
53
|
getSingleAttributeByMarkerSet(setMarker: string, attributeMarker: string, langCode?: string): Promise<IAttributesSetsEntity | IError>;
|
|
57
54
|
/**
|
|
@@ -61,7 +58,6 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
61
58
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
62
59
|
* @returns {IAttributeSetsEntity} Returns one object of the attribute set.
|
|
63
60
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
64
|
-
* @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.
|
|
65
61
|
*/
|
|
66
62
|
getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
|
|
67
63
|
}
|
|
@@ -33,7 +33,6 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
33
33
|
* @param {string} [sortBy] - identifier of the attribute set type. Default: "id".
|
|
34
34
|
* @returns {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
|
|
35
35
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
36
|
-
* @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
36
|
*/
|
|
38
37
|
async getAttributes(langCode = this.state.lang, offset = 0, limit = 30,
|
|
39
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -56,7 +55,6 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
56
55
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
57
56
|
* @returns {IAttributeSetsEntity[]} Returns an array of Attributes objects.
|
|
58
57
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
59
|
-
* @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
58
|
*/
|
|
61
59
|
async getAttributesByMarker(marker, langCode = this.state.lang) {
|
|
62
60
|
const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
|
|
@@ -70,11 +68,10 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
70
68
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
71
69
|
* @returns {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
|
|
72
70
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
73
|
-
* @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.
|
|
74
71
|
*/
|
|
75
72
|
async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
|
|
76
73
|
const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
|
|
77
|
-
return result;
|
|
74
|
+
return this._dataPostProcess(result, langCode);
|
|
78
75
|
}
|
|
79
76
|
/**
|
|
80
77
|
* Getting a single object from a set of attributes by marker.
|
|
@@ -83,7 +80,6 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
83
80
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
84
81
|
* @returns {IAttributeSetsEntity} Returns one object of the attribute set.
|
|
85
82
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
86
|
-
* @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.
|
|
87
83
|
*/
|
|
88
84
|
async getAttributeSetByMarker(marker, langCode = this.state.lang) {
|
|
89
85
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
@@ -62,33 +62,36 @@ type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' |
|
|
|
62
62
|
* @property {any} [value] - Value of the attribute, which can be of any type.
|
|
63
63
|
* @property {string} marker - Textual identifier of the attribute (marker). Example: "color", "size", "etc".
|
|
64
64
|
* @property {number} position - Position number for sorting. Example: 1.
|
|
65
|
-
* @property {IListTitle[] | Record<string, any>} [listTitles] - Array of values (with extended data) for list and radioButton attributes.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
65
|
+
* @property {IListTitle[] | Record<string, any>} [listTitles] - Array of values (with extended data) for list and radioButton attributes.
|
|
66
|
+
* @example
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
"title": "red",
|
|
70
|
+
"value": 1,
|
|
71
|
+
"position": 1,
|
|
72
|
+
"extendedValue": null,
|
|
73
|
+
"extendedValueType": null
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"title": "yellow",
|
|
77
|
+
"value": 2,
|
|
78
|
+
"position": 2,
|
|
79
|
+
"extendedValue": null,
|
|
80
|
+
"extendedValueType": null
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
* @property {Record<string, any>} [validators] - Set of validators for validation.
|
|
84
|
+
* @example
|
|
85
|
+
{
|
|
86
|
+
"requiredValidator": {
|
|
87
|
+
"strict": true
|
|
88
|
+
},
|
|
89
|
+
"defaultValueValidator": {
|
|
90
|
+
"fieldDefaultValue": 11
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
* @property {ILocalizeInfo} localizeInfos - The name of the template, taking into account localization.
|
|
94
|
+
* @example
|
|
92
95
|
{
|
|
93
96
|
"title": "My attribute"
|
|
94
97
|
}
|
|
@@ -99,6 +102,7 @@ type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' |
|
|
|
99
102
|
interface IAttributesSetsEntity {
|
|
100
103
|
type: AttributeType;
|
|
101
104
|
value?: any;
|
|
105
|
+
initialValue: any;
|
|
102
106
|
marker: string;
|
|
103
107
|
position: number;
|
|
104
108
|
listTitles?: IListTitle[] | Record<string, any>;
|
|
@@ -116,7 +120,8 @@ interface IAttributesSetsEntity {
|
|
|
116
120
|
* @property {string} identifier - A string that uniquely identifies the attribute set. Example: "attributeSet1".
|
|
117
121
|
* @property {number} typeId - The numerical identifier representing the type of the attribute set. Example: 1.
|
|
118
122
|
* @property {string} title - The title or name of the attribute set. Example: "Product Attributes".
|
|
119
|
-
* @property {object} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data.
|
|
123
|
+
* @property {object} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data.
|
|
124
|
+
* @example
|
|
120
125
|
{
|
|
121
126
|
"attribute1": {
|
|
122
127
|
"id": 1,
|
|
@@ -130,7 +135,8 @@ interface IAttributesSetsEntity {
|
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
137
|
* @property {boolean} isVisible - Indicates whether the attribute set is visible or not. Example: true.
|
|
133
|
-
* @property {object} properties - Additional properties associated with the attribute set, which can be of any type.
|
|
138
|
+
* @property {object} properties - Additional properties associated with the attribute set, which can be of any type.
|
|
139
|
+
* @example
|
|
134
140
|
{
|
|
135
141
|
"color": "red",
|
|
136
142
|
"size": "M"
|
|
@@ -141,6 +147,7 @@ interface IAttributesSetsEntity {
|
|
|
141
147
|
*/
|
|
142
148
|
interface IAttributeSetsEntity {
|
|
143
149
|
id: number;
|
|
150
|
+
createdDate: string;
|
|
144
151
|
updatedDate: string;
|
|
145
152
|
version: number;
|
|
146
153
|
identifier: string;
|
|
@@ -149,15 +156,19 @@ interface IAttributeSetsEntity {
|
|
|
149
156
|
schema: object;
|
|
150
157
|
isVisible: boolean;
|
|
151
158
|
properties: object;
|
|
152
|
-
type:
|
|
159
|
+
type: {
|
|
160
|
+
id: number;
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
153
163
|
position: number;
|
|
154
164
|
}
|
|
155
165
|
/**
|
|
156
166
|
* Represents the response structure for attribute sets.
|
|
157
167
|
* @interface IAttributesSetsResponse
|
|
158
168
|
* @property {number} total - Total items. Example: 100.
|
|
159
|
-
* @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities.
|
|
160
|
-
|
|
169
|
+
* @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities.
|
|
170
|
+
* @example
|
|
171
|
+
[
|
|
161
172
|
{
|
|
162
173
|
"id": 1,
|
|
163
174
|
"identifier": "set1"
|
|
@@ -21,7 +21,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
21
21
|
* User registration.
|
|
22
22
|
* @handleName signUp
|
|
23
23
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
24
|
-
* @param {ISignUpData} body - Request body.
|
|
24
|
+
* @param {ISignUpData} body - Request body.
|
|
25
|
+
* @example
|
|
25
26
|
{
|
|
26
27
|
"formIdentifier": "reg",
|
|
27
28
|
"authData": [
|
|
@@ -48,7 +49,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
* @param {string} body.formIdentifier - The identifier for the registration form. Example: "reg".
|
|
51
|
-
* @param {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
52
|
+
* @param {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
53
|
+
* @example
|
|
52
54
|
[
|
|
53
55
|
{
|
|
54
56
|
"marker": "login",
|
|
@@ -59,13 +61,15 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
59
61
|
"value": "12345"
|
|
60
62
|
}
|
|
61
63
|
]
|
|
62
|
-
* @param {IAuthFormData} body.formData - The form data for the registration, which can be a single object or an array of objects.
|
|
64
|
+
* @param {IAuthFormData} body.formData - The form data for the registration, which can be a single object or an array of objects.
|
|
65
|
+
* @example
|
|
63
66
|
{
|
|
64
67
|
"marker": "last_name",
|
|
65
68
|
"type": "string",
|
|
66
69
|
"value": "Name"
|
|
67
70
|
}
|
|
68
|
-
* @param {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
71
|
+
* @param {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
72
|
+
* @example
|
|
69
73
|
{
|
|
70
74
|
"email": "example@oneentry.cloud",
|
|
71
75
|
"phonePush": ["+99999999999"],
|
|
@@ -115,7 +119,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
115
119
|
* User authorization.
|
|
116
120
|
* @handleName auth
|
|
117
121
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
118
|
-
* @param {IAuthPostBody} body - Objects contains auth information.
|
|
122
|
+
* @param {IAuthPostBody} body - Objects contains auth information.
|
|
123
|
+
* @example
|
|
119
124
|
{
|
|
120
125
|
"authData": [
|
|
121
126
|
{
|
|
@@ -128,7 +133,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
128
133
|
}
|
|
129
134
|
]
|
|
130
135
|
}
|
|
131
|
-
* @param {{ marker: string; value: string | number }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
136
|
+
* @param {{ marker: string; value: string | number }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
137
|
+
* @example
|
|
132
138
|
[
|
|
133
139
|
{
|
|
134
140
|
"marker": "login",
|
|
@@ -159,7 +165,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
159
165
|
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
160
166
|
* @returns {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
161
167
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
162
|
-
* @description This method requires user authorization.
|
|
168
|
+
* @description This method requires user authorization.
|
|
169
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
163
170
|
*/
|
|
164
171
|
logout(marker: string, token: string): Promise<boolean | IError>;
|
|
165
172
|
/**
|
|
@@ -168,7 +175,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
168
175
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
169
176
|
* @returns {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
170
177
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
171
|
-
* @description This method requires user authorization.
|
|
178
|
+
* @description This method requires user authorization.
|
|
179
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
172
180
|
*/
|
|
173
181
|
logoutAll(marker: string): Promise<boolean | IError>;
|
|
174
182
|
/**
|
|
@@ -220,7 +228,8 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
220
228
|
* User registration (authorization) via OAUTH.
|
|
221
229
|
* @handleName oauthSignUp
|
|
222
230
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
223
|
-
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration.
|
|
231
|
+
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration.
|
|
232
|
+
* @example
|
|
224
233
|
{
|
|
225
234
|
"client_id": "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com",
|
|
226
235
|
"client_secret": "43434343434",
|
|
@@ -25,7 +25,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
25
25
|
* User registration.
|
|
26
26
|
* @handleName signUp
|
|
27
27
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
28
|
-
* @param {ISignUpData} body - Request body.
|
|
28
|
+
* @param {ISignUpData} body - Request body.
|
|
29
|
+
* @example
|
|
29
30
|
{
|
|
30
31
|
"formIdentifier": "reg",
|
|
31
32
|
"authData": [
|
|
@@ -52,7 +53,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
* @param {string} body.formIdentifier - The identifier for the registration form. Example: "reg".
|
|
55
|
-
* @param {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
56
|
+
* @param {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
57
|
+
* @example
|
|
56
58
|
[
|
|
57
59
|
{
|
|
58
60
|
"marker": "login",
|
|
@@ -63,13 +65,15 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
63
65
|
"value": "12345"
|
|
64
66
|
}
|
|
65
67
|
]
|
|
66
|
-
* @param {IAuthFormData} body.formData - The form data for the registration, which can be a single object or an array of objects.
|
|
68
|
+
* @param {IAuthFormData} body.formData - The form data for the registration, which can be a single object or an array of objects.
|
|
69
|
+
* @example
|
|
67
70
|
{
|
|
68
71
|
"marker": "last_name",
|
|
69
72
|
"type": "string",
|
|
70
73
|
"value": "Name"
|
|
71
74
|
}
|
|
72
|
-
* @param {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
75
|
+
* @param {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
76
|
+
* @example
|
|
73
77
|
{
|
|
74
78
|
"email": "example@oneentry.cloud",
|
|
75
79
|
"phonePush": ["+99999999999"],
|
|
@@ -145,7 +149,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
145
149
|
* User authorization.
|
|
146
150
|
* @handleName auth
|
|
147
151
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
148
|
-
* @param {IAuthPostBody} body - Objects contains auth information.
|
|
152
|
+
* @param {IAuthPostBody} body - Objects contains auth information.
|
|
153
|
+
* @example
|
|
149
154
|
{
|
|
150
155
|
"authData": [
|
|
151
156
|
{
|
|
@@ -158,7 +163,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
158
163
|
}
|
|
159
164
|
]
|
|
160
165
|
}
|
|
161
|
-
* @param {{ marker: string; value: string | number }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
166
|
+
* @param {{ marker: string; value: string | number }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
167
|
+
* @example
|
|
162
168
|
[
|
|
163
169
|
{
|
|
164
170
|
"marker": "login",
|
|
@@ -207,7 +213,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
207
213
|
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
208
214
|
* @returns {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
209
215
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
210
|
-
* @description This method requires user authorization.
|
|
216
|
+
* @description This method requires user authorization.
|
|
217
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
211
218
|
*/
|
|
212
219
|
async logout(marker, token) {
|
|
213
220
|
const data = {
|
|
@@ -229,7 +236,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
229
236
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
230
237
|
* @returns {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
231
238
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
232
|
-
* @description This method requires user authorization.
|
|
239
|
+
* @description This method requires user authorization.
|
|
240
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
233
241
|
*/
|
|
234
242
|
async logoutAll(marker) {
|
|
235
243
|
const result = await this._fetchPost(`/marker/${marker}/users/logout-all`);
|
|
@@ -311,7 +319,8 @@ class AuthProviderApi extends asyncModules_1.default {
|
|
|
311
319
|
* User registration (authorization) via OAUTH.
|
|
312
320
|
* @handleName oauthSignUp
|
|
313
321
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
314
|
-
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration.
|
|
322
|
+
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration.
|
|
323
|
+
* @example
|
|
315
324
|
{
|
|
316
325
|
"client_id": "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com",
|
|
317
326
|
"client_secret": "43434343434",
|
|
@@ -21,7 +21,8 @@ interface IAuthProvider {
|
|
|
21
21
|
* Registers a new user.
|
|
22
22
|
* @handleName signUp
|
|
23
23
|
* @param {string} marker - The marker identifying the auth provider. Example: "email".
|
|
24
|
-
* @param {ISignUpData} data - The data required for user registration.
|
|
24
|
+
* @param {ISignUpData} data - The data required for user registration.
|
|
25
|
+
* @example
|
|
25
26
|
{
|
|
26
27
|
"formIdentifier": "reg",
|
|
27
28
|
"authData": [
|
|
@@ -175,7 +176,8 @@ interface IAuthProvider {
|
|
|
175
176
|
* User registration (authorization) via OAUTH.
|
|
176
177
|
* @handleName oauthSignUp
|
|
177
178
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
178
|
-
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration.
|
|
179
|
+
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration.
|
|
180
|
+
* @example
|
|
179
181
|
{
|
|
180
182
|
"client_id": "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com",
|
|
181
183
|
"client_secret": "43434343434",
|
|
@@ -207,7 +209,8 @@ interface IAuthFormData {
|
|
|
207
209
|
* Interface representing the data required for user registration.
|
|
208
210
|
* @interface ISignUpData
|
|
209
211
|
* @property {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
210
|
-
* @property {ISignUpData} body - Request body.
|
|
212
|
+
* @property {ISignUpData} body - Request body.
|
|
213
|
+
* @example
|
|
211
214
|
{
|
|
212
215
|
"formIdentifier": "reg",
|
|
213
216
|
"authData": [
|
|
@@ -234,7 +237,8 @@ interface IAuthFormData {
|
|
|
234
237
|
}
|
|
235
238
|
}
|
|
236
239
|
* @property {string} body.formIdentifier - The identifier for the registration form. Example: "reg".
|
|
237
|
-
* @property {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
240
|
+
* @property {{ marker: string; value: string }[]} body.authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
241
|
+
* @example
|
|
238
242
|
[
|
|
239
243
|
{
|
|
240
244
|
"marker": "login",
|
|
@@ -245,13 +249,15 @@ interface IAuthFormData {
|
|
|
245
249
|
"value": "12345"
|
|
246
250
|
}
|
|
247
251
|
]
|
|
248
|
-
* @property {IAuthFormData | IAuthFormData[]} body.formData - The form data for the registration, which can be a single object or an array of objects.
|
|
252
|
+
* @property {IAuthFormData | IAuthFormData[]} body.formData - The form data for the registration, which can be a single object or an array of objects.
|
|
253
|
+
* @example
|
|
249
254
|
{
|
|
250
255
|
"marker": "last_name",
|
|
251
256
|
"type": "string",
|
|
252
257
|
"value": "Name"
|
|
253
258
|
}
|
|
254
|
-
* @property {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
259
|
+
* @property {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
260
|
+
* @example
|
|
255
261
|
{
|
|
256
262
|
"email": "example@oneentry.cloud",
|
|
257
263
|
"phonePush": ["+99999999999"],
|
|
@@ -299,7 +305,8 @@ interface IOAuthSignUpData {
|
|
|
299
305
|
* @property {number} version - The version number of the sign-up entity. Example: 1.
|
|
300
306
|
* @property {string} identifier - A unique string that identifies the sign-up entity. Example: "signup_12345".
|
|
301
307
|
* @property {boolean} isActive - Indicates whether the sign-up entity is active. Example: true.
|
|
302
|
-
* @property {{ marker: string; value: string }[]} formData - An array of objects representing the form data, each containing a marker and its corresponding value.
|
|
308
|
+
* @property {{ marker: string; value: string }[]} formData - An array of objects representing the form data, each containing a marker and its corresponding value.
|
|
309
|
+
* @example
|
|
303
310
|
[
|
|
304
311
|
{
|
|
305
312
|
"marker": "first_name",
|
|
@@ -310,7 +317,8 @@ interface IOAuthSignUpData {
|
|
|
310
317
|
"value": "Doe"
|
|
311
318
|
}
|
|
312
319
|
]
|
|
313
|
-
* @property {object} notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
320
|
+
* @property {object} notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
|
|
321
|
+
* @example
|
|
314
322
|
{
|
|
315
323
|
"email": "example@oneentry.cloud",
|
|
316
324
|
"phonePush": ["+99999999999"],
|
|
@@ -366,8 +374,16 @@ interface IAuthEntity {
|
|
|
366
374
|
* Interface representing an authentication provider entity.
|
|
367
375
|
* @interface IAuthProvidersEntity
|
|
368
376
|
* @property {number} id - The unique identifier of the auth provider entity. Example: 194.
|
|
369
|
-
* @property {ILocalizeInfo} localizeInfos - Localized information for the auth provider.
|
|
370
|
-
* @
|
|
377
|
+
* @property {ILocalizeInfo} localizeInfos - Localized information for the auth provider.
|
|
378
|
+
* @example
|
|
379
|
+
{
|
|
380
|
+
"key": "value"
|
|
381
|
+
}
|
|
382
|
+
* @property {IAuthProvidersEntityConfig} config - Configuration settings for the auth provider, stored as a key-value pair object.
|
|
383
|
+
* @example
|
|
384
|
+
{
|
|
385
|
+
"key": "value"
|
|
386
|
+
}
|
|
371
387
|
* @property {number} version - The version number of the auth provider entity. Example: 1.
|
|
372
388
|
* @property {string} identifier - A unique string that identifies the auth provider. Example: "email".
|
|
373
389
|
* @property {string} type - The type of the auth provider (e.g., 'email', 'google', etc.). Example: "email".
|
|
@@ -392,12 +408,12 @@ interface IAuthProvidersEntity {
|
|
|
392
408
|
/**
|
|
393
409
|
* Interface representing an authentication provider config.
|
|
394
410
|
* @interface IAuthProvidersEntityConfig
|
|
395
|
-
* @property {string} accessTokenTtlSec - Access token time to live in seconds.
|
|
396
|
-
* @property {string} refreshTokenTtlMc - Refresh token time to live in milliseconds.
|
|
397
|
-
* @property {string} tokenSecretKey - Token secret key.
|
|
398
|
-
* @property {string} deleteNoneActiveUsersAfterDays - Delete none active users after days.
|
|
399
|
-
* @property {string} systemCodeTlsSec - System code time to live in seconds.
|
|
400
|
-
* @property {string} systemCodeLength - System code length.
|
|
411
|
+
* @property {string} accessTokenTtlSec - Access token time to live in seconds. Example: "3600".
|
|
412
|
+
* @property {string} refreshTokenTtlMc - Refresh token time to live in milliseconds. Example: "86400000".
|
|
413
|
+
* @property {string} tokenSecretKey - Token secret key. Example: "secret_key".
|
|
414
|
+
* @property {string} deleteNoneActiveUsersAfterDays - Delete none active users after days. Example: "30".
|
|
415
|
+
* @property {string} systemCodeTlsSec - System code time to live in seconds. Example: "86400".
|
|
416
|
+
* @property {string} systemCodeLength - System code length. Example: "6".
|
|
401
417
|
*/
|
|
402
418
|
interface IAuthProvidersEntityConfig {
|
|
403
419
|
accessTokenTtlSec: string;
|
|
@@ -410,7 +426,8 @@ interface IAuthProvidersEntityConfig {
|
|
|
410
426
|
/**
|
|
411
427
|
* Interface representing the body used in authentication requests.
|
|
412
428
|
* @interface IAuthPostBody
|
|
413
|
-
* @property {{ marker: string; value: string | number }[]} authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
429
|
+
* @property {{ marker: string; value: string | number }[]} authData - An array of authentication data objects, each containing a marker and its corresponding value.
|
|
430
|
+
* @example
|
|
414
431
|
[
|
|
415
432
|
{
|
|
416
433
|
"marker": "login",
|
|
@@ -428,7 +445,8 @@ interface IAuthPostBody {
|
|
|
428
445
|
/**
|
|
429
446
|
* Interface representing the active session data.
|
|
430
447
|
* @interface IActiveSession
|
|
431
|
-
* @property {object} deviceInfo - Information about the device used in the active session.
|
|
448
|
+
* @property {object} deviceInfo - Information about the device used in the active session.
|
|
449
|
+
* @example
|
|
432
450
|
{
|
|
433
451
|
"os": "Win32",
|
|
434
452
|
"browser": "Node.js/22",
|
package/dist/base/syncModules.js
CHANGED
|
@@ -270,7 +270,8 @@ class SyncModules {
|
|
|
270
270
|
const d = data.attributeValues[attr];
|
|
271
271
|
// normalize numbers
|
|
272
272
|
if (d.type === 'integer' || d.type === 'float') {
|
|
273
|
-
|
|
273
|
+
const numValue = Number(d.value);
|
|
274
|
+
d.value = isNaN(numValue) ? null : numValue;
|
|
274
275
|
}
|
|
275
276
|
// add timeIntervals
|
|
276
277
|
if (data.attributeValues[attr].type === 'timeInterval') {
|
|
@@ -290,10 +291,12 @@ class SyncModules {
|
|
|
290
291
|
// for forms attributes
|
|
291
292
|
if ('attributes' in data) {
|
|
292
293
|
const d = data.attributes;
|
|
294
|
+
// console.log('Schedules:: ', JSON.stringify(d));
|
|
293
295
|
for (const attr in d) {
|
|
294
296
|
// Normalize numbers
|
|
295
297
|
if (d[attr].type === 'integer' || d[attr].type === 'float') {
|
|
296
|
-
|
|
298
|
+
const numValue = Number(d[attr].value);
|
|
299
|
+
d[attr].value = isNaN(numValue) ? null : numValue;
|
|
297
300
|
}
|
|
298
301
|
// Add time intervals
|
|
299
302
|
if (d[attr].type === 'timeInterval') {
|
|
@@ -309,8 +312,9 @@ class SyncModules {
|
|
|
309
312
|
}
|
|
310
313
|
// !!! For single attribute
|
|
311
314
|
if ('attributes' in data) {
|
|
312
|
-
//
|
|
315
|
+
// console.log('Schedules:: ', JSON.stringify(data));
|
|
313
316
|
}
|
|
317
|
+
// console.log('Schedules:: ', JSON.stringify(data));
|
|
314
318
|
return data;
|
|
315
319
|
}
|
|
316
320
|
/**
|
|
@@ -26,7 +26,6 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
26
26
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
27
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
|
-
* @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
29
|
*/
|
|
31
30
|
getBlocks(type?: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse | IError>;
|
|
32
31
|
/**
|
|
@@ -50,7 +49,6 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
50
49
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
51
50
|
* @returns {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
|
|
52
51
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
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
52
|
*/
|
|
55
53
|
private getSimilarProducts;
|
|
56
54
|
/**
|
|
@@ -62,7 +60,6 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
62
60
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
63
61
|
* @returns {IProductsEntity[]} Return array of BlocksEntity object.
|
|
64
62
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
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
63
|
*/
|
|
67
64
|
private getProductsByBlockMarker;
|
|
68
65
|
/**
|
|
@@ -72,7 +69,6 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
|
|
|
72
69
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
73
70
|
* @returns {ISearchBlock[]} Returns an array of ISearchBlock objects.
|
|
74
71
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
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
72
|
*/
|
|
77
73
|
searchBlock(name: string, langCode?: string): Promise<ISearchBlock[] | IError>;
|
|
78
74
|
}
|