oneentry 1.0.126 → 1.0.127

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 (83) hide show
  1. package/README.md +0 -2
  2. package/configure.js +25 -18
  3. package/dist/admins/adminsApi.d.ts +30 -25
  4. package/dist/admins/adminsApi.js +30 -25
  5. package/dist/admins/adminsInterfaces.d.ts +45 -54
  6. package/dist/attribute-sets/attributeSetsApi.d.ts +26 -27
  7. package/dist/attribute-sets/attributeSetsApi.js +26 -27
  8. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +101 -109
  9. package/dist/auth-provider/authProviderApi.d.ts +132 -158
  10. package/dist/auth-provider/authProviderApi.js +131 -157
  11. package/dist/auth-provider/authProvidersInterfaces.d.ts +241 -237
  12. package/dist/base/asyncModules.d.ts +23 -21
  13. package/dist/base/asyncModules.js +30 -25
  14. package/dist/base/result.d.ts +31 -0
  15. package/dist/base/result.js +32 -1
  16. package/dist/base/stateModule.d.ts +10 -0
  17. package/dist/base/stateModule.js +50 -2
  18. package/dist/base/syncModules.d.ts +41 -49
  19. package/dist/base/syncModules.js +49 -48
  20. package/dist/base/utils.d.ts +38 -7
  21. package/dist/blocks/blocksApi.d.ts +27 -36
  22. package/dist/blocks/blocksApi.js +27 -36
  23. package/dist/blocks/blocksInterfaces.d.ts +92 -97
  24. package/dist/config.d.ts +13 -0
  25. package/dist/config.js +30 -0
  26. package/dist/events/eventsApi.d.ts +16 -33
  27. package/dist/events/eventsApi.js +32 -46
  28. package/dist/events/eventsInterfaces.d.ts +42 -37
  29. package/dist/file-uploading/fileUploadingApi.d.ts +42 -47
  30. package/dist/file-uploading/fileUploadingApi.js +44 -47
  31. package/dist/file-uploading/fileUploadingInterfaces.d.ts +49 -60
  32. package/dist/forms/formsApi.d.ts +15 -14
  33. package/dist/forms/formsApi.js +15 -14
  34. package/dist/forms/formsInterfaces.d.ts +36 -40
  35. package/dist/forms-data/formsDataApi.d.ts +40 -44
  36. package/dist/forms-data/formsDataApi.js +42 -44
  37. package/dist/forms-data/formsDataInterfaces.d.ts +231 -231
  38. package/dist/general-types/generalTypesApi.d.ts +5 -5
  39. package/dist/general-types/generalTypesApi.js +5 -5
  40. package/dist/general-types/generalTypesInterfaces.d.ts +6 -9
  41. package/dist/index.d.ts +12 -13
  42. package/dist/index.js +12 -13
  43. package/dist/integration-collections/integrationCollectionsApi.d.ts +84 -98
  44. package/dist/integration-collections/integrationCollectionsApi.js +86 -102
  45. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +177 -169
  46. package/dist/locales/localesApi.d.ts +7 -3
  47. package/dist/locales/localesApi.js +7 -3
  48. package/dist/locales/localesInterfaces.d.ts +14 -13
  49. package/dist/menus/menusApi.d.ts +9 -5
  50. package/dist/menus/menusApi.js +9 -5
  51. package/dist/menus/menusInterfaces.d.ts +43 -48
  52. package/dist/menus/menusInterfaces.js +1 -0
  53. package/dist/orders/ordersApi.d.ts +62 -70
  54. package/dist/orders/ordersApi.js +62 -71
  55. package/dist/orders/ordersInterfaces.d.ts +238 -203
  56. package/dist/pages/pagesApi.d.ts +67 -80
  57. package/dist/pages/pagesApi.js +71 -81
  58. package/dist/pages/pagesInterfaces.d.ts +164 -160
  59. package/dist/payments/paymentsApi.d.ts +24 -34
  60. package/dist/payments/paymentsApi.js +24 -38
  61. package/dist/payments/paymentsInterfaces.d.ts +82 -76
  62. package/dist/product-statuses/productStatusesApi.d.ts +13 -13
  63. package/dist/product-statuses/productStatusesApi.js +13 -13
  64. package/dist/product-statuses/productStatusesInterfaces.d.ts +29 -27
  65. package/dist/products/productsApi.d.ts +246 -267
  66. package/dist/products/productsApi.js +247 -267
  67. package/dist/products/productsInterfaces.d.ts +333 -339
  68. package/dist/system/systemApi.d.ts +19 -21
  69. package/dist/system/systemApi.js +20 -21
  70. package/dist/system/systemInterfaces.d.ts +14 -3
  71. package/dist/templates/templatesApi.d.ts +13 -16
  72. package/dist/templates/templatesApi.js +13 -16
  73. package/dist/templates/templatesInterfaces.d.ts +30 -29
  74. package/dist/templates-preview/templatesPreviewApi.d.ts +10 -11
  75. package/dist/templates-preview/templatesPreviewApi.js +10 -11
  76. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +61 -64
  77. package/dist/users/usersApi.d.ts +36 -43
  78. package/dist/users/usersApi.js +36 -43
  79. package/dist/users/usersInterfaces.d.ts +92 -96
  80. package/dist/web-socket/wsApi.d.ts +5 -3
  81. package/dist/web-socket/wsApi.js +6 -3
  82. package/dist/web-socket/wsInterfaces.d.ts +7 -2
  83. package/package.json +16 -12
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // Abstract class representing synchronization modules
4
+ /**
5
+ *
6
+ */
4
7
  class SyncModules {
5
8
  // Constructor to initialize state and URL
6
9
  constructor(state) {
7
10
  /**
8
11
  * Sorts attributes by their positions.
9
- *
10
- * @param data - The data containing attributes.
11
- * @return Sorted attributes.
12
+ * @param {any} data - The data containing attributes.
13
+ * @returns {any} Sorted attributes.
12
14
  */
13
15
  this._sortAttributes = (data) => Object.fromEntries(Object.entries(data).sort(([, a], [, b]) => a.position - b.position));
14
16
  this.state = state;
@@ -16,18 +18,16 @@ class SyncModules {
16
18
  }
17
19
  /**
18
20
  * Constructs the full URL path by appending the given path to the base URL.
19
- *
20
- * @param path - The path to append to the base URL.
21
- * @return The full URL as a string.
21
+ * @param {string} path - The path to append to the base URL.
22
+ * @returns {string} The full URL as a string.
22
23
  */
23
24
  _getFullPath(path) {
24
25
  return this._url + path;
25
26
  }
26
27
  /**
27
28
  * Converts query parameters into a query string.
28
- *
29
- * @param query - The query object containing key-value pairs.
30
- * @return A string representation of the query parameters.
29
+ * @param {IProductsQuery | IUploadingQuery | any} query - The query object containing key-value pairs.
30
+ * @returns {string} A string representation of the query parameters.
31
31
  */
32
32
  _queryParamsToString(query) {
33
33
  let result = '';
@@ -40,10 +40,9 @@ class SyncModules {
40
40
  }
41
41
  /**
42
42
  * Normalizes data based on language code.
43
- *
44
- * @param data - The data to normalize.
45
- * @param langCode - The language code for normalization.
46
- * @return Normalized data.
43
+ * @param {any} data - The data to normalize.
44
+ * @param {string} langCode - The language code for normalization.
45
+ * @returns {any} Normalized data.
47
46
  */
48
47
  _normalizeData(data, langCode = this.state.lang) {
49
48
  if (Array.isArray(data)) {
@@ -73,10 +72,9 @@ class SyncModules {
73
72
  }
74
73
  /**
75
74
  * Normalizes the body of a POST request.
76
- *
77
- * @param body - The body to normalize.
78
- * @param langCode - The language code for normalization.
79
- * @return Normalized body.
75
+ * @param {any} body - The body to normalize.
76
+ * @param {string} langCode - The language code for normalization.
77
+ * @returns {any} Normalized body.
80
78
  */
81
79
  _normalizePostBody(body, langCode = this.state.lang) {
82
80
  const formData = {};
@@ -88,9 +86,8 @@ class SyncModules {
88
86
  }
89
87
  /**
90
88
  * Clears arrays within the data structure.
91
- *
92
- * @param data - The data to clear.
93
- * @return Cleared data.
89
+ * @param {Record<string, any>} data - The data to clear.
90
+ * @returns {any} Cleared data.
94
91
  */
95
92
  _clearArray(data) {
96
93
  if (Array.isArray(data)) {
@@ -127,10 +124,9 @@ class SyncModules {
127
124
  }
128
125
  /**
129
126
  * Adds a specified number of days to a date.
130
- *
131
- * @param date - The initial date.
132
- * @param days - The number of days to add.
133
- * @return The new date with added days.
127
+ * @param {Date} date - The initial date.
128
+ * @param {number} days - The number of days to add.
129
+ * @returns {any} The new date with added days.
134
130
  */
135
131
  _addDays(date, days) {
136
132
  const result = new Date(date);
@@ -139,10 +135,12 @@ class SyncModules {
139
135
  }
140
136
  /**
141
137
  * Generates intervals for a specific date based on a schedule.
142
- *
143
- * @param date - The date for which to generate intervals.
144
- * @param schedule - The schedule defining the intervals.
145
- * @param utcIntervals - A set to store unique intervals.
138
+ * @param {Date} date - The date for which to generate intervals.
139
+ * @param {object} schedule - The schedule defining the intervals.
140
+ * @param {boolean} schedule.inEveryWeek - The number of weeks between intervals.
141
+ * @param {any[]} schedule.times - The times for each interval.
142
+ * @param {boolean} schedule.inEveryMonth - The month intervals for each interval.
143
+ * @param {Set<Array<string>>} utcIntervals - A set to store unique intervals.
146
144
  */
147
145
  _generateIntervalsForDate(date, schedule, utcIntervals) {
148
146
  // Handle weekly schedules
@@ -227,9 +225,8 @@ class SyncModules {
227
225
  }
228
226
  /**
229
227
  * Adds time intervals to schedules.
230
- *
231
- * @param schedules - The schedules to process.
232
- * @return Schedules with added time intervals.
228
+ * @param {any[]} schedules - The schedules to process.
229
+ * @returns {any} Schedules with added time intervals.
233
230
  */
234
231
  _addTimeIntervalsToSchedules(schedules) {
235
232
  schedules.forEach((scheduleGroup) => {
@@ -253,9 +250,8 @@ class SyncModules {
253
250
  }
254
251
  /**
255
252
  * Normalizes attributes within the data.
256
- *
257
- * @param data - The data to normalize.
258
- * @return Normalized attributes.
253
+ * @param {any} data - The data to normalize.
254
+ * @returns {any} Normalized attributes.
259
255
  */
260
256
  _normalizeAttr(data) {
261
257
  // For regular attributes
@@ -305,10 +301,9 @@ class SyncModules {
305
301
  }
306
302
  /**
307
303
  * Processes data after fetching or receiving it.
308
- *
309
- * @param data - The data to process.
310
- * @param langCode - The language code for processing.
311
- * @return Processed data.
304
+ * @param {any} data - The data to process.
305
+ * @param {any} langCode - The language code for processing.
306
+ * @returns {any} Processed data.
312
307
  */
313
308
  _dataPostProcess(data, langCode = this.state.lang) {
314
309
  const normalize = this._normalizeData(data, langCode);
@@ -317,9 +312,8 @@ class SyncModules {
317
312
  }
318
313
  /**
319
314
  * Sets the access token in the state.
320
- *
321
- * @param accessToken - The access token to set.
322
- * @return The instance of SyncModules for chaining.
315
+ * @param {string} accessToken - The access token to set.
316
+ * @returns {any} The instance of SyncModules for chaining.
323
317
  */
324
318
  setAccessToken(accessToken) {
325
319
  this.state.accessToken = accessToken;
@@ -327,9 +321,8 @@ class SyncModules {
327
321
  }
328
322
  /**
329
323
  * Sets the refresh token in the state.
330
- *
331
- * @param refreshToken - The refresh token to set.
332
- * @return The instance of SyncModules for chaining.
324
+ * @param {any} refreshToken - The refresh token to set.
325
+ * @returns {any} The instance of SyncModules for chaining.
333
326
  */
334
327
  setRefreshToken(refreshToken) {
335
328
  this.state.refreshToken = refreshToken;
@@ -337,13 +330,21 @@ class SyncModules {
337
330
  }
338
331
  /**
339
332
  * Get deviceMetadata
333
+ * @returns {string} - Returns an object containing device metadata.
340
334
  */
341
335
  _getDeviceMetadata() {
342
- const platform = navigator.platform;
343
- const userAgent = navigator.userAgent;
344
- const language = navigator.language;
336
+ // Check if we're in a browser environment
337
+ if (typeof globalThis === 'undefined') {
338
+ return '';
339
+ }
340
+ // Access navigator through globalThis.window object to avoid direct reference
341
+ const win = globalThis.window;
342
+ const nav = (win === null || win === void 0 ? void 0 : win.navigator) || {};
343
+ const platform = nav.platform || 'Win32';
344
+ const userAgent = nav.userAgent || 'Node.js/22';
345
+ const language = nav.language || 'en-US';
345
346
  const deviceMetadata = {
346
- fingerprint: 'abc123-fp',
347
+ fingerprint: `UQ_${platform}_${userAgent}_${language}`,
347
348
  deviceInfo: {
348
349
  os: platform,
349
350
  browser: userAgent,
@@ -1,13 +1,12 @@
1
1
  type Types = 'product' | 'error_page' | 'catalog_page' | 'product_preview' | 'similar_products_block' | 'product_block' | 'form' | 'common_page' | 'common_block' | 'order' | 'service' | 'none';
2
2
  /**
3
- * @param {string} [token] - If your project is protected by a token, specify this token in this parameter.
4
- * @param {string} [langCode] - specify the default language to avoid specifying it in every request.
5
- * @param {boolean} [traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set this parameter to "false" to save traffic and decide for yourself what data you need.
6
- * @param {boolean} [auth] - An object with authorization settings
7
- * @param {boolean} [auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal
3
+ * @param {string} [token] - If your project is protected by a token, specify this token in this parameter.
4
+ * @param {string} [langCode] - specify the default language to avoid specifying it in every request.
5
+ * @param {boolean} [traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set this parameter to "false" to save traffic and decide for yourself what data you need.
6
+ * @param {boolean} [auth] - An object with authorization settings
7
+ * @param {boolean} [auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal
8
8
  * @param {boolean} [auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created
9
9
  * @param {boolean} [auth.saveFunction] - If you want to store the token between sessions, for example in local storage, create a custom function that takes refreshToken as a parameter and executes the necessary instructions. This function will be called every time the tokens are updated
10
- *
11
10
  * @example
12
11
  * const saveToken = (token) => {
13
12
  * localStorage.setItem('refresh', token)
@@ -30,7 +29,6 @@ type Types = 'product' | 'error_page' | 'catalog_page' | 'product_preview' | 'si
30
29
  * }
31
30
  * }
32
31
  * }
33
- *
34
32
  */
35
33
  interface IConfig {
36
34
  token?: string;
@@ -52,6 +50,19 @@ interface IConfig {
52
50
  };
53
51
  };
54
52
  }
53
+ /**
54
+ * @interface IAttributes
55
+ * @property {Array<object>} listTitles - List of titles.
56
+ * @property {ILocalizeInfo} localizeInfos - Localization information.
57
+ * @property {string} marker - Attribute marker.
58
+ * @property {number} position - Attribute position.
59
+ * @property {boolean} isVisible - Indicates whether the attribute is visible.
60
+ * @property {string} type - Attribute type.
61
+ * @property {Record<string, any>} settings - Additional settings for the attribute.
62
+ * @property {Record<string, any>} validators - Validators for the attribute.
63
+ * @property {Record<string, any>} additionalFields - Additional fields for the attribute.
64
+ * @description Interface for attributes.
65
+ */
55
66
  interface IAttributes {
56
67
  listTitles: Array<{
57
68
  title: string;
@@ -72,15 +83,35 @@ interface IAttributes {
72
83
  additionalFields?: any;
73
84
  [key: string]: any;
74
85
  }
86
+ /**
87
+ * @interface ILocalizeInfos
88
+ * @property {Record<string, ILocalizeInfo>} Localization information.
89
+ * @description Interface for localization information.
90
+ */
75
91
  interface ILocalizeInfos {
76
92
  [key: string]: ILocalizeInfo;
77
93
  }
94
+ /**
95
+ * Interface for localization information.
96
+ * @property {Record<string, any>} Localization information.
97
+ * @description Interface for localization information.
98
+ */
78
99
  interface ILocalizeInfo {
79
100
  [key: string]: any;
80
101
  }
102
+ /**
103
+ * @interface IAttributeValues
104
+ * @property {Record<string, IAttributeValue>} Attribute values.
105
+ * @description Interface for attribute values.
106
+ */
81
107
  interface IAttributeValues {
82
108
  [key: string]: IAttributeValue;
83
109
  }
110
+ /**
111
+ * @interface IAttributeValue
112
+ * @property {Record<string, any>} Attribute value.
113
+ * @description Interface for attribute value.
114
+ */
84
115
  interface IAttributeValue {
85
116
  [key: string]: any;
86
117
  }
@@ -4,82 +4,73 @@ import type { IError } from '../base/utils';
4
4
  import type { BlockType, IBlockEntity, IBlocks, IBlocksResponse, ISearchBlock } from './blocksInterfaces';
5
5
  /**
6
6
  * Controllers for working with blocks.
7
- *
8
7
  * @handle /api/content/blocks
9
8
  * @class BlocksApi
10
- * @extends AsyncModules
9
+ * @augments AsyncModules
11
10
  * @implements {IBlocks}
12
- *
13
11
  * @description This class provides methods to interact with blocks.
14
12
  */
15
13
  export default class BlocksApi extends AsyncModules implements IBlocks {
16
14
  protected state: StateModule;
17
15
  protected _url: string;
16
+ /**
17
+ *
18
+ */
18
19
  constructor(state: StateModule);
19
20
  /**
20
21
  * Get blocks by parameters.
21
- *
22
22
  * @handleName getBlocks
23
- *
24
- * @param {BlockType} type - Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". Example: 'product'.
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
- * @return {IBlocksResponse} Returns BlocksEntity object.
23
+ * @param {BlockType} type - Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". Example: 'product'.
24
+ * @param {string} [langCode] - Language code. Default: "en_US".
25
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
26
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
27
+ * @returns {IBlocksResponse} Returns BlocksEntity object.
29
28
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
30
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.
31
30
  */
32
31
  getBlocks(type?: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse | IError>;
33
32
  /**
34
33
  * Get block by marker.
35
- *
36
34
  * @handleName getBlockByMarker
37
- *
38
- * @param {string} marker - Marker of Block. Example: "product_block".
39
- * @param {string} [langCode] - Language code. Default: "en_US".
40
- * @param {number} [offset] - Parameter for pagination. Default: 0.
41
- * @param {number} [limit] - Parameter for pagination. Default: 30.
42
- * @return {IBlockEntity} - Returns a BlockEntity object.
35
+ * @param {string} marker - Marker of Block. Example: "product_block".
36
+ * @param {string} [langCode] - Language code. Default: "en_US".
37
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
38
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
39
+ * @returns {IBlockEntity} - Returns a BlockEntity object.
43
40
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
44
41
  * @description This method retrieves a block by its marker and includes additional information such as similar products or products associated with the block.
45
42
  */
46
43
  getBlockByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
47
44
  /**
48
45
  * Get similar products by block marker.
49
- *
50
46
  * @handleName getSimilarProducts
51
- *
52
- * @param {string} marker - Block identifier. Example: "similar_products_block".
53
- * @param {string} [langCode] - Language code. Default: "en_US".
54
- * @param {number} [offset] - Parameter for pagination. Default: 0.
55
- * @param {number} [limit] - Parameter for pagination. Default: 30.
56
- * @return {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
47
+ * @param {string} marker - Block identifier. Example: "similar_products_block".
48
+ * @param {string} [langCode] - Language code. Default: "en_US".
49
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
50
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
51
+ * @returns {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
57
52
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
53
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
59
54
  */
60
55
  private getSimilarProducts;
61
56
  /**
62
57
  * Get products by block marker.
63
- *
64
58
  * @handleName getProductsByBlockMarker
65
- *
66
- * @param {string} marker - Block identifier. Example: "product_block".
67
- * @param {string} [langCode] - Language code. Default: "en_US".
68
- * @param {number} [offset] - Parameter for pagination. Default: 0.
69
- * @param {number} [limit] - Parameter for pagination. Default: 30.
70
- * @return {IProductsEntity[]} Return array of BlocksEntity object.
59
+ * @param {string} marker - Block identifier. Example: "product_block".
60
+ * @param {string} [langCode] - Language code. Default: "en_US".
61
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
62
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
63
+ * @returns {IProductsEntity[]} Return array of BlocksEntity object.
71
64
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
72
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.
73
66
  */
74
67
  private getProductsByBlockMarker;
75
68
  /**
76
69
  * Quick search for block objects with limited output.
77
- *
78
70
  * @handleName searchBlock
79
- *
80
- * @param {string} name - Search string. Example: "product_block".
81
- * @param {string} [langCode] - Language code. Default: "en_US".
82
- * @return {ISearchBlock[]} Returns an array of ISearchBlock objects.
71
+ * @param {string} name - Search string. Example: "product_block".
72
+ * @param {string} [langCode] - Language code. Default: "en_US".
73
+ * @returns {ISearchBlock[]} Returns an array of ISearchBlock objects.
83
74
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
84
75
  * @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.
85
76
  */
@@ -6,29 +6,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
7
7
  /**
8
8
  * Controllers for working with blocks.
9
- *
10
9
  * @handle /api/content/blocks
11
10
  * @class BlocksApi
12
- * @extends AsyncModules
11
+ * @augments AsyncModules
13
12
  * @implements {IBlocks}
14
- *
15
13
  * @description This class provides methods to interact with blocks.
16
14
  */
17
15
  class BlocksApi extends asyncModules_1.default {
16
+ /**
17
+ *
18
+ */
18
19
  constructor(state) {
19
20
  super(state);
20
21
  this._url = state.url + '/api/content/blocks';
21
22
  }
22
23
  /**
23
24
  * Get blocks by parameters.
24
- *
25
25
  * @handleName getBlocks
26
- *
27
- * @param {BlockType} type - Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". Example: 'product'.
28
- * @param {string} [langCode] - Language code. Default: "en_US".
29
- * @param {number} [offset] - Parameter for pagination. Default: 0.
30
- * @param {number} [limit] - Parameter for pagination. Default: 30.
31
- * @return {IBlocksResponse} Returns BlocksEntity object.
26
+ * @param {BlockType} type - Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". Example: 'product'.
27
+ * @param {string} [langCode] - Language code. Default: "en_US".
28
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
29
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
30
+ * @returns {IBlocksResponse} Returns BlocksEntity object.
32
31
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
33
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.
34
33
  */
@@ -79,14 +78,12 @@ class BlocksApi extends asyncModules_1.default {
79
78
  }
80
79
  /**
81
80
  * Get block by marker.
82
- *
83
81
  * @handleName getBlockByMarker
84
- *
85
- * @param {string} marker - Marker of Block. Example: "product_block".
86
- * @param {string} [langCode] - Language code. Default: "en_US".
87
- * @param {number} [offset] - Parameter for pagination. Default: 0.
88
- * @param {number} [limit] - Parameter for pagination. Default: 30.
89
- * @return {IBlockEntity} - Returns a BlockEntity object.
82
+ * @param {string} marker - Marker of Block. Example: "product_block".
83
+ * @param {string} [langCode] - Language code. Default: "en_US".
84
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
85
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
86
+ * @returns {IBlockEntity} - Returns a BlockEntity object.
90
87
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
91
88
  * @description This method retrieves a block by its marker and includes additional information such as similar products or products associated with the block.
92
89
  */
@@ -131,14 +128,12 @@ class BlocksApi extends asyncModules_1.default {
131
128
  }
132
129
  /**
133
130
  * Get similar products by block marker.
134
- *
135
131
  * @handleName getSimilarProducts
136
- *
137
- * @param {string} marker - Block identifier. Example: "similar_products_block".
138
- * @param {string} [langCode] - Language code. Default: "en_US".
139
- * @param {number} [offset] - Parameter for pagination. Default: 0.
140
- * @param {number} [limit] - Parameter for pagination. Default: 30.
141
- * @return {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
132
+ * @param {string} marker - Block identifier. Example: "similar_products_block".
133
+ * @param {string} [langCode] - Language code. Default: "en_US".
134
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
135
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
136
+ * @returns {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
142
137
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
143
138
  * @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.
144
139
  */
@@ -153,14 +148,12 @@ class BlocksApi extends asyncModules_1.default {
153
148
  }
154
149
  /**
155
150
  * Get products by block marker.
156
- *
157
151
  * @handleName getProductsByBlockMarker
158
- *
159
- * @param {string} marker - Block identifier. Example: "product_block".
160
- * @param {string} [langCode] - Language code. Default: "en_US".
161
- * @param {number} [offset] - Parameter for pagination. Default: 0.
162
- * @param {number} [limit] - Parameter for pagination. Default: 30.
163
- * @return {IProductsEntity[]} Return array of BlocksEntity object.
152
+ * @param {string} marker - Block identifier. Example: "product_block".
153
+ * @param {string} [langCode] - Language code. Default: "en_US".
154
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
155
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
156
+ * @returns {IProductsEntity[]} Return array of BlocksEntity object.
164
157
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
165
158
  * @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.
166
159
  */
@@ -175,12 +168,10 @@ class BlocksApi extends asyncModules_1.default {
175
168
  }
176
169
  /**
177
170
  * Quick search for block objects with limited output.
178
- *
179
171
  * @handleName searchBlock
180
- *
181
- * @param {string} name - Search string. Example: "product_block".
182
- * @param {string} [langCode] - Language code. Default: "en_US".
183
- * @return {ISearchBlock[]} Returns an array of ISearchBlock objects.
172
+ * @param {string} name - Search string. Example: "product_block".
173
+ * @param {string} [langCode] - Language code. Default: "en_US".
174
+ * @returns {ISearchBlock[]} Returns an array of ISearchBlock objects.
184
175
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
185
176
  * @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.
186
177
  */