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
@@ -1,60 +1,203 @@
1
- import type { IError } from '../base/utils';
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of ICollections Api.
3
+ * @interface ICollectionsApi
4
4
  *
5
- * @property {function} [getICollections] - Get all collections
6
- * @property {function} [getICollectionById] - Get a single collection object
7
- * @property {function} [getICollectionRowsById] - Get all records belonging to the collection by collection id.
8
- * @property {function} [validateICollectionMarker] - Check for the existence of a text identifier (marker)
9
- * @property {function} [getICollectionRowByMarkerAndId] - Getting one record (row) from the collection.
10
- * @property {function} [createICollectionRow] - Create a record (row) in the collection
11
- * @property {function} [updateICollectionRow] - Edit a record (row) in the collection
12
- * @property {function} [deleteICollectionRowByMarkerAndId] - Deletion of collection record object (row)
5
+ * @property {function} getICollections - Get all collections.
6
+ * @property {function} getICollectionById - Get a single collection object.
7
+ * @property {function} getICollectionRowsById - Get all records belonging to the collection by collection id.
8
+ * @property {function} validateICollectionMarker - Check for the existence of a text identifier (marker).
9
+ * @property {function} getICollectionRowsByMarker - Getting all records (row) from the collection.
10
+ * @property {function} getICollectionRowByMarkerAndId - Getting one record (rows) from the collection.
11
+ * @property {function} createICollectionRow - Create a record (row) in the collection.
12
+ * @property {function} updateICollectionRow - Edit a record (row) in the collection.
13
+ * @property {function} deleteICollectionRowByMarkerAndId - Deletion of collection record object (row).
14
+ * @description This interface defines methods for managing collections and their records in the system.
13
15
  */
