oneentry 1.0.16 → 1.0.18
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 +155 -270
- package/dist/admins/adminsApi.d.ts +1 -1
- package/dist/admins/adminsInterfaces.d.ts +50 -15
- package/dist/forms/formsApi.d.ts +1 -7
- package/dist/forms/formsApi.js +0 -11
- package/dist/forms/formsApi.js.map +1 -1
- package/dist/forms/formsInterfaces.d.ts +28 -17
- package/dist/formsData/formsDataApi.d.ts +3 -3
- package/dist/formsData/formsDataApi.js +1 -1
- package/dist/formsData/formsDataInterfaces.d.ts +43 -10
- package/dist/general-types/GeneralTypesApi.js +1 -1
- package/dist/general-types/GeneralTypesApi.js.map +1 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/locales/localesInterfaces.d.ts +19 -1
- package/dist/menus/menusInterfaces.d.ts +24 -0
- package/dist/modules/modulesInterfaces.d.ts +1 -1
- package/dist/pages/pagesApi.d.ts +22 -2
- package/dist/pages/pagesApi.js +30 -13
- package/dist/pages/pagesApi.js.map +1 -1
- package/dist/pages/pagesInterfaces.d.ts +89 -4
- package/dist/product-statuses/productStatusesInterfaces.d.ts +22 -0
- package/dist/products/productsApi.d.ts +7 -15
- package/dist/products/productsApi.js +7 -20
- package/dist/products/productsApi.js.map +1 -1
- package/dist/products/productsInterfaces.d.ts +73 -18
- package/dist/templates/templatesApi.d.ts +4 -13
- package/dist/templates/templatesApi.js +4 -29
- package/dist/templates/templatesApi.js.map +1 -1
- package/dist/templates/templatesInterfaces.d.ts +32 -19
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +27 -11
- package/package.json +1 -1
package/dist/forms/formsApi.d.ts
CHANGED
|
@@ -10,13 +10,7 @@ export default class FormsApi extends OneEntry implements IForms {
|
|
|
10
10
|
*
|
|
11
11
|
* @returns Returns array for all objects of type FormEntity
|
|
12
12
|
*/
|
|
13
|
-
getAllForms(): Promise<IFormsEntity
|
|
14
|
-
/**
|
|
15
|
-
* Get one form by form id.
|
|
16
|
-
*
|
|
17
|
-
* @returns Returns object of type FormEntity
|
|
18
|
-
*/
|
|
19
|
-
getFormById(id: number): Promise<IFormsEntity>;
|
|
13
|
+
getAllForms(): Promise<Array<IFormsEntity>>;
|
|
20
14
|
/**
|
|
21
15
|
* Get one form by form marker.
|
|
22
16
|
*
|
package/dist/forms/formsApi.js
CHANGED
|
@@ -29,17 +29,6 @@ class FormsApi extends oneEntry_1.default {
|
|
|
29
29
|
return result;
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Get one form by form id.
|
|
34
|
-
*
|
|
35
|
-
* @returns Returns object of type FormEntity
|
|
36
|
-
*/
|
|
37
|
-
getFormById(id) {
|
|
38
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const result = yield this._fetchGet(`/${id}`);
|
|
40
|
-
return result;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
32
|
/**
|
|
44
33
|
* Get one form by form marker.
|
|
45
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formsApi.js","sourceRoot":"","sources":["../../src/forms/formsApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,QAAS,SAAQ,kBAAQ;IAC1C,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;OAIG;IACU,WAAW;;YACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACvC,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;
|
|
1
|
+
{"version":3,"file":"formsApi.js","sourceRoot":"","sources":["../../src/forms/formsApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,QAAS,SAAQ,kBAAQ;IAC1C,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;OAIG;IACU,WAAW;;YACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACvC,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAGD;;;;OAIG;IACU,eAAe,CAAC,MAAa;;YACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CACJ;AA1BD,2BA0BC"}
|
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
import { ILocalizeInfos } from "../base/utils";
|
|
2
|
+
import { IAttributeSet } from "../attribute-set/attributeSetInterfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Represents an interface object of Forms Api.
|
|
5
|
+
*
|
|
6
|
+
* @property {function} getAllForms - Get all forms in array.
|
|
7
|
+
*
|
|
8
|
+
* @property {function} getFormByMarker - Get one form by form marker.
|
|
9
|
+
*/
|
|
2
10
|
interface IForms {
|
|
3
|
-
getAllForms(): Promise<IFormsEntity
|
|
4
|
-
getFormById(id: number): Promise<IFormsEntity>;
|
|
11
|
+
getAllForms(): Promise<Array<IFormsEntity>>;
|
|
5
12
|
getFormByMarker(marker: string): Promise<IFormsEntity>;
|
|
6
13
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
+
/**
|
|
15
|
+
* Represents an object with various properties.
|
|
16
|
+
*
|
|
17
|
+
* @interface
|
|
18
|
+
* @property {number} id - The identifier of the object.
|
|
19
|
+
* @property {number} attributeSetId - The identifier of the attribute set being used.
|
|
20
|
+
* @property {string} processingType - Type of form processing.
|
|
21
|
+
* @property {ILocalizeInfos} localizeInfos - The name of the form, taking into account localization.
|
|
22
|
+
* @property {object} processingData - Form data.
|
|
23
|
+
* @property {IAttributesSets} attributesSets - The attributes with values used by the object.
|
|
24
|
+
* @property {number} version - The version number of the object.
|
|
25
|
+
* @property {string} identifier - The textual identifier for the record field.
|
|
26
|
+
* @property {number} position - The position of the object.
|
|
27
|
+
*/
|
|
14
28
|
interface IFormsEntity {
|
|
15
29
|
id: number;
|
|
16
|
-
updatedDate: string;
|
|
17
|
-
version: number;
|
|
18
|
-
identifier: string;
|
|
19
|
-
attributesSets: {
|
|
20
|
-
[key: string]: string;
|
|
21
|
-
};
|
|
22
30
|
attributeSetId: number;
|
|
23
31
|
processingType: string;
|
|
24
32
|
localizeInfos: ILocalizeInfos;
|
|
25
|
-
processingData: object;
|
|
26
|
-
|
|
33
|
+
processingData: object | string;
|
|
34
|
+
attributesValues: IAttributeSet;
|
|
35
|
+
version: number;
|
|
36
|
+
identifier: string;
|
|
37
|
+
position: number;
|
|
27
38
|
}
|
|
28
39
|
export { IForms, IFormsEntity };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OneEntry from '../base/oneEntry';
|
|
2
|
-
import { IFormsPost, IFormsData,
|
|
2
|
+
import { IFormsPost, IFormsData, IFormsDataEntity } from './formsDataInterfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Controllers for working with form data
|
|
5
5
|
*/
|
|
@@ -21,7 +21,7 @@ export default class FormsDataApi extends OneEntry implements IFormsData {
|
|
|
21
21
|
* "formData": [
|
|
22
22
|
* {
|
|
23
23
|
* "marker": "naimenovanie_1",
|
|
24
|
-
* "value": "
|
|
24
|
+
* "value": "Name",
|
|
25
25
|
* "langCode": "ru_RU"
|
|
26
26
|
* }
|
|
27
27
|
* ]
|
|
@@ -29,7 +29,7 @@ export default class FormsDataApi extends OneEntry implements IFormsData {
|
|
|
29
29
|
*
|
|
30
30
|
* @returns - Returns created CreateFormDataDto objects.
|
|
31
31
|
*/
|
|
32
|
-
postFormsData(data: Array<IFormsPost>): Promise<
|
|
32
|
+
postFormsData(data: Array<IFormsPost>): Promise<IFormsDataEntity>;
|
|
33
33
|
/**
|
|
34
34
|
* Get one object of form data by marker.
|
|
35
35
|
*
|
|
@@ -1,25 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a interface object of Forms Api.
|
|
3
|
+
*
|
|
4
|
+
* @property {function} getFormsData - Get all forms data.
|
|
5
|
+
*
|
|
6
|
+
* @property {function} postFormsData - Find all product page objects with pagination and multiple filtering.
|
|
7
|
+
*
|
|
8
|
+
* @property {function} getFormsDataByMarker - Get one object of form data by marker.
|
|
9
|
+
*/
|
|
1
10
|
interface IFormsData {
|
|
2
11
|
getFormsData(): Promise<Array<IFormsDataEntity>>;
|
|
3
|
-
postFormsData(data: Array<IFormsPost>): Promise<
|
|
12
|
+
postFormsData(data: Array<IFormsPost>): Promise<IFormsDataEntity>;
|
|
4
13
|
getFormsDataByMarker(marker: string): Promise<Array<IFormsDataEntity>>;
|
|
5
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Represents a form data.
|
|
17
|
+
*
|
|
18
|
+
* @interface
|
|
19
|
+
* @property {number} id - The unique identifier of the form page.
|
|
20
|
+
* @property {string} formIdentifier - The identifier of the page.
|
|
21
|
+
* @property {Date | string} time - The identifier of the form.
|
|
22
|
+
* @property {IFormData} formData - The identifier of the position.
|
|
23
|
+
*/
|
|
6
24
|
interface IFormsDataEntity {
|
|
7
25
|
id: number;
|
|
8
26
|
formIdentifier: string;
|
|
9
27
|
time: Date | string;
|
|
10
|
-
formData:
|
|
11
|
-
}
|
|
12
|
-
interface IFormsDataPost {
|
|
13
|
-
formIdentifier: string;
|
|
14
|
-
formData: Array<IFormData>;
|
|
28
|
+
formData: IFormData;
|
|
15
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Form data get by langcode identifier
|
|
32
|
+
* @example formData['en_US']
|
|
33
|
+
*
|
|
34
|
+
* @property {langCode.<object>}
|
|
35
|
+
*
|
|
36
|
+
* Contains an array of data form objects with the following values
|
|
37
|
+
*
|
|
38
|
+
* @property {string} marker Form data marker.
|
|
39
|
+
*
|
|
40
|
+
* @property {string} value Form data value.
|
|
41
|
+
*/
|
|
16
42
|
interface IFormData {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
43
|
+
[langcode: string]: Array<{
|
|
44
|
+
marker?: string;
|
|
45
|
+
value?: string;
|
|
46
|
+
}>;
|
|
20
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* interface to create an object of information about saving data using the form
|
|
50
|
+
*
|
|
51
|
+
* @property {string} formIdentifier - The identifier of the page.
|
|
52
|
+
* @property {IFormData} formData - The identifier of the page.
|
|
53
|
+
*/
|
|
21
54
|
interface IFormsPost {
|
|
22
55
|
formIdentifier: string;
|
|
23
56
|
formData: IFormData;
|
|
24
57
|
}
|
|
25
|
-
export { IFormsPost, IFormsData,
|
|
58
|
+
export { IFormsPost, IFormsData, IFormsDataEntity };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"GeneralTypesApi.js","sourceRoot":"","sources":["../../src/general-types/GeneralTypesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,eAAgB,SAAQ,kBAAQ;IACjD,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,4BAA4B,CAAA;IAC7C,CAAC;IAED;;;;OAIG;IACU,WAAW;;YACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACvC,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CAEJ;AAhBD,kCAgBC"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { Types } from "../base/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an interface object of General Type Api.
|
|
4
|
+
*
|
|
5
|
+
* @property {function} getAllTypes - Get all types.
|
|
6
|
+
*/
|
|
2
7
|
interface IGeneralTypes {
|
|
3
8
|
getAllTypes(): Promise<Array<IGeneralTypesEntity>>;
|
|
4
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents a general types object.
|
|
12
|
+
*
|
|
13
|
+
* @interface
|
|
14
|
+
* @property {number} id - Type id.
|
|
15
|
+
* @property {Types} type - Types enum.
|
|
16
|
+
*/
|
|
5
17
|
interface IGeneralTypesEntity {
|
|
6
18
|
id: number;
|
|
7
19
|
type: Types;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import ProductStatusesApi from "./product-statuses/productStatusesApi";
|
|
|
4
4
|
import TemplatesApi from "./templates/templatesApi";
|
|
5
5
|
import TemplatesPreviewApi from "./templates-preview/templatesPreviewApi";
|
|
6
6
|
import AdminsApi from "./admins/adminsApi";
|
|
7
|
-
import GeneralTypesApi from "./general-types/
|
|
7
|
+
import GeneralTypesApi from "./general-types/GeneralTypesApi";
|
|
8
8
|
import LocalesApi from "./locales/localesApi";
|
|
9
9
|
import MenusApi from "./menus/menusApi";
|
|
10
10
|
import FormsApi from "./forms/formsApi";
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const productStatusesApi_1 = require("./product-statuses/productStatusesApi");
|
|
|
7
7
|
const templatesApi_1 = require("./templates/templatesApi");
|
|
8
8
|
const templatesPreviewApi_1 = require("./templates-preview/templatesPreviewApi");
|
|
9
9
|
const adminsApi_1 = require("./admins/adminsApi");
|
|
10
|
-
const
|
|
10
|
+
const GeneralTypesApi_1 = require("./general-types/GeneralTypesApi");
|
|
11
11
|
const localesApi_1 = require("./locales/localesApi");
|
|
12
12
|
const menusApi_1 = require("./menus/menusApi");
|
|
13
13
|
const formsApi_1 = require("./forms/formsApi");
|
|
@@ -24,7 +24,7 @@ function defineOneEntry(url) {
|
|
|
24
24
|
const Templates = new templatesApi_1.default(url);
|
|
25
25
|
const TemplatesPreview = new templatesPreviewApi_1.default(url);
|
|
26
26
|
const Admins = new adminsApi_1.default(url);
|
|
27
|
-
const GeneralTypes = new
|
|
27
|
+
const GeneralTypes = new GeneralTypesApi_1.default(url);
|
|
28
28
|
const Locales = new localesApi_1.default(url);
|
|
29
29
|
const Menus = new menusApi_1.default(url);
|
|
30
30
|
const Forms = new formsApi_1.default(url);
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { LanguageCode } from "../base/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an interface object of Locales Api.
|
|
4
|
+
*
|
|
5
|
+
* @property {function} getLocales - Find all active language localization objects.
|
|
6
|
+
*/
|
|
2
7
|
interface ILocales {
|
|
3
8
|
getLocales(): Promise<Array<ILocalEntity>>;
|
|
4
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents a locales object.
|
|
12
|
+
*
|
|
13
|
+
* @interface
|
|
14
|
+
* @property {number} id - The unique identifier of the locales.
|
|
15
|
+
* @property {string} shortCode - The shortCode of locales.
|
|
16
|
+
* @property {LanguageCode} code - The full language code.
|
|
17
|
+
* @property {string} name - The language name.
|
|
18
|
+
* @property {string} nativeName - The native language name.
|
|
19
|
+
* @property {boolean} isActive - Active language flag.
|
|
20
|
+
* @property {string} image - The language image.
|
|
21
|
+
* @property {number} position - The language position.
|
|
22
|
+
*/
|
|
5
23
|
interface ILocalEntity {
|
|
6
24
|
id: number;
|
|
7
25
|
shortCode: string;
|
|
@@ -10,6 +28,6 @@ interface ILocalEntity {
|
|
|
10
28
|
nativeName: string;
|
|
11
29
|
isActive: boolean;
|
|
12
30
|
image: string;
|
|
13
|
-
position: number
|
|
31
|
+
position: number;
|
|
14
32
|
}
|
|
15
33
|
export { ILocales, ILocalEntity };
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { ILocalizeInfos } from "../base/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an interface object of Menus Api.
|
|
4
|
+
*
|
|
5
|
+
* @property {function} getAdminsInfo - Get pages includes in menu by marker.
|
|
6
|
+
*/
|
|
2
7
|
interface IMenus {
|
|
3
8
|
getMenusByMarker(marker: string): Promise<IMenusEntity>;
|
|
4
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents a position object.
|
|
12
|
+
*
|
|
13
|
+
* @interface
|
|
14
|
+
* @property {number} id - The unique identifier of the menu.
|
|
15
|
+
* @property {string} pageUrl - The page url string.
|
|
16
|
+
* @property {ILocalizeInfos} localizeInfos - The menu data, taking into account localization.
|
|
17
|
+
* @property {number} position - The menu position.
|
|
18
|
+
* @property {number | null} parentId - The menu parent id.
|
|
19
|
+
*/
|
|
5
20
|
interface IMenusPages {
|
|
6
21
|
id: number;
|
|
7
22
|
pageUrl: string;
|
|
@@ -9,6 +24,15 @@ interface IMenusPages {
|
|
|
9
24
|
position: number;
|
|
10
25
|
parentId: number | null;
|
|
11
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Represents a position object.
|
|
29
|
+
*
|
|
30
|
+
* @interface
|
|
31
|
+
* @property {number} id - The unique identifier of the menu.
|
|
32
|
+
* @property {string} identifier - The menu identifier.
|
|
33
|
+
* @property {ILocalizeInfos} localizeInfos - The menu data, taking into account localization.
|
|
34
|
+
* @property {Array<IMenusPages>} pages - Array of menu pages.
|
|
35
|
+
*/
|
|
12
36
|
interface IMenusEntity {
|
|
13
37
|
id: number;
|
|
14
38
|
identifier: string;
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OneEntry from "../base/oneEntry";
|
|
2
|
-
import { IPageApi, IPageConfig, IPagesEntity } from "./pagesInterfaces";
|
|
2
|
+
import { IPageApi, IPageConfig, IPagesEntity, IPositionForm } from "./pagesInterfaces";
|
|
3
3
|
/**
|
|
4
4
|
* Controllers for working with page objects, including catalog pages
|
|
5
5
|
*/
|
|
@@ -53,6 +53,26 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
53
53
|
* @returns Returns page object (DTO depends on the type of page being returned)
|
|
54
54
|
*/
|
|
55
55
|
getPageByUrl(url: string, langCode: string): Promise<IPagesEntity>;
|
|
56
|
+
/**
|
|
57
|
+
* Get child pages object with information as an array.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} [langCode] Required parameter lang code
|
|
60
|
+
*
|
|
61
|
+
* @param {string} [url] - Page URL
|
|
62
|
+
*
|
|
63
|
+
* @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
|
+
*/
|
|
65
|
+
getChildPagesByParentUrl(url: string, langCode: string): Promise<IPagesEntity>;
|
|
66
|
+
/**
|
|
67
|
+
* Get all forms by page url.
|
|
68
|
+
*
|
|
69
|
+
* @param {string} [langCode] Required parameter lang code
|
|
70
|
+
*
|
|
71
|
+
* @param {string} [url] - Page URL
|
|
72
|
+
*
|
|
73
|
+
* @returns Returns all forms as an array of PositionFormDto objects or an empty array [] (if there is no data) for the selected parent
|
|
74
|
+
*/
|
|
75
|
+
getFormsByPageUrl(url: string, langCode: string): Promise<Array<IPositionForm>>;
|
|
56
76
|
/**
|
|
57
77
|
* Get settings for the page.
|
|
58
78
|
*
|
|
@@ -70,5 +90,5 @@ export default class PageApi extends OneEntry implements IPageApi {
|
|
|
70
90
|
*
|
|
71
91
|
* @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
|
|
72
92
|
*/
|
|
73
|
-
searchPage(name: string, langCode: string): Promise<IPagesEntity
|
|
93
|
+
searchPage(name: string, langCode: string): Promise<Array<IPagesEntity>>;
|
|
74
94
|
}
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -91,19 +91,36 @@ class PageApi extends oneEntry_1.default {
|
|
|
91
91
|
return result;
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Get child pages object with information as an array.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} [langCode] Required parameter lang code
|
|
98
|
+
*
|
|
99
|
+
* @param {string} [url] - Page URL
|
|
100
|
+
*
|
|
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
|
|
102
|
+
*/
|
|
103
|
+
getChildPagesByParentUrl(url, langCode) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const result = yield this._fetchGet(`/${url}/children?langCode=${langCode}`);
|
|
106
|
+
return result;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get all forms by page url.
|
|
111
|
+
*
|
|
112
|
+
* @param {string} [langCode] Required parameter lang code
|
|
113
|
+
*
|
|
114
|
+
* @param {string} [url] - Page URL
|
|
115
|
+
*
|
|
116
|
+
* @returns Returns all forms as an array of PositionFormDto objects or an empty array [] (if there is no data) for the selected parent
|
|
117
|
+
*/
|
|
118
|
+
getFormsByPageUrl(url, langCode) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const result = yield this._fetchGet(`/${url}/forms?langCode=${langCode}`);
|
|
121
|
+
return result;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
107
124
|
/**
|
|
108
125
|
* Get settings for the page.
|
|
109
126
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagesApi.js","sourceRoot":"","sources":["../../src/pages/pagesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAwC;AAGxC;;GAEG;AACH,MAAqB,OAAQ,SAAQ,kBAAQ;IACzC,YAAY,GAAW;QACnB,KAAK,CAAC,GAAG,CAAC,CAAA;QACV,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAA;IACrC,CAAC;IAED;;;;;;OAMG;IACU,YAAY,CAAC,QAAe;;YACrC,MAAM,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I,CAAC,SAAS,CAAC,IAAI,GAAG,mBAAmB,QAAQ,EAAE,CAAC,CAAA;YACzE,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,kBAAkB,CAAC,GAAU;;YACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,CAAA;YACrD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,UAAU,CAAC,IAAW,EAAE,QAAe;;YAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,sBAAsB,QAAQ,SAAS,IAAI,EAAE,CAAC,CAAA;YAClF,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CAEJ;AAhID,0BAgIC"}
|
|
@@ -1,17 +1,100 @@
|
|
|
1
1
|
import { ILocalizeInfos, Types } from "../base/utils";
|
|
2
|
+
import { IAttributeSet } from "../attribute-set/attributeSetInterfaces";
|
|
3
|
+
import { IFormsEntity } from "../forms/formsInterfaces";
|
|
4
|
+
/**
|
|
5
|
+
* Represents an interface object of Pages Api.
|
|
6
|
+
*
|
|
7
|
+
* @property {function} getRootPages - Get all top-level page objects.
|
|
8
|
+
*
|
|
9
|
+
* @property {function} getCatalogPages - Get all page objects with product information as an array.
|
|
10
|
+
*
|
|
11
|
+
* @property {function} getPages - Get all page objects with product information as an array.
|
|
12
|
+
*
|
|
13
|
+
* @property {function} getPageById - Get page object with information about forms, blocks, menus, linked to the page.
|
|
14
|
+
*
|
|
15
|
+
* @property {function} getPageByUrl - Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
16
|
+
*
|
|
17
|
+
* @property {function} getChildPagesByParentUrl - Get child pages object with information as an array.
|
|
18
|
+
*
|
|
19
|
+
* @property {function} getFormsByPageUrl - Get all forms by page url.
|
|
20
|
+
*
|
|
21
|
+
* @property {function} getConfigPageByUrl - Get settings for the page.
|
|
22
|
+
*
|
|
23
|
+
* @property {function} searchPage - Quick search for page objects with limited output.
|
|
24
|
+
*/
|
|
2
25
|
interface IPageApi {
|
|
3
26
|
getRootPages(langCode: string): Promise<Array<IPagesEntity>>;
|
|
4
27
|
getCatalogPages(langCode: string, limit: number, offset: number): Promise<Array<IPagesEntity>>;
|
|
5
28
|
getPages(langCode: string): Promise<Array<IPagesEntity>>;
|
|
6
29
|
getPageById(id: number, langCode: string): Promise<IPagesEntity>;
|
|
7
30
|
getPageByUrl(url: string, langCode: string): Promise<IPagesEntity>;
|
|
31
|
+
getChildPagesByParentUrl(url: string, langCode: string): Promise<IPagesEntity>;
|
|
32
|
+
getFormsByPageUrl(url: string, langCode: string): Promise<Array<IPositionForm>>;
|
|
8
33
|
getConfigPageByUrl(url: string): Promise<IPageConfig>;
|
|
9
|
-
searchPage(name: string, langCode: string): Promise<IPagesEntity
|
|
34
|
+
searchPage(name: string, langCode: string): Promise<Array<IPagesEntity>>;
|
|
10
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Represents a config object.
|
|
38
|
+
*
|
|
39
|
+
* @interface
|
|
40
|
+
* @property {number} rowsPerPage - Number of lines per page.
|
|
41
|
+
*
|
|
42
|
+
* @property {number} rowsPerPage - Number of products per page.
|
|
43
|
+
*/
|
|
11
44
|
interface IPageConfig {
|
|
12
45
|
rowsPerPage: number;
|
|
13
46
|
productsPerRow: number;
|
|
14
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Represents an object with various properties.
|
|
50
|
+
*
|
|
51
|
+
* @interface
|
|
52
|
+
* @property {number} id - The identifier of the object.
|
|
53
|
+
* @property {Date | string} updatedDate - The date of last updated.
|
|
54
|
+
* @property {number} version - The version number of the object.
|
|
55
|
+
* @property {string} identifier - The textual identifier for the record field.
|
|
56
|
+
* @property {IAttributesSets} attributesSets - The attributes with values used by the object.
|
|
57
|
+
* @property {number} attributeSetId - The identifier of the attribute set being used.
|
|
58
|
+
* @property {string} processingType - Type of form processing.
|
|
59
|
+
* @property {ILocalizeInfos} localizeInfos - The name of the page, taking into account localization.
|
|
60
|
+
* @property {object} processingData - Form data.
|
|
61
|
+
* @property {number} position - The position of the object.
|
|
62
|
+
* @property {number} positionId - The position id.
|
|
63
|
+
*/
|
|
64
|
+
interface IPositionForm {
|
|
65
|
+
id: number;
|
|
66
|
+
updatedDate: Date | string;
|
|
67
|
+
version: number;
|
|
68
|
+
identifier: string;
|
|
69
|
+
attributesSets: IAttributeSet;
|
|
70
|
+
attributeSetId: number;
|
|
71
|
+
processingType: string;
|
|
72
|
+
localizeInfos: ILocalizeInfos;
|
|
73
|
+
processingData: object;
|
|
74
|
+
position: number;
|
|
75
|
+
positionId: number;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Represents an object with various properties.
|
|
79
|
+
*
|
|
80
|
+
* @interface
|
|
81
|
+
* @property {number} id - The identifier of the object.
|
|
82
|
+
* @property {number} parentId - The id of the parent page, if it contains null, then it is the top-level page.
|
|
83
|
+
* @property {Record<string, number>} config - Output settings for catalog pages.
|
|
84
|
+
* @property {string} pageUrl - Unique page Url.
|
|
85
|
+
* @property {number} depth - Page nesting depth relative to parentId.
|
|
86
|
+
* @property {ILocalizeInfos} localizeInfos - The name of the page, taking into account localization.
|
|
87
|
+
* @property {boolean} isVisible - A sign of page visibility.
|
|
88
|
+
* @property {number} products - The number of products linked to the page.
|
|
89
|
+
* @property {number} attributeSetId - Set of attributes id.
|
|
90
|
+
* @property {Array<IFormsEntity>} forms - Array of identifier values of the Form Entity objects to which the page is linked (optional).
|
|
91
|
+
* @property {Array<IFormsEntity>} blocks - array of identifier values of BlockEntity objects to which the page is linked (optional).
|
|
92
|
+
* @property {boolean} isSync - Indication of page indexing.
|
|
93
|
+
* @property {string} templateIdentifier - User id of the linked template.
|
|
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
|
+
* @property {number} position - Item number (for sorting).
|
|
96
|
+
* @property {Types} type - Page type.
|
|
97
|
+
*/
|
|
15
98
|
interface IPagesEntity {
|
|
16
99
|
id: number;
|
|
17
100
|
parentId: number;
|
|
@@ -20,9 +103,11 @@ interface IPagesEntity {
|
|
|
20
103
|
depth: number;
|
|
21
104
|
localizeInfos: ILocalizeInfos;
|
|
22
105
|
isVisible: boolean;
|
|
23
|
-
isEditorDisabled: boolean;
|
|
24
106
|
products: number;
|
|
25
107
|
attributeSetId: number;
|
|
108
|
+
forms?: Array<IFormsEntity>;
|
|
109
|
+
blocks?: Array<object>;
|
|
110
|
+
isSync: boolean;
|
|
26
111
|
templateIdentifier: string;
|
|
27
112
|
/**
|
|
28
113
|
* Language-specific attribute values.
|
|
@@ -33,7 +118,7 @@ interface IPagesEntity {
|
|
|
33
118
|
attributeValues: {
|
|
34
119
|
[langCode: string]: object;
|
|
35
120
|
};
|
|
36
|
-
position:
|
|
121
|
+
position: number;
|
|
37
122
|
type: Types;
|
|
38
123
|
}
|
|
39
|
-
export { IPageApi, IPageConfig, IPagesEntity };
|
|
124
|
+
export { IPageApi, IPageConfig, IPagesEntity, IPositionForm };
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { ILocalizeInfos } from "../base/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an interface object of Product Statuses Api.
|
|
4
|
+
*
|
|
5
|
+
* @property {function} getProductStatuses - Search for all product status objects.
|
|
6
|
+
*
|
|
7
|
+
* @property {function} getProductStatusesById - Search for a product status object by identifier.
|
|
8
|
+
*
|
|
9
|
+
* @property {function} getProductsByStatusMarker - Search for a product status object by its textual identifier (marker).
|
|
10
|
+
*
|
|
11
|
+
* @property {function} validateMarker - Check the existence of a textual identifier.
|
|
12
|
+
*/
|
|
2
13
|
interface IProductStatuses {
|
|
3
14
|
getProductStatuses(): Promise<Array<IProductStatusEntity>>;
|
|
4
15
|
getProductStatusesById(id: number): Promise<IProductStatusEntity>;
|
|
5
16
|
getProductsByStatusMarker(marker: string): Promise<IProductStatusEntity>;
|
|
6
17
|
validateMarker(marker: string): Promise<boolean>;
|
|
7
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents a position object.
|
|
21
|
+
*
|
|
22
|
+
* @interface
|
|
23
|
+
* @property {number} id - The unique identifier of the position.
|
|
24
|
+
* @property {Date | string} updatedDate - The date of last updated.
|
|
25
|
+
* @property {number} version - The version number of the object.
|
|
26
|
+
* @property {string} identifier - The textual identifier for the record field.
|
|
27
|
+
* @property {boolean} isLocked - Indicates whether the position is locked or not.
|
|
28
|
+
* @property {ILocalizeInfos} localizeInfos - The name of the products statuses, taking into account localization.
|
|
29
|
+
*/
|
|
8
30
|
interface IProductStatusEntity {
|
|
9
31
|
id: number;
|
|
10
32
|
updatedDate: string;
|