@secrecy/lib 1.49.0-feat-report-data.2 → 1.49.0-feat-report-data.4

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.
@@ -555,14 +555,12 @@ export class SecrecyCloudClient {
555
555
  this.#apiClient.misc.publicKey.query(),
556
556
  ]);
557
557
  const data = apiDataToInternal(rawData, this.#keys);
558
- if (!data.key) {
559
- throw new Error('Unable to retreive data key!');
560
- }
561
- const encryptedDataKey = sodium.to_hex(encryptCryptoBox(sodium.from_hex(data.key), secrecy.publicKey, this.#keys.privateKey));
562
558
  return this.#apiClient.cloud.reportData.mutate({
563
- id,
564
- reasons,
565
- encryptedDataKey,
559
+ id: id,
560
+ reasons: reasons,
561
+ encryptedDataKey: data.key
562
+ ? sodium.to_hex(encryptCryptoBox(sodium.from_hex(data.key), secrecy.publicKey, this.#keys.privateKey))
563
+ : null,
566
564
  });
567
565
  }
568
566
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@secrecy/lib",
3
3
  "author": "Anonymize <anonymize@gmail.com>",
4
4
  "description": "Anonymize Secrecy Library",
5
- "version": "1.49.0-feat-report-data.2",
5
+ "version": "1.49.0-feat-report-data.4",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"