oneentry 1.0.36 → 1.0.38
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/dist/base/oneEntry.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const https = require('https');
|
|
4
3
|
class OneEntry {
|
|
5
4
|
constructor(url, token) {
|
|
6
5
|
this._LANGCODE_KEY = '$LANGCODE';
|
|
@@ -30,6 +29,7 @@ class OneEntry {
|
|
|
30
29
|
return result;
|
|
31
30
|
}
|
|
32
31
|
else {
|
|
32
|
+
const https = require('https');
|
|
33
33
|
return new Promise((resolve, reject) => {
|
|
34
34
|
const req = https.get(this._getFullPath(path), options, (res) => {
|
|
35
35
|
let data = '';
|
|
@@ -62,6 +62,7 @@ class OneEntry {
|
|
|
62
62
|
return await response.json();
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
|
+
const https = require('https');
|
|
65
66
|
return new Promise((resolve, reject) => {
|
|
66
67
|
const req = https.request(this._getFullPath(path), options, (res) => {
|
|
67
68
|
let responseData = '';
|
|
@@ -94,6 +95,7 @@ class OneEntry {
|
|
|
94
95
|
return result;
|
|
95
96
|
}
|
|
96
97
|
else {
|
|
98
|
+
const https = require('https');
|
|
97
99
|
return new Promise((resolve, reject) => {
|
|
98
100
|
const req = https.get(this._getFullPath(path), options, (res) => {
|
|
99
101
|
let data = '';
|
package/dist/base/utils.d.ts
CHANGED
|
@@ -65,4 +65,4 @@ interface IAttributeSetEntity {
|
|
|
65
65
|
}
|
|
66
66
|
type LangType = string | Array<string>;
|
|
67
67
|
type LocalizeType = ILocalizeInfos | ILocalizeInfo;
|
|
68
|
-
export { LocalizeType, ILocalizeInfos, Types, IAttributeSetEntity, LangType, AttributeType, IAttributeValues, IAttributes };
|
|
68
|
+
export { LocalizeType, ILocalizeInfos, ILocalizeInfo, Types, IAttributeSetEntity, LangType, AttributeType, IAttributeValues, IAttributes };
|
package/dist/menus/menusApi.js
CHANGED
|
@@ -18,13 +18,22 @@ class MenusApi extends oneEntry_1.default {
|
|
|
18
18
|
*/
|
|
19
19
|
async getMenusByMarker(marker) {
|
|
20
20
|
const result = await this._fetchGet(`/marker/${marker}`);
|
|
21
|
-
|
|
22
|
-
pages.
|
|
21
|
+
let pages = result.pages;
|
|
22
|
+
pages = pages.map(page => {
|
|
23
|
+
page = this._normalizeData(page);
|
|
24
|
+
for (const key in page.localizeInfos) {
|
|
25
|
+
if (key !== 'menuTitle') {
|
|
26
|
+
delete page.localizeInfos[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
23
29
|
const children = pages.filter(child => child.parentId === page.id);
|
|
24
30
|
if (children.length) {
|
|
25
|
-
|
|
31
|
+
const normalizeChildren = children.map(child => this._normalizeData(child));
|
|
32
|
+
page.children = normalizeChildren;
|
|
26
33
|
}
|
|
34
|
+
return page;
|
|
27
35
|
});
|
|
36
|
+
result.pages = pages;
|
|
28
37
|
return this._normalizeData(result);
|
|
29
38
|
}
|
|
30
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ILocalizeInfo } from "../base/utils";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an interface object of Menus Api.
|
|
4
4
|
*
|
|
@@ -14,7 +14,7 @@ interface IMenus {
|
|
|
14
14
|
* @property {Array<IMenusPages>} children - The optional parameter. Contains array with child page objects.
|
|
15
15
|
* @property {number} id - The unique identifier of the menu.
|
|
16
16
|
* @property {string} pageUrl - The page url string.
|
|
17
|
-
* @property {
|
|
17
|
+
* @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization.
|
|
18
18
|
* @property {number} position - The menu position.
|
|
19
19
|
* @property {number | null} parentId - The menu parent id.
|
|
20
20
|
*/
|
|
@@ -22,7 +22,7 @@ interface IMenusPages {
|
|
|
22
22
|
children?: Array<IMenusPages>;
|
|
23
23
|
id: number;
|
|
24
24
|
pageUrl: string;
|
|
25
|
-
localizeInfos:
|
|
25
|
+
localizeInfos: ILocalizeInfo;
|
|
26
26
|
position: number;
|
|
27
27
|
parentId: number | null;
|
|
28
28
|
}
|
|
@@ -38,7 +38,7 @@ interface IMenusPages {
|
|
|
38
38
|
interface IMenusEntity {
|
|
39
39
|
id: number;
|
|
40
40
|
identifier: string;
|
|
41
|
-
localizeInfos:
|
|
41
|
+
localizeInfos: ILocalizeInfo;
|
|
42
42
|
pages: Array<IMenusPages>;
|
|
43
43
|
}
|
|
44
44
|
export { IMenus, IMenusEntity };
|