oneentry 1.0.0 → 1.0.7
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 +1655 -190
- package/dist/admins/adminsApi.d.ts +2 -2
- package/dist/admins/adminsInterfaces.d.ts +30 -2
- package/dist/attribute-set/AttributeSetApi.d.ts +3 -3
- package/dist/attribute-set/attributeSetInterfaces.d.ts +21 -3
- package/dist/base/utils.d.ts +32 -0
- package/dist/base/utils.js +32 -0
- package/dist/base/utils.js.map +1 -0
- package/dist/forms/formsApi.d.ts +26 -0
- package/dist/forms/formsApi.js +56 -0
- package/dist/forms/formsApi.js.map +1 -0
- package/dist/forms/formsInterfaces.d.ts +28 -0
- package/dist/forms/formsInterfaces.js +3 -0
- package/dist/forms/formsInterfaces.js.map +1 -0
- package/dist/formsData/formsDataApi.d.ts +41 -0
- package/dist/formsData/formsDataApi.js +71 -0
- package/dist/formsData/formsDataApi.js.map +1 -0
- package/dist/formsData/formsDataInterfaces.d.ts +25 -0
- package/dist/formsData/formsDataInterfaces.js +3 -0
- package/dist/formsData/formsDataInterfaces.js.map +1 -0
- package/dist/general-types/GeneralTypesApi.d.ts +2 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +7 -2
- package/dist/index.d.ts +11 -7
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/locales/localesApi.d.ts +2 -2
- package/dist/locales/localesInterfaces.d.ts +13 -2
- package/dist/markers/markersApi.d.ts +4 -4
- package/dist/markers/markersApi.js +1 -1
- package/dist/markers/markersApi.js.map +1 -1
- package/dist/markers/markersInterfaces.d.ts +14 -4
- package/dist/menus/menusApi.d.ts +2 -2
- package/dist/menus/menusInterfaces.d.ts +16 -2
- package/dist/modules/modulesApi.d.ts +2 -2
- package/dist/modules/modulesInterfaces.d.ts +17 -2
- package/dist/pages/pagesApi.d.ts +21 -9
- package/dist/pages/pagesApi.js +27 -15
- package/dist/pages/pagesApi.js.map +1 -1
- package/dist/pages/pagesInterfaces.d.ts +34 -9
- package/dist/product-statuses/productStatusesApi.d.ts +5 -5
- package/dist/product-statuses/productStatusesInterfaces.d.ts +13 -5
- package/dist/products/productsApi.d.ts +38 -26
- package/dist/products/productsApi.js +35 -22
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +38 -9
- package/dist/templates/templatesApi.d.ts +5 -5
- package/dist/templates/templatesInterfaces.d.ts +29 -5
- package/dist/templates-preview/templatesPreviewApi.d.ts +4 -4
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +25 -4
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
23
23
|
conditionValue: null,
|
|
24
24
|
conditionMarker: null,
|
|
25
25
|
attributeMarker: null,
|
|
26
|
+
langCode: 'en_US',
|
|
26
27
|
sortOrder: 'DESC',
|
|
27
28
|
sortKey: 'id'
|
|
28
29
|
};
|
|
@@ -44,6 +45,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
44
45
|
*
|
|
45
46
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
46
47
|
*
|
|
48
|
+
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
49
|
+
*
|
|
47
50
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
48
51
|
*
|
|
49
52
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
@@ -73,6 +76,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
73
76
|
*
|
|
74
77
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
75
78
|
*
|
|
79
|
+
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
80
|
+
*
|
|
76
81
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
77
82
|
*
|
|
78
83
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
@@ -104,6 +109,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
104
109
|
*
|
|
105
110
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
106
111
|
*
|
|
112
|
+
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
113
|
+
*
|
|
107
114
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
108
115
|
*
|
|
109
116
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
@@ -137,6 +144,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
137
144
|
*
|
|
138
145
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
139
146
|
*
|
|
147
|
+
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
148
|
+
*
|
|
140
149
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
141
150
|
*
|
|
142
151
|
* @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
@@ -160,6 +169,8 @@ class ProductApi extends oneEntry_1.default {
|
|
|
160
169
|
*
|
|
161
170
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
162
171
|
*
|
|
172
|
+
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
173
|
+
*
|
|
163
174
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
164
175
|
*
|
|
165
176
|
* @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
@@ -176,11 +187,13 @@ class ProductApi extends oneEntry_1.default {
|
|
|
176
187
|
*
|
|
177
188
|
* @param {number} [id] - Product id.
|
|
178
189
|
*
|
|
179
|
-
* @
|
|
190
|
+
* @param {string} [langCode] Language code parameter. Default "en_US"
|
|
191
|
+
*
|
|
192
|
+
* @returns {Promise<IProductsEntity>} - Returns ContentIndexedProductDto object for the product.
|
|
180
193
|
*/
|
|
181
|
-
getProductById(id) {
|
|
194
|
+
getProductById(id, langCode = 'en_US') {
|
|
182
195
|
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
-
const result = yield this._fetchGet(`/${id}`);
|
|
196
|
+
const result = yield this._fetchGet(`/${id}?${langCode}`);
|
|
184
197
|
return result;
|
|
185
198
|
});
|
|
186
199
|
}
|
|
@@ -188,28 +201,28 @@ class ProductApi extends oneEntry_1.default {
|
|
|
188
201
|
* Find all product page objects with pagination and multiple filtering.
|
|
189
202
|
*
|
|
190
203
|
* @param {array} [data] - Request body.
|
|
191
|
-
*
|
|
192
|
-
* [
|
|
204
|
+
* @example
|
|
205
|
+
* const objects = [
|
|
193
206
|
* {
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* },
|
|
207
|
+
* attributeMarker: "price",
|
|
208
|
+
* conditionMarker: "mth",
|
|
209
|
+
* conditionValue: 1,
|
|
210
|
+
* pageId: 0,
|
|
211
|
+
* }, null, 2},
|
|
199
212
|
* {
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
* }
|
|
205
|
-
* ]
|
|
206
|
-
*
|
|
207
|
-
*
|
|
213
|
+
* attributeMarker: "price",
|
|
214
|
+
* conditionMarker: "lth",
|
|
215
|
+
* conditionValue: 3,
|
|
216
|
+
* pageId: 0,
|
|
217
|
+
* }, null, 2},
|
|
218
|
+
* ];
|
|
208
219
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
209
220
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
210
221
|
*
|
|
211
222
|
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
212
223
|
*
|
|
224
|
+
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
225
|
+
*
|
|
213
226
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
214
227
|
*
|
|
215
228
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
@@ -219,7 +232,7 @@ class ProductApi extends oneEntry_1.default {
|
|
|
219
232
|
filterProduct(data, userQuery) {
|
|
220
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
221
234
|
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
222
|
-
const result = yield this._fetchPost(
|
|
235
|
+
const result = yield this._fetchPost(`/conditions-filter?` + this._queryParamsToString(query), data);
|
|
223
236
|
return result;
|
|
224
237
|
});
|
|
225
238
|
}
|
|
@@ -228,13 +241,13 @@ class ProductApi extends oneEntry_1.default {
|
|
|
228
241
|
*
|
|
229
242
|
* @param {string} [name] - Text to search product page objects (search is based on the title field of the localizeInfos object with language consideration)
|
|
230
243
|
*
|
|
231
|
-
* @param {string} [
|
|
244
|
+
* @param {string} [langCode] - Language code
|
|
232
245
|
*
|
|
233
246
|
* @returns {Promise<IProduct[]>} - Returns array of ContentIndexedProductDto object for the product.
|
|
234
247
|
*/
|
|
235
|
-
searchProduct(name,
|
|
248
|
+
searchProduct(name, langCode = 'en_US') {
|
|
236
249
|
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
const searchProducts = yield this._fetchGet(`/quick/search?lang=${
|
|
250
|
+
const searchProducts = yield this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
|
|
238
251
|
const productsList = [];
|
|
239
252
|
yield Promise.all(searchProducts.map((product) => __awaiter(this, void 0, void 0, function* () {
|
|
240
253
|
yield this.getProductById(product.id).then((result) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../src/products/productsApi.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+CAAuC;
|
|
1
|
+
{"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../src/products/productsApi.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+CAAuC;AAEvC;;GAEG;AACH,MAAqB,UAAW,SAAQ,kBAAQ;IAC5C,YAAY,GAAU;QAClB,KAAK,CAAC,GAAG,CAAC,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AAC,IAAW,EAAE,WAAkB,OAAO;;YAC7D,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,sBAAsB,QAAQ,SAAS,IAAI,EAAE,CAAC,CAAA;YAC1F,MAAM,YAAY,GAA0B,EAAE,CAAA;YAI9C,MAAM,OAAO,CAAC,GAAG,CACb,cAAc,CAAC,GAAG,CAAC,CAAO,OAAsB,EAAE,EAAE;gBAChD,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;oBAClD,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC7B,CAAC,CAAC,CAAA;YACN,CAAC,CAAA,CAAC,CACL,CAAA;YACD,OAAO,YAAY,CAAA;QACvB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,wBAAwB,CAAC,EAAS;;YAC3C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;YAC7C,OAAO,OAAO,CAAC,eAAe,CAAA;QAClC,CAAC;KAAA;CAEJ;AApQD,6BAoQC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { ILocalizeInfos } from "../base/utils";
|
|
1
2
|
interface IProductApi {
|
|
2
|
-
getProducts(userQuery?: IProductsQuery): Promise<
|
|
3
|
-
getProductsEmptyPage(userQuery?: IProductsQuery): Promise<
|
|
4
|
-
getProductsPageById(id: number, userQuery?: IProductsQuery): Promise<
|
|
5
|
-
getProductsPageByUrl(url: string, userQuery?: IProductsQuery): Promise<
|
|
6
|
-
getRelatedProductsById(id: number, userQuery?: IProductsQuery): Promise<
|
|
7
|
-
getProductById(id: number): Promise<
|
|
8
|
-
filterProduct(data: Array<IFilterParams>, userQuery?: IProductsQuery): Promise<
|
|
9
|
-
searchProduct(name: string,
|
|
3
|
+
getProducts(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
4
|
+
getProductsEmptyPage(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
5
|
+
getProductsPageById(id: number, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
6
|
+
getProductsPageByUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
7
|
+
getRelatedProductsById(id: number, userQuery?: IProductsQuery): Promise<IProductsEntity>;
|
|
8
|
+
getProductById(id: number, langCode: string): Promise<IProductsEntity>;
|
|
9
|
+
filterProduct(data: Array<IFilterParams>, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
10
|
+
searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity>>;
|
|
10
11
|
getAttributesByProductId(id: number): Promise<any>;
|
|
11
12
|
}
|
|
12
13
|
interface IProduct {
|
|
@@ -40,4 +41,32 @@ interface IFilterParams {
|
|
|
40
41
|
conditionValue: number;
|
|
41
42
|
pageId?: number;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
interface IProductsEntity {
|
|
45
|
+
id: number;
|
|
46
|
+
localizeInfos: ILocalizeInfos;
|
|
47
|
+
isVisible: boolean;
|
|
48
|
+
statusId: number;
|
|
49
|
+
relatedIds: number[];
|
|
50
|
+
productPages: {
|
|
51
|
+
id: number;
|
|
52
|
+
pageId: number;
|
|
53
|
+
productId: number;
|
|
54
|
+
}[];
|
|
55
|
+
attributeSetId: number;
|
|
56
|
+
version: number;
|
|
57
|
+
isSync: number | boolean;
|
|
58
|
+
price: number;
|
|
59
|
+
templateIdentifier: string;
|
|
60
|
+
shortDescTemplateIdentifier: string;
|
|
61
|
+
/**
|
|
62
|
+
* Language-specific attribute values.
|
|
63
|
+
* @example attributeValues['en_US']
|
|
64
|
+
*
|
|
65
|
+
* @property {langCode.<object>}
|
|
66
|
+
*/
|
|
67
|
+
attributeValues: {
|
|
68
|
+
[langCode: string]: object;
|
|
69
|
+
};
|
|
70
|
+
position: number;
|
|
71
|
+
}
|
|
72
|
+
export { IFilterParams, IProductsQuery, IProduct, IProductApi, IProductsEntity };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OneEntry from '../base/oneEntry';
|
|
2
|
-
import { ITemplatesApi } from './templatesInterfaces';
|
|
2
|
+
import { ITemplatesApi, ITemplateEntity } from './templatesInterfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Controllers for working with template objects
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
|
|
|
10
10
|
*
|
|
11
11
|
* @returns Returns an array of product status objects
|
|
12
12
|
*/
|
|
13
|
-
getTemplates(): Promise<
|
|
13
|
+
getTemplates(): Promise<Array<ITemplateEntity>>;
|
|
14
14
|
/**
|
|
15
15
|
* Get all template objects grouped by types.
|
|
16
16
|
*
|
|
@@ -18,7 +18,7 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
|
|
|
18
18
|
*
|
|
19
19
|
* @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
20
20
|
*/
|
|
21
|
-
getAllTemplates(): Promise<
|
|
21
|
+
getAllTemplates(): Promise<Array<ITemplateEntity>>;
|
|
22
22
|
/**
|
|
23
23
|
* Get one template object by id.
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
|
|
|
26
26
|
*
|
|
27
27
|
* @returns Returns a TemplateEntity object
|
|
28
28
|
*/
|
|
29
|
-
getTemplateById(id: number): Promise<
|
|
29
|
+
getTemplateById(id: number): Promise<ITemplateEntity>;
|
|
30
30
|
/**
|
|
31
31
|
* Get a single template object by marker.
|
|
32
32
|
*
|
|
@@ -34,5 +34,5 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
|
|
|
34
34
|
*
|
|
35
35
|
* @returns Returns a TemplateEntity object
|
|
36
36
|
*/
|
|
37
|
-
getTemplateByMarker(marker: string): Promise<
|
|
37
|
+
getTemplateByMarker(marker: string): Promise<ITemplateEntity>;
|
|
38
38
|
}
|
|
@@ -1,7 +1,31 @@
|
|
|
1
|
+
import { IGeneralTypesEntity } from "../general-types/generalTypesInterfaces";
|
|
2
|
+
import { ILocalizeInfos } from "../base/utils";
|
|
1
3
|
interface ITemplatesApi {
|
|
2
|
-
getTemplates(): Promise<
|
|
3
|
-
getAllTemplates(): Promise<
|
|
4
|
-
getTemplateById(id: number): Promise<
|
|
5
|
-
getTemplateByMarker(marker: string): Promise<
|
|
4
|
+
getTemplates(): Promise<Array<ITemplateEntity>>;
|
|
5
|
+
getAllTemplates(): Promise<Array<ITemplateEntity>>;
|
|
6
|
+
getTemplateById(id: number): Promise<ITemplateEntity>;
|
|
7
|
+
getTemplateByMarker(marker: string): Promise<ITemplateEntity>;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
interface ITemplateEntity {
|
|
10
|
+
id: number;
|
|
11
|
+
updatedDate: string;
|
|
12
|
+
version: number;
|
|
13
|
+
identifier: string;
|
|
14
|
+
attributesSets: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
attributeSetId: number;
|
|
18
|
+
generalType: IGeneralTypesEntity;
|
|
19
|
+
generalTypeId: number;
|
|
20
|
+
localizeInfos: ILocalizeInfos;
|
|
21
|
+
position: {
|
|
22
|
+
id: number;
|
|
23
|
+
position: number | string;
|
|
24
|
+
objectId: number;
|
|
25
|
+
objectType: string;
|
|
26
|
+
isLocked: boolean;
|
|
27
|
+
objectCategoryId: number;
|
|
28
|
+
};
|
|
29
|
+
positionId: number | string;
|
|
30
|
+
}
|
|
31
|
+
export { ITemplatesApi, ITemplateEntity };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OneEntry from "../base/oneEntry";
|
|
2
|
-
import { ITemplatesPreview } from "./templatesPreviewInterfaces";
|
|
2
|
+
import { ITemplatesPreview, ITemplatesPreviewEntity } from "./templatesPreviewInterfaces";
|
|
3
3
|
/**
|
|
4
4
|
* Controllers for working with template objects for preview
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ export default class PageApi extends OneEntry implements ITemplatesPreview {
|
|
|
10
10
|
*
|
|
11
11
|
* @returns Returns all TemplatePreviewsEntity template objects
|
|
12
12
|
*/
|
|
13
|
-
getTemplatesPreview(): Promise<
|
|
13
|
+
getTemplatesPreview(): Promise<Array<ITemplatesPreviewEntity>>;
|
|
14
14
|
/**
|
|
15
15
|
* Get one template object by id.
|
|
16
16
|
*
|
|
@@ -18,7 +18,7 @@ export default class PageApi extends OneEntry implements ITemplatesPreview {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns Returns a TemplatePreviewsEntity object
|
|
20
20
|
*/
|
|
21
|
-
getTemplatesPreviewById(id: number): Promise<
|
|
21
|
+
getTemplatesPreviewById(id: number): Promise<ITemplatesPreviewEntity>;
|
|
22
22
|
/**
|
|
23
23
|
* Get one template object by marker.
|
|
24
24
|
*
|
|
@@ -26,5 +26,5 @@ export default class PageApi extends OneEntry implements ITemplatesPreview {
|
|
|
26
26
|
*
|
|
27
27
|
* @returns Returns a TemplatePreviewsEntity object
|
|
28
28
|
*/
|
|
29
|
-
getTemplatesPreviewByMarker(marker: string): Promise<
|
|
29
|
+
getTemplatesPreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
|
|
30
30
|
}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
+
import { ILocalizeInfos } from "../base/utils";
|
|
1
2
|
interface ITemplatesPreview {
|
|
2
|
-
getTemplatesPreview(): Promise<
|
|
3
|
-
getTemplatesPreviewById(id: number): Promise<
|
|
4
|
-
getTemplatesPreviewByMarker(marker: string): Promise<
|
|
3
|
+
getTemplatesPreview(): Promise<Array<ITemplatesPreviewEntity>>;
|
|
4
|
+
getTemplatesPreviewById(id: number): Promise<ITemplatesPreviewEntity>;
|
|
5
|
+
getTemplatesPreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
+
interface ITemplatesPreviewEntity {
|
|
8
|
+
id: number;
|
|
9
|
+
updatedDate: string;
|
|
10
|
+
version: number;
|
|
11
|
+
identifier: string;
|
|
12
|
+
attributesSets: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
attributeSetId: number;
|
|
16
|
+
localizeInfos: ILocalizeInfos;
|
|
17
|
+
position: {
|
|
18
|
+
id: number;
|
|
19
|
+
position: number | string;
|
|
20
|
+
objectId: number;
|
|
21
|
+
objectType: string;
|
|
22
|
+
isLocked: boolean;
|
|
23
|
+
objectCategoryId: number | null;
|
|
24
|
+
};
|
|
25
|
+
positionId: number | string;
|
|
26
|
+
}
|
|
27
|
+
export { ITemplatesPreview, ITemplatesPreviewEntity };
|