@neondatabase/auth 0.1.0-beta.12 → 0.1.0-beta.14
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 +20 -1
- package/dist/{adapter-core-Bw9mn_AS.d.mts → adapter-core-9F3bfyWA.d.mts} +160 -206
- package/dist/{adapter-core-DODfSw9P.mjs → adapter-core-BPv4mLT0.mjs} +160 -36
- package/dist/better-auth-react-adapter-BYvAsZdj.d.mts +2168 -0
- package/dist/{better-auth-react-adapter-7JyvHiYG.mjs → better-auth-react-adapter-BkeuhSFt.mjs} +1 -6
- package/dist/{chunk-5DLVHPZS-Bxj7snpZ-DoVNlsyk.mjs → chunk-5DLVHPZS-Bxj7snpZ-EhdAQJMu.mjs} +2 -2
- package/dist/index.d.mts +9 -3
- package/dist/index.mjs +1 -1
- package/dist/{neon-auth-Bf2NFptR.mjs → neon-auth-BhLZg9v8.mjs} +4 -3
- package/dist/next/index.d.mts +47 -58
- package/dist/next/index.mjs +8 -8
- package/dist/react/adapters/index.d.mts +2 -2
- package/dist/react/adapters/index.mjs +1 -1
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.mjs +3 -3
- package/dist/react/ui/index.mjs +2 -2
- package/dist/react/ui/server.mjs +1 -1
- package/dist/supabase-adapter-_2wgvfZ3.d.mts +2254 -0
- package/dist/{supabase-adapter-DdhH8btX.mjs → supabase-adapter-rl2coLdb.mjs} +9 -41
- package/dist/ui/.safelist.html +1 -1
- package/dist/ui/css.css +1 -1
- package/dist/ui/tailwind.css +1 -0
- package/dist/ui/theme-inline.css +39 -0
- package/dist/{ui-aMoA-9nq.mjs → ui-C1IRQzLY.mjs} +49 -49
- package/dist/vanilla/adapters/index.d.mts +2 -2
- package/dist/vanilla/adapters/index.mjs +1 -1
- package/dist/vanilla/index.d.mts +2 -2
- package/dist/vanilla/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/better-auth-react-adapter-JoscqoDc.d.mts +0 -722
- package/dist/supabase-adapter-Clxlqg1x.d.mts +0 -127
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { n as NeonAuthAdapterCoreAuthOptions, t as NeonAuthAdapterCore } from "./adapter-core-Bw9mn_AS.mjs";
|
|
2
|
-
import { AuthClient, BetterAuthClientOptions } from "better-auth/client";
|
|
3
|
-
import * as _supabase_auth_js0 from "@supabase/auth-js";
|
|
4
|
-
import { AuthClient as AuthClient$1, JwtHeader, JwtPayload } from "@supabase/auth-js";
|
|
5
|
-
|
|
6
|
-
//#region src/adapters/better-auth-vanilla/better-auth-vanilla-adapter.d.ts
|
|
7
|
-
type BetterAuthVanillaAdapterOptions = Omit<NeonAuthAdapterCoreAuthOptions, 'baseURL'>;
|
|
8
|
-
/**
|
|
9
|
-
* Internal implementation class - use BetterAuthVanillaAdapter factory function instead
|
|
10
|
-
*/
|
|
11
|
-
declare class BetterAuthVanillaAdapterImpl extends NeonAuthAdapterCore {
|
|
12
|
-
private _betterAuth;
|
|
13
|
-
constructor(betterAuthClientOptions: NeonAuthAdapterCoreAuthOptions);
|
|
14
|
-
getBetterAuthInstance(): AuthClient<BetterAuthClientOptions>;
|
|
15
|
-
getJWTToken(): Promise<string | null>;
|
|
16
|
-
}
|
|
17
|
-
/** Instance type for BetterAuthVanillaAdapter */
|
|
18
|
-
type BetterAuthVanillaAdapterInstance = BetterAuthVanillaAdapterImpl;
|
|
19
|
-
/** Builder type that creates adapter instances */
|
|
20
|
-
type BetterAuthVanillaAdapterBuilder = (url: string) => BetterAuthVanillaAdapterInstance;
|
|
21
|
-
/**
|
|
22
|
-
* Factory function that returns an adapter builder.
|
|
23
|
-
* The builder is called by createClient/createAuthClient with the URL.
|
|
24
|
-
*
|
|
25
|
-
* @param options - Optional adapter configuration (baseURL is injected separately)
|
|
26
|
-
* @returns A builder function that creates the adapter instance
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```typescript
|
|
30
|
-
* const client = createClient({
|
|
31
|
-
* auth: {
|
|
32
|
-
* url: 'https://auth.example.com',
|
|
33
|
-
* adapter: BetterAuthVanillaAdapter(),
|
|
34
|
-
* },
|
|
35
|
-
* dataApi: { url: 'https://data-api.example.com' },
|
|
36
|
-
* });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
declare function BetterAuthVanillaAdapter(options?: BetterAuthVanillaAdapterOptions): BetterAuthVanillaAdapterBuilder;
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/adapters/supabase/auth-interface.d.ts
|
|
42
|
-
type _UpstreamAuthClientInstance = InstanceType<typeof AuthClient$1>;
|
|
43
|
-
type _AuthClientBase = { [K in keyof _UpstreamAuthClientInstance as _UpstreamAuthClientInstance[K] extends never ? never : K]: _UpstreamAuthClientInstance[K] };
|
|
44
|
-
type SupabaseAuthClientInterface = _AuthClientBase;
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/adapters/supabase/supabase-adapter.d.ts
|
|
47
|
-
type SupabaseAuthAdapterOptions = Omit<NeonAuthAdapterCoreAuthOptions, 'baseURL'>;
|
|
48
|
-
/**
|
|
49
|
-
* Internal implementation class - use SupabaseAuthAdapter factory function instead
|
|
50
|
-
*/
|
|
51
|
-
declare class SupabaseAuthAdapterImpl extends NeonAuthAdapterCore implements SupabaseAuthClientInterface {
|
|
52
|
-
admin: SupabaseAuthClientInterface['admin'];
|
|
53
|
-
mfa: SupabaseAuthClientInterface['mfa'];
|
|
54
|
-
oauth: SupabaseAuthClientInterface['oauth'];
|
|
55
|
-
private _betterAuth;
|
|
56
|
-
private _stateChangeEmitters;
|
|
57
|
-
constructor(betterAuthClientOptions: NeonAuthAdapterCoreAuthOptions);
|
|
58
|
-
getBetterAuthInstance(): AuthClient<BetterAuthClientOptions>;
|
|
59
|
-
getJWTToken(): Promise<string | null>;
|
|
60
|
-
initialize: SupabaseAuthClientInterface['initialize'];
|
|
61
|
-
getSession(options?: {
|
|
62
|
-
forceFetch?: boolean;
|
|
63
|
-
}): ReturnType<SupabaseAuthClientInterface['getSession']>;
|
|
64
|
-
refreshSession: SupabaseAuthClientInterface['refreshSession'];
|
|
65
|
-
setSession: SupabaseAuthClientInterface['setSession'];
|
|
66
|
-
signUp: SupabaseAuthClientInterface['signUp'];
|
|
67
|
-
signInAnonymously: SupabaseAuthClientInterface['signInAnonymously'];
|
|
68
|
-
signInWithPassword: SupabaseAuthClientInterface['signInWithPassword'];
|
|
69
|
-
signInWithOAuth: SupabaseAuthClientInterface['signInWithOAuth'];
|
|
70
|
-
signInWithOtp: SupabaseAuthClientInterface['signInWithOtp'];
|
|
71
|
-
signInWithIdToken: SupabaseAuthClientInterface['signInWithIdToken'];
|
|
72
|
-
signInWithSSO: SupabaseAuthClientInterface['signInWithSSO'];
|
|
73
|
-
signInWithWeb3: SupabaseAuthClientInterface['signInWithWeb3'];
|
|
74
|
-
signOut: SupabaseAuthClientInterface['signOut'];
|
|
75
|
-
getUser: SupabaseAuthClientInterface['getUser'];
|
|
76
|
-
getClaims: (jwtArg?: string) => Promise<{
|
|
77
|
-
data: {
|
|
78
|
-
header: JwtHeader;
|
|
79
|
-
claims: JwtPayload;
|
|
80
|
-
signature: Uint8Array<ArrayBufferLike>;
|
|
81
|
-
};
|
|
82
|
-
error: null;
|
|
83
|
-
} | {
|
|
84
|
-
data: null;
|
|
85
|
-
error: _supabase_auth_js0.AuthError;
|
|
86
|
-
}>;
|
|
87
|
-
updateUser: SupabaseAuthClientInterface['updateUser'];
|
|
88
|
-
getUserIdentities: SupabaseAuthClientInterface['getUserIdentities'];
|
|
89
|
-
linkIdentity: SupabaseAuthClientInterface['linkIdentity'];
|
|
90
|
-
unlinkIdentity: SupabaseAuthClientInterface['unlinkIdentity'];
|
|
91
|
-
verifyOtp: SupabaseAuthClientInterface['verifyOtp'];
|
|
92
|
-
resetPasswordForEmail: SupabaseAuthClientInterface['resetPasswordForEmail'];
|
|
93
|
-
reauthenticate: SupabaseAuthClientInterface['reauthenticate'];
|
|
94
|
-
resend: SupabaseAuthClientInterface['resend'];
|
|
95
|
-
exchangeCodeForSession: SupabaseAuthClientInterface['exchangeCodeForSession'];
|
|
96
|
-
onAuthStateChange: SupabaseAuthClientInterface['onAuthStateChange'];
|
|
97
|
-
isThrowOnErrorEnabled: SupabaseAuthClientInterface['isThrowOnErrorEnabled'];
|
|
98
|
-
startAutoRefresh: SupabaseAuthClientInterface['startAutoRefresh'];
|
|
99
|
-
stopAutoRefresh: SupabaseAuthClientInterface['stopAutoRefresh'];
|
|
100
|
-
private verifyEmailOtp;
|
|
101
|
-
private emitInitialSession;
|
|
102
|
-
}
|
|
103
|
-
/** Instance type for SupabaseAuthAdapter */
|
|
104
|
-
type SupabaseAuthAdapterInstance = SupabaseAuthAdapterImpl;
|
|
105
|
-
/** Builder type that creates adapter instances */
|
|
106
|
-
type SupabaseAuthAdapterBuilder = (url: string) => SupabaseAuthAdapterInstance;
|
|
107
|
-
/**
|
|
108
|
-
* Factory function that returns an adapter builder.
|
|
109
|
-
* The builder is called by createClient/createAuthClient with the URL.
|
|
110
|
-
*
|
|
111
|
-
* @param options - Optional adapter configuration (baseURL is injected separately)
|
|
112
|
-
* @returns A builder function that creates the adapter instance
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```typescript
|
|
116
|
-
* const client = createClient({
|
|
117
|
-
* auth: {
|
|
118
|
-
* url: 'https://auth.example.com',
|
|
119
|
-
* adapter: SupabaseAuthAdapter(),
|
|
120
|
-
* },
|
|
121
|
-
* dataApi: { url: 'https://data-api.example.com' },
|
|
122
|
-
* });
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
declare function SupabaseAuthAdapter(options?: SupabaseAuthAdapterOptions): SupabaseAuthAdapterBuilder;
|
|
126
|
-
//#endregion
|
|
127
|
-
export { BetterAuthVanillaAdapter as a, BetterAuthVanillaAdapterOptions as c, SupabaseAuthAdapterOptions as i, SupabaseAuthAdapterBuilder as n, BetterAuthVanillaAdapterBuilder as o, SupabaseAuthAdapterInstance as r, BetterAuthVanillaAdapterInstance as s, SupabaseAuthAdapter as t };
|