oneentry 1.0.26 → 1.0.28
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/admins/adminsApi.js +3 -14
- package/dist/admins/adminsApi.js.map +1 -1
- package/dist/admins/adminsInterfaces.d.ts +7 -26
- package/dist/base/oneEntry.js +59 -76
- package/dist/base/oneEntry.js.map +1 -1
- package/dist/base/utils.d.ts +14 -10
- package/dist/base/utils.js +1 -7
- package/dist/base/utils.js.map +1 -1
- package/dist/file-uploding/fileUploadingApi.js +8 -21
- package/dist/file-uploding/fileUploadingApi.js.map +1 -1
- package/dist/forms/formsApi.js +6 -19
- package/dist/forms/formsApi.js.map +1 -1
- package/dist/forms/formsInterfaces.d.ts +3 -4
- package/dist/formsData/formsDataApi.d.ts +2 -2
- package/dist/formsData/formsDataApi.js +11 -26
- package/dist/formsData/formsDataApi.js.map +1 -1
- package/dist/general-types/GeneralTypesApi.js +3 -14
- package/dist/general-types/GeneralTypesApi.js.map +1 -1
- package/dist/locales/localesApi.js +3 -14
- package/dist/locales/localesApi.js.map +1 -1
- package/dist/locales/localesInterfaces.d.ts +2 -3
- package/dist/menus/menusApi.d.ts +1 -1
- package/dist/menus/menusApi.js +10 -14
- package/dist/menus/menusApi.js.map +1 -1
- package/dist/menus/menusInterfaces.d.ts +2 -0
- package/dist/pages/pagesApi.d.ts +9 -9
- package/dist/pages/pagesApi.js +36 -63
- package/dist/pages/pagesApi.js.map +1 -1
- package/dist/pages/pagesInterfaces.d.ts +7 -7
- package/dist/product-statuses/productStatusesApi.js +12 -29
- package/dist/product-statuses/productStatusesApi.js.map +1 -1
- package/dist/product-statuses/productStatusesInterfaces.d.ts +1 -1
- package/dist/products/productsApi.d.ts +22 -10
- package/dist/products/productsApi.js +83 -73
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +5 -9
- package/dist/system/systemApi.js +6 -19
- package/dist/system/systemApi.js.map +1 -1
- package/dist/templates/templatesApi.js +6 -19
- package/dist/templates/templatesApi.js.map +1 -1
- package/dist/templates/templatesInterfaces.d.ts +5 -9
- package/dist/templates-preview/templatesPreviewApi.js +9 -24
- package/dist/templates-preview/templatesPreviewApi.js.map +1 -1
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +22 -11
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localesApi.js","sourceRoot":"","sources":["../../src/locales/localesApi.ts"],"names":[],"mappings":"
|
|
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,EAAE,KAAY;QACjC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,IAAI,CAAC,IAAI,IAAI,sBAAsB,CAAA;IACvC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU;QACnB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;QAClD,OAAO,MAAM,CAAA;IACjB,CAAC;CAEJ;AAhBD,6BAgBC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LanguageCode } from "../base/utils";
|
|
2
1
|
/**
|
|
3
2
|
* Represents an interface object of Locales Api.
|
|
4
3
|
*
|
|
@@ -13,7 +12,7 @@ interface ILocales {
|
|
|
13
12
|
* @interface
|
|
14
13
|
* @property {number} id - The unique identifier of the locales.
|
|
15
14
|
* @property {string} shortCode - The shortCode of locales.
|
|
16
|
-
* @property {
|
|
15
|
+
* @property {string} code - The full language code.
|
|
17
16
|
* @property {string} name - The language name.
|
|
18
17
|
* @property {string} nativeName - The native language name.
|
|
19
18
|
* @property {boolean} isActive - Active language flag.
|
|
@@ -23,7 +22,7 @@ interface ILocales {
|
|
|
23
22
|
interface ILocalEntity {
|
|
24
23
|
id: number;
|
|
25
24
|
shortCode: string;
|
|
26
|
-
code:
|
|
25
|
+
code: string;
|
|
27
26
|
name: string;
|
|
28
27
|
nativeName: string;
|
|
29
28
|
isActive: boolean;
|
package/dist/menus/menusApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class MenusApi extends OneEntry implements IMenus {
|
|
|
10
10
|
*
|
|
11
11
|
* @param {string} [marker] - Menu marker
|
|
12
12
|
*
|
|
13
|
-
* @returns Returns a single menu object as a
|
|
13
|
+
* @returns Returns a single menu object as a ContentMenu object with included pages
|
|
14
14
|
*/
|
|
15
15
|
getMenusByMarker(marker: string): Promise<IMenusEntity>;
|
|
16
16
|
}
|
package/dist/menus/menusApi.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
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
|
/**
|
|
@@ -23,13 +14,18 @@ class MenusApi extends oneEntry_1.default {
|
|
|
23
14
|
*
|
|
24
15
|
* @param {string} [marker] - Menu marker
|
|
25
16
|
*
|
|
26
|
-
* @returns Returns a single menu object as a
|
|
17
|
+
* @returns Returns a single menu object as a ContentMenu object with included pages
|
|
27
18
|
*/
|
|
28
|
-
getMenusByMarker(marker) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
async getMenusByMarker(marker) {
|
|
20
|
+
const result = await this._fetchGet(`/marker/${marker}`);
|
|
21
|
+
const pages = result.pages;
|
|
22
|
+
pages.forEach(page => {
|
|
23
|
+
const children = pages.filter(child => child.parentId === page.id);
|
|
24
|
+
if (children.length) {
|
|
25
|
+
page.children = children;
|
|
26
|
+
}
|
|
32
27
|
});
|
|
28
|
+
return result;
|
|
33
29
|
}
|
|
34
30
|
}
|
|
35
31
|
exports.default = MenusApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menusApi.js","sourceRoot":"","sources":["../../src/menus/menusApi.ts"],"names":[],"mappings":"
|
|
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,EAAE,KAAY;QACjC,KAAK,CAAC,GAAG,EAAC,KAAK,CAAC,CAAA;QAChB,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,gBAAgB,CAAC,MAAa;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;QACxD,MAAM,KAAK,GAAc,MAAM,CAAC,KAAK,CAAA;QACrC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACjB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,CAAA;YAClE,IAAI,QAAQ,CAAC,MAAM,EAAE;gBACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;aAC3B;QACL,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACjB,CAAC;CAEJ;AA1BD,2BA0BC"}
|
|
@@ -11,6 +11,7 @@ interface IMenus {
|
|
|
11
11
|
* Represents a position object.
|
|
12
12
|
*
|
|
13
13
|
* @interface
|
|
14
|
+
* @property {Array<IMenusPages>} children - The optional parameter. Contains array with child page objects.
|
|
14
15
|
* @property {number} id - The unique identifier of the menu.
|
|
15
16
|
* @property {string} pageUrl - The page url string.
|
|
16
17
|
* @property {ILocalizeInfos} localizeInfos - The menu data, taking into account localization.
|
|
@@ -18,6 +19,7 @@ interface IMenus {
|
|
|
18
19
|
* @property {number | null} parentId - The menu parent id.
|
|
19
20
|
*/
|
|
20
21
|
interface IMenusPages {
|
|
22
|
+
children?: Array<IMenusPages>;
|
|
21
23
|
id: number;
|
|
22
24
|
pageUrl: string;
|
|
23
25
|
localizeInfos: ILocalizeInfos;
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
11
11
|
*
|
|
12
12
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
13
13
|
*
|
|
14
|
-
* @returns Returns all created pages without parents as an array of
|
|
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
16
|
getRootPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
17
17
|
/**
|
|
@@ -23,7 +23,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
23
23
|
*
|
|
24
24
|
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
25
25
|
*
|
|
26
|
-
* @returns Returns all created pages as an array of
|
|
26
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
27
27
|
*/
|
|
28
28
|
getCatalogPages(langCode: LangType, limit?: number, offset?: number): Promise<Array<IPagesEntity>>;
|
|
29
29
|
/**
|
|
@@ -31,7 +31,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
31
31
|
*
|
|
32
32
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
33
33
|
*
|
|
34
|
-
* @returns Returns all created pages as an array of
|
|
34
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
35
35
|
*/
|
|
36
36
|
getPages(langCode: LangType): Promise<Array<IPagesEntity>>;
|
|
37
37
|
/**
|
|
@@ -41,7 +41,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
41
41
|
*
|
|
42
42
|
* @param {number} [id] - Page object identifier
|
|
43
43
|
*
|
|
44
|
-
* @returns Returns
|
|
44
|
+
* @returns Returns PageEntity object
|
|
45
45
|
*/
|
|
46
46
|
getPageById(id: number, langCode: LangType): Promise<IPagesEntity>;
|
|
47
47
|
/**
|
|
@@ -51,7 +51,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
51
51
|
*
|
|
52
52
|
* @param {string} [url] - Page URL
|
|
53
53
|
*
|
|
54
|
-
* @returns Returns
|
|
54
|
+
* @returns Returns PageEntity object
|
|
55
55
|
*/
|
|
56
56
|
getPageByUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
57
57
|
/**
|
|
@@ -61,7 +61,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
61
61
|
*
|
|
62
62
|
* @param {string} [url] - Page URL
|
|
63
63
|
*
|
|
64
|
-
* @returns Returns all created pages as an array of
|
|
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
66
|
getChildPagesByParentUrl(url: string, langCode: LangType): Promise<IPagesEntity>;
|
|
67
67
|
/**
|
|
@@ -71,7 +71,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
71
71
|
*
|
|
72
72
|
* @param {string} [url] - Page URL
|
|
73
73
|
*
|
|
74
|
-
* @returns Returns all forms as an array of
|
|
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
76
|
getFormsByPageUrl(url: string, langCode: LangType): Promise<Array<IPositionForm>>;
|
|
77
77
|
/**
|
|
@@ -79,7 +79,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
79
79
|
*
|
|
80
80
|
* @param {string} [url] - Page URL
|
|
81
81
|
*
|
|
82
|
-
* @returns Returns a
|
|
82
|
+
* @returns Returns a ConfigPage object with page display settings
|
|
83
83
|
*/
|
|
84
84
|
getConfigPageByUrl(url: string): Promise<IPageConfig>;
|
|
85
85
|
/**
|
|
@@ -89,7 +89,7 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
89
89
|
*
|
|
90
90
|
* @param {string} [langCode] Required parameter lang code
|
|
91
91
|
*
|
|
92
|
-
* @returns Returns all created pages as an array of
|
|
92
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
93
93
|
*/
|
|
94
94
|
searchPage(name: string, langCode: string): Promise<Array<IPagesEntity>>;
|
|
95
95
|
}
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
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
|
/**
|
|
@@ -23,13 +14,11 @@ class PageApi extends oneEntry_1.default {
|
|
|
23
14
|
*
|
|
24
15
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
25
16
|
*
|
|
26
|
-
* @returns Returns all created pages without parents as an array of
|
|
17
|
+
* @returns Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
27
18
|
*/
|
|
28
|
-
getRootPages(langCode) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return result;
|
|
32
|
-
});
|
|
19
|
+
async getRootPages(langCode) {
|
|
20
|
+
const result = await this._fetchRequests(`/root?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
21
|
+
return result;
|
|
33
22
|
}
|
|
34
23
|
/**
|
|
35
24
|
* Get all page objects with product information as an array.
|
|
@@ -40,26 +29,22 @@ class PageApi extends oneEntry_1.default {
|
|
|
40
29
|
*
|
|
41
30
|
* @param {number} [offset] - Optional parameter for pagination, default is 0
|
|
42
31
|
*
|
|
43
|
-
* @returns Returns all created pages as an array of
|
|
32
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
44
33
|
*/
|
|
45
|
-
getCatalogPages(langCode, limit = 30, offset = 0) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return result;
|
|
49
|
-
});
|
|
34
|
+
async getCatalogPages(langCode, limit = 30, offset = 0) {
|
|
35
|
+
const result = await this._fetchRequests(`/catalog?langCode=${this._LANGCODE_KEY}&limit=${limit}&offset=${offset}`, langCode);
|
|
36
|
+
return result;
|
|
50
37
|
}
|
|
51
38
|
/**
|
|
52
39
|
* Get all page objects with product information as an array.
|
|
53
40
|
*
|
|
54
41
|
* @param {string | Array<string>} [langCode] Required parameter lang code
|
|
55
42
|
*
|
|
56
|
-
* @returns Returns all created pages as an array of
|
|
43
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
57
44
|
*/
|
|
58
|
-
getPages(langCode) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return result;
|
|
62
|
-
});
|
|
45
|
+
async getPages(langCode) {
|
|
46
|
+
const result = await this._fetchRequests(`?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
47
|
+
return result;
|
|
63
48
|
}
|
|
64
49
|
/**
|
|
65
50
|
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
@@ -68,13 +53,11 @@ class PageApi extends oneEntry_1.default {
|
|
|
68
53
|
*
|
|
69
54
|
* @param {number} [id] - Page object identifier
|
|
70
55
|
*
|
|
71
|
-
* @returns Returns
|
|
56
|
+
* @returns Returns PageEntity object
|
|
72
57
|
*/
|
|
73
|
-
getPageById(id, langCode) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return result;
|
|
77
|
-
});
|
|
58
|
+
async getPageById(id, langCode) {
|
|
59
|
+
const result = await this._fetchRequests(`/${id}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
60
|
+
return result;
|
|
78
61
|
}
|
|
79
62
|
/**
|
|
80
63
|
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
@@ -83,13 +66,11 @@ class PageApi extends oneEntry_1.default {
|
|
|
83
66
|
*
|
|
84
67
|
* @param {string} [url] - Page URL
|
|
85
68
|
*
|
|
86
|
-
* @returns Returns
|
|
69
|
+
* @returns Returns PageEntity object
|
|
87
70
|
*/
|
|
88
|
-
getPageByUrl(url, langCode) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return result;
|
|
92
|
-
});
|
|
71
|
+
async getPageByUrl(url, langCode) {
|
|
72
|
+
const result = await this._fetchRequests(`/url/${url}?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
73
|
+
return result;
|
|
93
74
|
}
|
|
94
75
|
/**
|
|
95
76
|
* Get child pages object with information as an array.
|
|
@@ -98,13 +79,11 @@ class PageApi extends oneEntry_1.default {
|
|
|
98
79
|
*
|
|
99
80
|
* @param {string} [url] - Page URL
|
|
100
81
|
*
|
|
101
|
-
* @returns Returns all created pages as an array of
|
|
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
|
|
102
83
|
*/
|
|
103
|
-
getChildPagesByParentUrl(url, langCode) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return result;
|
|
107
|
-
});
|
|
84
|
+
async getChildPagesByParentUrl(url, langCode) {
|
|
85
|
+
const result = await this._fetchRequests(`/${url}/children?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
86
|
+
return result;
|
|
108
87
|
}
|
|
109
88
|
/**
|
|
110
89
|
* Get all forms by page url.
|
|
@@ -113,26 +92,22 @@ class PageApi extends oneEntry_1.default {
|
|
|
113
92
|
*
|
|
114
93
|
* @param {string} [url] - Page URL
|
|
115
94
|
*
|
|
116
|
-
* @returns Returns all forms as an array of
|
|
95
|
+
* @returns Returns all forms as an array of PositionForm objects or an empty array [] (if there is no data) for the selected parent
|
|
117
96
|
*/
|
|
118
|
-
getFormsByPageUrl(url, langCode) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return result;
|
|
122
|
-
});
|
|
97
|
+
async getFormsByPageUrl(url, langCode) {
|
|
98
|
+
const result = await this._fetchRequests(`/${url}/forms?langCode=${this._LANGCODE_KEY}`, langCode);
|
|
99
|
+
return result;
|
|
123
100
|
}
|
|
124
101
|
/**
|
|
125
102
|
* Get settings for the page.
|
|
126
103
|
*
|
|
127
104
|
* @param {string} [url] - Page URL
|
|
128
105
|
*
|
|
129
|
-
* @returns Returns a
|
|
106
|
+
* @returns Returns a ConfigPage object with page display settings
|
|
130
107
|
*/
|
|
131
|
-
getConfigPageByUrl(url) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return result;
|
|
135
|
-
});
|
|
108
|
+
async getConfigPageByUrl(url) {
|
|
109
|
+
const result = await this._fetchGet(`/${url}/config`);
|
|
110
|
+
return result;
|
|
136
111
|
}
|
|
137
112
|
/**
|
|
138
113
|
* Quick search for page objects with limited output.
|
|
@@ -141,13 +116,11 @@ class PageApi extends oneEntry_1.default {
|
|
|
141
116
|
*
|
|
142
117
|
* @param {string} [langCode] Required parameter lang code
|
|
143
118
|
*
|
|
144
|
-
* @returns Returns all created pages as an array of
|
|
119
|
+
* @returns Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
145
120
|
*/
|
|
146
|
-
searchPage(name, langCode) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return result;
|
|
150
|
-
});
|
|
121
|
+
async searchPage(name, langCode) {
|
|
122
|
+
const result = await this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
|
|
123
|
+
return result;
|
|
151
124
|
}
|
|
152
125
|
}
|
|
153
126
|
exports.default = PageApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagesApi.js","sourceRoot":"","sources":["../../src/pages/pagesApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagesApi.js","sourceRoot":"","sources":["../../src/pages/pagesApi.ts"],"names":[],"mappings":";;AAAA,+CAAwC;AAIxC;;GAEG;AACH,MAAqB,OAAQ,SAAQ,kBAAQ;IACzC,YAAY,GAAW,EAAE,KAAY;QACjC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,YAAY,CAAC,QAAiB;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,kBAAkB,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;QACzF,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;;;;;OAUG;IACI,KAAK,CAAC,eAAe,CAAC,QAAiB,EAAE,QAAe,EAAE,EAAE,SAAgB,CAAC;QAChF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,qBAAqB,IAAI,CAAC,aAAa,UAAU,KAAK,WAAW,MAAM,EAAE,EAAC,QAAQ,CAAC,CAAA;QAE5H,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,QAAQ,CAAC,QAAiB;QACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;QAEpF,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,WAAW,CAAC,EAAS,EAAE,QAAiB;QACjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;QAE1F,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,YAAY,CAAC,GAAU,EAAE,QAAiB;QACnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,GAAG,aAAa,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;QAE/F,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,wBAAwB,CAAC,GAAU,EAAE,QAAiB;QAC/D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,GAAG,sBAAsB,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;QAEpG,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,iBAAiB,CAAC,GAAU,EAAE,QAAiB;QACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,GAAG,mBAAmB,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;QAEjG,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,kBAAkB,CAAC,GAAU;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,CAAA;QACrD,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,UAAU,CAAC,IAAW,EAAE,QAAe;QAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,sBAAsB,QAAQ,SAAS,IAAI,EAAE,CAAC,CAAA;QAClF,OAAO,MAAM,CAAA;IACjB,CAAC;CAEJ;AAtID,0BAsIC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AttributeType, LangType, LocalizeType, Types } from "../base/utils";
|
|
2
2
|
import { IAttributeSetEntity } from "../base/utils";
|
|
3
3
|
import { IFormsEntity } from "../forms/formsInterfaces";
|
|
4
4
|
/**
|
|
@@ -69,7 +69,7 @@ interface IPositionForm {
|
|
|
69
69
|
attributesSets: IAttributeSetEntity;
|
|
70
70
|
attributeSetId: number;
|
|
71
71
|
processingType: string;
|
|
72
|
-
localizeInfos:
|
|
72
|
+
localizeInfos: LocalizeType;
|
|
73
73
|
processingData: object;
|
|
74
74
|
position: number;
|
|
75
75
|
positionId: number;
|
|
@@ -94,14 +94,15 @@ interface IPositionForm {
|
|
|
94
94
|
* @property {Array<[langCode:string]:object>} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
|
|
95
95
|
* @property {number} position - Item number (for sorting).
|
|
96
96
|
* @property {Types} type - Page type.
|
|
97
|
+
* @property {number} childrenCount - Children count.
|
|
97
98
|
*/
|
|
98
99
|
interface IPagesEntity {
|
|
99
100
|
id: number;
|
|
100
|
-
parentId: number;
|
|
101
|
+
parentId: number | null;
|
|
101
102
|
config: Record<string, number>;
|
|
102
103
|
pageUrl: string;
|
|
103
104
|
depth: number;
|
|
104
|
-
localizeInfos:
|
|
105
|
+
localizeInfos: LocalizeType;
|
|
105
106
|
isVisible: boolean;
|
|
106
107
|
products: number;
|
|
107
108
|
attributeSetId: number;
|
|
@@ -115,10 +116,9 @@ interface IPagesEntity {
|
|
|
115
116
|
*
|
|
116
117
|
* @property {langCode.<object>}
|
|
117
118
|
*/
|
|
118
|
-
attributeValues:
|
|
119
|
-
[langCode: string]: object;
|
|
120
|
-
};
|
|
119
|
+
attributeValues: AttributeType;
|
|
121
120
|
position: number;
|
|
122
121
|
type: Types;
|
|
122
|
+
childrenCount: number;
|
|
123
123
|
}
|
|
124
124
|
export { IPageApi, IPageConfig, IPagesEntity, IPositionForm };
|
|
@@ -1,13 +1,4 @@
|
|
|
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
|
/**
|
|
@@ -23,11 +14,9 @@ class ProductStatusesApi extends oneEntry_1.default {
|
|
|
23
14
|
*
|
|
24
15
|
* @returns Returns an array of product status objects
|
|
25
16
|
*/
|
|
26
|
-
getProductStatuses() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return result;
|
|
30
|
-
});
|
|
17
|
+
async getProductStatuses() {
|
|
18
|
+
const result = await this._fetchGet('');
|
|
19
|
+
return result;
|
|
31
20
|
}
|
|
32
21
|
/**
|
|
33
22
|
* Search for a product status object by identifier.
|
|
@@ -36,11 +25,9 @@ class ProductStatusesApi extends oneEntry_1.default {
|
|
|
36
25
|
*
|
|
37
26
|
* @returns Returns a product status object
|
|
38
27
|
*/
|
|
39
|
-
getProductStatusesById(id) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return result;
|
|
43
|
-
});
|
|
28
|
+
async getProductStatusesById(id) {
|
|
29
|
+
const result = await this._fetchGet(`/${id}`);
|
|
30
|
+
return result;
|
|
44
31
|
}
|
|
45
32
|
/**
|
|
46
33
|
* Search for a product status object by its textual identifier (marker).
|
|
@@ -49,11 +36,9 @@ class ProductStatusesApi extends oneEntry_1.default {
|
|
|
49
36
|
*
|
|
50
37
|
* @returns Returns a product status object
|
|
51
38
|
*/
|
|
52
|
-
getProductsByStatusMarker(marker) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return result;
|
|
56
|
-
});
|
|
39
|
+
async getProductsByStatusMarker(marker) {
|
|
40
|
+
const result = await this._fetchGet(`/marker/${marker}`);
|
|
41
|
+
return result;
|
|
57
42
|
}
|
|
58
43
|
/**
|
|
59
44
|
* Check the existence of a textual identifier.
|
|
@@ -62,11 +47,9 @@ class ProductStatusesApi extends oneEntry_1.default {
|
|
|
62
47
|
*
|
|
63
48
|
* @returns Returns true if the textual identifier (marker) exists or false if it doesn't
|
|
64
49
|
*/
|
|
65
|
-
validateMarker(marker) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return result;
|
|
69
|
-
});
|
|
50
|
+
async validateMarker(marker) {
|
|
51
|
+
const result = await this._fetchGet(`/marker-validation/${marker}`);
|
|
52
|
+
return result;
|
|
70
53
|
}
|
|
71
54
|
}
|
|
72
55
|
exports.default = ProductStatusesApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productStatusesApi.js","sourceRoot":"","sources":["../../src/product-statuses/productStatusesApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"productStatusesApi.js","sourceRoot":"","sources":["../../src/product-statuses/productStatusesApi.ts"],"names":[],"mappings":";;AAAA,+CAAuC;AAGvC;;GAEG;AACH,MAAqB,kBAAmB,SAAQ,kBAAQ;IACpD,YAAY,GAAW,EAAE,KAAY;QACjC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,IAAI,CAAC,IAAI,IAAI,+BAA+B,CAAA;IAChD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,kBAAkB;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACvC,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,sBAAsB,CAAC,EAAS;QACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QAC7C,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,yBAAyB,CAAC,MAAa;QAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;QACxD,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,cAAc,CAAC,MAAa;QACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,sBAAsB,MAAM,EAAE,CAAC,CAAA;QACnE,OAAO,MAAM,CAAA;IACjB,CAAC;CACJ;AAnDD,qCAmDC"}
|
|
@@ -24,13 +24,11 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
24
24
|
*
|
|
25
25
|
* @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
|
|
26
26
|
*
|
|
27
|
-
* @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
|
|
28
|
-
*
|
|
29
27
|
* @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
|
|
30
28
|
*
|
|
31
29
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
32
30
|
*
|
|
33
|
-
* @returns
|
|
31
|
+
* @returns Array with ProductEntity objects
|
|
34
32
|
*/
|
|
35
33
|
getProducts(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
36
34
|
/**
|
|
@@ -54,7 +52,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
54
52
|
*
|
|
55
53
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
56
54
|
*
|
|
57
|
-
* @returns
|
|
55
|
+
* @returns Array with ProductEntity objects
|
|
58
56
|
*/
|
|
59
57
|
getProductsEmptyPage(langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
60
58
|
/**
|
|
@@ -81,7 +79,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
81
79
|
*
|
|
82
80
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
83
81
|
*
|
|
84
|
-
* @returns
|
|
82
|
+
* @returns Array with ProductEntity objects
|
|
85
83
|
*/
|
|
86
84
|
getProductsPageById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
87
85
|
/**
|
|
@@ -108,7 +106,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
108
106
|
*
|
|
109
107
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
110
108
|
*
|
|
111
|
-
* @returns
|
|
109
|
+
* @returns Array with ProductEntity objects
|
|
112
110
|
*/
|
|
113
111
|
getProductsPageByUrl(url: string, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
114
112
|
/**
|
|
@@ -127,7 +125,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
127
125
|
*
|
|
128
126
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
129
127
|
*
|
|
130
|
-
* @returns
|
|
128
|
+
* @returns Array with ProductEntity objects
|
|
131
129
|
*/
|
|
132
130
|
getRelatedProductsById(id: number, langCode?: LangType, userQuery?: IProductsQuery): Promise<IProductsEntity>;
|
|
133
131
|
/**
|
|
@@ -137,7 +135,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
137
135
|
*
|
|
138
136
|
* @param {string | Array<string>} [langCode] Language code parameter. Default "en_US". You can also pass several language parameters ['en_US', 'it_IT']
|
|
139
137
|
*
|
|
140
|
-
* @returns
|
|
138
|
+
* @returns ProductEntity object.
|
|
141
139
|
*/
|
|
142
140
|
getProductById(id: number, langCode?: LangType): Promise<IProductsEntity>;
|
|
143
141
|
/**
|
|
@@ -149,19 +147,33 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
149
147
|
*
|
|
150
148
|
* @example
|
|
151
149
|
* const objects = [
|
|
150
|
+
*
|
|
152
151
|
* {
|
|
152
|
+
*
|
|
153
153
|
* attributeMarker: "price",
|
|
154
|
+
*
|
|
154
155
|
* conditionMarker: "mth",
|
|
156
|
+
*
|
|
155
157
|
* conditionValue: 1,
|
|
158
|
+
*
|
|
156
159
|
* pageId: 0,
|
|
160
|
+
*
|
|
157
161
|
* },
|
|
162
|
+
*
|
|
158
163
|
* {
|
|
164
|
+
*
|
|
159
165
|
* attributeMarker: "price",
|
|
166
|
+
*
|
|
160
167
|
* conditionMarker: "lth",
|
|
168
|
+
*
|
|
161
169
|
* conditionValue: 3,
|
|
170
|
+
*
|
|
162
171
|
* pageId: 0,
|
|
172
|
+
*
|
|
163
173
|
* },
|
|
174
|
+
*
|
|
164
175
|
* ];
|
|
176
|
+
*
|
|
165
177
|
* @param {IProductsQuery} [userQuery] - Optional set query parameters.
|
|
166
178
|
* @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
|
|
167
179
|
*
|
|
@@ -171,7 +183,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
171
183
|
*
|
|
172
184
|
* @param {string} [userQuery.sortKey] - Optional field to sort by
|
|
173
185
|
*
|
|
174
|
-
* @returns
|
|
186
|
+
* @returns Array with ProductEntity objects
|
|
175
187
|
*/
|
|
176
188
|
filterProduct(data: Array<IFilterParams>, langCode?: LangType, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
|
|
177
189
|
/**
|
|
@@ -181,7 +193,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
|
|
|
181
193
|
*
|
|
182
194
|
* @param {string} [langCode] - Language code
|
|
183
195
|
*
|
|
184
|
-
* @returns
|
|
196
|
+
* @returns Array with ProductEntity objects
|
|
185
197
|
*/
|
|
186
198
|
searchProduct(name: string, langCode?: string): Promise<Array<IProductsEntity>>;
|
|
187
199
|
}
|