@fleetless/contracts 5.1.0 → 5.3.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/routes.js CHANGED
@@ -1,8 +1,9 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- import { appListResponse, appDeletionSummary, createAppRequest, createServerKeyResponse, app as appSchema, role, roleListResponse, rolePermissions, serverKeyListResponse, updateAppRequest, } from './apps.js';
2
+ import { appListResponse, appDeletionSummary, createAppRequest, createServerKeyResponse, app as appSchema, role, roleListResponse, roleDeleteQuery, rolePermissions, roleRenameRequest, 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';
6
+ import { feedbackRequest, feedbackResponse } from './feedback.js';
6
7
  import { CLIENT_OIDC_CALLBACK_PATH, clientAcceptInvitationRequest, clientIdentity, clientLoginRequest, clientLogoutRequest, clientMcpInteraction, clientMcpInteractionDecisionResponse, clientOidcCallbackQuery, clientOidcExchangeRequest, clientOidcStartQuery, clientPasswordResetConfirmRequest, clientPasswordResetRequest, clientProviderListQuery, clientProviderListResponse, clientRefreshRequest, clientRegisterRequest, clientResendVerificationRequest, clientVerifyEmailRequest, mcpConsentGrantListResponse, } from './client-auth.js';
7
8
  import { clientRobotListResponse } from './client-robots.js';
8
9
  import { appAuthConfig, appInvitation, appInvitationListResponse, appMailTemplate, appMailTemplateListResponse, appOidcProvider, appOidcProviderListResponse, appUser, appUserListResponse, createAppInvitationRequest, createAppOidcProviderRequest, createAppUserRequest, mailOutcome, mailTemplatePreviewRequest, mailTemplatePreviewResponse, patchAppOidcProviderRequest, patchAppUserRequest, putAppAuthMcpRequest, putAppAuthRegistrationRequest, putAppAuthUrlsRequest, putAppMailTemplateRequest, } from './app-users.js';
@@ -328,7 +329,7 @@ export const ROUTES = [
328
329
  params: [{ name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' }],
329
330
  query: null, request: null, response: role,
330
331
  errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error'], transport: 'http',
331
- notes: 'The body is `{ "name": string }` — non-empty, trimmed, at most 120 characters — and is deliberately not a contract shape: contracts ' +
332
+ 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 ' +
332
333
  'define the `role` this answers with, not this one trivial request. **The answer is a bare `role`, not an envelope**, unlike the ' +
333
334
  'listing beside it.',
334
335
  },
@@ -381,6 +382,33 @@ export const ROUTES = [
381
382
  'offered and consults nothing about any user\'s actual MCP entitlement. A robot the role grants nothing on still appears, with an empty ' +
382
383
  '`exposures` — dropping it would read as "not attached", which is a different fact.',
383
384
  },
385
+ {
386
+ method: 'PATCH', path: '/api/apps/:id/roles/:roleId', section: 'apps',
387
+ summary: 'Renames a role; its users keep it.',
388
+ audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 200,
389
+ params: [
390
+ { name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
391
+ { name: 'roleId', description: 'The role\'s uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.' },
392
+ ],
393
+ query: null, request: roleRenameRequest, response: role,
394
+ errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'role_name_taken'], transport: 'http',
395
+ notes: 'Names are unique per app, compared exactly as stored after trimming. Built-in roles can be renamed.',
396
+ },
397
+ {
398
+ method: 'DELETE', path: '/api/apps/:id/roles/:roleId', section: 'apps',
399
+ summary: 'Deletes a role, moving its users, pending invitations and default-role status to another role.',
400
+ audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: false, status: 204,
401
+ params: [
402
+ { name: 'id', description: 'The app\'s uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`.' },
403
+ { name: 'roleId', description: 'The role\'s uuid, from `GET /api/apps/:id/roles`; a role of another app answers `404`.' },
404
+ ],
405
+ query: roleDeleteQuery, request: null, response: null,
406
+ errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'role_in_use', 'last_role'], transport: 'http',
407
+ notes: 'Without `move_to`, a role that app users or pending invitations hold, or that is the app\'s default, answers ' +
408
+ '`409 role_in_use` with `{ users, invitations, is_default }`. With `move_to` — another role of the same app, else ' +
409
+ '`400 validation_error` — one transaction moves `app_users.role_id`, pending invitations and `default_role_id`, then deletes ' +
410
+ 'the role and its permissions. The app\'s only role answers `409 last_role`. Built-in roles can be deleted like any other.',
411
+ },
384
412
  {
385
413
  method: 'POST', path: '/api/apps/:id/server-keys', section: 'apps',
386
414
  summary: 'Mints a server key for the app and returns the raw secret once.',
@@ -2417,6 +2445,16 @@ export const ROUTES = [
2417
2445
  'platform will answer is owed a refusal, not a shorter answer they will mistake for the whole picture. `from_day <= to_day` is a ' +
2418
2446
  'cross-field rule no JSON Schema can express and is enforced here. The window is echoed back.',
2419
2447
  },
2448
+ {
2449
+ method: 'POST', path: '/api/feedback', section: 'org',
2450
+ summary: 'Sends a message from a developer to the people who build Fleetless.',
2451
+ audience: 'developer', auth: 'developer', rateLimited: true, ownerTier: false, status: 202,
2452
+ params: [], query: null, request: feedbackRequest, response: feedbackResponse,
2453
+ errors: [...DEVELOPER_GUARD, 'validation_error', 'rate_limited'], transport: 'http',
2454
+ notes: 'The message is stored before any mail is tried, so `202` means it is kept whatever `mail` says: `sent`, `failed`, or ' +
2455
+ '`not_configured` when this cloud has no feedback address. At most 10 messages per developer per hour; the 11th answers ' +
2456
+ '`429 rate_limited` with `retry_after_ms`. Replies come by mail, to the sender\'s address.',
2457
+ },
2420
2458
  /* ------------------------------------------------- assets (robot upload) */
2421
2459
  {
2422
2460
  method: 'POST', path: '/api/bridge/assets', section: 'assets',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetless/contracts",
3
- "version": "5.1.0",
3
+ "version": "5.3.0-next.1",
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",