@absolutejs/auth 0.80.0 → 0.81.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/CHANGELOG.md +20 -0
- package/README.md +2 -0
- package/changelog.json +37 -0
- package/dist/credentials/api.d.ts +214 -0
- package/dist/credentials/emailVerification.d.ts +189 -1
- package/dist/credentials/integration.d.ts +3 -0
- package/dist/credentials/login.d.ts +208 -1
- package/dist/credentials/passwordReset.d.ts +197 -1
- package/dist/credentials/register.d.ts +198 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +64 -32
- package/dist/index.js.map +10 -9
- package/dist/manifest.js +53 -2
- package/dist/manifest.js.map +5 -4
- package/dist/manifest.json +25 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +64 -32
- package/dist/server.js.map +10 -9
- package/docs/PERSISTENT-CREDENTIALS.md +131 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,26 @@ This file is generated by `absolute-changelog` from the entries in
|
|
|
6
6
|
`changelog/`. Edit an entry, not this file — and add new ones under
|
|
7
7
|
`changelog/unreleased/`.
|
|
8
8
|
|
|
9
|
+
## 0.81.0 — 2026-09-22
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Provide fixed-route credentials APIs with inferred Eden request types and a package-owned manifest integration recipe** (`createCredentialsApi`)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Delegate configurable credential routes through shared literal-path factories while retaining the same configuration and default endpoints** (`credentialsLogin`, `credentialsRegister`, `credentialsEmailVerification`, `credentialsPasswordReset`)
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **Document the required auth context session binding and protected account route**
|
|
22
|
+
|
|
23
|
+
## 0.80.1 — 2026-09-22
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **Document verified persistent credentials integration and correct Drizzle and migration APIs**
|
|
28
|
+
|
|
9
29
|
## 0.80.0 — 2026-09-22
|
|
10
30
|
|
|
11
31
|
### Added
|
package/README.md
CHANGED
|
@@ -440,3 +440,5 @@ Studio's `absolute-auth setup` reads the selected adapter from
|
|
|
440
440
|
migrations and warns that sessions reset on restart. The Neon adapter requires
|
|
441
441
|
a real `DATABASE_URL` and runs migrations. Missing or unknown selections fail
|
|
442
442
|
with an actionable error; custom adapters must configure their own migrations.
|
|
443
|
+
|
|
444
|
+
For a complete credentials-only Bun setup, see [Persistent email/password sign-in](docs/PERSISTENT-CREDENTIALS.md). It includes real migration and auth configuration APIs, durable user records, and driver settings.
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/auth",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"version": "0.81.0",
|
|
7
|
+
"date": "2026-09-22",
|
|
8
|
+
"changes": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "added",
|
|
11
|
+
"summary": "Provide fixed-route credentials APIs with inferred Eden request types and a package-owned manifest integration recipe",
|
|
12
|
+
"symbols": [
|
|
13
|
+
"createCredentialsApi"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"kind": "fixed",
|
|
18
|
+
"summary": "Document the required auth context session binding and protected account route"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"kind": "changed",
|
|
22
|
+
"summary": "Delegate configurable credential routes through shared literal-path factories while retaining the same configuration and default endpoints",
|
|
23
|
+
"symbols": [
|
|
24
|
+
"credentialsLogin",
|
|
25
|
+
"credentialsRegister",
|
|
26
|
+
"credentialsEmailVerification",
|
|
27
|
+
"credentialsPasswordReset"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"changes": [
|
|
34
|
+
{
|
|
35
|
+
"kind": "fixed",
|
|
36
|
+
"summary": "Document verified persistent credentials integration and correct Drizzle and migration APIs"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"date": "2026-09-22",
|
|
40
|
+
"version": "0.80.1"
|
|
41
|
+
},
|
|
5
42
|
{
|
|
6
43
|
"changes": [
|
|
7
44
|
{
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { CredentialRouteProps } from './config';
|
|
3
|
+
/** Fixed routes preserve Eden's route and body inference. The application owns
|
|
4
|
+
* users, durable stores and email delivery; all credential policy stays in the
|
|
5
|
+
* existing package handlers. Mount this instead of auth's credentials block. */
|
|
6
|
+
export declare const createCredentialsApi: <UserType>(configuration: Omit<CredentialRouteProps<UserType>, "loginRoute" | "registerRoute" | "verifyEmailRoute" | "resetPasswordRoute">) => Elysia<"", "local", {
|
|
7
|
+
decorator: {};
|
|
8
|
+
store: {
|
|
9
|
+
session: import("..").SessionRecord<UserType>;
|
|
10
|
+
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
11
|
+
};
|
|
12
|
+
derive: {};
|
|
13
|
+
}, {
|
|
14
|
+
typebox: {};
|
|
15
|
+
error: [];
|
|
16
|
+
}, import("elysia/types").DefaultMetadata, {
|
|
17
|
+
auth: {
|
|
18
|
+
register: {
|
|
19
|
+
post: {
|
|
20
|
+
body: {
|
|
21
|
+
email: string;
|
|
22
|
+
password: string;
|
|
23
|
+
};
|
|
24
|
+
params: {};
|
|
25
|
+
query: unknown;
|
|
26
|
+
headers: unknown;
|
|
27
|
+
response: {
|
|
28
|
+
200: Response | import("..").StatusReturn;
|
|
29
|
+
422: {
|
|
30
|
+
type: "validation";
|
|
31
|
+
title: "Validation Error";
|
|
32
|
+
status: 422;
|
|
33
|
+
detail?: string;
|
|
34
|
+
on: string;
|
|
35
|
+
found?: unknown;
|
|
36
|
+
property?: string;
|
|
37
|
+
expected?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
error: never;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
} & {
|
|
45
|
+
auth: {
|
|
46
|
+
login: {
|
|
47
|
+
post: {
|
|
48
|
+
body: {
|
|
49
|
+
email: string;
|
|
50
|
+
password: string;
|
|
51
|
+
};
|
|
52
|
+
params: {};
|
|
53
|
+
query: unknown;
|
|
54
|
+
headers: unknown;
|
|
55
|
+
response: {
|
|
56
|
+
401: "Invalid email or password";
|
|
57
|
+
403: "Request origin is not allowed" | {
|
|
58
|
+
readonly status: "email_not_verified";
|
|
59
|
+
};
|
|
60
|
+
200: {
|
|
61
|
+
readonly status: "mfa_required";
|
|
62
|
+
} | {
|
|
63
|
+
readonly passwordCompromised: boolean;
|
|
64
|
+
readonly status: "authenticated";
|
|
65
|
+
};
|
|
66
|
+
422: {
|
|
67
|
+
type: "validation";
|
|
68
|
+
title: "Validation Error";
|
|
69
|
+
status: 422;
|
|
70
|
+
detail?: string;
|
|
71
|
+
on: string;
|
|
72
|
+
found?: unknown;
|
|
73
|
+
property?: string;
|
|
74
|
+
expected?: string;
|
|
75
|
+
};
|
|
76
|
+
429: {
|
|
77
|
+
readonly retryAfterMs: number | undefined;
|
|
78
|
+
readonly status: "account_locked";
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
error: never;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
} & {
|
|
86
|
+
auth: {
|
|
87
|
+
"verify-email": {
|
|
88
|
+
post: {
|
|
89
|
+
body: {
|
|
90
|
+
token: string;
|
|
91
|
+
};
|
|
92
|
+
params: {};
|
|
93
|
+
query: unknown;
|
|
94
|
+
headers: unknown;
|
|
95
|
+
response: {
|
|
96
|
+
200: Response | import("..").StatusReturn;
|
|
97
|
+
422: {
|
|
98
|
+
type: "validation";
|
|
99
|
+
title: "Validation Error";
|
|
100
|
+
status: 422;
|
|
101
|
+
detail?: string;
|
|
102
|
+
on: string;
|
|
103
|
+
found?: unknown;
|
|
104
|
+
property?: string;
|
|
105
|
+
expected?: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
error: never;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
} & {
|
|
113
|
+
auth: {
|
|
114
|
+
"verify-email": {
|
|
115
|
+
request: {
|
|
116
|
+
post: {
|
|
117
|
+
body: {
|
|
118
|
+
email: string;
|
|
119
|
+
};
|
|
120
|
+
params: {};
|
|
121
|
+
query: unknown;
|
|
122
|
+
headers: unknown;
|
|
123
|
+
response: {
|
|
124
|
+
200: {
|
|
125
|
+
readonly status: "verification_requested";
|
|
126
|
+
};
|
|
127
|
+
422: {
|
|
128
|
+
type: "validation";
|
|
129
|
+
title: "Validation Error";
|
|
130
|
+
status: 422;
|
|
131
|
+
detail?: string;
|
|
132
|
+
on: string;
|
|
133
|
+
found?: unknown;
|
|
134
|
+
property?: string;
|
|
135
|
+
expected?: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
error: never;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
} & {
|
|
144
|
+
auth: {
|
|
145
|
+
"reset-password": {
|
|
146
|
+
request: {
|
|
147
|
+
post: {
|
|
148
|
+
body: {
|
|
149
|
+
email: string;
|
|
150
|
+
};
|
|
151
|
+
params: {};
|
|
152
|
+
query: unknown;
|
|
153
|
+
headers: unknown;
|
|
154
|
+
response: {
|
|
155
|
+
200: {
|
|
156
|
+
readonly status: "reset_requested";
|
|
157
|
+
};
|
|
158
|
+
422: {
|
|
159
|
+
type: "validation";
|
|
160
|
+
title: "Validation Error";
|
|
161
|
+
status: 422;
|
|
162
|
+
detail?: string;
|
|
163
|
+
on: string;
|
|
164
|
+
found?: unknown;
|
|
165
|
+
property?: string;
|
|
166
|
+
expected?: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
error: never;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
} & {
|
|
175
|
+
auth: {
|
|
176
|
+
"reset-password": {
|
|
177
|
+
post: {
|
|
178
|
+
body: {
|
|
179
|
+
token: string;
|
|
180
|
+
password: string;
|
|
181
|
+
};
|
|
182
|
+
params: {};
|
|
183
|
+
query: unknown;
|
|
184
|
+
headers: unknown;
|
|
185
|
+
response: {
|
|
186
|
+
400: "Invalid or expired reset token" | {
|
|
187
|
+
readonly message: "Password does not meet the policy";
|
|
188
|
+
readonly violations: import("./passwordPolicy").PasswordPolicyViolation[];
|
|
189
|
+
};
|
|
190
|
+
200: {
|
|
191
|
+
readonly status: "password_reset";
|
|
192
|
+
};
|
|
193
|
+
422: {
|
|
194
|
+
type: "validation";
|
|
195
|
+
title: "Validation Error";
|
|
196
|
+
status: 422;
|
|
197
|
+
detail?: string;
|
|
198
|
+
on: string;
|
|
199
|
+
found?: unknown;
|
|
200
|
+
property?: string;
|
|
201
|
+
expected?: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
error: never;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
}, import("elysia/types").DefaultEphemeral, {
|
|
209
|
+
derive: {};
|
|
210
|
+
schema: {};
|
|
211
|
+
schemas: {};
|
|
212
|
+
response: {};
|
|
213
|
+
error: [];
|
|
214
|
+
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { RouteString } from '../types';
|
|
1
2
|
import { type CredentialsConfig } from './config';
|
|
2
|
-
export declare const credentialsEmailVerification: <UserType>(
|
|
3
|
+
export declare const credentialsEmailVerification: <UserType>(configuration: CredentialsConfig<UserType>) => import("elysia/types").AddRoute<"", "local", import("elysia/types").DefaultSingleton, {
|
|
3
4
|
typebox: {};
|
|
4
5
|
error: [];
|
|
5
6
|
}, import("elysia/types").DefaultMetadata, {
|
|
@@ -186,3 +187,190 @@ export declare const credentialsEmailVerification: <UserType>({ credentialStore,
|
|
|
186
187
|
}) => Promise<import("elysia").ElysiaStatus<"OK", {
|
|
187
188
|
readonly status: "verification_requested";
|
|
188
189
|
}, 200>>>;
|
|
190
|
+
export declare const credentialsEmailVerificationRoute: <UserType, const Route extends RouteString = RouteString>({ credentialStore, getUserByEmail, onCreateCredentialUser, onEmailVerified, onRegistrationSuccess, onSendEmail, requireEmailVerification, verificationTokenDurationMs, verifyEmailRoute }: Omit<CredentialsConfig<UserType>, "verifyEmailRoute"> & {
|
|
191
|
+
verifyEmailRoute: Route;
|
|
192
|
+
}) => import("elysia/types").AddRoute<"", "local", import("elysia/types").DefaultSingleton, {
|
|
193
|
+
typebox: {};
|
|
194
|
+
error: [];
|
|
195
|
+
}, import("elysia/types").DefaultMetadata, {} & import("elysia/types").CreateEden<import("elysia/types").JoinPath<"", Route>, {
|
|
196
|
+
post: {
|
|
197
|
+
body: {
|
|
198
|
+
token: string;
|
|
199
|
+
};
|
|
200
|
+
params: import("elysia/types").IsNever<keyof import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Route>>, unknown>> extends true ? import("elysia/types").ResolvePath<Route> : import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", Route>>, unknown>;
|
|
201
|
+
query: unknown;
|
|
202
|
+
headers: unknown;
|
|
203
|
+
response: {
|
|
204
|
+
200: Response | import("..").StatusReturn;
|
|
205
|
+
422: {
|
|
206
|
+
type: "validation";
|
|
207
|
+
title: "Validation Error";
|
|
208
|
+
status: 422;
|
|
209
|
+
detail?: string;
|
|
210
|
+
on: string;
|
|
211
|
+
found?: unknown;
|
|
212
|
+
property?: string;
|
|
213
|
+
expected?: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
error: never;
|
|
217
|
+
};
|
|
218
|
+
}>, import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral, "post", `${Route}/request`, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
|
|
219
|
+
body: import("typebox").TObject<{
|
|
220
|
+
email: import("typebox").TString;
|
|
221
|
+
}>;
|
|
222
|
+
}, {}, import("elysia/types").JoinPath<"", `${Route}/request`>>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, ({ body: { email }, status }: {
|
|
223
|
+
body: {
|
|
224
|
+
email: string;
|
|
225
|
+
};
|
|
226
|
+
query: Record<string, string | undefined>;
|
|
227
|
+
params: undefined extends import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", `${Route}/request`>>, unknown> ? Record<string, string> : import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", `${Route}/request`>>, unknown> extends infer T ? T extends import("elysia/types").IntersectIfObject<import("elysia/types").ResolvePath<import("elysia/types").JoinPath<"", `${Route}/request`>>, unknown> ? T extends object ? { [K in keyof T]: T[K]; } : T : never : never;
|
|
228
|
+
headers: Record<string, string | undefined>;
|
|
229
|
+
cookie: Record<string, import("elysia").Cookie<unknown>>;
|
|
230
|
+
server: import("elysia").Server | null;
|
|
231
|
+
redirect: import("elysia").redirect;
|
|
232
|
+
set: {
|
|
233
|
+
headers: import("elysia").HTTPHeaders;
|
|
234
|
+
status?: number | keyof import("elysia").StatusMap;
|
|
235
|
+
cookie?: Record<string, import("elysia").BaseCookie>;
|
|
236
|
+
};
|
|
237
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T_1 = Code extends 400 | 401 | 403 | 501 | 204 | 404 | 200 | 301 | 302 | 303 | 307 | 308 | 409 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 205 | 206 | 207 | 208 | 300 | 304 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
238
|
+
readonly 100: "Continue";
|
|
239
|
+
readonly 101: "Switching Protocols";
|
|
240
|
+
readonly 102: "Processing";
|
|
241
|
+
readonly 103: "Early Hints";
|
|
242
|
+
readonly 200: "OK";
|
|
243
|
+
readonly 201: "Created";
|
|
244
|
+
readonly 202: "Accepted";
|
|
245
|
+
readonly 203: "Non-Authoritative Information";
|
|
246
|
+
readonly 204: "No Content";
|
|
247
|
+
readonly 205: "Reset Content";
|
|
248
|
+
readonly 206: "Partial Content";
|
|
249
|
+
readonly 207: "Multi-Status";
|
|
250
|
+
readonly 208: "Already Reported";
|
|
251
|
+
readonly 300: "Multiple Choices";
|
|
252
|
+
readonly 301: "Moved Permanently";
|
|
253
|
+
readonly 302: "Found";
|
|
254
|
+
readonly 303: "See Other";
|
|
255
|
+
readonly 304: "Not Modified";
|
|
256
|
+
readonly 307: "Temporary Redirect";
|
|
257
|
+
readonly 308: "Permanent Redirect";
|
|
258
|
+
readonly 400: "Bad Request";
|
|
259
|
+
readonly 401: "Unauthorized";
|
|
260
|
+
readonly 402: "Payment Required";
|
|
261
|
+
readonly 403: "Forbidden";
|
|
262
|
+
readonly 404: "Not Found";
|
|
263
|
+
readonly 405: "Method Not Allowed";
|
|
264
|
+
readonly 406: "Not Acceptable";
|
|
265
|
+
readonly 407: "Proxy Authentication Required";
|
|
266
|
+
readonly 408: "Request Timeout";
|
|
267
|
+
readonly 409: "Conflict";
|
|
268
|
+
readonly 410: "Gone";
|
|
269
|
+
readonly 411: "Length Required";
|
|
270
|
+
readonly 412: "Precondition Failed";
|
|
271
|
+
readonly 413: "Payload Too Large";
|
|
272
|
+
readonly 414: "URI Too Long";
|
|
273
|
+
readonly 415: "Unsupported Media Type";
|
|
274
|
+
readonly 416: "Range Not Satisfiable";
|
|
275
|
+
readonly 417: "Expectation Failed";
|
|
276
|
+
readonly 418: "I'm a teapot";
|
|
277
|
+
readonly 420: "Enhance Your Calm";
|
|
278
|
+
readonly 421: "Misdirected Request";
|
|
279
|
+
readonly 422: "Unprocessable Content";
|
|
280
|
+
readonly 423: "Locked";
|
|
281
|
+
readonly 424: "Failed Dependency";
|
|
282
|
+
readonly 425: "Too Early";
|
|
283
|
+
readonly 426: "Upgrade Required";
|
|
284
|
+
readonly 428: "Precondition Required";
|
|
285
|
+
readonly 429: "Too Many Requests";
|
|
286
|
+
readonly 431: "Request Header Fields Too Large";
|
|
287
|
+
readonly 451: "Unavailable For Legal Reasons";
|
|
288
|
+
readonly 500: "Internal Server Error";
|
|
289
|
+
readonly 501: "Not Implemented";
|
|
290
|
+
readonly 502: "Bad Gateway";
|
|
291
|
+
readonly 503: "Service Unavailable";
|
|
292
|
+
readonly 504: "Gateway Timeout";
|
|
293
|
+
readonly 505: "HTTP Version Not Supported";
|
|
294
|
+
readonly 506: "Variant Also Negotiates";
|
|
295
|
+
readonly 507: "Insufficient Storage";
|
|
296
|
+
readonly 508: "Loop Detected";
|
|
297
|
+
readonly 510: "Not Extended";
|
|
298
|
+
readonly 511: "Network Authentication Required";
|
|
299
|
+
}[Code] : Code>(code: Code, response?: T_1) => import("elysia").ElysiaStatus<Code, T_1, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
|
|
300
|
+
readonly Continue: 100;
|
|
301
|
+
readonly "Switching Protocols": 101;
|
|
302
|
+
readonly Processing: 102;
|
|
303
|
+
readonly "Early Hints": 103;
|
|
304
|
+
readonly OK: 200;
|
|
305
|
+
readonly Created: 201;
|
|
306
|
+
readonly Accepted: 202;
|
|
307
|
+
readonly "Non-Authoritative Information": 203;
|
|
308
|
+
readonly "No Content": 204;
|
|
309
|
+
readonly "Reset Content": 205;
|
|
310
|
+
readonly "Partial Content": 206;
|
|
311
|
+
readonly "Multi-Status": 207;
|
|
312
|
+
readonly "Already Reported": 208;
|
|
313
|
+
readonly "Multiple Choices": 300;
|
|
314
|
+
readonly "Moved Permanently": 301;
|
|
315
|
+
readonly Found: 302;
|
|
316
|
+
readonly "See Other": 303;
|
|
317
|
+
readonly "Not Modified": 304;
|
|
318
|
+
readonly "Temporary Redirect": 307;
|
|
319
|
+
readonly "Permanent Redirect": 308;
|
|
320
|
+
readonly "Bad Request": 400;
|
|
321
|
+
readonly Unauthorized: 401;
|
|
322
|
+
readonly "Payment Required": 402;
|
|
323
|
+
readonly Forbidden: 403;
|
|
324
|
+
readonly "Not Found": 404;
|
|
325
|
+
readonly "Method Not Allowed": 405;
|
|
326
|
+
readonly "Not Acceptable": 406;
|
|
327
|
+
readonly "Proxy Authentication Required": 407;
|
|
328
|
+
readonly "Request Timeout": 408;
|
|
329
|
+
readonly Conflict: 409;
|
|
330
|
+
readonly Gone: 410;
|
|
331
|
+
readonly "Length Required": 411;
|
|
332
|
+
readonly "Precondition Failed": 412;
|
|
333
|
+
readonly "Payload Too Large": 413;
|
|
334
|
+
readonly "URI Too Long": 414;
|
|
335
|
+
readonly "Unsupported Media Type": 415;
|
|
336
|
+
readonly "Range Not Satisfiable": 416;
|
|
337
|
+
readonly "Expectation Failed": 417;
|
|
338
|
+
readonly "I'm a teapot": 418;
|
|
339
|
+
readonly "Enhance Your Calm": 420;
|
|
340
|
+
readonly "Misdirected Request": 421;
|
|
341
|
+
readonly "Unprocessable Content": 422;
|
|
342
|
+
readonly Locked: 423;
|
|
343
|
+
readonly "Failed Dependency": 424;
|
|
344
|
+
readonly "Too Early": 425;
|
|
345
|
+
readonly "Upgrade Required": 426;
|
|
346
|
+
readonly "Precondition Required": 428;
|
|
347
|
+
readonly "Too Many Requests": 429;
|
|
348
|
+
readonly "Request Header Fields Too Large": 431;
|
|
349
|
+
readonly "Unavailable For Legal Reasons": 451;
|
|
350
|
+
readonly "Internal Server Error": 500;
|
|
351
|
+
readonly "Not Implemented": 501;
|
|
352
|
+
readonly "Bad Gateway": 502;
|
|
353
|
+
readonly "Service Unavailable": 503;
|
|
354
|
+
readonly "Gateway Timeout": 504;
|
|
355
|
+
readonly "HTTP Version Not Supported": 505;
|
|
356
|
+
readonly "Variant Also Negotiates": 506;
|
|
357
|
+
readonly "Insufficient Storage": 507;
|
|
358
|
+
readonly "Loop Detected": 508;
|
|
359
|
+
readonly "Not Extended": 510;
|
|
360
|
+
readonly "Network Authentication Required": 511;
|
|
361
|
+
}[Code] : Code>;
|
|
362
|
+
defer: (fn: import("elysia/types").AfterResponseHandler<NoInfer<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
|
|
363
|
+
body: import("typebox").TObject<{
|
|
364
|
+
email: import("typebox").TString;
|
|
365
|
+
}>;
|
|
366
|
+
}, {}, import("elysia/types").JoinPath<"", `${Route}/request`>>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>>, NoInfer<import("elysia/types").DefaultSingleton & {
|
|
367
|
+
derive: {};
|
|
368
|
+
}>>) => import("elysia/types").MaybePromise<void>;
|
|
369
|
+
readonly path: string;
|
|
370
|
+
route?: string | undefined;
|
|
371
|
+
rid?: string | undefined;
|
|
372
|
+
request: Request;
|
|
373
|
+
store: {};
|
|
374
|
+
}) => Promise<import("elysia").ElysiaStatus<"OK", {
|
|
375
|
+
readonly status: "verification_requested";
|
|
376
|
+
}, 200>>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Package-owned source recipe. Host bindings are explicit: no generated user
|
|
2
|
+
* database, placeholder mailer, secret value or in-memory production fallback. */
|
|
3
|
+
export declare const credentialsIntegrationSource = "import { Elysia } from 'elysia';\nimport { createAuthContext, createCredentialsApi } from '@absolutejs/auth/server';\nimport { credentialsConfiguration } from './credentials.config';\n\nexport const credentialsApi = createCredentialsApi(credentialsConfiguration);\nexport const accountApi = new Elysia()\n .use(createAuthContext({ authSessionStore: credentialsConfiguration.authSessionStore }))\n .get('/api/account', ({ absoluteAuthStatus, status }) => {\n if (!absoluteAuthStatus.user) return status(401, { error: 'Sign in required' });\n return { user: absoluteAuthStatus.user };\n });\n// Mount both subapps on the application server. Use auth without a credentials\n// block for OAuth/sign-out to avoid duplicate credential routes.\n// Browser: treaty<typeof credentialsApi>(origin).auth.login.post({email,password})\n// Execute that directly typed call in a React Query mutationFn.\n";
|