export default async function sendcloudHelper(url: string, method: string = 'GET', body: any) {
  const config = useRuntimeConfig()
  
  let options: any = {}
  if(body) {
    options = {
      ...options,
      body: body
    }
  }

  return await $fetch(config.api.sendcloud+'/'+url, {
    method: method,
    headers: {
      Accept: 'application/pdf, application/json',
      'Content-Type': 'application/json',
      Authorization: 'Basic ' + btoa(config.api.sendcloudpublickey+':'+config.api.sendcloudprivatekey)
    },
    ...options
  })
}