@metaobjectsdev/metadata 0.9.0-rc.1 → 0.10.0
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 +84 -7
- package/dist/attr-schema-validate.js.map +1 -1
- package/dist/constants.d.ts +208 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +419 -0
- package/dist/constants.js.map +1 -0
- 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/doc-schema.d.ts +1 -1
- package/dist/core/documentation/doc-schema.d.ts.map +1 -1
- package/dist/core/documentation/doc-schema.js +13 -5
- package/dist/core/documentation/doc-schema.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/field-schema.d.ts +0 -16
- package/dist/core/field/field-schema.d.ts.map +1 -1
- package/dist/core/field/field-schema.js +10 -158
- package/dist/core/field/field-schema.js.map +1 -1
- 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/file-meta-data-loader.d.ts +18 -0
- package/dist/core/file-meta-data-loader.d.ts.map +1 -0
- package/dist/core/file-meta-data-loader.js +81 -0
- package/dist/core/file-meta-data-loader.js.map +1 -0
- package/dist/core/file-source.d.ts +12 -0
- package/dist/core/file-source.d.ts.map +1 -0
- package/dist/core/file-source.js +46 -0
- package/dist/core/file-source.js.map +1 -0
- 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 +91 -0
- package/dist/core/identity/identity-definition.embedded.js.map +1 -0
- package/dist/core/identity/identity-schema.d.ts.map +1 -1
- package/dist/core/identity/identity-schema.js +3 -2
- package/dist/core/identity/identity-schema.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/relationship/relationship-schema.d.ts.map +1 -1
- package/dist/core/relationship/relationship-schema.js +13 -7
- package/dist/core/relationship/relationship-schema.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 +134 -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-attr-schemas.d.ts +22 -0
- package/dist/core-attr-schemas.d.ts.map +1 -0
- package/dist/core-attr-schemas.js +324 -0
- package/dist/core-attr-schemas.js.map +1 -0
- package/dist/core-types.d.ts +5 -2
- package/dist/core-types.d.ts.map +1 -1
- package/dist/core-types.js +261 -115
- package/dist/core-types.js.map +1 -1
- package/dist/db/db-attr-schemas.d.ts +8 -0
- package/dist/db/db-attr-schemas.d.ts.map +1 -0
- package/dist/db/db-attr-schemas.js +26 -0
- package/dist/db/db-attr-schemas.js.map +1 -0
- package/dist/db/db-provider.d.ts +3 -0
- package/dist/db/db-provider.d.ts.map +1 -0
- package/dist/db/db-provider.js +28 -0
- package/dist/db/db-provider.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +78 -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 +47 -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 +513 -33
- package/dist/loader/validation-passes.js.map +1 -1
- package/dist/meta/find-reference.d.ts +22 -0
- package/dist/meta/find-reference.d.ts.map +1 -0
- package/dist/meta/find-reference.js +29 -0
- package/dist/meta/find-reference.js.map +1 -0
- package/dist/meta/meta-attr.d.ts +8 -0
- package/dist/meta/meta-attr.d.ts.map +1 -0
- package/dist/meta/meta-attr.js +17 -0
- package/dist/meta/meta-attr.js.map +1 -0
- package/dist/meta/meta-data.d.ts +107 -0
- package/dist/meta/meta-data.d.ts.map +1 -0
- package/dist/meta/meta-data.js +302 -0
- package/dist/meta/meta-data.js.map +1 -0
- package/dist/meta/meta-field.d.ts +48 -0
- package/dist/meta/meta-field.d.ts.map +1 -0
- package/dist/meta/meta-field.js +94 -0
- package/dist/meta/meta-field.js.map +1 -0
- package/dist/meta/meta-identity.d.ts +71 -0
- package/dist/meta/meta-identity.d.ts.map +1 -0
- package/dist/meta/meta-identity.js +129 -0
- package/dist/meta/meta-identity.js.map +1 -0
- package/dist/meta/meta-layout.d.ts +23 -0
- package/dist/meta/meta-layout.d.ts.map +1 -0
- package/dist/meta/meta-layout.js +45 -0
- package/dist/meta/meta-layout.js.map +1 -0
- package/dist/meta/meta-object.d.ts +40 -0
- package/dist/meta/meta-object.d.ts.map +1 -0
- package/dist/meta/meta-object.js +81 -0
- package/dist/meta/meta-object.js.map +1 -0
- package/dist/meta/meta-origin.d.ts +32 -0
- package/dist/meta/meta-origin.d.ts.map +1 -0
- package/dist/meta/meta-origin.js +55 -0
- package/dist/meta/meta-origin.js.map +1 -0
- package/dist/meta/meta-relationship.d.ts +11 -0
- package/dist/meta/meta-relationship.d.ts.map +1 -0
- package/dist/meta/meta-relationship.js +27 -0
- package/dist/meta/meta-relationship.js.map +1 -0
- package/dist/meta/meta-root.d.ts +12 -0
- package/dist/meta/meta-root.d.ts.map +1 -0
- package/dist/meta/meta-root.js +24 -0
- package/dist/meta/meta-root.js.map +1 -0
- package/dist/meta/meta-source.d.ts +18 -0
- package/dist/meta/meta-source.d.ts.map +1 -0
- package/dist/meta/meta-source.js +31 -0
- package/dist/meta/meta-source.js.map +1 -0
- package/dist/meta/meta-validator.d.ts +29 -0
- package/dist/meta/meta-validator.d.ts.map +1 -0
- package/dist/meta/meta-validator.js +49 -0
- package/dist/meta/meta-validator.js.map +1 -0
- package/dist/meta/meta-view.d.ts +4 -0
- package/dist/meta/meta-view.d.ts.map +1 -0
- package/dist/meta/meta-view.js +8 -0
- package/dist/meta/meta-view.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 +74 -8
- package/dist/parser-core.js.map +1 -1
- package/dist/persistence/db/db-attr-schemas.d.ts +8 -0
- package/dist/persistence/db/db-attr-schemas.d.ts.map +1 -0
- package/dist/persistence/db/db-attr-schemas.js +28 -0
- package/dist/persistence/db/db-attr-schemas.js.map +1 -0
- 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 +170 -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/db/db-schema.d.ts +14 -0
- package/dist/persistence/db/db-schema.d.ts.map +1 -1
- package/dist/persistence/db/db-schema.js +27 -0
- package/dist/persistence/db/db-schema.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/origin/origin-schema.d.ts.map +1 -1
- package/dist/persistence/origin/origin-schema.js +7 -3
- package/dist/persistence/origin/origin-schema.js.map +1 -1
- 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/layout/layout-schema.d.ts.map +1 -1
- package/dist/presentation/layout/layout-schema.js +3 -2
- package/dist/presentation/layout/layout-schema.js.map +1 -1
- 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/ui/ui-schema.d.ts +10 -0
- package/dist/presentation/ui/ui-schema.d.ts.map +1 -0
- package/dist/presentation/ui/ui-schema.js +41 -0
- package/dist/presentation/ui/ui-schema.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 +169 -0
- package/dist/provider-data.d.ts.map +1 -0
- package/dist/provider-data.js +269 -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 +60 -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/prompt-schema.d.ts +20 -0
- package/dist/template/prompt-schema.d.ts.map +1 -0
- package/dist/template/prompt-schema.js +70 -0
- package/dist/template/prompt-schema.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/template/template-schema.d.ts.map +1 -1
- package/dist/template/template-schema.js +12 -4
- package/dist/template/template-schema.js.map +1 -1
- package/package.json +33 -22
- package/src/attr-schema-validate.ts +96 -4
- 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-definition.embedded.ts +98 -0
- 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-definition.embedded.ts +141 -0
- package/src/core/yaml-desugar.ts +96 -7
- package/src/core-types.ts +289 -150
- package/src/errors.ts +78 -0
- 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 +66 -7
- package/src/loader/shortcuts.ts +2 -2
- package/src/loader/validation-passes.ts +679 -33
- 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 +86 -8
- package/src/persistence/db/db-definition.embedded.ts +177 -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 +446 -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 +90 -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/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
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
// Field attribute schemas — attrs common to every field subtype, plus the
|
|
2
|
-
// @currency attr specific to field.currency. Consumed by registerCoreTypes().
|
|
3
|
-
|
|
4
|
-
import type { AttrSchema } from "../../registry.js";
|
|
5
|
-
import {
|
|
6
|
-
ATTR_SUBTYPE_STRING,
|
|
7
|
-
ATTR_SUBTYPE_INT,
|
|
8
|
-
ATTR_SUBTYPE_BOOLEAN,
|
|
9
|
-
ATTR_SUBTYPE_STRINGARRAY,
|
|
10
|
-
ATTR_SUBTYPE_PROPERTIES,
|
|
11
|
-
} from "../attr/attr-constants.js";
|
|
12
|
-
import { SORT_ORDER_VALUES } from "../query/query-constants.js";
|
|
13
|
-
import {
|
|
14
|
-
FIELD_ATTR_OBJECT_REF,
|
|
15
|
-
FIELD_ATTR_STORAGE,
|
|
16
|
-
STORAGE_VALUES,
|
|
17
|
-
FIELD_ATTR_REQUIRED,
|
|
18
|
-
FIELD_ATTR_READ_ONLY,
|
|
19
|
-
FIELD_ATTR_UNIQUE,
|
|
20
|
-
FIELD_ATTR_DEFAULT,
|
|
21
|
-
FIELD_ATTR_MAX_LENGTH,
|
|
22
|
-
FIELD_ATTR_PRECISION,
|
|
23
|
-
FIELD_ATTR_SCALE,
|
|
24
|
-
FIELD_ATTR_FILTERABLE,
|
|
25
|
-
FIELD_ATTR_SORTABLE,
|
|
26
|
-
FIELD_ATTR_SORTABLE_DEFAULT_ORDER,
|
|
27
|
-
FIELD_ATTR_CURRENCY,
|
|
28
|
-
FIELD_ATTR_CURRENCY_DEFAULT,
|
|
29
|
-
FIELD_ATTR_AUTO_SET,
|
|
30
|
-
AUTO_SET_VALUES,
|
|
31
|
-
FIELD_ATTR_VALUES,
|
|
32
|
-
FIELD_ATTR_ENUM_ALIAS,
|
|
33
|
-
FIELD_ATTR_ENUM_DOC,
|
|
34
|
-
FIELD_ATTR_EXAMPLE,
|
|
35
|
-
FIELD_ATTR_INSTRUCTION,
|
|
36
|
-
FIELD_ATTR_COERCE_DEFAULT,
|
|
37
|
-
FIELD_ATTR_NORMALIZE,
|
|
38
|
-
NORMALIZE_MODES,
|
|
39
|
-
NORMALIZE_DEFAULT,
|
|
40
|
-
} from "./field-constants.js";
|
|
41
|
-
|
|
42
|
-
/** Attrs common to every field subtype (codegen-ts column mapper + Project D filter/sort). */
|
|
43
|
-
export const commonFieldAttrs: AttrSchema[] = [
|
|
44
|
-
{
|
|
45
|
-
name: FIELD_ATTR_OBJECT_REF,
|
|
46
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
47
|
-
required: false,
|
|
48
|
-
description:
|
|
49
|
-
"Name (or FQN) of the target object an object-typed field nests — drives nested-object (de)serialization.",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: FIELD_ATTR_STORAGE,
|
|
53
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
54
|
-
required: false,
|
|
55
|
-
allowedValues: [...STORAGE_VALUES],
|
|
56
|
-
description:
|
|
57
|
-
"Storage strategy for an object-typed field (set with @objectRef). " +
|
|
58
|
-
"\"flattened\" expands the nested value into prefixed columns on the parent " +
|
|
59
|
-
"table. \"jsonb\" stores the structured value in a single jsonb column " +
|
|
60
|
-
"(supports isArray=true for arrays of values). \"subdocument\" is a hint for " +
|
|
61
|
-
"document-store codegen targets and emits no Postgres column.",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: FIELD_ATTR_REQUIRED,
|
|
65
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
66
|
-
required: false,
|
|
67
|
-
description:
|
|
68
|
-
"When true, the field is NOT NULL. Equivalent to attaching a validator.required child.",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: FIELD_ATTR_READ_ONLY,
|
|
72
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
73
|
-
required: false,
|
|
74
|
-
description:
|
|
75
|
-
"FR-013: when true, the field is read-only — codegen emits no setter / " +
|
|
76
|
-
"writable property, the persistence layer skips the column on INSERT/UPDATE, " +
|
|
77
|
-
"and Zod/Pydantic/class-validator schemas mark it read-only on input variants. " +
|
|
78
|
-
"The value is populated by the database (computed column, default expression, " +
|
|
79
|
-
"trigger), by replication, or by another external owner.",
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: FIELD_ATTR_UNIQUE,
|
|
83
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
84
|
-
required: false,
|
|
85
|
-
description: "When true, the field gets a column-level UNIQUE constraint.",
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: FIELD_ATTR_DEFAULT,
|
|
89
|
-
// @default is polymorphic: its value type follows the OWNING field's
|
|
90
|
-
// subtype — a boolean field defaults to a boolean, an int field to a
|
|
91
|
-
// number, a string field to a string. No single fixed valueType can
|
|
92
|
-
// capture that, so valueType is intentionally omitted (declared-but-untyped).
|
|
93
|
-
// The parser stores the raw JSON value type-preserved (no coercion).
|
|
94
|
-
// Typed conversion happens at consumption time via MetaField.defaultValue(),
|
|
95
|
-
// which applies the field's own DataType — Java parity with
|
|
96
|
-
// MetaField.getDefaultValue() / DataConverter.toTypeSafe(getDataType(), o).
|
|
97
|
-
required: false,
|
|
98
|
-
description:
|
|
99
|
-
"Default value applied to the column when no value is supplied. Its type follows the field's own subtype (string / boolean / number / ...). Converted at consumption time via MetaField.defaultValue().",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: FIELD_ATTR_MAX_LENGTH,
|
|
103
|
-
valueType: ATTR_SUBTYPE_INT,
|
|
104
|
-
required: false,
|
|
105
|
-
description: "Maximum character length for string-typed fields (drives VARCHAR(n)).",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: FIELD_ATTR_PRECISION,
|
|
109
|
-
valueType: ATTR_SUBTYPE_INT,
|
|
110
|
-
required: false,
|
|
111
|
-
description: "Total number of significant digits for decimal-typed fields.",
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: FIELD_ATTR_SCALE,
|
|
115
|
-
valueType: ATTR_SUBTYPE_INT,
|
|
116
|
-
required: false,
|
|
117
|
-
description: "Number of digits to the right of the decimal point for decimal-typed fields.",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: FIELD_ATTR_FILTERABLE,
|
|
121
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
122
|
-
required: false,
|
|
123
|
-
description:
|
|
124
|
-
"When true, the field is exposed in generated CRUD filter allowlists (Project D filter layer).",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: FIELD_ATTR_SORTABLE,
|
|
128
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
129
|
-
required: false,
|
|
130
|
-
description:
|
|
131
|
-
"When true, the field is exposed in generated CRUD sort allowlists. Inherits from @filterable by default; set false to opt out.",
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: FIELD_ATTR_SORTABLE_DEFAULT_ORDER,
|
|
135
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
136
|
-
required: false,
|
|
137
|
-
allowedValues: [...SORT_ORDER_VALUES],
|
|
138
|
-
description: "Default sort direction applied when this field is the default sort field.",
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: FIELD_ATTR_AUTO_SET,
|
|
142
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
143
|
-
required: false,
|
|
144
|
-
allowedValues: [...AUTO_SET_VALUES],
|
|
145
|
-
description:
|
|
146
|
-
"Auto-set semantics for timestamp-like fields: 'onCreate' stamps on insert, 'onUpdate' stamps on every write.",
|
|
147
|
-
},
|
|
148
|
-
// FR-010 field-teaching attrs (any field): free-text shown in the generated
|
|
149
|
-
// output-format prompt fragment. Never carried in comments.
|
|
150
|
-
{
|
|
151
|
-
name: FIELD_ATTR_EXAMPLE,
|
|
152
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
153
|
-
required: false,
|
|
154
|
-
description:
|
|
155
|
-
"FR-010: an example value for this field, shown in the generated output-format prompt fragment.",
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: FIELD_ATTR_INSTRUCTION,
|
|
159
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
160
|
-
required: false,
|
|
161
|
-
description:
|
|
162
|
-
"FR-010: a short instruction for this field, shown in the generated output-format prompt fragment.",
|
|
163
|
-
},
|
|
164
|
-
];
|
|
165
|
-
|
|
166
|
-
/** The @currency attr — only on field.currency. */
|
|
167
|
-
export const currencyFieldAttr: AttrSchema = {
|
|
168
|
-
name: FIELD_ATTR_CURRENCY,
|
|
169
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
170
|
-
required: false,
|
|
171
|
-
default: FIELD_ATTR_CURRENCY_DEFAULT,
|
|
172
|
-
description:
|
|
173
|
-
"ISO 4217 currency code for a currency-subtype field. Storage is integer minor units; defaults to 'USD' when omitted.",
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
/** The @values attr — only on field.enum. Required string array. */
|
|
177
|
-
export const enumFieldAttr: AttrSchema = {
|
|
178
|
-
name: FIELD_ATTR_VALUES,
|
|
179
|
-
valueType: ATTR_SUBTYPE_STRINGARRAY,
|
|
180
|
-
required: true,
|
|
181
|
-
description:
|
|
182
|
-
"Member symbols of an enum-subtype field. Declaration order is significant; each is a legal identifier and its own stored string.",
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
/** The @enumAlias attr — only on field.enum. Map of off-vocabulary token → canonical
|
|
186
|
-
* member, feeding the FR-010 tolerant extract alias-fold (runtime aliases win on conflict). */
|
|
187
|
-
export const enumAliasAttr: AttrSchema = {
|
|
188
|
-
name: FIELD_ATTR_ENUM_ALIAS,
|
|
189
|
-
valueType: ATTR_SUBTYPE_PROPERTIES,
|
|
190
|
-
required: false,
|
|
191
|
-
description:
|
|
192
|
-
"Map of alternate/off-vocabulary tokens to canonical enum members; feeds the FR-010 tolerant extract alias-fold.",
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
/** The @enumDoc attr — only on field.enum. Map of member → human-readable description,
|
|
196
|
-
* shown per-member in the FR-010 'guide'-style output-format prompt fragment. */
|
|
197
|
-
export const enumDocAttr: AttrSchema = {
|
|
198
|
-
name: FIELD_ATTR_ENUM_DOC,
|
|
199
|
-
valueType: ATTR_SUBTYPE_PROPERTIES,
|
|
200
|
-
required: false,
|
|
201
|
-
description:
|
|
202
|
-
"Map of enum member to a human-readable description; shown per-member in the FR-010 'guide'-style prompt fragment.",
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/** FR-011: the @coerceDefault attr — only on field.enum. String member symbol used as
|
|
206
|
-
* the extract fallback when an LLM sends a present-but-uncoercible value. Loader-validated
|
|
207
|
-
* to be one of the field's @values (ERR_BAD_ATTR_VALUE otherwise). */
|
|
208
|
-
export const coerceDefaultAttr: AttrSchema = {
|
|
209
|
-
name: FIELD_ATTR_COERCE_DEFAULT,
|
|
210
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
211
|
-
required: false,
|
|
212
|
-
description:
|
|
213
|
-
"Fallback enum member used by tolerant extract when a present value cannot be coerced; must be one of the field's @values.",
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
/** FR-011: the @normalize attr — on field.enum (per-field) and object.value (object default).
|
|
217
|
-
* Closed enum (none|collapse|strip); controls the ASCII normalization applied during tolerant
|
|
218
|
-
* enum extract. Resolved field → owning object.value → global default (strip). */
|
|
219
|
-
export const normalizeAttr: AttrSchema = {
|
|
220
|
-
name: FIELD_ATTR_NORMALIZE,
|
|
221
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
222
|
-
required: false,
|
|
223
|
-
default: NORMALIZE_DEFAULT,
|
|
224
|
-
allowedValues: [...NORMALIZE_MODES],
|
|
225
|
-
description:
|
|
226
|
-
"ASCII normalization mode for tolerant enum extract (none|collapse|strip, default strip). " +
|
|
227
|
-
"On field.enum it is per-field; on object.value it is the default for the object's enum fields.",
|
|
228
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Identity attribute schemas — per-subtype attr inventories for identity types.
|
|
2
|
-
// Consumed by registerCoreTypes().
|
|
3
|
-
|
|
4
|
-
import type { AttrSchema } from "../../registry.js";
|
|
5
|
-
import {
|
|
6
|
-
ATTR_SUBTYPE_STRING,
|
|
7
|
-
ATTR_SUBTYPE_BOOLEAN,
|
|
8
|
-
ATTR_SUBTYPE_STRINGARRAY,
|
|
9
|
-
} from "../attr/attr-constants.js";
|
|
10
|
-
import {
|
|
11
|
-
IDENTITY_SUBTYPE_PRIMARY,
|
|
12
|
-
IDENTITY_SUBTYPE_SECONDARY,
|
|
13
|
-
IDENTITY_SUBTYPE_REFERENCE,
|
|
14
|
-
IDENTITY_ATTR_FIELDS,
|
|
15
|
-
IDENTITY_ATTR_GENERATION,
|
|
16
|
-
IDENTITY_ATTR_UNIQUE,
|
|
17
|
-
IDENTITY_REFERENCE_ATTR_REFERENCES,
|
|
18
|
-
IDENTITY_REFERENCE_ATTR_ENFORCE,
|
|
19
|
-
GENERATION_VALUES,
|
|
20
|
-
} from "./identity-constants.js";
|
|
21
|
-
|
|
22
|
-
/** Attrs on identity.primary / identity.secondary — @fields is required. */
|
|
23
|
-
export const identityFieldsAttr: AttrSchema = {
|
|
24
|
-
name: IDENTITY_ATTR_FIELDS,
|
|
25
|
-
valueType: ATTR_SUBTYPE_STRINGARRAY,
|
|
26
|
-
required: true,
|
|
27
|
-
description:
|
|
28
|
-
"The field name(s) composing this identity. Single-element for a simple PK/index, multiple for a composite.",
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const primaryIdentityAttrs: AttrSchema[] = [
|
|
32
|
-
{ ...identityFieldsAttr },
|
|
33
|
-
{
|
|
34
|
-
name: IDENTITY_ATTR_GENERATION,
|
|
35
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
36
|
-
required: false,
|
|
37
|
-
allowedValues: [...GENERATION_VALUES],
|
|
38
|
-
description:
|
|
39
|
-
"Primary-key value generation strategy: 'increment' (auto-increment), 'uuid', or 'assigned' (caller-supplied).",
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
const secondaryIdentityAttrs: AttrSchema[] = [
|
|
44
|
-
{ ...identityFieldsAttr },
|
|
45
|
-
{
|
|
46
|
-
name: IDENTITY_ATTR_UNIQUE,
|
|
47
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
48
|
-
required: false,
|
|
49
|
-
description:
|
|
50
|
-
"When true (default), the secondary identity is a UNIQUE index; false makes it a plain (non-unique) index.",
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
const referenceIdentityAttrs: AttrSchema[] = [
|
|
55
|
-
{ ...identityFieldsAttr },
|
|
56
|
-
{
|
|
57
|
-
name: IDENTITY_REFERENCE_ATTR_REFERENCES,
|
|
58
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
59
|
-
required: true,
|
|
60
|
-
description:
|
|
61
|
-
"Target of the reference. Bare entity name (e.g. 'Program') resolves to that entity's primary identity. " +
|
|
62
|
-
"Dotted forms ('Program.id' or 'Program.fieldA,fieldB') target an explicit field set on the entity.",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: IDENTITY_REFERENCE_ATTR_ENFORCE,
|
|
66
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
67
|
-
required: false,
|
|
68
|
-
description:
|
|
69
|
-
"When true (default), the backend physically enforces the reference (SQL FK constraint, " +
|
|
70
|
-
"document validation rule, graph edge guarantee). Set false to declare a logical reference " +
|
|
71
|
-
"for navigation/typing/codegen only — the value may dangle at the backend level.",
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
|
|
75
|
-
/** Attrs per identity subtype. primary adds @generation; secondary adds @unique. */
|
|
76
|
-
export const IDENTITY_ATTRS_MAP = new Map<string, AttrSchema[]>([
|
|
77
|
-
[IDENTITY_SUBTYPE_PRIMARY, [...primaryIdentityAttrs]],
|
|
78
|
-
[IDENTITY_SUBTYPE_SECONDARY, [...secondaryIdentityAttrs]],
|
|
79
|
-
[IDENTITY_SUBTYPE_REFERENCE, [...referenceIdentityAttrs]],
|
|
80
|
-
]);
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Object attribute schemas — attrs common to every object subtype.
|
|
2
|
-
// Consumed by registerCoreTypes().
|
|
3
|
-
|
|
4
|
-
import type { AttrSchema } from "../../registry.js";
|
|
5
|
-
import { ATTR_SUBTYPE_STRING } from "../attr/attr-constants.js";
|
|
6
|
-
import {
|
|
7
|
-
OBJECT_ATTR_DISCRIMINATOR,
|
|
8
|
-
OBJECT_ATTR_DISCRIMINATOR_VALUE,
|
|
9
|
-
} from "./object-constants.js";
|
|
10
|
-
|
|
11
|
-
/** Attrs common to every object subtype. */
|
|
12
|
-
export const objectAttrs: AttrSchema[] = [
|
|
13
|
-
{
|
|
14
|
-
name: OBJECT_ATTR_DISCRIMINATOR,
|
|
15
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
16
|
-
required: false,
|
|
17
|
-
description:
|
|
18
|
-
"FR-014: names the field on this entity (resolvable via extends:) that " +
|
|
19
|
-
"holds the subtype-discriminator value. Subtypes of this entity declare " +
|
|
20
|
-
"@discriminatorValue to bind their rows to a discriminator value. The " +
|
|
21
|
-
"discriminator field itself is an ordinary field declaration (typically " +
|
|
22
|
-
"field.enum or field.int / field.string).",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: OBJECT_ATTR_DISCRIMINATOR_VALUE,
|
|
26
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
27
|
-
required: false,
|
|
28
|
-
description:
|
|
29
|
-
"FR-014: on a subtype of an entity with @discriminator — the value that " +
|
|
30
|
-
"identifies rows of this subtype in the shared discriminator field. Wire " +
|
|
31
|
-
"form is always a string; the underlying field's subtype (enum / int / " +
|
|
32
|
-
"string) controls codegen + storage coercion. Required on every concrete " +
|
|
33
|
-
"subtype of a discriminated entity.",
|
|
34
|
-
},
|
|
35
|
-
];
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Relationship attribute schemas — attrs common to every relationship subtype.
|
|
2
|
-
// Consumed by registerCoreTypes().
|
|
3
|
-
|
|
4
|
-
import type { AttrSchema } from "../../registry.js";
|
|
5
|
-
import {
|
|
6
|
-
ATTR_SUBTYPE_STRING,
|
|
7
|
-
ATTR_SUBTYPE_STRINGARRAY,
|
|
8
|
-
} from "../attr/attr-constants.js";
|
|
9
|
-
import {
|
|
10
|
-
RELATIONSHIP_ATTR_CARDINALITY,
|
|
11
|
-
RELATIONSHIP_ATTR_OBJECT_REF,
|
|
12
|
-
RELATIONSHIP_ATTR_JOIN_ENTITY,
|
|
13
|
-
RELATIONSHIP_ATTR_JOIN_FIELDS,
|
|
14
|
-
RELATIONSHIP_ATTR_ON_DELETE,
|
|
15
|
-
RELATIONSHIP_ATTR_ON_UPDATE,
|
|
16
|
-
REFERENTIAL_ACTIONS,
|
|
17
|
-
} from "./relationship-constants.js";
|
|
18
|
-
|
|
19
|
-
/** Attrs common to every relationship subtype. */
|
|
20
|
-
export const relationshipAttrs: AttrSchema[] = [
|
|
21
|
-
{
|
|
22
|
-
name: RELATIONSHIP_ATTR_CARDINALITY,
|
|
23
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
24
|
-
required: false,
|
|
25
|
-
// No allowedValues: @cardinality is an open string at the metamodel level
|
|
26
|
-
// (MetaRelationship.cardinality returns `string | undefined`). The Java
|
|
27
|
-
// canonical fixtures use composite forms such as "many-to-one"; the
|
|
28
|
-
// CARDINALITY_VALUES ("one"/"many") constant is a TS codegen convenience,
|
|
29
|
-
// NOT a closed metamodel enum. A3 must not reject the Java-canonical values.
|
|
30
|
-
description:
|
|
31
|
-
"Cardinality of the relationship target (e.g. 'one', 'many', 'many-to-one').",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: RELATIONSHIP_ATTR_OBJECT_REF,
|
|
35
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
36
|
-
required: false,
|
|
37
|
-
description:
|
|
38
|
-
"Name or fully-qualified name of the target object the relationship points to (e.g. 'Week' or 'acme::vehicle::Car').",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: RELATIONSHIP_ATTR_JOIN_ENTITY,
|
|
42
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
43
|
-
required: false,
|
|
44
|
-
description: "Join-table entity name for N:M relationships.",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: RELATIONSHIP_ATTR_JOIN_FIELDS,
|
|
48
|
-
valueType: ATTR_SUBTYPE_STRINGARRAY,
|
|
49
|
-
required: false,
|
|
50
|
-
description: "Join-table column names for N:M relationships.",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: RELATIONSHIP_ATTR_ON_DELETE,
|
|
54
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
55
|
-
required: false,
|
|
56
|
-
allowedValues: [...REFERENTIAL_ACTIONS],
|
|
57
|
-
description:
|
|
58
|
-
"Referential action on parent delete. Default derives from subtype (composition→cascade, aggregation→set-null, association→restrict).",
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: RELATIONSHIP_ATTR_ON_UPDATE,
|
|
62
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
63
|
-
required: false,
|
|
64
|
-
allowedValues: [...REFERENTIAL_ACTIONS],
|
|
65
|
-
description: "Referential action on key update. Default cascade.",
|
|
66
|
-
},
|
|
67
|
-
];
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Validator attribute schemas — per-subtype attr inventories for validator types.
|
|
2
|
-
// Consumed by registerCoreTypes().
|
|
3
|
-
|
|
4
|
-
import type { AttrSchema } from "../../registry.js";
|
|
5
|
-
import { ATTR_SUBTYPE_INT, ATTR_SUBTYPE_STRING } from "../attr/attr-constants.js";
|
|
6
|
-
import { SUBTYPE_BASE } from "../../shared/base-types.js";
|
|
7
|
-
import {
|
|
8
|
-
VALIDATOR_SUBTYPE_REQUIRED,
|
|
9
|
-
VALIDATOR_SUBTYPE_LENGTH,
|
|
10
|
-
VALIDATOR_SUBTYPE_REGEX,
|
|
11
|
-
VALIDATOR_SUBTYPE_NUMERIC,
|
|
12
|
-
VALIDATOR_SUBTYPE_ARRAY,
|
|
13
|
-
VALIDATOR_ATTR_PATTERN,
|
|
14
|
-
VALIDATOR_ATTR_MIN,
|
|
15
|
-
VALIDATOR_ATTR_MAX,
|
|
16
|
-
} from "./validator-constants.js";
|
|
17
|
-
|
|
18
|
-
/** @min / @max shared by length, numeric, array, and the base validator. */
|
|
19
|
-
const minMaxValidatorAttrs: AttrSchema[] = [
|
|
20
|
-
{
|
|
21
|
-
name: VALIDATOR_ATTR_MIN,
|
|
22
|
-
valueType: ATTR_SUBTYPE_INT,
|
|
23
|
-
required: false,
|
|
24
|
-
description: "Minimum allowed value (length, numeric value, or array element count depending on the validator subtype).",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: VALIDATOR_ATTR_MAX,
|
|
28
|
-
valueType: ATTR_SUBTYPE_INT,
|
|
29
|
-
required: false,
|
|
30
|
-
description: "Maximum allowed value (length, numeric value, or array element count depending on the validator subtype).",
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
/** Attrs per validator subtype. Required uses none; regex adds @pattern. */
|
|
35
|
-
export const VALIDATOR_ATTRS_MAP = new Map<string, AttrSchema[]>([
|
|
36
|
-
[SUBTYPE_BASE, [...minMaxValidatorAttrs]],
|
|
37
|
-
[VALIDATOR_SUBTYPE_REQUIRED, []],
|
|
38
|
-
[VALIDATOR_SUBTYPE_LENGTH, [...minMaxValidatorAttrs]],
|
|
39
|
-
[VALIDATOR_SUBTYPE_REGEX, [
|
|
40
|
-
...minMaxValidatorAttrs,
|
|
41
|
-
{
|
|
42
|
-
name: VALIDATOR_ATTR_PATTERN,
|
|
43
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
44
|
-
required: false,
|
|
45
|
-
description: "Regular expression the value must match.",
|
|
46
|
-
},
|
|
47
|
-
]],
|
|
48
|
-
[VALIDATOR_SUBTYPE_NUMERIC, [...minMaxValidatorAttrs]],
|
|
49
|
-
[VALIDATOR_SUBTYPE_ARRAY, [...minMaxValidatorAttrs]],
|
|
50
|
-
]);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// DB-domain attribute schemas — registered by dbProvider (db-provider.ts),
|
|
2
|
-
// not the core metamodel.
|
|
3
|
-
|
|
4
|
-
import type { AttrSchema } from "../../registry.js";
|
|
5
|
-
import {
|
|
6
|
-
ATTR_SUBTYPE_STRING,
|
|
7
|
-
ATTR_SUBTYPE_BOOLEAN,
|
|
8
|
-
} from "../../core/attr/attr-constants.js";
|
|
9
|
-
import {
|
|
10
|
-
FIELD_ATTR_COLUMN,
|
|
11
|
-
FIELD_ATTR_DB_INDEXED,
|
|
12
|
-
FIELD_ATTR_DB_COLUMN_TYPE,
|
|
13
|
-
DB_COLUMN_TYPE_VALUES,
|
|
14
|
-
} from "./db-constants.js";
|
|
15
|
-
|
|
16
|
-
/** `@column` — column-name override on every field subtype (source.rdb). */
|
|
17
|
-
export const columnSchema: AttrSchema = {
|
|
18
|
-
name: FIELD_ATTR_COLUMN,
|
|
19
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
20
|
-
required: false,
|
|
21
|
-
description:
|
|
22
|
-
"Physical column name for this field on an rdb source. Defaults to the field name via columnNamingStrategy.",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/** `@db.indexed` — suppress the @filterable-without-index warning; on every field subtype. */
|
|
26
|
-
export const dbIndexedSchema: AttrSchema = {
|
|
27
|
-
name: FIELD_ATTR_DB_INDEXED,
|
|
28
|
-
valueType: ATTR_SUBTYPE_BOOLEAN,
|
|
29
|
-
required: false,
|
|
30
|
-
description:
|
|
31
|
-
"When true, suppress the @filterable-without-index Loader warning (the field is indexed by other means).",
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* R6 Plan 2b: `@dbColumnType` — physical DB column-type override on every field
|
|
36
|
-
* subtype. The legal value depends on the field's logical subtype, so the
|
|
37
|
-
* subtype × value pairing is validated own-only by the loader
|
|
38
|
-
* (validateAttrSchema → ERR_BAD_ATTR_VALUE), not by a flat `allowedValues` set.
|
|
39
|
-
* The string valueType keeps the schema's type check intact.
|
|
40
|
-
*/
|
|
41
|
-
export const dbColumnTypeSchema: AttrSchema = {
|
|
42
|
-
name: FIELD_ATTR_DB_COLUMN_TYPE,
|
|
43
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
44
|
-
required: false,
|
|
45
|
-
description:
|
|
46
|
-
"Physical DB column-type override (ADR-0013 escape hatch). Legal values are " +
|
|
47
|
-
`${DB_COLUMN_TYPE_VALUES.join(" | ")}, each legal only on a specific logical ` +
|
|
48
|
-
"field subtype (uuid/jsonb on field.string, timestamp_with_tz on field.timestamp). " +
|
|
49
|
-
"The logical field type and its native binding are unchanged.",
|
|
50
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Origin attribute schemas — per-subtype attr inventories for origin types.
|
|
2
|
-
// Consumed by registerCoreTypes().
|
|
3
|
-
|
|
4
|
-
import type { AttrSchema } from "../../registry.js";
|
|
5
|
-
import { ATTR_SUBTYPE_STRING } from "../../core/attr/attr-constants.js";
|
|
6
|
-
import { SUBTYPE_BASE } from "../../shared/base-types.js";
|
|
7
|
-
import {
|
|
8
|
-
ORIGIN_SUBTYPE_PASSTHROUGH,
|
|
9
|
-
ORIGIN_SUBTYPE_AGGREGATE,
|
|
10
|
-
ORIGIN_SUBTYPE_COLLECTION,
|
|
11
|
-
ORIGIN_PASSTHROUGH_ATTR_FROM,
|
|
12
|
-
ORIGIN_PASSTHROUGH_ATTR_VIA,
|
|
13
|
-
ORIGIN_AGGREGATE_ATTR_AGG,
|
|
14
|
-
ORIGIN_AGGREGATE_ATTR_OF,
|
|
15
|
-
ORIGIN_AGGREGATE_ATTR_VIA,
|
|
16
|
-
ORIGIN_COLLECTION_ATTR_VIA,
|
|
17
|
-
AGGREGATE_FUNCTIONS,
|
|
18
|
-
} from "./origin-constants.js";
|
|
19
|
-
|
|
20
|
-
/** Attrs on origin.passthrough — @from is required. */
|
|
21
|
-
const passthroughOriginAttrs: AttrSchema[] = [
|
|
22
|
-
{
|
|
23
|
-
name: ORIGIN_PASSTHROUGH_ATTR_FROM,
|
|
24
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
25
|
-
required: true,
|
|
26
|
-
description:
|
|
27
|
-
"Dotted Entity.field reference identifying the source value this projection field passes through (e.g. 'Program.title').",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: ORIGIN_PASSTHROUGH_ATTR_VIA,
|
|
31
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
32
|
-
required: false,
|
|
33
|
-
description:
|
|
34
|
-
"Optional dotted relationship path used to reach the source entity (e.g. 'Program.weeks').",
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
/** Attrs on origin.aggregate — @agg, @of, @via all required. */
|
|
39
|
-
const aggregateOriginAttrs: AttrSchema[] = [
|
|
40
|
-
{
|
|
41
|
-
name: ORIGIN_AGGREGATE_ATTR_AGG,
|
|
42
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
43
|
-
required: true,
|
|
44
|
-
allowedValues: [...AGGREGATE_FUNCTIONS],
|
|
45
|
-
description: "Aggregate function applied over the relationship path: count, sum, avg, min, or max.",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: ORIGIN_AGGREGATE_ATTR_OF,
|
|
49
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
50
|
-
required: true,
|
|
51
|
-
description:
|
|
52
|
-
"Dotted Entity.field reference identifying the column being aggregated (e.g. 'Week.durationMinutes').",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: ORIGIN_AGGREGATE_ATTR_VIA,
|
|
56
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
57
|
-
required: true,
|
|
58
|
-
description:
|
|
59
|
-
"Dotted relationship path from the base entity to the aggregated rows (e.g. 'Program.weeks' or 'Program.weeks.workouts').",
|
|
60
|
-
},
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
/** Attrs on origin.collection — @via (the relationship path) is required. */
|
|
64
|
-
const collectionOriginAttrs: AttrSchema[] = [
|
|
65
|
-
{
|
|
66
|
-
name: ORIGIN_COLLECTION_ATTR_VIA,
|
|
67
|
-
valueType: ATTR_SUBTYPE_STRING,
|
|
68
|
-
required: true,
|
|
69
|
-
description:
|
|
70
|
-
"Dotted relationship path the collection walks to produce an array of nested view-objects (e.g. 'Author.posts'), or a wildcard selector for a package-spanning collection (e.g. '*.User').",
|
|
71
|
-
},
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
/** Attrs per origin subtype. base has none; the others carry their respective attrs. */
|
|
75
|
-
export const ORIGIN_ATTRS_MAP = new Map<string, AttrSchema[]>([
|
|
76
|
-
[SUBTYPE_BASE, []],
|
|
77
|
-
[ORIGIN_SUBTYPE_PASSTHROUGH, [...passthroughOriginAttrs]],
|
|
78
|
-
[ORIGIN_SUBTYPE_AGGREGATE, [...aggregateOriginAttrs]],
|
|
79
|
-
[ORIGIN_SUBTYPE_COLLECTION, [...collectionOriginAttrs]],
|
|
80
|
-
]);
|