@fleetless/contracts 6.4.0-next.1 → 6.4.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/dist/routes.js CHANGED
@@ -12,9 +12,6 @@ import { jobRunListResponse, jobRunQuery, jobRunSummary, jobRunSummaryQuery } fr
12
12
  import { MCP_APP_PATHS, mcpRobotDatasheet, mcpRolePreviewResponse } from './mcp.js';
13
13
  import { authorizationServerMetadata, dynamicClientRegistrationRequest, dynamicClientRegistrationResponse, oauthAuthorizeQuery, oauthRedirectResponse, oauthTokenRequest, oauthTokenResponse, protectedResourceMetadata, } from './oauth.js';
14
14
  import { adminPlanChangeRequest, orgPlan, planChangeRequest } from './plans.js';
15
- import { OPERATOR_ROLES } from './operator.js';
16
- import { noopCommandRequest, noopCommandResponse } from './operator-commands.js';
17
- import { adminSearchQuery, adminSearchResponse, adminOrgDetail } from './admin.js';
18
15
  import { billingCancelRequest, billingChangeRequest, billingChangeResponse, billingDetailsUpdate, billingView, checkoutRequest, checkoutResponse, checkoutStatus, paymentMethodChangeRequest, vatIdCheckRequest, vatIdCheckResponse, } from './billing.js';
19
16
  import { cameraListResponse, cancelRequest, configDraftResponse, configVersionResponse, configVersionsResponse, createRobotRequest, createRobotResponse, datapointListResponse, datapointValue, exposureListResponse, fetchTypesRequest, fetchTypesResponse, historyQuery, historyResponse, introspectionResponse, invokeOrServiceResponse, invokeRequest, jobResponse, liveSessionResponse, orgHealthQuery, orgLatencyQuery, orgLatencyResponse, orgQuotaUsage, orgUsageQuery, orgUsageResponse, patchRobotRequest, patchRobotResponse, publishConfigResponse, publishRequest, putConfigDraftRequest, putRobotDetailsRequest, putRobotDetailsResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, releaseLiveQuery, renameSlugRequest, renameSlugResponse, robotDeleteQuery, resourceHealthListResponse, robotDeletionSummary, robotDetailResponse, robotJobsResponse, robotListResponse, slugUsageResponse, snapshotMetaResponse, typesResponse, } from './rest.js';
