@hallmaster/docker.js 0.0.9 → 0.0.11
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/DockerContainer.d.ts +5 -6
- package/dist/DockerContainer.js +1 -1
- package/dist/DockerSocket.d.ts +2 -3
- package/dist/DockerSocket.js +0 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.js +2 -19
- package/dist/types/DockerAuthToken.d.ts +4 -0
- package/dist/types/DockerAuthToken.js +1 -0
- package/dist/types/DockerContainer.d.ts +381 -0
- package/dist/types/DockerContainer.js +1 -0
- package/dist/types/DockerContainerStats.d.ts +129 -0
- package/dist/types/DockerContainerStats.js +1 -0
- package/dist/types/DockerContainerSummary.d.ts +78 -0
- package/dist/types/DockerContainerSummary.js +1 -0
- package/dist/types/DockerContainerTop.d.ts +10 -0
- package/dist/types/DockerContainerTop.js +1 -0
- package/dist/types/DockerInfo.d.ts +130 -0
- package/dist/types/DockerInfo.js +1 -0
- package/dist/types/DockerVersion.d.ts +32 -0
- package/dist/types/DockerVersion.js +1 -0
- package/package.json +2 -1
- package/dist/DockerContainer.d.ts.map +0 -1
- package/dist/DockerSocket.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import DockerSocket from "./DockerSocket";
|
|
2
|
-
import type { DockerContainerStats } from "./types/DockerContainerStats";
|
|
3
|
-
import type {
|
|
4
|
-
import type { DockerContainerTop } from "./types/DockerContainerTop";
|
|
1
|
+
import DockerSocket from "./DockerSocket.js";
|
|
2
|
+
import type { DockerContainerStats } from "./types/DockerContainerStats.js";
|
|
3
|
+
import type { DockerContainerSummary } from "./types/DockerContainerSummary.js";
|
|
4
|
+
import type { DockerContainerTop } from "./types/DockerContainerTop.js";
|
|
5
5
|
export default class DockerContainer {
|
|
6
6
|
private readonly dockerSocket;
|
|
7
7
|
constructor(dockerSocket: DockerSocket);
|
|
@@ -10,7 +10,7 @@ export default class DockerContainer {
|
|
|
10
10
|
limit?: number;
|
|
11
11
|
size?: boolean;
|
|
12
12
|
filters?: Record<string, string[]>;
|
|
13
|
-
}): Promise<
|
|
13
|
+
}): Promise<DockerContainerSummary>;
|
|
14
14
|
get(containerId: string, size?: boolean): Promise<DockerContainer>;
|
|
15
15
|
top(containerId: string, psArgs?: string): Promise<DockerContainerTop>;
|
|
16
16
|
logs(containerId: string, options?: {
|
|
@@ -30,4 +30,3 @@ export default class DockerContainer {
|
|
|
30
30
|
oneShot?: boolean;
|
|
31
31
|
}): Promise<DockerContainerStats>;
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=DockerContainer.d.ts.map
|
package/dist/DockerContainer.js
CHANGED
package/dist/DockerSocket.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DockerVersion } from "./types/DockerVersion";
|
|
2
|
-
import type { DockerInfo } from "./types/DockerInfo";
|
|
1
|
+
import type { DockerVersion } from "./types/DockerVersion.js";
|
|
2
|
+
import type { DockerInfo } from "./types/DockerInfo.js";
|
|
3
3
|
export default class DockerSocket {
|
|
4
4
|
private readonly apiBaseURL;
|
|
5
5
|
private dockerSocketPath;
|
|
@@ -19,4 +19,3 @@ export default class DockerSocket {
|
|
|
19
19
|
authenticate(serverAddress: string, username: string, password: string): Promise<void>;
|
|
20
20
|
info(): Promise<DockerInfo>;
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=DockerSocket.d.ts.map
|
package/dist/DockerSocket.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
|
|
1
|
+
export type { DockerAuthToken } from "./types/DockerAuthToken.js";
|
|
2
|
+
export type { DockerContainer } from "./types/DockerContainer.js";
|
|
3
|
+
export type { DockerContainerStats } from "./types/DockerContainerStats.js";
|
|
4
|
+
export type { DockerContainerSummary } from "./types/DockerContainerSummary.js";
|
|
5
|
+
export type { DockerContainerTop } from "./types/DockerContainerTop.js";
|
|
6
|
+
export type { DockerInfo } from "./types/DockerInfo.js";
|
|
7
|
+
export type { DockerVersion } from "./types/DockerVersion.js";
|
|
8
|
+
export * from "./DockerSocket.js";
|
|
9
|
+
export * from "./DockerContainer.js";
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
(async function () {
|
|
4
|
-
const socket = new DockerSocket();
|
|
5
|
-
await socket.init();
|
|
6
|
-
// await socket.authenticate(
|
|
7
|
-
// "ghcr.io",
|
|
8
|
-
// "github_username",
|
|
9
|
-
// "github_pat",
|
|
10
|
-
// );
|
|
11
|
-
// console.log(socket.token);
|
|
12
|
-
// console.log(await socket.info());
|
|
13
|
-
const containersApi = new DockerContainer(socket);
|
|
14
|
-
const containersSummary = await containersApi.stats("XXX", {
|
|
15
|
-
stream: false,
|
|
16
|
-
oneShot: true,
|
|
17
|
-
});
|
|
18
|
-
console.log(containersSummary);
|
|
19
|
-
})();
|
|
1
|
+
export * from "./DockerSocket.js";
|
|
2
|
+
export * from "./DockerContainer.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
export interface DockerContainer {
|
|
2
|
+
Id: string;
|
|
3
|
+
Created: string;
|
|
4
|
+
Path: string;
|
|
5
|
+
Args: string[];
|
|
6
|
+
State: State;
|
|
7
|
+
Image: string;
|
|
8
|
+
ResolvConfPath: string;
|
|
9
|
+
HostnamePath: string;
|
|
10
|
+
HostsPath: string;
|
|
11
|
+
LogPath: string;
|
|
12
|
+
Name: string;
|
|
13
|
+
RestartCount: number;
|
|
14
|
+
Driver: string;
|
|
15
|
+
Platform: string;
|
|
16
|
+
ImageManifestDescriptor: ImageManifestDescriptor;
|
|
17
|
+
MountLabel: string;
|
|
18
|
+
ProcessLabel: string;
|
|
19
|
+
AppArmorProfile: string;
|
|
20
|
+
ExecIDs: string[];
|
|
21
|
+
HostConfig: HostConfig;
|
|
22
|
+
GraphDriver: GraphDriver;
|
|
23
|
+
SizeRw: number;
|
|
24
|
+
SizeRootFs: number;
|
|
25
|
+
Mounts: HostConfigMount[];
|
|
26
|
+
Config: Config;
|
|
27
|
+
NetworkSettings: NetworkSettings;
|
|
28
|
+
}
|
|
29
|
+
export interface State {
|
|
30
|
+
Status: string;
|
|
31
|
+
Running: boolean;
|
|
32
|
+
Paused: boolean;
|
|
33
|
+
Restarting: boolean;
|
|
34
|
+
OOMKilled: boolean;
|
|
35
|
+
Dead: boolean;
|
|
36
|
+
Pid: number;
|
|
37
|
+
ExitCode: number;
|
|
38
|
+
Error: string;
|
|
39
|
+
StartedAt: string;
|
|
40
|
+
FinishedAt: string;
|
|
41
|
+
Health: Health;
|
|
42
|
+
}
|
|
43
|
+
export interface Health {
|
|
44
|
+
Status: string;
|
|
45
|
+
FailingStreak: number;
|
|
46
|
+
Log: Log[];
|
|
47
|
+
}
|
|
48
|
+
export interface Log {
|
|
49
|
+
Start: string;
|
|
50
|
+
End: string;
|
|
51
|
+
ExitCode: number;
|
|
52
|
+
Output: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ImageManifestDescriptor {
|
|
55
|
+
mediaType: string;
|
|
56
|
+
digest: string;
|
|
57
|
+
size: number;
|
|
58
|
+
urls: string[];
|
|
59
|
+
annotations: Annotations;
|
|
60
|
+
data: any;
|
|
61
|
+
platform: Platform;
|
|
62
|
+
artifactType: any;
|
|
63
|
+
}
|
|
64
|
+
export interface Annotations extends Record<string, string> {
|
|
65
|
+
"com.docker.official-images.bashbrew.arch": string;
|
|
66
|
+
"org.opencontainers.image.base.digest": string;
|
|
67
|
+
"org.opencontainers.image.base.name": string;
|
|
68
|
+
"org.opencontainers.image.created": string;
|
|
69
|
+
"org.opencontainers.image.revision": string;
|
|
70
|
+
"org.opencontainers.image.source": string;
|
|
71
|
+
"org.opencontainers.image.url": string;
|
|
72
|
+
"org.opencontainers.image.version": string;
|
|
73
|
+
}
|
|
74
|
+
export interface Platform {
|
|
75
|
+
architecture: string;
|
|
76
|
+
os: string;
|
|
77
|
+
"os.version": string;
|
|
78
|
+
"os.features": string[];
|
|
79
|
+
variant: string;
|
|
80
|
+
}
|
|
81
|
+
export interface HostConfig {
|
|
82
|
+
CpuShares: number;
|
|
83
|
+
Memory: number;
|
|
84
|
+
CgroupParent: string;
|
|
85
|
+
BlkioWeight: number;
|
|
86
|
+
BlkioWeightDevice: BlkioWeightDevice[];
|
|
87
|
+
BlkioDeviceReadBps: BlkioDeviceReadBp[];
|
|
88
|
+
BlkioDeviceWriteBps: BlkioDeviceWriteBp[];
|
|
89
|
+
BlkioDeviceReadIOps: BlkioDeviceReadIop[];
|
|
90
|
+
BlkioDeviceWriteIOps: BlkioDeviceWriteIop[];
|
|
91
|
+
CpuPeriod: number;
|
|
92
|
+
CpuQuota: number;
|
|
93
|
+
CpuRealtimePeriod: number;
|
|
94
|
+
CpuRealtimeRuntime: number;
|
|
95
|
+
CpusetCpus: string;
|
|
96
|
+
CpusetMems: string;
|
|
97
|
+
Devices: Device[];
|
|
98
|
+
DeviceCgroupRules: string[];
|
|
99
|
+
DeviceRequests: DeviceRequest[];
|
|
100
|
+
KernelMemoryTCP: number;
|
|
101
|
+
MemoryReservation: number;
|
|
102
|
+
MemorySwap: number;
|
|
103
|
+
MemorySwappiness: number;
|
|
104
|
+
NanoCpus: number;
|
|
105
|
+
OomKillDisable: boolean;
|
|
106
|
+
Init: boolean;
|
|
107
|
+
PidsLimit: number;
|
|
108
|
+
Ulimits: Ulimit[];
|
|
109
|
+
CpuCount: number;
|
|
110
|
+
CpuPercent: number;
|
|
111
|
+
IOMaximumIOps: number;
|
|
112
|
+
IOMaximumBandwidth: number;
|
|
113
|
+
Binds: string[];
|
|
114
|
+
ContainerIDFile: string;
|
|
115
|
+
LogConfig: LogConfig;
|
|
116
|
+
NetworkMode: string;
|
|
117
|
+
PortBindings: PortBindings;
|
|
118
|
+
RestartPolicy: RestartPolicy;
|
|
119
|
+
AutoRemove: boolean;
|
|
120
|
+
VolumeDriver: string;
|
|
121
|
+
VolumesFrom: string[];
|
|
122
|
+
Mounts: HostConfigMount[];
|
|
123
|
+
ConsoleSize: number[];
|
|
124
|
+
Annotations: HostAnnotations;
|
|
125
|
+
CapAdd: string[];
|
|
126
|
+
CapDrop: string[];
|
|
127
|
+
CgroupnsMode: string;
|
|
128
|
+
Dns: string[];
|
|
129
|
+
DnsOptions: string[];
|
|
130
|
+
DnsSearch: string[];
|
|
131
|
+
ExtraHosts: string[];
|
|
132
|
+
GroupAdd: string[];
|
|
133
|
+
IpcMode: string;
|
|
134
|
+
Cgroup: string;
|
|
135
|
+
Links: string[];
|
|
136
|
+
OomScoreAdj: number;
|
|
137
|
+
PidMode: string;
|
|
138
|
+
Privileged: boolean;
|
|
139
|
+
PublishAllPorts: boolean;
|
|
140
|
+
ReadonlyRootfs: boolean;
|
|
141
|
+
SecurityOpt: string[];
|
|
142
|
+
StorageOpt: StorageOptions;
|
|
143
|
+
Tmpfs: Tmpfs;
|
|
144
|
+
UTSMode: string;
|
|
145
|
+
UsernsMode: string;
|
|
146
|
+
ShmSize: number;
|
|
147
|
+
Sysctls: Sysctls;
|
|
148
|
+
Runtime: string;
|
|
149
|
+
Isolation: string;
|
|
150
|
+
MaskedPaths: string[];
|
|
151
|
+
ReadonlyPaths: string[];
|
|
152
|
+
}
|
|
153
|
+
export interface BlkioWeightDevice {
|
|
154
|
+
Path: string;
|
|
155
|
+
Weight: number;
|
|
156
|
+
}
|
|
157
|
+
export interface BlkioDeviceReadBp {
|
|
158
|
+
Path: string;
|
|
159
|
+
Rate: number;
|
|
160
|
+
}
|
|
161
|
+
export interface BlkioDeviceWriteBp {
|
|
162
|
+
Path: string;
|
|
163
|
+
Rate: number;
|
|
164
|
+
}
|
|
165
|
+
export interface BlkioDeviceReadIop {
|
|
166
|
+
Path: string;
|
|
167
|
+
Rate: number;
|
|
168
|
+
}
|
|
169
|
+
export interface BlkioDeviceWriteIop {
|
|
170
|
+
Path: string;
|
|
171
|
+
Rate: number;
|
|
172
|
+
}
|
|
173
|
+
export interface Device {
|
|
174
|
+
PathOnHost: string;
|
|
175
|
+
PathInContainer: string;
|
|
176
|
+
CgroupPermissions: string;
|
|
177
|
+
}
|
|
178
|
+
export interface DeviceRequest {
|
|
179
|
+
Driver: string;
|
|
180
|
+
Count: number;
|
|
181
|
+
DeviceIDs: string[];
|
|
182
|
+
Capabilities: string[][];
|
|
183
|
+
Options: Options;
|
|
184
|
+
}
|
|
185
|
+
export interface Options extends Record<string, string> {
|
|
186
|
+
}
|
|
187
|
+
export interface Ulimit {
|
|
188
|
+
Name: string;
|
|
189
|
+
Soft: number;
|
|
190
|
+
Hard: number;
|
|
191
|
+
}
|
|
192
|
+
export interface LogConfig {
|
|
193
|
+
Type: string;
|
|
194
|
+
Config: LogConfigInternal;
|
|
195
|
+
}
|
|
196
|
+
export interface LogConfigInternal {
|
|
197
|
+
"max-file": string;
|
|
198
|
+
"max-size": string;
|
|
199
|
+
}
|
|
200
|
+
export interface PortBindings extends Record<string, string> {
|
|
201
|
+
}
|
|
202
|
+
export interface PortBinding {
|
|
203
|
+
HostIp: string;
|
|
204
|
+
HostPort: string;
|
|
205
|
+
}
|
|
206
|
+
export interface RestartPolicy {
|
|
207
|
+
Name: string;
|
|
208
|
+
MaximumRetryCount: number;
|
|
209
|
+
}
|
|
210
|
+
export interface HostConfigMount {
|
|
211
|
+
Target: string;
|
|
212
|
+
Source: string;
|
|
213
|
+
Type: string;
|
|
214
|
+
ReadOnly: boolean;
|
|
215
|
+
Consistency: string;
|
|
216
|
+
BindOptions: BindOptions;
|
|
217
|
+
VolumeOptions: VolumeOptions;
|
|
218
|
+
ImageOptions: ImageOptions;
|
|
219
|
+
TmpfsOptions: TmpfsOptions;
|
|
220
|
+
}
|
|
221
|
+
export interface BindOptions {
|
|
222
|
+
Propagation: string;
|
|
223
|
+
NonRecursive: boolean;
|
|
224
|
+
CreateMountpoint: boolean;
|
|
225
|
+
ReadOnlyNonRecursive: boolean;
|
|
226
|
+
ReadOnlyForceRecursive: boolean;
|
|
227
|
+
}
|
|
228
|
+
export interface VolumeOptions {
|
|
229
|
+
NoCopy: boolean;
|
|
230
|
+
Labels: VolumeOptionsLabels;
|
|
231
|
+
DriverConfig: DriverConfig;
|
|
232
|
+
Subpath: string;
|
|
233
|
+
}
|
|
234
|
+
export interface VolumeOptionsLabels extends Record<string, string> {
|
|
235
|
+
}
|
|
236
|
+
export interface DriverConfig {
|
|
237
|
+
Name: string;
|
|
238
|
+
Options: DriverConfigOptions;
|
|
239
|
+
}
|
|
240
|
+
export interface DriverConfigOptions extends Record<string, string> {
|
|
241
|
+
}
|
|
242
|
+
export interface ImageOptions {
|
|
243
|
+
Subpath: string;
|
|
244
|
+
}
|
|
245
|
+
export interface TmpfsOptions {
|
|
246
|
+
SizeBytes: number;
|
|
247
|
+
Mode: number;
|
|
248
|
+
Options: string[][];
|
|
249
|
+
}
|
|
250
|
+
export interface HostAnnotations extends Record<string, string> {
|
|
251
|
+
}
|
|
252
|
+
export interface StorageOptions extends Record<string, string> {
|
|
253
|
+
}
|
|
254
|
+
export interface Tmpfs extends Record<string, string> {
|
|
255
|
+
}
|
|
256
|
+
export interface Sysctls extends Record<string, string> {
|
|
257
|
+
}
|
|
258
|
+
export interface GraphDriver {
|
|
259
|
+
Name: string;
|
|
260
|
+
Data: Data;
|
|
261
|
+
}
|
|
262
|
+
export interface Data {
|
|
263
|
+
MergedDir: string;
|
|
264
|
+
UpperDir: string;
|
|
265
|
+
WorkDir: string;
|
|
266
|
+
}
|
|
267
|
+
export interface HostConfigMount {
|
|
268
|
+
Type: string;
|
|
269
|
+
Name: string;
|
|
270
|
+
Source: string;
|
|
271
|
+
Destination: string;
|
|
272
|
+
Driver: string;
|
|
273
|
+
Mode: string;
|
|
274
|
+
RW: boolean;
|
|
275
|
+
Propagation: string;
|
|
276
|
+
}
|
|
277
|
+
export interface Config {
|
|
278
|
+
Hostname: string;
|
|
279
|
+
Domainname: string;
|
|
280
|
+
User: string;
|
|
281
|
+
AttachStdin: boolean;
|
|
282
|
+
AttachStdout: boolean;
|
|
283
|
+
AttachStderr: boolean;
|
|
284
|
+
ExposedPorts: ExposedPorts;
|
|
285
|
+
Tty: boolean;
|
|
286
|
+
OpenStdin: boolean;
|
|
287
|
+
StdinOnce: boolean;
|
|
288
|
+
Env: string[];
|
|
289
|
+
Cmd: string[];
|
|
290
|
+
Healthcheck: Healthcheck;
|
|
291
|
+
ArgsEscaped: boolean;
|
|
292
|
+
Image: string;
|
|
293
|
+
Volumes: Volumes;
|
|
294
|
+
WorkingDir: string;
|
|
295
|
+
Entrypoint: any[];
|
|
296
|
+
NetworkDisabled: boolean;
|
|
297
|
+
MacAddress: string;
|
|
298
|
+
OnBuild: any[];
|
|
299
|
+
Labels: ConfigLabels;
|
|
300
|
+
StopSignal: string;
|
|
301
|
+
StopTimeout: number;
|
|
302
|
+
Shell: string[];
|
|
303
|
+
}
|
|
304
|
+
export interface ExposedPorts extends Record<string, ExposedPort> {
|
|
305
|
+
}
|
|
306
|
+
export interface ExposedPort {
|
|
307
|
+
}
|
|
308
|
+
export interface Healthcheck {
|
|
309
|
+
Test: string[];
|
|
310
|
+
Interval: number;
|
|
311
|
+
Timeout: number;
|
|
312
|
+
Retries: number;
|
|
313
|
+
StartPeriod: number;
|
|
314
|
+
StartInterval: number;
|
|
315
|
+
}
|
|
316
|
+
export interface Volumes extends Record<string, VolumeAdditionalProp> {
|
|
317
|
+
}
|
|
318
|
+
export interface VolumeAdditionalProp {
|
|
319
|
+
}
|
|
320
|
+
export interface ConfigLabels extends Record<string, string> {
|
|
321
|
+
}
|
|
322
|
+
export interface NetworkSettings {
|
|
323
|
+
Bridge: string;
|
|
324
|
+
SandboxID: string;
|
|
325
|
+
HairpinMode: boolean;
|
|
326
|
+
LinkLocalIPv6Address: string;
|
|
327
|
+
LinkLocalIPv6PrefixLen: string;
|
|
328
|
+
Ports: Ports;
|
|
329
|
+
SandboxKey: string;
|
|
330
|
+
SecondaryIPAddresses: SecondaryIpaddress[];
|
|
331
|
+
SecondaryIPv6Addresses: SecondaryIpv6Address[];
|
|
332
|
+
EndpointID: string;
|
|
333
|
+
Gateway: string;
|
|
334
|
+
GlobalIPv6Address: string;
|
|
335
|
+
GlobalIPv6PrefixLen: number;
|
|
336
|
+
IPAddress: string;
|
|
337
|
+
IPPrefixLen: number;
|
|
338
|
+
IPv6Gateway: string;
|
|
339
|
+
MacAddress: string;
|
|
340
|
+
Networks: Networks;
|
|
341
|
+
}
|
|
342
|
+
export interface Ports extends Record<string, Port[]> {
|
|
343
|
+
}
|
|
344
|
+
export interface Port {
|
|
345
|
+
HostIp: string;
|
|
346
|
+
HostPort: string;
|
|
347
|
+
}
|
|
348
|
+
export interface SecondaryIpaddress {
|
|
349
|
+
Addr: string;
|
|
350
|
+
PrefixLen: number;
|
|
351
|
+
}
|
|
352
|
+
export interface SecondaryIpv6Address {
|
|
353
|
+
Addr: string;
|
|
354
|
+
PrefixLen: number;
|
|
355
|
+
}
|
|
356
|
+
export interface Networks extends Record<string, Network> {
|
|
357
|
+
}
|
|
358
|
+
export interface Network {
|
|
359
|
+
IPAMConfig: Ipamconfig;
|
|
360
|
+
Links: string[];
|
|
361
|
+
MacAddress: string;
|
|
362
|
+
Aliases: string[];
|
|
363
|
+
DriverOpts: DriverOpts;
|
|
364
|
+
GwPriority: number[];
|
|
365
|
+
NetworkID: string;
|
|
366
|
+
EndpointID: string;
|
|
367
|
+
Gateway: string;
|
|
368
|
+
IPAddress: string;
|
|
369
|
+
IPPrefixLen: number;
|
|
370
|
+
IPv6Gateway: string;
|
|
371
|
+
GlobalIPv6Address: string;
|
|
372
|
+
GlobalIPv6PrefixLen: number;
|
|
373
|
+
DNSNames: string[];
|
|
374
|
+
}
|
|
375
|
+
export interface Ipamconfig {
|
|
376
|
+
IPv4Address: string;
|
|
377
|
+
IPv6Address: string;
|
|
378
|
+
LinkLocalIPs: string[];
|
|
379
|
+
}
|
|
380
|
+
export interface DriverOpts extends Record<string, string> {
|
|
381
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export interface DockerContainerStats {
|
|
2
|
+
name: string;
|
|
3
|
+
id: string;
|
|
4
|
+
read: string;
|
|
5
|
+
preread: string;
|
|
6
|
+
pids_stats: PidsStats;
|
|
7
|
+
blkio_stats: BlkioStats;
|
|
8
|
+
num_procs: number;
|
|
9
|
+
storage_stats: StorageStats;
|
|
10
|
+
cpu_stats: CpuStats;
|
|
11
|
+
precpu_stats: PrecpuStats;
|
|
12
|
+
memory_stats: MemoryStats;
|
|
13
|
+
networks: Networks;
|
|
14
|
+
}
|
|
15
|
+
export interface PidsStats {
|
|
16
|
+
current: number;
|
|
17
|
+
limit: number;
|
|
18
|
+
}
|
|
19
|
+
export interface BlkioStats {
|
|
20
|
+
io_service_bytes_recursive: IoServiceBytesRecursive[];
|
|
21
|
+
io_serviced_recursive: any;
|
|
22
|
+
io_queue_recursive: any;
|
|
23
|
+
io_service_time_recursive: any;
|
|
24
|
+
io_wait_time_recursive: any;
|
|
25
|
+
io_merged_recursive: any;
|
|
26
|
+
io_time_recursive: any;
|
|
27
|
+
sectors_recursive: any;
|
|
28
|
+
}
|
|
29
|
+
export interface IoServiceBytesRecursive {
|
|
30
|
+
major: number;
|
|
31
|
+
minor: number;
|
|
32
|
+
op: string;
|
|
33
|
+
value: number;
|
|
34
|
+
}
|
|
35
|
+
export interface StorageStats {
|
|
36
|
+
read_count_normalized: number;
|
|
37
|
+
read_size_bytes: number;
|
|
38
|
+
write_count_normalized: number;
|
|
39
|
+
write_size_bytes: number;
|
|
40
|
+
}
|
|
41
|
+
export interface CpuStats {
|
|
42
|
+
cpu_usage: CpuUsage;
|
|
43
|
+
system_cpu_usage: number;
|
|
44
|
+
online_cpus: number;
|
|
45
|
+
throttling_data: ThrottlingData;
|
|
46
|
+
}
|
|
47
|
+
export interface CpuUsage {
|
|
48
|
+
total_usage: number;
|
|
49
|
+
percpu_usage: number[];
|
|
50
|
+
usage_in_kernelmode: number;
|
|
51
|
+
usage_in_usermode: number;
|
|
52
|
+
}
|
|
53
|
+
export interface ThrottlingData {
|
|
54
|
+
periods: number;
|
|
55
|
+
throttled_periods: number;
|
|
56
|
+
throttled_time: number;
|
|
57
|
+
}
|
|
58
|
+
export interface PrecpuStats {
|
|
59
|
+
cpu_usage: PrecpuStatsCpuUsage;
|
|
60
|
+
system_cpu_usage: number;
|
|
61
|
+
online_cpus: number;
|
|
62
|
+
throttling_data: PrecpuStatsThrottlingData;
|
|
63
|
+
}
|
|
64
|
+
export interface PrecpuStatsCpuUsage {
|
|
65
|
+
total_usage: number;
|
|
66
|
+
percpu_usage: number[];
|
|
67
|
+
usage_in_kernelmode: number;
|
|
68
|
+
usage_in_usermode: number;
|
|
69
|
+
}
|
|
70
|
+
export interface PrecpuStatsThrottlingData {
|
|
71
|
+
periods: number;
|
|
72
|
+
throttled_periods: number;
|
|
73
|
+
throttled_time: number;
|
|
74
|
+
}
|
|
75
|
+
export interface MemoryStats {
|
|
76
|
+
usage: number;
|
|
77
|
+
max_usage: number;
|
|
78
|
+
stats: Stats;
|
|
79
|
+
failcnt: number;
|
|
80
|
+
limit: number;
|
|
81
|
+
commitbytes: number;
|
|
82
|
+
commitpeakbytes: number;
|
|
83
|
+
privateworkingset: number;
|
|
84
|
+
}
|
|
85
|
+
export interface Stats {
|
|
86
|
+
active_anon: number;
|
|
87
|
+
active_file: number;
|
|
88
|
+
anon: number;
|
|
89
|
+
anon_thp: number;
|
|
90
|
+
file: number;
|
|
91
|
+
file_dirty: number;
|
|
92
|
+
file_mapped: number;
|
|
93
|
+
file_writeback: number;
|
|
94
|
+
inactive_anon: number;
|
|
95
|
+
inactive_file: number;
|
|
96
|
+
kernel_stack: number;
|
|
97
|
+
pgactivate: number;
|
|
98
|
+
pgdeactivate: number;
|
|
99
|
+
pgfault: number;
|
|
100
|
+
pglazyfree: number;
|
|
101
|
+
pglazyfreed: number;
|
|
102
|
+
pgmajfault: number;
|
|
103
|
+
pgrefill: number;
|
|
104
|
+
pgscan: number;
|
|
105
|
+
pgsteal: number;
|
|
106
|
+
shmem: number;
|
|
107
|
+
slab: number;
|
|
108
|
+
slab_reclaimable: number;
|
|
109
|
+
slab_unreclaimable: number;
|
|
110
|
+
sock: number;
|
|
111
|
+
thp_collapse_alloc: number;
|
|
112
|
+
thp_fault_alloc: number;
|
|
113
|
+
unevictable: number;
|
|
114
|
+
workingset_activate: number;
|
|
115
|
+
workingset_nodereclaim: number;
|
|
116
|
+
workingset_refault: number;
|
|
117
|
+
}
|
|
118
|
+
export interface Networks extends Record<string, NetworkInterface> {
|
|
119
|
+
}
|
|
120
|
+
export interface NetworkInterface {
|
|
121
|
+
rx_bytes: number;
|
|
122
|
+
rx_dropped: number;
|
|
123
|
+
rx_errors: number;
|
|
124
|
+
rx_packets: number;
|
|
125
|
+
tx_bytes: number;
|
|
126
|
+
tx_dropped: number;
|
|
127
|
+
tx_errors: number;
|
|
128
|
+
tx_packets: number;
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface DockerContainerSummary {
|
|
2
|
+
Id: string;
|
|
3
|
+
Names: string[];
|
|
4
|
+
Image: string;
|
|
5
|
+
ImageID: string;
|
|
6
|
+
ImageManifestDescriptor: ImageManifestDescriptor;
|
|
7
|
+
Command: string;
|
|
8
|
+
Created: number;
|
|
9
|
+
Ports: Port[];
|
|
10
|
+
Labels: Labels;
|
|
11
|
+
State: string;
|
|
12
|
+
Status: string;
|
|
13
|
+
HostConfig: HostConfig;
|
|
14
|
+
Health: Health;
|
|
15
|
+
NetworkSettings: NetworkSettings;
|
|
16
|
+
Mounts: Mount[];
|
|
17
|
+
}
|
|
18
|
+
export interface ImageManifestDescriptor {
|
|
19
|
+
mediaType: string;
|
|
20
|
+
digest: string;
|
|
21
|
+
size: number;
|
|
22
|
+
platform: Platform;
|
|
23
|
+
annotations?: Annotations;
|
|
24
|
+
}
|
|
25
|
+
export interface Platform {
|
|
26
|
+
architecture: string;
|
|
27
|
+
os: string;
|
|
28
|
+
variant?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface Annotations extends Record<string, string> {
|
|
31
|
+
}
|
|
32
|
+
export interface Port {
|
|
33
|
+
IP: string;
|
|
34
|
+
PrivatePort: number;
|
|
35
|
+
PublicPort: number;
|
|
36
|
+
Type: string;
|
|
37
|
+
}
|
|
38
|
+
export interface Labels extends Record<string, string> {
|
|
39
|
+
}
|
|
40
|
+
export interface HostConfig {
|
|
41
|
+
NetworkMode: string;
|
|
42
|
+
}
|
|
43
|
+
export interface Health {
|
|
44
|
+
Status: string;
|
|
45
|
+
FailingStreak: number;
|
|
46
|
+
}
|
|
47
|
+
export interface NetworkSettings {
|
|
48
|
+
Networks: Networks;
|
|
49
|
+
}
|
|
50
|
+
export interface Networks extends Record<string, Network> {
|
|
51
|
+
}
|
|
52
|
+
export interface Network {
|
|
53
|
+
IPAMConfig: any;
|
|
54
|
+
Links: any;
|
|
55
|
+
Aliases: any;
|
|
56
|
+
DriverOpts: any;
|
|
57
|
+
GwPriority: number;
|
|
58
|
+
NetworkID: string;
|
|
59
|
+
EndpointID: string;
|
|
60
|
+
Gateway: string;
|
|
61
|
+
IPAddress: string;
|
|
62
|
+
MacAddress: string;
|
|
63
|
+
IPPrefixLen: number;
|
|
64
|
+
IPv6Gateway: string;
|
|
65
|
+
GlobalIPv6Address: string;
|
|
66
|
+
GlobalIPv6PrefixLen: number;
|
|
67
|
+
DNSNames: any;
|
|
68
|
+
}
|
|
69
|
+
export interface Mount {
|
|
70
|
+
Type: string;
|
|
71
|
+
Source: string;
|
|
72
|
+
Destination: string;
|
|
73
|
+
Mode: string;
|
|
74
|
+
RW: boolean;
|
|
75
|
+
Propagation: string;
|
|
76
|
+
Name?: string;
|
|
77
|
+
Driver?: string;
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export declare interface DockerInfo {
|
|
2
|
+
ID: string;
|
|
3
|
+
Containers: number;
|
|
4
|
+
ContainersRunning: number;
|
|
5
|
+
ContainersPaused: number;
|
|
6
|
+
ContainersStopped: number;
|
|
7
|
+
Images: number;
|
|
8
|
+
Driver: string;
|
|
9
|
+
DriverStatus: string[][];
|
|
10
|
+
Plugins: Plugins;
|
|
11
|
+
MemoryLimit: boolean;
|
|
12
|
+
SwapLimit: boolean;
|
|
13
|
+
CpuCfsPeriod: boolean;
|
|
14
|
+
CpuCfsQuota: boolean;
|
|
15
|
+
CPUShares: boolean;
|
|
16
|
+
CPUSet: boolean;
|
|
17
|
+
PidsLimit: boolean;
|
|
18
|
+
IPv4Forwarding: boolean;
|
|
19
|
+
Debug: boolean;
|
|
20
|
+
NFd: number;
|
|
21
|
+
OomKillDisable: boolean;
|
|
22
|
+
NGoroutines: number;
|
|
23
|
+
SystemTime: string;
|
|
24
|
+
LoggingDriver: string;
|
|
25
|
+
CgroupDriver: string;
|
|
26
|
+
CgroupVersion: string;
|
|
27
|
+
NEventsListener: number;
|
|
28
|
+
KernelVersion: string;
|
|
29
|
+
OperatingSystem: string;
|
|
30
|
+
OSVersion: string;
|
|
31
|
+
OSType: string;
|
|
32
|
+
Architecture: string;
|
|
33
|
+
IndexServerAddress: string;
|
|
34
|
+
RegistryConfig: RegistryConfig;
|
|
35
|
+
NCPU: number;
|
|
36
|
+
MemTotal: number;
|
|
37
|
+
GenericResources: any;
|
|
38
|
+
DockerRootDir: string;
|
|
39
|
+
HttpProxy: string;
|
|
40
|
+
HttpsProxy: string;
|
|
41
|
+
NoProxy: string;
|
|
42
|
+
Name: string;
|
|
43
|
+
Labels: string[];
|
|
44
|
+
ExperimentalBuild: boolean;
|
|
45
|
+
ServerVersion: string;
|
|
46
|
+
Runtimes: Runtimes;
|
|
47
|
+
DefaultRuntime: string;
|
|
48
|
+
Swarm: Swarm;
|
|
49
|
+
LiveRestoreEnabled: boolean;
|
|
50
|
+
Isolation: string;
|
|
51
|
+
InitBinary: string;
|
|
52
|
+
ContainerdCommit: ContainerdCommit;
|
|
53
|
+
RuncCommit: RuncCommit;
|
|
54
|
+
InitCommit: InitCommit;
|
|
55
|
+
SecurityOptions: string[];
|
|
56
|
+
FirewallBackend: FirewallBackend;
|
|
57
|
+
CDISpecDirs: string[];
|
|
58
|
+
DiscoveredDevices: DiscoveredDevice[];
|
|
59
|
+
Containerd: Containerd;
|
|
60
|
+
Warnings: any;
|
|
61
|
+
}
|
|
62
|
+
export declare interface Plugins {
|
|
63
|
+
Volume: string[];
|
|
64
|
+
Network: string[];
|
|
65
|
+
Authorization: any;
|
|
66
|
+
Log: string[];
|
|
67
|
+
}
|
|
68
|
+
export declare interface RegistryConfig {
|
|
69
|
+
IndexConfigs: IndexConfigs;
|
|
70
|
+
InsecureRegistryCIDRs: string[];
|
|
71
|
+
Mirrors: any;
|
|
72
|
+
}
|
|
73
|
+
export declare interface IndexConfigs extends Record<string, IndexConfig> {
|
|
74
|
+
}
|
|
75
|
+
export declare interface IndexConfig {
|
|
76
|
+
Mirrors: any[];
|
|
77
|
+
Name: string;
|
|
78
|
+
Official: boolean;
|
|
79
|
+
Secure: boolean;
|
|
80
|
+
}
|
|
81
|
+
export declare interface Runtimes {
|
|
82
|
+
"io.containerd.runc.v2": IoContainerdRuncV2;
|
|
83
|
+
runc: Runc;
|
|
84
|
+
}
|
|
85
|
+
export declare interface IoContainerdRuncV2 {
|
|
86
|
+
path: string;
|
|
87
|
+
status: IoContainerdRuncV2Status;
|
|
88
|
+
}
|
|
89
|
+
export declare interface IoContainerdRuncV2Status {
|
|
90
|
+
"org.opencontainers.runtime-spec.features": string;
|
|
91
|
+
}
|
|
92
|
+
export declare interface Runc {
|
|
93
|
+
path: string;
|
|
94
|
+
status: RunStatus;
|
|
95
|
+
}
|
|
96
|
+
export declare interface RunStatus {
|
|
97
|
+
"org.opencontainers.runtime-spec.features": string;
|
|
98
|
+
}
|
|
99
|
+
export declare interface Swarm {
|
|
100
|
+
NodeID: string;
|
|
101
|
+
NodeAddr: string;
|
|
102
|
+
LocalNodeState: string;
|
|
103
|
+
ControlAvailable: boolean;
|
|
104
|
+
Error: string;
|
|
105
|
+
RemoteManagers: any;
|
|
106
|
+
}
|
|
107
|
+
export declare interface ContainerdCommit {
|
|
108
|
+
ID: string;
|
|
109
|
+
}
|
|
110
|
+
export declare interface RuncCommit {
|
|
111
|
+
ID: string;
|
|
112
|
+
}
|
|
113
|
+
export declare interface InitCommit {
|
|
114
|
+
ID: string;
|
|
115
|
+
}
|
|
116
|
+
export declare interface FirewallBackend {
|
|
117
|
+
Driver: string;
|
|
118
|
+
}
|
|
119
|
+
export declare interface DiscoveredDevice {
|
|
120
|
+
Source: string;
|
|
121
|
+
ID: string;
|
|
122
|
+
}
|
|
123
|
+
export declare interface Containerd {
|
|
124
|
+
Address: string;
|
|
125
|
+
Namespaces: Namespaces;
|
|
126
|
+
}
|
|
127
|
+
export declare interface Namespaces {
|
|
128
|
+
Containers: string;
|
|
129
|
+
Plugins: string;
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare interface DockerVersion {
|
|
2
|
+
Platform: Platform;
|
|
3
|
+
Components: Component[];
|
|
4
|
+
Version: string;
|
|
5
|
+
ApiVersion: string;
|
|
6
|
+
MinAPIVersion: string;
|
|
7
|
+
GitCommit: string;
|
|
8
|
+
GoVersion: string;
|
|
9
|
+
Os: string;
|
|
10
|
+
Arch: string;
|
|
11
|
+
KernelVersion: string;
|
|
12
|
+
BuildTime: string;
|
|
13
|
+
}
|
|
14
|
+
export declare interface Platform {
|
|
15
|
+
Name: string;
|
|
16
|
+
}
|
|
17
|
+
export declare interface Component {
|
|
18
|
+
Name: string;
|
|
19
|
+
Version: string;
|
|
20
|
+
Details: Details;
|
|
21
|
+
}
|
|
22
|
+
export declare interface Details {
|
|
23
|
+
ApiVersion?: string;
|
|
24
|
+
Arch?: string;
|
|
25
|
+
BuildTime?: string;
|
|
26
|
+
Experimental?: string;
|
|
27
|
+
GitCommit: string;
|
|
28
|
+
GoVersion?: string;
|
|
29
|
+
KernelVersion?: string;
|
|
30
|
+
MinAPIVersion?: string;
|
|
31
|
+
Os?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hallmaster/docker.js",
|
|
3
3
|
"description": "A TypeScript Docker API wrapper mainly used for the Hallmaster project.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"private": false,
|
|
8
|
+
"type": "module",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"import": "./dist/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DockerContainer.d.ts","sourceRoot":"","sources":["../src/DockerContainer.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,MAAM,CAAC,OAAO,OAAO,eAAe;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAEjD,IAAI,CACR,OAAO,GAAE;QACP,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;KACiB;IAkBlD,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE,OAAe;IAQ9C,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,GAAE,MAAc;IAQ/C,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;QACP,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;KASvB;IAqBG,KAAK,CACT,WAAW,EAAE,MAAM,EACnB,OAAO,GACH;QAAE,MAAM,EAAE,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAE,GACjC;QACE,MAAM,EAAE,KAAK,CAAC;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;KAIvB;CAeJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DockerSocket.d.ts","sourceRoot":"","sources":["../src/DockerSocket.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQrD,MAAM,CAAC,OAAO,OAAO,YAAY;IAS7B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAR7B,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO,CAAC,aAAa,CAA8B;IAEnD,OAAO,CAAC,eAAe,CAAuB;gBAG5C,cAAc,GAAE,MAA+B,EAC9B,UAAU,GAAE,MAA2B;IAKpD,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;YAiBnB,OAAO;IAqEf,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3B,IAAI,OAAO,kBAKV;IAED,IAAI,KAAK,WAKR;IAEK,OAAO,CAAC,CAAC,EACb,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,EACzB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;QAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAChC,GACA,OAAO,CAAC,CAAC,CAAC;IAkBP,YAAY,CAChB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAmBV,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CAGlC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|