@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.
Files changed (70) hide show
  1. package/dist/adapters/node.d.mts +0 -1
  2. package/dist/client.d.mts +293 -287
  3. package/dist/client.mjs +1 -0
  4. package/dist/core.d.mts +23 -24
  5. package/dist/core.mjs +6 -6
  6. package/dist/error.d.mts +53 -53
  7. package/dist/keys.d.mts +0 -1
  8. package/dist/mutex.d.mts +14 -14
  9. package/dist/provider/apple.d.mts +34 -35
  10. package/dist/provider/code.d.mts +75 -85
  11. package/dist/provider/code.mjs +83 -0
  12. package/dist/provider/discord.d.mts +49 -50
  13. package/dist/provider/facebook.d.mts +49 -50
  14. package/dist/provider/github.d.mts +50 -51
  15. package/dist/provider/gitlab.d.mts +34 -35
  16. package/dist/provider/google.d.mts +49 -50
  17. package/dist/provider/linkedin.d.mts +47 -48
  18. package/dist/provider/magiclink.d.mts +28 -38
  19. package/dist/provider/magiclink.mjs +57 -0
  20. package/dist/provider/microsoft.d.mts +67 -68
  21. package/dist/provider/oauth2.d.mts +75 -76
  22. package/dist/provider/oauth2.mjs +57 -0
  23. package/dist/provider/passkey.d.mts +20 -21
  24. package/dist/provider/password.d.mts +174 -202
  25. package/dist/provider/provider.d.mts +107 -109
  26. package/dist/provider/reddit.d.mts +33 -34
  27. package/dist/provider/slack.d.mts +34 -35
  28. package/dist/provider/spotify.d.mts +34 -35
  29. package/dist/provider/totp.d.mts +43 -44
  30. package/dist/provider/twitch.d.mts +33 -34
  31. package/dist/provider/vercel.d.mts +65 -66
  32. package/dist/revocation.d.mts +29 -30
  33. package/dist/router/context.d.mts +21 -0
  34. package/dist/router/context.mjs +193 -0
  35. package/dist/router/cookies.d.mts +8 -0
  36. package/dist/router/cookies.mjs +13 -0
  37. package/dist/router/index.d.mts +21 -0
  38. package/dist/router/index.mjs +107 -0
  39. package/dist/router/matcher.d.mts +15 -0
  40. package/dist/router/matcher.mjs +76 -0
  41. package/dist/router/middleware/cors.d.mts +15 -0
  42. package/dist/router/middleware/cors.mjs +114 -0
  43. package/dist/router/safe-request.d.mts +52 -0
  44. package/dist/router/safe-request.mjs +160 -0
  45. package/dist/router/types.d.mts +67 -0
  46. package/dist/router/types.mjs +1 -0
  47. package/dist/router/variables.d.mts +12 -0
  48. package/dist/router/variables.mjs +20 -0
  49. package/dist/storage/memory.d.mts +11 -12
  50. package/dist/storage/storage.d.mts +110 -110
  51. package/dist/storage/turso.d.mts +0 -1
  52. package/dist/storage/unstorage.d.mts +0 -1
  53. package/dist/subject.d.mts +0 -1
  54. package/dist/themes/theme.d.mts +101 -101
  55. package/dist/toolkit/client.d.mts +56 -57
  56. package/dist/toolkit/providers/facebook.d.mts +0 -1
  57. package/dist/toolkit/providers/github.d.mts +0 -1
  58. package/dist/toolkit/providers/google.d.mts +0 -1
  59. package/dist/toolkit/storage.d.mts +8 -8
  60. package/dist/ui/base.d.mts +0 -1
  61. package/dist/ui/code.d.mts +5 -6
  62. package/dist/ui/form.d.mts +6 -7
  63. package/dist/ui/icon.d.mts +0 -1
  64. package/dist/ui/magiclink.d.mts +5 -6
  65. package/dist/ui/passkey.d.mts +0 -1
  66. package/dist/ui/password.d.mts +2 -3
  67. package/dist/ui/select.d.mts +0 -1
  68. package/dist/ui/totp.d.mts +0 -1
  69. package/dist/util.d.mts +1 -2
  70. package/package.json +6 -7
