@siliconst/metaui 1.4.9 → 1.4.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 (307) hide show
  1. package/README.md +4 -178
  2. package/package.json +1 -1
  3. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +56 -8
  4. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
  5. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +27 -3
  6. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  7. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  8. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  9. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +52 -9
  10. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +132 -18
  11. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
  12. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +14 -9
  13. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  16. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +117 -18
  17. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js +1 -3
  18. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate-dbg.js.map +1 -1
  19. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.d.ts.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js +1 -1
  21. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DataSyncDelegate.ts +1 -3
  23. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js +9 -6
  24. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts +1 -1
  26. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts.map +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js +1 -1
  28. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js.map +1 -1
  29. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts +9 -6
  30. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js +56 -49
  31. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map +1 -1
  32. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts +9 -4
  33. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.d.ts.map +1 -1
  34. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js +1 -1
  35. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js.map +1 -1
  36. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +67 -50
  37. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js +0 -2
  38. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine-dbg.js.map +1 -1
  39. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts +0 -2
  40. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.d.ts.map +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.js.map +1 -1
  42. package/src/nz/co/siliconst/ui5/metaui/core/ConditionEngine.ts +0 -3
  43. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js +4 -6
  44. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator-dbg.js.map +1 -1
  45. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js +1 -1
  46. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.js.map +1 -1
  47. package/src/nz/co/siliconst/ui5/metaui/core/DefaultLayoutGenerator.ts +4 -4
  48. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +36 -9
  49. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  50. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +18 -2
  51. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  52. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
  53. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  54. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +39 -5
  55. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +19 -2
  56. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
  57. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts +9 -0
  58. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
  59. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
  60. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +21 -7
  62. package/src/nz/co/siliconst/ui5/metaui/core/Registry-dbg.js +3 -1
  63. package/src/nz/co/siliconst/ui5/metaui/core/Registry-dbg.js.map +1 -1
  64. package/src/nz/co/siliconst/ui5/metaui/core/Registry.d.ts.map +1 -1
  65. package/src/nz/co/siliconst/ui5/metaui/core/Registry.js +1 -1
  66. package/src/nz/co/siliconst/ui5/metaui/core/Registry.js.map +1 -1
  67. package/src/nz/co/siliconst/ui5/metaui/core/Registry.ts +3 -1
  68. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +54 -34
  69. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
  70. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +3 -1
  71. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
  72. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
  73. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
  74. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +55 -34
  75. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator-dbg.js +7 -6
  76. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator-dbg.js.map +1 -1
  77. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.d.ts.map +1 -1
  78. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.js +1 -1
  79. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.js.map +1 -1
  80. package/src/nz/co/siliconst/ui5/metaui/core/SchemaValidator.ts +7 -6
  81. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js +40 -11
  82. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
  83. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts +6 -1
  84. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.d.ts.map +1 -1
  85. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js +1 -1
  86. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
  87. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +39 -13
  88. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
  89. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +13 -0
  90. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
  91. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +15 -0
  92. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  93. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +1 -0
  94. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  95. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +1 -0
  96. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js +10 -0
  97. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout-dbg.js.map +1 -1
  98. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.d.ts.map +1 -1
  99. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js +1 -1
  100. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.js.map +1 -1
  101. package/src/nz/co/siliconst/ui5/metaui/layouts/TableLayout.ts +10 -0
  102. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js +1 -1
  103. package/src/nz/co/siliconst/ui5/metaui/library-dbg.js.map +1 -1
  104. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +44 -43
  105. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  106. package/src/nz/co/siliconst/ui5/metaui/library.d.ts +1 -0
  107. package/src/nz/co/siliconst/ui5/metaui/library.d.ts.map +1 -1
  108. package/src/nz/co/siliconst/ui5/metaui/library.js +1 -1
  109. package/src/nz/co/siliconst/ui5/metaui/library.js.map +1 -1
  110. package/src/nz/co/siliconst/ui5/metaui/library.ts +1 -0
  111. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js +6 -0
  112. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin-dbg.js.map +1 -1
  113. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.d.ts.map +1 -1
  114. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js +1 -1
  115. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.js.map +1 -1
  116. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin.ts +6 -0
  117. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js +2 -2
  118. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin-dbg.js.map +1 -1
  119. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js +1 -1
  120. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.js.map +1 -1
  121. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin.ts +2 -2
  122. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +77 -1
  123. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  124. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +17 -0
  125. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  126. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
  127. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  128. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +67 -7
  129. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js +1 -1
  130. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
  131. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js +1 -1
  132. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
  133. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +1 -1
  134. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js +1 -1
  135. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin-dbg.js.map +1 -1
  136. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js +1 -1
  137. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.js.map +1 -1
  138. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin.ts +1 -1
  139. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js +10 -3
  140. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin-dbg.js.map +1 -1
  141. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.d.ts.map +1 -1
  142. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js +1 -1
  143. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.js.map +1 -1
  144. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin.ts +10 -3
  145. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +1 -1
  146. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
  147. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
  148. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
  149. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +1 -1
  150. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +1 -1
  151. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
  152. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
  153. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
  154. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +1 -1
  155. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js +1 -1
  156. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
  157. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js +1 -1
  158. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
  159. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +1 -1
  160. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +1 -1
  161. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
  162. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
  163. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
  164. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +1 -1
  165. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js +1 -1
  166. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin-dbg.js.map +1 -1
  167. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js +1 -1
  168. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.js.map +1 -1
  169. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin.ts +1 -1
  170. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +130 -0
  171. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -0
  172. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts +39 -0
  173. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts.map +1 -0
  174. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +2 -0
  175. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -0
  176. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +127 -0
  177. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js +1 -1
  178. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js.map +1 -1
  179. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js +1 -1
  180. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js.map +1 -1
  181. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.ts +1 -1
  182. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +2 -2
  183. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
  184. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
  185. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
  186. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +2 -2
  187. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js +6 -0
  188. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin-dbg.js.map +1 -1
  189. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.d.ts.map +1 -1
  190. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js +1 -1
  191. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.js.map +1 -1
  192. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin.ts +6 -0
  193. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -1
  194. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
  195. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
  196. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
  197. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +1 -1
  198. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js +1 -1
  199. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin-dbg.js.map +1 -1
  200. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js +1 -1
  201. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.js.map +1 -1
  202. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin.ts +1 -1
  203. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js +1 -1
  204. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin-dbg.js.map +1 -1
  205. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js +1 -1
  206. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.js.map +1 -1
  207. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin.ts +1 -1
  208. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +1 -1
  209. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
  210. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
  211. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
  212. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +1 -1
  213. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js +1 -1
  214. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin-dbg.js.map +1 -1
  215. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js +1 -1
  216. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.js.map +1 -1
  217. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin.ts +1 -1
  218. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js +1 -1
  219. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js.map +1 -1
  220. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js +1 -1
  221. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js.map +1 -1
  222. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.ts +1 -1
  223. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js +40 -4
  224. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin-dbg.js.map +1 -1
  225. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts +4 -0
  226. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.d.ts.map +1 -1
  227. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js +1 -1
  228. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.js.map +1 -1
  229. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin.ts +41 -3
  230. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +1 -1
  231. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
  232. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
  233. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
  234. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +1 -1
  235. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js +1 -1
  236. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin-dbg.js.map +1 -1
  237. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js +1 -1
  238. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.js.map +1 -1
  239. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin.ts +1 -1
  240. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin-dbg.js.map +1 -1
  241. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.js.map +1 -1
  242. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin.ts +1 -1
  243. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin-dbg.js.map +1 -1
  244. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.js.map +1 -1
  245. package/src/nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin.ts +1 -1
  246. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin-dbg.js.map +1 -1
  247. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.d.ts +1 -1
  248. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.d.ts.map +1 -1
  249. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.js.map +1 -1
  250. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/CurrencyFormatterPlugin.ts +2 -2
  251. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin-dbg.js.map +1 -1
  252. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.d.ts +1 -1
  253. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.d.ts.map +1 -1
  254. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.js.map +1 -1
  255. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/DateFormatterPlugin.ts +1 -1
  256. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin-dbg.js +1 -1
  257. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin-dbg.js.map +1 -1
  258. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.d.ts +1 -1
  259. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.d.ts.map +1 -1
  260. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.js +1 -1
  261. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.js.map +1 -1
  262. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/PhoneFormatterPlugin.ts +2 -2
  263. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin-dbg.js +1 -1
  264. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin-dbg.js.map +1 -1
  265. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.d.ts +1 -1
  266. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.d.ts.map +1 -1
  267. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.js +1 -1
  268. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.js.map +1 -1
  269. package/src/nz/co/siliconst/ui5/metaui/plugins/formatters/TextCaseFormatterPlugin.ts +2 -2
  270. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin-dbg.js +1 -1
  271. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin-dbg.js.map +1 -1
  272. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.d.ts +1 -1
  273. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.d.ts.map +1 -1
  274. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.js +1 -1
  275. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.js.map +1 -1
  276. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/EmailValidatorPlugin.ts +3 -3
  277. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin-dbg.js.map +1 -1
  278. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.d.ts +1 -1
  279. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.d.ts.map +1 -1
  280. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.js.map +1 -1
  281. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/IbanValidatorPlugin.ts +1 -1
  282. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin-dbg.js.map +1 -1
  283. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.d.ts +1 -1
  284. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.d.ts.map +1 -1
  285. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.js.map +1 -1
  286. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/MinLengthValidatorPlugin.ts +1 -1
  287. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin-dbg.js +2 -2
  288. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin-dbg.js.map +1 -1
  289. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.d.ts +1 -1
  290. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.d.ts.map +1 -1
  291. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.js +1 -1
  292. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.js.map +1 -1
  293. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/PatternValidatorPlugin.ts +4 -4
  294. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin-dbg.js +3 -2
  295. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin-dbg.js.map +1 -1
  296. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.d.ts +1 -1
  297. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.d.ts.map +1 -1
  298. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.js +1 -1
  299. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.js.map +1 -1
  300. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/RangeValidatorPlugin.ts +4 -3
  301. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin-dbg.js +3 -1
  302. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin-dbg.js.map +1 -1
  303. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.d.ts +1 -1
  304. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.d.ts.map +1 -1
  305. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.js +1 -1
  306. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.js.map +1 -1
  307. package/src/nz/co/siliconst/ui5/metaui/plugins/validators/UrlValidatorPlugin.ts +4 -3
@@ -13,13 +13,16 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
13
13
  static normalize(rawSchema, data) {
14
14
  let schemaObj = rawSchema;
15
15
  if (typeof schemaObj === "string") {
16
- try {
17
- schemaObj = JSON.parse(schemaObj);
18
- } catch (e) {
19
- const msg = e.message;
20
- Logger.error("[MetaUI SchemaNormalizer] Failed to parse schema string.", msg);
21
- Logger.showErrorPopup(`Failed to parse the provided JSON schema.\n\nDetails: ${msg}`);
16
+ if (!schemaObj.trim()) {
22
17
  schemaObj = null;
18
+ } else {
19
+ try {
20
+ schemaObj = JSON.parse(schemaObj);
21
+ } catch (e) {
22
+ const msg = "Failed to parse schema string: " + e.message;
23
+ Logger.error("[MetaUI SchemaNormalizer]", msg);
24
+ throw new Error(msg);
25
+ }
23
26
  }
24
27
  }
25
28
  if (!schemaObj || typeof schemaObj !== 'object' || Array.isArray(schemaObj)) {
@@ -44,24 +47,20 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
44
47
  }
45
48
  }
46
49
  if (normalized.type === "object") {
47
- normalized.properties = this.normalizeProperties(targetProperties);
50
+ const requiredKeys = Array.isArray(schemaObj.required) ? schemaObj.required : [];
51
+ normalized.properties = this.normalizeProperties(targetProperties, requiredKeys);
48
52
  } else if (normalized.type === "array") {
49
53
  // Future expansion: array deep merge
50
54
  normalized.items = this.normalizePropertyMetadata(schemaObj.items || {
51
55
  type: "object",
52
56
  properties: {}
53
- }, "items");
57
+ }, "items", false);
54
58
  }
