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