@tinycloud/sdk-core 3.8.0-beta.15 → 3.8.0-beta.17

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.
@@ -3325,6 +3325,7 @@ var import_sha256 = require("@noble/hashes/sha256");
3325
3325
  var import_blake3 = require("@noble/hashes/blake3");
3326
3326
  var import_ed255192 = require("@noble/curves/ed25519");
3327
3327
  var import_zod = require("zod");
3328
+ var import_sdk_services2 = require("@tinycloud/sdk-services");
3328
3329
 
3329
3330
  // src/http-error.ts
3330
3331
  var import_sdk_services = require("@tinycloud/sdk-services");
@@ -3606,12 +3607,9 @@ function parseKvResource(resource) {
3606
3607
  return { space, path };
3607
3608
  }
3608
3609
  function parseEncryptionResource(resource) {
3609
- if (!resource.startsWith("urn:tinycloud:encryption:")) throw new Error("encryption capability is invalid");
3610
- const rest = resource.slice("urn:tinycloud:encryption:".length);
3611
- const separator = rest.lastIndexOf(":");
3612
- const ownerDid = separator < 0 ? "" : rest.slice(0, separator);
3613
- const network = separator < 0 ? "" : rest.slice(separator + 1);
3614
- if (!ownerDid.startsWith("did:") || network.length === 0 || network.includes(":") || network.includes("/") || network.includes("%") || network.includes("?") || network.includes("#")) {
3610
+ try {
3611
+ if ((0, import_sdk_services2.parseEncryptionResource)(resource).keyPath?.endsWith("/")) throw new Error("prefix");
3612
+ } catch {
3615
3613
  throw new Error("encryption capability is invalid");
3616
3614
  }
3617
3615
  }