import{addOauthHeader as e}from"@clevercloud/client/esm/oauth.js";import{prefixUrl as t}from"@clevercloud/client/esm/prefix-url.js";import{execWarpscript as r}from"@clevercloud/client/esm/request-warp10.fetch.js";import{request as o}from"@clevercloud/client/esm/request.fetch.js";import{withCache as c}from"@clevercloud/client/esm/with-cache.js";import{withOptions as i}from"@clevercloud/client/esm/with-options.js";import{dispatchCustomEvent as n}from"./events.js";function s({apiConfig:r,signal:s,cacheDelay:l,timeout:m}){return u=>{const h={...r,...u};return c(h,l,(()=>{const{API_HOST:c="https://api.clever-cloud.com",...l}=r;return Promise.resolve(u).then(t(c)).then(e(l)).then(i({signal:s,timeout:m})).then(o).catch((e=>{throw n(window,"cc-api:error",e),e}))}))}}function l({apiConfig:e,signal:o,cacheDelay:n,timeout:s}){return l=>{const m={...e,...l};return c(m,n,(()=>{const{WARP_10_HOST:c}=e;return Promise.resolve(l).then(t(c)).then(i({signal:o,timeout:s})).then(r)}))}}export{s as sendToApi,l as sendToWarp};
//# sourceMappingURL=send-to-api.js.map
