UNPKG

corellium-typescript

Version:
1 lines 395 B
const t=(t,e)=>({create:async()=>{const a=new URL("/api/v1/auth/apitoken",t),o=await fetch(a,{method:"POST",headers:{Authorization:e}});if(!o.ok)throw new Error(o.statusText);return await o.json()},delete:async()=>{const a=new URL("/api/v1/auth/apitoken",t),o=await fetch(a,{method:"DELETE",headers:{Authorization:e}});if(!o.ok)throw new Error(o.statusText)}});export{t as createTokenEndpoints};