@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
@@ -14,6 +14,10 @@
14
14
  "maxLength": 120,
15
15
  "description": "The organisation's display name. Free text, changed through `PATCH /api/org`."
16
16
  },
17
+ "require_two_factor": {
18
+ "type": "boolean",
19
+ "description": "Whether every member must have a second factor — a passkey or an authenticator app. A member without one sets it up at their next sign-in, before any session exists; nobody is signed out when it is switched on. It covers the console and the central MCP endpoint; server keys and robot bridges are not people and are not affected. Owners change it through `PATCH /api/org`."
20
+ },
17
21
  "created_at": {
18
22
  "type": "string",
19
23
  "format": "date-time",
@@ -24,6 +28,7 @@
24
28
  "required": [
25
29
  "id",
26
30
  "name",
31
+ "require_two_factor",
27
32
  "created_at"
28
33
  ],
29
34
  "additionalProperties": false
@@ -3,13 +3,15 @@
3
3
  "type": "object",
4
4
  "properties": {
5
5
  "name": {
6
+ "description": "The organisation's new display name. Absent leaves it alone.",
6
7
  "type": "string",
7
8
  "minLength": 1,
8
9
  "maxLength": 120
10
+ },
11
+ "require_two_factor": {
12
+ "description": "Whether every member must have a second factor. Turning it on signs nobody out: each member without one sets it up at their next sign-in. Absent leaves it alone.",
13
+ "type": "boolean"
9
14
  }
10
15
  },
11
- "required": [
12
- "name"
13
- ],
14
16
  "additionalProperties": false
15
17
  }
@@ -17,6 +17,10 @@
17
17
  "maxLength": 120,
18
18
  "description": "The organisation's display name. Free text, changed through `PATCH /api/org`."
19
19
  },
20
+ "require_two_factor": {
21
+ "type": "boolean",
22
+ "description": "Whether every member must have a second factor — a passkey or an authenticator app. A member without one sets it up at their next sign-in, before any session exists; nobody is signed out when it is switched on. It covers the console and the central MCP endpoint; server keys and robot bridges are not people and are not affected. Owners change it through `PATCH /api/org`."
23
+ },
20
24
  "created_at": {
21
25
  "type": "string",
22
26
  "format": "date-time",
@@ -27,6 +31,7 @@
27
31
  "required": [
28
32
  "id",
29
33
  "name",
34
+ "require_two_factor",
30
35
  "created_at"
31
36
  ],
32
37
  "additionalProperties": false,
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "hosted_accent": {
6
+ "anyOf": [
7
+ {
8
+ "type": "string",
9
+ "pattern": "^#[0-9a-f]{6}$"
10
+ },
11
+ {
12
+ "type": "null"
13
+ }
14
+ ],
15
+ "description": "The accent colour of the hosted pages, `#rrggbb` in lowercase, or `null` for the neutral shell's own."
16
+ }
17
+ },
18
+ "required": [
19
+ "hosted_accent"
20
+ ],
21
+ "additionalProperties": false
22
+ }
@@ -5,23 +5,10 @@
5
5
  "mcp_enabled": {
6
6
  "type": "boolean",
7
7
  "description": "Whether this app serves an MCP endpoint at `/mcp/<identifier>`. Off refuses the whole OAuth surface for the app, not merely the tool calls, and is re-read on every request rather than cached off a token."
8
- },
9
- "mcp_login_url": {
10
- "anyOf": [
11
- {
12
- "type": "string",
13
- "maxLength": 500
14
- },
15
- {
16
- "type": "null"
17
- }
18
- ],
19
- "description": "The page an MCP authorization redirects to, with `{interaction}` where the interaction id goes. Not a token: the id names a pending request the server already holds, and the app authenticates the user itself before approving it."
20
8
  }
21
9
  },
22
10
  "required": [
23
- "mcp_enabled",
24
- "mcp_login_url"
11
+ "mcp_enabled"
25
12
  ],
26
13
  "additionalProperties": false
