@vite-hub/auth 0.0.4 → 0.3.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 +443 -32
- package/dist/abilities-DfAnFYwG.d.ts +93 -0
- package/dist/abilities.d.ts +2 -0
- package/dist/abilities.js +43 -0
- package/dist/ability-error-CqgBrBfR.js +91 -0
- package/dist/ability-error-DcgChwCN.d.ts +34 -0
- package/dist/admin-claim-code-CDipqeAU.js +22 -0
- package/dist/agent.d.ts +23 -12
- package/dist/agent.js +30 -8
- package/dist/application-path-DuTpfGFj.js +62 -0
- package/dist/auth-instance-CR6b1W80.js +1168 -0
- package/dist/bun-sqlite.d.ts +8 -0
- package/dist/cli-ubYJpAL_.d.ts +163 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +108 -0
- package/dist/console-runtime-DTopBP-x.d.ts +71 -0
- package/dist/console-runtime-J9_Vx9pT.js +1166 -0
- package/dist/console-runtime.d.ts +3 -0
- package/dist/console-runtime.js +2 -0
- package/dist/console-types-CmmnKGMx.js +38 -0
- package/dist/console.d.ts +219 -0
- package/dist/console.js +15 -0
- package/dist/database-options-BRNef9oy.js +29 -0
- package/dist/database-schema-options-ENuRMduM.js +12 -0
- package/dist/database.d.ts +12 -0
- package/dist/database.js +45 -0
- package/dist/definition-CqQMcDEK.js +280 -0
- package/dist/error-diagnostics-C8XtVz0i.js +138 -0
- package/dist/events-ByzenEVj.js +314 -0
- package/dist/forward.d.ts +50 -0
- package/dist/forward.js +120 -0
- package/dist/host-declarations.d.ts +6 -1
- package/dist/index.d.ts +26 -5
- package/dist/index.js +3 -95
- package/dist/internal/server.d.ts +5 -0
- package/dist/internal/server.js +858 -0
- package/dist/invariant-D8_xBqmZ.js +22 -0
- package/dist/mcp.d.ts +187 -0
- package/dist/mcp.js +353 -0
- package/dist/members-D9lfaEO_.js +533 -0
- package/dist/nuxt-bridge-Cl988STZ.js +44 -0
- package/dist/nuxt.d.ts +36 -7
- package/dist/nuxt.js +116 -7
- package/dist/object-Da1zyPCR.js +11 -0
- package/dist/page-tools-shared-l4eyj53D.js +19 -0
- package/dist/presets-BGZi6Dfu.d.ts +25 -0
- package/dist/presets.d.ts +2 -0
- package/dist/presets.js +32 -0
- package/dist/request-z6DHHmrb.js +47 -0
- package/dist/runtime/console.d.ts +3 -0
- package/dist/runtime/console.js +4 -0
- package/dist/runtime/empty-abilities.d.ts +5 -0
- package/dist/runtime/empty-abilities.js +4 -0
- package/dist/runtime/empty-client.d.ts +6 -0
- package/dist/runtime/empty-client.js +5 -0
- package/dist/runtime/empty-definition.d.ts +1 -2
- package/dist/runtime/nuxt.d.ts +2 -3
- package/dist/runtime/nuxt.js +3 -2
- package/dist/runtime/server.d.ts +2 -0
- package/dist/runtime/server.js +77 -0
- package/dist/runtime/vue-nuxt.d.ts +4 -0
- package/dist/runtime/vue-nuxt.js +160 -0
- package/dist/runtime-state-ojQCzKOc.js +25 -0
- package/dist/schema.d.ts +137 -0
- package/dist/schema.js +147 -0
- package/dist/server-C0qnKN2W.d.ts +143 -0
- package/dist/server-bQGzVQ--.d.ts +41 -0
- package/dist/server.d.ts +3 -22
- package/dist/server.js +3 -2
- package/dist/session-cookies-BbH3UR2m.js +227 -0
- package/dist/set-cookie-C8NOhdRE.js +90 -0
- package/dist/shared-BwcdRGxD.js +12 -0
- package/dist/table-specs-8gq_FCaq.js +771 -0
- package/dist/table-specs-DbXyaXWs.d.ts +842 -0
- package/dist/test.d.ts +26 -0
- package/dist/test.js +25 -0
- package/dist/types-CNaeH2Fd.d.ts +569 -0
- package/dist/vite-CV400XXY.js +1556 -0
- package/dist/vite.d.ts +145 -18
- package/dist/vite.js +2 -2
- package/dist/vue.d.ts +343 -17
- package/dist/vue.js +640 -15
- package/package.json +156 -27
- package/dist/server-BZn8iQrB.js +0 -370
- package/dist/shared-QSYBHaMG.js +0 -12
- package/dist/types-jaRlW3D1.d.ts +0 -117
- package/dist/vite-Cmey8ODS.js +0 -1018
package/dist/types-jaRlW3D1.d.ts
DELETED
|
@@ -1,117 +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
|
-
authorize?: AuthAccessAuthorize;
|
|
30
|
-
method?: string;
|
|
31
|
-
route: string;
|
|
32
|
-
}
|
|
33
|
-
type AuthAccessRoute = string | AuthAccessRouteConfiguration;
|
|
34
|
-
interface AuthAccessAuthorizationContext {
|
|
35
|
-
request: AuthRequest;
|
|
36
|
-
session: Record<string, unknown>;
|
|
37
|
-
user: Record<string, unknown> & {
|
|
38
|
-
id: string;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
type AuthAccessAuthorizeResult = boolean | Response;
|
|
42
|
-
type AuthAccessAuthorize = (context: AuthAccessAuthorizationContext) => AuthAccessAuthorizeResult | Promise<AuthAccessAuthorizeResult>;
|
|
43
|
-
interface AuthAccessConfiguration {
|
|
44
|
-
routes?: AuthAccessRoute[];
|
|
45
|
-
signIn?: AuthSignInConfiguration;
|
|
46
|
-
}
|
|
47
|
-
interface AuthDatabaseReference {
|
|
48
|
-
dedicated?: boolean;
|
|
49
|
-
name: string;
|
|
50
|
-
}
|
|
51
|
-
type AuthDatabaseConfiguration = true | AuthDatabaseReference;
|
|
52
|
-
interface AuthSecondaryStorageReference {
|
|
53
|
-
store: string;
|
|
54
|
-
}
|
|
55
|
-
type AuthSecondaryStorageConfiguration = true | AuthSecondaryStorageReference;
|
|
56
|
-
interface AuthViteHubOptions {
|
|
57
|
-
access?: AuthAccessConfiguration;
|
|
58
|
-
basePath?: string;
|
|
59
|
-
database?: AuthDatabaseConfiguration;
|
|
60
|
-
route?: false;
|
|
61
|
-
runtime?: AuthRuntimeConfiguration;
|
|
62
|
-
secondaryStorage?: AuthSecondaryStorageConfiguration;
|
|
63
|
-
}
|
|
64
|
-
type AuthRuntimeOnlyOptions = { [Key in AuthRuntimeOption]?: never };
|
|
65
|
-
type AuthDefinitionOptions<TOptions extends AuthBetterAuthOptions = AuthBetterAuthOptions> = TOptions & AuthViteHubOptions & AuthRuntimeOnlyOptions;
|
|
66
|
-
type AuthResolvedDefinitionOptions<TOptions extends AuthBetterAuthOptions = AuthBetterAuthOptions> = TOptions & Omit<AuthViteHubOptions, "database" | "runtime" | "secondaryStorage"> & Omit<AuthRuntimeOptions, "database" | "secondaryStorage"> & {
|
|
67
|
-
database?: AuthDatabaseConfiguration | BetterAuthOptions["database"];
|
|
68
|
-
secondaryStorage?: AuthSecondaryStorageConfiguration | BetterAuthOptions["secondaryStorage"];
|
|
69
|
-
};
|
|
70
|
-
type AuthDefinitionResolver<TOptions extends AuthResolvedDefinitionOptions = AuthResolvedDefinitionOptions> = (context: AuthRuntimeContext) => TOptions;
|
|
71
|
-
type AuthDefinitionInput = AuthDefinitionOptions | AuthDefinitionResolver;
|
|
72
|
-
interface AuthDefinition<TOptions extends AuthDefinitionInput = AuthDefinitionInput> {
|
|
73
|
-
options: TOptions;
|
|
74
|
-
}
|
|
75
|
-
interface DiscoveredAuthDefinition {
|
|
76
|
-
handler: string;
|
|
77
|
-
name: "default";
|
|
78
|
-
source: "server-auth" | "server-auth-suffix";
|
|
79
|
-
}
|
|
80
|
-
type ResolvedAuthDatabaseConfiguration = {
|
|
81
|
-
mode: "default";
|
|
82
|
-
} | {
|
|
83
|
-
dedicated: boolean;
|
|
84
|
-
mode: "named";
|
|
85
|
-
name: string;
|
|
86
|
-
};
|
|
87
|
-
type ResolvedAuthSecondaryStorageConfiguration = {
|
|
88
|
-
mode: "default";
|
|
89
|
-
} | {
|
|
90
|
-
mode: "named";
|
|
91
|
-
store: string;
|
|
92
|
-
};
|
|
93
|
-
interface ResolvedAuthAccessRoute {
|
|
94
|
-
authorize?: true;
|
|
95
|
-
method?: string;
|
|
96
|
-
route: string;
|
|
97
|
-
}
|
|
98
|
-
interface ResolvedAuthViteConfig {
|
|
99
|
-
access: {
|
|
100
|
-
routes: ResolvedAuthAccessRoute[];
|
|
101
|
-
};
|
|
102
|
-
basePath: string;
|
|
103
|
-
database: ResolvedAuthDatabaseConfiguration;
|
|
104
|
-
definition: DiscoveredAuthDefinition;
|
|
105
|
-
rootDir: string;
|
|
106
|
-
route: false | string;
|
|
107
|
-
secondaryStorage: false | ResolvedAuthSecondaryStorageConfiguration;
|
|
108
|
-
}
|
|
109
|
-
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;
|
|
110
|
-
type AuthRequest = Pick<Request, "body" | "headers" | "method" | "signal" | "url">;
|
|
111
|
-
type AuthRequestInput = AuthRequest | {
|
|
112
|
-
req: AuthRequest;
|
|
113
|
-
};
|
|
114
|
-
type ViteHubAuth<Options extends BetterAuthOptions = BetterAuthOptions> = Auth<Options>;
|
|
115
|
-
type AuthModuleOptions = false | Record<string, never>;
|
|
116
|
-
//#endregion
|
|
117
|
-
export { AuthViteHubOptions as A, AuthRuntimeOnlyOptions as C, AuthSecondaryStorageConfiguration as D, AuthRuntimeOptionsResolver as E, ViteHubAuth as F, ResolvedAuthDatabaseConfiguration as M, ResolvedAuthSecondaryStorageConfiguration as N, AuthSecondaryStorageReference as O, ResolvedAuthViteConfig as P, AuthRuntimeEnv as S, AuthRuntimeOptions as T, AuthRequestInput as _, AuthAccessRoute as a, AuthRuntimeConfiguration as b, AuthBetterAuthRuntimeOptions as c, AuthDefinition as d, AuthDefinitionInput as f, AuthRequest as g, AuthModuleOptions as h, AuthAccessConfiguration as i, DiscoveredAuthDefinition as j, AuthSignInConfiguration as k, AuthDatabaseConfiguration as l, AuthDefinitionResolver as m, AuthAccessAuthorize as n, AuthAccessRouteConfiguration as o, AuthDefinitionOptions as p, AuthAccessAuthorizeResult as r, AuthBetterAuthOptions as s, AuthAccessAuthorizationContext as t, AuthDatabaseReference as u, AuthReservedOption as v, AuthRuntimeOption as w, AuthRuntimeContext as x, AuthResolvedDefinitionOptions as y };
|