import { adaptServer } from "../server" ; import { listDeployments as listDeploymentsInner , } from "../server/deployment" ; import { ApiResponse , WithLogger , withOpsSetup } from "./common" ; export interface DeploymentInfo { deployID : string ; } export interface ListOptions extends WithLogger { adaptUrl : string ; } export interface ListResponse extends ApiResponse { type : "success" ; deployments : DeploymentInfo [ ] ; } export async function listDeployments ( options ) { const setup = { name : "listDeployments" , description : "Listing deployments" , ... options , } ; return withOpsSetup ( setup , async ( info ) : Promise < ListResponse > => { const { logger } = info ; const server = await adaptServer ( options . adaptUrl , { } ) ; return { type : "success" , deployments : await listDeploymentsInner ( server ) , messages : logger . messages , summary : logger . summary , } ; } ) ; }