@astrale-os/kernel-core 0.9.0-beta.9 → 1.0.0-beta.2
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/auth/authority/accept.js +4 -0
- package/dist/auth/authority/admission/admission.d.ts +4 -1
- package/dist/auth/authority/admission/admission.js +46 -147
- package/dist/auth/authority/admission/index.d.ts +1 -1
- package/dist/auth/authority/admission/index.js +1 -1
- package/dist/auth/authority/admission/references.d.ts +13 -0
- package/dist/auth/authority/admission/references.js +38 -0
- package/dist/auth/authority/admission/term.d.ts +6 -0
- package/dist/auth/authority/admission/term.js +60 -0
- package/dist/auth/authority/admission/wire.d.ts +8 -0
- package/dist/auth/authority/admission/wire.js +33 -0
- package/dist/auth/authority/canonical.d.ts +2 -0
- package/dist/auth/authority/canonical.js +15 -0
- package/dist/auth/authority/index.d.ts +9 -2
- package/dist/auth/authority/index.js +6 -1
- package/dist/auth/authority/language/index.d.ts +3 -1
- package/dist/auth/authority/language/index.js +1 -0
- package/dist/auth/authority/language/predicate.d.ts +31 -16
- package/dist/auth/authority/language/predicate.js +1 -1
- package/dist/auth/authority/language/program.d.ts +21 -0
- package/dist/auth/authority/language/program.js +2 -0
- package/dist/auth/authority/normalization/index.d.ts +1 -1
- package/dist/auth/authority/normalization/index.js +1 -1
- package/dist/auth/authority/normalization/normalize.d.ts +2 -0
- package/dist/auth/authority/normalization/normalize.js +38 -16
- package/dist/auth/authority/ownership.optimization.d.ts +8 -0
- package/dist/auth/authority/ownership.optimization.js +83 -0
- package/dist/auth/authority/prepare-binder-body.d.ts +4 -0
- package/dist/auth/authority/prepare-binder-body.js +31 -0
- package/dist/auth/authority/program.d.ts +28 -0
- package/dist/auth/authority/program.js +191 -0
- package/dist/auth/authority/semantics/class-authority.d.ts +8 -0
- package/dist/auth/authority/semantics/class-authority.js +26 -0
- package/dist/auth/authority/semantics/composition.d.ts +39 -0
- package/dist/auth/authority/semantics/composition.js +112 -0
- package/dist/auth/authority/semantics/failure.d.ts +21 -0
- package/dist/auth/authority/semantics/failure.js +10 -0
- package/dist/auth/authority/semantics/index.d.ts +11 -0
- package/dist/auth/authority/semantics/index.js +5 -0
- package/dist/auth/authority/semantics/interpret.d.ts +41 -0
- package/dist/auth/authority/semantics/interpret.js +388 -0
- package/dist/auth/authority/semantics/snapshot.d.ts +40 -0
- package/dist/auth/authority/semantics/terms.d.ts +20 -0
- package/dist/auth/authority/semantics/terms.js +96 -0
- package/dist/auth/authority/semantics/vocabulary.d.ts +19 -0
- package/dist/auth/context/context.d.ts +4 -3
- package/dist/auth/expression/authoring/builder.d.ts +2 -11
- package/dist/auth/expression/authoring/builder.js +1 -45
- package/dist/auth/expression/authoring/index.d.ts +1 -1
- package/dist/auth/expression/authoring/index.js +1 -1
- package/dist/auth/expression/index.d.ts +1 -2
- package/dist/auth/expression/index.js +1 -2
- package/dist/auth/expression/language/identity-expression.d.ts +2 -22
- package/dist/auth/grant/index.d.ts +1 -1
- package/dist/auth/grant/index.js +1 -1
- package/dist/auth/grant/resolved/admission.d.ts +4 -3
- package/dist/auth/grant/resolved/admission.js +23 -13
- package/dist/auth/grant/resolved/grant.d.ts +1 -1
- package/dist/auth/grant/resolved/index.d.ts +1 -1
- package/dist/auth/grant/resolved/index.js +1 -1
- package/dist/auth/grant/unresolved/admission.d.ts +4 -1
- package/dist/auth/grant/unresolved/admission.js +27 -67
- package/dist/auth/grant/unresolved/limits.d.ts +2 -4
- package/dist/auth/grant/unresolved/limits.js +1 -5
- package/dist/auth/identity/admission.js +11 -3
- package/dist/auth/identity/identity.d.ts +15 -3
- package/dist/auth/identity/index.d.ts +1 -1
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/index.js +1 -1
- package/dist/auth/jwk/index.d.ts +1 -1
- package/dist/auth/jwk/index.js +1 -1
- package/dist/auth/jwk/thumbprint.d.ts +2 -0
- package/dist/auth/jwk/thumbprint.js +12 -6
- package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
- package/dist/auth/register/fingerprint/fingerprint.js +31 -0
- package/dist/auth/register/fingerprint/index.d.ts +2 -0
- package/dist/auth/register/index.d.ts +5 -0
- package/dist/auth/register/request/admission.d.ts +3 -0
- package/dist/auth/register/request/admission.js +103 -0
- package/dist/auth/register/request/index.d.ts +3 -0
- package/dist/auth/register/request/limits.d.ts +6 -0
- package/dist/auth/register/request/limits.js +6 -0
- package/dist/auth/register/request/request.d.ts +19 -0
- package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
- package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
- package/dist/auth/register/result/index.d.ts +1 -0
- package/dist/auth/register/result/result.d.ts +10 -0
- package/dist/auth/register/result/result.js +1 -0
- package/dist/callable/contract/body.d.ts +10 -0
- package/dist/callable/contract/body.js +7 -0
- package/dist/callable/contract/index.d.ts +2 -1
- package/dist/callable/contract/index.js +1 -1
- package/dist/callable/contract/output.d.ts +18 -2
- package/dist/callable/index.d.ts +3 -2
- package/dist/callable/index.js +2 -1
- package/dist/callable/invocation/call.d.ts +16 -2
- package/dist/callable/invocation/call.js +41 -1
- package/dist/callable/invocation/index.d.ts +1 -1
- package/dist/callable/invocation/index.js +1 -1
- package/dist/callable/invocation/result.d.ts +2 -2
- package/dist/dns-label.d.ts +1 -2
- package/dist/dns-label.js +2 -3
- package/dist/graph/graph/graph.d.ts +1 -5
- package/dist/graph/graph/graph.js +3 -27
- package/dist/graph/graph/index.d.ts +2 -4
- package/dist/graph/graph/index.js +2 -3
- package/dist/graph/graph/model/codec.js +4 -4
- package/dist/graph/graph/model/index.d.ts +1 -1
- package/dist/graph/graph/model/index.js +1 -1
- package/dist/graph/graph/model/model.d.ts +7 -7
- package/dist/graph/graph/model/model.js +6 -6
- package/dist/graph/graph/model/wire.d.ts +58 -78
- package/dist/graph/graph/model/wire.js +18 -19
- package/dist/graph/mutate/authoring/builder.d.ts +2 -2
- package/dist/graph/mutate/authoring/builder.js +2 -2
- package/dist/graph/mutate/authoring/create.js +13 -5
- package/dist/graph/mutate/index.d.ts +1 -1
- package/dist/graph/mutate/language/codec.js +3 -3
- package/dist/graph/mutate/language/model.d.ts +4 -4
- package/dist/graph/mutate/language/wire.d.ts +226 -215
- package/dist/graph/mutate/language/wire.js +42 -47
- package/dist/graph/mutate/result/index.d.ts +4 -3
- package/dist/graph/mutate/result/index.js +8 -6
- package/dist/graph/mutate/result/wire.d.ts +4 -4
- package/dist/graph/mutate/result/wire.js +7 -4
- package/dist/graph/node/identity/id.d.ts +0 -4
- package/dist/graph/node/identity/id.js +0 -5
- package/dist/graph/node/identity/order.js +20 -0
- package/dist/graph/path/authoring/path.d.ts +8 -5
- package/dist/graph/path/authoring/path.js +21 -3
- package/dist/graph/path/language/model.d.ts +8 -3
- package/dist/graph/path/language/syntax.js +23 -8
- package/dist/graph/query/authoring/builder.js +37 -5
- package/dist/graph/query/authoring/model.d.ts +20 -1
- package/dist/graph/query/index.d.ts +4 -2
- package/dist/graph/query/index.js +1 -0
- package/dist/graph/query/language/codec.js +18 -3
- package/dist/graph/query/language/fingerprint.js +8 -0
- package/dist/graph/query/language/model.d.ts +22 -4
- package/dist/graph/query/language/wire.d.ts +124 -114
- package/dist/graph/query/language/wire.js +54 -47
- package/dist/graph/query/order/index.d.ts +53 -0
- package/dist/graph/query/order/index.js +79 -0
- package/dist/graph/query/reference/evaluate.d.ts +1 -0
- package/dist/graph/query/reference/evaluate.js +39 -52
- package/dist/graph/query/result/index.js +1 -1
- package/dist/graph/query/result/wire.d.ts +93 -94
- package/dist/graph/query/result/wire.js +20 -20
- package/dist/graph/reconcile/condition/model.d.ts +2 -2
- package/dist/graph/reconcile/condition/references.d.ts +0 -1
- package/dist/graph/reconcile/condition/references.js +4 -4
- package/dist/graph/reconcile/correspondence.d.ts +9 -8
- package/dist/graph/reconcile/evidence.d.ts +2 -2
- package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
- package/dist/graph/reconcile/observation.d.ts +4 -3
- package/dist/graph/reconcile/planning/canonical.d.ts +6 -0
- package/dist/graph/reconcile/planning/canonical.js +28 -0
- package/dist/graph/reconcile/planning/context.d.ts +3 -3
- package/dist/graph/reconcile/planning/model.d.ts +8 -4
- package/dist/graph/reconcile/planning/plan.js +2 -1
- package/dist/schema/authority/authority-relation.js +3 -0
- package/dist/schema/authority/claims.d.ts +24 -25
- package/dist/schema/authority/claims.js +8 -8
- package/dist/schema/authority/governed-by.d.ts +16 -91
- package/dist/schema/authority/governed-by.js +1 -1
- package/dist/schema/authority/operation-node.d.ts +27 -13
- package/dist/schema/authority/operations.d.ts +8 -168
- package/dist/schema/authority/policy.d.ts +27 -15
- package/dist/schema/authority/vocabulary.d.ts +3 -0
- package/dist/schema/authority/vocabulary.js +25 -0
- package/dist/schema/callables/entrypoint.d.ts +32 -0
- package/dist/schema/callables/entrypoint.js +12 -0
- package/dist/schema/callables/execution.d.ts +269 -0
- package/dist/schema/callables/execution.js +32 -0
- package/dist/schema/callables/function.d.ts +3400 -55
- package/dist/schema/callables/function.js +4 -3
- package/dist/schema/callables/index.d.ts +2 -1
- package/dist/schema/callables/index.js +2 -1
- package/dist/schema/callables/method-of.d.ts +18 -143
- package/dist/schema/callables/method-of.js +2 -2
- package/dist/schema/callables/view.d.ts +83 -51
- package/dist/schema/definitions/class.d.ts +45 -33
- package/dist/schema/definitions/extends.d.ts +16 -110
- package/dist/schema/definitions/instance-of.d.ts +17 -69
- package/dist/schema/domain/domain.d.ts +3343 -148
- package/dist/schema/domain/domain.js +6 -3
- package/dist/schema/domain/of-domain.d.ts +18 -192
- package/dist/schema/domain/of-domain.js +1 -1
- package/dist/schema/identity/composition.d.ts +5 -0
- package/dist/schema/identity/composition.js +5 -0
- package/dist/schema/identity/identity.d.ts +225 -122
- package/dist/schema/identity/identity.js +3 -4
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/installation/operation-id.d.ts +1 -2
- package/dist/schema/installation/operation-id.js +2 -4
- package/dist/schema/introspection/index.d.ts +1 -1
- package/dist/schema/introspection/language.d.ts +12 -28
- package/dist/schema/kernel/projection/callables.js +2 -3
- package/dist/schema/kernel/projection/core.d.ts +7 -0
- package/dist/schema/kernel/projection/core.js +51 -0
- package/dist/schema/kernel/projection/definitions.d.ts +13 -0
- package/dist/schema/kernel/projection/definitions.js +71 -0
- package/dist/schema/kernel/projection/index.d.ts +3 -3
- package/dist/schema/kernel/projection/index.js +2 -2
- package/dist/schema/kernel/projection/methods.d.ts +5 -0
- package/dist/schema/kernel/projection/methods.js +41 -0
- package/dist/schema/kernel/projection/part.d.ts +34 -0
- package/dist/schema/kernel/projection/part.js +42 -0
- package/dist/schema/kernel/projection/paths.d.ts +6 -0
- package/dist/schema/kernel/projection/{keys.js → paths.js} +12 -14
- package/dist/schema/kernel/projection/project.d.ts +4 -2
- package/dist/schema/kernel/projection/project.js +33 -258
- package/dist/schema/kernel/projection/properties.d.ts +11 -0
- package/dist/schema/kernel/projection/properties.js +36 -0
- package/dist/schema/kernel/projection/relations.d.ts +7 -0
- package/dist/schema/kernel/projection/relations.js +61 -0
- package/dist/schema/kernel/projection/types.d.ts +28 -2
- package/dist/schema/kernel/schema.d.ts +8737 -5086
- package/dist/schema/kernel/schema.js +12 -8
- package/dist/schema/kernel/syscalls/contracts/admit.d.ts +15 -12
- package/dist/schema/kernel/syscalls/contracts/admit.js +16 -9
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +31 -0
- package/dist/schema/kernel/syscalls/contracts/blob.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/can.d.ts +19 -8
- package/dist/schema/kernel/syscalls/contracts/can.js +12 -4
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
- package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
- package/dist/schema/kernel/syscalls/contracts/execution.d.ts +60 -0
- package/dist/schema/kernel/syscalls/contracts/execution.js +46 -0
- package/dist/schema/kernel/syscalls/contracts/expected.d.ts +5 -0
- package/dist/schema/kernel/syscalls/contracts/expected.js +9 -0
- package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
- package/dist/schema/kernel/syscalls/contracts/identity.js +6 -7
- package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +6 -0
- package/dist/schema/kernel/syscalls/contracts/impersonate.js +4 -0
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +6 -3
- package/dist/schema/kernel/syscalls/contracts/index.js +6 -3
- package/dist/schema/kernel/syscalls/contracts/install.d.ts +149 -217
- package/dist/schema/kernel/syscalls/contracts/install.js +22 -26
- package/dist/schema/kernel/syscalls/contracts/installation.d.ts +65 -351
- package/dist/schema/kernel/syscalls/contracts/installation.js +29 -67
- package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +11 -15
- package/dist/schema/kernel/syscalls/contracts/introspect.js +8 -15
- package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
- package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
- package/dist/schema/kernel/syscalls/contracts/mint.d.ts +5 -7
- package/dist/schema/kernel/syscalls/contracts/mint.js +4 -5
- package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +243 -224
- package/dist/schema/kernel/syscalls/contracts/mutate.js +7 -1
- package/dist/schema/kernel/syscalls/contracts/query.d.ts +232 -222
- package/dist/schema/kernel/syscalls/contracts/query.js +10 -15
- package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
- package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +54 -148
- package/dist/schema/kernel/syscalls/contracts/uninstall.js +6 -5
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.d.ts +17 -0
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.js +40 -0
- package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +27 -28
- package/dist/schema/kernel/syscalls/contracts/view-resolve.js +16 -24
- package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
- package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
- package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
- package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/admit.d.ts +18 -18
- package/dist/schema/kernel/syscalls/declarations/admit.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/can.d.ts +19 -14
- package/dist/schema/kernel/syscalls/declarations/can.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +9 -12
- package/dist/schema/kernel/syscalls/declarations/delegate.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +12 -0
- package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/execution.d.ts +105 -0
- package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +9 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.js +12 -0
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +870 -1323
- package/dist/schema/kernel/syscalls/declarations/index.js +18 -2
- package/dist/schema/kernel/syscalls/declarations/install.d.ts +29 -172
- package/dist/schema/kernel/syscalls/declarations/install.js +7 -5
- package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +8 -19
- package/dist/schema/kernel/syscalls/declarations/introspect.js +3 -4
- package/dist/schema/kernel/syscalls/declarations/journal.d.ts +29 -31
- package/dist/schema/kernel/syscalls/declarations/journal.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/mint.d.ts +8 -13
- package/dist/schema/kernel/syscalls/declarations/mint.js +5 -5
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +239 -256
- package/dist/schema/kernel/syscalls/declarations/mutate.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/query.d.ts +235 -260
- package/dist/schema/kernel/syscalls/declarations/query.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
- package/dist/schema/kernel/syscalls/declarations/register.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +49 -153
- package/dist/schema/kernel/syscalls/declarations/uninstall.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
- package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
- package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +30 -37
- package/dist/schema/kernel/syscalls/declarations/view-resolve.js +5 -3
- package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +22 -26
- package/dist/schema/kernel/syscalls/declarations/whoami.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/whois.d.ts +25 -29
- package/dist/schema/kernel/syscalls/declarations/whois.js +5 -3
- package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +153 -0
- package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
- package/dist/schema/kernel/syscalls/descriptors/function.d.ts +8 -2
- package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +3 -1
- package/dist/schema/kernel/syscalls/descriptors/functions.js +3 -1
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +47 -13
- package/dist/schema/kernel/syscalls/descriptors/identity.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +5 -2
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +8 -38
- package/dist/schema/kernel/syscalls/descriptors/view.d.ts +11 -9
- package/dist/schema/kernel/syscalls/index.d.ts +2 -2
- package/dist/schema/kernel/syscalls/index.js +2 -2
- package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
- package/dist/schema/kernel/syscalls/references/execution.js +13 -0
- package/dist/schema/kernel/syscalls/references/functions.d.ts +12 -2
- package/dist/schema/kernel/syscalls/references/functions.js +3 -1
- package/dist/schema/kernel/syscalls/references/identity.d.ts +9 -0
- package/dist/schema/kernel/syscalls/references/identity.js +1 -0
- package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/references/index.js +2 -1
- package/dist/schema/meta/created-by.d.ts +32 -0
- package/dist/schema/meta/created-by.js +17 -0
- package/dist/schema/meta/descriptable.d.ts +13 -11
- package/dist/schema/meta/edge.d.ts +5 -9
- package/dist/schema/meta/iconable.d.ts +13 -11
- package/dist/schema/meta/index.d.ts +1 -0
- package/dist/schema/meta/index.js +1 -0
- package/dist/schema/meta/named.d.ts +13 -9
- package/dist/schema/meta/node.d.ts +9 -1
- package/dist/schema/meta/remotable.d.ts +15 -22
- package/dist/schema/meta/statused.d.ts +13 -7
- package/dist/schema/meta/timestamped.d.ts +14 -12
- package/package.json +9 -7
- package/dist/auth/expression/normalization/canonicalize.d.ts +0 -7
- package/dist/auth/expression/normalization/canonicalize.js +0 -102
- package/dist/auth/expression/normalization/index.d.ts +0 -2
- package/dist/auth/expression/normalization/index.js +0 -2
- package/dist/auth/expression/normalization/raise-denials.d.ts +0 -3
- package/dist/auth/expression/normalization/raise-denials.js +0 -59
- package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
- package/dist/auth/provision/fingerprint/fingerprint.js +0 -33
- package/dist/auth/provision/fingerprint/index.d.ts +0 -2
- package/dist/auth/provision/index.d.ts +0 -5
- package/dist/auth/provision/request/admission.d.ts +0 -3
- package/dist/auth/provision/request/admission.js +0 -125
- package/dist/auth/provision/request/index.d.ts +0 -3
- package/dist/auth/provision/request/request.d.ts +0 -29
- package/dist/auth/provision/result/index.d.ts +0 -1
- package/dist/auth/provision/result/result.d.ts +0 -12
- package/dist/graph/graph/navigation/error.d.ts +0 -12
- package/dist/graph/graph/navigation/error.js +0 -20
- package/dist/graph/graph/navigation/index.d.ts +0 -2
- package/dist/graph/graph/navigation/index.js +0 -1
- package/dist/graph/graph/navigation/model.d.ts +0 -15
- package/dist/schema/callables/view-for.d.ts +0 -296
- package/dist/schema/callables/view-for.js +0 -12
- package/dist/schema/kernel/projection/keys.d.ts +0 -3
- package/dist/schema/kernel/projection/path.d.ts +0 -2
- package/dist/schema/kernel/projection/path.js +0 -140
- package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -292
- package/dist/schema/kernel/syscalls/contracts/provision.js +0 -19
- package/dist/schema/kernel/syscalls/declarations/define.d.ts +0 -5
- package/dist/schema/kernel/syscalls/declarations/define.js +0 -7
- package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -296
- package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
- /package/dist/auth/{provision/request/request.js → authority/semantics/snapshot.js} +0 -0
- /package/dist/auth/{provision/result/index.js → authority/semantics/vocabulary.js} +0 -0
- /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
- /package/dist/auth/{provision → register}/index.js +0 -0
- /package/dist/auth/{provision → register}/request/index.js +0 -0
- /package/dist/auth/{provision/result/result.js → register/request/request.js} +0 -0
- /package/dist/{graph/graph/navigation/model.js → auth/register/result/index.js} +0 -0
|
@@ -1,149 +1,159 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
/** Structural JSON contract; decodeQueryAST owns canonical identities and binding dependencies. */
|
|
3
|
-
export declare const queryAstSchema:
|
|
4
|
-
format:
|
|
5
|
-
version:
|
|
6
|
-
source:
|
|
7
|
-
kind:
|
|
8
|
-
terms:
|
|
9
|
-
kind:
|
|
10
|
-
path:
|
|
11
|
-
},
|
|
12
|
-
kind:
|
|
13
|
-
class:
|
|
14
|
-
origin:
|
|
15
|
-
kind:
|
|
16
|
-
name:
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
binding:
|
|
20
|
-
},
|
|
21
|
-
kind:
|
|
22
|
-
terms:
|
|
23
|
-
kind:
|
|
24
|
-
class:
|
|
25
|
-
origin:
|
|
26
|
-
kind:
|
|
27
|
-
name:
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
bindings:
|
|
31
|
-
source:
|
|
32
|
-
edge:
|
|
33
|
-
target:
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
steps:
|
|
37
|
-
op:
|
|
38
|
-
binding:
|
|
39
|
-
predicate:
|
|
40
|
-
kind:
|
|
41
|
-
class:
|
|
42
|
-
origin:
|
|
43
|
-
kind:
|
|
44
|
-
name:
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
kind:
|
|
48
|
-
class:
|
|
49
|
-
origin:
|
|
50
|
-
kind:
|
|
51
|
-
name:
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
kind:
|
|
55
|
-
property:
|
|
56
|
-
value:
|
|
57
|
-
},
|
|
58
|
-
kind:
|
|
59
|
-
property:
|
|
60
|
-
},
|
|
61
|
-
kind:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
2
|
+
export declare const queryAstSchema: import("zod").ZodObject<{
|
|
3
|
+
format: import("zod").ZodLiteral<"astrale.graph.query">;
|
|
4
|
+
version: import("zod").ZodLiteral<"v6">;
|
|
5
|
+
source: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
6
|
+
kind: import("zod").ZodLiteral<"node">;
|
|
7
|
+
terms: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
8
|
+
kind: import("zod").ZodLiteral<"path">;
|
|
9
|
+
path: import("zod").ZodString;
|
|
10
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
11
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
12
|
+
class: import("zod").ZodObject<{
|
|
13
|
+
origin: import("zod").ZodString;
|
|
14
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
15
|
+
name: import("zod").ZodString;
|
|
16
|
+
}, import("zod/v4/core").$strict>;
|
|
17
|
+
}, import("zod/v4/core").$strict>], "kind">>;
|
|
18
|
+
binding: import("zod").ZodString;
|
|
19
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
20
|
+
kind: import("zod").ZodLiteral<"edge">;
|
|
21
|
+
terms: import("zod").ZodArray<import("zod").ZodObject<{
|
|
22
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
23
|
+
class: import("zod").ZodObject<{
|
|
24
|
+
origin: import("zod").ZodString;
|
|
25
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
26
|
+
name: import("zod").ZodString;
|
|
27
|
+
}, import("zod/v4/core").$strict>;
|
|
28
|
+
}, import("zod/v4/core").$strict>>;
|
|
29
|
+
bindings: import("zod").ZodObject<{
|
|
30
|
+
source: import("zod").ZodString;
|
|
31
|
+
edge: import("zod").ZodString;
|
|
32
|
+
target: import("zod").ZodString;
|
|
33
|
+
}, import("zod/v4/core").$strict>;
|
|
34
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
35
|
+
steps: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
36
|
+
op: import("zod").ZodLiteral<"filter">;
|
|
37
|
+
binding: import("zod").ZodString;
|
|
38
|
+
predicate: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
39
|
+
kind: import("zod").ZodLiteral<"class.satisfies">;
|
|
40
|
+
class: import("zod").ZodObject<{
|
|
41
|
+
origin: import("zod").ZodString;
|
|
42
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
43
|
+
name: import("zod").ZodString;
|
|
44
|
+
}, import("zod/v4/core").$strict>;
|
|
45
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
46
|
+
kind: import("zod").ZodLiteral<"class.equal">;
|
|
47
|
+
class: import("zod").ZodObject<{
|
|
48
|
+
origin: import("zod").ZodString;
|
|
49
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
50
|
+
name: import("zod").ZodString;
|
|
51
|
+
}, import("zod/v4/core").$strict>;
|
|
52
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
53
|
+
kind: import("zod").ZodLiteral<"property.equal">;
|
|
54
|
+
property: import("zod").ZodString;
|
|
55
|
+
value: import("zod").ZodUnknown;
|
|
56
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
57
|
+
kind: import("zod").ZodLiteral<"property.present">;
|
|
58
|
+
property: import("zod").ZodString;
|
|
59
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
60
|
+
kind: import("zod").ZodLiteral<"property.range">;
|
|
61
|
+
property: import("zod").ZodString;
|
|
62
|
+
lower: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
63
|
+
value: import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>;
|
|
64
|
+
inclusive: import("zod").ZodBoolean;
|
|
65
|
+
}, import("zod/v4/core").$strict>>;
|
|
66
|
+
upper: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
67
|
+
value: import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>;
|
|
68
|
+
inclusive: import("zod").ZodBoolean;
|
|
69
|
+
}, import("zod/v4/core").$strict>>;
|
|
70
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
71
|
+
kind: import("zod").ZodLiteral<"identity.equal">;
|
|
72
|
+
identity: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
73
|
+
source: import("zod").ZodString;
|
|
74
|
+
target: import("zod").ZodString;
|
|
75
|
+
class: import("zod").ZodString;
|
|
76
|
+
}, import("zod/v4/core").$strict>]>;
|
|
77
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
78
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
79
|
+
op: import("zod").ZodLiteral<"expand">;
|
|
80
|
+
from: import("zod").ZodString;
|
|
81
|
+
via: import("zod").ZodArray<import("zod").ZodObject<{
|
|
82
|
+
origin: import("zod").ZodString;
|
|
83
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
84
|
+
name: import("zod").ZodString;
|
|
85
|
+
}, import("zod/v4/core").$strict>>;
|
|
86
|
+
direction: import("zod").ZodEnum<{
|
|
77
87
|
incident: "incident";
|
|
78
88
|
incoming: "incoming";
|
|
79
89
|
outgoing: "outgoing";
|
|
80
90
|
}>;
|
|
81
|
-
bindings:
|
|
82
|
-
edge:
|
|
83
|
-
node:
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
select:
|
|
87
|
-
kind:
|
|
88
|
-
binding:
|
|
89
|
-
order:
|
|
90
|
-
property:
|
|
91
|
-
direction:
|
|
91
|
+
bindings: import("zod").ZodObject<{
|
|
92
|
+
edge: import("zod").ZodString;
|
|
93
|
+
node: import("zod").ZodString;
|
|
94
|
+
}, import("zod/v4/core").$strict>;
|
|
95
|
+
}, import("zod/v4/core").$strict>], "op">>;
|
|
96
|
+
select: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
97
|
+
kind: import("zod").ZodLiteral<"graph">;
|
|
98
|
+
binding: import("zod").ZodString;
|
|
99
|
+
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
100
|
+
property: import("zod").ZodString;
|
|
101
|
+
direction: import("zod").ZodEnum<{
|
|
92
102
|
asc: "asc";
|
|
93
103
|
desc: "desc";
|
|
94
104
|
}>;
|
|
95
|
-
unranked:
|
|
105
|
+
unranked: import("zod").ZodEnum<{
|
|
96
106
|
first: "first";
|
|
97
107
|
last: "last";
|
|
98
108
|
}>;
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
kind:
|
|
102
|
-
binding:
|
|
103
|
-
projection:
|
|
104
|
-
kind:
|
|
109
|
+
}, import("zod/v4/core").$strict>>;
|
|
110
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
111
|
+
kind: import("zod").ZodLiteral<"nodes">;
|
|
112
|
+
binding: import("zod").ZodString;
|
|
113
|
+
projection: import("zod").ZodObject<{
|
|
114
|
+
kind: import("zod").ZodEnum<{
|
|
105
115
|
reference: "reference";
|
|
106
116
|
value: "value";
|
|
107
117
|
}>;
|
|
108
|
-
},
|
|
109
|
-
order:
|
|
110
|
-
property:
|
|
111
|
-
direction:
|
|
118
|
+
}, import("zod/v4/core").$strict>;
|
|
119
|
+
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
120
|
+
property: import("zod").ZodString;
|
|
121
|
+
direction: import("zod").ZodEnum<{
|
|
112
122
|
asc: "asc";
|
|
113
123
|
desc: "desc";
|
|
114
124
|
}>;
|
|
115
|
-
unranked:
|
|
125
|
+
unranked: import("zod").ZodEnum<{
|
|
116
126
|
first: "first";
|
|
117
127
|
last: "last";
|
|
118
128
|
}>;
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
kind:
|
|
122
|
-
binding:
|
|
123
|
-
projection:
|
|
124
|
-
edge:
|
|
129
|
+
}, import("zod/v4/core").$strict>>;
|
|
130
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
131
|
+
kind: import("zod").ZodLiteral<"edges">;
|
|
132
|
+
binding: import("zod").ZodString;
|
|
133
|
+
projection: import("zod").ZodObject<{
|
|
134
|
+
edge: import("zod").ZodEnum<{
|
|
125
135
|
reference: "reference";
|
|
126
136
|
value: "value";
|
|
127
137
|
}>;
|
|
128
|
-
source:
|
|
138
|
+
source: import("zod").ZodEnum<{
|
|
129
139
|
reference: "reference";
|
|
130
140
|
value: "value";
|
|
131
141
|
}>;
|
|
132
|
-
target:
|
|
142
|
+
target: import("zod").ZodEnum<{
|
|
133
143
|
reference: "reference";
|
|
134
144
|
value: "value";
|
|
135
145
|
}>;
|
|
136
|
-
},
|
|
137
|
-
order:
|
|
138
|
-
property:
|
|
139
|
-
direction:
|
|
146
|
+
}, import("zod/v4/core").$strict>;
|
|
147
|
+
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
148
|
+
property: import("zod").ZodString;
|
|
149
|
+
direction: import("zod").ZodEnum<{
|
|
140
150
|
asc: "asc";
|
|
141
151
|
desc: "desc";
|
|
142
152
|
}>;
|
|
143
|
-
unranked:
|
|
153
|
+
unranked: import("zod").ZodEnum<{
|
|
144
154
|
first: "first";
|
|
145
155
|
last: "last";
|
|
146
156
|
}>;
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
},
|
|
157
|
+
}, import("zod/v4/core").$strict>>;
|
|
158
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
159
|
+
}, import("zod/v4/core").$strict>;
|
|
@@ -1,68 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { array, boolean, discriminatedUnion, enum as enumeration, literal, number, strictObject, string, union, unknown as unknownSchema, } from 'zod';
|
|
2
2
|
import { QUERY_AST_FORMAT, QUERY_AST_LIMITS, QUERY_AST_VERSION } from './model.js';
|
|
3
|
-
const text =
|
|
3
|
+
const text = string().min(1);
|
|
4
4
|
const binding = text.max(64);
|
|
5
|
-
const classRef =
|
|
5
|
+
const classRef = strictObject({
|
|
6
6
|
origin: text.max(253),
|
|
7
|
-
kind:
|
|
7
|
+
kind: literal('class'),
|
|
8
8
|
name: text,
|
|
9
9
|
});
|
|
10
|
-
const nodeSourceTerm =
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const nodeSourceTerm = discriminatedUnion('kind', [
|
|
11
|
+
strictObject({ kind: literal('path'), path: text }),
|
|
12
|
+
strictObject({ kind: literal('class'), class: classRef }),
|
|
13
13
|
]);
|
|
14
|
-
const classSourceTerm =
|
|
15
|
-
const source =
|
|
16
|
-
|
|
17
|
-
kind:
|
|
18
|
-
terms:
|
|
14
|
+
const classSourceTerm = strictObject({ kind: literal('class'), class: classRef });
|
|
15
|
+
const source = discriminatedUnion('kind', [
|
|
16
|
+
strictObject({
|
|
17
|
+
kind: literal('node'),
|
|
18
|
+
terms: array(nodeSourceTerm).min(1).max(QUERY_AST_LIMITS.sourceTerms),
|
|
19
19
|
binding,
|
|
20
20
|
}),
|
|
21
|
-
|
|
22
|
-
kind:
|
|
23
|
-
terms:
|
|
24
|
-
bindings:
|
|
21
|
+
strictObject({
|
|
22
|
+
kind: literal('edge'),
|
|
23
|
+
terms: array(classSourceTerm).min(1).max(QUERY_AST_LIMITS.sourceTerms),
|
|
24
|
+
bindings: strictObject({ source: binding, edge: binding, target: binding }),
|
|
25
25
|
}),
|
|
26
26
|
]);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
const rangeBound = strictObject({ value: union([number(), string()]), inclusive: boolean() });
|
|
28
|
+
const predicate = discriminatedUnion('kind', [
|
|
29
|
+
strictObject({ kind: literal('class.satisfies'), class: classRef }),
|
|
30
|
+
strictObject({ kind: literal('class.equal'), class: classRef }),
|
|
31
|
+
strictObject({ kind: literal('property.equal'), property: text, value: unknownSchema() }),
|
|
32
|
+
strictObject({ kind: literal('property.present'), property: text }),
|
|
33
|
+
strictObject({
|
|
34
|
+
kind: literal('property.range'),
|
|
35
|
+
property: text,
|
|
36
|
+
lower: rangeBound.optional(),
|
|
37
|
+
upper: rangeBound.optional(),
|
|
38
|
+
}),
|
|
39
|
+
strictObject({
|
|
40
|
+
kind: literal('identity.equal'),
|
|
41
|
+
identity: union([text, strictObject({ source: text, target: text, class: text })]),
|
|
35
42
|
}),
|
|
36
43
|
]);
|
|
37
|
-
const filter =
|
|
38
|
-
const expand =
|
|
39
|
-
op:
|
|
44
|
+
const filter = strictObject({ op: literal('filter'), binding, predicate });
|
|
45
|
+
const expand = strictObject({
|
|
46
|
+
op: literal('expand'),
|
|
40
47
|
from: binding,
|
|
41
|
-
via:
|
|
42
|
-
direction:
|
|
43
|
-
bindings:
|
|
48
|
+
via: array(classRef).min(1).max(QUERY_AST_LIMITS.expansionClassesPerStep),
|
|
49
|
+
direction: enumeration(['outgoing', 'incoming', 'incident']),
|
|
50
|
+
bindings: strictObject({ edge: binding, node: binding }),
|
|
44
51
|
});
|
|
45
|
-
const propertyOrder =
|
|
52
|
+
const propertyOrder = strictObject({
|
|
46
53
|
property: text,
|
|
47
|
-
direction:
|
|
48
|
-
unranked:
|
|
54
|
+
direction: enumeration(['asc', 'desc']),
|
|
55
|
+
unranked: enumeration(['first', 'last']),
|
|
49
56
|
});
|
|
50
|
-
const projectionShape =
|
|
51
|
-
const graphSelect =
|
|
52
|
-
kind:
|
|
57
|
+
const projectionShape = enumeration(['reference', 'value']);
|
|
58
|
+
const graphSelect = strictObject({
|
|
59
|
+
kind: literal('graph'),
|
|
53
60
|
binding,
|
|
54
61
|
order: propertyOrder.optional(),
|
|
55
62
|
});
|
|
56
|
-
const nodeSelect =
|
|
57
|
-
kind:
|
|
63
|
+
const nodeSelect = strictObject({
|
|
64
|
+
kind: literal('nodes'),
|
|
58
65
|
binding,
|
|
59
|
-
projection:
|
|
66
|
+
projection: strictObject({ kind: projectionShape }),
|
|
60
67
|
order: propertyOrder.optional(),
|
|
61
68
|
});
|
|
62
|
-
const edgeSelect =
|
|
63
|
-
kind:
|
|
69
|
+
const edgeSelect = strictObject({
|
|
70
|
+
kind: literal('edges'),
|
|
64
71
|
binding,
|
|
65
|
-
projection:
|
|
72
|
+
projection: strictObject({
|
|
66
73
|
edge: projectionShape,
|
|
67
74
|
source: projectionShape,
|
|
68
75
|
target: projectionShape,
|
|
@@ -70,10 +77,10 @@ const edgeSelect = z.strictObject({
|
|
|
70
77
|
order: propertyOrder.optional(),
|
|
71
78
|
});
|
|
72
79
|
/** Structural JSON contract; decodeQueryAST owns canonical identities and binding dependencies. */
|
|
73
|
-
export const queryAstSchema =
|
|
74
|
-
format:
|
|
75
|
-
version:
|
|
80
|
+
export const queryAstSchema = strictObject({
|
|
81
|
+
format: literal(QUERY_AST_FORMAT),
|
|
82
|
+
version: literal(QUERY_AST_VERSION),
|
|
76
83
|
source,
|
|
77
|
-
steps:
|
|
78
|
-
select:
|
|
84
|
+
steps: array(discriminatedUnion('op', [filter, expand])).max(QUERY_AST_LIMITS.steps),
|
|
85
|
+
select: discriminatedUnion('kind', [graphSelect, nodeSelect, edgeSelect]),
|
|
79
86
|
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { OrderingKind } from '@astrale-os/kernel-dsl/v1/language';
|
|
2
|
+
import type * as portable from '@astrale-os/kernel-dsl/value';
|
|
3
|
+
import type { EdgeKey } from '../../edge/index.js';
|
|
4
|
+
import type { NodeId } from '../../node/index.js';
|
|
5
|
+
import type { QueryOrderDirection, QueryPropertyRangePredicate, QueryUnrankedPlacement } from '../language/index.js';
|
|
6
|
+
/** The identity of one selected fact: a Node's NodeId or an Edge's complete EdgeKey. */
|
|
7
|
+
export type QueryRankIdentity = NodeId | EdgeKey;
|
|
8
|
+
/** A scalar ordering value of one proven kind; an instant is its canonical text. */
|
|
9
|
+
export type QueryRankValue = boolean | number | string;
|
|
10
|
+
/** One selected fact's position: its bucket, its ordering value when ranked, and its identity. */
|
|
11
|
+
export type QueryRank<Identity extends QueryRankIdentity = QueryRankIdentity> = {
|
|
12
|
+
readonly bucket: 'identity';
|
|
13
|
+
readonly identity: Identity;
|
|
14
|
+
} | {
|
|
15
|
+
readonly bucket: 'ranked';
|
|
16
|
+
readonly value: QueryRankValue;
|
|
17
|
+
readonly identity: Identity;
|
|
18
|
+
} | {
|
|
19
|
+
readonly bucket: 'unranked';
|
|
20
|
+
readonly identity: Identity;
|
|
21
|
+
};
|
|
22
|
+
/** The ordering of one Property order: its proven value kind, direction and unranked placement. */
|
|
23
|
+
export interface QueryRankOrder {
|
|
24
|
+
readonly kind: OrderingKind;
|
|
25
|
+
readonly direction: QueryOrderDirection;
|
|
26
|
+
readonly unranked: QueryUnrankedPlacement;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The one observable Query order. Without a Property order, facts follow identity order. With one,
|
|
30
|
+
* unranked facts sit first or last regardless of direction, ranked values compare by their kind in
|
|
31
|
+
* the requested direction, and identity breaks every tie: NodeId byte order, or EdgeKey order by
|
|
32
|
+
* source, target and ClassKey.
|
|
33
|
+
*/
|
|
34
|
+
export declare function compareQueryRank(left: QueryRank, right: QueryRank, order: QueryRankOrder | undefined): number;
|
|
35
|
+
/**
|
|
36
|
+
* Compare two ordering values of one kind: false before true, numeric order, and code-point order
|
|
37
|
+
* for strings and instants.
|
|
38
|
+
*/
|
|
39
|
+
export declare function compareQueryValue(left: QueryRankValue, right: QueryRankValue, kind: OrderingKind): number;
|
|
40
|
+
/**
|
|
41
|
+
* Unicode code-point order, which equals the byte order of the UTF-8 encodings. UTF-16 unit order
|
|
42
|
+
* differs from it only where a surrogate meets a unit at or above U+E000; the fixup reorders
|
|
43
|
+
* exactly that range.
|
|
44
|
+
*/
|
|
45
|
+
export declare function compareQueryText(left: string, right: string): number;
|
|
46
|
+
/**
|
|
47
|
+
* Whether one stored value lies in a Property range: it has the kind of the bounds, a number in
|
|
48
|
+
* numeric order or a text in code-point order, and every present bound holds. A value of any other
|
|
49
|
+
* kind, an absent value included, is never in the range; this is never an error.
|
|
50
|
+
*/
|
|
51
|
+
export declare function queryRangeContains(range: Pick<QueryPropertyRangePredicate, 'lower' | 'upper'>, value: portable.Value | undefined): boolean;
|
|
52
|
+
/** Identity order: NodeId byte order, or EdgeKey (source, target, ClassKey) tuple order. */
|
|
53
|
+
export declare function compareQueryIdentity(left: QueryRankIdentity, right: QueryRankIdentity): number;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { compareEdgeKeys } from '../../edge/index.js';
|
|
2
|
+
import { compareNodeIds } from '../../node/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The one observable Query order. Without a Property order, facts follow identity order. With one,
|
|
5
|
+
* unranked facts sit first or last regardless of direction, ranked values compare by their kind in
|
|
6
|
+
* the requested direction, and identity breaks every tie: NodeId byte order, or EdgeKey order by
|
|
7
|
+
* source, target and ClassKey.
|
|
8
|
+
*/
|
|
9
|
+
export function compareQueryRank(left, right, order) {
|
|
10
|
+
if (order !== undefined && left.bucket !== right.bucket) {
|
|
11
|
+
const first = order.unranked === 'first' ? 'unranked' : 'ranked';
|
|
12
|
+
return left.bucket === first ? -1 : 1;
|
|
13
|
+
}
|
|
14
|
+
if (order !== undefined && left.bucket === 'ranked' && right.bucket === 'ranked') {
|
|
15
|
+
const compared = compareQueryValue(left.value, right.value, order.kind);
|
|
16
|
+
if (compared !== 0)
|
|
17
|
+
return order.direction === 'asc' ? compared : -compared;
|
|
18
|
+
}
|
|
19
|
+
return compareQueryIdentity(left.identity, right.identity);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Compare two ordering values of one kind: false before true, numeric order, and code-point order
|
|
23
|
+
* for strings and instants.
|
|
24
|
+
*/
|
|
25
|
+
export function compareQueryValue(left, right, kind) {
|
|
26
|
+
if (kind === 'boolean')
|
|
27
|
+
return Number(left) - Number(right);
|
|
28
|
+
if (kind === 'number')
|
|
29
|
+
return Math.sign(left - right);
|
|
30
|
+
return compareQueryText(left, right);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Unicode code-point order, which equals the byte order of the UTF-8 encodings. UTF-16 unit order
|
|
34
|
+
* differs from it only where a surrogate meets a unit at or above U+E000; the fixup reorders
|
|
35
|
+
* exactly that range.
|
|
36
|
+
*/
|
|
37
|
+
export function compareQueryText(left, right) {
|
|
38
|
+
const length = Math.min(left.length, right.length);
|
|
39
|
+
for (let index = 0; index < length; index++) {
|
|
40
|
+
let a = left.charCodeAt(index);
|
|
41
|
+
let b = right.charCodeAt(index);
|
|
42
|
+
if (a === b)
|
|
43
|
+
continue;
|
|
44
|
+
if (a >= 0xd800 && b >= 0xd800) {
|
|
45
|
+
a += a >= 0xe000 ? -0x800 : 0x2000;
|
|
46
|
+
b += b >= 0xe000 ? -0x800 : 0x2000;
|
|
47
|
+
}
|
|
48
|
+
return a < b ? -1 : 1;
|
|
49
|
+
}
|
|
50
|
+
return Math.sign(left.length - right.length);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether one stored value lies in a Property range: it has the kind of the bounds, a number in
|
|
54
|
+
* numeric order or a text in code-point order, and every present bound holds. A value of any other
|
|
55
|
+
* kind, an absent value included, is never in the range; this is never an error.
|
|
56
|
+
*/
|
|
57
|
+
export function queryRangeContains(range, value) {
|
|
58
|
+
const kind = (range.lower ?? range.upper)?.value;
|
|
59
|
+
if (typeof value !== typeof kind || (typeof value !== 'number' && typeof value !== 'string')) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const holds = (bound, sign) => {
|
|
63
|
+
if (bound === undefined)
|
|
64
|
+
return true;
|
|
65
|
+
const compared = typeof value === 'number'
|
|
66
|
+
? Math.sign(value - bound.value)
|
|
67
|
+
: compareQueryText(value, bound.value);
|
|
68
|
+
return compared === 0 ? bound.inclusive : compared === sign;
|
|
69
|
+
};
|
|
70
|
+
return holds(range.lower, 1) && holds(range.upper, -1);
|
|
71
|
+
}
|
|
72
|
+
/** Identity order: NodeId byte order, or EdgeKey (source, target, ClassKey) tuple order. */
|
|
73
|
+
export function compareQueryIdentity(left, right) {
|
|
74
|
+
if (typeof left === 'string' && typeof right === 'string')
|
|
75
|
+
return compareNodeIds(left, right);
|
|
76
|
+
if (typeof left !== 'string' && typeof right !== 'string')
|
|
77
|
+
return compareEdgeKeys(left, right);
|
|
78
|
+
throw new TypeError('Query rank identities of different kinds are not comparable.');
|
|
79
|
+
}
|
|
@@ -29,6 +29,7 @@ export interface QueryReferenceContext {
|
|
|
29
29
|
closeClass(classRef: ClassRef): QueryReferenceClassClosure | undefined;
|
|
30
30
|
closeProperty(property: PropertyKeyValue): QueryReferenceProperty | undefined;
|
|
31
31
|
orientation(edge: ClassKey): EdgeOrientation | undefined;
|
|
32
|
+
admitEdge(edge: Edge, source: Node, target: Node): boolean;
|
|
32
33
|
traverseNode(node: Node): boolean;
|
|
33
34
|
traverseEdge(edge: Edge): boolean;
|
|
34
35
|
readNode(node: Node): boolean;
|