55
59
  return normalized;
56
60
  } catch (error) {
57
- const msg = error.message;
58
- Logger.error("[MetaUI SchemaNormalizer] Critical error normalizing schema object.", msg);
59
- Logger.showErrorPopup(`Schema Normalization failed.\n\nDetails: ${msg}`);
60
- // Fallback to empty object to prevent hard crash downstream
61
- return {
62
- type: "object",
63
- properties: {}
64
- };
61
+ const msg = "Critical error normalizing schema object: " + error.message;
62
+ Logger.error("[MetaUI SchemaNormalizer]", msg);
63
+ throw new Error(msg);
65
64
  }
66
65
  }
67
66
 
@@ -90,12 +89,14 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
90
89
  /**
91
90
  * Normalizes a collection of properties.
92
91
  * @param properties The raw properties map.
92
+ * @param requiredKeys An optional array of keys that are required by the parent object.
93
93
  * @returns A map of strict IPropertyMetadata objects.
94
94
  */
95
- static normalizeProperties(properties) {
95
+ static normalizeProperties(properties, requiredKeys = []) {
96
96
  const normalizedProps = {};
97
97
  for (const key of Object.keys(properties)) {
98
- normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key);
98
+ const isRequired = requiredKeys.includes(key);
99
+ normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key, isRequired);
99
100
  }
100
101
  return normalizedProps;
101
102
  }
@@ -104,9 +105,10 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
104
105
  * Normalizes a single property against the ISchema specification.
105
106
  * @param prop The raw property definition.
106
107
  * @param keyName The string key name for generating default labels.
108
+ * @param isRequired Indicates if the parent object mandated this property as required.
107
109
  * @returns A strict IPropertyMetadata instance.
108
110
  */
109
- static normalizePropertyMetadata(prop, keyName) {
111
+ static normalizePropertyMetadata(prop, keyName, isRequired = false) {
110
112
  const normalized = {
111
113
  type: prop.type || "string",
112
114
  ui: {
@@ -121,23 +123,27 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
121
123
  formatter: prop.ui?.formatter,
122
124
  args: prop.ui?.args,
123
125
  rows: prop.ui?.rows,
124
- fullWidth: prop.ui?.fullWidth
126
+ fullWidth: prop.ui?.fullWidth,
127
+ dialogButtonText: prop.ui?.dialogButtonText
125
128
  },
126
- required: !!prop.required,
129
+ required: isRequired || !!prop.required,
127
130
  maxLength: prop.maxLength,
131
+ minLength: prop.minLength,
128
132
  minimum: prop.minimum,
129
133
  maximum: prop.maximum,
130
134
  pattern: prop.pattern,
131
135
  precision: prop.precision,
132
136
  scale: prop.scale,
137
+ multipleOf: prop.multipleOf,
133
138
  valueHelp: prop.valueHelp,
134
139
  enum: prop.enum
135
140
  };
136
141
  if (normalized.type === "object" && prop.properties) {
137
- normalized.properties = this.normalizeProperties(prop.properties);
142
+ const requiredKeys = Array.isArray(prop.required) ? prop.required : [];
143
+ normalized.properties = this.normalizeProperties(prop.properties, requiredKeys);
138
144
  normalized.uiLayout = prop.uiLayout;
139
145
  } else if (normalized.type === "array" && prop.items) {
140
- normalized.items = this.normalizePropertyMetadata(prop.items, "items");
146
+ normalized.items = this.normalizePropertyMetadata(prop.items, "items", false);
141
147
  normalized.uiLayout = prop.uiLayout;
142
148
  }
143
149
  return normalized;
@@ -167,12 +173,19 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
167
173
  }
168
174
  if (Array.isArray(data)) {
169
175
  schema.type = "array";
170
- schema.layoutStrategy = "table";
171
- schema.items = {
172
- type: "object",
173
- layoutStrategy: "compact",
174
- properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}
175
- };
176
+ if (data.length > 0 && typeof data[0] !== "object") {
177
+ schema.layoutStrategy = "compact";
178
+ schema.items = {
179
+ type: typeof data[0]
180
+ };
181
+ } else {
182
+ schema.layoutStrategy = "table";
183
+ schema.items = {
184
+ type: "object",
185
+ layoutStrategy: "compact",
186
+ properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}
187
+ };
188
+ }
176
189
  } else {
177
190
  schema.type = "object";
178
191
  schema.properties = this.inferPropertiesFromObject(data);
@@ -196,10 +209,16 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
196
209
  let nestedProps;
197
210
  if (typeof val === "number") type = "number";else if (typeof val === "boolean") type = "boolean";else if (Array.isArray(val)) {
198
211
  type = "array";
199
- items = {
200
- type: "object",
201
- properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}
202
- };
212
+ if (val.length > 0 && typeof val[0] !== "object") {
213
+ items = {
214
+ type: typeof val[0]
215
+ };
216
+ } else {
217
+ items = {
218
+ type: "object",
219
+ properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}
220
+ };
221
+ }
203
222
  } else if (typeof val === "object") {
204
223
  type = "object";
205
224
  nestedProps = this.inferPropertiesFromObject(val);
@@ -211,7 +230,8 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
211
230
  ui: {
212
231
  label: this.generateLabel(key),
213
232
  isKey: false,
214
- readOnly: false
233
+ readOnly: false,
234
+ widget: type === "array" && items?.type !== "object" ? "multiInput" : undefined
215
235
  }
216
236
  };
