@tinycloud/node-sdk 3.9.0 → 3.9.1-beta.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/dist/index.js CHANGED
@@ -18974,6 +18974,7 @@ function pkhSpaceIdentity(spaceId) {
18974
18974
  }
18975
18975
  var DECRYPT_ACTION = ENCRYPTION.DECRYPT;
18976
18976
  var NETWORK_CREATE_ACTION = ENCRYPTION.NETWORK_CREATE;
18977
+ var KEY_CREATE_ACTION = "tinycloud.encryption/key.create";
18977
18978
  function describeHostFailure(result) {
18978
18979
  const text = result.error?.trim();
18979
18980
  return text ? `${result.status} - ${text}` : `${result.status}`;
@@ -19615,7 +19616,7 @@ var NodeUserAuthorization = class {
19615
19616
  return true;
19616
19617
  }
19617
19618
  const parsed = entry.path.includes("/") ? parseEncryptionResource(entry.path) : { ...parseNetworkId(entry.path), kind: "network" };
19618
- const sharePrefix = parsed.kind === "prefix" && parsed.network === "default" && parsed.prefix === "share" && entry.actions.length === 1 && entry.actions[0] === DECRYPT_ACTION && didPrincipalMatches(parsed.ownerDid, currentDid);
19619
+ const sharePrefix = parsed.kind === "prefix" && parsed.network === "default" && parsed.prefix === "share" && entry.actions.length > 0 && entry.actions.every((action) => action === DECRYPT_ACTION || action === KEY_CREATE_ACTION) && didPrincipalMatches(parsed.ownerDid, currentDid);
19619
19620
  if (parsed.kind !== "network" && !sharePrefix) {
19620
19621
  throw new ManifestValidationError("named keys go in manifest.keys");
19621
19622
  }