@schemavaults/auth-common 0.25.0 → 0.26.1

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.
Files changed (67) hide show
  1. package/dist/audience-schema.d.ts +2 -2
  2. package/dist/audience-schema.js +0 -1
  3. package/dist/audience-schema.js.map +1 -1
  4. package/dist/auth_acquire_tokens_grant_types.d.ts +12 -42
  5. package/dist/auth_acquire_tokens_grant_types.js +1 -1
  6. package/dist/auth_acquire_tokens_grant_types.js.map +1 -1
  7. package/dist/authenticate_result.d.ts +29 -144
  8. package/dist/authenticate_result.js +2 -2
  9. package/dist/authenticate_result.js.map +1 -1
  10. package/dist/authorize-client-application-form-type.d.ts +2 -6
  11. package/dist/credentials/email_credentials.d.ts +3 -9
  12. package/dist/credentials/normalize-email.d.ts +1 -1
  13. package/dist/credentials/normalize-email.js +5 -1
  14. package/dist/credentials/normalize-email.js.map +1 -1
  15. package/dist/credentials/password_requirements.d.ts +1 -1
  16. package/dist/credentials/register_credentials.d.ts +6 -26
  17. package/dist/invite-code/invite-code-definition.d.ts +5 -17
  18. package/dist/invite-code/invite-code-definition.js +1 -1
  19. package/dist/invite-code/invite-code-definition.js.map +1 -1
  20. package/dist/mfa/mfa-challenge.d.ts +2 -8
  21. package/dist/mfa/mfa-challenge.js +1 -1
  22. package/dist/mfa/mfa-challenge.js.map +1 -1
  23. package/dist/mfa/mfa-factor-type.d.ts +4 -1
  24. package/dist/mfa/mfa-verify-body.d.ts +57 -315
  25. package/dist/mfa/mfa-verify-body.js +9 -9
  26. package/dist/mfa/mfa-verify-body.js.map +1 -1
  27. package/dist/mfa/webauthn.d.ts +21 -145
  28. package/dist/mfa/webauthn.js +3 -3
  29. package/dist/mfa/webauthn.js.map +1 -1
  30. package/dist/middleware/auth-middleware-error.d.ts +1 -1
  31. package/dist/middleware/middleware-rules.d.ts +11 -15
  32. package/dist/oidc/endpoints.d.ts +32 -0
  33. package/dist/oidc/endpoints.js +42 -0
  34. package/dist/oidc/endpoints.js.map +1 -0
  35. package/dist/oidc/index.d.ts +6 -0
  36. package/dist/oidc/index.js +3 -0
  37. package/dist/oidc/index.js.map +1 -1
  38. package/dist/oidc/provider-metadata.d.ts +51 -0
  39. package/dist/oidc/provider-metadata.js +94 -0
  40. package/dist/oidc/provider-metadata.js.map +1 -0
  41. package/dist/oidc/token-endpoint-extensions.d.ts +58 -0
  42. package/dist/oidc/token-endpoint-extensions.js +69 -0
  43. package/dist/oidc/token-endpoint-extensions.js.map +1 -0
  44. package/dist/organizations/invite_member_form.d.ts +8 -21
  45. package/dist/organizations/invite_member_form.js +5 -5
  46. package/dist/organizations/invite_member_form.js.map +1 -1
  47. package/dist/organizations/organization-membership-role-type.d.ts +1 -1
  48. package/dist/organizations/organization_definition.d.ts +5 -15
  49. package/dist/organizations/organization_definition.js +1 -1
  50. package/dist/organizations/organization_definition.js.map +1 -1
  51. package/dist/organizations/organization_invitation.d.ts +21 -33
  52. package/dist/organizations/organization_invitation.js +5 -5
  53. package/dist/organizations/organization_invitation.js.map +1 -1
  54. package/dist/organizations/organization_membership_role_details.d.ts +6 -18
  55. package/dist/pagination.d.ts +1 -7
  56. package/dist/pkce/code_challenge.d.ts +5 -13
  57. package/dist/pkce/code_verifier.d.ts +6 -16
  58. package/dist/pkce/pkce.d.ts +11 -29
  59. package/dist/request_tokens_result.d.ts +54 -524
  60. package/dist/token-data/token-data.d.ts +23 -73
  61. package/dist/token-data/token-data.js +1 -1
  62. package/dist/token-data/token-data.js.map +1 -1
  63. package/dist/user_data/user_data.d.ts +7 -71
  64. package/dist/user_data/user_data.js +3 -3
  65. package/dist/user_data/user_data.js.map +1 -1
  66. package/dist/user_data/user_profile.d.ts +4 -58
  67. package/package.json +3 -3
