@tinycloud/cli 1.5.1 → 1.5.2-beta.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.
@@ -2046,6 +2046,10 @@ function expandEncryptionPermissionEntry(entry) {
2046
2046
  normalizedActions.push("tinycloud.encryption/network.revoke");
2047
2047
  continue;
2048
2048
  }
2049
+ if (sharePrefix && (action === "key.create" || action === "tinycloud.encryption/key.create")) {
2050
+ normalizedActions.push("tinycloud.encryption/key.create");
2051
+ continue;
2052
+ }
2049
2053
  if (action.includes("/")) {
2050
2054
  throw new ManifestValidationError(
2051
2055
  `unknown encryption action ${JSON.stringify(action)}; expected decrypt, network.create, or network.revoke`
@@ -2063,8 +2067,20 @@ function expandEncryptionPermissionEntry(entry) {
2063
2067
  seen.add(a);
2064
2068
  }
2065
2069
  }
2066
- if (sharePrefix && dedupedActions.some((action) => action !== "tinycloud.encryption/decrypt")) {
2067
- throw new ManifestValidationError("share prefix only supports decrypt");
2070
+ if (sharePrefix && dedupedActions.some((action) => action !== "tinycloud.encryption/decrypt" && action !== "tinycloud.encryption/key.create")) {
2071
+ throw new ManifestValidationError("share prefix only supports decrypt and key.create");
2072
+ }
2073
+ if (dedupedActions.includes("tinycloud.encryption/key.create")) {
2074
+ let canonical = false;
2075
+ try {
2076
+ const parsed = parseEncryptionResource(entry.path);
2077
+ canonical = parsed.kind === "prefix" && parsed.network === "default" && parsed.prefix === "share";
2078
+ } catch {
2079
+ canonical = false;
2080
+ }
2081
+ if (!canonical) {
2082
+ throw new ManifestValidationError("share prefix key.create requires the canonical owner address (EIP-55 checksummed) on the default network");
2083
+ }
2068
2084
  }
2069
2085
  return [
2070
2086
  {
@@ -31158,6 +31174,7 @@ var SharePublishError = class extends Error {
31158
31174
  this.code = code32;
31159
31175
  }
31160
31176
  };
31177
+ var textEncoder = new TextEncoder();
31161
31178
  function authorizationMethodForTarget(target) {
31162
31179
  if (target.kind === "recipientDid") return "openkey-device";
31163
31180
  if (target.kind === "email") return "email-claim";
@@ -31621,7 +31638,7 @@ async function publishTargetShare(input) {
31621
31638
  ...input.issuerKid === void 0 ? {} : { issuerKid: input.issuerKid }
31622
31639
  });
31623
31640
  }
31624
- var textEncoder = new TextEncoder();
31641
+ var textEncoder2 = new TextEncoder();
31625
31642
  var EMAIL_CREDENTIAL_ISSUER_DID = "did:web:issuer.credentials.org";
31626
31643
  var EMAIL_CREDENTIAL_ISSUER_KID = `${EMAIL_CREDENTIAL_ISSUER_DID}#controller`;
31627
31644
  var ADDRESSED_SHARE_TOO_LARGE_MESSAGE = "This share is too large to send as a link, so nothing was shared. Use a shorter path or fewer folders.";