@urun-sh/core 0.1.47 → 0.2.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/CHANGELOG.md +8 -0
- package/dist/chunk-2TYDFOWI.mjs +7 -0
- package/dist/{chunk-O7ZS2RQJ.mjs → chunk-QTLLNENF.mjs} +5 -5
- package/dist/index.browser.d.mts +321 -0
- package/dist/index.browser.d.ts +321 -0
- package/dist/index.browser.js +7 -0
- package/dist/index.browser.mjs +1 -0
- package/dist/index.d.mts +130 -24
- package/dist/index.d.ts +130 -24
- package/dist/index.js +5 -5
- package/dist/index.mjs +1 -1
- package/dist/internal.browser.d.mts +11 -0
- package/dist/internal.browser.d.ts +11 -0
- package/dist/internal.browser.js +7 -0
- package/dist/internal.browser.mjs +1 -0
- package/dist/internal.d.mts +3 -1
- package/dist/internal.d.ts +3 -1
- package/dist/internal.js +5 -5
- package/dist/internal.mjs +1 -1
- package/dist/{transport-DwP_VpLT.d.mts → stream-data-BQHZia_W.d.mts} +222 -16
- package/dist/{transport-DwP_VpLT.d.ts → stream-data-BQHZia_W.d.ts} +222 -16
- package/package.json +14 -2
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { b as AppOptions, a as App$1, A as AccessTokenOptions, R as Recording, z as SessionDocument, j as DocConnector, H as SessionText, y as Session$1, C as ChannelEndpoint, T as TransportSession, c as AttachOptions, B as SessionPhase, u as RecordingsAccessor, G as SessionStream$1, N as StreamDataTransport, K as StreamChunkOptions, g as ChunkReadable, P as Presence, v as RequestOptions, w as RequestStreamOptions, J as StoreOptions, I as Store, e as ChannelMultiplexer } from './stream-data-BQHZia_W.mjs';
|
|
2
|
+
export { L as Layer, k as LayoutConfig, l as LayoutContext, M as MediaChunkBinding, n as MediaChunkSource, o as MediaChunkSourceFactory, p as MediaRecorderChunkSourceOptions, q as PresenceState, r as RecordingBucket, s as RecordingLifecycle, t as RecordingStatus, S as SceneContext, x as SceneGraph, E as SessionPhaseName, Q as TransportState, X as isPendingRecording, Y as mediaRecorderChunkSource } from './stream-data-BQHZia_W.mjs';
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
import { Awareness } from 'y-protocols/awareness';
|
|
5
|
+
|
|
6
|
+
declare function App(appId: string, options: AppOptions): App$1;
|
|
7
|
+
|
|
8
|
+
interface RecordingsClientOptions {
|
|
9
|
+
|
|
10
|
+
functionsUrl: string;
|
|
11
|
+
|
|
12
|
+
orgId: string;
|
|
13
|
+
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
|
|
16
|
+
jwt?: string;
|
|
17
|
+
|
|
18
|
+
getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
|
|
19
|
+
|
|
20
|
+
authProvider?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare class RecordingsError extends Error {
|
|
24
|
+
|
|
25
|
+
readonly status: number;
|
|
26
|
+
|
|
27
|
+
readonly code: string;
|
|
28
|
+
constructor(message: string, options: {
|
|
29
|
+
status: number;
|
|
30
|
+
code: string;
|
|
31
|
+
cause?: unknown;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class RecordingsUnauthorizedError extends RecordingsError {
|
|
36
|
+
constructor(message?: string, code?: string);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class RecordingNotFoundError extends RecordingsError {
|
|
40
|
+
constructor(message?: string, code?: string);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class RetainNotTempError extends RecordingsError {
|
|
44
|
+
constructor(message?: string, code?: string);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare class PinRequiresActiveTempError extends RecordingsError {
|
|
48
|
+
constructor(message?: string, code?: string);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare class PermanentLockedError extends RecordingsError {
|
|
52
|
+
constructor(message?: string, code?: string);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare class InvalidDurationError extends RecordingsError {
|
|
56
|
+
constructor(message?: string, code?: string, status?: number);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare function isDurationString(value: string): boolean;
|
|
60
|
+
|
|
61
|
+
type RetentionIntent = {
|
|
62
|
+
action: 'retain';
|
|
63
|
+
duration: string;
|
|
64
|
+
} | {
|
|
65
|
+
action: 'pin';
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare function normalizeRetention(value: string): RetentionIntent;
|
|
69
|
+
|
|
70
|
+
declare class RecordingsClient {
|
|
71
|
+
private readonly _options;
|
|
72
|
+
private readonly _base;
|
|
73
|
+
constructor(_options: RecordingsClientOptions);
|
|
74
|
+
|
|
75
|
+
list(sessionId?: string): Promise<Recording[]>;
|
|
76
|
+
|
|
77
|
+
get(id: string): Promise<Recording>;
|
|
78
|
+
|
|
79
|
+
retain(id: string, duration: string): Promise<Recording>;
|
|
80
|
+
|
|
81
|
+
pin(id: string): Promise<Recording>;
|
|
82
|
+
|
|
83
|
+
unpin(id: string): Promise<Recording>;
|
|
84
|
+
|
|
85
|
+
permanent(id: string): Promise<Recording>;
|
|
86
|
+
|
|
87
|
+
delete(id: string): Promise<Recording>;
|
|
88
|
+
private _one;
|
|
89
|
+
|
|
90
|
+
private _request;
|
|
91
|
+
private _buildUrl;
|
|
92
|
+
private _fetch;
|
|
93
|
+
private _resolveToken;
|
|
94
|
+
private _readJson;
|
|
95
|
+
private _readError;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare function createRecordingsClient(options: RecordingsClientOptions): RecordingsClient;
|
|
99
|
+
|
|
100
|
+
declare class SessionDocumentImpl implements SessionDocument {
|
|
101
|
+
private _doc;
|
|
102
|
+
private _root;
|
|
103
|
+
private _awareness;
|
|
104
|
+
private _listeners;
|
|
105
|
+
private _key;
|
|
106
|
+
private _sessionId;
|
|
107
|
+
private _connection;
|
|
108
|
+
private _connUnsub;
|
|
109
|
+
|
|
110
|
+
private _synced;
|
|
111
|
+
|
|
112
|
+
private _syncWaiters;
|
|
113
|
+
|
|
114
|
+
private _texts;
|
|
115
|
+
private _observer;
|
|
116
|
+
constructor(key: string, sessionId: string, connector?: DocConnector | null);
|
|
117
|
+
|
|
118
|
+
get awareness(): Awareness;
|
|
119
|
+
|
|
120
|
+
setSessionId(sessionId: string): void;
|
|
121
|
+
|
|
122
|
+
get synced(): boolean;
|
|
123
|
+
|
|
124
|
+
onSynced(handler: () => void): () => void;
|
|
125
|
+
|
|
126
|
+
set(patch: Record<string, unknown>): void;
|
|
127
|
+
get(path?: string, defaultValue?: unknown): unknown;
|
|
128
|
+
on(event: 'change', handler: (snap: Record<string, unknown>) => void): () => void;
|
|
129
|
+
|
|
130
|
+
text(field: string): SessionTextImpl;
|
|
131
|
+
dispose(): void;
|
|
132
|
+
private _markSynced;
|
|
133
|
+
|
|
134
|
+
private applyPatch;
|
|
135
|
+
private snapshot;
|
|
136
|
+
private notify;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare class SessionTextImpl implements SessionText {
|
|
140
|
+
private _ytext;
|
|
141
|
+
private _delta;
|
|
142
|
+
private _observer;
|
|
143
|
+
constructor(_ytext: Y.Text);
|
|
144
|
+
append(text: string): void;
|
|
145
|
+
toString(): string;
|
|
146
|
+
get length(): number;
|
|
147
|
+
on(event: 'delta', handler: (inserted: string) => void): () => void;
|
|
148
|
+
dispose(): void;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare const DEFAULT_DOC_SYNC_TIMEOUT_MS = 30000;
|
|
152
|
+
declare class SessionStream implements SessionStream$1 {
|
|
153
|
+
private _name;
|
|
154
|
+
private _transport;
|
|
155
|
+
|
|
156
|
+
private _streamData?;
|
|
157
|
+
|
|
158
|
+
private _controlDoc?;
|
|
159
|
+
private _track;
|
|
160
|
+
private _handlers;
|
|
161
|
+
private _unsubscribeTransport;
|
|
162
|
+
|
|
163
|
+
private _subscribed;
|
|
164
|
+
|
|
165
|
+
private _messageConsumers;
|
|
166
|
+
|
|
167
|
+
private _dataUnsub;
|
|
168
|
+
|
|
169
|
+
private _replay;
|
|
170
|
+
private _disposed;
|
|
171
|
+
constructor(_name: string, _transport: TransportSession,
|
|
172
|
+
|
|
173
|
+
_streamData?: StreamDataTransport | undefined,
|
|
174
|
+
|
|
175
|
+
_controlDoc?: (() => SessionDocumentImpl) | undefined);
|
|
176
|
+
|
|
177
|
+
messages(): AsyncIterable<unknown>;
|
|
178
|
+
|
|
179
|
+
private _ensureSubscribed;
|
|
180
|
+
|
|
181
|
+
private _deliver;
|
|
182
|
+
get track(): MediaStreamTrack | null;
|
|
183
|
+
|
|
184
|
+
private _claimBrowserProducer;
|
|
185
|
+
attach(track: MediaStreamTrack): Promise<void>;
|
|
186
|
+
|
|
187
|
+
attachVideo(track: MediaStreamTrack): Promise<void>;
|
|
188
|
+
|
|
189
|
+
emit(payload: unknown, options?: {
|
|
190
|
+
to?: string;
|
|
191
|
+
}): Promise<void>;
|
|
192
|
+
detach(): Promise<void>;
|
|
193
|
+
|
|
194
|
+
detachVideo(): Promise<void>;
|
|
195
|
+
seek(target: number | 'live'): Promise<void>;
|
|
196
|
+
|
|
197
|
+
chunks(options?: StreamChunkOptions): ChunkReadable;
|
|
198
|
+
|
|
199
|
+
onSeeked(handler: (target: number | 'live') => void): () => void;
|
|
200
|
+
on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
|
|
201
|
+
dispose(): void;
|
|
202
|
+
private _setTrack;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare class Session implements Session$1 {
|
|
206
|
+
private _sessionId;
|
|
207
|
+
private _multiplexer;
|
|
208
|
+
private _transport;
|
|
209
|
+
private _docs;
|
|
210
|
+
private _streams;
|
|
211
|
+
|
|
212
|
+
private _docConnector;
|
|
213
|
+
|
|
214
|
+
private _streamData;
|
|
215
|
+
|
|
216
|
+
private _presence;
|
|
217
|
+
|
|
218
|
+
private _activeRequests;
|
|
219
|
+
|
|
220
|
+
private _recordingsAuth?;
|
|
221
|
+
|
|
222
|
+
private _recordingsAccessor;
|
|
223
|
+
constructor(sessionId: string, multiplexer: ChannelEndpoint, transport: TransportSession, recordingsAuth?: RecordingsClientOptions);
|
|
224
|
+
private _wireControlDocIncarnation;
|
|
225
|
+
|
|
226
|
+
static attach(sessionId: string, options: AttachOptions): Promise<Session>;
|
|
227
|
+
get id(): string;
|
|
228
|
+
|
|
229
|
+
get phase(): SessionPhase;
|
|
230
|
+
|
|
231
|
+
onPhase(handler: (phase: SessionPhase) => void): () => void;
|
|
232
|
+
|
|
233
|
+
get recordings(): RecordingsAccessor;
|
|
234
|
+
setSessionId(sessionId: string): void;
|
|
235
|
+
stream(name: string): SessionStream;
|
|
236
|
+
|
|
237
|
+
doc(key: string): SessionDocumentImpl;
|
|
238
|
+
|
|
239
|
+
get presence(): Presence;
|
|
240
|
+
|
|
241
|
+
connectDocs(connector: DocConnector): void;
|
|
242
|
+
|
|
243
|
+
setDocTransport(opts: {
|
|
244
|
+
wsUrl: string;
|
|
245
|
+
token?: string;
|
|
246
|
+
webSocket?: typeof WebSocket;
|
|
247
|
+
}): void;
|
|
248
|
+
|
|
249
|
+
useStreamDataTransport(transport: StreamDataTransport): void;
|
|
250
|
+
|
|
251
|
+
sendImage(value: string): Promise<unknown>;
|
|
252
|
+
|
|
253
|
+
sendImageLegacyDesired(value: string): void;
|
|
254
|
+
|
|
255
|
+
request(payload: unknown, options?: RequestOptions): Promise<unknown>;
|
|
256
|
+
|
|
257
|
+
private _consumeResponse;
|
|
258
|
+
|
|
259
|
+
requestStream(payload: unknown, options?: RequestStreamOptions): AsyncIterable<string>;
|
|
260
|
+
|
|
261
|
+
complete(payload: unknown, options?: RequestStreamOptions): Promise<unknown>;
|
|
262
|
+
disconnect(): void;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
declare function createStore(options: StoreOptions): Store & {
|
|
266
|
+
_getInternals(): {
|
|
267
|
+
multiplexer: ChannelMultiplexer;
|
|
268
|
+
ws: WebSocket;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
interface VideoStreamOptions {
|
|
273
|
+
|
|
274
|
+
codec?: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare function videoStream(source: ReadableStream<Uint8Array>, options?: VideoStreamOptions): MediaStream;
|
|
278
|
+
|
|
279
|
+
declare class RequestError extends Error {
|
|
280
|
+
|
|
281
|
+
readonly requestId?: string;
|
|
282
|
+
|
|
283
|
+
readonly code?: string;
|
|
284
|
+
constructor(message: string, options?: {
|
|
285
|
+
requestId?: string;
|
|
286
|
+
code?: string;
|
|
287
|
+
cause?: unknown;
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare class RequestTimeoutError extends RequestError {
|
|
292
|
+
|
|
293
|
+
readonly timeoutMs: number;
|
|
294
|
+
constructor(timeoutMs: number, requestId?: string);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
declare class RequestDocSyncError extends RequestError {
|
|
298
|
+
|
|
299
|
+
readonly timeoutMs: number;
|
|
300
|
+
constructor(timeoutMs: number, requestId?: string);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
declare class StreamDirectionConflict extends Error {
|
|
304
|
+
|
|
305
|
+
readonly stream: string;
|
|
306
|
+
|
|
307
|
+
readonly owner: 'runtime' | 'browser';
|
|
308
|
+
|
|
309
|
+
readonly attempted: 'runtime' | 'browser';
|
|
310
|
+
constructor(stream: string, owner: 'runtime' | 'browser', attempted: 'runtime' | 'browser');
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
declare class RequestAbortError extends RequestError {
|
|
314
|
+
constructor(requestId?: string);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
declare class RequestCancelledError extends RequestError {
|
|
318
|
+
constructor(requestId?: string);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export { App, App$1 as AppInterface, AppOptions, AttachOptions, ChunkReadable, DEFAULT_DOC_SYNC_TIMEOUT_MS, InvalidDurationError, PermanentLockedError, PinRequiresActiveTempError, Presence, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, Session, SessionDocument, Session$1 as SessionInterface, SessionPhase, SessionStream$1 as SessionStream, SessionText, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type VideoStreamOptions, createRecordingsClient, createStore, isDurationString, normalizeRetention, videoStream };
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { b as AppOptions, a as App$1, A as AccessTokenOptions, R as Recording, z as SessionDocument, j as DocConnector, H as SessionText, y as Session$1, C as ChannelEndpoint, T as TransportSession, c as AttachOptions, B as SessionPhase, u as RecordingsAccessor, G as SessionStream$1, N as StreamDataTransport, K as StreamChunkOptions, g as ChunkReadable, P as Presence, v as RequestOptions, w as RequestStreamOptions, J as StoreOptions, I as Store, e as ChannelMultiplexer } from './stream-data-BQHZia_W.js';
|
|
2
|
+
export { L as Layer, k as LayoutConfig, l as LayoutContext, M as MediaChunkBinding, n as MediaChunkSource, o as MediaChunkSourceFactory, p as MediaRecorderChunkSourceOptions, q as PresenceState, r as RecordingBucket, s as RecordingLifecycle, t as RecordingStatus, S as SceneContext, x as SceneGraph, E as SessionPhaseName, Q as TransportState, X as isPendingRecording, Y as mediaRecorderChunkSource } from './stream-data-BQHZia_W.js';
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
import { Awareness } from 'y-protocols/awareness';
|
|
5
|
+
|
|
6
|
+
declare function App(appId: string, options: AppOptions): App$1;
|
|
7
|
+
|
|
8
|
+
interface RecordingsClientOptions {
|
|
9
|
+
|
|
10
|
+
functionsUrl: string;
|
|
11
|
+
|
|
12
|
+
orgId: string;
|
|
13
|
+
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
|
|
16
|
+
jwt?: string;
|
|
17
|
+
|
|
18
|
+
getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
|
|
19
|
+
|
|
20
|
+
authProvider?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare class RecordingsError extends Error {
|
|
24
|
+
|
|
25
|
+
readonly status: number;
|
|
26
|
+
|
|
27
|
+
readonly code: string;
|
|
28
|
+
constructor(message: string, options: {
|
|
29
|
+
status: number;
|
|
30
|
+
code: string;
|
|
31
|
+
cause?: unknown;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class RecordingsUnauthorizedError extends RecordingsError {
|
|
36
|
+
constructor(message?: string, code?: string);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class RecordingNotFoundError extends RecordingsError {
|
|
40
|
+
constructor(message?: string, code?: string);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class RetainNotTempError extends RecordingsError {
|
|
44
|
+
constructor(message?: string, code?: string);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare class PinRequiresActiveTempError extends RecordingsError {
|
|
48
|
+
constructor(message?: string, code?: string);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare class PermanentLockedError extends RecordingsError {
|
|
52
|
+
constructor(message?: string, code?: string);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare class InvalidDurationError extends RecordingsError {
|
|
56
|
+
constructor(message?: string, code?: string, status?: number);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare function isDurationString(value: string): boolean;
|
|
60
|
+
|
|
61
|
+
type RetentionIntent = {
|
|
62
|
+
action: 'retain';
|
|
63
|
+
duration: string;
|
|
64
|
+
} | {
|
|
65
|
+
action: 'pin';
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare function normalizeRetention(value: string): RetentionIntent;
|
|
69
|
+
|
|
70
|
+
declare class RecordingsClient {
|
|
71
|
+
private readonly _options;
|
|
72
|
+
private readonly _base;
|
|
73
|
+
constructor(_options: RecordingsClientOptions);
|
|
74
|
+
|
|
75
|
+
list(sessionId?: string): Promise<Recording[]>;
|
|
76
|
+
|
|
77
|
+
get(id: string): Promise<Recording>;
|
|
78
|
+
|
|
79
|
+
retain(id: string, duration: string): Promise<Recording>;
|
|
80
|
+
|
|
81
|
+
pin(id: string): Promise<Recording>;
|
|
82
|
+
|
|
83
|
+
unpin(id: string): Promise<Recording>;
|
|
84
|
+
|
|
85
|
+
permanent(id: string): Promise<Recording>;
|
|
86
|
+
|
|
87
|
+
delete(id: string): Promise<Recording>;
|
|
88
|
+
private _one;
|
|
89
|
+
|
|
90
|
+
private _request;
|
|
91
|
+
private _buildUrl;
|
|
92
|
+
private _fetch;
|
|
93
|
+
private _resolveToken;
|
|
94
|
+
private _readJson;
|
|
95
|
+
private _readError;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare function createRecordingsClient(options: RecordingsClientOptions): RecordingsClient;
|
|
99
|
+
|
|
100
|
+
declare class SessionDocumentImpl implements SessionDocument {
|
|
101
|
+
private _doc;
|
|
102
|
+
private _root;
|
|
103
|
+
private _awareness;
|
|
104
|
+
private _listeners;
|
|
105
|
+
private _key;
|
|
106
|
+
private _sessionId;
|
|
107
|
+
private _connection;
|
|
108
|
+
private _connUnsub;
|
|
109
|
+
|
|
110
|
+
private _synced;
|
|
111
|
+
|
|
112
|
+
private _syncWaiters;
|
|
113
|
+
|
|
114
|
+
private _texts;
|
|
115
|
+
private _observer;
|
|
116
|
+
constructor(key: string, sessionId: string, connector?: DocConnector | null);
|
|
117
|
+
|
|
118
|
+
get awareness(): Awareness;
|
|
119
|
+
|
|
120
|
+
setSessionId(sessionId: string): void;
|
|
121
|
+
|
|
122
|
+
get synced(): boolean;
|
|
123
|
+
|
|
124
|
+
onSynced(handler: () => void): () => void;
|
|
125
|
+
|
|
126
|
+
set(patch: Record<string, unknown>): void;
|
|
127
|
+
get(path?: string, defaultValue?: unknown): unknown;
|
|
128
|
+
on(event: 'change', handler: (snap: Record<string, unknown>) => void): () => void;
|
|
129
|
+
|
|
130
|
+
text(field: string): SessionTextImpl;
|
|
131
|
+
dispose(): void;
|
|
132
|
+
private _markSynced;
|
|
133
|
+
|
|
134
|
+
private applyPatch;
|
|
135
|
+
private snapshot;
|
|
136
|
+
private notify;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare class SessionTextImpl implements SessionText {
|
|
140
|
+
private _ytext;
|
|
141
|
+
private _delta;
|
|
142
|
+
private _observer;
|
|
143
|
+
constructor(_ytext: Y.Text);
|
|
144
|
+
append(text: string): void;
|
|
145
|
+
toString(): string;
|
|
146
|
+
get length(): number;
|
|
147
|
+
on(event: 'delta', handler: (inserted: string) => void): () => void;
|
|
148
|
+
dispose(): void;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare const DEFAULT_DOC_SYNC_TIMEOUT_MS = 30000;
|
|
152
|
+
declare class SessionStream implements SessionStream$1 {
|
|
153
|
+
private _name;
|
|
154
|
+
private _transport;
|
|
155
|
+
|
|
156
|
+
private _streamData?;
|
|
157
|
+
|
|
158
|
+
private _controlDoc?;
|
|
159
|
+
private _track;
|
|
160
|
+
private _handlers;
|
|
161
|
+
private _unsubscribeTransport;
|
|
162
|
+
|
|
163
|
+
private _subscribed;
|
|
164
|
+
|
|
165
|
+
private _messageConsumers;
|
|
166
|
+
|
|
167
|
+
private _dataUnsub;
|
|
168
|
+
|
|
169
|
+
private _replay;
|
|
170
|
+
private _disposed;
|
|
171
|
+
constructor(_name: string, _transport: TransportSession,
|
|
172
|
+
|
|
173
|
+
_streamData?: StreamDataTransport | undefined,
|
|
174
|
+
|
|
175
|
+
_controlDoc?: (() => SessionDocumentImpl) | undefined);
|
|
176
|
+
|
|
177
|
+
messages(): AsyncIterable<unknown>;
|
|
178
|
+
|
|
179
|
+
private _ensureSubscribed;
|
|
180
|
+
|
|
181
|
+
private _deliver;
|
|
182
|
+
get track(): MediaStreamTrack | null;
|
|
183
|
+
|
|
184
|
+
private _claimBrowserProducer;
|
|
185
|
+
attach(track: MediaStreamTrack): Promise<void>;
|
|
186
|
+
|
|
187
|
+
attachVideo(track: MediaStreamTrack): Promise<void>;
|
|
188
|
+
|
|
189
|
+
emit(payload: unknown, options?: {
|
|
190
|
+
to?: string;
|
|
191
|
+
}): Promise<void>;
|
|
192
|
+
detach(): Promise<void>;
|
|
193
|
+
|
|
194
|
+
detachVideo(): Promise<void>;
|
|
195
|
+
seek(target: number | 'live'): Promise<void>;
|
|
196
|
+
|
|
197
|
+
chunks(options?: StreamChunkOptions): ChunkReadable;
|
|
198
|
+
|
|
199
|
+
onSeeked(handler: (target: number | 'live') => void): () => void;
|
|
200
|
+
on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
|
|
201
|
+
dispose(): void;
|
|
202
|
+
private _setTrack;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare class Session implements Session$1 {
|
|
206
|
+
private _sessionId;
|
|
207
|
+
private _multiplexer;
|
|
208
|
+
private _transport;
|
|
209
|
+
private _docs;
|
|
210
|
+
private _streams;
|
|
211
|
+
|
|
212
|
+
private _docConnector;
|
|
213
|
+
|
|
214
|
+
private _streamData;
|
|
215
|
+
|
|
216
|
+
private _presence;
|
|
217
|
+
|
|
218
|
+
private _activeRequests;
|
|
219
|
+
|
|
220
|
+
private _recordingsAuth?;
|
|
221
|
+
|
|
222
|
+
private _recordingsAccessor;
|
|
223
|
+
constructor(sessionId: string, multiplexer: ChannelEndpoint, transport: TransportSession, recordingsAuth?: RecordingsClientOptions);
|
|
224
|
+
private _wireControlDocIncarnation;
|
|
225
|
+
|
|
226
|
+
static attach(sessionId: string, options: AttachOptions): Promise<Session>;
|
|
227
|
+
get id(): string;
|
|
228
|
+
|
|
229
|
+
get phase(): SessionPhase;
|
|
230
|
+
|
|
231
|
+
onPhase(handler: (phase: SessionPhase) => void): () => void;
|
|
232
|
+
|
|
233
|
+
get recordings(): RecordingsAccessor;
|
|
234
|
+
setSessionId(sessionId: string): void;
|
|
235
|
+
stream(name: string): SessionStream;
|
|
236
|
+
|
|
237
|
+
doc(key: string): SessionDocumentImpl;
|
|
238
|
+
|
|
239
|
+
get presence(): Presence;
|
|
240
|
+
|
|
241
|
+
connectDocs(connector: DocConnector): void;
|
|
242
|
+
|
|
243
|
+
setDocTransport(opts: {
|
|
244
|
+
wsUrl: string;
|
|
245
|
+
token?: string;
|
|
246
|
+
webSocket?: typeof WebSocket;
|
|
247
|
+
}): void;
|
|
248
|
+
|
|
249
|
+
useStreamDataTransport(transport: StreamDataTransport): void;
|
|
250
|
+
|
|
251
|
+
sendImage(value: string): Promise<unknown>;
|
|
252
|
+
|
|
253
|
+
sendImageLegacyDesired(value: string): void;
|
|
254
|
+
|
|
255
|
+
request(payload: unknown, options?: RequestOptions): Promise<unknown>;
|
|
256
|
+
|
|
257
|
+
private _consumeResponse;
|
|
258
|
+
|
|
259
|
+
requestStream(payload: unknown, options?: RequestStreamOptions): AsyncIterable<string>;
|
|
260
|
+
|
|
261
|
+
complete(payload: unknown, options?: RequestStreamOptions): Promise<unknown>;
|
|
262
|
+
disconnect(): void;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
declare function createStore(options: StoreOptions): Store & {
|
|
266
|
+
_getInternals(): {
|
|
267
|
+
multiplexer: ChannelMultiplexer;
|
|
268
|
+
ws: WebSocket;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
interface VideoStreamOptions {
|
|
273
|
+
|
|
274
|
+
codec?: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare function videoStream(source: ReadableStream<Uint8Array>, options?: VideoStreamOptions): MediaStream;
|
|
278
|
+
|
|
279
|
+
declare class RequestError extends Error {
|
|
280
|
+
|
|
281
|
+
readonly requestId?: string;
|
|
282
|
+
|
|
283
|
+
readonly code?: string;
|
|
284
|
+
constructor(message: string, options?: {
|
|
285
|
+
requestId?: string;
|
|
286
|
+
code?: string;
|
|
287
|
+
cause?: unknown;
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare class RequestTimeoutError extends RequestError {
|
|
292
|
+
|
|
293
|
+
readonly timeoutMs: number;
|
|
294
|
+
constructor(timeoutMs: number, requestId?: string);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
declare class RequestDocSyncError extends RequestError {
|
|
298
|
+
|
|
299
|
+
readonly timeoutMs: number;
|
|
300
|
+
constructor(timeoutMs: number, requestId?: string);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
declare class StreamDirectionConflict extends Error {
|
|
304
|
+
|
|
305
|
+
readonly stream: string;
|
|
306
|
+
|
|
307
|
+
readonly owner: 'runtime' | 'browser';
|
|
308
|
+
|
|
309
|
+
readonly attempted: 'runtime' | 'browser';
|
|
310
|
+
constructor(stream: string, owner: 'runtime' | 'browser', attempted: 'runtime' | 'browser');
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
declare class RequestAbortError extends RequestError {
|
|
314
|
+
constructor(requestId?: string);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
declare class RequestCancelledError extends RequestError {
|
|
318
|
+
constructor(requestId?: string);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export { App, App$1 as AppInterface, AppOptions, AttachOptions, ChunkReadable, DEFAULT_DOC_SYNC_TIMEOUT_MS, InvalidDurationError, PermanentLockedError, PinRequiresActiveTempError, Presence, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, Session, SessionDocument, Session$1 as SessionInterface, SessionPhase, SessionStream$1 as SessionStream, SessionText, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type VideoStreamOptions, createRecordingsClient, createStore, isDurationString, normalizeRetention, videoStream };
|