@@ -1,378 +1,120 @@
1
1
  import { z } from "zod";
2
2
  export declare const totpCodeSchema: z.ZodString;
3
3
  export declare const recoveryCodeSchema: z.ZodString;
4
- export declare const mfaProofSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
4
+ export declare const mfaProofSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5
5
  type: z.ZodLiteral<"totp">;
6
- factor_id: z.ZodString;
6
+ factor_id: z.ZodGUID;
7
7
  code: z.ZodString;
8
- }, "strict", z.ZodTypeAny, {
9
- code: string;
10
- type: "totp";
11
- factor_id: string;
12
- }, {
13
- code: string;
14
- type: "totp";
15
- factor_id: string;
16
- }>, z.ZodObject<{
8
+ }, z.core.$strict>, z.ZodObject<{
17
9
  type: z.ZodLiteral<"webauthn">;
18
- factor_id: z.ZodString;
10
+ factor_id: z.ZodGUID;
19
11
  assertion: z.ZodObject<{
20
12
  id: z.ZodString;
21
13
  rawId: z.ZodString;
22
- response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
14
+ response: z.ZodObject<{}, z.core.$loose>;
23
15
  authenticatorAttachment: z.ZodOptional<z.ZodString>;
24
- clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
16
+ clientExtensionResults: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
25
17
  type: z.ZodString;
26
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
27
- id: z.ZodString;
28
- rawId: z.ZodString;
29
- response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
30
- authenticatorAttachment: z.ZodOptional<z.ZodString>;
31
- clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
32
- type: z.ZodString;
33
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
34
- id: z.ZodString;
35
- rawId: z.ZodString;
36
- response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
37
- authenticatorAttachment: z.ZodOptional<z.ZodString>;
38
- clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
39
- type: z.ZodString;
40
- }, z.ZodTypeAny, "passthrough">>;
41
- }, "strict", z.ZodTypeAny, {
42
- type: "webauthn";
43
- factor_id: string;
44
- assertion: {
45
- type: string;
46
- id: string;
47
- rawId: string;
48
- response: {} & {
49
- [k: string]: unknown;
50
- };
51
- authenticatorAttachment?: string | undefined;
52
- clientExtensionResults?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
53
- } & {
54
- [k: string]: unknown;
55
- };
56
- }, {
57
- type: "webauthn";
58
- factor_id: string;
59
- assertion: {
60
- type: string;
61
- id: string;
62
- rawId: string;
63
- response: {} & {
64
- [k: string]: unknown;
65
- };
66
- authenticatorAttachment?: string | undefined;
67
- clientExtensionResults?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
68
- } & {
69
- [k: string]: unknown;
70
- };
71
- }>, z.ZodObject<{
18
+ }, z.core.$loose>;
19
+ }, z.core.$strict>, z.ZodObject<{
72
20
  type: z.ZodLiteral<"recovery_code">;
73
21
  recovery_code: z.ZodString;
74
- }, "strict", z.ZodTypeAny, {
75
- type: "recovery_code";
76
- recovery_code: string;
77
- }, {
78
- type: "recovery_code";
79
- recovery_code: string;
80
- }>]>;
22
+ }, z.core.$strict>], "type">;
81
23
  export type MfaProof = z.infer<typeof mfaProofSchema>;
