@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/index.cjs CHANGED
@@ -26720,7 +26720,19 @@ var _TinyCloudNode = class _TinyCloudNode {
26720
26720
  "delegateTo requires a non-empty permissions array"
26721
26721
  );
26722
26722
  }
26723
- const expandedEntries = this.expandPermissionEntries(permissions);
26723
+ const expandedEntries = (0, import_sdk_core10.expandDelegationPermissionEntries)(permissions);
26724
+ const namedKeyEntries = expandedEntries.filter((entry) => entry.service === import_sdk_core10.ENCRYPTION_PERMISSION_SERVICE && entry.path.includes("/"));
26725
+ if (namedKeyEntries.length > 0) {
26726
+ if (expandedEntries.some((entry) => entry.service === import_sdk_core10.ENCRYPTION_PERMISSION_SERVICE && !entry.path.includes("/"))) {
26727
+ throw new import_sdk_core10.ManifestValidationError("named-key delegation cannot include bare-network permissions");
26728
+ }
26729
+ if (options?.forceWalletSign) {
26730
+ throw new import_sdk_core10.ManifestValidationError("named-key delegation requires a signed session grant");
26731
+ }
26732
+ const granted = this.projectSignedRecapCapabilities(session.siwe);
26733
+ const { subset, missing } = this.signedCapabilitySubset(namedKeyEntries, granted);
26734
+ if (!subset) throw new import_sdk_core10.PermissionNotInManifestError(missing, granted);
26735
+ }
26724
26736
  const now = /* @__PURE__ */ new Date();
26725
26737
  const expiryMs = resolveExpiryMs(options?.expiry);
26726
26738
  const expirationTime = new Date(now.getTime() + expiryMs);