217
237
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaNormalizer-dbg.js","names":["Logger","___utils_Logger","SchemaNormalizer","normalize","rawSchema","data","schemaObj","JSON","parse","e","msg","message","error","showErrorPopup","Array","isArray","inferSchemaFromData","normalized","title","type","items","layoutStrategy","uiLayout","additionalProperties","targetProperties","properties","inferred","deepMergeProperties","normalizeProperties","normalizePropertyMetadata","base","override","merged","key","Object","keys","overrideVal","baseVal","normalizedProps","prop","keyName","ui","label","generateLabel","isKey","readOnly","widget","valueHelp","enum","undefined","visibleOn","enabledOn","format","validators","formatter","args","rows","fullWidth","required","maxLength","minimum","maximum","pattern","precision","scale","name","spaced","replace","split","filter","w","length","map","word","charAt","toUpperCase","slice","toLowerCase","join","trim","schema","inferPropertiesFromObject","obj","val","nestedProps","resolveScope","scope","startsWith","meta","bindingPath","propKey","pathSegments","current","debug","stringify","i","segment","__exports","__esModule"],"sources":["SchemaNormalizer.ts"],"sourcesContent":["/**\n * @file SchemaNormalizer.ts\n * @description Transforms and validates incoming JSON payloads into the strict v2 ISchema dictionary matrix.\n */\n\nimport { ISchema, IPropertyMetadata, FieldType } from \"../interfaces/ISchema\";\nimport { Logger } from \"../utils/Logger\";\n\nexport class SchemaNormalizer {\n\n /**\n * Validates that the provided raw payload conforms to the required ISchema structures.\n */\n public static normalize(rawSchema?: unknown, data?: unknown): ISchema {\n let schemaObj = rawSchema;\n\n if (typeof schemaObj === \"string\") {\n try {\n schemaObj = JSON.parse(schemaObj);\n } catch (e) {\n const msg = (e as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer] Failed to parse schema string.\", msg);\n Logger.showErrorPopup(`Failed to parse the provided JSON schema.\\n\\nDetails: ${msg}`);\n schemaObj = null;\n }\n }\n\n if (!schemaObj || typeof schemaObj !== 'object' || Array.isArray(schemaObj)) {\n return this.inferSchemaFromData(data);\n }\n\n try {\n // It is an object. Ensure it conforms to v2 structure.\n const normalized: ISchema = {\n title: schemaObj.title,\n type: schemaObj.type || (schemaObj.items ? \"array\" : \"object\"),\n layoutStrategy: schemaObj.layoutStrategy,\n uiLayout: schemaObj.uiLayout,\n additionalProperties: schemaObj.additionalProperties\n };\n\n let targetProperties = schemaObj.properties || {};\n\n if (schemaObj.additionalProperties === true && data) {\n const inferred = this.inferSchemaFromData(data);\n if (inferred.type === \"object\" && inferred.properties) {\n targetProperties = this.deepMergeProperties(inferred.properties, targetProperties);\n } else if (inferred.type === \"array\" && inferred.items && inferred.items.properties) {\n // Array schema merging could be added here if we want full support.\n }\n }\n\n if (normalized.type === \"object\") {\n normalized.properties = this.normalizeProperties(targetProperties);\n } else if (normalized.type === \"array\") {\n // Future expansion: array deep merge\n normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: \"object\", properties: {} }, \"items\");\n }\n\n return normalized;\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer] Critical error normalizing schema object.\", msg);\n Logger.showErrorPopup(`Schema Normalization failed.\\n\\nDetails: ${msg}`);\n // Fallback to empty object to prevent hard crash downstream\n return { type: \"object\", properties: {} };\n }\n }\n\n /**\n * Recursively deep merges an inferred schema over a base schema.\n * @param base The base property dictionary.\n * @param override The overriding inferred dictionary.\n * @returns A new deeply merged property dictionary.\n */\n private static deepMergeProperties(base: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown> {\n const merged = { ...base };\n for (const key of Object.keys(override)) {\n const overrideVal = override[key];\n const baseVal = merged[key];\n\n if (baseVal && typeof baseVal === \"object\" && !Array.isArray(baseVal) &&\n overrideVal && typeof overrideVal === \"object\" && !Array.isArray(overrideVal)) {\n merged[key] = this.deepMergeProperties(baseVal, overrideVal);\n } else {\n merged[key] = overrideVal;\n }\n }\n return merged;\n }\n\n /**\n * Normalizes a collection of properties.\n * @param properties The raw properties map.\n * @returns A map of strict IPropertyMetadata objects.\n */\n private static normalizeProperties(properties: Record<string, unknown>): Record<string, IPropertyMetadata> {\n const normalizedProps: Record<string, IPropertyMetadata> = {};\n for (const key of Object.keys(properties)) {\n normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key);\n }\n return normalizedProps;\n }\n\n /**\n * Normalizes a single property against the ISchema specification.\n * @param prop The raw property definition.\n * @param keyName The string key name for generating default labels.\n * @returns A strict IPropertyMetadata instance.\n */\n private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string): IPropertyMetadata {\n const normalized: IPropertyMetadata = {\n type: prop.type || \"string\",\n ui: {\n label: prop.ui?.label || this.generateLabel(keyName),\n isKey: !!prop.ui?.isKey,\n readOnly: !!prop.ui?.readOnly,\n widget: prop.ui?.widget || (prop.valueHelp || prop.enum ? \"select\" : undefined),\n visibleOn: prop.ui?.visibleOn,\n enabledOn: prop.ui?.enabledOn,\n format: prop.ui?.format,\n validators: prop.ui?.validators,\n formatter: prop.ui?.formatter,\n args: prop.ui?.args,\n rows: prop.ui?.rows,\n fullWidth: prop.ui?.fullWidth\n },\n required: !!prop.required,\n maxLength: prop.maxLength,\n minimum: prop.minimum,\n maximum: prop.maximum,\n pattern: prop.pattern,\n precision: prop.precision,\n scale: prop.scale,\n valueHelp: prop.valueHelp,\n enum: prop.enum\n };\n\n if (normalized.type === \"object\" && prop.properties) {\n normalized.properties = this.normalizeProperties(prop.properties);\n normalized.uiLayout = prop.uiLayout;\n } else if (normalized.type === \"array\" && prop.items) {\n normalized.items = this.normalizePropertyMetadata(prop.items, \"items\");\n normalized.uiLayout = prop.uiLayout;\n }\n\n return normalized;\n }\n\n /**\n * Generates a Title Case label from camelCase or snake_case technical names.\n */\n private static generateLabel(name: string): string {\n if (!name) return \"\";\n let spaced = name.replace(/([A-Z])/g, \" $1\").replace(/_/g, \" \");\n return spaced.split(' ')\n .filter(w => w.length > 0)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ')\n .trim();\n }\n\n /**\n * Infers a v2 ISchema structure dynamically from a plain data payload.\n */\n private static inferSchemaFromData(data: unknown): ISchema {\n const schema: ISchema = { type: \"object\", properties: {}, layoutStrategy: \"compact\", title: \"\" };\n\n if (!data || typeof data !== \"object\") {\n return schema;\n }\n\n if (Array.isArray(data)) {\n schema.type = \"array\";\n schema.layoutStrategy = \"table\";\n schema.items = {\n type: \"object\",\n layoutStrategy: \"compact\",\n properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}\n };\n } else {\n schema.type = \"object\";\n schema.properties = this.inferPropertiesFromObject(data);\n }\n\n return schema;\n }\n\n /**\n * Infers field metadata recursively from a raw data object.\n * @param obj The raw JavaScript object.\n * @returns A dictionary of inferred IPropertyMetadata.\n */\n private static inferPropertiesFromObject(obj: Record<string, unknown>): Record<string, IPropertyMetadata> {\n const properties: Record<string, IPropertyMetadata> = {};\n if (!obj || typeof obj !== \"object\") return properties;\n\n for (const key of Object.keys(obj)) {\n const val = obj[key];\n if (val === null || val === undefined) continue;\n\n let type: FieldType = \"string\";\n let items: IPropertyMetadata | undefined;\n let nestedProps: Record<string, IPropertyMetadata> | undefined;\n\n if (typeof val === \"number\") type = \"number\";\n else if (typeof val === \"boolean\") type = \"boolean\";\n else if (Array.isArray(val)) {\n type = \"array\";\n items = {\n type: \"object\",\n properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}\n };\n } else if (typeof val === \"object\") {\n type = \"object\";\n nestedProps = this.inferPropertiesFromObject(val);\n }\n\n properties[key] = {\n type,\n items,\n properties: nestedProps,\n ui: {\n label: this.generateLabel(key),\n isKey: false,\n readOnly: false\n }\n };\n }\n\n return properties;\n }\n\n /**\n * Resolves a JSON Schema scope (e.g. '#/properties/header/properties/id')\n * against the ISchema, returning the PropertyMetadata and the UI5 binding path.\n */\n public static resolveScope(schema: ISchema, scope: string): { meta: IPropertyMetadata | undefined, bindingPath: string, propKey: string } {\n if (!scope || !scope.startsWith(\"#/properties/\")) {\n return { meta: undefined, bindingPath: scope || \"\", propKey: scope || \"\" };\n }\n \n const pathSegments = scope.replace(\"#/properties/\", \"\").split(\"/properties/\");\n let current: Record<string, unknown> = schema.properties;\n let meta: IPropertyMetadata | undefined;\n \n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Resolving scope '${scope}' with segments: ${JSON.stringify(pathSegments)}`, \"SchemaNormalizer\");\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Root schema keys: ${Object.keys(schema.properties || {})}`, \"SchemaNormalizer\");\n\n for (let i = 0; i < pathSegments.length; i++) {\n const segment = pathSegments[i];\n if (!current) {\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `current is undefined at segment '${segment}'`, \"SchemaNormalizer\");\n meta = undefined;\n break;\n }\n meta = current[segment];\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Segment '${segment}' resolved to meta: ${!!meta}. Available keys in current: ${Object.keys(current)}`, \"SchemaNormalizer\");\n if (i < pathSegments.length - 1) {\n current = meta?.properties;\n }\n }\n \n const bindingPath = pathSegments.join(\"/\");\n const propKey = scope.replace(\"#/properties/\", \"\"); // The original raw string for logging\n \n return {\n meta,\n bindingPath,\n propKey\n };\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAMSA,MAAM,GAAAC,eAAA;EAER,MAAMC,gBAAgB,CAAC;IAE1B;AACJ;AACA;IACI,OAAcC,SAASA,CAACC,SAAmB,EAAEC,IAAc,EAAW;MAClE,IAAIC,SAAS,GAAGF,SAAS;MAEzB,IAAI,OAAOE,SAAS,KAAK,QAAQ,EAAE;QAC/B,IAAI;UACAA,SAAS,GAAG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vBhG,MAAM,CAAC6F,KAAK,CAAC,2BAA2B,EAAE,YAAYG,OAAO,uBAAuB,CAAC,CAACR,IAAI,gCAAgCtD,MAAM,CAACC,IAAI,CAACyD,OAAO,CAAC,EAAE,EAAE,kBAAkB,CAAC;QACrK,IAAIG,CAAC,GAAGJ,YAAY,CAACpB,MAAM,GAAG,CAAC,EAAE;UAC7BqB,OAAO,GAAGJ,IAAI,EAAE/D,UAAU;QAC9B;MACJ;MAEA,MAAMgE,WAAW,GAAGE,YAAY,CAACb,IAAI,CAAC,GAAG,CAAC;MAC1C,MAAMY,OAAO,GAAGJ,KAAK,CAACnB,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;;MAEpD,OAAO;QACHqB,IAAI;QACJC,WAAW;QACXC;MACJ,CAAC;IACL;EACJ;EAAC,IAAAO,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA/F,gBAAA,GAAAA,gBAAA;EAAA,OAAA+F,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"SchemaNormalizer-dbg.js","names":["Logger","___utils_Logger","SchemaNormalizer","normalize","rawSchema","data","schemaObj","trim","JSON","parse","e","msg","message","error","Error","Array","isArray","inferSchemaFromData","normalized","title","type","items","layoutStrategy","uiLayout","additionalProperties","targetProperties","properties","inferred","deepMergeProperties","requiredKeys","required","normalizeProperties","normalizePropertyMetadata","base","override","merged","key","Object","keys","overrideVal","baseVal","normalizedProps","isRequired","includes","prop","keyName","ui","label","generateLabel","isKey","readOnly","widget","valueHelp","enum","undefined","visibleOn","enabledOn","format","validators","formatter","args","rows","fullWidth","dialogButtonText","maxLength","minLength","minimum","maximum","pattern","precision","scale","multipleOf","name","spaced","replace","split","filter","w","length","map","word","charAt","toUpperCase","slice","toLowerCase","join","schema","inferPropertiesFromObject","obj","val","nestedProps","resolveScope","scope","startsWith","meta","bindingPath","propKey","pathSegments","current","debug","stringify","i","segment","__exports","__esModule"],"sources":["SchemaNormalizer.ts"],"sourcesContent":["/**\n * @file SchemaNormalizer.ts\n * @description Transforms and validates incoming JSON payloads into the strict v2 ISchema dictionary matrix.\n */\n\nimport { ISchema, IPropertyMetadata, FieldType } from \"../interfaces/ISchema\";\nimport { Logger } from \"../utils/Logger\";\n\nexport class SchemaNormalizer {\n\n /**\n * Validates that the provided raw payload conforms to the required ISchema structures.\n */\n public static normalize(rawSchema?: unknown, data?: unknown): ISchema {\n let schemaObj = rawSchema;\n\n if (typeof schemaObj === \"string\") {\n if (!schemaObj.trim()) {\n schemaObj = null;\n } else {\n try {\n schemaObj = JSON.parse(schemaObj);\n } catch (e) {\n const msg = \"Failed to parse schema string: \" + (e as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer]\", msg);\n throw new Error(msg);\n }\n }\n }\n\n if (!schemaObj || typeof schemaObj !== 'object' || Array.isArray(schemaObj)) {\n return this.inferSchemaFromData(data);\n }\n\n try {\n // It is an object. Ensure it conforms to v2 structure.\n const normalized: ISchema = {\n title: schemaObj.title,\n type: schemaObj.type || (schemaObj.items ? \"array\" : \"object\"),\n layoutStrategy: schemaObj.layoutStrategy,\n uiLayout: schemaObj.uiLayout,\n additionalProperties: schemaObj.additionalProperties\n };\n\n let targetProperties = schemaObj.properties || {};\n\n if (schemaObj.additionalProperties === true && data) {\n const inferred = this.inferSchemaFromData(data);\n if (inferred.type === \"object\" && inferred.properties) {\n targetProperties = this.deepMergeProperties(inferred.properties, targetProperties);\n } else if (inferred.type === \"array\" && inferred.items && inferred.items.properties) {\n // Array schema merging could be added here if we want full support.\n }\n }\n\n if (normalized.type === \"object\") {\n const requiredKeys = Array.isArray(schemaObj.required) ? schemaObj.required : [];\n normalized.properties = this.normalizeProperties(targetProperties, requiredKeys);\n } else if (normalized.type === \"array\") {\n // Future expansion: array deep merge\n normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: \"object\", properties: {} }, \"items\", false);\n }\n\n return normalized;\n } catch (error) {\n const msg = \"Critical error normalizing schema object: \" + (error as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer]\", msg);\n throw new Error(msg);\n }\n }\n\n /**\n * Recursively deep merges an inferred schema over a base schema.\n * @param base The base property dictionary.\n * @param override The overriding inferred dictionary.\n * @returns A new deeply merged property dictionary.\n */\n private static deepMergeProperties(base: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown> {\n const merged = { ...base };\n for (const key of Object.keys(override)) {\n const overrideVal = override[key];\n const baseVal = merged[key];\n\n if (baseVal && typeof baseVal === \"object\" && !Array.isArray(baseVal) &&\n overrideVal && typeof overrideVal === \"object\" && !Array.isArray(overrideVal)) {\n merged[key] = this.deepMergeProperties(baseVal, overrideVal);\n } else {\n merged[key] = overrideVal;\n }\n }\n return merged;\n }\n\n /**\n * Normalizes a collection of properties.\n * @param properties The raw properties map.\n * @param requiredKeys An optional array of keys that are required by the parent object.\n * @returns A map of strict IPropertyMetadata objects.\n */\n private static normalizeProperties(properties: Record<string, unknown>, requiredKeys: string[] = []): Record<string, IPropertyMetadata> {\n const normalizedProps: Record<string, IPropertyMetadata> = {};\n for (const key of Object.keys(properties)) {\n const isRequired = requiredKeys.includes(key);\n normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key, isRequired);\n }\n return normalizedProps;\n }\n\n /**\n * Normalizes a single property against the ISchema specification.\n * @param prop The raw property definition.\n * @param keyName The string key name for generating default labels.\n * @param isRequired Indicates if the parent object mandated this property as required.\n * @returns A strict IPropertyMetadata instance.\n */\n private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string, isRequired: boolean = false): IPropertyMetadata {\n const normalized: IPropertyMetadata = {\n type: prop.type || \"string\",\n ui: {\n label: prop.ui?.label || this.generateLabel(keyName),\n isKey: !!prop.ui?.isKey,\n readOnly: !!prop.ui?.readOnly,\n widget: prop.ui?.widget || (prop.valueHelp || prop.enum ? \"select\" : undefined),\n visibleOn: prop.ui?.visibleOn,\n enabledOn: prop.ui?.enabledOn,\n format: prop.ui?.format,\n validators: prop.ui?.validators,\n formatter: prop.ui?.formatter,\n args: prop.ui?.args,\n rows: prop.ui?.rows,\n fullWidth: prop.ui?.fullWidth,\n dialogButtonText: prop.ui?.dialogButtonText\n },\n required: isRequired || !!prop.required,\n maxLength: prop.maxLength as number,\n minLength: prop.minLength as number,\n minimum: prop.minimum,\n maximum: prop.maximum,\n pattern: prop.pattern,\n precision: prop.precision,\n scale: prop.scale,\n multipleOf: prop.multipleOf as number,\n valueHelp: prop.valueHelp,\n enum: prop.enum\n };\n\n if (normalized.type === \"object\" && prop.properties) {\n const requiredKeys = Array.isArray(prop.required) ? prop.required : [];\n normalized.properties = this.normalizeProperties(prop.properties as Record<string, unknown>, requiredKeys);\n normalized.uiLayout = prop.uiLayout;\n } else if (normalized.type === \"array\" && prop.items) {\n normalized.items = this.normalizePropertyMetadata(prop.items as Record<string, unknown>, \"items\", false);\n normalized.uiLayout = prop.uiLayout;\n }\n\n return normalized;\n }\n\n /**\n * Generates a Title Case label from camelCase or snake_case technical names.\n */\n private static generateLabel(name: string): string {\n if (!name) return \"\";\n let spaced = name.replace(/([A-Z])/g, \" $1\").replace(/_/g, \" \");\n return spaced.split(' ')\n .filter(w => w.length > 0)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ')\n .trim();\n }\n\n /**\n * Infers a v2 ISchema structure dynamically from a plain data payload.\n */\n public static inferSchemaFromData(data: unknown): ISchema {\n const schema: ISchema = { type: \"object\", properties: {}, layoutStrategy: \"compact\", title: \"\" };\n\n if (!data || typeof data !== \"object\") {\n return schema;\n }\n\n if (Array.isArray(data)) {\n schema.type = \"array\";\n if (data.length > 0 && typeof data[0] !== \"object\") {\n schema.layoutStrategy = \"compact\";\n schema.items = { type: typeof data[0] as FieldType };\n } else {\n schema.layoutStrategy = \"table\";\n schema.items = {\n type: \"object\",\n layoutStrategy: \"compact\",\n properties: data.length > 0 ? this.inferPropertiesFromObject(data[0] as Record<string, unknown>) : {}\n };\n }\n } else {\n schema.type = \"object\";\n schema.properties = this.inferPropertiesFromObject(data);\n }\n\n return schema;\n }\n\n /**\n * Infers field metadata recursively from a raw data object.\n * @param obj The raw JavaScript object.\n * @returns A dictionary of inferred IPropertyMetadata.\n */\n private static inferPropertiesFromObject(obj: Record<string, unknown>): Record<string, IPropertyMetadata> {\n const properties: Record<string, IPropertyMetadata> = {};\n if (!obj || typeof obj !== \"object\") return properties;\n\n for (const key of Object.keys(obj)) {\n const val = obj[key];\n if (val === null || val === undefined) continue;\n\n let type: FieldType = \"string\";\n let items: IPropertyMetadata | undefined;\n let nestedProps: Record<string, IPropertyMetadata> | undefined;\n\n if (typeof val === \"number\") type = \"number\";\n else if (typeof val === \"boolean\") type = \"boolean\";\n else if (Array.isArray(val)) {\n type = \"array\";\n if (val.length > 0 && typeof val[0] !== \"object\") {\n items = {\n type: typeof val[0] as FieldType\n };\n } else {\n items = {\n type: \"object\",\n properties: val.length > 0 ? this.inferPropertiesFromObject(val[0] as Record<string, unknown>) : {}\n };\n }\n } else if (typeof val === \"object\") {\n type = \"object\";\n nestedProps = this.inferPropertiesFromObject(val);\n }\n\n properties[key] = {\n type,\n items,\n properties: nestedProps,\n ui: {\n label: this.generateLabel(key),\n isKey: false,\n readOnly: false,\n widget: type === \"array\" && items?.type !== \"object\" ? \"multiInput\" : undefined\n }\n };\n }\n\n return properties;\n }\n\n /**\n * Resolves a JSON Schema scope (e.g. '#/properties/header/properties/id')\n * against the ISchema, returning the PropertyMetadata and the UI5 binding path.\n */\n public static resolveScope(schema: ISchema, scope: string): { meta: IPropertyMetadata | undefined, bindingPath: string, propKey: string } {\n if (!scope || !scope.startsWith(\"#/properties/\")) {\n return { meta: undefined, bindingPath: scope || \"\", propKey: scope || \"\" };\n }\n \n const pathSegments = scope.replace(\"#/properties/\", \"\").split(\"/properties/\");\n let current: Record<string, IPropertyMetadata> | undefined = schema.properties;\n let meta: IPropertyMetadata | undefined;\n \n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Resolving scope '${scope}' with segments: ${JSON.stringify(pathSegments)}`, \"SchemaNormalizer\");\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Root schema keys: ${Object.keys(schema.properties || {})}`, \"SchemaNormalizer\");\n\n for (let i = 0; i < pathSegments.length; i++) {\n const segment = pathSegments[i];\n if (!current) {\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `current is undefined at segment '${segment}'`, \"SchemaNormalizer\");\n meta = undefined;\n break;\n }\n meta = current[segment];\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Segment '${segment}' resolved to meta: ${!!meta}. Available keys in current: ${Object.keys(current)}`, \"SchemaNormalizer\");\n if (i < pathSegments.length - 1) {\n current = meta?.properties;\n }\n }\n \n const bindingPath = pathSegments.join(\"/\");\n const propKey = scope.replace(\"#/properties/\", \"\"); // The original raw string for logging\n \n return {\n meta,\n bindingPath,\n propKey\n };\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAMSA,MAAM,GAAAC,eAAA;EAER,MAAMC,gBAAgB,CAAC;IAE1B;AACJ;AACA;IACI,OAAcC,SAASA,CAACC,SAAmB,EAAEC,IAAc,EAAW;MAClE,IAAIC,SAAS,GAAGF,SAAS;MAEzB,IAAI,OAAOE,SAAS,KAAK,QAAQ,EAAE;QAC/B,IAAI,CAACA,SAAS,CAACC,IAAI,CAAC,CAAC,EAAE;UACnBD,SAAS,GAAG,IAAI;QACpB,CAAC,MAAM;UACH,IAAI;YACAA,SAAS,GAAGE,IAAI,CAACC,KAAK,CAACH,SAAS,CAAC;UACrC,CAAC,CAAC,OAAOI,CAAC,EAAE;YACR,MAAMC,GAAG,GAAG,iCAAiC,GAAID,CAAC,CAAWE,OAAO;YACpEZ,MAAM,CAACa,KAAK,CAAC,2BAA2B,EAAEF,GAAG,CAAC;YAC9C,MAAM,IAAIG,KAAK,CAACH,GAAG,CAAC;UACxB;QACJ;MACJ;MAEA,IAAI,CAACL,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAIS,KAAK,CAACC,OAAO,CAACV,SA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AAAC,UAAA;EAAA;EAAAD,SAAA,CAAArG,gBAAA,GAAAA,gBAAA;EAAA,OAAAqG,SAAA;AAAA","ignoreList":[]}
@@ -19,6 +19,7 @@ declare module "nz/co/siliconst/ui5/metaui/core/SchemaNormalizer" {
19
19
  /**
20
20
  * Normalizes a collection of properties.
21
21
  * @param properties The raw properties map.
22
+ * @param requiredKeys An optional array of keys that are required by the parent object.
22
23
  * @returns A map of strict IPropertyMetadata objects.
23
24
  */
24
25
  private static normalizeProperties;
@@ -26,6 +27,7 @@ declare module "nz/co/siliconst/ui5/metaui/core/SchemaNormalizer" {
26
27
  * Normalizes a single property against the ISchema specification.
27
28
  * @param prop The raw property definition.
28
29
  * @param keyName The string key name for generating default labels.
30
+ * @param isRequired Indicates if the parent object mandated this property as required.
29
31
  * @returns A strict IPropertyMetadata instance.
30
32
  */
31
33
  private static normalizePropertyMetadata;
@@ -36,7 +38,7 @@ declare module "nz/co/siliconst/ui5/metaui/core/SchemaNormalizer" {
36
38
  /**
37
39
  * Infers a v2 ISchema structure dynamically from a plain data payload.
38
40
  */
39
- private static inferSchemaFromData;
41
+ static inferSchemaFromData(data: unknown): ISchema;
40
42
  /**
41
43
  * Infers field metadata recursively from a raw data object.
42
44
  * @param obj The raw JavaScript object.
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaNormalizer.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,kDAAkD,CAAC;IAClE;;;OAGG;IAEH,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAa,MAAM,+CAA+C,CAAC;IAGtG,MAAa,gBAAgB;QAEzB;;WAEG;eACW,SAAS,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO;QAwDrE;;;;;WAKG;QACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;QAgBlC;;;;WAIG;QACH,OAAO,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AE,iBAAiB,GAAG,SAAS,CAAC;YAAC,WAAW,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE;KAmC5I;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["../utils/Logger"],function(e){"use strict";const t=e["Logger"];class r{static normalize(e,r){let i=e;if(typeof i==="string"){try{i=JSON.parse(i)}catch(e){const r=e.message;t.error("[MetaUI SchemaNormalizer] Failed to parse schema string.",r);t.showErrorPopup(`Failed to parse the provided JSON schema.\n\nDetails: ${r}`);i=null}}if(!i||typeof i!=="object"||Array.isArray(i)){return this.inferSchemaFromData(r)}try{const e={title:i.title,type:i.type||(i.items?"array":"object"),layoutStrategy:i.layoutStrategy,uiLayout:i.uiLayout,additionalProperties:i.additionalProperties};let t=i.properties||{};if(i.additionalProperties===true&&r){const e=this.inferSchemaFromData(r);if(e.type==="object"&&e.properties){t=this.deepMergeProperties(e.properties,t)}else if(e.type==="array"&&e.items&&e.items.properties){}}if(e.type==="object"){e.properties=this.normalizeProperties(t)}else if(e.type==="array"){e.items=this.normalizePropertyMetadata(i.items||{type:"object",properties:{}},"items")}return e}catch(e){const r=e.message;t.error("[MetaUI SchemaNormalizer] Critical error normalizing schema object.",r);t.showErrorPopup(`Schema Normalization failed.\n\nDetails: ${r}`);return{type:"object",properties:{}}}}static deepMergeProperties(e,t){const r={...e};for(const e of Object.keys(t)){const i=t[e];const a=r[e];if(a&&typeof a==="object"&&!Array.isArray(a)&&i&&typeof i==="object"&&!Array.isArray(i)){r[e]=this.deepMergeProperties(a,i)}else{r[e]=i}}return r}static normalizeProperties(e){const t={};for(const r of Object.keys(e)){t[r]=this.normalizePropertyMetadata(e[r],r)}return t}static normalizePropertyMetadata(e,t){const r={type:e.type||"string",ui:{label:e.ui?.label||this.generateLabel(t),isKey:!!e.ui?.isKey,readOnly:!!e.ui?.readOnly,widget:e.ui?.widget||(e.valueHelp||e.enum?"select":undefined),visibleOn:e.ui?.visibleOn,enabledOn:e.ui?.enabledOn,format:e.ui?.format,validators:e.ui?.validators,formatter:e.ui?.formatter,args:e.ui?.args,rows:e.ui?.rows,fullWidth:e.ui?.fullWidth},required:!!e.required,maxLength:e.maxLength,minimum:e.minimum,maximum:e.maximum,pattern:e.pattern,precision:e.precision,scale:e.scale,valueHelp:e.valueHelp,enum:e.enum};if(r.type==="object"&&e.properties){r.properties=this.normalizeProperties(e.properties);r.uiLayout=e.uiLayout}else if(r.type==="array"&&e.items){r.items=this.normalizePropertyMetadata(e.items,"items");r.uiLayout=e.uiLayout}return r}static generateLabel(e){if(!e)return"";let t=e.replace(/([A-Z])/g," $1").replace(/_/g," ");return t.split(" ").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()}static inferSchemaFromData(e){const t={type:"object",properties:{},layoutStrategy:"compact",title:""};if(!e||typeof e!=="object"){return t}if(Array.isArray(e)){t.type="array";t.layoutStrategy="table";t.items={type:"object",layoutStrategy:"compact",properties:e.length>0?this.inferPropertiesFromObject(e[0]):{}}}else{t.type="object";t.properties=this.inferPropertiesFromObject(e)}return t}static inferPropertiesFromObject(e){const t={};if(!e||typeof e!=="object")return t;for(const r of Object.keys(e)){const i=e[r];if(i===null||i===undefined)continue;let a="string";let o;let s;if(typeof i==="number")a="number";else if(typeof i==="boolean")a="boolean";else if(Array.isArray(i)){a="array";o={type:"object",properties:i.length>0?this.inferPropertiesFromObject(i[0]):{}}}else if(typeof i==="object"){a="object";s=this.inferPropertiesFromObject(i)}t[r]={type:a,items:o,properties:s,ui:{label:this.generateLabel(r),isKey:false,readOnly:false}}}return t}static resolveScope(e,r){if(!r||!r.startsWith("#/properties/")){return{meta:undefined,bindingPath:r||"",propKey:r||""}}const i=r.replace("#/properties/","").split("/properties/");let a=e.properties;let o;t.debug("[MetaUI SchemaNormalizer]",`Resolving scope '${r}' with segments: ${JSON.stringify(i)}`,"SchemaNormalizer");t.debug("[MetaUI SchemaNormalizer]",`Root schema keys: ${Object.keys(e.properties||{})}`,"SchemaNormalizer");for(let e=0;e<i.length;e++){const r=i[e];if(!a){t.debug("[MetaUI SchemaNormalizer]",`current is undefined at segment '${r}'`,"SchemaNormalizer");o=undefined;break}o=a[r];t.debug("[MetaUI SchemaNormalizer]",`Segment '${r}' resolved to meta: ${!!o}. Available keys in current: ${Object.keys(a)}`,"SchemaNormalizer");if(e<i.length-1){a=o?.properties}}const s=i.join("/");const n=r.replace("#/properties/","");return{meta:o,bindingPath:s,propKey:n}}}var i={__esModule:true};i.SchemaNormalizer=r;return i});
1
+ sap.ui.define(["../utils/Logger"],function(e){"use strict";const t=e["Logger"];class r{static normalize(e,r){let i=e;if(typeof i==="string"){if(!i.trim()){i=null}else{try{i=JSON.parse(i)}catch(e){const r="Failed to parse schema string: "+e.message;t.error("[MetaUI SchemaNormalizer]",r);throw new Error(r)}}}if(!i||typeof i!=="object"||Array.isArray(i)){return this.inferSchemaFromData(r)}try{const e={title:i.title,type:i.type||(i.items?"array":"object"),layoutStrategy:i.layoutStrategy,uiLayout:i.uiLayout,additionalProperties:i.additionalProperties};let t=i.properties||{};if(i.additionalProperties===true&&r){const e=this.inferSchemaFromData(r);if(e.type==="object"&&e.properties){t=this.deepMergeProperties(e.properties,t)}else if(e.type==="array"&&e.items&&e.items.properties){}}if(e.type==="object"){const r=Array.isArray(i.required)?i.required:[];e.properties=this.normalizeProperties(t,r)}else if(e.type==="array"){e.items=this.normalizePropertyMetadata(i.items||{type:"object",properties:{}},"items",false)}return e}catch(e){const r="Critical error normalizing schema object: "+e.message;t.error("[MetaUI SchemaNormalizer]",r);throw new Error(r)}}static deepMergeProperties(e,t){const r={...e};for(const e of Object.keys(t)){const i=t[e];const a=r[e];if(a&&typeof a==="object"&&!Array.isArray(a)&&i&&typeof i==="object"&&!Array.isArray(i)){r[e]=this.deepMergeProperties(a,i)}else{r[e]=i}}return r}static normalizeProperties(e,t=[]){const r={};for(const i of Object.keys(e)){const a=t.includes(i);r[i]=this.normalizePropertyMetadata(e[i],i,a)}return r}static normalizePropertyMetadata(e,t,r=false){const i={type:e.type||"string",ui:{label:e.ui?.label||this.generateLabel(t),isKey:!!e.ui?.isKey,readOnly:!!e.ui?.readOnly,widget:e.ui?.widget||(e.valueHelp||e.enum?"select":undefined),visibleOn:e.ui?.visibleOn,enabledOn:e.ui?.enabledOn,format:e.ui?.format,validators:e.ui?.validators,formatter:e.ui?.formatter,args:e.ui?.args,rows:e.ui?.rows,fullWidth:e.ui?.fullWidth,dialogButtonText:e.ui?.dialogButtonText},required:r||!!e.required,maxLength:e.maxLength,minLength:e.minLength,minimum:e.minimum,maximum:e.maximum,pattern:e.pattern,precision:e.precision,scale:e.scale,multipleOf:e.multipleOf,valueHelp:e.valueHelp,enum:e.enum};if(i.type==="object"&&e.properties){const t=Array.isArray(e.required)?e.required:[];i.properties=this.normalizeProperties(e.properties,t);i.uiLayout=e.uiLayout}else if(i.type==="array"&&e.items){i.items=this.normalizePropertyMetadata(e.items,"items",false);i.uiLayout=e.uiLayout}return i}static generateLabel(e){if(!e)return"";let t=e.replace(/([A-Z])/g," $1").replace(/_/g," ");return t.split(" ").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()}static inferSchemaFromData(e){const t={type:"object",properties:{},layoutStrategy:"compact",title:""};if(!e||typeof e!=="object"){return t}if(Array.isArray(e)){t.type="array";if(e.length>0&&typeof e[0]!=="object"){t.layoutStrategy="compact";t.items={type:typeof e[0]}}else{t.layoutStrategy="table";t.items={type:"object",layoutStrategy:"compact",properties:e.length>0?this.inferPropertiesFromObject(e[0]):{}}}}else{t.type="object";t.properties=this.inferPropertiesFromObject(e)}return t}static inferPropertiesFromObject(e){const t={};if(!e||typeof e!=="object")return t;for(const r of Object.keys(e)){const i=e[r];if(i===null||i===undefined)continue;let a="string";let o;let s;if(typeof i==="number")a="number";else if(typeof i==="boolean")a="boolean";else if(Array.isArray(i)){a="array";if(i.length>0&&typeof i[0]!=="object"){o={type:typeof i[0]}}else{o={type:"object",properties:i.length>0?this.inferPropertiesFromObject(i[0]):{}}}}else if(typeof i==="object"){a="object";s=this.inferPropertiesFromObject(i)}t[r]={type:a,items:o,properties:s,ui:{label:this.generateLabel(r),isKey:false,readOnly:false,widget:a==="array"&&o?.type!=="object"?"multiInput":undefined}}}return t}static resolveScope(e,r){if(!r||!r.startsWith("#/properties/")){return{meta:undefined,bindingPath:r||"",propKey:r||""}}const i=r.replace("#/properties/","").split("/properties/");let a=e.properties;let o;t.debug("[MetaUI SchemaNormalizer]",`Resolving scope '${r}' with segments: ${JSON.stringify(i)}`,"SchemaNormalizer");t.debug("[MetaUI SchemaNormalizer]",`Root schema keys: ${Object.keys(e.properties||{})}`,"SchemaNormalizer");for(let e=0;e<i.length;e++){const r=i[e];if(!a){t.debug("[MetaUI SchemaNormalizer]",`current is undefined at segment '${r}'`,"SchemaNormalizer");o=undefined;break}o=a[r];t.debug("[MetaUI SchemaNormalizer]",`Segment '${r}' resolved to meta: ${!!o}. Available keys in current: ${Object.keys(a)}`,"SchemaNormalizer");if(e<i.length-1){a=o?.properties}}const s=i.join("/");const n=r.replace("#/properties/","");return{meta:o,bindingPath:s,propKey:n}}}var i={__esModule:true};i.SchemaNormalizer=r;return i});
2
2
  //# sourceMappingURL=SchemaNormalizer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaNormalizer.js","names":["Logger","___utils_Logger","SchemaNormalizer","normalize","rawSchema","data","schemaObj","JSON","parse","e","msg","message","error","showErrorPopup","Array","isArray","this","inferSchemaFromData","normalized","title","type","items","layoutStrategy","uiLayout","additionalProperties","targetProperties","properties","inferred","deepMergeProperties","normalizeProperties","normalizePropertyMetadata","base","override","merged","key","Object","keys","overrideVal","baseVal","normalizedProps","prop","keyName","ui","label","generateLabel","isKey","readOnly","widget","valueHelp","enum","undefined","visibleOn","enabledOn","format","validators","formatter","args","rows","fullWidth","required","maxLength","minimum","maximum","pattern","precision","scale","name","spaced","replace","split","filter","w","length","map","word","charAt","toUpperCase","slice","toLowerCase","join","trim","schema","inferPropertiesFromObject","obj","val","nestedProps","resolveScope","scope","startsWith","meta","bindingPath","propKey","pathSegments","current","debug","stringify","i","segment","__exports","__esModule"],"sources":["SchemaNormalizer.ts"],"sourcesContent":["/**\n * @file SchemaNormalizer.ts\n * @description Transforms and validates incoming JSON payloads into the strict v2 ISchema dictionary matrix.\n */\n\nimport { ISchema, IPropertyMetadata, FieldType } from \"../interfaces/ISchema\";\nimport { Logger } from \"../utils/Logger\";\n\nexport class SchemaNormalizer {\n\n /**\n * Validates that the provided raw payload conforms to the required ISchema structures.\n */\n public static normalize(rawSchema?: unknown, data?: unknown): ISchema {\n let schemaObj = rawSchema;\n\n if (typeof schemaObj === \"string\") {\n try {\n schemaObj = JSON.parse(schemaObj);\n } catch (e) {\n const msg = (e as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer] Failed to parse schema string.\", msg);\n Logger.showErrorPopup(`Failed to parse the provided JSON schema.\\n\\nDetails: ${msg}`);\n schemaObj = null;\n }\n }\n\n if (!schemaObj || typeof schemaObj !== 'object' || Array.isArray(schemaObj)) {\n return this.inferSchemaFromData(data);\n }\n\n try {\n // It is an object. Ensure it conforms to v2 structure.\n const normalized: ISchema = {\n title: schemaObj.title,\n type: schemaObj.type || (schemaObj.items ? \"array\" : \"object\"),\n layoutStrategy: schemaObj.layoutStrategy,\n uiLayout: schemaObj.uiLayout,\n additionalProperties: schemaObj.additionalProperties\n };\n\n let targetProperties = schemaObj.properties || {};\n\n if (schemaObj.additionalProperties === true && data) {\n const inferred = this.inferSchemaFromData(data);\n if (inferred.type === \"object\" && inferred.properties) {\n targetProperties = this.deepMergeProperties(inferred.properties, targetProperties);\n } else if (inferred.type === \"array\" && inferred.items && inferred.items.properties) {\n // Array schema merging could be added here if we want full support.\n }\n }\n\n if (normalized.type === \"object\") {\n normalized.properties = this.normalizeProperties(targetProperties);\n } else if (normalized.type === \"array\") {\n // Future expansion: array deep merge\n normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: \"object\", properties: {} }, \"items\");\n }\n\n return normalized;\n } catch (error) {\n const msg = (error as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer] Critical error normalizing schema object.\", msg);\n Logger.showErrorPopup(`Schema Normalization failed.\\n\\nDetails: ${msg}`);\n // Fallback to empty object to prevent hard crash downstream\n return { type: \"object\", properties: {} };\n }\n }\n\n /**\n * Recursively deep merges an inferred schema over a base schema.\n * @param base The base property dictionary.\n * @param override The overriding inferred dictionary.\n * @returns A new deeply merged property dictionary.\n */\n private static deepMergeProperties(base: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown> {\n const merged = { ...base };\n for (const key of Object.keys(override)) {\n const overrideVal = override[key];\n const baseVal = merged[key];\n\n if (baseVal && typeof baseVal === \"object\" && !Array.isArray(baseVal) &&\n overrideVal && typeof overrideVal === \"object\" && !Array.isArray(overrideVal)) {\n merged[key] = this.deepMergeProperties(baseVal, overrideVal);\n } else {\n merged[key] = overrideVal;\n }\n }\n return merged;\n }\n\n /**\n * Normalizes a collection of properties.\n * @param properties The raw properties map.\n * @returns A map of strict IPropertyMetadata objects.\n */\n private static normalizeProperties(properties: Record<string, unknown>): Record<string, IPropertyMetadata> {\n const normalizedProps: Record<string, IPropertyMetadata> = {};\n for (const key of Object.keys(properties)) {\n normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key);\n }\n return normalizedProps;\n }\n\n /**\n * Normalizes a single property against the ISchema specification.\n * @param prop The raw property definition.\n * @param keyName The string key name for generating default labels.\n * @returns A strict IPropertyMetadata instance.\n */\n private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string): IPropertyMetadata {\n const normalized: IPropertyMetadata = {\n type: prop.type || \"string\",\n ui: {\n label: prop.ui?.label || this.generateLabel(keyName),\n isKey: !!prop.ui?.isKey,\n readOnly: !!prop.ui?.readOnly,\n widget: prop.ui?.widget || (prop.valueHelp || prop.enum ? \"select\" : undefined),\n visibleOn: prop.ui?.visibleOn,\n enabledOn: prop.ui?.enabledOn,\n format: prop.ui?.format,\n validators: prop.ui?.validators,\n formatter: prop.ui?.formatter,\n args: prop.ui?.args,\n rows: prop.ui?.rows,\n fullWidth: prop.ui?.fullWidth\n },\n required: !!prop.required,\n maxLength: prop.maxLength,\n minimum: prop.minimum,\n maximum: prop.maximum,\n pattern: prop.pattern,\n precision: prop.precision,\n scale: prop.scale,\n valueHelp: prop.valueHelp,\n enum: prop.enum\n };\n\n if (normalized.type === \"object\" && prop.properties) {\n normalized.properties = this.normalizeProperties(prop.properties);\n normalized.uiLayout = prop.uiLayout;\n } else if (normalized.type === \"array\" && prop.items) {\n normalized.items = this.normalizePropertyMetadata(prop.items, \"items\");\n normalized.uiLayout = prop.uiLayout;\n }\n\n return normalized;\n }\n\n /**\n * Generates a Title Case label from camelCase or snake_case technical names.\n */\n private static generateLabel(name: string): string {\n if (!name) return \"\";\n let spaced = name.replace(/([A-Z])/g, \" $1\").replace(/_/g, \" \");\n return spaced.split(' ')\n .filter(w => w.length > 0)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ')\n .trim();\n }\n\n /**\n * Infers a v2 ISchema structure dynamically from a plain data payload.\n */\n private static inferSchemaFromData(data: unknown): ISchema {\n const schema: ISchema = { type: \"object\", properties: {}, layoutStrategy: \"compact\", title: \"\" };\n\n if (!data || typeof data !== \"object\") {\n return schema;\n }\n\n if (Array.isArray(data)) {\n schema.type = \"array\";\n schema.layoutStrategy = \"table\";\n schema.items = {\n type: \"object\",\n layoutStrategy: \"compact\",\n properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}\n };\n } else {\n schema.type = \"object\";\n schema.properties = this.inferPropertiesFromObject(data);\n }\n\n return schema;\n }\n\n /**\n * Infers field metadata recursively from a raw data object.\n * @param obj The raw JavaScript object.\n * @returns A dictionary of inferred IPropertyMetadata.\n */\n private static inferPropertiesFromObject(obj: Record<string, unknown>): Record<string, IPropertyMetadata> {\n const properties: Record<string, IPropertyMetadata> = {};\n if (!obj || typeof obj !== \"object\") return properties;\n\n for (const key of Object.keys(obj)) {\n const val = obj[key];\n if (val === null || val === undefined) continue;\n\n let type: FieldType = \"string\";\n let items: IPropertyMetadata | undefined;\n let nestedProps: Record<string, IPropertyMetadata> | undefined;\n\n if (typeof val === \"number\") type = \"number\";\n else if (typeof val === \"boolean\") type = \"boolean\";\n else if (Array.isArray(val)) {\n type = \"array\";\n items = {\n type: \"object\",\n properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}\n };\n } else if (typeof val === \"object\") {\n type = \"object\";\n nestedProps = this.inferPropertiesFromObject(val);\n }\n\n properties[key] = {\n type,\n items,\n properties: nestedProps,\n ui: {\n label: this.generateLabel(key),\n isKey: false,\n readOnly: false\n }\n };\n }\n\n return properties;\n }\n\n /**\n * Resolves a JSON Schema scope (e.g. '#/properties/header/properties/id')\n * against the ISchema, returning the PropertyMetadata and the UI5 binding path.\n */\n public static resolveScope(schema: ISchema, scope: string): { meta: IPropertyMetadata | undefined, bindingPath: string, propKey: string } {\n if (!scope || !scope.startsWith(\"#/properties/\")) {\n return { meta: undefined, bindingPath: scope || \"\", propKey: scope || \"\" };\n }\n \n const pathSegments = scope.replace(\"#/properties/\", \"\").split(\"/properties/\");\n let current: Record<string, unknown> = schema.properties;\n let meta: IPropertyMetadata | undefined;\n \n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Resolving scope '${scope}' with segments: ${JSON.stringify(pathSegments)}`, \"SchemaNormalizer\");\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Root schema keys: ${Object.keys(schema.properties || {})}`, \"SchemaNormalizer\");\n\n for (let i = 0; i < pathSegments.length; i++) {\n const segment = pathSegments[i];\n if (!current) {\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `current is undefined at segment '${segment}'`, \"SchemaNormalizer\");\n meta = undefined;\n break;\n }\n meta = current[segment];\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Segment '${segment}' resolved to meta: ${!!meta}. Available keys in current: ${Object.keys(current)}`, \"SchemaNormalizer\");\n if (i < pathSegments.length - 1) {\n current = meta?.properties;\n }\n }\n \n const bindingPath = pathSegments.join(\"/\");\n const propKey = scope.replace(\"#/properties/\", \"\"); // The original raw string for logging\n \n return {\n meta,\n bindingPath,\n propKey\n };\n }\n}\n"],"mappings":"2DAAA,MAMSA,EAAMC,EAAA,UAER,MAAMC,EAKT,gBAAcC,CAAUC,EAAqBC,GACzC,IAAIC,EAAYF,EAEhB,UAAWE,IAAc,SAAU,CAC/B,IACIA,EAAYC,KAAKC,MAAMF,EAC3B,CAAE,MAAOG,GACL,MAAMC,EAAOD,EAAYE,QACzBX,EAAOY,MAAM,2DAA4DF,GACzEV,EAAOa,eAAe,yDAAyDH,KAC/EJ,EAAY,IAChB,CACJ,CAEA,IAAKA,UAAoBA,IAAc,UAAYQ,MAAMC,QAAQT,GAAY,CACzE,OAAOU,KAAKC,oBAAoBZ,EACpC,CAEA,IAEI,MAAMa,EAAsB,CACxBC,MAAOb,EAAUa,MACjBC,KAAMd,EAAUc,OAASd,EAAUe,MAAQ,QAAU,UACrDC,eAAgBhB,EAAUgB,eAC1BC,SAAUjB,EAAUiB,SACpBC,qBAAsBlB,EAAUkB,sBAGpC,IAAIC,EAAmBnB,EAAUoB,YAAc,CAAC,EAEhD,GAAIpB,EAAUkB,uBAAyB,MAAQnB,EAAM,CACjD,MAAMsB,EAAWX,KAAKC,oBAAoBZ,GAC1C,GAAIsB,EAASP,OAAS,UAAYO,EAASD,WAAY,CACnDD,EAAmBT,KAAKY,oBAAoBD,EAASD,WAAYD,EACrE,MAAO,GAAIE,EAASP,OAAS,SAAWO,EAASN,OAASM,EAASN,MAAMK,WAAY,CACjF,CAER,CAEA,GAAIR,EAAWE,OAAS,SAAU,CAC9BF,EAAWQ,WAAaV,KAAKa,oBAAoBJ,EACrD,MAAO,GAAIP,EAAWE,OAAS,QAAS,CAEpCF,EAAWG,MAAQL,KAAKc,0BAA0BxB,EAAUe,OAAS,CAAED,KA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A,EAAIJ,EAAapB,OAAQwB,IAAK,CAC1C,MAAMC,EAAUL,EAAaI,GAC7B,IAAKH,EAAS,CACV7F,EAAO8F,MAAM,4BAA6B,oCAAoCG,KAAY,oBAC1FR,EAAOvC,UACP,KACJ,CACAuC,EAAOI,EAAQI,GACfjG,EAAO8F,MAAM,4BAA6B,YAAYG,0BAAgCR,iCAAoCtD,OAAOC,KAAKyD,KAAY,oBAClJ,GAAIG,EAAIJ,EAAapB,OAAS,EAAG,CAC7BqB,EAAUJ,GAAM/D,UACpB,CACJ,CAEA,MAAMgE,EAAcE,EAAab,KAAK,KACtC,MAAMY,EAAUJ,EAAMnB,QAAQ,gBAAiB,IAE/C,MAAO,CACHqB,OACAC,cACAC,UAER,EACH,IAAAO,EAAA,CAAAC,WAAA,MAAAD,EAAAhG,mBAAA,OAAAgG,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"SchemaNormalizer.js","names":["Logger","___utils_Logger","SchemaNormalizer","normalize","rawSchema","data","schemaObj","trim","JSON","parse","e","msg","message","error","Error","Array","isArray","this","inferSchemaFromData","normalized","title","type","items","layoutStrategy","uiLayout","additionalProperties","targetProperties","properties","inferred","deepMergeProperties","requiredKeys","required","normalizeProperties","normalizePropertyMetadata","base","override","merged","key","Object","keys","overrideVal","baseVal","normalizedProps","isRequired","includes","prop","keyName","ui","label","generateLabel","isKey","readOnly","widget","valueHelp","enum","undefined","visibleOn","enabledOn","format","validators","formatter","args","rows","fullWidth","dialogButtonText","maxLength","minLength","minimum","maximum","pattern","precision","scale","multipleOf","name","spaced","replace","split","filter","w","length","map","word","charAt","toUpperCase","slice","toLowerCase","join","schema","inferPropertiesFromObject","obj","val","nestedProps","resolveScope","scope","startsWith","meta","bindingPath","propKey","pathSegments","current","debug","stringify","i","segment","__exports","__esModule"],"sources":["SchemaNormalizer.ts"],"sourcesContent":["/**\n * @file SchemaNormalizer.ts\n * @description Transforms and validates incoming JSON payloads into the strict v2 ISchema dictionary matrix.\n */\n\nimport { ISchema, IPropertyMetadata, FieldType } from \"../interfaces/ISchema\";\nimport { Logger } from \"../utils/Logger\";\n\nexport class SchemaNormalizer {\n\n /**\n * Validates that the provided raw payload conforms to the required ISchema structures.\n */\n public static normalize(rawSchema?: unknown, data?: unknown): ISchema {\n let schemaObj = rawSchema;\n\n if (typeof schemaObj === \"string\") {\n if (!schemaObj.trim()) {\n schemaObj = null;\n } else {\n try {\n schemaObj = JSON.parse(schemaObj);\n } catch (e) {\n const msg = \"Failed to parse schema string: \" + (e as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer]\", msg);\n throw new Error(msg);\n }\n }\n }\n\n if (!schemaObj || typeof schemaObj !== 'object' || Array.isArray(schemaObj)) {\n return this.inferSchemaFromData(data);\n }\n\n try {\n // It is an object. Ensure it conforms to v2 structure.\n const normalized: ISchema = {\n title: schemaObj.title,\n type: schemaObj.type || (schemaObj.items ? \"array\" : \"object\"),\n layoutStrategy: schemaObj.layoutStrategy,\n uiLayout: schemaObj.uiLayout,\n additionalProperties: schemaObj.additionalProperties\n };\n\n let targetProperties = schemaObj.properties || {};\n\n if (schemaObj.additionalProperties === true && data) {\n const inferred = this.inferSchemaFromData(data);\n if (inferred.type === \"object\" && inferred.properties) {\n targetProperties = this.deepMergeProperties(inferred.properties, targetProperties);\n } else if (inferred.type === \"array\" && inferred.items && inferred.items.properties) {\n // Array schema merging could be added here if we want full support.\n }\n }\n\n if (normalized.type === \"object\") {\n const requiredKeys = Array.isArray(schemaObj.required) ? schemaObj.required : [];\n normalized.properties = this.normalizeProperties(targetProperties, requiredKeys);\n } else if (normalized.type === \"array\") {\n // Future expansion: array deep merge\n normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: \"object\", properties: {} }, \"items\", false);\n }\n\n return normalized;\n } catch (error) {\n const msg = \"Critical error normalizing schema object: \" + (error as Error).message;\n Logger.error(\"[MetaUI SchemaNormalizer]\", msg);\n throw new Error(msg);\n }\n }\n\n /**\n * Recursively deep merges an inferred schema over a base schema.\n * @param base The base property dictionary.\n * @param override The overriding inferred dictionary.\n * @returns A new deeply merged property dictionary.\n */\n private static deepMergeProperties(base: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown> {\n const merged = { ...base };\n for (const key of Object.keys(override)) {\n const overrideVal = override[key];\n const baseVal = merged[key];\n\n if (baseVal && typeof baseVal === \"object\" && !Array.isArray(baseVal) &&\n overrideVal && typeof overrideVal === \"object\" && !Array.isArray(overrideVal)) {\n merged[key] = this.deepMergeProperties(baseVal, overrideVal);\n } else {\n merged[key] = overrideVal;\n }\n }\n return merged;\n }\n\n /**\n * Normalizes a collection of properties.\n * @param properties The raw properties map.\n * @param requiredKeys An optional array of keys that are required by the parent object.\n * @returns A map of strict IPropertyMetadata objects.\n */\n private static normalizeProperties(properties: Record<string, unknown>, requiredKeys: string[] = []): Record<string, IPropertyMetadata> {\n const normalizedProps: Record<string, IPropertyMetadata> = {};\n for (const key of Object.keys(properties)) {\n const isRequired = requiredKeys.includes(key);\n normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key, isRequired);\n }\n return normalizedProps;\n }\n\n /**\n * Normalizes a single property against the ISchema specification.\n * @param prop The raw property definition.\n * @param keyName The string key name for generating default labels.\n * @param isRequired Indicates if the parent object mandated this property as required.\n * @returns A strict IPropertyMetadata instance.\n */\n private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string, isRequired: boolean = false): IPropertyMetadata {\n const normalized: IPropertyMetadata = {\n type: prop.type || \"string\",\n ui: {\n label: prop.ui?.label || this.generateLabel(keyName),\n isKey: !!prop.ui?.isKey,\n readOnly: !!prop.ui?.readOnly,\n widget: prop.ui?.widget || (prop.valueHelp || prop.enum ? \"select\" : undefined),\n visibleOn: prop.ui?.visibleOn,\n enabledOn: prop.ui?.enabledOn,\n format: prop.ui?.format,\n validators: prop.ui?.validators,\n formatter: prop.ui?.formatter,\n args: prop.ui?.args,\n rows: prop.ui?.rows,\n fullWidth: prop.ui?.fullWidth,\n dialogButtonText: prop.ui?.dialogButtonText\n },\n required: isRequired || !!prop.required,\n maxLength: prop.maxLength as number,\n minLength: prop.minLength as number,\n minimum: prop.minimum,\n maximum: prop.maximum,\n pattern: prop.pattern,\n precision: prop.precision,\n scale: prop.scale,\n multipleOf: prop.multipleOf as number,\n valueHelp: prop.valueHelp,\n enum: prop.enum\n };\n\n if (normalized.type === \"object\" && prop.properties) {\n const requiredKeys = Array.isArray(prop.required) ? prop.required : [];\n normalized.properties = this.normalizeProperties(prop.properties as Record<string, unknown>, requiredKeys);\n normalized.uiLayout = prop.uiLayout;\n } else if (normalized.type === \"array\" && prop.items) {\n normalized.items = this.normalizePropertyMetadata(prop.items as Record<string, unknown>, \"items\", false);\n normalized.uiLayout = prop.uiLayout;\n }\n\n return normalized;\n }\n\n /**\n * Generates a Title Case label from camelCase or snake_case technical names.\n */\n private static generateLabel(name: string): string {\n if (!name) return \"\";\n let spaced = name.replace(/([A-Z])/g, \" $1\").replace(/_/g, \" \");\n return spaced.split(' ')\n .filter(w => w.length > 0)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ')\n .trim();\n }\n\n /**\n * Infers a v2 ISchema structure dynamically from a plain data payload.\n */\n public static inferSchemaFromData(data: unknown): ISchema {\n const schema: ISchema = { type: \"object\", properties: {}, layoutStrategy: \"compact\", title: \"\" };\n\n if (!data || typeof data !== \"object\") {\n return schema;\n }\n\n if (Array.isArray(data)) {\n schema.type = \"array\";\n if (data.length > 0 && typeof data[0] !== \"object\") {\n schema.layoutStrategy = \"compact\";\n schema.items = { type: typeof data[0] as FieldType };\n } else {\n schema.layoutStrategy = \"table\";\n schema.items = {\n type: \"object\",\n layoutStrategy: \"compact\",\n properties: data.length > 0 ? this.inferPropertiesFromObject(data[0] as Record<string, unknown>) : {}\n };\n }\n } else {\n schema.type = \"object\";\n schema.properties = this.inferPropertiesFromObject(data);\n }\n\n return schema;\n }\n\n /**\n * Infers field metadata recursively from a raw data object.\n * @param obj The raw JavaScript object.\n * @returns A dictionary of inferred IPropertyMetadata.\n */\n private static inferPropertiesFromObject(obj: Record<string, unknown>): Record<string, IPropertyMetadata> {\n const properties: Record<string, IPropertyMetadata> = {};\n if (!obj || typeof obj !== \"object\") return properties;\n\n for (const key of Object.keys(obj)) {\n const val = obj[key];\n if (val === null || val === undefined) continue;\n\n let type: FieldType = \"string\";\n let items: IPropertyMetadata | undefined;\n let nestedProps: Record<string, IPropertyMetadata> | undefined;\n\n if (typeof val === \"number\") type = \"number\";\n else if (typeof val === \"boolean\") type = \"boolean\";\n else if (Array.isArray(val)) {\n type = \"array\";\n if (val.length > 0 && typeof val[0] !== \"object\") {\n items = {\n type: typeof val[0] as FieldType\n };\n } else {\n items = {\n type: \"object\",\n properties: val.length > 0 ? this.inferPropertiesFromObject(val[0] as Record<string, unknown>) : {}\n };\n }\n } else if (typeof val === \"object\") {\n type = \"object\";\n nestedProps = this.inferPropertiesFromObject(val);\n }\n\n properties[key] = {\n type,\n items,\n properties: nestedProps,\n ui: {\n label: this.generateLabel(key),\n isKey: false,\n readOnly: false,\n widget: type === \"array\" && items?.type !== \"object\" ? \"multiInput\" : undefined\n }\n };\n }\n\n return properties;\n }\n\n /**\n * Resolves a JSON Schema scope (e.g. '#/properties/header/properties/id')\n * against the ISchema, returning the PropertyMetadata and the UI5 binding path.\n */\n public static resolveScope(schema: ISchema, scope: string): { meta: IPropertyMetadata | undefined, bindingPath: string, propKey: string } {\n if (!scope || !scope.startsWith(\"#/properties/\")) {\n return { meta: undefined, bindingPath: scope || \"\", propKey: scope || \"\" };\n }\n \n const pathSegments = scope.replace(\"#/properties/\", \"\").split(\"/properties/\");\n let current: Record<string, IPropertyMetadata> | undefined = schema.properties;\n let meta: IPropertyMetadata | undefined;\n \n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Resolving scope '${scope}' with segments: ${JSON.stringify(pathSegments)}`, \"SchemaNormalizer\");\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Root schema keys: ${Object.keys(schema.properties || {})}`, \"SchemaNormalizer\");\n\n for (let i = 0; i < pathSegments.length; i++) {\n const segment = pathSegments[i];\n if (!current) {\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `current is undefined at segment '${segment}'`, \"SchemaNormalizer\");\n meta = undefined;\n break;\n }\n meta = current[segment];\n Logger.debug(\"[MetaUI SchemaNormalizer]\", `Segment '${segment}' resolved to meta: ${!!meta}. Available keys in current: ${Object.keys(current)}`, \"SchemaNormalizer\");\n if (i < pathSegments.length - 1) {\n current = meta?.properties;\n }\n }\n \n const bindingPath = pathSegments.join(\"/\");\n const propKey = scope.replace(\"#/properties/\", \"\"); // The original raw string for logging\n \n return {\n meta,\n bindingPath,\n propKey\n };\n }\n}\n"],"mappings":"2DAAA,MAMSA,EAAMC,EAAA,UAER,MAAMC,EAKT,gBAAcC,CAAUC,EAAqBC,GACzC,IAAIC,EAAYF,EAEhB,UAAWE,IAAc,SAAU,CAC/B,IAAKA,EAAUC,OAAQ,CACnBD,EAAY,IAChB,KAAO,CACH,IACIA,EAAYE,KAAKC,MAAMH,EAC3B,CAAE,MAAOI,GACL,MAAMC,EAAM,kCAAqCD,EAAYE,QAC7DZ,EAAOa,MAAM,4BAA6BF,GAC1C,MAAM,IAAIG,MAAMH,EACpB,CACJ,CACJ,CAEA,IAAKL,UAAoBA,IAAc,UAAYS,MAAMC,QAAQV,GAAY,CACzE,OAAOW,KAAKC,oBAAoBb,EACpC,CAEA,IAEI,MAAMc,EAAsB,CACxBC,MAAOd,EAAUc,MACjBC,KAAMf,EAAUe,OAASf,EAAUgB,MAAQ,QAAU,UACrDC,eAAgBjB,EAAUiB,eAC1BC,SAAUlB,EAAUkB,SACpBC,qBAAsBnB,EAAUmB,sBAGpC,IAAIC,EAAmBpB,EAAUqB,YAAc,CAAC,EAEhD,GAAIrB,EAAUmB,uBAAyB,MAAQpB,EAAM,CACjD,MAAMuB,EAAWX,KAAKC,oBAAoBb,GAC1C,GAAIuB,EAASP,OAAS,UAAYO,EAASD,WAAY,CACnDD,EAAmB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AAMqE,EAAcE,EAAaZ,KAAK,KACtC,MAAMW,EAAUJ,EAAMlB,QAAQ,gBAAiB,IAE/C,MAAO,CACHoB,OACAC,cACAC,UAER,EACH,IAAAO,EAAA,CAAAC,WAAA,MAAAD,EAAAtG,mBAAA,OAAAsG,CAAA","ignoreList":[]}