@@ -1,7 +1,6 @@
1
1
  import { OAuthStrategy } from "./strategy.mjs";
2
2
 
3
3
  //#region src/toolkit/providers/google.d.ts
4
-
5
4
  /**
6
5
  * Google OAuth 2.0 / OpenID Connect strategy.
7
6
  *
@@ -23,18 +23,18 @@ interface PKCEState {
23
23
  */
24
24
  interface AuthStorage {
25
25
  /**
26
- * Store PKCE state data.
27
- * @param state - PKCE state to persist
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
- * Retrieve stored PKCE state data.
32
- * @returns Stored state or null if not found
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
- * Clear stored PKCE state data.
37
- */
36
+ * Clear stored PKCE state data.
37
+ */
38
38
  clear(): void | Promise<void>;
39
39
  }
40
40
  /**
@@ -3,7 +3,6 @@ import * as preact0 from "preact";
3
3
  import { ComponentChildren } from "preact";
4
4
 
5
5
  //#region src/ui/base.d.ts
6
-
7
6
  /**
8
7
  * Props for the Layout component
9
8
  */
@@ -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
- * Input mode determining the type of contact information to collect
30
- * @default "email"
31
- */
28
+ * Input mode determining the type of contact information to collect
29
+ * @default "email"
30
+ */
32
31
  readonly mode?: CodeUIMode;
33
32
  /**
34
- * Custom text copy for UI labels, messages, and errors
35
- */
33
+ * Custom text copy for UI labels, messages, and errors
34
+ */
36
35
  readonly copy?: Partial<CodeUICopy>;
37
36
  }
38
37
  /**
@@ -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
- * The message text to display in the alert.
15
- * If not provided, the alert will not render.
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
- * Visual style variant for the alert.
20
- * @default "danger"
21
- */
18
+ * Visual style variant for the alert.
19
+ * @default "danger"
20
+ */
22
21
  readonly color?: FormAlertColor;
23
22
  }
24
23
  /**
@@ -1,7 +1,6 @@
1
1
  import { ComponentChildren } from "preact";
2
2
 
3
3
  //#region src/ui/icon.d.ts
4
-
5
4
  /**
6
5
  * GitHub brand icon with official logo design.
7
6
  */
@@ -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
- * Input mode determining the type of contact information to collect
28
- * @default "email"
29
- */
26
+ * Input mode determining the type of contact information to collect
27
+ * @default "email"
28
+ */
30
29
  readonly mode?: MagicLinkUIMode;
31
30
  /**
32
- * Custom text copy for UI labels, messages, and errors
33
- */
31
+ * Custom text copy for UI labels, messages, and errors
32
+ */
34
33
  readonly copy?: Partial<MagicLinkUICopy>;
35
34
  }
36
35
  /**
@@ -1,7 +1,6 @@
1
1
  import { PasskeyProviderConfig } from "../provider/passkey.mjs";
2
2
 
3
3
  //#region src/ui/passkey.d.ts
4
-
5
4
  /**
6
5
  * Strongly typed copy text configuration for passkey UI
7
6
  */
@@ -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
- * Custom text copy for UI labels, messages, and errors
34
- */
32
+ * Custom text copy for UI labels, messages, and errors
33
+ */
35
34
  readonly copy?: Partial<PasswordUICopy>;
36
35
  }
37
36
  /**
@@ -1,7 +1,6 @@
1
1
  import { Theme } from "../themes/theme.mjs";
2
2
 
3
3
  //#region src/ui/select.d.ts
4
-
5
4
  /**
6
5
  * Provider configuration for the select UI
7
6
  */
@@ -1,7 +1,6 @@
1
1
  import { TOTPProviderConfig } from "../provider/totp.mjs";
2
2
 
3
3
  //#region src/ui/totp.d.ts
4
-
5
4
  /**
6
5
  * Strongly typed copy text configuration for TOTP UI
7
6
  */
package/dist/util.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import { RouterContext } from "@draftlab/auth-router/types";
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.14.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.3",
40
+ "@types/node": "^25.0.9",
41
41
  "@types/qrcode": "^1.5.6",
42
- "tsdown": "^0.18.3",
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.1",
64
- "preact-render-to-string": "^6.6.4",
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"