20
17
  export const ROUTE_SECTIONS = [
@@ -2869,65 +2866,6 @@ export const ROUTES = [
2869
2866
  'owns them from then on. The plan itself keeps working on a billed org — a plan, an add-on or an override the operator sets here is ' +
2870
2867
  'charged from the next renewal, except `enterprise` and `basic`, which the sweep cancels the billing account for instead.',
2871
2868
  },
2872
- /* --- operator admin API (fleetless/fleetless#268) -----------------------
2873
- *
2874
- * Every route below is `audience: 'internal'`, `section: 'org'` and
2875
- * reachable only on the cloud's private admin listener, behind the
2876
- * operator gate: with it off, each answers exactly what an unregistered
2877
- * path answers, even for a perfectly valid assertion.
2878
- */
2879
- {
2880
- method: 'POST', path: '/api/admin/commands/noop', section: 'org',
2881
- summary: 'Runs the no-op command: proves the preview-reason-execute protocol without changing anything.',
2882
- audience: 'internal', auth: 'operator', rateLimited: true, ownerTier: false, status: 200,
2883
- operator: { roles: OPERATOR_ROLES, confirmation: 'click' },
2884
- params: [], query: null, request: noopCommandRequest, response: noopCommandResponse,
2885
- errors: ['unauthorized', 'forbidden', 'not_found', 'validation_error', 'preview_stale', 'idempotency_key_reused', 'rate_limited'],
2886
- transport: 'http',
2887
- notes: 'Reachable only where the cloud enables it (`OPERATOR_NOOP_COMMAND=true`; refused in production). Proves the command path end to ' +
2888
- 'end without a real effect: a preview always answers one `keeps` effect, and an execute writes the operator audit plus an ' +
2889
- '`operator.noop` row in the named org\'s audit, and nothing else. Every public host, and the private address while the operator ' +
2890
- 'API is not enabled, answers `404 not_found` for this path like any other unregistered one. A role the route does not list is ' +
2891
- 'refused with `403 forbidden`: a command says no where a read stays silent.',
2892
- },
2893
- {
2894
- method: 'GET', path: '/api/admin/search', section: 'org',
2895
- summary: 'Finds an org, person, invoice, payment or robot by a literal, case-insensitive match.',
2896
- audience: 'internal', auth: 'operator', rateLimited: true, ownerTier: false, status: 200,
2897
- operator: { roles: OPERATOR_ROLES },
2898
- params: [], query: adminSearchQuery, request: null, response: adminSearchResponse,
2899
- errors: ['unauthorized', 'not_found', 'validation_error', 'rate_limited'], transport: 'http',
2900
- notes: '`q` is matched literally — `%`, `_` and `\\` carry no wildcard meaning — never as an `ILIKE` pattern, so a two-character query ' +
2901
- 'never dumps a table. At most `ADMIN_SEARCH_LIMIT` hits come back; `truncated` says whether more exist. A hit kind the caller\'s ' +
2902
- 'role may not see is left out rather than refused: `operator-support` gets no `invoice` or `payment` hits. Every public host, and ' +
2903
- 'the private address while the operator API is not enabled, answers `404 not_found` for this path. A role the route does not ' +
2904
- 'list gets that same `404 not_found`, so a read never reveals that it exists.',
2905
- },
2906
- {
2907
- method: 'GET', path: '/api/admin/orgs/:id', section: 'org',
2908
- summary: "Reads an org's detail as the operator: its owner, plan, billing state and counts.",
2909
- audience: 'internal', auth: 'operator', rateLimited: true, ownerTier: false, status: 200,
2910
- operator: { roles: OPERATOR_ROLES },
2911
- params: [{ name: 'id', description: "The org's uuid, whose detail the operator is reading." }],
2912
- query: null, request: null, response: adminOrgDetail,
2913
- errors: ['unauthorized', 'not_found', 'rate_limited'], transport: 'http',
2914
- notes: '`billing` carries the account\'s state and next charge only — never the payer, address or payment method. An unknown `:id` is ' +
2915
- '`404 not_found`, the same every public host and the private address answer for this path while the operator API is not ' +
2916
- 'enabled. A role the route does not list gets that same `404 not_found`, so a read never reveals that it exists.',
2917
- },
2918
- {
2919
- method: 'GET', path: '/api/admin/orgs/:id/usage', section: 'org',
2920
- summary: "Reads what an org consumed per day, per app and per metric, as the operator.",
2921
- audience: 'internal', auth: 'operator', rateLimited: true, ownerTier: false, status: 200,
2922
- operator: { roles: OPERATOR_ROLES },
2923
- params: [{ name: 'id', description: "The org's uuid, whose usage the operator is reading." }],
2924
- query: orgUsageQuery, request: null, response: orgUsageResponse,
2925
- errors: ['unauthorized', 'not_found', 'validation_error', 'rate_limited'], transport: 'http',
2926
- notes: "Identical to `GET /api/org/usage` for the named org: the same window rule, the same `from_day <= to_day` cross-field check, and " +
2927
- 'the same echoed window. An unknown `:id` is `404 not_found`, the same every public host and the private address answer for ' +
2928
- 'this path while the operator API is not enabled. A role the route does not list gets that same `404 not_found`, so a read ' +
2929
- 'never reveals that it exists.',
2930
- },
2931
2869
  /* --- billing (2026-10-04, fleetless/fleetless#104) ----------------------
2932
2870
  *
2933
2871
  * Every route here but the webhook is owner-only (`ownerTier: true`), a
@@ -3136,16 +3074,3 @@ export const ROUTES = [
3136
3074
  notes: 'Authentication happens in the first frame, not on the upgrade. The frame types are the `realtime` schemas.',
3137
3075
  },
3138
3076
  ];
3139
- /** Every `auth: 'operator'` route, keyed `METHOD path`, for `operatorAccess`. */
3140
- const OPERATOR_ACCESS = new Map(ROUTES.filter((r) => r.auth === 'operator').map((r) => [`${r.method} ${r.path}`, r.operator]));
3141
- /**
3142
- * The roles (and, for a command, the confirmation level) a caller of this
3143
- * operator route needs, looked up by method and path (fleetless/fleetless#268).
3144
- * Throws for a route that is not `auth: 'operator'`.
3145
- */
3146
- export function operatorAccess(method, path) {
3147
- const access = OPERATOR_ACCESS.get(`${method} ${path}`);
3148
- if (!access)
3149
- throw new Error(`${method} ${path} is not an operator route`);
3150
- return access;
3151
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetless/contracts",
3
- "version": "6.4.0-next.1",
3
+ "version": "6.4.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",