reactor-effect-client 0.7.1 → 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 -1099
- 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 -246
- package/dist/orchestration/scheduler-policy.d.ts.map +0 -1
- package/dist/orchestration/scheduler-policy.js +0 -668
- package/dist/orchestration/scheduler-policy.js.map +0 -1
- package/dist/orchestration/scheduler.d.ts +0 -393
- package/dist/orchestration/scheduler.d.ts.map +0 -1
- package/dist/orchestration/scheduler.js +0 -2621
- 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,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client's failures. `ReactorError` carries a tagged `reason` (route with
|
|
3
|
+
* `Effect.catchReason`) and a `context` of dispatch evidence; `CommandFailure`
|
|
4
|
+
* is the same with the evidence a dispatched command must have, and
|
|
5
|
+
* `AcquisitionFailure` adds the cleanup report of a partial lease.
|
|
6
|
+
*
|
|
7
|
+
* `message` is written by the library and never holds provider or payload
|
|
8
|
+
* text. That text, native backend text and diagnostic detail live in
|
|
9
|
+
* `Redacted` fields, so logs, spans and `toJSON` show `<redacted>` for them.
|
|
10
|
+
* Persisted evidence stores a `FailureSummary`, never the error itself.
|
|
11
|
+
*/
|
|
12
|
+
import * as Duration from "effect/Duration";
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
import type { CloseReport } from "./Session.js";
|
|
15
|
+
declare const TypeId: "~reactor-effect-client/ReactorFailure";
|
|
16
|
+
/** The codes whose reason carries nothing beyond a library-written message. */
|
|
17
|
+
export declare const FailureCode: Schema.Literals<readonly ["InvalidInput", "Protocol", "VersionMismatch", "UnsupportedHost", "UnsupportedCapability", "InvalidState", "TerminalSession", "Timeout", "Disconnected", "Aborted", "Overflow", "UnexpectedReply", "Upload", "Closed", "AlreadyReading", "Shutdown", "SdpRejected", "ChannelClosed", "Indeterminate", "Moderated"]>;
|
|
18
|
+
export type FailureCode = typeof FailureCode.Type;
|
|
19
|
+
declare const Failure_base: Schema.Class<Failure, Schema.Struct<{
|
|
20
|
+
readonly _tag: Schema.Literals<readonly ["InvalidInput", "Protocol", "VersionMismatch", "UnsupportedHost", "UnsupportedCapability", "InvalidState", "TerminalSession", "Timeout", "Disconnected", "Aborted", "Overflow", "UnexpectedReply", "Upload", "Closed", "AlreadyReading", "Shutdown", "SdpRejected", "ChannelClosed", "Indeterminate", "Moderated"]>;
|
|
21
|
+
readonly message: Schema.String;
|
|
22
|
+
}>, import("effect/Cause").YieldableError>;
|
|
23
|
+
/** A reason whose `_tag` is its code. */
|
|
24
|
+
export declare class Failure extends Failure_base {
|
|
25
|
+
}
|
|
26
|
+
declare const Http_base: Schema.Class<Http, Schema.Struct<{
|
|
27
|
+
readonly _tag: Schema.tag<"Http">;
|
|
28
|
+
readonly message: Schema.String;
|
|
29
|
+
readonly status: Schema.optionalKey<Schema.Int>;
|
|
30
|
+
/** The response's `Retry-After`, when it named a delay. */
|
|
31
|
+
readonly retryAfter: Schema.optionalKey<Schema.Duration>;
|
|
32
|
+
/** The response body, for explicit inspection only. */
|
|
33
|
+
readonly body: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
34
|
+
}>, import("effect/Cause").YieldableError>;
|
|
35
|
+
/** A coordinator HTTP failure; `status` is absent when no response arrived. */
|
|
36
|
+
export declare class Http extends Http_base {
|
|
37
|
+
}
|
|
38
|
+
declare const Remote_base: Schema.Class<Remote, Schema.Struct<{
|
|
39
|
+
readonly _tag: Schema.Literals<readonly ["Remote", "RecorderDisabled"]>;
|
|
40
|
+
readonly message: Schema.String;
|
|
41
|
+
/** The provider's own error code, verbatim, for explicit inspection only. */
|
|
42
|
+
readonly remoteCode: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
43
|
+
/** The provider's error text, for explicit inspection only. */
|
|
44
|
+
readonly body: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
45
|
+
}>, import("effect/Cause").YieldableError>;
|
|
46
|
+
/**
|
|
47
|
+
* The provider replied with an error or a refusal. `RecorderDisabled` is a
|
|
48
|
+
* clip failure recognized from its reason, the one documented classification
|
|
49
|
+
* of provider text.
|
|
50
|
+
*/
|
|
51
|
+
export declare class Remote extends Remote_base {
|
|
52
|
+
}
|
|
53
|
+
declare const Native_base: Schema.Class<Native, Schema.Struct<{
|
|
54
|
+
readonly _tag: Schema.tag<"Native">;
|
|
55
|
+
readonly message: Schema.String;
|
|
56
|
+
/** libwebrtc's own text; it can contain peer SDP or signaling material. */
|
|
57
|
+
readonly backendMessage: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
58
|
+
}>, import("effect/Cause").YieldableError>;
|
|
59
|
+
/** A failure of the native WebRTC addon or its host process. */
|
|
60
|
+
export declare class Native extends Native_base {
|
|
61
|
+
}
|
|
62
|
+
declare const IceFailed_base: Schema.Class<IceFailed, Schema.Struct<{
|
|
63
|
+
readonly _tag: Schema.tag<"IceFailed">;
|
|
64
|
+
readonly message: Schema.String;
|
|
65
|
+
/** Candidate pairs the connection's statistics listed. */
|
|
66
|
+
readonly pairs: Schema.Int;
|
|
67
|
+
/** The local candidate types gathered, such as `host` or `relay`. */
|
|
68
|
+
readonly candidateTypes: Schema.$Array<Schema.String>;
|
|
69
|
+
}>, import("effect/Cause").YieldableError>;
|
|
70
|
+
/** No ICE candidate pair worked. */
|
|
71
|
+
export declare class IceFailed extends IceFailed_base {
|
|
72
|
+
}
|
|
73
|
+
declare const TransportFailed_base: Schema.Class<TransportFailed, Schema.Struct<{
|
|
74
|
+
readonly _tag: Schema.tag<"TransportFailed">;
|
|
75
|
+
readonly message: Schema.String;
|
|
76
|
+
readonly pairs: Schema.Int;
|
|
77
|
+
}>, import("effect/Cause").YieldableError>;
|
|
78
|
+
/** ICE connectivity succeeded and the DTLS or SCTP transport above it failed. */
|
|
79
|
+
export declare class TransportFailed extends TransportFailed_base {
|
|
80
|
+
}
|
|
81
|
+
declare const ClipEnded_base: Schema.Class<ClipEnded, Schema.Struct<{
|
|
82
|
+
readonly _tag: Schema.tag<"ClipEnded">;
|
|
83
|
+
readonly message: Schema.String;
|
|
84
|
+
readonly clipId: Schema.String;
|
|
85
|
+
readonly lifecycle: Schema.Literals<readonly ["clip_failed", "clip_popped"]>;
|
|
86
|
+
/** The transport generation whose evidence ended it. */
|
|
87
|
+
readonly transportGeneration: Schema.BigInt;
|
|
88
|
+
}>, import("effect/Cause").YieldableError>;
|
|
89
|
+
/** A clip ended, by `clip_failed` or `clip_popped`, before it reached the phase awaited. */
|
|
90
|
+
export declare class ClipEnded extends ClipEnded_base {
|
|
91
|
+
}
|
|
92
|
+
export declare const ReactorErrorReason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
93
|
+
export type ReactorErrorReason = typeof ReactorErrorReason.Type;
|
|
94
|
+
/** Every reason tag. */
|
|
95
|
+
export type ErrorCode = ReactorErrorReason["_tag"];
|
|
96
|
+
/** The codes a reason can be built from with a message alone. */
|
|
97
|
+
export type MessageCode = Exclude<ErrorCode, "IceFailed" | "TransportFailed" | "ClipEnded">;
|
|
98
|
+
/** Whether a remote mutation may have happened: never sent, maybe sent, or answered. */
|
|
99
|
+
export declare const RemoteOutcome: Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>;
|
|
100
|
+
export type RemoteOutcome = typeof RemoteOutcome.Type;
|
|
101
|
+
export declare const ErrorContext: Schema.Struct<{
|
|
102
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
103
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
104
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
105
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
106
|
+
readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>>;
|
|
107
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
108
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
109
|
+
}>;
|
|
110
|
+
export type ErrorContext = typeof ErrorContext.Type;
|
|
111
|
+
/** An `ErrorContext` whose `detail` is still plain; `fromCode` redacts it. */
|
|
112
|
+
export type ContextInput = Omit<ErrorContext, "detail"> & {
|
|
113
|
+
readonly detail?: unknown;
|
|
114
|
+
};
|
|
115
|
+
/** Dispatch evidence proving that a request was never handed to the remote. */
|
|
116
|
+
export declare const NotSubmitted: Schema.Struct<{
|
|
117
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
118
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
119
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
120
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
121
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
122
|
+
readonly outcome: Schema.Literal<"not-submitted">;
|
|
123
|
+
readonly operation: Schema.String;
|
|
124
|
+
}>;
|
|
125
|
+
export type NotSubmitted = typeof NotSubmitted.Type;
|
|
126
|
+
/** A command's dispatch evidence: never sent, or sent with its request identity. */
|
|
127
|
+
export declare const CommandContext: Schema.Union<readonly [Schema.Struct<{
|
|
128
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
129
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
130
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
131
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
132
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
133
|
+
readonly outcome: Schema.Literal<"not-submitted">;
|
|
134
|
+
readonly operation: Schema.String;
|
|
135
|
+
}>, Schema.Struct<{
|
|
136
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
137
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
138
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
139
|
+
readonly outcome: Schema.Literals<readonly ["unknown", "replied"]>;
|
|
140
|
+
readonly operation: Schema.String;
|
|
141
|
+
readonly requestId: Schema.String;
|
|
142
|
+
readonly generation: Schema.BigInt;
|
|
143
|
+
}>]>;
|
|
144
|
+
export type CommandContext = typeof CommandContext.Type;
|
|
145
|
+
/** `C` with a plain `detail`, member by member, so a union keeps its members. */
|
|
146
|
+
type PlainDetail<C> = C extends unknown ? Omit<C, "detail"> & {
|
|
147
|
+
readonly detail?: unknown;
|
|
148
|
+
} : never;
|
|
149
|
+
declare const ReactorError_base: Schema.Class<ReactorError, Schema.TaggedStruct<"ReactorError", {
|
|
150
|
+
readonly reason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
151
|
+
readonly context: Schema.withConstructorDefault<Schema.Struct<{
|
|
152
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
153
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
154
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
155
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
156
|
+
readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>>;
|
|
157
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
158
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
159
|
+
}>>;
|
|
160
|
+
}>, import("effect/Cause").YieldableError>;
|
|
161
|
+
/**
|
|
162
|
+
* A failure category never implies a mutation was rolled back: inspect
|
|
163
|
+
* `context.outcome`, and route on `reason._tag`.
|
|
164
|
+
*/
|
|
165
|
+
export declare class ReactorError extends ReactorError_base {
|
|
166
|
+
readonly [TypeId]: "~reactor-effect-client/ReactorFailure";
|
|
167
|
+
/** The reason is library-authored, so it is the native cause. */
|
|
168
|
+
readonly cause: ClipEnded | Failure | Http | IceFailed | Native | Remote | TransportFailed;
|
|
169
|
+
get message(): string;
|
|
170
|
+
get isRetryable(): boolean;
|
|
171
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
172
|
+
static is(u: unknown): u is ReactorError;
|
|
173
|
+
/** A failure whose reason is `code` with a library-written `message`. */
|
|
174
|
+
static fromCode(code: MessageCode, message: string, context?: ContextInput): ReactorError;
|
|
175
|
+
}
|
|
176
|
+
declare const CommandFailure_base: Schema.Class<CommandFailure, Schema.TaggedStruct<"CommandFailure", {
|
|
177
|
+
readonly reason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
178
|
+
readonly context: Schema.Union<readonly [Schema.Struct<{
|
|
179
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
180
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
181
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
182
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
183
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
184
|
+
readonly outcome: Schema.Literal<"not-submitted">;
|
|
185
|
+
readonly operation: Schema.String;
|
|
186
|
+
}>, Schema.Struct<{
|
|
187
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
188
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
189
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
190
|
+
readonly outcome: Schema.Literals<readonly ["unknown", "replied"]>;
|
|
191
|
+
readonly operation: Schema.String;
|
|
192
|
+
readonly requestId: Schema.String;
|
|
193
|
+
readonly generation: Schema.BigInt;
|
|
194
|
+
}>]>;
|
|
195
|
+
}>, import("effect/Cause").YieldableError>;
|
|
196
|
+
/** Every failed command carries the dispatch evidence its owner established. */
|
|
197
|
+
export declare class CommandFailure extends CommandFailure_base {
|
|
198
|
+
readonly [TypeId]: "~reactor-effect-client/ReactorFailure";
|
|
199
|
+
readonly cause: ClipEnded | Failure | Http | IceFailed | Native | Remote | TransportFailed;
|
|
200
|
+
get message(): string;
|
|
201
|
+
get isRetryable(): boolean;
|
|
202
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
203
|
+
static is(u: unknown): u is CommandFailure;
|
|
204
|
+
/** `error`'s reason with the dispatch evidence its command established. */
|
|
205
|
+
static from(error: ReactorError | CommandFailure | AcquisitionFailure, context: PlainDetail<CommandContext>): CommandFailure;
|
|
206
|
+
}
|
|
207
|
+
declare const AcquisitionFailure_base: Schema.Class<AcquisitionFailure, Schema.TaggedStruct<"AcquisitionFailure", {
|
|
208
|
+
readonly reason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
209
|
+
readonly context: Schema.withConstructorDefault<Schema.Struct<{
|
|
210
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
211
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
212
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
213
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
214
|
+
readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>>;
|
|
215
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
216
|
+
readonly detail: Schema.optionalKey<Schema.Redacted<Schema.Unknown>>;
|
|
217
|
+
}>>;
|
|
218
|
+
readonly cleanup: Schema.declare<{
|
|
219
|
+
readonly localClosed: boolean;
|
|
220
|
+
readonly allocation: "known" | "none" | "unknown";
|
|
221
|
+
readonly ownership?: "attached" | "owned";
|
|
222
|
+
readonly sessionId?: string;
|
|
223
|
+
readonly remote: {
|
|
224
|
+
readonly attempted: boolean;
|
|
225
|
+
readonly responseReceived: boolean;
|
|
226
|
+
readonly confirmed: boolean;
|
|
227
|
+
readonly evidence: "absent" | "terminal" | null;
|
|
228
|
+
readonly deleteStatus: number | null;
|
|
229
|
+
readonly state: string | null;
|
|
230
|
+
readonly error?: {
|
|
231
|
+
readonly _tag: string;
|
|
232
|
+
readonly reason: string;
|
|
233
|
+
readonly message: string;
|
|
234
|
+
readonly operation?: string;
|
|
235
|
+
readonly requestId?: string;
|
|
236
|
+
readonly sessionId?: string;
|
|
237
|
+
readonly generation?: string;
|
|
238
|
+
readonly outcome?: "not-submitted" | "replied" | "unknown";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
readonly unpublishSubmitted: readonly string[];
|
|
242
|
+
readonly unresolvedPublications: readonly string[];
|
|
243
|
+
readonly localErrors: readonly {
|
|
244
|
+
readonly _tag: string;
|
|
245
|
+
readonly reason: string;
|
|
246
|
+
readonly message: string;
|
|
247
|
+
readonly operation?: string;
|
|
248
|
+
readonly requestId?: string;
|
|
249
|
+
readonly sessionId?: string;
|
|
250
|
+
readonly generation?: string;
|
|
251
|
+
readonly outcome?: "not-submitted" | "replied" | "unknown";
|
|
252
|
+
}[];
|
|
253
|
+
}, {
|
|
254
|
+
readonly localClosed: boolean;
|
|
255
|
+
readonly allocation: "known" | "none" | "unknown";
|
|
256
|
+
readonly ownership?: "attached" | "owned";
|
|
257
|
+
readonly sessionId?: string;
|
|
258
|
+
readonly remote: {
|
|
259
|
+
readonly attempted: boolean;
|
|
260
|
+
readonly responseReceived: boolean;
|
|
261
|
+
readonly confirmed: boolean;
|
|
262
|
+
readonly evidence: "absent" | "terminal" | null;
|
|
263
|
+
readonly deleteStatus: number | null;
|
|
264
|
+
readonly state: string | null;
|
|
265
|
+
readonly error?: {
|
|
266
|
+
readonly _tag: string;
|
|
267
|
+
readonly reason: string;
|
|
268
|
+
readonly message: string;
|
|
269
|
+
readonly operation?: string;
|
|
270
|
+
readonly requestId?: string;
|
|
271
|
+
readonly sessionId?: string;
|
|
272
|
+
readonly generation?: string;
|
|
273
|
+
readonly outcome?: "not-submitted" | "replied" | "unknown";
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
readonly unpublishSubmitted: readonly string[];
|
|
277
|
+
readonly unresolvedPublications: readonly string[];
|
|
278
|
+
readonly localErrors: readonly {
|
|
279
|
+
readonly _tag: string;
|
|
280
|
+
readonly reason: string;
|
|
281
|
+
readonly message: string;
|
|
282
|
+
readonly operation?: string;
|
|
283
|
+
readonly requestId?: string;
|
|
284
|
+
readonly sessionId?: string;
|
|
285
|
+
readonly generation?: string;
|
|
286
|
+
readonly outcome?: "not-submitted" | "replied" | "unknown";
|
|
287
|
+
}[];
|
|
288
|
+
}>;
|
|
289
|
+
}>, import("effect/Cause").YieldableError>;
|
|
290
|
+
/** A failed acquisition still returns the lifetime evidence of its partial lease. */
|
|
291
|
+
export declare class AcquisitionFailure extends AcquisitionFailure_base {
|
|
292
|
+
readonly [TypeId]: "~reactor-effect-client/ReactorFailure";
|
|
293
|
+
readonly cause: ClipEnded | Failure | Http | IceFailed | Native | Remote | TransportFailed;
|
|
294
|
+
get message(): string;
|
|
295
|
+
get isRetryable(): boolean;
|
|
296
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
297
|
+
static is(u: unknown): u is AcquisitionFailure;
|
|
298
|
+
/** `error`'s reason and context, with the cleanup its partial lease reported. */
|
|
299
|
+
static from(error: ReactorError | CommandFailure | AcquisitionFailure, cleanup: CloseReport): AcquisitionFailure;
|
|
300
|
+
}
|
|
301
|
+
/** Any failure this client raises. Each class keeps its own `_tag`. */
|
|
302
|
+
export type ReactorFailure = ReactorError | CommandFailure | AcquisitionFailure;
|
|
303
|
+
/**
|
|
304
|
+
* Whether `u` is one of the client's failures. A passthrough re-raises a known
|
|
305
|
+
* failure through this guard or a class's `is`, so the evidence a class carries
|
|
306
|
+
* is kept instead of re-wrapped.
|
|
307
|
+
*/
|
|
308
|
+
export declare const isReactorFailure: (u: unknown) => u is ReactorFailure;
|
|
309
|
+
/** A failure as persisted evidence: its routing facts, without any redacted text. */
|
|
310
|
+
export declare const FailureSummary: Schema.Struct<{
|
|
311
|
+
readonly _tag: Schema.String;
|
|
312
|
+
readonly reason: Schema.String;
|
|
313
|
+
readonly message: Schema.String;
|
|
314
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
315
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
316
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
317
|
+
readonly generation: Schema.optionalKey<Schema.String>;
|
|
318
|
+
readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>>;
|
|
319
|
+
}>;
|
|
320
|
+
export type FailureSummary = typeof FailureSummary.Type;
|
|
321
|
+
/** The summary of any failure with a tagged reason and a context, the client's or a policy's. */
|
|
322
|
+
export declare const summarize: (error: {
|
|
323
|
+
readonly _tag: string;
|
|
324
|
+
readonly message: string;
|
|
325
|
+
readonly reason: {
|
|
326
|
+
readonly _tag: string;
|
|
327
|
+
};
|
|
328
|
+
readonly context: Omit<ErrorContext, "detail">;
|
|
329
|
+
}) => FailureSummary;
|
|
330
|
+
export {};
|
|
331
|
+
//# sourceMappingURL=ReactorError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactorError.d.ts","sourceRoot":"","sources":["../src/ReactorError.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client's failures. `ReactorError` carries a tagged `reason` (route with
|
|
3
|
+
* `Effect.catchReason`) and a `context` of dispatch evidence; `CommandFailure`
|
|
4
|
+
* is the same with the evidence a dispatched command must have, and
|
|
5
|
+
* `AcquisitionFailure` adds the cleanup report of a partial lease.
|
|
6
|
+
*
|
|
7
|
+
* `message` is written by the library and never holds provider or payload
|
|
8
|
+
* text. That text, native backend text and diagnostic detail live in
|
|
9
|
+
* `Redacted` fields, so logs, spans and `toJSON` show `<redacted>` for them.
|
|
10
|
+
* Persisted evidence stores a `FailureSummary`, never the error itself.
|
|
11
|
+
*/
|
|
12
|
+
import * as Duration from "effect/Duration";
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
|
+
import * as Predicate from "effect/Predicate";
|
|
15
|
+
import * as Redacted from "effect/Redacted";
|
|
16
|
+
import * as Schema from "effect/Schema";
|
|
17
|
+
const TypeId = "~reactor-effect-client/ReactorFailure";
|
|
18
|
+
/** The codes whose reason carries nothing beyond a library-written message. */
|
|
19
|
+
export const FailureCode = Schema.Literals([
|
|
20
|
+
"InvalidInput",
|
|
21
|
+
"Protocol",
|
|
22
|
+
"VersionMismatch",
|
|
23
|
+
"UnsupportedHost",
|
|
24
|
+
"UnsupportedCapability",
|
|
25
|
+
"InvalidState",
|
|
26
|
+
"TerminalSession",
|
|
27
|
+
"Timeout",
|
|
28
|
+
"Disconnected",
|
|
29
|
+
"Aborted",
|
|
30
|
+
"Overflow",
|
|
31
|
+
"UnexpectedReply",
|
|
32
|
+
"Upload",
|
|
33
|
+
"Closed",
|
|
34
|
+
"AlreadyReading",
|
|
35
|
+
"Shutdown",
|
|
36
|
+
"SdpRejected",
|
|
37
|
+
"ChannelClosed",
|
|
38
|
+
"Indeterminate",
|
|
39
|
+
/** Reactor's content moderation ended the session. */
|
|
40
|
+
"Moderated",
|
|
41
|
+
]);
|
|
42
|
+
/** A reason whose `_tag` is its code. */
|
|
43
|
+
export class Failure extends Schema.Error("reactor-effect-client/ReactorError/Failure")({
|
|
44
|
+
_tag: FailureCode,
|
|
45
|
+
message: Schema.String,
|
|
46
|
+
}) {
|
|
47
|
+
}
|
|
48
|
+
/** A coordinator HTTP failure; `status` is absent when no response arrived. */
|
|
49
|
+
export class Http extends Schema.Error("reactor-effect-client/ReactorError/Http")({
|
|
50
|
+
_tag: Schema.tag("Http"),
|
|
51
|
+
message: Schema.String,
|
|
52
|
+
status: Schema.optionalKey(Schema.Int),
|
|
53
|
+
/** The response's `Retry-After`, when it named a delay. */
|
|
54
|
+
retryAfter: Schema.optionalKey(Schema.Duration),
|
|
55
|
+
/** The response body, for explicit inspection only. */
|
|
56
|
+
body: Schema.String.pipe(Schema.Redacted, Schema.optionalKey),
|
|
57
|
+
}) {
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The provider replied with an error or a refusal. `RecorderDisabled` is a
|
|
61
|
+
* clip failure recognized from its reason, the one documented classification
|
|
62
|
+
* of provider text.
|
|
63
|
+
*/
|
|
64
|
+
export class Remote extends Schema.Error("reactor-effect-client/ReactorError/Remote")({
|
|
65
|
+
_tag: Schema.Literals(["Remote", "RecorderDisabled"]),
|
|
66
|
+
message: Schema.String,
|
|
67
|
+
/** The provider's own error code, verbatim, for explicit inspection only. */
|
|
68
|
+
remoteCode: Schema.String.pipe(Schema.Redacted, Schema.optionalKey),
|
|
69
|
+
/** The provider's error text, for explicit inspection only. */
|
|
70
|
+
body: Schema.String.pipe(Schema.Redacted, Schema.optionalKey),
|
|
71
|
+
}) {
|
|
72
|
+
}
|
|
73
|
+
/** A failure of the native WebRTC addon or its host process. */
|
|
74
|
+
export class Native extends Schema.Error("reactor-effect-client/ReactorError/Native")({
|
|
75
|
+
_tag: Schema.tag("Native"),
|
|
76
|
+
message: Schema.String,
|
|
77
|
+
/** libwebrtc's own text; it can contain peer SDP or signaling material. */
|
|
78
|
+
backendMessage: Schema.optionalKey(Schema.Redacted(Schema.String, { disallowJsonEncode: true })),
|
|
79
|
+
}) {
|
|
80
|
+
}
|
|
81
|
+
/** No ICE candidate pair worked. */
|
|
82
|
+
export class IceFailed extends Schema.Error("reactor-effect-client/ReactorError/IceFailed")({
|
|
83
|
+
_tag: Schema.tag("IceFailed"),
|
|
84
|
+
message: Schema.String,
|
|
85
|
+
/** Candidate pairs the connection's statistics listed. */
|
|
86
|
+
pairs: Schema.Int,
|
|
87
|
+
/** The local candidate types gathered, such as `host` or `relay`. */
|
|
88
|
+
candidateTypes: Schema.Array(Schema.String),
|
|
89
|
+
}) {
|
|
90
|
+
}
|
|
91
|
+
/** ICE connectivity succeeded and the DTLS or SCTP transport above it failed. */
|
|
92
|
+
export class TransportFailed extends Schema.Error("reactor-effect-client/ReactorError/TransportFailed")({
|
|
93
|
+
_tag: Schema.tag("TransportFailed"),
|
|
94
|
+
message: Schema.String,
|
|
95
|
+
pairs: Schema.Int,
|
|
96
|
+
}) {
|
|
97
|
+
}
|
|
98
|
+
/** A clip ended, by `clip_failed` or `clip_popped`, before it reached the phase awaited. */
|
|
99
|
+
export class ClipEnded extends Schema.Error("reactor-effect-client/ReactorError/ClipEnded")({
|
|
100
|
+
_tag: Schema.tag("ClipEnded"),
|
|
101
|
+
message: Schema.String,
|
|
102
|
+
clipId: Schema.String,
|
|
103
|
+
lifecycle: Schema.Literals(["clip_failed", "clip_popped"]),
|
|
104
|
+
/** The transport generation whose evidence ended it. */
|
|
105
|
+
transportGeneration: Schema.BigInt,
|
|
106
|
+
}) {
|
|
107
|
+
}
|
|
108
|
+
export const ReactorErrorReason = Schema.Union([
|
|
109
|
+
Failure,
|
|
110
|
+
Http,
|
|
111
|
+
Remote,
|
|
112
|
+
Native,
|
|
113
|
+
IceFailed,
|
|
114
|
+
TransportFailed,
|
|
115
|
+
ClipEnded,
|
|
116
|
+
]);
|
|
117
|
+
/** Whether a remote mutation may have happened: never sent, maybe sent, or answered. */
|
|
118
|
+
export const RemoteOutcome = Schema.Literals(["not-submitted", "unknown", "replied"]);
|
|
119
|
+
export const ErrorContext = Schema.Struct({
|
|
120
|
+
operation: Schema.optionalKey(Schema.String),
|
|
121
|
+
requestId: Schema.optionalKey(Schema.String),
|
|
122
|
+
sessionId: Schema.optionalKey(Schema.String),
|
|
123
|
+
generation: Schema.optionalKey(Schema.BigInt),
|
|
124
|
+
outcome: Schema.optionalKey(RemoteOutcome),
|
|
125
|
+
/** A cause or diagnostic record; it may hold provider or payload text. */
|
|
126
|
+
detail: Schema.Unknown.pipe(Schema.Redacted, Schema.optionalKey),
|
|
127
|
+
});
|
|
128
|
+
/** Dispatch evidence proving that a request was never handed to the remote. */
|
|
129
|
+
export const NotSubmitted = Schema.Struct({
|
|
130
|
+
...ErrorContext.fields,
|
|
131
|
+
outcome: Schema.Literal("not-submitted"),
|
|
132
|
+
operation: Schema.String,
|
|
133
|
+
});
|
|
134
|
+
/** A command's dispatch evidence: never sent, or sent with its request identity. */
|
|
135
|
+
export const CommandContext = Schema.Union([
|
|
136
|
+
NotSubmitted,
|
|
137
|
+
Schema.Struct({
|
|
138
|
+
...ErrorContext.fields,
|
|
139
|
+
outcome: Schema.Literals(["unknown", "replied"]),
|
|
140
|
+
operation: Schema.String,
|
|
141
|
+
requestId: Schema.String,
|
|
142
|
+
generation: Schema.BigInt,
|
|
143
|
+
}),
|
|
144
|
+
]);
|
|
145
|
+
const redactErrorContext = (context) => {
|
|
146
|
+
const { detail, ...rest } = context;
|
|
147
|
+
if (detail === undefined)
|
|
148
|
+
return rest;
|
|
149
|
+
return { ...rest, detail: Redacted.isRedacted(detail) ? detail : Redacted.make(detail) };
|
|
150
|
+
};
|
|
151
|
+
const redactCommandContext = (context) => {
|
|
152
|
+
const { detail, ...rest } = context;
|
|
153
|
+
if (detail === undefined)
|
|
154
|
+
return rest;
|
|
155
|
+
return { ...rest, detail: Redacted.isRedacted(detail) ? detail : Redacted.make(detail) };
|
|
156
|
+
};
|
|
157
|
+
const reasonFor = (code, message) => {
|
|
158
|
+
switch (code) {
|
|
159
|
+
case "Http":
|
|
160
|
+
return Http.make({ message });
|
|
161
|
+
case "Remote":
|
|
162
|
+
case "RecorderDisabled":
|
|
163
|
+
return Remote.make({ _tag: code, message });
|
|
164
|
+
case "Native":
|
|
165
|
+
return Native.make({ message });
|
|
166
|
+
default:
|
|
167
|
+
return Failure.make({ _tag: code, message });
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Whether a later attempt may succeed: backpressure, a lost connection, or an
|
|
172
|
+
* HTTP refusal for now. Never when the first attempt's outcome is unknown,
|
|
173
|
+
* since the remote may already have applied it.
|
|
174
|
+
*/
|
|
175
|
+
const retryable = (reason, outcome) => {
|
|
176
|
+
if (outcome === "unknown")
|
|
177
|
+
return false;
|
|
178
|
+
switch (reason._tag) {
|
|
179
|
+
case "Overflow":
|
|
180
|
+
case "Disconnected":
|
|
181
|
+
case "ChannelClosed":
|
|
182
|
+
return true;
|
|
183
|
+
case "Http":
|
|
184
|
+
// Reactor classes a server error as recoverable; a refusal of authority or a conflict is not.
|
|
185
|
+
return (reason.status === undefined ||
|
|
186
|
+
reason.status === 408 ||
|
|
187
|
+
reason.status === 429 ||
|
|
188
|
+
reason.status >= 500 ||
|
|
189
|
+
reason.retryAfter !== undefined);
|
|
190
|
+
default:
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const retryAfterOf = (reason) => reason._tag === "Http" ? reason.retryAfter : undefined;
|
|
195
|
+
/**
|
|
196
|
+
* A failure category never implies a mutation was rolled back: inspect
|
|
197
|
+
* `context.outcome`, and route on `reason._tag`.
|
|
198
|
+
*/
|
|
199
|
+
export class ReactorError extends Schema.TaggedError("reactor-effect-client/ReactorError")("ReactorError", {
|
|
200
|
+
reason: ReactorErrorReason,
|
|
201
|
+
context: ErrorContext.pipe(Schema.withConstructorDefault(Effect.succeed({}))),
|
|
202
|
+
}) {
|
|
203
|
+
[TypeId] = TypeId;
|
|
204
|
+
/** The reason is library-authored, so it is the native cause. */
|
|
205
|
+
cause = this.reason;
|
|
206
|
+
get message() {
|
|
207
|
+
return this.reason.message;
|
|
208
|
+
}
|
|
209
|
+
get isRetryable() {
|
|
210
|
+
return retryable(this.reason, this.context.outcome);
|
|
211
|
+
}
|
|
212
|
+
get retryAfter() {
|
|
213
|
+
return retryAfterOf(this.reason);
|
|
214
|
+
}
|
|
215
|
+
static is(u) {
|
|
216
|
+
return Predicate.hasProperty(u, TypeId) && Predicate.isTagged(u, "ReactorError");
|
|
217
|
+
}
|
|
218
|
+
/** A failure whose reason is `code` with a library-written `message`. */
|
|
219
|
+
static fromCode(code, message, context = {}) {
|
|
220
|
+
return ReactorError.make({
|
|
221
|
+
reason: reasonFor(code, message),
|
|
222
|
+
context: redactErrorContext(context),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/** Every failed command carries the dispatch evidence its owner established. */
|
|
227
|
+
export class CommandFailure extends Schema.TaggedError("reactor-effect-client/CommandFailure")("CommandFailure", {
|
|
228
|
+
reason: ReactorErrorReason,
|
|
229
|
+
context: CommandContext,
|
|
230
|
+
}) {
|
|
231
|
+
[TypeId] = TypeId;
|
|
232
|
+
cause = this.reason;
|
|
233
|
+
get message() {
|
|
234
|
+
return this.reason.message;
|
|
235
|
+
}
|
|
236
|
+
get isRetryable() {
|
|
237
|
+
return retryable(this.reason, this.context.outcome);
|
|
238
|
+
}
|
|
239
|
+
get retryAfter() {
|
|
240
|
+
return retryAfterOf(this.reason);
|
|
241
|
+
}
|
|
242
|
+
static is(u) {
|
|
243
|
+
return Predicate.hasProperty(u, TypeId) && Predicate.isTagged(u, "CommandFailure");
|
|
244
|
+
}
|
|
245
|
+
/** `error`'s reason with the dispatch evidence its command established. */
|
|
246
|
+
static from(error, context) {
|
|
247
|
+
return CommandFailure.make({
|
|
248
|
+
reason: error.reason,
|
|
249
|
+
context: redactCommandContext(context),
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* A partial lease's cleanup report. `Session` owns its Schema and imports this
|
|
255
|
+
* module at run time, so the report is declared here by type alone.
|
|
256
|
+
*/
|
|
257
|
+
const Cleanup = Schema.declare((u) => Predicate.isObject(u), {
|
|
258
|
+
expected: "CloseReport",
|
|
259
|
+
});
|
|
260
|
+
/** A failed acquisition still returns the lifetime evidence of its partial lease. */
|
|
261
|
+
export class AcquisitionFailure extends Schema.TaggedError("reactor-effect-client/AcquisitionFailure")("AcquisitionFailure", {
|
|
262
|
+
reason: ReactorErrorReason,
|
|
263
|
+
context: ErrorContext.pipe(Schema.withConstructorDefault(Effect.succeed({}))),
|
|
264
|
+
cleanup: Cleanup,
|
|
265
|
+
}) {
|
|
266
|
+
[TypeId] = TypeId;
|
|
267
|
+
cause = this.reason;
|
|
268
|
+
get message() {
|
|
269
|
+
return this.reason.message;
|
|
270
|
+
}
|
|
271
|
+
get isRetryable() {
|
|
272
|
+
return retryable(this.reason, this.context.outcome);
|
|
273
|
+
}
|
|
274
|
+
get retryAfter() {
|
|
275
|
+
return retryAfterOf(this.reason);
|
|
276
|
+
}
|
|
277
|
+
static is(u) {
|
|
278
|
+
return Predicate.hasProperty(u, TypeId) && Predicate.isTagged(u, "AcquisitionFailure");
|
|
279
|
+
}
|
|
280
|
+
/** `error`'s reason and context, with the cleanup its partial lease reported. */
|
|
281
|
+
static from(error, cleanup) {
|
|
282
|
+
return AcquisitionFailure.make({ reason: error.reason, context: error.context, cleanup });
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Whether `u` is one of the client's failures. A passthrough re-raises a known
|
|
287
|
+
* failure through this guard or a class's `is`, so the evidence a class carries
|
|
288
|
+
* is kept instead of re-wrapped.
|
|
289
|
+
*/
|
|
290
|
+
export const isReactorFailure = (u) => Predicate.hasProperty(u, TypeId);
|
|
291
|
+
/** A failure as persisted evidence: its routing facts, without any redacted text. */
|
|
292
|
+
export const FailureSummary = Schema.Struct({
|
|
293
|
+
_tag: Schema.String,
|
|
294
|
+
reason: Schema.String,
|
|
295
|
+
message: Schema.String,
|
|
296
|
+
operation: Schema.optionalKey(Schema.String),
|
|
297
|
+
requestId: Schema.optionalKey(Schema.String),
|
|
298
|
+
sessionId: Schema.optionalKey(Schema.String),
|
|
299
|
+
generation: Schema.optionalKey(Schema.String),
|
|
300
|
+
outcome: Schema.optionalKey(RemoteOutcome),
|
|
301
|
+
});
|
|
302
|
+
/** The summary of any failure with a tagged reason and a context, the client's or a policy's. */
|
|
303
|
+
export const summarize = (error) => {
|
|
304
|
+
const { operation, requestId, sessionId, generation, outcome } = error.context;
|
|
305
|
+
return {
|
|
306
|
+
_tag: error._tag,
|
|
307
|
+
reason: error.reason._tag,
|
|
308
|
+
message: error.message,
|
|
309
|
+
...(operation === undefined ? {} : { operation }),
|
|
310
|
+
...(requestId === undefined ? {} : { requestId }),
|
|
311
|
+
...(sessionId === undefined ? {} : { sessionId }),
|
|
312
|
+
...(generation === undefined ? {} : { generation: String(generation) }),
|
|
313
|
+
...(outcome === undefined ? {} : { outcome }),
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
//# sourceMappingURL=ReactorError.js.map
|