@@ -15,13 +15,16 @@ export class SchemaNormalizer {
15
15
  let schemaObj = rawSchema;
16
16
 
17
17
  if (typeof schemaObj === "string") {
18
- try {
19
- schemaObj = JSON.parse(schemaObj);
20
- } catch (e) {
21
- const msg = (e as Error).message;
22
- Logger.error("[MetaUI SchemaNormalizer] Failed to parse schema string.", msg);
23
- Logger.showErrorPopup(`Failed to parse the provided JSON schema.\n\nDetails: ${msg}`);
18
+ if (!schemaObj.trim()) {
24
19
  schemaObj = null;
20
+ } else {
21
+ try {
22
+ schemaObj = JSON.parse(schemaObj);
23
+ } catch (e) {
24
+ const msg = "Failed to parse schema string: " + (e as Error).message;
25
+ Logger.error("[MetaUI SchemaNormalizer]", msg);
26
+ throw new Error(msg);
27
+ }
25
28
  }
26
29
  }
27
30
 
@@ -51,19 +54,18 @@ export class SchemaNormalizer {
51
54
  }
52
55
 
53
56
  if (normalized.type === "object") {
54
- normalized.properties = this.normalizeProperties(targetProperties);
57
+ const requiredKeys = Array.isArray(schemaObj.required) ? schemaObj.required : [];
58
+ normalized.properties = this.normalizeProperties(targetProperties, requiredKeys);
55
59
  } else if (normalized.type === "array") {
56
60
  // Future expansion: array deep merge
57
- normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: "object", properties: {} }, "items");
61
+ normalized.items = this.normalizePropertyMetadata(schemaObj.items || { type: "object", properties: {} }, "items", false);
58
62
  }
