@secrecy/lib 1.12.0 → 1.13.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.
@@ -234,9 +234,9 @@ export class SecrecyCloudClient {
234
234
  });
235
235
  const shareNodes = [];
236
236
  for (const id of ids) {
237
- const nameKey = await this.perNode(id, publicKey);
238
- if (nameKey !== null) {
239
- shareNodes.push(nameKey);
237
+ const shareNode = await this.perNode(id, publicKey);
238
+ if (shareNode !== null) {
239
+ shareNodes.push(shareNode);
240
240
  }
241
241
  }
242
242
  const { isFinished } = await this.#apiClient.cloud.shareNodeFinish.mutate({
@@ -463,12 +463,11 @@ export class SecrecyCloudClient {
463
463
  }
464
464
  }
465
465
  const nameKey = node.access?.nameKey;
466
- if (nameKey === null) {
467
- return null;
468
- }
469
466
  return {
470
467
  id: node.id,
471
- nameKey: sodium.to_hex(encryptCryptoBox(sodium.from_hex(nameKey), publicKey, this.#keys.privateKey)),
468
+ nameKey: nameKey !== null
469
+ ? sodium.to_hex(encryptCryptoBox(sodium.from_hex(nameKey), publicKey, this.#keys.privateKey))
470
+ : null,
472
471
  files: 'history' in node
473
472
  ? node.history.map((f) => ({
474
473
  id: f.id,
@@ -4488,7 +4488,7 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
4488
4488
  id: string;
4489
4489
  key: string;
4490
4490
  }[];
4491
- nameKey: string;
4491
+ nameKey: string | null;
4492
4492
  }[];
4493
4493
  rights: "admin" | "write" | "read";
4494
4494
  };
@@ -4500,7 +4500,7 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
4500
4500
  id: string;
4501
4501
  key: string;
4502
4502
  }[];
4503
- nameKey: string;
4503
+ nameKey: string | null;
4504
4504
  }[];
4505
4505
  rights: "admin" | "write" | "read";
4506
4506
  };
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.12.0",
5
+ "version": "1.13.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@secrecy/lib-utils": "^1.0.18",
77
- "@secrecy/trpc-api-types": "1.19.0-feat-waiting-received-mails-endpoint.1",
77
+ "@secrecy/trpc-api-types": "1.19.0-fix-nullable-namekey.1",
78
78
  "@trpc/client": "10.45.2",
79
79
  "@trpc/server": "10.45.2",
80
80
  "@types/libsodium-wrappers-sumo": "^0.7.8",