@earendil-works/chord 1.4.0 → 1.5.0
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 +41 -0
- package/README.md +79 -14
- package/dist/cell.d.ts +7 -7
- package/dist/cell.d.ts.map +1 -1
- package/dist/cell.js.map +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/contract.d.ts +51 -52
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +19 -24
- package/dist/contract.js.map +1 -1
- package/dist/delta/apply-immutable-trusted.js +3 -4
- package/dist/delta/apply-immutable-trusted.js.map +1 -1
- package/dist/delta/diff.d.ts.map +1 -1
- package/dist/delta/diff.js +5 -3
- package/dist/delta/diff.js.map +1 -1
- package/dist/delta/index.d.ts +9 -1
- package/dist/delta/index.d.ts.map +1 -1
- package/dist/delta/index.js +15 -11
- package/dist/delta/index.js.map +1 -1
- 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/tracker.d.ts +12 -0
- package/dist/delta/tracker.d.ts.map +1 -1
- package/dist/delta/tracker.js +109 -39
- package/dist/delta/tracker.js.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +9 -7
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/next/contracts/accepts.d.ts +81 -0
- package/dist/next/contracts/accepts.d.ts.map +1 -0
- package/dist/next/contracts/accepts.js +123 -0
- package/dist/next/contracts/accepts.js.map +1 -0
- package/dist/next/contracts/contract.d.ts +121 -0
- package/dist/next/contracts/contract.d.ts.map +1 -0
- package/dist/next/contracts/contract.js +50 -0
- package/dist/next/contracts/contract.js.map +1 -0
- package/dist/next/contracts/declare.d.ts +107 -0
- package/dist/next/contracts/declare.d.ts.map +1 -0
- package/dist/next/contracts/declare.js +136 -0
- package/dist/next/contracts/declare.js.map +1 -0
- package/dist/next/contracts/evolve.d.ts +92 -0
- package/dist/next/contracts/evolve.d.ts.map +1 -0
- package/dist/next/contracts/evolve.js +179 -0
- package/dist/next/contracts/evolve.js.map +1 -0
- package/dist/next/contracts/fingerprint.d.ts +16 -0
- package/dist/next/contracts/fingerprint.d.ts.map +1 -0
- package/dist/next/contracts/fingerprint.js +50 -0
- package/dist/next/contracts/fingerprint.js.map +1 -0
- package/dist/next/contracts/history.d.ts +71 -0
- package/dist/next/contracts/history.d.ts.map +1 -0
- package/dist/next/contracts/history.js +3 -0
- package/dist/next/contracts/history.js.map +1 -0
- package/dist/next/contracts/host-kind.d.ts +40 -0
- package/dist/next/contracts/host-kind.d.ts.map +1 -0
- package/dist/next/contracts/host-kind.js +37 -0
- package/dist/next/contracts/host-kind.js.map +1 -0
- package/dist/next/contracts/index.d.ts +7 -0
- package/dist/next/contracts/index.d.ts.map +1 -0
- package/dist/next/contracts/index.js +6 -0
- package/dist/next/contracts/index.js.map +1 -0
- package/dist/next/contracts/internal.d.ts +10 -0
- package/dist/next/contracts/internal.d.ts.map +1 -0
- package/dist/next/contracts/internal.js +9 -0
- package/dist/next/contracts/internal.js.map +1 -0
- package/dist/next/contracts/names.d.ts +3 -0
- package/dist/next/contracts/names.d.ts.map +1 -0
- package/dist/next/contracts/names.js +13 -0
- package/dist/next/contracts/names.js.map +1 -0
- package/dist/next/contracts/params.d.ts +28 -0
- package/dist/next/contracts/params.d.ts.map +1 -0
- package/dist/next/contracts/params.js +50 -0
- package/dist/next/contracts/params.js.map +1 -0
- package/dist/next/contracts/schema.d.ts +102 -0
- package/dist/next/contracts/schema.d.ts.map +1 -0
- package/dist/next/contracts/schema.js +103 -0
- package/dist/next/contracts/schema.js.map +1 -0
- package/dist/next/contracts/snapshot.d.ts +16 -0
- package/dist/next/contracts/snapshot.d.ts.map +1 -0
- package/dist/next/contracts/snapshot.js +167 -0
- package/dist/next/contracts/snapshot.js.map +1 -0
- package/dist/next/data/args.d.ts +50 -0
- package/dist/next/data/args.d.ts.map +1 -0
- package/dist/next/data/args.js +83 -0
- package/dist/next/data/args.js.map +1 -0
- package/dist/next/data/errors.d.ts +73 -0
- package/dist/next/data/errors.d.ts.map +1 -0
- package/dist/next/data/errors.js +107 -0
- package/dist/next/data/errors.js.map +1 -0
- package/dist/next/data/failure.d.ts +26 -0
- package/dist/next/data/failure.d.ts.map +1 -0
- package/dist/next/data/failure.js +72 -0
- package/dist/next/data/failure.js.map +1 -0
- package/dist/next/data/index.d.ts +4 -0
- package/dist/next/data/index.d.ts.map +1 -0
- package/dist/next/data/index.js +4 -0
- package/dist/next/data/index.js.map +1 -0
- package/dist/next/data/internal.d.ts +7 -0
- package/dist/next/data/internal.d.ts.map +1 -0
- package/dist/next/data/internal.js +8 -0
- package/dist/next/data/internal.js.map +1 -0
- package/dist/next/data/params.d.ts +20 -0
- package/dist/next/data/params.d.ts.map +1 -0
- package/dist/next/data/params.js +31 -0
- package/dist/next/data/params.js.map +1 -0
- package/dist/next/data/principal.d.ts +17 -0
- package/dist/next/data/principal.d.ts.map +1 -0
- package/dist/next/data/principal.js +41 -0
- package/dist/next/data/principal.js.map +1 -0
- package/dist/next/data/validator.d.ts +12 -0
- package/dist/next/data/validator.d.ts.map +1 -0
- package/dist/next/data/validator.js +34 -0
- package/dist/next/data/validator.js.map +1 -0
- package/dist/next/documents/address-source.d.ts +20 -0
- package/dist/next/documents/address-source.d.ts.map +1 -0
- package/dist/next/documents/address-source.js +44 -0
- package/dist/next/documents/address-source.js.map +1 -0
- package/dist/next/documents/definition.d.ts +84 -0
- package/dist/next/documents/definition.d.ts.map +1 -0
- package/dist/next/documents/definition.js +73 -0
- package/dist/next/documents/definition.js.map +1 -0
- package/dist/next/documents/documents.d.ts +106 -0
- package/dist/next/documents/documents.d.ts.map +1 -0
- package/dist/next/documents/documents.js +224 -0
- package/dist/next/documents/documents.js.map +1 -0
- package/dist/next/documents/fence.d.ts +9 -0
- package/dist/next/documents/fence.d.ts.map +1 -0
- package/dist/next/documents/fence.js +15 -0
- package/dist/next/documents/fence.js.map +1 -0
- package/dist/next/documents/handles.d.ts +76 -0
- package/dist/next/documents/handles.d.ts.map +1 -0
- package/dist/next/documents/handles.js +66 -0
- package/dist/next/documents/handles.js.map +1 -0
- package/dist/next/documents/index.d.ts +4 -0
- package/dist/next/documents/index.d.ts.map +1 -0
- package/dist/next/documents/index.js +3 -0
- package/dist/next/documents/index.js.map +1 -0
- package/dist/next/documents/internal.d.ts +9 -0
- package/dist/next/documents/internal.d.ts.map +1 -0
- package/dist/next/documents/internal.js +9 -0
- package/dist/next/documents/internal.js.map +1 -0
- package/dist/next/documents/keyed-slot.d.ts +103 -0
- package/dist/next/documents/keyed-slot.d.ts.map +1 -0
- package/dist/next/documents/keyed-slot.js +395 -0
- package/dist/next/documents/keyed-slot.js.map +1 -0
- package/dist/next/documents/line.d.ts +7 -0
- package/dist/next/documents/line.d.ts.map +1 -0
- package/dist/next/documents/line.js +14 -0
- package/dist/next/documents/line.js.map +1 -0
- package/dist/next/documents/persistence.d.ts +104 -0
- package/dist/next/documents/persistence.d.ts.map +1 -0
- package/dist/next/documents/persistence.js +128 -0
- package/dist/next/documents/persistence.js.map +1 -0
- package/dist/next/documents/residency.d.ts +31 -0
- package/dist/next/documents/residency.d.ts.map +1 -0
- package/dist/next/documents/residency.js +93 -0
- package/dist/next/documents/residency.js.map +1 -0
- package/dist/next/documents/slot.d.ts +109 -0
- package/dist/next/documents/slot.d.ts.map +1 -0
- package/dist/next/documents/slot.js +181 -0
- package/dist/next/documents/slot.js.map +1 -0
- package/dist/next/documents/transaction.d.ts +133 -0
- package/dist/next/documents/transaction.d.ts.map +1 -0
- package/dist/next/documents/transaction.js +409 -0
- package/dist/next/documents/transaction.js.map +1 -0
- package/dist/next/host/activity.d.ts +31 -0
- package/dist/next/host/activity.d.ts.map +1 -0
- package/dist/next/host/activity.js +40 -0
- package/dist/next/host/activity.js.map +1 -0
- package/dist/next/host/adapted.d.ts +49 -0
- package/dist/next/host/adapted.d.ts.map +1 -0
- package/dist/next/host/adapted.js +214 -0
- package/dist/next/host/adapted.js.map +1 -0
- package/dist/next/host/attempt.d.ts +278 -0
- package/dist/next/host/attempt.d.ts.map +1 -0
- package/dist/next/host/attempt.js +1072 -0
- package/dist/next/host/attempt.js.map +1 -0
- package/dist/next/host/backoff.d.ts +29 -0
- package/dist/next/host/backoff.d.ts.map +1 -0
- package/dist/next/host/backoff.js +69 -0
- package/dist/next/host/backoff.js.map +1 -0
- package/dist/next/host/ctx.d.ts +47 -0
- package/dist/next/host/ctx.d.ts.map +1 -0
- package/dist/next/host/ctx.js +108 -0
- package/dist/next/host/ctx.js.map +1 -0
- package/dist/next/host/deadline.d.ts +12 -0
- package/dist/next/host/deadline.d.ts.map +1 -0
- package/dist/next/host/deadline.js +40 -0
- package/dist/next/host/deadline.js.map +1 -0
- package/dist/next/host/dependencies.d.ts +65 -0
- package/dist/next/host/dependencies.d.ts.map +1 -0
- package/dist/next/host/dependencies.js +115 -0
- package/dist/next/host/dependencies.js.map +1 -0
- package/dist/next/host/destination.d.ts +48 -0
- package/dist/next/host/destination.d.ts.map +1 -0
- package/dist/next/host/destination.js +101 -0
- package/dist/next/host/destination.js.map +1 -0
- package/dist/next/host/facet.d.ts +79 -0
- package/dist/next/host/facet.d.ts.map +1 -0
- package/dist/next/host/facet.js +55 -0
- package/dist/next/host/facet.js.map +1 -0
- package/dist/next/host/follow.d.ts +52 -0
- package/dist/next/host/follow.d.ts.map +1 -0
- package/dist/next/host/follow.js +207 -0
- package/dist/next/host/follow.js.map +1 -0
- package/dist/next/host/host.d.ts +495 -0
- package/dist/next/host/host.d.ts.map +1 -0
- package/dist/next/host/host.js +1075 -0
- package/dist/next/host/host.js.map +1 -0
- package/dist/next/host/index.d.ts +17 -0
- package/dist/next/host/index.d.ts.map +1 -0
- package/dist/next/host/index.js +6 -0
- package/dist/next/host/index.js.map +1 -0
- package/dist/next/host/internal.d.ts +10 -0
- package/dist/next/host/internal.d.ts.map +1 -0
- package/dist/next/host/internal.js +8 -0
- package/dist/next/host/internal.js.map +1 -0
- package/dist/next/host/members.d.ts +50 -0
- package/dist/next/host/members.d.ts.map +1 -0
- package/dist/next/host/members.js +107 -0
- package/dist/next/host/members.js.map +1 -0
- package/dist/next/host/native.d.ts +55 -0
- package/dist/next/host/native.d.ts.map +1 -0
- package/dist/next/host/native.js +92 -0
- package/dist/next/host/native.js.map +1 -0
- package/dist/next/host/object.d.ts +290 -0
- package/dist/next/host/object.d.ts.map +1 -0
- package/dist/next/host/object.js +1127 -0
- package/dist/next/host/object.js.map +1 -0
- package/dist/next/host/parked.d.ts +23 -0
- package/dist/next/host/parked.d.ts.map +1 -0
- package/dist/next/host/parked.js +79 -0
- package/dist/next/host/parked.js.map +1 -0
- package/dist/next/host/presence.d.ts +34 -0
- package/dist/next/host/presence.d.ts.map +1 -0
- package/dist/next/host/presence.js +117 -0
- package/dist/next/host/presence.js.map +1 -0
- package/dist/next/host/ref-state.d.ts +53 -0
- package/dist/next/host/ref-state.d.ts.map +1 -0
- package/dist/next/host/ref-state.js +83 -0
- package/dist/next/host/ref-state.js.map +1 -0
- package/dist/next/host/reference-keys.d.ts +36 -0
- package/dist/next/host/reference-keys.d.ts.map +1 -0
- package/dist/next/host/reference-keys.js +168 -0
- package/dist/next/host/reference-keys.js.map +1 -0
- package/dist/next/host/reference-source.d.ts +65 -0
- package/dist/next/host/reference-source.d.ts.map +1 -0
- package/dist/next/host/reference-source.js +285 -0
- package/dist/next/host/reference-source.js.map +1 -0
- package/dist/next/host/reference.d.ts +308 -0
- package/dist/next/host/reference.d.ts.map +1 -0
- package/dist/next/host/reference.js +775 -0
- package/dist/next/host/reference.js.map +1 -0
- package/dist/next/host/retry-on.d.ts +28 -0
- package/dist/next/host/retry-on.d.ts.map +1 -0
- package/dist/next/host/retry-on.js +52 -0
- package/dist/next/host/retry-on.js.map +1 -0
- package/dist/next/host/revocation.d.ts +16 -0
- package/dist/next/host/revocation.d.ts.map +1 -0
- package/dist/next/host/revocation.js +27 -0
- package/dist/next/host/revocation.js.map +1 -0
- package/dist/next/host/root.d.ts +27 -0
- package/dist/next/host/root.d.ts.map +1 -0
- package/dist/next/host/root.js +68 -0
- package/dist/next/host/root.js.map +1 -0
- package/dist/next/host/route.d.ts +64 -0
- package/dist/next/host/route.d.ts.map +1 -0
- package/dist/next/host/route.js +190 -0
- package/dist/next/host/route.js.map +1 -0
- package/dist/next/host/routines.d.ts +76 -0
- package/dist/next/host/routines.d.ts.map +1 -0
- package/dist/next/host/routines.js +350 -0
- package/dist/next/host/routines.js.map +1 -0
- package/dist/next/host/sleep.d.ts +9 -0
- package/dist/next/host/sleep.d.ts.map +1 -0
- package/dist/next/host/sleep.js +40 -0
- package/dist/next/host/sleep.js.map +1 -0
- package/dist/next/host/staging.d.ts +94 -0
- package/dist/next/host/staging.d.ts.map +1 -0
- package/dist/next/host/staging.js +302 -0
- package/dist/next/host/staging.js.map +1 -0
- package/dist/next/host/unbound.d.ts +30 -0
- package/dist/next/host/unbound.d.ts.map +1 -0
- package/dist/next/host/unbound.js +67 -0
- package/dist/next/host/unbound.js.map +1 -0
- package/dist/next/host/uuid.d.ts +3 -0
- package/dist/next/host/uuid.d.ts.map +1 -0
- package/dist/next/host/uuid.js +38 -0
- package/dist/next/host/uuid.js.map +1 -0
- package/dist/next/index.d.ts +28 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +18 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/jobs/definition.d.ts +96 -0
- package/dist/next/jobs/definition.d.ts.map +1 -0
- package/dist/next/jobs/definition.js +83 -0
- package/dist/next/jobs/definition.js.map +1 -0
- package/dist/next/jobs/index.d.ts +5 -0
- package/dist/next/jobs/index.d.ts.map +1 -0
- package/dist/next/jobs/index.js +3 -0
- package/dist/next/jobs/index.js.map +1 -0
- package/dist/next/jobs/internal.d.ts +3 -0
- package/dist/next/jobs/internal.d.ts.map +1 -0
- package/dist/next/jobs/internal.js +4 -0
- package/dist/next/jobs/internal.js.map +1 -0
- package/dist/next/jobs/job.d.ts +152 -0
- package/dist/next/jobs/job.d.ts.map +1 -0
- package/dist/next/jobs/job.js +320 -0
- package/dist/next/jobs/job.js.map +1 -0
- package/dist/next/jobs/persisted.d.ts +38 -0
- package/dist/next/jobs/persisted.d.ts.map +1 -0
- package/dist/next/jobs/persisted.js +95 -0
- package/dist/next/jobs/persisted.js.map +1 -0
- package/dist/next/jobs/records.d.ts +231 -0
- package/dist/next/jobs/records.d.ts.map +1 -0
- package/dist/next/jobs/records.js +869 -0
- package/dist/next/jobs/records.js.map +1 -0
- package/dist/next/jobs/run-states.d.ts +69 -0
- package/dist/next/jobs/run-states.d.ts.map +1 -0
- package/dist/next/jobs/run-states.js +228 -0
- package/dist/next/jobs/run-states.js.map +1 -0
- package/dist/next/jobs/run.d.ts +113 -0
- package/dist/next/jobs/run.d.ts.map +1 -0
- package/dist/next/jobs/run.js +200 -0
- package/dist/next/jobs/run.js.map +1 -0
- package/dist/next/jobs/running.d.ts +44 -0
- package/dist/next/jobs/running.d.ts.map +1 -0
- package/dist/next/jobs/running.js +117 -0
- package/dist/next/jobs/running.js.map +1 -0
- package/dist/next/jobs/stored.d.ts +63 -0
- package/dist/next/jobs/stored.d.ts.map +1 -0
- package/dist/next/jobs/stored.js +55 -0
- package/dist/next/jobs/stored.js.map +1 -0
- package/dist/next/link/binary.d.ts +4 -0
- package/dist/next/link/binary.d.ts.map +1 -0
- package/dist/next/link/binary.js +534 -0
- package/dist/next/link/binary.js.map +1 -0
- package/dist/next/link/channel.d.ts +63 -0
- package/dist/next/link/channel.d.ts.map +1 -0
- package/dist/next/link/channel.js +202 -0
- package/dist/next/link/channel.js.map +1 -0
- package/dist/next/link/errors.d.ts +7 -0
- package/dist/next/link/errors.d.ts.map +1 -0
- package/dist/next/link/errors.js +21 -0
- package/dist/next/link/errors.js.map +1 -0
- package/dist/next/link/index.d.ts +8 -0
- package/dist/next/link/index.d.ts.map +1 -0
- package/dist/next/link/index.js +8 -0
- package/dist/next/link/index.js.map +1 -0
- package/dist/next/link/internal.d.ts +9 -0
- package/dist/next/link/internal.d.ts.map +1 -0
- package/dist/next/link/internal.js +10 -0
- package/dist/next/link/internal.js.map +1 -0
- package/dist/next/link/ipc.d.ts +22 -0
- package/dist/next/link/ipc.d.ts.map +1 -0
- package/dist/next/link/ipc.js +64 -0
- package/dist/next/link/ipc.js.map +1 -0
- package/dist/next/link/link.d.ts +34 -0
- package/dist/next/link/link.d.ts.map +1 -0
- package/dist/next/link/link.js +87 -0
- package/dist/next/link/link.js.map +1 -0
- package/dist/next/link/message.d.ts +249 -0
- package/dist/next/link/message.d.ts.map +1 -0
- package/dist/next/link/message.js +123 -0
- package/dist/next/link/message.js.map +1 -0
- package/dist/next/link/part.d.ts +80 -0
- package/dist/next/link/part.d.ts.map +1 -0
- package/dist/next/link/part.js +164 -0
- package/dist/next/link/part.js.map +1 -0
- package/dist/next/link/text.d.ts +6 -0
- package/dist/next/link/text.d.ts.map +1 -0
- package/dist/next/link/text.js +335 -0
- package/dist/next/link/text.js.map +1 -0
- package/dist/next/link/values.d.ts +40 -0
- package/dist/next/link/values.d.ts.map +1 -0
- package/dist/next/link/values.js +117 -0
- package/dist/next/link/values.js.map +1 -0
- package/dist/next/link/websocket.d.ts +26 -0
- package/dist/next/link/websocket.d.ts.map +1 -0
- package/dist/next/link/websocket.js +91 -0
- package/dist/next/link/websocket.js.map +1 -0
- package/dist/next/registries/contribution.d.ts +50 -0
- package/dist/next/registries/contribution.d.ts.map +1 -0
- package/dist/next/registries/contribution.js +129 -0
- package/dist/next/registries/contribution.js.map +1 -0
- package/dist/next/registries/entries.d.ts +18 -0
- package/dist/next/registries/entries.d.ts.map +1 -0
- package/dist/next/registries/entries.js +42 -0
- package/dist/next/registries/entries.js.map +1 -0
- package/dist/next/registries/index.d.ts +3 -0
- package/dist/next/registries/index.d.ts.map +1 -0
- package/dist/next/registries/index.js +5 -0
- package/dist/next/registries/index.js.map +1 -0
- package/dist/next/registries/internal.d.ts +4 -0
- package/dist/next/registries/internal.d.ts.map +1 -0
- package/dist/next/registries/internal.js +5 -0
- package/dist/next/registries/internal.js.map +1 -0
- package/dist/next/registries/record.d.ts +94 -0
- package/dist/next/registries/record.d.ts.map +1 -0
- package/dist/next/registries/record.js +253 -0
- package/dist/next/registries/record.js.map +1 -0
- package/dist/next/registries/registry.d.ts +74 -0
- package/dist/next/registries/registry.d.ts.map +1 -0
- package/dist/next/registries/registry.js +14 -0
- package/dist/next/registries/registry.js.map +1 -0
- package/dist/next/registries/value.d.ts +48 -0
- package/dist/next/registries/value.d.ts.map +1 -0
- package/dist/next/registries/value.js +199 -0
- package/dist/next/registries/value.js.map +1 -0
- package/dist/next/remote/calls.d.ts +25 -0
- package/dist/next/remote/calls.d.ts.map +1 -0
- package/dist/next/remote/calls.js +62 -0
- package/dist/next/remote/calls.js.map +1 -0
- package/dist/next/remote/consumer.d.ts +42 -0
- package/dist/next/remote/consumer.d.ts.map +1 -0
- package/dist/next/remote/consumer.js +343 -0
- package/dist/next/remote/consumer.js.map +1 -0
- package/dist/next/remote/hold.d.ts +130 -0
- package/dist/next/remote/hold.d.ts.map +1 -0
- package/dist/next/remote/hold.js +537 -0
- package/dist/next/remote/hold.js.map +1 -0
- package/dist/next/remote/host-link.d.ts +77 -0
- package/dist/next/remote/host-link.d.ts.map +1 -0
- package/dist/next/remote/host-link.js +182 -0
- package/dist/next/remote/host-link.js.map +1 -0
- package/dist/next/remote/internal.d.ts +6 -0
- package/dist/next/remote/internal.d.ts.map +1 -0
- package/dist/next/remote/internal.js +6 -0
- package/dist/next/remote/internal.js.map +1 -0
- package/dist/next/remote/path.d.ts +46 -0
- package/dist/next/remote/path.d.ts.map +1 -0
- package/dist/next/remote/path.js +73 -0
- package/dist/next/remote/path.js.map +1 -0
- package/dist/next/remote/provider.d.ts +76 -0
- package/dist/next/remote/provider.d.ts.map +1 -0
- package/dist/next/remote/provider.js +506 -0
- package/dist/next/remote/provider.js.map +1 -0
- package/dist/next/remote/relay.d.ts +58 -0
- package/dist/next/remote/relay.d.ts.map +1 -0
- package/dist/next/remote/relay.js +117 -0
- package/dist/next/remote/relay.js.map +1 -0
- package/dist/next/remote/remote-object.d.ts +133 -0
- package/dist/next/remote/remote-object.d.ts.map +1 -0
- package/dist/next/remote/remote-object.js +411 -0
- package/dist/next/remote/remote-object.js.map +1 -0
- package/dist/next/remote/replica.d.ts +59 -0
- package/dist/next/remote/replica.d.ts.map +1 -0
- package/dist/next/remote/replica.js +125 -0
- package/dist/next/remote/replica.js.map +1 -0
- package/dist/next/state/batch.d.ts +64 -0
- package/dist/next/state/batch.d.ts.map +1 -0
- package/dist/next/state/batch.js +163 -0
- package/dist/next/state/batch.js.map +1 -0
- package/dist/next/state/derive.d.ts +52 -0
- package/dist/next/state/derive.d.ts.map +1 -0
- package/dist/next/state/derive.js +182 -0
- package/dist/next/state/derive.js.map +1 -0
- package/dist/next/state/index.d.ts +6 -0
- package/dist/next/state/index.d.ts.map +1 -0
- package/dist/next/state/index.js +4 -0
- package/dist/next/state/index.js.map +1 -0
- package/dist/next/state/internal.d.ts +6 -0
- package/dist/next/state/internal.d.ts.map +1 -0
- package/dist/next/state/internal.js +8 -0
- package/dist/next/state/internal.js.map +1 -0
- package/dist/next/state/native-source.d.ts +106 -0
- package/dist/next/state/native-source.d.ts.map +1 -0
- package/dist/next/state/native-source.js +240 -0
- package/dist/next/state/native-source.js.map +1 -0
- package/dist/next/state/watchable.d.ts +114 -0
- package/dist/next/state/watchable.d.ts.map +1 -0
- package/dist/next/state/watchable.js +156 -0
- package/dist/next/state/watchable.js.map +1 -0
- package/dist/next/state/writable.d.ts +32 -0
- package/dist/next/state/writable.d.ts.map +1 -0
- package/dist/next/state/writable.js +49 -0
- package/dist/next/state/writable.js.map +1 -0
- package/dist/next/store/adapter.d.ts +67 -0
- package/dist/next/store/adapter.d.ts.map +1 -0
- package/dist/next/store/adapter.js +118 -0
- package/dist/next/store/adapter.js.map +1 -0
- package/dist/next/store/allocator.d.ts +17 -0
- package/dist/next/store/allocator.d.ts.map +1 -0
- package/dist/next/store/allocator.js +30 -0
- package/dist/next/store/allocator.js.map +1 -0
- package/dist/next/store/applier.d.ts +8 -0
- package/dist/next/store/applier.d.ts.map +1 -0
- package/dist/next/store/applier.js +375 -0
- package/dist/next/store/applier.js.map +1 -0
- package/dist/next/store/apply-batch.d.ts +12 -0
- package/dist/next/store/apply-batch.d.ts.map +1 -0
- package/dist/next/store/apply-batch.js +83 -0
- package/dist/next/store/apply-batch.js.map +1 -0
- package/dist/next/store/archive.d.ts +32 -0
- package/dist/next/store/archive.d.ts.map +1 -0
- package/dist/next/store/archive.js +129 -0
- package/dist/next/store/archive.js.map +1 -0
- package/dist/next/store/backend.d.ts +10 -0
- package/dist/next/store/backend.d.ts.map +1 -0
- package/dist/next/store/backend.js +15 -0
- package/dist/next/store/backend.js.map +1 -0
- package/dist/next/store/catalog.d.ts +24 -0
- package/dist/next/store/catalog.d.ts.map +1 -0
- package/dist/next/store/catalog.js +17 -0
- package/dist/next/store/catalog.js.map +1 -0
- package/dist/next/store/claims.d.ts +23 -0
- package/dist/next/store/claims.d.ts.map +1 -0
- package/dist/next/store/claims.js +65 -0
- package/dist/next/store/claims.js.map +1 -0
- package/dist/next/store/columns.d.ts +77 -0
- package/dist/next/store/columns.d.ts.map +1 -0
- package/dist/next/store/columns.js +77 -0
- package/dist/next/store/columns.js.map +1 -0
- package/dist/next/store/engine.d.ts +176 -0
- package/dist/next/store/engine.d.ts.map +1 -0
- package/dist/next/store/engine.js +283 -0
- package/dist/next/store/engine.js.map +1 -0
- package/dist/next/store/evaluate.d.ts +17 -0
- package/dist/next/store/evaluate.d.ts.map +1 -0
- package/dist/next/store/evaluate.js +128 -0
- package/dist/next/store/evaluate.js.map +1 -0
- package/dist/next/store/export.d.ts +17 -0
- package/dist/next/store/export.d.ts.map +1 -0
- package/dist/next/store/export.js +200 -0
- package/dist/next/store/export.js.map +1 -0
- package/dist/next/store/expression.d.ts +150 -0
- package/dist/next/store/expression.d.ts.map +1 -0
- package/dist/next/store/expression.js +268 -0
- package/dist/next/store/expression.js.map +1 -0
- package/dist/next/store/import.d.ts +10 -0
- package/dist/next/store/import.d.ts.map +1 -0
- package/dist/next/store/import.js +276 -0
- package/dist/next/store/import.js.map +1 -0
- package/dist/next/store/index.d.ts +16 -0
- package/dist/next/store/index.d.ts.map +1 -0
- package/dist/next/store/index.js +13 -0
- package/dist/next/store/index.js.map +1 -0
- package/dist/next/store/json-column.d.ts +33 -0
- package/dist/next/store/json-column.d.ts.map +1 -0
- package/dist/next/store/json-column.js +61 -0
- package/dist/next/store/json-column.js.map +1 -0
- package/dist/next/store/jsonl.d.ts +9 -0
- package/dist/next/store/jsonl.d.ts.map +1 -0
- package/dist/next/store/jsonl.js +61 -0
- package/dist/next/store/jsonl.js.map +1 -0
- package/dist/next/store/outbox.d.ts +26 -0
- package/dist/next/store/outbox.d.ts.map +1 -0
- package/dist/next/store/outbox.js +80 -0
- package/dist/next/store/outbox.js.map +1 -0
- package/dist/next/store/query.d.ts +39 -0
- package/dist/next/store/query.d.ts.map +1 -0
- package/dist/next/store/query.js +97 -0
- package/dist/next/store/query.js.map +1 -0
- package/dist/next/store/refusal.d.ts +15 -0
- package/dist/next/store/refusal.d.ts.map +1 -0
- package/dist/next/store/refusal.js +36 -0
- package/dist/next/store/refusal.js.map +1 -0
- package/dist/next/store/rows.d.ts +80 -0
- package/dist/next/store/rows.d.ts.map +1 -0
- package/dist/next/store/rows.js +183 -0
- package/dist/next/store/rows.js.map +1 -0
- package/dist/next/store/schema.d.ts +25 -0
- package/dist/next/store/schema.d.ts.map +1 -0
- package/dist/next/store/schema.js +115 -0
- package/dist/next/store/schema.js.map +1 -0
- package/dist/next/store/sql.d.ts +73 -0
- package/dist/next/store/sql.d.ts.map +1 -0
- package/dist/next/store/sql.js +234 -0
- package/dist/next/store/sql.js.map +1 -0
- package/dist/next/store/step.d.ts +48 -0
- package/dist/next/store/step.d.ts.map +1 -0
- package/dist/next/store/step.js +50 -0
- package/dist/next/store/step.js.map +1 -0
- package/dist/next/store/store.d.ts +161 -0
- package/dist/next/store/store.d.ts.map +1 -0
- package/dist/next/store/store.js +627 -0
- package/dist/next/store/store.js.map +1 -0
- package/dist/next/store/table-changes.d.ts +29 -0
- package/dist/next/store/table-changes.d.ts.map +1 -0
- package/dist/next/store/table-changes.js +102 -0
- package/dist/next/store/table-changes.js.map +1 -0
- package/dist/next/store/table-evolve.d.ts +74 -0
- package/dist/next/store/table-evolve.d.ts.map +1 -0
- package/dist/next/store/table-evolve.js +201 -0
- package/dist/next/store/table-evolve.js.map +1 -0
- package/dist/next/store/table-handle.d.ts +67 -0
- package/dist/next/store/table-handle.d.ts.map +1 -0
- package/dist/next/store/table-handle.js +101 -0
- package/dist/next/store/table-handle.js.map +1 -0
- package/dist/next/store/table-history.d.ts +75 -0
- package/dist/next/store/table-history.d.ts.map +1 -0
- package/dist/next/store/table-history.js +42 -0
- package/dist/next/store/table-history.js.map +1 -0
- package/dist/next/store/table-migration.d.ts +16 -0
- package/dist/next/store/table-migration.d.ts.map +1 -0
- package/dist/next/store/table-migration.js +202 -0
- package/dist/next/store/table-migration.js.map +1 -0
- package/dist/next/store/table-writes.d.ts +125 -0
- package/dist/next/store/table-writes.d.ts.map +1 -0
- package/dist/next/store/table-writes.js +165 -0
- package/dist/next/store/table-writes.js.map +1 -0
- package/dist/next/store/table.d.ts +80 -0
- package/dist/next/store/table.d.ts.map +1 -0
- package/dist/next/store/table.js +103 -0
- package/dist/next/store/table.js.map +1 -0
- package/dist/next/store/text.d.ts +14 -0
- package/dist/next/store/text.d.ts.map +1 -0
- package/dist/next/store/text.js +51 -0
- package/dist/next/store/text.js.map +1 -0
- package/dist/next/store/writes.d.ts +5 -0
- package/dist/next/store/writes.d.ts.map +1 -0
- package/dist/next/store/writes.js +4 -0
- package/dist/next/store/writes.js.map +1 -0
- package/dist/next-node/compression.d.ts +7 -0
- package/dist/next-node/compression.d.ts.map +1 -0
- package/dist/next-node/compression.js +24 -0
- package/dist/next-node/compression.js.map +1 -0
- package/dist/next-node/http/admission.d.ts +63 -0
- package/dist/next-node/http/admission.d.ts.map +1 -0
- package/dist/next-node/http/admission.js +134 -0
- package/dist/next-node/http/admission.js.map +1 -0
- package/dist/next-node/http/authenticate.d.ts +21 -0
- package/dist/next-node/http/authenticate.d.ts.map +1 -0
- package/dist/next-node/http/authenticate.js +34 -0
- package/dist/next-node/http/authenticate.js.map +1 -0
- package/dist/next-node/http/cookies.d.ts +24 -0
- package/dist/next-node/http/cookies.d.ts.map +1 -0
- package/dist/next-node/http/cookies.js +62 -0
- package/dist/next-node/http/cookies.js.map +1 -0
- package/dist/next-node/http/file.d.ts +23 -0
- package/dist/next-node/http/file.d.ts.map +1 -0
- package/dist/next-node/http/file.js +94 -0
- package/dist/next-node/http/file.js.map +1 -0
- package/dist/next-node/http/headers.d.ts +37 -0
- package/dist/next-node/http/headers.d.ts.map +1 -0
- package/dist/next-node/http/headers.js +129 -0
- package/dist/next-node/http/headers.js.map +1 -0
- package/dist/next-node/http/http.d.ts +100 -0
- package/dist/next-node/http/http.d.ts.map +1 -0
- package/dist/next-node/http/http.js +462 -0
- package/dist/next-node/http/http.js.map +1 -0
- package/dist/next-node/http/incoming.d.ts +19 -0
- package/dist/next-node/http/incoming.d.ts.map +1 -0
- package/dist/next-node/http/incoming.js +31 -0
- package/dist/next-node/http/incoming.js.map +1 -0
- package/dist/next-node/http/index.d.ts +11 -0
- package/dist/next-node/http/index.d.ts.map +1 -0
- package/dist/next-node/http/index.js +12 -0
- package/dist/next-node/http/index.js.map +1 -0
- package/dist/next-node/http/node.d.ts +78 -0
- package/dist/next-node/http/node.d.ts.map +1 -0
- package/dist/next-node/http/node.js +291 -0
- package/dist/next-node/http/node.js.map +1 -0
- package/dist/next-node/http/request.d.ts +54 -0
- package/dist/next-node/http/request.d.ts.map +1 -0
- package/dist/next-node/http/request.js +116 -0
- package/dist/next-node/http/request.js.map +1 -0
- package/dist/next-node/http/response.d.ts +63 -0
- package/dist/next-node/http/response.d.ts.map +1 -0
- package/dist/next-node/http/response.js +202 -0
- package/dist/next-node/http/response.js.map +1 -0
- package/dist/next-node/http/router.d.ts +114 -0
- package/dist/next-node/http/router.d.ts.map +1 -0
- package/dist/next-node/http/router.js +261 -0
- package/dist/next-node/http/router.js.map +1 -0
- package/dist/next-node/http/upgrades.d.ts +58 -0
- package/dist/next-node/http/upgrades.d.ts.map +1 -0
- package/dist/next-node/http/upgrades.js +184 -0
- package/dist/next-node/http/upgrades.js.map +1 -0
- package/dist/next-node/plugins/build.d.ts +57 -0
- package/dist/next-node/plugins/build.d.ts.map +1 -0
- package/dist/next-node/plugins/build.js +334 -0
- package/dist/next-node/plugins/build.js.map +1 -0
- package/dist/next-node/plugins/discover.d.ts +36 -0
- package/dist/next-node/plugins/discover.d.ts.map +1 -0
- package/dist/next-node/plugins/discover.js +91 -0
- package/dist/next-node/plugins/discover.js.map +1 -0
- package/dist/next-node/plugins/evaluate.d.ts +33 -0
- package/dist/next-node/plugins/evaluate.d.ts.map +1 -0
- package/dist/next-node/plugins/evaluate.js +98 -0
- package/dist/next-node/plugins/evaluate.js.map +1 -0
- package/dist/next-node/plugins/index.d.ts +9 -0
- package/dist/next-node/plugins/index.d.ts.map +1 -0
- package/dist/next-node/plugins/index.js +11 -0
- package/dist/next-node/plugins/index.js.map +1 -0
- package/dist/next-node/plugins/install.d.ts +13 -0
- package/dist/next-node/plugins/install.d.ts.map +1 -0
- package/dist/next-node/plugins/install.js +37 -0
- package/dist/next-node/plugins/install.js.map +1 -0
- package/dist/next-node/plugins/plugins.d.ts +135 -0
- package/dist/next-node/plugins/plugins.d.ts.map +1 -0
- package/dist/next-node/plugins/plugins.js +206 -0
- package/dist/next-node/plugins/plugins.js.map +1 -0
- package/dist/next-node/plugins/runtime.d.ts +41 -0
- package/dist/next-node/plugins/runtime.d.ts.map +1 -0
- package/dist/next-node/plugins/runtime.js +136 -0
- package/dist/next-node/plugins/runtime.js.map +1 -0
- package/dist/next-node/plugins/stack.d.ts +16 -0
- package/dist/next-node/plugins/stack.d.ts.map +1 -0
- package/dist/next-node/plugins/stack.js +61 -0
- package/dist/next-node/plugins/stack.js.map +1 -0
- package/dist/next-node/plugins/watcher.d.ts +58 -0
- package/dist/next-node/plugins/watcher.d.ts.map +1 -0
- package/dist/next-node/plugins/watcher.js +281 -0
- package/dist/next-node/plugins/watcher.js.map +1 -0
- package/dist/next-node/workers/control.d.ts +83 -0
- package/dist/next-node/workers/control.d.ts.map +1 -0
- package/dist/next-node/workers/control.js +77 -0
- package/dist/next-node/workers/control.js.map +1 -0
- package/dist/next-node/workers/index.d.ts +5 -0
- package/dist/next-node/workers/index.d.ts.map +1 -0
- package/dist/next-node/workers/index.js +7 -0
- package/dist/next-node/workers/index.js.map +1 -0
- package/dist/next-node/workers/lock.d.ts +21 -0
- package/dist/next-node/workers/lock.d.ts.map +1 -0
- package/dist/next-node/workers/lock.js +137 -0
- package/dist/next-node/workers/lock.js.map +1 -0
- package/dist/next-node/workers/main.d.ts +46 -0
- package/dist/next-node/workers/main.d.ts.map +1 -0
- package/dist/next-node/workers/main.js +230 -0
- package/dist/next-node/workers/main.js.map +1 -0
- package/dist/next-node/workers/process.d.ts +42 -0
- package/dist/next-node/workers/process.d.ts.map +1 -0
- package/dist/next-node/workers/process.js +125 -0
- package/dist/next-node/workers/process.js.map +1 -0
- package/dist/next-node/workers/workers.d.ts +80 -0
- package/dist/next-node/workers/workers.d.ts.map +1 -0
- package/dist/next-node/workers/workers.js +572 -0
- package/dist/next-node/workers/workers.js.map +1 -0
- package/dist/object.d.ts +4 -4
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +3 -4
- package/dist/object.js.map +1 -1
- package/dist/output.d.ts +1 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +4 -2
- package/dist/output.js.map +1 -1
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +2 -2
- package/dist/remote.js.map +1 -1
- package/dist/schema.d.ts +8 -4
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +180 -5
- package/dist/schema.js.map +1 -1
- package/dist/sqlite/cloudflare.d.ts +2 -0
- package/dist/sqlite/cloudflare.d.ts.map +1 -1
- package/dist/sqlite/cloudflare.js +10 -0
- package/dist/sqlite/cloudflare.js.map +1 -1
- package/dist/sqlite/database.d.ts +5 -2
- package/dist/sqlite/database.d.ts.map +1 -1
- package/dist/sqlite/database.js.map +1 -1
- package/dist/sqlite/node.d.ts +4 -1
- package/dist/sqlite/node.d.ts.map +1 -1
- package/dist/sqlite/node.js +22 -5
- package/dist/sqlite/node.js.map +1 -1
- 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/wire.d.ts +174 -193
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +81 -80
- package/dist/wire.js.map +1 -1
- package/docs/guide.md +15 -15
- package/docs/next/benchmarks.md +959 -0
- package/docs/next/decisions.md +2957 -0
- package/docs/next/dependencies/book.md +1671 -0
- package/docs/next/dependencies/index.html +2641 -0
- package/docs/next/dependencies/model.md +330 -0
- package/docs/next/design.md +2554 -0
- package/docs/next/durable-observers/book.md +432 -0
- package/docs/next/durable-observers/index.html +517 -0
- package/docs/next/flow-control/book.md +333 -0
- package/docs/next/flow-control/fold/index.html +265 -0
- package/docs/next/flow-control/index.html +548 -0
- package/docs/next/flow-control/window/index.html +228 -0
- package/docs/next/guide-plugins-hosts/book.md +607 -0
- package/docs/next/guide-plugins-hosts/index.html +652 -0
- package/docs/next/http-workers/book.md +378 -0
- package/docs/next/http-workers/index.html +515 -0
- package/docs/next/layer-1.md +311 -0
- package/docs/next/layer-2.md +216 -0
- package/docs/next/plugin-model/book.md +186 -0
- package/docs/next/plugin-model/index.html +310 -0
- package/docs/next/plugin-primer/book.md +273 -0
- package/docs/next/plugin-primer/index.html +430 -0
- package/docs/next/slice-1.md +236 -0
- package/docs/next/slice-10.md +285 -0
- package/docs/next/slice-11.md +93 -0
- package/docs/next/slice-2.md +174 -0
- package/docs/next/slice-3a.md +296 -0
- package/docs/next/slice-3b.md +197 -0
- package/docs/next/slice-4.md +146 -0
- package/docs/next/slice-4a.md +418 -0
- package/docs/next/slice-4b.md +208 -0
- package/docs/next/slice-5.md +281 -0
- package/docs/next/slice-6a.md +676 -0
- package/docs/next/slice-6b.md +332 -0
- package/docs/next/slice-7a.md +130 -0
- package/docs/next/slice-7b/book.md +608 -0
- package/docs/next/slice-7b/index.html +842 -0
- package/docs/next/slice-7b.md +255 -0
- package/docs/next/slice-7c.md +165 -0
- package/docs/next/slice-8.md +194 -0
- package/docs/next/slices.md +230 -0
- package/docs/next/store/book.md +665 -0
- package/docs/next/store/index.html +861 -0
- package/docs/next/store/walkthrough.md +193 -0
- package/docs/spec.md +9 -9
- package/docs/tutorial.md +26 -25
- package/package.json +22 -6
- package/src/delta/README.md +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/next-node/http/request.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,qHAAqH;AACrH,kEAAkE;AA4BlE,+GAA+G;AAC/G,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC5B,MAAM,CAAS;IAExB,YAAY,MAAc,EAAE,OAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAED,wEAAwE;AACxE,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC;AAElC,wDAAwD;AACxD,MAAM,SAAS,GAAqC,EAAE,CAAC;AAEvD,4GAA4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KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;KAC/D,CAAC;AACH,CAAC","sourcesContent":["// Requests (slice 10 §2, D4): what a route, a wrap, a socket handler and an authenticator see of an HTTP request (a\n// Web `Request` once admitted), and its body, read only when asked: `json(limit?)` (1 MiB by default, malformed 400,\n// too large 413) and `body(limit?)`, an async iterable of chunks.\n\nimport type { JsonValue } from \"../../json.ts\";\nimport type { Provenance } from \"./admission.ts\";\nimport type { Incoming } from \"./incoming.ts\";\n\n/** A request as routes see it, once admitted: `origin` and `provenance` come only from admission. */\nexport interface HttpRequest {\n\treadonly method: string;\n\t/** The path, without the query, percent-encoded, its dot segments resolved (by the URL parser). */\n\treadonly path: string;\n\t/** The matched pattern's params, percent-decoded (`*` for the rest of a `/*` pattern). */\n\treadonly params: Readonly<Record<string, string>>;\n\treadonly query: URLSearchParams;\n\t/** The request's headers; read only. */\n\treadonly headers: Headers;\n\t/** `http://<host>` on loopback, `https://<host>` for an allowed host, a relay's origin for a relayed request. */\n\treadonly origin: string;\n\t/** Where it came from (decision \"The HTTP component's security baseline\" (1), \"Relays\"). */\n\treadonly provenance: Provenance;\n\t/** The server's script nonce: a page's inline scripts carry it (`<script nonce=\"…\">`), the CSP allows them. */\n\treadonly nonce: string;\n\t/** The body as JSON, at most `limit` bytes (1 MiB by default): `HttpFailure` 400 when malformed, 413 when larger. */\n\tjson(limit?: number): Promise<JsonValue>;\n\t/** The body's chunks, at most `limit` bytes (1 MiB by default): `HttpFailure` 413 past it, 400 when cut short. */\n\tbody(limit?: number): AsyncIterable<Uint8Array>;\n}\n\n/** A failure that answers its request with `status` when it escapes a route (400 malformed, 413 too large). */\nexport class HttpFailure extends Error {\n\treadonly status: number;\n\n\tconstructor(status: number, message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"HttpFailure\";\n\t\tthis.status = status;\n\t}\n}\n\n/** What `json` and `body` read unless a route says otherwise: 1 MiB. */\nconst DEFAULT_LIMIT = 1024 * 1024;\n\n/** The params of a request no pattern matched (yet). */\nconst NO_PARAMS: Readonly<Record<string, string>> = {};\n\n/** A request over what the component reads of it; the component sets its params once it matched a route. */\nexport class WebRequest implements HttpRequest {\n\treadonly method: string;\n\treadonly path: string;\n\tparams: Readonly<Record<string, string>> = NO_PARAMS;\n\treadonly origin: string;\n\treadonly provenance: Provenance;\n\treadonly nonce: string;\n\treadonly #incoming: Incoming;\n\t/** The query string (without `?`), parsed when first read. */\n\treadonly #search: string;\n\t#query: URLSearchParams | undefined;\n\t/** Whether a reader took the body (it is read once). */\n\t#taken = false;\n\n\tconstructor(\n\t\tincoming: Incoming,\n\t\tadmitted: { readonly origin: string; readonly provenance: Provenance },\n\t\tnonce: string,\n\t) {\n\t\tthis.method = incoming.method;\n\t\t// The URL is parsed and serialized already (dot segments resolved, `\\` as `/`): only split it here.\n\t\tconst { path, search } = splitUrl(incoming.url);\n\t\tthis.path = path;\n\t\tthis.#search = search;\n\t\tthis.origin = admitted.origin;\n\t\tthis.provenance = admitted.provenance;\n\t\tthis.nonce = nonce;\n\t\tthis.#incoming = incoming;\n\t}\n\n\t/** The headers: on Chord's Node server the Web `Request` is made only when something reads them. */\n\tget headers(): Headers {\n\t\treturn this.#incoming.request().headers;\n\t}\n\n\tget query(): URLSearchParams {\n\t\tthis.#query ??= new URLSearchParams(this.#search);\n\t\treturn this.#query;\n\t}\n\n\tasync json(limit = DEFAULT_LIMIT): Promise<JsonValue> {\n\t\tconst chunks: Uint8Array[] = [];\n\t\tfor await (const chunk of this.body(limit)) chunks.push(chunk);\n\t\tconst text = Buffer.concat(chunks).toString(\"utf8\");\n\t\ttry {\n\t\t\treturn JSON.parse(text) as JsonValue;\n\t\t} catch {\n\t\t\tthrow new HttpFailure(400, \"the body is no JSON\");\n\t\t}\n\t}\n\n\tasync *body(limit = DEFAULT_LIMIT): AsyncIterable<Uint8Array> {\n\t\tif (this.#taken) throw new Error(\"request body: read twice\");\n\t\tthis.#taken = true;\n\t\tconst declared = Number(this.#incoming.header(\"content-length\") ?? Number.NaN);\n\t\tif (declared > limit) throw new HttpFailure(413, `the body is larger than ${limit} bytes`);\n\t\tconst stream = this.#incoming.request().body;\n\t\tif (stream === null) return;\n\t\tconst reader = stream.getReader();\n\t\tlet read = 0;\n\t\ttry {\n\t\t\tfor (;;) {\n\t\t\t\tlet next: Awaited<ReturnType<typeof reader.read>>;\n\t\t\t\ttry {\n\t\t\t\t\tnext = await reader.read();\n\t\t\t\t} catch {\n\t\t\t\t\t// A body cut short (a disconnect, a broken stream) is no body: a prefix must never parse as the\n\t\t\t\t\t// whole (Sol's recheck N4: valid JSON then an error ran the route).\n\t\t\t\t\tthrow new HttpFailure(400, \"the body could not be read whole\");\n\t\t\t\t}\n\t\t\t\tif (next.done) return;\n\t\t\t\tread += next.value.byteLength;\n\t\t\t\tif (read > limit) throw new HttpFailure(413, `the body is larger than ${limit} bytes`);\n\t\t\t\tyield next.value;\n\t\t\t}\n\t\t} finally {\n\t\t\t// Past the limit, or a reader that stopped early: the rest stays unread (its server closes the connection\n\t\t\t// after the response); a cancel could reset the connection before the response is written.\n\t\t\treader.releaseLock();\n\t\t}\n\t}\n}\n\n/** A serialized URL's path (from the first `/` after the authority) and query (without `?`, no fragment). */\nexport function splitUrl(url: string): { readonly path: string; readonly search: string } {\n\tconst authority = url.indexOf(\"//\") + 2;\n\tlet start = url.indexOf(\"/\", authority);\n\tlet end = url.indexOf(\"#\", authority);\n\tif (end < 0) end = url.length;\n\tconst mark = url.indexOf(\"?\", authority);\n\tif (start < 0 || (mark >= 0 && start > mark)) start = -1;\n\tconst pathEnd = mark >= 0 && mark < end ? mark : end;\n\treturn {\n\t\tpath: start < 0 ? \"/\" : url.slice(start, pathEnd),\n\t\tsearch: mark >= 0 && mark < end ? url.slice(mark + 1, end) : \"\",\n\t};\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { JsonValue } from "../../json.ts";
|
|
2
|
+
import type { Ctx } from "../../next/host/index.ts";
|
|
3
|
+
import type { AnswerHeaders } from "./headers.ts";
|
|
4
|
+
/**
|
|
5
|
+
* A route's answer, as a description; `headers` replace same-named default ones (a route widens its own CSP); a list
|
|
6
|
+
* sends one line per value (several `Set-Cookie`).
|
|
7
|
+
*/
|
|
8
|
+
export type HttpResponse = {
|
|
9
|
+
readonly headers?: Readonly<Record<string, string | readonly string[]>>;
|
|
10
|
+
} & ({
|
|
11
|
+
readonly kind: "json";
|
|
12
|
+
readonly value: JsonValue;
|
|
13
|
+
readonly status?: number;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "html";
|
|
16
|
+
readonly body: string;
|
|
17
|
+
readonly status?: number;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: "bytes";
|
|
20
|
+
readonly mime: string;
|
|
21
|
+
/** The length: `Content-Length` and ranges; without it, read until `read` returns an empty chunk. */
|
|
22
|
+
readonly size?: number;
|
|
23
|
+
/** `length` bytes from `offset` (fewer only at the end of a body without `size`), in the request's scope. */
|
|
24
|
+
readonly read: (offset: number, length: number, ctx: Ctx) => Promise<Uint8Array>;
|
|
25
|
+
/** The file name it is saved under. */
|
|
26
|
+
readonly download?: string;
|
|
27
|
+
/** Shown in the browser instead of saved (an image, a video), with a `sandbox` CSP. */
|
|
28
|
+
readonly inline?: true;
|
|
29
|
+
/** Whether a single range is answered 206 (with `size`). */
|
|
30
|
+
readonly ranges?: boolean;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: "redirect";
|
|
33
|
+
readonly to: string;
|
|
34
|
+
readonly status?: 302 | 303 | 307;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: "error";
|
|
37
|
+
readonly status: number;
|
|
38
|
+
readonly message?: string;
|
|
39
|
+
});
|
|
40
|
+
/** What the component answers: a status, its headers, and a whole body, a pulled one, or none. */
|
|
41
|
+
export type Answer = {
|
|
42
|
+
readonly status: number;
|
|
43
|
+
readonly headers: AnswerHeaders;
|
|
44
|
+
/** A whole body is its text (UTF-8): Node writes a string body in one write with the head. */
|
|
45
|
+
readonly body: string | ReadableStream<Uint8Array> | null;
|
|
46
|
+
};
|
|
47
|
+
/** A `bytes` body that could not be read whole (a throwing or a short `read`). */
|
|
48
|
+
export declare class ResponseFailure extends Error {
|
|
49
|
+
constructor(message: string, options?: ErrorOptions);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The answer to `request` for `response` over `defaults` (which it changes): throws when a header is invalid (a CR or
|
|
53
|
+
* LF) or the value is no JSON. A `bytes` body that cannot be read whole is reported to `failed` (its stream errors).
|
|
54
|
+
*/
|
|
55
|
+
export declare function answerOf(response: HttpResponse, request: {
|
|
56
|
+
readonly method: string;
|
|
57
|
+
header(name: string): string | null;
|
|
58
|
+
}, defaults: AnswerHeaders, ctx: Ctx, failed: (error: unknown) => void): Answer;
|
|
59
|
+
/** The answer for an error `status` with its reason phrase (or `message`) as plain text. */
|
|
60
|
+
export declare function errorAnswer(status: number, headers: AnswerHeaders, message?: string, head?: boolean): Answer;
|
|
61
|
+
/** `answer` as a Web `Response`. */
|
|
62
|
+
export declare function webResponse(answer: Answer): Response;
|
|
63
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/next-node/http/response.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC,CAAC,CAAA;CAAE,GAAG,CACtG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAA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;IAC9F,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;CAC1D,CAAC;AAEF,kFAAkF;AAClF,qBAAa,eAAgB,SAAQ,KAAK;IACzC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAGlD;CACD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACvB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,EACzE,QAAQ,EAAE,aAAa,EACvB,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC9B,MAAM,CAuBR;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,UAAQ,GAAG,MAAM,CAE1G;AAED,oCAAoC;AACpC,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAKpD"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// Responses (slice 10 §2, D5, R6; decision "The HTTP component's security baseline" (4), (6)): routes return
|
|
2
|
+
// descriptions and the component turns them into an answer, a status, headers and a body: the default headers first,
|
|
3
|
+
// the response's own replacing same-named ones (validated: a CR or LF throws), `json`, `html`, `redirect`, `error`,
|
|
4
|
+
// and `bytes` read in 256 KiB pieces as the consumer pulls them (ranges 206/416, `HEAD`, an attachment unless inline,
|
|
5
|
+
// safe download names; without a `size`, until an empty read).
|
|
6
|
+
import { STATUS_CODES } from "node:http";
|
|
7
|
+
/** A `bytes` body that could not be read whole (a throwing or a short `read`). */
|
|
8
|
+
export class ResponseFailure extends Error {
|
|
9
|
+
constructor(message, options) {
|
|
10
|
+
super(message, options);
|
|
11
|
+
this.name = "ResponseFailure";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The answer to `request` for `response` over `defaults` (which it changes): throws when a header is invalid (a CR or
|
|
16
|
+
* LF) or the value is no JSON. A `bytes` body that cannot be read whole is reported to `failed` (its stream errors).
|
|
17
|
+
*/
|
|
18
|
+
export function answerOf(response, request, defaults, ctx, failed) {
|
|
19
|
+
const headers = defaults;
|
|
20
|
+
for (const name in response.headers)
|
|
21
|
+
headers.set(name, response.headers[name]);
|
|
22
|
+
const head = request.method === "HEAD";
|
|
23
|
+
switch (response.kind) {
|
|
24
|
+
case "json":
|
|
25
|
+
return whole(response.status ?? 200, headers, "application/json; charset=utf-8", JSON.stringify(response.value), head);
|
|
26
|
+
case "html":
|
|
27
|
+
return whole(response.status ?? 200, headers, "text/html; charset=utf-8", response.body, head);
|
|
28
|
+
case "redirect":
|
|
29
|
+
headers.set("Location", response.to);
|
|
30
|
+
return whole(response.status ?? 302, headers, undefined, "", head);
|
|
31
|
+
case "error":
|
|
32
|
+
return errorAnswer(response.status, headers, response.message, head);
|
|
33
|
+
case "bytes":
|
|
34
|
+
return bytesAnswer(response, request, headers, ctx, failed);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** The answer for an error `status` with its reason phrase (or `message`) as plain text. */
|
|
38
|
+
export function errorAnswer(status, headers, message, head = false) {
|
|
39
|
+
return whole(status, headers, "text/plain; charset=utf-8", message ?? STATUS_CODES[status] ?? "", head);
|
|
40
|
+
}
|
|
41
|
+
/** `answer` as a Web `Response`. */
|
|
42
|
+
export function webResponse(answer) {
|
|
43
|
+
// Bodies are bytes over plain `ArrayBuffer`s (never shared memory); the DOM types ask for exactly that.
|
|
44
|
+
const headers = new Headers();
|
|
45
|
+
for (const [name, value] of answer.headers.lines())
|
|
46
|
+
headers.append(name, value);
|
|
47
|
+
return new Response(answer.body, { status: answer.status, headers });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A whole body: `type` unless a header set one, and its length; none for `HEAD`, and neither for a status that
|
|
51
|
+
* carries no body (204, 205, 304: Sol's recheck N8, `Response` threw on them).
|
|
52
|
+
*/
|
|
53
|
+
function whole(status, headers, type, text, head) {
|
|
54
|
+
if (status < 200 || status > 599)
|
|
55
|
+
throw new RangeError(`response: status ${status}`);
|
|
56
|
+
if (BODYLESS.has(status)) {
|
|
57
|
+
headers.delete("Content-Type");
|
|
58
|
+
headers.delete("Content-Length");
|
|
59
|
+
return { status, headers, body: null };
|
|
60
|
+
}
|
|
61
|
+
if (type !== undefined && !headers.has("content-type"))
|
|
62
|
+
headers.set("Content-Type", type);
|
|
63
|
+
headers.set("Content-Length", String(Buffer.byteLength(text)));
|
|
64
|
+
return { status, headers, body: head || text === "" ? null : text };
|
|
65
|
+
}
|
|
66
|
+
/** The statuses whose responses carry no body. */
|
|
67
|
+
const BODYLESS = new Set([204, 205, 304]);
|
|
68
|
+
/** One `read` of a `bytes` body: 256 KiB. */
|
|
69
|
+
const PIECE = 256 * 1024;
|
|
70
|
+
/** A `bytes` answer: its range or all of it, or until an empty read without a `size`. */
|
|
71
|
+
function bytesAnswer(response, request, headers, ctx, failed) {
|
|
72
|
+
if (!headers.has("content-type"))
|
|
73
|
+
headers.set("Content-Type", response.mime);
|
|
74
|
+
headers.set("Content-Disposition", disposition(response));
|
|
75
|
+
if (response.inline === true)
|
|
76
|
+
headers.set("Content-Security-Policy", `${headers.get("content-security-policy") ?? ""}; sandbox`);
|
|
77
|
+
const { size } = response;
|
|
78
|
+
let start = 0;
|
|
79
|
+
let length = size;
|
|
80
|
+
let status = 200;
|
|
81
|
+
if (size !== undefined && response.ranges === true) {
|
|
82
|
+
headers.set("Accept-Ranges", "bytes");
|
|
83
|
+
const range = rangeOf(request.header("range"), size);
|
|
84
|
+
if (range === "unsatisfiable") {
|
|
85
|
+
headers.set("Content-Range", `bytes */${size}`);
|
|
86
|
+
return whole(416, headers, undefined, "", true);
|
|
87
|
+
}
|
|
88
|
+
if (range !== undefined) {
|
|
89
|
+
({ start, length } = range);
|
|
90
|
+
status = 206;
|
|
91
|
+
headers.set("Content-Range", `bytes ${start}-${start + range.length - 1}/${size}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (length !== undefined)
|
|
95
|
+
headers.set("Content-Length", String(length));
|
|
96
|
+
if (request.method === "HEAD" || length === 0)
|
|
97
|
+
return { status, headers, body: null };
|
|
98
|
+
return { status, headers, body: pulled(response, start, length, ctx, failed) };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The body of a `bytes` response from `start`, `length` bytes (`undefined`: until an empty read), read one piece per
|
|
102
|
+
* pull, so the consumer's backpressure paces the reads; a `read` that throws or comes back short fails it. It follows
|
|
103
|
+
* the request's scope: once sealed (a disconnect, `close`) the stream errors, no read starts, a late one is dropped
|
|
104
|
+
* (Astra's recheck R2, Sol's N3: a held `Response` went on reading after the seal).
|
|
105
|
+
*/
|
|
106
|
+
function pulled(response, start, length, ctx, failed) {
|
|
107
|
+
const end = length === undefined ? Number.POSITIVE_INFINITY : start + length;
|
|
108
|
+
const signal = ctx.abortSignal;
|
|
109
|
+
let offset = start;
|
|
110
|
+
let sealed;
|
|
111
|
+
return new ReadableStream({
|
|
112
|
+
start: (controller) => {
|
|
113
|
+
if (signal === undefined)
|
|
114
|
+
return;
|
|
115
|
+
// Sealed before the stream exists (an abort while the route returned it): no event will come
|
|
116
|
+
// (Sol's third recheck: the request never finished, `close` waited its whole bound).
|
|
117
|
+
if (signal.aborted)
|
|
118
|
+
return controller.error(signal.reason);
|
|
119
|
+
sealed = () => controller.error(signal.reason);
|
|
120
|
+
signal.addEventListener("abort", sealed, { once: true });
|
|
121
|
+
},
|
|
122
|
+
pull: async (controller) => {
|
|
123
|
+
if (signal?.aborted)
|
|
124
|
+
return controller.error(signal.reason);
|
|
125
|
+
const want = Math.min(PIECE, end - offset);
|
|
126
|
+
let chunk;
|
|
127
|
+
try {
|
|
128
|
+
chunk = await response.read(offset, want, ctx);
|
|
129
|
+
if (length !== undefined && chunk.byteLength !== want) {
|
|
130
|
+
throw new ResponseFailure(`bytes: read ${chunk.byteLength} of ${want} bytes at ${offset} (size ${response.size})`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
// A read cut by the seal is no failure of the response.
|
|
135
|
+
if (signal?.aborted)
|
|
136
|
+
return;
|
|
137
|
+
failed(error);
|
|
138
|
+
controller.error(error);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
// Sealed while reading: the stream errored already, the late chunk is dropped.
|
|
142
|
+
if (signal?.aborted)
|
|
143
|
+
return;
|
|
144
|
+
if (chunk.byteLength === 0 || offset + chunk.byteLength >= end) {
|
|
145
|
+
if (chunk.byteLength > 0)
|
|
146
|
+
controller.enqueue(chunk);
|
|
147
|
+
if (sealed !== undefined)
|
|
148
|
+
signal?.removeEventListener("abort", sealed);
|
|
149
|
+
controller.close();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
controller.enqueue(chunk);
|
|
153
|
+
offset += chunk.byteLength;
|
|
154
|
+
},
|
|
155
|
+
cancel: () => {
|
|
156
|
+
if (sealed !== undefined)
|
|
157
|
+
signal?.removeEventListener("abort", sealed);
|
|
158
|
+
},
|
|
159
|
+
}, { highWaterMark: 0 });
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The single range `header` asks for within `size` bytes; `undefined` for none, a malformed or a multi-range one (the
|
|
163
|
+
* whole body); `unsatisfiable` for one starting at or past the end.
|
|
164
|
+
*/
|
|
165
|
+
function rangeOf(header, size) {
|
|
166
|
+
if (header === null)
|
|
167
|
+
return undefined;
|
|
168
|
+
const match = /^bytes=(\d*)-(\d*)$/.exec(header.trim());
|
|
169
|
+
if (match === null)
|
|
170
|
+
return undefined;
|
|
171
|
+
const [, from = "", to = ""] = match;
|
|
172
|
+
if (from === "" && to === "")
|
|
173
|
+
return undefined;
|
|
174
|
+
if (from === "") {
|
|
175
|
+
const suffix = Number(to);
|
|
176
|
+
if (suffix === 0 || size === 0)
|
|
177
|
+
return "unsatisfiable";
|
|
178
|
+
const length = Math.min(suffix, size);
|
|
179
|
+
return { start: size - length, length };
|
|
180
|
+
}
|
|
181
|
+
const start = Number(from);
|
|
182
|
+
if (start >= size)
|
|
183
|
+
return "unsatisfiable";
|
|
184
|
+
const last = to === "" ? size - 1 : Math.min(Number(to), size - 1);
|
|
185
|
+
if (last < start)
|
|
186
|
+
return undefined;
|
|
187
|
+
return { start, length: last - start + 1 };
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* `Content-Disposition`: `inline` or `attachment`, with the download name as an ASCII fallback and as UTF-8 (RFC 6266,
|
|
191
|
+
* RFC 5987), its control and bidirectional formatting characters dropped (a name must read as it is).
|
|
192
|
+
*/
|
|
193
|
+
function disposition(response) {
|
|
194
|
+
const kind = response.inline === true ? "inline" : "attachment";
|
|
195
|
+
if (response.download === undefined)
|
|
196
|
+
return kind;
|
|
197
|
+
const name = response.download.replace(/[\u0000-\u001f\u007f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, "");
|
|
198
|
+
const ascii = name.replace(/[^\x20-\x7e]|["\\]/g, "_");
|
|
199
|
+
const encoded = encodeURIComponent(name).replace(/['()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
200
|
+
return `${kind}; filename="${ascii}"; filename*=UTF-8''${encoded}`;
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/next-node/http/response.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,qHAAqH;AACrH,oHAAoH;AACpH,sHAAsH;AACtH,+DAA+D;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAsCzC,kFAAkF;AAClF,MAAM,OAAO,eAAgB,SA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I,CAAC,OAAO,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAC/C,SAAS,EACT,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAC7D,CAAC;IACF,OAAO,GAAG,IAAI,eAAe,KAAK,uBAAuB,OAAO,EAAE,CAAC;AACpE,CAAC","sourcesContent":["// Responses (slice 10 §2, D5, R6; decision \"The HTTP component's security baseline\" (4), (6)): routes return\n// descriptions and the component turns them into an answer, a status, headers and a body: the default headers first,\n// the response's own replacing same-named ones (validated: a CR or LF throws), `json`, `html`, `redirect`, `error`,\n// and `bytes` read in 256 KiB pieces as the consumer pulls them (ranges 206/416, `HEAD`, an attachment unless inline,\n// safe download names; without a `size`, until an empty read).\n\nimport { STATUS_CODES } from \"node:http\";\nimport type { JsonValue } from \"../../json.ts\";\nimport type { Ctx } from \"../../next/host/index.ts\";\nimport type { AnswerHeaders } from \"./headers.ts\";\n\n/**\n * A route's answer, as a description; `headers` replace same-named default ones (a route widens its own CSP); a list\n * sends one line per value (several `Set-Cookie`).\n */\nexport type HttpResponse = { readonly headers?: Readonly<Record<string, string | readonly string[]>> } & (\n\t| { readonly kind: \"json\"; readonly value: JsonValue; readonly status?: number }\n\t| { readonly kind: \"html\"; readonly body: string; readonly status?: number }\n\t| {\n\t\t\treadonly kind: \"bytes\";\n\t\t\treadonly mime: string;\n\t\t\t/** The length: `Content-Length` and ranges; without it, read until `read` returns an empty chunk. */\n\t\t\treadonly size?: number;\n\t\t\t/** `length` bytes from `offset` (fewer only at the end of a body without `size`), in the request's scope. */\n\t\t\treadonly read: (offset: number, length: number, ctx: Ctx) => Promise<Uint8Array>;\n\t\t\t/** The file name it is saved under. */\n\t\t\treadonly download?: string;\n\t\t\t/** Shown in the browser instead of saved (an image, a video), with a `sandbox` CSP. */\n\t\t\treadonly inline?: true;\n\t\t\t/** Whether a single range is answered 206 (with `size`). */\n\t\t\treadonly ranges?: boolean;\n\t }\n\t| { readonly kind: \"redirect\"; readonly to: string; readonly status?: 302 | 303 | 307 }\n\t| { readonly kind: \"error\"; readonly status: number; readonly message?: string }\n);\n\n/** What the component answers: a status, its headers, and a whole body, a pulled one, or none. */\nexport type Answer = {\n\treadonly status: number;\n\treadonly headers: AnswerHeaders;\n\t/** A whole body is its text (UTF-8): Node writes a string body in one write with the head. */\n\treadonly body: string | ReadableStream<Uint8Array> | null;\n};\n\n/** A `bytes` body that could not be read whole (a throwing or a short `read`). */\nexport class ResponseFailure extends Error {\n\tconstructor(message: string, options?: ErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.name = \"ResponseFailure\";\n\t}\n}\n\n/**\n * The answer to `request` for `response` over `defaults` (which it changes): throws when a header is invalid (a CR or\n * LF) or the value is no JSON. A `bytes` body that cannot be read whole is reported to `failed` (its stream errors).\n */\nexport function answerOf(\n\tresponse: HttpResponse,\n\trequest: { readonly method: string; header(name: string): string | null },\n\tdefaults: AnswerHeaders,\n\tctx: Ctx,\n\tfailed: (error: unknown) => void,\n): Answer {\n\tconst headers = defaults;\n\tfor (const name in response.headers) headers.set(name, response.headers[name]!);\n\tconst head = request.method === \"HEAD\";\n\tswitch (response.kind) {\n\t\tcase \"json\":\n\t\t\treturn whole(\n\t\t\t\tresponse.status ?? 200,\n\t\t\t\theaders,\n\t\t\t\t\"application/json; charset=utf-8\",\n\t\t\t\tJSON.stringify(response.value),\n\t\t\t\thead,\n\t\t\t);\n\t\tcase \"html\":\n\t\t\treturn whole(response.status ?? 200, headers, \"text/html; charset=utf-8\", response.body, head);\n\t\tcase \"redirect\":\n\t\t\theaders.set(\"Location\", response.to);\n\t\t\treturn whole(response.status ?? 302, headers, undefined, \"\", head);\n\t\tcase \"error\":\n\t\t\treturn errorAnswer(response.status, headers, response.message, head);\n\t\tcase \"bytes\":\n\t\t\treturn bytesAnswer(response, request, headers, ctx, failed);\n\t}\n}\n\n/** The answer for an error `status` with its reason phrase (or `message`) as plain text. */\nexport function errorAnswer(status: number, headers: AnswerHeaders, message?: string, head = false): Answer {\n\treturn whole(status, headers, \"text/plain; charset=utf-8\", message ?? STATUS_CODES[status] ?? \"\", head);\n}\n\n/** `answer` as a Web `Response`. */\nexport function webResponse(answer: Answer): Response {\n\t// Bodies are bytes over plain `ArrayBuffer`s (never shared memory); the DOM types ask for exactly that.\n\tconst headers = new Headers();\n\tfor (const [name, value] of answer.headers.lines()) headers.append(name, value);\n\treturn new Response(answer.body as ConstructorParameters<typeof Response>[0], { status: answer.status, headers });\n}\n\n/**\n * A whole body: `type` unless a header set one, and its length; none for `HEAD`, and neither for a status that\n * carries no body (204, 205, 304: Sol's recheck N8, `Response` threw on them).\n */\nfunction whole(status: number, headers: AnswerHeaders, type: string | undefined, text: string, head: boolean): Answer {\n\tif (status < 200 || status > 599) throw new RangeError(`response: status ${status}`);\n\tif (BODYLESS.has(status)) {\n\t\theaders.delete(\"Content-Type\");\n\t\theaders.delete(\"Content-Length\");\n\t\treturn { status, headers, body: null };\n\t}\n\tif (type !== undefined && !headers.has(\"content-type\")) headers.set(\"Content-Type\", type);\n\theaders.set(\"Content-Length\", String(Buffer.byteLength(text)));\n\treturn { status, headers, body: head || text === \"\" ? null : text };\n}\n\n/** The statuses whose responses carry no body. */\nconst BODYLESS: ReadonlySet<number> = new Set([204, 205, 304]);\n\n/** One `read` of a `bytes` body: 256 KiB. */\nconst PIECE = 256 * 1024;\n\n/** A `bytes` answer: its range or all of it, or until an empty read without a `size`. */\nfunction bytesAnswer(\n\tresponse: Extract<HttpResponse, { readonly kind: \"bytes\" }>,\n\trequest: { readonly method: string; header(name: string): string | null },\n\theaders: AnswerHeaders,\n\tctx: Ctx,\n\tfailed: (error: unknown) => void,\n): Answer {\n\tif (!headers.has(\"content-type\")) headers.set(\"Content-Type\", response.mime);\n\theaders.set(\"Content-Disposition\", disposition(response));\n\tif (response.inline === true)\n\t\theaders.set(\"Content-Security-Policy\", `${headers.get(\"content-security-policy\") ?? \"\"}; sandbox`);\n\tconst { size } = response;\n\tlet start = 0;\n\tlet length = size;\n\tlet status = 200;\n\tif (size !== undefined && response.ranges === true) {\n\t\theaders.set(\"Accept-Ranges\", \"bytes\");\n\t\tconst range = rangeOf(request.header(\"range\"), size);\n\t\tif (range === \"unsatisfiable\") {\n\t\t\theaders.set(\"Content-Range\", `bytes */${size}`);\n\t\t\treturn whole(416, headers, undefined, \"\", true);\n\t\t}\n\t\tif (range !== undefined) {\n\t\t\t({ start, length } = range);\n\t\t\tstatus = 206;\n\t\t\theaders.set(\"Content-Range\", `bytes ${start}-${start + range.length - 1}/${size}`);\n\t\t}\n\t}\n\tif (length !== undefined) headers.set(\"Content-Length\", String(length));\n\tif (request.method === \"HEAD\" || length === 0) return { status, headers, body: null };\n\treturn { status, headers, body: pulled(response, start, length, ctx, failed) };\n}\n\n/**\n * The body of a `bytes` response from `start`, `length` bytes (`undefined`: until an empty read), read one piece per\n * pull, so the consumer's backpressure paces the reads; a `read` that throws or comes back short fails it. It follows\n * the request's scope: once sealed (a disconnect, `close`) the stream errors, no read starts, a late one is dropped\n * (Astra's recheck R2, Sol's N3: a held `Response` went on reading after the seal).\n */\nfunction pulled(\n\tresponse: Extract<HttpResponse, { readonly kind: \"bytes\" }>,\n\tstart: number,\n\tlength: number | undefined,\n\tctx: Ctx,\n\tfailed: (error: unknown) => void,\n): ReadableStream<Uint8Array> {\n\tconst end = length === undefined ? Number.POSITIVE_INFINITY : start + length;\n\tconst signal = ctx.abortSignal;\n\tlet offset = start;\n\tlet sealed: (() => void) | undefined;\n\treturn new ReadableStream<Uint8Array>(\n\t\t{\n\t\t\tstart: (controller) => {\n\t\t\t\tif (signal === undefined) return;\n\t\t\t\t// Sealed before the stream exists (an abort while the route returned it): no event will come\n\t\t\t\t// (Sol's third recheck: the request never finished, `close` waited its whole bound).\n\t\t\t\tif (signal.aborted) return controller.error(signal.reason);\n\t\t\t\tsealed = () => controller.error(signal.reason);\n\t\t\t\tsignal.addEventListener(\"abort\", sealed, { once: true });\n\t\t\t},\n\t\t\tpull: async (controller) => {\n\t\t\t\tif (signal?.aborted) return controller.error(signal.reason);\n\t\t\t\tconst want = Math.min(PIECE, end - offset);\n\t\t\t\tlet chunk: Uint8Array;\n\t\t\t\ttry {\n\t\t\t\t\tchunk = await response.read(offset, want, ctx);\n\t\t\t\t\tif (length !== undefined && chunk.byteLength !== want) {\n\t\t\t\t\t\tthrow new ResponseFailure(\n\t\t\t\t\t\t\t`bytes: read ${chunk.byteLength} of ${want} bytes at ${offset} (size ${response.size})`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// A read cut by the seal is no failure of the response.\n\t\t\t\t\tif (signal?.aborted) return;\n\t\t\t\t\tfailed(error);\n\t\t\t\t\tcontroller.error(error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Sealed while reading: the stream errored already, the late chunk is dropped.\n\t\t\t\tif (signal?.aborted) return;\n\t\t\t\tif (chunk.byteLength === 0 || offset + chunk.byteLength >= end) {\n\t\t\t\t\tif (chunk.byteLength > 0) controller.enqueue(chunk);\n\t\t\t\t\tif (sealed !== undefined) signal?.removeEventListener(\"abort\", sealed);\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\toffset += chunk.byteLength;\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tif (sealed !== undefined) signal?.removeEventListener(\"abort\", sealed);\n\t\t\t},\n\t\t},\n\t\t{ highWaterMark: 0 },\n\t);\n}\n\n/**\n * The single range `header` asks for within `size` bytes; `undefined` for none, a malformed or a multi-range one (the\n * whole body); `unsatisfiable` for one starting at or past the end.\n */\nfunction rangeOf(header: string | null, size: number): { start: number; length: number } | \"unsatisfiable\" | undefined {\n\tif (header === null) return undefined;\n\tconst match = /^bytes=(\\d*)-(\\d*)$/.exec(header.trim());\n\tif (match === null) return undefined;\n\tconst [, from = \"\", to = \"\"] = match;\n\tif (from === \"\" && to === \"\") return undefined;\n\tif (from === \"\") {\n\t\tconst suffix = Number(to);\n\t\tif (suffix === 0 || size === 0) return \"unsatisfiable\";\n\t\tconst length = Math.min(suffix, size);\n\t\treturn { start: size - length, length };\n\t}\n\tconst start = Number(from);\n\tif (start >= size) return \"unsatisfiable\";\n\tconst last = to === \"\" ? size - 1 : Math.min(Number(to), size - 1);\n\tif (last < start) return undefined;\n\treturn { start, length: last - start + 1 };\n}\n\n/**\n * `Content-Disposition`: `inline` or `attachment`, with the download name as an ASCII fallback and as UTF-8 (RFC 6266,\n * RFC 5987), its control and bidirectional formatting characters dropped (a name must read as it is).\n */\nfunction disposition(response: { readonly download?: string; readonly inline?: true }): string {\n\tconst kind = response.inline === true ? \"inline\" : \"attachment\";\n\tif (response.download === undefined) return kind;\n\tconst name = response.download.replace(/[\\u0000-\\u001f\\u007f\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]/g, \"\");\n\tconst ascii = name.replace(/[^\\x20-\\x7e]|[\"\\\\]/g, \"_\");\n\tconst encoded = encodeURIComponent(name).replace(\n\t\t/['()*]/g,\n\t\t(char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`,\n\t);\n\treturn `${kind}; filename=\"${ascii}\"; filename*=UTF-8''${encoded}`;\n}\n"]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { WebSocket } from "ws";
|
|
2
|
+
import type { Ctx } from "../../next/host/index.ts";
|
|
3
|
+
import { type ComposeContext, type RegistryTable } from "../../next/registries/index.ts";
|
|
4
|
+
import type { HttpRequest } from "./request.ts";
|
|
5
|
+
import type { HttpResponse } from "./response.ts";
|
|
6
|
+
/** A route: answers a request with a response description, in the request's scope (`ctx.principal`, its signal). */
|
|
7
|
+
export type HttpRoute = (request: HttpRequest, ctx: Ctx) => Promise<HttpResponse>;
|
|
8
|
+
/**
|
|
9
|
+
* A route with its options: `page` admits a top-level navigation from another site (a link to it) with its
|
|
10
|
+
* authentication; `crossSite` admits any foreign request (a webhook), always anonymous.
|
|
11
|
+
*/
|
|
12
|
+
export type HttpRouteOptions = {
|
|
13
|
+
readonly handler: HttpRoute;
|
|
14
|
+
readonly page?: true;
|
|
15
|
+
readonly crossSite?: true;
|
|
16
|
+
};
|
|
17
|
+
/** A wrap's phases, outermost first. */
|
|
18
|
+
export type WrapPhase = "observe" | "headers" | "transform";
|
|
19
|
+
/** A wrap (D2): runs around routes in its phase, around its own plugin's routes unless `scope` is `"all"`. */
|
|
20
|
+
export type HttpWrap = {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly phase: WrapPhase;
|
|
23
|
+
/** `"own"` (default): around the contributing plugin's routes; `"all"`: every route. */
|
|
24
|
+
readonly scope?: "own" | "all";
|
|
25
|
+
/** Only around this route (`"GET /notes/:id"`); a route nobody contributes is a reported conflict. */
|
|
26
|
+
readonly route?: string;
|
|
27
|
+
readonly wrap: (request: HttpRequest, next: (request: HttpRequest) => Promise<HttpResponse>, ctx: Ctx) => Promise<HttpResponse>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A plugin socket's handler (D6): a `ws` WebSocket after the checks and authentication, its `error` listener attached;
|
|
31
|
+
* its scope lasts until the socket closes.
|
|
32
|
+
*/
|
|
33
|
+
export type HttpSocket = (socket: WebSocketHandle, request: HttpRequest, ctx: Ctx) => void | Promise<void>;
|
|
34
|
+
/** A plugin socket: `ws`'s WebSocket, for the plugin's own protocol. */
|
|
35
|
+
export type WebSocketHandle = WebSocket;
|
|
36
|
+
/**
|
|
37
|
+
* A relay (p2's Radius): a forwarder on loopback that sends forwarded headers. `verify` recognizes its requests (a
|
|
38
|
+
* secret header, a signature) and names the origin the request came from and the origin allowed to frame it.
|
|
39
|
+
*/
|
|
40
|
+
export type HttpRelay = {
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly verify: (request: Request) => {
|
|
43
|
+
readonly origin: string;
|
|
44
|
+
readonly framer?: string;
|
|
45
|
+
} | undefined;
|
|
46
|
+
};
|
|
47
|
+
/** What a plugin contributes to `Http`: a plain value, or a writable of one (its change recomposes the router). */
|
|
48
|
+
export type HttpContribution = {
|
|
49
|
+
/** Routes by `"METHOD /pattern"`: exact segments, `:name`, a trailing `/*`. */
|
|
50
|
+
readonly routes?: Readonly<Record<string, HttpRoute | HttpRouteOptions>>;
|
|
51
|
+
readonly wraps?: readonly HttpWrap[];
|
|
52
|
+
/** Plugin sockets by pattern (no method). */
|
|
53
|
+
readonly sockets?: Readonly<Record<string, HttpSocket>>;
|
|
54
|
+
/** The largest frame this contribution's sockets accept; 1 MiB by default. */
|
|
55
|
+
readonly maxPayload?: number;
|
|
56
|
+
/** Hosts allowed besides loopback, as the client names them (`notes.example.com`): requests through them are https. */
|
|
57
|
+
readonly hosts?: readonly string[];
|
|
58
|
+
/** Origins allowed to frame the app's pages (CSP `frame-ancestors`). */
|
|
59
|
+
readonly framers?: readonly string[];
|
|
60
|
+
/** Relays whose forwarded requests are admitted (verified) on loopback. */
|
|
61
|
+
readonly relays?: readonly HttpRelay[];
|
|
62
|
+
/** Extra CSP sources by directive (`{ "img-src": ["https://cdn.example.com"] }`). */
|
|
63
|
+
readonly csp?: Readonly<Record<string, readonly string[]>>;
|
|
64
|
+
};
|
|
65
|
+
/** The router a request uses: as it was when the request started. */
|
|
66
|
+
export type Router = {
|
|
67
|
+
/** The route for `method` and `path`, with its params and wraps; `bad_path` for a malformed one. */
|
|
68
|
+
route(method: string, path: string): RouteMatch | "bad_path" | undefined;
|
|
69
|
+
/** The plugin socket for `path`. */
|
|
70
|
+
socket(path: string): SocketMatch | "bad_path" | undefined;
|
|
71
|
+
/** The hosts contributions allow (lowercased). */
|
|
72
|
+
readonly hosts: ReadonlySet<string>;
|
|
73
|
+
/** The origins allowed to frame pages. */
|
|
74
|
+
readonly framers: ReadonlySet<string>;
|
|
75
|
+
/** The relays, in contributor order. */
|
|
76
|
+
readonly relays: readonly HttpRelay[];
|
|
77
|
+
/** Extra CSP sources by directive. */
|
|
78
|
+
readonly csp: ReadonlyMap<string, readonly string[]>;
|
|
79
|
+
/** The socket handlers it serves: a socket handed out by one no longer here is closed. */
|
|
80
|
+
readonly socketHandlers: ReadonlySet<HttpSocket>;
|
|
81
|
+
};
|
|
82
|
+
/** A matched route: its pattern, plugin, params, handler, options and wraps (outermost first). */
|
|
83
|
+
export type RouteMatch = {
|
|
84
|
+
readonly pattern: string;
|
|
85
|
+
readonly plugin: string;
|
|
86
|
+
readonly params: Readonly<Record<string, string>>;
|
|
87
|
+
readonly handler: HttpRoute;
|
|
88
|
+
readonly page: boolean;
|
|
89
|
+
readonly crossSite: boolean;
|
|
90
|
+
readonly wraps: readonly ResolvedWrap[];
|
|
91
|
+
};
|
|
92
|
+
/** A matched plugin socket. */
|
|
93
|
+
export type SocketMatch = {
|
|
94
|
+
readonly pattern: string;
|
|
95
|
+
readonly plugin: string;
|
|
96
|
+
readonly params: Readonly<Record<string, string>>;
|
|
97
|
+
readonly handler: HttpSocket;
|
|
98
|
+
readonly maxPayload: number;
|
|
99
|
+
};
|
|
100
|
+
/** A wrap as a route runs it, with its plugin. */
|
|
101
|
+
export type ResolvedWrap = {
|
|
102
|
+
readonly wrap: HttpWrap;
|
|
103
|
+
readonly plugin: string;
|
|
104
|
+
};
|
|
105
|
+
/** The registry the HTTP component defines and serves (`http.facet`, plugin `chord.http`). */
|
|
106
|
+
export declare const Http: import("../../next/registries/registry.ts").Registry<HttpContribution, Router>;
|
|
107
|
+
/**
|
|
108
|
+
* The methods a Web `Request` cannot carry (the Fetch standard's forbidden methods): answered 501 at the wire, a route
|
|
109
|
+
* for one refused at compose.
|
|
110
|
+
*/
|
|
111
|
+
export declare const UNCARRIED: ReadonlySet<string>;
|
|
112
|
+
/** Builds the router from `table` (the registry's `compose`): pure, conflicts reported, the first by plugin name wins. */
|
|
113
|
+
export declare function composeRouter(table: RegistryTable<HttpContribution>, { report }: ComposeContext): Router;
|
|
114
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/next-node/http/router.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,cAAc,EAAkB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACzG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,oHAAoH;AACpH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;CAC1B,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAE5D,8GAA8G;AAC9G,MAAM,MAAM,QAAQ,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC/B,sGAAsG;IACtG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,CACd,OAAO,EAAE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