@fragno-dev/auth 0.0.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/LICENSE.md +16 -0
- package/README.md +16 -0
- package/dist/browser/client/react.d.ts +122 -0
- package/dist/browser/client/react.d.ts.map +1 -0
- package/dist/browser/client/react.js +11 -0
- package/dist/browser/client/react.js.map +1 -0
- package/dist/browser/client/solid.d.ts +122 -0
- package/dist/browser/client/solid.d.ts.map +1 -0
- package/dist/browser/client/solid.js +11 -0
- package/dist/browser/client/solid.js.map +1 -0
- package/dist/browser/client/svelte.d.ts +122 -0
- package/dist/browser/client/svelte.d.ts.map +1 -0
- package/dist/browser/client/svelte.js +11 -0
- package/dist/browser/client/svelte.js.map +1 -0
- package/dist/browser/client/vanilla.d.ts +122 -0
- package/dist/browser/client/vanilla.d.ts.map +1 -0
- package/dist/browser/client/vanilla.js +11 -0
- package/dist/browser/client/vanilla.js.map +1 -0
- package/dist/browser/client/vue.d.ts +122 -0
- package/dist/browser/client/vue.d.ts.map +1 -0
- package/dist/browser/client/vue.js +11 -0
- package/dist/browser/client/vue.js.map +1 -0
- package/dist/browser/index.d.ts +600 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/src-DNrh9CQq.js +184 -0
- package/dist/browser/src-DNrh9CQq.js.map +1 -0
- package/dist/node/index.d.ts +600 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +677 -0
- package/dist/node/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +97 -0
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
import * as _fragno_dev_core0 from "@fragno-dev/core";
|
|
2
|
+
import * as _fragno_dev_core_client0 from "@fragno-dev/core/client";
|
|
3
|
+
import { FragnoPublicClientConfig } from "@fragno-dev/core/client";
|
|
4
|
+
import * as _fragno_dev_db_schema0 from "@fragno-dev/db/schema";
|
|
5
|
+
import * as zod44 from "zod";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { Cursor } from "@fragno-dev/db/cursor";
|
|
8
|
+
import * as _fragno_dev_core_api4 from "@fragno-dev/core/api";
|
|
9
|
+
import { FragnoRouteConfig } from "@fragno-dev/core/api";
|
|
10
|
+
import * as zod_v4_core12 from "zod/v4/core";
|
|
11
|
+
import * as _fragno_dev_db0 from "@fragno-dev/db";
|
|
12
|
+
import { FragnoPublicConfigWithDatabase } from "@fragno-dev/db";
|
|
13
|
+
import * as _fragno_dev_db_fragment_definition_builder0 from "@fragno-dev/db/fragment-definition-builder";
|
|
14
|
+
|
|
15
|
+
//#region src/user/user-overview.d.ts
|
|
16
|
+
type SortField = "email" | "createdAt";
|
|
17
|
+
type SortOrder = "asc" | "desc";
|
|
18
|
+
interface GetUsersParams {
|
|
19
|
+
search?: string;
|
|
20
|
+
sortBy: SortField;
|
|
21
|
+
sortOrder: SortOrder;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
cursor?: Cursor;
|
|
24
|
+
}
|
|
25
|
+
interface UserResult {
|
|
26
|
+
id: string;
|
|
27
|
+
email: string;
|
|
28
|
+
role: "user" | "admin";
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/utils/cookie.d.ts
|
|
33
|
+
interface CookieOptions {
|
|
34
|
+
httpOnly?: boolean;
|
|
35
|
+
secure?: boolean;
|
|
36
|
+
sameSite?: "Strict" | "Lax" | "None";
|
|
37
|
+
maxAge?: number;
|
|
38
|
+
path?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse cookies from a Cookie header string
|
|
42
|
+
*/
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/index.d.ts
|
|
45
|
+
interface AuthConfig {
|
|
46
|
+
sendEmail?: (params: {
|
|
47
|
+
to: string;
|
|
48
|
+
subject: string;
|
|
49
|
+
body: string;
|
|
50
|
+
}) => Promise<void>;
|
|
51
|
+
cookieOptions?: CookieOptions;
|
|
52
|
+
}
|
|
53
|
+
declare const authFragmentDefinition: _fragno_dev_core0.FragmentDefinition<AuthConfig, FragnoPublicConfigWithDatabase, _fragno_dev_db0.ImplicitDatabaseDependencies<_fragno_dev_db_schema0.Schema<{
|
|
54
|
+
user: _fragno_dev_db_schema0.Table<Record<string, _fragno_dev_db_schema0.AnyColumn> & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"email", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"passwordHash", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"role", _fragno_dev_db_schema0.Column<"string", string | null, string>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_createdAt", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["createdAt"]>>>;
|
|
55
|
+
session: _fragno_dev_db_schema0.Table<Record<string, _fragno_dev_db_schema0.AnyColumn> & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"userId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>> & Record<"expiresAt", _fragno_dev_db_schema0.Column<"timestamp", _fragno_dev_db0.DbNow | Date, Date>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation> & Record<"sessionOwner", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<string, _fragno_dev_db_schema0.AnyColumn> & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"email", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"passwordHash", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"role", _fragno_dev_db_schema0.Column<"string", string | null, string>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_email", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["email"]>> & Record<"idx_user_id", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["id"]>>>>>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_session_user", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["userId"]>>>;
|
|
56
|
+
}>>, {
|
|
57
|
+
getUsersWithCursor: (this: _fragno_dev_core0.RequestThisContext & {
|
|
58
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
59
|
+
}, params: GetUsersParams) => _fragno_dev_db0.TxResult<{
|
|
60
|
+
users: UserResult[];
|
|
61
|
+
cursor: _fragno_dev_db0.Cursor | undefined;
|
|
62
|
+
hasNextPage: boolean;
|
|
63
|
+
}, {
|
|
64
|
+
users: UserResult[];
|
|
65
|
+
cursor: _fragno_dev_db0.Cursor | undefined;
|
|
66
|
+
hasNextPage: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
buildSessionCookie: (sessionId: string) => string;
|
|
69
|
+
createSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
70
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
71
|
+
}, userId: string) => _fragno_dev_db0.TxResult<{
|
|
72
|
+
id: string;
|
|
73
|
+
userId: string;
|
|
74
|
+
expiresAt: Date;
|
|
75
|
+
}, {
|
|
76
|
+
id: string;
|
|
77
|
+
userId: string;
|
|
78
|
+
expiresAt: Date;
|
|
79
|
+
}>;
|
|
80
|
+
validateSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
81
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
82
|
+
}, sessionId: string) => _fragno_dev_db0.TxResult<{
|
|
83
|
+
id: string;
|
|
84
|
+
userId: string;
|
|
85
|
+
user: {
|
|
86
|
+
id: string;
|
|
87
|
+
email: string;
|
|
88
|
+
role: string;
|
|
89
|
+
};
|
|
90
|
+
} | null, [{
|
|
91
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
92
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
93
|
+
expiresAt: Date;
|
|
94
|
+
createdAt: Date;
|
|
95
|
+
sessionOwner: {
|
|
96
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
97
|
+
email: string;
|
|
98
|
+
passwordHash: string;
|
|
99
|
+
role: string;
|
|
100
|
+
createdAt: Date;
|
|
101
|
+
} | null;
|
|
102
|
+
} | null]>;
|
|
103
|
+
invalidateSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
104
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
105
|
+
}, sessionId: string) => _fragno_dev_db0.TxResult<boolean, [{
|
|
106
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
107
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
108
|
+
expiresAt: Date;
|
|
109
|
+
createdAt: Date;
|
|
110
|
+
} | null]>;
|
|
111
|
+
getSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
112
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
113
|
+
}, headers: Headers) => _fragno_dev_db0.TxResult<{
|
|
114
|
+
userId: string;
|
|
115
|
+
email: string;
|
|
116
|
+
} | undefined, [{
|
|
117
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
118
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
119
|
+
expiresAt: Date;
|
|
120
|
+
createdAt: Date;
|
|
121
|
+
sessionOwner: {
|
|
122
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
123
|
+
email: string;
|
|
124
|
+
passwordHash: string;
|
|
125
|
+
role: string;
|
|
126
|
+
createdAt: Date;
|
|
127
|
+
} | null;
|
|
128
|
+
} | null]>;
|
|
129
|
+
createUser: (this: _fragno_dev_core0.RequestThisContext & {
|
|
130
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
131
|
+
}, email: string, passwordHash: string, role?: "user" | "admin") => _fragno_dev_db0.TxResult<{
|
|
132
|
+
id: string;
|
|
133
|
+
email: string;
|
|
134
|
+
role: "user" | "admin";
|
|
135
|
+
}, {
|
|
136
|
+
id: string;
|
|
137
|
+
email: string;
|
|
138
|
+
role: "user" | "admin";
|
|
139
|
+
}>;
|
|
140
|
+
getUserByEmail: (this: _fragno_dev_core0.RequestThisContext & {
|
|
141
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
142
|
+
}, email: string) => _fragno_dev_db0.TxResult<{
|
|
143
|
+
id: string;
|
|
144
|
+
email: string;
|
|
145
|
+
passwordHash: string;
|
|
146
|
+
role: "user" | "admin";
|
|
147
|
+
} | null, {
|
|
148
|
+
id: string;
|
|
149
|
+
email: string;
|
|
150
|
+
passwordHash: string;
|
|
151
|
+
role: "user" | "admin";
|
|
152
|
+
} | null>;
|
|
153
|
+
updateUserRole: (this: _fragno_dev_core0.RequestThisContext & {
|
|
154
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
155
|
+
}, userId: string, role: "user" | "admin") => _fragno_dev_db0.TxResult<{
|
|
156
|
+
success: boolean;
|
|
157
|
+
}, {
|
|
158
|
+
success: boolean;
|
|
159
|
+
}>;
|
|
160
|
+
updateUserPassword: (this: _fragno_dev_core0.RequestThisContext & {
|
|
161
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
162
|
+
}, userId: string, passwordHash: string) => _fragno_dev_db0.TxResult<{
|
|
163
|
+
success: boolean;
|
|
164
|
+
}, {
|
|
165
|
+
success: boolean;
|
|
166
|
+
}>;
|
|
167
|
+
signUpWithSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
168
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
169
|
+
}, email: string, passwordHash: string) => _fragno_dev_db0.TxResult<{
|
|
170
|
+
ok: false;
|
|
171
|
+
code: "email_already_exists";
|
|
172
|
+
sessionId?: undefined;
|
|
173
|
+
userId?: undefined;
|
|
174
|
+
email?: undefined;
|
|
175
|
+
role?: undefined;
|
|
176
|
+
} | {
|
|
177
|
+
ok: true;
|
|
178
|
+
sessionId: string;
|
|
179
|
+
userId: string;
|
|
180
|
+
email: string;
|
|
181
|
+
role: "user";
|
|
182
|
+
code?: undefined;
|
|
183
|
+
}, [{
|
|
184
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
185
|
+
email: string;
|
|
186
|
+
passwordHash: string;
|
|
187
|
+
role: string;
|
|
188
|
+
createdAt: Date;
|
|
189
|
+
} | null]>;
|
|
190
|
+
updateUserRoleWithSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
191
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
192
|
+
}, sessionId: string, userId: string, role: "user" | "admin") => _fragno_dev_db0.TxResult<{
|
|
193
|
+
ok: false;
|
|
194
|
+
code: "session_invalid";
|
|
195
|
+
} | {
|
|
196
|
+
ok: false;
|
|
197
|
+
code: "permission_denied";
|
|
198
|
+
} | {
|
|
199
|
+
ok: true;
|
|
200
|
+
code?: undefined;
|
|
201
|
+
}, [{
|
|
202
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
203
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
204
|
+
expiresAt: Date;
|
|
205
|
+
createdAt: Date;
|
|
206
|
+
sessionOwner: {
|
|
207
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
208
|
+
email: string;
|
|
209
|
+
passwordHash: string;
|
|
210
|
+
role: string;
|
|
211
|
+
createdAt: Date;
|
|
212
|
+
} | null;
|
|
213
|
+
} | null]>;
|
|
214
|
+
changePasswordWithSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
215
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
216
|
+
}, sessionId: string, passwordHash: string) => _fragno_dev_db0.TxResult<{
|
|
217
|
+
ok: false;
|
|
218
|
+
code: "session_invalid";
|
|
219
|
+
} | {
|
|
220
|
+
ok: true;
|
|
221
|
+
code?: undefined;
|
|
222
|
+
}, [{
|
|
223
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
224
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
225
|
+
expiresAt: Date;
|
|
226
|
+
createdAt: Date;
|
|
227
|
+
sessionOwner: {
|
|
228
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
229
|
+
email: string;
|
|
230
|
+
passwordHash: string;
|
|
231
|
+
role: string;
|
|
232
|
+
createdAt: Date;
|
|
233
|
+
} | null;
|
|
234
|
+
} | null]>;
|
|
235
|
+
}, {}, {}, {}, _fragno_dev_db0.DatabaseServiceContext<_fragno_dev_db0.HooksMap>, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>, _fragno_dev_db_fragment_definition_builder0.DatabaseRequestStorage, {
|
|
236
|
+
_fragno_internal: _fragno_dev_db0.InternalFragmentInstance;
|
|
237
|
+
}>;
|
|
238
|
+
type AuthFragment = typeof authFragmentDefinition;
|
|
239
|
+
declare function createAuthFragment(config: AuthConfig | undefined, fragnoConfig: FragnoPublicConfigWithDatabase): _fragno_dev_core0.FragnoInstantiatedFragment<readonly [_fragno_dev_core0.FragnoRouteConfig<"PATCH", "/users/:userId/role", zod44.ZodObject<{
|
|
240
|
+
role: zod44.ZodEnum<{
|
|
241
|
+
user: "user";
|
|
242
|
+
admin: "admin";
|
|
243
|
+
}>;
|
|
244
|
+
}, zod_v4_core12.$strip>, zod44.ZodObject<{
|
|
245
|
+
success: zod44.ZodBoolean;
|
|
246
|
+
}, zod_v4_core12.$strip>, "invalid_input" | "session_invalid" | "permission_denied", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/sign-up", zod44.ZodObject<{
|
|
247
|
+
email: zod44.ZodEmail;
|
|
248
|
+
password: zod44.ZodString;
|
|
249
|
+
}, zod_v4_core12.$strip>, zod44.ZodObject<{
|
|
250
|
+
sessionId: zod44.ZodString;
|
|
251
|
+
userId: zod44.ZodString;
|
|
252
|
+
email: zod44.ZodString;
|
|
253
|
+
role: zod44.ZodEnum<{
|
|
254
|
+
user: "user";
|
|
255
|
+
admin: "admin";
|
|
256
|
+
}>;
|
|
257
|
+
}, zod_v4_core12.$strip>, "invalid_input" | "email_already_exists", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/sign-in", zod44.ZodObject<{
|
|
258
|
+
email: zod44.ZodEmail;
|
|
259
|
+
password: zod44.ZodString;
|
|
260
|
+
}, zod_v4_core12.$strip>, zod44.ZodObject<{
|
|
261
|
+
sessionId: zod44.ZodString;
|
|
262
|
+
userId: zod44.ZodString;
|
|
263
|
+
email: zod44.ZodString;
|
|
264
|
+
role: zod44.ZodEnum<{
|
|
265
|
+
user: "user";
|
|
266
|
+
admin: "admin";
|
|
267
|
+
}>;
|
|
268
|
+
}, zod_v4_core12.$strip>, "invalid_credentials", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/change-password", zod44.ZodObject<{
|
|
269
|
+
newPassword: zod44.ZodString;
|
|
270
|
+
}, zod_v4_core12.$strip>, zod44.ZodObject<{
|
|
271
|
+
success: zod44.ZodBoolean;
|
|
272
|
+
}, zod_v4_core12.$strip>, "session_invalid", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/sign-out", zod44.ZodOptional<zod44.ZodObject<{
|
|
273
|
+
sessionId: zod44.ZodOptional<zod44.ZodString>;
|
|
274
|
+
}, zod_v4_core12.$strip>>, zod44.ZodObject<{
|
|
275
|
+
success: zod44.ZodBoolean;
|
|
276
|
+
}, zod_v4_core12.$strip>, "session_not_found", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/me", undefined, zod44.ZodObject<{
|
|
277
|
+
userId: zod44.ZodString;
|
|
278
|
+
email: zod44.ZodString;
|
|
279
|
+
role: zod44.ZodEnum<{
|
|
280
|
+
user: "user";
|
|
281
|
+
admin: "admin";
|
|
282
|
+
}>;
|
|
283
|
+
}, zod_v4_core12.$strip>, "session_invalid", "sessionId", _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/users", undefined, zod44.ZodObject<{
|
|
284
|
+
users: zod44.ZodArray<zod44.ZodObject<{
|
|
285
|
+
id: zod44.ZodString;
|
|
286
|
+
email: zod44.ZodString;
|
|
287
|
+
role: zod44.ZodEnum<{
|
|
288
|
+
user: "user";
|
|
289
|
+
admin: "admin";
|
|
290
|
+
}>;
|
|
291
|
+
createdAt: zod44.ZodString;
|
|
292
|
+
}, zod_v4_core12.$strip>>;
|
|
293
|
+
cursor: zod44.ZodOptional<zod44.ZodString>;
|
|
294
|
+
hasNextPage: zod44.ZodBoolean;
|
|
295
|
+
sortBy: zod44.ZodEnum<{
|
|
296
|
+
createdAt: "createdAt";
|
|
297
|
+
email: "email";
|
|
298
|
+
}>;
|
|
299
|
+
}, zod_v4_core12.$strip>, "invalid_input", "pageSize" | "search" | "cursor" | "sortOrder" | "sortBy", _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, ..._fragno_dev_core0.FragnoRouteConfig<_fragno_dev_core_api4.HTTPMethod, `/_internal/${string}`, any, any, any, any, any>[]], _fragno_dev_db0.ImplicitDatabaseDependencies<_fragno_dev_db_schema0.Schema<{
|
|
300
|
+
user: _fragno_dev_db_schema0.Table<Record<string, _fragno_dev_db_schema0.AnyColumn> & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"email", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"passwordHash", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"role", _fragno_dev_db_schema0.Column<"string", string | null, string>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_createdAt", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["createdAt"]>>>;
|
|
301
|
+
session: _fragno_dev_db_schema0.Table<Record<string, _fragno_dev_db_schema0.AnyColumn> & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"userId", _fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>> & Record<"expiresAt", _fragno_dev_db_schema0.Column<"timestamp", _fragno_dev_db0.DbNow | Date, Date>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation> & Record<"sessionOwner", _fragno_dev_db_schema0.Relation<"one", _fragno_dev_db_schema0.Table<Record<string, _fragno_dev_db_schema0.AnyColumn> & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"email", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"passwordHash", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"role", _fragno_dev_db_schema0.Column<"string", string | null, string>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record<string, _fragno_dev_db_schema0.AnyRelation>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_user_email", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"string", string, string>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["email"]>> & Record<"idx_user_id", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["id"]>>>>>, Record<string, _fragno_dev_db_schema0.Index<_fragno_dev_db_schema0.AnyColumn[], readonly string[]>> & Record<"idx_session_user", _fragno_dev_db_schema0.Index<readonly [_fragno_dev_db_schema0.Column<"bigint", string | bigint | _fragno_dev_db_schema0.FragnoId | _fragno_dev_db_schema0.FragnoReference, _fragno_dev_db_schema0.FragnoReference>] & _fragno_dev_db_schema0.AnyColumn[], readonly ["userId"]>>>;
|
|
302
|
+
}>>, _fragno_dev_core0.BoundServices<{
|
|
303
|
+
getUsersWithCursor: (this: _fragno_dev_core0.RequestThisContext & {
|
|
304
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
305
|
+
}, params: GetUsersParams) => _fragno_dev_db0.TxResult<{
|
|
306
|
+
users: UserResult[];
|
|
307
|
+
cursor: _fragno_dev_db0.Cursor | undefined;
|
|
308
|
+
hasNextPage: boolean;
|
|
309
|
+
}, {
|
|
310
|
+
users: UserResult[];
|
|
311
|
+
cursor: _fragno_dev_db0.Cursor | undefined;
|
|
312
|
+
hasNextPage: boolean;
|
|
313
|
+
}>;
|
|
314
|
+
buildSessionCookie: (sessionId: string) => string;
|
|
315
|
+
createSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
316
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
317
|
+
}, userId: string) => _fragno_dev_db0.TxResult<{
|
|
318
|
+
id: string;
|
|
319
|
+
userId: string;
|
|
320
|
+
expiresAt: Date;
|
|
321
|
+
}, {
|
|
322
|
+
id: string;
|
|
323
|
+
userId: string;
|
|
324
|
+
expiresAt: Date;
|
|
325
|
+
}>;
|
|
326
|
+
validateSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
327
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
328
|
+
}, sessionId: string) => _fragno_dev_db0.TxResult<{
|
|
329
|
+
id: string;
|
|
330
|
+
userId: string;
|
|
331
|
+
user: {
|
|
332
|
+
id: string;
|
|
333
|
+
email: string;
|
|
334
|
+
role: string;
|
|
335
|
+
};
|
|
336
|
+
} | null, [{
|
|
337
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
338
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
339
|
+
expiresAt: Date;
|
|
340
|
+
createdAt: Date;
|
|
341
|
+
sessionOwner: {
|
|
342
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
343
|
+
email: string;
|
|
344
|
+
passwordHash: string;
|
|
345
|
+
role: string;
|
|
346
|
+
createdAt: Date;
|
|
347
|
+
} | null;
|
|
348
|
+
} | null]>;
|
|
349
|
+
invalidateSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
350
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
351
|
+
}, sessionId: string) => _fragno_dev_db0.TxResult<boolean, [{
|
|
352
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
353
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
354
|
+
expiresAt: Date;
|
|
355
|
+
createdAt: Date;
|
|
356
|
+
} | null]>;
|
|
357
|
+
getSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
358
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
359
|
+
}, headers: Headers) => _fragno_dev_db0.TxResult<{
|
|
360
|
+
userId: string;
|
|
361
|
+
email: string;
|
|
362
|
+
} | undefined, [{
|
|
363
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
364
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
365
|
+
expiresAt: Date;
|
|
366
|
+
createdAt: Date;
|
|
367
|
+
sessionOwner: {
|
|
368
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
369
|
+
email: string;
|
|
370
|
+
passwordHash: string;
|
|
371
|
+
role: string;
|
|
372
|
+
createdAt: Date;
|
|
373
|
+
} | null;
|
|
374
|
+
} | null]>;
|
|
375
|
+
createUser: (this: _fragno_dev_core0.RequestThisContext & {
|
|
376
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
377
|
+
}, email: string, passwordHash: string, role?: "user" | "admin") => _fragno_dev_db0.TxResult<{
|
|
378
|
+
id: string;
|
|
379
|
+
email: string;
|
|
380
|
+
role: "user" | "admin";
|
|
381
|
+
}, {
|
|
382
|
+
id: string;
|
|
383
|
+
email: string;
|
|
384
|
+
role: "user" | "admin";
|
|
385
|
+
}>;
|
|
386
|
+
getUserByEmail: (this: _fragno_dev_core0.RequestThisContext & {
|
|
387
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
388
|
+
}, email: string) => _fragno_dev_db0.TxResult<{
|
|
389
|
+
id: string;
|
|
390
|
+
email: string;
|
|
391
|
+
passwordHash: string;
|
|
392
|
+
role: "user" | "admin";
|
|
393
|
+
} | null, {
|
|
394
|
+
id: string;
|
|
395
|
+
email: string;
|
|
396
|
+
passwordHash: string;
|
|
397
|
+
role: "user" | "admin";
|
|
398
|
+
} | null>;
|
|
399
|
+
updateUserRole: (this: _fragno_dev_core0.RequestThisContext & {
|
|
400
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
401
|
+
}, userId: string, role: "user" | "admin") => _fragno_dev_db0.TxResult<{
|
|
402
|
+
success: boolean;
|
|
403
|
+
}, {
|
|
404
|
+
success: boolean;
|
|
405
|
+
}>;
|
|
406
|
+
updateUserPassword: (this: _fragno_dev_core0.RequestThisContext & {
|
|
407
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
408
|
+
}, userId: string, passwordHash: string) => _fragno_dev_db0.TxResult<{
|
|
409
|
+
success: boolean;
|
|
410
|
+
}, {
|
|
411
|
+
success: boolean;
|
|
412
|
+
}>;
|
|
413
|
+
signUpWithSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
414
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
415
|
+
}, email: string, passwordHash: string) => _fragno_dev_db0.TxResult<{
|
|
416
|
+
ok: false;
|
|
417
|
+
code: "email_already_exists";
|
|
418
|
+
sessionId?: undefined;
|
|
419
|
+
userId?: undefined;
|
|
420
|
+
email?: undefined;
|
|
421
|
+
role?: undefined;
|
|
422
|
+
} | {
|
|
423
|
+
ok: true;
|
|
424
|
+
sessionId: string;
|
|
425
|
+
userId: string;
|
|
426
|
+
email: string;
|
|
427
|
+
role: "user";
|
|
428
|
+
code?: undefined;
|
|
429
|
+
}, [{
|
|
430
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
431
|
+
email: string;
|
|
432
|
+
passwordHash: string;
|
|
433
|
+
role: string;
|
|
434
|
+
createdAt: Date;
|
|
435
|
+
} | null]>;
|
|
436
|
+
updateUserRoleWithSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
437
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
438
|
+
}, sessionId: string, userId: string, role: "user" | "admin") => _fragno_dev_db0.TxResult<{
|
|
439
|
+
ok: false;
|
|
440
|
+
code: "session_invalid";
|
|
441
|
+
} | {
|
|
442
|
+
ok: false;
|
|
443
|
+
code: "permission_denied";
|
|
444
|
+
} | {
|
|
445
|
+
ok: true;
|
|
446
|
+
code?: undefined;
|
|
447
|
+
}, [{
|
|
448
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
449
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
450
|
+
expiresAt: Date;
|
|
451
|
+
createdAt: Date;
|
|
452
|
+
sessionOwner: {
|
|
453
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
454
|
+
email: string;
|
|
455
|
+
passwordHash: string;
|
|
456
|
+
role: string;
|
|
457
|
+
createdAt: Date;
|
|
458
|
+
} | null;
|
|
459
|
+
} | null]>;
|
|
460
|
+
changePasswordWithSession: (this: _fragno_dev_core0.RequestThisContext & {
|
|
461
|
+
serviceTx<TSchema extends _fragno_dev_db_schema0.AnySchema>(schema: TSchema): _fragno_dev_db0.ServiceTxBuilder<TSchema, readonly [], [], [], unknown, unknown, false, false, false, false, {}>;
|
|
462
|
+
}, sessionId: string, passwordHash: string) => _fragno_dev_db0.TxResult<{
|
|
463
|
+
ok: false;
|
|
464
|
+
code: "session_invalid";
|
|
465
|
+
} | {
|
|
466
|
+
ok: true;
|
|
467
|
+
code?: undefined;
|
|
468
|
+
}, [{
|
|
469
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
470
|
+
userId: _fragno_dev_db_schema0.FragnoReference;
|
|
471
|
+
expiresAt: Date;
|
|
472
|
+
createdAt: Date;
|
|
473
|
+
sessionOwner: {
|
|
474
|
+
id: _fragno_dev_db_schema0.FragnoId;
|
|
475
|
+
email: string;
|
|
476
|
+
passwordHash: string;
|
|
477
|
+
role: string;
|
|
478
|
+
createdAt: Date;
|
|
479
|
+
} | null;
|
|
480
|
+
} | null]>;
|
|
481
|
+
}>, _fragno_dev_db0.DatabaseServiceContext<_fragno_dev_db0.HooksMap>, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>, _fragno_dev_db_fragment_definition_builder0.DatabaseRequestStorage, FragnoPublicConfigWithDatabase, {
|
|
482
|
+
_fragno_internal: _fragno_dev_db0.InternalFragmentInstance;
|
|
483
|
+
}>;
|
|
484
|
+
declare function createAuthFragmentClients(fragnoConfig?: FragnoPublicClientConfig): {
|
|
485
|
+
useSignUp: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api4.NonGetHTTPMethod, "/sign-up", zod44.ZodObject<{
|
|
486
|
+
email: zod44.ZodEmail;
|
|
487
|
+
password: zod44.ZodString;
|
|
488
|
+
}, zod_v4_core12.$strip> | undefined, zod44.ZodObject<{
|
|
489
|
+
sessionId: zod44.ZodString;
|
|
490
|
+
userId: zod44.ZodString;
|
|
491
|
+
email: zod44.ZodString;
|
|
492
|
+
role: zod44.ZodEnum<{
|
|
493
|
+
user: "user";
|
|
494
|
+
admin: "admin";
|
|
495
|
+
}>;
|
|
496
|
+
}, zod_v4_core12.$strip> | undefined, "invalid_input" | "email_already_exists", string>;
|
|
497
|
+
useSignIn: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api4.NonGetHTTPMethod, "/sign-in", zod44.ZodObject<{
|
|
498
|
+
email: zod44.ZodEmail;
|
|
499
|
+
password: zod44.ZodString;
|
|
500
|
+
}, zod_v4_core12.$strip> | undefined, zod44.ZodObject<{
|
|
501
|
+
sessionId: zod44.ZodString;
|
|
502
|
+
userId: zod44.ZodString;
|
|
503
|
+
email: zod44.ZodString;
|
|
504
|
+
role: zod44.ZodEnum<{
|
|
505
|
+
user: "user";
|
|
506
|
+
admin: "admin";
|
|
507
|
+
}>;
|
|
508
|
+
}, zod_v4_core12.$strip> | undefined, "invalid_credentials", string>;
|
|
509
|
+
useSignOut: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api4.NonGetHTTPMethod, "/sign-out", zod44.ZodOptional<zod44.ZodObject<{
|
|
510
|
+
sessionId: zod44.ZodOptional<zod44.ZodString>;
|
|
511
|
+
}, zod_v4_core12.$strip>> | undefined, zod44.ZodObject<{
|
|
512
|
+
success: zod44.ZodBoolean;
|
|
513
|
+
}, zod_v4_core12.$strip> | undefined, "session_not_found", string>;
|
|
514
|
+
useMe: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/me", zod44.ZodObject<{
|
|
515
|
+
userId: zod44.ZodString;
|
|
516
|
+
email: zod44.ZodString;
|
|
517
|
+
role: zod44.ZodEnum<{
|
|
518
|
+
user: "user";
|
|
519
|
+
admin: "admin";
|
|
520
|
+
}>;
|
|
521
|
+
}, zod_v4_core12.$strip>, "session_invalid", "sessionId">;
|
|
522
|
+
useUsers: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/users", zod44.ZodObject<{
|
|
523
|
+
users: zod44.ZodArray<zod44.ZodObject<{
|
|
524
|
+
id: zod44.ZodString;
|
|
525
|
+
email: zod44.ZodString;
|
|
526
|
+
role: zod44.ZodEnum<{
|
|
527
|
+
user: "user";
|
|
528
|
+
admin: "admin";
|
|
529
|
+
}>;
|
|
530
|
+
createdAt: zod44.ZodString;
|
|
531
|
+
}, zod_v4_core12.$strip>>;
|
|
532
|
+
cursor: zod44.ZodOptional<zod44.ZodString>;
|
|
533
|
+
hasNextPage: zod44.ZodBoolean;
|
|
534
|
+
sortBy: zod44.ZodEnum<{
|
|
535
|
+
createdAt: "createdAt";
|
|
536
|
+
email: "email";
|
|
537
|
+
}>;
|
|
538
|
+
}, zod_v4_core12.$strip>, "invalid_input", "pageSize" | "search" | "cursor" | "sortOrder" | "sortBy">;
|
|
539
|
+
useUpdateUserRole: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api4.NonGetHTTPMethod, "/users/:userId/role", zod44.ZodObject<{
|
|
540
|
+
role: zod44.ZodEnum<{
|
|
541
|
+
user: "user";
|
|
542
|
+
admin: "admin";
|
|
543
|
+
}>;
|
|
544
|
+
}, zod_v4_core12.$strip> | undefined, zod44.ZodObject<{
|
|
545
|
+
success: zod44.ZodBoolean;
|
|
546
|
+
}, zod_v4_core12.$strip> | undefined, "invalid_input" | "session_invalid" | "permission_denied", string>;
|
|
547
|
+
useChangePassword: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api4.NonGetHTTPMethod, "/change-password", zod44.ZodObject<{
|
|
548
|
+
newPassword: zod44.ZodString;
|
|
549
|
+
}, zod_v4_core12.$strip> | undefined, zod44.ZodObject<{
|
|
550
|
+
success: zod44.ZodBoolean;
|
|
551
|
+
}, zod_v4_core12.$strip> | undefined, "session_invalid", string>;
|
|
552
|
+
signIn: {
|
|
553
|
+
email: ({
|
|
554
|
+
email,
|
|
555
|
+
password,
|
|
556
|
+
rememberMe: _rememberMe
|
|
557
|
+
}: {
|
|
558
|
+
email: string;
|
|
559
|
+
password: string;
|
|
560
|
+
rememberMe?: boolean;
|
|
561
|
+
}) => Promise<{
|
|
562
|
+
sessionId: string;
|
|
563
|
+
userId: string;
|
|
564
|
+
email: string;
|
|
565
|
+
role: "user" | "admin";
|
|
566
|
+
} | undefined>;
|
|
567
|
+
};
|
|
568
|
+
signUp: {
|
|
569
|
+
email: ({
|
|
570
|
+
email,
|
|
571
|
+
password
|
|
572
|
+
}: {
|
|
573
|
+
email: string;
|
|
574
|
+
password: string;
|
|
575
|
+
}) => Promise<{
|
|
576
|
+
sessionId: string;
|
|
577
|
+
userId: string;
|
|
578
|
+
email: string;
|
|
579
|
+
role: "user" | "admin";
|
|
580
|
+
} | undefined>;
|
|
581
|
+
};
|
|
582
|
+
signOut: (params?: {
|
|
583
|
+
sessionId?: string;
|
|
584
|
+
}) => Promise<{
|
|
585
|
+
success: boolean;
|
|
586
|
+
} | undefined>;
|
|
587
|
+
me: (params?: {
|
|
588
|
+
sessionId?: string;
|
|
589
|
+
}) => Promise<{
|
|
590
|
+
userId: string;
|
|
591
|
+
email: string;
|
|
592
|
+
role: "user" | "admin";
|
|
593
|
+
}>;
|
|
594
|
+
};
|
|
595
|
+
type Role = "user" | "admin";
|
|
596
|
+
//# sourceMappingURL=index.d.ts.map
|
|
597
|
+
|
|
598
|
+
//#endregion
|
|
599
|
+
export { AuthConfig, AuthFragment, type FragnoRouteConfig, type GetUsersParams, Role, type SortField, type SortOrder, type UserResult, authFragmentDefinition, createAuthFragment, createAuthFragmentClients };
|
|
600
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/user/user-overview.ts","../../../src/utils/cookie.ts","../../../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;KAOY,SAAA;KACA,SAAA;UAEK,cAAA;;UAEP;aACG;;WAEF;;UAGM,UAAA;;;EAXL,IAAA,EAAA,MAAS,GAAA,OAAA;EACT,SAAA,EAcC,IAdQ;AAErB;;;UCHiB,aAAA;;;;;;;;;;;;UCSA,UAAA;;;;;QACwD;kBACvD;;cAGL,0CAAsB,mBAAA,YAAA,gCAAA,eAAA,CAAA,oDAAA;oDAAA,sBAAA,CAAA,SAAA;;AFdnC,CAAA,CAAA,CAAA,EAAY;EACA,kBAAS,EAAA,CAAA,IAAA,EEac,iBAAA,CAAA,kBAAA,GFbd;IAEJ,SAAA,CAAA,gDAAc,CAAA,CAAA,MAAA,SAAA,CAAA,kCAAA,QAAA,EAAA,SAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAAA,EAAA,OAAA,EAAA,KAAA,EAAA,KAAA,EAAA,KAAA,EAAA,KAAA,EAAA,CAAA,CAAA,CAAA;EAAA,CAAA,EAAA,MAAA,gBAAA,EAAA,2BAAA,CAAA;IAErB,KAAA,YAAA,EAAA;IACG,MAAA,2BAAA,SAAA;IAEF,WAAA,EAAA,OAAA;EAAM,CAAA,EAAA;IAGA,KAAA,YAAU,EAAA;;;;ECXV,kBAAa,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,GAAA,MAAA;;;;ICSb,EAAA,EAAA,MAAU;IAAA,MAAA,EAAA,MAAA;IAC8C,SAAA,MAAA;EAAO,CAAA,EAC9D;IAAa,EAAA,EAAA,MAAA;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