oneentry 1.0.124 → 1.0.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -22
- package/dist/admins/adminsApi.d.ts +17 -4
- package/dist/admins/adminsApi.js +16 -3
- package/dist/admins/adminsInterfaces.d.ts +47 -26
- package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
- package/dist/attribute-sets/attributeSetsApi.js +9 -17
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
- package/dist/auth-provider/authProviderApi.d.ts +146 -36
- package/dist/auth-provider/authProviderApi.js +163 -37
- package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
- package/dist/base/asyncModules.d.ts +7 -1
- package/dist/base/asyncModules.js +127 -21
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +4 -0
- package/dist/base/syncModules.js +19 -1
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +7 -17
- package/dist/blocks/blocksApi.js +7 -17
- package/dist/blocks/blocksInterfaces.d.ts +77 -32
- package/dist/events/eventsApi.d.ts +7 -8
- package/dist/events/eventsApi.js +12 -7
- package/dist/events/eventsInterfaces.d.ts +16 -11
- package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
- package/dist/file-uploading/fileUploadingApi.js +20 -12
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
- package/dist/forms/formsApi.d.ts +3 -7
- package/dist/forms/formsApi.js +2 -6
- package/dist/forms/formsInterfaces.d.ts +44 -28
- package/dist/formsData/formsDataApi.d.ts +21 -9
- package/dist/formsData/formsDataApi.js +21 -9
- package/dist/formsData/formsDataInterfaces.d.ts +128 -45
- package/dist/general-types/generalTypesApi.d.ts +1 -3
- package/dist/general-types/generalTypesApi.js +0 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
- package/dist/integration-collections/integrationCollectionsApi.js +64 -45
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
- package/dist/locales/localesApi.d.ts +1 -2
- package/dist/locales/localesApi.js +1 -2
- package/dist/locales/localesInterfaces.d.ts +2 -4
- package/dist/menus/menusApi.d.ts +1 -3
- package/dist/menus/menusApi.js +1 -3
- package/dist/menus/menusInterfaces.d.ts +39 -13
- package/dist/orders/ordersApi.d.ts +36 -18
- package/dist/orders/ordersApi.js +40 -22
- package/dist/orders/ordersInterfaces.d.ts +163 -81
- package/dist/pages/pagesApi.d.ts +48 -48
- package/dist/pages/pagesApi.js +40 -45
- package/dist/pages/pagesInterfaces.d.ts +147 -98
- package/dist/payments/paymentsApi.d.ts +25 -45
- package/dist/payments/paymentsApi.js +27 -46
- package/dist/payments/paymentsInterfaces.d.ts +42 -60
- package/dist/product-statuses/productStatusesApi.d.ts +6 -12
- package/dist/product-statuses/productStatusesApi.js +5 -11
- package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
- package/dist/products/productsApi.d.ts +256 -104
- package/dist/products/productsApi.js +263 -97
- package/dist/products/productsInterfaces.d.ts +343 -160
- package/dist/system/systemApi.d.ts +21 -10
- package/dist/system/systemApi.js +22 -8
- package/dist/system/systemInterfaces.d.ts +0 -1
- package/dist/templates/templatesApi.d.ts +6 -12
- package/dist/templates/templatesApi.js +4 -10
- package/dist/templates/templatesInterfaces.d.ts +20 -20
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
- package/dist/templates-preview/templatesPreviewApi.js +1 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
- package/dist/users/usersApi.d.ts +33 -13
- package/dist/users/usersApi.js +38 -15
- package/dist/users/usersInterfaces.d.ts +78 -27
- package/dist/web-socket/wsApi.d.ts +1 -5
- package/dist/web-socket/wsApi.js +1 -5
- package/dist/web-socket/wsInterfaces.d.ts +0 -1
- package/package.json +18 -16
package/README.md
CHANGED
|
@@ -183,26 +183,28 @@ Now you can use the following links to jump to specific entries documentation:
|
|
|
183
183
|
|
|
184
184
|
- [Documentation](https://js-sdk.oneentry.cloud/docs/index)
|
|
185
185
|
|
|
186
|
-
- [Admins](https://js-sdk.oneentry.cloud/docs/admins)
|
|
187
|
-
- [AttributesSets](https://js-sdk.oneentry.cloud/docs/
|
|
188
|
-
- [AuthProvider](https://js-sdk.oneentry.cloud/docs/
|
|
189
|
-
- [Blocks](https://js-sdk.oneentry.cloud/docs/blocks)
|
|
190
|
-
- [Events](https://js-sdk.oneentry.cloud/docs/events)
|
|
191
|
-
- [
|
|
192
|
-
- [
|
|
193
|
-
- [
|
|
194
|
-
- [GeneralTypes](https://js-sdk.oneentry.cloud/docs/
|
|
195
|
-
- [
|
|
196
|
-
- [
|
|
197
|
-
- [
|
|
198
|
-
- [
|
|
199
|
-
- [
|
|
200
|
-
- [
|
|
201
|
-
- [
|
|
202
|
-
- [ProductStatuses](https://js-sdk.oneentry.cloud/docs/
|
|
203
|
-
- [
|
|
204
|
-
- [
|
|
205
|
-
- [
|
|
206
|
-
- [
|
|
207
|
-
- [
|
|
186
|
+
- [Admins](https://js-sdk.oneentry.cloud/docs/category/admins)
|
|
187
|
+
- [AttributesSets](https://js-sdk.oneentry.cloud/docs/category/attributessets)
|
|
188
|
+
- [AuthProvider](https://js-sdk.oneentry.cloud/docs/category/authprovider)
|
|
189
|
+
- [Blocks](https://js-sdk.oneentry.cloud/docs/category/blocks)
|
|
190
|
+
- [Events](https://js-sdk.oneentry.cloud/docs/category/events)
|
|
191
|
+
- [FileUploading](https://js-sdk.oneentry.cloud/docs/category/fileuploading)
|
|
192
|
+
- [Forms](https://js-sdk.oneentry.cloud/docs/category/forms-1)
|
|
193
|
+
- [FormData](https://js-sdk.oneentry.cloud/docs/category/formdata)
|
|
194
|
+
- [GeneralTypes](https://js-sdk.oneentry.cloud/docs/category/generaltypes)
|
|
195
|
+
- [ImmutableSettings](https://js-sdk.oneentry.cloud/docs/category/immutablesettings)
|
|
196
|
+
- [IntegrationCollections](https://js-sdk.oneentry.cloud/docs/category/integrationcollections)
|
|
197
|
+
- [Locales](https://js-sdk.oneentry.cloud/docs/category/locales)
|
|
198
|
+
- [Menus](https://js-sdk.oneentry.cloud/docs/category/menus)
|
|
199
|
+
- [Orders](https://js-sdk.oneentry.cloud/docs/category/orders-1)
|
|
200
|
+
- [Pages](https://js-sdk.oneentry.cloud/docs/category/pages)
|
|
201
|
+
- [Payments](https://js-sdk.oneentry.cloud/docs/category/payments)
|
|
202
|
+
- [ProductStatuses](https://js-sdk.oneentry.cloud/docs/category/productstatuses)
|
|
203
|
+
- [Products](https://js-sdk.oneentry.cloud/docs/category/products-1)
|
|
204
|
+
- [Settings](https://js-sdk.oneentry.cloud/docs/category/settings)
|
|
205
|
+
- [System](https://js-sdk.oneentry.cloud/docs/category/system)
|
|
206
|
+
- [Templates](https://js-sdk.oneentry.cloud/docs/category/templates)
|
|
207
|
+
- [TemplatePreviews](https://js-sdk.oneentry.cloud/docs/category/templatepreviews)
|
|
208
|
+
- [Users](https://js-sdk.oneentry.cloud/docs/category/users-1)
|
|
209
|
+
- [WS](https://js-sdk.oneentry.cloud/docs/category/web-socket)
|
|
208
210
|
- [Advanced examples](https://js-sdk.oneentry.cloud/docs/category/usage-examples)
|
|
@@ -18,15 +18,28 @@ export default class AdminsApi extends AsyncModules implements IAdmins {
|
|
|
18
18
|
*
|
|
19
19
|
* @handleName getAdminsInfo
|
|
20
20
|
*
|
|
21
|
-
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
21
|
+
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: []. Example:
|
|
22
|
+
[
|
|
23
|
+
{
|
|
24
|
+
"attributeMarker": "num",
|
|
25
|
+
"conditionMarker": "mth",
|
|
26
|
+
"conditionValue": 1
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"attributeMarker": "num",
|
|
30
|
+
"conditionMarker": "lth",
|
|
31
|
+
"conditionValue": 3
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
* @param {string} [body.attributeMarker] - Text identifier (marker) of the attribute in the set. Example: "num".
|
|
35
|
+
* @param {string} [body.conditionMarker] - Text identifier (marker) of the condition in the set. Example: "mth".
|
|
36
|
+
* @param {string} [body.conditionValue] - Value of the condition. Example: 1.
|
|
22
37
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
38
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
24
39
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
25
|
-
*
|
|
26
40
|
* @return {IAdminEntity[]} Returns an array of admin objects.
|
|
27
41
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
|
-
*
|
|
29
42
|
* @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.
|
|
30
43
|
*/
|
|
31
|
-
getAdminsInfo(body?:
|
|
44
|
+
getAdminsInfo(body?: AttributeType[], langCode?: string, offset?: number, limit?: number): Promise<IAdminEntity[] | IError>;
|
|
32
45
|
}
|
package/dist/admins/adminsApi.js
CHANGED
|
@@ -21,14 +21,27 @@ class AdminsApi extends asyncModules_1.default {
|
|
|
21
21
|
*
|
|
22
22
|
* @handleName getAdminsInfo
|
|
23
23
|
*
|
|
24
|
-
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: [].
|
|
24
|
+
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: []. Example:
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
"attributeMarker": "num",
|
|
28
|
+
"conditionMarker": "mth",
|
|
29
|
+
"conditionValue": 1
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"attributeMarker": "num",
|
|
33
|
+
"conditionMarker": "lth",
|
|
34
|
+
"conditionValue": 3
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
* @param {string} [body.attributeMarker] - Text identifier (marker) of the attribute in the set. Example: "num".
|
|
38
|
+
* @param {string} [body.conditionMarker] - Text identifier (marker) of the condition in the set. Example: "mth".
|
|
39
|
+
* @param {string} [body.conditionValue] - Value of the condition. Example: 1.
|
|
25
40
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
26
41
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
27
42
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
28
|
-
*
|
|
29
43
|
* @return {IAdminEntity[]} Returns an array of admin objects.
|
|
30
44
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
31
|
-
*
|
|
32
45
|
* @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.
|
|
33
46
|
*/
|
|
34
47
|
async getAdminsInfo(body = [], langCode = this.state.lang, offset = 0, limit = 30) {
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
import type { AttributeType, IError } from '../base/utils';
|
|
1
|
+
import type { AttributeType, IAttributeValues, IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IAdmins
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getAdminsInfo - Method to retrieve all admin user objects.
|
|
6
|
-
*
|
|
7
6
|
* @description This interface defines the contract for any class that implements it
|
|
8
7
|
*/
|
|
9
8
|
interface IAdmins {
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* Get all admins objects with filters.
|
|
12
11
|
*
|
|
13
|
-
* @
|
|
14
|
-
* @param {string} [langCode] - The language code for localization purposes. Default: "en_US".
|
|
15
|
-
* @param {number} [offset] - The starting point for pagination. Default: 0.
|
|
16
|
-
* @param {number} [limit] - The maximum number of results to return. Default: 30.
|
|
12
|
+
* @handleName getAdminsInfo
|
|
17
13
|
*
|
|
14
|
+
* @param {AttributeType[]} [body] - Array of filter objects with search conditions. Default: []. Example:
|
|
15
|
+
[
|
|
16
|
+
{
|
|
17
|
+
"attributeMarker": "num",
|
|
18
|
+
"conditionMarker": "mth",
|
|
19
|
+
"conditionValue": 1
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"attributeMarker": "num",
|
|
23
|
+
"conditionMarker": "lth",
|
|
24
|
+
"conditionValue": 3
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
* @param {string} [body.attributeMarker] - Text identifier (marker) of the attribute in the set. Example: "num".
|
|
28
|
+
* @param {string} [body.conditionMarker] - Text identifier (marker) of the condition in the set. Example: "mth".
|
|
29
|
+
* @param {string} [body.conditionValue] - Value of the condition. Example: 1.
|
|
30
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
31
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
32
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
18
33
|
* @return {IAdminEntity[]} Returns an array of admin objects.
|
|
19
34
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
20
|
-
*
|
|
21
35
|
* @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
36
|
*/
|
|
23
|
-
getAdminsInfo(body:
|
|
37
|
+
getAdminsInfo(body: AttributeType[], langCode: string, offset: number, limit: number): Promise<IAdminEntity[] | IError>;
|
|
24
38
|
}
|
|
25
39
|
/**
|
|
26
40
|
* Interface representing a Position entity.
|
|
@@ -28,21 +42,20 @@ interface IAdmins {
|
|
|
28
42
|
* @interface IPosition
|
|
29
43
|
*
|
|
30
44
|
* @property {number} id - The unique identifier of the position. Example: 1764.
|
|
31
|
-
* @property {number} position - The position of the object. Example: 192.
|
|
32
|
-
* @property {number} objectId - The unique identifier of the object. Example: 120.
|
|
33
|
-
* @property {string} objectType - The type of the object. Example: "admin".
|
|
34
45
|
* @property {boolean} [isLocked] - Indicates whether the position is locked or not. Example: false.
|
|
46
|
+
* @property {number} objectId - The unique identifier of the object. Example: 120.
|
|
35
47
|
* @property {number} [objectCategoryId] - The unique identifier of the object's category. Example: 5.
|
|
36
|
-
*
|
|
48
|
+
* @property {string} objectType - The type of the object. Example: "admin".
|
|
49
|
+
* @property {number} position - The position of the object. Example: 192.
|
|
37
50
|
* @description This interface outlines the properties associated with a position within a system.
|
|
38
51
|
*/
|
|
39
52
|
interface IPosition {
|
|
40
53
|
id: number;
|
|
41
|
-
position: number;
|
|
42
|
-
objectId: number;
|
|
43
|
-
objectType: string;
|
|
44
54
|
isLocked?: boolean;
|
|
55
|
+
objectId: number;
|
|
45
56
|
objectCategoryId?: number;
|
|
57
|
+
objectType: string;
|
|
58
|
+
position: number;
|
|
46
59
|
}
|
|
47
60
|
/**
|
|
48
61
|
* Interface representing an Admin Entity.
|
|
@@ -50,21 +63,30 @@ interface IPosition {
|
|
|
50
63
|
* @interface IAdminEntity
|
|
51
64
|
*
|
|
52
65
|
* @property {number} id - The identifier of the object. Example: 1764.
|
|
66
|
+
* @property {number | null} attributeSetId - The identifier of the attribute set being used. Example: 120.
|
|
53
67
|
* @property {string} identifier - The textual identifier for the record field. Example: "admin1".
|
|
54
|
-
* @property {
|
|
68
|
+
* @property {string | null} attributeSetIdentifier - The identifier of the attribute set. Example: "admins".
|
|
69
|
+
* @property {number | null} position - Position number (for sorting). Example: 1.
|
|
55
70
|
* @property {boolean} isSync - Page indexing flag (true or false). Example: true.
|
|
56
|
-
* @property {
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
* @property {IAttributeValues} attributeValues - Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value). Example:
|
|
72
|
+
[
|
|
73
|
+
{
|
|
74
|
+
"marker": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"value": "Some value"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
59
80
|
* @description This interface captures the essential details and additional attributes of an admin entity.
|
|
60
81
|
*/
|
|
61
82
|
interface IAdminEntity {
|
|
62
83
|
id: number;
|
|
63
|
-
identifier: string;
|
|
64
84
|
attributeSetId: number | null;
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
identifier: string;
|
|
86
|
+
attributeSetIdentifier: string | null;
|
|
67
87
|
position: number | null;
|
|
88
|
+
isSync: boolean;
|
|
89
|
+
attributeValues: IAttributeValues;
|
|
68
90
|
[key: string]: any;
|
|
69
91
|
}
|
|
70
92
|
/**
|
|
@@ -73,14 +95,13 @@ interface IAdminEntity {
|
|
|
73
95
|
* @interface IAdminQuery
|
|
74
96
|
*
|
|
75
97
|
* @property {number} langCode - Language code. Default: "en_US".
|
|
76
|
-
* @property {number} offset - Parameter for pagination. Default: 0.
|
|
77
98
|
* @property {number} limit - Parameter for pagination. Default: 30.
|
|
78
|
-
*
|
|
99
|
+
* @property {number} offset - Parameter for pagination. Default: 0.
|
|
79
100
|
* @description This interface defines the parameters required for querying admin data, including optional defaults.
|
|
80
101
|
*/
|
|
81
102
|
interface IAdminQuery {
|
|
82
103
|
langCode: string;
|
|
83
|
-
offset: number;
|
|
84
104
|
limit: number;
|
|
105
|
+
offset: number;
|
|
85
106
|
}
|
|
86
107
|
export type { IAdminEntity, IAdminQuery, IAdmins, IPosition };
|
|
@@ -18,15 +18,13 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
18
18
|
*
|
|
19
19
|
* @handleName getAttributes
|
|
20
20
|
*
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {number} [limit] - parameter limiting the selection of records. Default: 30.
|
|
21
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
22
|
* @param {number} [offset] - parameter offset of record selection. Default: 0.
|
|
24
|
-
* @param {number} [
|
|
25
|
-
* @param {
|
|
26
|
-
*
|
|
23
|
+
* @param {number} [limit] - parameter limiting the selection of records. Default: 30.
|
|
24
|
+
* @param {number} [typeId] - identifier of the attribute set type. Default: null.
|
|
25
|
+
* @param {string} [sortBy] - identifier of the attribute set type. Default: "id".
|
|
27
26
|
* @return {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
|
|
28
27
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
29
|
-
*
|
|
30
28
|
* @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
29
|
*/
|
|
32
30
|
getAttributes(langCode?: string, offset?: number, limit?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponse | IError>;
|
|
@@ -35,27 +33,23 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
35
33
|
*
|
|
36
34
|
* @handleName getAttributesByMarker
|
|
37
35
|
*
|
|
38
|
-
* @param {string} marker - Attribute marker. Example:
|
|
36
|
+
* @param {string} marker - Attribute marker. Example: "productAttributes".
|
|
39
37
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
40
|
-
*
|
|
41
|
-
* @return {IAttributesSetsEntity} Returns an array of Attributes objects.
|
|
38
|
+
* @return {IAttributeSetsEntity[]} Returns an array of Attributes objects.
|
|
42
39
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
43
|
-
*
|
|
44
40
|
* @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.
|
|
45
41
|
*/
|
|
46
|
-
getAttributesByMarker(marker: string, langCode?: string): Promise<
|
|
42
|
+
getAttributesByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity[] | IError>;
|
|
47
43
|
/**
|
|
48
44
|
* Get a single attribute with data from the attribute sets.
|
|
49
45
|
*
|
|
50
46
|
* @handleName getSingleAttributeByMarkerSet
|
|
51
47
|
*
|
|
52
|
-
* @param {string} setMarker - Text identifier (marker) of the attribute set. Example:
|
|
53
|
-
* @param {string} attributeMarker - Text identifier (marker) of the attribute in the set. Example:
|
|
48
|
+
* @param {string} setMarker - Text identifier (marker) of the attribute set. Example: "productAttributes".
|
|
49
|
+
* @param {string} attributeMarker - Text identifier (marker) of the attribute in the set. Example: "color".
|
|
54
50
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
55
|
-
*
|
|
56
51
|
* @return {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
|
|
57
52
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
58
|
-
*
|
|
59
53
|
* @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.
|
|
60
54
|
*/
|
|
61
55
|
getSingleAttributeByMarkerSet(setMarker: string, attributeMarker: string, langCode?: string): Promise<IAttributesSetsEntity | IError>;
|
|
@@ -64,12 +58,10 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
64
58
|
*
|
|
65
59
|
* @handleName getAttributeSetByMarker
|
|
66
60
|
*
|
|
67
|
-
* @param {string} marker - marker of the attribute set object. Example:
|
|
61
|
+
* @param {string} marker - marker of the attribute set object. Example: "productAttributes".
|
|
68
62
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
69
|
-
*
|
|
70
63
|
* @return {IAttributeSetsEntity} Returns one object of the attribute set.
|
|
71
64
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
72
|
-
*
|
|
73
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.
|
|
74
66
|
*/
|
|
75
67
|
getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
|
|
@@ -21,15 +21,13 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
21
21
|
*
|
|
22
22
|
* @handleName getAttributes
|
|
23
23
|
*
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {number} [limit] - parameter limiting the selection of records. Default: 30.
|
|
24
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
26
25
|
* @param {number} [offset] - parameter offset of record selection. Default: 0.
|
|
27
|
-
* @param {number} [
|
|
28
|
-
* @param {
|
|
29
|
-
*
|
|
26
|
+
* @param {number} [limit] - parameter limiting the selection of records. Default: 30.
|
|
27
|
+
* @param {number} [typeId] - identifier of the attribute set type. Default: null.
|
|
28
|
+
* @param {string} [sortBy] - identifier of the attribute set type. Default: "id".
|
|
30
29
|
* @return {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
|
|
31
30
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
32
|
-
*
|
|
33
31
|
* @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.
|
|
34
32
|
*/
|
|
35
33
|
async getAttributes(langCode = this.state.lang, offset = 0, limit = 30,
|
|
@@ -51,12 +49,10 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
51
49
|
*
|
|
52
50
|
* @handleName getAttributesByMarker
|
|
53
51
|
*
|
|
54
|
-
* @param {string} marker - Attribute marker. Example:
|
|
52
|
+
* @param {string} marker - Attribute marker. Example: "productAttributes".
|
|
55
53
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
56
|
-
*
|
|
57
|
-
* @return {IAttributesSetsEntity} Returns an array of Attributes objects.
|
|
54
|
+
* @return {IAttributeSetsEntity[]} Returns an array of Attributes objects.
|
|
58
55
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
59
|
-
*
|
|
60
56
|
* @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.
|
|
61
57
|
*/
|
|
62
58
|
async getAttributesByMarker(marker, langCode = this.state.lang) {
|
|
@@ -68,13 +64,11 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
68
64
|
*
|
|
69
65
|
* @handleName getSingleAttributeByMarkerSet
|
|
70
66
|
*
|
|
71
|
-
* @param {string} setMarker - Text identifier (marker) of the attribute set. Example:
|
|
72
|
-
* @param {string} attributeMarker - Text identifier (marker) of the attribute in the set. Example:
|
|
67
|
+
* @param {string} setMarker - Text identifier (marker) of the attribute set. Example: "productAttributes".
|
|
68
|
+
* @param {string} attributeMarker - Text identifier (marker) of the attribute in the set. Example: "color".
|
|
73
69
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
74
|
-
*
|
|
75
70
|
* @return {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
|
|
76
71
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
77
|
-
*
|
|
78
72
|
* @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.
|
|
79
73
|
*/
|
|
80
74
|
async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
|
|
@@ -86,12 +80,10 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
86
80
|
*
|
|
87
81
|
* @handleName getAttributeSetByMarker
|
|
88
82
|
*
|
|
89
|
-
* @param {string} marker - marker of the attribute set object. Example:
|
|
83
|
+
* @param {string} marker - marker of the attribute set object. Example: "productAttributes".
|
|
90
84
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
91
|
-
*
|
|
92
85
|
* @return {IAttributeSetsEntity} Returns one object of the attribute set.
|
|
93
86
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
94
|
-
*
|
|
95
87
|
* @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.
|
|
96
88
|
*/
|
|
97
89
|
async getAttributeSetByMarker(marker, langCode = this.state.lang) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IError } from '../base/utils';
|
|
1
|
+
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IAttributesSets
|
|
4
4
|
*
|
|
@@ -11,20 +11,18 @@ interface IAttributesSets {
|
|
|
11
11
|
/**
|
|
12
12
|
* Fetches attributes by a specific marker.
|
|
13
13
|
*
|
|
14
|
-
* @param {string} marker - The marker used to identify the attribute set. Example:
|
|
15
|
-
* @param {string} langCode - The language code for localization purposes. Default: 'en_US'.
|
|
16
|
-
*
|
|
17
|
-
* @returns {IAttributesSetsEntity[]} A promise that resolves to an array of attribute set entities or an error.
|
|
14
|
+
* @param {string} marker - The marker used to identify the attribute set. Example: "productAttributes".
|
|
15
|
+
* @param {string} [langCode] - The language code for localization purposes. Default: 'en_US'.
|
|
16
|
+
* @returns {IAttributeSetsEntity[]} A promise that resolves to an array of attribute set entities or an error.
|
|
18
17
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
19
18
|
*/
|
|
20
|
-
getAttributesByMarker(marker: string, langCode: string): Promise<
|
|
19
|
+
getAttributesByMarker(marker: string, langCode: string): Promise<IAttributeSetsEntity[] | IError>;
|
|
21
20
|
/**
|
|
22
21
|
* Fetches a single attribute by its marker and the set marker.
|
|
23
22
|
*
|
|
24
|
-
* @param {string} attributeMarker - The marker identifying the attribute. Example:
|
|
25
|
-
* @param {string} setMarker - The marker identifying the attribute set. Example:
|
|
26
|
-
* @param {string} langCode - The language code for localization purposes. Default:
|
|
27
|
-
*
|
|
23
|
+
* @param {string} attributeMarker - The marker identifying the attribute. Example: "color".
|
|
24
|
+
* @param {string} setMarker - The marker identifying the attribute set. Example: "productAttributes".
|
|
25
|
+
* @param {string} [langCode] - The language code for localization purposes. Default: "en_US".
|
|
28
26
|
* @returns {IAttributesSetsEntity} A promise that resolves to an attribute set entity or an error.
|
|
29
27
|
*/
|
|
30
28
|
getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity | IError>;
|
|
@@ -34,11 +32,10 @@ interface IAttributesSets {
|
|
|
34
32
|
*
|
|
35
33
|
* @interface IListTitle
|
|
36
34
|
*
|
|
37
|
-
* @property {string} title - The title or name associated with the list item. Example: "Item Name"
|
|
35
|
+
* @property {string} title - The title or name associated with the list item. Example: "Item Name".
|
|
38
36
|
* @property {number | string} value - The value of the list item, which can be either a number or a string depending on the context. Example: 42
|
|
39
37
|
* @property {string | number | null} position - The position of the list item, which can be represented as a string, number, or null if not applicable. Example: 1
|
|
40
38
|
* @property {object} extended - An object containing additional properties or metadata related to the list item. This could include any extra details that extend the basic information.
|
|
41
|
-
|
|
42
39
|
* @description This interface defines the structure of a list item, which includes properties for the title, value, position, and extended information.
|
|
43
40
|
*/
|
|
44
41
|
interface IListTitle {
|
|
@@ -53,6 +50,7 @@ interface IListTitle {
|
|
|
53
50
|
/**
|
|
54
51
|
* AttributeType
|
|
55
52
|
*
|
|
53
|
+
* @type IAdminQuery
|
|
56
54
|
* @type {AttributeType}
|
|
57
55
|
* @description This type defines the possible values for attribute types used in the system.
|
|
58
56
|
*/
|
|
@@ -62,73 +60,123 @@ type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' |
|
|
|
62
60
|
*
|
|
63
61
|
* @interface IAttributesSetsEntity
|
|
64
62
|
*
|
|
65
|
-
* @property {AttributeType} type - Attribute type. Example:
|
|
66
|
-
* @property {
|
|
63
|
+
* @property {AttributeType} type - Attribute type. Example: "string", "text", "integer", "etc".
|
|
64
|
+
* @property {any} [value] - Value of the attribute, which can be of any type.
|
|
65
|
+
* @property {string} marker - Textual identifier of the attribute (marker). Example: "color", "size", "etc".
|
|
67
66
|
* @property {number} position - Position number for sorting. Example: 1
|
|
68
|
-
* @property {Record<string, any>}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
* @property {IListTitle[] | Record<string, any>} [listTitles] - Array of values (with extended data) for list and radioButton attributes. Example:
|
|
68
|
+
[
|
|
69
|
+
{
|
|
70
|
+
"title": "red",
|
|
71
|
+
"value": 1,
|
|
72
|
+
"position": 1,
|
|
73
|
+
"extendedValue": null,
|
|
74
|
+
"extendedValueType": null
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"title": "yellow",
|
|
78
|
+
"value": 2,
|
|
79
|
+
"position": 2,
|
|
80
|
+
"extendedValue": null,
|
|
81
|
+
"extendedValueType": null
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
* @property {Record<string, any>} [validators] - Set of validators for validation. Example:
|
|
85
|
+
{
|
|
86
|
+
"requiredValidator": {
|
|
87
|
+
"strict": true
|
|
88
|
+
},
|
|
89
|
+
"defaultValueValidator": {
|
|
90
|
+
"fieldDefaultValue": 11
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
* @property {ILocalizeInfo} localizeInfos - The name of the template, taking into account localization. Example:
|
|
94
|
+
{
|
|
95
|
+
"title": "My attribute"
|
|
96
|
+
}
|
|
97
|
+
* @property {Record<string, any>} [additionalFields] - Additional fields for the attribute (optional).
|
|
98
|
+
* @property {Record<string, any>} [settings] - Additional attribute settings (optional).
|
|
75
99
|
* @description This interface defines the structure of an attribute set entity, including its type, marker, position, validators, localization information, list titles, additional fields, and settings.
|
|
76
100
|
*/
|
|
77
101
|
interface IAttributesSetsEntity {
|
|
78
102
|
type: AttributeType;
|
|
103
|
+
value?: any;
|
|
79
104
|
marker: string;
|
|
80
105
|
position: number;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
listTitles?: IListTitle[] | Record<string, any>;
|
|
107
|
+
validators?: Record<string, any>;
|
|
108
|
+
localizeInfos: ILocalizeInfo;
|
|
84
109
|
additionalFields?: Record<string, any>;
|
|
85
110
|
settings?: Record<string, any>;
|
|
86
|
-
value: any;
|
|
87
111
|
}
|
|
88
112
|
/**
|
|
89
113
|
* Interface representing an attribute set entity.
|
|
90
114
|
*
|
|
91
115
|
* @interface IAttributeSetsEntity
|
|
92
116
|
*
|
|
93
|
-
* @property {number} position - The position number for sorting the attribute set. Example: 1.
|
|
94
117
|
* @property {number} id - The unique identifier of the attribute set entity. Example: 123.
|
|
95
|
-
* @property {string} identifier - A string that uniquely identifies the attribute set. Example: "attributeSet1".
|
|
96
|
-
* @property {boolean} isVisible - Indicates whether the attribute set is visible or not. Example: true.
|
|
97
|
-
* @property {any} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data.
|
|
98
|
-
* @property {string} title - The title or name of the attribute set. Example: "Product Attributes".
|
|
99
|
-
* @property {any} type - The type of the attribute set, which could be a specific classification or category. Example: "product", "user", etc.
|
|
100
|
-
* @property {number} typeId - The numerical identifier representing the type of the attribute set. Example: 1.
|
|
101
118
|
* @property {string} updatedDate - The date when the attribute set was last updated, represented as a string. Example: "2023-10-01T12:00:00Z".
|
|
102
119
|
* @property {number} version - The version number of the attribute set, used for tracking changes or updates. Example: 1.
|
|
103
|
-
* @property {
|
|
104
|
-
*
|
|
120
|
+
* @property {string} identifier - A string that uniquely identifies the attribute set. Example: "attributeSet1".
|
|
121
|
+
* @property {number} typeId - The numerical identifier representing the type of the attribute set. Example: 1.
|
|
122
|
+
* @property {string} title - The title or name of the attribute set. Example: "Product Attributes".
|
|
123
|
+
* @property {any} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data. Example:
|
|
124
|
+
{
|
|
125
|
+
"attribute1": {
|
|
126
|
+
"id": 1,
|
|
127
|
+
"type": "string",
|
|
128
|
+
"isPrice": false,
|
|
129
|
+
"original": true,
|
|
130
|
+
"identifier": "string",
|
|
131
|
+
"localizeInfos": {
|
|
132
|
+
"en_US": { "title": "String" }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
* @property {boolean} isVisible - Indicates whether the attribute set is visible or not. Example: true.
|
|
137
|
+
* @property {any} properties - Additional properties associated with the attribute set, which can be of any type. Example:
|
|
138
|
+
{
|
|
139
|
+
"color": "red",
|
|
140
|
+
"size": "M"
|
|
141
|
+
}
|
|
142
|
+
* @property {any} type - The type of the attribute set, which could be a specific classification or category. Example: "product", "user", "etc".
|
|
143
|
+
* @property {number} position - The position number for sorting the attribute set. Example: 1.
|
|
105
144
|
* @description This interface defines the structure of an attribute set entity.
|
|
106
145
|
*/
|
|
107
146
|
interface IAttributeSetsEntity {
|
|
108
147
|
id: number;
|
|
109
|
-
identifier: string;
|
|
110
|
-
isVisible: boolean;
|
|
111
|
-
position: number;
|
|
112
|
-
schema: any;
|
|
113
|
-
title: string;
|
|
114
|
-
type: any;
|
|
115
|
-
typeId: number;
|
|
116
148
|
updatedDate: string;
|
|
117
149
|
version: number;
|
|
150
|
+
identifier: string;
|
|
151
|
+
typeId: number;
|
|
152
|
+
title: string;
|
|
153
|
+
schema: any;
|
|
154
|
+
isVisible: boolean;
|
|
118
155
|
properties: any;
|
|
156
|
+
type: any;
|
|
157
|
+
position: number;
|
|
119
158
|
}
|
|
120
159
|
/**
|
|
121
160
|
* Interface defining the structure of a response object for attribute sets.
|
|
122
161
|
*
|
|
123
162
|
* @interface IAttributesSetsResponse
|
|
124
163
|
*
|
|
125
|
-
* @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities. Example: [{ id: 1, identifier: 'set1', ... }, { id: 2, identifier: 'set2', ... }].
|
|
126
164
|
* @property {number} total - Total items. Example: 100.
|
|
127
|
-
*
|
|
165
|
+
* @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities. Example:
|
|
166
|
+
[
|
|
167
|
+
{
|
|
168
|
+
"id": 1,
|
|
169
|
+
"identifier": "set1"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": 2,
|
|
173
|
+
"identifier": "set2"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
128
176
|
* @description This interface defines the structure of a response object for attribute sets.
|
|
129
177
|
*/
|
|
130
178
|
interface IAttributesSetsResponse {
|
|
131
|
-
items: IAttributeSetsEntity[];
|
|
132
179
|
total: number;
|
|
180
|
+
items: IAttributeSetsEntity[];
|
|
133
181
|
}
|
|
134
182
|
export type { AttributeType, IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse, IListTitle, };
|