@ping-app/ping-openmls-sdk 0.10.1 → 0.10.2
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/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/notification-preview.d.cts +1 -1
- package/dist/notification-preview.d.ts +1 -1
- package/dist/storage/indexeddb.d.cts +1 -1
- package/dist/storage/indexeddb.d.ts +1 -1
- package/dist/transport/websocket.d.cts +1 -1
- package/dist/transport/websocket.d.ts +1 -1
- package/dist/{types-B1GFwNXa.d.cts → types-gAmJFSC-.d.cts} +11 -1
- package/dist/{types-B1GFwNXa.d.ts → types-gAmJFSC-.d.ts} +11 -1
- package/dist/worker.cjs +7 -0
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.js +7 -0
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/wasm/package.json +1 -1
- package/wasm/ping_wasm.d.ts +18 -2
- package/wasm/ping_wasm.js +66 -22
- package/wasm/ping_wasm_bg.wasm +0 -0
- package/wasm/ping_wasm_bg.wasm.d.ts +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MessageEnvelope, S as Storage, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, L as LinkingTicket, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, I as IdentityRotation, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, i as IncomingMessage, j as SequencedEnvelope, k as ApplyBatchResult, l as SyncStepResult, m as LogPosition, n as LogHead, P as PendingApply, o as CatchupAppEvent, p as CatchupSnapshotView, R as RecoveryBackup, H as HistoryBundle, q as AdmitChatEntry, r as AdmitChatOutcome, s as DeviceRemovalReport, t as MessageBatchMeta } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { M as MessageEnvelope, S as Storage, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, L as LinkingTicket, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, I as IdentityRotation, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, i as IncomingMessage, j as SequencedEnvelope, k as ApplyBatchResult, l as SyncStepResult, m as LogPosition, n as LogHead, P as PendingApply, o as CatchupAppEvent, p as CatchupSnapshotView, R as RecoveryBackup, H as HistoryBundle, q as AdmitChatEntry, r as AdmitChatOutcome, s as DeviceRemovalReport, t as ExportedSecret, u as MessageBatchMeta } from './types-gAmJFSC-.cjs';
|
|
2
|
+
export { v as AddMemberStatus, w as AddMemberVerdict, B as BufferOverflow, x as Bytes, y as CatchupSnapshotEntry, z as ConversationRemoval, F as ConversationUpdate, G as DeviceInfo, J as DeviceRemovalFailure, D as DiscoveredDevice, N as HistoryAppEvent, O as Hlc, Q as IdentityRotationFailure, V as LogGap, W as MessageKind, X as OverflowReason, Y as SenderRole, Z as StrandReason, _ as StrandedConversation, $ as WelcomeFailure, a0 as WelcomeFailureReason } from './types-gAmJFSC-.cjs';
|
|
3
3
|
export { IndexedDbStorage } from './storage/indexeddb.cjs';
|
|
4
4
|
export { WebSocketTransport } from './transport/websocket.cjs';
|
|
5
5
|
export { MAX_PREVIEW_PREREQUISITES, NotificationPreviewOptions, NotificationPreviewSession, openNotificationPreview } from './notification-preview.cjs';
|
|
@@ -1093,6 +1093,22 @@ declare class MessagingClient {
|
|
|
1093
1093
|
* byte-equality is enforced by `protocol/conformance/export_secret/`.
|
|
1094
1094
|
*/
|
|
1095
1095
|
exportConversationSecret(conv: ConversationId, label: string, context: Uint8Array, length: number): Promise<Uint8Array>;
|
|
1096
|
+
/**
|
|
1097
|
+
* {@link exportConversationSecret} together with the MLS epoch the secret was
|
|
1098
|
+
* exported at, from one read under one lock inside the core: the pair can
|
|
1099
|
+
* never disagree across a Commit.
|
|
1100
|
+
*
|
|
1101
|
+
* A host that files a key under an epoch number (a call's media key ring)
|
|
1102
|
+
* takes BOTH from this call. A conversation handle's `epoch` is this thread's
|
|
1103
|
+
* copy and any other read is a second request, so either may be a Commit away
|
|
1104
|
+
* from the secret.
|
|
1105
|
+
*
|
|
1106
|
+
* Same derivation, same arguments and the same refusals as
|
|
1107
|
+
* {@link exportConversationSecret}: at one epoch both answer the same bytes.
|
|
1108
|
+
* `secret` is a secret: never log it, persist it only encrypted, and call
|
|
1109
|
+
* `secret.fill(0)` after use. `epoch` is a plain number and may be logged.
|
|
1110
|
+
*/
|
|
1111
|
+
exportConversationSecretWithEpoch(conv: ConversationId, label: string, context: Uint8Array, length: number): Promise<ExportedSecret>;
|
|
1096
1112
|
/**
|
|
1097
1113
|
* Subscribe to decrypted application messages, one call per message. A
|
|
1098
1114
|
* batch or page result (the sequenced paths) is fanned out here per
|
|
@@ -1226,4 +1242,4 @@ declare function emulateSendBatch(transport: Pick<Transport, "send">, envelopes:
|
|
|
1226
1242
|
* server error code rides along for diagnostics. */
|
|
1227
1243
|
declare function describeTransportError(e: unknown): string;
|
|
1228
1244
|
|
|
1229
|
-
export { AddMembersReport, AdmitChatEntry, AdmitChatOutcome, ApplyBatchResult, BATCH_PARTIAL_PREFIX, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DeviceId, DeviceLinkApproval, DeviceLinkPossession, DeviceReauthProof, DeviceRemovalReport, EphemeralWorkerError, ExpectedOwner, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, IdentityRotation, IncomingMessage, KeyPackageEntry, LinkingTicket, LogHead, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, NotPermittedError, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, RecoveryBackup, SENDER_MISMATCH_PREFIX, SenderMismatchError, SequencedEnvelope, Storage, SyncStepResult, Transport, UserId, ValidationError, WIRE_VERSION_MIN_ACCEPTED, describeTransportError, emulateSendBatch, isNotPermittedError, isSenderMismatchError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };
|
|
1245
|
+
export { AddMembersReport, AdmitChatEntry, AdmitChatOutcome, ApplyBatchResult, BATCH_PARTIAL_PREFIX, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DeviceId, DeviceLinkApproval, DeviceLinkPossession, DeviceReauthProof, DeviceRemovalReport, EphemeralWorkerError, ExpectedOwner, ExportedSecret, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, IdentityRotation, IncomingMessage, KeyPackageEntry, LinkingTicket, LogHead, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, NotPermittedError, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, RecoveryBackup, SENDER_MISMATCH_PREFIX, SenderMismatchError, SequencedEnvelope, Storage, SyncStepResult, Transport, UserId, ValidationError, WIRE_VERSION_MIN_ACCEPTED, describeTransportError, emulateSendBatch, isNotPermittedError, isSenderMismatchError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MessageEnvelope, S as Storage, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, L as LinkingTicket, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, I as IdentityRotation, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, i as IncomingMessage, j as SequencedEnvelope, k as ApplyBatchResult, l as SyncStepResult, m as LogPosition, n as LogHead, P as PendingApply, o as CatchupAppEvent, p as CatchupSnapshotView, R as RecoveryBackup, H as HistoryBundle, q as AdmitChatEntry, r as AdmitChatOutcome, s as DeviceRemovalReport, t as MessageBatchMeta } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { M as MessageEnvelope, S as Storage, T as Transport, E as ExpectedOwner, C as ConversationId, K as KeyPackageEntry, A as AddMembersReport, a as DeviceId, U as UserId, b as ConversationMeta, L as LinkingTicket, c as DeviceReauthProof, d as DeviceLinkApproval, e as DeviceLinkPossession, I as IdentityRotation, f as CommitInDoubt, g as MemberInfo, h as ConversationPolicy, i as IncomingMessage, j as SequencedEnvelope, k as ApplyBatchResult, l as SyncStepResult, m as LogPosition, n as LogHead, P as PendingApply, o as CatchupAppEvent, p as CatchupSnapshotView, R as RecoveryBackup, H as HistoryBundle, q as AdmitChatEntry, r as AdmitChatOutcome, s as DeviceRemovalReport, t as ExportedSecret, u as MessageBatchMeta } from './types-gAmJFSC-.js';
|
|
2
|
+
export { v as AddMemberStatus, w as AddMemberVerdict, B as BufferOverflow, x as Bytes, y as CatchupSnapshotEntry, z as ConversationRemoval, F as ConversationUpdate, G as DeviceInfo, J as DeviceRemovalFailure, D as DiscoveredDevice, N as HistoryAppEvent, O as Hlc, Q as IdentityRotationFailure, V as LogGap, W as MessageKind, X as OverflowReason, Y as SenderRole, Z as StrandReason, _ as StrandedConversation, $ as WelcomeFailure, a0 as WelcomeFailureReason } from './types-gAmJFSC-.js';
|
|
3
3
|
export { IndexedDbStorage } from './storage/indexeddb.js';
|
|
4
4
|
export { WebSocketTransport } from './transport/websocket.js';
|
|
5
5
|
export { MAX_PREVIEW_PREREQUISITES, NotificationPreviewOptions, NotificationPreviewSession, openNotificationPreview } from './notification-preview.js';
|
|
@@ -1093,6 +1093,22 @@ declare class MessagingClient {
|
|
|
1093
1093
|
* byte-equality is enforced by `protocol/conformance/export_secret/`.
|
|
1094
1094
|
*/
|
|
1095
1095
|
exportConversationSecret(conv: ConversationId, label: string, context: Uint8Array, length: number): Promise<Uint8Array>;
|
|
1096
|
+
/**
|
|
1097
|
+
* {@link exportConversationSecret} together with the MLS epoch the secret was
|
|
1098
|
+
* exported at, from one read under one lock inside the core: the pair can
|
|
1099
|
+
* never disagree across a Commit.
|
|
1100
|
+
*
|
|
1101
|
+
* A host that files a key under an epoch number (a call's media key ring)
|
|
1102
|
+
* takes BOTH from this call. A conversation handle's `epoch` is this thread's
|
|
1103
|
+
* copy and any other read is a second request, so either may be a Commit away
|
|
1104
|
+
* from the secret.
|
|
1105
|
+
*
|
|
1106
|
+
* Same derivation, same arguments and the same refusals as
|
|
1107
|
+
* {@link exportConversationSecret}: at one epoch both answer the same bytes.
|
|
1108
|
+
* `secret` is a secret: never log it, persist it only encrypted, and call
|
|
1109
|
+
* `secret.fill(0)` after use. `epoch` is a plain number and may be logged.
|
|
1110
|
+
*/
|
|
1111
|
+
exportConversationSecretWithEpoch(conv: ConversationId, label: string, context: Uint8Array, length: number): Promise<ExportedSecret>;
|
|
1096
1112
|
/**
|
|
1097
1113
|
* Subscribe to decrypted application messages, one call per message. A
|
|
1098
1114
|
* batch or page result (the sequenced paths) is fanned out here per
|
|
@@ -1226,4 +1242,4 @@ declare function emulateSendBatch(transport: Pick<Transport, "send">, envelopes:
|
|
|
1226
1242
|
* server error code rides along for diagnostics. */
|
|
1227
1243
|
declare function describeTransportError(e: unknown): string;
|
|
1228
1244
|
|
|
1229
|
-
export { AddMembersReport, AdmitChatEntry, AdmitChatOutcome, ApplyBatchResult, BATCH_PARTIAL_PREFIX, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DeviceId, DeviceLinkApproval, DeviceLinkPossession, DeviceReauthProof, DeviceRemovalReport, EphemeralWorkerError, ExpectedOwner, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, IdentityRotation, IncomingMessage, KeyPackageEntry, LinkingTicket, LogHead, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, NotPermittedError, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, RecoveryBackup, SENDER_MISMATCH_PREFIX, SenderMismatchError, SequencedEnvelope, Storage, SyncStepResult, Transport, UserId, ValidationError, WIRE_VERSION_MIN_ACCEPTED, describeTransportError, emulateSendBatch, isNotPermittedError, isSenderMismatchError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };
|
|
1245
|
+
export { AddMembersReport, AdmitChatEntry, AdmitChatOutcome, ApplyBatchResult, BATCH_PARTIAL_PREFIX, CONTENT_TYPE_CBOR, CONTENT_TYPE_CBOR_LEGACY_V1, CONTENT_TYPE_JSON, CONTENT_TYPE_JSON_LEGACY_V1, CatchupAppEvent, CatchupSnapshotView, type ClientConfig, CommitInDoubt, type Conversation, ConversationId, ConversationMeta, ConversationPolicy, DeviceId, DeviceLinkApproval, DeviceLinkPossession, DeviceReauthProof, DeviceRemovalReport, EphemeralWorkerError, ExpectedOwner, ExportedSecret, HPKE_PQ_ENC_BYTES, HPKE_PQ_PUBLIC_KEY_BYTES, HistoryBundle, IdentityRotation, IncomingMessage, KeyPackageEntry, LinkingTicket, LogHead, LogPosition, MemberInfo, MessageBatchMeta, MessageEnvelope, MessagingClient, MessagingClientClosedError, NOT_PERMITTED_PREFIX, NotPermittedError, PING_WIRE_CONTRACT_HEADER, PING_WIRE_CONTRACT_HEADER_VALUE, PING_WIRE_CONTRACT_VERSION, PendingApply, RecoveryBackup, SENDER_MISMATCH_PREFIX, SenderMismatchError, SequencedEnvelope, Storage, SyncStepResult, Transport, UserId, ValidationError, WIRE_VERSION_MIN_ACCEPTED, describeTransportError, emulateSendBatch, isNotPermittedError, isSenderMismatchError, negotiates, notPermittedRule, validate, verifyApplicationContentHash };
|
package/dist/index.js
CHANGED
|
@@ -2322,6 +2322,34 @@ var MessagingClient = class _MessagingClient {
|
|
|
2322
2322
|
length
|
|
2323
2323
|
});
|
|
2324
2324
|
}
|
|
2325
|
+
/**
|
|
2326
|
+
* {@link exportConversationSecret} together with the MLS epoch the secret was
|
|
2327
|
+
* exported at, from one read under one lock inside the core: the pair can
|
|
2328
|
+
* never disagree across a Commit.
|
|
2329
|
+
*
|
|
2330
|
+
* A host that files a key under an epoch number (a call's media key ring)
|
|
2331
|
+
* takes BOTH from this call. A conversation handle's `epoch` is this thread's
|
|
2332
|
+
* copy and any other read is a second request, so either may be a Commit away
|
|
2333
|
+
* from the secret.
|
|
2334
|
+
*
|
|
2335
|
+
* Same derivation, same arguments and the same refusals as
|
|
2336
|
+
* {@link exportConversationSecret}: at one epoch both answer the same bytes.
|
|
2337
|
+
* `secret` is a secret: never log it, persist it only encrypted, and call
|
|
2338
|
+
* `secret.fill(0)` after use. `epoch` is a plain number and may be logged.
|
|
2339
|
+
*/
|
|
2340
|
+
async exportConversationSecretWithEpoch(conv, label, context, length) {
|
|
2341
|
+
if (length <= 0 || length > 1024) {
|
|
2342
|
+
throw new Error("exportConversationSecretWithEpoch: length must be 1..=1024");
|
|
2343
|
+
}
|
|
2344
|
+
return await this.call({
|
|
2345
|
+
kind: "exportConversationSecretWithEpoch",
|
|
2346
|
+
id: this.nextId++,
|
|
2347
|
+
conv,
|
|
2348
|
+
label,
|
|
2349
|
+
context,
|
|
2350
|
+
length
|
|
2351
|
+
});
|
|
2352
|
+
}
|
|
2325
2353
|
/**
|
|
2326
2354
|
* Subscribe to decrypted application messages, one call per message. A
|
|
2327
2355
|
* batch or page result (the sequenced paths) is fanned out here per
|