27
14
  }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "sign_in_methods": {
6
+ "type": "object",
7
+ "properties": {
8
+ "password": {
9
+ "type": "boolean",
10
+ "description": "Whether app users may sign in with a password. Off refuses `POST /api/client/login` with `method_not_allowed`, and registration and invitations then take no password."
11
+ },
12
+ "email_code": {
13
+ "type": "boolean",
14
+ "description": "Whether app users may sign in with a six-digit code mailed to them, valid ten minutes. A code needs no URL, so it works in local development and in an app with no web UI."
15
+ }
16
+ },
17
+ "required": [
18
+ "password",
19
+ "email_code"
20
+ ],
21
+ "additionalProperties": false,
22
+ "description": "Which sign-in methods the app offers: password, emailed code, or both — at least one. Identity providers stay on top of either. The default is password only."
23
+ },
24
+ "two_factor": {
25
+ "type": "string",
26
+ "enum": [
27
+ "off",
28
+ "optional",
29
+ "required"
30
+ ],
31
+ "description": "Whether the app asks for an authenticator code: `off` (the default), `optional` or `required`. A person with a confirmed authenticator is asked at every sign-in whatever the policy; a sign-in through an identity provider is never asked."
32
+ }
33
+ },
34
+ "required": [
35
+ "sign_in_methods",
36
+ "two_factor"
37
+ ],
38
+ "additionalProperties": false
39
+ }
@@ -2,6 +2,19 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "type": "object",
4
4
  "properties": {
5
+ "app_url": {
6
+ "anyOf": [
7
+ {
8
+ "type": "string",
9
+ "maxLength": 500,
10
+ "format": "uri"
11
+ },
12
+ {
13
+ "type": "null"
14
+ }
15
+ ],
16
+ "description": "The app's own home page, linked as `Open <app>` when a hosted flow is done. `null` makes the hosted done page say `You can close this tab`."
17
+ },
5
18
  "invite_url": {
6
19
  "anyOf": [
7
20
  {
@@ -12,7 +25,7 @@
12
25
  "type": "null"
13
26
  }
14
27
  ],
15
- "description": "The page in the developer's app that accepts an invitation, with `{token}` where the token goes. `null` when unconfigured, and then an invitation still issues but `send_mail` is refused with `409 target_state_conflict` — there would be nowhere for the link to point."
28
+ "description": "The page in the developer's app that accepts an invitation, with `{token}` where the token goes. `null` means the hosted page in `hosted_pages` is used."
16
29
  },
17
30
  "verify_url": {
18
31
  "anyOf": [
@@ -24,7 +37,7 @@
24
37
  "type": "null"
25
38
  }
26
39
  ],
27
- "description": "The page that confirms a new address, with `{token}` where the token goes. Self-registration needs it: without a page to send people to, a registration would leave an account nobody can activate."
40
+ "description": "The page that confirms a new address, with `{token}` where the token goes. `null` means the hosted page in `hosted_pages` is used."
28
41
  },
29
42
  "reset_url": {
30
43
  "anyOf": [
@@ -36,13 +49,27 @@
36
49
  "type": "null"
37
50
  }
38
51
  ],
39
- "description": "The page that takes a new password, with `{token}` where the token goes."
52
+ "description": "The page that takes a new password, with `{token}` where the token goes. `null` means the hosted page in `hosted_pages` is used."
53
+ },
54
+ "mcp_login_url": {
55
+ "anyOf": [
56
+ {
57
+ "type": "string",
58
+ "maxLength": 500
59
+ },
60
+ {
61
+ "type": "null"
62
+ }
63
+ ],
64
+ "description": "The page an MCP authorization redirects to, with `{interaction}` where the interaction id goes. Not a token: the id names a pending request the server already holds, and the app authenticates the user itself before approving it. `null` means the hosted MCP sign-in in `hosted_pages` is used."
40
65
  }
41
66
  },
42
67
  "required": [
68
+ "app_url",
43
69
  "invite_url",
44
70
  "verify_url",
45
- "reset_url"
71
+ "reset_url",
72
+ "mcp_login_url"
46
73
  ],
47
74
  "additionalProperties": false
48
75
  }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "recovery_codes": {
6
+ "minItems": 10,
7
+ "maxItems": 10,
8
+ "type": "array",
9
+ "items": {
10
+ "type": "string",
11
+ "pattern": "^[a-z2-7]{5}-[a-z2-7]{5}$"
12
+ },
13
+ "description": "The ten new recovery codes, lowercase, shown once. Every earlier code is void."
14
+ }
15
+ },
16
+ "required": [
17
+ "recovery_codes"
18
+ ],
19
+ "additionalProperties": false
20
+ }
@@ -5,8 +5,8 @@
5
5
  "name": {
6
6
  "type": "string",
7
7
  "minLength": 1,
8
- "maxLength": 60,
9
- "description": "The new name, trimmed, 1 to 60 characters. Unique per app: another role of this app with the same name answers `409 role_name_taken`. The role's users keep it under its new name."
8
+ "maxLength": 80,
9
+ "description": "The new name."
10
10
  }
