@deepdockai/cli 1.4.0 → 1.5.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 +16 -5
- package/README.md +9 -9
- package/dist/deepdock.js +11 -10
- package/package.json +11 -2
- package/skill/references/calling-actions.md +5 -5
- package/skill/references/cli.md +1 -1
- package/skill/references/clients/deepdock.py +2 -2
- package/skill/references/clients/deepdock.ts +7 -3
- package/skill/references/concepts.md +8 -3
- package/skill/references/discovery.md +4 -2
- package/skill/references/errors.md +9 -5
- package/skill/references/clients/__pycache__/deepdock.cpython-312.pyc +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
- The current device API: in `GET /v1/devices/{deviceId}/systems` an action is `active`, `paused` or `blocked`, and a blocked one carries a `reason` (`client_update`, `access_missing`, `access_not_set_up`, `access_reapproval`). The list now holds every action of yours on that system, blocked ones included. A system there no longer carries `lockedActions` (the device list still does), and the action index's `availability` value is `blocked_pending_access` (was `locked_pending_access`). The bundled TypeScript client and the skill describe the new states.
|
|
6
|
+
- `deepdock devices systems` counts blocked actions next to paused ones.
|
|
7
|
+
- The error code list gains `device_timeout` (exit 3, retry with the same key) and `too_many_rows` (exit 2: the write matched more records than it may change and was rolled back).
|
|
8
|
+
|
|
9
|
+
## 1.4.1
|
|
10
|
+
|
|
11
|
+
- The package no longer ships Python bytecode from the bundled client.
|
|
12
|
+
- The docs and the bundled clients use neutral example names. No command, field or error code changed.
|
|
13
|
+
|
|
3
14
|
## 1.4.0
|
|
4
15
|
|
|
5
|
-
-
|
|
16
|
+
- The current device API: the error code `system_version_unverified` and the error fields `version` and `reason` are gone, and a system's `writes` state in `GET /v1/devices/{deviceId}` is replaced by `blockedActions` (the actions this device's client cannot run yet; each answers `device_outdated` until the client updates). An action whose system runs a program version Deepdock has not yet approved for it answers the new `409 version_not_covered` (CLI exit 2): nothing ran, retrying gets the same answer, and it works once Deepdock approves that version or the customer runs an approved one. The bundled TypeScript and Python clients, the skill's error reference and the device types follow. This needs the API from the Deepdock release that carries these changes.
|
|
6
17
|
- `deepdock devices` and `deepdock incidents list` read the organisation's lists as `{ "data": [...], "nextCursor": ... }`, the form `/v1` already uses (was `{ "data": { "items": [...], "nextCursor": ... } }`). They need the API from the next Deepdock release; an older API answers the old form, which this version does not read.
|
|
7
18
|
- The CLI follows the API's British spelling and its renamed code: `GET /partner/organisations` (was `/partner/orgs`), the error code `organisation_required` (was `organization_required`) and `cli_outdated` (was `client_outdated`, still exit 4). The bundled device types and the skill's error reference include them. These need the API from the next Deepdock release.
|
|
8
19
|
- The command group `org` is now `orgs` (`deepdock orgs list`, `deepdock orgs select`); the old name is gone, with no alias.
|
|
@@ -53,7 +64,7 @@
|
|
|
53
64
|
|
|
54
65
|
## 1.0.25
|
|
55
66
|
|
|
56
|
-
- Three new error codes for writes over a customer system's own HTTP interface: `applied_unverified` (409, exit 2: the write landed but its read-back did not finish; `error.created` names the entry as `{ chartId }`, or null), `credentials_rejected` and `certificate_changed` (503, exit 3: a person at the
|
|
67
|
+
- Three new error codes for writes over a customer system's own HTTP interface: `applied_unverified` (409, exit 2: the write landed but its read-back did not finish; `error.created` names the entry as `{ chartId }`, or null), `credentials_rejected` and `certificate_changed` (503, exit 3: a person at the customer renews the login or confirms the certificate in the Deepdock client). An earlier CLI already exits with the same codes through its status fallback.
|
|
57
68
|
- `system_version_unverified` can carry `error.reason: unreported` with `error.version: null`, and a system's `writes` can read `unverified` with reason `unreported`: such a write is verified for one exact release, and the system reported none.
|
|
58
69
|
- `error.uncertain` is documented on `outcome_unknown`. The skill's error reference describes all of it.
|
|
59
70
|
|
|
@@ -77,7 +88,7 @@
|
|
|
77
88
|
## 1.0.20
|
|
78
89
|
|
|
79
90
|
- `409 check_failed` is renamed `409 readback_failed`, and a paused action's `reason` reads `readback_failed` instead of `check_failed`: Deepdock read the written record back, it did not match, so nothing was saved and the action is paused. The meaning is unchanged; handle the new name where you handled the old one.
|
|
80
|
-
- `unknown_author`, `unknown_provider` and `
|
|
91
|
+
- `unknown_author`, `unknown_provider` and `no_matching_period` leave the fixed list of error codes. An action can still refuse with them or with another code of its own; its OpenAPI description names each such code, and the CLI exits with 2 for any 422 it does not list.
|
|
81
92
|
|
|
82
93
|
## 1.0.19
|
|
83
94
|
|
|
@@ -85,7 +96,7 @@
|
|
|
85
96
|
|
|
86
97
|
## 1.0.18
|
|
87
98
|
|
|
88
|
-
- A read or write on a record the customer's system restricts (for example a locked
|
|
99
|
+
- A read or write on a record the customer's system restricts (for example a locked record) answers `422 record_restricted`: a read returns no data instead of an empty answer, and a write writes nothing. The skill's error reference lists it, and the CLI exits with 2 for it.
|
|
89
100
|
|
|
90
101
|
## 1.0.17
|
|
91
102
|
|
|
@@ -105,7 +116,7 @@
|
|
|
105
116
|
|
|
106
117
|
## 1.0.13
|
|
107
118
|
|
|
108
|
-
- A device carries `lastKnownAt`: the time of its last report while it is not connected, `null` while it is connected. Every system of a device carries `lockedActions`: the actions the device reports locked because its database account lacks a right they need, under
|
|
119
|
+
- A device carries `lastKnownAt`: the time of its last report while it is not connected, `null` while it is connected. Every system of a device carries `lockedActions`: the actions the device reports locked because its database account lacks a right they need, under its current action set, or `null` when there is no verdict or the verdict is for an older action set. Both are in the device list and, for `lockedActions`, in `GET /v1/devices/{deviceId}/systems`. The agent skill's TypeScript client types them, and its concepts reference explains them.
|
|
109
120
|
|
|
110
121
|
## 1.0.12
|
|
111
122
|
|
package/README.md
CHANGED
|
@@ -154,14 +154,14 @@ your code will receive; `auth`, `orgs select` and `keys create` build it from na
|
|
|
154
154
|
failure is one document on stderr, `{ "error": { "code", "message" }, "meta": { "hint" } }`,
|
|
155
155
|
with the API's error object unchanged. Switch on `code` or on the exit code, never on `message`.
|
|
156
156
|
|
|
157
|
-
| Exit | Meaning
|
|
158
|
-
| ---- |
|
|
159
|
-
| 0 | done
|
|
160
|
-
| 1 | something on the command line to fix (`invalid_usage`, `org_required`)
|
|
161
|
-
| 2 | the API refused the request; do not repeat it unchanged (`invalid_request`, `not_found`, `forbidden`, `rate_limited` and the other refusals)
|
|
162
|
-
| 3 | retry later (`device_offline`, `device_syncing`, `device_outdated`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost`) |
|
|
163
|
-
| 4 | the CLI is too old for the API (`cli_outdated`): run `npx @deepdockai/cli@latest`
|
|
164
|
-
| 5 | sign-in needed (`sign_in_needed`, `approval_denied`, `approval_expired`); `auth status` when nobody is signed in
|
|
157
|
+
| Exit | Meaning |
|
|
158
|
+
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
159
|
+
| 0 | done |
|
|
160
|
+
| 1 | something on the command line to fix (`invalid_usage`, `org_required`) |
|
|
161
|
+
| 2 | the API refused the request; do not repeat it unchanged (`invalid_request`, `not_found`, `forbidden`, `rate_limited` and the other refusals) |
|
|
162
|
+
| 3 | retry later (`device_offline`, `device_timeout`, `device_syncing`, `device_outdated`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost`) |
|
|
163
|
+
| 4 | the CLI is too old for the API (`cli_outdated`): run `npx @deepdockai/cli@latest` |
|
|
164
|
+
| 5 | sign-in needed (`sign_in_needed`, `approval_denied`, `approval_expired`); `auth status` when nobody is signed in |
|
|
165
165
|
|
|
166
166
|
The CLI never retries on its own: exit 3 says retry, you decide when. `deepdock commands --json`
|
|
167
167
|
prints the whole command tree.
|
|
@@ -265,7 +265,7 @@ another's; only the CLI's own settings move (`DEEPDOCK_CONFIG_DIR`), nothing els
|
|
|
265
265
|
|
|
266
266
|
```bash
|
|
267
267
|
bun run dev -- auth status # the production API
|
|
268
|
-
DEEPDOCK_BASE_URL=http://localhost:
|
|
268
|
+
DEEPDOCK_BASE_URL=http://localhost:3000 bun run dev -- auth login --no-wait
|
|
269
269
|
```
|
|
270
270
|
|
|
271
271
|
The script does not depend on the current directory: from elsewhere, call it by its path
|
package/dist/deepdock.js
CHANGED
|
@@ -10874,9 +10874,11 @@ var EXIT_CODES = {
|
|
|
10874
10874
|
record_locked: 2,
|
|
10875
10875
|
record_not_editable: 2,
|
|
10876
10876
|
record_restricted: 2,
|
|
10877
|
+
too_many_rows: 2,
|
|
10877
10878
|
payload_too_large: 2,
|
|
10878
10879
|
version_not_covered: 2,
|
|
10879
10880
|
device_offline: 3,
|
|
10881
|
+
device_timeout: 3,
|
|
10880
10882
|
device_syncing: 3,
|
|
10881
10883
|
device_outdated: 3,
|
|
10882
10884
|
action_paused: 3,
|
|
@@ -11441,7 +11443,7 @@ import { spawn } from "node:child_process";
|
|
|
11441
11443
|
import { homedir, hostname } from "node:os";
|
|
11442
11444
|
|
|
11443
11445
|
// src/version.ts
|
|
11444
|
-
var VERSION = "1.
|
|
11446
|
+
var VERSION = "1.5.0";
|
|
11445
11447
|
|
|
11446
11448
|
// src/runtime.ts
|
|
11447
11449
|
var DEFAULT_BASE_URL = "https://api.deepdock.ai";
|
|
@@ -12170,7 +12172,7 @@ var EXIT_CODES_HELP = `Exit codes
|
|
|
12170
12172
|
0 done
|
|
12171
12173
|
1 usage: something on the command line to fix (invalid_usage, org_required)
|
|
12172
12174
|
2 the API refused the request; do not repeat it unchanged
|
|
12173
|
-
3 retry later (device_offline, device_syncing, device_outdated,
|
|
12175
|
+
3 retry later (device_offline, device_timeout, device_syncing, device_outdated,
|
|
12174
12176
|
action_paused, access_outdated, access_missing,
|
|
12175
12177
|
credentials_rejected, certificate_changed,
|
|
12176
12178
|
system_unavailable, target_busy, temporarily_unavailable, internal_error,
|
|
@@ -12977,14 +12979,13 @@ var renderSystems = (ctx, data) => {
|
|
|
12977
12979
|
if (text === "")
|
|
12978
12980
|
return "The device reports no systems.";
|
|
12979
12981
|
const paused = countValue(data, "paused");
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
"
|
|
12986
|
-
|
|
12987
|
-
].join(`
|
|
12982
|
+
const blocked = countValue(data, "blocked");
|
|
12983
|
+
const lines = [text];
|
|
12984
|
+
if (paused > 0)
|
|
12985
|
+
lines.push(paused === 1 ? "One action is paused." : `${paused} actions are paused.`, "Only Deepdock resumes it; `deepdock incidents list` shows the incident.", "Your code gets 503 action_paused from it until then.");
|
|
12986
|
+
if (blocked > 0)
|
|
12987
|
+
lines.push(blocked === 1 ? "One action is blocked." : `${blocked} actions are blocked.`, "Its reason says what unblocks it: a client update or the customer setting up the access.");
|
|
12988
|
+
return lines.join(`
|
|
12988
12989
|
`);
|
|
12989
12990
|
};
|
|
12990
12991
|
var systemsOf = async (ctx, id) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepdockai/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Deepdock partner CLI: pair devices, see systems and actions, create the API key your code runs them with.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,16 @@
|
|
|
13
13
|
"bin": {
|
|
14
14
|
"deepdock": "dist/deepdock.js"
|
|
15
15
|
},
|
|
16
|
-
"files": [
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/deepdock.js",
|
|
18
|
+
"skill",
|
|
19
|
+
"!**/__pycache__",
|
|
20
|
+
"!**/*.pyc",
|
|
21
|
+
"README.md",
|
|
22
|
+
"CHANGELOG.md",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"SECURITY.md"
|
|
25
|
+
],
|
|
17
26
|
"engines": {
|
|
18
27
|
"node": ">=22.13"
|
|
19
28
|
},
|
|
@@ -12,12 +12,12 @@ answers `405 invalid_request` with `Allow` naming the action's one method, so a
|
|
|
12
12
|
is refused, not run.
|
|
13
13
|
|
|
14
14
|
Inputs are typed as the action's schema declares them and are never sent as text when they are not:
|
|
15
|
-
an integer is a JSON number (`"
|
|
15
|
+
an integer is a JSON number (`"customerId": 4711`, not `"4711"`; the text form is refused with
|
|
16
16
|
`422 invalid_input`). Text is normalised to Unicode NFC before anything else happens; a composed
|
|
17
17
|
and a decomposed spelling are the same value.
|
|
18
18
|
|
|
19
19
|
**Never put an input in the URL.** A value in a URL reaches request logs, proxies and browser
|
|
20
|
-
history, which is where a
|
|
20
|
+
history, which is where a customer's name or id must not end up. Any query string on an action
|
|
21
21
|
path, whatever it holds, answers `400 invalid_request` ("inputs go in the JSON body, not in the
|
|
22
22
|
URL") without repeating a name or a value. Because the body is JSON, a `+` or a non-ASCII letter
|
|
23
23
|
needs no escaping.
|
|
@@ -41,7 +41,7 @@ curl -X POST "$BASE/v1/devices/$DEVICE/systems/example-erp/actions/searchCustome
|
|
|
41
41
|
|
|
42
42
|
- A read with `cardinality: many` answers `data` as an array; `nextCursor` is a sibling of `data`
|
|
43
43
|
(present only on a read that can page). A read with `cardinality: one` (for example
|
|
44
|
-
`
|
|
44
|
+
`readCustomer`) answers `data` as the record itself, `{ "data": { "customerId": 1001, ... } }`, and
|
|
45
45
|
answers `404 not_found` when no record matches.
|
|
46
46
|
- Pass `nextCursor` back as `cursor` unchanged while it is not `null`, and stop only on `null`,
|
|
47
47
|
never on a short page: a page of long entries (notes) ends before `limit` rows to keep the
|
|
@@ -75,7 +75,7 @@ curl -X POST "$BASE/v1/devices/$DEVICE/systems/example-erp/actions/downloadDocum
|
|
|
75
75
|
- Once the bytes flow, a failure can only end the body early: compare the bytes received with
|
|
76
76
|
`Content-Length` and treat a short body as a failed download, never as the file. Run it again.
|
|
77
77
|
- The file name is already safe to save on Windows, macOS and Linux, but it is the customer's data
|
|
78
|
-
(a document title can name a
|
|
78
|
+
(a document title can name a person): store and show it like any other record value.
|
|
79
79
|
- The bundled clients do all of this in `download` (TypeScript: `{ bytes, contentType, filename }`;
|
|
80
80
|
Python: `Download(content, content_type, filename)`), and throw `DeepdockTransportError` for a
|
|
81
81
|
short body. A large file can take longer than 35 seconds to transfer, so their timeout bounds the
|
|
@@ -115,7 +115,7 @@ of a customer, the note id of an update. The pattern is always the same:
|
|
|
115
115
|
customer search).
|
|
116
116
|
2. Pass its id back in the type the write's schema declares, usually the integer the read returned.
|
|
117
117
|
3. Handle the action-specific refusal the description names: for example `422 unknown_author` when
|
|
118
|
-
the user is not one the system lists, or `422
|
|
118
|
+
the user is not one the system lists, or `422 no_matching_period` when the customer has no open period and
|
|
119
119
|
the action does not open one. Both mean nothing was written; fix the reference, do not retry
|
|
120
120
|
blindly.
|
|
121
121
|
|
package/skill/references/cli.md
CHANGED
|
@@ -84,7 +84,7 @@ A failure is one document on stderr: the API's error object unchanged plus what
|
|
|
84
84
|
| 0 | done | |
|
|
85
85
|
| 1 | something on the command line to fix | `invalid_usage` (a bad flag, an unknown slug, a question with no terminal and no `--yes`, an env file git does not ignore), `org_required` |
|
|
86
86
|
| 2 | the API refused the request; do not repeat it unchanged | `invalid_request`, `not_found`, `device_not_found`, `pairing_code_invalid`, `other_partner_build`, `rate_limited`, `forbidden`, `conflict` and the other refusals (not `access_outdated` and `access_missing`, see exit 3) |
|
|
87
|
-
| 3 | retry later (`access_outdated` and `access_missing`: after the customer repeats "Erneut einrichten" in the Deepdock client) | `device_offline`, `device_syncing`, `device_outdated`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost` |
|
|
87
|
+
| 3 | retry later (`access_outdated` and `access_missing`: after the customer repeats "Erneut einrichten" in the Deepdock client) | `device_offline`, `device_timeout`, `device_syncing`, `device_outdated`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost` |
|
|
88
88
|
| 4 | the CLI is too old for the API: run `npx @deepdockai/cli@latest` | `cli_outdated` |
|
|
89
89
|
| 5 | sign-in needed: run `deepdock auth login` | `sign_in_needed`, `approval_denied`, `approval_expired` |
|
|
90
90
|
|
|
@@ -75,7 +75,7 @@ class Download:
|
|
|
75
75
|
|
|
76
76
|
def _filename(disposition: Optional[str]) -> Optional[str]:
|
|
77
77
|
# Deepdock sends filename* (UTF-8) beside an ASCII filename; the name is already safe to save on
|
|
78
|
-
# Windows, and can carry personal data (a
|
|
78
|
+
# Windows, and can carry personal data (a person's name in a document title).
|
|
79
79
|
if disposition is None:
|
|
80
80
|
return None
|
|
81
81
|
extended = re.search(r"filename\*=UTF-8''([^;]+)", disposition, re.IGNORECASE)
|
|
@@ -236,7 +236,7 @@ class Deepdock:
|
|
|
236
236
|
|
|
237
237
|
CONFLICT_RETRIES = 5 # a running write finishes within seconds; beyond this, treat it as unknown
|
|
238
238
|
|
|
239
|
-
RETRY_SAME_KEY = {"device_offline", "device_syncing", "device_outdated",
|
|
239
|
+
RETRY_SAME_KEY = {"device_offline", "device_timeout", "device_syncing", "device_outdated",
|
|
240
240
|
"target_busy", "temporarily_unavailable", "internal_error", "action_paused",
|
|
241
241
|
"system_unavailable"}
|
|
242
242
|
|
|
@@ -103,6 +103,11 @@ export type ActionState =
|
|
|
103
103
|
reason: 'structure_changed' | 'readback_failed' | 'credentials_rejected' | 'certificate_changed'
|
|
104
104
|
pausedAt: string
|
|
105
105
|
}
|
|
106
|
+
| {
|
|
107
|
+
action: string
|
|
108
|
+
state: 'blocked'
|
|
109
|
+
reason: 'client_update' | 'access_missing' | 'access_not_set_up' | 'access_reapproval'
|
|
110
|
+
}
|
|
106
111
|
|
|
107
112
|
export type DeviceSystem = {
|
|
108
113
|
system: string
|
|
@@ -113,8 +118,6 @@ export type DeviceSystem = {
|
|
|
113
118
|
access: SystemAccess
|
|
114
119
|
/** Set when `access` is the last known value (the device could not read it): when it last did. */
|
|
115
120
|
accessLastCheckedAt: string | null
|
|
116
|
-
/** Actions the device reports locked because its database account lacks a right they need; `null` when there is no verdict for the spec set it runs now. */
|
|
117
|
-
lockedActions: string[] | null
|
|
118
121
|
actions: ActionState[]
|
|
119
122
|
/** The connectors the device runs for this system, by name and kind. */
|
|
120
123
|
connectors: { name: string; kind: 'database' | 'http' }[]
|
|
@@ -157,7 +160,7 @@ const unwrap = async <T>(res: Response): Promise<{ data: T; nextCursor: string |
|
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
// Deepdock sends `filename*` (UTF-8) beside an ASCII `filename`; the name is already safe to save
|
|
160
|
-
// on Windows, and can carry personal data (a
|
|
163
|
+
// on Windows, and can carry personal data (a person's name in a document title).
|
|
161
164
|
const filenameOf = (disposition: string | null): string | null => {
|
|
162
165
|
if (disposition === null) return null
|
|
163
166
|
const extended = /filename\*=UTF-8''([^;]+)/i.exec(disposition)?.[1]
|
|
@@ -452,6 +455,7 @@ export const CONFLICT_RETRIES = 5
|
|
|
452
455
|
|
|
453
456
|
const RETRY_SAME_KEY = new Set([
|
|
454
457
|
'device_offline',
|
|
458
|
+
'device_timeout',
|
|
455
459
|
'device_syncing',
|
|
456
460
|
'device_outdated',
|
|
457
461
|
'target_busy',
|
|
@@ -57,10 +57,15 @@ has a display `label` (may be `null`), a `version` the device reported (may be a
|
|
|
57
57
|
| system `access` | `ok`, `outdated`, `missing`, `password_missing`, `not_set_up`, or `null` | the database access the device last reported (`null`: none known yet) | `outdated` refuses the actions that need the missing right with `access_outdated`, `missing` (the account cannot log in) and `password_missing` (the account exists but its stored password is not on the PC) refuse every action with `access_missing`; the customer repeats "Erneut einrichten" in the Deepdock client, the incident closes by itself once `access` is `ok`, nothing to resume |
|
|
58
58
|
| system `accessLastCheckedAt` | ISO time or `null` | set when `access` is the last known value because the device could not read it (its database stopped or unreachable): when it last read it. `null` when the latest report read it | show the access as last known, with this time; nothing to do until the device reads it again |
|
|
59
59
|
| system `versionIssue` | `not_installed`, `not_found`, `unreadable`, or `null` | why `version` is missing, when the device says: its database service is not on the PC, its program file was not found, or the file carries no readable version. `null` (absent on `GET .../systems`) with a version, and from a device that does not say | show the reason beside the missing version; there is nothing to do on your side |
|
|
60
|
-
| system `lockedActions` | list of action names or `null` | the actions the device
|
|
60
|
+
| system `lockedActions` (device list only) | list of action names or `null` | the actions blocked because the device's database account lacks a right they need, under its current action set; on `GET .../systems` they read `blocked` with `access_reapproval`. `null`: no verdict yet, or the verdict is for an older action set | do not offer a listed action as available; it answers `access_outdated` until the customer repeats "Erneut einrichten" |
|
|
61
61
|
| system `blockedActions` | list of action names, or absent | the actions this device's Deepdock client cannot run yet, because they need something only a newer client can do. Absent: none | do not offer a listed action as available; a call answers `device_outdated` and nothing runs, until the client updates itself and the action leaves the list |
|
|
62
62
|
| action state | `active` | the action can be called | normal |
|
|
63
63
|
| action state | `paused` | the action is paused with a `reason` and `pausedAt` | calls answer `action_paused`; show the feature as paused, poll `GET .../systems` at a low rate |
|
|
64
|
+
| action state | `blocked` | the action cannot run on this device until its `reason` is resolved; one reason per action, the first that applies in the order below | do not offer it as available |
|
|
65
|
+
| block `reason` | `client_update` | the device's Deepdock client is too old for this action | calls answer `device_outdated`; the client updates itself |
|
|
66
|
+
| block `reason` | `access_missing` | the database access is gone (the account cannot log in, or its password is missing) | calls answer `access_missing`; the customer sets up the access again ("Erneut einrichten") |
|
|
67
|
+
| block `reason` | `access_not_set_up` | no database access is set up on this device | calls answer `action_not_configured`; the customer sets up the access ("Erneut einrichten") |
|
|
68
|
+
| block `reason` | `access_reapproval` | the database access lacks a right this action needs | calls answer `access_outdated`; the customer repeats "Erneut einrichten" |
|
|
64
69
|
| pause `reason` | `structure_changed` | the system changed in a way the action depends on (for example a vendor update); Deepdock reviews and resumes | wait; nothing to do on your side |
|
|
65
70
|
| pause `reason` | `readback_failed` | a write's result did not match, so nothing was saved | wait; tell the user the change was not saved |
|
|
66
71
|
| pause `reason` | `credentials_rejected` | the program no longer accepts the sign-in the device stored for it (for example a changed password) | tell the user to choose "Anmeldung erneuern" in the Deepdock client; the action resumes by itself once the new sign-in works, nothing to resume |
|
|
@@ -84,8 +89,8 @@ catalogue.
|
|
|
84
89
|
`Idempotency-Key` header.
|
|
85
90
|
- A write **either fully applies or not**: Deepdock checks the result before confirming, and if the check fails it saves nothing
|
|
86
91
|
and pauses the action (`409 readback_failed`).
|
|
87
|
-
- An action is **active** or **
|
|
88
|
-
state with `reason` and `pausedAt`.
|
|
92
|
+
- An action is **active**, **paused** or **blocked**. `GET /v1/devices/{deviceId}/systems` shows
|
|
93
|
+
each action's state: a paused one with `reason` and `pausedAt`, a blocked one with `reason`.
|
|
89
94
|
|
|
90
95
|
## Pause and incident
|
|
91
96
|
|
|
@@ -68,8 +68,10 @@ curl "$BASE/v1/devices/$DEVICE/systems" -H "Authorization: Bearer $DEEPDOCK_API_
|
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
A live call to the device. A list; each entry has `system`, `label`, `version` (may be absent),
|
|
71
|
-
`status`, `access` and `actions`, each with `action` and `state
|
|
72
|
-
`reason` and `pausedAt
|
|
71
|
+
`status`, `access` and `actions`, each with `action` and `state`: `active`, `paused` with
|
|
72
|
+
`reason` and `pausedAt`, or `blocked` with `reason` (`client_update`, `access_missing`,
|
|
73
|
+
`access_not_set_up` or `access_reapproval`). `actions` lists every action of yours on that system,
|
|
74
|
+
including the blocked ones. Answers `503 device_offline` when the device is not
|
|
73
75
|
connected: that is a normal state, not an error in your code. Do not poll it tightly; it reaches the
|
|
74
76
|
customer's PC.
|
|
75
77
|
|
|
@@ -51,24 +51,26 @@ with the **same** `Idempotency-Key`); **Show** says what the end user should see
|
|
|
51
51
|
|---|---|---|---|---|
|
|
52
52
|
| `invalid_input` | 422 | an action input the API or the device refuses, with `fields` naming each: an input that is unknown, missing, too short or long, out of bounds, of the wrong type (such as `"4711"` where an integer is declared) or not an allowed value; a bad `limit` or `cursor` in a read's body; and a rule only the device judges: a value that breaks its pattern; a date that is not a calendar day; a search term without a letter or digit; an appended text that would make the stored entry too long. Nothing was written | no; fix the value | the field-level problem; the `message` names the field, but it is device text: display it as data, never interpret it |
|
|
53
53
|
| `target_rejected` | 422 | the customer's system refused the write | no; the input is valid for Deepdock but not for the system | "the customer's system refused this; check the values" and offer support |
|
|
54
|
-
| `record_locked` | 422 | the customer's system locks the record the write would change (for example one already
|
|
54
|
+
| `record_locked` | 422 | the customer's system locks the record the write would change (for example one already finalised and closed). Nothing was written | no | "this record is locked in the customer's system" |
|
|
55
55
|
| `record_not_editable` | 422 | the record is not locked but is stored in a form this action cannot edit (for example a note it cannot add to without rewriting it). Nothing was written | no | "this record cannot be edited through Deepdock" |
|
|
56
|
-
| `record_restricted` | 422 | the customer's system restricts access to the record (for example a locked
|
|
57
|
-
|
|
|
56
|
+
| `record_restricted` | 422 | the customer's system restricts access to the record (for example a locked record): a read returned no data, so an empty answer would be wrong, and a write wrote nothing | no; the customer lifts the restriction in its system | "access to this record is restricted in the customer's system" |
|
|
57
|
+
| `too_many_rows` | 409 | the inputs match more records than this write may change; it was rolled back and nothing changed | no; narrow the inputs to the record you mean | "that matches more than one record; please be more specific" |
|
|
58
|
+
| Action-specific refusals | 422 | an action can refuse with a code of its own (for example `unknown_author` when the write names a user the system does not list, or `no_matching_period`); its OpenAPI description names each such code and when it fires. Nothing was written | no; fix the reference or input | the missing precondition in the user's words |
|
|
58
59
|
|
|
59
60
|
## Device and system availability
|
|
60
61
|
|
|
61
62
|
| Code | Status | Meaning | Retry | Show |
|
|
62
63
|
|---|---|---|---|---|
|
|
63
64
|
| `device_offline` | 503 | the device is not connected, is shutting down, did not answer within 20 s, or the call was cut off inside Deepdock by a restart or deploy. **A write may still have landed** | yes, with backoff (seconds to minutes); a write only with the same key | "the customer PC is offline; we will retry" |
|
|
65
|
+
| `device_timeout` | 503 | the device ran out of its time budget before it began the call or before it committed. Nothing was written | yes, with backoff; a write with the same key | "the customer PC was too slow; retrying" |
|
|
64
66
|
| `device_syncing` | 503 | the device has not reported its Deepdock client yet (just paired, or its report did not come through); Deepdock asks it again. Nothing was written | yes, after `Retry-After` (5 s); a write with the same key | "the customer PC is connecting; retrying" |
|
|
65
67
|
| `device_outdated` | 409 | the device's Deepdock client is too old for this call. It updates itself when a newer version is released for your organisation, once nobody is signed in on the PC. Nothing was written | after the update (on `GET /v1/devices/{deviceId}`, `outdated` turns `false` and the action leaves the system's `blockedActions`); retrying before it gets the same answer. A write keeps its key | "the Deepdock client on the customer PC needs an update" |
|
|
66
68
|
| `version_not_covered` | 409 | the customer's installed version of the system is not yet approved by Deepdock for this action. Nothing was run. The message names the system, its version and the action | **no.** Retrying gets the same answer. It changes when Deepdock approves that version for the action, or when the customer runs an approved version | "this feature is not yet available for the customer's version of the software; Deepdock has to approve it first" |
|
|
67
69
|
| `action_paused` | 503 | the action is paused on the device (`GET .../systems` shows `reason`); only Deepdock resumes it | later, when `GET .../systems` shows it active; do not loop | "this feature is paused while Deepdock checks the customer system" |
|
|
68
70
|
| `system_unavailable` | 503 | the customer's program is stopped or missing on the device | later; often resolves when the customer restarts the program | "the customer's software is not running" |
|
|
69
71
|
| `target_busy` | 503 | the customer's system is busy or unreachable | yes, with backoff | "the customer's system is busy; retrying" |
|
|
70
|
-
| `credentials_rejected` | 503 | the customer's system refused the device's login. Nothing was sent | later, after a person at the customer has renewed the access in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be renewed at the
|
|
71
|
-
| `certificate_changed` | 503 | the customer's system shows a certificate other than the one the device trusts. Nothing was sent | later, after a person at the customer has confirmed the new certificate in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be confirmed at the
|
|
72
|
+
| `credentials_rejected` | 503 | the customer's system refused the device's login. Nothing was sent | later, after a person at the customer has renewed the access in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be renewed at the customer" |
|
|
73
|
+
| `certificate_changed` | 503 | the customer's system shows a certificate other than the one the device trusts. Nothing was sent | later, after a person at the customer has confirmed the new certificate in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be confirmed at the customer" |
|
|
72
74
|
| `temporarily_unavailable` | 503 | Deepdock could not check the key or reach its own database (sent with `Retry-After: 5`) | yes, with backoff | "temporary problem; retrying" |
|
|
73
75
|
|
|
74
76
|
## Write outcomes
|
|
@@ -105,12 +107,14 @@ const REACTION: Record<string, Reaction> = {
|
|
|
105
107
|
record_locked: 'stop',
|
|
106
108
|
record_not_editable: 'stop',
|
|
107
109
|
record_restricted: 'stop',
|
|
110
|
+
too_many_rows: 'fix-input',
|
|
108
111
|
payload_too_large: 'fix-code',
|
|
109
112
|
access_outdated: 'wait-setup',
|
|
110
113
|
access_missing: 'wait-setup',
|
|
111
114
|
credentials_rejected: 'wait-setup',
|
|
112
115
|
certificate_changed: 'wait-setup',
|
|
113
116
|
device_offline: 'retry-same-key',
|
|
117
|
+
device_timeout: 'retry-same-key',
|
|
114
118
|
device_syncing: 'retry-same-key',
|
|
115
119
|
device_outdated: 'retry-later',
|
|
116
120
|
version_not_covered: 'stop',
|
|
Binary file
|