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,44 +1,45 @@
|
|
|
1
1
|
import type { AttributeType, IError, Types } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface ITemplatesApi
|
|
4
|
-
*
|
|
5
|
-
* @property {
|
|
6
|
-
* @property {
|
|
7
|
-
* @property {function} getTemplateByMarker - Getting a single template object.
|
|
8
|
-
*
|
|
4
|
+
* @property {Function} getAllTemplates - Get all template objects grouped by types.
|
|
5
|
+
* @property {Function} getTemplateByType - Get template objects by type.
|
|
6
|
+
* @property {Function} getTemplateByMarker - Getting a single template object.
|
|
9
7
|
* @description This interface defines methods for retrieving templates in the system, including fetching all templates, specific templates by type or ID, and by marker.
|
|
10
8
|
*/
|
|
11
9
|
interface ITemplatesApi {
|
|
12
10
|
/**
|
|
13
11
|
* Get all template objects grouped by types.
|
|
14
|
-
*
|
|
12
|
+
* @handleName getAllTemplates
|
|
15
13
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
16
|
-
* @
|
|
14
|
+
* @returns {Record<Types, ITemplateEntity[]>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
17
15
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
16
|
+
* @description This method gets all template objects grouped by types.
|
|
18
17
|
*/
|
|
19
18
|
getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity[]> | IError>;
|
|
20
19
|
/**
|
|
21
20
|
* Get template objects by type.
|
|
22
|
-
*
|
|
21
|
+
* @handleName getTemplateByType
|
|
23
22
|
* @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: "product".
|
|
24
23
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
-
* @
|
|
24
|
+
* @returns {ITemplateEntity[]} Returns a TemplateEntity object.
|
|
26
25
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
|
+
* @description This method gets template objects by type.
|
|
27
27
|
*/
|
|
28
28
|
getTemplateByType(type: Types, langCode: string): Promise<ITemplateEntity[] | IError>;
|
|
29
29
|
/**
|
|
30
30
|
* Get one template object by id.
|
|
31
|
-
*
|
|
31
|
+
* @handleName getTemplateByMarker
|
|
32
32
|
* @param {string} marker - The unique marker of the template to retrieve. Example: "template_12345".
|
|
33
33
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
34
|
-
* @
|
|
34
|
+
* @returns {ITemplateEntity} Returns a TemplateEntity object
|
|
35
35
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
36
|
+
* @description This method gets one template object by id.
|
|
36
37
|
*/
|
|
37
38
|
getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
41
|
+
* The template entity interface
|
|
40
42
|
* @interface ITemplateEntity
|
|
41
|
-
*
|
|
42
43
|
* @property {number} id - The unique identifier of the position. Example: 12345.
|
|
43
44
|
* @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "attribute_set_1".
|
|
44
45
|
* @property {string} title - The name of the template. Example: "Product Template".
|
|
@@ -4,34 +4,33 @@ import type { IError } from '../base/utils';
|
|
|
4
4
|
import type { ITemplatesPreview, ITemplatesPreviewEntity } from './templatesPreviewInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with template objects for preview.
|
|
7
|
-
*
|
|
8
7
|
* @handle /api/content/template-previews
|
|
9
|
-
*
|
|
10
8
|
* @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
|
|
11
9
|
*/
|
|
12
10
|
export default class TemplatePreviewsApi extends AsyncModules implements ITemplatesPreview {
|
|
13
11
|
protected state: StateModule;
|
|
14
12
|
protected _url: string;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for the TemplatePreviewsApi class.
|
|
15
|
+
* @param {StateModule} state - The state module instance.
|
|
16
|
+
* @description Initializes the TemplatePreviewsApi class with the provided state module instance.
|
|
17
|
+
*/
|
|
15
18
|
constructor(state: StateModule);
|
|
16
19
|
/**
|
|
17
20
|
* Get all template objects.
|
|
18
|
-
*
|
|
19
21
|
* @handleName getTemplatePreviews
|
|
20
|
-
*
|
|
21
22
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
22
|
-
* @
|
|
23
|
+
* @returns {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
|
|
23
24
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
24
25
|
* @description This method is used to fetch all available template objects.
|
|
25
26
|
*/
|
|
26
27
|
getTemplatePreviews(langCode?: string): Promise<ITemplatesPreviewEntity[] | IError>;
|
|
27
28
|
/**
|
|
28
29
|
* Retrieves a template object by its marker.
|
|
29
|
-
*
|
|
30
30
|
* @handleName getTemplatePreviewByMarker
|
|
31
|
-
*
|
|
32
31
|
* @param {string} marker - The unique product marker used to identify the template. If not provided, a default behavior or error may occur. Example: "template_12345".
|
|
33
32
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
34
|
-
* @
|
|
33
|
+
* @returns {Promise<ITemplatesPreviewEntity | IError>} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
|
|
35
34
|
* @throws {IError} - Throws an error object if there is an issue during the fetch operation.
|
|
36
35
|
* @description This method is used to fetch a specific template object based on the provided marker.
|
|
37
36
|
*/
|
|
@@ -6,23 +6,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
7
|
/**
|
|
8
8
|
* Controllers for working with template objects for preview.
|
|
9
|
-
*
|
|
10
9
|
* @handle /api/content/template-previews
|
|
11
|
-
*
|
|
12
10
|
* @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
|
|
13
11
|
*/
|
|
14
12
|
class TemplatePreviewsApi extends asyncModules_1.default {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for the TemplatePreviewsApi class.
|
|
15
|
+
* @param {StateModule} state - The state module instance.
|
|
16
|
+
* @description Initializes the TemplatePreviewsApi class with the provided state module instance.
|
|
17
|
+
*/
|
|
15
18
|
constructor(state) {
|
|
16
19
|
super(state);
|
|
17
20
|
this._url = state.url + '/api/content/template-previews';
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* Get all template objects.
|
|
21
|
-
*
|
|
22
24
|
* @handleName getTemplatePreviews
|
|
23
|
-
*
|
|
24
25
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
-
* @
|
|
26
|
+
* @returns {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
|
|
26
27
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
27
28
|
* @description This method is used to fetch all available template objects.
|
|
28
29
|
*/
|
|
@@ -32,12 +33,10 @@ class TemplatePreviewsApi extends asyncModules_1.default {
|
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* Retrieves a template object by its marker.
|
|
35
|
-
*
|
|
36
36
|
* @handleName getTemplatePreviewByMarker
|
|
37
|
-
*
|
|
38
37
|
* @param {string} marker - The unique product marker used to identify the template. If not provided, a default behavior or error may occur. Example: "template_12345".
|
|
39
38
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
40
|
-
* @
|
|
39
|
+
* @returns {Promise<ITemplatesPreviewEntity | IError>} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
|
|
41
40
|
* @throws {IError} - Throws an error object if there is an issue during the fetch operation.
|
|
42
41
|
* @description This method is used to fetch a specific template object based on the provided marker.
|
|
43
42
|
*/
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import type { AttributeType, IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface ITemplatesPreview
|
|
4
|
-
*
|
|
5
|
-
* @property {
|
|
6
|
-
* @
|
|
7
|
-
* @property {function} getTemplatesPreviewByMarker - Get one template object by marker.
|
|
8
|
-
*
|
|
9
|
-
* @description This interface defines methods for retrieving template previews in the system, including fetching all previews, specific previews by ID, and by marker.
|
|
4
|
+
* @property {Function} getTemplatePreviews - Get all template preview objects.
|
|
5
|
+
* @property {Function} getTemplatePreviewByMarker - Get one template preview object by marker.
|
|
6
|
+
* @description This interface defines methods for retrieving template previews in the system, including fetching all previews, specific previews by marker.
|
|
10
7
|
*/
|
|
11
8
|
interface ITemplatesPreview {
|
|
12
9
|
/**
|
|
13
10
|
* Retrieves all template preview objects.
|
|
14
|
-
*
|
|
15
11
|
* @param {string} langCode - Language code for localization. Default: "en_US".
|
|
16
12
|
* @returns {ITemplatesPreviewEntity[]} A promise resolving to an array of template preview entities or an error.
|
|
17
13
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
@@ -19,17 +15,18 @@ interface ITemplatesPreview {
|
|
|
19
15
|
getTemplatePreviews(langCode: string): Promise<ITemplatesPreviewEntity[] | IError>;
|
|
20
16
|
/**
|
|
21
17
|
* Retrieves a specific template preview object by its marker.
|
|
22
|
-
*
|
|
23
|
-
* @param {string} marker
|
|
18
|
+
* @handleName getTemplatePreviewByMarker
|
|
19
|
+
* @param {string} marker - The marker of the template preview. Example: "template_12345".
|
|
24
20
|
* @param {string} [langCode] - Language code for localization. Default: "en_US".
|
|
25
|
-
* @returns {ITemplatesPreviewEntity} A promise resolving to the template preview entity or an error.
|
|
21
|
+
* @returns {ITemplatesPreviewEntity | IError} A promise resolving to the template preview entity or an error.
|
|
26
22
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
23
|
+
* @description This method retrieves a specific template preview object by its marker.
|
|
27
24
|
*/
|
|
28
25
|
getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatesPreviewEntity | IError>;
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
28
|
+
* The `ITemplatesPreview` interface defines the structure of template preview entities.
|
|
31
29
|
* @interface ITemplatesPreviewEntity
|
|
32
|
-
*
|
|
33
30
|
* @property {number} id - The unique identifier of the position. Example: 3.
|
|
34
31
|
* @property {string} title - The name of the template preview. Example: "Product Template"..
|
|
35
32
|
* @property {object} proportions - Object contains info by proportions template preview. Example:
|
|
@@ -51,11 +48,6 @@ interface ITemplatesPreview {
|
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
|
-
* @property {string} identifier - The textual identifier for the record field. Example: "preview-templates"
|
|
55
|
-
* @property {number} version - The version number of the object. Example: 1.
|
|
56
|
-
* @property {AttributeType} attributeValues - Attribute values from index. Example: {}
|
|
57
|
-
* @property {number} position - The position of the object. Example: 1.
|
|
58
|
-
* @property {string | null} [attributeSetIdentifier] - Text identifier used for a set of attributes. Example: "attribute_set_1".
|
|
59
51
|
* @property {IProportion | null} proportions.horizontal - Horizontal proportion of the template preview. Example:
|
|
60
52
|
{
|
|
61
53
|
"width": 234,
|
|
@@ -73,6 +65,11 @@ interface ITemplatesPreview {
|
|
|
73
65
|
"side": 3,
|
|
74
66
|
"alignmentType": "leftTop"
|
|
75
67
|
}
|
|
68
|
+
* @property {string} identifier - The textual identifier for the record field. Example: "preview-templates"
|
|
69
|
+
* @property {number} version - The version number of the object. Example: 1.
|
|
70
|
+
* @property {AttributeType} attributeValues - Attribute values from index. Example: {}
|
|
71
|
+
* @property {number} position - The position of the object. Example: 1.
|
|
72
|
+
* @property {string | null} [attributeSetIdentifier] - Text identifier used for a set of attributes. Example: "attribute_set_1".
|
|
76
73
|
* @description This interface defines the structure of a template preview entity, including its identifiers, attributes, proportions, and title.
|
|
77
74
|
*/
|
|
78
75
|
interface ITemplatesPreviewEntity {
|
|
@@ -93,8 +90,8 @@ interface ITemplatesPreviewEntity {
|
|
|
93
90
|
attributeSetIdentifier?: string | null;
|
|
94
91
|
}
|
|
95
92
|
/**
|
|
93
|
+
* The `IProportion` interface defines the structure of a proportion object used in template previews.
|
|
96
94
|
* @interface IProportion
|
|
97
|
-
*
|
|
98
95
|
* @property {string | number | null} width - width of the template preview. Example: 100.
|
|
99
96
|
* @property {string | number | null} height - height of the template preview. Example: 200.
|
|
100
97
|
* @property {string} alignmentType - alignment type of the template preview. Example: "center".
|
|
@@ -106,8 +103,8 @@ interface IProportion {
|
|
|
106
103
|
alignmentType: string;
|
|
107
104
|
}
|
|
108
105
|
/**
|
|
106
|
+
* The `ISquare` interface defines the structure of a square proportion object used in template previews.
|
|
109
107
|
* @interface ISquare
|
|
110
|
-
*
|
|
111
108
|
* @property {number | string} side - Side length of the square template preview, can be a number or string. Example: 100.
|
|
112
109
|
* @property {string} alignmentType - Alignment type of the square template preview. Example: "center".
|
|
113
110
|
* @description Represents a square proportion object used in template previews.
|
package/dist/users/usersApi.d.ts
CHANGED
|
@@ -10,30 +10,31 @@ import type { IUserBody, IUserEntity, IUsers } from './usersInterfaces';
|
|
|
10
10
|
export default class UsersApi extends AsyncModules implements IUsers {
|
|
11
11
|
protected state: StateModule;
|
|
12
12
|
protected _url: string;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for UsersApi class.
|
|
15
|
+
* @param {StateModule} state - The state module containing necessary information for API calls.
|
|
16
|
+
* @description Initializes the UsersApi class with the provided state module.
|
|
17
|
+
*/
|
|
13
18
|
constructor(state: StateModule);
|
|
14
19
|
/**
|
|
15
20
|
* Getting the data of an authorized user.
|
|
16
|
-
*
|
|
17
21
|
* @handleName getUser
|
|
18
|
-
*
|
|
19
22
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
20
|
-
* @
|
|
23
|
+
* @returns {IUserEntity} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
|
|
21
24
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
22
25
|
* @description Getting the data of an authorized user. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
23
26
|
*/
|
|
24
27
|
getUser(langCode?: string): Promise<IUserEntity | IError>;
|
|
25
28
|
/**
|
|
26
29
|
* Updating a single user object.
|
|
27
|
-
*
|
|
28
30
|
* @handleName updateUser
|
|
29
|
-
*
|
|
30
31
|
* @param {IUserBody} body - Request body. Example:
|
|
31
32
|
{
|
|
32
33
|
"formIdentifier": "reg",
|
|
33
34
|
"authData": [
|
|
34
35
|
{
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
"marker": "password",
|
|
37
|
+
"value": "12345"
|
|
37
38
|
}
|
|
38
39
|
],
|
|
39
40
|
"formData": {
|
|
@@ -49,49 +50,41 @@ export default class UsersApi extends AsyncModules implements IUsers {
|
|
|
49
50
|
"state": {}
|
|
50
51
|
}
|
|
51
52
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
52
|
-
* @
|
|
53
|
+
* @returns {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
|
|
53
54
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
54
55
|
* @description Updating a single user object. 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
56
|
*/
|
|
56
57
|
updateUser(body: IUserBody, langCode?: string): Promise<boolean | IError>;
|
|
57
58
|
/**
|
|
58
59
|
* Archiving one user object (marked for deletion).
|
|
59
|
-
*
|
|
60
60
|
* @handleName archiveUser
|
|
61
|
-
*
|
|
62
|
-
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
61
|
+
* @returns {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
63
62
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
64
63
|
* @description Archiving one user object (marked for deletion). 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
64
|
*/
|
|
66
65
|
archiveUser(): Promise<boolean | IError>;
|
|
67
66
|
/**
|
|
68
67
|
* Delete a single user.
|
|
69
|
-
*
|
|
70
68
|
* @handleName deleteUser
|
|
71
|
-
*
|
|
72
|
-
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
69
|
+
* @returns {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
73
70
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
74
71
|
* @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.
|
|
75
72
|
*/
|
|
76
73
|
deleteUser(): Promise<boolean | IError>;
|
|
77
74
|
/**
|
|
78
75
|
* Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
79
|
-
*
|
|
80
76
|
* @handleName addFCMToken
|
|
81
|
-
*
|
|
82
77
|
* @param {string} token - The cloud messaging token to be added. This token is used to identify the user's device for push notifications. Example: "fcm_token_1234567890abcdefg".
|
|
83
|
-
* @
|
|
78
|
+
* @returns {boolean} Returns `true` if the token was successfully added; otherwise, returns an error object.
|
|
84
79
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
85
80
|
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
86
81
|
*/
|
|
87
82
|
addFCMToken(token: string): Promise<boolean | IError>;
|
|
88
83
|
/**
|
|
89
84
|
* Deletes an FCM (Firebase Cloud Messaging) token.
|
|
90
|
-
*
|
|
91
85
|
* @handleName deleteFCMToken
|
|
92
|
-
*
|
|
93
86
|
* @param {string} token - The cloud messaging token to be deleted. This token is used to identify the user's device for push notifications and will be removed. Example: "fcm_token_1234567890abcdefg".
|
|
94
|
-
* @
|
|
87
|
+
* @returns {boolean} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
|
|
95
88
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
96
89
|
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
97
90
|
*/
|
package/dist/users/usersApi.js
CHANGED
|
@@ -10,17 +10,20 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
|
10
10
|
* @description This module provides various methods to manage users, including creating, retrieving, updating, and deleting user data. It requires proper authorization to access these endpoints.
|
|
11
11
|
*/
|
|
12
12
|
class UsersApi extends asyncModules_1.default {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for UsersApi class.
|
|
15
|
+
* @param {StateModule} state - The state module containing necessary information for API calls.
|
|
16
|
+
* @description Initializes the UsersApi class with the provided state module.
|
|
17
|
+
*/
|
|
13
18
|
constructor(state) {
|
|
14
19
|
super(state);
|
|
15
20
|
this._url = state.url + '/api/content/users';
|
|
16
21
|
}
|
|
17
22
|
/**
|
|
18
23
|
* Getting the data of an authorized user.
|
|
19
|
-
*
|
|
20
24
|
* @handleName getUser
|
|
21
|
-
*
|
|
22
25
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
-
* @
|
|
26
|
+
* @returns {IUserEntity} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
|
|
24
27
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
25
28
|
* @description Getting the data of an authorized user. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
26
29
|
*/
|
|
@@ -30,16 +33,14 @@ class UsersApi extends asyncModules_1.default {
|
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
35
|
* Updating a single user object.
|
|
33
|
-
*
|
|
34
36
|
* @handleName updateUser
|
|
35
|
-
*
|
|
36
37
|
* @param {IUserBody} body - Request body. Example:
|
|
37
38
|
{
|
|
38
39
|
"formIdentifier": "reg",
|
|
39
40
|
"authData": [
|
|
40
41
|
{
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
"marker": "password",
|
|
43
|
+
"value": "12345"
|
|
43
44
|
}
|
|
44
45
|
],
|
|
45
46
|
"formData": {
|
|
@@ -55,7 +56,7 @@ class UsersApi extends asyncModules_1.default {
|
|
|
55
56
|
"state": {}
|
|
56
57
|
}
|
|
57
58
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
58
|
-
* @
|
|
59
|
+
* @returns {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
|
|
59
60
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
60
61
|
* @description Updating a single user object. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
61
62
|
*/
|
|
@@ -71,10 +72,8 @@ class UsersApi extends asyncModules_1.default {
|
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
73
74
|
* Archiving one user object (marked for deletion).
|
|
74
|
-
*
|
|
75
75
|
* @handleName archiveUser
|
|
76
|
-
*
|
|
77
|
-
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
76
|
+
* @returns {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
78
77
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
79
78
|
* @description Archiving one user object (marked for deletion). This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
80
79
|
*/
|
|
@@ -84,10 +83,8 @@ class UsersApi extends asyncModules_1.default {
|
|
|
84
83
|
}
|
|
85
84
|
/**
|
|
86
85
|
* Delete a single user.
|
|
87
|
-
*
|
|
88
86
|
* @handleName deleteUser
|
|
89
|
-
*
|
|
90
|
-
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
87
|
+
* @returns {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
91
88
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
92
89
|
* @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.
|
|
93
90
|
*/
|
|
@@ -97,11 +94,9 @@ class UsersApi extends asyncModules_1.default {
|
|
|
97
94
|
}
|
|
98
95
|
/**
|
|
99
96
|
* Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
100
|
-
*
|
|
101
97
|
* @handleName addFCMToken
|
|
102
|
-
*
|
|
103
98
|
* @param {string} token - The cloud messaging token to be added. This token is used to identify the user's device for push notifications. Example: "fcm_token_1234567890abcdefg".
|
|
104
|
-
* @
|
|
99
|
+
* @returns {boolean} Returns `true` if the token was successfully added; otherwise, returns an error object.
|
|
105
100
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
106
101
|
* @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.
|
|
107
102
|
*/
|
|
@@ -111,11 +106,9 @@ class UsersApi extends asyncModules_1.default {
|
|
|
111
106
|
}
|
|
112
107
|
/**
|
|
113
108
|
* Deletes an FCM (Firebase Cloud Messaging) token.
|
|
114
|
-
*
|
|
115
109
|
* @handleName deleteFCMToken
|
|
116
|
-
*
|
|
117
110
|
* @param {string} token - The cloud messaging token to be deleted. This token is used to identify the user's device for push notifications and will be removed. Example: "fcm_token_1234567890abcdefg".
|
|
118
|
-
* @
|
|
111
|
+
* @returns {boolean} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
|
|
119
112
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
120
113
|
* @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.
|
|
121
114
|
*/
|
|
@@ -4,37 +4,35 @@ import type { IError } from '../base/utils';
|
|
|
4
4
|
import type { FormDataType } from '../forms-data/formsDataInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Interface representing user-related operations.
|
|
7
|
-
*
|
|
8
7
|
* @interface IUsers
|
|
9
|
-
*
|
|
10
|
-
* @property {
|
|
11
|
-
* @property {
|
|
12
|
-
* @property {
|
|
13
|
-
* @property {
|
|
14
|
-
* @property {
|
|
15
|
-
* @property {function} deleteFCMToken - Deletes an existing FCM token.
|
|
8
|
+
* @property {Function} getUser - Retrieves the data of an authorized user, optionally based on a language code.
|
|
9
|
+
* @property {Function} updateUser - Updates the user's data with the provided information.
|
|
10
|
+
* @property {Function} archiveUser - Archiving one user object (marked for deletion).
|
|
11
|
+
* @property {Function} deleteUser - Deletes the user from the system.
|
|
12
|
+
* @property {Function} addFCMToken - Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
13
|
+
* @property {Function} deleteFCMToken - Deletes an existing FCM token.
|
|
16
14
|
* @description This interface defines methods for managing user data and handling Firebase Cloud Messaging tokens.
|
|
17
15
|
*/
|
|
18
16
|
interface IUsers {
|
|
19
17
|
/**
|
|
20
18
|
* Retrieves the data of an authorized user.
|
|
21
|
-
*
|
|
19
|
+
* @handleName getUser
|
|
22
20
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
23
|
-
* @
|
|
21
|
+
* @returns {IUserEntity} A promise resolving to the user entity or an error.
|
|
24
22
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
|
-
* @description
|
|
23
|
+
* @description This method retrieves the data of an authorized user.
|
|
26
24
|
*/
|
|
27
25
|
getUser(langCode?: string): Promise<IUserEntity | IError>;
|
|
28
26
|
/**
|
|
29
27
|
* Updates the user's data.
|
|
30
|
-
*
|
|
28
|
+
* @handleName updateUser
|
|
31
29
|
* @param {IUserBody} data - The new data for the user. Example:
|
|
32
30
|
{
|
|
33
31
|
"formIdentifier": "reg",
|
|
34
32
|
"authData": [
|
|
35
33
|
{
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
"marker": "password",
|
|
35
|
+
"value": "12345"
|
|
38
36
|
}
|
|
39
37
|
],
|
|
40
38
|
"formData": {
|
|
@@ -50,49 +48,48 @@ interface IUsers {
|
|
|
50
48
|
"state": {}
|
|
51
49
|
}
|
|
52
50
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
53
|
-
* @
|
|
51
|
+
* @returns {boolean} A promise resolving to true if successful, or an error.
|
|
54
52
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
55
|
-
* @description
|
|
53
|
+
* @description This method updates the user's data.
|
|
56
54
|
*/
|
|
57
55
|
updateUser(data: IUserBody, langCode?: string): Promise<boolean | IError>;
|
|
58
56
|
/**
|
|
59
57
|
* Archiving one user object (marked for deletion).
|
|
60
|
-
*
|
|
61
|
-
* @
|
|
58
|
+
* @handleName archiveUser
|
|
59
|
+
* @returns {boolean} A promise resolving to true if successful, or an error.
|
|
62
60
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
63
|
-
* @description
|
|
61
|
+
* @description This method archives a user object (marks it for deletion).
|
|
64
62
|
*/
|
|
65
63
|
archiveUser(): Promise<boolean | IError>;
|
|
66
64
|
/**
|
|
67
65
|
* Deletes the user from the system.
|
|
68
|
-
*
|
|
69
|
-
* @
|
|
66
|
+
* @handleName deleteUser
|
|
67
|
+
* @returns {boolean} A promise resolving to true if successful, or an error.
|
|
70
68
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
71
|
-
* @description
|
|
69
|
+
* @description This method deletes the user from the system.
|
|
72
70
|
*/
|
|
73
71
|
deleteUser(): Promise<boolean | IError>;
|
|
74
72
|
/**
|
|
75
73
|
* Adds an FCM token for sending push notifications.
|
|
76
|
-
*
|
|
74
|
+
* @handleName addFCMToken
|
|
77
75
|
* @param {string} token - The FCM token to be added. Example: "fcm_token_1234567890abcdefg".
|
|
78
|
-
* @
|
|
76
|
+
* @returns {boolean} A promise resolving to true if successful, or an error.
|
|
79
77
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
80
|
-
* @description
|
|
78
|
+
* @description This method adds an FCM token for sending push notifications.
|
|
81
79
|
*/
|
|
82
80
|
addFCMToken(token: string): Promise<boolean | IError>;
|
|
83
81
|
/**
|
|
84
82
|
* Deletes an existing FCM token.
|
|
85
|
-
*
|
|
83
|
+
* @handleName deleteFCMToken
|
|
86
84
|
* @param {string} token - The FCM token to be deleted. Example: "fcm_token_1234567890abcdefg".
|
|
87
|
-
* @
|
|
85
|
+
* @returns {boolean} A promise resolving to true if successful, or an error.
|
|
88
86
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
89
|
-
* @description
|
|
87
|
+
* @description This method deletes an existing FCM token.
|
|
90
88
|
*/
|
|
91
89
|
deleteFCMToken(token: string): Promise<boolean | IError>;
|
|
92
90
|
}
|
|
93
91
|
/**
|
|
94
92
|
* @interface IUserEntity
|
|
95
|
-
*
|
|
96
93
|
* @property {number} id - Object identifier. Example: 12345.
|
|
97
94
|
* @property {string} identifier - Text identifier for record field. Example: "user_12345".
|
|
98
95
|
* @property {string} authProviderIdentifier - Text identifier of the authentication provider. Example: "auth_provider_12345".
|
|
@@ -121,7 +118,6 @@ interface IUserEntity {
|
|
|
121
118
|
}
|
|
122
119
|
/**
|
|
123
120
|
* @interface IUserBody
|
|
124
|
-
*
|
|
125
121
|
* @property {string} formIdentifier - Text identifier of the form. Example: "form_12345".
|
|
126
122
|
* @property {string} [langCode] - Language code for localization. Default: "en_US".
|
|
127
123
|
* @property {{ marker: string; value: string }[]} [authData] - Array of authentication data objects with markers and values. Example:
|
|
@@ -9,13 +9,15 @@ import type { IWS } from './wsInterfaces';
|
|
|
9
9
|
export default class WsApi extends AsyncModules implements IWS {
|
|
10
10
|
protected state: StateModule;
|
|
11
11
|
protected _url: string;
|
|
12
|
+
/**
|
|
13
|
+
* Constructor
|
|
14
|
+
* @param {StateModule} state - StateModule
|
|
15
|
+
*/
|
|
12
16
|
constructor(state: StateModule);
|
|
13
17
|
/**
|
|
14
18
|
* Creates an instance of an object Socket.io with a connection. This method requires user authorization.
|
|
15
|
-
*
|
|
16
19
|
* @handleName connect
|
|
17
|
-
*
|
|
18
|
-
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
20
|
+
* @returns {Socket} Returns a Socket instance.
|
|
19
21
|
* @description Creates an instance of an object Socket.io with a connection. This method requires user authorization.
|
|
20
22
|
*/
|
|
21
23
|
connect(): Socket;
|
package/dist/web-socket/wsApi.js
CHANGED
|
@@ -10,20 +10,23 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
|
10
10
|
* @handle /api/content/ws
|
|
11
11
|
*/
|
|
12
12
|
class WsApi extends asyncModules_1.default {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param {StateModule} state - StateModule
|
|
16
|
+
*/
|
|
13
17
|
constructor(state) {
|
|
14
18
|
super(state);
|
|
15
19
|
this._url = state.url + '/api/content/ws';
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
22
|
* Creates an instance of an object Socket.io with a connection. This method requires user authorization.
|
|
19
|
-
*
|
|
20
23
|
* @handleName connect
|
|
21
|
-
*
|
|
22
|
-
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
24
|
+
* @returns {Socket} Returns a Socket instance.
|
|
23
25
|
* @description Creates an instance of an object Socket.io with a connection. This method requires user authorization.
|
|
24
26
|
*/
|
|
25
27
|
connect() {
|
|
26
28
|
if (!this.state.accessToken) {
|
|
29
|
+
// eslint-disable-next-line no-undef, no-console
|
|
27
30
|
console.error('User is unauthorized');
|
|
28
31
|
}
|
|
29
32
|
const socket = (0, socket_io_client_1.io)(this.state.url, {
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { Socket } from 'socket.io-client';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IWS
|
|
4
|
-
*
|
|
5
|
-
* @property {function} connect - WebSocket Connection.
|
|
4
|
+
* @property {Function} connect - WebSocket Connection.
|
|
6
5
|
* @description This interface defines a method for establishing a WebSocket connection.
|
|
7
6
|
*/
|
|
8
7
|
interface IWS {
|
|
8
|
+
/**
|
|
9
|
+
* WebSocket Connection.
|
|
10
|
+
* @handleName connect
|
|
11
|
+
* @returns {Socket} Returns a Socket instance.
|
|
12
|
+
* @description This method establishes a WebSocket connection.
|
|
13
|
+
*/
|
|
9
14
|
connect(): Socket;
|
|
10
15
|
}
|
|
11
16
|
export type { IWS };
|