@fleetless/contracts 5.0.0-next.2 → 5.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 CHANGED
@@ -9,6 +9,8 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [5.0.0] — 2026-09-30
13
+
12
14
  ### Added
13
15
 
14
16
  - **Protocol 5: `unknown` jobs, external goals, and a hard cut of protocols 3
@@ -40,6 +42,9 @@ version.
40
42
  caller is refused, not told the cancel succeeded. `reportedJobState`, every
41
43
  state but `unknown`, is what `job_update`, `job_status` entries and
42
44
  `hello.active_jobs` accept, so a bridge claiming `unknown` fails validation.
45
+ `POST /api/robots/:id/jobs/:slug/cancel` lists the answers this adds:
46
+ `409 cancel_rejected`, `504 bridge_timeout`, and `502` with the bridge's
47
+ own code (`unknown_slug`, `action_server_lost`, `internal_error`).
43
48
 
44
49
  ### Removed
45
50
 
@@ -7003,7 +7003,7 @@
7003
7003
  }
7004
7004
  },
7005
7005
  "default": {
7006
- "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `forbidden`, `invalid_uuid`, `not_found`, `validation_error`, `not_cancellable`, `robot_offline`.",
7006
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `forbidden`, `invalid_uuid`, `not_found`, `validation_error`, `not_cancellable`, `robot_offline`, `cancel_rejected`, `bridge_timeout`, `unknown_slug`, `action_server_lost`, `internal_error`.",
7007
7007
  "content": {
7008
7008
  "application/json": {
7009
7009
  "schema": {
@@ -7013,7 +7013,7 @@
7013
7013
  }
7014
7014
  }
7015
7015
  },
7016
- "description": "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` — the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`.",
7016
+ "description": "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` — the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`. The answer waits for the bridge's `cancel_result`: a `200` means the action server accepted the cancel request, not that the goal has ended — the job's end arrives as its own update. Any goal answered `ERROR_REJECTED` makes it `409 cancel_rejected`, with every goal and its `return_code` in `details.goals`; no answer within `JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge's own code (`unknown_slug`, `action_server_lost`, `internal_error`).",
7017
7017
  "requestBody": {
7018
7018
  "required": false,
7019
7019
  "content": {
@@ -4147,10 +4147,15 @@
4147
4147
  "not_found",
4148
4148
  "validation_error",
4149
4149
  "not_cancellable",
4150
- "robot_offline"
4150
+ "robot_offline",
4151
+ "cancel_rejected",
4152
+ "bridge_timeout",
4153
+ "unknown_slug",
4154
+ "action_server_lost",
4155
+ "internal_error"
4151
4156
  ],
4152
4157
  "transport": "http",
4153
- "notes": "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` — the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`."
4158
+ "notes": "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` — the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`. The answer waits for the bridge's `cancel_result`: a `200` means the action server accepted the cancel request, not that the goal has ended — the job's end arrives as its own update. Any goal answered `ERROR_REJECTED` makes it `409 cancel_rejected`, with every goal and its `return_code` in `details.goals`; no answer within `JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge's own code (`unknown_slug`, `action_server_lost`, `internal_error`)."
4154
4159
  },
4155
4160
  {
4156
4161
  "method": "POST",
package/dist/routes.js CHANGED
@@ -2112,12 +2112,19 @@ export const ROUTES = [
2112
2112
  { name: 'slug', description: 'The action slug from the published configuration; a service slug is refused.' },
2113
2113
  ],
2114
2114
  query: null, request: cancelRequest, requestOptional: true, response: jobResponse,
2115
- errors: [...CLIENT_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'not_cancellable', 'robot_offline'], transport: 'http',
2115
+ errors: [
2116
+ ...CLIENT_GUARD, 'invalid_uuid', 'not_found', 'validation_error', 'not_cancellable', 'robot_offline',
2117
+ 'cancel_rejected', 'bridge_timeout', 'unknown_slug', 'action_server_lost', 'internal_error',
2118
+ ], transport: 'http',
2116
2119
  notes: 'The body is optional: a bodyless `POST` was every caller\'s shape before `job_id` existed, and absent or `job_id: null` both mean ' +
2117
2120
  '"cancel whatever is running". A named `job_id` that is **not** what is running cancels nothing and answers `404` — the caller named an ' +
2118
2121
  'id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job ' +
2119
2122
  'also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call ' +
2120
- 'has no goal to cancel. Nothing running is a `200` with `job: null`.',
2123
+ 'has no goal to cancel. Nothing running is a `200` with `job: null`. The answer waits for the bridge\'s `cancel_result`: a `200` means ' +
2124
+ 'the action server accepted the cancel request, not that the goal has ended — the job\'s end arrives as its own update. Any goal ' +
2125
+ 'answered `ERROR_REJECTED` makes it `409 cancel_rejected`, with every goal and its `return_code` in `details.goals`; no answer within ' +
2126
+ '`JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge\'s own ' +
2127
+ 'code (`unknown_slug`, `action_server_lost`, `internal_error`).',
2121
2128
  },
2122
2129
  {
2123
2130
  method: 'POST', path: '/api/robots/:id/publishers/:slug', section: 'commands',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetless/contracts",
3
- "version": "5.0.0-next.2",
3
+ "version": "5.0.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",