59
63
 
60
64
  return normalized;
61
65
  } catch (error) {
62
- const msg = (error as Error).message;
63
- Logger.error("[MetaUI SchemaNormalizer] Critical error normalizing schema object.", msg);
64
- Logger.showErrorPopup(`Schema Normalization failed.\n\nDetails: ${msg}`);
65
- // Fallback to empty object to prevent hard crash downstream
66
- return { type: "object", properties: {} };
66
+ const msg = "Critical error normalizing schema object: " + (error as Error).message;
67
+ Logger.error("[MetaUI SchemaNormalizer]", msg);
68
+ throw new Error(msg);
67
69
  }
68
70
  }
69
71
 
@@ -92,12 +94,14 @@ export class SchemaNormalizer {
92
94
  /**
93
95
  * Normalizes a collection of properties.
94
96
  * @param properties The raw properties map.
97
+ * @param requiredKeys An optional array of keys that are required by the parent object.
95
98
  * @returns A map of strict IPropertyMetadata objects.
96
99
  */
97
- private static normalizeProperties(properties: Record<string, unknown>): Record<string, IPropertyMetadata> {
100
+ private static normalizeProperties(properties: Record<string, unknown>, requiredKeys: string[] = []): Record<string, IPropertyMetadata> {
98
101
  const normalizedProps: Record<string, IPropertyMetadata> = {};
99
102
  for (const key of Object.keys(properties)) {
100
- normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key);
103
+ const isRequired = requiredKeys.includes(key);
104
+ normalizedProps[key] = this.normalizePropertyMetadata(properties[key], key, isRequired);
101
105
  }
102
106
  return normalizedProps;
103
107
  }
@@ -106,9 +110,10 @@ export class SchemaNormalizer {
106
110
  * Normalizes a single property against the ISchema specification.
107
111
  * @param prop The raw property definition.
108
112
  * @param keyName The string key name for generating default labels.
113
+ * @param isRequired Indicates if the parent object mandated this property as required.
109
114
  * @returns A strict IPropertyMetadata instance.
110
115
  */
111
- private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string): IPropertyMetadata {
116
+ private static normalizePropertyMetadata(prop: Record<string, unknown>, keyName: string, isRequired: boolean = false): IPropertyMetadata {
112
117
  const normalized: IPropertyMetadata = {
113
118
  type: prop.type || "string",
114
119
  ui: {
@@ -123,24 +128,28 @@ export class SchemaNormalizer {
123
128
  formatter: prop.ui?.formatter,
124
129
  args: prop.ui?.args,
125
130
  rows: prop.ui?.rows,
126
- fullWidth: prop.ui?.fullWidth
131
+ fullWidth: prop.ui?.fullWidth,
132
+ dialogButtonText: prop.ui?.dialogButtonText
127
133
  },
128
- required: !!prop.required,
129
- maxLength: prop.maxLength,
134
+ required: isRequired || !!prop.required,
135
+ maxLength: prop.maxLength as number,
136
+ minLength: prop.minLength as number,
130
137
  minimum: prop.minimum,
131
138
  maximum: prop.maximum,
132
139
  pattern: prop.pattern,
133
140
  precision: prop.precision,
134
141
  scale: prop.scale,
142
+ multipleOf: prop.multipleOf as number,
135
143
  valueHelp: prop.valueHelp,
136
144
  enum: prop.enum
137
145
  };
138
146
 
139
147
  if (normalized.type === "object" && prop.properties) {
140
- normalized.properties = this.normalizeProperties(prop.properties);
148
+ const requiredKeys = Array.isArray(prop.required) ? prop.required : [];
149
+ normalized.properties = this.normalizeProperties(prop.properties as Record<string, unknown>, requiredKeys);
141
150
  normalized.uiLayout = prop.uiLayout;
142
151
  } else if (normalized.type === "array" && prop.items) {
143
- normalized.items = this.normalizePropertyMetadata(prop.items, "items");
152
+ normalized.items = this.normalizePropertyMetadata(prop.items as Record<string, unknown>, "items", false);
144
153
  normalized.uiLayout = prop.uiLayout;
145
154
  }
146
155
 
@@ -163,7 +172,7 @@ export class SchemaNormalizer {
163
172
  /**
164
173
  * Infers a v2 ISchema structure dynamically from a plain data payload.
165
174
  */
166
- private static inferSchemaFromData(data: unknown): ISchema {
175
+ public static inferSchemaFromData(data: unknown): ISchema {
167
176
  const schema: ISchema = { type: "object", properties: {}, layoutStrategy: "compact", title: "" };
168
177
 
169
178
  if (!data || typeof data !== "object") {
@@ -172,12 +181,17 @@ export class SchemaNormalizer {
172
181
 
173
182
  if (Array.isArray(data)) {
174
183
  schema.type = "array";
175
- schema.layoutStrategy = "table";
176
- schema.items = {
177
- type: "object",
178
- layoutStrategy: "compact",
179
- properties: data.length > 0 ? this.inferPropertiesFromObject(data[0]) : {}
180
- };
184
+ if (data.length > 0 && typeof data[0] !== "object") {
185
+ schema.layoutStrategy = "compact";
186
+ schema.items = { type: typeof data[0] as FieldType };
187
+ } else {
188
+ schema.layoutStrategy = "table";
189
+ schema.items = {
190
+ type: "object",
191
+ layoutStrategy: "compact",
192
+ properties: data.length > 0 ? this.inferPropertiesFromObject(data[0] as Record<string, unknown>) : {}
193
+ };
194
+ }
181
195
  } else {
182
196
  schema.type = "object";
183
197
  schema.properties = this.inferPropertiesFromObject(data);
@@ -207,10 +221,16 @@ export class SchemaNormalizer {
207
221
  else if (typeof val === "boolean") type = "boolean";
208
222
  else if (Array.isArray(val)) {
209
223
  type = "array";
210
- items = {
211
- type: "object",
212
- properties: val.length > 0 ? this.inferPropertiesFromObject(val[0]) : {}
213
- };
224
+ if (val.length > 0 && typeof val[0] !== "object") {
225
+ items = {
226
+ type: typeof val[0] as FieldType
227
+ };
228
+ } else {
229
+ items = {
230
+ type: "object",
231
+ properties: val.length > 0 ? this.inferPropertiesFromObject(val[0] as Record<string, unknown>) : {}
232
+ };
233
+ }
214
234
  } else if (typeof val === "object") {
215
235
  type = "object";
216
236
  nestedProps = this.inferPropertiesFromObject(val);
@@ -223,7 +243,8 @@ export class SchemaNormalizer {
223
243
  ui: {
224
244
  label: this.generateLabel(key),
225
245
  isKey: false,
226
- readOnly: false
246
+ readOnly: false,
247
+ widget: type === "array" && items?.type !== "object" ? "multiInput" : undefined
227
248
  }
228
249
  };
229
250
  }
@@ -241,7 +262,7 @@ export class SchemaNormalizer {
241
262
  }
242
263
 
243
264
  const pathSegments = scope.replace("#/properties/", "").split("/properties/");
244
- let current: Record<string, unknown> = schema.properties;
265
+ let current: Record<string, IPropertyMetadata> | undefined = schema.properties;
245
266
  let meta: IPropertyMetadata | undefined;
246
267
 
247
268
  Logger.debug("[MetaUI SchemaNormalizer]", `Resolving scope '${scope}' with segments: ${JSON.stringify(pathSegments)}`, "SchemaNormalizer");