@astrale-os/kernel-dsl 0.1.4 → 0.2.0-beta.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/index.d.ts +1 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -29
- package/dist/index.js.map +1 -0
- package/dist/upgrade/contract.d.ts +32 -0
- package/dist/upgrade/contract.d.ts.map +1 -0
- package/dist/upgrade/contract.js +2 -0
- package/dist/upgrade/contract.js.map +1 -0
- package/dist/upgrade/index.d.ts +2 -0
- package/dist/upgrade/index.d.ts.map +1 -0
- package/dist/upgrade/index.js +2 -0
- package/dist/upgrade/index.js.map +1 -0
- package/dist/v1/addressing/index.d.ts +6 -0
- package/dist/v1/addressing/index.d.ts.map +1 -0
- package/dist/v1/addressing/index.js +5 -0
- package/dist/v1/addressing/index.js.map +1 -0
- package/dist/v1/addressing/key.d.ts +21 -0
- package/dist/v1/addressing/key.d.ts.map +1 -0
- package/dist/v1/addressing/key.js +49 -0
- package/dist/v1/addressing/key.js.map +1 -0
- package/dist/v1/addressing/patterns.d.ts +18 -0
- package/dist/v1/addressing/patterns.d.ts.map +1 -0
- package/dist/v1/addressing/patterns.js +20 -0
- package/dist/v1/addressing/patterns.js.map +1 -0
- package/dist/v1/addressing/property-key.d.ts +18 -0
- package/dist/v1/addressing/property-key.d.ts.map +1 -0
- package/dist/v1/addressing/property-key.js +30 -0
- package/dist/v1/addressing/property-key.js.map +1 -0
- package/dist/v1/addressing/ref.d.ts +35 -0
- package/dist/v1/addressing/ref.d.ts.map +1 -0
- package/dist/v1/addressing/ref.js +94 -0
- package/dist/v1/addressing/ref.js.map +1 -0
- package/dist/v1/addressing/schema-ref.d.ts +8 -0
- package/dist/v1/addressing/schema-ref.d.ts.map +1 -0
- package/dist/v1/addressing/schema-ref.js +2 -0
- package/dist/v1/addressing/schema-ref.js.map +1 -0
- package/dist/v1/builder/callable.d.ts +81 -0
- package/dist/v1/builder/callable.d.ts.map +1 -0
- package/dist/v1/builder/callable.js +44 -0
- package/dist/v1/builder/callable.js.map +1 -0
- package/dist/v1/builder/compiler/callable.d.ts +20 -0
- package/dist/v1/builder/compiler/callable.d.ts.map +1 -0
- package/dist/v1/builder/compiler/callable.js +139 -0
- package/dist/v1/builder/compiler/callable.js.map +1 -0
- package/dist/v1/builder/compiler/core.d.ts +6 -0
- package/dist/v1/builder/compiler/core.d.ts.map +1 -0
- package/dist/v1/builder/compiler/core.js +44 -0
- package/dist/v1/builder/compiler/core.js.map +1 -0
- package/dist/v1/builder/compiler/core.properties.d.ts +6 -0
- package/dist/v1/builder/compiler/core.properties.d.ts.map +1 -0
- package/dist/v1/builder/compiler/core.properties.js +70 -0
- package/dist/v1/builder/compiler/core.properties.js.map +1 -0
- package/dist/v1/builder/compiler/definition.d.ts +26 -0
- package/dist/v1/builder/compiler/definition.d.ts.map +1 -0
- package/dist/v1/builder/compiler/definition.js +154 -0
- package/dist/v1/builder/compiler/definition.js.map +1 -0
- package/dist/v1/builder/compiler/policy.d.ts +17 -0
- package/dist/v1/builder/compiler/policy.d.ts.map +1 -0
- package/dist/v1/builder/compiler/policy.js +54 -0
- package/dist/v1/builder/compiler/policy.js.map +1 -0
- package/dist/v1/builder/compiler/schema.capture.d.ts +5 -0
- package/dist/v1/builder/compiler/schema.capture.d.ts.map +1 -0
- package/dist/v1/builder/compiler/schema.capture.js +85 -0
- package/dist/v1/builder/compiler/schema.capture.js.map +1 -0
- package/dist/v1/builder/compiler/schema.context.d.ts +45 -0
- package/dist/v1/builder/compiler/schema.context.d.ts.map +1 -0
- package/dist/v1/builder/compiler/schema.context.js +255 -0
- package/dist/v1/builder/compiler/schema.context.js.map +1 -0
- package/dist/v1/builder/compiler/schema.d.ts +10 -0
- package/dist/v1/builder/compiler/schema.d.ts.map +1 -0
- package/dist/v1/builder/compiler/schema.js +90 -0
- package/dist/v1/builder/compiler/schema.js.map +1 -0
- package/dist/v1/builder/compiler/schema.ownership.d.ts +9 -0
- package/dist/v1/builder/compiler/schema.ownership.d.ts.map +1 -0
- package/dist/v1/builder/compiler/schema.ownership.js +30 -0
- package/dist/v1/builder/compiler/schema.ownership.js.map +1 -0
- package/dist/v1/builder/compiler/value.d.ts +22 -0
- package/dist/v1/builder/compiler/value.d.ts.map +1 -0
- package/dist/v1/builder/compiler/value.js +149 -0
- package/dist/v1/builder/compiler/value.js.map +1 -0
- package/dist/v1/builder/compiler/value.path.d.ts +4 -0
- package/dist/v1/builder/compiler/value.path.d.ts.map +1 -0
- package/dist/v1/builder/compiler/value.path.js +21 -0
- package/dist/v1/builder/compiler/value.path.js.map +1 -0
- package/dist/v1/builder/compiler/value.zod.d.ts +33 -0
- package/dist/v1/builder/compiler/value.zod.d.ts.map +1 -0
- package/dist/v1/builder/compiler/value.zod.js +343 -0
- package/dist/v1/builder/compiler/value.zod.js.map +1 -0
- package/dist/v1/builder/compiler/view.d.ts +12 -0
- package/dist/v1/builder/compiler/view.d.ts.map +1 -0
- package/dist/v1/builder/compiler/view.js +27 -0
- package/dist/v1/builder/compiler/view.js.map +1 -0
- package/dist/v1/builder/core.d.ts +27 -0
- package/dist/v1/builder/core.d.ts.map +1 -0
- package/dist/v1/builder/core.js +21 -0
- package/dist/v1/builder/core.js.map +1 -0
- package/dist/v1/builder/definition.d.ts +105 -0
- package/dist/v1/builder/definition.d.ts.map +1 -0
- package/dist/v1/builder/definition.js +97 -0
- package/dist/v1/builder/definition.js.map +1 -0
- package/dist/v1/builder/full-match.d.ts +12 -0
- package/dist/v1/builder/full-match.d.ts.map +1 -0
- package/dist/v1/builder/full-match.js +21 -0
- package/dist/v1/builder/full-match.js.map +1 -0
- package/dist/v1/builder/index.d.ts +22 -0
- package/dist/v1/builder/index.d.ts.map +1 -0
- package/dist/v1/builder/index.js +11 -0
- package/dist/v1/builder/index.js.map +1 -0
- package/dist/v1/builder/internal/authoring.d.ts +8 -0
- package/dist/v1/builder/internal/authoring.d.ts.map +1 -0
- package/dist/v1/builder/internal/authoring.js +15 -0
- package/dist/v1/builder/internal/authoring.js.map +1 -0
- package/dist/v1/builder/internal/authoring.lazy.d.ts +3 -0
- package/dist/v1/builder/internal/authoring.lazy.d.ts.map +1 -0
- package/dist/v1/builder/internal/authoring.lazy.js +14 -0
- package/dist/v1/builder/internal/authoring.lazy.js.map +1 -0
- package/dist/v1/builder/internal/diagnostic.d.ts +4 -0
- package/dist/v1/builder/internal/diagnostic.d.ts.map +1 -0
- package/dist/v1/builder/internal/diagnostic.js +16 -0
- package/dist/v1/builder/internal/diagnostic.js.map +1 -0
- package/dist/v1/builder/internal/path.metadata.d.ts +5 -0
- package/dist/v1/builder/internal/path.metadata.d.ts.map +1 -0
- package/dist/v1/builder/internal/path.metadata.js +8 -0
- package/dist/v1/builder/internal/path.metadata.js.map +1 -0
- package/dist/v1/builder/path.d.ts +9 -0
- package/dist/v1/builder/path.d.ts.map +1 -0
- package/dist/v1/builder/path.js +12 -0
- package/dist/v1/builder/path.js.map +1 -0
- package/dist/v1/builder/policy.d.ts +50 -0
- package/dist/v1/builder/policy.d.ts.map +1 -0
- package/dist/v1/builder/policy.js +79 -0
- package/dist/v1/builder/policy.js.map +1 -0
- package/dist/v1/builder/property.d.ts +23 -0
- package/dist/v1/builder/property.d.ts.map +1 -0
- package/dist/v1/builder/property.js +12 -0
- package/dist/v1/builder/property.js.map +1 -0
- package/dist/v1/builder/schema.d.ts +6 -0
- package/dist/v1/builder/schema.d.ts.map +1 -0
- package/dist/v1/builder/schema.input.d.ts +19 -0
- package/dist/v1/builder/schema.input.d.ts.map +1 -0
- package/dist/v1/builder/schema.input.js +2 -0
- package/dist/v1/builder/schema.input.js.map +1 -0
- package/dist/v1/builder/schema.js +6 -0
- package/dist/v1/builder/schema.js.map +1 -0
- package/dist/v1/builder/value-schema.d.ts +17 -0
- package/dist/v1/builder/value-schema.d.ts.map +1 -0
- package/dist/v1/builder/value-schema.js +11 -0
- package/dist/v1/builder/value-schema.js.map +1 -0
- package/dist/v1/builder/view.d.ts +19 -0
- package/dist/v1/builder/view.d.ts.map +1 -0
- package/dist/v1/builder/view.js +7 -0
- package/dist/v1/builder/view.js.map +1 -0
- package/dist/v1/builder.d.ts +3 -0
- package/dist/v1/builder.d.ts.map +1 -0
- package/dist/v1/builder.js +2 -0
- package/dist/v1/builder.js.map +1 -0
- package/dist/v1/bundle/codec.d.ts +6 -0
- package/dist/v1/bundle/codec.d.ts.map +1 -0
- package/dist/v1/bundle/codec.js +151 -0
- package/dist/v1/bundle/codec.js.map +1 -0
- package/dist/v1/bundle/index.d.ts +17 -0
- package/dist/v1/bundle/index.d.ts.map +1 -0
- package/dist/v1/bundle/index.js +20 -0
- package/dist/v1/bundle/index.js.map +1 -0
- package/dist/v1/bundle/model.d.ts +19 -0
- package/dist/v1/bundle/model.d.ts.map +1 -0
- package/dist/v1/bundle/model.js +17 -0
- package/dist/v1/bundle/model.js.map +1 -0
- package/dist/v1/bundle/structure.d.ts +8 -0
- package/dist/v1/bundle/structure.d.ts.map +1 -0
- package/dist/v1/bundle/structure.js +71 -0
- package/dist/v1/bundle/structure.js.map +1 -0
- package/dist/v1/bundle.d.ts +3 -0
- package/dist/v1/bundle.d.ts.map +1 -0
- package/dist/v1/bundle.js +3 -0
- package/dist/v1/bundle.js.map +1 -0
- package/dist/v1/index.d.ts +9 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +6 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/schema/callable.d.ts +29 -0
- package/dist/v1/schema/callable.d.ts.map +1 -0
- package/dist/v1/schema/callable.js +2 -0
- package/dist/v1/schema/callable.js.map +1 -0
- package/dist/v1/schema/canonical/domain.d.ts +3 -0
- package/dist/v1/schema/canonical/domain.d.ts.map +1 -0
- package/dist/v1/schema/canonical/domain.digest.d.ts +4 -0
- package/dist/v1/schema/canonical/domain.digest.d.ts.map +1 -0
- package/dist/v1/schema/canonical/domain.digest.js +9 -0
- package/dist/v1/schema/canonical/domain.digest.js.map +1 -0
- package/dist/v1/schema/canonical/domain.js +193 -0
- package/dist/v1/schema/canonical/domain.js.map +1 -0
- package/dist/v1/schema/canonical/freeze.d.ts +2 -0
- package/dist/v1/schema/canonical/freeze.d.ts.map +1 -0
- package/dist/v1/schema/canonical/freeze.js +10 -0
- package/dist/v1/schema/canonical/freeze.js.map +1 -0
- package/dist/v1/schema/core/declaration.d.ts +17 -0
- package/dist/v1/schema/core/declaration.d.ts.map +1 -0
- package/dist/v1/schema/core/declaration.js +2 -0
- package/dist/v1/schema/core/declaration.js.map +1 -0
- package/dist/v1/schema/core/validate.d.ts +6 -0
- package/dist/v1/schema/core/validate.d.ts.map +1 -0
- package/dist/v1/schema/core/validate.js +237 -0
- package/dist/v1/schema/core/validate.js.map +1 -0
- package/dist/v1/schema/definition/analysis.d.ts +41 -0
- package/dist/v1/schema/definition/analysis.d.ts.map +1 -0
- package/dist/v1/schema/definition/analysis.js +188 -0
- package/dist/v1/schema/definition/analysis.js.map +1 -0
- package/dist/v1/schema/definition/class.d.ts +28 -0
- package/dist/v1/schema/definition/class.d.ts.map +1 -0
- package/dist/v1/schema/definition/class.js +2 -0
- package/dist/v1/schema/definition/class.js.map +1 -0
- package/dist/v1/schema/definition/data.d.ts +12 -0
- package/dist/v1/schema/definition/data.d.ts.map +1 -0
- package/dist/v1/schema/definition/data.js +3 -0
- package/dist/v1/schema/definition/data.js.map +1 -0
- package/dist/v1/schema/definition/edge.d.ts +22 -0
- package/dist/v1/schema/definition/edge.d.ts.map +1 -0
- package/dist/v1/schema/definition/edge.js +2 -0
- package/dist/v1/schema/definition/edge.js.map +1 -0
- package/dist/v1/schema/definition/interface.d.ts +22 -0
- package/dist/v1/schema/definition/interface.d.ts.map +1 -0
- package/dist/v1/schema/definition/interface.js +2 -0
- package/dist/v1/schema/definition/interface.js.map +1 -0
- package/dist/v1/schema/definition/property.d.ts +11 -0
- package/dist/v1/schema/definition/property.d.ts.map +1 -0
- package/dist/v1/schema/definition/property.js +2 -0
- package/dist/v1/schema/definition/property.js.map +1 -0
- package/dist/v1/schema/definition/validate.d.ts +5 -0
- package/dist/v1/schema/definition/validate.d.ts.map +1 -0
- package/dist/v1/schema/definition/validate.js +152 -0
- package/dist/v1/schema/definition/validate.js.map +1 -0
- package/dist/v1/schema/dependency.meaning.d.ts +30 -0
- package/dist/v1/schema/dependency.meaning.d.ts.map +1 -0
- package/dist/v1/schema/dependency.meaning.js +608 -0
- package/dist/v1/schema/dependency.meaning.js.map +1 -0
- package/dist/v1/schema/diagnostic.d.ts +12 -0
- package/dist/v1/schema/diagnostic.d.ts.map +1 -0
- package/dist/v1/schema/diagnostic.js +21 -0
- package/dist/v1/schema/diagnostic.js.map +1 -0
- package/dist/v1/schema/domain.accept.d.ts +4 -0
- package/dist/v1/schema/domain.accept.d.ts.map +1 -0
- package/dist/v1/schema/domain.accept.js +27 -0
- package/dist/v1/schema/domain.accept.js.map +1 -0
- package/dist/v1/schema/domain.codec.d.ts +6 -0
- package/dist/v1/schema/domain.codec.d.ts.map +1 -0
- package/dist/v1/schema/domain.codec.js +22 -0
- package/dist/v1/schema/domain.codec.js.map +1 -0
- package/dist/v1/schema/domain.header.d.ts +15 -0
- package/dist/v1/schema/domain.header.d.ts.map +1 -0
- package/dist/v1/schema/domain.header.js +21 -0
- package/dist/v1/schema/domain.header.js.map +1 -0
- package/dist/v1/schema/domain.ir.d.ts +40 -0
- package/dist/v1/schema/domain.ir.d.ts.map +1 -0
- package/dist/v1/schema/domain.ir.js +5 -0
- package/dist/v1/schema/domain.ir.js.map +1 -0
- package/dist/v1/schema/domain.lookup.d.ts +19 -0
- package/dist/v1/schema/domain.lookup.d.ts.map +1 -0
- package/dist/v1/schema/domain.lookup.js +32 -0
- package/dist/v1/schema/domain.lookup.js.map +1 -0
- package/dist/v1/schema/domain.resolve.d.ts +26 -0
- package/dist/v1/schema/domain.resolve.d.ts.map +1 -0
- package/dist/v1/schema/domain.resolve.js +43 -0
- package/dist/v1/schema/domain.resolve.js.map +1 -0
- package/dist/v1/schema/domain.revision.d.ts +12 -0
- package/dist/v1/schema/domain.revision.d.ts.map +1 -0
- package/dist/v1/schema/domain.revision.js +18 -0
- package/dist/v1/schema/domain.revision.js.map +1 -0
- package/dist/v1/schema/domain.validate.d.ts +12 -0
- package/dist/v1/schema/domain.validate.d.ts.map +1 -0
- package/dist/v1/schema/domain.validate.js +36 -0
- package/dist/v1/schema/domain.validate.js.map +1 -0
- package/dist/v1/schema/index.d.ts +36 -0
- package/dist/v1/schema/index.d.ts.map +1 -0
- package/dist/v1/schema/index.js +16 -0
- package/dist/v1/schema/index.js.map +1 -0
- package/dist/v1/schema/metadata.d.ts +13 -0
- package/dist/v1/schema/metadata.d.ts.map +1 -0
- package/dist/v1/schema/metadata.js +13 -0
- package/dist/v1/schema/metadata.js.map +1 -0
- package/dist/v1/schema/policy/ast.d.ts +77 -0
- package/dist/v1/schema/policy/ast.d.ts.map +1 -0
- package/dist/v1/schema/policy/ast.js +2 -0
- package/dist/v1/schema/policy/ast.js.map +1 -0
- package/dist/v1/schema/policy/normalize.d.ts +5 -0
- package/dist/v1/schema/policy/normalize.d.ts.map +1 -0
- package/dist/v1/schema/policy/normalize.js +230 -0
- package/dist/v1/schema/policy/normalize.js.map +1 -0
- package/dist/v1/schema/policy/validation/branches.d.ts +21 -0
- package/dist/v1/schema/policy/validation/branches.d.ts.map +1 -0
- package/dist/v1/schema/policy/validation/branches.js +155 -0
- package/dist/v1/schema/policy/validation/branches.js.map +1 -0
- package/dist/v1/schema/policy/validation/budgets.d.ts +19 -0
- package/dist/v1/schema/policy/validation/budgets.d.ts.map +1 -0
- package/dist/v1/schema/policy/validation/budgets.js +132 -0
- package/dist/v1/schema/policy/validation/budgets.js.map +1 -0
- package/dist/v1/schema/policy/validation/context.d.ts +28 -0
- package/dist/v1/schema/policy/validation/context.d.ts.map +1 -0
- package/dist/v1/schema/policy/validation/context.js +99 -0
- package/dist/v1/schema/policy/validation/context.js.map +1 -0
- package/dist/v1/schema/policy/validation/references.d.ts +3 -0
- package/dist/v1/schema/policy/validation/references.d.ts.map +1 -0
- package/dist/v1/schema/policy/validation/references.js +136 -0
- package/dist/v1/schema/policy/validation/references.js.map +1 -0
- package/dist/v1/schema/policy/validation/typing.d.ts +23 -0
- package/dist/v1/schema/policy/validation/typing.d.ts.map +1 -0
- package/dist/v1/schema/policy/validation/typing.js +357 -0
- package/dist/v1/schema/policy/validation/typing.js.map +1 -0
- package/dist/v1/schema/policy/validation/uses.d.ts +6 -0
- package/dist/v1/schema/policy/validation/uses.d.ts.map +1 -0
- package/dist/v1/schema/policy/validation/uses.js +269 -0
- package/dist/v1/schema/policy/validation/uses.js.map +1 -0
- package/dist/v1/schema/policy/validation/validate.d.ts +12 -0
- package/dist/v1/schema/policy/validation/validate.d.ts.map +1 -0
- package/dist/v1/schema/policy/validation/validate.js +24 -0
- package/dist/v1/schema/policy/validation/validate.js.map +1 -0
- package/dist/v1/schema/reference.d.ts +43 -0
- package/dist/v1/schema/reference.d.ts.map +1 -0
- package/dist/v1/schema/reference.js +31 -0
- package/dist/v1/schema/reference.js.map +1 -0
- package/dist/v1/schema/resolution/closure.d.ts +10 -0
- package/dist/v1/schema/resolution/closure.d.ts.map +1 -0
- package/dist/v1/schema/resolution/closure.js +50 -0
- package/dist/v1/schema/resolution/closure.js.map +1 -0
- package/dist/v1/schema/resolution/context.d.ts +18 -0
- package/dist/v1/schema/resolution/context.d.ts.map +1 -0
- package/dist/v1/schema/resolution/context.js +126 -0
- package/dist/v1/schema/resolution/context.js.map +1 -0
- package/dist/v1/schema/resolution/definition.index.d.ts +43 -0
- package/dist/v1/schema/resolution/definition.index.d.ts.map +1 -0
- package/dist/v1/schema/resolution/definition.index.js +27 -0
- package/dist/v1/schema/resolution/definition.index.js.map +1 -0
- package/dist/v1/schema/resolution/origins.d.ts +17 -0
- package/dist/v1/schema/resolution/origins.d.ts.map +1 -0
- package/dist/v1/schema/resolution/origins.js +129 -0
- package/dist/v1/schema/resolution/origins.js.map +1 -0
- package/dist/v1/schema/resolution/value.registry.d.ts +8 -0
- package/dist/v1/schema/resolution/value.registry.d.ts.map +1 -0
- package/dist/v1/schema/resolution/value.registry.js +46 -0
- package/dist/v1/schema/resolution/value.registry.js.map +1 -0
- package/dist/v1/schema/validation/domain.route.d.ts +5 -0
- package/dist/v1/schema/validation/domain.route.d.ts.map +1 -0
- package/dist/v1/schema/validation/domain.route.js +33 -0
- package/dist/v1/schema/validation/domain.route.js.map +1 -0
- package/dist/v1/schema/validation/domain.structure.d.ts +5 -0
- package/dist/v1/schema/validation/domain.structure.d.ts.map +1 -0
- package/dist/v1/schema/validation/domain.structure.js +422 -0
- package/dist/v1/schema/validation/domain.structure.js.map +1 -0
- package/dist/v1/schema/validation/value.d.ts +5 -0
- package/dist/v1/schema/validation/value.d.ts.map +1 -0
- package/dist/v1/schema/validation/value.js +44 -0
- package/dist/v1/schema/validation/value.js.map +1 -0
- package/dist/v1/schema/value/extensions/node-path/schema.d.ts +6 -0
- package/dist/v1/schema/value/extensions/node-path/schema.d.ts.map +1 -0
- package/dist/v1/schema/value/extensions/node-path/schema.js +19 -0
- package/dist/v1/schema/value/extensions/node-path/schema.js.map +1 -0
- package/dist/v1/schema/value/extensions/node-path/validate.d.ts +5 -0
- package/dist/v1/schema/value/extensions/node-path/validate.d.ts.map +1 -0
- package/dist/v1/schema/value/extensions/node-path/validate.js +80 -0
- package/dist/v1/schema/value/extensions/node-path/validate.js.map +1 -0
- package/dist/v1/schema/value/index.d.ts +14 -0
- package/dist/v1/schema/value/index.d.ts.map +1 -0
- package/dist/v1/schema/value/index.js +24 -0
- package/dist/v1/schema/value/index.js.map +1 -0
- package/dist/v1/schema/value/instance/assertions.d.ts +7 -0
- package/dist/v1/schema/value/instance/assertions.d.ts.map +1 -0
- package/dist/v1/schema/value/instance/assertions.js +59 -0
- package/dist/v1/schema/value/instance/assertions.js.map +1 -0
- package/dist/v1/schema/value/instance/compiler.d.ts +13 -0
- package/dist/v1/schema/value/instance/compiler.d.ts.map +1 -0
- package/dist/v1/schema/value/instance/compiler.js +69 -0
- package/dist/v1/schema/value/instance/compiler.js.map +1 -0
- package/dist/v1/schema/value/instance/evaluator.d.ts +5 -0
- package/dist/v1/schema/value/instance/evaluator.d.ts.map +1 -0
- package/dist/v1/schema/value/instance/evaluator.js +373 -0
- package/dist/v1/schema/value/instance/evaluator.js.map +1 -0
- package/dist/v1/schema/value/instance/types.d.ts +33 -0
- package/dist/v1/schema/value/instance/types.d.ts.map +1 -0
- package/dist/v1/schema/value/instance/types.js +10 -0
- package/dist/v1/schema/value/instance/types.js.map +1 -0
- package/dist/v1/schema/value/instance.validate.d.ts +13 -0
- package/dist/v1/schema/value/instance.validate.d.ts.map +1 -0
- package/dist/v1/schema/value/instance.validate.js +44 -0
- package/dist/v1/schema/value/instance.validate.js.map +1 -0
- package/dist/v1/schema/value/instant.d.ts +9 -0
- package/dist/v1/schema/value/instant.d.ts.map +1 -0
- package/dist/v1/schema/value/instant.js +37 -0
- package/dist/v1/schema/value/instant.js.map +1 -0
- package/dist/v1/schema/value/location/keywords.d.ts +4 -0
- package/dist/v1/schema/value/location/keywords.d.ts.map +1 -0
- package/dist/v1/schema/value/location/keywords.js +21 -0
- package/dist/v1/schema/value/location/keywords.js.map +1 -0
- package/dist/v1/schema/value/location/pointer.d.ts +5 -0
- package/dist/v1/schema/value/location/pointer.d.ts.map +1 -0
- package/dist/v1/schema/value/location/pointer.js +50 -0
- package/dist/v1/schema/value/location/pointer.js.map +1 -0
- package/dist/v1/schema/value/location/walk.d.ts +11 -0
- package/dist/v1/schema/value/location/walk.d.ts.map +1 -0
- package/dist/v1/schema/value/location/walk.js +54 -0
- package/dist/v1/schema/value/location/walk.js.map +1 -0
- package/dist/v1/schema/value/object.d.ts +5 -0
- package/dist/v1/schema/value/object.d.ts.map +1 -0
- package/dist/v1/schema/value/object.js +4 -0
- package/dist/v1/schema/value/object.js.map +1 -0
- package/dist/v1/schema/value/ordering.d.ts +11 -0
- package/dist/v1/schema/value/ordering.d.ts.map +1 -0
- package/dist/v1/schema/value/ordering.js +172 -0
- package/dist/v1/schema/value/ordering.js.map +1 -0
- package/dist/v1/schema/value/profile/canonicalize.d.ts +5 -0
- package/dist/v1/schema/value/profile/canonicalize.d.ts.map +1 -0
- package/dist/v1/schema/value/profile/canonicalize.js +133 -0
- package/dist/v1/schema/value/profile/canonicalize.js.map +1 -0
- package/dist/v1/schema/value/profile/dialect.d.ts +5 -0
- package/dist/v1/schema/value/profile/dialect.d.ts.map +1 -0
- package/dist/v1/schema/value/profile/dialect.js +36 -0
- package/dist/v1/schema/value/profile/dialect.js.map +1 -0
- package/dist/v1/schema/value/profile/json.validate.d.ts +3 -0
- package/dist/v1/schema/value/profile/json.validate.d.ts.map +1 -0
- package/dist/v1/schema/value/profile/json.validate.js +15 -0
- package/dist/v1/schema/value/profile/json.validate.js.map +1 -0
- package/dist/v1/schema/value/profile/meta-schema.validate.d.ts +4 -0
- package/dist/v1/schema/value/profile/meta-schema.validate.d.ts.map +1 -0
- package/dist/v1/schema/value/profile/meta-schema.validate.js +25 -0
- package/dist/v1/schema/value/profile/meta-schema.validate.js.map +1 -0
- package/dist/v1/schema/value/profile/rules.d.ts +5 -0
- package/dist/v1/schema/value/profile/rules.d.ts.map +1 -0
- package/dist/v1/schema/value/profile/rules.js +152 -0
- package/dist/v1/schema/value/profile/rules.js.map +1 -0
- package/dist/v1/schema/value/profile/validate.d.ts +5 -0
- package/dist/v1/schema/value/profile/validate.d.ts.map +1 -0
- package/dist/v1/schema/value/profile/validate.js +47 -0
- package/dist/v1/schema/value/profile/validate.js.map +1 -0
- package/dist/v1/schema/value/profile/vocabulary.d.ts +3 -0
- package/dist/v1/schema/value/profile/vocabulary.d.ts.map +1 -0
- package/dist/v1/schema/value/profile/vocabulary.js +69 -0
- package/dist/v1/schema/value/profile/vocabulary.js.map +1 -0
- package/dist/v1/schema/value/regexp/linear.d.ts +20 -0
- package/dist/v1/schema/value/regexp/linear.d.ts.map +1 -0
- package/dist/v1/schema/value/regexp/linear.js +24 -0
- package/dist/v1/schema/value/regexp/linear.js.map +1 -0
- package/dist/v1/schema/value/regexp/lower.d.ts +4 -0
- package/dist/v1/schema/value/regexp/lower.d.ts.map +1 -0
- package/dist/v1/schema/value/regexp/lower.js +27 -0
- package/dist/v1/schema/value/regexp/lower.js.map +1 -0
- package/dist/v1/schema/value/regexp/pattern.d.ts +3 -0
- package/dist/v1/schema/value/regexp/pattern.d.ts.map +1 -0
- package/dist/v1/schema/value/regexp/pattern.js +39 -0
- package/dist/v1/schema/value/regexp/pattern.js.map +1 -0
- package/dist/v1/schema/value/regexp/syntax.d.ts +3 -0
- package/dist/v1/schema/value/regexp/syntax.d.ts.map +1 -0
- package/dist/v1/schema/value/regexp/syntax.js +219 -0
- package/dist/v1/schema/value/regexp/syntax.js.map +1 -0
- package/dist/v1/schema/value/registry.d.ts +22 -0
- package/dist/v1/schema/value/registry.d.ts.map +1 -0
- package/dist/v1/schema/value/registry.js +2 -0
- package/dist/v1/schema/value/registry.js.map +1 -0
- package/dist/v1/schema/value/resources/closure.d.ts +12 -0
- package/dist/v1/schema/value/resources/closure.d.ts.map +1 -0
- package/dist/v1/schema/value/resources/closure.js +59 -0
- package/dist/v1/schema/value/resources/closure.js.map +1 -0
- package/dist/v1/schema/value/resources/recursion.d.ts +6 -0
- package/dist/v1/schema/value/resources/recursion.d.ts.map +1 -0
- package/dist/v1/schema/value/resources/recursion.js +96 -0
- package/dist/v1/schema/value/resources/recursion.js.map +1 -0
- package/dist/v1/schema/value/resources/references.d.ts +25 -0
- package/dist/v1/schema/value/resources/references.d.ts.map +1 -0
- package/dist/v1/schema/value/resources/references.js +93 -0
- package/dist/v1/schema/value/resources/references.js.map +1 -0
- package/dist/v1/schema/value/resources/registry.index.d.ts +22 -0
- package/dist/v1/schema/value/resources/registry.index.d.ts.map +1 -0
- package/dist/v1/schema/value/resources/registry.index.js +114 -0
- package/dist/v1/schema/value/resources/registry.index.js.map +1 -0
- package/dist/v1/schema/value/schema.d.ts +26 -0
- package/dist/v1/schema/value/schema.d.ts.map +1 -0
- package/dist/v1/schema/value/schema.js +13 -0
- package/dist/v1/schema/value/schema.js.map +1 -0
- package/dist/v1/schema/view/declaration.d.ts +14 -0
- package/dist/v1/schema/view/declaration.d.ts.map +1 -0
- package/dist/v1/schema/view/declaration.js +2 -0
- package/dist/v1/schema/view/declaration.js.map +1 -0
- package/dist/v1/schema/view/validate.d.ts +4 -0
- package/dist/v1/schema/view/validate.d.ts.map +1 -0
- package/dist/v1/schema/view/validate.js +22 -0
- package/dist/v1/schema/view/validate.js.map +1 -0
- package/dist/v1/schema.d.ts +3 -0
- package/dist/v1/schema.d.ts.map +1 -0
- package/dist/v1/schema.js +3 -0
- package/dist/v1/schema.js.map +1 -0
- package/dist/v1.d.ts +3 -0
- package/dist/v1.d.ts.map +1 -0
- package/dist/v1.js +3 -0
- package/dist/v1.js.map +1 -0
- package/dist/value/accept.d.ts +9 -0
- package/dist/value/accept.d.ts.map +1 -0
- package/dist/value/accept.js +133 -0
- package/dist/value/accept.js.map +1 -0
- package/dist/value/canonical.d.ts +5 -0
- package/dist/value/canonical.d.ts.map +1 -0
- package/dist/value/canonical.js +42 -0
- package/dist/value/canonical.js.map +1 -0
- package/dist/value/decode.d.ts +5 -0
- package/dist/value/decode.d.ts.map +1 -0
- package/dist/value/decode.js +109 -0
- package/dist/value/decode.js.map +1 -0
- package/dist/value/equal.d.ts +4 -0
- package/dist/value/equal.d.ts.map +1 -0
- package/dist/value/equal.js +6 -0
- package/dist/value/equal.js.map +1 -0
- package/dist/value/error.d.ts +13 -0
- package/dist/value/error.d.ts.map +1 -0
- package/dist/value/error.js +22 -0
- package/dist/value/error.js.map +1 -0
- package/dist/value/index.d.ts +10 -0
- package/dist/value/index.d.ts.map +1 -0
- package/dist/value/index.js +7 -0
- package/dist/value/index.js.map +1 -0
- package/dist/value/json.d.ts +4 -0
- package/dist/value/json.d.ts.map +1 -0
- package/dist/value/json.js +4 -0
- package/dist/value/json.js.map +1 -0
- package/dist/value/limits.d.ts +22 -0
- package/dist/value/limits.d.ts.map +1 -0
- package/dist/value/limits.js +16 -0
- package/dist/value/limits.js.map +1 -0
- package/dist/value/types.d.ts +7 -0
- package/dist/value/types.d.ts.map +1 -0
- package/dist/value/types.js +2 -0
- package/dist/value/types.js.map +1 -0
- package/dist/value/unicode.d.ts +5 -0
- package/dist/value/unicode.d.ts.map +1 -0
- package/dist/value/unicode.js +65 -0
- package/dist/value/unicode.js.map +1 -0
- package/dist/version/dispatch.d.ts +25 -0
- package/dist/version/dispatch.d.ts.map +1 -0
- package/dist/version/dispatch.js +48 -0
- package/dist/version/dispatch.js.map +1 -0
- package/dist/version/index.d.ts +3 -0
- package/dist/version/index.d.ts.map +1 -0
- package/dist/version/index.js +2 -0
- package/dist/version/index.js.map +1 -0
- package/package.json +19 -8
- package/dist/builders/bitmask.d.ts +0 -5
- package/dist/builders/bitmask.d.ts.map +0 -1
- package/dist/builders/bitmask.js +0 -11
- package/dist/builders/data.d.ts +0 -7
- package/dist/builders/data.d.ts.map +0 -1
- package/dist/builders/data.js +0 -17
- package/dist/builders/definition/base.d.ts +0 -13
- package/dist/builders/definition/base.d.ts.map +0 -1
- package/dist/builders/definition/base.js +0 -23
- package/dist/builders/definition/edge-class.d.ts +0 -8
- package/dist/builders/definition/edge-class.d.ts.map +0 -1
- package/dist/builders/definition/edge-class.js +0 -8
- package/dist/builders/definition/edge-interface.d.ts +0 -8
- package/dist/builders/definition/edge-interface.d.ts.map +0 -1
- package/dist/builders/definition/edge-interface.js +0 -8
- package/dist/builders/definition/node-class.d.ts +0 -7
- package/dist/builders/definition/node-class.d.ts.map +0 -1
- package/dist/builders/definition/node-class.js +0 -8
- package/dist/builders/definition/node-interface.d.ts +0 -7
- package/dist/builders/definition/node-interface.d.ts.map +0 -1
- package/dist/builders/definition/node-interface.js +0 -8
- package/dist/builders/function.d.ts +0 -20
- package/dist/builders/function.d.ts.map +0 -1
- package/dist/builders/function.js +0 -8
- package/dist/builders/prop.d.ts +0 -7
- package/dist/builders/prop.d.ts.map +0 -1
- package/dist/builders/prop.js +0 -8
- package/dist/builders/ref.d.ts +0 -12
- package/dist/builders/ref.d.ts.map +0 -1
- package/dist/builders/ref.js +0 -26
- package/dist/grammar/definition/base.d.ts +0 -13
- package/dist/grammar/definition/base.d.ts.map +0 -1
- package/dist/grammar/definition/base.js +0 -1
- package/dist/grammar/definition/discriminants.d.ts +0 -31
- package/dist/grammar/definition/discriminants.d.ts.map +0 -1
- package/dist/grammar/definition/discriminants.js +0 -32
- package/dist/grammar/definition/edge-class.d.ts +0 -19
- package/dist/grammar/definition/edge-class.d.ts.map +0 -1
- package/dist/grammar/definition/edge-class.js +0 -1
- package/dist/grammar/definition/edge-interface.d.ts +0 -18
- package/dist/grammar/definition/edge-interface.d.ts.map +0 -1
- package/dist/grammar/definition/edge-interface.js +0 -1
- package/dist/grammar/definition/node-class.d.ts +0 -21
- package/dist/grammar/definition/node-class.d.ts.map +0 -1
- package/dist/grammar/definition/node-class.js +0 -1
- package/dist/grammar/definition/node-interface.d.ts +0 -14
- package/dist/grammar/definition/node-interface.d.ts.map +0 -1
- package/dist/grammar/definition/node-interface.js +0 -1
- package/dist/grammar/facets/constraints.d.ts +0 -8
- package/dist/grammar/facets/constraints.d.ts.map +0 -1
- package/dist/grammar/facets/constraints.js +0 -1
- package/dist/grammar/facets/content.d.ts +0 -4
- package/dist/grammar/facets/content.d.ts.map +0 -1
- package/dist/grammar/facets/content.js +0 -1
- package/dist/grammar/facets/endpoints.d.ts +0 -14
- package/dist/grammar/facets/endpoints.d.ts.map +0 -1
- package/dist/grammar/facets/endpoints.js +0 -2
- package/dist/grammar/facets/indexes.d.ts +0 -12
- package/dist/grammar/facets/indexes.d.ts.map +0 -1
- package/dist/grammar/facets/indexes.js +0 -8
- package/dist/grammar/facets/properties.d.ts +0 -26
- package/dist/grammar/facets/properties.d.ts.map +0 -1
- package/dist/grammar/facets/properties.js +0 -44
- package/dist/grammar/function/config.d.ts +0 -14
- package/dist/grammar/function/config.d.ts.map +0 -1
- package/dist/grammar/function/config.js +0 -1
- package/dist/grammar/function/def.d.ts +0 -55
- package/dist/grammar/function/def.d.ts.map +0 -1
- package/dist/grammar/function/def.js +0 -1
- package/dist/grammar/function/inheritance.d.ts +0 -3
- package/dist/grammar/function/inheritance.d.ts.map +0 -1
- package/dist/grammar/function/inheritance.js +0 -1
- package/dist/grammar/function/output.d.ts +0 -3
- package/dist/grammar/function/output.d.ts.map +0 -1
- package/dist/grammar/function/output.js +0 -1
- package/dist/grammar/values/bitmask.d.ts +0 -7
- package/dist/grammar/values/bitmask.d.ts.map +0 -1
- package/dist/grammar/values/bitmask.js +0 -1
- package/dist/grammar/values/data.d.ts +0 -30
- package/dist/grammar/values/data.d.ts.map +0 -1
- package/dist/grammar/values/data.js +0 -1
- package/dist/grammar/values/ref.d.ts +0 -26
- package/dist/grammar/values/ref.d.ts.map +0 -1
- package/dist/grammar/values/ref.js +0 -1
- package/dist/grammar/values/self.d.ts +0 -12
- package/dist/grammar/values/self.d.ts.map +0 -1
- package/dist/grammar/values/self.js +0 -5
- package/dist/inference/content.d.ts +0 -27
- package/dist/inference/content.d.ts.map +0 -1
- package/dist/inference/content.js +0 -1
- package/dist/inference/index.d.ts +0 -7
- package/dist/inference/index.d.ts.map +0 -1
- package/dist/inference/index.js +0 -1
- package/dist/inference/inheritance.d.ts +0 -48
- package/dist/inference/inheritance.d.ts.map +0 -1
- package/dist/inference/inheritance.js +0 -1
- package/dist/inference/input.d.ts +0 -30
- package/dist/inference/input.d.ts.map +0 -1
- package/dist/inference/input.js +0 -1
- package/dist/inference/methods.d.ts +0 -69
- package/dist/inference/methods.d.ts.map +0 -1
- package/dist/inference/methods.js +0 -1
- package/dist/inference/properties.d.ts +0 -37
- package/dist/inference/properties.d.ts.map +0 -1
- package/dist/inference/properties.js +0 -1
- package/dist/inference/schema.d.ts +0 -37
- package/dist/inference/schema.d.ts.map +0 -1
- package/dist/inference/schema.js +0 -1
- package/dist/instance/core/define.d.ts +0 -13
- package/dist/instance/core/define.d.ts.map +0 -1
- package/dist/instance/core/define.js +0 -62
- package/dist/instance/core/edge.d.ts +0 -9
- package/dist/instance/core/edge.d.ts.map +0 -1
- package/dist/instance/core/edge.js +0 -10
- package/dist/instance/core/endpoint.d.ts +0 -11
- package/dist/instance/core/endpoint.d.ts.map +0 -1
- package/dist/instance/core/endpoint.js +0 -18
- package/dist/instance/core/node.d.ts +0 -7
- package/dist/instance/core/node.d.ts.map +0 -1
- package/dist/instance/core/node.js +0 -8
- package/dist/instance/core/path.d.ts +0 -21
- package/dist/instance/core/path.d.ts.map +0 -1
- package/dist/instance/core/path.js +0 -20
- package/dist/instance/core/self.d.ts +0 -15
- package/dist/instance/core/self.d.ts.map +0 -1
- package/dist/instance/core/self.js +0 -7
- package/dist/instance/core/types.d.ts +0 -45
- package/dist/instance/core/types.d.ts.map +0 -1
- package/dist/instance/core/types.js +0 -1
- package/dist/instance/seed/define.d.ts +0 -12
- package/dist/instance/seed/define.d.ts.map +0 -1
- package/dist/instance/seed/define.js +0 -33
- package/dist/instance/seed/types.d.ts +0 -12
- package/dist/instance/seed/types.d.ts.map +0 -1
- package/dist/instance/seed/types.js +0 -1
- package/dist/ir/classes.d.ts +0 -72
- package/dist/ir/classes.d.ts.map +0 -1
- package/dist/ir/classes.js +0 -1
- package/dist/ir/domain.d.ts +0 -13
- package/dist/ir/domain.d.ts.map +0 -1
- package/dist/ir/domain.js +0 -1
- package/dist/ir/endpoints.d.ts +0 -27
- package/dist/ir/endpoints.d.ts.map +0 -1
- package/dist/ir/endpoints.js +0 -1
- package/dist/ir/functions.d.ts +0 -19
- package/dist/ir/functions.d.ts.map +0 -1
- package/dist/ir/functions.js +0 -1
- package/dist/ir/index.d.ts +0 -8
- package/dist/ir/index.d.ts.map +0 -1
- package/dist/ir/index.js +0 -1
- package/dist/ir/ir.d.ts +0 -63
- package/dist/ir/ir.d.ts.map +0 -1
- package/dist/ir/ir.js +0 -4
- package/dist/ir/json-schema.d.ts +0 -20
- package/dist/ir/json-schema.d.ts.map +0 -1
- package/dist/ir/json-schema.js +0 -1
- package/dist/schema/classify.d.ts +0 -8
- package/dist/schema/classify.d.ts.map +0 -1
- package/dist/schema/classify.js +0 -19
- package/dist/schema/define.d.ts +0 -21
- package/dist/schema/define.d.ts.map +0 -1
- package/dist/schema/define.js +0 -40
- package/dist/schema/error.d.ts +0 -8
- package/dist/schema/error.d.ts.map +0 -1
- package/dist/schema/error.js +0 -13
- package/dist/schema/refs.d.ts +0 -77
- package/dist/schema/refs.d.ts.map +0 -1
- package/dist/schema/refs.js +0 -99
- package/dist/schema/resolve/index.d.ts +0 -5
- package/dist/schema/resolve/index.d.ts.map +0 -1
- package/dist/schema/resolve/index.js +0 -4
- package/dist/schema/resolve/methods.d.ts +0 -8
- package/dist/schema/resolve/methods.d.ts.map +0 -1
- package/dist/schema/resolve/methods.js +0 -17
- package/dist/schema/resolve/properties.d.ts +0 -13
- package/dist/schema/resolve/properties.d.ts.map +0 -1
- package/dist/schema/resolve/properties.js +0 -36
- package/dist/schema/resolve/self.d.ts +0 -7
- package/dist/schema/resolve/self.d.ts.map +0 -1
- package/dist/schema/resolve/self.js +0 -32
- package/dist/schema/resolve/thunks.d.ts +0 -12
- package/dist/schema/resolve/thunks.d.ts.map +0 -1
- package/dist/schema/resolve/thunks.js +0 -36
- package/dist/schema/schema.d.ts +0 -22
- package/dist/schema/schema.d.ts.map +0 -1
- package/dist/schema/schema.js +0 -1
- package/dist/schema/validators/context.d.ts +0 -13
- package/dist/schema/validators/context.d.ts.map +0 -1
- package/dist/schema/validators/context.js +0 -1
- package/dist/schema/validators/endpoints.d.ts +0 -4
- package/dist/schema/validators/endpoints.d.ts.map +0 -1
- package/dist/schema/validators/endpoints.js +0 -26
- package/dist/schema/validators/index.d.ts +0 -11
- package/dist/schema/validators/index.d.ts.map +0 -1
- package/dist/schema/validators/index.js +0 -21
- package/dist/schema/validators/indexes.d.ts +0 -4
- package/dist/schema/validators/indexes.d.ts.map +0 -1
- package/dist/schema/validators/indexes.js +0 -18
- package/dist/schema/validators/inheritance.d.ts +0 -4
- package/dist/schema/validators/inheritance.d.ts.map +0 -1
- package/dist/schema/validators/inheritance.js +0 -26
- package/dist/schema/validators/methods.d.ts +0 -9
- package/dist/schema/validators/methods.d.ts.map +0 -1
- package/dist/schema/validators/methods.js +0 -43
- package/dist/schema/validators/names.d.ts +0 -4
- package/dist/schema/validators/names.d.ts.map +0 -1
- package/dist/schema/validators/names.js +0 -18
- package/dist/schema/validators/ref-targets.d.ts +0 -4
- package/dist/schema/validators/ref-targets.d.ts.map +0 -1
- package/dist/schema/validators/ref-targets.js +0 -53
- package/dist/serializer/context.d.ts +0 -32
- package/dist/serializer/context.d.ts.map +0 -1
- package/dist/serializer/context.js +0 -308
- package/dist/serializer/helpers.d.ts +0 -34
- package/dist/serializer/helpers.d.ts.map +0 -1
- package/dist/serializer/helpers.js +0 -115
- package/dist/serializer/index.d.ts +0 -2
- package/dist/serializer/index.d.ts.map +0 -1
- package/dist/serializer/index.js +0 -1
- package/dist/serializer/serialize.d.ts +0 -12
- package/dist/serializer/serialize.d.ts.map +0 -1
- package/dist/serializer/serialize.js +0 -5
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SchemaContext } from './context.js';
|
|
2
|
-
export type { SchemaContext } from './context.js';
|
|
3
|
-
export { validateUniqueNames } from './names.js';
|
|
4
|
-
export { validateInheritance } from './inheritance.js';
|
|
5
|
-
export { validateEndpoints } from './endpoints.js';
|
|
6
|
-
export { validateIndexes } from './indexes.js';
|
|
7
|
-
export { validateRefTargets } from './ref-targets.js';
|
|
8
|
-
export { validateMethods } from './methods.js';
|
|
9
|
-
/** Run all schema validators in sequence */
|
|
10
|
-
export declare function validateSchema(ctx: SchemaContext): void;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AASjD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAOvD"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { validateEndpoints } from './endpoints.js';
|
|
2
|
-
import { validateIndexes } from './indexes.js';
|
|
3
|
-
import { validateInheritance } from './inheritance.js';
|
|
4
|
-
import { validateMethods } from './methods.js';
|
|
5
|
-
import { validateUniqueNames } from './names.js';
|
|
6
|
-
import { validateRefTargets } from './ref-targets.js';
|
|
7
|
-
export { validateUniqueNames } from './names.js';
|
|
8
|
-
export { validateInheritance } from './inheritance.js';
|
|
9
|
-
export { validateEndpoints } from './endpoints.js';
|
|
10
|
-
export { validateIndexes } from './indexes.js';
|
|
11
|
-
export { validateRefTargets } from './ref-targets.js';
|
|
12
|
-
export { validateMethods } from './methods.js';
|
|
13
|
-
/** Run all schema validators in sequence */
|
|
14
|
-
export function validateSchema(ctx) {
|
|
15
|
-
validateUniqueNames(ctx);
|
|
16
|
-
validateInheritance(ctx);
|
|
17
|
-
validateEndpoints(ctx);
|
|
18
|
-
validateIndexes(ctx);
|
|
19
|
-
validateRefTargets(ctx);
|
|
20
|
-
validateMethods(ctx);
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexes.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/indexes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAMjD,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAmBxD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SchemaValidationError } from '../error.js';
|
|
2
|
-
import { eachDef } from '../refs.js';
|
|
3
|
-
import { resolveAllPropertyKeys } from '../resolve/properties.js';
|
|
4
|
-
/** Validate that all indexed properties exist on the definition or its ancestors */
|
|
5
|
-
export function validateIndexes(ctx) {
|
|
6
|
-
for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
|
|
7
|
-
const indexes = def.config.indexes;
|
|
8
|
-
if (!indexes)
|
|
9
|
-
continue;
|
|
10
|
-
const available = resolveAllPropertyKeys(def);
|
|
11
|
-
for (const idx of indexes) {
|
|
12
|
-
const prop = typeof idx === 'string' ? idx : idx.property;
|
|
13
|
-
if (!available.has(prop)) {
|
|
14
|
-
throw new SchemaValidationError(`Index on '${name}' references unknown property '${prop}'`, `${name}.indexes`, [...available].join(', ') || '(no properties)', prop);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inheritance.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/inheritance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAMjD,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAsC5D"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { isAbstract, isNode } from '../../grammar/definition/discriminants.js';
|
|
2
|
-
import { SchemaValidationError } from '../error.js';
|
|
3
|
-
import { eachDef, isKnownDef } from '../refs.js';
|
|
4
|
-
/** Validate inheritance rules for all definitions */
|
|
5
|
-
export function validateInheritance(ctx) {
|
|
6
|
-
for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
|
|
7
|
-
const parents = def.config.inherits;
|
|
8
|
-
if (!parents)
|
|
9
|
-
continue;
|
|
10
|
-
for (const parent of parents) {
|
|
11
|
-
// Rule 3: Inheritance targets exist
|
|
12
|
-
if (!isKnownDef(parent, ctx.descriptorMap)) {
|
|
13
|
-
throw new SchemaValidationError(`Definition '${name}' inherits from an unknown type`, `${name}.inherits`, 'a def in this schema or imported', 'unknown reference');
|
|
14
|
-
}
|
|
15
|
-
// Rule 5: No concrete inheritance — only abstract can be inherited
|
|
16
|
-
if (!isAbstract(parent)) {
|
|
17
|
-
throw new SchemaValidationError(`Definition '${name}' inherits from a concrete type (kind: '${parent.__kind}'). Only interfaces can be inherited.`, `${name}.inherits`, 'node-interface | edge-interface', parent.__kind);
|
|
18
|
-
}
|
|
19
|
-
// Rule 4: Kind match — node defs inherit node interfaces only;
|
|
20
|
-
// edge defs can inherit from both edge interfaces and node interfaces (mixins)
|
|
21
|
-
if (isNode(def) && !isNode(parent)) {
|
|
22
|
-
throw new SchemaValidationError(`Node definition '${name}' inherits from an edge interface`, `${name}.inherits`, 'node-interface', parent.__kind);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { SchemaContext } from './context.js';
|
|
2
|
-
/**
|
|
3
|
-
* Validate method inheritance rules:
|
|
4
|
-
* - Sealed methods are not overridden
|
|
5
|
-
* - Concrete defs implement all inherited abstract methods
|
|
6
|
-
* - Inheritance modifier only allowed on interfaces
|
|
7
|
-
*/
|
|
8
|
-
export declare function validateMethods(ctx: SchemaContext): void;
|
|
9
|
-
//# sourceMappingURL=methods.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/methods.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAOjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAkDxD"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { isConcrete } from '../../grammar/definition/discriminants.js';
|
|
2
|
-
import { SchemaValidationError } from '../error.js';
|
|
3
|
-
import { eachDef } from '../refs.js';
|
|
4
|
-
import { resolveAllMethods } from '../resolve/methods.js';
|
|
5
|
-
/**
|
|
6
|
-
* Validate method inheritance rules:
|
|
7
|
-
* - Sealed methods are not overridden
|
|
8
|
-
* - Concrete defs implement all inherited abstract methods
|
|
9
|
-
* - Inheritance modifier only allowed on interfaces
|
|
10
|
-
*/
|
|
11
|
-
export function validateMethods(ctx) {
|
|
12
|
-
for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
|
|
13
|
-
const ownMethods = def.config.methods ?? {};
|
|
14
|
-
// Concrete defs must not declare inheritance on own methods
|
|
15
|
-
if (isConcrete(def)) {
|
|
16
|
-
for (const [methodName, fnDef] of Object.entries(ownMethods)) {
|
|
17
|
-
if (fnDef.config.inheritance) {
|
|
18
|
-
throw new SchemaValidationError(`Concrete def '${name}' declares '${methodName}' with inheritance '${fnDef.config.inheritance}'. ` +
|
|
19
|
-
`The 'inheritance' modifier is only allowed on interface methods.`, `${name}.${methodName}.inheritance`, 'undefined (no inheritance on concrete defs)', fnDef.config.inheritance);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
// Check sealed override violations
|
|
24
|
-
const parents = def.config.inherits ?? [];
|
|
25
|
-
for (const parent of parents) {
|
|
26
|
-
const parentMethods = resolveAllMethods(parent);
|
|
27
|
-
for (const [methodName, parentFn] of Object.entries(parentMethods)) {
|
|
28
|
-
if (parentFn.config.inheritance === 'sealed' && methodName in ownMethods) {
|
|
29
|
-
throw new SchemaValidationError(`Definition '${name}' overrides sealed method '${methodName}'`, `${name}.${methodName}`, 'no override (method is sealed)', 'override declared');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// Concrete defs must implement all inherited abstract methods
|
|
34
|
-
if (isConcrete(def)) {
|
|
35
|
-
const allInherited = resolveAllMethods(def);
|
|
36
|
-
for (const [methodName, fnDef] of Object.entries(allInherited)) {
|
|
37
|
-
if (fnDef.config.inheritance === 'abstract' && !(methodName in ownMethods)) {
|
|
38
|
-
throw new SchemaValidationError(`Concrete def '${name}' does not implement abstract method '${methodName}'`, `${name}.${methodName}`, 'method implementation', 'missing');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA0B5D"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SchemaValidationError } from '../error.js';
|
|
2
|
-
/** Validate that no two definitions share a name within the same group */
|
|
3
|
-
export function validateUniqueNames(ctx) {
|
|
4
|
-
const interfaceNames = new Set();
|
|
5
|
-
for (const name of Object.keys(ctx.interfaces)) {
|
|
6
|
-
if (interfaceNames.has(name)) {
|
|
7
|
-
throw new SchemaValidationError(`Duplicate interface name '${name}'`, 'interfaces', 'unique names', name);
|
|
8
|
-
}
|
|
9
|
-
interfaceNames.add(name);
|
|
10
|
-
}
|
|
11
|
-
const classNames = new Set();
|
|
12
|
-
for (const name of Object.keys(ctx.classes)) {
|
|
13
|
-
if (classNames.has(name)) {
|
|
14
|
-
throw new SchemaValidationError(`Duplicate class name '${name}'`, 'classes', 'unique names', name);
|
|
15
|
-
}
|
|
16
|
-
classNames.add(name);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ref-targets.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/ref-targets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAiCjD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAoC3D"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { SchemaValidationError } from '../error.js';
|
|
2
|
-
import { eachDef, isKnownDef } from '../refs.js';
|
|
3
|
-
// Runtime symbol
|
|
4
|
-
const REF_TAG_RUNTIME = Symbol.for('REF_TAG');
|
|
5
|
-
/** Extract all ref targets from a Zod schema tree */
|
|
6
|
-
function extractRefTargets(schema) {
|
|
7
|
-
if (schema === null || typeof schema !== 'object')
|
|
8
|
-
return [];
|
|
9
|
-
const targets = [];
|
|
10
|
-
const record = schema;
|
|
11
|
-
// Check for our REF_TAG brand
|
|
12
|
-
if (REF_TAG_RUNTIME in record) {
|
|
13
|
-
const meta = record[REF_TAG_RUNTIME];
|
|
14
|
-
if (meta.target && typeof meta.target === 'object') {
|
|
15
|
-
targets.push(meta.target);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
// Walk into Zod internals to find nested refs
|
|
19
|
-
const zod = record;
|
|
20
|
-
const inner = zod.element ?? zod.innerType ?? zod._def?.innerType ?? zod._def?.type;
|
|
21
|
-
if (inner && typeof inner === 'object') {
|
|
22
|
-
targets.push(...extractRefTargets(inner));
|
|
23
|
-
}
|
|
24
|
-
return targets;
|
|
25
|
-
}
|
|
26
|
-
/** Validate that all ref() targets in params/returns point to known definitions */
|
|
27
|
-
export function validateRefTargets(ctx) {
|
|
28
|
-
const validateFnRefs = (path, fnDef) => {
|
|
29
|
-
const params = fnDef.config.params;
|
|
30
|
-
if (params && typeof params === 'object' && typeof params !== 'function') {
|
|
31
|
-
for (const [paramName, paramSchema] of Object.entries(params)) {
|
|
32
|
-
for (const target of extractRefTargets(paramSchema)) {
|
|
33
|
-
if (!isKnownDef(target, ctx.descriptorMap)) {
|
|
34
|
-
throw new SchemaValidationError(`'${path}' param '${paramName}' references an unknown def`, `${path}.params.${paramName}`, 'a def in this schema or imported', 'unknown reference');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
for (const target of extractRefTargets(fnDef.config.returns)) {
|
|
40
|
-
if (!isKnownDef(target, ctx.descriptorMap)) {
|
|
41
|
-
throw new SchemaValidationError(`'${path}' return type references an unknown def`, `${path}.returns`, 'a def in this schema or imported', 'unknown reference');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
|
|
46
|
-
const methods = def.config.methods;
|
|
47
|
-
if (!methods)
|
|
48
|
-
continue;
|
|
49
|
-
for (const [methodName, methodDef] of Object.entries(methods)) {
|
|
50
|
-
validateFnRefs(`${name}.${methodName}`, methodDef);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { SchemaIR } from '../ir/index.js';
|
|
3
|
-
import type { Schema } from '../schema/schema.js';
|
|
4
|
-
export declare class SerializeContext {
|
|
5
|
-
private schema;
|
|
6
|
-
private descriptorMap;
|
|
7
|
-
private importedMaps;
|
|
8
|
-
private zodToTypeName;
|
|
9
|
-
private types;
|
|
10
|
-
private imports;
|
|
11
|
-
constructor(schema: Schema, options?: {
|
|
12
|
-
types?: Record<string, z.ZodType>;
|
|
13
|
-
});
|
|
14
|
-
run(): SchemaIR;
|
|
15
|
-
private serializeInterface;
|
|
16
|
-
private serializeNode;
|
|
17
|
-
private serializeEdge;
|
|
18
|
-
private resolveInherits;
|
|
19
|
-
private serializeEndpoint;
|
|
20
|
-
private serializeConstraints;
|
|
21
|
-
private serializeProperties;
|
|
22
|
-
private serializePropertySchema;
|
|
23
|
-
private serializeMethods;
|
|
24
|
-
private serializeFn;
|
|
25
|
-
private serializeParams;
|
|
26
|
-
private convertZodSchema;
|
|
27
|
-
private zodToJsonSchemaRaw;
|
|
28
|
-
private serializeData;
|
|
29
|
-
private buildNodeRef;
|
|
30
|
-
private getDefName;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/serializer/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,OAAO,KAAK,EACV,QAAQ,EAUT,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAkBjD,qBAAa,gBAAgB;IAQzB,OAAO,CAAC,MAAM;IAPhB,OAAO,CAAC,aAAa,CAA4B;IACjD,OAAO,CAAC,YAAY,CAAiE;IACrF,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,OAAO,CAAuC;IAEtD,YACU,MAAM,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;KAAE,EAkBhD;IAED,GAAG,IAAI,QAAQ,CA6Bd;IAED,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,eAAe;IAiCvB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,UAAU;CA0CnB"}
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { isEdge } from '../grammar/definition/discriminants.js';
|
|
3
|
-
import { normalizeProperty } from '../grammar/facets/properties.js';
|
|
4
|
-
import { buildDescriptorMap, findDefTransitive } from '../schema/refs.js';
|
|
5
|
-
import { unwrapZod, getArrayElement, foldNullable, mapCardinality, hasRefTag, getRefMeta, getDataMeta, hasBitmaskTag, cleanJsonSchema, } from './helpers.js';
|
|
6
|
-
export class SerializeContext {
|
|
7
|
-
schema;
|
|
8
|
-
descriptorMap;
|
|
9
|
-
importedMaps = [];
|
|
10
|
-
zodToTypeName = new WeakMap();
|
|
11
|
-
types = {};
|
|
12
|
-
imports = {};
|
|
13
|
-
constructor(schema, options) {
|
|
14
|
-
this.schema = schema;
|
|
15
|
-
this.descriptorMap = buildDescriptorMap(schema);
|
|
16
|
-
for (const imported of schema.imports ?? []) {
|
|
17
|
-
const importedMap = buildDescriptorMap(imported);
|
|
18
|
-
this.importedMaps.push({ origin: imported.domain, map: importedMap });
|
|
19
|
-
for (const [def, descriptor] of importedMap) {
|
|
20
|
-
this.descriptorMap.set(def, descriptor);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (options?.types) {
|
|
24
|
-
for (const [name, zodSchema] of Object.entries(options.types)) {
|
|
25
|
-
this.zodToTypeName.set(zodSchema, name);
|
|
26
|
-
this.types[name] = this.zodToJsonSchemaRaw(zodSchema);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
run() {
|
|
31
|
-
const interfaces = {};
|
|
32
|
-
const classes = {};
|
|
33
|
-
for (const [name, def] of Object.entries(this.schema.interfaces)) {
|
|
34
|
-
interfaces[name] = this.serializeInterface(name, def);
|
|
35
|
-
}
|
|
36
|
-
for (const [name, def] of Object.entries(this.schema.classes)) {
|
|
37
|
-
if (isEdge(def)) {
|
|
38
|
-
classes[name] = this.serializeEdge(name, def);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
classes[name] = this.serializeNode(name, def);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const result = {
|
|
45
|
-
version: '1.0',
|
|
46
|
-
domain: this.schema.domain,
|
|
47
|
-
types: this.types,
|
|
48
|
-
interfaces,
|
|
49
|
-
classes,
|
|
50
|
-
};
|
|
51
|
-
if (Object.keys(this.imports).length > 0) {
|
|
52
|
-
result.imports = this.imports;
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
serializeInterface(name, def) {
|
|
57
|
-
const { config } = def;
|
|
58
|
-
const result = {
|
|
59
|
-
type: 'interface',
|
|
60
|
-
name,
|
|
61
|
-
extends: this.resolveInherits(config),
|
|
62
|
-
properties: this.serializeProperties(config.properties),
|
|
63
|
-
methods: this.serializeMethods(config.methods, name),
|
|
64
|
-
};
|
|
65
|
-
const content = config.content;
|
|
66
|
-
const data = this.serializeData(content);
|
|
67
|
-
if (data)
|
|
68
|
-
result.data = data;
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
serializeNode(name, def) {
|
|
72
|
-
const { config } = def;
|
|
73
|
-
const result = {
|
|
74
|
-
type: 'node',
|
|
75
|
-
name,
|
|
76
|
-
implements: this.resolveInherits(config),
|
|
77
|
-
properties: this.serializeProperties(config.properties),
|
|
78
|
-
methods: this.serializeMethods(config.methods, name),
|
|
79
|
-
};
|
|
80
|
-
const content = config.content;
|
|
81
|
-
const data = this.serializeData(content);
|
|
82
|
-
if (data)
|
|
83
|
-
result.data = data;
|
|
84
|
-
const icon = config.icon;
|
|
85
|
-
if (typeof icon === 'string' && icon.length > 0)
|
|
86
|
-
result.icon = icon;
|
|
87
|
-
return result;
|
|
88
|
-
}
|
|
89
|
-
serializeEdge(name, def) {
|
|
90
|
-
const { config } = def;
|
|
91
|
-
const edgeDef = def;
|
|
92
|
-
const result = {
|
|
93
|
-
type: 'edge',
|
|
94
|
-
name,
|
|
95
|
-
implements: this.resolveInherits(config),
|
|
96
|
-
endpoints: [this.serializeEndpoint(edgeDef.from), this.serializeEndpoint(edgeDef.to)],
|
|
97
|
-
properties: this.serializeProperties(config.properties),
|
|
98
|
-
methods: this.serializeMethods(config.methods, name),
|
|
99
|
-
};
|
|
100
|
-
const constraints = this.serializeConstraints(config.constraints);
|
|
101
|
-
if (constraints)
|
|
102
|
-
result.constraints = constraints;
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
resolveInherits(config) {
|
|
106
|
-
const inherits = config.inherits;
|
|
107
|
-
if (!inherits)
|
|
108
|
-
return [];
|
|
109
|
-
return inherits.map((e) => this.getDefName(e));
|
|
110
|
-
}
|
|
111
|
-
serializeEndpoint(endpoint) {
|
|
112
|
-
const result = {
|
|
113
|
-
name: endpoint.as,
|
|
114
|
-
types: endpoint.types.map((t) => this.getDefName(t)),
|
|
115
|
-
};
|
|
116
|
-
if (endpoint.cardinality) {
|
|
117
|
-
const mapped = mapCardinality(endpoint.cardinality);
|
|
118
|
-
if (mapped)
|
|
119
|
-
result.cardinality = mapped;
|
|
120
|
-
}
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
serializeConstraints(constraints) {
|
|
124
|
-
if (!constraints)
|
|
125
|
-
return undefined;
|
|
126
|
-
const c = {};
|
|
127
|
-
let has = false;
|
|
128
|
-
if (constraints.unique) {
|
|
129
|
-
c.unique = true;
|
|
130
|
-
has = true;
|
|
131
|
-
}
|
|
132
|
-
if (constraints.noSelf) {
|
|
133
|
-
c.noSelf = true;
|
|
134
|
-
has = true;
|
|
135
|
-
}
|
|
136
|
-
if (constraints.acyclic) {
|
|
137
|
-
c.acyclic = true;
|
|
138
|
-
has = true;
|
|
139
|
-
}
|
|
140
|
-
if (constraints.symmetric) {
|
|
141
|
-
c.symmetric = true;
|
|
142
|
-
has = true;
|
|
143
|
-
}
|
|
144
|
-
return has ? c : undefined;
|
|
145
|
-
}
|
|
146
|
-
serializeProperties(attrs) {
|
|
147
|
-
if (!attrs)
|
|
148
|
-
return {};
|
|
149
|
-
const result = {};
|
|
150
|
-
for (const [name, input] of Object.entries(attrs)) {
|
|
151
|
-
const normalized = normalizeProperty(input);
|
|
152
|
-
const decl = this.serializePropertySchema(normalized.schema);
|
|
153
|
-
if (normalized.private)
|
|
154
|
-
decl.private = true;
|
|
155
|
-
result[name] = decl;
|
|
156
|
-
}
|
|
157
|
-
return result;
|
|
158
|
-
}
|
|
159
|
-
serializePropertySchema(schema) {
|
|
160
|
-
const { inner, nullable, defaultValue, hasDefault } = unwrapZod(schema);
|
|
161
|
-
let jsonSchema = this.convertZodSchema(inner);
|
|
162
|
-
if (nullable)
|
|
163
|
-
jsonSchema = foldNullable(jsonSchema);
|
|
164
|
-
if (hasDefault)
|
|
165
|
-
jsonSchema = { ...jsonSchema, default: defaultValue };
|
|
166
|
-
return jsonSchema;
|
|
167
|
-
}
|
|
168
|
-
serializeMethods(methods, _className) {
|
|
169
|
-
if (!methods)
|
|
170
|
-
return {};
|
|
171
|
-
const result = {};
|
|
172
|
-
for (const [name, def] of Object.entries(methods)) {
|
|
173
|
-
result[name] = this.serializeFn(name, def);
|
|
174
|
-
}
|
|
175
|
-
return result;
|
|
176
|
-
}
|
|
177
|
-
serializeFn(name, def) {
|
|
178
|
-
const { config } = def;
|
|
179
|
-
const { inner: returnInner, nullable: returnNullable } = unwrapZod(config.returns);
|
|
180
|
-
const fn = {
|
|
181
|
-
name,
|
|
182
|
-
params: this.serializeParams(config.params),
|
|
183
|
-
returns: this.convertZodSchema(returnInner),
|
|
184
|
-
static: config.static ?? false,
|
|
185
|
-
inheritance: config.inheritance ?? 'default',
|
|
186
|
-
};
|
|
187
|
-
if (returnNullable)
|
|
188
|
-
fn.returnsNullable = true;
|
|
189
|
-
if (config.output && config.output !== 'value')
|
|
190
|
-
fn.output = config.output;
|
|
191
|
-
return fn;
|
|
192
|
-
}
|
|
193
|
-
serializeParams(params) {
|
|
194
|
-
if (!params)
|
|
195
|
-
return {};
|
|
196
|
-
const resolved = typeof params === 'function' ? params() : params;
|
|
197
|
-
const result = {};
|
|
198
|
-
for (const [name, schema] of Object.entries(resolved)) {
|
|
199
|
-
const zodSchema = schema;
|
|
200
|
-
if (hasRefTag(zodSchema)) {
|
|
201
|
-
result[name] = this.buildNodeRef(zodSchema);
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
const { inner, nullable, defaultValue, hasDefault } = unwrapZod(zodSchema);
|
|
205
|
-
if (hasRefTag(inner)) {
|
|
206
|
-
let refSchema = this.buildNodeRef(inner);
|
|
207
|
-
if (nullable)
|
|
208
|
-
refSchema = foldNullable(refSchema);
|
|
209
|
-
if (hasDefault)
|
|
210
|
-
refSchema = { ...refSchema, default: defaultValue };
|
|
211
|
-
result[name] = refSchema;
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
let jsonSchema = this.convertZodSchema(inner);
|
|
215
|
-
if (nullable)
|
|
216
|
-
jsonSchema = foldNullable(jsonSchema);
|
|
217
|
-
if (hasDefault)
|
|
218
|
-
jsonSchema = { ...jsonSchema, default: defaultValue };
|
|
219
|
-
result[name] = jsonSchema;
|
|
220
|
-
}
|
|
221
|
-
return result;
|
|
222
|
-
}
|
|
223
|
-
convertZodSchema(schema) {
|
|
224
|
-
if (hasRefTag(schema))
|
|
225
|
-
return this.buildNodeRef(schema);
|
|
226
|
-
const dataMeta = getDataMeta(schema);
|
|
227
|
-
if (dataMeta) {
|
|
228
|
-
if (dataMeta.kind === 'self')
|
|
229
|
-
return { $dataRef: 'self' };
|
|
230
|
-
return { $dataRef: this.getDefName(dataMeta.target) };
|
|
231
|
-
}
|
|
232
|
-
if (hasBitmaskTag(schema))
|
|
233
|
-
return { type: 'integer', format: 'bitmask' };
|
|
234
|
-
const typeName = this.zodToTypeName.get(schema);
|
|
235
|
-
if (typeName)
|
|
236
|
-
return { $ref: `#/types/${typeName}` };
|
|
237
|
-
const element = getArrayElement(schema);
|
|
238
|
-
if (element) {
|
|
239
|
-
const itemSchema = this.convertZodSchema(element);
|
|
240
|
-
if (itemSchema.$nodeRef || itemSchema.$dataRef || itemSchema.$ref) {
|
|
241
|
-
return { type: 'array', items: itemSchema };
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return this.zodToJsonSchemaRaw(schema);
|
|
245
|
-
}
|
|
246
|
-
zodToJsonSchemaRaw(schema) {
|
|
247
|
-
try {
|
|
248
|
-
const result = z.toJSONSchema(schema);
|
|
249
|
-
return cleanJsonSchema(result);
|
|
250
|
-
}
|
|
251
|
-
catch {
|
|
252
|
-
return {};
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
serializeData(data) {
|
|
256
|
-
if (!data || Object.keys(data).length === 0)
|
|
257
|
-
return undefined;
|
|
258
|
-
const objectSchema = z.object(data);
|
|
259
|
-
const result = z.toJSONSchema(objectSchema);
|
|
260
|
-
return cleanJsonSchema(result);
|
|
261
|
-
}
|
|
262
|
-
buildNodeRef(schema) {
|
|
263
|
-
const meta = getRefMeta(schema);
|
|
264
|
-
if (!meta)
|
|
265
|
-
return {};
|
|
266
|
-
const result = {
|
|
267
|
-
$nodeRef: this.getDefName(meta.target),
|
|
268
|
-
};
|
|
269
|
-
if (meta.includeData)
|
|
270
|
-
result.includeData = true;
|
|
271
|
-
return result;
|
|
272
|
-
}
|
|
273
|
-
getDefName(def) {
|
|
274
|
-
const descriptor = this.descriptorMap.get(def);
|
|
275
|
-
if (!descriptor) {
|
|
276
|
-
const transitive = findDefTransitive(this.schema, def);
|
|
277
|
-
if (transitive) {
|
|
278
|
-
throw new Error(`Serialization error: referenced def is declared in schema "${transitive.origin}" ` +
|
|
279
|
-
`(reachable via ${transitive.path.join(' → ')}), but "${transitive.origin}" ` +
|
|
280
|
-
`is not in the direct imports of "${this.schema.domain}". ` +
|
|
281
|
-
`Add it to your schema's \`imports\` array.`);
|
|
282
|
-
}
|
|
283
|
-
throw new Error(`Serialization error: referenced def not found in schema "${this.schema.domain}" ` +
|
|
284
|
-
`or any of its imports. Is the def from an unregistered schema?`);
|
|
285
|
-
}
|
|
286
|
-
// Already recorded — early-out doubles as cycle-guard for the recursion below.
|
|
287
|
-
if (this.imports[descriptor.name])
|
|
288
|
-
return descriptor.name;
|
|
289
|
-
for (const { origin, map } of this.importedMaps) {
|
|
290
|
-
const importedDescriptor = map.get(def);
|
|
291
|
-
if (!importedDescriptor)
|
|
292
|
-
continue;
|
|
293
|
-
this.imports[descriptor.name] = { origin, definition: importedDescriptor.group };
|
|
294
|
-
// Recurse on `inherits` so transitive ancestors are recorded too:
|
|
295
|
-
// a method materialized via an indirect ancestor (e.g.
|
|
296
|
-
// `View → UI → Function → Identity` where only Function is referenced
|
|
297
|
-
// directly) must qualify to the ancestor's owning schema, not ours.
|
|
298
|
-
// The early-out above keeps the recursion cycle-safe.
|
|
299
|
-
const inherits = def.config.inherits;
|
|
300
|
-
if (inherits) {
|
|
301
|
-
for (const parent of inherits)
|
|
302
|
-
this.getDefName(parent);
|
|
303
|
-
}
|
|
304
|
-
return descriptor.name;
|
|
305
|
-
}
|
|
306
|
-
return descriptor.name;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
import type { Cardinality } from '../grammar/facets/endpoints.js';
|
|
3
|
-
export declare function getZodDef(schema: z.ZodType): Record<string, any> | null;
|
|
4
|
-
export declare function getZodTypeName(def: Record<string, any>): string | undefined;
|
|
5
|
-
export declare function getZodInner(def: Record<string, any>): z.ZodType | null;
|
|
6
|
-
export interface UnwrapResult {
|
|
7
|
-
inner: z.ZodType;
|
|
8
|
-
nullable: boolean;
|
|
9
|
-
defaultValue: unknown;
|
|
10
|
-
hasDefault: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function unwrapZod(schema: z.ZodType): UnwrapResult;
|
|
13
|
-
export declare function getArrayElement(schema: z.ZodType): z.ZodType | null;
|
|
14
|
-
export declare function hasRefTag(schema: z.ZodType): boolean;
|
|
15
|
-
export declare function getRefMeta(schema: z.ZodType): {
|
|
16
|
-
target: object;
|
|
17
|
-
includeData: boolean;
|
|
18
|
-
} | null;
|
|
19
|
-
export declare function hasDataTag(schema: z.ZodType): boolean;
|
|
20
|
-
export declare function getDataMeta(schema: z.ZodType): {
|
|
21
|
-
kind: 'self';
|
|
22
|
-
} | {
|
|
23
|
-
kind: 'grant';
|
|
24
|
-
target: object;
|
|
25
|
-
} | null;
|
|
26
|
-
export declare function hasBitmaskTag(schema: z.ZodType): boolean;
|
|
27
|
-
export type JsonSchema = Record<string, unknown>;
|
|
28
|
-
export declare function foldNullable(schema: JsonSchema): JsonSchema;
|
|
29
|
-
export declare function mapCardinality(c: Cardinality): {
|
|
30
|
-
min: number;
|
|
31
|
-
max: number | null;
|
|
32
|
-
} | undefined;
|
|
33
|
-
export declare function cleanJsonSchema(schema: Record<string, unknown>): JsonSchema;
|
|
34
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/serializer/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAYjE,wBAAgB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAEvE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,SAAS,CAE3E;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,IAAI,CAEtE;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,CAAC,CAAC,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,YAAY,CA0CzD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,GAAG,IAAI,CAQnE;AAID,wBAAgB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAEpD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAG7F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAErD;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,CAAC,CAAC,OAAO,GAChB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAG7D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAExD;AAID,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhD,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAS3D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAW9F;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAO3E"}
|