@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
package/CHANGELOG.md CHANGED
@@ -11,39 +11,114 @@ version.
11
11
 
12
12
  ### Added
13
13
 
14
- - **`feedbackRequest` and `feedbackResponse`** (`FeedbackRequest`,
15
- `FeedbackResponse`) for the new `POST /api/feedback`: a developer's
16
- message to the people who build Fleetless, `{ kind, message, page }` with
17
- `kind` one of `FEEDBACK_KINDS` (`idea`, `problem`, `question`, `other`), a
18
- trimmed message of at most `FEEDBACK_MESSAGE_MAX` (5000) characters and
19
- the console path it was sent from. The route answers `202` with
20
- `{ id, mail }`: the message is stored before any mail is tried, so `mail`
21
- (`sent`, `failed`, `not_configured`) never means it was lost. Rate
22
- limited to 10 per developer per hour. Published as the artifacts
23
- `feedback-request` and `feedback-response`.
24
- - **`jobActor.name`**: the person's display name when the job started,
25
- required and nullable — `null` for a server key, a person without a name
26
- and runs recorded before this version; show `label` then. `jobActor`
27
- stays non-strict, so a consumer on 5.2.0 strips the new key rather than
28
- refusing the run. Changes the artifacts `job-actor`, `job-run` and
29
- `job-run-list-response`.
30
- - **`roleRenameRequest`, `roleDeleteQuery` and `roleInUseDetails`**
31
- (`RoleRenameRequest`, `RoleDeleteQuery`, `RoleInUseDetails`) for the new
32
- `PATCH` and `DELETE /api/apps/:id/roles/:roleId`: rename a role
33
- (`409 role_name_taken` on a clash), or delete it, moving its app users,
34
- pending invitations and default-role status to `move_to`. Without
35
- `move_to` a held role answers `409 role_in_use` with
36
- `{ users, invitations, is_default }`; the app's only role answers
37
- `409 last_role`. The three codes join `ERROR_CODES`. `role.builtin` no
38
- longer says built-in roles cannot be renamed or deleted, and the create
39
- route's note now states the 60-character limit `role.name` always had.
40
- Published as the artifacts `role-rename-request`, `role-delete-query`
41
- and `role-in-use-details`.
42
- - **`auditQuery.target_id`**: only the events about one target — for a
43
- robot also those that name it in `details.robot_id`, so a robot's log
44
- includes what was started on it. A string, since target ids are not all
45
- uuids. `GET /api/audit/export` takes it too. Changes the artifact
46
- `audit-query`.
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
+ - **`appInvitation.accept_url` is never `null`**: an app with no
94
+ `invite_url` gets the hosted invitation page's link.
95
+ - **`appMailTemplateListResponse.templates` holds up to four** (was three),
96
+ with `login_code`.
97
+ - **The portal's identify step mails a sign-in code** (`POST
98
+ /console/oauth/identify`, `POST /mcp/oauth/identify`) instead of handing
99
+ back a password step, and answers the same for every address.
100
+ - **A password reset and a password change are refused with `403
101
+ method_not_allowed`** while the app has the password method off — `POST
102
+ /api/client/password/reset`, `…/password/reset/confirm`,
103
+ `…/password/change` and the developer's `POST
104
+ /api/apps/:id/users/:userId/reset-password`.
105
+
106
+ ### Removed
107
+
108
+ - **The developer password; this is why the release is a major.** The
109
+ schemas `developerLoginRequest`, `passwordResetRequest`,
110
+ `passwordResetConfirm`, `signUpRequest` and `signUpResponse`, and the
111
+ routes `POST /api/auth/signup`, `POST /api/auth/password/change`, `POST
112
+ /api/auth/password/reset`, `POST /api/auth/password/reset/confirm`, `GET
113
+ /reset-password`, `GET /reset-password/:token`, `POST
114
+ /console/oauth/login` and `POST /mcp/oauth/login`. Fleetless users sign
115
+ in by emailed code or passkey; the portal sign-up is the one way to
116
+ create an organisation. `passwordChangeRequest` stays, for `POST
117
+ /api/client/password/change`. The newly required fields above
118
+ (`appUser.two_factor`, `org.require_two_factor`,
119
+ `fleetlessUser.two_factor`, `clientIdentity.two_factor_enabled`,
120
+ `clientProviderListResponse.sign_in_methods`) and the narrowed `mcp`
121
+ slice break existing readers as well.
47
122
 
48
123
  ## [5.2.0] — 2026-09-30
49
124