@metaobjectsdev/metadata 0.5.0-rc.1

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 (405) hide show
  1. package/LICENSE +189 -0
  2. package/README.md +29 -0
  3. package/dist/attr-class-map.d.ts +26 -0
  4. package/dist/attr-class-map.d.ts.map +1 -0
  5. package/dist/attr-class-map.js +44 -0
  6. package/dist/attr-class-map.js.map +1 -0
  7. package/dist/attr-schema-validate.d.ts +9 -0
  8. package/dist/attr-schema-validate.d.ts.map +1 -0
  9. package/dist/attr-schema-validate.js +100 -0
  10. package/dist/attr-schema-validate.js.map +1 -0
  11. package/dist/constants.d.ts +208 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/constants.js +419 -0
  14. package/dist/constants.js.map +1 -0
  15. package/dist/core/attr/attr-constants.d.ts +12 -0
  16. package/dist/core/attr/attr-constants.d.ts.map +1 -0
  17. package/dist/core/attr/attr-constants.js +27 -0
  18. package/dist/core/attr/attr-constants.js.map +1 -0
  19. package/dist/core/attr/meta-attr-filter.d.ts +10 -0
  20. package/dist/core/attr/meta-attr-filter.d.ts.map +1 -0
  21. package/dist/core/attr/meta-attr-filter.js +56 -0
  22. package/dist/core/attr/meta-attr-filter.js.map +1 -0
  23. package/dist/core/attr/meta-attr-properties.d.ts +9 -0
  24. package/dist/core/attr/meta-attr-properties.d.ts.map +1 -0
  25. package/dist/core/attr/meta-attr-properties.js +22 -0
  26. package/dist/core/attr/meta-attr-properties.js.map +1 -0
  27. package/dist/core/attr/meta-attr-stringarray.d.ts +9 -0
  28. package/dist/core/attr/meta-attr-stringarray.d.ts.map +1 -0
  29. package/dist/core/attr/meta-attr-stringarray.js +29 -0
  30. package/dist/core/attr/meta-attr-stringarray.js.map +1 -0
  31. package/dist/core/attr/meta-attr.d.ts +37 -0
  32. package/dist/core/attr/meta-attr.d.ts.map +1 -0
  33. package/dist/core/attr/meta-attr.js +97 -0
  34. package/dist/core/attr/meta-attr.js.map +1 -0
  35. package/dist/core/export-json.d.ts +29 -0
  36. package/dist/core/export-json.d.ts.map +1 -0
  37. package/dist/core/export-json.js +45 -0
  38. package/dist/core/export-json.js.map +1 -0
  39. package/dist/core/field/field-constants.d.ts +40 -0
  40. package/dist/core/field/field-constants.d.ts.map +1 -0
  41. package/dist/core/field/field-constants.js +66 -0
  42. package/dist/core/field/field-constants.js.map +1 -0
  43. package/dist/core/field/field-schema.d.ts +6 -0
  44. package/dist/core/field/field-schema.d.ts.map +1 -0
  45. package/dist/core/field/field-schema.js +92 -0
  46. package/dist/core/field/field-schema.js.map +1 -0
  47. package/dist/core/field/meta-field.d.ts +50 -0
  48. package/dist/core/field/meta-field.d.ts.map +1 -0
  49. package/dist/core/field/meta-field.js +121 -0
  50. package/dist/core/field/meta-field.js.map +1 -0
  51. package/dist/core/file-meta-data-loader.d.ts +18 -0
  52. package/dist/core/file-meta-data-loader.d.ts.map +1 -0
  53. package/dist/core/file-meta-data-loader.js +81 -0
  54. package/dist/core/file-meta-data-loader.js.map +1 -0
  55. package/dist/core/file-source.d.ts +12 -0
  56. package/dist/core/file-source.d.ts.map +1 -0
  57. package/dist/core/file-source.js +46 -0
  58. package/dist/core/file-source.js.map +1 -0
  59. package/dist/core/identity/identity-constants.d.ts +19 -0
  60. package/dist/core/identity/identity-constants.d.ts.map +1 -0
  61. package/dist/core/identity/identity-constants.js +35 -0
  62. package/dist/core/identity/identity-constants.js.map +1 -0
  63. package/dist/core/identity/identity-schema.d.ts +6 -0
  64. package/dist/core/identity/identity-schema.d.ts.map +1 -0
  65. package/dist/core/identity/identity-schema.js +55 -0
  66. package/dist/core/identity/identity-schema.js.map +1 -0
  67. package/dist/core/identity/meta-identity.d.ts +71 -0
  68. package/dist/core/identity/meta-identity.d.ts.map +1 -0
  69. package/dist/core/identity/meta-identity.js +129 -0
  70. package/dist/core/identity/meta-identity.js.map +1 -0
  71. package/dist/core/index.d.ts +6 -0
  72. package/dist/core/index.d.ts.map +1 -0
  73. package/dist/core/index.js +11 -0
  74. package/dist/core/index.js.map +1 -0
  75. package/dist/core/object/meta-object.d.ts +39 -0
  76. package/dist/core/object/meta-object.d.ts.map +1 -0
  77. package/dist/core/object/meta-object.js +80 -0
  78. package/dist/core/object/meta-object.js.map +1 -0
  79. package/dist/core/object/object-constants.d.ts +5 -0
  80. package/dist/core/object/object-constants.d.ts.map +1 -0
  81. package/dist/core/object/object-constants.js +18 -0
  82. package/dist/core/object/object-constants.js.map +1 -0
  83. package/dist/core/object/object-schema.d.ts +4 -0
  84. package/dist/core/object/object-schema.d.ts.map +1 -0
  85. package/dist/core/object/object-schema.js +5 -0
  86. package/dist/core/object/object-schema.js.map +1 -0
  87. package/dist/core/parser-yaml.d.ts +3 -0
  88. package/dist/core/parser-yaml.d.ts.map +1 -0
  89. package/dist/core/parser-yaml.js +39 -0
  90. package/dist/core/parser-yaml.js.map +1 -0
  91. package/dist/core/query/query-constants.d.ts +20 -0
  92. package/dist/core/query/query-constants.d.ts.map +1 -0
  93. package/dist/core/query/query-constants.js +56 -0
  94. package/dist/core/query/query-constants.js.map +1 -0
  95. package/dist/core/relationship/find-reference.d.ts +22 -0
  96. package/dist/core/relationship/find-reference.d.ts.map +1 -0
  97. package/dist/core/relationship/find-reference.js +29 -0
  98. package/dist/core/relationship/find-reference.js.map +1 -0
  99. package/dist/core/relationship/meta-relationship.d.ts +11 -0
  100. package/dist/core/relationship/meta-relationship.d.ts.map +1 -0
  101. package/dist/core/relationship/meta-relationship.js +27 -0
  102. package/dist/core/relationship/meta-relationship.js.map +1 -0
  103. package/dist/core/relationship/relationship-constants.d.ts +14 -0
  104. package/dist/core/relationship/relationship-constants.d.ts.map +1 -0
  105. package/dist/core/relationship/relationship-constants.js +28 -0
  106. package/dist/core/relationship/relationship-constants.js.map +1 -0
  107. package/dist/core/relationship/relationship-schema.d.ts +4 -0
  108. package/dist/core/relationship/relationship-schema.d.ts.map +1 -0
  109. package/dist/core/relationship/relationship-schema.js +37 -0
  110. package/dist/core/relationship/relationship-schema.js.map +1 -0
  111. package/dist/core/validator/meta-validator.d.ts +29 -0
  112. package/dist/core/validator/meta-validator.d.ts.map +1 -0
  113. package/dist/core/validator/meta-validator.js +49 -0
  114. package/dist/core/validator/meta-validator.js.map +1 -0
  115. package/dist/core/validator/validator-constants.d.ts +11 -0
  116. package/dist/core/validator/validator-constants.d.ts.map +1 -0
  117. package/dist/core/validator/validator-constants.js +25 -0
  118. package/dist/core/validator/validator-constants.js.map +1 -0
  119. package/dist/core/validator/validator-schema.d.ts +4 -0
  120. package/dist/core/validator/validator-schema.d.ts.map +1 -0
  121. package/dist/core/validator/validator-schema.js +38 -0
  122. package/dist/core/validator/validator-schema.js.map +1 -0
  123. package/dist/core/yaml-desugar.d.ts +10 -0
  124. package/dist/core/yaml-desugar.d.ts.map +1 -0
  125. package/dist/core/yaml-desugar.js +99 -0
  126. package/dist/core/yaml-desugar.js.map +1 -0
  127. package/dist/core-attr-schemas.d.ts +22 -0
  128. package/dist/core-attr-schemas.d.ts.map +1 -0
  129. package/dist/core-attr-schemas.js +324 -0
  130. package/dist/core-attr-schemas.js.map +1 -0
  131. package/dist/core-types.d.ts +20 -0
  132. package/dist/core-types.d.ts.map +1 -0
  133. package/dist/core-types.js +225 -0
  134. package/dist/core-types.js.map +1 -0
  135. package/dist/data-converter.d.ts +17 -0
  136. package/dist/data-converter.d.ts.map +1 -0
  137. package/dist/data-converter.js +117 -0
  138. package/dist/data-converter.js.map +1 -0
  139. package/dist/data-type.d.ts +15 -0
  140. package/dist/data-type.d.ts.map +1 -0
  141. package/dist/data-type.js +25 -0
  142. package/dist/data-type.js.map +1 -0
  143. package/dist/db/db-attr-schemas.d.ts +8 -0
  144. package/dist/db/db-attr-schemas.d.ts.map +1 -0
  145. package/dist/db/db-attr-schemas.js +26 -0
  146. package/dist/db/db-attr-schemas.js.map +1 -0
  147. package/dist/db/db-provider.d.ts +3 -0
  148. package/dist/db/db-provider.d.ts.map +1 -0
  149. package/dist/db/db-provider.js +28 -0
  150. package/dist/db/db-provider.js.map +1 -0
  151. package/dist/errors.d.ts +26 -0
  152. package/dist/errors.d.ts.map +1 -0
  153. package/dist/errors.js +59 -0
  154. package/dist/errors.js.map +1 -0
  155. package/dist/index.d.ts +70 -0
  156. package/dist/index.d.ts.map +1 -0
  157. package/dist/index.js +76 -0
  158. package/dist/index.js.map +1 -0
  159. package/dist/loader/meta-data-loader.d.ts +87 -0
  160. package/dist/loader/meta-data-loader.d.ts.map +1 -0
  161. package/dist/loader/meta-data-loader.js +232 -0
  162. package/dist/loader/meta-data-loader.js.map +1 -0
  163. package/dist/loader/meta-data-source.d.ts +23 -0
  164. package/dist/loader/meta-data-source.d.ts.map +1 -0
  165. package/dist/loader/meta-data-source.js +20 -0
  166. package/dist/loader/meta-data-source.js.map +1 -0
  167. package/dist/loader/validation-passes.d.ts +7 -0
  168. package/dist/loader/validation-passes.d.ts.map +1 -0
  169. package/dist/loader/validation-passes.js +244 -0
  170. package/dist/loader/validation-passes.js.map +1 -0
  171. package/dist/meta/find-reference.d.ts +22 -0
  172. package/dist/meta/find-reference.d.ts.map +1 -0
  173. package/dist/meta/find-reference.js +29 -0
  174. package/dist/meta/find-reference.js.map +1 -0
  175. package/dist/meta/meta-attr.d.ts +8 -0
  176. package/dist/meta/meta-attr.d.ts.map +1 -0
  177. package/dist/meta/meta-attr.js +17 -0
  178. package/dist/meta/meta-attr.js.map +1 -0
  179. package/dist/meta/meta-data.d.ts +107 -0
  180. package/dist/meta/meta-data.d.ts.map +1 -0
  181. package/dist/meta/meta-data.js +302 -0
  182. package/dist/meta/meta-data.js.map +1 -0
  183. package/dist/meta/meta-field.d.ts +48 -0
  184. package/dist/meta/meta-field.d.ts.map +1 -0
  185. package/dist/meta/meta-field.js +94 -0
  186. package/dist/meta/meta-field.js.map +1 -0
  187. package/dist/meta/meta-identity.d.ts +71 -0
  188. package/dist/meta/meta-identity.d.ts.map +1 -0
  189. package/dist/meta/meta-identity.js +129 -0
  190. package/dist/meta/meta-identity.js.map +1 -0
  191. package/dist/meta/meta-layout.d.ts +23 -0
  192. package/dist/meta/meta-layout.d.ts.map +1 -0
  193. package/dist/meta/meta-layout.js +45 -0
  194. package/dist/meta/meta-layout.js.map +1 -0
  195. package/dist/meta/meta-object.d.ts +40 -0
  196. package/dist/meta/meta-object.d.ts.map +1 -0
  197. package/dist/meta/meta-object.js +81 -0
  198. package/dist/meta/meta-object.js.map +1 -0
  199. package/dist/meta/meta-origin.d.ts +32 -0
  200. package/dist/meta/meta-origin.d.ts.map +1 -0
  201. package/dist/meta/meta-origin.js +55 -0
  202. package/dist/meta/meta-origin.js.map +1 -0
  203. package/dist/meta/meta-relationship.d.ts +11 -0
  204. package/dist/meta/meta-relationship.d.ts.map +1 -0
  205. package/dist/meta/meta-relationship.js +27 -0
  206. package/dist/meta/meta-relationship.js.map +1 -0
  207. package/dist/meta/meta-root.d.ts +12 -0
  208. package/dist/meta/meta-root.d.ts.map +1 -0
  209. package/dist/meta/meta-root.js +24 -0
  210. package/dist/meta/meta-root.js.map +1 -0
  211. package/dist/meta/meta-source.d.ts +18 -0
  212. package/dist/meta/meta-source.d.ts.map +1 -0
  213. package/dist/meta/meta-source.js +31 -0
  214. package/dist/meta/meta-source.js.map +1 -0
  215. package/dist/meta/meta-validator.d.ts +29 -0
  216. package/dist/meta/meta-validator.d.ts.map +1 -0
  217. package/dist/meta/meta-validator.js +49 -0
  218. package/dist/meta/meta-validator.js.map +1 -0
  219. package/dist/meta/meta-view.d.ts +4 -0
  220. package/dist/meta/meta-view.d.ts.map +1 -0
  221. package/dist/meta/meta-view.js +8 -0
  222. package/dist/meta/meta-view.js.map +1 -0
  223. package/dist/naming.d.ts +27 -0
  224. package/dist/naming.d.ts.map +1 -0
  225. package/dist/naming.js +72 -0
  226. package/dist/naming.js.map +1 -0
  227. package/dist/object-serializer.d.ts +10 -0
  228. package/dist/object-serializer.d.ts.map +1 -0
  229. package/dist/object-serializer.js +128 -0
  230. package/dist/object-serializer.js.map +1 -0
  231. package/dist/overlay.d.ts +2 -0
  232. package/dist/overlay.d.ts.map +1 -0
  233. package/dist/overlay.js +6 -0
  234. package/dist/overlay.js.map +1 -0
  235. package/dist/parser-core.d.ts +47 -0
  236. package/dist/parser-core.d.ts.map +1 -0
  237. package/dist/parser-core.js +516 -0
  238. package/dist/parser-core.js.map +1 -0
  239. package/dist/parser-json.d.ts +4 -0
  240. package/dist/parser-json.d.ts.map +1 -0
  241. package/dist/parser-json.js +19 -0
  242. package/dist/parser-json.js.map +1 -0
  243. package/dist/persistence/db/db-attr-schemas.d.ts +8 -0
  244. package/dist/persistence/db/db-attr-schemas.d.ts.map +1 -0
  245. package/dist/persistence/db/db-attr-schemas.js +28 -0
  246. package/dist/persistence/db/db-attr-schemas.js.map +1 -0
  247. package/dist/persistence/db/db-constants.d.ts +5 -0
  248. package/dist/persistence/db/db-constants.d.ts.map +1 -0
  249. package/dist/persistence/db/db-constants.js +6 -0
  250. package/dist/persistence/db/db-constants.js.map +1 -0
  251. package/dist/persistence/db/db-provider.d.ts +3 -0
  252. package/dist/persistence/db/db-provider.d.ts.map +1 -0
  253. package/dist/persistence/db/db-provider.js +29 -0
  254. package/dist/persistence/db/db-provider.js.map +1 -0
  255. package/dist/persistence/db/db-schema.d.ts +8 -0
  256. package/dist/persistence/db/db-schema.d.ts.map +1 -0
  257. package/dist/persistence/db/db-schema.js +27 -0
  258. package/dist/persistence/db/db-schema.js.map +1 -0
  259. package/dist/persistence/origin/meta-origin.d.ts +32 -0
  260. package/dist/persistence/origin/meta-origin.d.ts.map +1 -0
  261. package/dist/persistence/origin/meta-origin.js +55 -0
  262. package/dist/persistence/origin/meta-origin.js.map +1 -0
  263. package/dist/persistence/origin/origin-constants.d.ts +12 -0
  264. package/dist/persistence/origin/origin-constants.d.ts.map +1 -0
  265. package/dist/persistence/origin/origin-constants.js +27 -0
  266. package/dist/persistence/origin/origin-constants.js.map +1 -0
  267. package/dist/persistence/origin/origin-schema.d.ts +4 -0
  268. package/dist/persistence/origin/origin-schema.d.ts.map +1 -0
  269. package/dist/persistence/origin/origin-schema.js +49 -0
  270. package/dist/persistence/origin/origin-schema.js.map +1 -0
  271. package/dist/persistence/source/meta-source.d.ts +18 -0
  272. package/dist/persistence/source/meta-source.d.ts.map +1 -0
  273. package/dist/persistence/source/meta-source.js +31 -0
  274. package/dist/persistence/source/meta-source.js.map +1 -0
  275. package/dist/persistence/source/source-constants.d.ts +16 -0
  276. package/dist/persistence/source/source-constants.d.ts.map +1 -0
  277. package/dist/persistence/source/source-constants.js +28 -0
  278. package/dist/persistence/source/source-constants.js.map +1 -0
  279. package/dist/presentation/layout/layout-constants.d.ts +10 -0
  280. package/dist/presentation/layout/layout-constants.d.ts.map +1 -0
  281. package/dist/presentation/layout/layout-constants.js +21 -0
  282. package/dist/presentation/layout/layout-constants.js.map +1 -0
  283. package/dist/presentation/layout/layout-schema.d.ts +4 -0
  284. package/dist/presentation/layout/layout-schema.d.ts.map +1 -0
  285. package/dist/presentation/layout/layout-schema.js +46 -0
  286. package/dist/presentation/layout/layout-schema.js.map +1 -0
  287. package/dist/presentation/layout/meta-layout.d.ts +23 -0
  288. package/dist/presentation/layout/meta-layout.d.ts.map +1 -0
  289. package/dist/presentation/layout/meta-layout.js +47 -0
  290. package/dist/presentation/layout/meta-layout.js.map +1 -0
  291. package/dist/presentation/view/meta-view.d.ts +4 -0
  292. package/dist/presentation/view/meta-view.d.ts.map +1 -0
  293. package/dist/presentation/view/meta-view.js +8 -0
  294. package/dist/presentation/view/meta-view.js.map +1 -0
  295. package/dist/presentation/view/view-constants.d.ts +20 -0
  296. package/dist/presentation/view/view-constants.d.ts.map +1 -0
  297. package/dist/presentation/view/view-constants.js +47 -0
  298. package/dist/presentation/view/view-constants.js.map +1 -0
  299. package/dist/presentation/view/view-schema.d.ts +4 -0
  300. package/dist/presentation/view/view-schema.d.ts.map +1 -0
  301. package/dist/presentation/view/view-schema.js +15 -0
  302. package/dist/presentation/view/view-schema.js.map +1 -0
  303. package/dist/provider.d.ts +20 -0
  304. package/dist/provider.d.ts.map +1 -0
  305. package/dist/provider.js +58 -0
  306. package/dist/provider.js.map +1 -0
  307. package/dist/registry.d.ts +89 -0
  308. package/dist/registry.d.ts.map +1 -0
  309. package/dist/registry.js +107 -0
  310. package/dist/registry.js.map +1 -0
  311. package/dist/serializer-json.d.ts +16 -0
  312. package/dist/serializer-json.d.ts.map +1 -0
  313. package/dist/serializer-json.js +154 -0
  314. package/dist/serializer-json.js.map +1 -0
  315. package/dist/shared/base-types.d.ts +23 -0
  316. package/dist/shared/base-types.d.ts.map +1 -0
  317. package/dist/shared/base-types.js +43 -0
  318. package/dist/shared/base-types.js.map +1 -0
  319. package/dist/shared/meta-data.d.ts +123 -0
  320. package/dist/shared/meta-data.d.ts.map +1 -0
  321. package/dist/shared/meta-data.js +365 -0
  322. package/dist/shared/meta-data.js.map +1 -0
  323. package/dist/shared/meta-root.d.ts +12 -0
  324. package/dist/shared/meta-root.d.ts.map +1 -0
  325. package/dist/shared/meta-root.js +24 -0
  326. package/dist/shared/meta-root.js.map +1 -0
  327. package/dist/shared/structural.d.ts +20 -0
  328. package/dist/shared/structural.d.ts.map +1 -0
  329. package/dist/shared/structural.js +49 -0
  330. package/dist/shared/structural.js.map +1 -0
  331. package/dist/subtype-rules.d.ts +8 -0
  332. package/dist/subtype-rules.d.ts.map +1 -0
  333. package/dist/subtype-rules.js +34 -0
  334. package/dist/subtype-rules.js.map +1 -0
  335. package/dist/super-resolve.d.ts +34 -0
  336. package/dist/super-resolve.d.ts.map +1 -0
  337. package/dist/super-resolve.js +124 -0
  338. package/dist/super-resolve.js.map +1 -0
  339. package/package.json +50 -0
  340. package/src/attr-class-map.ts +64 -0
  341. package/src/attr-schema-validate.ts +134 -0
  342. package/src/core/attr/attr-constants.ts +31 -0
  343. package/src/core/attr/meta-attr-filter.ts +67 -0
  344. package/src/core/attr/meta-attr-properties.ts +26 -0
  345. package/src/core/attr/meta-attr-stringarray.ts +31 -0
  346. package/src/core/attr/meta-attr.ts +125 -0
  347. package/src/core/export-json.ts +66 -0
  348. package/src/core/field/field-constants.ts +79 -0
  349. package/src/core/field/field-schema.ts +121 -0
  350. package/src/core/field/meta-field.ts +179 -0
  351. package/src/core/file-meta-data-loader.ts +89 -0
  352. package/src/core/file-source.ts +52 -0
  353. package/src/core/identity/identity-constants.ts +44 -0
  354. package/src/core/identity/identity-schema.ts +80 -0
  355. package/src/core/identity/meta-identity.ts +148 -0
  356. package/src/core/index.ts +12 -0
  357. package/src/core/object/meta-object.ts +151 -0
  358. package/src/core/object/object-constants.ts +21 -0
  359. package/src/core/object/object-schema.ts +7 -0
  360. package/src/core/parser-yaml.ts +54 -0
  361. package/src/core/query/query-constants.ts +66 -0
  362. package/src/core/relationship/find-reference.ts +44 -0
  363. package/src/core/relationship/meta-relationship.ts +36 -0
  364. package/src/core/relationship/relationship-constants.ts +38 -0
  365. package/src/core/relationship/relationship-schema.ts +49 -0
  366. package/src/core/validator/meta-validator.ts +62 -0
  367. package/src/core/validator/validator-constants.ts +31 -0
  368. package/src/core/validator/validator-schema.ts +50 -0
  369. package/src/core/yaml-desugar.ts +145 -0
  370. package/src/core-types.ts +329 -0
  371. package/src/data-converter.ts +125 -0
  372. package/src/data-type.ts +33 -0
  373. package/src/errors.ts +68 -0
  374. package/src/index.ts +165 -0
  375. package/src/loader/meta-data-loader.ts +307 -0
  376. package/src/loader/meta-data-source.ts +35 -0
  377. package/src/loader/validation-passes.ts +370 -0
  378. package/src/naming.ts +86 -0
  379. package/src/object-serializer.ts +153 -0
  380. package/src/overlay.ts +5 -0
  381. package/src/parser-core.ts +815 -0
  382. package/src/parser-json.ts +28 -0
  383. package/src/persistence/db/db-constants.ts +6 -0
  384. package/src/persistence/db/db-provider.ts +36 -0
  385. package/src/persistence/db/db-schema.ts +40 -0
  386. package/src/persistence/origin/meta-origin.ts +67 -0
  387. package/src/persistence/origin/origin-constants.ts +35 -0
  388. package/src/persistence/origin/origin-schema.ts +66 -0
  389. package/src/persistence/source/meta-source.ts +38 -0
  390. package/src/persistence/source/source-constants.ts +35 -0
  391. package/src/presentation/layout/layout-constants.ts +27 -0
  392. package/src/presentation/layout/layout-schema.ts +62 -0
  393. package/src/presentation/layout/meta-layout.ts +61 -0
  394. package/src/presentation/view/meta-view.ts +8 -0
  395. package/src/presentation/view/view-constants.ts +53 -0
  396. package/src/presentation/view/view-schema.ts +21 -0
  397. package/src/provider.ts +85 -0
  398. package/src/registry.ts +190 -0
  399. package/src/serializer-json.ts +210 -0
  400. package/src/shared/base-types.ts +52 -0
  401. package/src/shared/meta-data.ts +443 -0
  402. package/src/shared/meta-root.ts +33 -0
  403. package/src/shared/structural.ts +62 -0
  404. package/src/subtype-rules.ts +56 -0
  405. package/src/super-resolve.ts +147 -0
