@signalapp/libsignal-client 0.76.0 → 0.76.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/Native.d.ts CHANGED
@@ -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;
@@ -470,13 +470,11 @@ export function RegistrationService_CheckSvr2Credentials(asyncRuntime: Wrapper<T
470
470
  export function RegistrationService_CreateSession(asyncRuntime: Wrapper<TokioAsyncContext>, createSession: RegistrationCreateSessionRequest, connectChat: ConnectChatBridge): CancellablePromise<RegistrationService>;
471
471
  export function RegistrationService_RegisterAccount(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, registerAccount: Wrapper<RegisterAccountRequest>, accountAttributes: Wrapper<RegistrationAccountAttributes>): CancellablePromise<RegisterAccountResponse>;
472
472
  export function RegistrationService_RegistrationSession(service: Wrapper<RegistrationService>): RegistrationSession;
473
- export function RegistrationService_RequestPushChallenge(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, pushToken: string, pushTokenType: RegistrationPushTokenType): CancellablePromise<void>;
474
473
  export function RegistrationService_RequestVerificationCode(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, transport: string, client: string, languages: string[]): CancellablePromise<void>;
475
474
  export function RegistrationService_ReregisterAccount(asyncRuntime: Wrapper<TokioAsyncContext>, connectChat: ConnectChatBridge, number: string, registerAccount: Wrapper<RegisterAccountRequest>, accountAttributes: Wrapper<RegistrationAccountAttributes>): CancellablePromise<RegisterAccountResponse>;
476
475
  export function RegistrationService_ResumeSession(asyncRuntime: Wrapper<TokioAsyncContext>, sessionId: string, number: string, connectChat: ConnectChatBridge): CancellablePromise<RegistrationService>;
477
476
  export function RegistrationService_SessionId(service: Wrapper<RegistrationService>): string;
478
477
  export function RegistrationService_SubmitCaptcha(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, captchaValue: string): CancellablePromise<void>;
479
- export function RegistrationService_SubmitPushChallenge(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, pushChallenge: string): CancellablePromise<void>;
480
478
  export function RegistrationService_SubmitVerificationCode(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, code: string): CancellablePromise<void>;
481
479
  export function RegistrationSession_GetAllowedToRequestCode(session: Wrapper<RegistrationSession>): boolean;
482
480
  export function RegistrationSession_GetNextCallSeconds(session: Wrapper<RegistrationSession>): number | null;
@@ -679,9 +677,13 @@ export function TESTING_ServerMessageAck_Create(): ServerMessageAck;
679
677
  export function TESTING_SignedPublicPreKey_CheckBridgesCorrectly(sourcePublicKey: Wrapper<PublicKey>, signedPreKey: SignedPublicPreKey): void;
680
678
  export function TESTING_TestingHandleType_getValue(handle: Wrapper<TestingHandleType>): number;
681
679
  export function TESTING_TokioAsyncFuture(asyncRuntime: Wrapper<TokioAsyncContext>, input: number): CancellablePromise<number>;
680
+ export function TestingSemaphore_AddPermits(semaphore: Wrapper<TestingSemaphore>, permits: number): void;
681
+ export function TestingSemaphore_New(initial: number): TestingSemaphore;
682
+ export function TestingValueHolder_Get(holder: Wrapper<TestingValueHolder>): number;
683
+ export function TestingValueHolder_New(value: number): TestingValueHolder;
682
684
  export function TokioAsyncContext_cancel(context: Wrapper<TokioAsyncContext>, rawCancellationId: bigint): void;
683
685
  export function TokioAsyncContext_new(): TokioAsyncContext;
684
- export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>): CancellablePromise<UnauthenticatedChatConnection>;
686
+ export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, languages: string[]): CancellablePromise<UnauthenticatedChatConnection>;
685
687
  export function UnauthenticatedChatConnection_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>): CancellablePromise<void>;
686
688
  export function UnauthenticatedChatConnection_info(chat: Wrapper<UnauthenticatedChatConnection>): ChatConnectionInfo;
687
689
  export function UnauthenticatedChatConnection_init_listener(chat: Wrapper<UnauthenticatedChatConnection>, listener: ChatListener): void;
@@ -780,6 +782,8 @@ interface SignalMessage { readonly __type: unique symbol; }
780
782
  interface SignedPreKeyRecord { readonly __type: unique symbol; }
781
783
  interface TestingFutureCancellationCounter { readonly __type: unique symbol; }
782
784
  interface TestingHandleType { readonly __type: unique symbol; }
785
+ interface TestingSemaphore { readonly __type: unique symbol; }
786
+ interface TestingValueHolder { readonly __type: unique symbol; }
783
787
  interface TokioAsyncContext { readonly __type: unique symbol; }
784
788
  interface UnauthenticatedChatConnection { readonly __type: unique symbol; }
785
789
  interface UnidentifiedSenderMessageContent { readonly __type: unique symbol; }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/libsignal-client",
3
- "version": "0.76.0",
3
+ "version": "0.76.2",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",