82
24
  export declare const mfaVerifyBodySchema: z.ZodObject<{
83
- challenge_id: z.ZodString;
84
- client_app_id: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
85
- proof: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
25
+ challenge_id: z.ZodGUID;
26
+ client_app_id: z.ZodString;
27
+ proof: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
28
  type: z.ZodLiteral<"totp">;
87
- factor_id: z.ZodString;
29
+ factor_id: z.ZodGUID;
88
30
  code: z.ZodString;
89
- }, "strict", z.ZodTypeAny, {
90
- code: string;
91
- type: "totp";
92
- factor_id: string;
93
- }, {
94
- code: string;
95
- type: "totp";
96
- factor_id: string;
97
- }>, z.ZodObject<{
31
+ }, z.core.$strict>, z.ZodObject<{
98
32
  type: z.ZodLiteral<"webauthn">;
99
- factor_id: z.ZodString;
33
+ factor_id: z.ZodGUID;
100
34
  assertion: z.ZodObject<{
101
35
  id: z.ZodString;
102
36
  rawId: z.ZodString;
103
- response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
104
- authenticatorAttachment: z.ZodOptional<z.ZodString>;
105
- clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
106
- type: z.ZodString;
107
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
108
- id: z.ZodString;
109
- rawId: z.ZodString;
110
- response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
111
- authenticatorAttachment: z.ZodOptional<z.ZodString>;
112
- clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
113
- type: z.ZodString;
114
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
115
- id: z.ZodString;
116
- rawId: z.ZodString;
117
- response: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
37
+ response: z.ZodObject<{}, z.core.$loose>;
118
38
  authenticatorAttachment: z.ZodOptional<z.ZodString>;
119
- clientExtensionResults: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
39
+ clientExtensionResults: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
120
40
  type: z.ZodString;
121
- }, z.ZodTypeAny, "passthrough">>;
122
- }, "strict", z.ZodTypeAny, {
123
- type: "webauthn";
124
- factor_id: string;
125
- assertion: {
126
- type: string;
127
- id: string;
128
- rawId: string;
129
- response: {} & {
130
- [k: string]: unknown;
131
- };
132
- authenticatorAttachment?: string | undefined;
133
- clientExtensionResults?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
134
- } & {
135
- [k: string]: unknown;
136
- };
137
- }, {
138
- type: "webauthn";
139
- factor_id: string;
140
- assertion: {
141
- type: string;
142
- id: string;
143
- rawId: string;
144
- response: {} & {
145
- [k: string]: unknown;
146
- };
147
- authenticatorAttachment?: string | undefined;
148
- clientExtensionResults?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
149
- } & {
150
- [k: string]: unknown;
151
- };
152
- }>, z.ZodObject<{
41
+ }, z.core.$loose>;
42
+ }, z.core.$strict>, z.ZodObject<{
153
43
  type: z.ZodLiteral<"recovery_code">;
154
44
  recovery_code: z.ZodString;
155
- }, "strict", z.ZodTypeAny, {
156
- type: "recovery_code";
157
- recovery_code: string;
158
- }, {
159
- type: "recovery_code";
160
- recovery_code: string;
161
- }>]>;
162
- }, "strict", z.ZodTypeAny, {
163
- client_app_id: string;
164
- challenge_id: string;
165
- proof: {
166
- code: string;
167
- type: "totp";
168
- factor_id: string;
169
- } | {
170
- type: "webauthn";
171
- factor_id: string;
172
- assertion: {
173
- type: string;
174
- id: string;
175
- rawId: string;
176
- response: {} & {
177
- [k: string]: unknown;
178
- };
179
- authenticatorAttachment?: string | undefined;
180
- clientExtensionResults?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
181
- } & {
182
- [k: string]: unknown;
183
- };
184
- } | {
185
- type: "recovery_code";
186
- recovery_code: string;
187
- };
188
- }, {
189
- client_app_id: string;
190
- challenge_id: string;
191
- proof: {
192
- code: string;
193
- type: "totp";
194
- factor_id: string;
195
- } | {
196
- type: "webauthn";
197
- factor_id: string;
198
- assertion: {
199
- type: string;
200
- id: string;
201
- rawId: string;
202
- response: {} & {
203
- [k: string]: unknown;
204
- };
205
- authenticatorAttachment?: string | undefined;
206
- clientExtensionResults?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
207
- } & {
208
- [k: string]: unknown;
209
- };
210
- } | {
211
- type: "recovery_code";
212
- recovery_code: string;
213
- };
214
- }>;
45
+ }, z.core.$strict>], "type">;
46
+ }, z.core.$strict>;
215
47
  export type MfaVerifyBody = z.infer<typeof mfaVerifyBodySchema>;