@@ -0,0 +1,516 @@
1
+ // Shared canonical tree-builder — redesigned (post-v0.3) format.
2
+ //
3
+ // buildTree() turns a canonical-shaped JS object into a typed MetaData tree.
4
+ // parser-json.ts and parser-yaml.ts both funnel their parsed/desugared input
5
+ // through here so JSON and YAML stay isomorphic ("one structure, two
6
+ // renderings").
7
+ //
8
+ // Node encoding: every node is a single-key map { "<type>.<subType>": <body> }.
9
+ // The wrapper key FUSES type and subType into one dotted token (object.entity,
10
+ // field.long, metadata.root). The body is a map of reserved structural keys
11
+ // (name/package/extends/abstract/overlay/isArray/children), `@`-prefixed
12
+ // attributes, and the children list.
13
+ //
14
+ // Operator vocabulary (canonical, no aliases):
15
+ // - extends: string ref to a supertype (immediate resolution against
16
+ // the accumulating root, or deferred for cross-file refs)
17
+ // - overlay:true re-opens an existing same-(type,name) child; errors if missing
18
+ //
19
+ // Default (no operator): silently reuse existing same-(type,name) child, or
20
+ // create new.
21
+ //
22
+ // Context package for super resolution:
23
+ // Each node's effective package is its own package if set, or inherited from
24
+ // the nearest ancestor with a package.
25
+ import { TypeId, TypeRegistry } from "./registry.js";
26
+ import { MetaRoot } from "./shared/meta-root.js";
27
+ import { MetaAttr } from "./core/attr/meta-attr.js";
28
+ import { inferAttrSubType } from "./serializer-json.js";
29
+ import { ParseError } from "./errors.js";
30
+ import { resolveSuperRef } from "./super-resolve.js";
31
+ import { TYPE_ATTR, TYPE_FIELD, TYPE_OBJECT, TYPE_VALIDATOR, SUBTYPE_BASE, } from "./shared/base-types.js";
32
+ import { RESERVED_KEYS, RESERVED_KEY_NAME, RESERVED_KEY_PACKAGE, RESERVED_KEY_EXTENDS, RESERVED_KEY_ABSTRACT, RESERVED_KEY_OVERLAY, RESERVED_KEY_IS_ARRAY, RESERVED_KEY_CHILDREN, RESERVED_KEY_VALUE, JSON_KEY_SCHEMA, ATTR_PREFIX, TYPE_SUBTYPE_SEPARATOR, PACKAGE_SEPARATOR, } from "./shared/structural.js";
33
+ import { ATTR_SUBTYPE_PROPERTIES } from "./core/attr/attr-constants.js";
34
+ // ---------------------------------------------------------------------------
35
+ // Internal helper — build ParseError opts, omitting undefined fields
36
+ // (required by exactOptionalPropertyTypes: true in the project tsconfig)
37
+ // ---------------------------------------------------------------------------
38
+ export function errOpts(source, path) {
39
+ const opts = {};
40
+ if (source !== undefined)
41
+ opts.source = source;
42
+ if (path !== undefined)
43
+ opts.path = path;
44
+ return opts;
45
+ }
46
+ // ---------------------------------------------------------------------------
47
+ // Internal helper — report a problem: throw in strict mode, push warning otherwise
48
+ // ---------------------------------------------------------------------------
49
+ function reportProblem(msg, strict, warnings, source, path, code) {
50
+ if (strict) {
51
+ const opts = errOpts(source, path);
52
+ if (code !== undefined)
53
+ throw new ParseError(msg, { ...opts, code });
54
+ else
55
+ throw new ParseError(msg, opts);
56
+ }
57
+ warnings.push(msg);
58
+ }
59
+ function defaultSubTypeFor(type, registry) {
60
+ const subs = registry.allSubTypesOf(type);
61
+ const candidate = subs.length > 0 ? subs[0] : SUBTYPE_BASE;
62
+ if (!registry.has(type, candidate) && registry.has(type, SUBTYPE_BASE)) {
63
+ return SUBTYPE_BASE;
64
+ }
65
+ return candidate;
66
+ }
67
+ function splitTypeKey(key, registry) {
68
+ const dotIdx = key.indexOf(TYPE_SUBTYPE_SEPARATOR);
69
+ if (dotIdx < 0) {
70
+ // Bare type, no fused subType — resolve via the registry default.
71
+ return { type: key, subType: defaultSubTypeFor(key, registry), explicit: false };
72
+ }
73
+ const type = key.slice(0, dotIdx);
74
+ const subType = key.slice(dotIdx + TYPE_SUBTYPE_SEPARATOR.length);
75
+ // Malformed keys (e.g. "object.entity.extra", ".entity", "object.") are not
76
+ // validated here — they fall through to the downstream registry.has() check
77
+ // which reports them as an unknown type or subtype error.
78
+ return { type, subType, explicit: true };
79
+ }
80
+ // ---------------------------------------------------------------------------
81
+ // Helper: expand relative package paths
82
+ // ---------------------------------------------------------------------------
83
+ /**
84
+ * Expands a package path relative to a base package.
85
+ * Java semantics:
86
+ * - Absolute path (::foo::bar) → prepended with base: "acme" + "::foo" → "acme::foo::bar"
87
+ * - Relative parent (..) → handled in super resolution, not here
88
+ * - No leading :: → used as-is
89
+ */
90
+ function expandPackageForPath(basePkg, pkgPath) {
91
+ if (basePkg.trim() === "" || !pkgPath.startsWith(PACKAGE_SEPARATOR)) {
92
+ return pkgPath;
93
+ }
94
+ return basePkg + pkgPath;
95
+ }
96
+ // ---------------------------------------------------------------------------
97
+ // Main entry point
98
+ // ---------------------------------------------------------------------------
99
+ // Module-level flag consumed by parseNodeFresh during super resolution.
100
+ // Safe because buildTree is fully synchronous — no reentrancy risk within
101
+ // a single parse call. Set at buildTree entry, read deep in the call tree.
102
+ let _deferSuperResolution = false;
103
+ /**
104
+ * buildTree — the shared registry-driven tree-builder.
105
+ *
106
+ * Turns an already-parsed *canonical-shaped* JS object (from JSON.parse, or
107
+ * from the YAML parser's desugar) into a typed MetaData tree. Both parseJson
108
+ * and parseYaml funnel through here, guaranteeing one structure / two
109
+ * renderings stay isomorphic.
110
+ *
111
+ * Throws ParseError for top-level structural problems (matching the historical
112
+ * parseJson behavior); collects content-level problems into the result.
113
+ */
114
+ export function buildTree(parsed, opts) {
115
+ const warnings = [];
116
+ const errors = [];
117
+ const strict = opts.strict ?? false;
118
+ const source = opts.sourceName;
119
+ _deferSuperResolution = opts.deferSuperResolution === true;
120
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
121
+ throw new ParseError("Top-level metadata must be an object", { ...errOpts(source), code: "ERR_TOP_LEVEL_NOT_OBJECT" });
122
+ }
123
+ const topLevel = parsed;
124
+ // --- Find the wrapper key (skip $schema) ---
125
+ const wrapperKeys = Object.keys(topLevel).filter((k) => k !== JSON_KEY_SCHEMA);
126
+ if (wrapperKeys.length === 0) {
127
+ throw new ParseError("Top-level metadata object has no type wrapper key", { ...errOpts(source), code: "ERR_TOP_LEVEL_NOT_OBJECT" });
128
+ }
129
+ if (wrapperKeys.length > 1) {
130
+ throw new ParseError(`Top-level metadata object must have exactly one wrapper key (found: ${wrapperKeys.join(", ")})`, { ...errOpts(source), code: "ERR_TOP_LEVEL_NOT_OBJECT" });
131
+ }
132
+ const rootKey = wrapperKeys[0];
133
+ const rootData = topLevel[rootKey];
134
+ if (typeof rootData !== "object" || rootData === null || Array.isArray(rootData)) {
135
+ throw new ParseError(`Top-level wrapper "${rootKey}" must contain an object`, { ...errOpts(source, rootKey), code: "ERR_TOP_LEVEL_NOT_OBJECT" });
136
+ }
137
+ const rootDataObj = rootData;
138
+ const { type: rootType, subType: rootSubType } = splitTypeKey(rootKey, opts.registry);
139
+ // Check root type is registered (always throw — can't skip the root)
140
+ if (!opts.registry.has(rootType, rootSubType)) {
141
+ const rootTypeCode = opts.registry.allSubTypesOf(rootType).length > 0
142
+ ? "ERR_UNKNOWN_SUBTYPE"
143
+ : "ERR_UNKNOWN_TYPE";
144
+ throw new ParseError(`Unknown root type "${rootType}.${rootSubType}" — not registered`, { ...errOpts(source, rootKey), code: rootTypeCode });
145
+ }
146
+ if (opts.intoRoot !== undefined) {
147
+ // --- Merge mode: parse root's attrs/children into the existing root ---
148
+ // The JSON root's own package/super/reserved-keys are not re-applied to the
149
+ // existing root. BUT: children from the NEW JSON should inherit from the
150
+ // NEW root's package, not the existing root's.
151
+ const newRootPkg = rootDataObj[RESERVED_KEY_PACKAGE];
152
+ const contextPkg = (typeof newRootPkg === "string" ? newRootPkg : opts.intoRoot.package) ?? "";
153
+ parseNodeInto(rootDataObj, opts.intoRoot, opts.intoRoot, // accumulating root for super resolution
154
+ contextPkg, opts.registry, warnings, errors, strict, source, rootKey);
155
+ return { root: opts.intoRoot, warnings, errors };
156
+ }
157
+ // --- Fresh root mode: create a new root from the JSON ---
158
+ // The cast is safe within the core provider: `metadata.root` is the only
159
+ // registered `metadata` subtype, and its factory unconditionally produces a
160
+ // MetaRoot (see core-types.ts). A registry that registered a second
161
+ // `metadata.*` subtype backed by a non-MetaRoot factory would break this
162
+ // cast — a known limitation of the `TypeDefinition.factory: => MetaData`
163
+ // signature. `parseNodeFresh` is a general node parser, so MetaData is its
164
+ // correct return type; this top-level callsite is where the doc-root invariant holds.
165
+ const root = parseNodeFresh(rootType, rootSubType, rootDataObj, undefined, // no accumulating root yet — built as we go
166
+ "", // no inherited context pkg yet for the root itself
167
+ opts.registry, warnings, errors, strict, source, rootKey);
168
+ return { root, warnings, errors };
169
+ }
170
+ // ---------------------------------------------------------------------------
171
+ // parseNodeFresh — creates a NEW node for this metadata node.
172
+ //
173
+ // `accumRoot` is the root of the accumulating tree (for super resolution).
174
+ // When parsing the root node itself, accumRoot is undefined on first call;
175
+ // the newly created root is passed as accumRoot for its children.
176
+ //
177
+ // `inheritedContextPkg` is the effective package from the nearest ancestor
178
+ // that had an explicit package. Used when this node has no own package.
179
+ // ---------------------------------------------------------------------------
180
+ function parseNodeFresh(type, subType, nodeData, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, path, parentType, // optional: type of the parent node (for inheritance rules)
181
+ parent) {
182
+ // --- Look up type in registry ---
183
+ if (!registry.has(type, subType)) {
184
+ if (registry.has(type, SUBTYPE_BASE)) {
185
+ subType = SUBTYPE_BASE;
186
+ }
187
+ else {
188
+ const msg = `Unknown type "${type}.${subType}" — not registered`;
189
+ errors.push(new ParseError(msg, { ...errOpts(source, path), code: "ERR_UNKNOWN_TYPE" }));
190
+ const rawName = nodeData[RESERVED_KEY_NAME];
191
+ const name = typeof rawName === "string" ? rawName : "";
192
+ return new MetaRoot(new TypeId(type, subType), name);
193
+ }
194
+ }
195
+ // --- Determine name ---
196
+ const rawName = nodeData[RESERVED_KEY_NAME];
197
+ const name = typeof rawName === "string" ? rawName : "";
198
+ // --- Create the model ---
199
+ const def = registry.find(type, subType);
200
+ const model = def.factory(def.typeId, name);
201
+ // --- Apply reserved keys (package, extends, abstract, isArray) ---
202
+ applyReservedKeys(model, nodeData, strict, source, path, warnings, inheritedContextPkg);
203
+ // --- Inherit package from context if not explicitly set ---
204
+ // Java rule (BaseMetaDataParser.shouldInheritPackageFromParent):
205
+ // - Fields within objects: no package (simple names)
206
+ // - Fields NOT within objects: inherit parent's package (for abstract fields at root level)
207
+ // - Validators within fields: inherit the field's package ONLY if field's FQN contains "::"
208
+ // - Objects and other types: don't inherit
209
+ if (model.package === undefined && inheritedContextPkg !== "") {
210
+ let shouldInherit = false;
211
+ if (type === TYPE_FIELD && parentType !== TYPE_OBJECT) {
212
+ shouldInherit = true;
213
+ }
214
+ else if (type === TYPE_VALIDATOR && parentType === TYPE_FIELD && parent !== undefined) {
215
+ shouldInherit = parent.fqn().includes(PACKAGE_SEPARATOR);
216
+ }
217
+ if (shouldInherit) {
218
+ model.setPackage(inheritedContextPkg);
219
+ }
220
+ }
221
+ // --- Determine the effective context package for super resolution ---
222
+ const effectivePkg = model.package ?? inheritedContextPkg;
223
+ // --- Resolve super IMMEDIATELY against the accumulating root ---
224
+ // (Skipped when deferSuperResolution is true — the loader resolves after
225
+ // all input files have been parsed, so cross-file super refs work.)
226
+ if (model.superRef !== undefined && accumRoot !== undefined && !_deferSuperResolution) {
227
+ const superModel = resolveSuperRef(model.superRef, effectivePkg, accumRoot);
228
+ if (superModel !== undefined) {
229
+ model.setSuperResolved(superModel);
230
+ }
231
+ else {
232
+ throw new ParseError(`the SuperClass '${model.superRef}' does not exist in file '${source ?? "<unknown>"}'`, { ...errOpts(source, path), code: "ERR_UNRESOLVED_SUPER" });
233
+ }
234
+ }
235
+ else if (model.superRef !== undefined && accumRoot === undefined) {
236
+ // Root node has a super ref — not resolvable against itself.
237
+ reportProblem(`super on root node ('${model.superRef}') is not supported and will be ignored`, strict, warnings, source, path, "ERR_UNRESOLVED_SUPER");
238
+ }
239
+ // --- Process inline attributes and other keys ---
240
+ applyInlineAttrsAndUnknownKeys(model, nodeData, strict, source, path, warnings, registry);
241
+ // --- Process children ---
242
+ // For the root node we use itself as the accumRoot for its children.
243
+ const childAccumRoot = accumRoot ?? model;
244
+ const childInheritedContextPkg = model.package ?? inheritedContextPkg;
245
+ processChildren(model, nodeData, childAccumRoot, childInheritedContextPkg, registry, warnings, errors, strict, source, path);
246
+ return model;
247
+ }
248
+ // ---------------------------------------------------------------------------
249
+ // parseNodeInto — merges a JSON node's attrs/children into an EXISTING model.
250
+ //
251
+ // Used for the intoRoot mode (top-level merge), overlay: true nodes, and the
252
+ // default same-name reuse path. Does NOT re-apply reserved keys (subType,
253
+ // extends, package) — those belong to the original model's identity.
254
+ // ---------------------------------------------------------------------------
255
+ function parseNodeInto(nodeData, target, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, path) {
256
+ // Apply inline attrs (not reserved keys — those stay on the existing model)
257
+ applyInlineAttrsAndUnknownKeys(target, nodeData, strict, source, path, warnings, registry);
258
+ // The effective package for children: use inheritedContextPkg (from the new
259
+ // JSON's root) — not target.package, because target is the existing model
260
+ // being merged into, and new children inherit from the NEW context.
261
+ const effectivePkg = inheritedContextPkg;
262
+ processChildren(target, nodeData, accumRoot, effectivePkg, registry, warnings, errors, strict, source, path);
263
+ }
264
+ // ---------------------------------------------------------------------------
265
+ // createOrFindMetaData — per-node merge logic.
266
+ //
267
+ // overlay: true → find-or-throw (throw if no existing same-(type,name) child)
268
+ // default → find-or-create (silently reuse if found)
269
+ // ---------------------------------------------------------------------------
270
+ function createOrFindMetaData(type, subType, nodeData, parent, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, path) {
271
+ // Only `overlay: true` re-opens an existing node. Anything else falls through
272
+ // to the default reuse-or-create path.
273
+ const isOverlayNode = nodeData[RESERVED_KEY_OVERLAY] === true;
274
+ // Determine name (needed for the lookup). Lookup key is (type, name).
275
+ const rawName = nodeData[RESERVED_KEY_NAME];
276
+ const name = typeof rawName === "string" ? rawName : "";
277
+ // Look up an existing child with (type, name). Skip unnamed nodes — they
278
+ // are always distinct (e.g. inline validators, anonymous attrs).
279
+ const existing = name !== "" ? parent.ownChildByTypeAndName(type, name) : undefined;
280
+ if (isOverlayNode) {
281
+ if (existing === undefined) {
282
+ throw new ParseError(`Overlay operation requested for [${type}:${name}] but no existing metadata found to merge into`, { ...errOpts(source, path), code: "ERR_OVERLAY_NO_TARGET" });
283
+ }
284
+ existing.setIsMerge(true);
285
+ parseNodeInto(nodeData, existing, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, path);
286
+ return existing;
287
+ }
288
+ // Default: no operator → silently reuse existing or create new.
289
+ if (existing !== undefined) {
290
+ parseNodeInto(nodeData, existing, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, path);
291
+ return existing;
292
+ }
293
+ // Not found (or unnamed) → create new
294
+ return parseNodeFresh(type, subType, nodeData, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, path, parent.type, parent);
295
+ }
296
+ // ---------------------------------------------------------------------------
297
+ // applyReservedKeys — apply package, extends, abstract, isArray to a model.
298
+ //
299
+ // Called only when CREATING a new model (not when merging into existing).
300
+ // ---------------------------------------------------------------------------
301
+ function applyReservedKeys(model, nodeData, strict, source, path, warnings, contextPkg) {
302
+ // package
303
+ const rawPkg = nodeData[RESERVED_KEY_PACKAGE];
304
+ if (rawPkg !== undefined) {
305
+ if (typeof rawPkg !== "string") {
306
+ reportProblem(`"${RESERVED_KEY_PACKAGE}" must be a string at ${path}`, strict, warnings, source, path, "ERR_BAD_ATTR_VALUE");
307
+ }
308
+ else {
309
+ const expandedPkg = contextPkg !== undefined ? expandPackageForPath(contextPkg, rawPkg) : rawPkg;
310
+ model.setPackage(expandedPkg);
311
+ }
312
+ }
313
+ // extends — store the raw supertype ref; resolution happens after this call.
314
+ const rawExtends = nodeData[RESERVED_KEY_EXTENDS];
315
+ if (rawExtends !== undefined) {
316
+ if (typeof rawExtends !== "string") {
317
+ reportProblem(`"${RESERVED_KEY_EXTENDS}" must be a string at ${path}`, strict, warnings, source, path, "ERR_UNRESOLVED_SUPER");
318
+ }
319
+ else {
320
+ model.setSuper(rawExtends);
321
+ }
322
+ }
323
+ // abstract — structural key (true → abstract node)
324
+ const rawAbstract = nodeData[RESERVED_KEY_ABSTRACT];
325
+ if (rawAbstract !== undefined) {
326
+ if (typeof rawAbstract !== "boolean") {
327
+ reportProblem(`"${RESERVED_KEY_ABSTRACT}" must be a boolean at ${path}`, strict, warnings, source, path, "ERR_BAD_ATTR_VALUE");
328
+ }
329
+ else {
330
+ model.setIsAbstract(rawAbstract);
331
+ }
332
+ }
333
+ // isArray — structural key (true → array node)
334
+ const rawIsArray = nodeData[RESERVED_KEY_IS_ARRAY];
335
+ if (rawIsArray !== undefined) {
336
+ if (typeof rawIsArray !== "boolean") {
337
+ reportProblem(`"${RESERVED_KEY_IS_ARRAY}" must be a boolean at ${path}`, strict, warnings, source, path, "ERR_BAD_ATTR_VALUE");
338
+ }
339
+ else {
340
+ model.setIsArray(rawIsArray);
341
+ }
342
+ }
343
+ }
344
+ // ---------------------------------------------------------------------------
345
+ // applyInlineAttrsAndUnknownKeys — apply @-prefixed attrs and warn about unknowns
346
+ //
347
+ // Called for both fresh creates AND merge-into-existing paths.
348
+ // Does NOT process reserved structural keys.
349
+ // ---------------------------------------------------------------------------
350
+ function applyInlineAttrsAndUnknownKeys(model, nodeData, strict, source, path, warnings, registry) {
351
+ for (const key of Object.keys(nodeData)) {
352
+ // Skip all reserved structural keys (already handled or intentionally ignored)
353
+ if (RESERVED_KEYS.has(key))
354
+ continue;
355
+ if (!key.startsWith(ATTR_PREFIX)) {
356
+ const displayName = model.name !== "" ? `${model.type}.${model.subType} '${model.name}'` : `${model.type}.${model.subType}`;
357
+ reportProblem(`Unknown key '${key}' on ${displayName} at ${path} (must be reserved or ${ATTR_PREFIX}-prefixed)`, strict, warnings, source, path, "ERR_UNKNOWN_ATTR");
358
+ continue;
359
+ }
360
+ // Inline attribute (@-prefixed) — materialize into a MetaAttr instance.
361
+ const attrName = key.slice(ATTR_PREFIX.length);
362
+ const rawVal = nodeData[key];
363
+ try {
364
+ const attr = materializeAttr(model, attrName, rawVal, registry);
365
+ model.setMetaAttr(attr);
366
+ }
367
+ catch (err) {
368
+ reportProblem(`Failed to convert attribute "${ATTR_PREFIX}${attrName}" at ${path}: ${err.message}`, strict, warnings, source, path, "ERR_BAD_ATTR_VALUE");
369
+ }
370
+ }
371
+ }
372
+ // ---------------------------------------------------------------------------
373
+ // materializeAttr — build a single attr into the right MetaAttr subclass:
374
+ // declared subtype from the owner's AttrSchema (if any), else inferred from the
375
+ // value shape. The instance coerces + desugars its own value.
376
+ // ---------------------------------------------------------------------------
377
+ function materializeAttr(owner, attrName, rawVal, registry) {
378
+ const attrSpec = registry.attrsOf(owner.type, owner.subType).find((s) => s.name === attrName);
379
+ let subType;
380
+ if (attrSpec !== undefined && attrSpec.valueType !== undefined) {
381
+ subType = attrSpec.valueType;
382
+ }
383
+ else {
384
+ // Undeclared or declared-but-untyped (@default): preserve the author's shape.
385
+ subType = inferUndeclaredAttrSubType(rawVal);
386
+ }
387
+ const def = registry.find(TYPE_ATTR, subType);
388
+ const node = (def !== undefined
389
+ ? def.factory(def.typeId, attrName)
390
+ : new MetaAttr(new TypeId(TYPE_ATTR, subType), attrName));
391
+ const coerced = node.coerce(rawVal);
392
+ const desugared = node.desugar(coerced);
393
+ node.setAttr(RESERVED_KEY_VALUE, desugared);
394
+ return node;
395
+ }
396
+ // Undeclared attr → pick the subtype from the value's runtime shape, preserving
397
+ // type (a numeric string stays string). Wraps inferAttrSubType (scalar/array
398
+ // rule, incl. the int/long/double range split) with the object + null-reject
399
+ // branches that predate object attrs: a plain object → properties; null /
400
+ // undefined are not valid undeclared attr values.
401
+ function inferUndeclaredAttrSubType(raw) {
402
+ if (raw === null || raw === undefined) {
403
+ throw new Error(`${raw === null ? "null" : "undefined"} is not a valid attr value`);
404
+ }
405
+ if (typeof raw === "object" && !Array.isArray(raw))
406
+ return ATTR_SUBTYPE_PROPERTIES;
407
+ return inferAttrSubType(raw);
408
+ }
409
+ // ---------------------------------------------------------------------------
410
+ // processChildren — parse the "children" array of a node
411
+ // ---------------------------------------------------------------------------
412
+ function processChildren(parent, nodeData, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, path) {
413
+ const rawChildren = nodeData[RESERVED_KEY_CHILDREN];
414
+ if (rawChildren === undefined)
415
+ return;
416
+ if (!Array.isArray(rawChildren)) {
417
+ reportProblem(`"${RESERVED_KEY_CHILDREN}" must be an array at ${path}`, strict, warnings, source, path, "ERR_TOP_LEVEL_NOT_OBJECT");
418
+ return;
419
+ }
420
+ for (let i = 0; i < rawChildren.length; i++) {
421
+ const childEntry = rawChildren[i];
422
+ const childPath = `${path}.${RESERVED_KEY_CHILDREN}[${i}]`;
423
+ if (typeof childEntry !== "object" || childEntry === null || Array.isArray(childEntry)) {
424
+ reportProblem(`Child at ${childPath} must be an object`, strict, warnings, source, childPath, "ERR_TOP_LEVEL_NOT_OBJECT");
425
+ continue;
426
+ }
427
+ const childRecord = childEntry;
428
+ const childKeys = Object.keys(childRecord);
429
+ if (childKeys.length !== 1) {
430
+ const msg = childKeys.length === 0
431
+ ? `Child at ${childPath} has no type wrapper key`
432
+ : `Child at ${childPath} has multiple keys (${childKeys.join(", ")}) — each child must have exactly one wrapper key`;
433
+ reportProblem(msg, strict, warnings, source, childPath, "ERR_TOP_LEVEL_NOT_OBJECT");
434
+ continue;
435
+ }
436
+ const childKey = childKeys[0];
437
+ const childData = childRecord[childKey];
438
+ const childNodePath = `${childPath}.${childKey}`;
439
+ if (typeof childData !== "object" || childData === null || Array.isArray(childData)) {
440
+ reportProblem(`Child wrapper "${childKey}" at ${childNodePath} must contain an object`, strict, warnings, source, childNodePath, "ERR_TOP_LEVEL_NOT_OBJECT");
441
+ continue;
442
+ }
443
+ const childDataObj = childData;
444
+ const { type: childType, subType: childSubTypeRaw, explicit } = splitTypeKey(childKey, registry);
445
+ // --- Check if this child type is registered ---
446
+ // An EXPLICIT unknown subType (fused into the key) is an error — never
447
+ // silently downgraded to base. An OMITTED subType that resolves to an
448
+ // unregistered default falls back to base.
449
+ let childSubType = childSubTypeRaw;
450
+ if (!registry.has(childType, childSubType)) {
451
+ if (!explicit && registry.has(childType, SUBTYPE_BASE)) {
452
+ childSubType = SUBTYPE_BASE;
453
+ }
454
+ else {
455
+ const childTypeCode = explicit && registry.allSubTypesOf(childType).length > 0
456
+ ? "ERR_UNKNOWN_SUBTYPE"
457
+ : "ERR_UNKNOWN_TYPE";
458
+ errors.push(new ParseError(`Unknown type "${childType}.${childSubType}" — not registered`, { ...errOpts(source, childNodePath), code: childTypeCode }));
459
+ continue; // skip this child
460
+ }
461
+ }
462
+ // --- Special handling for "attr" child nodes ---
463
+ if (childType === TYPE_ATTR) {
464
+ parseAttrChild(parent, childType, childSubType, childDataObj, registry, warnings, strict, source, childNodePath);
465
+ }
466
+ else {
467
+ // Use createOrFindMetaData to handle overlay/default per-node logic
468
+ const childModel = createOrFindMetaData(childType, childSubType, childDataObj, parent, accumRoot, inheritedContextPkg, registry, warnings, errors, strict, source, childNodePath);
469
+ if (childModel !== undefined && !parent.ownChildren().includes(childModel)) {
470
+ parent.addChild(childModel);
471
+ }
472
+ }
473
+ }
474
+ }
475
+ // ---------------------------------------------------------------------------
476
+ // Attr child node — materialize into a MetaAttr instance (NOT a child).
477
+ // ---------------------------------------------------------------------------
478
+ //
479
+ // A typed attr is encoded as { "attr.<subType>": { "name": ..., "value": ... } }
480
+ // inside a node's children array. The subType is fused into the wrapper key.
481
+ //
482
+ // The instance coerces + desugars toward its OWN subtype (the wrapper key's
483
+ // subType, e.g. attr.stringarray) — StringArrayAttr.coerce wraps the bare
484
+ // string, FilterAttr.desugar normalizes. The attr is attached via setMetaAttr,
485
+ // never addChild: attrs are no longer structural children (D2/D5).
486
+ function parseAttrChild(parent, attrType, attrSubType, attrData, registry, warnings, strict, source, path) {
487
+ const attrName = attrData[RESERVED_KEY_NAME];
488
+ const attrValue = attrData[RESERVED_KEY_VALUE];
489
+ if (typeof attrName !== "string" || attrName === "") {
490
+ reportProblem(`attr child at ${path} requires a non-empty "${RESERVED_KEY_NAME}" string`, strict, warnings, source, path, "ERR_MISSING_REQUIRED_ATTR");
491
+ return;
492
+ }
493
+ if (attrValue === undefined) {
494
+ reportProblem(`attr child "${attrName}" at ${path} is missing "${RESERVED_KEY_VALUE}"`, strict, warnings, source, path, "ERR_MISSING_REQUIRED_ATTR");
495
+ return;
496
+ }
497
+ // Resolve the attr node's own subtype (fall back to base if unregistered).
498
+ const resolvedSubType = registry.has(attrType, attrSubType) || !registry.has(attrType, SUBTYPE_BASE)
499
+ ? attrSubType
500
+ : SUBTYPE_BASE;
501
+ const attrDef = registry.find(attrType, resolvedSubType);
502
+ const node = (attrDef !== undefined
503
+ ? attrDef.factory(attrDef.typeId, attrName)
504
+ : new MetaAttr(new TypeId(attrType, resolvedSubType), attrName));
505
+ try {
506
+ const coerced = node.coerce(attrValue);
507
+ const desugared = node.desugar(coerced);
508
+ node.setAttr(RESERVED_KEY_VALUE, desugared);
509
+ }
510
+ catch (err) {
511
+ reportProblem(`Failed to convert attr child "${attrName}" value at ${path}: ${err.message}`, strict, warnings, source, path, "ERR_BAD_ATTR_VALUE");
512
+ return;
513
+ }
514
+ parent.setMetaAttr(node);
515
+ }
516
+ //# sourceMappingURL=parser-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser-core.js","sourceRoot":"","sources":["../src/parser-core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AI,CAAC,OAAO,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,aAAa,CACX,iCAAiC,QAAQ,cAAc,IAAI,KAAM,GAAa,CAAC,OAAO,EAAE,EACxF,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,CACrD,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ParseOptions, ParseResult } from "./parser-core.js";
2
+ export type { ParseOptions, ParseResult } from "./parser-core.js";
3
+ export declare function parseJson(content: string, opts: ParseOptions): ParseResult;
4
+ //# sourceMappingURL=parser-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser-json.d.ts","sourceRoot":"","sources":["../src/parser-json.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAElE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAElE,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,WAAW,CAgB1E"}
@@ -0,0 +1,19 @@
1
+ // Canonical JSON parser.
2
+ //
3
+ // parseJson is a thin front-end: strip the UTF-8 BOM, JSON.parse, then hand
4
+ // the canonical object to the shared buildTree (parser-core.ts).
5
+ import { ParseError } from "./errors.js";
6
+ import { buildTree, errOpts } from "./parser-core.js";
7
+ export function parseJson(content, opts) {
8
+ // Strip UTF-8 BOM if present (Java-authored files often have it).
9
+ const normalizedContent = content.charCodeAt(0) === 0xfeff ? content.slice(1) : content;
10
+ let parsed;
11
+ try {
12
+ parsed = JSON.parse(normalizedContent);
13
+ }
14
+ catch (err) {
15
+ throw new ParseError(`Invalid JSON: ${err.message}`, { ...errOpts(opts.sourceName), code: "ERR_MALFORMED_JSON" });
16
+ }
17
+ return buildTree(parsed, opts);
18
+ }
19
+ //# sourceMappingURL=parser-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser-json.js","sourceRoot":"","sources":["../src/parser-json.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,EAAE;AACF,4EAA4E;AAC5E,iEAAiE;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKtD,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,IAAkB;IAC3D,kEAAkE;IAClE,MAAM,iBAAiB,GACrB,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAEhE,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,UAAU,CAClB,iBAAkB,GAAa,CAAC,OAAO,EAAE,EACzC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAC5D,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { AttrSchema } from "../../registry.js";
2
+ /** `@dbColumn` — column-name override; on every field subtype. */
3
+ export declare const dbColumnSchema: AttrSchema;
4
+ /** `@db.indexed` — suppress the @filterable-without-index warning; on every field subtype. */
5
+ export declare const dbIndexedSchema: AttrSchema;
6
+ /** `@name` — the SQL table/view identifier; on source.dbTable and source.dbView. */
7
+ export declare const sourceNameSchema: AttrSchema;
8
+ //# sourceMappingURL=db-attr-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db-attr-schemas.d.ts","sourceRoot":"","sources":["../../../src/persistence/db/db-attr-schemas.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAWpD,kEAAkE;AAClE,eAAO,MAAM,cAAc,EAAE,UAM5B,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,eAAe,EAAE,UAM7B,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,EAAE,UAM9B,CAAC"}
@@ -0,0 +1,28 @@
1
+ // DB-domain attribute schemas — registered by dbProvider (db-provider.ts),
2
+ // not the core metamodel.
3
+ // See docs/superpowers/specs/2026-05-18-phase4b-db-provider-design.md.
4
+ import { ATTR_SUBTYPE_STRING, ATTR_SUBTYPE_BOOLEAN, } from "../../core/attr/attr-constants.js";
5
+ import { FIELD_ATTR_DB_COLUMN, FIELD_ATTR_DB_INDEXED, } from "./db-constants.js";
6
+ import { SOURCE_ATTR_NAME } from "../source/source-constants.js";
7
+ /** `@dbColumn` — column-name override; on every field subtype. */
8
+ export const dbColumnSchema = {
9
+ name: FIELD_ATTR_DB_COLUMN,
10
+ valueType: ATTR_SUBTYPE_STRING,
11
+ required: false,
12
+ description: "Override the generated SQL column name for this field. Defaults to the field name run through the project's columnNamingStrategy.",
13
+ };
14
+ /** `@db.indexed` — suppress the @filterable-without-index warning; on every field subtype. */
15
+ export const dbIndexedSchema = {
16
+ name: FIELD_ATTR_DB_INDEXED,
17
+ valueType: ATTR_SUBTYPE_BOOLEAN,
18
+ required: false,
19
+ description: "When true, suppress the @filterable-without-index Loader warning (the field is indexed by other means).",
20
+ };
21
+ /** `@name` — the SQL table/view identifier; on source.dbTable and source.dbView. */
22
+ export const sourceNameSchema = {
23
+ name: SOURCE_ATTR_NAME,
24
+ valueType: ATTR_SUBTYPE_STRING,
25
+ required: false,
26
+ description: "The SQL table or view name for this source. Defaults to the object name run through the columnNamingStrategy when omitted.",
27
+ };
28
+ //# sourceMappingURL=db-attr-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db-attr-schemas.js","sourceRoot":"","sources":["../../../src/persistence/db/db-attr-schemas.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0BAA0B;AAC1B,uEAAuE;AAGvE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,kEAAkE;AAClE,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,IAAI,EAAE,oBAAoB;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,QAAQ,EAAE,KAAK;IACf,WAAW,EACT,mIAAmI;CACtI,CAAC;AAEF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,eAAe,GAAe;IACzC,IAAI,EAAE,qBAAqB;IAC3B,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE,KAAK;IACf,WAAW,EACT,yGAAyG;CAC5G,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,IAAI,EAAE,gBAAgB;IACtB,SAAS,EAAE,mBAAmB;IAC9B,QAAQ,EAAE,KAAK;IACf,WAAW,EACT,4HAA4H;CAC/H,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Custom DB column name override on a field (maps to @dbColumn in metadata). */
2
+ export declare const FIELD_ATTR_DB_COLUMN = "dbColumn";
3
+ /** When true, suppress the @filterable-without-index Loader warning (Project D drift check). */
4
+ export declare const FIELD_ATTR_DB_INDEXED = "db.indexed";
5
+ //# sourceMappingURL=db-constants.d.ts.map