@signalapp/libsignal-client 0.68.1 → 0.69.1

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 CHANGED
@@ -195,6 +195,8 @@ export function BackupKey_DeriveLocalBackupMetadataKey(backupKey: Buffer): Buffe
195
195
  export function BackupKey_DeriveMediaEncryptionKey(backupKey: Buffer, mediaId: Buffer): Buffer;
196
196
  export function BackupKey_DeriveMediaId(backupKey: Buffer, mediaName: string): Buffer;
197
197
  export function BackupKey_DeriveThumbnailTransitEncryptionKey(backupKey: Buffer, mediaId: Buffer): Buffer;
198
+ export function BridgedStringMap_insert(map: Wrapper<BridgedStringMap>, key: string, value: string): void;
199
+ export function BridgedStringMap_new(initialCapacity: number): BridgedStringMap;
198
200
  export function CallLinkAuthCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
199
201
  export function CallLinkAuthCredentialPresentation_GetUserId(presentationBytes: Buffer): Serialized<UuidCiphertext>;
200
202
  export function CallLinkAuthCredentialPresentation_Verify(presentationBytes: Buffer, now: Timestamp, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer): void;
@@ -207,11 +209,11 @@ export function CallLinkPublicParams_CheckValidContents(paramsBytes: Buffer): vo
207
209
  export function CallLinkSecretParams_CheckValidContents(paramsBytes: Buffer): void;
208
210
  export function CallLinkSecretParams_DecryptUserId(paramsBytes: Buffer, userId: Serialized<UuidCiphertext>): Buffer;
209
211
  export function CallLinkSecretParams_DeriveFromRootKey(rootKey: Buffer): Buffer;
212
+ export function CallLinkSecretParams_EncryptUserId(paramsBytes: Buffer, userId: Buffer): Serialized<UuidCiphertext>;
210
213
  export function CallLinkSecretParams_GetPublicParams(paramsBytes: Buffer): Buffer;
211
214
  export function Cds2ClientState_New(mrenclave: Buffer, attestationMsg: Buffer, currentTimestamp: Timestamp): SgxClientState;
212
215
  export function CdsiLookup_complete(asyncRuntime: Wrapper<TokioAsyncContext>, lookup: Wrapper<CdsiLookup>): CancellablePromise<LookupResponse>;
213
216
  export function CdsiLookup_new(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, request: Wrapper<LookupRequest>): CancellablePromise<CdsiLookup>;
214
- export function CdsiLookup_new_routes(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, request: Wrapper<LookupRequest>): CancellablePromise<CdsiLookup>;
215
217
  export function CdsiLookup_token(lookup: Wrapper<CdsiLookup>): Buffer;
216
218
  export function ChatConnectionInfo_description(connectionInfo: Wrapper<ChatConnectionInfo>): string;
217
219
  export function ChatConnectionInfo_ip_version(connectionInfo: Wrapper<ChatConnectionInfo>): number;
