@fleetless/contracts 5.3.0-next.1 → 6.0.0-next.2

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 (89) hide show
  1. package/CHANGELOG.md +108 -33
  2. package/artifacts/openapi.json +2053 -784
  3. package/artifacts/routes.json +1680 -323
  4. package/artifacts/schema/accept-team-invite-request.schema.json +13 -7
  5. package/artifacts/schema/app-auth-config.schema.json +108 -4
  6. package/artifacts/schema/app-hosted-pages.schema.json +33 -0
  7. package/artifacts/schema/app-invitation.schema.json +5 -12
  8. package/artifacts/schema/app-mail-template-list-response.schema.json +4 -3
  9. package/artifacts/schema/app-mail-template.schema.json +3 -2
  10. package/artifacts/schema/app-sign-in-methods.schema.json +19 -0
  11. package/artifacts/schema/app-user-list-response.schema.json +36 -0
  12. package/artifacts/schema/app-user.schema.json +36 -0
  13. package/artifacts/schema/audit-query.schema.json +0 -6
  14. package/artifacts/schema/auth-me-response.schema.json +27 -0
  15. package/artifacts/schema/auth-ok.schema.json +13 -1
  16. package/artifacts/schema/client-accept-invitation-request.schema.json +3 -4
  17. package/artifacts/schema/client-identity.schema.json +13 -1
  18. package/artifacts/schema/client-login-code-request.schema.json +24 -0
  19. package/artifacts/schema/client-login-code-verify-request.schema.json +30 -0
  20. package/artifacts/schema/client-provider-list-response.schema.json +22 -2
  21. package/artifacts/schema/client-register-request.schema.json +3 -4
  22. package/artifacts/schema/client-sign-in-result.schema.json +55 -0
  23. package/artifacts/schema/client-two-factor-disable-request.schema.json +15 -0
  24. package/artifacts/schema/client-two-factor-setup-confirm-request.schema.json +20 -0
  25. package/artifacts/schema/client-two-factor-setup-confirm-response.schema.json +49 -0
  26. package/artifacts/schema/client-two-factor-setup-request.schema.json +12 -0
  27. package/artifacts/schema/client-two-factor-verify-request.schema.json +25 -0
  28. package/artifacts/schema/create-app-invitation-request.schema.json +1 -1
  29. package/artifacts/schema/create-passkey-request.schema.json +25 -0
  30. package/artifacts/schema/create-passkey-response.schema.json +84 -0
  31. package/artifacts/schema/developer-passkey.schema.json +56 -0
  32. package/artifacts/schema/developer-two-factor.schema.json +105 -0
  33. package/artifacts/schema/fleetless-user-list-response.schema.json +22 -0
  34. package/artifacts/schema/fleetless-user.schema.json +22 -0
  35. package/artifacts/schema/invalid-code-details.schema.json +16 -0
  36. package/artifacts/schema/job-actor.schema.json +1 -15
  37. package/artifacts/schema/job-run-list-response.schema.json +1 -15
  38. package/artifacts/schema/job-run.schema.json +1 -15
  39. package/artifacts/schema/org.schema.json +5 -0
  40. package/artifacts/schema/patch-org-request.schema.json +5 -3
  41. package/artifacts/schema/patch-org-response.schema.json +5 -0
  42. package/artifacts/schema/put-app-auth-look-request.schema.json +22 -0
  43. package/artifacts/schema/put-app-auth-mcp-request.schema.json +1 -14
  44. package/artifacts/schema/put-app-auth-sign-in-request.schema.json +39 -0
  45. package/artifacts/schema/put-app-auth-urls-request.schema.json +31 -4
  46. package/artifacts/schema/recovery-codes-response.schema.json +20 -0
  47. package/artifacts/schema/{role-rename-request.schema.json → rename-passkey-request.schema.json} +2 -2
  48. package/artifacts/schema/role-list-response.schema.json +1 -1
  49. package/artifacts/schema/role.schema.json +1 -1
  50. package/artifacts/schema/totp-confirm-request.schema.json +15 -0
  51. package/artifacts/schema/totp-confirm-response.schema.json +27 -0
  52. package/artifacts/schema/two-factor-challenge.schema.json +24 -0
  53. package/artifacts/schema/two-factor-setup-response.schema.json +21 -0
  54. package/artifacts/schema/webauthn-options-response.schema.json +18 -0
  55. package/dist/app-users.d.ts +154 -35
  56. package/dist/app-users.js +177 -46
  57. package/dist/apps.d.ts +2 -38
  58. package/dist/apps.js +3 -46
  59. package/dist/audit.d.ts +0 -1
  60. package/dist/audit.js +0 -13
  61. package/dist/client-auth.d.ts +133 -24
  62. package/dist/client-auth.js +139 -28
  63. package/dist/config.d.ts +2 -2
  64. package/dist/errors.d.ts +10 -1
  65. package/dist/errors.js +37 -38
  66. package/dist/identity.d.ts +175 -128
  67. package/dist/identity.js +192 -106
  68. package/dist/index.d.ts +11 -13
  69. package/dist/index.js +12 -10
  70. package/dist/jobs.d.ts +0 -3
  71. package/dist/jobs.js +0 -16
  72. package/dist/protocol.d.ts +1 -1
  73. package/dist/realtime.d.ts +1 -0
  74. package/dist/rest.d.ts +2 -2
  75. package/dist/rest.js +17 -28
  76. package/dist/routes.d.ts +26 -0
  77. package/dist/routes.js +528 -234
  78. package/package.json +1 -1
  79. package/artifacts/schema/developer-login-request.schema.json +0 -19
  80. package/artifacts/schema/feedback-request.schema.json +0 -34
  81. package/artifacts/schema/feedback-response.schema.json +0 -27
  82. package/artifacts/schema/password-reset-confirm.schema.json +0 -19
  83. package/artifacts/schema/password-reset-request.schema.json +0 -14
  84. package/artifacts/schema/role-delete-query.schema.json +0 -13
  85. package/artifacts/schema/role-in-use-details.schema.json +0 -28
  86. package/artifacts/schema/sign-up-request.schema.json +0 -26
  87. package/artifacts/schema/sign-up-response.schema.json +0 -127
  88. package/dist/feedback.d.ts +0 -42
  89. package/dist/feedback.js +0 -35
