@signalapp/libsignal-client 0.74.1 → 0.75.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 +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
package/dist/AccountKeys.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import ByteArray from './zkgroup/internal/ByteArray';
|
|
3
2
|
import { Aci } from './Address';
|
|
4
3
|
import { PrivateKey } from './EcKeys';
|
|
@@ -28,7 +27,7 @@ export declare class AccountEntropyPool {
|
|
|
28
27
|
* `accountEntropyPool` must be a **validated** account entropy pool;
|
|
29
28
|
* passing an arbitrary string here is considered a programmer error.
|
|
30
29
|
*/
|
|
31
|
-
static deriveSvrKey(accountEntropyPool: string):
|
|
30
|
+
static deriveSvrKey(accountEntropyPool: string): Uint8Array;
|
|
32
31
|
/**
|
|
33
32
|
* Derives a backup key from the given account entropy pool.
|
|
34
33
|
*
|
|
@@ -49,7 +48,7 @@ export declare class AccountEntropyPool {
|
|
|
49
48
|
export declare class BackupKey extends ByteArray {
|
|
50
49
|
private readonly __type?;
|
|
51
50
|
static SIZE: number;
|
|
52
|
-
constructor(contents:
|
|
51
|
+
constructor(contents: Uint8Array);
|
|
53
52
|
/**
|
|
54
53
|
* Generates a random backup key.
|
|
55
54
|
*
|
|
@@ -63,7 +62,7 @@ export declare class BackupKey extends ByteArray {
|
|
|
63
62
|
*
|
|
64
63
|
* Used for both message and media backups.
|
|
65
64
|
*/
|
|
66
|
-
deriveBackupId(aci: Aci):
|
|
65
|
+
deriveBackupId(aci: Aci): Uint8Array;
|
|
67
66
|
/**
|
|
68
67
|
* Derives the backup EC key to use given the current device's ACI.
|
|
69
68
|
*
|
|
@@ -75,13 +74,13 @@ export declare class BackupKey extends ByteArray {
|
|
|
75
74
|
*
|
|
76
75
|
* Only relevant for message backup keys.
|
|
77
76
|
*/
|
|
78
|
-
deriveLocalBackupMetadataKey():
|
|
77
|
+
deriveLocalBackupMetadataKey(): Uint8Array;
|
|
79
78
|
/**
|
|
80
79
|
* Derives the ID for uploading media with the name `mediaName`.
|
|
81
80
|
*
|
|
82
81
|
* Only relevant for media backup keys.
|
|
83
82
|
*/
|
|
84
|
-
deriveMediaId(mediaName: string):
|
|
83
|
+
deriveMediaId(mediaName: string): Uint8Array;
|
|
85
84
|
/**
|
|
86
85
|
* Derives the composite encryption key for re-encrypting media with the given ID.
|
|
87
86
|
*
|
|
@@ -89,7 +88,7 @@ export declare class BackupKey extends ByteArray {
|
|
|
89
88
|
*
|
|
90
89
|
* Only relevant for media backup keys.
|
|
91
90
|
*/
|
|
92
|
-
deriveMediaEncryptionKey(mediaId:
|
|
91
|
+
deriveMediaEncryptionKey(mediaId: Uint8Array): Uint8Array;
|
|
93
92
|
/**
|
|
94
93
|
* Derives the composite encryption key for uploading thumbnails with the given ID to the "transit
|
|
95
94
|
* tier" CDN.
|
|
@@ -98,5 +97,5 @@ export declare class BackupKey extends ByteArray {
|
|
|
98
97
|
*
|
|
99
98
|
* Only relevant for media backup keys.
|
|
100
99
|
*/
|
|
101
|
-
deriveThumbnailTransitEncryptionKey(mediaId:
|
|
100
|
+
deriveThumbnailTransitEncryptionKey(mediaId: Uint8Array): Uint8Array;
|
|
102
101
|
}
|
package/dist/Address.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../Native';
|
|
3
2
|
export declare enum ServiceIdKind {
|
|
4
3
|
Aci = 0,
|
|
@@ -12,18 +11,18 @@ export declare enum ServiceIdKind {
|
|
|
12
11
|
*/
|
|
13
12
|
export declare abstract class ServiceId extends Object {
|
|
14
13
|
private readonly serviceIdFixedWidthBinary;
|
|
15
|
-
constructor(serviceIdFixedWidthBinary:
|
|
16
|
-
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: new (serviceIdFixedWidthBinary:
|
|
17
|
-
getServiceIdBinary():
|
|
18
|
-
getServiceIdFixedWidthBinary():
|
|
14
|
+
constructor(serviceIdFixedWidthBinary: Uint8Array);
|
|
15
|
+
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: new (serviceIdFixedWidthBinary: Uint8Array) => InstanceType<T>, uuidBytes: ArrayLike<number>, kind: ServiceIdKind): InstanceType<T>;
|
|
16
|
+
getServiceIdBinary(): Uint8Array;
|
|
17
|
+
getServiceIdFixedWidthBinary(): Uint8Array;
|
|
19
18
|
getServiceIdString(): string;
|
|
20
19
|
toString(): string;
|
|
21
20
|
private downcastTo;
|
|
22
|
-
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary:
|
|
23
|
-
static parseFromServiceIdBinary<T extends typeof ServiceId>(this: T, serviceIdBinary:
|
|
21
|
+
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary: Uint8Array): InstanceType<T>;
|
|
22
|
+
static parseFromServiceIdBinary<T extends typeof ServiceId>(this: T, serviceIdBinary: Uint8Array): InstanceType<T>;
|
|
24
23
|
static parseFromServiceIdString<T extends typeof ServiceId>(this: T, serviceIdString: string): InstanceType<T>;
|
|
25
24
|
getRawUuid(): string;
|
|
26
|
-
getRawUuidBytes():
|
|
25
|
+
getRawUuidBytes(): Uint8Array;
|
|
27
26
|
isEqual(other: ServiceId): boolean;
|
|
28
27
|
/**
|
|
29
28
|
* Orders ServiceIds by kind, then lexicographically by the bytes of the UUID.
|
|
@@ -31,7 +30,7 @@ export declare abstract class ServiceId extends Object {
|
|
|
31
30
|
* Compatible with <code>Array.sort</code>.
|
|
32
31
|
*/
|
|
33
32
|
static comparator(this: void, lhs: ServiceId, rhs: ServiceId): number;
|
|
34
|
-
static toConcatenatedFixedWidthBinary(serviceIds: ServiceId[]):
|
|
33
|
+
static toConcatenatedFixedWidthBinary(serviceIds: ServiceId[]): Uint8Array;
|
|
35
34
|
}
|
|
36
35
|
export declare class Aci extends ServiceId {
|
|
37
36
|
private readonly __type?;
|
|
@@ -47,6 +46,10 @@ export declare class ProtocolAddress {
|
|
|
47
46
|
readonly _nativeHandle: Native.ProtocolAddress;
|
|
48
47
|
private constructor();
|
|
49
48
|
static _fromNativeHandle(handle: Native.ProtocolAddress): ProtocolAddress;
|
|
49
|
+
/**
|
|
50
|
+
* @param name the identifer for the recipient, usually a `ServiceId`
|
|
51
|
+
* @param deviceId the identifier for the device; must be in the range 1-127 inclusive
|
|
52
|
+
*/
|
|
50
53
|
static new(name: string | ServiceId, deviceId: number): ProtocolAddress;
|
|
51
54
|
name(): string;
|
|
52
55
|
/**
|
package/dist/Address.js
CHANGED
|
@@ -29,7 +29,7 @@ class ServiceId extends Object {
|
|
|
29
29
|
this.serviceIdFixedWidthBinary = serviceIdFixedWidthBinary;
|
|
30
30
|
}
|
|
31
31
|
static fromUuidBytesAndKind(uuidBytes, kind) {
|
|
32
|
-
const buffer =
|
|
32
|
+
const buffer = new Uint8Array(SERVICE_ID_FIXED_WIDTH_BINARY_LEN);
|
|
33
33
|
buffer[0] = kind;
|
|
34
34
|
buffer.set(uuidBytes, 1);
|
|
35
35
|
return new this(buffer);
|
|
@@ -38,7 +38,7 @@ class ServiceId extends Object {
|
|
|
38
38
|
return Native.ServiceId_ServiceIdBinary(this.serviceIdFixedWidthBinary);
|
|
39
39
|
}
|
|
40
40
|
getServiceIdFixedWidthBinary() {
|
|
41
|
-
return
|
|
41
|
+
return Uint8Array.from(this.serviceIdFixedWidthBinary);
|
|
42
42
|
}
|
|
43
43
|
getServiceIdString() {
|
|
44
44
|
return Native.ServiceId_ServiceIdString(this.serviceIdFixedWidthBinary);
|
|
@@ -79,10 +79,10 @@ class ServiceId extends Object {
|
|
|
79
79
|
return uuid.stringify(this.serviceIdFixedWidthBinary, 1);
|
|
80
80
|
}
|
|
81
81
|
getRawUuidBytes() {
|
|
82
|
-
return
|
|
82
|
+
return this.serviceIdFixedWidthBinary.subarray(1);
|
|
83
83
|
}
|
|
84
84
|
isEqual(other) {
|
|
85
|
-
return
|
|
85
|
+
return ServiceId.comparator(this, other) == 0;
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* Orders ServiceIds by kind, then lexicographically by the bytes of the UUID.
|
|
@@ -90,10 +90,10 @@ class ServiceId extends Object {
|
|
|
90
90
|
* Compatible with <code>Array.sort</code>.
|
|
91
91
|
*/
|
|
92
92
|
static comparator(lhs, rhs) {
|
|
93
|
-
return lhs.serviceIdFixedWidthBinary
|
|
93
|
+
return Buffer.compare(lhs.serviceIdFixedWidthBinary, rhs.serviceIdFixedWidthBinary);
|
|
94
94
|
}
|
|
95
95
|
static toConcatenatedFixedWidthBinary(serviceIds) {
|
|
96
|
-
const result =
|
|
96
|
+
const result = new Uint8Array(serviceIds.length * SERVICE_ID_FIXED_WIDTH_BINARY_LEN);
|
|
97
97
|
let offset = 0;
|
|
98
98
|
for (const serviceId of serviceIds) {
|
|
99
99
|
result.set(serviceId.serviceIdFixedWidthBinary, offset);
|
|
@@ -128,6 +128,10 @@ class ProtocolAddress {
|
|
|
128
128
|
static _fromNativeHandle(handle) {
|
|
129
129
|
return new ProtocolAddress(handle);
|
|
130
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* @param name the identifer for the recipient, usually a `ServiceId`
|
|
133
|
+
* @param deviceId the identifier for the device; must be in the range 1-127 inclusive
|
|
134
|
+
*/
|
|
131
135
|
static new(name, deviceId) {
|
|
132
136
|
if (typeof name !== 'string') {
|
|
133
137
|
name = name.getServiceIdString();
|
package/dist/EcKeys.d.ts
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../Native';
|
|
3
2
|
export declare class PublicKey {
|
|
4
3
|
readonly _nativeHandle: Native.PublicKey;
|
|
5
4
|
private constructor();
|
|
6
5
|
static _fromNativeHandle(handle: Native.PublicKey): PublicKey;
|
|
7
|
-
static deserialize(buf:
|
|
6
|
+
static deserialize(buf: Uint8Array): PublicKey;
|
|
8
7
|
compare(other: PublicKey): number;
|
|
9
|
-
serialize():
|
|
10
|
-
getPublicKeyBytes():
|
|
11
|
-
verify(msg:
|
|
12
|
-
verifyAlternateIdentity(other: PublicKey, signature:
|
|
8
|
+
serialize(): Uint8Array;
|
|
9
|
+
getPublicKeyBytes(): Uint8Array;
|
|
10
|
+
verify(msg: Uint8Array, sig: Uint8Array): boolean;
|
|
11
|
+
verifyAlternateIdentity(other: PublicKey, signature: Uint8Array): boolean;
|
|
13
12
|
}
|
|
14
13
|
export declare class PrivateKey {
|
|
15
14
|
readonly _nativeHandle: Native.PrivateKey;
|
|
16
15
|
private constructor();
|
|
17
16
|
static _fromNativeHandle(handle: Native.PrivateKey): PrivateKey;
|
|
18
17
|
static generate(): PrivateKey;
|
|
19
|
-
static deserialize(buf:
|
|
20
|
-
serialize():
|
|
21
|
-
sign(msg:
|
|
22
|
-
agree(other_key: PublicKey):
|
|
18
|
+
static deserialize(buf: Uint8Array): PrivateKey;
|
|
19
|
+
serialize(): Uint8Array;
|
|
20
|
+
sign(msg: Uint8Array): Uint8Array;
|
|
21
|
+
agree(other_key: PublicKey): Uint8Array;
|
|
23
22
|
getPublicKey(): PublicKey;
|
|
24
23
|
}
|
|
25
24
|
export declare class IdentityKeyPair {
|
|
@@ -27,7 +26,7 @@ export declare class IdentityKeyPair {
|
|
|
27
26
|
readonly privateKey: PrivateKey;
|
|
28
27
|
constructor(publicKey: PublicKey, privateKey: PrivateKey);
|
|
29
28
|
static generate(): IdentityKeyPair;
|
|
30
|
-
static deserialize(buffer:
|
|
31
|
-
serialize():
|
|
32
|
-
signAlternateIdentity(other: PublicKey):
|
|
29
|
+
static deserialize(buffer: Uint8Array): IdentityKeyPair;
|
|
30
|
+
serialize(): Uint8Array;
|
|
31
|
+
signAlternateIdentity(other: PublicKey): Uint8Array;
|
|
33
32
|
}
|
package/dist/Errors.d.ts
CHANGED
|
@@ -6,42 +6,43 @@ export declare enum ErrorCode {
|
|
|
6
6
|
SealedSenderSelfSend = 2,
|
|
7
7
|
UntrustedIdentity = 3,
|
|
8
8
|
InvalidRegistrationId = 4,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
9
|
+
InvalidProtocolAddress = 5,
|
|
10
|
+
VerificationFailed = 6,
|
|
11
|
+
InvalidSession = 7,
|
|
12
|
+
InvalidSenderKeySession = 8,
|
|
13
|
+
NicknameCannotBeEmpty = 9,
|
|
14
|
+
CannotStartWithDigit = 10,
|
|
15
|
+
MissingSeparator = 11,
|
|
16
|
+
BadNicknameCharacter = 12,
|
|
17
|
+
NicknameTooShort = 13,
|
|
18
|
+
NicknameTooLong = 14,
|
|
19
|
+
DiscriminatorCannotBeEmpty = 15,
|
|
20
|
+
DiscriminatorCannotBeZero = 16,
|
|
21
|
+
DiscriminatorCannotBeSingleDigit = 17,
|
|
22
|
+
DiscriminatorCannotHaveLeadingZeros = 18,
|
|
23
|
+
BadDiscriminatorCharacter = 19,
|
|
24
|
+
DiscriminatorTooLarge = 20,
|
|
25
|
+
IoError = 21,
|
|
26
|
+
CdsiInvalidToken = 22,
|
|
27
|
+
InvalidUri = 23,
|
|
28
|
+
InvalidMediaInput = 24,
|
|
29
|
+
UnsupportedMediaInput = 25,
|
|
30
|
+
InputDataTooLong = 26,
|
|
31
|
+
InvalidEntropyDataLength = 27,
|
|
32
|
+
InvalidUsernameLinkEncryptedData = 28,
|
|
33
|
+
RateLimitedError = 29,
|
|
34
|
+
SvrDataMissing = 30,
|
|
35
|
+
SvrRequestFailed = 31,
|
|
36
|
+
SvrRestoreFailed = 32,
|
|
37
|
+
ChatServiceInactive = 33,
|
|
38
|
+
AppExpired = 34,
|
|
39
|
+
DeviceDelinked = 35,
|
|
40
|
+
ConnectionInvalidated = 36,
|
|
41
|
+
ConnectedElsewhere = 37,
|
|
42
|
+
BackupValidation = 38,
|
|
43
|
+
Cancelled = 39,
|
|
44
|
+
KeyTransparencyError = 40,
|
|
45
|
+
KeyTransparencyVerificationFailed = 41
|
|
45
46
|
}
|
|
46
47
|
export declare class LibSignalErrorBase extends Error {
|
|
47
48
|
readonly code: ErrorCode;
|
|
@@ -75,6 +76,11 @@ export type InvalidRegistrationIdError = LibSignalErrorCommon & {
|
|
|
75
76
|
code: ErrorCode.InvalidRegistrationId;
|
|
76
77
|
addr: ProtocolAddress;
|
|
77
78
|
};
|
|
79
|
+
export type InvalidProtocolAddress = LibSignalErrorCommon & {
|
|
80
|
+
code: ErrorCode.InvalidProtocolAddress;
|
|
81
|
+
name: string;
|
|
82
|
+
deviceId: number;
|
|
83
|
+
};
|
|
78
84
|
export type VerificationFailedError = LibSignalErrorCommon & {
|
|
79
85
|
code: ErrorCode.VerificationFailed;
|
|
80
86
|
};
|
|
@@ -187,4 +193,4 @@ export type KeyTransparencyError = LibSignalErrorCommon & {
|
|
|
187
193
|
export type KeyTransparencyVerificationFailed = LibSignalErrorCommon & {
|
|
188
194
|
code: ErrorCode.KeyTransparencyVerificationFailed;
|
|
189
195
|
};
|
|
190
|
-
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | 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 | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | ConnectionInvalidatedError | ConnectedElsewhereError | RateLimitedError | BackupValidationError | CancellationError | KeyTransparencyError | KeyTransparencyVerificationFailed;
|
|
196
|
+
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 | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | ConnectionInvalidatedError | ConnectedElsewhereError | RateLimitedError | BackupValidationError | CancellationError | KeyTransparencyError | KeyTransparencyVerificationFailed;
|
package/dist/Errors.js
CHANGED
|
@@ -13,42 +13,43 @@ var ErrorCode;
|
|
|
13
13
|
ErrorCode[ErrorCode["SealedSenderSelfSend"] = 2] = "SealedSenderSelfSend";
|
|
14
14
|
ErrorCode[ErrorCode["UntrustedIdentity"] = 3] = "UntrustedIdentity";
|
|
15
15
|
ErrorCode[ErrorCode["InvalidRegistrationId"] = 4] = "InvalidRegistrationId";
|
|
16
|
-
ErrorCode[ErrorCode["
|
|
17
|
-
ErrorCode[ErrorCode["
|
|
18
|
-
ErrorCode[ErrorCode["
|
|
19
|
-
ErrorCode[ErrorCode["
|
|
20
|
-
ErrorCode[ErrorCode["
|
|
21
|
-
ErrorCode[ErrorCode["
|
|
22
|
-
ErrorCode[ErrorCode["
|
|
23
|
-
ErrorCode[ErrorCode["
|
|
24
|
-
ErrorCode[ErrorCode["
|
|
25
|
-
ErrorCode[ErrorCode["
|
|
26
|
-
ErrorCode[ErrorCode["
|
|
27
|
-
ErrorCode[ErrorCode["
|
|
28
|
-
ErrorCode[ErrorCode["
|
|
29
|
-
ErrorCode[ErrorCode["
|
|
30
|
-
ErrorCode[ErrorCode["
|
|
31
|
-
ErrorCode[ErrorCode["
|
|
32
|
-
ErrorCode[ErrorCode["
|
|
33
|
-
ErrorCode[ErrorCode["
|
|
34
|
-
ErrorCode[ErrorCode["
|
|
35
|
-
ErrorCode[ErrorCode["
|
|
36
|
-
ErrorCode[ErrorCode["
|
|
37
|
-
ErrorCode[ErrorCode["
|
|
38
|
-
ErrorCode[ErrorCode["
|
|
39
|
-
ErrorCode[ErrorCode["
|
|
40
|
-
ErrorCode[ErrorCode["
|
|
41
|
-
ErrorCode[ErrorCode["
|
|
42
|
-
ErrorCode[ErrorCode["
|
|
43
|
-
ErrorCode[ErrorCode["
|
|
44
|
-
ErrorCode[ErrorCode["
|
|
45
|
-
ErrorCode[ErrorCode["
|
|
46
|
-
ErrorCode[ErrorCode["
|
|
47
|
-
ErrorCode[ErrorCode["
|
|
48
|
-
ErrorCode[ErrorCode["
|
|
49
|
-
ErrorCode[ErrorCode["
|
|
50
|
-
ErrorCode[ErrorCode["
|
|
51
|
-
ErrorCode[ErrorCode["
|
|
16
|
+
ErrorCode[ErrorCode["InvalidProtocolAddress"] = 5] = "InvalidProtocolAddress";
|
|
17
|
+
ErrorCode[ErrorCode["VerificationFailed"] = 6] = "VerificationFailed";
|
|
18
|
+
ErrorCode[ErrorCode["InvalidSession"] = 7] = "InvalidSession";
|
|
19
|
+
ErrorCode[ErrorCode["InvalidSenderKeySession"] = 8] = "InvalidSenderKeySession";
|
|
20
|
+
ErrorCode[ErrorCode["NicknameCannotBeEmpty"] = 9] = "NicknameCannotBeEmpty";
|
|
21
|
+
ErrorCode[ErrorCode["CannotStartWithDigit"] = 10] = "CannotStartWithDigit";
|
|
22
|
+
ErrorCode[ErrorCode["MissingSeparator"] = 11] = "MissingSeparator";
|
|
23
|
+
ErrorCode[ErrorCode["BadNicknameCharacter"] = 12] = "BadNicknameCharacter";
|
|
24
|
+
ErrorCode[ErrorCode["NicknameTooShort"] = 13] = "NicknameTooShort";
|
|
25
|
+
ErrorCode[ErrorCode["NicknameTooLong"] = 14] = "NicknameTooLong";
|
|
26
|
+
ErrorCode[ErrorCode["DiscriminatorCannotBeEmpty"] = 15] = "DiscriminatorCannotBeEmpty";
|
|
27
|
+
ErrorCode[ErrorCode["DiscriminatorCannotBeZero"] = 16] = "DiscriminatorCannotBeZero";
|
|
28
|
+
ErrorCode[ErrorCode["DiscriminatorCannotBeSingleDigit"] = 17] = "DiscriminatorCannotBeSingleDigit";
|
|
29
|
+
ErrorCode[ErrorCode["DiscriminatorCannotHaveLeadingZeros"] = 18] = "DiscriminatorCannotHaveLeadingZeros";
|
|
30
|
+
ErrorCode[ErrorCode["BadDiscriminatorCharacter"] = 19] = "BadDiscriminatorCharacter";
|
|
31
|
+
ErrorCode[ErrorCode["DiscriminatorTooLarge"] = 20] = "DiscriminatorTooLarge";
|
|
32
|
+
ErrorCode[ErrorCode["IoError"] = 21] = "IoError";
|
|
33
|
+
ErrorCode[ErrorCode["CdsiInvalidToken"] = 22] = "CdsiInvalidToken";
|
|
34
|
+
ErrorCode[ErrorCode["InvalidUri"] = 23] = "InvalidUri";
|
|
35
|
+
ErrorCode[ErrorCode["InvalidMediaInput"] = 24] = "InvalidMediaInput";
|
|
36
|
+
ErrorCode[ErrorCode["UnsupportedMediaInput"] = 25] = "UnsupportedMediaInput";
|
|
37
|
+
ErrorCode[ErrorCode["InputDataTooLong"] = 26] = "InputDataTooLong";
|
|
38
|
+
ErrorCode[ErrorCode["InvalidEntropyDataLength"] = 27] = "InvalidEntropyDataLength";
|
|
39
|
+
ErrorCode[ErrorCode["InvalidUsernameLinkEncryptedData"] = 28] = "InvalidUsernameLinkEncryptedData";
|
|
40
|
+
ErrorCode[ErrorCode["RateLimitedError"] = 29] = "RateLimitedError";
|
|
41
|
+
ErrorCode[ErrorCode["SvrDataMissing"] = 30] = "SvrDataMissing";
|
|
42
|
+
ErrorCode[ErrorCode["SvrRequestFailed"] = 31] = "SvrRequestFailed";
|
|
43
|
+
ErrorCode[ErrorCode["SvrRestoreFailed"] = 32] = "SvrRestoreFailed";
|
|
44
|
+
ErrorCode[ErrorCode["ChatServiceInactive"] = 33] = "ChatServiceInactive";
|
|
45
|
+
ErrorCode[ErrorCode["AppExpired"] = 34] = "AppExpired";
|
|
46
|
+
ErrorCode[ErrorCode["DeviceDelinked"] = 35] = "DeviceDelinked";
|
|
47
|
+
ErrorCode[ErrorCode["ConnectionInvalidated"] = 36] = "ConnectionInvalidated";
|
|
48
|
+
ErrorCode[ErrorCode["ConnectedElsewhere"] = 37] = "ConnectedElsewhere";
|
|
49
|
+
ErrorCode[ErrorCode["BackupValidation"] = 38] = "BackupValidation";
|
|
50
|
+
ErrorCode[ErrorCode["Cancelled"] = 39] = "Cancelled";
|
|
51
|
+
ErrorCode[ErrorCode["KeyTransparencyError"] = 40] = "KeyTransparencyError";
|
|
52
|
+
ErrorCode[ErrorCode["KeyTransparencyVerificationFailed"] = 41] = "KeyTransparencyVerificationFailed";
|
|
52
53
|
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
53
54
|
class LibSignalErrorBase extends Error {
|
|
54
55
|
constructor(message, name, operation, extraProps) {
|
package/dist/MessageBackup.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/**
|
|
3
2
|
* Message backup validation routines.
|
|
4
3
|
*
|
|
@@ -34,8 +33,8 @@ export type MessageBackupKeyInput = Readonly<{
|
|
|
34
33
|
accountEntropy: string;
|
|
35
34
|
aci: Aci;
|
|
36
35
|
} | {
|
|
37
|
-
backupKey: BackupKey |
|
|
38
|
-
backupId:
|
|
36
|
+
backupKey: BackupKey | Uint8Array;
|
|
37
|
+
backupId: Uint8Array;
|
|
39
38
|
}>;
|
|
40
39
|
/**
|
|
41
40
|
* Key used to encrypt and decrypt a message backup bundle.
|
|
@@ -56,9 +55,9 @@ export declare class MessageBackupKey {
|
|
|
56
55
|
*/
|
|
57
56
|
constructor(input: MessageBackupKeyInput);
|
|
58
57
|
/** An HMAC key used to sign a backup file. */
|
|
59
|
-
get hmacKey():
|
|
58
|
+
get hmacKey(): Uint8Array;
|
|
60
59
|
/** An AES-256-CBC key used to encrypt a backup file. */
|
|
61
|
-
get aesKey():
|
|
60
|
+
get aesKey(): Uint8Array;
|
|
62
61
|
}
|
|
63
62
|
export declare enum Purpose {
|
|
64
63
|
DeviceTransfer = 0,
|
|
@@ -108,7 +107,7 @@ export declare class OnlineBackupValidator {
|
|
|
108
107
|
*
|
|
109
108
|
* @throws BackupValidationError on error
|
|
110
109
|
*/
|
|
111
|
-
constructor(backupInfo:
|
|
110
|
+
constructor(backupInfo: Uint8Array, purpose: Purpose);
|
|
112
111
|
/**
|
|
113
112
|
* Processes a single Frame protobuf message.
|
|
114
113
|
*
|
|
@@ -116,7 +115,7 @@ export declare class OnlineBackupValidator {
|
|
|
116
115
|
*
|
|
117
116
|
* @throws BackupValidationError on error
|
|
118
117
|
*/
|
|
119
|
-
addFrame(frame:
|
|
118
|
+
addFrame(frame: Uint8Array): void;
|
|
120
119
|
/**
|
|
121
120
|
* Marks that a backup is complete, and does any final checks that require whole-file knowledge.
|
|
122
121
|
*
|
package/dist/Minidump.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function toJSONString(buffer: Buffer): string;
|
|
1
|
+
export declare function toJSONString(buffer: Uint8Array): string;
|
package/dist/Mp4Sanitizer.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/**
|
|
3
2
|
* An MP4 format “sanitizer”.
|
|
4
3
|
*
|
|
@@ -36,7 +35,7 @@ export declare class SanitizedMetadata {
|
|
|
36
35
|
* Get the sanitized metadata, if any.
|
|
37
36
|
* @returns The sanitized metadata, or `null` if it didn't need to be sanitized.
|
|
38
37
|
*/
|
|
39
|
-
getMetadata():
|
|
38
|
+
getMetadata(): Uint8Array | null;
|
|
40
39
|
/**
|
|
41
40
|
* Get the offset of the media data in the processed input.
|
|
42
41
|
* @returns The offset of the media data in the processed input.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as Native from '../Native';
|
|
3
2
|
/**
|
|
4
3
|
* A single recipient parsed from a {@link SealedSenderMultiRecipientMessage}.
|
|
@@ -17,13 +16,13 @@ export interface Recipient {
|
|
|
17
16
|
* material.
|
|
18
17
|
*/
|
|
19
18
|
export default class SealedSenderMultiRecipientMessage {
|
|
20
|
-
readonly _buffer:
|
|
19
|
+
readonly _buffer: Uint8Array;
|
|
21
20
|
readonly _recipientMap: {
|
|
22
21
|
[serviceId: string]: Native.SealedSenderMultiRecipientMessageRecipient;
|
|
23
22
|
};
|
|
24
23
|
readonly _excludedRecipients: string[];
|
|
25
24
|
readonly _offsetOfSharedData: number;
|
|
26
|
-
constructor(buffer:
|
|
25
|
+
constructor(buffer: Uint8Array);
|
|
27
26
|
/**
|
|
28
27
|
* Returns the recipients parsed from the message, keyed by service ID string.
|
|
29
28
|
*
|
|
@@ -47,5 +46,5 @@ export default class SealedSenderMultiRecipientMessage {
|
|
|
47
46
|
* {@link #recipientsByServiceIdString}. The same payload should be sent to all of the recipient's
|
|
48
47
|
* devices.
|
|
49
48
|
*/
|
|
50
|
-
messageForRecipient(recipient: Recipient):
|
|
49
|
+
messageForRecipient(recipient: Recipient): Uint8Array;
|
|
51
50
|
}
|
|
@@ -46,11 +46,13 @@ class SealedSenderMultiRecipientMessage {
|
|
|
46
46
|
*/
|
|
47
47
|
messageForRecipient(recipient) {
|
|
48
48
|
const nativeRecipient = recipient;
|
|
49
|
-
|
|
49
|
+
// Use Buffer.concat for convenience, but return a proper Uint8Array, both for the correct type
|
|
50
|
+
// and to make an independent copy of a possibly-reused buffer.
|
|
51
|
+
return new Uint8Array(Buffer.concat([
|
|
50
52
|
Buffer.of(0x22), // The "original" Sealed Sender V2 version
|
|
51
53
|
this._buffer.subarray(nativeRecipient.rangeOffset, nativeRecipient.rangeOffset + nativeRecipient.rangeLen),
|
|
52
54
|
this._buffer.subarray(this._offsetOfSharedData),
|
|
53
|
-
]);
|
|
55
|
+
]));
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
exports.default = SealedSenderMultiRecipientMessage;
|
package/dist/WebpSanitizer.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/**
|
|
3
2
|
* Sanitize a WebP input.
|
|
4
3
|
*
|
|
@@ -7,4 +6,4 @@
|
|
|
7
6
|
* @throws {InvalidMediaInputError} If the input could not be parsed because it was invalid.
|
|
8
7
|
* @throws {UnsupportedMediaInputError} If the input could not be parsed because it's unsupported in some way.
|
|
9
8
|
*/
|
|
10
|
-
export declare function sanitize(input:
|
|
9
|
+
export declare function sanitize(input: Uint8Array): void;
|