@signalapp/libsignal-client 0.72.0 → 0.73.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 +11 -12
- package/dist/acknowledgments.md +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -7
- package/dist/net/KeyTransparency.js +1 -3
- package/dist/net/Registration.d.ts +12 -1
- package/dist/net/Registration.js +23 -13
- package/dist/net.d.ts +2 -4
- package/dist/net.js +2 -4
- 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
|
@@ -349,7 +349,7 @@ export function KeyTransparency_AciSearchKey(aci: Buffer): Buffer;
|
|
|
349
349
|
export function KeyTransparency_Distinguished(asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, lastDistinguishedTreeHead: Buffer | null): CancellablePromise<Buffer>;
|
|
350
350
|
export function KeyTransparency_E164SearchKey(e164: string): Buffer;
|
|
351
351
|
export function KeyTransparency_Monitor(asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, aci: Buffer, aciIdentityKey: Wrapper<PublicKey>, e164: string | null, unidentifiedAccessKey: Buffer | null, usernameHash: Buffer | null, accountData: Buffer | null, lastDistinguishedTreeHead: Buffer): CancellablePromise<Buffer>;
|
|
352
|
-
export function KeyTransparency_Search(asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, aci: Buffer, aciIdentityKey: Wrapper<PublicKey>, e164: string | null, unidentifiedAccessKey: Buffer | null, usernameHash: Buffer | null, accountData: Buffer | null, lastDistinguishedTreeHead: Buffer): CancellablePromise<
|
|
352
|
+
export function KeyTransparency_Search(asyncRuntime: Wrapper<TokioAsyncContext>, environment: number, chatConnection: Wrapper<UnauthenticatedChatConnection>, aci: Buffer, aciIdentityKey: Wrapper<PublicKey>, e164: string | null, unidentifiedAccessKey: Buffer | null, usernameHash: Buffer | null, accountData: Buffer | null, lastDistinguishedTreeHead: Buffer): CancellablePromise<Buffer>;
|
|
353
353
|
export function KeyTransparency_UsernameHashSearchKey(hash: Buffer): Buffer;
|
|
354
354
|
export function KyberKeyPair_Generate(): KyberKeyPair;
|
|
355
355
|
export function KyberKeyPair_GetPublicKey(keyPair: Wrapper<KyberKeyPair>): KyberPublicKey;
|
|
@@ -389,8 +389,8 @@ export function PlaintextContent_GetBody(obj: Wrapper<PlaintextContent>): Buffer
|
|
|
389
389
|
export function PlaintextContent_Serialize(obj: Wrapper<PlaintextContent>): Buffer;
|
|
390
390
|
export function PreKeyBundle_GetDeviceId(obj: Wrapper<PreKeyBundle>): number;
|
|
391
391
|
export function PreKeyBundle_GetIdentityKey(p: Wrapper<PreKeyBundle>): PublicKey;
|
|
392
|
-
export function PreKeyBundle_GetKyberPreKeyId(
|
|
393
|
-
export function PreKeyBundle_GetKyberPreKeyPublic(bundle: Wrapper<PreKeyBundle>): KyberPublicKey
|
|
392
|
+
export function PreKeyBundle_GetKyberPreKeyId(bundle: Wrapper<PreKeyBundle>): number;
|
|
393
|
+
export function PreKeyBundle_GetKyberPreKeyPublic(bundle: Wrapper<PreKeyBundle>): KyberPublicKey;
|
|
394
394
|
export function PreKeyBundle_GetKyberPreKeySignature(bundle: Wrapper<PreKeyBundle>): Buffer;
|
|
395
395
|
export function PreKeyBundle_GetPreKeyId(obj: Wrapper<PreKeyBundle>): number | null;
|
|
396
396
|
export function PreKeyBundle_GetPreKeyPublic(obj: Wrapper<PreKeyBundle>): PublicKey | null;
|
|
@@ -398,7 +398,7 @@ export function PreKeyBundle_GetRegistrationId(obj: Wrapper<PreKeyBundle>): numb
|
|
|
398
398
|
export function PreKeyBundle_GetSignedPreKeyId(obj: Wrapper<PreKeyBundle>): number;
|
|
399
399
|
export function PreKeyBundle_GetSignedPreKeyPublic(obj: Wrapper<PreKeyBundle>): PublicKey;
|
|
400
400
|
export function PreKeyBundle_GetSignedPreKeySignature(obj: Wrapper<PreKeyBundle>): Buffer;
|
|
401
|
-
export function PreKeyBundle_New(registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper<PublicKey> | null, signedPrekeyId: number, signedPrekey: Wrapper<PublicKey>, signedPrekeySignature: Buffer, identityKey: Wrapper<PublicKey>, kyberPrekeyId: number
|
|
401
|
+
export function PreKeyBundle_New(registrationId: number, deviceId: number, prekeyId: number | null, prekey: Wrapper<PublicKey> | null, signedPrekeyId: number, signedPrekey: Wrapper<PublicKey>, signedPrekeySignature: Buffer, identityKey: Wrapper<PublicKey>, kyberPrekeyId: number, kyberPrekey: Wrapper<KyberPublicKey>, kyberPrekeySignature: Buffer): PreKeyBundle;
|
|
402
402
|
export function PreKeyRecord_Deserialize(data: Buffer): PreKeyRecord;
|
|
403
403
|
export function PreKeyRecord_GetId(obj: Wrapper<PreKeyRecord>): number;
|
|
404
404
|
export function PreKeyRecord_GetPrivateKey(obj: Wrapper<PreKeyRecord>): PrivateKey;
|
|
@@ -465,13 +465,14 @@ export function RegisterAccountResponse_GetReregistration(response: Wrapper<Regi
|
|
|
465
465
|
export function RegisterAccountResponse_GetStorageCapable(response: Wrapper<RegisterAccountResponse>): boolean;
|
|
466
466
|
export function RegisterAccountResponse_GetUsernameHash(response: Wrapper<RegisterAccountResponse>): Buffer | null;
|
|
467
467
|
export function RegisterAccountResponse_GetUsernameLinkHandle(response: Wrapper<RegisterAccountResponse>): Uuid | null;
|
|
468
|
-
export function RegistrationAccountAttributes_Create(recoveryPassword: Buffer, aciRegistrationId: number, pniRegistrationId: number, registrationLock: string | null, unidentifiedAccessKey: Buffer
|
|
468
|
+
export function RegistrationAccountAttributes_Create(recoveryPassword: Buffer, aciRegistrationId: number, pniRegistrationId: number, registrationLock: string | null, unidentifiedAccessKey: Buffer, unrestrictedUnidentifiedAccess: boolean, capabilities: string[], discoverableByPhoneNumber: boolean): RegistrationAccountAttributes;
|
|
469
469
|
export function RegistrationService_CheckSvr2Credentials(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, svrTokens: string[]): CancellablePromise<CheckSvr2CredentialsResponse>;
|
|
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
473
|
export function RegistrationService_RequestPushChallenge(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, pushToken: string, pushTokenType: RegistrationPushTokenType): CancellablePromise<void>;
|
|
474
474
|
export function RegistrationService_RequestVerificationCode(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, transport: string, client: string, languages: string[]): CancellablePromise<void>;
|
|
475
|
+
export function RegistrationService_ReregisterAccount(asyncRuntime: Wrapper<TokioAsyncContext>, connectChat: ConnectChatBridge, number: string, registerAccount: Wrapper<RegisterAccountRequest>, accountAttributes: Wrapper<RegistrationAccountAttributes>): CancellablePromise<RegisterAccountResponse>;
|
|
475
476
|
export function RegistrationService_ResumeSession(asyncRuntime: Wrapper<TokioAsyncContext>, sessionId: string, number: string, connectChat: ConnectChatBridge): CancellablePromise<RegistrationService>;
|
|
476
477
|
export function RegistrationService_SessionId(service: Wrapper<RegistrationService>): string;
|
|
477
478
|
export function RegistrationService_SubmitCaptcha(asyncRuntime: Wrapper<TokioAsyncContext>, service: Wrapper<RegistrationService>, captchaValue: string): CancellablePromise<void>;
|
|
@@ -497,11 +498,6 @@ export function SealedSender_DecryptToUsmc(ctext: Buffer, identityStore: Identit
|
|
|
497
498
|
export function SealedSender_Encrypt(destination: Wrapper<ProtocolAddress>, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
|
|
498
499
|
export function SealedSender_MultiRecipientEncrypt(recipients: Wrapper<ProtocolAddress>[], recipientSessions: Wrapper<SessionRecord>[], excludedRecipients: Buffer, content: Wrapper<UnidentifiedSenderMessageContent>, identityKeyStore: IdentityKeyStore): Promise<Buffer>;
|
|
499
500
|
export function SealedSender_MultiRecipientMessageForSingleRecipient(encodedMultiRecipientMessage: Buffer): Buffer;
|
|
500
|
-
export function SearchResult_GetAccountData(res: Wrapper<SearchResult>): Buffer;
|
|
501
|
-
export function SearchResult_GetAciForE164(res: Wrapper<SearchResult>): Buffer | null;
|
|
502
|
-
export function SearchResult_GetAciForUsernameHash(res: Wrapper<SearchResult>): Buffer | null;
|
|
503
|
-
export function SearchResult_GetAciIdentityKey(res: Wrapper<SearchResult>): PublicKey;
|
|
504
|
-
export function SearchResult_GetTimestamp(res: Wrapper<SearchResult>): bigint;
|
|
505
501
|
export function SenderCertificate_Deserialize(data: Buffer): SenderCertificate;
|
|
506
502
|
export function SenderCertificate_GetCertificate(obj: Wrapper<SenderCertificate>): Buffer;
|
|
507
503
|
export function SenderCertificate_GetDeviceId(obj: Wrapper<SenderCertificate>): number;
|
|
@@ -634,14 +630,16 @@ export function TESTING_FakeChatSentRequest_TakeHttpRequest(request: Wrapper<Fak
|
|
|
634
630
|
export function TESTING_FakeChatServer_Create(): FakeChatServer;
|
|
635
631
|
export function TESTING_FakeChatServer_GetNextRemote(asyncRuntime: Wrapper<TokioAsyncContext>, server: Wrapper<FakeChatServer>): CancellablePromise<FakeChatRemoteEnd>;
|
|
636
632
|
export function TESTING_FakeRegistrationSession_CreateSession(asyncRuntime: Wrapper<TokioAsyncContext>, createSession: RegistrationCreateSessionRequest, chat: Wrapper<FakeChatServer>): CancellablePromise<RegistrationService>;
|
|
633
|
+
export function TESTING_FutureCancellationCounter_Create(initialValue: number): TestingFutureCancellationCounter;
|
|
634
|
+
export function TESTING_FutureCancellationCounter_WaitForCount(asyncRuntime: Wrapper<TokioAsyncContext>, count: Wrapper<TestingFutureCancellationCounter>, target: number): CancellablePromise<void>;
|
|
637
635
|
export function TESTING_FutureFailure(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: number): CancellablePromise<number>;
|
|
636
|
+
export function TESTING_FutureIncrementOnCancel(asyncRuntime: Wrapper<TokioAsyncContext>, _guard: TestingFutureCancellationGuard): CancellablePromise<void>;
|
|
638
637
|
export function TESTING_FutureProducesOtherPointerType(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: string): CancellablePromise<OtherTestingHandleType>;
|
|
639
638
|
export function TESTING_FutureProducesPointerType(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: number): CancellablePromise<TestingHandleType>;
|
|
640
639
|
export function TESTING_FutureSuccess(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, input: number): CancellablePromise<number>;
|
|
641
640
|
export function TESTING_InputStreamReadIntoZeroLengthSlice(capsAlphabetInput: InputStream): Promise<Buffer>;
|
|
642
641
|
export function TESTING_JoinStringArray(array: string[], joinWith: string): string;
|
|
643
642
|
export function TESTING_NonSuspendingBackgroundThreadRuntime_New(): NonSuspendingBackgroundThreadRuntime;
|
|
644
|
-
export function TESTING_OnlyCompletesByCancellation(asyncRuntime: Wrapper<TokioAsyncContext>): CancellablePromise<void>;
|
|
645
643
|
export function TESTING_OtherTestingHandleType_getValue(handle: Wrapper<OtherTestingHandleType>): string;
|
|
646
644
|
export function TESTING_PanicInBodyAsync(_input: null): Promise<void>;
|
|
647
645
|
export function TESTING_PanicInBodyIo(asyncRuntime: Wrapper<NonSuspendingBackgroundThreadRuntime>, _input: null): CancellablePromise<void>;
|
|
@@ -675,6 +673,7 @@ export function TESTING_RoundTripU8(input: number): number;
|
|
|
675
673
|
export function TESTING_ServerMessageAck_Create(): ServerMessageAck;
|
|
676
674
|
export function TESTING_SignedPublicPreKey_CheckBridgesCorrectly(sourcePublicKey: Wrapper<PublicKey>, signedPreKey: SignedPublicPreKey): void;
|
|
677
675
|
export function TESTING_TestingHandleType_getValue(handle: Wrapper<TestingHandleType>): number;
|
|
676
|
+
export function TESTING_TokioAsyncFuture(asyncRuntime: Wrapper<TokioAsyncContext>, input: number): CancellablePromise<number>;
|
|
678
677
|
export function TokioAsyncContext_cancel(context: Wrapper<TokioAsyncContext>, rawCancellationId: bigint): void;
|
|
679
678
|
export function TokioAsyncContext_new(): TokioAsyncContext;
|
|
680
679
|
export function UnauthenticatedChatConnection_connect(asyncRuntime: Wrapper<TokioAsyncContext>, connectionManager: Wrapper<ConnectionManager>): CancellablePromise<UnauthenticatedChatConnection>;
|
|
@@ -762,7 +761,6 @@ interface RegistrationService { readonly __type: unique symbol; }
|
|
|
762
761
|
interface RegistrationSession { readonly __type: unique symbol; }
|
|
763
762
|
interface SanitizedMetadata { readonly __type: unique symbol; }
|
|
764
763
|
interface SealedSenderDecryptionResult { readonly __type: unique symbol; }
|
|
765
|
-
interface SearchResult { readonly __type: unique symbol; }
|
|
766
764
|
interface SenderCertificate { readonly __type: unique symbol; }
|
|
767
765
|
interface SenderKeyDistributionMessage { readonly __type: unique symbol; }
|
|
768
766
|
interface SenderKeyMessage { readonly __type: unique symbol; }
|
|
@@ -775,6 +773,7 @@ interface SessionRecord { readonly __type: unique symbol; }
|
|
|
775
773
|
interface SgxClientState { readonly __type: unique symbol; }
|
|
776
774
|
interface SignalMessage { readonly __type: unique symbol; }
|
|
777
775
|
interface SignedPreKeyRecord { readonly __type: unique symbol; }
|
|
776
|
+
interface TestingFutureCancellationCounter { readonly __type: unique symbol; }
|
|
778
777
|
interface TestingHandleType { readonly __type: unique symbol; }
|
|
779
778
|
interface TokioAsyncContext { readonly __type: unique symbol; }
|
|
780
779
|
interface UnauthenticatedChatConnection { readonly __type: unique symbol; }
|
package/dist/acknowledgments.md
CHANGED
|
@@ -4503,7 +4503,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
4503
4503
|
|
|
4504
4504
|
```
|
|
4505
4505
|
|
|
4506
|
-
## tungstenite 0.21.0, tungstenite 0.
|
|
4506
|
+
## tungstenite 0.21.0, tungstenite 0.26.2
|
|
4507
4507
|
|
|
4508
4508
|
```
|
|
4509
4509
|
Copyright (c) 2017 Alexey Galakhov
|
|
@@ -4622,7 +4622,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
4622
4622
|
|
|
4623
4623
|
```
|
|
4624
4624
|
|
|
4625
|
-
## tokio-tungstenite 0.21.0, tokio-tungstenite 0.
|
|
4625
|
+
## tokio-tungstenite 0.21.0, tokio-tungstenite 0.26.2
|
|
4626
4626
|
|
|
4627
4627
|
```
|
|
4628
4628
|
Copyright (c) 2017 Daniel Abramov
|
package/dist/index.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export type SignedKyberPublicPreKey = {
|
|
|
91
91
|
export declare class PreKeyBundle {
|
|
92
92
|
readonly _nativeHandle: Native.PreKeyBundle;
|
|
93
93
|
private constructor();
|
|
94
|
-
static new(registration_id: number, device_id: number, prekey_id: number | null, prekey: PublicKey | null, signed_prekey_id: number, signed_prekey: PublicKey, signed_prekey_signature: Buffer, identity_key: PublicKey, kyber_prekey_id
|
|
94
|
+
static new(registration_id: number, device_id: number, prekey_id: number | null, prekey: PublicKey | null, signed_prekey_id: number, signed_prekey: PublicKey, signed_prekey_signature: Buffer, identity_key: PublicKey, kyber_prekey_id: number, kyber_prekey: KEMPublicKey, kyber_prekey_signature: Buffer): PreKeyBundle;
|
|
95
95
|
deviceId(): number;
|
|
96
96
|
identityKey(): PublicKey;
|
|
97
97
|
preKeyId(): number | null;
|
|
@@ -100,9 +100,9 @@ export declare class PreKeyBundle {
|
|
|
100
100
|
signedPreKeyId(): number;
|
|
101
101
|
signedPreKeyPublic(): PublicKey;
|
|
102
102
|
signedPreKeySignature(): Buffer;
|
|
103
|
-
kyberPreKeyId(): number
|
|
104
|
-
kyberPreKeyPublic(): KEMPublicKey
|
|
105
|
-
kyberPreKeySignature(): Buffer
|
|
103
|
+
kyberPreKeyId(): number;
|
|
104
|
+
kyberPreKeyPublic(): KEMPublicKey;
|
|
105
|
+
kyberPreKeySignature(): Buffer;
|
|
106
106
|
}
|
|
107
107
|
export declare class PreKeyRecord {
|
|
108
108
|
readonly _nativeHandle: Native.PreKeyRecord;
|
package/dist/index.js
CHANGED
|
@@ -168,9 +168,7 @@ class PreKeyBundle {
|
|
|
168
168
|
this._nativeHandle = handle;
|
|
169
169
|
}
|
|
170
170
|
static new(registration_id, device_id, prekey_id, prekey, signed_prekey_id, signed_prekey, signed_prekey_signature, identity_key, kyber_prekey_id, kyber_prekey, kyber_prekey_signature) {
|
|
171
|
-
return new PreKeyBundle(Native.PreKeyBundle_New(registration_id, device_id, prekey_id, prekey
|
|
172
|
-
//prekey?,
|
|
173
|
-
signed_prekey_id, signed_prekey, signed_prekey_signature, identity_key, kyber_prekey_id ?? null, kyber_prekey ?? null, kyber_prekey_signature ?? Buffer.alloc(0)));
|
|
171
|
+
return new PreKeyBundle(Native.PreKeyBundle_New(registration_id, device_id, prekey_id, prekey, signed_prekey_id, signed_prekey, signed_prekey_signature, identity_key, kyber_prekey_id, kyber_prekey, kyber_prekey_signature));
|
|
174
172
|
}
|
|
175
173
|
deviceId() {
|
|
176
174
|
return Native.PreKeyBundle_GetDeviceId(this);
|
|
@@ -206,12 +204,10 @@ class PreKeyBundle {
|
|
|
206
204
|
return Native.PreKeyBundle_GetKyberPreKeyId(this);
|
|
207
205
|
}
|
|
208
206
|
kyberPreKeyPublic() {
|
|
209
|
-
|
|
210
|
-
return handle == null ? null : KEMPublicKey._fromNativeHandle(handle);
|
|
207
|
+
return KEMPublicKey._fromNativeHandle(Native.PreKeyBundle_GetKyberPreKeyPublic(this));
|
|
211
208
|
}
|
|
212
209
|
kyberPreKeySignature() {
|
|
213
|
-
|
|
214
|
-
return buf.length == 0 ? null : buf;
|
|
210
|
+
return Native.PreKeyBundle_GetKyberPreKeySignature(this);
|
|
215
211
|
}
|
|
216
212
|
}
|
|
217
213
|
exports.PreKeyBundle = PreKeyBundle;
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ClientImpl = void 0;
|
|
8
8
|
const Native = require("../../Native");
|
|
9
|
-
const internal_1 = require("../internal");
|
|
10
9
|
class ClientImpl {
|
|
11
10
|
constructor(asyncContext, chatService, env) {
|
|
12
11
|
this.asyncContext = asyncContext;
|
|
@@ -21,8 +20,7 @@ class ClientImpl {
|
|
|
21
20
|
e164: null,
|
|
22
21
|
unidentifiedAccessKey: null,
|
|
23
22
|
};
|
|
24
|
-
const
|
|
25
|
-
const accountData = Native.SearchResult_GetAccountData((0, internal_1.newNativeHandle)(searchResultHandle));
|
|
23
|
+
const accountData = await this.asyncContext.makeCancellable(abortSignal, Native.KeyTransparency_Search(this.asyncContext, this.env, this.chatService, aci.getServiceIdFixedWidthBinary(), aciIdentityKey, e164, unidentifiedAccessKey, usernameHash ?? null, await store.getAccountData(aci), distinguished));
|
|
26
24
|
await store.setAccountData(aci, accountData);
|
|
27
25
|
}
|
|
28
26
|
async monitor(request, store, options) {
|
|
@@ -9,7 +9,6 @@ type ConnectionManager = Native.Wrapper<Native.ConnectionManager>;
|
|
|
9
9
|
type RegistrationOptions = {
|
|
10
10
|
tokioAsyncContext: TokioAsyncContext;
|
|
11
11
|
connectionManager: ConnectionManager;
|
|
12
|
-
connectionTimeoutMillis?: number;
|
|
13
12
|
};
|
|
14
13
|
export type RegistrationSessionState = {
|
|
15
14
|
allowedToRequestCode: boolean;
|
|
@@ -101,6 +100,18 @@ export declare class RegistrationService {
|
|
|
101
100
|
aciPqLastResortPreKey: SignedKyberPublicPreKey;
|
|
102
101
|
pniPqLastResortPreKey: SignedKyberPublicPreKey;
|
|
103
102
|
}): Promise<RegisterAccountResponse>;
|
|
103
|
+
static reregisterAccount(options: ReadonlyDeep<RegistrationOptions>, inputs: {
|
|
104
|
+
e164: string;
|
|
105
|
+
accountPassword: string;
|
|
106
|
+
skipDeviceTransfer: boolean;
|
|
107
|
+
accountAttributes: AccountAttributes;
|
|
108
|
+
aciPublicKey: PublicKey;
|
|
109
|
+
pniPublicKey: PublicKey;
|
|
110
|
+
aciSignedPreKey: SignedPublicPreKey;
|
|
111
|
+
pniSignedPreKey: SignedPublicPreKey;
|
|
112
|
+
aciPqLastResortPreKey: SignedKyberPublicPreKey;
|
|
113
|
+
pniPqLastResortPreKey: SignedKyberPublicPreKey;
|
|
114
|
+
}): Promise<RegisterAccountResponse>;
|
|
104
115
|
/**
|
|
105
116
|
* Internal, only public for testing
|
|
106
117
|
*/
|
package/dist/net/Registration.js
CHANGED
|
@@ -87,19 +87,13 @@ class RegistrationService {
|
|
|
87
87
|
return Native.RegistrationService_CheckSvr2Credentials(this.tokioAsyncContext, this, svr2Tokens);
|
|
88
88
|
}
|
|
89
89
|
async registerAccount(inputs) {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Native.
|
|
97
|
-
Native.RegisterAccountRequest_SetIdentityPublicKey(args, Address_1.ServiceIdKind.Pni, pniPublicKey);
|
|
98
|
-
Native.RegisterAccountRequest_SetIdentitySignedPreKey(args, Address_1.ServiceIdKind.Aci, toBridgedPublicPreKey(aciSignedPreKey));
|
|
99
|
-
Native.RegisterAccountRequest_SetIdentitySignedPreKey(args, Address_1.ServiceIdKind.Pni, toBridgedPublicPreKey(pniSignedPreKey));
|
|
100
|
-
Native.RegisterAccountRequest_SetIdentityPqLastResortPreKey(args, Address_1.ServiceIdKind.Aci, toBridgedPublicPreKey(aciPqLastResortPreKey));
|
|
101
|
-
Native.RegisterAccountRequest_SetIdentityPqLastResortPreKey(args, Address_1.ServiceIdKind.Pni, toBridgedPublicPreKey(pniPqLastResortPreKey));
|
|
102
|
-
return new RegisterAccountResponse(await Native.RegistrationService_RegisterAccount(this.tokioAsyncContext, this, args, accountAttributes));
|
|
90
|
+
const request = new RegisterAccountRequest(inputs);
|
|
91
|
+
return new RegisterAccountResponse(await Native.RegistrationService_RegisterAccount(this.tokioAsyncContext, this, request, inputs.accountAttributes));
|
|
92
|
+
}
|
|
93
|
+
static async reregisterAccount(options, inputs) {
|
|
94
|
+
const { tokioAsyncContext, connectionManager } = options;
|
|
95
|
+
const request = new RegisterAccountRequest(inputs);
|
|
96
|
+
return new RegisterAccountResponse(await Native.RegistrationService_ReregisterAccount(tokioAsyncContext, connectionManager, inputs.e164, request, inputs.accountAttributes));
|
|
103
97
|
}
|
|
104
98
|
/**
|
|
105
99
|
* Internal, only public for testing
|
|
@@ -191,4 +185,20 @@ class RegisterAccountResponse {
|
|
|
191
185
|
}
|
|
192
186
|
}
|
|
193
187
|
exports.RegisterAccountResponse = RegisterAccountResponse;
|
|
188
|
+
class RegisterAccountRequest {
|
|
189
|
+
constructor(inputs) {
|
|
190
|
+
const { accountPassword, skipDeviceTransfer, aciPublicKey, pniPublicKey, aciSignedPreKey, pniSignedPreKey, aciPqLastResortPreKey, pniPqLastResortPreKey, } = inputs;
|
|
191
|
+
this._nativeHandle = Native.RegisterAccountRequest_Create();
|
|
192
|
+
Native.RegisterAccountRequest_SetAccountPassword(this, accountPassword);
|
|
193
|
+
if (skipDeviceTransfer) {
|
|
194
|
+
Native.RegisterAccountRequest_SetSkipDeviceTransfer(this);
|
|
195
|
+
}
|
|
196
|
+
Native.RegisterAccountRequest_SetIdentityPublicKey(this, Address_1.ServiceIdKind.Aci, aciPublicKey);
|
|
197
|
+
Native.RegisterAccountRequest_SetIdentityPublicKey(this, Address_1.ServiceIdKind.Pni, pniPublicKey);
|
|
198
|
+
Native.RegisterAccountRequest_SetIdentitySignedPreKey(this, Address_1.ServiceIdKind.Aci, toBridgedPublicPreKey(aciSignedPreKey));
|
|
199
|
+
Native.RegisterAccountRequest_SetIdentitySignedPreKey(this, Address_1.ServiceIdKind.Pni, toBridgedPublicPreKey(pniSignedPreKey));
|
|
200
|
+
Native.RegisterAccountRequest_SetIdentityPqLastResortPreKey(this, Address_1.ServiceIdKind.Aci, toBridgedPublicPreKey(aciPqLastResortPreKey));
|
|
201
|
+
Native.RegisterAccountRequest_SetIdentityPqLastResortPreKey(this, Address_1.ServiceIdKind.Pni, toBridgedPublicPreKey(pniPqLastResortPreKey));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
194
204
|
//# sourceMappingURL=Registration.js.map
|
package/dist/net.d.ts
CHANGED
|
@@ -90,14 +90,12 @@ export declare class Net {
|
|
|
90
90
|
connectAuthenticatedChat(username: string, password: string, receiveStories: boolean, listener: ChatServiceListener, options?: {
|
|
91
91
|
abortSignal?: AbortSignal;
|
|
92
92
|
}): Promise<AuthenticatedChatConnection>;
|
|
93
|
-
resumeRegistrationSession({ sessionId, e164,
|
|
93
|
+
resumeRegistrationSession({ sessionId, e164, }: {
|
|
94
94
|
sessionId: string;
|
|
95
95
|
e164: string;
|
|
96
|
-
connectionTimeoutMillis?: number;
|
|
97
96
|
}): Promise<RegistrationService>;
|
|
98
|
-
createRegistrationSession({ e164,
|
|
97
|
+
createRegistrationSession({ e164, }: {
|
|
99
98
|
e164: string;
|
|
100
|
-
connectionTimeoutMillis?: number;
|
|
101
99
|
}): Promise<RegistrationService>;
|
|
102
100
|
/**
|
|
103
101
|
* Enables/disables IPv6 for all new connections (until changed).
|
package/dist/net.js
CHANGED
|
@@ -100,18 +100,16 @@ class Net {
|
|
|
100
100
|
connectAuthenticatedChat(username, password, receiveStories, listener, options) {
|
|
101
101
|
return Chat_1.AuthenticatedChatConnection.connect(this.asyncContext, this._connectionManager, username, password, receiveStories, listener, options);
|
|
102
102
|
}
|
|
103
|
-
async resumeRegistrationSession({ sessionId, e164,
|
|
103
|
+
async resumeRegistrationSession({ sessionId, e164, }) {
|
|
104
104
|
return Registration_1.RegistrationService.resumeSession({
|
|
105
105
|
connectionManager: this._connectionManager,
|
|
106
106
|
tokioAsyncContext: this.asyncContext,
|
|
107
|
-
connectionTimeoutMillis: connectionTimeoutMillis,
|
|
108
107
|
}, { sessionId, e164 });
|
|
109
108
|
}
|
|
110
|
-
async createRegistrationSession({ e164,
|
|
109
|
+
async createRegistrationSession({ e164, }) {
|
|
111
110
|
return Registration_1.RegistrationService.createSession({
|
|
112
111
|
connectionManager: this._connectionManager,
|
|
113
112
|
tokioAsyncContext: this.asyncContext,
|
|
114
|
-
connectionTimeoutMillis: connectionTimeoutMillis,
|
|
115
113
|
}, { e164 });
|
|
116
114
|
}
|
|
117
115
|
/**
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|