oneentry 1.0.15 → 1.0.17

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 CHANGED
@@ -79,15 +79,15 @@ Example return:
79
79
  },
80
80
  "attributeSetId": 0,
81
81
  "login": "meteor",
82
- "email": "meteor@mydomen.ru",
82
+ "email": "meteor@mydomen.com",
83
83
  "restorePasswordCode": "",
84
84
  "position": {
85
85
  "id": 12,
86
86
  "objectId": 1,
87
87
  "objectType": "module",
88
- "position": "0|hzzzzz:"
88
+ "position": 1
89
89
  },
90
- "positionId": "0|hzzzzz:",
90
+ "positionId": 1,
91
91
  "permissions": {
92
92
  "menu.create": true
93
93
  },
@@ -145,7 +145,7 @@ Example return:
145
145
  "id": 12,
146
146
  "objectId": 1,
147
147
  "objectType": "page",
148
- "position": "0|hzzzzz:"
148
+ "position": 1
149
149
  }
150
150
  }
151
151
  ]
@@ -195,7 +195,7 @@ Example return:
195
195
  "id": 12,
196
196
  "objectId": 1,
197
197
  "objectType": "page",
198
- "position": "0|hzzzzz:"
198
+ "position": 1
199
199
  }
200
200
  }
201
201
  ]
@@ -246,7 +246,7 @@ Example return:
246
246
  "id": 12,
247
247
  "objectId": 1,
248
248
  "objectType": "page",
249
- "position": "0|hzzzzz:"
249
+ "position": 1
250
250
  }
251
251
  }
252
252
  ]
@@ -382,7 +382,7 @@ Example return:
382
382
  "nativeName": "বাংলা",
383
383
  "isActive": false,
384
384
  "image": "🇦🇨",
385
- "position": "0|hzzzzz:"
385
+ "position": 1
386
386
  }
387
387
  ]
388
388
  ```
@@ -1345,9 +1345,9 @@ Example return:
1345
1345
  "id": 12,
1346
1346
  "objectId": 1,
1347
1347
  "objectType": "module",
1348
- "position": "0|hzzzzz:"
1348
+ "position": 1
1349
1349
  },
1350
- "positionId": "0|hzzzzz:"
1350
+ "positionId": 1
1351
1351
  }
1352
1352
  ```
1353
1353
  ### getTemplateByMarker
@@ -1385,9 +1385,9 @@ Example return:
1385
1385
  "id": 12,
1386
1386
  "objectId": 1,
1387
1387
  "objectType": "module",
1388
- "position": "0|hzzzzz:"
1388
+ "position": 1
1389
1389
  },
1390
- "positionId": "0|hzzzzz:"
1390
+ "positionId": 1
1391
1391
  }
1392
1392
  ```
1393
1393
  ## TemplatesPreviewApi
@@ -1426,9 +1426,9 @@ Example return:
1426
1426
  "id": 12,
1427
1427
  "objectId": 1,
1428
1428
  "objectType": "module",
1429
- "position": "0|hzzzzz:"
1429
+ "position": 1
1430
1430
  },
1431
- "positionId": "0|hzzzzz:"
1431
+ "positionId": 1
1432
1432
  }
1433
1433
  ]
1434
1434
  ```
@@ -1462,9 +1462,9 @@ Example return:
1462
1462
  "id": 12,
1463
1463
  "objectId": 1,
1464
1464
  "objectType": "module",
1465
- "position": "0|hzzzzz:"
1465
+ "position": 1
1466
1466
  },
1467
- "positionId": "0|hzzzzz:"
1467
+ "positionId": 1
1468
1468
  }
1469
1469
  ```
1470
1470
  ### getTemplatesPreviewByMarker
@@ -1497,8 +1497,8 @@ Example return:
1497
1497
  "id": 12,
1498
1498
  "objectId": 1,
1499
1499
  "objectType": "module",
1500
- "position": "0|hzzzzz:"
1500
+ "position": 1
1501
1501
  },
1502
- "positionId": "0|hzzzzz:"
1502
+ "positionId": 1
1503
1503
  }
1504
1504
  ```
