oneentry 1.0.122 → 1.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/admins/adminsApi.d.ts +16 -8
  2. package/dist/admins/adminsApi.js +18 -10
  3. package/dist/admins/adminsInterfaces.d.ts +49 -25
  4. package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
  5. package/dist/attribute-sets/attributeSetsApi.js +49 -25
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
  7. package/dist/auth-provider/authProviderApi.d.ts +94 -83
  8. package/dist/auth-provider/authProviderApi.js +96 -83
  9. package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
  10. package/dist/base/asyncModules.d.ts +32 -28
  11. package/dist/base/asyncModules.js +62 -38
  12. package/dist/base/syncModules.d.ts +44 -44
  13. package/dist/base/syncModules.js +65 -63
  14. package/dist/blocks/blocksApi.d.ts +56 -25
  15. package/dist/blocks/blocksApi.js +56 -25
  16. package/dist/blocks/blocksInterfaces.d.ts +71 -22
  17. package/dist/events/eventsApi.d.ts +45 -11
  18. package/dist/events/eventsApi.js +47 -17
  19. package/dist/events/eventsInterfaces.d.ts +44 -2
  20. package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
  21. package/dist/file-uploading/fileUploadingApi.js +46 -27
  22. package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
  23. package/dist/forms/formsApi.d.ts +23 -8
  24. package/dist/forms/formsApi.js +23 -8
  25. package/dist/forms/formsInterfaces.d.ts +62 -15
  26. package/dist/formsData/formsDataApi.d.ts +33 -33
  27. package/dist/formsData/formsDataApi.js +33 -33
  28. package/dist/formsData/formsDataInterfaces.d.ts +123 -35
  29. package/dist/general-types/generalTypesApi.d.ts +12 -1
  30. package/dist/general-types/generalTypesApi.js +12 -1
  31. package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
  35. package/dist/integration-collections/integrationCollectionsApi.js +114 -81
  36. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
  37. package/dist/locales/localesApi.d.ts +6 -1
  38. package/dist/locales/localesApi.js +6 -1
  39. package/dist/locales/localesInterfaces.d.ts +20 -11
  40. package/dist/menus/menusApi.d.ts +8 -3
  41. package/dist/menus/menusApi.js +8 -3
  42. package/dist/menus/menusInterfaces.d.ts +30 -17
  43. package/dist/orders/ordersApi.d.ts +64 -64
  44. package/dist/orders/ordersApi.js +67 -65
  45. package/dist/orders/ordersInterfaces.d.ts +174 -60
  46. package/dist/pages/pagesApi.d.ts +89 -30
  47. package/dist/pages/pagesApi.js +181 -57
  48. package/dist/pages/pagesInterfaces.d.ts +117 -23
  49. package/dist/payments/paymentsApi.d.ts +56 -22
  50. package/dist/payments/paymentsApi.js +56 -22
  51. package/dist/payments/paymentsInterfaces.d.ts +119 -36
  52. package/dist/product-statuses/productStatusesApi.d.ts +21 -15
  53. package/dist/product-statuses/productStatusesApi.js +21 -18
  54. package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
  55. package/dist/products/productsApi.d.ts +137 -157
  56. package/dist/products/productsApi.js +137 -157
  57. package/dist/products/productsInterfaces.d.ts +240 -57
  58. package/dist/system/systemApi.d.ts +29 -10
  59. package/dist/system/systemApi.js +29 -10
  60. package/dist/system/systemInterfaces.d.ts +8 -0
  61. package/dist/templates/templatesApi.d.ts +26 -16
  62. package/dist/templates/templatesApi.js +26 -19
  63. package/dist/templates/templatesInterfaces.d.ts +40 -14
  64. package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
  65. package/dist/templates-preview/templatesPreviewApi.js +18 -17
  66. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +57 -29
  67. package/dist/users/usersApi.d.ts +37 -33
  68. package/dist/users/usersApi.js +37 -33
  69. package/dist/users/usersInterfaces.d.ts +80 -9
  70. package/dist/web-socket/wsApi.d.ts +6 -3
  71. package/dist/web-socket/wsApi.js +6 -3
  72. package/dist/web-socket/wsInterfaces.d.ts +3 -1
  73. package/package.json +11 -11
@@ -3,22 +3,30 @@ 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: [].
22
+ * @param {string} [langCode] - Language code. Default: "en_US".
23
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
24
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
25
+ *
26
+ * @return {IAdminEntity[]} Returns an array of admin objects.
27
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
28
+ *
29
+ * @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
30
  */
