@moq/net 0.4.8 → 0.22.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/README.md +7 -1
- package/announce.d.ts +1 -1
- package/announce.d.ts.map +1 -1
- package/announce.js +1 -1
- package/announce.js.map +1 -1
- package/announced.d.ts +51 -47
- package/announced.d.ts.map +1 -1
- package/announced.js +183 -31
- package/announced.js.map +1 -1
- package/announced.test-util.d.ts +2 -0
- package/announced.test-util.d.ts.map +1 -0
- package/announced.test-util.js +27 -0
- package/announced.test-util.js.map +1 -0
- package/auth.d.ts +64 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +20 -0
- package/auth.js.map +1 -0
- package/auth_gate.d.ts +2 -0
- package/auth_gate.d.ts.map +1 -0
- package/auth_gate.js +24 -0
- package/auth_gate.js.map +1 -0
- package/auth_session.d.ts +49 -0
- package/auth_session.d.ts.map +1 -0
- package/auth_session.js +1097 -0
- package/auth_session.js.map +1 -0
- package/bandwidth.d.ts +129 -25
- package/bandwidth.d.ts.map +1 -1
- package/bandwidth.js +410 -138
- package/bandwidth.js.map +1 -1
- package/bandwidth_api.d.ts +1 -1
- package/bandwidth_api.d.ts.map +1 -1
- package/bandwidth_api.js +1 -1
- package/bandwidth_api.js.map +1 -1
- package/broadcast.d.ts +62 -36
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +556 -172
- package/broadcast.js.map +1 -1
- package/cache.d.ts +103 -0
- package/cache.d.ts.map +1 -0
- package/cache.js +254 -0
- package/cache.js.map +1 -0
- package/claim.test-util.d.ts +5 -0
- package/claim.test-util.d.ts.map +1 -0
- package/claim.test-util.js +13 -0
- package/claim.test-util.js.map +1 -0
- package/connection/accept.d.ts +20 -12
- package/connection/accept.d.ts.map +1 -1
- package/connection/accept.js +97 -129
- package/connection/accept.js.map +1 -1
- package/connection/browser.d.ts.map +1 -1
- package/connection/browser.js +28 -19
- package/connection/browser.js.map +1 -1
- package/connection/connect.d.ts +119 -23
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +535 -216
- package/connection/connect.js.map +1 -1
- package/connection/dials.d.ts +45 -0
- package/connection/dials.d.ts.map +1 -0
- package/connection/dials.js +109 -0
- package/connection/dials.js.map +1 -0
- package/connection/endpoint.d.ts +60 -0
- package/connection/endpoint.d.ts.map +1 -0
- package/connection/endpoint.js +114 -0
- package/connection/endpoint.js.map +1 -0
- package/connection/forward.d.ts +7 -1
- package/connection/forward.d.ts.map +1 -1
- package/connection/forward.js +265 -80
- package/connection/forward.js.map +1 -1
- package/connection/goaway.d.ts +16 -9
- package/connection/goaway.d.ts.map +1 -1
- package/connection/goaway.js +22 -108
- package/connection/goaway.js.map +1 -1
- package/connection/handshake.d.ts +32 -6
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +97 -20
- package/connection/handshake.js.map +1 -1
- package/connection/index.d.ts +3 -6
- package/connection/index.d.ts.map +1 -1
- package/connection/index.js +1 -2
- package/connection/index.js.map +1 -1
- package/connection/liveness.d.ts +14 -0
- package/connection/liveness.d.ts.map +1 -0
- package/connection/liveness.js +30 -0
- package/connection/liveness.js.map +1 -0
- package/connection/pool.d.ts +137 -58
- package/connection/pool.d.ts.map +1 -1
- package/connection/pool.js +281 -117
- package/connection/pool.js.map +1 -1
- package/connection/reload.d.ts +60 -12
- package/connection/reload.d.ts.map +1 -1
- package/connection/reload.js +859 -233
- package/connection/reload.js.map +1 -1
- package/connection/session.d.ts +91 -0
- package/connection/session.d.ts.map +1 -0
- package/connection/session.js +2 -0
- package/connection/session.js.map +1 -0
- package/connection/stats.d.ts +20 -11
- package/connection/stats.d.ts.map +1 -1
- package/connection/stats.js +64 -8
- package/connection/stats.js.map +1 -1
- package/connection/ticker.d.ts +4 -0
- package/connection/ticker.d.ts.map +1 -0
- package/connection/ticker.js +66 -0
- package/connection/ticker.js.map +1 -0
- package/connection/tokens.d.ts +2 -0
- package/connection/tokens.d.ts.map +1 -0
- package/connection/tokens.js +404 -0
- package/connection/tokens.js.map +1 -0
- package/connection/transport.d.ts.map +1 -1
- package/connection/transport.js +4 -4
- package/connection/transport.js.map +1 -1
- package/connection/withdrawal.d.ts +2 -0
- package/connection/withdrawal.d.ts.map +1 -0
- package/connection/withdrawal.js +23 -0
- package/connection/withdrawal.js.map +1 -0
- package/consume.js +213 -46
- package/consume.js.map +1 -1
- package/cover.d.ts +59 -0
- package/cover.d.ts.map +1 -0
- package/cover.js +375 -0
- package/cover.js.map +1 -0
- package/datagram.d.ts +70 -11
- package/datagram.d.ts.map +1 -1
- package/datagram.js +317 -1
- package/datagram.js.map +1 -1
- package/datagram_stream.d.ts +18 -0
- package/datagram_stream.d.ts.map +1 -0
- package/datagram_stream.js +67 -0
- package/datagram_stream.js.map +1 -0
- package/defined.test-util.d.ts +2 -0
- package/defined.test-util.d.ts.map +1 -0
- package/defined.test-util.js +7 -0
- package/defined.test-util.js.map +1 -0
- package/delivered.d.ts +75 -0
- package/delivered.d.ts.map +1 -0
- package/delivered.js +228 -0
- package/delivered.js.map +1 -0
- package/demand.d.ts +173 -0
- package/demand.d.ts.map +1 -0
- package/demand.js +582 -0
- package/demand.js.map +1 -0
- package/drops.d.ts +93 -0
- package/drops.d.ts.map +1 -0
- package/drops.js +283 -0
- package/drops.js.map +1 -0
- package/error.d.ts +120 -21
- package/error.d.ts.map +1 -1
- package/error.js +230 -37
- package/error.js.map +1 -1
- package/errors.d.ts +2 -2
- package/errors.d.ts.map +1 -1
- package/errors.js +2 -2
- package/errors.js.map +1 -1
- package/fill.d.ts +174 -0
- package/fill.d.ts.map +1 -0
- package/fill.js +760 -0
- package/fill.js.map +1 -0
- package/flate/decoder.d.ts +2 -0
- package/flate/decoder.d.ts.map +1 -0
- package/flate/decoder.js +63 -0
- package/flate/decoder.js.map +1 -0
- package/flate/encoder.d.ts +2 -0
- package/flate/encoder.d.ts.map +1 -0
- package/flate/encoder.js +64 -0
- package/flate/encoder.js.map +1 -0
- package/flate/group.d.ts +34 -0
- package/flate/group.d.ts.map +1 -0
- package/flate/group.js +140 -0
- package/flate/group.js.map +1 -0
- package/frame.d.ts +80 -0
- package/frame.d.ts.map +1 -0
- package/frame.js +296 -0
- package/frame.js.map +1 -0
- package/frame.test-util.d.ts +5 -0
- package/frame.test-util.d.ts.map +1 -0
- package/frame.test-util.js +9 -0
- package/frame.test-util.js.map +1 -0
- package/group.d.ts +108 -45
- package/group.d.ts.map +1 -1
- package/group.js +1616 -307
- package/group.js.map +1 -1
- package/group_api.d.ts +7 -0
- package/group_api.d.ts.map +1 -0
- package/group_api.js +7 -0
- package/group_api.js.map +1 -0
- package/hop.d.ts +62 -76
- package/hop.d.ts.map +1 -1
- package/hop.js +92 -64
- package/hop.js.map +1 -1
- package/identity.d.ts +39 -0
- package/identity.d.ts.map +1 -0
- package/identity.js +47 -0
- package/identity.js.map +1 -0
- package/ietf/active_count.d.ts +2 -0
- package/ietf/active_count.d.ts.map +1 -0
- package/ietf/active_count.js +30 -0
- package/ietf/active_count.js.map +1 -0
- package/ietf/aliases.js +69 -35
- package/ietf/aliases.js.map +1 -1
- package/ietf/cluster.d.ts +3 -3
- package/ietf/cluster.js +14 -62
- package/ietf/cluster.js.map +1 -1
- package/ietf/connection.d.ts +1 -31
- package/ietf/connection.d.ts.map +1 -1
- package/ietf/connection.js +305 -143
- package/ietf/connection.js.map +1 -1
- package/ietf/datagram.d.ts +60 -0
- package/ietf/datagram.d.ts.map +1 -0
- package/ietf/datagram.js +152 -0
- package/ietf/datagram.js.map +1 -0
- package/ietf/error.d.ts +3 -3
- package/ietf/error.js +82 -100
- package/ietf/error.js.map +1 -1
- package/ietf/fetch.d.ts +91 -35
- package/ietf/fetch.d.ts.map +1 -1
- package/ietf/fetch.js +172 -93
- package/ietf/fetch.js.map +1 -1
- package/ietf/filter.d.ts +20 -30
- package/ietf/filter.d.ts.map +1 -1
- package/ietf/filter.js +140 -171
- package/ietf/filter.js.map +1 -1
- package/ietf/goaway.d.ts +11 -9
- package/ietf/goaway.d.ts.map +1 -1
- package/ietf/goaway.js +22 -35
- package/ietf/goaway.js.map +1 -1
- package/ietf/hidden.js +1 -1
- package/ietf/hidden.js.map +1 -1
- package/ietf/index.d.ts +2 -14
- package/ietf/index.d.ts.map +1 -1
- package/ietf/index.js +4 -14
- package/ietf/index.js.map +1 -1
- package/ietf/join.d.ts +7 -0
- package/ietf/join.d.ts.map +1 -0
- package/ietf/join.js +234 -0
- package/ietf/join.js.map +1 -0
- package/ietf/message.d.ts +18 -2
- package/ietf/message.d.ts.map +1 -1
- package/ietf/message.js +60 -40
- package/ietf/message.js.map +1 -1
- package/ietf/message.test-util.d.ts +6 -0
- package/ietf/message.test-util.d.ts.map +1 -0
- package/ietf/message.test-util.js +13 -0
- package/ietf/message.test-util.js.map +1 -0
- package/ietf/namespace.d.ts +17 -3
- package/ietf/namespace.d.ts.map +1 -1
- package/ietf/namespace.js +78 -26
- package/ietf/namespace.js.map +1 -1
- package/ietf/object.d.ts +194 -32
- package/ietf/object.d.ts.map +1 -1
- package/ietf/object.js +405 -178
- package/ietf/object.js.map +1 -1
- package/ietf/parameters.d.ts +22 -42
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +260 -472
- package/ietf/parameters.js.map +1 -1
- package/ietf/priority.d.ts +17 -2
- package/ietf/priority.d.ts.map +1 -1
- package/ietf/priority.js +19 -4
- package/ietf/priority.js.map +1 -1
- package/ietf/properties.d.ts +5 -4
- package/ietf/properties.d.ts.map +1 -1
- package/ietf/properties.js +78 -48
- package/ietf/properties.js.map +1 -1
- package/ietf/publish.d.ts +22 -30
- package/ietf/publish.d.ts.map +1 -1
- package/ietf/publish.js +45 -139
- package/ietf/publish.js.map +1 -1
- package/ietf/publish_namespace.d.ts +46 -69
- package/ietf/publish_namespace.d.ts.map +1 -1
- package/ietf/publish_namespace.js +66 -184
- package/ietf/publish_namespace.js.map +1 -1
- package/ietf/publisher.js +1800 -600
- package/ietf/publisher.js.map +1 -1
- package/ietf/range.d.ts +2 -0
- package/ietf/range.d.ts.map +1 -0
- package/ietf/range.js +222 -0
- package/ietf/range.js.map +1 -0
- package/ietf/request.d.ts +3 -27
- package/ietf/request.d.ts.map +1 -1
- package/ietf/request.js +41 -78
- package/ietf/request.js.map +1 -1
- package/ietf/request_stream.d.ts +1 -6
- package/ietf/request_stream.d.ts.map +1 -1
- package/ietf/request_stream.js +306 -16
- package/ietf/request_stream.js.map +1 -1
- package/ietf/session.d.ts +41 -0
- package/ietf/session.d.ts.map +1 -0
- package/ietf/session.js +65 -0
- package/ietf/session.js.map +1 -0
- package/ietf/setup.d.ts +4 -29
- package/ietf/setup.d.ts.map +1 -1
- package/ietf/setup.js +6 -117
- package/ietf/setup.js.map +1 -1
- package/ietf/setup_options.d.ts +31 -0
- package/ietf/setup_options.d.ts.map +1 -0
- package/ietf/setup_options.js +138 -0
- package/ietf/setup_options.js.map +1 -0
- package/ietf/solicit.js +4 -14
- package/ietf/solicit.js.map +1 -1
- package/ietf/subscribe.d.ts +48 -41
- package/ietf/subscribe.d.ts.map +1 -1
- package/ietf/subscribe.js +118 -239
- package/ietf/subscribe.js.map +1 -1
- package/ietf/subscribe_namespace.d.ts +13 -76
- package/ietf/subscribe_namespace.d.ts.map +1 -1
- package/ietf/subscribe_namespace.js +30 -201
- package/ietf/subscribe_namespace.js.map +1 -1
- package/ietf/subscriber.js +1839 -536
- package/ietf/subscriber.js.map +1 -1
- package/ietf/token.js +105 -27
- package/ietf/token.js.map +1 -1
- package/ietf/track.d.ts +25 -22
- package/ietf/track.d.ts.map +1 -1
- package/ietf/track.js +48 -61
- package/ietf/track.js.map +1 -1
- package/ietf/version.d.ts +13 -42
- package/ietf/version.d.ts.map +1 -1
- package/ietf/version.js +22 -48
- package/ietf/version.js.map +1 -1
- package/implementation.d.ts +2 -0
- package/implementation.d.ts.map +1 -0
- package/implementation.js +5 -0
- package/implementation.js.map +1 -0
- package/index.d.ts +25 -10
- package/index.d.ts.map +1 -1
- package/index.js +19 -6
- package/index.js.map +1 -1
- package/internal.d.ts +1512 -64
- package/internal.d.ts.map +1 -1
- package/internal.js +557 -79
- package/internal.js.map +1 -1
- package/ledger.d.ts +23 -0
- package/ledger.d.ts.map +1 -0
- package/ledger.js +247 -0
- package/ledger.js.map +1 -0
- package/listing.d.ts +132 -0
- package/listing.d.ts.map +1 -0
- package/listing.js +486 -0
- package/listing.js.map +1 -0
- package/lite/announce.d.ts +124 -63
- package/lite/announce.d.ts.map +1 -1
- package/lite/announce.js +384 -158
- package/lite/announce.js.map +1 -1
- package/lite/announce_stream.d.ts +2 -0
- package/lite/announce_stream.d.ts.map +1 -0
- package/lite/announce_stream.js +92 -0
- package/lite/announce_stream.js.map +1 -0
- package/lite/answer.d.ts +22 -0
- package/lite/answer.d.ts.map +1 -0
- package/lite/answer.js +301 -0
- package/lite/answer.js.map +1 -0
- package/lite/auth.d.ts +45 -0
- package/lite/auth.d.ts.map +1 -0
- package/lite/auth.js +204 -0
- package/lite/auth.js.map +1 -0
- package/lite/compat.d.ts +31 -0
- package/lite/compat.d.ts.map +1 -0
- package/lite/compat.js +86 -0
- package/lite/compat.js.map +1 -0
- package/lite/connection.d.ts +1 -45
- package/lite/connection.d.ts.map +1 -1
- package/lite/connection.js +360 -77
- package/lite/connection.js.map +1 -1
- package/lite/datagram-end.d.ts +26 -0
- package/lite/datagram-end.d.ts.map +1 -0
- package/lite/datagram-end.js +30 -0
- package/lite/datagram-end.js.map +1 -0
- package/lite/datagram.d.ts +73 -8
- package/lite/datagram.d.ts.map +1 -1
- package/lite/datagram.js +144 -9
- package/lite/datagram.js.map +1 -1
- package/lite/duration.d.ts +6 -0
- package/lite/duration.d.ts.map +1 -0
- package/lite/duration.js +14 -0
- package/lite/duration.js.map +1 -0
- package/lite/error.d.ts +9 -0
- package/lite/error.d.ts.map +1 -0
- package/lite/error.js +24 -0
- package/lite/error.js.map +1 -0
- package/lite/fills.d.ts +162 -0
- package/lite/fills.d.ts.map +1 -0
- package/lite/fills.js +486 -0
- package/lite/fills.js.map +1 -0
- package/lite/fit.d.ts +49 -0
- package/lite/fit.d.ts.map +1 -0
- package/lite/fit.js +305 -0
- package/lite/fit.js.map +1 -0
- package/lite/goaway.d.ts +1 -1
- package/lite/goaway.d.ts.map +1 -1
- package/lite/goaway.js +5 -13
- package/lite/goaway.js.map +1 -1
- package/lite/group.d.ts +64 -13
- package/lite/group.d.ts.map +1 -1
- package/lite/group.js +108 -30
- package/lite/group.js.map +1 -1
- package/lite/identity.d.ts +25 -0
- package/lite/identity.d.ts.map +1 -0
- package/lite/identity.js +79 -0
- package/lite/identity.js.map +1 -0
- package/lite/index.d.ts +2 -1
- package/lite/index.d.ts.map +1 -1
- package/lite/index.js +2 -1
- package/lite/index.js.map +1 -1
- package/lite/message.d.ts +9 -1
- package/lite/message.d.ts.map +1 -1
- package/lite/message.js +28 -44
- package/lite/message.js.map +1 -1
- package/lite/priority.d.ts +9 -2
- package/lite/priority.d.ts.map +1 -1
- package/lite/priority.js +11 -105
- package/lite/priority.js.map +1 -1
- package/lite/probe.d.ts.map +1 -1
- package/lite/probe.js +9 -0
- package/lite/probe.js.map +1 -1
- package/lite/publisher.d.ts +10 -1
- package/lite/publisher.d.ts.map +1 -1
- package/lite/publisher.js +2548 -437
- package/lite/publisher.js.map +1 -1
- package/lite/routed.d.ts +59 -0
- package/lite/routed.d.ts.map +1 -0
- package/lite/routed.js +564 -0
- package/lite/routed.js.map +1 -0
- package/lite/session.d.ts +1 -27
- package/lite/session.d.ts.map +1 -1
- package/lite/session.js +0 -99
- package/lite/session.js.map +1 -1
- package/lite/setup.d.ts +29 -2
- package/lite/setup.d.ts.map +1 -1
- package/lite/setup.js +95 -21
- package/lite/setup.js.map +1 -1
- package/lite/stream.d.ts +5 -11
- package/lite/stream.d.ts.map +1 -1
- package/lite/stream.js +5 -1
- package/lite/stream.js.map +1 -1
- package/lite/subscribe.d.ts +475 -75
- package/lite/subscribe.d.ts.map +1 -1
- package/lite/subscribe.js +1373 -142
- package/lite/subscribe.js.map +1 -1
- package/lite/subscriber.d.ts +7 -44
- package/lite/subscriber.d.ts.map +1 -1
- package/lite/subscriber.js +3290 -515
- package/lite/subscriber.js.map +1 -1
- package/lite/track.d.ts +24 -9
- package/lite/track.d.ts.map +1 -1
- package/lite/track.js +116 -37
- package/lite/track.js.map +1 -1
- package/lite/tracks.d.ts +55 -0
- package/lite/tracks.d.ts.map +1 -0
- package/lite/tracks.js +114 -0
- package/lite/tracks.js.map +1 -0
- package/lite/version.d.ts +132 -24
- package/lite/version.d.ts.map +1 -1
- package/lite/version.js +378 -33
- package/lite/version.js.map +1 -1
- package/meta.d.ts +77 -0
- package/meta.d.ts.map +1 -0
- package/meta.js +130 -0
- package/meta.js.map +1 -0
- package/meta_api.d.ts +7 -0
- package/meta_api.d.ts.map +1 -0
- package/meta_api.js +7 -0
- package/meta_api.js.map +1 -0
- package/mint.d.ts +28 -0
- package/mint.d.ts.map +1 -0
- package/mint.js +66 -0
- package/mint.js.map +1 -0
- package/open.d.ts +63 -0
- package/open.d.ts.map +1 -0
- package/open.js +250 -0
- package/open.js.map +1 -0
- package/origin.d.ts +392 -140
- package/origin.d.ts.map +1 -1
- package/origin.js +2533 -686
- package/origin.js.map +1 -1
- package/package.json +8 -13
- package/path.d.ts +51 -51
- package/path.d.ts.map +1 -1
- package/path.js +210 -57
- package/path.js.map +1 -1
- package/payload.d.ts +33 -0
- package/payload.d.ts.map +1 -0
- package/payload.js +65 -0
- package/payload.js.map +1 -0
- package/prefix.d.ts +152 -0
- package/prefix.d.ts.map +1 -0
- package/prefix.js +349 -0
- package/prefix.js.map +1 -0
- package/priority.d.ts +8 -0
- package/priority.d.ts.map +1 -0
- package/priority.js +185 -0
- package/priority.js.map +1 -0
- package/queue.d.ts +2 -0
- package/queue.d.ts.map +1 -0
- package/queue.js +46 -0
- package/queue.js.map +1 -0
- package/ranges.d.ts +36 -0
- package/ranges.d.ts.map +1 -0
- package/ranges.js +312 -0
- package/ranges.js.map +1 -0
- package/rescale.d.ts +24 -0
- package/rescale.d.ts.map +1 -0
- package/rescale.js +39 -0
- package/rescale.js.map +1 -0
- package/resume.d.ts +55 -0
- package/resume.d.ts.map +1 -0
- package/resume.js +4173 -0
- package/resume.js.map +1 -0
- package/resume.test-util.d.ts +2 -0
- package/resume.test-util.d.ts.map +1 -0
- package/resume.test-util.js +25 -0
- package/resume.test-util.js.map +1 -0
- package/skips.d.ts +48 -0
- package/skips.d.ts.map +1 -0
- package/skips.js +182 -0
- package/skips.js.map +1 -0
- package/stream.d.ts +75 -37
- package/stream.d.ts.map +1 -1
- package/stream.js +236 -92
- package/stream.js.map +1 -1
- package/subscription.test-util.d.ts +2 -0
- package/subscription.test-util.d.ts.map +1 -0
- package/subscription.test-util.js +49 -0
- package/subscription.test-util.js.map +1 -0
- package/tail.d.ts +23 -14
- package/tail.d.ts.map +1 -1
- package/tail.js +224 -97
- package/tail.js.map +1 -1
- package/time.d.ts +41 -102
- package/time.d.ts.map +1 -1
- package/time.js +129 -91
- package/time.js.map +1 -1
- package/timed.d.ts +21 -0
- package/timed.d.ts.map +1 -0
- package/timed.js +2 -0
- package/timed.js.map +1 -0
- package/track.d.ts +577 -245
- package/track.d.ts.map +1 -1
- package/track.js +7306 -771
- package/track.js.map +1 -1
- package/track_api.d.ts +7 -0
- package/track_api.d.ts.map +1 -0
- package/track_api.js +7 -0
- package/track_api.js.map +1 -0
- package/util/abort.d.ts +1 -0
- package/util/abort.d.ts.map +1 -1
- package/util/abort.js +23 -1
- package/util/abort.js.map +1 -1
- package/util/announce.d.ts +4 -0
- package/util/announce.d.ts.map +1 -0
- package/util/announce.js +11 -0
- package/util/announce.js.map +1 -0
- package/util/bigint.d.ts +3 -0
- package/util/bigint.d.ts.map +1 -0
- package/util/bigint.js +8 -0
- package/util/bigint.js.map +1 -0
- package/util/change.d.ts +12 -0
- package/util/change.d.ts.map +1 -0
- package/util/change.js +18 -0
- package/util/change.js.map +1 -0
- package/util/deadline.d.ts +2 -0
- package/util/deadline.d.ts.map +1 -0
- package/util/deadline.js +108 -0
- package/util/deadline.js.map +1 -0
- package/util/decode_error.d.ts +3 -0
- package/util/decode_error.d.ts.map +1 -0
- package/util/decode_error.js +11 -0
- package/util/decode_error.js.map +1 -0
- package/util/demand.d.ts +8 -0
- package/util/demand.d.ts.map +1 -0
- package/util/demand.js +24 -0
- package/util/demand.js.map +1 -0
- package/util/given_up.d.ts +2 -0
- package/util/given_up.d.ts.map +1 -0
- package/util/given_up.js +101 -0
- package/util/given_up.js.map +1 -0
- package/util/hex.d.ts +6 -0
- package/util/hex.d.ts.map +1 -1
- package/util/hex.js +19 -4
- package/util/hex.js.map +1 -1
- package/util/key.d.ts +15 -0
- package/util/key.d.ts.map +1 -0
- package/util/key.js +38 -0
- package/util/key.js.map +1 -0
- package/util/limits.d.ts +2 -0
- package/util/limits.d.ts.map +1 -0
- package/util/limits.js +76 -0
- package/util/limits.js.map +1 -0
- package/util/observed.d.ts +23 -0
- package/util/observed.d.ts.map +1 -0
- package/util/observed.js +122 -0
- package/util/observed.js.map +1 -0
- package/util/sorted.d.ts +2 -0
- package/util/sorted.d.ts.map +1 -0
- package/util/sorted.js +149 -0
- package/util/sorted.js.map +1 -0
- package/util/timeout.d.ts +2 -1
- package/util/timeout.d.ts.map +1 -1
- package/util/timeout.js +13 -9
- package/util/timeout.js.map +1 -1
- package/util/timer.d.ts +2 -0
- package/util/timer.d.ts.map +1 -0
- package/util/timer.js +19 -0
- package/util/timer.js.map +1 -0
- package/util/utf8.d.ts +2 -0
- package/util/utf8.d.ts.map +1 -1
- package/util/utf8.js +7 -1
- package/util/utf8.js.map +1 -1
- package/util/varint.d.ts.map +1 -1
- package/util/varint.js +8 -1
- package/util/varint.js.map +1 -1
- package/util/watch.d.ts +8 -0
- package/util/watch.d.ts.map +1 -0
- package/util/watch.js +38 -0
- package/util/watch.js.map +1 -0
- package/util/yield.d.ts +2 -0
- package/util/yield.d.ts.map +1 -0
- package/util/yield.js +31 -0
- package/util/yield.js.map +1 -0
- package/varint.d.ts +0 -29
- package/varint.d.ts.map +1 -1
- package/varint.js +7 -28
- package/varint.js.map +1 -1
- package/varint_api.d.ts +7 -0
- package/varint_api.d.ts.map +1 -0
- package/varint_api.js +7 -0
- package/varint_api.js.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +4 -0
- package/version.js.map +1 -0
- package/window.d.ts +570 -0
- package/window.d.ts.map +1 -0
- package/window.js +1677 -0
- package/window.js.map +1 -0
- package/wire.d.ts +145 -30
- package/wire.d.ts.map +1 -1
- package/wire.js +27 -0
- package/wire.js.map +1 -1
- package/connection/established.d.ts +0 -53
- package/connection/established.d.ts.map +0 -1
- package/connection/established.js +0 -2
- package/connection/established.js.map +0 -1
- package/ietf/adapter.d.ts +0 -75
- package/ietf/adapter.d.ts.map +0 -1
- package/ietf/adapter.js +0 -699
- package/ietf/adapter.js.map +0 -1
- package/lite/datagram_stream.d.ts +0 -8
- package/lite/datagram_stream.d.ts.map +0 -1
- package/lite/datagram_stream.js +0 -43
- package/lite/datagram_stream.js.map +0 -1
- package/lite/fetch.d.ts +0 -28
- package/lite/fetch.d.ts.map +0 -1
- package/lite/fetch.js +0 -78
- package/lite/fetch.js.map +0 -1
- package/util/log.d.ts +0 -5
- package/util/log.d.ts.map +0 -1
- package/util/log.js +0 -16
- package/util/log.js.map +0 -1
- package/zod.d.ts +0 -13
- package/zod.d.ts.map +0 -1
- package/zod.js +0 -18
- package/zod.js.map +0 -1
package/origin.d.ts
CHANGED
|
@@ -4,54 +4,110 @@
|
|
|
4
4
|
* Publish broadcasts into an origin and hand the origin to one or more connections to
|
|
5
5
|
* serve them; the broadcasts outlive any single session. Hand the same (or another)
|
|
6
6
|
* origin to a connection's `consume` option and the peer's announced routes appear
|
|
7
|
-
* in the table too: each route covers a path prefix,
|
|
8
|
-
* it resolves through the session that announced it.
|
|
9
|
-
* `rs/moq-net`.
|
|
7
|
+
* in the table too, under whatever its readers watch: each route covers a path prefix,
|
|
8
|
+
* and a request for a path under it resolves through the session that announced it.
|
|
9
|
+
* Mirrors the `origin` module in `rs/moq-net`.
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
13
|
import { type GetPromise, type Getter } from "@moq/signals";
|
|
14
|
-
import * as
|
|
14
|
+
import type * as Announce from "./announce.ts";
|
|
15
|
+
import type { Credential } from "./auth.ts";
|
|
15
16
|
import * as broadcast from "./broadcast.ts";
|
|
16
|
-
import {
|
|
17
|
+
import { type Cost } from "./hop.ts";
|
|
18
|
+
import * as Identity from "./identity.ts";
|
|
17
19
|
import * as Path from "./path.ts";
|
|
18
|
-
export type { Cost,
|
|
19
|
-
export { isAnonymous } from "./hop.ts";
|
|
20
|
+
export type { Cost, RouteInfo } from "./hop.ts";
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* The read side of an origin, borrowed: resolve broadcasts by path and watch what is
|
|
23
|
+
* available, without publishing into it or owning its lifecycle.
|
|
22
24
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* Code that only reads an origin should accept this type. {@link Consumer} implements it
|
|
26
|
+
* and {@link Table} extends it, so `producer.consume()`, a borrowed table, and a structural
|
|
27
|
+
* equivalent all fit.
|
|
26
28
|
*
|
|
27
29
|
* @public
|
|
28
30
|
*/
|
|
29
|
-
export interface
|
|
30
|
-
/** Settles once the origin closes; see {@link
|
|
31
|
+
export interface Reader {
|
|
32
|
+
/** Settles once the origin closes; see {@link Consumer.closed}. */
|
|
31
33
|
readonly closed: GetPromise<Error | null>;
|
|
32
34
|
/** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
|
|
33
35
|
readonly discovery: Getter<boolean | undefined>;
|
|
34
|
-
/**
|
|
35
|
-
createBroadcast(path: Path.Valid): broadcast.Producer;
|
|
36
|
-
/** Resolve `path`, optionally waiting for an announcement; see {@link Consumer.request}. */
|
|
36
|
+
/** Resolve one publisher identity at `path`; see {@link Consumer.request}. */
|
|
37
37
|
request(path: Path.Valid, options?: RequestOptions): Requesting;
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
/** The available broadcasts
|
|
41
|
-
announced(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
/** Follow `path` across publisher identities; see {@link Consumer.follow}. */
|
|
39
|
+
follow(path: Path.Valid, options?: FollowOptions): Following;
|
|
40
|
+
/** The available broadcasts at or beneath `prefix`, as a live stream; see {@link Consumer.announced}. */
|
|
41
|
+
announced(prefix?: Path.Valid, options?: Announce.Options): Announce.Consumer;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A non-owning handle on an origin: publish into it and read it, without its lifecycle.
|
|
45
|
+
*
|
|
46
|
+
* What a shared connection lends out. {@link Producer} implements it, so code that is
|
|
47
|
+
* handed an origin rather than owning one should accept this type: closing the origin
|
|
48
|
+
* stays the owner's alone, and a borrower cannot express it. A borrower that only reads
|
|
49
|
+
* should accept {@link Reader} instead, so `producer.consume()` fits too.
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export interface Table extends Reader {
|
|
54
|
+
/** Create a route at exactly `path`, owning a new broadcast; see {@link Producer.route}. */
|
|
55
|
+
route(path: Path.Valid, options?: RouteOptions): Route;
|
|
56
|
+
/** Claim `prefix`, yielding the requests beneath it; see {@link Producer.claim}. */
|
|
57
|
+
claim(prefix: Path.Valid, options?: RouteOptions): Claim;
|
|
47
58
|
}
|
|
48
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* How an application advertises a {@link Route} or {@link Claim}: its visibility at creation,
|
|
61
|
+
* its price, its credential, and, rarely, a stable identity.
|
|
62
|
+
*
|
|
63
|
+
* The default announces at once, at cost 0, under the session's scope, serving a fresh random
|
|
64
|
+
* identity minted when the route or claim is created.
|
|
65
|
+
*/
|
|
66
|
+
export interface RouteOptions {
|
|
67
|
+
/**
|
|
68
|
+
* Create the route hidden: it exists for nobody until it announces. For a
|
|
69
|
+
* publisher that fills its catalog first, or answers a negotiation, before readers may find it.
|
|
70
|
+
*/
|
|
71
|
+
hidden?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* What pulling content via this route costs: lower wins among routes covering the same
|
|
74
|
+
* prefix and anonymity. A publisher prices content it already produces at zero, and content
|
|
75
|
+
* it would have to start producing on demand higher.
|
|
76
|
+
*/
|
|
77
|
+
cost?: Cost;
|
|
78
|
+
/**
|
|
79
|
+
* The credential the advertising request carries, from `auth.add()`. Only a session built
|
|
80
|
+
* on the handle that issued it presents it, as the token on its moq-transport
|
|
81
|
+
* PUBLISH_NAMESPACE; every other session advertises the route under its own scope.
|
|
82
|
+
*/
|
|
83
|
+
auth?: Credential;
|
|
84
|
+
/**
|
|
85
|
+
* Serve this stable identity `id` at `epoch`, in place of a freshly minted one.
|
|
86
|
+
*
|
|
87
|
+
* Only for a publisher that continues the identity's key space across restarts,
|
|
88
|
+
* announcing a higher `epoch` each time, such as a counter persisted on disk. Readers
|
|
89
|
+
* stitch every route of one identity together, so a publisher that restarts its group
|
|
90
|
+
* keys under an old identity splices unrelated groups into their tracks. The highest
|
|
91
|
+
* epoch wins over every older one of the identity, cheaper or not. Naming an identity grants
|
|
92
|
+
* nothing: publishing still needs the path's grant.
|
|
93
|
+
*/
|
|
94
|
+
identity?: {
|
|
95
|
+
id: Identity.Valid;
|
|
96
|
+
epoch: bigint;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** Options for resolving one publisher identity with {@link Consumer.request}. */
|
|
49
100
|
export interface RequestOptions {
|
|
50
|
-
/**
|
|
51
|
-
|
|
101
|
+
/** Refuse a different publisher identity, including an asynchronous answer or a retry. */
|
|
102
|
+
identity?: Identity.Valid;
|
|
103
|
+
}
|
|
104
|
+
/** Options for following a broadcast path with {@link Consumer.follow}. */
|
|
105
|
+
export interface FollowOptions {
|
|
106
|
+
/** Follow only this publisher identity, waiting for it to return across gaps. */
|
|
107
|
+
identity?: Identity.Valid;
|
|
52
108
|
}
|
|
53
109
|
/**
|
|
54
|
-
* The write side of an origin:
|
|
110
|
+
* The write side of an origin: route broadcasts into it by path and advertise them.
|
|
55
111
|
*
|
|
56
112
|
* Independent of any connection. A connection given this origin (via its `publish` option)
|
|
57
113
|
* announces and serves the table's originated advertisements for as long as the session
|
|
@@ -59,66 +115,108 @@ export interface RequestOptions {
|
|
|
59
115
|
* the origin down. A reconnecting session re-announces the table on each attach, so
|
|
60
116
|
* advertisements made while offline surface on the next connection.
|
|
61
117
|
*
|
|
62
|
-
* Create
|
|
63
|
-
* {@link
|
|
64
|
-
*
|
|
118
|
+
* Create a {@link route} at a path and fill its broadcast; create it hidden and
|
|
119
|
+
* {@link Route.announce} it once its first tracks exist, since nobody can see or reach a hidden
|
|
120
|
+
* route. To publish broadcasts on demand instead, {@link claim} a prefix and answer the
|
|
121
|
+
* requests beneath it.
|
|
65
122
|
*
|
|
66
123
|
* @public
|
|
67
124
|
*/
|
|
68
125
|
export declare class Producer implements Table {
|
|
69
126
|
#private;
|
|
70
127
|
constructor();
|
|
71
|
-
/**
|
|
72
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Narrow this handle to `prefixes` beneath `root`, presenting paths relative to that root.
|
|
130
|
+
* Each prefix covers its whole subtree. The result borrows the origin; see {@link close}.
|
|
131
|
+
*/
|
|
132
|
+
scope(root: Path.Valid, prefixes: Path.Prefixes): Producer;
|
|
133
|
+
/**
|
|
134
|
+
* Rank the link a session given this handle as its `consume` origin lands its routes
|
|
135
|
+
* through: higher wins, and every handle starts at the neutral 0. An integer from -128 to 127.
|
|
136
|
+
*
|
|
137
|
+
* Only an identity's newest epoch is eligible, but among eligible routes priority decides
|
|
138
|
+
* before cost, so links to different operators rank by this instead of comparing their
|
|
139
|
+
* prices. On moq-lite-07 a route ranks by the lowest priority of any link on its path. The
|
|
140
|
+
* result borrows the origin, as {@link scope}'s does, and its own derived handles keep its
|
|
141
|
+
* priority.
|
|
142
|
+
*/
|
|
143
|
+
withPriority(priority: number): Producer;
|
|
73
144
|
/**
|
|
74
145
|
* Settles once the origin closes: `null` on a clean close, or the abort {@link Error}.
|
|
75
146
|
* Peek it synchronously (`undefined` while open), observe it reactively, or `await` it.
|
|
76
147
|
*/
|
|
77
148
|
get closed(): GetPromise<Error | null>;
|
|
78
149
|
/**
|
|
79
|
-
* Create a
|
|
150
|
+
* Create a route at exactly `path`, owning a new broadcast to fill.
|
|
151
|
+
*
|
|
152
|
+
* This is how local content enters an origin. Fill the broadcast through
|
|
153
|
+
* {@link Route.broadcast}. The route serves a fresh random identity, minted here and kept
|
|
154
|
+
* for its lifetime, across {@link Route.withdraw} and {@link Route.announce}, since its
|
|
155
|
+
* keys continue: a new route is a new stream that never splices into an old one. A
|
|
156
|
+
* publisher that continues one key space across restarts may name a stable identity
|
|
157
|
+
* instead ({@link RouteOptions.identity}).
|
|
80
158
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
159
|
+
* Announced at once unless created {@link RouteOptions.hidden | hidden}. A hidden route
|
|
160
|
+
* exists for nobody until {@link Route.announce}: announce streams skip it and a request
|
|
161
|
+
* for its path finds nothing, on this origin exactly as at a peer. Create it hidden when
|
|
162
|
+
* the tracks a subscriber needs first, such as a catalog, are not there yet. To serve paths
|
|
163
|
+
* on demand without publishing each one, use {@link claim}.
|
|
85
164
|
*
|
|
86
|
-
*
|
|
87
|
-
* broadcast
|
|
88
|
-
*
|
|
89
|
-
*
|
|
165
|
+
* Closing the route retracts it and closes its broadcast, and so does closing the
|
|
166
|
+
* broadcast. Creating a path again supersedes the previous route: the origin retracts it
|
|
167
|
+
* and closes its broadcast, and tracks already subscribed keep serving until they end. At
|
|
168
|
+
* the same identity, a local broadcast competes on cost and wins ties.
|
|
90
169
|
*/
|
|
91
|
-
|
|
170
|
+
route(path: Path.Valid, options?: RouteOptions): Route;
|
|
92
171
|
/**
|
|
93
|
-
*
|
|
172
|
+
* Claim `prefix`, yielding the requests beneath it.
|
|
94
173
|
*
|
|
95
|
-
* A route is always a prefix:
|
|
96
|
-
* empty prefix claims every path). A service that only serves some of them
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* no announced local broadcast wins is handed to
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
174
|
+
* A route is always a prefix on the wire: a claim covers `prefix` and every path beneath it
|
|
175
|
+
* (the empty prefix claims every path). A service that only serves some of them advertises
|
|
176
|
+
* the covering prefix and rejects the rest as they are requested; consumers filter
|
|
177
|
+
* announced paths locally. The claim is priced, credentialed and shown like an exact
|
|
178
|
+
* route, and forwarded by sessions while it is visible.
|
|
179
|
+
*
|
|
180
|
+
* A consumer resolving a path under it that no announced local broadcast wins is handed to
|
|
181
|
+
* {@link Claim.requested} as a {@link Request}: answer it by serving a broadcast already held
|
|
182
|
+
* ({@link Request.serve}), under this claim's identity, or by creating the path's own exact
|
|
183
|
+
* route ({@link Request.route}), a job. The claim keeps its identity, minted unless
|
|
184
|
+
* {@link RouteOptions.identity} names one, for as long as it lives: each job's exact route
|
|
185
|
+
* carries its own, so a job that ends and restarts is a new stream at its path without
|
|
186
|
+
* touching the claim or its other paths. A publisher that knows its broadcasts creates each
|
|
187
|
+
* one's exact {@link route} instead, so subscribers can enumerate them.
|
|
188
|
+
*/
|
|
189
|
+
claim(prefix: Path.Valid, options?: RouteOptions): Claim;
|
|
107
190
|
/** A read handle for this origin, the side a connection's `publish` option borrows. */
|
|
108
191
|
consume(): Consumer;
|
|
109
192
|
/** Whether every attached session announces into the table; see {@link Consumer.discovery}. */
|
|
110
193
|
get discovery(): Getter<boolean | undefined>;
|
|
111
|
-
/** Resolve
|
|
194
|
+
/** Resolve one publisher identity at `path`; see {@link Consumer.request}. */
|
|
112
195
|
request(path: Path.Valid, options?: RequestOptions): Requesting;
|
|
113
|
-
/**
|
|
114
|
-
|
|
115
|
-
/** The available broadcasts
|
|
116
|
-
announced(
|
|
117
|
-
/**
|
|
196
|
+
/** Follow `path` across publisher identities; see {@link Consumer.follow}. */
|
|
197
|
+
follow(path: Path.Valid, options?: FollowOptions): Following;
|
|
198
|
+
/** The available broadcasts at or beneath `prefix`, as a live stream; see {@link Consumer.announced}. */
|
|
199
|
+
announced(prefix?: Path.Valid, options?: Announce.Options): Announce.Consumer;
|
|
200
|
+
/**
|
|
201
|
+
* Close the origin, every broadcast it still routes, and its announcement streams. Idempotent.
|
|
202
|
+
*
|
|
203
|
+
* A handle from {@link scope} borrows the origin: closing it
|
|
204
|
+
* withdraws only the broadcasts, routes, and sessions (with their answers) registered
|
|
205
|
+
* through it and refuses new ones, ignoring `abort`. Only the handle made with `new Producer()` closes the origin.
|
|
206
|
+
*/
|
|
118
207
|
close(abort?: Error): void;
|
|
119
208
|
}
|
|
120
209
|
/**
|
|
121
|
-
* An
|
|
210
|
+
* An owned request for one publisher identity at a broadcast path; see {@link Consumer.request}.
|
|
211
|
+
*
|
|
212
|
+
* Await {@link broadcast} for the broadcast, as Rust awaits `request(path)`; read {@link active} and
|
|
213
|
+
* {@link closed} to follow it reactively instead. The handle is not itself awaitable, so an
|
|
214
|
+
* `await` or an async return never takes the broadcast out from under the request that owns it.
|
|
215
|
+
*
|
|
216
|
+
* ```ts
|
|
217
|
+
* const request = origin.request(Path.from("room"));
|
|
218
|
+
* const broadcast = await request.broadcast();
|
|
219
|
+
* ```
|
|
122
220
|
*
|
|
123
221
|
* @public
|
|
124
222
|
*/
|
|
@@ -127,38 +225,52 @@ export declare class Requesting {
|
|
|
127
225
|
/** The requested path. */
|
|
128
226
|
readonly path: Path.Valid;
|
|
129
227
|
/**
|
|
130
|
-
* The
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* answer, which is assumed present rather than known live: a missing broadcast
|
|
135
|
-
* surfaces as a reset on the first track subscription, not here. Drops back to
|
|
136
|
-
* undefined when the providing route dies and resolves again when another appears.
|
|
137
|
-
*
|
|
138
|
-
* Yours for as long as the request is open: it is a handle of this request's own, so
|
|
139
|
-
* closing it ends your view of the path rather than the route everyone else reads.
|
|
140
|
-
* {@link close} releases whatever is current.
|
|
228
|
+
* The accepted broadcast, or undefined while the request is pending.
|
|
229
|
+
* Another route of the same identity taking over keeps
|
|
230
|
+
* this handle: its tracks resume on that route from the first group each reader lacks.
|
|
231
|
+
* Closing this handle affects only this request.
|
|
141
232
|
*/
|
|
142
233
|
readonly active: Getter<broadcast.Consumer | undefined>;
|
|
143
234
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
*
|
|
151
|
-
*
|
|
235
|
+
* Settles on refusal, origin shutdown, explicit close, or the accepted identity ending.
|
|
236
|
+
* Fails `Unroutable` while pending once discovery syncs without a route for it.
|
|
237
|
+
*/
|
|
238
|
+
readonly closed: GetPromise<Error | null>;
|
|
239
|
+
private constructor();
|
|
240
|
+
/**
|
|
241
|
+
* Resolves with the broadcast once {@link active} holds one. Rejects with the error
|
|
242
|
+
* {@link closed} carries if the request ends first, such as `Unroutable`, or with a
|
|
243
|
+
* `StreamCode.Cancel` error if it closed cleanly: this handle or its origin was closed. The
|
|
244
|
+
* answer is fixed by the first call, and every later call gets the same one. The request
|
|
245
|
+
* still owns the broadcast, so close the request, not only the broadcast, when done.
|
|
246
|
+
*/
|
|
247
|
+
broadcast(): Promise<broadcast.Consumer>;
|
|
248
|
+
/** Withdraw the request. The path stays routed for any other open request. Idempotent. */
|
|
249
|
+
close(): void;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* An owned follower of the publisher identities announced at a broadcast path; see {@link Consumer.follow}.
|
|
253
|
+
*
|
|
254
|
+
* @public
|
|
255
|
+
*/
|
|
256
|
+
export declare class Following {
|
|
257
|
+
#private;
|
|
258
|
+
/** The followed path. */
|
|
259
|
+
readonly path: Path.Valid;
|
|
260
|
+
/**
|
|
261
|
+
* The current announced broadcast, or undefined between publisher identities.
|
|
262
|
+
* Moves to each new identity, or waits for the pinned identity when one was requested.
|
|
263
|
+
* Another route of the same identity keeps this handle and resumes its tracks.
|
|
264
|
+
* Closing this handle affects only this follower.
|
|
152
265
|
*/
|
|
153
|
-
readonly
|
|
266
|
+
readonly active: Getter<broadcast.Consumer | undefined>;
|
|
154
267
|
/**
|
|
155
|
-
* Settles
|
|
156
|
-
*
|
|
157
|
-
* request is needed to try again.
|
|
268
|
+
* Settles on refusal, origin shutdown, or explicit close.
|
|
269
|
+
* Waits through gaps in announcements for a later start, even when pinned to an identity.
|
|
158
270
|
*/
|
|
159
271
|
readonly closed: GetPromise<Error | null>;
|
|
160
272
|
private constructor();
|
|
161
|
-
/** Withdraw the
|
|
273
|
+
/** Withdraw the follower. The path stays routed for any other open request. Idempotent. */
|
|
162
274
|
close(): void;
|
|
163
275
|
}
|
|
164
276
|
/**
|
|
@@ -170,7 +282,7 @@ export declare class Requesting {
|
|
|
170
282
|
*
|
|
171
283
|
* @public
|
|
172
284
|
*/
|
|
173
|
-
export declare class Consumer {
|
|
285
|
+
export declare class Consumer implements Reader {
|
|
174
286
|
#private;
|
|
175
287
|
private constructor();
|
|
176
288
|
/** Settles once the origin closes; see {@link Producer.closed}. */
|
|
@@ -186,75 +298,185 @@ export declare class Consumer {
|
|
|
186
298
|
*/
|
|
187
299
|
get discovery(): Getter<boolean | undefined>;
|
|
188
300
|
/**
|
|
189
|
-
* Resolve `path`,
|
|
301
|
+
* Resolve one publisher identity serving `path`, pinned to `identity` when given.
|
|
190
302
|
*
|
|
191
|
-
* The
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* falls back to that blind behavior only when discovery is unavailable. Close the request
|
|
198
|
-
* when done. On a closed origin it never resolves.
|
|
303
|
+
* The request owns discovery of its path until closed and retries route churn while
|
|
304
|
+
* pending. It fails `Unroutable` once at least one session is attached and every
|
|
305
|
+
* session's discovery has synced without a route for it, and can use a session without
|
|
306
|
+
* discovery instead. With no session attached, such as between reconnects, it waits. Once resolved it keeps
|
|
307
|
+
* that identity, ending when the identity stops serving. Use {@link follow} to move on
|
|
308
|
+
* to the next one. Await the handle for the broadcast, or the error ending it first.
|
|
199
309
|
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
* arrives. It matters only on an origin mixing sessions that announce with sessions that
|
|
205
|
-
* cannot, where a path only the silent session carries may sit behind another session's
|
|
206
|
-
* answer. Prefer {@link unroutable} and announcements over blind requests when the origin
|
|
207
|
-
* feeds from more than one connection.
|
|
310
|
+
* A job's exact route ({@link Request.route}) carries its own identity. On this origin, a
|
|
311
|
+
* request waiting on the job's claim resolves onto the job once its route announces. Through
|
|
312
|
+
* a peer's claim, the request resolves the claim's broadcast instead, which is reset once the
|
|
313
|
+
* job's route announces: read an on-demand job across a session with {@link follow}.
|
|
208
314
|
*/
|
|
209
315
|
request(path: Path.Valid, options?: RequestOptions): Requesting;
|
|
210
316
|
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
317
|
+
* Follow `path` across publisher identities, pinned to `identity` when given.
|
|
318
|
+
*
|
|
319
|
+
* `active` moves to each identity announced at the path, clears between them, and never
|
|
320
|
+
* closes on a gap: a pinned follower waits for its identity to return. Owns discovery of
|
|
321
|
+
* its path until closed. Requires discovery: a session without it never serves a follower.
|
|
322
|
+
* A selected handler's refusal or the origin closing ends it.
|
|
216
323
|
*/
|
|
217
|
-
|
|
324
|
+
follow(path: Path.Valid, options?: FollowOptions): Following;
|
|
218
325
|
/**
|
|
219
|
-
* The announced
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
326
|
+
* The paths announced at or beneath `prefix`, relative to the root, within this handle's
|
|
327
|
+
* scope, each reported as it becomes present or absent: every currently advertised one
|
|
328
|
+
* arrives first as `present`. Another identity taking a path over keeps it present;
|
|
329
|
+
* {@link follow} it to see the broadcast change. A local broadcast appears once it announces,
|
|
330
|
+
* exactly as a peer sees it. Only routes at or beneath the prefix are listed, unless
|
|
331
|
+
* `options.covering` also asks for every route whose subtree overlaps it, a broadcast
|
|
332
|
+
* included. The stream ends when the origin closes or the consumer is closed. Hidden routes
|
|
333
|
+
* are left out unless `options.hidden` opts in (see {@link Announce.Options}). While open, it
|
|
334
|
+
* watches the prefix: a `consume` session asks its peer for announcements there. Throws
|
|
335
|
+
* {@link Path.InvalidPrefix} for a prefix holding a `*`.
|
|
225
336
|
*/
|
|
226
|
-
announced(
|
|
337
|
+
announced(prefix?: Path.Valid, options?: Announce.Options): Announce.Consumer;
|
|
227
338
|
}
|
|
228
339
|
/**
|
|
229
|
-
*
|
|
230
|
-
*
|
|
340
|
+
* An exact route in an origin, owning its broadcast.
|
|
341
|
+
*
|
|
342
|
+
* Create one with {@link Producer.route}, or a job's with {@link Request.route}.
|
|
231
343
|
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
344
|
+
* ```ts
|
|
345
|
+
* // Fill the catalog before readers can find it.
|
|
346
|
+
* const route = origin.route(Path.from("live/alice"), { hidden: true });
|
|
347
|
+
* route.broadcast.createTrack("catalog.json");
|
|
348
|
+
* route.announce(); // visible now, same identity
|
|
349
|
+
* route.setCost(5n); // re-prices in place
|
|
350
|
+
* route.withdraw(); // hidden; announce() again continues the same stream
|
|
351
|
+
* ```
|
|
352
|
+
*
|
|
353
|
+
* {@link close} retracts it and closes its broadcast, and so does closing the broadcast.
|
|
234
354
|
*
|
|
235
355
|
* @public
|
|
236
356
|
*/
|
|
237
|
-
export declare class
|
|
357
|
+
export declare class Route {
|
|
238
358
|
#private;
|
|
239
|
-
/** The
|
|
240
|
-
readonly
|
|
359
|
+
/** The broadcast this route owns, to fill with tracks. */
|
|
360
|
+
readonly broadcast: broadcast.Producer;
|
|
241
361
|
private constructor();
|
|
242
|
-
/**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
/**
|
|
362
|
+
/**
|
|
363
|
+
* The stream this route serves, minted when it was created unless {@link RouteOptions.identity}
|
|
364
|
+
* named one, and fixed for the route's life.
|
|
365
|
+
*/
|
|
366
|
+
get identity(): Identity.Valid;
|
|
367
|
+
/**
|
|
368
|
+
* Make the route visible, or keep it so. Idempotent.
|
|
369
|
+
*
|
|
370
|
+
* Visible to local consumers before it returns. A job's route ({@link Request.route}) also
|
|
371
|
+
* releases the requesters waiting on its path through the claim, which resolve it afresh: onto
|
|
372
|
+
* this route, under its own identity, unless pinned to the claim's. Throws once the route or its
|
|
373
|
+
* broadcast closed, and, announcing nothing, with {@link StreamCode | StreamCode.Unroutable} when
|
|
374
|
+
* a job's request was released or its claim retracted meanwhile: that route can never announce.
|
|
375
|
+
* A job's route priced above its visible claim at the claim's own prefix (see
|
|
376
|
+
* {@link Request.route}) throws the same way, and its first announce can never be retried.
|
|
377
|
+
*/
|
|
378
|
+
announce(): void;
|
|
379
|
+
/**
|
|
380
|
+
* Hide the route from everyone, local and remote alike, keeping its broadcast and identity:
|
|
381
|
+
* {@link announce} brings the same stream back. Requests for the path fail with
|
|
382
|
+
* {@link StreamCode | StreamCode.Unroutable} meanwhile, while tracks already in flight carry
|
|
383
|
+
* on to their own end. Idempotent.
|
|
384
|
+
*/
|
|
385
|
+
withdraw(): void;
|
|
386
|
+
/** Whether the route is visible. */
|
|
387
|
+
get announced(): boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Re-price the route: lower wins among routes covering the same prefix and anonymity. A
|
|
390
|
+
* visible route changes in place, as an update to its readers; a hidden one announces at
|
|
391
|
+
* this price. Throws once the route or its broadcast closed, and with
|
|
392
|
+
* {@link StreamCode | StreamCode.Unroutable}, keeping the old price, when a job's route would
|
|
393
|
+
* cost more than its visible claim at the claim's own prefix (see {@link Request.route}).
|
|
394
|
+
*/
|
|
395
|
+
setCost(cost: Cost): void;
|
|
396
|
+
/**
|
|
397
|
+
* Swap the credential the advertising request carries; see {@link RouteOptions.auth}.
|
|
398
|
+
* Undefined advertises under the session's scope. Throws once the route or its broadcast closed.
|
|
399
|
+
*/
|
|
400
|
+
setAuth(auth?: Credential): void;
|
|
401
|
+
/** Retract the route for good, closing its broadcast and refusing a job's waiting requesters. Idempotent. */
|
|
248
402
|
close(): void;
|
|
249
|
-
/**
|
|
403
|
+
/** Calls {@link close}, so `using` retracts the route. */
|
|
404
|
+
[Symbol.dispose](): void;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* A prefix route in an origin: a claim that every path beneath a prefix can be served,
|
|
408
|
+
* answering each request as it arrives.
|
|
409
|
+
*
|
|
410
|
+
* Create one with {@link Producer.claim}. Requests arrive on {@link requested}; answer each by
|
|
411
|
+
* serving a broadcast already held or by creating the path's own {@link Route}.
|
|
412
|
+
*
|
|
413
|
+
* ```ts
|
|
414
|
+
* const claim = origin.claim(Path.from("room"));
|
|
415
|
+
* for await (const request of claim.requested()) {
|
|
416
|
+
* const route = request.route({ hidden: true });
|
|
417
|
+
* route.broadcast.createTrack("catalog.json");
|
|
418
|
+
* route.announce(); // the requesters read it
|
|
419
|
+
* }
|
|
420
|
+
* ```
|
|
421
|
+
*
|
|
422
|
+
* {@link close} retracts it and rejects the requests still waiting.
|
|
423
|
+
*
|
|
424
|
+
* @public
|
|
425
|
+
*/
|
|
426
|
+
export declare class Claim {
|
|
427
|
+
#private;
|
|
428
|
+
private constructor();
|
|
429
|
+
/**
|
|
430
|
+
* The stream this claim serves, minted when it was created unless {@link RouteOptions.identity}
|
|
431
|
+
* named one. A session's claim follows its peer's.
|
|
432
|
+
*/
|
|
433
|
+
get identity(): Identity.Valid;
|
|
434
|
+
/**
|
|
435
|
+
* Make the claim visible, or keep it so. Idempotent. Visible to local consumers before it
|
|
436
|
+
* returns. Throws once the claim or the origin closed, and with
|
|
437
|
+
* {@link StreamCode | StreamCode.Unroutable}, staying hidden, when it would cost less than a
|
|
438
|
+
* visible job's route at its own prefix (see {@link Request.route}).
|
|
439
|
+
*/
|
|
440
|
+
announce(): void;
|
|
441
|
+
/**
|
|
442
|
+
* Hide the claim from everyone, local and remote alike, keeping its identity: {@link announce}
|
|
443
|
+
* brings it back. Requests beneath it fail with {@link StreamCode | StreamCode.Unroutable}
|
|
444
|
+
* meanwhile. Idempotent.
|
|
445
|
+
*/
|
|
446
|
+
withdraw(): void;
|
|
447
|
+
/** Whether the claim is visible. */
|
|
448
|
+
get announced(): boolean;
|
|
449
|
+
/**
|
|
450
|
+
* Re-price the claim: lower wins among routes covering the same prefix and anonymity. A
|
|
451
|
+
* visible claim changes in place, as an update to its readers; a hidden one announces at
|
|
452
|
+
* this price. Throws once the claim or the origin closed, and with
|
|
453
|
+
* {@link StreamCode | StreamCode.Unroutable}, keeping the old price, when the claim would cost
|
|
454
|
+
* less than a visible job's route at its own prefix (see {@link Request.route}).
|
|
455
|
+
*/
|
|
456
|
+
setCost(cost: Cost): void;
|
|
457
|
+
/**
|
|
458
|
+
* Swap the credential the advertising request carries; see {@link RouteOptions.auth}.
|
|
459
|
+
* Undefined advertises under the session's scope. Throws once the claim or the origin closed.
|
|
460
|
+
*/
|
|
461
|
+
setAuth(auth?: Credential): void;
|
|
462
|
+
/**
|
|
463
|
+
* The requests beneath this claim, as they arrive, each to answer with {@link Request.serve},
|
|
464
|
+
* {@link Request.route} or {@link Request.reject}. Advancing the iterator or closing it without
|
|
465
|
+
* answering rejects the request. Ends once the claim is closed or the origin closes.
|
|
466
|
+
*/
|
|
250
467
|
requested(): AsyncIterableIterator<Request>;
|
|
468
|
+
/** Retract the claim for good, rejecting the requests still waiting. Idempotent. */
|
|
469
|
+
close(): void;
|
|
470
|
+
/** Calls {@link close}, so `using` retracts the claim. */
|
|
471
|
+
[Symbol.dispose](): void;
|
|
251
472
|
}
|
|
252
473
|
/**
|
|
253
474
|
* A pending request for a broadcast to be served on demand.
|
|
254
475
|
*
|
|
255
|
-
* Yielded by {@link
|
|
256
|
-
*
|
|
257
|
-
*
|
|
476
|
+
* Yielded by {@link Claim.requested}. Answer it one of three ways: {@link serve} a broadcast
|
|
477
|
+
* already held, under the claim's identity; create the path's own exact route with
|
|
478
|
+
* {@link route}, a job of its own identity; or {@link reject} it with an error. Advancing the iterator or closing it
|
|
479
|
+
* without answering rejects the request.
|
|
258
480
|
*
|
|
259
481
|
* @public
|
|
260
482
|
*/
|
|
@@ -264,12 +486,42 @@ export declare class Request {
|
|
|
264
486
|
readonly path: Path.Valid;
|
|
265
487
|
private constructor();
|
|
266
488
|
/**
|
|
267
|
-
*
|
|
489
|
+
* Resolves once no requester waits on the answer any more: each left, or the origin moved
|
|
490
|
+
* them to another route. Final: a later requester gets a new request.
|
|
491
|
+
*/
|
|
492
|
+
unwanted(): Promise<void>;
|
|
493
|
+
/**
|
|
494
|
+
* Answer with the path's own exact route, owning a new broadcast.
|
|
495
|
+
*
|
|
496
|
+
* The route mints its own identity unless `options` names one, as {@link Producer.route}
|
|
497
|
+
* does: the job is its own stream, so a job that ends and restarts beneath the same claim is a
|
|
498
|
+
* new stream at its path, and the claim keeps its identity and keeps answering later
|
|
499
|
+
* requests. A reader that resolved the path through the claim moves to the job's identity as a
|
|
500
|
+
* new stream: a follower is handed the job's broadcast, and a request pinned to the claim's
|
|
501
|
+
* identity is refused. Created visible, the route announces now and releases the requesters
|
|
502
|
+
* waiting on its path, which resolve it afresh. Created {@link RouteOptions.hidden | hidden},
|
|
503
|
+
* they wait until {@link Route.announce}, so the job can fill its catalog first; closing the
|
|
504
|
+
* route or its broadcast before then refuses them.
|
|
505
|
+
*
|
|
506
|
+
* At the claim's own prefix, the job may cost no more than the claim: both rank in one tier,
|
|
507
|
+
* where cost comes first, so a pricier job would lose its path to the claim, which would ask for
|
|
508
|
+
* another job. Neither may be re-priced past the other while both are visible.
|
|
509
|
+
*
|
|
510
|
+
* Throws {@link StreamCode | StreamCode.Unroutable} on a request a session forwarded, which can
|
|
511
|
+
* only {@link serve} its peer's broadcast, when `options` price the job above its claim at the
|
|
512
|
+
* claim's own prefix, refusing the requesters, and, announcing nothing, once the request was
|
|
513
|
+
* released or its claim retracted. Otherwise it throws as {@link Producer.route} does.
|
|
514
|
+
*/
|
|
515
|
+
route(options?: RouteOptions): Route;
|
|
516
|
+
/**
|
|
517
|
+
* Serve a held broadcast under this claim without announcing an exact route.
|
|
268
518
|
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
519
|
+
* Takes ownership of a consumer; a producer stays the caller's. Every answer at this
|
|
520
|
+
* path belongs to the claim's identity and must continue the same keys and
|
|
521
|
+
* bytes. Start a new claim for different content, or use {@link route} for a job
|
|
522
|
+
* that can restart independently, whose route carries its own identity.
|
|
271
523
|
*/
|
|
272
|
-
|
|
524
|
+
serve(source: broadcast.Producer | broadcast.Consumer): void;
|
|
273
525
|
/** Reject the request, resolving every awaiting requester with `err`. */
|
|
274
526
|
reject(err: Error): void;
|
|
275
527
|
}
|