p2party 0.14.2 → 0.14.7
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 +230 -30
- package/docs/getting-started.md +15 -0
- package/docs/protocol-v4-security.md +40 -0
- package/docs/references.md +28 -8
- package/docs/session-api.md +10 -2
- package/lib/api/signalingServerApi.d.ts +13 -2
- package/lib/api/webrtc/applyIceConfiguration.d.ts +9 -0
- package/lib/api/webrtc/dataChannelHandler.d.ts +10 -0
- package/lib/api/webrtc/deleteRoomData.d.ts +13 -0
- package/lib/api/webrtc/disconnectFromAllRoomsQuery.d.ts +2 -1
- package/lib/api/webrtc/disconnectFromRoomQuery.d.ts +2 -1
- package/lib/api/webrtc/disconnectQuery.d.ts +2 -1
- package/lib/api/webrtc/iceRepair.d.ts +3 -1
- package/lib/api/webrtc/index.d.ts +2 -1
- package/lib/api/webrtc/interfaces.d.ts +37 -0
- package/lib/api/webrtc/negotiationLock.d.ts +24 -0
- package/lib/api/webrtc/pendingOffer.d.ts +29 -0
- package/lib/api/webrtc/rebindDeadline.d.ts +61 -0
- package/lib/api/webrtc/remoteTransportChange.d.ts +142 -0
- package/lib/api/webrtc/retiredRemoteTransports.d.ts +70 -0
- package/lib/api/webrtc/roomEdgeBudget.d.ts +10 -0
- package/lib/api/webrtc/setDescriptionQuery.d.ts +8 -1
- package/lib/api/webrtc/settleOnClose.d.ts +36 -0
- package/lib/blindRendezvous/admissionInput.d.ts +11 -0
- package/lib/blindRendezvous/admissionPolicy.d.ts +217 -0
- package/lib/blindRendezvous/canonicalSchema.d.ts +139 -0
- package/lib/blindRendezvous/carrierEnvelope.d.ts +105 -0
- package/lib/blindRendezvous/coreReduce.d.ts +199 -0
- package/lib/blindRendezvous/derivations.d.ts +381 -0
- package/lib/blindRendezvous/identityHelloAdmission.d.ts +89 -0
- package/lib/blindRendezvous/identityHelloAdmissionPersistence.d.ts +133 -0
- package/lib/blindRendezvous/identityHelloHistoricalEvidence.d.ts +52 -0
- package/lib/blindRendezvous/identityHelloOpen.d.ts +167 -0
- package/lib/blindRendezvous/identityHelloTrial.d.ts +271 -0
- package/lib/blindRendezvous/localAdmissibleProject.d.ts +101 -0
- package/lib/blindRendezvous/localPresenceKeyBinding.d.ts +108 -0
- package/lib/blindRendezvous/localStableIdentityCustody.d.ts +46 -0
- package/lib/blindRendezvous/normativeKernel.d.ts +222 -0
- package/lib/blindRendezvous/operation.d.ts +137 -0
- package/lib/blindRendezvous/operationPayload.d.ts +134 -0
- package/lib/blindRendezvous/pairBootstrapSuite.d.ts +93 -0
- package/lib/blindRendezvous/pairCrypto.d.ts +122 -0
- package/lib/blindRendezvous/pairLedger.d.ts +154 -0
- package/lib/blindRendezvous/pairOpenBudget.d.ts +67 -0
- package/lib/blindRendezvous/pairOpenReservation.d.ts +157 -0
- package/lib/blindRendezvous/pairPlaintext.d.ts +240 -0
- package/lib/blindRendezvous/pairStepEnvelope.d.ts +60 -0
- package/lib/blindRendezvous/plannerState.d.ts +61 -0
- package/lib/blindRendezvous/projections.d.ts +71 -0
- package/lib/blindRendezvous/publicWindow.d.ts +330 -0
- package/lib/blindRendezvous/retainedOperationStore.d.ts +187 -0
- package/lib/blindRendezvous/roomInviteV2.d.ts +92 -0
- package/lib/blindRendezvous/roomPolicyV4.d.ts +90 -0
- package/lib/blindRendezvous/schemas.d.ts +221 -0
- package/lib/blindRendezvous/storeDescriptor.d.ts +160 -0
- package/lib/cryptography/aeadWasm.d.ts +18 -0
- package/lib/cryptography/byteInput.d.ts +12 -0
- package/lib/cryptography/carrierAead.d.ts +23 -0
- package/lib/cryptography/chacha20poly1305.d.ts +7 -0
- package/lib/cryptography/fips202.d.ts +10 -0
- package/lib/cryptography/hpke.d.ts +84 -0
- package/lib/cryptography/hpkeSuite.d.ts +39 -0
- package/lib/cryptography/hybridKem.d.ts +42 -0
- package/lib/cryptography/hybridKemSuite.d.ts +22 -0
- package/lib/cryptography/interfaces.d.ts +3 -0
- package/lib/cryptography/mlkem.d.ts +27 -1
- package/lib/cryptography/mnemonic.d.ts +65 -1
- package/lib/cryptography/ownedEd25519KeyMaterial.d.ts +27 -0
- package/lib/cryptography/webCryptoSha256.d.ts +20 -0
- package/lib/cryptography/x25519.d.ts +18 -0
- package/lib/cryptography/xchacha20poly1305.d.ts +7 -0
- package/lib/db/api.d.ts +6 -3
- package/lib/db/identityEd25519ClientBoundary.d.ts +13 -0
- package/lib/db/src/getDB.d.ts +2 -2
- package/lib/db/types.d.ts +52 -4
- package/lib/db.worker.js +1 -1
- package/lib/handlers/coverChannelRegistry.d.ts +22 -0
- package/lib/handlers/edgeTeardownFollowUp.d.ts +35 -0
- package/lib/handlers/handleChallenge.d.ts +2 -1
- package/lib/handlers/handleConnectToPeer.d.ts +1 -1
- package/lib/handlers/handleHandshake.d.ts +2 -6
- package/lib/handlers/handleSendMessage.d.ts +60 -7
- package/lib/handlers/handleWebSocketMessage.d.ts +1 -1
- package/lib/handlers/handshakeCore.d.ts +2 -7
- package/lib/handlers/handshakeFrame.d.ts +25 -0
- package/lib/handlers/ratchetGateWait.d.ts +13 -0
- package/lib/handlers/reconcile.d.ts +24 -0
- package/lib/handlers/requestRoom.d.ts +30 -0
- package/lib/handlers/roomResponse.d.ts +53 -0
- package/lib/index.d.ts +99 -12
- package/lib/index.js +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/libcrypto.provenance.json +5 -5
- package/lib/libcrypto.wasm +0 -0
- package/lib/middleware/roomListenerMiddleware.d.ts +4 -1
- package/lib/reducers/commonSlice.d.ts +3 -2
- package/lib/reducers/keyPairSlice.d.ts +3 -6
- package/lib/reducers/roomSlice.d.ts +81 -5
- package/lib/reducers/signalingServerSlice.d.ts +3 -2
- package/lib/session.d.ts +6 -3
- package/lib/session.js +1 -1
- package/lib/session.mjs +1 -1
- package/lib/store.d.ts +4 -2
- package/lib/utils/constants.d.ts +12 -0
- package/lib/utils/correlationId.d.ts +4 -0
- package/lib/utils/identityRestore.d.ts +108 -0
- package/lib/utils/interfaces.d.ts +25 -6
- package/lib/utils/roomConnectAdmission.d.ts +15 -0
- package/lib/utils/roomLeaveCoordinator.d.ts +38 -0
- package/lib/utils/roomRequestCoordinator.d.ts +104 -0
- package/lib/utils/roomRosterReconciler.d.ts +83 -0
- package/lib/utils/sdpFingerprint.d.ts +6 -0
- package/lib/utils/signalingAttemptLifecycle.d.ts +33 -0
- package/lib/utils/signalingAuth.d.ts +21 -2
- package/lib/utils/signalingBounds.d.ts +6 -0
- package/lib/utils/signalingFrame.d.ts +21 -0
- package/lib/utils/signalingHeartbeatWatchdog.d.ts +45 -0
- package/lib/utils/signalingIngressQueue.d.ts +49 -0
- package/lib/utils/signalingPeerRequestDebouncer.d.ts +13 -0
- package/lib/utils/signalingRoomLifecycle.d.ts +7 -0
- package/lib/utils/signalingRoomOperationLifecycle.d.ts +14 -0
- package/lib/utils/signalingServerBoundary.d.ts +11 -0
- package/lib/utils/terminalSettlement.d.ts +53 -0
- package/lib/utils/transportIdentity.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { applyRoomResponse } from "../reducers/roomSlice";
|
|
2
|
+
import type { ManagedRoom } from "../reducers/roomSlice";
|
|
3
|
+
import type { TurnCredentials } from "../utils/interfaces";
|
|
4
|
+
import type { PendingRoomResponseClaim } from "../utils/roomRequestCoordinator";
|
|
5
|
+
export interface RoomResponseCorrelation {
|
|
6
|
+
readonly roomUrl: string;
|
|
7
|
+
readonly roomRequestId: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Read only the correlation tuple. No pending request is consumed until this
|
|
11
|
+
* tuple has been proven to be the exact current wire nonce.
|
|
12
|
+
*/
|
|
13
|
+
export declare const parseRoomResponseCorrelation: (value: unknown) => RoomResponseCorrelation | null;
|
|
14
|
+
export type RoomResponsePlan = {
|
|
15
|
+
accepted: true;
|
|
16
|
+
action: ReturnType<typeof applyRoomResponse>;
|
|
17
|
+
roomId: string;
|
|
18
|
+
roomUrl: string;
|
|
19
|
+
roomRequestId: string;
|
|
20
|
+
requestGeneration: number;
|
|
21
|
+
expiresAtUnixSeconds: number | null;
|
|
22
|
+
nextRtcConfig: RTCConfiguration;
|
|
23
|
+
} | {
|
|
24
|
+
accepted: false;
|
|
25
|
+
reason: "malformed-room-response" | "malformed-turn-credentials" | "unknown-room" | "room-id-reassignment" | "room-id-collision" | "stale-room-response";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Validate one wire-correlated response and derive its single Redux commit.
|
|
29
|
+
*
|
|
30
|
+
* Room identity and the signaling-owned TURN bundle change in one reducer
|
|
31
|
+
* action. No observer can see a new room ID paired with old credentials.
|
|
32
|
+
*/
|
|
33
|
+
export declare const planRoomResponse: (value: unknown, rooms: readonly ManagedRoom[], claim: PendingRoomResponseClaim, expectedPublicKey: string, nowMs?: number) => RoomResponsePlan;
|
|
34
|
+
export type AcceptedRoomResponsePlan = Extract<RoomResponsePlan, {
|
|
35
|
+
accepted: true;
|
|
36
|
+
}>;
|
|
37
|
+
export interface AuthoritativeRoomResponseState {
|
|
38
|
+
id: string;
|
|
39
|
+
roomResponseGeneration: number;
|
|
40
|
+
rtcConfig: RTCConfiguration;
|
|
41
|
+
signalingTurnCredentials: TurnCredentials | null;
|
|
42
|
+
signalingActive: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** True only when an expiry reducer just removed this exact live generation. */
|
|
45
|
+
export declare const isExactExpiredTurnGeneration: (room: AuthoritativeRoomResponseState | undefined, plan: Pick<AcceptedRoomResponsePlan, "roomId" | "requestGeneration">) => room is AuthoritativeRoomResponseState;
|
|
46
|
+
/**
|
|
47
|
+
* Apply live browser configuration before publishing the Redux generation.
|
|
48
|
+
*
|
|
49
|
+
* If setConfiguration() rejects, the old state and old refresh timer remain
|
|
50
|
+
* authoritative and retryable. Publishing first could orphan the new expiry
|
|
51
|
+
* with no timer while live PCs still used the old credential.
|
|
52
|
+
*/
|
|
53
|
+
export declare const commitRoomResponsePlan: (plan: AcceptedRoomResponsePlan, applyLiveConfiguration: (roomId: string, rtcConfig: RTCConfiguration, failurePolicy: "rollback" | "close") => Promise<void>, canPublish: () => boolean, publish: () => boolean, readRoom: (roomUrl: string) => AuthoritativeRoomResponseState | undefined, rollbackPublishedState?: (previous: AuthoritativeRoomResponseState) => void) => Promise<boolean>;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { createSession, generateSessionIdentity, restoreSession } from "./session";
|
|
2
|
+
import { validateMnemonic, validateMnemonicWords } from "./cryptography/mnemonic";
|
|
2
3
|
import { setWasmSourceUrl } from "./cryptography/wasmLoader";
|
|
3
4
|
import { setDebugLogging } from "./utils/debug";
|
|
4
5
|
import { WIRE_CHUNK_FRAME_LEN } from "./utils/constants";
|
|
5
6
|
import { DEFAULT_ROOM_POLICY_V1, MIN_COVER_CADENCE_MS, MAX_COVER_CADENCE_MS, MAX_COVER_LANES, MAX_COVER_FRAMES_PER_CELL, MIN_COVER_SLOT_MS, canonicalizeRoomPolicyV1, decodeRoomPolicyV1, encodeRoomPolicyV1, hashRoomPolicyV1, roomPoliciesEqualV1, validateRoomPolicyV1 } from "./roomPolicy";
|
|
6
|
-
import
|
|
7
|
+
import { InvalidRecoveryPhraseError } from "./utils/identityRestore";
|
|
8
|
+
import { RemoteRoomRevocationUnconfirmedError } from "./utils/roomLeaveCoordinator";
|
|
9
|
+
import type { State as InternalState } from "./store";
|
|
7
10
|
import type { Room, Peer, Channel, Message } from "./reducers/roomSlice";
|
|
8
11
|
import type { SignalingState } from "./reducers/signalingServerSlice";
|
|
9
12
|
import type { MimeType, FileExtension } from "./utils/messageTypes";
|
|
10
|
-
import type { WebSocketMessageRoomIdRequest, WebSocketMessageRoomIdResponse, WebSocketMessageChallengeRequest, WebSocketMessageChallengeResponse, WebSocketMessageDescriptionSend, WebSocketMessageDescriptionReceive, WebSocketMessageCandidateSend, WebSocketMessageCandidateReceive, WebSocketMessageError } from "./utils/interfaces";
|
|
13
|
+
import type { WebSocketMessageRoomIdRequest, WebSocketMessageRoomIdResponse, WebSocketMessageChallengeRequest, WebSocketMessageChallengeResponse, WebSocketMessageDescriptionSend, WebSocketMessageDescriptionReceive, WebSocketMessageCandidateSend, WebSocketMessageCandidateReceive, WebSocketMessageLeaveRoomRequest, WebSocketMessageRoomLeftResponse, WebSocketMessageError } from "./utils/interfaces";
|
|
11
14
|
import type { RoomData } from "./api/webrtc/interfaces";
|
|
12
|
-
import type { BlacklistedPeer, UsernamedPeer, UniqueRoom, RoomStats } from "./db/types";
|
|
15
|
+
import type { BlacklistedPeer, IdentityDerivation, UsernamedPeer, UniqueRoom, RoomStats } from "./db/types";
|
|
16
|
+
import type { CreatedRecoverableIdentity, CreateRecoverableIdentityOptions, RestoredIdentity } from "./utils/identityRestore";
|
|
13
17
|
import type { KeyPair } from "./reducers/keyPairSlice";
|
|
14
18
|
import type { RoomPolicyV1 } from "./roomPolicy";
|
|
15
19
|
import type { SendMessageResult } from "./handlers/handleSendMessage";
|
|
16
20
|
import { MessageDeliveryError } from "./handlers/handleSendMessage";
|
|
21
|
+
/** Public projection; reducer state keeps its additional fields normalized. */
|
|
22
|
+
type State = Omit<InternalState, "rooms"> & {
|
|
23
|
+
rooms: Room[];
|
|
24
|
+
};
|
|
17
25
|
export interface ConnectRoomOptions {
|
|
18
26
|
/**
|
|
19
27
|
* Canonical public room policy. Omit on reconnect to preserve the room's
|
|
@@ -121,11 +129,69 @@ export interface MessageTransferHandle {
|
|
|
121
129
|
/** Cancels exactly this logical send, even before hashing/WASM setup finishes. */
|
|
122
130
|
cancel(): Promise<void>;
|
|
123
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Adopt the identity a recovery phrase encodes, in place of the current one.
|
|
134
|
+
*
|
|
135
|
+
* An invalid phrase rejects with `InvalidRecoveryPhraseError` before anything
|
|
136
|
+
* is disconnected, so a typo costs nothing. Only a phrase that derives a key
|
|
137
|
+
* opens the exclusive boundary: signaling is disconnected, every room's WebRTC
|
|
138
|
+
* transport is brought to a terminal state, the cross-signed X25519 identity is
|
|
139
|
+
* deleted (the next connection regenerates and re-signs it), the Ed25519 key is
|
|
140
|
+
* persisted, and the identity is adopted in memory last.
|
|
141
|
+
*
|
|
142
|
+
* Rooms, messages, the address book and cached room PINs are all kept. Peers
|
|
143
|
+
* see a new identity key for this device, exactly as they would after a purge,
|
|
144
|
+
* so the address book will report an identity change.
|
|
145
|
+
*
|
|
146
|
+
* Signaling is left disconnected: call `connect(roomUrl)` afterwards to come
|
|
147
|
+
* back online under the restored identity.
|
|
148
|
+
*
|
|
149
|
+
* @param mnemonic - The recovery phrase, in any transcription
|
|
150
|
+
* @param password - The passphrase the identity was created with, if any
|
|
151
|
+
* @returns The restored Ed25519 public key, hex-encoded
|
|
152
|
+
*/
|
|
153
|
+
declare const restoreIdentityFromMnemonic: (mnemonic: string, password?: string) => Promise<RestoredIdentity>;
|
|
154
|
+
/**
|
|
155
|
+
* Replace the current identity with a freshly generated, recoverable one and
|
|
156
|
+
* return the phrase that restores it.
|
|
157
|
+
*
|
|
158
|
+
* The phrase is shown once and stored nowhere: it is the only backup, and a
|
|
159
|
+
* caller that drops it before the user has written it down has lost it. A
|
|
160
|
+
* `password` is folded into the derivation and is equally unrecoverable — the
|
|
161
|
+
* phrase alone will not restore the identity without it.
|
|
162
|
+
*
|
|
163
|
+
* As with `restoreIdentityFromMnemonic`, signaling is left disconnected; call
|
|
164
|
+
* `connect(roomUrl)` afterwards.
|
|
165
|
+
*
|
|
166
|
+
* @param options - Entropy bits (128 gives 12 words, 256 gives 24) and an
|
|
167
|
+
* optional passphrase
|
|
168
|
+
* @returns The recovery phrase and the Ed25519 public key it now derives
|
|
169
|
+
*/
|
|
170
|
+
declare const createRecoverableIdentity: (options?: CreateRecoverableIdentityOptions) => Promise<CreatedRecoverableIdentity>;
|
|
171
|
+
/** What the current account key is, and whether a phrase can reproduce it. */
|
|
172
|
+
export interface IdentityBackupStatus {
|
|
173
|
+
publicKey: string;
|
|
174
|
+
derivation: IdentityDerivation | null;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Whether the identity in use can be backed up at all.
|
|
178
|
+
*
|
|
179
|
+
* `derivation` is "mnemonic" only for an identity that was created from a
|
|
180
|
+
* recovery phrase; a "random" one cannot be exported, and the only way to get a
|
|
181
|
+
* recoverable identity is `createRecoverableIdentity`, which replaces it. It is
|
|
182
|
+
* null when no identity is stored yet, and also when the stored flag no longer
|
|
183
|
+
* describes the stored key — an unreadable provenance hint must never be
|
|
184
|
+
* reported as "this can be backed up".
|
|
185
|
+
*
|
|
186
|
+
* @returns The current Ed25519 public key (empty when there is none) and how it
|
|
187
|
+
* came into being
|
|
188
|
+
*/
|
|
189
|
+
declare const getIdentityBackupStatus: () => Promise<IdentityBackupStatus>;
|
|
124
190
|
export declare const p2party: {
|
|
125
191
|
store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
126
192
|
commonState: import("./reducers/commonSlice").CommonState;
|
|
127
193
|
keyPair: KeyPair;
|
|
128
|
-
rooms:
|
|
194
|
+
rooms: import("./reducers/roomSlice").ManagedRoom[];
|
|
129
195
|
signalingServer: SignalingState;
|
|
130
196
|
signalingServerApi: import("@reduxjs/toolkit/query").CombinedState<{
|
|
131
197
|
connectWebSocket: import("@reduxjs/toolkit/query").MutationDefinition<string, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/signalingServerApi").WebSocketParams, undefined>, never, undefined, "signalingServerApi", undefined>;
|
|
@@ -137,6 +203,7 @@ export declare const p2party: {
|
|
|
137
203
|
connectWithPeer: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCPeerConnectionParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
138
204
|
setDescription: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCSetDescriptionParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
139
205
|
setCandidate: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCSetCandidateParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
206
|
+
applyRoomConfiguration: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCApplyRoomConfigurationParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
140
207
|
openChannel: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCOpenChannelParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
141
208
|
sendMessage: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCSendMessageParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, SendMessageResult | undefined, "webrtcApi", undefined>;
|
|
142
209
|
disconnect: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCDisconnectParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
@@ -150,7 +217,7 @@ export declare const p2party: {
|
|
|
150
217
|
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
151
218
|
commonState: import("./reducers/commonSlice").CommonState;
|
|
152
219
|
keyPair: KeyPair;
|
|
153
|
-
rooms:
|
|
220
|
+
rooms: import("./reducers/roomSlice").ManagedRoom[];
|
|
154
221
|
signalingServer: SignalingState;
|
|
155
222
|
signalingServerApi: import("@reduxjs/toolkit/query").CombinedState<{
|
|
156
223
|
connectWebSocket: import("@reduxjs/toolkit/query").MutationDefinition<string, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/signalingServerApi").WebSocketParams, undefined>, never, undefined, "signalingServerApi", undefined>;
|
|
@@ -162,6 +229,7 @@ export declare const p2party: {
|
|
|
162
229
|
connectWithPeer: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCPeerConnectionParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
163
230
|
setDescription: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCSetDescriptionParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
164
231
|
setCandidate: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCSetCandidateParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
232
|
+
applyRoomConfiguration: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCApplyRoomConfigurationParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
165
233
|
openChannel: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCOpenChannelParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
166
234
|
sendMessage: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCSendMessageParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, SendMessageResult | undefined, "webrtcApi", undefined>;
|
|
167
235
|
disconnect: import("@reduxjs/toolkit/query").MutationDefinition<import("./api/webrtc/interfaces").RTCDisconnectParams, import("@reduxjs/toolkit/query").BaseQueryFn<import("./api/webrtc/baseQuery").RTCPeerConnectionParamsExtend, undefined>, never, undefined, "webrtcApi", undefined>;
|
|
@@ -173,10 +241,18 @@ export declare const p2party: {
|
|
|
173
241
|
}, never, "webrtcApi">;
|
|
174
242
|
}, undefined, import("redux").UnknownAction> & ((action: import("redux").Action<"listenerMiddleware/add">) => import("@reduxjs/toolkit").UnsubscribeListener);
|
|
175
243
|
}>, import("redux").StoreEnhancer]>>;
|
|
176
|
-
commonStateSelector: (state:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
244
|
+
commonStateSelector: (state: {
|
|
245
|
+
readonly commonState: import("./reducers/commonSlice").CommonState;
|
|
246
|
+
}) => import("./reducers/commonSlice").CommonState;
|
|
247
|
+
signalingServerSelector: (state: {
|
|
248
|
+
readonly signalingServer: SignalingState;
|
|
249
|
+
}) => SignalingState;
|
|
250
|
+
roomSelector: <TRoom extends Room>(state: {
|
|
251
|
+
readonly rooms: TRoom[];
|
|
252
|
+
}) => TRoom[];
|
|
253
|
+
keyPairSelector: (state: {
|
|
254
|
+
readonly keyPair: KeyPair;
|
|
255
|
+
}) => KeyPair;
|
|
180
256
|
connect: (roomUrl: string, signalingServerUrl?: string, rtcConfig?: RTCConfiguration, options?: ConnectRoomOptions) => Promise<void>;
|
|
181
257
|
connectToSignalingServer: (roomUrl: string, signalingServerUrl?: string) => Promise<void>;
|
|
182
258
|
disconnectFromSignalingServer: () => Promise<void>;
|
|
@@ -208,6 +284,7 @@ export declare const p2party: {
|
|
|
208
284
|
chunksReceivedReal?: number;
|
|
209
285
|
retransmits?: number;
|
|
210
286
|
}>;
|
|
287
|
+
getTransferAcks: (roomId: string, transferId: string) => import(".").TransferAck[];
|
|
211
288
|
getSendChunksCount: (transferId: string) => Promise<number>;
|
|
212
289
|
cancelMessage: (roomId: string, channelLabel: string, merkleRoot?: string | Uint8Array, hash?: string | Uint8Array, transferId?: string) => Promise<void>;
|
|
213
290
|
createTransferId: () => string;
|
|
@@ -241,7 +318,13 @@ export declare const p2party: {
|
|
|
241
318
|
generateKeyPair: (module?: import("./cryptography/libcrypto").LibCrypto) => Promise<import("./cryptography/interfaces").SignKeyPair>;
|
|
242
319
|
newKeyPair: (module?: import("./cryptography/libcrypto").LibCrypto) => Promise<import("./cryptography/interfaces").SignKeyPair>;
|
|
243
320
|
generateMnemonic: (strength?: 128 | 160 | 192 | 224 | 256 | 288 | 320 | 352 | 384 | 416 | 448 | 480 | 512) => Promise<string>;
|
|
244
|
-
keyPairFromMnemonic: (mnemonic: string, password?: string) => Promise<import("./cryptography/interfaces").SignKeyPair>;
|
|
321
|
+
keyPairFromMnemonic: (mnemonic: string, password?: string, module?: import("./cryptography/libcrypto").LibCrypto) => Promise<import("./cryptography/interfaces").SignKeyPair>;
|
|
322
|
+
validateMnemonic: (mnemonic: string) => Promise<boolean>;
|
|
323
|
+
validateMnemonicWords: (words: string) => import(".").MnemonicValidation;
|
|
324
|
+
createRecoverableIdentity: (options?: CreateRecoverableIdentityOptions) => Promise<CreatedRecoverableIdentity>;
|
|
325
|
+
restoreIdentityFromMnemonic: (mnemonic: string, password?: string) => Promise<RestoredIdentity>;
|
|
326
|
+
getIdentityBackupStatus: () => Promise<IdentityBackupStatus>;
|
|
327
|
+
InvalidRecoveryPhraseError: typeof InvalidRecoveryPhraseError;
|
|
245
328
|
MIN_CHUNKS: number;
|
|
246
329
|
MIN_CHUNK_SIZE: number;
|
|
247
330
|
MAX_CHUNK_SIZE: number;
|
|
@@ -253,6 +336,7 @@ export declare const p2party: {
|
|
|
253
336
|
MIN_COVER_SLOT_MS: number;
|
|
254
337
|
validateRoomPolicyV1: (policy: RoomPolicyV1) => void;
|
|
255
338
|
MessageDeliveryError: typeof MessageDeliveryError;
|
|
339
|
+
RemoteRoomRevocationUnconfirmedError: typeof RemoteRoomRevocationUnconfirmedError;
|
|
256
340
|
joinRoom: (roomUrl: string, signalingServerUrl?: string, rtcConfig?: RTCConfiguration, options?: ConnectRoomOptions & WaitForRoomOptions) => Promise<Room>;
|
|
257
341
|
waitForRoom: (roomUrl: string, options?: WaitForRoomOptions) => Promise<Room>;
|
|
258
342
|
waitForPeers: (roomId: string, options?: WaitForPeersOptions) => Promise<Peer[]>;
|
|
@@ -347,10 +431,13 @@ declare global {
|
|
|
347
431
|
p2party: typeof p2party;
|
|
348
432
|
}
|
|
349
433
|
}
|
|
350
|
-
export type { State, Room, Peer, Channel, Message, RoomData, MimeType, FileExtension, UsernamedPeer, BlacklistedPeer, UniqueRoom, RoomStats, SignalingState, KeyPair, RoomPolicyV1, WebSocketMessageRoomIdRequest, WebSocketMessageRoomIdResponse, WebSocketMessageChallengeRequest, WebSocketMessageChallengeResponse, WebSocketMessageDescriptionSend, WebSocketMessageDescriptionReceive, WebSocketMessageCandidateSend, WebSocketMessageCandidateReceive, WebSocketMessageError, };
|
|
351
|
-
export { createSession, restoreSession, generateSessionIdentity, setWasmSourceUrl, MessageDeliveryError, joinRoom, waitForRoom, waitForPeers, onMessage, setDebugLogging, };
|
|
434
|
+
export type { State, Room, Peer, Channel, Message, RoomData, MimeType, FileExtension, UsernamedPeer, BlacklistedPeer, UniqueRoom, RoomStats, SignalingState, KeyPair, RoomPolicyV1, IdentityDerivation, WebSocketMessageRoomIdRequest, WebSocketMessageRoomIdResponse, WebSocketMessageChallengeRequest, WebSocketMessageChallengeResponse, WebSocketMessageDescriptionSend, WebSocketMessageDescriptionReceive, WebSocketMessageCandidateSend, WebSocketMessageCandidateReceive, WebSocketMessageLeaveRoomRequest, WebSocketMessageRoomLeftResponse, WebSocketMessageError, };
|
|
435
|
+
export { createSession, restoreSession, generateSessionIdentity, setWasmSourceUrl, MessageDeliveryError, RemoteRoomRevocationUnconfirmedError, createRecoverableIdentity, restoreIdentityFromMnemonic, getIdentityBackupStatus, validateMnemonic, validateMnemonicWords, InvalidRecoveryPhraseError, joinRoom, waitForRoom, waitForPeers, onMessage, setDebugLogging, };
|
|
352
436
|
export { DEFAULT_ROOM_POLICY_V1, canonicalizeRoomPolicyV1, decodeRoomPolicyV1, encodeRoomPolicyV1, hashRoomPolicyV1, roomPoliciesEqualV1, };
|
|
353
437
|
export { MIN_COVER_CADENCE_MS, MAX_COVER_CADENCE_MS, MAX_COVER_LANES, MAX_COVER_FRAMES_PER_CELL, MIN_COVER_SLOT_MS, validateRoomPolicyV1, WIRE_CHUNK_FRAME_LEN, };
|
|
438
|
+
export type { TransferAck } from "./handlers/reconcile";
|
|
439
|
+
export type { MnemonicValidation } from "./cryptography/mnemonic";
|
|
440
|
+
export type { CreatedRecoverableIdentity, CreateRecoverableIdentityOptions, RestoredIdentity, } from "./utils/identityRestore";
|
|
354
441
|
export type { RoomAuthMode, RoomCoverMode, RoomPqMode, RoomRendezvousMode, } from "./roomPolicy";
|
|
355
442
|
export type { CreateSessionOptions, EncryptedSessionMessage, GenerateSessionIdentityOptions, GeneratedSessionIdentity, HandshakeTransport, LocalSessionIdentity, P2PartySession, SessionChannelBinding, SessionCryptoOptions, } from "./session";
|
|
356
443
|
export default p2party;
|