openrtc 1.0.6 → 1.0.8

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 +0,0 @@
1
- import {o}from'./chunk-HVTYSEU7.js';function O(i){let s=o({...i});if("auth"in i&&!i.authMode){let n=i.auth;s.authMode=n==="none"?"anonymous":n;}if("identity"in i){let n=i.identity,r=n==="temporary"?"ephemeral":n;!i.deviceIdPersistence&&!i.nodeIdPersistence&&(s.deviceIdPersistence=r),!i.endpointIdPersistence&&!i.nodeIdPersistence&&(s.endpointIdPersistence=r);}return "namespace"in i&&!i.storagePrefix&&(s.storagePrefix=i.namespace),"privacy"in i&&i.strictMode===void 0&&(s.strictMode=!!i.privacy),s}function I(i,s){let n=i.runtime,r=Object.create(n),l=async e=>{if(typeof e!="string")return e;let o=(await n.listDevices()).find(c=>c.deviceId===e);if(!o)throw new Error(`OpenRTC device '${e}' is not currently discoverable.`);return o},u=async e=>({...e,localDeviceId:e?.localDeviceId??await n.getLocalDeviceId()??""}),R=async e=>{let{device:t,scope:o,...c}=e,a=c.deviceId??(typeof t=="string"?t:t?.deviceId)??null,m=c.ticket??(typeof t=="string"?void 0:t?.ticket);a&&!m&&(m=(await l(a).catch(()=>null))?.ticket);let d={...c,scope:o??"session"};return a&&(d.deviceId=a),m&&(d.ticket=m),d},g={list:()=>n.listDevices(),startSession:(e={})=>n.startManagedSession({...e,platform:e.platform??s}),stopSession:e=>n.stopManagedSession(e),listWithStatus:()=>n.listDevicesWithStatus(),watch:e=>n.watchDevices(e),watchWithStatus:e=>n.watchDevicesWithStatus(e),connect:async(e,t)=>n.connectDevice(await l(e),await u(t)),connectWithRetry:async(e,t,o)=>n.connectDeviceWithRetry(await l(e),t,o),disconnect:e=>n.disconnectDevice(e),update:(e,t)=>n.updateDevice(e,t),delete:e=>n.deleteDevice(e),localId:()=>n.getLocalDeviceId(),localInfo:()=>n.getLocalDeviceInfo(),localProfile:e=>n.getLocalDeviceProfile(e),updateLocalName:e=>n.updateLocalDeviceName(e)},v={watch:e=>n.watchPeerStates(e),watchLifecycle:e=>n.watchPeerLifecycle(e),get:e=>n.getPeerState(e),listConnected:()=>n.listConnectedPeers(),connect:e=>n.connectPeer(e),disconnect:(e,t)=>n.disconnectPeer(e,t),forceDisconnect:e=>n.forceDisconnectPeer(e),session:e=>n.getPeerSession(e),sessions:()=>n.listPeerSessions(),waitConnected:(e,t)=>n.waitForConnectedPeer(e,t),readiness:(e,t)=>n.getPeerReadiness(e,t),health:e=>n.getPeerHealth(e),identity:e=>n.resolvePeerIdentity(e),addScope:(e,t)=>n.addPeerScope(e,t),releaseScope:(e,t)=>n.releasePeerScope(e,t),scopes:e=>n.getPeerScopes(e),refresh:()=>n.refreshPeerSnapshot()},C={register:e=>n.registerChannel(e),unregister:e=>n.unregisterChannel(e),list:()=>n.listChannels(),openBi:(e,t,o)=>n.openPeerBi(e,{...o,channelId:t}),openUni:(e,t,o)=>n.openPeerUni(e,{...o,channelId:t}),onIncoming:e=>n.onIncomingStream(e),onIncomingChannel:(e,t)=>n.onIncomingChannelStream(e,o=>{if(o.channel)return t(o)}),connect:async e=>n.connectScopedChannel(await R(e)),connectScoped:e=>n.connectScopedChannel(e)},P={create:e=>n.createRoom(e),join:(e,t)=>n.joinRoom(e,t),leave:e=>n.leaveRoom(e),watch:(e,t)=>n.watchRoom(e,t),members:e=>n.getRoomMembers(e)},h={raw:()=>n.getInvite(),share:e=>n.getTicketWithToken("share",e?.maxConnections??1),grant:(e,t)=>n.getTicketWithToken(e,t?.maxConnections??0),revoke:e=>n.revokeTokensByScope(e)},S={status:()=>n.getRuntimeStatus(),policy:()=>n.getRuntimePolicy(),capabilities:()=>n.getRuntimeCapabilities(),capabilityProfile:()=>n.getCapabilityProfile(),connectionStates:()=>n.getConnectionStates(),onConnectionStateChange:e=>n.onConnectionStateChange(e),connections:()=>n.getConnections(),applicationReadyConnections:e=>n.getApplicationReadyConnections(e),onConnection:e=>n.onConnection(e),onDisconnection:e=>n.onDisconnection(e),onConnectionEvent:e=>n.onConnectionEvent(e),forceReconnectSnapshot:()=>n.forceReconnectSnapshot(),peerReconciliation:()=>n.getPeerReconciliationStats()},b={runtime:n,assembly:i,nodeId:()=>n.getNodeId(),nodeIdFromTicket:e=>n.getNodeIdFromTicket(e),endpointTicket:()=>n.getEndpointTicket(),connectRaw:e=>n.connectRaw(e),openBi:e=>n.openBi(e),openUni:e=>n.openUni(e),isConnected:e=>n.isConnected(e),disconnectNode:e=>n.disconnectNode(e),setAutoConnectExcluded:(e,t)=>n.setAutoConnectExcluded(e,t),notifyNetworkChange:e=>n.notifyNetworkChange(e)};return Object.defineProperties(r,{devices:{get:()=>g,enumerable:true},peers:{get:()=>v,enumerable:true},channels:{get:()=>C,enumerable:true},rooms:{get:()=>P,enumerable:true},tickets:{get:()=>h,enumerable:true},diagnostics:{get:()=>S,enumerable:true},advanced:{get:()=>b,enumerable:true},setAuth:{value:e=>i.setAuthContext(e),enumerable:true,writable:true,configurable:true},setAuthContext:{value:e=>i.setAuthContext(e),enumerable:true,writable:true,configurable:true},syncPlutoAuth:{value:e=>i.syncPlutoAuth(e),enumerable:true,writable:true,configurable:true},bindPlutoAuthHost:{value:()=>i.bindPlutoAuthHost(),enumerable:true,writable:true,configurable:true},signIn:{value:()=>i.signInWithPluto(),enumerable:true,writable:true,configurable:true},signOut:{value:()=>i.signOut(),enumerable:true,writable:true,configurable:true},runtime:{get:()=>n,enumerable:false},_assembly:{get:()=>i,enumerable:false}}),r}export{O as a,I as b};
@@ -1,33 +0,0 @@
1
- import { n as ClientOptions } from './types-BCkKK8dy.js';
2
- import { W as WasmBridgeOptions, D as DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter-DlC0TZB0.js';
3
- import { P as PlutoIpcBridge } from './ipc-CflAVodw.js';
4
-
5
- interface NativeIpcBridgeOptions extends WasmBridgeOptions {
6
- allowWasmFallback?: boolean;
7
- ipcBridge?: PlutoIpcBridge;
8
- transports?: ClientOptions['transports'];
9
- strictMode?: boolean;
10
- }
11
-
12
- interface IpcRuntimeAdapterOptions extends NativeIpcBridgeOptions {
13
- bridge: PlutoIpcBridge;
14
- }
15
- declare class IpcRuntimeAdapter extends DelegatingRuntimeAdapter {
16
- constructor(options: IpcRuntimeAdapterOptions);
17
- }
18
-
19
- /**
20
- * @deprecated Native Tauri support now lives in the first-party `openrtc-tauri` package.
21
- * Removal target: OpenRTC 0.2.0. This shim remains for one compatibility cycle.
22
- */
23
- declare function createTauriIpcBridge(): PlutoIpcBridge;
24
- /**
25
- * @deprecated Native Tauri support now lives in the first-party `openrtc-tauri` package.
26
- * Removal target: OpenRTC 0.2.0. This shim remains for one compatibility cycle.
27
- */
28
- declare class TauriRuntimeAdapter extends IpcRuntimeAdapter {
29
- constructor(options: NativeIpcBridgeOptions);
30
- }
31
- type TauriRuntimeAdapterOptions = NativeIpcBridgeOptions;
32
-
33
- export { IpcRuntimeAdapter as I, TauriRuntimeAdapter as T, type IpcRuntimeAdapterOptions as a, type TauriRuntimeAdapterOptions as b, createTauriIpcBridge as c };