@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.
- 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 +3 -3
package/dist/share-receive.d.cts
CHANGED
|
@@ -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-
|
|
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
|
|
package/dist/share-receive.d.ts
CHANGED
|
@@ -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-
|
|
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
|
|
package/dist/share-receive.js
CHANGED
|
@@ -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
|
-
|
|
467
|
-
|
|
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))
|
|
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) {
|