//native
type Zuplo = {
apiKey: string
}
/**
* Deletes a deployment
* Deletes the specified deployment.
*/
export async function main(auth: Zuplo, deploymentName: string) {
const url = new URL(`https://dev.zuplo.com/v1/deployments/${deploymentName}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 235 days ago