oneentry 1.0.75 → 1.0.76
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 +1 -10
- package/dist/auth-provider/authProviderApi.d.ts +2 -2
- package/dist/auth-provider/authProvidersInterfaces.d.ts +2 -6
- package/dist/base/asyncModules.js +3 -14
- package/dist/base/stateModule.d.ts +2 -0
- package/dist/base/stateModule.js +19 -0
- package/package.json +1 -1
- package/dist/_cjs/admins/adminsApi.d.ts +0 -14
- package/dist/_cjs/admins/adminsApi.js +0 -34
- package/dist/_cjs/admins/adminsApi.js.map +0 -1
- package/dist/_cjs/admins/adminsInterfaces.d.ts +0 -32
- package/dist/_cjs/admins/adminsInterfaces.js +0 -3
- package/dist/_cjs/admins/adminsInterfaces.js.map +0 -1
- package/dist/_cjs/attribute-set/attributeSetApi.d.ts +0 -24
- package/dist/_cjs/attribute-set/attributeSetApi.js +0 -49
- package/dist/_cjs/attribute-set/attributeSetApi.js.map +0 -1
- package/dist/_cjs/attribute-set/attributeSetInterfaces.d.ts +0 -23
- package/dist/_cjs/attribute-set/attributeSetInterfaces.js +0 -3
- package/dist/_cjs/attribute-set/attributeSetInterfaces.js.map +0 -1
- package/dist/_cjs/base/oneEntry.d.ts +0 -9
- package/dist/_cjs/base/oneEntry.js +0 -55
- package/dist/_cjs/base/oneEntry.js.map +0 -1
- package/dist/_cjs/base/utils.d.ts +0 -32
- package/dist/_cjs/base/utils.js +0 -32
- package/dist/_cjs/base/utils.js.map +0 -1
- package/dist/_cjs/forms/formsApi.d.ts +0 -26
- package/dist/_cjs/forms/formsApi.js +0 -56
- package/dist/_cjs/forms/formsApi.js.map +0 -1
- package/dist/_cjs/forms/formsInterfaces.d.ts +0 -28
- package/dist/_cjs/forms/formsInterfaces.js +0 -3
- package/dist/_cjs/forms/formsInterfaces.js.map +0 -1
- package/dist/_cjs/formsData/formsDataApi.d.ts +0 -41
- package/dist/_cjs/formsData/formsDataApi.js +0 -71
- package/dist/_cjs/formsData/formsDataApi.js.map +0 -1
- package/dist/_cjs/formsData/formsDataInterfaces.d.ts +0 -25
- package/dist/_cjs/formsData/formsDataInterfaces.js +0 -3
- package/dist/_cjs/formsData/formsDataInterfaces.js.map +0 -1
- package/dist/_cjs/general-types/generalTypesApi.d.ts +0 -14
- package/dist/_cjs/general-types/generalTypesApi.js +0 -34
- package/dist/_cjs/general-types/generalTypesApi.js.map +0 -1
- package/dist/_cjs/general-types/generalTypesInterfaces.d.ts +0 -9
- package/dist/_cjs/general-types/generalTypesInterfaces.js +0 -3
- package/dist/_cjs/general-types/generalTypesInterfaces.js.map +0 -1
- package/dist/_cjs/index.d.ts +0 -35
- package/dist/_cjs/index.js +0 -55
- package/dist/_cjs/index.js.map +0 -1
- package/dist/_cjs/locales/localesApi.d.ts +0 -14
- package/dist/_cjs/locales/localesApi.js +0 -34
- package/dist/_cjs/locales/localesApi.js.map +0 -1
- package/dist/_cjs/locales/localesInterfaces.d.ts +0 -15
- package/dist/_cjs/locales/localesInterfaces.js +0 -3
- package/dist/_cjs/locales/localesInterfaces.js.map +0 -1
- package/dist/_cjs/markers/markersApi.d.ts +0 -35
- package/dist/_cjs/markers/markersApi.js +0 -65
- package/dist/_cjs/markers/markersApi.js.map +0 -1
- package/dist/_cjs/markers/markersInterfaces.d.ts +0 -16
- package/dist/_cjs/markers/markersInterfaces.js +0 -3
- package/dist/_cjs/markers/markersInterfaces.js.map +0 -1
- package/dist/_cjs/menus/menusApi.d.ts +0 -16
- package/dist/_cjs/menus/menusApi.js +0 -36
- package/dist/_cjs/menus/menusApi.js.map +0 -1
- package/dist/_cjs/menus/menusInterfaces.d.ts +0 -18
- package/dist/_cjs/menus/menusInterfaces.js +0 -3
- package/dist/_cjs/menus/menusInterfaces.js.map +0 -1
- package/dist/_cjs/modules/modulesApi.d.ts +0 -14
- package/dist/_cjs/modules/modulesApi.js +0 -34
- package/dist/_cjs/modules/modulesApi.js.map +0 -1
- package/dist/_cjs/modules/modulesInterfaces.d.ts +0 -19
- package/dist/_cjs/modules/modulesInterfaces.js +0 -3
- package/dist/_cjs/modules/modulesInterfaces.js.map +0 -1
- package/dist/_cjs/pages/pagesApi.d.ts +0 -74
- package/dist/_cjs/pages/pagesApi.js +0 -137
- package/dist/_cjs/pages/pagesApi.js.map +0 -1
- package/dist/_cjs/pages/pagesInterfaces.d.ts +0 -39
- package/dist/_cjs/pages/pagesInterfaces.js +0 -3
- package/dist/_cjs/pages/pagesInterfaces.js.map +0 -1
- package/dist/_cjs/product-statuses/productStatusesApi.d.ts +0 -38
- package/dist/_cjs/product-statuses/productStatusesApi.js +0 -73
- package/dist/_cjs/product-statuses/productStatusesApi.js.map +0 -1
- package/dist/_cjs/product-statuses/productStatusesInterfaces.d.ts +0 -15
- package/dist/_cjs/product-statuses/productStatusesInterfaces.js +0 -3
- package/dist/_cjs/product-statuses/productStatusesInterfaces.js.map +0 -1
- package/dist/_cjs/products/productsApi.d.ts +0 -195
- package/dist/_cjs/products/productsApi.js +0 -295
- package/dist/_cjs/products/productsApi.js.map +0 -1
- package/dist/_cjs/products/productsInterfaces.d.ts +0 -83
- package/dist/_cjs/products/productsInterfaces.js +0 -3
- package/dist/_cjs/products/productsInterfaces.js.map +0 -1
- package/dist/_cjs/templates/templatesApi.d.ts +0 -32
- package/dist/_cjs/templates/templatesApi.js +0 -72
- package/dist/_cjs/templates/templatesApi.js.map +0 -1
- package/dist/_cjs/templates/templatesInterfaces.d.ts +0 -30
- package/dist/_cjs/templates/templatesInterfaces.js +0 -3
- package/dist/_cjs/templates/templatesInterfaces.js.map +0 -1
- package/dist/_cjs/templates-preview/templatesPreviewApi.d.ts +0 -30
- package/dist/_cjs/templates-preview/templatesPreviewApi.js +0 -60
- package/dist/_cjs/templates-preview/templatesPreviewApi.js.map +0 -1
- package/dist/_cjs/templates-preview/templatesPreviewInterfaces.d.ts +0 -27
- package/dist/_cjs/templates-preview/templatesPreviewInterfaces.js +0 -3
- package/dist/_cjs/templates-preview/templatesPreviewInterfaces.js.map +0 -1
- package/dist/_esm/admins/adminsApi.d.ts +0 -14
- package/dist/_esm/admins/adminsApi.js +0 -31
- package/dist/_esm/admins/adminsApi.js.map +0 -1
- package/dist/_esm/admins/adminsInterfaces.d.ts +0 -32
- package/dist/_esm/admins/adminsInterfaces.js +0 -2
- package/dist/_esm/admins/adminsInterfaces.js.map +0 -1
- package/dist/_esm/attribute-set/attributeSetApi.d.ts +0 -24
- package/dist/_esm/attribute-set/attributeSetApi.js +0 -46
- package/dist/_esm/attribute-set/attributeSetApi.js.map +0 -1
- package/dist/_esm/attribute-set/attributeSetInterfaces.d.ts +0 -23
- package/dist/_esm/attribute-set/attributeSetInterfaces.js +0 -2
- package/dist/_esm/attribute-set/attributeSetInterfaces.js.map +0 -1
- package/dist/_esm/base/oneEntry.d.ts +0 -9
- package/dist/_esm/base/oneEntry.js +0 -52
- package/dist/_esm/base/oneEntry.js.map +0 -1
- package/dist/_esm/base/utils.d.ts +0 -32
- package/dist/_esm/base/utils.js +0 -30
- package/dist/_esm/base/utils.js.map +0 -1
- package/dist/_esm/forms/formsApi.d.ts +0 -26
- package/dist/_esm/forms/formsApi.js +0 -53
- package/dist/_esm/forms/formsApi.js.map +0 -1
- package/dist/_esm/forms/formsInterfaces.d.ts +0 -28
- package/dist/_esm/forms/formsInterfaces.js +0 -2
- package/dist/_esm/forms/formsInterfaces.js.map +0 -1
- package/dist/_esm/formsData/formsDataApi.d.ts +0 -41
- package/dist/_esm/formsData/formsDataApi.js +0 -68
- package/dist/_esm/formsData/formsDataApi.js.map +0 -1
- package/dist/_esm/formsData/formsDataInterfaces.d.ts +0 -25
- package/dist/_esm/formsData/formsDataInterfaces.js +0 -2
- package/dist/_esm/formsData/formsDataInterfaces.js.map +0 -1
- package/dist/_esm/general-types/generalTypesApi.d.ts +0 -14
- package/dist/_esm/general-types/generalTypesApi.js +0 -31
- package/dist/_esm/general-types/generalTypesApi.js.map +0 -1
- package/dist/_esm/general-types/generalTypesInterfaces.d.ts +0 -9
- package/dist/_esm/general-types/generalTypesInterfaces.js +0 -2
- package/dist/_esm/general-types/generalTypesInterfaces.js.map +0 -1
- package/dist/_esm/index.d.ts +0 -35
- package/dist/_esm/index.js +0 -51
- package/dist/_esm/index.js.map +0 -1
- package/dist/_esm/locales/localesApi.d.ts +0 -14
- package/dist/_esm/locales/localesApi.js +0 -31
- package/dist/_esm/locales/localesApi.js.map +0 -1
- package/dist/_esm/locales/localesInterfaces.d.ts +0 -15
- package/dist/_esm/locales/localesInterfaces.js +0 -2
- package/dist/_esm/locales/localesInterfaces.js.map +0 -1
- package/dist/_esm/markers/markersApi.d.ts +0 -35
- package/dist/_esm/markers/markersApi.js +0 -62
- package/dist/_esm/markers/markersApi.js.map +0 -1
- package/dist/_esm/markers/markersInterfaces.d.ts +0 -16
- package/dist/_esm/markers/markersInterfaces.js +0 -2
- package/dist/_esm/markers/markersInterfaces.js.map +0 -1
- package/dist/_esm/menus/menusApi.d.ts +0 -16
- package/dist/_esm/menus/menusApi.js +0 -33
- package/dist/_esm/menus/menusApi.js.map +0 -1
- package/dist/_esm/menus/menusInterfaces.d.ts +0 -18
- package/dist/_esm/menus/menusInterfaces.js +0 -2
- package/dist/_esm/menus/menusInterfaces.js.map +0 -1
- package/dist/_esm/modules/modulesApi.d.ts +0 -14
- package/dist/_esm/modules/modulesApi.js +0 -31
- package/dist/_esm/modules/modulesApi.js.map +0 -1
- package/dist/_esm/modules/modulesInterfaces.d.ts +0 -19
- package/dist/_esm/modules/modulesInterfaces.js +0 -2
- package/dist/_esm/modules/modulesInterfaces.js.map +0 -1
- package/dist/_esm/pages/pagesApi.d.ts +0 -74
- package/dist/_esm/pages/pagesApi.js +0 -134
- package/dist/_esm/pages/pagesApi.js.map +0 -1
- package/dist/_esm/pages/pagesInterfaces.d.ts +0 -39
- package/dist/_esm/pages/pagesInterfaces.js +0 -2
- package/dist/_esm/pages/pagesInterfaces.js.map +0 -1
- package/dist/_esm/product-statuses/productStatusesApi.d.ts +0 -38
- package/dist/_esm/product-statuses/productStatusesApi.js +0 -70
- package/dist/_esm/product-statuses/productStatusesApi.js.map +0 -1
- package/dist/_esm/product-statuses/productStatusesInterfaces.d.ts +0 -15
- package/dist/_esm/product-statuses/productStatusesInterfaces.js +0 -2
- package/dist/_esm/product-statuses/productStatusesInterfaces.js.map +0 -1
- package/dist/_esm/products/productsApi.d.ts +0 -195
- package/dist/_esm/products/productsApi.js +0 -292
- package/dist/_esm/products/productsApi.js.map +0 -1
- package/dist/_esm/products/productsInterfaces.d.ts +0 -83
- package/dist/_esm/products/productsInterfaces.js +0 -2
- package/dist/_esm/products/productsInterfaces.js.map +0 -1
- package/dist/_esm/templates/templatesApi.d.ts +0 -32
- package/dist/_esm/templates/templatesApi.js +0 -69
- package/dist/_esm/templates/templatesApi.js.map +0 -1
- package/dist/_esm/templates/templatesInterfaces.d.ts +0 -30
- package/dist/_esm/templates/templatesInterfaces.js +0 -2
- package/dist/_esm/templates/templatesInterfaces.js.map +0 -1
- package/dist/_esm/templates-preview/templatesPreviewApi.d.ts +0 -30
- package/dist/_esm/templates-preview/templatesPreviewApi.js +0 -57
- package/dist/_esm/templates-preview/templatesPreviewApi.js.map +0 -1
- package/dist/_esm/templates-preview/templatesPreviewInterfaces.d.ts +0 -27
- package/dist/_esm/templates-preview/templatesPreviewInterfaces.js +0 -2
- package/dist/_esm/templates-preview/templatesPreviewInterfaces.js.map +0 -1
- package/dist/_types/admins/adminsApi.d.ts +0 -14
- package/dist/_types/admins/adminsInterfaces.d.ts +0 -32
- package/dist/_types/attribute-set/attributeSetApi.d.ts +0 -24
- package/dist/_types/attribute-set/attributeSetInterfaces.d.ts +0 -23
- package/dist/_types/base/oneEntry.d.ts +0 -9
- package/dist/_types/base/utils.d.ts +0 -32
- package/dist/_types/forms/formsApi.d.ts +0 -26
- package/dist/_types/forms/formsInterfaces.d.ts +0 -28
- package/dist/_types/formsData/formsDataApi.d.ts +0 -41
- package/dist/_types/formsData/formsDataInterfaces.d.ts +0 -25
- package/dist/_types/general-types/generalTypesApi.d.ts +0 -14
- package/dist/_types/general-types/generalTypesInterfaces.d.ts +0 -9
- package/dist/_types/index.d.ts +0 -35
- package/dist/_types/locales/localesApi.d.ts +0 -14
- package/dist/_types/locales/localesInterfaces.d.ts +0 -15
- package/dist/_types/markers/markersApi.d.ts +0 -35
- package/dist/_types/markers/markersInterfaces.d.ts +0 -16
- package/dist/_types/menus/menusApi.d.ts +0 -16
- package/dist/_types/menus/menusInterfaces.d.ts +0 -18
- package/dist/_types/modules/modulesApi.d.ts +0 -14
- package/dist/_types/modules/modulesInterfaces.d.ts +0 -19
- package/dist/_types/pages/pagesApi.d.ts +0 -74
- package/dist/_types/pages/pagesInterfaces.d.ts +0 -39
- package/dist/_types/product-statuses/productStatusesApi.d.ts +0 -38
- package/dist/_types/product-statuses/productStatusesInterfaces.d.ts +0 -15
- package/dist/_types/products/productsApi.d.ts +0 -195
- package/dist/_types/products/productsInterfaces.d.ts +0 -83
- package/dist/_types/templates/templatesApi.d.ts +0 -32
- package/dist/_types/templates/templatesInterfaces.d.ts +0 -30
- package/dist/_types/templates-preview/templatesPreviewApi.d.ts +0 -30
- package/dist/_types/templates-preview/templatesPreviewInterfaces.d.ts +0 -27
- package/dist/admins/adminsApi.js.map +0 -1
- package/dist/admins/adminsInterfaces.js.map +0 -1
- package/dist/attribute-set/AttributeSetApi.d.ts +0 -24
- package/dist/attribute-set/AttributeSetApi.js +0 -49
- package/dist/attribute-set/AttributeSetApi.js.map +0 -1
- package/dist/attribute-set/attributeSetInterfaces.d.ts +0 -23
- package/dist/attribute-set/attributeSetInterfaces.js +0 -3
- package/dist/attribute-set/attributeSetInterfaces.js.map +0 -1
- package/dist/base/attributes.d.ts +0 -6
- package/dist/base/attributes.js +0 -6
- package/dist/base/modules.d.ts +0 -14
- package/dist/base/modules.js +0 -173
- package/dist/base/oneEntry.d.ts +0 -0
- package/dist/base/oneEntry.js +0 -74
- package/dist/base/oneEntry.js.map +0 -1
- package/dist/base/utils.js.map +0 -1
- package/dist/file-uploding/fileUploadingApi.js.map +0 -1
- package/dist/file-uploding/fileUploadingInterfaces.js.map +0 -1
- package/dist/forms/formsApi.js.map +0 -1
- package/dist/forms/formsInterfaces.js.map +0 -1
- package/dist/formsData/formsDataApi.js.map +0 -1
- package/dist/formsData/formsDataInterfaces.js.map +0 -1
- package/dist/general-types/GeneralTypesApi.d.ts +0 -15
- package/dist/general-types/GeneralTypesApi.js +0 -22
- package/dist/general-types/GeneralTypesApi.js.map +0 -1
- package/dist/general-types/generalTypesInterfaces.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/locales/localesApi.js.map +0 -1
- package/dist/locales/localesInterfaces.js.map +0 -1
- package/dist/markers/markersApi.d.ts +0 -37
- package/dist/markers/markersApi.js +0 -50
- package/dist/markers/markersApi.js.map +0 -1
- package/dist/markers/markersInterfaces.d.ts +0 -37
- package/dist/markers/markersInterfaces.js +0 -2
- package/dist/markers/markersInterfaces.js.map +0 -1
- package/dist/menus/menusApi.js.map +0 -1
- package/dist/menus/menusInterfaces.js.map +0 -1
- package/dist/modules/modulesApi.d.ts +0 -14
- package/dist/modules/modulesApi.js +0 -34
- package/dist/modules/modulesApi.js.map +0 -1
- package/dist/modules/modulesInterfaces.d.ts +0 -19
- package/dist/modules/modulesInterfaces.js +0 -3
- package/dist/modules/modulesInterfaces.js.map +0 -1
- package/dist/pages/pagesApi.js.map +0 -1
- package/dist/pages/pagesInterfaces.js.map +0 -1
- package/dist/product-statuses/productStatusesApi.js.map +0 -1
- package/dist/product-statuses/productStatusesInterfaces.js.map +0 -1
- package/dist/products/productsApi.js.map +0 -1
- package/dist/products/productsInterfaces.js.map +0 -1
- package/dist/system/systemApi.js.map +0 -1
- package/dist/system/systemInterfaces.js.map +0 -1
- package/dist/templates/templatesApi.js.map +0 -1
- package/dist/templates/templatesInterfaces.js.map +0 -1
- package/dist/templates-preview/templatesPreviewApi.js.map +0 -1
- package/dist/templates-preview/templatesPreviewInterfaces.js.map +0 -1
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const oneEntry_1 = require("../base/oneEntry");
|
|
13
|
-
/**
|
|
14
|
-
* Controllers for working with product pages
|
|
15
|
-
*/
|
|
16
|
-
class ProductApi extends oneEntry_1.default {
|
|
17
|
-
constructor(url) {
|
|
18
|
-
super(url);
|
|
19
|
-
this._defaultQuery = {
|
|
20
|
-
offset: 0,
|
|
21
|
-
limit: 30,
|
|
22
|
-
statusMarker: null,
|
|
23
|
-
conditionValue: null,
|
|
24
|
-
conditionMarker: null,
|
|
25
|
-
attributeMarker: null,
|
|
26
|
-
langCode: 'en_US',
|
|
27
|
-
sortOrder: 'DESC',
|
|
28
|
-
sortKey: 'id'
|
|
29
|
-
};
|
|
30
|
-
this._url += '/api/content/products';
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Search for all product page objects with pagination and filtering.
|
|
34
|
-
*
|
|
35
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
36
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
37
|
-
*
|
|
38
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
39
|
-
*
|
|
40
|
-
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
|
|
41
|
-
*
|
|
42
|
-
* @param {string} [userQuery.conditionValue] - Optional value that is being searched
|
|
43
|
-
*
|
|
44
|
-
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
|
|
45
|
-
*
|
|
46
|
-
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
47
|
-
*
|
|
48
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
49
|
-
*
|
|
50
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
51
|
-
*
|
|
52
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
53
|
-
*
|
|
54
|
-
* @returns {Promise<IProduct[]>} - List of products.
|
|
55
|
-
*/
|
|
56
|
-
getProducts(userQuery) {
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
59
|
-
const result = yield this._fetchGet('?' + this._queryParamsToString(query));
|
|
60
|
-
return result.items;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Search for all product page objects with pagination that do not have a category.
|
|
65
|
-
*
|
|
66
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
67
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
68
|
-
*
|
|
69
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
70
|
-
*
|
|
71
|
-
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
|
|
72
|
-
*
|
|
73
|
-
* @param {string} [userQuery.conditionValue] - Optional value that is being searched
|
|
74
|
-
*
|
|
75
|
-
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
|
|
76
|
-
*
|
|
77
|
-
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
78
|
-
*
|
|
79
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
80
|
-
*
|
|
81
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
82
|
-
*
|
|
83
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
84
|
-
*
|
|
85
|
-
* @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
86
|
-
*/
|
|
87
|
-
getProductsEmptyPage(userQuery) {
|
|
88
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
90
|
-
const result = yield this._fetchGet('/empty-page?' + this._queryParamsToString(query));
|
|
91
|
-
return result;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Search for all product page objects with pagination for the selected category.
|
|
96
|
-
*
|
|
97
|
-
* @param {number} [id] - Page identifier.
|
|
98
|
-
*
|
|
99
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
100
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
101
|
-
*
|
|
102
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
103
|
-
*
|
|
104
|
-
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
|
|
105
|
-
*
|
|
106
|
-
* @param {string} [userQuery.conditionValue] - Optional value that is being searched
|
|
107
|
-
*
|
|
108
|
-
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
|
|
109
|
-
*
|
|
110
|
-
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
111
|
-
*
|
|
112
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
113
|
-
*
|
|
114
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
115
|
-
*
|
|
116
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
117
|
-
*
|
|
118
|
-
* @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
119
|
-
*/
|
|
120
|
-
getProductsPageById(id, userQuery) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
123
|
-
const result = yield this._fetchGet(`/page/${id}?` + this._queryParamsToString(query));
|
|
124
|
-
return result.items;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Search for all product page objects with pagination for the selected category (by its URL).
|
|
129
|
-
*
|
|
130
|
-
* @param {string} [url] - URL of the category page.
|
|
131
|
-
*
|
|
132
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
133
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
134
|
-
*
|
|
135
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
136
|
-
*
|
|
137
|
-
* @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
|
|
138
|
-
*
|
|
139
|
-
* @param {string} [userQuery.conditionValue] - Optional value that is being searched
|
|
140
|
-
*
|
|
141
|
-
* @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
|
|
142
|
-
*
|
|
143
|
-
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
144
|
-
*
|
|
145
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
146
|
-
*
|
|
147
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
148
|
-
*
|
|
149
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
150
|
-
*
|
|
151
|
-
* @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
152
|
-
*/
|
|
153
|
-
getProductsPageByUrl(url, userQuery) {
|
|
154
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
-
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
156
|
-
const result = yield this._fetchGet(`/page/url/${url}?` + this._queryParamsToString(query));
|
|
157
|
-
return result.items;
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Find all related product page objects.
|
|
162
|
-
*
|
|
163
|
-
* @param {number} [id] - Product page identifier for which to find relationship.
|
|
164
|
-
*
|
|
165
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
166
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
167
|
-
*
|
|
168
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
169
|
-
*
|
|
170
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
171
|
-
*
|
|
172
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
173
|
-
*
|
|
174
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
175
|
-
*
|
|
176
|
-
* @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
177
|
-
*/
|
|
178
|
-
getRelatedProductsById(id, userQuery) {
|
|
179
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
-
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
181
|
-
const result = yield this._fetchGet(`/${id}/related?` + this._queryParamsToString(query));
|
|
182
|
-
return result.items;
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Retrieve one product object.
|
|
187
|
-
*
|
|
188
|
-
* @param {number} [id] - Product id.
|
|
189
|
-
*
|
|
190
|
-
* @param {string | Array<string>} [langCode] Language code parameter. Default "en_US". Нou can also pass several language parameters ['en_US', 'it_IT']
|
|
191
|
-
*
|
|
192
|
-
* @returns {Promise<IProductsEntity>} - Returns ContentIndexedProductDto object for the product.
|
|
193
|
-
*/
|
|
194
|
-
getProductById(id, langCode = 'en_US') {
|
|
195
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
-
const response = yield this._fetchGet(`/${id}?langCode=${langCode}`);
|
|
197
|
-
const product = yield this._normalizeProductData(response, langCode);
|
|
198
|
-
return product;
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Find all product page objects with pagination and multiple filtering.
|
|
203
|
-
*
|
|
204
|
-
* @param {array} [data] - Request body.
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* const objects = [
|
|
208
|
-
* {
|
|
209
|
-
* attributeMarker: "price",
|
|
210
|
-
* conditionMarker: "mth",
|
|
211
|
-
* conditionValue: 1,
|
|
212
|
-
* pageId: 0,
|
|
213
|
-
* },
|
|
214
|
-
* {
|
|
215
|
-
* attributeMarker: "price",
|
|
216
|
-
* conditionMarker: "lth",
|
|
217
|
-
* conditionValue: 3,
|
|
218
|
-
* pageId: 0,
|
|
219
|
-
* },
|
|
220
|
-
* ];
|
|
221
|
-
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
222
|
-
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
223
|
-
*
|
|
224
|
-
* @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
|
|
225
|
-
*
|
|
226
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
227
|
-
*
|
|
228
|
-
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
229
|
-
*
|
|
230
|
-
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
231
|
-
*
|
|
232
|
-
* @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
|
|
233
|
-
*/
|
|
234
|
-
filterProduct(data, userQuery) {
|
|
235
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
-
const query = Object.assign(Object.assign({}, this._defaultQuery), userQuery);
|
|
237
|
-
const result = yield this._fetchPost(`/conditions-filter?` + this._queryParamsToString(query), data);
|
|
238
|
-
return result.items;
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Quick search for product page objects with limited output.
|
|
243
|
-
*
|
|
244
|
-
* @param {string} [name] - Text to search product page objects (search is based on the title field of the localizeInfos object with language consideration)
|
|
245
|
-
*
|
|
246
|
-
* @param {string} [langCode] - Language code
|
|
247
|
-
*
|
|
248
|
-
* @returns {Promise<IProduct[]>} - Returns array of ContentIndexedProductDto object for the product.
|
|
249
|
-
*/
|
|
250
|
-
searchProduct(name, langCode = 'en_US') {
|
|
251
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
252
|
-
const searchProducts = yield this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
|
|
253
|
-
const productsList = [];
|
|
254
|
-
yield Promise.all(searchProducts.map((product) => __awaiter(this, void 0, void 0, function* () {
|
|
255
|
-
yield this.getProductById(product.id).then((result) => {
|
|
256
|
-
productsList.push(result);
|
|
257
|
-
});
|
|
258
|
-
})));
|
|
259
|
-
return productsList;
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Get all attributes of one Product.
|
|
264
|
-
*
|
|
265
|
-
* @param {number} [id] - Product id.
|
|
266
|
-
*
|
|
267
|
-
* @returns {Promise<IProduct[]>} - Returns array of set attributes.
|
|
268
|
-
*/
|
|
269
|
-
getAttributesByProductId(id) {
|
|
270
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
-
const product = yield this.getProductById(id);
|
|
272
|
-
return product.attributeValues;
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
_normalizeProductData(product, langSet) {
|
|
276
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
277
|
-
const normalizeProduct = Object.assign({}, product);
|
|
278
|
-
if (!Array.isArray(langSet)) {
|
|
279
|
-
normalizeProduct.attributeValues = product.attributeValues[langSet];
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
const attrs = [];
|
|
283
|
-
yield Promise.all(langSet.map((lang) => __awaiter(this, void 0, void 0, function* () {
|
|
284
|
-
yield this.getProductById(product.id, lang).then((result) => {
|
|
285
|
-
attrs.push(result.attributeValues);
|
|
286
|
-
});
|
|
287
|
-
})));
|
|
288
|
-
Object.assign(normalizeProduct.attributeValues, ...attrs);
|
|
289
|
-
}
|
|
290
|
-
return normalizeProduct;
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
exports.default = ProductApi;
|
|
295
|
-
//# sourceMappingURL=productsApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../../src/products/productsApi.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ILocalizeInfos } from "../base/utils";
|
|
2
|
-
interface IProductApi {
|
|
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>>;
|
|
11
|
-
getAttributesByProductId(id: number): Promise<any>;
|
|
12
|
-
}
|
|
13
|
-
interface IProduct {
|
|
14
|
-
attributeSetId: number | null;
|
|
15
|
-
attributeValues: object | null;
|
|
16
|
-
id: number;
|
|
17
|
-
isSync: number;
|
|
18
|
-
isVisible: boolean;
|
|
19
|
-
localizeInfos: object;
|
|
20
|
-
position: number;
|
|
21
|
-
price?: number;
|
|
22
|
-
relatedIds: number[];
|
|
23
|
-
shortDescTemplateIdentifier: string | number | null;
|
|
24
|
-
statusId: number | null;
|
|
25
|
-
templateIdentifier: string | number | null;
|
|
26
|
-
}
|
|
27
|
-
interface IProductsQuery {
|
|
28
|
-
offset?: number;
|
|
29
|
-
limit?: number;
|
|
30
|
-
statusMarker?: string | null;
|
|
31
|
-
conditionValue?: string | null;
|
|
32
|
-
/**
|
|
33
|
-
* 'in' - Contains,
|
|
34
|
-
* 'nin' - Does not contain,
|
|
35
|
-
* 'eq' - Equal,
|
|
36
|
-
* 'neq' - Not equal,
|
|
37
|
-
* 'mth' - Greater than,
|
|
38
|
-
* 'lth' - Less than,
|
|
39
|
-
* 'exs' - Exists,
|
|
40
|
-
* 'nexs' - Does not exist
|
|
41
|
-
*/
|
|
42
|
-
conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
|
|
43
|
-
attributeMarker?: string | null;
|
|
44
|
-
sortOrder?: 'DESC' | 'ASC';
|
|
45
|
-
langCode?: string;
|
|
46
|
-
sortKey?: string;
|
|
47
|
-
[key: string]: string | number | null;
|
|
48
|
-
}
|
|
49
|
-
interface IFilterParams {
|
|
50
|
-
attributeMarker: string;
|
|
51
|
-
conditionMarker: string;
|
|
52
|
-
conditionValue: number;
|
|
53
|
-
pageId?: number;
|
|
54
|
-
}
|
|
55
|
-
interface IProductsEntity {
|
|
56
|
-
id: number;
|
|
57
|
-
localizeInfos: ILocalizeInfos;
|
|
58
|
-
isVisible: boolean;
|
|
59
|
-
statusId: number;
|
|
60
|
-
relatedIds: number[];
|
|
61
|
-
productPages: {
|
|
62
|
-
id: number;
|
|
63
|
-
pageId: number;
|
|
64
|
-
productId: number;
|
|
65
|
-
}[];
|
|
66
|
-
attributeSetId: number;
|
|
67
|
-
version: number;
|
|
68
|
-
isSync: number | boolean;
|
|
69
|
-
price: number;
|
|
70
|
-
templateIdentifier: string;
|
|
71
|
-
shortDescTemplateIdentifier: string;
|
|
72
|
-
/**
|
|
73
|
-
* Language-specific attribute values.
|
|
74
|
-
* @example attributeValues['en_US']
|
|
75
|
-
*
|
|
76
|
-
* @property {langCode.<object>}
|
|
77
|
-
*/
|
|
78
|
-
attributeValues: {
|
|
79
|
-
[langCode: string]: object;
|
|
80
|
-
};
|
|
81
|
-
position: number;
|
|
82
|
-
}
|
|
83
|
-
export { IFilterParams, IProductsQuery, IProduct, IProductApi, IProductsEntity };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"productsInterfaces.js","sourceRoot":"","sources":["../../../src/products/productsInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import OneEntry from '../base/oneEntry';
|
|
2
|
-
import { ITemplatesApi, ITemplateEntity } from './templatesInterfaces';
|
|
3
|
-
/**
|
|
4
|
-
* Controllers for working with template objects
|
|
5
|
-
*/
|
|
6
|
-
export default class TemplatesPreviewApi extends OneEntry implements ITemplatesApi {
|
|
7
|
-
constructor(url: string);
|
|
8
|
-
/**
|
|
9
|
-
* Get all template objects grouped by types.
|
|
10
|
-
*
|
|
11
|
-
* @param {number} [id] - Status id
|
|
12
|
-
*
|
|
13
|
-
* @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
14
|
-
*/
|
|
15
|
-
getAllTemplates(): Promise<Array<ITemplateEntity>>;
|
|
16
|
-
/**
|
|
17
|
-
* Get one template object by id.
|
|
18
|
-
*
|
|
19
|
-
* @param {number} [id] - Product marker
|
|
20
|
-
*
|
|
21
|
-
* @returns Returns a TemplateEntity object
|
|
22
|
-
*/
|
|
23
|
-
getTemplateById(id: number): Promise<ITemplateEntity>;
|
|
24
|
-
/**
|
|
25
|
-
* Get a single template object by marker.
|
|
26
|
-
*
|
|
27
|
-
* @param {string} [marker] - Product marker
|
|
28
|
-
*
|
|
29
|
-
* @returns Returns a TemplateEntity object
|
|
30
|
-
*/
|
|
31
|
-
getTemplateByMarker(marker: string): Promise<ITemplateEntity>;
|
|
32
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const oneEntry_1 = require("../base/oneEntry");
|
|
13
|
-
/**
|
|
14
|
-
* Controllers for working with template objects
|
|
15
|
-
*/
|
|
16
|
-
class TemplatesPreviewApi extends oneEntry_1.default {
|
|
17
|
-
constructor(url) {
|
|
18
|
-
super(url);
|
|
19
|
-
this._url += '/api/content/templates';
|
|
20
|
-
}
|
|
21
|
-
// /**
|
|
22
|
-
// * Get all template objects of a specific type.
|
|
23
|
-
// *
|
|
24
|
-
// * @returns Returns an array of product status objects
|
|
25
|
-
// */
|
|
26
|
-
// public async getTemplatesByType(type:string):Promise<Array<ITemplateEntity>> {
|
|
27
|
-
// //TODO уточнить парметр type
|
|
28
|
-
// const result = await this._fetchGet(`?type=${type}`)
|
|
29
|
-
// return result
|
|
30
|
-
// }
|
|
31
|
-
/**
|
|
32
|
-
* Get all template objects grouped by types.
|
|
33
|
-
*
|
|
34
|
-
* @param {number} [id] - Status id
|
|
35
|
-
*
|
|
36
|
-
* @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
37
|
-
*/
|
|
38
|
-
getAllTemplates() {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const result = yield this._fetchGet('/all');
|
|
41
|
-
return result;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Get one template object by id.
|
|
46
|
-
*
|
|
47
|
-
* @param {number} [id] - Product marker
|
|
48
|
-
*
|
|
49
|
-
* @returns Returns a TemplateEntity object
|
|
50
|
-
*/
|
|
51
|
-
getTemplateById(id) {
|
|
52
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const result = yield this._fetchGet(`/${id}`);
|
|
54
|
-
return result;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Get a single template object by marker.
|
|
59
|
-
*
|
|
60
|
-
* @param {string} [marker] - Product marker
|
|
61
|
-
*
|
|
62
|
-
* @returns Returns a TemplateEntity object
|
|
63
|
-
*/
|
|
64
|
-
getTemplateByMarker(marker) {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
const result = yield this._fetchGet(`/marker/${marker}`);
|
|
67
|
-
return result;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.default = TemplatesPreviewApi;
|
|
72
|
-
//# sourceMappingURL=templatesApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templatesApi.js","sourceRoot":"","sources":["../../../src/templates/templatesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAuC;AAGvC;;GAEG;AACH,MAAqB,mBAAoB,SAAQ,kBAAQ;IACrD,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,wBAAwB,CAAA;IACzC,CAAC;IAED,MAAM;IACN,kDAAkD;IAClD,KAAK;IACL,yDAAyD;IACzD,MAAM;IACN,iFAAiF;IACjF,mCAAmC;IACnC,2DAA2D;IAC3D,oBAAoB;IACpB,IAAI;IAEJ;;;;;;OAMG;IACU,eAAe;;YACxB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YAC3C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,eAAe,CAAC,EAAS;;YAClC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;YAC7C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,mBAAmB,CAAC,MAAa;;YAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CACJ;AApDD,sCAoDC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IGeneralTypesEntity } from "../general-types/generalTypesInterfaces";
|
|
2
|
-
import { ILocalizeInfos } from "../base/utils";
|
|
3
|
-
interface ITemplatesApi {
|
|
4
|
-
getAllTemplates(): Promise<Array<ITemplateEntity>>;
|
|
5
|
-
getTemplateById(id: number): Promise<ITemplateEntity>;
|
|
6
|
-
getTemplateByMarker(marker: string): Promise<ITemplateEntity>;
|
|
7
|
-
}
|
|
8
|
-
interface ITemplateEntity {
|
|
9
|
-
id: number;
|
|
10
|
-
updatedDate: string;
|
|
11
|
-
version: number;
|
|
12
|
-
identifier: string;
|
|
13
|
-
attributesSets: {
|
|
14
|
-
[key: string]: string;
|
|
15
|
-
};
|
|
16
|
-
attributeSetId: number;
|
|
17
|
-
generalType: IGeneralTypesEntity;
|
|
18
|
-
generalTypeId: number;
|
|
19
|
-
localizeInfos: ILocalizeInfos;
|
|
20
|
-
position: {
|
|
21
|
-
id: number;
|
|
22
|
-
position: number | string;
|
|
23
|
-
objectId: number;
|
|
24
|
-
objectType: string;
|
|
25
|
-
isLocked: boolean;
|
|
26
|
-
objectCategoryId: number;
|
|
27
|
-
};
|
|
28
|
-
positionId: number | string;
|
|
29
|
-
}
|
|
30
|
-
export { ITemplatesApi, ITemplateEntity };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templatesInterfaces.js","sourceRoot":"","sources":["../../../src/templates/templatesInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import OneEntry from "../base/oneEntry";
|
|
2
|
-
import { ITemplatesPreview, ITemplatesPreviewEntity } from "./templatesPreviewInterfaces";
|
|
3
|
-
/**
|
|
4
|
-
* Controllers for working with template objects for preview
|
|
5
|
-
*/
|
|
6
|
-
export default class PageApi extends OneEntry implements ITemplatesPreview {
|
|
7
|
-
constructor(url: string);
|
|
8
|
-
/**
|
|
9
|
-
* Get all template objects.
|
|
10
|
-
*
|
|
11
|
-
* @returns Returns all TemplatePreviewsEntity template objects
|
|
12
|
-
*/
|
|
13
|
-
getTemplatesPreview(): Promise<Array<ITemplatesPreviewEntity>>;
|
|
14
|
-
/**
|
|
15
|
-
* Get one template object by id.
|
|
16
|
-
*
|
|
17
|
-
* @param {number} [id] - Product marker
|
|
18
|
-
*
|
|
19
|
-
* @returns Returns a TemplatePreviewsEntity object
|
|
20
|
-
*/
|
|
21
|
-
getTemplatesPreviewById(id: number): Promise<ITemplatesPreviewEntity>;
|
|
22
|
-
/**
|
|
23
|
-
* Get one template object by marker.
|
|
24
|
-
*
|
|
25
|
-
* @param {string} [marker] - Product marker
|
|
26
|
-
*
|
|
27
|
-
* @returns Returns a TemplatePreviewsEntity object
|
|
28
|
-
*/
|
|
29
|
-
getTemplatesPreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
|
|
30
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const oneEntry_1 = require("../base/oneEntry");
|
|
13
|
-
/**
|
|
14
|
-
* Controllers for working with template objects for preview
|
|
15
|
-
*/
|
|
16
|
-
class PageApi extends oneEntry_1.default {
|
|
17
|
-
constructor(url) {
|
|
18
|
-
super(url);
|
|
19
|
-
this._url += '/api/content/template-previews';
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get all template objects.
|
|
23
|
-
*
|
|
24
|
-
* @returns Returns all TemplatePreviewsEntity template objects
|
|
25
|
-
*/
|
|
26
|
-
getTemplatesPreview() {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const result = yield this._fetchGet('');
|
|
29
|
-
return result;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get one template object by id.
|
|
34
|
-
*
|
|
35
|
-
* @param {number} [id] - Product marker
|
|
36
|
-
*
|
|
37
|
-
* @returns Returns a TemplatePreviewsEntity object
|
|
38
|
-
*/
|
|
39
|
-
getTemplatesPreviewById(id) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const result = yield this._fetchGet(`/${id}`);
|
|
42
|
-
return result;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Get one template object by marker.
|
|
47
|
-
*
|
|
48
|
-
* @param {string} [marker] - Product marker
|
|
49
|
-
*
|
|
50
|
-
* @returns Returns a TemplatePreviewsEntity object
|
|
51
|
-
*/
|
|
52
|
-
getTemplatesPreviewByMarker(marker) {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
const result = yield this._fetchGet(`/marker/${marker}`);
|
|
55
|
-
return result;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.default = PageApi;
|
|
60
|
-
//# sourceMappingURL=templatesPreviewApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templatesPreviewApi.js","sourceRoot":"","sources":["../../../src/templates-preview/templatesPreviewApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,OAAQ,SAAQ,kBAAQ;IACzC,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,gCAAgC,CAAA;IACjD,CAAC;IAED;;;;OAIG;IACU,mBAAmB;;YAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACvC,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,uBAAuB,CAAC,EAAS;;YAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;YAC7C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,2BAA2B,CAAC,MAAa;;YAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CACJ;AAvCD,0BAuCC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ILocalizeInfos } from "../base/utils";
|
|
2
|
-
interface ITemplatesPreview {
|
|
3
|
-
getTemplatesPreview(): Promise<Array<ITemplatesPreviewEntity>>;
|
|
4
|
-
getTemplatesPreviewById(id: number): Promise<ITemplatesPreviewEntity>;
|
|
5
|
-
getTemplatesPreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
|
|
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 };
|