@signalapp/libsignal-client 0.79.0 → 0.80.0
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 +2 -1
- package/dist/Errors.d.ts +6 -2
- package/dist/Errors.js +1 -0
- package/dist/acknowledgments.md +38 -10
- package/dist/incremental_mac.js +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.js +22 -1
- package/dist/net/Chat.d.ts +7 -8
- package/dist/net/Chat.js +9 -7
- package/dist/net/chat/UnauthUsernamesService.d.ts +20 -0
- package/dist/net/chat/UnauthUsernamesService.js +14 -0
- package/dist/net.d.ts +1 -0
- package/dist/net.js +1 -0
- 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
|
@@ -516,7 +516,7 @@ export function SenderCertificate_GetSerialized(obj: Wrapper<SenderCertificate>)
|
|
|
516
516
|
export function SenderCertificate_GetServerCertificate(cert: Wrapper<SenderCertificate>): ServerCertificate;
|
|
517
517
|
export function SenderCertificate_GetSignature(obj: Wrapper<SenderCertificate>): Uint8Array;
|
|
518
518
|
export function SenderCertificate_New(senderUuid: string, senderE164: string | null, senderDeviceId: number, senderKey: Wrapper<PublicKey>, expiration: Timestamp, signerCert: Wrapper<ServerCertificate>, signerKey: Wrapper<PrivateKey>): SenderCertificate;
|
|
519
|
-
export function SenderCertificate_Validate(cert: Wrapper<SenderCertificate>,
|
|
519
|
+
export function SenderCertificate_Validate(cert: Wrapper<SenderCertificate>, trustRoots: Wrapper<PublicKey>[], time: Timestamp): boolean;
|
|
520
520
|
export function SenderKeyDistributionMessage_Create(sender: Wrapper<ProtocolAddress>, distributionId: Uuid, store: SenderKeyStore): Promise<SenderKeyDistributionMessage>;
|
|
521
521
|
export function SenderKeyDistributionMessage_Deserialize(data: Uint8Array): SenderKeyDistributionMessage;
|
|
522
522
|
export function SenderKeyDistributionMessage_GetChainId(obj: Wrapper<SenderKeyDistributionMessage>): number;
|
|
@@ -700,6 +700,7 @@ export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<Toki
|
|
|
700
700
|
export function UnauthenticatedChatConnection_disconnect(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>): CancellablePromise<void>;
|
|
701
701
|
export function UnauthenticatedChatConnection_info(chat: Wrapper<UnauthenticatedChatConnection>): ChatConnectionInfo;
|
|
702
702
|
export function UnauthenticatedChatConnection_init_listener(chat: Wrapper<UnauthenticatedChatConnection>, listener: ChatListener): void;
|
|
703
|
+
export function UnauthenticatedChatConnection_look_up_username_hash(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, hash: Uint8Array): CancellablePromise<Uuid | null>;
|
|
703
704
|
export function UnauthenticatedChatConnection_send(asyncRuntime: Wrapper<TokioAsyncContext>, chat: Wrapper<UnauthenticatedChatConnection>, httpRequest: Wrapper<HttpRequest>, timeoutMillis: number): CancellablePromise<ChatResponse>;
|
|
704
705
|
export function UnidentifiedSenderMessageContent_Deserialize(data: Uint8Array): UnidentifiedSenderMessageContent;
|
|
705
706
|
export function UnidentifiedSenderMessageContent_GetContentHint(m: Wrapper<UnidentifiedSenderMessageContent>): number;
|
package/dist/Errors.d.ts
CHANGED
|
@@ -45,7 +45,8 @@ export declare enum ErrorCode {
|
|
|
45
45
|
BackupValidation = 41,
|
|
46
46
|
Cancelled = 42,
|
|
47
47
|
KeyTransparencyError = 43,
|
|
48
|
-
KeyTransparencyVerificationFailed = 44
|
|
48
|
+
KeyTransparencyVerificationFailed = 44,
|
|
49
|
+
IncrementalMacVerificationFailed = 45
|
|
49
50
|
}
|
|
50
51
|
export declare class LibSignalErrorBase extends Error {
|
|
51
52
|
readonly code: ErrorCode;
|
|
@@ -207,4 +208,7 @@ export type KeyTransparencyError = LibSignalErrorCommon & {
|
|
|
207
208
|
export type KeyTransparencyVerificationFailed = LibSignalErrorCommon & {
|
|
208
209
|
code: ErrorCode.KeyTransparencyVerificationFailed;
|
|
209
210
|
};
|
|
210
|
-
export type
|
|
211
|
+
export type IncrementalMacVerificationFailed = LibSignalErrorCommon & {
|
|
212
|
+
code: ErrorCode.IncrementalMacVerificationFailed;
|
|
213
|
+
};
|
|
214
|
+
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 | SvrAttestationError | SvrInvalidDataError | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | ConnectionInvalidatedError | ConnectedElsewhereError | RateLimitedError | RateLimitChallengeError | BackupValidationError | CancellationError | KeyTransparencyError | KeyTransparencyVerificationFailed | IncrementalMacVerificationFailed;
|
package/dist/Errors.js
CHANGED
|
@@ -53,6 +53,7 @@ var ErrorCode;
|
|
|
53
53
|
ErrorCode[ErrorCode["Cancelled"] = 42] = "Cancelled";
|
|
54
54
|
ErrorCode[ErrorCode["KeyTransparencyError"] = 43] = "KeyTransparencyError";
|
|
55
55
|
ErrorCode[ErrorCode["KeyTransparencyVerificationFailed"] = 44] = "KeyTransparencyVerificationFailed";
|
|
56
|
+
ErrorCode[ErrorCode["IncrementalMacVerificationFailed"] = 45] = "IncrementalMacVerificationFailed";
|
|
56
57
|
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
57
58
|
class LibSignalErrorBase extends Error {
|
|
58
59
|
constructor(message, name, operation, extraProps) {
|
package/dist/acknowledgments.md
CHANGED
|
@@ -2591,7 +2591,7 @@ limitations under the License.
|
|
|
2591
2591
|
|
|
2592
2592
|
```
|
|
2593
2593
|
|
|
2594
|
-
## boring 4.
|
|
2594
|
+
## boring 4.18.0
|
|
2595
2595
|
|
|
2596
2596
|
```
|
|
2597
2597
|
Copyright 2011-2017 Google Inc.
|
|
@@ -2613,7 +2613,7 @@ limitations under the License.
|
|
|
2613
2613
|
|
|
2614
2614
|
```
|
|
2615
2615
|
|
|
2616
|
-
## bindgen 0.
|
|
2616
|
+
## bindgen 0.72.0
|
|
2617
2617
|
|
|
2618
2618
|
```
|
|
2619
2619
|
BSD 3-Clause License
|
|
@@ -2883,7 +2883,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
2883
2883
|
|
|
2884
2884
|
```
|
|
2885
2885
|
|
|
2886
|
-
## boring-sys 4.
|
|
2886
|
+
## boring-sys 4.18.0
|
|
2887
2887
|
|
|
2888
2888
|
```
|
|
2889
2889
|
/* Copyright (c) 2015, Google Inc.
|
|
@@ -3192,7 +3192,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
3192
3192
|
|
|
3193
3193
|
```
|
|
3194
3194
|
|
|
3195
|
-
## boring-sys 4.
|
|
3195
|
+
## boring-sys 4.18.0
|
|
3196
3196
|
|
|
3197
3197
|
```
|
|
3198
3198
|
Copyright (c) 2014 Alex Crichton
|
|
@@ -3488,7 +3488,7 @@ THE SOFTWARE.
|
|
|
3488
3488
|
|
|
3489
3489
|
```
|
|
3490
3490
|
|
|
3491
|
-
## either 1.15.0, itertools 0.
|
|
3491
|
+
## either 1.15.0, itertools 0.10.5, itertools 0.14.0, petgraph 0.7.1, serde_with 3.12.0, serde_with_macros 3.12.0
|
|
3492
3492
|
|
|
3493
3493
|
```
|
|
3494
3494
|
Copyright (c) 2015
|
|
@@ -3732,7 +3732,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
3732
3732
|
|
|
3733
3733
|
```
|
|
3734
3734
|
|
|
3735
|
-
## boring-sys 4.
|
|
3735
|
+
## boring-sys 4.18.0
|
|
3736
3736
|
|
|
3737
3737
|
```
|
|
3738
3738
|
Copyright (c) 2015-2016 the fiat-crypto authors (see
|
|
@@ -4095,7 +4095,7 @@ SOFTWARE.
|
|
|
4095
4095
|
|
|
4096
4096
|
```
|
|
4097
4097
|
|
|
4098
|
-
## tokio-boring 4.
|
|
4098
|
+
## tokio-boring 4.18.0
|
|
4099
4099
|
|
|
4100
4100
|
```
|
|
4101
4101
|
Copyright (c) 2016 Tokio contributors
|
|
@@ -6481,7 +6481,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
6481
6481
|
SOFTWARE.
|
|
6482
6482
|
```
|
|
6483
6483
|
|
|
6484
|
-
## snow 0.
|
|
6484
|
+
## snow 0.10.0
|
|
6485
6485
|
|
|
6486
6486
|
```
|
|
6487
6487
|
MIT License
|
|
@@ -6699,7 +6699,35 @@ SOFTWARE.
|
|
|
6699
6699
|
|
|
6700
6700
|
```
|
|
6701
6701
|
|
|
6702
|
-
##
|
|
6702
|
+
## rustc-hash 2.1.1
|
|
6703
|
+
|
|
6704
|
+
```
|
|
6705
|
+
Permission is hereby granted, free of charge, to any
|
|
6706
|
+
person obtaining a copy of this software and associated
|
|
6707
|
+
documentation files (the "Software"), to deal in the
|
|
6708
|
+
Software without restriction, including without
|
|
6709
|
+
limitation the rights to use, copy, modify, merge,
|
|
6710
|
+
publish, distribute, sublicense, and/or sell copies of
|
|
6711
|
+
the Software, and to permit persons to whom the Software
|
|
6712
|
+
is furnished to do so, subject to the following
|
|
6713
|
+
conditions:
|
|
6714
|
+
|
|
6715
|
+
The above copyright notice and this permission notice
|
|
6716
|
+
shall be included in all copies or substantial portions
|
|
6717
|
+
of the Software.
|
|
6718
|
+
|
|
6719
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
6720
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
6721
|
+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
6722
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
6723
|
+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
6724
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
6725
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
6726
|
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
6727
|
+
DEALINGS IN THE SOFTWARE.
|
|
6728
|
+
```
|
|
6729
|
+
|
|
6730
|
+
## curve25519-dalek-derive 0.1.1, adler2 2.0.0, anyhow 1.0.97, async-trait 0.1.88, atomic-waker 1.1.2, auto_enums 0.8.7, derive_utils 0.15.0, displaydoc 0.2.5, dyn-clone 1.0.19, fastrand 2.3.0, home 0.5.9, itoa 1.0.15, linkme-impl 0.3.33, linkme 0.3.33, linux-raw-sys 0.4.15, linux-raw-sys 0.9.3, minimal-lexical 0.2.1, num_enum 0.7.3, num_enum_derive 0.7.3, once_cell 1.21.3, paste 1.0.15, pin-project-internal 1.1.10, pin-project-lite 0.2.16, pin-project 1.1.10, prettyplease 0.2.32, proc-macro-crate 3.3.0, proc-macro2 1.0.94, quote 1.0.40, rustix 0.38.44, rustix 1.0.5, rustversion 1.0.20, semver 1.0.26, send_wrapper 0.6.0, serde 1.0.219, serde_derive 1.0.219, serde_json 1.0.140, syn-mid 0.6.0, syn 2.0.100, thiserror-impl 1.0.69, thiserror-impl 2.0.12, thiserror 1.0.69, thiserror 2.0.12, unicode-ident 1.0.18, utf-8 0.7.6
|
|
6703
6731
|
|
|
6704
6732
|
```
|
|
6705
6733
|
Permission is hereby granted, free of charge, to any
|
|
@@ -7628,7 +7656,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
|
|
|
7628
7656
|
|
|
7629
7657
|
```
|
|
7630
7658
|
|
|
7631
|
-
## boring-sys 4.
|
|
7659
|
+
## boring-sys 4.18.0
|
|
7632
7660
|
|
|
7633
7661
|
```
|
|
7634
7662
|
/* ====================================================================
|
package/dist/incremental_mac.js
CHANGED
|
@@ -182,6 +182,6 @@ function chunkSizeInBytes(sizeChoice) {
|
|
|
182
182
|
}
|
|
183
183
|
exports.chunkSizeInBytes = chunkSizeInBytes;
|
|
184
184
|
function makeVerificationError(message) {
|
|
185
|
-
return new Errors_1.LibSignalErrorBase(message, '
|
|
185
|
+
return new Errors_1.LibSignalErrorBase(message, 'IncrementalMacVerificationFailed', 'incremental_mac');
|
|
186
186
|
}
|
|
187
187
|
//# sourceMappingURL=incremental_mac.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -225,7 +225,21 @@ export declare class SenderCertificate {
|
|
|
225
225
|
senderDeviceId(): number;
|
|
226
226
|
serverCertificate(): ServerCertificate;
|
|
227
227
|
signature(): Uint8Array;
|
|
228
|
+
/**
|
|
229
|
+
* Validates `this` against the given trust root at the given current time.
|
|
230
|
+
*
|
|
231
|
+
* @see validateWithTrustRoots
|
|
232
|
+
*/
|
|
228
233
|
validate(trustRoot: PublicKey, time: number): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Validates `this` against the given trust roots at the given current time.
|
|
236
|
+
*
|
|
237
|
+
* Checks the certificate against each key in `trustRoots` in constant time (that is, no result
|
|
238
|
+
* is produced until every key is checked), making sure **one** of them has signed its embedded
|
|
239
|
+
* server certificate. The `time` parameter is compared numerically against ``expiration``, and
|
|
240
|
+
* is not required to use any specific units, but Signal uses milliseconds since 1970.
|
|
241
|
+
*/
|
|
242
|
+
validateWithTrustRoots(trustRoots: PublicKey[], time: number): boolean;
|
|
229
243
|
}
|
|
230
244
|
export declare class SenderKeyDistributionMessage {
|
|
231
245
|
readonly _nativeHandle: Native.SenderKeyDistributionMessage;
|
package/dist/index.js
CHANGED
|
@@ -505,8 +505,29 @@ class SenderCertificate {
|
|
|
505
505
|
signature() {
|
|
506
506
|
return Native.SenderCertificate_GetSignature(this);
|
|
507
507
|
}
|
|
508
|
+
/**
|
|
509
|
+
* Validates `this` against the given trust root at the given current time.
|
|
510
|
+
*
|
|
511
|
+
* @see validateWithTrustRoots
|
|
512
|
+
*/
|
|
508
513
|
validate(trustRoot, time) {
|
|
509
|
-
return Native.SenderCertificate_Validate(this, trustRoot, time);
|
|
514
|
+
return Native.SenderCertificate_Validate(this, [trustRoot], time);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Validates `this` against the given trust roots at the given current time.
|
|
518
|
+
*
|
|
519
|
+
* Checks the certificate against each key in `trustRoots` in constant time (that is, no result
|
|
520
|
+
* is produced until every key is checked), making sure **one** of them has signed its embedded
|
|
521
|
+
* server certificate. The `time` parameter is compared numerically against ``expiration``, and
|
|
522
|
+
* is not required to use any specific units, but Signal uses milliseconds since 1970.
|
|
523
|
+
*/
|
|
524
|
+
validateWithTrustRoots(trustRoots, time) {
|
|
525
|
+
try {
|
|
526
|
+
return Native.SenderCertificate_Validate(this, trustRoots, time);
|
|
527
|
+
}
|
|
528
|
+
catch (_error) {
|
|
529
|
+
return false;
|
|
530
|
+
}
|
|
510
531
|
}
|
|
511
532
|
}
|
|
512
533
|
exports.SenderCertificate = SenderCertificate;
|
package/dist/net/Chat.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export type ChatRequest = Readonly<{
|
|
|
10
10
|
body?: Uint8Array;
|
|
11
11
|
timeoutMillis?: number;
|
|
12
12
|
}>;
|
|
13
|
+
export type RequestOptions = {
|
|
14
|
+
abortSignal?: AbortSignal;
|
|
15
|
+
};
|
|
13
16
|
type ConnectionManager = Native.Wrapper<Native.ConnectionManager>;
|
|
14
17
|
export declare class ChatServerMessageAck {
|
|
15
18
|
readonly _nativeHandle: Native.ServerMessageAck;
|
|
@@ -65,9 +68,7 @@ export type ChatConnection = {
|
|
|
65
68
|
/**
|
|
66
69
|
* Sends request to the Chat service.
|
|
67
70
|
*/
|
|
68
|
-
fetch(chatRequest: ChatRequest, options?:
|
|
69
|
-
abortSignal?: AbortSignal;
|
|
70
|
-
}): Promise<Native.ChatResponse>;
|
|
71
|
+
fetch(chatRequest: ChatRequest, options?: RequestOptions): Promise<Native.ChatResponse>;
|
|
71
72
|
/**
|
|
72
73
|
* Information about the connection to the Chat service.
|
|
73
74
|
*/
|
|
@@ -79,8 +80,8 @@ export interface ConnectionInfo {
|
|
|
79
80
|
toString: () => string;
|
|
80
81
|
}
|
|
81
82
|
export declare class UnauthenticatedChatConnection implements ChatConnection {
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
readonly _asyncContext: TokioAsyncContext;
|
|
84
|
+
readonly _chatService: Wrapper<Native.UnauthenticatedChatConnection>;
|
|
84
85
|
private readonly chatListener;
|
|
85
86
|
private readonly env?;
|
|
86
87
|
static connect(asyncContext: TokioAsyncContext, connectionManager: ConnectionManager, listener: ConnectionEventsListener, env?: Environment, options?: {
|
|
@@ -97,9 +98,7 @@ export declare class UnauthenticatedChatConnection implements ChatConnection {
|
|
|
97
98
|
*/
|
|
98
99
|
static fakeConnect(asyncContext: TokioAsyncContext, listener: ChatServiceListener): [UnauthenticatedChatConnection, Wrapper<Native.FakeChatRemoteEnd>];
|
|
99
100
|
private constructor();
|
|
100
|
-
fetch(chatRequest: ChatRequest, options?:
|
|
101
|
-
abortSignal?: AbortSignal;
|
|
102
|
-
}): Promise<Native.ChatResponse>;
|
|
101
|
+
fetch(chatRequest: ChatRequest, options?: RequestOptions): Promise<Native.ChatResponse>;
|
|
103
102
|
disconnect(): Promise<void>;
|
|
104
103
|
connectionInfo(): ConnectionInfo;
|
|
105
104
|
keyTransparencyClient(): KT.Client;
|
package/dist/net/Chat.js
CHANGED
|
@@ -66,29 +66,31 @@ class UnauthenticatedChatConnection {
|
|
|
66
66
|
(0, internal_1.newNativeHandle)(Native.TESTING_FakeChatConnection_TakeRemote(fakeChat)),
|
|
67
67
|
];
|
|
68
68
|
}
|
|
69
|
-
constructor(
|
|
69
|
+
constructor(
|
|
70
|
+
// Not true-private so that they can be accessed by the "Service" interfaces in chat/.
|
|
71
|
+
_asyncContext, _chatService,
|
|
70
72
|
// Unused except to keep the listener alive since the Rust code only holds a
|
|
71
73
|
// weak reference to the same object.
|
|
72
74
|
chatListener, env) {
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
75
|
+
this._asyncContext = _asyncContext;
|
|
76
|
+
this._chatService = _chatService;
|
|
75
77
|
this.chatListener = chatListener;
|
|
76
78
|
this.env = env;
|
|
77
79
|
}
|
|
78
80
|
fetch(chatRequest, options) {
|
|
79
|
-
return this.
|
|
81
|
+
return this._asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_send(this._asyncContext, this._chatService, buildHttpRequest(chatRequest), chatRequest.timeoutMillis ?? DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS));
|
|
80
82
|
}
|
|
81
83
|
disconnect() {
|
|
82
|
-
return Native.UnauthenticatedChatConnection_disconnect(this.
|
|
84
|
+
return Native.UnauthenticatedChatConnection_disconnect(this._asyncContext, this._chatService);
|
|
83
85
|
}
|
|
84
86
|
connectionInfo() {
|
|
85
|
-
return new ConnectionInfoImpl(Native.UnauthenticatedChatConnection_info(this.
|
|
87
|
+
return new ConnectionInfoImpl(Native.UnauthenticatedChatConnection_info(this._chatService));
|
|
86
88
|
}
|
|
87
89
|
keyTransparencyClient() {
|
|
88
90
|
if (this.env == null) {
|
|
89
91
|
throw new Error('KeyTransparency is not supported on local test server');
|
|
90
92
|
}
|
|
91
|
-
return new KT.ClientImpl(this.
|
|
93
|
+
return new KT.ClientImpl(this._asyncContext, this._chatService, this.env);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
exports.UnauthenticatedChatConnection = UnauthenticatedChatConnection;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Aci } from '../../Address';
|
|
2
|
+
import { RequestOptions } from '../Chat';
|
|
3
|
+
declare module '../Chat' {
|
|
4
|
+
interface UnauthenticatedChatConnection extends UnauthUsernamesService {
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export interface UnauthUsernamesService {
|
|
8
|
+
/**
|
|
9
|
+
* Looks up a username hash on the service, like that computed by {@link usernames.hash}.
|
|
10
|
+
*
|
|
11
|
+
* Returns the corresponding account's ACI, or `null` if the username doesn't correspond to an
|
|
12
|
+
* account.
|
|
13
|
+
*
|
|
14
|
+
* Throws / completes with failure only if the request can't be completed, potentially including
|
|
15
|
+
* if the hash is structurally invalid.
|
|
16
|
+
*/
|
|
17
|
+
lookUpUsernameHash(request: {
|
|
18
|
+
hash: Uint8Array;
|
|
19
|
+
}, options?: RequestOptions): Promise<Aci | null>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//
|
|
3
|
+
// Copyright 2025 Signal Messenger, LLC.
|
|
4
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
|
+
//
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const Native = require("../../../Native");
|
|
8
|
+
const Address_1 = require("../../Address");
|
|
9
|
+
const Chat_1 = require("../Chat");
|
|
10
|
+
Chat_1.UnauthenticatedChatConnection.prototype.lookUpUsernameHash = async function ({ hash, }, options) {
|
|
11
|
+
const response = await this._asyncContext.makeCancellable(options?.abortSignal, Native.UnauthenticatedChatConnection_look_up_username_hash(this._asyncContext, this._chatService, Buffer.from(hash)));
|
|
12
|
+
return response ? Address_1.Aci.fromUuidBytes(response) : null;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=UnauthUsernamesService.js.map
|
package/dist/net.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { RegistrationService } from './net/Registration';
|
|
|
6
6
|
import { SvrB } from './net/SvrB';
|
|
7
7
|
export * from './net/CDSI';
|
|
8
8
|
export * from './net/Chat';
|
|
9
|
+
export * from './net/chat/UnauthUsernamesService';
|
|
9
10
|
export * from './net/Registration';
|
|
10
11
|
export * from './net/SvrB';
|
|
11
12
|
export declare enum Environment {
|
package/dist/net.js
CHANGED
|
@@ -27,6 +27,7 @@ const SvrB_1 = require("./net/SvrB");
|
|
|
27
27
|
const internal_1 = require("./internal");
|
|
28
28
|
__exportStar(require("./net/CDSI"), exports);
|
|
29
29
|
__exportStar(require("./net/Chat"), exports);
|
|
30
|
+
__exportStar(require("./net/chat/UnauthUsernamesService"), exports);
|
|
30
31
|
__exportStar(require("./net/Registration"), exports);
|
|
31
32
|
__exportStar(require("./net/SvrB"), exports);
|
|
32
33
|
// This must match the libsignal-bridge Rust enum of the same name.
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|