oneentry 1.0.88 → 1.0.90

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.
package/README.md CHANGED
@@ -5043,7 +5043,7 @@ const value = await System.test500()
5043
5043
  const { Templates } = defineOneEntry('your-url');
5044
5044
  ```
5045
5045
 
5046
- ### Templates.getAllTemplates()
5046
+ ### Templates.getAllTemplates(langCode)
5047
5047
 
5048
5048
  ```js
5049
5049
  const value = await Templates.getAllTemplates()
@@ -5054,17 +5054,37 @@ const value = await Templates.getAllTemplates()
5054
5054
  Example return:
5055
5055
 
5056
5056
  ```json
5057
- [
5058
- {
5059
- "id": 1764,
5060
- "version": 10,
5061
- "identifier": "marker",
5062
- "generalTypeId": 4,
5063
- "title": "Page template",
5064
- "position": 0,
5065
- "generalTypeName": "forProductPreview"
5066
- }
5067
- ]
5057
+ {
5058
+ "forTextBlock": [
5059
+ {
5060
+ "id": 1,
5061
+ "version": 0,
5062
+ "identifier": "for-block",
5063
+ "title": "For blocks",
5064
+ "generalTypeName": "forTextBlock",
5065
+ "generalTypeId": 18,
5066
+ "position": 1,
5067
+ "attributeValues": {
5068
+ "en_US": {
5069
+ "marker": {
5070
+ "value": "",
5071
+ "type": "string",
5072
+ "position": 1,
5073
+ "isProductPreview": false,
5074
+ "isIcon": false,
5075
+ "attributeFields": {
5076
+ "marker": {
5077
+ "type": "string",
5078
+ "value": "test"
5079
+ }
5080
+ }
5081
+ }
5082
+ }
5083
+ },
5084
+ "attributeIdentifier": "my-set"
5085
+ }
5086
+ ]
5087
+ }
5068
5088
  ```
5069
5089
  <details>
5070
5090
  <summary>Schema</summary>
@@ -5100,7 +5120,7 @@ general type name <br>
5100
5120
 
5101
5121
  </details>
5102
5122
 
5103
- ### Templates.getTemplateByType(type)
5123
+ ### Templates.getTemplateByType(type, langCode)
5104
5124
 
5105
5125
  ```js
5106
5126
  const value = await Templates.getTemplateByType('forCatalogProducts')
@@ -5114,12 +5134,28 @@ Example return:
5114
5134
  [
5115
5135
  {
5116
5136
  "id": 1764,
5117
- "version": 10,
5118
- "identifier": "marker",
5119
5137
  "generalTypeId": 4,
5138
+ "generalTypeName": "forCatalogProducts",
5120
5139
  "title": "Page template",
5121
- "position": 0,
5122
- "generalTypeName": "forProductPreview"
5140
+ "identifier": "marker",
5141
+ "position": 1,
5142
+ "version": 10,
5143
+ "attributeValues": {
5144
+ "marker": {
5145
+ "value": "",
5146
+ "type": "string",
5147
+ "position": 1,
5148
+ "isProductPreview": false,
5149
+ "isIcon": false,
5150
+ "attributeFields": {
5151
+ "marker": {
5152
+ "type": "string",
5153
+ "value": "test"
5154
+ }
5155
+ }
5156
+ }
5157
+ },
5158
+ "attributeSetIdentifier": "my-set"
5123
5159
  }
5124
5160
  ]
5125
5161
  ```
@@ -5158,7 +5194,7 @@ general type name <br>
5158
5194
  </details>
5159
5195
 
5160
5196
 
5161
- ### Templates.getTemplateById(id)
5197
+ ### Templates.getTemplateById(id, langCode)
5162
5198
 
5163
5199
  ```js
5164
5200
  const value = await Templates.getTemplateById(1)
@@ -5169,16 +5205,102 @@ const value = await Templates.getTemplateById(1)
5169
5205
  Example return:
5170
5206
 
5171
5207
  ```json
