oneentry 1.0.35 → 1.0.36
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 +1966 -395
- package/dist/admins/adminsApi.js +1 -1
- package/dist/attribute-sets/attributeSetsApi.d.ts +2 -2
- package/dist/attribute-sets/attributeSetsApi.js +3 -3
- package/dist/base/oneEntry.js +4 -0
- package/dist/blocks/blocksApi.js +1 -1
- package/dist/forms/formsApi.js +2 -2
- package/dist/formsData/formsDataApi.js +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/markers/markersApi.d.ts +18 -20
- package/dist/markers/markersApi.js +24 -42
- package/dist/markers/markersInterfaces.d.ts +28 -6
- package/dist/markers/markersInterfaces.js +0 -1
- package/dist/menus/menusApi.js +1 -1
- package/dist/pages/pagesApi.d.ts +9 -9
- package/dist/pages/pagesApi.js +9 -9
- package/package.json +1 -1
package/dist/admins/adminsApi.js
CHANGED
|
@@ -20,7 +20,7 @@ class AdminsApi extends oneEntry_1.default {
|
|
|
20
20
|
*/
|
|
21
21
|
async getAdminsInfo(langCode = 'en_US', offset = 0, limit = 30) {
|
|
22
22
|
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
23
|
-
return result;
|
|
23
|
+
return this._normalizeData(result);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
exports.default = AdminsApi;
|
|
@@ -13,7 +13,7 @@ export default class AttributesSetsApi extends OneEntry implements IAttributesSe
|
|
|
13
13
|
*
|
|
14
14
|
* @returns Returns an array of AttributeInSet objects.
|
|
15
15
|
*/
|
|
16
|
-
getAttributesByMarker(marker: string, langCode
|
|
16
|
+
getAttributesByMarker(marker: string, langCode?: string): Promise<Array<IAttributesSetsEntity>>;
|
|
17
17
|
/**
|
|
18
18
|
* Get a single attribute with data from the attribute sets.
|
|
19
19
|
*
|
|
@@ -23,5 +23,5 @@ export default class AttributesSetsApi extends OneEntry implements IAttributesSe
|
|
|
23
23
|
*
|
|
24
24
|
* @returns Returns a AttributeInSet object.
|
|
25
25
|
*/
|
|
26
|
-
getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode
|
|
26
|
+
getSingleAttributeByMarkerSet(attributeMarker: string, setMarker: string, langCode?: string): Promise<IAttributesSetsEntity>;
|
|
27
27
|
}
|
|
@@ -17,9 +17,9 @@ class AttributesSetsApi extends oneEntry_1.default {
|
|
|
17
17
|
*
|
|
18
18
|
* @returns Returns an array of AttributeInSet objects.
|
|
19
19
|
*/
|
|
20
|
-
async getAttributesByMarker(marker, langCode) {
|
|
20
|
+
async getAttributesByMarker(marker, langCode = 'en_US') {
|
|
21
21
|
const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
|
|
22
|
-
return result;
|
|
22
|
+
return this._normalizeData(result);
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Get a single attribute with data from the attribute sets.
|
|
@@ -30,7 +30,7 @@ class AttributesSetsApi extends oneEntry_1.default {
|
|
|
30
30
|
*
|
|
31
31
|
* @returns Returns a AttributeInSet object.
|
|
32
32
|
*/
|
|
33
|
-
async getSingleAttributeByMarkerSet(attributeMarker, setMarker, langCode) {
|
|
33
|
+
async getSingleAttributeByMarkerSet(attributeMarker, setMarker, langCode = 'en_US') {
|
|
34
34
|
const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
|
|
35
35
|
return result;
|
|
36
36
|
}
|
package/dist/base/oneEntry.js
CHANGED
|
@@ -172,6 +172,10 @@ class OneEntry {
|
|
|
172
172
|
const key = Object.keys(data.localizeInfos);
|
|
173
173
|
normalizeData.localizeInfos = data.localizeInfos[key[0]];
|
|
174
174
|
}
|
|
175
|
+
if (data.hasOwnProperty('formData')) {
|
|
176
|
+
const key = Object.keys(data.formData);
|
|
177
|
+
normalizeData.formData = data.formData[key[0]].flat();
|
|
178
|
+
}
|
|
175
179
|
return normalizeData;
|
|
176
180
|
}
|
|
177
181
|
}
|
package/dist/blocks/blocksApi.js
CHANGED
|
@@ -32,7 +32,7 @@ class BlocksApi extends oneEntry_1.default {
|
|
|
32
32
|
*/
|
|
33
33
|
async getBlockByMarker(marker, langCode = 'en_US') {
|
|
34
34
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
35
|
-
return result;
|
|
35
|
+
return this._normalizeData(result);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.default = BlocksApi;
|
package/dist/forms/formsApi.js
CHANGED
|
@@ -20,7 +20,7 @@ class FormsApi extends oneEntry_1.default {
|
|
|
20
20
|
*/
|
|
21
21
|
async getAllForms(langCode = 'en_US', offset = 0, limit = 30) {
|
|
22
22
|
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
23
|
-
return result;
|
|
23
|
+
return this._normalizeData(result);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Get one form by form marker.
|
|
@@ -32,7 +32,7 @@ class FormsApi extends oneEntry_1.default {
|
|
|
32
32
|
*/
|
|
33
33
|
async getFormByMarker(marker, langCode = 'en_US') {
|
|
34
34
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
35
|
-
return result;
|
|
35
|
+
return this._normalizeData(result);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.default = FormsApi;
|
|
@@ -20,7 +20,7 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
20
20
|
*/
|
|
21
21
|
async getFormsData(langCode = 'en_US', offset = 0, limit = 30) {
|
|
22
22
|
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
23
|
-
return result;
|
|
23
|
+
return this._normalizeData(result);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Find all product page objects with pagination and multiple filtering.
|
|
@@ -42,7 +42,7 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
42
42
|
*/
|
|
43
43
|
async postFormsData(data) {
|
|
44
44
|
const result = await this._fetchPost('', data);
|
|
45
|
-
return result;
|
|
45
|
+
return this._normalizeData(result);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Get one object of form data by marker.
|
|
@@ -56,7 +56,7 @@ class FormsDataApi extends oneEntry_1.default {
|
|
|
56
56
|
*/
|
|
57
57
|
async getFormsDataByMarker(marker, langCode = 'en_US', offset = 0, limit = 30) {
|
|
58
58
|
const result = await this._fetchGet(`/${marker}?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
59
|
-
return result;
|
|
59
|
+
return this._normalizeData(result);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
exports.default = FormsDataApi;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import FileUploadingApi from "./file-uploding/fileUploadingApi";
|
|
|
13
13
|
import SystemApi from "./system/systemApi";
|
|
14
14
|
import BlocksApi from "./blocks/blocksApi";
|
|
15
15
|
import AttributesSetsApi from "./attribute-sets/attributeSetsApi";
|
|
16
|
+
import MarkersApi from "./markers/markersApi";
|
|
16
17
|
interface IDefineApi {
|
|
17
18
|
Admins: AdminsApi;
|
|
18
19
|
AttributesSets: AttributesSetsApi;
|
|
@@ -22,6 +23,7 @@ interface IDefineApi {
|
|
|
22
23
|
FormData: FormsDataApi;
|
|
23
24
|
GeneralTypes: GeneralTypesApi;
|
|
24
25
|
Locales: LocalesApi;
|
|
26
|
+
Markers: MarkersApi;
|
|
25
27
|
Menus: MenusApi;
|
|
26
28
|
Pages: PageApi;
|
|
27
29
|
Products: ProductApi;
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ const fileUploadingApi_1 = require("./file-uploding/fileUploadingApi");
|
|
|
16
16
|
const systemApi_1 = require("./system/systemApi");
|
|
17
17
|
const blocksApi_1 = require("./blocks/blocksApi");
|
|
18
18
|
const attributeSetsApi_1 = require("./attribute-sets/attributeSetsApi");
|
|
19
|
+
const markersApi_1 = require("./markers/markersApi");
|
|
19
20
|
/**
|
|
20
21
|
* Define API.
|
|
21
22
|
* @param {string} url - URl of your project.
|
|
@@ -30,6 +31,7 @@ function defineOneEntry(url, token) {
|
|
|
30
31
|
const FormData = new formsDataApi_1.default(url, token);
|
|
31
32
|
const GeneralTypes = new GeneralTypesApi_1.default(url, token);
|
|
32
33
|
const Locales = new localesApi_1.default(url, token);
|
|
34
|
+
const Markers = new markersApi_1.default(url, token);
|
|
33
35
|
const Menus = new menusApi_1.default(url, token);
|
|
34
36
|
const Pages = new pagesApi_1.default(url, token);
|
|
35
37
|
const Products = new productsApi_1.default(url, token);
|
|
@@ -46,6 +48,7 @@ function defineOneEntry(url, token) {
|
|
|
46
48
|
FormData,
|
|
47
49
|
GeneralTypes,
|
|
48
50
|
Locales,
|
|
51
|
+
Markers,
|
|
49
52
|
Menus,
|
|
50
53
|
Pages,
|
|
51
54
|
Products,
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import OneEntry from
|
|
2
|
-
import { IMarkersApi,
|
|
1
|
+
import OneEntry from "../base/oneEntry";
|
|
2
|
+
import { IMarkersApi, IMarkersEntity } from "./markersInterfaces";
|
|
3
3
|
/**
|
|
4
|
-
* Controllers for working with markers
|
|
4
|
+
* Controllers for working with markers
|
|
5
5
|
*/
|
|
6
|
-
export default class
|
|
7
|
-
constructor(url: string);
|
|
6
|
+
export default class MarkersApi extends OneEntry implements IMarkersApi {
|
|
7
|
+
constructor(url: string, token: string);
|
|
8
8
|
/**
|
|
9
|
-
* Get
|
|
9
|
+
* Get all markers.
|
|
10
10
|
*
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
12
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
12
13
|
*
|
|
13
|
-
* @returns
|
|
14
|
-
* Returns one MarkerEntity marker object
|
|
14
|
+
* @returns Returns an array of MarkerEntity objects.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
getMarkers(offset?: number, limit?: number): Promise<Array<IMarkersEntity>>;
|
|
17
17
|
/**
|
|
18
|
-
* Get
|
|
18
|
+
* Get marker by id.
|
|
19
19
|
*
|
|
20
|
-
* @param {number} [
|
|
20
|
+
* @param {number} [id] - Marker id.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
23
|
-
*
|
|
24
|
-
* @returns Returns an object ItemsWithTotal, where items is an array of MarkerEntity objects, total - the total number of markers found
|
|
22
|
+
* @returns Return BlocksEntity object.
|
|
25
23
|
*/
|
|
26
|
-
|
|
24
|
+
getMarkerById(id: number): Promise<IMarkersEntity>;
|
|
27
25
|
/**
|
|
28
|
-
* Get
|
|
26
|
+
* Get marker by marker.
|
|
29
27
|
*
|
|
30
|
-
* @param {
|
|
28
|
+
* @param {string} [marker] - Marker of marker.
|
|
31
29
|
*
|
|
32
|
-
* @returns Returns
|
|
30
|
+
* @returns Returns a single MarkerEntity marker object.
|
|
33
31
|
*/
|
|
34
|
-
|
|
32
|
+
getMarkerByMarker(marker: string): Promise<IMarkersEntity>;
|
|
35
33
|
}
|
|
@@ -1,65 +1,47 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const oneEntry_1 = require("../base/oneEntry");
|
|
13
4
|
/**
|
|
14
|
-
* Controllers for working with markers
|
|
5
|
+
* Controllers for working with markers
|
|
15
6
|
*/
|
|
16
|
-
class
|
|
17
|
-
constructor(url) {
|
|
18
|
-
super(url);
|
|
7
|
+
class MarkersApi extends oneEntry_1.default {
|
|
8
|
+
constructor(url, token) {
|
|
9
|
+
super(url, token);
|
|
19
10
|
this._url += '/api/content/markers';
|
|
20
11
|
}
|
|
21
12
|
/**
|
|
22
|
-
* Get
|
|
13
|
+
* Get all markers.
|
|
23
14
|
*
|
|
24
|
-
* @param {
|
|
15
|
+
* @param {number} [limit] - Optional parameter for pagination, default is 0
|
|
16
|
+
* @param {number} [offset] - Optional parameter for pagination, default is 30
|
|
25
17
|
*
|
|
26
|
-
* @returns
|
|
27
|
-
* Returns one MarkerEntity marker object
|
|
18
|
+
* @returns Returns an array of MarkerEntity objects.
|
|
28
19
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return result;
|
|
33
|
-
});
|
|
20
|
+
async getMarkers(offset = 0, limit = 30) {
|
|
21
|
+
const result = await this._fetchGet(`?offset=${offset}&limit=${limit}`);
|
|
22
|
+
return this._normalizeData(result.items);
|
|
34
23
|
}
|
|
35
24
|
/**
|
|
36
|
-
* Get
|
|
25
|
+
* Get marker by id.
|
|
37
26
|
*
|
|
38
|
-
* @param {number} [
|
|
27
|
+
* @param {number} [id] - Marker id.
|
|
39
28
|
*
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
42
|
-
* @returns Returns an object ItemsWithTotal, where items is an array of MarkerEntity objects, total - the total number of markers found
|
|
29
|
+
* @returns Return BlocksEntity object.
|
|
43
30
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return result.items;
|
|
48
|
-
});
|
|
31
|
+
async getMarkerById(id) {
|
|
32
|
+
const result = await this._fetchGet(`/${id}`);
|
|
33
|
+
return this._normalizeData(result);
|
|
49
34
|
}
|
|
50
35
|
/**
|
|
51
|
-
* Get
|
|
36
|
+
* Get marker by marker.
|
|
52
37
|
*
|
|
53
|
-
* @param {
|
|
38
|
+
* @param {string} [marker] - Marker of marker.
|
|
54
39
|
*
|
|
55
|
-
* @returns Returns
|
|
40
|
+
* @returns Returns a single MarkerEntity marker object.
|
|
56
41
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return result;
|
|
61
|
-
});
|
|
42
|
+
async getMarkerByMarker(marker) {
|
|
43
|
+
const result = await this._fetchGet(`/marker/${marker}`);
|
|
44
|
+
return this._normalizeData(result);
|
|
62
45
|
}
|
|
63
46
|
}
|
|
64
|
-
exports.default =
|
|
65
|
-
//# sourceMappingURL=markersApi.js.map
|
|
47
|
+
exports.default = MarkersApi;
|
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
import { ILocalizeInfos } from "../base/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an interface object of Markers Api.
|
|
4
|
+
*
|
|
5
|
+
* @property {function} getMarkers - Get all markers.
|
|
6
|
+
*
|
|
7
|
+
* @property {function} getMarkerById - Get marker by id.
|
|
8
|
+
*
|
|
9
|
+
* @property {function} getMarkerByMarker - Get marker by id.
|
|
10
|
+
*/
|
|
2
11
|
interface IMarkersApi {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
12
|
+
getMarkers(offset: number, limit: number): Promise<Array<IMarkersEntity>>;
|
|
13
|
+
getMarkerById(id: number): Promise<IMarkersEntity>;
|
|
14
|
+
getMarkerByMarker(marker: string): Promise<IMarkersEntity>;
|
|
6
15
|
}
|
|
7
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Represents a template entity object.
|
|
18
|
+
*
|
|
19
|
+
* @interface
|
|
20
|
+
* @property {number} id - The unique identifier of the position.
|
|
21
|
+
* @property {Date | string} updateDate - The date of last updated.
|
|
22
|
+
* @property {number} version - The version number of the object.
|
|
23
|
+
* @property {string} identifier - The textual identifier for the record field.
|
|
24
|
+
* @property {string} name - Name of marker.
|
|
25
|
+
* @property {string} marker - Marker of marker.
|
|
26
|
+
* @property {ILocalizeInfos} localizeInfos - The name of the template, taking into account localization.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
interface IMarkersEntity {
|
|
8
30
|
id: number;
|
|
9
|
-
|
|
31
|
+
updateDate: string | Date;
|
|
10
32
|
version: number;
|
|
11
33
|
identifier: string;
|
|
12
34
|
name: string;
|
|
13
35
|
marker: string;
|
|
14
36
|
localizeInfos: ILocalizeInfos;
|
|
15
37
|
}
|
|
16
|
-
export { IMarkersApi,
|
|
38
|
+
export { IMarkersApi, IMarkersEntity };
|
package/dist/menus/menusApi.js
CHANGED
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
13
13
|
*
|
|
14
14
|
* @returns Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
15
15
|
*/
|
|
16
|
-
getRootPages(langCode
|
|
16
|
+
getRootPages(langCode?: LangType): Promise<Array<IPagesEntity>>;
|
|
17
17
|
/**
|
|
18
18
|
* Get all page objects with product information as an array.
|
|
19
19
|
*
|
|
@@ -25,7 +25,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
27
27
|
*/
|
|
28
|
-
getCatalogPages(langCode
|
|
28
|
+
getCatalogPages(langCode?: LangType, limit?: number, offset?: number): Promise<Array<IPagesEntity>>;
|
|
29
29
|
/**
|
|
30
30
|
* Get all page objects with product information as an array.
|
|
31
31
|
*
|
|
@@ -33,7 +33,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
33
33
|
*
|
|
34
34
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
35
35
|
*/
|
|
36
|
-
getPages(langCode
|
|
36
|
+
getPages(langCode?: LangType): Promise<Array<IPagesEntity>>;
|
|
37
37
|
/**
|
|
38
38
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
39
39
|
*
|
|
@@ -43,7 +43,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
43
43
|
*
|
|
44
44
|
* @returns Returns PageEntity object
|
|
45
45
|
*/
|
|
46
|
-
getPageById(id: number, langCode
|
|
46
|
+
getPageById(id: number, langCode?: LangType): Promise<IPagesEntity>;
|
|
47
47
|
/**
|
|
48
48
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
49
49
|
*
|
|
@@ -53,7 +53,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
53
53
|
*
|
|
54
54
|
* @returns Returns PageEntity object
|
|
55
55
|
*/
|
|
56
|
-
getPageByUrl(url: string, langCode
|
|
56
|
+
getPageByUrl(url: string, langCode?: LangType): Promise<IPagesEntity>;
|
|
57
57
|
/**
|
|
58
58
|
* Get child pages object with information as an array.
|
|
59
59
|
*
|
|
@@ -63,7 +63,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
63
63
|
*
|
|
64
64
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
65
65
|
*/
|
|
66
|
-
getChildPagesByParentUrl(url: string, langCode
|
|
66
|
+
getChildPagesByParentUrl(url: string, langCode?: LangType): Promise<IPagesEntity>;
|
|
67
67
|
/**
|
|
68
68
|
* Get all forms by page url.
|
|
69
69
|
*
|
|
@@ -73,7 +73,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
73
73
|
*
|
|
74
74
|
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
75
75
|
*/
|
|
76
|
-
getFormsByPageUrl(url: string, langCode
|
|
76
|
+
getFormsByPageUrl(url: string, langCode?: LangType): Promise<Array<IPositionForm>>;
|
|
77
77
|
/**
|
|
78
78
|
* Get all blocks by page url.
|
|
79
79
|
*
|
|
@@ -83,7 +83,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
83
83
|
*
|
|
84
84
|
* @returns Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
85
85
|
*/
|
|
86
|
-
getBlocksByPageUrl(url: string, langCode
|
|
86
|
+
getBlocksByPageUrl(url: string, langCode?: LangType): Promise<Array<IPositionBlock>>;
|
|
87
87
|
/**
|
|
88
88
|
* Get settings for the page.
|
|
89
89
|
*
|
|
@@ -101,5 +101,5 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
101
101
|
*
|
|
102
102
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
103
103
|
*/
|
|
104
|
-
searchPage(name: string, langCode
|
|
104
|
+
searchPage(name: string, langCode?: LangType): Promise<Array<IPagesEntity>>;
|
|
105
105
|
}
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -16,7 +16,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
16
16
|
*
|
|
17
17
|
* @returns Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
18
18
|
*/
|
|
19
|
-
async getRootPages(langCode) {
|
|
19
|
+
async getRootPages(langCode = 'en_US') {
|
|
20
20
|
const result = await this._fetchRequests(`/root?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
@@ -31,7 +31,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
31
31
|
*
|
|
32
32
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
33
33
|
*/
|
|
34
|
-
async getCatalogPages(langCode, limit = 30, offset = 0) {
|
|
34
|
+
async getCatalogPages(langCode = 'en_US', limit = 30, offset = 0) {
|
|
35
35
|
const result = await this._fetchRequests(`/catalog?langCode=${this._LANGCODE_KEY}&limit=${limit}&offset=${offset}`, langCode);
|
|
36
36
|
return result;
|
|
37
37
|
}
|
|
@@ -42,7 +42,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
42
42
|
*
|
|
43
43
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
44
44
|
*/
|
|
45
|
-
async getPages(langCode) {
|
|
45
|
+
async getPages(langCode = 'en_US') {
|
|
46
46
|
const result = await this._fetchRequests(`?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
47
47
|
return result;
|
|
48
48
|
}
|
|
@@ -55,7 +55,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
55
55
|
*
|
|
56
56
|
* @returns Returns PageEntity object
|
|
57
57
|
*/
|
|
58
|
-
async getPageById(id, langCode) {
|
|
58
|
+
async getPageById(id, langCode = 'en_US') {
|
|
59
59
|
const result = await this._fetchRequests(`/${id}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
60
60
|
return result;
|
|
61
61
|
}
|
|
@@ -68,7 +68,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
68
68
|
*
|
|
69
69
|
* @returns Returns PageEntity object
|
|
70
70
|
*/
|
|
71
|
-
async getPageByUrl(url, langCode) {
|
|
71
|
+
async getPageByUrl(url, langCode = 'en_US') {
|
|
72
72
|
const result = await this._fetchRequests(`/url/${url}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
73
73
|
return result;
|
|
74
74
|
}
|
|
@@ -81,7 +81,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
81
81
|
*
|
|
82
82
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
83
83
|
*/
|
|
84
|
-
async getChildPagesByParentUrl(url, langCode) {
|
|
84
|
+
async getChildPagesByParentUrl(url, langCode = 'en_US') {
|
|
85
85
|
const result = await this._fetchRequests(`/${url}/children?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
86
86
|
return result;
|
|
87
87
|
}
|
|
@@ -94,7 +94,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
94
94
|
*
|
|
95
95
|
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
96
96
|
*/
|
|
97
|
-
async getFormsByPageUrl(url, langCode) {
|
|
97
|
+
async getFormsByPageUrl(url, langCode = 'en_US') {
|
|
98
98
|
const result = await this._fetchRequests(`/${url}/forms?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
99
99
|
return result;
|
|
100
100
|
}
|
|
@@ -107,7 +107,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
107
107
|
*
|
|
108
108
|
* @returns Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
109
109
|
*/
|
|
110
|
-
async getBlocksByPageUrl(url, langCode) {
|
|
110
|
+
async getBlocksByPageUrl(url, langCode = 'en_US') {
|
|
111
111
|
const result = await this._fetchRequests(`/${url}/blocks?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
112
112
|
return result;
|
|
113
113
|
}
|
|
@@ -131,7 +131,7 @@ class PageApi extends oneEntry_1.default {
|
|
|
131
131
|
*
|
|
132
132
|
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
133
133
|
*/
|
|
134
|
-
async searchPage(name, langCode) {
|
|
134
|
+
async searchPage(name, langCode = 'en_US') {
|
|
135
135
|
const result = await this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
|
|
136
136
|
return result;
|
|
137
137
|
}
|