@open-e2ee/signal-protocol-sdk 9.4.0 → 10.0.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/ADAPTERS.md +1 -0
- package/CHANGELOG.md +229 -0
- package/README.md +1 -1
- package/SECURITY.md +4 -4
- package/client/README.md +29 -12
- package/dist/client/client.d.ts +75 -63
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +207 -179
- package/dist/client/client.js.map +1 -1
- package/dist/client/config.d.ts +18 -3
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/constants.d.ts +2 -10
- package/dist/client/constants.d.ts.map +1 -1
- package/dist/client/constants.js +3 -12
- package/dist/client/constants.js.map +1 -1
- package/dist/client/content-adapter.d.ts +8 -0
- package/dist/client/content-adapter.d.ts.map +1 -1
- package/dist/client/content-adapter.js +4 -0
- package/dist/client/content-adapter.js.map +1 -1
- package/dist/client/delivery-status.d.ts +50 -0
- package/dist/client/delivery-status.d.ts.map +1 -0
- package/dist/client/delivery-status.js +121 -0
- package/dist/client/delivery-status.js.map +1 -0
- package/dist/client/event-hooks.d.ts +44 -10
- package/dist/client/event-hooks.d.ts.map +1 -1
- package/dist/client/event-hooks.js +26 -0
- package/dist/client/event-hooks.js.map +1 -1
- package/dist/client/hosted-anonymous-delivery.d.ts +2 -2
- package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
- package/dist/client/hosted-anonymous-delivery.js +7 -4
- package/dist/client/hosted-anonymous-delivery.js.map +1 -1
- package/dist/client/hosted-mailbox-subscription.d.ts +39 -6
- package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
- package/dist/client/hosted-mailbox-subscription.js +133 -26
- package/dist/client/hosted-mailbox-subscription.js.map +1 -1
- package/dist/client/hosted-push.d.ts +4 -3
- package/dist/client/hosted-push.d.ts.map +1 -1
- package/dist/client/hosted-push.js +18 -6
- package/dist/client/hosted-push.js.map +1 -1
- package/dist/client/hosted-transport.d.ts +26 -6
- package/dist/client/hosted-transport.d.ts.map +1 -1
- package/dist/client/hosted-transport.js +101 -14
- package/dist/client/hosted-transport.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/messages.d.ts +4 -2
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +32 -7
- package/dist/client/messages.js.map +1 -1
- package/dist/client/relay-acceptance.d.ts +8 -0
- package/dist/client/relay-acceptance.d.ts.map +1 -1
- package/dist/client/relay-acceptance.js +7 -0
- package/dist/client/relay-acceptance.js.map +1 -1
- package/dist/client/relay-receipt-intake.d.ts +70 -0
- package/dist/client/relay-receipt-intake.d.ts.map +1 -0
- package/dist/client/relay-receipt-intake.js +111 -0
- package/dist/client/relay-receipt-intake.js.map +1 -0
- package/dist/client/relay-receipt-join.d.ts +50 -0
- package/dist/client/relay-receipt-join.d.ts.map +1 -0
- package/dist/client/relay-receipt-join.js +106 -0
- package/dist/client/relay-receipt-join.js.map +1 -0
- package/dist/client/relay-subscription.d.ts +12 -0
- package/dist/client/relay-subscription.d.ts.map +1 -1
- package/dist/client/relay-subscription.js +246 -83
- package/dist/client/relay-subscription.js.map +1 -1
- package/dist/client/retry-family.d.ts +119 -0
- package/dist/client/retry-family.d.ts.map +1 -0
- package/dist/client/retry-family.js +170 -0
- package/dist/client/retry-family.js.map +1 -0
- package/dist/client/retry-request-envelope.d.ts +106 -0
- package/dist/client/retry-request-envelope.d.ts.map +1 -0
- package/dist/client/retry-request-envelope.js +245 -0
- package/dist/client/retry-request-envelope.js.map +1 -0
- package/dist/client/retry.d.ts +63 -22
- package/dist/client/retry.d.ts.map +1 -1
- package/dist/client/retry.js +234 -136
- package/dist/client/retry.js.map +1 -1
- package/dist/client/sealed-sender.d.ts +15 -3
- package/dist/client/sealed-sender.d.ts.map +1 -1
- package/dist/client/sealed-sender.js +22 -3
- package/dist/client/sealed-sender.js.map +1 -1
- package/dist/client/signal-service-cipher.d.ts +64 -1
- package/dist/client/signal-service-cipher.d.ts.map +1 -1
- package/dist/client/signal-service-cipher.js +212 -17
- package/dist/client/signal-service-cipher.js.map +1 -1
- package/dist/client/state.d.ts +7 -60
- package/dist/client/state.d.ts.map +1 -1
- package/dist/client/state.js +8 -86
- package/dist/client/state.js.map +1 -1
- package/dist/client/types.d.ts +11 -3
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/types.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/protocol/sealed-sender/types.d.ts +1 -1
- package/dist/internal/protocol/sealed-sender/types.js +1 -1
- package/dist/local/store/received-content.d.ts +16 -2
- package/dist/local/store/received-content.d.ts.map +1 -1
- package/dist/local/store/received-content.js +18 -3
- package/dist/local/store/received-content.js.map +1 -1
- package/dist/local/store/reliability.d.ts +291 -2
- package/dist/local/store/reliability.d.ts.map +1 -1
- package/dist/local/store/reliability.js +451 -13
- package/dist/local/store/reliability.js.map +1 -1
- package/dist/remote/relay/index.d.ts +1 -1
- package/dist/remote/relay/index.d.ts.map +1 -1
- package/dist/remote/relay/index.js.map +1 -1
- package/dist/remote/relay/types.d.ts +34 -30
- package/dist/remote/relay/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +43 -22
- package/dist/types/api.d.ts.map +1 -1
- package/docs/ASSURANCE.md +5 -5
- package/docs/DEVIATIONS.md +4 -5
- package/docs/INTERFACES.md +2 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import type { SealedSenderConfig, SealedSenderDeliveryMode } from './config.js';
|
|
|
10
10
|
import type { Envelope, SealedSenderAuth } from '../remote/relay/types.js';
|
|
11
11
|
import { type Logger } from '../logger.js';
|
|
12
12
|
import type { SignalProtocolLocalStore } from '../types/index.js';
|
|
13
|
+
import { ContentHint } from '../types/messages.js';
|
|
13
14
|
import type { EndorsementManager } from './endorsement-manager.js';
|
|
14
15
|
import { type ContactProfileStateStore } from '../profile/contact-state.js';
|
|
15
16
|
import { SealedSenderContentType } from '../internal/protocol/sealed-sender/types.js';
|
|
@@ -42,7 +43,7 @@ export interface SealedSenderResolutionContext {
|
|
|
42
43
|
export declare function serializeDirectSealedSenderMessage(msg: {
|
|
43
44
|
recipientUserId: string;
|
|
44
45
|
recipientDeviceId: number;
|
|
45
|
-
}, ciphertextBase64: string, messageType: 'prekey_bundle' | 'ciphertext' | 'sender_key', recipientRegistrationId: number | undefined, sealedSender: ResolvedSealedSenderContext): Promise<string>;
|
|
46
|
+
}, ciphertextBase64: string, messageType: 'prekey_bundle' | 'ciphertext' | 'sender_key', recipientRegistrationId: number | undefined, sealedSender: ResolvedSealedSenderContext, contentHint: ContentHint | undefined): Promise<string>;
|
|
46
47
|
export declare function resolveSealedSenderContext(context: SealedSenderResolutionContext, recipientUserId: string, groupId?: string): Promise<ResolvedSealedSenderContext | null>;
|
|
47
48
|
/**
|
|
48
49
|
* Unseal a sealed sender message to reveal the sender and inner ciphertext.
|
|
@@ -57,19 +58,21 @@ export declare function resolveSealedSenderContext(context: SealedSenderResoluti
|
|
|
57
58
|
* @param recipientDeviceId - Recipient's device ID
|
|
58
59
|
* @param config - Sealed sender config with trust roots
|
|
59
60
|
* @param relayEnqueueTime - Immutable time when Relay accepted the message
|
|
60
|
-
* @returns Unsealed envelope info with sender identity and
|
|
61
|
+
* @returns Unsealed envelope info with sender identity, inner ciphertext and content hint
|
|
61
62
|
*/
|
|
62
63
|
export declare function unsealMessage(sealedCiphertextBase64: string, recipientIdentityPrivate: Uint8Array, recipientUuid: string, recipientDeviceId: number, config: SealedSenderConfig, relayEnqueueTime: number | undefined, providedLogger?: Logger): Promise<{
|
|
63
64
|
senderUserId: string;
|
|
64
65
|
senderDeviceId: number;
|
|
65
66
|
innerCiphertextBase64: string;
|
|
66
67
|
contentType: SealedSenderContentType;
|
|
68
|
+
contentHint: ContentHint;
|
|
67
69
|
}>;
|
|
68
70
|
/**
|
|
69
71
|
* Reconstruct an Envelope from an unsealed message.
|
|
70
72
|
*
|
|
71
73
|
* Takes the original sealed sender envelope (with empty sender fields)
|
|
72
|
-
* and fills in the sender identity revealed by unsealing.
|
|
74
|
+
* and fills in the sender identity revealed by unsealing. The content hint
|
|
75
|
+
* also travels inside the seal, so the unsealed envelope carries it.
|
|
73
76
|
*
|
|
74
77
|
* @param originalEnvelope - The incoming envelope with messageType 'unidentified_sender'
|
|
75
78
|
* @param unsealed - The unsealed sender info and inner ciphertext
|
|
@@ -80,7 +83,16 @@ export declare function reconstructEnvelope(originalEnvelope: Envelope, unsealed
|
|
|
80
83
|
senderDeviceId: number;
|
|
81
84
|
innerCiphertextBase64: string;
|
|
82
85
|
contentType: SealedSenderContentType;
|
|
86
|
+
contentHint: ContentHint;
|
|
83
87
|
}): Envelope;
|
|
88
|
+
/**
|
|
89
|
+
* Attach the unsealed envelope to an error that its decryption threw. The
|
|
90
|
+
* error handler then asks the unsealed sender device for a resend, because
|
|
91
|
+
* the sealed envelope names no sender.
|
|
92
|
+
*/
|
|
93
|
+
export declare function attachUnsealedEnvelope(error: unknown, envelope: Envelope): void;
|
|
94
|
+
/** The unsealed envelope that `attachUnsealedEnvelope` attached to an error. */
|
|
95
|
+
export declare function unsealedEnvelopeOf(error: unknown): Envelope | undefined;
|
|
84
96
|
/**
|
|
85
97
|
* Map a sealed envelope's content type onto the envelope type the decrypt
|
|
86
98
|
* path routes on.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed-sender.d.ts","sourceRoot":"","sources":["../../client/sealed-sender.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,KAA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,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC,CA+BD;AAiFD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,QAAQ,EAC1B,QAAQ,EAAE;IACR,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,uBAAuB,CAAC;IACrC,WAAW,EAAE,WAAW,CAAC;CAC1B,GACA,QAAQ,CASV;AAID;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAE/E;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAEvE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,uBAAuB,GACnC,QAAQ,CAAC,aAAa,CAAC,CAUzB"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @see https://signal.org/blog/sealed-sender/
|
|
8
8
|
*/
|
|
9
9
|
import { resolveSignalProtocolLogger } from '../logger.js';
|
|
10
|
+
import { ContentHint } from '../types/messages.js';
|
|
10
11
|
import { ProtocolAddress } from '../types/address.js';
|
|
11
12
|
import { x25519 } from '@noble/curves/ed25519.js';
|
|
12
13
|
import { base64ToBytes, bytesToBase64 } from '../internal/crypto/index.js';
|
|
@@ -16,7 +17,7 @@ import { deserializeSenderCertificate, sealMultiRecipient } from '../internal/pr
|
|
|
16
17
|
import { deriveAccessKey } from '../internal/protocol/sealed-sender/delivery-token.js';
|
|
17
18
|
import { unseal } from '../internal/protocol/sealed-sender/decryption.js';
|
|
18
19
|
import { deserializeReceivedMessage, serializeSentMessage, } from '../internal/protocol/sealed-sender/multi-recipient-message.js';
|
|
19
|
-
export async function serializeDirectSealedSenderMessage(msg, ciphertextBase64, messageType, recipientRegistrationId, sealedSender) {
|
|
20
|
+
export async function serializeDirectSealedSenderMessage(msg, ciphertextBase64, messageType, recipientRegistrationId, sealedSender, contentHint) {
|
|
20
21
|
const senderCertificate = deserializeSenderCertificate(base64ToBytes(sealedSender.senderCertificateBase64));
|
|
21
22
|
const sealed = await sealMultiRecipient({
|
|
22
23
|
senderCertificate,
|
|
@@ -31,6 +32,7 @@ export async function serializeDirectSealedSenderMessage(msg, ciphertextBase64,
|
|
|
31
32
|
},
|
|
32
33
|
],
|
|
33
34
|
signalProtocolMessage: base64ToBytes(ciphertextBase64),
|
|
35
|
+
contentHint,
|
|
34
36
|
contentType: messageType === 'sender_key'
|
|
35
37
|
? SealedSenderContentType.SENDERKEY_MESSAGE
|
|
36
38
|
: messageType === 'prekey_bundle'
|
|
@@ -164,7 +166,7 @@ export async function resolveSealedSenderContext(context, recipientUserId, group
|
|
|
164
166
|
* @param recipientDeviceId - Recipient's device ID
|
|
165
167
|
* @param config - Sealed sender config with trust roots
|
|
166
168
|
* @param relayEnqueueTime - Immutable time when Relay accepted the message
|
|
167
|
-
* @returns Unsealed envelope info with sender identity and
|
|
169
|
+
* @returns Unsealed envelope info with sender identity, inner ciphertext and content hint
|
|
168
170
|
*/
|
|
169
171
|
export async function unsealMessage(sealedCiphertextBase64, recipientIdentityPrivate, recipientUuid, recipientDeviceId, config, relayEnqueueTime, providedLogger) {
|
|
170
172
|
if (typeof relayEnqueueTime !== 'number' ||
|
|
@@ -237,13 +239,15 @@ async function unsealReceivedMessage(sealedBytes, recipientIdentityPrivate, reci
|
|
|
237
239
|
senderDeviceId: content.senderCertificate.senderDeviceId,
|
|
238
240
|
innerCiphertextBase64: content.signalProtocolMessage,
|
|
239
241
|
contentType: content.contentType,
|
|
242
|
+
contentHint: content.contentHint ?? ContentHint.Default,
|
|
240
243
|
};
|
|
241
244
|
}
|
|
242
245
|
/**
|
|
243
246
|
* Reconstruct an Envelope from an unsealed message.
|
|
244
247
|
*
|
|
245
248
|
* Takes the original sealed sender envelope (with empty sender fields)
|
|
246
|
-
* and fills in the sender identity revealed by unsealing.
|
|
249
|
+
* and fills in the sender identity revealed by unsealing. The content hint
|
|
250
|
+
* also travels inside the seal, so the unsealed envelope carries it.
|
|
247
251
|
*
|
|
248
252
|
* @param originalEnvelope - The incoming envelope with messageType 'unidentified_sender'
|
|
249
253
|
* @param unsealed - The unsealed sender info and inner ciphertext
|
|
@@ -256,8 +260,23 @@ export function reconstructEnvelope(originalEnvelope, unsealed) {
|
|
|
256
260
|
senderDeviceId: unsealed.senderDeviceId,
|
|
257
261
|
ciphertext: unsealed.innerCiphertextBase64,
|
|
258
262
|
messageType: envelopeTypeForContent(unsealed.contentType),
|
|
263
|
+
contentHint: unsealed.contentHint,
|
|
259
264
|
};
|
|
260
265
|
}
|
|
266
|
+
const unsealedEnvelopes = new WeakMap();
|
|
267
|
+
/**
|
|
268
|
+
* Attach the unsealed envelope to an error that its decryption threw. The
|
|
269
|
+
* error handler then asks the unsealed sender device for a resend, because
|
|
270
|
+
* the sealed envelope names no sender.
|
|
271
|
+
*/
|
|
272
|
+
export function attachUnsealedEnvelope(error, envelope) {
|
|
273
|
+
if (typeof error === 'object' && error !== null)
|
|
274
|
+
unsealedEnvelopes.set(error, envelope);
|
|
275
|
+
}
|
|
276
|
+
/** The unsealed envelope that `attachUnsealedEnvelope` attached to an error. */
|
|
277
|
+
export function unsealedEnvelopeOf(error) {
|
|
278
|
+
return typeof error === 'object' && error !== null ? unsealedEnvelopes.get(error) : undefined;
|
|
279
|
+
}
|
|
261
280
|
/**
|
|
262
281
|
* Map a sealed envelope's content type onto the envelope type the decrypt
|
|
263
282
|
* path routes on.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealed-sender.js","sourceRoot":"","sources":["../../client/sealed-sender.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,2BAA2B,EAAe,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM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,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChG,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,sBAAsB,CACpC,WAAoC;IAEpC,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,uBAAuB,CAAC,iBAAiB;YAC5C,OAAO,YAAY,CAAC;QACtB,KAAK,uBAAuB,CAAC,cAAc,CAAC;QAC5C,KAAK,uBAAuB,CAAC,OAAO;YAClC,OAAO,YAAY,CAAC;QACtB;YACE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -21,8 +21,10 @@ import { type Logger } from '../logger.js';
|
|
|
21
21
|
import { SenderKeyManager } from '../internal/protocol/sender-keys/index.js';
|
|
22
22
|
import type { EndorsementManager } from './endorsement-manager.js';
|
|
23
23
|
import type { GroupReceiveAuthorizer } from './group-receive-authorization.js';
|
|
24
|
-
import type { PreparedAttachmentUpload, SendOptions, SendResult } from './types.js';
|
|
24
|
+
import type { PreparedAttachmentUpload, SealedReceipt, SendOptions, SendResult } from './types.js';
|
|
25
|
+
import { ContentHint } from '../types/messages.js';
|
|
25
26
|
import { type BlockedRecipientsSyncInput, type ConfigurationSyncInput, type MediaAttachmentDeleteSyncInput, type ReadSyncEntryInput, type RecipientUsernameSyncInput, type SignalProtocolContentAdapter, type TaskNotificationAckSyncInput, type UsernameStateSyncInput, type VerificationStateSyncInput, type ViewOnceOpenSyncInput } from './content-adapter.js';
|
|
27
|
+
import { type RetryResendTarget } from '../local/store/reliability.js';
|
|
26
28
|
import { type BoundedFanOut } from '../utils/bounded-fan-out.js';
|
|
27
29
|
import { type SealedSenderProvider as SealedSenderProviderContract } from './sealed-sender.js';
|
|
28
30
|
import { type ContactProfileStateStore } from '../profile/contact-state.js';
|
|
@@ -256,6 +258,56 @@ export declare class SignalProtocolServiceCipher {
|
|
|
256
258
|
* @see https://signal.org/docs/specifications/sesame/
|
|
257
259
|
*/
|
|
258
260
|
encrypt(recipientId: string, content: Uint8Array, options?: SendOptions, sessions?: SendSessionCallbacks | undefined, stopSignal?: AbortSignal): Promise<SendResult>;
|
|
261
|
+
/**
|
|
262
|
+
* Encrypt content for one device of a user and post it to that device only.
|
|
263
|
+
* The send makes no outbox intent and no sent-sync transcript. A retry
|
|
264
|
+
* resend uses it: the retry request is the durable job, and only the device
|
|
265
|
+
* that asked gets the message again. The post uses the sealed-sender
|
|
266
|
+
* context of a direct send to the user.
|
|
267
|
+
*
|
|
268
|
+
* With a retry target, the resend stores its encryption under the device
|
|
269
|
+
* and the failed envelope ID. The resend carries the attempt number of
|
|
270
|
+
* the request that it answers, from the request envelope ID. Its client
|
|
271
|
+
* message ID is `<retryId>:resend` or `<retryId>:null`, with
|
|
272
|
+
* `:<attempt>` from attempt 2. A call for the request envelope and the
|
|
273
|
+
* kind of the stored record posts the stored bytes with their epoch
|
|
274
|
+
* again, and does not encrypt: that is the sender's own retry of a post
|
|
275
|
+
* that did not complete. A call for another request envelope or kind
|
|
276
|
+
* encrypts with a fresh epoch, replaces the record in one write, and
|
|
277
|
+
* posts it. So does a call whose stored bytes the Relay refuses with
|
|
278
|
+
* OPERATION_EXPIRED: the new bytes post under the same ID. A
|
|
279
|
+
* RETRY_CONFLICT answer to a post means that the Relay holds an earlier
|
|
280
|
+
* encryption under this ID, so the answer is complete. When the Relay
|
|
281
|
+
* admits the new bytes after the recipient acknowledged the earlier
|
|
282
|
+
* ones, the recipient drops them as processed. Nothing deletes the
|
|
283
|
+
* record before `RELIABILITY_RECORD_TTL_MS`.
|
|
284
|
+
*
|
|
285
|
+
* @param recipientUserId - The user of the device
|
|
286
|
+
* @param recipientDeviceId - The device that gets the message
|
|
287
|
+
* @param content - The plaintext to encrypt. Null when the plaintext is
|
|
288
|
+
* gone: then only a stored attempt can post
|
|
289
|
+
* @param options - The client timestamp and the content hint of the
|
|
290
|
+
* message, and the retry request that a retry resend answers. Without a
|
|
291
|
+
* retry target, the client message ID is a new UUID and nothing is
|
|
292
|
+
* stored. The timestamp goes in the envelope
|
|
293
|
+
* @param stopSignal - The stop signal of the relay work that sends. When it
|
|
294
|
+
* aborts while the send waits for the recipient's lock, the send throws
|
|
295
|
+
* RelayWorkStopped
|
|
296
|
+
* @returns False only when the content is null and no stored attempt can
|
|
297
|
+
* post: there is none for this request attempt, or the Relay refused it
|
|
298
|
+
* with OPERATION_EXPIRED
|
|
299
|
+
* @throws Error when the request envelope ID is not a retry request of
|
|
300
|
+
* the retry ID. Nothing is posted
|
|
301
|
+
*/
|
|
302
|
+
resendToDevice(recipientUserId: string, recipientDeviceId: number, content: string | null, options: {
|
|
303
|
+
timestamp: number;
|
|
304
|
+
contentHint?: ContentHint;
|
|
305
|
+
retry?: RetryResendTarget;
|
|
306
|
+
}, stopSignal?: AbortSignal): Promise<boolean>;
|
|
307
|
+
/** Post the encrypted bytes of a resend with their operation epoch, under one client message ID. */
|
|
308
|
+
private postResend;
|
|
309
|
+
/** Encrypt one attempt of a resend, with the current time as its operation epoch. */
|
|
310
|
+
private encryptResend;
|
|
259
311
|
/**
|
|
260
312
|
* Encrypt and upload attachment data without sending a standalone message.
|
|
261
313
|
*/
|
|
@@ -407,6 +459,17 @@ export declare class SignalProtocolServiceCipher {
|
|
|
407
459
|
*
|
|
408
460
|
*/
|
|
409
461
|
private resolveSealedSenderContext;
|
|
462
|
+
/**
|
|
463
|
+
* Seal an encrypted delivery receipt for anonymous delivery. A receipt
|
|
464
|
+
* follows the sealed sender delivery mode of a message. Resolves to
|
|
465
|
+
* undefined when the receipt goes identified: sealed sender is disabled,
|
|
466
|
+
* or it is preferred and the relay has no anonymous delivery or this
|
|
467
|
+
* client knows no access key of the recipient. In `'required'` mode a
|
|
468
|
+
* receipt that cannot be sealed throws `SEALED_SENDER_REQUIRED`, and the
|
|
469
|
+
* sealed receipt permits no identified fallback. A receipt never uses a
|
|
470
|
+
* group send endorsement.
|
|
471
|
+
*/
|
|
472
|
+
sealReceipt(recipientUserId: string, recipientDeviceId: number, ciphertextBase64: string): Promise<SealedReceipt | undefined>;
|
|
410
473
|
/**
|
|
411
474
|
* Send a single ciphertext to a device, optionally wrapping with sealed sender.
|
|
412
475
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signal-service-cipher.d.ts","sourceRoot":"","sources":["../../client/signal-service-cipher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,yBAAyB,EACzB,QAAQ,EAGR,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAA2B,MAAM,UAAU,CAAC;AAIlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAwB,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"signal-service-cipher.d.ts","sourceRoot":"","sources":["../../client/signal-service-cipher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,yBAAyB,EACzB,QAAQ,EAGR,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAA2B,MAAM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