oneentry 1.0.10 → 1.0.13

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 (226) hide show
  1. package/README.md +91 -215
  2. package/dist/_cjs/admins/adminsApi.d.ts +14 -0
  3. package/dist/_cjs/admins/adminsApi.js +34 -0
  4. package/dist/_cjs/admins/adminsApi.js.map +1 -0
  5. package/dist/_cjs/admins/adminsInterfaces.d.ts +32 -0
  6. package/dist/_cjs/admins/adminsInterfaces.js +3 -0
  7. package/dist/_cjs/admins/adminsInterfaces.js.map +1 -0
  8. package/dist/_cjs/attribute-set/attributeSetApi.d.ts +24 -0
  9. package/dist/_cjs/attribute-set/attributeSetApi.js +49 -0
  10. package/dist/_cjs/attribute-set/attributeSetApi.js.map +1 -0
  11. package/dist/_cjs/attribute-set/attributeSetInterfaces.d.ts +23 -0
  12. package/dist/_cjs/attribute-set/attributeSetInterfaces.js +3 -0
  13. package/dist/_cjs/attribute-set/attributeSetInterfaces.js.map +1 -0
  14. package/dist/_cjs/base/oneEntry.d.ts +9 -0
  15. package/dist/_cjs/base/oneEntry.js +55 -0
  16. package/dist/_cjs/base/oneEntry.js.map +1 -0
  17. package/dist/_cjs/base/utils.d.ts +32 -0
  18. package/dist/_cjs/base/utils.js +32 -0
  19. package/dist/_cjs/base/utils.js.map +1 -0
  20. package/dist/_cjs/forms/formsApi.d.ts +26 -0
  21. package/dist/_cjs/forms/formsApi.js +56 -0
  22. package/dist/_cjs/forms/formsApi.js.map +1 -0
  23. package/dist/_cjs/forms/formsInterfaces.d.ts +28 -0
  24. package/dist/_cjs/forms/formsInterfaces.js +3 -0
  25. package/dist/_cjs/forms/formsInterfaces.js.map +1 -0
  26. package/dist/_cjs/formsData/formsDataApi.d.ts +41 -0
  27. package/dist/_cjs/formsData/formsDataApi.js +71 -0
  28. package/dist/_cjs/formsData/formsDataApi.js.map +1 -0
  29. package/dist/_cjs/formsData/formsDataInterfaces.d.ts +25 -0
  30. package/dist/_cjs/formsData/formsDataInterfaces.js +3 -0
  31. package/dist/_cjs/formsData/formsDataInterfaces.js.map +1 -0
  32. package/dist/_cjs/general-types/generalTypesApi.d.ts +14 -0
  33. package/dist/_cjs/general-types/generalTypesApi.js +34 -0
  34. package/dist/_cjs/general-types/generalTypesApi.js.map +1 -0
  35. package/dist/_cjs/general-types/generalTypesInterfaces.d.ts +9 -0
  36. package/dist/_cjs/general-types/generalTypesInterfaces.js +3 -0
  37. package/dist/_cjs/general-types/generalTypesInterfaces.js.map +1 -0
  38. package/dist/_cjs/index.d.ts +35 -0
  39. package/dist/_cjs/index.js +55 -0
  40. package/dist/_cjs/index.js.map +1 -0
  41. package/dist/_cjs/locales/localesApi.d.ts +14 -0
  42. package/dist/_cjs/locales/localesApi.js +34 -0
  43. package/dist/_cjs/locales/localesApi.js.map +1 -0
  44. package/dist/_cjs/locales/localesInterfaces.d.ts +15 -0
  45. package/dist/_cjs/locales/localesInterfaces.js +3 -0
  46. package/dist/_cjs/locales/localesInterfaces.js.map +1 -0
  47. package/dist/_cjs/markers/markersApi.d.ts +35 -0
  48. package/dist/_cjs/markers/markersApi.js +65 -0
  49. package/dist/_cjs/markers/markersApi.js.map +1 -0
  50. package/dist/_cjs/markers/markersInterfaces.d.ts +16 -0
  51. package/dist/_cjs/markers/markersInterfaces.js +3 -0
  52. package/dist/_cjs/markers/markersInterfaces.js.map +1 -0
  53. package/dist/_cjs/menus/menusApi.d.ts +16 -0
  54. package/dist/_cjs/menus/menusApi.js +36 -0
  55. package/dist/_cjs/menus/menusApi.js.map +1 -0
  56. package/dist/_cjs/menus/menusInterfaces.d.ts +18 -0
  57. package/dist/_cjs/menus/menusInterfaces.js +3 -0
  58. package/dist/_cjs/menus/menusInterfaces.js.map +1 -0
  59. package/dist/_cjs/modules/modulesApi.d.ts +14 -0
  60. package/dist/_cjs/modules/modulesApi.js +34 -0
  61. package/dist/_cjs/modules/modulesApi.js.map +1 -0
  62. package/dist/_cjs/modules/modulesInterfaces.d.ts +19 -0
  63. package/dist/_cjs/modules/modulesInterfaces.js +3 -0
  64. package/dist/_cjs/modules/modulesInterfaces.js.map +1 -0
  65. package/dist/_cjs/pages/pagesApi.d.ts +74 -0
  66. package/dist/_cjs/pages/pagesApi.js +137 -0
  67. package/dist/_cjs/pages/pagesApi.js.map +1 -0
  68. package/dist/_cjs/pages/pagesInterfaces.d.ts +39 -0
  69. package/dist/_cjs/pages/pagesInterfaces.js +3 -0
  70. package/dist/_cjs/pages/pagesInterfaces.js.map +1 -0
  71. package/dist/_cjs/product-statuses/productStatusesApi.d.ts +38 -0
  72. package/dist/_cjs/product-statuses/productStatusesApi.js +73 -0
  73. package/dist/_cjs/product-statuses/productStatusesApi.js.map +1 -0
  74. package/dist/_cjs/product-statuses/productStatusesInterfaces.d.ts +15 -0
  75. package/dist/_cjs/product-statuses/productStatusesInterfaces.js +3 -0
  76. package/dist/_cjs/product-statuses/productStatusesInterfaces.js.map +1 -0
  77. package/dist/_cjs/products/productsApi.d.ts +195 -0
  78. package/dist/_cjs/products/productsApi.js +295 -0
  79. package/dist/_cjs/products/productsApi.js.map +1 -0
  80. package/dist/_cjs/products/productsInterfaces.d.ts +83 -0
  81. package/dist/_cjs/products/productsInterfaces.js +3 -0
  82. package/dist/_cjs/products/productsInterfaces.js.map +1 -0
  83. package/dist/_cjs/templates/templatesApi.d.ts +32 -0
  84. package/dist/_cjs/templates/templatesApi.js +72 -0
  85. package/dist/_cjs/templates/templatesApi.js.map +1 -0
  86. package/dist/_cjs/templates/templatesInterfaces.d.ts +30 -0
  87. package/dist/_cjs/templates/templatesInterfaces.js +3 -0
  88. package/dist/_cjs/templates/templatesInterfaces.js.map +1 -0
  89. package/dist/_cjs/templates-preview/templatesPreviewApi.d.ts +30 -0
  90. package/dist/_cjs/templates-preview/templatesPreviewApi.js +60 -0
  91. package/dist/_cjs/templates-preview/templatesPreviewApi.js.map +1 -0
  92. package/dist/_cjs/templates-preview/templatesPreviewInterfaces.d.ts +27 -0
  93. package/dist/_cjs/templates-preview/templatesPreviewInterfaces.js +3 -0
  94. package/dist/_cjs/templates-preview/templatesPreviewInterfaces.js.map +1 -0
  95. package/dist/_esm/admins/adminsApi.d.ts +14 -0
  96. package/dist/_esm/admins/adminsApi.js +31 -0
  97. package/dist/_esm/admins/adminsApi.js.map +1 -0
  98. package/dist/_esm/admins/adminsInterfaces.d.ts +32 -0
  99. package/dist/_esm/admins/adminsInterfaces.js +2 -0
  100. package/dist/_esm/admins/adminsInterfaces.js.map +1 -0
  101. package/dist/_esm/attribute-set/attributeSetApi.d.ts +24 -0
  102. package/dist/_esm/attribute-set/attributeSetApi.js +46 -0
  103. package/dist/_esm/attribute-set/attributeSetApi.js.map +1 -0
  104. package/dist/_esm/attribute-set/attributeSetInterfaces.d.ts +23 -0
  105. package/dist/_esm/attribute-set/attributeSetInterfaces.js +2 -0
  106. package/dist/_esm/attribute-set/attributeSetInterfaces.js.map +1 -0
  107. package/dist/_esm/base/oneEntry.d.ts +9 -0
  108. package/dist/_esm/base/oneEntry.js +52 -0
  109. package/dist/_esm/base/oneEntry.js.map +1 -0
  110. package/dist/_esm/base/utils.d.ts +32 -0
  111. package/dist/_esm/base/utils.js +30 -0
  112. package/dist/_esm/base/utils.js.map +1 -0
  113. package/dist/_esm/forms/formsApi.d.ts +26 -0
  114. package/dist/_esm/forms/formsApi.js +53 -0
  115. package/dist/_esm/forms/formsApi.js.map +1 -0
  116. package/dist/_esm/forms/formsInterfaces.d.ts +28 -0
  117. package/dist/_esm/forms/formsInterfaces.js +2 -0
  118. package/dist/_esm/forms/formsInterfaces.js.map +1 -0
  119. package/dist/_esm/formsData/formsDataApi.d.ts +41 -0
  120. package/dist/_esm/formsData/formsDataApi.js +68 -0
  121. package/dist/_esm/formsData/formsDataApi.js.map +1 -0
  122. package/dist/_esm/formsData/formsDataInterfaces.d.ts +25 -0
  123. package/dist/_esm/formsData/formsDataInterfaces.js +2 -0
  124. package/dist/_esm/formsData/formsDataInterfaces.js.map +1 -0
  125. package/dist/_esm/general-types/generalTypesApi.d.ts +14 -0
  126. package/dist/_esm/general-types/generalTypesApi.js +31 -0
  127. package/dist/_esm/general-types/generalTypesApi.js.map +1 -0
  128. package/dist/_esm/general-types/generalTypesInterfaces.d.ts +9 -0
  129. package/dist/_esm/general-types/generalTypesInterfaces.js +2 -0
  130. package/dist/_esm/general-types/generalTypesInterfaces.js.map +1 -0
  131. package/dist/_esm/index.d.ts +35 -0
  132. package/dist/_esm/index.js +51 -0
  133. package/dist/_esm/index.js.map +1 -0
  134. package/dist/_esm/locales/localesApi.d.ts +14 -0
  135. package/dist/_esm/locales/localesApi.js +31 -0
  136. package/dist/_esm/locales/localesApi.js.map +1 -0
  137. package/dist/_esm/locales/localesInterfaces.d.ts +15 -0
  138. package/dist/_esm/locales/localesInterfaces.js +2 -0
  139. package/dist/_esm/locales/localesInterfaces.js.map +1 -0
  140. package/dist/_esm/markers/markersApi.d.ts +35 -0
  141. package/dist/_esm/markers/markersApi.js +62 -0
  142. package/dist/_esm/markers/markersApi.js.map +1 -0
  143. package/dist/_esm/markers/markersInterfaces.d.ts +16 -0
  144. package/dist/_esm/markers/markersInterfaces.js +2 -0
  145. package/dist/_esm/markers/markersInterfaces.js.map +1 -0
  146. package/dist/_esm/menus/menusApi.d.ts +16 -0
  147. package/dist/_esm/menus/menusApi.js +33 -0
  148. package/dist/_esm/menus/menusApi.js.map +1 -0
  149. package/dist/_esm/menus/menusInterfaces.d.ts +18 -0
  150. package/dist/_esm/menus/menusInterfaces.js +2 -0
  151. package/dist/_esm/menus/menusInterfaces.js.map +1 -0
  152. package/dist/_esm/modules/modulesApi.d.ts +14 -0
  153. package/dist/_esm/modules/modulesApi.js +31 -0
  154. package/dist/_esm/modules/modulesApi.js.map +1 -0
  155. package/dist/_esm/modules/modulesInterfaces.d.ts +19 -0
  156. package/dist/_esm/modules/modulesInterfaces.js +2 -0
  157. package/dist/_esm/modules/modulesInterfaces.js.map +1 -0
  158. package/dist/_esm/pages/pagesApi.d.ts +74 -0
  159. package/dist/_esm/pages/pagesApi.js +134 -0
  160. package/dist/_esm/pages/pagesApi.js.map +1 -0
  161. package/dist/_esm/pages/pagesInterfaces.d.ts +39 -0
  162. package/dist/_esm/pages/pagesInterfaces.js +2 -0
  163. package/dist/_esm/pages/pagesInterfaces.js.map +1 -0
  164. package/dist/_esm/product-statuses/productStatusesApi.d.ts +38 -0
  165. package/dist/_esm/product-statuses/productStatusesApi.js +70 -0
  166. package/dist/_esm/product-statuses/productStatusesApi.js.map +1 -0
  167. package/dist/_esm/product-statuses/productStatusesInterfaces.d.ts +15 -0
  168. package/dist/_esm/product-statuses/productStatusesInterfaces.js +2 -0
  169. package/dist/_esm/product-statuses/productStatusesInterfaces.js.map +1 -0
  170. package/dist/_esm/products/productsApi.d.ts +195 -0
  171. package/dist/_esm/products/productsApi.js +292 -0
  172. package/dist/_esm/products/productsApi.js.map +1 -0
  173. package/dist/_esm/products/productsInterfaces.d.ts +83 -0
  174. package/dist/_esm/products/productsInterfaces.js +2 -0
  175. package/dist/_esm/products/productsInterfaces.js.map +1 -0
  176. package/dist/_esm/templates/templatesApi.d.ts +32 -0
  177. package/dist/_esm/templates/templatesApi.js +69 -0
  178. package/dist/_esm/templates/templatesApi.js.map +1 -0
  179. package/dist/_esm/templates/templatesInterfaces.d.ts +30 -0
  180. package/dist/_esm/templates/templatesInterfaces.js +2 -0
  181. package/dist/_esm/templates/templatesInterfaces.js.map +1 -0
  182. package/dist/_esm/templates-preview/templatesPreviewApi.d.ts +30 -0
  183. package/dist/_esm/templates-preview/templatesPreviewApi.js +57 -0
  184. package/dist/_esm/templates-preview/templatesPreviewApi.js.map +1 -0
  185. package/dist/_esm/templates-preview/templatesPreviewInterfaces.d.ts +27 -0
  186. package/dist/_esm/templates-preview/templatesPreviewInterfaces.js +2 -0
  187. package/dist/_esm/templates-preview/templatesPreviewInterfaces.js.map +1 -0
  188. package/dist/_types/admins/adminsApi.d.ts +14 -0
  189. package/dist/_types/admins/adminsInterfaces.d.ts +32 -0
  190. package/dist/_types/attribute-set/attributeSetApi.d.ts +24 -0
  191. package/dist/_types/attribute-set/attributeSetInterfaces.d.ts +23 -0
  192. package/dist/_types/base/oneEntry.d.ts +9 -0
  193. package/dist/_types/base/utils.d.ts +32 -0
  194. package/dist/_types/forms/formsApi.d.ts +26 -0
  195. package/dist/_types/forms/formsInterfaces.d.ts +28 -0
  196. package/dist/_types/formsData/formsDataApi.d.ts +41 -0
  197. package/dist/_types/formsData/formsDataInterfaces.d.ts +25 -0
  198. package/dist/_types/general-types/generalTypesApi.d.ts +14 -0
  199. package/dist/_types/general-types/generalTypesInterfaces.d.ts +9 -0
  200. package/dist/_types/index.d.ts +35 -0
  201. package/dist/_types/locales/localesApi.d.ts +14 -0
  202. package/dist/_types/locales/localesInterfaces.d.ts +15 -0
  203. package/dist/_types/markers/markersApi.d.ts +35 -0
  204. package/dist/_types/markers/markersInterfaces.d.ts +16 -0
  205. package/dist/_types/menus/menusApi.d.ts +16 -0
  206. package/dist/_types/menus/menusInterfaces.d.ts +18 -0
  207. package/dist/_types/modules/modulesApi.d.ts +14 -0
  208. package/dist/_types/modules/modulesInterfaces.d.ts +19 -0
  209. package/dist/_types/pages/pagesApi.d.ts +74 -0
  210. package/dist/_types/pages/pagesInterfaces.d.ts +39 -0
  211. package/dist/_types/product-statuses/productStatusesApi.d.ts +38 -0
  212. package/dist/_types/product-statuses/productStatusesInterfaces.d.ts +15 -0
  213. package/dist/_types/products/productsApi.d.ts +195 -0
  214. package/dist/_types/products/productsInterfaces.d.ts +83 -0
  215. package/dist/_types/templates/templatesApi.d.ts +32 -0
  216. package/dist/_types/templates/templatesInterfaces.d.ts +30 -0
  217. package/dist/_types/templates-preview/templatesPreviewApi.d.ts +30 -0
  218. package/dist/_types/templates-preview/templatesPreviewInterfaces.d.ts +27 -0
  219. package/dist/index.d.ts +0 -4
  220. package/dist/index.js +0 -8
  221. package/dist/index.js.map +1 -1
  222. package/dist/products/productsApi.d.ts +6 -4
  223. package/dist/products/productsApi.js +34 -7
  224. package/dist/products/productsApi.js.map +1 -1
  225. package/dist/products/productsInterfaces.d.ts +14 -3
  226. package/package.json +3 -2
