@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.
Files changed (71) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/artifacts/openapi.json +1975 -415
  3. package/artifacts/routes.json +1697 -251
  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 +2 -2
  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/auth-me-response.schema.json +27 -0
  14. package/artifacts/schema/auth-ok.schema.json +13 -1
  15. package/artifacts/schema/client-accept-invitation-request.schema.json +3 -4
  16. package/artifacts/schema/client-identity.schema.json +13 -1
  17. package/artifacts/schema/client-login-code-request.schema.json +24 -0
  18. package/artifacts/schema/client-login-code-verify-request.schema.json +30 -0
  19. package/artifacts/schema/client-provider-list-response.schema.json +22 -2
  20. package/artifacts/schema/client-register-request.schema.json +3 -4
  21. package/artifacts/schema/client-sign-in-result.schema.json +55 -0
  22. package/artifacts/schema/client-two-factor-disable-request.schema.json +15 -0
  23. package/artifacts/schema/client-two-factor-setup-confirm-request.schema.json +20 -0
  24. package/artifacts/schema/client-two-factor-setup-confirm-response.schema.json +49 -0
  25. package/artifacts/schema/client-two-factor-setup-request.schema.json +12 -0
  26. package/artifacts/schema/client-two-factor-verify-request.schema.json +25 -0
  27. package/artifacts/schema/create-app-invitation-request.schema.json +1 -1
  28. package/artifacts/schema/create-passkey-request.schema.json +25 -0
  29. package/artifacts/schema/create-passkey-response.schema.json +84 -0
  30. package/artifacts/schema/developer-passkey.schema.json +56 -0
  31. package/artifacts/schema/developer-two-factor.schema.json +105 -0
  32. package/artifacts/schema/fleetless-user-list-response.schema.json +22 -0
  33. package/artifacts/schema/fleetless-user.schema.json +22 -0
  34. package/artifacts/schema/invalid-code-details.schema.json +16 -0
  35. package/artifacts/schema/org.schema.json +5 -0
  36. package/artifacts/schema/patch-org-request.schema.json +5 -3
  37. package/artifacts/schema/patch-org-response.schema.json +5 -0
  38. package/artifacts/schema/put-app-auth-look-request.schema.json +22 -0
  39. package/artifacts/schema/put-app-auth-mcp-request.schema.json +1 -14
  40. package/artifacts/schema/put-app-auth-sign-in-request.schema.json +39 -0
  41. package/artifacts/schema/put-app-auth-urls-request.schema.json +31 -4
  42. package/artifacts/schema/recovery-codes-response.schema.json +20 -0
  43. package/artifacts/schema/rename-passkey-request.schema.json +16 -0
  44. package/artifacts/schema/totp-confirm-request.schema.json +15 -0
  45. package/artifacts/schema/totp-confirm-response.schema.json +27 -0
  46. package/artifacts/schema/two-factor-challenge.schema.json +24 -0
  47. package/artifacts/schema/two-factor-setup-response.schema.json +21 -0
  48. package/artifacts/schema/webauthn-options-response.schema.json +18 -0
  49. package/dist/app-users.d.ts +154 -34
  50. package/dist/app-users.js +177 -45
  51. package/dist/client-auth.d.ts +133 -24
  52. package/dist/client-auth.js +139 -28
  53. package/dist/config.d.ts +2 -2
  54. package/dist/errors.d.ts +10 -1
  55. package/dist/errors.js +34 -5
  56. package/dist/identity.d.ts +172 -123
  57. package/dist/identity.js +189 -101
  58. package/dist/index.d.ts +9 -9
  59. package/dist/index.js +11 -7
  60. package/dist/protocol.d.ts +1 -1
  61. package/dist/realtime.d.ts +1 -0
  62. package/dist/rest.d.ts +2 -2
  63. package/dist/rest.js +17 -28
  64. package/dist/routes.d.ts +19 -0
  65. package/dist/routes.js +497 -183
  66. package/package.json +1 -1
  67. package/artifacts/schema/developer-login-request.schema.json +0 -19
  68. package/artifacts/schema/password-reset-confirm.schema.json +0 -19
  69. package/artifacts/schema/password-reset-request.schema.json +0 -14
  70. package/artifacts/schema/sign-up-request.schema.json +0 -26
  71. package/artifacts/schema/sign-up-response.schema.json +0 -127