@@ -223,12 +225,13 @@ export function ComparableBackup_GetComparableString(backup: Wrapper<ComparableB
223
225
  export function ComparableBackup_GetUnknownFields(backup: Wrapper<ComparableBackup>): string[];
224
226
  export function ComparableBackup_ReadUnencrypted(stream: InputStream, len: bigint, purpose: number): Promise<ComparableBackup>;
225
227
  export function ConnectionManager_clear_proxy(connectionManager: Wrapper<ConnectionManager>): void;
226
- export function ConnectionManager_new(environment: number, userAgent: string): ConnectionManager;
228
+ export function ConnectionManager_new(environment: number, userAgent: string, remoteConfig: Wrapper<BridgedStringMap>): ConnectionManager;
227
229
  export function ConnectionManager_on_network_change(connectionManager: Wrapper<ConnectionManager>): void;
228
230
  export function ConnectionManager_set_censorship_circumvention_enabled(connectionManager: Wrapper<ConnectionManager>, enabled: boolean): void;
229
231
  export function ConnectionManager_set_invalid_proxy(connectionManager: Wrapper<ConnectionManager>): void;
230
232
  export function ConnectionManager_set_ipv6_enabled(connectionManager: Wrapper<ConnectionManager>, ipv6Enabled: boolean): void;
231
233
  export function ConnectionManager_set_proxy(connectionManager: Wrapper<ConnectionManager>, proxy: Wrapper<ConnectionProxyConfig>): void;
234
+ export function ConnectionManager_set_remote_config(connectionManager: Wrapper<ConnectionManager>, remoteConfig: Wrapper<BridgedStringMap>): void;
232
235
  export function ConnectionProxyConfig_new(scheme: string, host: string, port: number, username: string | null, password: string | null): ConnectionProxyConfig;
233
236
  export function CreateCallLinkCredentialPresentation_CheckValidContents(presentationBytes: Buffer): void;
234
237
  export function CreateCallLinkCredentialPresentation_Verify(presentationBytes: Buffer, roomId: Buffer, now: Timestamp, serverParamsBytes: Buffer, callLinkParamsBytes: Buffer): void;
@@ -278,6 +281,7 @@ export function GroupSecretParams_GetMasterKey(params: Serialized<GroupSecretPar
278
281
  export function GroupSecretParams_GetPublicParams(params: Serialized<GroupSecretParams>): Serialized<GroupPublicParams>;
279
282
  export function GroupSendDerivedKeyPair_CheckValidContents(bytes: Buffer): void;
280
283
  export function GroupSendDerivedKeyPair_ForExpiration(expiration: Timestamp, serverParams: Wrapper<ServerSecretParams>): Buffer;
284
+ export function GroupSendEndorsement_CallLinkParams_ToToken(endorsement: Buffer, callLinkSecretParamsSerialized: Buffer): Buffer;
281
285
  export function GroupSendEndorsement_CheckValidContents(bytes: Buffer): void;
282
286
  export function GroupSendEndorsement_Combine(endorsements: Buffer[]): Buffer;
283
287
  export function GroupSendEndorsement_Remove(endorsement: Buffer, toRemove: Buffer): Buffer;
@@ -535,6 +539,7 @@ export function SignedPreKeyRecord_GetSignature(obj: Wrapper<SignedPreKeyRecord>
535
539
  export function SignedPreKeyRecord_GetTimestamp(obj: Wrapper<SignedPreKeyRecord>): Timestamp;
536
540
  export function SignedPreKeyRecord_New(id: number, timestamp: Timestamp, pubKey: Wrapper<PublicKey>, privKey: Wrapper<PrivateKey>, signature: Buffer): SignedPreKeyRecord;
537
541
  export function SignedPreKeyRecord_Serialize(obj: Wrapper<SignedPreKeyRecord>): Buffer;
542
+ export function TESTING_BridgedStringMap_dump_to_json(map: Wrapper<BridgedStringMap>): string;
538
543
  export function TESTING_CdsiLookupErrorConvert(errorDescription: string): void;
539
544
  export function TESTING_CdsiLookupResponseConvert(asyncRuntime: Wrapper<TokioAsyncContext>): CancellablePromise<LookupResponse>;
540
545
  export function TESTING_ChatConnectErrorConvert(errorDescription: string): void;
@@ -561,13 +566,19 @@ export function TESTING_FakeChatRemoteEnd_InjectConnectionInterrupted(chat: Wrap
561
566
  export function TESTING_FakeChatRemoteEnd_ReceiveIncomingRequest(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<FakeChatRemoteEnd>): CancellablePromise<FakeChatSentRequest | null>;
562
567
  export function TESTING_FakeChatRemoteEnd_SendRawServerRequest(chat: Wrapper<FakeChatRemoteEnd>, bytes: Buffer): void;
563
568
  export function TESTING_FakeChatRemoteEnd_SendRawServerResponse(chat: Wrapper<FakeChatRemoteEnd>, bytes: Buffer): void;
569
+ export function TESTING_FakeChatRemoteEnd_SendServerResponse(chat: Wrapper<FakeChatRemoteEnd>, response: Wrapper<FakeChatResponse>): void;
570
+ export function TESTING_FakeChatResponse_Create(id: bigint, status: number, message: string, headers: string[], body: Buffer | null): FakeChatResponse;
564
571
  export function TESTING_FakeChatSentRequest_RequestId(request: Wrapper<FakeChatSentRequest>): bigint;
565
572
  export function TESTING_FakeChatSentRequest_TakeHttpRequest(request: Wrapper<FakeChatSentRequest>): HttpRequest;
573
+ export function TESTING_FakeChatServer_Create(): FakeChatServer;
574
+ export function TESTING_FakeChatServer_GetNextRemote(asyncRuntime: Wrapper<TokioAsyncContext>, server: Wrapper<FakeChatServer>): CancellablePromise<FakeChatRemoteEnd>;
575
+ export function TESTING_FakeRegistrationSession_CreateSession(asyncRuntime: Wrapper<TokioAsyncContext>, createSession: CreateSession, chat: Wrapper<FakeChatServer>): CancellablePromise<RegistrationService>;
566
576
  export function TESTING_FutureFailure(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: number): CancellablePromise<number>;
567
577
  export function TESTING_FutureProducesOtherPointerType(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: string): CancellablePromise<OtherTestingHandleType>;
568
578
  export function TESTING_FutureProducesPointerType(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: number): CancellablePromise<TestingHandleType>;
569
579
  export function TESTING_FutureSuccess(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: number): CancellablePromise<number>;
570
580
  export function TESTING_InputStreamReadIntoZeroLengthSlice(capsAlphabetInput: InputStream): Promise<Buffer>;
581
+ export function TESTING_JoinStringArray(array: string[], joinWith: string): string;
571
582
  export function TESTING_NonSuspendingBackgroundThreadRuntime_New(): NonSuspendingBackgroundThreadRuntime;
572
583
  export function TESTING_OnlyCompletesByCancellation(asyncRuntime: Wrapper<TokioAsyncContext>): CancellablePromise<void>;
573
584
  export function TESTING_OtherTestingHandleType_getValue(handle: Wrapper<OtherTestingHandleType>): string;
@@ -584,6 +595,11 @@ export function TESTING_PanicOnReturnAsync(_needsCleanup: null): Promise<null>;
584
595
  export function TESTING_PanicOnReturnIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _needsCleanup: null): CancellablePromise<null>;
585
596
  export function TESTING_PanicOnReturnSync(_needsCleanup: null): null;
586
597
  export function TESTING_ProcessBytestringArray(input: Buffer[]): Buffer[];
598
+ export function TESTING_RegistrationService_CreateSessionErrorConvert(errorDescription: string): void;
599
+ export function TESTING_RegistrationService_RequestVerificationCodeErrorConvert(errorDescription: string): void;
600
+ export function TESTING_RegistrationService_ResumeSessionErrorConvert(errorDescription: string): void;
601
+ export function TESTING_RegistrationService_SubmitVerificationErrorConvert(errorDescription: string): void;
602
+ export function TESTING_RegistrationService_UpdateSessionErrorConvert(errorDescription: string): void;
587
603
  export function TESTING_RegistrationSessionInfoConvert(): RegistrationSession;
588
604
  export function TESTING_ReturnStringArray(): string[];
589
605
  export function TESTING_RoundTripI32(input: number): number;
@@ -624,6 +640,7 @@ export function initLogger(maxLevel: LogLevel, callback: (level: LogLevel, targe
624
640
  export function test_only_fn_returns_123(): number;
625
641
  interface Aes256GcmSiv { readonly __type: unique symbol; }
626
642
  interface AuthenticatedChatConnection { readonly __type: unique symbol; }
643
+ interface BridgedStringMap { readonly __type: unique symbol; }
627
644
  interface CdsiLookup { readonly __type: unique symbol; }
628
645
  interface ChatConnectionInfo { readonly __type: unique symbol; }
629
646
  interface CiphertextMessage { readonly __type: unique symbol; }
@@ -636,7 +653,9 @@ interface ExpiringProfileKeyCredential { readonly __type: unique symbol; }
636
653
  interface ExpiringProfileKeyCredentialResponse { readonly __type: unique symbol; }
637
654
  interface FakeChatConnection { readonly __type: unique symbol; }
638
655
  interface FakeChatRemoteEnd { readonly __type: unique symbol; }
656
+ interface FakeChatResponse { readonly __type: unique symbol; }
639
657
  interface FakeChatSentRequest { readonly __type: unique symbol; }
658
+ interface FakeChatServer { readonly __type: unique symbol; }
640
659
  interface Fingerprint { readonly __type: unique symbol; }
641
660
  interface GroupMasterKey { readonly __type: unique symbol; }
642
661
  interface GroupPublicParams { readonly __type: unique symbol; }
package/dist/Errors.d.ts CHANGED
@@ -36,8 +36,10 @@ export declare enum ErrorCode {
36
36
  ChatServiceInactive = 32,
37
37
  AppExpired = 33,
38
38
  DeviceDelinked = 34,
39
- BackupValidation = 35,
40
- Cancelled = 36
39
+ ConnectionInvalidated = 35,
40
+ ConnectedElsewhere = 36,
41
+ BackupValidation = 37,
42
+ Cancelled = 38
41
43
  }
42
44
  export declare class LibSignalErrorBase extends Error {
43
45
  readonly code: ErrorCode;
@@ -154,6 +156,12 @@ export type AppExpiredError = LibSignalErrorBase & {
154
156
  export type DeviceDelinkedError = LibSignalErrorBase & {
155
157
  code: ErrorCode.DeviceDelinked;
156
158
  };
159
+ export type ConnectionInvalidatedError = LibSignalErrorBase & {
160
+ code: ErrorCode.ConnectionInvalidated;
161
+ };
162
+ export type ConnectedElsewhereError = LibSignalErrorBase & {
163
+ code: ErrorCode.ConnectedElsewhere;
164
+ };
157
165
  export type SvrDataMissingError = LibSignalErrorBase & {
158
166
  code: ErrorCode.SvrDataMissing;
159
167
  };
@@ -171,4 +179,4 @@ export type BackupValidationError = LibSignalErrorCommon & {
171
179
  export type CancellationError = LibSignalErrorCommon & {
172
180
  code: ErrorCode.Cancelled;
173
181
  };
174
- export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | NicknameCannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | DiscriminatorCannotBeEmptyError | DiscriminatorCannotBeZeroError | DiscriminatorCannotBeSingleDigitError | DiscriminatorCannotHaveLeadingZerosError | BadDiscriminatorCharacterError | DiscriminatorTooLargeError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | CdsiInvalidTokenError | InvalidUriError | InvalidMediaInputError | SvrDataMissingError | SvrRestoreFailedError | SvrRequestFailedError | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | RateLimitedError | BackupValidationError | CancellationError;
182
+ export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | NicknameCannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | DiscriminatorCannotBeEmptyError | DiscriminatorCannotBeZeroError | DiscriminatorCannotBeSingleDigitError | DiscriminatorCannotHaveLeadingZerosError | BadDiscriminatorCharacterError | DiscriminatorTooLargeError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | CdsiInvalidTokenError | InvalidUriError | InvalidMediaInputError | SvrDataMissingError | SvrRestoreFailedError | SvrRequestFailedError | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | ConnectionInvalidatedError | ConnectedElsewhereError | RateLimitedError | BackupValidationError | CancellationError;
package/dist/Errors.js CHANGED
@@ -43,8 +43,10 @@ var ErrorCode;
43
43
  ErrorCode[ErrorCode["ChatServiceInactive"] = 32] = "ChatServiceInactive";
44
44
  ErrorCode[ErrorCode["AppExpired"] = 33] = "AppExpired";
45
45
  ErrorCode[ErrorCode["DeviceDelinked"] = 34] = "DeviceDelinked";
46
- ErrorCode[ErrorCode["BackupValidation"] = 35] = "BackupValidation";
47
- ErrorCode[ErrorCode["Cancelled"] = 36] = "Cancelled";
46
+ ErrorCode[ErrorCode["ConnectionInvalidated"] = 35] = "ConnectionInvalidated";
47
+ ErrorCode[ErrorCode["ConnectedElsewhere"] = 36] = "ConnectedElsewhere";
48
+ ErrorCode[ErrorCode["BackupValidation"] = 37] = "BackupValidation";
49
+ ErrorCode[ErrorCode["Cancelled"] = 38] = "Cancelled";
48
50
  })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
49
51
  class LibSignalErrorBase extends Error {
50
52
  constructor(message, name, operation, extraProps) {