@metaobjectsdev/metadata 0.5.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +189 -0
- package/README.md +29 -0
- package/dist/attr-class-map.d.ts +26 -0
- package/dist/attr-class-map.d.ts.map +1 -0
- package/dist/attr-class-map.js +44 -0
- package/dist/attr-class-map.js.map +1 -0
- package/dist/attr-schema-validate.d.ts +9 -0
- package/dist/attr-schema-validate.d.ts.map +1 -0
- package/dist/attr-schema-validate.js +100 -0
- package/dist/attr-schema-validate.js.map +1 -0
- 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/core/attr/attr-constants.d.ts +12 -0
- package/dist/core/attr/attr-constants.d.ts.map +1 -0
- package/dist/core/attr/attr-constants.js +27 -0
- package/dist/core/attr/attr-constants.js.map +1 -0
- package/dist/core/attr/meta-attr-filter.d.ts +10 -0
- package/dist/core/attr/meta-attr-filter.d.ts.map +1 -0
- package/dist/core/attr/meta-attr-filter.js +56 -0
- package/dist/core/attr/meta-attr-filter.js.map +1 -0
- package/dist/core/attr/meta-attr-properties.d.ts +9 -0
- package/dist/core/attr/meta-attr-properties.d.ts.map +1 -0
- package/dist/core/attr/meta-attr-properties.js +22 -0
- package/dist/core/attr/meta-attr-properties.js.map +1 -0
- package/dist/core/attr/meta-attr-stringarray.d.ts +9 -0
- package/dist/core/attr/meta-attr-stringarray.d.ts.map +1 -0
- package/dist/core/attr/meta-attr-stringarray.js +29 -0
- package/dist/core/attr/meta-attr-stringarray.js.map +1 -0
- package/dist/core/attr/meta-attr.d.ts +37 -0
- package/dist/core/attr/meta-attr.d.ts.map +1 -0
- package/dist/core/attr/meta-attr.js +97 -0
- package/dist/core/attr/meta-attr.js.map +1 -0
- package/dist/core/export-json.d.ts +29 -0
- package/dist/core/export-json.d.ts.map +1 -0
- package/dist/core/export-json.js +45 -0
- package/dist/core/export-json.js.map +1 -0
- package/dist/core/field/field-constants.d.ts +40 -0
- package/dist/core/field/field-constants.d.ts.map +1 -0
- package/dist/core/field/field-constants.js +66 -0
- package/dist/core/field/field-constants.js.map +1 -0
- package/dist/core/field/field-schema.d.ts +6 -0
- package/dist/core/field/field-schema.d.ts.map +1 -0
- package/dist/core/field/field-schema.js +92 -0
- package/dist/core/field/field-schema.js.map +1 -0
- package/dist/core/field/meta-field.d.ts +50 -0
- package/dist/core/field/meta-field.d.ts.map +1 -0
- package/dist/core/field/meta-field.js +121 -0
- package/dist/core/field/meta-field.js.map +1 -0
- 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-constants.d.ts +19 -0
- package/dist/core/identity/identity-constants.d.ts.map +1 -0
- package/dist/core/identity/identity-constants.js +35 -0
- package/dist/core/identity/identity-constants.js.map +1 -0
- package/dist/core/identity/identity-schema.d.ts +6 -0
- package/dist/core/identity/identity-schema.d.ts.map +1 -0
- package/dist/core/identity/identity-schema.js +55 -0
- package/dist/core/identity/identity-schema.js.map +1 -0
- package/dist/core/identity/meta-identity.d.ts +71 -0
- package/dist/core/identity/meta-identity.d.ts.map +1 -0
- package/dist/core/identity/meta-identity.js +129 -0
- package/dist/core/identity/meta-identity.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +11 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/object/meta-object.d.ts +39 -0
- package/dist/core/object/meta-object.d.ts.map +1 -0
- package/dist/core/object/meta-object.js +80 -0
- package/dist/core/object/meta-object.js.map +1 -0
- package/dist/core/object/object-constants.d.ts +5 -0
- package/dist/core/object/object-constants.d.ts.map +1 -0
- package/dist/core/object/object-constants.js +18 -0
- package/dist/core/object/object-constants.js.map +1 -0
- package/dist/core/object/object-schema.d.ts +4 -0
- package/dist/core/object/object-schema.d.ts.map +1 -0
- package/dist/core/object/object-schema.js +5 -0
- package/dist/core/object/object-schema.js.map +1 -0
- package/dist/core/parser-yaml.d.ts +3 -0
- package/dist/core/parser-yaml.d.ts.map +1 -0
- package/dist/core/parser-yaml.js +39 -0
- package/dist/core/parser-yaml.js.map +1 -0
- package/dist/core/query/query-constants.d.ts +20 -0
- package/dist/core/query/query-constants.d.ts.map +1 -0
- package/dist/core/query/query-constants.js +56 -0
- package/dist/core/query/query-constants.js.map +1 -0
- package/dist/core/relationship/find-reference.d.ts +22 -0
- package/dist/core/relationship/find-reference.d.ts.map +1 -0
- package/dist/core/relationship/find-reference.js +29 -0
- package/dist/core/relationship/find-reference.js.map +1 -0
- package/dist/core/relationship/meta-relationship.d.ts +11 -0
- package/dist/core/relationship/meta-relationship.d.ts.map +1 -0
- package/dist/core/relationship/meta-relationship.js +27 -0
- package/dist/core/relationship/meta-relationship.js.map +1 -0
- package/dist/core/relationship/relationship-constants.d.ts +14 -0
- package/dist/core/relationship/relationship-constants.d.ts.map +1 -0
- package/dist/core/relationship/relationship-constants.js +28 -0
- package/dist/core/relationship/relationship-constants.js.map +1 -0
- package/dist/core/relationship/relationship-schema.d.ts +4 -0
- package/dist/core/relationship/relationship-schema.d.ts.map +1 -0
- package/dist/core/relationship/relationship-schema.js +37 -0
- package/dist/core/relationship/relationship-schema.js.map +1 -0
- package/dist/core/validator/meta-validator.d.ts +29 -0
- package/dist/core/validator/meta-validator.d.ts.map +1 -0
- package/dist/core/validator/meta-validator.js +49 -0
- package/dist/core/validator/meta-validator.js.map +1 -0
- package/dist/core/validator/validator-constants.d.ts +11 -0
- package/dist/core/validator/validator-constants.d.ts.map +1 -0
- package/dist/core/validator/validator-constants.js +25 -0
- package/dist/core/validator/validator-constants.js.map +1 -0
- package/dist/core/validator/validator-schema.d.ts +4 -0
- package/dist/core/validator/validator-schema.d.ts.map +1 -0
- package/dist/core/validator/validator-schema.js +38 -0
- package/dist/core/validator/validator-schema.js.map +1 -0
- package/dist/core/yaml-desugar.d.ts +10 -0
- package/dist/core/yaml-desugar.d.ts.map +1 -0
- package/dist/core/yaml-desugar.js +99 -0
- package/dist/core/yaml-desugar.js.map +1 -0
- 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 +20 -0
- package/dist/core-types.d.ts.map +1 -0
- package/dist/core-types.js +225 -0
- package/dist/core-types.js.map +1 -0
- package/dist/data-converter.d.ts +17 -0
- package/dist/data-converter.d.ts.map +1 -0
- package/dist/data-converter.js +117 -0
- package/dist/data-converter.js.map +1 -0
- package/dist/data-type.d.ts +15 -0
- package/dist/data-type.d.ts.map +1 -0
- package/dist/data-type.js +25 -0
- package/dist/data-type.js.map +1 -0
- 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 +26 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +59 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/loader/meta-data-loader.d.ts +87 -0
- package/dist/loader/meta-data-loader.d.ts.map +1 -0
- package/dist/loader/meta-data-loader.js +232 -0
- package/dist/loader/meta-data-loader.js.map +1 -0
- package/dist/loader/meta-data-source.d.ts +23 -0
- package/dist/loader/meta-data-source.d.ts.map +1 -0
- package/dist/loader/meta-data-source.js +20 -0
- package/dist/loader/meta-data-source.js.map +1 -0
- package/dist/loader/validation-passes.d.ts +7 -0
- package/dist/loader/validation-passes.d.ts.map +1 -0
- package/dist/loader/validation-passes.js +244 -0
- package/dist/loader/validation-passes.js.map +1 -0
- 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/naming.d.ts +27 -0
- package/dist/naming.d.ts.map +1 -0
- package/dist/naming.js +72 -0
- package/dist/naming.js.map +1 -0
- package/dist/object-serializer.d.ts +10 -0
- package/dist/object-serializer.d.ts.map +1 -0
- package/dist/object-serializer.js +128 -0
- package/dist/object-serializer.js.map +1 -0
- package/dist/overlay.d.ts +2 -0
- package/dist/overlay.d.ts.map +1 -0
- package/dist/overlay.js +6 -0
- package/dist/overlay.js.map +1 -0
- package/dist/parser-core.d.ts +47 -0
- package/dist/parser-core.d.ts.map +1 -0
- package/dist/parser-core.js +516 -0
- package/dist/parser-core.js.map +1 -0
- package/dist/parser-json.d.ts +4 -0
- package/dist/parser-json.d.ts.map +1 -0
- package/dist/parser-json.js +19 -0
- package/dist/parser-json.js.map +1 -0
- 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-constants.d.ts +5 -0
- package/dist/persistence/db/db-constants.d.ts.map +1 -0
- package/dist/persistence/db/db-constants.js +6 -0
- package/dist/persistence/db/db-constants.js.map +1 -0
- package/dist/persistence/db/db-provider.d.ts +3 -0
- package/dist/persistence/db/db-provider.d.ts.map +1 -0
- package/dist/persistence/db/db-provider.js +29 -0
- package/dist/persistence/db/db-provider.js.map +1 -0
- package/dist/persistence/db/db-schema.d.ts +8 -0
- package/dist/persistence/db/db-schema.d.ts.map +1 -0
- package/dist/persistence/db/db-schema.js +27 -0
- package/dist/persistence/db/db-schema.js.map +1 -0
- package/dist/persistence/origin/meta-origin.d.ts +32 -0
- package/dist/persistence/origin/meta-origin.d.ts.map +1 -0
- package/dist/persistence/origin/meta-origin.js +55 -0
- package/dist/persistence/origin/meta-origin.js.map +1 -0
- package/dist/persistence/origin/origin-constants.d.ts +12 -0
- package/dist/persistence/origin/origin-constants.d.ts.map +1 -0
- package/dist/persistence/origin/origin-constants.js +27 -0
- package/dist/persistence/origin/origin-constants.js.map +1 -0
- package/dist/persistence/origin/origin-schema.d.ts +4 -0
- package/dist/persistence/origin/origin-schema.d.ts.map +1 -0
- package/dist/persistence/origin/origin-schema.js +49 -0
- package/dist/persistence/origin/origin-schema.js.map +1 -0
- package/dist/persistence/source/meta-source.d.ts +18 -0
- package/dist/persistence/source/meta-source.d.ts.map +1 -0
- package/dist/persistence/source/meta-source.js +31 -0
- package/dist/persistence/source/meta-source.js.map +1 -0
- package/dist/persistence/source/source-constants.d.ts +16 -0
- package/dist/persistence/source/source-constants.d.ts.map +1 -0
- package/dist/persistence/source/source-constants.js +28 -0
- package/dist/persistence/source/source-constants.js.map +1 -0
- package/dist/presentation/layout/layout-constants.d.ts +10 -0
- package/dist/presentation/layout/layout-constants.d.ts.map +1 -0
- package/dist/presentation/layout/layout-constants.js +21 -0
- package/dist/presentation/layout/layout-constants.js.map +1 -0
- package/dist/presentation/layout/layout-schema.d.ts +4 -0
- package/dist/presentation/layout/layout-schema.d.ts.map +1 -0
- package/dist/presentation/layout/layout-schema.js +46 -0
- package/dist/presentation/layout/layout-schema.js.map +1 -0
- package/dist/presentation/layout/meta-layout.d.ts +23 -0
- package/dist/presentation/layout/meta-layout.d.ts.map +1 -0
- package/dist/presentation/layout/meta-layout.js +47 -0
- package/dist/presentation/layout/meta-layout.js.map +1 -0
- package/dist/presentation/view/meta-view.d.ts +4 -0
- package/dist/presentation/view/meta-view.d.ts.map +1 -0
- package/dist/presentation/view/meta-view.js +8 -0
- package/dist/presentation/view/meta-view.js.map +1 -0
- package/dist/presentation/view/view-constants.d.ts +20 -0
- package/dist/presentation/view/view-constants.d.ts.map +1 -0
- package/dist/presentation/view/view-constants.js +47 -0
- package/dist/presentation/view/view-constants.js.map +1 -0
- package/dist/presentation/view/view-schema.d.ts +4 -0
- package/dist/presentation/view/view-schema.d.ts.map +1 -0
- package/dist/presentation/view/view-schema.js +15 -0
- package/dist/presentation/view/view-schema.js.map +1 -0
- package/dist/provider.d.ts +20 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +58 -0
- package/dist/provider.js.map +1 -0
- package/dist/registry.d.ts +89 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +107 -0
- package/dist/registry.js.map +1 -0
- package/dist/serializer-json.d.ts +16 -0
- package/dist/serializer-json.d.ts.map +1 -0
- package/dist/serializer-json.js +154 -0
- package/dist/serializer-json.js.map +1 -0
- package/dist/shared/base-types.d.ts +23 -0
- package/dist/shared/base-types.d.ts.map +1 -0
- package/dist/shared/base-types.js +43 -0
- package/dist/shared/base-types.js.map +1 -0
- package/dist/shared/meta-data.d.ts +123 -0
- package/dist/shared/meta-data.d.ts.map +1 -0
- package/dist/shared/meta-data.js +365 -0
- package/dist/shared/meta-data.js.map +1 -0
- package/dist/shared/meta-root.d.ts +12 -0
- package/dist/shared/meta-root.d.ts.map +1 -0
- package/dist/shared/meta-root.js +24 -0
- package/dist/shared/meta-root.js.map +1 -0
- package/dist/shared/structural.d.ts +20 -0
- package/dist/shared/structural.d.ts.map +1 -0
- package/dist/shared/structural.js +49 -0
- package/dist/shared/structural.js.map +1 -0
- package/dist/subtype-rules.d.ts +8 -0
- package/dist/subtype-rules.d.ts.map +1 -0
- package/dist/subtype-rules.js +34 -0
- package/dist/subtype-rules.js.map +1 -0
- package/dist/super-resolve.d.ts +34 -0
- package/dist/super-resolve.d.ts.map +1 -0
- package/dist/super-resolve.js +124 -0
- package/dist/super-resolve.js.map +1 -0
- package/package.json +50 -0
- package/src/attr-class-map.ts +64 -0
- package/src/attr-schema-validate.ts +134 -0
- package/src/core/attr/attr-constants.ts +31 -0
- package/src/core/attr/meta-attr-filter.ts +67 -0
- package/src/core/attr/meta-attr-properties.ts +26 -0
- package/src/core/attr/meta-attr-stringarray.ts +31 -0
- package/src/core/attr/meta-attr.ts +125 -0
- package/src/core/export-json.ts +66 -0
- package/src/core/field/field-constants.ts +79 -0
- package/src/core/field/field-schema.ts +121 -0
- package/src/core/field/meta-field.ts +179 -0
- package/src/core/file-meta-data-loader.ts +89 -0
- package/src/core/file-source.ts +52 -0
- package/src/core/identity/identity-constants.ts +44 -0
- package/src/core/identity/identity-schema.ts +80 -0
- package/src/core/identity/meta-identity.ts +148 -0
- package/src/core/index.ts +12 -0
- package/src/core/object/meta-object.ts +151 -0
- package/src/core/object/object-constants.ts +21 -0
- package/src/core/object/object-schema.ts +7 -0
- package/src/core/parser-yaml.ts +54 -0
- package/src/core/query/query-constants.ts +66 -0
- package/src/core/relationship/find-reference.ts +44 -0
- package/src/core/relationship/meta-relationship.ts +36 -0
- package/src/core/relationship/relationship-constants.ts +38 -0
- package/src/core/relationship/relationship-schema.ts +49 -0
- package/src/core/validator/meta-validator.ts +62 -0
- package/src/core/validator/validator-constants.ts +31 -0
- package/src/core/validator/validator-schema.ts +50 -0
- package/src/core/yaml-desugar.ts +145 -0
- package/src/core-types.ts +329 -0
- package/src/data-converter.ts +125 -0
- package/src/data-type.ts +33 -0
- package/src/errors.ts +68 -0
- package/src/index.ts +165 -0
- package/src/loader/meta-data-loader.ts +307 -0
- package/src/loader/meta-data-source.ts +35 -0
- package/src/loader/validation-passes.ts +370 -0
- package/src/naming.ts +86 -0
- package/src/object-serializer.ts +153 -0
- package/src/overlay.ts +5 -0
- package/src/parser-core.ts +815 -0
- package/src/parser-json.ts +28 -0
- package/src/persistence/db/db-constants.ts +6 -0
- package/src/persistence/db/db-provider.ts +36 -0
- package/src/persistence/db/db-schema.ts +40 -0
- package/src/persistence/origin/meta-origin.ts +67 -0
- package/src/persistence/origin/origin-constants.ts +35 -0
- package/src/persistence/origin/origin-schema.ts +66 -0
- package/src/persistence/source/meta-source.ts +38 -0
- package/src/persistence/source/source-constants.ts +35 -0
- package/src/presentation/layout/layout-constants.ts +27 -0
- package/src/presentation/layout/layout-schema.ts +62 -0
- package/src/presentation/layout/meta-layout.ts +61 -0
- package/src/presentation/view/meta-view.ts +8 -0
- package/src/presentation/view/view-constants.ts +53 -0
- package/src/presentation/view/view-schema.ts +21 -0
- package/src/provider.ts +85 -0
- package/src/registry.ts +190 -0
- package/src/serializer-json.ts +210 -0
- package/src/shared/base-types.ts +52 -0
- package/src/shared/meta-data.ts +443 -0
- package/src/shared/meta-root.ts +33 -0
- package/src/shared/structural.ts +62 -0
- package/src/subtype-rules.ts +56 -0
- package/src/super-resolve.ts +147 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other transformations
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of recording and
|
|
55
|
+
discussing modifications to the Work, but excluding communication that
|
|
56
|
+
is conspicuously marked or designated in writing by the copyright owner
|
|
57
|
+
as "Not a Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a cross-claim
|
|
80
|
+
or counterclaim in a lawsuit) alleging that the Work or any
|
|
81
|
+
Contribution embodied within the Work constitutes direct or contributory
|
|
82
|
+
patent infringement, then any patent licenses granted to You under
|
|
83
|
+
this License for that Work shall terminate as of the date such
|
|
84
|
+
litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
92
|
+
Works a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
98
|
+
that You distribute, all copyright, patent, trademark, and
|
|
99
|
+
attribution notices from the Source form of the Work,
|
|
100
|
+
excluding those notices that do not pertain to any part of
|
|
101
|
+
the Derivative Works; and
|
|
102
|
+
|
|
103
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
+
distribution, You must include a readable copy of the
|
|
105
|
+
attribution notices contained within such NOTICE file, in
|
|
106
|
+
at least one of the following places: within a NOTICE text
|
|
107
|
+
file distributed as part of the Derivative Works; within
|
|
108
|
+
the Source form or documentation, if provided along with the
|
|
109
|
+
Derivative Works; or, within a display generated by the
|
|
110
|
+
Derivative Works, if and wherever such third-party notices
|
|
111
|
+
normally appear. The contents of the NOTICE file are for
|
|
112
|
+
informational purposes only and do not modify the License.
|
|
113
|
+
You may add Your own attribution notices within Derivative
|
|
114
|
+
Works that You distribute, alongside or in addition to the
|
|
115
|
+
NOTICE text from the Work, provided that such additional
|
|
116
|
+
attribution notices cannot be construed as modifying the License.
|
|
117
|
+
|
|
118
|
+
You may add Your own license statement for Your modifications and
|
|
119
|
+
may provide additional grant of rights to use, reproduce, modify,
|
|
120
|
+
prepare derivative works of, distribute, and sublicense such modifications,
|
|
121
|
+
as an additional requirement of this License.
|
|
122
|
+
|
|
123
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
124
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
125
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
126
|
+
this License, without any additional terms or conditions.
|
|
127
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
128
|
+
the terms of any separate license agreement you may have executed
|
|
129
|
+
with Licensor regarding such Contributions.
|
|
130
|
+
|
|
131
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
132
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
133
|
+
except as required for reasonable and customary use in describing the
|
|
134
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
135
|
+
|
|
136
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
137
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
138
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
139
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
140
|
+
implied, including, without limitation, any conditions of TITLE,
|
|
141
|
+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
|
|
142
|
+
PURPOSE. You are solely responsible for determining the
|
|
143
|
+
appropriateness of using or reproducing the Work and assume any
|
|
144
|
+
risks associated with Your exercise of permissions under this License.
|
|
145
|
+
|
|
146
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
147
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
148
|
+
unless required by applicable law (such as deliberate and grossly
|
|
149
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
150
|
+
liable to You for damages, including any direct, indirect, special,
|
|
151
|
+
incidental, or exemplary damages of any character arising as a
|
|
152
|
+
result of this License or out of the use or inability to use the
|
|
153
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
154
|
+
work stoppage, computer failure or malfunction, or all other
|
|
155
|
+
commercial damages or losses), even if such Contributor has been
|
|
156
|
+
advised of the possibility of such damages.
|
|
157
|
+
|
|
158
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
159
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
160
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
161
|
+
or other liability obligations and/or rights consistent with this
|
|
162
|
+
License. However, in accepting such obligations, You may offer
|
|
163
|
+
only obligations consistent to this License provided that the
|
|
164
|
+
obligations are consistent with this License.
|
|
165
|
+
|
|
166
|
+
END OF TERMS AND CONDITIONS
|
|
167
|
+
|
|
168
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
169
|
+
|
|
170
|
+
To apply the Apache License to your work, attach the following
|
|
171
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
172
|
+
replaced with your own identifying information. (Don't include
|
|
173
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
174
|
+
comment syntax for the file format in question. Also add information
|
|
175
|
+
on how to contact you electronically and/or by mail.
|
|
176
|
+
|
|
177
|
+
Copyright 2026 MetaObjects Contributors
|
|
178
|
+
|
|
179
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
180
|
+
you may not use this file except in compliance with the License.
|
|
181
|
+
You may obtain a copy of the License at
|
|
182
|
+
|
|
183
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
184
|
+
|
|
185
|
+
Unless required by applicable law or agreed to in writing, software
|
|
186
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
187
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
188
|
+
See the License for the specific language governing permissions and
|
|
189
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @metaobjectsdev/metadata
|
|
2
|
+
|
|
3
|
+
The metamodel loader, typed views, and constants for the MetaObjects standard. This is the foundation package every other `@metaobjectsdev/*` package builds on — it parses `metaobjects/*.json` files into a typed object model, resolves `extends` and overlay merging, and exposes the 11-type vocabulary as named constants.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @metaobjectsdev/metadata
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { MetaDataLoader, InMemorySource } from "@metaobjectsdev/metadata";
|
|
15
|
+
|
|
16
|
+
const json = `{ "metadata.root": { "package": "demo", "children": [] } }`;
|
|
17
|
+
const result = await new MetaDataLoader().load([new InMemorySource(json)]);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The public loader API is `MetaDataLoader` + `InMemorySource`. A `MetaDataLoader` instance is single-use; construct a new one per load.
|
|
21
|
+
|
|
22
|
+
## Links
|
|
23
|
+
|
|
24
|
+
- [Spec](https://github.com/metaobjectsdev/metaobjects/tree/main/spec)
|
|
25
|
+
- [Metamodel reference](https://github.com/metaobjectsdev/metaobjects/blob/main/spec/metamodel.md)
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
Apache 2.0 — see [LICENSE](../../../../LICENSE) at the repo root.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TypeId } from "./registry.js";
|
|
2
|
+
import type { MetaData } from "./shared/meta-data.js";
|
|
3
|
+
import type { MetaAttr } from "./core/attr/meta-attr.js";
|
|
4
|
+
/** A general node constructor — kept assignable from AttrConstructor. */
|
|
5
|
+
export type NodeConstructor = new (typeId: TypeId, name: string) => MetaData;
|
|
6
|
+
/** A MetaAttr (sub)class constructor — narrower than NodeConstructor so callers
|
|
7
|
+
* can read `.dataType` off a probe instance and store the result in a
|
|
8
|
+
* Map<string, MetaAttr>. Assignable to NodeConstructor since MetaAttr extends
|
|
9
|
+
* MetaData. MetaAttr is imported type-only here so this module stays free of
|
|
10
|
+
* any meta-tree value import (type imports are erased — no eval cycle). */
|
|
11
|
+
export type AttrConstructor = new (typeId: TypeId, name: string) => MetaAttr;
|
|
12
|
+
/** Subtype → concrete attr subclass. Populated by each subclass at module load
|
|
13
|
+
* via registerAttrClass. The base MetaAttr is the fallback for unmapped
|
|
14
|
+
* (scalar/string) subtypes — see attrClassFor. */
|
|
15
|
+
export declare const ATTR_CLASS_MAP: Map<string, AttrConstructor>;
|
|
16
|
+
/** Register a subtype → subclass mapping. Called by each attr subclass module
|
|
17
|
+
* at load time (`registerAttrClass(ATTR_SUBTYPE_X, XAttr)`). */
|
|
18
|
+
export declare function registerAttrClass(subType: string, ctor: AttrConstructor): void;
|
|
19
|
+
/** Register the base MetaAttr as the fallback for unmapped subtypes. Called once
|
|
20
|
+
* by meta-attr.ts at load. */
|
|
21
|
+
export declare function registerFallbackAttrClass(ctor: AttrConstructor): void;
|
|
22
|
+
/** The concrete MetaAttr subclass for an attr subtype (default base MetaAttr).
|
|
23
|
+
* Used by MetaData.setAttr to materialize an undeclared attr as the right
|
|
24
|
+
* class, and by core-types to register the subtype's TypeDefinition. */
|
|
25
|
+
export declare function attrClassFor(subType: string): AttrConstructor;
|
|
26
|
+
//# sourceMappingURL=attr-class-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attr-class-map.d.ts","sourceRoot":"","sources":["../src/attr-class-map.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,QAAQ,CAAC;AAE7E;;;;4EAI4E;AAC5E,MAAM,MAAM,eAAe,GAAG,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,QAAQ,CAAC;AAE7E;;mDAEmD;AACnD,eAAO,MAAM,cAAc,8BAAqC,CAAC;AAMjE;iEACiE;AACjE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,IAAI,CAE9E;AAED;+BAC+B;AAC/B,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAErE;AAED;;yEAEyE;AACzE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAY7D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// attr-class-map — dependency-free registry mapping each attr subtype to its
|
|
2
|
+
// concrete MetaAttr (sub)class.
|
|
3
|
+
//
|
|
4
|
+
// Why a registry (and not a static Map literal of class references): MetaData
|
|
5
|
+
// (the base of every node, including MetaAttr) must resolve an attr subclass in
|
|
6
|
+
// setAttr. If MetaData imported a module that imported the MetaAttr subclasses,
|
|
7
|
+
// that closes a module-eval cycle (meta-data → <map> → meta-attr → meta-data)
|
|
8
|
+
// and the `class MetaAttr extends MetaData` clause runs before MetaData is
|
|
9
|
+
// initialized (TDZ). To break it, this module imports NOTHING from the meta
|
|
10
|
+
// tree: each subclass registers ITSELF here (one self-registration line per
|
|
11
|
+
// subclass — the Open-Closed seam), and meta-data.ts reads back through this
|
|
12
|
+
// dependency-free leaf.
|
|
13
|
+
/** Subtype → concrete attr subclass. Populated by each subclass at module load
|
|
14
|
+
* via registerAttrClass. The base MetaAttr is the fallback for unmapped
|
|
15
|
+
* (scalar/string) subtypes — see attrClassFor. */
|
|
16
|
+
export const ATTR_CLASS_MAP = new Map();
|
|
17
|
+
/** Fallback constructor for unmapped subtypes (the base MetaAttr). Registered
|
|
18
|
+
* by meta-attr.ts at load so attrClassFor never returns undefined. */
|
|
19
|
+
let fallbackAttrClass;
|
|
20
|
+
/** Register a subtype → subclass mapping. Called by each attr subclass module
|
|
21
|
+
* at load time (`registerAttrClass(ATTR_SUBTYPE_X, XAttr)`). */
|
|
22
|
+
export function registerAttrClass(subType, ctor) {
|
|
23
|
+
ATTR_CLASS_MAP.set(subType, ctor);
|
|
24
|
+
}
|
|
25
|
+
/** Register the base MetaAttr as the fallback for unmapped subtypes. Called once
|
|
26
|
+
* by meta-attr.ts at load. */
|
|
27
|
+
export function registerFallbackAttrClass(ctor) {
|
|
28
|
+
fallbackAttrClass = ctor;
|
|
29
|
+
}
|
|
30
|
+
/** The concrete MetaAttr subclass for an attr subtype (default base MetaAttr).
|
|
31
|
+
* Used by MetaData.setAttr to materialize an undeclared attr as the right
|
|
32
|
+
* class, and by core-types to register the subtype's TypeDefinition. */
|
|
33
|
+
export function attrClassFor(subType) {
|
|
34
|
+
const ctor = ATTR_CLASS_MAP.get(subType) ?? fallbackAttrClass;
|
|
35
|
+
if (ctor === undefined) {
|
|
36
|
+
throw new Error(`Attr classes are not registered (no fallback set, and no class for subType '${subType}'). ` +
|
|
37
|
+
`The MetaAttr subclasses self-register as a module side-effect; a deep direct import that ` +
|
|
38
|
+
`bypasses the package entry can run MetaData.setAttr before they load. ` +
|
|
39
|
+
`Import the package entry ("@metaobjectsdev/metadata") or register the core types ` +
|
|
40
|
+
`(registerCoreTypes) before constructing/loading metadata.`);
|
|
41
|
+
}
|
|
42
|
+
return ctor;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=attr-class-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attr-class-map.js","sourceRoot":"","sources":["../src/attr-class-map.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,gCAAgC;AAChC,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,wBAAwB;AAgBxB;;mDAEmD;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,EAA2B,CAAC;AAEjE;uEACuE;AACvE,IAAI,iBAA8C,CAAC;AAEnD;iEACiE;AACjE,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,IAAqB;IACtE,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;+BAC+B;AAC/B,MAAM,UAAU,yBAAyB,CAAC,IAAqB;IAC7D,iBAAiB,GAAG,IAAI,CAAC;AAC3B,CAAC;AAED;;yEAEyE;AACzE,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,iBAAiB,CAAC;IAC9D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,+EAA+E,OAAO,MAAM;YAC1F,2FAA2F;YAC3F,wEAAwE;YACxE,mFAAmF;YACnF,2DAA2D,CAC9D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MetaData } from "./shared/meta-data.js";
|
|
2
|
+
import { ParseError } from "./errors.js";
|
|
3
|
+
import type { TypeRegistry } from "./registry.js";
|
|
4
|
+
export interface AttrSchemaValidationResult {
|
|
5
|
+
errors: ParseError[];
|
|
6
|
+
warnings: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function validateAttrSchema(root: MetaData, registry: TypeRegistry): AttrSchemaValidationResult;
|
|
9
|
+
//# sourceMappingURL=attr-schema-validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attr-schema-validate.d.ts","sourceRoot":"","sources":["../src/attr-schema-validate.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAMD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,YAAY,GACrB,0BAA0B,CAI5B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Phase A3 — attribute-schema validation pass.
|
|
2
|
+
//
|
|
3
|
+
// Consumes the per-(type, subType) attribute schema populated in core-types.ts
|
|
4
|
+
// (Phase A2). For each node in the loaded typed tree, looks up
|
|
5
|
+
// registry.attrsOf(node.type, node.subType) and checks the node's OWN
|
|
6
|
+
// @-attributes against that schema:
|
|
7
|
+
//
|
|
8
|
+
// 1. Required attrs present — every AttrSchema with required:true must
|
|
9
|
+
// have a matching attr on the node.
|
|
10
|
+
// 2. Declared attrs well-typed — for each @-attr ON the node that IS in the
|
|
11
|
+
// schema, its value must satisfy the
|
|
12
|
+
// MetaAttr instance's own validateValue.
|
|
13
|
+
// 3. allowedValues honored — declared attrs with a non-empty
|
|
14
|
+
// allowedValues set must hold a member value.
|
|
15
|
+
// 4. Undeclared attrs — NOT an error, NOT a warning (open policy).
|
|
16
|
+
//
|
|
17
|
+
// `default` values are NOT auto-applied — A3 is pure validation, not mutation.
|
|
18
|
+
//
|
|
19
|
+
// Checks 2+3 dispatch to the materialized MetaAttr instance: each attr is a
|
|
20
|
+
// MetaAttr that owns validateValue(value): ValueError[] (resolved by its
|
|
21
|
+
// subType, which the parser chose from the declared valueType). The central
|
|
22
|
+
// value-shape helper + the per-shape subtype sets are gone — value-shape
|
|
23
|
+
// knowledge now lives on the instance. The pass maps each ValueError to a
|
|
24
|
+
// ParseError with the unchanged ERR_BAD_ATTR_VALUE code, so conformance
|
|
25
|
+
// fixtures stay green.
|
|
26
|
+
//
|
|
27
|
+
// Modeled on src/subtype-rules.ts: a recursive walk producing an
|
|
28
|
+
// { errors, warnings } result. All A3 findings are ERRORS; warnings stays [].
|
|
29
|
+
import { ParseError } from "./errors.js";
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Public entry point
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
export function validateAttrSchema(root, registry) {
|
|
34
|
+
const errors = [];
|
|
35
|
+
walk(root, registry, errors);
|
|
36
|
+
return { errors, warnings: [] };
|
|
37
|
+
}
|
|
38
|
+
function walk(node, registry, errors) {
|
|
39
|
+
validateNode(node, registry, errors);
|
|
40
|
+
for (const child of node.ownChildren()) {
|
|
41
|
+
walk(child, registry, errors);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** A node label for error messages, e.g. `origin.aggregate 'weekCount'`. */
|
|
45
|
+
function nodeLabel(node) {
|
|
46
|
+
const head = `${node.type}.${node.subType}`;
|
|
47
|
+
return node.name !== "" ? `${head} '${node.name}'` : head;
|
|
48
|
+
}
|
|
49
|
+
function validateNode(node, registry, errors) {
|
|
50
|
+
const schema = registry.attrsOf(node.type, node.subType);
|
|
51
|
+
if (schema.length === 0)
|
|
52
|
+
return;
|
|
53
|
+
// Index the schema by attr name for the declared-attr checks below.
|
|
54
|
+
const byName = new Map();
|
|
55
|
+
for (const spec of schema)
|
|
56
|
+
byName.set(spec.name, spec);
|
|
57
|
+
// --- Check 1: required attrs present ---
|
|
58
|
+
//
|
|
59
|
+
// Use attrs() (own + inherited via extends:) to determine presence.
|
|
60
|
+
// A node that legitimately inherits a required attr from its super must NOT be
|
|
61
|
+
// flagged as missing it — inherited attrs count as satisfying the requirement.
|
|
62
|
+
// Contrast with Checks 2+3 below, which iterate own attrs only: inherited attrs
|
|
63
|
+
// were already validated on the node that declared them, so re-checking would
|
|
64
|
+
// double-report. This mirrors the effective-vs-own split in subtype-rules.ts.
|
|
65
|
+
const effective = node.attrs();
|
|
66
|
+
for (const spec of schema) {
|
|
67
|
+
if (spec.required && !effective.has(spec.name)) {
|
|
68
|
+
errors.push(new ParseError(`${nodeLabel(node)} is missing required attribute '@${spec.name}'`, { code: "ERR_MISSING_REQUIRED_ATTR" }));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// --- Checks 2 + 3: declared attrs on the node are well-typed + in range ---
|
|
72
|
+
for (const inst of node.ownMetaAttrs()) {
|
|
73
|
+
const spec = byName.get(inst.name);
|
|
74
|
+
if (spec === undefined)
|
|
75
|
+
continue; // undeclared attr → open policy: ignore.
|
|
76
|
+
const value = inst.value;
|
|
77
|
+
if (value === undefined)
|
|
78
|
+
continue;
|
|
79
|
+
// Check 2: the instance validates its own value shape. When the declared
|
|
80
|
+
// valueType is absent (e.g. @default), skip — any AttrValue is valid.
|
|
81
|
+
if (spec.valueType !== undefined) {
|
|
82
|
+
const valueErrors = inst.validateValue(value);
|
|
83
|
+
if (valueErrors.length > 0) {
|
|
84
|
+
for (const ve of valueErrors) {
|
|
85
|
+
errors.push(new ParseError(`${nodeLabel(node)} ${ve.message}`, { code: "ERR_BAD_ATTR_VALUE" }));
|
|
86
|
+
}
|
|
87
|
+
continue; // type wrong → skip allowedValues
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Check 3: allowedValues membership (unchanged).
|
|
91
|
+
if (spec.allowedValues !== undefined && spec.allowedValues.length > 0) {
|
|
92
|
+
if (!spec.allowedValues.includes(value)) {
|
|
93
|
+
errors.push(new ParseError(`${nodeLabel(node)} attribute '@${inst.name}' has value ` +
|
|
94
|
+
`'${String(value)}' which is not one of the allowed values: ` +
|
|
95
|
+
`${spec.allowedValues.map((v) => String(v)).join(", ")}`, { code: "ERR_BAD_ATTR_VALUE" }));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=attr-schema-validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attr-schema-validate.js","sourceRoot":"","sources":["../src/attr-schema-validate.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
export declare const TYPE_METADATA = "metadata";
|
|
2
|
+
export declare const TYPE_OBJECT = "object";
|
|
3
|
+
export declare const TYPE_FIELD = "field";
|
|
4
|
+
export declare const TYPE_ATTR = "attr";
|
|
5
|
+
export declare const TYPE_VALIDATOR = "validator";
|
|
6
|
+
export declare const TYPE_VIEW = "view";
|
|
7
|
+
export declare const TYPE_IDENTITY = "identity";
|
|
8
|
+
export declare const TYPE_RELATIONSHIP = "relationship";
|
|
9
|
+
export declare const TYPE_LAYOUT = "layout";
|
|
10
|
+
export declare const TYPE_SOURCE = "source";
|
|
11
|
+
export declare const TYPE_ORIGIN = "origin";
|
|
12
|
+
export declare const BASE_TYPES: readonly ["metadata", "object", "field", "attr", "validator", "view", "identity", "relationship", "layout", "source", "origin"];
|
|
13
|
+
export type BaseType = (typeof BASE_TYPES)[number];
|
|
14
|
+
export declare const SUBTYPE_BASE = "base";
|
|
15
|
+
/**
|
|
16
|
+
* The metadata document root subtype. The root node is `metadata.root` in the
|
|
17
|
+
* canonical format. (Distinct from the universal SUBTYPE_BASE — the redesigned
|
|
18
|
+
* format spec confirms the root subtype is `root`, not `base`.)
|
|
19
|
+
*/
|
|
20
|
+
export declare const SUBTYPE_ROOT = "root";
|
|
21
|
+
export declare const METADATA_SUBTYPES: readonly ["root"];
|
|
22
|
+
export type MetadataSubType = (typeof METADATA_SUBTYPES)[number];
|
|
23
|
+
export declare const OBJECT_SUBTYPE_ENTITY = "entity";
|
|
24
|
+
export declare const OBJECT_SUBTYPE_VALUE = "value";
|
|
25
|
+
export declare const OBJECT_SUBTYPES: readonly ["base", "entity", "value"];
|
|
26
|
+
export type ObjectSubType = (typeof OBJECT_SUBTYPES)[number];
|
|
27
|
+
export declare const FIELD_SUBTYPE_STRING = "string";
|
|
28
|
+
export declare const FIELD_SUBTYPE_INT = "int";
|
|
29
|
+
export declare const FIELD_SUBTYPE_SHORT = "short";
|
|
30
|
+
export declare const FIELD_SUBTYPE_BYTE = "byte";
|
|
31
|
+
export declare const FIELD_SUBTYPE_LONG = "long";
|
|
32
|
+
export declare const FIELD_SUBTYPE_DOUBLE = "double";
|
|
33
|
+
export declare const FIELD_SUBTYPE_FLOAT = "float";
|
|
34
|
+
export declare const FIELD_SUBTYPE_DECIMAL = "decimal";
|
|
35
|
+
export declare const FIELD_SUBTYPE_BOOLEAN = "boolean";
|
|
36
|
+
export declare const FIELD_SUBTYPE_DATE = "date";
|
|
37
|
+
export declare const FIELD_SUBTYPE_TIME = "time";
|
|
38
|
+
export declare const FIELD_SUBTYPE_TIMESTAMP = "timestamp";
|
|
39
|
+
export declare const FIELD_SUBTYPE_OBJECT = "object";
|
|
40
|
+
export declare const FIELD_SUBTYPE_CLASS = "class";
|
|
41
|
+
export declare const FIELD_SUBTYPE_CURRENCY = "currency";
|
|
42
|
+
export declare const FIELD_SUBTYPES: readonly ["base", "string", "int", "short", "byte", "long", "double", "float", "decimal", "boolean", "date", "time", "timestamp", "object", "class", "currency"];
|
|
43
|
+
export type FieldSubType = (typeof FIELD_SUBTYPES)[number];
|
|
44
|
+
export declare const ATTR_SUBTYPE_STRING = "string";
|
|
45
|
+
export declare const ATTR_SUBTYPE_INT = "int";
|
|
46
|
+
export declare const ATTR_SUBTYPE_LONG = "long";
|
|
47
|
+
export declare const ATTR_SUBTYPE_DOUBLE = "double";
|
|
48
|
+
export declare const ATTR_SUBTYPE_BOOLEAN = "boolean";
|
|
49
|
+
export declare const ATTR_SUBTYPE_CLASS = "class";
|
|
50
|
+
export declare const ATTR_SUBTYPE_PROPERTIES = "properties";
|
|
51
|
+
export declare const ATTR_SUBTYPE_STRINGARRAY = "stringarray";
|
|
52
|
+
export declare const ATTR_SUBTYPES: readonly ["base", "string", "int", "long", "double", "boolean", "class", "properties", "stringarray"];
|
|
53
|
+
export type AttrSubType = (typeof ATTR_SUBTYPES)[number];
|
|
54
|
+
export declare const VALIDATOR_SUBTYPE_REQUIRED = "required";
|
|
55
|
+
export declare const VALIDATOR_SUBTYPE_LENGTH = "length";
|
|
56
|
+
export declare const VALIDATOR_SUBTYPE_REGEX = "regex";
|
|
57
|
+
export declare const VALIDATOR_SUBTYPE_NUMERIC = "numeric";
|
|
58
|
+
export declare const VALIDATOR_SUBTYPE_ARRAY = "array";
|
|
59
|
+
export declare const VALIDATOR_SUBTYPES: readonly ["base", "required", "length", "regex", "numeric", "array"];
|
|
60
|
+
export type ValidatorSubType = (typeof VALIDATOR_SUBTYPES)[number];
|
|
61
|
+
export declare const VIEW_SUBTYPE_TEXT = "text";
|
|
62
|
+
export declare const VIEW_SUBTYPE_TEXTAREA = "textarea";
|
|
63
|
+
export declare const VIEW_SUBTYPE_DATE = "date";
|
|
64
|
+
export declare const VIEW_SUBTYPE_MONTH = "month";
|
|
65
|
+
export declare const VIEW_SUBTYPE_HOTLINK = "hotlink";
|
|
66
|
+
export declare const VIEW_SUBTYPE_DROPDOWN = "dropdown";
|
|
67
|
+
export declare const VIEW_SUBTYPE_RADIO = "radio";
|
|
68
|
+
export declare const VIEW_SUBTYPE_CHECKBOX = "checkbox";
|
|
69
|
+
export declare const VIEW_SUBTYPE_NUMBER = "number";
|
|
70
|
+
export declare const VIEW_SUBTYPE_PASSWORD = "password";
|
|
71
|
+
export declare const VIEW_SUBTYPE_HIDDEN = "hidden";
|
|
72
|
+
export declare const VIEW_SUBTYPE_WEB = "web";
|
|
73
|
+
export declare const VIEW_SUBTYPE_CURRENCY = "currency";
|
|
74
|
+
export declare const VIEW_SUBTYPES: readonly ["base", "text", "textarea", "date", "month", "hotlink", "dropdown", "radio", "checkbox", "number", "password", "hidden", "web", "currency"];
|
|
75
|
+
export type ViewSubType = (typeof VIEW_SUBTYPES)[number];
|
|
76
|
+
export declare const LAYOUT_SUBTYPE_DATA_GRID = "dataGrid";
|
|
77
|
+
export declare const LAYOUT_SUBTYPES: readonly ["base", "dataGrid"];
|
|
78
|
+
export type LayoutSubType = (typeof LAYOUT_SUBTYPES)[number];
|
|
79
|
+
export declare const LAYOUT_DATA_GRID_ATTR_PAGE_SIZE = "pageSize";
|
|
80
|
+
export declare const LAYOUT_DATA_GRID_ATTR_DEFAULT_SORT_FIELD = "defaultSortField";
|
|
81
|
+
export declare const LAYOUT_DATA_GRID_ATTR_DEFAULT_SORT_ORDER = "defaultSortOrder";
|
|
82
|
+
export declare const LAYOUT_DATA_GRID_ATTR_FILTERABLE = "filterable";
|
|
83
|
+
export declare const LAYOUT_DATA_GRID_ATTR_FILTER = "filter";
|
|
84
|
+
export declare const LAYOUT_DATA_GRID_ATTR_COLUMNS = "columns";
|
|
85
|
+
/** BCP 47 locale code on a view[currency]. Defaults to "en-US" when omitted. */
|
|
86
|
+
export declare const VIEW_CURRENCY_ATTR_LOCALE = "locale";
|
|
87
|
+
/** Default BCP 47 locale code when @locale is omitted on a view[currency]. */
|
|
88
|
+
export declare const VIEW_CURRENCY_ATTR_LOCALE_DEFAULT = "en-US";
|
|
89
|
+
export declare const IDENTITY_SUBTYPE_PRIMARY = "primary";
|
|
90
|
+
export declare const IDENTITY_SUBTYPE_SECONDARY = "secondary";
|
|
91
|
+
export declare const IDENTITY_SUBTYPE_REFERENCE = "reference";
|
|
92
|
+
export declare const IDENTITY_SUBTYPES: readonly ["primary", "secondary", "reference"];
|
|
93
|
+
export type IdentitySubType = (typeof IDENTITY_SUBTYPES)[number];
|
|
94
|
+
export declare const RELATIONSHIP_SUBTYPE_ASSOCIATION = "association";
|
|
95
|
+
export declare const RELATIONSHIP_SUBTYPE_AGGREGATION = "aggregation";
|
|
96
|
+
export declare const RELATIONSHIP_SUBTYPE_COMPOSITION = "composition";
|
|
97
|
+
export declare const RELATIONSHIP_SUBTYPES: readonly ["base", "association", "aggregation", "composition"];
|
|
98
|
+
export type RelationshipSubType = (typeof RELATIONSHIP_SUBTYPES)[number];
|
|
99
|
+
export declare const RESERVED_KEY_NAME = "name";
|
|
100
|
+
export declare const RESERVED_KEY_PACKAGE = "package";
|
|
101
|
+
export declare const RESERVED_KEY_EXTENDS = "extends";
|
|
102
|
+
export declare const RESERVED_KEY_ABSTRACT = "abstract";
|
|
103
|
+
export declare const RESERVED_KEY_OVERLAY = "overlay";
|
|
104
|
+
export declare const RESERVED_KEY_IS_ARRAY = "isArray";
|
|
105
|
+
export declare const RESERVED_KEY_CHILDREN = "children";
|
|
106
|
+
/** attr-child-node body key carrying the typed value. */
|
|
107
|
+
export declare const RESERVED_KEY_VALUE = "value";
|
|
108
|
+
export declare const RESERVED_KEYS: Set<string>;
|
|
109
|
+
export declare const JSON_KEY_SCHEMA = "$schema";
|
|
110
|
+
export declare const ATTR_PREFIX = "@";
|
|
111
|
+
/** Separator fusing type and subType in a node's wrapper key (`object.entity`). */
|
|
112
|
+
export declare const TYPE_SUBTYPE_SEPARATOR = ".";
|
|
113
|
+
/** Separator between package segments and between package and name. */
|
|
114
|
+
export declare const PACKAGE_SEPARATOR = "::";
|
|
115
|
+
/** Relative-reference "go up one level" marker. */
|
|
116
|
+
export declare const PACKAGE_PARENT = "..";
|
|
117
|
+
export declare const CHILD_RULE_WILDCARD = "*";
|
|
118
|
+
export declare const IDENTITY_ATTR_FIELDS = "fields";
|
|
119
|
+
export declare const IDENTITY_ATTR_GENERATION = "generation";
|
|
120
|
+
/** On secondary identities: true → uniqueIndex; false/absent → index. Defaults to true for back-compat. */
|
|
121
|
+
export declare const IDENTITY_ATTR_UNIQUE = "unique";
|
|
122
|
+
/** Identity-reference attr: target entity (bare or dotted `Entity.field` / `Entity.fA,fB`). */
|
|
123
|
+
export declare const IDENTITY_REFERENCE_ATTR_REFERENCES = "references";
|
|
124
|
+
/** Identity-reference attr: physical-enforcement flag. Default true → hard FK constraint; false → logical-only reference. */
|
|
125
|
+
export declare const IDENTITY_REFERENCE_ATTR_ENFORCE = "enforce";
|
|
126
|
+
export declare const RELATIONSHIP_ATTR_CARDINALITY = "cardinality";
|
|
127
|
+
export declare const RELATIONSHIP_ATTR_OBJECT_REF = "objectRef";
|
|
128
|
+
export declare const RELATIONSHIP_ATTR_JOIN_ENTITY = "joinEntity";
|
|
129
|
+
export declare const RELATIONSHIP_ATTR_JOIN_FIELDS = "joinFields";
|
|
130
|
+
export declare const FIELD_ATTR_REQUIRED = "required";
|
|
131
|
+
export declare const FIELD_ATTR_UNIQUE = "unique";
|
|
132
|
+
export declare const FIELD_ATTR_DEFAULT = "default";
|
|
133
|
+
export declare const FIELD_ATTR_MAX_LENGTH = "maxLength";
|
|
134
|
+
export declare const FIELD_ATTR_DB_COLUMN = "dbColumn";
|
|
135
|
+
export declare const FIELD_ATTR_PRECISION = "precision";
|
|
136
|
+
export declare const FIELD_ATTR_SCALE = "scale";
|
|
137
|
+
export declare const FIELD_ATTR_FILTERABLE = "filterable";
|
|
138
|
+
export declare const FIELD_ATTR_SORTABLE = "sortable";
|
|
139
|
+
export declare const FIELD_ATTR_SORTABLE_DEFAULT_ORDER = "sortableDefaultOrder";
|
|
140
|
+
/** When true, suppress the @filterable-without-index Loader warning (Project D drift check). */
|
|
141
|
+
export declare const FIELD_ATTR_DB_INDEXED = "db.indexed";
|
|
142
|
+
/** ISO 4217 currency code on a currency-subtype field. Defaults to "USD" when omitted. */
|
|
143
|
+
export declare const FIELD_ATTR_CURRENCY = "currency";
|
|
144
|
+
/** Default ISO 4217 currency code when @currency is omitted on a currency field. */
|
|
145
|
+
export declare const FIELD_ATTR_CURRENCY_DEFAULT = "USD";
|
|
146
|
+
/** Auto-set semantics on a timestamp field. Values: "onCreate" | "onUpdate". */
|
|
147
|
+
export declare const FIELD_ATTR_AUTO_SET = "autoSet";
|
|
148
|
+
/** Name (or FQN) of the target object an object-typed field nests. Same wire
|
|
149
|
+
* spelling as the relationship `@objectRef` — Java's single ATTR_OBJECT_REF. */
|
|
150
|
+
export declare const FIELD_ATTR_OBJECT_REF = "objectRef";
|
|
151
|
+
export declare const AUTO_SET_ON_CREATE = "onCreate";
|
|
152
|
+
export declare const AUTO_SET_ON_UPDATE = "onUpdate";
|
|
153
|
+
export declare const AUTO_SET_VALUES: readonly ["onCreate", "onUpdate"];
|
|
154
|
+
export type AutoSetValue = (typeof AUTO_SET_VALUES)[number];
|
|
155
|
+
export declare const SORT_ORDER_ASC = "asc";
|
|
156
|
+
export declare const SORT_ORDER_DESC = "desc";
|
|
157
|
+
export declare const SORT_ORDER_VALUES: readonly ["asc", "desc"];
|
|
158
|
+
export type SortOrderValue = (typeof SORT_ORDER_VALUES)[number];
|
|
159
|
+
export declare const OBJECT_JAVA_RUNTIME_POJO = "pojo";
|
|
160
|
+
export declare const OBJECT_JAVA_RUNTIME_MAP = "map";
|
|
161
|
+
export declare const OBJECT_JAVA_RUNTIME_PROXY = "proxy";
|
|
162
|
+
export declare const OBJECT_JAVA_RUNTIME_VALUES: readonly ["pojo", "map", "proxy"];
|
|
163
|
+
export type ObjectJavaRuntimeValue = (typeof OBJECT_JAVA_RUNTIME_VALUES)[number];
|
|
164
|
+
export declare const VALIDATOR_ATTR_PATTERN = "pattern";
|
|
165
|
+
export declare const VALIDATOR_ATTR_MIN = "min";
|
|
166
|
+
export declare const VALIDATOR_ATTR_MAX = "max";
|
|
167
|
+
export declare const GENERATION_INCREMENT = "increment";
|
|
168
|
+
export declare const GENERATION_UUID = "uuid";
|
|
169
|
+
export declare const GENERATION_ASSIGNED = "assigned";
|
|
170
|
+
export declare const GENERATION_VALUES: readonly ["increment", "uuid", "assigned"];
|
|
171
|
+
export type GenerationValue = (typeof GENERATION_VALUES)[number];
|
|
172
|
+
export declare const CARDINALITY_ONE = "one";
|
|
173
|
+
export declare const CARDINALITY_MANY = "many";
|
|
174
|
+
export declare const CARDINALITY_VALUES: readonly ["one", "many"];
|
|
175
|
+
export type CardinalityValue = (typeof CARDINALITY_VALUES)[number];
|
|
176
|
+
export declare const FILTER_OPS: readonly ["eq", "ne", "gt", "gte", "lt", "lte", "in", "like", "isNull"];
|
|
177
|
+
export type FilterOp = (typeof FILTER_OPS)[number];
|
|
178
|
+
export declare const OPS_BY_SUBTYPE: Readonly<Record<string, readonly FilterOp[]>>;
|
|
179
|
+
export declare function opsForSubType(subType: string): readonly FilterOp[];
|
|
180
|
+
/** Java runtime strategy for an object. Values: "pojo" | "map" | "proxy". */
|
|
181
|
+
export declare const OBJECT_ATTR_JAVA_RUNTIME = "javaRuntime";
|
|
182
|
+
export declare const SOURCE_SUBTYPE_DB_TABLE = "dbTable";
|
|
183
|
+
export declare const SOURCE_SUBTYPE_DB_VIEW = "dbView";
|
|
184
|
+
export declare const SOURCE_SUBTYPES: readonly ["base", "dbTable", "dbView"];
|
|
185
|
+
export type SourceSubType = (typeof SOURCE_SUBTYPES)[number];
|
|
186
|
+
export declare const SOURCE_DB_TABLE_ATTR_NAME = "name";
|
|
187
|
+
export declare const SOURCE_DB_VIEW_ATTR_NAME = "name";
|
|
188
|
+
/** Shared @name attr key for MetaSource (covers both dbTable and dbView). Use this
|
|
189
|
+
* in generic source accessors instead of the subtype-specific aliases above. */
|
|
190
|
+
export declare const SOURCE_ATTR_NAME = "name";
|
|
191
|
+
/** Optional DB schema attr on source[dbTable] / source[dbView]. Postgres uses
|
|
192
|
+
* this to namespace tables/views. SQLite has no schema concept and rejects
|
|
193
|
+
* any non-default value. Default for Postgres: "public". */
|
|
194
|
+
export declare const SOURCE_ATTR_SCHEMA = "schema";
|
|
195
|
+
/** Default Postgres schema when @schema is omitted from a source. */
|
|
196
|
+
export declare const DEFAULT_DB_SCHEMA_POSTGRES = "public";
|
|
197
|
+
export declare const ORIGIN_SUBTYPE_PASSTHROUGH = "passthrough";
|
|
198
|
+
export declare const ORIGIN_SUBTYPE_AGGREGATE = "aggregate";
|
|
199
|
+
export declare const ORIGIN_SUBTYPES: readonly ["base", "passthrough", "aggregate"];
|
|
200
|
+
export type OriginSubType = (typeof ORIGIN_SUBTYPES)[number];
|
|
201
|
+
export declare const ORIGIN_PASSTHROUGH_ATTR_FROM = "from";
|
|
202
|
+
export declare const ORIGIN_PASSTHROUGH_ATTR_VIA = "via";
|
|
203
|
+
export declare const ORIGIN_AGGREGATE_ATTR_AGG = "agg";
|
|
204
|
+
export declare const ORIGIN_AGGREGATE_ATTR_OF = "of";
|
|
205
|
+
export declare const ORIGIN_AGGREGATE_ATTR_VIA = "via";
|
|
206
|
+
export declare const AGGREGATE_FUNCTIONS: readonly ["count", "sum", "avg", "min", "max"];
|
|
207
|
+
export type AggregateFunction = (typeof AGGREGATE_FUNCTIONS)[number];
|
|
208
|
+
//# sourceMappingURL=constants.d.ts.map
|