@afterrealism/dendri-client 2.3.7 → 2.5.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/LICENSE +202 -21
- package/README.md +65 -72
- package/dist/{chunk-MJW5M75V.js → chunk-3CE674DE.js} +267 -24
- package/dist/chunk-3CE674DE.js.map +1 -0
- package/dist/dendri.browser.global.js +233 -18
- package/dist/dendri.browser.global.js.map +1 -1
- package/dist/dendri.cjs +266 -22
- package/dist/dendri.cjs.map +1 -1
- package/dist/dendri.d.cts +13 -4
- package/dist/dendri.d.ts +13 -4
- package/dist/dendri.js +3 -3
- package/dist/dendri.js.map +1 -1
- package/dist/dendri.min.global.js +13 -13
- package/dist/dendri.min.global.js.map +1 -1
- package/dist/serializer.msgpack.cjs +3 -3
- package/dist/serializer.msgpack.cjs.map +1 -1
- package/dist/serializer.msgpack.d.cts +31 -4
- package/dist/serializer.msgpack.d.ts +31 -4
- package/dist/serializer.msgpack.js +2 -2
- package/dist/serializer.msgpack.js.map +1 -1
- package/dist/{store-RTivRmUW.d.cts → store-C3Nwl62R.d.cts} +38 -5
- package/dist/{store-RTivRmUW.d.ts → store-C3Nwl62R.d.ts} +38 -5
- package/dist/store.cjs +256 -21
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +1 -1
- package/dist/store.d.ts +1 -1
- package/dist/store.js +1 -1
- package/package.json +8 -2
- package/dist/chunk-MJW5M75V.js.map +0 -1
|
@@ -133,7 +133,10 @@ declare enum ServerMessageType {
|
|
|
133
133
|
RoomPeers = "ROOM-PEERS",// List of peers in a room.
|
|
134
134
|
HostMigrate = "HOST-MIGRATE",// Host migration notification.
|
|
135
135
|
PresenceUpdate = "PRESENCE-UPDATE",// Presence data broadcast.
|
|
136
|
-
KeyExchange = "KEY-EXCHANGE"
|
|
136
|
+
KeyExchange = "KEY-EXCHANGE",// E2E encryption key exchange for relay.
|
|
137
|
+
ConnectRequest = "CONNECT-REQUEST",// Address exchange for Connection Reversal (H1)
|
|
138
|
+
DcutrConnect = "DCUTR-CONNECT",// DCUtR hole punch address exchange (H2)
|
|
139
|
+
DcutrSync = "DCUTR-SYNC"
|
|
137
140
|
}
|
|
138
141
|
declare enum TransportMode {
|
|
139
142
|
WebRTC = "webrtc",
|
|
@@ -162,6 +165,12 @@ declare enum ConnectionQuality {
|
|
|
162
165
|
Poor = "poor",
|
|
163
166
|
Unknown = "unknown"
|
|
164
167
|
}
|
|
168
|
+
declare enum TopicClass {
|
|
169
|
+
/** Reliable, persisted, replayed — data integrity critical (Yjs updates, RPC) */
|
|
170
|
+
Persistent = "persistent",
|
|
171
|
+
/** Best-effort, not replayed — ephemeral UX state (cursor, scroll, typing indicators) */
|
|
172
|
+
Ephemeral = "ephemeral"
|
|
173
|
+
}
|
|
165
174
|
|
|
166
175
|
interface ServerMessage {
|
|
167
176
|
type: ServerMessageType;
|
|
@@ -262,6 +271,7 @@ declare abstract class DataConnection extends BaseConnection<DataConnectionEvent
|
|
|
262
271
|
constructor(peerId: string, provider: Dendri, options: any);
|
|
263
272
|
/** Called by the Negotiator when the DataChannel is ready. */
|
|
264
273
|
_initializeDataChannel(dc: RTCDataChannel): void;
|
|
274
|
+
private _applyAdaptiveBuffer;
|
|
265
275
|
/**
|
|
266
276
|
* Exposed functionality for users.
|
|
267
277
|
*/
|
|
@@ -317,6 +327,13 @@ interface AnswerOption {
|
|
|
317
327
|
}
|
|
318
328
|
interface DendriOption {
|
|
319
329
|
key?: string;
|
|
330
|
+
/**
|
|
331
|
+
* Full server URL, e.g. `"wss://signal.example.com"` or `"http://127.0.0.1:9876"`.
|
|
332
|
+
* Shorthand for host/port/secure/path; any of those passed explicitly win.
|
|
333
|
+
*/
|
|
334
|
+
url?: string;
|
|
335
|
+
/** API key for hosted / multi-tenant Dendri deployments. Sent with every signaling and REST request. */
|
|
336
|
+
apiKey?: string;
|
|
320
337
|
host?: string;
|
|
321
338
|
port?: number;
|
|
322
339
|
path?: string;
|
|
@@ -325,7 +342,7 @@ interface DendriOption {
|
|
|
325
342
|
config?: RTCConfiguration;
|
|
326
343
|
debug?: number;
|
|
327
344
|
referrerPolicy?: ReferrerPolicy;
|
|
328
|
-
/** Auto-fetch TURN credentials from the signaling server's GET /turn endpoint. */
|
|
345
|
+
/** Auto-fetch TURN credentials from the signaling server's GET /{key}/turn-credentials endpoint. */
|
|
329
346
|
fetchTurnCredentials?: boolean;
|
|
330
347
|
/** Optional JWT for authenticated connections. */
|
|
331
348
|
jwt?: string;
|
|
@@ -515,6 +532,9 @@ declare class HybridConnection extends EventEmitter<HybridConnectionEvents> {
|
|
|
515
532
|
* Respects `autoUpgrade`, `upgradeInterval`, and `maxUpgradeAttempts` options.
|
|
516
533
|
*/
|
|
517
534
|
private _scheduleUpgrade;
|
|
535
|
+
private _tryConnectionReversal;
|
|
536
|
+
private _gatherSrflxCandidates;
|
|
537
|
+
_dcutrHolePunch(): Promise<boolean>;
|
|
518
538
|
}
|
|
519
539
|
|
|
520
540
|
declare enum LogLevel {
|
|
@@ -622,6 +642,13 @@ declare class DendriOptions implements DendriOption {
|
|
|
622
642
|
* Prints log messages depending on the debug level passed in.
|
|
623
643
|
*/
|
|
624
644
|
debug?: LogLevel;
|
|
645
|
+
/**
|
|
646
|
+
* Full server URL, e.g. `"wss://signal.example.com"` or `"http://127.0.0.1:9876"`.
|
|
647
|
+
* Shorthand for host/port/secure/path; any of those passed explicitly win.
|
|
648
|
+
*/
|
|
649
|
+
url?: string;
|
|
650
|
+
/** API key for hosted / multi-tenant Dendri deployments. Sent with every signaling and REST request. */
|
|
651
|
+
apiKey?: string;
|
|
625
652
|
/**
|
|
626
653
|
* Server host for your Dendri signaling server.
|
|
627
654
|
* Also accepts `'/'` to signify relative hostname.
|
|
@@ -648,7 +675,7 @@ declare class DendriOptions implements DendriOption {
|
|
|
648
675
|
*
|
|
649
676
|
* Defaults to {@apilink util.defaultConfig}
|
|
650
677
|
*/
|
|
651
|
-
config?:
|
|
678
|
+
config?: RTCConfiguration;
|
|
652
679
|
/**
|
|
653
680
|
* Set to true `true` if you're using TLS.
|
|
654
681
|
* :::danger
|
|
@@ -658,7 +685,7 @@ declare class DendriOptions implements DendriOption {
|
|
|
658
685
|
secure?: boolean;
|
|
659
686
|
pingInterval?: number;
|
|
660
687
|
referrerPolicy?: ReferrerPolicy;
|
|
661
|
-
logFunction?: (logLevel: LogLevel, ...rest:
|
|
688
|
+
logFunction?: (logLevel: LogLevel, ...rest: unknown[]) => void;
|
|
662
689
|
serializers?: SerializerMapping;
|
|
663
690
|
/** Auto-fetch TURN credentials from the signaling server's GET /turn endpoint. */
|
|
664
691
|
fetchTurnCredentials?: boolean;
|
|
@@ -670,6 +697,12 @@ declare class DendriOptions implements DendriOption {
|
|
|
670
697
|
validateMetadata?: (metadata: unknown) => boolean;
|
|
671
698
|
/** Signaling transport: 'websocket' (default), 'sse', 'polling', or 'auto' (tries WS then SSE then polling) */
|
|
672
699
|
signalingTransport?: "websocket" | "sse" | "polling" | "auto";
|
|
700
|
+
/**
|
|
701
|
+
* ICE candidate privacy policy.
|
|
702
|
+
* - 'all': RFC 8828 mode 1 — all candidates including host IPs (default)
|
|
703
|
+
* - 'public': RFC 8828 mode 3 — only STUN/TURN (srflx + relay) candidates
|
|
704
|
+
*/
|
|
705
|
+
ipPolicy?: "all" | "public";
|
|
673
706
|
}
|
|
674
707
|
|
|
675
708
|
interface SerializerMapping {
|
|
@@ -1375,4 +1408,4 @@ interface DendriStore {
|
|
|
1375
1408
|
*/
|
|
1376
1409
|
declare function createDendriStore(input?: CreateDendriStoreInput): DendriStore;
|
|
1377
1410
|
|
|
1378
|
-
export { AckManager as A, BaseConnectionErrorType as B, type CallOption as C, Dendri as D, type RpcResponse as E, SerializationType as F, ServerMessageType as G, HybridConnection as H, SocketEventType as I, type StoreListener as J,
|
|
1411
|
+
export { AckManager as A, BaseConnectionErrorType as B, type CallOption as C, Dendri as D, type RpcResponse as E, SerializationType as F, ServerMessageType as G, HybridConnection as H, SocketEventType as I, type StoreListener as J, type TransportEvents as K, LogLevel as L, MediaConnection as M, TransportMode as N, createDendriStore as O, type PresenceEvents as P, isRpcRequest as Q, Room as R, type SerializerMapping as S, TopicClass as T, isRpcResponse as U, type CreateDendriStoreInput as V, DataConnection as a, SignalingTransport as b, type AnswerOption as c, ConnectionQuality as d, ConnectionState as e, ConnectionType as f, DataConnectionErrorType as g, type DendriConnectOption as h, DendriError as i, DendriErrorType as j, type DendriEvents as k, type DendriOption as l, DendriOptions as m, type DendriStore as n, type DendriStoreOptions as o, type DendriStoreSnapshot as p, type HybridConnectionOption as q, type HybridSendOptions as r, PresenceManager as s, type RoomEvents as t, type RoomOptions as u, RpcError as v, RpcErrorCode as w, type RpcHandler as x, RpcManager as y, type RpcRequest as z };
|
|
@@ -133,7 +133,10 @@ declare enum ServerMessageType {
|
|
|
133
133
|
RoomPeers = "ROOM-PEERS",// List of peers in a room.
|
|
134
134
|
HostMigrate = "HOST-MIGRATE",// Host migration notification.
|
|
135
135
|
PresenceUpdate = "PRESENCE-UPDATE",// Presence data broadcast.
|
|
136
|
-
KeyExchange = "KEY-EXCHANGE"
|
|
136
|
+
KeyExchange = "KEY-EXCHANGE",// E2E encryption key exchange for relay.
|
|
137
|
+
ConnectRequest = "CONNECT-REQUEST",// Address exchange for Connection Reversal (H1)
|
|
138
|
+
DcutrConnect = "DCUTR-CONNECT",// DCUtR hole punch address exchange (H2)
|
|
139
|
+
DcutrSync = "DCUTR-SYNC"
|
|
137
140
|
}
|
|
138
141
|
declare enum TransportMode {
|
|
139
142
|
WebRTC = "webrtc",
|
|
@@ -162,6 +165,12 @@ declare enum ConnectionQuality {
|
|
|
162
165
|
Poor = "poor",
|
|
163
166
|
Unknown = "unknown"
|
|
164
167
|
}
|
|
168
|
+
declare enum TopicClass {
|
|
169
|
+
/** Reliable, persisted, replayed — data integrity critical (Yjs updates, RPC) */
|
|
170
|
+
Persistent = "persistent",
|
|
171
|
+
/** Best-effort, not replayed — ephemeral UX state (cursor, scroll, typing indicators) */
|
|
172
|
+
Ephemeral = "ephemeral"
|
|
173
|
+
}
|
|
165
174
|
|
|
166
175
|
interface ServerMessage {
|
|
167
176
|
type: ServerMessageType;
|
|
@@ -262,6 +271,7 @@ declare abstract class DataConnection extends BaseConnection<DataConnectionEvent
|
|
|
262
271
|
constructor(peerId: string, provider: Dendri, options: any);
|
|
263
272
|
/** Called by the Negotiator when the DataChannel is ready. */
|
|
264
273
|
_initializeDataChannel(dc: RTCDataChannel): void;
|
|
274
|
+
private _applyAdaptiveBuffer;
|
|
265
275
|
/**
|
|
266
276
|
* Exposed functionality for users.
|
|
267
277
|
*/
|
|
@@ -317,6 +327,13 @@ interface AnswerOption {
|
|
|
317
327
|
}
|
|
318
328
|
interface DendriOption {
|
|
319
329
|
key?: string;
|
|
330
|
+
/**
|
|
331
|
+
* Full server URL, e.g. `"wss://signal.example.com"` or `"http://127.0.0.1:9876"`.
|
|
332
|
+
* Shorthand for host/port/secure/path; any of those passed explicitly win.
|
|
333
|
+
*/
|
|
334
|
+
url?: string;
|
|
335
|
+
/** API key for hosted / multi-tenant Dendri deployments. Sent with every signaling and REST request. */
|
|
336
|
+
apiKey?: string;
|
|
320
337
|
host?: string;
|
|
321
338
|
port?: number;
|
|
322
339
|
path?: string;
|
|
@@ -325,7 +342,7 @@ interface DendriOption {
|
|
|
325
342
|
config?: RTCConfiguration;
|
|
326
343
|
debug?: number;
|
|
327
344
|
referrerPolicy?: ReferrerPolicy;
|
|
328
|
-
/** Auto-fetch TURN credentials from the signaling server's GET /turn endpoint. */
|
|
345
|
+
/** Auto-fetch TURN credentials from the signaling server's GET /{key}/turn-credentials endpoint. */
|
|
329
346
|
fetchTurnCredentials?: boolean;
|
|
330
347
|
/** Optional JWT for authenticated connections. */
|
|
331
348
|
jwt?: string;
|
|
@@ -515,6 +532,9 @@ declare class HybridConnection extends EventEmitter<HybridConnectionEvents> {
|
|
|
515
532
|
* Respects `autoUpgrade`, `upgradeInterval`, and `maxUpgradeAttempts` options.
|
|
516
533
|
*/
|
|
517
534
|
private _scheduleUpgrade;
|
|
535
|
+
private _tryConnectionReversal;
|
|
536
|
+
private _gatherSrflxCandidates;
|
|
537
|
+
_dcutrHolePunch(): Promise<boolean>;
|
|
518
538
|
}
|
|
519
539
|
|
|
520
540
|
declare enum LogLevel {
|
|
@@ -622,6 +642,13 @@ declare class DendriOptions implements DendriOption {
|
|
|
622
642
|
* Prints log messages depending on the debug level passed in.
|
|
623
643
|
*/
|
|
624
644
|
debug?: LogLevel;
|
|
645
|
+
/**
|
|
646
|
+
* Full server URL, e.g. `"wss://signal.example.com"` or `"http://127.0.0.1:9876"`.
|
|
647
|
+
* Shorthand for host/port/secure/path; any of those passed explicitly win.
|
|
648
|
+
*/
|
|
649
|
+
url?: string;
|
|
650
|
+
/** API key for hosted / multi-tenant Dendri deployments. Sent with every signaling and REST request. */
|
|
651
|
+
apiKey?: string;
|
|
625
652
|
/**
|
|
626
653
|
* Server host for your Dendri signaling server.
|
|
627
654
|
* Also accepts `'/'` to signify relative hostname.
|
|
@@ -648,7 +675,7 @@ declare class DendriOptions implements DendriOption {
|
|
|
648
675
|
*
|
|
649
676
|
* Defaults to {@apilink util.defaultConfig}
|
|
650
677
|
*/
|
|
651
|
-
config?:
|
|
678
|
+
config?: RTCConfiguration;
|
|
652
679
|
/**
|
|
653
680
|
* Set to true `true` if you're using TLS.
|
|
654
681
|
* :::danger
|
|
@@ -658,7 +685,7 @@ declare class DendriOptions implements DendriOption {
|
|
|
658
685
|
secure?: boolean;
|
|
659
686
|
pingInterval?: number;
|
|
660
687
|
referrerPolicy?: ReferrerPolicy;
|
|
661
|
-
logFunction?: (logLevel: LogLevel, ...rest:
|
|
688
|
+
logFunction?: (logLevel: LogLevel, ...rest: unknown[]) => void;
|
|
662
689
|
serializers?: SerializerMapping;
|
|
663
690
|
/** Auto-fetch TURN credentials from the signaling server's GET /turn endpoint. */
|
|
664
691
|
fetchTurnCredentials?: boolean;
|
|
@@ -670,6 +697,12 @@ declare class DendriOptions implements DendriOption {
|
|
|
670
697
|
validateMetadata?: (metadata: unknown) => boolean;
|
|
671
698
|
/** Signaling transport: 'websocket' (default), 'sse', 'polling', or 'auto' (tries WS then SSE then polling) */
|
|
672
699
|
signalingTransport?: "websocket" | "sse" | "polling" | "auto";
|
|
700
|
+
/**
|
|
701
|
+
* ICE candidate privacy policy.
|
|
702
|
+
* - 'all': RFC 8828 mode 1 — all candidates including host IPs (default)
|
|
703
|
+
* - 'public': RFC 8828 mode 3 — only STUN/TURN (srflx + relay) candidates
|
|
704
|
+
*/
|
|
705
|
+
ipPolicy?: "all" | "public";
|
|
673
706
|
}
|
|
674
707
|
|
|
675
708
|
interface SerializerMapping {
|
|
@@ -1375,4 +1408,4 @@ interface DendriStore {
|
|
|
1375
1408
|
*/
|
|
1376
1409
|
declare function createDendriStore(input?: CreateDendriStoreInput): DendriStore;
|
|
1377
1410
|
|
|
1378
|
-
export { AckManager as A, BaseConnectionErrorType as B, type CallOption as C, Dendri as D, type RpcResponse as E, SerializationType as F, ServerMessageType as G, HybridConnection as H, SocketEventType as I, type StoreListener as J,
|
|
1411
|
+
export { AckManager as A, BaseConnectionErrorType as B, type CallOption as C, Dendri as D, type RpcResponse as E, SerializationType as F, ServerMessageType as G, HybridConnection as H, SocketEventType as I, type StoreListener as J, type TransportEvents as K, LogLevel as L, MediaConnection as M, TransportMode as N, createDendriStore as O, type PresenceEvents as P, isRpcRequest as Q, Room as R, type SerializerMapping as S, TopicClass as T, isRpcResponse as U, type CreateDendriStoreInput as V, DataConnection as a, SignalingTransport as b, type AnswerOption as c, ConnectionQuality as d, ConnectionState as e, ConnectionType as f, DataConnectionErrorType as g, type DendriConnectOption as h, DendriError as i, DendriErrorType as j, type DendriEvents as k, type DendriOption as l, DendriOptions as m, type DendriStore as n, type DendriStoreOptions as o, type DendriStoreSnapshot as p, type HybridConnectionOption as q, type HybridSendOptions as r, PresenceManager as s, type RoomEvents as t, type RoomOptions as u, RpcError as v, RpcErrorCode as w, type RpcHandler as x, RpcManager as y, type RpcRequest as z };
|