@@ -1,17 +1,59 @@
1
+ /**
2
+ * Represents a interface object of Admins Api.
3
+ *
4
+ * @property {function} getAdminsInfo - Get all user objects - admins.
5
+ */
1
6
  interface IAdmins {
2
7
  getAdminsInfo(): Promise<IAdminEntity>;
3
8
  }
9
+ /**
10
+ * Represents a position object.
11
+ *
12
+ * @interface
13
+ * @property {number} id - The unique identifier of the position.
14
+ * @property {number} position - The position of the object.
15
+ * @property {number} objectId - The unique identifier of the object.
16
+ * @property {string} objectType - The type of the object.
17
+ * @property {boolean} isLocked - Indicates whether the position is locked or not.
18
+ * @property {number} objectCategoryId - The unique identifier of the object's category.
19
+ */
4
20
  interface IPosition {
5
21
  id: number;
6
- position: string;
22
+ position: number;
7
23
  objectId: number;
8
24
  objectType: string;
9
- isLocked: boolean;
10
- objectCategoryId: number;
25
+ isLocked?: boolean;
26
+ objectCategoryId?: number;
11
27
  }
28
+ /**
29
+ * Represents a position object.
30
+ *
31
+ * @interface
32
+ * @property {string} attr_name - Attributes with values used by the object.
33
+ */
12
34
  interface IAttributesSets {
13
35
  [key: string]: string;
14
36
  }
37
+ /**
38
+ * Represents an object with various properties.
39
+ *
40
+ * @interface
41
+ * @property {number} id - The identifier of the object.
42
+ * @property {string} updatedDate - The date of when the object was last updated.
43
+ * @property {number} version - The version number of the object.
44
+ * @property {string} identifier - The textual identifier for the record field.
45
+ * @property {IAttributesSets} attributesSets - The attributes with values used by the object.
46
+ * @property {number} attributeSetId - The identifier of the attribute set being used.
47
+ * @property {string} login - The login username.
48
+ * @property {string} email - The email address.
49
+ * @property {number} restorePasswordCode - The code for password restoration.
50
+ * @property {IPosition} position - The position of the object.
51
+ * @property {number} positionId - The identifier of the position object.
52
+ * @property {Record<string, boolean>} permissions - The user's available permissions.
53
+ * @property {string} selectedLanguage - The selected language for the interface.
54
+ * @property {string} selectedContentLanguage - The selected language for content.
55
+ * @property {string} selectedUITheme - The selected theme for the interface.
56
+ */
15
57
  interface IAdminEntity {
16
58
  id: number;
17
59
  updatedDate: string;
@@ -29,4 +71,4 @@ interface IAdminEntity {
29
71
  selectedContentLanguage: string;
30
72
  selectedUITheme: string;
31
73
  }
32
- export { IAdmins, IAdminEntity };
74
+ export { IAdmins, IAdminEntity, IPosition };
@@ -11,12 +11,6 @@ export default class FormsApi extends OneEntry implements IForms {
11
11
  * @returns Returns array for all objects of type FormEntity
12
12
  */
13
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>;
20
14
  /**
21
15
  * Get one form by form marker.
22
16
  *
@@ -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;IAED;;;;OAIG;IACU,WAAW,CAAC,EAAS;;YAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;YAC7C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;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;AAnCD,2BAmCC"}
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
11
  getAllForms(): Promise<IFormsEntity[]>;
4
- getFormById(id: number): Promise<IFormsEntity>;
5
12
  getFormByMarker(marker: string): Promise<IFormsEntity>;
6
13
  }
7
- interface IFromPages {
8
- id: number;
9
- pageId: number;
10
- formId: number;
11
- positionId: number;
12
- position: object;
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
33
  processingData: object;
26
- formPages: Array<IFromPages>;
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, IFormsDataPost, IFormsDataEntity } from './formsDataInterfaces';
2
+ import { IFormsPost, IFormsData, IFormsDataEntity } from './formsDataInterfaces';
3
3
  /**
4
4
  * Controllers for working with form data
5
5
  */
@@ -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<IFormsDataPost>;
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<IFormsDataPost>;
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: Array<IFormData>;
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
- marker?: string;
18
- value?: string;
19
- langCode?: string;
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, IFormsDataPost, IFormsDataEntity };
58
+ export { IFormsPost, IFormsData, IFormsDataEntity };
@@ -31,4 +31,4 @@ class GeneralTypesApi extends oneEntry_1.default {
31
31
  }
32
32
  }
