@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/token.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProtocolViolation } from "../error.js";
|
|
2
2
|
import * as Varint from "../varint.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Version } from "./version.js";
|
|
3
|
+
import { IetfSessionCode } from "./error.js";
|
|
5
4
|
/**
|
|
6
|
-
* The `AUTHORIZATION TOKEN` Setup Option (draft-ietf-moq-transport-
|
|
5
|
+
* The `AUTHORIZATION TOKEN` Setup Option (draft-ietf-moq-transport-22 section 9.1.4) and
|
|
6
|
+
* Message Parameter.
|
|
7
7
|
*
|
|
8
8
|
* The value is the Token structure of section 8.9: an Alias Type, then fields that type
|
|
9
9
|
* selects. We advertise no `MAX_AUTH_TOKEN_CACHE_SIZE`, so its default of 0 means no alias
|
|
@@ -14,6 +14,12 @@ import { Version } from "./version.js";
|
|
|
14
14
|
* @module
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* The `AUTHORIZATION TOKEN` key, the same as a Setup Option and as a Message Parameter.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export const AUTHORIZATION_TOKEN = 0x03n;
|
|
17
23
|
/** Retire a registered alias. */
|
|
18
24
|
const DELETE = 0x0n;
|
|
19
25
|
/** Register an alias for this type and value, then use them. */
|
|
@@ -28,52 +34,112 @@ const USE_VALUE = 0x3n;
|
|
|
28
34
|
* @internal
|
|
29
35
|
*/
|
|
30
36
|
export const TOKEN_OUT_OF_BAND = 0x0n;
|
|
31
|
-
/**
|
|
32
|
-
* Token Type 1: a Common Access Token (draft-ietf-moq-c4m).
|
|
33
|
-
*
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
export const TOKEN_CAT = 0x1n;
|
|
37
|
-
/** Draft-17 replaced QUIC's two-bit-length varint with a leading-ones one. */
|
|
38
|
-
function leadingOnes(version) {
|
|
39
|
-
return version !== Version.DRAFT_14 && version !== Version.DRAFT_15 && version !== Version.DRAFT_16;
|
|
40
|
-
}
|
|
41
37
|
/**
|
|
42
38
|
* The token the peer's SETUP presented, if any.
|
|
43
39
|
*
|
|
44
40
|
* A second token is already refused as a duplicate option by {@link SetupOptions}: one
|
|
45
41
|
* credential per connection.
|
|
46
42
|
*
|
|
47
|
-
* @throws {
|
|
48
|
-
* SETUP could have registered, or `KeyValueFormatting` for a structure that cannot be decoded.
|
|
43
|
+
* @throws {ProtocolViolation} carrying the session code to close with.
|
|
49
44
|
* @internal
|
|
50
45
|
*/
|
|
51
|
-
export function tokenFromSetup(params
|
|
52
|
-
const raw = params.getBytes(
|
|
46
|
+
export function tokenFromSetup(params) {
|
|
47
|
+
const raw = params.getBytes(AUTHORIZATION_TOKEN);
|
|
53
48
|
if (raw === undefined)
|
|
54
49
|
return undefined;
|
|
50
|
+
return decode(raw, true);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A request whose tokens repeat one another, which section 8.9 rejects with
|
|
54
|
+
* MALFORMED_AUTH_TOKEN rather than closing the session.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export class MalformedAuthToken extends Error {
|
|
59
|
+
/** The refused request. Every request starts with its Request ID, so framing fills it in. */
|
|
60
|
+
requestId;
|
|
61
|
+
constructor() {
|
|
62
|
+
super("repeated AUTHORIZATION TOKEN");
|
|
63
|
+
this.name = "MalformedAuthToken";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Refuse a request whose tokens repeat one another.
|
|
68
|
+
*
|
|
69
|
+
* Section 8.9 lets a token repeat only with a different type or value, after resolving
|
|
70
|
+
* aliases, of which we accept none. Checked once every parameter decoded, so a token that
|
|
71
|
+
* closes the session wins over a repeat.
|
|
72
|
+
*
|
|
73
|
+
* @throws {MalformedAuthToken}
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
export function unique(tokens) {
|
|
77
|
+
const same = (a, b) => a.kind === b.kind && a.value.length === b.value.length && a.value.every((byte, i) => byte === b.value[i]);
|
|
78
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
79
|
+
if (tokens.slice(0, i).some((prev) => same(prev, tokens[i])))
|
|
80
|
+
throw new MalformedAuthToken();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Decode an `AUTHORIZATION TOKEN` message parameter on a request, by the SETUP option's rules
|
|
85
|
+
* except that a registration overflows the cache instead of falling back to a value.
|
|
86
|
+
*
|
|
87
|
+
* @throws {ProtocolViolation} carrying the session code to close with.
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export function tokenFromRequest(raw) {
|
|
91
|
+
return decode(raw, false);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Decode a Token structure, refusing what this endpoint cannot accept.
|
|
95
|
+
*
|
|
96
|
+
* @throws {ProtocolViolation} `AuthTokenCacheOverflow` for a registration outside SETUP,
|
|
97
|
+
* `UnknownAuthTokenAlias` for an alias reference on a request (`ProtocolViolation` in SETUP),
|
|
98
|
+
* or `KeyValueFormatting` for a structure that cannot be decoded.
|
|
99
|
+
*/
|
|
100
|
+
function decode(raw, setup) {
|
|
55
101
|
// Section 8.9: a structure that cannot be decoded closes with KEY_VALUE_FORMATTING_ERROR.
|
|
56
|
-
const malformed = (cause) => new
|
|
102
|
+
const malformed = (cause) => new ProtocolViolation("malformed AUTHORIZATION TOKEN", { cause, code: IetfSessionCode.KeyValueFormatting });
|
|
57
103
|
const unvarint = (buf) => {
|
|
58
104
|
try {
|
|
59
|
-
return
|
|
105
|
+
return Varint.decodeLeadingOnes(buf);
|
|
60
106
|
}
|
|
61
107
|
catch (err) {
|
|
62
108
|
throw malformed(err);
|
|
63
109
|
}
|
|
64
110
|
};
|
|
111
|
+
// Every field an alias type names decodes before its meaning applies, so a truncated
|
|
112
|
+
// structure is malformed whatever its type.
|
|
65
113
|
let [aliasType, rest] = unvarint(raw);
|
|
66
114
|
switch (aliasType) {
|
|
67
115
|
case USE_VALUE:
|
|
68
116
|
break;
|
|
69
|
-
// With no cache, section 9.1.4 treats a registration as a value; the alias is unused.
|
|
70
117
|
case REGISTER:
|
|
71
118
|
[, rest] = unvarint(rest);
|
|
119
|
+
// Section 8.9: a registration past the cache size of 0 closes the session. With no
|
|
120
|
+
// cache, section 9.1.4 treats one in SETUP as a value and the alias is unused.
|
|
121
|
+
if (!setup) {
|
|
122
|
+
unvarint(rest);
|
|
123
|
+
throw new ProtocolViolation("AUTHORIZATION TOKEN registration", {
|
|
124
|
+
code: IetfSessionCode.AuthTokenCacheOverflow,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
72
127
|
break;
|
|
73
|
-
// Section 9.1.4: nothing can have been registered before SETUP.
|
|
74
128
|
case DELETE:
|
|
75
|
-
case USE_ALIAS:
|
|
76
|
-
|
|
129
|
+
case USE_ALIAS: {
|
|
130
|
+
const [, trailing] = unvarint(rest);
|
|
131
|
+
if (trailing.length > 0)
|
|
132
|
+
throw malformed();
|
|
133
|
+
// Section 9.1.4: nothing can have been registered before SETUP.
|
|
134
|
+
if (setup)
|
|
135
|
+
throw new ProtocolViolation("AUTHORIZATION TOKEN alias in SETUP");
|
|
136
|
+
// Section 9.1.3: a cache size of 0 prohibits aliases, so none was ever registered.
|
|
137
|
+
// Section 8.9 rejects the message, but 0x17 is only a session code (section 12.2),
|
|
138
|
+
// so the session closes; doc/concept/standard.md records the deviation.
|
|
139
|
+
throw new ProtocolViolation("unknown AUTHORIZATION TOKEN alias", {
|
|
140
|
+
code: IetfSessionCode.UnknownAuthTokenAlias,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
77
143
|
default:
|
|
78
144
|
throw malformed();
|
|
79
145
|
}
|
|
@@ -85,14 +151,26 @@ export function tokenFromSetup(params, version) {
|
|
|
85
151
|
*
|
|
86
152
|
* @internal
|
|
87
153
|
*/
|
|
88
|
-
export function tokenIntoSetup(params, token
|
|
89
|
-
|
|
154
|
+
export function tokenIntoSetup(params, token) {
|
|
155
|
+
params.setBytes(AUTHORIZATION_TOKEN, encode(token));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Carry `value`, a token in a format agreed out of band, on a request, by value.
|
|
159
|
+
*
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
162
|
+
export function tokenIntoRequest(params, value) {
|
|
163
|
+
params.bytes.set(AUTHORIZATION_TOKEN, encode({ kind: TOKEN_OUT_OF_BAND, value }));
|
|
164
|
+
}
|
|
165
|
+
/** A Token structure by value: USE_VALUE, its type, then the token. */
|
|
166
|
+
function encode(token) {
|
|
167
|
+
const varint = Varint.encodeLeadingOnes;
|
|
90
168
|
const aliasType = varint(USE_VALUE);
|
|
91
169
|
const kind = varint(token.kind);
|
|
92
170
|
const out = new Uint8Array(aliasType.length + kind.length + token.value.length);
|
|
93
171
|
out.set(aliasType, 0);
|
|
94
172
|
out.set(kind, aliasType.length);
|
|
95
173
|
out.set(token.value, aliasType.length + kind.length);
|
|
96
|
-
|
|
174
|
+
return out;
|
|
97
175
|
}
|
|
98
176
|
//# sourceMappingURL=token.js.map
|
package/ietf/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/ietf/token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAqB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAoB,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD;;;;;;;;;;;GAWG;AAEH,iCAAiC;AACjC,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB,gEAAgE;AAChE,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB,uDAAuD;AACvD,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,6CAA6C;AAC7C,MAAM,SAAS,GAAG,IAAI,CAAC;AAcvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC;AAE9B,8EAA8E;AAC9E,SAAS,WAAW,CAAC,OAAoB;IACxC,OAAO,OAAO,KAAK,OAAO,CAAC,QAAQ,IAAI,OAAO,KAAK,OAAO,CAAC,QAAQ,IAAI,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC;AACrG,CAAC;AAED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C,CAAC;IACrC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAoB,EAAE,KAAY,EAAE,OAAoB;IACtF,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChF,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACtB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import { SessionCode, SessionError } from \"../error.ts\";\nimport * as Varint from \"../varint.ts\";\nimport { SetupOption, type SetupOptions } from \"./parameters.ts\";\nimport { type IetfVersion, Version } from \"./version.ts\";\n\n/**\n * The `AUTHORIZATION TOKEN` Setup Option (draft-ietf-moq-transport-21 section 9.1.4).\n *\n * The value is the Token structure of section 8.9: an Alias Type, then fields that type\n * selects. We advertise no `MAX_AUTH_TOKEN_CACHE_SIZE`, so its default of 0 means no alias\n * is ever registered and every token arrives by value.\n *\n * Mirrors `rs/moq-net/src/ietf/token.rs`.\n *\n * @module\n * @internal\n */\n\n/** Retire a registered alias. */\nconst DELETE = 0x0n;\n/** Register an alias for this type and value, then use them. */\nconst REGISTER = 0x1n;\n/** Use the type and value a registered alias names. */\nconst USE_ALIAS = 0x2n;\n/** Use the type and value carried inline. */\nconst USE_VALUE = 0x3n;\n\n/**\n * A credential presented in a SETUP's `AUTHORIZATION TOKEN` option.\n *\n * @internal\n */\nexport interface Token {\n\t/** The wire Token Type, naming how `value` is encoded. */\n\tkind: bigint;\n\t/** The token itself. */\n\tvalue: Uint8Array;\n}\n\n/**\n * Token Type 0: a format the endpoints agreed on out of band, such as a JWT.\n *\n * @internal\n */\nexport const TOKEN_OUT_OF_BAND = 0x0n;\n\n/**\n * Token Type 1: a Common Access Token (draft-ietf-moq-c4m).\n *\n * @internal\n */\nexport const TOKEN_CAT = 0x1n;\n\n/** Draft-17 replaced QUIC's two-bit-length varint with a leading-ones one. */\nfunction leadingOnes(version: IetfVersion): boolean {\n\treturn version !== Version.DRAFT_14 && version !== Version.DRAFT_15 && version !== Version.DRAFT_16;\n}\n\n/**\n * The token the peer's SETUP presented, if any.\n *\n * A second token is already refused as a duplicate option by {@link SetupOptions}: one\n * credential per connection.\n *\n * @throws {SessionError} `ProtocolViolation` for an alias reference, which nothing before\n * SETUP could have registered, or `KeyValueFormatting` for a structure that cannot be decoded.\n * @internal\n */\nexport function tokenFromSetup(params: SetupOptions, version: IetfVersion): Token | undefined {\n\tconst raw = params.getBytes(SetupOption.AuthorizationToken);\n\tif (raw === undefined) return undefined;\n\n\t// Section 8.9: a structure that cannot be decoded closes with KEY_VALUE_FORMATTING_ERROR.\n\tconst malformed = (cause?: unknown) =>\n\t\tnew SessionError(SessionCode.KeyValueFormatting, { cause, reason: \"malformed AUTHORIZATION TOKEN\" });\n\tconst unvarint = (buf: Uint8Array): [bigint, Uint8Array] => {\n\t\ttry {\n\t\t\treturn leadingOnes(version) ? Varint.decodeLeadingOnes(buf) : Varint.decodeBigInt(buf);\n\t\t} catch (err) {\n\t\t\tthrow malformed(err);\n\t\t}\n\t};\n\n\tlet [aliasType, rest] = unvarint(raw);\n\tswitch (aliasType) {\n\t\tcase USE_VALUE:\n\t\t\tbreak;\n\t\t// With no cache, section 9.1.4 treats a registration as a value; the alias is unused.\n\t\tcase REGISTER:\n\t\t\t[, rest] = unvarint(rest);\n\t\t\tbreak;\n\t\t// Section 9.1.4: nothing can have been registered before SETUP.\n\t\tcase DELETE:\n\t\tcase USE_ALIAS:\n\t\t\tthrow new SessionError(SessionCode.ProtocolViolation, { reason: \"AUTHORIZATION TOKEN alias in SETUP\" });\n\t\tdefault:\n\t\t\tthrow malformed();\n\t}\n\n\tconst [kind, value] = unvarint(rest);\n\treturn { kind, value: value.slice() };\n}\n\n/**\n * Present `token` in our SETUP, by value.\n *\n * @internal\n */\nexport function tokenIntoSetup(params: SetupOptions, token: Token, version: IetfVersion) {\n\tconst varint = (v: bigint) => (leadingOnes(version) ? Varint.encodeLeadingOnes(v) : Varint.encode(v));\n\tconst aliasType = varint(USE_VALUE);\n\tconst kind = varint(token.kind);\n\n\tconst out = new Uint8Array(aliasType.length + kind.length + token.value.length);\n\tout.set(aliasType, 0);\n\tout.set(kind, aliasType.length);\n\tout.set(token.value, aliasType.length + kind.length);\n\tparams.setBytes(SetupOption.AuthorizationToken, out);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/ietf/token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI7C;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAEzC,iCAAiC;AACjC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,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChF,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACtB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["import { ProtocolViolation } from \"../error.ts\";\nimport * as Varint from \"../varint.ts\";\nimport { IetfSessionCode } from \"./error.ts\";\nimport type { Parameters } from \"./parameters.ts\";\nimport type { SetupOptions } from \"./setup_options.ts\";\n\n/**\n * The `AUTHORIZATION TOKEN` Setup Option (draft-ietf-moq-transport-22 section 9.1.4) and\n * Message Parameter.\n *\n * The value is the Token structure of section 8.9: an Alias Type, then fields that type\n * selects. We advertise no `MAX_AUTH_TOKEN_CACHE_SIZE`, so its default of 0 means no alias\n * is ever registered and every token arrives by value.\n *\n * Mirrors `rs/moq-net/src/ietf/token.rs`.\n *\n * @module\n * @internal\n */\n\n/**\n * The `AUTHORIZATION TOKEN` key, the same as a Setup Option and as a Message Parameter.\n *\n * @internal\n */\nexport const AUTHORIZATION_TOKEN = 0x03n;\n\n/** Retire a registered alias. */\nconst DELETE = 0x0n;\n/** Register an alias for this type and value, then use them. */\nconst REGISTER = 0x1n;\n/** Use the type and value a registered alias names. */\nconst USE_ALIAS = 0x2n;\n/** Use the type and value carried inline. */\nconst USE_VALUE = 0x3n;\n\n/**\n * A credential presented in an `AUTHORIZATION TOKEN` option or parameter.\n *\n * @internal\n */\nexport interface Token {\n\t/** The wire Token Type, naming how `value` is encoded. */\n\tkind: bigint;\n\t/** The token itself. */\n\tvalue: Uint8Array;\n}\n\n/**\n * Token Type 0: a format the endpoints agreed on out of band, such as a JWT.\n *\n * @internal\n */\nexport const TOKEN_OUT_OF_BAND = 0x0n;\n\n/**\n * The token the peer's SETUP presented, if any.\n *\n * A second token is already refused as a duplicate option by {@link SetupOptions}: one\n * credential per connection.\n *\n * @throws {ProtocolViolation} carrying the session code to close with.\n * @internal\n */\nexport function tokenFromSetup(params: SetupOptions): Token | undefined {\n\tconst raw = params.getBytes(AUTHORIZATION_TOKEN);\n\tif (raw === undefined) return undefined;\n\treturn decode(raw, true);\n}\n\n/**\n * A request whose tokens repeat one another, which section 8.9 rejects with\n * MALFORMED_AUTH_TOKEN rather than closing the session.\n *\n * @internal\n */\nexport class MalformedAuthToken extends Error {\n\t/** The refused request. Every request starts with its Request ID, so framing fills it in. */\n\trequestId?: bigint;\n\n\tconstructor() {\n\t\tsuper(\"repeated AUTHORIZATION TOKEN\");\n\t\tthis.name = \"MalformedAuthToken\";\n\t}\n}\n\n/**\n * Refuse a request whose tokens repeat one another.\n *\n * Section 8.9 lets a token repeat only with a different type or value, after resolving\n * aliases, of which we accept none. Checked once every parameter decoded, so a token that\n * closes the session wins over a repeat.\n *\n * @throws {MalformedAuthToken}\n * @internal\n */\nexport function unique(tokens: Token[]) {\n\tconst same = (a: Token, b: Token) =>\n\t\ta.kind === b.kind && a.value.length === b.value.length && a.value.every((byte, i) => byte === b.value[i]);\n\tfor (let i = 0; i < tokens.length; i++) {\n\t\tif (tokens.slice(0, i).some((prev) => same(prev, tokens[i]))) throw new MalformedAuthToken();\n\t}\n}\n\n/**\n * Decode an `AUTHORIZATION TOKEN` message parameter on a request, by the SETUP option's rules\n * except that a registration overflows the cache instead of falling back to a value.\n *\n * @throws {ProtocolViolation} carrying the session code to close with.\n * @internal\n */\nexport function tokenFromRequest(raw: Uint8Array): Token {\n\treturn decode(raw, false);\n}\n\n/**\n * Decode a Token structure, refusing what this endpoint cannot accept.\n *\n * @throws {ProtocolViolation} `AuthTokenCacheOverflow` for a registration outside SETUP,\n * `UnknownAuthTokenAlias` for an alias reference on a request (`ProtocolViolation` in SETUP),\n * or `KeyValueFormatting` for a structure that cannot be decoded.\n */\nfunction decode(raw: Uint8Array, setup: boolean): Token {\n\t// Section 8.9: a structure that cannot be decoded closes with KEY_VALUE_FORMATTING_ERROR.\n\tconst malformed = (cause?: unknown) =>\n\t\tnew ProtocolViolation(\"malformed AUTHORIZATION TOKEN\", { cause, code: IetfSessionCode.KeyValueFormatting });\n\tconst unvarint = (buf: Uint8Array): [bigint, Uint8Array] => {\n\t\ttry {\n\t\t\treturn Varint.decodeLeadingOnes(buf);\n\t\t} catch (err) {\n\t\t\tthrow malformed(err);\n\t\t}\n\t};\n\n\t// Every field an alias type names decodes before its meaning applies, so a truncated\n\t// structure is malformed whatever its type.\n\tlet [aliasType, rest] = unvarint(raw);\n\tswitch (aliasType) {\n\t\tcase USE_VALUE:\n\t\t\tbreak;\n\t\tcase REGISTER:\n\t\t\t[, rest] = unvarint(rest);\n\t\t\t// Section 8.9: a registration past the cache size of 0 closes the session. With no\n\t\t\t// cache, section 9.1.4 treats one in SETUP as a value and the alias is unused.\n\t\t\tif (!setup) {\n\t\t\t\tunvarint(rest);\n\t\t\t\tthrow new ProtocolViolation(\"AUTHORIZATION TOKEN registration\", {\n\t\t\t\t\tcode: IetfSessionCode.AuthTokenCacheOverflow,\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tcase DELETE:\n\t\tcase USE_ALIAS: {\n\t\t\tconst [, trailing] = unvarint(rest);\n\t\t\tif (trailing.length > 0) throw malformed();\n\t\t\t// Section 9.1.4: nothing can have been registered before SETUP.\n\t\t\tif (setup) throw new ProtocolViolation(\"AUTHORIZATION TOKEN alias in SETUP\");\n\t\t\t// Section 9.1.3: a cache size of 0 prohibits aliases, so none was ever registered.\n\t\t\t// Section 8.9 rejects the message, but 0x17 is only a session code (section 12.2),\n\t\t\t// so the session closes; doc/concept/standard.md records the deviation.\n\t\t\tthrow new ProtocolViolation(\"unknown AUTHORIZATION TOKEN alias\", {\n\t\t\t\tcode: IetfSessionCode.UnknownAuthTokenAlias,\n\t\t\t});\n\t\t}\n\t\tdefault:\n\t\t\tthrow malformed();\n\t}\n\n\tconst [kind, value] = unvarint(rest);\n\treturn { kind, value: value.slice() };\n}\n\n/**\n * Present `token` in our SETUP, by value.\n *\n * @internal\n */\nexport function tokenIntoSetup(params: SetupOptions, token: Token) {\n\tparams.setBytes(AUTHORIZATION_TOKEN, encode(token));\n}\n\n/**\n * Carry `value`, a token in a format agreed out of band, on a request, by value.\n *\n * @internal\n */\nexport function tokenIntoRequest(params: Parameters, value: Uint8Array) {\n\tparams.bytes.set(AUTHORIZATION_TOKEN, encode({ kind: TOKEN_OUT_OF_BAND, value }));\n}\n\n/** A Token structure by value: USE_VALUE, its type, then the token. */\nfunction encode(token: Token): Uint8Array {\n\tconst varint = Varint.encodeLeadingOnes;\n\tconst aliasType = varint(USE_VALUE);\n\tconst kind = varint(token.kind);\n\n\tconst out = new Uint8Array(aliasType.length + kind.length + token.value.length);\n\tout.set(aliasType, 0);\n\tout.set(kind, aliasType.length);\n\tout.set(token.value, aliasType.length + kind.length);\n\treturn out;\n}\n"]}
|
package/ietf/track.d.ts
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
1
|
import type * as Path from "../path.ts";
|
|
2
2
|
import type { Reader, Writer } from "../stream.ts";
|
|
3
|
-
import { type
|
|
3
|
+
import { type MessageLocation } from "./parameters.ts";
|
|
4
|
+
import * as Properties from "./properties.ts";
|
|
5
|
+
import type { IetfVersion } from "./version.ts";
|
|
4
6
|
export declare class TrackStatusRequest {
|
|
5
7
|
#private;
|
|
6
8
|
static id: number;
|
|
7
9
|
requestId: bigint;
|
|
8
10
|
trackNamespace: Path.Valid;
|
|
9
11
|
trackName: string;
|
|
10
|
-
|
|
12
|
+
/** Whether the requester wants Track Properties on the answer (INCLUDE_PROPERTIES, draft-22). */
|
|
13
|
+
propertiesWanted: boolean;
|
|
14
|
+
constructor({ requestId, trackNamespace, trackName, propertiesWanted, }: {
|
|
11
15
|
requestId: bigint;
|
|
12
16
|
trackNamespace: Path.Valid;
|
|
13
17
|
trackName: string;
|
|
18
|
+
propertiesWanted?: boolean;
|
|
14
19
|
});
|
|
15
20
|
encode(w: Writer, version: IetfVersion): Promise<void>;
|
|
16
21
|
/**
|
|
17
22
|
* Every draft defines TRACK_STATUS as identical to SUBSCRIBE, so it decodes as one and
|
|
18
|
-
* keeps
|
|
23
|
+
* keeps what names the track and shapes the answer. The rest goes unread: there is no
|
|
24
|
+
* subscription for it to configure.
|
|
19
25
|
*/
|
|
20
26
|
static decode(r: Reader, version: IetfVersion): Promise<TrackStatusRequest>;
|
|
21
27
|
}
|
|
22
|
-
|
|
28
|
+
/**
|
|
29
|
+
* TRACK_STATUS_OK: what a SUBSCRIBE_OK would say about the track, with no subscription.
|
|
30
|
+
*
|
|
31
|
+
* The answer is a REQUEST_OK carrying the message parameters and Track Properties.
|
|
32
|
+
*/
|
|
33
|
+
export declare class TrackStatusOk {
|
|
23
34
|
#private;
|
|
24
|
-
static id: number;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
trackName: string;
|
|
33
|
-
statusCode: number;
|
|
34
|
-
lastGroupId: bigint;
|
|
35
|
-
lastObjectId: bigint;
|
|
35
|
+
static readonly id: number;
|
|
36
|
+
/** The largest Location in the track (LARGEST_OBJECT), absent while it has no content. */
|
|
37
|
+
largest: MessageLocation | undefined;
|
|
38
|
+
/** The Track Properties. */
|
|
39
|
+
properties: Properties.Properties;
|
|
40
|
+
constructor({ largest, properties }?: {
|
|
41
|
+
largest?: MessageLocation;
|
|
42
|
+
properties?: Properties.Properties;
|
|
36
43
|
});
|
|
37
|
-
encode(w: Writer,
|
|
38
|
-
static decode(r: Reader,
|
|
39
|
-
static readonly STATUS_IN_PROGRESS = 0;
|
|
40
|
-
static readonly STATUS_NOT_FOUND = 1;
|
|
41
|
-
static readonly STATUS_NOT_AUTHORIZED = 2;
|
|
42
|
-
static readonly STATUS_ENDED = 3;
|
|
44
|
+
encode(w: Writer, version: IetfVersion): Promise<void>;
|
|
45
|
+
static decode(r: Reader, version: IetfVersion): Promise<TrackStatusOk>;
|
|
43
46
|
}
|
|
44
47
|
//# sourceMappingURL=track.d.ts.map
|
package/ietf/track.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../src/ietf/track.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../src/ietf/track.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EAAE,KAAK,eAAe,EAAc,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAG9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,qBAAa,kBAAkB;;IAC9B,MAAM,CAAC,EAAE,SAAQ;IAEjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,iGAAiG;IACjG,gBAAgB,EAAE,OAAO,CAAC;IAE1B,YAAY,EACX,SAAS,EACT,cAAc,EACd,SAAS,EACT,gBAAuB,GACvB,EAAE;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC;QAC3B,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC3B,EAKA;IAaK,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;IAED;;;;OAIG;IACH,OAAa,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAGhF;CACD;AAED;;;;GAIG;AACH,qBAAa,aAAa;;IACzB,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAgB;IAElC,0FAA0F;IAC1F,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IAErC,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;IAElC,YAAY,EAAE,OAAO,EAAE,UAAe,EAAE,GAAE;QAAE,OAAO,CAAC,EAAE,eAAe,CAAC;QAAC,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,CAAA;KAAO,EAG/G;IAYK,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;IAED,OAAa,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAE3E;CAOD"}
|
package/ietf/track.js
CHANGED
|
@@ -1,93 +1,80 @@
|
|
|
1
|
+
import * as Filter from "./filter.js";
|
|
1
2
|
import * as Message from "./message.js";
|
|
2
3
|
import * as Namespace from "./namespace.js";
|
|
3
4
|
import { Parameters } from "./parameters.js";
|
|
5
|
+
import * as Properties from "./properties.js";
|
|
6
|
+
import { RequestOk } from "./request.js";
|
|
4
7
|
import { Subscribe } from "./subscribe.js";
|
|
5
|
-
import { Version } from "./version.js";
|
|
6
|
-
// we only support Group Order descending
|
|
7
|
-
const GROUP_ORDER = 0x02;
|
|
8
8
|
export class TrackStatusRequest {
|
|
9
9
|
static id = 0x0d;
|
|
10
10
|
requestId;
|
|
11
11
|
trackNamespace;
|
|
12
12
|
trackName;
|
|
13
|
-
|
|
13
|
+
/** Whether the requester wants Track Properties on the answer (INCLUDE_PROPERTIES, draft-22). */
|
|
14
|
+
propertiesWanted;
|
|
15
|
+
constructor({ requestId, trackNamespace, trackName, propertiesWanted = true, }) {
|
|
14
16
|
this.requestId = requestId;
|
|
15
17
|
this.trackNamespace = trackNamespace;
|
|
16
18
|
this.trackName = trackName;
|
|
19
|
+
this.propertiesWanted = propertiesWanted;
|
|
17
20
|
}
|
|
18
21
|
async #encode(w, version) {
|
|
19
22
|
await w.u62(this.requestId);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
await w.u8(GROUP_ORDER); // group_order
|
|
28
|
-
await w.bool(false); // forward
|
|
29
|
-
await w.u53(0x2); // filter_type = LargestObject
|
|
30
|
-
await w.u53(0); // no parameters
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
// v15+: just parameters
|
|
34
|
-
const params = new Parameters();
|
|
35
|
-
await params.encode(w, version);
|
|
36
|
-
}
|
|
23
|
+
await Namespace.encodeTrack(w, this.trackNamespace, this.trackName);
|
|
24
|
+
// Only the opt-out is worth bytes, and a peer before draft-22 would read
|
|
25
|
+
// INCLUDE_PROPERTIES as unknown, which is a protocol violation.
|
|
26
|
+
const params = new Parameters();
|
|
27
|
+
if (!this.propertiesWanted && Filter.isDraft20(version))
|
|
28
|
+
params.includeProperties = false;
|
|
29
|
+
await params.encode(w, version);
|
|
37
30
|
}
|
|
38
31
|
async encode(w, version) {
|
|
39
32
|
return Message.encode(w, (mw) => this.#encode(mw, version));
|
|
40
33
|
}
|
|
41
34
|
/**
|
|
42
35
|
* Every draft defines TRACK_STATUS as identical to SUBSCRIBE, so it decodes as one and
|
|
43
|
-
* keeps
|
|
36
|
+
* keeps what names the track and shapes the answer. The rest goes unread: there is no
|
|
37
|
+
* subscription for it to configure.
|
|
44
38
|
*/
|
|
45
39
|
static async decode(r, version) {
|
|
46
|
-
const { requestId, trackNamespace, trackName } = await Subscribe.decode(r, version);
|
|
47
|
-
return new TrackStatusRequest({ requestId, trackNamespace, trackName });
|
|
40
|
+
const { requestId, trackNamespace, trackName, propertiesWanted } = await Subscribe.decode(r, version);
|
|
41
|
+
return new TrackStatusRequest({ requestId, trackNamespace, trackName, propertiesWanted });
|
|
48
42
|
}
|
|
49
43
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.lastObjectId = lastObjectId;
|
|
44
|
+
/**
|
|
45
|
+
* TRACK_STATUS_OK: what a SUBSCRIBE_OK would say about the track, with no subscription.
|
|
46
|
+
*
|
|
47
|
+
* The answer is a REQUEST_OK carrying the message parameters and Track Properties.
|
|
48
|
+
*/
|
|
49
|
+
export class TrackStatusOk {
|
|
50
|
+
static id = RequestOk.id;
|
|
51
|
+
/** The largest Location in the track (LARGEST_OBJECT), absent while it has no content. */
|
|
52
|
+
largest;
|
|
53
|
+
/** The Track Properties. */
|
|
54
|
+
properties;
|
|
55
|
+
constructor({ largest, properties = {} } = {}) {
|
|
56
|
+
this.largest = largest;
|
|
57
|
+
this.properties = properties;
|
|
65
58
|
}
|
|
66
|
-
async #encode(w) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
await
|
|
59
|
+
async #encode(w, version) {
|
|
60
|
+
// The parameters SUBSCRIBE_OK carries.
|
|
61
|
+
const params = new Parameters();
|
|
62
|
+
if (this.largest !== undefined)
|
|
63
|
+
params.largest = this.largest;
|
|
64
|
+
await params.encode(w, version);
|
|
65
|
+
// Track Properties are the final field, so nothing may follow.
|
|
66
|
+
await Properties.encode(w, this.properties);
|
|
72
67
|
}
|
|
73
|
-
async encode(w,
|
|
74
|
-
return Message.encode(w, this.#encode
|
|
68
|
+
async encode(w, version) {
|
|
69
|
+
return Message.encode(w, (mw) => this.#encode(mw, version));
|
|
75
70
|
}
|
|
76
|
-
static async decode(r,
|
|
77
|
-
return Message.decode(r,
|
|
71
|
+
static async decode(r, version) {
|
|
72
|
+
return Message.decode(r, (mr) => TrackStatusOk.#decode(mr, version));
|
|
78
73
|
}
|
|
79
|
-
static async #decode(r) {
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
const lastGroupId = await r.u62();
|
|
84
|
-
const lastObjectId = await r.u62();
|
|
85
|
-
return new TrackStatus({ trackNamespace, trackName, statusCode, lastGroupId, lastObjectId });
|
|
74
|
+
static async #decode(r, version) {
|
|
75
|
+
const params = await Parameters.decode(r, version, "subscribe-ok");
|
|
76
|
+
const properties = await Properties.decode(r);
|
|
77
|
+
return new TrackStatusOk({ largest: params.largest, properties });
|
|
86
78
|
}
|
|
87
|
-
// Track status codes
|
|
88
|
-
static STATUS_IN_PROGRESS = 0x00;
|
|
89
|
-
static STATUS_NOT_FOUND = 0x01;
|
|
90
|
-
static STATUS_NOT_AUTHORIZED = 0x02;
|
|
91
|
-
static STATUS_ENDED = 0x03;
|
|
92
79
|
}
|
|
93
80
|
//# sourceMappingURL=track.js.map
|
package/ietf/track.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../src/ietf/track.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../src/ietf/track.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,cAA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AoB;QAC3C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAS,EAAE,OAAoB;QAClD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAS,EAAE,OAAoB;QACnD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QACnE,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9C,OAAO,IAAI,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;IACnE,CAAC;CACD","sourcesContent":["import type * as Path from \"../path.ts\";\nimport type { Reader, Writer } from \"../stream.ts\";\nimport * as Filter from \"./filter.ts\";\nimport * as Message from \"./message.ts\";\nimport * as Namespace from \"./namespace.ts\";\nimport { type MessageLocation, Parameters } from \"./parameters.ts\";\nimport * as Properties from \"./properties.ts\";\nimport { RequestOk } from \"./request.ts\";\nimport { Subscribe } from \"./subscribe.ts\";\nimport type { IetfVersion } from \"./version.ts\";\n\nexport class TrackStatusRequest {\n\tstatic id = 0x0d;\n\n\trequestId: bigint;\n\ttrackNamespace: Path.Valid;\n\ttrackName: string;\n\t/** Whether the requester wants Track Properties on the answer (INCLUDE_PROPERTIES, draft-22). */\n\tpropertiesWanted: boolean;\n\n\tconstructor({\n\t\trequestId,\n\t\ttrackNamespace,\n\t\ttrackName,\n\t\tpropertiesWanted = true,\n\t}: {\n\t\trequestId: bigint;\n\t\ttrackNamespace: Path.Valid;\n\t\ttrackName: string;\n\t\tpropertiesWanted?: boolean;\n\t}) {\n\t\tthis.requestId = requestId;\n\t\tthis.trackNamespace = trackNamespace;\n\t\tthis.trackName = trackName;\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\t\tawait Namespace.encodeTrack(w, this.trackNamespace, this.trackName);\n\n\t\t// Only the opt-out is worth bytes, and a peer before draft-22 would read\n\t\t// INCLUDE_PROPERTIES as unknown, which is a protocol violation.\n\t\tconst params = new Parameters();\n\t\tif (!this.propertiesWanted && Filter.isDraft20(version)) params.includeProperties = false;\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\t/**\n\t * Every draft defines TRACK_STATUS as identical to SUBSCRIBE, so it decodes as one and\n\t * keeps what names the track and shapes the answer. The rest goes unread: there is no\n\t * subscription for it to configure.\n\t */\n\tstatic async decode(r: Reader, version: IetfVersion): Promise<TrackStatusRequest> {\n\t\tconst { requestId, trackNamespace, trackName, propertiesWanted } = await Subscribe.decode(r, version);\n\t\treturn new TrackStatusRequest({ requestId, trackNamespace, trackName, propertiesWanted });\n\t}\n}\n\n/**\n * TRACK_STATUS_OK: what a SUBSCRIBE_OK would say about the track, with no subscription.\n *\n * The answer is a REQUEST_OK carrying the message parameters and Track Properties.\n */\nexport class TrackStatusOk {\n\tstatic readonly id = RequestOk.id;\n\n\t/** The largest Location in the track (LARGEST_OBJECT), absent while it has no content. */\n\tlargest: MessageLocation | undefined;\n\n\t/** The Track Properties. */\n\tproperties: Properties.Properties;\n\n\tconstructor({ largest, properties = {} }: { largest?: MessageLocation; properties?: Properties.Properties } = {}) {\n\t\tthis.largest = largest;\n\t\tthis.properties = properties;\n\t}\n\n\tasync #encode(w: Writer, version: IetfVersion): Promise<void> {\n\t\t// The parameters SUBSCRIBE_OK carries.\n\t\tconst params = new Parameters();\n\t\tif (this.largest !== undefined) params.largest = this.largest;\n\t\tawait params.encode(w, version);\n\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<TrackStatusOk> {\n\t\treturn Message.decode(r, (mr) => TrackStatusOk.#decode(mr, version));\n\t}\n\n\tstatic async #decode(r: Reader, version: IetfVersion): Promise<TrackStatusOk> {\n\t\tconst params = await Parameters.decode(r, version, \"subscribe-ok\");\n\t\tconst properties = await Properties.decode(r);\n\t\treturn new TrackStatusOk({ largest: params.largest, properties });\n\t}\n}\n"]}
|
package/ietf/version.d.ts
CHANGED
|
@@ -2,72 +2,43 @@
|
|
|
2
2
|
* Supported MoQ Transport protocol versions
|
|
3
3
|
*/
|
|
4
4
|
export declare const Version: {
|
|
5
|
-
/**
|
|
6
|
-
* draft-ietf-moq-transport-07
|
|
7
|
-
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-07.txt
|
|
8
|
-
*/
|
|
9
|
-
readonly DRAFT_07: 4278190087;
|
|
10
|
-
/**
|
|
11
|
-
* draft-ietf-moq-transport-14
|
|
12
|
-
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-14.txt
|
|
13
|
-
*/
|
|
14
|
-
readonly DRAFT_14: 4278190094;
|
|
15
|
-
/**
|
|
16
|
-
* draft-ietf-moq-transport-15
|
|
17
|
-
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-15.txt
|
|
18
|
-
*/
|
|
19
|
-
readonly DRAFT_15: 4278190095;
|
|
20
|
-
/**
|
|
21
|
-
* draft-ietf-moq-transport-16
|
|
22
|
-
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-16.txt
|
|
23
|
-
*/
|
|
24
|
-
readonly DRAFT_16: 4278190096;
|
|
25
|
-
/**
|
|
26
|
-
* draft-ietf-moq-transport-17
|
|
27
|
-
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-17.txt
|
|
28
|
-
*/
|
|
29
|
-
readonly DRAFT_17: 4278190097;
|
|
30
5
|
/**
|
|
31
6
|
* draft-ietf-moq-transport-18
|
|
32
7
|
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-18.txt
|
|
33
8
|
*/
|
|
34
9
|
readonly DRAFT_18: 4278190098;
|
|
35
|
-
/**
|
|
36
|
-
* draft-ietf-moq-transport-19
|
|
37
|
-
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-19.txt
|
|
38
|
-
*/
|
|
39
|
-
readonly DRAFT_19: 4278190099;
|
|
40
10
|
/**
|
|
41
11
|
* draft-ietf-moq-transport-20
|
|
42
12
|
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-20.txt
|
|
43
13
|
*/
|
|
44
14
|
readonly DRAFT_20: 4278190100;
|
|
45
15
|
/**
|
|
46
|
-
* draft-ietf-moq-transport-
|
|
47
|
-
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-
|
|
16
|
+
* draft-ietf-moq-transport-22
|
|
17
|
+
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-22.txt
|
|
48
18
|
*/
|
|
49
|
-
readonly
|
|
19
|
+
readonly DRAFT_22: 4278190102;
|
|
50
20
|
/**
|
|
51
|
-
* draft-ietf-moq-transport-
|
|
21
|
+
* draft-ietf-moq-transport-23
|
|
22
|
+
* https://www.ietf.org/archive/id/draft-ietf-moq-transport-23.txt
|
|
52
23
|
*/
|
|
53
|
-
readonly
|
|
24
|
+
readonly DRAFT_23: 4278190103;
|
|
54
25
|
};
|
|
55
26
|
export type Version = (typeof Version)[keyof typeof Version];
|
|
56
27
|
export declare const ALPN: {
|
|
57
|
-
readonly DRAFT_14: "moq-00";
|
|
58
|
-
readonly DRAFT_15: "moqt-15";
|
|
59
|
-
readonly DRAFT_16: "moqt-16";
|
|
60
|
-
readonly DRAFT_17: "moqt-17";
|
|
61
28
|
readonly DRAFT_18: "moqt-18";
|
|
62
|
-
readonly DRAFT_19: "moqt-19";
|
|
63
29
|
readonly DRAFT_20: "moqt-20";
|
|
64
|
-
readonly DRAFT_21: "moqt-21";
|
|
65
30
|
readonly DRAFT_22: "moqt-22";
|
|
31
|
+
readonly DRAFT_23: "moqt-23";
|
|
66
32
|
};
|
|
67
33
|
/**
|
|
68
34
|
* IETF protocol versions used by the ietf/ module.
|
|
69
35
|
* Use this narrower type for version-branched encode/decode to get exhaustive matching.
|
|
70
36
|
*/
|
|
71
|
-
export type IetfVersion = typeof Version.
|
|
37
|
+
export type IetfVersion = typeof Version.DRAFT_18 | typeof Version.DRAFT_20 | typeof Version.DRAFT_22 | typeof Version.DRAFT_23;
|
|
38
|
+
/**
|
|
39
|
+
* Whether `version` is draft-23 or later. The older drafts are listed so a new draft falls
|
|
40
|
+
* forward to draft-23's wire form.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isDraft23(version: IetfVersion): boolean;
|
|
72
43
|
export declare function versionName(v: Version): string;
|
|
73
44
|
//# sourceMappingURL=version.d.ts.map
|
package/ietf/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/ietf/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO;IACnB;;;OAGG;aACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;aACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;aACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;aACH,QAAQ,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/ietf/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO;IACnB;;;OAGG;aACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;aACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;aACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;aACH,QAAQ,EAAE,UAAU;CACX,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAG7D,eAAO,MAAM,IAAI;aAChB,QAAQ,EAAE,SAAS;aACnB,QAAQ,EAAE,SAAS;aACnB,QAAQ,EAAE,SAAS;aACnB,QAAQ,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,WAAW,GACpB,OAAO,OAAO,CAAC,QAAQ,GACvB,OAAO,OAAO,CAAC,QAAQ,GACvB,OAAO,OAAO,CAAC,QAAQ,GACvB,OAAO,OAAO,CAAC,QAAQ,CAAC;AAS3B;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CASvD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE9C"}
|