@signalapp/libsignal-client 0.75.1 → 0.76.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 +4 -4
- package/dist/Errors.d.ts +19 -13
- package/dist/Errors.js +13 -12
- package/dist/net/Chat.d.ts +2 -0
- package/dist/net/Chat.js +2 -2
- package/dist/net.d.ts +5 -1
- package/dist/net.js +3 -1
- package/package.json +1 -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
|
@@ -136,7 +136,7 @@ type ChatListener = {
|
|
|
136
136
|
): void;
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
type
|
|
139
|
+
type ChallengeOption = 'pushChallenge' | 'captcha';
|
|
140
140
|
|
|
141
141
|
type RegistrationPushTokenType = 'apn' | 'fcm';
|
|
142
142
|
|
|
@@ -199,7 +199,7 @@ export function AuthCredentialPresentation_GetRedemptionTime(presentationBytes:
|
|
|
199
199
|
export function AuthCredentialPresentation_GetUuidCiphertext(presentationBytes: Uint8Array): Serialized<UuidCiphertext>;
|
|
200
200
|
export function AuthCredentialWithPniResponse_CheckValidContents(bytes: Uint8Array): void;
|
|
201
201
|
export function AuthCredentialWithPni_CheckValidContents(bytes: Uint8Array): void;
|
|
202
|
-
export function AuthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, receiveStories: boolean): CancellablePromise<AuthenticatedChatConnection>;
|
|
202
|
+
export function AuthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, receiveStories: boolean, languages: string[]): CancellablePromise<AuthenticatedChatConnection>;
|
|
203
203
|
export function AuthenticatedChatConnection_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<AuthenticatedChatConnection>): CancellablePromise<void>;
|
|
204
204
|
export function AuthenticatedChatConnection_info(chat: Wrapper<AuthenticatedChatConnection>): ChatConnectionInfo;
|
|
205
205
|
export function AuthenticatedChatConnection_init_listener(chat: Wrapper<AuthenticatedChatConnection>, listener: ChatListener): void;
|
|
@@ -482,7 +482,7 @@ export function RegistrationSession_GetAllowedToRequestCode(session: Wrapper<Reg
|
|
|
482
482
|
export function RegistrationSession_GetNextCallSeconds(session: Wrapper<RegistrationSession>): number | null;
|
|
483
483
|
export function RegistrationSession_GetNextSmsSeconds(session: Wrapper<RegistrationSession>): number | null;
|
|
484
484
|
export function RegistrationSession_GetNextVerificationAttemptSeconds(session: Wrapper<RegistrationSession>): number | null;
|
|
485
|
-
export function RegistrationSession_GetRequestedInformation(session: Wrapper<RegistrationSession>):
|
|
485
|
+
export function RegistrationSession_GetRequestedInformation(session: Wrapper<RegistrationSession>): ChallengeOption[];
|
|
486
486
|
export function RegistrationSession_GetVerified(session: Wrapper<RegistrationSession>): boolean;
|
|
487
487
|
export function SanitizedMetadata_GetDataLen(sanitized: Wrapper<SanitizedMetadata>): bigint;
|
|
488
488
|
export function SanitizedMetadata_GetDataOffset(sanitized: Wrapper<SanitizedMetadata>): bigint;
|
|
@@ -681,7 +681,7 @@ export function TESTING_TestingHandleType_getValue(handle: Wrapper<TestingHandle
|
|
|
681
681
|
export function TESTING_TokioAsyncFuture(asyncRuntime: Wrapper<TokioAsyncContext>, input: number): CancellablePromise<number>;
|
|
682
682
|
export function TokioAsyncContext_cancel(context: Wrapper<TokioAsyncContext>, rawCancellationId: bigint): void;
|
|
683
683
|
export function TokioAsyncContext_new(): TokioAsyncContext;
|
|
684
|
-
export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager
|
|
684
|
+
export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, languages: string[]): CancellablePromise<UnauthenticatedChatConnection>;
|
|
685
685
|
export function UnauthenticatedChatConnection_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>): CancellablePromise<void>;
|
|
686
686
|
export function UnauthenticatedChatConnection_info(chat: Wrapper<UnauthenticatedChatConnection>): ChatConnectionInfo;
|
|
687
687
|
export function UnauthenticatedChatConnection_init_listener(chat: Wrapper<UnauthenticatedChatConnection>, listener: ChatListener): void;
|
package/dist/Errors.d.ts
CHANGED
|
@@ -31,18 +31,19 @@ export declare enum ErrorCode {
|
|
|
31
31
|
InvalidEntropyDataLength = 27,
|
|
32
32
|
InvalidUsernameLinkEncryptedData = 28,
|
|
33
33
|
RateLimitedError = 29,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
RateLimitChallengeError = 30,
|
|
35
|
+
SvrDataMissing = 31,
|
|
36
|
+
SvrRequestFailed = 32,
|
|
37
|
+
SvrRestoreFailed = 33,
|
|
38
|
+
ChatServiceInactive = 34,
|
|
39
|
+
AppExpired = 35,
|
|
40
|
+
DeviceDelinked = 36,
|
|
41
|
+
ConnectionInvalidated = 37,
|
|
42
|
+
ConnectedElsewhere = 38,
|
|
43
|
+
BackupValidation = 39,
|
|
44
|
+
Cancelled = 40,
|
|
45
|
+
KeyTransparencyError = 41,
|
|
46
|
+
KeyTransparencyVerificationFailed = 42
|
|
46
47
|
}
|
|
47
48
|
export declare class LibSignalErrorBase extends Error {
|
|
48
49
|
readonly code: ErrorCode;
|
|
@@ -155,6 +156,11 @@ export type RateLimitedError = LibSignalErrorBase & {
|
|
|
155
156
|
code: ErrorCode.RateLimitedError;
|
|
156
157
|
readonly retryAfterSecs: number;
|
|
157
158
|
};
|
|
159
|
+
export type RateLimitChallengeError = LibSignalErrorBase & {
|
|
160
|
+
code: ErrorCode.RateLimitChallengeError;
|
|
161
|
+
readonly token: string;
|
|
162
|
+
readonly options: Set<'pushChallenge' | 'captcha'>;
|
|
163
|
+
};
|
|
158
164
|
export type ChatServiceInactive = LibSignalErrorBase & {
|
|
159
165
|
code: ErrorCode.ChatServiceInactive;
|
|
160
166
|
};
|
|
@@ -193,4 +199,4 @@ export type KeyTransparencyError = LibSignalErrorCommon & {
|
|
|
193
199
|
export type KeyTransparencyVerificationFailed = LibSignalErrorCommon & {
|
|
194
200
|
code: ErrorCode.KeyTransparencyVerificationFailed;
|
|
195
201
|
};
|
|
196
|
-
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | InvalidProtocolAddress | 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 | KeyTransparencyError | KeyTransparencyVerificationFailed;
|
|
202
|
+
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | InvalidProtocolAddress | 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 | RateLimitChallengeError | BackupValidationError | CancellationError | KeyTransparencyError | KeyTransparencyVerificationFailed;
|
package/dist/Errors.js
CHANGED
|
@@ -38,18 +38,19 @@ var ErrorCode;
|
|
|
38
38
|
ErrorCode[ErrorCode["InvalidEntropyDataLength"] = 27] = "InvalidEntropyDataLength";
|
|
39
39
|
ErrorCode[ErrorCode["InvalidUsernameLinkEncryptedData"] = 28] = "InvalidUsernameLinkEncryptedData";
|
|
40
40
|
ErrorCode[ErrorCode["RateLimitedError"] = 29] = "RateLimitedError";
|
|
41
|
-
ErrorCode[ErrorCode["
|
|
42
|
-
ErrorCode[ErrorCode["
|
|
43
|
-
ErrorCode[ErrorCode["
|
|
44
|
-
ErrorCode[ErrorCode["
|
|
45
|
-
ErrorCode[ErrorCode["
|
|
46
|
-
ErrorCode[ErrorCode["
|
|
47
|
-
ErrorCode[ErrorCode["
|
|
48
|
-
ErrorCode[ErrorCode["
|
|
49
|
-
ErrorCode[ErrorCode["
|
|
50
|
-
ErrorCode[ErrorCode["
|
|
51
|
-
ErrorCode[ErrorCode["
|
|
52
|
-
ErrorCode[ErrorCode["
|
|
41
|
+
ErrorCode[ErrorCode["RateLimitChallengeError"] = 30] = "RateLimitChallengeError";
|
|
42
|
+
ErrorCode[ErrorCode["SvrDataMissing"] = 31] = "SvrDataMissing";
|
|
43
|
+
ErrorCode[ErrorCode["SvrRequestFailed"] = 32] = "SvrRequestFailed";
|
|
44
|
+
ErrorCode[ErrorCode["SvrRestoreFailed"] = 33] = "SvrRestoreFailed";
|
|
45
|
+
ErrorCode[ErrorCode["ChatServiceInactive"] = 34] = "ChatServiceInactive";
|
|
46
|
+
ErrorCode[ErrorCode["AppExpired"] = 35] = "AppExpired";
|
|
47
|
+
ErrorCode[ErrorCode["DeviceDelinked"] = 36] = "DeviceDelinked";
|
|
48
|
+
ErrorCode[ErrorCode["ConnectionInvalidated"] = 37] = "ConnectionInvalidated";
|
|
49
|
+
ErrorCode[ErrorCode["ConnectedElsewhere"] = 38] = "ConnectedElsewhere";
|
|
50
|
+
ErrorCode[ErrorCode["BackupValidation"] = 39] = "BackupValidation";
|
|
51
|
+
ErrorCode[ErrorCode["Cancelled"] = 40] = "Cancelled";
|
|
52
|
+
ErrorCode[ErrorCode["KeyTransparencyError"] = 41] = "KeyTransparencyError";
|
|
53
|
+
ErrorCode[ErrorCode["KeyTransparencyVerificationFailed"] = 42] = "KeyTransparencyVerificationFailed";
|
|
53
54
|
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
54
55
|
class LibSignalErrorBase extends Error {
|
|
55
56
|
constructor(message, name, operation, extraProps) {
|
package/dist/net/Chat.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export declare class UnauthenticatedChatConnection implements ChatConnection {
|
|
|
84
84
|
private readonly chatListener;
|
|
85
85
|
private readonly env?;
|
|
86
86
|
static connect(asyncContext: TokioAsyncContext, connectionManager: ConnectionManager, listener: ConnectionEventsListener, env?: Environment, options?: {
|
|
87
|
+
languages?: string[];
|
|
87
88
|
abortSignal?: AbortSignal;
|
|
88
89
|
}): Promise<UnauthenticatedChatConnection>;
|
|
89
90
|
/**
|
|
@@ -108,6 +109,7 @@ export declare class AuthenticatedChatConnection implements ChatConnection {
|
|
|
108
109
|
private readonly chatService;
|
|
109
110
|
private readonly chatListener;
|
|
110
111
|
static connect(asyncContext: TokioAsyncContext, connectionManager: ConnectionManager, username: string, password: string, receiveStories: boolean, listener: ChatServiceListener, options?: {
|
|
112
|
+
languages?: string[];
|
|
111
113
|
abortSignal?: AbortSignal;
|
|
112
114
|
}): Promise<AuthenticatedChatConnection>;
|
|
113
115
|
/**
|
package/dist/net/Chat.js
CHANGED
|
@@ -43,7 +43,7 @@ class ConnectionInfoImpl {
|
|
|
43
43
|
class UnauthenticatedChatConnection {
|
|
44
44
|
static async connect(asyncContext, connectionManager, listener, env, options) {
|
|
45
45
|
const nativeChatListener = makeNativeChatListener(asyncContext, listener);
|
|
46
|
-
const connect = Native.UnauthenticatedChatConnection_connect(asyncContext, connectionManager);
|
|
46
|
+
const connect = Native.UnauthenticatedChatConnection_connect(asyncContext, connectionManager, options?.languages ?? []);
|
|
47
47
|
const chat = await asyncContext.makeCancellable(options?.abortSignal, connect);
|
|
48
48
|
const connection = (0, internal_1.newNativeHandle)(chat);
|
|
49
49
|
Native.UnauthenticatedChatConnection_init_listener(connection, new WeakListenerWrapper(nativeChatListener));
|
|
@@ -95,7 +95,7 @@ exports.UnauthenticatedChatConnection = UnauthenticatedChatConnection;
|
|
|
95
95
|
class AuthenticatedChatConnection {
|
|
96
96
|
static async connect(asyncContext, connectionManager, username, password, receiveStories, listener, options) {
|
|
97
97
|
const nativeChatListener = makeNativeChatListener(asyncContext, listener);
|
|
98
|
-
const connect = Native.AuthenticatedChatConnection_connect(asyncContext, connectionManager, username, password, receiveStories);
|
|
98
|
+
const connect = Native.AuthenticatedChatConnection_connect(asyncContext, connectionManager, username, password, receiveStories, options?.languages ?? []);
|
|
99
99
|
const chat = await asyncContext.makeCancellable(options?.abortSignal, connect);
|
|
100
100
|
const connection = (0, internal_1.newNativeHandle)(chat);
|
|
101
101
|
Native.AuthenticatedChatConnection_init_listener(connection, new WeakListenerWrapper(nativeChatListener));
|
package/dist/net.d.ts
CHANGED
|
@@ -72,20 +72,24 @@ export declare class Net {
|
|
|
72
72
|
abortSignal?: AbortSignal;
|
|
73
73
|
}): Promise<void>;
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
76
75
|
* Creates a new instance of {@link UnauthenticatedChatConnection}.
|
|
76
|
+
*
|
|
77
77
|
* @param listener the listener for incoming events.
|
|
78
78
|
* @param options additional options to pass through.
|
|
79
|
+
* @param options.languages If provided, a list of languages in Accept-Language syntax to apply
|
|
80
|
+
* to all requests made on this connection.
|
|
79
81
|
* @param options.abortSignal an {@link AbortSignal} that will cancel the connection attempt.
|
|
80
82
|
* @returns the connected listener, if the connection succeeds.
|
|
81
83
|
*/
|
|
82
84
|
connectUnauthenticatedChat(listener: ConnectionEventsListener, options?: {
|
|
85
|
+
languages?: string[];
|
|
83
86
|
abortSignal?: AbortSignal;
|
|
84
87
|
}): Promise<UnauthenticatedChatConnection>;
|
|
85
88
|
/**
|
|
86
89
|
* Creates a new instance of {@link AuthenticatedChatConnection}.
|
|
87
90
|
*/
|
|
88
91
|
connectAuthenticatedChat(username: string, password: string, receiveStories: boolean, listener: ChatServiceListener, options?: {
|
|
92
|
+
languages?: string[];
|
|
89
93
|
abortSignal?: AbortSignal;
|
|
90
94
|
}): Promise<AuthenticatedChatConnection>;
|
|
91
95
|
resumeRegistrationSession({ sessionId, e164, }: {
|
package/dist/net.js
CHANGED
|
@@ -83,10 +83,12 @@ class Net {
|
|
|
83
83
|
return this.asyncContext.makeCancellable(options?.abortSignal, Native.AuthenticatedChatConnection_preconnect(this.asyncContext, this._connectionManager));
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
87
86
|
* Creates a new instance of {@link UnauthenticatedChatConnection}.
|
|
87
|
+
*
|
|
88
88
|
* @param listener the listener for incoming events.
|
|
89
89
|
* @param options additional options to pass through.
|
|
90
|
+
* @param options.languages If provided, a list of languages in Accept-Language syntax to apply
|
|
91
|
+
* to all requests made on this connection.
|
|
90
92
|
* @param options.abortSignal an {@link AbortSignal} that will cancel the connection attempt.
|
|
91
93
|
* @returns the connected listener, if the connection succeeds.
|
|
92
94
|
*/
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|