oneentry 1.0.123 → 1.0.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +30 -9
  3. package/dist/admins/adminsApi.js +30 -9
  4. package/dist/admins/adminsInterfaces.d.ts +77 -32
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +36 -22
  6. package/dist/attribute-sets/attributeSetsApi.js +41 -25
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +133 -39
  8. package/dist/auth-provider/authProviderApi.d.ts +209 -88
  9. package/dist/auth-provider/authProviderApi.js +226 -87
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +345 -18
  11. package/dist/base/asyncModules.d.ts +38 -28
  12. package/dist/base/asyncModules.js +178 -47
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +48 -44
  15. package/dist/base/syncModules.js +84 -64
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +48 -27
  18. package/dist/blocks/blocksApi.js +48 -27
  19. package/dist/blocks/blocksInterfaces.d.ts +126 -32
  20. package/dist/events/eventsApi.d.ts +45 -12
  21. package/dist/events/eventsApi.js +47 -12
  22. package/dist/events/eventsInterfaces.d.ts +50 -3
  23. package/dist/file-uploading/fileUploadingApi.d.ts +57 -29
  24. package/dist/file-uploading/fileUploadingApi.js +57 -30
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +90 -17
  26. package/dist/forms/formsApi.d.ts +20 -9
  27. package/dist/forms/formsApi.js +19 -8
  28. package/dist/forms/formsInterfaces.d.ts +86 -23
  29. package/dist/formsData/formsDataApi.d.ts +33 -21
  30. package/dist/formsData/formsDataApi.js +33 -21
  31. package/dist/formsData/formsDataInterfaces.d.ts +212 -41
  32. package/dist/general-types/generalTypesApi.d.ts +11 -2
  33. package/dist/general-types/generalTypesApi.js +10 -1
  34. package/dist/general-types/generalTypesInterfaces.d.ts +17 -6
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +2 -2
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +134 -81
  38. package/dist/integration-collections/integrationCollectionsApi.js +135 -83
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +246 -43
  40. package/dist/locales/localesApi.d.ts +5 -1
  41. package/dist/locales/localesApi.js +5 -1
  42. package/dist/locales/localesInterfaces.d.ts +19 -12
  43. package/dist/menus/menusApi.d.ts +6 -3
  44. package/dist/menus/menusApi.js +6 -3
  45. package/dist/menus/menusInterfaces.d.ts +60 -21
  46. package/dist/orders/ordersApi.d.ts +84 -66
  47. package/dist/orders/ordersApi.js +91 -71
  48. package/dist/orders/ordersInterfaces.d.ts +282 -86
  49. package/dist/pages/pagesApi.d.ts +101 -42
  50. package/dist/pages/pagesApi.js +93 -39
  51. package/dist/pages/pagesInterfaces.d.ts +218 -75
  52. package/dist/payments/paymentsApi.d.ts +53 -39
  53. package/dist/payments/paymentsApi.js +55 -40
  54. package/dist/payments/paymentsInterfaces.d.ts +121 -56
  55. package/dist/product-statuses/productStatusesApi.d.ts +17 -17
  56. package/dist/product-statuses/productStatusesApi.js +16 -19
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +43 -14
  58. package/dist/products/productsApi.d.ts +309 -177
  59. package/dist/products/productsApi.js +313 -167
  60. package/dist/products/productsInterfaces.d.ts +447 -81
  61. package/dist/system/systemApi.d.ts +42 -12
  62. package/dist/system/systemApi.js +43 -10
  63. package/dist/system/systemInterfaces.d.ts +7 -0
  64. package/dist/templates/templatesApi.d.ts +24 -20
  65. package/dist/templates/templatesApi.js +22 -21
  66. package/dist/templates/templatesInterfaces.d.ts +48 -22
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +17 -17
  68. package/dist/templates-preview/templatesPreviewApi.js +16 -19
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +85 -32
  70. package/dist/users/usersApi.d.ts +59 -35
  71. package/dist/users/usersApi.js +62 -35
  72. package/dist/users/usersInterfaces.d.ts +136 -14
  73. package/dist/web-socket/wsApi.d.ts +4 -5
  74. package/dist/web-socket/wsApi.js +4 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +2 -1
  76. package/package.json +20 -18
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/attribute-sets/attributesets)
188
- - [AuthProvider](https://js-sdk.oneentry.cloud/docs/auth-provider/authprovider)
189
- - [Blocks](https://js-sdk.oneentry.cloud/docs/blocks)
190
- - [Events](https://js-sdk.oneentry.cloud/docs/events)
191
- - [Forms](https://js-sdk.oneentry.cloud/docs/forms)
192
- - [FormData](https://js-sdk.oneentry.cloud/docs/forms-data/formsdata)
193
- - [FileUploading](https://js-sdk.oneentry.cloud/docs/file-uploading/fileuploading)
194
- - [GeneralTypes](https://js-sdk.oneentry.cloud/docs/general-types/generaltypes)
195
- - [IntegrationCollections](https://js-sdk.oneentry.cloud/docs/integration-collections/integrationcollections)
196
- - [Locales](https://js-sdk.oneentry.cloud/docs/locales)
197
- - [Menus](https://js-sdk.oneentry.cloud/docs/menus)
198
- - [Orders](https://js-sdk.oneentry.cloud/docs/orders)
199
- - [Pages](https://js-sdk.oneentry.cloud/docs/pages)
200
- - [Payments](https://js-sdk.oneentry.cloud/docs/payments)
201
- - [Products](https://js-sdk.oneentry.cloud/docs/products)
202
- - [ProductStatuses](https://js-sdk.oneentry.cloud/docs/product-statuses/productstatuses)
203
- - [System](https://js-sdk.oneentry.cloud/docs/system)
204
- - [Templates](https://js-sdk.oneentry.cloud/docs/templates)
205
- - [TemplatePreviews](https://js-sdk.oneentry.cloud/docs/templates-preview/templatepreviews)
206
- - [Users](https://js-sdk.oneentry.cloud/docs/users)
207
- - [WS](https://js-sdk.oneentry.cloud/docs/web-socket/ws)
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)
@@ -3,22 +3,43 @@ import type StateModule from '../base/stateModule';
3
3
  import type { AttributeType, IError } from '../base/utils';
4
4
  import type { IAdminEntity, IAdmins } from './adminsInterfaces';
5
5
  /**
6
- * Controllers for working with users - admins
7
- * @handle /api/content/admins
6
+ * Controllers for working with users - admins.
7
+ *
8
+ * @module AdminsApi
9
+ *
10
+ * @description This module provides methods for working with users - admins, including retrieving information about all admins.
8
11
  */
9
12
  export default class AdminsApi extends AsyncModules implements IAdmins {
10
13
  protected state: StateModule;
11
14
  protected _url: string;
12
15
  constructor(state: StateModule);
13
16
  /**
14
- * Get all user objects - admins.
17
+ * Get all admins objects with filters.
15
18
  *
16
- * @param {Array<any>} [body] - array of objects AttributeType
17
- * @param {string} [langCode] - Language code. Default "en_US"
18
- * @param {number} [offset] - Optional parameter for pagination, default is 0
19
- * @param {number} [limit] - Optional parameter for pagination, default is 30
19
+ * @handleName getAdminsInfo
20
20
  *
21
- * @returns Returns all AdminEntity user objects
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.
37
+ * @param {string} [langCode] - Language code. Default: "en_US".
38
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
39
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
40
+ * @return {IAdminEntity[]} Returns an array of admin objects.
41
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
22
43
  */
23
- getAdminsInfo(body?: Array<AttributeType>, langCode?: string, offset?: number, limit?: number): Promise<Array<IAdminEntity> | IError>;
44
+ getAdminsInfo(body?: AttributeType[], langCode?: string, offset?: number, limit?: number): Promise<IAdminEntity[] | IError>;
24
45
  }
@@ -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 users - admins
9
- * @handle /api/content/admins
8
+ * Controllers for working with users - admins.
9
+ *
10
+ * @module AdminsApi
11
+ *
12
+ * @description This module provides methods for working with users - admins, including retrieving information about all admins.
10
13
  */
11
14
  class AdminsApi extends asyncModules_1.default {
12
15
  constructor(state) {
@@ -14,14 +17,32 @@ class AdminsApi extends asyncModules_1.default {
14
17
  this._url = state.url + '/api/content/admins/all';
15
18
  }
16
19
  /**
17
- * Get all user objects - admins.
20
+ * Get all admins objects with filters.
18
21
  *
19
- * @param {Array<any>} [body] - array of objects AttributeType
20
- * @param {string} [langCode] - Language code. Default "en_US"
21
- * @param {number} [offset] - Optional parameter for pagination, default is 0
22
- * @param {number} [limit] - Optional parameter for pagination, default is 30
22
+ * @handleName getAdminsInfo
23
23
  *
24
- * @returns Returns all AdminEntity user objects
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.
40
+ * @param {string} [langCode] - Language code. Default: "en_US".
41
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
42
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
43
+ * @return {IAdminEntity[]} Returns an array of admin objects.
44
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
25
46
  */
26
47
  async getAdminsInfo(body = [], langCode = this.state.lang, offset = 0, limit = 30) {
27
48
  const query = {
@@ -29,7 +50,7 @@ class AdminsApi extends asyncModules_1.default {
29
50
  offset,
30
51
  limit,
31
52
  };
32
- const response = await this._fetchPost(`/?` + this._queryParamsToString(query), body);
53
+ const response = await this._fetchPost(`?` + this._queryParamsToString(query), body);
33
54
  return this._normalizeData(response, langCode);
34
55
  }
35
56
  }
@@ -1,62 +1,107 @@
1
- import type { AttributeType, IError } from '../base/utils';
1
+ import type { AttributeType, IAttributeValues, IError } from '../base/utils';
2
2
  /**
3
- * Represents a interface object of Admins Api.
3
+ * @interface IAdmins
4
4
  *
5
- * @property {function} [getAdminsInfo] - Get all user objects - admins.
5
+ * @property {function} getAdminsInfo - Method to retrieve all admin user objects.
6
+ * @description This interface defines the contract for any class that implements it
6
7
  */
7
8
  interface IAdmins {
8
- getAdminsInfo(body: Array<AttributeType>, langCode: string, offset: number, limit: number): Promise<Array<IAdminEntity> | IError>;
9
+ /**
10
+ * Get all admins objects with filters.
11
+ *
12
+ * @handleName getAdminsInfo
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.
33
+ * @return {IAdminEntity[]} Returns an array of admin objects.
34
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
36
+ */
37
+ getAdminsInfo(body: AttributeType[], langCode: string, offset: number, limit: number): Promise<IAdminEntity[] | IError>;
9
38
  }
10
39
  /**
11
- * Represents a position object.
40
+ * Interface representing a Position entity.
12
41
  *
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.
42
+ * @interface IPosition
43
+ *
44
+ * @property {number} id - The unique identifier of the position. Example: 1764.
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.
47
+ * @property {number} [objectCategoryId] - The unique identifier of the object's category. Example: 5.
48
+ * @property {string} objectType - The type of the object. Example: "admin".
49
+ * @property {number} position - The position of the object. Example: 192.
50
+ * @description This interface outlines the properties associated with a position within a system.
20
51
  */
21
52
  interface IPosition {
22
53
  id: number;
23
- position: number;
24
- objectId: number;
25
- objectType: string;
26
54
  isLocked?: boolean;
55
+ objectId: number;
27
56
  objectCategoryId?: number;
57
+ objectType: string;
58
+ position: number;
28
59
  }
29
60
  /**
30
- * Represents an object with various properties.
61
+ * Interface representing an Admin Entity.
62
+ *
63
+ * @interface IAdminEntity
31
64
  *
32
- * @interface
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>} [attributeValues] - The attributes with values used by the object.
38
- * @property {number} [position] - The position of the object.
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.
67
+ * @property {string} identifier - The textual identifier for the record field. Example: "admin1".
68
+ * @property {string | null} attributeSetIdentifier - The identifier of the attribute set. Example: "admins".
69
+ * @property {number | null} position - Position number (for sorting). Example: 1.
70
+ * @property {boolean} isSync - Page indexing flag (true or false). Example: true.
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
+ ]
80
+ * @description This interface captures the essential details and additional attributes of an admin entity.
39
81
  */
40
82
  interface IAdminEntity {
41
83
  id: number;
42
- identifier: string;
43
84
  attributeSetId: number | null;
44
- isSync: boolean;
45
- attributeValues: Record<string, any>;
85
+ identifier: string;
86
+ attributeSetIdentifier: string | null;
46
87
  position: number | null;
88
+ isSync: boolean;
89
+ attributeValues: IAttributeValues;
47
90
  [key: string]: any;
48
91
  }
49
92
  /**
50
- * Represents IAdmin query parameters object.
93
+ * Interface representing a query for fetching admin data.
51
94
  *
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.
95
+ * @interface IAdminQuery
96
+ *
97
+ * @property {number} langCode - Language code. Default: "en_US".
98
+ * @property {number} limit - Parameter for pagination. Default: 30.
99
+ * @property {number} offset - Parameter for pagination. Default: 0.
100
+ * @description This interface defines the parameters required for querying admin data, including optional defaults.
56
101
  */
57
102
  interface IAdminQuery {
58
103
  langCode: string;
59
- offset: number;
60
104
  limit: number;
105
+ offset: number;
61
106
  }
62
107
  export type { IAdminEntity, IAdminQuery, IAdmins, IPosition };
@@ -4,51 +4,65 @@ import type { IError } from '../base/utils';
4
4
  import type { IAttributeSetsEntity, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse } from './attributeSetsInterfaces';
5
5
  /**
6
6
  * Controllers for working with attributes - AttributesSetsApi.
7
- * @handle /api/content/attributes-sets
8
- * @class
7
+ *
8
+ * @module AttributesSetsApi
9
+ *
10
+ * @description This class provides methods to interact with attribute sets, including fetching attributes, getting attributes by marker, and retrieving single attributes by marker and set.
9
11
  */
10
12
  export default class AttributesSetsApi extends AsyncModules implements IAttributesSets {
11
13
  protected state: StateModule;
12
14
  protected _url: string;
13
15
  constructor(state: StateModule);
14
16
  /**
15
- * Getting all attribute sets objects
17
+ * Getting all attribute sets objects.
16
18
  *
17
- * @param {number} [langCode] - Language code.
18
- * @param {number} [limit] - parameter limiting the selection of records, default - 30. Example : 30
19
- * @param {number} [offset] - parameter offset of record selection, default - 0.Example : 0
20
- * @param {number} [typeId] - identifier of the attribute set type. Example : null
21
- * @param {string} [sortBy] - identifier of the attribute set type. Example : null
19
+ * @handleName getAttributes
22
20
  *
23
- * @returns Returns an array of AttributeInSet objects.
21
+ * @param {string} [langCode] - Language code. Default: "en_US".
22
+ * @param {number} [offset] - parameter offset of record selection. Default: 0.
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".
26
+ * @return {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
27
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
24
29
  */
25
30
  getAttributes(langCode?: string, offset?: number, limit?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponse | IError>;
26
31
  /**
27
- * Getting all attributes with data from the attribute set
32
+ * Getting all attributes with data from the attribute set.
28
33
  *
29
- * @param {string} [marker] - Attribute marker.
30
- * @param {string} [langCode] - Language code.
34
+ * @handleName getAttributesByMarker
31
35
  *
32
- * @returns Returns an array of AttributeInSet objects.
36
+ * @param {string} marker - Attribute marker. Example: "productAttributes".
37
+ * @param {string} [langCode] - Language code. Default: "en_US".
38
+ * @return {IAttributeSetsEntity[]} Returns an array of Attributes objects.
39
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
33
41
  */
34
- getAttributesByMarker(marker: string, langCode?: string): Promise<Array<IAttributesSetsEntity> | IError>;
42
+ getAttributesByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity[] | IError>;
35
43
  /**
36
44
  * Get a single attribute with data from the attribute sets.
37
45
  *
38
- * @param {string} [setMarker] - Text identifier (marker) of the attribute set.
39
- * @param {string} [attributeMarker] - Text identifier (marker) of the attribute in the set.
40
- * @param {string} [langCode] - Language code.
46
+ * @handleName getSingleAttributeByMarkerSet
41
47
  *
42
- * @returns Returns a AttributeInSet object.
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".
50
+ * @param {string} [langCode] - Language code. Default: "en_US".
51
+ * @return {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
52
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
43
54
  */
44
55
  getSingleAttributeByMarkerSet(setMarker: string, attributeMarker: string, langCode?: string): Promise<IAttributesSetsEntity | IError>;
45
56
  /**
46
- * Getting a single object from a set of attributes by marker
57
+ * Getting a single object from a set of attributes by marker.
47
58
  *
48
- * @param {string} [marker] - marker of the attribute set object
49
- * @param {string} [langCode] - Language code.
59
+ * @handleName getAttributeSetByMarker
50
60
  *
51
- * @returns Returns one object of the attribute set
61
+ * @param {string} marker - marker of the attribute set object. Example: "productAttributes".
62
+ * @param {string} [langCode] - Language code. Default: "en_US".
63
+ * @return {IAttributeSetsEntity} Returns one object of the attribute set.
64
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
52
66
  */
53
67
  getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
54
68
  }
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- /* eslint-disable @typescript-eslint/no-explicit-any */
7
6
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
7
  /**
9
8
  * Controllers for working with attributes - AttributesSetsApi.
10
- * @handle /api/content/attributes-sets
11
- * @class
9
+ *
10
+ * @module AttributesSetsApi
11
+ *
12
+ * @description This class provides methods to interact with attribute sets, including fetching attributes, getting attributes by marker, and retrieving single attributes by marker and set.
12
13
  */
13
14
  class AttributesSetsApi extends asyncModules_1.default {
14
15
  constructor(state) {
@@ -16,17 +17,23 @@ class AttributesSetsApi extends asyncModules_1.default {
16
17
  this._url = state.url + '/api/content/attributes-sets';
17
18
  }
18
19
  /**
19
- * Getting all attribute sets objects
20
+ * Getting all attribute sets objects.
20
21
  *
21
- * @param {number} [langCode] - Language code.
22
- * @param {number} [limit] - parameter limiting the selection of records, default - 30. Example : 30
23
- * @param {number} [offset] - parameter offset of record selection, default - 0.Example : 0
24
- * @param {number} [typeId] - identifier of the attribute set type. Example : null
25
- * @param {string} [sortBy] - identifier of the attribute set type. Example : null
22
+ * @handleName getAttributes
26
23
  *
27
- * @returns Returns an array of AttributeInSet objects.
24
+ * @param {string} [langCode] - Language code. Default: "en_US".
25
+ * @param {number} [offset] - parameter offset of record selection. Default: 0.
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".
29
+ * @return {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
30
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
28
32
  */
29
- async getAttributes(langCode = this.state.lang, offset = 0, limit = 30, typeId = null, sortBy = 'id') {
33
+ async getAttributes(langCode = this.state.lang, offset = 0, limit = 30,
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ typeId = null, sortBy = 'id') {
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
37
  const query = {
31
38
  langCode,
32
39
  offset,
@@ -34,16 +41,19 @@ class AttributesSetsApi extends asyncModules_1.default {
34
41
  typeId,
35
42
  sortBy,
36
43
  };
37
- const result = await this._fetchGet(`/?` + this._queryParamsToString(query));
44
+ const result = await this._fetchGet(`?` + this._queryParamsToString(query));
38
45
  return this._dataPostProcess(result, langCode);
39
46
  }
40
47
  /**
41
- * Getting all attributes with data from the attribute set
48
+ * Getting all attributes with data from the attribute set.
42
49
  *
43
- * @param {string} [marker] - Attribute marker.
44
- * @param {string} [langCode] - Language code.
50
+ * @handleName getAttributesByMarker
45
51
  *
46
- * @returns Returns an array of AttributeInSet objects.
52
+ * @param {string} marker - Attribute marker. Example: "productAttributes".
53
+ * @param {string} [langCode] - Language code. Default: "en_US".
54
+ * @return {IAttributeSetsEntity[]} Returns an array of Attributes objects.
55
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
47
57
  */
48
58
  async getAttributesByMarker(marker, langCode = this.state.lang) {
49
59
  const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
@@ -52,26 +62,32 @@ class AttributesSetsApi extends asyncModules_1.default {
52
62
  /**
53
63
  * Get a single attribute with data from the attribute sets.
54
64
  *
55
- * @param {string} [setMarker] - Text identifier (marker) of the attribute set.
56
- * @param {string} [attributeMarker] - Text identifier (marker) of the attribute in the set.
57
- * @param {string} [langCode] - Language code.
65
+ * @handleName getSingleAttributeByMarkerSet
58
66
  *
59
- * @returns Returns a AttributeInSet object.
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".
69
+ * @param {string} [langCode] - Language code. Default: "en_US".
70
+ * @return {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
71
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
60
73
  */
61
74
  async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
62
75
  const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
63
76
  return result;
64
77
  }
65
78
  /**
66
- * Getting a single object from a set of attributes by marker
79
+ * Getting a single object from a set of attributes by marker.
67
80
  *
68
- * @param {string} [marker] - marker of the attribute set object
69
- * @param {string} [langCode] - Language code.
81
+ * @handleName getAttributeSetByMarker
70
82
  *
71
- * @returns Returns one object of the attribute set
83
+ * @param {string} marker - marker of the attribute set object. Example: "productAttributes".
84
+ * @param {string} [langCode] - Language code. Default: "en_US".
85
+ * @return {IAttributeSetsEntity} Returns one object of the attribute set.
86
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
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.
72
88
  */
73
89
  async getAttributeSetByMarker(marker, langCode = this.state.lang) {
74
- const result = await this._fetchGet(`/marker/${marker}/?langCode=${langCode}`);
90
+ const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
75
91
  return this._dataPostProcess(result, langCode);
76
92
  }
77
93
  }