216
48
  export declare const mfaEnrollResponseSchema: z.ZodObject<{
217
- factor_id: z.ZodString;
49
+ factor_id: z.ZodGUID;
218
50
  factor_type: z.ZodLiteral<"totp">;
219
- otpauth_url: z.ZodString;
51
+ otpauth_url: z.ZodURL;
220
52
  qr_code_data_url: z.ZodString;
221
53
  secret: z.ZodString;
222
- }, "strict", z.ZodTypeAny, {
223
- factor_id: string;
224
- factor_type: "totp";
225
- otpauth_url: string;
226
- qr_code_data_url: string;
227
- secret: string;
228
- }, {
229
- factor_id: string;
230
- factor_type: "totp";
231
- otpauth_url: string;
232
- qr_code_data_url: string;
233
- secret: string;
234
- }>;
54
+ }, z.core.$strict>;
235
55
  export type MfaEnrollResponse = z.infer<typeof mfaEnrollResponseSchema>;
236
56
  export declare const mfaVerifyEnrollmentBodySchema: z.ZodObject<{
237
- factor_id: z.ZodString;
57
+ factor_id: z.ZodGUID;
238
58
  code: z.ZodString;
239
- }, "strict", z.ZodTypeAny, {
240
- code: string;
241
- factor_id: string;
242
- }, {
243
- code: string;
244
- factor_id: string;
245
- }>;
59
+ }, z.core.$strict>;
246
60
  export type MfaVerifyEnrollmentBody = z.infer<typeof mfaVerifyEnrollmentBodySchema>;
247
61
  export declare const mfaVerifyEnrollmentResponseSchema: z.ZodObject<{
248
62
  success: z.ZodLiteral<true>;
249
- recovery_codes: z.ZodArray<z.ZodString, "many">;
63
+ recovery_codes: z.ZodArray<z.ZodString>;
250
64
  recovery_codes_issued: z.ZodBoolean;
251
- }, "strict", z.ZodTypeAny, {
252
- success: true;
253
- recovery_codes: string[];
254
- recovery_codes_issued: boolean;
255
- }, {
256
- success: true;
257
- recovery_codes: string[];
258
- recovery_codes_issued: boolean;
259
- }>;
65
+ }, z.core.$strict>;
260
66
  export type MfaVerifyEnrollmentResponse = z.infer<typeof mfaVerifyEnrollmentResponseSchema>;
261
67
  export declare const mfaFactorStatusResponseSchema: z.ZodObject<{
262
68
  enabled: z.ZodBoolean;
263
69
  pending: z.ZodBoolean;
264
- factor_id: z.ZodOptional<z.ZodString>;
265
- factor_type: z.ZodOptional<z.ZodEnum<["totp", "webauthn"]>>;
70
+ factor_id: z.ZodOptional<z.ZodGUID>;
71
+ factor_type: z.ZodOptional<z.ZodEnum<{
72
+ totp: "totp";
73
+ webauthn: "webauthn";
74
+ }>>;
266
75
  verified_at: z.ZodOptional<z.ZodNumber>;
267
- }, "strict", z.ZodTypeAny, {
268
- enabled: boolean;
269
- pending: boolean;
270
- factor_id?: string | undefined;
271
- factor_type?: "totp" | "webauthn" | undefined;
272
- verified_at?: number | undefined;
273
- }, {
274
- enabled: boolean;
275
- pending: boolean;
276
- factor_id?: string | undefined;
277
- factor_type?: "totp" | "webauthn" | undefined;
278
- verified_at?: number | undefined;
279
- }>;
76
+ }, z.core.$strict>;
280
77
  export type MfaFactorStatusResponse = z.infer<typeof mfaFactorStatusResponseSchema>;
