@smartcrab/contracts-public 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/dist/association-files.d.ts +46 -0
- package/dist/association-files.js +32 -0
- package/dist/config.d.ts +57 -0
- package/dist/config.js +38 -0
- package/dist/email.d.ts +55 -0
- package/dist/email.js +39 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/me.d.ts +297 -0
- package/dist/me.js +140 -0
- package/dist/oidc.d.ts +239 -0
- package/dist/oidc.js +230 -0
- package/dist/outcome.d.ts +19 -0
- package/dist/outcome.js +2 -0
- package/dist/passkeys.d.ts +257 -0
- package/dist/passkeys.js +162 -0
- package/dist/primitives.d.ts +60 -0
- package/dist/primitives.js +52 -0
- package/dist/redirect-uri.d.ts +25 -0
- package/dist/redirect-uri.js +39 -0
- package/dist/scopes.d.ts +30 -0
- package/dist/scopes.js +46 -0
- package/dist/social.d.ts +44 -0
- package/dist/social.js +35 -0
- package/dist/transaction-status.d.ts +53 -0
- package/dist/transaction-status.js +37 -0
- package/dist/transactions.d.ts +144 -0
- package/dist/transactions.js +103 -0
- package/package.json +43 -0
- package/src/association-files.test.ts +71 -0
- package/src/association-files.ts +46 -0
- package/src/config.test.ts +66 -0
- package/src/config.ts +62 -0
- package/src/email.test.ts +40 -0
- package/src/email.ts +50 -0
- package/src/index.ts +23 -0
- package/src/me.test.ts +116 -0
- package/src/me.ts +223 -0
- package/src/oidc.test.ts +224 -0
- package/src/oidc.ts +296 -0
- package/src/outcome.ts +17 -0
- package/src/passkeys.test.ts +80 -0
- package/src/passkeys.ts +218 -0
- package/src/primitives.ts +79 -0
- package/src/redirect-uri.test.ts +118 -0
- package/src/redirect-uri.ts +86 -0
- package/src/scopes.test.ts +51 -0
- package/src/scopes.ts +63 -0
- package/src/social.test.ts +34 -0
- package/src/social.ts +43 -0
- package/src/transaction-status.ts +44 -0
- package/src/transactions.test.ts +153 -0
- package/src/transactions.ts +129 -0
package/dist/me.d.ts
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The authenticated self-service surface (design.md §16.2 route list). All
|
|
4
|
+
* responses here project persisted rows (design.md §12.1-§12.5) minus
|
|
5
|
+
* internal/sensitive columns (`security_version`, `metadata_json`,
|
|
6
|
+
* `credential_id`, `public_key`, `sign_count`, token ciphertexts, hashes).
|
|
7
|
+
*/
|
|
8
|
+
export declare const USER_STATUSES: readonly ["active", "blocked", "pending_deletion"];
|
|
9
|
+
export declare const userStatusSchema: z.ZodEnum<{
|
|
10
|
+
active: "active";
|
|
11
|
+
blocked: "blocked";
|
|
12
|
+
pending_deletion: "pending_deletion";
|
|
13
|
+
}>;
|
|
14
|
+
export type UserStatus = (typeof USER_STATUSES)[number];
|
|
15
|
+
export declare const meUserSchema: z.ZodObject<{
|
|
16
|
+
user_id: z.ZodString;
|
|
17
|
+
email: z.ZodNullable<z.ZodEmail>;
|
|
18
|
+
email_verified: z.ZodBoolean;
|
|
19
|
+
name: z.ZodNullable<z.ZodString>;
|
|
20
|
+
avatar_url: z.ZodNullable<z.ZodURL>;
|
|
21
|
+
locale: z.ZodNullable<z.ZodString>;
|
|
22
|
+
timezone: z.ZodNullable<z.ZodString>;
|
|
23
|
+
status: z.ZodEnum<{
|
|
24
|
+
active: "active";
|
|
25
|
+
blocked: "blocked";
|
|
26
|
+
pending_deletion: "pending_deletion";
|
|
27
|
+
}>;
|
|
28
|
+
created_at: z.ZodISODateTime;
|
|
29
|
+
last_login_at: z.ZodNullable<z.ZodISODateTime>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type MeUser = z.infer<typeof meUserSchema>;
|
|
32
|
+
/**
|
|
33
|
+
* Email is intentionally excluded: changing it goes through
|
|
34
|
+
* `POST /v1/me/email/change/start` (dual old/new-email verification,
|
|
35
|
+
* design.md §25), never a direct `PATCH`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const meUpdateRequestSchema: z.ZodObject<{
|
|
38
|
+
name: z.ZodOptional<z.ZodString>;
|
|
39
|
+
avatar_url: z.ZodOptional<z.ZodURL>;
|
|
40
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
41
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export type MeUpdateRequest = z.infer<typeof meUpdateRequestSchema>;
|
|
44
|
+
/** `PATCH /v1/me` returns the updated profile, same shape as `GET /v1/me`. */
|
|
45
|
+
export declare const meUpdateResponseSchema: z.ZodObject<{
|
|
46
|
+
user_id: z.ZodString;
|
|
47
|
+
email: z.ZodNullable<z.ZodEmail>;
|
|
48
|
+
email_verified: z.ZodBoolean;
|
|
49
|
+
name: z.ZodNullable<z.ZodString>;
|
|
50
|
+
avatar_url: z.ZodNullable<z.ZodURL>;
|
|
51
|
+
locale: z.ZodNullable<z.ZodString>;
|
|
52
|
+
timezone: z.ZodNullable<z.ZodString>;
|
|
53
|
+
status: z.ZodEnum<{
|
|
54
|
+
active: "active";
|
|
55
|
+
blocked: "blocked";
|
|
56
|
+
pending_deletion: "pending_deletion";
|
|
57
|
+
}>;
|
|
58
|
+
created_at: z.ZodISODateTime;
|
|
59
|
+
last_login_at: z.ZodNullable<z.ZodISODateTime>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type MeUpdateResponse = z.infer<typeof meUpdateResponseSchema>;
|
|
62
|
+
export declare const mePasskeysListResponseSchema: z.ZodObject<{
|
|
63
|
+
passkeys: z.ZodArray<z.ZodObject<{
|
|
64
|
+
passkey_id: z.ZodString;
|
|
65
|
+
name: z.ZodNullable<z.ZodString>;
|
|
66
|
+
created_at: z.ZodISODateTime;
|
|
67
|
+
last_used_at: z.ZodNullable<z.ZodISODateTime>;
|
|
68
|
+
device_type: z.ZodNullable<z.ZodEnum<{
|
|
69
|
+
single_device: "single_device";
|
|
70
|
+
multi_device: "multi_device";
|
|
71
|
+
}>>;
|
|
72
|
+
backed_up: z.ZodBoolean;
|
|
73
|
+
transports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
74
|
+
ble: "ble";
|
|
75
|
+
hybrid: "hybrid";
|
|
76
|
+
internal: "internal";
|
|
77
|
+
nfc: "nfc";
|
|
78
|
+
usb: "usb";
|
|
79
|
+
}>>>;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
export type MePasskeysListResponse = z.infer<typeof mePasskeysListResponseSchema>;
|
|
83
|
+
/** Registration options depend on the session's user; only the RP ID may be named (design.md §8.3). */
|
|
84
|
+
export declare const mePasskeyRegistrationOptionsRequestSchema: z.ZodObject<{
|
|
85
|
+
rp_id: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
export type MePasskeyRegistrationOptionsRequest = z.infer<typeof mePasskeyRegistrationOptionsRequestSchema>;
|
|
88
|
+
/** Same fixed WebAuthn configuration as the transaction-scoped registration options (design.md §17.1). */
|
|
89
|
+
export declare const mePasskeyRegistrationOptionsResponseSchema: z.ZodObject<{
|
|
90
|
+
rp: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
user: z.ZodObject<{
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
displayName: z.ZodString;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
challenge: z.ZodString;
|
|
100
|
+
pubKeyCredParams: z.ZodArray<z.ZodObject<{
|
|
101
|
+
type: z.ZodLiteral<"public-key">;
|
|
102
|
+
alg: z.ZodNumber;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
excludeCredentials: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
type: z.ZodLiteral<"public-key">;
|
|
108
|
+
transports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
109
|
+
ble: "ble";
|
|
110
|
+
hybrid: "hybrid";
|
|
111
|
+
internal: "internal";
|
|
112
|
+
nfc: "nfc";
|
|
113
|
+
usb: "usb";
|
|
114
|
+
}>>>;
|
|
115
|
+
}, z.core.$strict>>>;
|
|
116
|
+
authenticatorSelection: z.ZodObject<{
|
|
117
|
+
authenticatorAttachment: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
platform: "platform";
|
|
119
|
+
"cross-platform": "cross-platform";
|
|
120
|
+
}>>;
|
|
121
|
+
residentKey: z.ZodLiteral<"required">;
|
|
122
|
+
userVerification: z.ZodLiteral<"required">;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
attestation: z.ZodLiteral<"none">;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
export type MePasskeyRegistrationOptionsResponse = z.infer<typeof mePasskeyRegistrationOptionsResponseSchema>;
|
|
127
|
+
/** Same shape as the transaction-scoped credential + optional label (design.md §17.1). */
|
|
128
|
+
export declare const mePasskeyRegistrationVerifyRequestSchema: z.ZodObject<{
|
|
129
|
+
credential: z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
rawId: z.ZodString;
|
|
132
|
+
type: z.ZodLiteral<"public-key">;
|
|
133
|
+
response: z.ZodObject<{
|
|
134
|
+
clientDataJSON: z.ZodString;
|
|
135
|
+
attestationObject: z.ZodString;
|
|
136
|
+
transports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
137
|
+
ble: "ble";
|
|
138
|
+
hybrid: "hybrid";
|
|
139
|
+
internal: "internal";
|
|
140
|
+
nfc: "nfc";
|
|
141
|
+
usb: "usb";
|
|
142
|
+
}>>>;
|
|
143
|
+
publicKeyAlgorithm: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
publicKey: z.ZodOptional<z.ZodString>;
|
|
145
|
+
authenticatorData: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
authenticatorAttachment: z.ZodOptional<z.ZodEnum<{
|
|
148
|
+
platform: "platform";
|
|
149
|
+
"cross-platform": "cross-platform";
|
|
150
|
+
}>>;
|
|
151
|
+
clientExtensionResults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
name: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strict>;
|
|
155
|
+
export type MePasskeyRegistrationVerifyRequest = z.infer<typeof mePasskeyRegistrationVerifyRequestSchema>;
|
|
156
|
+
export declare const mePasskeyRegistrationVerifyResponseSchema: z.ZodObject<{
|
|
157
|
+
passkey: z.ZodObject<{
|
|
158
|
+
passkey_id: z.ZodString;
|
|
159
|
+
name: z.ZodNullable<z.ZodString>;
|
|
160
|
+
created_at: z.ZodISODateTime;
|
|
161
|
+
last_used_at: z.ZodNullable<z.ZodISODateTime>;
|
|
162
|
+
device_type: z.ZodNullable<z.ZodEnum<{
|
|
163
|
+
single_device: "single_device";
|
|
164
|
+
multi_device: "multi_device";
|
|
165
|
+
}>>;
|
|
166
|
+
backed_up: z.ZodBoolean;
|
|
167
|
+
transports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
168
|
+
ble: "ble";
|
|
169
|
+
hybrid: "hybrid";
|
|
170
|
+
internal: "internal";
|
|
171
|
+
nfc: "nfc";
|
|
172
|
+
usb: "usb";
|
|
173
|
+
}>>>;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
export type MePasskeyRegistrationVerifyResponse = z.infer<typeof mePasskeyRegistrationVerifyResponseSchema>;
|
|
177
|
+
export declare const mePasskeyDeleteResponseSchema: z.ZodObject<{
|
|
178
|
+
passkey_id: z.ZodString;
|
|
179
|
+
deleted: z.ZodLiteral<true>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
export type MePasskeyDeleteResponse = z.infer<typeof mePasskeyDeleteResponseSchema>;
|
|
182
|
+
export declare const meIdentitySummarySchema: z.ZodObject<{
|
|
183
|
+
identity_id: z.ZodString;
|
|
184
|
+
provider: z.ZodEnum<{
|
|
185
|
+
google: "google";
|
|
186
|
+
apple: "apple";
|
|
187
|
+
github: "github";
|
|
188
|
+
microsoft: "microsoft";
|
|
189
|
+
generic_oidc: "generic_oidc";
|
|
190
|
+
}>;
|
|
191
|
+
linked_at: z.ZodISODateTime;
|
|
192
|
+
last_used_at: z.ZodNullable<z.ZodISODateTime>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
export type MeIdentitySummary = z.infer<typeof meIdentitySummarySchema>;
|
|
195
|
+
export declare const meIdentitiesListResponseSchema: z.ZodObject<{
|
|
196
|
+
identities: z.ZodArray<z.ZodObject<{
|
|
197
|
+
identity_id: z.ZodString;
|
|
198
|
+
provider: z.ZodEnum<{
|
|
199
|
+
google: "google";
|
|
200
|
+
apple: "apple";
|
|
201
|
+
github: "github";
|
|
202
|
+
microsoft: "microsoft";
|
|
203
|
+
generic_oidc: "generic_oidc";
|
|
204
|
+
}>;
|
|
205
|
+
linked_at: z.ZodISODateTime;
|
|
206
|
+
last_used_at: z.ZodNullable<z.ZodISODateTime>;
|
|
207
|
+
}, z.core.$strict>>;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
export type MeIdentitiesListResponse = z.infer<typeof meIdentitiesListResponseSchema>;
|
|
210
|
+
/**
|
|
211
|
+
* `redirect_uri` is where the authenticated app wants the user returned to
|
|
212
|
+
* after the linking OAuth round-trip completes (this is an app-context
|
|
213
|
+
* link, not a public auth transaction, so it carries its own return
|
|
214
|
+
* target rather than one fixed at transaction-create time).
|
|
215
|
+
*/
|
|
216
|
+
export declare const meIdentityLinkRequestSchema: z.ZodObject<{
|
|
217
|
+
redirect_uri: z.ZodString;
|
|
218
|
+
}, z.core.$strict>;
|
|
219
|
+
export type MeIdentityLinkRequest = z.infer<typeof meIdentityLinkRequestSchema>;
|
|
220
|
+
/** Same shape as the transaction-scoped social start: a URL to open in the system browser. */
|
|
221
|
+
export declare const meIdentityLinkResponseSchema: z.ZodObject<{
|
|
222
|
+
authorization_url: z.ZodURL;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
export type MeIdentityLinkResponse = z.infer<typeof meIdentityLinkResponseSchema>;
|
|
225
|
+
export declare const meIdentityUnlinkResponseSchema: z.ZodObject<{
|
|
226
|
+
identity_id: z.ZodString;
|
|
227
|
+
unlinked: z.ZodLiteral<true>;
|
|
228
|
+
}, z.core.$strict>;
|
|
229
|
+
export type MeIdentityUnlinkResponse = z.infer<typeof meIdentityUnlinkResponseSchema>;
|
|
230
|
+
export declare const meSessionSummarySchema: z.ZodObject<{
|
|
231
|
+
session_id: z.ZodString;
|
|
232
|
+
client_id: z.ZodString;
|
|
233
|
+
device_name: z.ZodNullable<z.ZodString>;
|
|
234
|
+
created_at: z.ZodISODateTime;
|
|
235
|
+
last_active_at: z.ZodISODateTime;
|
|
236
|
+
current: z.ZodBoolean;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
export type MeSessionSummary = z.infer<typeof meSessionSummarySchema>;
|
|
239
|
+
export declare const meSessionsListResponseSchema: z.ZodObject<{
|
|
240
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
241
|
+
session_id: z.ZodString;
|
|
242
|
+
client_id: z.ZodString;
|
|
243
|
+
device_name: z.ZodNullable<z.ZodString>;
|
|
244
|
+
created_at: z.ZodISODateTime;
|
|
245
|
+
last_active_at: z.ZodISODateTime;
|
|
246
|
+
current: z.ZodBoolean;
|
|
247
|
+
}, z.core.$strict>>;
|
|
248
|
+
}, z.core.$strict>;
|
|
249
|
+
export type MeSessionsListResponse = z.infer<typeof meSessionsListResponseSchema>;
|
|
250
|
+
export declare const meSessionRevokeResponseSchema: z.ZodObject<{
|
|
251
|
+
session_id: z.ZodString;
|
|
252
|
+
revoked: z.ZodLiteral<true>;
|
|
253
|
+
}, z.core.$strict>;
|
|
254
|
+
export type MeSessionRevokeResponse = z.infer<typeof meSessionRevokeResponseSchema>;
|
|
255
|
+
/** design.md §24.3: revoking all sessions bumps `UserSecurityDO.securityVersion`. */
|
|
256
|
+
export declare const meSessionsRevokeAllResponseSchema: z.ZodObject<{
|
|
257
|
+
revoked: z.ZodLiteral<true>;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
export type MeSessionsRevokeAllResponse = z.infer<typeof meSessionsRevokeAllResponseSchema>;
|
|
260
|
+
export declare const meEmailChangeStartRequestSchema: z.ZodObject<{
|
|
261
|
+
new_email: z.ZodEmail;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
export type MeEmailChangeStartRequest = z.infer<typeof meEmailChangeStartRequestSchema>;
|
|
264
|
+
/** An OTP challenge sent to the CURRENT (old) email, confirming account ownership. */
|
|
265
|
+
export declare const meEmailChangeStartResponseSchema: z.ZodObject<{
|
|
266
|
+
challenge_id: z.ZodString;
|
|
267
|
+
expires_at: z.ZodISODateTime;
|
|
268
|
+
}, z.core.$strict>;
|
|
269
|
+
export type MeEmailChangeStartResponse = z.infer<typeof meEmailChangeStartResponseSchema>;
|
|
270
|
+
export declare const meEmailChangeVerifyOldRequestSchema: z.ZodObject<{
|
|
271
|
+
challenge_id: z.ZodString;
|
|
272
|
+
code: z.ZodString;
|
|
273
|
+
}, z.core.$strict>;
|
|
274
|
+
export type MeEmailChangeVerifyOldRequest = z.infer<typeof meEmailChangeVerifyOldRequestSchema>;
|
|
275
|
+
/** A new OTP challenge, now sent to the NEW email. */
|
|
276
|
+
export declare const meEmailChangeVerifyOldResponseSchema: z.ZodObject<{
|
|
277
|
+
challenge_id: z.ZodString;
|
|
278
|
+
expires_at: z.ZodISODateTime;
|
|
279
|
+
}, z.core.$strict>;
|
|
280
|
+
export type MeEmailChangeVerifyOldResponse = z.infer<typeof meEmailChangeVerifyOldResponseSchema>;
|
|
281
|
+
export declare const meEmailChangeVerifyNewRequestSchema: z.ZodObject<{
|
|
282
|
+
challenge_id: z.ZodString;
|
|
283
|
+
code: z.ZodString;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
export type MeEmailChangeVerifyNewRequest = z.infer<typeof meEmailChangeVerifyNewRequestSchema>;
|
|
286
|
+
export declare const meEmailChangeVerifyNewResponseSchema: z.ZodObject<{
|
|
287
|
+
email: z.ZodEmail;
|
|
288
|
+
email_verified: z.ZodLiteral<true>;
|
|
289
|
+
}, z.core.$strict>;
|
|
290
|
+
export type MeEmailChangeVerifyNewResponse = z.infer<typeof meEmailChangeVerifyNewResponseSchema>;
|
|
291
|
+
export declare const meDeleteRequestSchema: z.ZodObject<{}, z.core.$strict>;
|
|
292
|
+
export type MeDeleteRequest = z.infer<typeof meDeleteRequestSchema>;
|
|
293
|
+
export declare const meDeleteResponseSchema: z.ZodObject<{
|
|
294
|
+
user_id: z.ZodString;
|
|
295
|
+
status: z.ZodLiteral<"pending_deletion">;
|
|
296
|
+
}, z.core.$strict>;
|
|
297
|
+
export type MeDeleteResponse = z.infer<typeof meDeleteResponseSchema>;
|
package/dist/me.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { emailChallengeResponseSchema } from "./email.js";
|
|
3
|
+
import { passkeyRegistrationOptionsRequestSchema, passkeyRegistrationOptionsResponseSchema, passkeyRegistrationVerifyRequestSchema, passkeySummarySchema, } from "./passkeys.js";
|
|
4
|
+
import { clientIdSchema, emailOtpCodeSchema, identityIdSchema, isoDateTimeSchema, passkeyIdSchema, redirectUriSchema, sessionIdSchema, userIdSchema, } from "./primitives.js";
|
|
5
|
+
import { socialProviderSchema, socialStartResponseSchema } from "./social.js";
|
|
6
|
+
/**
|
|
7
|
+
* The authenticated self-service surface (design.md §16.2 route list). All
|
|
8
|
+
* responses here project persisted rows (design.md §12.1-§12.5) minus
|
|
9
|
+
* internal/sensitive columns (`security_version`, `metadata_json`,
|
|
10
|
+
* `credential_id`, `public_key`, `sign_count`, token ciphertexts, hashes).
|
|
11
|
+
*/
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// GET/PATCH /v1/me (design.md §12.1 `users`)
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
export const USER_STATUSES = ["active", "blocked", "pending_deletion"];
|
|
16
|
+
export const userStatusSchema = z.enum(USER_STATUSES);
|
|
17
|
+
export const meUserSchema = z.strictObject({
|
|
18
|
+
user_id: userIdSchema,
|
|
19
|
+
email: z.email().nullable(),
|
|
20
|
+
email_verified: z.boolean(),
|
|
21
|
+
name: z.string().nullable(),
|
|
22
|
+
avatar_url: z.url().nullable(),
|
|
23
|
+
locale: z.string().nullable(),
|
|
24
|
+
timezone: z.string().nullable(),
|
|
25
|
+
status: userStatusSchema,
|
|
26
|
+
created_at: isoDateTimeSchema,
|
|
27
|
+
last_login_at: isoDateTimeSchema.nullable(),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Email is intentionally excluded: changing it goes through
|
|
31
|
+
* `POST /v1/me/email/change/start` (dual old/new-email verification,
|
|
32
|
+
* design.md §25), never a direct `PATCH`.
|
|
33
|
+
*/
|
|
34
|
+
export const meUpdateRequestSchema = z.strictObject({
|
|
35
|
+
name: z.string().min(1).max(200).optional(),
|
|
36
|
+
avatar_url: z.url().optional(),
|
|
37
|
+
locale: z.string().min(1).max(35).optional(),
|
|
38
|
+
timezone: z.string().min(1).max(64).optional(),
|
|
39
|
+
});
|
|
40
|
+
/** `PATCH /v1/me` returns the updated profile, same shape as `GET /v1/me`. */
|
|
41
|
+
export const meUpdateResponseSchema = meUserSchema;
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// /v1/me/passkeys (design.md §17.1)
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
export const mePasskeysListResponseSchema = z.strictObject({
|
|
46
|
+
passkeys: z.array(passkeySummarySchema),
|
|
47
|
+
});
|
|
48
|
+
/** Registration options depend on the session's user; only the RP ID may be named (design.md §8.3). */
|
|
49
|
+
export const mePasskeyRegistrationOptionsRequestSchema = passkeyRegistrationOptionsRequestSchema;
|
|
50
|
+
/** Same fixed WebAuthn configuration as the transaction-scoped registration options (design.md §17.1). */
|
|
51
|
+
export const mePasskeyRegistrationOptionsResponseSchema = passkeyRegistrationOptionsResponseSchema;
|
|
52
|
+
/** Same shape as the transaction-scoped credential + optional label (design.md §17.1). */
|
|
53
|
+
export const mePasskeyRegistrationVerifyRequestSchema = passkeyRegistrationVerifyRequestSchema;
|
|
54
|
+
export const mePasskeyRegistrationVerifyResponseSchema = z.strictObject({
|
|
55
|
+
passkey: passkeySummarySchema,
|
|
56
|
+
});
|
|
57
|
+
export const mePasskeyDeleteResponseSchema = z.strictObject({
|
|
58
|
+
passkey_id: passkeyIdSchema,
|
|
59
|
+
deleted: z.literal(true),
|
|
60
|
+
});
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// /v1/me/identities (design.md §20.5 `identities` table)
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
export const meIdentitySummarySchema = z.strictObject({
|
|
65
|
+
identity_id: identityIdSchema,
|
|
66
|
+
provider: socialProviderSchema,
|
|
67
|
+
linked_at: isoDateTimeSchema,
|
|
68
|
+
last_used_at: isoDateTimeSchema.nullable(),
|
|
69
|
+
});
|
|
70
|
+
export const meIdentitiesListResponseSchema = z.strictObject({
|
|
71
|
+
identities: z.array(meIdentitySummarySchema),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* `redirect_uri` is where the authenticated app wants the user returned to
|
|
75
|
+
* after the linking OAuth round-trip completes (this is an app-context
|
|
76
|
+
* link, not a public auth transaction, so it carries its own return
|
|
77
|
+
* target rather than one fixed at transaction-create time).
|
|
78
|
+
*/
|
|
79
|
+
export const meIdentityLinkRequestSchema = z.strictObject({
|
|
80
|
+
redirect_uri: redirectUriSchema,
|
|
81
|
+
});
|
|
82
|
+
/** Same shape as the transaction-scoped social start: a URL to open in the system browser. */
|
|
83
|
+
export const meIdentityLinkResponseSchema = socialStartResponseSchema;
|
|
84
|
+
export const meIdentityUnlinkResponseSchema = z.strictObject({
|
|
85
|
+
identity_id: identityIdSchema,
|
|
86
|
+
unlinked: z.literal(true),
|
|
87
|
+
});
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// /v1/me/sessions (design.md §12.4 `sessions`, §24)
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
export const meSessionSummarySchema = z.strictObject({
|
|
92
|
+
session_id: sessionIdSchema,
|
|
93
|
+
client_id: clientIdSchema,
|
|
94
|
+
device_name: z.string().nullable(),
|
|
95
|
+
created_at: isoDateTimeSchema,
|
|
96
|
+
last_active_at: isoDateTimeSchema,
|
|
97
|
+
/** Whether this is the session the current request was authenticated with. */
|
|
98
|
+
current: z.boolean(),
|
|
99
|
+
});
|
|
100
|
+
export const meSessionsListResponseSchema = z.strictObject({
|
|
101
|
+
sessions: z.array(meSessionSummarySchema),
|
|
102
|
+
});
|
|
103
|
+
export const meSessionRevokeResponseSchema = z.strictObject({
|
|
104
|
+
session_id: sessionIdSchema,
|
|
105
|
+
revoked: z.literal(true),
|
|
106
|
+
});
|
|
107
|
+
/** design.md §24.3: revoking all sessions bumps `UserSecurityDO.securityVersion`. */
|
|
108
|
+
export const meSessionsRevokeAllResponseSchema = z.strictObject({
|
|
109
|
+
revoked: z.literal(true),
|
|
110
|
+
});
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// /v1/me/email/change/* (design.md §25: both old and new email must verify)
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
export const meEmailChangeStartRequestSchema = z.strictObject({
|
|
115
|
+
new_email: z.email(),
|
|
116
|
+
});
|
|
117
|
+
/** An OTP challenge sent to the CURRENT (old) email, confirming account ownership. */
|
|
118
|
+
export const meEmailChangeStartResponseSchema = emailChallengeResponseSchema;
|
|
119
|
+
export const meEmailChangeVerifyOldRequestSchema = z.strictObject({
|
|
120
|
+
challenge_id: z.string().min(1),
|
|
121
|
+
code: emailOtpCodeSchema,
|
|
122
|
+
});
|
|
123
|
+
/** A new OTP challenge, now sent to the NEW email. */
|
|
124
|
+
export const meEmailChangeVerifyOldResponseSchema = emailChallengeResponseSchema;
|
|
125
|
+
export const meEmailChangeVerifyNewRequestSchema = z.strictObject({
|
|
126
|
+
challenge_id: z.string().min(1),
|
|
127
|
+
code: emailOtpCodeSchema,
|
|
128
|
+
});
|
|
129
|
+
export const meEmailChangeVerifyNewResponseSchema = z.strictObject({
|
|
130
|
+
email: z.email(),
|
|
131
|
+
email_verified: z.literal(true),
|
|
132
|
+
});
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
// DELETE /v1/me (design.md §33: logical delete first; fresh session required, §24.4)
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
export const meDeleteRequestSchema = z.strictObject({});
|
|
137
|
+
export const meDeleteResponseSchema = z.strictObject({
|
|
138
|
+
user_id: userIdSchema,
|
|
139
|
+
status: z.literal("pending_deletion"),
|
|
140
|
+
});
|
package/dist/oidc.d.ts
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TOKEN_TTL_SECONDS: {
|
|
3
|
+
readonly authorizationCode: 60;
|
|
4
|
+
readonly accessToken: 300;
|
|
5
|
+
readonly idToken: 300;
|
|
6
|
+
readonly refreshIdle: number;
|
|
7
|
+
readonly refreshAbsolute: number;
|
|
8
|
+
readonly loginSessionIdle: number;
|
|
9
|
+
readonly loginSessionAbsolute: number;
|
|
10
|
+
};
|
|
11
|
+
/** Only the Authorization Code Grant is supported (design.md §15.3: no Implicit, ROPC, Device Code). */
|
|
12
|
+
export declare const RESPONSE_TYPES: readonly ["code"];
|
|
13
|
+
export declare const responseTypeSchema: z.ZodEnum<{
|
|
14
|
+
code: "code";
|
|
15
|
+
}>;
|
|
16
|
+
/** `plain` PKCE is explicitly unsupported (design.md §15.3). */
|
|
17
|
+
export declare const CODE_CHALLENGE_METHODS: readonly ["S256"];
|
|
18
|
+
export declare const codeChallengeMethodSchema: z.ZodEnum<{
|
|
19
|
+
S256: "S256";
|
|
20
|
+
}>;
|
|
21
|
+
export declare const GRANT_TYPES: readonly ["authorization_code", "refresh_token"];
|
|
22
|
+
export declare const grantTypeSchema: z.ZodEnum<{
|
|
23
|
+
authorization_code: "authorization_code";
|
|
24
|
+
refresh_token: "refresh_token";
|
|
25
|
+
}>;
|
|
26
|
+
export type GrantType = (typeof GRANT_TYPES)[number];
|
|
27
|
+
/** design.md §15.4. Public clients (`web_spa`, `react_native`) never hold a secret. */
|
|
28
|
+
export declare const TOKEN_ENDPOINT_AUTH_METHODS: readonly ["client_secret_basic", "client_secret_post", "none"];
|
|
29
|
+
export declare const tokenEndpointAuthMethodSchema: z.ZodEnum<{
|
|
30
|
+
client_secret_basic: "client_secret_basic";
|
|
31
|
+
client_secret_post: "client_secret_post";
|
|
32
|
+
none: "none";
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Query params for the authorize endpoint. `client_id` auth fields
|
|
36
|
+
* (`client_secret`, Basic auth) do not appear here: authorize is a
|
|
37
|
+
* front-channel, browser-navigated request and never carries a client
|
|
38
|
+
* secret (design.md §15.4).
|
|
39
|
+
*/
|
|
40
|
+
export declare const authorizeRequestQuerySchema: z.ZodObject<{
|
|
41
|
+
response_type: z.ZodEnum<{
|
|
42
|
+
code: "code";
|
|
43
|
+
}>;
|
|
44
|
+
client_id: z.ZodString;
|
|
45
|
+
redirect_uri: z.ZodString;
|
|
46
|
+
scope: z.ZodString;
|
|
47
|
+
state: z.ZodString;
|
|
48
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
49
|
+
code_challenge: z.ZodString;
|
|
50
|
+
code_challenge_method: z.ZodEnum<{
|
|
51
|
+
S256: "S256";
|
|
52
|
+
}>;
|
|
53
|
+
resource: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type AuthorizeRequestQuery = z.infer<typeof authorizeRequestQuerySchema>;
|
|
56
|
+
export declare const authorizationCodeGrantRequestSchema: z.ZodObject<{
|
|
57
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
59
|
+
grant_type: z.ZodLiteral<"authorization_code">;
|
|
60
|
+
code: z.ZodString;
|
|
61
|
+
redirect_uri: z.ZodString;
|
|
62
|
+
code_verifier: z.ZodString;
|
|
63
|
+
resource: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export type AuthorizationCodeGrantRequest = z.infer<typeof authorizationCodeGrantRequestSchema>;
|
|
66
|
+
export declare const refreshTokenGrantRequestSchema: z.ZodObject<{
|
|
67
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
68
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
69
|
+
grant_type: z.ZodLiteral<"refresh_token">;
|
|
70
|
+
refresh_token: z.ZodString;
|
|
71
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
72
|
+
resource: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
export type RefreshTokenGrantRequest = z.infer<typeof refreshTokenGrantRequestSchema>;
|
|
75
|
+
export declare const tokenRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
77
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
78
|
+
grant_type: z.ZodLiteral<"authorization_code">;
|
|
79
|
+
code: z.ZodString;
|
|
80
|
+
redirect_uri: z.ZodString;
|
|
81
|
+
code_verifier: z.ZodString;
|
|
82
|
+
resource: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
83
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
84
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
85
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
86
|
+
grant_type: z.ZodLiteral<"refresh_token">;
|
|
87
|
+
refresh_token: z.ZodString;
|
|
88
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
89
|
+
resource: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
90
|
+
}, z.core.$strict>], "grant_type">;
|
|
91
|
+
export type TokenRequest = z.infer<typeof tokenRequestSchema>;
|
|
92
|
+
export declare const tokenResponseSchema: z.ZodObject<{
|
|
93
|
+
access_token: z.ZodString;
|
|
94
|
+
token_type: z.ZodLiteral<"Bearer">;
|
|
95
|
+
expires_in: z.ZodNumber;
|
|
96
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
97
|
+
id_token: z.ZodOptional<z.ZodString>;
|
|
98
|
+
scope: z.ZodString;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
export type TokenResponse = z.infer<typeof tokenResponseSchema>;
|
|
101
|
+
export declare const userinfoResponseSchema: z.ZodObject<{
|
|
102
|
+
sub: z.ZodString;
|
|
103
|
+
name: z.ZodOptional<z.ZodString>;
|
|
104
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
105
|
+
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
107
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
export type UserinfoResponse = z.infer<typeof userinfoResponseSchema>;
|
|
110
|
+
export declare const oidcDiscoveryDocumentSchema: z.ZodObject<{
|
|
111
|
+
issuer: z.ZodURL;
|
|
112
|
+
authorization_endpoint: z.ZodURL;
|
|
113
|
+
token_endpoint: z.ZodURL;
|
|
114
|
+
userinfo_endpoint: z.ZodURL;
|
|
115
|
+
jwks_uri: z.ZodURL;
|
|
116
|
+
revocation_endpoint: z.ZodURL;
|
|
117
|
+
introspection_endpoint: z.ZodURL;
|
|
118
|
+
end_session_endpoint: z.ZodURL;
|
|
119
|
+
response_types_supported: z.ZodArray<z.ZodEnum<{
|
|
120
|
+
code: "code";
|
|
121
|
+
}>>;
|
|
122
|
+
grant_types_supported: z.ZodArray<z.ZodEnum<{
|
|
123
|
+
authorization_code: "authorization_code";
|
|
124
|
+
refresh_token: "refresh_token";
|
|
125
|
+
}>>;
|
|
126
|
+
code_challenge_methods_supported: z.ZodArray<z.ZodEnum<{
|
|
127
|
+
S256: "S256";
|
|
128
|
+
}>>;
|
|
129
|
+
token_endpoint_auth_methods_supported: z.ZodArray<z.ZodEnum<{
|
|
130
|
+
client_secret_basic: "client_secret_basic";
|
|
131
|
+
client_secret_post: "client_secret_post";
|
|
132
|
+
none: "none";
|
|
133
|
+
}>>;
|
|
134
|
+
scopes_supported: z.ZodArray<z.ZodString>;
|
|
135
|
+
subject_types_supported: z.ZodArray<z.ZodLiteral<"public">>;
|
|
136
|
+
id_token_signing_alg_values_supported: z.ZodArray<z.ZodLiteral<"ES256">>;
|
|
137
|
+
claims_supported: z.ZodArray<z.ZodString>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export type OidcDiscoveryDocument = z.infer<typeof oidcDiscoveryDocumentSchema>;
|
|
140
|
+
export declare const jwkSchema: z.ZodObject<{
|
|
141
|
+
kty: z.ZodLiteral<"EC">;
|
|
142
|
+
crv: z.ZodLiteral<"P-256">;
|
|
143
|
+
x: z.ZodString;
|
|
144
|
+
y: z.ZodString;
|
|
145
|
+
kid: z.ZodString;
|
|
146
|
+
alg: z.ZodLiteral<"ES256">;
|
|
147
|
+
use: z.ZodLiteral<"sig">;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
export type Jwk = z.infer<typeof jwkSchema>;
|
|
150
|
+
export declare const jwksDocumentSchema: z.ZodObject<{
|
|
151
|
+
keys: z.ZodArray<z.ZodObject<{
|
|
152
|
+
kty: z.ZodLiteral<"EC">;
|
|
153
|
+
crv: z.ZodLiteral<"P-256">;
|
|
154
|
+
x: z.ZodString;
|
|
155
|
+
y: z.ZodString;
|
|
156
|
+
kid: z.ZodString;
|
|
157
|
+
alg: z.ZodLiteral<"ES256">;
|
|
158
|
+
use: z.ZodLiteral<"sig">;
|
|
159
|
+
}, z.core.$strict>>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
export type JwksDocument = z.infer<typeof jwksDocumentSchema>;
|
|
162
|
+
export declare const introspectionRequestSchema: z.ZodObject<{
|
|
163
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
164
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
165
|
+
token: z.ZodString;
|
|
166
|
+
token_type_hint: z.ZodOptional<z.ZodEnum<{
|
|
167
|
+
refresh_token: "refresh_token";
|
|
168
|
+
access_token: "access_token";
|
|
169
|
+
}>>;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
export type IntrospectionRequest = z.infer<typeof introspectionRequestSchema>;
|
|
172
|
+
export declare const introspectionResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
173
|
+
active: z.ZodLiteral<true>;
|
|
174
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
175
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
176
|
+
token_type: z.ZodOptional<z.ZodLiteral<"Bearer">>;
|
|
177
|
+
exp: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
iat: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
nbf: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
sub: z.ZodOptional<z.ZodString>;
|
|
181
|
+
aud: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
182
|
+
iss: z.ZodOptional<z.ZodURL>;
|
|
183
|
+
jti: z.ZodOptional<z.ZodString>;
|
|
184
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
185
|
+
active: z.ZodLiteral<false>;
|
|
186
|
+
}, z.core.$strict>]>;
|
|
187
|
+
export type IntrospectionResponse = z.infer<typeof introspectionResponseSchema>;
|
|
188
|
+
export declare const revocationRequestSchema: z.ZodObject<{
|
|
189
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
190
|
+
client_secret: z.ZodOptional<z.ZodString>;
|
|
191
|
+
token: z.ZodString;
|
|
192
|
+
token_type_hint: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
refresh_token: "refresh_token";
|
|
194
|
+
access_token: "access_token";
|
|
195
|
+
}>>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
export type RevocationRequest = z.infer<typeof revocationRequestSchema>;
|
|
198
|
+
/**
|
|
199
|
+
* Always empty, always HTTP 200: design.md §15.8 requires the revocation
|
|
200
|
+
* endpoint to succeed even for a token that never existed, so response
|
|
201
|
+
* content must never leak whether the token was real.
|
|
202
|
+
*/
|
|
203
|
+
export declare const revocationResponseSchema: z.ZodObject<{}, z.core.$strict>;
|
|
204
|
+
export type RevocationResponse = z.infer<typeof revocationResponseSchema>;
|
|
205
|
+
export declare const logoutRequestSchema: z.ZodObject<{
|
|
206
|
+
id_token_hint: z.ZodOptional<z.ZodString>;
|
|
207
|
+
post_logout_redirect_uri: z.ZodOptional<z.ZodString>;
|
|
208
|
+
state: z.ZodOptional<z.ZodString>;
|
|
209
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
export type LogoutRequest = z.infer<typeof logoutRequestSchema>;
|
|
212
|
+
export declare const OAUTH_ERROR_CODES: readonly ["invalid_request", "invalid_client", "invalid_grant", "unsupported_grant_type", "invalid_scope", "access_denied", "server_error", "temporarily_unavailable"];
|
|
213
|
+
export declare const oauthErrorCodeSchema: z.ZodEnum<{
|
|
214
|
+
invalid_scope: "invalid_scope";
|
|
215
|
+
invalid_request: "invalid_request";
|
|
216
|
+
invalid_client: "invalid_client";
|
|
217
|
+
invalid_grant: "invalid_grant";
|
|
218
|
+
unsupported_grant_type: "unsupported_grant_type";
|
|
219
|
+
access_denied: "access_denied";
|
|
220
|
+
server_error: "server_error";
|
|
221
|
+
temporarily_unavailable: "temporarily_unavailable";
|
|
222
|
+
}>;
|
|
223
|
+
export type OAuthErrorCode = (typeof OAUTH_ERROR_CODES)[number];
|
|
224
|
+
export declare const oauthErrorResponseSchema: z.ZodObject<{
|
|
225
|
+
error: z.ZodEnum<{
|
|
226
|
+
invalid_scope: "invalid_scope";
|
|
227
|
+
invalid_request: "invalid_request";
|
|
228
|
+
invalid_client: "invalid_client";
|
|
229
|
+
invalid_grant: "invalid_grant";
|
|
230
|
+
unsupported_grant_type: "unsupported_grant_type";
|
|
231
|
+
access_denied: "access_denied";
|
|
232
|
+
server_error: "server_error";
|
|
233
|
+
temporarily_unavailable: "temporarily_unavailable";
|
|
234
|
+
}>;
|
|
235
|
+
error_description: z.ZodOptional<z.ZodString>;
|
|
236
|
+
error_uri: z.ZodOptional<z.ZodURL>;
|
|
237
|
+
state: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, z.core.$strict>;
|
|
239
|
+
export type OAuthErrorResponse = z.infer<typeof oauthErrorResponseSchema>;
|