@spfn/auth 0.2.0-beta.8 → 0.2.0-beta.80
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 +1 -1
- package/README.md +549 -1819
- package/dist/authenticate-ofdEmk6x.d.ts +1109 -0
- package/dist/config.d.ts +359 -41
- package/dist/config.js +186 -30
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +117 -3
- package/dist/errors.js +83 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +351 -109
- package/dist/index.js +124 -7
- package/dist/index.js.map +1 -1
- package/dist/nextjs/api.js +591 -61
- package/dist/nextjs/api.js.map +1 -1
- package/dist/nextjs/client.d.ts +28 -0
- package/dist/nextjs/client.js +80 -0
- package/dist/nextjs/client.js.map +1 -0
- package/dist/nextjs/server.d.ts +92 -3
- package/dist/nextjs/server.js +288 -24
- package/dist/nextjs/server.js.map +1 -1
- package/dist/server.d.ts +2015 -513
- package/dist/server.js +4198 -1086
- package/dist/server.js.map +1 -1
- package/dist/session-CGxgH3C9.d.ts +53 -0
- package/dist/types-1BMx0OX1.d.ts +84 -0
- package/migrations/0001_smooth_the_fury.sql +3 -0
- package/migrations/0002_deep_iceman.sql +11 -0
- package/migrations/0003_perfect_deathbird.sql +3 -0
- package/migrations/0004_concerned_rawhide_kid.sql +5 -0
- package/migrations/0005_lethal_lifeguard.sql +32 -0
- package/migrations/0006_easy_hardball.sql +24 -0
- package/migrations/0007_glossy_major_mapleleaf.sql +1 -0
- package/migrations/meta/0001_snapshot.json +1660 -0
- package/migrations/meta/0002_snapshot.json +1660 -0
- package/migrations/meta/0003_snapshot.json +1689 -0
- package/migrations/meta/0004_snapshot.json +1721 -0
- package/migrations/meta/0005_snapshot.json +1721 -0
- package/migrations/meta/0006_snapshot.json +1921 -0
- package/migrations/meta/0007_snapshot.json +1916 -0
- package/migrations/meta/_journal.json +49 -0
- package/package.json +43 -39
- package/dist/dto-lZmWuObc.d.ts +0 -645
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
import * as _spfn_core_nextjs from '@spfn/core/nextjs';
|
|
2
|
-
import { R as RoleConfig, P as PermissionConfig,
|
|
3
|
-
export {
|
|
2
|
+
import { R as RoleConfig, P as PermissionConfig, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, I as IssueOneTimeTokenResult, O as OAuthStartResult, c as OAuthNativeResult, U as UserProfile, d as ProfileInfo, m as mainAuthRouter } from './authenticate-ofdEmk6x.js';
|
|
3
|
+
export { j as AuthInitOptions, A as AuthSession, h as PERMISSION_CATEGORIES, i as PermissionCategory, g as VERIFICATION_PURPOSES, f as VERIFICATION_TARGET_TYPES, e as VerificationPurpose, V as VerificationTargetType } from './authenticate-ofdEmk6x.js';
|
|
4
4
|
import * as _spfn_core_route from '@spfn/core/route';
|
|
5
|
+
import { HttpMethod } from '@spfn/core/route';
|
|
6
|
+
export { b as ACCOUNT_DELETION_REQUESTED_BY, A as ACCOUNT_DELETION_REQUEST_STATUSES, f as AccountDeletionRequestStatus, g as AccountDeletionRequestedBy, I as INVITATION_STATUSES, c as InvitationStatus, a as KEY_ALGORITHM, K as KeyAlgorithmType, P as PURGE_STRATEGIES, h as PurgeStrategy, S as SOCIAL_PROVIDERS, e as SocialProvider, U as USER_STATUSES, d as UserStatus } from './types-1BMx0OX1.js';
|
|
5
7
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
6
8
|
import '@spfn/auth/server';
|
|
7
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Email regex pattern (RFC 5322 compliant)
|
|
12
|
+
* Validates: local-part@domain.tld
|
|
13
|
+
* - Local part: alphanumeric, dots, hyphens, underscores
|
|
14
|
+
* - Domain: alphanumeric, hyphens, dots
|
|
15
|
+
* - TLD: minimum 2 characters
|
|
16
|
+
*/
|
|
17
|
+
declare const EMAIL_PATTERN = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$";
|
|
18
|
+
/**
|
|
19
|
+
* Phone regex pattern (E.164 format)
|
|
20
|
+
* Format: +[country code][number] (1-15 digits total)
|
|
21
|
+
*/
|
|
22
|
+
declare const PHONE_PATTERN = "^\\+[1-9]\\d{1,14}$";
|
|
23
|
+
/**
|
|
24
|
+
* SHA-256 fingerprint pattern (64 hex characters)
|
|
25
|
+
*/
|
|
26
|
+
declare const FINGERPRINT_PATTERN = "^[a-f0-9]{64}$";
|
|
27
|
+
/**
|
|
28
|
+
* UUID v4 pattern (8-4-4-4-12 format)
|
|
29
|
+
*/
|
|
30
|
+
declare const UUID_PATTERN = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
|
|
31
|
+
/**
|
|
32
|
+
* Base64 pattern (DER encoded keys)
|
|
33
|
+
* Matches standard Base64 with padding
|
|
34
|
+
*/
|
|
35
|
+
declare const BASE64_PATTERN = "^[A-Za-z0-9+/]+=*$";
|
|
36
|
+
|
|
8
37
|
/**
|
|
9
38
|
* @spfn/auth - Built-in Roles and Permissions
|
|
10
39
|
*
|
|
@@ -31,31 +60,16 @@ type BuiltinRoleName = keyof typeof BUILTIN_ROLE_PERMISSIONS;
|
|
|
31
60
|
type BuiltinPermissionName = typeof BUILTIN_PERMISSIONS[keyof typeof BUILTIN_PERMISSIONS]['name'];
|
|
32
61
|
|
|
33
62
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* -
|
|
37
|
-
* - Domain: alphanumeric, hyphens, dots
|
|
38
|
-
* - TLD: minimum 2 characters
|
|
39
|
-
*/
|
|
40
|
-
declare const EMAIL_PATTERN = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$";
|
|
41
|
-
/**
|
|
42
|
-
* Phone regex pattern (E.164 format)
|
|
43
|
-
* Format: +[country code][number] (1-15 digits total)
|
|
44
|
-
*/
|
|
45
|
-
declare const PHONE_PATTERN = "^\\+[1-9]\\d{1,14}$";
|
|
46
|
-
/**
|
|
47
|
-
* SHA-256 fingerprint pattern (64 hex characters)
|
|
48
|
-
*/
|
|
49
|
-
declare const FINGERPRINT_PATTERN = "^[a-f0-9]{64}$";
|
|
50
|
-
/**
|
|
51
|
-
* UUID v4 pattern (8-4-4-4-12 format)
|
|
52
|
-
*/
|
|
53
|
-
declare const UUID_PATTERN = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
|
|
54
|
-
/**
|
|
55
|
-
* Base64 pattern (DER encoded keys)
|
|
56
|
-
* Matches standard Base64 with padding
|
|
63
|
+
* Route Map (Auto-generated)
|
|
64
|
+
*
|
|
65
|
+
* DO NOT EDIT - This file is generated by @spfn/core:route-map generator
|
|
57
66
|
*/
|
|
58
|
-
|
|
67
|
+
|
|
68
|
+
interface RouteInfo {
|
|
69
|
+
method: HttpMethod;
|
|
70
|
+
path: string;
|
|
71
|
+
}
|
|
72
|
+
declare const routeMap: Record<string, RouteInfo>;
|
|
59
73
|
|
|
60
74
|
/**
|
|
61
75
|
* Type-safe API client for auth routes
|
|
@@ -74,25 +88,205 @@ declare const BASE64_PATTERN = "^[A-Za-z0-9+/]+=*$";
|
|
|
74
88
|
* ```
|
|
75
89
|
*/
|
|
76
90
|
declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
77
|
-
|
|
78
|
-
updateUserProfile: _spfn_core_route.RouteDef<{
|
|
91
|
+
sendVerificationCode: _spfn_core_route.RouteDef<{
|
|
79
92
|
body: _sinclair_typebox.TObject<{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
avatarUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
84
|
-
bio: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
85
|
-
locale: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
86
|
-
timezone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
87
|
-
dateOfBirth: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
88
|
-
gender: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
89
|
-
website: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
90
|
-
location: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
91
|
-
company: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
92
|
-
jobTitle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
93
|
-
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
93
|
+
target: _sinclair_typebox.TString;
|
|
94
|
+
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
95
|
+
purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">, _sinclair_typebox.TLiteral<"email_change">, _sinclair_typebox.TLiteral<"phone_change">, _sinclair_typebox.TLiteral<"account_deletion">]>;
|
|
94
96
|
}>;
|
|
95
|
-
}, {},
|
|
97
|
+
}, {}, SendVerificationCodeResult>;
|
|
98
|
+
verifyCode: _spfn_core_route.RouteDef<{
|
|
99
|
+
body: _sinclair_typebox.TObject<{
|
|
100
|
+
target: _sinclair_typebox.TString;
|
|
101
|
+
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
102
|
+
code: _sinclair_typebox.TString;
|
|
103
|
+
purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">, _sinclair_typebox.TLiteral<"email_change">, _sinclair_typebox.TLiteral<"phone_change">, _sinclair_typebox.TLiteral<"account_deletion">]>;
|
|
104
|
+
}>;
|
|
105
|
+
}, {}, {
|
|
106
|
+
valid: boolean;
|
|
107
|
+
verificationToken: string;
|
|
108
|
+
}>;
|
|
109
|
+
register: _spfn_core_route.RouteDef<{
|
|
110
|
+
body: _sinclair_typebox.TObject<{
|
|
111
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
112
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
113
|
+
verificationToken: _sinclair_typebox.TString;
|
|
114
|
+
password: _sinclair_typebox.TString;
|
|
115
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
116
|
+
}>;
|
|
117
|
+
}, {
|
|
118
|
+
body: _sinclair_typebox.TObject<{
|
|
119
|
+
publicKey: _sinclair_typebox.TString;
|
|
120
|
+
keyId: _sinclair_typebox.TString;
|
|
121
|
+
fingerprint: _sinclair_typebox.TString;
|
|
122
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
123
|
+
}>;
|
|
124
|
+
}, RegisterResult>;
|
|
125
|
+
login: _spfn_core_route.RouteDef<{
|
|
126
|
+
body: _sinclair_typebox.TObject<{
|
|
127
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
128
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
129
|
+
password: _sinclair_typebox.TString;
|
|
130
|
+
}>;
|
|
131
|
+
}, {
|
|
132
|
+
body: _sinclair_typebox.TObject<{
|
|
133
|
+
publicKey: _sinclair_typebox.TString;
|
|
134
|
+
keyId: _sinclair_typebox.TString;
|
|
135
|
+
fingerprint: _sinclair_typebox.TString;
|
|
136
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
137
|
+
oldKeyId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
138
|
+
}>;
|
|
139
|
+
}, LoginResult>;
|
|
140
|
+
logout: _spfn_core_route.RouteDef<{}, {}, void>;
|
|
141
|
+
rotateKey: _spfn_core_route.RouteDef<{}, {
|
|
142
|
+
body: _sinclair_typebox.TObject<{
|
|
143
|
+
publicKey: _sinclair_typebox.TString;
|
|
144
|
+
keyId: _sinclair_typebox.TString;
|
|
145
|
+
fingerprint: _sinclair_typebox.TString;
|
|
146
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
147
|
+
}>;
|
|
148
|
+
}, RotateKeyResult>;
|
|
149
|
+
changePassword: _spfn_core_route.RouteDef<{
|
|
150
|
+
body: _sinclair_typebox.TObject<{
|
|
151
|
+
currentPassword: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
152
|
+
newPassword: _sinclair_typebox.TString;
|
|
153
|
+
}>;
|
|
154
|
+
}, {}, void>;
|
|
155
|
+
getAuthSession: _spfn_core_route.RouteDef<{}, {}, {
|
|
156
|
+
role: {
|
|
157
|
+
id: number;
|
|
158
|
+
name: string;
|
|
159
|
+
displayName: string;
|
|
160
|
+
priority: number;
|
|
161
|
+
};
|
|
162
|
+
permissions: {
|
|
163
|
+
id: number;
|
|
164
|
+
name: string;
|
|
165
|
+
displayName: string;
|
|
166
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
167
|
+
}[];
|
|
168
|
+
userId: number;
|
|
169
|
+
publicId: string;
|
|
170
|
+
email: string | null;
|
|
171
|
+
emailVerified: boolean;
|
|
172
|
+
phoneVerified: boolean;
|
|
173
|
+
hasPassword: boolean;
|
|
174
|
+
}>;
|
|
175
|
+
issueOneTimeToken: _spfn_core_route.RouteDef<{}, {}, IssueOneTimeTokenResult>;
|
|
176
|
+
requestAccountDeletion: _spfn_core_route.RouteDef<{
|
|
177
|
+
body: _sinclair_typebox.TObject<{
|
|
178
|
+
password: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
179
|
+
verificationToken: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
180
|
+
reason: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
181
|
+
immediate: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
182
|
+
}>;
|
|
183
|
+
}, {}, {
|
|
184
|
+
purgeScheduledAt: string;
|
|
185
|
+
}>;
|
|
186
|
+
cancelAccountDeletion: _spfn_core_route.RouteDef<{
|
|
187
|
+
body: _sinclair_typebox.TObject<{
|
|
188
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
189
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
190
|
+
password: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
191
|
+
verificationToken: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
192
|
+
}>;
|
|
193
|
+
}, {}, void>;
|
|
194
|
+
oauthGoogleStart: _spfn_core_route.RouteDef<{
|
|
195
|
+
query: _sinclair_typebox.TObject<{
|
|
196
|
+
state: _sinclair_typebox.TString;
|
|
197
|
+
}>;
|
|
198
|
+
}, {}, Response>;
|
|
199
|
+
oauthGoogleCallback: _spfn_core_route.RouteDef<{
|
|
200
|
+
query: _sinclair_typebox.TObject<{
|
|
201
|
+
code: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
202
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
203
|
+
error: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
204
|
+
error_description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
205
|
+
}>;
|
|
206
|
+
}, {}, Response>;
|
|
207
|
+
oauthStart: _spfn_core_route.RouteDef<{
|
|
208
|
+
body: _sinclair_typebox.TObject<{
|
|
209
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
210
|
+
returnUrl: _sinclair_typebox.TString;
|
|
211
|
+
publicKey: _sinclair_typebox.TString;
|
|
212
|
+
keyId: _sinclair_typebox.TString;
|
|
213
|
+
fingerprint: _sinclair_typebox.TString;
|
|
214
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
215
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
216
|
+
}>;
|
|
217
|
+
}, {}, OAuthStartResult>;
|
|
218
|
+
oauthProviders: _spfn_core_route.RouteDef<{}, {}, {
|
|
219
|
+
providers: ("google" | "apple" | "github" | "kakao" | "naver" | "superself")[];
|
|
220
|
+
}>;
|
|
221
|
+
getGoogleOAuthUrl: _spfn_core_route.RouteDef<{
|
|
222
|
+
body: _sinclair_typebox.TObject<{
|
|
223
|
+
returnUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
224
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
225
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
226
|
+
}>;
|
|
227
|
+
}, {}, {
|
|
228
|
+
authUrl: string;
|
|
229
|
+
}>;
|
|
230
|
+
oauthFinalize: _spfn_core_route.RouteDef<{
|
|
231
|
+
body: _sinclair_typebox.TObject<{
|
|
232
|
+
userId: _sinclair_typebox.TString;
|
|
233
|
+
keyId: _sinclair_typebox.TString;
|
|
234
|
+
returnUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
235
|
+
}>;
|
|
236
|
+
}, {}, {
|
|
237
|
+
success: boolean;
|
|
238
|
+
userId: string;
|
|
239
|
+
keyId: string;
|
|
240
|
+
returnUrl: string;
|
|
241
|
+
}>;
|
|
242
|
+
oauthProviderStart: _spfn_core_route.RouteDef<{
|
|
243
|
+
params: _sinclair_typebox.TObject<{
|
|
244
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
245
|
+
}>;
|
|
246
|
+
query: _sinclair_typebox.TObject<{
|
|
247
|
+
state: _sinclair_typebox.TString;
|
|
248
|
+
}>;
|
|
249
|
+
}, {}, Response>;
|
|
250
|
+
oauthProviderCallback: _spfn_core_route.RouteDef<{
|
|
251
|
+
params: _sinclair_typebox.TObject<{
|
|
252
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
253
|
+
}>;
|
|
254
|
+
query: _sinclair_typebox.TObject<{
|
|
255
|
+
code: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
256
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
257
|
+
error: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
258
|
+
error_description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
259
|
+
}>;
|
|
260
|
+
}, {}, Response>;
|
|
261
|
+
getProviderOAuthUrl: _spfn_core_route.RouteDef<{
|
|
262
|
+
params: _sinclair_typebox.TObject<{
|
|
263
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
264
|
+
}>;
|
|
265
|
+
body: _sinclair_typebox.TObject<{
|
|
266
|
+
returnUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
267
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
268
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
269
|
+
}>;
|
|
270
|
+
}, {}, {
|
|
271
|
+
authUrl: string;
|
|
272
|
+
}>;
|
|
273
|
+
oauthNative: _spfn_core_route.RouteDef<{
|
|
274
|
+
params: _sinclair_typebox.TObject<{
|
|
275
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
276
|
+
}>;
|
|
277
|
+
body: _sinclair_typebox.TObject<{
|
|
278
|
+
idToken: _sinclair_typebox.TString;
|
|
279
|
+
nonce: _sinclair_typebox.TString;
|
|
280
|
+
publicKey: _sinclair_typebox.TString;
|
|
281
|
+
keyId: _sinclair_typebox.TString;
|
|
282
|
+
fingerprint: _sinclair_typebox.TString;
|
|
283
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
284
|
+
profile: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
|
|
285
|
+
name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
286
|
+
}>>;
|
|
287
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
288
|
+
}>;
|
|
289
|
+
}, {}, OAuthNativeResult>;
|
|
96
290
|
getInvitation: _spfn_core_route.RouteDef<{
|
|
97
291
|
params: _sinclair_typebox.TObject<{
|
|
98
292
|
token: _sinclair_typebox.TString;
|
|
@@ -127,6 +321,7 @@ declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
|
127
321
|
email: _sinclair_typebox.TString;
|
|
128
322
|
roleId: _sinclair_typebox.TNumber;
|
|
129
323
|
expiresInDays: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
|
|
324
|
+
expiresAt: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
130
325
|
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
|
|
131
326
|
}>;
|
|
132
327
|
}, {}, {
|
|
@@ -193,95 +388,142 @@ declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
|
193
388
|
id: _sinclair_typebox.TNumber;
|
|
194
389
|
}>;
|
|
195
390
|
}, {}, void>;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
email: _sinclair_typebox.TString;
|
|
199
|
-
}>, _sinclair_typebox.TObject<{
|
|
200
|
-
phone: _sinclair_typebox.TString;
|
|
201
|
-
}>]>;
|
|
202
|
-
}, {}, CheckAccountExistsResult>;
|
|
203
|
-
sendVerificationCode: _spfn_core_route.RouteDef<{
|
|
391
|
+
getUserProfile: _spfn_core_route.RouteDef<{}, {}, UserProfile>;
|
|
392
|
+
updateUserProfile: _spfn_core_route.RouteDef<{
|
|
204
393
|
body: _sinclair_typebox.TObject<{
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
394
|
+
displayName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
395
|
+
firstName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
396
|
+
lastName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
397
|
+
avatarUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
398
|
+
bio: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
399
|
+
locale: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
400
|
+
timezone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
401
|
+
dateOfBirth: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
402
|
+
gender: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
403
|
+
website: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
404
|
+
location: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
405
|
+
company: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
406
|
+
jobTitle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
407
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
208
408
|
}>;
|
|
209
|
-
}, {},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
214
|
-
code: _sinclair_typebox.TString;
|
|
215
|
-
purpose: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"registration">, _sinclair_typebox.TLiteral<"login">, _sinclair_typebox.TLiteral<"password_reset">, _sinclair_typebox.TLiteral<"email_change">, _sinclair_typebox.TLiteral<"phone_change">]>;
|
|
409
|
+
}, {}, ProfileInfo>;
|
|
410
|
+
checkUsername: _spfn_core_route.RouteDef<{
|
|
411
|
+
query: _sinclair_typebox.TObject<{
|
|
412
|
+
username: _sinclair_typebox.TString;
|
|
216
413
|
}>;
|
|
217
414
|
}, {}, {
|
|
218
|
-
|
|
219
|
-
verificationToken: string;
|
|
415
|
+
available: boolean;
|
|
220
416
|
}>;
|
|
221
|
-
|
|
417
|
+
updateUsername: _spfn_core_route.RouteDef<{
|
|
222
418
|
body: _sinclair_typebox.TObject<{
|
|
223
|
-
|
|
224
|
-
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
225
|
-
verificationToken: _sinclair_typebox.TString;
|
|
226
|
-
password: _sinclair_typebox.TString;
|
|
419
|
+
username: _sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TNull]>;
|
|
227
420
|
}>;
|
|
228
|
-
}, {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
421
|
+
}, {}, {
|
|
422
|
+
deletedAt: Date | null;
|
|
423
|
+
deletedBy: string | null;
|
|
424
|
+
createdAt: Date;
|
|
425
|
+
updatedAt: Date;
|
|
426
|
+
id: number;
|
|
427
|
+
publicId: string;
|
|
428
|
+
email: string | null;
|
|
429
|
+
phone: string | null;
|
|
430
|
+
username: string | null;
|
|
431
|
+
passwordHash: string | null;
|
|
432
|
+
passwordChangeRequired: boolean;
|
|
433
|
+
roleId: number;
|
|
434
|
+
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
435
|
+
emailVerifiedAt: Date | null;
|
|
436
|
+
phoneVerifiedAt: Date | null;
|
|
437
|
+
lastLoginAt: Date | null;
|
|
438
|
+
}>;
|
|
439
|
+
updateLocale: _spfn_core_route.RouteDef<{
|
|
243
440
|
body: _sinclair_typebox.TObject<{
|
|
244
|
-
|
|
245
|
-
keyId: _sinclair_typebox.TString;
|
|
246
|
-
fingerprint: _sinclair_typebox.TString;
|
|
247
|
-
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
248
|
-
oldKeyId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
441
|
+
locale: _sinclair_typebox.TString;
|
|
249
442
|
}>;
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
fingerprint: _sinclair_typebox.TString;
|
|
257
|
-
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
443
|
+
}, {}, {
|
|
444
|
+
locale: string;
|
|
445
|
+
}>;
|
|
446
|
+
listRoles: _spfn_core_route.RouteDef<{
|
|
447
|
+
query: _sinclair_typebox.TObject<{
|
|
448
|
+
includeInactive: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
258
449
|
}>;
|
|
259
|
-
},
|
|
260
|
-
|
|
450
|
+
}, {}, {
|
|
451
|
+
roles: {
|
|
452
|
+
description: string | null;
|
|
453
|
+
id: number;
|
|
454
|
+
name: string;
|
|
455
|
+
displayName: string;
|
|
456
|
+
isBuiltin: boolean;
|
|
457
|
+
isSystem: boolean;
|
|
458
|
+
isActive: boolean;
|
|
459
|
+
priority: number;
|
|
460
|
+
createdAt: Date;
|
|
461
|
+
updatedAt: Date;
|
|
462
|
+
}[];
|
|
463
|
+
}>;
|
|
464
|
+
createAdminRole: _spfn_core_route.RouteDef<{
|
|
261
465
|
body: _sinclair_typebox.TObject<{
|
|
262
|
-
|
|
263
|
-
|
|
466
|
+
name: _sinclair_typebox.TString;
|
|
467
|
+
displayName: _sinclair_typebox.TString;
|
|
468
|
+
description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
469
|
+
priority: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
|
|
470
|
+
permissionIds: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TNumber>>;
|
|
264
471
|
}>;
|
|
265
|
-
}, {},
|
|
266
|
-
getAuthSession: _spfn_core_route.RouteDef<{}, {}, {
|
|
472
|
+
}, {}, {
|
|
267
473
|
role: {
|
|
474
|
+
description: string | null;
|
|
268
475
|
id: number;
|
|
269
476
|
name: string;
|
|
270
477
|
displayName: string;
|
|
478
|
+
isBuiltin: boolean;
|
|
479
|
+
isSystem: boolean;
|
|
480
|
+
isActive: boolean;
|
|
271
481
|
priority: number;
|
|
482
|
+
createdAt: Date;
|
|
483
|
+
updatedAt: Date;
|
|
272
484
|
};
|
|
273
|
-
|
|
485
|
+
}>;
|
|
486
|
+
updateAdminRole: _spfn_core_route.RouteDef<{
|
|
487
|
+
params: _sinclair_typebox.TObject<{
|
|
488
|
+
id: _sinclair_typebox.TNumber;
|
|
489
|
+
}>;
|
|
490
|
+
body: _sinclair_typebox.TObject<{
|
|
491
|
+
displayName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
492
|
+
description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
493
|
+
priority: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
|
|
494
|
+
isActive: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
495
|
+
}>;
|
|
496
|
+
}, {}, {
|
|
497
|
+
role: {
|
|
498
|
+
description: string | null;
|
|
274
499
|
id: number;
|
|
275
500
|
name: string;
|
|
276
501
|
displayName: string;
|
|
277
|
-
|
|
278
|
-
|
|
502
|
+
isBuiltin: boolean;
|
|
503
|
+
isSystem: boolean;
|
|
504
|
+
isActive: boolean;
|
|
505
|
+
priority: number;
|
|
506
|
+
createdAt: Date;
|
|
507
|
+
updatedAt: Date;
|
|
508
|
+
};
|
|
509
|
+
}>;
|
|
510
|
+
deleteAdminRole: _spfn_core_route.RouteDef<{
|
|
511
|
+
params: _sinclair_typebox.TObject<{
|
|
512
|
+
id: _sinclair_typebox.TNumber;
|
|
513
|
+
}>;
|
|
514
|
+
}, {}, void>;
|
|
515
|
+
updateUserRole: _spfn_core_route.RouteDef<{
|
|
516
|
+
params: _sinclair_typebox.TObject<{
|
|
517
|
+
userId: _sinclair_typebox.TNumber;
|
|
518
|
+
}>;
|
|
519
|
+
body: _sinclair_typebox.TObject<{
|
|
520
|
+
roleId: _sinclair_typebox.TNumber;
|
|
521
|
+
}>;
|
|
522
|
+
}, {}, {
|
|
279
523
|
userId: number;
|
|
280
|
-
|
|
281
|
-
emailVerified: boolean;
|
|
282
|
-
phoneVerified: boolean;
|
|
524
|
+
roleId: number;
|
|
283
525
|
}>;
|
|
284
526
|
}>>;
|
|
285
527
|
type AuthRouter = typeof mainAuthRouter;
|
|
286
528
|
|
|
287
|
-
export { type AuthRouter, BASE64_PATTERN, BUILTIN_PERMISSIONS, BUILTIN_ROLES, BUILTIN_ROLE_PERMISSIONS, type BuiltinPermissionName, type BuiltinRoleName, EMAIL_PATTERN, FINGERPRINT_PATTERN, PHONE_PATTERN, PermissionConfig, ProfileInfo, RoleConfig, UUID_PATTERN, UserProfile, authApi };
|
|
529
|
+
export { type AuthRouter, BASE64_PATTERN, BUILTIN_PERMISSIONS, BUILTIN_ROLES, BUILTIN_ROLE_PERMISSIONS, type BuiltinPermissionName, type BuiltinRoleName, EMAIL_PATTERN, FINGERPRINT_PATTERN, PHONE_PATTERN, PermissionConfig, ProfileInfo, RoleConfig, UUID_PATTERN, UserProfile, authApi, routeMap as authRouteMap };
|