endia 0.0.0-stage → 0.0.2
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/LICENSE +202 -0
- package/README.md +34 -2
- package/dist/archives/archive-file.d.ts +36 -0
- package/dist/archives/archive-file.js +71 -0
- package/dist/archives/build-context.d.ts +63 -0
- package/dist/archives/build-context.js +132 -0
- package/dist/archives/docker-ignore.d.ts +57 -0
- package/dist/archives/docker-ignore.js +250 -0
- package/dist/archives/fleet-archive.d.ts +33 -0
- package/dist/archives/fleet-archive.js +134 -0
- package/dist/compose-model.d.ts +32 -0
- package/dist/compose-model.js +39 -0
- package/dist/contract/archives.d.ts +14 -0
- package/dist/contract/archives.js +1 -0
- package/dist/contract/bases.d.ts +48 -0
- package/dist/contract/bases.js +1 -0
- package/dist/contract/clients.d.ts +29 -0
- package/dist/contract/clients.js +1 -0
- package/dist/contract/common.d.ts +30 -0
- package/dist/contract/common.js +1 -0
- package/dist/contract/compose.d.ts +27 -0
- package/dist/contract/compose.js +1 -0
- package/dist/contract/desktop.d.ts +269 -0
- package/dist/contract/desktop.js +1 -0
- package/dist/contract/execs.d.ts +61 -0
- package/dist/contract/execs.js +1 -0
- package/dist/contract/fleets.d.ts +136 -0
- package/dist/contract/fleets.js +1 -0
- package/dist/contract/images.d.ts +130 -0
- package/dist/contract/images.js +1 -0
- package/dist/contract/machines.d.ts +199 -0
- package/dist/contract/machines.js +1 -0
- package/dist/contract/operations.d.ts +28 -0
- package/dist/contract/operations.js +1 -0
- package/dist/contract/processes.d.ts +75 -0
- package/dist/contract/processes.js +1 -0
- package/dist/contract/purposes.d.ts +62 -0
- package/dist/contract/purposes.js +1 -0
- package/dist/contract/space.d.ts +114 -0
- package/dist/contract/space.js +1 -0
- package/dist/contract/stats.d.ts +58 -0
- package/dist/contract/stats.js +1 -0
- package/dist/contract/status.d.ts +151 -0
- package/dist/contract/status.js +1 -0
- package/dist/contract/volumes.d.ts +22 -0
- package/dist/contract/volumes.js +1 -0
- package/dist/eastindia-client.d.ts +118 -0
- package/dist/eastindia-client.js +142 -0
- package/dist/environment.d.ts +52 -0
- package/dist/environment.js +133 -0
- package/dist/errors.d.ts +81 -0
- package/dist/errors.js +108 -0
- package/dist/exec/exec-frame.d.ts +38 -0
- package/dist/exec/exec-frame.js +50 -0
- package/dist/exec/exec-session.d.ts +64 -0
- package/dist/exec/exec-session.js +117 -0
- package/dist/groups/archives.d.ts +78 -0
- package/dist/groups/archives.js +117 -0
- package/dist/groups/bases.d.ts +28 -0
- package/dist/groups/bases.js +39 -0
- package/dist/groups/certificates.d.ts +32 -0
- package/dist/groups/certificates.js +43 -0
- package/dist/groups/desktop.d.ts +143 -0
- package/dist/groups/desktop.js +182 -0
- package/dist/groups/execs.d.ts +110 -0
- package/dist/groups/execs.js +119 -0
- package/dist/groups/fleets.d.ts +206 -0
- package/dist/groups/fleets.js +255 -0
- package/dist/groups/images.d.ts +130 -0
- package/dist/groups/images.js +109 -0
- package/dist/groups/machines.d.ts +124 -0
- package/dist/groups/machines.js +127 -0
- package/dist/groups/operations.d.ts +127 -0
- package/dist/groups/operations.js +174 -0
- package/dist/groups/processes.d.ts +77 -0
- package/dist/groups/processes.js +75 -0
- package/dist/groups/stats.d.ts +29 -0
- package/dist/groups/stats.js +33 -0
- package/dist/groups/system.d.ts +33 -0
- package/dist/groups/system.js +40 -0
- package/dist/groups/volumes.d.ts +36 -0
- package/dist/groups/volumes.js +40 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +20 -0
- package/dist/purposes.d.ts +17 -0
- package/dist/purposes.js +21 -0
- package/dist/routes.d.ts +71 -0
- package/dist/routes.js +73 -0
- package/dist/transport/api-connection.d.ts +185 -0
- package/dist/transport/api-connection.js +396 -0
- package/dist/transport/connection-failures.d.ts +14 -0
- package/dist/transport/connection-failures.js +57 -0
- package/dist/transport/json-lines.d.ts +10 -0
- package/dist/transport/json-lines.js +23 -0
- package/dist/transport/query-text.d.ts +49 -0
- package/dist/transport/query-text.js +62 -0
- package/dist/transport/service-address.d.ts +30 -0
- package/dist/transport/service-address.js +37 -0
- package/dist/transport/tls-files.d.ts +9 -0
- package/dist/transport/tls-files.js +1 -0
- package/package.json +44 -5
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import type { Timestamp, WindowBounds } from "./common.js";
|
|
2
|
+
import type { ProcessWindow } from "./processes.js";
|
|
3
|
+
/** The body of `POST /v1/machines/{name}/desktop/click`: the element the pointer clicks at its centre. It exists for elements that answer only the mouse, which `invoke` cannot press, without the caller working out a point from the element's bounds. */
|
|
4
|
+
export interface ClickRequest {
|
|
5
|
+
/** The ID of the process that owns the element's window. */
|
|
6
|
+
readonly processId: number;
|
|
7
|
+
/** The time the process must have started, or null to take whichever process has the ID. */
|
|
8
|
+
readonly started?: Timestamp | null;
|
|
9
|
+
/** The element selector; its first segment names one of the process's top-level windows. */
|
|
10
|
+
readonly element: string;
|
|
11
|
+
/** The button: `left`, `right` or `middle`. */
|
|
12
|
+
readonly button?: string;
|
|
13
|
+
/** Whether to click twice, as a double-click. */
|
|
14
|
+
readonly doubleClick?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** The body of `POST /v1/machines/{name}/desktop/inspect`: the process whose UI tree to read, and optionally one of its windows. */
|
|
17
|
+
export interface DesktopInspectRequest {
|
|
18
|
+
/** The process ID. */
|
|
19
|
+
readonly processId: number;
|
|
20
|
+
/** The time the process must have started, or null to take whichever process has the ID. */
|
|
21
|
+
readonly started?: Timestamp | null;
|
|
22
|
+
/** One window's handle as hexadecimal text, or null for every visible top-level window of the process. */
|
|
23
|
+
readonly window?: string | null;
|
|
24
|
+
}
|
|
25
|
+
/** The body of `POST /v1/machines/{name}/desktop/launch`, which `endia desktop launch` sends: the program to start in the desktop user's session. */
|
|
26
|
+
export interface DesktopLaunchRequest {
|
|
27
|
+
/** The program: a full path, or a file name Windows looks for on the desktop user's `PATH`. */
|
|
28
|
+
readonly program: string;
|
|
29
|
+
/** The arguments, each passed to the program as one argument. */
|
|
30
|
+
readonly args?: readonly string[];
|
|
31
|
+
/** The working folder, or null for the folder the guest service chooses. */
|
|
32
|
+
readonly workingDir?: string | null;
|
|
33
|
+
/** Extra environment variables, each `NAME=value`, added to the desktop user's own. */
|
|
34
|
+
readonly env?: readonly string[];
|
|
35
|
+
/** Whether to start the program with the desktop user's linked administrator token. */
|
|
36
|
+
readonly elevated?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** The body of `POST /v1/machines/{name}/desktop/wait`: the element to wait for, and whether to wait for it to appear or to go. Without this route a caller would poll `desktop inspect` in a loop of its own. */
|
|
39
|
+
export interface DesktopWaitRequest {
|
|
40
|
+
/** The ID of the process that owns the element's window. */
|
|
41
|
+
readonly processId: number;
|
|
42
|
+
/** The time the process must have started, or null to take whichever process has the ID. */
|
|
43
|
+
readonly started?: Timestamp | null;
|
|
44
|
+
/** The element selector; its first segment names one of the process's top-level windows, and a selector of that one segment waits for the window itself. */
|
|
45
|
+
readonly element: string;
|
|
46
|
+
/** Whether to wait until the selector names no element, instead of until it names exactly one. */
|
|
47
|
+
readonly gone?: boolean;
|
|
48
|
+
/** The longest wait in seconds, or null for `desktopActionTimeoutSeconds`. */
|
|
49
|
+
readonly timeoutSeconds?: number | null;
|
|
50
|
+
}
|
|
51
|
+
/** The body of `POST /v1/machines/{name}/desktop/invoke`: the element whose Invoke pattern to use, such as a button to press. */
|
|
52
|
+
export interface InvokeRequest {
|
|
53
|
+
/** The ID of the process that owns the element's window. */
|
|
54
|
+
readonly processId: number;
|
|
55
|
+
/** The time the process must have started, or null to take whichever process has the ID. */
|
|
56
|
+
readonly started?: Timestamp | null;
|
|
57
|
+
/** The element selector, for example `Window[Trainee]/Button[Send diagnostics]`; its first segment names one of the process's top-level windows. */
|
|
58
|
+
readonly element: string;
|
|
59
|
+
}
|
|
60
|
+
/** The body of `POST /v1/machines/{name}/desktop/keys`: keys to press, or text to type, in the process's main window. Exactly one of `Keys` and `Text` is given. */
|
|
61
|
+
export interface KeysRequest {
|
|
62
|
+
/** The ID of the process whose main window receives the input. */
|
|
63
|
+
readonly processId: number;
|
|
64
|
+
/** The time the process must have started, or null to take whichever process has the ID. */
|
|
65
|
+
readonly started?: Timestamp | null;
|
|
66
|
+
/** Chords separated by spaces, such as `ctrl+s` or `alt+f4 enter`; or null when `Text` is given. */
|
|
67
|
+
readonly keys?: string | null;
|
|
68
|
+
/** Text typed literally as Unicode characters; or null when `Keys` is given. */
|
|
69
|
+
readonly text?: string | null;
|
|
70
|
+
}
|
|
71
|
+
/** The body of `POST /v1/machines/{name}/desktop/pointer`: what the pointer does, and where: in a process's main window, or on the screen when no process is named. */
|
|
72
|
+
export interface PointerRequest {
|
|
73
|
+
/** The ID of the process whose main window the pointer acts in, or null to act at a point on the screen. */
|
|
74
|
+
readonly processId?: number | null;
|
|
75
|
+
/** The time the process must have started, or null to take whichever process has the ID. */
|
|
76
|
+
readonly started?: Timestamp | null;
|
|
77
|
+
/** The action: `move`, `click`, `double-click` or `scroll`. */
|
|
78
|
+
readonly action: string;
|
|
79
|
+
/** The distance in physical pixels from the left edge of the window's client area, or of the screen when no process is named. */
|
|
80
|
+
readonly x: number;
|
|
81
|
+
/** The distance in physical pixels from the top edge of the window's client area, or of the screen when no process is named. */
|
|
82
|
+
readonly y: number;
|
|
83
|
+
/** The button a click uses: `left`, `right` or `middle`. */
|
|
84
|
+
readonly button?: string;
|
|
85
|
+
/** The wheel notches a scroll turns; positive scrolls up, negative down. */
|
|
86
|
+
readonly delta?: number;
|
|
87
|
+
}
|
|
88
|
+
/** The body of `POST /v1/machines/{name}/desktop/screenshot`: the whole desktop, or the largest visible window of one process. */
|
|
89
|
+
export interface ScreenshotRequest {
|
|
90
|
+
/** The process whose largest visible top-level window to capture, or null for the whole desktop. */
|
|
91
|
+
readonly processId?: number | null;
|
|
92
|
+
}
|
|
93
|
+
/** The body of `POST /v1/machines/{name}/desktop/set-value`: the element whose Value pattern to set, the value, and whether the value is a secret. */
|
|
94
|
+
export interface SetValueRequest {
|
|
95
|
+
/** The ID of the process that owns the element's window. */
|
|
96
|
+
readonly processId: number;
|
|
97
|
+
/** The time the process must have started, or null to take whichever process has the ID. */
|
|
98
|
+
readonly started?: Timestamp | null;
|
|
99
|
+
/** The element selector; its first segment names one of the process's top-level windows. */
|
|
100
|
+
readonly element: string;
|
|
101
|
+
/** The value to set. */
|
|
102
|
+
readonly value: string;
|
|
103
|
+
/** Whether the value is a secret, such as a password: it may then go into a password field, it is never logged, recorded or printed, and it is not read back. */
|
|
104
|
+
readonly secret?: boolean;
|
|
105
|
+
}
|
|
106
|
+
/** The body of `POST /v1/machines/{name}/desktop/tray/click`: which notification-area icon the pointer clicks, and how. */
|
|
107
|
+
export interface TrayClickRequest {
|
|
108
|
+
/** The start of the icon's name, compared with case; exactly one icon's name must start with it. */
|
|
109
|
+
readonly icon: string;
|
|
110
|
+
/** The button: `left`, `right` or `middle`. */
|
|
111
|
+
readonly button?: string;
|
|
112
|
+
/** Whether to click twice, as a double-click. */
|
|
113
|
+
readonly doubleClick?: boolean;
|
|
114
|
+
}
|
|
115
|
+
/** The body of `POST /v1/machines/{name}/desktop/uac`, which `endia desktop uac` sends: which program's elevation prompt to wait for, and how to answer it. The password is used for this one action: the service writes it to no log, record or stored reply, which is why this route ignores an `Idempotency-Key`. */
|
|
116
|
+
export interface UacRequest {
|
|
117
|
+
/** The file name of the program the prompt must name, for example `diagnostics.exe`, compared without regard to case. */
|
|
118
|
+
readonly expectedProgram: string;
|
|
119
|
+
/** How to answer: `credentials`, `consent` or `cancel`. */
|
|
120
|
+
readonly action: string;
|
|
121
|
+
/** The account to choose for `credentials`; otherwise null. */
|
|
122
|
+
readonly user?: string | null;
|
|
123
|
+
/** The account's password for `credentials`; otherwise null. */
|
|
124
|
+
readonly password?: string | null;
|
|
125
|
+
/** The seconds to wait for the prompt, or null for `desktopActionTimeoutSeconds`. */
|
|
126
|
+
readonly timeoutSeconds?: number | null;
|
|
127
|
+
}
|
|
128
|
+
/** The answer to `endia desktop inspect`: the UI tree of each window read, as UI Automation's control view shows it. */
|
|
129
|
+
export interface DesktopInspectResult {
|
|
130
|
+
/** The windows, the frontmost first. */
|
|
131
|
+
readonly windows: readonly InspectedWindow[];
|
|
132
|
+
}
|
|
133
|
+
/** The answer to `endia desktop launch`, given once the process exists and without waiting for a window: the real process ID and the facts that name the process safely afterwards. */
|
|
134
|
+
export interface DesktopLaunchResult {
|
|
135
|
+
/** The process ID. */
|
|
136
|
+
readonly processId: number;
|
|
137
|
+
/** When the process started; `--started` takes this value. */
|
|
138
|
+
readonly started: Timestamp;
|
|
139
|
+
/** The desktop user's Windows session. */
|
|
140
|
+
readonly sessionId: number;
|
|
141
|
+
/** The account the process runs as. */
|
|
142
|
+
readonly user: string;
|
|
143
|
+
/** The integrity level of the process's token: `low`, `medium`, `high` or `system`. */
|
|
144
|
+
readonly integrityLevel: string;
|
|
145
|
+
/** The windows the process had shown when it was found to exist; usually none yet. */
|
|
146
|
+
readonly windows: readonly ProcessWindow[];
|
|
147
|
+
}
|
|
148
|
+
/** The answer of `POST /v1/machines/{name}/desktop/wait`: the element the wait found, and the window that holds it, so that the caller can act on the element without reading the tree again. Both are null when the wait was for the element to go. */
|
|
149
|
+
export interface DesktopWaitResult {
|
|
150
|
+
/** The handle, in hexadecimal, of the window that holds the element, or null when the element has gone. */
|
|
151
|
+
readonly window: string | null;
|
|
152
|
+
/** The element found, without its children, or null when the element has gone. */
|
|
153
|
+
readonly element: UiElement | null;
|
|
154
|
+
}
|
|
155
|
+
/** The answer to `endia desktop invoke`. */
|
|
156
|
+
export interface InvokeResult {
|
|
157
|
+
/** Whether the element was invoked; always true, because a failure is a refusal. */
|
|
158
|
+
readonly invoked: boolean;
|
|
159
|
+
}
|
|
160
|
+
/** The answer to `endia desktop keys`. */
|
|
161
|
+
export interface KeysResult {
|
|
162
|
+
/** The number of input events sent: a press and a release for each key. */
|
|
163
|
+
readonly sent: number;
|
|
164
|
+
}
|
|
165
|
+
/** The answer to `endia desktop pointer`: where on the screen the pointer acted, and the window it acted on. */
|
|
166
|
+
export interface PointerResult {
|
|
167
|
+
/** The distance in physical pixels from the left edge of the screen. */
|
|
168
|
+
readonly screenX: number;
|
|
169
|
+
/** The distance in physical pixels from the top edge of the screen. */
|
|
170
|
+
readonly screenY: number;
|
|
171
|
+
/** The handle of the top-level window under the point, as hexadecimal text; null when the guest did not report it. */
|
|
172
|
+
readonly window: string | null;
|
|
173
|
+
/** The ID of the process that owns that window; null when the guest did not report it. */
|
|
174
|
+
readonly processId: number | null;
|
|
175
|
+
}
|
|
176
|
+
/** The answer to `endia desktop set-value`. */
|
|
177
|
+
export interface SetValueResult {
|
|
178
|
+
/** The element's value read back after it was set, or null when the element no longer gives one. */
|
|
179
|
+
readonly value: string | null;
|
|
180
|
+
}
|
|
181
|
+
/** The answer of `POST /v1/machines/{name}/desktop/tray/click`: the full name of the icon clicked, which may carry more than the start the caller gave, and the screen point the pointer clicked. */
|
|
182
|
+
export interface TrayClickResult {
|
|
183
|
+
/** The full name of the icon clicked. */
|
|
184
|
+
readonly name: string;
|
|
185
|
+
/** The horizontal screen position clicked, in physical pixels. */
|
|
186
|
+
readonly screenX: number;
|
|
187
|
+
/** The vertical screen position clicked, in physical pixels. */
|
|
188
|
+
readonly screenY: number;
|
|
189
|
+
}
|
|
190
|
+
/** The answer to `endia desktop uac`: what became of the prompt, what it showed, and the desktop before and after the answer. Whether the program then ran elevated is not reported; the caller checks that through its workload. */
|
|
191
|
+
export interface UacResult {
|
|
192
|
+
/** The outcome: `accepted` when the prompt closed after Yes, `credentialsRefused` when it still shows after Yes and is left open, or `cancelled` after No. */
|
|
193
|
+
readonly outcome: string;
|
|
194
|
+
/** What the prompt showed. */
|
|
195
|
+
readonly prompt: UacPromptDetail;
|
|
196
|
+
/** A PNG of the desktop before the answer, base64 encoded. */
|
|
197
|
+
readonly screenshotBefore: string;
|
|
198
|
+
/** A PNG of the desktop, base64 encoded. It is taken after the answer, once the wait that the host's configuration sets in `uacSettleSeconds` has passed. */
|
|
199
|
+
readonly screenshotAfter: string;
|
|
200
|
+
}
|
|
201
|
+
/** One element of a window's UI tree, with what an element selector matches on (its control type, name and automation ID) and what an action needs to know (whether it is enabled, its value and the patterns it supports). */
|
|
202
|
+
export interface UiElement {
|
|
203
|
+
/** UI Automation's control type without `ControlType.`, for example `Button`. */
|
|
204
|
+
readonly controlType: string;
|
|
205
|
+
/** The element's name, or null when it has none. */
|
|
206
|
+
readonly name: string | null;
|
|
207
|
+
/** The element's automation ID, or null when it has none. */
|
|
208
|
+
readonly automationId: string | null;
|
|
209
|
+
/** The element's window class name, or null when it has none. */
|
|
210
|
+
readonly className: string | null;
|
|
211
|
+
/** The element's value, or null when it has no value or is a password field, whose value is never read. */
|
|
212
|
+
readonly value: string | null;
|
|
213
|
+
/** Whether the element accepts input. */
|
|
214
|
+
readonly enabled: boolean;
|
|
215
|
+
/** Whether the element is on screen. */
|
|
216
|
+
readonly visible: boolean;
|
|
217
|
+
/** Whether the element is a password field. */
|
|
218
|
+
readonly isPassword: boolean;
|
|
219
|
+
/** Where the element is, in physical pixels from the top-left corner of its window, or null when it has no size. */
|
|
220
|
+
readonly bounds: WindowBounds | null;
|
|
221
|
+
/** Where the element is, in physical pixels from the top-left corner of the screen, or null when it has no size. A point inside it is where `desktop pointer --screen` acts on the element, if no other window covers it. */
|
|
222
|
+
readonly screenBounds: WindowBounds | null;
|
|
223
|
+
/** The UI Automation patterns the element supports, for example `Invoke` or `Value`. */
|
|
224
|
+
readonly patterns: readonly string[];
|
|
225
|
+
/** The child elements, in document order. */
|
|
226
|
+
readonly children: readonly UiElement[];
|
|
227
|
+
}
|
|
228
|
+
/** One window and its UI tree. */
|
|
229
|
+
export interface InspectedWindow {
|
|
230
|
+
/** The window handle as hexadecimal text. */
|
|
231
|
+
readonly handle: string;
|
|
232
|
+
/** The title bar text; empty when the window has none. */
|
|
233
|
+
readonly title: string;
|
|
234
|
+
/** The window's own element, with its descendants. */
|
|
235
|
+
readonly root: UiElement;
|
|
236
|
+
}
|
|
237
|
+
/** One visible top-level window on a machine's desktop, as `endia desktop windows` lists it, with the process that owns it. */
|
|
238
|
+
export interface DesktopWindow {
|
|
239
|
+
/** The ID of the process that owns the window, which the other desktop commands take. */
|
|
240
|
+
readonly processId: number;
|
|
241
|
+
/** The name of that process's program, without its extension; empty when the desktop helper may not read it. */
|
|
242
|
+
readonly processName: string;
|
|
243
|
+
/** The window handle as hexadecimal text, for example `0x2a0b4c`, which `desktop inspect --window` takes. */
|
|
244
|
+
readonly handle: string;
|
|
245
|
+
/** The title bar text; empty when the window has none. */
|
|
246
|
+
readonly title: string;
|
|
247
|
+
/** The window class name. */
|
|
248
|
+
readonly className: string;
|
|
249
|
+
/** Where the window is, in physical pixels from the top-left corner of the screen. */
|
|
250
|
+
readonly bounds: WindowBounds;
|
|
251
|
+
}
|
|
252
|
+
/** One icon of the notification area, as `GET /v1/machines/{name}/desktop/tray` lists it. The icon belongs to Windows' taskbar, not to the program that put it there, so the window and element commands, which name a process, cannot reach it. */
|
|
253
|
+
export interface TrayIcon {
|
|
254
|
+
/** The name Windows shows for the icon, usually the program's tooltip. */
|
|
255
|
+
readonly name: string;
|
|
256
|
+
/** Whether Windows has moved the icon behind the "Show hidden icons" button. */
|
|
257
|
+
readonly hidden: boolean;
|
|
258
|
+
/** Where the icon is on the screen, in physical pixels from the top-left corner of the primary screen, or null for a hidden icon. */
|
|
259
|
+
readonly screenBounds: WindowBounds | null;
|
|
260
|
+
}
|
|
261
|
+
/** What an elevation prompt showed. */
|
|
262
|
+
export interface UacPromptDetail {
|
|
263
|
+
/** The program the prompt asked to elevate. */
|
|
264
|
+
readonly program: string;
|
|
265
|
+
/** The publisher the prompt showed, or null when it showed none. */
|
|
266
|
+
readonly publisher: string | null;
|
|
267
|
+
/** The accounts the prompt offered; empty on a consent prompt. */
|
|
268
|
+
readonly accounts: readonly string[];
|
|
269
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Timestamp } from "./common.js";
|
|
2
|
+
/** The body of `POST /v1/machines/{name}/exec`, which `endia exec` sends to create an exec: the program and its arguments, the account, the working folder, the extra variables, and whether the program gets a console and standard input. The exec is started by a second request. */
|
|
3
|
+
export interface ExecCreateRequest {
|
|
4
|
+
/** The program followed by its arguments; at least the program. */
|
|
5
|
+
readonly cmd: readonly string[];
|
|
6
|
+
/** The local account to run as, or null to run as the service's default user, or the image's user when the service sets none. */
|
|
7
|
+
readonly user?: string | null;
|
|
8
|
+
/** The folder to start in, or null to start in the service's default folder, or the image's folder when the service sets none. */
|
|
9
|
+
readonly workingDir?: string | null;
|
|
10
|
+
/** The extra variables, each written `NAME=value`, laid over the machine's main-process environment. */
|
|
11
|
+
readonly env?: readonly string[];
|
|
12
|
+
/** Whether the program gets a Windows pseudo console. */
|
|
13
|
+
readonly tty?: boolean;
|
|
14
|
+
/** Whether the program's standard input stays open for what the caller sends. */
|
|
15
|
+
readonly attachStdin?: boolean;
|
|
16
|
+
/** The console's size as rows and then columns, or null for the pseudo console's default. */
|
|
17
|
+
readonly consoleSize?: readonly number[] | null;
|
|
18
|
+
}
|
|
19
|
+
/** The answer to `POST /v1/machines/{name}/exec`: the new exec's ID, which the start, inspect and resize routes take. */
|
|
20
|
+
export interface ExecCreated {
|
|
21
|
+
/** The exec ID: 32 lower-case hexadecimal digits. */
|
|
22
|
+
readonly id: string;
|
|
23
|
+
}
|
|
24
|
+
/** The answer to a detached start: the process the program runs in, which the process commands take. */
|
|
25
|
+
export interface ExecStarted {
|
|
26
|
+
/** The Windows process ID inside the machine. */
|
|
27
|
+
readonly processId: number;
|
|
28
|
+
/** When the process started, which tells it apart from a later process given the same ID. */
|
|
29
|
+
readonly started: Timestamp;
|
|
30
|
+
}
|
|
31
|
+
/** One exec as `GET /v1/execs/{id}` shows it: what was asked for, the process it runs in, whether it still runs and, once it has ended, its exit code. `endia exec` reads the exit code here once the program's output has ended. */
|
|
32
|
+
export interface ExecDetail {
|
|
33
|
+
/** The exec ID: 32 lower-case hexadecimal digits. */
|
|
34
|
+
readonly id: string;
|
|
35
|
+
/** The name of the machine the exec runs in. */
|
|
36
|
+
readonly machine: string;
|
|
37
|
+
/** The boot of Windows in which the exec was created or, once the exec has started, in which it started. */
|
|
38
|
+
readonly bootId: string | null;
|
|
39
|
+
/** The program followed by its arguments. */
|
|
40
|
+
readonly cmd: readonly string[];
|
|
41
|
+
/** The account asked for, or null for the default. */
|
|
42
|
+
readonly user: string | null;
|
|
43
|
+
/** The working folder asked for, or null for the default. */
|
|
44
|
+
readonly workingDir: string | null;
|
|
45
|
+
/** Whether the program has a pseudo console. */
|
|
46
|
+
readonly tty: boolean;
|
|
47
|
+
/** Whether the exec was started detached. */
|
|
48
|
+
readonly detached: boolean;
|
|
49
|
+
/** The Windows process ID inside the machine, or null before the program has started or when it could not. */
|
|
50
|
+
readonly processId: number | null;
|
|
51
|
+
/** When the program started, or null before it has. */
|
|
52
|
+
readonly started: Timestamp | null;
|
|
53
|
+
/** Whether the program runs now. */
|
|
54
|
+
readonly running: boolean;
|
|
55
|
+
/** The program's exit code once it has ended: 127 when the program was not found and 126 when it was found but could not start, as Docker gives them. Null while it runs, and when Windows restarted before it ended. */
|
|
56
|
+
readonly exitCode: number | null;
|
|
57
|
+
/** When the program ended, or null. */
|
|
58
|
+
readonly exited: Timestamp | null;
|
|
59
|
+
/** Why the program could not start, or null. */
|
|
60
|
+
readonly startError: string | null;
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { Timestamp } from "./common.js";
|
|
2
|
+
import type { MachineSummary } from "./machines.js";
|
|
3
|
+
import type { PurposeDetail, PurposeSummary } from "./purposes.js";
|
|
4
|
+
/** One planned action in a dry run: what would be done, to what, and why. */
|
|
5
|
+
export interface DryRunAction {
|
|
6
|
+
/** What would be done: `createNetwork`, `createVolume`, `build`, `create`, `recreate`, `start`, `remove` or `keep`. */
|
|
7
|
+
readonly action: string;
|
|
8
|
+
/** What it would be done to: a network or volume name, a service name for a build, or a machine name. */
|
|
9
|
+
readonly target: string;
|
|
10
|
+
/** Why, in words for the caller, such as `no machine has index 3`. */
|
|
11
|
+
readonly reason: string;
|
|
12
|
+
}
|
|
13
|
+
/** One fleet as `endia compose ps` reads it: the fleet's record, with each of its machines as `endia ps` lists one. */
|
|
14
|
+
export interface FleetDetail {
|
|
15
|
+
/** The fleet name, which is the Compose project name. */
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/** The paths of the Compose files as the CLI sent them with the last `compose up`. */
|
|
18
|
+
readonly configFiles: readonly string[];
|
|
19
|
+
/** The folder against which the CLI resolved relative paths. */
|
|
20
|
+
readonly projectDirectory: string;
|
|
21
|
+
/** The resolved Compose model of the last `compose up`, as `compose config --format json` prints it. */
|
|
22
|
+
readonly model: unknown;
|
|
23
|
+
/** The fleet's private networks. */
|
|
24
|
+
readonly networks: readonly FleetNetworkDetail[];
|
|
25
|
+
/** The names of the named volumes the fleet declares. */
|
|
26
|
+
readonly volumes: readonly string[];
|
|
27
|
+
/** The fleet's machines, sorted by service and then by index. */
|
|
28
|
+
readonly machines: readonly MachineSummary[];
|
|
29
|
+
/** When the fleet was first brought up. */
|
|
30
|
+
readonly created: Timestamp;
|
|
31
|
+
/** When the fleet's record was last changed. */
|
|
32
|
+
readonly updated: Timestamp;
|
|
33
|
+
/** What the fleet is being used for, in full, or null when it has no purpose. Each machine without a purpose of its own has it. */
|
|
34
|
+
readonly purpose: PurposeDetail | null;
|
|
35
|
+
}
|
|
36
|
+
/** What `compose down` removed, as its operation's result, with the warnings for the caller. */
|
|
37
|
+
export interface FleetDownResult {
|
|
38
|
+
/** The fleet name. */
|
|
39
|
+
readonly fleet: string;
|
|
40
|
+
/** The machines removed, in the order they were removed: dependants before the services they depend on. */
|
|
41
|
+
readonly machines: readonly string[];
|
|
42
|
+
/** The networks whose switches were removed. */
|
|
43
|
+
readonly networks: readonly string[];
|
|
44
|
+
/** The named volumes whose disks were deleted. */
|
|
45
|
+
readonly volumes: readonly string[];
|
|
46
|
+
/** The warnings, in Docker Compose's words where Docker Compose has them. */
|
|
47
|
+
readonly warnings: readonly string[];
|
|
48
|
+
}
|
|
49
|
+
/** The answer to `compose up --dry-run`: what `compose up` would do, in order, and whether the host has the memory the machines it would start need. Nothing is changed to give it. */
|
|
50
|
+
export interface FleetDryRun {
|
|
51
|
+
/** The planned actions, in the order `compose up` would perform them. */
|
|
52
|
+
readonly actions: readonly DryRunAction[];
|
|
53
|
+
/** The memory, in bytes, of the machines the plan would start: those it creates, recreates or starts. */
|
|
54
|
+
readonly memoryRequiredBytes: number;
|
|
55
|
+
/** The host's free memory, in bytes, less `hostReserveMiB`. */
|
|
56
|
+
readonly memoryAvailableBytes: number;
|
|
57
|
+
}
|
|
58
|
+
/** The result of `compose stop`, `compose start` and `compose restart`: the machines acted on, in the order they were acted on, and the warnings for the caller. */
|
|
59
|
+
export interface FleetMachinesResult {
|
|
60
|
+
/** The fleet name. */
|
|
61
|
+
readonly fleet: string;
|
|
62
|
+
/** The machines stopped, started or restarted, in order. */
|
|
63
|
+
readonly machines: readonly string[];
|
|
64
|
+
/** The warnings, in Docker Compose's words where Docker Compose has them. */
|
|
65
|
+
readonly warnings: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
/** One private network of a fleet: the Hyper-V switch that carries it, its address range and each machine's address on it. */
|
|
68
|
+
export interface FleetNetworkDetail {
|
|
69
|
+
/** The network's key in the Compose model, for example `backend`. */
|
|
70
|
+
readonly key: string;
|
|
71
|
+
/** The network's name: its `name` in the Compose model, or else `<fleet>_<key>`. */
|
|
72
|
+
readonly name: string;
|
|
73
|
+
/** The name of the private Hyper-V switch. */
|
|
74
|
+
readonly switchName: string;
|
|
75
|
+
/** Hyper-V's identifier of the switch. */
|
|
76
|
+
readonly switchId: string;
|
|
77
|
+
/** The address range in CIDR form, for example `10.231.0.0/24`. */
|
|
78
|
+
readonly subnet: string;
|
|
79
|
+
/** Whether the network is internal: its machines have no card on the host's internet switch. */
|
|
80
|
+
readonly internal: boolean;
|
|
81
|
+
/** The IPv4 address of each machine on the network, by machine name. */
|
|
82
|
+
readonly addresses: Readonly<Record<string, string>>;
|
|
83
|
+
}
|
|
84
|
+
/** One fleet as `endia compose ls` lists it: its name, how many of its machines are in each state, and the Compose files its last `compose up` came from. */
|
|
85
|
+
export interface FleetSummary {
|
|
86
|
+
/** The fleet name, which is the Compose project name. */
|
|
87
|
+
readonly name: string;
|
|
88
|
+
/** The number of machines in each state, as Docker Compose words it: each state with its count in brackets, the states sorted by name and joined by a comma and a space, such as `exited(1), running(3)`; empty for a fleet without machines. A listing that does not ask for every fleet counts only running and restarting machines. */
|
|
89
|
+
readonly status: string;
|
|
90
|
+
/** The paths of the Compose files as the CLI sent them with the last `compose up`. */
|
|
91
|
+
readonly configFiles: readonly string[];
|
|
92
|
+
/** What the fleet is being used for, or null when it has no purpose. */
|
|
93
|
+
readonly purpose: PurposeSummary | null;
|
|
94
|
+
}
|
|
95
|
+
/** What `compose up` did, as its operation's result: each machine, network and volume of the fleet with what was done to it, and the warnings for the caller. */
|
|
96
|
+
export interface FleetUpResult {
|
|
97
|
+
/** The fleet name. */
|
|
98
|
+
readonly fleet: string;
|
|
99
|
+
/** Each machine the plan acted on or kept, in the order of the plan. */
|
|
100
|
+
readonly machines: readonly MachineOutcome[];
|
|
101
|
+
/** Each network the selected services join, in the order the project declares them. */
|
|
102
|
+
readonly networks: readonly NetworkOutcome[];
|
|
103
|
+
/** Each named volume the selected services mount, in the order the project declares them. */
|
|
104
|
+
readonly volumes: readonly VolumeOutcome[];
|
|
105
|
+
/** The warnings, in Docker Compose's words where Docker Compose has them, such as the list of orphan machines. */
|
|
106
|
+
readonly warnings: readonly string[];
|
|
107
|
+
}
|
|
108
|
+
/** One machine in the result of `compose up`: what was done to it, and its state and health once the operation finished. */
|
|
109
|
+
export interface MachineOutcome {
|
|
110
|
+
/** The machine name, such as `classroom-trainee-2`. */
|
|
111
|
+
readonly name: string;
|
|
112
|
+
/** The machine's service. */
|
|
113
|
+
readonly service: string;
|
|
114
|
+
/** What was done: `created`, `recreated`, `started`, `removed` or `unchanged`. */
|
|
115
|
+
readonly action: string;
|
|
116
|
+
/** The machine's state as its record holds it, such as `running`; `removed` for a machine that no longer exists. */
|
|
117
|
+
readonly state: string;
|
|
118
|
+
/** The machine's health: `none`, `starting`, `healthy` or `unhealthy`. */
|
|
119
|
+
readonly health: string;
|
|
120
|
+
}
|
|
121
|
+
/** One network in the result of `compose up`: its name, its subnet and whether this run created it. */
|
|
122
|
+
export interface NetworkOutcome {
|
|
123
|
+
/** The network's name, such as `classroom_classroom`. */
|
|
124
|
+
readonly name: string;
|
|
125
|
+
/** The subnet in CIDR form, such as `10.231.10.0/24`. */
|
|
126
|
+
readonly subnet: string;
|
|
127
|
+
/** `created` or `unchanged`. */
|
|
128
|
+
readonly action: string;
|
|
129
|
+
}
|
|
130
|
+
/** One named volume in the result of `compose up`: its name and whether this run created its disk. */
|
|
131
|
+
export interface VolumeOutcome {
|
|
132
|
+
/** The volume's name, such as `classroom_server-data`. */
|
|
133
|
+
readonly name: string;
|
|
134
|
+
/** `created` or `unchanged`. */
|
|
135
|
+
readonly action: string;
|
|
136
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { Timestamp } from "./common.js";
|
|
2
|
+
/** One image in the list that `endia images` prints. Members that Docker's API also gives an image in its list, such as `id`, `repoTags` and `parentId`, carry Docker's names, so that a `--format` template written for Docker reads the same fields. */
|
|
3
|
+
export interface ImageSummary {
|
|
4
|
+
/** The image's digest, `sha256:` and 64 hexadecimal digits, which is its ID. */
|
|
5
|
+
readonly id: string;
|
|
6
|
+
/** Every tag that names the image, in full `name:tag` form, sorted; empty for an image without tags. */
|
|
7
|
+
readonly repoTags: readonly string[];
|
|
8
|
+
/** The digest of the image this one is built on; null for an imported image, which has no parent. */
|
|
9
|
+
readonly parentId: string | null;
|
|
10
|
+
/** When the image was recorded. */
|
|
11
|
+
readonly created: Timestamp;
|
|
12
|
+
/** The size in bytes of the image's own disk file, not counting the disks of the images it is built on. */
|
|
13
|
+
readonly size: number;
|
|
14
|
+
/** The image's labels, by name. */
|
|
15
|
+
readonly labels: Readonly<Record<string, string>>;
|
|
16
|
+
/** The start, at midnight UTC, of the day on which the image's evaluation edition of Windows expires; null when the image is not an evaluation edition. */
|
|
17
|
+
readonly evaluationExpires: Timestamp | null;
|
|
18
|
+
/** Whether the expiry date is fewer than `evaluationWarningDays` days away or has passed, so that the image needs a warning. */
|
|
19
|
+
readonly expiryWarning: boolean;
|
|
20
|
+
/** The number of machines made from the image. */
|
|
21
|
+
readonly machines: number;
|
|
22
|
+
/** The number of images built on the image. */
|
|
23
|
+
readonly children: number;
|
|
24
|
+
}
|
|
25
|
+
/** Everything that `endia image inspect` shows about one image: its tags, the chain of parents it is built on, its configuration and labels, its disk, the recipe and arguments that built it, and the machines and images that depend on it. Members that Docker's image inspect also gives, such as `id`, `repoTags`, `os` and `config`, carry Docker's names, so that a `--format` template written for Docker, such as `{{.Id}}`, reads the same fields. */
|
|
26
|
+
export interface ImageDetail {
|
|
27
|
+
/** The image's digest, `sha256:` and 64 hexadecimal digits, which is its ID. */
|
|
28
|
+
readonly id: string;
|
|
29
|
+
/** Every tag that names the image, in full `name:tag` form, sorted; empty for an image without tags. */
|
|
30
|
+
readonly repoTags: readonly string[];
|
|
31
|
+
/** The digest of the image this one is built on; null for an imported image, which has no parent. */
|
|
32
|
+
readonly parentId: string | null;
|
|
33
|
+
/** When the image was recorded. */
|
|
34
|
+
readonly created: Timestamp;
|
|
35
|
+
/** The operating system that machines made from the image run: always `windows`. */
|
|
36
|
+
readonly os: string;
|
|
37
|
+
/** The processor architecture, as Docker names it: always `amd64`. */
|
|
38
|
+
readonly architecture: string;
|
|
39
|
+
/** The size in bytes of the image's own disk file, not counting the disks of the images it is built on. */
|
|
40
|
+
readonly size: number;
|
|
41
|
+
/** The configuration that machines made from the image, and images built on it, inherit; null when the image's record holds no configuration, which is the case only for a record written before image records kept it. */
|
|
42
|
+
readonly config: ImageConfigDetail | null;
|
|
43
|
+
/** The image's labels, by name. */
|
|
44
|
+
readonly labels: Readonly<Record<string, string>>;
|
|
45
|
+
/** The digests of the images this one is built on: its parent first, then the parent's parent, up to the imported image. Empty for an imported image. */
|
|
46
|
+
readonly chain: readonly string[];
|
|
47
|
+
/** The image's disk file: where it is, and how it came to be in the image folder. */
|
|
48
|
+
readonly disk: ImageDiskDetail;
|
|
49
|
+
/** The build key, a SHA-256 hash of everything that decided the build's result; null for an imported image. */
|
|
50
|
+
readonly buildKey: string | null;
|
|
51
|
+
/** The recipe and build arguments that built the image; null for an imported image. */
|
|
52
|
+
readonly build: ImageBuildDetail | null;
|
|
53
|
+
/** The names of the machines made from the image, sorted. */
|
|
54
|
+
readonly machines: readonly string[];
|
|
55
|
+
/** The digests of the images whose parent is this image. */
|
|
56
|
+
readonly children: readonly string[];
|
|
57
|
+
}
|
|
58
|
+
/** The configuration of an image as `endia image inspect` shows it: what a machine made from the image, and an image built on it, inherit from its recipe and its parents' recipes. */
|
|
59
|
+
export interface ImageConfigDetail {
|
|
60
|
+
/** The environment variables, each written `NAME=value`, ordered by name. */
|
|
61
|
+
readonly env: readonly string[];
|
|
62
|
+
/** The default arguments, or null when none are set since the last entry point. */
|
|
63
|
+
readonly cmd: readonly string[] | null;
|
|
64
|
+
/** The entry point, or null when none is set. */
|
|
65
|
+
readonly entrypoint: readonly string[] | null;
|
|
66
|
+
/** The working directory with `/` separators, such as `C:/app`, or empty when none is set. */
|
|
67
|
+
readonly workingDir: string;
|
|
68
|
+
/** The account programs run as, or empty when none is set. */
|
|
69
|
+
readonly user: string;
|
|
70
|
+
/** The exposed ports, each written `number/protocol` such as `8080/tcp`. */
|
|
71
|
+
readonly exposedPorts: readonly string[];
|
|
72
|
+
/** The shell that runs shell-form commands, the executable first, or empty when none is set. */
|
|
73
|
+
readonly shell: readonly string[];
|
|
74
|
+
}
|
|
75
|
+
/** An image's disk file as `endia image inspect` shows it: its path, and how it came to be in the image folder. */
|
|
76
|
+
export interface ImageDiskDetail {
|
|
77
|
+
/** The full path of the disk file in the image folder. */
|
|
78
|
+
readonly path: string;
|
|
79
|
+
/** How the disk file came to be in the image folder: `built` when a build made it, or, for an imported image, `copied`, `moved` or `inPlace`, the last when the file was already in the image folder and was used where it was. Null for an imported image whose record was written before image records kept how the disk came in. */
|
|
80
|
+
readonly broughtIn: string | null;
|
|
81
|
+
}
|
|
82
|
+
/** What built an image, as `endia image inspect` shows it: the recipe's text and the build arguments it was built with. */
|
|
83
|
+
export interface ImageBuildDetail {
|
|
84
|
+
/** The text of the recipe. */
|
|
85
|
+
readonly recipe: string;
|
|
86
|
+
/** The build arguments, by name. */
|
|
87
|
+
readonly buildArgs: Readonly<Record<string, string>>;
|
|
88
|
+
}
|
|
89
|
+
/** The answer to `endia tag`: the tag that was set, the image it names now and the image it named before. */
|
|
90
|
+
export interface TagResult {
|
|
91
|
+
/** The tag that was set, the `TARGET_IMAGE[:TAG]` argument of `endia tag`. */
|
|
92
|
+
readonly target: string;
|
|
93
|
+
/** The digest of the image that the tag now names. */
|
|
94
|
+
readonly digest: string;
|
|
95
|
+
/** The digest of the image that the tag named before; null when the tag is new. */
|
|
96
|
+
readonly previousDigest: string | null;
|
|
97
|
+
}
|
|
98
|
+
/** One event of `endia rmi`, as `docker rmi` answers: a tag that was removed, written `{ "untagged": tag }`, or an image that was deleted, written `{ "deleted": digest }`. The answer lists the events in the order they happened, so the removal of an image's last tag comes before the deletion it led to. */
|
|
99
|
+
export interface RemovalEntry {
|
|
100
|
+
/** The tag that was removed, in the form `name:tag`, or null when the event is a deletion. */
|
|
101
|
+
readonly untagged?: string | null;
|
|
102
|
+
/** The digest of the image that was deleted, or null when the event is a removed tag. */
|
|
103
|
+
readonly deleted?: string | null;
|
|
104
|
+
}
|
|
105
|
+
/** The result of a finished build: the image it made or reused for its target stage, the tags that now name that image, whether anything was built, and what each stage on the way to the target gave. */
|
|
106
|
+
export interface BuildResult {
|
|
107
|
+
/** The digest of the image, in the form `sha256:` followed by 64 hexadecimal digits. */
|
|
108
|
+
readonly digest: string;
|
|
109
|
+
/** The tags that were requested, each of which now names the image; empty when the build asked for none. */
|
|
110
|
+
readonly tags: readonly string[];
|
|
111
|
+
/** The target stage's build key: a SHA-256 hash of everything that decides its result. A later build with the same key reuses this image. */
|
|
112
|
+
readonly buildKey: string;
|
|
113
|
+
/** Whether every stage was found in the cache, so that nothing was built. */
|
|
114
|
+
readonly cacheHit: boolean;
|
|
115
|
+
/** How long the build took, in seconds, from the start of the operation's work to the last tag moved. */
|
|
116
|
+
readonly seconds: number;
|
|
117
|
+
/** Each stage the build made or found, from the lowest, built on an image, to the target. A recipe of one stage gives one. A service older than multi-stage builds leaves it out. */
|
|
118
|
+
readonly stages?: readonly BuildStageResult[];
|
|
119
|
+
}
|
|
120
|
+
/** What one stage of a build gave: the image, for the target stage, or a build-cache entry, for a stage below it. A stage is the part of a recipe from one `FROM` to the next; a build-cache entry is a stage's committed result that is not an image, which a later build whose stage has the same build key reuses. */
|
|
121
|
+
export interface BuildStageResult {
|
|
122
|
+
/** The name that the stage's `FROM ... AS` gives it, in lower case, or null for a stage without one. */
|
|
123
|
+
readonly name: string | null;
|
|
124
|
+
/** The digest of the stage's result, in the form `sha256:` followed by 64 hexadecimal digits. */
|
|
125
|
+
readonly digest: string;
|
|
126
|
+
/** The stage's build key: a SHA-256 hash of everything that decides the stage's result. */
|
|
127
|
+
readonly buildKey: string;
|
|
128
|
+
/** Whether an image or build-cache entry with the stage's build key already existed, so that the stage was not built. */
|
|
129
|
+
readonly cacheHit: boolean;
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|