@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
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate-embedded-metamodel.ts — DO NOT EDIT.
|
|
2
|
+
// Canonical source: repo-root spec/metamodel/relationship.json
|
|
3
|
+
// Regenerate: bun run scripts/generate-embedded-metamodel.ts
|
|
4
|
+
//
|
|
5
|
+
// Embeds the canonical FR-033 ProviderDefinition so the provider can register
|
|
6
|
+
// itself wherever the on-disk spec/ tree is unavailable (bundled builds).
|
|
7
|
+
import type { ProviderDefinition } from "../../provider-data.js";
|
|
8
|
+
|
|
9
|
+
export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
|
|
10
|
+
"provider": "metaobjects-core-types",
|
|
11
|
+
"types": [
|
|
12
|
+
{
|
|
13
|
+
"type": "relationship",
|
|
14
|
+
"subType": "base",
|
|
15
|
+
"description": "Abstract relationship base — shared shape for the concrete association/aggregation/composition subtypes; not authored directly.",
|
|
16
|
+
"rules": "@cardinality is an open string at the metamodel level ('one'/'many', and Java-canonical composite forms such as 'many-to-one'); @objectRef names the target entity. M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. @onDelete/@onUpdate carry referential actions (cascade/set-null/restrict/no-action).",
|
|
17
|
+
"children": [
|
|
18
|
+
{
|
|
19
|
+
"type": "attr",
|
|
20
|
+
"subType": "string",
|
|
21
|
+
"name": "cardinality",
|
|
22
|
+
"min": 0,
|
|
23
|
+
"max": 1,
|
|
24
|
+
"description": "Cardinality of the relationship target (e.g. 'one', 'many', 'many-to-one')."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "attr",
|
|
28
|
+
"subType": "string",
|
|
29
|
+
"name": "objectRef",
|
|
30
|
+
"min": 0,
|
|
31
|
+
"max": 1,
|
|
32
|
+
"description": "Name or fully-qualified name of the target object the relationship points to (e.g. 'Week' or 'acme::vehicle::Car')."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "attr",
|
|
36
|
+
"subType": "string",
|
|
37
|
+
"name": "through",
|
|
38
|
+
"min": 0,
|
|
39
|
+
"max": 1,
|
|
40
|
+
"description": "Junction (through) entity name for M:N relationships — a third entity declaring two identity.reference children, one per FK side. The relationship's FK fields are derived from those references."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "attr",
|
|
44
|
+
"subType": "string",
|
|
45
|
+
"name": "sourceRefField",
|
|
46
|
+
"min": 0,
|
|
47
|
+
"max": 1,
|
|
48
|
+
"description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "attr",
|
|
52
|
+
"subType": "boolean",
|
|
53
|
+
"name": "symmetric",
|
|
54
|
+
"min": 0,
|
|
55
|
+
"max": 1,
|
|
56
|
+
"description": "Undirected self-join flag (union-on-read). Valid only when @objectRef == the declaring entity. Mutually exclusive with @sourceRefField."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "attr",
|
|
60
|
+
"subType": "string",
|
|
61
|
+
"name": "onDelete",
|
|
62
|
+
"min": 0,
|
|
63
|
+
"max": 1,
|
|
64
|
+
"allowedValues": [
|
|
65
|
+
"cascade",
|
|
66
|
+
"set-null",
|
|
67
|
+
"restrict",
|
|
68
|
+
"no-action"
|
|
69
|
+
],
|
|
70
|
+
"description": "Referential action on parent delete. Default derives from subtype (composition→cascade, aggregation→set-null, association→restrict)."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "attr",
|
|
74
|
+
"subType": "string",
|
|
75
|
+
"name": "onUpdate",
|
|
76
|
+
"min": 0,
|
|
77
|
+
"max": 1,
|
|
78
|
+
"allowedValues": [
|
|
79
|
+
"cascade",
|
|
80
|
+
"set-null",
|
|
81
|
+
"restrict",
|
|
82
|
+
"no-action"
|
|
83
|
+
],
|
|
84
|
+
"description": "Referential action on key update. Default cascade."
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"type": "relationship",
|
|
90
|
+
"subType": "association",
|
|
91
|
+
"description": "A plain reference to another entity — no ownership; the target has an independent lifecycle (default @onDelete restrict).",
|
|
92
|
+
"rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Association is a plain reference — the target's lifecycle is independent (default @onDelete restrict).",
|
|
93
|
+
"children": [
|
|
94
|
+
{
|
|
95
|
+
"type": "attr",
|
|
96
|
+
"subType": "string",
|
|
97
|
+
"name": "cardinality",
|
|
98
|
+
"min": 0,
|
|
99
|
+
"max": 1,
|
|
100
|
+
"description": "Cardinality of the relationship target (e.g. 'one', 'many', 'many-to-one')."
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"type": "attr",
|
|
104
|
+
"subType": "string",
|
|
105
|
+
"name": "objectRef",
|
|
106
|
+
"min": 0,
|
|
107
|
+
"max": 1,
|
|
108
|
+
"description": "Name or fully-qualified name of the target object the relationship points to (e.g. 'Week' or 'acme::vehicle::Car')."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"type": "attr",
|
|
112
|
+
"subType": "string",
|
|
113
|
+
"name": "through",
|
|
114
|
+
"min": 0,
|
|
115
|
+
"max": 1,
|
|
116
|
+
"description": "Junction (through) entity name for M:N relationships — a third entity declaring two identity.reference children, one per FK side. The relationship's FK fields are derived from those references."
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "attr",
|
|
120
|
+
"subType": "string",
|
|
121
|
+
"name": "sourceRefField",
|
|
122
|
+
"min": 0,
|
|
123
|
+
"max": 1,
|
|
124
|
+
"description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"type": "attr",
|
|
128
|
+
"subType": "boolean",
|
|
129
|
+
"name": "symmetric",
|
|
130
|
+
"min": 0,
|
|
131
|
+
"max": 1,
|
|
132
|
+
"description": "Undirected self-join flag (union-on-read). Valid only when @objectRef == the declaring entity. Mutually exclusive with @sourceRefField."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"type": "attr",
|
|
136
|
+
"subType": "string",
|
|
137
|
+
"name": "onDelete",
|
|
138
|
+
"min": 0,
|
|
139
|
+
"max": 1,
|
|
140
|
+
"allowedValues": [
|
|
141
|
+
"cascade",
|
|
142
|
+
"set-null",
|
|
143
|
+
"restrict",
|
|
144
|
+
"no-action"
|
|
145
|
+
],
|
|
146
|
+
"description": "Referential action on parent delete. Default derives from subtype (composition→cascade, aggregation→set-null, association→restrict)."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"type": "attr",
|
|
150
|
+
"subType": "string",
|
|
151
|
+
"name": "onUpdate",
|
|
152
|
+
"min": 0,
|
|
153
|
+
"max": 1,
|
|
154
|
+
"allowedValues": [
|
|
155
|
+
"cascade",
|
|
156
|
+
"set-null",
|
|
157
|
+
"restrict",
|
|
158
|
+
"no-action"
|
|
159
|
+
],
|
|
160
|
+
"description": "Referential action on key update. Default cascade."
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"type": "relationship",
|
|
166
|
+
"subType": "aggregation",
|
|
167
|
+
"description": "A shared/independent containment — the parent groups the target but does not own its lifecycle (default @onDelete set-null).",
|
|
168
|
+
"rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Aggregation is shared/independent — the target outlives the parent (default @onDelete set-null).",
|
|
169
|
+
"children": [
|
|
170
|
+
{
|
|
171
|
+
"type": "attr",
|
|
172
|
+
"subType": "string",
|
|
173
|
+
"name": "cardinality",
|
|
174
|
+
"min": 0,
|
|
175
|
+
"max": 1,
|
|
176
|
+
"description": "Cardinality of the relationship target (e.g. 'one', 'many', 'many-to-one')."
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"type": "attr",
|
|
180
|
+
"subType": "string",
|
|
181
|
+
"name": "objectRef",
|
|
182
|
+
"min": 0,
|
|
183
|
+
"max": 1,
|
|
184
|
+
"description": "Name or fully-qualified name of the target object the relationship points to (e.g. 'Week' or 'acme::vehicle::Car')."
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"type": "attr",
|
|
188
|
+
"subType": "string",
|
|
189
|
+
"name": "through",
|
|
190
|
+
"min": 0,
|
|
191
|
+
"max": 1,
|
|
192
|
+
"description": "Junction (through) entity name for M:N relationships — a third entity declaring two identity.reference children, one per FK side. The relationship's FK fields are derived from those references."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"type": "attr",
|
|
196
|
+
"subType": "string",
|
|
197
|
+
"name": "sourceRefField",
|
|
198
|
+
"min": 0,
|
|
199
|
+
"max": 1,
|
|
200
|
+
"description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"type": "attr",
|
|
204
|
+
"subType": "boolean",
|
|
205
|
+
"name": "symmetric",
|
|
206
|
+
"min": 0,
|
|
207
|
+
"max": 1,
|
|
208
|
+
"description": "Undirected self-join flag (union-on-read). Valid only when @objectRef == the declaring entity. Mutually exclusive with @sourceRefField."
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "attr",
|
|
212
|
+
"subType": "string",
|
|
213
|
+
"name": "onDelete",
|
|
214
|
+
"min": 0,
|
|
215
|
+
"max": 1,
|
|
216
|
+
"allowedValues": [
|
|
217
|
+
"cascade",
|
|
218
|
+
"set-null",
|
|
219
|
+
"restrict",
|
|
220
|
+
"no-action"
|
|
221
|
+
],
|
|
222
|
+
"description": "Referential action on parent delete. Default derives from subtype (composition→cascade, aggregation→set-null, association→restrict)."
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"type": "attr",
|
|
226
|
+
"subType": "string",
|
|
227
|
+
"name": "onUpdate",
|
|
228
|
+
"min": 0,
|
|
229
|
+
"max": 1,
|
|
230
|
+
"allowedValues": [
|
|
231
|
+
"cascade",
|
|
232
|
+
"set-null",
|
|
233
|
+
"restrict",
|
|
234
|
+
"no-action"
|
|
235
|
+
],
|
|
236
|
+
"description": "Referential action on key update. Default cascade."
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"type": "relationship",
|
|
242
|
+
"subType": "composition",
|
|
243
|
+
"description": "An owned containment — the parent owns the target's lifecycle; deleting the parent deletes the children (default @onDelete cascade).",
|
|
244
|
+
"rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Composition is owned lifecycle — the children do not outlive the parent (default @onDelete cascade).",
|
|
245
|
+
"children": [
|
|
246
|
+
{
|
|
247
|
+
"type": "attr",
|
|
248
|
+
"subType": "string",
|
|
249
|
+
"name": "cardinality",
|
|
250
|
+
"min": 0,
|
|
251
|
+
"max": 1,
|
|
252
|
+
"description": "Cardinality of the relationship target (e.g. 'one', 'many', 'many-to-one')."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"type": "attr",
|
|
256
|
+
"subType": "string",
|
|
257
|
+
"name": "objectRef",
|
|
258
|
+
"min": 0,
|
|
259
|
+
"max": 1,
|
|
260
|
+
"description": "Name or fully-qualified name of the target object the relationship points to (e.g. 'Week' or 'acme::vehicle::Car')."
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"type": "attr",
|
|
264
|
+
"subType": "string",
|
|
265
|
+
"name": "through",
|
|
266
|
+
"min": 0,
|
|
267
|
+
"max": 1,
|
|
268
|
+
"description": "Junction (through) entity name for M:N relationships — a third entity declaring two identity.reference children, one per FK side. The relationship's FK fields are derived from those references."
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"type": "attr",
|
|
272
|
+
"subType": "string",
|
|
273
|
+
"name": "sourceRefField",
|
|
274
|
+
"min": 0,
|
|
275
|
+
"max": 1,
|
|
276
|
+
"description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"type": "attr",
|
|
280
|
+
"subType": "boolean",
|
|
281
|
+
"name": "symmetric",
|
|
282
|
+
"min": 0,
|
|
283
|
+
"max": 1,
|
|
284
|
+
"description": "Undirected self-join flag (union-on-read). Valid only when @objectRef == the declaring entity. Mutually exclusive with @sourceRefField."
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"type": "attr",
|
|
288
|
+
"subType": "string",
|
|
289
|
+
"name": "onDelete",
|
|
290
|
+
"min": 0,
|
|
291
|
+
"max": 1,
|
|
292
|
+
"allowedValues": [
|
|
293
|
+
"cascade",
|
|
294
|
+
"set-null",
|
|
295
|
+
"restrict",
|
|
296
|
+
"no-action"
|
|
297
|
+
],
|
|
298
|
+
"description": "Referential action on parent delete. Default derives from subtype (composition→cascade, aggregation→set-null, association→restrict)."
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"type": "attr",
|
|
302
|
+
"subType": "string",
|
|
303
|
+
"name": "onUpdate",
|
|
304
|
+
"min": 0,
|
|
305
|
+
"max": 1,
|
|
306
|
+
"allowedValues": [
|
|
307
|
+
"cascade",
|
|
308
|
+
"set-null",
|
|
309
|
+
"restrict",
|
|
310
|
+
"no-action"
|
|
311
|
+
],
|
|
312
|
+
"description": "Referential action on key update. Default cascade."
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { SUBTYPE_BASE } from "../../shared/base-types.js";
|
|
4
4
|
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
6
|
-
// Validator subtypes (
|
|
6
|
+
// Validator subtypes (10)
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
export const VALIDATOR_SUBTYPE_REQUIRED = "required";
|
|
@@ -11,6 +11,11 @@ export const VALIDATOR_SUBTYPE_LENGTH = "length";
|
|
|
11
11
|
export const VALIDATOR_SUBTYPE_REGEX = "regex";
|
|
12
12
|
export const VALIDATOR_SUBTYPE_NUMERIC = "numeric";
|
|
13
13
|
export const VALIDATOR_SUBTYPE_ARRAY = "array";
|
|
14
|
+
// Cross-field validators — entity-scoped, reference sibling fields by name.
|
|
15
|
+
export const VALIDATOR_SUBTYPE_COMPARISON = "comparison";
|
|
16
|
+
export const VALIDATOR_SUBTYPE_REQUIRED_WHEN = "requiredWhen";
|
|
17
|
+
export const VALIDATOR_SUBTYPE_PRESENT_IFF = "presentIff";
|
|
18
|
+
export const VALIDATOR_SUBTYPE_AT_LEAST_ONE = "atLeastOne";
|
|
14
19
|
|
|
15
20
|
export const VALIDATOR_SUBTYPES = [
|
|
16
21
|
SUBTYPE_BASE,
|
|
@@ -19,6 +24,10 @@ export const VALIDATOR_SUBTYPES = [
|
|
|
19
24
|
VALIDATOR_SUBTYPE_REGEX,
|
|
20
25
|
VALIDATOR_SUBTYPE_NUMERIC,
|
|
21
26
|
VALIDATOR_SUBTYPE_ARRAY,
|
|
27
|
+
VALIDATOR_SUBTYPE_COMPARISON,
|
|
28
|
+
VALIDATOR_SUBTYPE_REQUIRED_WHEN,
|
|
29
|
+
VALIDATOR_SUBTYPE_PRESENT_IFF,
|
|
30
|
+
VALIDATOR_SUBTYPE_AT_LEAST_ONE,
|
|
22
31
|
] as const;
|
|
23
32
|
export type ValidatorSubType = (typeof VALIDATOR_SUBTYPES)[number];
|
|
24
33
|
|
|
@@ -29,3 +38,15 @@ export type ValidatorSubType = (typeof VALIDATOR_SUBTYPES)[number];
|
|
|
29
38
|
export const VALIDATOR_ATTR_PATTERN = "pattern";
|
|
30
39
|
export const VALIDATOR_ATTR_MIN = "min";
|
|
31
40
|
export const VALIDATOR_ATTR_MAX = "max";
|
|
41
|
+
// Cross-field validator attrs (field references by name + operator/value).
|
|
42
|
+
export const VALIDATOR_ATTR_LEFT = "left";
|
|
43
|
+
export const VALIDATOR_ATTR_OP = "op";
|
|
44
|
+
export const VALIDATOR_ATTR_RIGHT = "right";
|
|
45
|
+
export const VALIDATOR_ATTR_FIELD = "field";
|
|
46
|
+
export const VALIDATOR_ATTR_WHEN = "when";
|
|
47
|
+
export const VALIDATOR_ATTR_EQUALS = "equals";
|
|
48
|
+
export const VALIDATOR_ATTR_FIELDS = "fields";
|
|
49
|
+
|
|
50
|
+
// Comparison operators (@op allowed values) → relational operator.
|
|
51
|
+
export const VALIDATOR_COMPARISON_OPS = ["gt", "gte", "lt", "lte", "ne", "eq"] as const;
|
|
52
|
+
export type ComparisonOp = (typeof VALIDATOR_COMPARISON_OPS)[number];
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate-embedded-metamodel.ts — DO NOT EDIT.
|
|
2
|
+
// Canonical source: repo-root spec/metamodel/validator.json
|
|
3
|
+
// Regenerate: bun run scripts/generate-embedded-metamodel.ts
|
|
4
|
+
//
|
|
5
|
+
// Embeds the canonical FR-033 ProviderDefinition so the provider can register
|
|
6
|
+
// itself wherever the on-disk spec/ tree is unavailable (bundled builds).
|
|
7
|
+
import type { ProviderDefinition } from "../../provider-data.js";
|
|
8
|
+
|
|
9
|
+
export const VALIDATOR_DEFINITION: ProviderDefinition = {
|
|
10
|
+
"provider": "metaobjects-core-types",
|
|
11
|
+
"types": [
|
|
12
|
+
{
|
|
13
|
+
"type": "validator",
|
|
14
|
+
"subType": "base",
|
|
15
|
+
"description": "Abstract base validator — the shared root subtype concrete validators specialize. Carries the @min/@max bounds attrs but enforces no rule of its own.",
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"type": "attr",
|
|
19
|
+
"subType": "int",
|
|
20
|
+
"name": "min",
|
|
21
|
+
"min": 0,
|
|
22
|
+
"max": 1,
|
|
23
|
+
"description": "Minimum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "attr",
|
|
27
|
+
"subType": "int",
|
|
28
|
+
"name": "max",
|
|
29
|
+
"min": 0,
|
|
30
|
+
"max": 1,
|
|
31
|
+
"description": "Maximum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "validator",
|
|
37
|
+
"subType": "required",
|
|
38
|
+
"description": "Fails when the value is null/empty (NOT NULL). Equivalent to @required on the owning field."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "validator",
|
|
42
|
+
"subType": "length",
|
|
43
|
+
"description": "Bounds string length / collection size via @min/@max.",
|
|
44
|
+
"children": [
|
|
45
|
+
{
|
|
46
|
+
"type": "attr",
|
|
47
|
+
"subType": "int",
|
|
48
|
+
"name": "min",
|
|
49
|
+
"min": 0,
|
|
50
|
+
"max": 1,
|
|
51
|
+
"description": "Minimum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "attr",
|
|
55
|
+
"subType": "int",
|
|
56
|
+
"name": "max",
|
|
57
|
+
"min": 0,
|
|
58
|
+
"max": 1,
|
|
59
|
+
"description": "Maximum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"type": "validator",
|
|
65
|
+
"subType": "regex",
|
|
66
|
+
"description": "Requires the value match a regular expression (@pattern).",
|
|
67
|
+
"children": [
|
|
68
|
+
{
|
|
69
|
+
"type": "attr",
|
|
70
|
+
"subType": "int",
|
|
71
|
+
"name": "min",
|
|
72
|
+
"min": 0,
|
|
73
|
+
"max": 1,
|
|
74
|
+
"description": "Minimum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "attr",
|
|
78
|
+
"subType": "int",
|
|
79
|
+
"name": "max",
|
|
80
|
+
"min": 0,
|
|
81
|
+
"max": 1,
|
|
82
|
+
"description": "Maximum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"type": "attr",
|
|
86
|
+
"subType": "string",
|
|
87
|
+
"name": "pattern",
|
|
88
|
+
"min": 0,
|
|
89
|
+
"max": 1,
|
|
90
|
+
"description": "Regular expression the value must match."
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"type": "validator",
|
|
96
|
+
"subType": "numeric",
|
|
97
|
+
"description": "Bounds a numeric value's magnitude via @min/@max.",
|
|
98
|
+
"children": [
|
|
99
|
+
{
|
|
100
|
+
"type": "attr",
|
|
101
|
+
"subType": "int",
|
|
102
|
+
"name": "min",
|
|
103
|
+
"min": 0,
|
|
104
|
+
"max": 1,
|
|
105
|
+
"description": "Minimum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"type": "attr",
|
|
109
|
+
"subType": "int",
|
|
110
|
+
"name": "max",
|
|
111
|
+
"min": 0,
|
|
112
|
+
"max": 1,
|
|
113
|
+
"description": "Maximum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "validator",
|
|
119
|
+
"subType": "array",
|
|
120
|
+
"description": "Bounds the element count of an array-valued field via @min/@max.",
|
|
121
|
+
"children": [
|
|
122
|
+
{
|
|
123
|
+
"type": "attr",
|
|
124
|
+
"subType": "int",
|
|
125
|
+
"name": "min",
|
|
126
|
+
"min": 0,
|
|
127
|
+
"max": 1,
|
|
128
|
+
"description": "Minimum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "attr",
|
|
132
|
+
"subType": "int",
|
|
133
|
+
"name": "max",
|
|
134
|
+
"min": 0,
|
|
135
|
+
"max": 1,
|
|
136
|
+
"description": "Maximum allowed value (length, numeric value, or array element count depending on the validator subtype)."
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"type": "validator",
|
|
142
|
+
"subType": "comparison",
|
|
143
|
+
"description": "Cross-field ordering: requires two sibling fields of the owning entity stand in a relational order (@left @op @right), e.g. current_hp <= max_hp or expires_at > created_at. Entity-scoped; references fields by name. Backends derive the rule (CHECK constraint, cross-field assertion) — no raw expression is stored.",
|
|
144
|
+
"rules": "@left and @right must name fields of the owning entity. @op is one of gt/gte/lt/lte/ne/eq. The comparison is null-tolerant where the backend's relational operator is (SQL: a NULL operand yields no violation).",
|
|
145
|
+
"children": [
|
|
146
|
+
{
|
|
147
|
+
"type": "attr",
|
|
148
|
+
"subType": "string",
|
|
149
|
+
"name": "left",
|
|
150
|
+
"min": 1,
|
|
151
|
+
"max": 1,
|
|
152
|
+
"description": "Name of the left-hand field of the owning entity."
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"type": "attr",
|
|
156
|
+
"subType": "string",
|
|
157
|
+
"name": "op",
|
|
158
|
+
"min": 1,
|
|
159
|
+
"max": 1,
|
|
160
|
+
"allowedValues": [
|
|
161
|
+
"gt",
|
|
162
|
+
"gte",
|
|
163
|
+
"lt",
|
|
164
|
+
"lte",
|
|
165
|
+
"ne",
|
|
166
|
+
"eq"
|
|
167
|
+
],
|
|
168
|
+
"description": "Relational operator: gt (>), gte (>=), lt (<), lte (<=), ne (<>), eq (=)."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"type": "attr",
|
|
172
|
+
"subType": "string",
|
|
173
|
+
"name": "right",
|
|
174
|
+
"min": 1,
|
|
175
|
+
"max": 1,
|
|
176
|
+
"description": "Name of the right-hand field of the owning entity."
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"type": "validator",
|
|
182
|
+
"subType": "requiredWhen",
|
|
183
|
+
"description": "One-directional conditional presence: when the gating field (@when) equals @equals, the target field (@field) must be present (NOT NULL); otherwise @field is unconstrained. Mirrors JSON Schema dependentRequired / Rails validates_presence_of :x, if:. Entity-scoped; references fields by name.",
|
|
184
|
+
"rules": "@field and @when must name fields of the owning entity. @equals is the gating value, compared against @when's value (rendered per @when's field subtype — boolean true/false, enum/string literal, numeric literal).",
|
|
185
|
+
"children": [
|
|
186
|
+
{
|
|
187
|
+
"type": "attr",
|
|
188
|
+
"subType": "string",
|
|
189
|
+
"name": "field",
|
|
190
|
+
"min": 1,
|
|
191
|
+
"max": 1,
|
|
192
|
+
"description": "Name of the field that becomes required when the condition holds."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"type": "attr",
|
|
196
|
+
"subType": "string",
|
|
197
|
+
"name": "when",
|
|
198
|
+
"min": 1,
|
|
199
|
+
"max": 1,
|
|
200
|
+
"description": "Name of the gating field whose value triggers the requirement."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"type": "attr",
|
|
204
|
+
"subType": "string",
|
|
205
|
+
"name": "equals",
|
|
206
|
+
"min": 1,
|
|
207
|
+
"max": 1,
|
|
208
|
+
"description": "The gating value; when @when equals this, @field must be present."
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "validator",
|
|
214
|
+
"subType": "presentIff",
|
|
215
|
+
"description": "Biconditional presence: the target field (@field) is present (NOT NULL) if and only if the gating field (@when) equals @equals. Models paired flag/companion-column invariants, e.g. used_at present iff is_used=true. Entity-scoped; references fields by name.",
|
|
216
|
+
"rules": "@field and @when must name fields of the owning entity. @equals is rendered per @when's field subtype. Stricter than requiredWhen — also forbids @field when the condition is false.",
|
|
217
|
+
"children": [
|
|
218
|
+
{
|
|
219
|
+
"type": "attr",
|
|
220
|
+
"subType": "string",
|
|
221
|
+
"name": "field",
|
|
222
|
+
"min": 1,
|
|
223
|
+
"max": 1,
|
|
224
|
+
"description": "Name of the field whose presence is governed by the condition."
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"type": "attr",
|
|
228
|
+
"subType": "string",
|
|
229
|
+
"name": "when",
|
|
230
|
+
"min": 1,
|
|
231
|
+
"max": 1,
|
|
232
|
+
"description": "Name of the gating field."
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"type": "attr",
|
|
236
|
+
"subType": "string",
|
|
237
|
+
"name": "equals",
|
|
238
|
+
"min": 1,
|
|
239
|
+
"max": 1,
|
|
240
|
+
"description": "The gating value; @field is present exactly when @when equals this."
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"type": "validator",
|
|
246
|
+
"subType": "atLeastOne",
|
|
247
|
+
"description": "Cardinality of presence: at least one of the named fields (@fields) must be present (NOT NULL). Entity-scoped; references fields by name (same @fields-by-name pattern as identity.*).",
|
|
248
|
+
"rules": "@fields names two or more fields of the owning entity. Satisfied when any one of them is non-null.",
|
|
249
|
+
"children": [
|
|
250
|
+
{
|
|
251
|
+
"type": "attr",
|
|
252
|
+
"subType": "string",
|
|
253
|
+
"name": "fields",
|
|
254
|
+
"isArray": true,
|
|
255
|
+
"min": 1,
|
|
256
|
+
"max": 1,
|
|
257
|
+
"description": "Names of the candidate fields; at least one must be present."
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
};
|