oneentry 1.0.122 → 1.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/admins/adminsApi.d.ts +16 -8
  2. package/dist/admins/adminsApi.js +18 -10
  3. package/dist/admins/adminsInterfaces.d.ts +49 -25
  4. package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
  5. package/dist/attribute-sets/attributeSetsApi.js +49 -25
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
  7. package/dist/auth-provider/authProviderApi.d.ts +94 -83
  8. package/dist/auth-provider/authProviderApi.js +96 -83
  9. package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
  10. package/dist/base/asyncModules.d.ts +32 -28
  11. package/dist/base/asyncModules.js +62 -38
  12. package/dist/base/syncModules.d.ts +44 -44
  13. package/dist/base/syncModules.js +65 -63
  14. package/dist/blocks/blocksApi.d.ts +56 -25
  15. package/dist/blocks/blocksApi.js +56 -25
  16. package/dist/blocks/blocksInterfaces.d.ts +71 -22
  17. package/dist/events/eventsApi.d.ts +45 -11
  18. package/dist/events/eventsApi.js +47 -17
  19. package/dist/events/eventsInterfaces.d.ts +44 -2
  20. package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
  21. package/dist/file-uploading/fileUploadingApi.js +46 -27
  22. package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
  23. package/dist/forms/formsApi.d.ts +23 -8
  24. package/dist/forms/formsApi.js +23 -8
  25. package/dist/forms/formsInterfaces.d.ts +62 -15
  26. package/dist/formsData/formsDataApi.d.ts +33 -33
  27. package/dist/formsData/formsDataApi.js +33 -33
  28. package/dist/formsData/formsDataInterfaces.d.ts +123 -35
  29. package/dist/general-types/generalTypesApi.d.ts +12 -1
  30. package/dist/general-types/generalTypesApi.js +12 -1
  31. package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
  35. package/dist/integration-collections/integrationCollectionsApi.js +114 -81
  36. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
  37. package/dist/locales/localesApi.d.ts +6 -1
  38. package/dist/locales/localesApi.js +6 -1
  39. package/dist/locales/localesInterfaces.d.ts +20 -11
  40. package/dist/menus/menusApi.d.ts +8 -3
  41. package/dist/menus/menusApi.js +8 -3
  42. package/dist/menus/menusInterfaces.d.ts +30 -17
  43. package/dist/orders/ordersApi.d.ts +64 -64
  44. package/dist/orders/ordersApi.js +67 -65
  45. package/dist/orders/ordersInterfaces.d.ts +174 -60
  46. package/dist/pages/pagesApi.d.ts +89 -30
  47. package/dist/pages/pagesApi.js +181 -57
  48. package/dist/pages/pagesInterfaces.d.ts +117 -23
  49. package/dist/payments/paymentsApi.d.ts +56 -22
  50. package/dist/payments/paymentsApi.js +56 -22
  51. package/dist/payments/paymentsInterfaces.d.ts +119 -36
  52. package/dist/product-statuses/productStatusesApi.d.ts +21 -15
  53. package/dist/product-statuses/productStatusesApi.js +21 -18
  54. package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
  55. package/dist/products/productsApi.d.ts +137 -157
  56. package/dist/products/productsApi.js +137 -157
  57. package/dist/products/productsInterfaces.d.ts +240 -57
  58. package/dist/system/systemApi.d.ts +29 -10
  59. package/dist/system/systemApi.js +29 -10
  60. package/dist/system/systemInterfaces.d.ts +8 -0
  61. package/dist/templates/templatesApi.d.ts +26 -16
  62. package/dist/templates/templatesApi.js +26 -19
  63. package/dist/templates/templatesInterfaces.d.ts +40 -14
  64. package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
  65. package/dist/templates-preview/templatesPreviewApi.js +18 -17
  66. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +57 -29
  67. package/dist/users/usersApi.d.ts +37 -33
  68. package/dist/users/usersApi.js +37 -33
  69. package/dist/users/usersInterfaces.d.ts +80 -9
  70. package/dist/web-socket/wsApi.d.ts +6 -3
  71. package/dist/web-socket/wsApi.js +6 -3
  72. package/dist/web-socket/wsInterfaces.d.ts +3 -1
  73. package/package.json +11 -11