@@ -7,9 +7,10 @@ import { z } from 'zod';
7
7
  * There are two identity spaces now and **nothing joins them**:
8
8
  *
9
9
  * - *Fleetless users*, this file. The people who configure robots in the
10
- * console. Email globally unique, tier `owner | developer`, a Fleetless
11
- * password, login through the auth portal. They always have MCP access, at
12
- * the one central endpoint.
10
+ * console. Email globally unique, tier `owner | developer`, sign-in through
11
+ * the auth portal by a code mailed to them or by a passkey — **no
12
+ * password** — with an optional second factor the organisation may require.
13
+ * They always have MCP access, at the one central endpoint.
13
14
  * - *app users*, `app-users.ts`. The people who use a developer's app. One app
14
15
  * each, email unique per app, authenticated through the JSON client-auth
15
16
  * API that the developer's own UI calls.
@@ -24,25 +25,31 @@ import { z } from 'zod';
24
25
  * the two populations have different lifecycles, and every joining mechanism
25
26
  * was cost without a product reason.
26
27
  *
27
- * What did **not** change: the password rules, the session and token shapes,
28
- * and the enumeration-oracle reasoning on password reset. None of those was
29
- * ever a statement about which space a person lived in.
28
+ * What did **not** change: the session and token shapes, and the
29
+ * enumeration-oracle reasoning. Neither was ever a statement about which space
30
+ * a person lived in.
31
+ *
32
+ * **Developers have no password any more.** They sign in with a six-digit
33
+ * code mailed to them, or with a passkey, which proves possession and user
34
+ * verification at once and so completes a sign-in on its own. After a code,
35
+ * a developer with a second factor — a passkey or an authenticator app —
36
+ * gives it; ten recovery codes are the fallback. The password sign-in, the
37
+ * password change, the reset pages and `POST /api/auth/signup` are gone: the
38
+ * portal's sign-up (email, code, organisation) is the one door in.
30
39
  *
