@sap/ux-specification 1.142.2 → 1.142.4

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 (235) hide show
  1. package/CHANGELOG.md +117 -43
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
  3. package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
  4. package/dist/documentation/v2/v2-ListReport.html +2 -2
  5. package/dist/documentation/v2/v2-ListReportNew.html +2 -2
  6. package/dist/documentation/v2/v2-ObjectPage.html +2 -2
  7. package/dist/documentation/v2/v2-OverviewPage.html +2 -2
  8. package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
  9. package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
  10. package/dist/documentation/v4/v4-FreestylePage.html +2 -2
  11. package/dist/documentation/v4/v4-ListReport.html +2 -2
  12. package/dist/documentation/v4/v4-ObjectPage.html +2 -2
  13. package/dist/index-min.js +288 -282
  14. package/dist/index-min.js.map +4 -4
  15. package/dist/schemas/v2/AnalyticalListPageConfig.json +3 -3
  16. package/dist/schemas/v2/ListReportConfig.json +5 -5
  17. package/dist/schemas/v2/ListReportNewConfig.json +1 -1
  18. package/dist/schemas/v2/ObjectPageConfig.json +5 -5
  19. package/dist/schemas/v4/ApplicationV4.json +1 -1
  20. package/dist/schemas/v4/BuildingBlocksConfig.json +128 -42
  21. package/dist/schemas/v4/ListReportConfig.json +24 -6
  22. package/dist/schemas/v4/ObjectPageConfig.json +32 -8
  23. package/dist/specification/package.json +14 -12
  24. package/dist/specification/scripts/extractDocu.js +18 -1
  25. package/dist/specification/scripts/extractDocu.js.map +1 -1
  26. package/dist/specification/scripts/generate-validity-report.d.ts +15 -0
  27. package/dist/specification/scripts/generate-validity-report.d.ts.map +1 -0
  28. package/dist/specification/scripts/generate-validity-report.js +367 -0
  29. package/dist/specification/scripts/generate-validity-report.js.map +1 -0
  30. package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
  31. package/dist/specification/scripts/macros/corrections.js +36 -1
  32. package/dist/specification/scripts/macros/corrections.js.map +1 -1
  33. package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
  34. package/dist/specification/scripts/macros/schema.js +13 -0
  35. package/dist/specification/scripts/macros/schema.js.map +1 -1
  36. package/dist/specification/src/api.js +1 -1
  37. package/dist/specification/src/i18n/i18n.d.ts.map +1 -1
  38. package/dist/specification/src/i18n/i18n.js +2 -1
  39. package/dist/specification/src/i18n/i18n.js.map +1 -1
  40. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts +8 -1
  41. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.d.ts.map +1 -1
  42. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js +10 -7
  43. package/dist/specification/src/sync/common/ManifestDrivenSchemaProcessor.js.map +1 -1
  44. package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts +503 -0
  45. package/dist/specification/src/sync/common/decoration/decorator-paths.d.ts.map +1 -0
  46. package/dist/specification/src/sync/common/decoration/decorator-paths.js +497 -0
  47. package/dist/specification/src/sync/common/decoration/decorator-paths.js.map +1 -0
  48. package/dist/specification/src/sync/common/decoration/decorators.d.ts +116 -24
  49. package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
  50. package/dist/specification/src/sync/common/decoration/decorators.js +308 -78
  51. package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
  52. package/dist/specification/src/sync/common/decoration/index.d.ts +1 -0
  53. package/dist/specification/src/sync/common/decoration/index.d.ts.map +1 -1
  54. package/dist/specification/src/sync/common/decoration/index.js +1 -0
  55. package/dist/specification/src/sync/common/decoration/index.js.map +1 -1
  56. package/dist/specification/src/sync/common/dist_tag.json +8 -3
  57. package/dist/specification/src/sync/common/generate/objectPage.d.ts.map +1 -1
  58. package/dist/specification/src/sync/common/generate/objectPage.js +3 -1
  59. package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
  60. package/dist/specification/src/sync/common/i18n.json +2 -1
  61. package/dist/specification/src/sync/common/rules.d.ts +25 -0
  62. package/dist/specification/src/sync/common/rules.d.ts.map +1 -1
  63. package/dist/specification/src/sync/common/rules.js +27 -2
  64. package/dist/specification/src/sync/common/rules.js.map +1 -1
  65. package/dist/specification/src/sync/common/utils.d.ts +22 -6
  66. package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
  67. package/dist/specification/src/sync/common/utils.js +122 -18
  68. package/dist/specification/src/sync/common/utils.js.map +1 -1
  69. package/dist/specification/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
  70. package/dist/specification/src/sync/v2/generate/analyticalListReport.js +9 -7
  71. package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  72. package/dist/specification/src/sync/v2/generate/listReport.d.ts.map +1 -1
  73. package/dist/specification/src/sync/v2/generate/listReport.js +3 -1
  74. package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
  75. package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
  76. package/dist/specification/src/sync/v2/generate/objectPage.js +58 -2
  77. package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
  78. package/dist/specification/src/sync/v2/generate/overviewPage.d.ts +1 -9
  79. package/dist/specification/src/sync/v2/generate/overviewPage.d.ts.map +1 -1
  80. package/dist/specification/src/sync/v2/generate/overviewPage.js +30 -1
  81. package/dist/specification/src/sync/v2/generate/overviewPage.js.map +1 -1
  82. package/dist/specification/src/sync/v2/import/app/appProvider.d.ts.map +1 -1
  83. package/dist/specification/src/sync/v2/import/app/appProvider.js +2 -0
  84. package/dist/specification/src/sync/v2/import/app/appProvider.js.map +1 -1
  85. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts +2 -1
  86. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -1
  87. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js +5 -0
  88. package/dist/specification/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
  89. package/dist/specification/src/sync/v2/import/pages/listReport.d.ts +2 -1
  90. package/dist/specification/src/sync/v2/import/pages/listReport.d.ts.map +1 -1
  91. package/dist/specification/src/sync/v2/import/pages/listReport.js +5 -0
  92. package/dist/specification/src/sync/v2/import/pages/listReport.js.map +1 -1
  93. package/dist/specification/src/sync/v2/import/pages/objectPage.d.ts.map +1 -1
  94. package/dist/specification/src/sync/v2/import/pages/objectPage.js +2 -1
  95. package/dist/specification/src/sync/v2/import/pages/objectPage.js.map +1 -1
  96. package/dist/specification/src/sync/v2/import/utils.d.ts +28 -1
  97. package/dist/specification/src/sync/v2/import/utils.d.ts.map +1 -1
  98. package/dist/specification/src/sync/v2/import/utils.js +37 -0
  99. package/dist/specification/src/sync/v2/import/utils.js.map +1 -1
  100. package/dist/specification/src/sync/v2/utils.d.ts +12 -2
  101. package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
  102. package/dist/specification/src/sync/v2/utils.js +19 -2
  103. package/dist/specification/src/sync/v2/utils.js.map +1 -1
  104. package/dist/specification/src/sync/v4/application.d.ts +31 -2
  105. package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
  106. package/dist/specification/src/sync/v4/application.js +44 -4
  107. package/dist/specification/src/sync/v4/application.js.map +1 -1
  108. package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts +2 -1
  109. package/dist/specification/src/sync/v4/export/controls/FilterBar.d.ts.map +1 -1
  110. package/dist/specification/src/sync/v4/export/controls/FilterBar.js +2 -1
  111. package/dist/specification/src/sync/v4/export/controls/FilterBar.js.map +1 -1
  112. package/dist/specification/src/sync/v4/export/controls/Header.d.ts +4 -3
  113. package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
  114. package/dist/specification/src/sync/v4/export/controls/Header.js +7 -3
  115. package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
  116. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +2 -1
  117. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
  118. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +7 -0
  119. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
  120. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts +2 -1
  121. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.d.ts.map +1 -1
  122. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js +2 -1
  123. package/dist/specification/src/sync/v4/export/controls/ObjectPageCustomSection.js.map +1 -1
  124. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts +1 -1
  125. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.d.ts.map +1 -1
  126. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js +0 -13
  127. package/dist/specification/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
  128. package/dist/specification/src/sync/v4/export/controls/Table.d.ts +32 -17
  129. package/dist/specification/src/sync/v4/export/controls/Table.d.ts.map +1 -1
  130. package/dist/specification/src/sync/v4/export/controls/Table.js +90 -60
  131. package/dist/specification/src/sync/v4/export/controls/Table.js.map +1 -1
  132. package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -1
  133. package/dist/specification/src/sync/v4/export/controls/TableColumn.js +2 -2
  134. package/dist/specification/src/sync/v4/export/controls/TableColumn.js.map +1 -1
  135. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +2 -1
  136. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
  137. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +4 -3
  138. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
  139. package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
  140. package/dist/specification/src/sync/v4/export/export.js +25 -3
  141. package/dist/specification/src/sync/v4/export/export.js.map +1 -1
  142. package/dist/specification/src/sync/v4/export/pages/ListReport.js +1 -1
  143. package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
  144. package/dist/specification/src/sync/v4/generate/actions.d.ts +1 -1
  145. package/dist/specification/src/sync/v4/generate/actions.d.ts.map +1 -1
  146. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts.map +1 -1
  147. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +20 -12
  148. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
  149. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.d.ts.map +1 -1
  150. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +10 -1
  151. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
  152. package/dist/specification/src/sync/v4/generate/index.d.ts +1 -1
  153. package/dist/specification/src/sync/v4/generate/index.d.ts.map +1 -1
  154. package/dist/specification/src/sync/v4/generate/index.js +1 -1
  155. package/dist/specification/src/sync/v4/generate/index.js.map +1 -1
  156. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts +73 -0
  157. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.d.ts.map +1 -0
  158. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js +354 -0
  159. package/dist/specification/src/sync/v4/generate/list-report/ListReportUtils.js.map +1 -0
  160. package/dist/specification/src/sync/v4/generate/{listReport.d.ts → list-report/listReport.d.ts} +27 -16
  161. package/dist/specification/src/sync/v4/generate/list-report/listReport.d.ts.map +1 -0
  162. package/dist/specification/src/sync/v4/generate/{listReport.js → list-report/listReport.js} +194 -164
  163. package/dist/specification/src/sync/v4/generate/list-report/listReport.js.map +1 -0
  164. package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
  165. package/dist/specification/src/sync/v4/generate/objectPage.js +145 -44
  166. package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
  167. package/dist/specification/src/sync/v4/import/pages/listReport.d.ts.map +1 -1
  168. package/dist/specification/src/sync/v4/import/pages/listReport.js +2 -1
  169. package/dist/specification/src/sync/v4/import/pages/listReport.js.map +1 -1
  170. package/dist/specification/src/sync/v4/import/utils.js +5 -3
  171. package/dist/specification/src/sync/v4/import/utils.js.map +1 -1
  172. package/dist/specification/src/sync/v4/sync-rules/App.d.ts +9 -7
  173. package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -1
  174. package/dist/specification/src/sync/v4/sync-rules/App.js +4 -8
  175. package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -1
  176. package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +2 -9
  177. package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -1
  178. package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +2 -11
  179. package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -1
  180. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +219 -96
  181. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -1
  182. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +557 -211
  183. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -1
  184. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +17 -22
  185. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -1
  186. package/dist/specification/src/sync/v4/sync-rules/Page.js +15 -22
  187. package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -1
  188. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts +1 -0
  189. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.d.ts.map +1 -1
  190. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js +17 -9
  191. package/dist/specification/src/sync/v4/sync-rules/controllerExtensions.js.map +1 -1
  192. package/dist/specification/src/sync/v4/sync-rules/index.d.ts +5 -0
  193. package/dist/specification/src/sync/v4/sync-rules/index.d.ts.map +1 -0
  194. package/dist/specification/src/sync/v4/sync-rules/index.js +21 -0
  195. package/dist/specification/src/sync/v4/sync-rules/index.js.map +1 -0
  196. package/dist/specification/src/sync/v4/sync-rules/utils.d.ts.map +1 -1
  197. package/dist/specification/src/sync/v4/sync-rules/utils.js +4 -0
  198. package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -1
  199. package/dist/specification/src/sync/v4/utils/index.d.ts +2 -0
  200. package/dist/specification/src/sync/v4/utils/index.d.ts.map +1 -0
  201. package/dist/specification/src/sync/v4/utils/index.js +18 -0
  202. package/dist/specification/src/sync/v4/utils/index.js.map +1 -0
  203. package/dist/specification/src/sync/v4/utils/utils.d.ts +9 -1
  204. package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
  205. package/dist/specification/src/sync/v4/utils/utils.js +17 -2
  206. package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
  207. package/dist/specification/test/test-projects/v2sttaProdMan2/webapp/manifest.json +550 -0
  208. package/dist/specification/test/test-projects/v4new/webapp/manifest.json +147 -0
  209. package/dist/specification/test/test-utils/utils.d.ts +71 -0
  210. package/dist/specification/test/test-utils/utils.d.ts.map +1 -0
  211. package/dist/specification/test/test-utils/utils.js +400 -0
  212. package/dist/specification/test/test-utils/utils.js.map +1 -0
  213. package/dist/specification/test/unit/decorators/validity-test-utils.d.ts +131 -0
  214. package/dist/specification/test/unit/decorators/validity-test-utils.d.ts.map +1 -0
  215. package/dist/specification/test/unit/decorators/validity-test-utils.js +661 -0
  216. package/dist/specification/test/unit/decorators/validity-test-utils.js.map +1 -0
  217. package/dist/types/src/apiTypes.d.ts +2 -3
  218. package/dist/types/src/apiTypes.d.ts.map +1 -1
  219. package/dist/types/src/apiTypes.js.map +1 -1
  220. package/dist/types/src/common/types.d.ts +119 -13
  221. package/dist/types/src/common/types.d.ts.map +1 -1
  222. package/dist/types/src/common/types.js.map +1 -1
  223. package/dist/types/src/v2/controls/ObjectPageTable.d.ts +1 -1
  224. package/dist/types/src/v2/controls/Table.d.ts +1 -1
  225. package/dist/types/src/v4/controls/ObjectPageTable.d.ts +1 -1
  226. package/dist/types/src/v4/controls/ObjectPageTable.d.ts.map +1 -1
  227. package/dist/types/src/v4/controls/Table.d.ts +3 -3
  228. package/dist/types/src/v4/controls/Table.d.ts.map +1 -1
  229. package/package.json +14 -12
  230. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts +0 -107
  231. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts.map +0 -1
  232. package/dist/specification/src/sync/v4/generate/ListReportUtils.js +0 -394
  233. package/dist/specification/src/sync/v4/generate/ListReportUtils.js.map +0 -1
  234. package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +0 -1
  235. package/dist/specification/src/sync/v4/generate/listReport.js.map +0 -1
