@astrale-os/kernel-dsl 1.0.0-beta.3 → 1.0.0-beta.31
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/v1/addressing/class-key.js +3 -3
- package/dist/v1/addressing/definition-ref.js +21 -37
- package/dist/v1/addressing/domain-dependency.d.ts +0 -6
- package/dist/v1/addressing/domain-dependency.js +1 -6
- package/dist/v1/addressing/key.d.ts +4 -1
- package/dist/v1/addressing/key.js +23 -3
- package/dist/v1/addressing/ordering.d.ts +2 -0
- package/dist/v1/addressing/ordering.js +2 -0
- package/dist/v1/addressing/patterns.d.ts +1 -1
- package/dist/v1/addressing/patterns.js +2 -6
- package/dist/v1/builder/callable/authoring.d.ts +11 -5
- package/dist/v1/builder/callable/authoring.js +2 -0
- package/dist/v1/builder/class/authoring.d.ts +94 -224
- package/dist/v1/builder/class/authoring.js +30 -35
- package/dist/v1/builder/class/handle.d.ts +27 -0
- package/dist/v1/builder/class/handle.js +1 -0
- package/dist/v1/builder/class/input.d.ts +159 -0
- package/dist/v1/builder/class/projection.d.ts +129 -0
- package/dist/v1/builder/class/projection.js +1 -0
- package/dist/v1/builder/class/property.d.ts +3 -9
- package/dist/v1/builder/class/property.js +1 -0
- package/dist/v1/builder/core/authoring.d.ts +1 -1
- package/dist/v1/builder/index.d.ts +10 -2
- package/dist/v1/builder/index.js +2 -0
- package/dist/v1/builder/lowering/callable.js +1 -0
- package/dist/v1/builder/lowering/class.d.ts +9 -1
- package/dist/v1/builder/lowering/class.js +62 -17
- package/dist/v1/builder/lowering/policy.js +6 -24
- package/dist/v1/builder/lowering/property-keys.d.ts +27 -0
- package/dist/v1/builder/lowering/property-keys.js +108 -0
- package/dist/v1/builder/lowering/schema/compile.js +13 -6
- package/dist/v1/builder/lowering/schema/context.d.ts +9 -1
- package/dist/v1/builder/lowering/schema/context.js +36 -7
- package/dist/v1/builder/lowering/schema/lifetime.d.ts +11 -0
- package/dist/v1/builder/lowering/schema/lifetime.js +55 -0
- package/dist/v1/builder/lowering/value/compile.js +29 -22
- package/dist/v1/builder/lowering/value/file.d.ts +7 -0
- package/dist/v1/builder/lowering/value/file.js +14 -0
- package/dist/v1/builder/lowering/value/path.d.ts +1 -1
- package/dist/v1/builder/lowering/value/path.js +2 -4
- package/dist/v1/builder/lowering/value/zod.js +41 -7
- package/dist/v1/builder/policy/authoring.d.ts +80 -9
- package/dist/v1/builder/policy/authoring.js +99 -68
- package/dist/v1/builder/policy/legacy/edge.d.ts +28 -0
- package/dist/v1/builder/policy/legacy/edge.js +16 -0
- package/dist/v1/builder/schema/define.d.ts +0 -1
- package/dist/v1/builder/schema/diagnostic.d.ts +3 -2
- package/dist/v1/builder/schema/diagnostic.js +5 -10
- package/dist/v1/builder/schema/input.d.ts +4 -1
- package/dist/v1/builder/schema/projection/callable.d.ts +7 -5
- package/dist/v1/builder/schema/projection/class.d.ts +78 -16
- package/dist/v1/builder/schema/projection/core-input.d.ts +2 -1
- package/dist/v1/builder/schema/projection/domain.d.ts +13 -2
- package/dist/v1/builder/schema/projection/identity.d.ts +74 -9
- package/dist/v1/builder/schema/projection/model.d.ts +4 -2
- package/dist/v1/builder/schema/projection/property.d.ts +38 -4
- package/dist/v1/builder/schema/projection/resolved-class.d.ts +5 -4
- package/dist/v1/builder/schema/projection.d.ts +1 -1
- package/dist/v1/builder/schema/rule.d.ts +316 -0
- package/dist/v1/builder/schema/rule.js +192 -0
- package/dist/v1/builder/value/file.d.ts +34 -0
- package/dist/v1/builder/value/file.js +77 -0
- package/dist/v1/builder/value/full-match.d.ts +0 -1
- package/dist/v1/builder/value/full-match.js +0 -1
- package/dist/v1/builder/value/path-metadata.d.ts +1 -1
- package/dist/v1/builder/value/path.d.ts +1 -1
- package/dist/v1/bundle/codec.js +55 -74
- package/dist/v1/bundle/diagnostic.d.ts +3 -1
- package/dist/v1/bundle/diagnostic.js +9 -7
- package/dist/v1/bundle/index.d.ts +2 -0
- package/dist/v1/bundle/index.js +1 -0
- package/dist/v1/bundle/model.js +1 -1
- package/dist/v1/bundle/rule.d.ts +14 -0
- package/dist/v1/bundle/rule.js +41 -0
- package/dist/v1/bundle/structure.js +6 -8
- package/dist/v1/compiled/admission/accept.js +9 -15
- package/dist/v1/compiled/admission/closure.js +17 -34
- package/dist/v1/compiled/admission/diagnostic.d.ts +23 -1
- package/dist/v1/compiled/admission/diagnostic.js +40 -3
- package/dist/v1/compiled/admission/revision.d.ts +9 -1
- package/dist/v1/compiled/admission/revision.js +7 -3
- package/dist/v1/compiled/admission/semantics/class.d.ts +4 -1
- package/dist/v1/compiled/admission/semantics/class.js +48 -19
- package/dist/v1/compiled/admission/semantics/core.d.ts +1 -24
- package/dist/v1/compiled/admission/semantics/core.js +56 -24
- package/dist/v1/compiled/admission/semantics/edge.d.ts +2 -4
- package/dist/v1/compiled/admission/semantics/edge.js +6 -65
- package/dist/v1/compiled/admission/semantics/policy/admit.js +4 -19
- package/dist/v1/compiled/admission/semantics/policy/callable.js +2 -5
- package/dist/v1/compiled/admission/semantics/policy/contracts.d.ts +5 -20
- package/dist/v1/compiled/admission/semantics/policy/contracts.js +8 -21
- package/dist/v1/compiled/admission/semantics/policy/parity.js +44 -53
- package/dist/v1/compiled/admission/semantics/policy/pattern.d.ts +4 -1
- package/dist/v1/compiled/admission/semantics/policy/pattern.js +7 -21
- package/dist/v1/compiled/admission/semantics/policy/typing.d.ts +2 -24
- package/dist/v1/compiled/admission/semantics/policy/typing.js +19 -201
- package/dist/v1/compiled/admission/wire/callable.d.ts +5 -2
- package/dist/v1/compiled/admission/wire/callable.js +24 -20
- package/dist/v1/compiled/admission/wire/class.js +79 -30
- package/dist/v1/compiled/admission/wire/entry.d.ts +1 -1
- package/dist/v1/compiled/admission/wire/entry.js +36 -13
- package/dist/v1/compiled/admission/wire/policy.d.ts +4 -3
- package/dist/v1/compiled/admission/wire/policy.js +27 -20
- package/dist/v1/compiled/admission/wire/program.d.ts +13 -3
- package/dist/v1/compiled/admission/wire/program.js +39 -44
- package/dist/v1/compiled/admission/wire/property.d.ts +4 -1
- package/dist/v1/compiled/admission/wire/property.js +8 -5
- package/dist/v1/compiled/admission/wire/value.d.ts +0 -2
- package/dist/v1/compiled/admission/wire/value.js +0 -7
- package/dist/v1/compiled/codec/json.js +4 -3
- package/dist/v1/compiled/compiler/compile.js +15 -33
- package/dist/v1/compiled/diagnostic.d.ts +1 -1
- package/dist/v1/compiled/diagnostic.js +2 -3
- package/dist/v1/compiled/index.d.ts +2 -0
- package/dist/v1/compiled/index.js +1 -0
- package/dist/v1/compiled/loader/load.d.ts +3 -2
- package/dist/v1/compiled/loader/load.js +13 -52
- package/dist/v1/compiled/model/schema.d.ts +3 -0
- package/dist/v1/compiled/rule.d.ts +49 -0
- package/dist/v1/compiled/rule.js +169 -0
- package/dist/v1/domain/create.js +9 -10
- package/dist/v1/domain/model/domain.d.ts +2 -7
- package/dist/v1/domain/model/input.d.ts +19 -10
- package/dist/v1/domain/namespace/member-collection.js +8 -7
- package/dist/v1/domain/projection/classes.js +11 -8
- package/dist/v1/domain/validation/create.d.ts +7 -16
- package/dist/v1/domain/validation/create.js +35 -81
- package/dist/v1/index.d.ts +5 -3
- package/dist/v1/index.js +1 -1
- package/dist/v1/language/.spec/schemas/draft-2020-12.schema.json +462 -0
- package/dist/v1/language/.spec/schemas/value-schema.schema.json +23 -0
- package/dist/v1/language/callable/admission.d.ts +15 -0
- package/dist/v1/language/callable/admission.js +44 -0
- package/dist/v1/language/callable/model/callable.d.ts +10 -0
- package/dist/v1/language/callable/resolved.d.ts +26 -5
- package/dist/v1/language/chain.d.ts +7 -0
- package/dist/v1/language/chain.js +24 -0
- package/dist/v1/language/class/inheritance.d.ts +36 -5
- package/dist/v1/language/class/inheritance.js +85 -1
- package/dist/v1/language/class/lifetime.d.ts +50 -11
- package/dist/v1/language/class/lifetime.js +89 -20
- package/dist/v1/language/class/model/class.d.ts +45 -9
- package/dist/v1/language/class/model/edge.d.ts +31 -2
- package/dist/v1/language/class/model/property.d.ts +16 -7
- package/dist/v1/language/class/property-values.js +2 -4
- package/dist/v1/language/class/resolved.d.ts +9 -4
- package/dist/v1/language/class/unique.d.ts +143 -0
- package/dist/v1/language/class/unique.js +264 -0
- package/dist/v1/language/core/facts.d.ts +85 -0
- package/dist/v1/language/core/facts.js +116 -0
- package/dist/v1/language/cycle.d.ts +10 -0
- package/dist/v1/language/cycle.js +30 -0
- package/dist/v1/language/definition/metadata.d.ts +38 -0
- package/dist/v1/language/definition/metadata.js +51 -0
- package/dist/v1/language/freeze.d.ts +5 -0
- package/dist/v1/{schema/canonical → language}/freeze.js +4 -0
- package/dist/v1/language/index.d.ts +7 -2
- package/dist/v1/language/index.js +5 -1
- package/dist/v1/language/limits.d.ts +83 -0
- package/dist/v1/language/limits.js +77 -0
- package/dist/v1/language/policy/analysis/branches.d.ts +8 -0
- package/dist/v1/language/policy/analysis/branches.js +8 -8
- package/dist/v1/language/policy/analysis/budgets.d.ts +45 -12
- package/dist/v1/language/policy/analysis/budgets.js +140 -20
- package/dist/v1/language/policy/analysis/checks.js +8 -6
- package/dist/v1/language/policy/analysis/composition.d.ts +4 -0
- package/dist/v1/language/policy/analysis/composition.js +11 -0
- package/dist/v1/language/policy/analysis/typing.d.ts +51 -0
- package/dist/v1/language/policy/analysis/typing.js +456 -0
- package/dist/v1/language/policy/model/policy.d.ts +71 -9
- package/dist/v1/language/policy/model/policy.js +42 -4
- package/dist/v1/language/policy/normalization/normalize.d.ts +6 -6
- package/dist/v1/language/policy/normalization/normalize.js +46 -68
- package/dist/v1/language/suspended.d.ts +7 -0
- package/dist/v1/language/suspended.js +23 -0
- package/dist/v1/language/validation/diagnostic.d.ts +15 -1
- package/dist/v1/language/validation/diagnostic.js +21 -0
- package/dist/v1/language/validation/rule.d.ts +45 -0
- package/dist/v1/language/validation/rule.js +109 -0
- package/dist/v1/language/value/compile/fields.js +16 -16
- package/dist/v1/language/value/compile/load.d.ts +5 -0
- package/dist/v1/language/value/compile/load.js +13 -0
- package/dist/v1/language/value/evaluate/assertions.d.ts +5 -1
- package/dist/v1/language/value/evaluate/assertions.js +19 -8
- package/dist/v1/language/value/evaluate/evaluator.js +117 -120
- package/dist/v1/language/value/evaluate/preparation.d.ts +16 -0
- package/dist/v1/language/value/evaluate/preparation.js +100 -47
- package/dist/v1/language/value/evaluate/program.d.ts +2 -1
- package/dist/v1/language/value/evaluate/program.js +6 -6
- package/dist/v1/language/value/evaluate/validate.d.ts +3 -3
- package/dist/v1/language/value/evaluate/validate.js +15 -11
- package/dist/v1/language/value/evaluate/validity.optimization.d.ts +14 -0
- package/dist/v1/language/value/evaluate/validity.optimization.js +338 -0
- package/dist/v1/language/value/files.d.ts +44 -0
- package/dist/v1/language/value/files.js +151 -0
- package/dist/v1/language/value/inclusion/arrays.d.ts +3 -0
- package/dist/v1/language/value/inclusion/arrays.js +85 -0
- package/dist/v1/language/value/inclusion/assertions.d.ts +18 -0
- package/dist/v1/language/value/inclusion/assertions.js +28 -0
- package/dist/v1/language/value/inclusion/combinators.d.ts +3 -0
- package/dist/v1/language/value/inclusion/combinators.js +67 -0
- package/dist/v1/language/value/inclusion/equivalence.d.ts +4 -0
- package/dist/v1/language/value/inclusion/equivalence.js +76 -0
- package/dist/v1/language/value/inclusion/evidence.d.ts +34 -0
- package/dist/v1/language/value/inclusion/evidence.js +140 -0
- package/dist/v1/language/value/inclusion/includes.d.ts +29 -3
- package/dist/v1/language/value/inclusion/includes.js +58 -723
- package/dist/v1/language/value/inclusion/keywords.d.ts +5 -0
- package/dist/v1/language/value/inclusion/keywords.js +31 -0
- package/dist/v1/language/value/inclusion/kinds.d.ts +17 -0
- package/dist/v1/language/value/inclusion/kinds.js +57 -0
- package/dist/v1/language/value/inclusion/location.d.ts +24 -0
- package/dist/v1/language/value/inclusion/location.js +66 -0
- package/dist/v1/language/value/inclusion/numbers.d.ts +3 -0
- package/dist/v1/language/value/inclusion/numbers.js +41 -0
- package/dist/v1/language/value/inclusion/objects.d.ts +3 -0
- package/dist/v1/language/value/inclusion/objects.js +190 -0
- package/dist/v1/language/value/inclusion/strings.d.ts +3 -0
- package/dist/v1/language/value/inclusion/strings.js +29 -0
- package/dist/v1/language/value/inclusion/types.d.ts +3 -0
- package/dist/v1/language/value/inclusion/types.js +34 -0
- package/dist/v1/language/value/model/blob.d.ts +6 -0
- package/dist/v1/language/value/model/blob.js +8 -0
- package/dist/v1/language/value/model/file.d.ts +41 -0
- package/dist/v1/language/value/model/file.js +122 -0
- package/dist/v1/language/value/ordering.d.ts +14 -0
- package/dist/v1/language/value/ordering.js +144 -77
- package/dist/v1/language/value/profile/canonicalize.d.ts +6 -1
- package/dist/v1/language/value/profile/canonicalize.js +67 -87
- package/dist/v1/language/value/profile/json.validate.d.ts +12 -0
- package/dist/v1/language/value/profile/json.validate.js +18 -5
- package/dist/v1/language/value/profile/meta-schema.compiled.d.ts +1 -0
- package/dist/v1/language/value/profile/meta-schema.compiled.js +21 -5
- package/dist/v1/language/value/profile/rules.js +27 -44
- package/dist/v1/language/value/profile/validate.js +1 -10
- package/dist/v1/language/value/profile/vocabulary.d.ts +36 -2
- package/dist/v1/language/value/profile/vocabulary.js +58 -5
- package/dist/v1/language/value/reference/closure.js +6 -6
- package/dist/v1/language/value/reference/recursion.js +9 -48
- package/dist/v1/language/value/reference/references.d.ts +3 -1
- package/dist/v1/language/value/reference/references.js +7 -7
- package/dist/v1/language/value/reference/registry.index.d.ts +2 -0
- package/dist/v1/language/value/reference/registry.index.js +33 -16
- package/dist/v1/language/value/regexp/ast.js +6 -7
- package/dist/v1/language/value/regexp/compile.d.ts +5 -11
- package/dist/v1/language/value/regexp/compile.js +14 -12
- package/dist/v1/language/value/regexp/syntax.js +3 -2
- package/dist/v1/language/value/regexp/unicode.d.ts +1 -1
- package/dist/v1/language/value/regexp/unicode.js +1 -1
- package/dist/v1/language/value/syntax/keywords.d.ts +3 -3
- package/dist/v1/language/value/syntax/keywords.js +4 -20
- package/dist/v1/language/value/syntax/node-path/validate.js +2 -3
- package/dist/v1/language/value/syntax/pointer.d.ts +2 -0
- package/dist/v1/language/value/syntax/pointer.js +5 -2
- package/dist/v1/language/value/syntax/walk.d.ts +9 -0
- package/dist/v1/language/value/syntax/walk.js +37 -20
- package/dist/v1/schema/.spec/schemas/domain-schema.schema.json +2596 -0
- package/dist/v1/schema/admission/accept.d.ts +3 -1
- package/dist/v1/schema/admission/accept.js +6 -14
- package/dist/v1/schema/admission/callable.d.ts +21 -0
- package/dist/v1/schema/admission/callable.js +96 -0
- package/dist/v1/schema/analysis/class.d.ts +4 -0
- package/dist/v1/schema/analysis/class.js +57 -17
- package/dist/v1/schema/canonical/revision.d.ts +4 -1
- package/dist/v1/schema/canonical/revision.js +8 -5
- package/dist/v1/schema/compatibility/api.d.ts +4 -1
- package/dist/v1/schema/compatibility/api.js +2 -0
- package/dist/v1/schema/compatibility/comparators/callables.js +1 -1
- package/dist/v1/schema/compatibility/comparators/classes.d.ts +9 -4
- package/dist/v1/schema/compatibility/comparators/classes.js +50 -29
- package/dist/v1/schema/compatibility/comparators/index.d.ts +1 -1
- package/dist/v1/schema/compatibility/comparators/members.js +1 -1
- package/dist/v1/schema/compatibility/comparators/values.js +2 -2
- package/dist/v1/schema/compatibility/context.d.ts +5 -2
- package/dist/v1/schema/compatibility/context.js +8 -6
- package/dist/v1/schema/compatibility/coordinate.js +3 -3
- package/dist/v1/schema/compatibility/diff.js +2 -4
- package/dist/v1/schema/compatibility/extension.d.ts +11 -0
- package/dist/v1/schema/compatibility/extension.js +22 -0
- package/dist/v1/schema/compatibility/fields.d.ts +20 -4
- package/dist/v1/schema/compatibility/fields.js +13 -3
- package/dist/v1/schema/compatibility/meaning/footprint.js +16 -51
- package/dist/v1/schema/compatibility/model.d.ts +17 -5
- package/dist/v1/schema/compatibility/references.d.ts +0 -3
- package/dist/v1/schema/compatibility/references.js +1 -9
- package/dist/v1/schema/compatibility/report.js +1 -1
- package/dist/v1/schema/compatibility/rule.d.ts +13 -0
- package/dist/v1/schema/compatibility/rule.js +23 -0
- package/dist/v1/schema/compatibility/scope.d.ts +2 -0
- package/dist/v1/schema/compatibility/scope.js +4 -1
- package/dist/v1/schema/compatibility/structure/index.js +6 -4
- package/dist/v1/schema/compatibility/structure/requirements.js +58 -61
- package/dist/v1/schema/compatibility/versioning/index.js +1 -1
- package/dist/v1/schema/compatibility/versioning/surface.d.ts +1 -1
- package/dist/v1/schema/compatibility/versioning/surface.js +30 -2
- package/dist/v1/schema/compatibility/walk.d.ts +17 -0
- package/dist/v1/schema/compatibility/walk.js +41 -0
- package/dist/v1/schema/diagnostic.d.ts +17 -3
- package/dist/v1/schema/diagnostic.js +14 -11
- package/dist/v1/schema/enforcement/changes.d.ts +590 -0
- package/dist/v1/schema/enforcement/changes.js +566 -0
- package/dist/v1/schema/enforcement/derived.d.ts +236 -0
- package/dist/v1/schema/enforcement/derived.js +243 -0
- package/dist/v1/schema/enforcement/dispose.d.ts +308 -0
- package/dist/v1/schema/enforcement/dispose.js +275 -0
- package/dist/v1/schema/enforcement/facts.d.ts +89 -0
- package/dist/v1/schema/enforcement/facts.js +70 -0
- package/dist/v1/schema/enforcement/fields.d.ts +65 -0
- package/dist/v1/schema/enforcement/fields.js +36 -0
- package/dist/v1/schema/enforcement/index.d.ts +39 -0
- package/dist/v1/schema/enforcement/index.js +10 -0
- package/dist/v1/schema/enforcement/install.d.ts +1634 -0
- package/dist/v1/schema/enforcement/install.js +1223 -0
- package/dist/v1/schema/enforcement/lifecycle.d.ts +87 -0
- package/dist/v1/schema/enforcement/lifecycle.js +91 -0
- package/dist/v1/schema/enforcement/model.d.ts +253 -0
- package/dist/v1/schema/enforcement/model.js +1 -0
- package/dist/v1/schema/enforcement/obligations.d.ts +248 -0
- package/dist/v1/schema/enforcement/obligations.js +240 -0
- package/dist/v1/schema/enforcement/write.d.ts +1314 -0
- package/dist/v1/schema/enforcement/write.js +1017 -0
- package/dist/v1/schema/index.d.ts +11 -1
- package/dist/v1/schema/index.js +5 -0
- package/dist/v1/schema/model/schema.d.ts +23 -1
- package/dist/v1/schema/model/schema.js +1 -1
- package/dist/v1/schema/normalization/domain.d.ts +2 -0
- package/dist/v1/schema/normalization/domain.js +50 -13
- package/dist/v1/schema/resolution/closure.js +2 -1
- package/dist/v1/schema/resolution/context.js +17 -18
- package/dist/v1/schema/resolution/domain.d.ts +5 -0
- package/dist/v1/schema/resolution/domain.js +6 -12
- package/dist/v1/schema/resolution/origins.js +6 -8
- package/dist/v1/schema/rule.d.ts +25 -0
- package/dist/v1/schema/rule.js +459 -0
- package/dist/v1/schema/validation/callable.d.ts +35 -2
- package/dist/v1/schema/validation/callable.js +65 -9
- package/dist/v1/schema/validation/class.d.ts +6 -2
- package/dist/v1/schema/validation/class.js +128 -105
- package/dist/v1/schema/validation/core.js +103 -173
- package/dist/v1/schema/validation/domain.js +25 -15
- package/dist/v1/schema/validation/domain.json-schema.d.ts +15 -0
- package/dist/v1/schema/validation/domain.json-schema.js +222 -0
- package/dist/v1/schema/validation/domain.route.d.ts +6 -1
- package/dist/v1/schema/validation/domain.route.js +18 -0
- package/dist/v1/schema/validation/domain.structure.d.ts +7797 -0
- package/dist/v1/schema/validation/domain.structure.js +516 -160
- package/dist/v1/schema/validation/icon.d.ts +4 -0
- package/dist/v1/schema/validation/icon.js +29 -0
- package/dist/v1/schema/validation/json.json-schema.d.ts +40 -0
- package/dist/v1/schema/validation/json.json-schema.js +46 -0
- package/dist/v1/schema/validation/policy/budgets.d.ts +37 -2
- package/dist/v1/schema/validation/policy/budgets.js +94 -121
- package/dist/v1/schema/validation/policy/context.d.ts +6 -5
- package/dist/v1/schema/validation/policy/context.js +7 -10
- package/dist/v1/schema/validation/policy/objects.d.ts +1 -1
- package/dist/v1/schema/validation/policy/objects.js +6 -14
- package/dist/v1/schema/validation/policy/references.js +20 -62
- package/dist/v1/schema/validation/policy/typing.d.ts +3 -18
- package/dist/v1/schema/validation/policy/typing.js +22 -356
- package/dist/v1/schema/validation/policy/uses.d.ts +40 -3
- package/dist/v1/schema/validation/policy/uses.js +63 -91
- package/dist/v1/schema/validation/policy/validate.js +5 -5
- package/dist/v1/schema/validation/value-api.d.ts +27 -1
- package/dist/v1/schema/validation/value-api.js +37 -2
- package/dist/v1/schema/validation/value.d.ts +3 -0
- package/dist/v1/schema/validation/value.js +9 -17
- package/dist/v1/schema/validation/value.json-schema.d.ts +54 -0
- package/dist/v1/schema/validation/value.json-schema.js +163 -0
- package/dist/v1/schema/validation/view.js +4 -8
- package/dist/value/accept.d.ts +9 -3
- package/dist/value/accept.js +25 -1
- package/dist/value/canonical.d.ts +22 -1
- package/dist/value/canonical.js +114 -21
- package/dist/value/decode.d.ts +7 -0
- package/dist/value/decode.js +159 -9
- package/dist/value/equal.d.ts +9 -1
- package/dist/value/equal.js +37 -3
- package/dist/value/immutable.optimization.d.ts +2 -0
- package/dist/value/immutable.optimization.js +4 -0
- package/dist/value/index.d.ts +5 -3
- package/dist/value/index.js +2 -1
- package/dist/value/json.d.ts +2 -2
- package/dist/value/json.js +2 -2
- package/dist/value/limits.d.ts +11 -0
- package/dist/value/rule.d.ts +12 -0
- package/dist/value/rule.js +50 -0
- package/dist/value/types.d.ts +6 -0
- package/dist/value/unicode.d.ts +2 -1
- package/dist/value/unicode.js +2 -0
- package/package.json +15 -4
- package/dist/v1/builder/lowering/core-properties.d.ts +0 -10
- package/dist/v1/builder/lowering/core-properties.js +0 -76
- package/dist/v1/compiled/admission/semantics/cardinality.d.ts +0 -5
- package/dist/v1/compiled/admission/semantics/cardinality.js +0 -113
- package/dist/v1/compiled/admission/semantics/policy/equality.d.ts +0 -8
- package/dist/v1/compiled/admission/semantics/policy/equality.js +0 -27
- package/dist/v1/compiled/admission/semantics/policy/measure.d.ts +0 -9
- package/dist/v1/compiled/admission/semantics/policy/measure.js +0 -81
- package/dist/v1/compiled/admission/semantics/policy/variants.d.ts +0 -10
- package/dist/v1/compiled/admission/semantics/policy/variants.js +0 -65
- package/dist/v1/compiled/admission/wire/pattern.d.ts +0 -12
- package/dist/v1/compiled/admission/wire/pattern.js +0 -111
- package/dist/v1/language/class/index.d.ts +0 -8
- package/dist/v1/language/class/index.js +0 -1
- package/dist/v1/language/core/index.d.ts +0 -2
- package/dist/v1/language/value/index.d.ts +0 -11
- package/dist/v1/language/value/index.js +0 -8
- package/dist/v1/schema/canonical/domain.d.ts +0 -3
- package/dist/v1/schema/canonical/domain.digest.d.ts +0 -3
- package/dist/v1/schema/canonical/domain.digest.js +0 -5
- package/dist/v1/schema/canonical/domain.js +0 -5
- package/dist/v1/schema/canonical/freeze.d.ts +0 -1
- /package/dist/v1/{language/core/index.js → builder/class/input.js} +0 -0
|
@@ -43,8 +43,19 @@ interface DomainOfProjection<Projection extends DomainProjection> extends domain
|
|
|
43
43
|
readonly [Alias in keyof Projection['dependencies']]: Projection['dependencies'][Alias] extends infer Dependency extends DomainSchema ? DomainOfSchema<Dependency> : never;
|
|
44
44
|
}>;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
declare const AUTHORED_CLASSES: unique symbol;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve compact authored witnesses into the exact public Domain type. The type names the
|
|
49
|
+
* authored handles of its Classes, so a Schema depending on this one reads them, through any type
|
|
50
|
+
* that extends it.
|
|
51
|
+
*/
|
|
52
|
+
export interface ResolvedDomainOfInput<Origin extends string, Input extends DomainSchemaInput> extends DomainOfProjection<ProjectionOfInput<Origin, Input>> {
|
|
53
|
+
readonly [AUTHORED_CLASSES]: ClassesInputOf<Input>;
|
|
54
|
+
}
|
|
55
|
+
/** The authored handles of a resolved Domain's Classes: `never` when its type names none. */
|
|
56
|
+
export type AuthoredClassesOf<Value> = Value extends {
|
|
57
|
+
readonly [AUTHORED_CLASSES]: infer Classes extends NonNullable<DomainSchemaInput['classes']>;
|
|
58
|
+
} ? Classes : never;
|
|
48
59
|
type DependenciesInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'dependencies'>;
|
|
49
60
|
type DependencySchemasOf<Input extends DomainSchemaInput> = {
|
|
50
61
|
readonly [Alias in keyof DependenciesInputOf<Input>]: DependenciesInputOf<Input>[Alias];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DomainSchema, DomainOfSchema } from '../../../schema/model/schema.js';
|
|
2
|
+
import type { NodeClass, DirectedEdgeClass, UndirectedEdgeClass, Class } from '../../class/handle.js';
|
|
3
|
+
import type { ClassReferenceProjection, ClassReferenceProjectionOf, ClassIdentityProjectionOf, ClassOwnerProjectionOf, ClassOwnerProjection, ClassIdentityProjection } from '../../class/projection.js';
|
|
2
4
|
import type { DomainSchemaInput } from '../input.js';
|
|
5
|
+
import type { AuthoredClassesOf } from './domain.js';
|
|
3
6
|
/** Extract an authored abstract modifier with its default. */
|
|
4
7
|
export type AbstractOf<Config> = Config extends {
|
|
5
8
|
readonly abstract: infer Abstract extends boolean;
|
|
@@ -8,8 +11,11 @@ export type AbstractOf<Config> = Config extends {
|
|
|
8
11
|
export type ConstraintsOf<Options> = Options extends {
|
|
9
12
|
readonly constraints?: infer Constraints;
|
|
10
13
|
} ? NonNullable<Constraints> : Record<never, never>;
|
|
11
|
-
/**
|
|
12
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Extract one named declaration dictionary. A field that is absent, `undefined` or `never` declares
|
|
16
|
+
* nothing.
|
|
17
|
+
*/
|
|
18
|
+
export type RecordField<Value, Key extends PropertyKey> = Key extends keyof Value ? [NonNullable<Value[Key]>] extends [never] ? Record<never, never> : NonNullable<Value[Key]> extends Readonly<Record<string, unknown>> ? NonNullable<Value[Key]> : Record<never, never> : Record<never, never>;
|
|
13
19
|
/** Select the local Class dictionary of a schema input. */
|
|
14
20
|
export type ClassesInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'classes'>;
|
|
15
21
|
/** Unwrap lazy references within the existing 32-step inference budget. */
|
|
@@ -21,10 +27,10 @@ type Same<Left, Right> = [Left] extends [Right] ? ([Right] extends [Left] ? true
|
|
|
21
27
|
export type LocalNameOf<Root extends DomainSchemaInput, Value> = {
|
|
22
28
|
[Name in keyof ClassesInputOf<Root>]: Same<ClassesInputOf<Root>[Name], Value> extends true ? Name : never;
|
|
23
29
|
}[keyof ClassesInputOf<Root>];
|
|
24
|
-
/** Find
|
|
25
|
-
export type
|
|
26
|
-
[Name in keyof
|
|
27
|
-
}[keyof
|
|
30
|
+
/** Find an authored Class by the reference projection its handle keeps. */
|
|
31
|
+
export type NameOfReference<Classes, Value> = {
|
|
32
|
+
[Name in keyof Classes]: Value extends ClassReferenceProjection<'node' | 'edge', unknown, unknown, unknown, unknown> ? Same<ClassReferenceProjectionOf<Extract<Classes[Name], Class>>, Value> extends true ? Name : never : never;
|
|
33
|
+
}[keyof Classes];
|
|
28
34
|
type LocalNameOfIdentity<Root extends DomainSchemaInput, Value> = {
|
|
29
35
|
[Name in keyof ClassesInputOf<Root>]: Same<ClassIdentityProjectionOf<Extract<ClassesInputOf<Root>[Name], Class>>, Value> extends true ? Name : never;
|
|
30
36
|
}[keyof ClassesInputOf<Root>];
|
|
@@ -34,6 +40,65 @@ type LocalNameOfOwner<Root extends DomainSchemaInput, Value> = {
|
|
|
34
40
|
type UnionIsMultiple<Value, Whole = Value> = Value extends unknown ? [Whole] extends [Value] ? false : true : never;
|
|
35
41
|
/** Distinguish ambiguous unions from one exact member. */
|
|
36
42
|
export type IsMultiple<Value> = true extends UnionIsMultiple<Value> ? true : false;
|
|
37
|
-
/**
|
|
38
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The authored handles of a dependency's Classes, as its type keeps them: `never` when its type
|
|
45
|
+
* names neither those handles nor their names.
|
|
46
|
+
*/
|
|
47
|
+
export type DependencyClassesOf<Dependency> = Dependency extends DomainSchema ? AuthoredClassesOf<DomainOfSchema<Dependency>> extends infer Classes ? string extends keyof Classes ? never : Classes : never : never;
|
|
48
|
+
/**
|
|
49
|
+
* Whether a Class of a direct dependency may be the Class a reference projects: one whose authored
|
|
50
|
+
* handle keeps the same reference, as for a Class of the Schema. A value has the reference of a
|
|
51
|
+
* dependency's Class only through a type that names that Class, so a dependency whose Classes the
|
|
52
|
+
* types do not name holds none.
|
|
53
|
+
*/
|
|
54
|
+
type DependencyMayBe<Root extends DomainSchemaInput, Value> = Value extends ClassReferenceProjection<'node' | 'edge', unknown, unknown, unknown, unknown> ? [
|
|
55
|
+
{
|
|
56
|
+
[Alias in keyof RecordField<Root, 'dependencies'>]: NameOfReference<DependencyClassesOf<RecordField<Root, 'dependencies'>[Alias]>, Value>;
|
|
57
|
+
}[keyof RecordField<Root, 'dependencies'>]
|
|
58
|
+
] extends [never] ? false : true : false;
|
|
59
|
+
/**
|
|
60
|
+
* The Classes of the Schema a parent may be: those its projection matches, but the Class being
|
|
61
|
+
* read, which is no ancestor of itself.
|
|
62
|
+
*/
|
|
63
|
+
type LocalClassesOfParent<Root extends DomainSchemaInput, Parent, CurrentName> = Exclude<NameOfReference<ClassesInputOf<Root>, ResolveLazy<Parent>>, CurrentName>;
|
|
64
|
+
/**
|
|
65
|
+
* Whether a parent is a candidate owner whichever Class of the Schema it is: a union of Classes may
|
|
66
|
+
* not be. A dependency's Class bearing its projection declares the Property too, so two parents
|
|
67
|
+
* among the candidates bring two Properties whichever Classes they are.
|
|
68
|
+
*/
|
|
69
|
+
type IsAmong<Names, Owners> = [Names] extends [never] ? false : [Names] extends [Owners] ? true : false;
|
|
70
|
+
type ParentsAmong<Root extends DomainSchemaInput, Parents, CurrentName, Owners> = Parents extends readonly [infer Parent, ...infer Rest] ? IsAmong<LocalClassesOfParent<Root, Parent, CurrentName>, Owners> extends true ? readonly [Parent, ...ParentsAmong<Root, Rest, CurrentName, Owners>] : ParentsAmong<Root, Rest, CurrentName, Owners> : readonly [];
|
|
71
|
+
type ParentsOf<Value> = ClassInputOf<Value> extends {
|
|
72
|
+
readonly extends: infer Parents extends readonly unknown[];
|
|
73
|
+
} ? Parents : readonly [];
|
|
74
|
+
/**
|
|
75
|
+
* The Class a parent is, when it can be only one Class of the Schema and no Class of a direct
|
|
76
|
+
* dependency, whose authored handle may bear its projection.
|
|
77
|
+
*/
|
|
78
|
+
type ExactNameOfParent<Root extends DomainSchemaInput, Parent, CurrentName> = Parent extends unknown ? LocalClassesOfParent<Root, Parent, CurrentName> extends infer Name ? IsMultiple<Name> extends true ? never : DependencyMayBe<Root, ResolveLazy<Parent>> extends true ? never : Name : never : never;
|
|
79
|
+
type ExactNamesOfParents<Root extends DomainSchemaInput, Names, CurrentName> = Names extends keyof ClassesInputOf<Root> ? ExactNameOfParent<Root, ParentsOf<ClassesInputOf<Root>[Names]>[number], CurrentName> : never;
|
|
80
|
+
type SomeHasTwoParentsAmong<Root extends DomainSchemaInput, Names, CurrentName, Owners> = Names extends keyof ClassesInputOf<Root> ? ParentsAmong<Root, ParentsOf<ClassesInputOf<Root>[Names]>, CurrentName, Owners>['length'] extends 0 | 1 ? never : true : never;
|
|
81
|
+
/**
|
|
82
|
+
* Level by level: a level is a union, so a Class that two paths reach is read once on it, and a
|
|
83
|
+
* level holds no Class an earlier one read, so the walk ends within the Classes of the Schema. Each
|
|
84
|
+
* reference to the walk is read through `true extends`, so the checker relates two instantiations
|
|
85
|
+
* of it without unrolling the walk.
|
|
86
|
+
*/
|
|
87
|
+
type AncestorsHoldOwnersApart<Root extends DomainSchemaInput, Names, CurrentName, Owners, Seen = never> = [Names] extends [never] ? false : [SomeHasTwoParentsAmong<Root, Names, CurrentName, Owners>] extends [never] ? true extends AncestorsHoldOwnersApart<Root, Exclude<ExactNamesOfParents<Root, Names, CurrentName>, Seen | Names>, CurrentName, Owners, Seen | Names> ? true : false : true;
|
|
88
|
+
/**
|
|
89
|
+
* Whether two parents of the Class are among the candidate owners, or of a Class it extends that
|
|
90
|
+
* only one Class of the Schema can be: an ancestor alike to another says nothing about either.
|
|
91
|
+
*/
|
|
92
|
+
type HoldsOwnersApart<Root extends DomainSchemaInput, Value, CurrentName, Owners> = ParentsAmong<Root, ParentsOf<Value>, CurrentName, Owners>['length'] extends 0 | 1 ? true extends AncestorsHoldOwnersApart<Root, ExactNameOfParent<Root, ParentsOf<Value>[number], CurrentName>, CurrentName, Owners> ? true : false : true;
|
|
93
|
+
/**
|
|
94
|
+
* The candidate owners of each Property an inherited member is on the Class. Classes alike in shape
|
|
95
|
+
* are one owner to the types. A Class has one Property, under the key of each candidate, unless the
|
|
96
|
+
* types are sure it has one per owner: in doubt, a reader finds the Property by its name.
|
|
97
|
+
*/
|
|
98
|
+
export type OwnersOfEachProperty<Root extends DomainSchemaInput, Value, CurrentName, Owners> = IsMultiple<Owners> extends true ? true extends HoldsOwnersApart<Root, Value, CurrentName, Owners> ? Owners extends unknown ? readonly [Owners] : never : readonly [Owners] : readonly [Owners];
|
|
99
|
+
/**
|
|
100
|
+
* Recover the local declaring Class name for an effective member. An inherited member's owner is an
|
|
101
|
+
* ancestor, so never the Class being read, even when the two are alike.
|
|
102
|
+
*/
|
|
103
|
+
export type OwnerNameOf<Root extends DomainSchemaInput, CurrentName extends string, Owner> = Owner extends 'self' ? CurrentName : Owner extends ClassOwnerProjection ? Exclude<Extract<LocalNameOfOwner<Root, Owner>, string>, CurrentName> : Owner extends ClassIdentityProjection ? Exclude<Extract<LocalNameOfIdentity<Root, Owner>, string>, CurrentName> : never;
|
|
39
104
|
export {};
|
|
@@ -10,7 +10,7 @@ export interface PropertyProjection<Value = unknown, Required extends boolean =
|
|
|
10
10
|
readonly input: Input;
|
|
11
11
|
}
|
|
12
12
|
/** A Method’s exact callable, ownership and executable contracts. */
|
|
13
|
-
export interface MethodProjection<Input = unknown, Output = unknown, Static extends boolean = boolean, Abstract extends boolean = boolean, Auth extends language.FunctionAuth = language.FunctionAuth, Name extends string = string, Key extends language.MethodKey = language.MethodKey, Executable extends boolean = boolean, Execution extends language.CallableExecution | undefined = language.CallableExecution | undefined> {
|
|
13
|
+
export interface MethodProjection<Input = unknown, Output = unknown, Static extends boolean = boolean, Abstract extends boolean = boolean, Auth extends language.FunctionAuth = language.FunctionAuth, Name extends string = string, Key extends language.MethodKey = language.MethodKey, Executable extends boolean = boolean, Execution extends language.CallableExecution | undefined = language.CallableExecution | undefined, Admission extends language.CallableAdmission | undefined = language.CallableAdmission | undefined> {
|
|
14
14
|
readonly input: Input;
|
|
15
15
|
readonly output: Output;
|
|
16
16
|
readonly static: Static;
|
|
@@ -20,15 +20,17 @@ export interface MethodProjection<Input = unknown, Output = unknown, Static exte
|
|
|
20
20
|
readonly name: Name;
|
|
21
21
|
readonly key: Key;
|
|
22
22
|
readonly execution: Execution;
|
|
23
|
+
readonly admission: Admission;
|
|
23
24
|
}
|
|
24
25
|
/** A Function’s exact callable and declaration contracts. */
|
|
25
|
-
export interface FunctionProjection<Input = unknown, Output = unknown, Auth extends language.FunctionAuth = language.FunctionAuth, Ref extends language.FunctionRef = language.FunctionRef, Key extends language.DefinitionKey<string, 'function'> = language.DefinitionKey<string, 'function'>, Execution extends language.CallableExecution | undefined = language.CallableExecution | undefined> {
|
|
26
|
+
export interface FunctionProjection<Input = unknown, Output = unknown, Auth extends language.FunctionAuth = language.FunctionAuth, Ref extends language.FunctionRef = language.FunctionRef, Key extends language.DefinitionKey<string, 'function'> = language.DefinitionKey<string, 'function'>, Execution extends language.CallableExecution | undefined = language.CallableExecution | undefined, Admission extends language.CallableAdmission | undefined = language.CallableAdmission | undefined> {
|
|
26
27
|
readonly input: Input;
|
|
27
28
|
readonly output: Output;
|
|
28
29
|
readonly auth: Auth;
|
|
29
30
|
readonly ref: Ref;
|
|
30
31
|
readonly key: Key;
|
|
31
32
|
readonly execution: Execution;
|
|
33
|
+
readonly admission: Admission;
|
|
32
34
|
}
|
|
33
35
|
/** A compact Class witness with effective members and exact self facets. */
|
|
34
36
|
export interface ClassProjection<Kind extends language.ClassKind = language.ClassKind, Definition extends Extract<language.ClassDefinition, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as language from '../../../language/index.js';
|
|
2
|
-
import type { AuthoredPropertyProjection } from '../../class/
|
|
2
|
+
import type { AuthoredPropertyProjection } from '../../class/projection.js';
|
|
3
3
|
import type { DomainSchemaInput } from '../input.js';
|
|
4
|
-
import type { RecordField, ClassInputOf, OwnerNameOf } from './identity.js';
|
|
4
|
+
import type { RecordField, ClassInputOf, IsMultiple, OwnerNameOf, OwnersOfEachProperty } from './identity.js';
|
|
5
5
|
import type { PropertyProjection } from './model.js';
|
|
6
6
|
type PropertyFieldsOf<Value> = RecordField<ClassInputOf<Value>, 'properties'>;
|
|
7
7
|
interface AuthoredPropertyEntry<Owner, Name extends string, Field> {
|
|
@@ -26,7 +26,41 @@ export type OwnPropertyProjectionsOf<Origin extends string, Name extends string,
|
|
|
26
26
|
export type EffectivePropertyEntriesOfClass<Value> = ClassInputOf<Value> extends {
|
|
27
27
|
readonly effectiveProperties: infer Properties;
|
|
28
28
|
} ? Properties : never;
|
|
29
|
-
type EffectivePropertyProjectionOfEntry<Origin extends string, CurrentName extends string, Root extends DomainSchemaInput, Entry> = Entry extends language.ResolvedProperty ? PropertyProjectionOfResolved<Entry> : Entry extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer PropertyName, infer Owner, infer State> ? OwnerNameOf<Root, CurrentName, Owner
|
|
29
|
+
type EffectivePropertyProjectionOfEntry<Origin extends string, CurrentName extends string, Value, Root extends DomainSchemaInput, Entry> = Entry extends language.ResolvedProperty ? PropertyProjectionOfResolved<Entry> : Entry extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer PropertyName, infer Owner, infer State> ? OwnersOfEachProperty<Root, Value, CurrentName, OwnerNameOf<Root, CurrentName, Owner>> extends infer Owners ? Owners extends readonly [infer OwnerName extends string] ? PropertyProjection<Output, Required, PropertyName, language.PropertyKey<Origin, OwnerName, PropertyName>, State, Input> : never : never : never;
|
|
30
|
+
/** The entries of this name under one key: Properties the types are sure of. */
|
|
31
|
+
type SureEntriesNamed<All, Name> = All extends {
|
|
32
|
+
readonly name: Name;
|
|
33
|
+
readonly key: infer Key;
|
|
34
|
+
} ? [Key] extends [never] ? never : IsMultiple<Key> extends true ? never : All : never;
|
|
35
|
+
/** The entries of this name in doubt among keys, `Key` not among them. */
|
|
36
|
+
type DoubtsWithout<All, Name, Key> = All extends {
|
|
37
|
+
readonly name: Name;
|
|
38
|
+
readonly key: infer Keys;
|
|
39
|
+
} ? IsMultiple<Keys> extends true ? [Key] extends [Keys] ? never : All : never : never;
|
|
40
|
+
/** The names of the entries under several candidate keys, or under one. */
|
|
41
|
+
type NamesUnder<All, Several extends boolean> = All extends {
|
|
42
|
+
readonly name: infer Name;
|
|
43
|
+
readonly key: infer Key;
|
|
44
|
+
} ? IsMultiple<Key> extends Several ? Name : never : never;
|
|
45
|
+
/**
|
|
46
|
+
* Only a dependency brings an entry under one key among the keys of an entry in doubt: in this
|
|
47
|
+
* Schema, the candidates of an inherited Property are the Classes alike to its owner but the Class
|
|
48
|
+
* being read, so those of two Properties are the same Classes or share none, and the Class's own
|
|
49
|
+
* Properties are under its own key. A Schema without dependencies reads its entries as they are.
|
|
50
|
+
*/
|
|
51
|
+
type OneEntryPerDoubtIn<Root, All> = [keyof RecordField<Root, 'dependencies'>] extends [never] ? All : OneEntryPerDoubt<All>;
|
|
52
|
+
/**
|
|
53
|
+
* A dependency's Class brings its Property under the key of each candidate, and another path can
|
|
54
|
+
* bring the same Property under one of them. An entry of a name goes when it spans exactly the keys
|
|
55
|
+
* of the name's entries under one key and every entry in doubt bears all of them: those entries
|
|
56
|
+
* stand for it. So the only entry under one key goes when every entry in doubt bears its key, as in
|
|
57
|
+
* doubt the types read one Property, and an entry in doubt among exactly the keys of several
|
|
58
|
+
* entries under one key goes, as it is one of those sure Properties. Every other entry stands.
|
|
59
|
+
*/
|
|
60
|
+
type OneEntryPerDoubt<All, Doubts = Extract<NamesUnder<All, true>, NamesUnder<All, false>>, Each = All> = [Doubts] extends [never] ? All : Each extends {
|
|
61
|
+
readonly name: infer Name;
|
|
62
|
+
readonly key: infer Key;
|
|
63
|
+
} ? Name extends Doubts ? [SureEntriesNamed<All, Name>] extends [Each] ? [Each] extends [SureEntriesNamed<All, Name>] ? [DoubtsWithout<All, Name, Key>] extends [never] ? never : Each : Each : Each : Each : never;
|
|
30
64
|
/** Bind effective Property witnesses to their declaring Class coordinates. */
|
|
31
|
-
export type EffectivePropertyProjectionsOf<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput> = EffectivePropertyEntriesOfClass<Value> extends infer Entry ? Entry extends unknown ? EffectivePropertyProjectionOfEntry<Origin, Name, Root, Entry> : never : never
|
|
65
|
+
export type EffectivePropertyProjectionsOf<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput> = OneEntryPerDoubtIn<Root, EffectivePropertyEntriesOfClass<Value> extends infer Entry ? Entry extends unknown ? EffectivePropertyProjectionOfEntry<Origin, Name, Value, Root, Entry> : never : never>;
|
|
32
66
|
export {};
|
|
@@ -41,10 +41,10 @@ type ResolvedPropertyOfProjection<Value> = Value extends PropertyProjection<infe
|
|
|
41
41
|
readonly name: Name;
|
|
42
42
|
readonly key: Key;
|
|
43
43
|
} : never;
|
|
44
|
+
type PropertiesBearing<Entries extends PropertyProjection, Key> = Entries extends unknown ? Key extends Entries['key'] ? Entries : never : never;
|
|
45
|
+
/** A Property under each key it may bear: see `OwnersOfEachProperty`. */
|
|
44
46
|
type ProjectionPropertyByKey<Entries extends PropertyProjection> = Readonly<{
|
|
45
|
-
[Key in Entries['key']]: ResolvedPropertyOfProjection<
|
|
46
|
-
readonly key: Key;
|
|
47
|
-
}>>;
|
|
47
|
+
[Key in Entries['key']]: ResolvedPropertyOfProjection<PropertiesBearing<Entries, Key>>;
|
|
48
48
|
}>;
|
|
49
49
|
type ProjectionPropertyByName<Entries extends PropertyProjection> = Readonly<{
|
|
50
50
|
[Name in Entries['name'] as IsMultiple<Extract<Entries, {
|
|
@@ -56,10 +56,11 @@ type ProjectionPropertyByName<Entries extends PropertyProjection> = Readonly<{
|
|
|
56
56
|
/** Restore qualified lookup and unambiguous named Property access. */
|
|
57
57
|
type PropertyCollectionOfProjection<Entries extends PropertyProjection> = language.ResolvedPropertyCollection<ProjectionPropertyByKey<Entries>, ProjectionPropertyByName<Entries>>;
|
|
58
58
|
type MethodCollectionOperation = 'byKey' | 'get';
|
|
59
|
-
type ResolvedMethodOfProjection<Value> = Value extends MethodProjection<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer Name, infer Key, infer Executable, infer Execution> ? language.ResolvedMethod<Input, Output, Static, Abstract, Auth, language.CallablePolicy, Key> & {
|
|
59
|
+
type ResolvedMethodOfProjection<Value> = Value extends MethodProjection<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer Name, infer Key, infer Executable, infer Execution, infer Admission> ? language.ResolvedMethod<Input, Output, Static, Abstract, Auth, language.CallablePolicy, Key> & {
|
|
60
60
|
readonly name: Name;
|
|
61
61
|
readonly executable: Executable;
|
|
62
62
|
readonly execution: Execution;
|
|
63
|
+
readonly admission: Admission;
|
|
63
64
|
} : never;
|
|
64
65
|
type ProjectionMethodByKey<Entries extends MethodProjection> = Readonly<{
|
|
65
66
|
[Key in Entries['key']]: ResolvedMethodOfProjection<Extract<Entries, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { PropertyProjection, MethodProjection, FunctionProjection, ClassProjection,
|
|
1
|
+
export type { PropertyProjection, MethodProjection, FunctionProjection, ClassProjection, } from './projection/model.js';
|
|
2
2
|
export type { ResolvedDomainOfInput } from './projection/domain.js';
|
|
3
3
|
export type { CoreNamedPropertyInput, CorePropertyInput } from './projection/core-input.js';
|
|
4
4
|
export type { ClassProjectionOfResolved } from './projection/resolved-class.js';
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import type { SchemaDiagnosticCode } from '../../schema/diagnostic.js';
|
|
2
|
+
import type { InstallId } from '../../schema/enforcement/install.js';
|
|
3
|
+
/**
|
|
4
|
+
* What answers a Schema document that breaks a rule of the Builder: a document reaches the Kernel
|
|
5
|
+
* without passing through the Builder. `refused`: admission refuses it by `admission`, or the install
|
|
6
|
+
* by the row `install`. `nothing`: it is accepted and installs, so only an authored Schema holds the
|
|
7
|
+
* rule. `unsayable`: the rule is about an authoring value, which a document cannot hold. `unexamined`:
|
|
8
|
+
* a rule of Policies, Functions, Methods or Views, whose document is not compared here.
|
|
9
|
+
*/
|
|
10
|
+
export type BuilderRuleOnDocument = {
|
|
11
|
+
readonly holds: 'refused';
|
|
12
|
+
readonly admission?: readonly [SchemaDiagnosticCode, ...SchemaDiagnosticCode[]];
|
|
13
|
+
readonly install?: InstallId;
|
|
14
|
+
} | {
|
|
15
|
+
readonly holds: 'nothing';
|
|
16
|
+
} | {
|
|
17
|
+
readonly holds: 'unsayable';
|
|
18
|
+
} | {
|
|
19
|
+
readonly holds: 'unexamined';
|
|
20
|
+
};
|
|
21
|
+
/** The rule one diagnostic code of the Builder reports. */
|
|
22
|
+
export interface BuilderRule {
|
|
23
|
+
/** The rule, in one plain sentence. */
|
|
24
|
+
readonly statement: string;
|
|
25
|
+
readonly document: BuilderRuleOnDocument;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Every diagnostic code the Builder owns with the rule it reports. A code added to the Builder does
|
|
29
|
+
* not compile until it is described here. A rule of the Language is in `schema.values.RULES`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const BUILDER_RULES: Readonly<{
|
|
32
|
+
readonly BUILDER_ABSTRACT_POLICY: {
|
|
33
|
+
readonly statement: 'An abstract Class declares no Class Policy, and an abstract Method no Policy.';
|
|
34
|
+
readonly document: {
|
|
35
|
+
readonly holds: 'unexamined';
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly BUILDER_AMBIGUOUS_OWNERSHIP: {
|
|
39
|
+
readonly statement: 'One authoring handle is owned by one Definition.';
|
|
40
|
+
readonly document: {
|
|
41
|
+
readonly holds: 'unsayable';
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly BUILDER_AUTO_EVENT_INVALID: {
|
|
45
|
+
readonly statement: 'An automatic Property runs on at least one event, each of them create or update, and a required one runs on create.';
|
|
46
|
+
readonly document: {
|
|
47
|
+
readonly holds: 'refused';
|
|
48
|
+
readonly admission: readonly ["STRUCTURE_MINIMUM", "STRUCTURE_VALUE", "DV_PROPERTY_AUTO"];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly BUILDER_AUTO_IMMUTABLE: {
|
|
52
|
+
readonly statement: 'An automatic Property is not immutable.';
|
|
53
|
+
readonly document: {
|
|
54
|
+
readonly holds: 'refused';
|
|
55
|
+
readonly admission: readonly ["DV_PROPERTY_IMMUTABLE"];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly BUILDER_AUTO_NESTED: {
|
|
59
|
+
readonly statement: '`auto(...)` wraps a Property which is not already automatic.';
|
|
60
|
+
readonly document: {
|
|
61
|
+
readonly holds: 'unsayable';
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
readonly BUILDER_AUTO_SET_INVALID: {
|
|
65
|
+
readonly statement: 'The setter of an automatic Property is `instant`.';
|
|
66
|
+
readonly document: {
|
|
67
|
+
readonly holds: 'refused';
|
|
68
|
+
readonly admission: readonly ["STRUCTURE_VALUE"];
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
readonly BUILDER_CALLABLE_AUTH: {
|
|
72
|
+
readonly statement: 'A Function declares its auth as anonymous, authenticated or authorized.';
|
|
73
|
+
readonly document: {
|
|
74
|
+
readonly holds: 'unexamined';
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly BUILDER_CALLABLE_PLACEMENT: {
|
|
78
|
+
readonly statement: 'A standalone Function declares no staticness or abstractness, and a Method takes a Value input.';
|
|
79
|
+
readonly document: {
|
|
80
|
+
readonly holds: 'unexamined';
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
readonly BUILDER_CALLABLE_POLICY_AUTH: {
|
|
84
|
+
readonly statement: 'Only an authorized Function or Method declares a Policy check.';
|
|
85
|
+
readonly document: {
|
|
86
|
+
readonly holds: 'unexamined';
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly BUILDER_CLASS_INHERITANCE: {
|
|
90
|
+
readonly statement: 'A Class extends a Class of another Domain only where that Class is open in the revision it binds.';
|
|
91
|
+
readonly document: {
|
|
92
|
+
readonly holds: 'refused';
|
|
93
|
+
readonly admission: readonly ["DV_CLASS_INHERITANCE"];
|
|
94
|
+
readonly install: 'DEPENDENCY_INCOMPATIBLE';
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
readonly BUILDER_CORE_CLASS: {
|
|
98
|
+
readonly statement: 'The Class of a Core Node or a Core Edge is local to the owning Domain.';
|
|
99
|
+
readonly document: {
|
|
100
|
+
readonly holds: 'refused';
|
|
101
|
+
readonly admission: readonly ["DV_CORE_NODE_CLASS", "DV_CORE_EDGE_CLASS"];
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly BUILDER_CORE_EDGE: {
|
|
105
|
+
readonly statement: 'An entry of `core.edges` is created by `core.edge(...)`.';
|
|
106
|
+
readonly document: {
|
|
107
|
+
readonly holds: 'unsayable';
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly BUILDER_CORE_NODE: {
|
|
111
|
+
readonly statement: 'An entry of `core.nodes` is created by `core.node(...)`.';
|
|
112
|
+
readonly document: {
|
|
113
|
+
readonly holds: 'unsayable';
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
readonly BUILDER_CORE_PROPERTY: {
|
|
117
|
+
readonly statement: 'A Core fact names a Property of its Class by name, each once, and its Class is concrete and resolves.';
|
|
118
|
+
readonly document: {
|
|
119
|
+
readonly holds: 'refused';
|
|
120
|
+
readonly admission: readonly ["DV_CORE_NODE_PROPERTIES"];
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
readonly BUILDER_CORE_REF: {
|
|
124
|
+
readonly statement: 'An endpoint of a Core Edge names the owning Domain or one local Definition, Function, Method, Policy, View or Core Node.';
|
|
125
|
+
readonly document: {
|
|
126
|
+
readonly holds: 'refused';
|
|
127
|
+
readonly admission: readonly ["DV_CORE_REF"];
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
readonly BUILDER_DEFINITION: {
|
|
131
|
+
readonly statement: 'An entry of `classes` is created by a Definition builder.';
|
|
132
|
+
readonly document: {
|
|
133
|
+
readonly holds: 'unsayable';
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
readonly BUILDER_DEPENDENCY_ALIAS: {
|
|
137
|
+
readonly statement: 'A dependency alias is an ASCII lower-camel identifier and is not reserved.';
|
|
138
|
+
readonly document: {
|
|
139
|
+
readonly holds: 'refused';
|
|
140
|
+
readonly admission: readonly ["STRUCTURE_KEY", "STRUCTURE_DEPENDENCY_ALIAS"];
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly BUILDER_DEPENDENCY_CONFLICT: {
|
|
144
|
+
readonly statement: 'One origin is declared under one dependency alias.';
|
|
145
|
+
readonly document: {
|
|
146
|
+
readonly holds: 'refused';
|
|
147
|
+
readonly admission: readonly ["DV_DEPENDENCY_UNIQUE"];
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
readonly BUILDER_DEPENDENCY_DIRECT: {
|
|
151
|
+
readonly statement: 'A foreign Definition belongs to a direct dependency.';
|
|
152
|
+
readonly document: {
|
|
153
|
+
readonly holds: 'refused';
|
|
154
|
+
readonly admission: readonly ["DV_REF_RESOLVES", "DV_DEPENDENCY_DIRECT"];
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
readonly BUILDER_EDGE_LIFETIME: {
|
|
158
|
+
readonly statement: 'An Edge Class with an endpoint which can hold a Node of another Domain requires no Edge at any endpoint, and an Edge Class keeps the lifetimes of the Edge Classes it extends.';
|
|
159
|
+
readonly document: {
|
|
160
|
+
readonly holds: 'nothing';
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
readonly BUILDER_FILE_INVALID: {
|
|
164
|
+
readonly statement: 'A file field states valid constraints, within those of the blob it is copied from.';
|
|
165
|
+
readonly document: {
|
|
166
|
+
readonly holds: 'refused';
|
|
167
|
+
readonly admission: readonly ["DV_VALUE_SCHEMA"];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
readonly BUILDER_FOREIGN_POLICY: {
|
|
171
|
+
readonly statement: 'A Policy reference names a local Policy.';
|
|
172
|
+
readonly document: {
|
|
173
|
+
readonly holds: 'unexamined';
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
readonly BUILDER_FULL_MATCH_INVALID: {
|
|
177
|
+
readonly statement: '`fullMatch(...)` takes a complete I-Regexp source within the state budget.';
|
|
178
|
+
readonly document: {
|
|
179
|
+
readonly holds: 'refused';
|
|
180
|
+
readonly admission: readonly ["DV_VALUE_SCHEMA"];
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
readonly BUILDER_FUNCTION: {
|
|
184
|
+
readonly statement: 'An entry of `functions` is created by `func(...)`.';
|
|
185
|
+
readonly document: {
|
|
186
|
+
readonly holds: 'unexamined';
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
readonly BUILDER_METHOD: {
|
|
190
|
+
readonly statement: 'An entry of `methods` is created by `method(...)`.';
|
|
191
|
+
readonly document: {
|
|
192
|
+
readonly holds: 'unexamined';
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
readonly BUILDER_PATH_DUPLICATE: {
|
|
196
|
+
readonly statement: '`path(...)` names one Node Definition once. A path stands in a Zod input, so the refusal reaches the caller as `ZOD_SCHEMA_NOT_LOSSLESS`, whose message holds this code.';
|
|
197
|
+
readonly document: {
|
|
198
|
+
readonly holds: 'refused';
|
|
199
|
+
readonly admission: readonly ["DV_VALUE_SCHEMA"];
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
readonly BUILDER_PATH_EMPTY: {
|
|
203
|
+
readonly statement: '`path(...)` names at least one Node Definition.';
|
|
204
|
+
readonly document: {
|
|
205
|
+
readonly holds: 'refused';
|
|
206
|
+
readonly admission: readonly ["DV_VALUE_SCHEMA"];
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
readonly BUILDER_POLICY: {
|
|
210
|
+
readonly statement: 'A Policy is created by `policy(...)` and its operands take the object it checks.';
|
|
211
|
+
readonly document: {
|
|
212
|
+
readonly holds: 'unexamined';
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
readonly BUILDER_POLICY_COMPOSITION: {
|
|
216
|
+
readonly statement: 'A Policy composition is created by `policy.allOf(...)` or `policy.anyOf(...)`.';
|
|
217
|
+
readonly document: {
|
|
218
|
+
readonly holds: 'unexamined';
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
readonly BUILDER_POLICY_CYCLE: {
|
|
222
|
+
readonly statement: 'A Policy composition does not reach itself.';
|
|
223
|
+
readonly document: {
|
|
224
|
+
readonly holds: 'unexamined';
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
readonly BUILDER_POLICY_EMPTY_COMPOSITION: {
|
|
228
|
+
readonly statement: 'A Policy composition has at least one operand.';
|
|
229
|
+
readonly document: {
|
|
230
|
+
readonly holds: 'unexamined';
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
readonly BUILDER_POLICY_EMPTY_EXISTS: {
|
|
234
|
+
readonly statement: '`exists(...)` declares at least one variable Node.';
|
|
235
|
+
readonly document: {
|
|
236
|
+
readonly holds: 'unexamined';
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly BUILDER_POLICY_INPUT: {
|
|
240
|
+
readonly statement: 'A Policy input is one direct required field holding one Node path.';
|
|
241
|
+
readonly document: {
|
|
242
|
+
readonly holds: 'unexamined';
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
readonly BUILDER_POLICY_REF: {
|
|
246
|
+
readonly statement: 'A Policy `ref(...)` names one local or direct-dependency Definition, Function, Method, Policy, View or Core Node.';
|
|
247
|
+
readonly document: {
|
|
248
|
+
readonly holds: 'unexamined';
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
readonly BUILDER_POLICY_SELF: {
|
|
252
|
+
readonly statement: '`self` is available only to a non-static Node Method.';
|
|
253
|
+
readonly document: {
|
|
254
|
+
readonly holds: 'unexamined';
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly BUILDER_PROPERTY_IMMUTABLE_INVALID: {
|
|
258
|
+
readonly statement: '`immutable` is `create` or `once`.';
|
|
259
|
+
readonly document: {
|
|
260
|
+
readonly holds: 'refused';
|
|
261
|
+
readonly admission: readonly ["STRUCTURE_VALUE"];
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
readonly BUILDER_REFERENCE_CYCLE: {
|
|
265
|
+
readonly statement: 'A lazy reference resolves without reaching itself.';
|
|
266
|
+
readonly document: {
|
|
267
|
+
readonly holds: 'unsayable';
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
readonly BUILDER_REFERENCE_KIND: {
|
|
271
|
+
readonly statement: 'A reference names a Class of the kind its position takes.';
|
|
272
|
+
readonly document: {
|
|
273
|
+
readonly holds: 'refused';
|
|
274
|
+
readonly admission: readonly ["DV_CLASS_KIND"];
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
readonly BUILDER_REFERENCE_MISSING: {
|
|
278
|
+
readonly statement: 'A local reference names a Definition the Domain declares.';
|
|
279
|
+
readonly document: {
|
|
280
|
+
readonly holds: 'refused';
|
|
281
|
+
readonly admission: readonly ["DV_REF_RESOLVES"];
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
readonly BUILDER_UNIQUE_PROPERTY: {
|
|
285
|
+
readonly statement: 'A key names a Property its Class holds.';
|
|
286
|
+
readonly document: {
|
|
287
|
+
readonly holds: 'refused';
|
|
288
|
+
readonly admission: readonly ["DV_NODE_UNIQUE"];
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
readonly BUILDER_UNKNOWN_FIELD: {
|
|
292
|
+
readonly statement: 'An authoring input holds no field its builder does not read.';
|
|
293
|
+
readonly document: {
|
|
294
|
+
readonly holds: 'refused';
|
|
295
|
+
readonly admission: readonly ["STRUCTURE_UNKNOWN_FIELD"];
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
readonly BUILDER_UNOWNED_REFERENCE: {
|
|
299
|
+
readonly statement: 'A reference to an authoring handle names a handle some Domain owns.';
|
|
300
|
+
readonly document: {
|
|
301
|
+
readonly holds: 'unsayable';
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
readonly BUILDER_VIEW: {
|
|
305
|
+
readonly statement: 'An entry of `views` is created by `view(...)`, which names no target.';
|
|
306
|
+
readonly document: {
|
|
307
|
+
readonly holds: 'unexamined';
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
readonly ZOD_SCHEMA_NOT_LOSSLESS: {
|
|
311
|
+
readonly statement: 'A Zod schema is one Draft 2020-12 can state with the same acceptance. A document states a value schema directly.';
|
|
312
|
+
readonly document: {
|
|
313
|
+
readonly holds: 'unsayable';
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
}>;
|