@absolutejs/auth 0.22.7 → 0.24.0

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 (93) hide show
  1. package/README.md +6 -13
  2. package/dist/htmxRoutes.d.ts +514 -0
  3. package/dist/index.d.ts +752 -1
  4. package/dist/index.js +207 -40
  5. package/dist/index.js.map +8 -6
  6. package/dist/{src/types.d.ts → types.d.ts} +6 -0
  7. package/dist/ui/index.d.ts +2 -0
  8. package/dist/ui/index.js +2212 -0
  9. package/dist/ui/index.js.map +11 -0
  10. package/dist/ui/renderers.d.ts +8 -0
  11. package/dist/ui/types.d.ts +129 -0
  12. package/package.json +71 -86
  13. package/dist/example/components/auth/AuthContainer.d.ts +0 -1
  14. package/dist/example/components/auth/OAuthButton.d.ts +0 -7
  15. package/dist/example/components/auth/OAuthButtons.d.ts +0 -5
  16. package/dist/example/components/hamburger/HamburgerDropdown.d.ts +0 -10
  17. package/dist/example/components/hamburger/HamburgerHeader.d.ts +0 -5
  18. package/dist/example/components/hamburger/HamburgerMenu.d.ts +0 -14
  19. package/dist/example/components/hamburger/HamburgerUserButtons.d.ts +0 -8
  20. package/dist/example/components/navbar/DropdownContainer.d.ts +0 -17
  21. package/dist/example/components/navbar/Navbar.d.ts +0 -7
  22. package/dist/example/components/navbar/NavbarDropdown.d.ts +0 -10
  23. package/dist/example/components/navbar/NavbarLink.d.ts +0 -8
  24. package/dist/example/components/navbar/NavbarLinks.d.ts +0 -6
  25. package/dist/example/components/navbar/NavbarUserButtons.d.ts +0 -7
  26. package/dist/example/components/page/Head.d.ts +0 -6
  27. package/dist/example/components/protected/AccountOverview.d.ts +0 -6
  28. package/dist/example/components/protected/DeleteAccountSection.d.ts +0 -5
  29. package/dist/example/components/protected/LinkedAuthIdentitiesPanel.d.ts +0 -1
  30. package/dist/example/components/protected/LinkedProvidersPanel.d.ts +0 -1
  31. package/dist/example/components/protected/ProviderButtons.d.ts +0 -1
  32. package/dist/example/components/protected/SettingsNoticeToast.d.ts +0 -1
  33. package/dist/example/components/protected/UserInfo.d.ts +0 -7
  34. package/dist/example/components/utils/AnimatedComponents.d.ts +0 -1
  35. package/dist/example/components/utils/Divider.d.ts +0 -7
  36. package/dist/example/components/utils/HighlightedJson.d.ts +0 -5
  37. package/dist/example/components/utils/JsonLine.d.ts +0 -6
  38. package/dist/example/components/utils/Modal.d.ts +0 -9
  39. package/dist/example/components/utils/ProfilePicture.d.ts +0 -8
  40. package/dist/example/components/utils/ProviderDropdown.d.ts +0 -8
  41. package/dist/example/components/utils/Toast.d.ts +0 -14
  42. package/dist/example/components/utils/ToastProvider.d.ts +0 -30
  43. package/dist/example/db/schema.d.ts +0 -2570
  44. package/dist/example/eden/treaty.d.ts +0 -1
  45. package/dist/example/handlers/userHandlers.d.ts +0 -254
  46. package/dist/example/hooks/useAuthIdentityPayload.d.ts +0 -37
  47. package/dist/example/hooks/useAuthStatus.d.ts +0 -19
  48. package/dist/example/hooks/useContainerQuery.d.ts +0 -10
  49. package/dist/example/hooks/useMediaQuery.d.ts +0 -11
  50. package/dist/example/linkedProviders/persistCallbackAuthorization.d.ts +0 -30
  51. package/dist/example/linkedProviders/resolver.d.ts +0 -1
  52. package/dist/example/linkedProviders/stores.d.ts +0 -9
  53. package/dist/example/pages/Connectors.d.ts +0 -1
  54. package/dist/example/pages/Home.d.ts +0 -1
  55. package/dist/example/pages/NotAuthorized.d.ts +0 -1
  56. package/dist/example/pages/Protected.d.ts +0 -1
  57. package/dist/example/pages/Settings.d.ts +0 -1
  58. package/dist/example/server.d.ts +0 -902
  59. package/dist/example/styles/authModalStyles.d.ts +0 -22
  60. package/dist/example/styles/navbarStyles.d.ts +0 -15
  61. package/dist/example/styles/styles.d.ts +0 -15
  62. package/dist/example/utils/absoluteAuthConfig.d.ts +0 -4
  63. package/dist/example/utils/constants.d.ts +0 -1
  64. package/dist/example/utils/navbarData.d.ts +0 -2
  65. package/dist/example/utils/providerData.d.ts +0 -9
  66. package/dist/example/utils/providersConfiguration.d.ts +0 -1
  67. package/dist/example/utils/typeGuards.d.ts +0 -1
  68. package/dist/example/utils/types.d.ts +0 -26
  69. package/dist/src/index.d.ts +0 -300
  70. /package/dist/{src/authSessionStores.d.ts → authSessionStores.d.ts} +0 -0
  71. /package/dist/{src/authorize.d.ts → authorize.d.ts} +0 -0
  72. /package/dist/{src/callback.d.ts → callback.d.ts} +0 -0
  73. /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
  74. /package/dist/{src/errors.d.ts → errors.d.ts} +0 -0
  75. /package/dist/{src/linkedProviderResolver.d.ts → linkedProviderResolver.d.ts} +0 -0
  76. /package/dist/{src/linkedProviderStores.d.ts → linkedProviderStores.d.ts} +0 -0
  77. /package/dist/{src/neonAuthSessionStore.d.ts → neonAuthSessionStore.d.ts} +0 -0
  78. /package/dist/{src/neonLinkedProviders.d.ts → neonLinkedProviders.d.ts} +0 -0
  79. /package/dist/{src/oauthLinkedProviderResolver.d.ts → oauthLinkedProviderResolver.d.ts} +0 -0
  80. /package/dist/{src/profile.d.ts → profile.d.ts} +0 -0
  81. /package/dist/{src/protectRoute.d.ts → protectRoute.d.ts} +0 -0
  82. /package/dist/{src/providerClients.d.ts → providerClients.d.ts} +0 -0
  83. /package/dist/{src/refresh.d.ts → refresh.d.ts} +0 -0
  84. /package/dist/{src/revoke.d.ts → revoke.d.ts} +0 -0
  85. /package/dist/{src/sessionAccess.d.ts → sessionAccess.d.ts} +0 -0
  86. /package/dist/{src/sessionCleanup.d.ts → sessionCleanup.d.ts} +0 -0
  87. /package/dist/{src/sessionStore.d.ts → sessionStore.d.ts} +0 -0
  88. /package/dist/{src/sessionTypes.d.ts → sessionTypes.d.ts} +0 -0
  89. /package/dist/{src/signout.d.ts → signout.d.ts} +0 -0
  90. /package/dist/{src/typeGuards.d.ts → typeGuards.d.ts} +0 -0
  91. /package/dist/{src/typebox.d.ts → typebox.d.ts} +0 -0
  92. /package/dist/{src/userStatus.d.ts → userStatus.d.ts} +0 -0
  93. /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
