@sap/ux-specification 1.124.32 → 1.124.34

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 (193) hide show
  1. package/CHANGELOG.md +73 -0
  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 +249 -250
  14. package/dist/index-min.js.map +4 -4
  15. package/dist/schemas/v2/ApplicationV2.json +28 -3
  16. package/dist/schemas/v2/ListReportNewConfig.json +45 -0
  17. package/dist/schemas/v2/ObjectPageConfig.json +11 -5
  18. package/dist/schemas/v4/ApplicationV4.json +12 -6
  19. package/dist/schemas/v4/BuildingBlocksConfig.json +34 -16
  20. package/dist/schemas/v4/ListReportConfig.json +34 -0
  21. package/dist/schemas/v4/ObjectPageConfig.json +18 -1
  22. package/dist/specification/package.json +18 -18
  23. package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
  24. package/dist/specification/scripts/macros/corrections.js +17 -1
  25. package/dist/specification/scripts/macros/corrections.js.map +1 -1
  26. package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
  27. package/dist/specification/scripts/macros/schema.js +10 -1
  28. package/dist/specification/scripts/macros/schema.js.map +1 -1
  29. package/dist/specification/scripts/macros/types.d.ts +1 -0
  30. package/dist/specification/scripts/macros/types.d.ts.map +1 -1
  31. package/dist/specification/scripts/schema/to-json-schema.d.ts.map +1 -1
  32. package/dist/specification/scripts/schema/to-json-schema.js +23 -13
  33. package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
  34. package/dist/specification/src/api.js +1 -1
  35. package/dist/specification/src/sync/common/decoration/decorators.d.ts +65 -4
  36. package/dist/specification/src/sync/common/decoration/decorators.d.ts.map +1 -1
  37. package/dist/specification/src/sync/common/decoration/decorators.js +138 -8
  38. package/dist/specification/src/sync/common/decoration/decorators.js.map +1 -1
  39. package/dist/specification/src/sync/common/distTagEvaluator.d.ts +10 -3
  40. package/dist/specification/src/sync/common/distTagEvaluator.d.ts.map +1 -1
  41. package/dist/specification/src/sync/common/distTagEvaluator.js +14 -4
  42. package/dist/specification/src/sync/common/distTagEvaluator.js.map +1 -1
  43. package/dist/specification/src/sync/common/generate/objectPage.js +3 -1
  44. package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
  45. package/dist/specification/src/sync/common/generate/utils.d.ts +13 -4
  46. package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
  47. package/dist/specification/src/sync/common/generate/utils.js +35 -20
  48. package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
  49. package/dist/specification/src/sync/common/i18n.json +5 -3
  50. package/dist/specification/src/sync/common/utils.d.ts +52 -1
  51. package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
  52. package/dist/specification/src/sync/common/utils.js +176 -4
  53. package/dist/specification/src/sync/common/utils.js.map +1 -1
  54. package/dist/specification/src/sync/v2/application.d.ts +1 -0
  55. package/dist/specification/src/sync/v2/application.d.ts.map +1 -1
  56. package/dist/specification/src/sync/v2/application.js +18 -0
  57. package/dist/specification/src/sync/v2/application.js.map +1 -1
  58. package/dist/specification/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -1
  59. package/dist/specification/src/sync/v2/export/exportPage.d.ts.map +1 -1
  60. package/dist/specification/src/sync/v2/export/exportPage.js +15 -4
  61. package/dist/specification/src/sync/v2/export/exportPage.js.map +1 -1
  62. package/dist/specification/src/sync/v2/export/exportPageGeneric.d.ts.map +1 -1
  63. package/dist/specification/src/sync/v2/export/exportPageGeneric.js +8 -15
  64. package/dist/specification/src/sync/v2/export/exportPageGeneric.js.map +1 -1
  65. package/dist/specification/src/sync/v2/export/factory.d.ts +26 -0
  66. package/dist/specification/src/sync/v2/export/factory.d.ts.map +1 -1
  67. package/dist/specification/src/sync/v2/export/factory.js +3 -3
  68. package/dist/specification/src/sync/v2/export/factory.js.map +1 -1
  69. package/dist/specification/src/sync/v2/export/pages/ObjectPage.d.ts +1 -0
  70. package/dist/specification/src/sync/v2/export/pages/ObjectPage.d.ts.map +1 -1
  71. package/dist/specification/src/sync/v2/export/pages/ObjectPage.js +11 -0
  72. package/dist/specification/src/sync/v2/export/pages/ObjectPage.js.map +1 -1
  73. package/dist/specification/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -1
  74. package/dist/specification/src/sync/v2/generate/analyticalListReport.js +46 -0
  75. package/dist/specification/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  76. package/dist/specification/src/sync/v2/generate/listReport.d.ts.map +1 -1
  77. package/dist/specification/src/sync/v2/generate/listReport.js +46 -1
  78. package/dist/specification/src/sync/v2/generate/listReport.js.map +1 -1
  79. package/dist/specification/src/sync/v2/generate/objectPage.d.ts.map +1 -1
  80. package/dist/specification/src/sync/v2/generate/objectPage.js +63 -13
  81. package/dist/specification/src/sync/v2/generate/objectPage.js.map +1 -1
  82. package/dist/specification/src/sync/v2/generate/schemaAdaptation.d.ts.map +1 -1
  83. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js +28 -1
  84. package/dist/specification/src/sync/v2/generate/schemaAdaptation.js.map +1 -1
  85. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.d.ts +22 -0
  86. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.d.ts.map +1 -0
  87. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.js +124 -0
  88. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/MultiViewSingleTable.js.map +1 -0
  89. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts +1 -0
  90. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -1
  91. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +4 -0
  92. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -1
  93. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts +1 -0
  94. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts.map +1 -1
  95. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js +1 -0
  96. package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js.map +1 -1
  97. package/dist/specification/src/sync/v2/import/importPage.d.ts.map +1 -1
  98. package/dist/specification/src/sync/v2/import/importPage.js +5 -6
  99. package/dist/specification/src/sync/v2/import/importPage.js.map +1 -1
  100. package/dist/specification/src/sync/v2/import/pages/overviewPage.d.ts.map +1 -1
  101. package/dist/specification/src/sync/v2/import/pages/overviewPage.js +4 -0
  102. package/dist/specification/src/sync/v2/import/pages/overviewPage.js.map +1 -1
  103. package/dist/specification/src/sync/v2/utils.d.ts +17 -1
  104. package/dist/specification/src/sync/v2/utils.d.ts.map +1 -1
  105. package/dist/specification/src/sync/v2/utils.js +57 -0
  106. package/dist/specification/src/sync/v2/utils.js.map +1 -1
  107. package/dist/specification/src/sync/v4/export/controls/Header.d.ts +3 -2
  108. package/dist/specification/src/sync/v4/export/controls/Header.d.ts.map +1 -1
  109. package/dist/specification/src/sync/v4/export/controls/Header.js +14 -2
  110. package/dist/specification/src/sync/v4/export/controls/Header.js.map +1 -1
  111. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts +2 -1
  112. package/dist/specification/src/sync/v4/export/controls/HeaderAction.d.ts.map +1 -1
  113. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js +7 -2
  114. package/dist/specification/src/sync/v4/export/controls/HeaderAction.js.map +1 -1
  115. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +3 -0
  116. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts.map +1 -1
  117. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.js +20 -0
  118. package/dist/specification/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -1
  119. package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts +5 -0
  120. package/dist/specification/src/sync/v4/export/controls/TableColumn.d.ts.map +1 -1
  121. package/dist/specification/src/sync/v4/export/controls/TableColumn.js +40 -0
  122. package/dist/specification/src/sync/v4/export/controls/TableColumn.js.map +1 -1
  123. package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
  124. package/dist/specification/src/sync/v4/export/export.js +11 -3
  125. package/dist/specification/src/sync/v4/export/export.js.map +1 -1
  126. package/dist/specification/src/sync/v4/export/pages/ListReport.d.ts.map +1 -1
  127. package/dist/specification/src/sync/v4/export/pages/ListReport.js +2 -1
  128. package/dist/specification/src/sync/v4/export/pages/ListReport.js.map +1 -1
  129. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts +107 -0
  130. package/dist/specification/src/sync/v4/generate/ListReportUtils.d.ts.map +1 -0
  131. package/dist/specification/src/sync/v4/generate/ListReportUtils.js +374 -0
  132. package/dist/specification/src/sync/v4/generate/ListReportUtils.js.map +1 -0
  133. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts +3 -3
  134. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.d.ts.map +1 -1
  135. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +10 -2
  136. package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
  137. package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.d.ts.map +1 -1
  138. package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +9 -2
  139. package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js.map +1 -1
  140. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js +2 -2
  141. package/dist/specification/src/sync/v4/generate/fpm-custom-page/utils.js.map +1 -1
  142. package/dist/specification/src/sync/v4/generate/listReport.d.ts +100 -2
  143. package/dist/specification/src/sync/v4/generate/listReport.d.ts.map +1 -1
  144. package/dist/specification/src/sync/v4/generate/listReport.js +119 -100
  145. package/dist/specification/src/sync/v4/generate/listReport.js.map +1 -1
  146. package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
  147. package/dist/specification/src/sync/v4/generate/objectPage.js +7 -7
  148. package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
  149. package/dist/specification/src/sync/v4/sync-rules/App.d.ts +141 -0
  150. package/dist/specification/src/sync/v4/sync-rules/App.d.ts.map +1 -0
  151. package/dist/specification/src/sync/v4/sync-rules/App.js +208 -0
  152. package/dist/specification/src/sync/v4/sync-rules/App.js.map +1 -0
  153. package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts +193 -0
  154. package/dist/specification/src/sync/v4/sync-rules/AppSchema.d.ts.map +1 -0
  155. package/dist/specification/src/sync/v4/sync-rules/AppSchema.js +384 -0
  156. package/dist/specification/src/sync/v4/sync-rules/AppSchema.js.map +1 -0
  157. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts +172 -0
  158. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.d.ts.map +1 -0
  159. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js +410 -0
  160. package/dist/specification/src/sync/v4/sync-rules/DecoratorClass.js.map +1 -0
  161. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts +70 -0
  162. package/dist/specification/src/sync/v4/sync-rules/Page.d.ts.map +1 -0
  163. package/dist/specification/src/sync/v4/sync-rules/Page.js +73 -0
  164. package/dist/specification/src/sync/v4/sync-rules/Page.js.map +1 -0
  165. package/dist/specification/src/sync/v4/sync-rules/utils.d.ts +9 -0
  166. package/dist/specification/src/sync/v4/sync-rules/utils.d.ts.map +1 -0
  167. package/dist/specification/src/sync/v4/sync-rules/utils.js +43 -0
  168. package/dist/specification/src/sync/v4/sync-rules/utils.js.map +1 -0
  169. package/dist/specification/src/sync/v4/utils/utils.d.ts +6 -28
  170. package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
  171. package/dist/specification/src/sync/v4/utils/utils.js +8 -55
  172. package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
  173. package/dist/types/src/common/types.d.ts +122 -1
  174. package/dist/types/src/common/types.d.ts.map +1 -1
  175. package/dist/types/src/common/types.js +16 -1
  176. package/dist/types/src/common/types.js.map +1 -1
  177. package/dist/types/src/common/webapp/manifest/Manifest.d.ts +1 -1
  178. package/dist/types/src/common/webapp/manifest/Manifest.d.ts.map +1 -1
  179. package/dist/types/src/v2/application.d.ts +18 -0
  180. package/dist/types/src/v2/application.d.ts.map +1 -1
  181. package/dist/types/src/v2/controls/ObjectPageHeaderSection.d.ts.map +1 -1
  182. package/dist/types/src/v2/controls/ObjectPageTable.d.ts +4 -4
  183. package/dist/types/src/v2/controls/ObjectPageTable.d.ts.map +1 -1
  184. package/dist/types/src/v2/controls/Table.d.ts.map +1 -1
  185. package/dist/types/src/v2/pages/ObjectPageConfigV2.d.ts +10 -1
  186. package/dist/types/src/v2/pages/ObjectPageConfigV2.d.ts.map +1 -1
  187. package/dist/types/src/v4/controls/ObjectPageHeader.d.ts +1 -1
  188. package/dist/types/src/v4/controls/ObjectPageHeaderSection.d.ts.map +1 -1
  189. package/dist/types/src/v4/controls/ObjectPageSection.d.ts.map +1 -1
  190. package/dist/types/src/v4/webapp/manifest/ManifestSettings.d.ts +41 -0
  191. package/dist/types/src/v4/webapp/manifest/ManifestSettings.d.ts.map +1 -1
  192. package/dist/types/src/v4/webapp/manifest/ManifestSettings.js.map +1 -1
  193. package/package.json +18 -18
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.App = void 0;
7
+ exports.createApp = createApp;
8
+ const ux_specification_types_1 = require("@sap/ux-specification-types");
9
+ const extensionLogger_1 = require("../../../extensionLogger");
10
+ const i18next_1 = __importDefault(require("i18next"));
11
+ /**
12
+ * Generic App class that implements the App interface.
13
+ * Contains general, reusable methods applicable to any Fiori application.
14
+ * Provides utilities for accessing manifest data, entity information, page discovery, and more.
15
+ * Automatically extracts pages from the manifest during construction.
16
+ */
17
+ class App {
18
+ /**
19
+ * Constructor for the App class.
20
+ *
21
+ * @param manifest The application manifest
22
+ * @param avt The converted metadata from annotation vocabulary tools
23
+ * @param logger Optional logger for error messages
24
+ */
25
+ constructor(manifest, avt, logger) {
26
+ this.manifest = manifest;
27
+ this.avt = avt;
28
+ this.logger = logger;
29
+ this.alias = this.getUIVocabularyAlias();
30
+ this.setMinUI5Version();
31
+ this.extractPagesFromManifest();
32
+ }
33
+ /**
34
+ * Extracts pages from the manifest's routing targets.
35
+ * Called automatically during construction.
36
+ */
37
+ extractPagesFromManifest() {
38
+ const pages = this.manifest?.[ux_specification_types_1.ManifestSection.ui5]?.routing?.targets;
39
+ // Validate pages and log error if no pages found
40
+ if (!pages || pages.length === 0) {
41
+ if (this.logger) {
42
+ (0, extensionLogger_1.log)(this.logger, {
43
+ severity: "info" /* LogSeverity.Info */,
44
+ message: i18next_1.default.t('NOPAGES', { appId: this.getAppId() }),
45
+ location: {
46
+ path: ux_specification_types_1.MANIFESTPATH,
47
+ range: [ux_specification_types_1.ManifestSection.ui5, 'routing']
48
+ }
49
+ });
50
+ }
51
+ }
52
+ this.pages = pages;
53
+ }
54
+ // ==================== UI5 Version Management ====================
55
+ /**
56
+ * Sets the minimum UI5 version.
57
+ */
58
+ setMinUI5Version() {
59
+ this.minUI5Version = this.manifest?.['sap.ui5']?.dependencies?.minUI5Version;
60
+ }
61
+ /**
62
+ * Gets the minimum UI5 version as a string.
63
+ * If minUI5Version is an array, returns the first element.
64
+ *
65
+ * @todo Handle array case properly if needed.
66
+ * @returns The minimum UI5 version as a string, or undefined if not set
67
+ */
68
+ getMinUI5Version() {
69
+ return typeof this.minUI5Version === 'string' ? this.minUI5Version : this.minUI5Version?.[0];
70
+ }
71
+ // ==================== Manifest Access ====================
72
+ /**
73
+ * Gets the manifest.
74
+ *
75
+ * @returns The application manifest
76
+ */
77
+ getManifest() {
78
+ return this.manifest;
79
+ }
80
+ /**
81
+ * Gets the application ID from the manifest.
82
+ *
83
+ * @returns The application ID, or undefined if not found
84
+ */
85
+ getAppId() {
86
+ return this.manifest?.['sap.app']?.id;
87
+ }
88
+ /**
89
+ * Gets the application version from the manifest.
90
+ *
91
+ * @returns The application version, or undefined if not found
92
+ */
93
+ getAppVersion() {
94
+ return this.manifest?.['sap.app']?.applicationVersion?.version;
95
+ }
96
+ /**
97
+ * Gets the application title from the manifest.
98
+ *
99
+ * @returns The application title, or undefined if not found
100
+ */
101
+ getAppTitle() {
102
+ return this.manifest?.['sap.app']?.title;
103
+ }
104
+ // ==================== AVT (Annotation Vocabulary Tools) Access ====================
105
+ /**
106
+ * Gets the converted metadata (AVT).
107
+ *
108
+ * @returns The converted metadata containing entity types, entity sets, and annotations
109
+ */
110
+ getAVT() {
111
+ return this.avt;
112
+ }
113
+ /**
114
+ * Gets a specific entity set by name.
115
+ *
116
+ * @param name - The name of the entity set to find
117
+ * @returns The entity set, or undefined if not found
118
+ */
119
+ getEntitySet(name) {
120
+ return this.avt?.entitySets?.find((es) => es.name === name);
121
+ }
122
+ /**
123
+ * Gets the entity type for a given entity set.
124
+ *
125
+ * @param entitySetName - The name of the entity set
126
+ * @returns The entity type, or undefined if not found
127
+ */
128
+ getEntityType(entitySetName) {
129
+ const entitySet = this.getEntitySet(entitySetName);
130
+ return entitySet?.entityType;
131
+ }
132
+ /**
133
+ * Finds the annotation alias for a given vocabulary namespace.
134
+ *
135
+ * @param vocabulary - The vocabulary namespace to search for (e.g., 'com.sap.vocabularies.UI.v1')
136
+ * @returns The alias for the vocabulary, or undefined if not found
137
+ */
138
+ findAnnotationAlias(vocabulary) {
139
+ if (!this.avt?.references) {
140
+ return undefined;
141
+ }
142
+ let aliasReference = this.avt.references.find((reference) => {
143
+ return reference.namespace === vocabulary;
144
+ });
145
+ if (!aliasReference) {
146
+ aliasReference = this.avt.references.find((reference) => {
147
+ return reference.alias === vocabulary;
148
+ });
149
+ }
150
+ if (!aliasReference) {
151
+ aliasReference = this.avt.references.find((reference) => {
152
+ return (reference.alias.toUpperCase() ===
153
+ vocabulary.split('SAP__')[vocabulary.split('SAP__').length - 1].toUpperCase());
154
+ });
155
+ }
156
+ return aliasReference?.alias;
157
+ }
158
+ /**
159
+ * Gets the alias for the UI vocabulary (com.sap.vocabularies.UI.v1).
160
+ * This is a convenience method for the commonly-used UI vocabulary.
161
+ *
162
+ * @param vocabulary - The vocabulary namespace to search for (default is UIVOCABULARY)
163
+ * @returns The alias for the UI vocabulary, or undefined if not found
164
+ */
165
+ getUIVocabularyAlias(vocabulary = ux_specification_types_1.UIVOCABULARY) {
166
+ return this.findAnnotationAlias(vocabulary);
167
+ }
168
+ // ==================== Page Management ====================
169
+ /**
170
+ * Gets all pages.
171
+ *
172
+ * @returns Array of page configurations
173
+ */
174
+ getPages() {
175
+ return this.pages;
176
+ }
177
+ /**
178
+ * Checks if the application has any pages configured.
179
+ *
180
+ * @returns True if pages exist, false otherwise
181
+ */
182
+ hasPages() {
183
+ return this.pages && this.pages.length > 0;
184
+ }
185
+ /**
186
+ * Gets the logger instance.
187
+ *
188
+ * @returns Instance of logger
189
+ */
190
+ getLogger() {
191
+ return this.logger;
192
+ }
193
+ }
194
+ exports.App = App;
195
+ /**
196
+ * Factory function to create an App instance.
197
+ * Provides a convenient way to instantiate the App class.
198
+ * Pages are automatically extracted from the manifest.
199
+ *
200
+ * @param manifest - The application manifest
201
+ * @param avt - The converted metadata from annotation vocabulary tools
202
+ * @param logger - Optional logger for error messages
203
+ * @returns A new App instance with pages automatically extracted
204
+ */
205
+ function createApp(manifest, avt, logger) {
206
+ return new App(manifest, avt, logger);
207
+ }
208
+ //# sourceMappingURL=App.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.js","sourceRoot":"","sources":["../../../../../../src/sync/v4/sync-rules/App.ts"],"names":[],"mappings":";;;;;;AAgPA,8BAEC;AA/OD,wEAAuG;AACvG,8DAA+C;AAC/C,sDAA8B;AAa9B;;;;;GAKG;AACH,MAAa,GAAG;IAQZ;;;;;;OAMG;IACH,YAAY,QAAkB,EAAE,GAAsB,EAAE,MAAwB;QAC5E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;IAED;;;OAGG;IACK,wBAAwB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,wCAAe,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,OAAsC,CAAC;QACpG,iDAAiD;QACjD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,IAAA,qBAAG,EAAC,IAAI,CAAC,MAAM,EAAE;oBACb,QAAQ,+BAAkB;oBAC1B,OAAO,EAAE,iBAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACzD,QAAQ,EAAE;wBACN,IAAI,EAAE,qCAAY;wBAClB,KAAK,EAAE,CAAC,wCAAe,CAAC,GAAG,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B,CAAC;IAED;;;;OAIG;IACH,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,SAAS;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ;AA5MD,kBA4MC;AAED;;;;;;;;;GASG;AACH,SAAgB,SAAS,CAAC,QAAkB,EAAE,GAAsB,EAAE,MAAwB;IAC1F,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,193 @@
1
+ import type { Definition, DefinitionOrBoolean } from 'typescript-json-schema';
2
+ import { SchemaTag } from '@sap/ux-specification-types';
3
+ type TagInfo = {
4
+ name: SchemaTag | '$ref';
5
+ value: unknown;
6
+ };
7
+ /**
8
+ * Central manager for application schema lifecycle and operations.
9
+ * Encapsulates all schema structure knowledge and provides clean APIs for schema manipulation.
10
+ */
11
+ export declare class AppSchema {
12
+ private schema;
13
+ /**
14
+ * Constructor for AppSchema.
15
+ *
16
+ * @param genericSchema - The initial generic schema object
17
+ */
18
+ constructor(genericSchema: object);
19
+ /**
20
+ * Validates a property path array.
21
+ *
22
+ * @param propertyPath - The path to validate
23
+ * @returns true if valid, false otherwise
24
+ */
25
+ private isValidPropertyPath;
26
+ /**
27
+ * Resolves a $ref to its actual definition.
28
+ *
29
+ * @param ref - The $ref string (e.g., "#/definitions/MyDefinition")
30
+ * @returns The resolved definition or undefined
31
+ */
32
+ private resolveRef;
33
+ /**
34
+ * Navigates through an object using a property path and returns the value at that path.
35
+ * Automatically resolves $ref references when encountered.
36
+ *
37
+ * @param root - The root object to navigate from
38
+ * @param propertyPath - Array of keys forming the path
39
+ * @param createIntermediates - Whether to create intermediate objects if they don't exist
40
+ * @param resolveRefs - Whether to resolve $ref references during navigation (default: true)
41
+ * @returns The value at the path, or undefined if not found
42
+ */
43
+ private navigatePropertyPath;
44
+ /**
45
+ * Sets a value at a property path within an object, creating intermediate objects as needed.
46
+ *
47
+ * @param root - The root object to navigate from
48
+ * @param propertyPath - Array of keys forming the path
49
+ * @param value - The value to set
50
+ * @returns true if successful, false otherwise
51
+ */
52
+ private setPropertyPath;
53
+ /**
54
+ * Gets the current schema definition.
55
+ *
56
+ * @returns The schema definition
57
+ */
58
+ getSchema(): Definition;
59
+ /**
60
+ * Gets a specific definition from the schema by name.
61
+ *
62
+ * @param name - The name of the definition
63
+ * @returns The definition or undefined if not found
64
+ */
65
+ getDefinition(name: Definition | string): Definition | undefined;
66
+ /**
67
+ * Sets a definition in the schema.
68
+ *
69
+ * @param name - The name of the definition
70
+ * @param definition - The definition to set
71
+ */
72
+ setDefinition(name: string, definition: Definition): void;
73
+ /**
74
+ * Deletes a definition from the schema.
75
+ *
76
+ * @param name - The name of the definition to delete
77
+ */
78
+ deleteDefinition(name: string): void;
79
+ /**
80
+ * Gets a root level property by path.
81
+ *
82
+ * @param propertyPath - Array of property names forming the path
83
+ * @returns The property definition or undefined
84
+ */
85
+ getRootProperty(propertyPath: string[]): Definition | undefined;
86
+ /**
87
+ * Gets a property in a definition by path.
88
+ *
89
+ * @param definition - The definition object
90
+ * @param propertyPath - Array of property names forming the path
91
+ * @returns The property definition or undefined
92
+ */
93
+ getProperty(definition: Definition, propertyPath?: string[]): Definition | undefined;
94
+ /**
95
+ * Sets a property in a definition using a path.
96
+ *
97
+ * @param definition - The definition name (string) or definition object
98
+ * @param propertyPath - The path to the property (optional)
99
+ * @param value - The value to set
100
+ */
101
+ setProperty(definition: string | Definition, propertyPath: string[] | undefined, value: DefinitionOrBoolean | string): void;
102
+ /**
103
+ * Removes a property in a definition using a path.
104
+ *
105
+ * @param definition - The definition object
106
+ * @param value - The value to set
107
+ */
108
+ removeProperty(definition: Definition, value: string): void;
109
+ /**
110
+ * Sets a schema tag on a definition.
111
+ *
112
+ * @param definitionName - The name of the definition
113
+ * @param tag - The schema tag to set
114
+ * @param value - The value for the tag
115
+ */
116
+ setDefinitionTag(definitionName: string, tag: SchemaTag, value: Definition): void;
117
+ /**
118
+ * Sets a schema tag on a property using a path.
119
+ *
120
+ * @param definitionOrString - The definition or name of the definition that should contain the property
121
+ * @param tagOrProperty - The tag info or property path
122
+ * @param tag - The tag info (if property path is provided)
123
+ */
124
+ setPropertyTag(definitionOrString: Definition | string, tagOrProperty: TagInfo | string[], tag?: TagInfo): void;
125
+ /**
126
+ * Hides a property or definition by setting the hidden tag.
127
+ *
128
+ * @param definition - The definition or name of the definition that should contain the property
129
+ * @param propertyPath - The path to the property (optional)
130
+ */
131
+ hide(definition: string | Definition, propertyPath?: string[]): void;
132
+ /**
133
+ * Creates a reference to a definition.
134
+ *
135
+ * @param definitionName - The name of the definition to reference
136
+ * @returns The $ref string
137
+ */
138
+ private createDefinitionRef;
139
+ /**
140
+ * Sets a property to reference a definition using a path.
141
+ *
142
+ * @param definitionOrString - The definition or name of the definition that should contain the property
143
+ * @param propertyPath - The path to the property
144
+ * @param targetDefinitionName - The name of the definition to reference
145
+ */
146
+ setPropertyRef(definitionOrString: Definition | string, propertyPath: string[], targetDefinitionName: string): void;
147
+ /**
148
+ * Sets a reference for a definition without a path.
149
+ *
150
+ * @param definitionOrString - The definition or name of the definition that should contain the property
151
+ * @param targetDefinitionName - The name of the definition to reference
152
+ */
153
+ setDefinitionRef(definitionOrString: Definition | string, targetDefinitionName: string): void;
154
+ /**
155
+ * Adds an enum to a definition property using a path.
156
+ * If there is only one enum value, adds a 'const' property instead of 'enum'.
157
+ *
158
+ * @param definitionName - The name of the definition
159
+ * @param propertyPath - Array of property names forming the path
160
+ * @param enumValues - Array of enum values to add
161
+ */
162
+ addEnumToSchema(definitionName: string, propertyPath: string[], enumValues: string[]): void;
163
+ /**
164
+ * Clones a definition with a new name.
165
+ *
166
+ * @param sourceName - The name of the source definition to clone
167
+ * @param targetName - The name for the cloned definition
168
+ * @returns The cloned definition or undefined if source doesn't exist
169
+ */
170
+ cloneDefinition(sourceName: string, targetName: string): Definition | undefined;
171
+ /**
172
+ * Updates property indices for ordering.
173
+ *
174
+ * @param order - Array of property names in the desired order
175
+ * @param definitionName - Optional definition name (if not provided, updates root schema properties)
176
+ */
177
+ updatePropertyIndices(order: string[], definitionName?: string): void;
178
+ /**
179
+ * Performs cleanup operations on the schema.
180
+ *
181
+ * @param definitionsToDelete - Array of definition names to delete
182
+ */
183
+ cleanup(definitionsToDelete: string[]): void;
184
+ /**
185
+ * Finalizes and returns the schema.
186
+ * This method can be used as the final step in schema generation.
187
+ *
188
+ * @returns The finalized schema definition
189
+ */
190
+ finalize(): Definition;
191
+ }
192
+ export {};
193
+ //# sourceMappingURL=AppSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppSchema.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/v4/sync-rules/AppSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAkB,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGxE,KAAK,OAAO,GAAG;IACX,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,qBAAa,SAAS;IAClB,OAAO,CAAC,MAAM,CAAa;IAE3B;;;;OAIG;gBACS,aAAa,EAAE,MAAM;IAIjC;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAoD5B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAyBvB;;;;OAIG;IACH,SAAS,IAAI,UAAU;IAIvB;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS;IAOhE;;;;;OAKG;IACH,aAAa,CAA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