openrtc 0.1.2 → 0.2.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 +26 -3
- package/dist/DelegatingRuntimeAdapter-CjHzBEBA.d.ts +180 -0
- package/dist/{IpcRuntimeAdapter-CT-W0Mtp.d.ts → IpcRuntimeAdapter-CtckyMol.d.ts} +2 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/internal.js +1 -1
- package/dist/chunk-3VTF5RKW.js +1 -0
- package/dist/chunk-JXGKO7SX.js +1 -0
- package/dist/chunk-MFT6SOZ6.js +3 -0
- package/dist/chunk-SGZWR63E.js +1 -0
- package/dist/chunk-VARALO7G.js +1 -0
- package/dist/chunk-WOHFM6DI.js +2 -0
- package/dist/chunk-YHJOXD46.js +2 -0
- package/dist/{factories-0TxDPMeu.d.ts → factories-CwZiIRg1.d.ts} +412 -226
- package/dist/index.d.ts +100 -6
- package/dist/index.js +2 -1
- package/dist/openrtc_bg.wasm +0 -0
- package/dist/runtime/WasmRuntimeAdapter.d.ts +2 -1
- package/dist/runtime/WasmRuntimeAdapter.js +1 -1
- package/dist/runtime/index.d.ts +205 -391
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/tauri.d.ts +5 -6
- package/dist/runtime/tauri.js +1 -1
- package/dist/transport/index.d.ts +11 -0
- package/dist/transport/index.js +1 -0
- package/dist/{DelegatingRuntimeAdapter-CW8d78dZ.d.ts → types-DyCGvj9l.d.ts} +200 -170
- package/package.json +12 -10
- package/dist/chunk-4MH42GUI.js +0 -2
- package/dist/chunk-CQAKCS2S.js +0 -4
- package/dist/chunk-D54VGRRH.js +0 -1
- package/dist/chunk-DIQYFAGL.js +0 -2
- package/dist/chunk-PZ25OCVG.js +0 -2
- package/dist/chunk-UVASANPG.js +0 -1
- package/wasm/README.md +0 -64
- package/wasm/openrtc.d.ts +0 -320
- package/wasm/openrtc.js +0 -2290
- package/wasm/openrtc_bg.wasm +0 -0
- package/wasm/openrtc_bg.wasm.d.ts +0 -113
- package/wasm/package.json +0 -16
package/dist/runtime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{q as RuntimeClient,h as RuntimeConnectionController,l as ScopedConnectionActorError,o as ScopedConnectionActorHandle,p as ScopedConnectionActorRegistry,k as clog,j as correlationForDriveGrantScope,s as createIpcClient,r as createWasmClient,i as renderCorrelationFields,m as scopedConnectionKey,n as scopedConnectionKeyToString}from'../chunk-MFT6SOZ6.js';export{a as WasmRuntimeAdapter}from'../chunk-VARALO7G.js';export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-SGZWR63E.js';export{c as IpcRuntimeAdapter}from'../chunk-WOHFM6DI.js';export{s as BROWSER_WASM_RUNTIME_CAPABILITIES,t as NATIVE_IPC_RUNTIME_CAPABILITIES,q as OPENRTC_RUNTIME_POLICY,u as cloneRuntimeCapabilities,r as getRuntimePolicy,i as logOpenRtcTeardownTrace,c as openRtcDebug,b as openRtcDebugEnabled,d as openRtcDebugInfo,e as openRtcDebugLog,v as runtimeCapabilityProfile}from'../chunk-JXGKO7SX.js';import'../chunk-YHJOXD46.js';import'../chunk-3VTF5RKW.js';
|
package/dist/runtime/tauri.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../
|
|
3
|
-
|
|
4
|
-
type TauriBridgeOptions = NativeIpcBridgeOptions;
|
|
1
|
+
import { I as IpcRuntimeAdapter, N as NativeIpcBridgeOptions, P as PlutoIpcBridge } from '../IpcRuntimeAdapter-CtckyMol.js';
|
|
2
|
+
import '../types-DyCGvj9l.js';
|
|
3
|
+
import '../DelegatingRuntimeAdapter-CjHzBEBA.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* @deprecated Native Tauri support now lives in the first-party `openrtc-tauri` package.
|
|
@@ -13,8 +12,8 @@ declare function createTauriIpcBridge(): PlutoIpcBridge;
|
|
|
13
12
|
* Removal target: OpenRTC 0.2.0. This shim remains for one compatibility cycle.
|
|
14
13
|
*/
|
|
15
14
|
declare class TauriRuntimeAdapter extends IpcRuntimeAdapter {
|
|
16
|
-
constructor(options:
|
|
15
|
+
constructor(options: NativeIpcBridgeOptions);
|
|
17
16
|
}
|
|
18
|
-
type TauriRuntimeAdapterOptions =
|
|
17
|
+
type TauriRuntimeAdapterOptions = NativeIpcBridgeOptions;
|
|
19
18
|
|
|
20
19
|
export { TauriRuntimeAdapter, type TauriRuntimeAdapterOptions, createTauriIpcBridge };
|
package/dist/runtime/tauri.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-
|
|
1
|
+
export{b as TauriRuntimeAdapter,a as createTauriIpcBridge}from'../chunk-SGZWR63E.js';import'../chunk-WOHFM6DI.js';import'../chunk-JXGKO7SX.js';import'../chunk-YHJOXD46.js';import'../chunk-3VTF5RKW.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { n as ProtocolName } from '../types-DyCGvj9l.js';
|
|
2
|
+
|
|
3
|
+
declare const TRANSPORT_LABELS: readonly ProtocolName[];
|
|
4
|
+
declare function normalizeTransportLabel(value: unknown): ProtocolName | undefined;
|
|
5
|
+
declare function isIrohBaseTransportLabel(value: unknown): boolean;
|
|
6
|
+
declare function isDirectIrohTransportLabel(value: unknown): boolean;
|
|
7
|
+
declare function isOptionalTransportLabel(value: unknown): boolean;
|
|
8
|
+
declare function isWebRtcTransportLabel(value: unknown): boolean;
|
|
9
|
+
declare function isIndependentTransportLabel(value: unknown): boolean;
|
|
10
|
+
|
|
11
|
+
export { ProtocolName, TRANSPORT_LABELS, isDirectIrohTransportLabel, isIndependentTransportLabel, isIrohBaseTransportLabel, isOptionalTransportLabel, isWebRtcTransportLabel, normalizeTransportLabel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as TRANSPORT_LABELS,d as isDirectIrohTransportLabel,g as isIndependentTransportLabel,c as isIrohBaseTransportLabel,e as isOptionalTransportLabel,f as isWebRtcTransportLabel,b as normalizeTransportLabel}from'../chunk-3VTF5RKW.js';
|
|
@@ -5,32 +5,58 @@ interface AppLimits {
|
|
|
5
5
|
maxRooms: number;
|
|
6
6
|
/** Max members per room. -1 = unlimited. */
|
|
7
7
|
maxMembersPerRoom: number;
|
|
8
|
-
/** Max active devices across all provisioned
|
|
8
|
+
/** Max active devices across all provisioned spaces for this app. -1 = unlimited. */
|
|
9
9
|
maxPersonalDevices: number;
|
|
10
10
|
}
|
|
11
11
|
interface PlutoRTCConfiguration extends RTCConfiguration {
|
|
12
12
|
iceServers?: RTCIceServer[];
|
|
13
13
|
privacyMode?: boolean;
|
|
14
14
|
useTurn?: boolean;
|
|
15
|
+
/** Prefer host/srflx ICE candidates and upgrade aggressively on LAN. */
|
|
16
|
+
lanMode?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface LocalPeerSnapshot {
|
|
19
|
+
nodeId: string;
|
|
20
|
+
discoveredAtMs: number;
|
|
21
|
+
localReachable: boolean;
|
|
15
22
|
}
|
|
16
23
|
interface PlutoMoQConfiguration {
|
|
17
24
|
relayUrl?: string;
|
|
18
25
|
}
|
|
19
26
|
interface PlutoIrohConfiguration {
|
|
20
27
|
relayOnly?: boolean;
|
|
28
|
+
relayTransportPolicy?: 'auto' | 'quicRequired' | 'websocketRequired';
|
|
21
29
|
persistenceMode?: 'persistent' | 'ephemeral';
|
|
30
|
+
/** Enable native iroh mDNS LAN discovery (native runtimes only). */
|
|
31
|
+
localDiscovery?: boolean;
|
|
32
|
+
/** When false, listen for LAN peers without advertising this endpoint. */
|
|
33
|
+
localDiscoveryMode?: 'active' | 'passive';
|
|
34
|
+
}
|
|
35
|
+
interface PlutoBleConfiguration {
|
|
36
|
+
/** Enable native BLE discovery + transport (native runtimes only). */
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
/** Timeout for a single BLE connection attempt. */
|
|
39
|
+
connectTimeoutMs?: number;
|
|
40
|
+
/** Preferred retry budget for native BLE connection establishment. */
|
|
41
|
+
retryAttempts?: number;
|
|
42
|
+
/** Backoff between BLE retry attempts. */
|
|
43
|
+
retryBackoffMs?: number;
|
|
22
44
|
}
|
|
23
45
|
interface TurnCredentials {
|
|
24
46
|
iceServers?: RTCIceServer[];
|
|
25
47
|
}
|
|
26
48
|
type TurnCredentialsProvider = () => Promise<TurnCredentials | null | undefined>;
|
|
27
|
-
type DiscoveryMode = '
|
|
49
|
+
type DiscoveryMode = 'space' | 'user-scoped';
|
|
28
50
|
type AuthMode = 'external' | 'anonymous' | 'required';
|
|
29
51
|
type SignalingMode = 'hosted' | 'ticket-only';
|
|
30
52
|
type RoomCreationMode = 'client-open' | 'client-auth' | 'server-only';
|
|
31
53
|
type EndpointKind = 'device' | 'ephemeral';
|
|
32
54
|
type PeerLifecycleStatus = 'disconnected' | 'connecting' | 'connected' | 'failed' | 'closed';
|
|
33
55
|
type PeerHealth = 'unknown' | 'healthy' | 'suspect' | 'stale';
|
|
56
|
+
type PeerLifecycleStage = 'discovered' | 'dialing' | 'base-connected' | 'admitted' | 'protocol-ready' | 'upgrading' | 'webrtc-ready' | 'degraded' | 'reconnecting' | 'closed';
|
|
57
|
+
type PeerBaseTransportState = 'unknown' | 'connecting' | 'connected' | 'degraded' | 'closed';
|
|
58
|
+
type PeerAdmissionState = 'unknown' | 'pending' | 'admitted' | 'rejected' | 'expired';
|
|
59
|
+
type PeerWebRtcState = 'unknown' | 'disabled' | 'connecting' | 'transport-open' | 'route-probing' | 'ready' | 'failed' | 'closed';
|
|
34
60
|
/**
|
|
35
61
|
* Lifecycle label attached to a projected peer while the runtime tracks local ownership.
|
|
36
62
|
*
|
|
@@ -62,15 +88,30 @@ interface ChannelDescriptor {
|
|
|
62
88
|
signalingPolicy?: ChannelSignalingPolicy;
|
|
63
89
|
description?: string;
|
|
64
90
|
}
|
|
65
|
-
type ProtocolName = 'iroh' | 'iroh-quic' | 'iroh-relay' | 'webrtc' | 'moq';
|
|
91
|
+
type ProtocolName = 'iroh' | 'iroh-quic' | 'iroh-relay' | 'iroh-lan' | 'ble' | 'webrtc' | 'webrtc-lan' | 'moq';
|
|
66
92
|
type ProtocolMaturity = 'stable' | 'experimental' | 'unsupported';
|
|
93
|
+
type ProtocolBaseName = 'iroh' | 'webrtc' | 'moq';
|
|
94
|
+
type ProtocolImplementationKind = 'plugin' | 'native' | 'path-label';
|
|
95
|
+
type ProtocolLocality = 'nearby' | 'direct-internet' | 'relay' | 'mixed';
|
|
67
96
|
interface ProtocolCapability {
|
|
68
97
|
protocol: ProtocolName;
|
|
98
|
+
baseProtocol: ProtocolBaseName;
|
|
99
|
+
implementation: ProtocolImplementationKind;
|
|
100
|
+
locality: ProtocolLocality;
|
|
69
101
|
maturity: ProtocolMaturity;
|
|
102
|
+
preferredRank: number;
|
|
103
|
+
browser: boolean;
|
|
104
|
+
native: boolean;
|
|
70
105
|
available: boolean;
|
|
71
106
|
reason?: string;
|
|
72
107
|
}
|
|
73
108
|
type ProtocolCapabilityMap = Record<ProtocolName, ProtocolCapability>;
|
|
109
|
+
/** Space discovery always uses namespace-scoped Firebase tokens. */
|
|
110
|
+
type SpaceAuthMode = 'scoped-token';
|
|
111
|
+
type SpaceTokenProvider = () => Promise<{
|
|
112
|
+
customToken: string;
|
|
113
|
+
uid?: string;
|
|
114
|
+
} | null | undefined>;
|
|
74
115
|
interface ClientOptions {
|
|
75
116
|
/**
|
|
76
117
|
* API key issued from the Pluto developer dashboard (https://api.openrtc.app/developer).
|
|
@@ -78,26 +119,23 @@ interface ClientOptions {
|
|
|
78
119
|
*/
|
|
79
120
|
apiKey?: string;
|
|
80
121
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* This should only be used for controlled demos/tests. Production integrations
|
|
84
|
-
* should always provide an API key.
|
|
85
|
-
*/
|
|
86
|
-
allowAnonymousHostedDefaults?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Discovery mode for this app. Defaults to 'personal'.
|
|
89
|
-
* - 'personal': No user accounts. Devices share a spaceKey to discover each other.
|
|
122
|
+
* Discovery mode for this app. Defaults to 'space'.
|
|
123
|
+
* - 'space': Devices share a space and authenticate with scoped Firebase tokens.
|
|
90
124
|
* - 'user-scoped': Developer mints tokens for their users. Devices scoped per user.
|
|
91
125
|
*
|
|
92
126
|
* Set in the developer dashboard. The server validates this against the app's plan.
|
|
93
127
|
*/
|
|
94
128
|
discoveryMode?: DiscoveryMode;
|
|
95
129
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
|
|
130
|
+
* Shared space name for 'space' discovery mode. This is the beginner-facing
|
|
131
|
+
* name for `spaceKey`; if both are set, `spaceKey` wins.
|
|
132
|
+
*/
|
|
133
|
+
space?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Space key for 'space' discovery mode. The SDK derives a namespace from
|
|
136
|
+
* apiKey + spaceKey, then authenticates with spaceTokenProvider.
|
|
99
137
|
*
|
|
100
|
-
* Only used when discoveryMode is '
|
|
138
|
+
* Only used when discoveryMode is 'space'. Ignored for managed modes.
|
|
101
139
|
*/
|
|
102
140
|
spaceKey?: string;
|
|
103
141
|
/**
|
|
@@ -106,6 +144,11 @@ interface ClientOptions {
|
|
|
106
144
|
*/
|
|
107
145
|
sessionToken?: string;
|
|
108
146
|
authMode?: AuthMode;
|
|
147
|
+
/**
|
|
148
|
+
* Allows first-party demos to use hosted defaults when an API key is omitted.
|
|
149
|
+
* Product apps should pass an API key.
|
|
150
|
+
*/
|
|
151
|
+
allowAnonymousHostedDefaults?: boolean;
|
|
109
152
|
signalingMode?: SignalingMode;
|
|
110
153
|
projectId?: string;
|
|
111
154
|
storagePrefix?: string;
|
|
@@ -130,10 +173,38 @@ interface ClientOptions {
|
|
|
130
173
|
transports?: {
|
|
131
174
|
iroh?: boolean | PlutoIrohConfiguration;
|
|
132
175
|
webrtc?: boolean | PlutoRTCConfiguration;
|
|
176
|
+
ble?: boolean | PlutoBleConfiguration;
|
|
133
177
|
moq?: boolean | PlutoMoQConfiguration;
|
|
134
178
|
};
|
|
135
179
|
transportPriority?: ProtocolName[];
|
|
180
|
+
/** Subscribe to native LAN peer discovery events. */
|
|
181
|
+
onLocalPeer?: (peer: LocalPeerSnapshot) => void;
|
|
136
182
|
disableIrohFallback?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Optional application-layer payload envelope. When configured, OpenRTC
|
|
185
|
+
* protects public message/media payload bytes before they are handed to
|
|
186
|
+
* iroh, WebRTC, or MoQ and opens them before app callbacks fire.
|
|
187
|
+
*/
|
|
188
|
+
applicationCrypto?: ApplicationPayloadCrypto;
|
|
189
|
+
/**
|
|
190
|
+
* When manual `applicationCrypto` is not set, peers must negotiate an
|
|
191
|
+
* ephemeral X25519 ECDH key during transport handshake. Disabling is not
|
|
192
|
+
* supported in secure deployments.
|
|
193
|
+
*/
|
|
194
|
+
automaticApplicationKeyAgreement?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* @internal Overrides orphan drift grace windows for tests and diagnostics.
|
|
197
|
+
*/
|
|
198
|
+
orphanReconciliationGrace?: {
|
|
199
|
+
tsConnectionMs?: number;
|
|
200
|
+
rustRecordMs?: number;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Mints a namespace-scoped Firebase custom token for space discovery.
|
|
204
|
+
* Required when `discoveryMode` is `space` and `space`/`spaceKey` is set.
|
|
205
|
+
* Use `spaceToken` for browser demos.
|
|
206
|
+
*/
|
|
207
|
+
spaceTokenProvider?: SpaceTokenProvider;
|
|
137
208
|
}
|
|
138
209
|
interface Device {
|
|
139
210
|
deviceId: string;
|
|
@@ -159,6 +230,8 @@ interface Device {
|
|
|
159
230
|
updatedAt?: any;
|
|
160
231
|
metadata?: string;
|
|
161
232
|
excludedPeers?: string[];
|
|
233
|
+
availableTransports?: ProtocolName[];
|
|
234
|
+
transports?: ProtocolName[];
|
|
162
235
|
}
|
|
163
236
|
interface PeerState {
|
|
164
237
|
peerId: string;
|
|
@@ -173,13 +246,22 @@ interface PeerState {
|
|
|
173
246
|
platformType?: string;
|
|
174
247
|
status: PeerLifecycleStatus;
|
|
175
248
|
health: PeerHealth;
|
|
249
|
+
lifecycleStage?: PeerLifecycleStage;
|
|
250
|
+
generation?: number;
|
|
251
|
+
baseTransportState?: PeerBaseTransportState;
|
|
252
|
+
admissionState?: PeerAdmissionState;
|
|
176
253
|
transportState?: string;
|
|
177
254
|
protocolState?: string;
|
|
255
|
+
webrtcState?: PeerWebRtcState;
|
|
178
256
|
routable?: boolean;
|
|
179
257
|
activeTransportStableId?: number | null;
|
|
180
258
|
transportGeneration?: number;
|
|
181
259
|
activeTransport?: ProtocolName;
|
|
260
|
+
fallbackTransport?: ProtocolName | null;
|
|
182
261
|
parallelTransport?: ProtocolName | null;
|
|
262
|
+
manualDisconnect?: boolean;
|
|
263
|
+
lastAuthoritativeEventAt?: number;
|
|
264
|
+
lastTransientEventAt?: number;
|
|
183
265
|
promotionEligible?: boolean;
|
|
184
266
|
scopes: PeerScope[];
|
|
185
267
|
lastSeenAt?: number;
|
|
@@ -218,6 +300,7 @@ interface NativeConnectResult {
|
|
|
218
300
|
deviceIdHint?: string | null;
|
|
219
301
|
remoteNodeId?: string | null;
|
|
220
302
|
state: string;
|
|
303
|
+
approvedScope?: string | null;
|
|
221
304
|
}
|
|
222
305
|
interface BackendPeerBiStream {
|
|
223
306
|
readable: ReadableStream<Uint8Array>;
|
|
@@ -260,6 +343,8 @@ interface SignalingEnvelope {
|
|
|
260
343
|
name?: string;
|
|
261
344
|
senderId: string;
|
|
262
345
|
targetId: string;
|
|
346
|
+
senderUserId?: string;
|
|
347
|
+
targetUserId?: string;
|
|
263
348
|
state?: string;
|
|
264
349
|
payload: string;
|
|
265
350
|
replyPayload?: string;
|
|
@@ -367,6 +452,7 @@ interface DeviceStatusSnapshot extends Device {
|
|
|
367
452
|
transportGeneration?: number;
|
|
368
453
|
activeTransport?: ProtocolName;
|
|
369
454
|
parallelTransport?: ProtocolName | null;
|
|
455
|
+
availableTransports?: ProtocolName[];
|
|
370
456
|
}
|
|
371
457
|
interface ManagedConnectionRecord {
|
|
372
458
|
connectionId: string;
|
|
@@ -473,11 +559,21 @@ interface ExplicitFileDataSendParams {
|
|
|
473
559
|
send: (message: unknown) => Promise<void>;
|
|
474
560
|
deviceId?: string;
|
|
475
561
|
remoteNodeId?: string;
|
|
562
|
+
requireApplicationCrypto?: boolean;
|
|
563
|
+
getUpgradeState?: () => string;
|
|
564
|
+
isWebRtcApplicationRouteReady?: () => boolean;
|
|
565
|
+
sendOnWebRTC?: (data: Uint8Array) => Promise<void>;
|
|
566
|
+
getWebRTCTransport?: () => {
|
|
567
|
+
getBufferedAmount?: () => number;
|
|
568
|
+
waitForDrain?: (lowWaterMark: number) => Promise<void>;
|
|
569
|
+
} | null;
|
|
476
570
|
};
|
|
477
571
|
remoteNodeId?: string;
|
|
478
572
|
file: File;
|
|
479
573
|
transferId: string;
|
|
480
574
|
channelId?: string;
|
|
575
|
+
applicationCrypto?: ApplicationPayloadCrypto;
|
|
576
|
+
requireApplicationCrypto?: boolean;
|
|
481
577
|
}
|
|
482
578
|
interface ISignalingBackend {
|
|
483
579
|
currentUser: RuntimeIdentity | null;
|
|
@@ -537,19 +633,18 @@ interface ISignalingBackend {
|
|
|
537
633
|
}): Promise<string | null>;
|
|
538
634
|
getEndpointTicket?(): Promise<string>;
|
|
539
635
|
openPeerBi?(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
636
|
+
openPeerNativeBi?(id: string, label: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
540
637
|
openPeerUni?(id: string, timeoutMs?: number): Promise<BackendPeerUniStream>;
|
|
541
638
|
connectToDevice?(params: {
|
|
542
639
|
deviceId?: string | null;
|
|
543
640
|
endpointTicket: string;
|
|
544
641
|
}): Promise<NativeConnectResult>;
|
|
545
642
|
/**
|
|
546
|
-
* Optional backchannel so a backend (e.g. WasmBridge) can access the
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
* the WASM auto-connect path) so the TS Connection/upgrade state machine
|
|
550
|
-
* stays in lockstep with the Rust transport.
|
|
643
|
+
* Optional backchannel so a backend (e.g. WasmBridge) can access the narrow
|
|
644
|
+
* facade surface needed to escalate runtime transport dials into registered
|
|
645
|
+
* TS connections.
|
|
551
646
|
*/
|
|
552
|
-
setCoreClient?(client:
|
|
647
|
+
setCoreClient?(client: CoreClientBridgeHost | null): void;
|
|
553
648
|
disconnectDevice?(deviceId: string): Promise<void>;
|
|
554
649
|
setAutoConnectExcluded?(deviceId: string, excluded: boolean): Promise<void>;
|
|
555
650
|
isConnected(nodeId: string): Promise<boolean>;
|
|
@@ -560,30 +655,109 @@ interface ISignalingBackend {
|
|
|
560
655
|
getTransferHistory?(limit?: number): Promise<Array<[string, unknown]>>;
|
|
561
656
|
deleteTransferJob?(jobId: string): Promise<void>;
|
|
562
657
|
}
|
|
658
|
+
interface CoreClientBridgeHost {
|
|
659
|
+
connect(ticket: string, timeoutMs?: number, expectedDeviceId?: string | null, channelId?: string, options?: {
|
|
660
|
+
admissionAlreadyPresented?: boolean;
|
|
661
|
+
approvedScope?: string | null;
|
|
662
|
+
}): Promise<{
|
|
663
|
+
remoteNodeId?: string | null;
|
|
664
|
+
deviceId?: string | null;
|
|
665
|
+
} | unknown>;
|
|
666
|
+
waitForApplicationCryptoForPeer?(peerId?: string, timeoutMs?: number): Promise<unknown>;
|
|
667
|
+
hasApplicationRouteForPeer?(connectionId?: string, remoteNodeId?: string): boolean;
|
|
668
|
+
}
|
|
563
669
|
interface SignalingOptions {
|
|
564
670
|
apiKey?: string;
|
|
565
|
-
allowAnonymousHostedDefaults?: boolean;
|
|
566
671
|
authMode?: AuthMode;
|
|
567
672
|
projectId?: string;
|
|
568
673
|
storagePrefix?: string;
|
|
569
674
|
nodeIdPersistence?: 'persistent' | 'ephemeral';
|
|
570
675
|
}
|
|
571
676
|
interface TransportContext {
|
|
572
|
-
sendMoQ: (data: Uint8Array
|
|
677
|
+
sendMoQ: (data: Uint8Array, options?: {
|
|
678
|
+
alreadyProtected?: boolean;
|
|
679
|
+
}) => Promise<void>;
|
|
573
680
|
priorities: ProtocolName[];
|
|
574
681
|
disableIrohFallback: boolean;
|
|
575
682
|
isMoQReady: () => boolean;
|
|
576
683
|
runtimeFlow?: 'default' | 'ticket-only';
|
|
577
684
|
readerCloseStrategy?: 'cancel' | 'release-lock';
|
|
578
685
|
}
|
|
686
|
+
interface ApplicationPayloadCrypto {
|
|
687
|
+
/**
|
|
688
|
+
* When true, incoming application payloads that are not encrypted by this
|
|
689
|
+
* envelope are dropped before app callbacks fire.
|
|
690
|
+
*/
|
|
691
|
+
requireEncrypted?: boolean;
|
|
692
|
+
protectPayload: (typeId: number, payload: Uint8Array) => Uint8Array;
|
|
693
|
+
openPayload: (expectedTypeId: number, payload: Uint8Array) => Uint8Array | null;
|
|
694
|
+
}
|
|
695
|
+
interface ApplicationCryptoBiStream {
|
|
696
|
+
send: WritableStream<Uint8Array>;
|
|
697
|
+
recv: ReadableStream<Uint8Array>;
|
|
698
|
+
endpoint_id?: string;
|
|
699
|
+
}
|
|
700
|
+
interface ApplicationCryptoStreamTools {
|
|
701
|
+
readonly typeId: number;
|
|
702
|
+
protectFrame: (payload: Uint8Array) => Uint8Array;
|
|
703
|
+
openFrame: (payload: Uint8Array) => Uint8Array | null;
|
|
704
|
+
createOutboundTransform: () => TransformStream<Uint8Array, Uint8Array>;
|
|
705
|
+
createInboundTransform: () => TransformStream<Uint8Array, Uint8Array>;
|
|
706
|
+
wrapReadable: (readable: ReadableStream<Uint8Array>) => ReadableStream<Uint8Array>;
|
|
707
|
+
wrapWritable: (writable: WritableStream<Uint8Array>) => WritableStream<Uint8Array>;
|
|
708
|
+
wrapBiStream: <T extends ApplicationCryptoBiStream>(stream: T) => T;
|
|
709
|
+
}
|
|
710
|
+
interface ApplicationPayloadReadinessOptions {
|
|
711
|
+
/**
|
|
712
|
+
* When provided, a connection is considered ready only once its active
|
|
713
|
+
* application route is one of these transports.
|
|
714
|
+
*/
|
|
715
|
+
preferredTransports?: ProtocolName[];
|
|
716
|
+
/**
|
|
717
|
+
* If a preferred upgraded route cannot be established, allow the connection's
|
|
718
|
+
* proven application route to carry payloads instead of remaining pending.
|
|
719
|
+
*/
|
|
720
|
+
allowFallbackAfterPreferredTransportFailure?: boolean;
|
|
721
|
+
}
|
|
722
|
+
interface ApplicationPayloadRouteOptions extends ApplicationPayloadReadinessOptions {
|
|
723
|
+
/**
|
|
724
|
+
* Include the parallel/fallback transport in diagnostic route listings.
|
|
725
|
+
* Normal app payload probes should leave this disabled so they measure the
|
|
726
|
+
* route OpenRTC would actually prefer for application data.
|
|
727
|
+
*/
|
|
728
|
+
includeFallbackTransports?: boolean;
|
|
729
|
+
}
|
|
730
|
+
interface ApplicationPayloadSendOptions extends ApplicationPayloadRouteOptions {
|
|
731
|
+
}
|
|
579
732
|
interface ConnectionOptions {
|
|
580
733
|
reliable?: boolean;
|
|
581
|
-
rtcConfig?:
|
|
734
|
+
rtcConfig?: PlutoRTCConfiguration;
|
|
582
735
|
transportContext?: TransportContext;
|
|
736
|
+
applicationCrypto?: ApplicationPayloadCrypto;
|
|
737
|
+
/** Framing used by the underlying iroh control stream. */
|
|
738
|
+
controlFrameMode?: 'typed' | 'native-main';
|
|
739
|
+
/**
|
|
740
|
+
* When true, public application payload sends wait for applicationCrypto to
|
|
741
|
+
* be installed and fail closed if key negotiation never completes.
|
|
742
|
+
* Internal handshake/control frames are sent through a separate control path.
|
|
743
|
+
*/
|
|
744
|
+
requireApplicationCrypto?: boolean;
|
|
745
|
+
applicationCryptoWaitMs?: number;
|
|
583
746
|
onTransportStatusChange?: (status: {
|
|
584
747
|
activeTransport: ProtocolName;
|
|
585
748
|
parallelTransport?: ProtocolName | null;
|
|
586
749
|
}) => void;
|
|
750
|
+
/**
|
|
751
|
+
* Fired when the WebRTC data plane has proven a ping/pong round trip but the
|
|
752
|
+
* mandatory application crypto route is not installed yet. Connection owns
|
|
753
|
+
* transport proof; Client owns the application-route handshake recovery.
|
|
754
|
+
*/
|
|
755
|
+
onApplicationRouteMissing?: (event: {
|
|
756
|
+
connectionId: string;
|
|
757
|
+
remoteNodeId: string;
|
|
758
|
+
reason: 'webrtc-heartbeat-before-crypto';
|
|
759
|
+
negotiationId?: string | null;
|
|
760
|
+
}) => void;
|
|
587
761
|
}
|
|
588
762
|
interface JoinRequest {
|
|
589
763
|
id: string;
|
|
@@ -592,148 +766,4 @@ interface JoinRequest {
|
|
|
592
766
|
state: 'pending' | 'accepted' | 'rejected';
|
|
593
767
|
}
|
|
594
768
|
|
|
595
|
-
type
|
|
596
|
-
userId: string;
|
|
597
|
-
token?: string | null;
|
|
598
|
-
refreshToken?: string | null;
|
|
599
|
-
customToken?: string | null;
|
|
600
|
-
tokenProvider?: (forceRefresh?: boolean) => Promise<string | null>;
|
|
601
|
-
expiresAtMs?: number | null;
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
type RuntimeAdapterKind = 'browser-wasm' | 'native-ipc' | 'tauri-ipc' | 'unknown';
|
|
605
|
-
interface RuntimeCapabilities {
|
|
606
|
-
adapter: RuntimeAdapterKind;
|
|
607
|
-
signaling: {
|
|
608
|
-
firestore: boolean;
|
|
609
|
-
nativeIpc: boolean;
|
|
610
|
-
rtdbPresence: boolean;
|
|
611
|
-
};
|
|
612
|
-
transport: {
|
|
613
|
-
irohQuic: boolean;
|
|
614
|
-
webRtcUpgrade: boolean;
|
|
615
|
-
nativeWebRtc: boolean;
|
|
616
|
-
wasm: boolean;
|
|
617
|
-
};
|
|
618
|
-
lifecycle: {
|
|
619
|
-
managedSession: boolean;
|
|
620
|
-
autoConnect: boolean;
|
|
621
|
-
manualDisconnect: boolean;
|
|
622
|
-
connectionStateEvents: boolean;
|
|
623
|
-
peerSessions: boolean;
|
|
624
|
-
};
|
|
625
|
-
transfers: {
|
|
626
|
-
explicitFilePath: boolean;
|
|
627
|
-
explicitFileData: boolean;
|
|
628
|
-
history: boolean;
|
|
629
|
-
};
|
|
630
|
-
fallback: {
|
|
631
|
-
wasm: boolean;
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
declare const BROWSER_WASM_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
635
|
-
declare const NATIVE_IPC_RUNTIME_CAPABILITIES: RuntimeCapabilities;
|
|
636
|
-
declare function cloneRuntimeCapabilities(capabilities: RuntimeCapabilities): RuntimeCapabilities;
|
|
637
|
-
|
|
638
|
-
interface WasmBridgeOptions {
|
|
639
|
-
apiKey?: string;
|
|
640
|
-
discoveryMode?: DiscoveryMode;
|
|
641
|
-
spaceKey?: string;
|
|
642
|
-
authMode?: AuthMode;
|
|
643
|
-
signalingMode?: SignalingMode;
|
|
644
|
-
projectId?: string;
|
|
645
|
-
storagePrefix?: string;
|
|
646
|
-
nodeIdPersistence?: 'persistent' | 'ephemeral';
|
|
647
|
-
deviceName?: string;
|
|
648
|
-
turnCredentialsProvider?: () => Promise<{
|
|
649
|
-
iceServers?: RTCIceServer[];
|
|
650
|
-
} | null | undefined>;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
654
|
-
protected readonly backend: ISignalingBackend;
|
|
655
|
-
protected constructor(backend: ISignalingBackend);
|
|
656
|
-
get currentUser(): RuntimeIdentity | null;
|
|
657
|
-
setAuthContext(context: AuthContext | null): Promise<void> | void;
|
|
658
|
-
signInAnonymously(): Promise<void>;
|
|
659
|
-
signInWithPluto(): Promise<void>;
|
|
660
|
-
signOut(): Promise<void>;
|
|
661
|
-
stopAuthScopedActivity(): Promise<void>;
|
|
662
|
-
getTurnCredentials(): Promise<any>;
|
|
663
|
-
updatePresence(localNodeId: string, ticketStr: string, isOnline: boolean, ttlMs: number, metadata?: string): Promise<void>;
|
|
664
|
-
setOffline(localNodeId: string): Promise<void>;
|
|
665
|
-
cleanupStaleDevices(): Promise<void>;
|
|
666
|
-
searchDevices(excludeNodeId?: string): Promise<Device[]>;
|
|
667
|
-
listDevicesWithStatus(): Promise<DeviceStatusSnapshot[]>;
|
|
668
|
-
getPeerSession(id: string): Promise<PeerSessionSnapshot | null>;
|
|
669
|
-
listPeerSessions(): Promise<PeerSessionSnapshot[]>;
|
|
670
|
-
waitForSettledPeer(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
|
|
671
|
-
resolvePeerIdentity(id: string): Promise<ResolvedPeerIdentity>;
|
|
672
|
-
resolvePeerConnectionRecords(id: string): Promise<ManagedConnectionRecord[]>;
|
|
673
|
-
updateDevice(deviceId: string, updates: {
|
|
674
|
-
deviceName?: string;
|
|
675
|
-
capabilities?: Device['capabilities'];
|
|
676
|
-
metadata?: string;
|
|
677
|
-
}): Promise<void>;
|
|
678
|
-
deleteDevice(deviceId: string): Promise<void>;
|
|
679
|
-
onDevicesChange(callback: (devices: Device[]) => void, excludeNodeId?: string): () => void;
|
|
680
|
-
onAuthChange(callback: (user: RuntimeIdentity | null) => void): () => void;
|
|
681
|
-
checkForSSOToken(): Promise<void>;
|
|
682
|
-
waitForAuth(): Promise<void>;
|
|
683
|
-
sendMessage(targetId: string, payload: string, state?: string, replyPayload?: string): Promise<string>;
|
|
684
|
-
pollMessages(targetId: string): Promise<SignalingEnvelope[]>;
|
|
685
|
-
subscribeDevices(userId: string): Promise<ReadableStream<DeviceEvent[]>>;
|
|
686
|
-
startAutoConnect(userId: string, localDeviceId: string): void;
|
|
687
|
-
startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): void;
|
|
688
|
-
createSession(session: SignalingSession): Promise<void>;
|
|
689
|
-
updateSession(sessionId: string, updateData: any): Promise<void>;
|
|
690
|
-
subscribeSessions(localDeviceId: string): Promise<ReadableStream<SessionEvent[]>>;
|
|
691
|
-
forceReconnectSnapshot(): void;
|
|
692
|
-
getLocalDeviceId(): Promise<string | null>;
|
|
693
|
-
getLocalDeviceInfo(): Promise<LocalDeviceInfo | null>;
|
|
694
|
-
updateLocalDeviceName(deviceName: string): Promise<LocalDeviceInfo | null>;
|
|
695
|
-
startManagedSessionNative(options: {
|
|
696
|
-
userId: string;
|
|
697
|
-
deviceName?: string;
|
|
698
|
-
localDeviceId?: string | null;
|
|
699
|
-
metadata?: string;
|
|
700
|
-
autoConnect?: boolean;
|
|
701
|
-
presence?: boolean;
|
|
702
|
-
}): Promise<NativeManagedSessionStartResult>;
|
|
703
|
-
getManagedNodeId(options?: {
|
|
704
|
-
initializeIfMissing?: boolean;
|
|
705
|
-
}): Promise<string | null>;
|
|
706
|
-
startPresenceLoopOnce(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): Promise<void>;
|
|
707
|
-
startAutoConnectOnce(userId: string, localDeviceId: string): Promise<void>;
|
|
708
|
-
getEndpointTicket(): Promise<string>;
|
|
709
|
-
getEndpointTicketWithToken(scope: GrantScope, maxConnections: number): Promise<string | null>;
|
|
710
|
-
registerSessionToken(token: string, scope: GrantScope, maxConnections: number): Promise<void>;
|
|
711
|
-
revokeSessionTokensByScope(scope: GrantScope): Promise<string[]>;
|
|
712
|
-
openPeerBi(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
713
|
-
openPeerBiTransportOnly(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
714
|
-
openPeerUni(id: string, timeoutMs?: number): Promise<BackendPeerUniStream>;
|
|
715
|
-
connectToDevice(params: {
|
|
716
|
-
deviceId?: string | null;
|
|
717
|
-
endpointTicket: string;
|
|
718
|
-
}): Promise<NativeConnectResult>;
|
|
719
|
-
disconnectDevice(deviceId: string): Promise<void>;
|
|
720
|
-
isConnected(nodeId: string): Promise<boolean>;
|
|
721
|
-
getConnectionStates(): Promise<BackendConnectionState[]>;
|
|
722
|
-
onConnectionStateChange(callback: (state: BackendConnectionState) => void): Promise<() => void> | (() => void);
|
|
723
|
-
sendExplicitFilePath(connectionId: string, filePath: string, transferId?: string): Promise<string>;
|
|
724
|
-
sendExplicitFileData(params: ExplicitFileDataSendParams): Promise<void>;
|
|
725
|
-
getTransferHistory(limit?: number): Promise<Array<[string, unknown]>>;
|
|
726
|
-
deleteTransferJob(jobId: string): Promise<void>;
|
|
727
|
-
getRuntimeCapabilities(): RuntimeCapabilities;
|
|
728
|
-
onIncomingNativeMessage(callback: (connectionId: string, remoteNodeId: string | null, message: any) => void): Promise<() => void>;
|
|
729
|
-
unwrap(): ISignalingBackend;
|
|
730
|
-
/**
|
|
731
|
-
* Forward setCoreClient() to the inner backend if it implements it. This
|
|
732
|
-
* lets the core Client inject a reference into backends (e.g. WasmBridge)
|
|
733
|
-
* that need to escalate transport-level dials into full Client.connect()
|
|
734
|
-
* handshakes.
|
|
735
|
-
*/
|
|
736
|
-
setCoreClient(client: unknown): void;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
export { type AuthContext as A, type BackendConnectionState as B, type ConnectDeviceResult as C, DelegatingRuntimeAdapter as D, type ExplicitFileDataSendParams as E, type RoomCreationMode as F, type GrantScope as G, type ScanningLoopOptions as H, type IncomingStreamChannelMetadata as I, type JoinRoomOptions as J, type ScanningLoopHandle as K, type LocalDeviceInfo as L, type ManagedDeviceConnectOptions as M, type NativeConnectResult as N, type RuntimeBootstrapOptions as O, type PeerSessionSnapshot as P, type RuntimeBootstrapResult as Q, type ResolvedPeerIdentity as R, type SignalingMode as S, type JoinRequest as T, BROWSER_WASM_RUNTIME_CAPABILITIES as U, NATIVE_IPC_RUNTIME_CAPABILITIES as V, type WasmBridgeOptions as W, cloneRuntimeCapabilities as X, type ConnectDeviceHooks as a, type ConnectDeviceOptions as b, type RuntimeCapabilities as c, type AppLimits as d, type AuthMode as e, type DiscoveryMode as f, type ProtocolCapability as g, type ProtocolCapabilityMap as h, type ProtocolName as i, type RuntimeAdapterKind as j, type ClientOptions as k, type ChannelDescriptor as l, type Device as m, type SignalingSession as n, type RuntimeIdentity as o, type DeviceStatusSnapshot as p, type PeerState as q, type PeerHealth as r, type RoomMember as s, type PeerScope as t, type PeerLifecycleStatus as u, type ConnectionOptions as v, type ISignalingBackend as w, type ManagedConnectionRecord as x, type SignalingOptions as y, type SignalingEnvelope as z };
|
|
769
|
+
export type { ScanningLoopOptions as $, AuthMode as A, BackendPeerBiStream as B, ClientOptions as C, DiscoveryMode as D, ExplicitFileDataSendParams as E, ProtocolLocality as F, GrantScope as G, SpaceAuthMode as H, ISignalingBackend as I, ConnectionOptions as J, ChannelDescriptor as K, LocalDeviceInfo as L, ManagedConnectionRecord as M, NativeManagedSessionStartResult as N, IncomingStreamChannelMetadata as O, PeerSessionSnapshot as P, ManagedDeviceConnectOptions as Q, RuntimeIdentity as R, SignalingMode as S, PeerState as T, PeerHealth as U, JoinRoomOptions as V, RoomMember as W, PeerScope as X, PeerLifecycleStatus as Y, SignalingOptions as Z, RoomCreationMode as _, Device as a, ScanningLoopHandle as a0, RuntimeBootstrapOptions as a1, RuntimeBootstrapResult as a2, JoinRequest as a3, DeviceStatusSnapshot as b, ResolvedPeerIdentity as c, SignalingEnvelope as d, DeviceEvent as e, SignalingSession as f, SessionEvent as g, BackendPeerUniStream as h, NativeConnectResult as i, BackendConnectionState as j, ConnectDeviceResult as k, ConnectDeviceHooks as l, ConnectDeviceOptions as m, ProtocolName as n, ProtocolCapability as o, ProtocolCapabilityMap as p, ApplicationPayloadCrypto as q, ApplicationCryptoStreamTools as r, SpaceTokenProvider as s, AppLimits as t, ApplicationCryptoBiStream as u, ApplicationPayloadReadinessOptions as v, ApplicationPayloadRouteOptions as w, ApplicationPayloadSendOptions as x, ProtocolBaseName as y, ProtocolImplementationKind as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrtc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,13 +27,7 @@
|
|
|
27
27
|
"dist/**/*.js",
|
|
28
28
|
"dist/**/*.d.ts",
|
|
29
29
|
"dist/**/*.wasm",
|
|
30
|
-
"README.md"
|
|
31
|
-
"wasm/openrtc.js",
|
|
32
|
-
"wasm/openrtc.d.ts",
|
|
33
|
-
"wasm/openrtc_bg.wasm",
|
|
34
|
-
"wasm/openrtc_bg.wasm.d.ts",
|
|
35
|
-
"wasm/package.json",
|
|
36
|
-
"wasm/README.md"
|
|
30
|
+
"README.md"
|
|
37
31
|
],
|
|
38
32
|
"exports": {
|
|
39
33
|
".": {
|
|
@@ -56,6 +50,10 @@
|
|
|
56
50
|
"types": "./dist/runtime/tauri.d.ts",
|
|
57
51
|
"import": "./dist/runtime/tauri.js"
|
|
58
52
|
},
|
|
53
|
+
"./transport": {
|
|
54
|
+
"types": "./dist/transport/index.d.ts",
|
|
55
|
+
"import": "./dist/transport/index.js"
|
|
56
|
+
},
|
|
59
57
|
"./auth/internal": {
|
|
60
58
|
"types": "./dist/auth/internal.d.ts",
|
|
61
59
|
"import": "./dist/auth/internal.js"
|
|
@@ -65,10 +63,11 @@
|
|
|
65
63
|
"scripts": {
|
|
66
64
|
"build": "tsup",
|
|
67
65
|
"build:types": "tsc --noEmit",
|
|
68
|
-
"build:wasm": "cd ../../crates/openrtc && wasm-pack build --target web --out-dir ../../packages/openrtc/wasm && rm -rf ../../packages/openrtc/wasm/.gitignore",
|
|
66
|
+
"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 && rm -rf ../../packages/openrtc/wasm/.gitignore",
|
|
69
67
|
"test": "pnpm run test:deterministic",
|
|
70
68
|
"test:deterministic": "OPENRTC_LIVE_TESTS=0 vitest run tests/unit tests/contract",
|
|
71
|
-
"test:emulator": "
|
|
69
|
+
"test:emulator": "node ../../tests/emulator/run-emulator-suite.mjs",
|
|
70
|
+
"test:emulator:running": "OPENRTC_EMULATOR_TESTS=1 REQUIRE_OPENRTC_EMULATOR_TESTS=1 OPENRTC_LIVE_TESTS=0 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 VITE_OPENRTC_RTDB_EMULATOR_HOST=127.0.0.1:9001 vitest run tests/emulator",
|
|
72
71
|
"test:live": "pnpm run build:wasm && pnpm run build && OPENRTC_LIVE_TESTS=1 vitest run tests/live",
|
|
73
72
|
"test:live:emulator": "OPENRTC_LIVE_TESTS=1 FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099 vitest run tests/live",
|
|
74
73
|
"test:watch": "vitest",
|
|
@@ -76,6 +75,9 @@
|
|
|
76
75
|
"prepublishOnly": "npm run build:wasm && npm run build"
|
|
77
76
|
},
|
|
78
77
|
"dependencies": {
|
|
78
|
+
"@noble/ciphers": "^2.2.0",
|
|
79
|
+
"@noble/curves": "^1.9.0",
|
|
80
|
+
"@noble/hashes": "^1.8.0",
|
|
79
81
|
"firebase": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0",
|
|
80
82
|
"tweetnacl": "^1.0.3"
|
|
81
83
|
},
|