5172
- [
5173
- {
5174
- "id": 1764,
5175
- "version": 10,
5176
- "identifier": "marker",
5177
- "generalTypeId": 4,
5178
- "title": "Page template",
5179
- "generalTypeName": "forProductPreview"
5180
- }
5181
- ]
5208
+ {
5209
+ "id": 1764,
5210
+ "generalTypeId": 4,
5211
+ "generalTypeName": "forProductPreview",
5212
+ "title": "Page template",
5213
+ "identifier": "marker",
5214
+ "position": 1,
5215
+ "version": 10,
5216
+ "attributeValues": {
5217
+ "marker": {
5218
+ "value": "",
5219
+ "type": "string",
5220
+ "position": 1,
5221
+ "isProductPreview": false,
5222
+ "isIcon": false,
5223
+ "attributeFields": {
5224
+ "marker": {
5225
+ "type": "string",
5226
+ "value": "test"
5227
+ }
5228
+ }
5229
+ }
5230
+ },
5231
+ "attributeSetIdentifier": "my-set"
5232
+ }
5233
+ ```
5234
+ <details>
5235
+ <summary>Schema</summary>
5236
+
5237
+ **id:** number <br>
5238
+ *object identifier* <br>
5239
+ example: 1764 <br>
5240
+
5241
+ **version** number <br>
5242
+ *object's version number of modification* <br>
5243
+ example: 10 <br>
5244
+
5245
+ **identifier:** string <br>
5246
+ *textual identifier for a field in the record* <br>
5247
+ example: catalog <br>
5248
+
5249
+ **generalTypeId:** number <br>
5250
+ *type identifier* <br>
5251
+ example: 4 <br>
5252
+
5253
+ **title:** string<br>
5254
+ *template name* <br>
5255
+ example: page template <br>
5256
+
5257
+ **position** object <br>
5258
+ *position number* <br>
5259
+ example: 0 <br>
5260
+
5261
+
5262
+ **generalTypeName** string <br>
5263
+ *example: forProductPreview* <br>
5264
+ general type name <br>
5265
+
5266
+ </details>
5267
+
5268
+ ### Templates.getTemplateByMarker(marker, langCode)
5269
+
5270
+ ```js
5271
+ const value = await Templates.getTemplateByMarker('my-marker')
5272
+ ```
5273
+
5274
+ > This method retrieves a single template object based on its identifier (marker) from the API. It returns a Promise that resolves to a template object.
5275
+
5276
+ Example return:
5277
+
5278
+ ```json
5279
+ {
5280
+ "id": 1764,
5281
+ "generalTypeId": 4,
5282
+ "generalTypeName": "forProductPreview",
5283
+ "title": "Page template",
5284
+ "identifier": "marker",
5285
+ "position": 1,
5286
+ "version": 10,
5287
+ "attributeValues": {
5288
+ "marker": {
5289
+ "value": "",
5290
+ "type": "string",
5291
+ "position": 1,
5292
+ "isProductPreview": false,
5293
+ "isIcon": false,
5294
+ "attributeFields": {
5295
+ "marker": {
5296
+ "type": "string",
5297
+ "value": "test"
5298
+ }
5299
+ }
5300
+ }
5301
+ },
5302
+ "attributeSetIdentifier": "my-set"
5303
+ }
5182
5304
  ```
5183
5305
  <details>
5184
5306
  <summary>Schema</summary>
@@ -5214,6 +5336,7 @@ general type name <br>
5214
5336
 
5215
5337
  </details>
5216
5338
 
5339
+
5217
5340
  ---
5218
5341
 
5219
5342
 
@@ -5224,7 +5347,7 @@ general type name <br>
5224
5347
  const { TemplatePreviews } = defineOneEntry('your-url');
5225
5348
  ```
5226
5349
 
