@spfn/auth 0.2.0-beta.9 → 0.2.0-beta.91
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 +1007 -1739
- package/dist/authenticate-DlTGaBT8.d.ts +1403 -0
- package/dist/client-proof.d.ts +606 -0
- package/dist/client-proof.js +1842 -0
- package/dist/client-proof.js.map +1 -0
- package/dist/config.d.ts +487 -39
- package/dist/config.js +243 -29
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +208 -3
- package/dist/errors.js +140 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +392 -110
- package/dist/index.js +186 -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 +2618 -1092
- package/dist/server.js +6553 -1500
- package/dist/server.js.map +1 -1
- package/dist/session-DTHahDQ9.d.ts +53 -0
- package/dist/types-DYyhze28.d.ts +98 -0
- package/dist/wire-version-CtzMKvBB.d.ts +134 -0
- package/migrations/20251125021229_premium_famine/snapshot.json +2641 -0
- package/migrations/20260225130050_smooth_the_fury/migration.sql +3 -0
- package/migrations/20260225130050_smooth_the_fury/snapshot.json +2686 -0
- package/migrations/20260308141417_deep_iceman/migration.sql +11 -0
- package/migrations/20260308141417_deep_iceman/snapshot.json +2686 -0
- package/migrations/20260308151309_perfect_deathbird/migration.sql +3 -0
- package/migrations/20260308151309_perfect_deathbird/snapshot.json +2731 -0
- package/migrations/20260308201135_concerned_rawhide_kid/migration.sql +5 -0
- package/migrations/20260308201135_concerned_rawhide_kid/snapshot.json +2786 -0
- package/migrations/20260629103209_lethal_lifeguard/migration.sql +32 -0
- package/migrations/20260629103209_lethal_lifeguard/snapshot.json +2786 -0
- package/migrations/20260709073531_easy_hardball/migration.sql +24 -0
- package/migrations/20260709073531_easy_hardball/snapshot.json +3119 -0
- package/migrations/20260714081434_glossy_major_mapleleaf/migration.sql +1 -0
- package/migrations/20260714081434_glossy_major_mapleleaf/snapshot.json +3112 -0
- package/migrations/20260804105939_amazing_bushwacker/migration.sql +3 -0
- package/migrations/20260804105939_amazing_bushwacker/snapshot.json +3112 -0
- package/migrations/20260804110033_fat_piledriver/migration.sql +2 -0
- package/migrations/20260804110033_fat_piledriver/snapshot.json +3138 -0
- package/migrations/20260805143152_vengeful_ravenous/migration.sql +4 -0
- package/migrations/20260805143152_vengeful_ravenous/snapshot.json +3190 -0
- package/package.json +60 -46
- package/dist/dto-CRlgoCP5.d.ts +0 -645
- package/migrations/meta/0000_snapshot.json +0 -1632
- package/migrations/meta/_journal.json +0 -13
- /package/migrations/{0000_premium_famine.sql → 20251125021229_premium_famine/migration.sql} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
import * as _spfn_core_nextjs from '@spfn/core/nextjs';
|
|
2
|
-
import { R as RoleConfig,
|
|
3
|
-
export {
|
|
2
|
+
import { P as PermissionConfig, R as RoleConfig, m as mainAuthRouter, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, K as KeySummary, c as RevokeAllKeysResult, I as IssueOneTimeTokenResult, O as OAuthStartResult, d as OAuthNativeResult, U as UserProfile, e as ProfileInfo } from './authenticate-DlTGaBT8.js';
|
|
3
|
+
export { A as AuthInitOptions, f as AuthSession, g as PERMISSION_CATEGORIES, h as PermissionCategory, V as VERIFICATION_PURPOSES, i as VERIFICATION_TARGET_TYPES, j as VerificationPurpose, k as VerificationTargetType } from './authenticate-DlTGaBT8.js';
|
|
4
4
|
import * as _spfn_core_route from '@spfn/core/route';
|
|
5
|
+
import { HttpMethod } from '@spfn/core/route';
|
|
6
|
+
export { A as ACCOUNT_DELETION_REQUESTED_BY, a as ACCOUNT_DELETION_REQUEST_STATUSES, b as AccountDeletionRequestStatus, c as AccountDeletionRequestedBy, I as INVITATION_STATUSES, d as InvitationStatus, e as KEY_ALGORITHM, f as KEY_DEVICE_NAME_MAX_LENGTH, g as KEY_PLATFORM, K as KeyAlgorithmType, h as KeyPlatformType, P as PURGE_STRATEGIES, i as PurgeStrategy, S as SOCIAL_PROVIDERS, j as SocialProvider, U as USER_STATUSES, k as UserStatus } from './types-DYyhze28.js';
|
|
5
7
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
8
|
+
import 'hono';
|
|
6
9
|
import '@spfn/auth/server';
|
|
7
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Email regex pattern (RFC 5322 compliant)
|
|
13
|
+
* Validates: local-part@domain.tld
|
|
14
|
+
* - Local part: alphanumeric, dots, hyphens, underscores
|
|
15
|
+
* - Domain: alphanumeric, hyphens, dots
|
|
16
|
+
* - TLD: minimum 2 characters
|
|
17
|
+
*/
|
|
18
|
+
declare const EMAIL_PATTERN = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$";
|
|
19
|
+
/**
|
|
20
|
+
* Phone regex pattern (E.164 format)
|
|
21
|
+
* Format: +[country code][number] (1-15 digits total)
|
|
22
|
+
*/
|
|
23
|
+
declare const PHONE_PATTERN = "^\\+[1-9]\\d{1,14}$";
|
|
24
|
+
/**
|
|
25
|
+
* SHA-256 fingerprint pattern (64 hex characters)
|
|
26
|
+
*/
|
|
27
|
+
declare const FINGERPRINT_PATTERN = "^[a-f0-9]{64}$";
|
|
28
|
+
/**
|
|
29
|
+
* UUID v4 pattern (8-4-4-4-12 format)
|
|
30
|
+
*/
|
|
31
|
+
declare const UUID_PATTERN = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
|
|
32
|
+
/**
|
|
33
|
+
* Base64 pattern (DER encoded keys)
|
|
34
|
+
* Matches standard Base64 with padding
|
|
35
|
+
*/
|
|
36
|
+
declare const BASE64_PATTERN = "^[A-Za-z0-9+/]+=*$";
|
|
37
|
+
|
|
8
38
|
/**
|
|
9
39
|
* @spfn/auth - Built-in Roles and Permissions
|
|
10
40
|
*
|
|
@@ -31,31 +61,16 @@ type BuiltinRoleName = keyof typeof BUILTIN_ROLE_PERMISSIONS;
|
|
|
31
61
|
type BuiltinPermissionName = typeof BUILTIN_PERMISSIONS[keyof typeof BUILTIN_PERMISSIONS]['name'];
|
|
32
62
|
|
|
33
63
|
/**
|
|
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
|
|
64
|
+
* Route Map (Auto-generated)
|
|
65
|
+
*
|
|
66
|
+
* DO NOT EDIT - This file is generated by @spfn/core:route-map generator
|
|
57
67
|
*/
|
|
58
|
-
|
|
68
|
+
|
|
69
|
+
interface RouteInfo {
|
|
70
|
+
method: HttpMethod;
|
|
71
|
+
path: string;
|
|
72
|
+
}
|
|
73
|
+
declare const routeMap: Record<string, RouteInfo>;
|
|
59
74
|
|
|
60
75
|
/**
|
|
61
76
|
* Type-safe API client for auth routes
|
|
@@ -74,25 +89,244 @@ declare const BASE64_PATTERN = "^[A-Za-z0-9+/]+=*$";
|
|
|
74
89
|
* ```
|
|
75
90
|
*/
|
|
76
91
|
declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
77
|
-
|
|
78
|
-
updateUserProfile: _spfn_core_route.RouteDef<{
|
|
92
|
+
sendVerificationCode: _spfn_core_route.RouteDef<{
|
|
79
93
|
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>>;
|
|
94
|
+
target: _sinclair_typebox.TString;
|
|
95
|
+
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
96
|
+
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
97
|
}>;
|
|
95
|
-
}, {},
|
|
98
|
+
}, {}, SendVerificationCodeResult>;
|
|
99
|
+
verifyCode: _spfn_core_route.RouteDef<{
|
|
100
|
+
body: _sinclair_typebox.TObject<{
|
|
101
|
+
target: _sinclair_typebox.TString;
|
|
102
|
+
targetType: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"email">, _sinclair_typebox.TLiteral<"phone">]>;
|
|
103
|
+
code: _sinclair_typebox.TString;
|
|
104
|
+
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">]>;
|
|
105
|
+
}>;
|
|
106
|
+
}, {}, {
|
|
107
|
+
valid: boolean;
|
|
108
|
+
verificationToken: string;
|
|
109
|
+
}>;
|
|
110
|
+
register: _spfn_core_route.RouteDef<{
|
|
111
|
+
body: _sinclair_typebox.TObject<{
|
|
112
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
113
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
114
|
+
verificationToken: _sinclair_typebox.TString;
|
|
115
|
+
password: _sinclair_typebox.TString;
|
|
116
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
117
|
+
}>;
|
|
118
|
+
}, {
|
|
119
|
+
body: _sinclair_typebox.TObject<{
|
|
120
|
+
publicKey: _sinclair_typebox.TString;
|
|
121
|
+
keyId: _sinclair_typebox.TString;
|
|
122
|
+
fingerprint: _sinclair_typebox.TString;
|
|
123
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
124
|
+
deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
125
|
+
platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
|
|
126
|
+
}>;
|
|
127
|
+
}, RegisterResult>;
|
|
128
|
+
login: _spfn_core_route.RouteDef<{
|
|
129
|
+
body: _sinclair_typebox.TObject<{
|
|
130
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
131
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
132
|
+
password: _sinclair_typebox.TString;
|
|
133
|
+
}>;
|
|
134
|
+
}, {
|
|
135
|
+
body: _sinclair_typebox.TObject<{
|
|
136
|
+
publicKey: _sinclair_typebox.TString;
|
|
137
|
+
keyId: _sinclair_typebox.TString;
|
|
138
|
+
fingerprint: _sinclair_typebox.TString;
|
|
139
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
140
|
+
oldKeyId: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
141
|
+
deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
142
|
+
platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
|
|
143
|
+
}>;
|
|
144
|
+
}, LoginResult>;
|
|
145
|
+
logout: _spfn_core_route.RouteDef<{}, {}, void>;
|
|
146
|
+
rotateKey: _spfn_core_route.RouteDef<{}, {
|
|
147
|
+
body: _sinclair_typebox.TObject<{
|
|
148
|
+
publicKey: _sinclair_typebox.TString;
|
|
149
|
+
keyId: _sinclair_typebox.TString;
|
|
150
|
+
fingerprint: _sinclair_typebox.TString;
|
|
151
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
152
|
+
deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
153
|
+
platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
|
|
154
|
+
}>;
|
|
155
|
+
}, RotateKeyResult>;
|
|
156
|
+
listKeys: _spfn_core_route.RouteDef<{
|
|
157
|
+
body: _sinclair_typebox.TObject<{
|
|
158
|
+
includeRevoked: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
159
|
+
}>;
|
|
160
|
+
}, {}, {
|
|
161
|
+
keys: KeySummary[];
|
|
162
|
+
}>;
|
|
163
|
+
revokeKey: _spfn_core_route.RouteDef<{
|
|
164
|
+
body: _sinclair_typebox.TObject<{
|
|
165
|
+
keyId: _sinclair_typebox.TString;
|
|
166
|
+
}>;
|
|
167
|
+
}, {}, {
|
|
168
|
+
keyId: string;
|
|
169
|
+
selfRevoked: boolean;
|
|
170
|
+
}>;
|
|
171
|
+
revokeAllKeys: _spfn_core_route.RouteDef<{
|
|
172
|
+
body: _sinclair_typebox.TObject<{
|
|
173
|
+
includeCurrent: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
174
|
+
}>;
|
|
175
|
+
}, {}, RevokeAllKeysResult>;
|
|
176
|
+
changePassword: _spfn_core_route.RouteDef<{
|
|
177
|
+
body: _sinclair_typebox.TObject<{
|
|
178
|
+
currentPassword: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
179
|
+
newPassword: _sinclair_typebox.TString;
|
|
180
|
+
}>;
|
|
181
|
+
}, {}, void>;
|
|
182
|
+
getAuthSession: _spfn_core_route.RouteDef<{}, {}, {
|
|
183
|
+
role: {
|
|
184
|
+
id: number;
|
|
185
|
+
name: string;
|
|
186
|
+
displayName: string;
|
|
187
|
+
priority: number;
|
|
188
|
+
};
|
|
189
|
+
permissions: {
|
|
190
|
+
id: number;
|
|
191
|
+
name: string;
|
|
192
|
+
displayName: string;
|
|
193
|
+
category: "auth" | "custom" | "user" | "rbac" | "system" | undefined;
|
|
194
|
+
}[];
|
|
195
|
+
userId: number;
|
|
196
|
+
publicId: string;
|
|
197
|
+
email: string | null;
|
|
198
|
+
emailVerified: boolean;
|
|
199
|
+
phoneVerified: boolean;
|
|
200
|
+
hasPassword: boolean;
|
|
201
|
+
}>;
|
|
202
|
+
issueOneTimeToken: _spfn_core_route.RouteDef<{}, {}, IssueOneTimeTokenResult>;
|
|
203
|
+
requestAccountDeletion: _spfn_core_route.RouteDef<{
|
|
204
|
+
body: _sinclair_typebox.TObject<{
|
|
205
|
+
password: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
206
|
+
verificationToken: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
207
|
+
reason: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
208
|
+
immediate: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
209
|
+
}>;
|
|
210
|
+
}, {}, {
|
|
211
|
+
purgeScheduledAt: string;
|
|
212
|
+
}>;
|
|
213
|
+
cancelAccountDeletion: _spfn_core_route.RouteDef<{
|
|
214
|
+
body: _sinclair_typebox.TObject<{
|
|
215
|
+
email: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
216
|
+
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
217
|
+
password: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
218
|
+
verificationToken: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
219
|
+
}>;
|
|
220
|
+
}, {}, void>;
|
|
221
|
+
oauthGoogleStart: _spfn_core_route.RouteDef<{
|
|
222
|
+
query: _sinclair_typebox.TObject<{
|
|
223
|
+
state: _sinclair_typebox.TString;
|
|
224
|
+
}>;
|
|
225
|
+
}, {}, Response>;
|
|
226
|
+
oauthGoogleCallback: _spfn_core_route.RouteDef<{
|
|
227
|
+
query: _sinclair_typebox.TObject<{
|
|
228
|
+
code: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
229
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
230
|
+
error: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
231
|
+
error_description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
232
|
+
}>;
|
|
233
|
+
}, {}, Response>;
|
|
234
|
+
oauthStart: _spfn_core_route.RouteDef<{
|
|
235
|
+
body: _sinclair_typebox.TObject<{
|
|
236
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
237
|
+
returnUrl: _sinclair_typebox.TString;
|
|
238
|
+
publicKey: _sinclair_typebox.TString;
|
|
239
|
+
keyId: _sinclair_typebox.TString;
|
|
240
|
+
fingerprint: _sinclair_typebox.TString;
|
|
241
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
242
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
243
|
+
}>;
|
|
244
|
+
}, {}, OAuthStartResult>;
|
|
245
|
+
oauthProviders: _spfn_core_route.RouteDef<{}, {}, {
|
|
246
|
+
providers: ("google" | "apple" | "github" | "kakao" | "naver" | "superself")[];
|
|
247
|
+
}>;
|
|
248
|
+
getGoogleOAuthUrl: _spfn_core_route.RouteDef<{
|
|
249
|
+
body: _sinclair_typebox.TObject<{
|
|
250
|
+
returnUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
251
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
252
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
253
|
+
}>;
|
|
254
|
+
}, {}, {
|
|
255
|
+
authUrl: string;
|
|
256
|
+
}>;
|
|
257
|
+
oauthFinalize: _spfn_core_route.RouteDef<{
|
|
258
|
+
body: _sinclair_typebox.TObject<{
|
|
259
|
+
userId: _sinclair_typebox.TString;
|
|
260
|
+
keyId: _sinclair_typebox.TString;
|
|
261
|
+
returnUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
262
|
+
}>;
|
|
263
|
+
}, {}, {
|
|
264
|
+
success: boolean;
|
|
265
|
+
userId: string;
|
|
266
|
+
keyId: string;
|
|
267
|
+
returnUrl: string;
|
|
268
|
+
}>;
|
|
269
|
+
oauthProviderStart: _spfn_core_route.RouteDef<{
|
|
270
|
+
params: _sinclair_typebox.TObject<{
|
|
271
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
272
|
+
}>;
|
|
273
|
+
query: _sinclair_typebox.TObject<{
|
|
274
|
+
state: _sinclair_typebox.TString;
|
|
275
|
+
}>;
|
|
276
|
+
}, {}, Response>;
|
|
277
|
+
oauthProviderCallback: _spfn_core_route.RouteDef<{
|
|
278
|
+
params: _sinclair_typebox.TObject<{
|
|
279
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
280
|
+
}>;
|
|
281
|
+
query: _sinclair_typebox.TObject<{
|
|
282
|
+
code: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
283
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
284
|
+
error: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
285
|
+
error_description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
286
|
+
}>;
|
|
287
|
+
}, {}, Response>;
|
|
288
|
+
getProviderOAuthUrl: _spfn_core_route.RouteDef<{
|
|
289
|
+
params: _sinclair_typebox.TObject<{
|
|
290
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
291
|
+
}>;
|
|
292
|
+
body: _sinclair_typebox.TObject<{
|
|
293
|
+
returnUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
294
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
295
|
+
state: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
296
|
+
}>;
|
|
297
|
+
}, {}, {
|
|
298
|
+
authUrl: string;
|
|
299
|
+
}>;
|
|
300
|
+
oauthNative: _spfn_core_route.RouteDef<{
|
|
301
|
+
params: _sinclair_typebox.TObject<{
|
|
302
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
303
|
+
}>;
|
|
304
|
+
body: _sinclair_typebox.TObject<{
|
|
305
|
+
idToken: _sinclair_typebox.TString;
|
|
306
|
+
nonce: _sinclair_typebox.TString;
|
|
307
|
+
accessToken: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
308
|
+
publicKey: _sinclair_typebox.TString;
|
|
309
|
+
keyId: _sinclair_typebox.TString;
|
|
310
|
+
fingerprint: _sinclair_typebox.TString;
|
|
311
|
+
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
312
|
+
deviceName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
313
|
+
platform: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ios" | "android" | "web" | "desktop">[]>>;
|
|
314
|
+
profile: _sinclair_typebox.TOptional<_sinclair_typebox.TObject<{
|
|
315
|
+
name: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
316
|
+
}>>;
|
|
317
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>>;
|
|
318
|
+
}>;
|
|
319
|
+
}, {}, OAuthNativeResult>;
|
|
320
|
+
oauthUnlinkNotify: _spfn_core_route.RouteDef<{
|
|
321
|
+
params: _sinclair_typebox.TObject<{
|
|
322
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
323
|
+
}>;
|
|
324
|
+
}, {}, void | Response>;
|
|
325
|
+
oauthUnlinkNotifyGet: _spfn_core_route.RouteDef<{
|
|
326
|
+
params: _sinclair_typebox.TObject<{
|
|
327
|
+
provider: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"google" | "apple" | "github" | "kakao" | "naver" | "superself">[]>;
|
|
328
|
+
}>;
|
|
329
|
+
}, {}, void | Response>;
|
|
96
330
|
getInvitation: _spfn_core_route.RouteDef<{
|
|
97
331
|
params: _sinclair_typebox.TObject<{
|
|
98
332
|
token: _sinclair_typebox.TString;
|
|
@@ -127,6 +361,7 @@ declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
|
127
361
|
email: _sinclair_typebox.TString;
|
|
128
362
|
roleId: _sinclair_typebox.TNumber;
|
|
129
363
|
expiresInDays: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
|
|
364
|
+
expiresAt: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
130
365
|
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
|
|
131
366
|
}>;
|
|
132
367
|
}, {}, {
|
|
@@ -193,95 +428,142 @@ declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
|
193
428
|
id: _sinclair_typebox.TNumber;
|
|
194
429
|
}>;
|
|
195
430
|
}, {}, 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<{
|
|
431
|
+
getUserProfile: _spfn_core_route.RouteDef<{}, {}, UserProfile>;
|
|
432
|
+
updateUserProfile: _spfn_core_route.RouteDef<{
|
|
204
433
|
body: _sinclair_typebox.TObject<{
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
434
|
+
displayName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
435
|
+
firstName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
436
|
+
lastName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
437
|
+
avatarUrl: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
438
|
+
bio: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
439
|
+
locale: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
440
|
+
timezone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
441
|
+
dateOfBirth: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
442
|
+
gender: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
443
|
+
website: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
444
|
+
location: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
445
|
+
company: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
446
|
+
jobTitle: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
447
|
+
metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
208
448
|
}>;
|
|
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">]>;
|
|
449
|
+
}, {}, ProfileInfo>;
|
|
450
|
+
checkUsername: _spfn_core_route.RouteDef<{
|
|
451
|
+
query: _sinclair_typebox.TObject<{
|
|
452
|
+
username: _sinclair_typebox.TString;
|
|
216
453
|
}>;
|
|
217
454
|
}, {}, {
|
|
218
|
-
|
|
219
|
-
verificationToken: string;
|
|
455
|
+
available: boolean;
|
|
220
456
|
}>;
|
|
221
|
-
|
|
457
|
+
updateUsername: _spfn_core_route.RouteDef<{
|
|
222
458
|
body: _sinclair_typebox.TObject<{
|
|
223
|
-
|
|
224
|
-
phone: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
225
|
-
verificationToken: _sinclair_typebox.TString;
|
|
226
|
-
password: _sinclair_typebox.TString;
|
|
459
|
+
username: _sinclair_typebox.TUnion<[_sinclair_typebox.TString, _sinclair_typebox.TNull]>;
|
|
227
460
|
}>;
|
|
228
|
-
}, {
|
|
461
|
+
}, {}, {
|
|
462
|
+
deletedAt: Date | null;
|
|
463
|
+
deletedBy: string | null;
|
|
464
|
+
createdAt: Date;
|
|
465
|
+
updatedAt: Date;
|
|
466
|
+
id: number;
|
|
467
|
+
publicId: string;
|
|
468
|
+
email: string | null;
|
|
469
|
+
phone: string | null;
|
|
470
|
+
username: string | null;
|
|
471
|
+
passwordHash: string | null;
|
|
472
|
+
passwordChangeRequired: boolean;
|
|
473
|
+
roleId: number;
|
|
474
|
+
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
475
|
+
emailVerifiedAt: Date | null;
|
|
476
|
+
phoneVerifiedAt: Date | null;
|
|
477
|
+
lastLoginAt: Date | null;
|
|
478
|
+
}>;
|
|
479
|
+
updateLocale: _spfn_core_route.RouteDef<{
|
|
229
480
|
body: _sinclair_typebox.TObject<{
|
|
230
|
-
|
|
231
|
-
keyId: _sinclair_typebox.TString;
|
|
232
|
-
fingerprint: _sinclair_typebox.TString;
|
|
233
|
-
algorithm: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"ES256" | "RS256">[]>;
|
|
481
|
+
locale: _sinclair_typebox.TString;
|
|
234
482
|
}>;
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
483
|
+
}, {}, {
|
|
484
|
+
locale: string;
|
|
485
|
+
}>;
|
|
486
|
+
listRoles: _spfn_core_route.RouteDef<{
|
|
487
|
+
query: _sinclair_typebox.TObject<{
|
|
488
|
+
includeInactive: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
241
489
|
}>;
|
|
242
|
-
}, {
|
|
490
|
+
}, {}, {
|
|
491
|
+
roles: {
|
|
492
|
+
description: string | null;
|
|
493
|
+
name: string;
|
|
494
|
+
id: number;
|
|
495
|
+
displayName: string;
|
|
496
|
+
isBuiltin: boolean;
|
|
497
|
+
isSystem: boolean;
|
|
498
|
+
isActive: boolean;
|
|
499
|
+
priority: number;
|
|
500
|
+
createdAt: Date;
|
|
501
|
+
updatedAt: Date;
|
|
502
|
+
}[];
|
|
503
|
+
}>;
|
|
504
|
+
createAdminRole: _spfn_core_route.RouteDef<{
|
|
243
505
|
body: _sinclair_typebox.TObject<{
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
506
|
+
name: _sinclair_typebox.TString;
|
|
507
|
+
displayName: _sinclair_typebox.TString;
|
|
508
|
+
description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
509
|
+
priority: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
|
|
510
|
+
permissionIds: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TNumber>>;
|
|
249
511
|
}>;
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
512
|
+
}, {}, {
|
|
513
|
+
role: {
|
|
514
|
+
description: string | null;
|
|
515
|
+
name: string;
|
|
516
|
+
id: number;
|
|
517
|
+
displayName: string;
|
|
518
|
+
isBuiltin: boolean;
|
|
519
|
+
isSystem: boolean;
|
|
520
|
+
isActive: boolean;
|
|
521
|
+
priority: number;
|
|
522
|
+
createdAt: Date;
|
|
523
|
+
updatedAt: Date;
|
|
524
|
+
};
|
|
525
|
+
}>;
|
|
526
|
+
updateAdminRole: _spfn_core_route.RouteDef<{
|
|
527
|
+
params: _sinclair_typebox.TObject<{
|
|
528
|
+
id: _sinclair_typebox.TNumber;
|
|
258
529
|
}>;
|
|
259
|
-
}, RotateKeyResult>;
|
|
260
|
-
changePassword: _spfn_core_route.RouteDef<{
|
|
261
530
|
body: _sinclair_typebox.TObject<{
|
|
262
|
-
|
|
263
|
-
|
|
531
|
+
displayName: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
532
|
+
description: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
|
|
533
|
+
priority: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
|
|
534
|
+
isActive: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
264
535
|
}>;
|
|
265
|
-
}, {},
|
|
266
|
-
getAuthSession: _spfn_core_route.RouteDef<{}, {}, {
|
|
536
|
+
}, {}, {
|
|
267
537
|
role: {
|
|
268
|
-
|
|
538
|
+
description: string | null;
|
|
269
539
|
name: string;
|
|
540
|
+
id: number;
|
|
270
541
|
displayName: string;
|
|
542
|
+
isBuiltin: boolean;
|
|
543
|
+
isSystem: boolean;
|
|
544
|
+
isActive: boolean;
|
|
271
545
|
priority: number;
|
|
546
|
+
createdAt: Date;
|
|
547
|
+
updatedAt: Date;
|
|
272
548
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
549
|
+
}>;
|
|
550
|
+
deleteAdminRole: _spfn_core_route.RouteDef<{
|
|
551
|
+
params: _sinclair_typebox.TObject<{
|
|
552
|
+
id: _sinclair_typebox.TNumber;
|
|
553
|
+
}>;
|
|
554
|
+
}, {}, void>;
|
|
555
|
+
updateUserRole: _spfn_core_route.RouteDef<{
|
|
556
|
+
params: _sinclair_typebox.TObject<{
|
|
557
|
+
userId: _sinclair_typebox.TNumber;
|
|
558
|
+
}>;
|
|
559
|
+
body: _sinclair_typebox.TObject<{
|
|
560
|
+
roleId: _sinclair_typebox.TNumber;
|
|
561
|
+
}>;
|
|
562
|
+
}, {}, {
|
|
279
563
|
userId: number;
|
|
280
|
-
|
|
281
|
-
emailVerified: boolean;
|
|
282
|
-
phoneVerified: boolean;
|
|
564
|
+
roleId: number;
|
|
283
565
|
}>;
|
|
284
566
|
}>>;
|
|
285
567
|
type AuthRouter = typeof mainAuthRouter;
|
|
286
568
|
|
|
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 };
|
|
569
|
+
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 };
|