//native
type SageIntacct = {
token: string
}
/**
* Returns allowed operations for specified objects.
* Get allowed operations
*/
export async function main(
auth: SageIntacct,
body: {
object?: string
keys?: string[]
operations?: string[]
options?: { includePrivate?: false | true; moduleKey?: string }
}
) {
const url = new URL(`https://api.intacct.com/ia/api/v1/services/core/allowed-operations/list`)
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.token
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago