@signalapp/libsignal-client 0.57.1 → 0.58.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/dist/net.d.ts CHANGED
@@ -137,7 +137,7 @@ export type ChatService = {
137
137
  */
138
138
  export declare class AuthenticatedChatService implements ChatService {
139
139
  private readonly asyncContext;
140
- readonly chatService: Wrapper<Native.Chat>;
140
+ readonly chatService: Wrapper<Native.AuthChat>;
141
141
  constructor(asyncContext: TokioAsyncContext, connectionManager: ConnectionManager, username: string, password: string, receiveStories: boolean, listener: ChatServiceListener);
142
142
  disconnect(): Promise<void>;
143
143
  connect(options?: {
@@ -155,7 +155,7 @@ export declare class AuthenticatedChatService implements ChatService {
155
155
  */
156
156
  export declare class UnauthenticatedChatService implements ChatService {
157
157
  private readonly asyncContext;
158
- readonly chatService: Wrapper<Native.Chat>;
158
+ readonly chatService: Wrapper<Native.UnauthChat>;
159
159
  constructor(asyncContext: TokioAsyncContext, connectionManager: ConnectionManager, listener: ConnectionEventsListener);
160
160
  disconnect(): Promise<void>;
161
161
  connect(options?: {
package/dist/net.js CHANGED
@@ -65,7 +65,7 @@ exports.ChatServerMessageAck = ChatServerMessageAck;
65
65
  class AuthenticatedChatService {
66
66
  constructor(asyncContext, connectionManager, username, password, receiveStories, listener) {
67
67
  this.asyncContext = asyncContext;
68
- this.chatService = newNativeHandle(Native.ChatService_new(connectionManager, username, password, receiveStories));
68
+ this.chatService = newNativeHandle(Native.ChatService_new_auth(connectionManager, username, password, receiveStories));
69
69
  const nativeChatListener = {
70
70
  _incoming_message(envelope, timestamp, ack) {
71
71
  listener.onIncomingMessage(envelope, timestamp, new ChatServerMessageAck(asyncContext, ack));
@@ -80,7 +80,7 @@ class AuthenticatedChatService {
80
80
  Native.ChatService_SetListenerAuth(asyncContext, this.chatService, nativeChatListener);
81
81
  }
82
82
  disconnect() {
83
- return Native.ChatService_disconnect(this.asyncContext, this.chatService);
83
+ return Native.ChatService_disconnect_auth(this.asyncContext, this.chatService);
84
84
  }
85
85
  connect(options) {
86
86
  return this.asyncContext.makeCancellable(options?.abortSignal, Native.ChatService_connect_auth(this.asyncContext, this.chatService));
@@ -99,7 +99,7 @@ exports.AuthenticatedChatService = AuthenticatedChatService;
99
99
  class UnauthenticatedChatService {
100
100
  constructor(asyncContext, connectionManager, listener) {
101
101
  this.asyncContext = asyncContext;
102
- this.chatService = newNativeHandle(Native.ChatService_new(connectionManager, '', '', false));
102
+ this.chatService = newNativeHandle(Native.ChatService_new_unauth(connectionManager));
103
103
  const nativeChatListener = {
104
104
  _incoming_message(_envelope, _timestamp, _ack) {
105
105
  throw new Error('Event not supported on unauthenticated connection');
@@ -114,7 +114,7 @@ class UnauthenticatedChatService {
114
114
  Native.ChatService_SetListenerUnauth(asyncContext, this.chatService, nativeChatListener);
115
115
  }
116
116
  disconnect() {
117
- return Native.ChatService_disconnect(this.asyncContext, this.chatService);
117
+ return Native.ChatService_disconnect_unauth(this.asyncContext, this.chatService);
118
118
  }
119
119
  connect(options) {
120
120
  return this.asyncContext.makeCancellable(options?.abortSignal, Native.ChatService_connect_unauth(this.asyncContext, this.chatService));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/libsignal-client",
3
- "version": "0.57.1",
3
+ "version": "0.58.1",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,6 +25,7 @@
25
25
  "test": "mocha --recursive dist/test --require source-map-support/register",
26
26
  "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
27
27
  "format": "p() { prettier ${@:- --write} '**/*.{css,js,json,md,scss,ts,tsx}' ../rust/bridge/node/bin/Native.d.ts.in; }; p",
28
+ "format-check": "p() { prettier ${@:- --check} '**/*.{css,js,json,md,scss,ts,tsx}' ../rust/bridge/node/bin/Native.d.ts.in; }; p",
28
29
  "prepack": "cp ../acknowledgments/acknowledgments.md dist"
29
30
  },
30
31
  "dependencies": {
@@ -43,8 +44,8 @@
43
44
  "@types/sinon": "^17.0.3",
44
45
  "@types/sinon-chai": "^3.2.12",
45
46
  "@types/uuid": "^8.3.0",
46
- "@typescript-eslint/eslint-plugin": "^5.47.0",
47
- "@typescript-eslint/parser": "^5.47.0",
47
+ "@typescript-eslint/eslint-plugin": "^6.18.1",
48
+ "@typescript-eslint/parser": "^6.18.1",
48
49
  "chai": "^4.2.0",
49
50
  "chai-as-promised": "^7.1.1",
50
51
  "chance": "^1.1.11",