@signalapp/libsignal-client 0.82.1 → 0.84.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/Native.d.ts +12 -7
- package/dist/EcKeys.js +1 -1
- package/dist/MessageBackup.d.ts +36 -1
- package/dist/MessageBackup.js +41 -0
- package/dist/index.d.ts +3 -7
- package/dist/index.js +6 -11
- package/dist/net.d.ts +35 -0
- package/dist/net.js +18 -21
- package/package.json +2 -1
- package/prebuilds/darwin-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/darwin-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/linux-x64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-arm64/@signalapp+libsignal-client.node +0 -0
- package/prebuilds/win32-x64/@signalapp+libsignal-client.node +0 -0
package/Native.d.ts
CHANGED
|
@@ -229,6 +229,10 @@ export function BackupAuthCredential_GetBackupId(credentialBytes: Uint8Array): U
|
|
|
229
229
|
export function BackupAuthCredential_GetBackupLevel(credentialBytes: Uint8Array): number;
|
|
230
230
|
export function BackupAuthCredential_GetType(credentialBytes: Uint8Array): number;
|
|
231
231
|
export function BackupAuthCredential_PresentDeterministic(credentialBytes: Uint8Array, serverParamsBytes: Uint8Array, randomness: Uint8Array): Uint8Array;
|
|
232
|
+
export function BackupJsonExporter_ExportFrames(exporter: Wrapper<BackupJsonExporter>, frames: Uint8Array): string;
|
|
233
|
+
export function BackupJsonExporter_Finish(exporter: Wrapper<BackupJsonExporter>): string;
|
|
234
|
+
export function BackupJsonExporter_GetInitialChunk(exporter: Wrapper<BackupJsonExporter>): string;
|
|
235
|
+
export function BackupJsonExporter_New(backupInfo: Uint8Array, shouldValidate: boolean): BackupJsonExporter;
|
|
232
236
|
export function BackupKey_DeriveBackupId(backupKey: Uint8Array, aci: Uint8Array): Uint8Array;
|
|
233
237
|
export function BackupKey_DeriveEcKey(backupKey: Uint8Array, aci: Uint8Array): PrivateKey;
|
|
234
238
|
export function BackupKey_DeriveLocalBackupMetadataKey(backupKey: Uint8Array): Uint8Array;
|
|
@@ -270,13 +274,13 @@ export function ComparableBackup_GetComparableString(backup: Wrapper<ComparableB
|
|
|
270
274
|
export function ComparableBackup_GetUnknownFields(backup: Wrapper<ComparableBackup>): string[];
|
|
271
275
|
export function ComparableBackup_ReadUnencrypted(stream: InputStream, len: bigint, purpose: number): Promise<ComparableBackup>;
|
|
272
276
|
export function ConnectionManager_clear_proxy(connectionManager: Wrapper<ConnectionManager>): void;
|
|
273
|
-
export function ConnectionManager_new(environment: number, userAgent: string, remoteConfig: Wrapper<BridgedStringMap
|
|
277
|
+
export function ConnectionManager_new(environment: number, userAgent: string, remoteConfig: Wrapper<BridgedStringMap>, buildVariant: number): ConnectionManager;
|
|
274
278
|
export function ConnectionManager_on_network_change(connectionManager: Wrapper<ConnectionManager>): void;
|
|
275
279
|
export function ConnectionManager_set_censorship_circumvention_enabled(connectionManager: Wrapper<ConnectionManager>, enabled: boolean): void;
|
|
276
280
|
export function ConnectionManager_set_invalid_proxy(connectionManager: Wrapper<ConnectionManager>): void;
|
|
277
281
|
export function ConnectionManager_set_ipv6_enabled(connectionManager: Wrapper<ConnectionManager>, ipv6Enabled: boolean): void;
|
|
278
282
|
export function ConnectionManager_set_proxy(connectionManager: Wrapper<ConnectionManager>, proxy: Wrapper<ConnectionProxyConfig>): void;
|
|
279
|
-
export function ConnectionManager_set_remote_config(connectionManager: Wrapper<ConnectionManager>, remoteConfig: Wrapper<BridgedStringMap
|
|
283
|
+
export function ConnectionManager_set_remote_config(connectionManager: Wrapper<ConnectionManager>, remoteConfig: Wrapper<BridgedStringMap>, buildVariant: number): void;
|
|
280
284
|
export function ConnectionProxyConfig_new(scheme: string, host: string, port: number, username: string | null, password: string | null): ConnectionProxyConfig;
|
|
281
285
|
export function CreateCallLinkCredentialPresentation_CheckValidContents(presentationBytes: Uint8Array): void;
|
|
282
286
|
export function CreateCallLinkCredentialPresentation_Verify(presentationBytes: Uint8Array, roomId: Uint8Array, now: Timestamp, serverParamsBytes: Uint8Array, callLinkParamsBytes: Uint8Array): void;
|
|
@@ -347,7 +351,7 @@ export function HsmEnclaveClient_InitialRequest(obj: Wrapper<HsmEnclaveClient>):
|
|
|
347
351
|
export function HsmEnclaveClient_New(trustedPublicKey: Uint8Array, trustedCodeHashes: Uint8Array): HsmEnclaveClient;
|
|
348
352
|
export function HttpRequest_add_header(request: Wrapper<HttpRequest>, name: string, value: string): void;
|
|
349
353
|
export function HttpRequest_new(method: string, path: string, bodyAsSlice: Uint8Array | null): HttpRequest;
|
|
350
|
-
export function IdentityKeyPair_Deserialize(
|
|
354
|
+
export function IdentityKeyPair_Deserialize(input: Uint8Array): [PublicKey, PrivateKey];
|
|
351
355
|
export function IdentityKeyPair_Serialize(publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>): Uint8Array;
|
|
352
356
|
export function IdentityKeyPair_SignAlternateIdentity(publicKey: Wrapper<PublicKey>, privateKey: Wrapper<PrivateKey>, otherIdentity: Wrapper<PublicKey>): Uint8Array;
|
|
353
357
|
export function IdentityKey_VerifyAlternateIdentity(publicKey: Wrapper<PublicKey>, otherIdentity: Wrapper<PublicKey>, signature: Uint8Array): boolean;
|
|
@@ -503,7 +507,7 @@ export function SealedSenderDecryptionResult_GetSenderE164(obj: Wrapper<SealedSe
|
|
|
503
507
|
export function SealedSenderDecryptionResult_GetSenderUuid(obj: Wrapper<SealedSenderDecryptionResult>): string;
|
|
504
508
|
export function SealedSenderDecryptionResult_Message(obj: Wrapper<SealedSenderDecryptionResult>): Uint8Array;
|
|
505
509
|
export function SealedSenderMultiRecipientMessage_Parse(buffer: Uint8Array): SealedSenderMultiRecipientMessage;
|
|
506
|
-
export function SealedSender_DecryptMessage(message: Uint8Array, trustRoot: Wrapper<PublicKey>, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore
|
|
510
|
+
export function SealedSender_DecryptMessage(message: Uint8Array, trustRoot: Wrapper<PublicKey>, timestamp: Timestamp, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<SealedSenderDecryptionResult>;
|
|
507
511
|
export function SealedSender_DecryptToUsmc(ctext: Uint8Array, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>;
|
|
508
512
|
export function SealedSender_Encrypt(destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
509
513
|
export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], excludedRecipients: Uint8Array, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
@@ -579,8 +583,8 @@ export function ServiceId_ParseFromServiceIdString(input: string): Uint8Array;
|
|
|
579
583
|
export function ServiceId_ServiceIdBinary(value: Uint8Array): Uint8Array;
|
|
580
584
|
export function ServiceId_ServiceIdLog(value: Uint8Array): string;
|
|
581
585
|
export function ServiceId_ServiceIdString(value: Uint8Array): string;
|
|
582
|
-
export function SessionBuilder_ProcessPreKeyBundle(bundle: Wrapper<PreKeyBundle>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp
|
|
583
|
-
export function SessionCipher_DecryptPreKeySignalMessage(message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore
|
|
586
|
+
export function SessionBuilder_ProcessPreKeyBundle(bundle: Wrapper<PreKeyBundle>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp): Promise<void>;
|
|
587
|
+
export function SessionCipher_DecryptPreKeySignalMessage(message: Wrapper<PreKeySignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<Uint8Array>;
|
|
584
588
|
export function SessionCipher_DecryptSignalMessage(message: Wrapper<SignalMessage>, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
585
589
|
export function SessionCipher_EncryptMessage(ptext: Uint8Array, protocolAddress: Wrapper<ProtocolAddress>, sessionStore: SessionStore, identityKeyStore: IdentityKeyStore, now: Timestamp): Promise<CiphertextMessage>;
|
|
586
590
|
export function SessionRecord_ArchiveCurrentState(sessionRecord: Wrapper<SessionRecord>): void;
|
|
@@ -685,6 +689,7 @@ export function TESTING_RegistrationService_ResumeSessionErrorConvert(errorDescr
|
|
|
685
689
|
export function TESTING_RegistrationService_SubmitVerificationErrorConvert(errorDescription: string): void;
|
|
686
690
|
export function TESTING_RegistrationService_UpdateSessionErrorConvert(errorDescription: string): void;
|
|
687
691
|
export function TESTING_RegistrationSessionInfoConvert(): RegistrationSession;
|
|
692
|
+
export function TESTING_ReturnPair(): [number, string];
|
|
688
693
|
export function TESTING_ReturnStringArray(): string[];
|
|
689
694
|
export function TESTING_RoundTripI32(input: number): number;
|
|
690
695
|
export function TESTING_RoundTripU16(input: number): number;
|
|
@@ -733,6 +738,7 @@ export function initLogger(maxLevel: LogLevel, callback: (level: LogLevel, targe
|
|
|
733
738
|
export function test_only_fn_returns_123(): number;
|
|
734
739
|
interface Aes256GcmSiv { readonly __type: unique symbol; }
|
|
735
740
|
interface AuthenticatedChatConnection { readonly __type: unique symbol; }
|
|
741
|
+
interface BackupJsonExporter { readonly __type: unique symbol; }
|
|
736
742
|
interface BackupRestoreResponse { readonly __type: unique symbol; }
|
|
737
743
|
interface BackupStoreResponse { readonly __type: unique symbol; }
|
|
738
744
|
interface BridgedStringMap { readonly __type: unique symbol; }
|
|
@@ -740,7 +746,6 @@ interface CdsiLookup { readonly __type: unique symbol; }
|
|
|
740
746
|
interface ChatConnectionInfo { readonly __type: unique symbol; }
|
|
741
747
|
interface CiphertextMessage { readonly __type: unique symbol; }
|
|
742
748
|
interface ComparableBackup { readonly __type: unique symbol; }
|
|
743
|
-
interface ComparableBackup { readonly __type: unique symbol; }
|
|
744
749
|
interface ConnectionManager { readonly __type: unique symbol; }
|
|
745
750
|
interface ConnectionProxyConfig { readonly __type: unique symbol; }
|
|
746
751
|
interface DecryptionErrorMessage { readonly __type: unique symbol; }
|
package/dist/EcKeys.js
CHANGED
|
@@ -93,7 +93,7 @@ export class IdentityKeyPair {
|
|
|
93
93
|
return new IdentityKeyPair(privateKey.getPublicKey(), privateKey);
|
|
94
94
|
}
|
|
95
95
|
static deserialize(buffer) {
|
|
96
|
-
const
|
|
96
|
+
const [publicKey, privateKey] = Native.IdentityKeyPair_Deserialize(buffer);
|
|
97
97
|
return new IdentityKeyPair(PublicKey._fromNativeHandle(publicKey), PrivateKey._fromNativeHandle(privateKey));
|
|
98
98
|
}
|
|
99
99
|
serialize() {
|
package/dist/MessageBackup.d.ts
CHANGED
|
@@ -62,7 +62,8 @@ export declare class MessageBackupKey {
|
|
|
62
62
|
}
|
|
63
63
|
export declare enum Purpose {
|
|
64
64
|
DeviceTransfer = 0,
|
|
65
|
-
RemoteBackup = 1
|
|
65
|
+
RemoteBackup = 1,
|
|
66
|
+
TakeoutExport = 2
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
68
69
|
* Validate a backup file
|
|
@@ -170,3 +171,37 @@ export declare class ComparableBackup {
|
|
|
170
171
|
*/
|
|
171
172
|
get unknownFields(): Array<string>;
|
|
172
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Streaming exporter that produces a human-readable JSON representation of a backup.
|
|
176
|
+
*/
|
|
177
|
+
export declare class BackupJsonExporter {
|
|
178
|
+
readonly _nativeHandle: Native.BackupJsonExporter;
|
|
179
|
+
private constructor();
|
|
180
|
+
/**
|
|
181
|
+
* Initializes the streaming exporter and returns the first chunk of output.
|
|
182
|
+
* @param backupInfo The serialized BackupInfo protobuf without a varint header.
|
|
183
|
+
* @param [options] Additional configuration for the exporter.
|
|
184
|
+
* @param [options.validate=true] Whether to run semantic validation on the backup.
|
|
185
|
+
* @returns An object containing the exporter and the first chunk of output, containing the backup info.
|
|
186
|
+
* @throws Error if the input is invalid.
|
|
187
|
+
*/
|
|
188
|
+
static start(backupInfo: Uint8Array, options?: {
|
|
189
|
+
validate?: boolean;
|
|
190
|
+
}): {
|
|
191
|
+
exporter: BackupJsonExporter;
|
|
192
|
+
chunk: string;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Validates and exports a human-readable JSON representation of backup frames.
|
|
196
|
+
* @param frames One or more varint delimited Frame serialized protobuf messages.
|
|
197
|
+
* @returns A string containing the exported frames.
|
|
198
|
+
* @throws Error if the input is invalid.
|
|
199
|
+
*/
|
|
200
|
+
exportFrames(frames: Uint8Array): string;
|
|
201
|
+
/**
|
|
202
|
+
* Completes the validation and export of the previously exported frames.
|
|
203
|
+
* @returns A string containing the final chunk of the output.
|
|
204
|
+
* @throws Error if some previous input fails validation at the final stage.
|
|
205
|
+
*/
|
|
206
|
+
finish(): string;
|
|
207
|
+
}
|
package/dist/MessageBackup.js
CHANGED
|
@@ -70,6 +70,7 @@ export var Purpose;
|
|
|
70
70
|
(function (Purpose) {
|
|
71
71
|
Purpose[Purpose["DeviceTransfer"] = 0] = "DeviceTransfer";
|
|
72
72
|
Purpose[Purpose["RemoteBackup"] = 1] = "RemoteBackup";
|
|
73
|
+
Purpose[Purpose["TakeoutExport"] = 2] = "TakeoutExport";
|
|
73
74
|
})(Purpose || (Purpose = {}));
|
|
74
75
|
/**
|
|
75
76
|
* Validate a backup file
|
|
@@ -202,4 +203,44 @@ export class ComparableBackup {
|
|
|
202
203
|
return Native.ComparableBackup_GetUnknownFields(this);
|
|
203
204
|
}
|
|
204
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Streaming exporter that produces a human-readable JSON representation of a backup.
|
|
208
|
+
*/
|
|
209
|
+
export class BackupJsonExporter {
|
|
210
|
+
constructor(handle) {
|
|
211
|
+
this._nativeHandle = handle;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Initializes the streaming exporter and returns the first chunk of output.
|
|
215
|
+
* @param backupInfo The serialized BackupInfo protobuf without a varint header.
|
|
216
|
+
* @param [options] Additional configuration for the exporter.
|
|
217
|
+
* @param [options.validate=true] Whether to run semantic validation on the backup.
|
|
218
|
+
* @returns An object containing the exporter and the first chunk of output, containing the backup info.
|
|
219
|
+
* @throws Error if the input is invalid.
|
|
220
|
+
*/
|
|
221
|
+
static start(backupInfo, options) {
|
|
222
|
+
const shouldValidate = options?.validate ?? true;
|
|
223
|
+
const handle = Native.BackupJsonExporter_New(backupInfo, shouldValidate);
|
|
224
|
+
const exporter = new BackupJsonExporter(handle);
|
|
225
|
+
const chunk = Native.BackupJsonExporter_GetInitialChunk(exporter);
|
|
226
|
+
return { exporter, chunk };
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Validates and exports a human-readable JSON representation of backup frames.
|
|
230
|
+
* @param frames One or more varint delimited Frame serialized protobuf messages.
|
|
231
|
+
* @returns A string containing the exported frames.
|
|
232
|
+
* @throws Error if the input is invalid.
|
|
233
|
+
*/
|
|
234
|
+
exportFrames(frames) {
|
|
235
|
+
return Native.BackupJsonExporter_ExportFrames(this, frames);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Completes the validation and export of the previously exported frames.
|
|
239
|
+
* @returns A string containing the final chunk of the output.
|
|
240
|
+
* @throws Error if some previous input fails validation at the final stage.
|
|
241
|
+
*/
|
|
242
|
+
finish() {
|
|
243
|
+
return Native.BackupJsonExporter_Finish(this);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
205
246
|
//# sourceMappingURL=MessageBackup.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -24,10 +24,6 @@ export declare enum ContentHint {
|
|
|
24
24
|
Resendable = 1,
|
|
25
25
|
Implicit = 2
|
|
26
26
|
}
|
|
27
|
-
export declare enum UsePQRatchet {
|
|
28
|
-
Yes = 0,
|
|
29
|
-
No = 1
|
|
30
|
-
}
|
|
31
27
|
export type Uuid = string;
|
|
32
28
|
export declare function hkdf(outputLength: number, keyMaterial: Uint8Array, label: Uint8Array, salt: Uint8Array | null): Uint8Array;
|
|
33
29
|
export declare class ScannableFingerprint {
|
|
@@ -379,10 +375,10 @@ export declare class DecryptionErrorMessage {
|
|
|
379
375
|
deviceId(): number;
|
|
380
376
|
ratchetKey(): PublicKey | undefined;
|
|
381
377
|
}
|
|
382
|
-
export declare function processPreKeyBundle(bundle: PreKeyBundle, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore,
|
|
378
|
+
export declare function processPreKeyBundle(bundle: PreKeyBundle, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, now?: Date): Promise<void>;
|
|
383
379
|
export declare function signalEncrypt(message: Uint8Array, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, now?: Date): Promise<CiphertextMessage>;
|
|
384
380
|
export declare function signalDecrypt(message: SignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
385
|
-
export declare function signalDecryptPreKey(message: PreKeySignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore
|
|
381
|
+
export declare function signalDecryptPreKey(message: PreKeySignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<Uint8Array>;
|
|
386
382
|
export declare function sealedSenderEncryptMessage(message: Uint8Array, address: ProtocolAddress, senderCert: SenderCertificate, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
387
383
|
export declare function sealedSenderEncrypt(content: UnidentifiedSenderMessageContent, address: ProtocolAddress, identityStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
388
384
|
export type SealedSenderMultiRecipientEncryptOptions = {
|
|
@@ -395,7 +391,7 @@ export type SealedSenderMultiRecipientEncryptOptions = {
|
|
|
395
391
|
export declare function sealedSenderMultiRecipientEncrypt(options: SealedSenderMultiRecipientEncryptOptions): Promise<Uint8Array>;
|
|
396
392
|
export declare function sealedSenderMultiRecipientEncrypt(content: UnidentifiedSenderMessageContent, recipients: ProtocolAddress[], identityStore: IdentityKeyStore, sessionStore: SessionStore): Promise<Uint8Array>;
|
|
397
393
|
export declare function sealedSenderMultiRecipientMessageForSingleRecipient(message: Uint8Array): Uint8Array;
|
|
398
|
-
export declare function sealedSenderDecryptMessage(message: Uint8Array, trustRoot: PublicKey, timestamp: number, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore
|
|
394
|
+
export declare function sealedSenderDecryptMessage(message: Uint8Array, trustRoot: PublicKey, timestamp: number, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore): Promise<SealedSenderDecryptionResult>;
|
|
399
395
|
export declare function sealedSenderDecryptToUsmc(message: Uint8Array, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>;
|
|
400
396
|
export declare class Cds2Client {
|
|
401
397
|
readonly _nativeHandle: Native.SgxClientState;
|
package/dist/index.js
CHANGED
|
@@ -37,11 +37,6 @@ export var ContentHint;
|
|
|
37
37
|
ContentHint[ContentHint["Resendable"] = 1] = "Resendable";
|
|
38
38
|
ContentHint[ContentHint["Implicit"] = 2] = "Implicit";
|
|
39
39
|
})(ContentHint || (ContentHint = {}));
|
|
40
|
-
export var UsePQRatchet;
|
|
41
|
-
(function (UsePQRatchet) {
|
|
42
|
-
UsePQRatchet[UsePQRatchet["Yes"] = 0] = "Yes";
|
|
43
|
-
UsePQRatchet[UsePQRatchet["No"] = 1] = "No";
|
|
44
|
-
})(UsePQRatchet || (UsePQRatchet = {}));
|
|
45
40
|
export function hkdf(outputLength, keyMaterial, label, salt) {
|
|
46
41
|
return Native.HKDF_DeriveSecrets(outputLength, keyMaterial, label, salt);
|
|
47
42
|
}
|
|
@@ -788,8 +783,8 @@ export class DecryptionErrorMessage {
|
|
|
788
783
|
}
|
|
789
784
|
}
|
|
790
785
|
}
|
|
791
|
-
export function processPreKeyBundle(bundle, address, sessionStore, identityStore,
|
|
792
|
-
return Native.SessionBuilder_ProcessPreKeyBundle(bundle, address, sessionStore, identityStore, now.getTime()
|
|
786
|
+
export function processPreKeyBundle(bundle, address, sessionStore, identityStore, now = new Date()) {
|
|
787
|
+
return Native.SessionBuilder_ProcessPreKeyBundle(bundle, address, sessionStore, identityStore, now.getTime());
|
|
793
788
|
}
|
|
794
789
|
export async function signalEncrypt(message, address, sessionStore, identityStore, now = new Date()) {
|
|
795
790
|
return CiphertextMessage._fromNativeHandle(await Native.SessionCipher_EncryptMessage(message, address, sessionStore, identityStore, now.getTime()));
|
|
@@ -797,8 +792,8 @@ export async function signalEncrypt(message, address, sessionStore, identityStor
|
|
|
797
792
|
export function signalDecrypt(message, address, sessionStore, identityStore) {
|
|
798
793
|
return Native.SessionCipher_DecryptSignalMessage(message, address, sessionStore, identityStore);
|
|
799
794
|
}
|
|
800
|
-
export function signalDecryptPreKey(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore
|
|
801
|
-
return Native.SessionCipher_DecryptPreKeySignalMessage(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore
|
|
795
|
+
export function signalDecryptPreKey(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore) {
|
|
796
|
+
return Native.SessionCipher_DecryptPreKeySignalMessage(message, address, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore);
|
|
802
797
|
}
|
|
803
798
|
export async function sealedSenderEncryptMessage(message, address, senderCert, sessionStore, identityStore) {
|
|
804
799
|
const ciphertext = await signalEncrypt(message, address, sessionStore, identityStore);
|
|
@@ -831,8 +826,8 @@ export async function sealedSenderMultiRecipientEncrypt(contentOrOptions, recipi
|
|
|
831
826
|
export function sealedSenderMultiRecipientMessageForSingleRecipient(message) {
|
|
832
827
|
return Native.SealedSender_MultiRecipientMessageForSingleRecipient(message);
|
|
833
828
|
}
|
|
834
|
-
export async function sealedSenderDecryptMessage(message, trustRoot, timestamp, localE164, localUuid, localDeviceId, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore
|
|
835
|
-
const ssdr = await Native.SealedSender_DecryptMessage(message, trustRoot, timestamp, localE164, localUuid, localDeviceId, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore
|
|
829
|
+
export async function sealedSenderDecryptMessage(message, trustRoot, timestamp, localE164, localUuid, localDeviceId, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore) {
|
|
830
|
+
const ssdr = await Native.SealedSender_DecryptMessage(message, trustRoot, timestamp, localE164, localUuid, localDeviceId, sessionStore, identityStore, prekeyStore, signedPrekeyStore, kyberPrekeyStore);
|
|
836
831
|
return SealedSenderDecryptionResult._fromNativeHandle(ssdr);
|
|
837
832
|
}
|
|
838
833
|
export async function sealedSenderDecryptToUsmc(message, identityStore) {
|
package/dist/net.d.ts
CHANGED
|
@@ -13,6 +13,19 @@ export declare enum Environment {
|
|
|
13
13
|
Staging = 0,
|
|
14
14
|
Production = 1
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Build variant for remote config key selection.
|
|
18
|
+
*
|
|
19
|
+
* This must match the libsignal-bridge Rust enum of the same name.
|
|
20
|
+
*
|
|
21
|
+
* - `Production`: Use for release builds. Only uses base remote config keys without suffixes.
|
|
22
|
+
* - `Beta`: Use for all other builds (nightly, alpha, internal, public betas). Prefers
|
|
23
|
+
* keys with a `.beta` suffix, falling back to base keys if the suffixed key is not present.
|
|
24
|
+
*/
|
|
25
|
+
export declare enum BuildVariant {
|
|
26
|
+
Production = 0,
|
|
27
|
+
Beta = 1
|
|
28
|
+
}
|
|
16
29
|
export type ServiceAuth = {
|
|
17
30
|
username: string;
|
|
18
31
|
password: string;
|
|
@@ -36,6 +49,7 @@ export type NetConstructorOptions = Readonly<{
|
|
|
36
49
|
env: Environment;
|
|
37
50
|
userAgent: string;
|
|
38
51
|
remoteConfig?: Map<string, string>;
|
|
52
|
+
buildVariant?: BuildVariant;
|
|
39
53
|
} | {
|
|
40
54
|
localTestServer: true;
|
|
41
55
|
userAgent: string;
|
|
@@ -208,9 +222,30 @@ export declare class Net {
|
|
|
208
222
|
* Only new connections made *after* this call will use the new remote config settings.
|
|
209
223
|
* Existing connections are not affected.
|
|
210
224
|
*
|
|
225
|
+
* @deprecated Calling without buildVariant is deprecated. Please explicitly specify BuildVariant.Production or BuildVariant.Beta.
|
|
211
226
|
* @param remoteConfig A map containing preprocessed libsignal configuration keys and their associated values.
|
|
212
227
|
*/
|
|
213
228
|
setRemoteConfig(remoteConfig: ReadonlyMap<string, string>): void;
|
|
229
|
+
/**
|
|
230
|
+
* Updates libsignal's remote configuration settings.
|
|
231
|
+
*
|
|
232
|
+
* The provided configuration map must conform to the following requirements:
|
|
233
|
+
* - Each key represents an enabled configuration and directly indicates that the setting is enabled.
|
|
234
|
+
* - Keys must have had the platform-specific prefix (e.g., `"desktop.libsignal."`) removed.
|
|
235
|
+
* - Entries explicitly disabled by the server must not appear in the map.
|
|
236
|
+
* - Values originally set to `null` by the server must be represented as empty strings.
|
|
237
|
+
* - Values should otherwise maintain the same format as they are returned by the server.
|
|
238
|
+
*
|
|
239
|
+
* These constraints ensure configurations passed to libsignal precisely reflect enabled
|
|
240
|
+
* server-provided settings without ambiguity.
|
|
241
|
+
*
|
|
242
|
+
* Only new connections made *after* this call will use the new remote config settings.
|
|
243
|
+
* Existing connections are not affected.
|
|
244
|
+
*
|
|
245
|
+
* @param remoteConfig A map containing preprocessed libsignal configuration keys and their associated values.
|
|
246
|
+
* @param buildVariant The build variant (BuildVariant.Production or BuildVariant.Beta) that determines which remote config keys to use.
|
|
247
|
+
*/
|
|
248
|
+
setRemoteConfig(remoteConfig: ReadonlyMap<string, string>, buildVariant: BuildVariant): void;
|
|
214
249
|
/**
|
|
215
250
|
* Notifies libsignal that the network has changed.
|
|
216
251
|
*
|
package/dist/net.js
CHANGED
|
@@ -19,6 +19,20 @@ export var Environment;
|
|
|
19
19
|
Environment[Environment["Staging"] = 0] = "Staging";
|
|
20
20
|
Environment[Environment["Production"] = 1] = "Production";
|
|
21
21
|
})(Environment || (Environment = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Build variant for remote config key selection.
|
|
24
|
+
*
|
|
25
|
+
* This must match the libsignal-bridge Rust enum of the same name.
|
|
26
|
+
*
|
|
27
|
+
* - `Production`: Use for release builds. Only uses base remote config keys without suffixes.
|
|
28
|
+
* - `Beta`: Use for all other builds (nightly, alpha, internal, public betas). Prefers
|
|
29
|
+
* keys with a `.beta` suffix, falling back to base keys if the suffixed key is not present.
|
|
30
|
+
*/
|
|
31
|
+
export var BuildVariant;
|
|
32
|
+
(function (BuildVariant) {
|
|
33
|
+
BuildVariant[BuildVariant["Production"] = 0] = "Production";
|
|
34
|
+
BuildVariant[BuildVariant["Beta"] = 1] = "Beta";
|
|
35
|
+
})(BuildVariant || (BuildVariant = {}));
|
|
22
36
|
/** Low-level async runtime control, mostly just exported for testing. */
|
|
23
37
|
export class TokioAsyncContext {
|
|
24
38
|
constructor(handle) {
|
|
@@ -50,7 +64,8 @@ export class Net {
|
|
|
50
64
|
this._connectionManager = newNativeHandle(Native.TESTING_ConnectionManager_newLocalOverride(options.userAgent, options.TESTING_localServer_chatPort, options.TESTING_localServer_cdsiPort, options.TESTING_localServer_svr2Port, options.TESTING_localServer_svrBPort, options.TESTING_localServer_rootCertificateDer));
|
|
51
65
|
}
|
|
52
66
|
else {
|
|
53
|
-
|
|
67
|
+
const { env, userAgent, remoteConfig = new Map(), buildVariant = BuildVariant.Production, } = options;
|
|
68
|
+
this._connectionManager = newNativeHandle(Native.ConnectionManager_new(env, userAgent, new BridgedStringMap(remoteConfig), buildVariant));
|
|
54
69
|
}
|
|
55
70
|
}
|
|
56
71
|
/**
|
|
@@ -232,26 +247,8 @@ export class Net {
|
|
|
232
247
|
clearProxy() {
|
|
233
248
|
Native.ConnectionManager_clear_proxy(this._connectionManager);
|
|
234
249
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
*
|
|
238
|
-
* The provided configuration map must conform to the following requirements:
|
|
239
|
-
* - Each key represents an enabled configuration and directly indicates that the setting is enabled.
|
|
240
|
-
* - Keys must have had the platform-specific prefix (e.g., `"desktop.libsignal."`) removed.
|
|
241
|
-
* - Entries explicitly disabled by the server must not appear in the map.
|
|
242
|
-
* - Values originally set to `null` by the server must be represented as empty strings.
|
|
243
|
-
* - Values should otherwise maintain the same format as they are returned by the server.
|
|
244
|
-
*
|
|
245
|
-
* These constraints ensure configurations passed to libsignal precisely reflect enabled
|
|
246
|
-
* server-provided settings without ambiguity.
|
|
247
|
-
*
|
|
248
|
-
* Only new connections made *after* this call will use the new remote config settings.
|
|
249
|
-
* Existing connections are not affected.
|
|
250
|
-
*
|
|
251
|
-
* @param remoteConfig A map containing preprocessed libsignal configuration keys and their associated values.
|
|
252
|
-
*/
|
|
253
|
-
setRemoteConfig(remoteConfig) {
|
|
254
|
-
Native.ConnectionManager_set_remote_config(this._connectionManager, new BridgedStringMap(remoteConfig));
|
|
250
|
+
setRemoteConfig(remoteConfig, buildVariant = BuildVariant.Production) {
|
|
251
|
+
Native.ConnectionManager_set_remote_config(this._connectionManager, new BridgedStringMap(remoteConfig), buildVariant);
|
|
255
252
|
}
|
|
256
253
|
/**
|
|
257
254
|
* Notifies libsignal that the network has changed.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalapp/libsignal-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"mocha": "^11",
|
|
65
65
|
"prettier": "^2.7.1",
|
|
66
66
|
"prettier-plugin-packagejson": "^2.5.19",
|
|
67
|
+
"protobufjs": "^7.5.3",
|
|
67
68
|
"rimraf": "^6.0.1",
|
|
68
69
|
"sinon": "^21.0.0",
|
|
69
70
|
"sinon-chai": "^4.0.1",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|