@reactor-team/js-sdk 2.11.2 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.mts +113 -10
- package/dist/index.d.ts +113 -10
- package/dist/index.js +489 -705
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +475 -690
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -219,7 +219,7 @@ For models with a published typed SDK, prefer [`@reactor-models/<name>`](https:/
|
|
|
219
219
|
| Surface | Where it lives |
|
|
220
220
|
| -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
221
221
|
| `Reactor` | [Reactor class](https://docs.reactor.inc/api-reference/reactor-class) |
|
|
222
|
-
| `<ReactorProvider>`, `<ReactorView>`, `<WebcamStream
|
|
222
|
+
| `<ReactorProvider>`, `<ReactorView>`, `<WebcamStream>` | [React components](https://docs.reactor.inc/api-reference/react-components) |
|
|
223
223
|
| `useReactor`, `useReactorMessage`, `useStats` | [React hooks](https://docs.reactor.inc/api-reference/react-hooks) |
|
|
224
224
|
| `<ClipPlayer>`, `<ClipDownloadButton>`, `useClipDownload`, `RecordingClient`, `RecordingError`, `fetchPlaylist`, `parsePlaylist` | [Recordings](https://docs.reactor.inc/concepts/recordings) |
|
|
225
225
|
|
package/dist/index.d.mts
CHANGED
|
@@ -85,6 +85,52 @@ type TrackCapability = z.infer<typeof TrackCapabilitySchema>;
|
|
|
85
85
|
type CommandCapability = z.infer<typeof CommandCapabilitySchema>;
|
|
86
86
|
type SessionResponse = z.infer<typeof SessionResponseSchema>;
|
|
87
87
|
type Capabilities = z.infer<typeof CapabilitiesSchema>;
|
|
88
|
+
/** One OpenAPI operation (the `post` of an event/webhook path item). */
|
|
89
|
+
interface ModelSchemaOperation {
|
|
90
|
+
operationId?: string;
|
|
91
|
+
summary?: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
requestBody?: {
|
|
94
|
+
required?: boolean;
|
|
95
|
+
content?: Record<string, {
|
|
96
|
+
schema?: Record<string, unknown>;
|
|
97
|
+
}>;
|
|
98
|
+
};
|
|
99
|
+
responses?: Record<string, unknown>;
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
}
|
|
102
|
+
/** An OpenAPI path item; the runtime only populates `post`. */
|
|
103
|
+
interface ModelSchemaPathItem {
|
|
104
|
+
post?: ModelSchemaOperation;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The model's OpenAPI 3.1 schema, returned by the runtime in response to a
|
|
109
|
+
* `requestSchema` runtime-channel command. This is a pass-through of the
|
|
110
|
+
* runtime's document, not a shape the SDK reshapes: client-triggerable
|
|
111
|
+
* events live under `paths` as `POST /events/<name>` operations, outbound
|
|
112
|
+
* model messages under `webhooks`, and media tracks under `x-reactor.tracks`.
|
|
113
|
+
* Read the parts you need.
|
|
114
|
+
*/
|
|
115
|
+
interface ModelSchema {
|
|
116
|
+
openapi: string;
|
|
117
|
+
info: {
|
|
118
|
+
title: string;
|
|
119
|
+
version: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
};
|
|
122
|
+
paths?: Record<string, ModelSchemaPathItem>;
|
|
123
|
+
webhooks?: Record<string, ModelSchemaPathItem>;
|
|
124
|
+
"x-reactor"?: {
|
|
125
|
+
tracks?: Array<{
|
|
126
|
+
name: string;
|
|
127
|
+
kind: string;
|
|
128
|
+
direction: string;
|
|
129
|
+
}>;
|
|
130
|
+
};
|
|
131
|
+
components?: Record<string, unknown>;
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}
|
|
88
134
|
|
|
89
135
|
/**
|
|
90
136
|
* Reference to an uploaded file, returned by {@link Reactor.uploadFile}.
|
|
@@ -136,6 +182,16 @@ interface ReactorState$1 {
|
|
|
136
182
|
interface ConnectOptions {
|
|
137
183
|
/** Maximum number of SDP polling attempts before giving up. Default: 6. */
|
|
138
184
|
maxAttempts?: number;
|
|
185
|
+
/**
|
|
186
|
+
* When true (default), sends `resume_track` for every recvonly track
|
|
187
|
+
* immediately after the connection is established, causing the backend to
|
|
188
|
+
* begin streaming those tracks — this preserves the pre-multi-connection
|
|
189
|
+
* behaviour where output tracks flow automatically on connect. Set to false
|
|
190
|
+
* to keep recvonly tracks paused on connect and resume them individually via
|
|
191
|
+
* `resumeTrack()` (e.g. multi-connection apps that only subscribe to a
|
|
192
|
+
* subset of peers).
|
|
193
|
+
*/
|
|
194
|
+
autoResumeTracks?: boolean;
|
|
139
195
|
/**
|
|
140
196
|
* Attach to a session that already exists (e.g. one created by a backend)
|
|
141
197
|
* instead of creating a new one. When set, `connect()` skips `POST /sessions`
|
|
@@ -143,6 +199,18 @@ interface ConnectOptions {
|
|
|
143
199
|
* `connect()` must be valid for the account that owns the session.
|
|
144
200
|
*/
|
|
145
201
|
sessionId?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Use a specific WebRTC connection id instead of minting one. When omitted
|
|
204
|
+
* (default), the transport registers a fresh connection (`POST .../connections`)
|
|
205
|
+
* and the server mints the id. When set, the transport skips registration and
|
|
206
|
+
* sends its SDP offer directly to that connection — so the id must already have
|
|
207
|
+
* been registered under this session (e.g. a backend called `POST .../connections`
|
|
208
|
+
* and handed the id to this client) and must still be open.
|
|
209
|
+
*
|
|
210
|
+
* `connect()` rejects if the id is invalid (out of the server's accepted range)
|
|
211
|
+
* or if no open connection with that id exists for the session.
|
|
212
|
+
*/
|
|
213
|
+
connectionId?: number;
|
|
146
214
|
}
|
|
147
215
|
/**
|
|
148
216
|
* Transport-agnostic timing breakdown of the connect() handshake, recorded
|
|
@@ -183,7 +251,7 @@ interface ConnectionStats {
|
|
|
183
251
|
connectionTimings?: ConnectionTimings;
|
|
184
252
|
timestamp: number;
|
|
185
253
|
}
|
|
186
|
-
type ReactorEvent = "statusChanged" | "sessionIdChanged" | "message" | "runtimeMessage" | "trackReceived" | "error" | "sessionExpirationChanged" | "
|
|
254
|
+
type ReactorEvent = "statusChanged" | "sessionIdChanged" | "message" | "runtimeMessage" | "trackReceived" | "error" | "sessionExpirationChanged" | "schemaReceived" | "statsUpdate";
|
|
187
255
|
/**
|
|
188
256
|
* Severity tier of a content moderation event delivered as the inner
|
|
189
257
|
* payload of a `runtimeMessage` with `type === "moderation"`.
|
|
@@ -641,11 +709,21 @@ declare class Reactor {
|
|
|
641
709
|
private sessionExpiration?;
|
|
642
710
|
private local;
|
|
643
711
|
private sessionId?;
|
|
712
|
+
/**
|
|
713
|
+
* True only when the active session was created by THIS connect flow
|
|
714
|
+
* (via `createSession()`). False when the session was adopted via
|
|
715
|
+
* `connect({ sessionId })`. We must never DELETE a session we did not
|
|
716
|
+
* create — another client (or the backend that created it) owns its
|
|
717
|
+
* lifecycle, so on disconnect/teardown/error an adopting client tears
|
|
718
|
+
* down its own transport but leaves the session alive.
|
|
719
|
+
*/
|
|
720
|
+
private createdSession;
|
|
644
721
|
private connectStartTime?;
|
|
645
722
|
private connectionTimings?;
|
|
646
|
-
private
|
|
723
|
+
private schema?;
|
|
647
724
|
private tracks;
|
|
648
725
|
private presetTracks?;
|
|
726
|
+
private autoResumeTracks;
|
|
649
727
|
private sessionResponse?;
|
|
650
728
|
private jwtResolver?;
|
|
651
729
|
/** Per-Reactor recording client. See {@link RecordingClient}. */
|
|
@@ -717,6 +795,8 @@ declare class Reactor {
|
|
|
717
795
|
*/
|
|
718
796
|
publishTrack(name: string, track: MediaStreamTrack): Promise<void>;
|
|
719
797
|
unpublishTrack(name: string): Promise<void>;
|
|
798
|
+
pauseTrack(name: string): void;
|
|
799
|
+
resumeTrack(name: string): void;
|
|
720
800
|
/**
|
|
721
801
|
* Reconnects to an existing session with a fresh transport.
|
|
722
802
|
*/
|
|
@@ -748,9 +828,16 @@ declare class Reactor {
|
|
|
748
828
|
getStatus(): ReactorStatus;
|
|
749
829
|
getState(): ReactorState$1;
|
|
750
830
|
getLastError(): ReactorError | undefined;
|
|
751
|
-
|
|
831
|
+
/**
|
|
832
|
+
* The model's OpenAPI schema (events, outbound messages, tracks),
|
|
833
|
+
* received over the runtime channel shortly after the session becomes
|
|
834
|
+
* ready. `undefined` until the `schemaReceived` event has fired.
|
|
835
|
+
*/
|
|
836
|
+
getSchema(): ModelSchema | undefined;
|
|
752
837
|
getSessionInfo(): SessionResponse | undefined;
|
|
753
838
|
getStats(): ConnectionStats | undefined;
|
|
839
|
+
/** Timing breakdown from the most recent connect() handshake. */
|
|
840
|
+
getConnectionTimings(): ConnectionTimings | undefined;
|
|
754
841
|
private setSessionId;
|
|
755
842
|
private setStatus;
|
|
756
843
|
private setSessionExpiration;
|
|
@@ -773,6 +860,13 @@ interface ReactorState {
|
|
|
773
860
|
sessionExpiration?: number;
|
|
774
861
|
/** Token source for Coordinator HTTP calls — see {@link JwtSource}. */
|
|
775
862
|
jwtToken?: JwtSource;
|
|
863
|
+
/**
|
|
864
|
+
* Default connect options set by the provider. Applied as base values
|
|
865
|
+
* whenever `connect()` is called without explicit options, so that
|
|
866
|
+
* provider-level settings like `autoResumeTracks` are honoured for
|
|
867
|
+
* both autoConnect and manual connect calls.
|
|
868
|
+
*/
|
|
869
|
+
connectOptions?: ConnectOptions;
|
|
776
870
|
}
|
|
777
871
|
interface ReactorActions {
|
|
778
872
|
sendCommand(command: string, data: any, scope?: MessageScope): Promise<void>;
|
|
@@ -785,6 +879,19 @@ interface ReactorActions {
|
|
|
785
879
|
disconnect(recoverable?: boolean): Promise<void>;
|
|
786
880
|
publish(name: string, track: MediaStreamTrack): Promise<void>;
|
|
787
881
|
unpublish(name: string): Promise<void>;
|
|
882
|
+
/**
|
|
883
|
+
* Ask the runtime to stop processing a recvonly track. Top-level
|
|
884
|
+
* alias for `internal.reactor.pauseTrack(…)` — lifted onto the store
|
|
885
|
+
* so consumers don't have to reach through `internal.reactor`. See
|
|
886
|
+
* {@link Reactor.pauseTrack}.
|
|
887
|
+
*/
|
|
888
|
+
pauseTrack(name: string): void;
|
|
889
|
+
/**
|
|
890
|
+
* Ask the runtime to resume a previously paused recvonly track.
|
|
891
|
+
* Top-level alias for `internal.reactor.resumeTrack(…)`. See
|
|
892
|
+
* {@link Reactor.resumeTrack}.
|
|
893
|
+
*/
|
|
894
|
+
resumeTrack(name: string): void;
|
|
788
895
|
reconnect(options?: ConnectOptions): Promise<void>;
|
|
789
896
|
uploadFile(file: File | Blob, options?: {
|
|
790
897
|
name?: string;
|
|
@@ -820,6 +927,8 @@ type ReactorStore = ReactorState & ReactorActions & {
|
|
|
820
927
|
interface ReactorInitializationProps extends Options {
|
|
821
928
|
/** Token source for the underlying {@link Reactor} — see {@link JwtSource}. */
|
|
822
929
|
jwtToken?: JwtSource;
|
|
930
|
+
/** Default connect options applied when `connect()` is called without explicit options. */
|
|
931
|
+
connectOptions?: ConnectOptions;
|
|
823
932
|
}
|
|
824
933
|
|
|
825
934
|
/**
|
|
@@ -878,12 +987,6 @@ interface ReactorViewProps {
|
|
|
878
987
|
}
|
|
879
988
|
declare function ReactorView({ track, audioTrack, width, height, className, style, videoObjectFit, muted, }: ReactorViewProps): react_jsx_runtime.JSX.Element;
|
|
880
989
|
|
|
881
|
-
interface ReactorControllerProps {
|
|
882
|
-
className?: string;
|
|
883
|
-
style?: React.CSSProperties;
|
|
884
|
-
}
|
|
885
|
-
declare function ReactorController({ className, style, }: ReactorControllerProps): react_jsx_runtime.JSX.Element;
|
|
886
|
-
|
|
887
990
|
interface WebcamStreamProps {
|
|
888
991
|
/**
|
|
889
992
|
* The name of the sendonly **video** track to publish the webcam to.
|
|
@@ -1223,4 +1326,4 @@ declare function useReactorInternalMessage(handler: (message: any) => void): voi
|
|
|
1223
1326
|
*/
|
|
1224
1327
|
declare function useStats(): ConnectionStats | undefined;
|
|
1225
1328
|
|
|
1226
|
-
export { AbortError, type Capabilities, type Clip, ClipDownloadButton, type ClipDownloadButtonProps, type ClipDownloadState, type ClipFailedPayload, type ClipKind, ClipPlayer, type ClipPlayerProps, type ClipReadyPayload, type CommandCapability, ConflictError, type ConnectOptions, type ConnectionStats, type ConnectionTimings, DEFAULT_BASE_URL, DEFAULT_CLIP_REQUEST_TIMEOUT_MS, DEFAULT_PLAYLIST_POLL_SLACK_MS, type DownloadClipOptions, type FetchPlaylistOptions, FileRef, type JwtResolver, type JwtSource, type MessageScope, type ModerationAction, type ModerationEvent, type Options, type ParseClipOptions, Reactor, type ReactorConnectOptions,
|
|
1329
|
+
export { AbortError, type Capabilities, type Clip, ClipDownloadButton, type ClipDownloadButtonProps, type ClipDownloadState, type ClipFailedPayload, type ClipKind, ClipPlayer, type ClipPlayerProps, type ClipReadyPayload, type CommandCapability, ConflictError, type ConnectOptions, type ConnectionStats, type ConnectionTimings, DEFAULT_BASE_URL, DEFAULT_CLIP_REQUEST_TIMEOUT_MS, DEFAULT_PLAYLIST_POLL_SLACK_MS, type DownloadClipOptions, type FetchPlaylistOptions, FileRef, type JwtResolver, type JwtSource, type MessageScope, type ModelSchema, type ModelSchemaOperation, type ModelSchemaPathItem, type ModerationAction, type ModerationEvent, type Options, type ParseClipOptions, Reactor, type ReactorConnectOptions, type ReactorError, type ReactorEvent, ReactorProvider, type ReactorState$1 as ReactorState, type ReactorStatus, type ReactorStore, ReactorView, type ReactorViewProps, RecordingClient, type RecordingClientHost, RecordingError, RuntimeRecordingMessageType, type SessionResponse, type TrackCapability, type UseClipDownloadOptions, type UseClipDownloadResult, WebcamStream, type WebcamStreamProps, clipFromPayload, createPlayableManifestUrl, downloadClipAsFile, fetchPlaylist, isAbortError, normalizeJwtSource, parsePlaylist, rewriteUrlHost, useClipDownload, useReactor, useReactorInternalMessage, useReactorMessage, useReactorStore, useStats };
|
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,52 @@ type TrackCapability = z.infer<typeof TrackCapabilitySchema>;
|
|
|
85
85
|
type CommandCapability = z.infer<typeof CommandCapabilitySchema>;
|
|
86
86
|
type SessionResponse = z.infer<typeof SessionResponseSchema>;
|
|
87
87
|
type Capabilities = z.infer<typeof CapabilitiesSchema>;
|
|
88
|
+
/** One OpenAPI operation (the `post` of an event/webhook path item). */
|
|
89
|
+
interface ModelSchemaOperation {
|
|
90
|
+
operationId?: string;
|
|
91
|
+
summary?: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
requestBody?: {
|
|
94
|
+
required?: boolean;
|
|
95
|
+
content?: Record<string, {
|
|
96
|
+
schema?: Record<string, unknown>;
|
|
97
|
+
}>;
|
|
98
|
+
};
|
|
99
|
+
responses?: Record<string, unknown>;
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
}
|
|
102
|
+
/** An OpenAPI path item; the runtime only populates `post`. */
|
|
103
|
+
interface ModelSchemaPathItem {
|
|
104
|
+
post?: ModelSchemaOperation;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The model's OpenAPI 3.1 schema, returned by the runtime in response to a
|
|
109
|
+
* `requestSchema` runtime-channel command. This is a pass-through of the
|
|
110
|
+
* runtime's document, not a shape the SDK reshapes: client-triggerable
|
|
111
|
+
* events live under `paths` as `POST /events/<name>` operations, outbound
|
|
112
|
+
* model messages under `webhooks`, and media tracks under `x-reactor.tracks`.
|
|
113
|
+
* Read the parts you need.
|
|
114
|
+
*/
|
|
115
|
+
interface ModelSchema {
|
|
116
|
+
openapi: string;
|
|
117
|
+
info: {
|
|
118
|
+
title: string;
|
|
119
|
+
version: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
};
|
|
122
|
+
paths?: Record<string, ModelSchemaPathItem>;
|
|
123
|
+
webhooks?: Record<string, ModelSchemaPathItem>;
|
|
124
|
+
"x-reactor"?: {
|
|
125
|
+
tracks?: Array<{
|
|
126
|
+
name: string;
|
|
127
|
+
kind: string;
|
|
128
|
+
direction: string;
|
|
129
|
+
}>;
|
|
130
|
+
};
|
|
131
|
+
components?: Record<string, unknown>;
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}
|
|
88
134
|
|
|
89
135
|
/**
|
|
90
136
|
* Reference to an uploaded file, returned by {@link Reactor.uploadFile}.
|
|
@@ -136,6 +182,16 @@ interface ReactorState$1 {
|
|
|
136
182
|
interface ConnectOptions {
|
|
137
183
|
/** Maximum number of SDP polling attempts before giving up. Default: 6. */
|
|
138
184
|
maxAttempts?: number;
|
|
185
|
+
/**
|
|
186
|
+
* When true (default), sends `resume_track` for every recvonly track
|
|
187
|
+
* immediately after the connection is established, causing the backend to
|
|
188
|
+
* begin streaming those tracks — this preserves the pre-multi-connection
|
|
189
|
+
* behaviour where output tracks flow automatically on connect. Set to false
|
|
190
|
+
* to keep recvonly tracks paused on connect and resume them individually via
|
|
191
|
+
* `resumeTrack()` (e.g. multi-connection apps that only subscribe to a
|
|
192
|
+
* subset of peers).
|
|
193
|
+
*/
|
|
194
|
+
autoResumeTracks?: boolean;
|
|
139
195
|
/**
|
|
140
196
|
* Attach to a session that already exists (e.g. one created by a backend)
|
|
141
197
|
* instead of creating a new one. When set, `connect()` skips `POST /sessions`
|
|
@@ -143,6 +199,18 @@ interface ConnectOptions {
|
|
|
143
199
|
* `connect()` must be valid for the account that owns the session.
|
|
144
200
|
*/
|
|
145
201
|
sessionId?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Use a specific WebRTC connection id instead of minting one. When omitted
|
|
204
|
+
* (default), the transport registers a fresh connection (`POST .../connections`)
|
|
205
|
+
* and the server mints the id. When set, the transport skips registration and
|
|
206
|
+
* sends its SDP offer directly to that connection — so the id must already have
|
|
207
|
+
* been registered under this session (e.g. a backend called `POST .../connections`
|
|
208
|
+
* and handed the id to this client) and must still be open.
|
|
209
|
+
*
|
|
210
|
+
* `connect()` rejects if the id is invalid (out of the server's accepted range)
|
|
211
|
+
* or if no open connection with that id exists for the session.
|
|
212
|
+
*/
|
|
213
|
+
connectionId?: number;
|
|
146
214
|
}
|
|
147
215
|
/**
|
|
148
216
|
* Transport-agnostic timing breakdown of the connect() handshake, recorded
|
|
@@ -183,7 +251,7 @@ interface ConnectionStats {
|
|
|
183
251
|
connectionTimings?: ConnectionTimings;
|
|
184
252
|
timestamp: number;
|
|
185
253
|
}
|
|
186
|
-
type ReactorEvent = "statusChanged" | "sessionIdChanged" | "message" | "runtimeMessage" | "trackReceived" | "error" | "sessionExpirationChanged" | "
|
|
254
|
+
type ReactorEvent = "statusChanged" | "sessionIdChanged" | "message" | "runtimeMessage" | "trackReceived" | "error" | "sessionExpirationChanged" | "schemaReceived" | "statsUpdate";
|
|
187
255
|
/**
|
|
188
256
|
* Severity tier of a content moderation event delivered as the inner
|
|
189
257
|
* payload of a `runtimeMessage` with `type === "moderation"`.
|
|
@@ -641,11 +709,21 @@ declare class Reactor {
|
|
|
641
709
|
private sessionExpiration?;
|
|
642
710
|
private local;
|
|
643
711
|
private sessionId?;
|
|
712
|
+
/**
|
|
713
|
+
* True only when the active session was created by THIS connect flow
|
|
714
|
+
* (via `createSession()`). False when the session was adopted via
|
|
715
|
+
* `connect({ sessionId })`. We must never DELETE a session we did not
|
|
716
|
+
* create — another client (or the backend that created it) owns its
|
|
717
|
+
* lifecycle, so on disconnect/teardown/error an adopting client tears
|
|
718
|
+
* down its own transport but leaves the session alive.
|
|
719
|
+
*/
|
|
720
|
+
private createdSession;
|
|
644
721
|
private connectStartTime?;
|
|
645
722
|
private connectionTimings?;
|
|
646
|
-
private
|
|
723
|
+
private schema?;
|
|
647
724
|
private tracks;
|
|
648
725
|
private presetTracks?;
|
|
726
|
+
private autoResumeTracks;
|
|
649
727
|
private sessionResponse?;
|
|
650
728
|
private jwtResolver?;
|
|
651
729
|
/** Per-Reactor recording client. See {@link RecordingClient}. */
|
|
@@ -717,6 +795,8 @@ declare class Reactor {
|
|
|
717
795
|
*/
|
|
718
796
|
publishTrack(name: string, track: MediaStreamTrack): Promise<void>;
|
|
719
797
|
unpublishTrack(name: string): Promise<void>;
|
|
798
|
+
pauseTrack(name: string): void;
|
|
799
|
+
resumeTrack(name: string): void;
|
|
720
800
|
/**
|
|
721
801
|
* Reconnects to an existing session with a fresh transport.
|
|
722
802
|
*/
|
|
@@ -748,9 +828,16 @@ declare class Reactor {
|
|
|
748
828
|
getStatus(): ReactorStatus;
|
|
749
829
|
getState(): ReactorState$1;
|
|
750
830
|
getLastError(): ReactorError | undefined;
|
|
751
|
-
|
|
831
|
+
/**
|
|
832
|
+
* The model's OpenAPI schema (events, outbound messages, tracks),
|
|
833
|
+
* received over the runtime channel shortly after the session becomes
|
|
834
|
+
* ready. `undefined` until the `schemaReceived` event has fired.
|
|
835
|
+
*/
|
|
836
|
+
getSchema(): ModelSchema | undefined;
|
|
752
837
|
getSessionInfo(): SessionResponse | undefined;
|
|
753
838
|
getStats(): ConnectionStats | undefined;
|
|
839
|
+
/** Timing breakdown from the most recent connect() handshake. */
|
|
840
|
+
getConnectionTimings(): ConnectionTimings | undefined;
|
|
754
841
|
private setSessionId;
|
|
755
842
|
private setStatus;
|
|
756
843
|
private setSessionExpiration;
|
|
@@ -773,6 +860,13 @@ interface ReactorState {
|
|
|
773
860
|
sessionExpiration?: number;
|
|
774
861
|
/** Token source for Coordinator HTTP calls — see {@link JwtSource}. */
|
|
775
862
|
jwtToken?: JwtSource;
|
|
863
|
+
/**
|
|
864
|
+
* Default connect options set by the provider. Applied as base values
|
|
865
|
+
* whenever `connect()` is called without explicit options, so that
|
|
866
|
+
* provider-level settings like `autoResumeTracks` are honoured for
|
|
867
|
+
* both autoConnect and manual connect calls.
|
|
868
|
+
*/
|
|
869
|
+
connectOptions?: ConnectOptions;
|
|
776
870
|
}
|
|
777
871
|
interface ReactorActions {
|
|
778
872
|
sendCommand(command: string, data: any, scope?: MessageScope): Promise<void>;
|
|
@@ -785,6 +879,19 @@ interface ReactorActions {
|
|
|
785
879
|
disconnect(recoverable?: boolean): Promise<void>;
|
|
786
880
|
publish(name: string, track: MediaStreamTrack): Promise<void>;
|
|
787
881
|
unpublish(name: string): Promise<void>;
|
|
882
|
+
/**
|
|
883
|
+
* Ask the runtime to stop processing a recvonly track. Top-level
|
|
884
|
+
* alias for `internal.reactor.pauseTrack(…)` — lifted onto the store
|
|
885
|
+
* so consumers don't have to reach through `internal.reactor`. See
|
|
886
|
+
* {@link Reactor.pauseTrack}.
|
|
887
|
+
*/
|
|
888
|
+
pauseTrack(name: string): void;
|
|
889
|
+
/**
|
|
890
|
+
* Ask the runtime to resume a previously paused recvonly track.
|
|
891
|
+
* Top-level alias for `internal.reactor.resumeTrack(…)`. See
|
|
892
|
+
* {@link Reactor.resumeTrack}.
|
|
893
|
+
*/
|
|
894
|
+
resumeTrack(name: string): void;
|
|
788
895
|
reconnect(options?: ConnectOptions): Promise<void>;
|
|
789
896
|
uploadFile(file: File | Blob, options?: {
|
|
790
897
|
name?: string;
|
|
@@ -820,6 +927,8 @@ type ReactorStore = ReactorState & ReactorActions & {
|
|
|
820
927
|
interface ReactorInitializationProps extends Options {
|
|
821
928
|
/** Token source for the underlying {@link Reactor} — see {@link JwtSource}. */
|
|
822
929
|
jwtToken?: JwtSource;
|
|
930
|
+
/** Default connect options applied when `connect()` is called without explicit options. */
|
|
931
|
+
connectOptions?: ConnectOptions;
|
|
823
932
|
}
|
|
824
933
|
|
|
825
934
|
/**
|
|
@@ -878,12 +987,6 @@ interface ReactorViewProps {
|
|
|
878
987
|
}
|
|
879
988
|
declare function ReactorView({ track, audioTrack, width, height, className, style, videoObjectFit, muted, }: ReactorViewProps): react_jsx_runtime.JSX.Element;
|
|
880
989
|
|
|
881
|
-
interface ReactorControllerProps {
|
|
882
|
-
className?: string;
|
|
883
|
-
style?: React.CSSProperties;
|
|
884
|
-
}
|
|
885
|
-
declare function ReactorController({ className, style, }: ReactorControllerProps): react_jsx_runtime.JSX.Element;
|
|
886
|
-
|
|
887
990
|
interface WebcamStreamProps {
|
|
888
991
|
/**
|
|
889
992
|
* The name of the sendonly **video** track to publish the webcam to.
|
|
@@ -1223,4 +1326,4 @@ declare function useReactorInternalMessage(handler: (message: any) => void): voi
|
|
|
1223
1326
|
*/
|
|
1224
1327
|
declare function useStats(): ConnectionStats | undefined;
|
|
1225
1328
|
|
|
1226
|
-
export { AbortError, type Capabilities, type Clip, ClipDownloadButton, type ClipDownloadButtonProps, type ClipDownloadState, type ClipFailedPayload, type ClipKind, ClipPlayer, type ClipPlayerProps, type ClipReadyPayload, type CommandCapability, ConflictError, type ConnectOptions, type ConnectionStats, type ConnectionTimings, DEFAULT_BASE_URL, DEFAULT_CLIP_REQUEST_TIMEOUT_MS, DEFAULT_PLAYLIST_POLL_SLACK_MS, type DownloadClipOptions, type FetchPlaylistOptions, FileRef, type JwtResolver, type JwtSource, type MessageScope, type ModerationAction, type ModerationEvent, type Options, type ParseClipOptions, Reactor, type ReactorConnectOptions,
|
|
1329
|
+
export { AbortError, type Capabilities, type Clip, ClipDownloadButton, type ClipDownloadButtonProps, type ClipDownloadState, type ClipFailedPayload, type ClipKind, ClipPlayer, type ClipPlayerProps, type ClipReadyPayload, type CommandCapability, ConflictError, type ConnectOptions, type ConnectionStats, type ConnectionTimings, DEFAULT_BASE_URL, DEFAULT_CLIP_REQUEST_TIMEOUT_MS, DEFAULT_PLAYLIST_POLL_SLACK_MS, type DownloadClipOptions, type FetchPlaylistOptions, FileRef, type JwtResolver, type JwtSource, type MessageScope, type ModelSchema, type ModelSchemaOperation, type ModelSchemaPathItem, type ModerationAction, type ModerationEvent, type Options, type ParseClipOptions, Reactor, type ReactorConnectOptions, type ReactorError, type ReactorEvent, ReactorProvider, type ReactorState$1 as ReactorState, type ReactorStatus, type ReactorStore, ReactorView, type ReactorViewProps, RecordingClient, type RecordingClientHost, RecordingError, RuntimeRecordingMessageType, type SessionResponse, type TrackCapability, type UseClipDownloadOptions, type UseClipDownloadResult, WebcamStream, type WebcamStreamProps, clipFromPayload, createPlayableManifestUrl, downloadClipAsFile, fetchPlaylist, isAbortError, normalizeJwtSource, parsePlaylist, rewriteUrlHost, useClipDownload, useReactor, useReactorInternalMessage, useReactorMessage, useReactorStore, useStats };
|