oneentry 1.0.124 → 1.0.126

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 (78) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +17 -4
  3. package/dist/admins/adminsApi.js +16 -3
  4. package/dist/admins/adminsInterfaces.d.ts +47 -26
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
  6. package/dist/attribute-sets/attributeSetsApi.js +9 -17
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
  8. package/dist/auth-provider/authProviderApi.d.ts +146 -36
  9. package/dist/auth-provider/authProviderApi.js +163 -37
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
  11. package/dist/base/asyncModules.d.ts +7 -1
  12. package/dist/base/asyncModules.js +127 -21
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +4 -0
  15. package/dist/base/syncModules.js +19 -1
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +7 -17
  18. package/dist/blocks/blocksApi.js +7 -17
  19. package/dist/blocks/blocksInterfaces.d.ts +77 -32
  20. package/dist/events/eventsApi.d.ts +7 -8
  21. package/dist/events/eventsApi.js +12 -7
  22. package/dist/events/eventsInterfaces.d.ts +16 -11
  23. package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
  24. package/dist/file-uploading/fileUploadingApi.js +20 -12
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
  26. package/dist/forms/formsApi.d.ts +3 -7
  27. package/dist/forms/formsApi.js +2 -6
  28. package/dist/forms/formsInterfaces.d.ts +44 -28
  29. package/dist/{formsData → forms-data}/formsDataApi.d.ts +31 -15
  30. package/dist/{formsData → forms-data}/formsDataApi.js +30 -14
  31. package/dist/forms-data/formsDataInterfaces.d.ts +462 -0
  32. package/dist/general-types/generalTypesApi.d.ts +1 -3
  33. package/dist/general-types/generalTypesApi.js +0 -2
  34. package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
  38. package/dist/integration-collections/integrationCollectionsApi.js +64 -45
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
  40. package/dist/locales/localesApi.d.ts +1 -2
  41. package/dist/locales/localesApi.js +1 -2
  42. package/dist/locales/localesInterfaces.d.ts +2 -4
  43. package/dist/menus/menusApi.d.ts +1 -3
  44. package/dist/menus/menusApi.js +1 -3
  45. package/dist/menus/menusInterfaces.d.ts +39 -13
  46. package/dist/orders/ordersApi.d.ts +36 -18
  47. package/dist/orders/ordersApi.js +40 -22
  48. package/dist/orders/ordersInterfaces.d.ts +163 -81
  49. package/dist/pages/pagesApi.d.ts +48 -48
  50. package/dist/pages/pagesApi.js +40 -45
  51. package/dist/pages/pagesInterfaces.d.ts +147 -98
  52. package/dist/payments/paymentsApi.d.ts +25 -45
  53. package/dist/payments/paymentsApi.js +27 -46
  54. package/dist/payments/paymentsInterfaces.d.ts +42 -60
  55. package/dist/product-statuses/productStatusesApi.d.ts +6 -12
  56. package/dist/product-statuses/productStatusesApi.js +5 -11
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
  58. package/dist/products/productsApi.d.ts +256 -104
  59. package/dist/products/productsApi.js +263 -97
  60. package/dist/products/productsInterfaces.d.ts +343 -160
  61. package/dist/system/systemApi.d.ts +21 -10
  62. package/dist/system/systemApi.js +22 -8
  63. package/dist/system/systemInterfaces.d.ts +0 -1
  64. package/dist/templates/templatesApi.d.ts +6 -12
  65. package/dist/templates/templatesApi.js +4 -10
  66. package/dist/templates/templatesInterfaces.d.ts +20 -20
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
  68. package/dist/templates-preview/templatesPreviewApi.js +1 -5
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
  70. package/dist/users/usersApi.d.ts +33 -13
  71. package/dist/users/usersApi.js +38 -15
  72. package/dist/users/usersInterfaces.d.ts +78 -27
  73. package/dist/web-socket/wsApi.d.ts +1 -5
  74. package/dist/web-socket/wsApi.js +1 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +0 -1
  76. package/package.json +18 -16
  77. package/dist/formsData/formsDataInterfaces.d.ts +0 -267
  78. /package/dist/{formsData → forms-data}/formsDataInterfaces.js +0 -0
