@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/ietf/fetch.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Writer } from "../stream.js";
|
|
2
|
-
import
|
|
2
|
+
import * as Filter from "./filter.js";
|
|
3
3
|
import * as Message from "./message.js";
|
|
4
4
|
import * as Namespace from "./namespace.js";
|
|
5
5
|
import { Parameters } from "./parameters.js";
|
|
6
|
-
import {
|
|
6
|
+
import { DEFAULT_WIRE } from "./priority.js";
|
|
7
|
+
import * as Properties from "./properties.js";
|
|
8
|
+
import { RequestOk } from "./request.js";
|
|
9
|
+
import { GroupOrder } from "./subscribe.js";
|
|
10
|
+
import { isDraft23 } from "./version.js";
|
|
7
11
|
/**
|
|
8
|
-
* The header that begins a fetch stream (draft-
|
|
9
|
-
* answers. Written by the publisher when serving a subscription's fill.
|
|
12
|
+
* The header that begins a fetch stream (draft-22 section 11.4), naming the request it
|
|
13
|
+
* answers. Written by the publisher when serving a FETCH or a subscription's fill.
|
|
10
14
|
*/
|
|
11
15
|
export class FetchHeader {
|
|
12
16
|
/** The uni stream type, not a control message id. */
|
|
@@ -28,127 +32,202 @@ export class FetchHeader {
|
|
|
28
32
|
return new FetchHeader({ requestId: await r.u62() });
|
|
29
33
|
}
|
|
30
34
|
}
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
/** The Fetch Type tags of draft-18. */
|
|
36
|
+
const STANDALONE = 0x1;
|
|
37
|
+
const RELATIVE_JOINING = 0x2;
|
|
38
|
+
const ABSOLUTE_JOINING = 0x3;
|
|
39
|
+
/** A FETCH request. */
|
|
35
40
|
export class Fetch {
|
|
36
41
|
static id = 0x16;
|
|
37
42
|
requestId;
|
|
38
|
-
|
|
43
|
+
/** What the request asks for. */
|
|
44
|
+
type;
|
|
45
|
+
/** The SUBSCRIBER_PRIORITY wire byte, lower first. */
|
|
46
|
+
subscriberPriority;
|
|
47
|
+
/** The order the response's groups go out in, or the publisher's pick when absent. */
|
|
48
|
+
groupOrder;
|
|
49
|
+
/** Whether the request carried Range Filters, which we refuse. Never encoded. */
|
|
50
|
+
rangeFilters;
|
|
51
|
+
/** Whether the requester wants Track Properties in FETCH_OK (INCLUDE_PROPERTIES, draft-22). */
|
|
52
|
+
propertiesWanted;
|
|
53
|
+
constructor({ requestId, type, subscriberPriority = DEFAULT_WIRE, groupOrder, rangeFilters = false, propertiesWanted = true, }) {
|
|
39
54
|
this.requestId = requestId;
|
|
55
|
+
this.type = type;
|
|
56
|
+
this.subscriberPriority = subscriberPriority;
|
|
57
|
+
this.groupOrder = groupOrder;
|
|
58
|
+
this.rangeFilters = rangeFilters;
|
|
59
|
+
this.propertiesWanted = propertiesWanted;
|
|
60
|
+
}
|
|
61
|
+
async #encode(w, version) {
|
|
62
|
+
await w.u62(this.requestId);
|
|
63
|
+
const params = new Parameters();
|
|
64
|
+
params.subscriberPriority = this.subscriberPriority;
|
|
65
|
+
if (this.groupOrder !== undefined)
|
|
66
|
+
params.groupOrder = this.groupOrder === "ascending" ? GroupOrder.Ascending : GroupOrder.Descending;
|
|
67
|
+
const type = this.type;
|
|
68
|
+
if (Filter.isDraft20(version)) {
|
|
69
|
+
// The joining forms and the Fetch Type tag are gone in draft-22.
|
|
70
|
+
if (type.kind !== "filtered")
|
|
71
|
+
throw new Error(`${type.kind} FETCH needs draft-18`);
|
|
72
|
+
await Namespace.encodeTrack(w, type.trackNamespace, type.trackName);
|
|
73
|
+
params.subscriptionFilter = type.filter;
|
|
74
|
+
// The default is 1, so only the opt-out is worth bytes.
|
|
75
|
+
if (!this.propertiesWanted)
|
|
76
|
+
params.includeProperties = false;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
switch (type.kind) {
|
|
80
|
+
case "standalone":
|
|
81
|
+
await w.u53(STANDALONE);
|
|
82
|
+
await Namespace.encodeTrack(w, type.trackNamespace, type.trackName);
|
|
83
|
+
await w.u62(type.start.group);
|
|
84
|
+
await w.u62(type.start.object);
|
|
85
|
+
await w.u62(type.end.group);
|
|
86
|
+
await w.u62(type.end.object);
|
|
87
|
+
break;
|
|
88
|
+
case "relativeJoining":
|
|
89
|
+
await w.u53(RELATIVE_JOINING);
|
|
90
|
+
await w.u62(type.subscription);
|
|
91
|
+
await w.u62(type.offset);
|
|
92
|
+
break;
|
|
93
|
+
case "absoluteJoining":
|
|
94
|
+
await w.u53(ABSOLUTE_JOINING);
|
|
95
|
+
await w.u62(type.subscription);
|
|
96
|
+
await w.u62(type.group);
|
|
97
|
+
break;
|
|
98
|
+
case "filtered":
|
|
99
|
+
throw new Error("filtered FETCH needs draft-22");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
await params.encode(w, version);
|
|
40
103
|
}
|
|
41
|
-
async
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
async encode(w, _version) {
|
|
45
|
-
return Message.encode(w, this.#encode.bind(this));
|
|
104
|
+
async encode(w, version) {
|
|
105
|
+
return Message.encode(w, (mw) => this.#encode(mw, version));
|
|
46
106
|
}
|
|
47
107
|
static async decode(r, version) {
|
|
48
108
|
return Message.decode(r, (mr) => Fetch.#decode(mr, version));
|
|
49
109
|
}
|
|
50
110
|
static async #decode(r, version) {
|
|
51
111
|
const requestId = await r.u62();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
if (isDraft20(version)) {
|
|
60
|
-
// Draft-20 names the track up front and moves the range into LOCATION_FILTER.
|
|
61
|
-
await Namespace.decode(r);
|
|
62
|
-
await r.string();
|
|
112
|
+
let type;
|
|
113
|
+
if (Filter.isDraft20(version)) {
|
|
114
|
+
// Draft-22 names the track up front and moves the range into LOCATION_FILTER.
|
|
115
|
+
const { namespace, name } = await Namespace.decodeTrack(r);
|
|
116
|
+
// Placeholder until the parameters name the filter.
|
|
117
|
+
type = { kind: "filtered", trackNamespace: namespace, trackName: name, filter: { kind: "unfiltered" } };
|
|
63
118
|
}
|
|
64
119
|
else {
|
|
65
120
|
const fetchType = await r.u53();
|
|
66
121
|
switch (fetchType) {
|
|
67
|
-
case
|
|
68
|
-
await Namespace.
|
|
69
|
-
await r.
|
|
70
|
-
|
|
71
|
-
|
|
122
|
+
case STANDALONE: {
|
|
123
|
+
const { namespace, name } = await Namespace.decodeTrack(r);
|
|
124
|
+
const start = { group: await r.u62(), object: await r.u62() };
|
|
125
|
+
const end = { group: await r.u62(), object: await r.u62() };
|
|
126
|
+
type = { kind: "standalone", trackNamespace: namespace, trackName: name, start, end };
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
case RELATIVE_JOINING:
|
|
130
|
+
type = { kind: "relativeJoining", subscription: await r.u62(), offset: await r.u62() };
|
|
72
131
|
break;
|
|
73
|
-
case
|
|
74
|
-
|
|
75
|
-
await r.u62();
|
|
76
|
-
await r.u62();
|
|
132
|
+
case ABSOLUTE_JOINING:
|
|
133
|
+
type = { kind: "absoluteJoining", subscription: await r.u62(), group: await r.u62() };
|
|
77
134
|
break;
|
|
78
135
|
default:
|
|
79
136
|
throw new Error(`unknown fetch type: ${fetchType}`);
|
|
80
137
|
}
|
|
81
138
|
}
|
|
82
|
-
const params = await Parameters.decode(r, version);
|
|
83
|
-
if (params.rangeFilters && !hasRangeFilters(version)) {
|
|
84
|
-
throw new Error("Range Filters need draft-
|
|
139
|
+
const params = await Parameters.decode(r, version, "fetch");
|
|
140
|
+
if (params.rangeFilters && !Filter.hasRangeFilters(version)) {
|
|
141
|
+
throw new Error("Range Filters need draft-22");
|
|
85
142
|
}
|
|
86
143
|
if (params.trackPropertyFilter) {
|
|
87
144
|
throw new Error("TRACK_PROPERTY_FILTER is not allowed on FETCH");
|
|
88
145
|
}
|
|
89
|
-
|
|
146
|
+
// An absent LOCATION_FILTER fetches the whole track.
|
|
147
|
+
if (type.kind === "filtered")
|
|
148
|
+
type.filter = params.subscriptionFilter ?? { kind: "unfiltered" };
|
|
149
|
+
const order = params.groupOrder;
|
|
150
|
+
return new Fetch({
|
|
151
|
+
requestId,
|
|
152
|
+
type,
|
|
153
|
+
subscriberPriority: params.subscriberPriority ?? DEFAULT_WIRE,
|
|
154
|
+
// Parameters refuses anything but Ascending or Descending.
|
|
155
|
+
groupOrder: order === undefined ? undefined : order === GroupOrder.Ascending ? "ascending" : "descending",
|
|
156
|
+
rangeFilters: params.rangeFilters,
|
|
157
|
+
// Defaults to 1, so an absent parameter means the requester wants them.
|
|
158
|
+
propertiesWanted: params.includeProperties ?? true,
|
|
159
|
+
});
|
|
90
160
|
}
|
|
91
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* The answer to a FETCH, sent before its fetch stream: the FETCH_OK message (0x18) through
|
|
164
|
+
* draft-22, and a REQUEST_OK (0x07) from draft-23 on (section 9.3).
|
|
165
|
+
*/
|
|
92
166
|
export class FetchOk {
|
|
93
167
|
static id = 0x18;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
static async #decode(_r) {
|
|
131
|
-
throw new Error("FETCH_ERROR messages are not supported");
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// Removed in d17
|
|
135
|
-
export class FetchCancel {
|
|
136
|
-
static id = 0x17;
|
|
137
|
-
requestId;
|
|
138
|
-
constructor({ requestId }) {
|
|
139
|
-
this.requestId = requestId;
|
|
140
|
-
}
|
|
141
|
-
async #encode(_w) {
|
|
142
|
-
throw new Error("FETCH_CANCEL messages are not supported");
|
|
168
|
+
/** Whether the response holds the track's final object. Through draft-22 only. */
|
|
169
|
+
endOfTrack;
|
|
170
|
+
/**
|
|
171
|
+
* Where the response ends. Draft-18 uses the last object plus one, or Object 0 for the
|
|
172
|
+
* whole End Group; draft-22 an inclusive End Location. Draft-23 has none: the answer ends
|
|
173
|
+
* at {@link largest} when set, and at the requested end otherwise (section 3.2).
|
|
174
|
+
*/
|
|
175
|
+
endLocation;
|
|
176
|
+
/** Draft-23's LARGEST_OBJECT, where the answer ends when the requested range reaches it. */
|
|
177
|
+
largest;
|
|
178
|
+
/** The track's properties, as SUBSCRIBE_OK carries them. */
|
|
179
|
+
properties;
|
|
180
|
+
constructor({ endOfTrack, endLocation, largest, properties = {}, }) {
|
|
181
|
+
this.endOfTrack = endOfTrack;
|
|
182
|
+
this.endLocation = endLocation;
|
|
183
|
+
this.largest = largest;
|
|
184
|
+
this.properties = properties;
|
|
185
|
+
}
|
|
186
|
+
/** The message type answering a FETCH on `version`; FETCH_OK's own is reserved from draft-23. */
|
|
187
|
+
static idFor(version) {
|
|
188
|
+
return isDraft23(version) ? RequestOk.id : FetchOk.id;
|
|
189
|
+
}
|
|
190
|
+
async #encode(w, version) {
|
|
191
|
+
const params = new Parameters();
|
|
192
|
+
if (isDraft23(version)) {
|
|
193
|
+
if (this.largest)
|
|
194
|
+
params.largest = { groupId: this.largest.group, objectId: this.largest.object };
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
await w.bool(this.endOfTrack);
|
|
198
|
+
await w.u62(this.endLocation.group);
|
|
199
|
+
await w.u62(this.endLocation.object);
|
|
200
|
+
}
|
|
201
|
+
await params.encode(w, version);
|
|
202
|
+
// Track Properties are the final field, so nothing may follow.
|
|
203
|
+
await Properties.encode(w, this.properties);
|
|
143
204
|
}
|
|
144
|
-
async encode(w,
|
|
145
|
-
return Message.encode(w, this.#encode
|
|
205
|
+
async encode(w, version) {
|
|
206
|
+
return Message.encode(w, (mw) => this.#encode(mw, version));
|
|
146
207
|
}
|
|
147
|
-
static async decode(r,
|
|
148
|
-
return Message.decode(r,
|
|
208
|
+
static async decode(r, version) {
|
|
209
|
+
return Message.decode(r, (mr) => FetchOk.#decode(mr, version));
|
|
149
210
|
}
|
|
150
|
-
static async #decode(
|
|
151
|
-
|
|
211
|
+
static async #decode(r, version) {
|
|
212
|
+
if (isDraft23(version)) {
|
|
213
|
+
// EXPIRES is read and ignored, like SUBSCRIBE_OK's.
|
|
214
|
+
const params = await Parameters.decode(r, version, "fetch-ok");
|
|
215
|
+
const properties = await Properties.decode(r);
|
|
216
|
+
const at = params.largest;
|
|
217
|
+
const largest = at && { group: at.groupId, object: at.objectId };
|
|
218
|
+
return new FetchOk({
|
|
219
|
+
endOfTrack: false,
|
|
220
|
+
endLocation: largest ?? { group: 0n, object: 0n },
|
|
221
|
+
largest,
|
|
222
|
+
properties,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
const endOfTrack = await r.bool();
|
|
226
|
+
const endLocation = { group: await r.u62(), object: await r.u62() };
|
|
227
|
+
// FETCH_OK lists no parameters, so any is a protocol violation.
|
|
228
|
+
await Parameters.decode(r, version, "fetch-ok");
|
|
229
|
+
const properties = await Properties.decode(r);
|
|
230
|
+
return new FetchOk({ endOfTrack, endLocation, properties });
|
|
152
231
|
}
|
|
153
232
|
}
|
|
154
233
|
//# sourceMappingURL=fetch.js.map
|
package/ietf/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/ietf/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAoB,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAO,WAAW;IACvB,qDAAqD;IACrD,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;IAElB,wEAAwE;IACxE,SAAS,CAAS;IAElB,YAAY,EAAE,SAAS,EAAyB;QAC/C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,MAAM,CAAC,CAAS,EAAE,OA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C/C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAU;QAC9B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC5D,CAAC;CACD","sourcesContent":["import { type Reader, Writer } from \"../stream.ts\";\nimport { hasRangeFilters, isDraft20 } from \"./filter.ts\";\nimport * as Message from \"./message.ts\";\nimport * as Namespace from \"./namespace.ts\";\nimport { Parameters } from \"./parameters.ts\";\nimport { type IetfVersion, Version } from \"./version.ts\";\n\n/**\n * The header that begins a fetch stream (draft-20 section 11.4.4), naming the request it\n * answers. Written by the publisher when serving a subscription's fill.\n */\nexport class FetchHeader {\n\t/** The uni stream type, not a control message id. */\n\tstatic type = 0x5;\n\n\t/** The SUBSCRIBE (or FETCH) request this stream carries objects for. */\n\trequestId: bigint;\n\n\tconstructor({ requestId }: { requestId: bigint }) {\n\t\tthis.requestId = requestId;\n\t}\n\n\t/** Write the stream type and the header in one write, like a subgroup header. */\n\tasync encode(w: Writer, version: IetfVersion): Promise<void> {\n\t\tawait w.write(\n\t\t\tawait Writer.collect(version, async (h) => {\n\t\t\t\tawait h.u53(FetchHeader.type);\n\t\t\t\tawait h.u62(this.requestId);\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** Read the header, with the stream type already consumed. */\n\tstatic async decode(r: Reader, _version: IetfVersion): Promise<FetchHeader> {\n\t\treturn new FetchHeader({ requestId: await r.u62() });\n\t}\n}\n\n/**\n * A FETCH request. We serve none, so only what a refusal needs is kept; the rest is\n * decoded so a legal request is refused rather than breaking the stream.\n */\nexport class Fetch {\n\tstatic id = 0x16;\n\n\trequestId: bigint;\n\n\tconstructor({ requestId }: { requestId: bigint }) {\n\t\tthis.requestId = requestId;\n\t}\n\n\tasync #encode(_w: Writer): Promise<void> {\n\t\tthrow new Error(\"FETCH messages are not supported\");\n\t}\n\n\tasync encode(w: Writer, _version: IetfVersion): Promise<void> {\n\t\treturn Message.encode(w, this.#encode.bind(this));\n\t}\n\n\tstatic async decode(r: Reader, version: IetfVersion): Promise<Fetch> {\n\t\treturn Message.decode(r, (mr) => Fetch.#decode(mr, version));\n\t}\n\n\tstatic async #decode(r: Reader, version: IetfVersion): Promise<Fetch> {\n\t\tconst requestId = await r.u62();\n\t\tif (version === Version.DRAFT_17) {\n\t\t\tawait r.u62(); // required_request_id_delta\n\t\t}\n\n\t\tif (version === Version.DRAFT_14) {\n\t\t\tawait r.u8(); // subscriber_priority\n\t\t\tawait r.u8(); // group_order\n\t\t}\n\n\t\tif (isDraft20(version)) {\n\t\t\t// Draft-20 names the track up front and moves the range into LOCATION_FILTER.\n\t\t\tawait Namespace.decode(r);\n\t\t\tawait r.string();\n\t\t} else {\n\t\t\tconst fetchType = await r.u53();\n\t\t\tswitch (fetchType) {\n\t\t\t\tcase 0x1: // Standalone: namespace, name, start and end Locations\n\t\t\t\t\tawait Namespace.decode(r);\n\t\t\t\t\tawait r.string();\n\t\t\t\t\tfor (let i = 0; i < 4; i++) await r.u62();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x2: // Relative Joining: subscription, group offset\n\t\t\t\tcase 0x3: // Absolute Joining: subscription, group\n\t\t\t\t\tawait r.u62();\n\t\t\t\t\tawait r.u62();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`unknown fetch type: ${fetchType}`);\n\t\t\t}\n\t\t}\n\n\t\tconst params = await Parameters.decode(r, version);\n\t\tif (params.rangeFilters && !hasRangeFilters(version)) {\n\t\t\tthrow new Error(\"Range Filters need draft-19\");\n\t\t}\n\t\tif (params.trackPropertyFilter) {\n\t\t\tthrow new Error(\"TRACK_PROPERTY_FILTER is not allowed on FETCH\");\n\t\t}\n\n\t\treturn new Fetch({ requestId });\n\t}\n}\n\nexport class FetchOk {\n\tstatic id = 0x18;\n\n\trequestId: bigint | undefined;\n\n\tconstructor({ requestId }: { requestId?: bigint }) {\n\t\tthis.requestId = requestId;\n\t}\n\n\tasync #encode(_w: Writer): Promise<void> {\n\t\tthrow new Error(\"FETCH_OK messages are not supported\");\n\t}\n\n\tasync encode(w: Writer, _version: IetfVersion): Promise<void> {\n\t\treturn Message.encode(w, this.#encode.bind(this));\n\t}\n\n\tstatic async decode(r: Reader, _version: IetfVersion): Promise<FetchOk> {\n\t\treturn Message.decode(r, FetchOk.#decode);\n\t}\n\n\tstatic async #decode(_r: Reader): Promise<FetchOk> {\n\t\tthrow new Error(\"FETCH_OK messages are not supported\");\n\t}\n}\n\nexport class FetchError {\n\tstatic id = 0x19;\n\n\trequestId: bigint;\n\terrorCode: number;\n\treasonPhrase: string;\n\n\tconstructor({\n\t\trequestId,\n\t\terrorCode,\n\t\treasonPhrase,\n\t}: { requestId: bigint; errorCode: number; reasonPhrase: string }) {\n\t\tthis.requestId = requestId;\n\t\tthis.errorCode = errorCode;\n\t\tthis.reasonPhrase = reasonPhrase;\n\t}\n\n\tasync #encode(_w: Writer): Promise<void> {\n\t\tthrow new Error(\"FETCH_ERROR messages are not supported\");\n\t}\n\n\tasync encode(w: Writer, _version: IetfVersion): Promise<void> {\n\t\treturn Message.encode(w, this.#encode.bind(this));\n\t}\n\n\tstatic async decode(r: Reader, _version: IetfVersion): Promise<FetchError> {\n\t\treturn Message.decode(r, FetchError.#decode);\n\t}\n\n\tstatic async #decode(_r: Reader): Promise<FetchError> {\n\t\tthrow new Error(\"FETCH_ERROR messages are not supported\");\n\t}\n}\n\n// Removed in d17\nexport class FetchCancel {\n\tstatic id = 0x17;\n\n\trequestId: bigint;\n\n\tconstructor({ requestId }: { requestId: bigint }) {\n\t\tthis.requestId = requestId;\n\t}\n\n\tasync #encode(_w: Writer): Promise<void> {\n\t\tthrow new Error(\"FETCH_CANCEL messages are not supported\");\n\t}\n\n\tasync encode(w: Writer, _version: IetfVersion): Promise<void> {\n\t\treturn Message.encode(w, this.#encode.bind(this));\n\t}\n\n\tstatic async decode(r: Reader, _version: IetfVersion): Promise<FetchCancel> {\n\t\treturn Message.decode(r, FetchCancel.#decode);\n\t}\n\n\tstatic async #decode(_r: Reader): Promise<FetchCancel> {\n\t\tthrow new Error(\"FETCH_CANCEL messages are not supported\");\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/ietf/fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,MAAM,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,WAAW;IACvB,qDAAqD;IACrD,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;IAElB,wEAAwE;IACxE,SAAS,CAAS;IAElB,YAAY,EAAE,SAAS,EAAyB;QAC/C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,MAAM,CAAC,CAAS,EAAE,OAAoB;QAC3C,MAAM,CAAC,CAAC,KAAK,CACZ,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;YACzC,MAAM,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC9B,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC,CAAC,CACF,CAAC;IACH,CAAC;IAED,8DAA8D;IAC9D,MAAM,C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,WAAW,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;QACpE,gEAAgE;QAChE,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAChD,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9C,OAAO,IAAI,OAAO,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;CACD","sourcesContent":["import type * as Path from \"../path.ts\";\nimport { type Reader, Writer } from \"../stream.ts\";\nimport type { Order } from \"../track.ts\";\nimport * as Filter from \"./filter.ts\";\nimport * as Message from \"./message.ts\";\nimport * as Namespace from \"./namespace.ts\";\nimport { Parameters } from \"./parameters.ts\";\nimport { DEFAULT_WIRE } from \"./priority.ts\";\nimport * as Properties from \"./properties.ts\";\nimport { RequestOk } from \"./request.ts\";\nimport { GroupOrder } from \"./subscribe.ts\";\nimport { type IetfVersion, isDraft23 } from \"./version.ts\";\n\n/**\n * The header that begins a fetch stream (draft-22 section 11.4), naming the request it\n * answers. Written by the publisher when serving a FETCH or a subscription's fill.\n */\nexport class FetchHeader {\n\t/** The uni stream type, not a control message id. */\n\tstatic type = 0x5;\n\n\t/** The SUBSCRIBE (or FETCH) request this stream carries objects for. */\n\trequestId: bigint;\n\n\tconstructor({ requestId }: { requestId: bigint }) {\n\t\tthis.requestId = requestId;\n\t}\n\n\t/** Write the stream type and the header in one write, like a subgroup header. */\n\tasync encode(w: Writer, version: IetfVersion): Promise<void> {\n\t\tawait w.write(\n\t\t\tawait Writer.collect(version, async (h) => {\n\t\t\t\tawait h.u53(FetchHeader.type);\n\t\t\t\tawait h.u62(this.requestId);\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** Read the header, with the stream type already consumed. */\n\tstatic async decode(r: Reader, _version: IetfVersion): Promise<FetchHeader> {\n\t\treturn new FetchHeader({ requestId: await r.u62() });\n\t}\n}\n\n/** A `{Group, Object}` Location. */\nexport interface Location {\n\t/** The group's sequence number. */\n\tgroup: bigint;\n\t/** The object's id within that group. */\n\tobject: bigint;\n}\n\n/**\n * What a FETCH asks for.\n *\n * Through draft-18 a Fetch Type tag picks one of the first three. Draft-22 dropped the tag\n * and the joining forms, leaving `filtered`.\n */\nexport type FetchType =\n\t/**\n\t * A range of a track, through draft-18. `end` is one past the last object, or Object 0\n\t * for the whole End Group.\n\t */\n\t| { kind: \"standalone\"; trackNamespace: Path.Valid; trackName: string; start: Location; end: Location }\n\t/** The groups `offset` back from a subscription's Largest Object group, through draft-18. */\n\t| { kind: \"relativeJoining\"; subscription: bigint; offset: bigint }\n\t/** The groups from `group` up to a subscription's Largest Object group, through draft-18. */\n\t| { kind: \"absoluteJoining\"; subscription: bigint; group: bigint }\n\t/** A track with the range as a LOCATION_FILTER, from draft-22 on. */\n\t| { kind: \"filtered\"; trackNamespace: Path.Valid; trackName: string; filter: Filter.Filter };\n\n/** The Fetch Type tags of draft-18. */\nconst STANDALONE = 0x1;\nconst RELATIVE_JOINING = 0x2;\nconst ABSOLUTE_JOINING = 0x3;\n\n/** A FETCH request. */\nexport class Fetch {\n\tstatic id = 0x16;\n\n\trequestId: bigint;\n\n\t/** What the request asks for. */\n\ttype: FetchType;\n\n\t/** The SUBSCRIBER_PRIORITY wire byte, lower first. */\n\tsubscriberPriority: number;\n\n\t/** The order the response's groups go out in, or the publisher's pick when absent. */\n\tgroupOrder?: Order;\n\n\t/** Whether the request carried Range Filters, which we refuse. Never encoded. */\n\trangeFilters: boolean;\n\n\t/** Whether the requester wants Track Properties in FETCH_OK (INCLUDE_PROPERTIES, draft-22). */\n\tpropertiesWanted: boolean;\n\n\tconstructor({\n\t\trequestId,\n\t\ttype,\n\t\tsubscriberPriority = DEFAULT_WIRE,\n\t\tgroupOrder,\n\t\trangeFilters = false,\n\t\tpropertiesWanted = true,\n\t}: {\n\t\trequestId: bigint;\n\t\ttype: FetchType;\n\t\tsubscriberPriority?: number;\n\t\tgroupOrder?: Order;\n\t\trangeFilters?: boolean;\n\t\tpropertiesWanted?: boolean;\n\t}) {\n\t\tthis.requestId = requestId;\n\t\tthis.type = type;\n\t\tthis.subscriberPriority = subscriberPriority;\n\t\tthis.groupOrder = groupOrder;\n\t\tthis.rangeFilters = rangeFilters;\n\t\tthis.propertiesWanted = propertiesWanted;\n\t}\n\n\tasync #encode(w: Writer, version: IetfVersion): Promise<void> {\n\t\tawait w.u62(this.requestId);\n\n\t\tconst params = new Parameters();\n\t\tparams.subscriberPriority = this.subscriberPriority;\n\t\tif (this.groupOrder !== undefined)\n\t\t\tparams.groupOrder = this.groupOrder === \"ascending\" ? GroupOrder.Ascending : GroupOrder.Descending;\n\n\t\tconst type = this.type;\n\t\tif (Filter.isDraft20(version)) {\n\t\t\t// The joining forms and the Fetch Type tag are gone in draft-22.\n\t\t\tif (type.kind !== \"filtered\") throw new Error(`${type.kind} FETCH needs draft-18`);\n\t\t\tawait Namespace.encodeTrack(w, type.trackNamespace, type.trackName);\n\t\t\tparams.subscriptionFilter = type.filter;\n\t\t\t// The default is 1, so only the opt-out is worth bytes.\n\t\t\tif (!this.propertiesWanted) params.includeProperties = false;\n\t\t} else {\n\t\t\tswitch (type.kind) {\n\t\t\t\tcase \"standalone\":\n\t\t\t\t\tawait w.u53(STANDALONE);\n\t\t\t\t\tawait Namespace.encodeTrack(w, type.trackNamespace, type.trackName);\n\t\t\t\t\tawait w.u62(type.start.group);\n\t\t\t\t\tawait w.u62(type.start.object);\n\t\t\t\t\tawait w.u62(type.end.group);\n\t\t\t\t\tawait w.u62(type.end.object);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"relativeJoining\":\n\t\t\t\t\tawait w.u53(RELATIVE_JOINING);\n\t\t\t\t\tawait w.u62(type.subscription);\n\t\t\t\t\tawait w.u62(type.offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"absoluteJoining\":\n\t\t\t\t\tawait w.u53(ABSOLUTE_JOINING);\n\t\t\t\t\tawait w.u62(type.subscription);\n\t\t\t\t\tawait w.u62(type.group);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"filtered\":\n\t\t\t\t\tthrow new Error(\"filtered FETCH needs draft-22\");\n\t\t\t}\n\t\t}\n\t\tawait params.encode(w, version);\n\t}\n\n\tasync encode(w: Writer, version: IetfVersion): Promise<void> {\n\t\treturn Message.encode(w, (mw) => this.#encode(mw, version));\n\t}\n\n\tstatic async decode(r: Reader, version: IetfVersion): Promise<Fetch> {\n\t\treturn Message.decode(r, (mr) => Fetch.#decode(mr, version));\n\t}\n\n\tstatic async #decode(r: Reader, version: IetfVersion): Promise<Fetch> {\n\t\tconst requestId = await r.u62();\n\n\t\tlet type: FetchType;\n\t\tif (Filter.isDraft20(version)) {\n\t\t\t// Draft-22 names the track up front and moves the range into LOCATION_FILTER.\n\t\t\tconst { namespace, name } = await Namespace.decodeTrack(r);\n\t\t\t// Placeholder until the parameters name the filter.\n\t\t\ttype = { kind: \"filtered\", trackNamespace: namespace, trackName: name, filter: { kind: \"unfiltered\" } };\n\t\t} else {\n\t\t\tconst fetchType = await r.u53();\n\t\t\tswitch (fetchType) {\n\t\t\t\tcase STANDALONE: {\n\t\t\t\t\tconst { namespace, name } = await Namespace.decodeTrack(r);\n\t\t\t\t\tconst start = { group: await r.u62(), object: await r.u62() };\n\t\t\t\t\tconst end = { group: await r.u62(), object: await r.u62() };\n\t\t\t\t\ttype = { kind: \"standalone\", trackNamespace: namespace, trackName: name, start, end };\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase RELATIVE_JOINING:\n\t\t\t\t\ttype = { kind: \"relativeJoining\", subscription: await r.u62(), offset: await r.u62() };\n\t\t\t\t\tbreak;\n\t\t\t\tcase ABSOLUTE_JOINING:\n\t\t\t\t\ttype = { kind: \"absoluteJoining\", subscription: await r.u62(), group: await r.u62() };\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`unknown fetch type: ${fetchType}`);\n\t\t\t}\n\t\t}\n\n\t\tconst params = await Parameters.decode(r, version, \"fetch\");\n\t\tif (params.rangeFilters && !Filter.hasRangeFilters(version)) {\n\t\t\tthrow new Error(\"Range Filters need draft-22\");\n\t\t}\n\t\tif (params.trackPropertyFilter) {\n\t\t\tthrow new Error(\"TRACK_PROPERTY_FILTER is not allowed on FETCH\");\n\t\t}\n\t\t// An absent LOCATION_FILTER fetches the whole track.\n\t\tif (type.kind === \"filtered\") type.filter = params.subscriptionFilter ?? { kind: \"unfiltered\" };\n\n\t\tconst order = params.groupOrder;\n\t\treturn new Fetch({\n\t\t\trequestId,\n\t\t\ttype,\n\t\t\tsubscriberPriority: params.subscriberPriority ?? DEFAULT_WIRE,\n\t\t\t// Parameters refuses anything but Ascending or Descending.\n\t\t\tgroupOrder: order === undefined ? undefined : order === GroupOrder.Ascending ? \"ascending\" : \"descending\",\n\t\t\trangeFilters: params.rangeFilters,\n\t\t\t// Defaults to 1, so an absent parameter means the requester wants them.\n\t\t\tpropertiesWanted: params.includeProperties ?? true,\n\t\t});\n\t}\n}\n\n/**\n * The answer to a FETCH, sent before its fetch stream: the FETCH_OK message (0x18) through\n * draft-22, and a REQUEST_OK (0x07) from draft-23 on (section 9.3).\n */\nexport class FetchOk {\n\tstatic id = 0x18;\n\n\t/** Whether the response holds the track's final object. Through draft-22 only. */\n\tendOfTrack: boolean;\n\n\t/**\n\t * Where the response ends. Draft-18 uses the last object plus one, or Object 0 for the\n\t * whole End Group; draft-22 an inclusive End Location. Draft-23 has none: the answer ends\n\t * at {@link largest} when set, and at the requested end otherwise (section 3.2).\n\t */\n\tendLocation: Location;\n\n\t/** Draft-23's LARGEST_OBJECT, where the answer ends when the requested range reaches it. */\n\tlargest?: Location;\n\n\t/** The track's properties, as SUBSCRIBE_OK carries them. */\n\tproperties: Properties.Properties;\n\n\tconstructor({\n\t\tendOfTrack,\n\t\tendLocation,\n\t\tlargest,\n\t\tproperties = {},\n\t}: {\n\t\tendOfTrack: boolean;\n\t\tendLocation: Location;\n\t\tlargest?: Location;\n\t\tproperties?: Properties.Properties;\n\t}) {\n\t\tthis.endOfTrack = endOfTrack;\n\t\tthis.endLocation = endLocation;\n\t\tthis.largest = largest;\n\t\tthis.properties = properties;\n\t}\n\n\t/** The message type answering a FETCH on `version`; FETCH_OK's own is reserved from draft-23. */\n\tstatic idFor(version: IetfVersion): number {\n\t\treturn isDraft23(version) ? RequestOk.id : FetchOk.id;\n\t}\n\n\tasync #encode(w: Writer, version: IetfVersion): Promise<void> {\n\t\tconst params = new Parameters();\n\t\tif (isDraft23(version)) {\n\t\t\tif (this.largest) params.largest = { groupId: this.largest.group, objectId: this.largest.object };\n\t\t} else {\n\t\t\tawait w.bool(this.endOfTrack);\n\t\t\tawait w.u62(this.endLocation.group);\n\t\t\tawait w.u62(this.endLocation.object);\n\t\t}\n\t\tawait params.encode(w, version);\n\t\t// Track Properties are the final field, so nothing may follow.\n\t\tawait Properties.encode(w, this.properties);\n\t}\n\n\tasync encode(w: Writer, version: IetfVersion): Promise<void> {\n\t\treturn Message.encode(w, (mw) => this.#encode(mw, version));\n\t}\n\n\tstatic async decode(r: Reader, version: IetfVersion): Promise<FetchOk> {\n\t\treturn Message.decode(r, (mr) => FetchOk.#decode(mr, version));\n\t}\n\n\tstatic async #decode(r: Reader, version: IetfVersion): Promise<FetchOk> {\n\t\tif (isDraft23(version)) {\n\t\t\t// EXPIRES is read and ignored, like SUBSCRIBE_OK's.\n\t\t\tconst params = await Parameters.decode(r, version, \"fetch-ok\");\n\t\t\tconst properties = await Properties.decode(r);\n\t\t\tconst at = params.largest;\n\t\t\tconst largest = at && { group: at.groupId, object: at.objectId };\n\t\t\treturn new FetchOk({\n\t\t\t\tendOfTrack: false,\n\t\t\t\tendLocation: largest ?? { group: 0n, object: 0n },\n\t\t\t\tlargest,\n\t\t\t\tproperties,\n\t\t\t});\n\t\t}\n\t\tconst endOfTrack = await r.bool();\n\t\tconst endLocation = { group: await r.u62(), object: await r.u62() };\n\t\t// FETCH_OK lists no parameters, so any is a protocol violation.\n\t\tawait Parameters.decode(r, version, \"fetch-ok\");\n\t\tconst properties = await Properties.decode(r);\n\t\treturn new FetchOk({ endOfTrack, endLocation, properties });\n\t}\n}\n"]}
|
package/ietf/filter.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Location Filter carried by SUBSCRIBE, and draft-
|
|
2
|
+
* The Location Filter carried by SUBSCRIBE, and draft-22's fill request.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type
|
|
6
|
+
import { type Reader } from "../stream.ts";
|
|
7
|
+
import type { Order } from "../track.ts";
|
|
7
8
|
import { type IetfVersion } from "./version.ts";
|
|
8
9
|
/** Which Objects a subscription delivers. */
|
|
9
10
|
export type Filter =
|
|
@@ -38,22 +39,13 @@ export type Filter =
|
|
|
38
39
|
* Whether this is draft-20 or newer.
|
|
39
40
|
*
|
|
40
41
|
* Draft-20 replaced the Filter Type tag with up to four optional varints, where the number
|
|
41
|
-
* present selects the meaning.
|
|
42
|
+
* present selects the meaning, and added the parameters that ride with it. Draft-22 names
|
|
43
|
+
* the meaning with a Location Filter Type instead, but keeps those parameters.
|
|
42
44
|
*/
|
|
43
45
|
export declare function isDraft20(version: IetfVersion): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Whether this is draft-22 or newer.
|
|
46
|
-
*
|
|
47
|
-
* Draft-22 replaced the length-inferred field list with a Location Filter Type that names
|
|
48
|
-
* the fields that follow, so the value carries no Length.
|
|
49
|
-
*/
|
|
50
|
-
export declare function isDraft22(version: IetfVersion): boolean;
|
|
51
|
-
/** Whether the Range Filters (draft-19) exist on this draft. */
|
|
46
|
+
/** Whether the Range Filters exist on this draft. */
|
|
52
47
|
export declare function hasRangeFilters(version: IetfVersion): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Encode a filter as its raw parameter value, without the Length that frames it through
|
|
55
|
-
* draft-21. Unfiltered encodes to zero bytes on draft-20 and draft-21.
|
|
56
|
-
*/
|
|
48
|
+
/** Encode a filter as its raw parameter value, without the Length that frames it before draft-22. */
|
|
57
49
|
export declare function encode(filter: Filter, version: IetfVersion): Uint8Array;
|
|
58
50
|
/** Encode LOCATION_FILTER's value as it follows the parameter type from draft-17 on. */
|
|
59
51
|
export declare function encodeParam(filter: Filter, version: IetfVersion): Uint8Array;
|
|
@@ -62,23 +54,14 @@ export declare function decodeParam(r: Reader, version: IetfVersion): Promise<Fi
|
|
|
62
54
|
/** Decode a filter from its raw parameter value, which must be consumed whole. */
|
|
63
55
|
export declare function decode(data: Uint8Array, version: IetfVersion): Filter;
|
|
64
56
|
/**
|
|
65
|
-
*
|
|
66
|
-
* following the tag have no length to delimit them.
|
|
57
|
+
* A draft-22 fill: the backfill a subscriber asks for alongside its subscription.
|
|
67
58
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* decided when the range is resolved.
|
|
71
|
-
*/
|
|
72
|
-
export declare function decodeInline(r: Reader): Promise<Filter>;
|
|
73
|
-
/**
|
|
74
|
-
* A draft-20 fill: the backfill a subscriber asks for alongside its subscription.
|
|
75
|
-
*
|
|
76
|
-
* The publisher serves one whose range resolves to a single group, straight from the group
|
|
77
|
-
* cache on a fetch stream. That covers the draft's own current-group join (a Next Object
|
|
78
|
-
* subscription plus a `StartGroup=1` fill). Anything wider is refused by resetting the
|
|
79
|
-
* fetch stream, the draft's fill-failure signal.
|
|
59
|
+
* The publisher serves the retained groups on a fetch stream in the requested order,
|
|
60
|
+
* capped at the Largest Object snapshot independently of the subscription's live cursor.
|
|
80
61
|
*/
|
|
81
62
|
export interface Fill {
|
|
63
|
+
/** The filled groups' order, or the subscription's order when omitted. */
|
|
64
|
+
groupOrder?: Order;
|
|
82
65
|
/**
|
|
83
66
|
* The range to fill. `undefined` means the Location Filter was omitted, which inherits
|
|
84
67
|
* the subscription's own filter; `unfiltered` (a zero length filter, or type 0x00 from
|
|
@@ -98,6 +81,13 @@ export interface Fill {
|
|
|
98
81
|
* The value is a nested parameter scope, encoded like a message's parameters.
|
|
99
82
|
*/
|
|
100
83
|
export declare function encodeFill(fill: Fill, version: IetfVersion): Uint8Array;
|
|
101
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Whether FILL_PARAMETERS is a bare Number of Parameters and the Parameters (draft-23 section
|
|
86
|
+
* 9.19.15) rather than a length-prefixed block.
|
|
87
|
+
*/
|
|
88
|
+
export declare function isCountedFill(version: IetfVersion): boolean;
|
|
89
|
+
/** Decode FILL_PARAMETERS, including its inherited or explicit group order. */
|
|
102
90
|
export declare function decodeFill(data: Uint8Array, version: IetfVersion): Fill;
|
|
91
|
+
/** How many bytes at the front of `data` the fill's count and Parameters span. */
|
|
92
|
+
export declare function fillSize(data: Uint8Array, version: IetfVersion): number;
|
|
103
93
|
//# sourceMappingURL=filter.d.ts.map
|
package/ietf/filter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/ietf/filter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/ietf/filter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,cAAc,CAAC;AAEpE,6CAA6C;AAC7C,MAAM,MAAM,MAAM;AACjB,oEAAoE;AAClE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;AACxB,sEAAsE;GACpE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE;AACxB;;;GA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