@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.
package/dist/index.mjs CHANGED
@@ -3531,6 +3531,11 @@ var PermissionWaiterRegistry = class {
3531
3531
  for (const callback of [...set]) callback(decision);
3532
3532
  }
3533
3533
  };
3534
+ function promptedKey(error) {
3535
+ const details = error.details ?? {};
3536
+ const field = (name) => typeof details[name] === "string" ? details[name] : error[name];
3537
+ return permissionKey(field("resourceType"), field("action"), field("target"));
3538
+ }
3534
3539
  function toDeniedError(error) {
3535
3540
  return { ...error, code: 1002 /* DENIED */ };
3536
3541
  }
@@ -3543,7 +3548,7 @@ async function withPermissionRetry(send, registry, log, timeoutMs = PERMISSION_D
3543
3548
  if (!isPermissionPromptError(error) || attempt >= MAX_PERMISSION_PROMPTS) {
3544
3549
  throw error;
3545
3550
  }
3546
- const key = permissionKey(error.resourceType, error.action, error.target);
3551
+ const key = promptedKey(error);
3547
3552
  const times = asked.get(key) ?? 0;
3548
3553
  if (times >= MAX_PERMISSION_RETRIES) throw error;
3549
3554
  asked.set(key, times + 1);