@signalapp/libsignal-client 0.88.3 → 0.89.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/dist/AccountKeys.d.ts +8 -8
- package/dist/AccountKeys.js +4 -2
- package/dist/Address.d.ts +8 -8
- package/dist/Address.js +7 -2
- package/dist/EcKeys.d.ts +14 -14
- package/dist/EcKeys.js +4 -0
- package/dist/Errors.d.ts +7 -3
- package/dist/Errors.js +8 -0
- package/dist/MessageBackup.d.ts +8 -8
- package/dist/MessageBackup.js +13 -0
- package/dist/Minidump.d.ts +1 -1
- package/dist/Mp4Sanitizer.d.ts +1 -1
- package/dist/Mp4Sanitizer.js +1 -0
- package/dist/Native.d.ts +24 -19
- package/dist/Native.js +3 -3
- package/dist/ProtocolTypes.d.ts +45 -0
- package/dist/ProtocolTypes.js +106 -0
- package/dist/SealedSenderMultiRecipientMessage.d.ts +3 -3
- package/dist/SealedSenderMultiRecipientMessage.js +4 -0
- package/dist/WebpSanitizer.d.ts +1 -1
- package/dist/acknowledgments.md +1 -1
- package/dist/incremental_mac.d.ts +5 -7
- package/dist/incremental_mac.js +7 -5
- package/dist/index.d.ts +85 -129
- package/dist/index.js +66 -128
- package/dist/internal.js +1 -0
- package/dist/io.d.ts +2 -2
- package/dist/net/Chat.d.ts +3 -3
- package/dist/net/Chat.js +14 -0
- package/dist/net/FakeChat.d.ts +4 -4
- package/dist/net/FakeChat.js +4 -0
- package/dist/net/KeyTransparency.d.ts +7 -7
- package/dist/net/KeyTransparency.js +3 -0
- package/dist/net/Registration.d.ts +4 -4
- package/dist/net/Registration.js +5 -0
- package/dist/net/SvrB.d.ts +6 -6
- package/dist/net/SvrB.js +6 -0
- package/dist/net/chat/UnauthKeysService.d.ts +30 -0
- package/dist/net/chat/UnauthKeysService.js +20 -0
- package/dist/net/chat/UnauthMessagesService.d.ts +1 -1
- package/dist/net/chat/UnauthMessagesService.js +1 -0
- package/dist/net/chat/UnauthUsernamesService.d.ts +3 -3
- package/dist/net/chat/UnauthUsernamesService.js +2 -2
- package/dist/net.d.ts +4 -3
- package/dist/net.js +7 -1
- package/dist/usernames.d.ts +8 -8
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +5 -1
- package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -1
- package/dist/zkgroup/GenericServerPublicParams.js +1 -0
- package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -2
- package/dist/zkgroup/GenericServerSecretParams.js +1 -0
- package/dist/zkgroup/NotarySignature.d.ts +1 -1
- package/dist/zkgroup/NotarySignature.js +3 -3
- package/dist/zkgroup/ServerPublicParams.d.ts +4 -4
- package/dist/zkgroup/ServerPublicParams.js +1 -0
- package/dist/zkgroup/ServerSecretParams.d.ts +5 -5
- package/dist/zkgroup/ServerSecretParams.js +1 -0
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialPresentation.js +1 -0
- package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPni.js +1 -0
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.js +1 -0
- package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +1 -1
- package/dist/zkgroup/auth/ClientZkAuthOperations.js +1 -0
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +1 -1
- package/dist/zkgroup/auth/ServerZkAuthOperations.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +3 -3
- package/dist/zkgroup/backups/BackupAuthCredential.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +2 -2
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.js +1 -0
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +3 -3
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +3 -2
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +2 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +2 -2
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -1
- package/dist/zkgroup/calllinks/CallLinkPublicParams.js +1 -0
- package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +2 -2
- package/dist/zkgroup/calllinks/CallLinkSecretParams.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +3 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +2 -2
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +3 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.js +1 -0
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.js +1 -0
- package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +3 -3
- package/dist/zkgroup/groups/ClientZkGroupCipher.js +1 -0
- package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -1
- package/dist/zkgroup/groups/GroupIdentifier.js +3 -3
- package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -1
- package/dist/zkgroup/groups/GroupMasterKey.js +3 -3
- package/dist/zkgroup/groups/GroupPublicParams.d.ts +1 -1
- package/dist/zkgroup/groups/GroupPublicParams.js +1 -0
- package/dist/zkgroup/groups/GroupSecretParams.d.ts +2 -2
- package/dist/zkgroup/groups/GroupSecretParams.js +1 -0
- package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/ProfileKeyCiphertext.js +1 -0
- package/dist/zkgroup/groups/UuidCiphertext.d.ts +2 -2
- package/dist/zkgroup/groups/UuidCiphertext.js +1 -0
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +1 -1
- package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +1 -1
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +1 -1
- package/dist/zkgroup/groupsend/GroupSendToken.d.ts +1 -1
- package/dist/zkgroup/internal/ByteArray.d.ts +5 -5
- package/dist/zkgroup/internal/ByteArray.js +1 -0
- package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +2 -2
- package/dist/zkgroup/profiles/ClientZkProfileOperations.js +1 -0
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.js +1 -0
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.js +1 -0
- package/dist/zkgroup/profiles/ProfileKey.d.ts +2 -2
- package/dist/zkgroup/profiles/ProfileKey.js +3 -3
- package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCommitment.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.js +1 -0
- package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyVersion.js +3 -3
- package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +1 -1
- package/dist/zkgroup/profiles/ServerZkProfileOperations.js +1 -0
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +2 -2
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.js +1 -0
- package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredential.js +1 -0
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.js +3 -3
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.js +1 -0
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.js +3 -3
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.js +1 -0
- package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptSerial.js +3 -3
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +1 -1
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.js +1 -0
- package/package.json +3 -3
- 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
|
@@ -27,7 +27,7 @@ export declare class AccountEntropyPool {
|
|
|
27
27
|
* `accountEntropyPool` must be a **validated** account entropy pool;
|
|
28
28
|
* passing an arbitrary string here is considered a programmer error.
|
|
29
29
|
*/
|
|
30
|
-
static deriveSvrKey(accountEntropyPool: string): Uint8Array
|
|
30
|
+
static deriveSvrKey(accountEntropyPool: string): Uint8Array<ArrayBuffer>;
|
|
31
31
|
/**
|
|
32
32
|
* Derives a backup key from the given account entropy pool.
|
|
33
33
|
*
|
|
@@ -48,7 +48,7 @@ export declare class AccountEntropyPool {
|
|
|
48
48
|
export declare class BackupKey extends ByteArray {
|
|
49
49
|
private readonly __type?;
|
|
50
50
|
static SIZE: number;
|
|
51
|
-
constructor(contents: Uint8Array);
|
|
51
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
52
52
|
/**
|
|
53
53
|
* Generates a random backup key.
|
|
54
54
|
*
|
|
@@ -62,7 +62,7 @@ export declare class BackupKey extends ByteArray {
|
|
|
62
62
|
*
|
|
63
63
|
* Used for both message and media backups.
|
|
64
64
|
*/
|
|
65
|
-
deriveBackupId(aci: Aci): Uint8Array
|
|
65
|
+
deriveBackupId(aci: Aci): Uint8Array<ArrayBuffer>;
|
|
66
66
|
/**
|
|
67
67
|
* Derives the backup EC key to use given the current device's ACI.
|
|
68
68
|
*
|
|
@@ -74,13 +74,13 @@ export declare class BackupKey extends ByteArray {
|
|
|
74
74
|
*
|
|
75
75
|
* Only relevant for message backup keys.
|
|
76
76
|
*/
|
|
77
|
-
deriveLocalBackupMetadataKey(): Uint8Array
|
|
77
|
+
deriveLocalBackupMetadataKey(): Uint8Array<ArrayBuffer>;
|
|
78
78
|
/**
|
|
79
79
|
* Derives the ID for uploading media with the name `mediaName`.
|
|
80
80
|
*
|
|
81
81
|
* Only relevant for media backup keys.
|
|
82
82
|
*/
|
|
83
|
-
deriveMediaId(mediaName: string): Uint8Array
|
|
83
|
+
deriveMediaId(mediaName: string): Uint8Array<ArrayBuffer>;
|
|
84
84
|
/**
|
|
85
85
|
* Derives the composite encryption key for re-encrypting media with the given ID.
|
|
86
86
|
*
|
|
@@ -88,7 +88,7 @@ export declare class BackupKey extends ByteArray {
|
|
|
88
88
|
*
|
|
89
89
|
* Only relevant for media backup keys.
|
|
90
90
|
*/
|
|
91
|
-
deriveMediaEncryptionKey(mediaId: Uint8Array): Uint8Array
|
|
91
|
+
deriveMediaEncryptionKey(mediaId: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
92
92
|
/**
|
|
93
93
|
* Derives the composite encryption key for uploading thumbnails with the given ID to the "transit
|
|
94
94
|
* tier" CDN.
|
|
@@ -97,7 +97,7 @@ export declare class BackupKey extends ByteArray {
|
|
|
97
97
|
*
|
|
98
98
|
* Only relevant for media backup keys.
|
|
99
99
|
*/
|
|
100
|
-
deriveThumbnailTransitEncryptionKey(mediaId: Uint8Array): Uint8Array
|
|
100
|
+
deriveThumbnailTransitEncryptionKey(mediaId: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* A forward secrecy token used for deriving message backup keys.
|
|
@@ -108,5 +108,5 @@ export declare class BackupKey extends ByteArray {
|
|
|
108
108
|
export declare class BackupForwardSecrecyToken extends ByteArray {
|
|
109
109
|
private readonly __type?;
|
|
110
110
|
static SIZE: number;
|
|
111
|
-
constructor(contents: Uint8Array);
|
|
111
|
+
constructor(contents: Uint8Array<ArrayBuffer>);
|
|
112
112
|
}
|
package/dist/AccountKeys.js
CHANGED
|
@@ -66,6 +66,8 @@ export class AccountEntropyPool {
|
|
|
66
66
|
* a "media" key (formally the "media root backup key") that's not derived from anything else.
|
|
67
67
|
*/
|
|
68
68
|
export class BackupKey extends ByteArray {
|
|
69
|
+
__type;
|
|
70
|
+
static SIZE = 32;
|
|
69
71
|
constructor(contents) {
|
|
70
72
|
super(contents, BackupKey.checkLength(BackupKey.SIZE));
|
|
71
73
|
}
|
|
@@ -134,7 +136,6 @@ export class BackupKey extends ByteArray {
|
|
|
134
136
|
return Native.BackupKey_DeriveThumbnailTransitEncryptionKey(this.contents, mediaId);
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
|
-
BackupKey.SIZE = 32;
|
|
138
139
|
/**
|
|
139
140
|
* A forward secrecy token used for deriving message backup keys.
|
|
140
141
|
*
|
|
@@ -142,9 +143,10 @@ BackupKey.SIZE = 32;
|
|
|
142
143
|
* with the backup key to derive the actual encryption keys for message backups.
|
|
143
144
|
*/
|
|
144
145
|
export class BackupForwardSecrecyToken extends ByteArray {
|
|
146
|
+
__type;
|
|
147
|
+
static SIZE = 32;
|
|
145
148
|
constructor(contents) {
|
|
146
149
|
super(contents, BackupForwardSecrecyToken.checkLength(BackupForwardSecrecyToken.SIZE));
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
|
-
BackupForwardSecrecyToken.SIZE = 32;
|
|
150
152
|
//# sourceMappingURL=AccountKeys.js.map
|
package/dist/Address.d.ts
CHANGED
|
@@ -11,18 +11,18 @@ export declare enum ServiceIdKind {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare abstract class ServiceId extends Object {
|
|
13
13
|
private readonly serviceIdFixedWidthBinary;
|
|
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
|
|
14
|
+
constructor(serviceIdFixedWidthBinary: Uint8Array<ArrayBuffer>);
|
|
15
|
+
protected static fromUuidBytesAndKind<T extends typeof ServiceId>(this: new (serviceIdFixedWidthBinary: Uint8Array<ArrayBuffer>) => InstanceType<T>, uuidBytes: ArrayLike<number>, kind: ServiceIdKind): InstanceType<T>;
|
|
16
|
+
getServiceIdBinary(): Uint8Array<ArrayBuffer>;
|
|
17
|
+
getServiceIdFixedWidthBinary(): Uint8Array<ArrayBuffer>;
|
|
18
18
|
getServiceIdString(): string;
|
|
19
19
|
toString(): string;
|
|
20
20
|
private downcastTo;
|
|
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>;
|
|
21
|
+
static parseFromServiceIdFixedWidthBinary<T extends typeof ServiceId>(this: T, serviceIdFixedWidthBinary: Uint8Array<ArrayBuffer>): InstanceType<T>;
|
|
22
|
+
static parseFromServiceIdBinary<T extends typeof ServiceId>(this: T, serviceIdBinary: Uint8Array<ArrayBuffer>): InstanceType<T>;
|
|
23
23
|
static parseFromServiceIdString<T extends typeof ServiceId>(this: T, serviceIdString: string): InstanceType<T>;
|
|
24
24
|
getRawUuid(): string;
|
|
25
|
-
getRawUuidBytes(): Uint8Array
|
|
25
|
+
getRawUuidBytes(): Uint8Array<ArrayBuffer>;
|
|
26
26
|
isEqual(other: ServiceId): boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Orders ServiceIds by kind, then lexicographically by the bytes of the UUID.
|
|
@@ -30,7 +30,7 @@ export declare abstract class ServiceId extends Object {
|
|
|
30
30
|
* Compatible with <code>Array.sort</code>.
|
|
31
31
|
*/
|
|
32
32
|
static comparator(this: void, lhs: ServiceId, rhs: ServiceId): number;
|
|
33
|
-
static toConcatenatedFixedWidthBinary(serviceIds: ServiceId[]): Uint8Array
|
|
33
|
+
static toConcatenatedFixedWidthBinary(serviceIds: ServiceId[]): Uint8Array<ArrayBuffer>;
|
|
34
34
|
}
|
|
35
35
|
export declare class Aci extends ServiceId {
|
|
36
36
|
private readonly __type?;
|
package/dist/Address.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Native from './Native.js';
|
|
6
6
|
import * as uuid from 'uuid';
|
|
7
7
|
import { Buffer } from 'node:buffer';
|
|
8
|
+
import { parseUuid } from './uuid.js';
|
|
8
9
|
export var ServiceIdKind;
|
|
9
10
|
(function (ServiceIdKind) {
|
|
10
11
|
ServiceIdKind[ServiceIdKind["Aci"] = 0] = "Aci";
|
|
@@ -18,6 +19,7 @@ const SERVICE_ID_FIXED_WIDTH_BINARY_LEN = 17;
|
|
|
18
19
|
* user on the Signal service.
|
|
19
20
|
*/
|
|
20
21
|
export class ServiceId extends Object {
|
|
22
|
+
serviceIdFixedWidthBinary;
|
|
21
23
|
// This has to be public for `InstanceType<T>`, which we use below.
|
|
22
24
|
constructor(serviceIdFixedWidthBinary) {
|
|
23
25
|
super();
|
|
@@ -101,22 +103,25 @@ export class ServiceId extends Object {
|
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
export class Aci extends ServiceId {
|
|
106
|
+
__type;
|
|
104
107
|
static fromUuid(uuidString) {
|
|
105
|
-
return this.fromUuidBytes(
|
|
108
|
+
return this.fromUuidBytes(parseUuid(uuidString));
|
|
106
109
|
}
|
|
107
110
|
static fromUuidBytes(uuidBytes) {
|
|
108
111
|
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Aci);
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
export class Pni extends ServiceId {
|
|
115
|
+
__type;
|
|
112
116
|
static fromUuid(uuidString) {
|
|
113
|
-
return this.fromUuidBytes(
|
|
117
|
+
return this.fromUuidBytes(parseUuid(uuidString));
|
|
114
118
|
}
|
|
115
119
|
static fromUuidBytes(uuidBytes) {
|
|
116
120
|
return this.fromUuidBytesAndKind(uuidBytes, ServiceIdKind.Pni);
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
export class ProtocolAddress {
|
|
124
|
+
_nativeHandle;
|
|
120
125
|
constructor(handle) {
|
|
121
126
|
this._nativeHandle = handle;
|
|
122
127
|
}
|
package/dist/EcKeys.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ export declare class PublicKey {
|
|
|
3
3
|
readonly _nativeHandle: Native.PublicKey;
|
|
4
4
|
private constructor();
|
|
5
5
|
static _fromNativeHandle(handle: Native.PublicKey): PublicKey;
|
|
6
|
-
static deserialize(buf: Uint8Array): PublicKey;
|
|
6
|
+
static deserialize(buf: Uint8Array<ArrayBuffer>): PublicKey;
|
|
7
7
|
equals(other: PublicKey): boolean;
|
|
8
|
-
serialize(): Uint8Array
|
|
9
|
-
getPublicKeyBytes(): Uint8Array
|
|
10
|
-
verify(msg: Uint8Array
|
|
11
|
-
verifyAlternateIdentity(other: PublicKey, signature: Uint8Array): boolean;
|
|
8
|
+
serialize(): Uint8Array<ArrayBuffer>;
|
|
9
|
+
getPublicKeyBytes(): Uint8Array<ArrayBuffer>;
|
|
10
|
+
verify(msg: Uint8Array<ArrayBuffer>, sig: Uint8Array<ArrayBuffer>): boolean;
|
|
11
|
+
verifyAlternateIdentity(other: PublicKey, signature: Uint8Array<ArrayBuffer>): boolean;
|
|
12
12
|
/**
|
|
13
13
|
* Seals a message so only the holder of the private key can decrypt it.
|
|
14
14
|
*
|
|
@@ -21,17 +21,17 @@ export declare class PublicKey {
|
|
|
21
21
|
*
|
|
22
22
|
* @see PrivateKey#open
|
|
23
23
|
*/
|
|
24
|
-
seal(msg: Uint8Array
|
|
24
|
+
seal(msg: Uint8Array<ArrayBuffer>, info: string | Uint8Array<ArrayBuffer>, associatedData?: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
25
25
|
}
|
|
26
26
|
export declare class PrivateKey {
|
|
27
27
|
readonly _nativeHandle: Native.PrivateKey;
|
|
28
28
|
private constructor();
|
|
29
29
|
static _fromNativeHandle(handle: Native.PrivateKey): PrivateKey;
|
|
30
30
|
static generate(): PrivateKey;
|
|
31
|
-
static deserialize(buf: Uint8Array): PrivateKey;
|
|
32
|
-
serialize(): Uint8Array
|
|
33
|
-
sign(msg: Uint8Array): Uint8Array
|
|
34
|
-
agree(other_key: PublicKey): Uint8Array
|
|
31
|
+
static deserialize(buf: Uint8Array<ArrayBuffer>): PrivateKey;
|
|
32
|
+
serialize(): Uint8Array<ArrayBuffer>;
|
|
33
|
+
sign(msg: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
34
|
+
agree(other_key: PublicKey): Uint8Array<ArrayBuffer>;
|
|
35
35
|
getPublicKey(): PublicKey;
|
|
36
36
|
/**
|
|
37
37
|
* Opens a ciphertext sealed with {@link PublicKey#seal}.
|
|
@@ -40,14 +40,14 @@ export declare class PrivateKey {
|
|
|
40
40
|
* include its original type byte indicating the chosen algorithms and ciphertext layout. The
|
|
41
41
|
* `info` and `associatedData` must match those used during sealing.
|
|
42
42
|
*/
|
|
43
|
-
open(ciphertext: Uint8Array
|
|
43
|
+
open(ciphertext: Uint8Array<ArrayBuffer>, info: string | Uint8Array<ArrayBuffer>, associatedData?: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
|
|
44
44
|
}
|
|
45
45
|
export declare class IdentityKeyPair {
|
|
46
46
|
readonly publicKey: PublicKey;
|
|
47
47
|
readonly privateKey: PrivateKey;
|
|
48
48
|
constructor(publicKey: PublicKey, privateKey: PrivateKey);
|
|
49
49
|
static generate(): IdentityKeyPair;
|
|
50
|
-
static deserialize(buffer: Uint8Array): IdentityKeyPair;
|
|
51
|
-
serialize(): Uint8Array
|
|
52
|
-
signAlternateIdentity(other: PublicKey): Uint8Array
|
|
50
|
+
static deserialize(buffer: Uint8Array<ArrayBuffer>): IdentityKeyPair;
|
|
51
|
+
serialize(): Uint8Array<ArrayBuffer>;
|
|
52
|
+
signAlternateIdentity(other: PublicKey): Uint8Array<ArrayBuffer>;
|
|
53
53
|
}
|
package/dist/EcKeys.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
//
|
|
5
5
|
import * as Native from './Native.js';
|
|
6
6
|
export class PublicKey {
|
|
7
|
+
_nativeHandle;
|
|
7
8
|
constructor(handle) {
|
|
8
9
|
this._nativeHandle = handle;
|
|
9
10
|
}
|
|
@@ -46,6 +47,7 @@ export class PublicKey {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
export class PrivateKey {
|
|
50
|
+
_nativeHandle;
|
|
49
51
|
constructor(handle) {
|
|
50
52
|
this._nativeHandle = handle;
|
|
51
53
|
}
|
|
@@ -83,6 +85,8 @@ export class PrivateKey {
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
export class IdentityKeyPair {
|
|
88
|
+
publicKey;
|
|
89
|
+
privateKey;
|
|
86
90
|
constructor(publicKey, privateKey) {
|
|
87
91
|
this.publicKey = publicKey;
|
|
88
92
|
this.privateKey = privateKey;
|
package/dist/Errors.d.ts
CHANGED
|
@@ -49,10 +49,11 @@ export declare enum ErrorCode {
|
|
|
49
49
|
KeyTransparencyVerificationFailed = 45,
|
|
50
50
|
IncrementalMacVerificationFailed = 46,
|
|
51
51
|
RequestUnauthorized = 47,
|
|
52
|
-
MismatchedDevices = 48
|
|
52
|
+
MismatchedDevices = 48,
|
|
53
|
+
ServiceIdNotFound = 49
|
|
53
54
|
}
|
|
54
55
|
/** Called out as a separate type so it's not confused with a normal ServiceIdBinary. */
|
|
55
|
-
type ServiceIdFixedWidthBinary = Uint8Array
|
|
56
|
+
type ServiceIdFixedWidthBinary = Uint8Array<ArrayBuffer>;
|
|
56
57
|
/**
|
|
57
58
|
* A failure sending to a recipient on account of not being up to date on their devices.
|
|
58
59
|
*
|
|
@@ -248,5 +249,8 @@ export type MismatchedDevicesError = LibSignalErrorCommon & {
|
|
|
248
249
|
code: ErrorCode.MismatchedDevices;
|
|
249
250
|
readonly entries: MismatchedDevicesEntry[];
|
|
250
251
|
};
|
|
251
|
-
export type
|
|
252
|
+
export type ServiceIdNotFound = LibSignalErrorCommon & {
|
|
253
|
+
code: ErrorCode.ServiceIdNotFound;
|
|
254
|
+
};
|
|
255
|
+
export type LibSignalError = GenericError | DuplicatedMessageError | SealedSenderSelfSendError | UntrustedIdentityError | InvalidRegistrationIdError | InvalidProtocolAddress | VerificationFailedError | InvalidSessionError | InvalidSenderKeySessionError | NicknameCannotBeEmptyError | CannotStartWithDigitError | MissingSeparatorError | BadNicknameCharacterError | NicknameTooShortError | NicknameTooLongError | DiscriminatorCannotBeEmptyError | DiscriminatorCannotBeZeroError | DiscriminatorCannotBeSingleDigitError | DiscriminatorCannotHaveLeadingZerosError | BadDiscriminatorCharacterError | DiscriminatorTooLargeError | InputDataTooLong | InvalidEntropyDataLength | InvalidUsernameLinkEncryptedData | IoError | CdsiInvalidTokenError | InvalidUriError | InvalidMediaInputError | SvrDataMissingError | SvrRestoreFailedError | SvrRequestFailedError | SvrAttestationError | SvrInvalidDataError | UnsupportedMediaInputError | ChatServiceInactive | AppExpiredError | DeviceDelinkedError | ConnectionInvalidatedError | ConnectedElsewhereError | PossibleCaptiveNetworkError | RateLimitedError | RateLimitChallengeError | BackupValidationError | CancellationError | KeyTransparencyError | KeyTransparencyVerificationFailed | IncrementalMacVerificationFailed | RequestUnauthorizedError | MismatchedDevicesError | ServiceIdNotFound;
|
|
252
256
|
export {};
|
package/dist/Errors.js
CHANGED
|
@@ -54,6 +54,7 @@ export var ErrorCode;
|
|
|
54
54
|
ErrorCode[ErrorCode["IncrementalMacVerificationFailed"] = 46] = "IncrementalMacVerificationFailed";
|
|
55
55
|
ErrorCode[ErrorCode["RequestUnauthorized"] = 47] = "RequestUnauthorized";
|
|
56
56
|
ErrorCode[ErrorCode["MismatchedDevices"] = 48] = "MismatchedDevices";
|
|
57
|
+
ErrorCode[ErrorCode["ServiceIdNotFound"] = 49] = "ServiceIdNotFound";
|
|
57
58
|
})(ErrorCode || (ErrorCode = {}));
|
|
58
59
|
/**
|
|
59
60
|
* A failure sending to a recipient on account of not being up to date on their devices.
|
|
@@ -66,6 +67,10 @@ export var ErrorCode;
|
|
|
66
67
|
* establishing new sessions for the "missing" and "stale" devices.
|
|
67
68
|
*/
|
|
68
69
|
export class MismatchedDevicesEntry {
|
|
70
|
+
account;
|
|
71
|
+
missingDevices;
|
|
72
|
+
extraDevices;
|
|
73
|
+
staleDevices;
|
|
69
74
|
constructor({ account, missingDevices, extraDevices, staleDevices, }) {
|
|
70
75
|
this.account =
|
|
71
76
|
account instanceof ServiceId
|
|
@@ -77,6 +82,9 @@ export class MismatchedDevicesEntry {
|
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
export class LibSignalErrorBase extends Error {
|
|
85
|
+
code;
|
|
86
|
+
operation;
|
|
87
|
+
_addr;
|
|
80
88
|
constructor(message, name, operation, extraProps) {
|
|
81
89
|
super(message);
|
|
82
90
|
// Include the dynamic check for `name in ErrorCode` in case there's a bug in the Rust code.
|
package/dist/MessageBackup.d.ts
CHANGED
|
@@ -34,8 +34,8 @@ export type MessageBackupKeyInput = Readonly<{
|
|
|
34
34
|
aci: Aci;
|
|
35
35
|
forwardSecrecyToken?: BackupForwardSecrecyToken;
|
|
36
36
|
} | {
|
|
37
|
-
backupKey: BackupKey | Uint8Array
|
|
38
|
-
backupId: Uint8Array
|
|
37
|
+
backupKey: BackupKey | Uint8Array<ArrayBuffer>;
|
|
38
|
+
backupId: Uint8Array<ArrayBuffer>;
|
|
39
39
|
forwardSecrecyToken?: BackupForwardSecrecyToken;
|
|
40
40
|
}>;
|
|
41
41
|
/**
|
|
@@ -56,9 +56,9 @@ export declare class MessageBackupKey {
|
|
|
56
56
|
*/
|
|
57
57
|
constructor(input: MessageBackupKeyInput);
|
|
58
58
|
/** An HMAC key used to sign a backup file. */
|
|
59
|
-
get hmacKey(): Uint8Array
|
|
59
|
+
get hmacKey(): Uint8Array<ArrayBuffer>;
|
|
60
60
|
/** An AES-256-CBC key used to encrypt a backup file. */
|
|
61
|
-
get aesKey(): Uint8Array
|
|
61
|
+
get aesKey(): Uint8Array<ArrayBuffer>;
|
|
62
62
|
}
|
|
63
63
|
export declare enum Purpose {
|
|
64
64
|
DeviceTransfer = 0,
|
|
@@ -109,7 +109,7 @@ export declare class OnlineBackupValidator {
|
|
|
109
109
|
*
|
|
110
110
|
* @throws BackupValidationError on error
|
|
111
111
|
*/
|
|
112
|
-
constructor(backupInfo: Uint8Array
|
|
112
|
+
constructor(backupInfo: Uint8Array<ArrayBuffer>, purpose: Purpose);
|
|
113
113
|
/**
|
|
114
114
|
* Processes a single Frame protobuf message.
|
|
115
115
|
*
|
|
@@ -117,7 +117,7 @@ export declare class OnlineBackupValidator {
|
|
|
117
117
|
*
|
|
118
118
|
* @throws BackupValidationError on error
|
|
119
119
|
*/
|
|
120
|
-
addFrame(frame: Uint8Array): void;
|
|
120
|
+
addFrame(frame: Uint8Array<ArrayBuffer>): void;
|
|
121
121
|
/**
|
|
122
122
|
* Marks that a backup is complete, and does any final checks that require whole-file knowledge.
|
|
123
123
|
*
|
|
@@ -208,7 +208,7 @@ export declare class BackupJsonExporter {
|
|
|
208
208
|
* @returns An object containing the exporter and the first chunk of output, containing the backup info.
|
|
209
209
|
* @throws Error if the input is invalid.
|
|
210
210
|
*/
|
|
211
|
-
static start(backupInfo: Uint8Array
|
|
211
|
+
static start(backupInfo: Uint8Array<ArrayBuffer>, options?: {
|
|
212
212
|
validate?: boolean;
|
|
213
213
|
}): {
|
|
214
214
|
exporter: BackupJsonExporter;
|
|
@@ -223,7 +223,7 @@ export declare class BackupJsonExporter {
|
|
|
223
223
|
* aborting.
|
|
224
224
|
* @throws Error if the input data cannot be parsed.
|
|
225
225
|
*/
|
|
226
|
-
exportFrames(frames: Uint8Array): BackupJsonFrameResult[];
|
|
226
|
+
exportFrames(frames: Uint8Array<ArrayBuffer>): BackupJsonFrameResult[];
|
|
227
227
|
/**
|
|
228
228
|
* Completes the validation and export of the previously exported frames.
|
|
229
229
|
*
|
package/dist/MessageBackup.js
CHANGED
|
@@ -14,6 +14,15 @@ import { BackupKey } from './AccountKeys.js';
|
|
|
14
14
|
* Result of validating a message backup bundle.
|
|
15
15
|
*/
|
|
16
16
|
export class ValidationOutcome {
|
|
17
|
+
/**
|
|
18
|
+
* A developer-facing message about the error encountered during validation,
|
|
19
|
+
* if any.
|
|
20
|
+
*/
|
|
21
|
+
errorMessage;
|
|
22
|
+
/**
|
|
23
|
+
* Information about unknown fields encountered during validation.
|
|
24
|
+
*/
|
|
25
|
+
unknownFieldMessages;
|
|
17
26
|
/**
|
|
18
27
|
* `true` if the backup is valid, `false` otherwise.
|
|
19
28
|
*
|
|
@@ -34,6 +43,7 @@ export class ValidationOutcome {
|
|
|
34
43
|
* @see {@link BackupKey}
|
|
35
44
|
*/
|
|
36
45
|
export class MessageBackupKey {
|
|
46
|
+
_nativeHandle;
|
|
37
47
|
/**
|
|
38
48
|
* Create a backup bundle key from an account entropy pool and ACI.
|
|
39
49
|
*
|
|
@@ -121,6 +131,7 @@ export async function validate(backupKey, purpose, inputFactory, length) {
|
|
|
121
131
|
* ```
|
|
122
132
|
*/
|
|
123
133
|
export class OnlineBackupValidator {
|
|
134
|
+
_nativeHandle;
|
|
124
135
|
/**
|
|
125
136
|
* Initializes an OnlineBackupValidator from the given BackupInfo protobuf message.
|
|
126
137
|
*
|
|
@@ -166,6 +177,7 @@ export class OnlineBackupValidator {
|
|
|
166
177
|
* differences between the logical content of the input backup files.
|
|
167
178
|
*/
|
|
168
179
|
export class ComparableBackup {
|
|
180
|
+
_nativeHandle;
|
|
169
181
|
constructor(handle) {
|
|
170
182
|
this._nativeHandle = handle;
|
|
171
183
|
}
|
|
@@ -212,6 +224,7 @@ export class ComparableBackup {
|
|
|
212
224
|
* produced so consumers can continue streaming the export.
|
|
213
225
|
*/
|
|
214
226
|
export class BackupJsonExporter {
|
|
227
|
+
_nativeHandle;
|
|
215
228
|
constructor(_nativeHandle) {
|
|
216
229
|
this._nativeHandle = _nativeHandle;
|
|
217
230
|
}
|
package/dist/Minidump.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function toJSONString(buffer: Uint8Array): string;
|
|
1
|
+
export declare function toJSONString(buffer: Uint8Array<ArrayBuffer>): string;
|
package/dist/Mp4Sanitizer.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare class SanitizedMetadata {
|
|
|
35
35
|
* Get the sanitized metadata, if any.
|
|
36
36
|
* @returns The sanitized metadata, or `null` if it didn't need to be sanitized.
|
|
37
37
|
*/
|
|
38
|
-
getMetadata(): Uint8Array | null;
|
|
38
|
+
getMetadata(): Uint8Array<ArrayBuffer> | null;
|
|
39
39
|
/**
|
|
40
40
|
* Get the offset of the media data in the processed input.
|
|
41
41
|
* @returns The offset of the media data in the processed input.
|