@effect-auth/core 0.1.0-alpha.1 → 0.1.0-alpha.13
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/README.md +790 -73
- package/dist/ApiKey.d.ts +207 -0
- package/dist/ApiKey.d.ts.map +1 -0
- package/dist/ApiKey.js +275 -0
- package/dist/ApiKey.js.map +1 -0
- package/dist/AuditLog.d.ts +335 -1
- package/dist/AuditLog.d.ts.map +1 -1
- package/dist/AuditLog.js +318 -1
- package/dist/AuditLog.js.map +1 -1
- package/dist/AuthConfig.d.ts +42 -0
- package/dist/AuthConfig.d.ts.map +1 -0
- package/dist/AuthConfig.js +43 -0
- package/dist/AuthConfig.js.map +1 -0
- package/dist/AuthFlow.d.ts +462 -36
- package/dist/AuthFlow.d.ts.map +1 -1
- package/dist/AuthFlow.js +657 -5
- package/dist/AuthFlow.js.map +1 -1
- package/dist/AuthKernel.d.ts +3 -0
- package/dist/AuthKernel.d.ts.map +1 -0
- package/dist/AuthKernel.js +9 -0
- package/dist/AuthKernel.js.map +1 -0
- package/dist/Challenge.d.ts +24 -4
- package/dist/Challenge.d.ts.map +1 -1
- package/dist/Challenge.js +167 -1
- package/dist/Challenge.js.map +1 -1
- package/dist/Client.d.ts +449 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +985 -0
- package/dist/Client.js.map +1 -0
- package/dist/Crypto.d.ts +6 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +62 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/DomainVerification.d.ts +200 -0
- package/dist/DomainVerification.d.ts.map +1 -0
- package/dist/DomainVerification.js +304 -0
- package/dist/DomainVerification.js.map +1 -0
- package/dist/EffectQbSqliteStorage.d.ts +985 -0
- package/dist/EffectQbSqliteStorage.d.ts.map +1 -0
- package/dist/EffectQbSqliteStorage.js +2824 -0
- package/dist/EffectQbSqliteStorage.js.map +1 -0
- package/dist/EmailOtp.d.ts +120 -0
- package/dist/EmailOtp.d.ts.map +1 -0
- package/dist/EmailOtp.js +286 -0
- package/dist/EmailOtp.js.map +1 -0
- package/dist/EmailVerification.d.ts +121 -0
- package/dist/EmailVerification.d.ts.map +1 -0
- package/dist/EmailVerification.js +200 -0
- package/dist/EmailVerification.js.map +1 -0
- package/dist/HttpApi/Api.d.ts +2410 -0
- package/dist/HttpApi/Api.d.ts.map +1 -0
- package/dist/HttpApi/Api.js +3026 -0
- package/dist/HttpApi/Api.js.map +1 -0
- package/dist/HttpApi/Endpoints.d.ts +1073 -0
- package/dist/HttpApi/Endpoints.d.ts.map +1 -0
- package/dist/HttpApi/Endpoints.js +428 -0
- package/dist/HttpApi/Endpoints.js.map +1 -0
- package/dist/HttpApi/Errors.d.ts +114 -0
- package/dist/HttpApi/Errors.d.ts.map +1 -0
- package/dist/HttpApi/Errors.js +230 -0
- package/dist/HttpApi/Errors.js.map +1 -0
- package/dist/HttpApi/Schemas.d.ts +1254 -0
- package/dist/HttpApi/Schemas.d.ts.map +1 -0
- package/dist/HttpApi/Schemas.js +862 -0
- package/dist/HttpApi/Schemas.js.map +1 -0
- package/dist/HttpApi/Security.d.ts +159 -0
- package/dist/HttpApi/Security.d.ts.map +1 -0
- package/dist/HttpApi/Security.js +530 -0
- package/dist/HttpApi/Security.js.map +1 -0
- package/dist/HttpApi/Transport.d.ts +65 -0
- package/dist/HttpApi/Transport.d.ts.map +1 -0
- package/dist/HttpApi/Transport.js +311 -0
- package/dist/HttpApi/Transport.js.map +1 -0
- package/dist/HttpApi/index.d.ts +8 -0
- package/dist/HttpApi/index.d.ts.map +1 -0
- package/dist/HttpApi/index.js +7 -0
- package/dist/HttpApi/index.js.map +1 -0
- package/dist/HttpApi.d.ts +2 -0
- package/dist/HttpApi.d.ts.map +1 -0
- package/dist/HttpApi.js +2 -0
- package/dist/HttpApi.js.map +1 -0
- package/dist/Identifiers.d.ts +3 -0
- package/dist/Identifiers.d.ts.map +1 -1
- package/dist/Identifiers.js +2 -0
- package/dist/Identifiers.js.map +1 -1
- package/dist/IncidentAction.d.ts +80 -0
- package/dist/IncidentAction.d.ts.map +1 -0
- package/dist/IncidentAction.js +158 -0
- package/dist/IncidentAction.js.map +1 -0
- package/dist/Internal.d.ts +7 -0
- package/dist/Internal.d.ts.map +1 -0
- package/dist/Internal.js +12 -0
- package/dist/Internal.js.map +1 -0
- package/dist/Jwt.d.ts +281 -0
- package/dist/Jwt.d.ts.map +1 -0
- package/dist/Jwt.js +721 -0
- package/dist/Jwt.js.map +1 -0
- package/dist/LoginApproval.d.ts +314 -0
- package/dist/LoginApproval.d.ts.map +1 -0
- package/dist/LoginApproval.js +551 -0
- package/dist/LoginApproval.js.map +1 -0
- package/dist/LoginNotification.d.ts +183 -0
- package/dist/LoginNotification.d.ts.map +1 -0
- package/dist/LoginNotification.js +329 -0
- package/dist/LoginNotification.js.map +1 -0
- package/dist/LoginRisk.d.ts +344 -0
- package/dist/LoginRisk.d.ts.map +1 -0
- package/dist/LoginRisk.js +484 -0
- package/dist/LoginRisk.js.map +1 -0
- package/dist/MachineAuth.d.ts +73 -0
- package/dist/MachineAuth.d.ts.map +1 -0
- package/dist/MachineAuth.js +147 -0
- package/dist/MachineAuth.js.map +1 -0
- package/dist/MagicLink.d.ts +85 -0
- package/dist/MagicLink.d.ts.map +1 -0
- package/dist/MagicLink.js +206 -0
- package/dist/MagicLink.js.map +1 -0
- package/dist/Mailer.d.ts +147 -0
- package/dist/Mailer.d.ts.map +1 -0
- package/dist/Mailer.js +208 -0
- package/dist/Mailer.js.map +1 -0
- package/dist/OAuth.d.ts +1890 -0
- package/dist/OAuth.d.ts.map +1 -0
- package/dist/OAuth.js +3063 -0
- package/dist/OAuth.js.map +1 -0
- package/dist/Passkey.d.ts +334 -0
- package/dist/Passkey.d.ts.map +1 -0
- package/dist/Passkey.js +422 -0
- package/dist/Passkey.js.map +1 -0
- package/dist/PasskeySimpleWebAuthn.d.ts +11 -0
- package/dist/PasskeySimpleWebAuthn.d.ts.map +1 -0
- package/dist/PasskeySimpleWebAuthn.js +181 -0
- package/dist/PasskeySimpleWebAuthn.js.map +1 -0
- package/dist/Password.d.ts +237 -0
- package/dist/Password.d.ts.map +1 -0
- package/dist/Password.js +641 -0
- package/dist/Password.js.map +1 -0
- package/dist/Policy.d.ts +7 -4
- package/dist/Policy.d.ts.map +1 -1
- package/dist/Policy.js +28 -5
- package/dist/Policy.js.map +1 -1
- package/dist/Privacy.d.ts +15 -0
- package/dist/Privacy.d.ts.map +1 -1
- package/dist/Privacy.js +58 -1
- package/dist/Privacy.js.map +1 -1
- package/dist/RateLimiter.d.ts +104 -0
- package/dist/RateLimiter.d.ts.map +1 -0
- package/dist/RateLimiter.js +118 -0
- package/dist/RateLimiter.js.map +1 -0
- package/dist/RecoveryCode.d.ts +169 -0
- package/dist/RecoveryCode.d.ts.map +1 -0
- package/dist/RecoveryCode.js +299 -0
- package/dist/RecoveryCode.js.map +1 -0
- package/dist/RefreshToken.d.ts +222 -0
- package/dist/RefreshToken.d.ts.map +1 -0
- package/dist/RefreshToken.js +342 -0
- package/dist/RefreshToken.js.map +1 -0
- package/dist/Retention.d.ts +98 -0
- package/dist/Retention.d.ts.map +1 -0
- package/dist/Retention.js +204 -0
- package/dist/Retention.js.map +1 -0
- package/dist/SecurityTimeline.d.ts +78 -0
- package/dist/SecurityTimeline.d.ts.map +1 -0
- package/dist/SecurityTimeline.js +461 -0
- package/dist/SecurityTimeline.js.map +1 -0
- package/dist/Sessions.d.ts +123 -11
- package/dist/Sessions.d.ts.map +1 -1
- package/dist/Sessions.js +534 -1
- package/dist/Sessions.js.map +1 -1
- package/dist/StepUp.d.ts +44 -0
- package/dist/StepUp.d.ts.map +1 -0
- package/dist/StepUp.js +82 -0
- package/dist/StepUp.js.map +1 -0
- package/dist/Storage.d.ts +73 -5
- package/dist/Storage.d.ts.map +1 -1
- package/dist/Storage.js +11 -1
- package/dist/Storage.js.map +1 -1
- package/dist/StorageMigrations.d.ts +23 -1
- package/dist/StorageMigrations.d.ts.map +1 -1
- package/dist/StorageMigrations.js +462 -2
- package/dist/StorageMigrations.js.map +1 -1
- package/dist/Testing.d.ts +9 -1
- package/dist/Testing.d.ts.map +1 -1
- package/dist/Testing.js +30 -2
- package/dist/Testing.js.map +1 -1
- package/dist/Totp.d.ts +220 -0
- package/dist/Totp.d.ts.map +1 -0
- package/dist/Totp.js +477 -0
- package/dist/Totp.js.map +1 -0
- package/dist/TrustedDevice.d.ts +127 -0
- package/dist/TrustedDevice.d.ts.map +1 -0
- package/dist/TrustedDevice.js +252 -0
- package/dist/TrustedDevice.js.map +1 -0
- package/dist/WaitUntil.d.ts.map +1 -1
- package/dist/WaitUntil.js +1 -1
- package/dist/WaitUntil.js.map +1 -1
- package/dist/Webhook.d.ts +380 -0
- package/dist/Webhook.d.ts.map +1 -0
- package/dist/Webhook.js +592 -0
- package/dist/Webhook.js.map +1 -0
- package/dist/alchemy/cloudflare/Email.d.ts +25 -0
- package/dist/alchemy/cloudflare/Email.d.ts.map +1 -0
- package/dist/alchemy/cloudflare/Email.js +117 -0
- package/dist/alchemy/cloudflare/Email.js.map +1 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts +34 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.js +30 -0
- package/dist/alchemy/cloudflare/RateLimitDurableObject.js.map +1 -0
- package/dist/cloudflare/Email.d.ts +25 -0
- package/dist/cloudflare/Email.d.ts.map +1 -0
- package/dist/cloudflare/Email.js +153 -0
- package/dist/cloudflare/Email.js.map +1 -0
- package/dist/cloudflare/RateLimitDurableObject.d.ts +50 -0
- package/dist/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
- package/dist/cloudflare/RateLimitDurableObject.js +51 -0
- package/dist/cloudflare/RateLimitDurableObject.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/RateLimitDurableObject.d.ts +32 -0
- package/dist/internal/RateLimitDurableObject.d.ts.map +1 -0
- package/dist/internal/RateLimitDurableObject.js +80 -0
- package/dist/internal/RateLimitDurableObject.js.map +1 -0
- package/migrations/0002_auth_password.sql +25 -0
- package/migrations/0003_auth_login_approval_review.sql +22 -0
- package/migrations/0004_auth_trusted_device.sql +12 -0
- package/migrations/0005_auth_passkey.sql +17 -0
- package/migrations/0006_auth_totp_factor.sql +17 -0
- package/migrations/0007_auth_recovery_code.sql +13 -0
- package/migrations/0008_auth_api_key.sql +17 -0
- package/migrations/0009_auth_refresh_token.sql +21 -0
- package/migrations/0010_auth_jwt_revocation.sql +8 -0
- package/migrations/0011_auth_oauth_account.sql +16 -0
- package/migrations/0012_auth_oauth_provider_token_vault.sql +20 -0
- package/migrations/0013_auth_security_timeline.sql +16 -0
- package/migrations/0014_auth_webhook_outbox.sql +16 -0
- package/migrations/0015_auth_webhook_replay.sql +7 -0
- package/migrations/0016_auth_login_risk_history.sql +23 -0
- package/migrations/0017_auth_audit_log.sql +17 -0
- package/migrations/0018_auth_domain_verification.sql +18 -0
- package/migrations/0019_auth_oauth_authorization_code.sql +17 -0
- package/migrations/0020_auth_oauth_provider_mode_token.sql +24 -0
- package/migrations/0021_auth_oauth_client_secret.sql +14 -0
- package/migrations/0022_auth_oauth_client.sql +15 -0
- package/migrations/0023_auth_oauth_consent.sql +15 -0
- package/package.json +162 -26
- package/dist/D1Kysely.d.ts +0 -40
- package/dist/D1Kysely.d.ts.map +0 -1
- package/dist/D1Kysely.js +0 -75
- package/dist/D1Kysely.js.map +0 -1
- package/dist/KyselyStorage.d.ts +0 -41
- package/dist/KyselyStorage.d.ts.map +0 -1
- package/dist/KyselyStorage.js +0 -176
- package/dist/KyselyStorage.js.map +0 -1
|
@@ -0,0 +1,862 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { AuthFlowIdSchema, ChallengeIdSchema, CredentialIdSchema, OAuthAccountIdSchema, EmailSchema, OAuthProviderIdSchema, SessionIdSchema, UnixMillisSchema, UserIdSchema, } from "../Identifiers.js";
|
|
3
|
+
export const PasswordSignInBody = Schema.Struct({
|
|
4
|
+
email: EmailSchema,
|
|
5
|
+
password: Schema.String,
|
|
6
|
+
});
|
|
7
|
+
export const PasswordSignUpBody = Schema.Struct({
|
|
8
|
+
email: EmailSchema,
|
|
9
|
+
password: Schema.String,
|
|
10
|
+
emailVerified: Schema.optional(Schema.Boolean),
|
|
11
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
12
|
+
});
|
|
13
|
+
export const PasswordResetStartBody = Schema.Struct({
|
|
14
|
+
email: EmailSchema,
|
|
15
|
+
secret: Schema.optional(Schema.String),
|
|
16
|
+
locale: Schema.optional(Schema.String),
|
|
17
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
18
|
+
});
|
|
19
|
+
export const PasswordResetVerifyBody = Schema.Struct({
|
|
20
|
+
challengeId: ChallengeIdSchema,
|
|
21
|
+
secret: Schema.String,
|
|
22
|
+
password: Schema.String,
|
|
23
|
+
});
|
|
24
|
+
export const PasswordSetBody = Schema.Struct({
|
|
25
|
+
password: Schema.String,
|
|
26
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
27
|
+
});
|
|
28
|
+
export const PasswordChangeBody = Schema.Struct({
|
|
29
|
+
currentPassword: Schema.String,
|
|
30
|
+
newPassword: Schema.String,
|
|
31
|
+
});
|
|
32
|
+
export const EmailVerificationStartBody = Schema.Struct({
|
|
33
|
+
userId: UserIdSchema,
|
|
34
|
+
email: EmailSchema,
|
|
35
|
+
secret: Schema.optional(Schema.String),
|
|
36
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
37
|
+
});
|
|
38
|
+
export const EmailVerificationVerifyBody = Schema.Struct({
|
|
39
|
+
challengeId: ChallengeIdSchema,
|
|
40
|
+
secret: Schema.optional(Schema.String),
|
|
41
|
+
});
|
|
42
|
+
export const EmailOtpStartBody = Schema.Struct({
|
|
43
|
+
email: EmailSchema,
|
|
44
|
+
secret: Schema.optional(Schema.String),
|
|
45
|
+
locale: Schema.optional(Schema.String),
|
|
46
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
47
|
+
});
|
|
48
|
+
export const EmailOtpStartedBody = Schema.Struct({
|
|
49
|
+
challengeId: ChallengeIdSchema,
|
|
50
|
+
email: EmailSchema,
|
|
51
|
+
expiresAt: UnixMillisSchema,
|
|
52
|
+
});
|
|
53
|
+
export const EmailOtpVerifyBody = Schema.Struct({
|
|
54
|
+
challengeId: ChallengeIdSchema,
|
|
55
|
+
secret: Schema.String,
|
|
56
|
+
});
|
|
57
|
+
export const MagicLinkStartBody = Schema.Struct({
|
|
58
|
+
email: EmailSchema,
|
|
59
|
+
secret: Schema.optional(Schema.String),
|
|
60
|
+
locale: Schema.optional(Schema.String),
|
|
61
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
62
|
+
});
|
|
63
|
+
export const MagicLinkStartedBody = Schema.Struct({
|
|
64
|
+
email: EmailSchema,
|
|
65
|
+
expiresAt: UnixMillisSchema,
|
|
66
|
+
});
|
|
67
|
+
export const MagicLinkVerifyBody = Schema.Struct({
|
|
68
|
+
challengeId: ChallengeIdSchema,
|
|
69
|
+
secret: Schema.String,
|
|
70
|
+
});
|
|
71
|
+
export const OAuthAuthorizationStartBody = Schema.Struct({
|
|
72
|
+
providerId: OAuthProviderIdSchema,
|
|
73
|
+
redirectUri: Schema.optional(Schema.String),
|
|
74
|
+
scopes: Schema.optional(Schema.Array(Schema.String)),
|
|
75
|
+
authorizationParams: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
76
|
+
codeVerifier: Schema.optional(Schema.String),
|
|
77
|
+
includeNonce: Schema.optional(Schema.Boolean),
|
|
78
|
+
nonce: Schema.optional(Schema.String),
|
|
79
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
80
|
+
});
|
|
81
|
+
export const OAuthAuthorizationStartedBody = Schema.Struct({
|
|
82
|
+
providerId: OAuthProviderIdSchema,
|
|
83
|
+
authorizationUrl: Schema.String,
|
|
84
|
+
state: Schema.String,
|
|
85
|
+
challengeId: ChallengeIdSchema,
|
|
86
|
+
expiresAt: UnixMillisSchema,
|
|
87
|
+
codeChallenge: Schema.String,
|
|
88
|
+
codeChallengeMethod: Schema.Literal("S256"),
|
|
89
|
+
nonce: Schema.optional(Schema.String),
|
|
90
|
+
redirectUri: Schema.String,
|
|
91
|
+
scopes: Schema.Array(Schema.String),
|
|
92
|
+
});
|
|
93
|
+
export const OAuthAuthorizationCallbackBody = Schema.Struct({
|
|
94
|
+
providerId: OAuthProviderIdSchema,
|
|
95
|
+
state: Schema.String,
|
|
96
|
+
code: Schema.optional(Schema.String),
|
|
97
|
+
error: Schema.optional(Schema.String),
|
|
98
|
+
errorDescription: Schema.optional(Schema.String),
|
|
99
|
+
errorUri: Schema.optional(Schema.String),
|
|
100
|
+
authorizationUser: Schema.optional(Schema.Unknown),
|
|
101
|
+
});
|
|
102
|
+
export const OAuthProviderAuthorizationQuery = Schema.Struct({
|
|
103
|
+
response_type: Schema.String,
|
|
104
|
+
client_id: Schema.optional(Schema.String),
|
|
105
|
+
redirect_uri: Schema.optional(Schema.String),
|
|
106
|
+
scope: Schema.optional(Schema.String),
|
|
107
|
+
state: Schema.optional(Schema.String),
|
|
108
|
+
code_challenge: Schema.optional(Schema.String),
|
|
109
|
+
code_challenge_method: Schema.optional(Schema.String),
|
|
110
|
+
});
|
|
111
|
+
export const OAuthTokenRequestBody = Schema.Struct({
|
|
112
|
+
grant_type: Schema.String,
|
|
113
|
+
code: Schema.optional(Schema.String),
|
|
114
|
+
refresh_token: Schema.optional(Schema.String),
|
|
115
|
+
redirect_uri: Schema.optional(Schema.String),
|
|
116
|
+
client_id: Schema.optional(Schema.String),
|
|
117
|
+
client_secret: Schema.optional(Schema.String),
|
|
118
|
+
code_verifier: Schema.optional(Schema.String),
|
|
119
|
+
scope: Schema.optional(Schema.String),
|
|
120
|
+
});
|
|
121
|
+
export const OAuthTokenRevocationRequestBody = Schema.Struct({
|
|
122
|
+
token: Schema.String,
|
|
123
|
+
token_type_hint: Schema.optional(Schema.String),
|
|
124
|
+
client_id: Schema.optional(Schema.String),
|
|
125
|
+
client_secret: Schema.optional(Schema.String),
|
|
126
|
+
});
|
|
127
|
+
export const OAuthTokenIntrospectionRequestBody = Schema.Struct({
|
|
128
|
+
token: Schema.String,
|
|
129
|
+
token_type_hint: Schema.optional(Schema.String),
|
|
130
|
+
client_id: Schema.optional(Schema.String),
|
|
131
|
+
client_secret: Schema.optional(Schema.String),
|
|
132
|
+
});
|
|
133
|
+
export const OAuthTokenResponseBody = Schema.Struct({
|
|
134
|
+
access_token: Schema.String,
|
|
135
|
+
token_type: Schema.String,
|
|
136
|
+
expires_in: Schema.optional(Schema.Number),
|
|
137
|
+
refresh_token: Schema.optional(Schema.String),
|
|
138
|
+
id_token: Schema.optional(Schema.String),
|
|
139
|
+
scope: Schema.optional(Schema.String),
|
|
140
|
+
extra: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
141
|
+
});
|
|
142
|
+
export const OAuthTokenIntrospectionResponseBody = Schema.Struct({
|
|
143
|
+
active: Schema.Boolean,
|
|
144
|
+
scope: Schema.optional(Schema.String),
|
|
145
|
+
client_id: Schema.optional(Schema.String),
|
|
146
|
+
username: Schema.optional(Schema.String),
|
|
147
|
+
token_type: Schema.optional(Schema.String),
|
|
148
|
+
exp: Schema.optional(Schema.Number),
|
|
149
|
+
iat: Schema.optional(Schema.Number),
|
|
150
|
+
nbf: Schema.optional(Schema.Number),
|
|
151
|
+
sub: Schema.optional(Schema.String),
|
|
152
|
+
aud: Schema.optional(Schema.Union([Schema.String, Schema.Array(Schema.String)])),
|
|
153
|
+
iss: Schema.optional(Schema.String),
|
|
154
|
+
jti: Schema.optional(Schema.String),
|
|
155
|
+
extra: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
156
|
+
});
|
|
157
|
+
export const OAuthVerifiedIdentityHttpBody = Schema.Struct({
|
|
158
|
+
providerId: OAuthProviderIdSchema,
|
|
159
|
+
providerAccountId: Schema.String,
|
|
160
|
+
email: Schema.optional(EmailSchema),
|
|
161
|
+
emailVerified: Schema.optional(Schema.Boolean),
|
|
162
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
163
|
+
});
|
|
164
|
+
export const OAuthPublicVerifiedIdentityHttpBody = Schema.Struct({
|
|
165
|
+
providerId: OAuthProviderIdSchema,
|
|
166
|
+
providerAccountId: Schema.String,
|
|
167
|
+
email: Schema.optional(EmailSchema),
|
|
168
|
+
emailVerified: Schema.optional(Schema.Boolean),
|
|
169
|
+
});
|
|
170
|
+
export const OAuthLinkConfirmationStartBody = Schema.Struct({
|
|
171
|
+
userId: Schema.optional(UserIdSchema),
|
|
172
|
+
identity: Schema.optional(OAuthVerifiedIdentityHttpBody),
|
|
173
|
+
reason: Schema.optional(Schema.String),
|
|
174
|
+
secret: Schema.optional(Schema.String),
|
|
175
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
176
|
+
});
|
|
177
|
+
export const OAuthLinkConfirmationStartedBody = Schema.Struct({
|
|
178
|
+
challengeId: ChallengeIdSchema,
|
|
179
|
+
userId: UserIdSchema,
|
|
180
|
+
identity: OAuthPublicVerifiedIdentityHttpBody,
|
|
181
|
+
reason: Schema.String,
|
|
182
|
+
expiresAt: UnixMillisSchema,
|
|
183
|
+
});
|
|
184
|
+
export const OAuthLinkConfirmationInspectBody = Schema.Struct({
|
|
185
|
+
challengeId: ChallengeIdSchema,
|
|
186
|
+
secret: Schema.optional(Schema.String),
|
|
187
|
+
});
|
|
188
|
+
export const OAuthLinkConfirmationPendingBody = OAuthLinkConfirmationStartedBody;
|
|
189
|
+
export const OAuthLinkConfirmationConfirmBody = Schema.Struct({
|
|
190
|
+
challengeId: ChallengeIdSchema,
|
|
191
|
+
secret: Schema.optional(Schema.String),
|
|
192
|
+
expectedProviderId: Schema.optional(OAuthProviderIdSchema),
|
|
193
|
+
expectedProviderAccountId: Schema.optional(Schema.String),
|
|
194
|
+
});
|
|
195
|
+
export const OAuthAccountUnlinkBody = Schema.Struct({
|
|
196
|
+
providerId: OAuthProviderIdSchema,
|
|
197
|
+
providerAccountId: Schema.String,
|
|
198
|
+
reason: Schema.optional(Schema.String),
|
|
199
|
+
});
|
|
200
|
+
export const OAuthLinkedAccountHttpBody = Schema.Struct({
|
|
201
|
+
accountId: OAuthAccountIdSchema,
|
|
202
|
+
providerId: OAuthProviderIdSchema,
|
|
203
|
+
providerAccountId: Schema.String,
|
|
204
|
+
});
|
|
205
|
+
export const OAuthAccountUnlinkAllowedBody = Schema.Struct({
|
|
206
|
+
type: Schema.Literal("allow"),
|
|
207
|
+
reason: Schema.Literal("owned-account"),
|
|
208
|
+
account: OAuthLinkedAccountHttpBody,
|
|
209
|
+
remainingAccounts: Schema.Array(OAuthLinkedAccountHttpBody),
|
|
210
|
+
unlinked: Schema.Boolean,
|
|
211
|
+
});
|
|
212
|
+
export const OAuthAccountUnlinkRequiresStepUpBody = Schema.Struct({
|
|
213
|
+
type: Schema.Literal("requires-step-up"),
|
|
214
|
+
reason: Schema.Literal("step-up-required"),
|
|
215
|
+
account: OAuthLinkedAccountHttpBody,
|
|
216
|
+
remainingAccounts: Schema.Array(OAuthLinkedAccountHttpBody),
|
|
217
|
+
});
|
|
218
|
+
export const OAuthAccountUnlinkDenyNotFoundBody = Schema.Struct({
|
|
219
|
+
type: Schema.Literal("deny-not-found"),
|
|
220
|
+
reason: Schema.Literal("provider-account-not-found"),
|
|
221
|
+
providerId: OAuthProviderIdSchema,
|
|
222
|
+
providerAccountId: Schema.String,
|
|
223
|
+
});
|
|
224
|
+
export const OAuthAccountUnlinkDenyNotOwnerBody = Schema.Struct({
|
|
225
|
+
type: Schema.Literal("deny-not-owner"),
|
|
226
|
+
reason: Schema.Literal("provider-account-linked-to-different-user"),
|
|
227
|
+
providerId: OAuthProviderIdSchema,
|
|
228
|
+
providerAccountId: Schema.String,
|
|
229
|
+
});
|
|
230
|
+
export const OAuthAccountUnlinkDenyLastAccountBody = Schema.Struct({
|
|
231
|
+
type: Schema.Literal("deny-last-account"),
|
|
232
|
+
reason: Schema.Literal("last-linked-account"),
|
|
233
|
+
account: OAuthLinkedAccountHttpBody,
|
|
234
|
+
});
|
|
235
|
+
export const OAuthAccountUnlinkResolutionBody = Schema.Union([
|
|
236
|
+
OAuthAccountUnlinkAllowedBody,
|
|
237
|
+
OAuthAccountUnlinkRequiresStepUpBody,
|
|
238
|
+
OAuthAccountUnlinkDenyNotFoundBody,
|
|
239
|
+
OAuthAccountUnlinkDenyNotOwnerBody,
|
|
240
|
+
OAuthAccountUnlinkDenyLastAccountBody,
|
|
241
|
+
]);
|
|
242
|
+
export const OAuthLinkConfirmationConfirmedBody = Schema.Struct({
|
|
243
|
+
challengeId: ChallengeIdSchema,
|
|
244
|
+
userId: UserIdSchema,
|
|
245
|
+
identity: OAuthPublicVerifiedIdentityHttpBody,
|
|
246
|
+
reason: Schema.String,
|
|
247
|
+
existingAccount: Schema.optional(OAuthLinkedAccountHttpBody),
|
|
248
|
+
linked: Schema.Boolean,
|
|
249
|
+
});
|
|
250
|
+
export const PasskeyClientCredentialBody = Schema.Struct({
|
|
251
|
+
id: Schema.String,
|
|
252
|
+
rawId: Schema.optional(Schema.String),
|
|
253
|
+
type: Schema.Literal("public-key"),
|
|
254
|
+
response: Schema.Record(Schema.String, Schema.Unknown),
|
|
255
|
+
authenticatorAttachment: Schema.optional(Schema.String),
|
|
256
|
+
clientExtensionResults: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
257
|
+
});
|
|
258
|
+
export const PasskeyRegistrationStartBody = Schema.Struct({
|
|
259
|
+
userId: UserIdSchema,
|
|
260
|
+
userName: Schema.String,
|
|
261
|
+
userDisplayName: Schema.String,
|
|
262
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
263
|
+
});
|
|
264
|
+
export const PasskeyRegistrationFinishBody = Schema.Struct({
|
|
265
|
+
challengeId: ChallengeIdSchema,
|
|
266
|
+
userId: UserIdSchema,
|
|
267
|
+
credential: PasskeyClientCredentialBody,
|
|
268
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
269
|
+
});
|
|
270
|
+
export const PasskeyAuthenticationStartBody = Schema.Struct({
|
|
271
|
+
userId: Schema.optional(UserIdSchema),
|
|
272
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
273
|
+
});
|
|
274
|
+
export const PasskeyAuthenticationFinishBody = Schema.Struct({
|
|
275
|
+
challengeId: ChallengeIdSchema,
|
|
276
|
+
credential: PasskeyClientCredentialBody,
|
|
277
|
+
userId: Schema.optional(UserIdSchema),
|
|
278
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
279
|
+
});
|
|
280
|
+
export const PasskeyMfaStartBody = Schema.Struct({
|
|
281
|
+
flowId: AuthFlowIdSchema,
|
|
282
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
283
|
+
});
|
|
284
|
+
export const PasskeyMfaVerifyBody = Schema.Struct({
|
|
285
|
+
flowId: AuthFlowIdSchema,
|
|
286
|
+
challengeId: ChallengeIdSchema,
|
|
287
|
+
credential: PasskeyClientCredentialBody,
|
|
288
|
+
userId: Schema.optional(UserIdSchema),
|
|
289
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
290
|
+
});
|
|
291
|
+
export const PasskeyCredentialDescriptorHttpBody = Schema.Struct({
|
|
292
|
+
type: Schema.Literal("public-key"),
|
|
293
|
+
id: Schema.String,
|
|
294
|
+
transports: Schema.optional(Schema.Array(Schema.String)),
|
|
295
|
+
});
|
|
296
|
+
export const PasskeyPublicKeyCredentialParametersHttpBody = Schema.Struct({
|
|
297
|
+
type: Schema.Literal("public-key"),
|
|
298
|
+
alg: Schema.Number,
|
|
299
|
+
});
|
|
300
|
+
export const PasskeyAuthenticatorSelectionHttpBody = Schema.Struct({
|
|
301
|
+
authenticatorAttachment: Schema.optional(Schema.Literals(["platform", "cross-platform"])),
|
|
302
|
+
residentKey: Schema.optional(Schema.Literals(["discouraged", "preferred", "required"])),
|
|
303
|
+
requireResidentKey: Schema.optional(Schema.Boolean),
|
|
304
|
+
userVerification: Schema.optional(Schema.Literals(["required", "preferred", "discouraged"])),
|
|
305
|
+
});
|
|
306
|
+
export const PasskeyRegistrationPublicKeyOptionsHttpBody = Schema.Struct({
|
|
307
|
+
challenge: Schema.String,
|
|
308
|
+
rp: Schema.Struct({ id: Schema.String, name: Schema.String }),
|
|
309
|
+
user: Schema.Struct({
|
|
310
|
+
id: Schema.String,
|
|
311
|
+
name: Schema.String,
|
|
312
|
+
displayName: Schema.String,
|
|
313
|
+
}),
|
|
314
|
+
pubKeyCredParams: Schema.Array(PasskeyPublicKeyCredentialParametersHttpBody),
|
|
315
|
+
timeout: Schema.optional(Schema.Number),
|
|
316
|
+
excludeCredentials: Schema.optional(Schema.Array(PasskeyCredentialDescriptorHttpBody)),
|
|
317
|
+
authenticatorSelection: Schema.optional(PasskeyAuthenticatorSelectionHttpBody),
|
|
318
|
+
attestation: Schema.optional(Schema.Literals(["none", "indirect", "direct", "enterprise"])),
|
|
319
|
+
});
|
|
320
|
+
export const PasskeyAuthenticationPublicKeyOptionsHttpBody = Schema.Struct({
|
|
321
|
+
challenge: Schema.String,
|
|
322
|
+
rpId: Schema.String,
|
|
323
|
+
timeout: Schema.optional(Schema.Number),
|
|
324
|
+
allowCredentials: Schema.optional(Schema.Array(PasskeyCredentialDescriptorHttpBody)),
|
|
325
|
+
userVerification: Schema.optional(Schema.Literals(["required", "preferred", "discouraged"])),
|
|
326
|
+
});
|
|
327
|
+
export const PasskeyRegistrationStartedBody = Schema.Struct({
|
|
328
|
+
challengeId: ChallengeIdSchema,
|
|
329
|
+
expiresAt: UnixMillisSchema,
|
|
330
|
+
publicKey: PasskeyRegistrationPublicKeyOptionsHttpBody,
|
|
331
|
+
});
|
|
332
|
+
export const PasskeyAuthenticationStartedBody = Schema.Struct({
|
|
333
|
+
challengeId: ChallengeIdSchema,
|
|
334
|
+
expiresAt: UnixMillisSchema,
|
|
335
|
+
publicKey: PasskeyAuthenticationPublicKeyOptionsHttpBody,
|
|
336
|
+
});
|
|
337
|
+
export const PasskeyRegisteredBody = Schema.Struct({
|
|
338
|
+
credentialId: Schema.String,
|
|
339
|
+
});
|
|
340
|
+
export const PasskeyCredentialHttpBody = Schema.Struct({
|
|
341
|
+
credentialId: Schema.String,
|
|
342
|
+
transports: Schema.optional(Schema.Array(Schema.String)),
|
|
343
|
+
backedUp: Schema.optional(Schema.Boolean),
|
|
344
|
+
createdAt: UnixMillisSchema,
|
|
345
|
+
lastUsedAt: Schema.optional(UnixMillisSchema),
|
|
346
|
+
revokedAt: Schema.optional(UnixMillisSchema),
|
|
347
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
348
|
+
});
|
|
349
|
+
export const PasskeyCredentialsBody = Schema.Struct({
|
|
350
|
+
credentials: Schema.Array(PasskeyCredentialHttpBody),
|
|
351
|
+
});
|
|
352
|
+
export const PasskeyCredentialRevokeBody = Schema.Struct({
|
|
353
|
+
credentialId: Schema.String,
|
|
354
|
+
reason: Schema.optional(Schema.String),
|
|
355
|
+
});
|
|
356
|
+
export const TotpAlgorithmHttpBody = Schema.Literals([
|
|
357
|
+
"SHA1",
|
|
358
|
+
"SHA256",
|
|
359
|
+
"SHA512",
|
|
360
|
+
]);
|
|
361
|
+
export const TotpEnrollmentStartBody = Schema.Struct({
|
|
362
|
+
accountName: Schema.String,
|
|
363
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
364
|
+
});
|
|
365
|
+
export const TotpEnrollmentConfirmBody = Schema.Struct({
|
|
366
|
+
factorId: CredentialIdSchema,
|
|
367
|
+
code: Schema.String,
|
|
368
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
369
|
+
});
|
|
370
|
+
export const TotpVerifyBody = Schema.Struct({
|
|
371
|
+
code: Schema.String,
|
|
372
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
373
|
+
});
|
|
374
|
+
export const TotpFactorRevokeBody = Schema.Struct({
|
|
375
|
+
factorId: CredentialIdSchema,
|
|
376
|
+
reason: Schema.optional(Schema.String),
|
|
377
|
+
});
|
|
378
|
+
export const TotpFactorHttpBody = Schema.Struct({
|
|
379
|
+
factorId: CredentialIdSchema,
|
|
380
|
+
algorithm: TotpAlgorithmHttpBody,
|
|
381
|
+
digits: Schema.Number,
|
|
382
|
+
period: Schema.Number,
|
|
383
|
+
createdAt: UnixMillisSchema,
|
|
384
|
+
confirmedAt: Schema.optional(UnixMillisSchema),
|
|
385
|
+
lastUsedAt: Schema.optional(UnixMillisSchema),
|
|
386
|
+
revokedAt: Schema.optional(UnixMillisSchema),
|
|
387
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
388
|
+
});
|
|
389
|
+
export const TotpEnrollmentStartedBody = Schema.Struct({
|
|
390
|
+
factor: TotpFactorHttpBody,
|
|
391
|
+
secret: Schema.String,
|
|
392
|
+
uri: Schema.String,
|
|
393
|
+
});
|
|
394
|
+
export const TotpVerifyResultBody = Schema.Struct({
|
|
395
|
+
valid: Schema.Boolean,
|
|
396
|
+
factor: Schema.optional(TotpFactorHttpBody),
|
|
397
|
+
delta: Schema.optional(Schema.Number),
|
|
398
|
+
});
|
|
399
|
+
export const TotpFactorsBody = Schema.Struct({
|
|
400
|
+
factors: Schema.Array(TotpFactorHttpBody),
|
|
401
|
+
});
|
|
402
|
+
export const RecoveryCodeGenerateBody = Schema.Struct({
|
|
403
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
404
|
+
});
|
|
405
|
+
export const RecoveryCodeVerifyBody = Schema.Struct({
|
|
406
|
+
code: Schema.String,
|
|
407
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
408
|
+
});
|
|
409
|
+
export const RecoveryCodeRevokeBody = Schema.Struct({
|
|
410
|
+
codeId: CredentialIdSchema,
|
|
411
|
+
reason: Schema.optional(Schema.String),
|
|
412
|
+
});
|
|
413
|
+
export const RecoveryCodeHttpBody = Schema.Struct({
|
|
414
|
+
codeId: CredentialIdSchema,
|
|
415
|
+
createdAt: UnixMillisSchema,
|
|
416
|
+
usedAt: Schema.optional(UnixMillisSchema),
|
|
417
|
+
revokedAt: Schema.optional(UnixMillisSchema),
|
|
418
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
419
|
+
});
|
|
420
|
+
export const RecoveryCodesGeneratedBody = Schema.Struct({
|
|
421
|
+
codes: Schema.Array(Schema.String),
|
|
422
|
+
records: Schema.Array(RecoveryCodeHttpBody),
|
|
423
|
+
});
|
|
424
|
+
export const RecoveryCodeVerifyResultBody = Schema.Struct({
|
|
425
|
+
valid: Schema.Boolean,
|
|
426
|
+
code: Schema.optional(RecoveryCodeHttpBody),
|
|
427
|
+
});
|
|
428
|
+
export const RecoveryCodesBody = Schema.Struct({
|
|
429
|
+
codes: Schema.Array(RecoveryCodeHttpBody),
|
|
430
|
+
});
|
|
431
|
+
export const ApiKeyCreateBody = Schema.Struct({
|
|
432
|
+
scopes: Schema.optional(Schema.Array(Schema.String)),
|
|
433
|
+
expiresAt: Schema.optional(UnixMillisSchema),
|
|
434
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
435
|
+
});
|
|
436
|
+
export const ApiKeyRevokeBody = Schema.Struct({
|
|
437
|
+
keyId: Schema.String,
|
|
438
|
+
reason: Schema.optional(Schema.String),
|
|
439
|
+
});
|
|
440
|
+
export const ApiKeyHttpBody = Schema.Struct({
|
|
441
|
+
keyId: Schema.String,
|
|
442
|
+
prefix: Schema.String,
|
|
443
|
+
scopes: Schema.Array(Schema.String),
|
|
444
|
+
createdAt: UnixMillisSchema,
|
|
445
|
+
expiresAt: Schema.optional(UnixMillisSchema),
|
|
446
|
+
lastUsedAt: Schema.optional(UnixMillisSchema),
|
|
447
|
+
revokedAt: Schema.optional(UnixMillisSchema),
|
|
448
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
449
|
+
});
|
|
450
|
+
export const ApiKeyCreatedBody = Schema.Struct({
|
|
451
|
+
secret: Schema.String,
|
|
452
|
+
key: ApiKeyHttpBody,
|
|
453
|
+
});
|
|
454
|
+
export const ApiKeysBody = Schema.Struct({
|
|
455
|
+
keys: Schema.Array(ApiKeyHttpBody),
|
|
456
|
+
});
|
|
457
|
+
export const RefreshTokenRefreshBody = Schema.Struct({
|
|
458
|
+
refreshToken: Schema.String,
|
|
459
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
460
|
+
});
|
|
461
|
+
export const RefreshTokenHttpBody = Schema.Struct({
|
|
462
|
+
tokenId: Schema.String,
|
|
463
|
+
familyId: Schema.String,
|
|
464
|
+
createdAt: UnixMillisSchema,
|
|
465
|
+
expiresAt: UnixMillisSchema,
|
|
466
|
+
lastUsedAt: Schema.optional(UnixMillisSchema),
|
|
467
|
+
rotatedAt: Schema.optional(UnixMillisSchema),
|
|
468
|
+
replacedById: Schema.optional(Schema.String),
|
|
469
|
+
revokedAt: Schema.optional(UnixMillisSchema),
|
|
470
|
+
reuseDetectedAt: Schema.optional(UnixMillisSchema),
|
|
471
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
472
|
+
});
|
|
473
|
+
export const RefreshTokenRefreshedBody = Schema.Struct({
|
|
474
|
+
accessToken: Schema.String,
|
|
475
|
+
accessTokenExpiresAt: Schema.optional(UnixMillisSchema),
|
|
476
|
+
refreshToken: Schema.String,
|
|
477
|
+
refreshTokenRecord: RefreshTokenHttpBody,
|
|
478
|
+
});
|
|
479
|
+
export const JwtIntrospectBody = Schema.Struct({
|
|
480
|
+
token: Schema.String,
|
|
481
|
+
});
|
|
482
|
+
export const JwtRevokeBody = Schema.Struct({
|
|
483
|
+
jwtId: Schema.String,
|
|
484
|
+
expiresAt: Schema.optional(UnixMillisSchema),
|
|
485
|
+
reason: Schema.optional(Schema.String),
|
|
486
|
+
});
|
|
487
|
+
export const JwtPublicJwkBody = Schema.Record(Schema.String, Schema.Unknown);
|
|
488
|
+
export const JwtJwksBody = Schema.Struct({
|
|
489
|
+
keys: Schema.Array(JwtPublicJwkBody),
|
|
490
|
+
});
|
|
491
|
+
export const OidcDiscoveryMetadataBody = Schema.Struct({
|
|
492
|
+
issuer: Schema.String,
|
|
493
|
+
authorization_endpoint: Schema.String,
|
|
494
|
+
token_endpoint: Schema.String,
|
|
495
|
+
jwks_uri: Schema.String,
|
|
496
|
+
response_types_supported: Schema.Array(Schema.String),
|
|
497
|
+
subject_types_supported: Schema.Array(Schema.String),
|
|
498
|
+
id_token_signing_alg_values_supported: Schema.Array(Schema.String),
|
|
499
|
+
scopes_supported: Schema.optional(Schema.Array(Schema.String)),
|
|
500
|
+
claims_supported: Schema.optional(Schema.Array(Schema.String)),
|
|
501
|
+
grant_types_supported: Schema.optional(Schema.Array(Schema.String)),
|
|
502
|
+
token_endpoint_auth_methods_supported: Schema.optional(Schema.Array(Schema.String)),
|
|
503
|
+
introspection_endpoint_auth_methods_supported: Schema.optional(Schema.Array(Schema.String)),
|
|
504
|
+
code_challenge_methods_supported: Schema.optional(Schema.Array(Schema.String)),
|
|
505
|
+
userinfo_endpoint: Schema.optional(Schema.String),
|
|
506
|
+
end_session_endpoint: Schema.optional(Schema.String),
|
|
507
|
+
introspection_endpoint: Schema.optional(Schema.String),
|
|
508
|
+
revocation_endpoint: Schema.optional(Schema.String),
|
|
509
|
+
revocation_endpoint_auth_methods_supported: Schema.optional(Schema.Array(Schema.String)),
|
|
510
|
+
});
|
|
511
|
+
export const JwtHeaderHttpBody = Schema.Struct({
|
|
512
|
+
typ: Schema.Literal("JWT"),
|
|
513
|
+
alg: Schema.Literals(["HS256", "RS256", "ES256", "EdDSA"]),
|
|
514
|
+
kid: Schema.String,
|
|
515
|
+
});
|
|
516
|
+
export const JwtKeyHttpBody = Schema.Struct({
|
|
517
|
+
keyId: Schema.String,
|
|
518
|
+
alg: Schema.Literals(["HS256", "RS256", "ES256", "EdDSA"]),
|
|
519
|
+
status: Schema.Literals(["active", "retired", "disabled"]),
|
|
520
|
+
createdAt: Schema.optional(UnixMillisSchema),
|
|
521
|
+
expiresAt: Schema.optional(UnixMillisSchema),
|
|
522
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
523
|
+
});
|
|
524
|
+
export const JwtIntrospectionInactiveReasonBody = Schema.Literals([
|
|
525
|
+
"malformed",
|
|
526
|
+
"unsupported_alg",
|
|
527
|
+
"unknown_key",
|
|
528
|
+
"invalid_signature",
|
|
529
|
+
"expired",
|
|
530
|
+
"not_yet_valid",
|
|
531
|
+
"issuer_mismatch",
|
|
532
|
+
"audience_mismatch",
|
|
533
|
+
"revoked",
|
|
534
|
+
]);
|
|
535
|
+
export const JwtIntrospectionActiveBody = Schema.Struct({
|
|
536
|
+
active: Schema.Literal(true),
|
|
537
|
+
header: JwtHeaderHttpBody,
|
|
538
|
+
claims: Schema.Record(Schema.String, Schema.Unknown),
|
|
539
|
+
key: JwtKeyHttpBody,
|
|
540
|
+
jwtId: Schema.optional(Schema.String),
|
|
541
|
+
expiresAt: Schema.optional(UnixMillisSchema),
|
|
542
|
+
revoked: Schema.Literal(false),
|
|
543
|
+
});
|
|
544
|
+
export const JwtIntrospectionInactiveBody = Schema.Struct({
|
|
545
|
+
active: Schema.Literal(false),
|
|
546
|
+
reason: JwtIntrospectionInactiveReasonBody,
|
|
547
|
+
jwtId: Schema.optional(Schema.String),
|
|
548
|
+
expiresAt: Schema.optional(UnixMillisSchema),
|
|
549
|
+
revokedAt: Schema.optional(UnixMillisSchema),
|
|
550
|
+
revokedReason: Schema.optional(Schema.String),
|
|
551
|
+
});
|
|
552
|
+
export const JwtIntrospectionBody = Schema.Union([
|
|
553
|
+
JwtIntrospectionActiveBody,
|
|
554
|
+
JwtIntrospectionInactiveBody
|
|
555
|
+
]);
|
|
556
|
+
export const MfaOptionsBody = Schema.Struct({
|
|
557
|
+
flowId: AuthFlowIdSchema,
|
|
558
|
+
});
|
|
559
|
+
export const MfaFactorOptionBody = Schema.Struct({
|
|
560
|
+
type: Schema.Literals(["totp", "backup-code", "passkey"]),
|
|
561
|
+
});
|
|
562
|
+
export const MfaOptionsResultBody = Schema.Struct({
|
|
563
|
+
factors: Schema.Array(MfaFactorOptionBody),
|
|
564
|
+
});
|
|
565
|
+
export const StepUpFactorOptionBody = Schema.Struct({
|
|
566
|
+
type: Schema.Literals(["totp", "backup-code", "passkey"]),
|
|
567
|
+
});
|
|
568
|
+
export const StepUpOptionsResultBody = Schema.Struct({
|
|
569
|
+
factors: Schema.Array(StepUpFactorOptionBody),
|
|
570
|
+
});
|
|
571
|
+
export const StepUpTotpVerifyBody = Schema.Struct({
|
|
572
|
+
code: Schema.String,
|
|
573
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
574
|
+
});
|
|
575
|
+
export const StepUpRecoveryCodeVerifyBody = Schema.Struct({
|
|
576
|
+
code: Schema.String,
|
|
577
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
578
|
+
});
|
|
579
|
+
export const StepUpPasskeyStartBody = Schema.Struct({
|
|
580
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
581
|
+
});
|
|
582
|
+
export const StepUpPasskeyVerifyBody = Schema.Struct({
|
|
583
|
+
challengeId: ChallengeIdSchema,
|
|
584
|
+
credential: PasskeyClientCredentialBody,
|
|
585
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
586
|
+
});
|
|
587
|
+
export const TotpMfaVerifyBody = Schema.Struct({
|
|
588
|
+
flowId: AuthFlowIdSchema,
|
|
589
|
+
userId: UserIdSchema,
|
|
590
|
+
code: Schema.String,
|
|
591
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
592
|
+
});
|
|
593
|
+
export const TotpMfaVerifyForFlowBody = Schema.Struct({
|
|
594
|
+
flowId: AuthFlowIdSchema,
|
|
595
|
+
code: Schema.String,
|
|
596
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
597
|
+
});
|
|
598
|
+
export const RecoveryCodeMfaVerifyBody = Schema.Struct({
|
|
599
|
+
flowId: AuthFlowIdSchema,
|
|
600
|
+
userId: UserIdSchema,
|
|
601
|
+
code: Schema.String,
|
|
602
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
603
|
+
});
|
|
604
|
+
export const RecoveryCodeMfaVerifyForFlowBody = Schema.Struct({
|
|
605
|
+
flowId: AuthFlowIdSchema,
|
|
606
|
+
code: Schema.String,
|
|
607
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
608
|
+
});
|
|
609
|
+
export const LoginApprovalApproveBody = Schema.Struct({
|
|
610
|
+
flowId: AuthFlowIdSchema,
|
|
611
|
+
approvalChallengeId: ChallengeIdSchema,
|
|
612
|
+
secret: Schema.optional(Schema.String),
|
|
613
|
+
rememberDevice: Schema.optional(Schema.Boolean),
|
|
614
|
+
});
|
|
615
|
+
export const LoginApprovalReviewStatusBody = Schema.Struct({
|
|
616
|
+
flowId: AuthFlowIdSchema,
|
|
617
|
+
approvalChallengeId: ChallengeIdSchema,
|
|
618
|
+
});
|
|
619
|
+
export const LoginApprovalFinalizeBody = Schema.Struct({
|
|
620
|
+
flowId: AuthFlowIdSchema,
|
|
621
|
+
approvalChallengeId: ChallengeIdSchema,
|
|
622
|
+
rememberDevice: Schema.optional(Schema.Boolean),
|
|
623
|
+
});
|
|
624
|
+
export const SessionClaimsHttpBody = Schema.Struct({
|
|
625
|
+
emailVerified: Schema.optional(Schema.Boolean),
|
|
626
|
+
requirements: Schema.optional(Schema.Array(Schema.String)),
|
|
627
|
+
});
|
|
628
|
+
export const AuthenticatedHttpBody = Schema.Struct({
|
|
629
|
+
type: Schema.Literal("authenticated"),
|
|
630
|
+
expiresAt: Schema.Number,
|
|
631
|
+
aal: Schema.Literals(["aal1", "aal2", "aal3"]),
|
|
632
|
+
amr: Schema.Array(Schema.String),
|
|
633
|
+
mfaVerifiedAt: Schema.optional(UnixMillisSchema),
|
|
634
|
+
claims: Schema.optional(SessionClaimsHttpBody),
|
|
635
|
+
});
|
|
636
|
+
export const CurrentSessionHttpBody = Schema.Struct({
|
|
637
|
+
type: Schema.Literal("authenticated"),
|
|
638
|
+
userId: Schema.String,
|
|
639
|
+
sessionId: Schema.String,
|
|
640
|
+
authTime: Schema.Number,
|
|
641
|
+
expiresAt: Schema.Number,
|
|
642
|
+
aal: Schema.Literals(["aal1", "aal2", "aal3"]),
|
|
643
|
+
amr: Schema.Array(Schema.String),
|
|
644
|
+
mfaVerifiedAt: Schema.optional(UnixMillisSchema),
|
|
645
|
+
claims: Schema.optional(SessionClaimsHttpBody),
|
|
646
|
+
});
|
|
647
|
+
export const ActiveSessionHttpBody = Schema.Struct({
|
|
648
|
+
sessionId: SessionIdSchema,
|
|
649
|
+
userId: UserIdSchema,
|
|
650
|
+
createdAt: UnixMillisSchema,
|
|
651
|
+
authTime: UnixMillisSchema,
|
|
652
|
+
lastSeenAt: Schema.optional(UnixMillisSchema),
|
|
653
|
+
expiresAt: UnixMillisSchema,
|
|
654
|
+
aal: Schema.Literals(["aal1", "aal2", "aal3"]),
|
|
655
|
+
amr: Schema.Array(Schema.String),
|
|
656
|
+
mfaVerifiedAt: Schema.optional(UnixMillisSchema),
|
|
657
|
+
current: Schema.Boolean,
|
|
658
|
+
claims: Schema.optional(SessionClaimsHttpBody),
|
|
659
|
+
ip: Schema.optional(Schema.String),
|
|
660
|
+
userAgent: Schema.optional(Schema.String),
|
|
661
|
+
country: Schema.optional(Schema.String),
|
|
662
|
+
region: Schema.optional(Schema.String),
|
|
663
|
+
city: Schema.optional(Schema.String),
|
|
664
|
+
latitude: Schema.optional(Schema.Number),
|
|
665
|
+
longitude: Schema.optional(Schema.Number),
|
|
666
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
667
|
+
});
|
|
668
|
+
export const ActiveSessionsHttpBody = Schema.Struct({
|
|
669
|
+
sessions: Schema.Array(ActiveSessionHttpBody),
|
|
670
|
+
});
|
|
671
|
+
export const SessionRevokeBody = Schema.Struct({
|
|
672
|
+
sessionId: SessionIdSchema,
|
|
673
|
+
});
|
|
674
|
+
export const AdminSessionHttpBody = Schema.Struct({
|
|
675
|
+
sessionId: SessionIdSchema,
|
|
676
|
+
userId: UserIdSchema,
|
|
677
|
+
createdAt: UnixMillisSchema,
|
|
678
|
+
authTime: UnixMillisSchema,
|
|
679
|
+
lastSeenAt: Schema.optional(UnixMillisSchema),
|
|
680
|
+
expiresAt: UnixMillisSchema,
|
|
681
|
+
aal: Schema.Literals(["aal1", "aal2", "aal3"]),
|
|
682
|
+
amr: Schema.Array(Schema.String),
|
|
683
|
+
mfaVerifiedAt: Schema.optional(UnixMillisSchema),
|
|
684
|
+
ip: Schema.optional(Schema.String),
|
|
685
|
+
userAgent: Schema.optional(Schema.String),
|
|
686
|
+
country: Schema.optional(Schema.String),
|
|
687
|
+
region: Schema.optional(Schema.String),
|
|
688
|
+
city: Schema.optional(Schema.String),
|
|
689
|
+
latitude: Schema.optional(Schema.Number),
|
|
690
|
+
longitude: Schema.optional(Schema.Number),
|
|
691
|
+
});
|
|
692
|
+
export const AdminSessionsHttpBody = Schema.Struct({
|
|
693
|
+
sessions: Schema.Array(AdminSessionHttpBody),
|
|
694
|
+
});
|
|
695
|
+
export const AdminSessionListQuery = Schema.Struct({
|
|
696
|
+
userId: UserIdSchema,
|
|
697
|
+
});
|
|
698
|
+
export const AdminSessionRevokeBody = Schema.Struct({
|
|
699
|
+
userId: UserIdSchema,
|
|
700
|
+
sessionId: SessionIdSchema,
|
|
701
|
+
});
|
|
702
|
+
export const AdminSessionRevokeAllBody = Schema.Struct({
|
|
703
|
+
userId: UserIdSchema,
|
|
704
|
+
});
|
|
705
|
+
export const LoginNotificationReportBody = Schema.Struct({
|
|
706
|
+
challengeId: ChallengeIdSchema,
|
|
707
|
+
secret: Schema.String,
|
|
708
|
+
});
|
|
709
|
+
export const SecurityTimelineEventTypeBody = Schema.Literals([
|
|
710
|
+
"auth.login.succeeded",
|
|
711
|
+
"auth.login.failed",
|
|
712
|
+
"auth.session.revoked",
|
|
713
|
+
"auth.risk.assessed",
|
|
714
|
+
"auth.policy.denied",
|
|
715
|
+
"auth.oauth.account.linked",
|
|
716
|
+
"auth.oauth.account.unlinked",
|
|
717
|
+
"auth.oauth.link_confirmation.started",
|
|
718
|
+
"auth.oauth.link_confirmation.confirmed",
|
|
719
|
+
"auth.oauth.provider_token.refreshed",
|
|
720
|
+
"auth.oauth.provider_token.revoked",
|
|
721
|
+
"auth.passkey.credential.revoked",
|
|
722
|
+
"auth.totp.enrollment.started",
|
|
723
|
+
"auth.totp.factor.confirmed",
|
|
724
|
+
"auth.totp.factor.verified",
|
|
725
|
+
"auth.totp.factor.revoked",
|
|
726
|
+
"auth.recovery_code.generated",
|
|
727
|
+
"auth.recovery_code.verified",
|
|
728
|
+
"auth.recovery_code.revoked",
|
|
729
|
+
"auth.api_key.created",
|
|
730
|
+
"auth.api_key.verified",
|
|
731
|
+
"auth.api_key.revoked",
|
|
732
|
+
"auth.api_key.verification_failed",
|
|
733
|
+
"auth.refresh_token.issued",
|
|
734
|
+
"auth.refresh_token.rotated",
|
|
735
|
+
"auth.refresh_token.reuse_detected",
|
|
736
|
+
"auth.refresh_token.revoked",
|
|
737
|
+
"auth.incident_action.executed",
|
|
738
|
+
"auth.jwt.introspected",
|
|
739
|
+
"auth.jwt.revoked",
|
|
740
|
+
]);
|
|
741
|
+
export const SecurityTimelineEventCategoryBody = Schema.Literals([
|
|
742
|
+
"api_key",
|
|
743
|
+
"auth",
|
|
744
|
+
"incident",
|
|
745
|
+
"jwt",
|
|
746
|
+
"mfa",
|
|
747
|
+
"oauth",
|
|
748
|
+
"policy",
|
|
749
|
+
"refresh_token",
|
|
750
|
+
"risk",
|
|
751
|
+
"session",
|
|
752
|
+
]);
|
|
753
|
+
export const SecurityTimelineEventSeverityBody = Schema.Literals([
|
|
754
|
+
"info",
|
|
755
|
+
"warning",
|
|
756
|
+
"critical",
|
|
757
|
+
]);
|
|
758
|
+
export const SecurityTimelineActorBody = Schema.Union([
|
|
759
|
+
Schema.Struct({
|
|
760
|
+
type: Schema.Literal("anonymous"),
|
|
761
|
+
}),
|
|
762
|
+
Schema.Struct({
|
|
763
|
+
type: Schema.Literal("user"),
|
|
764
|
+
sessionId: Schema.optional(SessionIdSchema),
|
|
765
|
+
}),
|
|
766
|
+
]);
|
|
767
|
+
export const SecurityTimelineRequestBody = Schema.Struct({
|
|
768
|
+
ipHash: Schema.optional(Schema.String),
|
|
769
|
+
userAgentHash: Schema.optional(Schema.String),
|
|
770
|
+
});
|
|
771
|
+
export const SecurityTimelineEventBody = Schema.Struct({
|
|
772
|
+
eventId: Schema.String,
|
|
773
|
+
type: SecurityTimelineEventTypeBody,
|
|
774
|
+
category: SecurityTimelineEventCategoryBody,
|
|
775
|
+
severity: SecurityTimelineEventSeverityBody,
|
|
776
|
+
occurredAt: UnixMillisSchema,
|
|
777
|
+
summary: Schema.String,
|
|
778
|
+
actor: Schema.optional(SecurityTimelineActorBody),
|
|
779
|
+
request: Schema.optional(SecurityTimelineRequestBody),
|
|
780
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
781
|
+
});
|
|
782
|
+
export const SecurityTimelineEventsBody = Schema.Struct({
|
|
783
|
+
events: Schema.Array(SecurityTimelineEventBody),
|
|
784
|
+
});
|
|
785
|
+
export const SecurityTimelineListQuery = Schema.Struct({
|
|
786
|
+
limit: Schema.optional(Schema.Number),
|
|
787
|
+
beforeOccurredAt: Schema.optional(UnixMillisSchema),
|
|
788
|
+
types: Schema.optional(Schema.Array(SecurityTimelineEventTypeBody)),
|
|
789
|
+
categories: Schema.optional(Schema.Array(SecurityTimelineEventCategoryBody)),
|
|
790
|
+
});
|
|
791
|
+
export const AdminSecurityTimelineListQuery = Schema.Struct({
|
|
792
|
+
userId: UserIdSchema,
|
|
793
|
+
limit: Schema.optional(Schema.Number),
|
|
794
|
+
beforeOccurredAt: Schema.optional(UnixMillisSchema),
|
|
795
|
+
types: Schema.optional(Schema.Array(SecurityTimelineEventTypeBody)),
|
|
796
|
+
categories: Schema.optional(Schema.Array(SecurityTimelineEventCategoryBody)),
|
|
797
|
+
});
|
|
798
|
+
export const TrustedDeviceHttpBody = Schema.Struct({
|
|
799
|
+
deviceId: Schema.String,
|
|
800
|
+
createdAt: UnixMillisSchema,
|
|
801
|
+
lastSeenAt: UnixMillisSchema,
|
|
802
|
+
expiresAt: UnixMillisSchema,
|
|
803
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
804
|
+
});
|
|
805
|
+
export const TrustedDevicesBody = Schema.Struct({
|
|
806
|
+
devices: Schema.Array(TrustedDeviceHttpBody),
|
|
807
|
+
});
|
|
808
|
+
export const TrustedDeviceRevokeBody = Schema.Struct({
|
|
809
|
+
deviceId: Schema.String,
|
|
810
|
+
});
|
|
811
|
+
export const AdminTrustedDeviceListQuery = Schema.Struct({
|
|
812
|
+
userId: UserIdSchema,
|
|
813
|
+
});
|
|
814
|
+
export const AdminTrustedDeviceRevokeBody = Schema.Struct({
|
|
815
|
+
userId: UserIdSchema,
|
|
816
|
+
deviceId: Schema.String,
|
|
817
|
+
});
|
|
818
|
+
export const RequiresMfaHttpBody = Schema.Struct({
|
|
819
|
+
type: Schema.Literal("requires_mfa"),
|
|
820
|
+
flowId: Schema.String,
|
|
821
|
+
factors: Schema.Array(Schema.Struct({ type: Schema.String })),
|
|
822
|
+
});
|
|
823
|
+
export const RequiresEmailVerificationHttpBody = Schema.Struct({
|
|
824
|
+
type: Schema.Literal("requires_email_verification"),
|
|
825
|
+
flowId: Schema.String,
|
|
826
|
+
});
|
|
827
|
+
export const RequiresLoginApprovalHttpBody = Schema.Struct({
|
|
828
|
+
type: Schema.Literal("requires_login_approval"),
|
|
829
|
+
flowId: Schema.String,
|
|
830
|
+
approvalChallengeId: Schema.String,
|
|
831
|
+
channel: Schema.String,
|
|
832
|
+
sessionBinding: Schema.Literals([
|
|
833
|
+
"originating-device",
|
|
834
|
+
"approval-device",
|
|
835
|
+
"none",
|
|
836
|
+
]),
|
|
837
|
+
sameDeviceRequired: Schema.Boolean,
|
|
838
|
+
reason: Schema.String,
|
|
839
|
+
});
|
|
840
|
+
export const LoginApprovalReviewStatusHttpBody = Schema.Struct({
|
|
841
|
+
status: Schema.Literals([
|
|
842
|
+
"pending",
|
|
843
|
+
"approved",
|
|
844
|
+
"denied",
|
|
845
|
+
"expired",
|
|
846
|
+
]),
|
|
847
|
+
expiresAt: UnixMillisSchema,
|
|
848
|
+
});
|
|
849
|
+
export const RequiresPasskeyEnrollmentHttpBody = Schema.Struct({
|
|
850
|
+
type: Schema.Literal("requires_passkey_enrollment"),
|
|
851
|
+
flowId: Schema.String,
|
|
852
|
+
});
|
|
853
|
+
export const PasswordAuthSuccess = Schema.Union([
|
|
854
|
+
AuthenticatedHttpBody,
|
|
855
|
+
RequiresMfaHttpBody,
|
|
856
|
+
RequiresEmailVerificationHttpBody,
|
|
857
|
+
RequiresLoginApprovalHttpBody,
|
|
858
|
+
RequiresPasskeyEnrollmentHttpBody,
|
|
859
|
+
]);
|
|
860
|
+
export const EmailOtpAuthSuccess = PasswordAuthSuccess;
|
|
861
|
+
export const MagicLinkAuthSuccess = PasswordAuthSuccess;
|
|
862
|
+
//# sourceMappingURL=Schemas.js.map
|