oneentry 1.0.0
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 +324 -0
- package/dist/admins/adminsApi.d.ts +14 -0
- package/dist/admins/adminsApi.js +34 -0
- package/dist/admins/adminsApi.js.map +1 -0
- package/dist/admins/adminsInterfaces.d.ts +4 -0
- package/dist/admins/adminsInterfaces.js +3 -0
- package/dist/admins/adminsInterfaces.js.map +1 -0
- package/dist/attribute-set/AttributeSetApi.d.ts +24 -0
- package/dist/attribute-set/AttributeSetApi.js +49 -0
- package/dist/attribute-set/AttributeSetApi.js.map +1 -0
- package/dist/attribute-set/attributeSetInterfaces.d.ts +5 -0
- package/dist/attribute-set/attributeSetInterfaces.js +3 -0
- package/dist/attribute-set/attributeSetInterfaces.js.map +1 -0
- package/dist/base/oneEntry.d.ts +9 -0
- package/dist/base/oneEntry.js +55 -0
- package/dist/base/oneEntry.js.map +1 -0
- package/dist/general-types/GeneralTypesApi.d.ts +14 -0
- package/dist/general-types/GeneralTypesApi.js +34 -0
- package/dist/general-types/GeneralTypesApi.js.map +1 -0
- package/dist/general-types/generalTypesInterfaces.d.ts +4 -0
- package/dist/general-types/generalTypesInterfaces.js +3 -0
- package/dist/general-types/generalTypesInterfaces.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/locales/localesApi.d.ts +14 -0
- package/dist/locales/localesApi.js +34 -0
- package/dist/locales/localesApi.js.map +1 -0
- package/dist/locales/localesInterfaces.d.ts +4 -0
- package/dist/locales/localesInterfaces.js +3 -0
- package/dist/locales/localesInterfaces.js.map +1 -0
- package/dist/markers/markersApi.d.ts +35 -0
- package/dist/markers/markersApi.js +65 -0
- package/dist/markers/markersApi.js.map +1 -0
- package/dist/markers/markersInterfaces.d.ts +6 -0
- package/dist/markers/markersInterfaces.js +3 -0
- package/dist/markers/markersInterfaces.js.map +1 -0
- package/dist/menus/menusApi.d.ts +16 -0
- package/dist/menus/menusApi.js +36 -0
- package/dist/menus/menusApi.js.map +1 -0
- package/dist/menus/menusInterfaces.d.ts +4 -0
- package/dist/menus/menusInterfaces.js +3 -0
- package/dist/menus/menusInterfaces.js.map +1 -0
- package/dist/modules/modulesApi.d.ts +14 -0
- package/dist/modules/modulesApi.js +34 -0
- package/dist/modules/modulesApi.js.map +1 -0
- package/dist/modules/modulesInterfaces.d.ts +4 -0
- package/dist/modules/modulesInterfaces.js +3 -0
- package/dist/modules/modulesInterfaces.js.map +1 -0
- package/dist/pages/pagesApi.d.ts +72 -0
- package/dist/pages/pagesApi.js +128 -0
- package/dist/pages/pagesApi.js.map +1 -0
- package/dist/pages/pagesInterfaces.d.ts +15 -0
- package/dist/pages/pagesInterfaces.js +3 -0
- package/dist/pages/pagesInterfaces.js.map +1 -0
- package/dist/product-statuses/productStatusesApi.d.ts +38 -0
- package/dist/product-statuses/productStatusesApi.js +73 -0
- package/dist/product-statuses/productStatusesApi.js.map +1 -0
- package/dist/product-statuses/productStatusesInterfaces.d.ts +7 -0
- package/dist/product-statuses/productStatusesInterfaces.js +3 -0
- package/dist/product-statuses/productStatusesInterfaces.js.map +1 -0
- package/dist/products/productsApi.d.ts +181 -0
- package/dist/products/productsApi.js +262 -0
- package/dist/products/productsApi.js.map +1 -0
- package/dist/products/productsInterfaces.d.ts +43 -0
- package/dist/products/productsInterfaces.js +3 -0
- package/dist/products/productsInterfaces.js.map +1 -0
- package/dist/templates/templatesApi.d.ts +38 -0
- package/dist/templates/templatesApi.js +74 -0
- package/dist/templates/templatesApi.js.map +1 -0
- package/dist/templates/templatesInterfaces.d.ts +7 -0
- package/dist/templates/templatesInterfaces.js +3 -0
- package/dist/templates/templatesInterfaces.js.map +1 -0
- package/dist/templates-preview/templatesPreviewApi.d.ts +30 -0
- package/dist/templates-preview/templatesPreviewApi.js +60 -0
- package/dist/templates-preview/templatesPreviewApi.js.map +1 -0
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +6 -0
- package/dist/templates-preview/templatesPreviewInterfaces.js +3 -0
- package/dist/templates-preview/templatesPreviewInterfaces.js.map +1 -0
- package/package.json +19 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineOneEntry = void 0;
|
|
4
|
+
const productsApi_1 = require("./products/productsApi");
|
|
5
|
+
const pagesApi_1 = require("./pages/pagesApi");
|
|
6
|
+
const productStatusesApi_1 = require("./product-statuses/productStatusesApi");
|
|
7
|
+
const templatesApi_1 = require("./templates/templatesApi");
|
|
8
|
+
const templatesPreviewApi_1 = require("./templates-preview/templatesPreviewApi");
|
|
9
|
+
const markersApi_1 = require("./markers/markersApi");
|
|
10
|
+
const attributeSetApi_1 = require("./attribute-set/attributeSetApi");
|
|
11
|
+
const adminsApi_1 = require("./admins/adminsApi");
|
|
12
|
+
const generalTypesApi_1 = require("./general-types/generalTypesApi");
|
|
13
|
+
const localesApi_1 = require("./locales/localesApi");
|
|
14
|
+
const menusApi_1 = require("./menus/menusApi");
|
|
15
|
+
const modulesApi_1 = require("./modules/modulesApi");
|
|
16
|
+
/**
|
|
17
|
+
* Define API.
|
|
18
|
+
* @param {string} url - URl of your project.
|
|
19
|
+
* @returns {IDefineApi} - List of methods set.
|
|
20
|
+
*/
|
|
21
|
+
function defineOneEntry(url) {
|
|
22
|
+
const Product = new productsApi_1.default(url);
|
|
23
|
+
const Page = new pagesApi_1.default(url);
|
|
24
|
+
const ProductStatus = new productStatusesApi_1.default(url);
|
|
25
|
+
const Templates = new templatesApi_1.default(url);
|
|
26
|
+
const TemplatesPreview = new templatesPreviewApi_1.default(url);
|
|
27
|
+
const Markers = new markersApi_1.default(url);
|
|
28
|
+
const AttributeSet = new attributeSetApi_1.default(url);
|
|
29
|
+
const Admins = new adminsApi_1.default(url);
|
|
30
|
+
const GeneralTypes = new generalTypesApi_1.default(url);
|
|
31
|
+
const Locales = new localesApi_1.default(url);
|
|
32
|
+
const Menus = new menusApi_1.default(url);
|
|
33
|
+
const Modules = new modulesApi_1.default(url);
|
|
34
|
+
return {
|
|
35
|
+
Product,
|
|
36
|
+
Page,
|
|
37
|
+
ProductStatus,
|
|
38
|
+
Templates,
|
|
39
|
+
TemplatesPreview,
|
|
40
|
+
Markers,
|
|
41
|
+
AttributeSet,
|
|
42
|
+
Admins,
|
|
43
|
+
GeneralTypes,
|
|
44
|
+
Locales,
|
|
45
|
+
Menus,
|
|
46
|
+
Modules
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
exports.defineOneEntry = defineOneEntry;
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wDAA+C;AAC/C,+CAAuC;AACvC,8EAAuE;AACvE,2DAAoD;AACpD,iFAA0E;AAC1E,qDAA8C;AAC9C,qEAA8D;AAC9D,kDAA0C;AAC1C,qEAA6D;AAC7D,qDAA6C;AAC7C,+CAAwC;AACxC,qDAA8C;AAiB9C;;;;GAIG;AACH,SAAgB,cAAc,CAAC,GAAU;IACrC,MAAM,OAAO,GAAc,IAAI,qBAAU,CAAC,GAAG,CAAC,CAAA;IAC9C,MAAM,IAAI,GAAW,IAAI,kBAAO,CAAC,GAAG,CAAC,CAAA;IACrC,MAAM,aAAa,GAAsB,IAAI,4BAAkB,CAAC,GAAG,CAAC,CAAA;IACpE,MAAM,SAAS,GAAiB,IAAI,sBAAY,CAAC,GAAG,CAAC,CAAA;IACrD,MAAM,gBAAgB,GAAwB,IAAI,6BAAmB,CAAC,GAAG,CAAC,CAAA;IAC1E,MAAM,OAAO,GAAe,IAAI,oBAAU,CAAC,GAAG,CAAC,CAAA;IAC/C,MAAM,YAAY,GAAoB,IAAI,yBAAe,CAAC,GAAG,CAAC,CAAA;IAC9D,MAAM,MAAM,GAAc,IAAI,mBAAS,CAAC,GAAG,CAAC,CAAA;IAC5C,MAAM,YAAY,GAAqB,IAAI,yBAAe,CAAC,GAAG,CAAC,CAAA;IAC/D,MAAM,OAAO,GAAe,IAAI,oBAAU,CAAC,GAAG,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAa,IAAI,kBAAQ,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,OAAO,GAAe,IAAI,oBAAU,CAAC,GAAG,CAAC,CAAA;IAE/C,OAAO;QACH,OAAO;QACP,IAAI;QACJ,aAAa;QACb,SAAS;QACT,gBAAgB;QAChB,OAAO;QACP,YAAY;QACZ,MAAM;QACN,YAAY;QACZ,OAAO;QACP,KAAK;QACL,OAAO;KACV,CAAA;AACL,CAAC;AA5BD,wCA4BC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import OneEntry from "../base/oneEntry";
|
|
2
|
+
import { ILocales } from "./localesInterfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Controllers for working with localizations (content language)
|
|
5
|
+
*/
|
|
6
|
+
export default class LocalesApi extends OneEntry implements ILocales {
|
|
7
|
+
constructor(url: string);
|
|
8
|
+
/**
|
|
9
|
+
* Find all active language localization objects.
|
|
10
|
+
*
|
|
11
|
+
* @returns Returns an array of LocaleEntity objects
|
|
12
|
+
*/
|
|
13
|
+
getLocales(): Promise<any>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 localizations (content language)
|
|
15
|
+
*/
|
|
16
|
+
class LocalesApi extends oneEntry_1.default {
|
|
17
|
+
constructor(url) {
|
|
18
|
+
super(url);
|
|
19
|
+
this._url += '/api/content/locales';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Find all active language localization objects.
|
|
23
|
+
*
|
|
24
|
+
* @returns Returns an array of LocaleEntity objects
|
|
25
|
+
*/
|
|
26
|
+
getLocales() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const result = yield this._fetchGet('/active/all');
|
|
29
|
+
return result;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = LocalesApi;
|
|
34
|
+
//# sourceMappingURL=localesApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localesApi.js","sourceRoot":"","sources":["../../src/locales/localesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,UAAW,SAAQ,kBAAQ;IAC5C,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,sBAAsB,CAAA;IACvC,CAAC;IAED;;;;OAIG;IACU,UAAU;;YACnB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;YAClD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CAEJ;AAhBD,6BAgBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localesInterfaces.js","sourceRoot":"","sources":["../../src/locales/localesInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import OneEntry from '../base/oneEntry';
|
|
2
|
+
import { IMarkersApi } from "./markersInterfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Controllers for working with markers objects
|
|
5
|
+
*/
|
|
6
|
+
export default class TemplatesPreviewApi extends OneEntry implements IMarkersApi {
|
|
7
|
+
constructor(url: string);
|
|
8
|
+
/**
|
|
9
|
+
* Get one marker object by marker.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} [marker] - Text identifier (marker) of the marker object
|
|
12
|
+
*
|
|
13
|
+
* @returns
|
|
14
|
+
* Returns one MarkerEntity marker object
|
|
15
|
+
*/
|
|
16
|
+
getMarker(marker: string): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* Get all marker objects.
|
|
19
|
+
*
|
|
20
|
+
* @param {number} [limit] - Parameter for limiting the selection of records, by default - 30
|
|
21
|
+
*
|
|
22
|
+
* @param {number} [offset] - Parameter for offset of records selection, default - 0
|
|
23
|
+
*
|
|
24
|
+
* @returns Returns an object ItemsWithTotal, where items is an array of MarkerEntity objects, total - the total number of markers found
|
|
25
|
+
*/
|
|
26
|
+
getMarkers(limit?: number, offset?: number): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Get one marker object.
|
|
29
|
+
*
|
|
30
|
+
* @param {number} [id] - Identifier of marker object
|
|
31
|
+
*
|
|
32
|
+
* @returns Returns one marker object MarkerEntity
|
|
33
|
+
*/
|
|
34
|
+
getMarkersById(id: number): Promise<any>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 markers objects
|
|
15
|
+
*/
|
|
16
|
+
class TemplatesPreviewApi extends oneEntry_1.default {
|
|
17
|
+
constructor(url) {
|
|
18
|
+
super(url);
|
|
19
|
+
this._url += '/api/content/markers';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get one marker object by marker.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} [marker] - Text identifier (marker) of the marker object
|
|
25
|
+
*
|
|
26
|
+
* @returns
|
|
27
|
+
* Returns one MarkerEntity marker object
|
|
28
|
+
*/
|
|
29
|
+
getMarker(marker) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const result = yield this._fetchGet(`/marker/${marker}`);
|
|
32
|
+
return result;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get all marker objects.
|
|
37
|
+
*
|
|
38
|
+
* @param {number} [limit] - Parameter for limiting the selection of records, by default - 30
|
|
39
|
+
*
|
|
40
|
+
* @param {number} [offset] - Parameter for offset of records selection, default - 0
|
|
41
|
+
*
|
|
42
|
+
* @returns Returns an object ItemsWithTotal, where items is an array of MarkerEntity objects, total - the total number of markers found
|
|
43
|
+
*/
|
|
44
|
+
getMarkers(limit = 30, offset = 0) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const result = yield this._fetchGet(`?limit=${limit}&offset=${offset}`);
|
|
47
|
+
return result;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get one marker object.
|
|
52
|
+
*
|
|
53
|
+
* @param {number} [id] - Identifier of marker object
|
|
54
|
+
*
|
|
55
|
+
* @returns Returns one marker object MarkerEntity
|
|
56
|
+
*/
|
|
57
|
+
getMarkersById(id) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const result = yield this._fetchGet(`/${id}`);
|
|
60
|
+
return result;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = TemplatesPreviewApi;
|
|
65
|
+
//# sourceMappingURL=markersApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markersApi.js","sourceRoot":"","sources":["../../src/markers/markersApi.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,sBAAsB,CAAA;IACvC,CAAC;IAED;;;;;;;OAOG;IACU,SAAS,CAAC,MAAa;;YAChC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,UAAU,CAAC,QAAe,EAAE,EAAE,SAAgB,CAAC;;YACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,KAAK,WAAW,MAAM,EAAE,CAAC,CAAA;YACvE,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,cAAc,CAAC,EAAS;;YACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;YAC7C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CACJ;AA5CD,sCA4CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markersInterfaces.js","sourceRoot":"","sources":["../../src/markers/markersInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import OneEntry from "../base/oneEntry";
|
|
2
|
+
import { IMenus } from "./menusInterfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Controllers for working with menu objects
|
|
5
|
+
*/
|
|
6
|
+
export default class MenusApi extends OneEntry implements IMenus {
|
|
7
|
+
constructor(url: string);
|
|
8
|
+
/**
|
|
9
|
+
* Get pages includes in menu by marker.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} [marker] - Menu marker
|
|
12
|
+
*
|
|
13
|
+
* @returns Returns a single menu object as a ContentMenuDto object with included pages
|
|
14
|
+
*/
|
|
15
|
+
getMenusByMarker(marker: string): Promise<any>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 menu objects
|
|
15
|
+
*/
|
|
16
|
+
class MenusApi extends oneEntry_1.default {
|
|
17
|
+
constructor(url) {
|
|
18
|
+
super(url);
|
|
19
|
+
this._url += '/api/content/menus';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get pages includes in menu by marker.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} [marker] - Menu marker
|
|
25
|
+
*
|
|
26
|
+
* @returns Returns a single menu object as a ContentMenuDto object with included pages
|
|
27
|
+
*/
|
|
28
|
+
getMenusByMarker(marker) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const result = yield this._fetchGet(`/marker/${marker}`);
|
|
31
|
+
return result;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = MenusApi;
|
|
36
|
+
//# sourceMappingURL=menusApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menusApi.js","sourceRoot":"","sources":["../../src/menus/menusApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,QAAS,SAAQ,kBAAQ;IAC1C,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;;;OAMG;IACU,gBAAgB,CAAC,MAAa;;YACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CAEJ;AAlBD,2BAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menusInterfaces.js","sourceRoot":"","sources":["../../src/menus/menusInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import OneEntry from "../base/oneEntry";
|
|
2
|
+
import { IModules } from "./modulesInterfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Controllers for working with application modules
|
|
5
|
+
*/
|
|
6
|
+
export default class ModulesApi extends OneEntry implements IModules {
|
|
7
|
+
constructor(url: string);
|
|
8
|
+
/**
|
|
9
|
+
* Get all modules.
|
|
10
|
+
*
|
|
11
|
+
* @returns Returns BaseModuleDto objects or an empty array [] if there is no data
|
|
12
|
+
*/
|
|
13
|
+
getAllModules(): Promise<any>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 application modules
|
|
15
|
+
*/
|
|
16
|
+
class ModulesApi extends oneEntry_1.default {
|
|
17
|
+
constructor(url) {
|
|
18
|
+
super(url);
|
|
19
|
+
this._url += '/api/content/modules';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get all modules.
|
|
23
|
+
*
|
|
24
|
+
* @returns Returns BaseModuleDto objects or an empty array [] if there is no data
|
|
25
|
+
*/
|
|
26
|
+
getAllModules() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const result = yield this._fetchGet('');
|
|
29
|
+
return result;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = ModulesApi;
|
|
34
|
+
//# sourceMappingURL=modulesApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modulesApi.js","sourceRoot":"","sources":["../../src/modules/modulesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,UAAW,SAAQ,kBAAQ;IAC5C,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,sBAAsB,CAAA;IACvC,CAAC;IAED;;;;OAIG;IACU,aAAa;;YACtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACvC,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CAEJ;AAhBD,6BAgBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modulesInterfaces.js","sourceRoot":"","sources":["../../src/modules/modulesInterfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import OneEntry from "../base/oneEntry";
|
|
2
|
+
import { IPageApi, IPageConfig } from "./pagesInterfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Controllers for working with page objects, including catalog pages
|
|
5
|
+
*/
|
|
6
|
+
export default class PageApi extends OneEntry implements IPageApi {
|
|
7
|
+
constructor(url: string);
|
|
8
|
+
/**
|
|
9
|
+
* Get all top-level page objects.
|
|
10
|
+
*
|
|
11
|
+
* @returns Returns all created pages without parents as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
12
|
+
*/
|
|
13
|
+
getRootPages(): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Get all page objects with product information as an array.
|
|
16
|
+
*
|
|
17
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
18
|
+
*
|
|
19
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
20
|
+
*
|
|
21
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
22
|
+
*/
|
|
23
|
+
getCatalogPages(limit?: number, offset?: number): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Get all page objects with product information as an array.
|
|
26
|
+
*
|
|
27
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
28
|
+
*/
|
|
29
|
+
getPages(): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
32
|
+
*
|
|
33
|
+
* @param {number} [id] - Page object identifier
|
|
34
|
+
*
|
|
35
|
+
* @returns Returns page object (DTO depends on the type of page being returned)
|
|
36
|
+
*/
|
|
37
|
+
getPageById(id: number): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} [url] - Page URL
|
|
42
|
+
*
|
|
43
|
+
* @returns Returns page object (DTO depends on the type of page being returned)
|
|
44
|
+
*/
|
|
45
|
+
getPageByUrl(url: string): Promise<any>;
|
|
46
|
+
/**
|
|
47
|
+
* Get child pages object with information as an array.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} [url] - Page URL
|
|
50
|
+
*
|
|
51
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data) for the selected parent
|
|
52
|
+
*/
|
|
53
|
+
getChildPagesByParentUrl(url: string): Promise<any>;
|
|
54
|
+
/**
|
|
55
|
+
* Get settings for the page.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} [url] - Page URL
|
|
58
|
+
*
|
|
59
|
+
* @returns Returns a ConfigPageDto object with page display settings
|
|
60
|
+
*/
|
|
61
|
+
getConfigPageByUrl(url: string): Promise<IPageConfig>;
|
|
62
|
+
/**
|
|
63
|
+
* Quick search for page objects with limited output.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} [name] - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account)
|
|
66
|
+
*
|
|
67
|
+
* @param {string} [lang] - Language code. Example : en_US
|
|
68
|
+
*
|
|
69
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
70
|
+
*/
|
|
71
|
+
searchPage(name: string, lang?: string): Promise<any>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
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 page objects, including catalog pages
|
|
15
|
+
*/
|
|
16
|
+
class PageApi extends oneEntry_1.default {
|
|
17
|
+
constructor(url) {
|
|
18
|
+
super(url);
|
|
19
|
+
this._url += '/api/content/pages';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get all top-level page objects.
|
|
23
|
+
*
|
|
24
|
+
* @returns Returns all created pages without parents as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
25
|
+
*/
|
|
26
|
+
getRootPages() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const result = yield this._fetchGet('/root');
|
|
29
|
+
return result;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get all page objects with product information as an array.
|
|
34
|
+
*
|
|
35
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 30
|
|
36
|
+
*
|
|
37
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
38
|
+
*
|
|
39
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
40
|
+
*/
|
|
41
|
+
getCatalogPages(limit = 30, offset = 0) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
//TODO Query parameters
|
|
44
|
+
const result = yield this._fetchGet('/catalog');
|
|
45
|
+
return result;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get all page objects with product information as an array.
|
|
50
|
+
*
|
|
51
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
52
|
+
*/
|
|
53
|
+
getPages() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const result = yield this._fetchGet('');
|
|
56
|
+
return result;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
61
|
+
*
|
|
62
|
+
* @param {number} [id] - Page object identifier
|
|
63
|
+
*
|
|
64
|
+
* @returns Returns page object (DTO depends on the type of page being returned)
|
|
65
|
+
*/
|
|
66
|
+
getPageById(id) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const result = yield this._fetchGet(`/${id}`);
|
|
69
|
+
return result;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
74
|
+
*
|
|
75
|
+
* @param {string} [url] - Page URL
|
|
76
|
+
*
|
|
77
|
+
* @returns Returns page object (DTO depends on the type of page being returned)
|
|
78
|
+
*/
|
|
79
|
+
getPageByUrl(url) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const result = yield this._fetchGet(`/url/${url}`);
|
|
82
|
+
return result;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get child pages object with information as an array.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} [url] - Page URL
|
|
89
|
+
*
|
|
90
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data) for the selected parent
|
|
91
|
+
*/
|
|
92
|
+
getChildPagesByParentUrl(url) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const result = yield this._fetchGet(`/${url}/children`);
|
|
95
|
+
return result;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get settings for the page.
|
|
100
|
+
*
|
|
101
|
+
* @param {string} [url] - Page URL
|
|
102
|
+
*
|
|
103
|
+
* @returns Returns a ConfigPageDto object with page display settings
|
|
104
|
+
*/
|
|
105
|
+
getConfigPageByUrl(url) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
const result = yield this._fetchGet(`/${url}/config`);
|
|
108
|
+
return result;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Quick search for page objects with limited output.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} [name] - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account)
|
|
115
|
+
*
|
|
116
|
+
* @param {string} [lang] - Language code. Example : en_US
|
|
117
|
+
*
|
|
118
|
+
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
119
|
+
*/
|
|
120
|
+
searchPage(name, lang = 'en_US') {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const result = yield this._fetchGet(`/quick/search?lang=${lang}&name=${name}`);
|
|
123
|
+
return result;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.default = PageApi;
|
|
128
|
+
//# sourceMappingURL=pagesApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagesApi.js","sourceRoot":"","sources":["../../src/pages/pagesApi.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,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;OAIG;IACU,YAAY;;YACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YAC5C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,eAAe,CAAC,QAAe,EAAE,EAAE,SAAgB,CAAC;;YAC7D,uBAAuB;YACvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;YAC/C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;OAIG;IACU,QAAQ;;YACjB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACvC,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,WAAW,CAAC,EAAS;;YAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;YAC7C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,YAAY,CAAC,GAAU;;YAChC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAA;YAClD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,wBAAwB,CAAC,GAAU;;YAC5C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,WAAW,CAAC,CAAA;YACvD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,kBAAkB,CAAC,GAAU;;YACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,CAAA;YACrD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,UAAU,CAAC,IAAW,EAAE,OAAc,OAAO;;YACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,sBAAsB,IAAI,SAAS,IAAI,EAAE,CAAC,CAAA;YAC9E,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CAEJ;AAvGD,0BAuGC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface IPageApi {
|
|
2
|
+
getRootPages(): Promise<any>;
|
|
3
|
+
getCatalogPages(limit: number, offset: number): Promise<any>;
|
|
4
|
+
getPages(): Promise<any>;
|
|
5
|
+
getPageById(id: number): Promise<any>;
|
|
6
|
+
getPageByUrl(url: string): Promise<any>;
|
|
7
|
+
getChildPagesByParentUrl(url: string): Promise<any>;
|
|
8
|
+
getConfigPageByUrl(url: string): Promise<any>;
|
|
9
|
+
searchPage(name: string, lang: string): Promise<any>;
|
|
10
|
+
}
|
|
11
|
+
interface IPageConfig {
|
|
12
|
+
rowsPerPage: number;
|
|
13
|
+
productsPerRow: number;
|
|
14
|
+
}
|
|
15
|
+
export { IPageApi, IPageConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagesInterfaces.js","sourceRoot":"","sources":["../../src/pages/pagesInterfaces.ts"],"names":[],"mappings":""}
|