@fleetless/contracts 5.2.0 → 6.0.0-next.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.
- package/CHANGELOG.md +99 -0
- package/artifacts/openapi.json +1975 -415
- package/artifacts/routes.json +1697 -251
- package/artifacts/schema/accept-team-invite-request.schema.json +13 -7
- package/artifacts/schema/app-auth-config.schema.json +108 -4
- package/artifacts/schema/app-hosted-pages.schema.json +33 -0
- package/artifacts/schema/app-invitation.schema.json +2 -2
- package/artifacts/schema/app-mail-template-list-response.schema.json +4 -3
- package/artifacts/schema/app-mail-template.schema.json +3 -2
- package/artifacts/schema/app-sign-in-methods.schema.json +19 -0
- package/artifacts/schema/app-user-list-response.schema.json +36 -0
- package/artifacts/schema/app-user.schema.json +36 -0
- package/artifacts/schema/auth-me-response.schema.json +27 -0
- package/artifacts/schema/auth-ok.schema.json +13 -1
- package/artifacts/schema/client-accept-invitation-request.schema.json +3 -4
- package/artifacts/schema/client-identity.schema.json +13 -1
- package/artifacts/schema/client-login-code-request.schema.json +24 -0
- package/artifacts/schema/client-login-code-verify-request.schema.json +30 -0
- package/artifacts/schema/client-provider-list-response.schema.json +22 -2
- package/artifacts/schema/client-register-request.schema.json +3 -4
- package/artifacts/schema/client-sign-in-result.schema.json +55 -0
- package/artifacts/schema/client-two-factor-disable-request.schema.json +15 -0
- package/artifacts/schema/client-two-factor-setup-confirm-request.schema.json +20 -0
- package/artifacts/schema/client-two-factor-setup-confirm-response.schema.json +49 -0
- package/artifacts/schema/client-two-factor-setup-request.schema.json +12 -0
- package/artifacts/schema/client-two-factor-verify-request.schema.json +25 -0
- package/artifacts/schema/create-app-invitation-request.schema.json +1 -1
- package/artifacts/schema/create-passkey-request.schema.json +25 -0
- package/artifacts/schema/create-passkey-response.schema.json +84 -0
- package/artifacts/schema/developer-passkey.schema.json +56 -0
- package/artifacts/schema/developer-two-factor.schema.json +105 -0
- package/artifacts/schema/fleetless-user-list-response.schema.json +22 -0
- package/artifacts/schema/fleetless-user.schema.json +22 -0
- package/artifacts/schema/invalid-code-details.schema.json +16 -0
- package/artifacts/schema/org.schema.json +5 -0
- package/artifacts/schema/patch-org-request.schema.json +5 -3
- package/artifacts/schema/patch-org-response.schema.json +5 -0
- package/artifacts/schema/put-app-auth-look-request.schema.json +22 -0
- package/artifacts/schema/put-app-auth-mcp-request.schema.json +1 -14
- package/artifacts/schema/put-app-auth-sign-in-request.schema.json +39 -0
- package/artifacts/schema/put-app-auth-urls-request.schema.json +31 -4
- package/artifacts/schema/recovery-codes-response.schema.json +20 -0
- package/artifacts/schema/rename-passkey-request.schema.json +16 -0
- package/artifacts/schema/totp-confirm-request.schema.json +15 -0
- package/artifacts/schema/totp-confirm-response.schema.json +27 -0
- package/artifacts/schema/two-factor-challenge.schema.json +24 -0
- package/artifacts/schema/two-factor-setup-response.schema.json +21 -0
- package/artifacts/schema/webauthn-options-response.schema.json +18 -0
- package/dist/app-users.d.ts +154 -34
- package/dist/app-users.js +177 -45
- package/dist/client-auth.d.ts +133 -24
- package/dist/client-auth.js +139 -28
- package/dist/config.d.ts +2 -2
- package/dist/errors.d.ts +10 -1
- package/dist/errors.js +34 -5
- package/dist/identity.d.ts +172 -123
- package/dist/identity.js +189 -101
- package/dist/index.d.ts +9 -9
- package/dist/index.js +11 -7
- package/dist/protocol.d.ts +1 -1
- package/dist/realtime.d.ts +1 -0
- package/dist/rest.d.ts +2 -2
- package/dist/rest.js +17 -28
- package/dist/routes.d.ts +19 -0
- package/dist/routes.js +497 -183
- package/package.json +1 -1
- package/artifacts/schema/developer-login-request.schema.json +0 -19
- package/artifacts/schema/password-reset-confirm.schema.json +0 -19
- package/artifacts/schema/password-reset-request.schema.json +0 -14
- package/artifacts/schema/sign-up-request.schema.json +0 -26
- package/artifacts/schema/sign-up-response.schema.json +0 -127
package/dist/identity.d.ts
CHANGED
|
@@ -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`,
|
|
11
|
-
*
|
|
12
|
-
* the
|
|
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
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
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
|
-
*
|
|
44
|
-
*
|
|
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
|
|
87
|
-
*
|
|
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.
|
|
99
|
-
*
|
|
100
|
-
* IdP-lockout class
|
|
101
|
-
*
|
|
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
|
-
*
|
|
150
|
-
*
|
|
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
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
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
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
|
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
|
*
|
|
@@ -341,10 +326,14 @@ export declare const pendingTeamInviteListResponse: z.ZodObject<{
|
|
|
341
326
|
}, z.core.$strip>>;
|
|
342
327
|
}, z.core.$strip>;
|
|
343
328
|
export type PendingTeamInviteListResponse = z.infer<typeof pendingTeamInviteListResponse>;
|
|
344
|
-
/**
|
|
329
|
+
/**
|
|
330
|
+
* Accepting it: the token proves the invitation, and the mailed link proves
|
|
331
|
+
* the address, so accepting needs no code and takes **no password** — the
|
|
332
|
+
* new member signs in by emailed code from then on.
|
|
333
|
+
*/
|
|
345
334
|
export declare const acceptTeamInviteRequest: z.ZodObject<{
|
|
346
335
|
token: z.ZodString;
|
|
347
|
-
|
|
336
|
+
display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
337
|
}, z.core.$strict>;
|
|
349
338
|
export type AcceptTeamInviteRequest = z.infer<typeof acceptTeamInviteRequest>;
|
|
350
339
|
/**
|
|
@@ -407,58 +396,20 @@ export declare const tierRequiredDetails: z.ZodObject<{
|
|
|
407
396
|
}, z.core.$strip>;
|
|
408
397
|
export type TierRequiredDetails = z.infer<typeof tierRequiredDetails>;
|
|
409
398
|
/**
|
|
410
|
-
*
|
|
399
|
+
* An app user changing their own password while signed in
|
|
400
|
+
* (`POST /api/client/password/change`). Fleetless users have no password.
|
|
411
401
|
*
|
|
412
402
|
* `current_password` is required even though the session already proves
|
|
413
403
|
* identity: it is what makes a stolen *session* insufficient to take the
|
|
414
404
|
* *account*. Every other session is revoked on success; the one that made the
|
|
415
405
|
* change survives, because logging someone out of the tab they just used is
|
|
416
406
|
* 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
407
|
*/
|
|
422
408
|
export declare const passwordChangeRequest: z.ZodObject<{
|
|
423
409
|
current_password: z.ZodString;
|
|
424
410
|
new_password: z.ZodString;
|
|
425
411
|
}, z.core.$strip>;
|
|
426
412
|
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
413
|
/**
|
|
463
414
|
* An IdP issuer URL — **an attacker-supplied string that decides where the
|
|
464
415
|
* *server* connects.**
|
|
@@ -494,8 +445,8 @@ export type IdpIssuer = z.infer<typeof idpIssuer>;
|
|
|
494
445
|
* here.** `oidcCallbackErrorCode` and `oidcCallbackError` described the page
|
|
495
446
|
* `GET /mcp/oauth/idp-callback` rendered when a group's identity provider sent
|
|
496
447
|
* a browser back — `jit_disabled` and `email_collision` name provisioning steps
|
|
497
|
-
* only a group provider had. Fleetless users
|
|
498
|
-
* group providers, so the flow that produced these codes cannot start; the
|
|
448
|
+
* only a group provider had. Fleetless users sign in by emailed code or
|
|
449
|
+
* passkey, with no group providers, so the flow that produced these codes cannot start; the
|
|
499
450
|
* route is gone from this manifest and from the cloud.
|
|
500
451
|
*
|
|
501
452
|
* The per-app OIDC vocabulary is `clientOidcErrorCode` in `client-auth.ts`: a
|
|
@@ -518,6 +469,7 @@ export declare const authMeResponse: z.ZodObject<{
|
|
|
518
469
|
org: z.ZodObject<{
|
|
519
470
|
id: z.ZodUUID;
|
|
520
471
|
name: z.ZodString;
|
|
472
|
+
require_two_factor: z.ZodBoolean;
|
|
521
473
|
created_at: z.ZodISODateTime;
|
|
522
474
|
}, z.core.$strip>;
|
|
523
475
|
user: z.ZodObject<{
|
|
@@ -529,13 +481,22 @@ export declare const authMeResponse: z.ZodObject<{
|
|
|
529
481
|
owner: "owner";
|
|
530
482
|
developer: "developer";
|
|
531
483
|
}>;
|
|
484
|
+
two_factor: z.ZodObject<{
|
|
485
|
+
passkeys: z.ZodNumber;
|
|
486
|
+
authenticator: z.ZodBoolean;
|
|
487
|
+
}, z.core.$strip>;
|
|
532
488
|
created_at: z.ZodISODateTime;
|
|
533
489
|
}, z.core.$strip>;
|
|
534
490
|
}, z.core.$strip>;
|
|
535
491
|
export type AuthMeResponse = z.infer<typeof authMeResponse>;
|
|
536
|
-
/**
|
|
492
|
+
/**
|
|
493
|
+
* `PATCH /api/org` — rename the org, require two-factor for its members, or
|
|
494
|
+
* both. Owner only. At least one field: an empty patch is a refusal rather
|
|
495
|
+
* than a write that changed nothing.
|
|
496
|
+
*/
|
|
537
497
|
export declare const patchOrgRequest: z.ZodObject<{
|
|
538
|
-
name: z.ZodString
|
|
498
|
+
name: z.ZodOptional<z.ZodString>;
|
|
499
|
+
require_two_factor: z.ZodOptional<z.ZodBoolean>;
|
|
539
500
|
}, z.core.$strict>;
|
|
540
501
|
export type PatchOrgRequest = z.infer<typeof patchOrgRequest>;
|
|
541
502
|
/** `PATCH /api/auth/me` — the caller updates their own display name (null clears it). */
|
|
@@ -543,3 +504,91 @@ export declare const patchAuthMeRequest: z.ZodObject<{
|
|
|
543
504
|
display_name: z.ZodNullable<z.ZodString>;
|
|
544
505
|
}, z.core.$strict>;
|
|
545
506
|
export type PatchAuthMeRequest = z.infer<typeof patchAuthMeRequest>;
|
|
507
|
+
/**
|
|
508
|
+
* **A WebAuthn JSON document, opaque here.** The `PublicKeyCredential*JSON`
|
|
509
|
+
* shapes of the WebAuthn Level 3 specification — creation and request options
|
|
510
|
+
* going out, the browser's credential coming back. The browser API and the
|
|
511
|
+
* server library define them; a second, hand-written copy here would be one
|
|
512
|
+
* that drifts.
|
|
513
|
+
*/
|
|
514
|
+
export declare const webauthnJson: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
515
|
+
/**
|
|
516
|
+
* **Options for a WebAuthn ceremony**, to hand to the browser as they are.
|
|
517
|
+
* The relying party is `fleetless.dev`, so the auth portal and the console
|
|
518
|
+
* both accept the same passkey; user verification is required.
|
|
519
|
+
*/
|
|
520
|
+
export declare const webauthnOptionsResponse: z.ZodObject<{
|
|
521
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
522
|
+
}, z.core.$strip>;
|
|
523
|
+
export type WebauthnOptionsResponse = z.infer<typeof webauthnOptionsResponse>;
|
|
524
|
+
/** **One registered passkey**, as Settings › Profile lists it. No key material travels here. */
|
|
525
|
+
export declare const developerPasskey: z.ZodObject<{
|
|
526
|
+
id: z.ZodUUID;
|
|
527
|
+
name: z.ZodString;
|
|
528
|
+
created_at: z.ZodISODateTime;
|
|
529
|
+
last_used_at: z.ZodNullable<z.ZodISODateTime>;
|
|
530
|
+
synced: z.ZodNullable<z.ZodBoolean>;
|
|
531
|
+
}, z.core.$strip>;
|
|
532
|
+
export type DeveloperPasskey = z.infer<typeof developerPasskey>;
|
|
533
|
+
/** **`GET /api/auth/two-factor`** — the caller's own second factors, in full. */
|
|
534
|
+
export declare const developerTwoFactor: z.ZodObject<{
|
|
535
|
+
passkeys: z.ZodArray<z.ZodObject<{
|
|
536
|
+
id: z.ZodUUID;
|
|
537
|
+
name: z.ZodString;
|
|
538
|
+
created_at: z.ZodISODateTime;
|
|
539
|
+
last_used_at: z.ZodNullable<z.ZodISODateTime>;
|
|
540
|
+
synced: z.ZodNullable<z.ZodBoolean>;
|
|
541
|
+
}, z.core.$strip>>;
|
|
542
|
+
authenticator: z.ZodNullable<z.ZodObject<{
|
|
543
|
+
created_at: z.ZodISODateTime;
|
|
544
|
+
}, z.core.$strip>>;
|
|
545
|
+
recovery_codes_left: z.ZodNumber;
|
|
546
|
+
required_by_org: z.ZodBoolean;
|
|
547
|
+
}, z.core.$strip>;
|
|
548
|
+
export type DeveloperTwoFactor = z.infer<typeof developerTwoFactor>;
|
|
549
|
+
/** **Registering a passkey**: the name, and the browser's answer to the creation options. */
|
|
550
|
+
export declare const createPasskeyRequest: z.ZodObject<{
|
|
551
|
+
name: z.ZodString;
|
|
552
|
+
credential: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
553
|
+
}, z.core.$strict>;
|
|
554
|
+
export type CreatePasskeyRequest = z.infer<typeof createPasskeyRequest>;
|
|
555
|
+
/**
|
|
556
|
+
* **The registered passkey**, and the ten recovery codes when it is the
|
|
557
|
+
* account's first second factor — `null` otherwise, since the existing codes
|
|
558
|
+
* stay valid.
|
|
559
|
+
*/
|
|
560
|
+
export declare const createPasskeyResponse: z.ZodObject<{
|
|
561
|
+
passkey: z.ZodObject<{
|
|
562
|
+
id: z.ZodUUID;
|
|
563
|
+
name: z.ZodString;
|
|
564
|
+
created_at: z.ZodISODateTime;
|
|
565
|
+
last_used_at: z.ZodNullable<z.ZodISODateTime>;
|
|
566
|
+
synced: z.ZodNullable<z.ZodBoolean>;
|
|
567
|
+
}, z.core.$strip>;
|
|
568
|
+
recovery_codes: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
569
|
+
}, z.core.$strip>;
|
|
570
|
+
export type CreatePasskeyResponse = z.infer<typeof createPasskeyResponse>;
|
|
571
|
+
/** **Renaming a passkey.** The name is the only thing about one that can change. */
|
|
572
|
+
export declare const renamePasskeyRequest: z.ZodObject<{
|
|
573
|
+
name: z.ZodString;
|
|
574
|
+
}, z.core.$strict>;
|
|
575
|
+
export type RenamePasskeyRequest = z.infer<typeof renamePasskeyRequest>;
|
|
576
|
+
/** **Confirming a new authenticator** with a code it shows now. */
|
|
577
|
+
export declare const totpConfirmRequest: z.ZodObject<{
|
|
578
|
+
code: z.ZodString;
|
|
579
|
+
}, z.core.$strict>;
|
|
580
|
+
export type TotpConfirmRequest = z.infer<typeof totpConfirmRequest>;
|
|
581
|
+
/**
|
|
582
|
+
* **The confirmed authenticator.** Ten recovery codes when it is the
|
|
583
|
+
* account's first second factor; `null` when it replaces an authenticator or
|
|
584
|
+
* joins passkeys, whose codes stay valid.
|
|
585
|
+
*/
|
|
586
|
+
export declare const totpConfirmResponse: z.ZodObject<{
|
|
587
|
+
recovery_codes: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
588
|
+
}, z.core.$strip>;
|
|
589
|
+
export type TotpConfirmResponse = z.infer<typeof totpConfirmResponse>;
|
|
590
|
+
/** **A fresh set of ten recovery codes**, shown once. The previous set stops working. */
|
|
591
|
+
export declare const recoveryCodesResponse: z.ZodObject<{
|
|
592
|
+
recovery_codes: z.ZodArray<z.ZodString>;
|
|
593
|
+
}, z.core.$strip>;
|
|
594
|
+
export type RecoveryCodesResponse = z.infer<typeof recoveryCodesResponse>;
|