@signalapp/libsignal-client 0.50.0 → 0.51.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
@@ -114,6 +114,18 @@ export abstract class InputStream {
114
114
 
115
115
  export abstract class SyncInputStream extends Buffer {}
116
116
 
117
+ export abstract class ChatListener {
118
+ _incoming_message(
119
+ envelope: Buffer,
120
+ timestamp: number,
121
+ ack: ServerMessageAck
122
+ ): void;
123
+ _queue_empty(): void;
124
+ _connection_interrupted(): void;
125
+ }
126
+
127
+ export abstract class MakeChatListener extends ChatListener {}
128
+
117
129
  type Wrapper<T> = Readonly<{
118
130
  _nativeHandle: T;
119
131
  }>;
@@ -168,6 +180,7 @@ export function Cds2ClientState_New(mrenclave: Buffer, attestationMsg: Buffer, c
168
180
  export function CdsiLookup_complete(asyncRuntime: Wrapper<TokioAsyncContext>, lookup: Wrapper<CdsiLookup>): Promise<LookupResponse>;
169
181
  export function CdsiLookup_new(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>, username: string, password: string, request: Wrapper<LookupRequest>): Promise<CdsiLookup>;
170
182
  export function CdsiLookup_token(lookup: Wrapper<CdsiLookup>): Buffer;
183
+ export function ChatServer_SetListener(runtime: Wrapper<TokioAsyncContext>, chat: Wrapper<Chat>, makeListener: MakeChatListener | null): void;
171
184
  export function ChatService_auth_send(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<Chat>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): Promise<ChatResponse>;
172
185
  export function ChatService_auth_send_and_debug(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<Chat>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): Promise<ResponseAndDebugInfo>;
173
186
  export function ChatService_connect_auth(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<Chat>): Promise<ChatServiceDebugInfo>;
@@ -480,6 +493,7 @@ export function TESTING_ChatServiceDebugInfoConvert(): ChatServiceDebugInfo;
480
493
  export function TESTING_ChatServiceErrorConvert(errorDescription: string): void;
481
494
  export function TESTING_ChatServiceResponseAndDebugInfoConvert(): ResponseAndDebugInfo;
482
495
  export function TESTING_ChatServiceResponseConvert(bodyPresent: boolean): ChatResponse;
496
+ export function TESTING_ChatService_InjectConnectionInterrupted(chat: Wrapper<Chat>): void;
483
497
  export function TESTING_ChatService_InjectRawServerRequest(chat: Wrapper<Chat>, bytes: Buffer): void;
484
498
  export function TESTING_ErrorOnBorrowAsync(_input: null): Promise<void>;
485
499
  export function TESTING_ErrorOnBorrowIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: null): Promise<void>;
@@ -2,7 +2,7 @@
2
2
 
3
3
  libsignal makes use of the following open source projects.
4
4
 
5
- ## partial-default 0.1.0, partial-default-derive 0.1.0
5
+ ## partial-default-derive 0.1.0, partial-default 0.1.0
6
6
 
7
7
  ```
8
8
  GNU AFFERO GENERAL PUBLIC LICENSE
@@ -669,7 +669,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
669
669
 
670
670
  ```
671
671
 
672
- ## attest 0.1.0, device-transfer 0.1.0, libsignal-bridge 0.1.0, libsignal-bridge-macros 0.1.0, libsignal-core 0.1.0, libsignal-ffi 0.50.0, libsignal-jni 0.50.0, libsignal-message-backup 0.1.0, libsignal-message-backup-macros 0.1.0, libsignal-net 0.1.0, libsignal-node 0.50.0, libsignal-protocol 0.1.0, libsignal-svr3 0.1.0, poksho 0.7.0, signal-crypto 0.1.0, signal-media 0.1.0, signal-neon-futures 0.1.0, signal-neon-futures-tests 0.1.0, signal-pin 0.1.0, usernames 0.1.0, zkcredential 0.1.0, zkgroup 0.9.0
672
+ ## attest 0.1.0, libsignal-ffi 0.51.1, libsignal-jni 0.51.1, libsignal-node 0.51.1, signal-neon-futures 0.1.0, signal-neon-futures-tests 0.1.0, libsignal-bridge 0.1.0, libsignal-bridge-macros 0.1.0, libsignal-core 0.1.0, signal-crypto 0.1.0, device-transfer 0.1.0, signal-media 0.1.0, libsignal-message-backup 0.1.0, libsignal-message-backup-macros 0.1.0, libsignal-net 0.1.0, signal-pin 0.1.0, poksho 0.7.0, libsignal-protocol 0.1.0, libsignal-svr3 0.1.0, usernames 0.1.0, zkcredential 0.1.0, zkgroup 0.9.0
673
673
 
674
674
  ```
675
675
  GNU AFFERO GENERAL PUBLIC LICENSE
@@ -1326,7 +1326,7 @@ You should also get your employer (if you work as a programmer) or school, if an
1326
1326
 
1327
1327
  ```
1328
1328
 
1329
- ## ciborium 0.2.2, ciborium-io 0.2.2, ciborium-ll 0.2.2
1329
+ ## ciborium-io 0.2.2, ciborium-ll 0.2.2, ciborium 0.2.2
1330
1330
 
1331
1331
  ```
1332
1332
  Apache License
@@ -1715,7 +1715,7 @@ END OF TERMS AND CONDITIONS
1715
1715
 
1716
1716
  ```
1717
1717
 
1718
- ## debugid 0.8.0, prost 0.12.6, prost-build 0.12.6, prost-derive 0.12.6, prost-types 0.12.6
1718
+ ## debugid 0.8.0, prost-build 0.12.6, prost-derive 0.12.6, prost-types 0.12.6, prost 0.12.6
1719
1719
 
1720
1720
  ```
1721
1721
  Apache License
@@ -2011,7 +2011,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2011
2011
 
2012
2012
  ```
2013
2013
 
2014
- ## curve25519-dalek 4.1.1
2014
+ ## curve25519-dalek 4.1.3
2015
2015
 
2016
2016
  ```
2017
2017
  Copyright (c) 2012 The Go Authors. All rights reserved.
@@ -2043,45 +2043,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2043
2043
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2044
2044
  ```
2045
2045
 
2046
- ## sha1_smol 1.0.0
2047
-
2048
- ```
2049
- Copyright (c) 2014 by Armin Ronacher.
2050
-
2051
- Copyright (c) 2013 Koka El Kiwi
2052
-
2053
- Some rights reserved.
2054
-
2055
- Redistribution and use in source and binary forms, with or without
2056
- modification, are permitted provided that the following conditions are
2057
- met:
2058
-
2059
- * Redistributions of source code must retain the above copyright
2060
- notice, this list of conditions and the following disclaimer.
2061
-
2062
- * Redistributions in binary form must reproduce the above
2063
- copyright notice, this list of conditions and the following
2064
- disclaimer in the documentation and/or other materials provided
2065
- with the distribution.
2066
-
2067
- * The names of the contributors may not be used to endorse or
2068
- promote products derived from this software without specific
2069
- prior written permission.
2070
-
2071
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2072
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2073
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2074
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2075
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2076
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2077
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2078
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2079
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2080
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2081
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2082
-
2083
- ```
2084
-
2085
2046
  ## subtle 2.5.0
2086
2047
 
2087
2048
  ```
@@ -2116,7 +2077,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2116
2077
 
2117
2078
  ```
2118
2079
 
2119
- ## curve25519-dalek 4.1.1
2080
+ ## curve25519-dalek 4.1.3
2120
2081
 
2121
2082
  ```
2122
2083
  Copyright (c) 2016-2021 isis agora lovecruft. All rights reserved.
@@ -2585,7 +2546,7 @@ DEALINGS IN THE SOFTWARE.
2585
2546
 
2586
2547
  ```
2587
2548
 
2588
- ## lazy_static 1.4.0, rayon 1.10.0, rayon-core 1.12.1
2549
+ ## lazy_static 1.4.0, rayon-core 1.12.1, rayon 1.10.0
2589
2550
 
2590
2551
  ```
2591
2552
  Copyright (c) 2010 The Rust Project Developers
@@ -2616,7 +2577,7 @@ DEALINGS IN THE SOFTWARE.
2616
2577
 
2617
2578
  ```
2618
2579
 
2619
- ## core-foundation 0.9.4, core-foundation-sys 0.8.6
2580
+ ## core-foundation-sys 0.8.6, core-foundation 0.9.4
2620
2581
 
2621
2582
  ```
2622
2583
  Copyright (c) 2012-2013 Mozilla Foundation
@@ -2854,6 +2815,37 @@ THE SOFTWARE.
2854
2815
 
2855
2816
  ```
2856
2817
 
2818
+ ## errno 0.3.9
2819
+
2820
+ ```
2821
+ Copyright (c) 2014 Chris Wong
2822
+
2823
+ Permission is hereby granted, free of charge, to any
2824
+ person obtaining a copy of this software and associated
2825
+ documentation files (the "Software"), to deal in the
2826
+ Software without restriction, including without
2827
+ limitation the rights to use, copy, modify, merge,
2828
+ publish, distribute, sublicense, and/or sell copies of
2829
+ the Software, and to permit persons to whom the Software
2830
+ is furnished to do so, subject to the following
2831
+ conditions:
2832
+
2833
+ The above copyright notice and this permission notice
2834
+ shall be included in all copies or substantial portions
2835
+ of the Software.
2836
+
2837
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
2838
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
2839
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
2840
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
2841
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
2842
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2843
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
2844
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2845
+ DEALINGS IN THE SOFTWARE.
2846
+
2847
+ ```
2848
+
2857
2849
  ## base64ct 1.6.0
2858
2850
 
2859
2851
  ```
@@ -2886,7 +2878,7 @@ DEALINGS IN THE SOFTWARE.
2886
2878
 
2887
2879
  ```
2888
2880
 
2889
- ## bitflags 2.5.0, glob 0.3.1, log 0.4.21, num-bigint 0.4.5, num-derive 0.4.2, num-integer 0.1.46, num-traits 0.2.19, range-map 0.2.0, regex 1.10.4, regex-automata 0.4.6, regex-syntax 0.8.3
2881
+ ## bitflags 2.5.0, glob 0.3.1, log 0.4.21, num-bigint 0.4.5, num-derive 0.4.2, num-integer 0.1.46, num-traits 0.2.19, range-map 0.2.0, regex-automata 0.4.6, regex-syntax 0.8.3, regex 1.10.4
2890
2882
 
2891
2883
  ```
2892
2884
  Copyright (c) 2014 The Rust Project Developers
@@ -3088,7 +3080,7 @@ THE SOFTWARE.
3088
3080
 
3089
3081
  ```
3090
3082
 
3091
- ## neon 1.0.0, neon-macros 1.0.0
3083
+ ## neon-macros 1.0.0, neon 1.0.0
3092
3084
 
3093
3085
  ```
3094
3086
  Copyright (c) 2015 David Herman
@@ -3547,7 +3539,7 @@ THE SOFTWARE.
3547
3539
 
3548
3540
  ```
3549
3541
 
3550
- ## futures 0.3.30, futures-channel 0.3.30, futures-core 0.3.30, futures-executor 0.3.30, futures-io 0.3.30, futures-macro 0.3.30, futures-sink 0.3.30, futures-task 0.3.30, futures-util 0.3.30
3542
+ ## futures-channel 0.3.30, futures-core 0.3.30, futures-executor 0.3.30, futures-io 0.3.30, futures-macro 0.3.30, futures-sink 0.3.30, futures-task 0.3.30, futures-util 0.3.30, futures 0.3.30
3551
3543
 
3552
3544
  ```
3553
3545
  Copyright (c) 2016 Alex Crichton
@@ -3672,7 +3664,7 @@ DEALINGS IN THE SOFTWARE.
3672
3664
 
3673
3665
  ```
3674
3666
 
3675
- ## rustls 0.23.8, rustls-native-certs 0.7.0, rustls-pemfile 2.1.2
3667
+ ## rustls-native-certs 0.7.0, rustls-pemfile 2.1.2, rustls 0.23.8
3676
3668
 
3677
3669
  ```
3678
3670
  Copyright (c) 2016 Joseph Birr-Pixton <jpixton@gmail.com>
@@ -4211,7 +4203,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4211
4203
 
4212
4204
  ```
4213
4205
 
4214
- ## foreign-types 0.5.0, foreign-types-macros 0.2.3, foreign-types-shared 0.3.1
4206
+ ## foreign-types-macros 0.2.3, foreign-types-shared 0.3.1, foreign-types 0.5.0
4215
4207
 
4216
4208
  ```
4217
4209
  Copyright (c) 2017 The foreign-types Developers
@@ -4392,37 +4384,6 @@ DEALINGS IN THE SOFTWARE.
4392
4384
 
4393
4385
  ```
4394
4386
 
4395
- ## libm 0.2.8
4396
-
4397
- ```
4398
- Copyright (c) 2018 Jorge Aparicio
4399
-
4400
- Permission is hereby granted, free of charge, to any
4401
- person obtaining a copy of this software and associated
4402
- documentation files (the "Software"), to deal in the
4403
- Software without restriction, including without
4404
- limitation the rights to use, copy, modify, merge,
4405
- publish, distribute, sublicense, and/or sell copies of
4406
- the Software, and to permit persons to whom the Software
4407
- is furnished to do so, subject to the following
4408
- conditions:
4409
-
4410
- The above copyright notice and this permission notice
4411
- shall be included in all copies or substantial portions
4412
- of the Software.
4413
-
4414
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
4415
- ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
4416
- TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
4417
- PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
4418
- SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
4419
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
4420
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
4421
- IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
4422
- DEALINGS IN THE SOFTWARE.
4423
-
4424
- ```
4425
-
4426
4387
  ## autocfg 1.3.0
4427
4388
 
4428
4389
  ```
@@ -4573,37 +4534,6 @@ DEALINGS IN THE SOFTWARE.
4573
4534
 
4574
4535
  ```
4575
4536
 
4576
- ## platforms 3.4.0
4577
-
4578
- ```
4579
- Copyright (c) 2018-2020 The Rust Secure Code Working Group
4580
-
4581
- Permission is hereby granted, free of charge, to any
4582
- person obtaining a copy of this software and associated
4583
- documentation files (the "Software"), to deal in the
4584
- Software without restriction, including without
4585
- limitation the rights to use, copy, modify, merge,
4586
- publish, distribute, sublicense, and/or sell copies of
4587
- the Software, and to permit persons to whom the Software
4588
- is furnished to do so, subject to the following
4589
- conditions:
4590
-
4591
- The above copyright notice and this permission notice
4592
- shall be included in all copies or substantial portions
4593
- of the Software.
4594
-
4595
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
4596
- ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
4597
- TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
4598
- PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
4599
- SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
4600
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
4601
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
4602
- IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
4603
- DEALINGS IN THE SOFTWARE.
4604
-
4605
- ```
4606
-
4607
4537
  ## cbc 0.1.2, ctr 0.9.2
4608
4538
 
4609
4539
  ```
@@ -4757,7 +4687,7 @@ DEALINGS IN THE SOFTWARE.
4757
4687
 
4758
4688
  ```
4759
4689
 
4760
- ## http-body 1.0.0, http-body-util 0.1.1
4690
+ ## http-body-util 0.1.1, http-body 1.0.0
4761
4691
 
4762
4692
  ```
4763
4693
  Copyright (c) 2019 Hyper Contributors
@@ -4819,7 +4749,7 @@ DEALINGS IN THE SOFTWARE.
4819
4749
 
4820
4750
  ```
4821
4751
 
4822
- ## protobuf 3.4.0, protobuf-codegen 3.4.0, protobuf-json-mapping 3.4.0, protobuf-parse 3.4.0, protobuf-support 3.4.0
4752
+ ## protobuf-codegen 3.4.0, protobuf-json-mapping 3.4.0, protobuf-parse 3.4.0, protobuf-support 3.4.0, protobuf 3.4.0
4823
4753
 
4824
4754
  ```
4825
4755
  Copyright (c) 2019 Stepan Koltsov
@@ -4874,7 +4804,7 @@ DEALINGS IN THE SOFTWARE.
4874
4804
 
4875
4805
  ```
4876
4806
 
4877
- ## aes-gcm 0.10.3, aes-gcm-siv 0.11.1, chacha20poly1305 0.10.1
4807
+ ## aes-gcm-siv 0.11.1, chacha20poly1305 0.10.1
4878
4808
 
4879
4809
  ```
4880
4810
  Copyright (c) 2019 The RustCrypto Project Developers
@@ -4937,7 +4867,7 @@ DEALINGS IN THE SOFTWARE.
4937
4867
 
4938
4868
  ```
4939
4869
 
4940
- ## tracing 0.1.40, tracing-attributes 0.1.27, tracing-core 0.1.32
4870
+ ## tracing-attributes 0.1.27, tracing-core 0.1.32, tracing 0.1.40
4941
4871
 
4942
4872
  ```
4943
4873
  Copyright (c) 2019 Tokio Contributors
@@ -5361,7 +5291,7 @@ SOFTWARE.
5361
5291
 
5362
5292
  ```
5363
5293
 
5364
- ## mediasan-common 0.5.1, mp4san 0.5.1, mp4san-derive 0.5.1, webpsan 0.5.1
5294
+ ## mediasan-common 0.5.1, mp4san-derive 0.5.1, mp4san 0.5.1, webpsan 0.5.1
5365
5295
 
5366
5296
  ```
5367
5297
  Copyright (c) 2022 jessa0
@@ -5492,7 +5422,7 @@ THE SOFTWARE.
5492
5422
 
5493
5423
  ```
5494
5424
 
5495
- ## tokio 1.37.0, tokio-macros 2.2.0, tokio-stream 0.1.15, tokio-util 0.7.11
5425
+ ## tokio-macros 2.2.0, tokio-stream 0.1.15, tokio-util 0.7.11, tokio 1.37.0
5496
5426
 
5497
5427
  ```
5498
5428
  Copyright (c) 2023 Tokio Contributors
@@ -5679,7 +5609,7 @@ DEALINGS IN THE SOFTWARE.
5679
5609
 
5680
5610
  ```
5681
5611
 
5682
- ## breakpad-symbols 0.20.0, minidump 0.20.0, minidump-common 0.20.0, minidump-processor 0.20.0, minidump-unwind 0.20.0
5612
+ ## breakpad-symbols 0.20.0, minidump-common 0.20.0, minidump-processor 0.20.0, minidump-unwind 0.20.0, minidump 0.20.0
5683
5613
 
5684
5614
  ```
5685
5615
  MIT License
@@ -5922,7 +5852,7 @@ SOFTWARE.
5922
5852
 
5923
5853
  ```
5924
5854
 
5925
- ## macro_rules_attribute 0.2.0, macro_rules_attribute-proc_macro 0.2.0
5855
+ ## macro_rules_attribute-proc_macro 0.2.0, macro_rules_attribute 0.2.0
5926
5856
 
5927
5857
  ```
5928
5858
  MIT License
@@ -6191,7 +6121,7 @@ SOFTWARE.
6191
6121
 
6192
6122
  ```
6193
6123
 
6194
- ## cesu8 1.1.0, curve25519-dalek-derive 0.1.0, half 2.4.1, pqcrypto-internals 0.2.5, pqcrypto-kyber 0.7.9, pqcrypto-kyber 0.8.1, pqcrypto-traits 0.3.5, rustls-platform-verifier 0.3.1, rustls-platform-verifier-android 0.1.0
6124
+ ## cesu8 1.1.0, half 2.4.1, pqcrypto-internals 0.2.5, pqcrypto-kyber 0.7.9, pqcrypto-kyber 0.8.1, pqcrypto-traits 0.3.5, rustls-platform-verifier-android 0.1.0, rustls-platform-verifier 0.3.1
6195
6125
 
6196
6126
  ```
6197
6127
  MIT License
@@ -6305,7 +6235,7 @@ DEALINGS IN THE SOFTWARE.
6305
6235
 
6306
6236
  ```
6307
6237
 
6308
- ## adler 1.0.2, anyhow 1.0.86, async-trait 0.1.80, atomic-waker 1.1.2, dyn-clone 1.0.17, fastrand 2.1.0, home 0.5.9, is-terminal 0.4.12, itoa 1.0.11, linkme 0.3.26, linkme-impl 0.3.26, linux-raw-sys 0.4.14, minimal-lexical 0.2.1, num_enum 0.6.1, num_enum_derive 0.6.1, once_cell 1.19.0, paste 1.0.15, pin-project-lite 0.2.14, prettyplease 0.2.20, proc-macro-crate 1.3.1, proc-macro2 1.0.83, quote 1.0.36, rustc-hash 1.1.0, rustix 0.38.34, rustversion 1.0.17, semver 1.0.23, send_wrapper 0.6.0, serde 1.0.202, serde_derive 1.0.202, serde_json 1.0.117, syn 1.0.109, syn 2.0.66, syn-mid 0.6.0, thiserror 1.0.61, thiserror-impl 1.0.61, unicode-ident 1.0.12, utf-8 0.7.6
6238
+ ## curve25519-dalek-derive 0.1.1, adler 1.0.2, anyhow 1.0.86, async-trait 0.1.80, atomic-waker 1.1.2, dyn-clone 1.0.17, fastrand 2.1.0, home 0.5.9, is-terminal 0.4.12, itoa 1.0.11, linkme-impl 0.3.26, linkme 0.3.26, linux-raw-sys 0.4.14, minimal-lexical 0.2.1, num_enum 0.6.1, num_enum_derive 0.6.1, once_cell 1.19.0, paste 1.0.15, pin-project-lite 0.2.14, prettyplease 0.2.20, proc-macro-crate 1.3.1, proc-macro2 1.0.83, quote 1.0.36, rustc-hash 1.1.0, rustix 0.38.34, rustversion 1.0.17, semver 1.0.23, send_wrapper 0.6.0, serde 1.0.202, serde_derive 1.0.202, serde_json 1.0.117, syn-mid 0.6.0, syn 1.0.109, syn 2.0.66, thiserror-impl 1.0.61, thiserror 1.0.61, unicode-ident 1.0.12, utf-8 0.7.6
6309
6239
 
6310
6240
  ```
6311
6241
  Permission is hereby granted, free of charge, to any
@@ -6641,7 +6571,7 @@ THE SOFTWARE.
6641
6571
 
6642
6572
  ```
6643
6573
 
6644
- ## security-framework 2.11.0, security-framework-sys 2.11.0
6574
+ ## security-framework-sys 2.11.0, security-framework 2.11.0
6645
6575
 
6646
6576
  ```
6647
6577
  The MIT License (MIT)
@@ -6923,7 +6853,7 @@ DEALINGS IN THE SOFTWARE.
6923
6853
 
6924
6854
  ```
6925
6855
 
6926
- ## dyn-clonable 0.9.0, dyn-clonable-impl 0.9.0
6856
+ ## dyn-clonable-impl 0.9.0, dyn-clonable 0.9.0
6927
6857
 
6928
6858
  ```
6929
6859
  The MIT License (MIT)
package/dist/net.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  import type { ReadonlyDeep } from 'type-fest';
3
3
  import * as Native from '../Native';
4
4
  import { Wrapper } from '../Native';
5
+ import { Buffer } from 'node:buffer';
5
6
  export declare enum Environment {
6
7
  Staging = 0,
7
8
  Production = 1
@@ -42,6 +43,41 @@ export declare class TokioAsyncContext {
42
43
  constructor(handle: Native.TokioAsyncContext);
43
44
  makeCancellable<T>(abortSignal: AbortSignal | undefined, promise: Promise<T>): Promise<T>;
44
45
  }
46
+ export declare class ChatServerMessageAck {
47
+ private readonly asyncContext;
48
+ readonly _nativeHandle: Native.ServerMessageAck;
49
+ private promise;
50
+ constructor(asyncContext: TokioAsyncContext, _nativeHandle: Native.ServerMessageAck);
51
+ send(): Promise<void>;
52
+ }
53
+ export interface ChatServiceListener {
54
+ /**
55
+ * Called when the server delivers an incoming message to the client.
56
+ *
57
+ * `timestamp` is in milliseconds.
58
+ *
59
+ * If `ack`'s `send` method is not called, the server will leave this message in the message
60
+ * queue and attempt to deliver it again in the future.
61
+ */
62
+ onIncomingMessage(envelope: Buffer, timestamp: number, ack: ChatServerMessageAck): void;
63
+ /**
64
+ * Called when the server indicates that there are no further messages in the message queue.
65
+ *
66
+ * Note that further messages may still be delivered; this merely indicates that all messages that
67
+ * were in the queue *when the connection was established* have been delivered.
68
+ */
69
+ onQueueEmpty(): void;
70
+ /**
71
+ * Called when the client gets disconnected from the server.
72
+ *
73
+ * This includes both deliberate disconnects as well as unexpected socket closures that will be
74
+ * automatically retried.
75
+ *
76
+ * Will not be called if no other requests have been invoked for this connection attempt. That is,
77
+ * you should never see this as the first callback, nor two of these callbacks in a row.
78
+ */
79
+ onConnectionInterrupted(): void;
80
+ }
45
81
  /**
46
82
  * Provides API methods to connect and communicate with the Chat Service.
47
83
  * Before using either authenticated or unauthenticated channels,
@@ -50,8 +86,19 @@ export declare class TokioAsyncContext {
50
86
  */
51
87
  export declare class ChatService {
52
88
  private readonly asyncContext;
53
- private readonly chatService;
89
+ readonly chatService: Wrapper<Native.Chat>;
54
90
  constructor(asyncContext: TokioAsyncContext, connectionManager: ConnectionManager);
91
+ /**
92
+ * Sets the listener for server push messages on the authenticated connection.
93
+ *
94
+ * Note that this creates a **non-garbage-collectable** reference to `listener`. If `listener`
95
+ * contains a reference to this ChatService (directly or indirectly), both objects will be kept
96
+ * alive even with no other references. This may be fine if `listener` is a long-lived object
97
+ * anyway, but if not, make sure to eventually break the cycle, possibly by calling
98
+ * {@link #clearListener}.
99
+ */
100
+ setListener(listener: ChatServiceListener): void;
101
+ clearListener(): void;
55
102
  /**
56
103
  * Initiates termination of the underlying connection to the Chat Service. After the service is
57
104
  * disconnected, it will not attempt to automatically reconnect until you call
@@ -80,6 +127,7 @@ export declare class ChatService {
80
127
  * reconnect attempt will be made.
81
128
  *
82
129
  * Calling this method will result in starting to accept incoming requests from the Chat Service.
130
+ * You should set a listener first using {@link #setListener()}.
83
131
  *
84
132
  * @throws {AppExpiredError} if the current app version is too old (as judged by the server).
85
133
  * @throws {DeviceDelinkedError} if the current device has been delinked.
package/dist/net.js CHANGED
@@ -4,9 +4,10 @@
4
4
  // SPDX-License-Identifier: AGPL-3.0-only
5
5
  //
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.RestoredSecret = exports.Net = exports.ChatService = exports.TokioAsyncContext = exports.Environment = void 0;
7
+ exports.RestoredSecret = exports.Net = exports.ChatService = exports.ChatServerMessageAck = exports.TokioAsyncContext = exports.Environment = void 0;
8
8
  const Native = require("../Native");
9
9
  const Address_1 = require("./Address");
10
+ const node_buffer_1 = require("node:buffer");
10
11
  const DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS = 5000;
11
12
  // This must match the libsignal-bridge Rust enum of the same name.
12
13
  var Environment;
@@ -43,6 +44,20 @@ class TokioAsyncContext {
43
44
  }
44
45
  }
45
46
  exports.TokioAsyncContext = TokioAsyncContext;
47
+ class ChatServerMessageAck {
48
+ constructor(asyncContext, _nativeHandle) {
49
+ this.asyncContext = asyncContext;
50
+ this._nativeHandle = _nativeHandle;
51
+ this.promise = null;
52
+ }
53
+ send() {
54
+ if (!this.promise) {
55
+ this.promise = Native.ServerMessageAck_Send(this.asyncContext, this);
56
+ }
57
+ return this.promise;
58
+ }
59
+ }
60
+ exports.ChatServerMessageAck = ChatServerMessageAck;
46
61
  /**
47
62
  * Provides API methods to connect and communicate with the Chat Service.
48
63
  * Before using either authenticated or unauthenticated channels,
@@ -54,6 +69,33 @@ class ChatService {
54
69
  this.asyncContext = asyncContext;
55
70
  this.chatService = newNativeHandle(Native.ChatService_new(connectionManager, '', ''));
56
71
  }
72
+ /**
73
+ * Sets the listener for server push messages on the authenticated connection.
74
+ *
75
+ * Note that this creates a **non-garbage-collectable** reference to `listener`. If `listener`
76
+ * contains a reference to this ChatService (directly or indirectly), both objects will be kept
77
+ * alive even with no other references. This may be fine if `listener` is a long-lived object
78
+ * anyway, but if not, make sure to eventually break the cycle, possibly by calling
79
+ * {@link #clearListener}.
80
+ */
81
+ setListener(listener) {
82
+ const asyncContext = this.asyncContext;
83
+ const nativeChatListener = {
84
+ _incoming_message(envelope, timestamp, ack) {
85
+ listener.onIncomingMessage(envelope, timestamp, new ChatServerMessageAck(asyncContext, ack));
86
+ },
87
+ _queue_empty() {
88
+ listener.onQueueEmpty();
89
+ },
90
+ _connection_interrupted() {
91
+ listener.onConnectionInterrupted();
92
+ },
93
+ };
94
+ Native.ChatServer_SetListener(asyncContext, this.chatService, nativeChatListener);
95
+ }
96
+ clearListener() {
97
+ Native.ChatServer_SetListener(this.asyncContext, this.chatService, null);
98
+ }
57
99
  /**
58
100
  * Initiates termination of the underlying connection to the Chat Service. After the service is
59
101
  * disconnected, it will not attempt to automatically reconnect until you call
@@ -84,6 +126,7 @@ class ChatService {
84
126
  * reconnect attempt will be made.
85
127
  *
86
128
  * Calling this method will result in starting to accept incoming requests from the Chat Service.
129
+ * You should set a listener first using {@link #setListener()}.
87
130
  *
88
131
  * @throws {AppExpiredError} if the current app version is too old (as judged by the server).
89
132
  * @throws {DeviceDelinkedError} if the current device has been delinked.
@@ -136,7 +179,7 @@ class ChatService {
136
179
  }
137
180
  static buildHttpRequest(chatRequest) {
138
181
  const { verb, path, body, headers } = chatRequest;
139
- const bodyBuffer = body !== undefined ? Buffer.from(body) : null;
182
+ const bodyBuffer = body !== undefined ? node_buffer_1.Buffer.from(body) : null;
140
183
  const httpRequest = {
141
184
  _nativeHandle: Native.HttpRequest_new(verb, path, bodyBuffer),
142
185
  };
@@ -195,7 +238,7 @@ class Net {
195
238
  Native.LookupRequest_addE164(request, e164);
196
239
  });
197
240
  acisAndAccessKeys.forEach(({ aci: aciStr, accessKey: accessKeyStr }) => {
198
- Native.LookupRequest_addAciAndAccessKey(request, Address_1.Aci.parseFromServiceIdString(aciStr).getServiceIdFixedWidthBinary(), Buffer.from(accessKeyStr, 'base64'));
241
+ Native.LookupRequest_addAciAndAccessKey(request, Address_1.Aci.parseFromServiceIdString(aciStr).getServiceIdFixedWidthBinary(), node_buffer_1.Buffer.from(accessKeyStr, 'base64'));
199
242
  });
200
243
  Native.LookupRequest_setReturnAcisWithoutUaks(request, returnAcisWithoutUaks);
201
244
  const lookup = await this.asyncContext.makeCancellable(abortSignal, Native.CdsiLookup_new(this.asyncContext, this.connectionManager, username, password, request));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/libsignal-client",
3
- "version": "0.50.0",
3
+ "version": "0.51.1",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,6 +19,7 @@
19
19
  "scripts": {
20
20
  "install": "node-gyp-build",
21
21
  "build": "node-gyp build",
22
+ "build-with-debug-level-logs": "npx --libsignal-debug-level-logs node-gyp build",
22
23
  "tsc": "tsc -b",
23
24
  "clean": "rimraf dist build prebuilds",
24
25
  "test": "mocha --recursive dist/test --require source-map-support/register",
@@ -39,6 +40,8 @@
39
40
  "@types/chance": "^1.1.3",
40
41
  "@types/mocha": "^5.2.7",
41
42
  "@types/node": "~18.15.0",
43
+ "@types/sinon": "^17.0.3",
44
+ "@types/sinon-chai": "^3.2.12",
42
45
  "@types/uuid": "^8.3.0",
43
46
  "@typescript-eslint/eslint-plugin": "^5.47.0",
44
47
  "@typescript-eslint/parser": "^5.47.0",
@@ -54,9 +57,11 @@
54
57
  "eslint-plugin-more": "^1.0.0",
55
58
  "mocha": "^9",
56
59
  "node-gyp": "^10.0.0",
57
- "prebuildify": "^5.0.1",
60
+ "prebuildify": "^6.0.0",
58
61
  "prettier": "^2.7.1",
59
62
  "rimraf": "^3.0.1",
63
+ "sinon": "^18.0.0",
64
+ "sinon-chai": "^3.7.0",
60
65
  "source-map-support": "^0.5.19",
61
66
  "typescript": "4.9.3"
62
67
  }
index 7d27d28..0a69bc9 100644
Binary file
index d3efeb0..3f9883d 100644
Binary file
index 5eea665..95beb74 100644
Binary file
index 4a814df..27f4462 100644
Binary file
index f3a9e21..3bacaab 100644
Binary file
index fd5274c..c6059fb 100644
Binary file