package/CHANGELOG.md CHANGED
@@ -9,6 +9,105 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ### Added
13
+
14
+ - **App sign-in methods, two-factor policy, hosted pages and look.**
15
+ `appAuthConfig` gains `sign_in_methods` (`appSignInMethods`: `password`
16
+ and/or `email_code`, at least one; default password only), `two_factor`
17
+ (`appTwoFactorPolicy`: `off`, `optional`, `required`; default `off`),
18
+ `app_url` (`appHomeUrl`), `hosted_accent` (`hostedAccent`, `#rrggbb`
19
+ lowercase), and the read-only `hosted_logo_url` and `hosted_pages`
20
+ (`appHostedPages`) — the Fleetless-hosted page each unset URL falls back
21
+ to. New slices `PUT /api/apps/:id/auth-config/sign-in`
22
+ (`putAppAuthSignInRequest`) and `…/look` (`putAppAuthLookRequest`), and
23
+ the logo as a raw PNG or SVG body at `PUT` and `DELETE
24
+ /api/apps/:id/auth-config/logo` (`HOSTED_LOGO_TYPES`,
25
+ `HOSTED_LOGO_MAX_BYTES`, 100 KB).
26
+ - **App-user two-factor state and reset.** `appUser.two_factor` (`enabled`,
27
+ `enabled_at`, `recovery_codes_left`), and `DELETE
28
+ /api/apps/:id/users/:userId/two-factor` resets it and ends the user's
29
+ sessions.
30
+ - **Email-code sign-in for app users.** `POST /api/client/login/code`
31
+ (`clientLoginCodeRequest`, a `202` decoy for every address) mails six
32
+ digits valid ten minutes; `POST /api/client/login/code/verify`
33
+ (`clientLoginCodeVerifyRequest`) spends them. The mail kind `login_code`
34
+ joins `mailTemplateKind`, with its default template and the variables
35
+ `code` and `expires_in_minutes`.
36
+ - **TOTP two-factor for app users.** `clientSignInResult`, the union of
37
+ `sessionTokens` and `twoFactorChallenge`, is what every sign-in step
38
+ answers. `POST /api/client/two-factor/verify`
39
+ (`clientTwoFactorVerifyRequest`), `…/setup` (`clientTwoFactorSetupRequest`,
40
+ answering `twoFactorSetupResponse`), `…/setup/confirm`
41
+ (`clientTwoFactorSetupConfirmRequest`, answering
42
+ `clientTwoFactorSetupConfirmResponse`: ten recovery codes and the
43
+ session), and `DELETE /api/client/two-factor`
44
+ (`clientTwoFactorDisableRequest`). Shared by both identity spaces:
45
+ `loginCode`, `totpCode`, `recoveryCode` and `recoveryCodesList`.
46
+ - **Developer sign-in by emailed code and passkey, with second factors.**
47
+ The portal steps for `/console/oauth` and `/mcp/oauth` —
48
+ `developerSignInRoutes(prefix)`: code, second step, recovery code,
49
+ passkey, and the setup when the org requires two-factor — and console
50
+ sign-up by email, code (`POST /console/oauth/signup/code`) and
51
+ organization. A developer manages their own passkeys, authenticator and
52
+ recovery codes at `GET /api/auth/two-factor` (`developerTwoFactor`),
53
+ `/api/auth/passkeys` (`webauthnOptionsResponse`, `createPasskeyRequest`,
54
+ `createPasskeyResponse`, `renamePasskeyRequest`, `developerPasskey`),
55
+ `/api/auth/totp` (`totpConfirmRequest`, `totpConfirmResponse`) and `POST
56
+ /api/auth/recovery-codes` (`recoveryCodesResponse`).
57
+ - **An org can require two-factor.** `org.require_two_factor`, set by owners
58
+ through `PATCH /api/org`; `fleetlessUser.two_factor` reports each member's
59
+ factors, and `DELETE /api/org/users/:id/two-factor` lets an owner reset a
60
+ member's.
61
+ - **The hosted app pages** under `/app/:appIdentifier` on the auth portal,
62
+ nineteen internal HTML routes: the MCP sign-in, the two-factor steps, the
63
+ invitation, reset, verification, forgot-password and sign-up pages, and
64
+ the app's logo.
65
+ - **Error codes `invalid_code`** (details `invalidCodeDetails`:
66
+ `attempts_left`) **and `method_not_allowed`.**
67
+
68
+ ### Changed
69
+
70
+ - **Nothing is refused for a missing app URL.** An unset `invite_url`,
71
+ `verify_url`, `reset_url` or `mcp_login_url` falls back to the hosted
72
+ page: mailed invitations, self-registration, resets and MCP sign-in work
73
+ before an app has pages of its own, and the per-app MCP authorize no
74
+ longer answers `409 target_state_conflict` for a missing
75
+ `mcp_login_url`.
76
+ - **Every app-user sign-in step answers `clientSignInResult`.** `POST
77
+ /api/client/login`, `…/verify-email`, `…/password/reset/confirm` and
78
+ `…/invitations/accept` answer a `twoFactorChallenge` instead of tokens
79
+ when the person has an authenticator or the app requires one. `POST
80
+ /api/client/oidc/exchange` still answers tokens: the identity provider
81
+ owns that sign-in.
82
+ - **`clientRegisterRequest.password` and
83
+ `clientAcceptInvitationRequest.password` are optional**: required while
84
+ the app's password method is on, refused while it is off.
85
+ - **`mcp_login_url` moved from the `mcp` slice to the `urls` slice**, which
86
+ also takes `app_url`; `putAppAuthMcpRequest` is `mcp_enabled` alone.
87
+ - `clientProviderListResponse` gains `sign_in_methods`, `clientIdentity`
88
+ gains `two_factor_enabled`, `patchOrgRequest` takes `name` and
89
+ `require_two_factor`, both optional and at least one, and
90
+ `acceptTeamInviteRequest` takes an optional `display_name` and no
91
+ password. The default invitation mail no longer asks the invitee to
92
+ choose a password.
93
+
94
+ ### Removed
95
+
96
+ - **The developer password; this is why the release is a major.** The
97
+ schemas `developerLoginRequest`, `passwordResetRequest`,
98
+ `passwordResetConfirm`, `signUpRequest` and `signUpResponse`, and the
99
+ routes `POST /api/auth/signup`, `POST /api/auth/password/change`, `POST
100
+ /api/auth/password/reset`, `POST /api/auth/password/reset/confirm`, `GET
101
+ /reset-password`, `GET /reset-password/:token`, `POST
102
+ /console/oauth/login` and `POST /mcp/oauth/login`. Fleetless users sign
103
+ in by emailed code or passkey; the portal sign-up is the one way to
104
+ create an organisation. `passwordChangeRequest` stays, for `POST
105
+ /api/client/password/change`. Together with the newly required fields
106
+ above (`appUser.two_factor`, `org.require_two_factor`,
107
+ `fleetlessUser.two_factor`, `clientIdentity.two_factor_enabled`,
108
+ `clientProviderListResponse.sign_in_methods`) and the narrowed `mcp`
109
+ slice, this is why the release is a major.
110
+
12
111
  ## [5.2.0] — 2026-09-30
13
112
 
14
113
  ### Added