//native
type Mollie = {
token: string;
};
/**
* List permissions
* Retrieve a list of all permissions available to the current access token.
The results are **not** paginated.
> 🔑 Access with
>
> Access token
*/
export async function main(auth: Mollie) {
const url = new URL(`https://api.mollie.com/v2/permissions`);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + 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 428 days ago