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.
Files changed (45) hide show
  1. package/dist/admins/adminsApi.js +3 -14
  2. package/dist/admins/adminsApi.js.map +1 -1
  3. package/dist/admins/adminsInterfaces.d.ts +7 -26
  4. package/dist/base/oneEntry.js +59 -76
  5. package/dist/base/oneEntry.js.map +1 -1
  6. package/dist/base/utils.d.ts +14 -10
  7. package/dist/base/utils.js +1 -7
  8. package/dist/base/utils.js.map +1 -1
  9. package/dist/file-uploding/fileUploadingApi.js +8 -21
  10. package/dist/file-uploding/fileUploadingApi.js.map +1 -1
  11. package/dist/forms/formsApi.js +6 -19
  12. package/dist/forms/formsApi.js.map +1 -1
  13. package/dist/forms/formsInterfaces.d.ts +3 -4
  14. package/dist/formsData/formsDataApi.d.ts +2 -2
  15. package/dist/formsData/formsDataApi.js +11 -26
  16. package/dist/formsData/formsDataApi.js.map +1 -1
  17. package/dist/general-types/GeneralTypesApi.js +3 -14
  18. package/dist/general-types/GeneralTypesApi.js.map +1 -1
  19. package/dist/locales/localesApi.js +3 -14
  20. package/dist/locales/localesApi.js.map +1 -1
  21. package/dist/locales/localesInterfaces.d.ts +2 -3
  22. package/dist/menus/menusApi.d.ts +1 -1
  23. package/dist/menus/menusApi.js +10 -14
  24. package/dist/menus/menusApi.js.map +1 -1
  25. package/dist/menus/menusInterfaces.d.ts +2 -0
  26. package/dist/pages/pagesApi.d.ts +9 -9
  27. package/dist/pages/pagesApi.js +36 -63
  28. package/dist/pages/pagesApi.js.map +1 -1
  29. package/dist/pages/pagesInterfaces.d.ts +7 -7
  30. package/dist/product-statuses/productStatusesApi.js +12 -29
  31. package/dist/product-statuses/productStatusesApi.js.map +1 -1
  32. package/dist/product-statuses/productStatusesInterfaces.d.ts +1 -1
  33. package/dist/products/productsApi.d.ts +22 -10
  34. package/dist/products/productsApi.js +83 -73
  35. package/dist/products/productsApi.js.map +1 -1
  36. package/dist/products/productsInterfaces.d.ts +5 -9
  37. package/dist/system/systemApi.js +6 -19
  38. package/dist/system/systemApi.js.map +1 -1
  39. package/dist/templates/templatesApi.js +6 -19
  40. package/dist/templates/templatesApi.js.map +1 -1
  41. package/dist/templates/templatesInterfaces.d.ts +5 -9
  42. package/dist/templates-preview/templatesPreviewApi.js +9 -24
  43. package/dist/templates-preview/templatesPreviewApi.js.map +1 -1
  44. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +22 -11
  45. package/package.json +1 -1
@@ -1 +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,EAAE,KAAY;QACjC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,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"}
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 {LanguageCode} code - The full language code.
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: LanguageCode;
25
+ code: string;
27
26
  name: string;
28
27
  nativeName: string;
29
28
  isActive: boolean;
@@ -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 ContentMenuDto object with included pages
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
  }
@@ -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 ContentMenuDto object with included pages
17
+ * @returns Returns a single menu object as a ContentMenu object with included pages
27
18
  */
28
- getMenusByMarker(marker) {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- const result = yield this._fetchGet(`/marker/${marker}`);
31
- return result;
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":";;;;;;;;;;;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;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"}
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;
@@ -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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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 page object (DTO depends on the type of page being returned)
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 page object (DTO depends on the type of page being returned)
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 ContentIndexedPageDto objects or an empty array [] (if there is no data) for the selected parent
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 PositionFormDto objects or an empty array [] (if there is no data) for the selected parent
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 ConfigPageDto object with page display settings
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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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
  }