@@ -6,65 +6,65 @@ export default abstract class SyncModules {
6
6
  protected _url: string;
7
7
  protected constructor(state: StateModule);
8
8
  /**
9
- * getFullPath
9
+ * Constructs the full URL path by appending the given path to the base URL.
10
10
  *
11
- * @param path
12
- * @returns
11
+ * @param path - The path to append to the base URL.
12
+ * @return The full URL as a string.
13
13
  */
14
14
  protected _getFullPath(path: string): string;
15
15
  /**
16
- * queryParamsToString
16
+ * Converts query parameters into a query string.
17
17
  *
18
- * @param query
19
- * @returns
18
+ * @param query - The query object containing key-value pairs.
19
+ * @return A string representation of the query parameters.
20
20
  */
21
21
  protected _queryParamsToString(query: IProductsQuery | IUploadingQuery | any): string;
22
22
  /**
23
- * normalizeData
23
+ * Normalizes data based on language code.
24
24
  *
25
- * @param data
26
- * @param langCode
27
- * @returns normalized data
25
+ * @param data - The data to normalize.
26
+ * @param langCode - The language code for normalization.
27
+ * @return Normalized data.
28
28
  */
29
29
  protected _normalizeData(data: any, langCode?: string): any;
30
30
  /**
31
- * normalizePostBody
31
+ * Normalizes the body of a POST request.
32
32
  *
33
- * @param body
34
- * @param langCode
35
- * @returns
33
+ * @param body - The body to normalize.
34
+ * @param langCode - The language code for normalization.
35
+ * @return Normalized body.
36
36
  */
37
37
  protected _normalizePostBody(body: any, langCode?: string): any;
38
38
  /**
39
- * clearArray
39
+ * Clears arrays within the data structure.
40
40
  *
41
- * @param data
42
- * @returns
41
+ * @param data - The data to clear.
42
+ * @return Cleared data.
43
43
  */
44
44
  protected _clearArray(data: Record<string, any>): any;
45
45
  /**
46
- * Sort attributes by its positions
46
+ * Sorts attributes by their positions.
47
47
  *
48
- * @param data
49
- * @returns
48
+ * @param data - The data containing attributes.
49
+ * @return Sorted attributes.
50
50
  */
51
51
  protected _sortAttributes: (data: any) => {
52
52
  [k: string]: unknown;
53
53
  };
54
54
  /**
55
- * Function to add days to a date
55
+ * Adds a specified number of days to a date.
56
56
  *
57
- * @param date
58
- * @param days
59
- * @returns
57
+ * @param date - The initial date.
58
+ * @param days - The number of days to add.
59
+ * @return The new date with added days.
60
60
  */
61
61
  protected _addDays(date: Date, days: number): Date;
62
62
  /**
63
- * Function to generate intervals for a specific date
63
+ * Generates intervals for a specific date based on a schedule.
64
64
  *
65
- * @param date
66
- * @param schedule
67
- * @param utcIntervals
65
+ * @param date - The date for which to generate intervals.
66
+ * @param schedule - The schedule defining the intervals.
67
+ * @param utcIntervals - A set to store unique intervals.
68
68
  */
69
69
  protected _generateIntervalsForDate(date: Date, schedule: {
70
70
  inEveryWeek: boolean;
@@ -72,39 +72,39 @@ export default abstract class SyncModules {
72
72
  inEveryMonth: boolean;
73
73
  }, utcIntervals: Set<Array<string>>): void;
74
74
  /**
75
- * Add TimeIntervals to schedules
75
+ * Adds time intervals to schedules.
76
76
  *
77
- * @param schedules
78
- * @returns schedules with timeIntervals
77
+ * @param schedules - The schedules to process.
78
+ * @return Schedules with added time intervals.
79
79
  */
80
80
  _addTimeIntervalsToSchedules(schedules: any[]): any[];
81
81
  /**
82
- * normalizeAttr
82
+ * Normalizes attributes within the data.
83
83
  *
84
- * @param data
85
- * @returns normalized Attrs
84
+ * @param data - The data to normalize.
85
+ * @return Normalized attributes.
86
86
  */
87
87
  protected _normalizeAttr(data: any): any;
88
88
  /**
89
- * dataPostProcess
89
+ * Processes data after fetching or receiving it.
90
90
  *
91
- * @param data
92
- * @param langCode
93
- * @returns
91
+ * @param data - The data to process.
92
+ * @param langCode - The language code for processing.
93
+ * @return Processed data.
94
94
  */
95
95
  protected _dataPostProcess(data: any, langCode?: string): any;
96
96
  /**
97
- * setAccessToken
97
+ * Sets the access token in the state.
98
98
  *
99
- * @param accessToken
100
- * @returns
99
+ * @param accessToken - The access token to set.
100
+ * @return The instance of SyncModules for chaining.
101
101
  */
102
102
  setAccessToken(accessToken: string): this;
103
103
  /**
104
- * setRefreshToken
104
+ * Sets the refresh token in the state.
105
105
  *
106
- * @param refreshToken
107
- * @returns
106
+ * @param refreshToken - The refresh token to set.
107
+ * @return The instance of SyncModules for chaining.
108
108
  */
109
109
  setRefreshToken(refreshToken: string): this;
110
110
  }
@@ -1,31 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // Abstract class representing synchronization modules
3
4
  class SyncModules {
5
+ // Constructor to initialize state and URL
4
6
  constructor(state) {
5
7
  /**
6
- * Sort attributes by its positions
8
+ * Sorts attributes by their positions.
7
9
  *
8
- * @param data
9
- * @returns
10
+ * @param data - The data containing attributes.
11
+ * @return Sorted attributes.
10
12
  */
11
13
  this._sortAttributes = (data) => Object.fromEntries(Object.entries(data).sort(([, a], [, b]) => a.position - b.position));
12
14
  this.state = state;
13
15
  this._url = state.url;
14
16
  }
15
17
  /**
16
- * getFullPath
18
+ * Constructs the full URL path by appending the given path to the base URL.
17
19
  *
18
- * @param path
19
- * @returns
20
+ * @param path - The path to append to the base URL.
21
+ * @return The full URL as a string.
20
22
  */
21
23
  _getFullPath(path) {
22
24
  return this._url + path;
23
25
  }
24
26
  /**
25
- * queryParamsToString
27
+ * Converts query parameters into a query string.
26
28
  *
27
- * @param query
28
- * @returns
29
+ * @param query - The query object containing key-value pairs.
30
+ * @return A string representation of the query parameters.
29
31
  */
30
32
  _queryParamsToString(query) {
31
33
  let result = '';
@@ -37,11 +39,11 @@ class SyncModules {
37
39
  return result.slice(0, result.length - 1);
38
40
  }
39
41
  /**
40
- * normalizeData
42
+ * Normalizes data based on language code.
41
43
  *
42
- * @param data
43
- * @param langCode
44
- * @returns normalized data
44
+ * @param data - The data to normalize.
45
+ * @param langCode - The language code for normalization.
46
+ * @return Normalized data.
45
47
  */
46
48
  _normalizeData(data, langCode = this.state.lang) {
47
49
  if (Array.isArray(data)) {
@@ -70,11 +72,11 @@ class SyncModules {
70
72
  }
71
73
  }
72
74
  /**
73
- * normalizePostBody
75
+ * Normalizes the body of a POST request.
74
76
  *
75
- * @param body
76
- * @param langCode
77
- * @returns
77
+ * @param body - The body to normalize.
78
+ * @param langCode - The language code for normalization.
79
+ * @return Normalized body.
78
80
  */
79
81
  _normalizePostBody(body, langCode = this.state.lang) {
80
82
  const formData = {};
@@ -85,10 +87,10 @@ class SyncModules {
85
87
  return body;
86
88
  }
87
89
  /**
88
- * clearArray
90
+ * Clears arrays within the data structure.
89
91
  *
90
- * @param data
91
- * @returns
92
+ * @param data - The data to clear.
93
+ * @return Cleared data.
92
94
  */
93
95
  _clearArray(data) {
94
96
  if (Array.isArray(data)) {
@@ -124,11 +126,11 @@ class SyncModules {
124
126
  }
125
127
  }
126
128
  /**
127
- * Function to add days to a date
129
+ * Adds a specified number of days to a date.
128
130
  *
129
- * @param date
130
- * @param days
131
- * @returns
131
+ * @param date - The initial date.
132
+ * @param days - The number of days to add.
133
+ * @return The new date with added days.
132
134
  */
133
135
  _addDays(date, days) {
134
136
  const result = new Date(date);
@@ -136,17 +138,17 @@ class SyncModules {
136
138
  return result;
137
139
  }
138
140
  /**
139
- * Function to generate intervals for a specific date
141
+ * Generates intervals for a specific date based on a schedule.
140
142
  *
141
- * @param date
142
- * @param schedule
143
- * @param utcIntervals
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.
144
146
  */
145
147
  _generateIntervalsForDate(date, schedule, utcIntervals) {
146
- // inEveryWeek
148
+ // Handle weekly schedules
147
149
  if (schedule.inEveryWeek && !schedule.inEveryMonth) {
148
150
  let currentDate = new Date(date);
149
- // Вычисляем последний день текущего месяца
151
+ // Calculate the last day of the current month
150
152
  const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
151
153
  while (currentDate <= endOfMonth) {
152
154
  schedule.times.forEach((timeRange) => {
@@ -155,16 +157,16 @@ class SyncModules {
155
157
  intervalStart.setUTCHours(startTime.hours, startTime.minutes, 0, 0);
156
158
  const intervalEnd = new Date(currentDate);
157
159
  intervalEnd.setUTCHours(endTime.hours, endTime.minutes, 0, 0);
158
- // Добавляем строку JSON в Set для уникальности
160
+ // Add JSON string to Set for uniqueness
159
161
  utcIntervals.add([
160
162
  intervalStart.toISOString(),
161
163
  intervalEnd.toISOString(),
162
164
  ]);
163
165
  });
164
- currentDate = this._addDays(currentDate, 7); // Переходим к следующей неделе
166
+ currentDate = this._addDays(currentDate, 7); // Move to the next week
165
167
  }
166
168
  }
167
- // inEveryMonth
169
+ // Handle monthly schedules
168
170
  if (schedule.inEveryMonth && !schedule.inEveryWeek) {
169
171
  const startDate = new Date(date); // Начальная дата
170
172
  const targetDayOfMonth = startDate.getUTCDate(); // Определяем день месяца начальной даты
@@ -172,11 +174,11 @@ class SyncModules {
172
174
  for (let i = 0; i < numberOfMonths; i++) {
173
175
  const currentDate = new Date(startDate);
174
176
  currentDate.setUTCMonth(currentDate.getUTCMonth() + i);
175
- // Попробуем установить текущую дату на целевой день месяца
177
+ // Try setting the current date to the target day of the month
176
178
  currentDate.setUTCDate(targetDayOfMonth);
177
- // Проверяем, не вышли ли мы за пределы месяца
179
+ // Check if we have exceeded the month
178
180
  if (currentDate.getUTCMonth() !== (startDate.getUTCMonth() + i) % 12) {
179
- continue; // Если вышли, пропускаем этот месяц
181
+ continue; // Skip this month if exceeded
180
182
  }
181
183
  schedule.times.forEach((timeRange) => {
182
184
  const [startTime, endTime] = timeRange;
@@ -191,19 +193,19 @@ class SyncModules {
191
193
  });
192
194
  }
193
195
  }
194
- // inEveryMonth && inEveryWeek
196
+ // Handle both weekly and monthly schedules
195
197
  if (schedule.inEveryMonth && schedule.inEveryWeek) {
196
- const startDate = new Date(date); // Начальная дата
197
- const targetDayOfWeek = startDate.getUTCDay(); // Определяем день недели начальной даты
198
- const numberOfMonths = 12; // Количество месяцев, на которые нужно повторить
198
+ const startDate = new Date(date); // Initial date
199
+ const targetDayOfWeek = startDate.getUTCDay(); // Determine the day of the week
200
+ const numberOfMonths = 12; // Number of months to repeat
199
201
  for (let i = 0; i < numberOfMonths; i++) {
200
202
  const currentDate = new Date(startDate);
201
203
  currentDate.setUTCMonth(currentDate.getUTCMonth() + i);
202
- currentDate.setUTCDate(1); // Устанавливаем на первый день месяца
203
- // Находим первый целевой день недели в текущем месяце
204
+ currentDate.setUTCDate(1); // Set to the first day of the month
205
+ // Find the first target day of the week in the current month
204
206
  const daysUntilTargetDay = (targetDayOfWeek - currentDate.getUTCDay() + 7) % 7;
205
207
  currentDate.setUTCDate(currentDate.getUTCDate() + daysUntilTargetDay);
206
- // Проходим по всем целевым дням недели в текущем месяце
208
+ // Iterate over all target days of the week in the current month
207
209
  while (currentDate.getUTCMonth() ===
208
210
  (startDate.getUTCMonth() + i) % 12) {
209
211
  schedule.times.forEach((timeRange) => {
@@ -217,17 +219,17 @@ class SyncModules {
217
219
  intervalEnd.toISOString(),
218
220
  ]);
219
221
  });
220
- // Переходим к следующей неделе (следующему такому же дню недели)
222
+ // Move to the next week (same day of the week)
221
223
  currentDate.setUTCDate(currentDate.getUTCDate() + 7);
222
224
  }
223
225
  }
224
226
  }
225
227
  }
226
228
  /**
227
- * Add TimeIntervals to schedules
229
+ * Adds time intervals to schedules.
228
230
  *
229
- * @param schedules
230
- * @returns schedules with timeIntervals
231
+ * @param schedules - The schedules to process.
232
+ * @return Schedules with added time intervals.
231
233
  */
232
234
  _addTimeIntervalsToSchedules(schedules) {
233
235
  schedules.forEach((scheduleGroup) => {
@@ -250,13 +252,13 @@ class SyncModules {
250
252
  return schedules;
251
253
  }
252
254
  /**
253
- * normalizeAttr
255
+ * Normalizes attributes within the data.
254
256
  *
255
- * @param data
256
- * @returns normalized Attrs
257
+ * @param data - The data to normalize.
258
+ * @return Normalized attributes.
257
259
  */
258
260
  _normalizeAttr(data) {
259
- // for regular attributes
261
+ // For regular attributes
260
262
  if ('attributeValues' in data) {
261
263
  for (const attr in data.attributeValues) {
262
264
  const d = data.attributeValues[attr];
@@ -283,11 +285,11 @@ class SyncModules {
283
285
  if ('attributes' in data) {
284
286
  const d = data.attributes;
285
287
  for (const attr in d) {
286
- // normalize numbers
288
+ // Normalize numbers
287
289
  if (d[attr].type === 'integer' || d[attr].type === 'float') {
288
290
  d[attr].value = Number(d[attr].value);
289
291
  }
290
- // add timeIntervals
292
+ // Add time intervals
291
293
  if (d[attr].type === 'timeInterval') {
292
294
  // const schedules = d[attr].localizeInfos.intervals;
293
295
  // if (Array.isArray(schedules) && schedules.length > 0) {
@@ -301,11 +303,11 @@ class SyncModules {
301
303
  return data;
302
304
  }
303
305
  /**
304
- * dataPostProcess
306
+ * Processes data after fetching or receiving it.
305
307
  *
306
- * @param data
307
- * @param langCode
308
- * @returns
308
+ * @param data - The data to process.
309
+ * @param langCode - The language code for processing.
310
+ * @return Processed data.
309
311
  */
310
312
  _dataPostProcess(data, langCode = this.state.lang) {
311
313
  const normalize = this._normalizeData(data, langCode);
@@ -313,20 +315,20 @@ class SyncModules {
313
315
  return result;
314
316
  }
315
317
  /**
316
- * setAccessToken
318
+ * Sets the access token in the state.
317
319
  *
318
- * @param accessToken
319
- * @returns
320
+ * @param accessToken - The access token to set.
321
+ * @return The instance of SyncModules for chaining.
320
322
  */
321
323
  setAccessToken(accessToken) {
322
324
  this.state.accessToken = accessToken;
323
325
  return this;
324
326
  }
325
327
  /**
326
- * setRefreshToken
328
+ * Sets the refresh token in the state.
327
329
  *
328
- * @param refreshToken
329
- * @returns
330
+ * @param refreshToken - The refresh token to set.
331
+ * @return The instance of SyncModules for chaining.
330
332
  */
331
333
  setRefreshToken(refreshToken) {
332
334
  this.state.refreshToken = refreshToken;
@@ -3,8 +3,14 @@ import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
4
  import type { BlockType, IBlockEntity, IBlocks, IBlocksResponse, ISearchBlock } from './blocksInterfaces';
5
5
  /**
6
- * Controllers for working with blocks
6
+ * Controllers for working with blocks.
7
+ *
7
8
  * @handle /api/content/blocks
9
+ * @class BlocksApi
10
+ * @extends AsyncModules
11
+ * @implements {IBlocks}
12
+ *
13
+ * @description This class provides methods to interact with blocks.
8
14
  */
9
15
  export default class BlocksApi extends AsyncModules implements IBlocks {
10
16
  protected state: StateModule;
@@ -13,54 +19,79 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
13
19
  /**
14
20
  * Get blocks by parameters.
15
21
  *
16
- * @param {BlockType} [type] - Available values : product | error_page | catalog_page | product_preview | similar_products_block | product_block | form | common_page | common_block | order | none
17
- * @param {string} [langCode] - Language code. Default "en_US"
18
- * @param {number} [offset] - Parameter for pagination. Default 0
19
- * @param {number} [limit] - Parameter for pagination. Default 30
22
+ * @handleName getBlocks
20
23
  *
21
- * @returns Return array of BlocksEntity object.
24
+ * @param {BlockType} type - Available values : product | error_page | catalog_page | product_preview | similar_products_block | product_block | form | common_page | common_block | order | 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
+ *
29
+ * @return {IBlocksResponse} Returns BlocksEntity object.
30
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
31
+ *
32
+ * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
22
33
  */
23
34
  getBlocks(type: BlockType, langCode?: string, offset?: number, limit?: number): Promise<IBlocksResponse | IError>;
24
35
  /**
25
36
  * Get block by marker.
26
37
  *
27
- * @param {string} [marker] - Marker of Block.
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
38
+ * @handleName getBlockByMarker
39
+ *
40
+ * @param {string} marker - Marker of Block. Example: 'product_block'.
41
+ * @param {string} [langCode] - Language code. Default: "en_US".
42
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
43
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
31
44
  *
32
- * @returns Return BlocksEntity object.
45
+ * @return {IBlockEntity} - Returns a BlockEntity object.
46
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
47
+ *
48
+ * @description This method retrieves a block by its marker and includes additional information such as similar products or products associated with the block.
33
49
  */
34
50
  getBlockByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IBlockEntity | IError>;
35
51
  /**
36
52
  * Get similar products by block marker.
37
53
  *
38
- * @param {string} [marker] - Block identifier
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
54
+ * @handleName getSimilarProducts
55
+ *
56
+ * @param {string} marker - Block identifier. Example: 'similar_products_block'.
57
+ * @param {string} [langCode] - Language code. Default: "en_US".
58
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
59
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
42
60
  *
43
- * @returns Return IProductsResponse with total and items array of BlocksEntity object.
61
+ * @return {IProductsResponse} - Returns the total count and an array of product items in object by specified block marker.
62
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
63
+ *
64
+ * @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.
44
65
  */
45
66
  private getSimilarProducts;
46
67
  /**
47
68
  * Get products by block marker.
48
69
  *
49
- * @param {string} [marker] - Block identifier
50
- * @param {string} [langCode] - Language code. Default "en_US"
51
- * @param {number} [offset] - Parameter for pagination. Default 0
52
- * @param {number} [limit] - Parameter for pagination. Default 30
70
+ * @handleName getProductsByBlockMarker
71
+ *
72
+ * @param {string} marker - Block identifier. Example: 'product_block'.
73
+ * @param {string} [langCode] - Language code. Default: "en_US".
74
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
75
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
76
+ *
77
+ * @return {IProductsEntity[]} Return array of BlocksEntity object.
78
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
53
79
  *
54
- * @returns Return array of BlocksEntity object.
80
+ * @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.
55
81
  */
56
82
  private getProductsByBlockMarker;
57
83
  /**
58
- * Quick search for block objects with limited output
84
+ * Quick search for block objects with limited output.
85
+ *
86
+ * @handleName searchBlock
87
+ *
88
+ * @param {string} name - Search string. Example: 'product_block'.
89
+ * @param {string} [langCode] - Language code. Default: "en_US".
59
90
  *
60
- * @param {string} [name] - Search string
61
- * @param {string} [langCode] - Language code. Default "en_US"
91
+ * @return {ISearchBlock[]} Returns an array of ISearchBlock objects.
92
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
62
93
  *
63
- * @returns Return array of BlocksEntity object.
94
+ * @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.
64
95
  */
65
96
  searchBlock(name: string, langCode?: string): Promise<Array<ISearchBlock> | IError>;
66
97
  }