//native
type Confluence = {
email: string
apiToken: string
domain: string
}
/**
* Reset space theme
* Resets the space theme. This means that the space will inherit the
global look and feel settings
**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
'Admin' permission for the space.
*/
export async function main(auth: Confluence, spaceKey: string) {
const url = new URL(`https://${auth.domain}/wiki/rest/api/space/${spaceKey}/theme`)
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