281
78
  export declare const mfaEnrolledFactorSchema: z.ZodObject<{
282
- factor_id: z.ZodString;
283
- factor_type: z.ZodEnum<["totp", "webauthn"]>;
79
+ factor_id: z.ZodGUID;
80
+ factor_type: z.ZodEnum<{
81
+ totp: "totp";
82
+ webauthn: "webauthn";
83
+ }>;
284
84
  verified_at: z.ZodOptional<z.ZodNumber>;
285
- }, "strict", z.ZodTypeAny, {
286
- factor_id: string;
287
- factor_type: "totp" | "webauthn";
288
- verified_at?: number | undefined;
289
- }, {
290
- factor_id: string;
291
- factor_type: "totp" | "webauthn";
292
- verified_at?: number | undefined;
293
- }>;
85
+ }, z.core.$strict>;
294
86
  export type MfaEnrolledFactor = z.infer<typeof mfaEnrolledFactorSchema>;
295
87
  export declare const mfaStatusResponseSchema: z.ZodObject<{
296
88
  enabled: z.ZodBoolean;
297
89
  factors: z.ZodArray<z.ZodObject<{
298
- factor_id: z.ZodString;
299
- factor_type: z.ZodEnum<["totp", "webauthn"]>;
90
+ factor_id: z.ZodGUID;
91
+ factor_type: z.ZodEnum<{
92
+ totp: "totp";
93
+ webauthn: "webauthn";
94
+ }>;
300
95
  verified_at: z.ZodOptional<z.ZodNumber>;
301
- }, "strict", z.ZodTypeAny, {
302
- factor_id: string;
303
- factor_type: "totp" | "webauthn";
304
- verified_at?: number | undefined;
305
- }, {
306
- factor_id: string;
307
- factor_type: "totp" | "webauthn";
308
- verified_at?: number | undefined;
309
- }>, "many">;
96
+ }, z.core.$strict>>;
310
97
  recovery_codes_remaining: z.ZodNumber;
311
- }, "strict", z.ZodTypeAny, {
312
- enabled: boolean;
313
- factors: {
314
- factor_id: string;
315
- factor_type: "totp" | "webauthn";
316
- verified_at?: number | undefined;
317
- }[];
318
- recovery_codes_remaining: number;
319
- }, {
320
- enabled: boolean;
321
- factors: {
322
- factor_id: string;
323
- factor_type: "totp" | "webauthn";
324
- verified_at?: number | undefined;
325
- }[];
326
- recovery_codes_remaining: number;
327
- }>;
98
+ }, z.core.$strict>;
328
99
  export type MfaStatusResponse = z.infer<typeof mfaStatusResponseSchema>;
329
100
  export declare const mfaCodeOnlyBodySchema: z.ZodObject<{
330
101
  code: z.ZodString;
331
- }, "strict", z.ZodTypeAny, {
332
- code: string;
333
- }, {
334
- code: string;
335
- }>;
102
+ }, z.core.$strict>;
336
103
  export type MfaCodeOnlyBody = z.infer<typeof mfaCodeOnlyBodySchema>;
337
104
  export declare const mfaTotpProofBodySchema: z.ZodObject<{
338
- factor_id: z.ZodString;
105
+ factor_id: z.ZodGUID;
339
106
  code: z.ZodString;
340
- }, "strict", z.ZodTypeAny, {
341
- code: string;
342
- factor_id: string;
343
- }, {
344
- code: string;
345
- factor_id: string;
346
- }>;
107
+ }, z.core.$strict>;
347
108
  export type MfaTotpProofBody = z.infer<typeof mfaTotpProofBodySchema>;
348
109
  export declare const mfaChallengeFactorsPayloadSchema: z.ZodObject<{
349
110
  available_factors: z.ZodArray<z.ZodObject<{
350
- factor_id: z.ZodString;
351
- factor_type: z.ZodEnum<["totp", "webauthn"]>;
111
+ factor_id: z.ZodGUID;
112
+ factor_type: z.ZodEnum<{
113
+ totp: "totp";
114
+ webauthn: "webauthn";
115
+ }>;
352
116
  last_used_at: z.ZodNullable<z.ZodNumber>;
353
- }, "strict", z.ZodTypeAny, {
354
- factor_id: string;
355
- factor_type: "totp" | "webauthn";
356
- last_used_at: number | null;
357
- }, {
358
- factor_id: string;
359
- factor_type: "totp" | "webauthn";
360
- last_used_at: number | null;
361
- }>, "many">;
117
+ }, z.core.$strict>>;
362
118
  recovery_codes_available: z.ZodBoolean;
