oneentry 1.0.122 → 1.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admins/adminsApi.d.ts +16 -8
- package/dist/admins/adminsApi.js +18 -10
- package/dist/admins/adminsInterfaces.d.ts +49 -25
- package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
- package/dist/attribute-sets/attributeSetsApi.js +49 -25
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
- package/dist/auth-provider/authProviderApi.d.ts +94 -83
- package/dist/auth-provider/authProviderApi.js +96 -83
- package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
- package/dist/base/asyncModules.d.ts +32 -28
- package/dist/base/asyncModules.js +62 -38
- package/dist/base/syncModules.d.ts +44 -44
- package/dist/base/syncModules.js +65 -63
- package/dist/blocks/blocksApi.d.ts +56 -25
- package/dist/blocks/blocksApi.js +56 -25
- package/dist/blocks/blocksInterfaces.d.ts +71 -22
- package/dist/events/eventsApi.d.ts +45 -11
- package/dist/events/eventsApi.js +47 -17
- package/dist/events/eventsInterfaces.d.ts +44 -2
- package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
- package/dist/file-uploading/fileUploadingApi.js +46 -27
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
- package/dist/forms/formsApi.d.ts +23 -8
- package/dist/forms/formsApi.js +23 -8
- package/dist/forms/formsInterfaces.d.ts +62 -15
- package/dist/formsData/formsDataApi.d.ts +33 -33
- package/dist/formsData/formsDataApi.js +33 -33
- package/dist/formsData/formsDataInterfaces.d.ts +123 -35
- package/dist/general-types/generalTypesApi.d.ts +12 -1
- package/dist/general-types/generalTypesApi.js +12 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
- package/dist/integration-collections/integrationCollectionsApi.js +114 -81
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
- package/dist/locales/localesApi.d.ts +6 -1
- package/dist/locales/localesApi.js +6 -1
- package/dist/locales/localesInterfaces.d.ts +20 -11
- package/dist/menus/menusApi.d.ts +8 -3
- package/dist/menus/menusApi.js +8 -3
- package/dist/menus/menusInterfaces.d.ts +30 -17
- package/dist/orders/ordersApi.d.ts +64 -64
- package/dist/orders/ordersApi.js +67 -65
- package/dist/orders/ordersInterfaces.d.ts +174 -60
- package/dist/pages/pagesApi.d.ts +89 -30
- package/dist/pages/pagesApi.js +181 -57
- package/dist/pages/pagesInterfaces.d.ts +117 -23
- package/dist/payments/paymentsApi.d.ts +56 -22
- package/dist/payments/paymentsApi.js +56 -22
- package/dist/payments/paymentsInterfaces.d.ts +119 -36
- package/dist/product-statuses/productStatusesApi.d.ts +21 -15
- package/dist/product-statuses/productStatusesApi.js +21 -18
- package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
- package/dist/products/productsApi.d.ts +137 -157
- package/dist/products/productsApi.js +137 -157
- package/dist/products/productsInterfaces.d.ts +240 -57
- package/dist/system/systemApi.d.ts +29 -10
- package/dist/system/systemApi.js +29 -10
- package/dist/system/systemInterfaces.d.ts +8 -0
- package/dist/templates/templatesApi.d.ts +26 -16
- package/dist/templates/templatesApi.js +26 -19
- package/dist/templates/templatesInterfaces.d.ts +40 -14
- package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
- package/dist/templates-preview/templatesPreviewApi.js +18 -17
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +57 -29
- package/dist/users/usersApi.d.ts +37 -33
- package/dist/users/usersApi.js +37 -33
- package/dist/users/usersInterfaces.d.ts +80 -9
- package/dist/web-socket/wsApi.d.ts +6 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +3 -1
- package/package.json +11 -11
|
@@ -7,7 +7,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
8
|
/**
|
|
9
9
|
* Controllers for working with template objects
|
|
10
|
+
*
|
|
11
|
+
* @module TemplateController
|
|
10
12
|
* @handle /api/content/templates
|
|
13
|
+
*
|
|
14
|
+
* @description This module provides a set of controllers for handling operations related to template objects.
|
|
11
15
|
*/
|
|
12
16
|
class TemplatesPreviewApi extends asyncModules_1.default {
|
|
13
17
|
constructor(state) {
|
|
@@ -17,9 +21,14 @@ class TemplatesPreviewApi extends asyncModules_1.default {
|
|
|
17
21
|
/**
|
|
18
22
|
* Get all template objects grouped by types.
|
|
19
23
|
*
|
|
20
|
-
* @
|
|
24
|
+
* @handleName getAllTemplates
|
|
21
25
|
*
|
|
22
|
-
* @
|
|
26
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
27
|
+
*
|
|
28
|
+
* @return {Record<Types, ITemplateEntity>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
29
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
30
|
+
*
|
|
31
|
+
* @description This function is designed to fetch organized template objects in groups based on their types.
|
|
23
32
|
*/
|
|
24
33
|
async getAllTemplates(langCode = this.state.lang) {
|
|
25
34
|
const response = await this._fetchGet(`/all?langCode=${langCode}`);
|
|
@@ -33,34 +42,32 @@ class TemplatesPreviewApi extends asyncModules_1.default {
|
|
|
33
42
|
/**
|
|
34
43
|
* Get template objects by type.
|
|
35
44
|
*
|
|
36
|
-
* @
|
|
37
|
-
*
|
|
45
|
+
* @handleName getTemplateByType
|
|
46
|
+
*
|
|
47
|
+
* @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: 'product'.
|
|
48
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
49
|
+
*
|
|
50
|
+
* @return {TemplateEntity[]} Returns a TemplateEntity object.
|
|
51
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
38
52
|
*
|
|
39
|
-
* @
|
|
53
|
+
* @description Fetch template objects that belong to a specific type, with an optional filter by language.
|
|
40
54
|
*/
|
|
41
55
|
async getTemplateByType(type, langCode = this.state.lang) {
|
|
42
56
|
const result = await this._fetchGet(`?type=${type}&langCode=${langCode}`);
|
|
43
57
|
return this._normalizeData(result);
|
|
44
58
|
}
|
|
45
59
|
/**
|
|
46
|
-
* Get one template object by
|
|
60
|
+
* Get one template object by marker.
|
|
47
61
|
*
|
|
48
|
-
* @
|
|
49
|
-
* @param {string} [langCode] - Optional parameter language code
|
|
62
|
+
* @handleName getTemplateByMarker
|
|
50
63
|
*
|
|
51
|
-
* @
|
|
52
|
-
|
|
53
|
-
async getTemplateById(id, langCode = this.state.lang) {
|
|
54
|
-
const result = await this._fetchGet(`/${id}?langCode=${langCode}`);
|
|
55
|
-
return this._normalizeData(result);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Get one template object by id.
|
|
64
|
+
* @param {number} marker - The unique marker of the template to retrieve. Example: 'template_12345'.
|
|
65
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
59
66
|
*
|
|
60
|
-
* @
|
|
61
|
-
* @
|
|
67
|
+
* @return {ITemplateEntity} Returns a TemplateEntity object
|
|
68
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
62
69
|
*
|
|
63
|
-
* @
|
|
70
|
+
* @description Fetch a specific template object based on its unique marker.
|
|
64
71
|
*/
|
|
65
72
|
async getTemplateByMarker(marker, langCode = this.state.lang) {
|
|
66
73
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
@@ -1,32 +1,58 @@
|
|
|
1
1
|
import type { AttributeType, IError, Types } from '../base/utils';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* @interface ITemplatesApi
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getAllTemplates - Get all template objects grouped by types.
|
|
6
6
|
* @property {function} getTemplateByType - Get template objects by type.
|
|
7
|
-
* @property {function} getTemplateById - Get one template object by id.
|
|
8
7
|
* @property {function} getTemplateByMarker - Getting a single template object.
|
|
8
|
+
*
|
|
9
|
+
* @description This interface defines methods for retrieving templates in the system, including fetching all templates, specific templates by type or ID, and by marker.
|
|
9
10
|
*/
|
|
10
11
|
interface ITemplatesApi {
|
|
12
|
+
/**
|
|
13
|
+
* Get all template objects grouped by types.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
16
|
+
*
|
|
17
|
+
* @return {Record<Types, ITemplateEntity>} Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
18
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
19
|
+
*/
|
|
11
20
|
getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity> | IError>;
|
|
21
|
+
/**
|
|
22
|
+
* Get template objects by type.
|
|
23
|
+
*
|
|
24
|
+
* @param {Types} type - The type of templates to retrieve. This parameter specifies the category or classification of templates being requested. Example: 'product'.
|
|
25
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
26
|
+
*
|
|
27
|
+
* @return {TemplateEntity[]} Returns a TemplateEntity object.
|
|
28
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
29
|
+
*/
|
|
12
30
|
getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity> | IError>;
|
|
13
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Get one template object by id.
|
|
33
|
+
*
|
|
34
|
+
* @param {number} marker - The unique marker of the template to retrieve. Example: 'template_12345'.
|
|
35
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
36
|
+
*
|
|
37
|
+
* @return {ITemplateEntity} Returns a TemplateEntity object
|
|
38
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
39
|
+
*/
|
|
14
40
|
getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity | IError>;
|
|
15
41
|
}
|
|
16
42
|
/**
|
|
17
|
-
*
|
|
43
|
+
* @interface ITemplateEntity
|
|
18
44
|
*
|
|
19
|
-
* @
|
|
20
|
-
* @property {number}
|
|
21
|
-
* @property {
|
|
22
|
-
* @property {
|
|
23
|
-
* @property {
|
|
24
|
-
* @property {
|
|
25
|
-
* @property {
|
|
26
|
-
* @property {
|
|
27
|
-
* @property {
|
|
28
|
-
* @property {AttributeType} attributeValues - Attribute values from the index (represented as a pair of user attribute id: attribute value).
|
|
45
|
+
* @property {number} id - The unique identifier of the position. Example: 12345.
|
|
46
|
+
* @property {number} version - The version number of the object. Example: 1.
|
|
47
|
+
* @property {string} identifier - The textual identifier for the record field. Example: 'template_12345'.
|
|
48
|
+
* @property {number} generalTypeId - General type Entity id. Example: 67890.
|
|
49
|
+
* @property {string} title - The name of the template. Example: 'Product Template'.
|
|
50
|
+
* @property {number} position - The position of the object. Example: 1.
|
|
51
|
+
* @property {Types} generalTypeName - General type name. Example: 'product'.
|
|
52
|
+
* @property {string} attributeSetIdentifier - Set of attributes id. Example: 'attribute_set_1'.
|
|
53
|
+
* @property {AttributeType} attributeValues - Attribute values from the index (represented as a pair of user attribute id: attribute value). Example: .
|
|
29
54
|
*
|
|
55
|
+
* @description This interface defines the structure of a template entity, including its identifiers, attributes, and general type information.
|
|
30
56
|
*/
|
|
31
57
|
interface ITemplateEntity {
|
|
32
58
|
id: number;
|
|
@@ -3,8 +3,11 @@ import type StateModule from '../base/stateModule';
|
|
|
3
3
|
import type { IError } from '../base/utils';
|
|
4
4
|
import type { ITemplatesPreview, ITemplatesPreviewEntity } from './templatesPreviewInterfaces';
|
|
5
5
|
/**
|
|
6
|
-
* Controllers for working with template objects for preview
|
|
6
|
+
* Controllers for working with template objects for preview.
|
|
7
|
+
*
|
|
7
8
|
* @handle /api/content/template-previews
|
|
9
|
+
*
|
|
10
|
+
* @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
|
|
8
11
|
*/
|
|
9
12
|
export default class TemplatePreviewsApi extends AsyncModules implements ITemplatesPreview {
|
|
10
13
|
protected state: StateModule;
|
|
@@ -13,27 +16,28 @@ export default class TemplatePreviewsApi extends AsyncModules implements ITempla
|
|
|
13
16
|
/**
|
|
14
17
|
* Get all template objects.
|
|
15
18
|
*
|
|
16
|
-
* @
|
|
19
|
+
* @handleName getTemplatePreviews
|
|
17
20
|
*
|
|
18
|
-
* @
|
|
21
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
22
|
+
*
|
|
23
|
+
* @return {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
|
|
24
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
|
+
*
|
|
26
|
+
* @description This method is used to fetch all available template objects.
|
|
19
27
|
*/
|
|
20
28
|
getTemplatePreviews(langCode?: string): Promise<Array<ITemplatesPreviewEntity> | IError>;
|
|
21
29
|
/**
|
|
22
|
-
*
|
|
30
|
+
* Retrieves a template object by its marker.
|
|
23
31
|
*
|
|
24
|
-
* @
|
|
25
|
-
* @param {string} [langCode] - Optional parameter language code
|
|
32
|
+
* @handleName getTemplatePreviewByMarker
|
|
26
33
|
*
|
|
27
|
-
* @
|
|
28
|
-
|
|
29
|
-
getTemplatePreviewById(id: number, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
|
|
30
|
-
/**
|
|
31
|
-
* Get one template object by marker.
|
|
34
|
+
* @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'.
|
|
35
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
32
36
|
*
|
|
33
|
-
* @
|
|
34
|
-
* @
|
|
37
|
+
* @return {TemplatePreviewsEntity} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
|
|
38
|
+
* @throws {IError} - Throws an error object if there is an issue during the fetch operation.
|
|
35
39
|
*
|
|
36
|
-
* @
|
|
40
|
+
* @description This method is used to fetch a specific template object based on the provided marker.
|
|
37
41
|
*/
|
|
38
42
|
getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
|
|
39
43
|
}
|
|
@@ -5,8 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
7
|
/**
|
|
8
|
-
* Controllers for working with template objects for preview
|
|
8
|
+
* Controllers for working with template objects for preview.
|
|
9
|
+
*
|
|
9
10
|
* @handle /api/content/template-previews
|
|
11
|
+
*
|
|
12
|
+
* @description This module provides a set of controllers for managing and retrieving template objects designed for preview purposes.
|
|
10
13
|
*/
|
|
11
14
|
class TemplatePreviewsApi extends asyncModules_1.default {
|
|
12
15
|
constructor(state) {
|
|
@@ -16,33 +19,31 @@ class TemplatePreviewsApi extends asyncModules_1.default {
|
|
|
16
19
|
/**
|
|
17
20
|
* Get all template objects.
|
|
18
21
|
*
|
|
19
|
-
* @
|
|
22
|
+
* @handleName getTemplatePreviews
|
|
20
23
|
*
|
|
21
|
-
* @
|
|
24
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
+
*
|
|
26
|
+
* @return {ITemplatesPreviewEntity[]} - Returns all TemplatePreviewsEntity template objects.
|
|
27
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
|
+
*
|
|
29
|
+
* @description This method is used to fetch all available template objects.
|
|
22
30
|
*/
|
|
23
31
|
async getTemplatePreviews(langCode = this.state.lang) {
|
|
24
32
|
const result = await this._fetchGet(`?langCode=${langCode}`);
|
|
25
33
|
return this._normalizeData(result, langCode);
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
|
-
*
|
|
36
|
+
* Retrieves a template object by its marker.
|
|
29
37
|
*
|
|
30
|
-
* @
|
|
31
|
-
* @param {string} [langCode] - Optional parameter language code
|
|
38
|
+
* @handleName getTemplatePreviewByMarker
|
|
32
39
|
*
|
|
33
|
-
* @
|
|
34
|
-
|
|
35
|
-
async getTemplatePreviewById(id, langCode = this.state.lang) {
|
|
36
|
-
const result = await this._fetchGet(`/${id}?langCode=${langCode}`);
|
|
37
|
-
return this._normalizeData(result, langCode);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Get one template object by marker.
|
|
40
|
+
* @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'.
|
|
41
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
41
42
|
*
|
|
42
|
-
* @
|
|
43
|
-
* @
|
|
43
|
+
* @return {TemplatePreviewsEntity} - A promise that resolves to a TemplatePreviewsEntity object representing the template.
|
|
44
|
+
* @throws {IError} - Throws an error object if there is an issue during the fetch operation.
|
|
44
45
|
*
|
|
45
|
-
* @
|
|
46
|
+
* @description This method is used to fetch a specific template object based on the provided marker.
|
|
46
47
|
*/
|
|
47
48
|
async getTemplatePreviewByMarker(marker, langCode = this.state.lang) {
|
|
48
49
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
@@ -1,28 +1,50 @@
|
|
|
1
1
|
import type { AttributeType, IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* @interface ITemplatesPreview
|
|
4
4
|
*
|
|
5
|
-
* @interface
|
|
6
5
|
* @property {function} getTemplatesPreview - Get all template objects.
|
|
7
6
|
* @property {function} getTemplatesPreviewById - Get one template object by id.
|
|
8
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.
|
|
9
10
|
*/
|
|
10
11
|
interface ITemplatesPreview {
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves all template preview objects.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} langCode - Language code for localization. Default: "en_US".
|
|
16
|
+
*
|
|
17
|
+
* @returns {ITemplatesPreviewEntity[]} A promise resolving to an array of template preview entities or an error.
|
|
18
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
19
|
+
*/
|
|
11
20
|
getTemplatePreviews(langCode: string): Promise<Array<ITemplatesPreviewEntity> | IError>;
|
|
12
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a specific template preview object by its marker.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} marker - The marker of the template preview. Example: 'template_12345'.
|
|
25
|
+
* @param {string} [langCode] - Language code for localization. Default: "en_US".
|
|
26
|
+
*
|
|
27
|
+
* @returns {ITemplatesPreviewEntity} A promise resolving to the template preview entity or an error.
|
|
28
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
29
|
+
*/
|
|
13
30
|
getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatesPreviewEntity | IError>;
|
|
14
31
|
}
|
|
15
32
|
/**
|
|
16
|
-
*
|
|
33
|
+
* @interface ITemplatesPreviewEntity
|
|
34
|
+
*
|
|
35
|
+
* @property {number} id - The unique identifier of the position. Example: 12345.
|
|
36
|
+
* @property {number} version - The version number of the object. Example: 1.
|
|
37
|
+
* @property {string} identifier - The textual identifier for the record field. Example: 'template_12345'.
|
|
38
|
+
* @property {AttributeType} attributeValues - Attribute values from index. Example: .
|
|
39
|
+
* @property {string} attributeSetIdentifier - Text identifier used for a set of attributes. Example: 'attribute_set_1'.
|
|
40
|
+
* @property {string} title - The name of the template preview. Example: 'Product Template'.
|
|
41
|
+
* @property {number} position - The position of the object. Example: 1.
|
|
42
|
+
* @property {object} proportions - Object contains info by proportions template preview. Example: .
|
|
43
|
+
* @property {IProportion | null} proportions.horizontal - Horizontal proportion of the template preview. Example: .
|
|
44
|
+
* @property {IProportion | null} proportions.vertical - Vertical proportion of the template preview. Example: .
|
|
45
|
+
* @property {ISquare} proportions.square - Square proportion of the template preview. Example: .
|
|
17
46
|
*
|
|
18
|
-
* @interface
|
|
19
|
-
* @property {number} id - The unique identifier of the position.
|
|
20
|
-
* @property {string} identifier - The textual identifier for the record field.
|
|
21
|
-
* @property {object} proportion - Object contains info by proportion template preview.
|
|
22
|
-
* @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
|
|
23
|
-
* @property {number} position - The position of the object.
|
|
24
|
-
* @property {AttributeType} attributeValues - Attribute values from index.
|
|
25
|
-
* @property {string} attributeSetIdentifier - Text identifier used for a set of attributes
|
|
47
|
+
* @description This interface defines the structure of a template preview entity, including its identifiers, attributes, proportions, and title.
|
|
26
48
|
*/
|
|
27
49
|
interface ITemplatesPreviewEntity {
|
|
28
50
|
id: number;
|
|
@@ -30,36 +52,42 @@ interface ITemplatesPreviewEntity {
|
|
|
30
52
|
identifier: string;
|
|
31
53
|
attributeValues: AttributeType;
|
|
32
54
|
attributeSetIdentifier?: string | null;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
proportions: {
|
|
56
|
+
default: {
|
|
57
|
+
horizontal: IProportion | null;
|
|
58
|
+
vertical: IProportion | null;
|
|
59
|
+
square: ISquare;
|
|
60
|
+
};
|
|
37
61
|
};
|
|
38
62
|
title: string;
|
|
39
63
|
position: number;
|
|
64
|
+
isUsed: boolean;
|
|
40
65
|
}
|
|
41
66
|
/**
|
|
42
|
-
* IProportion
|
|
67
|
+
* @interface IProportion
|
|
68
|
+
*
|
|
69
|
+
* @property {string | number | null} width - width of the template preview. Example: 100.
|
|
70
|
+
* @property {string | number | null} height - height of the template preview. Example: 200.
|
|
71
|
+
* @property {string} marker - marker of the template preview. Example: 'template_12345'.
|
|
72
|
+
* @property {string} alignmentType - alignment type of the template preview. Example: 'center'.
|
|
43
73
|
*
|
|
44
|
-
* @
|
|
45
|
-
* @property {string | number | null} height -
|
|
46
|
-
* @property {string} marker -
|
|
47
|
-
* @property {string} alignmentType -
|
|
74
|
+
* @description Represents a proportion object used in template previews.
|
|
48
75
|
*/
|
|
49
76
|
interface IProportion {
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
52
|
-
marker: string;
|
|
77
|
+
width: number | null;
|
|
78
|
+
height: number | null;
|
|
53
79
|
alignmentType: string;
|
|
54
80
|
}
|
|
55
81
|
/**
|
|
56
|
-
* ISquare
|
|
57
|
-
*
|
|
58
|
-
* @property {
|
|
59
|
-
* @property {string}
|
|
82
|
+
* @interface ISquare
|
|
83
|
+
*
|
|
84
|
+
* @property {string} marker - Marker of the square template preview. Example: 'square_template_12345'.
|
|
85
|
+
* @property {number | string} side - Side length of the square template preview, can be a number or string. Example: 100.
|
|
86
|
+
* @property {string} alignmentType - Alignment type of the square template preview. Example: 'center'.
|
|
87
|
+
*
|
|
88
|
+
* @description Represents a square proportion object used in template previews.
|
|
60
89
|
*/
|
|
61
90
|
interface ISquare {
|
|
62
|
-
marker: string;
|
|
63
91
|
side: number | string;
|
|
64
92
|
alignmentType: string;
|
|
65
93
|
}
|
package/dist/users/usersApi.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { IUserBody, IUserEntity, IUsers } from './usersInterfaces';
|
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with users
|
|
7
7
|
* @handle /api/content/users
|
|
8
|
+
* @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.
|
|
8
9
|
*/
|
|
9
10
|
export default class UsersApi extends AsyncModules implements IUsers {
|
|
10
11
|
protected state: StateModule;
|
|
@@ -13,63 +14,66 @@ export default class UsersApi extends AsyncModules implements IUsers {
|
|
|
13
14
|
/**
|
|
14
15
|
* Getting the data of an authorized user.
|
|
15
16
|
*
|
|
16
|
-
* @
|
|
17
|
+
* @handleName getUser
|
|
18
|
+
*
|
|
19
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
20
|
+
*
|
|
21
|
+
* @return {IUserEntity} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
|
|
22
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
17
23
|
*
|
|
18
|
-
* @
|
|
24
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
19
25
|
*/
|
|
20
26
|
getUser(langCode?: string): Promise<IUserEntity | IError>;
|
|
21
27
|
/**
|
|
22
28
|
* Updating a single user object.
|
|
23
29
|
*
|
|
30
|
+
* @handleName updateUser
|
|
31
|
+
*
|
|
32
|
+
* @param {object} body - Request body. Example: {"formIdentifier": "reg", "authData": [{"marker": "password", "value": "12345"}], "formData": {"marker": "last_name", "type": "string", "value": "Username"}, "notificationData": {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999"}, "state": {}}
|
|
33
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
34
|
+
*
|
|
35
|
+
* @return {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
|
|
36
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
37
|
+
*
|
|
24
38
|
* @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.
|
|
25
39
|
*
|
|
26
|
-
* @param {object} [body] - Request body.
|
|
27
|
-
* @param {string} [langCode] - Optional language field
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* {
|
|
31
|
-
* "formIdentifier": "reg",
|
|
32
|
-
* "authData": [
|
|
33
|
-
* {
|
|
34
|
-
* "marker": "password",
|
|
35
|
-
* "value": "12345"
|
|
36
|
-
* }
|
|
37
|
-
* ],
|
|
38
|
-
* "formData": {
|
|
39
|
-
* "marker": "last_name",
|
|
40
|
-
* "type": "string",
|
|
41
|
-
* "value": "Username"
|
|
42
|
-
* },
|
|
43
|
-
* "notificationData": {
|
|
44
|
-
* "email": "example@oneentry.cloud",
|
|
45
|
-
* "phonePush": ["+99999999999"],
|
|
46
|
-
* "phoneSMS": "+99999999999"
|
|
47
|
-
* },
|
|
48
|
-
* "state": {}
|
|
49
|
-
* }
|
|
50
40
|
*/
|
|
51
41
|
updateUser(body: IUserBody, langCode?: string): Promise<boolean | IError>;
|
|
52
42
|
/**
|
|
53
43
|
* Delete a single user object.
|
|
54
44
|
*
|
|
55
|
-
* @
|
|
45
|
+
* @handleName deleteUser
|
|
46
|
+
*
|
|
47
|
+
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
48
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
56
49
|
*
|
|
50
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
57
51
|
*/
|
|
58
52
|
deleteUser(): Promise<boolean | IError>;
|
|
59
53
|
/**
|
|
60
|
-
* Adds FCM token for sending
|
|
54
|
+
* Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
61
55
|
*
|
|
62
|
-
* @
|
|
56
|
+
* @handleName addFCMToken
|
|
57
|
+
*
|
|
58
|
+
* @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".
|
|
63
59
|
*
|
|
64
|
-
* @
|
|
60
|
+
* @return {boolean} Returns `true` if the token was successfully added; otherwise, returns an error object.
|
|
61
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
62
|
+
*
|
|
63
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
65
64
|
*/
|
|
66
65
|
addFCMToken(token: string): Promise<boolean | IError>;
|
|
67
66
|
/**
|
|
68
|
-
*
|
|
67
|
+
* Deletes an FCM (Firebase Cloud Messaging) token.
|
|
69
68
|
*
|
|
70
|
-
* @
|
|
69
|
+
* @handleName deleteFCMToken
|
|
70
|
+
*
|
|
71
|
+
* @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".
|
|
71
72
|
*
|
|
72
|
-
* @
|
|
73
|
+
* @return {boolean} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
|
|
74
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
75
|
+
*
|
|
76
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
73
77
|
*/
|
|
74
78
|
deleteFCMToken(token: string): Promise<boolean | IError>;
|
|
75
79
|
}
|
package/dist/users/usersApi.js
CHANGED
|
@@ -7,6 +7,7 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
|
7
7
|
/**
|
|
8
8
|
* Controllers for working with users
|
|
9
9
|
* @handle /api/content/users
|
|
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.
|
|
10
11
|
*/
|
|
11
12
|
class UsersApi extends asyncModules_1.default {
|
|
12
13
|
constructor(state) {
|
|
@@ -16,9 +17,14 @@ class UsersApi extends asyncModules_1.default {
|
|
|
16
17
|
/**
|
|
17
18
|
* Getting the data of an authorized user.
|
|
18
19
|
*
|
|
19
|
-
* @
|
|
20
|
+
* @handleName getUser
|
|
21
|
+
*
|
|
22
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
+
*
|
|
24
|
+
* @return {IUserEntity} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
|
|
25
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
20
26
|
*
|
|
21
|
-
* @
|
|
27
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
22
28
|
*/
|
|
23
29
|
async getUser(langCode = this.state.lang) {
|
|
24
30
|
const result = await this._fetchGet(`/me?langCode=${langCode}`);
|
|
@@ -27,32 +33,16 @@ class UsersApi extends asyncModules_1.default {
|
|
|
27
33
|
/**
|
|
28
34
|
* Updating a single user object.
|
|
29
35
|
*
|
|
36
|
+
* @handleName updateUser
|
|
37
|
+
*
|
|
38
|
+
* @param {object} body - Request body. Example: {"formIdentifier": "reg", "authData": [{"marker": "password", "value": "12345"}], "formData": {"marker": "last_name", "type": "string", "value": "Username"}, "notificationData": {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999"}, "state": {}}
|
|
39
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
40
|
+
*
|
|
41
|
+
* @return {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
|
|
42
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
43
|
+
*
|
|
30
44
|
* @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.
|
|
31
45
|
*
|
|
32
|
-
* @param {object} [body] - Request body.
|
|
33
|
-
* @param {string} [langCode] - Optional language field
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* {
|
|
37
|
-
* "formIdentifier": "reg",
|
|
38
|
-
* "authData": [
|
|
39
|
-
* {
|
|
40
|
-
* "marker": "password",
|
|
41
|
-
* "value": "12345"
|
|
42
|
-
* }
|
|
43
|
-
* ],
|
|
44
|
-
* "formData": {
|
|
45
|
-
* "marker": "last_name",
|
|
46
|
-
* "type": "string",
|
|
47
|
-
* "value": "Username"
|
|
48
|
-
* },
|
|
49
|
-
* "notificationData": {
|
|
50
|
-
* "email": "example@oneentry.cloud",
|
|
51
|
-
* "phonePush": ["+99999999999"],
|
|
52
|
-
* "phoneSMS": "+99999999999"
|
|
53
|
-
* },
|
|
54
|
-
* "state": {}
|
|
55
|
-
* }
|
|
56
46
|
*/
|
|
57
47
|
async updateUser(body, langCode = this.state.lang) {
|
|
58
48
|
if (!('langCode' in body))
|
|
@@ -67,30 +57,44 @@ class UsersApi extends asyncModules_1.default {
|
|
|
67
57
|
/**
|
|
68
58
|
* Delete a single user object.
|
|
69
59
|
*
|
|
70
|
-
* @
|
|
60
|
+
* @handleName deleteUser
|
|
61
|
+
*
|
|
62
|
+
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
63
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
71
64
|
*
|
|
65
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
72
66
|
*/
|
|
73
67
|
async deleteUser() {
|
|
74
68
|
const result = await this._fetchDelete('/me');
|
|
75
69
|
return result;
|
|
76
70
|
}
|
|
77
71
|
/**
|
|
78
|
-
* Adds FCM token for sending
|
|
72
|
+
* Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
79
73
|
*
|
|
80
|
-
* @
|
|
74
|
+
* @handleName addFCMToken
|
|
75
|
+
*
|
|
76
|
+
* @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".
|
|
81
77
|
*
|
|
82
|
-
* @
|
|
78
|
+
* @return {boolean} Returns `true` if the token was successfully added; otherwise, returns an error object.
|
|
79
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
80
|
+
*
|
|
81
|
+
* @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.
|
|
83
82
|
*/
|
|
84
83
|
async addFCMToken(token) {
|
|
85
84
|
const result = await this._fetchPost(`/me/fcm-token/${token}`);
|
|
86
85
|
return result;
|
|
87
86
|
}
|
|
88
87
|
/**
|
|
89
|
-
*
|
|
88
|
+
* Deletes an FCM (Firebase Cloud Messaging) token.
|
|
90
89
|
*
|
|
91
|
-
* @
|
|
90
|
+
* @handleName deleteFCMToken
|
|
91
|
+
*
|
|
92
|
+
* @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".
|
|
92
93
|
*
|
|
93
|
-
* @
|
|
94
|
+
* @return {boolean} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
|
|
95
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
96
|
+
*
|
|
97
|
+
* @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.
|
|
94
98
|
*/
|
|
95
99
|
async deleteFCMToken(token) {
|
|
96
100
|
const result = await this._fetchDelete(`/me/fcm-token/${token}`);
|