14
16
  interface ICollectionsApi {
15
- getICollections(marker: string, langCode: string, userQuery?: any): Promise<Array<any> | IError>;
16
- getICollectionById(id: number, langCode: string): Promise<any | IError>;
17
- getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<any | IError>;
17
+ /**
18
+ * Get all collections.
19
+ *
20
+ * @param {string} [langCode] - Language code. Default: "en_US".
21
+ * @param {any} [userQuery] - Query parameters. Example:
22
+ {
23
+ "limit": 30,
24
+ "offset": 0,
25
+ "entityType": "orders",
26
+ "entityId": 1
27
+ }
28
+ * @param {number} [userQuery.limit] - Parameter for pagination. Default: 0.
29
+ * @param {number} [userQuery.offset] - Parameter for pagination. Default: 30.
30
+ * @param {string} [userQuery.entityType] - Entity type. Example: "orders".
31
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
32
+ * @return {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
33
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
34
+ */
35
+ getICollections(langCode: string, userQuery?: {
36
+ limit: number;
37
+ offset: number;
38
+ entityType: string;
39
+ entityId: number;
40
+ }): Promise<ICollectionEntity[] | IError>;
41
+ /**
42
+ * Get a single collection object by id.
43
+ *
44
+ * @param {number} id - Collection id. Example: 1.
45
+ * @param {string} [langCode] - Language code. Default: "en_US".
46
+ * @return {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
47
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
48
+ */
49
+ getICollectionById(id: number, langCode: string): Promise<ICollectionEntity | IError>;
50
+ /**
51
+ * Get all records belonging to the collection by collection id.
52
+ *
53
+ * @param {number} id - Collection id.
54
+ * @param {string} [langCode] - Language code. Default: "en_US".
55
+ * @param {any} [userQuery] - Optional set query parameters. Example:
56
+ {
57
+ "limit": 30,
58
+ "offset": 0,
59
+ "entityType": "orders",
60
+ "entityId": 1
61
+ }
62
+ * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
63
+ * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
64
+ * @param {number} [userQuery.entityType] - Entity type. Example: "orders".
65
+ * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
66
+ * @return {ICollectionRowsResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
67
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
68
+ */
69
+ getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<ICollectionRowsResponce | IError>;
70
+ /**
71
+ * Check for the existence of a text identifier (marker).
72
+ *
73
+ * @param {string} marker - Collection marker. Example: "collection1".
74
+ * @return {ICollectionIsValid} Returns an object with a boolean property `valid` indicating whether the marker is valid or not. Example:
75
+ {
76
+ "valid": true
77
+ }
78
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
79
+ */
18
80
  validateICollectionMarker(marker: string): Promise<any | IError>;
19
- getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<any | IError>;
20
- createICollectionRow(marker: string, body: any, langCode: string): Promise<Array<any> | IError>;
21
- updateICollectionRow(marker: string, id: number, body: any, langCode: string): Promise<any | IError>;
81
+ /**
82
+ * Getting all records from the collection.
83
+ *
84
+ * @param {string} marker - Collection text identifier. Example: "collection1".
85
+ * @param {string} [langCode] - Language code. Default: "en_US".
86
+ * @return {ICollectionRowsResponce} Returns collection row entity object.
87
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
88
+ */
89
+ getICollectionRowsByMarker(marker: string, langCode?: string): Promise<ICollectionRowsResponce | IError>;
90
+ /**
91
+ * Getting one record from the collection.
92
+ *
93
+ * @param {string} marker - Collection text identifier. Example: "collection1".
94
+ * @param {number} id - Collection record identifier. Example: 1.
95
+ * @param {string} [langCode] - Language code. Default: "en_US".
96
+ * @return {ICollectionRow} Returns collection row entity object.
97
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
98
+ */
99
+ getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<ICollectionRow | IError>;
100
+ /**
101
+ * Create a record in the collection.
102
+ *
103
+ * @param {string} marker - Collection text identifier. Example: "collection1".
104
+ * @param {ICollectionFormObject} body - Object for creating a record. Example:
105
+ {
106
+ "formIdentifier": "collection-form",
107
+ "formData": {
108
+ "en_US": [
109
+ {
110
+ "marker": "collection_marker",
111
+ "type": "string",
112
+ "value": "Collection marker"
113
+ }
114
+ ]
115
+ }
116
+ }
117
+ * @param {string} [langCode] - Language code. Default: "en_US".
118
+ * @return {any} Returns object of type ICollectionRow.
119
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
120
+ */
121
+ createICollectionRow(marker: string, body: ICollectionFormObject, langCode: string): Promise<any | IError>;
122
+ /**
123
+ * Edit a record in the collection.
124
+ *
125
+ * @param {string} marker - Text identifier of the collection. Example: "collection1".
126
+ * @param {number} id - Row id. Example: 12.
127
+ * @param {ICollectionFormObject} body - Object for updating a record in the collection. Example:
128
+ {
129
+ "formIdentifier": "collection-form",
130
+ "formData": {
131
+ "en_US": [
132
+ {
133
+ "marker": "collection_marker",
134
+ "type": "string",
135
+ "value": "Collection marker"
136
+ }
137
+ ]
138
+ }
139
+ }
140
+ * @param {string} [langCode] - Language code. Default: "en_US".
141
+ * @return {ICollectionRow} Returns object of type ICollectionRow.
142
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
143
+ */
144
+ updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode: string): Promise<any | IError>;
145
+ /**
146
+ * Deletion of collection record object
147
+ *
148
+ * @param {string} marker - text identifier of the collection Example: "collection1".
149
+ * @param {number} id - record identifier in the collection Example: 12.
150
+ * @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
151
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
152
+ */
22
153
  deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<any | IError>;
23
154
  }
