@otterdeploy/docker 0.1.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.
@@ -0,0 +1,2011 @@
1
+ import * as http from "node:http";
2
+ import * as better_result0 from "better-result";
3
+ import { Result } from "better-result";
4
+ import { Client } from "ssh2";
5
+ import { Duplex, PassThrough } from "node:stream";
6
+ import { EventEmitter } from "node:events";
7
+ import * as net from "node:net";
8
+
9
+ //#region src/errors.d.ts
10
+ declare const DockerBadRequestError_base: better_result0.TaggedErrorClass<"DockerBadRequestError", {
11
+ message: string;
12
+ }>;
13
+ declare class DockerBadRequestError extends DockerBadRequestError_base {
14
+ readonly statusCode: 400;
15
+ }
16
+ declare const DockerUnauthorizedError_base: better_result0.TaggedErrorClass<"DockerUnauthorizedError", {
17
+ message: string;
18
+ }>;
19
+ declare class DockerUnauthorizedError extends DockerUnauthorizedError_base {
20
+ readonly statusCode: 401;
21
+ }
22
+ declare const DockerForbiddenError_base: better_result0.TaggedErrorClass<"DockerForbiddenError", {
23
+ message: string;
24
+ }>;
25
+ declare class DockerForbiddenError extends DockerForbiddenError_base {
26
+ readonly statusCode: 403;
27
+ }
28
+ declare const DockerNotFoundError_base: better_result0.TaggedErrorClass<"DockerNotFoundError", {
29
+ message: string;
30
+ }>;
31
+ declare class DockerNotFoundError extends DockerNotFoundError_base {
32
+ readonly statusCode: 404;
33
+ }
34
+ declare const DockerConflictError_base: better_result0.TaggedErrorClass<"DockerConflictError", {
35
+ message: string;
36
+ }>;
37
+ declare class DockerConflictError extends DockerConflictError_base {
38
+ readonly statusCode: 409;
39
+ }
40
+ declare const DockerServerError_base: better_result0.TaggedErrorClass<"DockerServerError", {
41
+ message: string;
42
+ }>;
43
+ declare class DockerServerError extends DockerServerError_base {
44
+ readonly statusCode: 500;
45
+ }
46
+ declare const DockerServiceUnavailableError_base: better_result0.TaggedErrorClass<"DockerServiceUnavailableError", {
47
+ message: string;
48
+ }>;
49
+ declare class DockerServiceUnavailableError extends DockerServiceUnavailableError_base {
50
+ readonly statusCode: 503;
51
+ }
52
+ declare const DockerNetworkError_base: better_result0.TaggedErrorClass<"DockerNetworkError", {
53
+ message: string;
54
+ cause: unknown;
55
+ }>;
56
+ declare class DockerNetworkError extends DockerNetworkError_base {}
57
+ declare const DockerTimeoutError_base: better_result0.TaggedErrorClass<"DockerTimeoutError", {
58
+ message: string;
59
+ timeoutMs: number;
60
+ }>;
61
+ declare class DockerTimeoutError extends DockerTimeoutError_base {}
62
+ declare const DockerAbortError_base: better_result0.TaggedErrorClass<"DockerAbortError", {
63
+ message: string;
64
+ }>;
65
+ declare class DockerAbortError extends DockerAbortError_base {}
66
+ declare const DockerDecodeError_base: better_result0.TaggedErrorClass<"DockerDecodeError", {
67
+ message: string;
68
+ cause: unknown;
69
+ body: string;
70
+ }>;
71
+ declare class DockerDecodeError extends DockerDecodeError_base {}
72
+ declare const DockerUnknownError_base: better_result0.TaggedErrorClass<"DockerUnknownError", {
73
+ message: string;
74
+ statusCode: number;
75
+ }>;
76
+ declare class DockerUnknownError extends DockerUnknownError_base {}
77
+ type DockerApiError = DockerBadRequestError | DockerUnauthorizedError | DockerForbiddenError | DockerNotFoundError | DockerConflictError | DockerServerError | DockerServiceUnavailableError;
78
+ type DockerTransportError = DockerNetworkError | DockerTimeoutError | DockerAbortError | DockerDecodeError;
79
+ type DockerError = DockerApiError | DockerTransportError | DockerUnknownError;
80
+ /**
81
+ * Maps an HTTP status code to the appropriate Docker error class.
82
+ * Unknown status codes produce a DockerUnknownError.
83
+ */
84
+ declare function statusCodeToError(statusCode: number, message: string): DockerApiError | DockerUnknownError;
85
+ //#endregion
86
+ //#region src/transport/types.d.ts
87
+ type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "HEAD";
88
+ type StatusCodeMap = Record<number, true | string>;
89
+ type DialOptions = {
90
+ method: HttpMethod;
91
+ path: string;
92
+ query?: Record<string, unknown>;
93
+ body?: unknown;
94
+ headers?: Record<string, string>;
95
+ statusCodes: StatusCodeMap;
96
+ timeout?: number;
97
+ signal?: AbortSignal;
98
+ isStream?: boolean;
99
+ hijack?: boolean;
100
+ openStdin?: boolean;
101
+ authconfig?: Record<string, unknown>;
102
+ registryconfig?: Record<string, unknown>;
103
+ };
104
+ type DialResponse = {
105
+ statusCode: number;
106
+ headers: Record<string, string>;
107
+ body: unknown;
108
+ };
109
+ type TlsConfig = {
110
+ ca?: string;
111
+ cert?: string;
112
+ key?: string;
113
+ rejectUnauthorized?: boolean;
114
+ };
115
+ type TransportConfig = {
116
+ type: "unix";
117
+ socketPath?: string;
118
+ } | {
119
+ type: "tcp";
120
+ host: string;
121
+ port?: number;
122
+ tls?: TlsConfig;
123
+ } | {
124
+ type: "ssh";
125
+ host: string;
126
+ port?: number;
127
+ username: string;
128
+ privateKey?: string;
129
+ passphrase?: string;
130
+ } | {
131
+ type: "npipe";
132
+ path?: string;
133
+ };
134
+ interface Transport {
135
+ dial(options: DialOptions): Promise<Result<DialResponse, DockerError>>;
136
+ dialStream(options: DialOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
137
+ dialHijack(options: DialOptions): Promise<Result<net.Socket, DockerError>>;
138
+ destroy(): void;
139
+ }
140
+ //#endregion
141
+ //#region src/client/types.d.ts
142
+ /** Authentication configuration for registry access. */
143
+ type AuthConfig = {
144
+ username?: string;
145
+ password?: string;
146
+ serveraddress?: string;
147
+ identitytoken?: string;
148
+ email?: string;
149
+ };
150
+ /** Response from a prune operation. */
151
+ type PruneResponse = {
152
+ SpaceReclaimed: number;
153
+ [key: string]: unknown;
154
+ };
155
+ /** Filters for list/prune operations, mapping filter name to values. */
156
+ type Filters = Record<string, string[]>;
157
+ /**
158
+ * EventMessage represents the information an event contains.
159
+ * Returned by the /events endpoint.
160
+ */
161
+ type EventMessage = {
162
+ Type?: string;
163
+ Action?: string;
164
+ Actor?: EventActor;
165
+ scope?: string;
166
+ time?: number;
167
+ timeNano?: number;
168
+ };
169
+ /** Actor describes something that generates events. */
170
+ type EventActor = {
171
+ ID?: string;
172
+ Attributes?: Record<string, string>;
173
+ };
174
+ /** Response to an API call that returns just an Id. */
175
+ type IdResponse = {
176
+ Id: string;
177
+ Warnings?: string[];
178
+ };
179
+ /** Response from GET /info. */
180
+ type DockerInfo = {
181
+ ID: string;
182
+ Containers: number;
183
+ ContainersRunning: number;
184
+ ContainersPaused: number;
185
+ ContainersStopped: number;
186
+ Images: number;
187
+ Driver: string;
188
+ DriverStatus?: string[][];
189
+ DockerRootDir?: string;
190
+ MemTotal: number;
191
+ MemoryLimit?: boolean;
192
+ Name: string;
193
+ NCPU: number;
194
+ OperatingSystem: string;
195
+ OSType: string;
196
+ OSVersion?: string;
197
+ Architecture: string;
198
+ ServerVersion: string;
199
+ KernelVersion?: string;
200
+ Labels?: string[];
201
+ ExperimentalBuild?: boolean;
202
+ Swarm?: Record<string, unknown>;
203
+ LiveRestoreEnabled?: boolean;
204
+ SecurityOptions?: string[];
205
+ Runtimes?: Record<string, unknown>;
206
+ DefaultRuntime?: string;
207
+ [key: string]: unknown;
208
+ };
209
+ /** Response from GET /version. */
210
+ type DockerVersion = {
211
+ Version: string;
212
+ ApiVersion: string;
213
+ MinAPIVersion: string;
214
+ GitCommit: string;
215
+ GoVersion: string;
216
+ Os: string;
217
+ Arch: string;
218
+ KernelVersion: string;
219
+ BuildTime: string;
220
+ Platform?: {
221
+ Name: string;
222
+ };
223
+ Components?: Array<{
224
+ Name: string;
225
+ Version: string;
226
+ Details?: Record<string, unknown> | null;
227
+ }>;
228
+ Experimental?: boolean;
229
+ [key: string]: unknown;
230
+ };
231
+ /** Response from GET /system/df. */
232
+ type SystemDf = {
233
+ LayersSize: number;
234
+ Images: ImageSummary[];
235
+ Containers: ContainerSummary[];
236
+ Volumes: Volume[];
237
+ BuildCache?: unknown[];
238
+ [key: string]: unknown;
239
+ };
240
+ /** Describes a port mapping between the container and the host (list endpoint). */
241
+ type Port = {
242
+ IP?: string;
243
+ PrivatePort: number;
244
+ PublicPort?: number;
245
+ Type: string;
246
+ };
247
+ /** Represents a binding between a host IP address and a host port. */
248
+ type PortBinding = {
249
+ HostIp?: string;
250
+ HostPort?: string;
251
+ };
252
+ /** Mount represents a mount configuration. */
253
+ type Mount = {
254
+ Target?: string;
255
+ Source?: string;
256
+ Type?: string;
257
+ ReadOnly?: boolean;
258
+ Consistency?: string;
259
+ BindOptions?: {
260
+ Propagation?: string;
261
+ NonRecursive?: boolean;
262
+ CreateMountpoint?: boolean;
263
+ ReadOnlyNonRecursive?: boolean;
264
+ ReadOnlyForceRecursive?: boolean;
265
+ };
266
+ VolumeOptions?: {
267
+ NoCopy?: boolean;
268
+ Labels?: Record<string, string>;
269
+ DriverConfig?: {
270
+ Name?: string;
271
+ Options?: Record<string, string>;
272
+ };
273
+ Subpath?: string;
274
+ };
275
+ TmpfsOptions?: {
276
+ SizeBytes?: number;
277
+ Mode?: number;
278
+ Options?: string[][];
279
+ };
280
+ ImageOptions?: {
281
+ Subpath?: string;
282
+ };
283
+ };
284
+ /** MountPoint as reported by container inspect (actual mount state). */
285
+ type MountPoint = {
286
+ Type?: string;
287
+ Name?: string;
288
+ Source?: string;
289
+ Destination?: string;
290
+ Driver?: string;
291
+ Mode?: string;
292
+ RW?: boolean;
293
+ Propagation?: string;
294
+ };
295
+ /** The behavior to apply when the container exits. */
296
+ type RestartPolicy = {
297
+ Name?: "" | "no" | "always" | "unless-stopped" | "on-failure";
298
+ MaximumRetryCount?: number;
299
+ };
300
+ /** Configuration for a network endpoint. */
301
+ type EndpointSettings = {
302
+ IPAMConfig?: EndpointIPAMConfig | null;
303
+ Links?: string[];
304
+ MacAddress?: string;
305
+ Aliases?: string[];
306
+ DriverOpts?: Record<string, string> | null;
307
+ GwPriority?: number;
308
+ NetworkID?: string;
309
+ EndpointID?: string;
310
+ Gateway?: string;
311
+ IPAddress?: string;
312
+ IPPrefixLen?: number;
313
+ IPv6Gateway?: string;
314
+ GlobalIPv6Address?: string;
315
+ GlobalIPv6PrefixLen?: number;
316
+ DNSNames?: string[];
317
+ };
318
+ /** Endpoint IPAM configuration. */
319
+ type EndpointIPAMConfig = {
320
+ IPv4Address?: string;
321
+ IPv6Address?: string;
322
+ LinkLocalIPs?: string[];
323
+ };
324
+ /** NetworkSettings exposes the network settings in the API. */
325
+ type NetworkSettings = {
326
+ SandboxID?: string;
327
+ SandboxKey?: string;
328
+ Ports?: Record<string, PortBinding[] | null>;
329
+ Networks?: Record<string, EndpointSettings>;
330
+ Bridge?: string;
331
+ HairpinMode?: boolean;
332
+ LinkLocalIPv6Address?: string;
333
+ LinkLocalIPv6PrefixLen?: number;
334
+ Gateway?: string;
335
+ GlobalIPv6Address?: string;
336
+ GlobalIPv6PrefixLen?: number;
337
+ IPAddress?: string;
338
+ IPPrefixLen?: number;
339
+ IPv6Gateway?: string;
340
+ MacAddress?: string;
341
+ [key: string]: unknown;
342
+ };
343
+ /**
344
+ * NetworkingConfig represents the container's networking configuration
345
+ * for each of its interfaces. Used in container create.
346
+ */
347
+ type NetworkingConfig = {
348
+ EndpointsConfig?: Record<string, EndpointSettings>;
349
+ };
350
+ /** Summary representation of a container (from list endpoint). */
351
+ type ContainerSummary = {
352
+ Id: string;
353
+ Names: string[];
354
+ Image: string;
355
+ ImageID: string;
356
+ Command: string;
357
+ Created: number;
358
+ State: string;
359
+ Status: string;
360
+ Ports: Port[];
361
+ Labels: Record<string, string>;
362
+ SizeRw?: number;
363
+ SizeRootFs?: number;
364
+ HostConfig: {
365
+ NetworkMode: string;
366
+ Annotations?: Record<string, string> | null;
367
+ };
368
+ NetworkSettings: {
369
+ Networks: Record<string, EndpointSettings>;
370
+ };
371
+ Mounts: MountPoint[];
372
+ Health?: {
373
+ Status?: string;
374
+ FailingStreak?: number;
375
+ };
376
+ };
377
+ /** Full container inspection response. */
378
+ type ContainerInspect = {
379
+ Id: string;
380
+ Created: string;
381
+ Path: string;
382
+ Args: string[];
383
+ State: ContainerState;
384
+ Image: string;
385
+ ResolvConfPath?: string;
386
+ HostnamePath?: string;
387
+ HostsPath?: string;
388
+ LogPath?: string | null;
389
+ Name: string;
390
+ RestartCount: number;
391
+ Driver: string;
392
+ Platform: string;
393
+ MountLabel?: string;
394
+ ProcessLabel?: string;
395
+ AppArmorProfile?: string;
396
+ ExecIDs?: string[] | null;
397
+ HostConfig: HostConfig;
398
+ GraphDriver?: {
399
+ Name: string;
400
+ Data: Record<string, string>;
401
+ } | null;
402
+ SizeRw?: number | null;
403
+ SizeRootFs?: number | null;
404
+ Config: ContainerConfig;
405
+ NetworkSettings: NetworkSettings;
406
+ Mounts: MountPoint[];
407
+ [key: string]: unknown;
408
+ };
409
+ /** ContainerState stores a container's running state. */
410
+ type ContainerState = {
411
+ Status: string;
412
+ Running: boolean;
413
+ Paused: boolean;
414
+ Restarting: boolean;
415
+ OOMKilled: boolean;
416
+ Dead: boolean;
417
+ Pid: number;
418
+ ExitCode: number;
419
+ Error: string;
420
+ StartedAt: string;
421
+ FinishedAt: string;
422
+ Health?: {
423
+ Status?: string;
424
+ FailingStreak?: number;
425
+ Log?: Array<{
426
+ Start?: string;
427
+ End?: string;
428
+ ExitCode?: number;
429
+ Output?: string;
430
+ }>;
431
+ };
432
+ };
433
+ /** Container configuration (image-level config stored at creation time). */
434
+ type ContainerConfig = {
435
+ Hostname: string;
436
+ Domainname: string;
437
+ User: string;
438
+ AttachStdin: boolean;
439
+ AttachStdout: boolean;
440
+ AttachStderr: boolean;
441
+ ExposedPorts?: Record<string, {}>;
442
+ Tty: boolean;
443
+ OpenStdin: boolean;
444
+ StdinOnce: boolean;
445
+ Env: string[];
446
+ Cmd: string[];
447
+ Image: string;
448
+ Volumes?: Record<string, {}>;
449
+ WorkingDir: string;
450
+ Entrypoint: string[] | null;
451
+ Labels: Record<string, string>;
452
+ OnBuild?: string[] | null;
453
+ StopSignal?: string;
454
+ StopTimeout?: number;
455
+ Healthcheck?: HealthConfig;
456
+ [key: string]: unknown;
457
+ };
458
+ /** Health check configuration. */
459
+ type HealthConfig = {
460
+ Test?: string[];
461
+ Interval?: number;
462
+ Timeout?: number;
463
+ Retries?: number;
464
+ StartPeriod?: number;
465
+ StartInterval?: number;
466
+ };
467
+ /** Host-specific configuration for a container. */
468
+ type HostConfig = {
469
+ Binds?: string[];
470
+ Memory?: number;
471
+ MemorySwap?: number;
472
+ MemoryReservation?: number;
473
+ NanoCpus?: number;
474
+ CpuShares?: number;
475
+ CpuPeriod?: number;
476
+ CpuQuota?: number;
477
+ CpusetCpus?: string;
478
+ CpusetMems?: string;
479
+ CpuCount?: number;
480
+ CpuPercent?: number;
481
+ BlkioWeight?: number;
482
+ BlkioWeightDevice?: Array<{
483
+ Path: string;
484
+ Weight: number;
485
+ }>;
486
+ BlkioDeviceReadBps?: Array<{
487
+ Path: string;
488
+ Rate: number;
489
+ }>;
490
+ BlkioDeviceWriteBps?: Array<{
491
+ Path: string;
492
+ Rate: number;
493
+ }>;
494
+ BlkioDeviceReadIOps?: Array<{
495
+ Path: string;
496
+ Rate: number;
497
+ }>;
498
+ BlkioDeviceWriteIOps?: Array<{
499
+ Path: string;
500
+ Rate: number;
501
+ }>;
502
+ NetworkMode?: string;
503
+ PortBindings?: Record<string, PortBinding[]>;
504
+ RestartPolicy?: RestartPolicy;
505
+ Privileged?: boolean;
506
+ PublishAllPorts?: boolean;
507
+ ReadonlyRootfs?: boolean;
508
+ Dns?: string[];
509
+ DnsOptions?: string[];
510
+ DnsSearch?: string[];
511
+ ExtraHosts?: string[];
512
+ VolumesFrom?: string[];
513
+ Mounts?: Mount[];
514
+ CapAdd?: string[];
515
+ CapDrop?: string[];
516
+ GroupAdd?: string[];
517
+ SecurityOpt?: string[];
518
+ UsernsMode?: string;
519
+ Sysctls?: Record<string, string>;
520
+ Runtime?: string;
521
+ Isolation?: string;
522
+ MaskedPaths?: string[];
523
+ ReadonlyPaths?: string[];
524
+ LogConfig?: {
525
+ Type: string;
526
+ Config: Record<string, string>;
527
+ };
528
+ CgroupnsMode?: string;
529
+ CgroupParent?: string;
530
+ PidsLimit?: number | null;
531
+ OomKillDisable?: boolean;
532
+ OomScoreAdj?: number;
533
+ ShmSize?: number;
534
+ Tmpfs?: Record<string, string>;
535
+ UTSMode?: string;
536
+ IpcMode?: string;
537
+ PidMode?: string;
538
+ Devices?: Array<{
539
+ PathOnHost?: string;
540
+ PathInContainer?: string;
541
+ CgroupPermissions?: string;
542
+ }>;
543
+ DeviceRequests?: Array<{
544
+ Driver?: string;
545
+ Count?: number;
546
+ DeviceIDs?: string[];
547
+ Capabilities?: string[][];
548
+ Options?: Record<string, string>;
549
+ }>;
550
+ DeviceCgroupRules?: string[];
551
+ Ulimits?: Array<{
552
+ Name?: string;
553
+ Soft?: number;
554
+ Hard?: number;
555
+ }>;
556
+ Init?: boolean | null;
557
+ Links?: string[];
558
+ AutoRemove?: boolean;
559
+ StorageOpt?: Record<string, string>;
560
+ Annotations?: Record<string, string>;
561
+ [key: string]: unknown;
562
+ };
563
+ /** Options for creating a container. */
564
+ type CreateContainerOptions = {
565
+ name?: string;
566
+ platform?: string;
567
+ Image: string;
568
+ Cmd?: string[];
569
+ Env?: string[];
570
+ ExposedPorts?: Record<string, {}>;
571
+ HostConfig?: Partial<HostConfig>;
572
+ Labels?: Record<string, string>;
573
+ Volumes?: Record<string, {}>;
574
+ WorkingDir?: string;
575
+ Entrypoint?: string[] | null;
576
+ Tty?: boolean;
577
+ OpenStdin?: boolean;
578
+ StdinOnce?: boolean;
579
+ AttachStdin?: boolean;
580
+ AttachStdout?: boolean;
581
+ AttachStderr?: boolean;
582
+ User?: string;
583
+ NetworkingConfig?: NetworkingConfig;
584
+ StopSignal?: string;
585
+ StopTimeout?: number;
586
+ Domainname?: string;
587
+ Hostname?: string;
588
+ Healthcheck?: HealthConfig;
589
+ OnBuild?: string[];
590
+ Shell?: string[];
591
+ MacAddress?: string;
592
+ [key: string]: unknown;
593
+ };
594
+ /** Response from container create. */
595
+ type CreateContainerResponse = {
596
+ Id: string;
597
+ Warnings: string[];
598
+ };
599
+ /** Response from container wait. */
600
+ type WaitResponse = {
601
+ StatusCode: number;
602
+ Error?: {
603
+ Message: string;
604
+ };
605
+ };
606
+ /** Filesystem change in a container. */
607
+ type ContainerChange = {
608
+ Path: string;
609
+ Kind: number;
610
+ };
611
+ /** Container top (process list) response. */
612
+ type ContainerTopResponse = {
613
+ Titles: string[];
614
+ Processes: string[][];
615
+ };
616
+ /** Container update response. */
617
+ type ContainerUpdateResponse = {
618
+ Warnings?: string[];
619
+ };
620
+ /**
621
+ * Container stats response.
622
+ * Uses Record<string, unknown> with key fields typed due to the large
623
+ * and platform-dependent shape of the stats response.
624
+ */
625
+ type ContainerStats = {
626
+ id?: string;
627
+ name?: string;
628
+ read?: string;
629
+ preread?: string;
630
+ num_procs?: number;
631
+ cpu_stats?: {
632
+ cpu_usage?: {
633
+ total_usage?: number;
634
+ percpu_usage?: number[] | null;
635
+ usage_in_kernelmode?: number;
636
+ usage_in_usermode?: number;
637
+ };
638
+ system_cpu_usage?: number;
639
+ online_cpus?: number;
640
+ throttling_data?: {
641
+ periods?: number;
642
+ throttled_periods?: number;
643
+ throttled_time?: number;
644
+ };
645
+ [key: string]: unknown;
646
+ };
647
+ precpu_stats?: {
648
+ cpu_usage?: {
649
+ total_usage?: number;
650
+ percpu_usage?: number[] | null;
651
+ usage_in_kernelmode?: number;
652
+ usage_in_usermode?: number;
653
+ };
654
+ system_cpu_usage?: number;
655
+ online_cpus?: number;
656
+ throttling_data?: {
657
+ periods?: number;
658
+ throttled_periods?: number;
659
+ throttled_time?: number;
660
+ };
661
+ [key: string]: unknown;
662
+ };
663
+ memory_stats?: {
664
+ usage?: number;
665
+ max_usage?: number;
666
+ limit?: number;
667
+ stats?: Record<string, unknown>;
668
+ [key: string]: unknown;
669
+ };
670
+ pids_stats?: {
671
+ current?: number;
672
+ limit?: number;
673
+ };
674
+ blkio_stats?: {
675
+ io_service_bytes_recursive?: Array<{
676
+ major?: number;
677
+ minor?: number;
678
+ op?: string;
679
+ value?: number;
680
+ }> | null;
681
+ [key: string]: unknown;
682
+ };
683
+ networks?: Record<string, {
684
+ rx_bytes?: number;
685
+ rx_packets?: number;
686
+ rx_errors?: number;
687
+ rx_dropped?: number;
688
+ tx_bytes?: number;
689
+ tx_packets?: number;
690
+ tx_errors?: number;
691
+ tx_dropped?: number;
692
+ [key: string]: unknown;
693
+ }>;
694
+ storage_stats?: Record<string, unknown>;
695
+ [key: string]: unknown;
696
+ };
697
+ /** Options for container logs. */
698
+ type LogsOptions = {
699
+ follow?: boolean;
700
+ stdout?: boolean;
701
+ stderr?: boolean;
702
+ since?: number;
703
+ until?: number;
704
+ timestamps?: boolean;
705
+ tail?: string;
706
+ };
707
+ /** Summary representation of an image (from list endpoint). */
708
+ type ImageSummary = {
709
+ Id: string;
710
+ ParentId: string;
711
+ RepoTags: string[];
712
+ RepoDigests: string[];
713
+ Created: number;
714
+ Size: number;
715
+ SharedSize: number;
716
+ Labels: Record<string, string>;
717
+ Containers: number;
718
+ Manifests?: unknown[];
719
+ Descriptor?: Record<string, unknown> | null;
720
+ [key: string]: unknown;
721
+ };
722
+ /** Full image inspection response. */
723
+ type ImageInspect = {
724
+ Id: string;
725
+ RepoTags?: string[];
726
+ RepoDigests?: string[];
727
+ Comment?: string | null;
728
+ Created?: string | null;
729
+ Author?: string | null;
730
+ Config?: ImageConfig;
731
+ Architecture: string;
732
+ Variant?: string | null;
733
+ Os: string;
734
+ OsVersion?: string | null;
735
+ Size: number;
736
+ GraphDriver?: {
737
+ Name: string;
738
+ Data: Record<string, string>;
739
+ } | null;
740
+ RootFS?: {
741
+ Type: string;
742
+ Layers?: string[];
743
+ };
744
+ Metadata?: {
745
+ LastTagTime?: string | null;
746
+ };
747
+ Descriptor?: Record<string, unknown> | null;
748
+ Manifests?: unknown[] | null;
749
+ Identity?: Record<string, unknown> | null;
750
+ [key: string]: unknown;
751
+ };
752
+ /** Image configuration (stored in the image manifest). */
753
+ type ImageConfig = {
754
+ Hostname?: string;
755
+ Domainname?: string;
756
+ User?: string;
757
+ AttachStdin?: boolean;
758
+ AttachStdout?: boolean;
759
+ AttachStderr?: boolean;
760
+ ExposedPorts?: Record<string, {}>;
761
+ Tty?: boolean;
762
+ OpenStdin?: boolean;
763
+ StdinOnce?: boolean;
764
+ Env?: string[];
765
+ Cmd?: string[] | null;
766
+ Image?: string;
767
+ Volumes?: Record<string, {}> | null;
768
+ WorkingDir?: string;
769
+ Entrypoint?: string[] | null;
770
+ Labels?: Record<string, string>;
771
+ OnBuild?: string[] | null;
772
+ StopSignal?: string;
773
+ Healthcheck?: HealthConfig;
774
+ Shell?: string[] | null;
775
+ [key: string]: unknown;
776
+ };
777
+ /** Individual image layer information from image history. */
778
+ type ImageHistory = {
779
+ Id: string;
780
+ Created: number;
781
+ CreatedBy: string;
782
+ Tags: string[];
783
+ Size: number;
784
+ Comment: string;
785
+ };
786
+ /** Options for creating/pulling an image. */
787
+ type CreateImageOptions = {
788
+ fromImage?: string;
789
+ fromSrc?: string;
790
+ repo?: string;
791
+ tag?: string;
792
+ platform?: string;
793
+ [key: string]: unknown;
794
+ };
795
+ /** Result from image search. */
796
+ type SearchResult = {
797
+ description?: string;
798
+ is_official?: boolean;
799
+ is_automated?: boolean;
800
+ name?: string;
801
+ star_count?: number;
802
+ };
803
+ /** Options for building an image. */
804
+ type BuildOptions = {
805
+ dockerfile?: string;
806
+ t?: string;
807
+ extrahosts?: string;
808
+ remote?: string;
809
+ q?: boolean;
810
+ nocache?: boolean;
811
+ cachefrom?: string[];
812
+ pull?: string;
813
+ rm?: boolean;
814
+ forcerm?: boolean;
815
+ memory?: number;
816
+ memswap?: number;
817
+ cpushares?: number;
818
+ cpusetcpus?: string;
819
+ cpuperiod?: number;
820
+ cpuquota?: number;
821
+ buildargs?: Record<string, string>;
822
+ shmsize?: number;
823
+ squash?: boolean;
824
+ labels?: Record<string, string>;
825
+ networkmode?: string;
826
+ platform?: string;
827
+ target?: string;
828
+ outputs?: string;
829
+ version?: string;
830
+ [key: string]: unknown;
831
+ };
832
+ /** Response item from image delete. */
833
+ type ImageDeleteResponseItem = {
834
+ Untagged?: string;
835
+ Deleted?: string;
836
+ };
837
+ /** Options for importing an image from a tar archive. */
838
+ type ImageImportOptions = {
839
+ repo?: string;
840
+ tag?: string;
841
+ message?: string;
842
+ platform?: string;
843
+ [key: string]: unknown;
844
+ };
845
+ /** Options for pruning build cache. */
846
+ type BuilderPruneOptions = {
847
+ "keep-storage"?: number;
848
+ all?: boolean;
849
+ filters?: Filters;
850
+ };
851
+ /** Response from build cache prune. */
852
+ type BuilderPruneResponse = {
853
+ CachesDeleted?: string[];
854
+ SpaceReclaimed: number;
855
+ };
856
+ /** Options for creating a checkpoint. */
857
+ type CheckpointCreateOptions = {
858
+ CheckpointID: string;
859
+ Exit?: boolean;
860
+ };
861
+ /** Archive info returned by HEAD /containers/{id}/archive. */
862
+ type ArchiveInfo = {
863
+ name: string;
864
+ size: number;
865
+ mode: number;
866
+ mtime: string;
867
+ linkTarget: string;
868
+ };
869
+ /** A Docker volume. */
870
+ type Volume = {
871
+ Name: string;
872
+ Driver: string;
873
+ Mountpoint: string;
874
+ CreatedAt?: string;
875
+ Status?: Record<string, unknown>;
876
+ Labels: Record<string, string>;
877
+ Scope: string;
878
+ Options: Record<string, string>;
879
+ UsageData?: {
880
+ Size: number;
881
+ RefCount: number;
882
+ } | null;
883
+ ClusterVolume?: Record<string, unknown>;
884
+ [key: string]: unknown;
885
+ };
886
+ /** Response from volume list. */
887
+ type VolumeListResponse = {
888
+ Volumes: Volume[];
889
+ Warnings?: string[];
890
+ };
891
+ /** Options for creating a volume. */
892
+ type CreateVolumeOptions = {
893
+ Name?: string;
894
+ Driver?: string;
895
+ DriverOpts?: Record<string, string>;
896
+ Labels?: Record<string, string>;
897
+ ClusterVolumeSpec?: Record<string, unknown>;
898
+ };
899
+ /** A Docker network. */
900
+ type Network = {
901
+ Name: string;
902
+ Id: string;
903
+ Created: string;
904
+ Scope: string;
905
+ Driver: string;
906
+ EnableIPv4?: boolean;
907
+ EnableIPv6?: boolean;
908
+ IPAM?: IPAM;
909
+ Internal?: boolean;
910
+ Attachable?: boolean;
911
+ Ingress?: boolean;
912
+ ConfigFrom?: {
913
+ Network?: string;
914
+ };
915
+ ConfigOnly?: boolean;
916
+ Options?: Record<string, string>;
917
+ Labels?: Record<string, string>;
918
+ Peers?: Array<{
919
+ Name?: string;
920
+ IP?: string;
921
+ }>;
922
+ Containers?: Record<string, {
923
+ Name?: string;
924
+ EndpointID?: string;
925
+ MacAddress?: string;
926
+ IPv4Address?: string;
927
+ IPv6Address?: string;
928
+ }>;
929
+ Services?: Record<string, unknown>;
930
+ [key: string]: unknown;
931
+ };
932
+ /** IPAM configuration for a network. */
933
+ type IPAM = {
934
+ Driver?: string;
935
+ Config?: Array<{
936
+ Subnet?: string;
937
+ IPRange?: string;
938
+ Gateway?: string;
939
+ AuxiliaryAddresses?: Record<string, string>;
940
+ }>;
941
+ Options?: Record<string, string>;
942
+ };
943
+ /** Options for creating a network. */
944
+ type NetworkCreateOptions = {
945
+ Name: string;
946
+ Driver?: string;
947
+ Scope?: string;
948
+ Internal?: boolean;
949
+ Attachable?: boolean;
950
+ Ingress?: boolean;
951
+ ConfigOnly?: boolean;
952
+ ConfigFrom?: {
953
+ Network?: string;
954
+ };
955
+ IPAM?: IPAM;
956
+ EnableIPv4?: boolean;
957
+ EnableIPv6?: boolean;
958
+ Options?: Record<string, string>;
959
+ Labels?: Record<string, string>;
960
+ };
961
+ /** Response from network create. */
962
+ type NetworkCreateResponse = {
963
+ Id: string;
964
+ Warning: string;
965
+ };
966
+ /** Options for connecting a container to a network. */
967
+ type NetworkConnectOptions = {
968
+ Container: string;
969
+ EndpointConfig?: EndpointSettings | null;
970
+ };
971
+ /** Options for disconnecting a container from a network. */
972
+ type NetworkDisconnectOptions = {
973
+ Container: string;
974
+ Force?: boolean;
975
+ };
976
+ /** Options for creating an exec instance. */
977
+ type ExecCreateOptions = {
978
+ AttachStdin?: boolean;
979
+ AttachStdout?: boolean;
980
+ AttachStderr?: boolean;
981
+ ConsoleSize?: [number, number] | null;
982
+ DetachKeys?: string;
983
+ Tty?: boolean;
984
+ Env?: string[];
985
+ Cmd?: string[];
986
+ Privileged?: boolean;
987
+ User?: string;
988
+ WorkingDir?: string;
989
+ };
990
+ /** Inspection response for an exec instance. */
991
+ type ExecInspect = {
992
+ CanRemove?: boolean;
993
+ DetachKeys?: string;
994
+ ID?: string;
995
+ Running?: boolean;
996
+ ExitCode?: number;
997
+ ProcessConfig?: {
998
+ privileged?: boolean;
999
+ user?: string;
1000
+ tty?: boolean;
1001
+ entrypoint?: string;
1002
+ arguments?: string[];
1003
+ };
1004
+ OpenStdin?: boolean;
1005
+ OpenStderr?: boolean;
1006
+ OpenStdout?: boolean;
1007
+ ContainerID?: string;
1008
+ Pid?: number;
1009
+ };
1010
+ /** Options for starting an exec instance. */
1011
+ type ExecStartOptions = {
1012
+ Detach?: boolean;
1013
+ Tty?: boolean;
1014
+ ConsoleSize?: [number, number] | null;
1015
+ };
1016
+ /** A Docker Swarm service. */
1017
+ type Service = {
1018
+ ID?: string;
1019
+ Version?: ObjectVersion;
1020
+ CreatedAt?: string;
1021
+ UpdatedAt?: string;
1022
+ Spec?: ServiceSpec;
1023
+ Endpoint?: {
1024
+ Spec?: EndpointSpec;
1025
+ Ports?: EndpointPortConfig[];
1026
+ VirtualIPs?: Array<{
1027
+ NetworkID?: string;
1028
+ Addr?: string;
1029
+ }>;
1030
+ };
1031
+ UpdateStatus?: {
1032
+ State?: string;
1033
+ StartedAt?: string;
1034
+ CompletedAt?: string;
1035
+ Message?: string;
1036
+ };
1037
+ ServiceStatus?: {
1038
+ RunningTasks?: number;
1039
+ DesiredTasks?: number;
1040
+ CompletedTasks?: number;
1041
+ };
1042
+ JobStatus?: {
1043
+ JobIteration?: ObjectVersion;
1044
+ LastExecution?: string;
1045
+ };
1046
+ [key: string]: unknown;
1047
+ };
1048
+ /** Version number for optimistic concurrency control. */
1049
+ type ObjectVersion = {
1050
+ Index?: number;
1051
+ };
1052
+ /** User-modifiable configuration for a service. */
1053
+ type ServiceSpec = {
1054
+ Name?: string;
1055
+ Labels?: Record<string, string>;
1056
+ TaskTemplate?: Record<string, unknown>;
1057
+ Mode?: {
1058
+ Replicated?: {
1059
+ Replicas?: number;
1060
+ };
1061
+ Global?: {};
1062
+ ReplicatedJob?: {
1063
+ MaxConcurrent?: number;
1064
+ TotalCompletions?: number;
1065
+ };
1066
+ GlobalJob?: {};
1067
+ };
1068
+ UpdateConfig?: ServiceUpdateConfig;
1069
+ RollbackConfig?: ServiceUpdateConfig;
1070
+ Networks?: Array<{
1071
+ Target?: string;
1072
+ Aliases?: string[];
1073
+ }>;
1074
+ EndpointSpec?: EndpointSpec;
1075
+ [key: string]: unknown;
1076
+ };
1077
+ /** Update/rollback configuration for a service. */
1078
+ type ServiceUpdateConfig = {
1079
+ Parallelism?: number;
1080
+ Delay?: number;
1081
+ FailureAction?: string;
1082
+ Monitor?: number;
1083
+ MaxFailureRatio?: number;
1084
+ Order?: string;
1085
+ };
1086
+ /** Endpoint specification for a service. */
1087
+ type EndpointSpec = {
1088
+ Mode?: string;
1089
+ Ports?: EndpointPortConfig[];
1090
+ };
1091
+ /** Port configuration for a service endpoint. */
1092
+ type EndpointPortConfig = {
1093
+ Name?: string;
1094
+ Protocol?: string;
1095
+ TargetPort?: number;
1096
+ PublishedPort?: number;
1097
+ PublishMode?: string;
1098
+ };
1099
+ /** Options for creating a service. */
1100
+ type ServiceCreateOptions = {
1101
+ Name?: string;
1102
+ Labels?: Record<string, string>;
1103
+ TaskTemplate?: Record<string, unknown>;
1104
+ Mode?: ServiceSpec["Mode"];
1105
+ UpdateConfig?: ServiceUpdateConfig;
1106
+ RollbackConfig?: ServiceUpdateConfig;
1107
+ Networks?: Array<{
1108
+ Target?: string;
1109
+ Aliases?: string[];
1110
+ }>;
1111
+ EndpointSpec?: EndpointSpec;
1112
+ authconfig?: AuthConfig;
1113
+ [key: string]: unknown;
1114
+ };
1115
+ /** Response from service create. */
1116
+ type ServiceCreateResponse = {
1117
+ ID: string;
1118
+ Warnings?: string[] | null;
1119
+ };
1120
+ /** Options for updating a service. */
1121
+ type ServiceUpdateOptions = {
1122
+ version: number;
1123
+ Name?: string;
1124
+ Labels?: Record<string, string>;
1125
+ TaskTemplate?: Record<string, unknown>;
1126
+ Mode?: ServiceSpec["Mode"];
1127
+ UpdateConfig?: ServiceUpdateConfig;
1128
+ RollbackConfig?: ServiceUpdateConfig;
1129
+ Networks?: Array<{
1130
+ Target?: string;
1131
+ Aliases?: string[];
1132
+ }>;
1133
+ EndpointSpec?: EndpointSpec;
1134
+ authconfig?: AuthConfig;
1135
+ registryAuthFrom?: string;
1136
+ rollback?: string;
1137
+ [key: string]: unknown;
1138
+ };
1139
+ /** Response from service update. */
1140
+ type ServiceUpdateResponse = {
1141
+ Warnings?: string[];
1142
+ };
1143
+ /** A Swarm task. */
1144
+ type Task = {
1145
+ ID?: string;
1146
+ Version?: ObjectVersion;
1147
+ CreatedAt?: string;
1148
+ UpdatedAt?: string;
1149
+ Name?: string;
1150
+ Labels?: Record<string, string>;
1151
+ Spec?: Record<string, unknown>;
1152
+ ServiceID?: string;
1153
+ Slot?: number;
1154
+ NodeID?: string;
1155
+ AssignedGenericResources?: unknown[];
1156
+ Status?: {
1157
+ Timestamp?: string;
1158
+ State?: string;
1159
+ Message?: string;
1160
+ Err?: string;
1161
+ ContainerStatus?: {
1162
+ ContainerID?: string;
1163
+ PID?: number;
1164
+ ExitCode?: number;
1165
+ };
1166
+ PortStatus?: {
1167
+ Ports?: EndpointPortConfig[];
1168
+ };
1169
+ };
1170
+ DesiredState?: string;
1171
+ JobIteration?: ObjectVersion;
1172
+ [key: string]: unknown;
1173
+ };
1174
+ /** A Swarm node. */
1175
+ type Node = {
1176
+ ID?: string;
1177
+ Version?: ObjectVersion;
1178
+ CreatedAt?: string;
1179
+ UpdatedAt?: string;
1180
+ Spec?: NodeSpec;
1181
+ Description?: {
1182
+ Hostname?: string;
1183
+ Platform?: {
1184
+ Architecture?: string;
1185
+ OS?: string;
1186
+ };
1187
+ Resources?: {
1188
+ NanoCPUs?: number;
1189
+ MemoryBytes?: number;
1190
+ GenericResources?: unknown[];
1191
+ };
1192
+ Engine?: {
1193
+ EngineVersion?: string;
1194
+ Labels?: Record<string, string>;
1195
+ Plugins?: Array<{
1196
+ Type?: string;
1197
+ Name?: string;
1198
+ }>;
1199
+ };
1200
+ TLSInfo?: {
1201
+ TrustRoot?: string;
1202
+ CertIssuerSubject?: string;
1203
+ CertIssuerPublicKey?: string;
1204
+ };
1205
+ };
1206
+ Status?: {
1207
+ State?: string;
1208
+ Message?: string;
1209
+ Addr?: string;
1210
+ };
1211
+ ManagerStatus?: {
1212
+ Leader?: boolean;
1213
+ Reachability?: string;
1214
+ Addr?: string;
1215
+ } | null;
1216
+ [key: string]: unknown;
1217
+ };
1218
+ /** Node specification (user-modifiable fields). */
1219
+ type NodeSpec = {
1220
+ Name?: string;
1221
+ Labels?: Record<string, string>;
1222
+ Role?: "worker" | "manager";
1223
+ Availability?: "active" | "pause" | "drain";
1224
+ };
1225
+ /** A Swarm secret. */
1226
+ type Secret = {
1227
+ ID?: string;
1228
+ Version?: ObjectVersion;
1229
+ CreatedAt?: string;
1230
+ UpdatedAt?: string;
1231
+ Spec?: SecretSpec;
1232
+ [key: string]: unknown;
1233
+ };
1234
+ /** Secret specification. */
1235
+ type SecretSpec = {
1236
+ Name?: string;
1237
+ Labels?: Record<string, string>;
1238
+ Data?: string;
1239
+ Driver?: {
1240
+ Name: string;
1241
+ Options?: Record<string, string>;
1242
+ };
1243
+ Templating?: {
1244
+ Name: string;
1245
+ Options?: Record<string, string>;
1246
+ };
1247
+ };
1248
+ /** Options for creating a secret. */
1249
+ type SecretCreateOptions = {
1250
+ Name: string;
1251
+ Labels?: Record<string, string>;
1252
+ Data: string;
1253
+ Driver?: {
1254
+ Name: string;
1255
+ Options?: Record<string, string>;
1256
+ };
1257
+ Templating?: {
1258
+ Name: string;
1259
+ Options?: Record<string, string>;
1260
+ };
1261
+ };
1262
+ /** A Swarm config object. */
1263
+ type Config = {
1264
+ ID?: string;
1265
+ Version?: ObjectVersion;
1266
+ CreatedAt?: string;
1267
+ UpdatedAt?: string;
1268
+ Spec?: ConfigSpec;
1269
+ [key: string]: unknown;
1270
+ };
1271
+ /** Config specification. */
1272
+ type ConfigSpec = {
1273
+ Name?: string;
1274
+ Labels?: Record<string, string>;
1275
+ Data?: string;
1276
+ Templating?: {
1277
+ Name: string;
1278
+ Options?: Record<string, string>;
1279
+ };
1280
+ };
1281
+ /** Options for creating a config. */
1282
+ type ConfigCreateOptions = {
1283
+ Name: string;
1284
+ Labels?: Record<string, string>;
1285
+ Data: string;
1286
+ Templating?: {
1287
+ Name: string;
1288
+ Options?: Record<string, string>;
1289
+ };
1290
+ };
1291
+ /** Response from POST /auth. */
1292
+ type AuthResponse = {
1293
+ Status: string;
1294
+ IdentityToken?: string;
1295
+ };
1296
+ /** Options for initializing a swarm. */
1297
+ type SwarmInitOptions = {
1298
+ ListenAddr: string;
1299
+ AdvertiseAddr?: string;
1300
+ DataPathAddr?: string;
1301
+ DataPathPort?: number;
1302
+ ForceNewCluster?: boolean;
1303
+ Spec?: Record<string, unknown>;
1304
+ DefaultAddrPool?: string[];
1305
+ SubnetSize?: number;
1306
+ [key: string]: unknown;
1307
+ };
1308
+ /** Options for joining a swarm. */
1309
+ type SwarmJoinOptions = {
1310
+ ListenAddr: string;
1311
+ AdvertiseAddr?: string;
1312
+ DataPathAddr?: string;
1313
+ RemoteAddrs: string[];
1314
+ JoinToken: string;
1315
+ [key: string]: unknown;
1316
+ };
1317
+ /** Options for leaving a swarm. */
1318
+ type SwarmLeaveOptions = {
1319
+ force?: boolean;
1320
+ };
1321
+ /** Options for updating a swarm. */
1322
+ type SwarmUpdateOptions = {
1323
+ version: number;
1324
+ rotateWorkerToken?: boolean;
1325
+ rotateManagerToken?: boolean;
1326
+ rotateManagerUnlockKey?: boolean;
1327
+ Spec?: Record<string, unknown>;
1328
+ [key: string]: unknown;
1329
+ };
1330
+ /** Options for the events endpoint. */
1331
+ type EventsOptions = {
1332
+ since?: string;
1333
+ until?: string;
1334
+ filters?: Record<string, string[]>;
1335
+ };
1336
+ /** A Docker plugin. */
1337
+ type Plugin = {
1338
+ Id?: string;
1339
+ Name: string;
1340
+ Enabled: boolean;
1341
+ Settings: {
1342
+ Mounts: Array<Record<string, unknown>>;
1343
+ Env: string[];
1344
+ Args: string[];
1345
+ Devices: Array<Record<string, unknown>>;
1346
+ };
1347
+ PluginReference?: string;
1348
+ Config: {
1349
+ Description: string;
1350
+ Documentation: string;
1351
+ Interface: {
1352
+ Types: string[];
1353
+ Socket: string;
1354
+ ProtocolScheme?: string;
1355
+ };
1356
+ Entrypoint: string[];
1357
+ WorkDir: string;
1358
+ User?: {
1359
+ UID?: number;
1360
+ GID?: number;
1361
+ };
1362
+ Network: {
1363
+ Type: string;
1364
+ };
1365
+ Linux: {
1366
+ Capabilities: string[];
1367
+ AllowAllDevices: boolean;
1368
+ Devices: Array<Record<string, unknown>>;
1369
+ };
1370
+ PropagatedMount: string;
1371
+ IpcHost: boolean;
1372
+ PidHost: boolean;
1373
+ Mounts: Array<Record<string, unknown>>;
1374
+ Env: Array<Record<string, unknown>>;
1375
+ Args: {
1376
+ Name: string;
1377
+ Description: string;
1378
+ Settable: string[];
1379
+ Value: string[];
1380
+ };
1381
+ rootfs?: {
1382
+ type?: string;
1383
+ diff_ids?: string[];
1384
+ };
1385
+ [key: string]: unknown;
1386
+ };
1387
+ [key: string]: unknown;
1388
+ };
1389
+ /** Describes a permission the user has to accept upon installing a plugin. */
1390
+ type PluginPrivilege = {
1391
+ Name?: string;
1392
+ Description?: string;
1393
+ Value?: string[];
1394
+ };
1395
+ //#endregion
1396
+ //#region src/client/system.d.ts
1397
+ declare class SystemOperations {
1398
+ private readonly transport;
1399
+ private readonly apiVersion;
1400
+ constructor(transport: Transport, apiVersion: string);
1401
+ ping(): Promise<Result<string, DockerError>>;
1402
+ info(): Promise<Result<DockerInfo, DockerError>>;
1403
+ version(): Promise<Result<DockerVersion, DockerError>>;
1404
+ df(): Promise<Result<SystemDf, DockerError>>;
1405
+ swarmInit(options: SwarmInitOptions): Promise<Result<string, DockerError>>;
1406
+ swarmJoin(options: SwarmJoinOptions): Promise<Result<void, DockerError>>;
1407
+ swarmLeave(options?: SwarmLeaveOptions): Promise<Result<void, DockerError>>;
1408
+ swarmUpdate(options: SwarmUpdateOptions): Promise<Result<void, DockerError>>;
1409
+ swarmInspect(): Promise<Result<unknown, DockerError>>;
1410
+ events(options?: EventsOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1411
+ auth(options: AuthConfig): Promise<Result<AuthResponse, DockerError>>;
1412
+ pruneBuilder(options?: BuilderPruneOptions): Promise<Result<BuilderPruneResponse, DockerError>>;
1413
+ }
1414
+ //#endregion
1415
+ //#region src/client/exec.d.ts
1416
+ type ExecStartWithStdinOptions = ExecStartOptions & {
1417
+ stdin?: boolean;
1418
+ };
1419
+ declare class Exec {
1420
+ private readonly transport;
1421
+ private readonly apiVersion;
1422
+ readonly id: string;
1423
+ constructor(transport: Transport, apiVersion: string, id: string);
1424
+ start(options?: ExecStartWithStdinOptions): Promise<Result<NodeJS.ReadableStream | Duplex, DockerError>>;
1425
+ resize(options: {
1426
+ h: number;
1427
+ w: number;
1428
+ }): Promise<Result<void, DockerError>>;
1429
+ inspect(): Promise<Result<ExecInspect, DockerError>>;
1430
+ }
1431
+ //#endregion
1432
+ //#region src/client/container.d.ts
1433
+ type ContainerListOptions = {
1434
+ all?: boolean;
1435
+ limit?: number;
1436
+ size?: boolean;
1437
+ filters?: Filters;
1438
+ };
1439
+ type ContainerStopOptions = {
1440
+ t?: number;
1441
+ };
1442
+ type ContainerRestartOptions = {
1443
+ t?: number;
1444
+ };
1445
+ type ContainerKillOptions = {
1446
+ signal?: string;
1447
+ };
1448
+ type ContainerRemoveOptions = {
1449
+ v?: boolean;
1450
+ force?: boolean;
1451
+ link?: boolean;
1452
+ };
1453
+ type ContainerWaitOptions = {
1454
+ condition?: "not-running" | "next-exit" | "removed";
1455
+ };
1456
+ type ContainerResizeOptions = {
1457
+ h: number;
1458
+ w: number;
1459
+ };
1460
+ type ContainerAttachOptions = {
1461
+ detachKeys?: string;
1462
+ logs?: boolean;
1463
+ stream?: boolean;
1464
+ stdin?: boolean;
1465
+ stdout?: boolean;
1466
+ stderr?: boolean;
1467
+ };
1468
+ type ContainerStatsOptions = {
1469
+ stream?: boolean;
1470
+ "one-shot"?: boolean;
1471
+ };
1472
+ type ContainerArchiveOptions = {
1473
+ path: string;
1474
+ };
1475
+ type ContainerPruneOptions = {
1476
+ filters?: Filters;
1477
+ };
1478
+ type ContainerCommitOptions = {
1479
+ repo?: string;
1480
+ tag?: string;
1481
+ comment?: string;
1482
+ author?: string;
1483
+ pause?: boolean;
1484
+ changes?: string;
1485
+ [key: string]: unknown;
1486
+ };
1487
+ type ContainerUpdateOptions = {
1488
+ Memory?: number;
1489
+ MemorySwap?: number;
1490
+ MemoryReservation?: number;
1491
+ NanoCpus?: number;
1492
+ CpuShares?: number;
1493
+ CpuPeriod?: number;
1494
+ CpuQuota?: number;
1495
+ CpusetCpus?: string;
1496
+ CpusetMems?: string;
1497
+ BlkioWeight?: number;
1498
+ RestartPolicy?: {
1499
+ Name?: string;
1500
+ MaximumRetryCount?: number;
1501
+ };
1502
+ PidsLimit?: number;
1503
+ [key: string]: unknown;
1504
+ };
1505
+ declare class Container {
1506
+ private readonly transport;
1507
+ private readonly apiVersion;
1508
+ readonly id: string;
1509
+ constructor(transport: Transport, apiVersion: string, id: string);
1510
+ inspect(): Promise<Result<ContainerInspect, DockerError>>;
1511
+ start(): Promise<Result<void, DockerError>>;
1512
+ stop(options?: ContainerStopOptions): Promise<Result<void, DockerError>>;
1513
+ restart(options?: ContainerRestartOptions): Promise<Result<void, DockerError>>;
1514
+ kill(options?: ContainerKillOptions): Promise<Result<void, DockerError>>;
1515
+ pause(): Promise<Result<void, DockerError>>;
1516
+ unpause(): Promise<Result<void, DockerError>>;
1517
+ remove(options?: ContainerRemoveOptions): Promise<Result<void, DockerError>>;
1518
+ rename(name: string): Promise<Result<void, DockerError>>;
1519
+ update(options: ContainerUpdateOptions): Promise<Result<ContainerUpdateResponse, DockerError>>;
1520
+ top(psArgs?: string): Promise<Result<ContainerTopResponse, DockerError>>;
1521
+ changes(): Promise<Result<ContainerChange[], DockerError>>;
1522
+ logs(options?: LogsOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1523
+ stats(options?: ContainerStatsOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1524
+ wait(options?: ContainerWaitOptions): Promise<Result<WaitResponse, DockerError>>;
1525
+ resize(options: ContainerResizeOptions): Promise<Result<void, DockerError>>;
1526
+ attach(options?: ContainerAttachOptions): Promise<Result<NodeJS.ReadableStream | Duplex, DockerError>>;
1527
+ exec(options: ExecCreateOptions): Promise<Result<Exec, DockerError>>;
1528
+ export(): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1529
+ getArchive(options: ContainerArchiveOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1530
+ putArchive(options: ContainerArchiveOptions, stream: NodeJS.ReadableStream): Promise<Result<void, DockerError>>;
1531
+ listCheckpoints(): Promise<Result<unknown[], DockerError>>;
1532
+ createCheckpoint(options: CheckpointCreateOptions): Promise<Result<void, DockerError>>;
1533
+ deleteCheckpoint(name: string): Promise<Result<void, DockerError>>;
1534
+ infoArchive(options: ContainerArchiveOptions): Promise<Result<ArchiveInfo, DockerError>>;
1535
+ commit(options?: ContainerCommitOptions): Promise<Result<IdResponse, DockerError>>;
1536
+ }
1537
+ declare class ContainerOperations {
1538
+ private readonly transport;
1539
+ private readonly apiVersion;
1540
+ constructor(transport: Transport, apiVersion: string);
1541
+ list(options?: ContainerListOptions): Promise<Result<ContainerSummary[], DockerError>>;
1542
+ create(options: CreateContainerOptions): Promise<Result<Container, DockerError>>;
1543
+ inspect(id: string): Promise<Result<ContainerInspect, DockerError>>;
1544
+ prune(options?: ContainerPruneOptions): Promise<Result<PruneResponse, DockerError>>;
1545
+ getContainer(id: string): Container;
1546
+ }
1547
+ //#endregion
1548
+ //#region src/client/image.d.ts
1549
+ type ImageListOptions = {
1550
+ all?: boolean;
1551
+ filters?: Filters;
1552
+ digests?: boolean;
1553
+ };
1554
+ type ImageSearchOptions = {
1555
+ term: string;
1556
+ limit?: number;
1557
+ filters?: Filters;
1558
+ };
1559
+ type ImagePruneOptions = {
1560
+ filters?: Filters;
1561
+ };
1562
+ type ImageTagOptions = {
1563
+ repo: string;
1564
+ tag?: string;
1565
+ };
1566
+ type ImageRemoveOptions = {
1567
+ force?: boolean;
1568
+ noprune?: boolean;
1569
+ };
1570
+ type ImagePushOptions = {
1571
+ tag?: string;
1572
+ };
1573
+ declare class Image {
1574
+ private readonly transport;
1575
+ private readonly apiVersion;
1576
+ readonly name: string;
1577
+ constructor(transport: Transport, apiVersion: string, name: string);
1578
+ inspect(): Promise<Result<ImageInspect, DockerError>>;
1579
+ history(): Promise<Result<ImageHistory[], DockerError>>;
1580
+ push(options?: ImagePushOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1581
+ tag(options: ImageTagOptions): Promise<Result<void, DockerError>>;
1582
+ remove(options?: ImageRemoveOptions): Promise<Result<ImageDeleteResponseItem[], DockerError>>;
1583
+ get(): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1584
+ distribution(): Promise<Result<Record<string, unknown>, DockerError>>;
1585
+ }
1586
+ declare class ImageOperations {
1587
+ private readonly transport;
1588
+ private readonly apiVersion;
1589
+ constructor(transport: Transport, apiVersion: string);
1590
+ list(options?: ImageListOptions): Promise<Result<ImageSummary[], DockerError>>;
1591
+ create(options: CreateImageOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1592
+ build(context: NodeJS.ReadableStream | Buffer, options?: BuildOptions & {
1593
+ authconfig?: AuthConfig;
1594
+ registryconfig?: Record<string, AuthConfig>;
1595
+ }): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1596
+ load(stream: NodeJS.ReadableStream): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1597
+ import(stream: NodeJS.ReadableStream, options?: ImageImportOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1598
+ search(options: ImageSearchOptions): Promise<Result<SearchResult[], DockerError>>;
1599
+ prune(options?: ImagePruneOptions): Promise<Result<PruneResponse, DockerError>>;
1600
+ getImage(name: string): Image;
1601
+ }
1602
+ //#endregion
1603
+ //#region src/client/volume.d.ts
1604
+ type VolumeListOptions = {
1605
+ filters?: Filters;
1606
+ };
1607
+ type VolumePruneOptions = {
1608
+ filters?: Filters;
1609
+ };
1610
+ type VolumeRemoveOptions = {
1611
+ force?: boolean;
1612
+ };
1613
+ declare class VolumeEntity {
1614
+ private readonly transport;
1615
+ private readonly apiVersion;
1616
+ readonly name: string;
1617
+ constructor(transport: Transport, apiVersion: string, name: string);
1618
+ inspect(): Promise<Result<Volume, DockerError>>;
1619
+ remove(options?: VolumeRemoveOptions): Promise<Result<void, DockerError>>;
1620
+ }
1621
+ declare class VolumeOperations {
1622
+ private readonly transport;
1623
+ private readonly apiVersion;
1624
+ constructor(transport: Transport, apiVersion: string);
1625
+ list(options?: VolumeListOptions): Promise<Result<VolumeListResponse, DockerError>>;
1626
+ create(options: CreateVolumeOptions): Promise<Result<Volume, DockerError>>;
1627
+ inspect(name: string): Promise<Result<Volume, DockerError>>;
1628
+ prune(options?: VolumePruneOptions): Promise<Result<PruneResponse, DockerError>>;
1629
+ getVolume(name: string): VolumeEntity;
1630
+ }
1631
+ //#endregion
1632
+ //#region src/client/network.d.ts
1633
+ type NetworkListOptions = {
1634
+ filters?: Filters;
1635
+ };
1636
+ type NetworkPruneOptions = {
1637
+ filters?: Filters;
1638
+ };
1639
+ declare class NetworkEntity {
1640
+ private readonly transport;
1641
+ private readonly apiVersion;
1642
+ readonly id: string;
1643
+ constructor(transport: Transport, apiVersion: string, id: string);
1644
+ inspect(): Promise<Result<Network, DockerError>>;
1645
+ remove(): Promise<Result<void, DockerError>>;
1646
+ connect(options: NetworkConnectOptions): Promise<Result<void, DockerError>>;
1647
+ disconnect(options: NetworkDisconnectOptions): Promise<Result<void, DockerError>>;
1648
+ }
1649
+ declare class NetworkOperations {
1650
+ private readonly transport;
1651
+ private readonly apiVersion;
1652
+ constructor(transport: Transport, apiVersion: string);
1653
+ list(options?: NetworkListOptions): Promise<Result<Network[], DockerError>>;
1654
+ create(options: NetworkCreateOptions): Promise<Result<NetworkCreateResponse, DockerError>>;
1655
+ inspect(id: string): Promise<Result<Network, DockerError>>;
1656
+ prune(options?: NetworkPruneOptions): Promise<Result<PruneResponse, DockerError>>;
1657
+ getNetwork(id: string): NetworkEntity;
1658
+ }
1659
+ //#endregion
1660
+ //#region src/client/service.d.ts
1661
+ type ServiceListOptions = {
1662
+ filters?: Filters;
1663
+ status?: boolean;
1664
+ };
1665
+ declare class ServiceEntity {
1666
+ private readonly transport;
1667
+ private readonly apiVersion;
1668
+ readonly id: string;
1669
+ constructor(transport: Transport, apiVersion: string, id: string);
1670
+ inspect(): Promise<Result<Service, DockerError>>;
1671
+ update(options: ServiceUpdateOptions): Promise<Result<void, DockerError>>;
1672
+ remove(): Promise<Result<void, DockerError>>;
1673
+ logs(options?: LogsOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1674
+ }
1675
+ declare class ServiceOperations {
1676
+ private readonly transport;
1677
+ private readonly apiVersion;
1678
+ constructor(transport: Transport, apiVersion: string);
1679
+ list(options?: ServiceListOptions): Promise<Result<Service[], DockerError>>;
1680
+ create(options: ServiceCreateOptions): Promise<Result<ServiceCreateResponse, DockerError>>;
1681
+ inspect(id: string): Promise<Result<Service, DockerError>>;
1682
+ getService(id: string): ServiceEntity;
1683
+ }
1684
+ //#endregion
1685
+ //#region src/client/task.d.ts
1686
+ type TaskListOptions = {
1687
+ filters?: Filters;
1688
+ };
1689
+ declare class TaskEntity {
1690
+ private readonly transport;
1691
+ private readonly apiVersion;
1692
+ readonly id: string;
1693
+ constructor(transport: Transport, apiVersion: string, id: string);
1694
+ inspect(): Promise<Result<Task, DockerError>>;
1695
+ logs(options?: LogsOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1696
+ }
1697
+ declare class TaskOperations {
1698
+ private readonly transport;
1699
+ private readonly apiVersion;
1700
+ constructor(transport: Transport, apiVersion: string);
1701
+ list(options?: TaskListOptions): Promise<Result<Task[], DockerError>>;
1702
+ inspect(id: string): Promise<Result<Task, DockerError>>;
1703
+ getTask(id: string): TaskEntity;
1704
+ }
1705
+ //#endregion
1706
+ //#region src/client/node.d.ts
1707
+ type NodeListOptions = {
1708
+ filters?: Filters;
1709
+ };
1710
+ type NodeUpdateOptions = {
1711
+ version: number;
1712
+ Name?: string;
1713
+ Labels?: Record<string, string>;
1714
+ Role?: NodeSpec["Role"];
1715
+ Availability?: NodeSpec["Availability"];
1716
+ };
1717
+ type NodeRemoveOptions = {
1718
+ force?: boolean;
1719
+ };
1720
+ declare class NodeEntity {
1721
+ private readonly transport;
1722
+ private readonly apiVersion;
1723
+ readonly id: string;
1724
+ constructor(transport: Transport, apiVersion: string, id: string);
1725
+ inspect(): Promise<Result<Node, DockerError>>;
1726
+ update(options: NodeUpdateOptions): Promise<Result<void, DockerError>>;
1727
+ remove(options?: NodeRemoveOptions): Promise<Result<void, DockerError>>;
1728
+ }
1729
+ declare class NodeOperations {
1730
+ private readonly transport;
1731
+ private readonly apiVersion;
1732
+ constructor(transport: Transport, apiVersion: string);
1733
+ list(options?: NodeListOptions): Promise<Result<Node[], DockerError>>;
1734
+ inspect(id: string): Promise<Result<Node, DockerError>>;
1735
+ getNode(id: string): NodeEntity;
1736
+ }
1737
+ //#endregion
1738
+ //#region src/client/secret.d.ts
1739
+ type SecretListOptions = {
1740
+ filters?: Filters;
1741
+ };
1742
+ type SecretUpdateOptions = {
1743
+ version: number;
1744
+ Name?: string;
1745
+ Labels?: Record<string, string>;
1746
+ Data?: string;
1747
+ Driver?: {
1748
+ Name: string;
1749
+ Options?: Record<string, string>;
1750
+ };
1751
+ Templating?: {
1752
+ Name: string;
1753
+ Options?: Record<string, string>;
1754
+ };
1755
+ };
1756
+ declare class SecretEntity {
1757
+ private readonly transport;
1758
+ private readonly apiVersion;
1759
+ readonly id: string;
1760
+ constructor(transport: Transport, apiVersion: string, id: string);
1761
+ inspect(): Promise<Result<Secret, DockerError>>;
1762
+ update(options: SecretUpdateOptions): Promise<Result<void, DockerError>>;
1763
+ remove(): Promise<Result<void, DockerError>>;
1764
+ }
1765
+ declare class SecretOperations {
1766
+ private readonly transport;
1767
+ private readonly apiVersion;
1768
+ constructor(transport: Transport, apiVersion: string);
1769
+ list(options?: SecretListOptions): Promise<Result<Secret[], DockerError>>;
1770
+ create(options: SecretCreateOptions): Promise<Result<IdResponse, DockerError>>;
1771
+ inspect(id: string): Promise<Result<Secret, DockerError>>;
1772
+ getSecret(id: string): SecretEntity;
1773
+ }
1774
+ //#endregion
1775
+ //#region src/client/config.d.ts
1776
+ type ConfigListOptions = {
1777
+ filters?: Filters;
1778
+ };
1779
+ type ConfigUpdateOptions = {
1780
+ version: number;
1781
+ Name?: string;
1782
+ Labels?: Record<string, string>;
1783
+ Data?: string;
1784
+ Templating?: {
1785
+ Name: string;
1786
+ Options?: Record<string, string>;
1787
+ };
1788
+ };
1789
+ declare class ConfigEntity {
1790
+ private readonly transport;
1791
+ private readonly apiVersion;
1792
+ readonly id: string;
1793
+ constructor(transport: Transport, apiVersion: string, id: string);
1794
+ inspect(): Promise<Result<Config, DockerError>>;
1795
+ update(options: ConfigUpdateOptions): Promise<Result<void, DockerError>>;
1796
+ remove(): Promise<Result<void, DockerError>>;
1797
+ }
1798
+ declare class ConfigOperations {
1799
+ private readonly transport;
1800
+ private readonly apiVersion;
1801
+ constructor(transport: Transport, apiVersion: string);
1802
+ list(options?: ConfigListOptions): Promise<Result<Config[], DockerError>>;
1803
+ create(options: ConfigCreateOptions): Promise<Result<IdResponse, DockerError>>;
1804
+ inspect(id: string): Promise<Result<Config, DockerError>>;
1805
+ getConfig(id: string): ConfigEntity;
1806
+ }
1807
+ //#endregion
1808
+ //#region src/client/plugin.d.ts
1809
+ type PluginListOptions = {
1810
+ filters?: Filters;
1811
+ };
1812
+ type PluginPrivilegesOptions = {
1813
+ remote: string;
1814
+ };
1815
+ type PluginInstallOptions = {
1816
+ remote: string;
1817
+ name?: string;
1818
+ };
1819
+ type PluginCreateOptions = {
1820
+ name: string;
1821
+ };
1822
+ type PluginRemoveOptions = {
1823
+ force?: boolean;
1824
+ };
1825
+ type PluginEnableOptions = {
1826
+ timeout?: number;
1827
+ };
1828
+ type PluginDisableOptions = {
1829
+ Force?: boolean;
1830
+ };
1831
+ type PluginConfigureOptions = {
1832
+ env: string[];
1833
+ };
1834
+ type PluginUpgradeOptions = {
1835
+ remote: string;
1836
+ };
1837
+ declare class PluginEntity {
1838
+ private readonly transport;
1839
+ private readonly apiVersion;
1840
+ readonly name: string;
1841
+ constructor(transport: Transport, apiVersion: string, name: string);
1842
+ inspect(): Promise<Result<Plugin, DockerError>>;
1843
+ remove(options?: PluginRemoveOptions): Promise<Result<Plugin, DockerError>>;
1844
+ enable(options?: PluginEnableOptions): Promise<Result<void, DockerError>>;
1845
+ disable(options?: PluginDisableOptions): Promise<Result<void, DockerError>>;
1846
+ push(): Promise<Result<void, DockerError>>;
1847
+ configure(options: PluginConfigureOptions): Promise<Result<void, DockerError>>;
1848
+ upgrade(options: PluginUpgradeOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1849
+ }
1850
+ declare class PluginOperations {
1851
+ private readonly transport;
1852
+ private readonly apiVersion;
1853
+ constructor(transport: Transport, apiVersion: string);
1854
+ list(options?: PluginListOptions): Promise<Result<Plugin[], DockerError>>;
1855
+ privileges(options: PluginPrivilegesOptions): Promise<Result<PluginPrivilege[], DockerError>>;
1856
+ install(options: PluginInstallOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1857
+ create(options: PluginCreateOptions): Promise<Result<void, DockerError>>;
1858
+ getPlugin(name: string): PluginEntity;
1859
+ }
1860
+ //#endregion
1861
+ //#region src/client/index.d.ts
1862
+ type DockerConfig = {
1863
+ transport: TransportConfig;
1864
+ apiVersion: string;
1865
+ timeoutMs?: number;
1866
+ };
1867
+ type PullOptions = {
1868
+ authconfig?: AuthConfig;
1869
+ platform?: string;
1870
+ };
1871
+ type RunOptions = Omit<CreateContainerOptions, "Image" | "Cmd"> & {
1872
+ autoRemove?: boolean;
1873
+ };
1874
+ type RunResult = {
1875
+ output: WaitResponse;
1876
+ container: Container;
1877
+ };
1878
+ declare class Docker {
1879
+ readonly system: SystemOperations;
1880
+ readonly containers: ContainerOperations;
1881
+ readonly images: ImageOperations;
1882
+ readonly volumes: VolumeOperations;
1883
+ readonly networks: NetworkOperations;
1884
+ readonly services: ServiceOperations;
1885
+ readonly tasks: TaskOperations;
1886
+ readonly nodes: NodeOperations;
1887
+ readonly secrets: SecretOperations;
1888
+ readonly configs: ConfigOperations;
1889
+ readonly plugins: PluginOperations;
1890
+ private readonly transport;
1891
+ private readonly apiVersion;
1892
+ constructor(config: DockerConfig);
1893
+ /** Create Docker client with pre-existing transport (for testing). */
1894
+ static fromTransport(transport: Transport, opts: {
1895
+ apiVersion: string;
1896
+ }): Docker;
1897
+ /**
1898
+ * Create Docker client from environment variables.
1899
+ * Reads DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH, DOCKER_CLIENT_TIMEOUT.
1900
+ */
1901
+ static fromEnv(opts?: {
1902
+ apiVersion?: string;
1903
+ }): Docker;
1904
+ /**
1905
+ * Pull an image from a registry.
1906
+ * Returns a progress stream of newline-delimited JSON.
1907
+ */
1908
+ pull(repoTag: string, options?: PullOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1909
+ /**
1910
+ * Create and run a container, waiting for it to exit.
1911
+ * Returns the wait result and the container instance.
1912
+ */
1913
+ run(image: string, cmd: string[], options?: RunOptions): Promise<Result<RunResult, DockerError>>;
1914
+ destroy(): void;
1915
+ }
1916
+ //#endregion
1917
+ //#region src/transport/npipe-transport.d.ts
1918
+ type RequestFn = typeof http.request;
1919
+ type NamedPipeTransportOptions = {
1920
+ path?: string; /** @internal For testing only. Override the http.request function. */
1921
+ _requestFn?: RequestFn;
1922
+ };
1923
+ declare class NamedPipeTransport implements Transport {
1924
+ private readonly pipePath;
1925
+ private readonly requestFn;
1926
+ constructor(options: NamedPipeTransportOptions);
1927
+ dial(options: DialOptions): Promise<Result<DialResponse, DockerError>>;
1928
+ dialStream(options: DialOptions): Promise<Result<NodeJS.ReadableStream, DockerError>>;
1929
+ dialHijack(options: DialOptions): Promise<Result<net.Socket, DockerError>>;
1930
+ destroy(): void;
1931
+ private performHijack;
1932
+ private performRequest;
1933
+ private convertError;
1934
+ }
1935
+ //#endregion
1936
+ //#region src/transport/index.d.ts
1937
+ declare function createTransport(config: TransportConfig): Transport;
1938
+ /**
1939
+ * Create a transport by auto-detecting configuration from environment variables.
1940
+ *
1941
+ * Environment variables:
1942
+ * - DOCKER_HOST: Docker daemon socket (unix://, tcp://, ssh://, npipe://)
1943
+ * - DOCKER_TLS_VERIFY: Set to "1" to enable TLS verification
1944
+ * - DOCKER_CERT_PATH: Directory containing ca.pem, cert.pem, key.pem
1945
+ * - DOCKER_CLIENT_TIMEOUT: Default timeout in seconds
1946
+ */
1947
+ declare function createTransportFromEnv(): Transport;
1948
+ //#endregion
1949
+ //#region src/transport/http-duplex.d.ts
1950
+ /**
1951
+ * HttpDuplex wraps a raw net.Socket (obtained from HTTP hijack/upgrade)
1952
+ * into a Node.js Duplex stream for bidirectional I/O.
1953
+ *
1954
+ * Used for interactive attach/exec operations where stdin needs to be
1955
+ * written to the connection while stdout/stderr is read from it.
1956
+ */
1957
+ declare class HttpDuplex extends Duplex {
1958
+ private readonly socket;
1959
+ constructor(socket: net.Socket);
1960
+ _read(_size: number): void;
1961
+ _write(chunk: Buffer | string, _encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
1962
+ _final(callback: (error?: Error | null) => void): void;
1963
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
1964
+ }
1965
+ //#endregion
1966
+ //#region src/transport/stream-utils.d.ts
1967
+ declare class DockerStream extends EventEmitter {
1968
+ readonly isTty: boolean;
1969
+ private readonly source;
1970
+ constructor(source: NodeJS.ReadableStream, isTty: boolean);
1971
+ /**
1972
+ * Destroys the underlying source stream.
1973
+ */
1974
+ destroy(): void;
1975
+ }
1976
+ /**
1977
+ * Separates a Docker multiplexed stream into stdout and stderr PassThrough
1978
+ * streams based on the Docker stream multiplexing protocol.
1979
+ *
1980
+ * Docker multiplexed format: 8-byte header per frame
1981
+ * - Byte 0: stream type (0=stdin, 1=stdout, 2=stderr)
1982
+ * - Bytes 1-3: padding (0)
1983
+ * - Bytes 4-7: payload size (big-endian uint32)
1984
+ * - Followed by `size` bytes of payload
1985
+ */
1986
+ declare function demuxStream(source: NodeJS.ReadableStream): {
1987
+ stdout: PassThrough;
1988
+ stderr: PassThrough;
1989
+ };
1990
+ /**
1991
+ * Follows a newline-delimited JSON progress stream (e.g., from pull/push/build).
1992
+ * Accumulates all events and calls onFinished when the stream ends.
1993
+ * Optionally calls onProgress for each event as it arrives.
1994
+ */
1995
+ declare function followProgress(stream: NodeJS.ReadableStream, onFinished: (err: Error | null, output: unknown[]) => void, onProgress?: (event: unknown) => void): void;
1996
+ //#endregion
1997
+ //#region src/session/index.d.ts
1998
+ type SessionResult = {
1999
+ sessionId: string;
2000
+ close: () => void;
2001
+ };
2002
+ /**
2003
+ * Establishes a BuildKit gRPC session over a hijacked HTTP connection.
2004
+ *
2005
+ * This is used for BuildKit v2 builds to provide registry credentials
2006
+ * to the builder during image builds.
2007
+ */
2008
+ declare function withSession(transport: Transport, apiVersion: string, auth?: AuthConfig): Promise<Result<SessionResult, DockerError>>;
2009
+ //#endregion
2010
+ export { type ArchiveInfo, type AuthConfig, type AuthResponse, type BuildOptions, type BuilderPruneOptions, type BuilderPruneResponse, type CheckpointCreateOptions, type Config, type ConfigCreateOptions, ConfigEntity, type ConfigListOptions, ConfigOperations, type ConfigSpec, type ConfigUpdateOptions, Container, type ContainerArchiveOptions, type ContainerAttachOptions, type ContainerChange, type ContainerCommitOptions, type ContainerConfig, type ContainerInspect, type ContainerKillOptions, type ContainerListOptions, ContainerOperations, type ContainerPruneOptions, type ContainerRemoveOptions, type ContainerResizeOptions, type ContainerRestartOptions, type ContainerState, type ContainerStats, type ContainerStatsOptions, type ContainerStopOptions, type ContainerSummary, type ContainerTopResponse, type ContainerUpdateOptions, type ContainerUpdateResponse, type ContainerWaitOptions, type CreateContainerOptions, type CreateContainerResponse, type CreateImageOptions, type CreateVolumeOptions, type DialOptions, type DialResponse, Docker, DockerAbortError, type DockerApiError, DockerBadRequestError, type DockerConfig, DockerConflictError, DockerDecodeError, type DockerError, DockerForbiddenError, type DockerInfo, DockerNetworkError, DockerNotFoundError, DockerServerError, DockerServiceUnavailableError, DockerStream, DockerTimeoutError, type DockerTransportError, DockerUnauthorizedError, DockerUnknownError, type DockerVersion, type EndpointIPAMConfig, type EndpointPortConfig, type EndpointSettings, type EndpointSpec, type EventActor, type EventMessage, type EventsOptions, Exec, type ExecCreateOptions, type ExecInspect, type ExecStartOptions, type ExecStartWithStdinOptions, type Filters, type HealthConfig, type HostConfig, HttpDuplex, type HttpMethod, type IPAM, type IdResponse, Image, type ImageConfig, type ImageDeleteResponseItem, type ImageHistory, type ImageImportOptions, type ImageInspect, type ImageListOptions, ImageOperations, type ImagePruneOptions, type ImagePushOptions, type ImageRemoveOptions, type ImageSearchOptions, type ImageSummary, type ImageTagOptions, type LogsOptions, type Mount, type MountPoint, NamedPipeTransport, type Network, type NetworkConnectOptions, type NetworkCreateOptions, type NetworkCreateResponse, type NetworkDisconnectOptions, NetworkEntity, type NetworkListOptions, NetworkOperations, type NetworkPruneOptions, type NetworkSettings, type NetworkingConfig, type Node, NodeEntity, type NodeListOptions, NodeOperations, type NodeRemoveOptions, type NodeSpec, type NodeUpdateOptions, type ObjectVersion, type Plugin, type PluginConfigureOptions, type PluginCreateOptions, type PluginDisableOptions, type PluginEnableOptions, PluginEntity, type PluginInstallOptions, type PluginListOptions, PluginOperations, type PluginPrivilege, type PluginPrivilegesOptions, type PluginRemoveOptions, type PluginUpgradeOptions, type Port, type PortBinding, type PruneResponse, type PullOptions, type RestartPolicy, type RunOptions, type RunResult, type SearchResult, type Secret, type SecretCreateOptions, SecretEntity, type SecretListOptions, SecretOperations, type SecretSpec, type SecretUpdateOptions, type Service, type ServiceCreateOptions, type ServiceCreateResponse, ServiceEntity, type ServiceListOptions, ServiceOperations, type ServiceSpec, type ServiceUpdateConfig, type ServiceUpdateOptions, type ServiceUpdateResponse, type SessionResult, type StatusCodeMap, type SwarmInitOptions, type SwarmJoinOptions, type SwarmLeaveOptions, type SwarmUpdateOptions, type SystemDf, SystemOperations, type Task, TaskEntity, type TaskListOptions, TaskOperations, type TlsConfig, type Transport, type TransportConfig, type Volume, VolumeEntity, type VolumeListOptions, type VolumeListResponse, VolumeOperations, type VolumePruneOptions, type VolumeRemoveOptions, type WaitResponse, createTransport, createTransportFromEnv, demuxStream, followProgress, statusCodeToError, withSession };
2011
+ //# sourceMappingURL=index.d.mts.map