5227
- ### TemplatePreviews.getTemplatePreviews()
5350
+ ### TemplatePreviews.getTemplatePreviews(langCode)
5228
5351
 
5229
5352
  ```js
5230
5353
  const value = await TemplatePreviews.getTemplatePreviews()
@@ -5240,6 +5363,24 @@ Example return:
5240
5363
  "id": 1,
5241
5364
  "version": 0,
5242
5365
  "identifier": "preview-templates",
5366
+ "attributeValues": {
5367
+ "en_US": {
5368
+ "marker": {
5369
+ "value": "",
5370
+ "type": "string",
5371
+ "position": 1,
5372
+ "isProductPreview": false,
5373
+ "isIcon": false,
5374
+ "attributeFields": {
5375
+ "marker": {
5376
+ "type": "string",
5377
+ "value": "test"
5378
+ }
5379
+ }
5380
+ }
5381
+ }
5382
+ },
5383
+ "attributeSetIdentifier": "my-set",
5243
5384
  "proportion": {
5244
5385
  "vertical": {
5245
5386
  "width": "2",
@@ -5299,7 +5440,7 @@ example: 12 <br>
5299
5440
  </details>
5300
5441
 
5301
5442
 
5302
- ### TemplatePreviews.getTemplatesPreviewById(id)
5443
+ ### TemplatePreviews.getTemplatesPreviewById(id, langCode)
5303
5444
 
5304
5445
  ```js
5305
5446
  const value = await TemplatePreviews.getTemplatePreviewById(1764)
@@ -5314,6 +5455,24 @@ Example return:
5314
5455
  "id": 1,
5315
5456
  "version": 0,
5316
5457
  "identifier": "preview-templates",