31
40
  * **Email is globally unique here** — `lower(email)` unique across all orgs, so
32
- * one address is exactly one Fleetless user in exactly one org. Every shape
33
- * that identifies a person by a bare address (`developerLoginRequest`,
34
- * `passwordResetRequest`) therefore resolves to at most one account with no org
35
- * context needed. App users are the opposite and say so on their own shape:
36
- * unique **per app**, so one address may be several unrelated app accounts.
41
+ * one address is exactly one Fleetless user in exactly one org. A bare address
42
+ * therefore resolves to at most one account with no org context needed. App
43
+ * users are the opposite and say so on their own shape: unique **per app**, so
44
+ * one address may be several unrelated app accounts.
37
45
  */
38
46
  /**
39
47
  * The password rule, stated once so the cloud, the console and the SDK refuse
40
48
  * the same inputs for the same reason. Length only: a rule a user cannot
41
49
  * predict is a rule they work around.
42
50
  *
43
- * Shared by both identity spaces on purpose. A weaker rule for app users would
44
- * be a second policy for one decision, and the weaker one always wins by
45
- * accident.
51
+ * App users only: Fleetless users sign in by emailed code or passkey and hold
52
+ * no password.
46
53
  */
47
54
  export declare const password: z.ZodString;
48
55
  /** The bound on a Fleetless user's display name; `APP_USER_DISPLAY_NAME_MAX` matches it, so a rename cannot be legal in one space and refused in the other. */
@@ -70,6 +77,7 @@ export type OrgAdminTier = z.infer<typeof orgAdminTier>;
70
77
  export declare const org: z.ZodObject<{
71
78
  id: z.ZodUUID;
72
79
  name: z.ZodString;
80
+ require_two_factor: z.ZodBoolean;
73
81
  created_at: z.ZodISODateTime;
74
82
  }, z.core.$strip>;
75
83
  export type Org = z.infer<typeof org>;
@@ -78,13 +86,14 @@ export declare const patchOrgResponse: z.ZodObject<{
78
86
  org: z.ZodObject<{
79
87
  id: z.ZodUUID;
80
88
  name: z.ZodString;
89
+ require_two_factor: z.ZodBoolean;
81
90
  created_at: z.ZodISODateTime;
82
91
  }, z.core.$strip>;
83
92
  }, z.core.$strip>;
84
93
  export type PatchOrgResponse = z.infer<typeof patchOrgResponse>;
85
94
  /**
86
- * **A member of the org's team.** Console access, a tier, a Fleetless
87
- * password, and no relationship whatsoever to any app's users.
95
+ * **A member of the org's team.** Console access, a tier, a sign-in by
96
+ * emailed code or passkey, and no relationship whatsoever to any app's users.
88
97
  *
89
98
  * `email` is **globally unique** — `lower(email)` unique across every org, a
90
99
  * constraint the cloud enforces in the database; a schema cannot see two rows
@@ -95,10 +104,10 @@ export type PatchOrgResponse = z.infer<typeof patchOrgResponse>;
95
104
  * groups), `mcp_access` (a Fleetless user always has MCP access, at the
96
105
  * central endpoint), and `has_password`. The last is the interesting one — it
97
106
  * existed because a pool user might have been provisioned by an identity
98
- * provider and hold no Fleetless credential. A Fleetless user always holds
99
- * one: the console is password-only by design, which removes the
100
- * IdP-lockout class entirely, so a field reporting whether the credential
101
- * exists would have exactly one value forever.
107
+ * provider and hold no Fleetless credential. Every Fleetless user signs in by
108
+ * a code mailed to their address, so the console has no federated door and
109
+ * no IdP-lockout class, and a field about a password would describe nothing.
110
+ * What varies is the second factor, which `two_factor` reports.
102
111
  */
