@signalapp/libsignal-client 0.74.0 → 0.75.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 +281 -281
- package/dist/AccountKeys.d.ts +7 -8
- package/dist/Address.d.ts +12 -9
- package/dist/Address.js +10 -6
- package/dist/EcKeys.d.ts +12 -13
- package/dist/Errors.d.ts +43 -37
- package/dist/Errors.js +37 -36
- package/dist/MessageBackup.d.ts +6 -7
- package/dist/Minidump.d.ts +1 -2
- package/dist/Mp4Sanitizer.d.ts +1 -2
- package/dist/SealedSenderMultiRecipientMessage.d.ts +3 -4
- package/dist/SealedSenderMultiRecipientMessage.js +4 -2
- package/dist/WebpSanitizer.d.ts +1 -2
- package/dist/acknowledgments.md +24 -631
- package/dist/incremental_mac.d.ts +5 -5
- package/dist/incremental_mac.js +3 -1
- package/dist/index.d.ts +90 -91
- package/dist/index.js +4 -4
- package/dist/io.d.ts +3 -5
- package/dist/net/Chat.d.ts +1 -3
- package/dist/net/Chat.js +1 -3
- package/dist/net/KeyTransparency.d.ts +6 -7
- package/dist/net/Registration.d.ts +2 -3
- package/dist/net/Registration.js +1 -1
- package/dist/net.d.ts +1 -3
- package/dist/usernames.d.ts +8 -9
- package/dist/usernames.js +2 -2
- package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -2
- package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -3
- package/dist/zkgroup/NotarySignature.d.ts +1 -2
- package/dist/zkgroup/ServerPublicParams.d.ts +4 -5
- package/dist/zkgroup/ServerPublicParams.js +1 -1
- package/dist/zkgroup/ServerSecretParams.d.ts +5 -6
- package/dist/zkgroup/ServerSecretParams.js +1 -1
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -2
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -2
- package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +1 -2
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +1 -2
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +3 -4
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +2 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +2 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +2 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +1 -1
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +2 -3
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +2 -3
- package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -2
- package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +2 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +3 -4
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +2 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +2 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +3 -4
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +3 -4
- package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -2
- package/dist/zkgroup/groups/GroupIdentifier.js +1 -1
- package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -2
- package/dist/zkgroup/groups/GroupPublicParams.d.ts +1 -2
- package/dist/zkgroup/groups/GroupSecretParams.d.ts +2 -3
- package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -2
- package/dist/zkgroup/groups/UuidCiphertext.d.ts +2 -3
- package/dist/zkgroup/groups/UuidCiphertext.js +2 -2
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +1 -2
- package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +1 -2
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +2 -3
- package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +1 -2
- package/dist/zkgroup/groupsend/GroupSendToken.d.ts +1 -2
- package/dist/zkgroup/internal/ByteArray.d.ts +5 -6
- package/dist/zkgroup/internal/ByteArray.js +2 -2
- package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +2 -3
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -2
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKey.d.ts +2 -3
- package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -2
- package/dist/zkgroup/profiles/ProfileKeyVersion.js +4 -2
- package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +1 -2
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +2 -3
- package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -2
- package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -2
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +1 -2
- package/package.json +2 -2
- 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
|
@@ -13,16 +13,16 @@ export declare function everyNthByte(n: number): ChunkSizeChoice;
|
|
|
13
13
|
export declare function inferChunkSize(dataSize: number): ChunkSizeChoice;
|
|
14
14
|
export declare class DigestingPassThrough extends stream.Transform {
|
|
15
15
|
private digester;
|
|
16
|
-
constructor(key:
|
|
17
|
-
getFinalDigest():
|
|
18
|
-
_transform(data:
|
|
16
|
+
constructor(key: Uint8Array, sizeChoice: ChunkSizeChoice);
|
|
17
|
+
getFinalDigest(): Uint8Array;
|
|
18
|
+
_transform(data: Uint8Array, enc: BufferEncoding, callback: CallbackType): void;
|
|
19
19
|
_final(callback: CallbackType): void;
|
|
20
20
|
}
|
|
21
21
|
export declare class ValidatingPassThrough extends stream.Transform {
|
|
22
22
|
private validator;
|
|
23
23
|
private buffer;
|
|
24
|
-
constructor(key:
|
|
25
|
-
_transform(data:
|
|
24
|
+
constructor(key: Uint8Array, sizeChoice: ChunkSizeChoice, digest: Uint8Array);
|
|
25
|
+
_transform(data: Uint8Array, enc: BufferEncoding, callback: CallbackType): void;
|
|
26
26
|
_final(callback: CallbackType): void;
|
|
27
27
|
}
|
|
28
28
|
export declare function chunkSizeInBytes(sizeChoice: ChunkSizeChoice): number;
|
package/dist/incremental_mac.js
CHANGED
|
@@ -23,7 +23,9 @@ class DigestingWritable extends stream.Writable {
|
|
|
23
23
|
this._nativeHandle = Native.IncrementalMac_Initialize(key, chunkSizeInBytes(sizeChoice));
|
|
24
24
|
}
|
|
25
25
|
getFinalDigest() {
|
|
26
|
-
|
|
26
|
+
// Use Buffer.concat for convenience, but return a proper Uint8Array, both for the correct type
|
|
27
|
+
// and to make an independent copy of a possibly-reused buffer.
|
|
28
|
+
return new Uint8Array(Buffer.concat(this._digests));
|
|
27
29
|
}
|
|
28
30
|
_write(
|
|
29
31
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export * from './Errors';
|
|
3
2
|
import { Aci, ProtocolAddress, ServiceId } from './Address';
|
|
4
3
|
export * from './Address';
|
|
@@ -30,13 +29,13 @@ export declare enum UsePQRatchet {
|
|
|
30
29
|
No = 1
|
|
31
30
|
}
|
|
32
31
|
export type Uuid = string;
|
|
33
|
-
export declare function hkdf(outputLength: number, keyMaterial:
|
|
32
|
+
export declare function hkdf(outputLength: number, keyMaterial: Uint8Array, label: Uint8Array, salt: Uint8Array | null): Uint8Array;
|
|
34
33
|
export declare class ScannableFingerprint {
|
|
35
34
|
private readonly scannable;
|
|
36
35
|
private constructor();
|
|
37
|
-
static _fromBuffer(scannable:
|
|
36
|
+
static _fromBuffer(scannable: Uint8Array): ScannableFingerprint;
|
|
38
37
|
compare(other: ScannableFingerprint): boolean;
|
|
39
|
-
toBuffer():
|
|
38
|
+
toBuffer(): Uint8Array;
|
|
40
39
|
}
|
|
41
40
|
export declare class DisplayableFingerprint {
|
|
42
41
|
private readonly display;
|
|
@@ -47,30 +46,30 @@ export declare class DisplayableFingerprint {
|
|
|
47
46
|
export declare class Fingerprint {
|
|
48
47
|
readonly _nativeHandle: Native.Fingerprint;
|
|
49
48
|
private constructor();
|
|
50
|
-
static new(iterations: number, version: number, localIdentifier:
|
|
49
|
+
static new(iterations: number, version: number, localIdentifier: Uint8Array, localKey: PublicKey, remoteIdentifier: Uint8Array, remoteKey: PublicKey): Fingerprint;
|
|
51
50
|
displayableFingerprint(): DisplayableFingerprint;
|
|
52
51
|
scannableFingerprint(): ScannableFingerprint;
|
|
53
52
|
}
|
|
54
53
|
export declare class Aes256GcmSiv {
|
|
55
54
|
readonly _nativeHandle: Native.Aes256GcmSiv;
|
|
56
55
|
private constructor();
|
|
57
|
-
static new(key:
|
|
58
|
-
encrypt(message:
|
|
59
|
-
decrypt(message:
|
|
56
|
+
static new(key: Uint8Array): Aes256GcmSiv;
|
|
57
|
+
encrypt(message: Uint8Array, nonce: Uint8Array, associated_data: Uint8Array): Uint8Array;
|
|
58
|
+
decrypt(message: Uint8Array, nonce: Uint8Array, associated_data: Uint8Array): Uint8Array;
|
|
60
59
|
}
|
|
61
60
|
export declare class KEMPublicKey {
|
|
62
61
|
readonly _nativeHandle: Native.KyberPublicKey;
|
|
63
62
|
private constructor();
|
|
64
63
|
static _fromNativeHandle(handle: Native.KyberPublicKey): KEMPublicKey;
|
|
65
|
-
static deserialize(buf:
|
|
66
|
-
serialize():
|
|
64
|
+
static deserialize(buf: Uint8Array): KEMPublicKey;
|
|
65
|
+
serialize(): Uint8Array;
|
|
67
66
|
}
|
|
68
67
|
export declare class KEMSecretKey {
|
|
69
68
|
readonly _nativeHandle: Native.KyberSecretKey;
|
|
70
69
|
private constructor();
|
|
71
70
|
static _fromNativeHandle(handle: Native.KyberSecretKey): KEMSecretKey;
|
|
72
|
-
static deserialize(buf:
|
|
73
|
-
serialize():
|
|
71
|
+
static deserialize(buf: Uint8Array): KEMSecretKey;
|
|
72
|
+
serialize(): Uint8Array;
|
|
74
73
|
}
|
|
75
74
|
export declare class KEMKeyPair {
|
|
76
75
|
readonly _nativeHandle: Native.KyberKeyPair;
|
|
@@ -84,18 +83,18 @@ export declare class KEMKeyPair {
|
|
|
84
83
|
export type SignedPublicPreKey = {
|
|
85
84
|
id(): number;
|
|
86
85
|
publicKey(): PublicKey;
|
|
87
|
-
signature():
|
|
86
|
+
signature(): Uint8Array;
|
|
88
87
|
};
|
|
89
88
|
/** The public information contained in a {@link KyberPreKeyRecord} */
|
|
90
89
|
export type SignedKyberPublicPreKey = {
|
|
91
90
|
id(): number;
|
|
92
91
|
publicKey(): KEMPublicKey;
|
|
93
|
-
signature():
|
|
92
|
+
signature(): Uint8Array;
|
|
94
93
|
};
|
|
95
94
|
export declare class PreKeyBundle {
|
|
96
95
|
readonly _nativeHandle: Native.PreKeyBundle;
|
|
97
96
|
private constructor();
|
|
98
|
-
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:
|
|
97
|
+
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: Uint8Array, identity_key: PublicKey, kyber_prekey_id: number, kyber_prekey: KEMPublicKey, kyber_prekey_signature: Uint8Array): PreKeyBundle;
|
|
99
98
|
deviceId(): number;
|
|
100
99
|
identityKey(): PublicKey;
|
|
101
100
|
preKeyId(): number | null;
|
|
@@ -103,78 +102,78 @@ export declare class PreKeyBundle {
|
|
|
103
102
|
registrationId(): number;
|
|
104
103
|
signedPreKeyId(): number;
|
|
105
104
|
signedPreKeyPublic(): PublicKey;
|
|
106
|
-
signedPreKeySignature():
|
|
105
|
+
signedPreKeySignature(): Uint8Array;
|
|
107
106
|
kyberPreKeyId(): number;
|
|
108
107
|
kyberPreKeyPublic(): KEMPublicKey;
|
|
109
|
-
kyberPreKeySignature():
|
|
108
|
+
kyberPreKeySignature(): Uint8Array;
|
|
110
109
|
}
|
|
111
110
|
export declare class PreKeyRecord {
|
|
112
111
|
readonly _nativeHandle: Native.PreKeyRecord;
|
|
113
112
|
private constructor();
|
|
114
113
|
static _fromNativeHandle(nativeHandle: Native.PreKeyRecord): PreKeyRecord;
|
|
115
114
|
static new(id: number, pubKey: PublicKey, privKey: PrivateKey): PreKeyRecord;
|
|
116
|
-
static deserialize(buffer:
|
|
115
|
+
static deserialize(buffer: Uint8Array): PreKeyRecord;
|
|
117
116
|
id(): number;
|
|
118
117
|
privateKey(): PrivateKey;
|
|
119
118
|
publicKey(): PublicKey;
|
|
120
|
-
serialize():
|
|
119
|
+
serialize(): Uint8Array;
|
|
121
120
|
}
|
|
122
121
|
export declare class SignedPreKeyRecord implements SignedPublicPreKey {
|
|
123
122
|
readonly _nativeHandle: Native.SignedPreKeyRecord;
|
|
124
123
|
private constructor();
|
|
125
124
|
static _fromNativeHandle(nativeHandle: Native.SignedPreKeyRecord): SignedPreKeyRecord;
|
|
126
|
-
static new(id: number, timestamp: number, pubKey: PublicKey, privKey: PrivateKey, signature:
|
|
127
|
-
static deserialize(buffer:
|
|
125
|
+
static new(id: number, timestamp: number, pubKey: PublicKey, privKey: PrivateKey, signature: Uint8Array): SignedPreKeyRecord;
|
|
126
|
+
static deserialize(buffer: Uint8Array): SignedPreKeyRecord;
|
|
128
127
|
id(): number;
|
|
129
128
|
privateKey(): PrivateKey;
|
|
130
129
|
publicKey(): PublicKey;
|
|
131
|
-
serialize():
|
|
132
|
-
signature():
|
|
130
|
+
serialize(): Uint8Array;
|
|
131
|
+
signature(): Uint8Array;
|
|
133
132
|
timestamp(): number;
|
|
134
133
|
}
|
|
135
134
|
export declare class KyberPreKeyRecord implements SignedKyberPublicPreKey {
|
|
136
135
|
readonly _nativeHandle: Native.KyberPreKeyRecord;
|
|
137
136
|
private constructor();
|
|
138
137
|
static _fromNativeHandle(nativeHandle: Native.KyberPreKeyRecord): KyberPreKeyRecord;
|
|
139
|
-
static new(id: number, timestamp: number, keyPair: KEMKeyPair, signature:
|
|
140
|
-
serialize():
|
|
141
|
-
static deserialize(buffer:
|
|
138
|
+
static new(id: number, timestamp: number, keyPair: KEMKeyPair, signature: Uint8Array): KyberPreKeyRecord;
|
|
139
|
+
serialize(): Uint8Array;
|
|
140
|
+
static deserialize(buffer: Uint8Array): KyberPreKeyRecord;
|
|
142
141
|
id(): number;
|
|
143
142
|
keyPair(): KEMKeyPair;
|
|
144
143
|
publicKey(): KEMPublicKey;
|
|
145
144
|
secretKey(): KEMSecretKey;
|
|
146
|
-
signature():
|
|
145
|
+
signature(): Uint8Array;
|
|
147
146
|
timestamp(): number;
|
|
148
147
|
}
|
|
149
148
|
export declare class SignalMessage {
|
|
150
149
|
readonly _nativeHandle: Native.SignalMessage;
|
|
151
150
|
private constructor();
|
|
152
|
-
static _new(messageVersion: number, macKey:
|
|
153
|
-
static deserialize(buffer:
|
|
154
|
-
body():
|
|
155
|
-
pqRatchet():
|
|
151
|
+
static _new(messageVersion: number, macKey: Uint8Array, senderRatchetKey: PublicKey, counter: number, previousCounter: number, ciphertext: Uint8Array, senderIdentityKey: PublicKey, receiverIdentityKey: PublicKey, pqRatchet: Uint8Array): SignalMessage;
|
|
152
|
+
static deserialize(buffer: Uint8Array): SignalMessage;
|
|
153
|
+
body(): Uint8Array;
|
|
154
|
+
pqRatchet(): Uint8Array;
|
|
156
155
|
counter(): number;
|
|
157
156
|
messageVersion(): number;
|
|
158
|
-
serialize():
|
|
159
|
-
verifyMac(senderIdentityKey: PublicKey, recevierIdentityKey: PublicKey, macKey:
|
|
157
|
+
serialize(): Uint8Array;
|
|
158
|
+
verifyMac(senderIdentityKey: PublicKey, recevierIdentityKey: PublicKey, macKey: Uint8Array): boolean;
|
|
160
159
|
}
|
|
161
160
|
export declare class PreKeySignalMessage {
|
|
162
161
|
readonly _nativeHandle: Native.PreKeySignalMessage;
|
|
163
162
|
private constructor();
|
|
164
163
|
static _new(messageVersion: number, registrationId: number, preKeyId: number | null, signedPreKeyId: number, baseKey: PublicKey, identityKey: PublicKey, signalMessage: SignalMessage): PreKeySignalMessage;
|
|
165
|
-
static deserialize(buffer:
|
|
164
|
+
static deserialize(buffer: Uint8Array): PreKeySignalMessage;
|
|
166
165
|
preKeyId(): number | null;
|
|
167
166
|
registrationId(): number;
|
|
168
167
|
signedPreKeyId(): number;
|
|
169
168
|
version(): number;
|
|
170
|
-
serialize():
|
|
169
|
+
serialize(): Uint8Array;
|
|
171
170
|
}
|
|
172
171
|
export declare class SessionRecord {
|
|
173
172
|
readonly _nativeHandle: Native.SessionRecord;
|
|
174
173
|
private constructor();
|
|
175
174
|
static _fromNativeHandle(nativeHandle: Native.SessionRecord): SessionRecord;
|
|
176
|
-
static deserialize(buffer:
|
|
177
|
-
serialize():
|
|
175
|
+
static deserialize(buffer: Uint8Array): SessionRecord;
|
|
176
|
+
serialize(): Uint8Array;
|
|
178
177
|
archiveCurrentState(): void;
|
|
179
178
|
localRegistrationId(): number;
|
|
180
179
|
remoteRegistrationId(): number;
|
|
@@ -191,28 +190,28 @@ export declare class ServerCertificate {
|
|
|
191
190
|
static _fromNativeHandle(nativeHandle: Native.ServerCertificate): ServerCertificate;
|
|
192
191
|
private constructor();
|
|
193
192
|
static new(keyId: number, serverKey: PublicKey, trustRoot: PrivateKey): ServerCertificate;
|
|
194
|
-
static deserialize(buffer:
|
|
195
|
-
certificateData():
|
|
193
|
+
static deserialize(buffer: Uint8Array): ServerCertificate;
|
|
194
|
+
certificateData(): Uint8Array;
|
|
196
195
|
key(): PublicKey;
|
|
197
196
|
keyId(): number;
|
|
198
|
-
serialize():
|
|
199
|
-
signature():
|
|
197
|
+
serialize(): Uint8Array;
|
|
198
|
+
signature(): Uint8Array;
|
|
200
199
|
}
|
|
201
200
|
export declare class SenderKeyRecord {
|
|
202
201
|
readonly _nativeHandle: Native.SenderKeyRecord;
|
|
203
202
|
static _fromNativeHandle(nativeHandle: Native.SenderKeyRecord): SenderKeyRecord;
|
|
204
203
|
private constructor();
|
|
205
|
-
static deserialize(buffer:
|
|
206
|
-
serialize():
|
|
204
|
+
static deserialize(buffer: Uint8Array): SenderKeyRecord;
|
|
205
|
+
serialize(): Uint8Array;
|
|
207
206
|
}
|
|
208
207
|
export declare class SenderCertificate {
|
|
209
208
|
readonly _nativeHandle: Native.SenderCertificate;
|
|
210
209
|
private constructor();
|
|
211
210
|
static _fromNativeHandle(nativeHandle: Native.SenderCertificate): SenderCertificate;
|
|
212
211
|
static new(senderUuid: string | Aci, senderE164: string | null, senderDeviceId: number, senderKey: PublicKey, expiration: number, signerCert: ServerCertificate, signerKey: PrivateKey): SenderCertificate;
|
|
213
|
-
static deserialize(buffer:
|
|
214
|
-
serialize():
|
|
215
|
-
certificate():
|
|
212
|
+
static deserialize(buffer: Uint8Array): SenderCertificate;
|
|
213
|
+
serialize(): Uint8Array;
|
|
214
|
+
certificate(): Uint8Array;
|
|
216
215
|
expiration(): number;
|
|
217
216
|
key(): PublicKey;
|
|
218
217
|
senderE164(): string | null;
|
|
@@ -225,17 +224,17 @@ export declare class SenderCertificate {
|
|
|
225
224
|
senderAci(): Aci | null;
|
|
226
225
|
senderDeviceId(): number;
|
|
227
226
|
serverCertificate(): ServerCertificate;
|
|
228
|
-
signature():
|
|
227
|
+
signature(): Uint8Array;
|
|
229
228
|
validate(trustRoot: PublicKey, time: number): boolean;
|
|
230
229
|
}
|
|
231
230
|
export declare class SenderKeyDistributionMessage {
|
|
232
231
|
readonly _nativeHandle: Native.SenderKeyDistributionMessage;
|
|
233
232
|
private constructor();
|
|
234
233
|
static create(sender: ProtocolAddress, distributionId: Uuid, store: SenderKeyStore): Promise<SenderKeyDistributionMessage>;
|
|
235
|
-
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainKey:
|
|
236
|
-
static deserialize(buffer:
|
|
237
|
-
serialize():
|
|
238
|
-
chainKey():
|
|
234
|
+
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, chainKey: Uint8Array, pk: PublicKey): SenderKeyDistributionMessage;
|
|
235
|
+
static deserialize(buffer: Uint8Array): SenderKeyDistributionMessage;
|
|
236
|
+
serialize(): Uint8Array;
|
|
237
|
+
chainKey(): Uint8Array;
|
|
239
238
|
iteration(): number;
|
|
240
239
|
chainId(): number;
|
|
241
240
|
distributionId(): Uuid;
|
|
@@ -244,10 +243,10 @@ export declare function processSenderKeyDistributionMessage(sender: ProtocolAddr
|
|
|
244
243
|
export declare class SenderKeyMessage {
|
|
245
244
|
readonly _nativeHandle: Native.SenderKeyMessage;
|
|
246
245
|
private constructor();
|
|
247
|
-
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext:
|
|
248
|
-
static deserialize(buffer:
|
|
249
|
-
serialize():
|
|
250
|
-
ciphertext():
|
|
246
|
+
static _new(messageVersion: number, distributionId: Uuid, chainId: number, iteration: number, ciphertext: Uint8Array, pk: PrivateKey): SenderKeyMessage;
|
|
247
|
+
static deserialize(buffer: Uint8Array): SenderKeyMessage;
|
|
248
|
+
serialize(): Uint8Array;
|
|
249
|
+
ciphertext(): Uint8Array;
|
|
251
250
|
iteration(): number;
|
|
252
251
|
chainId(): number;
|
|
253
252
|
distributionId(): Uuid;
|
|
@@ -257,14 +256,14 @@ export declare class UnidentifiedSenderMessageContent {
|
|
|
257
256
|
readonly _nativeHandle: Native.UnidentifiedSenderMessageContent;
|
|
258
257
|
private constructor();
|
|
259
258
|
static _fromNativeHandle(nativeHandle: Native.UnidentifiedSenderMessageContent): UnidentifiedSenderMessageContent;
|
|
260
|
-
static new(message: CiphertextMessage, sender: SenderCertificate, contentHint: number, groupId:
|
|
261
|
-
static deserialize(buffer:
|
|
262
|
-
serialize():
|
|
263
|
-
contents():
|
|
259
|
+
static new(message: CiphertextMessage, sender: SenderCertificate, contentHint: number, groupId: Uint8Array | null): UnidentifiedSenderMessageContent;
|
|
260
|
+
static deserialize(buffer: Uint8Array): UnidentifiedSenderMessageContent;
|
|
261
|
+
serialize(): Uint8Array;
|
|
262
|
+
contents(): Uint8Array;
|
|
264
263
|
msgType(): number;
|
|
265
264
|
senderCertificate(): SenderCertificate;
|
|
266
265
|
contentHint(): number;
|
|
267
|
-
groupId():
|
|
266
|
+
groupId(): Uint8Array | null;
|
|
268
267
|
}
|
|
269
268
|
export declare abstract class SessionStore implements Native.SessionStore {
|
|
270
269
|
_saveSession(name: Native.ProtocolAddress, record: Native.SessionRecord): Promise<void>;
|
|
@@ -317,13 +316,13 @@ export declare abstract class SenderKeyStore implements Native.SenderKeyStore {
|
|
|
317
316
|
abstract saveSenderKey(sender: ProtocolAddress, distributionId: Uuid, record: SenderKeyRecord): Promise<void>;
|
|
318
317
|
abstract getSenderKey(sender: ProtocolAddress, distributionId: Uuid): Promise<SenderKeyRecord | null>;
|
|
319
318
|
}
|
|
320
|
-
export declare function groupEncrypt(sender: ProtocolAddress, distributionId: Uuid, store: SenderKeyStore, message:
|
|
321
|
-
export declare function groupDecrypt(sender: ProtocolAddress, store: SenderKeyStore, message:
|
|
319
|
+
export declare function groupEncrypt(sender: ProtocolAddress, distributionId: Uuid, store: SenderKeyStore, message: Uint8Array): Promise<CiphertextMessage>;
|
|
320
|
+
export declare function groupDecrypt(sender: ProtocolAddress, store: SenderKeyStore, message: Uint8Array): Promise<Uint8Array>;
|
|
322
321
|
export declare class SealedSenderDecryptionResult {
|
|
323
322
|
readonly _nativeHandle: Native.SealedSenderDecryptionResult;
|
|
324
323
|
private constructor();
|
|
325
324
|
static _fromNativeHandle(nativeHandle: Native.SealedSenderDecryptionResult): SealedSenderDecryptionResult;
|
|
326
|
-
message():
|
|
325
|
+
message(): Uint8Array;
|
|
327
326
|
senderE164(): string | null;
|
|
328
327
|
senderUuid(): string;
|
|
329
328
|
/**
|
|
@@ -342,36 +341,36 @@ export declare class CiphertextMessage {
|
|
|
342
341
|
private constructor();
|
|
343
342
|
static _fromNativeHandle(nativeHandle: Native.CiphertextMessage): CiphertextMessage;
|
|
344
343
|
static from(message: CiphertextMessageConvertible): CiphertextMessage;
|
|
345
|
-
serialize():
|
|
344
|
+
serialize(): Uint8Array;
|
|
346
345
|
type(): number;
|
|
347
346
|
}
|
|
348
347
|
export declare class PlaintextContent implements CiphertextMessageConvertible {
|
|
349
348
|
readonly _nativeHandle: Native.PlaintextContent;
|
|
350
349
|
private constructor();
|
|
351
|
-
static deserialize(buffer:
|
|
350
|
+
static deserialize(buffer: Uint8Array): PlaintextContent;
|
|
352
351
|
static from(message: DecryptionErrorMessage): PlaintextContent;
|
|
353
|
-
serialize():
|
|
354
|
-
body():
|
|
352
|
+
serialize(): Uint8Array;
|
|
353
|
+
body(): Uint8Array;
|
|
355
354
|
asCiphertextMessage(): CiphertextMessage;
|
|
356
355
|
}
|
|
357
356
|
export declare class DecryptionErrorMessage {
|
|
358
357
|
readonly _nativeHandle: Native.DecryptionErrorMessage;
|
|
359
358
|
private constructor();
|
|
360
359
|
static _fromNativeHandle(nativeHandle: Native.DecryptionErrorMessage): DecryptionErrorMessage;
|
|
361
|
-
static forOriginal(bytes:
|
|
362
|
-
static deserialize(buffer:
|
|
363
|
-
static extractFromSerializedBody(buffer:
|
|
364
|
-
serialize():
|
|
360
|
+
static forOriginal(bytes: Uint8Array, type: CiphertextMessageType, timestamp: number, originalSenderDeviceId: number): DecryptionErrorMessage;
|
|
361
|
+
static deserialize(buffer: Uint8Array): DecryptionErrorMessage;
|
|
362
|
+
static extractFromSerializedBody(buffer: Uint8Array): DecryptionErrorMessage;
|
|
363
|
+
serialize(): Uint8Array;
|
|
365
364
|
timestamp(): number;
|
|
366
365
|
deviceId(): number;
|
|
367
366
|
ratchetKey(): PublicKey | undefined;
|
|
368
367
|
}
|
|
369
368
|
export declare function processPreKeyBundle(bundle: PreKeyBundle, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, usePqRatchet: UsePQRatchet, now?: Date): Promise<void>;
|
|
370
|
-
export declare function signalEncrypt(message:
|
|
371
|
-
export declare function signalDecrypt(message: SignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<
|
|
372
|
-
export declare function signalDecryptPreKey(message: PreKeySignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, usePqRatchet: UsePQRatchet): Promise<
|
|
373
|
-
export declare function sealedSenderEncryptMessage(message:
|
|
374
|
-
export declare function sealedSenderEncrypt(content: UnidentifiedSenderMessageContent, address: ProtocolAddress, identityStore: IdentityKeyStore): Promise<
|
|
369
|
+
export declare function signalEncrypt(message: Uint8Array, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, now?: Date): Promise<CiphertextMessage>;
|
|
370
|
+
export declare function signalDecrypt(message: SignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
371
|
+
export declare function signalDecryptPreKey(message: PreKeySignalMessage, address: ProtocolAddress, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, usePqRatchet: UsePQRatchet): Promise<Uint8Array>;
|
|
372
|
+
export declare function sealedSenderEncryptMessage(message: Uint8Array, address: ProtocolAddress, senderCert: SenderCertificate, sessionStore: SessionStore, identityStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
373
|
+
export declare function sealedSenderEncrypt(content: UnidentifiedSenderMessageContent, address: ProtocolAddress, identityStore: IdentityKeyStore): Promise<Uint8Array>;
|
|
375
374
|
export type SealedSenderMultiRecipientEncryptOptions = {
|
|
376
375
|
content: UnidentifiedSenderMessageContent;
|
|
377
376
|
recipients: ProtocolAddress[];
|
|
@@ -379,28 +378,28 @@ export type SealedSenderMultiRecipientEncryptOptions = {
|
|
|
379
378
|
identityStore: IdentityKeyStore;
|
|
380
379
|
sessionStore: SessionStore;
|
|
381
380
|
};
|
|
382
|
-
export declare function sealedSenderMultiRecipientEncrypt(options: SealedSenderMultiRecipientEncryptOptions): Promise<
|
|
383
|
-
export declare function sealedSenderMultiRecipientEncrypt(content: UnidentifiedSenderMessageContent, recipients: ProtocolAddress[], identityStore: IdentityKeyStore, sessionStore: SessionStore): Promise<
|
|
384
|
-
export declare function sealedSenderMultiRecipientMessageForSingleRecipient(message:
|
|
385
|
-
export declare function sealedSenderDecryptMessage(message:
|
|
386
|
-
export declare function sealedSenderDecryptToUsmc(message:
|
|
381
|
+
export declare function sealedSenderMultiRecipientEncrypt(options: SealedSenderMultiRecipientEncryptOptions): Promise<Uint8Array>;
|
|
382
|
+
export declare function sealedSenderMultiRecipientEncrypt(content: UnidentifiedSenderMessageContent, recipients: ProtocolAddress[], identityStore: IdentityKeyStore, sessionStore: SessionStore): Promise<Uint8Array>;
|
|
383
|
+
export declare function sealedSenderMultiRecipientMessageForSingleRecipient(message: Uint8Array): Uint8Array;
|
|
384
|
+
export declare function sealedSenderDecryptMessage(message: Uint8Array, trustRoot: PublicKey, timestamp: number, localE164: string | null, localUuid: string, localDeviceId: number, sessionStore: SessionStore, identityStore: IdentityKeyStore, prekeyStore: PreKeyStore, signedPrekeyStore: SignedPreKeyStore, kyberPrekeyStore: KyberPreKeyStore, usePqRatchet: UsePQRatchet): Promise<SealedSenderDecryptionResult>;
|
|
385
|
+
export declare function sealedSenderDecryptToUsmc(message: Uint8Array, identityStore: IdentityKeyStore): Promise<UnidentifiedSenderMessageContent>;
|
|
387
386
|
export declare class Cds2Client {
|
|
388
387
|
readonly _nativeHandle: Native.SgxClientState;
|
|
389
388
|
private constructor();
|
|
390
|
-
static new(mrenclave:
|
|
391
|
-
initialRequest():
|
|
392
|
-
completeHandshake(buffer:
|
|
393
|
-
establishedSend(buffer:
|
|
394
|
-
establishedRecv(buffer:
|
|
389
|
+
static new(mrenclave: Uint8Array, attestationMsg: Uint8Array, currentTimestamp: Date): Cds2Client;
|
|
390
|
+
initialRequest(): Uint8Array;
|
|
391
|
+
completeHandshake(buffer: Uint8Array): void;
|
|
392
|
+
establishedSend(buffer: Uint8Array): Uint8Array;
|
|
393
|
+
establishedRecv(buffer: Uint8Array): Uint8Array;
|
|
395
394
|
}
|
|
396
395
|
export declare class HsmEnclaveClient {
|
|
397
396
|
readonly _nativeHandle: Native.HsmEnclaveClient;
|
|
398
397
|
private constructor();
|
|
399
|
-
static new(public_key:
|
|
400
|
-
initialRequest():
|
|
401
|
-
completeHandshake(buffer:
|
|
402
|
-
establishedSend(buffer:
|
|
403
|
-
establishedRecv(buffer:
|
|
398
|
+
static new(public_key: Uint8Array, code_hashes: Uint8Array[]): HsmEnclaveClient;
|
|
399
|
+
initialRequest(): Uint8Array;
|
|
400
|
+
completeHandshake(buffer: Uint8Array): void;
|
|
401
|
+
establishedSend(buffer: Uint8Array): Uint8Array;
|
|
402
|
+
establishedRecv(buffer: Uint8Array): Uint8Array;
|
|
404
403
|
}
|
|
405
404
|
export declare enum LogLevel {
|
|
406
405
|
Error = 1,
|
package/dist/index.js
CHANGED
|
@@ -515,11 +515,11 @@ class SenderKeyDistributionMessage {
|
|
|
515
515
|
this._nativeHandle = nativeHandle;
|
|
516
516
|
}
|
|
517
517
|
static async create(sender, distributionId, store) {
|
|
518
|
-
const handle = await Native.SenderKeyDistributionMessage_Create(sender,
|
|
518
|
+
const handle = await Native.SenderKeyDistributionMessage_Create(sender, uuid.parse(distributionId), store);
|
|
519
519
|
return new SenderKeyDistributionMessage(handle);
|
|
520
520
|
}
|
|
521
521
|
static _new(messageVersion, distributionId, chainId, iteration, chainKey, pk) {
|
|
522
|
-
return new SenderKeyDistributionMessage(Native.SenderKeyDistributionMessage_New(messageVersion,
|
|
522
|
+
return new SenderKeyDistributionMessage(Native.SenderKeyDistributionMessage_New(messageVersion, uuid.parse(distributionId), chainId, iteration, chainKey, pk));
|
|
523
523
|
}
|
|
524
524
|
static deserialize(buffer) {
|
|
525
525
|
return new SenderKeyDistributionMessage(Native.SenderKeyDistributionMessage_Deserialize(buffer));
|
|
@@ -550,7 +550,7 @@ class SenderKeyMessage {
|
|
|
550
550
|
this._nativeHandle = nativeHandle;
|
|
551
551
|
}
|
|
552
552
|
static _new(messageVersion, distributionId, chainId, iteration, ciphertext, pk) {
|
|
553
|
-
return new SenderKeyMessage(Native.SenderKeyMessage_New(messageVersion,
|
|
553
|
+
return new SenderKeyMessage(Native.SenderKeyMessage_New(messageVersion, uuid.parse(distributionId), chainId, iteration, ciphertext, pk));
|
|
554
554
|
}
|
|
555
555
|
static deserialize(buffer) {
|
|
556
556
|
return new SenderKeyMessage(Native.SenderKeyMessage_Deserialize(buffer));
|
|
@@ -707,7 +707,7 @@ class SenderKeyStore {
|
|
|
707
707
|
}
|
|
708
708
|
exports.SenderKeyStore = SenderKeyStore;
|
|
709
709
|
async function groupEncrypt(sender, distributionId, store, message) {
|
|
710
|
-
return CiphertextMessage._fromNativeHandle(await Native.GroupCipher_EncryptMessage(sender,
|
|
710
|
+
return CiphertextMessage._fromNativeHandle(await Native.GroupCipher_EncryptMessage(sender, uuid.parse(distributionId), message, store));
|
|
711
711
|
}
|
|
712
712
|
exports.groupEncrypt = groupEncrypt;
|
|
713
713
|
async function groupDecrypt(sender, store, message) {
|
package/dist/io.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../Native';
|
|
3
|
-
import type { Buffer } from 'node:buffer';
|
|
4
2
|
/**
|
|
5
3
|
* An abstract class representing an input stream of bytes.
|
|
6
4
|
*/
|
|
7
5
|
export declare abstract class InputStream implements Native.InputStream {
|
|
8
|
-
_read(amount: number): Promise<
|
|
6
|
+
_read(amount: number): Promise<Uint8Array>;
|
|
9
7
|
_skip(amount: number): Promise<void>;
|
|
10
8
|
/**
|
|
11
9
|
* Called to indicate the stream's resources should be released.
|
|
@@ -20,10 +18,10 @@ export declare abstract class InputStream implements Native.InputStream {
|
|
|
20
18
|
* however, returning zero bytes always indicates that the end of the stream has been reached.
|
|
21
19
|
*
|
|
22
20
|
* @param amount The amount of bytes to read.
|
|
23
|
-
* @returns A promise yielding a {@link
|
|
21
|
+
* @returns A promise yielding a {@link Uint8Array} containing the read bytes.
|
|
24
22
|
* @throws {IoError} If an I/O error occurred while reading from the input.
|
|
25
23
|
*/
|
|
26
|
-
abstract read(amount: number): Promise<
|
|
24
|
+
abstract read(amount: number): Promise<Uint8Array>;
|
|
27
25
|
/**
|
|
28
26
|
* Skip an amount of bytes in the input stream.
|
|
29
27
|
*
|
package/dist/net/Chat.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../../Native';
|
|
3
2
|
import { LibSignalError } from '../Errors';
|
|
4
3
|
import { Wrapper } from '../../Native';
|
|
5
|
-
import { Buffer } from 'node:buffer';
|
|
6
4
|
import { TokioAsyncContext, Environment } from '../net';
|
|
7
5
|
import * as KT from './KeyTransparency';
|
|
8
6
|
export type ChatRequest = Readonly<{
|
|
@@ -37,7 +35,7 @@ export interface ChatServiceListener extends ConnectionEventsListener {
|
|
|
37
35
|
* If `ack`'s `send` method is not called, the server will leave this message in the message
|
|
38
36
|
* queue and attempt to deliver it again in the future.
|
|
39
37
|
*/
|
|
40
|
-
onIncomingMessage(envelope:
|
|
38
|
+
onIncomingMessage(envelope: Uint8Array, timestamp: number, ack: ChatServerMessageAck): void;
|
|
41
39
|
/**
|
|
42
40
|
* Called when the server indicates that there are no further messages in the message queue.
|
|
43
41
|
*
|
package/dist/net/Chat.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.buildHttpRequest = exports.AuthenticatedChatConnection = exports.UnauthenticatedChatConnection = exports.ChatServerMessageAck = void 0;
|
|
8
8
|
const Native = require("../../Native");
|
|
9
|
-
const node_buffer_1 = require("node:buffer");
|
|
10
9
|
const KT = require("./KeyTransparency");
|
|
11
10
|
const internal_1 = require("../internal");
|
|
12
11
|
const DEFAULT_CHAT_REQUEST_TIMEOUT_MILLIS = 5000;
|
|
@@ -209,9 +208,8 @@ function makeNativeChatListener(asyncContext, listener) {
|
|
|
209
208
|
}
|
|
210
209
|
function buildHttpRequest(chatRequest) {
|
|
211
210
|
const { verb, path, body, headers } = chatRequest;
|
|
212
|
-
const bodyBuffer = body !== undefined ? node_buffer_1.Buffer.from(body) : null;
|
|
213
211
|
const httpRequest = {
|
|
214
|
-
_nativeHandle: Native.HttpRequest_new(verb, path,
|
|
212
|
+
_nativeHandle: Native.HttpRequest_new(verb, path, body ?? null),
|
|
215
213
|
};
|
|
216
214
|
headers.forEach((header) => {
|
|
217
215
|
const [name, value] = header;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../../Native';
|
|
3
2
|
import { Aci } from '../Address';
|
|
4
3
|
import { PublicKey } from '../EcKeys';
|
|
@@ -10,10 +9,10 @@ import { Environment, type TokioAsyncContext } from '../net';
|
|
|
10
9
|
* used by the {@link Client}.
|
|
11
10
|
*/
|
|
12
11
|
export interface Store {
|
|
13
|
-
getLastDistinguishedTreeHead(): Promise<
|
|
14
|
-
setLastDistinguishedTreeHead(bytes: Readonly<
|
|
15
|
-
getAccountData(aci: Aci): Promise<
|
|
16
|
-
setAccountData(aci: Aci, bytes: Readonly<
|
|
12
|
+
getLastDistinguishedTreeHead(): Promise<Uint8Array | null>;
|
|
13
|
+
setLastDistinguishedTreeHead(bytes: Readonly<Uint8Array> | null): Promise<void>;
|
|
14
|
+
getAccountData(aci: Aci): Promise<Uint8Array | null>;
|
|
15
|
+
setAccountData(aci: Aci, bytes: Readonly<Uint8Array>): Promise<void>;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* Options that are accepted by all {@link Client} APIs.
|
|
@@ -35,7 +34,7 @@ export type AciInfo = {
|
|
|
35
34
|
*/
|
|
36
35
|
export type E164Info = {
|
|
37
36
|
e164: string;
|
|
38
|
-
unidentifiedAccessKey: Readonly<
|
|
37
|
+
unidentifiedAccessKey: Readonly<Uint8Array>;
|
|
39
38
|
};
|
|
40
39
|
/**
|
|
41
40
|
* Key transparency client request
|
|
@@ -46,7 +45,7 @@ export type Request = {
|
|
|
46
45
|
aciInfo: AciInfo;
|
|
47
46
|
/** Unidentified access key associated with the account. Optional. */
|
|
48
47
|
e164Info?: E164Info;
|
|
49
|
-
usernameHash?: Readonly<
|
|
48
|
+
usernameHash?: Readonly<Uint8Array>;
|
|
50
49
|
};
|
|
51
50
|
/**
|
|
52
51
|
* Typed API to access the key transparency subsystem using an existing
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
3
2
|
import * as Native from '../../Native';
|
|
4
3
|
import { type TokioAsyncContext } from '../net';
|
|
@@ -145,8 +144,8 @@ export declare class RegisterAccountResponse {
|
|
|
145
144
|
get aci(): Aci;
|
|
146
145
|
get pni(): Pni;
|
|
147
146
|
get number(): string;
|
|
148
|
-
get usernameHash():
|
|
149
|
-
get usernameLinkHandle():
|
|
147
|
+
get usernameHash(): Uint8Array | null;
|
|
148
|
+
get usernameLinkHandle(): Uint8Array | null;
|
|
150
149
|
get backupEntitlement(): {
|
|
151
150
|
backupLevel: bigint;
|
|
152
151
|
expirationSeconds: bigint;
|
package/dist/net/Registration.js
CHANGED
|
@@ -141,7 +141,7 @@ function toBridgedPublicPreKey(key) {
|
|
|
141
141
|
class AccountAttributes {
|
|
142
142
|
constructor({ recoveryPassword, aciRegistrationId, pniRegistrationId, registrationLock, unidentifiedAccessKey, unrestrictedUnidentifiedAccess, capabilities, discoverableByPhoneNumber, }) {
|
|
143
143
|
const capabilitiesArray = Array.from(capabilities);
|
|
144
|
-
this._nativeHandle = Native.RegistrationAccountAttributes_Create(
|
|
144
|
+
this._nativeHandle = Native.RegistrationAccountAttributes_Create(recoveryPassword, aciRegistrationId, pniRegistrationId, registrationLock, unidentifiedAccessKey, unrestrictedUnidentifiedAccess, capabilitiesArray, discoverableByPhoneNumber);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
exports.AccountAttributes = AccountAttributes;
|
package/dist/net.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
3
2
|
import * as Native from '../Native';
|
|
4
|
-
import { Buffer } from 'node:buffer';
|
|
5
3
|
import { CDSRequestOptionsType, CDSResponseType } from './net/CDSI';
|
|
6
4
|
import { ConnectionEventsListener, UnauthenticatedChatConnection, AuthenticatedChatConnection, ChatServiceListener } from './net/Chat';
|
|
7
5
|
import { RegistrationService } from './net/Registration';
|
|
@@ -41,7 +39,7 @@ export type NetConstructorOptions = Readonly<{
|
|
|
41
39
|
TESTING_localServer_chatPort: number;
|
|
42
40
|
TESTING_localServer_cdsiPort: number;
|
|
43
41
|
TESTING_localServer_svr2Port: number;
|
|
44
|
-
TESTING_localServer_rootCertificateDer:
|
|
42
|
+
TESTING_localServer_rootCertificateDer: Uint8Array;
|
|
45
43
|
}>;
|
|
46
44
|
/** See {@link Net.setProxy()}. */
|
|
47
45
|
export type ProxyOptions = {
|
package/dist/usernames.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export type UsernameLink = {
|
|
3
|
-
entropy:
|
|
4
|
-
encryptedUsername:
|
|
2
|
+
entropy: Uint8Array;
|
|
3
|
+
encryptedUsername: Uint8Array;
|
|
5
4
|
};
|
|
6
5
|
export declare function generateCandidates(nickname: string, minNicknameLength: number, maxNicknameLength: number): string[];
|
|
7
6
|
export declare function fromParts(nickname: string, discriminator: string, minNicknameLength: number, maxNicknameLength: number): {
|
|
8
7
|
username: string;
|
|
9
|
-
hash:
|
|
8
|
+
hash: Uint8Array;
|
|
10
9
|
};
|
|
11
|
-
export declare function hash(username: string):
|
|
12
|
-
export declare function generateProof(username: string):
|
|
13
|
-
export declare function generateProofWithRandom(username: string, random:
|
|
10
|
+
export declare function hash(username: string): Uint8Array;
|
|
11
|
+
export declare function generateProof(username: string): Uint8Array;
|
|
12
|
+
export declare function generateProofWithRandom(username: string, random: Uint8Array): Uint8Array;
|
|
14
13
|
export declare function decryptUsernameLink(usernameLink: UsernameLink): string;
|
|
15
|
-
export declare function createUsernameLink(username: string, previousEntropy?:
|
|
16
|
-
export declare function verifyProof(proof:
|
|
14
|
+
export declare function createUsernameLink(username: string, previousEntropy?: Uint8Array): UsernameLink;
|
|
15
|
+
export declare function verifyProof(proof: Uint8Array, hash: Uint8Array): void;
|