33
33
  exports.default = GeneralTypesApi;
34
- //# sourceMappingURL=generalTypesApi.js.map
34
+ //# sourceMappingURL=GeneralTypesApi.js.map
@@ -1 +1 @@
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
+ {"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/generalTypesApi";
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 generalTypesApi_1 = require("./general-types/generalTypesApi");
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 generalTypesApi_1.default(url);
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 | string;
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;
@@ -13,7 +13,7 @@ interface IModulesEntity {
13
13
  type: string;
14
14
  }[];
15
15
  attributeSetTypes: [];
16
- position: number | string;
16
+ position: number;
17
17
  positionId: number;
18
18
  }
19
19
  export { IModules, IModulesEntity };
@@ -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
  *
@@ -91,19 +91,36 @@ class PageApi extends oneEntry_1.default {
91
91
  return result;
92
92
  });
93
93
  }
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
- // public async getChildPagesByParentUrl(url:string, langCode:string):Promise<IPagesEntity> {
104
- // const result = await this._fetchGet(`/${url}/children?langCode=${langCode}`)
105
- // return result
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,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAA;YACjE,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;;;OAUG;IACU,eAAe,CAAC,QAAe,EAAE,QAAe,EAAE,EAAE,SAAgB,CAAC;;YAC9E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,qBAAqB,QAAQ,UAAU,KAAK,WAAW,MAAM,EAAE,CAAC,CAAA;YACpG,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,QAAQ,CAAC,QAAe;;YACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAA;YAC5D,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,WAAW,CAAC,EAAS,EAAE,QAAe;;YAC/C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,QAAQ,EAAE,CAAC,CAAA;YAClE,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACU,YAAY,CAAC,GAAU,EAAE,QAAe;;YAC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AA;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
34
  searchPage(name: string, langCode: string): Promise<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: string;
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;
@@ -28,7 +28,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
28
28
  *
29
29
  * @param {string} [userQuery.sortKey] - Optional field to sort by
30
30
  *
31
- * @returns {Promise<IProduct[]>} - List of products.
31
+ * @returns {Promise<IProductsEntity[]>} - List of products.
32
32
  */
