//native
type Botify = {
token: string
}
/**
* Get datasources summary by projects
* Get the datasources details for all projects of a user
*/
export async function main(auth: Botify, username: string) {
const url = new URL(`https://api.botify.com/users/${username}/datasources_summary_by_projects`)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Token ' + 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 2 days ago