@signalapp/libsignal-client 0.81.1 → 0.82.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 +34 -31
- package/Native.js +4 -1
- package/dist/AccountKeys.d.ts +3 -3
- package/dist/AccountKeys.js +8 -14
- package/dist/Address.d.ts +1 -1
- package/dist/Address.js +9 -15
- package/dist/EcKeys.d.ts +1 -1
- package/dist/EcKeys.js +4 -10
- package/dist/Errors.d.ts +2 -2
- package/dist/Errors.js +5 -9
- package/dist/MessageBackup.d.ts +4 -4
- package/dist/MessageBackup.js +10 -18
- package/dist/Minidump.js +2 -6
- package/dist/Mp4Sanitizer.d.ts +2 -2
- package/dist/Mp4Sanitizer.js +3 -8
- package/dist/SealedSenderMultiRecipientMessage.d.ts +1 -1
- package/dist/SealedSenderMultiRecipientMessage.js +3 -5
- package/dist/WebpSanitizer.js +2 -6
- package/dist/acknowledgments.md +87 -89
- package/dist/incremental_mac.d.ts +1 -1
- package/dist/incremental_mac.js +12 -19
- package/dist/index.d.ts +18 -18
- package/dist/index.js +94 -158
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +3 -8
- package/dist/io.d.ts +1 -1
- package/dist/io.js +1 -5
- package/dist/net/CDSI.d.ts +2 -2
- package/dist/net/CDSI.js +8 -12
- package/dist/net/Chat.d.ts +11 -12
- package/dist/net/Chat.js +15 -22
- package/dist/net/KeyTransparency.d.ts +15 -11
- package/dist/net/KeyTransparency.js +7 -11
- package/dist/net/Registration.d.ts +5 -5
- package/dist/net/Registration.js +16 -22
- package/dist/net/SvrB.d.ts +3 -3
- package/dist/net/SvrB.js +5 -9
- package/dist/net/chat/UnauthUsernamesService.d.ts +4 -4
- package/dist/net/chat/UnauthUsernamesService.js +6 -7
- package/dist/net.d.ts +11 -11
- package/dist/net.js +27 -46
- package/dist/usernames.js +12 -23
- package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -1
- package/dist/zkgroup/GenericServerPublicParams.js +3 -6
- package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -2
- package/dist/zkgroup/GenericServerSecretParams.js +8 -11
- package/dist/zkgroup/NotarySignature.d.ts +1 -1
- package/dist/zkgroup/NotarySignature.js +3 -5
- package/dist/zkgroup/ServerPublicParams.d.ts +2 -2
- package/dist/zkgroup/ServerPublicParams.js +2 -5
- package/dist/zkgroup/ServerSecretParams.d.ts +3 -3
- package/dist/zkgroup/ServerSecretParams.js +10 -13
- package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/auth/AuthCredentialPresentation.js +6 -9
- package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPni.js +3 -6
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -1
- package/dist/zkgroup/auth/AuthCredentialWithPniResponse.js +3 -6
- package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +6 -6
- package/dist/zkgroup/auth/ClientZkAuthOperations.js +9 -12
- package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +5 -5
- package/dist/zkgroup/auth/ServerZkAuthOperations.js +7 -10
- package/dist/zkgroup/backups/BackupAuthCredential.d.ts +5 -5
- package/dist/zkgroup/backups/BackupAuthCredential.js +12 -15
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +4 -4
- package/dist/zkgroup/backups/BackupAuthCredentialPresentation.js +7 -10
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +5 -5
- package/dist/zkgroup/backups/BackupAuthCredentialRequest.js +8 -11
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +6 -6
- package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +8 -11
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/backups/BackupAuthCredentialResponse.js +3 -6
- package/dist/zkgroup/backups/BackupCredentialType.js +1 -3
- package/dist/zkgroup/backups/BackupLevel.js +1 -3
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +5 -5
- package/dist/zkgroup/calllinks/CallLinkAuthCredential.js +8 -11
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +4 -4
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.js +5 -8
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +5 -5
- package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.js +8 -11
- package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -1
- package/dist/zkgroup/calllinks/CallLinkPublicParams.js +3 -6
- package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +4 -4
- package/dist/zkgroup/calllinks/CallLinkSecretParams.js +9 -12
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +5 -5
- package/dist/zkgroup/calllinks/CreateCallLinkCredential.js +8 -11
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +3 -3
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.js +3 -6
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +4 -4
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.js +8 -11
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +6 -6
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.js +10 -13
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.js +3 -6
- package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +5 -5
- package/dist/zkgroup/groups/ClientZkGroupCipher.js +13 -16
- package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -1
- package/dist/zkgroup/groups/GroupIdentifier.js +4 -5
- package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -1
- package/dist/zkgroup/groups/GroupMasterKey.js +3 -5
- package/dist/zkgroup/groups/GroupPublicParams.d.ts +2 -2
- package/dist/zkgroup/groups/GroupPublicParams.js +5 -8
- package/dist/zkgroup/groups/GroupSecretParams.d.ts +3 -3
- package/dist/zkgroup/groups/GroupSecretParams.js +10 -13
- package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/ProfileKeyCiphertext.js +3 -6
- package/dist/zkgroup/groups/UuidCiphertext.d.ts +1 -1
- package/dist/zkgroup/groups/UuidCiphertext.js +3 -6
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.js +3 -6
- package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +5 -5
- package/dist/zkgroup/groupsend/GroupSendEndorsement.js +10 -13
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +7 -7
- package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.js +14 -17
- package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +3 -3
- package/dist/zkgroup/groupsend/GroupSendFullToken.js +5 -8
- package/dist/zkgroup/groupsend/GroupSendToken.d.ts +2 -2
- package/dist/zkgroup/groupsend/GroupSendToken.js +5 -8
- package/dist/zkgroup/index.d.ts +57 -57
- package/dist/zkgroup/index.js +57 -118
- package/dist/zkgroup/internal/ByteArray.js +6 -10
- package/dist/zkgroup/internal/Constants.js +4 -7
- package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +8 -8
- package/dist/zkgroup/profiles/ClientZkProfileOperations.js +12 -15
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.js +3 -6
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.js +3 -6
- package/dist/zkgroup/profiles/ProfileKey.d.ts +4 -4
- package/dist/zkgroup/profiles/ProfileKey.js +8 -10
- package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCommitment.js +3 -6
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +3 -3
- package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.js +7 -10
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.js +3 -6
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +2 -2
- package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.js +5 -8
- package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -1
- package/dist/zkgroup/profiles/ProfileKeyVersion.js +3 -5
- package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +7 -7
- package/dist/zkgroup/profiles/ServerZkProfileOperations.js +7 -10
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +6 -6
- package/dist/zkgroup/receipts/ClientZkReceiptOperations.js +12 -15
- package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredential.js +3 -6
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +2 -2
- package/dist/zkgroup/receipts/ReceiptCredentialPresentation.js +6 -8
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialRequest.js +3 -6
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +2 -2
- package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.js +6 -8
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptCredentialResponse.js +3 -6
- package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -1
- package/dist/zkgroup/receipts/ReceiptSerial.js +3 -5
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +4 -4
- package/dist/zkgroup/receipts/ServerZkReceiptOperations.js +7 -10
- package/package.json +20 -17
- 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/zkgroup.js +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
3
|
-
import BackupAuthCredentialPresentation from './BackupAuthCredentialPresentation';
|
|
4
|
-
import BackupLevel from './BackupLevel';
|
|
5
|
-
import BackupCredentialType from './BackupCredentialType';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import GenericServerPublicParams from '../GenericServerPublicParams.js';
|
|
3
|
+
import BackupAuthCredentialPresentation from './BackupAuthCredentialPresentation.js';
|
|
4
|
+
import BackupLevel from './BackupLevel.js';
|
|
5
|
+
import BackupCredentialType from './BackupCredentialType.js';
|
|
6
6
|
export default class BackupAuthCredential extends ByteArray {
|
|
7
7
|
private readonly __type?;
|
|
8
8
|
constructor(contents: Uint8Array);
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class BackupAuthCredential extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
8
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
9
|
+
import BackupAuthCredentialPresentation from './BackupAuthCredentialPresentation.js';
|
|
10
|
+
import BackupLevel from './BackupLevel.js';
|
|
11
|
+
import BackupCredentialType from './BackupCredentialType.js';
|
|
12
|
+
export default class BackupAuthCredential extends ByteArray {
|
|
15
13
|
constructor(contents) {
|
|
16
14
|
super(contents, Native.BackupAuthCredential_CheckValidContents);
|
|
17
15
|
}
|
|
18
16
|
present(serverParams) {
|
|
19
|
-
const random =
|
|
17
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
20
18
|
return this.presentWithRandom(serverParams, random);
|
|
21
19
|
}
|
|
22
20
|
presentWithRandom(serverParams, random) {
|
|
23
|
-
return new
|
|
21
|
+
return new BackupAuthCredentialPresentation(Native.BackupAuthCredential_PresentDeterministic(this.contents, serverParams.contents, random));
|
|
24
22
|
}
|
|
25
23
|
getBackupId() {
|
|
26
24
|
return Native.BackupAuthCredential_GetBackupId(this.contents);
|
|
27
25
|
}
|
|
28
26
|
getBackupLevel() {
|
|
29
27
|
const n = Native.BackupAuthCredential_GetBackupLevel(this.contents);
|
|
30
|
-
if (!(n in
|
|
28
|
+
if (!(n in BackupLevel)) {
|
|
31
29
|
throw new TypeError(`Invalid BackupLevel ${n}`);
|
|
32
30
|
}
|
|
33
31
|
return n;
|
|
34
32
|
}
|
|
35
33
|
getType() {
|
|
36
34
|
const n = Native.BackupAuthCredential_GetType(this.contents);
|
|
37
|
-
if (!(n in
|
|
35
|
+
if (!(n in BackupCredentialType)) {
|
|
38
36
|
throw new TypeError(`Invalid BackupCredentialType ${n}`);
|
|
39
37
|
}
|
|
40
38
|
return n;
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
|
-
exports.default = BackupAuthCredential;
|
|
44
41
|
//# sourceMappingURL=BackupAuthCredential.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
3
|
-
import BackupLevel from './BackupLevel';
|
|
4
|
-
import BackupCredentialType from './BackupCredentialType';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import GenericServerSecretParams from '../GenericServerSecretParams.js';
|
|
3
|
+
import BackupLevel from './BackupLevel.js';
|
|
4
|
+
import BackupCredentialType from './BackupCredentialType.js';
|
|
5
5
|
export default class BackupAuthCredentialPresentation extends ByteArray {
|
|
6
6
|
private readonly __type?;
|
|
7
7
|
constructor(contents: Uint8Array);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class BackupAuthCredentialPresentation extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import BackupLevel from './BackupLevel.js';
|
|
8
|
+
import BackupCredentialType from './BackupCredentialType.js';
|
|
9
|
+
export default class BackupAuthCredentialPresentation extends ByteArray {
|
|
12
10
|
constructor(contents) {
|
|
13
11
|
super(contents, Native.BackupAuthCredentialPresentation_CheckValidContents);
|
|
14
12
|
}
|
|
@@ -20,18 +18,17 @@ class BackupAuthCredentialPresentation extends ByteArray_1.default {
|
|
|
20
18
|
}
|
|
21
19
|
getBackupLevel() {
|
|
22
20
|
const n = Native.BackupAuthCredentialPresentation_GetBackupLevel(this.contents);
|
|
23
|
-
if (!(n in
|
|
21
|
+
if (!(n in BackupLevel)) {
|
|
24
22
|
throw new TypeError(`Invalid BackupLevel ${n}`);
|
|
25
23
|
}
|
|
26
24
|
return n;
|
|
27
25
|
}
|
|
28
26
|
getType() {
|
|
29
27
|
const n = Native.BackupAuthCredentialPresentation_GetType(this.contents);
|
|
30
|
-
if (!(n in
|
|
28
|
+
if (!(n in BackupCredentialType)) {
|
|
31
29
|
throw new TypeError(`Invalid BackupCredentialType ${n}`);
|
|
32
30
|
}
|
|
33
31
|
return n;
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
|
-
exports.default = BackupAuthCredentialPresentation;
|
|
37
34
|
//# sourceMappingURL=BackupAuthCredentialPresentation.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
3
|
-
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse';
|
|
4
|
-
import BackupLevel from './BackupLevel';
|
|
5
|
-
import BackupCredentialType from './BackupCredentialType';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import GenericServerSecretParams from '../GenericServerSecretParams.js';
|
|
3
|
+
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse.js';
|
|
4
|
+
import BackupLevel from './BackupLevel.js';
|
|
5
|
+
import BackupCredentialType from './BackupCredentialType.js';
|
|
6
6
|
export default class BackupAuthCredentialRequest extends ByteArray {
|
|
7
7
|
private readonly __type?;
|
|
8
8
|
constructor(contents: Uint8Array);
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class BackupAuthCredentialRequest extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
8
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
9
|
+
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse.js';
|
|
10
|
+
export default class BackupAuthCredentialRequest extends ByteArray {
|
|
13
11
|
constructor(contents) {
|
|
14
12
|
super(contents, Native.BackupAuthCredentialRequest_CheckValidContents);
|
|
15
13
|
}
|
|
16
14
|
issueCredential(timestamp, backupLevel, type, params) {
|
|
17
|
-
const random =
|
|
15
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
18
16
|
return this.issueCredentialWithRandom(timestamp, backupLevel, type, params, random);
|
|
19
17
|
}
|
|
20
18
|
issueCredentialWithRandom(timestamp, backupLevel, type, params, random) {
|
|
21
|
-
return new
|
|
19
|
+
return new BackupAuthCredentialResponse(Native.BackupAuthCredentialRequest_IssueDeterministic(this.contents, timestamp, backupLevel, type, params.contents, random));
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
|
-
exports.default = BackupAuthCredentialRequest;
|
|
25
22
|
//# sourceMappingURL=BackupAuthCredentialRequest.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import BackupAuthCredentialRequest from './BackupAuthCredentialRequest';
|
|
3
|
-
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse';
|
|
4
|
-
import BackupAuthCredential from './BackupAuthCredential';
|
|
5
|
-
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
6
|
-
import type { Uuid } from '
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import BackupAuthCredentialRequest from './BackupAuthCredentialRequest.js';
|
|
3
|
+
import BackupAuthCredentialResponse from './BackupAuthCredentialResponse.js';
|
|
4
|
+
import BackupAuthCredential from './BackupAuthCredential.js';
|
|
5
|
+
import GenericServerPublicParams from '../GenericServerPublicParams.js';
|
|
6
|
+
import type { Uuid } from '../../index.js';
|
|
7
7
|
export default class BackupAuthCredentialRequestContext extends ByteArray {
|
|
8
8
|
private readonly __type?;
|
|
9
9
|
constructor(contents: Uint8Array);
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class BackupAuthCredentialRequestContext extends ByteArray_1.default {
|
|
5
|
+
import * as uuid from 'uuid';
|
|
6
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
7
|
+
import Native from '../../../Native.js';
|
|
8
|
+
import BackupAuthCredentialRequest from './BackupAuthCredentialRequest.js';
|
|
9
|
+
import BackupAuthCredential from './BackupAuthCredential.js';
|
|
10
|
+
export default class BackupAuthCredentialRequestContext extends ByteArray {
|
|
13
11
|
constructor(contents) {
|
|
14
12
|
super(contents, Native.BackupAuthCredentialRequestContext_CheckValidContents);
|
|
15
13
|
}
|
|
@@ -17,11 +15,10 @@ class BackupAuthCredentialRequestContext extends ByteArray_1.default {
|
|
|
17
15
|
return new BackupAuthCredentialRequestContext(Native.BackupAuthCredentialRequestContext_New(backupKey, uuid.parse(aci)));
|
|
18
16
|
}
|
|
19
17
|
getRequest() {
|
|
20
|
-
return new
|
|
18
|
+
return new BackupAuthCredentialRequest(Native.BackupAuthCredentialRequestContext_GetRequest(this.contents));
|
|
21
19
|
}
|
|
22
20
|
receive(response, redemptionTime, params) {
|
|
23
|
-
return new
|
|
21
|
+
return new BackupAuthCredential(Native.BackupAuthCredentialRequestContext_ReceiveResponse(this.contents, response.contents, redemptionTime, params.contents));
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
|
-
exports.default = BackupAuthCredentialRequestContext;
|
|
27
24
|
//# sourceMappingURL=BackupAuthCredentialRequestContext.js.map
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class BackupAuthCredentialResponse extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class BackupAuthCredentialResponse extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.BackupAuthCredentialResponse_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = BackupAuthCredentialResponse;
|
|
15
12
|
//# sourceMappingURL=BackupAuthCredentialResponse.js.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
5
|
// This must match the Rust version of the enum.
|
|
8
6
|
var BackupCredentialType;
|
|
9
7
|
(function (BackupCredentialType) {
|
|
10
8
|
BackupCredentialType[BackupCredentialType["Messages"] = 1] = "Messages";
|
|
11
9
|
BackupCredentialType[BackupCredentialType["Media"] = 2] = "Media";
|
|
12
10
|
})(BackupCredentialType || (BackupCredentialType = {}));
|
|
13
|
-
|
|
11
|
+
export default BackupCredentialType;
|
|
14
12
|
//# sourceMappingURL=BackupCredentialType.js.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2024 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
5
|
// This must match the Rust version of the enum.
|
|
8
6
|
var BackupLevel;
|
|
9
7
|
(function (BackupLevel) {
|
|
10
8
|
BackupLevel[BackupLevel["Free"] = 200] = "Free";
|
|
11
9
|
BackupLevel[BackupLevel["Paid"] = 201] = "Paid";
|
|
12
10
|
})(BackupLevel || (BackupLevel = {}));
|
|
13
|
-
|
|
11
|
+
export default BackupLevel;
|
|
14
12
|
//# sourceMappingURL=BackupLevel.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import CallLinkSecretParams from './CallLinkSecretParams';
|
|
3
|
-
import CallLinkAuthCredentialPresentation from './CallLinkAuthCredentialPresentation';
|
|
4
|
-
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
5
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import CallLinkSecretParams from './CallLinkSecretParams.js';
|
|
3
|
+
import CallLinkAuthCredentialPresentation from './CallLinkAuthCredentialPresentation.js';
|
|
4
|
+
import GenericServerPublicParams from '../GenericServerPublicParams.js';
|
|
5
|
+
import { Aci } from '../../Address.js';
|
|
6
6
|
export default class CallLinkAuthCredential extends ByteArray {
|
|
7
7
|
private readonly __type?;
|
|
8
8
|
constructor(contents: Uint8Array);
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class CallLinkAuthCredential extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
7
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
8
|
+
import Native from '../../../Native.js';
|
|
9
|
+
import CallLinkAuthCredentialPresentation from './CallLinkAuthCredentialPresentation.js';
|
|
10
|
+
export default class CallLinkAuthCredential extends ByteArray {
|
|
13
11
|
constructor(contents) {
|
|
14
12
|
super(contents, Native.CallLinkAuthCredential_CheckValidContents);
|
|
15
13
|
}
|
|
16
14
|
present(userId, redemptionTime, serverParams, callLinkParams) {
|
|
17
|
-
const random =
|
|
15
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
18
16
|
return this.presentWithRandom(userId, redemptionTime, serverParams, callLinkParams, random);
|
|
19
17
|
}
|
|
20
18
|
presentWithRandom(userId, redemptionTime, serverParams, callLinkParams, random) {
|
|
21
|
-
return new
|
|
19
|
+
return new CallLinkAuthCredentialPresentation(Native.CallLinkAuthCredential_PresentDeterministic(this.contents, userId.getServiceIdFixedWidthBinary(), redemptionTime, serverParams.contents, callLinkParams.contents, random));
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
|
-
exports.default = CallLinkAuthCredential;
|
|
25
22
|
//# sourceMappingURL=CallLinkAuthCredential.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import CallLinkPublicParams from './CallLinkPublicParams';
|
|
3
|
-
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
4
|
-
import UuidCiphertext from '../groups/UuidCiphertext';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import CallLinkPublicParams from './CallLinkPublicParams.js';
|
|
3
|
+
import GenericServerSecretParams from '../GenericServerSecretParams.js';
|
|
4
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
5
5
|
export default class CallLinkAuthCredentialPresentation extends ByteArray {
|
|
6
6
|
private readonly __type?;
|
|
7
7
|
constructor(contents: Uint8Array);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class CallLinkAuthCredentialPresentation extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
8
|
+
export default class CallLinkAuthCredentialPresentation extends ByteArray {
|
|
11
9
|
constructor(contents) {
|
|
12
10
|
super(contents, Native.CallLinkAuthCredentialPresentation_CheckValidContents);
|
|
13
11
|
}
|
|
@@ -15,8 +13,7 @@ class CallLinkAuthCredentialPresentation extends ByteArray_1.default {
|
|
|
15
13
|
Native.CallLinkAuthCredentialPresentation_Verify(this.contents, Math.floor(now.getTime() / 1000), serverParams.contents, callLinkParams.contents);
|
|
16
14
|
}
|
|
17
15
|
getUserId() {
|
|
18
|
-
return new
|
|
16
|
+
return new UuidCiphertext(Native.CallLinkAuthCredentialPresentation_GetUserId(this.contents));
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
exports.default = CallLinkAuthCredentialPresentation;
|
|
22
19
|
//# sourceMappingURL=CallLinkAuthCredentialPresentation.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
3
|
-
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
4
|
-
import CallLinkAuthCredential from './CallLinkAuthCredential';
|
|
5
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import GenericServerSecretParams from '../GenericServerSecretParams.js';
|
|
3
|
+
import GenericServerPublicParams from '../GenericServerPublicParams.js';
|
|
4
|
+
import CallLinkAuthCredential from './CallLinkAuthCredential.js';
|
|
5
|
+
import { Aci } from '../../Address.js';
|
|
6
6
|
export default class CallLinkAuthCredentialResponse extends ByteArray {
|
|
7
7
|
private readonly __type?;
|
|
8
8
|
constructor(contents: Uint8Array);
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class CallLinkAuthCredentialResponse extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
7
|
+
import Native from '../../../Native.js';
|
|
8
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
9
|
+
import CallLinkAuthCredential from './CallLinkAuthCredential.js';
|
|
10
|
+
export default class CallLinkAuthCredentialResponse extends ByteArray {
|
|
13
11
|
constructor(contents) {
|
|
14
12
|
super(contents, Native.CallLinkAuthCredentialResponse_CheckValidContents);
|
|
15
13
|
}
|
|
16
14
|
static issueCredential(userId, redemptionTime, params) {
|
|
17
|
-
const random =
|
|
15
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
18
16
|
return this.issueCredentialWithRandom(userId, redemptionTime, params, random);
|
|
19
17
|
}
|
|
20
18
|
static issueCredentialWithRandom(userId, redemptionTime, params, random) {
|
|
21
19
|
return new CallLinkAuthCredentialResponse(Native.CallLinkAuthCredentialResponse_IssueDeterministic(userId.getServiceIdFixedWidthBinary(), redemptionTime, params.contents, random));
|
|
22
20
|
}
|
|
23
21
|
receive(userId, redemptionTime, params) {
|
|
24
|
-
return new
|
|
22
|
+
return new CallLinkAuthCredential(Native.CallLinkAuthCredentialResponse_Receive(this.contents, userId.getServiceIdFixedWidthBinary(), redemptionTime, params.contents));
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
|
-
exports.default = CallLinkAuthCredentialResponse;
|
|
28
25
|
//# sourceMappingURL=CallLinkAuthCredentialResponse.js.map
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class CallLinkPublicParams extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class CallLinkPublicParams extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.CallLinkPublicParams_CheckValidContents);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
|
-
exports.default = CallLinkPublicParams;
|
|
15
12
|
//# sourceMappingURL=CallLinkPublicParams.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import CallLinkPublicParams from './CallLinkPublicParams';
|
|
3
|
-
import UuidCiphertext from '../groups/UuidCiphertext';
|
|
4
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import CallLinkPublicParams from './CallLinkPublicParams.js';
|
|
3
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
4
|
+
import { Aci } from '../../Address.js';
|
|
5
5
|
export default class CallLinkSecretParams extends ByteArray {
|
|
6
6
|
private readonly __type?;
|
|
7
7
|
static deriveFromRootKey(callLinkRootKey: Uint8Array): CallLinkSecretParams;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class CallLinkSecretParams extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
import CallLinkPublicParams from './CallLinkPublicParams.js';
|
|
8
|
+
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
9
|
+
import { Aci } from '../../Address.js';
|
|
10
|
+
export default class CallLinkSecretParams extends ByteArray {
|
|
13
11
|
static deriveFromRootKey(callLinkRootKey) {
|
|
14
12
|
return new CallLinkSecretParams(Native.CallLinkSecretParams_DeriveFromRootKey(callLinkRootKey));
|
|
15
13
|
}
|
|
@@ -17,14 +15,13 @@ class CallLinkSecretParams extends ByteArray_1.default {
|
|
|
17
15
|
super(contents, Native.CallLinkSecretParams_CheckValidContents);
|
|
18
16
|
}
|
|
19
17
|
getPublicParams() {
|
|
20
|
-
return new
|
|
18
|
+
return new CallLinkPublicParams(Native.CallLinkSecretParams_GetPublicParams(this.contents));
|
|
21
19
|
}
|
|
22
20
|
decryptUserId(userId) {
|
|
23
|
-
return
|
|
21
|
+
return Aci.parseFromServiceIdFixedWidthBinary(Native.CallLinkSecretParams_DecryptUserId(this.contents, userId.contents));
|
|
24
22
|
}
|
|
25
23
|
encryptUserId(userId) {
|
|
26
|
-
return new
|
|
24
|
+
return new UuidCiphertext(Native.CallLinkSecretParams_EncryptUserId(this.contents, userId.getServiceIdFixedWidthBinary()));
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
|
-
exports.default = CallLinkSecretParams;
|
|
30
27
|
//# sourceMappingURL=CallLinkSecretParams.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import CallLinkSecretParams from './CallLinkSecretParams';
|
|
3
|
-
import CreateCallLinkCredentialPresentation from './CreateCallLinkCredentialPresentation';
|
|
4
|
-
import GenericServerPublicParams from '../GenericServerPublicParams';
|
|
5
|
-
import { Aci } from '../../Address';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import CallLinkSecretParams from './CallLinkSecretParams.js';
|
|
3
|
+
import CreateCallLinkCredentialPresentation from './CreateCallLinkCredentialPresentation.js';
|
|
4
|
+
import GenericServerPublicParams from '../GenericServerPublicParams.js';
|
|
5
|
+
import { Aci } from '../../Address.js';
|
|
6
6
|
export default class CreateCallLinkCredential extends ByteArray {
|
|
7
7
|
private readonly __type?;
|
|
8
8
|
constructor(contents: Uint8Array);
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class CreateCallLinkCredential extends ByteArray_1.default {
|
|
5
|
+
import { randomBytes } from 'node:crypto';
|
|
6
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
7
|
+
import { RANDOM_LENGTH } from '../internal/Constants.js';
|
|
8
|
+
import Native from '../../../Native.js';
|
|
9
|
+
import CreateCallLinkCredentialPresentation from './CreateCallLinkCredentialPresentation.js';
|
|
10
|
+
export default class CreateCallLinkCredential extends ByteArray {
|
|
13
11
|
constructor(contents) {
|
|
14
12
|
super(contents, Native.CreateCallLinkCredential_CheckValidContents);
|
|
15
13
|
}
|
|
16
14
|
present(roomId, userId, serverParams, callLinkParams) {
|
|
17
|
-
const random =
|
|
15
|
+
const random = randomBytes(RANDOM_LENGTH);
|
|
18
16
|
return this.presentWithRandom(roomId, userId, serverParams, callLinkParams, random);
|
|
19
17
|
}
|
|
20
18
|
presentWithRandom(roomId, userId, serverParams, callLinkParams, random) {
|
|
21
|
-
return new
|
|
19
|
+
return new CreateCallLinkCredentialPresentation(Native.CreateCallLinkCredential_PresentDeterministic(this.contents, roomId, userId.getServiceIdFixedWidthBinary(), serverParams.contents, callLinkParams.contents, random));
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
|
-
exports.default = CreateCallLinkCredential;
|
|
25
22
|
//# sourceMappingURL=CreateCallLinkCredential.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ByteArray from '../internal/ByteArray';
|
|
2
|
-
import CallLinkPublicParams from './CallLinkPublicParams';
|
|
3
|
-
import GenericServerSecretParams from '../GenericServerSecretParams';
|
|
1
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
2
|
+
import CallLinkPublicParams from './CallLinkPublicParams.js';
|
|
3
|
+
import GenericServerSecretParams from '../GenericServerSecretParams.js';
|
|
4
4
|
export default class CreateCallLinkCredentialPresentation extends ByteArray {
|
|
5
5
|
private readonly __type?;
|
|
6
6
|
constructor(contents: Uint8Array);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
//
|
|
3
2
|
// Copyright 2023 Signal Messenger, LLC.
|
|
4
3
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
4
|
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class CreateCallLinkCredentialPresentation extends ByteArray_1.default {
|
|
5
|
+
import ByteArray from '../internal/ByteArray.js';
|
|
6
|
+
import Native from '../../../Native.js';
|
|
7
|
+
export default class CreateCallLinkCredentialPresentation extends ByteArray {
|
|
10
8
|
constructor(contents) {
|
|
11
9
|
super(contents, Native.CreateCallLinkCredentialPresentation_CheckValidContents);
|
|
12
10
|
}
|
|
@@ -14,5 +12,4 @@ class CreateCallLinkCredentialPresentation extends ByteArray_1.default {
|
|
|
14
12
|
Native.CreateCallLinkCredentialPresentation_Verify(this.contents, roomId, Math.floor(now.getTime() / 1000), serverParams.contents, callLinkParams.contents);
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
|
-
exports.default = CreateCallLinkCredentialPresentation;
|
|
18
15
|
//# sourceMappingURL=CreateCallLinkCredentialPresentation.js.map
|