23
31
  getAdminsInfo(body?: Array<AttributeType>, langCode?: string, offset?: number, limit?: number): Promise<Array<IAdminEntity> | IError>;
24
32
  }
@@ -5,23 +5,31 @@ 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) {
13
16
  super(state);
14
- this._url = state.url + '/api/content/admins';
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: [].
25
+ * @param {string} [langCode] - Language code. Default: "en_US".
26
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
27
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
28
+ *
29
+ * @return {IAdminEntity[]} Returns an array of admin objects.
30
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
31
+ *
32
+ * @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
33
  */
26
34
  async getAdminsInfo(body = [], langCode = this.state.lang, offset = 0, limit = 30) {
27
35
  const query = {
@@ -29,7 +37,7 @@ class AdminsApi extends asyncModules_1.default {
29
37
  offset,
30
38
  limit,
31
39
  };
32
- const response = await this._fetchPost(`/?` + this._queryParamsToString(query), body);
40
+ const response = await this._fetchPost(`?` + this._queryParamsToString(query), body);
33
41
  return this._normalizeData(response, langCode);
34
42
  }
35
43
  }
@@ -1,22 +1,40 @@
1
1
  import type { AttributeType, 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
+ *
7
+ * @description This interface defines the contract for any class that implements it
6
8
  */
7
9
  interface IAdmins {
10
+ /**
11
+ * Fetches information about admins.
12
+ *
13
+ * @param {AttributeType[]} body - An array of attributes used to filter or modify the query. Default: [].
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.
17
+ *
18
+ * @return {IAdminEntity[]} Returns an array of admin objects.
19
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
20
+ *
21
+ * @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
+ */
8
23
  getAdminsInfo(body: Array<AttributeType>, langCode: string, offset: number, limit: number): Promise<Array<IAdminEntity> | IError>;
9
24
  }
10
25
  /**
11
- * Represents a position object.
12
- *
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.
26
+ * Interface representing a Position entity.
27
+ *
28
+ * @interface IPosition
29
+ *
30
+ * @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
+ * @property {boolean} [isLocked] - Indicates whether the position is locked or not. Example: false.
35
+ * @property {number} [objectCategoryId] - The unique identifier of the object's category. Example: 5.
36
+ *
37
+ * @description This interface outlines the properties associated with a position within a system.
20
38
  */
21
39
  interface IPosition {
22
40
  id: number;
@@ -27,15 +45,18 @@ interface IPosition {
27
45
  objectCategoryId?: number;
28
46
  }
29
47
  /**
30
- * Represents an object with various properties.
31
- *
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.
48
+ * Interface representing an Admin Entity.
49
+ *
50
+ * @interface IAdminEntity
51
+ *
52
+ * @property {number} id - The identifier of the object. Example: 1764.
53
+ * @property {string} identifier - The textual identifier for the record field. Example: "admin1".
54
+ * @property {number} attributeSetId - The identifier of the attribute set being used. Example: 120.
55
+ * @property {boolean} isSync - Page indexing flag (true or false). Example: true.
56
+ * @property {any} attributeValues - Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value). Example: [{"marker": { "value": "", "type": "string" }},].
57
+ * @property {number} position - Position number (for sorting). Example: 192
58
+ *
59
+ * @description This interface captures the essential details and additional attributes of an admin entity.
39
60
  */
40
61
  interface IAdminEntity {
41
62
  id: number;
@@ -47,12 +68,15 @@ interface IAdminEntity {
47
68
  [key: string]: any;
48
69
  }
49
70
  /**
50
- * Represents IAdmin query parameters object.
71
+ * Interface representing a query for fetching admin data.
72
+ *
73
+ * @interface IAdminQuery
74
+ *
75
+ * @property {number} langCode - Language code. Default: "en_US".
76
+ * @property {number} offset - Parameter for pagination. Default: 0.
77
+ * @property {number} limit - Parameter for pagination. Default: 30.
51
78
  *
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.
79
+ * @description This interface defines the parameters required for querying admin data, including optional defaults.
56
80
  */
57
81
  interface IAdminQuery {
58
82
  langCode: string;
@@ -4,51 +4,73 @@ 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 {number} [langCode] - Language code. Default: "en_US".
22
+ * @param {number} [limit] - parameter limiting the selection of records. Default: 30.
23
+ * @param {number} [offset] - parameter offset of record selection. Default: 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.
26
+ *
27
+ * @return {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
28
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
29
+ *
30
+ * @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
31
  */
25
32
  getAttributes(langCode?: string, offset?: number, limit?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponse | IError>;
26
33
  /**
27
- * Getting all attributes with data from the attribute set
34
+ * Getting all attributes with data from the attribute set.
35
+ *
36
+ * @handleName getAttributesByMarker
37
+ *
38
+ * @param {string} marker - Attribute marker. Example: 'productAttributes'.
39
+ * @param {string} [langCode] - Language code. Default: "en_US".
28
40
  *
29
- * @param {string} [marker] - Attribute marker.
30
- * @param {string} [langCode] - Language code.
41
+ * @return {IAttributesSetsEntity} Returns an array of Attributes objects.
42
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
31
43
  *
32
- * @returns Returns an array of AttributeInSet objects.
44
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
33
45
  */
34
46
  getAttributesByMarker(marker: string, langCode?: string): Promise<Array<IAttributesSetsEntity> | IError>;
35
47
  /**
36
48
  * Get a single attribute with data from the attribute sets.
37
49
  *
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.
50
+ * @handleName getSingleAttributeByMarkerSet
41
51
  *
42
- * @returns Returns a AttributeInSet object.
52
+ * @param {string} setMarker - Text identifier (marker) of the attribute set. Example: 'productAttributes'.
53
+ * @param {string} attributeMarker - Text identifier (marker) of the attribute in the set. Example: 'color'.
54
+ * @param {string} [langCode] - Language code. Default: "en_US".
55
+ *
56
+ * @return {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
57
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
+ *
59
+ * @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
60
  */
44
61
  getSingleAttributeByMarkerSet(setMarker: string, attributeMarker: string, langCode?: string): Promise<IAttributesSetsEntity | IError>;
45
62
  /**
46
- * Getting a single object from a set of attributes by marker
63
+ * Getting a single object from a set of attributes by marker.
64
+ *
65
+ * @handleName getAttributeSetByMarker
66
+ *
67
+ * @param {string} marker - marker of the attribute set object. Example: 'productAttributes'.
68
+ * @param {string} [langCode] - Language code. Default: "en_US".
47
69
  *
48
- * @param {string} [marker] - marker of the attribute set object
49
- * @param {string} [langCode] - Language code.
70
+ * @return {IAttributeSetsEntity} Returns one object of the attribute set.
71
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
50
72
  *
51
- * @returns Returns one object of the attribute set
73
+ * @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
74
  */
53
75
  getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
54
76
  }
@@ -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,25 @@ 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 {number} [langCode] - Language code. Default: "en_US".
25
+ * @param {number} [limit] - parameter limiting the selection of records. Default: 30.
26
+ * @param {number} [offset] - parameter offset of record selection. Default: 0.
27
+ * @param {number} [typeId] - identifier of the attribute set type. Example: null.
28
+ * @param {string} [sortBy] - identifier of the attribute set type. Example: null.
29
+ *
30
+ * @return {IAttributesSetsResponse} Returns object with array of IAttributeSetsEntity and total items count.
31
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
32
+ *
33
+ * @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
34
  */
29
- async getAttributes(langCode = this.state.lang, offset = 0, limit = 30, typeId = null, sortBy = 'id') {
35
+ async getAttributes(langCode = this.state.lang, offset = 0, limit = 30,
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ typeId = null, sortBy = 'id') {
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
39
  const query = {
31
40
  langCode,
32
41
  offset,
@@ -34,16 +43,21 @@ class AttributesSetsApi extends asyncModules_1.default {
34
43
  typeId,
35
44
  sortBy,
36
45
  };
37
- const result = await this._fetchGet(`/?` + this._queryParamsToString(query));
46
+ const result = await this._fetchGet(`?` + this._queryParamsToString(query));
38
47
  return this._dataPostProcess(result, langCode);
39
48
  }
40
49
  /**
41
- * Getting all attributes with data from the attribute set
50
+ * Getting all attributes with data from the attribute set.
51
+ *
52
+ * @handleName getAttributesByMarker
53
+ *
54
+ * @param {string} marker - Attribute marker. Example: 'productAttributes'.
55
+ * @param {string} [langCode] - Language code. Default: "en_US".
42
56
  *
43
- * @param {string} [marker] - Attribute marker.
44
- * @param {string} [langCode] - Language code.
57
+ * @return {IAttributesSetsEntity} Returns an array of Attributes objects.
58
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
45
59
  *
46
- * @returns Returns an array of AttributeInSet objects.
60
+ * @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
61
  */
48
62
  async getAttributesByMarker(marker, langCode = this.state.lang) {
49
63
  const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
@@ -52,26 +66,36 @@ class AttributesSetsApi extends asyncModules_1.default {
52
66
  /**
53
67
  * Get a single attribute with data from the attribute sets.
54
68
  *
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.
69
+ * @handleName getSingleAttributeByMarkerSet
58
70
  *
59
- * @returns Returns a AttributeInSet object.
71
+ * @param {string} setMarker - Text identifier (marker) of the attribute set. Example: 'productAttributes'.
72
+ * @param {string} attributeMarker - Text identifier (marker) of the attribute in the set. Example: 'color'.
73
+ * @param {string} [langCode] - Language code. Default: "en_US".
74
+ *
75
+ * @return {IAttributesSetsEntity} Returns a single attribute object from the attribute set.
76
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
77
+ *
78
+ * @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
79
  */
61
80
  async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
62
81
  const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
63
82
  return result;
64
83
  }
65
84
  /**
66
- * Getting a single object from a set of attributes by marker
85
+ * Getting a single object from a set of attributes by marker.
86
+ *
87
+ * @handleName getAttributeSetByMarker
88
+ *
89
+ * @param {string} marker - marker of the attribute set object. Example: 'productAttributes'.
90
+ * @param {string} [langCode] - Language code. Default: "en_US".
67
91
  *
68
- * @param {string} [marker] - marker of the attribute set object
69
- * @param {string} [langCode] - Language code.
92
+ * @return {IAttributeSetsEntity} Returns one object of the attribute set.
93
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
70
94
  *
71
- * @returns Returns one object of the attribute set
95
+ * @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
96
  */
73
97
  async getAttributeSetByMarker(marker, langCode = this.state.lang) {
74
- const result = await this._fetchGet(`/marker/${marker}/?langCode=${langCode}`);
98
+ const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
75
99
  return this._dataPostProcess(result, langCode);
76
100
  }
77
101
  }
@@ -1,21 +1,45 @@
1
1
  import type { IError } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of AttributesSets Api.
3
+ * @interface IAttributesSets
4
4
  *
5
5
  * @property {function} getAttributesByMarker - Get all attributes with data from the attribute sets.
6
6
  * @property {function} getSingleAttributeByMarkerSet - Get a single attribute with data from the attribute sets.
7
+ *
8
+ * @description This interface defines methods for retrieving attributes based on markers and language codes.
7
9
  */
8
10
  interface IAttributesSets {
11
+ /**
12
+ * Fetches attributes by a specific marker.
13
+ *
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
+ *
17
+ * @returns {IAttributesSetsEntity[]} A promise that resolves to an array of attribute set entities or an error.
18
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
19
+ */
9
20
  getAttributesByMarker(marker: string, langCode: string): Promise<Array<IAttributesSetsEntity> | IError>;
21
+ /**
22
+ * Fetches a single attribute by its marker and the set marker.
23
+ *
24
+ * @param {string} attributeMarker - The marker identifying the attribute. Example: 'color'.
25
+ * @param {string} setMarker - The marker identifying the attribute set. Example: 'productAttributes'.
26
+ * @param {string} langCode - The language code for localization purposes. Default: 'en_US'.
27
+ *
28
+ * @returns {IAttributesSetsEntity} A promise that resolves to an attribute set entity or an error.
29
+ */
10
30
  getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode: string): Promise<IAttributesSetsEntity | IError>;
11
31
  }
12
32
  /**
13
- * Represents an interface object of IListTitle.
33
+ * Interface representing the structure of a list item.
34
+ *
35
+ * @interface IListTitle
14
36
  *
15
- * @property {string} title - The title or name associated with the list item.
16
- * @property {number | string} value - The value of the list item, which can be either a number or a string depending on the context.
17
- * @property {string | number | null} position - The position of the list item, which can be represented as a string, number, or null if not applicable.
37
+ * @property {string} title - The title or name associated with the list item. Example: "Item Name"
38
+ * @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
+ * @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
18
40
  * @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
+ * @description This interface defines the structure of a list item, which includes properties for the title, value, position, and extended information.
19
43
  */
20
44
  interface IListTitle {
21
45
  title: string;
@@ -26,19 +50,29 @@ interface IListTitle {
26
50
  type: string | null;
27
51
  };
28
52
  }
53
+ /**
54
+ * AttributeType
55
+ *
56
+ * @type {AttributeType}
57
+ * @description This type defines the possible values for attribute types used in the system.
58
+ */
29
59
  type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' | 'float' | 'dateTime' | 'date' | 'time' | 'file' | 'image' | 'groupOfImages' | 'radioButton' | 'list' | 'button';
30
60
  /**
31
- * Represents a template entity object.
61
+ * Interface representing an attribute set entity.
32
62
  *
33
- * @interface
34
- * @property {AttributeType} type - Attribute type.
35
- * @property {string} marker - Textual identifier of the attribute (marker).
36
- * @property {number} position - Position number for sorting.
37
- * @property {Record<string, any>} validators - Set of validators for validation.
63
+ * @interface IAttributesSetsEntity
64
+ *
65
+ * @property {AttributeType} type - Attribute type. Example: 'string', 'text', 'integer', etc.
66
+ * @property {string} marker - Textual identifier of the attribute (marker). Example: 'color', 'size', etc.
67
+ * @property {number} position - Position number for sorting. Example: 1
68
+ * @property {Record<string, any>} validators - Set of validators for validation. Example: { required: true, minLength: 3 }.
38
69
  * @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
39
70
  * @property {Array<Record<string, any>>} listTitles - Array of values (with extended data) for list and radioButton attributes.
40
- * @property {Array<Record<string, any>>} settings - Additional attribute settings (optional).
71
+ * @property {Record<string, any>} additionalFields - Additional fields for the attribute (optional).
72
+ * @property {Array<Record<string, any>>} [settings] - Additional attribute settings (optional).
73
+ * @property {any} value - Value of the attribute, which can be of any type
41
74
  *
75
+ * @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.
42
76
  */
43
77
  interface IAttributesSetsEntity {
44
78
  type: AttributeType;
@@ -49,19 +83,26 @@ interface IAttributesSetsEntity {
49
83
  listTitles: Array<IListTitle> | Record<string, any>;
50
84
  additionalFields?: Record<string, any>;
51
85
  settings?: Record<string, any>;
86
+ value: any;
52
87
  }
53
88
  /**
54
- * Represents an interface object of IAttributeSetsEntity.
89
+ * Interface representing an attribute set entity.
90
+ *
91
+ * @interface IAttributeSetsEntity
55
92
  *
56
- * @property {number} id - The unique identifier of the attribute set entity.
57
- * @property {string} identifier - A string that uniquely identifies the attribute set.
58
- * @property {boolean} isVisible - Indicates whether the attribute set is visible or not.
93
+ * @property {number} position - The position number for sorting the attribute set. Example: 1.
94
+ * @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.
59
97
  * @property {any} schema - The schema definition associated with the attribute set. This could represent the structure or rules for the data.
60
- * @property {string} title - The title or name of the attribute set.
61
- * @property {any} type - The type of the attribute set, which could be a specific classification or category.
62
- * @property {number} typeId - The numerical identifier representing the type of the attribute set.
63
- * @property {string} updatedDate - The date when the attribute set was last updated, represented as a string. Consider using Date for better date handling.
64
- * @property {number} version - The version number of the attribute set, used for tracking changes or updates.
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
+ * @property {string} updatedDate - The date when the attribute set was last updated, represented as a string. Example: "2023-10-01T12:00:00Z".
102
+ * @property {number} version - The version number of the attribute set, used for tracking changes or updates. Example: 1.
103
+ * @property {any} properties - Additional properties associated with the attribute set, which can be of any type. Example: { color: "red", size: "M" }.
104
+ *
105
+ * @description This interface defines the structure of an attribute set entity.
65
106
  */
66
107
  interface IAttributeSetsEntity {
67
108
  id: number;
@@ -74,12 +115,17 @@ interface IAttributeSetsEntity {
74
115
  typeId: number;
75
116
  updatedDate: string;
76
117
  version: number;
118
+ properties: any;
77
119
  }
78
120
  /**
79
- * Represents an interface object of IAttributesSetsResponce.
121
+ * Interface defining the structure of a response object for attribute sets.
122
+ *
123
+ * @interface IAttributesSetsResponse
124
+ *
125
+ * @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity array containing attribute set entities. Example: [{ id: 1, identifier: 'set1', ... }, { id: 2, identifier: 'set2', ... }].
126
+ * @property {number} total - Total items. Example: 100.
80
127
  *
81
- * @property {IAttributeSetsEntity[]} items - IAttributeSetsEntity
82
- * @property {number} total - total items
128
+ * @description This interface defines the structure of a response object for attribute sets.
83
129
  */
84
130
  interface IAttributesSetsResponse {
85
131
  items: IAttributeSetsEntity[];