@tinycloud/node-sdk 3.9.0-beta.4 → 3.9.0-beta.6

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.
@@ -1,6 +1,6 @@
1
1
  import { ShareMetadata, ShareFetchOptions } from '@tinycloud/share-sdk';
2
2
  import { ShareEnvelopeV3 } from '@tinycloud/share-envelope';
3
- import { m as HolderSigner, a as EmailProofPending } from './email-proof-BaOqVlB-.cjs';
3
+ import { m as HolderSigner, a as EmailProofPending } from './email-proof-B4DRizIL.cjs';
4
4
  import '@tinycloud/sdk-core';
5
5
  import '@tinycloud/sdk-core/held-credentials';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { ShareMetadata, ShareFetchOptions } from '@tinycloud/share-sdk';
2
2
  import { ShareEnvelopeV3 } from '@tinycloud/share-envelope';
3
- import { m as HolderSigner, a as EmailProofPending } from './email-proof-BaOqVlB-.js';
3
+ import { m as HolderSigner, a as EmailProofPending } from './email-proof-B4DRizIL.js';
4
4
  import '@tinycloud/sdk-core';
5
5
  import '@tinycloud/sdk-core/held-credentials';
6
6
 
@@ -456,6 +456,7 @@ var MESSAGES = {
456
456
  CANCELED: "Email verification was canceled.",
457
457
  FAILED: "Email verification failed."
458
458
  };
459
+ var LOCAL_PROFILE_UNAVAILABLE = "This SDK build doesn't enable the email verification profile.";
459
460
  function rateLimitMessage(retryAfterMs) {
460
461
  const head = "Too many codes were requested for this address.";
461
462
  if (retryAfterMs === void 0 || !Number.isFinite(retryAfterMs) || retryAfterMs <= 0) return `${head} Try again in about an hour.`;
@@ -463,8 +464,9 @@ function rateLimitMessage(retryAfterMs) {
463
464
  return `${head} Try again in ${minutes} ${minutes === 1 ? "minute" : "minutes"}.`;
464
465
  }
465
466
  var EmailProofError = class extends Error {
466
- constructor(step, code, retryAfterMs, recoverable = RECOVERABILITY[code]) {
467
- super(code === "RATE_LIMITED" ? rateLimitMessage(retryAfterMs) : MESSAGES[code]);
467
+ /** `message` overrides the code's text for one refusal whose cause the shared text would misdescribe. It never carries request data. */
468
+ constructor(step, code, retryAfterMs, recoverable = RECOVERABILITY[code], message) {
469
+ super(message ?? (code === "RATE_LIMITED" ? rateLimitMessage(retryAfterMs) : MESSAGES[code]));
468
470
  this.name = "EmailProofError";
469
471
  this.step = step;
470
472
  this.code = code;
@@ -680,7 +682,9 @@ function assertHolder(holder, step, profile) {
680
682
  }
681
683
  function profilePin(profile, step, allowHeld) {
682
684
  const entry = Object.prototype.hasOwnProperty.call(PROFILE_PINS, profile) ? PROFILE_PINS[profile] : void 0;
683
- if (!entry || !entry.enabled && !(allowHeld === true && profile === HELD_PROFILE)) throw new EmailProofError(step, "PROFILE_UNAVAILABLE");
685
+ if (!entry || !entry.enabled && !(allowHeld === true && profile === HELD_PROFILE)) {
686
+ throw new EmailProofError(step, "PROFILE_UNAVAILABLE", void 0, void 0, LOCAL_PROFILE_UNAVAILABLE);
687
+ }
684
688
  return entry;
685
689
  }
686
690
  function emailRequirement(address, profile) {