import nodeFetch from "node-fetch" ; import { Client , createClient } from "../../generated/io-cgn-api/client" ; export function CgnAPIClient ( token , baseUrl , basePath , fetchApi = ( nodeFetch as any ) as typeof fetch ) { return createClient < "ApiKey" > ( { basePath , baseUrl , fetchApi , withDefaults : op => params => op ( { ... params , ApiKey : token } ) } ) ; } export type CgnAPIClient = typeof CgnAPIClient ;