@@ -0,0 +1,16 @@
1
+ import OneEntry from "../base/oneEntry";
2
+ import { IMenus, IMenusEntity } from "./menusInterfaces";
3
+ /**
4
+ * Controllers for working with menu objects
5
+ */
6
+ export default class MenusApi extends OneEntry implements IMenus {
7
+ constructor(url: string);
8
+ /**
9
+ * Get pages includes in menu by marker.
10
+ *
11
+ * @param {string} [marker] - Menu marker
12
+ *
13
+ * @returns Returns a single menu object as a ContentMenuDto object with included pages
14
+ */
15
+ getMenusByMarker(marker: string): Promise<IMenusEntity>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { ILocalizeInfos } from "../base/utils";
2
+ interface IMenus {
3
+ getMenusByMarker(marker: string): Promise<IMenusEntity>;
4
+ }
5
+ interface IMenusPages {
6
+ id: number;
7
+ pageUrl: string;
8
+ localizeInfos: ILocalizeInfos;
9
+ position: number;
10
+ parentId: number | null;
11
+ }
12
+ interface IMenusEntity {
13
+ id: number;
14
+ identifier: string;
15
+ localizeInfos: ILocalizeInfos;
16
+ pages: Array<IMenusPages>;
17
+ }
18
+ export { IMenus, IMenusEntity };
@@ -0,0 +1,14 @@
1
+ import OneEntry from "../base/oneEntry";
2
+ import { IModules, IModulesEntity } from "./modulesInterfaces";
3
+ /**
4
+ * Controllers for working with application modules
5
+ */
6
+ export default class ModulesApi extends OneEntry implements IModules {
7
+ constructor(url: string);
8
+ /**
9
+ * Get all modules.
10
+ *
11
+ * @returns Returns BaseModuleDto objects or an empty array [] if there is no data
12
+ */
13
+ getAllModules(): Promise<Array<IModulesEntity>>;
14
+ }
@@ -0,0 +1,19 @@
1
+ import { ILocalizeInfos } from "../base/utils";
2
+ interface IModules {
3
+ getAllModules(): Promise<Array<IModulesEntity>>;
4
+ }
5
+ interface IModulesEntity {
6
+ identifier: string;
7
+ isVisible: boolean;
8
+ type: string | null;
9
+ localizeInfos: ILocalizeInfos;
10
+ icon: string;
11
+ generalTypes: {
12
+ id: number;
13
+ type: string;
14
+ }[];
15
+ attributeSetTypes: [];
16
+ position: number | string;
17
+ positionId: number;
18
+ }
19
+ export { IModules, IModulesEntity };
@@ -0,0 +1,74 @@
1
+ import OneEntry from "../base/oneEntry";
2
+ import { IPageApi, IPageConfig, IPagesEntity } from "./pagesInterfaces";
3
+ /**
4
+ * Controllers for working with page objects, including catalog pages
5
+ */
6
+ export default class PageApi extends OneEntry implements IPageApi {
7
+ constructor(url: string);
8
+ /**
9
+ * Get all top-level page objects.
10
+ *
11
+ * @param {string} [langCode] Required parameter lang code
12
+ *
13
+ * @returns Returns all created pages without parents as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
14
+ */
15
+ getRootPages(langCode: string): Promise<Array<IPagesEntity>>;
16
+ /**
17
+ * Get all page objects with product information as an array.
18
+ *
19
+ * @param {string} [langCode] Required parameter lang code
20
+ *
21
+ * @param {number} [limit] - Optional parameter for pagination, default is 30
22
+ *
23
+ * @param {number} [offset] - Optional parameter for pagination, default is 0
24
+ *
25
+ * @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
26
+ */
27
+ getCatalogPages(langCode: string, limit?: number, offset?: number): Promise<Array<IPagesEntity>>;
28
+ /**
29
+ * Get all page objects with product information as an array.
30
+ *
31
+ * @param {string} [langCode] Required parameter lang code
32
+ *
33
+ * @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
34
+ */
35
+ getPages(langCode: string): Promise<Array<IPagesEntity>>;
36
+ /**
37
+ * Get page object with information about forms, blocks, menus, linked to the page.
38
+ *
39
+ * @param {string} [langCode] Required parameter lang code
40
+ *
41
+ * @param {number} [id] - Page object identifier
42
+ *
43
+ * @returns Returns page object (DTO depends on the type of page being returned)
44
+ */
45
+ getPageById(id: number, langCode: string): Promise<IPagesEntity>;
46
+ /**
47
+ * Get page object with information about forms, blocks, menus, linked to the page by URL.
48
+ *
49
+ * @param {string} [langCode] Required parameter lang code
50
+ *
51
+ * @param {string} [url] - Page URL
52
+ *
53
+ * @returns Returns page object (DTO depends on the type of page being returned)
54
+ */
55
+ getPageByUrl(url: string, langCode: string): Promise<IPagesEntity>;
56
+ /**
57
+ * Get settings for the page.
58
+ *
59
+ * @param {string} [url] - Page URL
60
+ *
61
+ * @returns Returns a ConfigPageDto object with page display settings
62
+ */
63
+ getConfigPageByUrl(url: string): Promise<IPageConfig>;
64
+ /**
65
+ * Quick search for page objects with limited output.
66
+ *
67
+ * @param {string} [name] - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account)
68
+ *
69
+ * @param {string} [langCode] Required parameter lang code
70
+ *
71
+ * @returns Returns all created pages as an array of ContentIndexedPageDto objects or an empty array [] (if there is no data)
72
+ */
73
+ searchPage(name: string, langCode: string): Promise<IPagesEntity>;
74
+ }
@@ -0,0 +1,39 @@
1
+ import { ILocalizeInfos, Types } from "../base/utils";
2
+ interface IPageApi {
3
+ getRootPages(langCode: string): Promise<Array<IPagesEntity>>;
4
+ getCatalogPages(langCode: string, limit: number, offset: number): Promise<Array<IPagesEntity>>;
5
+ getPages(langCode: string): Promise<Array<IPagesEntity>>;
6
+ getPageById(id: number, langCode: string): Promise<IPagesEntity>;
7
+ getPageByUrl(url: string, langCode: string): Promise<IPagesEntity>;
8
+ getConfigPageByUrl(url: string): Promise<IPageConfig>;
9
+ searchPage(name: string, langCode: string): Promise<IPagesEntity>;
10
+ }
11
+ interface IPageConfig {
12
+ rowsPerPage: number;
13
+ productsPerRow: number;
14
+ }
15
+ interface IPagesEntity {
16
+ id: number;
17
+ parentId: number;
18
+ config: Record<string, number>;
19
+ pageUrl: string;
20
+ depth: number;
21
+ localizeInfos: ILocalizeInfos;
22
+ isVisible: boolean;
23
+ isEditorDisabled: boolean;
24
+ products: number;
25
+ attributeSetId: number;
26
+ templateIdentifier: string;
27
+ /**
28
+ * Language-specific attribute values.
29
+ * @example attributeValues['en_US']
30
+ *
31
+ * @property {langCode.<object>}
32
+ */
33
+ attributeValues: {
34
+ [langCode: string]: object;
35
+ };
36
+ position: string;
37
+ type: Types;
38
+ }
39
+ export { IPageApi, IPageConfig, IPagesEntity };
@@ -0,0 +1,38 @@
1
+ import OneEntry from '../base/oneEntry';
2
+ import { IProductStatusEntity, IProductStatuses } from "./productStatusesInterfaces";
3
+ /**
4
+ * Controllers for working with product statuses
5
+ */
6
+ export default class ProductStatusesApi extends OneEntry implements IProductStatuses {
7
+ constructor(url: string);
8
+ /**
9
+ * Search for all product status objects.
10
+ *
11
+ * @returns Returns an array of product status objects
12
+ */
13
+ getProductStatuses(): Promise<Array<IProductStatusEntity>>;
14
+ /**
15
+ * Search for a product status object by identifier.
16
+ *
17
+ * @param {number} [id] - Status id
18
+ *
19
+ * @returns Returns a product status object
20
+ */
21
+ getProductStatusesById(id: number): Promise<IProductStatusEntity>;
22
+ /**
23
+ * Search for a product status object by its textual identifier (marker).
24
+ *
25
+ * @param {string} [marker] - Product marker
26
+ *
27
+ * @returns Returns a product status object
28
+ */
29
+ getProductsByStatusMarker(marker: string): Promise<IProductStatusEntity>;
30
+ /**
31
+ * Check the existence of a textual identifier.
32
+ *
33
+ * @param {string} [marker] - Product marker
34
+ *
35
+ * @returns Returns true if the textual identifier (marker) exists or false if it doesn't
36
+ */
37
+ validateMarker(marker: string): Promise<boolean>;
38
+ }
@@ -0,0 +1,15 @@
1
+ import { ILocalizeInfos } from "../base/utils";
2
+ interface IProductStatuses {
3
+ getProductStatuses(): Promise<Array<IProductStatusEntity>>;
4
+ getProductStatusesById(id: number): Promise<IProductStatusEntity>;
5
+ getProductsByStatusMarker(marker: string): Promise<IProductStatusEntity>;
6
+ validateMarker(marker: string): Promise<boolean>;
7
+ }
8
+ interface IProductStatusEntity {
9
+ id: number;
10
+ updatedDate: string;
11
+ version: number;
12
+ identifier: string;
13
+ localizeInfos: ILocalizeInfos;
14
+ }
15
+ export { IProductStatuses, IProductStatusEntity };
@@ -0,0 +1,195 @@
1
+ import { IProductsQuery, IFilterParams, IProductApi, IProductsEntity } from './productsInterfaces';
2
+ import OneEntry from '../base/oneEntry';
3
+ /**
4
+ * Controllers for working with product pages
5
+ */
6
+ export default class ProductApi extends OneEntry implements IProductApi {
7
+ constructor(url: string);
8
+ private _defaultQuery;
9
+ /**
10
+ * Search for all product page objects with pagination and filtering.
11
+ *
12
+ * @param {IProductsQuery} [userQuery] - Optional set query parameters.
13
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
14
+ *
15
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
16
+ *
17
+ * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
18
+ *
19
+ * @param {string} [userQuery.conditionValue] - Optional value that is being searched
20
+ *
21
+ * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
22
+ *
23
+ * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
24
+ *
25
+ * @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
26
+ *
27
+ * @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
28
+ *
29
+ * @param {string} [userQuery.sortKey] - Optional field to sort by
30
+ *
31
+ * @returns {Promise<IProduct[]>} - List of products.
32
+ */
33
+ getProducts(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
34
+ /**
35
+ * Search for all product page objects with pagination that do not have a category.
36
+ *
37
+ * @param {IProductsQuery} [userQuery] - Optional set query parameters.
38
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
39
+ *
40
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
41
+ *
42
+ * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
43
+ *
44
+ * @param {string} [userQuery.conditionValue] - Optional value that is being searched
45
+ *
46
+ * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
47
+ *
48
+ * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
49
+ *
50
+ * @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
51
+ *
52
+ * @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
53
+ *
54
+ * @param {string} [userQuery.sortKey] - Optional field to sort by
55
+ *
56
+ * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
57
+ */
58
+ getProductsEmptyPage(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
59
+ /**
60
+ * Search for all product page objects with pagination for the selected category.
61
+ *
62
+ * @param {number} [id] - Page identifier.
63
+ *
64
+ * @param {IProductsQuery} [userQuery] - Optional set query parameters.
65
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
66
+ *
67
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
68
+ *
69
+ * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
70
+ *
71
+ * @param {string} [userQuery.conditionValue] - Optional value that is being searched
72
+ *
73
+ * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
74
+ *
75
+ * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
76
+ *
77
+ * @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
78
+ *
79
+ * @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
80
+ *
81
+ * @param {string} [userQuery.sortKey] - Optional field to sort by
82
+ *
83
+ * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
84
+ */
85
+ getProductsPageById(id: number, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
86
+ /**
87
+ * Search for all product page objects with pagination for the selected category (by its URL).
88
+ *
89
+ * @param {string} [url] - URL of the category page.
90
+ *
91
+ * @param {IProductsQuery} [userQuery] - Optional set query parameters.
92
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
93
+ *
94
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
95
+ *
96
+ * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status
97
+ *
98
+ * @param {string} [userQuery.conditionValue] - Optional value that is being searched
99
+ *
100
+ * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered
101
+ *
102
+ * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered
103
+ *
104
+ * @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
105
+ *
106
+ * @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
107
+ *
108
+ * @param {string} [userQuery.sortKey] - Optional field to sort by
109
+ *
110
+ * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
111
+ */
112
+ getProductsPageByUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
113
+ /**
114
+ * Find all related product page objects.
115
+ *
116
+ * @param {number} [id] - Product page identifier for which to find relationship.
117
+ *
118
+ * @param {IProductsQuery} [userQuery] - Optional set query parameters.
119
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
120
+ *
121
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
122
+ *
123
+ * @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
124
+ *
125
+ * @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
126
+ *
127
+ * @param {string} [userQuery.sortKey] - Optional field to sort by
128
+ *
129
+ * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
130
+ */
131
+ getRelatedProductsById(id: number, userQuery?: IProductsQuery): Promise<IProductsEntity>;
132
+ /**
133
+ * Retrieve one product object.
134
+ *
135
+ * @param {number} [id] - Product id.
136
+ *
137
+ * @param {string | Array<string>} [langCode] Language code parameter. Default "en_US". Нou can also pass several language parameters ['en_US', 'it_IT']
138
+ *
139
+ * @returns {Promise<IProductsEntity>} - Returns ContentIndexedProductDto object for the product.
140
+ */
141
+ getProductById(id: number, langCode?: string | Array<string>): Promise<IProductsEntity>;
142
+ /**
143
+ * Find all product page objects with pagination and multiple filtering.
144
+ *
145
+ * @param {array} [data] - Request body.
146
+ *
147
+ * @example
148
+ * const objects = [
149
+ * {
150
+ * attributeMarker: "price",
151
+ * conditionMarker: "mth",
152
+ * conditionValue: 1,
153
+ * pageId: 0,
154
+ * },
155
+ * {
156
+ * attributeMarker: "price",
157
+ * conditionMarker: "lth",
158
+ * conditionValue: 3,
159
+ * pageId: 0,
160
+ * },
161
+ * ];
162
+ * @param {IProductsQuery} [userQuery] - Optional set query parameters.
163
+ * @param {number} [userQuery.limit] - Optional parameter for pagination, default is 0
164
+ *
165
+ * @param {number} [userQuery.offset] - Optional parameter for pagination, default is 30
166
+ *
167
+ * @param {string} [userQuery.langCode] Language code parameter. Default "en_US"
168
+ *
169
+ * @param {string} [userQuery.sortOrder] - Optional sorting order DESC | ASC
170
+ *
171
+ * @param {string} [userQuery.sortKey] - Optional field to sort by
172
+ *
173
+ * @returns {Promise<IProduct[]>} - Returns array of items, where item - ContentIndexedProductDto objects.
174
+ */
175
+ filterProduct(data: Array<IFilterParams>, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
176
+ /**
177
+ * Quick search for product page objects with limited output.
178
+ *
179
+ * @param {string} [name] - Text to search product page objects (search is based on the title field of the localizeInfos object with language consideration)
180
+ *
181
+ * @param {string} [langCode] - Language code
182
+ *
183
+ * @returns {Promise<IProduct[]>} - Returns array of ContentIndexedProductDto object for the product.
184
+ */
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
+ private _normalizeProductData;
195
+ }
@@ -0,0 +1,83 @@
1
+ import { ILocalizeInfos } from "../base/utils";
2
+ interface IProductApi {
3
+ getProducts(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
4
+ getProductsEmptyPage(userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
5
+ getProductsPageById(id: number, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
6
+ getProductsPageByUrl(url: string, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
7
+ getRelatedProductsById(id: number, userQuery?: IProductsQuery): Promise<IProductsEntity>;
8
+ getProductById(id: number, langCode: string): Promise<IProductsEntity>;
9
+ filterProduct(data: Array<IFilterParams>, userQuery?: IProductsQuery): Promise<Array<IProductsEntity>>;
10
+ 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
+ }
27
+ interface IProductsQuery {
28
+ offset?: number;
29
+ limit?: number;
30
+ statusMarker?: string | null;
31
+ conditionValue?: string | null;
32
+ /**
33
+ * 'in' - Contains,
34
+ * 'nin' - Does not contain,
35
+ * 'eq' - Equal,
36
+ * 'neq' - Not equal,
37
+ * 'mth' - Greater than,
38
+ * 'lth' - Less than,
39
+ * 'exs' - Exists,
40
+ * 'nexs' - Does not exist
41
+ */
42
+ conditionMarker?: 'in' | 'nin' | 'eq' | 'neq' | 'mth' | 'lth' | 'exs' | 'nexs' | null;
43
+ attributeMarker?: string | null;
44
+ sortOrder?: 'DESC' | 'ASC';
45
+ langCode?: string;
46
+ sortKey?: string;
47
+ [key: string]: string | number | null;
48
+ }
49
+ interface IFilterParams {
50
+ attributeMarker: string;
51
+ conditionMarker: string;
52
+ conditionValue: number;
53
+ pageId?: number;
54
+ }
55
+ interface IProductsEntity {
56
+ id: number;
57
+ localizeInfos: ILocalizeInfos;
58
+ isVisible: boolean;
59
+ statusId: number;
60
+ relatedIds: number[];
61
+ productPages: {
62
+ id: number;
63
+ pageId: number;
64
+ productId: number;
65
+ }[];
66
+ attributeSetId: number;
67
+ version: number;
68
+ isSync: number | boolean;
69
+ price: number;
70
+ templateIdentifier: string;
71
+ shortDescTemplateIdentifier: string;
72
+ /**
73
+ * Language-specific attribute values.
74
+ * @example attributeValues['en_US']
75
+ *
76
+ * @property {langCode.<object>}
77
+ */
78
+ attributeValues: {
79
+ [langCode: string]: object;
80
+ };
81
+ position: number;
82
+ }
83
+ export { IFilterParams, IProductsQuery, IProduct, IProductApi, IProductsEntity };
@@ -0,0 +1,32 @@
1
+ import OneEntry from '../base/oneEntry';
2
+ import { ITemplatesApi, ITemplateEntity } from './templatesInterfaces';
3
+ /**
4
+ * Controllers for working with template objects
5
+ */
6
+ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesApi {
7
+ constructor(url: string);
8
+ /**
9
+ * Get all template objects grouped by types.
10
+ *
11
+ * @param {number} [id] - Status id
12
+ *
13
+ * @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
14
+ */
15
+ getAllTemplates(): Promise<Array<ITemplateEntity>>;
16
+ /**
17
+ * Get one template object by id.
18
+ *
19
+ * @param {number} [id] - Product marker
20
+ *
21
+ * @returns Returns a TemplateEntity object
22
+ */
23
+ getTemplateById(id: number): Promise<ITemplateEntity>;
24
+ /**
25
+ * Get a single template object by marker.
26
+ *
27
+ * @param {string} [marker] - Product marker
28
+ *
29
+ * @returns Returns a TemplateEntity object
30
+ */
31
+ getTemplateByMarker(marker: string): Promise<ITemplateEntity>;
32
+ }
@@ -0,0 +1,30 @@
1
+ import { IGeneralTypesEntity } from "../general-types/generalTypesInterfaces";
2
+ import { ILocalizeInfos } from "../base/utils";
3
+ interface ITemplatesApi {
4
+ getAllTemplates(): Promise<Array<ITemplateEntity>>;
5
+ getTemplateById(id: number): Promise<ITemplateEntity>;
6
+ getTemplateByMarker(marker: string): Promise<ITemplateEntity>;
7
+ }
8
+ interface ITemplateEntity {
9
+ id: number;
10
+ updatedDate: string;
11
+ version: number;
12
+ identifier: string;
13
+ attributesSets: {
14
+ [key: string]: string;
15
+ };
16
+ attributeSetId: number;
17
+ generalType: IGeneralTypesEntity;
18
+ generalTypeId: number;
19
+ localizeInfos: ILocalizeInfos;
20
+ position: {
21
+ id: number;
22
+ position: number | string;
23
+ objectId: number;
24
+ objectType: string;
25
+ isLocked: boolean;
26
+ objectCategoryId: number;
27
+ };
28
+ positionId: number | string;
29
+ }
30
+ export { ITemplatesApi, ITemplateEntity };
@@ -0,0 +1,30 @@
1
+ import OneEntry from "../base/oneEntry";
2
+ import { ITemplatesPreview, ITemplatesPreviewEntity } from "./templatesPreviewInterfaces";
3
+ /**
4
+ * Controllers for working with template objects for preview
5
+ */
6
+ export default class PageApi extends OneEntry implements ITemplatesPreview {
7
+ constructor(url: string);
8
+ /**
9
+ * Get all template objects.
10
+ *
11
+ * @returns Returns all TemplatePreviewsEntity template objects
12
+ */
13
+ getTemplatesPreview(): Promise<Array<ITemplatesPreviewEntity>>;
14
+ /**
15
+ * Get one template object by id.
16
+ *
17
+ * @param {number} [id] - Product marker
18
+ *
19
+ * @returns Returns a TemplatePreviewsEntity object
20
+ */
21
+ getTemplatesPreviewById(id: number): Promise<ITemplatesPreviewEntity>;
22
+ /**
23
+ * Get one template object by marker.
24
+ *
25
+ * @param {string} [marker] - Product marker
26
+ *
27
+ * @returns Returns a TemplatePreviewsEntity object
28
+ */
29
+ getTemplatesPreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
30
+ }
@@ -0,0 +1,27 @@
1
+ import { ILocalizeInfos } from "../base/utils";
2
+ interface ITemplatesPreview {
3
+ getTemplatesPreview(): Promise<Array<ITemplatesPreviewEntity>>;
4
+ getTemplatesPreviewById(id: number): Promise<ITemplatesPreviewEntity>;
5
+ getTemplatesPreviewByMarker(marker: string): Promise<ITemplatesPreviewEntity>;
6
+ }
7
+ interface ITemplatesPreviewEntity {
8
+ id: number;
9
+ updatedDate: string;
10
+ version: number;
11
+ identifier: string;
12
+ attributesSets: {
13
+ [key: string]: string;
14
+ };
15
+ attributeSetId: number;
16
+ 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
+ };
25
+ positionId: number | string;
26
+ }
27
+ export { ITemplatesPreview, ITemplatesPreviewEntity };
package/dist/index.d.ts CHANGED
@@ -3,23 +3,19 @@ import PageApi from "./pages/pagesApi";
3
3
  import ProductStatusesApi from "./product-statuses/productStatusesApi";
4
4
  import TemplatesApi from "./templates/templatesApi";
5
5
  import TemplatesPreviewApi from "./templates-preview/templatesPreviewApi";
6
- import AttributeSetApi from "./attribute-set/attributeSetApi";
7
6
  import AdminsApi from "./admins/adminsApi";
8
7
  import GeneralTypesApi from "./general-types/generalTypesApi";
9
8
  import LocalesApi from "./locales/localesApi";
10
9
  import MenusApi from "./menus/menusApi";
11
- import ModulesApi from "./modules/modulesApi";
12
10
  import FormsApi from "./forms/formsApi";
13
11
  import FormsDataApi from "./formsData/formsDataApi";
14
12
  interface IDefineApi {
15
13
  Admins: AdminsApi;
16
- AttributeSet: AttributeSetApi;
17
14
  Forms: FormsApi;
18
15
  FormsData: FormsDataApi;
19
16
  GeneralTypes: GeneralTypesApi;
20
17
  Locales: LocalesApi;
21
18
  Menus: MenusApi;
22
- Modules: ModulesApi;
23
19
  Page: PageApi;
24
20
  Product: ProductApi;
25
21
  ProductStatus: ProductStatusesApi;