@signalapp/libsignal-client 0.81.0 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/Native.d.ts +34 -31
  2. package/Native.js +4 -1
  3. package/dist/AccountKeys.d.ts +3 -3
  4. package/dist/AccountKeys.js +8 -14
  5. package/dist/Address.d.ts +1 -1
  6. package/dist/Address.js +8 -15
  7. package/dist/EcKeys.d.ts +1 -1
  8. package/dist/EcKeys.js +4 -10
  9. package/dist/Errors.d.ts +2 -2
  10. package/dist/Errors.js +5 -9
  11. package/dist/MessageBackup.d.ts +4 -4
  12. package/dist/MessageBackup.js +10 -18
  13. package/dist/Minidump.js +2 -6
  14. package/dist/Mp4Sanitizer.d.ts +2 -2
  15. package/dist/Mp4Sanitizer.js +3 -8
  16. package/dist/SealedSenderMultiRecipientMessage.d.ts +1 -1
  17. package/dist/SealedSenderMultiRecipientMessage.js +2 -5
  18. package/dist/WebpSanitizer.js +2 -6
  19. package/dist/acknowledgments.md +254 -89
  20. package/dist/incremental_mac.d.ts +1 -1
  21. package/dist/incremental_mac.js +11 -19
  22. package/dist/index.d.ts +18 -18
  23. package/dist/index.js +93 -158
  24. package/dist/internal.d.ts +2 -2
  25. package/dist/internal.js +3 -8
  26. package/dist/io.d.ts +1 -1
  27. package/dist/io.js +1 -5
  28. package/dist/net/CDSI.d.ts +2 -2
  29. package/dist/net/CDSI.js +8 -12
  30. package/dist/net/Chat.d.ts +11 -12
  31. package/dist/net/Chat.js +15 -22
  32. package/dist/net/KeyTransparency.d.ts +10 -10
  33. package/dist/net/KeyTransparency.js +4 -8
  34. package/dist/net/Registration.d.ts +5 -5
  35. package/dist/net/Registration.js +16 -22
  36. package/dist/net/SvrB.d.ts +3 -3
  37. package/dist/net/SvrB.js +5 -9
  38. package/dist/net/chat/UnauthUsernamesService.d.ts +4 -4
  39. package/dist/net/chat/UnauthUsernamesService.js +5 -7
  40. package/dist/net.d.ts +11 -11
  41. package/dist/net.js +27 -46
  42. package/dist/usernames.js +12 -23
  43. package/dist/zkgroup/GenericServerPublicParams.d.ts +1 -1
  44. package/dist/zkgroup/GenericServerPublicParams.js +3 -6
  45. package/dist/zkgroup/GenericServerSecretParams.d.ts +2 -2
  46. package/dist/zkgroup/GenericServerSecretParams.js +8 -11
  47. package/dist/zkgroup/NotarySignature.d.ts +1 -1
  48. package/dist/zkgroup/NotarySignature.js +3 -5
  49. package/dist/zkgroup/ServerPublicParams.d.ts +2 -2
  50. package/dist/zkgroup/ServerPublicParams.js +2 -5
  51. package/dist/zkgroup/ServerSecretParams.d.ts +3 -3
  52. package/dist/zkgroup/ServerSecretParams.js +10 -13
  53. package/dist/zkgroup/auth/AuthCredentialPresentation.d.ts +2 -2
  54. package/dist/zkgroup/auth/AuthCredentialPresentation.js +6 -9
  55. package/dist/zkgroup/auth/AuthCredentialWithPni.d.ts +1 -1
  56. package/dist/zkgroup/auth/AuthCredentialWithPni.js +3 -6
  57. package/dist/zkgroup/auth/AuthCredentialWithPniResponse.d.ts +1 -1
  58. package/dist/zkgroup/auth/AuthCredentialWithPniResponse.js +3 -6
  59. package/dist/zkgroup/auth/ClientZkAuthOperations.d.ts +6 -6
  60. package/dist/zkgroup/auth/ClientZkAuthOperations.js +9 -12
  61. package/dist/zkgroup/auth/ServerZkAuthOperations.d.ts +5 -5
  62. package/dist/zkgroup/auth/ServerZkAuthOperations.js +7 -10
  63. package/dist/zkgroup/backups/BackupAuthCredential.d.ts +5 -5
  64. package/dist/zkgroup/backups/BackupAuthCredential.js +12 -15
  65. package/dist/zkgroup/backups/BackupAuthCredentialPresentation.d.ts +4 -4
  66. package/dist/zkgroup/backups/BackupAuthCredentialPresentation.js +7 -10
  67. package/dist/zkgroup/backups/BackupAuthCredentialRequest.d.ts +5 -5
  68. package/dist/zkgroup/backups/BackupAuthCredentialRequest.js +8 -11
  69. package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.d.ts +6 -6
  70. package/dist/zkgroup/backups/BackupAuthCredentialRequestContext.js +8 -11
  71. package/dist/zkgroup/backups/BackupAuthCredentialResponse.d.ts +1 -1
  72. package/dist/zkgroup/backups/BackupAuthCredentialResponse.js +3 -6
  73. package/dist/zkgroup/backups/BackupCredentialType.js +1 -3
  74. package/dist/zkgroup/backups/BackupLevel.js +1 -3
  75. package/dist/zkgroup/calllinks/CallLinkAuthCredential.d.ts +5 -5
  76. package/dist/zkgroup/calllinks/CallLinkAuthCredential.js +8 -11
  77. package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.d.ts +4 -4
  78. package/dist/zkgroup/calllinks/CallLinkAuthCredentialPresentation.js +5 -8
  79. package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.d.ts +5 -5
  80. package/dist/zkgroup/calllinks/CallLinkAuthCredentialResponse.js +8 -11
  81. package/dist/zkgroup/calllinks/CallLinkPublicParams.d.ts +1 -1
  82. package/dist/zkgroup/calllinks/CallLinkPublicParams.js +3 -6
  83. package/dist/zkgroup/calllinks/CallLinkSecretParams.d.ts +4 -4
  84. package/dist/zkgroup/calllinks/CallLinkSecretParams.js +9 -12
  85. package/dist/zkgroup/calllinks/CreateCallLinkCredential.d.ts +5 -5
  86. package/dist/zkgroup/calllinks/CreateCallLinkCredential.js +8 -11
  87. package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.d.ts +3 -3
  88. package/dist/zkgroup/calllinks/CreateCallLinkCredentialPresentation.js +3 -6
  89. package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.d.ts +4 -4
  90. package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequest.js +8 -11
  91. package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.d.ts +6 -6
  92. package/dist/zkgroup/calllinks/CreateCallLinkCredentialRequestContext.js +10 -13
  93. package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.d.ts +1 -1
  94. package/dist/zkgroup/calllinks/CreateCallLinkCredentialResponse.js +3 -6
  95. package/dist/zkgroup/groups/ClientZkGroupCipher.d.ts +5 -5
  96. package/dist/zkgroup/groups/ClientZkGroupCipher.js +13 -16
  97. package/dist/zkgroup/groups/GroupIdentifier.d.ts +1 -1
  98. package/dist/zkgroup/groups/GroupIdentifier.js +3 -5
  99. package/dist/zkgroup/groups/GroupMasterKey.d.ts +1 -1
  100. package/dist/zkgroup/groups/GroupMasterKey.js +3 -5
  101. package/dist/zkgroup/groups/GroupPublicParams.d.ts +2 -2
  102. package/dist/zkgroup/groups/GroupPublicParams.js +5 -8
  103. package/dist/zkgroup/groups/GroupSecretParams.d.ts +3 -3
  104. package/dist/zkgroup/groups/GroupSecretParams.js +10 -13
  105. package/dist/zkgroup/groups/ProfileKeyCiphertext.d.ts +1 -1
  106. package/dist/zkgroup/groups/ProfileKeyCiphertext.js +3 -6
  107. package/dist/zkgroup/groups/UuidCiphertext.d.ts +1 -1
  108. package/dist/zkgroup/groups/UuidCiphertext.js +3 -6
  109. package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.d.ts +2 -2
  110. package/dist/zkgroup/groupsend/GroupSendDerivedKeyPair.js +3 -6
  111. package/dist/zkgroup/groupsend/GroupSendEndorsement.d.ts +5 -5
  112. package/dist/zkgroup/groupsend/GroupSendEndorsement.js +10 -13
  113. package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.d.ts +7 -7
  114. package/dist/zkgroup/groupsend/GroupSendEndorsementsResponse.js +14 -17
  115. package/dist/zkgroup/groupsend/GroupSendFullToken.d.ts +3 -3
  116. package/dist/zkgroup/groupsend/GroupSendFullToken.js +5 -8
  117. package/dist/zkgroup/groupsend/GroupSendToken.d.ts +2 -2
  118. package/dist/zkgroup/groupsend/GroupSendToken.js +5 -8
  119. package/dist/zkgroup/index.d.ts +57 -57
  120. package/dist/zkgroup/index.js +57 -118
  121. package/dist/zkgroup/internal/ByteArray.js +6 -10
  122. package/dist/zkgroup/internal/Constants.js +4 -7
  123. package/dist/zkgroup/profiles/ClientZkProfileOperations.d.ts +8 -8
  124. package/dist/zkgroup/profiles/ClientZkProfileOperations.js +12 -15
  125. package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.d.ts +1 -1
  126. package/dist/zkgroup/profiles/ExpiringProfileKeyCredential.js +3 -6
  127. package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.d.ts +1 -1
  128. package/dist/zkgroup/profiles/ExpiringProfileKeyCredentialResponse.js +3 -6
  129. package/dist/zkgroup/profiles/ProfileKey.d.ts +4 -4
  130. package/dist/zkgroup/profiles/ProfileKey.js +8 -10
  131. package/dist/zkgroup/profiles/ProfileKeyCommitment.d.ts +1 -1
  132. package/dist/zkgroup/profiles/ProfileKeyCommitment.js +3 -6
  133. package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.d.ts +3 -3
  134. package/dist/zkgroup/profiles/ProfileKeyCredentialPresentation.js +7 -10
  135. package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.d.ts +1 -1
  136. package/dist/zkgroup/profiles/ProfileKeyCredentialRequest.js +3 -6
  137. package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.d.ts +2 -2
  138. package/dist/zkgroup/profiles/ProfileKeyCredentialRequestContext.js +5 -8
  139. package/dist/zkgroup/profiles/ProfileKeyVersion.d.ts +1 -1
  140. package/dist/zkgroup/profiles/ProfileKeyVersion.js +3 -5
  141. package/dist/zkgroup/profiles/ServerZkProfileOperations.d.ts +7 -7
  142. package/dist/zkgroup/profiles/ServerZkProfileOperations.js +7 -10
  143. package/dist/zkgroup/receipts/ClientZkReceiptOperations.d.ts +6 -6
  144. package/dist/zkgroup/receipts/ClientZkReceiptOperations.js +12 -15
  145. package/dist/zkgroup/receipts/ReceiptCredential.d.ts +1 -1
  146. package/dist/zkgroup/receipts/ReceiptCredential.js +3 -6
  147. package/dist/zkgroup/receipts/ReceiptCredentialPresentation.d.ts +2 -2
  148. package/dist/zkgroup/receipts/ReceiptCredentialPresentation.js +6 -8
  149. package/dist/zkgroup/receipts/ReceiptCredentialRequest.d.ts +1 -1
  150. package/dist/zkgroup/receipts/ReceiptCredentialRequest.js +3 -6
  151. package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.d.ts +2 -2
  152. package/dist/zkgroup/receipts/ReceiptCredentialRequestContext.js +6 -8
  153. package/dist/zkgroup/receipts/ReceiptCredentialResponse.d.ts +1 -1
  154. package/dist/zkgroup/receipts/ReceiptCredentialResponse.js +3 -6
  155. package/dist/zkgroup/receipts/ReceiptSerial.d.ts +1 -1
  156. package/dist/zkgroup/receipts/ReceiptSerial.js +3 -5
  157. package/dist/zkgroup/receipts/ServerZkReceiptOperations.d.ts +4 -4
  158. package/dist/zkgroup/receipts/ServerZkReceiptOperations.js +7 -10
  159. package/package.json +24 -20
  160. package/prebuilds/darwin-arm64/@signalapp+libsignal-client.node +0 -0
  161. package/prebuilds/darwin-x64/@signalapp+libsignal-client.node +0 -0
  162. package/prebuilds/linux-arm64/@signalapp+libsignal-client.node +0 -0
  163. package/prebuilds/linux-x64/@signalapp+libsignal-client.node +0 -0
  164. package/prebuilds/win32-arm64/@signalapp+libsignal-client.node +0 -0
  165. package/prebuilds/win32-x64/@signalapp+libsignal-client.node +0 -0
  166. 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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const crypto_1 = require("crypto");
