@tinycloud/sdk-core 3.1.0-beta.8 → 3.1.0-beta.9

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.
@@ -1507,8 +1507,17 @@ function canonicalizeRecapCaveats(caveats) {
1507
1507
  }
1508
1508
  return `[${branches.join(",")}]`;
1509
1509
  }
1510
+ var EXPLICIT_ONLY_ACTIONS = {
1511
+ "tinycloud.kv/sync": true,
1512
+ "tinycloud.kv/retain": true
1513
+ };
1514
+ function isExplicitOnlyAction(action) {
1515
+ return Object.prototype.hasOwnProperty.call(EXPLICIT_ONLY_ACTIONS, action);
1516
+ }
1510
1517
  function actionContains(grantedAction, requestedAction) {
1511
- if (grantedAction === "*" || grantedAction === requestedAction) return true;
1518
+ if (grantedAction === requestedAction) return true;
1519
+ if (isExplicitOnlyAction(requestedAction)) return false;
1520
+ if (grantedAction === "*") return true;
1512
1521
  if (!grantedAction.endsWith("/*")) return false;
1513
1522
  const service = grantedAction.slice(0, -2);
1514
1523
  return requestedAction === service || requestedAction.startsWith(`${service}/`);
@@ -5740,7 +5749,9 @@ var SharingService = class {
5740
5749
  if (delegation.allowSubDelegation === false) continue;
5741
5750
  if (!this.pathMatches(delegation.path || "", path)) continue;
5742
5751
  const delegationActions = delegation.actions || [];
5743
- if (!actions.every((action) => delegationActions.includes(action) || delegationActions.includes("*"))) {
5752
+ if (!actions.every(
5753
+ (action) => delegationActions.some((granted) => actionContains(granted, action))
5754
+ )) {
5744
5755
  continue;
5745
5756
  }
5746
5757
  if ((delegation.caveats?.length ?? 0) > 0) {