@hachej/boring-core 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 +21 -0
- package/README.md +83 -0
- package/dist/CoreFront-CDeLdfb0.d.ts +19 -0
- package/dist/app/front/index.d.ts +18 -0
- package/dist/app/front/index.js +162 -0
- package/dist/app/front/styles.css +6 -0
- package/dist/app/server/index.d.ts +96 -0
- package/dist/app/server/index.js +507 -0
- package/dist/app/vite/index.d.ts +10 -0
- package/dist/app/vite/index.js +33 -0
- package/dist/authHook-vsRhOvnh.d.ts +38 -0
- package/dist/chunk-CZ4HIXII.js +2869 -0
- package/dist/chunk-H5KU6R6Y.js +68 -0
- package/dist/chunk-HSRBZLKT.js +1684 -0
- package/dist/chunk-HYNKZSTF.js +18 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-VTOS4C7B.js +3443 -0
- package/dist/connection-CE7z-wBp.d.ts +145 -0
- package/dist/front/index.d.ts +458 -0
- package/dist/front/index.js +126 -0
- package/dist/front/theme.css +168 -0
- package/dist/front/top-bar-slot.d.ts +10 -0
- package/dist/front/top-bar-slot.js +9 -0
- package/dist/index-COZa03RP.d.ts +266 -0
- package/dist/migrate-D49JsATX.d.ts +8 -0
- package/dist/server/db/index.d.ts +209 -0
- package/dist/server/db/index.js +18 -0
- package/dist/server/index.d.ts +395 -0
- package/dist/server/index.js +136 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +13 -0
- package/drizzle/.gitkeep +0 -0
- package/drizzle/0000_easy_meggan.sql +53 -0
- package/drizzle/0001_groovy_smiling_tiger.sql +14 -0
- package/drizzle/0002_busy_iron_man.sql +16 -0
- package/drizzle/0003_aspiring_richard_fisk.sql +12 -0
- package/drizzle/0004_heavy_lenny_balinger.sql +9 -0
- package/drizzle/0005_flimsy_mastermind.sql +17 -0
- package/drizzle/0006_happy_callisto.sql +13 -0
- package/drizzle/0007_v7_substrate.sql +54 -0
- package/drizzle/0008_workspace_sandbox_handles.sql +32 -0
- package/drizzle/0009_workspace_runtime_resources.sql +39 -0
- package/drizzle/meta/0000_snapshot.json +380 -0
- package/drizzle/meta/0001_snapshot.json +471 -0
- package/drizzle/meta/0002_snapshot.json +599 -0
- package/drizzle/meta/0003_snapshot.json +693 -0
- package/drizzle/meta/0004_snapshot.json +753 -0
- package/drizzle/meta/0005_snapshot.json +886 -0
- package/drizzle/meta/0006_snapshot.json +968 -0
- package/drizzle/meta/_journal.json +76 -0
- package/drizzle/schema.ts +110 -0
- package/package.json +127 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { C as CoreConfig, W as Workspace, E as ERROR_CODES, M as MemberRole, a as WorkspaceMember, U as User, b as WorkspaceInvite, c as WorkspaceRuntime, d as WorkspaceRuntimeResourceSelector, e as WorkspaceRuntimeResource, f as WorkspaceRuntimeResourceInput, g as CapabilitiesResponse } from './index-COZa03RP.js';
|
|
2
|
+
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
3
|
+
import postgres from 'postgres';
|
|
4
|
+
|
|
5
|
+
interface WorkspaceProvisioner {
|
|
6
|
+
provision(ctx: ProvisionContext): Promise<ProvisionResult>;
|
|
7
|
+
destroy(workspaceId: string): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
interface ProvisionContext {
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
workspaceName: string;
|
|
12
|
+
ownerId: string;
|
|
13
|
+
appId: string;
|
|
14
|
+
}
|
|
15
|
+
interface ProvisionResult {
|
|
16
|
+
volumePath: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface UserStore {
|
|
20
|
+
getById(id: string): Promise<User | null>;
|
|
21
|
+
getByEmail(email: string): Promise<User | null>;
|
|
22
|
+
upsert(userId: string, data: {
|
|
23
|
+
email: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
}): Promise<User>;
|
|
26
|
+
getUserSettings(userId: string, appId: string): Promise<{
|
|
27
|
+
displayName: string;
|
|
28
|
+
email: string;
|
|
29
|
+
settings: Record<string, unknown>;
|
|
30
|
+
}>;
|
|
31
|
+
putUserSettings(userId: string, appId: string, updates: {
|
|
32
|
+
displayName?: string;
|
|
33
|
+
email?: string;
|
|
34
|
+
settings?: Record<string, unknown>;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
displayName: string;
|
|
37
|
+
email: string;
|
|
38
|
+
settings: Record<string, unknown>;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
interface WorkspaceStore {
|
|
42
|
+
create(userId: string, name: string, appId: string, opts?: {
|
|
43
|
+
isDefault?: boolean;
|
|
44
|
+
}): Promise<Workspace>;
|
|
45
|
+
list(userId: string, appId: string): Promise<Workspace[]>;
|
|
46
|
+
get(id: string): Promise<Workspace | null>;
|
|
47
|
+
update(id: string, updates: Partial<Pick<Workspace, 'name'>>): Promise<Workspace | null>;
|
|
48
|
+
delete(id: string): Promise<{
|
|
49
|
+
removed: boolean;
|
|
50
|
+
code?: typeof ERROR_CODES.NOT_FOUND;
|
|
51
|
+
}>;
|
|
52
|
+
getWorkspacesWhereSoleOwner(userId: string): Promise<Workspace[]>;
|
|
53
|
+
isMember(workspaceId: string, userId: string): Promise<boolean>;
|
|
54
|
+
getMemberRole(workspaceId: string, userId: string): Promise<MemberRole | null>;
|
|
55
|
+
listMembers(workspaceId: string): Promise<Array<WorkspaceMember & {
|
|
56
|
+
user: Pick<User, 'id' | 'email' | 'name' | 'image'>;
|
|
57
|
+
}>>;
|
|
58
|
+
upsertMember(workspaceId: string, userId: string, role: MemberRole): Promise<WorkspaceMember>;
|
|
59
|
+
updateMemberRole(workspaceId: string, userId: string, role: MemberRole): Promise<{
|
|
60
|
+
member?: WorkspaceMember;
|
|
61
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
62
|
+
}>;
|
|
63
|
+
removeMember(workspaceId: string, userId: string): Promise<{
|
|
64
|
+
removed: boolean;
|
|
65
|
+
code?: typeof ERROR_CODES.LAST_OWNER | typeof ERROR_CODES.NOT_MEMBER;
|
|
66
|
+
}>;
|
|
67
|
+
listInvites(workspaceId: string): Promise<WorkspaceInvite[]>;
|
|
68
|
+
createInvite(workspaceId: string, email: string, role: MemberRole, invitedBy: string | null, opts?: {
|
|
69
|
+
ttlDays?: number;
|
|
70
|
+
}): Promise<{
|
|
71
|
+
invite: WorkspaceInvite;
|
|
72
|
+
rawToken: string;
|
|
73
|
+
}>;
|
|
74
|
+
getInvite(workspaceId: string, inviteId: string): Promise<WorkspaceInvite | null>;
|
|
75
|
+
getInviteByTokenHash(tokenHash: string): Promise<WorkspaceInvite | null>;
|
|
76
|
+
revokeInvite(workspaceId: string, inviteId: string): Promise<boolean>;
|
|
77
|
+
acceptInvite(workspaceId: string, inviteId: string, userId: string): Promise<{
|
|
78
|
+
invite: WorkspaceInvite;
|
|
79
|
+
member: WorkspaceMember;
|
|
80
|
+
}>;
|
|
81
|
+
incrementInviteFailedAttempts(inviteId: string): Promise<{
|
|
82
|
+
failedAttempts: number;
|
|
83
|
+
lockedUntil: string | null;
|
|
84
|
+
}>;
|
|
85
|
+
resetInviteFailedAttempts(inviteId: string): Promise<void>;
|
|
86
|
+
getWorkspaceSettings(workspaceId: string): Promise<Array<{
|
|
87
|
+
key: string;
|
|
88
|
+
configured: boolean;
|
|
89
|
+
updated_at: string;
|
|
90
|
+
}>>;
|
|
91
|
+
putWorkspaceSettings(workspaceId: string, settings: Record<string, string>): Promise<Array<{
|
|
92
|
+
key: string;
|
|
93
|
+
configured: boolean;
|
|
94
|
+
updated_at: string;
|
|
95
|
+
}>>;
|
|
96
|
+
getWorkspaceRuntime(workspaceId: string): Promise<WorkspaceRuntime | null>;
|
|
97
|
+
putWorkspaceRuntime(workspaceId: string, state: Partial<WorkspaceRuntime>): Promise<WorkspaceRuntime>;
|
|
98
|
+
getWorkspaceRuntimeResource?(workspaceId: string, selector: WorkspaceRuntimeResourceSelector): Promise<WorkspaceRuntimeResource | null>;
|
|
99
|
+
putWorkspaceRuntimeResource?(workspaceId: string, resource: WorkspaceRuntimeResourceInput): Promise<WorkspaceRuntimeResource>;
|
|
100
|
+
deleteWorkspaceRuntimeResource?(workspaceId: string, selector: WorkspaceRuntimeResourceSelector): Promise<void>;
|
|
101
|
+
listWorkspaceRuntimeResources?(workspaceId?: string): Promise<WorkspaceRuntimeResource[]>;
|
|
102
|
+
retryWorkspaceRuntime(workspaceId: string): Promise<WorkspaceRuntime | null>;
|
|
103
|
+
getUiState(userId: string, workspaceId: string): Promise<Record<string, unknown> | null>;
|
|
104
|
+
putUiState(userId: string, workspaceId: string, state: Record<string, unknown>): Promise<void>;
|
|
105
|
+
}
|
|
106
|
+
interface AuthProvider {
|
|
107
|
+
verifySession(token: string): Promise<unknown>;
|
|
108
|
+
cookieName(): string;
|
|
109
|
+
}
|
|
110
|
+
type CapabilitiesContributor = (ctx: {
|
|
111
|
+
config: CoreConfig;
|
|
112
|
+
}) => Partial<CapabilitiesResponse> | Promise<Partial<CapabilitiesResponse>>;
|
|
113
|
+
interface CreateCoreAppOptions {
|
|
114
|
+
authProvider?: AuthProvider;
|
|
115
|
+
userStore?: UserStore;
|
|
116
|
+
workspaceStore?: WorkspaceStore;
|
|
117
|
+
provisioner?: WorkspaceProvisioner;
|
|
118
|
+
manageShutdown?: boolean;
|
|
119
|
+
}
|
|
120
|
+
declare module 'fastify' {
|
|
121
|
+
interface FastifyInstance {
|
|
122
|
+
config: CoreConfig;
|
|
123
|
+
workspaceStore: WorkspaceStore;
|
|
124
|
+
provisioner: WorkspaceProvisioner | null;
|
|
125
|
+
addRedactionPaths(paths: string[]): void;
|
|
126
|
+
registerCapabilitiesContributor(name: string, fn: CapabilitiesContributor): void;
|
|
127
|
+
capabilitiesCache: CapabilitiesResponse | null;
|
|
128
|
+
}
|
|
129
|
+
interface FastifyRequest {
|
|
130
|
+
user?: {
|
|
131
|
+
id: string;
|
|
132
|
+
email: string;
|
|
133
|
+
name: string | null;
|
|
134
|
+
} | null;
|
|
135
|
+
cspNonce?: string;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
type Database = ReturnType<typeof drizzle>;
|
|
140
|
+
declare function createDatabase(config: CoreConfig): {
|
|
141
|
+
db: Database;
|
|
142
|
+
sql: postgres.Sql;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export { type AuthProvider as A, type CreateCoreAppOptions as C, type Database as D, type ProvisionContext as P, type UserStore as U, type WorkspaceStore as W, type WorkspaceProvisioner as a, type CapabilitiesContributor as b, createDatabase as c, type ProvisionResult as d };
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { Component, ReactNode, ErrorInfo } from 'react';
|
|
4
|
+
import { R as RuntimeConfig, g as CapabilitiesResponse, a as WorkspaceMember, U as User, W as Workspace, M as MemberRole, S as SessionState } from '../index-COZa03RP.js';
|
|
5
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
|
+
import * as better_auth_react from 'better-auth/react';
|
|
7
|
+
import { createAuthClient } from 'better-auth/react';
|
|
8
|
+
import * as better_auth from 'better-auth';
|
|
9
|
+
export { a as CoreFront, C as CoreFrontAuthPagesOverride, b as CoreFrontProps } from '../CoreFront-CDeLdfb0.js';
|
|
10
|
+
import { NavigateFunction } from 'react-router-dom';
|
|
11
|
+
export { TopBarSlotProvider, useTopBarSlot } from './top-bar-slot.js';
|
|
12
|
+
|
|
13
|
+
interface AppErrorBoundaryProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
16
|
+
}
|
|
17
|
+
interface AppErrorBoundaryState {
|
|
18
|
+
error: Error | null;
|
|
19
|
+
}
|
|
20
|
+
declare class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppErrorBoundaryState> {
|
|
21
|
+
state: AppErrorBoundaryState;
|
|
22
|
+
static getDerivedStateFromError(error: Error): AppErrorBoundaryState;
|
|
23
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
24
|
+
private handleReload;
|
|
25
|
+
private handleRetry;
|
|
26
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface ConfigProviderProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
/** @internal Override retry backoff delays (ms). Default: [500, 1000, 2000]. */
|
|
32
|
+
retryBackoff?: number[];
|
|
33
|
+
}
|
|
34
|
+
declare function ConfigProvider({ children, retryBackoff, }: ConfigProviderProps): react_jsx_runtime.JSX.Element | null;
|
|
35
|
+
declare function useConfig(): RuntimeConfig;
|
|
36
|
+
declare function useConfigLoaded(): boolean;
|
|
37
|
+
|
|
38
|
+
type Theme = 'light' | 'dark';
|
|
39
|
+
type ThemePreference = 'light' | 'dark' | 'system';
|
|
40
|
+
interface ThemeApi {
|
|
41
|
+
theme: Theme;
|
|
42
|
+
preference: ThemePreference;
|
|
43
|
+
setTheme: (theme: ThemePreference) => void;
|
|
44
|
+
toggleTheme: () => void;
|
|
45
|
+
}
|
|
46
|
+
interface ThemeProviderProps {
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
defaultTheme?: ThemePreference;
|
|
49
|
+
}
|
|
50
|
+
declare function ThemeProvider({ children, defaultTheme }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare function useTheme(): ThemeApi;
|
|
52
|
+
|
|
53
|
+
interface Binding {
|
|
54
|
+
shortcut: string;
|
|
55
|
+
handler: (event: KeyboardEvent) => void;
|
|
56
|
+
}
|
|
57
|
+
declare function useKeyboardShortcuts(bindings: Binding[]): void;
|
|
58
|
+
|
|
59
|
+
type Breakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
60
|
+
declare function useViewportBreakpoint(): Breakpoint;
|
|
61
|
+
|
|
62
|
+
declare function useReducedMotion(): boolean;
|
|
63
|
+
|
|
64
|
+
declare function useBlobUrl(blob: Blob | null): string | null;
|
|
65
|
+
|
|
66
|
+
declare function useCapabilities(): CapabilitiesResponse;
|
|
67
|
+
|
|
68
|
+
type EnrichedMember = WorkspaceMember & {
|
|
69
|
+
user: Pick<User, 'id' | 'email' | 'name' | 'image'>;
|
|
70
|
+
};
|
|
71
|
+
declare function useWorkspaceMembers(workspaceId: string): _tanstack_react_query.UseQueryResult<EnrichedMember[], Error>;
|
|
72
|
+
|
|
73
|
+
interface WorkspaceAuthProviderProps {
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
}
|
|
76
|
+
declare function WorkspaceAuthProvider({ children }: WorkspaceAuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
77
|
+
declare function useCurrentWorkspace(): Workspace | null;
|
|
78
|
+
declare function useWorkspaceRole(): MemberRole | null;
|
|
79
|
+
|
|
80
|
+
interface AuthProviderProps {
|
|
81
|
+
children: ReactNode;
|
|
82
|
+
baseURL?: string;
|
|
83
|
+
queryClient?: {
|
|
84
|
+
clear(): void;
|
|
85
|
+
};
|
|
86
|
+
navigate?: (path: string) => void;
|
|
87
|
+
}
|
|
88
|
+
declare function AuthProvider({ children, baseURL, queryClient, navigate, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare function useSession(): SessionState;
|
|
90
|
+
declare function useSignIn(): {
|
|
91
|
+
magicLink: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
92
|
+
email: string;
|
|
93
|
+
name?: string | undefined;
|
|
94
|
+
callbackURL?: string | undefined;
|
|
95
|
+
newUserCallbackURL?: string | undefined;
|
|
96
|
+
errorCallbackURL?: string | undefined;
|
|
97
|
+
metadata?: Record<string, any> | undefined;
|
|
98
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
99
|
+
email: string;
|
|
100
|
+
name?: string | undefined;
|
|
101
|
+
callbackURL?: string | undefined;
|
|
102
|
+
newUserCallbackURL?: string | undefined;
|
|
103
|
+
errorCallbackURL?: string | undefined;
|
|
104
|
+
metadata?: Record<string, any> | undefined;
|
|
105
|
+
} & {
|
|
106
|
+
fetchOptions?: FetchOptions | undefined;
|
|
107
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
|
|
108
|
+
status: boolean;
|
|
109
|
+
}, {
|
|
110
|
+
code?: string | undefined;
|
|
111
|
+
message?: string | undefined;
|
|
112
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
113
|
+
} & {
|
|
114
|
+
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
115
|
+
provider: "line" | (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
116
|
+
callbackURL?: string | undefined;
|
|
117
|
+
newUserCallbackURL?: string | undefined;
|
|
118
|
+
errorCallbackURL?: string | undefined;
|
|
119
|
+
disableRedirect?: boolean | undefined;
|
|
120
|
+
idToken?: {
|
|
121
|
+
token: string;
|
|
122
|
+
nonce?: string | undefined;
|
|
123
|
+
accessToken?: string | undefined;
|
|
124
|
+
refreshToken?: string | undefined;
|
|
125
|
+
expiresAt?: number | undefined;
|
|
126
|
+
user?: {
|
|
127
|
+
name?: {
|
|
128
|
+
firstName?: string | undefined;
|
|
129
|
+
lastName?: string | undefined;
|
|
130
|
+
} | undefined;
|
|
131
|
+
email?: string | undefined;
|
|
132
|
+
} | undefined;
|
|
133
|
+
} | undefined;
|
|
134
|
+
scopes?: string[] | undefined;
|
|
135
|
+
requestSignUp?: boolean | undefined;
|
|
136
|
+
loginHint?: string | undefined;
|
|
137
|
+
additionalData?: Record<string, any> | undefined;
|
|
138
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
139
|
+
provider: "line" | (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
140
|
+
callbackURL?: string | undefined;
|
|
141
|
+
newUserCallbackURL?: string | undefined;
|
|
142
|
+
errorCallbackURL?: string | undefined;
|
|
143
|
+
disableRedirect?: boolean | undefined;
|
|
144
|
+
idToken?: {
|
|
145
|
+
token: string;
|
|
146
|
+
nonce?: string | undefined;
|
|
147
|
+
accessToken?: string | undefined;
|
|
148
|
+
refreshToken?: string | undefined;
|
|
149
|
+
expiresAt?: number | undefined;
|
|
150
|
+
user?: {
|
|
151
|
+
name?: {
|
|
152
|
+
firstName?: string | undefined;
|
|
153
|
+
lastName?: string | undefined;
|
|
154
|
+
} | undefined;
|
|
155
|
+
email?: string | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
scopes?: string[] | undefined;
|
|
159
|
+
requestSignUp?: boolean | undefined;
|
|
160
|
+
loginHint?: string | undefined;
|
|
161
|
+
additionalData?: Record<string, any> | undefined;
|
|
162
|
+
} & {
|
|
163
|
+
fetchOptions?: FetchOptions | undefined;
|
|
164
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
|
|
165
|
+
redirect: boolean;
|
|
166
|
+
url: string;
|
|
167
|
+
} | (Omit<{
|
|
168
|
+
redirect: boolean;
|
|
169
|
+
token: string;
|
|
170
|
+
url: undefined;
|
|
171
|
+
user: {
|
|
172
|
+
id: string;
|
|
173
|
+
createdAt: Date;
|
|
174
|
+
updatedAt: Date;
|
|
175
|
+
email: string;
|
|
176
|
+
emailVerified: boolean;
|
|
177
|
+
name: string;
|
|
178
|
+
image?: string | null | undefined | undefined;
|
|
179
|
+
};
|
|
180
|
+
}, "user"> & {
|
|
181
|
+
user: better_auth.StripEmptyObjects<{
|
|
182
|
+
id: string;
|
|
183
|
+
createdAt: Date;
|
|
184
|
+
updatedAt: Date;
|
|
185
|
+
email: string;
|
|
186
|
+
emailVerified: boolean;
|
|
187
|
+
name: string;
|
|
188
|
+
image?: string | null | undefined;
|
|
189
|
+
}>;
|
|
190
|
+
}), {
|
|
191
|
+
code?: string | undefined;
|
|
192
|
+
message?: string | undefined;
|
|
193
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
194
|
+
} & {
|
|
195
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
196
|
+
email: string;
|
|
197
|
+
password: string;
|
|
198
|
+
callbackURL?: string | undefined;
|
|
199
|
+
rememberMe?: boolean | undefined;
|
|
200
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
201
|
+
email: string;
|
|
202
|
+
password: string;
|
|
203
|
+
callbackURL?: string | undefined;
|
|
204
|
+
rememberMe?: boolean | undefined;
|
|
205
|
+
} & {
|
|
206
|
+
fetchOptions?: FetchOptions | undefined;
|
|
207
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<Omit<{
|
|
208
|
+
redirect: boolean;
|
|
209
|
+
token: string;
|
|
210
|
+
url?: string | undefined;
|
|
211
|
+
user: {
|
|
212
|
+
id: string;
|
|
213
|
+
createdAt: Date;
|
|
214
|
+
updatedAt: Date;
|
|
215
|
+
email: string;
|
|
216
|
+
emailVerified: boolean;
|
|
217
|
+
name: string;
|
|
218
|
+
image?: string | null | undefined | undefined;
|
|
219
|
+
};
|
|
220
|
+
}, "user"> & {
|
|
221
|
+
user: better_auth.StripEmptyObjects<{
|
|
222
|
+
id: string;
|
|
223
|
+
createdAt: Date;
|
|
224
|
+
updatedAt: Date;
|
|
225
|
+
email: string;
|
|
226
|
+
emailVerified: boolean;
|
|
227
|
+
name: string;
|
|
228
|
+
image?: string | null | undefined;
|
|
229
|
+
}>;
|
|
230
|
+
}, {
|
|
231
|
+
code?: string | undefined;
|
|
232
|
+
message?: string | undefined;
|
|
233
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
234
|
+
};
|
|
235
|
+
declare function useSignUp(): {
|
|
236
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
237
|
+
name: string;
|
|
238
|
+
email: string;
|
|
239
|
+
password: string;
|
|
240
|
+
image?: string | undefined;
|
|
241
|
+
callbackURL?: string | undefined;
|
|
242
|
+
rememberMe?: boolean | undefined;
|
|
243
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
244
|
+
email: string;
|
|
245
|
+
name: string;
|
|
246
|
+
password: string;
|
|
247
|
+
image?: string | undefined;
|
|
248
|
+
callbackURL?: string | undefined;
|
|
249
|
+
fetchOptions?: FetchOptions | undefined;
|
|
250
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<(Omit<{
|
|
251
|
+
token: null;
|
|
252
|
+
user: {
|
|
253
|
+
id: string;
|
|
254
|
+
createdAt: Date;
|
|
255
|
+
updatedAt: Date;
|
|
256
|
+
email: string;
|
|
257
|
+
emailVerified: boolean;
|
|
258
|
+
name: string;
|
|
259
|
+
image?: string | null | undefined | undefined;
|
|
260
|
+
};
|
|
261
|
+
}, "user"> & {
|
|
262
|
+
user: better_auth.StripEmptyObjects<{
|
|
263
|
+
id: string;
|
|
264
|
+
createdAt: Date;
|
|
265
|
+
updatedAt: Date;
|
|
266
|
+
email: string;
|
|
267
|
+
emailVerified: boolean;
|
|
268
|
+
name: string;
|
|
269
|
+
image?: string | null | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
}) | (Omit<{
|
|
272
|
+
token: string;
|
|
273
|
+
user: {
|
|
274
|
+
id: string;
|
|
275
|
+
createdAt: Date;
|
|
276
|
+
updatedAt: Date;
|
|
277
|
+
email: string;
|
|
278
|
+
emailVerified: boolean;
|
|
279
|
+
name: string;
|
|
280
|
+
image?: string | null | undefined | undefined;
|
|
281
|
+
};
|
|
282
|
+
}, "user"> & {
|
|
283
|
+
user: better_auth.StripEmptyObjects<{
|
|
284
|
+
id: string;
|
|
285
|
+
createdAt: Date;
|
|
286
|
+
updatedAt: Date;
|
|
287
|
+
email: string;
|
|
288
|
+
emailVerified: boolean;
|
|
289
|
+
name: string;
|
|
290
|
+
image?: string | null | undefined;
|
|
291
|
+
}>;
|
|
292
|
+
}), {
|
|
293
|
+
code?: string | undefined;
|
|
294
|
+
message?: string | undefined;
|
|
295
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
296
|
+
};
|
|
297
|
+
declare function useVerifyEmail(): (opts: {
|
|
298
|
+
query: {
|
|
299
|
+
token: string;
|
|
300
|
+
};
|
|
301
|
+
}) => Promise<{
|
|
302
|
+
data: unknown;
|
|
303
|
+
error: {
|
|
304
|
+
status: number;
|
|
305
|
+
message: string;
|
|
306
|
+
} | null;
|
|
307
|
+
}>;
|
|
308
|
+
declare function useSendVerificationEmail(): (opts: {
|
|
309
|
+
email: string;
|
|
310
|
+
callbackURL?: string;
|
|
311
|
+
}) => Promise<{
|
|
312
|
+
data: unknown;
|
|
313
|
+
error: unknown;
|
|
314
|
+
}>;
|
|
315
|
+
declare function useChangePassword(): (opts: {
|
|
316
|
+
currentPassword: string;
|
|
317
|
+
newPassword: string;
|
|
318
|
+
revokeOtherSessions?: boolean;
|
|
319
|
+
}) => Promise<{
|
|
320
|
+
data: unknown;
|
|
321
|
+
error: {
|
|
322
|
+
status: number;
|
|
323
|
+
message: string;
|
|
324
|
+
} | null;
|
|
325
|
+
}>;
|
|
326
|
+
declare function useSignOut(): () => Promise<void>;
|
|
327
|
+
|
|
328
|
+
interface UserSettings {
|
|
329
|
+
displayName: string;
|
|
330
|
+
email: string;
|
|
331
|
+
settings: Record<string, unknown>;
|
|
332
|
+
}
|
|
333
|
+
interface UserIdentity {
|
|
334
|
+
user: User;
|
|
335
|
+
settings: UserSettings;
|
|
336
|
+
}
|
|
337
|
+
interface UserIdentityProviderProps {
|
|
338
|
+
children: ReactNode;
|
|
339
|
+
}
|
|
340
|
+
declare function UserIdentityProvider({ children }: UserIdentityProviderProps): react_jsx_runtime.JSX.Element;
|
|
341
|
+
declare function useUser(): UserIdentity | null;
|
|
342
|
+
|
|
343
|
+
type InferAuthClient = ReturnType<typeof createAuthClient<{
|
|
344
|
+
baseURL: string;
|
|
345
|
+
basePath: string;
|
|
346
|
+
plugins: ReturnType<typeof magicLinkClient>[];
|
|
347
|
+
}>>;
|
|
348
|
+
interface AuthClient extends InferAuthClient {
|
|
349
|
+
}
|
|
350
|
+
declare function getAuthClient(baseURL?: string): AuthClient;
|
|
351
|
+
|
|
352
|
+
declare function SignInPage(): react_jsx_runtime.JSX.Element;
|
|
353
|
+
|
|
354
|
+
declare function SignUpPage(): react_jsx_runtime.JSX.Element;
|
|
355
|
+
|
|
356
|
+
declare function ForgotPasswordPage(): react_jsx_runtime.JSX.Element;
|
|
357
|
+
|
|
358
|
+
declare function ResetPasswordPage(): react_jsx_runtime.JSX.Element;
|
|
359
|
+
|
|
360
|
+
declare function VerifyEmailPage(): react_jsx_runtime.JSX.Element;
|
|
361
|
+
|
|
362
|
+
interface UserSettingsPageProps {
|
|
363
|
+
topBar?: ReactNode;
|
|
364
|
+
}
|
|
365
|
+
declare function UserSettingsPage({ topBar }?: UserSettingsPageProps): react_jsx_runtime.JSX.Element;
|
|
366
|
+
|
|
367
|
+
declare function InviteAcceptPage(): react_jsx_runtime.JSX.Element | null;
|
|
368
|
+
|
|
369
|
+
declare function setApiBase(base: string): void;
|
|
370
|
+
declare function getApiBase(): string;
|
|
371
|
+
declare function buildApiUrl(path: string): string;
|
|
372
|
+
declare function getWsBase(): string;
|
|
373
|
+
declare function buildWsUrl(path: string): string;
|
|
374
|
+
declare function openWebSocket(path: string, protocols?: string | string[]): WebSocket;
|
|
375
|
+
declare function apiFetch(url: string, init?: RequestInit): Promise<Response>;
|
|
376
|
+
declare function apiFetchJson<T>(url: string, init?: RequestInit): Promise<T>;
|
|
377
|
+
declare function getHttpErrorDetail(err: unknown): {
|
|
378
|
+
code: string;
|
|
379
|
+
message: string;
|
|
380
|
+
status?: number;
|
|
381
|
+
};
|
|
382
|
+
type RouteMap = {
|
|
383
|
+
signin: '/auth/signin';
|
|
384
|
+
signup: '/auth/signup';
|
|
385
|
+
forgotPassword: '/auth/forgot-password';
|
|
386
|
+
resetPassword: '/auth/reset-password';
|
|
387
|
+
verifyEmail: '/auth/verify-email';
|
|
388
|
+
callbackGithub: '/auth/callback/github';
|
|
389
|
+
me: '/me';
|
|
390
|
+
workspaceMembers: '/w/:id/members';
|
|
391
|
+
workspaceInvites: '/w/:id/invites';
|
|
392
|
+
workspaceSettings: '/w/:id/settings';
|
|
393
|
+
inviteAccept: '/invites/:token';
|
|
394
|
+
};
|
|
395
|
+
declare const routes: RouteMap;
|
|
396
|
+
declare function routeHref(name: keyof RouteMap, params?: Record<string, string>): string;
|
|
397
|
+
|
|
398
|
+
interface AuthGateLocation {
|
|
399
|
+
pathname: string;
|
|
400
|
+
search?: string;
|
|
401
|
+
hash?: string;
|
|
402
|
+
}
|
|
403
|
+
interface AuthGateProps {
|
|
404
|
+
children: ReactNode;
|
|
405
|
+
publicPaths?: string[];
|
|
406
|
+
graceMs?: number;
|
|
407
|
+
location?: AuthGateLocation;
|
|
408
|
+
navigate?: (to: string, options?: {
|
|
409
|
+
replace?: boolean;
|
|
410
|
+
}) => void;
|
|
411
|
+
now?: () => number;
|
|
412
|
+
}
|
|
413
|
+
declare function AuthGate({ children, publicPaths, graceMs, location, navigate, now, }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
414
|
+
|
|
415
|
+
interface CoreCommand {
|
|
416
|
+
id: string;
|
|
417
|
+
title: string;
|
|
418
|
+
run: () => void;
|
|
419
|
+
keywords?: string[];
|
|
420
|
+
shortcut?: string;
|
|
421
|
+
when?: () => boolean;
|
|
422
|
+
pluginId?: string;
|
|
423
|
+
}
|
|
424
|
+
declare function useCoreCommands(): CoreCommand[];
|
|
425
|
+
|
|
426
|
+
declare function InvitesPage(): react_jsx_runtime.JSX.Element;
|
|
427
|
+
|
|
428
|
+
declare function MembersPage(): react_jsx_runtime.JSX.Element;
|
|
429
|
+
|
|
430
|
+
interface WorkspaceSettingsPageProps {
|
|
431
|
+
topBar?: ReactNode;
|
|
432
|
+
}
|
|
433
|
+
declare function WorkspaceSettingsPage({ topBar }?: WorkspaceSettingsPageProps): react_jsx_runtime.JSX.Element;
|
|
434
|
+
|
|
435
|
+
interface WorkspaceCommand {
|
|
436
|
+
id: string;
|
|
437
|
+
label: string;
|
|
438
|
+
keywords?: string[];
|
|
439
|
+
run: () => void;
|
|
440
|
+
}
|
|
441
|
+
declare function getWorkspaceCommands(workspaceId: string, navigate: NavigateFunction): WorkspaceCommand[];
|
|
442
|
+
|
|
443
|
+
declare function UserMenu(): react_jsx_runtime.JSX.Element;
|
|
444
|
+
|
|
445
|
+
interface WorkspaceSwitcherProps {
|
|
446
|
+
appTitle?: string;
|
|
447
|
+
workspacePathPrefix?: string;
|
|
448
|
+
}
|
|
449
|
+
declare function WorkspaceSwitcher({ appTitle, workspacePathPrefix, }: WorkspaceSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
450
|
+
|
|
451
|
+
declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
|
|
452
|
+
|
|
453
|
+
declare function sanitizeMarkdown(input: string): string;
|
|
454
|
+
declare function sanitizeToolOutput(input: string): string;
|
|
455
|
+
|
|
456
|
+
declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, ms: number): T;
|
|
457
|
+
|
|
458
|
+
export { AppErrorBoundary, type AuthClient, AuthGate, type AuthGateProps, AuthProvider, type AuthProviderProps, type Binding, type Breakpoint, ConfigProvider, type ConfigProviderProps, type CoreCommand, type EnrichedMember, ForgotPasswordPage, InviteAcceptPage, InvitesPage, MembersPage, ResetPasswordPage, type RouteMap, SignInPage, SignUpPage, type ThemeApi, ThemeProvider, type ThemeProviderProps, ThemeToggle, type UserIdentity, UserIdentityProvider, type UserIdentityProviderProps, UserMenu, UserSettingsPage, VerifyEmailPage, WorkspaceAuthProvider, type WorkspaceAuthProviderProps, type WorkspaceCommand, WorkspaceSettingsPage, WorkspaceSwitcher, apiFetch, apiFetchJson, buildApiUrl, buildWsUrl, debounce, getApiBase, getAuthClient, getHttpErrorDetail, getWorkspaceCommands, getWsBase, openWebSocket, routeHref, routes, sanitizeMarkdown, sanitizeToolOutput, setApiBase, useBlobUrl, useCapabilities, useChangePassword, useConfig, useConfigLoaded, useCoreCommands, useCurrentWorkspace, useKeyboardShortcuts, useReducedMotion, useSendVerificationEmail, useSession, useSignIn, useSignOut, useSignUp, useTheme, useUser, useVerifyEmail, useViewportBreakpoint, useWorkspaceMembers, useWorkspaceRole };
|