@urun-sh/core 0.2.8 → 0.2.9

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.
@@ -1,10 +1,37 @@
1
- import { b as AppOptions, a as App$1, K as SessionPhase, T as SessionStatus, O as SessionPhaseName, A as AccessTokenOptions, y as RuntimeArtifact, z as RuntimeArtifactDownload, R as Recording, G as Session$1, C as ChannelEndpoint, _ as TransportSession, c as AttachOptions, v as RecordingsAccessor, B as RuntimeArtifactsAccessor, U as SessionStream$1, Z as StreamDataTransport, I as SessionDocumentImpl, Y as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, X as StoreOptions, W as Store, e as ChannelMultiplexer, J as SessionFailureKind } from './stream-data-BS3Z4V1D.mjs';
2
- export { L as Layer, l as LayoutConfig, m as LayoutContext, M as MediaChunkBinding, o as MediaChunkSource, p as MediaChunkSourceFactory, q as MediaRecorderChunkSourceOptions, r as PresenceState, s as RecordingBucket, t as RecordingLifecycle, u as RecordingStatus, E as RuntimeAvailability, S as SceneContext, F as SceneGraph, H as SessionDocument, N as SessionPhaseError, V as SessionText, a0 as TransportState, a4 as isPendingRecording, a5 as mediaRecorderChunkSource } from './stream-data-BS3Z4V1D.mjs';
1
+ import { b as AppOptions, a as App$1, K as SessionPhase, T as SessionStatus, O as SessionPhaseName, A as AccessTokenOptions$1, y as RuntimeArtifact, z as RuntimeArtifactDownload, R as Recording, G as Session$1, C as ChannelEndpoint, _ as TransportSession, c as AttachOptions, v as RecordingsAccessor, B as RuntimeArtifactsAccessor, U as SessionStream$1, Z as StreamDataTransport, I as SessionDocumentImpl, Y as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, X as StoreOptions, W as Store, e as ChannelMultiplexer, J as SessionFailureKind } from './stream-data-DWu57atL.mjs';
2
+ export { L as Layer, l as LayoutConfig, m as LayoutContext, M as MediaChunkBinding, o as MediaChunkSource, p as MediaChunkSourceFactory, q as MediaRecorderChunkSourceOptions, r as PresenceState, s as RecordingBucket, t as RecordingLifecycle, u as RecordingStatus, E as RuntimeAvailability, S as SceneContext, F as SceneGraph, H as SessionDocument, N as SessionPhaseError, V as SessionText, a0 as TransportState, a4 as isPendingRecording, a5 as mediaRecorderChunkSource } from './stream-data-DWu57atL.mjs';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
5
 
6
6
  declare function App(appId: string, options: AppOptions): App$1;
7
7
 
8
+ interface AccessTokenOptions {
9
+ forceRefresh?: boolean;
10
+ reason?: 'initial' | 'unauthorized' | 'background';
11
+ }
12
+ interface PrewakeOptions {
13
+ baseUrl: string;
14
+
15
+ app: string;
16
+
17
+ functionName: string;
18
+ orgId: string;
19
+ jwt?: string;
20
+ getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
21
+ authProvider?: string;
22
+ }
23
+ type PrewakeStatus = 'warming' | 'prebound' | 'unknown-app' | 'unavailable';
24
+ interface PrewakeResult {
25
+
26
+ status: PrewakeStatus;
27
+
28
+ expiresAt?: string;
29
+
30
+ warmCapable?: boolean;
31
+ }
32
+
33
+ declare function prewake(options: PrewakeOptions): Promise<PrewakeResult>;
34
+
8
35
  declare function isWakingPhase(phase: SessionPhase | SessionPhaseName | null | undefined): boolean;
9
36
 
