@absolutejs/auth 0.58.0 → 0.59.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/README.md +9 -4
- package/dist/cli/migrate.js +18 -12
- package/dist/cli/migrate.js.map +4 -4
- package/dist/index.d.ts +6 -6
- package/dist/index.js +353 -123
- package/dist/index.js.map +14 -13
- package/dist/mfa/challenge.d.ts +1 -1
- package/dist/mfa/config.d.ts +3 -0
- package/dist/mfa/management.d.ts +3 -3
- package/dist/mfa/postgresMfaStore.d.ts +15 -0
- package/dist/mfa/recentAuth.d.ts +2 -0
- package/dist/mfa/routes.d.ts +6 -6
- package/dist/mfa/sms.d.ts +9 -4
- package/dist/mfa/totp.d.ts +3 -3
- package/dist/mfa/types.d.ts +31 -0
- package/dist/server.js +352 -123
- package/dist/server.js.map +14 -13
- package/dist/verification/types.d.ts +13 -2
- package/package.json +2 -2
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
/** Stable purposes let providers apply separate templates, limits, and audit policy. */
|
|
2
|
-
export type VerificationPurpose = 'mfa_challenge' | 'mfa_enrollment';
|
|
2
|
+
export type VerificationPurpose = 'account_recovery' | 'mfa_challenge' | 'mfa_enrollment' | 'phone_change' | 'phone_signup' | 'step_up';
|
|
3
|
+
export type VerificationChannel = 'call' | 'sms' | 'whatsapp';
|
|
3
4
|
export type VerificationStartInput = {
|
|
4
|
-
channel:
|
|
5
|
+
channel: VerificationChannel;
|
|
6
|
+
/** Optional BCP-47 locale used for provider-managed message copy. */
|
|
7
|
+
locale?: string;
|
|
5
8
|
purpose: VerificationPurpose;
|
|
9
|
+
/** Provider-specific, non-secret rate-limit buckets (for example an IP hash). */
|
|
10
|
+
rateLimits?: Readonly<Record<string, string>>;
|
|
6
11
|
/** Stable application subject. Providers must not include it in message text. */
|
|
7
12
|
subject: string;
|
|
8
13
|
/** E.164 destination. */
|
|
9
14
|
to: string;
|
|
15
|
+
/** Stable tenant key used only for provider/service routing. */
|
|
16
|
+
tenant?: string;
|
|
10
17
|
};
|
|
11
18
|
export type VerificationStartResult = {
|
|
12
19
|
/** Provider reference safe for audit correlation (for example, a Twilio VE SID). */
|
|
@@ -20,6 +27,9 @@ export type VerificationCheckInput = VerificationStartInput & {
|
|
|
20
27
|
/** Exact challenge reference returned by start(). */
|
|
21
28
|
reference: string;
|
|
22
29
|
};
|
|
30
|
+
export type VerificationCancelInput = VerificationStartInput & {
|
|
31
|
+
reference: string;
|
|
32
|
+
};
|
|
23
33
|
export type VerificationCheckResult = {
|
|
24
34
|
reference?: string;
|
|
25
35
|
status: VerificationCheckStatus;
|
|
@@ -42,6 +52,7 @@ export declare class VerificationProviderError extends Error {
|
|
|
42
52
|
*/
|
|
43
53
|
export type VerificationProvider = {
|
|
44
54
|
readonly name: string;
|
|
55
|
+
cancel: (input: VerificationCancelInput) => Promise<void>;
|
|
45
56
|
check: (input: VerificationCheckInput) => Promise<VerificationCheckResult>;
|
|
46
57
|
start: (input: VerificationStartInput) => Promise<VerificationStartResult>;
|
|
47
58
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.59.1",
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"description": "An authorization library for absolutejs",
|
|
5
5
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test": "bun test",
|
|
23
23
|
"format": "absolute prettier --write",
|
|
24
24
|
"lint": "absolute eslint",
|
|
25
|
-
"prepack": "bun -e \"for (const path of ['dist/oidc/config.d.ts','dist/oidc/types.d.ts','dist/oidc/postgresStores.d.ts']) if (!(await Bun.file(path).exists())) throw new Error('Run bun run build before packing: missing ' + path)\"",
|
|
25
|
+
"prepack": "bun -e \"for (const path of ['dist/index.d.ts','dist/server.d.ts','dist/agents/index.d.ts','dist/oidc/index.d.ts','dist/oidc/config.d.ts','dist/oidc/types.d.ts','dist/oidc/postgresStores.d.ts']) if (!(await Bun.file(path).exists())) throw new Error('Run bun run build before packing: missing ' + path)\"",
|
|
26
26
|
"typecheck": "absolute typecheck",
|
|
27
27
|
"verify-package": "absolute-manifest verify-package",
|
|
28
28
|
"check:package": "bun run typecheck && bun run lint && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts",
|