@@ -1,4 +1,4 @@
1
- import type { IError } from '../base/utils';
1
+ import type { IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
3
  * @interface ICollectionsApi
4
4
  *
@@ -11,7 +11,6 @@ import type { IError } from '../base/utils';
11
11
  * @property {function} createICollectionRow - Create a record (row) in the collection.
12
12
  * @property {function} updateICollectionRow - Edit a record (row) in the collection.
13
13
  * @property {function} deleteICollectionRowByMarkerAndId - Deletion of collection record object (row).
14
- *
15
14
  * @description This interface defines methods for managing collections and their records in the system.
16
15
  */
17
16
  interface ICollectionsApi {
@@ -19,48 +18,63 @@ interface ICollectionsApi {
19
18
  * Get all collections.
20
19
  *
21
20
  * @param {string} [langCode] - Language code. Default: "en_US".
22
- * @param {any} [userQuery] - Optional set query parameters.
23
- * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
24
- * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
25
- * @param {number} [userQuery.entityType] - Entity type. Example: .
26
- * @param {number} [userQuery.entityId] - Entity identifier. Example: .
27
- *
28
- * @return {ICollection[]} Returns an array of ICollection objects or an error object if there was an issue.
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.
29
33
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
30
34
  */
31
- getICollections(marker: string, langCode: string, userQuery?: any): Promise<Array<ICollection> | IError>;
35
+ getICollections(langCode: string, userQuery?: {
36
+ limit: number;
37
+ offset: number;
38
+ entityType: string;
39
+ entityId: number;
40
+ }): Promise<ICollectionEntity[] | IError>;
32
41
  /**
33
42
  * Get a single collection object by id.
34
43
  *
35
44
  * @param {number} id - Collection id. Example: 1.
36
45
  * @param {string} [langCode] - Language code. Default: "en_US".
37
- *
38
- * @return {ICollection} Returns an ICollection object or an error object if there was an issue.
46
+ * @return {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
39
47
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
40
48
  */
41
- getICollectionById(id: number, langCode: string): Promise<ICollection | IError>;
49
+ getICollectionById(id: number, langCode: string): Promise<ICollectionEntity | IError>;
42
50
  /**
43
51
  * Get all records belonging to the collection by collection id.
44
52
  *
45
53
  * @param {number} id - Collection id.
46
54
  * @param {string} [langCode] - Language code. Default: "en_US".
47
- * @param {any} [userQuery] - Optional set query parameters.
48
- *
49
- * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
50
- * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
51
- * @param {number} [userQuery.entityType] - Entity type. Example: .
52
- * @param {number} [userQuery.entityId] - Entity identifier. Example: .
53
- *
54
- * @return {ICollectionResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
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.
55
67
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
56
68
  */
57
- getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<any | IError>;
69
+ getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<ICollectionRowsResponce | IError>;
58
70
  /**
59
71
  * Check for the existence of a text identifier (marker).
60
72
  *
61
73
  * @param {string} marker - Collection marker. Example: "collection1".
62
- *
63
- * @return {any} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
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
+ }
64
78
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
65
79
  */
66
80
  validateICollectionMarker(marker: string): Promise<any | IError>;
@@ -69,95 +83,120 @@ interface ICollectionsApi {
69
83
  *
70
84
  * @param {string} marker - Collection text identifier. Example: "collection1".
71
85
  * @param {string} [langCode] - Language code. Default: "en_US".
72
- *
73
- * @return {any} Returns CollectionRowEntity object.
86
+ * @return {ICollectionRowsResponce} Returns collection row entity object.
74
87
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
75
88
  */
76
- getICollectionRowsByMarker(marker: string, langCode?: string): Promise<any | IError>;
89
+ getICollectionRowsByMarker(marker: string, langCode?: string): Promise<ICollectionRowsResponce | IError>;
77
90
  /**
78
91
  * Getting one record from the collection.
79
92
  *
80
93
  * @param {string} marker - Collection text identifier. Example: "collection1".
81
94
  * @param {number} id - Collection record identifier. Example: 1.
82
95
  * @param {string} [langCode] - Language code. Default: "en_US".
83
- *
84
- * @return {any} Returns CollectionRowEntity object.
96
+ * @return {ICollectionRow} Returns collection row entity object.
85
97
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
86
98
  */
87
- getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<any | IError>;
99
+ getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<ICollectionRow | IError>;
88
100
  /**
89
101
  * Create a record in the collection.
90
102
  *
91
103
  * @param {string} marker - Collection text identifier. Example: "collection1".
92
- * @param {ICollectionFormObject} body - Object for creating a record. Example: { "formIdentifier": "collection-form", "formData": { "en_US": [ { "marker": "collection_marker", "type": "string", "value": "Collection marker" } ] } }
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
+ }
93
117
  * @param {string} [langCode] - Language code. Default: "en_US".
94
- *
95
118
  * @return {any} Returns object of type ICollectionRow.
96
119
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
97
120
  */
98
- createICollectionRow(marker: string, body: any, langCode: string): Promise<Array<any> | IError>;
121
+ createICollectionRow(marker: string, body: ICollectionFormObject, langCode: string): Promise<any | IError>;
99
122
  /**
100
123
  * Edit a record in the collection.
101
124
  *
102
125
  * @param {string} marker - Text identifier of the collection. Example: "collection1".
103
126
  * @param {number} id - Row id. Example: 12.
104
- * @param {object} body - Object for updating a record in the collection. Example: { "formIdentifier": "collection-form", "formData": { "en_US": [ { "marker": "collection_marker", "type": "string", "value": "Collection marker" } ] } }
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
+ }
105
140
  * @param {string} [langCode] - Language code. Default: "en_US".
106
- *
107
141
  * @return {ICollectionRow} Returns object of type ICollectionRow.
108
142
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
109
143
  */
110
- updateICollectionRow(marker: string, id: number, body: any, langCode: string): Promise<any | IError>;
144
+ updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode: string): Promise<any | IError>;
111
145
  /**
112
146
  * Deletion of collection record object
113
147
  *
114
148
  * @param {string} marker - text identifier of the collection Example: "collection1".
115
149
  * @param {number} id - record identifier in the collection Example: 12.
116
- *
117
150
  * @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
118
151
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
119
152
  */
120
153
  deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<any | IError>;
121
154
  }
122
155
  /**
123
- * @interface ICollection
156
+ * @interface ICollectionEntity
124
157
  *
125
158
  * @property {number} id - Object identifier. Example: 1.
126
159
  * @property {string | null} identifier - Text identifier for record field. Example: "collection1".
127
160
  * @property {number | null} formId - Identifier for the form used by the order storage. Example: 1234.
128
- * @property {object} localizeInfos - Localized information about the collection. Example: .
161
+ * @property {ILocalizeInfo} localizeInfos - Localized information about the collection. Example:
162
+ {
163
+ "title": "Admins text"
164
+ }
129
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.
130
166
  * @property {string | null} selectedAttributeMarkers - Text identifiers of form object attributes for display in the data table. Example: "collection_marker".
131
- *
132
167
  * @description Represents a collection object with various properties, including identifiers, form information, and localized data.
133
168
  */
134
- interface ICollection {
169
+ interface ICollectionEntity {
135
170
  id: number;
136
171
  identifier: string | null;
137
172
  formId: number | null;
138
- localizeInfos: object;
173
+ localizeInfos: ILocalizeInfo;
139
174
  attributeSetId: string | null;
140
175
  selectedAttributeMarkers: string | null;
141
176
  }
142
177
  /**
143
178
  * @interface ICollectionResponce
144
179
  *
145
- * @property {ICollection[]} items - Array of collection objects. Example: [{ id: 1, identifier: "collection1", ... }].
180
+ * @property {ICollectionEntity[]} items - Array of collection objects. Example:
181
+ [
182
+ {
183
+ "id": 1,
184
+ "identifier": "collection1"
185
+ }
186
+ ]
146
187
  * @property {number} total - Total number of found records. Example: 10.
147
- *
148
188
  * @description Represents a response from the collections API containing a total count and an array of collection objects.
149
189
  */
150
190
  interface ICollectionResponce {
151
- items: ICollection[];
191
+ items: ICollectionEntity[];
152
192
  total: number;
153
193
  }
154
194
  /**
155
195
  * @interface ICollectionFormData
156
196
  *
157
197
  * @property {string} marker - Text identifier (marker) of the form field. Example: "collection_marker".
158
- * @property {string} type - Type of the form field, such as 'text', 'number', 'date', etc. Example: "string".
159
- * @property {string} value - Value of the form field, which can be a string, number, date, etc. Example: "Collection marker".
160
- *
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".
161
200
  * @description Represents a form data object within a collection, containing a marker, type, and value.
162
201
  */
163
202
  interface ICollectionFormData {
@@ -169,8 +208,17 @@ interface ICollectionFormData {
169
208
  * @interface ICollectionFormObject
170
209
  *
171
210
  * @property {string} formIdentifier - Text identifier (marker) of the form. Example: "collection-form".
172
- * @property {ICollectionFormData[]} formData - An object where keys are form field markers and values are arrays of ICollectionFormData objects. Example: .
173
- *
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".
174
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.
175
223
  */
176
224
  interface ICollectionFormObject {
@@ -185,34 +233,67 @@ interface ICollectionFormObject {
185
233
  * @property {number} id - Object identifier. Example: 1.
186
234
  * @property {string} createdDate - Date of creation of the record. Example: "2023-01-01T00:00:00Z".
187
235
  * @property {string} updatedDate - Date of last update of the record. Example: "2023-01-02T00:00:00Z".
188
- * @property {any} entityId - Identifier of the entity associated with the collection row. Example: 12345.
189
- * @property {any} entityType - Type of the entity associated with the collection row. Example: "product", "order", etc.
190
- * @property {ICollectionFormData[]} formData - Array of form data objects associated with the collection row. Example: .
191
- * @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.
192
- * @property {string} [total] - Total value associated with the collection row, if applicable. Example: "100.00".
193
- *
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".
194
249
  * @description Represents a row in a collection, containing various properties such as identifiers, dates, form data, and an optional total value.
195
250
  */
196
251
  interface ICollectionRow {
197
252
  id: number;
198
253
  createdDate: string;
199
254
  updatedDate: string;
200
- entityId: any;
201
- entityType: any;
255
+ collectionId?: number | null;
202
256
  formData: ICollectionFormData[];
203
- attributeSetIdentifier: string | null;
204
- total?: string;
257
+ entityType: string | null;
258
+ entityId: number | null;
259
+ attributeSetIdentifier?: string | null;
260
+ total: string;
205
261
  }
206
262
  /**
207
263
  * @interface ICollectionRowsResponce
208
264
  *
209
- * @property {ICollectionRow[]} items - Array of collection row objects. Example: .
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
+ ]
210
283
  * @property {number} total - Total number of found records. Example: 10.
211
- *
212
284
  * @description Represents a response from the collections API containing a total count and an array of collection row objects.
213
285
  */
214
286
  interface ICollectionRowsResponce {
215
287
  items: ICollectionRow[];
216
288
  total: number;
217
289
  }
218
- 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, };
@@ -17,8 +17,7 @@ export default class LocalesApi extends AsyncModules implements ILocales {
17
17
  *
18
18
  * @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
19
19
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
20
- *
21
- * @description
20
+ * @description Find all active language localization objects.
22
21
  */
23
22
  getLocales(): Promise<Array<ILocalEntity> | IError>;
24
23
  }
@@ -20,8 +20,7 @@ class LocalesApi extends asyncModules_1.default {
20
20
  *
21
21
  * @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
22
22
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
23
- *
24
- * @description
23
+ * @description Find all active language localization objects.
25
24
  */
26
25
  async getLocales() {
27
26
  const result = await this._fetchGet('/active/all');
@@ -3,7 +3,6 @@ import type { IError } from '../base/utils';
3
3
  * @interface ILocales
4
4
  *
5
5
  * @property {function} getLocales - Find all active language localization objects.
6
- *
7
6
  * @description This interface defines a method for retrieving all active language localization objects in the system.
8
7
  */
9
8
  interface ILocales {
@@ -13,7 +12,7 @@ interface ILocales {
13
12
  * @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
14
13
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
15
14
  */
16
- getLocales(): Promise<Array<ILocalEntity> | IError>;
15
+ getLocales(): Promise<ILocalEntity[] | IError>;
17
16
  }
18
17
  /**
19
18
  * @interface ILocalEntity
@@ -24,9 +23,8 @@ interface ILocales {
24
23
  * @property {string} name - The language name. Example: "English".
25
24
  * @property {string} nativeName - The native language name. Example: "English".
26
25
  * @property {boolean} isActive - Active language flag. Example: true.
27
- * @property {string} image - The language image. Example: "https://example.com/images/en.png".
26
+ * @property {string | null} image - The language image. Example: "https://example.com/images/en.png".
28
27
  * @property {number} position - The language position. Example: 1.
29
- *
30
28
  * @description This interface defines the structure of a locales entity, including its identifiers, name, and other properties.
31
29
  */
32
30
  interface ILocalEntity {
@@ -17,11 +17,9 @@ export default class MenusApi extends AsyncModules implements IMenus {
17
17
  *
18
18
  * @param {string} marker - Menu marker. Example: "main_menu".
19
19
  * @param {string} [langCode] - Language code. Default: "en_US".
20
- *
21
20
  * @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
22
21
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
23
- *
24
- * @description
22
+ * @description Get pages includes in menu by marker.
25
23
  */
26
24
  getMenusByMarker(marker: string, langCode?: string): Promise<IMenusEntity | IError>;
27
25
  }
@@ -20,11 +20,9 @@ class MenusApi extends asyncModules_1.default {
20
20
  *
21
21
  * @param {string} marker - Menu marker. Example: "main_menu".
22
22
  * @param {string} [langCode] - Language code. Default: "en_US".
23
- *
24
23
  * @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
25
24
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
26
- *
27
- * @description
25
+ * @description Get pages includes in menu by marker.
28
26
  */
29
27
  async getMenusByMarker(marker, langCode = this.state.lang) {
30
28
  const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
@@ -1,9 +1,8 @@
1
- import type { IError, ILocalizeInfo } from '../base/utils';
1
+ import type { IAttributeValues, IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
3
  * @interface IMenus
4
4
  *
5
5
  * @property {function} getMenusByMarker - Get pages includes in menu by marker.
6
- *
7
6
  * @description This interface defines a method for retrieving menu pages by a specific marker and language code.
8
7
  */
9
8
  interface IMenus {
@@ -12,7 +11,6 @@ interface IMenus {
12
11
  *
13
12
  * @param {string} marker - Menu marker. Example: "main_menu".
14
13
  * @param {string} [langCode] - Language code. Default: "en_US".
15
- *
16
14
  * @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
17
15
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
18
16
  */
@@ -21,22 +19,38 @@ interface IMenus {
21
19
  /**
22
20
  * @interface IMenusPages
23
21
  *
24
- * @property {Array<IMenusPages>} [children] - The optional parameter. Contains array with child page objects.
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
+ ]
25
33
  * @property {number} id - The unique identifier of the menu. Example: 1.
26
34
  * @property {string} pageUrl - The page url string. Example: "about".
27
- * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization. Example: .
28
- * @property {IAttributesSets} attributeValues - Attributes sets. Example: { "color": "red", "size": "large" }.
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
+ }
29
44
  * @property {number} position - The menu position. Example: 1.
30
45
  * @property {number | null} parentId - The menu parent id. Example: null.
31
- *
32
46
  * @description This interface defines the structure of a menu page entity, including its identifiers, localization information, attributes, and hierarchical relationships.
33
47
  */
34
48
  interface IMenusPages {
35
- children?: Array<IMenusPages> | IMenusPages;
49
+ children?: IMenusPages[] | IMenusPages;
36
50
  id: number | null;
37
51
  pageUrl: string | null;
38
52
  localizeInfos: ILocalizeInfo;
39
- attributeValues: any;
53
+ attributeValues: IAttributeValues;
40
54
  position: number;
41
55
  parentId: number | null;
42
56
  }
@@ -45,15 +59,27 @@ interface IMenusPages {
45
59
  *
46
60
  * @property {number} id - The unique identifier of the menu. Example: 1.
47
61
  * @property {string} identifier - The menu identifier. Example: "main_menu".
48
- * @property {Record<string, any>} localizeInfos - The menu data, taking into account localization. Example: .
49
- * @property {Array<IMenusPages>} pages - Array of menu pages. Example: .
50
- *
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
+ ]
51
77
  * @description This interface defines the structure of a menu entity, including its identifiers, localization information, and associated pages.
52
78
  */
53
79
  interface IMenusEntity {
54
80
  id: number;
55
81
  identifier: string;
56
82
  localizeInfos: ILocalizeInfo;
57
- pages: Array<IMenusPages> | IMenusPages;
83
+ pages: IMenusPages[] | IMenusPages;
58
84
  }
59
85
  export type { IMenus, IMenusEntity, IMenusPages };
@@ -7,7 +7,6 @@ import type { IBaseOrdersEntity, IOrderByMarkerEntity, IOrderData, IOrdersApi, I
7
7
  *
8
8
  * @handle /api/content/orders-storage
9
9
  * @module OrdersApi
10
- *
11
10
  * @description This module provides methods for working with orders, including retrieving, creating, and updating orders in the order storage.
12
11
  */
13
12
  export default class OrdersApi extends AsyncModules implements IOrdersApi {
@@ -19,16 +18,14 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
19
18
  *
20
19
  * @handleName getAllOrdersStorage
21
20
  *
22
- * @param {number} [langCode] - Language code. Default: "en_US".
21
+ * @param {string} [langCode] - Language code. Default: "en_US".
23
22
  * @param {number} [offset] - Optional parameter for pagination. Default: 0.
24
23
  * @param {number} [limit] - Optional parameter for pagination. Default: 30.
25
- *
26
24
  * @return {IOrdersEntity[]} Returns an array of order storage objects.
27
25
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
28
- *
29
26
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
30
27
  **/
31
- getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<Array<IOrdersEntity> | IError>;
28
+ getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<IOrdersEntity[] | IError>;
32
29
  /**
33
30
  * Getting all orders from the orders storage object created by the user.
34
31
  *
@@ -38,10 +35,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
38
35
  * @param {string} [langCode] - Language code. Default: "en_US".
39
36
  * @param {number} [offset] - Offset parameter. Default: 0.
40
37
  * @param {number} [limit] - Limit parameter. Default: 30.
41
- *
42
38
  * @return {IOrdersByMarkerEntity} Returns an object with the orders.
43
39
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
44
- *
45
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.
46
41
  */
47
42
  getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
@@ -52,10 +47,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
52
47
  *
53
48
  * @param {string} marker - Marker of the order object. Example: "order_storage_1".
54
49
  * @param {string} [langCode] - Language code. Default: "en_US".
55
- *
56
50
  * @return {IOrdersEntity} Return object of order information.
57
51
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
- *
59
52
  * @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
53
  */
61
54
  getOrderByMarker(marker: string, langCode?: string): Promise<IOrdersEntity | IError>;
@@ -67,10 +60,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
67
60
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
68
61
  * @param {number} id - ID of the order object. Example: 12345.
69
62
  * @param {string} [langCode] - Language code. Default: "en_US".
70
- *
71
63
  * @return {IOrderByMarkerEntity} Returns an object with the order.
72
64
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
73
- *
74
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.
75
66
  */
76
67
  getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrderByMarkerEntity | IError>;
@@ -80,15 +71,28 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
80
71
  * @handleName createOrder
81
72
  *
82
73
  * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
83
- * @param {IOrderData} data - Object for creating an order. Example: "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ] }.
74
+ * @param {IOrderData} body - Object for creating an order. Example:
75
+ {
76
+ "formIdentifier": "bar-orders-form",
77
+ "paymentAccountIdentifier": "usd-payment",
78
+ "formData": {
79
+ "marker": "name_1",
80
+ "value": "Name",
81
+ "type": "string"
82
+ },
83
+ "products": [
84
+ {
85
+ "productId": 1,
86
+ "quantity": 2
87
+ }
88
+ ]
89
+ }
84
90
  * @param {String} [langCode] - Language code. Default: "en_US".
85
- *
86
91
  * @return {IBaseOrdersEntity} Returns an object with the created order.
87
92
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
88
- *
89
93
  * @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.
90
94
  */
91
- createOrder(marker: string, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
95
+ createOrder(marker: string, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
92
96
  /**
93
97
  * Changing an order in the orders storage
94
98
  *
@@ -96,12 +100,26 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
96
100
  *
97
101
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
98
102
  * @param {number} id - ID of the order object. Example: 12345.
99
- * @param {IOrderData} body - Object for updating an order. Example: { "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ], "currency": "USD" }.
103
+ * @param {IOrderData} body - Object for updating an order. Example:
104
+ {
105
+ "formIdentifier": "bar-orders-form",
106
+ "paymentAccountIdentifier": "usd-payment",
107
+ "formData": {
108
+ "marker": "name_1",
109
+ "value": "Name",
110
+ "type": "string"
111
+ },
112
+ "products": [
113
+ {
114
+ "productId": 1,
115
+ "quantity": 2
116
+ }
117
+ ],
118
+ "currency": "USD"
119
+ }
100
120
  * @param {string} [langCode] - Language code. Default: "en_US".
101
- *
102
121
  * @return {IBaseOrdersEntity} Returns an object with the updated order.
103
122
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
104
- *
105
123
  * @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.
106
124
  */
107
125
  updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;