103
112
  export declare const fleetlessUser: z.ZodObject<{
104
113
  id: z.ZodUUID;
@@ -109,6 +118,10 @@ export declare const fleetlessUser: z.ZodObject<{
109
118
  owner: "owner";
110
119
  developer: "developer";
111
120
  }>;
121
+ two_factor: z.ZodObject<{
122
+ passkeys: z.ZodNumber;
123
+ authenticator: z.ZodBoolean;
124
+ }, z.core.$strip>;
112
125
  created_at: z.ZodISODateTime;
113
126
  }, z.core.$strip>;
114
127
  export type FleetlessUser = z.infer<typeof fleetlessUser>;
@@ -123,6 +136,10 @@ export declare const fleetlessUserListResponse: z.ZodObject<{
123
136
  owner: "owner";
124
137
  developer: "developer";
125
138
  }>;
139
+ two_factor: z.ZodObject<{
140
+ passkeys: z.ZodNumber;
141
+ authenticator: z.ZodBoolean;
142
+ }, z.core.$strip>;
126
143
  created_at: z.ZodISODateTime;
127
144
  }, z.core.$strip>>;
128
145
  }, z.core.$strip>;
@@ -146,48 +163,35 @@ export declare const refreshRequest: z.ZodObject<{
146
163
  }, z.core.$strip>;
147
164
  export type RefreshRequest = z.infer<typeof refreshRequest>;
148
165
  /**
149
- * Registering an org creates the org and its first owner in one step: whoever
150
- * registers the organisation is the owner.
166
+ * **A six-digit code**: the emailed sign-in code (valid ten minutes, five
167
+ * wrong attempts) and an authenticator's time-based code alike. Exactly six
168
+ * digits on the wire, leading zeros included — the portal and hosted forms
169
+ * strip spaces before they send it, the JSON API does not.
151
170
  */
152
- export declare const signUpRequest: z.ZodObject<{
153
- org_name: z.ZodString;
154
- email: z.ZodEmail;
155
- password: z.ZodString;
156
- }, z.core.$strip>;
157
- export type SignUpRequest = z.infer<typeof signUpRequest>;
171
+ export declare const loginCode: z.ZodString;
172
+ /** An authenticator app's code (TOTP, RFC 6238: SHA-1, six digits, thirty-second steps). The same shape as `loginCode`. */
173
+ export declare const totpCode: z.ZodString;
158
174
  /**
159
- * Registering answers with the founding **Fleetless user**, tier `owner`.
160
- *
161
- * The key is `user` rather than `member` or `owner`, and it has stayed `user`
162
- * through two identity redesigns deliberately: a renamed shape under a
163
- * renamed key would typecheck in every consumer that reads `.user.id` and mean
164
- * something subtly different, which is the quietest way for a cut like this to
165
- * go wrong.
175
+ * **A recovery code as typed**: two groups of five base32 characters,
176
+ * `xxxxx-xxxxx`, in either case — the cloud lower-cases before it compares.
177
+ * Single use.
166
178
  */
