@draftlab/auth 0.14.0 → 0.15.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/adapters/node.d.mts +0 -1
- package/dist/client.d.mts +293 -287
- package/dist/client.mjs +1 -0
- package/dist/core.d.mts +23 -24
- package/dist/core.mjs +6 -6
- package/dist/error.d.mts +53 -53
- package/dist/keys.d.mts +0 -1
- package/dist/mutex.d.mts +14 -14
- package/dist/provider/apple.d.mts +34 -35
- package/dist/provider/code.d.mts +75 -85
- package/dist/provider/code.mjs +83 -0
- package/dist/provider/discord.d.mts +49 -50
- package/dist/provider/facebook.d.mts +49 -50
- package/dist/provider/github.d.mts +50 -51
- package/dist/provider/gitlab.d.mts +34 -35
- package/dist/provider/google.d.mts +49 -50
- package/dist/provider/linkedin.d.mts +47 -48
- package/dist/provider/magiclink.d.mts +28 -38
- package/dist/provider/magiclink.mjs +57 -0
- package/dist/provider/microsoft.d.mts +67 -68
- package/dist/provider/oauth2.d.mts +75 -76
- package/dist/provider/oauth2.mjs +57 -0
- package/dist/provider/passkey.d.mts +20 -21
- package/dist/provider/password.d.mts +174 -202
- package/dist/provider/provider.d.mts +107 -109
- package/dist/provider/reddit.d.mts +33 -34
- package/dist/provider/slack.d.mts +34 -35
- package/dist/provider/spotify.d.mts +34 -35
- package/dist/provider/totp.d.mts +43 -44
- package/dist/provider/twitch.d.mts +33 -34
- package/dist/provider/vercel.d.mts +65 -66
- package/dist/revocation.d.mts +29 -30
- package/dist/router/context.d.mts +21 -0
- package/dist/router/context.mjs +193 -0
- package/dist/router/cookies.d.mts +8 -0
- package/dist/router/cookies.mjs +13 -0
- package/dist/router/index.d.mts +21 -0
- package/dist/router/index.mjs +107 -0
- package/dist/router/matcher.d.mts +15 -0
- package/dist/router/matcher.mjs +76 -0
- package/dist/router/middleware/cors.d.mts +15 -0
- package/dist/router/middleware/cors.mjs +114 -0
- package/dist/router/safe-request.d.mts +52 -0
- package/dist/router/safe-request.mjs +160 -0
- package/dist/router/types.d.mts +67 -0
- package/dist/router/types.mjs +1 -0
- package/dist/router/variables.d.mts +12 -0
- package/dist/router/variables.mjs +20 -0
- package/dist/storage/memory.d.mts +11 -12
- package/dist/storage/storage.d.mts +110 -110
- package/dist/storage/turso.d.mts +0 -1
- package/dist/storage/unstorage.d.mts +0 -1
- package/dist/subject.d.mts +0 -1
- package/dist/themes/theme.d.mts +101 -101
- package/dist/toolkit/client.d.mts +56 -57
- package/dist/toolkit/providers/facebook.d.mts +0 -1
- package/dist/toolkit/providers/github.d.mts +0 -1
- package/dist/toolkit/providers/google.d.mts +0 -1
- package/dist/toolkit/storage.d.mts +8 -8
- package/dist/ui/base.d.mts +0 -1
- package/dist/ui/code.d.mts +5 -6
- package/dist/ui/form.d.mts +6 -7
- package/dist/ui/icon.d.mts +0 -1
- package/dist/ui/magiclink.d.mts +5 -6
- package/dist/ui/passkey.d.mts +0 -1
- package/dist/ui/password.d.mts +2 -3
- package/dist/ui/select.d.mts +0 -1
- package/dist/ui/totp.d.mts +0 -1
- package/dist/util.d.mts +1 -2
- package/package.json +6 -7
|
@@ -23,18 +23,18 @@ interface PKCEState {
|
|
|
23
23
|
*/
|
|
24
24
|
interface AuthStorage {
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* Store PKCE state data.
|
|
27
|
+
* @param state - PKCE state to persist
|
|
28
|
+
*/
|
|
29
29
|
set(state: PKCEState): void | Promise<void>;
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
* Retrieve stored PKCE state data.
|
|
32
|
+
* @returns Stored state or null if not found
|
|
33
|
+
*/
|
|
34
34
|
get(): PKCEState | null | Promise<PKCEState | null>;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
* Clear stored PKCE state data.
|
|
37
|
+
*/
|
|
38
38
|
clear(): void | Promise<void>;
|
|
39
39
|
}
|
|
40
40
|
/**
|
package/dist/ui/base.d.mts
CHANGED
package/dist/ui/code.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CodeProviderOptions } from "../provider/code.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/ui/code.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Type for customizable UI copy text
|
|
7
6
|
*/
|
|
@@ -26,13 +25,13 @@ type CodeUIMode = "email" | "phone";
|
|
|
26
25
|
*/
|
|
27
26
|
interface CodeUIOptions extends Pick<CodeProviderOptions, "sendCode"> {
|
|
28
27
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
* Input mode determining the type of contact information to collect
|
|
29
|
+
* @default "email"
|
|
30
|
+
*/
|
|
32
31
|
readonly mode?: CodeUIMode;
|
|
33
32
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
* Custom text copy for UI labels, messages, and errors
|
|
34
|
+
*/
|
|
36
35
|
readonly copy?: Partial<CodeUICopy>;
|
|
37
36
|
}
|
|
38
37
|
/**
|
package/dist/ui/form.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ComponentChildren } from "preact";
|
|
2
2
|
|
|
3
3
|
//#region src/ui/form.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Alert color variant determining the visual style and icon.
|
|
7
6
|
*/
|
|
@@ -11,14 +10,14 @@ type FormAlertColor = "danger" | "success";
|
|
|
11
10
|
*/
|
|
12
11
|
interface FormAlertProps {
|
|
13
12
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
* The message text to display in the alert.
|
|
14
|
+
* If not provided, the alert will not render.
|
|
15
|
+
*/
|
|
17
16
|
readonly message?: string;
|
|
18
17
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
* Visual style variant for the alert.
|
|
19
|
+
* @default "danger"
|
|
20
|
+
*/
|
|
22
21
|
readonly color?: FormAlertColor;
|
|
23
22
|
}
|
|
24
23
|
/**
|
package/dist/ui/icon.d.mts
CHANGED
package/dist/ui/magiclink.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MagicLinkConfig } from "../provider/magiclink.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/ui/magiclink.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Type for customizable UI copy text
|
|
7
6
|
*/
|
|
@@ -24,13 +23,13 @@ type MagicLinkUIMode = "email" | "phone";
|
|
|
24
23
|
*/
|
|
25
24
|
interface MagicLinkUIOptions<Claims extends Record<string, string> = Record<string, string>> extends Pick<MagicLinkConfig<Claims>, "sendLink"> {
|
|
26
25
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
* Input mode determining the type of contact information to collect
|
|
27
|
+
* @default "email"
|
|
28
|
+
*/
|
|
30
29
|
readonly mode?: MagicLinkUIMode;
|
|
31
30
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
* Custom text copy for UI labels, messages, and errors
|
|
32
|
+
*/
|
|
34
33
|
readonly copy?: Partial<MagicLinkUICopy>;
|
|
35
34
|
}
|
|
36
35
|
/**
|
package/dist/ui/passkey.d.mts
CHANGED
package/dist/ui/password.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PasswordConfig } from "../provider/password.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/ui/password.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Strongly typed copy text configuration for password UI
|
|
7
6
|
*/
|
|
@@ -30,8 +29,8 @@ interface PasswordUICopy {
|
|
|
30
29
|
*/
|
|
31
30
|
interface PasswordUIOptions extends Pick<PasswordConfig, "sendCode" | "validatePassword"> {
|
|
32
31
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
* Custom text copy for UI labels, messages, and errors
|
|
33
|
+
*/
|
|
35
34
|
readonly copy?: Partial<PasswordUICopy>;
|
|
36
35
|
}
|
|
37
36
|
/**
|
package/dist/ui/select.d.mts
CHANGED
package/dist/ui/totp.d.mts
CHANGED
package/dist/util.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { RouterContext } from "
|
|
1
|
+
import { RouterContext } from "./router/types.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/util.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Utility type that flattens complex types for better IntelliSense display.
|
|
7
6
|
* Converts intersections and complex mapped types into cleaner object types.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftlab/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core implementation for @draftlab/auth",
|
|
6
6
|
"author": "Matheus Pergoli",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
],
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^25.0.
|
|
40
|
+
"@types/node": "^25.0.9",
|
|
41
41
|
"@types/qrcode": "^1.5.6",
|
|
42
|
-
"tsdown": "
|
|
42
|
+
"tsdown": "0.20.0-beta.3",
|
|
43
43
|
"typescript": "^5.9.3",
|
|
44
44
|
"@draftlab/tsconfig": "0.1.0"
|
|
45
45
|
},
|
|
@@ -60,10 +60,9 @@
|
|
|
60
60
|
"@standard-schema/spec": "^1.1.0",
|
|
61
61
|
"jose": "^6.1.3",
|
|
62
62
|
"otpauth": "^9.4.1",
|
|
63
|
-
"preact": "^10.28.
|
|
64
|
-
"preact-render-to-string": "^6.6.
|
|
65
|
-
"qrcode": "^1.5.4"
|
|
66
|
-
"@draftlab/auth-router": "0.5.0"
|
|
63
|
+
"preact": "^10.28.2",
|
|
64
|
+
"preact-render-to-string": "^6.6.5",
|
|
65
|
+
"qrcode": "^1.5.4"
|
|
67
66
|
},
|
|
68
67
|
"engines": {
|
|
69
68
|
"node": ">=18"
|