363
- }, "strict", z.ZodTypeAny, {
364
- available_factors: {
365
- factor_id: string;
366
- factor_type: "totp" | "webauthn";
367
- last_used_at: number | null;
368
- }[];
369
- recovery_codes_available: boolean;
370
- }, {
371
- available_factors: {
372
- factor_id: string;
373
- factor_type: "totp" | "webauthn";
374
- last_used_at: number | null;
375
- }[];
376
- recovery_codes_available: boolean;
377
- }>;
119
+ }, z.core.$strict>;
378
120
  export type MfaChallengeFactorsPayload = z.infer<typeof mfaChallengeFactorsPayloadSchema>;
@@ -19,14 +19,14 @@ export const mfaProofSchema = z.discriminatedUnion("type", [
19
19
  z
20
20
  .object({
21
21
  type: z.literal("totp"),
22
- factor_id: z.string().uuid(),
22
+ factor_id: z.guid(),
23
23
  code: totpCodeSchema,
24
24
  })
25
25
  .strict(),
26
26
  z
27
27
  .object({
28
28
  type: z.literal("webauthn"),
29
- factor_id: z.string().uuid(),
29
+ factor_id: z.guid(),
30
30
  assertion: webauthnAuthenticationResponseSchema,
31
31
  })
32
32
  .strict(),
@@ -36,23 +36,23 @@ export const mfaProofSchema = z.discriminatedUnion("type", [
36
36
  ]);
37
37
  export const mfaVerifyBodySchema = z
38
38
  .object({
39
- challenge_id: z.string().uuid(),
39
+ challenge_id: z.guid(),
40
40
  client_app_id: appIdSchema,
41
41
  proof: mfaProofSchema,
42
42
  })
43
43
  .strict();
44
44
  export const mfaEnrollResponseSchema = z
45
45
  .object({
46
- factor_id: z.string().uuid(),
46
+ factor_id: z.guid(),
47
47
  factor_type: z.literal("totp"),
48
- otpauth_url: z.string().url(),
48
+ otpauth_url: z.url(),
49
49
  qr_code_data_url: z.string().min(1),
50
50
  secret: z.string().min(16),
51
51
  })
52
52
  .strict();
53
53
  export const mfaVerifyEnrollmentBodySchema = z
54
54
  .object({
55
- factor_id: z.string().uuid(),
55
+ factor_id: z.guid(),
56
56
  code: totpCodeSchema,
57
57
  })
58
58
  .strict();
@@ -82,7 +82,7 @@ export const mfaFactorStatusResponseSchema = z
82
82
  .object({
83
83
  enabled: z.boolean(),
84
84
  pending: z.boolean(),
85
- factor_id: z.string().uuid().optional(),
85
+ factor_id: z.guid().optional(),
86
86
  factor_type: mfaFactorTypeSchema.optional(),
87
87
  verified_at: z.number().int().positive().optional(),
88
88
  })
@@ -90,7 +90,7 @@ export const mfaFactorStatusResponseSchema = z
90
90
  // A single verified factor in the account-wide MFA status list.
91
91
  export const mfaEnrolledFactorSchema = z
92
92
  .object({
93
- factor_id: z.string().uuid(),
93
+ factor_id: z.guid(),
94
94
  factor_type: mfaFactorTypeSchema,
95
95
  verified_at: z.number().int().positive().optional(),
96
96
  })
@@ -117,7 +117,7 @@ export const mfaCodeOnlyBodySchema = z
117
117
  // enrolled factor's secret in turn.
118
118
  export const mfaTotpProofBodySchema = z
119
119
  .object({
120
- factor_id: z.string().uuid(),
120
+ factor_id: z.guid(),
121
121
  code: totpCodeSchema,
122
122
  })
123
123
  .strict();
@@ -1 +1 @@
1
- {"version":3,"file":"mfa-verify-body.js","sourceRoot":"","sources":["../../src/mfa/mfa-verify-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAElE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,KAAK,CAAC,UAAU,EAAE,oCAAoC,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC,CAAC;AAEX,uEAAuE;AACvE,uEAAuE;AACvE,2EAA2E;AAC3E,4EAA4E;AAC5E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACzD,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EA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