@secrecy/lib 1.69.2-fix-node-sharing.1 → 1.69.2-fix-node-sharing.2

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.
@@ -348,15 +348,14 @@ export class SecrecyCloudClient {
348
348
  .filter((node) => !node.includeKeys)
349
349
  .map((node) => {
350
350
  return {
351
- nodeId: node.nodeId,
352
- userId: userId,
353
- permissions: {
354
- rights: node.rights,
355
- addAccess: node.addAccess,
356
- delAccess: node.delAccess,
357
- sharingAddAccess: node.sharingAddAccess,
358
- sharingDelAccess: node.sharingDelAccess,
359
- },
351
+ id: node.nodeId,
352
+ data: [],
353
+ nameKey: null,
354
+ rights: node.rights,
355
+ addAccess: node.addAccess,
356
+ delAccess: node.delAccess,
357
+ sharingAddAccess: node.sharingAddAccess,
358
+ sharingDelAccess: node.sharingDelAccess,
360
359
  };
361
360
  }),
362
361
  ]));
@@ -388,10 +387,13 @@ export class SecrecyCloudClient {
388
387
  },
389
388
  ];
390
389
  }));
391
- const finishInput = Object.fromEntries([
392
- ...Object.entries(withKeys),
393
- ...Object.entries(nodesToUpdateRights),
394
- ]);
390
+ const finishInput = [];
391
+ for (const [userId, nodes] of Object.entries(withKeys)) {
392
+ finishInput.push({ userId, nodes: nodes.nodes });
393
+ }
394
+ for (const [userId, nodes] of Object.entries(nodesToUpdateRights)) {
395
+ finishInput.push({ userId, nodes });
396
+ }
395
397
  const subState = finishInput.length > 0
396
398
  ? await this.#apiClient.cloud.shareNodeFinish.mutate(finishInput)
397
399
  : { isFinished: true, details: {} };
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.69.2-fix-node-sharing.1",
5
+ "version": "1.69.2-fix-node-sharing.2",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"