@@ -1,171 +1,294 @@
1
1
  import type { Definition } from 'typescript-json-schema';
2
+ import type { ExtensionLogger } from '@sap/ux-specification-types';
3
+ import type { App } from './App';
4
+ import type { Page } from './Page';
5
+ import type { AppSchema } from './AppSchema';
6
+ export type GeneralSettings<PageWithConfig extends Page = Page> = {
7
+ appSchema: AppSchema;
8
+ app: App;
9
+ page: PageWithConfig;
10
+ logger?: ExtensionLogger;
11
+ };
12
+ export declare class BaseConstruct {
13
+ protected readonly appSchema: AppSchema;
14
+ protected readonly app: App;
15
+ protected readonly page: Page;
16
+ protected readonly logger?: ExtensionLogger;
17
+ /**
18
+ * Creates the base construct with access to the app schema, app/page configuration, and logger.
19
+ *
20
+ * @param settings - Shared context (appSchema, app, page, logger) passed to all decorator classes
21
+ */
22
+ constructor(settings?: GeneralSettings);
23
+ /**
24
+ * Returns the shared context (appSchema, app, page, logger) for use by subclasses or callers.
25
+ *
26
+ * @returns The current settings object
27
+ */
28
+ getSettings(): GeneralSettings;
29
+ }
2
30
  export interface Base {
3
31
  name: string;
4
32
  definition: Definition;
5
33
  }
