@tinycloud/node-sdk 3.8.0-beta.14 → 3.8.0-beta.15

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/core.cjs CHANGED
@@ -8896,7 +8896,19 @@ var _TinyCloudNode = class _TinyCloudNode {
8896
8896
  "delegateTo requires a non-empty permissions array"
8897
8897
  );
8898
8898
  }
8899
- const expandedEntries = this.expandPermissionEntries(permissions);
8899
+ const expandedEntries = (0, import_sdk_core11.expandDelegationPermissionEntries)(permissions);
8900
+ const namedKeyEntries = expandedEntries.filter((entry) => entry.service === import_sdk_core11.ENCRYPTION_PERMISSION_SERVICE && entry.path.includes("/"));
8901
+ if (namedKeyEntries.length > 0) {
8902
+ if (expandedEntries.some((entry) => entry.service === import_sdk_core11.ENCRYPTION_PERMISSION_SERVICE && !entry.path.includes("/"))) {
8903
+ throw new import_sdk_core11.ManifestValidationError("named-key delegation cannot include bare-network permissions");
8904
+ }
8905
+ if (options?.forceWalletSign) {
8906
+ throw new import_sdk_core11.ManifestValidationError("named-key delegation requires a signed session grant");
8907
+ }
8908
+ const granted = this.projectSignedRecapCapabilities(session.siwe);
8909
+ const { subset, missing } = this.signedCapabilitySubset(namedKeyEntries, granted);
8910
+ if (!subset) throw new import_sdk_core11.PermissionNotInManifestError(missing, granted);
8911
+ }
8900
8912
  const now = /* @__PURE__ */ new Date();
8901
8913
  const expiryMs = resolveExpiryMs(options?.expiry);
8902
8914
  const expirationTime = new Date(now.getTime() + expiryMs);