@dockstat/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,686 @@
1
+ import type { BodyInit } from "bun"
2
+
3
+ /**
4
+ * Image summary information returned by list
5
+ */
6
+ export interface ImageSummary {
7
+ Id: string
8
+ ParentId: string
9
+ RepoTags: string[]
10
+ RepoDigests: string[]
11
+ Created: number
12
+ Size: number
13
+ SharedSize: number
14
+ Labels?: Record<string, string>
15
+ Containers: number
16
+ Manifests?: ImageManifestSummary[]
17
+ Descriptor?: OCIDescriptor
18
+ }
19
+
20
+ /**
21
+ * Detailed image information returned by inspect
22
+ */
23
+ export interface ImageInspect {
24
+ Id: string
25
+ Descriptor?: OCIDescriptor
26
+ Identity?: Identity
27
+ Manifests?: ImageManifestSummary[]
28
+ RepoTags?: string[]
29
+ RepoDigests?: string[]
30
+ Comment?: string
31
+ Created?: string
32
+ Author?: string
33
+ Config?: ImageConfig
34
+ Architecture?: string
35
+ Variant?: string
36
+ Os?: string
37
+ OsVersion?: string
38
+ Size?: number
39
+ GraphDriver?: GraphDriver
40
+ RootFS?: RootFS
41
+ Metadata?: ImageMetadata
42
+ }
43
+
44
+ /**
45
+ * Image configuration
46
+ */
47
+ export interface ImageConfig {
48
+ User?: string
49
+ ExposedPorts?: Record<string, object>
50
+ Env?: string[]
51
+ Cmd?: string[]
52
+ Healthcheck?: HealthConfig
53
+ ArgsEscaped?: boolean
54
+ Volumes?: Record<string, object>
55
+ WorkingDir?: string
56
+ Entrypoint?: string[]
57
+ OnBuild?: string[]
58
+ Labels?: Record<string, string>
59
+ StopSignal?: string
60
+ Shell?: string[]
61
+ }
62
+
63
+ /**
64
+ * Root filesystem information
65
+ */
66
+ export interface RootFS {
67
+ Type: string
68
+ Layers: string[]
69
+ }
70
+
71
+ /**
72
+ * Image metadata
73
+ */
74
+ export interface ImageMetadata {
75
+ LastTagTime?: string
76
+ }
77
+
78
+ /**
79
+ * Graph driver information
80
+ */
81
+ export interface GraphDriver {
82
+ Name: string
83
+ Data: Record<string, string>
84
+ }
85
+
86
+ /**
87
+ * Image history item
88
+ */
89
+ export interface ImageHistoryResponseItem {
90
+ Id: string
91
+ Created: number
92
+ CreatedBy: string
93
+ Tags: string[]
94
+ Size: number
95
+ Comment: string
96
+ }
97
+
98
+ /**
99
+ * Image delete response item
100
+ */
101
+ export interface ImageDeleteResponseItem {
102
+ Untagged?: string
103
+ Deleted?: string
104
+ }
105
+
106
+ /**
107
+ * Images disk usage
108
+ */
109
+ export interface ImagesDiskUsage {
110
+ ActiveCount: number
111
+ TotalCount: number
112
+ Reclaimable: number
113
+ TotalSize: number
114
+ Items?: ImageSummary[]
115
+ }
116
+
117
+ /**
118
+ * Image search result
119
+ */
120
+ export interface ImageSearchResponseItem {
121
+ description: string
122
+ is_official: boolean
123
+ is_automated: boolean
124
+ name: string
125
+ star_count: number
126
+ }
127
+
128
+ /**
129
+ * Image prune response
130
+ */
131
+ export interface ImagePruneResponse {
132
+ ImagesDeleted?: ImageDeleteResponseItem[]
133
+ SpaceReclaimed: number
134
+ }
135
+
136
+ /**
137
+ * OCI descriptor
138
+ */
139
+ export interface OCIDescriptor {
140
+ mediaType: string
141
+ digest: string
142
+ size: number
143
+ urls?: string[]
144
+ annotations?: Record<string, string>
145
+ data?: string
146
+ platform?: OCIPlatform
147
+ artifactType?: string
148
+ }
149
+
150
+ /**
151
+ * OCI platform
152
+ */
153
+ export interface OCIPlatform {
154
+ architecture: string
155
+ os: string
156
+ "os.version"?: string
157
+ "os.features"?: string[]
158
+ variant?: string
159
+ }
160
+
161
+ /**
162
+ * Image manifest summary
163
+ */
164
+ export interface ImageManifestSummary {
165
+ ID: string
166
+ Descriptor: OCIDescriptor
167
+ Available: boolean
168
+ Size: {
169
+ Total: number
170
+ Content: number
171
+ }
172
+ Kind: "manifest" | "index" | "unknown"
173
+ ImageData?: {
174
+ Platform: OCIPlatform
175
+ Identity?: Identity
176
+ Containers?: string[]
177
+ Size?: {
178
+ Unpacked: number
179
+ }
180
+ }
181
+ AttestationData?: {
182
+ For: string
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Identity information
188
+ */
189
+ export interface Identity {
190
+ Signature?: SignatureIdentity[]
191
+ Pull?: PullIdentity[]
192
+ Build?: BuildIdentity[]
193
+ }
194
+
195
+ /**
196
+ * Build identity
197
+ */
198
+ export interface BuildIdentity {
199
+ Ref: string
200
+ CreatedAt: string
201
+ }
202
+
203
+ /**
204
+ * Pull identity
205
+ */
206
+ export interface PullIdentity {
207
+ Repository: string
208
+ }
209
+
210
+ /**
211
+ * Signature identity
212
+ */
213
+ export interface SignatureIdentity {
214
+ Name: string
215
+ Timestamps: SignatureTimestamp[]
216
+ KnownSigner?: KnownSignerIdentity
217
+ DockerReference?: string
218
+ Signer?: SignerIdentity
219
+ SignatureType?: SignatureType
220
+ Error?: string
221
+ Warnings?: string[]
222
+ }
223
+
224
+ /**
225
+ * Signature timestamp
226
+ */
227
+ export interface SignatureTimestamp {
228
+ Type: SignatureTimestampType
229
+ URI?: string
230
+ Timestamp: string
231
+ }
232
+
233
+ /**
234
+ * Signature timestamp type
235
+ */
236
+ export type SignatureTimestampType = "sig" | "exp" | "att"
237
+
238
+ /**
239
+ * Signature type
240
+ */
241
+ export type SignatureType = "cosign" | "notation" | "sbom"
242
+
243
+ /**
244
+ * Known signer identity
245
+ */
246
+ export type KnownSignerIdentity = "docker-official" | "docker-notary-service"
247
+
248
+ /**
249
+ * Signer identity
250
+ */
251
+ export interface SignerIdentity {
252
+ CertificateIssuer?: string
253
+ SubjectAlternativeName?: string
254
+ Issuer?: string
255
+ BuildSignerURI?: string
256
+ BuildSignerDigest?: string
257
+ RunnerEnvironment?: string
258
+ SourceRepositoryURI?: string
259
+ SourceRepositoryDigest?: string
260
+ SourceRepositoryRef?: string
261
+ SourceRepositoryIdentifier?: string
262
+ SourceRepositoryOwnerURI?: string
263
+ SourceRepositoryOwnerIdentifier?: string
264
+ BuildConfigURI?: string
265
+ BuildConfigDigest?: string
266
+ BuildTrigger?: string
267
+ RunInvocationURI?: string
268
+ SourceRepositoryVisibilityAtSigning?: string
269
+ }
270
+
271
+ /**
272
+ * Image ID
273
+ */
274
+ export interface ImageID {
275
+ Id: string
276
+ }
277
+
278
+ /**
279
+ * Create image information
280
+ */
281
+ export interface CreateImageInfo {
282
+ id?: string
283
+ errorDetail?: ErrorDetail
284
+ status?: string
285
+ progressDetail?: ProgressDetail
286
+ }
287
+
288
+ /**
289
+ * Push image information
290
+ */
291
+ export interface PushImageInfo {
292
+ errorDetail?: ErrorDetail
293
+ status?: string
294
+ progressDetail?: ProgressDetail
295
+ }
296
+
297
+ /**
298
+ * Error detail
299
+ */
300
+ export interface ErrorDetail {
301
+ code?: number
302
+ message: string
303
+ }
304
+
305
+ /**
306
+ * Progress detail
307
+ */
308
+ export interface ProgressDetail {
309
+ current?: number
310
+ total?: number
311
+ }
312
+
313
+ /**
314
+ * Health configuration
315
+ */
316
+ export interface HealthConfig {
317
+ Test?: string[]
318
+ Interval?: number
319
+ Timeout?: number
320
+ Retries?: number
321
+ StartPeriod?: number
322
+ StartInterval?: number
323
+ }
324
+
325
+ /**
326
+ * Build cache disk usage
327
+ */
328
+ export interface BuildCacheDiskUsage {
329
+ ActiveCount: number
330
+ TotalCount: number
331
+ Reclaimable: number
332
+ TotalSize: number
333
+ Items?: BuildCache[]
334
+ }
335
+
336
+ /**
337
+ * Build cache
338
+ */
339
+ export interface BuildCache {
340
+ ID: string
341
+ Parents?: string[]
342
+ Type: string
343
+ Description?: string
344
+ InUse?: boolean
345
+ Shared?: boolean
346
+ Size?: number
347
+ CreatedAt: string
348
+ LastUsedAt?: string
349
+ UsageCount?: number
350
+ }
351
+
352
+ // ============================================================================
353
+ // Request/Response Types
354
+ // ============================================================================
355
+
356
+ /**
357
+ * List images options
358
+ */
359
+ export interface ListImagesOptions {
360
+ all?: boolean
361
+ filters?: {
362
+ before?: string[]
363
+ dangling?: string[]
364
+ label?: string[]
365
+ reference?: string[]
366
+ since?: string[]
367
+ until?: string[]
368
+ }
369
+ sharedSize?: boolean
370
+ digests?: boolean
371
+ manifests?: boolean
372
+ identity?: boolean
373
+ }
374
+
375
+ /**
376
+ * Pull image options
377
+ */
378
+ export interface PullImageOptions {
379
+ fromImage: string
380
+ tag?: string
381
+ platform?: string
382
+ fromSrc?: string
383
+ repo?: string
384
+ message?: string
385
+ inputImage?: BodyInit
386
+ changes?: string[]
387
+ authHeader?: string
388
+ }
389
+
390
+ /**
391
+ * Push image options
392
+ */
393
+ export interface PushImageOptions {
394
+ tag?: string
395
+ platform?: string
396
+ authHeader: string
397
+ }
398
+
399
+ /**
400
+ * Tag image options
401
+ */
402
+ export interface TagImageOptions {
403
+ repo: string
404
+ tag?: string
405
+ }
406
+
407
+ /**
408
+ * Remove image options
409
+ */
410
+ export interface RemoveImageOptions {
411
+ force?: boolean
412
+ noprune?: boolean
413
+ platforms?: string[]
414
+ }
415
+
416
+ /**
417
+ * Search images options
418
+ */
419
+ export interface SearchImagesOptions {
420
+ term: string
421
+ limit?: number
422
+ filters?: {
423
+ "is-official"?: string[]
424
+ stars?: string[]
425
+ }
426
+ }
427
+
428
+ /**
429
+ * Prune images options
430
+ */
431
+ export interface PruneImagesOptions {
432
+ filters?: {
433
+ dangling?: string[]
434
+ until?: string[]
435
+ label?: string[]
436
+ }
437
+ }
438
+
439
+ /**
440
+ * Inspect image options
441
+ */
442
+ export interface InspectImageOptions {
443
+ manifests?: boolean
444
+ platform?: string
445
+ }
446
+
447
+ /**
448
+ * History image options
449
+ */
450
+ export interface HistoryImageOptions {
451
+ platform?: string
452
+ }
453
+
454
+ /**
455
+ * Export image options
456
+ */
457
+ export interface ExportImageOptions {
458
+ name: string
459
+ platform?: string[]
460
+ }
461
+
462
+ /**
463
+ * Export all images options
464
+ */
465
+ export interface ExportAllImagesOptions {
466
+ names?: string[]
467
+ platform?: string[]
468
+ }
469
+
470
+ /**
471
+ * Load image options
472
+ */
473
+ export interface LoadImageOptions {
474
+ imagesTarball: BodyInit
475
+ quiet?: boolean
476
+ platform?: string[]
477
+ }
478
+
479
+ /**
480
+ * Build image options
481
+ */
482
+ export interface BuildImageOptions {
483
+ inputStream?: BodyInit
484
+ dockerfile?: string
485
+ t?: string
486
+ extrahosts?: string
487
+ remote?: string
488
+ q?: boolean
489
+ nocache?: boolean
490
+ cachefrom?: string
491
+ pull?: string
492
+ rm?: boolean
493
+ forcerm?: boolean
494
+ memory?: number
495
+ memswap?: number
496
+ cpushares?: number
497
+ cpusetcpus?: string
498
+ cpuperiod?: number
499
+ cpuquota?: number
500
+ buildargs?: string
501
+ shmsize?: number
502
+ squash?: boolean
503
+ labels?: string
504
+ networkmode?: string
505
+ authConfig?: string
506
+ platform?: string
507
+ target?: string
508
+ outputs?: string
509
+ version?: "1" | "2"
510
+ }
511
+
512
+ /**
513
+ * Prune build cache options
514
+ */
515
+ export interface PruneBuildCacheOptions {
516
+ all?: boolean
517
+ "keep-storage"?: number
518
+ filters?: {
519
+ until?: string
520
+ id?: string[]
521
+ }
522
+ }
523
+
524
+ /**
525
+ *
526
+ */
527
+ export interface CommitParams {
528
+ container: string
529
+ repo: string
530
+ tag: string
531
+ comment: string
532
+ author: string
533
+ pause: boolean
534
+ changes: string
535
+ }
536
+ export interface CommitBody {
537
+ /** The hostname to use for the container, as a valid RFC 1123 hostname. */
538
+ Hostname: string
539
+ /** The domain name to use for the container. */
540
+ Domainname: string
541
+ /**
542
+ * Commands run as this user inside the container.
543
+ * If omitted, commands run as the user
544
+ * specified in the image the container was started from.
545
+ *
546
+ * Can be either user-name or UID, and optional group-name or GID,
547
+ * separated by a colon (`<user-name|UID>[<:group-name|GID>]`).
548
+ */
549
+ User: string
550
+ /**
551
+ * Whether to attach to stdin.
552
+ * Default: false
553
+ */
554
+ AttachStdin: boolean
555
+ /**
556
+ * Whether to attach to stdout.
557
+ * Default: true
558
+ */
559
+ AttachStdout: boolean
560
+ /**
561
+ * Whether to attach to stderr.
562
+ * Default: true
563
+ */
564
+ AttachStderr: boolean
565
+ /**
566
+ * An object mapping ports to an empty object in the form: {"<port>/<tcp|udp|sctp>": {}}
567
+ */
568
+ ExposedPorts: null | Record<string, unknown>
569
+ /**
570
+ * Attach standard streams to a TTY, including stdin if it is not closed.
571
+ * Default: false
572
+ */
573
+ Tty: boolean
574
+ /** Default: false */
575
+ OpenStdin: boolean
576
+ /**
577
+ * Close stdin after one attached client disconnects
578
+ * Default: false
579
+ */
580
+ StdinOnce: boolean
581
+ /**
582
+ * A list of environment variables to set inside the container
583
+ * in the form ["VAR=value", ...].
584
+ * A variable without = is removed from the environment,
585
+ * rather than to have an empty value.
586
+ */
587
+ Env: string[]
588
+ /** Command to run specified as a string or an array of strings. */
589
+ Cmd: string | string[]
590
+ /**
591
+ * A test to perform to check that the container is healthy.
592
+ * Healthcheck commands should be side-effect free.
593
+ */
594
+ HealthCheck: {
595
+ /**
596
+ * The test to perform. Possible values are:
597
+ * - [] inherit healthcheck from image or parent image
598
+ * - ["NONE"] disable healthcheck
599
+ * - ["CMD", args...] exec arguments directly
600
+ * - ["CMD-SHELL", command] run command with system's default shell
601
+ * A non-zero exit code indicates a failed healthcheck:
602
+ * - 0 healthy
603
+ * - 1 unhealthy
604
+ * - 2 reserved (treated as unhealthy)
605
+ * - other values: error running probe
606
+ */
607
+ Test: string[]
608
+ /**
609
+ * The time to wait between checks in nanoseconds.
610
+ * It should be 0 or at least 1000000 (1 ms). 0 means inherit.
611
+ */
612
+ Interval: number
613
+ /**
614
+ * The time to wait before considering the check to have hung.
615
+ * It should be 0 or at least 1000000 (1 ms). 0 means inherit.
616
+ */
617
+ Timeout: number
618
+ /**
619
+ * The number of consecutive failures needed to consider a container as unhealthy.
620
+ * 0 means inherit.
621
+ */
622
+ Retries: number
623
+ /** Start period for the container to initialize before starting health-retries
624
+ * countdown in nanoseconds.
625
+ * It should be 0 or at least 1000000 (1 ms).
626
+ * 0 means inherit.
627
+ * */
628
+ StartPeriod: number
629
+ /**
630
+ * The time to wait between checks in nanoseconds during the start period.
631
+ * It should be 0 or at least 1000000 (1 ms).
632
+ * 0 means inherit.
633
+ */
634
+ StartInterval: number
635
+ }
636
+ /**
637
+ * Command is already escaped (Windows only)
638
+ * Default: false
639
+ * */
640
+ ArgsEscaped: boolean | null
641
+ /**
642
+ * The name (or reference) of the image to use when creating the container,
643
+ * or which was used when the container was created.
644
+ */
645
+ Image: string
646
+ /**
647
+ * An object mapping mount point paths inside the container to empty objects.
648
+ */
649
+ Volumes: Record<string, unknown>
650
+ /**
651
+ * The working directory for commands to run in.
652
+ */
653
+ WorkingDir: string
654
+ /**
655
+ * The entry point for the container as a string or an array of strings.
656
+ * If the array consists of exactly one empty string ([""]),
657
+ * then the entry point is reset to system default
658
+ * (i.e., the entry point used by docker when there is no ENTRYPOINT instruction in the Dockerfile).
659
+ */
660
+ Entrypoint: string[]
661
+ /**
662
+ * Disable networking for the container.
663
+ */
664
+ NetworkDisabled: boolean | null
665
+ /**
666
+ * `ONBUILD` metadata that were defined in the image's Dockerfile.
667
+ */
668
+ OnBuild: string[] | null
669
+ /**
670
+ * User-defined key/value metadata.
671
+ */
672
+ Labels: Record<string, string>
673
+ /**
674
+ * Signal to stop a container as a string or unsigned integer.
675
+ */
676
+ StopSignal: string | number | null
677
+ /**
678
+ * Timeout to stop a container in seconds.
679
+ * Default: 10
680
+ */
681
+ StopTimeout: number
682
+ /**
683
+ * Shell for when RUN, CMD, and ENTRYPOINT uses a shell.
684
+ */
685
+ Shell: string[]
686
+ }