reactor-effect-client 0.7.0 → 0.8.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/NOTICE +7 -2
- package/README.md +103 -141
- package/dist/Coordinator.d.ts +382 -0
- package/dist/Coordinator.d.ts.map +1 -0
- package/dist/Coordinator.js +732 -0
- package/dist/Coordinator.js.map +1 -0
- package/dist/H3.d.ts +159 -0
- package/dist/H3.d.ts.map +1 -0
- package/dist/H3.js +21 -0
- package/dist/H3.js.map +1 -0
- package/dist/H3Source.d.ts +93 -0
- package/dist/H3Source.d.ts.map +1 -0
- package/dist/H3Source.js +401 -0
- package/dist/H3Source.js.map +1 -0
- package/dist/LocalSource.d.ts +68 -0
- package/dist/LocalSource.d.ts.map +1 -0
- package/dist/LocalSource.js +354 -0
- package/dist/LocalSource.js.map +1 -0
- package/dist/Media.d.ts +106 -0
- package/dist/Media.d.ts.map +1 -0
- package/dist/Media.js +16 -0
- package/dist/Media.js.map +1 -0
- package/dist/Peer.d.ts +134 -0
- package/dist/Peer.d.ts.map +1 -0
- package/dist/Peer.js +57 -0
- package/dist/Peer.js.map +1 -0
- package/dist/Playout.d.ts +724 -0
- package/dist/Playout.d.ts.map +1 -0
- package/dist/Playout.js +28 -0
- package/dist/Playout.js.map +1 -0
- package/dist/Reactor.d.ts +135 -0
- package/dist/Reactor.d.ts.map +1 -0
- package/dist/Reactor.js +158 -0
- package/dist/Reactor.js.map +1 -0
- package/dist/ReactorError.d.ts +331 -0
- package/dist/ReactorError.d.ts.map +1 -0
- package/dist/ReactorError.js +316 -0
- package/dist/ReactorError.js.map +1 -0
- package/dist/ReactorTest.d.ts +383 -0
- package/dist/ReactorTest.d.ts.map +1 -0
- package/dist/ReactorTest.js +317 -0
- package/dist/ReactorTest.js.map +1 -0
- package/dist/Session.d.ts +314 -0
- package/dist/Session.d.ts.map +1 -0
- package/dist/Session.js +51 -0
- package/dist/Session.js.map +1 -0
- package/dist/index.d.ts +12 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/correlator.d.ts +46 -0
- package/dist/internal/correlator.d.ts.map +1 -0
- package/dist/internal/correlator.js +150 -0
- package/dist/internal/correlator.js.map +1 -0
- package/dist/internal/deadline.d.ts +24 -0
- package/dist/internal/deadline.d.ts.map +1 -0
- package/dist/internal/deadline.js +44 -0
- package/dist/internal/deadline.js.map +1 -0
- package/dist/{h3/_internal/contracts.d.ts → internal/h3/commands.d.ts} +39 -33
- package/dist/internal/h3/commands.d.ts.map +1 -0
- package/dist/internal/h3/commands.js +128 -0
- package/dist/internal/h3/commands.js.map +1 -0
- package/dist/{h3 → internal/h3}/messages.d.ts +16 -11
- package/dist/internal/h3/messages.d.ts.map +1 -0
- package/dist/{h3 → internal/h3}/messages.js +19 -31
- package/dist/internal/h3/messages.js.map +1 -0
- package/dist/internal/h3/operations.d.ts +145 -0
- package/dist/internal/h3/operations.d.ts.map +1 -0
- package/dist/internal/h3/operations.js +284 -0
- package/dist/internal/h3/operations.js.map +1 -0
- package/dist/{h3 → internal/h3}/profile.d.ts +63 -65
- package/dist/internal/h3/profile.d.ts.map +1 -0
- package/dist/{h3 → internal/h3}/profile.js +39 -39
- package/dist/internal/h3/profile.js.map +1 -0
- package/dist/internal/h3/provider.d.ts +14 -0
- package/dist/internal/h3/provider.d.ts.map +1 -0
- package/dist/internal/h3/provider.js +672 -0
- package/dist/internal/h3/provider.js.map +1 -0
- package/dist/internal/h3/references.d.ts +68 -0
- package/dist/internal/h3/references.d.ts.map +1 -0
- package/dist/internal/h3/references.js +339 -0
- package/dist/internal/h3/references.js.map +1 -0
- package/dist/internal/h3/request.d.ts +56 -0
- package/dist/internal/h3/request.d.ts.map +1 -0
- package/dist/internal/h3/request.js +70 -0
- package/dist/internal/h3/request.js.map +1 -0
- package/dist/internal/h3/state.d.ts +120 -0
- package/dist/internal/h3/state.d.ts.map +1 -0
- package/dist/internal/h3/state.js +270 -0
- package/dist/internal/h3/state.js.map +1 -0
- package/dist/{Submission.d.ts → internal/h3/submission.d.ts} +1 -3
- package/dist/internal/h3/submission.d.ts.map +1 -0
- package/dist/{Submission.js → internal/h3/submission.js} +1 -9
- package/dist/internal/h3/submission.js.map +1 -0
- package/dist/internal/hub.d.ts +32 -0
- package/dist/internal/hub.d.ts.map +1 -0
- package/dist/internal/hub.js +92 -0
- package/dist/internal/hub.js.map +1 -0
- package/dist/internal/playout/errors.d.ts +51 -0
- package/dist/internal/playout/errors.d.ts.map +1 -0
- package/dist/internal/playout/errors.js +40 -0
- package/dist/internal/playout/errors.js.map +1 -0
- package/dist/internal/playout/policy.d.ts +559 -0
- package/dist/internal/playout/policy.d.ts.map +1 -0
- package/dist/internal/playout/policy.js +2338 -0
- package/dist/internal/playout/policy.js.map +1 -0
- package/dist/internal/playout/runtime.d.ts +28 -0
- package/dist/internal/playout/runtime.d.ts.map +1 -0
- package/dist/internal/playout/runtime.js +766 -0
- package/dist/internal/playout/runtime.js.map +1 -0
- package/dist/internal/playout/tag.d.ts +14 -0
- package/dist/internal/playout/tag.d.ts.map +1 -0
- package/dist/internal/playout/tag.js +43 -0
- package/dist/internal/playout/tag.js.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/common_pb.d.ts +55 -0
- package/dist/internal/proto/reactor_wire/v1/common_pb.d.ts.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/common_pb.js +42 -0
- package/dist/internal/proto/reactor_wire/v1/common_pb.js.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/control_pb.d.ts +160 -0
- package/dist/internal/proto/reactor_wire/v1/control_pb.d.ts.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/control_pb.js +21 -0
- package/dist/internal/proto/reactor_wire/v1/control_pb.js.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/data_pb.d.ts +89 -0
- package/dist/internal/proto/reactor_wire/v1/data_pb.d.ts.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/data_pb.js +20 -0
- package/dist/internal/proto/reactor_wire/v1/data_pb.js.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/model_pb.d.ts +85 -0
- package/dist/internal/proto/reactor_wire/v1/model_pb.d.ts.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/model_pb.js +24 -0
- package/dist/internal/proto/reactor_wire/v1/model_pb.js.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/platform_pb.d.ts +190 -0
- package/dist/internal/proto/reactor_wire/v1/platform_pb.d.ts.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/platform_pb.js +54 -0
- package/dist/internal/proto/reactor_wire/v1/platform_pb.js.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/track_pb.d.ts +88 -0
- package/dist/internal/proto/reactor_wire/v1/track_pb.d.ts.map +1 -0
- package/dist/internal/proto/reactor_wire/v1/track_pb.js +33 -0
- package/dist/internal/proto/reactor_wire/v1/track_pb.js.map +1 -0
- package/dist/internal/queue.d.ts +4 -0
- package/dist/internal/queue.d.ts.map +1 -0
- package/dist/{_internal → internal}/queue.js +0 -9
- package/dist/internal/queue.js.map +1 -0
- package/dist/internal/reactorTest/coordinator.d.ts +5 -0
- package/dist/internal/reactorTest/coordinator.d.ts.map +1 -0
- package/dist/internal/reactorTest/coordinator.js +178 -0
- package/dist/internal/reactorTest/coordinator.js.map +1 -0
- package/dist/internal/reactorTest/faults.d.ts +172 -0
- package/dist/internal/reactorTest/faults.d.ts.map +1 -0
- package/dist/internal/reactorTest/faults.js +23 -0
- package/dist/internal/reactorTest/faults.js.map +1 -0
- package/dist/internal/reactorTest/h3.d.ts +431 -0
- package/dist/internal/reactorTest/h3.d.ts.map +1 -0
- package/dist/internal/reactorTest/h3.js +625 -0
- package/dist/internal/reactorTest/h3.js.map +1 -0
- package/dist/internal/reactorTest/media.d.ts +22 -0
- package/dist/internal/reactorTest/media.d.ts.map +1 -0
- package/dist/internal/reactorTest/media.js +34 -0
- package/dist/internal/reactorTest/media.js.map +1 -0
- package/dist/internal/reactorTest/peer.d.ts +318 -0
- package/dist/internal/reactorTest/peer.d.ts.map +1 -0
- package/dist/internal/reactorTest/peer.js +206 -0
- package/dist/internal/reactorTest/peer.js.map +1 -0
- package/dist/internal/reactorTest/playout.d.ts +34 -0
- package/dist/internal/reactorTest/playout.d.ts.map +1 -0
- package/dist/internal/reactorTest/playout.js +340 -0
- package/dist/internal/reactorTest/playout.js.map +1 -0
- package/dist/internal/reactorTest/references.d.ts +25 -0
- package/dist/internal/reactorTest/references.d.ts.map +1 -0
- package/dist/{testing/Png.js → internal/reactorTest/references.js} +50 -12
- package/dist/internal/reactorTest/references.js.map +1 -0
- package/dist/internal/reactorTest/sessions.d.ts +364 -0
- package/dist/internal/reactorTest/sessions.d.ts.map +1 -0
- package/dist/internal/reactorTest/sessions.js +592 -0
- package/dist/internal/reactorTest/sessions.js.map +1 -0
- package/dist/internal/reactorTest/timing.d.ts +13 -0
- package/dist/internal/reactorTest/timing.d.ts.map +1 -0
- package/dist/internal/reactorTest/timing.js +20 -0
- package/dist/internal/reactorTest/timing.js.map +1 -0
- package/dist/internal/recording.d.ts +52 -0
- package/dist/internal/recording.d.ts.map +1 -0
- package/dist/internal/recording.js +141 -0
- package/dist/internal/recording.js.map +1 -0
- package/dist/internal/session/connect.d.ts +34 -0
- package/dist/internal/session/connect.d.ts.map +1 -0
- package/dist/internal/session/connect.js +502 -0
- package/dist/internal/session/connect.js.map +1 -0
- package/dist/internal/session/generation.d.ts +35 -0
- package/dist/internal/session/generation.d.ts.map +1 -0
- package/dist/internal/session/generation.js +185 -0
- package/dist/internal/session/generation.js.map +1 -0
- package/dist/internal/session/ice.d.ts +23 -0
- package/dist/internal/session/ice.d.ts.map +1 -0
- package/dist/internal/session/ice.js +57 -0
- package/dist/internal/session/ice.js.map +1 -0
- package/dist/internal/session/inbound.d.ts +50 -0
- package/dist/internal/session/inbound.d.ts.map +1 -0
- package/dist/internal/session/inbound.js +202 -0
- package/dist/internal/session/inbound.js.map +1 -0
- package/dist/internal/session/model.d.ts +163 -0
- package/dist/internal/session/model.d.ts.map +1 -0
- package/dist/internal/session/model.js +78 -0
- package/dist/internal/session/model.js.map +1 -0
- package/dist/internal/session/requests.d.ts +71 -0
- package/dist/internal/session/requests.d.ts.map +1 -0
- package/dist/internal/session/requests.js +240 -0
- package/dist/internal/session/requests.js.map +1 -0
- package/dist/internal/session/tracks.d.ts +21 -0
- package/dist/internal/session/tracks.d.ts.map +1 -0
- package/dist/internal/session/tracks.js +166 -0
- package/dist/internal/session/tracks.js.map +1 -0
- package/dist/internal/session/upload.d.ts +21 -0
- package/dist/internal/session/upload.d.ts.map +1 -0
- package/dist/internal/session/upload.js +68 -0
- package/dist/internal/session/upload.js.map +1 -0
- package/dist/internal/session.d.ts +66 -0
- package/dist/internal/session.d.ts.map +1 -0
- package/dist/internal/session.js +280 -0
- package/dist/internal/session.js.map +1 -0
- package/dist/{stats.d.ts → internal/stats.d.ts} +30 -16
- package/dist/internal/stats.d.ts.map +1 -0
- package/dist/internal/stats.js +201 -0
- package/dist/internal/stats.js.map +1 -0
- package/dist/internal/token.d.ts +22 -0
- package/dist/internal/token.d.ts.map +1 -0
- package/dist/internal/token.js +65 -0
- package/dist/internal/token.js.map +1 -0
- package/dist/internal/wire.d.ts +37 -0
- package/dist/internal/wire.d.ts.map +1 -0
- package/dist/internal/wire.js +49 -0
- package/dist/internal/wire.js.map +1 -0
- package/notices/bufbuild-protobuf-LICENSE +201 -0
- package/package.json +17 -38
- package/dist/FetchHttp.d.ts +0 -9
- package/dist/FetchHttp.d.ts.map +0 -1
- package/dist/FetchHttp.js +0 -63
- package/dist/FetchHttp.js.map +0 -1
- package/dist/PeerFactory.d.ts +0 -26
- package/dist/PeerFactory.d.ts.map +0 -1
- package/dist/PeerFactory.js +0 -4
- package/dist/PeerFactory.js.map +0 -1
- package/dist/PeerTypes.d.ts +0 -64
- package/dist/PeerTypes.d.ts.map +0 -1
- package/dist/PeerTypes.js +0 -2
- package/dist/PeerTypes.js.map +0 -1
- package/dist/Sequence.d.ts +0 -85
- package/dist/Sequence.d.ts.map +0 -1
- package/dist/Sequence.js +0 -210
- package/dist/Sequence.js.map +0 -1
- package/dist/SessionTypes.d.ts +0 -312
- package/dist/SessionTypes.d.ts.map +0 -1
- package/dist/SessionTypes.js +0 -19
- package/dist/SessionTypes.js.map +0 -1
- package/dist/Submission.d.ts.map +0 -1
- package/dist/Submission.js.map +0 -1
- package/dist/_internal/queue.d.ts +0 -6
- package/dist/_internal/queue.d.ts.map +0 -1
- package/dist/_internal/queue.js.map +0 -1
- package/dist/bytes.d.ts +0 -6
- package/dist/bytes.d.ts.map +0 -1
- package/dist/bytes.js +0 -32
- package/dist/bytes.js.map +0 -1
- package/dist/contract.d.ts +0 -149
- package/dist/contract.d.ts.map +0 -1
- package/dist/contract.js +0 -119
- package/dist/contract.js.map +0 -1
- package/dist/coordinator/_internal/client.d.ts +0 -215
- package/dist/coordinator/_internal/client.d.ts.map +0 -1
- package/dist/coordinator/_internal/client.js +0 -563
- package/dist/coordinator/_internal/client.js.map +0 -1
- package/dist/coordinator/_internal/recording.d.ts +0 -31
- package/dist/coordinator/_internal/recording.d.ts.map +0 -1
- package/dist/coordinator/_internal/recording.js +0 -123
- package/dist/coordinator/_internal/recording.js.map +0 -1
- package/dist/coordinator/_internal/response.d.ts +0 -15
- package/dist/coordinator/_internal/response.d.ts.map +0 -1
- package/dist/coordinator/_internal/response.js +0 -55
- package/dist/coordinator/_internal/response.js.map +0 -1
- package/dist/coordinator/_internal/schemas.d.ts +0 -73
- package/dist/coordinator/_internal/schemas.d.ts.map +0 -1
- package/dist/coordinator/_internal/schemas.js +0 -200
- package/dist/coordinator/_internal/schemas.js.map +0 -1
- package/dist/coordinator/index.d.ts +0 -40
- package/dist/coordinator/index.d.ts.map +0 -1
- package/dist/coordinator/index.js +0 -21
- package/dist/coordinator/index.js.map +0 -1
- package/dist/correlation.d.ts +0 -47
- package/dist/correlation.d.ts.map +0 -1
- package/dist/correlation.js +0 -131
- package/dist/correlation.js.map +0 -1
- package/dist/duration.d.ts +0 -27
- package/dist/duration.d.ts.map +0 -1
- package/dist/duration.js +0 -47
- package/dist/duration.js.map +0 -1
- package/dist/errors.d.ts +0 -1303
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -745
- package/dist/errors.js.map +0 -1
- package/dist/h3/_internal/client.d.ts +0 -9
- package/dist/h3/_internal/client.d.ts.map +0 -1
- package/dist/h3/_internal/client.js +0 -652
- package/dist/h3/_internal/client.js.map +0 -1
- package/dist/h3/_internal/contracts.d.ts.map +0 -1
- package/dist/h3/_internal/contracts.js +0 -123
- package/dist/h3/_internal/contracts.js.map +0 -1
- package/dist/h3/_internal/deployment.d.ts +0 -8
- package/dist/h3/_internal/deployment.d.ts.map +0 -1
- package/dist/h3/_internal/deployment.js +0 -149
- package/dist/h3/_internal/deployment.js.map +0 -1
- package/dist/h3/_internal/evidence.d.ts +0 -17
- package/dist/h3/_internal/evidence.d.ts.map +0 -1
- package/dist/h3/_internal/evidence.js +0 -48
- package/dist/h3/_internal/evidence.js.map +0 -1
- package/dist/h3/_internal/operations.d.ts +0 -58
- package/dist/h3/_internal/operations.d.ts.map +0 -1
- package/dist/h3/_internal/operations.js +0 -268
- package/dist/h3/_internal/operations.js.map +0 -1
- package/dist/h3/_internal/references.d.ts +0 -24
- package/dist/h3/_internal/references.d.ts.map +0 -1
- package/dist/h3/_internal/references.js +0 -309
- package/dist/h3/_internal/references.js.map +0 -1
- package/dist/h3/_internal/request.d.ts +0 -21
- package/dist/h3/_internal/request.d.ts.map +0 -1
- package/dist/h3/_internal/request.js +0 -97
- package/dist/h3/_internal/request.js.map +0 -1
- package/dist/h3/_internal/retained.d.ts +0 -22
- package/dist/h3/_internal/retained.d.ts.map +0 -1
- package/dist/h3/_internal/retained.js +0 -89
- package/dist/h3/_internal/retained.js.map +0 -1
- package/dist/h3/_internal/state.d.ts +0 -44
- package/dist/h3/_internal/state.d.ts.map +0 -1
- package/dist/h3/_internal/state.js +0 -283
- package/dist/h3/_internal/state.js.map +0 -1
- package/dist/h3/index.d.ts +0 -10
- package/dist/h3/index.d.ts.map +0 -1
- package/dist/h3/index.js +0 -7
- package/dist/h3/index.js.map +0 -1
- package/dist/h3/messages.d.ts.map +0 -1
- package/dist/h3/messages.js.map +0 -1
- package/dist/h3/profile.d.ts.map +0 -1
- package/dist/h3/profile.js.map +0 -1
- package/dist/h3/types.d.ts +0 -291
- package/dist/h3/types.d.ts.map +0 -1
- package/dist/h3/types.js +0 -2
- package/dist/h3/types.js.map +0 -1
- package/dist/host.d.ts +0 -26
- package/dist/host.d.ts.map +0 -1
- package/dist/host.js +0 -20
- package/dist/host.js.map +0 -1
- package/dist/json.d.ts +0 -25
- package/dist/json.d.ts.map +0 -1
- package/dist/json.js +0 -143
- package/dist/json.js.map +0 -1
- package/dist/media-stream.d.ts +0 -10
- package/dist/media-stream.d.ts.map +0 -1
- package/dist/media-stream.js +0 -18
- package/dist/media-stream.js.map +0 -1
- package/dist/observation.d.ts +0 -38
- package/dist/observation.d.ts.map +0 -1
- package/dist/observation.js +0 -113
- package/dist/observation.js.map +0 -1
- package/dist/orchestration/elapsed.d.ts +0 -9
- package/dist/orchestration/elapsed.d.ts.map +0 -1
- package/dist/orchestration/elapsed.js +0 -8
- package/dist/orchestration/elapsed.js.map +0 -1
- package/dist/orchestration/h3-source.d.ts +0 -58
- package/dist/orchestration/h3-source.d.ts.map +0 -1
- package/dist/orchestration/h3-source.js +0 -362
- package/dist/orchestration/h3-source.js.map +0 -1
- package/dist/orchestration/index.d.ts +0 -17
- package/dist/orchestration/index.d.ts.map +0 -1
- package/dist/orchestration/index.js +0 -12
- package/dist/orchestration/index.js.map +0 -1
- package/dist/orchestration/media-buffer.d.ts +0 -32
- package/dist/orchestration/media-buffer.d.ts.map +0 -1
- package/dist/orchestration/media-buffer.js +0 -94
- package/dist/orchestration/media-buffer.js.map +0 -1
- package/dist/orchestration/open-h3.d.ts +0 -101
- package/dist/orchestration/open-h3.d.ts.map +0 -1
- package/dist/orchestration/open-h3.js +0 -127
- package/dist/orchestration/open-h3.js.map +0 -1
- package/dist/orchestration/queries.d.ts +0 -10
- package/dist/orchestration/queries.d.ts.map +0 -1
- package/dist/orchestration/queries.js +0 -43
- package/dist/orchestration/queries.js.map +0 -1
- package/dist/orchestration/references.d.ts +0 -18
- package/dist/orchestration/references.d.ts.map +0 -1
- package/dist/orchestration/references.js +0 -79
- package/dist/orchestration/references.js.map +0 -1
- package/dist/orchestration/renewal-state.d.ts +0 -84
- package/dist/orchestration/renewal-state.d.ts.map +0 -1
- package/dist/orchestration/renewal-state.js +0 -95
- package/dist/orchestration/renewal-state.js.map +0 -1
- package/dist/orchestration/renewal.d.ts +0 -103
- package/dist/orchestration/renewal.d.ts.map +0 -1
- package/dist/orchestration/renewal.js +0 -1088
- package/dist/orchestration/renewal.js.map +0 -1
- package/dist/orchestration/request.d.ts +0 -65
- package/dist/orchestration/request.d.ts.map +0 -1
- package/dist/orchestration/request.js +0 -134
- package/dist/orchestration/request.js.map +0 -1
- package/dist/orchestration/retention.d.ts +0 -100
- package/dist/orchestration/retention.d.ts.map +0 -1
- package/dist/orchestration/retention.js +0 -134
- package/dist/orchestration/retention.js.map +0 -1
- package/dist/orchestration/routing.d.ts +0 -21
- package/dist/orchestration/routing.d.ts.map +0 -1
- package/dist/orchestration/routing.js +0 -93
- package/dist/orchestration/routing.js.map +0 -1
- package/dist/orchestration/scheduler-key.d.ts +0 -14
- package/dist/orchestration/scheduler-key.d.ts.map +0 -1
- package/dist/orchestration/scheduler-key.js +0 -62
- package/dist/orchestration/scheduler-key.js.map +0 -1
- package/dist/orchestration/scheduler-policy.d.ts +0 -222
- package/dist/orchestration/scheduler-policy.d.ts.map +0 -1
- package/dist/orchestration/scheduler-policy.js +0 -582
- package/dist/orchestration/scheduler-policy.js.map +0 -1
- package/dist/orchestration/scheduler.d.ts +0 -383
- package/dist/orchestration/scheduler.d.ts.map +0 -1
- package/dist/orchestration/scheduler.js +0 -2597
- package/dist/orchestration/scheduler.js.map +0 -1
- package/dist/orchestration/source-slot.d.ts +0 -124
- package/dist/orchestration/source-slot.d.ts.map +0 -1
- package/dist/orchestration/source-slot.js +0 -348
- package/dist/orchestration/source-slot.js.map +0 -1
- package/dist/orchestration/types.d.ts +0 -1462
- package/dist/orchestration/types.d.ts.map +0 -1
- package/dist/orchestration/types.js +0 -135
- package/dist/orchestration/types.js.map +0 -1
- package/dist/protobuf.d.ts +0 -63
- package/dist/protobuf.d.ts.map +0 -1
- package/dist/protobuf.js +0 -252
- package/dist/protobuf.js.map +0 -1
- package/dist/session/_internal/acquire.d.ts +0 -21
- package/dist/session/_internal/acquire.d.ts.map +0 -1
- package/dist/session/_internal/acquire.js +0 -168
- package/dist/session/_internal/acquire.js.map +0 -1
- package/dist/session/_internal/cleanup.d.ts +0 -19
- package/dist/session/_internal/cleanup.d.ts.map +0 -1
- package/dist/session/_internal/cleanup.js +0 -102
- package/dist/session/_internal/cleanup.js.map +0 -1
- package/dist/session/_internal/lifecycle.d.ts +0 -67
- package/dist/session/_internal/lifecycle.d.ts.map +0 -1
- package/dist/session/_internal/lifecycle.js +0 -142
- package/dist/session/_internal/lifecycle.js.map +0 -1
- package/dist/session/_internal/remote.d.ts +0 -28
- package/dist/session/_internal/remote.d.ts.map +0 -1
- package/dist/session/_internal/remote.js +0 -71
- package/dist/session/_internal/remote.js.map +0 -1
- package/dist/session/_internal/uploads.d.ts +0 -7
- package/dist/session/_internal/uploads.d.ts.map +0 -1
- package/dist/session/_internal/uploads.js +0 -31
- package/dist/session/_internal/uploads.js.map +0 -1
- package/dist/session/commands.d.ts +0 -2
- package/dist/session/commands.d.ts.map +0 -1
- package/dist/session/commands.js +0 -2
- package/dist/session/commands.js.map +0 -1
- package/dist/session/files.d.ts +0 -21
- package/dist/session/files.d.ts.map +0 -1
- package/dist/session/files.js +0 -49
- package/dist/session/files.js.map +0 -1
- package/dist/session/index.d.ts +0 -84
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js +0 -16
- package/dist/session/index.js.map +0 -1
- package/dist/session/media.d.ts +0 -114
- package/dist/session/media.d.ts.map +0 -1
- package/dist/session/media.js +0 -2
- package/dist/session/media.js.map +0 -1
- package/dist/session/recorder.d.ts +0 -24
- package/dist/session/recorder.d.ts.map +0 -1
- package/dist/session/recorder.js +0 -19
- package/dist/session/recorder.js.map +0 -1
- package/dist/session.d.ts +0 -105
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -976
- package/dist/session.js.map +0 -1
- package/dist/simulation/_internal/source.d.ts +0 -12
- package/dist/simulation/_internal/source.d.ts.map +0 -1
- package/dist/simulation/_internal/source.js +0 -513
- package/dist/simulation/_internal/source.js.map +0 -1
- package/dist/simulation/index.d.ts +0 -13
- package/dist/simulation/index.d.ts.map +0 -1
- package/dist/simulation/index.js +0 -12
- package/dist/simulation/index.js.map +0 -1
- package/dist/simulation/types.d.ts +0 -39
- package/dist/simulation/types.d.ts.map +0 -1
- package/dist/simulation/types.js +0 -2
- package/dist/simulation/types.js.map +0 -1
- package/dist/stats.d.ts.map +0 -1
- package/dist/stats.js +0 -205
- package/dist/stats.js.map +0 -1
- package/dist/testing/Faults.d.ts +0 -4
- package/dist/testing/Faults.d.ts.map +0 -1
- package/dist/testing/Faults.js +0 -7
- package/dist/testing/Faults.js.map +0 -1
- package/dist/testing/Png.d.ts +0 -3
- package/dist/testing/Png.d.ts.map +0 -1
- package/dist/testing/Png.js.map +0 -1
- package/dist/testing/Wav.d.ts +0 -14
- package/dist/testing/Wav.d.ts.map +0 -1
- package/dist/testing/Wav.js +0 -37
- package/dist/testing/Wav.js.map +0 -1
- package/dist/testing/index.d.ts +0 -5
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -4
- package/dist/testing/index.js.map +0 -1
- package/dist/wire.d.ts +0 -7
- package/dist/wire.d.ts.map +0 -1
- package/dist/wire.generated.d.ts +0 -305
- package/dist/wire.generated.d.ts.map +0 -1
- package/dist/wire.generated.js +0 -1257
- package/dist/wire.generated.js.map +0 -1
- package/dist/wire.js +0 -5
- package/dist/wire.js.map +0 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a session and each of its connection generations hold, and the core
|
|
3
|
+
* the session's parts share. The parts are built from the core in
|
|
4
|
+
* `internal/session.ts`, one concern each.
|
|
5
|
+
*/
|
|
6
|
+
import * as Cause from "effect/Cause";
|
|
7
|
+
import type * as Deferred from "effect/Deferred";
|
|
8
|
+
import type * as Duration from "effect/Duration";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import type * as Queue from "effect/Queue";
|
|
11
|
+
import type * as Ref from "effect/Ref";
|
|
12
|
+
import type * as Schedule from "effect/Schedule";
|
|
13
|
+
import type * as Schema from "effect/Schema";
|
|
14
|
+
import type * as Scope from "effect/Scope";
|
|
15
|
+
import type * as SubscriptionRef from "effect/SubscriptionRef";
|
|
16
|
+
import type { MessageInitShape } from "@bufbuild/protobuf";
|
|
17
|
+
import type { Descriptor, IceCandidate, Mapping, Signaling } from "../../Coordinator.js";
|
|
18
|
+
import type { MediaTrack, Peer, PeerEvent } from "../../Peer.js";
|
|
19
|
+
import { type ContextInput, ReactorError } from "../../ReactorError.js";
|
|
20
|
+
import type { CloseReport, CommandReply, ControlMessage, EventPayload, ReadyState, SessionEvent, Status } from "../../Session.js";
|
|
21
|
+
import type * as Correlator from "../correlator.js";
|
|
22
|
+
import type * as Hub from "../hub.js";
|
|
23
|
+
import type * as Stats from "../stats.js";
|
|
24
|
+
import type * as Wire from "../wire.js";
|
|
25
|
+
export interface Settings {
|
|
26
|
+
readonly replyTimeout: Duration.Duration;
|
|
27
|
+
readonly uploadTimeout: Duration.Duration;
|
|
28
|
+
readonly connectTimeout: Duration.Duration;
|
|
29
|
+
/**
|
|
30
|
+
* A reconnect's deadline, the session's own counted from the drop that began it: Reactor ends a
|
|
31
|
+
* session 30 s after it loses its last connection.
|
|
32
|
+
*/
|
|
33
|
+
readonly reconnectTimeout: Duration.Duration;
|
|
34
|
+
/** When the session tries a dropped connection again; none leaves it dropped. */
|
|
35
|
+
readonly reconnect: Schedule.Schedule<unknown, ReactorError> | undefined;
|
|
36
|
+
readonly readyTimeout: Duration.Duration;
|
|
37
|
+
/** Infinite disables the heartbeat. */
|
|
38
|
+
readonly heartbeat: Duration.Duration;
|
|
39
|
+
readonly maxPending: number;
|
|
40
|
+
readonly maxUploadBytes: number;
|
|
41
|
+
/** Distinguishes this client's request ids from another's on a shared session. */
|
|
42
|
+
readonly namespace: string;
|
|
43
|
+
}
|
|
44
|
+
export type Intent = {
|
|
45
|
+
readonly _tag: "Create";
|
|
46
|
+
readonly model: {
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly version?: string | undefined;
|
|
49
|
+
};
|
|
50
|
+
readonly extraArgs?: Schema.Json | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
readonly _tag: "Attach";
|
|
53
|
+
readonly sessionId: string;
|
|
54
|
+
readonly connectionId?: number | undefined;
|
|
55
|
+
/** The attached session's remote lifetime is taken over: it is owned. */
|
|
56
|
+
readonly adopt: boolean;
|
|
57
|
+
};
|
|
58
|
+
export interface Known {
|
|
59
|
+
readonly ownership: "owned" | "attached";
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly descriptor?: Descriptor | undefined;
|
|
62
|
+
readonly connectionId?: number | undefined;
|
|
63
|
+
}
|
|
64
|
+
export type RemoteSession = {
|
|
65
|
+
readonly ownership: "allocating" | "unknown";
|
|
66
|
+
} | Known;
|
|
67
|
+
export declare const isKnown: (remote: RemoteSession | undefined) => remote is Known;
|
|
68
|
+
/** What one connection generation has learned and holds. */
|
|
69
|
+
export interface Link {
|
|
70
|
+
readonly failure?: ReactorError | undefined;
|
|
71
|
+
readonly peerConnected: boolean;
|
|
72
|
+
readonly controlOpen: boolean;
|
|
73
|
+
readonly dataOpen: boolean;
|
|
74
|
+
readonly ice: ReadonlyArray<IceCandidate>;
|
|
75
|
+
readonly iceBytes: number;
|
|
76
|
+
readonly iceDone: boolean;
|
|
77
|
+
readonly finalSent: boolean;
|
|
78
|
+
readonly connectionId?: number | undefined;
|
|
79
|
+
readonly mapping: ReadonlyArray<Mapping>;
|
|
80
|
+
readonly negotiated?: ReadyState["remote"] | undefined;
|
|
81
|
+
readonly paused: ReadonlySet<string>;
|
|
82
|
+
readonly claimed: ReadonlySet<string>;
|
|
83
|
+
readonly sending: ReadonlyMap<string, MediaTrack>;
|
|
84
|
+
/** Publication claims by request id, until their reply names the track. */
|
|
85
|
+
readonly claims: ReadonlyMap<string, string>;
|
|
86
|
+
readonly busy: ReadonlySet<string>;
|
|
87
|
+
}
|
|
88
|
+
export declare const newLink: Link;
|
|
89
|
+
/** One connection generation: its scope, peer, readiness and the events it applies in order. */
|
|
90
|
+
export interface Connection {
|
|
91
|
+
readonly generation: bigint;
|
|
92
|
+
readonly scope: Scope.Closeable;
|
|
93
|
+
readonly peer: Peer;
|
|
94
|
+
readonly ready: Deferred.Deferred<void, ReactorError>;
|
|
95
|
+
readonly failed: Deferred.Deferred<never, ReactorError>;
|
|
96
|
+
readonly events: Queue.Queue<PeerEvent>;
|
|
97
|
+
readonly iceWake: Queue.Queue<void>;
|
|
98
|
+
readonly link: Ref.Ref<Link>;
|
|
99
|
+
}
|
|
100
|
+
export interface State {
|
|
101
|
+
readonly status: Status;
|
|
102
|
+
/** Content moderation is ending the session: nothing reconnects it. */
|
|
103
|
+
readonly moderated: boolean;
|
|
104
|
+
/** A dropped connection is reconnected on its own: the session has a policy and was acquired. */
|
|
105
|
+
readonly reconnects: boolean;
|
|
106
|
+
/** The session is reconnecting on its own, from the drop until a connection is ready or it stops. */
|
|
107
|
+
readonly reconnecting: boolean;
|
|
108
|
+
readonly generation: bigint;
|
|
109
|
+
readonly remote: RemoteSession | undefined;
|
|
110
|
+
readonly connection: Connection | undefined;
|
|
111
|
+
readonly lastError: ReactorError | undefined;
|
|
112
|
+
readonly close: CloseReport | undefined;
|
|
113
|
+
readonly received: ReadonlySet<string>;
|
|
114
|
+
readonly bitrates: ReadonlyMap<string, number>;
|
|
115
|
+
readonly sampler: Stats.SamplerState;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The moves a session's status may make, but for the move to `ready`: only the negotiation makes
|
|
119
|
+
* that, in one step with its checks, so `transition` refuses it as illegal.
|
|
120
|
+
*/
|
|
121
|
+
export declare const transitions: Record<Status, ReadonlyArray<Status>>;
|
|
122
|
+
export declare const isClosing: (status: Status) => boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Whether no later attempt can reconnect the session after `error`: it ended, is gone, or speaks a
|
|
125
|
+
* protocol this client does not.
|
|
126
|
+
*/
|
|
127
|
+
export declare const ends: (error: ReactorError) => boolean;
|
|
128
|
+
/** Why nothing connects again a session that content moderation ended. */
|
|
129
|
+
export declare const moderationEnded: (context: ContextInput) => ReactorError;
|
|
130
|
+
/** A control message this client sends. */
|
|
131
|
+
export type ControlPayload = Exclude<MessageInitShape<typeof Wire.ControlClientMessageSchema>["payload"], {
|
|
132
|
+
readonly case: undefined;
|
|
133
|
+
} | undefined>;
|
|
134
|
+
/** What the session's parts share: its state, its event hub and its correlators. */
|
|
135
|
+
export interface Core {
|
|
136
|
+
readonly intent: Intent;
|
|
137
|
+
readonly settings: Settings;
|
|
138
|
+
readonly signaling: Signaling;
|
|
139
|
+
readonly state: SubscriptionRef.SubscriptionRef<State>;
|
|
140
|
+
/** The last event sequence number published. */
|
|
141
|
+
readonly sequence: Ref.Ref<bigint>;
|
|
142
|
+
readonly hub: Hub.Hub<SessionEvent>;
|
|
143
|
+
readonly data: Correlator.Correlator<CommandReply>;
|
|
144
|
+
readonly control: Correlator.Correlator<ControlMessage>;
|
|
145
|
+
/** Publishes an event on `generation`, the current one when omitted. */
|
|
146
|
+
readonly publish: (payload: EventPayload, generation?: bigint) => Effect.Effect<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Moves the session to `status` if it is not there yet, and says whether it is there: once the
|
|
149
|
+
* close has begun it refuses any other move. Any other illegal move is a defect.
|
|
150
|
+
*/
|
|
151
|
+
readonly transition: (status: Status) => Effect.Effect<boolean>;
|
|
152
|
+
}
|
|
153
|
+
/** The fallback of a `timeoutOrElse`: `operation`'s deadline passed. */
|
|
154
|
+
export declare const timedOut: (operation: string) => () => Effect.Effect<never, ReactorError, never>;
|
|
155
|
+
/** The typed failure in a cause, or `fallback`'s for a defect or an interruption. */
|
|
156
|
+
export declare const failureOr: (fallback: () => ReactorError) => (cause: Cause.Cause<ReactorError>) => ReactorError;
|
|
157
|
+
/** `set` with `value` in it. */
|
|
158
|
+
export declare const including: <A>(value: A) => (set: ReadonlySet<A>) => ReadonlySet<A>;
|
|
159
|
+
/** `set` without `value`. */
|
|
160
|
+
export declare const excluding: <A>(value: A) => (set: ReadonlySet<A>) => ReadonlySet<A>;
|
|
161
|
+
/** `map` without `key`. */
|
|
162
|
+
export declare const withoutKey: <K>(key: K) => <V>(map: ReadonlyMap<K, V>) => ReadonlyMap<K, V>;
|
|
163
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/internal/session/model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,KAAK,GAAG,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,KAA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AS,GACnB,CAAC,SAAS,CAAC,WACN,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CACX,CAAC;AAE5B,6BAA6B;AAC7B,eAAO,MAAM,SAAS,GACnB,CAAC,SAAS,CAAC,WACN,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAInC,CAAC;AAEJ,2BAA2B;AAC3B,eAAO,MAAM,UAAU,GACpB,CAAC,OAAO,CAAC,MACT,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAI5C,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a session and each of its connection generations hold, and the core
|
|
3
|
+
* the session's parts share. The parts are built from the core in
|
|
4
|
+
* `internal/session.ts`, one concern each.
|
|
5
|
+
*/
|
|
6
|
+
import * as Cause from "effect/Cause";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { ReactorError } from "../../ReactorError.js";
|
|
9
|
+
export const isKnown = (remote) => remote?.ownership === "owned" || remote?.ownership === "attached";
|
|
10
|
+
export const newLink = {
|
|
11
|
+
peerConnected: false,
|
|
12
|
+
controlOpen: false,
|
|
13
|
+
dataOpen: false,
|
|
14
|
+
ice: [],
|
|
15
|
+
iceBytes: 0,
|
|
16
|
+
iceDone: false,
|
|
17
|
+
finalSent: false,
|
|
18
|
+
mapping: [],
|
|
19
|
+
paused: new Set(),
|
|
20
|
+
claimed: new Set(),
|
|
21
|
+
sending: new Map(),
|
|
22
|
+
claims: new Map(),
|
|
23
|
+
busy: new Set(),
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The moves a session's status may make, but for the move to `ready`: only the negotiation makes
|
|
27
|
+
* that, in one step with its checks, so `transition` refuses it as illegal.
|
|
28
|
+
*/
|
|
29
|
+
export const transitions = {
|
|
30
|
+
idle: ["connecting", "closing"],
|
|
31
|
+
connecting: ["waiting", "disconnected", "closing"],
|
|
32
|
+
waiting: ["disconnected", "closing"],
|
|
33
|
+
ready: ["connecting", "disconnected", "closing"],
|
|
34
|
+
disconnected: ["connecting", "closing"],
|
|
35
|
+
closing: ["closed"],
|
|
36
|
+
closed: [],
|
|
37
|
+
};
|
|
38
|
+
export const isClosing = (status) => status === "closing" || status === "closed";
|
|
39
|
+
/**
|
|
40
|
+
* Whether no later attempt can reconnect the session after `error`: it ended, is gone, or speaks a
|
|
41
|
+
* protocol this client does not.
|
|
42
|
+
*/
|
|
43
|
+
export const ends = (error) => {
|
|
44
|
+
switch (error.reason._tag) {
|
|
45
|
+
case "TerminalSession":
|
|
46
|
+
case "Moderated":
|
|
47
|
+
case "VersionMismatch":
|
|
48
|
+
return true;
|
|
49
|
+
case "Http":
|
|
50
|
+
return error.reason.status === 404;
|
|
51
|
+
default:
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/** Why nothing connects again a session that content moderation ended. */
|
|
56
|
+
export const moderationEnded = (context) => ReactorError.fromCode("Moderated", "content moderation ended the session", context);
|
|
57
|
+
/** The fallback of a `timeoutOrElse`: `operation`'s deadline passed. */
|
|
58
|
+
export const timedOut = (operation) => () => Effect.fail(ReactorError.fromCode("Timeout", `${operation}: deadline`));
|
|
59
|
+
/** The typed failure in a cause, or `fallback`'s for a defect or an interruption. */
|
|
60
|
+
export const failureOr = (fallback) => (cause) => {
|
|
61
|
+
const error = Cause.findError(cause);
|
|
62
|
+
return error._tag === "Success" ? error.success : fallback();
|
|
63
|
+
};
|
|
64
|
+
/** `set` with `value` in it. */
|
|
65
|
+
export const including = (value) => (set) => new Set(set).add(value);
|
|
66
|
+
/** `set` without `value`. */
|
|
67
|
+
export const excluding = (value) => (set) => {
|
|
68
|
+
const next = new Set(set);
|
|
69
|
+
next.delete(value);
|
|
70
|
+
return next;
|
|
71
|
+
};
|
|
72
|
+
/** `map` without `key`. */
|
|
73
|
+
export const withoutKey = (key) => (map) => {
|
|
74
|
+
const next = new Map(map);
|
|
75
|
+
next.delete(key);
|
|
76
|
+
return next;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/internal/session/model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAUxC,OAAO,EAAqB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAwDxE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAiC,EAAmB,EAAE,CAC5E,MAAM,EAAE,SAAS,KAAK,OAAO,IAAI,MAAM,EAAE,SAAS,KAAK,UAAU,CAAC;AAuBpE,MAAM,CAAC,MAAM,OAAO,GAAS;IAC3B,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,KAAK;IACf,GAAG,EAAE,EAAE;IACP,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,IAAI,GAAG,EAAE;IACjB,OAAO,EAAE,IAAI,GAAG,EAAE;IAClB,OAAO,EAAE,IAAI,GAAG,EAAE;IAClB,MAAM,EAAE,IAAI,GAAG,EAAE;IACjB,IAAI,EAAE,IAAI,GAAG,EAAE;CAChB,CAAC;AAgCF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAA0C;IAChE,IAAI,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;IAC/B,UAAU,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,SAAS,CAAC;IAClD,OAAO,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC;IACpC,KAAK,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,SAAS,CAAC;IAChD,YAAY,EAAE,CAAC,YAAY,EAAE,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CAAgC;AAChC,MAAM,CAAC,MAAM,SAAS,GACpB,CAAI,KAAQ,EAAE,EAAE,CAChB,CAAC,GAAmB,EAAkB,EAAE,CACtC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAE5B,6BAA6B;AAC7B,MAAM,CAAC,MAAM,SAAS,GACpB,CAAI,KAAQ,EAAE,EAAE,CAChB,CAAC,GAAmB,EAAkB,EAAE;IACtC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEJ,2BAA2B;AAC3B,MAAM,CAAC,MAAM,UAAU,GACrB,CAAI,GAAM,EAAE,EAAE,CACd,CAAI,GAAsB,EAAqB,EAAE;IAC/C,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Redacted from "effect/Redacted";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { CommandFailure, ReactorError } from "../../ReactorError.js";
|
|
5
|
+
import type { CommandOptions } from "../../Session.js";
|
|
6
|
+
import type { Generation } from "./generation.js";
|
|
7
|
+
import type { Connection, ControlPayload, Core } from "./model.js";
|
|
8
|
+
export declare const unexpected: (message: string) => ReactorError;
|
|
9
|
+
export declare const make: ({ core, generation, apiUrl, }: {
|
|
10
|
+
readonly core: Core;
|
|
11
|
+
readonly generation: Generation;
|
|
12
|
+
/** Where a clip's relative playlist URL resolves. */
|
|
13
|
+
readonly apiUrl: string;
|
|
14
|
+
}) => {
|
|
15
|
+
command: (name: string, input: unknown, options?: CommandOptions | undefined) => Effect.Effect<import("../../Session.js").CommandReply, CommandFailure, never>;
|
|
16
|
+
controlRequest: (operation: string, payload: ControlPayload, expected?: Connection | undefined) => Effect.Effect<{
|
|
17
|
+
readonly _tag: "ModelSchema";
|
|
18
|
+
readonly openapi?: {
|
|
19
|
+
readonly [x: string]: Schema.Json;
|
|
20
|
+
};
|
|
21
|
+
} | {
|
|
22
|
+
readonly _tag: "ClipReady";
|
|
23
|
+
readonly clip: {
|
|
24
|
+
readonly sessionId: string;
|
|
25
|
+
readonly kind: string;
|
|
26
|
+
readonly startMarker: number;
|
|
27
|
+
readonly endMarker: number;
|
|
28
|
+
readonly nowMarker: number;
|
|
29
|
+
readonly predictedReadyAtMs: bigint;
|
|
30
|
+
readonly playlistUrl: string;
|
|
31
|
+
};
|
|
32
|
+
} | {
|
|
33
|
+
readonly _tag: "ClipFailed";
|
|
34
|
+
readonly reason: Redacted.Redacted<string>;
|
|
35
|
+
} | {
|
|
36
|
+
readonly _tag: "TrackPublished";
|
|
37
|
+
readonly name: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly _tag: "Error";
|
|
40
|
+
readonly code: Redacted.Redacted<string>;
|
|
41
|
+
readonly message: Redacted.Redacted<string>;
|
|
42
|
+
}, ReactorError, never>;
|
|
43
|
+
notification: (c: Connection, payload: ControlPayload) => Effect.Effect<void, ReactorError, never>;
|
|
44
|
+
schema: Effect.Effect<{
|
|
45
|
+
openapi?: never;
|
|
46
|
+
} | {
|
|
47
|
+
openapi: {
|
|
48
|
+
readonly [x: string]: Schema.Json;
|
|
49
|
+
};
|
|
50
|
+
}, ReactorError, never>;
|
|
51
|
+
requestRecordingClip: (seconds: number) => Effect.Effect<{
|
|
52
|
+
readonly sessionId: string;
|
|
53
|
+
readonly kind: string;
|
|
54
|
+
readonly startMarker: number;
|
|
55
|
+
readonly endMarker: number;
|
|
56
|
+
readonly nowMarker: number;
|
|
57
|
+
readonly predictedReadyAtMs: bigint;
|
|
58
|
+
readonly playlistUrl: string;
|
|
59
|
+
}, ReactorError, never>;
|
|
60
|
+
recording: Effect.Effect<{
|
|
61
|
+
readonly sessionId: string;
|
|
62
|
+
readonly kind: string;
|
|
63
|
+
readonly startMarker: number;
|
|
64
|
+
readonly endMarker: number;
|
|
65
|
+
readonly nowMarker: number;
|
|
66
|
+
readonly predictedReadyAtMs: bigint;
|
|
67
|
+
readonly playlistUrl: string;
|
|
68
|
+
}, ReactorError, never>;
|
|
69
|
+
};
|
|
70
|
+
export type Requests = ReturnType<typeof make>;
|
|
71
|
+
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/internal/session/requests.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAU,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAa,cAAc,EAAmB,MAAM,kBAAkB,CAAC;AAInF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAQ,MAAM,YAAY,CAAC;AAoBzE,eAAO,MAAM,UAAU,YAAa,MAAM,iBACiC,CAAC;AAsC5E,eAAO,MAAM,IAAI,kCAId;IACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAmL0B,UAAU,WAAW,cAAc;;;;;;;;oCA0DrB,MAAM;;;;;;;;;;;;;;;;;;CAiB9C,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requests over the data and control channels. Each is registered with its
|
|
3
|
+
* correlator before it is sent and runs on its generation's scope, past its
|
|
4
|
+
* caller's wait, until its own outcome; a failure carries the dispatch
|
|
5
|
+
* evidence it established. A notification is sent with no reply to wait for.
|
|
6
|
+
*/
|
|
7
|
+
import * as Deferred from "effect/Deferred";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Exit from "effect/Exit";
|
|
10
|
+
import * as Fiber from "effect/Fiber";
|
|
11
|
+
import * as Redacted from "effect/Redacted";
|
|
12
|
+
import * as Ref from "effect/Ref";
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
import { CommandFailure, ReactorError, Remote } from "../../ReactorError.js";
|
|
15
|
+
import * as Deadline from "../deadline.js";
|
|
16
|
+
import * as Wire from "../wire.js";
|
|
17
|
+
import { timedOut, withoutKey } from "./model.js";
|
|
18
|
+
const UploadReference = Schema.Struct({
|
|
19
|
+
uploadId: Schema.NonEmptyString,
|
|
20
|
+
name: Schema.NonEmptyString,
|
|
21
|
+
mimeType: Schema.NonEmptyString,
|
|
22
|
+
size: Schema.BigInt.check(Schema.isGreaterThanOrEqualToBigInt(0n), Schema.isLessThanBigInt(1n << 63n)),
|
|
23
|
+
});
|
|
24
|
+
const CommandInput = Schema.Struct({
|
|
25
|
+
name: Schema.NonEmptyString,
|
|
26
|
+
data: Wire.StructJson,
|
|
27
|
+
uploads: Schema.ReadonlyMap(Schema.NonEmptyString, UploadReference).check(Schema.makeFilter((uploads) => uploads.size <= 128 || "at most 128 upload references")),
|
|
28
|
+
});
|
|
29
|
+
export const unexpected = (message) => ReactorError.fromCode("UnexpectedReply", message, { outcome: "replied" });
|
|
30
|
+
/** How a request's execution ended, as its span records it: identity and outcome only. */
|
|
31
|
+
const outcomeOf = (exit, submitted) => {
|
|
32
|
+
if (Exit.isSuccess(exit))
|
|
33
|
+
return { "reactor.command.outcome": "replied" };
|
|
34
|
+
const error = Exit.findError(exit);
|
|
35
|
+
if (error._tag === "Success")
|
|
36
|
+
return {
|
|
37
|
+
"reactor.command.outcome": error.success.context.outcome,
|
|
38
|
+
"error.type": error.success.reason._tag,
|
|
39
|
+
};
|
|
40
|
+
return { "reactor.command.outcome": submitted ? "unknown" : "not-submitted" };
|
|
41
|
+
};
|
|
42
|
+
/** A command's failure with the dispatch evidence it established. */
|
|
43
|
+
const commandFailure = (name) => (error) => {
|
|
44
|
+
const { outcome, requestId, generation } = error.context;
|
|
45
|
+
if ((outcome === "unknown" || outcome === "replied") &&
|
|
46
|
+
requestId !== undefined &&
|
|
47
|
+
generation !== undefined) {
|
|
48
|
+
const context = {
|
|
49
|
+
...error.context,
|
|
50
|
+
operation: name,
|
|
51
|
+
outcome,
|
|
52
|
+
requestId,
|
|
53
|
+
generation,
|
|
54
|
+
};
|
|
55
|
+
return CommandFailure.from(error, context);
|
|
56
|
+
}
|
|
57
|
+
return CommandFailure.from(error, {
|
|
58
|
+
...error.context,
|
|
59
|
+
operation: name,
|
|
60
|
+
outcome: "not-submitted",
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
export const make = ({ core, generation, apiUrl, }) => {
|
|
64
|
+
const { settings, data, control } = core;
|
|
65
|
+
const { current, currentReady, guard } = generation;
|
|
66
|
+
const request = (spec) => Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
|
|
67
|
+
const { c, correlator, operation, channel } = spec;
|
|
68
|
+
yield* current(c);
|
|
69
|
+
const pending = yield* correlator.register(c.generation, operation);
|
|
70
|
+
const forget = Effect.all([
|
|
71
|
+
correlator.cancel(pending),
|
|
72
|
+
Ref.update(c.link, (link) => ({
|
|
73
|
+
...link,
|
|
74
|
+
claims: withoutKey(pending.id)(link.claims),
|
|
75
|
+
})),
|
|
76
|
+
]);
|
|
77
|
+
const publication = spec.publication;
|
|
78
|
+
if (publication !== undefined)
|
|
79
|
+
yield* Ref.update(c.link, (link) => ({
|
|
80
|
+
...link,
|
|
81
|
+
claims: new Map(link.claims).set(pending.id, publication),
|
|
82
|
+
}));
|
|
83
|
+
const encoded = yield* Effect.result(spec.encode(pending.id));
|
|
84
|
+
if (encoded._tag === "Failure") {
|
|
85
|
+
yield* forget;
|
|
86
|
+
return yield* ReactorError.make({
|
|
87
|
+
reason: encoded.failure.reason,
|
|
88
|
+
context: {
|
|
89
|
+
...encoded.failure.context,
|
|
90
|
+
operation,
|
|
91
|
+
requestId: pending.id,
|
|
92
|
+
generation: c.generation,
|
|
93
|
+
outcome: "not-submitted",
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const attribute = (error) => correlator.isSubmitted(pending).pipe(Effect.map((submitted) => ReactorError.make({
|
|
98
|
+
reason: error.reason,
|
|
99
|
+
context: {
|
|
100
|
+
...error.context,
|
|
101
|
+
operation,
|
|
102
|
+
requestId: pending.id,
|
|
103
|
+
generation: c.generation,
|
|
104
|
+
outcome: error.context.outcome ?? (submitted ? "unknown" : "not-submitted"),
|
|
105
|
+
},
|
|
106
|
+
})));
|
|
107
|
+
const sending = current(c).pipe(
|
|
108
|
+
// The record exists before the peer could reply, however fast.
|
|
109
|
+
Effect.andThen(correlator.submitted(pending)), Effect.andThen(c.peer.send(channel, encoded.success)), Effect.catch((error) => Effect.gen(function* () {
|
|
110
|
+
if (!(yield* correlator.isPending(pending)))
|
|
111
|
+
return;
|
|
112
|
+
if (error.context.outcome === "not-submitted")
|
|
113
|
+
yield* forget;
|
|
114
|
+
yield* Deferred.fail(pending.deferred, yield* attribute(error));
|
|
115
|
+
})));
|
|
116
|
+
const execution = Effect.gen(function* () {
|
|
117
|
+
// The reply can precede the transport's acknowledgement of the send.
|
|
118
|
+
yield* Effect.forkIn(sending, yield* Effect.scope, { startImmediately: true });
|
|
119
|
+
return yield* Deferred.await(pending.deferred);
|
|
120
|
+
}).pipe(Effect.scoped, Effect.interruptible, Effect.timeoutOrElse({ duration: spec.wait, orElse: timedOut(operation) }), Effect.catch((error) => Effect.flatMap(attribute(error), Effect.fail)), Effect.onExit((exit) => Effect.gen(function* () {
|
|
121
|
+
// A submitted request stays attributable until a late reply or its
|
|
122
|
+
// generation retires; its slot is not released by the deadline.
|
|
123
|
+
const submitted = yield* correlator.isSubmitted(pending);
|
|
124
|
+
if (!submitted)
|
|
125
|
+
yield* forget;
|
|
126
|
+
else if (Exit.isFailure(exit))
|
|
127
|
+
yield* correlator.abandon(pending);
|
|
128
|
+
// The span covers the owned execution, which ends with the request's
|
|
129
|
+
// own outcome even after its caller stops waiting.
|
|
130
|
+
yield* Effect.annotateCurrentSpan(outcomeOf(exit, submitted));
|
|
131
|
+
})), Effect.withSpan(channel === "data" ? "Session.command" : "Session.control", {
|
|
132
|
+
kind: "client",
|
|
133
|
+
attributes: {
|
|
134
|
+
"reactor.operation": operation,
|
|
135
|
+
"reactor.request.id": pending.id,
|
|
136
|
+
"reactor.connection.generation": c.generation,
|
|
137
|
+
},
|
|
138
|
+
}, { captureStackTrace: false }));
|
|
139
|
+
const owner = yield* Effect.forkIn(execution, c.scope, { startImmediately: true });
|
|
140
|
+
return yield* restore(Fiber.join(owner));
|
|
141
|
+
}));
|
|
142
|
+
const command = Effect.fnUntraced(function* (name, input, options = {}) {
|
|
143
|
+
const { c } = yield* currentReady;
|
|
144
|
+
const payload = yield* Schema.decodeUnknownEffect(CommandInput)({
|
|
145
|
+
name,
|
|
146
|
+
data: input,
|
|
147
|
+
uploads: options.uploads ?? new Map(),
|
|
148
|
+
}).pipe(Effect.mapError((cause) => ReactorError.fromCode("InvalidInput", "invalid command", {
|
|
149
|
+
operation: name,
|
|
150
|
+
outcome: "not-submitted",
|
|
151
|
+
detail: cause,
|
|
152
|
+
})));
|
|
153
|
+
const wait = yield* Deadline.decode("replyTimeout")(options.replyTimeout ?? settings.replyTimeout);
|
|
154
|
+
return yield* request({
|
|
155
|
+
c,
|
|
156
|
+
correlator: data,
|
|
157
|
+
operation: name,
|
|
158
|
+
encode: (id) => Wire.encode(Wire.DataClientMessageSchema)({
|
|
159
|
+
requestId: id,
|
|
160
|
+
kind: Wire.MessageKind.REQUEST,
|
|
161
|
+
payload: {
|
|
162
|
+
case: "command",
|
|
163
|
+
value: {
|
|
164
|
+
type: payload.name,
|
|
165
|
+
data: payload.data,
|
|
166
|
+
uploads: Object.fromEntries(payload.uploads),
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
channel: "data",
|
|
171
|
+
wait,
|
|
172
|
+
});
|
|
173
|
+
}, (effect, name) => Effect.mapError(effect, commandFailure(name)));
|
|
174
|
+
/** A control request on `expected`, or on the ready generation. */
|
|
175
|
+
const controlRequest = Effect.fnUntraced(function* (operation, payload, expected) {
|
|
176
|
+
const c = expected ?? (yield* currentReady).c;
|
|
177
|
+
yield* current(c);
|
|
178
|
+
return yield* request({
|
|
179
|
+
c,
|
|
180
|
+
correlator: control,
|
|
181
|
+
operation,
|
|
182
|
+
encode: (id) => Wire.encode(Wire.ControlClientMessageSchema)({
|
|
183
|
+
requestId: id,
|
|
184
|
+
kind: Wire.MessageKind.REQUEST,
|
|
185
|
+
payload,
|
|
186
|
+
}),
|
|
187
|
+
channel: "control",
|
|
188
|
+
wait: settings.replyTimeout,
|
|
189
|
+
publication: payload.case === "publishTrack" ? payload.value.name : undefined,
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
const notification = (c, payload) => current(c).pipe(Effect.andThen(Wire.encode(Wire.ControlClientMessageSchema)({
|
|
193
|
+
kind: Wire.MessageKind.NOTIFICATION,
|
|
194
|
+
payload,
|
|
195
|
+
})), Effect.flatMap((bytes) => guard(c, c.peer.send("control", bytes))), Effect.timeoutOrElse({
|
|
196
|
+
duration: settings.replyTimeout,
|
|
197
|
+
orElse: timedOut("control notification"),
|
|
198
|
+
}));
|
|
199
|
+
/** A recording request: its clip, with a playlist URL resolved against the API. */
|
|
200
|
+
const clip = (operation, payload) => controlRequest(operation, payload).pipe(Effect.flatMap((reply) => {
|
|
201
|
+
if (reply._tag === "ClipFailed")
|
|
202
|
+
return Effect.fail(ReactorError.make({
|
|
203
|
+
reason: Remote.make({
|
|
204
|
+
// The one classification of provider text: a clip failure carries
|
|
205
|
+
// only a reason string, and a disabled recorder must be told apart.
|
|
206
|
+
_tag: /recorder disabled|encoder crashed/i.test(Redacted.value(reply.reason))
|
|
207
|
+
? "RecorderDisabled"
|
|
208
|
+
: "Remote",
|
|
209
|
+
message: "clip failed",
|
|
210
|
+
body: reply.reason,
|
|
211
|
+
}),
|
|
212
|
+
context: { outcome: "replied" },
|
|
213
|
+
}));
|
|
214
|
+
if (reply._tag !== "ClipReady")
|
|
215
|
+
return Effect.fail(unexpected(`clip reply was ${reply._tag}`));
|
|
216
|
+
const playlist = URL.parse(reply.clip.playlistUrl, `${apiUrl}/`);
|
|
217
|
+
return playlist === null
|
|
218
|
+
? Effect.fail(ReactorError.fromCode("Protocol", "clip playlist URL is malformed", {
|
|
219
|
+
outcome: "replied",
|
|
220
|
+
}))
|
|
221
|
+
: Effect.succeed({ ...reply.clip, playlistUrl: playlist.href });
|
|
222
|
+
}));
|
|
223
|
+
const schema = controlRequest("request_schema", { case: "requestSchema", value: {} }).pipe(Effect.flatMap((reply) => reply._tag === "ModelSchema"
|
|
224
|
+
? Effect.succeed(reply.openapi === undefined ? {} : { openapi: reply.openapi })
|
|
225
|
+
: Effect.fail(unexpected(`schema reply was ${reply._tag}`))));
|
|
226
|
+
const requestRecordingClip = (seconds) => Number.isFinite(seconds) && seconds > 0
|
|
227
|
+
? clip("request_clip", { case: "requestClip", value: { durationSeconds: seconds } })
|
|
228
|
+
: Effect.fail(ReactorError.fromCode("InvalidInput", "clip duration must be finite and positive", {
|
|
229
|
+
outcome: "not-submitted",
|
|
230
|
+
}));
|
|
231
|
+
return {
|
|
232
|
+
command,
|
|
233
|
+
controlRequest,
|
|
234
|
+
notification,
|
|
235
|
+
schema,
|
|
236
|
+
requestRecordingClip,
|
|
237
|
+
recording: clip("request_recording", { case: "requestRecording", value: {} }),
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../src/internal/session/requests.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC,cAAc;IAC/B,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAC,cAAc;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CACvB,MAAM,CAAC,4BAA4B,CAAC,EAAE,CAAC,EACvC,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,GAAG,CAAC,CACnC;CACF,CAAC,CAAC;AACH,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,IAAI,EAAE,IAAI,CAAC,UAAU;IACrB,OAAO,EAAE,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AAc,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,CAAC;QACpF,CAAC,CAAC,MAAM,CAAC,IAAI,CACT,YAAY,CAAC,QAAQ,CAAC,cAAc,EAAE,2CAA2C,EAAE;YACjF,OAAO,EAAE,eAAe;SACzB,CAAC,CACH,CAAC;IAER,OAAO;QACL,OAAO;QACP,cAAc;QACd,YAAY;QACZ,MAAM;QACN,oBAAoB;QACpB,SAAS,EAAE,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;KAC9E,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { DecodedMedia, TrackMedia } from "../../Media.js";
|
|
3
|
+
import { ReactorError } from "../../ReactorError.js";
|
|
4
|
+
import type { Generation } from "./generation.js";
|
|
5
|
+
import type { Connection, Core } from "./model.js";
|
|
6
|
+
import type { Requests } from "./requests.js";
|
|
7
|
+
export declare const make: ({ core, generation, requests, }: {
|
|
8
|
+
readonly core: Core;
|
|
9
|
+
readonly generation: Generation;
|
|
10
|
+
readonly requests: Requests;
|
|
11
|
+
}) => {
|
|
12
|
+
setTrackActive: (name: string, active: boolean, expected?: Connection) => Effect.Effect<void, ReactorError, never>;
|
|
13
|
+
releasePublications: (c: Connection | undefined) => Effect.Effect<{
|
|
14
|
+
submitted: string[];
|
|
15
|
+
errors: ReactorError[];
|
|
16
|
+
}, never, never>;
|
|
17
|
+
decoded: Effect.Effect<DecodedMedia, ReactorError, never>;
|
|
18
|
+
tracks: Effect.Effect<TrackMedia, ReactorError, never>;
|
|
19
|
+
};
|
|
20
|
+
export type Tracks = ReturnType<typeof make>;
|
|
21
|
+
//# sourceMappingURL=tracks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracks.d.ts","sourceRoot":"","sources":["../../../src/internal/session/tracks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AAEhE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM9C,eAAO,MAAM,IAAI,oCAId;IACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;2BAoC+B,MAAM,UAAU,OAAO,aAAa,UAAU;;;;;;;CA2N7E,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC"}
|