package/package.json CHANGED
@@ -1,88 +1,73 @@
1
1
  {
2
- "version": "0.22.7",
3
- "name": "@absolutejs/auth",
4
- "description": "An authorization library for absolutejs",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/absolutejs/absolute-auth.git"
8
- },
9
- "main": "./dist/index.js",
10
- "license": "CC BY-NC 4.0",
11
- "author": "Alex Kahn",
12
- "scripts": {
13
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external elysia && tsc --emitDeclarationOnly --project tsconfig.json && bun -e \"await Bun.write(\\\"dist/index.d.ts\\\", \\\"export * from \\\\\\\"./src/index\\\\\\\";\\n\\\")\"",
14
- "test": "echo \"Error: no test specified\" && exit 1",
15
- "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json}\"",
16
- "dev": "bun run --watch example/server.ts",
17
- "db:push": "drizzle-kit push",
18
- "db:migrate": "bun run ./example/db/migrate.ts",
19
- "db:studio": "drizzle-kit studio",
20
- "lint": "eslint ./src ./example ./eslint.config.mjs",
21
- "typecheck": "bun run tsc --noEmit",
22
- "release": "bun run format && bun run build && bun publish"
23
- },
24
- "keywords": [
25
- "authorization",
26
- "authentication",
27
- "absolutejs",
28
- "elysia",
29
- "oauth"
30
- ],
31
- "types": "./dist/index.d.ts",
32
- "peerDependencies": {
33
- "elysia": ">= 1.4.26"
34
- },
35
- "dependencies": {
36
- "@absolutejs/linked-providers": "0.0.2",
37
- "citra": "0.25.11",
38
- "@neondatabase/serverless": "1.0.0",
39
- "drizzle-orm": "0.41.0"
40
- },
41
- "devDependencies": {
42
- "@absolutejs/absolute": "0.12.3",
43
- "@tanstack/react-query": "5.79.0",
44
- "@elysiajs/eden": "1.2.0",
45
- "@elysiajs/static": "1.2.0",
46
- "@react-spring/web": "10.0.0-beta.0",
47
- "@stylistic/eslint-plugin-ts": "4.2.0",
48
- "@types/bun": "1.2.9",
49
- "@types/react": "19.1.1",
50
- "@types/react-dom": "19.1.2",
51
- "drizzle-kit": "0.30.6",
52
- "elysia": "1.4.26",
53
- "eslint": "9.26.0",
54
- "eslint-plugin-absolute": "0.0.3",
55
- "eslint-plugin-import": "2.31.0",
56
- "eslint-plugin-jsx-a11y": "6.10.2",
57
- "eslint-plugin-promise": "7.2.1",
58
- "eslint-plugin-react": "7.37.5",
59
- "eslint-plugin-react-compiler": "19.1.0-rc.1",
60
- "eslint-plugin-react-hooks": "5.2.0",
61
- "eslint-plugin-security": "3.0.1",
62
- "prettier": "3.5.3",
63
- "react": "19.1.0",
64
- "react-dom": "19.1.0",
65
- "react-icons": "5.5.0",
66
- "typescript": "5.8.3",
67
- "typescript-eslint": "8.32.0"
68
- },
69
- "module": "./dist/index.js",
70
- "exports": {
71
- ".": {
72
- "import": "./dist/index.js",
73
- "types": "./dist/index.d.ts"
74
- }
75
- },
76
- "type": "module",
77
- "files": [
78
- "dist",
79
- "README.md"
80
- ],
81
- "typesVersions": {
82
- "*": {
83
- "*": [
84
- "dist/index.d.ts"
85
- ]
86
- }
87
- }
2
+ "version": "0.24.0",
3
+ "name": "@absolutejs/auth",
4
+ "description": "An authorization library for absolutejs",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/absolutejs/absolute-auth.git"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "license": "CC BY-NC 4.0",
11
+ "author": "Alex Kahn",
12
+ "scripts": {
13
+ "build": "rm -rf dist && bun build src/index.ts src/ui/index.ts --outdir dist --sourcemap --target=bun --external elysia && tsc --emitDeclarationOnly --project tsconfig.json",
14
+ "test": "echo \"Error: no test specified\" && exit 1",
15
+ "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json}\"",
16
+ "lint": "eslint ./src ./eslint.config.mjs",
17
+ "typecheck": "bun run tsc --noEmit",
18
+ "release": "bun run format && bun run build && bun publish"
19
+ },
20
+ "keywords": [
21
+ "authorization",
22
+ "authentication",
23
+ "absolutejs",
24
+ "elysia",
25
+ "oauth"
26
+ ],
27
+ "types": "./dist/index.d.ts",
28
+ "peerDependencies": {
29
+ "elysia": ">= 1.4.26"
30
+ },
31
+ "dependencies": {
32
+ "@absolutejs/linked-providers": "0.0.2",
33
+ "citra": "0.25.11",
34
+ "@neondatabase/serverless": "1.0.0",
35
+ "drizzle-orm": "0.41.0"
36
+ },
37
+ "devDependencies": {
38
+ "@stylistic/eslint-plugin-ts": "4.2.0",
39
+ "@types/bun": "1.2.9",
40
+ "elysia": "1.4.26",
41
+ "eslint": "9.26.0",
42
+ "eslint-plugin-absolute": "0.0.3",
43
+ "eslint-plugin-import": "2.31.0",
44
+ "eslint-plugin-promise": "7.2.1",
45
+ "eslint-plugin-security": "3.0.1",
46
+ "prettier": "3.5.3",
47
+ "typescript": "5.8.3",
48
+ "typescript-eslint": "8.32.0"
49
+ },
50
+ "module": "./dist/index.js",
51
+ "exports": {
52
+ ".": {
53
+ "import": "./dist/index.js",
54
+ "types": "./dist/index.d.ts"
55
+ },
56
+ "./ui": {
57
+ "import": "./dist/ui/index.js",
58
+ "types": "./dist/ui/index.d.ts"
59
+ }
60
+ },
61
+ "type": "module",
62
+ "files": [
63
+ "dist",
64
+ "README.md"
65
+ ],
66
+ "typesVersions": {
67
+ "*": {
68
+ "*": [
69
+ "dist/index.d.ts"
70
+ ]
71
+ }
72
+ }
88
73
  }