24
155
  /**
25
- * ICollection
156
+ * @interface ICollectionEntity
26
157
  *
27
- * @property {number} [id] - Object identifier
28
- * @property {object} [localizeInfos] - Name considering localization
29
- * @property {string | null} [identifier] - Text identifier for record field
30
- * @property {number | null} [formId] - Identifier for the form used by the order storage
31
- * @property {string | null} [attributeSetId] - Identifier of the set of attributes used by the form attached to the collection
32
- * @property {string | null} [selectedAttributeMarkers] - Text identifiers of form object attributes for display in the data table
158
+ * @property {number} id - Object identifier. Example: 1.
159
+ * @property {string | null} identifier - Text identifier for record field. Example: "collection1".
160
+ * @property {number | null} formId - Identifier for the form used by the order storage. Example: 1234.
161
+ * @property {ILocalizeInfo} localizeInfos - Localized information about the collection. Example:
162
+ {
163
+ "title": "Admins text"
164
+ }
165
+ * @property {string | null} attributeSetId - Identifier of the set of attributes used by the form attached to the collection. Example: "attributeSet1" or null if not applicable.
166
+ * @property {string | null} selectedAttributeMarkers - Text identifiers of form object attributes for display in the data table. Example: "collection_marker".
167
+ * @description Represents a collection object with various properties, including identifiers, form information, and localized data.
33
168
  */