10
37
  interface PhaseObservable {
@@ -34,7 +61,7 @@ interface RuntimeArtifactsClientOptions {
34
61
  fallbackUrls?: readonly string[];
35
62
  orgId: string;
36
63
  jwt?: string;
37
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
64
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
38
65
  authProvider?: string;
39
66
  }
40
67
  declare class RuntimeArtifactsError extends Error {
@@ -71,7 +98,7 @@ interface RecordingsClientOptions {
71
98
 
72
99
  jwt?: string;
73
100
 
74
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
101
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
75
102
 
76
103
  authProvider?: string;
77
104
  }
@@ -241,6 +268,8 @@ declare class Session implements Session$1 {
241
268
 
242
269
  get phase(): SessionPhase;
243
270
 
271
+ get endsAt(): Date | null;
272
+
244
273
  get status(): SessionStatus;
245
274
 
246
275
  onPhase(handler: (phase: SessionPhase) => void): () => void;
@@ -373,4 +402,49 @@ declare class SessionAllocationError extends Error {
373
402
  });
374
403
  }
375
404
 
376
- export { App, App$1 as AppInterface, AppOptions, AttachOptions, ChunkReadable, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, FOREGROUND_COALESCE_MS, InvalidDurationError, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type VideoStreamOptions, type WhenLiveOptions, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, isDurationString, isWakingPhase, normalizeRetention, observePageLifecycle, sessionFailureFromMediaError, videoStream, whenLive };
405
+ type CaptureKind = 'audio' | 'video';
406
+ type GetUserMedia = (constraints: MediaStreamConstraints) => Promise<MediaStream>;
407
+
408
+ declare class CaptureUnavailableError extends Error {
409
+ constructor();
410
+ }
411
+
412
+ interface CaptureClaim {
413
+ readonly kind: CaptureKind;
414
+
415
+ readonly track: MediaStreamTrack | null;
416
+
417
+ readonly stream: MediaStream | null;
418
+
419
+ update(constraints: MediaTrackConstraints): Promise<MediaStreamTrack>;
420
+
421
+ release(): void;
422
+
423
+ onTrack(listener: (track: MediaStreamTrack, stream: MediaStream) => void): () => void;
424
+
425
+ onLost(listener: (error: Error) => void): () => void;
426
+ }
427
+ interface CaptureControllerOptions {
428
+
429
+ getUserMedia?: GetUserMedia;
430
+ }
431
+
432
+ declare class CaptureController {
433
+ private readonly claims;
434
+ private readonly injectedGetUserMedia?;
435
+ private queue;
436
+ constructor(options?: CaptureControllerOptions);
437
+
438
+ claim(kind: CaptureKind, constraints: MediaTrackConstraints): Promise<CaptureClaim>;
439
+
440
+ idle(): Promise<void>;
441
+ private enqueue;
442
+ private resolveGetUserMedia;
443
+
444
+ private converge;
445
+ private createState;
446
+ }
447
+
448
+ declare function sharedCaptureController(): CaptureController;
449
+
450
+ export { App, App$1 as AppInterface, AppOptions, AttachOptions, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, FOREGROUND_COALESCE_MS, InvalidDurationError, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PrewakeOptions, type PrewakeResult, type PrewakeStatus, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type VideoStreamOptions, type WhenLiveOptions, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, isDurationString, isWakingPhase, normalizeRetention, observePageLifecycle, prewake, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive };
@@ -1,10 +1,37 @@
1
- import { b as AppOptions, a as App$1, K as SessionPhase, T as SessionStatus, O as SessionPhaseName, A as AccessTokenOptions, y as RuntimeArtifact, z as RuntimeArtifactDownload, R as Recording, G as Session$1, C as ChannelEndpoint, _ as TransportSession, c as AttachOptions, v as RecordingsAccessor, B as RuntimeArtifactsAccessor, U as SessionStream$1, Z as StreamDataTransport, I as SessionDocumentImpl, Y as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, X as StoreOptions, W as Store, e as ChannelMultiplexer, J as SessionFailureKind } from './stream-data-BS3Z4V1D.js';
2
- export { L as Layer, l as LayoutConfig, m as LayoutContext, M as MediaChunkBinding, o as MediaChunkSource, p as MediaChunkSourceFactory, q as MediaRecorderChunkSourceOptions, r as PresenceState, s as RecordingBucket, t as RecordingLifecycle, u as RecordingStatus, E as RuntimeAvailability, S as SceneContext, F as SceneGraph, H as SessionDocument, N as SessionPhaseError, V as SessionText, a0 as TransportState, a4 as isPendingRecording, a5 as mediaRecorderChunkSource } from './stream-data-BS3Z4V1D.js';
1
+ import { b as AppOptions, a as App$1, K as SessionPhase, T as SessionStatus, O as SessionPhaseName, A as AccessTokenOptions$1, y as RuntimeArtifact, z as RuntimeArtifactDownload, R as Recording, G as Session$1, C as ChannelEndpoint, _ as TransportSession, c as AttachOptions, v as RecordingsAccessor, B as RuntimeArtifactsAccessor, U as SessionStream$1, Z as StreamDataTransport, I as SessionDocumentImpl, Y as StreamChunkOptions, g as ChunkReadable, P as Presence, k as DocConnector, w as RequestOptions, x as RequestStreamOptions, X as StoreOptions, W as Store, e as ChannelMultiplexer, J as SessionFailureKind } from './stream-data-DWu57atL.js';
2
+ export { L as Layer, l as LayoutConfig, m as LayoutContext, M as MediaChunkBinding, o as MediaChunkSource, p as MediaChunkSourceFactory, q as MediaRecorderChunkSourceOptions, r as PresenceState, s as RecordingBucket, t as RecordingLifecycle, u as RecordingStatus, E as RuntimeAvailability, S as SceneContext, F as SceneGraph, H as SessionDocument, N as SessionPhaseError, V as SessionText, a0 as TransportState, a4 as isPendingRecording, a5 as mediaRecorderChunkSource } from './stream-data-DWu57atL.js';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
5
 
6
6
  declare function App(appId: string, options: AppOptions): App$1;
7
7
 
8
+ interface AccessTokenOptions {
9
+ forceRefresh?: boolean;
10
+ reason?: 'initial' | 'unauthorized' | 'background';
11
+ }
12
+ interface PrewakeOptions {
13
+ baseUrl: string;
14
+
15
+ app: string;
16
+
17
+ functionName: string;
18
+ orgId: string;
19
+ jwt?: string;
20
+ getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
21
+ authProvider?: string;
22
+ }
23
+ type PrewakeStatus = 'warming' | 'prebound' | 'unknown-app' | 'unavailable';
24
+ interface PrewakeResult {
25
+
26
+ status: PrewakeStatus;
27
+
28
+ expiresAt?: string;
29
+
30
+ warmCapable?: boolean;
31
+ }
32
+
33
+ declare function prewake(options: PrewakeOptions): Promise<PrewakeResult>;
34
+
8
35
  declare function isWakingPhase(phase: SessionPhase | SessionPhaseName | null | undefined): boolean;
9
36
 
10
37
  interface PhaseObservable {
@@ -34,7 +61,7 @@ interface RuntimeArtifactsClientOptions {
34
61
  fallbackUrls?: readonly string[];
35
62
  orgId: string;
36
63
  jwt?: string;
37
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
64
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
38
65
  authProvider?: string;
39
66
  }
40
67
  declare class RuntimeArtifactsError extends Error {
@@ -71,7 +98,7 @@ interface RecordingsClientOptions {
71
98
 
72
99
  jwt?: string;
73
100
 
74
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
101
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
75
102
 
76
103
  authProvider?: string;
77
104
  }
@@ -241,6 +268,8 @@ declare class Session implements Session$1 {
241
268
 
242
269
  get phase(): SessionPhase;
243
270
 
271
+ get endsAt(): Date | null;
272
+
244
273
  get status(): SessionStatus;
245
274
 
246
275
  onPhase(handler: (phase: SessionPhase) => void): () => void;
@@ -373,4 +402,49 @@ declare class SessionAllocationError extends Error {
373
402
  });
374
403
  }
375
404
 
376
- export { App, App$1 as AppInterface, AppOptions, AttachOptions, ChunkReadable, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, FOREGROUND_COALESCE_MS, InvalidDurationError, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type VideoStreamOptions, type WhenLiveOptions, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, isDurationString, isWakingPhase, normalizeRetention, observePageLifecycle, sessionFailureFromMediaError, videoStream, whenLive };
405
+ type CaptureKind = 'audio' | 'video';
406
+ type GetUserMedia = (constraints: MediaStreamConstraints) => Promise<MediaStream>;
407
+
408
+ declare class CaptureUnavailableError extends Error {
409
+ constructor();
410
+ }
411
+
412
+ interface CaptureClaim {
413
+ readonly kind: CaptureKind;
414
+
415
+ readonly track: MediaStreamTrack | null;
416
+
417
+ readonly stream: MediaStream | null;
418
+
419
+ update(constraints: MediaTrackConstraints): Promise<MediaStreamTrack>;
420
+
421
+ release(): void;
422
+
423
+ onTrack(listener: (track: MediaStreamTrack, stream: MediaStream) => void): () => void;
424
+
425
+ onLost(listener: (error: Error) => void): () => void;
426
+ }
427
+ interface CaptureControllerOptions {
428
+
429
+ getUserMedia?: GetUserMedia;
430
+ }
431
+
432
+ declare class CaptureController {
433
+ private readonly claims;
434
+ private readonly injectedGetUserMedia?;
435
+ private queue;
436
+ constructor(options?: CaptureControllerOptions);
437
+
438
+ claim(kind: CaptureKind, constraints: MediaTrackConstraints): Promise<CaptureClaim>;
439
+
440
+ idle(): Promise<void>;
441
+ private enqueue;
442
+ private resolveGetUserMedia;
443
+
444
+ private converge;
445
+ private createState;
446
+ }
447
+
448
+ declare function sharedCaptureController(): CaptureController;
449
+
450
+ export { App, App$1 as AppInterface, AppOptions, AttachOptions, type CaptureClaim, CaptureController, type CaptureControllerOptions, type CaptureKind, CaptureUnavailableError, ChunkReadable, DEFAULT_DOC_SYNC_TIMEOUT_MS, DEFAULT_WHEN_LIVE_TIMEOUT_MS, FOREGROUND_COALESCE_MS, InvalidDurationError, PermanentLockedError, type PhaseObservable, PinRequiresActiveTempError, Presence, type PrewakeOptions, type PrewakeResult, type PrewakeStatus, Recording, RecordingNotFoundError, RecordingsAccessor, RecordingsClient, type RecordingsClientOptions, RecordingsError, RecordingsUnauthorizedError, RequestAbortError, RequestCancelledError, RequestDocSyncError, RequestError, RequestOptions, RequestStreamOptions, RequestTimeoutError, RetainNotTempError, type RetentionIntent, RuntimeArtifact, RuntimeArtifactDownload, RuntimeArtifactNotFoundError, RuntimeArtifactsAccessor, RuntimeArtifactsClient, type RuntimeArtifactsClientOptions, RuntimeArtifactsError, RuntimeArtifactsUnauthorizedError, Session, SessionAllocationError, SessionFailedError, SessionFailureKind, Session$1 as SessionInterface, SessionPhase, SessionPhaseName, SessionStatus, SessionStream$1 as SessionStream, Store, StoreOptions, StreamChunkOptions, StreamDirectionConflict, type VideoStreamOptions, type WhenLiveOptions, createRecordingsClient, createRuntimeArtifactsClient, createStore, describeSessionFailure, describeSessionPhase, isDurationString, isWakingPhase, normalizeRetention, observePageLifecycle, prewake, sessionFailureFromMediaError, sharedCaptureController, videoStream, whenLive };