//native
type Phrase = {
token: string
baseUrl: string
}
/**
* Delete a blocked key
* Delete an existing rule for blocking keys.
*/
export async function main(auth: Phrase, project_id: string, id: string) {
const url = new URL(`${auth.baseUrl}/projects/${project_id}/blacklisted_keys/${id}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'ApiToken ' + auth.token
},
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