@vite-hub/auth 0.0.3 → 0.1.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/LICENSE +201 -0
- package/README.md +213 -41
- package/dist/agent.d.ts +25 -13
- package/dist/agent.js +19 -5
- package/dist/application-path-C290OAIs.js +18 -0
- package/dist/cli-mgXvsBtA.d.ts +85 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +68 -0
- package/dist/console-B7eERmGv.d.ts +180 -0
- package/dist/console-runtime-bZQtnX2Y.d.ts +39 -0
- package/dist/console-runtime.d.ts +3 -0
- package/dist/console-runtime.js +819 -0
- package/dist/console-types-CmmnKGMx.js +38 -0
- package/dist/console.d.ts +7 -0
- package/dist/console.js +15 -0
- package/dist/error-diagnostics-CL0yjHiM.js +79 -0
- package/dist/events-BkmK2dFY.d.ts +486 -0
- package/dist/events-P7mI4IQb.js +196 -0
- package/dist/events-config-CjcFOhTE.js +177 -0
- package/dist/host-declarations.d.ts +17 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +40 -28
- package/dist/inspect-DPtsW8dB.d.ts +36 -0
- package/dist/nuxt.d.ts +59 -0
- package/dist/nuxt.js +93 -0
- package/dist/presets-BGZi6Dfu.d.ts +25 -0
- package/dist/presets.d.ts +2 -0
- package/dist/presets.js +32 -0
- package/dist/runtime/console.d.ts +7 -0
- package/dist/runtime/console.js +42 -0
- package/dist/runtime/empty-definition.d.ts +1 -2
- package/dist/runtime/nuxt.d.ts +3 -0
- package/dist/runtime/nuxt.js +9 -0
- package/dist/runtime/vue-nuxt.d.ts +3 -0
- package/dist/runtime/vue-nuxt.js +8 -0
- package/dist/server-B7LU19dS.js +1730 -0
- package/dist/server-CTD_JAww.d.ts +77 -0
- package/dist/server.d.ts +3 -20
- package/dist/server.js +3 -2
- package/dist/set-cookie-2as_DbHe.js +75 -0
- package/dist/shared-DnpgYiLF.js +15 -0
- package/dist/vite-COWkwxsj.js +990 -0
- package/dist/vite.d.ts +34 -10
- package/dist/vite.js +2 -995
- package/dist/vue.d.ts +55 -0
- package/dist/vue.js +112 -0
- package/package.json +92 -17
- package/dist/server-Diw3mAbX.js +0 -322
- package/dist/shared-QSYBHaMG.js +0 -12
- package/dist/types-B0fg9XFd.d.ts +0 -106
package/dist/types-B0fg9XFd.d.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { Auth, BetterAuthOptions } from "better-auth";
|
|
2
|
-
|
|
3
|
-
//#region src/types.d.ts
|
|
4
|
-
declare global {
|
|
5
|
-
namespace ViteHub {
|
|
6
|
-
interface AuthRuntimeEnv extends Record<string, unknown> {}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
type AuthRuntimeOption = "baseURL" | "secret" | "secrets";
|
|
10
|
-
type AuthReservedOption = AuthRuntimeOption | "access" | "basePath" | "database" | "route" | "runtime" | "secondaryStorage";
|
|
11
|
-
type AuthBetterAuthOptions = Omit<BetterAuthOptions, AuthReservedOption>;
|
|
12
|
-
interface AuthRuntimeEnv extends ViteHub.AuthRuntimeEnv {}
|
|
13
|
-
interface AuthRuntimeContext<TEnv extends Record<string, unknown> = AuthRuntimeEnv> {
|
|
14
|
-
env: TEnv;
|
|
15
|
-
request?: Pick<Request, "headers" | "url">;
|
|
16
|
-
requestOrigin: string;
|
|
17
|
-
}
|
|
18
|
-
type AuthRuntimeOptions = Partial<Omit<BetterAuthOptions, "basePath">>;
|
|
19
|
-
type AuthRuntimeOptionsResolver = (context: AuthRuntimeContext) => AuthRuntimeOptions;
|
|
20
|
-
type AuthRuntimeConfiguration = AuthRuntimeOptions | AuthRuntimeOptionsResolver;
|
|
21
|
-
interface AuthSignInConfiguration {
|
|
22
|
-
callbackURL?: string;
|
|
23
|
-
errorCallbackURL?: string;
|
|
24
|
-
provider: string;
|
|
25
|
-
requestSignUp?: boolean;
|
|
26
|
-
scopes?: string[];
|
|
27
|
-
}
|
|
28
|
-
interface AuthAccessRouteConfiguration {
|
|
29
|
-
method?: string;
|
|
30
|
-
route: string;
|
|
31
|
-
}
|
|
32
|
-
type AuthAccessRoute = string | AuthAccessRouteConfiguration;
|
|
33
|
-
interface AuthAccessConfiguration {
|
|
34
|
-
routes?: AuthAccessRoute[];
|
|
35
|
-
signIn?: AuthSignInConfiguration;
|
|
36
|
-
}
|
|
37
|
-
interface AuthDatabaseReference {
|
|
38
|
-
dedicated?: boolean;
|
|
39
|
-
name: string;
|
|
40
|
-
}
|
|
41
|
-
type AuthDatabaseConfiguration = true | AuthDatabaseReference;
|
|
42
|
-
interface AuthSecondaryStorageReference {
|
|
43
|
-
store: string;
|
|
44
|
-
}
|
|
45
|
-
type AuthSecondaryStorageConfiguration = true | AuthSecondaryStorageReference;
|
|
46
|
-
interface AuthViteHubOptions {
|
|
47
|
-
access?: AuthAccessConfiguration;
|
|
48
|
-
basePath?: string;
|
|
49
|
-
database?: AuthDatabaseConfiguration;
|
|
50
|
-
route?: false;
|
|
51
|
-
runtime?: AuthRuntimeConfiguration;
|
|
52
|
-
secondaryStorage?: AuthSecondaryStorageConfiguration;
|
|
53
|
-
}
|
|
54
|
-
type AuthRuntimeOnlyOptions = { [Key in AuthRuntimeOption]?: never };
|
|
55
|
-
type AuthDefinitionOptions<TOptions extends AuthBetterAuthOptions = AuthBetterAuthOptions> = TOptions & AuthViteHubOptions & AuthRuntimeOnlyOptions;
|
|
56
|
-
type AuthResolvedDefinitionOptions<TOptions extends AuthBetterAuthOptions = AuthBetterAuthOptions> = TOptions & Omit<AuthViteHubOptions, "database" | "runtime" | "secondaryStorage"> & Omit<AuthRuntimeOptions, "database" | "secondaryStorage"> & {
|
|
57
|
-
database?: AuthDatabaseConfiguration | BetterAuthOptions["database"];
|
|
58
|
-
secondaryStorage?: AuthSecondaryStorageConfiguration | BetterAuthOptions["secondaryStorage"];
|
|
59
|
-
};
|
|
60
|
-
type AuthDefinitionResolver<TOptions extends AuthResolvedDefinitionOptions = AuthResolvedDefinitionOptions> = (context: AuthRuntimeContext) => TOptions;
|
|
61
|
-
type AuthDefinitionInput = AuthDefinitionOptions | AuthDefinitionResolver;
|
|
62
|
-
interface AuthDefinition<TOptions extends AuthDefinitionInput = AuthDefinitionInput> {
|
|
63
|
-
options: TOptions;
|
|
64
|
-
}
|
|
65
|
-
interface DiscoveredAuthDefinition {
|
|
66
|
-
handler: string;
|
|
67
|
-
name: "default";
|
|
68
|
-
source: "server-auth" | "server-auth-suffix";
|
|
69
|
-
}
|
|
70
|
-
type ResolvedAuthDatabaseConfiguration = {
|
|
71
|
-
mode: "default";
|
|
72
|
-
} | {
|
|
73
|
-
dedicated: boolean;
|
|
74
|
-
mode: "named";
|
|
75
|
-
name: string;
|
|
76
|
-
};
|
|
77
|
-
type ResolvedAuthSecondaryStorageConfiguration = {
|
|
78
|
-
mode: "default";
|
|
79
|
-
} | {
|
|
80
|
-
mode: "named";
|
|
81
|
-
store: string;
|
|
82
|
-
};
|
|
83
|
-
interface ResolvedAuthAccessRoute {
|
|
84
|
-
method?: string;
|
|
85
|
-
route: string;
|
|
86
|
-
}
|
|
87
|
-
interface ResolvedAuthViteConfig {
|
|
88
|
-
access: {
|
|
89
|
-
routes: ResolvedAuthAccessRoute[];
|
|
90
|
-
};
|
|
91
|
-
basePath: string;
|
|
92
|
-
database: ResolvedAuthDatabaseConfiguration;
|
|
93
|
-
definition: DiscoveredAuthDefinition;
|
|
94
|
-
rootDir: string;
|
|
95
|
-
route: false | string;
|
|
96
|
-
secondaryStorage: false | ResolvedAuthSecondaryStorageConfiguration;
|
|
97
|
-
}
|
|
98
|
-
type AuthBetterAuthRuntimeOptions<TOptions extends AuthDefinitionInput = AuthDefinitionInput> = (TOptions extends AuthDefinitionResolver<infer TResolved> ? Omit<TResolved, AuthRuntimeOption | "access" | "database" | "route" | "runtime" | "secondaryStorage"> : Omit<TOptions, AuthRuntimeOption | "access" | "database" | "route" | "runtime" | "secondaryStorage">) & AuthRuntimeOptions & BetterAuthOptions;
|
|
99
|
-
type AuthRequest = Pick<Request, "body" | "headers" | "method" | "signal" | "url">;
|
|
100
|
-
type AuthRequestInput = AuthRequest | {
|
|
101
|
-
req: AuthRequest;
|
|
102
|
-
};
|
|
103
|
-
type ViteHubAuth<Options extends BetterAuthOptions = BetterAuthOptions> = Auth<Options>;
|
|
104
|
-
type AuthModuleOptions = false | Record<string, never>;
|
|
105
|
-
//#endregion
|
|
106
|
-
export { ResolvedAuthSecondaryStorageConfiguration as A, AuthRuntimeOptionsResolver as C, AuthViteHubOptions as D, AuthSignInConfiguration as E, ViteHubAuth as M, DiscoveredAuthDefinition as O, AuthRuntimeOptions as S, AuthSecondaryStorageReference as T, AuthRuntimeConfiguration as _, AuthBetterAuthRuntimeOptions as a, AuthRuntimeOnlyOptions as b, AuthDefinition as c, AuthDefinitionResolver as d, AuthModuleOptions as f, AuthResolvedDefinitionOptions as g, AuthReservedOption as h, AuthBetterAuthOptions as i, ResolvedAuthViteConfig as j, ResolvedAuthDatabaseConfiguration as k, AuthDefinitionInput as l, AuthRequestInput as m, AuthAccessRoute as n, AuthDatabaseConfiguration as o, AuthRequest as p, AuthAccessRouteConfiguration as r, AuthDatabaseReference as s, AuthAccessConfiguration as t, AuthDefinitionOptions as u, AuthRuntimeContext as v, AuthSecondaryStorageConfiguration as w, AuthRuntimeOption as x, AuthRuntimeEnv as y };
|