@fleetless/contracts 13.2.0 → 14.0.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 +169 -0
- package/artifacts/openapi.json +2092 -787
- package/artifacts/routes.json +229 -230
- package/artifacts/schema/access-warning.schema.json +51 -0
- package/artifacts/schema/action-config.schema.json +35 -0
- package/artifacts/schema/app-access-response.schema.json +136 -0
- package/artifacts/schema/app-access.schema.json +80 -0
- package/artifacts/schema/app-auth-config.schema.json +15 -0
- package/artifacts/schema/app-deletion-summary.schema.json +0 -7
- package/artifacts/schema/app-invitation-list-response.schema.json +13 -6
- package/artifacts/schema/app-invitation.schema.json +5 -5
- package/artifacts/schema/app-list-response.schema.json +6 -6
- package/artifacts/schema/app-lock.schema.json +30 -0
- package/artifacts/schema/app-user-list-response.schema.json +13 -6
- package/artifacts/schema/app-user.schema.json +13 -6
- package/artifacts/schema/app.schema.json +6 -6
- package/artifacts/schema/auth-ok.schema.json +20 -6
- package/artifacts/schema/camera-list-response.schema.json +1 -1
- package/artifacts/schema/client-identity.schema.json +21 -6
- package/artifacts/schema/cloud-config.schema.json +359 -5
- package/artifacts/schema/config-draft-response.schema.json +389 -5
- package/artifacts/schema/config-version-response.schema.json +389 -5
- package/artifacts/schema/config-versions-response.schema.json +30 -0
- package/artifacts/schema/create-app-invitation-request.schema.json +4 -4
- package/artifacts/schema/create-app-user-request.schema.json +4 -4
- package/artifacts/schema/create-org-role-request.schema.json +33 -0
- package/artifacts/schema/dangling-reference.schema.json +129 -0
- package/artifacts/schema/datapoint-config.schema.json +35 -0
- package/artifacts/schema/datapoint-list-response.schema.json +1 -1
- package/artifacts/schema/effective-capability.schema.json +104 -0
- package/artifacts/schema/effective-rights-query.schema.json +19 -0
- package/artifacts/schema/effective-rights-response.schema.json +310 -0
- package/artifacts/schema/effective-robot-rights.schema.json +266 -0
- package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
- package/artifacts/schema/invoke-response.schema.json +1 -1
- package/artifacts/schema/journal-intent-v2-body.schema.json +74 -0
- package/artifacts/schema/journal-intent-v2.schema.json +84 -0
- package/artifacts/schema/journal-replay-receipt-body.schema.json +1 -0
- package/artifacts/schema/journal-replay-receipt.schema.json +1 -0
- package/artifacts/schema/mcp-robot-datasheet.schema.json +2 -2
- package/artifacts/schema/org-role-list-response.schema.json +205 -0
- package/artifacts/schema/org-role.schema.json +59 -0
- package/artifacts/schema/patch-app-user-request.schema.json +4 -4
- package/artifacts/schema/patch-org-role-request.schema.json +38 -0
- package/artifacts/schema/publish-config-response.schema.json +48 -1
- package/artifacts/schema/publisher-config.schema.json +35 -0
- package/artifacts/schema/put-role-defaults-request.schema.json +127 -0
- package/artifacts/schema/reference-place.schema.json +111 -0
- package/artifacts/schema/rename-slug-response.schema.json +4 -3
- package/artifacts/schema/robot-config-doc.schema.json +359 -5
- package/artifacts/schema/role-cycle-details.schema.json +18 -0
- package/artifacts/schema/role-defaults-response.schema.json +59 -0
- package/artifacts/schema/role-rename-preview.schema.json +146 -0
- package/artifacts/schema/service-config.schema.json +35 -0
- package/artifacts/schema/slug-usage-response.schema.json +4 -3
- package/artifacts/schema/update-app-request.schema.json +0 -12
- package/dist/app-users.d.ts +30 -10
- package/dist/app-users.js +32 -12
- package/dist/apps.d.ts +242 -71
- package/dist/apps.js +205 -151
- package/dist/audit.d.ts +3 -3
- package/dist/billing.d.ts +10 -10
- package/dist/client-auth.d.ts +5 -2
- package/dist/client-auth.js +11 -3
- package/dist/client-robots.d.ts +1 -1
- package/dist/client-robots.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/config-issues.d.ts +1 -1
- package/dist/config-issues.js +1 -1
- package/dist/config.d.ts +77 -11
- package/dist/config.js +108 -14
- package/dist/errors.d.ts +14 -5
- package/dist/errors.js +37 -24
- package/dist/index.d.ts +22 -12
- package/dist/index.js +16 -6
- package/dist/journal-intents.d.ts +30 -0
- package/dist/journal-intents.js +3 -0
- package/dist/legal-acceptances.d.ts +2 -2
- package/dist/mcp.d.ts +5 -37
- package/dist/mcp.js +4 -14
- package/dist/org-roles.d.ts +182 -0
- package/dist/org-roles.js +198 -0
- package/dist/plans.d.ts +6 -6
- package/dist/protocol.d.ts +19 -1
- package/dist/realtime.d.ts +6 -3
- package/dist/realtime.js +1 -1
- package/dist/rest.d.ts +104 -25
- package/dist/rest.js +67 -29
- package/dist/rights.d.ts +197 -0
- package/dist/rights.js +396 -0
- package/dist/routes.js +190 -148
- package/package.json +1 -1
- package/artifacts/schema/mcp-role-preview-response.schema.json +0 -134
- package/artifacts/schema/role-delete-query.schema.json +0 -13
- package/artifacts/schema/role-in-use-details.schema.json +0 -28
- package/artifacts/schema/role-list-response.schema.json +0 -48
- package/artifacts/schema/role-permissions.schema.json +0 -61
- package/artifacts/schema/role-rename-request.schema.json +0 -16
- package/artifacts/schema/role.schema.json +0 -35
package/dist/routes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
import { appListResponse, appDeletionSummary, createAppRequest, createServerKeyResponse, app as appSchema,
|
|
2
|
+
import { appAccess, appAccessResponse, appListResponse, appDeletionSummary, createAppRequest, createServerKeyResponse, app as appSchema, effectiveRightsQuery, effectiveRightsResponse, serverKeyListResponse, updateAppRequest, } from './apps.js';
|
|
3
3
|
import { alertListResponse, orgAlertsQuery, orgFiringAlertsResponse } from './alerts.js';
|
|
4
4
|
import { asset, assetListResponse, assetsClearResponse, assetSyncRequest, assetSyncResponse, assetSyncStatus, missingAssetQuery } from './assets.js';
|
|
5
5
|
import { auditListResponse, auditQuery } from './audit.js';
|
|
@@ -7,12 +7,13 @@ import { feedbackRequest, feedbackResponse } from './feedback.js';
|
|
|
7
7
|
import { CLIENT_OIDC_CALLBACK_PATH, clientAcceptInvitationRequest, clientIdentity, clientLoginCodeRequest, clientLoginCodeVerifyRequest, clientLoginRequest, clientLogoutRequest, clientMcpInteraction, clientMcpInteractionDecisionResponse, clientOidcCallbackQuery, clientOidcExchangeRequest, clientOidcStartQuery, clientPasswordResetConfirmRequest, clientPasswordResetRequest, clientProviderListQuery, clientProviderListResponse, clientRefreshRequest, clientRegisterRequest, clientResendVerificationRequest, clientSignInResult, clientTwoFactorDisableRequest, clientTwoFactorSetupConfirmRequest, clientTwoFactorSetupConfirmResponse, clientTwoFactorSetupRequest, clientTwoFactorVerifyRequest, clientVerifyEmailRequest, mcpConsentGrantListResponse, } from './client-auth.js';
|
|
8
8
|
import { clientRobotListResponse } from './client-robots.js';
|
|
9
9
|
import { appAuthConfig, appInvitation, appInvitationListResponse, appMailTemplate, appMailTemplateListResponse, appOidcProvider, appOidcProviderListResponse, appUser, appUserListResponse, createAppInvitationRequest, createAppOidcProviderRequest, createAppUserRequest, mailOutcome, mailTemplatePreviewRequest, mailTemplatePreviewResponse, patchAppOidcProviderRequest, patchAppUserRequest, putAppAuthLookRequest, putAppAuthMcpRequest, putAppAuthRegistrationRequest, putAppAuthSignInRequest, putAppAuthUrlsRequest, putAppMailTemplateRequest, } from './app-users.js';
|
|
10
|
+
import { createOrgRoleRequest, orgRole, orgRoleListResponse, patchOrgRoleRequest, putRoleDefaultsRequest, roleDefaultsResponse, } from './org-roles.js';
|
|
10
11
|
import { controllerRegisterOrgResponse, controllerRegisterWrite } from './controller-register.js';
|
|
11
12
|
import { acceptTeamInviteRequest, authMeResponse, createPasskeyRequest, createPasskeyResponse, createTeamInviteRequest, developerPasskey, developerTwoFactor, fleetlessUser, fleetlessUserListResponse, passwordChangeRequest, patchAuthMeRequest, patchFleetlessUserRequest, patchOrgRequest, patchOrgResponse, pendingTeamInviteListResponse, refreshRequest, sessionTokens, teamInvite, recoveryCodesResponse, renamePasskeyRequest, tierChangeRequest, totpConfirmRequest, totpConfirmResponse, twoFactorSetupResponse, waitlistRequest, webauthnOptionsResponse, } from './identity.js';
|
|
12
13
|
import { jobRunListResponse, jobRunQuery, jobRunSummary, jobRunSummaryQuery } from './jobs.js';
|
|
13
14
|
import { legalAcceptanceListQuery, legalAcceptanceListResponse } from './legal-acceptances.js';
|
|
14
15
|
import { legalOfferListQuery, legalOfferListResponse, legalOfferDisplayRequest, legalOfferDisplayResponse, legalOfferDecisionRequest, legalOfferDecisionLookupQuery, legalOfferDecisionResult, } from './legal-offers.js';
|
|
15
|
-
import { MCP_APP_PATHS, mcpRobotDatasheet
|
|
16
|
+
import { MCP_APP_PATHS, mcpRobotDatasheet } from './mcp.js';
|
|
16
17
|
import { authorizationServerMetadata, dynamicClientRegistrationRequest, dynamicClientRegistrationResponse, oauthAuthorizeQuery, oauthRedirectResponse, oauthTokenRequest, oauthTokenResponse, protectedResourceMetadata, } from './oauth.js';
|
|
17
18
|
import { adminPlanChangeRequest, orgPlan, planChangeRequest, planChangePrepareRequest, planChangeDecisionLookupQuery, planChangeDecisionStatusResponse } from './plans.js';
|
|
18
19
|
import { supportRenewFailRequest, supportTokenRequest, supportTokenResponse } from './support.js';
|
|
@@ -130,9 +131,9 @@ const MOLLIE = ['payment_provider_unavailable'];
|
|
|
130
131
|
* code in `ERROR_CODES` satisfies every one of them.
|
|
131
132
|
*
|
|
132
133
|
* It keeps `forbidden`, which `DEVELOPER_GUARD` no longer carries: this guard's
|
|
133
|
-
* routes have live 403 producers — a slug the
|
|
134
|
+
* routes have live 403 producers — a slug the caller's rights do not cover
|
|
134
135
|
* (`routes/history.ts`), a capability the role does not carry
|
|
135
|
-
* (`routes/commands.ts`), a camera or datapoint outside the
|
|
136
|
+
* (`routes/commands.ts`), a camera or datapoint outside the caller's rights
|
|
136
137
|
* (`routes/cameras.ts`, `routes/robots.ts`). That divergence is the reason the
|
|
137
138
|
* two lists were kept as separate constants while they still read alike.
|
|
138
139
|
*/
|
|
@@ -452,7 +453,7 @@ export const ROUTES = [
|
|
|
452
453
|
/* ------------------------------------------- client auth (portal pages) */
|
|
453
454
|
{
|
|
454
455
|
method: 'GET', path: '/favicon.svg', section: 'client-auth',
|
|
455
|
-
summary: 'Serves the Fleetless icon for the auth portal\'s
|
|
456
|
+
summary: 'Serves the Fleetless icon for the auth portal\'s browser tab.',
|
|
456
457
|
audience: 'internal', auth: 'none', rateLimited: false, ownerTier: false, status: 200,
|
|
457
458
|
params: [], query: null, request: null, response: null, errors: [], transport: 'http',
|
|
458
459
|
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 ' +
|
|
@@ -552,6 +553,78 @@ export const ROUTES = [
|
|
|
552
553
|
notes: 'The authenticated org is the only target. Null contacts explicitly clear earlier values. ' +
|
|
553
554
|
'The write is atomic and audited; billing data is never an implicit source. Support sessions cannot write.',
|
|
554
555
|
},
|
|
556
|
+
{
|
|
557
|
+
method: 'GET', path: '/api/org/roles', section: 'org',
|
|
558
|
+
summary: "Lists the organization's roles with how much depends on each, and the keys that are written somewhere but are no role.",
|
|
559
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
560
|
+
params: [], query: null, request: null, response: orgRoleListResponse,
|
|
561
|
+
errors: [...DEVELOPER_GUARD], transport: 'http',
|
|
562
|
+
notes: 'Roles belong to the organization and are shared by all its apps; console members hold none and are never filtered by them. Each role ' +
|
|
563
|
+
'carries the number of app users that hold it, of invitations that carry it, of apps that use it as their default and of places in ' +
|
|
564
|
+
'documents that name it. `dangling` lists the keys that are written somewhere and are no role, each with every place that writes it, ' +
|
|
565
|
+
'so a deleted or misspelled key can be found. None of this is an error: a key that names no role grants nothing and is reported here.',
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
method: 'POST', path: '/api/org/roles', section: 'org',
|
|
569
|
+
summary: 'Creates an organization role.',
|
|
570
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 201,
|
|
571
|
+
params: [], query: null, request: createOrgRoleRequest, response: orgRole,
|
|
572
|
+
errors: [...DEVELOPER_GUARD, 'validation_error', 'role_cycle', 'role_key_taken'], transport: 'http',
|
|
573
|
+
notes: 'An organization holds at most 50 roles; the next one is `400 validation_error`. A key in `inherits` that names no role is accepted and ' +
|
|
574
|
+
'warns: inheritance through it grants nothing until a role with that key exists. A role that would inherit from itself, as `inherits` ' +
|
|
575
|
+
'naming its own key does, is `400 role_cycle`. A key that another role has is `409 role_key_taken`.',
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
method: 'PATCH', path: '/api/org/roles/:key', section: 'org',
|
|
579
|
+
summary: "Changes a role's name, its parents or its key.",
|
|
580
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
581
|
+
params: [{ name: 'key', description: "The role's key, as listed by `GET /api/org/roles`; a key that names no role answers `404`." }],
|
|
582
|
+
query: null, request: patchOrgRoleRequest, response: orgRole,
|
|
583
|
+
errors: [...DEVELOPER_GUARD, 'validation_error', 'not_found', 'role_cycle', 'role_key_taken', 'confirmation_required'], transport: 'http',
|
|
584
|
+
notes: 'A field that is left out stays as it is; `inherits` replaces the whole list. A change to `inherits` that would lead back to the role is ' +
|
|
585
|
+
'`400 role_cycle`, with the loop in `details`. \n\n**Renaming the key is one call or two.** Without `update_references`, the rename is ' +
|
|
586
|
+
'accepted at once; everything that still names the old key, in documents, assignments, invitations, default roles, other roles and ' +
|
|
587
|
+
'organization defaults, keeps it and turns into a warning. With `update_references: true` and no `confirm`, a rename that has places to ' +
|
|
588
|
+
'rewrite changes nothing and answers `409 confirmation_required` whose `details` is a `roleRenamePreview`: every place that would be ' +
|
|
589
|
+
'rewritten, the document it is in, the version a published document would get, and a `confirm` token. A rename with no place to ' +
|
|
590
|
+
'rewrite applies at once and needs no token. The second call repeats the same body with ' +
|
|
591
|
+
'`confirm` set to that token and rewrites all of it in one transaction. Assignments and role rows change directly; each affected ' +
|
|
592
|
+
'published `fleetless.yaml` gets a new version that differs only in the key, and an existing draft is updated the same way. If the ' +
|
|
593
|
+
'places changed between the two calls, the token is stale and the second call answers a new preview instead of applying. A new key ' +
|
|
594
|
+
'that another role has is `409 role_key_taken`.',
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
method: 'DELETE', path: '/api/org/roles/:key', section: 'org',
|
|
598
|
+
summary: 'Deletes a role at once.',
|
|
599
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 204,
|
|
600
|
+
params: [{ name: 'key', description: "The role's key, as listed by `GET /api/org/roles`; a key that names no role answers `404`." }],
|
|
601
|
+
query: null, request: null, response: null,
|
|
602
|
+
errors: [...DEVELOPER_GUARD, 'validation_error', 'not_found'], transport: 'http',
|
|
603
|
+
notes: 'Nothing is moved and nothing is refused for what depends on the role. App users that hold it keep their account and can sign in, with ' +
|
|
604
|
+
'no rights from the role; everything that names the key turns into a warning and is listed under `dangling` of `GET /api/org/roles`. ' +
|
|
605
|
+
'Live subscriptions that relied on the role are re-checked at once. Creating a role with the same key later makes the places that ' +
|
|
606
|
+
'name it count again.',
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
method: 'GET', path: '/api/org/roles/defaults', section: 'org',
|
|
610
|
+
summary: "Reads the organization's default roles for each kind of access.",
|
|
611
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
612
|
+
params: [], query: null, request: null, response: roleDefaultsResponse,
|
|
613
|
+
errors: [...DEVELOPER_GUARD], transport: 'http',
|
|
614
|
+
notes: 'Every kind of access is present; an empty list means nobody holds it, not even the most senior role. A default applies where a robot\'s ' +
|
|
615
|
+
'published `fleetless.yaml` names no role for the thing asked about. A new organization starts with `observe` for `read` and `assets`, ' +
|
|
616
|
+
'and `operate` for `invoke`, `publish` and `job_history`.',
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
method: 'PUT', path: '/api/org/roles/defaults', section: 'org',
|
|
620
|
+
summary: "Changes the organization's default roles for the named kinds of access.",
|
|
621
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
622
|
+
params: [], query: null, request: putRoleDefaultsRequest, response: roleDefaultsResponse,
|
|
623
|
+
errors: [...DEVELOPER_GUARD, 'validation_error'], transport: 'http',
|
|
624
|
+
notes: 'Despite the verb, kinds that are not named keep their default; `null` or `[]` sets a kind to nobody. A key that names no role is ' +
|
|
625
|
+
'accepted and warns, and grants nothing. Answers all the defaults as they stand afterwards. A default that narrows who holds a kind ' +
|
|
626
|
+
're-checks the live subscriptions it affects.',
|
|
627
|
+
},
|
|
555
628
|
{
|
|
556
629
|
method: 'GET', path: '/api/audit', section: 'org',
|
|
557
630
|
summary: "Reads the org's audit log, newest first, cursor-paged over the durable sequence number.",
|
|
@@ -580,7 +653,8 @@ export const ROUTES = [
|
|
|
580
653
|
errors: [...DEVELOPER_GUARD, 'validation_error', 'identifier_taken', 'quota_exceeded'], transport: 'http',
|
|
581
654
|
notes: 'Every robot id is checked before anything is created, so a bad one never leaves a robotless app to clean up. The identifier `mcp` is ' +
|
|
582
655
|
'reserved by the central MCP server and refused as a `validation_error`. An app belongs to the org and to nothing inside it: the group ' +
|
|
583
|
-
'an app used to be created in, and the `409 target_state_conflict` that refused the Org Admins one, are both gone with the group model.'
|
|
656
|
+
'an app used to be created in, and the `409 target_state_conflict` that refused the Org Admins one, are both gone with the group model. ' +
|
|
657
|
+
'A new app has no default role: `default_role` is `null` until `PUT /api/apps/:id/access` sets one.',
|
|
584
658
|
},
|
|
585
659
|
{
|
|
586
660
|
method: 'GET', path: '/api/apps', section: 'apps',
|
|
@@ -597,17 +671,19 @@ export const ROUTES = [
|
|
|
597
671
|
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
598
672
|
query: null, request: null, response: appSchema,
|
|
599
673
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
600
|
-
notes: 'An app belonging to another org reads exactly like one that does not exist — `404`, never a `403`.'
|
|
674
|
+
notes: 'An app belonging to another org reads exactly like one that does not exist — `404`, never a `403`. `default_role` is the key as stored, ' +
|
|
675
|
+
'or `null` when the app has none; a key that names no role is shown as it is, and `GET /api/apps/:id/access` warns about it.',
|
|
601
676
|
},
|
|
602
677
|
{
|
|
603
678
|
method: 'PATCH', path: '/api/apps/:id', section: 'apps',
|
|
604
|
-
summary: "Changes an app's name
|
|
679
|
+
summary: "Changes an app's name or its attached robots.",
|
|
605
680
|
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
606
681
|
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
607
682
|
query: null, request: updateAppRequest, response: appSchema,
|
|
608
683
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'validation_error', 'not_found'], transport: 'http',
|
|
609
|
-
notes: '
|
|
610
|
-
'
|
|
684
|
+
notes: 'The default role is not set here: `PUT /api/apps/:id/access` replaces it together with the locks, and a body that names ' +
|
|
685
|
+
'a default role, by id or by key, is `400 validation_error`. ' +
|
|
686
|
+
'Changing the robot set closes every live subscription the app\'s users hold, since a robot they were using may no longer be reachable.',
|
|
611
687
|
},
|
|
612
688
|
{
|
|
613
689
|
method: 'GET', path: '/api/apps/:id/deletion-preview', section: 'apps',
|
|
@@ -629,98 +705,11 @@ export const ROUTES = [
|
|
|
629
705
|
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
630
706
|
query: null, request: null, response: null,
|
|
631
707
|
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,
|
|
708
|
+
notes: 'An app outside the caller\'s org answers `404`, as an unknown id does. A full cascade — its users, server keys, ' +
|
|
633
709
|
'invitations, OIDC provider configuration and mail templates all go, recorded once as `app.deleted` carrying an `appDeletionSummary`. ' +
|
|
634
|
-
'Its robots are untouched: they belong to the org, not to the app. \n\n**No `force` parameter** — see ' +
|
|
710
|
+
'Its robots and the organization\'s roles are untouched: they belong to the org, not to the app. \n\n**No `force` parameter** — see ' +
|
|
635
711
|
'`GET /api/apps/:id/deletion-preview`.',
|
|
636
712
|
},
|
|
637
|
-
{
|
|
638
|
-
method: 'POST', path: '/api/apps/:id/roles', section: 'apps',
|
|
639
|
-
summary: 'Creates a custom role on the app.',
|
|
640
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 201,
|
|
641
|
-
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
642
|
-
query: null, request: null, response: role,
|
|
643
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error'], transport: 'http',
|
|
644
|
-
notes: 'The body is `{ "name": string }` — non-empty, trimmed, at most 60 characters as on `role.name` — and is deliberately not a contract shape: contracts ' +
|
|
645
|
-
'define the `role` this answers with, not this one trivial request. **The answer is a bare `role`, not an envelope**, unlike the ' +
|
|
646
|
-
'listing beside it.',
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
method: 'GET', path: '/api/apps/:id/roles', section: 'apps',
|
|
650
|
-
summary: "Lists the app's roles, builtin and custom.",
|
|
651
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
652
|
-
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
653
|
-
query: null, request: null, response: roleListResponse,
|
|
654
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
655
|
-
notes: 'Answers `{ "roles": [role, …] }`, builtin roles included — a role a developer never created is still one a user can hold.',
|
|
656
|
-
},
|
|
657
|
-
{
|
|
658
|
-
method: 'PUT', path: '/api/apps/:id/roles/:roleId/permissions', section: 'apps',
|
|
659
|
-
summary: "Replaces a role's grants and capabilities in one write.",
|
|
660
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
661
|
-
params: [
|
|
662
|
-
{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
|
|
663
|
-
{ name: 'roleId', description: 'The role\'s uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.' },
|
|
664
|
-
],
|
|
665
|
-
query: null, request: rolePermissions, response: rolePermissions,
|
|
666
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error'], transport: 'http',
|
|
667
|
-
notes: '`role_id` in the body must name the role in the path, compared case-insensitively — a uuid is a value, not a string, and a client that ' +
|
|
668
|
-
'uppercases them consistently must not be refused for repeating what the path says. A grant naming a robot the app does not have is ' +
|
|
669
|
-
'refused rather than stored: a permission for something the role cannot reach reads as authoritative to whoever writes the next consumer. ' +
|
|
670
|
-
'Every user holding this role has their live subscriptions re-authorized.',
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
method: 'GET', path: '/api/apps/:id/roles/:roleId/permissions', section: 'apps',
|
|
674
|
-
summary: "Reads a role's grants and capabilities.",
|
|
675
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
676
|
-
params: [
|
|
677
|
-
{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
|
|
678
|
-
{ name: 'roleId', description: 'The role\'s uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.' },
|
|
679
|
-
],
|
|
680
|
-
query: null, request: null, response: rolePermissions,
|
|
681
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
method: 'GET', path: '/api/apps/:id/roles/:roleId/mcp-tools', section: 'apps',
|
|
685
|
-
summary: 'Previews the robot datasheets an MCP caller holding this role would be offered.',
|
|
686
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
687
|
-
params: [
|
|
688
|
-
{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
|
|
689
|
-
{ name: 'roleId', description: 'The role\'s uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.' },
|
|
690
|
-
],
|
|
691
|
-
query: null, request: null, response: mcpRolePreviewResponse,
|
|
692
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
693
|
-
notes: 'Built by the same builder the MCP server\'s own `robots.describe` uses, so the two cannot drift. It answers what the role *would* be ' +
|
|
694
|
-
'offered and consults nothing about any user\'s actual MCP entitlement. A robot the role grants nothing on still appears, with an empty ' +
|
|
695
|
-
'`exposures` — dropping it would read as "not attached", which is a different fact.',
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
method: 'PATCH', path: '/api/apps/:id/roles/:roleId', section: 'apps',
|
|
699
|
-
summary: 'Renames a role; its users keep it.',
|
|
700
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
701
|
-
params: [
|
|
702
|
-
{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
|
|
703
|
-
{ name: 'roleId', description: 'The role\'s uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.' },
|
|
704
|
-
],
|
|
705
|
-
query: null, request: roleRenameRequest, response: role,
|
|
706
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'role_name_taken'], transport: 'http',
|
|
707
|
-
notes: 'Names are unique per app, compared exactly as stored after trimming. Built-in roles can be renamed.',
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
method: 'DELETE', path: '/api/apps/:id/roles/:roleId', section: 'apps',
|
|
711
|
-
summary: 'Deletes a role, moving its users, pending invitations and default-role status to another role.',
|
|
712
|
-
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 204,
|
|
713
|
-
params: [
|
|
714
|
-
{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
|
|
715
|
-
{ name: 'roleId', description: 'The role\'s uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.' },
|
|
716
|
-
],
|
|
717
|
-
query: roleDeleteQuery, request: null, response: null,
|
|
718
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'role_in_use', 'last_role'], transport: 'http',
|
|
719
|
-
notes: 'Without `move_to`, a role that app users or pending invitations hold, or that is the app\'s default, answers ' +
|
|
720
|
-
'`409 role_in_use` with `{ users, invitations, is_default }`. With `move_to` — another role of the same app, else ' +
|
|
721
|
-
'`400 validation_error` — one transaction moves `app_users.role_id`, pending invitations and `default_role_id`, then deletes ' +
|
|
722
|
-
'the role and its permissions. The app\'s only role answers `409 last_role`. Built-in roles can be deleted like any other.',
|
|
723
|
-
},
|
|
724
713
|
{
|
|
725
714
|
method: 'POST', path: '/api/apps/:id/server-keys', section: 'apps',
|
|
726
715
|
summary: 'Mints a server key for the app and returns the raw secret once.',
|
|
@@ -728,8 +717,8 @@ export const ROUTES = [
|
|
|
728
717
|
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
729
718
|
query: null, request: null, response: createServerKeyResponse,
|
|
730
719
|
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 }`,
|
|
732
|
-
'trivial
|
|
720
|
+
notes: 'A server key carries full app rights and outlives its creator\'s removal. The body is `{ "name": string }`, too ' +
|
|
721
|
+
'trivial to be a contract shape. `key` is the only moment the raw secret exists outside the caller\'s hands — it is never in a ' +
|
|
733
722
|
'listing, never in an audit event, and cannot be read back.',
|
|
734
723
|
},
|
|
735
724
|
{
|
|
@@ -768,6 +757,49 @@ export const ROUTES = [
|
|
|
768
757
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
769
758
|
notes: 'The key stops working at once. Minting, rotating and revoking all decide who may speak for the whole app.',
|
|
770
759
|
},
|
|
760
|
+
{
|
|
761
|
+
method: 'GET', path: '/api/apps/:id/access', section: 'apps',
|
|
762
|
+
summary: "Reads what an app locks and which role its users get by default, with what is out of step in it.",
|
|
763
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
764
|
+
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
765
|
+
query: null, request: null, response: appAccessResponse,
|
|
766
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
767
|
+
notes: 'An app can only lock, never extend: roles decide who may use what, and a lock takes capabilities away from every user and server key of ' +
|
|
768
|
+
'the app, whatever their role. `warnings` lists what the access names that does not exist as written, such as a default role that ' +
|
|
769
|
+
'is no role or a lock on a slug the robot does not have. None of it is an error. `revision` identifies the access as it stands: ' +
|
|
770
|
+
'send it back with the next `PUT` and a write composed from a stale read is refused.',
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
method: 'PUT', path: '/api/apps/:id/access', section: 'apps',
|
|
774
|
+
summary: "Replaces what an app locks and which role its users get by default.",
|
|
775
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
776
|
+
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
777
|
+
query: null, request: appAccess, response: appAccessResponse,
|
|
778
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'validation_error', 'not_found', 'target_state_conflict'], transport: 'http',
|
|
779
|
+
notes: 'A full replacement: the body is exactly what the app has afterwards, so a lock that is not in it is lifted. A default role that is no ' +
|
|
780
|
+
'role, a lock on a slug the robot does not have and a lock on a robot the app does not attach are accepted and come back as ' +
|
|
781
|
+
'`warnings`. A change that can narrow rights re-checks the live subscriptions of the app\'s users at once. \n\n**Send the `revision` you ' +
|
|
782
|
+
'read.** The access can change under a caller without a write of its own: a slug rename adds the new name to every lock that lists the ' +
|
|
783
|
+
'old one, and detaching a robot drops its lock. A body composed before such a change would lift the lock it added, so a `revision` that ' +
|
|
784
|
+
'is no longer the stored one is `409 target_state_conflict` naming `revision` (rule `stale`), and nothing is written, audited or ' +
|
|
785
|
+
'announced; read the access again and compose the body anew. Left out, the body replaces whatever is stored, as before: the last ' +
|
|
786
|
+
'writer wins. A `revision` that is not a revision is `400 validation_error`.',
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
method: 'GET', path: '/api/apps/:id/effective-rights', section: 'apps',
|
|
790
|
+
summary: 'Shows what one role, or one app user, may use on each robot the app attaches.',
|
|
791
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
792
|
+
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
|
|
793
|
+
query: effectiveRightsQuery, request: null, response: effectiveRightsResponse,
|
|
794
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'validation_error', 'not_found'], transport: 'http',
|
|
795
|
+
notes: 'Name exactly one of `role` and `user`; both or neither is `400 validation_error`. Per attached robot, every capability is listed with ' +
|
|
796
|
+
'whether it is granted, the requirement, where that came from (the entry, rule n of `access.rules`, or the organization default), the ' +
|
|
797
|
+
'inherited role that satisfied it and whether the app locks it; the datasheet is the one an MCP session of that role would get. ' +
|
|
798
|
+
'Only the published configuration counts: a robot with nothing published has no exposures, and its `assets` and `job_history` follow ' +
|
|
799
|
+
'the organization defaults. `reachable` says whether a session of the role reaches the robot at all; a robot it does not reach is ' +
|
|
800
|
+
'still listed, with every capability that explains why. A role that is no role is not an error; it answers `role_known: false` with ' +
|
|
801
|
+
'nothing granted, and so does a user who is not `active`. A user of another app answers `404`.',
|
|
802
|
+
},
|
|
771
803
|
/* -------------------------------------- the app's users and invitations */
|
|
772
804
|
{
|
|
773
805
|
method: 'GET', path: '/api/apps/:id/users', section: 'apps',
|
|
@@ -779,7 +811,8 @@ export const ROUTES = [
|
|
|
779
811
|
notes: 'Answers `{ "users": [appUser, …] }`. **A different identity space from `GET /api/org/users`**, and nothing joins the two: an app user ' +
|
|
780
812
|
'belongs to exactly one app, their address is unique per app rather than globally, and the same address may exist as unrelated accounts ' +
|
|
781
813
|
'in several apps of one org. No password hash, no token and no provider secret appears here — `appUser` names the fields it carries ' +
|
|
782
|
-
'rather than spreading the stored row.'
|
|
814
|
+
'rather than spreading the stored row. An account that holds no role key lists with `role: null`; it reaches nothing until ' +
|
|
815
|
+
'`PATCH /api/apps/:id/users/:userId` gives it one.',
|
|
783
816
|
},
|
|
784
817
|
{
|
|
785
818
|
method: 'POST', path: '/api/apps/:id/users', section: 'apps',
|
|
@@ -791,13 +824,14 @@ export const ROUTES = [
|
|
|
791
824
|
notes: 'The developer-authenticated door into the app\'s user table, and the one place `409 email_taken` is an honest answer about an app user: ' +
|
|
792
825
|
'the caller is authenticated into this app already, so telling them the address is taken discloses nothing they could not read from the ' +
|
|
793
826
|
'listing beside it. `POST /api/client/register` answers `202` to the same fact, because there the caller is a stranger. `404 not_found` ' +
|
|
794
|
-
'is the app
|
|
795
|
-
'
|
|
827
|
+
'is the app. The `role` is a key of the organization\'s roles: a malformed one is `400 validation_error`, and a well-formed one is stored ' +
|
|
828
|
+
'as given even when it names no role, which grants nothing and shows up under `dangling` of `GET /api/org/roles`. **The password policy ' +
|
|
829
|
+
'answers `400 validation_error`**, not a code of its own: the ' +
|
|
796
830
|
'twelve-character minimum is the `password` field\'s schema rule, and every route that takes a password refuses a ' +
|
|
797
831
|
'short one exactly the way it refuses any other malformed field. An account created here is `active` immediately: a developer entering ' +
|
|
798
832
|
'somebody by hand has made the decision the verification mail automates, and its address counts as proven. `409 target_state_conflict` ' +
|
|
799
|
-
'names `
|
|
800
|
-
'
|
|
833
|
+
'names `default_role` with rule `not_set` when `role` is absent and the app has no default role — there would be no role to give the ' +
|
|
834
|
+
'user, so nothing is created. \n\n**`409 quota_exceeded` when the org holds as ' +
|
|
801
835
|
'many app users as `max_end_users` allows**, counted across every app of the org — the same number `GET /api/org/quotas` reports as ' +
|
|
802
836
|
'`usage.max_end_users`, since the same address in two apps is two accounts. `details` carries `{ quota, limit }`, as every count quota\'s ' +
|
|
803
837
|
'refusal does. The check is at **creation** only: an existing user signs in, is patched and is deleted at the quota exactly as under it, ' +
|
|
@@ -827,7 +861,9 @@ export const ROUTES = [
|
|
|
827
861
|
'who typed an address they do not own log in without ever spending the mailed token. Unblocking restores the status the account had — ' +
|
|
828
862
|
'`active` for one whose address was proven, `pending_verification` for one blocked before it ever verified. A write that names the ' +
|
|
829
863
|
'status the account already holds changes nothing and mints no event, so it does not end the sessions a re-sent form would otherwise ' +
|
|
830
|
-
'have killed. A `
|
|
864
|
+
'have killed. A `role` is stored as given, as creation does: a malformed key is `400 validation_error`, one that names no role grants ' +
|
|
865
|
+
'nothing, and the same key the user already holds changes nothing. A changed role is applied to the user\'s open subscriptions at once, ' +
|
|
866
|
+
'and those the new role no longer allows end.',
|
|
831
867
|
},
|
|
832
868
|
{
|
|
833
869
|
method: 'DELETE', path: '/api/apps/:id/users/:userId', section: 'apps',
|
|
@@ -926,7 +962,8 @@ export const ROUTES = [
|
|
|
926
962
|
'revoke. **No `accept_url`**, the rule the team listing already keeps: this list exists so a developer can see what is outstanding and ' +
|
|
927
963
|
'withdraw it, and neither needs the token, while a list that carried it would turn every screenshot and browser-history entry of that ' +
|
|
928
964
|
'page into a live credential for somebody else\'s account. `mail` is omitted too — it described what happened at creation time, and ' +
|
|
929
|
-
're-serving it invites a reader to take it as current.'
|
|
965
|
+
're-serving it invites a reader to take it as current. An invitation that holds no role key and whose app has no default role lists ' +
|
|
966
|
+
'with `role: null`; accepting or reissuing it is `409 target_state_conflict` naming `default_role`.',
|
|
930
967
|
},
|
|
931
968
|
{
|
|
932
969
|
method: 'POST', path: '/api/apps/:id/invitations', section: 'apps',
|
|
@@ -937,12 +974,13 @@ export const ROUTES = [
|
|
|
937
974
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'validation_error', 'not_found', 'email_taken', 'target_state_conflict', 'rate_limited'],
|
|
938
975
|
transport: 'http',
|
|
939
976
|
notes: '**An app user, not a team member.** `POST /api/org/invitations` is the other space and leads to the console; this link leads into the ' +
|
|
940
|
-
'developer\'s own app. The role is resolved and stored now, so a later change to `
|
|
977
|
+
'developer\'s own app. The role is resolved and stored now, so a later change to `default_role` does not re-aim a link already sent. ' +
|
|
941
978
|
'An invitation **always bypasses `allowed_domains`**. \n\nThe answer carries `accept_url`: the app\'s `invite_url` with the token in it, ' +
|
|
942
979
|
'or the Fleetless-hosted invitation page when the app has configured none — so mailing it is never refused for a missing URL. ' +
|
|
943
|
-
'`409 target_state_conflict` names `
|
|
944
|
-
'that names no role has nothing to hand its acceptor, so it is refused here rather than at the acceptance a week later. `
|
|
945
|
-
'
|
|
980
|
+
'`409 target_state_conflict` names `default_role` with rule `not_set` when `role` is absent and the app has no default role: an invitation ' +
|
|
981
|
+
'that names no role has nothing to hand its acceptor, so it is refused here rather than at the acceptance a week later. A `role` that ' +
|
|
982
|
+
'names no role is accepted and grants nothing; a malformed key is `400 validation_error`. `409 ' +
|
|
983
|
+
'email_taken` is an address the app already has as a user; `404 not_found` is the app. ' +
|
|
946
984
|
'\n\nCreating shares the reissue route\'s ceiling of **five invitation mails a minute per app**, answering `429 rate_limited` with ' +
|
|
947
985
|
'`retry_after_ms`: re-creating an invitation for one address replaces it and mails again, so a limit that bound only reissue would be ' +
|
|
948
986
|
'a limit on the wrong door.',
|
|
@@ -953,11 +991,13 @@ export const ROUTES = [
|
|
|
953
991
|
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
954
992
|
params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }, { name: 'invId', description: 'The invitation\'s uuid, from `GET /api/apps/:id/invitations`; an invitation of another app answers `404`.' }],
|
|
955
993
|
query: null, request: null, response: appInvitation,
|
|
956
|
-
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'rate_limited'], transport: 'http',
|
|
994
|
+
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'target_state_conflict', 'rate_limited'], transport: 'http',
|
|
957
995
|
notes: 'The old link stops resolving the instant this returns: the row is found by token hash and the previous hash is gone. Two live links to ' +
|
|
958
996
|
'one invitation would reopen the door the listing\'s missing `accept_url` closes. \n\n**The answer carries a new `id`.** The old row ' +
|
|
959
997
|
'is revoked and a fresh one takes its place, so a caller holding the previous `id` gets `404` from its next revoke or reissue: re-read ' +
|
|
960
|
-
'the listing after this call rather than keeping the id you sent. The
|
|
998
|
+
'the listing after this call rather than keeping the id you sent. The new invitation holds the same role, and the seven days start ' +
|
|
999
|
+
'again. An invitation that holds no role key and whose app has no default role is refused with `409 target_state_conflict` naming ' +
|
|
1000
|
+
'`default_role` (rule `not_set`) before the old link is revoked: set the default role, or revoke it and invite again. \n\nLimited server-side to **five ' +
|
|
961
1001
|
'reissues a minute per app** — shared with `POST /api/apps/:id/invitations`, since both mint a link and mail it — answering `429 ' +
|
|
962
1002
|
'rate_limited` with `retry_after_ms`. A disabled button is a hint, this is the limit. An invitation that has already been accepted is ' +
|
|
963
1003
|
'not pending and answers `404`.',
|
|
@@ -1141,7 +1181,7 @@ export const ROUTES = [
|
|
|
1141
1181
|
query: null, request: null, response: appAuthConfig,
|
|
1142
1182
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'validation_error', 'not_found', 'unsupported_media_type'], transport: 'http',
|
|
1143
1183
|
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`, ' +
|
|
1144
|
-
'`image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (
|
|
1184
|
+
'`image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (512 KB); a larger body, or one ' +
|
|
1145
1185
|
'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 ' +
|
|
1146
1186
|
'`hosted_logo_url` as an image only, and the cloud serves an SVG sandboxed, so a script inside one never runs.',
|
|
1147
1187
|
},
|
|
@@ -1625,17 +1665,6 @@ export const ROUTES = [
|
|
|
1625
1665
|
/* --------------------------------- the Fleetless-hosted app pages */
|
|
1626
1666
|
...HOSTED_APP_ROUTES,
|
|
1627
1667
|
/* ---------------------------------------------------- mcp (the endpoint) */
|
|
1628
|
-
{
|
|
1629
|
-
method: 'GET', path: '/mcp/welcome', section: 'mcp',
|
|
1630
|
-
summary: 'Serves the page that tells a person which URL to paste into their MCP client.',
|
|
1631
|
-
audience: 'internal', auth: 'none', rateLimited: false, ownerTier: false, status: 200,
|
|
1632
|
-
params: [], query: null, request: null, response: null, errors: [], transport: 'http',
|
|
1633
|
-
notes: 'HTML, one fixed document rendered once at startup — its inputs are process configuration, not request state. Cached for five minutes ' +
|
|
1634
|
-
'rather than a day, because the URLs it names can change with a deployment. Its content security policy admits the page\'s own inline ' +
|
|
1635
|
-
'style and script by SHA-256 rather than by `unsafe-inline`, and forbids every external fetch outright. A configured friendly URL that ' +
|
|
1636
|
-
'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 ' +
|
|
1637
|
-
'front of every end user.',
|
|
1638
|
-
},
|
|
1639
1668
|
{
|
|
1640
1669
|
method: 'POST', path: '/mcp', section: 'mcp',
|
|
1641
1670
|
summary: 'The central MCP endpoint: a stateless Streamable HTTP transport carrying the robot and console tool catalogs.',
|
|
@@ -1665,8 +1694,8 @@ export const ROUTES = [
|
|
|
1665
1694
|
errors: ['not_found', 'unauthorized', 'forbidden'], transport: 'http',
|
|
1666
1695
|
notes: 'JSON-RPC over MCP\'s Streamable HTTP, so neither the request nor the response is a shape contracts describes — exactly as `POST /mcp` ' +
|
|
1667
1696
|
'is, and stateless for the same reason: a fresh transport per request, no session id, nothing surviving the call. **App users only.** ' +
|
|
1668
|
-
'The tools are this app\'s robots filtered by the caller\'s role, built by the same builder `GET /api/
|
|
1669
|
-
'
|
|
1697
|
+
'The tools are this app\'s robots filtered by the caller\'s role, built by the same builder `GET /api/robots/:id/datasheet` ' +
|
|
1698
|
+
'answers, so the datasheet and the live catalog cannot drift. The console tool family belongs to the central endpoint and is ' +
|
|
1670
1699
|
'offered here to nobody. \n\n**The bearer is verified inside the handler**, not by a route guard, for the two reasons the central ' +
|
|
1671
1700
|
'endpoint gives — the identity comes from the token and the path names none of it, and the refusal has to carry a `WWW-Authenticate` ' +
|
|
1672
1701
|
'challenge a guard shared with the REST surface does not send. The challenge names **this app\'s** protected-resource document (RFC ' +
|
|
@@ -1872,8 +1901,9 @@ export const ROUTES = [
|
|
|
1872
1901
|
'or sent while it is off: an email-code-only app registers people without one. `404 not_found` names an ' +
|
|
1873
1902
|
'**app identifier no app carries**, and never an address: an app identifier is already public (it is in the MCP metadata path and in the ' +
|
|
1874
1903
|
'developer\'s own URLs), while collapsing it into `registration_closed` sent a developer who mistyped their own identifier hunting a ' +
|
|
1875
|
-
'configuration bug that was not there. `409 target_state_conflict` when the app has no default
|
|
1876
|
-
'the person.
|
|
1904
|
+
'configuration bug that was not there. `409 target_state_conflict` naming `default_role` with rule `not_set` when the app has no default ' +
|
|
1905
|
+
'role — there would be no role to give the person. A default that names no role is not a refusal: the account holds the key and ' +
|
|
1906
|
+
'reaches nothing. An app with no `verify_url` is not refused: the mailed link points at the hosted confirmation page instead. ' +
|
|
1877
1907
|
'\n\n**`409 quota_exceeded` when the org is at its `max_end_users` limit**, counted across every app of the org. It is the one refusal ' +
|
|
1878
1908
|
'here that is answered **before the address is looked at** — and that ordering is the point rather than an implementation detail: a ' +
|
|
1879
1909
|
'quota checked after the existence branch would answer `202` for an address the app already knows and `409` for one it does not, which ' +
|
|
@@ -1959,9 +1989,11 @@ export const ROUTES = [
|
|
|
1959
1989
|
'than being spent, so the developer can revoke it or point the person at the login. An address that registered itself and is still ' +
|
|
1960
1990
|
'`pending_verification` is not that state: accepting sets the password the invitee just chose, activates the account and gives it the ' +
|
|
1961
1991
|
'invitation\'s role, because reading the invitation mail proves the address the verification link was waiting on. \n\n`409 ' +
|
|
1962
|
-
'target_state_conflict` names `
|
|
1963
|
-
'app has no default role to fall back on: there is no access to hand the acceptor, and creating an account with none would
|
|
1964
|
-
'than saying so.
|
|
1992
|
+
'target_state_conflict` names `default_role` with rule `not_set` when the invitation holds no role key (it lists with `role: null`) ' +
|
|
1993
|
+
'and the app has no default role to fall back on: there is no access to hand the acceptor, and creating an account with none would ' +
|
|
1994
|
+
'be worse than saying so. A role deleted since the invitation was issued is no obstacle: the account is created holding the key and ' +
|
|
1995
|
+
'reaches nothing. ' +
|
|
1996
|
+
'\n\n**`409 quota_exceeded` when accepting would CREATE an account and the org is at its `max_end_users` limit**, counted ' +
|
|
1965
1997
|
'across every app of the org. An invitation that names a row the developer already created, and one whose address is held by an ' +
|
|
1966
1998
|
'unfinished self-registration, both finish an account that already counts — those are not refused, because the org is not one account ' +
|
|
1967
1999
|
'larger afterwards. The token is not spent by the refusal: the developer can raise the limit, or delete somebody, and the same link ' +
|
|
@@ -2010,7 +2042,9 @@ export const ROUTES = [
|
|
|
2010
2042
|
params: [], query: null, request: null, response: clientIdentity,
|
|
2011
2043
|
errors: [...CLIENT_GUARD], transport: 'http',
|
|
2012
2044
|
notes: 'The one route that answers for all three caller kinds — a developer bearer, an app-user bearer and a server key — which is why the ' +
|
|
2013
|
-
'shape names each of `developer_id`, `app_user_id` and `server_key_id` and fills exactly one.'
|
|
2045
|
+
'shape names each of `developer_id`, `app_user_id` and `server_key_id` and fills exactly one. `role` is the organization role an app ' +
|
|
2046
|
+
'user holds, as its key and display name; it is `null` for a developer and a server key, and for an app user whose key names no role ' +
|
|
2047
|
+
'(the role was deleted), who signs in and reaches nothing.',
|
|
2014
2048
|
},
|
|
2015
2049
|
/* ------------------------------------------------ app-user two-factor */
|
|
2016
2050
|
{
|
|
@@ -2360,17 +2394,17 @@ export const ROUTES = [
|
|
|
2360
2394
|
params: [{ name: 'id', description: 'The robot\'s uuid; an end user reaches it through an app that attaches it.' }],
|
|
2361
2395
|
query: null, request: null, response: datapointListResponse,
|
|
2362
2396
|
errors: [...CLIENT_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2363
|
-
notes: 'A developer bearer sees the robot\'s whole list unfiltered; an end user
|
|
2397
|
+
notes: 'A developer bearer sees the robot\'s whole list unfiltered; an end user sees only the slugs their role grants, a server key every slug its app does not lock, and a ' +
|
|
2364
2398
|
'robot their app does not attach answers `404` exactly as one that does not exist.',
|
|
2365
2399
|
},
|
|
2366
2400
|
{
|
|
2367
2401
|
method: 'GET', path: '/api/robots/:id/exposures', section: 'robots',
|
|
2368
|
-
summary: 'Lists every
|
|
2402
|
+
summary: 'Lists every exposed slug of a robot with its kind — the material an app picks its locks from.',
|
|
2369
2403
|
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
2370
2404
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2371
2405
|
query: null, request: null, response: exposureListResponse,
|
|
2372
2406
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2373
|
-
notes: 'Developer-only: this is what a role
|
|
2407
|
+
notes: 'Developer-only: this is what a role could be required to use and an app could lock, which is a configuration fact rather than something an end user is entitled to enumerate.',
|
|
2374
2408
|
},
|
|
2375
2409
|
{
|
|
2376
2410
|
method: 'GET', path: '/api/robots/:id/datapoints/:slug', section: 'robots',
|
|
@@ -2409,7 +2443,7 @@ export const ROUTES = [
|
|
|
2409
2443
|
errors: [...CLIENT_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2410
2444
|
notes: '**The REST twin of the MCP action `robots.describe`**: one answer per robot — every datapoint, action, service, publisher and camera the ' +
|
|
2411
2445
|
'role grants, each with its `input_schema` where it takes parameters, plus the two capabilities that gate whole features, ' +
|
|
2412
|
-
'`
|
|
2446
|
+
'`job_history` and `assets`. A robot with nothing published answers an empty `exposures` list, never a refusal. A robot the caller ' +
|
|
2413
2447
|
'does not reach — not attached to their app, or attached with a role that grants nothing on it — answers `404` exactly as one that ' +
|
|
2414
2448
|
'does not exist. The app-user datapoint and camera listings under this prefix stay; this is the one read that also names actions, ' +
|
|
2415
2449
|
'services, publishers and capabilities, which is what an app needs before it can draw a screen.',
|
|
@@ -2423,7 +2457,8 @@ export const ROUTES = [
|
|
|
2423
2457
|
query: null, request: null, response: configDraftResponse,
|
|
2424
2458
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2425
2459
|
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 ' +
|
|
2426
|
-
'draft that is valid YAML but not a Fleetless configuration — a state the format admits and the publish route refuses.'
|
|
2460
|
+
'draft that is valid YAML but not a Fleetless configuration — a state the format admits and the publish route refuses. `updated_by` ' +
|
|
2461
|
+
'names the team member who saved it last, and is `null` when nobody has, or when the cloud itself rewrote the draft.',
|
|
2427
2462
|
},
|
|
2428
2463
|
{
|
|
2429
2464
|
method: 'PUT', path: '/api/robots/:id/config/draft', section: 'config',
|
|
@@ -2447,7 +2482,9 @@ export const ROUTES = [
|
|
|
2447
2482
|
notes: 'A draft that is valid YAML but not a Fleetless configuration is `422 draft_not_a_document`, carrying every issue rather than the ' +
|
|
2448
2483
|
'blocking subset — nothing about that text is publishable, so there is no subset to pick, and the warning naming the checks that could ' +
|
|
2449
2484
|
'not run is part of reading the list correctly. A document with `severity: "error"` issues is `422 validation_error` with just those. ' +
|
|
2450
|
-
'The draft\'s own text travels into the version, so a restore later returns what the author wrote rather than a re-rendering of it.'
|
|
2485
|
+
'The draft\'s own text travels into the version, so a restore later returns what the author wrote rather than a re-rendering of it. ' +
|
|
2486
|
+
'The answer carries `warnings`: every `warning` of the published document, role keys that name no role of the organization included. ' +
|
|
2487
|
+
'A warning never blocks a publish.',
|
|
2451
2488
|
},
|
|
2452
2489
|
{
|
|
2453
2490
|
method: 'GET', path: '/api/robots/:id/config/versions', section: 'config',
|
|
@@ -2456,6 +2493,7 @@ export const ROUTES = [
|
|
|
2456
2493
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2457
2494
|
query: null, request: null, response: configVersionsResponse,
|
|
2458
2495
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2496
|
+
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.',
|
|
2459
2497
|
},
|
|
2460
2498
|
{
|
|
2461
2499
|
method: 'GET', path: '/api/robots/:id/config/versions/:v', section: 'config',
|
|
@@ -2485,16 +2523,20 @@ export const ROUTES = [
|
|
|
2485
2523
|
},
|
|
2486
2524
|
{
|
|
2487
2525
|
method: 'POST', path: '/api/robots/:id/config/rename-slug', section: 'config',
|
|
2488
|
-
summary: 'Renames a slug in the draft and moves
|
|
2526
|
+
summary: 'Renames a slug in the draft and moves the app locks and the recorded history with the name.',
|
|
2489
2527
|
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
|
|
2490
2528
|
params: [{ name: 'id', description: 'The robot\'s uuid, as returned by `POST /api/robots` or listed by `GET /api/robots`.' }],
|
|
2491
2529
|
query: null, request: renameSlugRequest, response: renameSlugResponse,
|
|
2492
2530
|
errors: [
|
|
2493
2531
|
...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'draft_not_a_document',
|
|
2494
|
-
'unknown_slug', 'reserved_slug', 'duplicate_slug', 'history_migrating', 'internal_error',
|
|
2532
|
+
'unknown_slug', 'reserved_slug', 'duplicate_slug', 'history_migrating', 'target_state_conflict', 'internal_error',
|
|
2495
2533
|
], transport: 'http',
|
|
2496
|
-
notes: 'One transaction: the draft document and every app
|
|
2497
|
-
'the name without rewriting any stored sample, so a rename takes the same time however much history there is.
|
|
2534
|
+
notes: 'One transaction: the draft document and every app lock that lists the slug are rewritten, and the recorded history moves with ' +
|
|
2535
|
+
'the name without rewriting any stored sample, so a rename takes the same time however much history there is. Locks follow the ' +
|
|
2536
|
+
'rename: a lock that listed the old slug lists the new one as well, in every app of the organization, so a locked capability stays ' +
|
|
2537
|
+
'locked; the old name stays in the lock until the next `PUT /api/apps/:id/access`, and `rewritten_locks` counts the locks touched. A ' +
|
|
2538
|
+
'lock that would grow past the most slugs it can hold refuses the whole rename with `409 target_state_conflict` naming `to` (rule ' +
|
|
2539
|
+
'`lock_full`); nothing is written. Samples the robot ' +
|
|
2498
2540
|
'still sends under the old slug until the next publish join the renamed history. The published configuration is immutable, so ' +
|
|
2499
2541
|
'`requires_publish` says the rename is not live on the robot yet. A draft that is not a document is `409 draft_not_a_document` — the ' +
|
|
2500
2542
|
'same word the usage preview uses for the same state. While the recorded history is being migrated the rename is refused with ' +
|
|
@@ -2513,7 +2555,7 @@ export const ROUTES = [
|
|
|
2513
2555
|
notes: 'A draft that is valid YAML but not a Fleetless document is refused rather than answered with `alert_count: 0`: the two states are ' +
|
|
2514
2556
|
'*this slug has no alerts* and *there is no document to ask*, and a zero cannot tell them apart — it would show a smaller blast radius ' +
|
|
2515
2557
|
'than the rename actually has. The other three counts are real whatever the draft holds, and a partial answer to a preview whose whole ' +
|
|
2516
|
-
'purpose is to be complete is not worth the ambiguity.',
|
|
2558
|
+
'purpose is to be complete is not worth the ambiguity. `lock_count` counts the app locks the rename would extend with the new name.',
|
|
2517
2559
|
},
|
|
2518
2560
|
/* -------------------------------------------------------------- alerts */
|
|
2519
2561
|
{
|
|
@@ -2600,7 +2642,7 @@ export const ROUTES = [
|
|
|
2600
2642
|
params: [{ name: 'id', description: 'The robot\'s uuid; an end user reaches it through an app that attaches it.' }],
|
|
2601
2643
|
query: jobRunQuery, request: null, response: jobRunListResponse,
|
|
2602
2644
|
errors: [...CLIENT_GUARD, 'invalid_uuid', 'not_found', 'capability_required', 'validation_error'], transport: 'http',
|
|
2603
|
-
notes: 'Needs the `
|
|
2645
|
+
notes: 'Needs the `job_history` capability, and **this route is what makes that switch mean something** — it was unkeepable while nothing ' +
|
|
2604
2646
|
'durable recorded what had run. Two residuals worth stating rather than implying away. `history` is a syntactically valid slug, and ' +
|
|
2605
2647
|
'a static segment matches before a parameter, so a robot with a service literally slugged `history` can no longer be **read** through ' +
|
|
2606
2648
|
'`GET /api/robots/:id/jobs/:slug`; invoking, cancelling and the listing are unaffected. And a run row names its actor by email address, ' +
|
|
@@ -2620,7 +2662,7 @@ export const ROUTES = [
|
|
|
2620
2662
|
...CLIENT_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'parameter_invalid',
|
|
2621
2663
|
'robot_offline', 'busy', 'bridge_timeout', 'internal_error',
|
|
2622
2664
|
], transport: 'http',
|
|
2623
|
-
notes: '**One route for both kinds**, because a path segment naming the kind would demand a fact
|
|
2665
|
+
notes: '**One route for both kinds**, because a path segment naming the kind would demand a fact the rights model does not carry. An action answers ' +
|
|
2624
2666
|
'`202` with an `invokeResponse` the moment the job exists; a service answers `200` with a `serviceCallResponse` once the result is in — ' +
|
|
2625
2667
|
'two shapes, carried by one union (`invokeOrServiceResponse`) and told apart by whether `kind` or a bare `result` arrives. Parameters are checked **before** anything about the world (offline, busy): ' +
|
|
2626
2668
|
'the same request must get the same verdict whether or not the robot happens to be reachable, or a developer testing against an offline ' +
|
|
@@ -3301,7 +3343,7 @@ export const ROUTES = [
|
|
|
3301
3343
|
},
|
|
3302
3344
|
{
|
|
3303
3345
|
method: 'GET', path: '/realtime', section: 'transports',
|
|
3304
|
-
summary: 'The client WebSocket: subscriptions on datapoints
|
|
3346
|
+
summary: 'The client WebSocket: subscriptions on datapoints (the built-in bridge state included), jobs and cameras, plus full command parity with REST.',
|
|
3305
3347
|
audience: 'client', auth: 'none', rateLimited: false, ownerTier: false, status: 101,
|
|
3306
3348
|
params: [], query: null, request: null, response: null, errors: ['invalid_token', 'rate_limited'], transport: 'websocket',
|
|
3307
3349
|
notes: 'Authentication happens in the first frame, not on the upgrade. The frame types are the `realtime` schemas.',
|