6
- export declare class BaseClass {
7
- private appSchema;
8
- private base;
34
+ export declare class BaseClass extends BaseConstruct {
35
+ private readonly base;
9
36
  /**
10
- * Creates an instance of BaseClass.
37
+ * Looks up the matching schema definition by class name and stores it as the base.
11
38
  *
12
- * @param appSchema - The application schema definition
39
+ * @param settings - Shared context (appSchema, app, page, logger) passed to all decorator classes
13
40
  */
14
- constructor(appSchema?: Definition);
41
+ constructor(settings?: GeneralSettings);
15
42
  /**
16
- * Gets the class name.
43
+ * Returns the class name used to look up the matching schema definition.
17
44
  *
18
- * @returns The name of the class
45
+ * @returns The constructor name of this class
19
46
  */
20
47
  getClassName(): string;
21
48
  /**
22
- * Gets the base name.
49
+ * Returns the name stored at construction time for the schema definition lookup.
23
50
  *
24
- * @returns The base name
51
+ * @returns The base definition name
25
52
  */
26
53
  getBaseName(): string;
27
54
  /**
28
- * Gets the base definition.
55
+ * Returns the schema definition that decorators are applied to.
29
56
  *
30
- * @returns The base definition
57
+ * @returns The JSON schema definition for this class
31
58
  */
32
59
  getBase(): Definition;
33
60
  /**
34
- * Sets the base definition and name.
35
- *
36
- * @param base - The base object containing name and definition
37
- */
38
- setBase(base: Base): void;
39
- /**
40
- * Gets the definitions from the app schema.
41
- *
42
- * @returns The definitions object or undefined
43
- */
44
- getDefinitions(): Definition | undefined;
45
- /**
46
- * Creates an annotation path for schema based on entity type, term, and qualifier.
61
+ * Builds an annotation path like `/<EntityType>/@<Term>#<Qualifier>` and stores it on the schema definition.
47
62
  *
48
- * @param entityTypeName - Entity type name.
49
- * @param term - Annotation term.
50
- * @param qualifier - Annotation qualifier (optional).
51
- * @returns Annotation path based on received params
63
+ * @param entityTypeName - The OData entity type name (e.g. "SalesOrderItem")
64
+ * @param term - The annotation term (e.g. "com.sap.vocabularies.UI.v1.LineItem")
65
+ * @param qualifier - Optional qualifier to disambiguate multiple annotations of the same term
66
+ * @returns The built annotation path, or undefined if entityTypeName is empty
52
67
  */
53
68
  createAnnotationPath(entityTypeName: string, term: string, qualifier?: string): string | undefined;
54
69
  }
55
70
  export declare class Decorator extends BaseClass {
56
71
  /**
57
- * Reference to the parent decorator instance.
58
- * Used by @dependsOn decorator to support parent property access via '../' syntax.
72
+ * Evaluation context built from app config, page config, and optional custom values.
73
+ * Non-enumerable to stay hidden from serialization.
59
74
  */
60
- private __parent__?;
75
+ private decoratorContext;
61
76
  /**
62
- * Sets the parent decorator instance for this object.
63
- * This enables nested decorators to access parent properties using the '../' prefix in @dependsOn.
77
+ * Sets up the decorator context as non-enumerable so it stays hidden from serialization.
64
78
  *
65
- * @param parent - The parent Decorator instance
66
- * @returns this (for method chaining)
79
+ * @param settings - Shared context (appSchema, app, page, logger) passed to all decorator classes
67
80
  */
68
- setParent(parent: Decorator): this;
81
+ constructor(settings?: GeneralSettings);
69
82
  /**
70
- * Gets the parent decorator instance if it exists.
83
+ * Builds the decorator context from app, page, and custom values, then applies all
84
+ * decorators (enums, message, hide, readonly) to the schema definition.
71
85
  *
72
- * @returns The parent Decorator instance or undefined
86
+ * @param customContext - Specific values (e.g. table state, section state) used for condition evaluation
87
+ * @param definition - Override the schema definition to decorate (defaults to getBase())
88
+ * @example
89
+ * ```typescript
90
+ * // Basic initialization (app and page auto-injected)
91
+ * decorator.init();
92
+ *
93
+ * // With custom context for table-specific conditions
94
+ * decorator.init({
95
+ * table: { type: 'GridTable', views: [] }
96
+ * });
97
+ *
98
+ * // With custom definition (for dynamically created definitions)
99
+ * decorator.init({ table: { type: 'GridTable' } }, customTableDefinition);
100
+ * ```
73
101
  */
74
- getParent(): Decorator | undefined;
102
+ init(customContext?: Record<string, unknown>, definition?: Definition): void;
75
103
  /**
76
- * Helper method to get property value from an object using a property path.
77
- * Supports simple property names (e.g., 'visualFilters'), nested paths (e.g., 'settings.enabled'),
78
- * and parent traversal (e.g., '../type' to access parent object's type property).
104
+ * Resolves a dotted property path (e.g. `page.isALP`, `custom.items[0].name`) against
105
+ * the decorator context using JSONPath. The path must start with a known source prefix
106
+ * (`app`, `page`, or `custom`).
79
107
  *
80
- * @param syncInstance - The object instance to retrieve the property value from
81
- * @param propertyPath - The property path (e.g., 'visualFilters', 'settings.enabled', or '../type')
82
- * @returns Object containing the final key and its value, or undefined if not found
108
+ * @param propertyPath - Dotted path with source prefix, supports full JSONPath syntax
109
+ * @returns The resolved `{ key, value }` pair, or undefined if the path does not resolve
110
+ * @example
111
+ * ```typescript
112
+ * // With decoratorContext = {
113
+ * // app: { manifest: { 'sap.ui5': { routing: {...} } } },
114
+ * // page: { isALP: true },
115
+ * // custom: { type: 'GridTable', items: [{ name: 'Item1' }, { name: 'Item2' }] }
116
+ * // }
117
+ * getPropertyKeyValue('page.isALP') // { key: 'isALP', value: true }
118
+ * getPropertyKeyValue('custom.items[0]') // { key: '0', value: { name: 'Item1' } }
119
+ * getPropertyKeyValue('custom.items[1].name') // { key: 'name', value: 'Item2' }
120
+ * getPropertyKeyValue('app.manifest["sap.ui5"]') // Access property with dot in name
121
+ * getPropertyKeyValue('$.app.manifest["sap.ui5"].routing') // JSONPath with root reference
122
+ * getPropertyKeyValue('$app["manifest"]["sap.ui5"]') // Alternative JSONPath format
123
+ * ```
83
124
  */
84
125
  private getPropertyKeyValue;
85
126
  /**
86
- * Evaluates a single dependency condition.
127
+ * Evaluates one condition: resolves the path, applies the check (custom function,
128
+ * equality, or truthy), and optionally negates the result (for `not()` conditions).
87
129
  *
88
- * @param condition - The single condition to evaluate
89
- * @param condition.path - The property path to check
90
- * @param condition.dependsOn - Optional custom condition function
91
- * @param condition.expectedValue - Optional expected value for equality check
92
- * @param syncRuleProviderInstance - The sync rule provider instance
93
- * @returns Object containing whether condition passed and the dependency value
130
+ * @param condition - A single condition with path, expected value, and optional negate flag
131
+ * @returns Whether the condition passed along with the resolved value and key
94
132
  */
95
133
  private evaluateSingleCondition;
96
134
  /**
97
- * Helper method to add a message to the schema property based on value condition.
135
+ * Translates and attaches a message to a schema property.
136
+ * Supports both the new `MessageConfig` format (from `msg()` helper) and the legacy `DependsOnMessage` format.
98
137
  *
99
- * @param condition - EnumValueCondition object containing condition details
100
- * @param syncRuleProviderInstance - The instance of the sync rule provider
101
- * @param definition - The schema property definition
102
- * @param i18nProperties - i18n properties for message translation
103
- * @param i18nProperties.propertyName - The property name for the message
104
- * @param i18nProperties.context - The context for the message
138
+ * @param condition - The decorator metadata or enum value condition containing the message definition
139
+ * @param decoratedClass - The decorated class instance, used for legacy function-based message text
140
+ * @param definition - The schema property definition to attach the message to
141
+ * @param i18nProperties - Context for i18n translation (propertyName, evaluation context)
142
+ * @param i18nProperties.propertyName - The property name used as i18n parameter
143
+ * @param i18nProperties.context - The evaluation context string used as i18n parameter
105
144
  */
106
145
  private addConditionalMessage;
107
146
  /**
108
- * Gets the context message from evaluation results.
147
+ * Resolves any `PathNode` values in message params to their actual values from the decorator context.
109
148
  *
110
- * @param results - The evaluation results
111
- * @returns The context message string
149
+ * @param params - Message parameters that may contain PathNode references
150
+ * @returns A new params object with PathNode values replaced by their resolved context values
151
+ */
152
+ private resolveMessageParams;
153
+ /**
154
+ * Builds a human-readable context string from the evaluation results that did not pass.
155
+ * Used for diagnostic messages showing which conditions were unmet.
156
+ *
157
+ * @param results - The condition evaluation results to summarize
158
+ * @returns A comma-separated string of `key: value` pairs for failed conditions
112
159
  */
113
160
  private getContextForMessage;
114
161
  /**
115
- * Applies the dependsOn decorator to the schema definition.
162
+ * Evaluates one item inside an AND group — either a single condition or a nested OR group.
116
163
  *
117
- * @param schemaDefinition - The schema definition to apply the decorator to
118
- * @param syncRuleProviderInstance - The sync rule provider instance
164
+ * @param conditionItem - A single condition or a nested `{ __orConditions }` group
165
+ * @returns Whether the item passed and the detailed evaluation results
119
166
  */
120
- private applyDependsOnDecorator;
167
+ private evaluateAndConditionItem;
121
168
  /**
122
- * Gets the validity metadata for a property.
169
+ * Evaluates OR conditions passes when at least one item (single condition or nested AND group) matches.
170
+ * Short-circuits on the first passing item.
123
171
  *
124
- * @param target - The target object
125
- * @param propertyName - The property name
126
- * @returns The validity metadata or undefined
172
+ * @param orConditions - Array of conditions or nested AND groups to evaluate
173
+ * @returns Whether any condition passed and the collected evaluation results
174
+ */
175
+ private evaluateOrConditions;
176
+ /**
177
+ * Evaluates AND conditions — passes only when every item (single condition or nested OR group) matches.
178
+ * Continues even after a failure to collect all results for diagnostic context.
179
+ *
180
+ * @param andConditions - Array of conditions or nested OR groups that must all pass
181
+ * @returns Whether all conditions passed and the collected evaluation results
182
+ */
183
+ private evaluateAndConditions;
184
+ /**
185
+ * Entry point for condition evaluation. Dispatches to OR, AND, or single evaluation
186
+ * depending on the shape of the condition metadata.
187
+ *
188
+ * @param conditionInfo - The decorator condition metadata (single, AND, or OR)
189
+ * @returns Whether the condition passed and a diagnostic context string
190
+ */
191
+ private evaluateCondition;
192
+ /**
193
+ * Yields each property from a schema definition for decorator processing.
194
+ * Returns early if the definition has no properties or the target is falsy.
195
+ *
196
+ * @param schemaDefinition - The schema definition whose properties to iterate
197
+ * @param target - Guard object — iteration is skipped if falsy
198
+ * @yields Property name and its definition for each property in the schema
199
+ */
200
+ private iterateProperties;
201
+ /**
202
+ * Hides properties whose `@hide` conditions pass.
203
+ * Multiple `@hide` decorators use OR semantics — any passing condition hides the property.
204
+ * Skipped when the `@message` decorator already added messages to the property.
205
+ *
206
+ * @param schemaDefinition - The schema definition to process
207
+ * @param decoratedClass - The decorated class instance carrying `@hide` metadata
208
+ */
209
+ private applyHideDecorator;
210
+ /**
211
+ * Shows messages on properties whose `@message` conditions pass.
212
+ * Must run before `applyHideDecorator` so hide can detect existing messages.
213
+ *
214
+ * @param schemaDefinition - The schema definition to process
215
+ * @param decoratedClass - The decorated class instance carrying `@message` metadata
216
+ */
217
+ private applyMessageDecorator;
218
+ /**
219
+ * Marks properties as read-only whose `@readonly` conditions pass.
220
+ * Multiple `@readonly` decorators use OR semantics — any passing condition makes the property read-only.
221
+ *
222
+ * @param schemaDefinition - The schema definition to process
223
+ * @param decoratedClass - The decorated class instance carrying `@readonly` metadata
224
+ */
225
+ private applyReadonlyDecorator;
226
+ /**
227
+ * Restricts enum values on properties whose `@enums` conditions pass.
228
+ * When multiple `@enums` decorators exist on the same property, the first matching condition wins.
229
+ *
230
+ * @param schemaDefinition - The schema definition to process
231
+ * @param decoratedClass - The decorated class instance carrying `@enums` metadata
232
+ */
233
+ private applyEnumsDecorator;
234
+ /**
235
+ * Reads the `@validity` metadata stored on a property of the decorated class.
236
+ *
237
+ * @param target - The decorated class instance
238
+ * @param propertyName - The property to read validity metadata from
239
+ * @returns The validity constraints (since, enum restrictions), or undefined if none
127
240
  */
128
241
  private getValidityMetadata;
129
242
  /**
130
- * Applies the validity decorator to the schema definition based on the sync rule provider instance and minimum UI5 version.
243
+ * Returns the enum values from a property definition, resolving `$ref` to a shared enum definition if needed.
131
244
  *
132
- * @param schemaDefinition The schema definition to apply the validity decorator to
133
- * @param syncRuleProviderInstance The instance of the sync rule provider
134
- * @param minUI5Version The minimum UI5 version to consider for validity checks
245
+ * @param property - The schema property definition (may have inline `enum` or a `$ref`)
246
+ * @returns The enum values array, or undefined if the property is not an enum
135
247
  */
136
- private applyValidityDecorator;
248
+ private resolveEnumFromProperty;
137
249
  /**
138
- * Applies the isViewNode decorator to the schema definition based on the target and property name.
250
+ * Writes filtered enum values to a property definition.
251
+ * For `$ref` properties, inlines the enum, copies the type, and removes the `$ref`.
139
252
  *
140
- * @param schemaDefinition The schema definition to apply the isViewNode decorator to
141
- * @param target The target object or function
142
- * @param propertyName The property name (optional)
253
+ * @param property - The schema property definition to update
254
+ * @param filteredEnum - The allowed enum values after filtering
143
255
  */
144
- private applyIsViewNodeDecorator;
256
+ private applyFilteredEnumToProperty;
145
257
  /**
146
- * Applies the description decorator to the schema definition.
258
+ * Hides properties and filters enum values that require a UI5 version higher than the app's minimum.
147
259
  *
148
- * @param schemaDefinition - The schema definition to apply the decorator to
149
- * @param target - The target object or function
150
- * @param propertyName - The property name (optional)
260
+ * @param schemaDefinition - The schema definition to process
261
+ * @param decoratedClass - The decorated class instance carrying `@validity` metadata
262
+ * @param minUI5Version - The app's minimum UI5 version to check against
151
263
  */
152
- private applyDescriptionDecorator;
264
+ private applyValidityDecorator;
265
+ /**
266
+ * Marks the schema definition as a view node if the `@isViewNode` decorator is present on the target.
267
+ *
268
+ * @param schemaDefinition - The schema definition to tag
269
+ * @param target - The class constructor or prototype carrying the decorator
270
+ * @param propertyName - Optional property name for property-level decorators
271
+ */
272
+ private applyIsViewNodeDecorator;
153
273
  /**
154
- * Applies the hidden decorator to the schema definition.
274
+ * Sets the schema `description` field from the `@description` decorator if present on the target.
155
275
  *
156
- * @param schemaDefinition - The schema definition to apply the decorator to
157
- * @param target - The target object or function
158
- * @param propertyName - The property name (optional)
276
+ * @param schemaDefinition - The schema definition to update
277
+ * @param target - The class constructor or prototype carrying the decorator
278
+ * @param propertyName - Optional property name for property-level decorators
159
279
  */
160
- private applyHiddenDecorator;
280
+ private applyDescriptionDecorator;
161
281
  /**
162
- * Applies all decorators to the schema definition.
282
+ * Applies all decorators to the schema in the correct order:
283
+ * description → isViewNode → validity → enums → message → hide → readonly.
284
+ * Message runs before hide so that hide can skip properties that already have messages.
163
285
  *
164
- * @param minUi5Version - The minimum UI5 version (optional)
165
- * @param propertyName - The property name (optional)
166
- * @returns Object containing the definition
286
+ * @param minUi5Version - The app's minimum UI5 version for validity checks
287
+ * @param propertyName - Optional property name when decorating a single property
288
+ * @param customDefinition - Override the schema definition (defaults to `getBase()`)
289
+ * @returns The decorated schema definition
167
290
  */
168
- applyDecorators(minUi5Version?: string, propertyName?: string): {
291
+ applyDecorators(minUi5Version?: string, propertyName?: string, customDefinition?: Definition): {
169
292
  definition: Definition;
170
293
  };
171
294
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DecoratorClass.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v4/sync-rules/DecoratorClass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAgCzD,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;CAC1B;AAQD,qBAAa,SAAS;IAClB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,IAAI,CAAO;IAEnB;;;;OAIG;gBACS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