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