oneentry 1.0.102 → 1.0.105
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 +1322 -506
- package/configure.js +24 -33
- package/dist/admins/adminsApi.d.ts +11 -7
- package/dist/admins/adminsApi.js +17 -5
- package/dist/admins/adminsInterfaces.d.ts +33 -19
- package/dist/attribute-sets/attributeSetsApi.d.ts +35 -10
- package/dist/attribute-sets/attributeSetsApi.js +49 -7
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +42 -11
- package/dist/auth-provider/authProviderApi.d.ts +17 -5
- package/dist/auth-provider/authProviderApi.js +31 -14
- package/dist/auth-provider/authProvidersInterfaces.d.ts +23 -2
- package/dist/base/asyncModules.d.ts +2 -2
- package/dist/base/asyncModules.js +26 -17
- package/dist/base/result.js +26 -12
- package/dist/base/stateModule.d.ts +1 -1
- package/dist/base/stateModule.js +20 -11
- package/dist/base/syncModules.d.ts +4 -4
- package/dist/base/syncModules.js +16 -12
- package/dist/base/utils.d.ts +2 -2
- package/dist/blocks/blocksApi.d.ts +8 -5
- package/dist/blocks/blocksApi.js +30 -8
- package/dist/blocks/blocksInterfaces.d.ts +38 -5
- package/dist/events/eventsApi.d.ts +7 -7
- package/dist/events/eventsApi.js +14 -9
- package/dist/events/eventsInterfaces.d.ts +5 -2
- package/dist/{file-uploding → file-uploading}/fileUploadingApi.d.ts +3 -3
- package/dist/{file-uploding → file-uploading}/fileUploadingApi.js +9 -5
- package/dist/{file-uploding → file-uploading}/fileUploadingInterfaces.d.ts +8 -5
- package/dist/forms/formsApi.d.ts +4 -4
- package/dist/forms/formsApi.js +4 -1
- package/dist/forms/formsInterfaces.d.ts +2 -3
- package/dist/formsData/formsDataApi.d.ts +5 -5
- package/dist/formsData/formsDataApi.js +10 -4
- package/dist/formsData/formsDataInterfaces.d.ts +2 -2
- package/dist/general-types/{typesApi.d.ts → generalTypesApi.d.ts} +4 -4
- package/dist/general-types/{typesApi.js → generalTypesApi.js} +4 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -2
- package/dist/index.d.ts +33 -21
- package/dist/index.js +37 -26
- package/dist/integration-collections/integrationCollectionsApi.d.ts +128 -0
- package/dist/integration-collections/integrationCollectionsApi.js +161 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +57 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
- package/dist/locales/localesApi.d.ts +4 -4
- package/dist/locales/localesApi.js +4 -1
- package/dist/locales/localesInterfaces.d.ts +2 -2
- package/dist/menus/menusApi.d.ts +4 -4
- package/dist/menus/menusApi.js +4 -1
- package/dist/menus/menusInterfaces.d.ts +6 -4
- package/dist/menus/menusInterfaces.js +1 -0
- package/dist/orders/ordersApi.d.ts +8 -8
- package/dist/orders/ordersApi.js +15 -7
- package/dist/orders/ordersInterfaces.d.ts +13 -3
- package/dist/pages/pagesApi.d.ts +4 -10
- package/dist/pages/pagesApi.js +14 -10
- package/dist/pages/pagesInterfaces.d.ts +13 -22
- package/dist/payments/paymentsApi.d.ts +6 -6
- package/dist/payments/paymentsApi.js +14 -6
- package/dist/payments/paymentsInterfaces.d.ts +20 -5
- package/dist/product-statuses/productStatusesApi.d.ts +3 -3
- package/dist/product-statuses/productStatusesApi.js +4 -1
- package/dist/product-statuses/productStatusesInterfaces.d.ts +2 -5
- package/dist/products/productsApi.d.ts +38 -54
- package/dist/products/productsApi.js +63 -61
- package/dist/products/productsInterfaces.d.ts +50 -38
- package/dist/system/systemApi.d.ts +3 -3
- package/dist/system/systemApi.js +5 -1
- package/dist/system/systemInterfaces.d.ts +1 -1
- package/dist/templates/templatesApi.d.ts +6 -3
- package/dist/templates/templatesApi.js +10 -2
- package/dist/templates/templatesInterfaces.d.ts +2 -2
- package/dist/templates-preview/templatesPreviewApi.d.ts +5 -4
- package/dist/templates-preview/templatesPreviewApi.js +5 -1
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +21 -10
- package/dist/users/usersApi.d.ts +15 -4
- package/dist/users/usersApi.js +29 -2
- package/dist/users/usersInterfaces.d.ts +10 -4
- package/dist/web-socket/wsApi.d.ts +4 -4
- package/dist/web-socket/wsApi.js +15 -14
- package/dist/web-socket/wsInterfaces.d.ts +2 -2
- package/package.json +45 -9
- /package/dist/{file-uploding → file-uploading}/fileUploadingInterfaces.js +0 -0
package/configure.js
CHANGED
|
@@ -6,44 +6,35 @@ const path = require('path');
|
|
|
6
6
|
const readline = require('readline');
|
|
7
7
|
|
|
8
8
|
const rl = readline.createInterface({
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
input: process.stdin,
|
|
10
|
+
output: process.stdout
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
rl.question('Enter project name witht https://... : ', (name) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
rl.question('Enter token: ', (token) => {
|
|
15
|
+
rl.close()
|
|
16
|
+
createInterface(name, token)
|
|
17
|
+
})
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
function createInterface(name, token) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
const filePath = 'example.ts'
|
|
23
|
+
fs.writeFile(filePath,
|
|
24
|
+
`
|
|
25
|
+
type BuildInterface<T extends string[]> = {
|
|
26
|
+
[K in T[number]]: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
interface IAttributesList extends BuildInterface<['${name}', '${token}', 'value3']> {}
|
|
29
|
+
export {
|
|
30
|
+
IAttributesList
|
|
31
|
+
}
|
|
32
|
+
`,
|
|
33
|
+
(err) => {
|
|
34
|
+
if (err) {
|
|
35
|
+
console.error(err);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
console.log(`Successfully created ${filePath}`);
|
|
39
|
+
})
|
|
34
40
|
}
|
|
35
|
-
`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
, (err) => {
|
|
39
|
-
if (err) {
|
|
40
|
-
console.error(err);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
console.log(`Successfully created ${filePath}`);
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import AsyncModules from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { AttributeType, IError } from '../base/utils';
|
|
4
|
+
import type { IAdminEntity, IAdmins } from './adminsInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with users - admins
|
|
7
7
|
*/
|
|
8
8
|
export default class AdminsApi extends AsyncModules implements IAdmins {
|
|
9
9
|
protected state: StateModule;
|
|
10
10
|
protected _url: string;
|
|
11
|
+
/**
|
|
12
|
+
* '/api/content/admins'
|
|
13
|
+
*/
|
|
11
14
|
constructor(state: StateModule);
|
|
12
15
|
/**
|
|
13
16
|
* Get all user objects - admins.
|
|
14
17
|
*
|
|
18
|
+
* @param {Array<any>} [body] - array of objects AttributeType
|
|
15
19
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
16
|
-
* @param {number} [offset] -
|
|
17
|
-
* @param {number} [limit] -
|
|
20
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
21
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
18
22
|
*
|
|
19
23
|
* @returns Returns all AdminEntity user objects
|
|
20
24
|
*/
|
|
21
|
-
getAdminsInfo(langCode?: string, offset?: number, limit?: number): Promise<Array<IAdminEntity> | IError>;
|
|
25
|
+
getAdminsInfo(body?: Array<AttributeType>, langCode?: string, offset?: number, limit?: number): Promise<Array<IAdminEntity> | IError>;
|
|
22
26
|
}
|
package/dist/admins/adminsApi.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const asyncModules_1 = require("../base/asyncModules");
|
|
6
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
4
7
|
/**
|
|
5
8
|
* Controllers for working with users - admins
|
|
6
9
|
*/
|
|
7
10
|
class AdminsApi extends asyncModules_1.default {
|
|
11
|
+
/**
|
|
12
|
+
* '/api/content/admins'
|
|
13
|
+
*/
|
|
8
14
|
constructor(state) {
|
|
9
15
|
super(state);
|
|
10
16
|
this._url = state.url + '/api/content/admins';
|
|
@@ -12,14 +18,20 @@ class AdminsApi extends asyncModules_1.default {
|
|
|
12
18
|
/**
|
|
13
19
|
* Get all user objects - admins.
|
|
14
20
|
*
|
|
21
|
+
* @param {Array<any>} [body] - array of objects AttributeType
|
|
15
22
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
16
|
-
* @param {number} [offset] -
|
|
17
|
-
* @param {number} [limit] -
|
|
23
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
24
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
18
25
|
*
|
|
19
26
|
* @returns Returns all AdminEntity user objects
|
|
20
27
|
*/
|
|
21
|
-
async getAdminsInfo(langCode = this.state.lang, offset = 0, limit = 30) {
|
|
22
|
-
const
|
|
28
|
+
async getAdminsInfo(body = [], langCode = this.state.lang, offset = 0, limit = 30) {
|
|
29
|
+
const query = {
|
|
30
|
+
langCode,
|
|
31
|
+
offset,
|
|
32
|
+
limit,
|
|
33
|
+
};
|
|
34
|
+
const response = await this._fetchPost(`/?` + this._queryParamsToString(query), body);
|
|
23
35
|
return this._normalizeData(response, langCode);
|
|
24
36
|
}
|
|
25
37
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { AttributeType, IError } from
|
|
1
|
+
import type { AttributeType, IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents a interface object of Admins Api.
|
|
4
4
|
*
|
|
5
|
-
* @property {function} getAdminsInfo - Get all user objects - admins.
|
|
5
|
+
* @property {function} [getAdminsInfo] - Get all user objects - admins.
|
|
6
6
|
*/
|
|
7
7
|
interface IAdmins {
|
|
8
|
-
getAdminsInfo(langCode: string, offset
|
|
8
|
+
getAdminsInfo(body: Array<AttributeType>, langCode: string, offset: number, limit: number): Promise<Array<IAdminEntity> | IError>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Represents a position object.
|
|
12
12
|
*
|
|
13
13
|
* @interface
|
|
14
|
-
* @property {number} id - The unique identifier of the position.
|
|
15
|
-
* @property {number} position - The position of the object.
|
|
16
|
-
* @property {number} objectId - The unique identifier of the object.
|
|
17
|
-
* @property {string} objectType - The type of the object.
|
|
18
|
-
* @property {boolean} isLocked - Indicates whether the position is locked or not.
|
|
19
|
-
* @property {number} objectCategoryId - The unique identifier of the object's category.
|
|
14
|
+
* @property {number} [id] - The unique identifier of the position.
|
|
15
|
+
* @property {number} [position] - The position of the object.
|
|
16
|
+
* @property {number} [objectId] - The unique identifier of the object.
|
|
17
|
+
* @property {string} [objectType] - The type of the object.
|
|
18
|
+
* @property {boolean} [isLocked] - Indicates whether the position is locked or not.
|
|
19
|
+
* @property {number} [objectCategoryId] - The unique identifier of the object's category.
|
|
20
20
|
*/
|
|
21
21
|
interface IPosition {
|
|
22
22
|
id: number;
|
|
@@ -30,19 +30,33 @@ interface IPosition {
|
|
|
30
30
|
* Represents an object with various properties.
|
|
31
31
|
*
|
|
32
32
|
* @interface
|
|
33
|
-
* @property {number} id - The identifier of the object.
|
|
34
|
-
* @property {string} identifier - The textual identifier for the record field.
|
|
35
|
-
* @property {
|
|
36
|
-
* @property {
|
|
37
|
-
* @property {
|
|
38
|
-
* @property {number} position - The position of the object.
|
|
33
|
+
* @property {number} [id] - The identifier of the object.
|
|
34
|
+
* @property {string} [identifier] - The textual identifier for the record field.
|
|
35
|
+
* @property {number} [attributeSetId] - The identifier of the attribute set being used.
|
|
36
|
+
* @property {boolean} [isSync] - Indication of page indexing.
|
|
37
|
+
* @property {Record<string, any>} [attributesSets] - The attributes with values used by the object.
|
|
38
|
+
* @property {number} [position] - The position of the object.
|
|
39
39
|
*/
|
|
40
40
|
interface IAdminEntity {
|
|
41
|
-
attributeSetId: number | null;
|
|
42
|
-
attributeValues: AttributeType;
|
|
43
41
|
id: number;
|
|
44
42
|
identifier: string;
|
|
43
|
+
attributeSetId: number | null;
|
|
45
44
|
isSync: boolean;
|
|
46
|
-
|
|
45
|
+
attributesSets: Record<string, any>;
|
|
46
|
+
position: number | null;
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Represents IAdmin query parameters object.
|
|
51
|
+
*
|
|
52
|
+
* @interface
|
|
53
|
+
* @property {number} [langCode] - Language code. Default "en_US"
|
|
54
|
+
* @property {number} [offset] - Parameter for pagination, default 0.
|
|
55
|
+
* @property {number} [limit] - Parameter for pagination, default 30.
|
|
56
|
+
*/
|
|
57
|
+
interface IAdminQuery {
|
|
58
|
+
langCode: string;
|
|
59
|
+
offset: number;
|
|
60
|
+
limit: number;
|
|
47
61
|
}
|
|
48
|
-
export {
|
|
62
|
+
export type { IAdminEntity, IAdminQuery, IAdmins, IPosition };
|
|
@@ -1,31 +1,56 @@
|
|
|
1
|
-
import AsyncModules from
|
|
2
|
-
import
|
|
3
|
-
import { IError } from
|
|
4
|
-
import
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponce } from './attributeSetsInterfaces';
|
|
5
5
|
/**
|
|
6
|
-
* Controllers for working with attributes.
|
|
6
|
+
* Controllers for working with attributes - AttributesSetsApi.
|
|
7
|
+
* @class
|
|
7
8
|
*/
|
|
8
9
|
export default class AttributesSetsApi extends AsyncModules implements IAttributesSets {
|
|
9
10
|
protected state: StateModule;
|
|
10
11
|
protected _url: string;
|
|
12
|
+
/**
|
|
13
|
+
* '/api/content/attributes-sets'
|
|
14
|
+
*/
|
|
11
15
|
constructor(state: StateModule);
|
|
12
16
|
/**
|
|
13
|
-
*
|
|
17
|
+
* Getting all attribute sets objects
|
|
18
|
+
*
|
|
19
|
+
* @param {number} [langCode] - Language code.
|
|
20
|
+
* @param {number} [limit] - parameter limiting the selection of records, default - 30. Example : 30
|
|
21
|
+
* @param {number} [offset] - parameter offset of record selection, default - 0.Example : 0
|
|
22
|
+
* @param {number} [typeId] - identifier of the attribute set type. Example : null
|
|
23
|
+
* @param {string} [sortBy] - identifier of the attribute set type. Example : null
|
|
24
|
+
*
|
|
25
|
+
* @returns Returns an array of AttributeInSet objects.
|
|
26
|
+
*/
|
|
27
|
+
getAttributes(langCode?: string, limit?: number, offset?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponce | IError>;
|
|
28
|
+
/**
|
|
29
|
+
* Getting all attributes with data from the attribute set
|
|
14
30
|
*
|
|
15
|
-
* @param {string} marker - Attribute marker.
|
|
31
|
+
* @param {string} [marker] - Attribute marker.
|
|
16
32
|
* @param {string} [langCode] - Language code.
|
|
17
33
|
*
|
|
18
34
|
* @returns Returns an array of AttributeInSet objects.
|
|
19
35
|
*/
|
|
20
36
|
getAttributesByMarker(marker: string, langCode?: string): Promise<Array<IAttributesSetsEntity> | IError>;
|
|
37
|
+
/**
|
|
38
|
+
* Getting a single object from a set of attributes by marker
|
|
39
|
+
*
|
|
40
|
+
* @param {string} [marker] - marker of the attribute set object
|
|
41
|
+
* @param {string} [langCode] - Language code.
|
|
42
|
+
*
|
|
43
|
+
* @returns Returns one object ContentPositionAttributesSetDto of the attribute set
|
|
44
|
+
*/
|
|
45
|
+
getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
|
|
21
46
|
/**
|
|
22
47
|
* Get a single attribute with data from the attribute sets.
|
|
23
48
|
*
|
|
24
|
-
* @param {string}
|
|
25
|
-
* @param {string}
|
|
49
|
+
* @param {string} [setMarker] - Text identifier (marker) of the attribute set.
|
|
50
|
+
* @param {string} [attributeMarker] - Text identifier (marker) of the attribute in the set.
|
|
26
51
|
* @param {string} [langCode] - Language code.
|
|
27
52
|
*
|
|
28
53
|
* @returns Returns a AttributeInSet object.
|
|
29
54
|
*/
|
|
30
|
-
getSingleAttributeByMarkerSet(
|
|
55
|
+
getSingleAttributeByMarkerSet(setMarker: string, attributeMarker: string, langCode?: string): Promise<IAttributesSetsEntity | IError>;
|
|
31
56
|
}
|
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
4
8
|
/**
|
|
5
|
-
* Controllers for working with attributes.
|
|
9
|
+
* Controllers for working with attributes - AttributesSetsApi.
|
|
10
|
+
* @class
|
|
6
11
|
*/
|
|
7
12
|
class AttributesSetsApi extends asyncModules_1.default {
|
|
13
|
+
/**
|
|
14
|
+
* '/api/content/attributes-sets'
|
|
15
|
+
*/
|
|
8
16
|
constructor(state) {
|
|
9
17
|
super(state);
|
|
10
18
|
this._url = state.url + '/api/content/attributes-sets';
|
|
11
19
|
}
|
|
12
20
|
/**
|
|
13
|
-
*
|
|
21
|
+
* Getting all attribute sets objects
|
|
22
|
+
*
|
|
23
|
+
* @param {number} [langCode] - Language code.
|
|
24
|
+
* @param {number} [limit] - parameter limiting the selection of records, default - 30. Example : 30
|
|
25
|
+
* @param {number} [offset] - parameter offset of record selection, default - 0.Example : 0
|
|
26
|
+
* @param {number} [typeId] - identifier of the attribute set type. Example : null
|
|
27
|
+
* @param {string} [sortBy] - identifier of the attribute set type. Example : null
|
|
28
|
+
*
|
|
29
|
+
* @returns Returns an array of AttributeInSet objects.
|
|
30
|
+
*/
|
|
31
|
+
async getAttributes(langCode = this.state.lang, limit = 30, offset = 0, typeId = null, sortBy = 'id') {
|
|
32
|
+
const query = {
|
|
33
|
+
langCode,
|
|
34
|
+
limit,
|
|
35
|
+
offset,
|
|
36
|
+
typeId,
|
|
37
|
+
sortBy,
|
|
38
|
+
};
|
|
39
|
+
const result = await this._fetchGet(`/?` + this._queryParamsToString(query));
|
|
40
|
+
return this._dataPostProcess(result, langCode);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Getting all attributes with data from the attribute set
|
|
14
44
|
*
|
|
15
|
-
* @param {string} marker - Attribute marker.
|
|
45
|
+
* @param {string} [marker] - Attribute marker.
|
|
16
46
|
* @param {string} [langCode] - Language code.
|
|
17
47
|
*
|
|
18
48
|
* @returns Returns an array of AttributeInSet objects.
|
|
@@ -21,16 +51,28 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
21
51
|
const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
|
|
22
52
|
return this._dataPostProcess(result, langCode);
|
|
23
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Getting a single object from a set of attributes by marker
|
|
56
|
+
*
|
|
57
|
+
* @param {string} [marker] - marker of the attribute set object
|
|
58
|
+
* @param {string} [langCode] - Language code.
|
|
59
|
+
*
|
|
60
|
+
* @returns Returns one object ContentPositionAttributesSetDto of the attribute set
|
|
61
|
+
*/
|
|
62
|
+
async getAttributeSetByMarker(marker, langCode = this.state.lang) {
|
|
63
|
+
const result = await this._fetchGet(`/marker/${marker}/?langCode=${langCode}`);
|
|
64
|
+
return this._dataPostProcess(result, langCode);
|
|
65
|
+
}
|
|
24
66
|
/**
|
|
25
67
|
* Get a single attribute with data from the attribute sets.
|
|
26
68
|
*
|
|
27
|
-
* @param {string}
|
|
28
|
-
* @param {string}
|
|
69
|
+
* @param {string} [setMarker] - Text identifier (marker) of the attribute set.
|
|
70
|
+
* @param {string} [attributeMarker] - Text identifier (marker) of the attribute in the set.
|
|
29
71
|
* @param {string} [langCode] - Language code.
|
|
30
72
|
*
|
|
31
73
|
* @returns Returns a AttributeInSet object.
|
|
32
74
|
*/
|
|
33
|
-
async getSingleAttributeByMarkerSet(
|
|
75
|
+
async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
|
|
34
76
|
const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
|
|
35
77
|
return result;
|
|
36
78
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import { IError } from
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of AttributesSets Api.
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getAttributesByMarker - Get all attributes with data from the attribute sets.
|
|
6
|
-
*
|
|
7
6
|
* @property {function} getSingleAttributeByMarkerSet - Get a single attribute with data from the attribute sets.
|
|
8
7
|
*/
|
|
9
8
|
interface IAttributesSets {
|
|
10
9
|
getAttributesByMarker(marker: string, langCode: string): Promise<Array<IAttributesSetsEntity> | IError>;
|
|
11
10
|
getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity | IError>;
|
|
12
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents an interface object of IListTitle.
|
|
14
|
+
*
|
|
15
|
+
* @property {string} title
|
|
16
|
+
* @property {number | string} value
|
|
17
|
+
* @property {string | number | null} position
|
|
18
|
+
* @property {object} extended
|
|
19
|
+
*/
|
|
13
20
|
interface IListTitle {
|
|
14
21
|
title: string;
|
|
15
22
|
value: number | string;
|
|
@@ -37,16 +44,40 @@ interface IAttributesSetsEntity {
|
|
|
37
44
|
type: AttributeType;
|
|
38
45
|
marker: string;
|
|
39
46
|
position: number;
|
|
40
|
-
validators:
|
|
41
|
-
requiredValidator: {
|
|
42
|
-
strict: boolean;
|
|
43
|
-
};
|
|
44
|
-
defaultValueValidator: {
|
|
45
|
-
fieldDefaultValue: number;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
47
|
+
validators: object;
|
|
48
48
|
localizeInfos: Record<string, any>;
|
|
49
49
|
listTitles: Array<IListTitle> | Record<string, any>;
|
|
50
|
+
additionalFields?: Record<string, any>;
|
|
50
51
|
settings?: Record<string, any>;
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Represents an interface object of IAttributeSetsEntity.
|
|
55
|
+
*
|
|
56
|
+
* @property {number} id
|
|
57
|
+
* @property {string} identifier
|
|
58
|
+
* @property {boolean} isVisible
|
|
59
|
+
* @property {number} position
|
|
60
|
+
*/
|
|
61
|
+
interface IAttributeSetsEntity {
|
|
62
|
+
id: number;
|
|
63
|
+
identifier: string;
|
|
64
|
+
isVisible: boolean;
|
|
65
|
+
position: number;
|
|
66
|
+
schema: any;
|
|
67
|
+
title: string;
|
|
68
|
+
type: any;
|
|
69
|
+
typeId: number;
|
|
70
|
+
updatedDate: string;
|
|
71
|
+
version: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Represents an interface object of IAttributesSetsResponce.
|
|
75
|
+
*
|
|
76
|
+
* @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity
|
|
77
|
+
* @property {number} total - total items
|
|
78
|
+
*/
|
|
79
|
+
interface IAttributesSetsResponce {
|
|
80
|
+
items: IAttributeSetsEntity[];
|
|
81
|
+
total: number;
|
|
82
|
+
}
|
|
83
|
+
export type { AttributeType, IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponce, IListTitle, };
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import AsyncModules from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IAuthEntity, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, ISignUpData, ISignUpEntity } from './authProvidersInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with auth services.
|
|
7
7
|
*/
|
|
8
8
|
export default class AuthProviderApi extends AsyncModules implements IAuthProvider {
|
|
9
9
|
protected state: StateModule;
|
|
10
10
|
protected _url: string;
|
|
11
|
+
/**
|
|
12
|
+
* '/api/content/users-auth-providers'
|
|
13
|
+
*/
|
|
11
14
|
constructor(state: StateModule);
|
|
12
15
|
/**
|
|
13
16
|
* User registration
|
|
17
|
+
*
|
|
14
18
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
15
19
|
* @param data - Request body
|
|
16
20
|
* @param {string} langCode - Optional language field
|
|
@@ -45,6 +49,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
45
49
|
signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
|
|
46
50
|
/**
|
|
47
51
|
* Getting a user activation code. The code is returned via the appropriate user notification method
|
|
52
|
+
*
|
|
48
53
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
49
54
|
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
50
55
|
* @param {string} eventIdentifier - Text identifier of the event object for which the code is generated
|
|
@@ -52,6 +57,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
52
57
|
generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
|
|
53
58
|
/**
|
|
54
59
|
* User activation code verification. Returns true (if the code is correct) or false (if it is incorrect).
|
|
60
|
+
*
|
|
55
61
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
56
62
|
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
57
63
|
* @param {string} code - Service code
|
|
@@ -59,6 +65,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
59
65
|
checkCode(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
|
|
60
66
|
/**
|
|
61
67
|
* User activate.
|
|
68
|
+
*
|
|
62
69
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
63
70
|
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
64
71
|
* @param {string} code - Service code
|
|
@@ -66,6 +73,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
66
73
|
activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
|
|
67
74
|
/**
|
|
68
75
|
* User authorization
|
|
76
|
+
*
|
|
69
77
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
70
78
|
* @param {IAuthPostBody} data - Array of objects contains auth information
|
|
71
79
|
*
|
|
@@ -87,14 +95,15 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
87
95
|
auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
|
|
88
96
|
/**
|
|
89
97
|
* Refresh token
|
|
98
|
+
*
|
|
90
99
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
91
100
|
* @param {string} token - Refresh token
|
|
92
101
|
*
|
|
93
102
|
*/
|
|
94
103
|
refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
|
|
95
104
|
/**
|
|
96
|
-
*
|
|
97
105
|
* User logout.
|
|
106
|
+
*
|
|
98
107
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
99
108
|
* @param {string} token - Refresh token
|
|
100
109
|
*
|
|
@@ -103,6 +112,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
103
112
|
logout(marker: string, token: string): Promise<boolean | IError>;
|
|
104
113
|
/**
|
|
105
114
|
* Change password
|
|
115
|
+
*
|
|
106
116
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
107
117
|
* @param {string} userIdentifier - The text identifier of the user's object (user login)
|
|
108
118
|
* @param {string} code - Service code
|
|
@@ -113,6 +123,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
113
123
|
changePassword(marker: string, userIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
|
|
114
124
|
/**
|
|
115
125
|
* Get all auth providers objects
|
|
126
|
+
*
|
|
116
127
|
* @param {string} [langCode] - Language code. Default "en_US"
|
|
117
128
|
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
118
129
|
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
@@ -120,6 +131,7 @@ export default class AuthProviderApi extends AsyncModules implements IAuthProvid
|
|
|
120
131
|
getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<Array<IAuthProvidersEntity> | IError>;
|
|
121
132
|
/**
|
|
122
133
|
* Get one auth provider object by marker
|
|
134
|
+
*
|
|
123
135
|
* @param {string} marker - The text identifier of the authorization provider. Example - email
|
|
124
136
|
* @param {string} [langCode] - Optional parameter language code. Default "en_US"
|
|
125
137
|
*/
|