@moq/net 0.4.7 → 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 -2
- package/announce.js.map +1 -1
- package/announced.d.ts +51 -47
- package/announced.d.ts.map +1 -1
- package/announced.js +183 -32
- 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 -139
- 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 -2
- package/bandwidth_api.js.map +1 -1
- package/broadcast.d.ts +64 -38
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +556 -173
- 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 +21 -13
- package/connection/accept.d.ts.map +1 -1
- package/connection/accept.js +97 -130
- package/connection/accept.js.map +1 -1
- package/connection/browser.d.ts.map +1 -1
- package/connection/browser.js +28 -20
- package/connection/browser.js.map +1 -1
- package/connection/connect.d.ts +120 -24
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +535 -217
- 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 -81
- 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 -95
- package/connection/goaway.js.map +1 -1
- package/connection/handshake.d.ts +34 -8
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +97 -21
- package/connection/handshake.js.map +1 -1
- package/connection/index.d.ts +4 -7
- package/connection/index.d.ts.map +1 -1
- package/connection/index.js +1 -3
- 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 +142 -63
- package/connection/pool.d.ts.map +1 -1
- package/connection/pool.js +281 -118
- 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 -234
- 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 -9
- 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 -5
- 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 -47
- 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 -2
- 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 -38
- package/error.js.map +1 -1
- package/errors.d.ts +2 -2
- package/errors.d.ts.map +1 -1
- package/errors.js +2 -3
- 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 -308
- 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 -65
- 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 -36
- package/ietf/aliases.js.map +1 -1
- package/ietf/cluster.d.ts +3 -3
- package/ietf/cluster.js +14 -55
- 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 -144
- 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 -101
- package/ietf/error.js.map +1 -1
- package/ietf/fetch.d.ts +93 -37
- package/ietf/fetch.d.ts.map +1 -1
- package/ietf/fetch.js +172 -94
- package/ietf/fetch.js.map +1 -1
- package/ietf/filter.d.ts +21 -31
- package/ietf/filter.d.ts.map +1 -1
- package/ietf/filter.js +140 -172
- package/ietf/filter.js.map +1 -1
- package/ietf/goaway.d.ts +12 -10
- package/ietf/goaway.d.ts.map +1 -1
- package/ietf/goaway.js +22 -36
- package/ietf/goaway.js.map +1 -1
- package/ietf/hidden.js +1 -2
- package/ietf/hidden.js.map +1 -1
- package/ietf/index.d.ts +8 -20
- package/ietf/index.d.ts.map +1 -1
- package/ietf/index.js +4 -15
- 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 -41
- 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 +19 -5
- package/ietf/namespace.d.ts.map +1 -1
- package/ietf/namespace.js +78 -27
- package/ietf/namespace.js.map +1 -1
- package/ietf/object.d.ts +195 -33
- package/ietf/object.d.ts.map +1 -1
- package/ietf/object.js +405 -179
- package/ietf/object.js.map +1 -1
- package/ietf/parameters.d.ts +25 -45
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +260 -473
- 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 -5
- package/ietf/priority.js.map +1 -1
- package/ietf/properties.d.ts +6 -5
- package/ietf/properties.d.ts.map +1 -1
- package/ietf/properties.js +78 -49
- package/ietf/properties.js.map +1 -1
- package/ietf/publish.d.ts +25 -33
- package/ietf/publish.d.ts.map +1 -1
- package/ietf/publish.js +45 -140
- package/ietf/publish.js.map +1 -1
- package/ietf/publish_namespace.d.ts +49 -72
- package/ietf/publish_namespace.d.ts.map +1 -1
- package/ietf/publish_namespace.js +66 -185
- package/ietf/publish_namespace.js.map +1 -1
- package/ietf/publisher.js +1800 -601
- 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 +6 -30
- package/ietf/request.d.ts.map +1 -1
- package/ietf/request.js +41 -79
- 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 -17
- 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 +5 -30
- package/ietf/setup.d.ts.map +1 -1
- package/ietf/setup.js +6 -118
- 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 -15
- package/ietf/solicit.js.map +1 -1
- package/ietf/subscribe.d.ts +52 -45
- package/ietf/subscribe.d.ts.map +1 -1
- package/ietf/subscribe.js +118 -240
- package/ietf/subscribe.js.map +1 -1
- package/ietf/subscribe_namespace.d.ts +16 -79
- package/ietf/subscribe_namespace.d.ts.map +1 -1
- package/ietf/subscribe_namespace.js +30 -202
- package/ietf/subscribe_namespace.js.map +1 -1
- package/ietf/subscriber.js +1839 -537
- package/ietf/subscriber.js.map +1 -1
- package/ietf/token.js +105 -28
- package/ietf/token.js.map +1 -1
- package/ietf/track.d.ts +27 -24
- package/ietf/track.d.ts.map +1 -1
- package/ietf/track.js +48 -62
- 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 -49
- 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 +34 -19
- package/index.d.ts.map +1 -1
- package/index.js +19 -7
- package/index.js.map +1 -1
- package/internal.d.ts +1515 -67
- package/internal.d.ts.map +1 -1
- package/internal.js +557 -80
- 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 +127 -66
- package/lite/announce.d.ts.map +1 -1
- package/lite/announce.js +384 -159
- 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 -78
- 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 -10
- 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 +2 -2
- package/lite/goaway.d.ts.map +1 -1
- package/lite/goaway.js +5 -14
- package/lite/goaway.js.map +1 -1
- package/lite/group.d.ts +67 -16
- package/lite/group.d.ts.map +1 -1
- package/lite/group.js +108 -31
- 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 +14 -13
- package/lite/index.d.ts.map +1 -1
- package/lite/index.js +2 -2
- package/lite/index.js.map +1 -1
- package/lite/message.d.ts +10 -2
- package/lite/message.d.ts.map +1 -1
- package/lite/message.js +28 -45
- 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 -106
- package/lite/priority.js.map +1 -1
- package/lite/probe.d.ts +2 -2
- package/lite/probe.d.ts.map +1 -1
- package/lite/probe.js +9 -1
- 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 -438
- 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 +2 -28
- package/lite/session.d.ts.map +1 -1
- package/lite/session.js +0 -100
- package/lite/session.js.map +1 -1
- package/lite/setup.d.ts +32 -5
- package/lite/setup.d.ts.map +1 -1
- package/lite/setup.js +95 -22
- 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 -2
- package/lite/stream.js.map +1 -1
- package/lite/subscribe.d.ts +478 -78
- package/lite/subscribe.d.ts.map +1 -1
- package/lite/subscribe.js +1373 -143
- 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 -516
- package/lite/subscriber.js.map +1 -1
- package/lite/track.d.ts +27 -12
- package/lite/track.d.ts.map +1 -1
- package/lite/track.js +116 -38
- 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 -34
- 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 +394 -142
- package/origin.d.ts.map +1 -1
- package/origin.js +2533 -687
- 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 -58
- 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 +78 -40
- package/stream.d.ts.map +1 -1
- package/stream.js +236 -93
- 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 -98
- package/tail.js.map +1 -1
- package/time.d.ts +41 -102
- package/time.d.ts.map +1 -1
- package/time.js +129 -92
- 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 +578 -246
- package/track.d.ts.map +1 -1
- package/track.js +7306 -772
- 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 -2
- 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 -5
- 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 -10
- 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/u64.js +0 -1
- package/util/utf8.d.ts +2 -0
- package/util/utf8.d.ts.map +1 -1
- package/util/utf8.js +7 -2
- package/util/utf8.js.map +1 -1
- package/util/varint.d.ts.map +1 -1
- package/util/varint.js +8 -2
- 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 -29
- 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 +150 -35
- package/wire.d.ts.map +1 -1
- package/wire.js +27 -1
- 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 -3
- 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 -700
- 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 -44
- 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 -79
- 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 -17
- package/util/log.js.map +0 -1
- package/zod.d.ts +0 -13
- package/zod.d.ts.map +0 -1
- package/zod.js +0 -19
- package/zod.js.map +0 -1
package/path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AA+CA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAE5B,iGAAiG;AACjG,MAAM,UAAU,IAAI,CAAC,GAAG,KAAe;IACtC,4GAA4G;IAC5G,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,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,CAAC,CAAC;IACb,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,yDAAyD;IACzD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAEzE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;SACpC,IAAI,CAAC,IAAI,CAAC;SACV,MAAM,CAAC,IAAI,CAAC,CAAC;IAEf,iFAAiF;IACjF,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAa,CAAC;AAC7D,CAAC;AAED,kEAAkE;AAClE,OAAO,EACN,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,QAAQ,GAGR,MAAM,cAAc,CAAC","sourcesContent":["/**\n * A broadcast path that provides safe prefix matching operations.\n *\n * This module provides path-aware operations that respect delimiter boundaries,\n * preventing issues like \"foo\" matching \"foobar\".\n *\n * Paths are automatically trimmed of leading and trailing slashes on creation,\n * making all slashes implicit at boundaries. A path names a point in the origin's\n * tree from its root; a leading slash never escapes that root. The same type names\n * an exact broadcast and the prefix a route or announcement covers, so a broadcast's\n * own path is the prefix it announces. See {@link Relative} for `..`-style references.\n *\n * {@link Pattern} and {@link Patterns} are re-exported from `@moq/pattern`, the owner of\n * the v1 grammar and algebra. Literal path construction and wire decoding retain\n * their existing behavior.\n *\n * @example\n * ```typescript\n * // Creation automatically trims slashes\n * const path1 = Path.from(\"/foo/bar/\");\n * const path2 = Path.from(\"foo/bar\");\n * console.log(path1 === path2); // true\n *\n * // Multiple arguments are joined with \"/\"\n * const path3 = Path.from(\"api\", \"v1\", \"users\");\n * console.log(path3); // \"api/v1/users\"\n *\n * // Safe prefix matching\n * const base = Path.from(\"api/v1\");\n * console.log(Path.hasPrefix(Path.from(\"api\"), base)); // true\n * console.log(Path.hasPrefix(Path.from(\"api/v1\"), base)); // true\n *\n * const joined = Path.join(base, Path.from(\"users\"));\n * console.log(joined); // \"api/v1/users\"\n * ```\n */\nexport type Valid = string & { __brand: \"Name\" };\n\n/**\n * A relative reference from one broadcast to another, as a hang catalog carries it.\n *\n * It may contain `..` and is meaningful only once {@link resolve}d against a base\n * {@link Valid} path. It never crosses the wire on its own. Build one with\n * {@link normalizeRelative} or {@link relative}.\n */\nexport type Relative = string & { __brand: \"Relative\" };\n\n/**\n * Maximum number of slash-separated parts in a path.\n *\n * Matches the IETF moq-transport limit of 32 fields in a namespace tuple.\n * moq-lite enforces the same bound when decoding paths off the wire.\n */\nexport const MAX_PARTS = 32;\n\n/** Build a path from one or more components, joining with \"/\" and trimming redundant slashes. */\nexport function from(...paths: string[]): Valid {\n\t// Join paths with \"/\" and then remove leading and trailing slashes, and collapse multiple slashes into one.\n\tconst joined = paths.join(\"/\");\n\treturn joined.replace(/\\/+/g, \"/\").replace(/^\\/+/, \"\").replace(/\\/+$/, \"\") as Valid;\n}\n\n/** Split a path into its slash-separated parts. The empty path has no parts. */\nexport function parts(path: Valid): string[] {\n\treturn path === \"\" ? [] : path.split(\"/\");\n}\n\n/**\n * Validate an untrusted wire string as a path, enforcing {@link MAX_PARTS}.\n *\n * Throws when the path has too many parts; use at wire decode sites.\n */\nexport function decode(raw: string): Valid {\n\tconst path = from(raw);\n\treturn encode(path);\n}\n\n/**\n * Validate a path before writing it to the wire, enforcing {@link MAX_PARTS}.\n *\n * Throws when the path has too many parts; use at wire encode sites so we never\n * emit a path the remote side is required to reject.\n */\nexport function encode(path: Valid): Valid {\n\t// Count separators with an early exit instead of splitting, so a hostile path never allocates per part.\n\tlet count = path === \"\" ? 0 : 1;\n\tfor (let i = path.indexOf(\"/\"); i !== -1; i = path.indexOf(\"/\", i + 1)) {\n\t\tif (++count > MAX_PARTS) {\n\t\t\tthrow new Error(`path exceeds ${MAX_PARTS} parts`);\n\t\t}\n\t}\n\treturn path;\n}\n\n/**\n * Check if a path has the given prefix, respecting path boundaries.\n *\n * Unlike String.startsWith, this ensures that \"foo\" does not match \"foobar\".\n * The prefix must either:\n * - Be exactly equal to the path\n * - Be followed by a '/' delimiter in the original path\n * - Be empty (matches everything)\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path)); // true\n * console.log(Path.hasPrefix(Path.from(\"foo/\"), path)); // true (trailing slash ignored)\n * console.log(Path.hasPrefix(Path.from(\"fo\"), path)); // false\n *\n * const path2 = Path.from(\"foobar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path2)); // false\n * ```\n */\nexport function hasPrefix(prefix: Valid, path: Valid): boolean {\n\tif (prefix === \"\") {\n\t\treturn true;\n\t}\n\n\tif (!path.startsWith(prefix)) {\n\t\treturn false;\n\t}\n\n\t// Check if the prefix is the exact match\n\tif (path.length === prefix.length) {\n\t\treturn true;\n\t}\n\n\t// Otherwise, ensure the character after the prefix is a delimiter\n\treturn path[prefix.length] === \"/\";\n}\n\n/**\n * Strip the given prefix from a path, returning the suffix.\n *\n * Returns null if the prefix doesn't match according to hasPrefix rules.\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar/baz\");\n * const suffix = Path.stripPrefix(Path.from(\"foo\"), path);\n * console.log(suffix); // \"bar/baz\"\n *\n * const suffix2 = Path.stripPrefix(Path.from(\"foo/\"), path);\n * console.log(suffix2); // \"bar/baz\"\n *\n * const noMatch = Path.stripPrefix(Path.from(\"notfound\"), path);\n * console.log(noMatch); // null\n * ```\n */\nexport function stripPrefix(prefix: Valid, path: Valid): Valid | null {\n\tif (!hasPrefix(prefix, path)) {\n\t\treturn null;\n\t}\n\n\t// Handle empty prefix case\n\tif (prefix === \"\") {\n\t\treturn path;\n\t}\n\n\t// If prefix matches exactly, return empty\n\tif (path.length === prefix.length) {\n\t\treturn \"\" as Valid;\n\t}\n\n\t// For non-empty prefix that's shorter, skip the prefix and the following slash\n\treturn path.slice(prefix.length + 1) as Valid;\n}\n\n/**\n * Join two path components together.\n *\n * @example\n * ```typescript\n * const base = Path.from(\"foo\");\n * const joined = Path.join(base, Path.from(\"bar\"));\n * console.log(joined); // \"foo/bar\"\n * ```\n */\nexport function join(path: Valid, other: Valid): Valid {\n\tif (path === \"\") {\n\t\treturn other;\n\t} else if (other === \"\") {\n\t\treturn path;\n\t} else {\n\t\t// Since paths are trimmed, we always need to add a slash\n\t\treturn `${path}/${other}` as Valid;\n\t}\n}\n\n/** The empty path, which is a prefix of every path. */\nexport function empty(): Valid {\n\treturn \"\" as Valid;\n}\n\n/**\n * Normalize a relative path reference: trim leading/trailing slashes, drop empty\n * segments, and drop redundant `.` segments. A reference made only of `.` segments\n * normalizes to `.` because it names the base's parent, while empty names the base.\n * `..` is preserved and only interpreted by {@link resolve}.\n *\n * Mirrors the Rust `path::Relative::new` normalization, so JS and Rust agree\n * byte-for-byte on the stored form. Two callers comparing normalized strings can\n * detect equivalent references while preserving the distinction between `\"\"` and `\".\"`.\n */\nexport function normalizeRelative(rel: string): Relative {\n\tconst raw = rel.split(\"/\");\n\tconst normalized = raw.filter((s) => s !== \"\" && s !== \".\").join(\"/\");\n\n\treturn (normalized === \"\" && raw.includes(\".\") ? \".\" : normalized) as Relative;\n}\n\n/**\n * Resolve a relative path reference against a base path.\n *\n * A non-empty reference replaces the last segment of the base, matching relative URL\n * resolution. `..` segments then pop another segment; other segments are appended.\n * `.` and empty segments are no-ops. Excess `..` once the base is empty is also a no-op\n * (subsequent named segments still append). An empty `rel` returns the base unchanged.\n *\n * Mirrors the Rust `Path::resolve`, used by hang catalogs to express\n * cross-broadcast track references (a rendition's `broadcast` field).\n *\n * @example\n * ```typescript\n * Path.resolve(Path.from(\"a/b/c\"), \"./source\"); // \"a/b/source\"\n * Path.resolve(Path.from(\"a/b\"), \".\"); // \"a\"\n * Path.resolve(Path.from(\"a/b/c\"), \"../source\"); // \"a/source\"\n * ```\n */\nexport function resolve(base: Valid, rel: Relative): Valid {\n\tif (rel === \"\") return base;\n\n\tconst segments = base === \"\" ? [] : base.split(\"/\");\n\tsegments.pop();\n\n\tfor (const seg of rel.split(\"/\")) {\n\t\tif (seg === \"\" || seg === \".\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg === \"..\") {\n\t\t\tsegments.pop();\n\t\t} else {\n\t\t\tsegments.push(seg);\n\t\t}\n\t}\n\n\treturn segments.join(\"/\") as Valid;\n}\n\n/**\n * Resolve a relative path, returning `undefined` if it escapes above the root.\n *\n * Unlike {@link resolve}, this distinguishes a valid reference to the empty root\n * path from excess `..` segments. Use it for untrusted catalog references that\n * must not be clamped to the root.\n */\nexport function tryResolve(base: Valid, rel: Relative): Valid | undefined {\n\tif (rel === \"\") return base;\n\n\tconst segments = base === \"\" ? [] : base.split(\"/\");\n\tsegments.pop();\n\n\tfor (const seg of rel.split(\"/\")) {\n\t\tif (seg === \"\" || seg === \".\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg === \"..\") {\n\t\t\tif (segments.pop() === undefined) return undefined;\n\t\t} else {\n\t\t\tsegments.push(seg);\n\t\t}\n\t}\n\n\treturn segments.join(\"/\") as Valid;\n}\n\n/**\n * Express `target` relative to `base`: the inverse of {@link resolve}.\n *\n * The result round-trips (`resolve(base, relative(target, base)) === target`) and never\n * walks above the root, so {@link tryResolve} accepts it too.\n *\n * A relative reference replaces the last segment of the base, matching relative URL\n * resolution, so a target nested under the base repeats the base's own last segment.\n *\n * The empty reference names the base itself, so that is what a self-reference returns.\n *\n * Returns `undefined` for a target no reference can name: a path segment may literally be\n * `.` or `..`, which resolution reads as navigation instead of as a name. Only the segments\n * past the shared prefix matter, since the rest are never emitted.\n *\n * Mirrors the Rust `Path::relative`, used to author the cross-broadcast track\n * references a hang catalog carries. Note the argument order: the target comes first,\n * the opposite of Node's `path.relative(from, to)`.\n *\n * @example\n * ```typescript\n * Path.relative(Path.from(\"a/b/c\"), Path.from(\"a/b\")); // \"b/c\"\n * Path.relative(Path.from(\"a/c\"), Path.from(\"a/b\")); // \"c\"\n * Path.relative(Path.from(\"a\"), Path.from(\"a/b\")); // \".\"\n * Path.relative(Path.from(\"a/b\"), Path.from(\"a/b\")); // \"\"\n * Path.relative(Path.from(\"a/..\"), Path.from(\"a/b\")); // undefined\n * ```\n */\nexport function relative(target: Valid, base: Valid): Relative | undefined {\n\t// Only the empty reference can name a base whose last segment is itself `.` or `..`,\n\t// since resolution replaces that segment rather than emitting it.\n\tif (target === base) return \"\" as Relative;\n\n\t// Resolution replaces the base's last segment, so walk from its parent.\n\tconst dir = base === \"\" ? [] : base.split(\"/\");\n\tdir.pop();\n\n\tconst parts = target === \"\" ? [] : target.split(\"/\");\n\n\tlet common = 0;\n\twhile (common < dir.length && common < parts.length && dir[common] === parts[common]) {\n\t\tcommon += 1;\n\t}\n\n\tconst down = parts.slice(common);\n\t// Resolution would walk on these instead of naming them.\n\tif (down.some((part) => part === \".\" || part === \"..\")) return undefined;\n\n\tconst rel = Array(dir.length - common)\n\t\t.fill(\"..\")\n\t\t.concat(down);\n\n\t// An empty reference resolves to the base itself, so name the parent explicitly.\n\treturn (rel.length === 0 ? \".\" : rel.join(\"/\")) as Relative;\n}\n\n/** Path patterns: grammar and algebra owned by `@moq/pattern`. */\nexport {\n\tcompareSpecificity,\n\tInvalidPattern,\n\tPattern,\n\tPatterns,\n\ttype Segment,\n\ttype Specificity,\n} from \"@moq/pattern\";\n"]}
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAc7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAE5B;;;;;;;GA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operations.\n *\n * This module provides path-aware operations that respect delimiter boundaries,\n * preventing issues like \"foo\" matching \"foobar\".\n *\n * A path is a run of non-empty segments separated by `/`, so it has exactly one spelling:\n * {@link from} throws on a leading, trailing, or doubled slash rather than collapsing it, and on\n * a lone surrogate, which has no UTF-8 bytes of its own.\n * A `\\` escapes the `\\` or `/` after it, which is how a moq-transport namespace field holding\n * either one is spelled, and any other `\\` is refused. An escaped `/` never splits a segment:\n * `a\\/b` is one segment, and a prefix never ends inside it.\n * {@link parts} is the one walk every segment reading goes through. Until the previous release\n * is gone, an escaped `/` still counts against {@link MAX_PARTS}, and one beside a bare `/` or at\n * the end is refused, since that release splits at every `/`.\n * The empty path is the root, which prefixes every path; a prefix needs no trailing slash.\n * A path names a point in the origin's tree from its root. The same type names an exact\n * broadcast and the prefix a route or announcement covers, so a broadcast's own path is\n * the prefix it announces. See {@link Relative} for `..`-style references.\n *\n * {@link Prefix} and {@link Prefixes} name grants and scopes: each prefix covers its whole subtree.\n *\n * @example\n * ```typescript\n * // Multiple arguments are joined with \"/\", and an empty one is the root\n * const path = Path.from(\"api\", \"\", \"v1/users\");\n * console.log(path); // \"api/v1/users\"\n *\n * // A slash at a boundary or a doubled one is an empty segment\n * Path.from(\"/api/v1\"); // throws\n *\n * // Safe prefix matching\n * const base = Path.from(\"api/v1\");\n * console.log(Path.hasPrefix(Path.from(\"api\"), base)); // true\n * console.log(Path.hasPrefix(Path.from(\"api/v1\"), base)); // true\n *\n * const joined = Path.join(base, Path.from(\"users\"));\n * console.log(joined); // \"api/v1/users\"\n * ```\n * @module\n */\n\nimport { parts as split } from \"./prefix.ts\";\n\n/** A broadcast path: non-empty segments separated by `/`, or the empty root. */\nexport type Valid = string & { __brand: \"Name\" };\n\n/**\n * A relative reference from one broadcast to another, as a hang catalog carries it.\n *\n * It may contain `..` and is meaningful only once {@link resolve}d against a base\n * {@link Valid} path. It never crosses the wire on its own. Build one with\n * {@link normalizeRelative} or {@link relative}.\n */\nexport type Relative = string & { __brand: \"Relative\" };\n\n/**\n * Maximum number of segments in a path.\n *\n * Matches the IETF moq-transport limit of 32 fields in a namespace tuple.\n * moq-lite enforces the same bound when decoding paths off the wire.\n *\n * @internal\n */\nexport const MAX_PARTS = 32;\n\n/**\n * Maximum UTF-8 length of a path in bytes.\n *\n * Matches the IETF moq-transport limit of 4096 bytes for a namespace. Its tuple fields\n * drop the path's separators and escapes, so every path fits both wires.\n *\n * @internal\n */\nexport const MAX_BYTES = 4096;\n\nconst utf8 = new TextEncoder();\n\n/**\n * Build a path by joining components with \"/\", where an empty component is the root.\n *\n * Throws when a component has a leading, trailing, or doubled `/`, a `\\` before anything\n * but `\\` or `/`, or a lone surrogate, or when the path is longer than 4096 bytes or\n * deeper than 32 parts.\n */\nexport function from(...paths: string[]): Valid {\n\tfor (const path of paths) {\n\t\tconst error = longer(path) ?? spelling(path);\n\t\tif (error) throw new Error(error);\n\t}\n\treturn bounded(paths.filter((path) => path !== \"\").join(\"/\"));\n}\n\n// Why `path` passes `MAX_BYTES`, or undefined when it fits.\nfunction longer(path: string): string | undefined {\n\t// A UTF-16 unit is at most 3 UTF-8 bytes, so only a long path needs encoding to measure.\n\tif (path.length > MAX_BYTES / 3 && utf8.encode(path).length > MAX_BYTES) {\n\t\treturn `path exceeds ${MAX_BYTES} bytes`;\n\t}\n\treturn undefined;\n}\n\n// Why the resolved `path` breaks the bounds every path keeps, or undefined when it fits. A\n// `Relative`'s `..` steps can pass `MAX_PARTS` between two valid paths, so it is exempt.\nfunction bounds(path: string): string | undefined {\n\treturn (\n\t\tlonger(path) ?? (path !== \"\" && split(path).length > MAX_PARTS ? `path exceeds ${MAX_PARTS} parts` : undefined)\n\t);\n}\n\n// `path`, already spelled validly, as a `Valid` once it fits the bounds.\nfunction bounded(path: string): Valid {\n\tconst error = bounds(path);\n\tif (error) throw new Error(error);\n\treturn path as Valid;\n}\n\n// Why `path` is not the one spelling of a path, or undefined when it is.\nfunction spelling(path: string): string | undefined {\n\t// UTF-8 cannot carry a lone surrogate: the encoder writes U+FFFD, another path's bytes.\n\tif (!path.isWellFormed()) return \"path contains a lone surrogate\";\n\tif (!path.includes(\"\\\\\")) {\n\t\t// Without a `\\`, every `/` separates.\n\t\treturn path.startsWith(\"/\") || path.endsWith(\"/\") || path.includes(\"//\")\n\t\t\t? \"path contains an empty segment\"\n\t\t\t: undefined;\n\t}\n\t// Pairs of `\\` are escaped backslashes, so any `\\` left must escape a `/`.\n\tif (/\\\\(?!\\/)/.test(path.replaceAll(\"\\\\\\\\\", \"\"))) {\n\t\treturn \"path contains a `\\\\` that escapes neither `\\\\` nor `/`\";\n\t}\n\t// TEMPORARY MIGRATION, delete at the next version cut: the previous release splits at every\n\t// `/`, escaped or not, and trims and collapses the empty segments that leaves, so it would\n\t// re-spell `a\\//b` as `a\\/b`, another broadcast's path. Refuse what it would re-spell.\n\tif (path.endsWith(\"/\") || path.includes(\"//\")) return \"path contains an empty segment\";\n\t// An escaped `/` is content, so only a bare one can leave a segment empty.\n\tif (split(path).includes(\"\")) return \"path contains an empty segment\";\n\treturn undefined;\n}\n\n/**\n * Split a path into its segments, only at a `/` no `\\` escapes, each still escaped as written.\n * The empty path has no parts. See {@link unescape} for a segment's content.\n */\nexport function parts(path: Valid): string[] {\n\treturn split(path);\n}\n\n/** The first `n` segments of `path`, or `undefined` if it has fewer. */\nexport function head(path: Valid, n: number): Valid | undefined {\n\tconst segments = parts(path);\n\treturn n <= segments.length ? (segments.slice(0, n).join(\"/\") as Valid) : undefined;\n}\n\n/**\n * Validate an untrusted wire string as a path, enforcing {@link MAX_PARTS} and a 4096 byte limit.\n *\n * Throws when the path has an empty segment or is too deep or too long; use at wire decode sites.\n *\n * @internal\n */\nexport function decode(raw: string): Valid {\n\t// The limits first, so a hostile path is refused before its spelling is split.\n\tencode(raw as Valid);\n\treturn from(raw);\n}\n\n/** Like {@link decode}, but `undefined` for an invalid path rather than a throw. @internal */\nexport function tryDecode(raw: string): Valid | undefined {\n\tconst path = raw as Valid;\n\tif (check(path) !== undefined) return undefined;\n\treturn spelling(raw) === undefined ? path : undefined;\n}\n\n/**\n * Validate a path before writing it to the wire, enforcing {@link MAX_PARTS} and a 4096 byte limit.\n *\n * Throws when the path is too deep or too long; use at wire encode sites so we never\n * emit a path the remote side is required to reject.\n *\n * @internal\n */\nexport function encode(path: Valid): Valid {\n\tconst error = check(path);\n\tif (error) throw new Error(error);\n\treturn path;\n}\n\n/** Why `path` breaks the wire limits, or undefined when it fits. @internal */\nexport function check(path: Valid): string | undefined {\n\t// TEMPORARY MIGRATION, delete at the next version cut and count `parts` instead: the previous\n\t// release splits at every `/`, escaped or not, and ends the whole announce stream on a path\n\t// past 32 parts by that count, so until it is gone the limit counts every `/`.\n\t// Count separators with an early exit instead of splitting, so a hostile path never allocates per part.\n\tlet count = path === \"\" ? 0 : 1;\n\tfor (let i = path.indexOf(\"/\"); i !== -1; i = path.indexOf(\"/\", i + 1)) {\n\t\tif (++count > MAX_PARTS) return `path exceeds ${MAX_PARTS} parts`;\n\t}\n\treturn longer(path);\n}\n\n/**\n * Check if a path has the given prefix, respecting path boundaries.\n *\n * Unlike String.startsWith, this ensures that \"foo\" does not match \"foobar\".\n * The prefix must either:\n * - Be exactly equal to the path\n * - Be followed by a '/' delimiter in the original path\n * - Be empty (matches everything)\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path)); // true\n * console.log(Path.hasPrefix(Path.from(\"fo\"), path)); // false\n *\n * const path2 = Path.from(\"foobar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path2)); // false\n * ```\n */\nexport function hasPrefix(prefix: Valid, path: Valid): boolean {\n\tif (prefix === \"\") {\n\t\treturn true;\n\t}\n\n\tif (!path.startsWith(prefix)) {\n\t\treturn false;\n\t}\n\n\t// Check if the prefix is the exact match\n\tif (path.length === prefix.length) {\n\t\treturn true;\n\t}\n\n\t// Otherwise, ensure the character after the prefix is a delimiter\n\treturn path[prefix.length] === \"/\";\n}\n\n/**\n * Strip the given prefix from a path, returning the suffix.\n *\n * Returns null if the prefix doesn't match according to hasPrefix rules.\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar/baz\");\n * const suffix = Path.stripPrefix(Path.from(\"foo\"), path);\n * console.log(suffix); // \"bar/baz\"\n *\n * const noMatch = Path.stripPrefix(Path.from(\"notfound\"), path);\n * console.log(noMatch); // null\n * ```\n */\nexport function stripPrefix(prefix: Valid, path: Valid): Valid | null {\n\tif (!hasPrefix(prefix, path)) {\n\t\treturn null;\n\t}\n\n\t// Handle empty prefix case\n\tif (prefix === \"\") {\n\t\treturn path;\n\t}\n\n\t// If prefix matches exactly, return empty\n\tif (path.length === prefix.length) {\n\t\treturn \"\" as Valid;\n\t}\n\n\t// For non-empty prefix that's shorter, skip the prefix and the following slash\n\treturn path.slice(prefix.length + 1) as Valid;\n}\n\n/**\n * Join two path components together, throwing when the result is longer than 4096 bytes\n * or deeper than 32 parts.\n *\n * @example\n * ```typescript\n * const base = Path.from(\"foo\");\n * const joined = Path.join(base, Path.from(\"bar\"));\n * console.log(joined); // \"foo/bar\"\n * ```\n */\nexport function join(path: Valid, other: Valid): Valid {\n\tif (path === \"\") return other;\n\tif (other === \"\") return path;\n\t// Neither side has a boundary slash, so exactly one joins them.\n\treturn bounded(`${path}/${other}`);\n}\n\n/** Like {@link join}, but `undefined` when the result is too long or too deep rather than a throw. */\nexport function tryJoin(path: Valid, other: Valid): Valid | undefined {\n\tif (path === \"\") return other;\n\tif (other === \"\") return path;\n\tconst joined = `${path}/${other}`;\n\treturn bounds(joined) === undefined ? (joined as Valid) : undefined;\n}\n\n/** The empty path, which is a prefix of every path. */\nexport function empty(): Valid {\n\treturn \"\" as Valid;\n}\n\n/**\n * Parse a relative path reference and drop its redundant `.` segments. It is spelled like\n * a path, so this throws on a leading, trailing, or doubled `/` or a lone `\\` rather than\n * collapsing it, and an escaped `/` never splits a segment. A reference made only of `.` segments normalizes to `.` because it names\n * the base's parent, while empty names the base. `..` is preserved and only interpreted\n * by {@link resolve}.\n *\n * Mirrors the Rust `path::Relative::new`, so JS and Rust agree byte-for-byte on the stored\n * form. Two callers comparing normalized strings can detect equivalent references while\n * preserving the distinction between `\"\"` and `\".\"`.\n */\nexport function normalizeRelative(rel: string): Relative {\n\t// Unbounded: `..` steps between two valid paths can pass the limits, and only the path a\n\t// reference resolves to is held to them.\n\tconst error = spelling(rel);\n\tif (error) throw new Error(error);\n\tconst raw = split(rel);\n\tif (!raw.includes(\".\")) return rel as Relative;\n\n\t// Dropping whole segments leaves a valid path.\n\tconst normalized = raw.filter((s) => s !== \".\").join(\"/\");\n\treturn (normalized === \"\" ? \".\" : normalized) as Relative;\n}\n\n/**\n * Resolve a relative path reference against a base path.\n *\n * A non-empty reference replaces the last segment of the base, matching relative URL\n * resolution. `..` segments then pop another segment; other segments are appended.\n * `.` segments are no-ops. Excess `..` once the base is empty is also a no-op\n * (subsequent named segments still append). An empty `rel` returns the base unchanged.\n *\n * Throws when the result is longer than 4096 bytes or deeper than 32 parts.\n *\n * Mirrors the Rust `Path::resolve`, used by hang catalogs to express\n * cross-broadcast track references (a rendition's `broadcast` field).\n *\n * @example\n * ```typescript\n * Path.resolve(Path.from(\"a/b/c\"), \"./source\"); // \"a/b/source\"\n * Path.resolve(Path.from(\"a/b\"), \".\"); // \"a\"\n * Path.resolve(Path.from(\"a/b/c\"), \"../source\"); // \"a/source\"\n * ```\n */\nexport function resolve(base: Valid, rel: Relative): Valid {\n\tif (rel === \"\") return base;\n\n\tconst segments = parts(base);\n\tsegments.pop();\n\n\tfor (const seg of parts(rel as string as Valid)) {\n\t\tif (seg === \".\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg === \"..\") {\n\t\t\tsegments.pop();\n\t\t} else {\n\t\t\tsegments.push(seg);\n\t\t}\n\t}\n\n\t// Whole segments of valid paths rejoin into a validly spelled path, unless it is too long or deep.\n\treturn bounded(segments.join(\"/\"));\n}\n\n/**\n * Resolve a relative path, returning `undefined` if it escapes above the root or\n * {@link resolve} would throw.\n *\n * Unlike {@link resolve}, this distinguishes a valid reference to the empty root\n * path from excess `..` segments. Use it for untrusted catalog references that\n * must not be clamped to the root.\n */\nexport function tryResolve(base: Valid, rel: Relative): Valid | undefined {\n\tif (rel === \"\") return base;\n\n\tconst segments = parts(base);\n\tsegments.pop();\n\n\tfor (const seg of parts(rel as string as Valid)) {\n\t\tif (seg === \".\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (seg === \"..\") {\n\t\t\tif (segments.pop() === undefined) return undefined;\n\t\t} else {\n\t\t\tsegments.push(seg);\n\t\t}\n\t}\n\n\tconst resolved = segments.join(\"/\");\n\treturn bounds(resolved) === undefined ? (resolved as Valid) : undefined;\n}\n\n/**\n * Express `target` relative to `base`: the inverse of {@link resolve}.\n *\n * The result round-trips (`resolve(base, relative(target, base)) === target`) and never\n * walks above the root, so {@link tryResolve} accepts it too.\n *\n * A relative reference replaces the last segment of the base, matching relative URL\n * resolution, so a target nested under the base repeats the base's own last segment.\n *\n * The empty reference names the base itself, so that is what a self-reference returns.\n *\n * Returns `undefined` for a target no reference can name: a path segment may literally be\n * `.` or `..`, which resolution reads as navigation instead of as a name. Only the segments\n * past the shared prefix matter, since the rest are never emitted.\n *\n * Mirrors the Rust `Path::relative`, used to author the cross-broadcast track\n * references a hang catalog carries. Note the argument order: the target comes first,\n * the opposite of Node's `path.relative(from, to)`.\n *\n * @example\n * ```typescript\n * Path.relative(Path.from(\"a/b/c\"), Path.from(\"a/b\")); // \"b/c\"\n * Path.relative(Path.from(\"a/c\"), Path.from(\"a/b\")); // \"c\"\n * Path.relative(Path.from(\"a\"), Path.from(\"a/b\")); // \".\"\n * Path.relative(Path.from(\"a/b\"), Path.from(\"a/b\")); // \"\"\n * Path.relative(Path.from(\"a/..\"), Path.from(\"a/b\")); // undefined\n * ```\n */\nexport function relative(target: Valid, base: Valid): Relative | undefined {\n\t// Only the empty reference can name a base whose last segment is itself `.` or `..`,\n\t// since resolution replaces that segment rather than emitting it.\n\tif (target === base) return \"\" as Relative;\n\n\t// Resolution replaces the base's last segment, so walk from its parent.\n\tconst dir = parts(base);\n\tdir.pop();\n\n\tconst segments = parts(target);\n\n\tlet common = 0;\n\twhile (common < dir.length && common < segments.length && dir[common] === segments[common]) {\n\t\tcommon += 1;\n\t}\n\n\tconst down = segments.slice(common);\n\t// Resolution would walk on these instead of naming them.\n\tif (down.some((part) => part === \".\" || part === \"..\")) return undefined;\n\n\tconst rel = Array(dir.length - common)\n\t\t.fill(\"..\")\n\t\t.concat(down);\n\n\t// An empty reference resolves to the base itself, so name the parent explicitly.\n\treturn (rel.length === 0 ? \".\" : rel.join(\"/\")) as Relative;\n}\n\n/** Grant prefixes and a segment's escaping. */\nexport { escape, InvalidPrefix, Prefix, Prefixes, unescape } from \"./prefix.ts\";\n"]}
|
package/payload.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type * as frame from "./frame.ts";
|
|
2
|
+
import type * as group from "./group.ts";
|
|
3
|
+
import { type ReadGroupFrame } from "./internal.ts";
|
|
4
|
+
import type { Cursor, Reader } from "./stream.ts";
|
|
5
|
+
import { type Timestamp } from "./time.ts";
|
|
6
|
+
/** A decoded frame header, and its payload unless that streams in after it. */
|
|
7
|
+
export interface WirePayload {
|
|
8
|
+
/** The payload size in bytes. */
|
|
9
|
+
size: number;
|
|
10
|
+
/** The payload, or `undefined` past one segment, where it follows the header on the stream. */
|
|
11
|
+
payload?: Uint8Array;
|
|
12
|
+
/** The timestamp the wire carried, which a scale-less track's frame lacks. */
|
|
13
|
+
timestamp?: Timestamp;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Read a `size`-byte payload with its header when it fits one segment; a larger one is left on the
|
|
17
|
+
* stream. A size past {@link MAX_FRAME_BYTES} throws `FrameTooLarge` before any of it is read, as
|
|
18
|
+
* the group a reader joins keeps every chunk of the frame.
|
|
19
|
+
*/
|
|
20
|
+
export declare function decodePayload(c: Cursor, size: number): Uint8Array | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Write a decoded frame into `producer`, streaming from `stream` a payload its decode left
|
|
23
|
+
* there. A frame the wire carried no timestamp for, on a scale-less track, takes its group's
|
|
24
|
+
* key. Resolves false if the group closed first, which already failed the frame.
|
|
25
|
+
*/
|
|
26
|
+
export declare function receiveFrame(stream: Reader, producer: group.Producer, frame: WirePayload, inflated?: number): Promise<boolean>;
|
|
27
|
+
/** Read past a `size`-byte payload left on the stream, keeping none of it. */
|
|
28
|
+
export declare function skipPayload(stream: Reader, size: number): Promise<void>;
|
|
29
|
+
/** The payload size of a frame read for egress. */
|
|
30
|
+
export declare function readSize(read: ReadGroupFrame): number;
|
|
31
|
+
/** Write a streamed payload with `write` as it arrives. Throws if `closed` settles first, since the stream can take no more. */
|
|
32
|
+
export declare function sendPayload(chunks: frame.Consumer, write: (chunk: Uint8Array) => Promise<unknown>, closed: Promise<void>): Promise<void>;
|
|
33
|
+
//# sourceMappingURL=payload.d.ts.map
|
package/payload.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../src/payload.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AACzC,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAGrD,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC3B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/F,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAG7E;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CACjC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAclB;AAED,8EAA8E;AAC9E,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7E;AAED,mDAAmD;AACnD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAErD;AAED,gIAAgI;AAChI,wBAAsB,WAAW,CAChC,MAAM,EAAE,KAAK,CAAC,QAAQ,EACtB,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,EAC9C,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,GACnB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
package/payload.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A frame payload's way between a wire stream and a group. A payload within one segment is
|
|
3
|
+
* decoded with its header; a larger one streams through in chunks, so no hop holds it whole.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { race } from "@moq/signals";
|
|
8
|
+
import { FrameTooLarge } from "./error.js";
|
|
9
|
+
import { hooks } from "./internal.js";
|
|
10
|
+
import { received } from "./time.js";
|
|
11
|
+
import { MAX_FRAME_BYTES, SEGMENT_BYTES } from "./util/limits.js";
|
|
12
|
+
/**
|
|
13
|
+
* Read a `size`-byte payload with its header when it fits one segment; a larger one is left on the
|
|
14
|
+
* stream. A size past {@link MAX_FRAME_BYTES} throws `FrameTooLarge` before any of it is read, as
|
|
15
|
+
* the group a reader joins keeps every chunk of the frame.
|
|
16
|
+
*/
|
|
17
|
+
export function decodePayload(c, size) {
|
|
18
|
+
if (size > MAX_FRAME_BYTES)
|
|
19
|
+
throw new FrameTooLarge();
|
|
20
|
+
return size > SEGMENT_BYTES ? undefined : c.read(size);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Write a decoded frame into `producer`, streaming from `stream` a payload its decode left
|
|
24
|
+
* there. A frame the wire carried no timestamp for, on a scale-less track, takes its group's
|
|
25
|
+
* key. Resolves false if the group closed first, which already failed the frame.
|
|
26
|
+
*/
|
|
27
|
+
export async function receiveFrame(stream, producer, frame, inflated) {
|
|
28
|
+
const timestamp = received(frame.timestamp, producer.start);
|
|
29
|
+
if (frame.payload) {
|
|
30
|
+
hooks.writeGroupFrame(producer, { payload: frame.payload, timestamp }, inflated);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
const open = producer.createFrame({ size: frame.size, timestamp });
|
|
34
|
+
while (open.remaining > 0) {
|
|
35
|
+
const chunk = await race([stream.readChunk(Math.min(open.remaining, SEGMENT_BYTES)), producer.closed]);
|
|
36
|
+
if (!(chunk instanceof Uint8Array))
|
|
37
|
+
return false;
|
|
38
|
+
open.write(chunk);
|
|
39
|
+
}
|
|
40
|
+
open.finish();
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/** Read past a `size`-byte payload left on the stream, keeping none of it. */
|
|
44
|
+
export async function skipPayload(stream, size) {
|
|
45
|
+
for (let left = size; left > 0;)
|
|
46
|
+
left -= (await stream.readChunk(Math.min(left, SEGMENT_BYTES))).byteLength;
|
|
47
|
+
}
|
|
48
|
+
/** The payload size of a frame read for egress. */
|
|
49
|
+
export function readSize(read) {
|
|
50
|
+
return read.chunks?.size ?? read.frame.payload.byteLength;
|
|
51
|
+
}
|
|
52
|
+
/** Write a streamed payload with `write` as it arrives. Throws if `closed` settles first, since the stream can take no more. */
|
|
53
|
+
export async function sendPayload(chunks, write, closed) {
|
|
54
|
+
for (let sent = 0;;) {
|
|
55
|
+
const chunk = await hooks.readFrameChunk(chunks, closed);
|
|
56
|
+
if (!(chunk instanceof Uint8Array)) {
|
|
57
|
+
if (sent < chunks.size)
|
|
58
|
+
throw new Error("stream closed mid-frame");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
sent += chunk.byteLength;
|
|
62
|
+
await write(chunk);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=payload.js.map
|
package/payload.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../src/payload.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAuB,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAkB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAYlE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,CAAS,EAAE,IAAY;IACpD,IAAI,IAAI,GAAG,eAAe;QAAE,MAAM,IAAI,aAAa,EAAE,CAAC;IACtD,OAAO,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CACjC,MAAc,EACd,QAAwB,EACxB,KAAkB,EAClB,QAAiB;IAEjB,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,KAAK,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,OAAO,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AAC;QACvB,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzD,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;YACpC,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;YACnE,OAAO;QACR,CAAC;QACD,IAAI,IAAI,KAAK,CAAC,UAAU,CAAC;QACzB,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;AACF,CAAC","sourcesContent":["/**\n * A frame payload's way between a wire stream and a group. A payload within one segment is\n * decoded with its header; a larger one streams through in chunks, so no hop holds it whole.\n *\n * @module\n */\nimport { race } from \"@moq/signals\";\nimport { FrameTooLarge } from \"./error.ts\";\nimport type * as frame from \"./frame.ts\";\nimport type * as group from \"./group.ts\";\nimport { hooks, type ReadGroupFrame } from \"./internal.ts\";\nimport type { Cursor, Reader } from \"./stream.ts\";\nimport { received, type Timestamp } from \"./time.ts\";\nimport { MAX_FRAME_BYTES, SEGMENT_BYTES } from \"./util/limits.ts\";\n\n/** A decoded frame header, and its payload unless that streams in after it. */\nexport interface WirePayload {\n\t/** The payload size in bytes. */\n\tsize: number;\n\t/** The payload, or `undefined` past one segment, where it follows the header on the stream. */\n\tpayload?: Uint8Array;\n\t/** The timestamp the wire carried, which a scale-less track's frame lacks. */\n\ttimestamp?: Timestamp;\n}\n\n/**\n * Read a `size`-byte payload with its header when it fits one segment; a larger one is left on the\n * stream. A size past {@link MAX_FRAME_BYTES} throws `FrameTooLarge` before any of it is read, as\n * the group a reader joins keeps every chunk of the frame.\n */\nexport function decodePayload(c: Cursor, size: number): Uint8Array | undefined {\n\tif (size > MAX_FRAME_BYTES) throw new FrameTooLarge();\n\treturn size > SEGMENT_BYTES ? undefined : c.read(size);\n}\n\n/**\n * Write a decoded frame into `producer`, streaming from `stream` a payload its decode left\n * there. A frame the wire carried no timestamp for, on a scale-less track, takes its group's\n * key. Resolves false if the group closed first, which already failed the frame.\n */\nexport async function receiveFrame(\n\tstream: Reader,\n\tproducer: group.Producer,\n\tframe: WirePayload,\n\tinflated?: number,\n): Promise<boolean> {\n\tconst timestamp = received(frame.timestamp, producer.start);\n\tif (frame.payload) {\n\t\thooks.writeGroupFrame(producer, { payload: frame.payload, timestamp }, inflated);\n\t\treturn true;\n\t}\n\tconst open = producer.createFrame({ size: frame.size, timestamp });\n\twhile (open.remaining > 0) {\n\t\tconst chunk = await race([stream.readChunk(Math.min(open.remaining, SEGMENT_BYTES)), producer.closed]);\n\t\tif (!(chunk instanceof Uint8Array)) return false;\n\t\topen.write(chunk);\n\t}\n\topen.finish();\n\treturn true;\n}\n\n/** Read past a `size`-byte payload left on the stream, keeping none of it. */\nexport async function skipPayload(stream: Reader, size: number): Promise<void> {\n\tfor (let left = size; left > 0; ) left -= (await stream.readChunk(Math.min(left, SEGMENT_BYTES))).byteLength;\n}\n\n/** The payload size of a frame read for egress. */\nexport function readSize(read: ReadGroupFrame): number {\n\treturn read.chunks?.size ?? read.frame.payload.byteLength;\n}\n\n/** Write a streamed payload with `write` as it arrives. Throws if `closed` settles first, since the stream can take no more. */\nexport async function sendPayload(\n\tchunks: frame.Consumer,\n\twrite: (chunk: Uint8Array) => Promise<unknown>,\n\tclosed: Promise<void>,\n): Promise<void> {\n\tfor (let sent = 0; ; ) {\n\t\tconst chunk = await hooks.readFrameChunk(chunks, closed);\n\t\tif (!(chunk instanceof Uint8Array)) {\n\t\t\tif (sent < chunks.size) throw new Error(\"stream closed mid-frame\");\n\t\t\treturn;\n\t\t}\n\t\tsent += chunk.byteLength;\n\t\tawait write(chunk);\n\t}\n}\n"]}
|
package/prefix.d.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grant prefixes and a path segment's escaping.
|
|
3
|
+
*
|
|
4
|
+
* A grant is a {@link Prefixes} set: each {@link Prefix} covers a path and everything beneath
|
|
5
|
+
* it, the empty prefix covering every path. A grant never holds a wildcard: parsing one fails
|
|
6
|
+
* loudly with an {@link InvalidPrefix} of code `wildcard`. The Rust twin is `moq_net::path`.
|
|
7
|
+
*
|
|
8
|
+
* A separate entrypoint (`@moq/net/prefix`) so a token minting service reads grants without
|
|
9
|
+
* loading the wire stack.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The segments of `path`, split only at a `/` no `\` escapes and still escaped as written.
|
|
15
|
+
*
|
|
16
|
+
* The empty path has none. Anything else yields one more segment than it has separators,
|
|
17
|
+
* empty ones included, so a caller that requires non-empty segments checks them itself.
|
|
18
|
+
* With `limit`, stops after that many segments.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* parts("room/a\\/b/cam"); // ["room", "a\\/b", "cam"]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function parts(path: string, limit?: number): string[];
|
|
26
|
+
/**
|
|
27
|
+
* A segment's content: each escaped `\` or `/` as the character itself.
|
|
28
|
+
*
|
|
29
|
+
* Expects a segment as {@link parts} yields it from a valid path, where every `\` escapes
|
|
30
|
+
* the character after it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function unescape(segment: string): string;
|
|
33
|
+
/** The segment holding `content`: each `\` or `/` escaped by a `\`. The inverse of {@link unescape}. */
|
|
34
|
+
export declare function escape(content: string): string;
|
|
35
|
+
/** Thrown when a grant member is not a valid {@link Prefix}. */
|
|
36
|
+
export declare class InvalidPrefix extends Error {
|
|
37
|
+
/** Which rule was broken. */
|
|
38
|
+
readonly code: InvalidPrefix.Code;
|
|
39
|
+
/** Create an error with the broken rule in `code` and a human-readable `message`. */
|
|
40
|
+
constructor(code: InvalidPrefix.Code, message: string, options?: ErrorOptions);
|
|
41
|
+
}
|
|
42
|
+
/** Types for {@link InvalidPrefix}. */
|
|
43
|
+
export declare namespace InvalidPrefix {
|
|
44
|
+
/** Why a string is not a valid {@link Prefix}. */
|
|
45
|
+
type Code =
|
|
46
|
+
/** It holds a `*`: a grant is a prefix, never a wildcard. */
|
|
47
|
+
"wildcard"
|
|
48
|
+
/** It is not a valid path: an empty segment, a bad escape, or too many segments. */
|
|
49
|
+
| "path";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* One grant member: a path covering itself and every path beneath it. The empty prefix
|
|
53
|
+
* covers every path.
|
|
54
|
+
*
|
|
55
|
+
* A prefix is never a wildcard: `foo` covers `foo` and its subtree, so a grant writes `foo`
|
|
56
|
+
* where releases before 0.22 wrote `foo/**`, and the empty prefix where they wrote `**`.
|
|
57
|
+
* Build one with {@link Prefix.parse} or {@link Prefix.all}.
|
|
58
|
+
*
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export declare class Prefix {
|
|
62
|
+
/** The canonical text: segments joined by `/`, escapes as written. */
|
|
63
|
+
readonly text: string;
|
|
64
|
+
/** The segments, still escaped as written. */
|
|
65
|
+
readonly segments: readonly string[];
|
|
66
|
+
private constructor();
|
|
67
|
+
/**
|
|
68
|
+
* Parse a grant member. Throws {@link InvalidPrefix}: `wildcard` for any `*`, and `path`
|
|
69
|
+
* for a leading, trailing, or doubled `/`, a `\` that escapes neither `\` nor `/`, or more
|
|
70
|
+
* than 32 segments.
|
|
71
|
+
*/
|
|
72
|
+
static parse(text: string): Prefix;
|
|
73
|
+
/** The empty prefix, which covers every path. */
|
|
74
|
+
static all(): Prefix;
|
|
75
|
+
/** Order two prefixes segment by segment, so a prefix sorts right before everything beneath it. */
|
|
76
|
+
static compare(a: Prefix, b: Prefix): number;
|
|
77
|
+
/** The canonical text. */
|
|
78
|
+
toString(): string;
|
|
79
|
+
/** Serializes as the canonical text, matching the Rust crate's serde form. */
|
|
80
|
+
toJSON(): string;
|
|
81
|
+
/** Whether the two are the same prefix. */
|
|
82
|
+
equals(other: Prefix): boolean;
|
|
83
|
+
/** Whether this is the empty prefix, covering every path. */
|
|
84
|
+
get isEmpty(): boolean;
|
|
85
|
+
/** Whether `path`, normalized like a broadcast path, is this prefix or beneath it. */
|
|
86
|
+
matches(path: string): boolean;
|
|
87
|
+
/** Whether `path`, normalized like a broadcast path, and this prefix share a path: one lies beneath the other. */
|
|
88
|
+
overlaps(path: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* This prefix placed beneath the path `root`, normalized like a broadcast path (slashes
|
|
91
|
+
* trimmed and collapsed). Throws {@link InvalidPrefix} when `root` holds a wildcard or a
|
|
92
|
+
* malformed escape, or the result has more than 32 segments.
|
|
93
|
+
*/
|
|
94
|
+
rooted(root: string): Prefix;
|
|
95
|
+
/**
|
|
96
|
+
* This prefix as seen from the path `root`, normalized like a broadcast path: the rest
|
|
97
|
+
* beneath it, or the empty prefix when this one covers `root` already. Undefined when the
|
|
98
|
+
* two share no path.
|
|
99
|
+
*/
|
|
100
|
+
rebase(root: string): Prefix | undefined;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A grant: a set of {@link Prefix}es, reduced so no member lies beneath another, and sorted
|
|
104
|
+
* segment by segment, so two sets covering the same paths are {@link Prefixes.equals | equal}.
|
|
105
|
+
* The empty set grants nothing.
|
|
106
|
+
*
|
|
107
|
+
* Every operation is near-linear in the members on every shape: a prefix's ancestors sort
|
|
108
|
+
* right before it, so finding the member covering a path is one binary search.
|
|
109
|
+
*
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export declare class Prefixes implements Iterable<Prefix> {
|
|
113
|
+
#private;
|
|
114
|
+
/** The reduced set of the given prefixes. Empty when none are given. */
|
|
115
|
+
constructor(prefixes?: Iterable<Prefix>);
|
|
116
|
+
/** The set holding the empty prefix, which covers every path. */
|
|
117
|
+
static all(): Prefixes;
|
|
118
|
+
/** Parse each text as a {@link Prefix} into one set. Throws {@link InvalidPrefix}. */
|
|
119
|
+
static parse(texts: Iterable<string>): Prefixes;
|
|
120
|
+
/**
|
|
121
|
+
* Add a prefix, dropping the members beneath it.
|
|
122
|
+
*
|
|
123
|
+
* Returns false when a member already covers it, leaving the set unchanged.
|
|
124
|
+
*/
|
|
125
|
+
insert(prefix: Prefix): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether some member covers `path`, normalized like a broadcast path. A member covering a
|
|
128
|
+
* path covers its whole subtree, so this also says whether the set grants everything beneath it.
|
|
129
|
+
*/
|
|
130
|
+
matches(path: string): boolean;
|
|
131
|
+
/** Whether some member lies at, above, or beneath `path`, normalized like a broadcast path. */
|
|
132
|
+
overlaps(path: string): boolean;
|
|
133
|
+
/** Whether every member of `other` is covered here: `other` grants nothing this set does not. */
|
|
134
|
+
covers(other: Prefixes): boolean;
|
|
135
|
+
/** The paths in both sets: each member of one that the other covers. */
|
|
136
|
+
intersect(other: Prefixes): Prefixes;
|
|
137
|
+
/** What this set covers beneath `root`, named relative to it. See {@link Prefix.rebase}. */
|
|
138
|
+
rebase(root: string): Prefixes;
|
|
139
|
+
/** Every member placed beneath `root`. See {@link Prefix.rooted}. */
|
|
140
|
+
rooted(root: string): Prefixes;
|
|
141
|
+
/** The number of members. */
|
|
142
|
+
get size(): number;
|
|
143
|
+
/** The members, in canonical order. */
|
|
144
|
+
[Symbol.iterator](): Iterator<Prefix>;
|
|
145
|
+
/** The members as a fresh array, in canonical order. */
|
|
146
|
+
toArray(): Prefix[];
|
|
147
|
+
/** Serializes as a list of texts, matching the Rust crate's serde form. */
|
|
148
|
+
toJSON(): string[];
|
|
149
|
+
/** Whether the two sets cover the same paths. */
|
|
150
|
+
equals(other: Prefixes): boolean;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=prefix.d.ts.map
|
package/prefix.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefix.d.ts","sourceRoot":"","sources":["../src/prefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,IAA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