import type { CreateClientConfig } from '../gen/client/client.gen'

const _100mb = 100 * 1024 * 1024
const maxBodyLength = _100mb
const maxContentLength = _100mb
const defaultHttpTimeout = 60_000

export const createClientConfig: CreateClientConfig = (config) => ({
  ...config,
  withCredentials: true,
  timeout: defaultHttpTimeout,
  maxBodyLength,
  maxContentLength,
  throwOnError: true,
  parseAs: 'json', // We do not always have the content type header in each request so we parse as json by default
})
