@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.
- package/README.md +6 -13
- package/dist/htmxRoutes.d.ts +514 -0
- package/dist/index.d.ts +752 -1
- package/dist/index.js +207 -40
- package/dist/index.js.map +8 -6
- package/dist/{src/types.d.ts → types.d.ts} +6 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2212 -0
- package/dist/ui/index.js.map +11 -0
- package/dist/ui/renderers.d.ts +8 -0
- package/dist/ui/types.d.ts +129 -0
- package/package.json +71 -86
- package/dist/example/components/auth/AuthContainer.d.ts +0 -1
- package/dist/example/components/auth/OAuthButton.d.ts +0 -7
- package/dist/example/components/auth/OAuthButtons.d.ts +0 -5
- package/dist/example/components/hamburger/HamburgerDropdown.d.ts +0 -10
- package/dist/example/components/hamburger/HamburgerHeader.d.ts +0 -5
- package/dist/example/components/hamburger/HamburgerMenu.d.ts +0 -14
- package/dist/example/components/hamburger/HamburgerUserButtons.d.ts +0 -8
- package/dist/example/components/navbar/DropdownContainer.d.ts +0 -17
- package/dist/example/components/navbar/Navbar.d.ts +0 -7
- package/dist/example/components/navbar/NavbarDropdown.d.ts +0 -10
- package/dist/example/components/navbar/NavbarLink.d.ts +0 -8
- package/dist/example/components/navbar/NavbarLinks.d.ts +0 -6
- package/dist/example/components/navbar/NavbarUserButtons.d.ts +0 -7
- package/dist/example/components/page/Head.d.ts +0 -6
- package/dist/example/components/protected/AccountOverview.d.ts +0 -6
- package/dist/example/components/protected/DeleteAccountSection.d.ts +0 -5
- package/dist/example/components/protected/LinkedAuthIdentitiesPanel.d.ts +0 -1
- package/dist/example/components/protected/LinkedProvidersPanel.d.ts +0 -1
- package/dist/example/components/protected/ProviderButtons.d.ts +0 -1
- package/dist/example/components/protected/SettingsNoticeToast.d.ts +0 -1
- package/dist/example/components/protected/UserInfo.d.ts +0 -7
- package/dist/example/components/utils/AnimatedComponents.d.ts +0 -1
- package/dist/example/components/utils/Divider.d.ts +0 -7
- package/dist/example/components/utils/HighlightedJson.d.ts +0 -5
- package/dist/example/components/utils/JsonLine.d.ts +0 -6
- package/dist/example/components/utils/Modal.d.ts +0 -9
- package/dist/example/components/utils/ProfilePicture.d.ts +0 -8
- package/dist/example/components/utils/ProviderDropdown.d.ts +0 -8
- package/dist/example/components/utils/Toast.d.ts +0 -14
- package/dist/example/components/utils/ToastProvider.d.ts +0 -30
- package/dist/example/db/schema.d.ts +0 -2570
- package/dist/example/eden/treaty.d.ts +0 -1
- package/dist/example/handlers/userHandlers.d.ts +0 -254
- package/dist/example/hooks/useAuthIdentityPayload.d.ts +0 -37
- package/dist/example/hooks/useAuthStatus.d.ts +0 -19
- package/dist/example/hooks/useContainerQuery.d.ts +0 -10
- package/dist/example/hooks/useMediaQuery.d.ts +0 -11
- package/dist/example/linkedProviders/persistCallbackAuthorization.d.ts +0 -30
- package/dist/example/linkedProviders/resolver.d.ts +0 -1
- package/dist/example/linkedProviders/stores.d.ts +0 -9
- package/dist/example/pages/Connectors.d.ts +0 -1
- package/dist/example/pages/Home.d.ts +0 -1
- package/dist/example/pages/NotAuthorized.d.ts +0 -1
- package/dist/example/pages/Protected.d.ts +0 -1
- package/dist/example/pages/Settings.d.ts +0 -1
- package/dist/example/server.d.ts +0 -902
- package/dist/example/styles/authModalStyles.d.ts +0 -22
- package/dist/example/styles/navbarStyles.d.ts +0 -15
- package/dist/example/styles/styles.d.ts +0 -15
- package/dist/example/utils/absoluteAuthConfig.d.ts +0 -4
- package/dist/example/utils/constants.d.ts +0 -1
- package/dist/example/utils/navbarData.d.ts +0 -2
- package/dist/example/utils/providerData.d.ts +0 -9
- package/dist/example/utils/providersConfiguration.d.ts +0 -1
- package/dist/example/utils/typeGuards.d.ts +0 -1
- package/dist/example/utils/types.d.ts +0 -26
- package/dist/src/index.d.ts +0 -300
- /package/dist/{src/authSessionStores.d.ts → authSessionStores.d.ts} +0 -0
- /package/dist/{src/authorize.d.ts → authorize.d.ts} +0 -0
- /package/dist/{src/callback.d.ts → callback.d.ts} +0 -0
- /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{src/errors.d.ts → errors.d.ts} +0 -0
- /package/dist/{src/linkedProviderResolver.d.ts → linkedProviderResolver.d.ts} +0 -0
- /package/dist/{src/linkedProviderStores.d.ts → linkedProviderStores.d.ts} +0 -0
- /package/dist/{src/neonAuthSessionStore.d.ts → neonAuthSessionStore.d.ts} +0 -0
- /package/dist/{src/neonLinkedProviders.d.ts → neonLinkedProviders.d.ts} +0 -0
- /package/dist/{src/oauthLinkedProviderResolver.d.ts → oauthLinkedProviderResolver.d.ts} +0 -0
- /package/dist/{src/profile.d.ts → profile.d.ts} +0 -0
- /package/dist/{src/protectRoute.d.ts → protectRoute.d.ts} +0 -0
- /package/dist/{src/providerClients.d.ts → providerClients.d.ts} +0 -0
- /package/dist/{src/refresh.d.ts → refresh.d.ts} +0 -0
- /package/dist/{src/revoke.d.ts → revoke.d.ts} +0 -0
- /package/dist/{src/sessionAccess.d.ts → sessionAccess.d.ts} +0 -0
- /package/dist/{src/sessionCleanup.d.ts → sessionCleanup.d.ts} +0 -0
- /package/dist/{src/sessionStore.d.ts → sessionStore.d.ts} +0 -0
- /package/dist/{src/sessionTypes.d.ts → sessionTypes.d.ts} +0 -0
- /package/dist/{src/signout.d.ts → signout.d.ts} +0 -0
- /package/dist/{src/typeGuards.d.ts → typeGuards.d.ts} +0 -0
- /package/dist/{src/typebox.d.ts → typebox.d.ts} +0 -0
- /package/dist/{src/userStatus.d.ts → userStatus.d.ts} +0 -0
- /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,88 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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,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,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,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,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 +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 +0,0 @@
|
|
|
1
|
-
export declare const AnimatedFaChevronDown: import("@react-spring/web").AnimatedComponent<import("react-icons/lib").IconType>;
|
|
@@ -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 {};
|