8
- const Native = require("../../../Native");
9
- const ByteArray_1 = require("../internal/ByteArray");
10
- const Constants_1 = require("../internal/Constants");
11
- const BackupAuthCredentialPresentation_1 = require("./BackupAuthCredentialPresentation");
12
- const BackupLevel_1 = require("./BackupLevel");
13
- const BackupCredentialType_1 = require("./BackupCredentialType");
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 = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
17
+ const random = randomBytes(RANDOM_LENGTH);
20
18
  return this.presentWithRandom(serverParams, random);
21
19
  }
22
20
  presentWithRandom(serverParams, random) {
23
- return new BackupAuthCredentialPresentation_1.default(Native.BackupAuthCredential_PresentDeterministic(this.contents, serverParams.contents, random));
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 BackupLevel_1.default)) {
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 BackupCredentialType_1.default)) {
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const ByteArray_1 = require("../internal/ByteArray");
8
- const Native = require("../../../Native");
9
- const BackupLevel_1 = require("./BackupLevel");
10
- const BackupCredentialType_1 = require("./BackupCredentialType");
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 BackupLevel_1.default)) {
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 BackupCredentialType_1.default)) {
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const crypto_1 = require("crypto");
8
- const Native = require("../../../Native");
9
- const ByteArray_1 = require("../internal/ByteArray");
10
- const Constants_1 = require("../internal/Constants");
11
- const BackupAuthCredentialResponse_1 = require("./BackupAuthCredentialResponse");
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 = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
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 BackupAuthCredentialResponse_1.default(Native.BackupAuthCredentialRequest_IssueDeterministic(this.contents, timestamp, backupLevel, type, params.contents, random));
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const uuid = require("uuid");
8
- const ByteArray_1 = require("../internal/ByteArray");
9
- const Native = require("../../../Native");
10
- const BackupAuthCredentialRequest_1 = require("./BackupAuthCredentialRequest");
11
- const BackupAuthCredential_1 = require("./BackupAuthCredential");
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 BackupAuthCredentialRequest_1.default(Native.BackupAuthCredentialRequestContext_GetRequest(this.contents));
18
+ return new BackupAuthCredentialRequest(Native.BackupAuthCredentialRequestContext_GetRequest(this.contents));
21
19
  }