@@ -1 +0,0 @@
1
- export declare const AuthContainer: () => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { ProviderOption } from 'citra';
2
- type OAuthButtonProps = {
3
- action?: 'login' | 'signup' | 'link';
4
- provider: Lowercase<ProviderOption> | undefined;
5
- };
6
- export declare const OAuthButton: ({ action, provider }: OAuthButtonProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,5 +0,0 @@
1
- type OAuthButtonsProps = {
2
- action?: 'login' | 'signup';
3
- };
4
- export declare const OAuthButtons: ({ action }: OAuthButtonsProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,10 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { NavbarElement } from '../../utils/types';
3
- type HamburgerDropdownProps = {
4
- label: string;
5
- href: string;
6
- links: NavbarElement[];
7
- icon?: ReactNode;
8
- };
9
- export declare const HamburgerDropdown: ({ label, icon, href, links }: HamburgerDropdownProps) => import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,5 +0,0 @@
1
- type HamburgerHeaderProps = {
2
- onClose: () => void;
3
- };
4
- export declare const HamburgerHeader: ({ onClose }: HamburgerHeaderProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,14 +0,0 @@
1
- import { SpringRef, SpringValue } from '@react-spring/web';
2
- import { User } from '../../db/schema';
3
- type HamburgerMenuProps = {
4
- spring: {
5
- transform: SpringValue<string>;
6
- };
7
- springApi: SpringRef<{
8
- transform: string;
9
- }>;
10
- user: User | undefined;
11
- handleSignOut: () => Promise<void>;
12
- };
13
- export declare const HamburgerMenu: ({ spring, springApi, user, handleSignOut }: HamburgerMenuProps) => import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,8 +0,0 @@
1
- import { User } from '../../db/schema';
2
- type HamburgerUserButtonsProps = {
3
- user: User | undefined;
4
- handleSignOut: () => Promise<void>;
5
- openModal: () => void;
6
- };
7
- export declare const HamburgerUserButtons: ({ user, handleSignOut, openModal }: HamburgerUserButtonsProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,17 +0,0 @@
1
- import { SpringRef, SpringValue } from '@react-spring/web';
2
- import { ReactNode, RefObject } from 'react';
3
- type DropdownContainerProps = {
4
- spring: {
5
- opacity: SpringValue<number>;
6
- scale: SpringValue<number>;
7
- };
8
- springApi: SpringRef<{
9
- opacity: number;
10
- scale: number;
11
- }>;
12
- onClose?: () => void;
13
- children?: ReactNode;
14
- ignoredElements?: RefObject<HTMLElement | null>[];
15
- };
16
- export declare const DropdownContainer: ({ springApi, onClose, children, ignoredElements }: DropdownContainerProps) => import("react/jsx-runtime").JSX.Element;
17
- export {};
@@ -1,7 +0,0 @@
1
- import { User } from '../../db/schema';
2
- type NavbarProps = {
3
- user: User | undefined;
4
- handleSignOut: () => Promise<void>;
5
- };
6
- export declare const Navbar: ({ user, handleSignOut }: NavbarProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,10 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { NavbarLink as NavbarLinkType } from '../../utils/types';
3
- type NavbarDropdownProps = {
4
- label: string;
5
- href: string;
6
- links: NavbarLinkType[];
7
- icon?: ReactNode;
8
- };
9
- export declare const NavbarDropdown: ({ label, href, links }: NavbarDropdownProps) => import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,8 +0,0 @@
1
- import { ReactNode } from 'react';
2
- type NavbarLinkProps = {
3
- icon?: ReactNode;
4
- href: string;
5
- label: string;
6
- };
7
- export declare const NavbarLink: ({ icon, href, label }: NavbarLinkProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,6 +0,0 @@
1
- import { NavbarElement } from '../../utils/types';
2
- type NavbarLinksProps = {
3
- navbarData: NavbarElement[];
4
- };
5
- export declare const NavbarLinks: ({ navbarData }: NavbarLinksProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,7 +0,0 @@
1
- import { User } from '../../db/schema';
2
- type NavbarUserButtonsProps = {
3
- user: User | undefined;
4
- handleSignOut: () => Promise<void>;
5
- };
6
- export declare const NavbarUserButtons: ({ user, handleSignOut }: NavbarUserButtonsProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,6 +0,0 @@
1
- type HeadProps = {
2
- title?: string;
3
- icon?: string;
4
- };
5
- export declare const Head: ({ title, icon }: HeadProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,6 +0,0 @@
1
- import { User } from '../../db/schema';
2
- type AccountOverviewProps = {
3
- user: User | undefined;
4
- };
5
- export declare const AccountOverview: ({ user }: AccountOverviewProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,5 +0,0 @@
1
- type DeleteAccountSectionProps = {
2
- onSignedOut: () => Promise<void>;
3
- };
4
- export declare const DeleteAccountSection: ({ onSignedOut }: DeleteAccountSectionProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1 +0,0 @@
1
- export declare const LinkedAuthIdentitiesPanel: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const LinkedProvidersPanel: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const ProviderButtons: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const SettingsNoticeToast: () => null;
@@ -1,7 +0,0 @@
1
- import { User } from '../../db/schema';
2
- type UserInfoProps = {
3
- user: User | undefined;
4
- heading?: string;
5
- };
6
- export declare const UserInfo: ({ user, heading }: UserInfoProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1 +0,0 @@
1
- export declare const AnimatedFaChevronDown: import("@react-spring/web").AnimatedComponent<import("react-icons/lib").IconType>;
@@ -1,7 +0,0 @@
1
- type DividerProps = {
2
- color?: string;
3
- height?: string;
4
- text?: string;
5
- };
6
- export declare const Divider: ({ color, text, height }: DividerProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,5 +0,0 @@
1
- type HighlightedJsonProps = {
2
- data: unknown;
3
- };
4
- export declare const HighlightedJson: ({ data }: HighlightedJsonProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,6 +0,0 @@
1
- type JsonLineProps = {
2
- line: string;
3
- needsNewline: boolean;
4
- };
5
- export declare const JsonLine: ({ line, needsNewline }: JsonLineProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,9 +0,0 @@
1
- import { ReactNode } from 'react';
2
- type ModalProps = {
3
- isOpen: boolean;
4
- onClose?: () => void;
5
- onOpen?: (dialogRef: HTMLDialogElement | null) => void;
6
- children: ReactNode;
7
- };
8
- export declare const Modal: ({ isOpen, onClose, onOpen, children }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
9
- export {};
@@ -1,8 +0,0 @@
1
- type ProfilePictureProps = {
2
- userImage: string | null | undefined;
3
- backupImage: string;
4
- width?: string;
5
- height?: string;
6
- };
7
- export declare const ProfilePicture: ({ userImage, backupImage, width, height }: ProfilePictureProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,8 +0,0 @@
1
- import { ProviderOption } from 'citra';
2
- import { Dispatch, SetStateAction } from 'react';
3
- type ProviderDropdownProps = {
4
- providers?: Lowercase<ProviderOption>[];
5
- setCurrentProvider: Dispatch<SetStateAction<Lowercase<ProviderOption> | undefined>>;
6
- };
7
- export declare const ProviderDropdown: ({ providers, setCurrentProvider }: ProviderDropdownProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,14 +0,0 @@
1
- type ToastProps = {
2
- message: string;
3
- action?: {
4
- label: string;
5
- onClick: () => void;
6
- };
7
- style?: {
8
- background?: string;
9
- color?: string;
10
- };
11
- removeToast: () => void;
12
- };
13
- export declare const Toast: ({ message, action, style, removeToast }: ToastProps) => import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,30 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Toast } from './Toast';
3
- type Toast = {
4
- id: number;
5
- message: string;
6
- action?: {
7
- label: string;
8
- onClick: () => void;
9
- };
10
- style?: {
11
- background?: string;
12
- color?: string;
13
- };
14
- };
15
- type AddToastProps = {
16
- message: string;
17
- action?: Toast['action'];
18
- style?: Toast['style'];
19
- duration?: number;
20
- };
21
- type ToastContextType = {
22
- addToast: (opts: AddToastProps) => void;
23
- registerHost: (host: HTMLElement | null) => void;
24
- };
25
- export declare const useToast: () => ToastContextType;
26
- type ToastProviderProps = {
27
- children: ReactNode;
28
- };
29
- export declare const ToastProvider: ({ children }: ToastProviderProps) => import("react/jsx-runtime").JSX.Element;
30
- export {};