//native
type Confluence = {
email: string
apiToken: string
domain: string
}
/**
* Remove label from content
* Removes a label from a piece of content.
*/
export async function main(auth: Confluence, id: string, label: string) {
const url = new URL(`https://${auth.domain}/wiki/rest/api/content/${id}/label/${label}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Basic ' + btoa(`${auth.email}:${auth.apiToken}`)
},
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