@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.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-B1GFwNXa.cjs';
2
- export { u as AddMemberStatus, v as AddMemberVerdict, B as BufferOverflow, w as Bytes, x as CatchupSnapshotEntry, y as ConversationRemoval, z as ConversationUpdate, F as DeviceInfo, G as DeviceRemovalFailure, D as DiscoveredDevice, J as HistoryAppEvent, N as Hlc, O as IdentityRotationFailure, Q as LogGap, V as MessageKind, W as OverflowReason, X as SenderRole, Y as StrandReason, Z as StrandedConversation, _ as WelcomeFailure, $ as WelcomeFailureReason } from './types-B1GFwNXa.cjs';
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-B1GFwNXa.js';
2
- export { u as AddMemberStatus, v as AddMemberVerdict, B as BufferOverflow, w as Bytes, x as CatchupSnapshotEntry, y as ConversationRemoval, z as ConversationUpdate, F as DeviceInfo, G as DeviceRemovalFailure, D as DiscoveredDevice, J as HistoryAppEvent, N as Hlc, O as IdentityRotationFailure, Q as LogGap, V as MessageKind, W as OverflowReason, X as SenderRole, Y as StrandReason, Z as StrandedConversation, _ as WelcomeFailure, $ as WelcomeFailureReason } from './types-B1GFwNXa.js';
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