@urun-sh/core 0.1.38 → 0.1.39
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/dist/chunk-4O3YOYT6.mjs +7 -0
- package/dist/chunk-FNR7JDXN.mjs +1 -0
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +134 -5
- package/dist/index.mjs +1 -1
- package/dist/internal.d.mts +9 -1
- package/dist/internal.d.ts +9 -1
- package/dist/internal.js +134 -5
- package/dist/internal.mjs +1 -1
- package/dist/lib-RR67JYGM.mjs +130 -0
- package/dist/{internal-CrXsIQMr.d.mts → transport-Cpxx3zGY.d.mts} +28 -2
- package/dist/{internal-CrXsIQMr.d.ts → transport-Cpxx3zGY.d.ts} +28 -2
- package/package.json +5 -5
- package/dist/chunk-LBV7WHPF.mjs +0 -7
|
@@ -37,6 +37,8 @@ interface TransportSessionOptions {
|
|
|
37
37
|
|
|
38
38
|
sessionId?: string;
|
|
39
39
|
|
|
40
|
+
iceServers?: RTCIceServer[];
|
|
41
|
+
|
|
40
42
|
mediaLiveness?: MediaLivenessOptions;
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -176,8 +178,12 @@ interface SessionStream {
|
|
|
176
178
|
|
|
177
179
|
attach(track: MediaStreamTrack): Promise<void>;
|
|
178
180
|
|
|
181
|
+
attachVideo(track: MediaStreamTrack): Promise<void>;
|
|
182
|
+
|
|
179
183
|
detach(): Promise<void>;
|
|
180
184
|
|
|
185
|
+
detachVideo(): Promise<void>;
|
|
186
|
+
|
|
181
187
|
seek(target: number | 'live'): Promise<void>;
|
|
182
188
|
|
|
183
189
|
on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
|
|
@@ -278,11 +284,26 @@ declare class ChannelMultiplexer implements ChannelEndpoint {
|
|
|
278
284
|
private flushPendingSends;
|
|
279
285
|
private listenForOpen;
|
|
280
286
|
}
|
|
287
|
+
declare class DeferredChannelMultiplexer implements ChannelEndpoint {
|
|
288
|
+
private _handlers;
|
|
289
|
+
private _pendingSends;
|
|
290
|
+
private _target;
|
|
291
|
+
private _targetUnsubscribes;
|
|
292
|
+
private _disposed;
|
|
293
|
+
setTarget(target: ChannelEndpoint): void;
|
|
294
|
+
rewriteSessionChannels(oldSessionId: string, newSessionId: string): void;
|
|
295
|
+
on(channel: string, handler: (data: ChannelMessage) => void): () => void;
|
|
296
|
+
emit(channel: string, data: Record<string, unknown>): void;
|
|
297
|
+
dispose(): void;
|
|
298
|
+
private detachTarget;
|
|
299
|
+
}
|
|
281
300
|
|
|
282
301
|
interface TransportConnection {
|
|
283
302
|
url: string;
|
|
284
303
|
sessionId: string;
|
|
285
304
|
jwt?: string;
|
|
305
|
+
|
|
306
|
+
iceServers?: RTCIceServer[];
|
|
286
307
|
}
|
|
287
308
|
|
|
288
309
|
declare function encodeDocSyncFrame(docKey: string, payload: Uint8Array): Uint8Array;
|
|
@@ -335,6 +356,7 @@ declare class TransportSession {
|
|
|
335
356
|
private _sendTransport;
|
|
336
357
|
private _consumers;
|
|
337
358
|
private _audioProducer;
|
|
359
|
+
private _videoProducer;
|
|
338
360
|
private _pendingProduce;
|
|
339
361
|
private _multiplexer;
|
|
340
362
|
private _reconnectAttempts;
|
|
@@ -382,7 +404,7 @@ declare class TransportSession {
|
|
|
382
404
|
getTrackByName(name: string): MediaStreamTrack | undefined;
|
|
383
405
|
setAuth(options: Pick<TransportSessionOptions, 'orgId' | 'jwt' | 'authProvider'>): void;
|
|
384
406
|
constructor(options?: TransportSessionOptions);
|
|
385
|
-
setConnection(options: Pick<TransportSessionOptions, 'url' | 'fallbackUrls' | 'sessionId'>): void;
|
|
407
|
+
setConnection(options: Pick<TransportSessionOptions, 'url' | 'fallbackUrls' | 'sessionId' | 'iceServers'>): void;
|
|
386
408
|
setConnectionResolver(resolveConnection: (() => Promise<TransportConnection>) | null): void;
|
|
387
409
|
|
|
388
410
|
applyControlDocState(state: Record<string, unknown> | null | undefined): void;
|
|
@@ -406,6 +428,10 @@ declare class TransportSession {
|
|
|
406
428
|
private _emitDocSyncFrame;
|
|
407
429
|
addTrack(track: MediaStreamTrack): Promise<void>;
|
|
408
430
|
removeTrack(): void;
|
|
431
|
+
|
|
432
|
+
addVideoTrack(track: MediaStreamTrack): Promise<void>;
|
|
433
|
+
|
|
434
|
+
stopVideo(): void;
|
|
409
435
|
requestDiagnostics(): void;
|
|
410
436
|
seekStream(name: string, target: number | 'live'): void;
|
|
411
437
|
|
|
@@ -452,4 +478,4 @@ declare class TransportSession {
|
|
|
452
478
|
private _emitError;
|
|
453
479
|
}
|
|
454
480
|
|
|
455
|
-
export { type App as A, type ChannelEndpoint as C, type Layer as L, type RequestOptions as R, type SceneContext as S, TransportSession as T, type AppOptions as a, type AttachOptions as b, type ChannelMessage as c, ChannelMultiplexer as d, type ChannelName as e, type LayoutConfig as f, type LayoutContext as g, type RequestStreamOptions as h, type SceneGraph as i, type Session as j, type SessionDocument as k, type SessionPhase as l, type SessionPhaseName as m, type SessionStartOptions as n, type SessionStream as o, type SessionText as p, type Store as q, type StoreOptions as r, type TransportSessionOptions as s, type TransportState as t, decodeDocSyncFrame as u, encodeDocSyncFrame as v };
|
|
481
|
+
export { type App as A, type ChannelEndpoint as C, DeferredChannelMultiplexer as D, type Layer as L, type RequestOptions as R, type SceneContext as S, TransportSession as T, type AppOptions as a, type AttachOptions as b, type ChannelMessage as c, ChannelMultiplexer as d, type ChannelName as e, type LayoutConfig as f, type LayoutContext as g, type RequestStreamOptions as h, type SceneGraph as i, type Session as j, type SessionDocument as k, type SessionPhase as l, type SessionPhaseName as m, type SessionStartOptions as n, type SessionStream as o, type SessionText as p, type Store as q, type StoreOptions as r, type TransportSessionOptions as s, type TransportState as t, decodeDocSyncFrame as u, encodeDocSyncFrame as v };
|
|
@@ -37,6 +37,8 @@ interface TransportSessionOptions {
|
|
|
37
37
|
|
|
38
38
|
sessionId?: string;
|
|
39
39
|
|
|
40
|
+
iceServers?: RTCIceServer[];
|
|
41
|
+
|
|
40
42
|
mediaLiveness?: MediaLivenessOptions;
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -176,8 +178,12 @@ interface SessionStream {
|
|
|
176
178
|
|
|
177
179
|
attach(track: MediaStreamTrack): Promise<void>;
|
|
178
180
|
|
|
181
|
+
attachVideo(track: MediaStreamTrack): Promise<void>;
|
|
182
|
+
|
|
179
183
|
detach(): Promise<void>;
|
|
180
184
|
|
|
185
|
+
detachVideo(): Promise<void>;
|
|
186
|
+
|
|
181
187
|
seek(target: number | 'live'): Promise<void>;
|
|
182
188
|
|
|
183
189
|
on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
|
|
@@ -278,11 +284,26 @@ declare class ChannelMultiplexer implements ChannelEndpoint {
|
|
|
278
284
|
private flushPendingSends;
|
|
279
285
|
private listenForOpen;
|
|
280
286
|
}
|
|
287
|
+
declare class DeferredChannelMultiplexer implements ChannelEndpoint {
|
|
288
|
+
private _handlers;
|
|
289
|
+
private _pendingSends;
|
|
290
|
+
private _target;
|
|
291
|
+
private _targetUnsubscribes;
|
|
292
|
+
private _disposed;
|
|
293
|
+
setTarget(target: ChannelEndpoint): void;
|
|
294
|
+
rewriteSessionChannels(oldSessionId: string, newSessionId: string): void;
|
|
295
|
+
on(channel: string, handler: (data: ChannelMessage) => void): () => void;
|
|
296
|
+
emit(channel: string, data: Record<string, unknown>): void;
|
|
297
|
+
dispose(): void;
|
|
298
|
+
private detachTarget;
|
|
299
|
+
}
|
|
281
300
|
|
|
282
301
|
interface TransportConnection {
|
|
283
302
|
url: string;
|
|
284
303
|
sessionId: string;
|
|
285
304
|
jwt?: string;
|
|
305
|
+
|
|
306
|
+
iceServers?: RTCIceServer[];
|
|
286
307
|
}
|
|
287
308
|
|
|
288
309
|
declare function encodeDocSyncFrame(docKey: string, payload: Uint8Array): Uint8Array;
|
|
@@ -335,6 +356,7 @@ declare class TransportSession {
|
|
|
335
356
|
private _sendTransport;
|
|
336
357
|
private _consumers;
|
|
337
358
|
private _audioProducer;
|
|
359
|
+
private _videoProducer;
|
|
338
360
|
private _pendingProduce;
|
|
339
361
|
private _multiplexer;
|
|
340
362
|
private _reconnectAttempts;
|
|
@@ -382,7 +404,7 @@ declare class TransportSession {
|
|
|
382
404
|
getTrackByName(name: string): MediaStreamTrack | undefined;
|
|
383
405
|
setAuth(options: Pick<TransportSessionOptions, 'orgId' | 'jwt' | 'authProvider'>): void;
|
|
384
406
|
constructor(options?: TransportSessionOptions);
|
|
385
|
-
setConnection(options: Pick<TransportSessionOptions, 'url' | 'fallbackUrls' | 'sessionId'>): void;
|
|
407
|
+
setConnection(options: Pick<TransportSessionOptions, 'url' | 'fallbackUrls' | 'sessionId' | 'iceServers'>): void;
|
|
386
408
|
setConnectionResolver(resolveConnection: (() => Promise<TransportConnection>) | null): void;
|
|
387
409
|
|
|
388
410
|
applyControlDocState(state: Record<string, unknown> | null | undefined): void;
|
|
@@ -406,6 +428,10 @@ declare class TransportSession {
|
|
|
406
428
|
private _emitDocSyncFrame;
|
|
407
429
|
addTrack(track: MediaStreamTrack): Promise<void>;
|
|
408
430
|
removeTrack(): void;
|
|
431
|
+
|
|
432
|
+
addVideoTrack(track: MediaStreamTrack): Promise<void>;
|
|
433
|
+
|
|
434
|
+
stopVideo(): void;
|
|
409
435
|
requestDiagnostics(): void;
|
|
410
436
|
seekStream(name: string, target: number | 'live'): void;
|
|
411
437
|
|
|
@@ -452,4 +478,4 @@ declare class TransportSession {
|
|
|
452
478
|
private _emitError;
|
|
453
479
|
}
|
|
454
480
|
|
|
455
|
-
export { type App as A, type ChannelEndpoint as C, type Layer as L, type RequestOptions as R, type SceneContext as S, TransportSession as T, type AppOptions as a, type AttachOptions as b, type ChannelMessage as c, ChannelMultiplexer as d, type ChannelName as e, type LayoutConfig as f, type LayoutContext as g, type RequestStreamOptions as h, type SceneGraph as i, type Session as j, type SessionDocument as k, type SessionPhase as l, type SessionPhaseName as m, type SessionStartOptions as n, type SessionStream as o, type SessionText as p, type Store as q, type StoreOptions as r, type TransportSessionOptions as s, type TransportState as t, decodeDocSyncFrame as u, encodeDocSyncFrame as v };
|
|
481
|
+
export { type App as A, type ChannelEndpoint as C, DeferredChannelMultiplexer as D, type Layer as L, type RequestOptions as R, type SceneContext as S, TransportSession as T, type AppOptions as a, type AttachOptions as b, type ChannelMessage as c, ChannelMultiplexer as d, type ChannelName as e, type LayoutConfig as f, type LayoutContext as g, type RequestStreamOptions as h, type SceneGraph as i, type Session as j, type SessionDocument as k, type SessionPhase as l, type SessionPhaseName as m, type SessionStartOptions as n, type SessionStream as o, type SessionText as p, type Store as q, type StoreOptions as r, type TransportSessionOptions as s, type TransportState as t, decodeDocSyncFrame as u, encodeDocSyncFrame as v };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urun-sh/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"description": "Core transport and channel primitives for the urun TypeScript SDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/ws": "^8.5.12",
|
|
38
|
-
"tsup": "^8.5.0",
|
|
39
|
-
"vitest": "^3.0.0",
|
|
40
38
|
"happy-dom": "^20.9.0",
|
|
41
|
-
"
|
|
39
|
+
"tsup": "^8.5.0",
|
|
40
|
+
"typescript": "^5.3.0",
|
|
41
|
+
"vitest": "^3.0.0"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"dist",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"yjs": "^13.6.0"
|
|
63
63
|
},
|
|
64
64
|
"optionalDependencies": {
|
|
65
|
-
"
|
|
65
|
+
"werift": "0.23.0",
|
|
66
66
|
"ws": "^8.18.0"
|
|
67
67
|
}
|
|
68
68
|
}
|