@urun-sh/core 0.2.34 → 0.2.36

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/internal.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __urunCreateRequire } from 'node:module'; const require = globalThis.require ?? __urunCreateRequire(import.meta.url);
2
- import{A as s,B as m,C as c,D as i,E as f,F as x,G as C,H as l,a as e,b as r,u as o,v as t,w as a,y as n,z as p}from"./chunk-73X4QNRW.mjs";export{e as ChannelMultiplexer,c as DOC_SYNC_WIRE_CONTRACT_VERSION,r as DeferredChannelMultiplexer,x as DeferredDocConnector,n as LoopbackStreamData,C as SessionDocumentImpl,m as TransportSession,l as createPresence,f as createWebsocketDocConnector,i as deriveYjsServerUrl,a as ensureNodeWebRTC,o as isNodeRuntime,t as nodeMediasoupHandlerName,s as streamDataLabel,p as transportStreamData};
2
+ import{D as r,G as t,H as a,I as n,K as s,L as p,M as m,N as c,O as i,P as l,Q as f,R as x,S,T as C,a as e,b as o}from"./chunk-TQBKKR7C.mjs";export{e as ChannelMultiplexer,i as DOC_SYNC_WIRE_CONTRACT_VERSION,o as DeferredChannelMultiplexer,x as DeferredDocConnector,s as LoopbackStreamData,S as SessionDocumentImpl,c as TransportSession,r as allocateSession,C as createPresence,f as createWebsocketDocConnector,l as deriveYjsServerUrl,n as ensureNodeWebRTC,t as isNodeRuntime,a as nodeMediasoupHandlerName,m as streamDataLabel,p as transportStreamData};
@@ -470,7 +470,7 @@ interface AppOptions {
470
470
 
471
471
  jwt?: string;
472
472
 
473
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
473
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
474
474
 
475
475
  authProvider?: string;
476
476
 
@@ -484,7 +484,7 @@ interface AppOptions {
484
484
 
485
485
  priority?: 'preempt';
486
486
  }
487
- interface AccessTokenOptions {
487
+ interface AccessTokenOptions$1 {
488
488
  forceRefresh?: boolean;
489
489
  reason?: 'initial' | 'unauthorized' | 'background';
490
490
  }
@@ -499,7 +499,7 @@ interface AttachOptions {
499
499
 
500
500
  jwt?: string;
501
501
 
502
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
502
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
503
503
 
504
504
  authProvider?: string;
505
505
 
@@ -510,6 +510,109 @@ interface App {
510
510
  [fnName: string]: (args?: Record<string, unknown>) => Session;
511
511
  }
512
512
 
513
+ type SessionGatewayStatus = 'allocated' | 'pending' | 'queued' | 'rejected' | 'failed' | 'canceled';
514
+ interface SessionGatewayResponse {
515
+ status?: SessionGatewayStatus;
516
+ request_id?: string;
517
+ session_id?: string;
518
+ ws_url?: string;
519
+
520
+ ice_servers?: RTCIceServer[];
521
+ queued?: boolean;
522
+ retry_after_seconds?: number;
523
+ queue_position?: number;
524
+ queue_depth?: number;
525
+
526
+ runtime_state?: string;
527
+
528
+ runtime_reason?: string;
529
+
530
+ ends_at?: string;
531
+ error_code?: string;
532
+ error_message?: string;
533
+ }
534
+
535
+ interface AdmissionUpdate {
536
+
537
+ status: 'queued' | 'pending';
538
+
539
+ requestId?: string;
540
+
541
+ queue?: {
542
+ position: number;
543
+ depth: number;
544
+ };
545
+
546
+ runtime?: RuntimeAvailability;
547
+ }
548
+ interface AllocateSessionOptions {
549
+ baseUrl: string;
550
+ fallbackUrls?: readonly string[];
551
+ app: string;
552
+ functionName: string;
553
+ orgId: string;
554
+ jwt?: string;
555
+ getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
556
+ authProvider?: string;
557
+ idempotencyKey: string;
558
+
559
+ onAdmission?: (update: AdmissionUpdate) => void;
560
+
561
+ onRequest?: (handle: {
562
+ requestId: string;
563
+ baseUrl: string;
564
+ }) => void;
565
+
566
+ sessionKey?: string;
567
+
568
+ priority?: 'preempt';
569
+ }
570
+ interface AccessTokenOptions {
571
+ forceRefresh?: boolean;
572
+ reason?: 'initial' | 'unauthorized' | 'background';
573
+ }
574
+ interface AllocatedSession {
575
+ baseUrl: string;
576
+ sessionId: string;
577
+ wsUrl: string;
578
+
579
+ endsAt: Date | null;
580
+ response: SessionGatewayResponse;
581
+ }
582
+ interface ReleaseSessionBeaconOptions {
583
+ baseUrl: string;
584
+ requestId: string;
585
+ orgId: string;
586
+
587
+ jwt?: string;
588
+ authProvider?: string;
589
+ }
590
+
591
+ declare function releaseSessionBeacon(options: ReleaseSessionBeaconOptions): void;
592
+ declare function allocateSession(options: AllocateSessionOptions): Promise<AllocatedSession>;
593
+ interface PrewakeOptions {
594
+ baseUrl: string;
595
+
596
+ app: string;
597
+
598
+ functionName: string;
599
+ orgId: string;
600
+ jwt?: string;
601
+ getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
602
+ authProvider?: string;
603
+ }
604
+ type PrewakeStatus = 'warming' | 'prebound' | 'unknown-app' | 'unavailable';
605
+ interface PrewakeResult {
606
+
607
+ status: PrewakeStatus;
608
+
609
+ expiresAt?: string;
610
+
611
+ warmCapable?: boolean;
612
+ }
613
+
614
+ declare function prewake(options: PrewakeOptions): Promise<PrewakeResult>;
615
+
513
616
  interface ChannelEndpoint {
514
617
  on(channel: string, handler: (data: ChannelMessage) => void): () => void;
515
618
  emit(channel: string, data: Record<string, unknown>): void;
@@ -917,4 +1020,4 @@ interface DataChannelTransport {
917
1020
 
918
1021
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
919
1022
 
920
- export { type TransportState as $, type AccessTokenOptions as A, type RuntimeAvailability as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type SessionDiagnostic as E, type SessionDocument as F, SessionDocumentImpl as G, type SessionEndResult as H, type SessionFailureKind as I, type SessionPhase as J, type SessionPhaseError as K, LoopbackStreamData as L, type MediaChunkBinding as M, type SessionPhaseName as N, type SessionStartOptions as O, type Presence as P, type SessionStatus as Q, type Recording as R, type Session as S, type SessionStream as T, type SessionText as U, type Store as V, type StoreOptions as W, type StreamChunkOptions as X, type StreamDataTransport as Y, TransportSession as Z, type TransportSessionOptions as _, type ActivationEvent as a, createPresence as a0, createWebsocketDocConnector as a1, deriveYjsServerUrl as a2, isPendingRecording as a3, mediaRecorderChunkSource as a4, streamDataLabel as a5, transportStreamData as a6, type ActivationState as b, type App as c, type AppOptions as d, type AttachOptions as e, type ChannelMessage as f, ChannelMultiplexer as g, type ChannelName as h, type ChunkReadable as i, DeferredChannelMultiplexer as j, DeferredDocConnector as k, type DocConnection as l, type DocConnector as m, type MediaChunkSource as n, type MediaChunkSourceFactory as o, type MediaRecorderChunkSourceOptions as p, type PresenceState as q, type RecordingBucket as r, type RecordingLifecycle as s, type RecordingStatus as t, type RecordingsAccessor as u, type RequestOptions as v, type RequestStreamOptions as w, type RuntimeArtifact as x, type RuntimeArtifactDownload as y, type RuntimeArtifactsAccessor as z };
1023
+ export { type SessionText as $, type AccessTokenOptions$1 as A, type RecordingsAccessor as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type ReleaseSessionBeaconOptions as E, type RequestOptions as F, type RequestStreamOptions as G, type RuntimeArtifact as H, type RuntimeArtifactDownload as I, type RuntimeArtifactsAccessor as J, type RuntimeAvailability as K, LoopbackStreamData as L, type MediaChunkBinding as M, type SessionDiagnostic as N, type SessionDocument as O, type Presence as P, SessionDocumentImpl as Q, type Recording as R, type Session as S, type SessionEndResult as T, type SessionFailureKind as U, type SessionPhase as V, type SessionPhaseError as W, type SessionPhaseName as X, type SessionStartOptions as Y, type SessionStatus as Z, type SessionStream as _, type AccessTokenOptions as a, type Store as a0, type StoreOptions as a1, type StreamChunkOptions as a2, type StreamDataTransport as a3, TransportSession as a4, type TransportSessionOptions as a5, type TransportState as a6, allocateSession as a7, createPresence as a8, createWebsocketDocConnector as a9, deriveYjsServerUrl as aa, isPendingRecording as ab, mediaRecorderChunkSource as ac, prewake as ad, releaseSessionBeacon as ae, streamDataLabel as af, transportStreamData as ag, type ActivationEvent as b, type ActivationState as c, type AllocateSessionOptions as d, type AllocatedSession as e, type App as f, type AppOptions as g, type AttachOptions as h, type ChannelMessage as i, ChannelMultiplexer as j, type ChannelName as k, type ChunkReadable as l, DeferredChannelMultiplexer as m, DeferredDocConnector as n, type DocConnection as o, type DocConnector as p, type MediaChunkSource as q, type MediaChunkSourceFactory as r, type MediaRecorderChunkSourceOptions as s, type PresenceState as t, type PrewakeOptions as u, type PrewakeResult as v, type PrewakeStatus as w, type RecordingBucket as x, type RecordingLifecycle as y, type RecordingStatus as z };
@@ -470,7 +470,7 @@ interface AppOptions {
470
470
 
471
471
  jwt?: string;
472
472
 
473
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
473
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
474
474
 
475
475
  authProvider?: string;
476
476
 
@@ -484,7 +484,7 @@ interface AppOptions {
484
484
 
485
485
  priority?: 'preempt';
486
486
  }
487
- interface AccessTokenOptions {
487
+ interface AccessTokenOptions$1 {
488
488
  forceRefresh?: boolean;
489
489
  reason?: 'initial' | 'unauthorized' | 'background';
490
490
  }
@@ -499,7 +499,7 @@ interface AttachOptions {
499
499
 
500
500
  jwt?: string;
501
501
 
502
- getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
502
+ getAccessToken?: (options?: AccessTokenOptions$1) => string | null | undefined | Promise<string | null | undefined>;
503
503
 
504
504
  authProvider?: string;
505
505
 
@@ -510,6 +510,109 @@ interface App {
510
510
  [fnName: string]: (args?: Record<string, unknown>) => Session;
511
511
  }
512
512
 
513
+ type SessionGatewayStatus = 'allocated' | 'pending' | 'queued' | 'rejected' | 'failed' | 'canceled';
514
+ interface SessionGatewayResponse {
515
+ status?: SessionGatewayStatus;
516
+ request_id?: string;
517
+ session_id?: string;
518
+ ws_url?: string;
519
+
520
+ ice_servers?: RTCIceServer[];
521
+ queued?: boolean;
522
+ retry_after_seconds?: number;
523
+ queue_position?: number;
524
+ queue_depth?: number;
525
+
526
+ runtime_state?: string;
527
+
528
+ runtime_reason?: string;
529
+
530
+ ends_at?: string;
531
+ error_code?: string;
532
+ error_message?: string;
533
+ }
534
+
535
+ interface AdmissionUpdate {
536
+
537
+ status: 'queued' | 'pending';
538
+
539
+ requestId?: string;
540
+
541
+ queue?: {
542
+ position: number;
543
+ depth: number;
544
+ };
545
+
546
+ runtime?: RuntimeAvailability;
547
+ }
548
+ interface AllocateSessionOptions {
549
+ baseUrl: string;
550
+ fallbackUrls?: readonly string[];
551
+ app: string;
552
+ functionName: string;
553
+ orgId: string;
554
+ jwt?: string;
555
+ getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
556
+ authProvider?: string;
557
+ idempotencyKey: string;
558
+
559
+ onAdmission?: (update: AdmissionUpdate) => void;
560
+
561
+ onRequest?: (handle: {
562
+ requestId: string;
563
+ baseUrl: string;
564
+ }) => void;
565
+
566
+ sessionKey?: string;
567
+
568
+ priority?: 'preempt';
569
+ }
570
+ interface AccessTokenOptions {
571
+ forceRefresh?: boolean;
572
+ reason?: 'initial' | 'unauthorized' | 'background';
573
+ }
574
+ interface AllocatedSession {
575
+ baseUrl: string;
576
+ sessionId: string;
577
+ wsUrl: string;
578
+
579
+ endsAt: Date | null;
580
+ response: SessionGatewayResponse;
581
+ }
582
+ interface ReleaseSessionBeaconOptions {
583
+ baseUrl: string;
584
+ requestId: string;
585
+ orgId: string;
586
+
587
+ jwt?: string;
588
+ authProvider?: string;
589
+ }
590
+
591
+ declare function releaseSessionBeacon(options: ReleaseSessionBeaconOptions): void;
592
+ declare function allocateSession(options: AllocateSessionOptions): Promise<AllocatedSession>;
593
+ interface PrewakeOptions {
594
+ baseUrl: string;
595
+
596
+ app: string;
597
+
598
+ functionName: string;
599
+ orgId: string;
600
+ jwt?: string;
601
+ getAccessToken?: (options?: AccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
602
+ authProvider?: string;
603
+ }
604
+ type PrewakeStatus = 'warming' | 'prebound' | 'unknown-app' | 'unavailable';
605
+ interface PrewakeResult {
606
+
607
+ status: PrewakeStatus;
608
+
609
+ expiresAt?: string;
610
+
611
+ warmCapable?: boolean;
612
+ }
613
+
614
+ declare function prewake(options: PrewakeOptions): Promise<PrewakeResult>;
615
+
513
616
  interface ChannelEndpoint {
514
617
  on(channel: string, handler: (data: ChannelMessage) => void): () => void;
515
618
  emit(channel: string, data: Record<string, unknown>): void;
@@ -917,4 +1020,4 @@ interface DataChannelTransport {
917
1020
 
918
1021
  declare function transportStreamData(transport: DataChannelTransport): StreamDataTransport;
919
1022
 
920
- export { type TransportState as $, type AccessTokenOptions as A, type RuntimeAvailability as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type SessionDiagnostic as E, type SessionDocument as F, SessionDocumentImpl as G, type SessionEndResult as H, type SessionFailureKind as I, type SessionPhase as J, type SessionPhaseError as K, LoopbackStreamData as L, type MediaChunkBinding as M, type SessionPhaseName as N, type SessionStartOptions as O, type Presence as P, type SessionStatus as Q, type Recording as R, type Session as S, type SessionStream as T, type SessionText as U, type Store as V, type StoreOptions as W, type StreamChunkOptions as X, type StreamDataTransport as Y, TransportSession as Z, type TransportSessionOptions as _, type ActivationEvent as a, createPresence as a0, createWebsocketDocConnector as a1, deriveYjsServerUrl as a2, isPendingRecording as a3, mediaRecorderChunkSource as a4, streamDataLabel as a5, transportStreamData as a6, type ActivationState as b, type App as c, type AppOptions as d, type AttachOptions as e, type ChannelMessage as f, ChannelMultiplexer as g, type ChannelName as h, type ChunkReadable as i, DeferredChannelMultiplexer as j, DeferredDocConnector as k, type DocConnection as l, type DocConnector as m, type MediaChunkSource as n, type MediaChunkSourceFactory as o, type MediaRecorderChunkSourceOptions as p, type PresenceState as q, type RecordingBucket as r, type RecordingLifecycle as s, type RecordingStatus as t, type RecordingsAccessor as u, type RequestOptions as v, type RequestStreamOptions as w, type RuntimeArtifact as x, type RuntimeArtifactDownload as y, type RuntimeArtifactsAccessor as z };
1023
+ export { type SessionText as $, type AccessTokenOptions$1 as A, type RecordingsAccessor as B, type ChannelEndpoint as C, DOC_SYNC_WIRE_CONTRACT_VERSION as D, type ReleaseSessionBeaconOptions as E, type RequestOptions as F, type RequestStreamOptions as G, type RuntimeArtifact as H, type RuntimeArtifactDownload as I, type RuntimeArtifactsAccessor as J, type RuntimeAvailability as K, LoopbackStreamData as L, type MediaChunkBinding as M, type SessionDiagnostic as N, type SessionDocument as O, type Presence as P, SessionDocumentImpl as Q, type Recording as R, type Session as S, type SessionEndResult as T, type SessionFailureKind as U, type SessionPhase as V, type SessionPhaseError as W, type SessionPhaseName as X, type SessionStartOptions as Y, type SessionStatus as Z, type SessionStream as _, type AccessTokenOptions as a, type Store as a0, type StoreOptions as a1, type StreamChunkOptions as a2, type StreamDataTransport as a3, TransportSession as a4, type TransportSessionOptions as a5, type TransportState as a6, allocateSession as a7, createPresence as a8, createWebsocketDocConnector as a9, deriveYjsServerUrl as aa, isPendingRecording as ab, mediaRecorderChunkSource as ac, prewake as ad, releaseSessionBeacon as ae, streamDataLabel as af, transportStreamData as ag, type ActivationEvent as b, type ActivationState as c, type AllocateSessionOptions as d, type AllocatedSession as e, type App as f, type AppOptions as g, type AttachOptions as h, type ChannelMessage as i, ChannelMultiplexer as j, type ChannelName as k, type ChunkReadable as l, DeferredChannelMultiplexer as m, DeferredDocConnector as n, type DocConnection as o, type DocConnector as p, type MediaChunkSource as q, type MediaChunkSourceFactory as r, type MediaRecorderChunkSourceOptions as s, type PresenceState as t, type PrewakeOptions as u, type PrewakeResult as v, type PrewakeStatus as w, type RecordingBucket as x, type RecordingLifecycle as y, type RecordingStatus as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urun-sh/core",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "description": "Core transport and channel primitives for the urun TypeScript SDK",
5
5
  "repository": {
6
6
  "type": "git",