@haex-space/vault-sdk 4.7.0 → 4.7.1

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.
@@ -2721,6 +2721,11 @@ var PermissionWaiterRegistry = class {
2721
2721
  for (const callback of [...set]) callback(decision);
2722
2722
  }
2723
2723
  };
2724
+ function promptedKey(error) {
2725
+ const details = error.details ?? {};
2726
+ const field = (name) => typeof details[name] === "string" ? details[name] : error[name];
2727
+ return permissionKey(field("resourceType"), field("action"), field("target"));
2728
+ }
2724
2729
  function toDeniedError(error) {
2725
2730
  return { ...error, code: 1002 /* DENIED */ };
2726
2731
  }
@@ -2733,7 +2738,7 @@ async function withPermissionRetry(send, registry, log, timeoutMs = PERMISSION_D
2733
2738
  if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_PROMPTS) {
2734
2739
  throw error;
2735
2740
  }
2736
- const key = permissionKey(error.resourceType, error.action, error.target);
2741
+ const key = promptedKey(error);
2737
2742
  const times = asked.get(key) ?? 0;
2738
2743
  if (times >= MAX_PERMISSION_RETRIES) throw error;
2739
2744
  asked.set(key, times + 1);