@diffra-ai/chord 0.0.0-stage → 0.2.3
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/CHANGELOG.md +237 -0
- package/README.md +227 -2
- package/dist/context/index.d.ts +43 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +112 -0
- package/dist/context/index.js.map +1 -0
- package/dist/contracts/accepts.d.ts +91 -0
- package/dist/contracts/accepts.d.ts.map +1 -0
- package/dist/contracts/accepts.js +145 -0
- package/dist/contracts/accepts.js.map +1 -0
- package/dist/contracts/contract.d.ts +238 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js +69 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/declare.d.ts +144 -0
- package/dist/contracts/declare.d.ts.map +1 -0
- package/dist/contracts/declare.js +207 -0
- package/dist/contracts/declare.js.map +1 -0
- package/dist/contracts/evolve.d.ts +142 -0
- package/dist/contracts/evolve.d.ts.map +1 -0
- package/dist/contracts/evolve.js +216 -0
- package/dist/contracts/evolve.js.map +1 -0
- package/dist/contracts/fingerprint.d.ts +16 -0
- package/dist/contracts/fingerprint.d.ts.map +1 -0
- package/dist/contracts/fingerprint.js +61 -0
- package/dist/contracts/fingerprint.js.map +1 -0
- package/dist/contracts/history.d.ts +79 -0
- package/dist/contracts/history.d.ts.map +1 -0
- package/dist/contracts/history.js +3 -0
- package/dist/contracts/history.js.map +1 -0
- package/dist/contracts/host-kind.d.ts +58 -0
- package/dist/contracts/host-kind.d.ts.map +1 -0
- package/dist/contracts/host-kind.js +122 -0
- package/dist/contracts/host-kind.js.map +1 -0
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +7 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/internal.d.ts +12 -0
- package/dist/contracts/internal.d.ts.map +1 -0
- package/dist/contracts/internal.js +11 -0
- package/dist/contracts/internal.js.map +1 -0
- package/dist/contracts/names.d.ts +3 -0
- package/dist/contracts/names.d.ts.map +1 -0
- package/dist/contracts/names.js +13 -0
- package/dist/contracts/names.js.map +1 -0
- package/dist/contracts/params.d.ts +28 -0
- package/dist/contracts/params.d.ts.map +1 -0
- package/dist/contracts/params.js +55 -0
- package/dist/contracts/params.js.map +1 -0
- package/dist/contracts/schema.d.ts +144 -0
- package/dist/contracts/schema.d.ts.map +1 -0
- package/dist/contracts/schema.js +144 -0
- package/dist/contracts/schema.js.map +1 -0
- package/dist/contracts/snapshot.d.ts +16 -0
- package/dist/contracts/snapshot.d.ts.map +1 -0
- package/dist/contracts/snapshot.js +167 -0
- package/dist/contracts/snapshot.js.map +1 -0
- package/dist/data/args.d.ts +50 -0
- package/dist/data/args.d.ts.map +1 -0
- package/dist/data/args.js +83 -0
- package/dist/data/args.js.map +1 -0
- package/dist/data/errors.d.ts +80 -0
- package/dist/data/errors.d.ts.map +1 -0
- package/dist/data/errors.js +116 -0
- package/dist/data/errors.js.map +1 -0
- package/dist/data/failure.d.ts +31 -0
- package/dist/data/failure.d.ts.map +1 -0
- package/dist/data/failure.js +78 -0
- package/dist/data/failure.js.map +1 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +5 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/internal.d.ts +7 -0
- package/dist/data/internal.d.ts.map +1 -0
- package/dist/data/internal.js +8 -0
- package/dist/data/internal.js.map +1 -0
- package/dist/data/params.d.ts +20 -0
- package/dist/data/params.d.ts.map +1 -0
- package/dist/data/params.js +31 -0
- package/dist/data/params.js.map +1 -0
- package/dist/data/principal.d.ts +28 -0
- package/dist/data/principal.d.ts.map +1 -0
- package/dist/data/principal.js +64 -0
- package/dist/data/principal.js.map +1 -0
- package/dist/data/validator.d.ts +12 -0
- package/dist/data/validator.d.ts.map +1 -0
- package/dist/data/validator.js +35 -0
- package/dist/data/validator.js.map +1 -0
- package/dist/delta/apply-immutable-trusted.d.ts +4 -0
- package/dist/delta/apply-immutable-trusted.d.ts.map +1 -0
- package/dist/delta/apply-immutable-trusted.js +126 -0
- package/dist/delta/apply-immutable-trusted.js.map +1 -0
- package/dist/delta/diff.d.ts +5 -0
- package/dist/delta/diff.d.ts.map +1 -0
- package/dist/delta/diff.js +435 -0
- package/dist/delta/diff.js.map +1 -0
- package/dist/delta/draft.d.ts +5 -0
- package/dist/delta/draft.d.ts.map +1 -0
- package/dist/delta/draft.js +2 -0
- package/dist/delta/draft.js.map +1 -0
- package/dist/delta/index.d.ts +120 -0
- package/dist/delta/index.d.ts.map +1 -0
- package/dist/delta/index.js +697 -0
- package/dist/delta/index.js.map +1 -0
- package/dist/delta/pending.d.ts +36 -0
- package/dist/delta/pending.d.ts.map +1 -0
- package/dist/delta/pending.js +143 -0
- package/dist/delta/pending.js.map +1 -0
- package/dist/delta/revision-validator.d.ts +7 -0
- package/dist/delta/revision-validator.d.ts.map +1 -0
- package/dist/delta/revision-validator.js +71 -0
- package/dist/delta/revision-validator.js.map +1 -0
- package/dist/delta/tracker.d.ts +38 -0
- package/dist/delta/tracker.d.ts.map +1 -0
- package/dist/delta/tracker.js +2175 -0
- package/dist/delta/tracker.js.map +1 -0
- package/dist/documents/address-source.d.ts +20 -0
- package/dist/documents/address-source.d.ts.map +1 -0
- package/dist/documents/address-source.js +44 -0
- package/dist/documents/address-source.js.map +1 -0
- package/dist/documents/definition.d.ts +92 -0
- package/dist/documents/definition.d.ts.map +1 -0
- package/dist/documents/definition.js +81 -0
- package/dist/documents/definition.js.map +1 -0
- package/dist/documents/documents.d.ts +129 -0
- package/dist/documents/documents.d.ts.map +1 -0
- package/dist/documents/documents.js +258 -0
- package/dist/documents/documents.js.map +1 -0
- package/dist/documents/fence.d.ts +9 -0
- package/dist/documents/fence.d.ts.map +1 -0
- package/dist/documents/fence.js +15 -0
- package/dist/documents/fence.js.map +1 -0
- package/dist/documents/handles.d.ts +81 -0
- package/dist/documents/handles.d.ts.map +1 -0
- package/dist/documents/handles.js +74 -0
- package/dist/documents/handles.js.map +1 -0
- package/dist/documents/index.d.ts +4 -0
- package/dist/documents/index.d.ts.map +1 -0
- package/dist/documents/index.js +3 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/internal.d.ts +9 -0
- package/dist/documents/internal.d.ts.map +1 -0
- package/dist/documents/internal.js +9 -0
- package/dist/documents/internal.js.map +1 -0
- package/dist/documents/keyed-slot.d.ts +139 -0
- package/dist/documents/keyed-slot.d.ts.map +1 -0
- package/dist/documents/keyed-slot.js +478 -0
- package/dist/documents/keyed-slot.js.map +1 -0
- package/dist/documents/line.d.ts +7 -0
- package/dist/documents/line.d.ts.map +1 -0
- package/dist/documents/line.js +14 -0
- package/dist/documents/line.js.map +1 -0
- package/dist/documents/persistence.d.ts +120 -0
- package/dist/documents/persistence.d.ts.map +1 -0
- package/dist/documents/persistence.js +156 -0
- package/dist/documents/persistence.js.map +1 -0
- package/dist/documents/residency.d.ts +31 -0
- package/dist/documents/residency.d.ts.map +1 -0
- package/dist/documents/residency.js +93 -0
- package/dist/documents/residency.js.map +1 -0
- package/dist/documents/slot.d.ts +112 -0
- package/dist/documents/slot.d.ts.map +1 -0
- package/dist/documents/slot.js +190 -0
- package/dist/documents/slot.js.map +1 -0
- package/dist/documents/transaction.d.ts +143 -0
- package/dist/documents/transaction.d.ts.map +1 -0
- package/dist/documents/transaction.js +445 -0
- package/dist/documents/transaction.js.map +1 -0
- package/dist/host/activity.d.ts +31 -0
- package/dist/host/activity.d.ts.map +1 -0
- package/dist/host/activity.js +40 -0
- package/dist/host/activity.js.map +1 -0
- package/dist/host/adapted.d.ts +63 -0
- package/dist/host/adapted.d.ts.map +1 -0
- package/dist/host/adapted.js +298 -0
- package/dist/host/adapted.js.map +1 -0
- package/dist/host/admission.d.ts +137 -0
- package/dist/host/admission.d.ts.map +1 -0
- package/dist/host/admission.js +290 -0
- package/dist/host/admission.js.map +1 -0
- package/dist/host/attempt.d.ts +417 -0
- package/dist/host/attempt.d.ts.map +1 -0
- package/dist/host/attempt.js +1490 -0
- package/dist/host/attempt.js.map +1 -0
- package/dist/host/backoff.d.ts +29 -0
- package/dist/host/backoff.d.ts.map +1 -0
- package/dist/host/backoff.js +69 -0
- package/dist/host/backoff.js.map +1 -0
- package/dist/host/ctx.d.ts +94 -0
- package/dist/host/ctx.d.ts.map +1 -0
- package/dist/host/ctx.js +200 -0
- package/dist/host/ctx.js.map +1 -0
- package/dist/host/deadline.d.ts +12 -0
- package/dist/host/deadline.d.ts.map +1 -0
- package/dist/host/deadline.js +40 -0
- package/dist/host/deadline.js.map +1 -0
- package/dist/host/dependencies.d.ts +97 -0
- package/dist/host/dependencies.d.ts.map +1 -0
- package/dist/host/dependencies.js +148 -0
- package/dist/host/dependencies.js.map +1 -0
- package/dist/host/destination.d.ts +48 -0
- package/dist/host/destination.d.ts.map +1 -0
- package/dist/host/destination.js +101 -0
- package/dist/host/destination.js.map +1 -0
- package/dist/host/events.d.ts +114 -0
- package/dist/host/events.d.ts.map +1 -0
- package/dist/host/events.js +191 -0
- package/dist/host/events.js.map +1 -0
- package/dist/host/facet.d.ts +106 -0
- package/dist/host/facet.d.ts.map +1 -0
- package/dist/host/facet.js +55 -0
- package/dist/host/facet.js.map +1 -0
- package/dist/host/follow.d.ts +52 -0
- package/dist/host/follow.d.ts.map +1 -0
- package/dist/host/follow.js +207 -0
- package/dist/host/follow.js.map +1 -0
- package/dist/host/host-data.d.ts +62 -0
- package/dist/host/host-data.d.ts.map +1 -0
- package/dist/host/host-data.js +229 -0
- package/dist/host/host-data.js.map +1 -0
- package/dist/host/host.d.ts +641 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.js +1449 -0
- package/dist/host/host.js.map +1 -0
- package/dist/host/index.d.ts +20 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +7 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/internal.d.ts +13 -0
- package/dist/host/internal.d.ts.map +1 -0
- package/dist/host/internal.js +11 -0
- package/dist/host/internal.js.map +1 -0
- package/dist/host/list.d.ts +52 -0
- package/dist/host/list.d.ts.map +1 -0
- package/dist/host/list.js +149 -0
- package/dist/host/list.js.map +1 -0
- package/dist/host/members.d.ts +58 -0
- package/dist/host/members.d.ts.map +1 -0
- package/dist/host/members.js +178 -0
- package/dist/host/members.js.map +1 -0
- package/dist/host/named-query.d.ts +67 -0
- package/dist/host/named-query.d.ts.map +1 -0
- package/dist/host/named-query.js +166 -0
- package/dist/host/named-query.js.map +1 -0
- package/dist/host/native.d.ts +64 -0
- package/dist/host/native.d.ts.map +1 -0
- package/dist/host/native.js +126 -0
- package/dist/host/native.js.map +1 -0
- package/dist/host/object.d.ts +388 -0
- package/dist/host/object.d.ts.map +1 -0
- package/dist/host/object.js +1527 -0
- package/dist/host/object.js.map +1 -0
- package/dist/host/old-work.d.ts +34 -0
- package/dist/host/old-work.d.ts.map +1 -0
- package/dist/host/old-work.js +52 -0
- package/dist/host/old-work.js.map +1 -0
- package/dist/host/parked.d.ts +23 -0
- package/dist/host/parked.d.ts.map +1 -0
- package/dist/host/parked.js +79 -0
- package/dist/host/parked.js.map +1 -0
- package/dist/host/presence.d.ts +34 -0
- package/dist/host/presence.d.ts.map +1 -0
- package/dist/host/presence.js +117 -0
- package/dist/host/presence.js.map +1 -0
- package/dist/host/query-reader.d.ts +80 -0
- package/dist/host/query-reader.d.ts.map +1 -0
- package/dist/host/query-reader.js +182 -0
- package/dist/host/query-reader.js.map +1 -0
- package/dist/host/read-declarations.d.ts +75 -0
- package/dist/host/read-declarations.d.ts.map +1 -0
- package/dist/host/read-declarations.js +152 -0
- package/dist/host/read-declarations.js.map +1 -0
- package/dist/host/readiness.d.ts +27 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.js +134 -0
- package/dist/host/readiness.js.map +1 -0
- package/dist/host/ref-state.d.ts +53 -0
- package/dist/host/ref-state.d.ts.map +1 -0
- package/dist/host/ref-state.js +83 -0
- package/dist/host/ref-state.js.map +1 -0
- package/dist/host/reference-events.d.ts +51 -0
- package/dist/host/reference-events.d.ts.map +1 -0
- package/dist/host/reference-events.js +133 -0
- package/dist/host/reference-events.js.map +1 -0
- package/dist/host/reference-keys.d.ts +36 -0
- package/dist/host/reference-keys.d.ts.map +1 -0
- package/dist/host/reference-keys.js +168 -0
- package/dist/host/reference-keys.js.map +1 -0
- package/dist/host/reference-source.d.ts +77 -0
- package/dist/host/reference-source.d.ts.map +1 -0
- package/dist/host/reference-source.js +326 -0
- package/dist/host/reference-source.js.map +1 -0
- package/dist/host/reference.d.ts +377 -0
- package/dist/host/reference.d.ts.map +1 -0
- package/dist/host/reference.js +986 -0
- package/dist/host/reference.js.map +1 -0
- package/dist/host/reload-cycle.d.ts +16 -0
- package/dist/host/reload-cycle.d.ts.map +1 -0
- package/dist/host/reload-cycle.js +81 -0
- package/dist/host/reload-cycle.js.map +1 -0
- package/dist/host/retry-on.d.ts +28 -0
- package/dist/host/retry-on.d.ts.map +1 -0
- package/dist/host/retry-on.js +52 -0
- package/dist/host/retry-on.js.map +1 -0
- package/dist/host/revocation.d.ts +16 -0
- package/dist/host/revocation.d.ts.map +1 -0
- package/dist/host/revocation.js +27 -0
- package/dist/host/revocation.js.map +1 -0
- package/dist/host/root.d.ts +37 -0
- package/dist/host/root.d.ts.map +1 -0
- package/dist/host/root.js +68 -0
- package/dist/host/root.js.map +1 -0
- package/dist/host/route-admission.d.ts +24 -0
- package/dist/host/route-admission.d.ts.map +1 -0
- package/dist/host/route-admission.js +238 -0
- package/dist/host/route-admission.js.map +1 -0
- package/dist/host/route.d.ts +88 -0
- package/dist/host/route.d.ts.map +1 -0
- package/dist/host/route.js +247 -0
- package/dist/host/route.js.map +1 -0
- package/dist/host/routines.d.ts +78 -0
- package/dist/host/routines.d.ts.map +1 -0
- package/dist/host/routines.js +398 -0
- package/dist/host/routines.js.map +1 -0
- package/dist/host/sleep.d.ts +9 -0
- package/dist/host/sleep.d.ts.map +1 -0
- package/dist/host/sleep.js +40 -0
- package/dist/host/sleep.js.map +1 -0
- package/dist/host/staging.d.ts +100 -0
- package/dist/host/staging.d.ts.map +1 -0
- package/dist/host/staging.js +413 -0
- package/dist/host/staging.js.map +1 -0
- package/dist/host/tiling.d.ts +57 -0
- package/dist/host/tiling.d.ts.map +1 -0
- package/dist/host/tiling.js +269 -0
- package/dist/host/tiling.js.map +1 -0
- package/dist/host/unbound-clock.d.ts +23 -0
- package/dist/host/unbound-clock.d.ts.map +1 -0
- package/dist/host/unbound-clock.js +58 -0
- package/dist/host/unbound-clock.js.map +1 -0
- package/dist/host/unbound.d.ts +37 -0
- package/dist/host/unbound.d.ts.map +1 -0
- package/dist/host/unbound.js +88 -0
- package/dist/host/unbound.js.map +1 -0
- package/dist/host/uuid.d.ts +3 -0
- package/dist/host/uuid.d.ts.map +1 -0
- package/dist/host/uuid.js +38 -0
- package/dist/host/uuid.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/definition.d.ts +96 -0
- package/dist/jobs/definition.d.ts.map +1 -0
- package/dist/jobs/definition.js +83 -0
- package/dist/jobs/definition.js.map +1 -0
- package/dist/jobs/index.d.ts +5 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +3 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/internal.d.ts +3 -0
- package/dist/jobs/internal.d.ts.map +1 -0
- package/dist/jobs/internal.js +4 -0
- package/dist/jobs/internal.js.map +1 -0
- package/dist/jobs/job.d.ts +149 -0
- package/dist/jobs/job.d.ts.map +1 -0
- package/dist/jobs/job.js +387 -0
- package/dist/jobs/job.js.map +1 -0
- package/dist/jobs/persisted.d.ts +38 -0
- package/dist/jobs/persisted.d.ts.map +1 -0
- package/dist/jobs/persisted.js +95 -0
- package/dist/jobs/persisted.js.map +1 -0
- package/dist/jobs/records.d.ts +231 -0
- package/dist/jobs/records.d.ts.map +1 -0
- package/dist/jobs/records.js +871 -0
- package/dist/jobs/records.js.map +1 -0
- package/dist/jobs/run-states.d.ts +69 -0
- package/dist/jobs/run-states.d.ts.map +1 -0
- package/dist/jobs/run-states.js +228 -0
- package/dist/jobs/run-states.js.map +1 -0
- package/dist/jobs/run.d.ts +117 -0
- package/dist/jobs/run.d.ts.map +1 -0
- package/dist/jobs/run.js +204 -0
- package/dist/jobs/run.js.map +1 -0
- package/dist/jobs/running.d.ts +44 -0
- package/dist/jobs/running.d.ts.map +1 -0
- package/dist/jobs/running.js +117 -0
- package/dist/jobs/running.js.map +1 -0
- package/dist/jobs/stored.d.ts +63 -0
- package/dist/jobs/stored.d.ts.map +1 -0
- package/dist/jobs/stored.js +55 -0
- package/dist/jobs/stored.js.map +1 -0
- package/dist/json.d.ts +18 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +124 -0
- package/dist/json.js.map +1 -0
- package/dist/link/binary.d.ts +4 -0
- package/dist/link/binary.d.ts.map +1 -0
- package/dist/link/binary.js +574 -0
- package/dist/link/binary.js.map +1 -0
- package/dist/link/channel.d.ts +78 -0
- package/dist/link/channel.d.ts.map +1 -0
- package/dist/link/channel.js +252 -0
- package/dist/link/channel.js.map +1 -0
- package/dist/link/errors.d.ts +7 -0
- package/dist/link/errors.d.ts.map +1 -0
- package/dist/link/errors.js +21 -0
- package/dist/link/errors.js.map +1 -0
- package/dist/link/index.d.ts +8 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +8 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/internal.d.ts +9 -0
- package/dist/link/internal.d.ts.map +1 -0
- package/dist/link/internal.js +10 -0
- package/dist/link/internal.js.map +1 -0
- package/dist/link/ipc.d.ts +22 -0
- package/dist/link/ipc.d.ts.map +1 -0
- package/dist/link/ipc.js +64 -0
- package/dist/link/ipc.js.map +1 -0
- package/dist/link/link.d.ts +34 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +87 -0
- package/dist/link/link.js.map +1 -0
- package/dist/link/message.d.ts +278 -0
- package/dist/link/message.d.ts.map +1 -0
- package/dist/link/message.js +179 -0
- package/dist/link/message.js.map +1 -0
- package/dist/link/part.d.ts +80 -0
- package/dist/link/part.d.ts.map +1 -0
- package/dist/link/part.js +165 -0
- package/dist/link/part.js.map +1 -0
- package/dist/link/text.d.ts +6 -0
- package/dist/link/text.d.ts.map +1 -0
- package/dist/link/text.js +383 -0
- package/dist/link/text.js.map +1 -0
- package/dist/link/values.d.ts +40 -0
- package/dist/link/values.d.ts.map +1 -0
- package/dist/link/values.js +121 -0
- package/dist/link/values.js.map +1 -0
- package/dist/link/websocket.d.ts +26 -0
- package/dist/link/websocket.d.ts.map +1 -0
- package/dist/link/websocket.js +91 -0
- package/dist/link/websocket.js.map +1 -0
- package/dist/node/app/app.d.ts +283 -0
- package/dist/node/app/app.d.ts.map +1 -0
- package/dist/node/app/app.js +598 -0
- package/dist/node/app/app.js.map +1 -0
- package/dist/node/app/archive.d.ts +44 -0
- package/dist/node/app/archive.d.ts.map +1 -0
- package/dist/node/app/archive.js +212 -0
- package/dist/node/app/archive.js.map +1 -0
- package/dist/node/app/blobs.d.ts +23 -0
- package/dist/node/app/blobs.d.ts.map +1 -0
- package/dist/node/app/blobs.js +64 -0
- package/dist/node/app/blobs.js.map +1 -0
- package/dist/node/app/data.d.ts +40 -0
- package/dist/node/app/data.d.ts.map +1 -0
- package/dist/node/app/data.js +47 -0
- package/dist/node/app/data.js.map +1 -0
- package/dist/node/app/ephemeral-sign-ins.d.ts +20 -0
- package/dist/node/app/ephemeral-sign-ins.d.ts.map +1 -0
- package/dist/node/app/ephemeral-sign-ins.js +69 -0
- package/dist/node/app/ephemeral-sign-ins.js.map +1 -0
- package/dist/node/app/ephemeral.d.ts +11 -0
- package/dist/node/app/ephemeral.d.ts.map +1 -0
- package/dist/node/app/ephemeral.js +34 -0
- package/dist/node/app/ephemeral.js.map +1 -0
- package/dist/node/app/files-copy.d.ts +13 -0
- package/dist/node/app/files-copy.d.ts.map +1 -0
- package/dist/node/app/files-copy.js +86 -0
- package/dist/node/app/files-copy.js.map +1 -0
- package/dist/node/app/files-entry.d.ts +4 -0
- package/dist/node/app/files-entry.d.ts.map +1 -0
- package/dist/node/app/files-entry.js +7 -0
- package/dist/node/app/files-entry.js.map +1 -0
- package/dist/node/app/files-index.d.ts +180 -0
- package/dist/node/app/files-index.d.ts.map +1 -0
- package/dist/node/app/files-index.js +535 -0
- package/dist/node/app/files-index.js.map +1 -0
- package/dist/node/app/files.d.ts +388 -0
- package/dist/node/app/files.d.ts.map +1 -0
- package/dist/node/app/files.js +368 -0
- package/dist/node/app/files.js.map +1 -0
- package/dist/node/app/folder-views.d.ts +21 -0
- package/dist/node/app/folder-views.d.ts.map +1 -0
- package/dist/node/app/folder-views.js +55 -0
- package/dist/node/app/folder-views.js.map +1 -0
- package/dist/node/app/index.d.ts +12 -0
- package/dist/node/app/index.d.ts.map +1 -0
- package/dist/node/app/index.js +15 -0
- package/dist/node/app/index.js.map +1 -0
- package/dist/node/app/info.d.ts +70 -0
- package/dist/node/app/info.d.ts.map +1 -0
- package/dist/node/app/info.js +37 -0
- package/dist/node/app/info.js.map +1 -0
- package/dist/node/app/invite.d.ts +5 -0
- package/dist/node/app/invite.d.ts.map +1 -0
- package/dist/node/app/invite.js +64 -0
- package/dist/node/app/invite.js.map +1 -0
- package/dist/node/app/layout.d.ts +36 -0
- package/dist/node/app/layout.d.ts.map +1 -0
- package/dist/node/app/layout.js +87 -0
- package/dist/node/app/layout.js.map +1 -0
- package/dist/node/app/owner.d.ts +31 -0
- package/dist/node/app/owner.d.ts.map +1 -0
- package/dist/node/app/owner.js +104 -0
- package/dist/node/app/owner.js.map +1 -0
- package/dist/node/app/pairing.d.ts +55 -0
- package/dist/node/app/pairing.d.ts.map +1 -0
- package/dist/node/app/pairing.js +183 -0
- package/dist/node/app/pairing.js.map +1 -0
- package/dist/node/app/secrets.d.ts +16 -0
- package/dist/node/app/secrets.d.ts.map +1 -0
- package/dist/node/app/secrets.js +72 -0
- package/dist/node/app/secrets.js.map +1 -0
- package/dist/node/app/sign-ins.d.ts +74 -0
- package/dist/node/app/sign-ins.d.ts.map +1 -0
- package/dist/node/app/sign-ins.js +222 -0
- package/dist/node/app/sign-ins.js.map +1 -0
- package/dist/node/app/tar.d.ts +24 -0
- package/dist/node/app/tar.d.ts.map +1 -0
- package/dist/node/app/tar.js +167 -0
- package/dist/node/app/tar.js.map +1 -0
- package/dist/node/app/uploads.d.ts +37 -0
- package/dist/node/app/uploads.d.ts.map +1 -0
- package/dist/node/app/uploads.js +157 -0
- package/dist/node/app/uploads.js.map +1 -0
- package/dist/node/app/users.d.ts +39 -0
- package/dist/node/app/users.d.ts.map +1 -0
- package/dist/node/app/users.js +62 -0
- package/dist/node/app/users.js.map +1 -0
- package/dist/node/app/worker.d.ts +18 -0
- package/dist/node/app/worker.d.ts.map +1 -0
- package/dist/node/app/worker.js +84 -0
- package/dist/node/app/worker.js.map +1 -0
- package/dist/node/compression.d.ts +7 -0
- package/dist/node/compression.d.ts.map +1 -0
- package/dist/node/compression.js +25 -0
- package/dist/node/compression.js.map +1 -0
- package/dist/node/http/admission.d.ts +64 -0
- package/dist/node/http/admission.d.ts.map +1 -0
- package/dist/node/http/admission.js +137 -0
- package/dist/node/http/admission.js.map +1 -0
- package/dist/node/http/authenticate.d.ts +21 -0
- package/dist/node/http/authenticate.d.ts.map +1 -0
- package/dist/node/http/authenticate.js +34 -0
- package/dist/node/http/authenticate.js.map +1 -0
- package/dist/node/http/cookies.d.ts +32 -0
- package/dist/node/http/cookies.d.ts.map +1 -0
- package/dist/node/http/cookies.js +70 -0
- package/dist/node/http/cookies.js.map +1 -0
- package/dist/node/http/file.d.ts +23 -0
- package/dist/node/http/file.d.ts.map +1 -0
- package/dist/node/http/file.js +94 -0
- package/dist/node/http/file.js.map +1 -0
- package/dist/node/http/headers.d.ts +37 -0
- package/dist/node/http/headers.d.ts.map +1 -0
- package/dist/node/http/headers.js +136 -0
- package/dist/node/http/headers.js.map +1 -0
- package/dist/node/http/http.d.ts +114 -0
- package/dist/node/http/http.d.ts.map +1 -0
- package/dist/node/http/http.js +524 -0
- package/dist/node/http/http.js.map +1 -0
- package/dist/node/http/incoming.d.ts +19 -0
- package/dist/node/http/incoming.d.ts.map +1 -0
- package/dist/node/http/incoming.js +31 -0
- package/dist/node/http/incoming.js.map +1 -0
- package/dist/node/http/index.d.ts +11 -0
- package/dist/node/http/index.d.ts.map +1 -0
- package/dist/node/http/index.js +12 -0
- package/dist/node/http/index.js.map +1 -0
- package/dist/node/http/node.d.ts +78 -0
- package/dist/node/http/node.d.ts.map +1 -0
- package/dist/node/http/node.js +291 -0
- package/dist/node/http/node.js.map +1 -0
- package/dist/node/http/request.d.ts +60 -0
- package/dist/node/http/request.d.ts.map +1 -0
- package/dist/node/http/request.js +118 -0
- package/dist/node/http/request.js.map +1 -0
- package/dist/node/http/response.d.ts +63 -0
- package/dist/node/http/response.d.ts.map +1 -0
- package/dist/node/http/response.js +202 -0
- package/dist/node/http/response.js.map +1 -0
- package/dist/node/http/router.d.ts +132 -0
- package/dist/node/http/router.d.ts.map +1 -0
- package/dist/node/http/router.js +267 -0
- package/dist/node/http/router.js.map +1 -0
- package/dist/node/http/upgrades.d.ts +62 -0
- package/dist/node/http/upgrades.d.ts.map +1 -0
- package/dist/node/http/upgrades.js +194 -0
- package/dist/node/http/upgrades.js.map +1 -0
- package/dist/node/plugins/base-inputs.d.ts +14 -0
- package/dist/node/plugins/base-inputs.d.ts.map +1 -0
- package/dist/node/plugins/base-inputs.js +33 -0
- package/dist/node/plugins/base-inputs.js.map +1 -0
- package/dist/node/plugins/build.d.ts +77 -0
- package/dist/node/plugins/build.d.ts.map +1 -0
- package/dist/node/plugins/build.js +577 -0
- package/dist/node/plugins/build.js.map +1 -0
- package/dist/node/plugins/css-modules.d.ts +13 -0
- package/dist/node/plugins/css-modules.d.ts.map +1 -0
- package/dist/node/plugins/css-modules.js +58 -0
- package/dist/node/plugins/css-modules.js.map +1 -0
- package/dist/node/plugins/discover.d.ts +67 -0
- package/dist/node/plugins/discover.d.ts.map +1 -0
- package/dist/node/plugins/discover.js +369 -0
- package/dist/node/plugins/discover.js.map +1 -0
- package/dist/node/plugins/evaluate.d.ts +33 -0
- package/dist/node/plugins/evaluate.d.ts.map +1 -0
- package/dist/node/plugins/evaluate.js +121 -0
- package/dist/node/plugins/evaluate.js.map +1 -0
- package/dist/node/plugins/index.d.ts +11 -0
- package/dist/node/plugins/index.d.ts.map +1 -0
- package/dist/node/plugins/index.js +13 -0
- package/dist/node/plugins/index.js.map +1 -0
- package/dist/node/plugins/install.d.ts +40 -0
- package/dist/node/plugins/install.d.ts.map +1 -0
- package/dist/node/plugins/install.js +215 -0
- package/dist/node/plugins/install.js.map +1 -0
- package/dist/node/plugins/plugins.d.ts +165 -0
- package/dist/node/plugins/plugins.d.ts.map +1 -0
- package/dist/node/plugins/plugins.js +268 -0
- package/dist/node/plugins/plugins.js.map +1 -0
- package/dist/node/plugins/runtime.d.ts +57 -0
- package/dist/node/plugins/runtime.d.ts.map +1 -0
- package/dist/node/plugins/runtime.js +92 -0
- package/dist/node/plugins/runtime.js.map +1 -0
- package/dist/node/plugins/stack.d.ts +16 -0
- package/dist/node/plugins/stack.d.ts.map +1 -0
- package/dist/node/plugins/stack.js +70 -0
- package/dist/node/plugins/stack.js.map +1 -0
- package/dist/node/plugins/testing.d.ts +58 -0
- package/dist/node/plugins/testing.d.ts.map +1 -0
- package/dist/node/plugins/testing.js +210 -0
- package/dist/node/plugins/testing.js.map +1 -0
- package/dist/node/plugins/watcher.d.ts +69 -0
- package/dist/node/plugins/watcher.d.ts.map +1 -0
- package/dist/node/plugins/watcher.js +622 -0
- package/dist/node/plugins/watcher.js.map +1 -0
- package/dist/node/surfaces/bundle.d.ts +40 -0
- package/dist/node/surfaces/bundle.d.ts.map +1 -0
- package/dist/node/surfaces/bundle.js +121 -0
- package/dist/node/surfaces/bundle.js.map +1 -0
- package/dist/node/surfaces/current.d.ts +17 -0
- package/dist/node/surfaces/current.d.ts.map +1 -0
- package/dist/node/surfaces/current.js +54 -0
- package/dist/node/surfaces/current.js.map +1 -0
- package/dist/node/surfaces/index.d.ts +6 -0
- package/dist/node/surfaces/index.d.ts.map +1 -0
- package/dist/node/surfaces/index.js +6 -0
- package/dist/node/surfaces/index.js.map +1 -0
- package/dist/node/surfaces/published.d.ts +27 -0
- package/dist/node/surfaces/published.d.ts.map +1 -0
- package/dist/node/surfaces/published.js +142 -0
- package/dist/node/surfaces/published.js.map +1 -0
- package/dist/node/surfaces/served.d.ts +17 -0
- package/dist/node/surfaces/served.d.ts.map +1 -0
- package/dist/node/surfaces/served.js +44 -0
- package/dist/node/surfaces/served.js.map +1 -0
- package/dist/node/surfaces/surface-build.d.ts +53 -0
- package/dist/node/surfaces/surface-build.d.ts.map +1 -0
- package/dist/node/surfaces/surface-build.js +105 -0
- package/dist/node/surfaces/surface-build.js.map +1 -0
- package/dist/node/surfaces/tui.d.ts +42 -0
- package/dist/node/surfaces/tui.d.ts.map +1 -0
- package/dist/node/surfaces/tui.js +59 -0
- package/dist/node/surfaces/tui.js.map +1 -0
- package/dist/node/surfaces/web.d.ts +82 -0
- package/dist/node/surfaces/web.d.ts.map +1 -0
- package/dist/node/surfaces/web.js +122 -0
- package/dist/node/surfaces/web.js.map +1 -0
- package/dist/node/tui/actions.d.ts +49 -0
- package/dist/node/tui/actions.d.ts.map +1 -0
- package/dist/node/tui/actions.js +195 -0
- package/dist/node/tui/actions.js.map +1 -0
- package/dist/node/tui/credentials.d.ts +17 -0
- package/dist/node/tui/credentials.d.ts.map +1 -0
- package/dist/node/tui/credentials.js +54 -0
- package/dist/node/tui/credentials.js.map +1 -0
- package/dist/node/tui/filter.d.ts +5 -0
- package/dist/node/tui/filter.d.ts.map +1 -0
- package/dist/node/tui/filter.js +79 -0
- package/dist/node/tui/filter.js.map +1 -0
- package/dist/node/tui/index.d.ts +6 -0
- package/dist/node/tui/index.d.ts.map +1 -0
- package/dist/node/tui/index.js +6 -0
- package/dist/node/tui/index.js.map +1 -0
- package/dist/node/tui/launcher.d.ts +40 -0
- package/dist/node/tui/launcher.d.ts.map +1 -0
- package/dist/node/tui/launcher.js +439 -0
- package/dist/node/tui/launcher.js.map +1 -0
- package/dist/node/tui/pipe.d.ts +18 -0
- package/dist/node/tui/pipe.d.ts.map +1 -0
- package/dist/node/tui/pipe.js +134 -0
- package/dist/node/tui/pipe.js.map +1 -0
- package/dist/node/tui/sandbox.d.ts +54 -0
- package/dist/node/tui/sandbox.d.ts.map +1 -0
- package/dist/node/tui/sandbox.js +431 -0
- package/dist/node/tui/sandbox.js.map +1 -0
- package/dist/node/workers/base.d.ts +30 -0
- package/dist/node/workers/base.d.ts.map +1 -0
- package/dist/node/workers/base.js +260 -0
- package/dist/node/workers/base.js.map +1 -0
- package/dist/node/workers/child.d.ts +4 -0
- package/dist/node/workers/child.d.ts.map +1 -0
- package/dist/node/workers/child.js +6 -0
- package/dist/node/workers/child.js.map +1 -0
- package/dist/node/workers/control.d.ts +83 -0
- package/dist/node/workers/control.d.ts.map +1 -0
- package/dist/node/workers/control.js +77 -0
- package/dist/node/workers/control.js.map +1 -0
- package/dist/node/workers/index.d.ts +4 -0
- package/dist/node/workers/index.d.ts.map +1 -0
- package/dist/node/workers/index.js +7 -0
- package/dist/node/workers/index.js.map +1 -0
- package/dist/node/workers/lock.d.ts +30 -0
- package/dist/node/workers/lock.d.ts.map +1 -0
- package/dist/node/workers/lock.js +180 -0
- package/dist/node/workers/lock.js.map +1 -0
- package/dist/node/workers/main.d.ts +46 -0
- package/dist/node/workers/main.d.ts.map +1 -0
- package/dist/node/workers/main.js +230 -0
- package/dist/node/workers/main.js.map +1 -0
- package/dist/node/workers/process.d.ts +43 -0
- package/dist/node/workers/process.d.ts.map +1 -0
- package/dist/node/workers/process.js +137 -0
- package/dist/node/workers/process.js.map +1 -0
- package/dist/node/workers/workers.d.ts +144 -0
- package/dist/node/workers/workers.d.ts.map +1 -0
- package/dist/node/workers/workers.js +723 -0
- package/dist/node/workers/workers.js.map +1 -0
- package/dist/output.d.ts +91 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +362 -0
- package/dist/output.js.map +1 -0
- package/dist/react/hooks.d.ts +61 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +119 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/stores.d.ts +9 -0
- package/dist/react/stores.d.ts.map +1 -0
- package/dist/react/stores.js +37 -0
- package/dist/react/stores.js.map +1 -0
- package/dist/registries/contribution.d.ts +50 -0
- package/dist/registries/contribution.d.ts.map +1 -0
- package/dist/registries/contribution.js +129 -0
- package/dist/registries/contribution.js.map +1 -0
- package/dist/registries/entries.d.ts +18 -0
- package/dist/registries/entries.d.ts.map +1 -0
- package/dist/registries/entries.js +42 -0
- package/dist/registries/entries.js.map +1 -0
- package/dist/registries/index.d.ts +3 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/index.js +5 -0
- package/dist/registries/index.js.map +1 -0
- package/dist/registries/internal.d.ts +4 -0
- package/dist/registries/internal.d.ts.map +1 -0
- package/dist/registries/internal.js +5 -0
- package/dist/registries/internal.js.map +1 -0
- package/dist/registries/record.d.ts +115 -0
- package/dist/registries/record.d.ts.map +1 -0
- package/dist/registries/record.js +283 -0
- package/dist/registries/record.js.map +1 -0
- package/dist/registries/registry.d.ts +74 -0
- package/dist/registries/registry.d.ts.map +1 -0
- package/dist/registries/registry.js +14 -0
- package/dist/registries/registry.js.map +1 -0
- package/dist/registries/value.d.ts +48 -0
- package/dist/registries/value.d.ts.map +1 -0
- package/dist/registries/value.js +224 -0
- package/dist/registries/value.js.map +1 -0
- package/dist/remote/calls.d.ts +34 -0
- package/dist/remote/calls.d.ts.map +1 -0
- package/dist/remote/calls.js +75 -0
- package/dist/remote/calls.js.map +1 -0
- package/dist/remote/consumer.d.ts +59 -0
- package/dist/remote/consumer.d.ts.map +1 -0
- package/dist/remote/consumer.js +468 -0
- package/dist/remote/consumer.js.map +1 -0
- package/dist/remote/hold.d.ts +147 -0
- package/dist/remote/hold.d.ts.map +1 -0
- package/dist/remote/hold.js +653 -0
- package/dist/remote/hold.js.map +1 -0
- package/dist/remote/host-link.d.ts +81 -0
- package/dist/remote/host-link.d.ts.map +1 -0
- package/dist/remote/host-link.js +198 -0
- package/dist/remote/host-link.js.map +1 -0
- package/dist/remote/internal.d.ts +6 -0
- package/dist/remote/internal.d.ts.map +1 -0
- package/dist/remote/internal.js +6 -0
- package/dist/remote/internal.js.map +1 -0
- package/dist/remote/path.d.ts +105 -0
- package/dist/remote/path.d.ts.map +1 -0
- package/dist/remote/path.js +197 -0
- package/dist/remote/path.js.map +1 -0
- package/dist/remote/provider.d.ts +113 -0
- package/dist/remote/provider.d.ts.map +1 -0
- package/dist/remote/provider.js +787 -0
- package/dist/remote/provider.js.map +1 -0
- package/dist/remote/relay.d.ts +126 -0
- package/dist/remote/relay.d.ts.map +1 -0
- package/dist/remote/relay.js +334 -0
- package/dist/remote/relay.js.map +1 -0
- package/dist/remote/remote-object.d.ts +181 -0
- package/dist/remote/remote-object.d.ts.map +1 -0
- package/dist/remote/remote-object.js +683 -0
- package/dist/remote/remote-object.js.map +1 -0
- package/dist/remote/replica.d.ts +66 -0
- package/dist/remote/replica.d.ts.map +1 -0
- package/dist/remote/replica.js +148 -0
- package/dist/remote/replica.js.map +1 -0
- package/dist/sqlite/cloudflare.d.ts +54 -0
- package/dist/sqlite/cloudflare.d.ts.map +1 -0
- package/dist/sqlite/cloudflare.js +144 -0
- package/dist/sqlite/cloudflare.js.map +1 -0
- package/dist/sqlite/database.d.ts +40 -0
- package/dist/sqlite/database.d.ts.map +1 -0
- package/dist/sqlite/database.js +2 -0
- package/dist/sqlite/database.js.map +1 -0
- package/dist/sqlite/index.d.ts +4 -0
- package/dist/sqlite/index.d.ts.map +1 -0
- package/dist/sqlite/index.js +3 -0
- package/dist/sqlite/index.js.map +1 -0
- package/dist/sqlite/migrations.d.ts +10 -0
- package/dist/sqlite/migrations.d.ts.map +1 -0
- package/dist/sqlite/migrations.js +33 -0
- package/dist/sqlite/migrations.js.map +1 -0
- package/dist/sqlite/node.d.ts +49 -0
- package/dist/sqlite/node.d.ts.map +1 -0
- package/dist/sqlite/node.js +197 -0
- package/dist/sqlite/node.js.map +1 -0
- package/dist/sqlite/schema.d.ts +3 -0
- package/dist/sqlite/schema.d.ts.map +1 -0
- package/dist/sqlite/schema.js +10 -0
- package/dist/sqlite/schema.js.map +1 -0
- package/dist/state/batch.d.ts +64 -0
- package/dist/state/batch.d.ts.map +1 -0
- package/dist/state/batch.js +164 -0
- package/dist/state/batch.js.map +1 -0
- package/dist/state/derive.d.ts +56 -0
- package/dist/state/derive.d.ts.map +1 -0
- package/dist/state/derive.js +192 -0
- package/dist/state/derive.js.map +1 -0
- package/dist/state/framed.d.ts +43 -0
- package/dist/state/framed.d.ts.map +1 -0
- package/dist/state/framed.js +121 -0
- package/dist/state/framed.js.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +4 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/internal.d.ts +7 -0
- package/dist/state/internal.d.ts.map +1 -0
- package/dist/state/internal.js +9 -0
- package/dist/state/internal.js.map +1 -0
- package/dist/state/native-source.d.ts +106 -0
- package/dist/state/native-source.d.ts.map +1 -0
- package/dist/state/native-source.js +240 -0
- package/dist/state/native-source.js.map +1 -0
- package/dist/state/watchable.d.ts +114 -0
- package/dist/state/watchable.d.ts.map +1 -0
- package/dist/state/watchable.js +156 -0
- package/dist/state/watchable.js.map +1 -0
- package/dist/state/writable.d.ts +32 -0
- package/dist/state/writable.d.ts.map +1 -0
- package/dist/state/writable.js +49 -0
- package/dist/state/writable.js.map +1 -0
- package/dist/store/adapter.d.ts +67 -0
- package/dist/store/adapter.d.ts.map +1 -0
- package/dist/store/adapter.js +118 -0
- package/dist/store/adapter.js.map +1 -0
- package/dist/store/allocator.d.ts +17 -0
- package/dist/store/allocator.d.ts.map +1 -0
- package/dist/store/allocator.js +30 -0
- package/dist/store/allocator.js.map +1 -0
- package/dist/store/applier.d.ts +8 -0
- package/dist/store/applier.d.ts.map +1 -0
- package/dist/store/applier.js +390 -0
- package/dist/store/applier.js.map +1 -0
- package/dist/store/apply-batch.d.ts +12 -0
- package/dist/store/apply-batch.d.ts.map +1 -0
- package/dist/store/apply-batch.js +83 -0
- package/dist/store/apply-batch.js.map +1 -0
- package/dist/store/archive.d.ts +36 -0
- package/dist/store/archive.d.ts.map +1 -0
- package/dist/store/archive.js +140 -0
- package/dist/store/archive.js.map +1 -0
- package/dist/store/backend.d.ts +10 -0
- package/dist/store/backend.d.ts.map +1 -0
- package/dist/store/backend.js +15 -0
- package/dist/store/backend.js.map +1 -0
- package/dist/store/catalog.d.ts +24 -0
- package/dist/store/catalog.d.ts.map +1 -0
- package/dist/store/catalog.js +17 -0
- package/dist/store/catalog.js.map +1 -0
- package/dist/store/claims.d.ts +23 -0
- package/dist/store/claims.d.ts.map +1 -0
- package/dist/store/claims.js +65 -0
- package/dist/store/claims.js.map +1 -0
- package/dist/store/column-set.d.ts +64 -0
- package/dist/store/column-set.d.ts.map +1 -0
- package/dist/store/column-set.js +96 -0
- package/dist/store/column-set.js.map +1 -0
- package/dist/store/columns.d.ts +93 -0
- package/dist/store/columns.d.ts.map +1 -0
- package/dist/store/columns.js +87 -0
- package/dist/store/columns.js.map +1 -0
- package/dist/store/engine.d.ts +182 -0
- package/dist/store/engine.d.ts.map +1 -0
- package/dist/store/engine.js +290 -0
- package/dist/store/engine.js.map +1 -0
- package/dist/store/evaluate.d.ts +17 -0
- package/dist/store/evaluate.d.ts.map +1 -0
- package/dist/store/evaluate.js +131 -0
- package/dist/store/evaluate.js.map +1 -0
- package/dist/store/export.d.ts +30 -0
- package/dist/store/export.d.ts.map +1 -0
- package/dist/store/export.js +221 -0
- package/dist/store/export.js.map +1 -0
- package/dist/store/expression.d.ts +254 -0
- package/dist/store/expression.d.ts.map +1 -0
- package/dist/store/expression.js +577 -0
- package/dist/store/expression.js.map +1 -0
- package/dist/store/host-column.d.ts +22 -0
- package/dist/store/host-column.d.ts.map +1 -0
- package/dist/store/host-column.js +36 -0
- package/dist/store/host-column.js.map +1 -0
- package/dist/store/host-data.d.ts +100 -0
- package/dist/store/host-data.d.ts.map +1 -0
- package/dist/store/host-data.js +397 -0
- package/dist/store/host-data.js.map +1 -0
- package/dist/store/import-migration.d.ts +19 -0
- package/dist/store/import-migration.d.ts.map +1 -0
- package/dist/store/import-migration.js +124 -0
- package/dist/store/import-migration.js.map +1 -0
- package/dist/store/import.d.ts +12 -0
- package/dist/store/import.d.ts.map +1 -0
- package/dist/store/import.js +279 -0
- package/dist/store/import.js.map +1 -0
- package/dist/store/index.d.ts +19 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +16 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/json-column.d.ts +33 -0
- package/dist/store/json-column.d.ts.map +1 -0
- package/dist/store/json-column.js +62 -0
- package/dist/store/json-column.js.map +1 -0
- package/dist/store/jsonl.d.ts +9 -0
- package/dist/store/jsonl.d.ts.map +1 -0
- package/dist/store/jsonl.js +61 -0
- package/dist/store/jsonl.js.map +1 -0
- package/dist/store/live-query.d.ts +72 -0
- package/dist/store/live-query.d.ts.map +1 -0
- package/dist/store/live-query.js +162 -0
- package/dist/store/live-query.js.map +1 -0
- package/dist/store/open-query.d.ts +90 -0
- package/dist/store/open-query.d.ts.map +1 -0
- package/dist/store/open-query.js +201 -0
- package/dist/store/open-query.js.map +1 -0
- package/dist/store/outbox.d.ts +26 -0
- package/dist/store/outbox.d.ts.map +1 -0
- package/dist/store/outbox.js +80 -0
- package/dist/store/outbox.js.map +1 -0
- package/dist/store/page.d.ts +14 -0
- package/dist/store/page.d.ts.map +1 -0
- package/dist/store/page.js +26 -0
- package/dist/store/page.js.map +1 -0
- package/dist/store/query.d.ts +65 -0
- package/dist/store/query.d.ts.map +1 -0
- package/dist/store/query.js +193 -0
- package/dist/store/query.js.map +1 -0
- package/dist/store/read-plan.d.ts +74 -0
- package/dist/store/read-plan.d.ts.map +1 -0
- package/dist/store/read-plan.js +324 -0
- package/dist/store/read-plan.js.map +1 -0
- package/dist/store/read.d.ts +81 -0
- package/dist/store/read.d.ts.map +1 -0
- package/dist/store/read.js +113 -0
- package/dist/store/read.js.map +1 -0
- package/dist/store/reads.d.ts +79 -0
- package/dist/store/reads.d.ts.map +1 -0
- package/dist/store/reads.js +255 -0
- package/dist/store/reads.js.map +1 -0
- package/dist/store/refusal.d.ts +15 -0
- package/dist/store/refusal.d.ts.map +1 -0
- package/dist/store/refusal.js +36 -0
- package/dist/store/refusal.js.map +1 -0
- package/dist/store/rows.d.ts +96 -0
- package/dist/store/rows.d.ts.map +1 -0
- package/dist/store/rows.js +222 -0
- package/dist/store/rows.js.map +1 -0
- package/dist/store/schema.d.ts +25 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +123 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/skip.d.ts +26 -0
- package/dist/store/skip.d.ts.map +1 -0
- package/dist/store/skip.js +66 -0
- package/dist/store/skip.js.map +1 -0
- package/dist/store/sql.d.ts +78 -0
- package/dist/store/sql.d.ts.map +1 -0
- package/dist/store/sql.js +244 -0
- package/dist/store/sql.js.map +1 -0
- package/dist/store/step.d.ts +52 -0
- package/dist/store/step.d.ts.map +1 -0
- package/dist/store/step.js +59 -0
- package/dist/store/step.js.map +1 -0
- package/dist/store/store.d.ts +192 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +863 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/table-changes.d.ts +35 -0
- package/dist/store/table-changes.d.ts.map +1 -0
- package/dist/store/table-changes.js +127 -0
- package/dist/store/table-changes.js.map +1 -0
- package/dist/store/table-evolve.d.ts +82 -0
- package/dist/store/table-evolve.d.ts.map +1 -0
- package/dist/store/table-evolve.js +208 -0
- package/dist/store/table-evolve.js.map +1 -0
- package/dist/store/table-handle.d.ts +69 -0
- package/dist/store/table-handle.d.ts.map +1 -0
- package/dist/store/table-handle.js +92 -0
- package/dist/store/table-handle.js.map +1 -0
- package/dist/store/table-history.d.ts +78 -0
- package/dist/store/table-history.d.ts.map +1 -0
- package/dist/store/table-history.js +43 -0
- package/dist/store/table-history.js.map +1 -0
- package/dist/store/table-migration.d.ts +28 -0
- package/dist/store/table-migration.d.ts.map +1 -0
- package/dist/store/table-migration.js +212 -0
- package/dist/store/table-migration.js.map +1 -0
- package/dist/store/table-writes.d.ts +125 -0
- package/dist/store/table-writes.d.ts.map +1 -0
- package/dist/store/table-writes.js +170 -0
- package/dist/store/table-writes.js.map +1 -0
- package/dist/store/table.d.ts +91 -0
- package/dist/store/table.d.ts.map +1 -0
- package/dist/store/table.js +133 -0
- package/dist/store/table.js.map +1 -0
- package/dist/store/text.d.ts +14 -0
- package/dist/store/text.d.ts.map +1 -0
- package/dist/store/text.js +51 -0
- package/dist/store/text.js.map +1 -0
- package/dist/store/writes.d.ts +5 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +4 -0
- package/dist/store/writes.js.map +1 -0
- package/dist/surfaces/active-language.d.ts +20 -0
- package/dist/surfaces/active-language.d.ts.map +1 -0
- package/dist/surfaces/active-language.js +78 -0
- package/dist/surfaces/active-language.js.map +1 -0
- package/dist/surfaces/active-theme.d.ts +16 -0
- package/dist/surfaces/active-theme.d.ts.map +1 -0
- package/dist/surfaces/active-theme.js +47 -0
- package/dist/surfaces/active-theme.js.map +1 -0
- package/dist/surfaces/client.d.ts +106 -0
- package/dist/surfaces/client.d.ts.map +1 -0
- package/dist/surfaces/client.js +280 -0
- package/dist/surfaces/client.js.map +1 -0
- package/dist/surfaces/connection.d.ts +53 -0
- package/dist/surfaces/connection.d.ts.map +1 -0
- package/dist/surfaces/connection.js +161 -0
- package/dist/surfaces/connection.js.map +1 -0
- package/dist/surfaces/format.d.ts +5 -0
- package/dist/surfaces/format.d.ts.map +1 -0
- package/dist/surfaces/format.js +37 -0
- package/dist/surfaces/format.js.map +1 -0
- package/dist/surfaces/index.d.ts +15 -0
- package/dist/surfaces/index.d.ts.map +1 -0
- package/dist/surfaces/index.js +18 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/language.d.ts +53 -0
- package/dist/surfaces/language.d.ts.map +1 -0
- package/dist/surfaces/language.js +74 -0
- package/dist/surfaces/language.js.map +1 -0
- package/dist/surfaces/loaded.d.ts +42 -0
- package/dist/surfaces/loaded.d.ts.map +1 -0
- package/dist/surfaces/loaded.js +116 -0
- package/dist/surfaces/loaded.js.map +1 -0
- package/dist/surfaces/locale-choice.d.ts +26 -0
- package/dist/surfaces/locale-choice.d.ts.map +1 -0
- package/dist/surfaces/locale-choice.js +14 -0
- package/dist/surfaces/locale-choice.js.map +1 -0
- package/dist/surfaces/messages.d.ts +67 -0
- package/dist/surfaces/messages.d.ts.map +1 -0
- package/dist/surfaces/messages.js +112 -0
- package/dist/surfaces/messages.js.map +1 -0
- package/dist/surfaces/page-state.d.ts +14 -0
- package/dist/surfaces/page-state.d.ts.map +1 -0
- package/dist/surfaces/page-state.js +43 -0
- package/dist/surfaces/page-state.js.map +1 -0
- package/dist/surfaces/preference.d.ts +33 -0
- package/dist/surfaces/preference.d.ts.map +1 -0
- package/dist/surfaces/preference.js +72 -0
- package/dist/surfaces/preference.js.map +1 -0
- package/dist/surfaces/registered.d.ts +33 -0
- package/dist/surfaces/registered.d.ts.map +1 -0
- package/dist/surfaces/registered.js +51 -0
- package/dist/surfaces/registered.js.map +1 -0
- package/dist/surfaces/scripts.d.ts +86 -0
- package/dist/surfaces/scripts.d.ts.map +1 -0
- package/dist/surfaces/scripts.js +28 -0
- package/dist/surfaces/scripts.js.map +1 -0
- package/dist/surfaces/theme-choice.d.ts +32 -0
- package/dist/surfaces/theme-choice.d.ts.map +1 -0
- package/dist/surfaces/theme-choice.js +18 -0
- package/dist/surfaces/theme-choice.js.map +1 -0
- package/dist/surfaces/themes.d.ts +43 -0
- package/dist/surfaces/themes.d.ts.map +1 -0
- package/dist/surfaces/themes.js +110 -0
- package/dist/surfaces/themes.js.map +1 -0
- package/dist/surfaces/translations.d.ts +29 -0
- package/dist/surfaces/translations.d.ts.map +1 -0
- package/dist/surfaces/translations.js +57 -0
- package/dist/surfaces/translations.js.map +1 -0
- package/dist/surfaces/variant.d.ts +23 -0
- package/dist/surfaces/variant.d.ts.map +1 -0
- package/dist/surfaces/variant.js +18 -0
- package/dist/surfaces/variant.js.map +1 -0
- package/dist/sync/batch.d.ts +18 -0
- package/dist/sync/batch.d.ts.map +1 -0
- package/dist/sync/batch.js +125 -0
- package/dist/sync/batch.js.map +1 -0
- package/dist/sync/client.d.ts +169 -0
- package/dist/sync/client.d.ts.map +1 -0
- package/dist/sync/client.js +459 -0
- package/dist/sync/client.js.map +1 -0
- package/dist/sync/files.d.ts +46 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +13 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/filesystem.d.ts +37 -0
- package/dist/sync/filesystem.d.ts.map +1 -0
- package/dist/sync/filesystem.js +205 -0
- package/dist/sync/filesystem.js.map +1 -0
- package/dist/sync/index.d.ts +8 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +9 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/lines.d.ts +18 -0
- package/dist/sync/lines.d.ts.map +1 -0
- package/dist/sync/lines.js +46 -0
- package/dist/sync/lines.js.map +1 -0
- package/dist/sync/remote.d.ts +145 -0
- package/dist/sync/remote.d.ts.map +1 -0
- package/dist/sync/remote.js +59 -0
- package/dist/sync/remote.js.map +1 -0
- package/dist/sync/state.d.ts +17 -0
- package/dist/sync/state.d.ts.map +1 -0
- package/dist/sync/state.js +40 -0
- package/dist/sync/state.js.map +1 -0
- package/dist/telemetry-ingest/batch.d.ts +73 -0
- package/dist/telemetry-ingest/batch.d.ts.map +1 -0
- package/dist/telemetry-ingest/batch.js +110 -0
- package/dist/telemetry-ingest/batch.js.map +1 -0
- package/dist/telemetry-ingest/facet.d.ts +26 -0
- package/dist/telemetry-ingest/facet.d.ts.map +1 -0
- package/dist/telemetry-ingest/facet.js +100 -0
- package/dist/telemetry-ingest/facet.js.map +1 -0
- package/dist/telemetry-ingest/index.d.ts +5 -0
- package/dist/telemetry-ingest/index.d.ts.map +1 -0
- package/dist/telemetry-ingest/index.js +8 -0
- package/dist/telemetry-ingest/index.js.map +1 -0
- package/dist/telemetry-ingest/recorder.d.ts +50 -0
- package/dist/telemetry-ingest/recorder.d.ts.map +1 -0
- package/dist/telemetry-ingest/recorder.js +298 -0
- package/dist/telemetry-ingest/recorder.js.map +1 -0
- package/dist/telemetry-ingest/sender.d.ts +14 -0
- package/dist/telemetry-ingest/sender.d.ts.map +1 -0
- package/dist/telemetry-ingest/sender.js +64 -0
- package/dist/telemetry-ingest/sender.js.map +1 -0
- package/dist/telemetry-sqlite/index.d.ts +33 -0
- package/dist/telemetry-sqlite/index.d.ts.map +1 -0
- package/dist/telemetry-sqlite/index.js +113 -0
- package/dist/telemetry-sqlite/index.js.map +1 -0
- package/dist/telemetry-sqlite/node.d.ts +13 -0
- package/dist/telemetry-sqlite/node.d.ts.map +1 -0
- package/dist/telemetry-sqlite/node.js +27 -0
- package/dist/telemetry-sqlite/node.js.map +1 -0
- package/dist/telemetry-sqlite/schema.d.ts +9 -0
- package/dist/telemetry-sqlite/schema.d.ts.map +1 -0
- package/dist/telemetry-sqlite/schema.js +61 -0
- package/dist/telemetry-sqlite/schema.js.map +1 -0
- package/dist/telemetry-sqlite/store.d.ts +12 -0
- package/dist/telemetry-sqlite/store.d.ts.map +1 -0
- package/dist/telemetry-sqlite/store.js +121 -0
- package/dist/telemetry-sqlite/store.js.map +1 -0
- package/dist/telemetry.d.ts +1013 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +518 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tui/bridge.d.ts +112 -0
- package/dist/tui/bridge.d.ts.map +1 -0
- package/dist/tui/bridge.js +9 -0
- package/dist/tui/bridge.js.map +1 -0
- package/dist/tui/channel.d.ts +44 -0
- package/dist/tui/channel.d.ts.map +1 -0
- package/dist/tui/channel.js +150 -0
- package/dist/tui/channel.js.map +1 -0
- package/dist/tui/frames.d.ts +5 -0
- package/dist/tui/frames.d.ts.map +1 -0
- package/dist/tui/frames.js +52 -0
- package/dist/tui/frames.js.map +1 -0
- package/dist/tui/index.d.ts +8 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/runtime.d.ts +46 -0
- package/dist/tui/runtime.d.ts.map +1 -0
- package/dist/tui/runtime.js +101 -0
- package/dist/tui/runtime.js.map +1 -0
- package/dist/tui/scope.d.ts +62 -0
- package/dist/tui/scope.d.ts.map +1 -0
- package/dist/tui/scope.js +173 -0
- package/dist/tui/scope.js.map +1 -0
- package/dist/tui/terminal.d.ts +15 -0
- package/dist/tui/terminal.d.ts.map +1 -0
- package/dist/tui/terminal.js +37 -0
- package/dist/tui/terminal.js.map +1 -0
- package/dist/tui/theme.d.ts +17 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +38 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/watch.d.ts +194 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +383 -0
- package/dist/watch.js.map +1 -0
- package/dist/web/environment.d.ts +4 -0
- package/dist/web/environment.d.ts.map +1 -0
- package/dist/web/environment.js +37 -0
- package/dist/web/environment.js.map +1 -0
- package/dist/web/index.d.ts +5 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +7 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/language.d.ts +7 -0
- package/dist/web/language.d.ts.map +1 -0
- package/dist/web/language.js +21 -0
- package/dist/web/language.js.map +1 -0
- package/dist/web/page.d.ts +42 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +96 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/scripts.d.ts +23 -0
- package/dist/web/scripts.d.ts.map +1 -0
- package/dist/web/scripts.js +50 -0
- package/dist/web/scripts.js.map +1 -0
- package/dist/web/styles.d.ts +17 -0
- package/dist/web/styles.d.ts.map +1 -0
- package/dist/web/styles.js +218 -0
- package/dist/web/styles.js.map +1 -0
- package/dist/web/themes.d.ts +6 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +31 -0
- package/dist/web/themes.js.map +1 -0
- package/docs/admission/design.md +178 -0
- package/docs/benchmarks.md +1182 -0
- package/docs/decisions.md +3760 -0
- package/docs/dependencies/book.md +1671 -0
- package/docs/dependencies/index.html +2641 -0
- package/docs/dependencies/model.md +330 -0
- package/docs/design.md +3691 -0
- package/docs/durable-observers/book.md +432 -0
- package/docs/durable-observers/index.html +517 -0
- package/docs/events/spec.md +438 -0
- package/docs/flow-control/book.md +333 -0
- package/docs/flow-control/fold/index.html +265 -0
- package/docs/flow-control/index.html +548 -0
- package/docs/flow-control/window/index.html +228 -0
- package/docs/guide-plugins-hosts/book.md +958 -0
- package/docs/guide-plugins-hosts/index.html +952 -0
- package/docs/host-keyed/spec.md +343 -0
- package/docs/http-workers/book.md +378 -0
- package/docs/http-workers/index.html +515 -0
- package/docs/i18n/book.md +217 -0
- package/docs/i18n/index.html +344 -0
- package/docs/layer-1.md +311 -0
- package/docs/layer-2.md +216 -0
- package/docs/p3-features/README.md +6 -0
- package/docs/p3-features/book.md +478 -0
- package/docs/plugin-authoring.md +389 -0
- package/docs/plugin-model/book.md +186 -0
- package/docs/plugin-model/index.html +310 -0
- package/docs/plugin-primer/book.md +273 -0
- package/docs/plugin-primer/index.html +430 -0
- package/docs/shared-holds/design.md +339 -0
- package/docs/slice-1.md +236 -0
- package/docs/slice-10.md +288 -0
- package/docs/slice-11.md +114 -0
- package/docs/slice-12.md +132 -0
- package/docs/slice-13.md +121 -0
- package/docs/slice-14-design.md +213 -0
- package/docs/slice-14.md +861 -0
- package/docs/slice-2.md +174 -0
- package/docs/slice-3a.md +296 -0
- package/docs/slice-3b.md +197 -0
- package/docs/slice-4.md +146 -0
- package/docs/slice-4a.md +418 -0
- package/docs/slice-4b.md +208 -0
- package/docs/slice-5.md +281 -0
- package/docs/slice-6a.md +676 -0
- package/docs/slice-6b.md +332 -0
- package/docs/slice-7a.md +130 -0
- package/docs/slice-7b/book.md +608 -0
- package/docs/slice-7b/index.html +842 -0
- package/docs/slice-7b.md +255 -0
- package/docs/slice-7c.md +165 -0
- package/docs/slice-8.md +194 -0
- package/docs/slice-9.md +110 -0
- package/docs/slices.md +380 -0
- package/docs/store/book.md +670 -0
- package/docs/store/index.html +861 -0
- package/docs/store/walkthrough.md +193 -0
- package/docs/theming/book.md +223 -0
- package/docs/theming/index.html +371 -0
- package/docs/tutorial/book.md +2170 -0
- package/docs/tutorial/index.html +2112 -0
- package/docs/tutorial/screens/click-after.png +0 -0
- package/docs/tutorial/screens/click-before.png +0 -0
- package/docs/tutorial/screens/edited.png +0 -0
- package/docs/tutorial/screens/french.png +0 -0
- package/docs/tutorial/screens/harbor.png +0 -0
- package/docs/tutorial/screens/page.png +0 -0
- package/docs/tutorial/screens/traces-ada.png +0 -0
- package/docs/tutorial/screens/traces.png +0 -0
- package/package.json +200 -5
- package/src/delta/README.md +262 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
// The table expression language (slice 6a §6, §7; rules 10, 13, 14, 16; decision "Nullable columns and the `set`
|
|
2
|
+
// form"): the builders plugins write `where` and `set` with, and their compilation at staging into one data-only
|
|
3
|
+
// vocabulary (what the outbox and archives carry; `evaluate.ts` runs it in JavaScript, `sql.ts` renders it).
|
|
4
|
+
import { invalid } from "../data/internal.js";
|
|
5
|
+
import { columnRecord, } from "./columns.js";
|
|
6
|
+
import { checkScalar, encodeCell } from "./rows.js";
|
|
7
|
+
/** A value expression as a plugin builds it: `T` is its value, `K` its column type. Compiled when staged. */
|
|
8
|
+
export class Expression {
|
|
9
|
+
op;
|
|
10
|
+
args;
|
|
11
|
+
constructor(op, args) {
|
|
12
|
+
this.op = op;
|
|
13
|
+
this.args = args;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A reference to a column of the row, as `(t) => …` callbacks get them. One of a column set (`Set.refs`) carries the
|
|
18
|
+
* set's name: a condition names the side it means by it (a query's own table, a joined set, an `exists`).
|
|
19
|
+
*/
|
|
20
|
+
export class ColumnRef extends Expression {
|
|
21
|
+
column;
|
|
22
|
+
set;
|
|
23
|
+
constructor(column, set) {
|
|
24
|
+
super("col", [column]);
|
|
25
|
+
this.column = column;
|
|
26
|
+
this.set = set;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** A condition as a plugin builds it; compiled when staged or run. */
|
|
30
|
+
export class Condition {
|
|
31
|
+
op;
|
|
32
|
+
args;
|
|
33
|
+
constructor(op, args) {
|
|
34
|
+
this.op = op;
|
|
35
|
+
this.args = args;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** The column equals `value` (`NULL` never matches). */
|
|
39
|
+
export function eq(column, value) {
|
|
40
|
+
return new Condition("eq", [column, value]);
|
|
41
|
+
}
|
|
42
|
+
/** The column differs from `value` (`NULL` never matches). */
|
|
43
|
+
export function ne(column, value) {
|
|
44
|
+
return new Condition("ne", [column, value]);
|
|
45
|
+
}
|
|
46
|
+
/** The column is below `value`. */
|
|
47
|
+
export function lt(column, value) {
|
|
48
|
+
return new Condition("lt", [column, value]);
|
|
49
|
+
}
|
|
50
|
+
/** The column is at most `value`. */
|
|
51
|
+
export function lte(column, value) {
|
|
52
|
+
return new Condition("lte", [column, value]);
|
|
53
|
+
}
|
|
54
|
+
/** The column is above `value`. */
|
|
55
|
+
export function gt(column, value) {
|
|
56
|
+
return new Condition("gt", [column, value]);
|
|
57
|
+
}
|
|
58
|
+
/** The column is at least `value`. */
|
|
59
|
+
export function gte(column, value) {
|
|
60
|
+
return new Condition("gte", [column, value]);
|
|
61
|
+
}
|
|
62
|
+
/** The column equals one of `values` (`[]` matches nothing). */
|
|
63
|
+
export function inArray(column, values) {
|
|
64
|
+
return new Condition("inArray", [column, values]);
|
|
65
|
+
}
|
|
66
|
+
/** The column is `NULL` (an `opt(...)` column without a value). */
|
|
67
|
+
export function isNull(column) {
|
|
68
|
+
return new Condition("isNull", [column]);
|
|
69
|
+
}
|
|
70
|
+
/** The text column starts with `prefix`, compared by code point (`""` matches every value). */
|
|
71
|
+
export function prefix(column, prefix) {
|
|
72
|
+
return new Condition("prefix", [column, prefix]);
|
|
73
|
+
}
|
|
74
|
+
/** Every condition holds (`and()` always does). */
|
|
75
|
+
export function and(...conditions) {
|
|
76
|
+
return new Condition("and", conditions);
|
|
77
|
+
}
|
|
78
|
+
/** Some condition holds (`or()` never does). */
|
|
79
|
+
export function or(...conditions) {
|
|
80
|
+
return new Condition("or", conditions);
|
|
81
|
+
}
|
|
82
|
+
/** The condition does not hold (`NULL` stays `NULL`: it never matches). */
|
|
83
|
+
export function not(condition) {
|
|
84
|
+
return new Condition("not", [condition]);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* `set`'s table has a row equal to the enclosing row in the matched columns (a leading prefix of the set's key or of
|
|
88
|
+
* one of its declared indexes) that satisfies `inner`. In queries only.
|
|
89
|
+
*/
|
|
90
|
+
export function exists(set, match, inner) {
|
|
91
|
+
return new Condition("exists", [set, match, inner?.(set.refs)]);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* `exists` with its inner condition as data (`compile`'s result): for a condition handed over as an argument. A
|
|
95
|
+
* trust boundary: `inner` is whatever arrived, and is checked whole before anything is rendered.
|
|
96
|
+
*/
|
|
97
|
+
export function existsNode(set, match, inner) {
|
|
98
|
+
return new Condition("existsNode", [set, match, inner]);
|
|
99
|
+
}
|
|
100
|
+
/** `a + b` over integers; a result outside ±(2^53 - 1) fails (rule 10). */
|
|
101
|
+
export function add(a, b) {
|
|
102
|
+
return new Expression("add", [a, b]);
|
|
103
|
+
}
|
|
104
|
+
/** `a - b` over integers; a result outside ±(2^53 - 1) fails (rule 10). */
|
|
105
|
+
export function sub(a, b) {
|
|
106
|
+
return new Expression("sub", [a, b]);
|
|
107
|
+
}
|
|
108
|
+
/** The larger of `a` and b` (`int` or `num`). */
|
|
109
|
+
export function max(a, b) {
|
|
110
|
+
return new Expression("max", [a, b]);
|
|
111
|
+
}
|
|
112
|
+
/** The smaller of `a` and `b` (`int` or `num`). */
|
|
113
|
+
export function min(a, b) {
|
|
114
|
+
return new Expression("min", [a, b]);
|
|
115
|
+
}
|
|
116
|
+
/** `a` followed by `b`. */
|
|
117
|
+
export function concat(a, b) {
|
|
118
|
+
return new Expression("concat", [a, b]);
|
|
119
|
+
}
|
|
120
|
+
/** `value` with its prefix `from` replaced by `to`; a value without the prefix stays as it is. */
|
|
121
|
+
export function replacePrefix(value, from, to) {
|
|
122
|
+
return new Expression("replacePrefix", [value, from, to]);
|
|
123
|
+
}
|
|
124
|
+
/** `a` unless it is `NULL`, else `b`. */
|
|
125
|
+
export function coalesce(a, b) {
|
|
126
|
+
return new Expression("coalesce", [a, b]);
|
|
127
|
+
}
|
|
128
|
+
/** `a` where `condition` holds for the row, else `b`. */
|
|
129
|
+
export function when(condition, a, b) {
|
|
130
|
+
return new Expression("when", [condition, a, b]);
|
|
131
|
+
}
|
|
132
|
+
/** One `ColumnRef` per column of `definition`, for its `(t) => …` callbacks. */
|
|
133
|
+
export function columnRefs(columns) {
|
|
134
|
+
return Object.fromEntries(columns.map(({ name }) => [name, new ColumnRef(name)]));
|
|
135
|
+
}
|
|
136
|
+
/** The scope of one table: its own references, and those of the set it exposes. */
|
|
137
|
+
export function tableScope(table, exists) {
|
|
138
|
+
return {
|
|
139
|
+
name: table.name,
|
|
140
|
+
exists,
|
|
141
|
+
resolve: (ref) => {
|
|
142
|
+
if (ref.set !== undefined && ref.set !== table.exposes?.name)
|
|
143
|
+
return undefined;
|
|
144
|
+
const column = table.byName.get(ref.column);
|
|
145
|
+
return column === undefined ? undefined : { column, name: column.name };
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** The scope of a column set alone: its own references (`compile`, an `exists`' inner condition). */
|
|
150
|
+
export function setScope(set) {
|
|
151
|
+
return {
|
|
152
|
+
name: set.name,
|
|
153
|
+
exists: true,
|
|
154
|
+
resolve: (ref) => {
|
|
155
|
+
const column = ref.set === set.name ? set.byName.get(ref.column) : undefined;
|
|
156
|
+
return column === undefined ? undefined : { column, name: column.name };
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/** The name of a joined set's column in compiled nodes, orders and cursors: `<set>:<column>`. */
|
|
161
|
+
export function partnerName(set, column) {
|
|
162
|
+
return `${set}:${column}`;
|
|
163
|
+
}
|
|
164
|
+
/** The scope of a query of `own` joined with `set`: the partner's columns are named `<set>:<column>`. */
|
|
165
|
+
export function joinedScope(own, set) {
|
|
166
|
+
return {
|
|
167
|
+
name: own.name,
|
|
168
|
+
exists: true,
|
|
169
|
+
resolve: (ref) => {
|
|
170
|
+
if (ref.set !== set.name)
|
|
171
|
+
return own.resolve(ref);
|
|
172
|
+
const column = set.byName.get(ref.column);
|
|
173
|
+
return column === undefined ? undefined : { column, name: partnerName(set.name, column.name) };
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Compiles a plugin's condition over `table`'s columns for a write (a trust boundary: plugin values): known scalar
|
|
179
|
+
* columns, operands of their type made storable (`invalid/args` otherwise, `undefined` included: ask with `isNull`,
|
|
180
|
+
* rule 16). No `exists`.
|
|
181
|
+
*/
|
|
182
|
+
export function compileWhere(table, condition, what) {
|
|
183
|
+
return compileCondition(tableScope(table, false), condition, what);
|
|
184
|
+
}
|
|
185
|
+
/** A condition over `set`'s columns as plain data (slice 14 §6), for `whereNode` and `existsNode`. */
|
|
186
|
+
export function compile(set, condition) {
|
|
187
|
+
return compileCondition(setScope(set), condition, "compile");
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Compiles a plugin's condition in `scope` (a trust boundary), as `compileWhere` does for one table. The set columns
|
|
191
|
+
* its `exists` use are added to `expected`.
|
|
192
|
+
*/
|
|
193
|
+
export function compileCondition(scope, condition, what, expected = new Map()) {
|
|
194
|
+
if (!(condition instanceof Condition))
|
|
195
|
+
throw invalid("args", `${scope.name}: ${what}: expected a condition`);
|
|
196
|
+
const { op, args } = condition;
|
|
197
|
+
switch (op) {
|
|
198
|
+
case "and":
|
|
199
|
+
case "or": {
|
|
200
|
+
const nodes = args.map((each) => compileCondition(scope, each, what, expected));
|
|
201
|
+
return op === "and" ? { and: nodes } : { or: nodes };
|
|
202
|
+
}
|
|
203
|
+
case "not":
|
|
204
|
+
return { not: compileCondition(scope, args[0], what, expected) };
|
|
205
|
+
case "exists":
|
|
206
|
+
case "existsNode":
|
|
207
|
+
return { exists: compileExists(scope, condition, what, expected) };
|
|
208
|
+
case "isNull":
|
|
209
|
+
return { isNull: ordered(scope, scalarColumn(scope, args[0], what), op, what).name };
|
|
210
|
+
case "prefix": {
|
|
211
|
+
const { column, name } = ordered(scope, scalarColumn(scope, args[0], what), op, what);
|
|
212
|
+
if (column.type !== "str")
|
|
213
|
+
throw invalid("args", `${scope.name}: ${what}: prefix needs a str() column`);
|
|
214
|
+
return { prefix: [name, operand(column, args[1], what)] };
|
|
215
|
+
}
|
|
216
|
+
case "inArray": {
|
|
217
|
+
const { column, name } = scalarColumn(scope, args[0], what);
|
|
218
|
+
const values = args[1];
|
|
219
|
+
if (!Array.isArray(values))
|
|
220
|
+
throw invalid("args", `${scope.name}: ${what}: inArray needs an array`);
|
|
221
|
+
return { inArray: [name, values.map((value) => operand(column, value, what))] };
|
|
222
|
+
}
|
|
223
|
+
default: {
|
|
224
|
+
const resolved = scalarColumn(scope, args[0], what);
|
|
225
|
+
if (op !== "eq" && op !== "ne")
|
|
226
|
+
ordered(scope, resolved, op, what);
|
|
227
|
+
// One of the six comparisons: the node's shape is `{ [op]: [column, value] }`.
|
|
228
|
+
return { [op]: [resolved.name, operand(resolved.column, args[1], what)] };
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/** How deep a condition handed over as data may nest (`and`, `or`, `not`, `exists`). */
|
|
233
|
+
export const NODE_DEPTH = 16;
|
|
234
|
+
/**
|
|
235
|
+
* Compiles an `exists` of `scope`: the set's matched columns are a leading prefix of its key or of one of its
|
|
236
|
+
* declared indexes, each of the type (and host kind) of the enclosing column it is matched to; the inner condition is
|
|
237
|
+
* the callback's, compiled over the set, or a node, checked as `whereNode` checks one.
|
|
238
|
+
*/
|
|
239
|
+
function compileExists(scope, condition, what, expected) {
|
|
240
|
+
// The builders' arguments (`exists`, `existsNode`): plugin values, read as unknown data.
|
|
241
|
+
const [set, match, inner] = condition.args;
|
|
242
|
+
if (!scope.exists)
|
|
243
|
+
throw invalid("args", `${scope.name}: ${what}: exists is for queries, not for writes`);
|
|
244
|
+
if (typeof match !== "object" || match === null)
|
|
245
|
+
throw invalid("args", `${scope.name}: ${what}: exists needs a match`);
|
|
246
|
+
const pairs = Object.entries(match).map(([name, ref]) => {
|
|
247
|
+
const column = set.byName.get(name);
|
|
248
|
+
const outer = ref instanceof ColumnRef ? scope.resolve(ref) : undefined;
|
|
249
|
+
if (column === undefined || outer === undefined) {
|
|
250
|
+
throw invalid("args", `${scope.name}: ${what}: exists(${set.name}): "${name}" is matched to no column`);
|
|
251
|
+
}
|
|
252
|
+
checkPair(set.name, column, outer.column, `${scope.name}: ${what}`);
|
|
253
|
+
return [name, outer.name];
|
|
254
|
+
});
|
|
255
|
+
checkMatch(set, pairs.map(([name]) => name), `${scope.name}: ${what}`);
|
|
256
|
+
let node = null;
|
|
257
|
+
if (condition.op === "existsNode") {
|
|
258
|
+
checkNode(inner, set, `${scope.name}: ${what}: existsNode(${set.name})`);
|
|
259
|
+
node = inner;
|
|
260
|
+
}
|
|
261
|
+
else if (inner !== undefined)
|
|
262
|
+
node = compileCondition(setScope(set), inner, what, expected);
|
|
263
|
+
// What this `exists` uses of the set, as its author's `Set` declares it.
|
|
264
|
+
let columns = expected.get(set.name);
|
|
265
|
+
if (columns === undefined) {
|
|
266
|
+
columns = new Map();
|
|
267
|
+
expected.set(set.name, columns);
|
|
268
|
+
}
|
|
269
|
+
for (const name of [...pairs.map(([each]) => each), ...(node === null ? [] : columnsOf(node))]) {
|
|
270
|
+
columns.set(name, set.byName.get(name));
|
|
271
|
+
}
|
|
272
|
+
return [set.name, pairs, node];
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* The columns a condition uses of its own side: the ones it compares, and the ones its `exists` are matched to. An
|
|
276
|
+
* `exists`' inner condition is another side's.
|
|
277
|
+
*/
|
|
278
|
+
export function columnsOf(node) {
|
|
279
|
+
if ("and" in node)
|
|
280
|
+
return node.and.flatMap(columnsOf);
|
|
281
|
+
if ("or" in node)
|
|
282
|
+
return node.or.flatMap(columnsOf);
|
|
283
|
+
if ("not" in node)
|
|
284
|
+
return columnsOf(node.not);
|
|
285
|
+
if ("isNull" in node)
|
|
286
|
+
return [node.isNull];
|
|
287
|
+
if ("exists" in node)
|
|
288
|
+
return node.exists[1].map(([, enclosing]) => enclosing);
|
|
289
|
+
// The remaining nodes are `{ [op]: [column, operand] }`.
|
|
290
|
+
return [Object.values(node)[0][0]];
|
|
291
|
+
}
|
|
292
|
+
/** The `exists` a condition tests on its own side (not the ones nested inside them). */
|
|
293
|
+
export function existsIn(node) {
|
|
294
|
+
if ("and" in node)
|
|
295
|
+
return node.and.flatMap(existsIn);
|
|
296
|
+
if ("or" in node)
|
|
297
|
+
return node.or.flatMap(existsIn);
|
|
298
|
+
if ("not" in node)
|
|
299
|
+
return existsIn(node.not);
|
|
300
|
+
return "exists" in node ? [node.exists] : [];
|
|
301
|
+
}
|
|
302
|
+
/** Whether `key` is the canonical stored key of an address of `host`'s kind. */
|
|
303
|
+
function isHostKey(host, key) {
|
|
304
|
+
try {
|
|
305
|
+
return host.key(host.address(key), "") === key;
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Refuses a match that is no leading prefix of `set`'s key or of one of its declared indexes (`invalid/args`, listing
|
|
313
|
+
* them): two tables are matched only by such an equality (the bounding rule, slice 14 §5).
|
|
314
|
+
*/
|
|
315
|
+
export function checkMatch(set, matched, what) {
|
|
316
|
+
const paths = [set.key, ...set.indexes.values()];
|
|
317
|
+
const fits = (path) => matched.length > 0 &&
|
|
318
|
+
matched.length <= path.length &&
|
|
319
|
+
path.slice(0, matched.length).every((column) => matched.includes(column));
|
|
320
|
+
if (paths.some(fits))
|
|
321
|
+
return;
|
|
322
|
+
const listed = [
|
|
323
|
+
`key (${set.key.join(", ")})`,
|
|
324
|
+
...[...set.indexes].map(([name, columns]) => `${name} (${columns.join(", ")})`),
|
|
325
|
+
];
|
|
326
|
+
throw invalid("args", `${what}: ${set.name} is matched by (${matched.join(", ")}), no leading prefix of its ${listed.join(" or ")}`);
|
|
327
|
+
}
|
|
328
|
+
/** Refuses a pair of matched columns of different types or host kinds (`invalid/args`, naming the set's column). */
|
|
329
|
+
export function checkPair(set, column, outer, what) {
|
|
330
|
+
const [a, b] = [columnRecord(column), columnRecord(outer)];
|
|
331
|
+
if (a.type === "json" || a.type !== b.type || a.host !== b.host) {
|
|
332
|
+
throw invalid("args", `${what}: ${set} column "${column.name}" and the column it is matched to differ in type`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Checks a condition handed over as data against `side`'s columns (a trust boundary, slice 14 §6): one known kind
|
|
337
|
+
* per node, operand shapes and types (a `host(...)` column's operands are stored keys), every column in the side, a
|
|
338
|
+
* depth bound. The inner condition of a nested `exists` is over another set: its structure is checked here, its
|
|
339
|
+
* columns when the read opens and the set's table is known. `invalid/args` otherwise.
|
|
340
|
+
*/
|
|
341
|
+
export function checkNode(node, side, what, depth = 0) {
|
|
342
|
+
const refuse = (message) => {
|
|
343
|
+
throw invalid("args", `${what}: ${message}`);
|
|
344
|
+
};
|
|
345
|
+
if (depth > NODE_DEPTH)
|
|
346
|
+
refuse(`nested deeper than ${NODE_DEPTH}`);
|
|
347
|
+
if (typeof node !== "object" || node === null || Array.isArray(node))
|
|
348
|
+
refuse("a condition node is an object");
|
|
349
|
+
const entries = Object.entries(node);
|
|
350
|
+
if (entries.length !== 1)
|
|
351
|
+
refuse("a condition node has one kind");
|
|
352
|
+
const [kind, value] = entries[0];
|
|
353
|
+
const column = (name) => {
|
|
354
|
+
if (typeof name !== "string")
|
|
355
|
+
return refuse("a column is named by a string");
|
|
356
|
+
const found = side?.byName.get(name);
|
|
357
|
+
if (side !== undefined && found === undefined)
|
|
358
|
+
refuse(`no column "${name}" in ${side.name}`);
|
|
359
|
+
if (found?.type === "json")
|
|
360
|
+
refuse(`json(...) column "${name}" is not queryable`);
|
|
361
|
+
return found;
|
|
362
|
+
};
|
|
363
|
+
const operand = (of, each) => {
|
|
364
|
+
const type = typeof each;
|
|
365
|
+
if (type !== "string" && type !== "boolean" && !(type === "number" && Number.isFinite(each)))
|
|
366
|
+
refuse("an operand is a string, a number or a boolean");
|
|
367
|
+
if (of === undefined)
|
|
368
|
+
return;
|
|
369
|
+
checkScalar(of.type, each, what);
|
|
370
|
+
// A `host(...)` column holds canonical address keys: anything else would silently match nothing.
|
|
371
|
+
if (of.type === "str" && of.host !== undefined && !isHostKey(of.host, each)) {
|
|
372
|
+
refuse(`"${String(each)}" is no address key of ${of.host.kind.kind} (column "${of.name}")`);
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
/** A `host(...)` column compares only with eq, ne and inArray, as `compile` has it. */
|
|
376
|
+
const ordered = (of) => {
|
|
377
|
+
if (of?.type === "str" && of.host !== undefined)
|
|
378
|
+
refuse(`${kind} on host(...) column "${of.name}"`);
|
|
379
|
+
};
|
|
380
|
+
const pair = () => {
|
|
381
|
+
if (!Array.isArray(value) || value.length !== 2)
|
|
382
|
+
return refuse(`${kind} takes [column, operand]`);
|
|
383
|
+
return value;
|
|
384
|
+
};
|
|
385
|
+
switch (kind) {
|
|
386
|
+
case "and":
|
|
387
|
+
case "or":
|
|
388
|
+
if (!Array.isArray(value))
|
|
389
|
+
return refuse(`${kind} takes an array`);
|
|
390
|
+
for (const each of value)
|
|
391
|
+
checkNode(each, side, what, depth + 1);
|
|
392
|
+
return;
|
|
393
|
+
case "not":
|
|
394
|
+
return checkNode(value, side, what, depth + 1);
|
|
395
|
+
case "isNull":
|
|
396
|
+
ordered(column(value));
|
|
397
|
+
return;
|
|
398
|
+
case "inArray": {
|
|
399
|
+
const [name, values] = pair();
|
|
400
|
+
const of = column(name);
|
|
401
|
+
if (!Array.isArray(values))
|
|
402
|
+
return refuse("inArray takes an array of operands");
|
|
403
|
+
for (const each of values)
|
|
404
|
+
operand(of, each);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
case "prefix": {
|
|
408
|
+
const [name, text] = pair();
|
|
409
|
+
const of = column(name);
|
|
410
|
+
ordered(of);
|
|
411
|
+
if (typeof text !== "string" || (of !== undefined && of.type !== "str"))
|
|
412
|
+
refuse("prefix takes a str() column and a string");
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
case "eq":
|
|
416
|
+
case "ne": {
|
|
417
|
+
const [name, each] = pair();
|
|
418
|
+
operand(column(name), each);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
case "lt":
|
|
422
|
+
case "lte":
|
|
423
|
+
case "gt":
|
|
424
|
+
case "gte": {
|
|
425
|
+
const [name, each] = pair();
|
|
426
|
+
const of = column(name);
|
|
427
|
+
ordered(of);
|
|
428
|
+
operand(of, each);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
case "exists": {
|
|
432
|
+
if (!Array.isArray(value) || value.length !== 3)
|
|
433
|
+
return refuse("exists takes [set, pairs, inner]");
|
|
434
|
+
const [set, pairs, inner] = value;
|
|
435
|
+
if (typeof set !== "string" || !Array.isArray(pairs) || pairs.length === 0)
|
|
436
|
+
return refuse("exists takes a set name and its matched pairs");
|
|
437
|
+
for (const each of pairs) {
|
|
438
|
+
if (!Array.isArray(each) || each.length !== 2 || typeof each[0] !== "string")
|
|
439
|
+
return refuse("an exists pair is [setColumn, column]");
|
|
440
|
+
column(each[1]);
|
|
441
|
+
}
|
|
442
|
+
if (inner !== null)
|
|
443
|
+
checkNode(inner, undefined, what, depth + 1);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
default:
|
|
447
|
+
return refuse(`unknown kind "${kind}"`);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Compiles a plugin's `set` (plain values or a callback's result) for `table` (a trust boundary): known non-key
|
|
452
|
+
* columns (rule 13), at least one (rule 14), `undefined` clearing an `opt(...)` column as the explicit `null` (a
|
|
453
|
+
* `null` value is a `json(...)` cell's JSON `null`, refused for other columns), an
|
|
454
|
+
* expression whose result may be `NULL` only for an `opt(...)` column; integer arithmetic only on `int` columns.
|
|
455
|
+
*/
|
|
456
|
+
export function compileSet(table, set, what) {
|
|
457
|
+
if (typeof set !== "object" || set === null || Array.isArray(set)) {
|
|
458
|
+
throw invalid("args", `${table.name}: ${what}: expected an object of column values`);
|
|
459
|
+
}
|
|
460
|
+
const entries = Object.entries(set);
|
|
461
|
+
if (entries.length === 0)
|
|
462
|
+
throw invalid("args", `${table.name}: ${what}: the set is empty`);
|
|
463
|
+
const node = {};
|
|
464
|
+
for (const [name, value] of entries) {
|
|
465
|
+
const column = table.byName.get(name);
|
|
466
|
+
if (column === undefined)
|
|
467
|
+
throw invalid("args", `${table.name}: ${what}: no column "${name}"`);
|
|
468
|
+
if (table.key.includes(name)) {
|
|
469
|
+
throw invalid("args", `${table.name}: ${what}: key column "${name}" cannot change (delete and put)`);
|
|
470
|
+
}
|
|
471
|
+
const where = `${what}: column "${name}"`;
|
|
472
|
+
if (value === undefined) {
|
|
473
|
+
if (!column.optional)
|
|
474
|
+
throw invalid("args", `${table.name}: ${where} is not opt(...) and cannot be cleared`);
|
|
475
|
+
node[name] = null;
|
|
476
|
+
}
|
|
477
|
+
else if (value === null && column.type !== "json") {
|
|
478
|
+
// A row never holds an explicit `null` (decision "Nullable columns and the set form"); a JSON `null` is a value.
|
|
479
|
+
throw invalid("args", `${table.name}: ${where}: null is no ${column.type} value (undefined clears)`);
|
|
480
|
+
}
|
|
481
|
+
else if (value instanceof Expression) {
|
|
482
|
+
if (column.type === "json" || column.host !== undefined)
|
|
483
|
+
throw invalid("args", `${table.name}: ${where}: ${column.type === "json" ? "json" : "host"}(...) columns take plain values`);
|
|
484
|
+
const compiled = compileExpr(table, value, column.type, where);
|
|
485
|
+
if (compiled.nullable && !column.optional) {
|
|
486
|
+
throw invalid("args", `${table.name}: ${where}: the expression may be NULL; the column is not opt(...)`);
|
|
487
|
+
}
|
|
488
|
+
node[name] = compiled.node;
|
|
489
|
+
}
|
|
490
|
+
else if (column.type === "json") {
|
|
491
|
+
node[name] = { json: encodeCell(column, value, `${table.name}: ${where}`).stored };
|
|
492
|
+
}
|
|
493
|
+
else
|
|
494
|
+
node[name] = encodeCell(column, value, `${table.name}: ${where}`).stored;
|
|
495
|
+
}
|
|
496
|
+
return node;
|
|
497
|
+
}
|
|
498
|
+
function compileExpr(table, value, type, what) {
|
|
499
|
+
if (!(value instanceof Expression)) {
|
|
500
|
+
if (value === undefined || value === null)
|
|
501
|
+
return { node: null, nullable: true };
|
|
502
|
+
return { node: checkScalar(type, value, `${table.name}: ${what}`), nullable: false };
|
|
503
|
+
}
|
|
504
|
+
const { op, args } = value;
|
|
505
|
+
const refuse = (message) => {
|
|
506
|
+
throw invalid("args", `${table.name}: ${what}: ${message}`);
|
|
507
|
+
};
|
|
508
|
+
switch (op) {
|
|
509
|
+
case "col": {
|
|
510
|
+
const column = table.byName.get(args[0]) ?? refuse(`no column "${String(args[0])}"`);
|
|
511
|
+
if (column.type !== type)
|
|
512
|
+
refuse(`column "${column.name}" is ${column.type}, not ${type}`);
|
|
513
|
+
if (column.type === "str" && column.host !== undefined)
|
|
514
|
+
refuse(`host(...) column "${column.name}" holds addresses`);
|
|
515
|
+
return { node: { col: column.name }, nullable: column.optional };
|
|
516
|
+
}
|
|
517
|
+
case "add":
|
|
518
|
+
case "sub":
|
|
519
|
+
case "max":
|
|
520
|
+
case "min":
|
|
521
|
+
case "concat": {
|
|
522
|
+
const types = op === "concat" ? ["str"] : op === "add" || op === "sub" ? ["int"] : ["int", "num"];
|
|
523
|
+
if (!types.includes(type))
|
|
524
|
+
refuse(`${op} gives ${types.join(" or ")}, the column is ${type}`);
|
|
525
|
+
const [a, b] = [compileExpr(table, args[0], type, what), compileExpr(table, args[1], type, what)];
|
|
526
|
+
// The operation's shape is `{ [op]: [a, b] }`.
|
|
527
|
+
return { node: { [op]: [a.node, b.node] }, nullable: a.nullable || b.nullable };
|
|
528
|
+
}
|
|
529
|
+
case "coalesce": {
|
|
530
|
+
const [a, b] = [compileExpr(table, args[0], type, what), compileExpr(table, args[1], type, what)];
|
|
531
|
+
return { node: { coalesce: [a.node, b.node] }, nullable: a.nullable && b.nullable };
|
|
532
|
+
}
|
|
533
|
+
case "replacePrefix": {
|
|
534
|
+
if (type !== "str")
|
|
535
|
+
refuse(`replacePrefix gives str, the column is ${type}`);
|
|
536
|
+
const subject = compileExpr(table, args[0], type, what);
|
|
537
|
+
const [from, to] = [args[1], args[2]].map((each) => checkScalar("str", each, `${table.name}: ${what}`));
|
|
538
|
+
return { node: { replacePrefix: [subject.node, from, to] }, nullable: subject.nullable };
|
|
539
|
+
}
|
|
540
|
+
case "when": {
|
|
541
|
+
const condition = compileWhere(table, args[0], what);
|
|
542
|
+
const [a, b] = [compileExpr(table, args[1], type, what), compileExpr(table, args[2], type, what)];
|
|
543
|
+
return { node: { when: [condition, a.node, b.node] }, nullable: a.nullable || b.nullable };
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
/** The column a condition compares: a reference to a known scalar column of `scope`. */
|
|
548
|
+
function scalarColumn(scope, ref, what) {
|
|
549
|
+
if (!(ref instanceof ColumnRef))
|
|
550
|
+
throw invalid("args", `${scope.name}: ${what}: expected a column reference`);
|
|
551
|
+
const resolved = scope.resolve(ref);
|
|
552
|
+
if (resolved === undefined)
|
|
553
|
+
throw invalid("args", `${scope.name}: ${what}: no column "${ref.column}"`);
|
|
554
|
+
if (resolved.column.type === "json")
|
|
555
|
+
throw invalid("args", `${scope.name}: ${what}: json(...) column "${ref.column}" is not queryable`);
|
|
556
|
+
return resolved;
|
|
557
|
+
}
|
|
558
|
+
/** `resolved` for a comparison by order, `isNull` or `prefix`: a `host(...)` column compares only with eq, ne, inArray. */
|
|
559
|
+
function ordered(scope, resolved, op, what) {
|
|
560
|
+
const { column } = resolved;
|
|
561
|
+
if (column.type === "str" && column.host !== undefined) {
|
|
562
|
+
throw invalid("args", `${scope.name}: ${what}: ${op} on host(...) column "${column.name}" (eq, ne, inArray only)`);
|
|
563
|
+
}
|
|
564
|
+
return resolved;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* An operand compared with `column`, made storable (an address as its key for a `host(...)` column); `undefined` and
|
|
568
|
+
* `null` are refused (rule 16).
|
|
569
|
+
*/
|
|
570
|
+
function operand(column, value, what) {
|
|
571
|
+
if (value === undefined || value === null) {
|
|
572
|
+
throw invalid("args", `${what}: column "${column.name}" compared with ${String(value)}; ask with isNull`);
|
|
573
|
+
}
|
|
574
|
+
// `scalarColumn` refused json columns.
|
|
575
|
+
return encodeCell(column, value, `${what}: column "${column.name}"`).stored;
|
|
576
|
+
}
|
|
577
|
+
//# sourceMappingURL=expression.js.map
|