oneentry 1.0.126 → 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/README.md +0 -2
- package/configure.js +25 -18
- package/dist/admins/adminsApi.d.ts +18 -13
- package/dist/admins/adminsApi.js +18 -13
- package/dist/admins/adminsInterfaces.d.ts +16 -25
- package/dist/attribute-sets/attributeSetsApi.d.ts +14 -15
- package/dist/attribute-sets/attributeSetsApi.js +14 -15
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +78 -84
- package/dist/auth-provider/authProviderApi.d.ts +53 -79
- package/dist/auth-provider/authProviderApi.js +52 -78
- package/dist/auth-provider/authProvidersInterfaces.d.ts +98 -94
- package/dist/base/asyncModules.d.ts +23 -21
- package/dist/base/asyncModules.js +39 -29
- package/dist/base/result.d.ts +31 -0
- package/dist/base/result.js +32 -5
- package/dist/base/stateModule.d.ts +10 -0
- package/dist/base/stateModule.js +50 -2
- package/dist/base/syncModules.d.ts +42 -50
- package/dist/base/syncModules.js +106 -58
- package/dist/base/utils.d.ts +33 -2
- package/dist/blocks/blocksApi.d.ts +9 -18
- package/dist/blocks/blocksApi.js +9 -18
- package/dist/blocks/blocksInterfaces.d.ts +41 -46
- package/dist/config.d.ts +13 -0
- package/dist/config.js +30 -0
- package/dist/events/eventsApi.d.ts +10 -27
- package/dist/events/eventsApi.js +26 -40
- package/dist/events/eventsInterfaces.d.ts +33 -28
- package/dist/file-uploading/fileUploadingApi.d.ts +12 -17
- package/dist/file-uploading/fileUploadingApi.js +14 -17
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +8 -19
- package/dist/forms/formsApi.d.ts +10 -9
- package/dist/forms/formsApi.js +10 -9
- package/dist/forms/formsInterfaces.d.ts +20 -12
- package/dist/forms-data/formsDataApi.d.ts +24 -28
- package/dist/forms-data/formsDataApi.js +25 -28
- package/dist/forms-data/formsDataInterfaces.d.ts +71 -71
- package/dist/general-types/generalTypesApi.d.ts +5 -5
- package/dist/general-types/generalTypesApi.js +5 -5
- package/dist/general-types/generalTypesInterfaces.d.ts +5 -8
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/dist/integration-collections/integrationCollectionsApi.d.ts +29 -47
- package/dist/integration-collections/integrationCollectionsApi.js +31 -51
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +62 -58
- package/dist/locales/localesApi.d.ts +7 -3
- package/dist/locales/localesApi.js +7 -3
- package/dist/locales/localesInterfaces.d.ts +6 -5
- package/dist/menus/menusApi.d.ts +7 -3
- package/dist/menus/menusApi.js +7 -3
- package/dist/menus/menusInterfaces.d.ts +5 -10
- package/dist/menus/menusInterfaces.js +1 -0
- package/dist/orders/ordersApi.d.ts +17 -25
- package/dist/orders/ordersApi.js +17 -26
- package/dist/orders/ordersInterfaces.d.ts +94 -53
- package/dist/pages/pagesApi.d.ts +47 -60
- package/dist/pages/pagesApi.js +51 -61
- package/dist/pages/pagesInterfaces.d.ts +44 -48
- package/dist/payments/paymentsApi.d.ts +17 -27
- package/dist/payments/paymentsApi.js +17 -31
- package/dist/payments/paymentsInterfaces.d.ts +35 -29
- package/dist/product-statuses/productStatusesApi.d.ts +9 -9
- package/dist/product-statuses/productStatusesApi.js +9 -9
- package/dist/product-statuses/productStatusesInterfaces.d.ts +14 -12
- package/dist/products/productsApi.d.ts +23 -44
- package/dist/products/productsApi.js +24 -44
- package/dist/products/productsInterfaces.d.ts +51 -57
- package/dist/system/systemApi.d.ts +11 -13
- package/dist/system/systemApi.js +12 -13
- package/dist/system/systemInterfaces.d.ts +14 -3
- package/dist/templates/templatesApi.d.ts +8 -11
- package/dist/templates/templatesApi.js +8 -11
- package/dist/templates/templatesInterfaces.d.ts +13 -12
- package/dist/templates-preview/templatesPreviewApi.d.ts +7 -8
- package/dist/templates-preview/templatesPreviewApi.js +7 -8
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +15 -18
- package/dist/users/usersApi.d.ts +13 -20
- package/dist/users/usersApi.js +13 -20
- package/dist/users/usersInterfaces.d.ts +26 -30
- package/dist/web-socket/wsApi.d.ts +5 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +7 -2
- package/package.json +16 -12
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
|
+
* Interface for retrieving attributes based on markers and language codes.
|
|
3
4
|
* @interface IAttributesSets
|
|
4
|
-
*
|
|
5
|
-
* @property {
|
|
6
|
-
* @property {function} getSingleAttributeByMarkerSet - Get a single attribute with data from the attribute sets.
|
|
7
|
-
*
|
|
5
|
+
* @property {Function} getAttributesByMarker - Get all attributes with data from the attribute sets.
|
|
6
|
+
* @property {Function} getSingleAttributeByMarkerSet - Get a single attribute with data from the attribute sets.
|
|
8
7
|
* @description This interface defines methods for retrieving attributes based on markers and language codes.
|
|
9
8
|
*/
|
|
10
9
|
interface IAttributesSets {
|
|
11
10
|
/**
|
|
12
11
|
* Fetches attributes by a specific marker.
|
|
13
|
-
*
|
|
12
|
+
* @handleName getAttributesByMarker
|
|
14
13
|
* @param {string} marker - The marker used to identify the attribute set. Example: "productAttributes".
|
|
15
14
|
* @param {string} [langCode] - The language code for localization purposes. Default: 'en_US'.
|
|
16
15
|
* @returns {IAttributeSetsEntity[]} A promise that resolves to an array of attribute set entities or an error.
|
|
17
16
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
17
|
+
* @description This method fetches attributes by a specific marker.
|
|
18
18
|
*/
|
|
19
19
|
getAttributesByMarker(marker: string, langCode: string): Promise<IAttributeSetsEntity[] | IError>;
|
|
20
20
|
/**
|
|
21
21
|
* Fetches a single attribute by its marker and the set marker.
|
|
22
|
-
*
|
|
22
|
+
* @handleName getSingleAttributeByMarkerSet
|
|
23
23
|
* @param {string} attributeMarker - The marker identifying the attribute. Example: "color".
|
|
24
24
|
* @param {string} setMarker - The marker identifying the attribute set. Example: "productAttributes".
|
|
25
25
|
* @param {string} [langCode] - The language code for localization purposes. Default: "en_US".
|
|
26
26
|
* @returns {IAttributesSetsEntity} A promise that resolves to an attribute set entity or an error.
|
|
27
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
|
+
* @description This method fetches a single attribute by its marker and the set marker.
|
|
27
29
|
*/
|
|
28
30
|
getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity | IError>;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
+
* Represents the structure of a list item.
|
|
33
34
|
* @interface IListTitle
|
|
34
|
-
*
|
|
35
35
|
* @property {string} title - The title or name associated with the list item. Example: "Item Name".
|
|
36
|
-
* @property {number | string} value - The value of the list item, which can be either a number or a string depending on the context. Example: 42
|
|
37
|
-
* @property {string | number | null} position - The position of the list item, which can be represented as a string, number, or null if not applicable. Example: 1
|
|
36
|
+
* @property {number | string} value - The value of the list item, which can be either a number or a string depending on the context. Example: 42.
|
|
37
|
+
* @property {string | number | null} position - The position of the list item, which can be represented as a string, number, or null if not applicable. Example: 1.
|
|
38
38
|
* @property {object} extended - An object containing additional properties or metadata related to the list item. This could include any extra details that extend the basic information.
|
|
39
|
+
* @property {string | null} extended.value - The extended value, which can be a string or null. Example: "extra_value".
|
|
40
|
+
* @property {string | null} extended.type - The type of the extended value, which can be a string or null. Example: "color".
|
|
39
41
|
* @description This interface defines the structure of a list item, which includes properties for the title, value, position, and extended information.
|
|
40
42
|
*/
|
|
41
43
|
interface IListTitle {
|
|
@@ -48,54 +50,50 @@ interface IListTitle {
|
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* @type IAdminQuery
|
|
53
|
+
* Defines the possible values for attribute types used in the system.
|
|
54
54
|
* @type {AttributeType}
|
|
55
55
|
* @description This type defines the possible values for attribute types used in the system.
|
|
56
56
|
*/
|
|
57
57
|
type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' | 'float' | 'dateTime' | 'date' | 'time' | 'file' | 'image' | 'groupOfImages' | 'radioButton' | 'list' | 'button';
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* Represents an attribute set entity.
|
|
61
60
|
* @interface IAttributesSetsEntity
|
|
62
|
-
*
|
|
63
61
|
* @property {AttributeType} type - Attribute type. Example: "string", "text", "integer", "etc".
|
|
64
62
|
* @property {any} [value] - Value of the attribute, which can be of any type.
|
|
65
63
|
* @property {string} marker - Textual identifier of the attribute (marker). Example: "color", "size", "etc".
|
|
66
|
-
* @property {number} position - Position number for sorting. Example: 1
|
|
64
|
+
* @property {number} position - Position number for sorting. Example: 1.
|
|
67
65
|
* @property {IListTitle[] | Record<string, any>} [listTitles] - Array of values (with extended data) for list and radioButton attributes. Example:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
[
|
|
67
|
+
{
|
|
68
|
+
"title": "red",
|
|
69
|
+
"value": 1,
|
|
70
|
+
"position": 1,
|
|
71
|
+
"extendedValue": null,
|
|
72
|
+
"extendedValueType": null
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"title": "yellow",
|
|
76
|
+
"value": 2,
|
|
77
|
+
"position": 2,
|
|
78
|
+
"extendedValue": null,
|
|
79
|
+
"extendedValueType": null
|
|
80
|
+
}
|
|
81
|
+
]
|
|
84
82
|
* @property {Record<string, any>} [validators] - Set of validators for validation. Example:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
{
|
|
84
|
+
"requiredValidator": {
|
|
85
|
+
"strict": true
|
|
86
|
+
},
|
|
87
|
+
"defaultValueValidator": {
|
|
88
|
+
"fieldDefaultValue": 11
|
|
89
|
+
}
|
|
90
|
+
}
|
|
93
91
|
* @property {ILocalizeInfo} localizeInfos - The name of the template, taking into account localization. Example:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
{
|
|
93
|
+
"title": "My attribute"
|
|
94
|
+
}
|
|
97
95
|
* @property {Record<string, any>} [additionalFields] - Additional fields for the attribute (optional).
|
|
98
|
-
* @property {Record<string, any>} [settings] -
|
|
96
|
+
* @property {Record<string, any>} [settings] - Additional attribute settings (optional).
|
|
99
97
|
* @description This interface defines the structure of an attribute set entity, including its type, marker, position, validators, localization information, list titles, additional fields, and settings.
|
|
100
98
|
*/
|
|
101
99
|
interface IAttributesSetsEntity {
|
|
@@ -110,36 +108,34 @@ interface IAttributesSetsEntity {
|
|
|
110
108
|
settings?: Record<string, any>;
|
|
111
109
|
}
|
|
112
110
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
111
|
+
* Represents an attribute set entity.
|
|
115
112
|
* @interface IAttributeSetsEntity
|
|
116
|
-
*
|
|
117
113
|
* @property {number} id - The unique identifier of the attribute set entity. Example: 123.
|
|
118
114
|
* @property {string} updatedDate - The date when the attribute set was last updated, represented as a string. Example: "2023-10-01T12:00:00Z".
|
|
119
115
|
* @property {number} version - The version number of the attribute set, used for tracking changes or updates. Example: 1.
|
|
120
116
|
* @property {string} identifier - A string that uniquely identifies the attribute set. Example: "attributeSet1".
|
|
121
117
|
* @property {number} typeId - The numerical identifier representing the type of the attribute set. Example: 1.
|
|
122
118
|
* @property {string} title - The title or name of the attribute set. Example: "Product Attributes".
|
|
123
|
-
* @property {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
* @property {object} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data. Example:
|
|
120
|
+
{
|
|
121
|
+
"attribute1": {
|
|
122
|
+
"id": 1,
|
|
123
|
+
"type": "string",
|
|
124
|
+
"isPrice": false,
|
|
125
|
+
"original": true,
|
|
126
|
+
"identifier": "string",
|
|
127
|
+
"localizeInfos": {
|
|
128
|
+
"en_US": { "title": "String" }
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
136
132
|
* @property {boolean} isVisible - Indicates whether the attribute set is visible or not. Example: true.
|
|
137
|
-
* @property {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
* @property {
|
|
133
|
+
* @property {object} properties - Additional properties associated with the attribute set, which can be of any type. Example:
|
|
134
|
+
{
|
|
135
|
+
"color": "red",
|
|
136
|
+
"size": "M"
|
|
137
|
+
}
|
|
138
|
+
* @property {string} type - The type of the attribute set, which could be a specific classification or category. Example: "product", "user", "etc".
|
|
143
139
|
* @property {number} position - The position number for sorting the attribute set. Example: 1.
|
|
144
140
|
* @description This interface defines the structure of an attribute set entity.
|
|
145
141
|
*/
|
|
@@ -150,29 +146,27 @@ interface IAttributeSetsEntity {
|
|
|
150
146
|
identifier: string;
|
|
151
147
|
typeId: number;
|
|
152
148
|
title: string;
|
|
153
|
-
schema:
|
|
149
|
+
schema: object;
|
|
154
150
|
isVisible: boolean;
|
|
155
|
-
properties:
|
|
156
|
-
type:
|
|
151
|
+
properties: object;
|
|
152
|
+
type: string;
|
|
157
153
|
position: number;
|
|
158
154
|
}
|
|
159
155
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
156
|
+
* Represents the response structure for attribute sets.
|
|
162
157
|
* @interface IAttributesSetsResponse
|
|
163
|
-
*
|
|
164
158
|
* @property {number} total - Total items. Example: 100.
|
|
165
159
|
* @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities. Example:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
160
|
+
[
|
|
161
|
+
{
|
|
162
|
+
"id": 1,
|
|
163
|
+
"identifier": "set1"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": 2,
|
|
167
|
+
"identifier": "set2"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
176
170
|
* @description This interface defines the structure of a response object for attribute sets.
|
|
177
171
|
*/
|
|
178
172
|
interface IAttributesSetsResponse {
|
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules';
|
|
2
2
|
import type StateModule from '../base/stateModule';
|
|
3
3
|
import type { IError } from '../base/utils';
|
|
4
|
-
import type { IAuthEntity, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, IOAuthSignUpData, ISignUpData, ISignUpEntity } from './authProvidersInterfaces';
|
|
4
|
+
import type { IActiveSession, IAuthEntity, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, IOAuthSignUpData, ISignUpData, ISignUpEntity } from './authProvidersInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with auth services.
|
|
7
|
-
*
|
|
8
7
|
* @handle /api/content/users-auth-providers
|
|
9
8
|
* @class AuthProviderApi
|
|
10
|
-
* @
|
|
9
|
+
* @augments AsyncModules
|
|
11
10
|
* @implements {IAuthProvider}
|
|
12
|
-
*
|
|
13
11
|
* @description This class provides methods for user registration, authentication, and management of authentication providers.
|
|
14
12
|
*/
|
|
15
13
|
export default class AuthProviderApi extends AsyncModules implements IAuthProvider {
|
|
16
14
|
protected state: StateModule;
|
|
17
15
|
protected _url: string;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
18
19
|
constructor(state: StateModule);
|
|
19
20
|
/**
|
|
20
21
|
* User registration.
|
|
21
|
-
*
|
|
22
22
|
* @handleName signUp
|
|
23
|
-
*
|
|
24
23
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
25
24
|
* @param {ISignUpData} body - Request body. Example:
|
|
26
25
|
{
|
|
27
26
|
"formIdentifier": "reg",
|
|
28
27
|
"authData": [
|
|
29
28
|
{
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
"marker": "login",
|
|
30
|
+
"value": "example@oneentry.cloud"
|
|
32
31
|
},
|
|
33
32
|
{
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
"marker": "password",
|
|
34
|
+
"value": "12345"
|
|
36
35
|
}
|
|
37
36
|
],
|
|
38
37
|
"formData": [
|
|
39
38
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
"marker": "last_name",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"value": "Name"
|
|
43
42
|
}
|
|
44
43
|
],
|
|
45
44
|
"notificationData": {
|
|
@@ -48,92 +47,84 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
48
47
|
"phoneSMS": "+99999999999"
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
"marker": "login",
|
|
56
|
-
"value": "example@oneentry.cloud"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"marker": "password",
|
|
60
|
-
"value": "12345"
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
* @param {IAuthFormData | IAuthFormData[]} body.formData - The form data for the registration, which can be a single object or an array of objects. Example:
|
|
50
|
+
* @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. Example:
|
|
52
|
+
[
|
|
64
53
|
{
|
|
65
|
-
"marker": "
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
* @param {Object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS. Example:
|
|
54
|
+
"marker": "login",
|
|
55
|
+
"value": "example@oneentry.cloud"
|
|
56
|
+
},
|
|
70
57
|
{
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"phoneSMS": "+99999999999"
|
|
58
|
+
"marker": "password",
|
|
59
|
+
"value": "12345"
|
|
74
60
|
}
|
|
61
|
+
]
|
|
62
|
+
* @param {IAuthFormData} body.formData - The form data for the registration, which can be a single object or an array of objects. Example:
|
|
63
|
+
{
|
|
64
|
+
"marker": "last_name",
|
|
65
|
+
"type": "string",
|
|
66
|
+
"value": "Name"
|
|
67
|
+
}
|
|
68
|
+
* @param {object} body.notificationData - An object containing notification data, including email, phonePush, and phoneSMS. Example:
|
|
69
|
+
{
|
|
70
|
+
"email": "example@oneentry.cloud",
|
|
71
|
+
"phonePush": ["+99999999999"],
|
|
72
|
+
"phoneSMS": "+99999999999"
|
|
73
|
+
}
|
|
75
74
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
76
|
-
* @
|
|
75
|
+
* @returns {ISignUpEntity} Returns a user object.
|
|
77
76
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
78
77
|
* @description User registration (❗️For a provider with user activation, the activation code is sent through the corresponding user notification method).
|
|
79
78
|
*/
|
|
80
79
|
signUp(marker: string, body: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
|
|
81
80
|
/**
|
|
82
81
|
* Getting a user activation code. The code is returned via the appropriate user notification method.
|
|
83
|
-
*
|
|
84
82
|
* @handleName generateCode
|
|
85
|
-
*
|
|
86
83
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
87
84
|
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
88
85
|
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
|
|
89
|
-
* @
|
|
86
|
+
* @returns {void} Returns void if the code is successfully generated, or an error object if there was an issue.
|
|
90
87
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
91
88
|
* @description Obtaining a code to activate the user.
|
|
92
89
|
*/
|
|
93
90
|
generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
|
|
94
91
|
/**
|
|
95
92
|
* User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
|
|
96
|
-
*
|
|
97
93
|
* @handleName checkCode
|
|
98
|
-
*
|
|
99
94
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
100
|
-
* @param {string} userIdentifier
|
|
95
|
+
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
101
96
|
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated. Example: "user_registration".
|
|
102
97
|
* @param {string} code - Service code. Example: "123456".
|
|
103
|
-
* @
|
|
98
|
+
* @returns {boolean} Returns true if the code is correct, or an error object if there was an issue.
|
|
104
99
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
105
100
|
* @description Checking the user activation code
|
|
106
101
|
*/
|
|
107
102
|
checkCode(marker: string, userIdentifier: string, eventIdentifier: string, code: string): Promise<boolean | IError>;
|
|
108
103
|
/**
|
|
109
104
|
* User activate.
|
|
110
|
-
*
|
|
111
105
|
* @handleName activateUser
|
|
112
|
-
*
|
|
113
106
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
114
107
|
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
115
108
|
* @param {string} code - Service code. Example: "123456".
|
|
116
|
-
* @
|
|
109
|
+
* @returns {boolean} Returns true if the user was successfully activated, or an error object if there was an issue.
|
|
117
110
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
118
111
|
* @description User activation.
|
|
119
112
|
*/
|
|
120
113
|
activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
|
|
121
114
|
/**
|
|
122
115
|
* User authorization.
|
|
123
|
-
*
|
|
124
116
|
* @handleName auth
|
|
125
|
-
*
|
|
126
117
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
127
118
|
* @param {IAuthPostBody} body - Objects contains auth information. Example:
|
|
128
119
|
{
|
|
129
120
|
"authData": [
|
|
130
121
|
{
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
"marker": "login",
|
|
123
|
+
"value": "example@oneentry.cloud"
|
|
133
124
|
},
|
|
134
125
|
{
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
"marker": "password",
|
|
127
|
+
"value": "12345"
|
|
137
128
|
}
|
|
138
129
|
]
|
|
139
130
|
}
|
|
@@ -145,53 +136,44 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
145
136
|
}
|
|
146
137
|
]
|
|
147
138
|
* @param {string} body.authData[index].marker - The marker for the authentication data. Example: "login".
|
|
148
|
-
* @param {string} body.authData[index].value
|
|
149
|
-
*
|
|
150
|
-
* @return {IAuthEntity} Returns an auth entity object.
|
|
139
|
+
* @param {string} body.authData[index].value - The value for the authentication data. Example: "user@example.com".
|
|
140
|
+
* @returns {IAuthEntity} Returns an auth entity object.
|
|
151
141
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
152
142
|
* @description User authorization.
|
|
153
143
|
*/
|
|
154
144
|
auth(marker: string, body: IAuthPostBody): Promise<IAuthEntity | IError>;
|
|
155
145
|
/**
|
|
156
146
|
* Refresh token.
|
|
157
|
-
*
|
|
158
147
|
* @handleName refresh
|
|
159
|
-
*
|
|
160
148
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
161
149
|
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
162
|
-
* @
|
|
150
|
+
* @returns {IAuthEntity} Returns an auth entity object with the following values: accessToken, refreshToken, user, and other auth-related data.
|
|
163
151
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
164
152
|
* @description User token refresh.
|
|
165
153
|
*/
|
|
166
154
|
refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
|
|
167
155
|
/**
|
|
168
156
|
* User account logout.
|
|
169
|
-
*
|
|
170
157
|
* @handleName logout
|
|
171
|
-
*
|
|
172
158
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
173
159
|
* @param {string} token - Refresh token. Example: "abcdef123456".
|
|
174
|
-
* @
|
|
160
|
+
* @returns {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
175
161
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
176
162
|
* @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
163
|
*/
|
|
178
164
|
logout(marker: string, token: string): Promise<boolean | IError>;
|
|
179
165
|
/**
|
|
180
166
|
* Logout of user account on all devices.
|
|
181
|
-
*
|
|
182
167
|
* @handleName logoutAll
|
|
183
|
-
*
|
|
184
168
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
185
|
-
* @
|
|
169
|
+
* @returns {boolean} Returns true if the logout was successful, or an error object if there was an issue.
|
|
186
170
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
187
171
|
* @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.
|
|
188
172
|
*/
|
|
189
173
|
logoutAll(marker: string): Promise<boolean | IError>;
|
|
190
174
|
/**
|
|
191
175
|
* Change password.
|
|
192
|
-
*
|
|
193
176
|
* @handleName changePassword
|
|
194
|
-
*
|
|
195
177
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
196
178
|
* @param {string} userIdentifier - The text identifier of the user's object (user login). Example: "example@oneentry.cloud".
|
|
197
179
|
* @param {string} eventIdentifier - The text identifier of the event. Example: "reg".
|
|
@@ -199,52 +181,44 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
199
181
|
* @param {string} code - Service code. Example: "123456".
|
|
200
182
|
* @param {string} newPassword - New password. Example: "newPassword123".
|
|
201
183
|
* @param {string} [repeatPassword] - Optional variable contains repeat new password for validation. Example: "newPassword123".
|
|
202
|
-
* @
|
|
184
|
+
* @returns {boolean} Returns true if the password was successfully changed, or an error object if there was an issue.
|
|
203
185
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
204
186
|
* @description User password change (only for tariffs with account activation and the Activation feature enabled).
|
|
205
187
|
*/
|
|
206
188
|
changePassword(marker: string, userIdentifier: string, eventIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
|
|
207
189
|
/**
|
|
208
190
|
* Get all auth providers objects.
|
|
209
|
-
*
|
|
210
191
|
* @handleName getAuthProviders
|
|
211
|
-
*
|
|
212
192
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
213
193
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
214
194
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
215
|
-
* @
|
|
195
|
+
* @returns {IAuthProvidersEntity[]} Returns an array of auth provider objects.
|
|
216
196
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
217
197
|
* @description Getting all objects of authorization providers.
|
|
218
198
|
*/
|
|
219
199
|
getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<IAuthProvidersEntity[] | IError>;
|
|
220
200
|
/**
|
|
221
201
|
* Get one auth provider object by marker.
|
|
222
|
-
*
|
|
223
202
|
* @handleName getAuthProviderByMarker
|
|
224
|
-
*
|
|
225
203
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
226
204
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
227
|
-
* @
|
|
205
|
+
* @returns {IAuthProvidersEntity} Returns an auth provider object.
|
|
228
206
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
229
207
|
* @description Getting a single authorization provider object by marker.
|
|
230
208
|
*/
|
|
231
209
|
getAuthProviderByMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
|
|
232
210
|
/**
|
|
233
211
|
* Getting active user sessions data.
|
|
234
|
-
*
|
|
235
212
|
* @handleName getActiveSessions
|
|
236
|
-
*
|
|
237
213
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
238
|
-
* @
|
|
214
|
+
* @returns {IActiveSession[]} Returns an auth provider object.
|
|
239
215
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
240
216
|
* @description Getting a single authorization provider object by marker.
|
|
241
217
|
*/
|
|
242
|
-
getActiveSessionsByMarker(marker: string): Promise<
|
|
218
|
+
getActiveSessionsByMarker(marker: string): Promise<IActiveSession[] | IError>;
|
|
243
219
|
/**
|
|
244
220
|
* User registration (authorization) via OAUTH.
|
|
245
|
-
*
|
|
246
221
|
* @handleName oauthSignUp
|
|
247
|
-
*
|
|
248
222
|
* @param {string} marker - The text identifier of the authorization provider. Example: "email".
|
|
249
223
|
* @param {IOAuthSignUpData} body - Object contains OAuth information for registration. Example:
|
|
250
224
|
{
|
|
@@ -255,7 +229,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
255
229
|
"redirect_uri": "http://localhost:3000"
|
|
256
230
|
}
|
|
257
231
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
258
|
-
* @
|
|
232
|
+
* @returns {ISignUpEntity} Returns a user object.
|
|
259
233
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
260
234
|
* @description User registration (authorization) via OAUTH.
|
|
261
235
|
*/
|