@seamless-auth/types 0.31.0 → 0.32.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/CHANGELOG.md +11 -0
- package/dist/schemas/me/schema.d.ts +1 -0
- package/dist/schemas/me/schema.d.ts.map +1 -1
- package/dist/schemas/me/schema.js +6 -0
- package/dist/schemas/me/schema.js.map +1 -1
- package/dist/schemas/recovery/schema.d.ts +120 -2
- package/dist/schemas/recovery/schema.d.ts.map +1 -1
- package/dist/schemas/recovery/schema.js +34 -2
- package/dist/schemas/recovery/schema.js.map +1 -1
- package/package.json +1 -1
- package/src/schemas/me/schema.ts +6 -0
- package/src/schemas/recovery/schema.ts +49 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @seamless-auth/types
|
|
2
2
|
|
|
3
|
+
## 0.32.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- cf2de06: Shared schemas for the rest of the v0.20 account recovery contract, and a recovery flag on `/users/me`.
|
|
8
|
+
|
|
9
|
+
- `AccountRecoveryRequestSchema` and `AccountRecoveryRequestsResponseSchema` for `GET /recovery/requests`, and `AccountRecoveryRequestIdParamSchema` for `DELETE /recovery/requests/:id`.
|
|
10
|
+
- `AccountRecoveryVerifyResponseSchema`: the status plus the optional `deliveries` returned to a server that owns delivery.
|
|
11
|
+
- `RecoveryErrorCodeSchema`, the `error` values the recovery code and account recovery routes answer with.
|
|
12
|
+
- `MeResponseSchema` gains optional `recovery`, true for a recovery session, so a cookie client can tell after a reload that the user still has to enroll a factor.
|
|
13
|
+
|
|
3
14
|
## 0.31.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -102,6 +102,7 @@ export declare const MeResponseSchema: z.ZodObject<{
|
|
|
102
102
|
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
103
103
|
retiredOAuthProviders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
104
|
}, z.core.$strip>>>;
|
|
105
|
+
recovery: z.ZodOptional<z.ZodBoolean>;
|
|
105
106
|
}, z.core.$strip>;
|
|
106
107
|
export type MeResponse = z.infer<typeof MeResponseSchema>;
|
|
107
108
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/me/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;iBAOvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/me/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;iBAOvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -20,5 +20,11 @@ export const MeResponseSchema = z.object({
|
|
|
20
20
|
credentials: z.array(CredentialResponseSchema),
|
|
21
21
|
organizations: z.array(OrganizationSchema).optional(),
|
|
22
22
|
activeOrganization: OrganizationSchema.nullable().optional(),
|
|
23
|
+
/**
|
|
24
|
+
* True for a recovery session, from account recovery or a recovery code: it can only
|
|
25
|
+
* enroll a new passkey or authenticator app until one is enrolled. A cookie client
|
|
26
|
+
* cannot read its access token, so this is how it learns that after a reload.
|
|
27
|
+
*/
|
|
28
|
+
recovery: z.boolean().optional(),
|
|
23
29
|
});
|
|
24
30
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schemas/me/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACxC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IAC9C,aA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AE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
|
@@ -149,8 +149,126 @@ export declare const AccountRecoveryStatusSchema: z.ZodObject<{
|
|
|
149
149
|
}, z.core.$strip>;
|
|
150
150
|
export type AccountRecoveryStatus = z.infer<typeof AccountRecoveryStatusSchema>;
|
|
151
151
|
/**
|
|
152
|
-
* `POST /recovery/
|
|
153
|
-
*
|
|
152
|
+
* `POST /recovery/verify`. `deliveries` carries the "recovery opened" notices only for a
|
|
153
|
+
* credentialed caller that owns delivery and names their kinds in
|
|
154
|
+
* `x-seamless-auth-delivery-kinds`; each can hold a cancel link for the owner alone.
|
|
155
|
+
*/
|
|
156
|
+
export declare const AccountRecoveryVerifyResponseSchema: z.ZodObject<{
|
|
157
|
+
state: z.ZodEnum<{
|
|
158
|
+
completed: "completed";
|
|
159
|
+
pending: "pending";
|
|
160
|
+
ready: "ready";
|
|
161
|
+
cancelled: "cancelled";
|
|
162
|
+
}>;
|
|
163
|
+
requestedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
164
|
+
completesAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
165
|
+
deliveries: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
166
|
+
kind: z.ZodLiteral<"otp_email">;
|
|
167
|
+
to: z.ZodString;
|
|
168
|
+
token: z.ZodString;
|
|
169
|
+
purpose: z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
account_recovery: "account_recovery";
|
|
171
|
+
}>>;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
kind: z.ZodLiteral<"otp_sms">;
|
|
174
|
+
to: z.ZodString;
|
|
175
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
176
|
+
purpose: z.ZodOptional<z.ZodEnum<{
|
|
177
|
+
account_recovery: "account_recovery";
|
|
178
|
+
}>>;
|
|
179
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
180
|
+
kind: z.ZodLiteral<"magic_link_email">;
|
|
181
|
+
to: z.ZodString;
|
|
182
|
+
token: z.ZodOptional<z.ZodString>;
|
|
183
|
+
magicLinkUrl: z.ZodString;
|
|
184
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
+
kind: z.ZodLiteral<"enrollment_invite_email">;
|
|
186
|
+
to: z.ZodString;
|
|
187
|
+
signInUrl: z.ZodString;
|
|
188
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
189
|
+
kind: z.ZodLiteral<"account_notice_email">;
|
|
190
|
+
notice: z.ZodEnum<{
|
|
191
|
+
account_recovery_completed: "account_recovery_completed";
|
|
192
|
+
recovery_code_used: "recovery_code_used";
|
|
193
|
+
account_recovery_opened: "account_recovery_opened";
|
|
194
|
+
identity_changed: "identity_changed";
|
|
195
|
+
}>;
|
|
196
|
+
to: z.ZodString;
|
|
197
|
+
subject: z.ZodString;
|
|
198
|
+
text: z.ZodString;
|
|
199
|
+
cancelUrl: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
kind: z.ZodLiteral<"account_notice_sms">;
|
|
202
|
+
notice: z.ZodEnum<{
|
|
203
|
+
account_recovery_completed: "account_recovery_completed";
|
|
204
|
+
recovery_code_used: "recovery_code_used";
|
|
205
|
+
account_recovery_opened: "account_recovery_opened";
|
|
206
|
+
identity_changed: "identity_changed";
|
|
207
|
+
}>;
|
|
208
|
+
to: z.ZodString;
|
|
209
|
+
text: z.ZodString;
|
|
210
|
+
cancelUrl: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, z.core.$strip>], "kind">>>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
export type AccountRecoveryVerifyResponse = z.infer<typeof AccountRecoveryVerifyResponseSchema>;
|
|
214
|
+
/** One open request, as `GET /recovery/requests` lists it for the signed-in owner. */
|
|
215
|
+
export declare const AccountRecoveryRequestSchema: z.ZodObject<{
|
|
216
|
+
state: z.ZodEnum<{
|
|
217
|
+
completed: "completed";
|
|
218
|
+
pending: "pending";
|
|
219
|
+
ready: "ready";
|
|
220
|
+
cancelled: "cancelled";
|
|
221
|
+
}>;
|
|
222
|
+
requestedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
223
|
+
completesAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
channel: z.ZodEnum<{
|
|
226
|
+
email: "email";
|
|
227
|
+
phone: "phone";
|
|
228
|
+
}>;
|
|
229
|
+
}, z.core.$strip>;
|
|
230
|
+
export type AccountRecoveryRequest = z.infer<typeof AccountRecoveryRequestSchema>;
|
|
231
|
+
export declare const AccountRecoveryRequestsResponseSchema: z.ZodObject<{
|
|
232
|
+
requests: z.ZodArray<z.ZodObject<{
|
|
233
|
+
state: z.ZodEnum<{
|
|
234
|
+
completed: "completed";
|
|
235
|
+
pending: "pending";
|
|
236
|
+
ready: "ready";
|
|
237
|
+
cancelled: "cancelled";
|
|
238
|
+
}>;
|
|
239
|
+
requestedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
240
|
+
completesAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
241
|
+
id: z.ZodString;
|
|
242
|
+
channel: z.ZodEnum<{
|
|
243
|
+
email: "email";
|
|
244
|
+
phone: "phone";
|
|
245
|
+
}>;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
}, z.core.$strip>;
|
|
248
|
+
export type AccountRecoveryRequestsResponse = z.infer<typeof AccountRecoveryRequestsResponseSchema>;
|
|
249
|
+
/** `DELETE /recovery/requests/:id`. */
|
|
250
|
+
export declare const AccountRecoveryRequestIdParamSchema: z.ZodObject<{
|
|
251
|
+
id: z.ZodString;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
export type AccountRecoveryRequestIdParam = z.infer<typeof AccountRecoveryRequestIdParamSchema>;
|
|
254
|
+
/**
|
|
255
|
+
* The `error` values the recovery code and account recovery routes answer with, so a
|
|
256
|
+
* client can tell them apart without matching strings of its own.
|
|
257
|
+
*/
|
|
258
|
+
export declare const RecoveryErrorCodeSchema: z.ZodEnum<{
|
|
259
|
+
invalid_recovery_code: "invalid_recovery_code";
|
|
260
|
+
recovery_codes_disabled: "recovery_codes_disabled";
|
|
261
|
+
cancel_token_required: "cancel_token_required";
|
|
262
|
+
recovery_notice_failed: "recovery_notice_failed";
|
|
263
|
+
account_recovery_disabled: "account_recovery_disabled";
|
|
264
|
+
recovery_not_found: "recovery_not_found";
|
|
265
|
+
recovery_not_ready: "recovery_not_ready";
|
|
266
|
+
enrollment_required: "enrollment_required";
|
|
267
|
+
}>;
|
|
268
|
+
export type RecoveryErrorCode = z.infer<typeof RecoveryErrorCodeSchema>;
|
|
269
|
+
/**
|
|
270
|
+
* `POST /recovery/cancel` with the token from the "recovery opened" notice. A signed-in
|
|
271
|
+
* owner cancels without it through `DELETE /recovery/requests/:id`.
|
|
154
272
|
*/
|
|
155
273
|
export declare const AccountRecoveryCancelRequestSchema: z.ZodObject<{
|
|
156
274
|
cancelToken: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/recovery/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;GAGG;AACH,eAAO,MAAM,kBAAkB,aAGiD,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,qFAAqF;AACrF,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC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AqC,CAAC,CAAC;AAEpG,uCAAuC;AACvC,eAAO,MAAM,mCAAmC;;iBAAsC,CAAC;AAEvF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;EASlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,kCAAkC;;iBAE7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
|
|
@@ -72,8 +72,40 @@ export const AccountRecoveryStatusSchema = z.object({
|
|
|
72
72
|
completesAt: IsoDate,
|
|
73
73
|
});
|
|
74
74
|
/**
|
|
75
|
-
* `POST /recovery/
|
|
76
|
-
*
|
|
75
|
+
* `POST /recovery/verify`. `deliveries` carries the "recovery opened" notices only for a
|
|
76
|
+
* credentialed caller that owns delivery and names their kinds in
|
|
77
|
+
* `x-seamless-auth-delivery-kinds`; each can hold a cancel link for the owner alone.
|
|
78
|
+
*/
|
|
79
|
+
export const AccountRecoveryVerifyResponseSchema = AccountRecoveryStatusSchema.extend({
|
|
80
|
+
deliveries: z.array(AuthDeliverySchema).optional(),
|
|
81
|
+
});
|
|
82
|
+
/** One open request, as `GET /recovery/requests` lists it for the signed-in owner. */
|
|
83
|
+
export const AccountRecoveryRequestSchema = AccountRecoveryStatusSchema.extend({
|
|
84
|
+
id: z.string().uuid(),
|
|
85
|
+
channel: AccountRecoveryChannelSchema,
|
|
86
|
+
});
|
|
87
|
+
export const AccountRecoveryRequestsResponseSchema = z.object({
|
|
88
|
+
requests: z.array(AccountRecoveryRequestSchema),
|
|
89
|
+
});
|
|
90
|
+
/** `DELETE /recovery/requests/:id`. */
|
|
91
|
+
export const AccountRecoveryRequestIdParamSchema = z.object({ id: z.string().uuid() });
|
|
92
|
+
/**
|
|
93
|
+
* The `error` values the recovery code and account recovery routes answer with, so a
|
|
94
|
+
* client can tell them apart without matching strings of its own.
|
|
95
|
+
*/
|
|
96
|
+
export const RecoveryErrorCodeSchema = z.enum([
|
|
97
|
+
'invalid_recovery_code',
|
|
98
|
+
'recovery_codes_disabled',
|
|
99
|
+
'cancel_token_required',
|
|
100
|
+
'recovery_notice_failed',
|
|
101
|
+
'account_recovery_disabled',
|
|
102
|
+
'recovery_not_found',
|
|
103
|
+
'recovery_not_ready',
|
|
104
|
+
'enrollment_required',
|
|
105
|
+
]);
|
|
106
|
+
/**
|
|
107
|
+
* `POST /recovery/cancel` with the token from the "recovery opened" notice. A signed-in
|
|
108
|
+
* owner cancels without it through `DELETE /recovery/requests/:id`.
|
|
77
109
|
*/
|
|
78
110
|
export const AccountRecoveryCancelRequestSchema = z.object({
|
|
79
111
|
cancelToken: z.string().trim().min(1).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schemas/recovery/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,EAAE;KACR,IAAI,EAAE;KACN,KAAK,CAAC,kCAAkC,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;AAIjF,qFAAqF;AACrF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC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AM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC5C,uBAAuB;IACvB,yBAAyB;IACzB,uBAAuB;IACvB,wBAAwB;IACxB,2BAA2B;IAC3B,oBAAoB;IACpB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/schemas/me/schema.ts
CHANGED
|
@@ -27,6 +27,12 @@ export const MeResponseSchema = z.object({
|
|
|
27
27
|
credentials: z.array(CredentialResponseSchema),
|
|
28
28
|
organizations: z.array(OrganizationSchema).optional(),
|
|
29
29
|
activeOrganization: OrganizationSchema.nullable().optional(),
|
|
30
|
+
/**
|
|
31
|
+
* True for a recovery session, from account recovery or a recovery code: it can only
|
|
32
|
+
* enroll a new passkey or authenticator app until one is enrolled. A cookie client
|
|
33
|
+
* cannot read its access token, so this is how it learns that after a reload.
|
|
34
|
+
*/
|
|
35
|
+
recovery: z.boolean().optional(),
|
|
30
36
|
});
|
|
31
37
|
|
|
32
38
|
export type MeResponse = z.infer<typeof MeResponseSchema>;
|
|
@@ -107,8 +107,55 @@ export const AccountRecoveryStatusSchema = z.object({
|
|
|
107
107
|
export type AccountRecoveryStatus = z.infer<typeof AccountRecoveryStatusSchema>;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* `POST /recovery/
|
|
111
|
-
*
|
|
110
|
+
* `POST /recovery/verify`. `deliveries` carries the "recovery opened" notices only for a
|
|
111
|
+
* credentialed caller that owns delivery and names their kinds in
|
|
112
|
+
* `x-seamless-auth-delivery-kinds`; each can hold a cancel link for the owner alone.
|
|
113
|
+
*/
|
|
114
|
+
export const AccountRecoveryVerifyResponseSchema = AccountRecoveryStatusSchema.extend({
|
|
115
|
+
deliveries: z.array(AuthDeliverySchema).optional(),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export type AccountRecoveryVerifyResponse = z.infer<typeof AccountRecoveryVerifyResponseSchema>;
|
|
119
|
+
|
|
120
|
+
/** One open request, as `GET /recovery/requests` lists it for the signed-in owner. */
|
|
121
|
+
export const AccountRecoveryRequestSchema = AccountRecoveryStatusSchema.extend({
|
|
122
|
+
id: z.string().uuid(),
|
|
123
|
+
channel: AccountRecoveryChannelSchema,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export type AccountRecoveryRequest = z.infer<typeof AccountRecoveryRequestSchema>;
|
|
127
|
+
|
|
128
|
+
export const AccountRecoveryRequestsResponseSchema = z.object({
|
|
129
|
+
requests: z.array(AccountRecoveryRequestSchema),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export type AccountRecoveryRequestsResponse = z.infer<typeof AccountRecoveryRequestsResponseSchema>;
|
|
133
|
+
|
|
134
|
+
/** `DELETE /recovery/requests/:id`. */
|
|
135
|
+
export const AccountRecoveryRequestIdParamSchema = z.object({ id: z.string().uuid() });
|
|
136
|
+
|
|
137
|
+
export type AccountRecoveryRequestIdParam = z.infer<typeof AccountRecoveryRequestIdParamSchema>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The `error` values the recovery code and account recovery routes answer with, so a
|
|
141
|
+
* client can tell them apart without matching strings of its own.
|
|
142
|
+
*/
|
|
143
|
+
export const RecoveryErrorCodeSchema = z.enum([
|
|
144
|
+
'invalid_recovery_code',
|
|
145
|
+
'recovery_codes_disabled',
|
|
146
|
+
'cancel_token_required',
|
|
147
|
+
'recovery_notice_failed',
|
|
148
|
+
'account_recovery_disabled',
|
|
149
|
+
'recovery_not_found',
|
|
150
|
+
'recovery_not_ready',
|
|
151
|
+
'enrollment_required',
|
|
152
|
+
]);
|
|
153
|
+
|
|
154
|
+
export type RecoveryErrorCode = z.infer<typeof RecoveryErrorCodeSchema>;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* `POST /recovery/cancel` with the token from the "recovery opened" notice. A signed-in
|
|
158
|
+
* owner cancels without it through `DELETE /recovery/requests/:id`.
|
|
112
159
|
*/
|
|
113
160
|
export const AccountRecoveryCancelRequestSchema = z.object({
|
|
114
161
|
cancelToken: z.string().trim().min(1).optional(),
|