@fleetless/contracts 13.1.0 → 13.3.0
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 +43 -0
- package/artifacts/openapi.json +126 -20
- package/artifacts/routes.json +22 -47
- package/artifacts/schema/app-auth-config.schema.json +15 -0
- package/artifacts/schema/config-draft-response.schema.json +30 -0
- package/artifacts/schema/config-version-response.schema.json +30 -0
- package/artifacts/schema/config-versions-response.schema.json +30 -0
- package/dist/app-users.d.ts +19 -2
- package/dist/app-users.js +14 -2
- package/dist/assets.d.ts +1 -1
- package/dist/assets.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/rest.d.ts +28 -0
- package/dist/rest.js +30 -4
- package/dist/routes.js +32 -44
- package/package.json +1 -1
package/dist/routes.js
CHANGED
|
@@ -452,7 +452,7 @@ export const ROUTES = [
|
|
|
452
452
|
/* ------------------------------------------- client auth (portal pages) */
|
|
453
453
|
{
|
|
454
454
|
method: 'GET', path: '/favicon.svg', section: 'client-auth',
|
|
455
|
-
summary: 'Serves the Fleetless icon for the auth portal\'s
|
|
455
|
+
summary: 'Serves the Fleetless icon for the auth portal\'s browser tab.',
|
|
456
456
|
audience: 'internal', auth: 'none', rateLimited: false, ownerTier: false, status: 200,
|
|
457
457
|
params: [], query: null, request: null, response: null, errors: [], transport: 'http',
|
|
458
458
|
notes: 'An SVG, not JSON. Those pages carry a Content-Security-Policy that admits no `data:` image, so the icon is a file on their own ' +
|
|
@@ -625,12 +625,11 @@ export const ROUTES = [
|
|
|
625
625
|
{
|
|
626
626
|
method: 'DELETE', path: '/api/apps/:id', section: 'apps',
|
|
627
627
|
summary: 'Deletes an app and everything it produced.',
|
|
628
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier:
|
|
628
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 204,
|
|
629
629
|
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
630
630
|
query: null, request: null, response: null,
|
|
631
|
-
errors: [...DEVELOPER_GUARD, '
|
|
632
|
-
notes: '
|
|
633
|
-
'for an app outside their org, rather than a tier refusal that confirms the id exists. A full cascade — its users, roles, server keys, ' +
|
|
631
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
632
|
+
notes: 'An app outside the caller\'s org answers `404`, as an unknown id does. A full cascade — its users, roles, server keys, ' +
|
|
634
633
|
'invitations, OIDC provider configuration and mail templates all go, recorded once as `app.deleted` carrying an `appDeletionSummary`. ' +
|
|
635
634
|
'Its robots are untouched: they belong to the org, not to the app. \n\n**No `force` parameter** — see ' +
|
|
636
635
|
'`GET /api/apps/:id/deletion-preview`.',
|
|
@@ -725,11 +724,11 @@ export const ROUTES = [
|
|
|
725
724
|
{
|
|
726
725
|
method: 'POST', path: '/api/apps/:id/server-keys', section: 'apps',
|
|
727
726
|
summary: 'Mints a server key for the app and returns the raw secret once.',
|
|
728
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier:
|
|
727
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 201,
|
|
729
728
|
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
730
729
|
query: null, request: null, response: createServerKeyResponse,
|
|
731
|
-
errors: [...DEVELOPER_GUARD, '
|
|
732
|
-
notes: '
|
|
730
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error'], transport: 'http',
|
|
731
|
+
notes: 'A server key carries full app rights and outlives its creator\'s removal. The body is `{ "name": string }`, the same ' +
|
|
733
732
|
'trivial shape role creation takes. `key` is the only moment the raw secret exists outside the caller\'s hands — it is never in a ' +
|
|
734
733
|
'listing, never in an audit event, and cannot be read back.',
|
|
735
734
|
},
|
|
@@ -746,28 +745,28 @@ export const ROUTES = [
|
|
|
746
745
|
{
|
|
747
746
|
method: 'POST', path: '/api/apps/:id/server-keys/:keyId/rotate', section: 'apps',
|
|
748
747
|
summary: 'Replaces a server key\'s secret in place and returns the new one once.',
|
|
749
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier:
|
|
748
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
750
749
|
params: [
|
|
751
750
|
{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
|
|
752
751
|
{ name: 'keyId', description: 'The server key\'s uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`.' },
|
|
753
752
|
],
|
|
754
753
|
query: null, request: null, response: createServerKeyResponse,
|
|
755
|
-
errors: [...DEVELOPER_GUARD, '
|
|
756
|
-
notes: '
|
|
754
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
755
|
+
notes: 'The old secret is refused from this call on, and any `/realtime` socket that authenticated with ' +
|
|
757
756
|
'it is closed — rotation is what a developer reaches for when a key has leaked, and the holder of that socket is exactly who they are ' +
|
|
758
757
|
'rotating against.',
|
|
759
758
|
},
|
|
760
759
|
{
|
|
761
760
|
method: 'DELETE', path: '/api/apps/:id/server-keys/:keyId', section: 'apps',
|
|
762
761
|
summary: 'Revokes a server key and closes every socket holding it.',
|
|
763
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier:
|
|
762
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 204,
|
|
764
763
|
params: [
|
|
765
764
|
{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
|
|
766
765
|
{ name: 'keyId', description: 'The server key\'s uuid, from `GET /api/apps/:id/server-keys`; a key of another app answers `404`.' },
|
|
767
766
|
],
|
|
768
767
|
query: null, request: null, response: null,
|
|
769
|
-
errors: [...DEVELOPER_GUARD, '
|
|
770
|
-
notes: '
|
|
768
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
769
|
+
notes: 'The key stops working at once. Minting, rotating and revoking all decide who may speak for the whole app.',
|
|
771
770
|
},
|
|
772
771
|
/* -------------------------------------- the app's users and invitations */
|
|
773
772
|
{
|
|
@@ -1142,7 +1141,7 @@ export const ROUTES = [
|
|
|
1142
1141
|
query: null, request: null, response: appAuthConfig,
|
|
1143
1142
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'validation_error', 'not_found', 'unsupported_media_type'], transport: 'http',
|
|
1144
1143
|
notes: 'The body is the **raw image**, not JSON, so it has no request schema: `Content-Type` is one of `HOSTED_LOGO_TYPES` (`image/png`, ' +
|
|
1145
|
-
'`image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (
|
|
1144
|
+
'`image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (512 KB); a larger body, or one ' +
|
|
1146
1145
|
'that is not the image its type names, is `400 validation_error`. A new logo replaces the stored one. The hosted pages load it from ' +
|
|
1147
1146
|
'`hosted_logo_url` as an image only, and the cloud serves an SVG sandboxed, so a script inside one never runs.',
|
|
1148
1147
|
},
|
|
@@ -1626,17 +1625,6 @@ export const ROUTES = [
|
|
|
1626
1625
|
/* --------------------------------- the Fleetless-hosted app pages */
|
|
1627
1626
|
...HOSTED_APP_ROUTES,
|
|
1628
1627
|
/* ---------------------------------------------------- mcp (the endpoint) */
|
|
1629
|
-
{
|
|
1630
|
-
method: 'GET', path: '/mcp/welcome', section: 'mcp',
|
|
1631
|
-
summary: 'Serves the page that tells a person which URL to paste into their MCP client.',
|
|
1632
|
-
audience: 'internal', auth: 'none', rateLimited: false, ownerTier: false, status: 200,
|
|
1633
|
-
params: [], query: null, request: null, response: null, errors: [], transport: 'http',
|
|
1634
|
-
notes: 'HTML, one fixed document rendered once at startup — its inputs are process configuration, not request state. Cached for five minutes ' +
|
|
1635
|
-
'rather than a day, because the URLs it names can change with a deployment. Its content security policy admits the page\'s own inline ' +
|
|
1636
|
-
'style and script by SHA-256 rather than by `unsafe-inline`, and forbids every external fetch outright. A configured friendly URL that ' +
|
|
1637
|
-
'is not a usable absolute http(s) URL is ignored rather than rendered: a typo in a deployment variable must not put a broken URL in ' +
|
|
1638
|
-
'front of every end user.',
|
|
1639
|
-
},
|
|
1640
1628
|
{
|
|
1641
1629
|
method: 'POST', path: '/mcp', section: 'mcp',
|
|
1642
1630
|
summary: 'The central MCP endpoint: a stateless Streamable HTTP transport carrying the robot and console tool catalogs.',
|
|
@@ -1649,7 +1637,7 @@ export const ROUTES = [
|
|
|
1649
1637
|
'the refusal has to carry a `WWW-Authenticate` challenge that a guard shared with the REST surface does not send. `Origin` is checked ' +
|
|
1650
1638
|
'against the cloud\'s own, and a foreign one is the `403 forbidden` above. **Both catalogs, unconditionally**: every caller admitted ' +
|
|
1651
1639
|
'here is a Fleetless user, so the tool list has nothing left to vary with and the admin-ness check on `tools/call` is gone — a console ' +
|
|
1652
|
-
'tool that is still narrower than the catalog refuses for itself (`
|
|
1640
|
+
'tool that is still narrower than the catalog refuses for itself (`console_team_write.delete` refuses to remove an owner). ' +
|
|
1653
1641
|
'`403 forbidden` is also what an `mcp_session` token whose subject is an **app user** gets: this endpoint serves the team only, and such ' +
|
|
1654
1642
|
'a token belongs to its own app\'s endpoint. The code is `forbidden` rather than `mcp_disabled` because nothing is switched off — the ' +
|
|
1655
1643
|
'caller is at the wrong server — and per-app sign-in mints exactly such tokens, so the two states must not share a word. ' +
|
|
@@ -2264,13 +2252,12 @@ export const ROUTES = [
|
|
|
2264
2252
|
{
|
|
2265
2253
|
method: 'POST', path: '/api/robots/:id/token/rotate', section: 'robots',
|
|
2266
2254
|
summary: 'Mints a new bridge token for the robot and invalidates the old one.',
|
|
2267
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier:
|
|
2255
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 201,
|
|
2268
2256
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2269
2257
|
query: null, request: null, response: robotTokenRotateResponse,
|
|
2270
|
-
errors: [...DEVELOPER_GUARD, '
|
|
2271
|
-
notes: '
|
|
2272
|
-
'
|
|
2273
|
-
'stores a hash — so a caller who loses it rotates again. Audited as `robot.token_rotated`, with no `details`: the one interesting value ' +
|
|
2258
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2259
|
+
notes: 'A robot outside the caller\'s org answers `404`, as an unknown id does. `token` is the only moment the new secret exists outside the ' +
|
|
2260
|
+
'caller\'s hands — the cloud stores a hash — so a caller who loses it rotates again. Audited as `robot.token_rotated`, with no `details`: the one interesting value ' +
|
|
2274
2261
|
'here is the token. \n\n**It stops the bridge that is connected right now.** The old secret is gone the instant the hash is replaced, so ' +
|
|
2275
2262
|
'the cloud closes that socket with `CLOSE_TOKEN_ROTATED` rather than leaving a bridge speaking on a credential nothing would accept ' +
|
|
2276
2263
|
'again. A bridge that does not know the code reconnects and is refused at hello as `invalid_token`, which is the honest answer and ends ' +
|
|
@@ -2336,12 +2323,11 @@ export const ROUTES = [
|
|
|
2336
2323
|
{
|
|
2337
2324
|
method: 'DELETE', path: '/api/robots/:id', section: 'robots',
|
|
2338
2325
|
summary: 'Deletes a robot and everything it produced.',
|
|
2339
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier:
|
|
2326
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 204,
|
|
2340
2327
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2341
2328
|
query: robotDeleteQuery, request: null, response: null,
|
|
2342
|
-
errors: [...DEVELOPER_GUARD, '
|
|
2343
|
-
notes: '
|
|
2344
|
-
'for a robot outside their org, rather than a tier refusal that confirms the id exists. A full cascade — everything the robot produced ' +
|
|
2329
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'robot_in_use', 'robot_deletion_partial'], transport: 'http',
|
|
2330
|
+
notes: 'A robot outside the caller\'s org answers `404`, as an unknown id does. A full cascade — everything the robot produced ' +
|
|
2345
2331
|
'goes, except the audit trail, which is a record of what happened and must survive the thing it happened to. An open live session is ' +
|
|
2346
2332
|
'`409 robot_in_use` unless `?force=true` is passed, matched as the bare string so the caller has to actually say it. A cascade that ' +
|
|
2347
2333
|
'fails partway is `500 robot_deletion_partial` with the progress, never a bare `internal_error` that would read as "nothing happened".',
|
|
@@ -2426,7 +2412,8 @@ export const ROUTES = [
|
|
|
2426
2412
|
query: null, request: null, response: configDraftResponse,
|
|
2427
2413
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2428
2414
|
notes: 'Issues are recomputed on every read and every write, so an editor never has to guess whether it may publish. `doc` is `null` for a ' +
|
|
2429
|
-
'draft that is valid YAML but not a Fleetless configuration — a state the format admits and the publish route refuses.'
|
|
2415
|
+
'draft that is valid YAML but not a Fleetless configuration — a state the format admits and the publish route refuses. `updated_by` ' +
|
|
2416
|
+
'names the team member who saved it last, and is `null` when nobody has, or when the cloud itself rewrote the draft.',
|
|
2430
2417
|
},
|
|
2431
2418
|
{
|
|
2432
2419
|
method: 'PUT', path: '/api/robots/:id/config/draft', section: 'config',
|
|
@@ -2459,6 +2446,7 @@ export const ROUTES = [
|
|
|
2459
2446
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2460
2447
|
query: null, request: null, response: configVersionsResponse,
|
|
2461
2448
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2449
|
+
notes: 'Each version carries `published_by`, the team member who published it, or `null` for a version published before the cloud recorded authors or by a member who has since been removed.',
|
|
2462
2450
|
},
|
|
2463
2451
|
{
|
|
2464
2452
|
method: 'GET', path: '/api/robots/:id/config/versions/:v', section: 'config',
|
|
@@ -2867,11 +2855,11 @@ export const ROUTES = [
|
|
|
2867
2855
|
{
|
|
2868
2856
|
method: 'POST', path: '/api/robots/:id/assets/sync', section: 'assets',
|
|
2869
2857
|
summary: 'Asks the robot to upload its URDF and meshes, and returns the sync id.',
|
|
2870
|
-
audience: 'client', auth: 'developer_or_client', rateLimited: false, ownerTier:
|
|
2858
|
+
audience: 'client', auth: 'developer_or_client', rateLimited: false, ownerTier: false, status: 202,
|
|
2871
2859
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2872
2860
|
query: null, request: assetSyncRequest, response: assetSyncResponse,
|
|
2873
|
-
errors: [...CLIENT_GUARD, '
|
|
2874
|
-
notes: '
|
|
2861
|
+
errors: [...CLIENT_GUARD, 'invalid_uuid', 'validation_error', 'not_found', 'robot_offline', 'busy'], transport: 'http',
|
|
2862
|
+
notes: 'Developer sessions only. The guard admits an end user or a server key, but only a developer session gets past the handler — and the ' +
|
|
2875
2863
|
'body is parsed **before** that `401`, because this route has always answered a malformed body first and the order has to survive. The ' +
|
|
2876
2864
|
'request is strict: a caller naming a source that does not exist learns so, instead of silently getting a bridge sync they did not ask ' +
|
|
2877
2865
|
'for. A robot that has reported nothing available to sync is `404`. A second sync is `409 busy` naming the `sync_id` that is actually ' +
|
|
@@ -2893,13 +2881,13 @@ export const ROUTES = [
|
|
|
2893
2881
|
{
|
|
2894
2882
|
method: 'DELETE', path: '/api/robots/:id/assets', section: 'assets',
|
|
2895
2883
|
summary: "Empties a robot's asset store: every URDF, mesh and texture, gone at once.",
|
|
2896
|
-
audience: 'client', auth: 'developer_or_client', rateLimited: false, ownerTier:
|
|
2884
|
+
audience: 'client', auth: 'developer_or_client', rateLimited: false, ownerTier: false, status: 200,
|
|
2897
2885
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2898
2886
|
query: null, request: null, response: assetsClearResponse,
|
|
2899
|
-
errors: [...CLIENT_GUARD, '
|
|
2887
|
+
errors: [...CLIENT_GUARD, 'invalid_uuid', 'not_found', 'busy'], transport: 'http',
|
|
2900
2888
|
notes: 'The store\'s escape hatch: a full store is never a dead end, and this is the blunt third of the three answers to it — the URDF upload ' +
|
|
2901
|
-
'is exempt from the gate, reconcile after a sync already frees what the new URDF stopped referencing, and this route lets
|
|
2902
|
-
'the robot outright.
|
|
2889
|
+
'is exempt from the gate, reconcile after a sync already frees what the new URDF stopped referencing, and this route lets a developer clear ' +
|
|
2890
|
+
'the robot outright. Developer sessions only, like starting a sync. Removes every asset of the robot and resets its store to `0`; ' +
|
|
2903
2891
|
"the next sync fills it again. It does not touch the bridge's availability report — `urdf_available` still answers from the connected " +
|
|
2904
2892
|
'robot, unrelated to what this cloud happens to have stored. A clear while a sync is running is `409 busy` naming that sync\'s ' +
|
|
2905
2893
|
'details, the same refusal starting a second sync gets, because deleting under a running upload would leave the store counter wrong.',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetless/contracts",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.3.0",
|
|
4
4
|
"description": "Fleetless wire contracts: the bridge-cloud protocol, the REST API schemas and the error codes, as zod schemas with generated JSON Schema and OpenAPI artifacts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Dehne Robotik GmbH",
|