11
11
  },
12
12
  "required": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "builtin": {
29
29
  "type": "boolean",
30
- "description": "`true` for the two roles every app starts with. Their **rights may be re-scoped** exactly like a custom role's, through `PUT /api/apps/:id/roles/:roleId/permissions` — the flag exists so the console can explain where they came from, not to protect them. Built-in roles can be renamed and deleted like any other; the flag only records that the cloud seeded them."
30
+ "description": "`true` for the two roles every app starts with. Their **rights may be re-scoped** exactly like a custom role's, through `PUT /api/apps/:id/roles/:roleId/permissions` — the flag exists so the console can explain where they came from, not to protect them. It does not make them renamable or deletable — no route does that for any role."
31
31
  }
32
32
  },
33
33
  "required": [
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "builtin": {
24
24
  "type": "boolean",
25
- "description": "`true` for the two roles every app starts with. Their **rights may be re-scoped** exactly like a custom role's, through `PUT /api/apps/:id/roles/:roleId/permissions` — the flag exists so the console can explain where they came from, not to protect them. Built-in roles can be renamed and deleted like any other; the flag only records that the cloud seeded them."
25
+ "description": "`true` for the two roles every app starts with. Their **rights may be re-scoped** exactly like a custom role's, through `PUT /api/apps/:id/roles/:roleId/permissions` — the flag exists so the console can explain where they came from, not to protect them. It does not make them renamable or deletable — no route does that for any role."
26
26
  }
27
27
  },
28
28
  "required": [
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "code": {
6
+ "type": "string",
7
+ "pattern": "^\\d{6}$",
8
+ "description": "A code the new authenticator shows now. It proves the secret was copied correctly before anything depends on it."
9
+ }
10
+ },
11
+ "required": [
12
+ "code"
13
+ ],
14
+ "additionalProperties": false
15
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "recovery_codes": {
6
+ "anyOf": [
7
+ {
8
+ "minItems": 10,
9
+ "maxItems": 10,
10
+ "type": "array",
11
+ "items": {
12
+ "type": "string",
13
+ "pattern": "^[a-z2-7]{5}-[a-z2-7]{5}$"
14
+ }
15
+ },
16
+ {
17
+ "type": "null"
18
+ }
19
+ ],
20
+ "description": "The ten recovery codes, shown once, when this is the account's first second factor; `null` otherwise."
21
+ }
22
+ },
23
+ "required": [
24
+ "recovery_codes"
25
+ ],
26
+ "additionalProperties": false
27
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "status": {
6
+ "type": "string",
7
+ "enum": [
8
+ "two_factor_required",
9
+ "two_factor_setup_required"
10
+ ],
11
+ "description": "`two_factor_required`: ask for the authenticator code. `two_factor_setup_required`: the app requires two-factor and the person has none yet, so set one up before any session exists."
12
+ },
13
+ "challenge": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "description": "The handle the next step spends. Valid five minutes; afterwards it answers `410 token_spent` and the sign-in starts over."
17
+ }
18
+ },
19
+ "required": [
20
+ "status",
21
+ "challenge"
22
+ ],
23
+ "additionalProperties": false
24
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "secret": {
6
+ "type": "string",
7
+ "minLength": 1,
8
+ "description": "The shared secret, base32, for an authenticator app that cannot scan a QR code. Shown once; the cloud stores it encrypted."
9
+ },
10
+ "otpauth_url": {
11
+ "type": "string",
12
+ "pattern": "^otpauth:\\/\\/totp\\/.*",
13
+ "description": "The same secret as an `otpauth://totp/` URL, to render as a QR code. It carries the secret: never log it."
14
+ }
15
+ },
16
+ "required": [
17
+ "secret",
18
+ "otpauth_url"
19
+ ],
20
+ "additionalProperties": false
21
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "options": {
6
+ "type": "object",
7
+ "propertyNames": {
8
+ "type": "string"
9
+ },
10
+ "additionalProperties": {},
11
+ "description": "The `PublicKeyCredentialCreationOptionsJSON` or `PublicKeyCredentialRequestOptionsJSON` to pass to the browser. Its challenge is single-use and short-lived."
12
+ }
13
+ },
14
+ "required": [
15
+ "options"
16
+ ],
17
+ "additionalProperties": false
18
+ }