Initial push
This commit is contained in:
@@ -0,0 +1,260 @@
|
||||
// Mirrors the Go types in internal/spec, internal/dkr and internal/job.
|
||||
|
||||
export type MountKind = 'volume' | 'anonymous' | 'bind' | 'tmpfs' | string
|
||||
|
||||
export interface Mount {
|
||||
kind: MountKind
|
||||
name?: string
|
||||
source?: string
|
||||
destination: string
|
||||
readOnly: boolean
|
||||
propagation?: string
|
||||
tmpfsOpts?: string
|
||||
sizeBytes: number
|
||||
}
|
||||
|
||||
export interface Endpoint {
|
||||
network: string
|
||||
aliases?: string[]
|
||||
ipv4Address?: string
|
||||
ipv6Address?: string
|
||||
macAddress?: string
|
||||
}
|
||||
|
||||
export interface PortBinding {
|
||||
containerPort: string
|
||||
hostIp?: string
|
||||
hostPort?: string
|
||||
}
|
||||
|
||||
export interface Container {
|
||||
id: string
|
||||
name: string
|
||||
state: string
|
||||
image: string
|
||||
imageId: string
|
||||
imageDigest?: string
|
||||
composeProject?: string
|
||||
composeService?: string
|
||||
env?: string[]
|
||||
labels?: Record<string, string>
|
||||
cmd?: string[]
|
||||
entrypoint?: string[]
|
||||
restartPolicy?: string
|
||||
privileged?: boolean
|
||||
networkMode?: string
|
||||
endpoints?: Endpoint[]
|
||||
ports?: PortBinding[]
|
||||
mounts?: Mount[]
|
||||
warnings?: string[]
|
||||
}
|
||||
|
||||
export interface Volume {
|
||||
name: string
|
||||
driver: string
|
||||
driverOpts?: Record<string, string>
|
||||
labels?: Record<string, string>
|
||||
}
|
||||
|
||||
export interface NetworkSpec {
|
||||
name: string
|
||||
driver: string
|
||||
internal?: boolean
|
||||
attachable?: boolean
|
||||
}
|
||||
|
||||
export interface Inventory {
|
||||
host: string
|
||||
dockerVersion: string
|
||||
containers: Container[]
|
||||
volumes: Volume[]
|
||||
networks: NetworkSpec[]
|
||||
warnings?: string[]
|
||||
}
|
||||
|
||||
export type ImageMode = 'auto' | 'pull' | 'stream' | 'skip'
|
||||
export type MountAction = 'copy' | 'structure' | 'skip'
|
||||
export type ConflictPolicy = 'fail' | 'skip' | 'replace' | 'rename'
|
||||
|
||||
export interface MountSelection {
|
||||
action: MountAction
|
||||
targetSource?: string
|
||||
targetName?: string
|
||||
}
|
||||
|
||||
export interface ItemSelection {
|
||||
containerId: string
|
||||
include: boolean
|
||||
nameOverride?: string
|
||||
migrateImage: boolean
|
||||
imageMode: ImageMode
|
||||
migrateNetworks: boolean
|
||||
keepStaticIps: boolean
|
||||
migratePorts: boolean
|
||||
mounts: Record<string, MountSelection>
|
||||
startAfter: boolean
|
||||
stopSourceDuringCopy: boolean
|
||||
stopSourceAfter: boolean
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
conflict: ConflictPolicy
|
||||
renameSuffix?: string
|
||||
compress: boolean
|
||||
compressLevel: number
|
||||
dryRun: boolean
|
||||
parallelism: number
|
||||
verifyAfter: boolean
|
||||
}
|
||||
|
||||
export interface Plan {
|
||||
items: ItemSelection[]
|
||||
options: Options
|
||||
target?: string
|
||||
packageName?: string
|
||||
}
|
||||
|
||||
export interface SourceResponse {
|
||||
inventory: Inventory
|
||||
defaults: Record<string, ItemSelection>
|
||||
options: Options
|
||||
}
|
||||
|
||||
export type AuthMethod = 'password' | 'key' | 'agent'
|
||||
|
||||
export interface Connection {
|
||||
id: string
|
||||
name: string
|
||||
host: string
|
||||
port: number
|
||||
user: string
|
||||
auth: AuthMethod
|
||||
password?: string
|
||||
privateKey?: string
|
||||
privateKeyPath?: string
|
||||
passphrase?: string
|
||||
sudo: boolean
|
||||
dockerCmd?: string
|
||||
saveSecrets: boolean
|
||||
}
|
||||
|
||||
export interface Preflight {
|
||||
dockerVersion: string
|
||||
serverVersion: string
|
||||
os: string
|
||||
arch: string
|
||||
hasGzip: boolean
|
||||
diskFreeBytes: number
|
||||
dockerRoot: string
|
||||
problems?: string[]
|
||||
}
|
||||
|
||||
export interface TargetContainer {
|
||||
id: string
|
||||
name: string
|
||||
image: string
|
||||
state: string
|
||||
status: string
|
||||
ports: string
|
||||
}
|
||||
|
||||
export interface TargetInventory {
|
||||
host: string
|
||||
containers: TargetContainer[] | null
|
||||
volumes: string[] | null
|
||||
networks: string[] | null
|
||||
preflight: Preflight
|
||||
}
|
||||
|
||||
export interface HostKeyInfo {
|
||||
host: string
|
||||
keyType: string
|
||||
fingerprint: string
|
||||
trusted: boolean
|
||||
changed: boolean
|
||||
}
|
||||
|
||||
export type JobState = 'pending' | 'running' | 'succeeded' | 'failed' | 'skipped' | 'canceled'
|
||||
|
||||
export interface Step {
|
||||
id: string
|
||||
label: string
|
||||
state: JobState
|
||||
bytesDone: number
|
||||
bytesTotal: number
|
||||
error?: string
|
||||
startedAt?: string
|
||||
endedAt?: string
|
||||
}
|
||||
|
||||
export interface JobItem {
|
||||
id: string
|
||||
name: string
|
||||
state: JobState
|
||||
error?: string
|
||||
steps: Step[]
|
||||
warnings?: string[]
|
||||
}
|
||||
|
||||
export interface LogEntry {
|
||||
seq: number
|
||||
at: string
|
||||
level: 'info' | 'warn' | 'error' | 'cmd'
|
||||
item?: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface JobSnapshot {
|
||||
id: string
|
||||
kind: 'ssh' | 'package' | 'restore'
|
||||
title: string
|
||||
state: JobState
|
||||
dryRun: boolean
|
||||
error?: string
|
||||
createdAt: string
|
||||
startedAt?: string
|
||||
endedAt?: string
|
||||
items: JobItem[]
|
||||
log: LogEntry[]
|
||||
bytesDone: number
|
||||
bytesTotal: number
|
||||
artifact?: string
|
||||
artifactBytes?: number
|
||||
revision: number
|
||||
}
|
||||
|
||||
export interface PreviewItem {
|
||||
containerId: string
|
||||
name: string
|
||||
targetName: string
|
||||
image: string
|
||||
commands: string[] | null
|
||||
transfers: string[] | null
|
||||
notes: string[] | null
|
||||
warnings: string[] | null
|
||||
totalBytes: number
|
||||
}
|
||||
|
||||
export interface PreviewResponse {
|
||||
networkCommands: string[] | null
|
||||
items: PreviewItem[]
|
||||
}
|
||||
|
||||
export interface PackageInfo {
|
||||
name: string
|
||||
path: string
|
||||
bytes: number
|
||||
isDir: boolean
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface Health {
|
||||
ok: boolean
|
||||
dockerHost: string
|
||||
dockerVersion?: string
|
||||
dockerError?: string
|
||||
packageDir: string
|
||||
dataDir: string
|
||||
knownHosts: string
|
||||
authRequired: boolean
|
||||
}
|
||||
Reference in New Issue
Block a user