22
20
  receive(response, redemptionTime, params) {
23
- return new BackupAuthCredential_1.default(Native.BackupAuthCredentialRequestContext_ReceiveResponse(this.contents, response.contents, redemptionTime, params.contents));
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,4 +1,4 @@
1
- import ByteArray from '../internal/ByteArray';
1
+ import ByteArray from '../internal/ByteArray.js';
2
2
  export default class BackupAuthCredentialResponse extends ByteArray {
3
3
  private readonly __type?;
4
4
  constructor(contents: Uint8Array);
@@ -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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const ByteArray_1 = require("../internal/ByteArray");
8
- const Native = require("../../../Native");
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
- exports.default = BackupCredentialType;
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
- exports.default = BackupLevel;
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const crypto_1 = require("crypto");
8
- const ByteArray_1 = require("../internal/ByteArray");
9
- const Constants_1 = require("../internal/Constants");
10
- const Native = require("../../../Native");
11
- const CallLinkAuthCredentialPresentation_1 = require("./CallLinkAuthCredentialPresentation");
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 = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
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 CallLinkAuthCredentialPresentation_1.default(Native.CallLinkAuthCredential_PresentDeterministic(this.contents, userId.getServiceIdFixedWidthBinary(), redemptionTime, serverParams.contents, callLinkParams.contents, random));
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const ByteArray_1 = require("../internal/ByteArray");
8
- const Native = require("../../../Native");
9
- const UuidCiphertext_1 = require("../groups/UuidCiphertext");
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 UuidCiphertext_1.default(Native.CallLinkAuthCredentialPresentation_GetUserId(this.contents));
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const crypto_1 = require("crypto");
8
- const ByteArray_1 = require("../internal/ByteArray");
9
- const Native = require("../../../Native");
10
- const Constants_1 = require("../internal/Constants");
11
- const CallLinkAuthCredential_1 = require("./CallLinkAuthCredential");
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 = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
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 CallLinkAuthCredential_1.default(Native.CallLinkAuthCredentialResponse_Receive(this.contents, userId.getServiceIdFixedWidthBinary(), redemptionTime, params.contents));
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,4 +1,4 @@
1
- import ByteArray from '../internal/ByteArray';
1
+ import ByteArray from '../internal/ByteArray.js';
2
2
  export default class CallLinkPublicParams extends ByteArray {
3
3
  private readonly __type?;
4
4
  constructor(contents: Uint8Array);
@@ -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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const ByteArray_1 = require("../internal/ByteArray");
8
- const Native = require("../../../Native");
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const ByteArray_1 = require("../internal/ByteArray");
8
- const Native = require("../../../Native");
9
- const CallLinkPublicParams_1 = require("./CallLinkPublicParams");
10
- const UuidCiphertext_1 = require("../groups/UuidCiphertext");
11
- const Address_1 = require("../../Address");
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 CallLinkPublicParams_1.default(Native.CallLinkSecretParams_GetPublicParams(this.contents));
18
+ return new CallLinkPublicParams(Native.CallLinkSecretParams_GetPublicParams(this.contents));
21
19
  }
22
20
  decryptUserId(userId) {
23
- return Address_1.Aci.parseFromServiceIdFixedWidthBinary(Native.CallLinkSecretParams_DecryptUserId(this.contents, userId.contents));
21
+ return Aci.parseFromServiceIdFixedWidthBinary(Native.CallLinkSecretParams_DecryptUserId(this.contents, userId.contents));
24
22
  }
25
23
  encryptUserId(userId) {
26
- return new UuidCiphertext_1.default(Native.CallLinkSecretParams_EncryptUserId(this.contents, userId.getServiceIdFixedWidthBinary()));
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const crypto_1 = require("crypto");
8
- const ByteArray_1 = require("../internal/ByteArray");
9
- const Constants_1 = require("../internal/Constants");
10
- const Native = require("../../../Native");
11
- const CreateCallLinkCredentialPresentation_1 = require("./CreateCallLinkCredentialPresentation");
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 = (0, crypto_1.randomBytes)(Constants_1.RANDOM_LENGTH);
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 CreateCallLinkCredentialPresentation_1.default(Native.CreateCallLinkCredential_PresentDeterministic(this.contents, roomId, userId.getServiceIdFixedWidthBinary(), serverParams.contents, callLinkParams.contents, random));
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const ByteArray_1 = require("../internal/ByteArray");
8
- const Native = require("../../../Native");
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