@tinycloud/node-sdk 3.9.0-beta.4 → 3.9.0-beta.5
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/credential-pending-store.cjs.map +1 -1
- package/dist/credential-pending-store.d.cts +1 -1
- package/dist/credential-pending-store.d.ts +1 -1
- package/dist/credential-pending-store.js.map +1 -1
- package/dist/credentials.cjs +7 -3
- package/dist/credentials.cjs.map +1 -1
- package/dist/credentials.d.cts +1 -1
- package/dist/credentials.d.ts +1 -1
- package/dist/credentials.js +7 -3
- package/dist/credentials.js.map +1 -1
- package/dist/{email-proof-BaOqVlB-.d.cts → email-proof-B4DRizIL.d.cts} +3 -2
- package/dist/{email-proof-BaOqVlB-.d.ts → email-proof-B4DRizIL.d.ts} +3 -2
- package/dist/share-receive.cjs +7 -3
- package/dist/share-receive.cjs.map +1 -1
- package/dist/share-receive.d.cts +1 -1
- package/dist/share-receive.d.ts +1 -1
- package/dist/share-receive.js +7 -3
- package/dist/share-receive.js.map +1 -1
- package/package.json +2 -2
package/dist/credentials.cjs
CHANGED
|
@@ -467,6 +467,7 @@ var MESSAGES = {
|
|
|
467
467
|
CANCELED: "Email verification was canceled.",
|
|
468
468
|
FAILED: "Email verification failed."
|
|
469
469
|
};
|
|
470
|
+
var LOCAL_PROFILE_UNAVAILABLE = "This SDK build doesn't enable the email verification profile.";
|
|
470
471
|
function rateLimitMessage(retryAfterMs) {
|
|
471
472
|
const head = "Too many codes were requested for this address.";
|
|
472
473
|
if (retryAfterMs === void 0 || !Number.isFinite(retryAfterMs) || retryAfterMs <= 0) return `${head} Try again in about an hour.`;
|
|
@@ -474,8 +475,9 @@ function rateLimitMessage(retryAfterMs) {
|
|
|
474
475
|
return `${head} Try again in ${minutes} ${minutes === 1 ? "minute" : "minutes"}.`;
|
|
475
476
|
}
|
|
476
477
|
var EmailProofError = class extends Error {
|
|
477
|
-
|
|
478
|
-
|
|
478
|
+
/** `message` overrides the code's text for one refusal whose cause the shared text would misdescribe. It never carries request data. */
|
|
479
|
+
constructor(step, code, retryAfterMs, recoverable = RECOVERABILITY[code], message) {
|
|
480
|
+
super(message ?? (code === "RATE_LIMITED" ? rateLimitMessage(retryAfterMs) : MESSAGES[code]));
|
|
479
481
|
this.name = "EmailProofError";
|
|
480
482
|
this.step = step;
|
|
481
483
|
this.code = code;
|
|
@@ -762,7 +764,9 @@ function assertHolder(holder, step, profile) {
|
|
|
762
764
|
}
|
|
763
765
|
function profilePin(profile, step, allowHeld) {
|
|
764
766
|
const entry = Object.prototype.hasOwnProperty.call(PROFILE_PINS, profile) ? PROFILE_PINS[profile] : void 0;
|
|
765
|
-
if (!entry || !entry.enabled && !(allowHeld === true && profile === HELD_PROFILE))
|
|
767
|
+
if (!entry || !entry.enabled && !(allowHeld === true && profile === HELD_PROFILE)) {
|
|
768
|
+
throw new EmailProofError(step, "PROFILE_UNAVAILABLE", void 0, void 0, LOCAL_PROFILE_UNAVAILABLE);
|
|
769
|
+
}
|
|
766
770
|
return entry;
|
|
767
771
|
}
|
|
768
772
|
function emailRequirement(address, profile) {
|