33
33
  getProducts(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
34
34
  /**
@@ -53,7 +53,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
53
53
  *
54
54
  * @param {string} [userQuery.sortKey] - Optional field to sort by
55
55
  *
56
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
56
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
57
57
  */
58
58
  getProductsEmptyPage(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
59
59
  /**
@@ -80,7 +80,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
80
80
  *
81
81
  * @param {string} [userQuery.sortKey] - Optional field to sort by
82
82
  *
83
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
83
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
84
84
  */
85
85
  getProductsPageById(id: number, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
86
86
  /**
@@ -107,7 +107,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
107
107
  *
108
108
  * @param {string} [userQuery.sortKey] - Optional field to sort by
109
109
  *
110
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
110
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
111
111
  */
112
112
  getProductsPageByUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
113
113
  /**
@@ -126,7 +126,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
126
126
  *
127
127
  * @param {string} [userQuery.sortKey] - Optional field to sort by
128
128
  *
129
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
129
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
130
130
  */
131
131
  getRelatedProductsById(id: number, userQuery?: IProductsQuery): Promise<IProductsEntity>;
132
132
  /**
@@ -170,7 +170,7 @@ export default class ProductApi extends OneEntry implements IProductApi {
170
170
  *
171
171
  * @param {string} [userQuery.sortKey] - Optional field to sort by
172
172
  *
173
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
173
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
174
174
  */
175
175
  filterProduct(data: Array<IFilterParams>, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
176
176
  /**
@@ -180,16 +180,8 @@ export default class ProductApi extends OneEntry implements IProductApi {
180
180
  *
181
181
  * @param {string} [langCode] - Language code
182
182
  *
183
- * @returns {Promise<IProduct[]>} - Returns array of ContentIndexedProductDto object for the product.
183
+ * @returns {Promise<IProductsEntity[]>} - Returns array of ContentIndexedProductDto object for the product.
184
184
  */
185
185
  searchProduct(name: string, langCode?: string): Promise<Array<IProductsEntity>>;
186
- /**
187
- * Get all attributes of one Product.
188
- *
189
- * @param {number} [id] - Product id.
190
- *
191
- * @returns {Promise<IProduct[]>} - Returns array of set attributes.
192
- */
193
- getAttributesByProductId(id: number): Promise<any>;
194
186
  private _normalizeProductData;
195
187
  }
@@ -51,7 +51,7 @@ class ProductApi extends oneEntry_1.default {
51
51
  *
52
52
  * @param {string} [userQuery.sortKey] - Optional field to sort by
53
53
  *
54
- * @returns {Promise<IProduct[]>} - List of products.
54
+ * @returns {Promise<IProductsEntity[]>} - List of products.
55
55
  */
56
56
  getProducts(userQuery) {
57
57
  return __awaiter(this, void 0, void 0, function* () {
@@ -82,7 +82,7 @@ class ProductApi extends oneEntry_1.default {
82
82
  *
83
83
  * @param {string} [userQuery.sortKey] - Optional field to sort by
84
84
  *
85
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
85
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
86
86
  */
87
87
  getProductsEmptyPage(userQuery) {
88
88
  return __awaiter(this, void 0, void 0, function* () {
@@ -115,7 +115,7 @@ class ProductApi extends oneEntry_1.default {
115
115
  *
116
116
  * @param {string} [userQuery.sortKey] - Optional field to sort by
117
117
  *
118
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
118
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
119
119
  */
120
120
  getProductsPageById(id, userQuery) {
121
121
  return __awaiter(this, void 0, void 0, function* () {
@@ -148,7 +148,7 @@ class ProductApi extends oneEntry_1.default {
148
148
  *
149
149
  * @param {string} [userQuery.sortKey] - Optional field to sort by
150
150
  *
151
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
151
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
152
152
  */
153
153
  getProductsPageByUrl(url, userQuery) {
154
154
  return __awaiter(this, void 0, void 0, function* () {
@@ -173,7 +173,7 @@ class ProductApi extends oneEntry_1.default {
173
173
  *
174
174
  * @param {string} [userQuery.sortKey] - Optional field to sort by
175
175
  *
176
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
176
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
177
177
  */
178
178
  getRelatedProductsById(id, userQuery) {
179
179
  return __awaiter(this, void 0, void 0, function* () {
@@ -235,7 +235,7 @@ class ProductApi extends oneEntry_1.default {
235
235
  *
236
236
  * @param {string} [userQuery.sortKey] - Optional field to sort by
237
237
  *
238
- * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
238
+ * @returns {Promise<IProductsEntity[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
239
239
  */
240
240
  filterProduct(data, userQuery) {
241
241
  return __awaiter(this, void 0, void 0, function* () {
@@ -251,7 +251,7 @@ class ProductApi extends oneEntry_1.default {
251
251
  *
252
252
  * @param {string} [langCode] - Language code
253
253
  *
254
- * @returns {Promise<IProduct[]>} - Returns array of ContentIndexedProductDto object for the product.
254
+ * @returns {Promise<IProductsEntity[]>} - Returns array of ContentIndexedProductDto object for the product.
255
255
  */
256
256
  searchProduct(name, langCode = 'en_US') {
257
257
  return __awaiter(this, void 0, void 0, function* () {
@@ -265,19 +265,6 @@ class ProductApi extends oneEntry_1.default {
265
265
  return productsList;
266
266
  });
267
267
  }
268
- /**
269
- * Get all attributes of one Product.
270
- *
271
- * @param {number} [id] - Product id.
272
- *
273
- * @returns {Promise<IProduct[]>} - Returns array of set attributes.
274
- */
275
- getAttributesByProductId(id) {
276
- return __awaiter(this, void 0, void 0, function* () {
277
- const product = yield this.getProductById(id);
278
- return product.attributeValues;
279
- });
280
- }
281
268
  _normalizeProductData(product, langSet) {
282
269
  return __awaiter(this, void 0, void 0, function* () {
283
270
  const normalizeProduct = Object.assign({}, product);
@@ -1 +1 @@
1
- {"version":3,"file":"productsApi.js","sourceRoot":"","sources":["../../src/products/productsApi.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+CAAuC;AAEvC;;GAEG;AACH,MAAqB,UAAW,SAAQ,kBAAQ;IAC5C,YAAY,GAAU;QAClB,KAAK,CAAC,GAAG,CAAC,CAAA;QAIN,kBAAa,GAAkB;Y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*
5
+ * @property {function} getProducts - Search for all product page objects with pagination and filtering.
6
+ *
7
+ * @property {function} getProductsEmptyPage - Search for all product page objects with pagination that do not have a category.
8
+ *
9
+ * @property {function} getProductsPageById - Search for all product page objects with pagination for the selected category.
10
+ *
11
+ * @property {function} getProductsPageByUrl - Search for all product page objects with pagination for the selected category (by its URL).
12
+ *
13
+ * @property {function} getRelatedProductsById - Find all related product page objects.
14
+ *
15
+ * @property {function} getProductById - Retrieve one product object.
16
+ *
17
+ * @property {function} filterProduct - Find all product page objects with pagination and multiple filtering.
18
+ *
19
+ * @property {function} searchProduct - Quick search for product page objects with limited output.
20
+ */
2
21
  interface IProductApi {
3
22
  getProducts(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
4
23
  getProductsEmptyPage(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
@@ -8,22 +27,21 @@ interface IProductApi {
8
27
  getProductById(id: number, langCode: string): Promise<IProductsEntity>;
9
28
  filterProduct(data: Array<IFilterParams>, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
10
29
  searchProduct(name: string, langCode: string): Promise<Array<IProductsEntity>>;
11
- getAttributesByProductId(id: number): Promise<any>;
12
- }
13
- interface IProduct {
14
- attributeSetId: number | null;
15
- attributeValues: object | null;
16
- id: number;
17
- isSync: number;
18
- isVisible: boolean;
19
- localizeInfos: object;
20
- position: number;
21
- price?: number;
22
- relatedIds: number[];
23
- shortDescTemplateIdentifier: string | number | null;
24
- statusId: number | null;
25
- templateIdentifier: string | number | null;
26
30
  }
31
+ /**
32
+ * Represents a product query parameters object.
33
+ *
34
+ * @interface
35
+ * @property {number} offset - Parameter for pagination, default 0.
36
+ * @property {number} limit - Parameter for pagination, default 30.
37
+ * @property {string | null} statusMarker - Product page status id, default null.
38
+ * @property {string | null} conditionValue - The value that is being searched for, default null.
39
+ * @property {string | null} conditionMarker - Id of the filter condition by which the values are filtered, default null.
40
+ * @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
41
+ * @property {string} sortOrder - Sort order 'DESC' | 'ASC', default 'DESC'.
42
+ * @property {string} langCode - localization language code (used only when searching with a filter, default 'en_US'.
43
+ * @property {string} sortKey - Sorting field, default null.
44
+ */
27
45
  interface IProductsQuery {
28
46
  offset?: number;
29
47
  limit?: number;
@@ -46,17 +64,54 @@ interface IProductsQuery {
46
64
  sortKey?: string;
47
65
  [key: string]: string | number | null;
48
66
  }
67
+ /**
68
+ * Represents a product POST data object.
69
+ *
70
+ * @interface
71
+ * @property {number | null} conditionValue - The value that is being searched for, default null.
72
+ * @property {string | null} conditionMarker - Id of the filter condition by which the values are filtered, default null.
73
+ * @property {string | null} attributeMarker - The text identifier of the indexed attribute by which values are filtered, default null.
74
+ * @property {number | null} pageId - Id of the category page object.
75
+ */
49
76
  interface IFilterParams {
50
77
  attributeMarker: string;
51
- conditionMarker: string;
78
+ /**
79
+ * 'in' - Contains,
80
+ * 'nin' - Does not contain,
81
+ * 'eq' - Equal,
82
+ * 'neq' - Not equal,
83
+ * 'mth' - Greater than,
84
+ * 'lth' - Less than,
85
+ * 'exs' - Exists,
86
+ * 'nexs' - Does not exist
87
+ */
88
+ conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
52
89
  conditionValue: number;
53
90
  pageId?: number;
54
91
  }
92
+ /**
93
+ * Represents a product entity object.
94
+ *
95
+ * @interface
96
+ * @property {number} id - The unique identifier.
97
+ * @property {ILocalizeInfos} localizeInfos - The name of the products, taking into account localization.
98
+ * @property {boolean} isVisible - A sign of page visibility.
99
+ * @property {number | null} statusId - Product page status identifiers (may be null).
100
+ * @property {Array<number>} relatedIds - Ids of related product pages.
101
+ * @property {object} productPages - ProductPageEntity objects associated with the product page.
102
+ * @property {number} attributeSetId - Set of attributes id.
103
+ * @property {number} version - Page modification version number.
104
+ * @property {boolean} isSync - Indication of page indexing.
105
+ * @property {number} price - The value of the product page price taken from the index.
106
+ * @property {string} templateIdentifier - User id of the linked template.
107
+ * @property {string} shortDescTemplateIdentifier - User id of the linked template for a short description.
108
+ * @property {number} position - Item number (for sorting).
109
+ */
55
110
  interface IProductsEntity {
56
111
  id: number;
57
112
  localizeInfos: ILocalizeInfos;
58
113
  isVisible: boolean;
59
- statusId: number;
114
+ statusId: number | null;
60
115
  relatedIds: number[];
61
116
  productPages: {
62
117
  id: number;
@@ -80,4 +135,4 @@ interface IProductsEntity {
80
135
  };
81
136
  position: number;
82
137
  }
83
- export { IFilterParams, IProductsQuery, IProduct, IProductApi, IProductsEntity };
138
+ export { IFilterParams, IProductsQuery, IProductApi, IProductsEntity };
@@ -8,8 +8,6 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
8
8
  /**
9
9
  * Get all template objects grouped by types.
10
10
  *
11
- * @param {number} [id] - Status id
12
- *
13
11
  * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
14
12
  */
15
13
  getAllTemplates(): Promise<Array<ITemplateEntity>>;
@@ -18,21 +18,9 @@ class TemplatesPreviewApi extends oneEntry_1.default {
18
18
  super(url);
19
19
  this._url += '/api/content/templates';
20
20
  }
21
- // /**
22
- // * Get all template objects of a specific type.
23
- // *
24
- // * @returns Returns an array of product status objects
25
- // */
26
- // public async getTemplatesByType(type:string):Promise<Array<ITemplateEntity>> {
27
- // //TODO уточнить парметр type
28
- // const result = await this._fetchGet(`?type=${type}`)
29
- // return result
30
- // }
31
21
  /**
32
22
  * Get all template objects grouped by types.
33
23
  *
34
- * @param {number} [id] - Status id
35
- *
36
24
  * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
37
25
  */
38
26
  getAllTemplates() {
@@ -1 +1 @@
1
- {"version":3,"file":"templatesApi.js","sourceRoot":"","sources":["../../src/templates/templatesApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+CAAuC;AAGvC;;GAEG;AACH,MAAqB,mBAAoB,SAAQ,kBAAQ;IACrD,YAAY,GAAW;QACnB,KAAK,CAAC,G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AC,CAAA;YAC7C,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;IAED;;;;;;OAMG;IACU,mBAAmB,CAAC,MAAa;;YAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,MAAM,EAAE,CAAC,CAAA;YACxD,OAAO,MAAM,CAAA;QACjB,CAAC;KAAA;CACJ;AAvCD,sCAuCC"}
@@ -1,30 +1,49 @@
1
1
  import { IGeneralTypesEntity } from "../general-types/generalTypesInterfaces";
2
2
  import { ILocalizeInfos } from "../base/utils";
3
+ import { IPosition } from "../admins/adminsInterfaces";
4
+ import { IAttributeSet } from "../attribute-set/attributeSetInterfaces";
5
+ /**
6
+ * Represents an interface object of Templates Api.
7
+ *
8
+ * @property {function} getAllTemplates - Get all template objects grouped by types.
9
+ *
10
+ * @property {function} getTemplateById - Get one template object by id.
11
+ *
12
+ * @property {function} getTemplateByMarker - Get a single template object by marker.
13
+ */
3
14
  interface ITemplatesApi {
4
15
  getAllTemplates(): Promise<Array<ITemplateEntity>>;
5
16
  getTemplateById(id: number): Promise<ITemplateEntity>;
6
17
  getTemplateByMarker(marker: string): Promise<ITemplateEntity>;
7
18
  }
19
+ /**
20
+ * Represents a template entity 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 {IAttributesSets} attributesSets - The attributes with values used by the object.
28
+ * @property {number} attributeSetId - The identifier of the attribute set being used.
29
+ * @property {IGeneralTypesEntity} generalType - General type Entity object.
30
+ * @property {number} generalTypeId - General type Entity id.
31
+ * @property {ILocalizeInfos} localizeInfos - The name of the template, taking into account localization.
32
+ * @property {IPosition} position - The position of the object.
33
+ * @property {number | string} positionId - Id of the item object.
34
+ *
35
+ */
8
36
  interface ITemplateEntity {
9
37
  id: number;
10
38
  updatedDate: string;
11
39
  version: number;
12
40
  identifier: string;
13
- attributesSets: {
14
- [key: string]: string;
15
- };
41
+ attributesSets: IAttributeSet;
16
42
  attributeSetId: number;
17
43
  generalType: IGeneralTypesEntity;
18
44
  generalTypeId: number;
19
45
  localizeInfos: ILocalizeInfos;
20
- position: {
21
- id: number;
22
- position: number | string;
23
- objectId: number;
24
- objectType: string;
25
- isLocked: boolean;
26
- objectCategoryId: number;
27
- };
46
+ position: IPosition;
28
47
  positionId: number | string;
29
48
  }
30
49
  export { ITemplatesApi, ITemplateEntity };
@@ -1,27 +1,43 @@
1
1
  import { ILocalizeInfos } from "../base/utils";
2
+ import { IPosition } from "../admins/adminsInterfaces";
3
+ import { IAttributeSet } from "../attribute-set/attributeSetInterfaces";
4
+ /**
5
+ * Represents an interface object of Templates Preview Api.
6
+ *
7
+ * @property {function} getTemplatesPreview - Get all template objects.
8
+ *
9
+ * @property {function} getTemplatesPreviewById - Get one template object by id.
10
+ *
11
+ * @property {function} getTemplatesPreviewByMarker - Get one template object by marker.
12
+ */
2
13
  interface ITemplatesPreview {
3
14
  getTemplatesPreview(): Promise<Array<ITemplatesPreviewEntity>>;
4
15
  getTemplatesPreviewById(id: number): Promise<ITemplatesPreviewEntity>;
5
16
  getTemplatesPreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
6
17
  }
18
+ /**
19
+ * Represents a template preview entity object.
20
+ *
21
+ * @interface
22
+ * @property {number} id - The unique identifier of the position.
23
+ * @property {Date | string} updatedDate - The date of last updated.
24
+ * @property {string} identifier - The textual identifier for the record field.
25
+ * @property {IAttributesSets} attributesSets - The attributes with values used by the object.
26
+ * @property {number} attributeSetId - The identifier of the attribute set being used.
27
+ * @property {ILocalizeInfos} localizeInfos - The name of the template, taking into account localization.
28
+ * @property {IPosition} position - The position of the object.
29
+ * @property {number | string} positionId - Id of the item object.
30
+ *
31
+ */
7
32
  interface ITemplatesPreviewEntity {
8
33
  id: number;
9
34
  updatedDate: string;
10
35
  version: number;
11
36
  identifier: string;
12
- attributesSets: {
13
- [key: string]: string;
14
- };
37
+ attributesSets: IAttributeSet;
15
38
  attributeSetId: number;
16
39
  localizeInfos: ILocalizeInfos;
17
- position: {
18
- id: number;
19
- position: number | string;
20
- objectId: number;
21
- objectType: string;
22
- isLocked: boolean;
23
- objectCategoryId: number | null;
24
- };
40
+ position: IPosition;
25
41
  positionId: number | string;
26
42
  }
27
43
  export { ITemplatesPreview, ITemplatesPreviewEntity };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",