@metaobjectsdev/metadata 0.9.0 → 0.11.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.
- package/dist/attr-schema-validate.d.ts +1 -1
- package/dist/attr-schema-validate.d.ts.map +1 -1
- package/dist/attr-schema-validate.js +96 -11
- package/dist/attr-schema-validate.js.map +1 -1
- package/dist/constraint-merge.d.ts +18 -0
- package/dist/constraint-merge.d.ts.map +1 -0
- package/dist/constraint-merge.js +0 -0
- package/dist/constraint-merge.js.map +1 -0
- package/dist/constraint-validate.d.ts +6 -0
- package/dist/constraint-validate.d.ts.map +1 -0
- package/dist/constraint-validate.js +274 -0
- package/dist/constraint-validate.js.map +1 -0
- package/dist/core/attr/attr-constants.d.ts +13 -3
- package/dist/core/attr/attr-constants.d.ts.map +1 -1
- package/dist/core/attr/attr-constants.js +11 -2
- package/dist/core/attr/attr-constants.js.map +1 -1
- package/dist/core/attr/attr-definition.embedded.d.ts +3 -0
- package/dist/core/attr/attr-definition.embedded.d.ts.map +1 -0
- package/dist/core/attr/attr-definition.embedded.js +60 -0
- package/dist/core/attr/attr-definition.embedded.js.map +1 -0
- package/dist/core/documentation/doc-constants.d.ts +3 -2
- package/dist/core/documentation/doc-constants.d.ts.map +1 -1
- package/dist/core/documentation/doc-constants.js +3 -1
- package/dist/core/documentation/doc-constants.js.map +1 -1
- package/dist/core/documentation/doc-provider.d.ts.map +1 -1
- package/dist/core/documentation/doc-provider.js +6 -2
- package/dist/core/documentation/doc-provider.js.map +1 -1
- package/dist/core/documentation/documentation-definition.embedded.d.ts +3 -0
- package/dist/core/documentation/documentation-definition.embedded.d.ts.map +1 -0
- package/dist/core/documentation/documentation-definition.embedded.js +79 -0
- package/dist/core/documentation/documentation-definition.embedded.js.map +1 -0
- package/dist/core/field/field-constants.d.ts +7 -4
- package/dist/core/field/field-constants.d.ts.map +1 -1
- package/dist/core/field/field-constants.js +7 -7
- package/dist/core/field/field-constants.js.map +1 -1
- package/dist/core/field/field-definition.embedded.d.ts +3 -0
- package/dist/core/field/field-definition.embedded.d.ts.map +1 -0
- package/dist/core/field/field-definition.embedded.js +236 -0
- package/dist/core/field/field-definition.embedded.js.map +1 -0
- package/dist/core/field/meta-field.d.ts.map +1 -1
- package/dist/core/field/meta-field.js +7 -5
- package/dist/core/field/meta-field.js.map +1 -1
- package/dist/core/identity/identity-constants.d.ts.map +1 -1
- package/dist/core/identity/identity-constants.js +3 -0
- package/dist/core/identity/identity-constants.js.map +1 -1
- package/dist/core/identity/identity-definition.embedded.d.ts +3 -0
- package/dist/core/identity/identity-definition.embedded.d.ts.map +1 -0
- package/dist/core/identity/identity-definition.embedded.js +93 -0
- package/dist/core/identity/identity-definition.embedded.js.map +1 -0
- package/dist/core/identity/meta-identity.d.ts.map +1 -1
- package/dist/core/identity/meta-identity.js +8 -1
- package/dist/core/identity/meta-identity.js.map +1 -1
- package/dist/core/identity/validate-identity-passthrough.d.ts +42 -0
- package/dist/core/identity/validate-identity-passthrough.d.ts.map +1 -0
- package/dist/core/identity/validate-identity-passthrough.js +158 -0
- package/dist/core/identity/validate-identity-passthrough.js.map +1 -0
- package/dist/core/object/object-constants.d.ts +2 -1
- package/dist/core/object/object-constants.d.ts.map +1 -1
- package/dist/core/object/object-constants.js +3 -0
- package/dist/core/object/object-constants.js.map +1 -1
- package/dist/core/object/object-definition.embedded.d.ts +3 -0
- package/dist/core/object/object-definition.embedded.d.ts.map +1 -0
- package/dist/core/object/object-definition.embedded.js +110 -0
- package/dist/core/object/object-definition.embedded.js.map +1 -0
- package/dist/core/object/validate-discriminator.d.ts.map +1 -1
- package/dist/core/object/validate-discriminator.js +1 -3
- package/dist/core/object/validate-discriminator.js.map +1 -1
- package/dist/core/query/query-constants.d.ts.map +1 -1
- package/dist/core/query/query-constants.js +5 -3
- package/dist/core/query/query-constants.js.map +1 -1
- package/dist/core/relationship/derive-m2m-fields.d.ts +26 -0
- package/dist/core/relationship/derive-m2m-fields.d.ts.map +1 -0
- package/dist/core/relationship/derive-m2m-fields.js +102 -0
- package/dist/core/relationship/derive-m2m-fields.js.map +1 -0
- package/dist/core/relationship/meta-relationship.d.ts +6 -4
- package/dist/core/relationship/meta-relationship.d.ts.map +1 -1
- package/dist/core/relationship/meta-relationship.js +12 -8
- package/dist/core/relationship/meta-relationship.js.map +1 -1
- package/dist/core/relationship/relationship-constants.d.ts +6 -2
- package/dist/core/relationship/relationship-constants.d.ts.map +1 -1
- package/dist/core/relationship/relationship-constants.js +6 -2
- package/dist/core/relationship/relationship-constants.js.map +1 -1
- package/dist/core/relationship/relationship-definition.embedded.d.ts +3 -0
- package/dist/core/relationship/relationship-definition.embedded.d.ts.map +1 -0
- package/dist/core/relationship/relationship-definition.embedded.js +310 -0
- package/dist/core/relationship/relationship-definition.embedded.js.map +1 -0
- package/dist/core/validator/validator-constants.d.ts +14 -1
- package/dist/core/validator/validator-constants.d.ts.map +1 -1
- package/dist/core/validator/validator-constants.js +20 -1
- package/dist/core/validator/validator-constants.js.map +1 -1
- package/dist/core/validator/validator-definition.embedded.d.ts +3 -0
- package/dist/core/validator/validator-definition.embedded.d.ts.map +1 -0
- package/dist/core/validator/validator-definition.embedded.js +255 -0
- package/dist/core/validator/validator-definition.embedded.js.map +1 -0
- package/dist/core/yaml-desugar.d.ts.map +1 -1
- package/dist/core/yaml-desugar.js +88 -10
- package/dist/core/yaml-desugar.js.map +1 -1
- package/dist/core-types.d.ts +5 -2
- package/dist/core-types.d.ts.map +1 -1
- package/dist/core-types.js +285 -116
- package/dist/core-types.js.map +1 -1
- package/dist/errors.d.ts +3 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +87 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/library/embedded-library.generated.d.ts +2 -0
- package/dist/library/embedded-library.generated.d.ts.map +1 -0
- package/dist/library/embedded-library.generated.js +11 -0
- package/dist/library/embedded-library.generated.js.map +1 -0
- package/dist/library/library-sources.d.ts +12 -0
- package/dist/library/library-sources.d.ts.map +1 -0
- package/dist/library/library-sources.js +88 -0
- package/dist/library/library-sources.js.map +1 -0
- package/dist/loader/meta-data-loader.d.ts +10 -2
- package/dist/loader/meta-data-loader.d.ts.map +1 -1
- package/dist/loader/meta-data-loader.js +57 -6
- package/dist/loader/meta-data-loader.js.map +1 -1
- package/dist/loader/shortcuts.d.ts +2 -5
- package/dist/loader/shortcuts.d.ts.map +1 -1
- package/dist/loader/shortcuts.js.map +1 -1
- package/dist/loader/validation-passes.d.ts +3 -0
- package/dist/loader/validation-passes.d.ts.map +1 -1
- package/dist/loader/validation-passes.js +519 -34
- package/dist/loader/validation-passes.js.map +1 -1
- package/dist/loader/validation-registry.d.ts +10 -0
- package/dist/loader/validation-registry.d.ts.map +1 -0
- package/dist/loader/validation-registry.js +84 -0
- package/dist/loader/validation-registry.js.map +1 -0
- package/dist/metamodel-docs/index.d.ts +19 -0
- package/dist/metamodel-docs/index.d.ts.map +1 -0
- package/dist/metamodel-docs/index.js +37 -0
- package/dist/metamodel-docs/index.js.map +1 -0
- package/dist/metamodel-docs/provenance.d.ts +42 -0
- package/dist/metamodel-docs/provenance.d.ts.map +1 -0
- package/dist/metamodel-docs/provenance.js +148 -0
- package/dist/metamodel-docs/provenance.js.map +1 -0
- package/dist/metamodel-docs/provider-definitions.d.ts +8 -0
- package/dist/metamodel-docs/provider-definitions.d.ts.map +1 -0
- package/dist/metamodel-docs/provider-definitions.js +48 -0
- package/dist/metamodel-docs/provider-definitions.js.map +1 -0
- package/dist/metamodel-docs/render.d.ts +12 -0
- package/dist/metamodel-docs/render.d.ts.map +1 -0
- package/dist/metamodel-docs/render.js +252 -0
- package/dist/metamodel-docs/render.js.map +1 -0
- package/dist/naming-refs.d.ts +41 -0
- package/dist/naming-refs.d.ts.map +1 -0
- package/dist/naming-refs.js +144 -0
- package/dist/naming-refs.js.map +1 -0
- package/dist/naming.d.ts.map +1 -1
- package/dist/naming.js +10 -2
- package/dist/naming.js.map +1 -1
- package/dist/parser-core.d.ts.map +1 -1
- package/dist/parser-core.js +84 -9
- package/dist/parser-core.js.map +1 -1
- package/dist/persistence/db/db-constants.d.ts +10 -0
- package/dist/persistence/db/db-constants.d.ts.map +1 -1
- package/dist/persistence/db/db-constants.js +14 -0
- package/dist/persistence/db/db-constants.js.map +1 -1
- package/dist/persistence/db/db-definition.embedded.d.ts +3 -0
- package/dist/persistence/db/db-definition.embedded.d.ts.map +1 -0
- package/dist/persistence/db/db-definition.embedded.js +227 -0
- package/dist/persistence/db/db-definition.embedded.js.map +1 -0
- package/dist/persistence/db/db-provider.d.ts.map +1 -1
- package/dist/persistence/db/db-provider.js +13 -18
- package/dist/persistence/db/db-provider.js.map +1 -1
- package/dist/persistence/origin/origin-definition.embedded.d.ts +3 -0
- package/dist/persistence/origin/origin-definition.embedded.d.ts.map +1 -0
- package/dist/persistence/origin/origin-definition.embedded.js +88 -0
- package/dist/persistence/origin/origin-definition.embedded.js.map +1 -0
- package/dist/persistence/source/source-definition.embedded.d.ts +3 -0
- package/dist/persistence/source/source-definition.embedded.d.ts.map +1 -0
- package/dist/persistence/source/source-definition.embedded.js +17 -0
- package/dist/persistence/source/source-definition.embedded.js.map +1 -0
- package/dist/persistence/source/validate-source-parameter-ref.d.ts.map +1 -1
- package/dist/persistence/source/validate-source-parameter-ref.js +7 -1
- package/dist/persistence/source/validate-source-parameter-ref.js.map +1 -1
- package/dist/persistence/source/validate-source-roles.d.ts.map +1 -1
- package/dist/persistence/source/validate-source-roles.js +16 -1
- package/dist/persistence/source/validate-source-roles.js.map +1 -1
- package/dist/presentation/layout/layout-definition.embedded.d.ts +3 -0
- package/dist/presentation/layout/layout-definition.embedded.d.ts.map +1 -0
- package/dist/presentation/layout/layout-definition.embedded.js +16 -0
- package/dist/presentation/layout/layout-definition.embedded.js.map +1 -0
- package/dist/presentation/ui/ui-definition.embedded.d.ts +3 -0
- package/dist/presentation/ui/ui-definition.embedded.d.ts.map +1 -0
- package/dist/presentation/ui/ui-definition.embedded.js +114 -0
- package/dist/presentation/ui/ui-definition.embedded.js.map +1 -0
- package/dist/presentation/ui/ui-provider.d.ts +3 -0
- package/dist/presentation/ui/ui-provider.d.ts.map +1 -0
- package/dist/presentation/ui/ui-provider.js +21 -0
- package/dist/presentation/ui/ui-provider.js.map +1 -0
- package/dist/presentation/view/view-definition.embedded.d.ts +3 -0
- package/dist/presentation/view/view-definition.embedded.d.ts.map +1 -0
- package/dist/presentation/view/view-definition.embedded.js +76 -0
- package/dist/presentation/view/view-definition.embedded.js.map +1 -0
- package/dist/provider-data.d.ts +184 -0
- package/dist/provider-data.d.ts.map +1 -0
- package/dist/provider-data.js +271 -0
- package/dist/provider-data.js.map +1 -0
- package/dist/provider.d.ts +3 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +15 -1
- package/dist/provider.js.map +1 -1
- package/dist/registry-coverage.d.ts +99 -0
- package/dist/registry-coverage.d.ts.map +1 -0
- package/dist/registry-coverage.js +294 -0
- package/dist/registry-coverage.js.map +1 -0
- package/dist/registry-manifest-exclusions.d.ts +62 -0
- package/dist/registry-manifest-exclusions.d.ts.map +1 -0
- package/dist/registry-manifest-exclusions.js +163 -0
- package/dist/registry-manifest-exclusions.js.map +1 -0
- package/dist/registry-manifest.d.ts +117 -0
- package/dist/registry-manifest.d.ts.map +1 -0
- package/dist/registry-manifest.js +242 -0
- package/dist/registry-manifest.js.map +1 -0
- package/dist/registry.d.ts +76 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +37 -1
- package/dist/registry.js.map +1 -1
- package/dist/shared/structural.d.ts +7 -0
- package/dist/shared/structural.d.ts.map +1 -1
- package/dist/shared/structural.js +7 -0
- package/dist/shared/structural.js.map +1 -1
- package/dist/subtype-rules.d.ts.map +1 -1
- package/dist/subtype-rules.js +97 -13
- package/dist/subtype-rules.js.map +1 -1
- package/dist/super-resolve.d.ts +49 -2
- package/dist/super-resolve.d.ts.map +1 -1
- package/dist/super-resolve.js +128 -43
- package/dist/super-resolve.js.map +1 -1
- package/dist/template/meta-template.d.ts +3 -2
- package/dist/template/meta-template.d.ts.map +1 -1
- package/dist/template/meta-template.js +3 -2
- package/dist/template/meta-template.js.map +1 -1
- package/dist/template/prompt-definition.embedded.d.ts +3 -0
- package/dist/template/prompt-definition.embedded.d.ts.map +1 -0
- package/dist/template/prompt-definition.embedded.js +368 -0
- package/dist/template/prompt-definition.embedded.js.map +1 -0
- package/dist/template/prompt-provider.d.ts +3 -0
- package/dist/template/prompt-provider.d.ts.map +1 -0
- package/dist/template/prompt-provider.js +25 -0
- package/dist/template/prompt-provider.js.map +1 -0
- package/dist/template/template-constants.d.ts +2 -0
- package/dist/template/template-constants.d.ts.map +1 -1
- package/dist/template/template-constants.js +7 -0
- package/dist/template/template-constants.js.map +1 -1
- package/dist/template/template-definition.embedded.d.ts +3 -0
- package/dist/template/template-definition.embedded.d.ts.map +1 -0
- package/dist/template/template-definition.embedded.js +30 -0
- package/dist/template/template-definition.embedded.js.map +1 -0
- package/dist/validate-max-occurs.d.ts +5 -0
- package/dist/validate-max-occurs.d.ts.map +1 -0
- package/dist/validate-max-occurs.js +28 -0
- package/dist/validate-max-occurs.js.map +1 -0
- package/dist/validation-types.d.ts +36 -0
- package/dist/validation-types.d.ts.map +1 -0
- package/dist/validation-types.js +7 -0
- package/dist/validation-types.js.map +1 -0
- package/package.json +33 -22
- package/src/attr-schema-validate.ts +108 -8
- package/src/constraint-merge.ts +0 -0
- package/src/constraint-validate.ts +363 -0
- package/src/core/attr/attr-constants.ts +15 -3
- package/src/core/attr/attr-definition.embedded.ts +67 -0
- package/src/core/documentation/doc-constants.ts +3 -1
- package/src/core/documentation/doc-provider.ts +6 -2
- package/src/core/documentation/documentation-definition.embedded.ts +86 -0
- package/src/core/field/field-constants.ts +8 -7
- package/src/core/field/field-definition.embedded.ts +243 -0
- package/src/core/field/meta-field.ts +6 -7
- package/src/core/identity/identity-constants.ts +4 -0
- package/src/core/identity/identity-definition.embedded.ts +100 -0
- package/src/core/identity/meta-identity.ts +8 -1
- package/src/core/identity/validate-identity-passthrough.ts +194 -0
- package/src/core/object/object-constants.ts +3 -0
- package/src/core/object/object-definition.embedded.ts +117 -0
- package/src/core/object/validate-discriminator.ts +0 -4
- package/src/core/query/query-constants.ts +5 -3
- package/src/core/relationship/derive-m2m-fields.ts +145 -0
- package/src/core/relationship/meta-relationship.ts +15 -9
- package/src/core/relationship/relationship-constants.ts +6 -2
- package/src/core/relationship/relationship-definition.embedded.ts +317 -0
- package/src/core/validator/validator-constants.ts +22 -1
- package/src/core/validator/validator-definition.embedded.ts +262 -0
- package/src/core/yaml-desugar.ts +96 -7
- package/src/core-types.ts +314 -150
- package/src/errors.ts +89 -2
- package/src/index.ts +47 -2
- package/src/library/embedded-library.generated.ts +10 -0
- package/src/library/library-sources.ts +97 -0
- package/src/loader/meta-data-loader.ts +78 -7
- package/src/loader/shortcuts.ts +2 -2
- package/src/loader/validation-passes.ts +690 -34
- package/src/loader/validation-registry.ts +93 -0
- package/src/metamodel-docs/index.ts +41 -0
- package/src/metamodel-docs/provenance.ts +187 -0
- package/src/metamodel-docs/provider-definitions.ts +50 -0
- package/src/metamodel-docs/render.ts +309 -0
- package/src/naming-refs.ts +162 -0
- package/src/naming.ts +10 -2
- package/src/parser-core.ts +96 -9
- package/src/persistence/db/db-constants.ts +16 -0
- package/src/persistence/db/db-definition.embedded.ts +234 -0
- package/src/persistence/db/db-provider.ts +13 -18
- package/src/persistence/origin/origin-definition.embedded.ts +95 -0
- package/src/persistence/source/source-definition.embedded.ts +24 -0
- package/src/persistence/source/validate-source-parameter-ref.ts +7 -1
- package/src/persistence/source/validate-source-roles.ts +22 -1
- package/src/presentation/layout/layout-definition.embedded.ts +23 -0
- package/src/presentation/ui/ui-definition.embedded.ts +121 -0
- package/src/presentation/ui/ui-provider.ts +25 -0
- package/src/presentation/view/view-definition.embedded.ts +83 -0
- package/src/provider-data.ts +463 -0
- package/src/provider.ts +18 -0
- package/src/registry-coverage.ts +430 -0
- package/src/registry-manifest-exclusions.ts +176 -0
- package/src/registry-manifest.ts +334 -0
- package/src/registry.ts +106 -3
- package/src/shared/structural.ts +8 -0
- package/src/subtype-rules.ts +135 -18
- package/src/super-resolve.ts +153 -43
- package/src/template/meta-template.ts +3 -2
- package/src/template/prompt-definition.embedded.ts +375 -0
- package/src/template/prompt-provider.ts +29 -0
- package/src/template/template-constants.ts +8 -0
- package/src/template/template-definition.embedded.ts +37 -0
- package/src/validate-max-occurs.ts +39 -0
- package/src/validation-types.ts +57 -0
- package/dist/core/documentation/doc-schema.d.ts +0 -8
- package/dist/core/documentation/doc-schema.d.ts.map +0 -1
- package/dist/core/documentation/doc-schema.js +0 -53
- package/dist/core/documentation/doc-schema.js.map +0 -1
- package/dist/core/field/field-schema.d.ts +0 -22
- package/dist/core/field/field-schema.d.ts.map +0 -1
- package/dist/core/field/field-schema.js +0 -171
- package/dist/core/field/field-schema.js.map +0 -1
- package/dist/core/identity/identity-schema.d.ts +0 -6
- package/dist/core/identity/identity-schema.d.ts.map +0 -1
- package/dist/core/identity/identity-schema.js +0 -55
- package/dist/core/identity/identity-schema.js.map +0 -1
- package/dist/core/object/object-schema.d.ts +0 -4
- package/dist/core/object/object-schema.d.ts.map +0 -1
- package/dist/core/object/object-schema.js +0 -28
- package/dist/core/object/object-schema.js.map +0 -1
- package/dist/core/relationship/relationship-schema.d.ts +0 -4
- package/dist/core/relationship/relationship-schema.d.ts.map +0 -1
- package/dist/core/relationship/relationship-schema.js +0 -51
- package/dist/core/relationship/relationship-schema.js.map +0 -1
- package/dist/core/validator/validator-schema.d.ts +0 -4
- package/dist/core/validator/validator-schema.d.ts.map +0 -1
- package/dist/core/validator/validator-schema.js +0 -38
- package/dist/core/validator/validator-schema.js.map +0 -1
- package/dist/persistence/db/db-schema.d.ts +0 -14
- package/dist/persistence/db/db-schema.d.ts.map +0 -1
- package/dist/persistence/db/db-schema.js +0 -35
- package/dist/persistence/db/db-schema.js.map +0 -1
- package/dist/persistence/origin/origin-schema.d.ts +0 -4
- package/dist/persistence/origin/origin-schema.d.ts.map +0 -1
- package/dist/persistence/origin/origin-schema.js +0 -59
- package/dist/persistence/origin/origin-schema.js.map +0 -1
- package/dist/persistence/source/source-schema.d.ts +0 -4
- package/dist/persistence/source/source-schema.d.ts.map +0 -1
- package/dist/persistence/source/source-schema.js +0 -98
- package/dist/persistence/source/source-schema.js.map +0 -1
- package/dist/presentation/layout/layout-schema.d.ts +0 -4
- package/dist/presentation/layout/layout-schema.d.ts.map +0 -1
- package/dist/presentation/layout/layout-schema.js +0 -46
- package/dist/presentation/layout/layout-schema.js.map +0 -1
- package/dist/presentation/view/view-schema.d.ts +0 -4
- package/dist/presentation/view/view-schema.d.ts.map +0 -1
- package/dist/presentation/view/view-schema.js +0 -15
- package/dist/presentation/view/view-schema.js.map +0 -1
- package/dist/template/template-schema.d.ts +0 -3
- package/dist/template/template-schema.d.ts.map +0 -1
- package/dist/template/template-schema.js +0 -173
- package/dist/template/template-schema.js.map +0 -1
- package/src/core/documentation/doc-schema.ts +0 -64
- package/src/core/field/field-schema.ts +0 -228
- package/src/core/identity/identity-schema.ts +0 -80
- package/src/core/object/object-schema.ts +0 -35
- package/src/core/relationship/relationship-schema.ts +0 -67
- package/src/core/validator/validator-schema.ts +0 -50
- package/src/persistence/db/db-schema.ts +0 -50
- package/src/persistence/origin/origin-schema.ts +0 -80
- package/src/persistence/source/source-schema.ts +0 -129
- package/src/presentation/layout/layout-schema.ts +0 -62
- package/src/presentation/view/view-schema.ts +0 -21
- package/src/template/template-schema.ts +0 -211
package/src/core-types.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { TypeId, type AttrSchema, type ChildRule, type TypeDefinition, TypeRegis
|
|
|
3
3
|
import type { MetaDataTypeProvider } from "./provider.js";
|
|
4
4
|
import { dbProvider } from "./persistence/db/db-provider.js";
|
|
5
5
|
import { docProvider } from "./core/documentation/doc-provider.js";
|
|
6
|
+
import { promptProvider } from "./template/prompt-provider.js";
|
|
7
|
+
import { uiProvider } from "./presentation/ui/ui-provider.js";
|
|
6
8
|
import { type DataType } from "./data-type.js";
|
|
7
9
|
import type { MetaData } from "./shared/meta-data.js";
|
|
8
10
|
import { MetaRoot } from "./shared/meta-root.js";
|
|
@@ -35,16 +37,19 @@ import { MetaRelationship } from "./core/relationship/meta-relationship.js";
|
|
|
35
37
|
import { MetaLayout } from "./presentation/layout/meta-layout.js";
|
|
36
38
|
import { MetaSource } from "./persistence/source/meta-source.js";
|
|
37
39
|
import { MetaOrigin, MetaPassthroughOrigin, MetaAggregateOrigin, MetaCollectionOrigin } from "./persistence/origin/meta-origin.js";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
40
|
+
import { defineProviderFromData, type FactoryMap } from "./provider-data.js";
|
|
41
|
+
import { FIELD_DEFINITION } from "./core/field/field-definition.embedded.js";
|
|
42
|
+
import { OBJECT_DEFINITION } from "./core/object/object-definition.embedded.js";
|
|
43
|
+
import { ATTR_DEFINITION } from "./core/attr/attr-definition.embedded.js";
|
|
44
|
+
import { VALIDATOR_DEFINITION } from "./core/validator/validator-definition.embedded.js";
|
|
45
|
+
import { IDENTITY_DEFINITION } from "./core/identity/identity-definition.embedded.js";
|
|
46
|
+
import { RELATIONSHIP_DEFINITION } from "./core/relationship/relationship-definition.embedded.js";
|
|
47
|
+
import { ORIGIN_DEFINITION } from "./persistence/origin/origin-definition.embedded.js";
|
|
48
|
+
import { SOURCE_DEFINITION } from "./persistence/source/source-definition.embedded.js";
|
|
49
|
+
import { VIEW_DEFINITION } from "./presentation/view/view-definition.embedded.js";
|
|
50
|
+
import { LAYOUT_DEFINITION } from "./presentation/layout/layout-definition.embedded.js";
|
|
46
51
|
import { MetaTemplate } from "./template/meta-template.js";
|
|
47
|
-
import {
|
|
52
|
+
import { TEMPLATE_DEFINITION } from "./template/template-definition.embedded.js";
|
|
48
53
|
import { TEMPLATE_SUBTYPES } from "./template/template-constants.js";
|
|
49
54
|
import {
|
|
50
55
|
TYPE_METADATA,
|
|
@@ -62,8 +67,8 @@ import {
|
|
|
62
67
|
SUBTYPE_ROOT,
|
|
63
68
|
} from "./shared/base-types.js";
|
|
64
69
|
import { CHILD_RULE_WILDCARD } from "./shared/structural.js";
|
|
65
|
-
import { OBJECT_SUBTYPES, OBJECT_SUBTYPE_ENTITY
|
|
66
|
-
import { FIELD_SUBTYPES
|
|
70
|
+
import { OBJECT_SUBTYPES, OBJECT_SUBTYPE_ENTITY } from "./core/object/object-constants.js";
|
|
71
|
+
import { FIELD_SUBTYPES } from "./core/field/field-constants.js";
|
|
67
72
|
import { ATTR_SUBTYPES } from "./core/attr/attr-constants.js";
|
|
68
73
|
import {
|
|
69
74
|
VALIDATOR_SUBTYPES,
|
|
@@ -73,18 +78,16 @@ import {
|
|
|
73
78
|
VALIDATOR_SUBTYPE_NUMERIC,
|
|
74
79
|
VALIDATOR_SUBTYPE_ARRAY,
|
|
75
80
|
} from "./core/validator/validator-constants.js";
|
|
76
|
-
import {
|
|
77
|
-
VIEW_SUBTYPES,
|
|
78
|
-
VIEW_SUBTYPE_CURRENCY,
|
|
79
|
-
} from "./presentation/view/view-constants.js";
|
|
81
|
+
import { VIEW_SUBTYPES } from "./presentation/view/view-constants.js";
|
|
80
82
|
import {
|
|
81
83
|
IDENTITY_SUBTYPES,
|
|
82
84
|
IDENTITY_SUBTYPE_PRIMARY,
|
|
83
85
|
IDENTITY_SUBTYPE_SECONDARY,
|
|
84
86
|
IDENTITY_SUBTYPE_REFERENCE,
|
|
87
|
+
IDENTITY_REFERENCE_ATTR_REFERENCES,
|
|
85
88
|
} from "./core/identity/identity-constants.js";
|
|
86
|
-
import { RELATIONSHIP_SUBTYPES } from "./core/relationship/relationship-constants.js";
|
|
87
|
-
import { LAYOUT_SUBTYPES
|
|
89
|
+
import { RELATIONSHIP_SUBTYPES, RELATIONSHIP_ATTR_OBJECT_REF } from "./core/relationship/relationship-constants.js";
|
|
90
|
+
import { LAYOUT_SUBTYPES } from "./presentation/layout/layout-constants.js";
|
|
88
91
|
import { SOURCE_SUBTYPES } from "./persistence/source/source-constants.js";
|
|
89
92
|
import {
|
|
90
93
|
ORIGIN_SUBTYPES,
|
|
@@ -95,7 +98,8 @@ import {
|
|
|
95
98
|
|
|
96
99
|
// ---------------------------------------------------------------------------
|
|
97
100
|
// The per-(type, subType) attribute schemas live in per-concern *-schema.ts
|
|
98
|
-
// modules (e.g.
|
|
101
|
+
// modules (e.g. presentation/view/view-schema.ts) or, increasingly under
|
|
102
|
+
// FR-033, in the externalized spec/metamodel/*.json provider definitions.
|
|
99
103
|
// This file keeps only the registration logic: the def() helper, the
|
|
100
104
|
// subtype→class dispatch maps, and registerCoreTypes() itself.
|
|
101
105
|
// ---------------------------------------------------------------------------
|
|
@@ -161,175 +165,326 @@ const ORIGIN_CLASS_MAP = new Map<string, NodeConstructor>([
|
|
|
161
165
|
// re-exported from the package index for the same public surface.
|
|
162
166
|
|
|
163
167
|
function registerCoreTypeDefs(registry: TypeRegistry): void {
|
|
164
|
-
// metadata — 1 subtype (the document root: metadata.root)
|
|
168
|
+
// metadata — 1 subtype (the document root: metadata.root). FR-033 S1-simple:
|
|
169
|
+
// the any-attr wildcard child rule is DROPPED (strict/fail-closed — a document
|
|
170
|
+
// root holds structural nodes, never bare attrs); the genuinely-open structural
|
|
171
|
+
// wildcards (object/field/validator/template) are KEPT — a root legitimately
|
|
172
|
+
// holds arbitrary nodes of those types.
|
|
165
173
|
registry.register(
|
|
166
174
|
def(TYPE_METADATA, SUBTYPE_ROOT, "Root metadata document", [
|
|
167
175
|
wildcard(TYPE_OBJECT),
|
|
168
176
|
wildcard(TYPE_FIELD),
|
|
169
|
-
wildcard(TYPE_ATTR),
|
|
170
177
|
wildcard(TYPE_VALIDATOR),
|
|
171
178
|
wildcard(TYPE_TEMPLATE),
|
|
172
179
|
], MetaRoot),
|
|
173
180
|
);
|
|
174
181
|
|
|
175
|
-
// object — 4 subtypes
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
182
|
+
// object — 4 subtypes. FR-033 S1-object: the object provider's declarative
|
|
183
|
+
// definition (vocabulary + per-subtype attr constraints + the structural child
|
|
184
|
+
// rules + real descriptions + the ADR-0028 taxonomy rule prose) is externalized
|
|
185
|
+
// to spec/metamodel/object.json, embedded at build into OBJECT_DEFINITION. The
|
|
186
|
+
// strict per-subtype model lives entirely in the JSON now: object.base carries
|
|
187
|
+
// the INTERSECTION of every subtype's structural children (field/identity/
|
|
188
|
+
// validator/layout/source); each concrete subtype sets extendsBase:true
|
|
189
|
+
// (composeWithBase folds the base childRules in at registration) and adds ONLY
|
|
190
|
+
// its subtype-specific children — value adds relationship; entity adds
|
|
191
|
+
// relationship + template (templates may be co-located) + the FR-014 TPH attrs
|
|
192
|
+
// @discriminator/@discriminatorValue (an entity-inheritance concept — a value
|
|
193
|
+
// object / derived projection carries no discriminator); projection inherits the
|
|
194
|
+
// base intersection ONLY (NO relationship — derivation is via @via, not a
|
|
195
|
+
// relationship child — and NO template). The "any attr" wildcard child rule is
|
|
196
|
+
// DROPPED (strict/fail-closed) and childRules are NO LONGER post-assigned in
|
|
197
|
+
// code. defineProviderFromData lowers it to TypeDefinitions; the factory
|
|
198
|
+
// (behavior) stays code via OBJECT_FACTORIES, mapping every subType → MetaObject.
|
|
199
|
+
const OBJECT_FACTORIES: FactoryMap = Object.fromEntries(
|
|
200
|
+
OBJECT_SUBTYPES.map((subType) => [
|
|
201
|
+
`${TYPE_OBJECT}.${subType}`,
|
|
202
|
+
(typeId: TypeId, name: string) => new MetaObject(typeId, name),
|
|
203
|
+
]),
|
|
204
|
+
);
|
|
205
|
+
for (const objectDef of defineProviderFromData(OBJECT_DEFINITION, OBJECT_FACTORIES)) {
|
|
206
|
+
registry.register(objectDef);
|
|
195
207
|
}
|
|
196
208
|
|
|
197
|
-
// field —
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
new MetaField(new TypeId(TYPE_FIELD, subType), "").dataType),
|
|
223
|
-
);
|
|
209
|
+
// field — 15 subtypes. FR-033 S1-field-B: the field provider's declarative
|
|
210
|
+
// definition (vocabulary + per-subtype attr constraints + the structural child
|
|
211
|
+
// rules + descriptions + rule prose) is externalized to spec/metamodel/field.json,
|
|
212
|
+
// embedded at build into FIELD_DEFINITION. The strict per-subtype model lives
|
|
213
|
+
// entirely in the JSON now: field.base carries the universal core attrs
|
|
214
|
+
// (@required/@readOnly/@default/@unique) + the open validator/view/origin child
|
|
215
|
+
// rules; each concrete subtype sets extendsBase:true (composeWithBase folds the
|
|
216
|
+
// base attrs+childRules in at registration) and adds ONLY its subtype-specific
|
|
217
|
+
// attrs (@maxLength→string, @precision/@scale→decimal, @currency→currency,
|
|
218
|
+
// @objectRef→object, @values/@provided→enum). The "any attr" wildcard child rule
|
|
219
|
+
// is DROPPED (strict/fail-closed) and childRules are NO LONGER post-assigned in
|
|
220
|
+
// code. defineProviderFromData lowers it to TypeDefinitions; the factory
|
|
221
|
+
// (behavior) stays code via FIELD_FACTORIES.
|
|
222
|
+
//
|
|
223
|
+
// (id, name) → MetaField for every field subtype. MetaField computes its own
|
|
224
|
+
// dataType from subType (FIELD_DATA_TYPE getter), so no setDataType is needed;
|
|
225
|
+
// FIELD_DEFINITION.dataType carries the same per-subtype value onto the def.
|
|
226
|
+
const FIELD_FACTORIES: FactoryMap = Object.fromEntries(
|
|
227
|
+
FIELD_SUBTYPES.map((subType) => [
|
|
228
|
+
`${TYPE_FIELD}.${subType}`,
|
|
229
|
+
(typeId: TypeId, name: string) => new MetaField(typeId, name),
|
|
230
|
+
]),
|
|
231
|
+
);
|
|
232
|
+
for (const fieldDef of defineProviderFromData(FIELD_DEFINITION, FIELD_FACTORIES)) {
|
|
233
|
+
registry.register(fieldDef);
|
|
224
234
|
}
|
|
225
235
|
|
|
226
|
-
// attr — 9 subtypes, no children allowed
|
|
227
|
-
//
|
|
228
|
-
//
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
// attr — 9 subtypes, no children allowed, no per-type attrs. FR-033: the attr
|
|
237
|
+
// provider's declarative definition (vocabulary + descriptions + per-subtype
|
|
238
|
+
// dataType) is externalized to spec/metamodel/attr.json, embedded at build into
|
|
239
|
+
// ATTR_DEFINITION. defineProviderFromData lowers it to TypeDefinitions; the
|
|
240
|
+
// factory (behavior) stays code via ATTR_FACTORIES. attrs are leaf value-type
|
|
241
|
+
// vocabulary: no childRules and no attributes, so (unlike field) NO post-assign
|
|
242
|
+
// is needed. Each subtype's class owns its dataType internally (resolved by
|
|
243
|
+
// this.subType); ATTR_DEFINITION.dataType carries the same per-subtype value.
|
|
244
|
+
const ATTR_FACTORIES: FactoryMap = Object.fromEntries(
|
|
245
|
+
ATTR_SUBTYPES.map((subType) => [
|
|
246
|
+
`${TYPE_ATTR}.${subType}`,
|
|
247
|
+
(typeId: TypeId, name: string) => new (attrClassFor(subType))(typeId, name),
|
|
248
|
+
]),
|
|
249
|
+
);
|
|
250
|
+
for (const attrDef of defineProviderFromData(ATTR_DEFINITION, ATTR_FACTORIES)) {
|
|
251
|
+
registry.register(attrDef);
|
|
235
252
|
}
|
|
236
253
|
|
|
237
254
|
// validator — 6 subtypes (base + 5 named); dispatch to subtype-specific class.
|
|
238
|
-
//
|
|
255
|
+
// FR-033: the validator provider's declarative definition (vocabulary +
|
|
256
|
+
// per-subtype attr constraints + descriptions + rule prose) is externalized to
|
|
257
|
+
// spec/metamodel/validator.json, embedded at build into VALIDATOR_DEFINITION.
|
|
258
|
+
// defineProviderFromData lowers it to TypeDefinitions; the factory (behavior)
|
|
259
|
+
// stays code via VALIDATOR_FACTORIES, dispatching subType→class:
|
|
239
260
|
// required → MetaRequiredValidator, length → MetaLengthValidator,
|
|
240
261
|
// regex → MetaRegexValidator, numeric → MetaNumericValidator,
|
|
241
262
|
// array → MetaArrayValidator, default (base) → MetaValidator.
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
//
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)
|
|
263
|
+
// FR-033 S1-simple: validator is an ATTR-ONLY type — its only children are its
|
|
264
|
+
// declared named attrs (no structural children, ever). The "any attr" wildcard
|
|
265
|
+
// child rule is DROPPED (strict/fail-closed); defineProviderFromData leaves
|
|
266
|
+
// childRules EMPTY. The named attrs still enforce strictly via attr-schema-
|
|
267
|
+
// validate (ERR_UNKNOWN_ATTR); a misplaced STRUCTURAL child is now
|
|
268
|
+
// ERR_CHILD_NOT_ALLOWED. Attr schemas: base + length/numeric/array read @min/@max
|
|
269
|
+
// via this.ownAttr(VALIDATOR_ATTR_MIN/MAX); regex also reads @pattern; required
|
|
270
|
+
// has no extra attrs.
|
|
271
|
+
const VALIDATOR_FACTORIES: FactoryMap = Object.fromEntries(
|
|
272
|
+
VALIDATOR_SUBTYPES.map((subType) => [
|
|
273
|
+
`${TYPE_VALIDATOR}.${subType}`,
|
|
274
|
+
(typeId: TypeId, name: string) =>
|
|
275
|
+
new (VALIDATOR_CLASS_MAP.get(subType) ?? MetaValidator)(typeId, name),
|
|
276
|
+
]),
|
|
277
|
+
);
|
|
278
|
+
for (const validatorDef of defineProviderFromData(VALIDATOR_DEFINITION, VALIDATOR_FACTORIES)) {
|
|
279
|
+
registry.register(validatorDef);
|
|
252
280
|
}
|
|
253
281
|
|
|
254
|
-
// view —
|
|
255
|
-
// MetaView only attaches to fields, never
|
|
256
|
-
//
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
282
|
+
// view — 13 subtypes (base + 12 field-level UI/render hints). Each view permits
|
|
283
|
+
// only attr children (Java parity: MetaView only attaches to fields, never
|
|
284
|
+
// aggregates child views).
|
|
285
|
+
// FR-033: the view provider's declarative definition (vocabulary + real
|
|
286
|
+
// per-subtype descriptions + the single @locale attr on view.currency) is
|
|
287
|
+
// externalized to spec/metamodel/view.json, embedded at build into
|
|
288
|
+
// VIEW_DEFINITION. defineProviderFromData lowers it to TypeDefinitions; the
|
|
289
|
+
// factory (behavior) stays code via VIEW_FACTORIES — every subtype maps to the
|
|
290
|
+
// single MetaView class (views carry no per-subtype behavior). Only
|
|
291
|
+
// view.currency carries a documented attr (@locale, default "en-US"); the
|
|
292
|
+
// other 12 subtypes have none. FR-033 S1-simple: view is an ATTR-ONLY type —
|
|
293
|
+
// the "any attr" wildcard child rule is DROPPED (strict/fail-closed) and
|
|
294
|
+
// childRules are left EMPTY; the declared named attrs still enforce strictly,
|
|
295
|
+
// a misplaced STRUCTURAL child is now ERR_CHILD_NOT_ALLOWED.
|
|
296
|
+
const VIEW_FACTORIES: FactoryMap = Object.fromEntries(
|
|
297
|
+
VIEW_SUBTYPES.map((subType) => [
|
|
298
|
+
`${TYPE_VIEW}.${subType}`,
|
|
299
|
+
(typeId: TypeId, name: string) => new MetaView(typeId, name),
|
|
300
|
+
]),
|
|
301
|
+
);
|
|
302
|
+
for (const viewDef of defineProviderFromData(VIEW_DEFINITION, VIEW_FACTORIES)) {
|
|
303
|
+
registry.register(viewDef);
|
|
262
304
|
}
|
|
263
305
|
|
|
264
306
|
// layout — object-level UI surfaces (data grids, forms, tabs, cards).
|
|
265
|
-
//
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
307
|
+
// FR-033: the layout provider's declarative definition (2 subtypes — base +
|
|
308
|
+
// dataGrid — vocabulary + the 6 dataGrid attr constraints + descriptions) is
|
|
309
|
+
// externalized to spec/metamodel/layout.json, embedded at build into
|
|
310
|
+
// LAYOUT_DEFINITION. defineProviderFromData lowers it to TypeDefinitions; the
|
|
311
|
+
// factory (behavior) stays code via LAYOUT_FACTORIES — every subtype maps to
|
|
312
|
+
// the single MetaLayout class (layouts are config carriers, no per-subtype
|
|
313
|
+
// behavior). FR-033 S1-simple: layout is an ATTR-ONLY type — like views,
|
|
314
|
+
// layouts are config carriers — the "any attr" wildcard child rule is DROPPED
|
|
315
|
+
// (strict/fail-closed) and childRules are left EMPTY; the declared named attrs
|
|
316
|
+
// still enforce strictly, a misplaced STRUCTURAL child is now
|
|
317
|
+
// ERR_CHILD_NOT_ALLOWED.
|
|
318
|
+
const LAYOUT_FACTORIES: FactoryMap = Object.fromEntries(
|
|
319
|
+
LAYOUT_SUBTYPES.map((subType) => [
|
|
320
|
+
`${TYPE_LAYOUT}.${subType}`,
|
|
321
|
+
(typeId: TypeId, name: string) => new MetaLayout(typeId, name),
|
|
322
|
+
]),
|
|
323
|
+
);
|
|
324
|
+
for (const layoutDef of defineProviderFromData(LAYOUT_DEFINITION, LAYOUT_FACTORIES)) {
|
|
325
|
+
registry.register(layoutDef);
|
|
271
326
|
}
|
|
272
327
|
|
|
273
|
-
// source — declares where an object's data lives (rdb,
|
|
274
|
-
// Only attr children; sources carry only configuration, never
|
|
275
|
-
//
|
|
276
|
-
//
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
328
|
+
// source — declares where an object's data lives (2 subtypes: base/rdb, per
|
|
329
|
+
// ADR-0007). Only attr children; sources carry only configuration, never
|
|
330
|
+
// nested structure.
|
|
331
|
+
// FR-033: the CORE source registration (the bare source shells + real
|
|
332
|
+
// descriptions + ADR-0007 rules prose) is externalized to
|
|
333
|
+
// spec/metamodel/source.json, embedded at build into SOURCE_DEFINITION.
|
|
334
|
+
// defineProviderFromData lowers it to TypeDefinitions; the factory (behavior)
|
|
335
|
+
// stays code via SOURCE_FACTORIES — a single MetaSource class backs all
|
|
336
|
+
// subtypes. The CORE registration carries NO own attrs (children == []); the
|
|
337
|
+
// per-subtype @table/@kind/@role/@schema/@parameterRef attrs on source.rdb are
|
|
338
|
+
// contributed by a SEPARATE provider (dbProvider, persistence/db) via
|
|
339
|
+
// registry.extend(TYPE_SOURCE, "rdb", ...) — untouched by this conversion.
|
|
340
|
+
// FR-033 S1-simple: source is an ATTR-ONLY type (configuration carrier, never
|
|
341
|
+
// nested structure) — the "any attr" wildcard child rule is DROPPED (strict/
|
|
342
|
+
// fail-closed) and childRules are left EMPTY; the per-subtype @table/@kind/
|
|
343
|
+
// @role/@schema attrs (from dbProvider) still enforce strictly, a misplaced
|
|
344
|
+
// STRUCTURAL child is now ERR_CHILD_NOT_ALLOWED.
|
|
345
|
+
const SOURCE_FACTORIES: FactoryMap = Object.fromEntries(
|
|
346
|
+
SOURCE_SUBTYPES.map((subType) => [
|
|
347
|
+
`${TYPE_SOURCE}.${subType}`,
|
|
348
|
+
(typeId: TypeId, name: string) => new MetaSource(typeId, name),
|
|
349
|
+
]),
|
|
350
|
+
);
|
|
351
|
+
for (const sourceDef of defineProviderFromData(SOURCE_DEFINITION, SOURCE_FACTORIES)) {
|
|
352
|
+
registry.register(sourceDef);
|
|
281
353
|
}
|
|
282
354
|
|
|
283
|
-
// origin — field-level provenance
|
|
284
|
-
//
|
|
355
|
+
// origin — field-level provenance (4 subtypes: base/passthrough/aggregate/
|
|
356
|
+
// collection; only attr children).
|
|
357
|
+
// FR-033: the origin provider's declarative definition (vocabulary +
|
|
358
|
+
// per-subtype attr constraints + real descriptions) is externalized to
|
|
359
|
+
// spec/metamodel/origin.json, embedded at build into ORIGIN_DEFINITION.
|
|
360
|
+
// defineProviderFromData lowers it to TypeDefinitions; the factory (behavior)
|
|
361
|
+
// stays code via ORIGIN_FACTORIES, dispatching subType→class:
|
|
285
362
|
// passthrough → MetaPassthroughOrigin, aggregate → MetaAggregateOrigin,
|
|
286
|
-
// base (and any unmapped subtype) →
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
363
|
+
// collection → MetaCollectionOrigin, base (and any unmapped subtype) →
|
|
364
|
+
// MetaOrigin (fallback).
|
|
365
|
+
// FR-033 S1-simple: origin is an ATTR-ONLY type — the "any attr" wildcard child
|
|
366
|
+
// rule is DROPPED (strict/fail-closed) and childRules are left EMPTY; the named
|
|
367
|
+
// attrs still enforce strictly, a misplaced STRUCTURAL child is now
|
|
368
|
+
// ERR_CHILD_NOT_ALLOWED. Attr schemas: base has none; passthrough adds @from
|
|
369
|
+
// (required) + @via; aggregate adds @agg (required) + @of (required) + @via;
|
|
370
|
+
// collection adds @via (required).
|
|
371
|
+
const ORIGIN_FACTORIES: FactoryMap = Object.fromEntries(
|
|
372
|
+
ORIGIN_SUBTYPES.map((subType) => [
|
|
373
|
+
`${TYPE_ORIGIN}.${subType}`,
|
|
374
|
+
(typeId: TypeId, name: string) =>
|
|
375
|
+
new (ORIGIN_CLASS_MAP.get(subType) ?? MetaOrigin)(typeId, name),
|
|
376
|
+
]),
|
|
377
|
+
);
|
|
378
|
+
for (const originDef of defineProviderFromData(ORIGIN_DEFINITION, ORIGIN_FACTORIES)) {
|
|
379
|
+
registry.register(originDef);
|
|
293
380
|
}
|
|
294
381
|
|
|
295
382
|
// template — renderable text artifacts (FR-004) + tool-call envelopes
|
|
296
|
-
// (ADR-0011).
|
|
297
|
-
// A single MetaTemplate class backs
|
|
383
|
+
// (ADR-0011). Four subtypes: base + prompt + output + toolcall; attr-only
|
|
384
|
+
// children. A single MetaTemplate class backs every subtype (mirrors source);
|
|
298
385
|
// per-subtype attr schemas drive validation (prompt + output require
|
|
299
386
|
// @payloadRef + @textRef + @format closed enum; prompt adds the LLM overlay;
|
|
300
|
-
// toolcall has its own set —
|
|
301
|
-
// @textRef requirement since toolcalls have no
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
387
|
+
// output adds @promptStyle + @kind/email part-refs; toolcall has its own set —
|
|
388
|
+
// @toolName + @payloadRef, no @textRef requirement since toolcalls have no
|
|
389
|
+
// renderable body).
|
|
390
|
+
// FR-033: the template provider's declarative definition (the 4-subtype
|
|
391
|
+
// vocabulary + the full per-subtype attr constraints — incl. @format/@promptStyle/
|
|
392
|
+
// @kind closed-enum allowedValues + defaults + required @payloadRef/@toolName —
|
|
393
|
+
// + real descriptions + the FR-004/ADR-0011 rules prose) is externalized to
|
|
394
|
+
// spec/metamodel/template.json, embedded at build into TEMPLATE_DEFINITION.
|
|
395
|
+
// defineProviderFromData lowers it to TypeDefinitions; the factory (behavior)
|
|
396
|
+
// stays code via TEMPLATE_FACTORIES, mapping every subType → MetaTemplate.
|
|
397
|
+
// FR-033 S2: template's CORE registration carries NO own attrs (children == []);
|
|
398
|
+
// the per-subtype type attrs (@payloadRef/@textRef/@format/@kind/…) on prompt/
|
|
399
|
+
// output/toolcall are contributed by a SEPARATE provider (promptProvider,
|
|
400
|
+
// template/prompt-provider) via registry.extend(TYPE_TEMPLATE, sub, ...). With
|
|
401
|
+
// those attrs re-homed, template is now an ATTR-ONLY type and the "any attr"
|
|
402
|
+
// wildcard child rule is DROPPED (strict completion — like view/layout/source);
|
|
403
|
+
// childRules are left EMPTY, so a misplaced STRUCTURAL child is now
|
|
404
|
+
// ERR_CHILD_NOT_ALLOWED and a non-declared attr is ERR_UNKNOWN_ATTR. Vendor
|
|
405
|
+
// toolcall attrs stay extensible via consumer registry.extend (ADR-0011).
|
|
406
|
+
const TEMPLATE_FACTORIES: FactoryMap = Object.fromEntries(
|
|
407
|
+
TEMPLATE_SUBTYPES.map((subType) => [
|
|
408
|
+
`${TYPE_TEMPLATE}.${subType}`,
|
|
409
|
+
(typeId: TypeId, name: string) => new MetaTemplate(typeId, name),
|
|
410
|
+
]),
|
|
411
|
+
);
|
|
412
|
+
for (const templateDef of defineProviderFromData(TEMPLATE_DEFINITION, TEMPLATE_FACTORIES)) {
|
|
413
|
+
registry.register(templateDef);
|
|
307
414
|
}
|
|
308
415
|
|
|
309
|
-
// identity —
|
|
310
|
-
//
|
|
416
|
+
// identity — 3 subtypes (primary/secondary/reference; no base — Java doesn't
|
|
417
|
+
// register one).
|
|
418
|
+
// FR-033: the identity provider's declarative definition (vocabulary +
|
|
419
|
+
// per-subtype attr constraints + descriptions) is externalized to
|
|
420
|
+
// spec/metamodel/identity.json, embedded at build into IDENTITY_DEFINITION.
|
|
421
|
+
// defineProviderFromData lowers it to TypeDefinitions; the factory (behavior)
|
|
422
|
+
// stays code via IDENTITY_FACTORIES, dispatching subType→class:
|
|
311
423
|
// primary → MetaPrimaryIdentity, secondary → MetaSecondaryIdentity,
|
|
312
|
-
// default → MetaIdentity (fallback
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
424
|
+
// reference → MetaReferenceIdentity, default → MetaIdentity (fallback).
|
|
425
|
+
// FR-033 S1-simple: identity is an ATTR-ONLY type — the "any attr" wildcard
|
|
426
|
+
// child rule is DROPPED (strict/fail-closed) and childRules are left EMPTY; the
|
|
427
|
+
// named attrs still enforce strictly, a misplaced STRUCTURAL child is now
|
|
428
|
+
// ERR_CHILD_NOT_ALLOWED. Attr schemas: all three carry the required @fields;
|
|
429
|
+
// primary adds @generation, secondary @unique, reference @references (required)
|
|
430
|
+
// + @enforce.
|
|
431
|
+
const IDENTITY_FACTORIES: FactoryMap = Object.fromEntries(
|
|
432
|
+
IDENTITY_SUBTYPES.map((subType) => [
|
|
433
|
+
`${TYPE_IDENTITY}.${subType}`,
|
|
434
|
+
(typeId: TypeId, name: string) =>
|
|
435
|
+
new (IDENTITY_CLASS_MAP.get(subType) ?? MetaIdentity)(typeId, name),
|
|
436
|
+
]),
|
|
437
|
+
);
|
|
438
|
+
for (const identityDef of defineProviderFromData(IDENTITY_DEFINITION, IDENTITY_FACTORIES)) {
|
|
439
|
+
registry.register(identityDef);
|
|
319
440
|
}
|
|
320
441
|
|
|
321
|
-
// relationship — 4 subtypes
|
|
442
|
+
// relationship — 4 subtypes (base/association/aggregation/composition), all
|
|
443
|
+
// backed by the single MetaRelationship node class (no subType→class dispatch).
|
|
444
|
+
// FR-033: the relationship provider's declarative definition (vocabulary +
|
|
445
|
+
// the 7 shared attr constraints + real descriptions + the complex M:N rules
|
|
446
|
+
// prose) is externalized to spec/metamodel/relationship.json, embedded at build
|
|
447
|
+
// into RELATIONSHIP_DEFINITION. defineProviderFromData lowers it to
|
|
448
|
+
// TypeDefinitions; the factory (behavior) stays code via RELATIONSHIP_FACTORIES,
|
|
449
|
+
// mapping every subType → MetaRelationship. FR-033 S1-simple: relationship is an
|
|
450
|
+
// ATTR-ONLY type — the "any attr" wildcard child rule is DROPPED (strict/fail-
|
|
451
|
+
// closed) and childRules are left EMPTY; the named attrs still enforce strictly,
|
|
452
|
+
// a misplaced STRUCTURAL child is now ERR_CHILD_NOT_ALLOWED.
|
|
453
|
+
const RELATIONSHIP_FACTORIES: FactoryMap = Object.fromEntries(
|
|
454
|
+
RELATIONSHIP_SUBTYPES.map((subType) => [
|
|
455
|
+
`${TYPE_RELATIONSHIP}.${subType}`,
|
|
456
|
+
(typeId: TypeId, name: string) => new MetaRelationship(typeId, name),
|
|
457
|
+
]),
|
|
458
|
+
);
|
|
459
|
+
for (const relationshipDef of defineProviderFromData(
|
|
460
|
+
RELATIONSHIP_DEFINITION,
|
|
461
|
+
RELATIONSHIP_FACTORIES,
|
|
462
|
+
)) {
|
|
463
|
+
registry.register(relationshipDef);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Declare the core cross-references ON their TypeDefinitions, so the loader's
|
|
467
|
+
// registry-derived validation resolves them generically (a dangling target fails the
|
|
468
|
+
// load). Set on the concrete subtypes the parser produces. (Production moves these into
|
|
469
|
+
// the embedded spec/metamodel JSON once every port's spec reader carries the field.)
|
|
322
470
|
for (const subType of RELATIONSHIP_SUBTYPES) {
|
|
323
|
-
registry.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
471
|
+
const def = registry.find(TYPE_RELATIONSHIP, subType);
|
|
472
|
+
if (def) {
|
|
473
|
+
def.references = [
|
|
474
|
+
{ attr: RELATIONSHIP_ATTR_OBJECT_REF, targetType: TYPE_OBJECT, errorCode: "ERR_INVALID_RELATIONSHIP" },
|
|
475
|
+
];
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
const idRefDef = registry.find(TYPE_IDENTITY, IDENTITY_SUBTYPE_REFERENCE);
|
|
479
|
+
if (idRefDef) {
|
|
480
|
+
idRefDef.references = [
|
|
481
|
+
{
|
|
482
|
+
attr: IDENTITY_REFERENCE_ATTR_REFERENCES,
|
|
483
|
+
targetType: TYPE_OBJECT,
|
|
484
|
+
dottedFieldPath: true,
|
|
485
|
+
errorCode: "ERR_INVALID_REFERENCE",
|
|
486
|
+
},
|
|
487
|
+
];
|
|
333
488
|
}
|
|
334
489
|
|
|
335
490
|
// Default subTypes for YAML authoring sugar: a bare `metadata:` / `object:`
|
|
@@ -354,9 +509,18 @@ export const coreTypesProvider: MetaDataTypeProvider = {
|
|
|
354
509
|
},
|
|
355
510
|
};
|
|
356
511
|
|
|
357
|
-
/** The default provider bundle — core metamodel types plus
|
|
358
|
-
*
|
|
359
|
-
|
|
512
|
+
/** The default provider bundle — core metamodel types plus the four concern
|
|
513
|
+
* providers (DB-domain attrs, documentation common-attrs, prompt/AI + the
|
|
514
|
+
* UI/query-surface markers). FR-033 S1-field-A re-homed the field's
|
|
515
|
+
* filter/sort/teaching/extract/storage attrs out of core into db/ui/prompt;
|
|
516
|
+
* the composed set is unchanged. Spread it to add more: `[...coreProviders, mine]`. */
|
|
517
|
+
export const coreProviders: readonly MetaDataTypeProvider[] = [
|
|
518
|
+
coreTypesProvider,
|
|
519
|
+
dbProvider,
|
|
520
|
+
docProvider,
|
|
521
|
+
promptProvider,
|
|
522
|
+
uiProvider,
|
|
523
|
+
];
|
|
360
524
|
|
|
361
525
|
/**
|
|
362
526
|
* Register the core metamodel into an existing registry. Thin convenience
|