5458
+ "attributeValues": {
5459
+ "en_US": {
5460
+ "marker": {
5461
+ "value": "",
5462
+ "type": "string",
5463
+ "position": 1,
5464
+ "isProductPreview": false,
5465
+ "isIcon": false,
5466
+ "attributeFields": {
5467
+ "marker": {
5468
+ "type": "string",
5469
+ "value": "test"
5470
+ }
5471
+ }
5472
+ }
5473
+ }
5474
+ },
5475
+ "attributeSetIdentifier": "my-set",
5317
5476
  "proportion": {
5318
5477
  "vertical": {
5319
5478
  "width": "2",
@@ -5371,7 +5530,7 @@ example: 12 <br>
5371
5530
 
5372
5531
  </details>
5373
5532
 
5374
- ### TemplatePreviews.getTemplatesPreviewByMarker(marker)
5533
+ ### TemplatePreviews.getTemplatesPreviewByMarker(marker, langCode)
5375
5534
 
5376
5535
  ```js
5377
5536
  const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
@@ -5386,6 +5545,24 @@ Example return:
5386
5545
  "id": 1,
5387
5546
  "version": 0,
5388
5547
  "identifier": "preview-templates",
5548
+ "attributeValues": {
5549
+ "en_US": {
5550
+ "marker": {
5551
+ "value": "",
5552
+ "type": "string",
5553
+ "position": 1,
5554
+ "isProductPreview": false,
5555
+ "isIcon": false,
5556
+ "attributeFields": {
5557
+ "marker": {
5558
+ "type": "string",
5559
+ "value": "test"
5560
+ }
5561
+ }
5562
+ }
5563
+ }
5564
+ },
5565
+ "attributeSetIdentifier": "my-set",
5389
5566
  "proportion": {
5390
5567
  "vertical": {
5391
5568
  "width": "2",
@@ -1,3 +1,4 @@
1
+ import { AttributeType } from "../base/utils";
1
2
  /**
2
3
  * Represents a interface object of Admins Api.
3
4
  *
@@ -38,7 +39,7 @@ interface IPosition {
38
39
  */
39
40
  interface IAdminEntity {
40
41
  attributeSetId: number | null;
41
- attributeValues: Record<string, any>;
42
+ attributeValues: AttributeType;
42
43
  id: number;
43
44
  identifier: string;
44
45
  isSync: boolean;
@@ -163,11 +163,11 @@ class AsyncModules extends syncModules_1.default {
163
163
  return await secondResponse.json();
164
164
  }
165
165
  }
166
- throw response;
166
+ return response;
167
167
  }
168
168
  }
169
169
  catch (e) {
170
- console.error(e);
170
+ return e;
171
171
  }
172
172
  }
173
173
  }
@@ -66,23 +66,6 @@ interface IAttributeValue {
66
66
  [key: string]: any;
67
67
  }
68
68
  type AttributeType = IAttributeValues | IAttributeValue;
69
- interface IAttributeSetEntity {
70
- id: number;
71
- updatedDate: string;
72
- version: number;
73
- identifier: string;
74
- typeId: number;
75
- localizeInfos: LocalizeType;
76
- schema: Record<string, any>;
77
- position: {
78
- id: number;
79
- objectId: number;
80
- objectType: string;
81
- position: number | string;
82
- };
83
- positionId: number | string;
84
- isVisible: boolean;
85
- }
86
69
  type LangType = string | Array<string>;
87
70
  type LocalizeType = ILocalizeInfos | ILocalizeInfo;
88
71
  interface IError {
@@ -92,4 +75,4 @@ interface IError {
92
75
  timestamp: string;
93
76
  [key: string]: any;
94
77
  }
95
- export { LocalizeType, ILocalizeInfos, ILocalizeInfo, Types, IAttributeSetEntity, LangType, AttributeType, IAttributeValues, IAttributes, IConfig, IError };
78
+ export { LocalizeType, ILocalizeInfos, ILocalizeInfo, Types, LangType, AttributeType, IAttributeValues, IAttributes, IConfig, IError };
@@ -1,3 +1,4 @@
1
+ import { AttributeType } from "../base/utils";
1
2
  import { IProductsEntity } from "../products/productsInterfaces";
2
3
  /**
3
4
  * Represents a interface object of Blocks Api.
@@ -18,7 +19,7 @@ interface IBlocksResponse {
18
19
  items: Array<IBlockEntity>;
19
20
  }
20
21
  interface IBlockEntity {
21
- attributeValues: Record<string, any>;
22
+ attributeValues: AttributeType;
22
23
  id: number;
23
24
  identifier: string;
24
25
  isVisible: boolean;
@@ -18,23 +18,7 @@ class MenusApi extends asyncModules_1.default {
18
18
  * @returns Returns a single menu object as a ContentMenu object with included pages
19
19
  */
20
20
  async getMenusByMarker(marker, langCode = this.state.lang) {
21
- const result = await this._fetchGet(`/marker/${marker}`);
22
- let pages = result.pages;
23
- pages = pages.map(page => {
24
- page = this._normalizeData(page, langCode);
25
- for (const key in page.localizeInfos) {
26
- if (key !== 'menuTitle') {
27
- delete page.localizeInfos[key];
28
- }
29
- }
30
- const children = pages.filter(child => child.parentId === page.id);
31
- if (children.length) {
32
- const normalizeChildren = children.map(child => this._normalizeData(child, langCode));
33
- page.children = normalizeChildren;
34
- }
35
- return page;
36
- });
37
- result.pages = pages;
21
+ const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
38
22
  return this._dataPostProcess(result, langCode);
39
23
  }
40
24
  }
@@ -1,4 +1,4 @@
1
- import { IAttributes, LangType, Types } from "../base/utils";
1
+ import { AttributeType, IAttributes, LangType, Types } from "../base/utils";
2
2
  /**
3
3
  * Represents an interface object of Pages Api.
4
4
  *
@@ -74,23 +74,25 @@ interface IPositionForm {
74
74
  * @interface
75
75
  * @property {number} id - The identifier of the object.
76
76
  * @property {number} version - The version number of the object.
77
+ * @property {number} quantity - Quantity pages in block.
77
78
  * @property {string} identifier - The textual identifier for the record field.
78
79
  * @property {Record<string, any>} localizeInfos - The name of the page, taking into account localization.
79
80
  * @property {number} position - The position of the object.
80
81
  * @property {boolean} isSync - Indication of page indexing.
81
- * @property {Record<string, any>} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
82
+ * @property {AttributeType} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
82
83
  * @property {string} attributeSetIdentifier
83
84
  * @property {Types} type - Page type.
84
85
  */
85
86
  interface IPositionBlock {
86
87
  id: number;
88
+ quantity?: number;
87
89
  version: number;
88
90
  identifier: string;
89
91
  localizeInfos: Record<string, any>;
90
92
  position: number;
91
93
  isSync: boolean;
92
94
  isVisible: boolean;
93
- attributeValues: Record<string, any>;
95
+ attributeValues: AttributeType;
94
96
  attributeSetIdentifier: string | null;
95
97
  type: string;
96
98
  templateIdentifier: string | null;
@@ -111,14 +113,14 @@ interface IPositionBlock {
111
113
  * @property {string} attributeSetIdentifier - Set of attributes id.
112
114
  * @property {boolean} isSync - Indication of page indexing.
113
115
  * @property {string} templateIdentifier - User id of the linked template.
114
- * @property {Record<string, any>} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
116
+ * @property {AttributeType} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
115
117
  * @property {number} position - Item number (for sorting).
116
118
  * @property {Types} type - Page type.
117
119
  * @property {number} childrenCount - Children count.
118
120
  */
119
121
  interface IPagesEntity {
120
122
  attributeSetIdentifier: string;
121
- attributeValues: Record<string, any>;
123
+ attributeValues: AttributeType;
122
124
  childrenCount?: number;
123
125
  config?: Record<string, number>;
124
126
  depth: number;
@@ -1,4 +1,4 @@
1
- import { LangType, Types } from "../base/utils";
1
+ import { AttributeType, LangType, Types } from "../base/utils";
2
2
  /**
3
3
  * Represents an interface object of Products Api.
4
4
  *
@@ -66,6 +66,8 @@ interface IProductsQuery {
66
66
  * @property {string | null} conditionMarker - Id of the filter condition by which the values are filtered, default null.
67
67
  * @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
68
68
  * @property {Array<string> | null} pageUrl - Url of the category page object.
69
+ * @property {string | null} statusMarker - Text identifier of the product page status (default not set).
70
+ * @property {string | null} title - Product name.
69
71
  */
70
72
  interface IFilterParams {
71
73
  attributeMarker: string;
@@ -82,6 +84,8 @@ interface IFilterParams {
82
84
  conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
83
85
  conditionValue: number | string | null;
84
86
  pageUrl?: Array<string> | null;
87
+ statusMarker?: string;
88
+ title?: string;
85
89
  }
86
90
  /**
87
91
  * Represents a product entity object.
@@ -120,7 +124,7 @@ interface IProductsEntity {
120
124
  templateIdentifier: string | null;
121
125
  shortDescTemplateIdentifier: string;
122
126
  statusLocalizeInfos: Record<string, any>;
123
- attributeValues: Record<string, any>;
127
+ attributeValues: AttributeType;
124
128
  position: number;
125
129
  sku: string | null;
126
130
  }
@@ -168,6 +172,6 @@ interface IProductBlock {
168
172
  templateIdentifier: string | null;
169
173
  isVisible: boolean;
170
174
  isSync: boolean;
171
- attributeValues: Record<string, any>;
175
+ attributeValues: AttributeType;
172
176
  }
173
177
  export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity, IProductsInfo, IProductInfo, IProductBlock, IProductEntity, IProductsResponse };
@@ -24,13 +24,21 @@ export default class TemplatesPreviewApi extends AsyncModules implements ITempla
24
24
  *
25
25
  * @returns Returns a TemplateEntity object
26
26
  */
27
- getTemplateByType(type: Types): Promise<Array<ITemplateEntity>>;
27
+ getTemplateByType(type: Types, langCode?: string): Promise<Array<ITemplateEntity>>;
28
28
  /**
29
29
  * Get one template object by id.
30
30
  *
31
31
  * @param {number} id - Template id
32
+ * @param {string} [langCode] - Optional parameter language code
33
+ * @returns Returns a TemplateEntity object
34
+ */
35
+ getTemplateById(id: number, langCode?: string): Promise<ITemplateEntity>;
36
+ /**
37
+ * Get one template object by id.
32
38
  *
39
+ * @param {number} marker - Template marker
40
+ * @param {string} [langCode] - Optional parameter language code
33
41
  * @returns Returns a TemplateEntity object
34
42
  */
35
- getTemplateById(id: number): Promise<Record<Types, ITemplateEntity>>;
43
+ getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity>;
36
44
  }
@@ -16,7 +16,7 @@ class TemplatesPreviewApi extends asyncModules_1.default {
16
16
  * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
17
17
  */
18
18
  async getAllTemplates(langCode = this.state.lang) {
19
- const response = await this._fetchGet('/all');
19
+ const response = await this._fetchGet(`/all?langCode=${langCode}`);
20
20
  const result = {};
21
21
  for (let item in response) {
22
22
  result[item] = this._normalizeData(response[item], langCode);
@@ -31,20 +31,31 @@ class TemplatesPreviewApi extends asyncModules_1.default {
31
31
  *
32
32
  * @returns Returns a TemplateEntity object
33
33
  */
34
- async getTemplateByType(type) {
35
- const result = await this._fetchGet(`?type=${type}`);
36
- return result;
34
+ async getTemplateByType(type, langCode = this.state.lang) {
35
+ const result = await this._fetchGet(`?type=${type}&langCode=${langCode}`);
36
+ return this._normalizeData(result);
37
37
  }
38
38
  /**
39
39
  * Get one template object by id.
40
40
  *
41
41
  * @param {number} id - Template id
42
+ * @param {string} [langCode] - Optional parameter language code
43
+ * @returns Returns a TemplateEntity object
44
+ */
45
+ async getTemplateById(id, langCode = this.state.lang) {
46
+ const result = await this._fetchGet(`/${id}?langCode=${langCode}`);
47
+ return this._normalizeData(result);
48
+ }
49
+ /**
50
+ * Get one template object by id.
42
51
  *
52
+ * @param {number} marker - Template marker
53
+ * @param {string} [langCode] - Optional parameter language code
43
54
  * @returns Returns a TemplateEntity object
44
55
  */
45
- async getTemplateById(id) {
46
- const result = await this._fetchGet(`/${id}`);
47
- return result;
56
+ async getTemplateByMarker(marker, langCode = this.state.lang) {
57
+ const result = await this._fetchGet(`/${marker}?langCode=${langCode}`);
58
+ return this._normalizeData(result);
48
59
  }
49
60
  }
50
61
  exports.default = TemplatesPreviewApi;
@@ -1,15 +1,17 @@
1
- import { Types } from "../base/utils";
1
+ import { AttributeType, Types } from "../base/utils";
2
2
  /**
3
3
  * Represents an interface object of Templates Api.
4
4
  *
5
5
  * @property {function} getAllTemplates - Get all template objects grouped by types.
6
6
  * @property {function} getTemplateByType - Get template objects by type.
7
7
  * @property {function} getTemplateById - Get one template object by id.
8
+ * @property {function} getTemplateByMarker - Getting a single template object.
8
9
  */
9
10
  interface ITemplatesApi {
10
- getAllTemplates(langCode: string): Promise<Record<Types, ITemplateEntity>>;
11
+ getAllTemplates(langCode?: string): Promise<Record<Types, ITemplateEntity>>;
11
12
  getTemplateByType(type: Types, langCode: string): Promise<Array<ITemplateEntity>>;
12
- getTemplateById(id: number): Promise<Record<Types, ITemplateEntity>>;
13
+ getTemplateById(id: number): Promise<ITemplateEntity>;
14
+ getTemplateByMarker(marker: string, langCode?: string): Promise<ITemplateEntity>;
13
15
  }
14
16
  /**
15
17
  * Represents a template entity object.
@@ -22,6 +24,8 @@ interface ITemplatesApi {
22
24
  * @property {string} title - The name of the template.
23
25
  * @property {number} position - The position of the object.
24
26
  * @property {Types} generalTypeName - General type name.
27
+ * @property {string} attributeSetIdentifier - Set of attributes id.
28
+ * @property {AttributeType} attributeValues - Attribute values from the index (represented as a pair of user attribute id: attribute value).
25
29
  *
26
30
  */
27
31
  interface ITemplateEntity {
@@ -32,5 +36,7 @@ interface ITemplateEntity {
32
36
  title: string;
33
37
  position: number;
34
38
  generalTypeName: Types;
39
+ attributeValues: AttributeType;
40
+ attributeSetIdentifier: string | null;
35
41
  }
36
42
  export { ITemplatesApi, ITemplateEntity, };
@@ -16,7 +16,7 @@ class TemplatePreviewsApi extends asyncModules_1.default {
16
16
  * @returns Returns all TemplatePreviewsEntity template objects
17
17
  */
18
18
  async getTemplatePreviews(langCode = this.state.lang) {
19
- const result = await this._fetchGet('');
19
+ const result = await this._fetchGet(`?langCode=${langCode}`);
20
20
  return this._normalizeData(result, langCode);
21
21
  }
22
22
  /**
@@ -28,7 +28,7 @@ class TemplatePreviewsApi extends asyncModules_1.default {
28
28
  * @returns Returns a TemplatePreviewsEntity object
29
29
  */
30
30
  async getTemplatePreviewById(id, langCode = this.state.lang) {
31
- const result = await this._fetchGet(`/${id}`);
31
+ const result = await this._fetchGet(`/${id}?langCode=${langCode}`);
32
32
  return this._normalizeData(result, langCode);
33
33
  }
34
34
  /**
@@ -40,7 +40,7 @@ class TemplatePreviewsApi extends asyncModules_1.default {
40
40
  * @returns Returns a TemplatePreviewsEntity object
41
41
  */
42
42
  async getTemplatePreviewByMarker(marker, langCode = this.state.lang) {
43
- const result = await this._fetchGet(`/marker/${marker}`);
43
+ const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
44
44
  return this._normalizeData(result, langCode);
45
45
  }
46
46
  }
@@ -1,3 +1,4 @@
1
+ import { AttributeType } from "../base/utils";
1
2
  /**
2
3
  * Represents an interface object of Templates Preview Api.
3
4
  *
@@ -21,12 +22,17 @@ interface ITemplatesPreview {
21
22
  * @property {object} proportion - Object contains info by proportion template preview.
22
23
  * @property {Record<string, any>} localizeInfos - The name of the template, taking into account localization.
23
24
  * @property {number} position - The position of the object.
25
+ * @property {AttributeType} attributeValues - Attribute values from index.
26
+ * @property {string} attributeSetIdentifier - Text identifier used for a set of attributes
27
+ *
24
28
  *
25
29
  */
26
30
  interface ITemplatesPreviewEntity {
27
31
  id: number;
28
32
  version: number;
29
33
  identifier: string;
34
+ attributeValues: AttributeType;
35
+ attributeSetIdentifier: string;
30
36
  proportion: {
31
37
  horizontal: IProportion | null;
32
38
  vertical: IProportion | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",