167
- export declare const signUpResponse: z.ZodObject<{
168
- org: z.ZodObject<{
169
- id: z.ZodUUID;
170
- name: z.ZodString;
171
- created_at: z.ZodISODateTime;
172
- }, z.core.$strip>;
173
- user: z.ZodObject<{
174
- id: z.ZodUUID;
175
- org_id: z.ZodUUID;
176
- email: z.ZodEmail;
177
- display_name: z.ZodNullable<z.ZodString>;
178
- tier: z.ZodEnum<{
179
- owner: "owner";
180
- developer: "developer";
181
- }>;
182
- created_at: z.ZodISODateTime;
183
- }, z.core.$strip>;
184
- tokens: z.ZodObject<{
185
- access_token: z.ZodString;
186
- refresh_token: z.ZodString;
187
- expires_in: z.ZodNumber;
188
- }, z.core.$strip>;
179
+ export declare const recoveryCode: z.ZodString;
180
+ /**
181
+ * **The ten recovery codes, as issued**: lowercase, shown once. Generating a
182
+ * new set voids the old one.
183
+ */
184
+ export declare const recoveryCodesList: z.ZodArray<z.ZodString>;
185
+ /**
186
+ * **An authenticator being set up**: the secret to type in, and the same
187
+ * secret as an `otpauth://` URL for a QR code. Nothing is stored as
188
+ * confirmed until a code from it is confirmed.
189
+ */
190
+ export declare const twoFactorSetupResponse: z.ZodObject<{
191
+ secret: z.ZodString;
192
+ otpauth_url: z.ZodString;
189
193
  }, z.core.$strip>;
190
- export type SignUpResponse = z.infer<typeof signUpResponse>;
194
+ export type TwoFactorSetupResponse = z.infer<typeof twoFactorSetupResponse>;
191
195
  /**
192
196
  * The landing page's waiting list (public site, 2026-09-04): one address,
193
197
  * posted from fleetless.dev while sign-up is closed. The route answers
@@ -202,25 +206,6 @@ export declare const waitlistRequest: z.ZodObject<{
202
206
  email: z.ZodEmail;
203
207
  }, z.core.$strip>;
204
208
  export type WaitlistRequest = z.infer<typeof waitlistRequest>;
205
- /**
206
- * Console login. Fleetless users only, always the Fleetless password — the
207
- * console has no federated door at all, which removes the IdP-lockout
208
- * class entirely.
209
- *
210
- * This resolves a person by address alone, and a Fleetless user's email is
211
- * **globally unique**, so a bare address names at most one account and no org
212
- * context is needed to disambiguate. An org selector was never needed and
213
- * would have told an unauthenticated caller which org an address belongs to.
214
- *
215
- * **It cannot be reached by an app user**, whatever their address: the two
216
- * spaces have separate tables and separate routes, and a credential from one
217
- * never authenticates the other.
218
- */
219
- export declare const developerLoginRequest: z.ZodObject<{
220
- email: z.ZodEmail;
221
- password: z.ZodString;
222
- }, z.core.$strip>;
223
- export type DeveloperLoginRequest = z.infer<typeof developerLoginRequest>;
224
209
  /**
225
210
  * What happened to the mail, in four words instead of one.
226
211
  *
@@ -235,11 +220,9 @@ export type DeveloperLoginRequest = z.infer<typeof developerLoginRequest>;
235
220
  * no sender can promise that, and this value must never
236
221
  * be rendered as if it could.
237
222
  * - `not_requested` — no mail was attempted: the caller asked for none
238
- * (`send_mail: false`), or there was no link for one to
239
- * carry (the app has configured no `invite_url`, which
240
- * the `null` `accept_url` beside it says). **A fourth
241
- * word rather than a reuse of `not_configured`**: the
242
- * deployment's mailer is irrelevant in both cases, and a
223
+ * (`send_mail: false`). **A fourth word rather than a
224
+ * reuse of `not_configured`**: the deployment's mailer
225
+ * is irrelevant there, and a
243
226
  * console reading "mail server not configured" beside an
244
227
  * invitation whose mail checkbox was off would send a
245
228
  * developer to fix something that is not broken.
@@ -341,10 +324,14 @@ export declare const pendingTeamInviteListResponse: z.ZodObject<{
341
324
  }, z.core.$strip>>;
342
325
  }, z.core.$strip>;
343
326
  export type PendingTeamInviteListResponse = z.infer<typeof pendingTeamInviteListResponse>;
344
- /** Accepting it: the token proves the invitation, the password creates the login. */
327
+ /**
328
+ * Accepting it: the token proves the invitation, and the mailed link proves
329
+ * the address, so accepting needs no code and takes **no password** — the
330
+ * new member signs in by emailed code from then on.
331
+ */
345
332
  export declare const acceptTeamInviteRequest: z.ZodObject<{
346
333
  token: z.ZodString;
347
- password: z.ZodString;
334
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
335
  }, z.core.$strict>;
349
336
  export type AcceptTeamInviteRequest = z.infer<typeof acceptTeamInviteRequest>;
350
337
  /**
@@ -407,58 +394,20 @@ export declare const tierRequiredDetails: z.ZodObject<{
407
394
  }, z.core.$strip>;
408
395
  export type TierRequiredDetails = z.infer<typeof tierRequiredDetails>;
409
396
  /**
410
- * Changing your own password while logged in.
397
+ * An app user changing their own password while signed in
398
+ * (`POST /api/client/password/change`). Fleetless users have no password.
411
399
  *
412
400
  * `current_password` is required even though the session already proves
413
401
  * identity: it is what makes a stolen *session* insufficient to take the
414
402
  * *account*. Every other session is revoked on success; the one that made the
415
403
  * change survives, because logging someone out of the tab they just used is
416
404
  * indistinguishable from the change having failed.
417
- *
418
- * Shared with the app-user surface (`POST /api/client/password/change`): the
419
- * argument is about credentials and sessions, not about which space the person
420
- * lives in.
421
405
  */
422
406
  export declare const passwordChangeRequest: z.ZodObject<{
423
407
  current_password: z.ZodString;
424
408
  new_password: z.ZodString;
425
409
  }, z.core.$strip>;
426
410
  export type PasswordChangeRequest = z.infer<typeof passwordChangeRequest>;
427
- /**
428
- * Asking for a reset link, **as a Fleetless user**.
429
- *
430
- * **The response never says whether the address exists.** It is unauthenticated
431
- * and would otherwise be an account-enumeration oracle — the one place where
432
- * revealing nothing about what exists is not a preference but the whole point.
433
- * So this answers the same way for a known and an unknown address, in
434
- * status, body **and timing**, and any consumer that renders "no such account"
435
- * from it has reintroduced the oracle.
436
- *
437
- * A bare address resolves to at most one account: a Fleetless user's email is
438
- * **globally unique**, so the reset mails the one match, if any, with a token
439
- * bound to that account.
440
- *
441
- * The app-user equivalent is `clientPasswordResetRequest` in `client-auth.ts`
442
- * and carries an `app_identifier`, because on that surface a person is
443
- * identified by app *and* address. Two shapes rather than one, because the two
444
- * surfaces identify a person differently — not because the reasoning differs.
445
- */
446
- export declare const passwordResetRequest: z.ZodObject<{
447
- email: z.ZodEmail;
448
- }, z.core.$strip>;
449
- export type PasswordResetRequest = z.infer<typeof passwordResetRequest>;
450
- /**
451
- * Using the link. The token is **single-use and expires**; spending it revokes
452
- * every session of that subject, because a forgotten password is one of the
453
- * two states where somebody else may be holding one. `token_spent` covers used
454
- * and expired alike — telling them apart tells a stranger whether a token ever
455
- * existed.
456
- */
457
- export declare const passwordResetConfirm: z.ZodObject<{
458
- token: z.ZodString;
459
- new_password: z.ZodString;
460
- }, z.core.$strip>;
461
- export type PasswordResetConfirm = z.infer<typeof passwordResetConfirm>;
462
411
  /**
463
412
  * An IdP issuer URL — **an attacker-supplied string that decides where the
464
413
  * *server* connects.**
@@ -494,8 +443,8 @@ export type IdpIssuer = z.infer<typeof idpIssuer>;
494
443
  * here.** `oidcCallbackErrorCode` and `oidcCallbackError` described the page
495
444
  * `GET /mcp/oauth/idp-callback` rendered when a group's identity provider sent
496
445
  * a browser back — `jit_disabled` and `email_collision` name provisioning steps
497
- * only a group provider had. Fleetless users are password-only now, which deletes
498
- * group providers, so the flow that produced these codes cannot start; the
446
+ * only a group provider had. Fleetless users sign in by emailed code or
447
+ * passkey, with no group providers, so the flow that produced these codes cannot start; the
499
448
  * route is gone from this manifest and from the cloud.
500
449
  *
501
450
  * The per-app OIDC vocabulary is `clientOidcErrorCode` in `client-auth.ts`: a
@@ -518,6 +467,7 @@ export declare const authMeResponse: z.ZodObject<{
518
467
  org: z.ZodObject<{
519
468
  id: z.ZodUUID;
520
469
  name: z.ZodString;
470
+ require_two_factor: z.ZodBoolean;
521
471
  created_at: z.ZodISODateTime;
522
472
  }, z.core.$strip>;
523
473
  user: z.ZodObject<{
@@ -529,13 +479,22 @@ export declare const authMeResponse: z.ZodObject<{
529
479
  owner: "owner";
530
480
  developer: "developer";
531
481
  }>;
482
+ two_factor: z.ZodObject<{
483
+ passkeys: z.ZodNumber;
484
+ authenticator: z.ZodBoolean;
485
+ }, z.core.$strip>;
532
486
  created_at: z.ZodISODateTime;
533
487
  }, z.core.$strip>;
534
488
  }, z.core.$strip>;
535
489
  export type AuthMeResponse = z.infer<typeof authMeResponse>;
536
- /** `PATCH /api/org` — rename the org. Owner only. Same bounds as signup's `org_name`. */
490
+ /**
491
+ * `PATCH /api/org` — rename the org, require two-factor for its members, or
492
+ * both. Owner only. At least one field: an empty patch is a refusal rather
493
+ * than a write that changed nothing.
494
+ */
537
495
  export declare const patchOrgRequest: z.ZodObject<{
538
- name: z.ZodString;
496
+ name: z.ZodOptional<z.ZodString>;
497
+ require_two_factor: z.ZodOptional<z.ZodBoolean>;
539
498
  }, z.core.$strict>;
540
499
  export type PatchOrgRequest = z.infer<typeof patchOrgRequest>;
541
500
  /** `PATCH /api/auth/me` — the caller updates their own display name (null clears it). */
@@ -543,3 +502,91 @@ export declare const patchAuthMeRequest: z.ZodObject<{
543
502
  display_name: z.ZodNullable<z.ZodString>;
544
503
  }, z.core.$strict>;
545
504
  export type PatchAuthMeRequest = z.infer<typeof patchAuthMeRequest>;
505
+ /**
506
+ * **A WebAuthn JSON document, opaque here.** The `PublicKeyCredential*JSON`
507
+ * shapes of the WebAuthn Level 3 specification — creation and request options
508
+ * going out, the browser's credential coming back. The browser API and the
509
+ * server library define them; a second, hand-written copy here would be one
510
+ * that drifts.
511
+ */
512
+ export declare const webauthnJson: z.ZodRecord<z.ZodString, z.ZodUnknown>;
513
+ /**
514
+ * **Options for a WebAuthn ceremony**, to hand to the browser as they are.
515
+ * The relying party is `fleetless.dev`, so the auth portal and the console
516
+ * both accept the same passkey; user verification is required.
517
+ */
518
+ export declare const webauthnOptionsResponse: z.ZodObject<{
519
+ options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
520
+ }, z.core.$strip>;
521
+ export type WebauthnOptionsResponse = z.infer<typeof webauthnOptionsResponse>;
522
+ /** **One registered passkey**, as Settings › Profile lists it. No key material travels here. */
523
+ export declare const developerPasskey: z.ZodObject<{
524
+ id: z.ZodUUID;
525
+ name: z.ZodString;
526
+ created_at: z.ZodISODateTime;
527
+ last_used_at: z.ZodNullable<z.ZodISODateTime>;
528
+ synced: z.ZodNullable<z.ZodBoolean>;
529
+ }, z.core.$strip>;
530
+ export type DeveloperPasskey = z.infer<typeof developerPasskey>;
531
+ /** **`GET /api/auth/two-factor`** — the caller's own second factors, in full. */
532
+ export declare const developerTwoFactor: z.ZodObject<{
533
+ passkeys: z.ZodArray<z.ZodObject<{
534
+ id: z.ZodUUID;
535
+ name: z.ZodString;
536
+ created_at: z.ZodISODateTime;
537
+ last_used_at: z.ZodNullable<z.ZodISODateTime>;
538
+ synced: z.ZodNullable<z.ZodBoolean>;
539
+ }, z.core.$strip>>;
540
+ authenticator: z.ZodNullable<z.ZodObject<{
541
+ created_at: z.ZodISODateTime;
542
+ }, z.core.$strip>>;
543
+ recovery_codes_left: z.ZodNumber;
544
+ required_by_org: z.ZodBoolean;
545
+ }, z.core.$strip>;
546
+ export type DeveloperTwoFactor = z.infer<typeof developerTwoFactor>;
547
+ /** **Registering a passkey**: the name, and the browser's answer to the creation options. */
548
+ export declare const createPasskeyRequest: z.ZodObject<{
549
+ name: z.ZodString;
550
+ credential: z.ZodRecord<z.ZodString, z.ZodUnknown>;
551
+ }, z.core.$strict>;
552
+ export type CreatePasskeyRequest = z.infer<typeof createPasskeyRequest>;
553
+ /**
554
+ * **The registered passkey**, and the ten recovery codes when it is the
555
+ * account's first second factor — `null` otherwise, since the existing codes
556
+ * stay valid.
557
+ */
558
+ export declare const createPasskeyResponse: z.ZodObject<{
559
+ passkey: z.ZodObject<{
560
+ id: z.ZodUUID;
561
+ name: z.ZodString;
562
+ created_at: z.ZodISODateTime;
563
+ last_used_at: z.ZodNullable<z.ZodISODateTime>;
564
+ synced: z.ZodNullable<z.ZodBoolean>;
565
+ }, z.core.$strip>;
566
+ recovery_codes: z.ZodNullable<z.ZodArray<z.ZodString>>;
567
+ }, z.core.$strip>;
568
+ export type CreatePasskeyResponse = z.infer<typeof createPasskeyResponse>;
569
+ /** **Renaming a passkey.** The name is the only thing about one that can change. */
570
+ export declare const renamePasskeyRequest: z.ZodObject<{
571
+ name: z.ZodString;
572
+ }, z.core.$strict>;
573
+ export type RenamePasskeyRequest = z.infer<typeof renamePasskeyRequest>;
574
+ /** **Confirming a new authenticator** with a code it shows now. */
575
+ export declare const totpConfirmRequest: z.ZodObject<{
576
+ code: z.ZodString;
577
+ }, z.core.$strict>;
578
+ export type TotpConfirmRequest = z.infer<typeof totpConfirmRequest>;
579
+ /**
580
+ * **The confirmed authenticator.** Ten recovery codes when it is the
581
+ * account's first second factor; `null` when it replaces an authenticator or
582
+ * joins passkeys, whose codes stay valid.
583
+ */
584
+ export declare const totpConfirmResponse: z.ZodObject<{
585
+ recovery_codes: z.ZodNullable<z.ZodArray<z.ZodString>>;
586
+ }, z.core.$strip>;
587
+ export type TotpConfirmResponse = z.infer<typeof totpConfirmResponse>;
588
+ /** **A fresh set of ten recovery codes**, shown once. The previous set stops working. */
589
+ export declare const recoveryCodesResponse: z.ZodObject<{
590
+ recovery_codes: z.ZodArray<z.ZodString>;
591
+ }, z.core.$strip>;
592
+ export type RecoveryCodesResponse = z.infer<typeof recoveryCodesResponse>;