Skip to content

xuxucode/docker-api-types

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker/Moby API types

This package only contains TypeScript declaration files. In case you do not want to introduce effect-ts in your project, only need the TypeScript types for API parameters and return types.

See https://github.com/leonitousconforti/the-moby-effect for full functional REST API.

Examples

import type { MobyEndpoints, MobySchemas } from 'docker-api-types'
import { toURLSearchParams } from './utils'

export type ContainerListOptions = NonNullable<Parameters<MobyEndpoints.Containers['list']>[0]>

export async function listContainers(params?: ContainerListOptions): Promise<MobySchemas.ContainerSummary[] | undefined> {
  const queryParams = toURLSearchParams(params)
  const response = await fetch(`/containers/json?${queryParams}`)
  if (response.ok) {
    return await response.json() as MobySchemas.ContainerSummary[]
  }
}

// import type { Brand, Effect } from 'docker-api-types/effect'

Credits

Huge thanks to Leo Conforti 👍

About

Moby/Docker API client built using effect-ts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.3%
  • Go 3.8%
  • JavaScript 0.6%
  • Dockerfile 0.2%
  • Nix 0.1%
  • Smarty 0.0%