34
- interface ICollection {
169
+ interface ICollectionEntity {
35
170
  id: number;
36
171
  identifier: string | null;
37
172
  formId: number | null;
38
- localizeInfos: object;
173
+ localizeInfos: ILocalizeInfo;
39
174
  attributeSetId: string | null;
40
175
  selectedAttributeMarkers: string | null;
41
176
  }
42
177
  /**
43
- * ICollectionResponce
178
+ * @interface ICollectionResponce
44
179
  *
45
- * @property {ICollection[]} items -
46
- * @property {number} total -
180
+ * @property {ICollectionEntity[]} items - Array of collection objects. Example:
181
+ [
182
+ {
183
+ "id": 1,
184
+ "identifier": "collection1"
185
+ }
186
+ ]
187
+ * @property {number} total - Total number of found records. Example: 10.
188
+ * @description Represents a response from the collections API containing a total count and an array of collection objects.
47
189
  */
48
190
  interface ICollectionResponce {
49
- items: ICollection[];
191
+ items: ICollectionEntity[];
50
192
  total: number;
51
193
  }
52
194
  /**
53
- * ICollectionFormData
195
+ * @interface ICollectionFormData
54
196
  *
55
- * @property {string} marker -
56
- * @property {string} type -
57
- * @property {string} value -
197
+ * @property {string} marker - Text identifier (marker) of the form field. Example: "collection_marker".
198
+ * @property {string} type - Type of the form field, such as "text", "number", "date", "etc". Example: "number".
199
+ * @property {string} value - Value of the form field, which can be a "string", "number", "date", "etc". Example: "Collection marker".
200
+ * @description Represents a form data object within a collection, containing a marker, type, and value.
58
201
  */
59
202
  interface ICollectionFormData {
60
203
  marker: string;
@@ -62,10 +205,21 @@ interface ICollectionFormData {
62
205
  value: string;
63
206
  }
64
207
  /**
65
- * ICollectionFormObject
208
+ * @interface ICollectionFormObject
66
209
  *
67
- * @property {string} formIdentifier -
68
- * @property {object} formData -
210
+ * @property {string} formIdentifier - Text identifier (marker) of the form. Example: "collection-form".
211
+ * @property {Record<string, ICollectionFormData>} formData - An object where keys are form field markers and values are arrays of ICollectionFormData objects. Example:
212
+ [
213
+ {
214
+ "marker": "name_1",
215
+ "type": "string",
216
+ "value": "Value"
217
+ }
218
+ ]
219
+ * @property {string} formData[index].marker - Text identifier (marker) of the form field. Example: "name_1".
220
+ * @property {string} formData[index].type - Type of the form field. Example: "string".
221
+ * @property {string} formData[index].value - Value of the form field. Example: "Value".
222
+ * @description Represents a collection form object that contains a form identifier and associated form data. This interface defines the structure of a collection form object, which includes a form identifier and a set of form data organized by markers.
69
223
  */
70
224
  interface ICollectionFormObject {
71
225
  formIdentifier: string;
@@ -74,23 +228,72 @@ interface ICollectionFormObject {
74
228
  };
75
229
  }
76
230
  /**
77
- * ICollectionRow
231
+ * @interface ICollectionRow
232
+ *
233
+ * @property {number} id - Object identifier. Example: 1.
234
+ * @property {string} createdDate - Date of creation of the record. Example: "2023-01-01T00:00:00Z".
235
+ * @property {string} updatedDate - Date of last update of the record. Example: "2023-01-02T00:00:00Z".
236
+ * @property {number | null} [collectionId] - collectionId associated with the collection row. Example: "product", "order", "etc".
237
+ * @property {ICollectionFormData[]} formData - Array of form data objects associated with the collection row. Example:
238
+ [
239
+ {
240
+ "marker": "name_1",
241
+ "type": "string",
242
+ "value": "Value"
243
+ }
244
+ ]
245
+ * @property {string | null} entityType - Type of the entity associated with the collection row. Example: "product", "order", "etc".
246
+ * @property {number | null} entityId - Identifier of the entity associated with the collection row. Example: 12345.
247
+ * @property {string | null} [attributeSetIdentifier] - Identifier of the attribute set used by the form attached to the collection row, or null if not applicable. Example: "attributeSet1" or null.
248
+ * @property {string} total - Total count. Example: "1".
249
+ * @description Represents a row in a collection, containing various properties such as identifiers, dates, form data, and an optional total value.
78
250
  */
79
251
  interface ICollectionRow {
80
252
  id: number;
81
253
  createdDate: string;
82
254
  updatedDate: string;
83
- entityId: any;
84
- entityType: any;
255
+ collectionId?: number | null;
85
256
  formData: ICollectionFormData[];
86
- attributeSetIdentifier: string | null;
87
- total?: string;
257
+ entityType: string | null;
258
+ entityId: number | null;
259
+ attributeSetIdentifier?: string | null;
260
+ total: string;
88
261
  }
89
262
  /**
90
- * ICollectionRows
263
+ * @interface ICollectionRowsResponce
264
+ *
265
+ * @property {ICollectionRow[]} items - Array of collection row objects. Example:
266
+ [
267
+ {
268
+ "id": 1,
269
+ "createdDate": "2025-06-06T19:08:54.616Z",
270
+ "updatedDate": "2025-06-06T19:08:54.616Z",
271
+ "entityId": null,
272
+ "entityType": null,
273
+ "formData": [
274
+ {
275
+ "marker": "name_1",
276
+ "type": "string",
277
+ "value": "Value"
278
+ }
279
+ ],
280
+ "attributeSetIdentifier": null
281
+ }
282
+ ]
283
+ * @property {number} total - Total number of found records. Example: 10.
284
+ * @description Represents a response from the collections API containing a total count and an array of collection row objects.
91
285
  */
92
286
  interface ICollectionRowsResponce {
93
287
  items: ICollectionRow[];
94
288
  total: number;
95
289
  }
96
- export type { ICollection, ICollectionFormObject, ICollectionResponce, ICollectionRow, ICollectionRowsResponce, ICollectionsApi, };
290
+ /**
291
+ * @interface ICollectionIsValid
292
+ *
293
+ * @property {boolean} valid - Valid marker object. Example: true.
294
+ * @description Represents a response from the validateICollectionMarker.
295
+ */
296
+ interface ICollectionIsValid {
297
+ valid: boolean;
298
+ }
299
+ export type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionResponce, ICollectionRow, ICollectionRowsResponce, ICollectionsApi, };
@@ -13,7 +13,11 @@ export default class LocalesApi extends AsyncModules implements ILocales {
13
13
  /**
14
14
  * Find all active language localization objects.
15
15
  *
16
- * @returns Returns an array of LocaleEntity objects
16
+ * @handleName getLocales
17
+ *
18
+ * @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
19
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
20
+ * @description Find all active language localization objects.
17
21
  */
18
22
  getLocales(): Promise<Array<ILocalEntity> | IError>;
19
23
  }
@@ -16,7 +16,11 @@ class LocalesApi extends asyncModules_1.default {
16
16
  /**
17
17
  * Find all active language localization objects.
18
18
  *
19
- * @returns Returns an array of LocaleEntity objects
19
+ * @handleName getLocales
20
+ *
21
+ * @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
22
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
23
+ * @description Find all active language localization objects.
20
24
  */
21
25
  async getLocales() {
22
26
  const result = await this._fetchGet('/active/all');
@@ -1,24 +1,31 @@
1
1
  import type { IError } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of Locales Api.
3
+ * @interface ILocales
4
4
  *
5
5
  * @property {function} getLocales - Find all active language localization objects.
6
+ * @description This interface defines a method for retrieving all active language localization objects in the system.
6
7
  */
7
8
  interface ILocales {
8
- getLocales(): Promise<Array<ILocalEntity> | IError>;
9
+ /**
10
+ * Find all active language localization objects.
11
+ *
12
+ * @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
13
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
14
+ */
15
+ getLocales(): Promise<ILocalEntity[] | IError>;
9
16
  }
10
17
  /**
11
- * Represents a locales object.
18
+ * @interface ILocalEntity
12
19
  *
13
- * @interface
14
- * @property {number} id - The unique identifier of the locales.
15
- * @property {string} shortCode - The shortCode of locales.
16
- * @property {string} code - The full language code.
17
- * @property {string} name - The language name.
18
- * @property {string} nativeName - The native language name.
19
- * @property {boolean} isActive - Active language flag.
20
- * @property {string} image - The language image.
21
- * @property {number} position - The language position.
20
+ * @property {number} id - The unique identifier of the locales. Example: 1.
21
+ * @property {string} shortCode - The shortCode of locales. Example: "en".
22
+ * @property {string} code - The full language code. Example: "en_US".
23
+ * @property {string} name - The language name. Example: "English".
24
+ * @property {string} nativeName - The native language name. Example: "English".
25
+ * @property {boolean} isActive - Active language flag. Example: true.
26
+ * @property {string | null} image - The language image. Example: "https://example.com/images/en.png".
27
+ * @property {number} position - The language position. Example: 1.
28
+ * @description This interface defines the structure of a locales entity, including its identifiers, name, and other properties.
22
29
  */
23
30
  interface ILocalEntity {
24
31
  id: number;
@@ -13,10 +13,13 @@ export default class MenusApi extends AsyncModules implements IMenus {
13
13
  /**
14
14
  * Get pages includes in menu by marker.
15
15
  *
16
- * @param {string} [marker] - Menu marker
17
- * @param {string} [langCode] - Language code
16
+ * @handleName getMenusByMarker
18
17
  *
19
- * @returns Returns a single menu object as a ContentMenu object with included pages
18
+ * @param {string} marker - Menu marker. Example: "main_menu".
19
+ * @param {string} [langCode] - Language code. Default: "en_US".
20
+ * @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
21
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
22
+ * @description Get pages includes in menu by marker.
20
23
  */
21
24
  getMenusByMarker(marker: string, langCode?: string): Promise<IMenusEntity | IError>;
22
25
  }
@@ -16,10 +16,13 @@ class MenusApi extends asyncModules_1.default {
16
16
  /**
17
17
  * Get pages includes in menu by marker.
18
18
  *
19
- * @param {string} [marker] - Menu marker
20
- * @param {string} [langCode] - Language code
19
+ * @handleName getMenusByMarker
21
20
  *
22
- * @returns Returns a single menu object as a ContentMenu object with included pages
21
+ * @param {string} marker - Menu marker. Example: "main_menu".
22
+ * @param {string} [langCode] - Language code. Default: "en_US".
23
+ * @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
24
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
25
+ * @description Get pages includes in menu by marker.
23
26
  */
24
27
  async getMenusByMarker(marker, langCode = this.state.lang) {
25
28
  const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
@@ -1,46 +1,85 @@
1
- import type { IError, ILocalizeInfo } from '../base/utils';
1
+ import type { IAttributeValues, IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
- * Represents an interface object of Menus Api.
3
+ * @interface IMenus
4
4
  *
5
- * @property {function} getAdminsInfo - Get pages includes in menu by marker.
5
+ * @property {function} getMenusByMarker - Get pages includes in menu by marker.
6
+ * @description This interface defines a method for retrieving menu pages by a specific marker and language code.
6
7
  */
7
8
  interface IMenus {
9
+ /**
10
+ * Get pages includes in menu by marker.
11
+ *
12
+ * @param {string} marker - Menu marker. Example: "main_menu".
13
+ * @param {string} [langCode] - Language code. Default: "en_US".
14
+ * @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
15
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
16
+ */
8
17
  getMenusByMarker(marker: string, langCode: string): Promise<IMenusEntity | IError>;
9
18
  }
10
19
  /**
11
- * Represents a position object.
20
+ * @interface IMenusPages
12
21
  *
13
- * @interface
14
- * @property {Array<IMenusPages>} children - The optional parameter. Contains array with child page objects.
15
- * @property {number} id - The unique identifier of the menu.
16
- * @property {string} pageUrl - The page url string.
17
- * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization.
18
- * @property {IAttributesSets} attributeValues - Attributes sets
19
- * @property {number} position - The menu position.
20
- * @property {number | null} parentId - The menu parent id.
22
+ * @property {IMenusPages[]} children - Contains array with child page objects. Example:
23
+ [
24
+ {
25
+ "id": null,
26
+ "pageUrl": null,
27
+ "localizeInfos": {},
28
+ "attributeValues": {},
29
+ "parentId": null,
30
+ "position": 1
31
+ }
32
+ ]
33
+ * @property {number} id - The unique identifier of the menu. Example: 1.
34
+ * @property {string} pageUrl - The page url string. Example: "about".
35
+ * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization. Example:
36
+ {
37
+ "title": "menu"
38
+ }
39
+ * @property {IAttributeValues} attributeValues - Attributes sets. Example:
40
+ {
41
+ "color": "red",
42
+ "size": "large"
43
+ }
44
+ * @property {number} position - The menu position. Example: 1.
45
+ * @property {number | null} parentId - The menu parent id. Example: null.
46
+ * @description This interface defines the structure of a menu page entity, including its identifiers, localization information, attributes, and hierarchical relationships.
21
47
  */
22
48
  interface IMenusPages {
23
- children?: Array<IMenusPages> | IMenusPages;
49
+ children?: IMenusPages[] | IMenusPages;
24
50
  id: number | null;
25
51
  pageUrl: string | null;
26
52
  localizeInfos: ILocalizeInfo;
27
- attributeValues: any;
53
+ attributeValues: IAttributeValues;
28
54
  position: number;
29
55
  parentId: number | null;
30
56
  }
31
57
  /**
32
- * Represents a position object.
58
+ * @interface IMenusEntity
33
59
  *
34
- * @interface
35
- * @property {number} id - The unique identifier of the menu.
36
- * @property {string} identifier - The menu identifier.
37
- * @property {Record<string, any>} localizeInfos - The menu data, taking into account localization.
38
- * @property {Array<IMenusPages>} pages - Array of menu pages.
60
+ * @property {number} id - The unique identifier of the menu. Example: 1.
61
+ * @property {string} identifier - The menu identifier. Example: "main_menu".
62
+ * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization. Example:
63
+ {
64
+ "title": "menu"
65
+ }
66
+ * @property {IMenusPages[]} pages - Array of menu pages. Example:
67
+ [
68
+ {
69
+ "id": null,
70
+ "pageUrl": null,
71
+ "localizeInfos": {},
72
+ "attributeValues": {},
73
+ "parentId": null,
74
+ "position": 1
75
+ }
76
+ ]
77
+ * @description This interface defines the structure of a menu entity, including its identifiers, localization information, and associated pages.
39
78
  */
40
79
  interface IMenusEntity {
41
80
  id: number;
42
81
  identifier: string;
43
82
  localizeInfos: ILocalizeInfo;
44
- pages: Array<IMenusPages> | IMenusPages;
83
+ pages: IMenusPages[] | IMenusPages;
45
84
  }
46
85
  export type { IMenus, IMenusEntity, IMenusPages };