@@ -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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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
- return __awaiter(this, void 0, void 0, function* () {
30
- const result = yield this._fetchRequests(`/root?langCode=${this._LANGCODE_KEY}`, langCode);
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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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
- return __awaiter(this, void 0, void 0, function* () {
47
- const result = yield this._fetchRequests(`/catalog?langCode=${this._LANGCODE_KEY}&limit=${limit}&offset=${offset}`, langCode);
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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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
- return __awaiter(this, void 0, void 0, function* () {
60
- const result = yield this._fetchRequests(`?langCode=${this._LANGCODE_KEY}`, langCode);
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 page object (DTO depends on the type of page being returned)
56
+ * @returns Returns PageEntity object
72
57
  */
73
- getPageById(id, langCode) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- const result = yield this._fetchRequests(`/${id}?langCode=${this._LANGCODE_KEY}`, langCode);
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 page object (DTO depends on the type of page being returned)
69
+ * @returns Returns PageEntity object
87
70
  */
88
- getPageByUrl(url, langCode) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- const result = yield this._fetchRequests(`/url/${url}?langCode=${this._LANGCODE_KEY}`, langCode);
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 ContentIndexedPageDto objects or an empty array [] (if there is no data) for the selected parent
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
- return __awaiter(this, void 0, void 0, function* () {
105
- const result = yield this._fetchRequests(`/${url}/children?langCode=${this._LANGCODE_KEY}`, langCode);
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 PositionFormDto objects or an empty array [] (if there is no data) for the selected parent
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
- return __awaiter(this, void 0, void 0, function* () {
120
- const result = yield this._fetchRequests(`/${url}/forms?langCode=${this._LANGCODE_KEY}`, langCode);
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 ConfigPageDto object with page display settings
106
+ * @returns Returns a ConfigPage object with page display settings
130
107
  */
131
- getConfigPageByUrl(url) {
132
- return __awaiter(this, void 0, void 0, function* () {
133
- const result = yield this._fetchGet(`/${url}/config`);
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 ContentIndexedPageDto objects or an empty array [] (if there is no data)
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
- return __awaiter(this, void 0, void 0, function* () {
148
- const result = yield this._fetchGet(`/quick/search?lang=${langCode}&name=${name}`);
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":";;;;;;;;;;;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;IACU,YAAY,CAAC,QAAiB;;YACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,kBAAkB,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;YACzF,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;;;OAUG;IACU,eAAe,CAAC,QAAiB,EAAE,QAAe,EAAE,EAAE,SAAgB,CAAC;;YAChF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,qBAAqB,IAAI,CAAC,aAAa,UAAU,KAAK,WAAW,MAAM,EAAE,EAAC,QAAQ,CAAC,CAAA;YAE5H,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,QAAQ,CAAC,QAAiB;;YACnC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;YAEpF,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,WAAW,CAAC,EAAS,EAAE,QAAiB;;YACjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,IAAI,CAAC,aAAa,EAAE,EAAC,QAAQ,CAAC,CAAA;YAE1F,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA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AC;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 { ILocalizeInfos, LangType, Types } from "../base/utils";
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: ILocalizeInfos;
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: ILocalizeInfos;
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
- return __awaiter(this, void 0, void 0, function* () {
28
- const result = yield this._fetchGet('');
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
- return __awaiter(this, void 0, void 0, function* () {
41
- const result = yield this._fetchGet(`/${id}`);
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
- return __awaiter(this, void 0, void 0, function* () {
54
- const result = yield this._fetchGet(`/marker/${marker}`);
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
- return __awaiter(this, void 0, void 0, function* () {
67
- const result = yield this._fetchGet(`/marker-validation/${marker}`);
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":";;;;;;;;;;;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;IACU,kBAAkB;;YAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACvC,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,sBAAsB,CAAC,EAAS;;YACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;YAC7C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,yBAAyB,CAAC,MAAa;;YAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,cAAc,CAAC,MAAa;;YACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,sBAAsB,MAAM,EAAE,CAAC,CAAA;YACnE,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CACJ;AAnDD,qCAmDC"}
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"}
@@ -29,7 +29,7 @@ interface IProductStatuses {
29
29
  */
30
30
  interface IProductStatusEntity {
31
31
  id: number;
32
- updatedDate: string;
32
+ updatedDate: string | Date;
33
33
  version: number;
34
34
  identifier: string;
35
35
  localizeInfos: ILocalizeInfos;
@@ -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 {Promise<IProductsEntity[]>} - List of products.
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 {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
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 {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
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 {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
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 {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
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 {Promise<IProductsEntity>} - Returns ContentIndexedProductDto object for the product.
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 {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
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 {Promise<IProductsEntity[]>} - Returns array of ContentIndexedProductDto object for the product.
196
+ * @returns Array with ProductEntity objects
185
197
  */
186
198
  searchProduct(name: string, langCode?: string): Promise<Array<IProductsEntity>>;
187
199
  }