openrtc 2.0.0 → 2.1.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/README.md +11 -8
- package/dist/{DelegatingRuntimeAdapter-BFZDC604.d.ts → DelegatingRuntimeAdapter-BkLR3TNN.d.ts} +33 -31
- package/dist/{ITransport-WV6gGMnX.d.ts → ITransport-yaruAmx3.d.ts} +50 -86
- package/dist/{IpcRuntimeAdapter-CJq3dRBF.d.ts → IpcRuntimeAdapter-DDKeQ6UC.d.ts} +6 -6
- package/dist/WasmBridge-DVQ2YPRB.js +1 -0
- package/dist/{assembly-q0jRRpsc.d.ts → assembly-BTzwQuwI.d.ts} +67 -74
- package/dist/{capabilities-BfZi4Cd7.d.ts → capabilities-BwzPe51I.d.ts} +19 -19
- package/dist/chunk-4N6UDVZR.js +1 -0
- package/dist/chunk-AJQVMVYW.js +1 -0
- package/dist/{chunk-VBUDERMM.js → chunk-BYOPTGET.js} +1 -1
- package/dist/chunk-DI5VSZ2T.js +2 -0
- package/dist/chunk-EDUGFJHN.js +2 -0
- package/dist/chunk-F4BJ72HN.js +1 -0
- package/dist/{chunk-LRT5GEGH.js → chunk-FKEKINIM.js} +2 -2
- package/dist/chunk-GND6UW37.js +1 -0
- package/dist/{chunk-Z2WVSXPW.js → chunk-HUG5AX7R.js} +1 -1
- package/dist/chunk-LN4ALFT6.js +1 -0
- package/dist/chunk-NXM5ZGHD.js +2 -0
- package/dist/chunk-OUFHVLDQ.js +2 -0
- package/dist/chunk-SUWCBTBQ.js +1 -0
- package/dist/chunk-UGZJJQPM.js +3 -0
- package/dist/chunk-ZA44REGI.js +2 -0
- package/dist/controlPlane-JJFURVOX.js +1 -0
- package/dist/{OpenRTCShared.d.ts → coreClient.d.ts} +61 -66
- package/dist/coreClient.js +1 -0
- package/dist/deviceEnrollment-Z2EHP2EX.js +2 -0
- package/dist/{deviceKey-SBNKLVYF.js → deviceKey-C6UE7QDV.js} +1 -1
- package/dist/deviceProfile-CR2C7OYR.js +2 -0
- package/dist/index.d.ts +30 -30
- package/dist/index.js +1 -1
- package/dist/{ipc-CflAVodw.d.ts → ipc-CPnNwv6f.d.ts} +3 -3
- package/dist/ipcFactory-DQFK65VE.js +1 -0
- package/dist/openrtc-DFZOQJ7V.js +2 -0
- package/dist/openrtc_bg.wasm +0 -0
- package/dist/runtime/WasmRuntimeAdapter.d.ts +4 -4
- package/dist/runtime/WasmRuntimeAdapter.js +1 -1
- package/dist/runtime/device-status.d.ts +10 -10
- package/dist/runtime/device-status.js +1 -1
- package/dist/runtime/factories.d.ts +8 -8
- package/dist/runtime/factories.js +1 -1
- package/dist/runtime/index.d.ts +50 -50
- package/dist/runtime/index.js +1 -1
- package/dist/testing.d.ts +126 -13
- package/dist/testing.js +1 -1
- package/dist/transport/index.d.ts +24 -24
- package/dist/transport/index.js +1 -1
- package/dist/{types-DVNSd5B9.d.ts → types-D67HlF0p.d.ts} +58 -102
- package/dist/{types-Di034GVQ.d.ts → types-DCdYg7za.d.ts} +74 -72
- package/package.json +4 -14
- package/dist/OpenRTCShared.js +0 -1
- package/dist/WasmBridge-5GYKXPXK.js +0 -1
- package/dist/chunk-45WBH7E3.js +0 -1
- package/dist/chunk-7FPG3MFF.js +0 -2
- package/dist/chunk-AG2F6MOB.js +0 -1
- package/dist/chunk-CWGKLGJZ.js +0 -1
- package/dist/chunk-D2OJN5S5.js +0 -1
- package/dist/chunk-H5R5ZXXN.js +0 -3
- package/dist/chunk-KJTJLLJE.js +0 -2
- package/dist/chunk-OEVPKC3W.js +0 -1
- package/dist/chunk-VOCOZ57Q.js +0 -2
- package/dist/chunk-XPL7PUBW.js +0 -2
- package/dist/chunk-Z6TZLF4B.js +0 -1
- package/dist/controlPlane-P66ZTVNW.js +0 -2
- package/dist/deviceEnrollment-GL4JPVGG.js +0 -2
- package/dist/deviceProfile-3BEQZLJF.js +0 -2
- package/dist/ipcFactory-B6HBECSU.js +0 -1
- package/dist/native.d.ts +0 -15
- package/dist/native.js +0 -1
- package/dist/openrtc-BFF336RG.js +0 -2
- /package/dist/{deviceManagement-PHY5TIOS.js → deviceManagement-SUMBRXXC.js} +0 -0
- /package/dist/{deviceRoster-VZA3TQOR.js → deviceRoster-EUF6BBF5.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrtc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,10 +35,6 @@
|
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
36
|
"import": "./dist/index.js"
|
|
37
37
|
},
|
|
38
|
-
"./native": {
|
|
39
|
-
"types": "./dist/native.d.ts",
|
|
40
|
-
"import": "./dist/native.js"
|
|
41
|
-
},
|
|
42
38
|
"./testing": {
|
|
43
39
|
"types": "./dist/testing.d.ts",
|
|
44
40
|
"import": "./dist/testing.js"
|
|
@@ -64,22 +60,16 @@
|
|
|
64
60
|
"scripts": {
|
|
65
61
|
"build": "tsup",
|
|
66
62
|
"check:lightweight-entry": "node scripts/check-lightweight-entry.mjs",
|
|
67
|
-
"check:native-bundle": "node scripts/check-native-
|
|
63
|
+
"check:native-bundle": "node scripts/check-native-bundle.mjs",
|
|
68
64
|
"build:clean": "rm -rf dist && pnpm run build",
|
|
69
65
|
"release:prepare": "pnpm run build:wasm && pnpm run build:clean && pnpm run check:lightweight-entry && pnpm run check:native-bundle",
|
|
70
66
|
"build:types": "tsc --noEmit",
|
|
71
67
|
"build:wasm": "cd ../../crates/openrtc && OPENRTC_REPO_ROOT=$(cd ../.. && pwd) && CARGO_REGISTRY_ROOT=${CARGO_HOME:-$HOME/.cargo} && RUSTUP_TOOLCHAIN=nightly RUSTFLAGS=\"-Zlocation-detail=none --remap-path-prefix=$HOME=/home --remap-path-prefix=$CARGO_REGISTRY_ROOT=/cargo --remap-path-prefix=$OPENRTC_REPO_ROOT=/openrtc\" wasm-pack build --target web --out-dir ../../packages/openrtc/wasm . --features iroh-protocols-wasm,iroh-transport-webrtc,iroh-transport-moq && rm -rf ../../packages/openrtc/wasm/.gitignore",
|
|
72
|
-
"build:wasm:legacy": "cd ../../crates/openrtc && OPENRTC_REPO_ROOT=$(cd ../.. && pwd) && CARGO_REGISTRY_ROOT=${CARGO_HOME:-$HOME/.cargo} && RUSTUP_TOOLCHAIN=nightly RUSTFLAGS=\"-Zlocation-detail=none --remap-path-prefix=$HOME=/home --remap-path-prefix=$CARGO_REGISTRY_ROOT=/cargo --remap-path-prefix=$OPENRTC_REPO_ROOT=/openrtc\" wasm-pack build --target web --out-dir ../../packages/openrtc/wasm . --features legacy-v1,iroh-protocols-wasm,iroh-transport-webrtc,iroh-transport-moq && rm -rf ../../packages/openrtc/wasm/.gitignore",
|
|
73
68
|
"test": "pnpm run test:deterministic && pnpm run test:emulator",
|
|
74
69
|
"test:deterministic": "OPENRTC_DETERMINISTIC_TESTS=1 vitest run tests/unit tests/contract",
|
|
75
70
|
"test:emulator": "node ../../tests/emulator/run-emulator-suite.mjs",
|
|
76
|
-
"test:
|
|
77
|
-
"test:
|
|
78
|
-
"test:avenues:full": "OPENRTC_EMULATOR_TRANSPORT_MATRIX_FULL=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_FIVE=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_REFRESH_FOCUS=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_FLICKER=1 OPENRTC_EMULATOR_TRANSPORT_MATRIX_RELAY_ONLY=1 OPENRTC_EMULATOR_TEST_FILTER='tests/emulator/AvenueRetention.emulator.test.ts tests/emulator/DriveGrant.revoke-enforcement.desktop-wasm.emulator.test.ts tests/emulator/DriveGrant.zombie-replacement.native-wasm.emulator.test.ts tests/emulator/MagicLink.ephemeral-session.desktop-wasm.emulator.test.ts tests/emulator/MagicLink.ephemeral-session.wasm-wasm.emulator.test.ts tests/emulator/MultiDeviceStress.transport-matrix.emulator.test.ts tests/emulator/NativeStandaloneAuth.parity.emulator.test.ts tests/emulator/RealOpenRtcAcceptance.native-wasm.emulator.test.ts tests/emulator/ThreeStoreReconciliation.disconnect.desktop-wasm.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.desktop-desktop.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.desktop-wasm.emulator.test.ts tests/emulator/UserDevice.persistent-autoconnect.wasm-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.offer-answer.native-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.preexisting-acl-share.desktop-desktop.emulator.test.ts tests/emulator/WebRtcUpgrade.preexisting-acl-share.desktop-wasm.emulator.test.ts tests/emulator/WebRtcUpgrade.reliability.native-wasm.emulator.test.ts' pnpm run test:emulator",
|
|
79
|
-
"test:emulator:running": "FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9100 FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 OPENRTC_FIRESTORE_HOST=127.0.0.1:8082 VITE_USE_EMULATORS=true VITE_OPENRTC_FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 vitest run tests/emulator --no-file-parallelism --maxWorkers=1 --maxConcurrency=1",
|
|
80
|
-
"test:acceptance:native:running": "FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9100 FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 OPENRTC_FIRESTORE_HOST=127.0.0.1:8082 VITE_USE_EMULATORS=true VITE_OPENRTC_FIRESTORE_EMULATOR_HOST=127.0.0.1:8082 vitest run tests/emulator/RealOpenRtcAcceptance.native-wasm.emulator.test.ts --no-file-parallelism --maxWorkers=1 --maxConcurrency=1",
|
|
81
|
-
"test:live": "pnpm run build:wasm:legacy && pnpm run build && vitest run tests/live",
|
|
82
|
-
"test:live:emulator": "FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099 vitest run tests/live",
|
|
71
|
+
"test:emulator:running": "vitest run tests/emulator --no-file-parallelism --maxWorkers=1 --maxConcurrency=1",
|
|
72
|
+
"test:acceptance:native:running": "vitest run tests/emulator/RealOpenRtcAcceptance.native-wasm.emulator.test.ts --no-file-parallelism --maxWorkers=1 --maxConcurrency=1",
|
|
83
73
|
"test:watch": "vitest",
|
|
84
74
|
"coverage": "vitest run --coverage",
|
|
85
75
|
"prepublishOnly": "pnpm run release:prepare"
|
package/dist/OpenRTCShared.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {n}from'./chunk-KJTJLLJE.js';import'./chunk-45WBH7E3.js';import'./chunk-NRXEG5GQ.js';function O(i){let s=n({...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 resolveOptions,I as wrapAssembly};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{y as WasmBridge}from'./chunk-VOCOZ57Q.js';import'./chunk-AG2F6MOB.js';import'./chunk-CWGKLGJZ.js';import'./chunk-KJTJLLJE.js';import'./chunk-45WBH7E3.js';import'./chunk-NRXEG5GQ.js';
|
package/dist/chunk-45WBH7E3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.freeze([Object.freeze({id:"iroh-lan",baseProtocol:"iroh",family:"iroh-path",implementation:"path-label",locality:"nearby",maturity:"stable",defaultRank:0,browser:false,native:true,independentlyInstantiable:false}),Object.freeze({id:"webrtc-lan",baseProtocol:"webrtc",family:"optional-route",implementation:"path-label",locality:"nearby",maturity:"stable",defaultRank:1,browser:true,native:true,independentlyInstantiable:false}),Object.freeze({id:"ble",baseProtocol:"iroh",family:"iroh-physical",implementation:"host-installed",locality:"nearby",maturity:"experimental",defaultRank:2,browser:false,native:true,independentlyInstantiable:false}),Object.freeze({id:"iroh-webrtc",baseProtocol:"iroh",family:"iroh-physical",implementation:"carrier-adapter",locality:"mixed",maturity:"stable",defaultRank:3,browser:true,native:true,independentlyInstantiable:false}),Object.freeze({id:"webrtc",baseProtocol:"webrtc",family:"optional-route",implementation:"route-adapter",locality:"mixed",maturity:"stable",defaultRank:4,browser:true,native:true,independentlyInstantiable:true}),Object.freeze({id:"iroh-moq",baseProtocol:"iroh",family:"iroh-physical",implementation:"carrier-adapter",locality:"relay",maturity:"experimental",defaultRank:5,browser:true,native:true,independentlyInstantiable:false}),Object.freeze({id:"moq",baseProtocol:"moq",family:"optional-route",implementation:"route-adapter",locality:"relay",maturity:"experimental",defaultRank:6,browser:true,native:true,independentlyInstantiable:true}),Object.freeze({id:"iroh",baseProtocol:"iroh",family:"iroh-path",implementation:"core",locality:"mixed",maturity:"stable",defaultRank:7,browser:true,native:true,independentlyInstantiable:false}),Object.freeze({id:"iroh-quic",baseProtocol:"iroh",family:"iroh-path",implementation:"path-label",locality:"direct-internet",maturity:"stable",defaultRank:8,browser:false,native:true,independentlyInstantiable:false}),Object.freeze({id:"iroh-relay",baseProtocol:"iroh",family:"iroh-path",implementation:"path-label",locality:"relay",maturity:"stable",defaultRank:9,browser:true,native:true,independentlyInstantiable:false}),Object.freeze({id:"webrtc-turn",baseProtocol:"webrtc",family:"optional-route",implementation:"path-label",locality:"relay",maturity:"stable",defaultRank:10,browser:true,native:true,independentlyInstantiable:false})]),r=Object.freeze(Object.fromEntries(t.map(e=>[e.id,e]))),o=Object.freeze(["iroh-lan","webrtc-lan","ble","iroh-webrtc","webrtc","iroh-moq","moq","iroh","iroh-quic","iroh-relay","webrtc-turn"]),a=Object.freeze(["iroh-lan","webrtc-lan","ble","iroh-webrtc","webrtc","iroh-moq","moq","iroh"]),i=Object.freeze({iroh:80,"iroh-quic":30,"iroh-relay":70,"iroh-lan":10,ble:25,"iroh-webrtc":27,webrtc:40,"webrtc-lan":20,"webrtc-turn":60,"iroh-moq":55,moq:50});var l=t,n=r,R=o,s=a,m=i;function p(e){return n[e]}function u(){return l}export{l as a,R as b,s as c,m as d,p as e,u as f};
|
package/dist/chunk-7FPG3MFF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-VBUDERMM.js';function p(){let r=crypto.getRandomValues(new Uint8Array(24)),e="";for(let t of r)e+=String.fromCharCode(t);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function u(r){if(!r||typeof r!="object")throw new Error("[OpenRTC] Native host returned no device public key.");let e=r;if(e.kty!=="OKP"||e.crv!=="Ed25519"||typeof e.x!="string"||!/^[A-Za-z0-9_-]{43}$/.test(e.x)||e.d!==void 0)throw new Error("[OpenRTC] Native host returned an invalid Ed25519 public key.");return {kty:"OKP",crv:"Ed25519",x:e.x}}function v(r){return {async readSecureRecord(e,t){return r.invoke("openrtc_v2_read_secure_record",{appTag:e,key:t})},async writeSecureRecord(e,t,n){await r.invoke("openrtc_v2_write_secure_record",{appTag:e,key:t,value:n});},async deleteSecureRecord(e,t){await r.invoke("openrtc_v2_delete_secure_record",{appTag:e,key:t});},async delete(e){await r.invoke("openrtc_v2_delete_device_key",{appTag:e});},async getOrCreate(e){let t=u(await r.invoke("openrtc_v2_device_public_key",{appTag:e})),n=await a(t);return {publicKeyJwk:t,thumbprint:n,async proof(s){let o=p(),c=Math.floor(Date.now()/1e3),i=await r.invoke("openrtc_v2_sign_device_proof",{appTag:e,challenge:s(o,c)});if(!/^[A-Za-z0-9_-]{80,128}$/.test(i))throw new Error("[OpenRTC] Native host returned an invalid device proof.");return {publicKeyJwk:t,signature:i,nonce:o,issuedAt:c}}}}}}
|
|
2
|
-
export{v as a};
|
package/dist/chunk-AG2F6MOB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b,e}from'./chunk-45WBH7E3.js';import {xchacha20poly1305}from'@noble/ciphers/chacha.js';function I(){if(typeof globalThis<"u"&&globalThis.__OPENRTC_DEBUG__===true)return true;if(typeof localStorage<"u")try{return localStorage.getItem("openrtc:debug")==="1"}catch{return false}return false}function L(t,e,r){if(I()){if(typeof r>"u"){console[t](e);return}console[t](e,r);}}function Y(t,e){L("debug",t,e);}function $(t,e){L("info",t,e);}function G(t,e){L("log",t,e);}function H(t){return new Promise(e=>setTimeout(e,t))}function K(t){let e=new Uint8Array(t.byteLength);return e.set(t),e}function B(t){let e=t.reduce((s,c)=>s+c.byteLength,0),r=new Uint8Array(e),a=0;for(let s of t)r.set(s,a),a+=s.byteLength;return r}function Q(t,e,r){let a=e*Math.pow(2,Math.max(0,t-1));return Math.min(r,a)}function j(t){try{let e=t;return !!e&&!!e.send&&typeof e.send.getWriter=="function"&&!!e.recv&&typeof e.recv.getReader=="function"}catch{return false}}function J(t,e,r){let a=t;if(!a)return null;try{let s=a.send,c=a.recv;if(!s||typeof s.getWriter!="function"||!c||typeof c.getReader!="function")return null;let f=typeof a.endpoint_id=="string"&&a.endpoint_id.trim().length>0?a.endpoint_id:e,i=Number.isSafeInteger(a.transport_stable_id)&&Number(a.transport_stable_id)>0?Number(a.transport_stable_id):void 0,y=Number.isSafeInteger(r)&&Number(r)>0?Number(r):void 0;if(i!==void 0&&y!==void 0&&i!==y)return null;let o=i??y;return {send:s,recv:c,endpoint_id:f,...o?{transport_stable_id:o}:{}}}catch{return null}}function Z(t,e){let r={send:t.send,recv:e,endpoint_id:typeof t.endpoint_id=="string"?t.endpoint_id:"",...Number.isSafeInteger(t.transport_stable_id)&&Number(t.transport_stable_id)>0?{transport_stable_id:Number(t.transport_stable_id)}:{}};return t?.applicationCryptoWrapped===true&&(r.applicationCryptoWrapped=true),r}async function ee(t,e){if(!t)return false;try{let r=t.send?.getWriter?.();if(r)try{await r.close();}catch{}finally{try{r.releaseLock();}catch{}}}catch{}try{let r=t.recv?.getReader?.();if(r)try{await r.cancel(e);}catch{}finally{try{r.releaseLock();}catch{}}}catch{}return true}function te(t,e,r={}){let a=r.context??"prependBytesToReader",s=r.traceId,c=e.byteLength===0,f=r.pendingRead??null,i=o=>r.release?.(o),y=(o,n)=>r.log?.(o,n);return new ReadableStream({async pull(o){if(!c){c=true,o.enqueue(e);return}if(f){let l=f;f=null;let d;try{d=await l;}catch(u){o.error(u),i("pending-read-error"),y("prepend-bytes:pending-read-error",{context:a,traceId:s||null,error:u?.message||String(u)});return}if(d.done){o.close(),i("pending-done");return}d.value&&o.enqueue(d.value);return}let n;try{n=await t.read();}catch(l){o.error(l),i("read-error"),y("prepend-bytes:read-error",{context:a,traceId:s||null,error:l?.message||String(l)});return}let{done:p,value:b}=n;if(p){o.close(),i("done");return}b&&o.enqueue(b);},async cancel(o){i("cancel");}})}async function re(t,e){let r=t.read(),a=e-Date.now();if(a<=0)return {status:"timeout",pendingRead:r};let s=Symbol("probe-timeout"),c,f=new Promise(i=>{c=setTimeout(()=>i(s),a);});try{let i=await Promise.race([r,f]);if(i===s)return {status:"timeout",pendingRead:r};let{done:y,value:o}=i;return y?{status:"done"}:{status:"data",value:o&&o.byteLength>0?new Uint8Array(o):new Uint8Array(0)}}finally{c&&clearTimeout(c);}}var N=b,k=new Set(N);function A(t){if(typeof t!="string")return;let e=t.trim().toLowerCase();return k.has(e)?e:void 0}function oe(t){let e$1=A(t);return e$1?e(e$1).baseProtocol==="iroh":false}function ie(t){let e$1=A(t);if(!e$1)return false;let r=e(e$1);return r.baseProtocol==="iroh"&&(r.locality==="nearby"||r.locality==="direct-internet")}function se(t){let e$1=A(t);return e$1?e(e$1).family==="optional-route":false}function ue(t){let e$1=A(t);return e$1?e(e$1).baseProtocol==="webrtc":false}function ce(t){let e$1=A(t);if(!e$1)return false;let r=e(e$1);return r.baseProtocol==="iroh"&&r.implementation==="carrier-adapter"}function le(t,e,r=false){return t==="relay"||e==="relay"?"webrtc-turn":t==="host"&&e==="host"||r&&t&&e?"webrtc-lan":"webrtc"}function de(t){let e$1=A(t);return e$1?e(e$1).independentlyInstantiable:false}var g=new Uint8Array([79,82,84,67,69,49]),T=2,w=8,h=24,_=32,C=3,D=16*1024*1024,q=4096;function F(t,e){if(t.byteLength<e.byteLength)return false;let r=0;for(let a=0;a<e.byteLength;a+=1)r|=t[a]^e[a];return r===0}function W(t){let e=new Uint8Array(t),r=globalThis.crypto;if(!r||typeof r.getRandomValues!="function")throw new Error("[OpenRTC] application payload crypto requires crypto.getRandomValues");return r.getRandomValues(e),e}function V(t,e){let r="";for(let a of e)r+=a.toString(16).padStart(2,"0");return `${t}:${r}`}function v(t){if(!F(t,g))return null;let e=t[g.byteLength];return e===T?e:null}function M(t){return v(t)===T&&t.byteLength>g.byteLength+1+w+h}function be(t,e={}){if(!(t instanceof Uint8Array)||t.byteLength!==_)throw new Error(`[OpenRTC] application payload crypto key must be ${_} bytes`);let r=new Uint8Array(t),a=e.requireEncrypted??true,s=e.randomBytes??W,c=e.replayProtection??true,f=0,i=new Set,y=[];return {requireEncrypted:a,protectPayload(o,n){let p=s(h);if(!(p instanceof Uint8Array)||p.byteLength!==h)throw new Error(`[OpenRTC] application payload crypto nonce must be ${h} bytes`);let b=new Uint8Array(1+n.byteLength);b[0]=o,b.set(n,1);let l=xchacha20poly1305(r,p).encrypt(b);if(!c)throw new Error("[OpenRTC] ORTCE1 v1 envelopes are not supported; replay protection is required");let d=new Uint8Array(g.byteLength+1+w+p.byteLength+l.byteLength),u=0;d.set(g,u),u+=g.byteLength,d[u]=T,u+=1;let S=f;return f+=1,new DataView(d.buffer,d.byteOffset+u,w).setBigUint64(0,BigInt(S),false),u+=w,d.set(p,u),u+=p.byteLength,d.set(l,u),d},openPayload(o,n){if(!M(n))return a?null:n;if(v(n)!==T)return null;let b=g.byteLength+1,l=Number(new DataView(n.buffer,n.byteOffset+b,w).getBigUint64(0,false));if(!Number.isFinite(l))return null;let d=b+w,u=d+h,S=n.slice(d,u),R=c?V(l,S):null;if(R&&i.has(R))return null;let O=n.slice(u),U;try{U=xchacha20poly1305(r,S).decrypt(O);}catch{return null}if(U.byteLength<1||U[0]!==o)return null;if(R)for(i.add(R),y.push(R);y.length>q;){let x=y.shift();x&&i.delete(x);}return U.slice(1)}}}function z(t){let e=new Uint8Array(4+t.byteLength);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint32(0,t.byteLength,false),e.set(t,4),e}function me(t,e={}){let r=e.typeId??C,a=e.maxFrameBytes??D;if(!Number.isInteger(r)||r<0||r>255)throw new Error("[OpenRTC] raw application crypto stream typeId must be an integer from 0 to 255");if(!Number.isInteger(a)||a<=0)throw new Error("[OpenRTC] raw application crypto maxFrameBytes must be a positive integer");let s=n=>t.protectPayload(r,n),c=n=>t.openPayload(r,n),f=()=>new TransformStream({transform(n,p){p.enqueue(z(s(new Uint8Array(n))));}}),i=()=>{let n=new Uint8Array(0);return new TransformStream({transform(p,b){for(n=B([n,new Uint8Array(p)]);n.byteLength>=4;){let l=new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,false);if(l===0||l>a)throw new Error("[OpenRTC] invalid encrypted raw stream frame length");if(n.byteLength<4+l)return;let d=n.slice(4,4+l);n=n.slice(4+l);let u=c(d);if(!u)throw new Error("[OpenRTC] encrypted raw stream frame failed authentication");b.enqueue(u);}},flush(){if(n.byteLength!==0)throw new Error("[OpenRTC] encrypted raw stream ended mid-frame")}})},y=n=>n.pipeThrough(i()),o=n=>{let p=f();return p.readable.pipeTo(n).catch(()=>{}),p.writable};return {typeId:r,protectFrame:s,openFrame:c,createOutboundTransform:f,createInboundTransform:i,wrapReadable:y,wrapWritable:o,wrapBiStream(n){return {...n,send:o(n.send),recv:y(n.recv)}}}}export{I as a,Y as b,$ as c,G as d,H as e,K as f,B as g,Q as h,j as i,J as j,Z as k,ee as l,te as m,re as n,N as o,A as p,oe as q,ie as r,se as s,ue as t,ce as u,le as v,de as w,M as x,be as y,me as z};
|
package/dist/chunk-CWGKLGJZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={AUTH_NOT_READY:"auth/not-ready",AUTH_DENIED:"auth/denied",AUTH_EXPIRED:"auth/expired",AUTH_DEVICE_REENROLLMENT_REQUIRED:"auth/device-reenrollment-required",ADMISSION_DENIED:"admission/denied",ADMISSION_SCOPE_MISMATCH:"admission/scope-mismatch",BUDGET_EXCEEDED:"budget/exceeded",BUDGET_STALE:"budget/stale",BUDGET_RENEWAL_REQUIRED:"budget/renewal-required",COORDINATION_DISCONNECTED:"coordination/disconnected",COORDINATION_PROTOCOL:"coordination/protocol",COORDINATION_RATE_LIMITED:"coordination/rate-limited",COORDINATION_SERVICE_UNAVAILABLE:"coordination/service-unavailable",TRANSPORT_DIAL_EXHAUSTED:"transport/dial-exhausted",TRANSPORT_UNAVAILABLE:"transport/unavailable",TRANSPORT_TICKET_MISSING:"transport/ticket-missing",DELIVERY_NOT_READY:"delivery/not-ready",INTERNAL:"internal/error"},i=class e extends Error{constructor(n){super(n.message);this.name="OpenRtcError";n.cause!==void 0&&(this.cause=n.cause),this.code=n.code,this.retryable=n.retryable,this.plane=n.plane,this.generation=n.generation,this.transportGeneration=n.transportGeneration,this.routeGeneration=n.routeGeneration,this.revision=n.revision;}static isOpenRtcError(n){return n instanceof e||typeof n=="object"&&n!==null&&n.name==="OpenRtcError"&&typeof n.code=="string"&&typeof n.retryable=="boolean"&&typeof n.plane=="string"}static shouldAppRetry(n){let t=c(n);return t.retryable?t.plane==="coordination"||t.plane==="transport"||t.plane==="auth":false}toJSON(){return {name:this.name,code:this.code,message:this.message,retryable:this.retryable,plane:this.plane,generation:this.generation??null,transportGeneration:this.transportGeneration??null,routeGeneration:this.routeGeneration??null,revision:this.revision??null}}};function R(e){let a=c(e);return {errorCode:a.code,retryable:a.retryable,errorPlane:a.plane}}function o(e,a,n){let t=d(e);return new i({code:e,message:a,retryable:n.retryable??t.retryable,plane:n.plane??t.plane,cause:n.cause,generation:n.generation,transportGeneration:n.transportGeneration,routeGeneration:n.routeGeneration,revision:n.revision})}function d(e){switch(e){case r.AUTH_NOT_READY:case r.AUTH_EXPIRED:case r.AUTH_DEVICE_REENROLLMENT_REQUIRED:return {retryable:true,plane:"auth"};case r.AUTH_DENIED:return {retryable:false,plane:"auth"};case r.ADMISSION_DENIED:case r.ADMISSION_SCOPE_MISMATCH:return {retryable:false,plane:"admission"};case r.BUDGET_EXCEEDED:return {retryable:false,plane:"budget"};case r.BUDGET_STALE:case r.BUDGET_RENEWAL_REQUIRED:return {retryable:true,plane:"budget"};case r.COORDINATION_DISCONNECTED:case r.COORDINATION_RATE_LIMITED:case r.COORDINATION_SERVICE_UNAVAILABLE:return {retryable:true,plane:"coordination"};case r.COORDINATION_PROTOCOL:return {retryable:false,plane:"coordination"};case r.TRANSPORT_DIAL_EXHAUSTED:case r.TRANSPORT_UNAVAILABLE:case r.TRANSPORT_TICKET_MISSING:return {retryable:true,plane:"transport"};case r.DELIVERY_NOT_READY:return {retryable:true,plane:"delivery"};case r.INTERNAL:default:return {retryable:false,plane:"internal"}}}function c(e){if(i.isOpenRtcError(e))return e instanceof i?e:new i({code:e.code,message:e.message||String(e),retryable:e.retryable,plane:e.plane,cause:e,generation:e.generation,transportGeneration:e.transportGeneration,routeGeneration:e.routeGeneration,revision:e.revision});if(typeof e=="object"&&e!==null){let n=e,t=typeof n.code=="string"?n.code:"",l=typeof n.message=="string"?n.message:e instanceof Error?e.message:String(e),s=typeof n.retryable=="boolean"?n.retryable:void 0;if(t){let u=p(t,l,s);if(u)return u}if(typeof n.name=="string"&&n.name==="CoordinationConnectError")return o(r.COORDINATION_DISCONNECTED,l,{retryable:s??true,plane:"coordination",cause:e});if(typeof n.name=="string"&&n.name==="CoordinationGatewayProtocolError")return o(t||r.COORDINATION_PROTOCOL,l,{retryable:s??false,plane:E(t),cause:e})}let a=e instanceof Error?e.message:String(e??"unknown error");return O(a,e)}function p(e,a,n){let t=e.trim().toLowerCase();return t==="unauthenticated"||t==="functions/unauthenticated"||t==="auth/unauthorized"||t.includes("permission-denied")?o(r.AUTH_DENIED,a,{retryable:false,plane:"auth"}):t==="budget-renewal-required"||t==="budget/renewal-required"?o(r.BUDGET_RENEWAL_REQUIRED,a,{retryable:n??true,plane:"budget"}):t.includes("resource-exhausted")||t.includes("budget")||t==="budget-exceeded"||t==="insufficient-budget"?t.includes("stale")||/stale-budget/i.test(a)?o(r.BUDGET_STALE,a,{retryable:n??true,plane:"budget"}):o(r.BUDGET_EXCEEDED,a,{retryable:false,plane:"budget"}):t.includes("rate-limit")||t==="rate_limited"||t==="too-many-requests"?o(r.COORDINATION_RATE_LIMITED,a,{retryable:n??true,plane:"coordination"}):t.includes("admission")||t==="permission-denied"||t==="session-token-denied"?o(r.ADMISSION_DENIED,a,{retryable:false,plane:"admission"}):t.includes("scope")?o(r.ADMISSION_SCOPE_MISMATCH,a,{retryable:false,plane:"admission"}):t.includes("disconnect")||t.includes("unavailable")||t==="aborted"?o(r.COORDINATION_DISCONNECTED,a,{retryable:n??true,plane:"coordination"}):t.startsWith("coordination/")||t.includes("protocol")?o(e,a,{retryable:n??false,plane:E(e)}):null}function E(e){let a=e.trim().toLowerCase();return a.includes("budget")?"budget":a.includes("auth")?"auth":a.includes("admission")||a.includes("scope")?"admission":(a.includes("rate"),"coordination")}function O(e,a){return /auth(?:entication)?\s*(?:not ready|pending|missing)/i.test(e)||/token\s*(?:not ready|pending|missing)/i.test(e)||/awaiting[- ]auth/i.test(e)?o(r.AUTH_NOT_READY,e,{retryable:true,plane:"auth",cause:a}):/missing endpoint ticket|ticket missing/i.test(e)?o(r.TRANSPORT_TICKET_MISSING,e,{retryable:true,plane:"transport",cause:a}):/dial.*(exhaust|budget)|retry budget|connection.*did not become application-routable/i.test(e)?o(r.TRANSPORT_DIAL_EXHAUSTED,e,{retryable:true,plane:"transport",cause:a}):/stale[- ]budget/i.test(e)?o(r.BUDGET_STALE,e,{retryable:true,plane:"budget",cause:a}):/budget|credit|quota|limit\s*exceeded/i.test(e)?o(r.BUDGET_EXCEEDED,e,{retryable:false,plane:"budget",cause:a}):/admission|session[- ]token.*(deny|reject)|permission[- ]denied/i.test(e)?o(r.ADMISSION_DENIED,e,{retryable:false,plane:"admission",cause:a}):/not\s+application-routable|not[- ]ready|settledReady/i.test(e)?o(r.DELIVERY_NOT_READY,e,{retryable:true,plane:"delivery",cause:a}):/gateway|coordination|websocket|signaling/i.test(e)?o(r.COORDINATION_DISCONNECTED,e,{retryable:true,plane:"coordination",cause:a}):o(r.INTERNAL,e,{retryable:false,plane:"internal",cause:a})}export{r as a,i as b,R as c,o as d,c as e};
|
package/dist/chunk-D2OJN5S5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {v}from'./chunk-VOCOZ57Q.js';var a=class{constructor(e){this.backend=e;}get currentUser(){return this.backend.currentUser}setAuthContext(e){return this.backend.setAuthContext?.(e)}async signInAnonymously(){return this.backend.signInAnonymously()}async signInWithPluto(){if(typeof this.backend.signInWithPluto!="function")throw new Error("Selected runtime adapter does not support Pluto SSO.");return this.backend.signInWithPluto()}async signOut(){return this.backend.signOut()}async stopAuthScopedActivity(){typeof this.backend.stopAuthScopedActivity=="function"&&await this.backend.stopAuthScopedActivity();}usesCoordinationGateway(){return this.backend.usesCoordinationGateway?.()===true}async joinCoordinationRoom(e,n,t){if(!this.backend.joinCoordinationRoom)throw new Error("Selected runtime adapter does not support coordination rooms.");await this.backend.joinCoordinationRoom(e,n,t);}async leaveCoordinationRoom(e){if(!this.backend.leaveCoordinationRoom)throw new Error("Selected runtime adapter does not support coordination rooms.");await this.backend.leaveCoordinationRoom(e);}async getCoordinationRoomMembers(e){if(!this.backend.getCoordinationRoomMembers)throw new Error("Selected runtime adapter does not support coordination rooms.");return this.backend.getCoordinationRoomMembers(e)}watchCoordinationRoomMembers(e,n){if(!this.backend.watchCoordinationRoomMembers)throw new Error("Selected runtime adapter does not support coordination rooms.");return this.backend.watchCoordinationRoomMembers(e,n)}async getTurnCredentials(){return this.backend.getTurnCredentials()}async updatePresence(e,n,t,i,r){return this.backend.updatePresence(e,n,t,i,r)}async refreshLivePresence(e,n,t){if(typeof this.backend.refreshLivePresence!="function")throw new Error("Selected runtime adapter does not support refreshLivePresence().");return this.backend.refreshLivePresence(e,n,t)}async setOffline(e){return this.backend.setOffline(e)}async cleanupStaleDevices(){return this.backend.cleanupStaleDevices()}async searchDevices(e){return this.backend.searchDevices(e)}async listDevicesWithStatus(){if(typeof this.backend.listDevicesWithStatus!="function")throw new Error("Selected runtime adapter does not support listDevicesWithStatus().");return this.backend.listDevicesWithStatus()}async getPeerSession(e){return typeof this.backend.getPeerSession!="function"?null:this.backend.getPeerSession(e)}async listPeerSessions(){return typeof this.backend.listPeerSessions!="function"?[]:this.backend.listPeerSessions()}async waitForSettledPeer(e,n){return typeof this.backend.waitForSettledPeer!="function"?null:this.backend.waitForSettledPeer(e,n)}async resolvePeerIdentity(e){return typeof this.backend.resolvePeerIdentity!="function"?{peerId:null,deviceId:null,deviceIdHint:null,nodeId:null}:this.backend.resolvePeerIdentity(e)}async resolvePeerConnectionRecords(e){return typeof this.backend.resolvePeerConnectionRecords!="function"?[]:this.backend.resolvePeerConnectionRecords(e)}async updateDevice(e,n){return this.backend.updateDevice(e,n)}async deleteDevice(e){return this.backend.deleteDevice(e)}onDevicesChange(e,n){return this.backend.onDevicesChange(e,n)}onAuthChange(e){return this.backend.onAuthChange(e)}async checkForSSOToken(){return this.backend.checkForSSOToken()}async waitForAuth(){return this.backend.waitForAuth()}async sendMessage(e,n,t,i){return this.backend.sendMessage(e,n,t,i)}async pollMessages(e){return this.backend.pollMessages(e)}watchFriendDevices(e,n){let t=this.backend;return t.watchFriendDevices?t.watchFriendDevices(e,n):()=>{}}async updateFriendTicket(e){let n=this.backend;n.updateFriendTicket&&await n.updateFriendTicket(e);}async subscribeDevices(e){return this.backend.subscribeDevices(e)}startAutoConnect(e,n){this.backend.startAutoConnect(e,n);}async submitDesiredPeerProjection(e,n){if(typeof this.backend.submitDesiredPeerProjection!="function")throw new Error("Selected runtime adapter does not support desired-peer projections.");await this.backend.submitDesiredPeerProjection(e,n);}startPresenceLoop(e,n,t,i,r){this.backend.startPresenceLoop(e,n,t,i,r);}async createSession(e){return this.backend.createSession(e)}async updateSession(e,n){return this.backend.updateSession(e,n)}async subscribeSessions(e){return this.backend.subscribeSessions(e)}forceReconnectSnapshot(){this.backend.forceReconnectSnapshot();}async getLocalDeviceId(){return typeof this.backend.getLocalDeviceId!="function"?null:this.backend.getLocalDeviceId()}async getLocalDeviceInfo(){return typeof this.backend.getLocalDeviceInfo!="function"?null:this.backend.getLocalDeviceInfo()}async updateLocalDeviceName(e){return typeof this.backend.updateLocalDeviceName!="function"?null:this.backend.updateLocalDeviceName(e)}async startManagedSessionNative(e){let n=this.backend;if(typeof n.startManagedSessionNative!="function")throw new Error("Selected runtime adapter does not support startManagedSessionNative().");return n.startManagedSessionNative(e)}async notifyNetworkChange(e){return typeof this.backend.notifyNetworkChange!="function"?null:this.backend.notifyNetworkChange(e)}async getManagedNodeId(e){if(console.info("[DelegatingRuntimeAdapter][getManagedNodeId] enter",{hasMethod:typeof this.backend.getManagedNodeId=="function",backendCtor:this.backend.constructor?.name??null}),typeof this.backend.getManagedNodeId!="function")return null;let n=await this.backend.getManagedNodeId(e);return console.info("[DelegatingRuntimeAdapter][getManagedNodeId] resolved",{result:n}),n}async startPresenceLoopOnce(e,n,t,i,r){let o=this.backend;if(typeof o.startPresenceLoopOnce!="function")throw new Error("Selected runtime adapter does not support startPresenceLoopOnce().");return o.startPresenceLoopOnce(e,n,t,i,r)}async startAutoConnectOnce(e,n){let t=this.backend;if(typeof t.startAutoConnectOnce!="function")throw new Error("Selected runtime adapter does not support startAutoConnectOnce().");return t.startAutoConnectOnce(e,n)}async getEndpointTicket(){if(typeof this.backend.getEndpointTicket!="function")throw new Error("Selected runtime adapter does not support getEndpointTicket().");return this.backend.getEndpointTicket()}async getEndpointTicketWithToken(e,n){let t=this.backend;return typeof t.getEndpointTicketWithToken!="function"?null:t.getEndpointTicketWithToken(e,n)}async registerSessionToken(e,n,t,i){let r=this.backend;typeof r.registerSessionToken=="function"&&await r.registerSessionToken(e,n,t,i);}async revokeSessionTokensByScope(e){let n=this.backend;return typeof n.revokeSessionTokensByScope!="function"?[]:n.revokeSessionTokensByScope(e)}async openPeerBi(e,n){if(typeof this.backend.openPeerBi!="function")throw new Error("Selected runtime adapter does not support openPeerBi().");return this.backend.openPeerBi(e,n)}async incoming_streams(){let e=this.backend;if(typeof e.incoming_streams!="function")throw new Error("Selected runtime adapter does not support incoming_streams().");return e.incoming_streams()}async is_current_transport_stable_id(e,n){let t=this.backend;return typeof t.is_current_transport_stable_id!="function"?false:t.is_current_transport_stable_id(e,n)}async openPeerNativeBi(e,n,t){let i=this.backend;if(typeof i.openPeerNativeBi!="function")throw new Error("Selected runtime adapter does not support openPeerNativeBi().");return i.openPeerNativeBi(e,n,t)}async openPeerBiTransportOnly(e,n){let t=this.backend;return typeof t.openPeerBiTransportOnly=="function"?t.openPeerBiTransportOnly(e,n):this.openPeerBi(e,n)}async openPeerUni(e,n){if(typeof this.backend.openPeerUni!="function")throw new Error("Selected runtime adapter does not support openPeerUni().");return this.backend.openPeerUni(e,n)}async connectToDevice(e){if(typeof this.backend.connectToDevice!="function")throw new Error("Selected runtime adapter does not support connectToDevice().");return this.backend.connectToDevice(e)}async disconnectDevice(e){if(typeof this.backend.disconnectDevice!="function")throw new Error("Selected runtime adapter does not support disconnectDevice().");return this.backend.disconnectDevice(e)}async setAutoConnectExcluded(e,n){if(typeof this.backend.setAutoConnectExcluded!="function")throw new Error("Selected runtime adapter does not support setAutoConnectExcluded().");return this.backend.setAutoConnectExcluded(e,n)}async isConnected(e){return this.backend.isConnected(e)}async getConnectionStates(){return typeof this.backend.getConnectionStates!="function"?[]:this.backend.getConnectionStates()}onConnectionStateChange(e){return typeof this.backend.onConnectionStateChange!="function"?()=>{}:this.backend.onConnectionStateChange(e)}async sendExplicitFilePath(e,n,t){if(typeof this.backend.sendExplicitFilePath!="function")throw new Error("Selected runtime adapter does not support sendExplicitFilePath().");return this.backend.sendExplicitFilePath(e,n,t)}async sendExplicitFileData(e){if(typeof this.backend.sendExplicitFileData!="function")throw new Error("Selected runtime adapter does not support sendExplicitFileData().");return this.backend.sendExplicitFileData(e)}async getTransferHistory(e){return typeof this.backend.getTransferHistory!="function"?[]:this.backend.getTransferHistory(e)}async deleteTransferJob(e){if(typeof this.backend.deleteTransferJob=="function")return this.backend.deleteTransferJob(e)}getRuntimeCapabilities(){let e=this.backend;return typeof e.getRuntimeCapabilities=="function"?e.getRuntimeCapabilities():v()}async onIncomingNativeMessage(e){let n=this.backend;return typeof n.onIncomingNativeMessage!="function"?()=>{}:n.onIncomingNativeMessage(e)}unwrap(){return this.backend}setCoreClient(e){let n=this.backend;typeof n.setCoreClient=="function"&&n.setCoreClient(e);}};export{a};
|