@autofleet/rapido-http-client 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +1 -1
- package/dist/{utils-CwsK3pZM.cjs → utils-BIXrZN8_.cjs} +2 -2
- package/dist/{utils-CwsK3pZM.cjs.map → utils-BIXrZN8_.cjs.map} +1 -1
- package/dist/{utils-DSeLox4O.js → utils-CXxwjP2v.js} +2 -2
- package/dist/{utils-DSeLox4O.js.map → utils-CXxwjP2v.js.map} +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./utils-
|
|
1
|
+
Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./utils-BIXrZN8_.cjs`);let l=require(`node:http`),u=require(`undici`);u=s(u);let d=require(`@autofleet/outbreak`);const f=Symbol.for(`RapidoHttpClientErrorBrand`);let p;(function(e){e.UndiciError=u.errors.UndiciError,e.ConnectTimeoutError=u.errors.ConnectTimeoutError,e.HeadersTimeoutError=u.errors.HeadersTimeoutError,e.HeadersOverflowError=u.errors.HeadersOverflowError,e.BodyTimeoutError=u.errors.BodyTimeoutError,e.ResponseError=u.errors.ResponseError,e.InvalidArgumentError=u.errors.InvalidArgumentError,e.InvalidReturnValueError=u.errors.InvalidReturnValueError,e.RequestAbortedError=u.errors.RequestAbortedError,e.InformationalError=u.errors.InformationalError,e.RequestContentLengthMismatchError=u.errors.RequestContentLengthMismatchError,e.ResponseContentLengthMismatchError=u.errors.ResponseContentLengthMismatchError,e.ClientDestroyedError=u.errors.ClientDestroyedError,e.ClientClosedError=u.errors.ClientClosedError,e.SocketError=u.errors.SocketError,e.NotSupportedError=u.errors.NotSupportedError,e.BalancedPoolMissingUpstreamError=u.errors.BalancedPoolMissingUpstreamError,e.HTTPParserError=u.errors.HTTPParserError,e.ResponseExceededMaxSizeError=u.errors.ResponseExceededMaxSizeError,e.RequestRetryError=u.errors.RequestRetryError,e.SecureProxyConnectionError=u.errors.SecureProxyConnectionError,e.MaxOriginsReachedError=u.errors.MaxOriginsReachedError;function t(e){return typeof e==`object`&&!!e&&f in e}e.isRapidoHttpClientError=t;class n extends u.errors.ResponseError{constructor(e,t,n,r){super(`HTTP Error ${t.statusCode}`,t.statusCode,{headers:t.headers,body:e}),this.response=t,this.data=n,this.status=t.statusCode,this.statusText=l.STATUS_CODES[t.statusCode]||`Unknown Status`,this.requestOptions=r?.requestOptions,r?.cause&&(this.cause=r.cause),Object.defineProperty(this,f,{value:!0,enumerable:!1,writable:!1})}static isRapidoHttpClientError(e){return t(e)}}e.RapidoHttpClientError=n})(p||={});const m=Symbol(`testAgentParam`),h=e=>function(t,n){let r=(0,d.getCurrentContext)().context;if(r){let e;e=Array.isArray(t.headers)?Object.fromEntries(t.headers):{...t.headers};for(let[t,n]of r)typeof n==`symbol`||n===void 0||(e[t]=n);t.headers=e}return e(t,n)},{cacheStores:g}=u.default,{cache:_,retry:v,decompress:y}=u.interceptors,b=[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`,`QUERY`];var x=class{#e;get(e,t){return this.#i(`GET`,e,void 0,t)}post(e,t,n){return this.#i(`POST`,e,t,n)}delete(e,t){return this.#i(`DELETE`,e,void 0,t)}head(e,t){return this.#i(`HEAD`,e,void 0,t)}put(e,t,n){return this.#i(`PUT`,e,t,n)}patch(e,t,n){return this.#i(`PATCH`,e,t,n)}options(e,t){return this.#i(`OPTIONS`,e,void 0,t)}query(e,t,n){return this.#i(`QUERY`,e,t,n)}constructor(e){this.#e=e.logger.child(`RapidoHttpClient`,{}),this.settings=c.o(e.autoDecompress?c.i:c.r,e),this.#t();let t=globalThis.__RAPIDO_HTTP_CLIENT_MOCK_AGENT__;this.client=this.settings[m]??t??new u.Agent({connect:{timeout:this.settings.timeout},keepAliveTimeout:this.settings.keepAliveTimeout,keepAliveMaxTimeout:this.settings.keepAliveMaxTimeout,connections:this.settings.connections}),this.settings.cache&&(this.client=this.client.compose(_({store:new g.MemoryCacheStore({...this.settings.cache})}))),this.settings.retries&&(this.client=this.client.compose(v({methods:b,...this.settings.retries,retry:(e,t,n)=>{let{counter:r}=t.state,i=t.opts.retryOptions?.maxRetries??5;(this.settings.retries?.retry??c.n)(e,t,a=>{if(!a){let{method:n,origin:a,path:o}=t.opts,s=!a||typeof a==`string`?a:a.origin;this.#e.warn(`Request retry attempt ${r}/${i}: ${c.t(n,s,o)}`,{err:e})}n(a)})}}))),this.settings.autoDecompress&&(this.client=this.client.compose(y({skipErrorResponses:!1}))),this.client=this.client.compose(h)}#t(){let e=c.c(this.settings),t=new URL(e);this.settings.baseURL=t.origin,this.settings.basePath=t.pathname===`/`?``:t.pathname}#n(e,t){if(!e&&!t)return{signal:void 0,timeoutSignal:void 0};if(e&&!t)return{signal:e,timeoutSignal:void 0};let n=AbortSignal.timeout(t);return!e&&t?{signal:n,timeoutSignal:n}:{signal:AbortSignal.any([e,n]),timeoutSignal:n}}#r(e,t){if(e!=null){if(c.a(e))return!t[`Content-Type`]&&!t[`content-type`]&&(t[`Content-Type`]=`application/x-www-form-urlencoded`),e;if(typeof e==`object`&&!Buffer.isBuffer(e)){let n=t[`Content-Type`]||t[`content-type`];if(n&&/application\/x-www-form-urlencoded/i.test(n)){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>t.append(n,String(e))):r!=null&&t.append(n,String(r));return t.toString()}return!t[`Content-Type`]&&!t[`content-type`]&&(t[`Content-Type`]=`application/json`),JSON.stringify(e)}return typeof e==`string`||Buffer.isBuffer(e)?e:String(e)}}async#i(e,t,n,r={}){let i=c.o(this.settings,r);if(i.signal?.aborted)throw this.#e.error(`Request aborted before start: ${c.t(e,i.baseURL,t)}`),new p.RequestAbortedError(i.signal.reason?.message||`Request aborted`,{cause:i.signal.reason});let{successSchema:a,errorSchema:o}=r,s={...i.headers},u=this.#r(n,s),{origin:d,path:f}=c.s(t,i.baseURL,i.basePath),m={method:e,baseURL:d,url:t};if(i.params)for(let[e,t]of Object.entries(i.params))Array.isArray(t)&&!e.endsWith(`[]`)&&(i.params[`${e}[]`]=t,delete i.params[e]);let{signal:h,timeoutSignal:g}=this.#n(i.signal,i.timeout);try{this.#e.info(`Start Request: ${c.t(e,d,f)}`);let t={path:f,origin:d,method:e,signal:h,headers:s,body:u,query:i.params},n=await this.client.request(t);if(d.startsWith(`http://`)&&n.statusCode>=300&&n.statusCode<400){let e=[n.headers.location].flat()[0]??`unknown location`;throw new p.RapidoHttpClientError(u,n,void 0,{requestOptions:t,cause:Error(`Redirect to ${e} on HTTP origin, which is not supported for security reasons`)})}if(!(i.validateStatus??(()=>n.statusCode<400))(n.statusCode)){let r=await this.#s(u,n,o);throw this.#e.error(`Finish Request with error ${c.t(e,d,f)}`,{status:n.statusCode,data:r}),new p.RapidoHttpClientError(u,n,r,{requestOptions:t})}return this.#e.info(`Finish Request: ${c.t(e,d,f)}`),{data:n.statusCode===204?void 0:await this.#o(u,n,a),status:n.statusCode,statusText:l.STATUS_CODES[n.statusCode]||``,headers:n.headers,config:m}}catch(t){if(g&&g.reason===t){this.#e.error(`Request timeout: ${c.t(e,d,f)}`);let t=new p.UndiciError(`Request timeout after ${i.timeout}ms`,{cause:g.reason});throw t.code=`UND_ERR_TIMEOUT`,t}throw h&&h.reason===t?(this.#e.error(`Request aborted: ${c.t(e,d,f)}`),new p.RequestAbortedError(h.reason.message,{cause:h.reason})):(this.#e.error(`Finish Request with error ${c.t(e,d,f)}`,{error:t}),t)}}async#a(e,t,n){let r=t.headers[`content-type`]||``,i=await t.body.text();if(!i)return;if(/text/i.test(r)){if(!n)return i;let e=n.safeParse(i);if(e.success)return e.data;throw Object.assign(e.error,{json:i})}let a;try{a=JSON.parse(i)}catch(r){if(!n)return i;let a=n.safeParse(i);if(a.success)return a.data;throw new p.RapidoHttpClientError(e,t,void 0,{cause:r})}if(!n)return a;let o=n.safeParse(a);if(o.success)return o.data;throw Object.assign(o.error,{json:a})}async#o(e,t,n){return this.#a(e,t,n)}async#s(e,t,n){return this.#a(e,t,n)}async getAllPages(e,t={}){let n=[],r=null,i=null,a={...t,params:{...t.params,page:1}};for(a.params.page||=1;(a.params.page===1||i===r)&&i!==0;){let{data:t}=await this.get(e,a);i=t.length,a.params.page===1&&(r=t.length),a.params.page+=1,Array.prototype.push.apply(n,t)}return n}async getAllPagesFromQueryEndpoint(e,t={},n=100){let r=[],i=!0,a=1;for(;i&&(n===-1||a<n);){let{data:n}=await this.post(e,{...t,page:a}),{rows:o,count:s}=n;a+=1,Array.prototype.push.apply(r,o),i=r.length<s}return r}async close(){await this.client.close()}async[Symbol.asyncDispose](){await this.close()}},S=x;exports.RapidoHttpClient=x,exports.default=S,Object.defineProperty(exports,`errors`,{enumerable:!0,get:function(){return p}}),exports.t=s;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./utils-
|
|
1
|
+
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./utils-CXxwjP2v.js";import{STATUS_CODES as c}from"node:http";import l,{Agent as u,errors as d,interceptors as f}from"undici";import{getCurrentContext as p}from"@autofleet/outbreak";const m=Symbol.for(`RapidoHttpClientErrorBrand`);let h;(function(e){e.UndiciError=d.UndiciError,e.ConnectTimeoutError=d.ConnectTimeoutError,e.HeadersTimeoutError=d.HeadersTimeoutError,e.HeadersOverflowError=d.HeadersOverflowError,e.BodyTimeoutError=d.BodyTimeoutError,e.ResponseError=d.ResponseError,e.InvalidArgumentError=d.InvalidArgumentError,e.InvalidReturnValueError=d.InvalidReturnValueError,e.RequestAbortedError=d.RequestAbortedError,e.InformationalError=d.InformationalError,e.RequestContentLengthMismatchError=d.RequestContentLengthMismatchError,e.ResponseContentLengthMismatchError=d.ResponseContentLengthMismatchError,e.ClientDestroyedError=d.ClientDestroyedError,e.ClientClosedError=d.ClientClosedError,e.SocketError=d.SocketError,e.NotSupportedError=d.NotSupportedError,e.BalancedPoolMissingUpstreamError=d.BalancedPoolMissingUpstreamError,e.HTTPParserError=d.HTTPParserError,e.ResponseExceededMaxSizeError=d.ResponseExceededMaxSizeError,e.RequestRetryError=d.RequestRetryError,e.SecureProxyConnectionError=d.SecureProxyConnectionError,e.MaxOriginsReachedError=d.MaxOriginsReachedError;function t(e){return typeof e==`object`&&!!e&&m in e}e.isRapidoHttpClientError=t;class n extends d.ResponseError{constructor(e,t,n,r){super(`HTTP Error ${t.statusCode}`,t.statusCode,{headers:t.headers,body:e}),this.response=t,this.data=n,this.status=t.statusCode,this.statusText=c[t.statusCode]||`Unknown Status`,this.requestOptions=r?.requestOptions,r?.cause&&(this.cause=r.cause),Object.defineProperty(this,m,{value:!0,enumerable:!1,writable:!1})}static isRapidoHttpClientError(e){return t(e)}}e.RapidoHttpClientError=n})(h||={});const g=Symbol(`testAgentParam`),_=e=>function(t,n){let r=p().context;if(r){let e;e=Array.isArray(t.headers)?Object.fromEntries(t.headers):{...t.headers};for(let[t,n]of r)typeof n==`symbol`||n===void 0||(e[t]=n);t.headers=e}return e(t,n)},{cacheStores:v}=l,{cache:y,retry:b,decompress:x}=f,S=[`GET`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`TRACE`,`QUERY`];var C=class{#e;get(e,t){return this.#i(`GET`,e,void 0,t)}post(e,t,n){return this.#i(`POST`,e,t,n)}delete(e,t){return this.#i(`DELETE`,e,void 0,t)}head(e,t){return this.#i(`HEAD`,e,void 0,t)}put(e,t,n){return this.#i(`PUT`,e,t,n)}patch(e,t,n){return this.#i(`PATCH`,e,t,n)}options(e,t){return this.#i(`OPTIONS`,e,void 0,t)}query(e,t,n){return this.#i(`QUERY`,e,t,n)}constructor(e){this.#e=e.logger.child(`RapidoHttpClient`,{}),this.settings=i(e.autoDecompress?n:a,e),this.#t();let t=globalThis.__RAPIDO_HTTP_CLIENT_MOCK_AGENT__;this.client=this.settings[g]??t??new u({connect:{timeout:this.settings.timeout},keepAliveTimeout:this.settings.keepAliveTimeout,keepAliveMaxTimeout:this.settings.keepAliveMaxTimeout,connections:this.settings.connections}),this.settings.cache&&(this.client=this.client.compose(y({store:new v.MemoryCacheStore({...this.settings.cache})}))),this.settings.retries&&(this.client=this.client.compose(b({methods:S,...this.settings.retries,retry:(e,t,n)=>{let{counter:i}=t.state,a=t.opts.retryOptions?.maxRetries??5;(this.settings.retries?.retry??r)(e,t,r=>{if(!r){let{method:n,origin:r,path:o}=t.opts,c=!r||typeof r==`string`?r:r.origin;this.#e.warn(`Request retry attempt ${i}/${a}: ${s(n,c,o)}`,{err:e})}n(r)})}}))),this.settings.autoDecompress&&(this.client=this.client.compose(x({skipErrorResponses:!1}))),this.client=this.client.compose(_)}#t(){let e=t(this.settings),n=new URL(e);this.settings.baseURL=n.origin,this.settings.basePath=n.pathname===`/`?``:n.pathname}#n(e,t){if(!e&&!t)return{signal:void 0,timeoutSignal:void 0};if(e&&!t)return{signal:e,timeoutSignal:void 0};let n=AbortSignal.timeout(t);return!e&&t?{signal:n,timeoutSignal:n}:{signal:AbortSignal.any([e,n]),timeoutSignal:n}}#r(t,n){if(t!=null){if(e(t))return!n[`Content-Type`]&&!n[`content-type`]&&(n[`Content-Type`]=`application/x-www-form-urlencoded`),t;if(typeof t==`object`&&!Buffer.isBuffer(t)){let e=n[`Content-Type`]||n[`content-type`];if(e&&/application\/x-www-form-urlencoded/i.test(e)){let e=new URLSearchParams;for(let[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(t=>e.append(n,String(t))):r!=null&&e.append(n,String(r));return e.toString()}return!n[`Content-Type`]&&!n[`content-type`]&&(n[`Content-Type`]=`application/json`),JSON.stringify(t)}return typeof t==`string`||Buffer.isBuffer(t)?t:String(t)}}async#i(e,t,n,r={}){let a=i(this.settings,r);if(a.signal?.aborted)throw this.#e.error(`Request aborted before start: ${s(e,a.baseURL,t)}`),new h.RequestAbortedError(a.signal.reason?.message||`Request aborted`,{cause:a.signal.reason});let{successSchema:l,errorSchema:u}=r,d={...a.headers},f=this.#r(n,d),{origin:p,path:m}=o(t,a.baseURL,a.basePath),g={method:e,baseURL:p,url:t};if(a.params)for(let[e,t]of Object.entries(a.params))Array.isArray(t)&&!e.endsWith(`[]`)&&(a.params[`${e}[]`]=t,delete a.params[e]);let{signal:_,timeoutSignal:v}=this.#n(a.signal,a.timeout);try{this.#e.info(`Start Request: ${s(e,p,m)}`);let t={path:m,origin:p,method:e,signal:_,headers:d,body:f,query:a.params},n=await this.client.request(t);if(p.startsWith(`http://`)&&n.statusCode>=300&&n.statusCode<400){let e=[n.headers.location].flat()[0]??`unknown location`;throw new h.RapidoHttpClientError(f,n,void 0,{requestOptions:t,cause:Error(`Redirect to ${e} on HTTP origin, which is not supported for security reasons`)})}if(!(a.validateStatus??(()=>n.statusCode<400))(n.statusCode)){let r=await this.#s(f,n,u);throw this.#e.error(`Finish Request with error ${s(e,p,m)}`,{status:n.statusCode,data:r}),new h.RapidoHttpClientError(f,n,r,{requestOptions:t})}return this.#e.info(`Finish Request: ${s(e,p,m)}`),{data:n.statusCode===204?void 0:await this.#o(f,n,l),status:n.statusCode,statusText:c[n.statusCode]||``,headers:n.headers,config:g}}catch(t){if(v&&v.reason===t){this.#e.error(`Request timeout: ${s(e,p,m)}`);let t=new h.UndiciError(`Request timeout after ${a.timeout}ms`,{cause:v.reason});throw t.code=`UND_ERR_TIMEOUT`,t}throw _&&_.reason===t?(this.#e.error(`Request aborted: ${s(e,p,m)}`),new h.RequestAbortedError(_.reason.message,{cause:_.reason})):(this.#e.error(`Finish Request with error ${s(e,p,m)}`,{error:t}),t)}}async#a(e,t,n){let r=t.headers[`content-type`]||``,i=await t.body.text();if(!i)return;if(/text/i.test(r)){if(!n)return i;let e=n.safeParse(i);if(e.success)return e.data;throw Object.assign(e.error,{json:i})}let a;try{a=JSON.parse(i)}catch(r){if(!n)return i;let a=n.safeParse(i);if(a.success)return a.data;throw new h.RapidoHttpClientError(e,t,void 0,{cause:r})}if(!n)return a;let o=n.safeParse(a);if(o.success)return o.data;throw Object.assign(o.error,{json:a})}async#o(e,t,n){return this.#a(e,t,n)}async#s(e,t,n){return this.#a(e,t,n)}async getAllPages(e,t={}){let n=[],r=null,i=null,a={...t,params:{...t.params,page:1}};for(a.params.page||=1;(a.params.page===1||i===r)&&i!==0;){let{data:t}=await this.get(e,a);i=t.length,a.params.page===1&&(r=t.length),a.params.page+=1,Array.prototype.push.apply(n,t)}return n}async getAllPagesFromQueryEndpoint(e,t={},n=100){let r=[],i=!0,a=1;for(;i&&(n===-1||a<n);){let{data:n}=await this.post(e,{...t,page:a}),{rows:o,count:s}=n;a+=1,Array.prototype.push.apply(r,o),i=r.length<s}return r}async close(){await this.client.close()}async[Symbol.asyncDispose](){await this.close()}},w=C;export{C as RapidoHttpClient,w as default,h as errors};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/testing.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./utils-
|
|
1
|
+
const e=require(`./utils-BIXrZN8_.cjs`),t=require(`./index.cjs`);let n=require(`undici`);function r({blockNonMockedNetwork:t,collectCallHistory:r}={}){let i=new n.MockAgent({enableCallHistory:r??!1});(t??!0)&&i.disableNetConnect(),globalThis.__RAPIDO_HTTP_CLIENT_MOCK_AGENT__=i;let a=new Map,o=new Map,s=e=>{let t=new URL(e),n=t.origin,r=t.pathname===`/`?``:t.pathname.replace(/\/$/,``),s=n+r;if(!a.has(s)){let e=i.get(n);a.set(s,e),o.set(s,r)}return{pool:a.get(s),basePath:o.get(s)||``}},c=(e,t)=>{if(typeof e==`string`)return{path:t+e};let n={...e};if(typeof n.path==`string`&&(n.path=t+n.path),n.body&&typeof n.body==`object`&&!(n.body instanceof RegExp)&&typeof n.body!=`function`){let e=n.headers,t=e?.[`Content-Type`]||e?.[`content-type`];if(t&&/application\/x-www-form-urlencoded/i.test(t)){let e=new URLSearchParams;for(let[t,r]of Object.entries(n.body))Array.isArray(r)?r.forEach(n=>e.append(t,String(n))):r!=null&&e.append(t,String(r));n.body=e.toString()}else n.body=JSON.stringify(n.body)}if(n.query)for(let[e,t]of Object.entries(n.query))Array.isArray(t)&&!e.endsWith(`[]`)&&(n.query[`${e}[]`]=t,delete n.query[e]);return n};return{intercept:t=>{let{pool:n,basePath:r}=s(typeof t==`string`?t:e.c(t));return{get:e=>n.intercept({...c(e,r),method:`GET`}),head:e=>n.intercept({...c(e,r),method:`HEAD`}),delete:e=>n.intercept({...c(e,r),method:`DELETE`}),options:e=>n.intercept({...c(e,r),method:`OPTIONS`}),put:e=>n.intercept({...c(e,r),method:`PUT`}),post:e=>n.intercept({...c(e,r),method:`POST`}),patch:e=>n.intercept({...c(e,r),method:`PATCH`}),query:e=>n.intercept({...c(e,r),method:`QUERY`})}},getPool:t=>s(typeof t==`string`?t:e.c(t)).pool,cleanup:async()=>{delete globalThis.__RAPIDO_HTTP_CLIENT_MOCK_AGENT__,a.clear(),o.clear(),await i.close(),i.clearCallHistory()},get calls(){return i.getCallHistory()?.calls()??[]},clearCallHistory:()=>i.clearCallHistory(),enableCallHistory:()=>{i.enableCallHistory()},disableCallHistory:()=>{i.disableCallHistory()},mockAgent:i}}exports.setupRapidoHttpClientMock=r;
|
|
2
2
|
//# sourceMappingURL=testing.cjs.map
|
package/dist/testing.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e}from"./utils-
|
|
1
|
+
import{c as e}from"./utils-CXxwjP2v.js";import{MockAgent as t}from"undici";function n({blockNonMockedNetwork:n,collectCallHistory:r}={}){let i=new t({enableCallHistory:r??!1});(n??!0)&&i.disableNetConnect(),globalThis.__RAPIDO_HTTP_CLIENT_MOCK_AGENT__=i;let a=new Map,o=new Map,s=e=>{let t=new URL(e),n=t.origin,r=t.pathname===`/`?``:t.pathname.replace(/\/$/,``),s=n+r;if(!a.has(s)){let e=i.get(n);a.set(s,e),o.set(s,r)}return{pool:a.get(s),basePath:o.get(s)||``}},c=(e,t)=>{if(typeof e==`string`)return{path:t+e};let n={...e};if(typeof n.path==`string`&&(n.path=t+n.path),n.body&&typeof n.body==`object`&&!(n.body instanceof RegExp)&&typeof n.body!=`function`){let e=n.headers,t=e?.[`Content-Type`]||e?.[`content-type`];if(t&&/application\/x-www-form-urlencoded/i.test(t)){let e=new URLSearchParams;for(let[t,r]of Object.entries(n.body))Array.isArray(r)?r.forEach(n=>e.append(t,String(n))):r!=null&&e.append(t,String(r));n.body=e.toString()}else n.body=JSON.stringify(n.body)}if(n.query)for(let[e,t]of Object.entries(n.query))Array.isArray(t)&&!e.endsWith(`[]`)&&(n.query[`${e}[]`]=t,delete n.query[e]);return n};return{intercept:t=>{let{pool:n,basePath:r}=s(typeof t==`string`?t:e(t));return{get:e=>n.intercept({...c(e,r),method:`GET`}),head:e=>n.intercept({...c(e,r),method:`HEAD`}),delete:e=>n.intercept({...c(e,r),method:`DELETE`}),options:e=>n.intercept({...c(e,r),method:`OPTIONS`}),put:e=>n.intercept({...c(e,r),method:`PUT`}),post:e=>n.intercept({...c(e,r),method:`POST`}),patch:e=>n.intercept({...c(e,r),method:`PATCH`}),query:e=>n.intercept({...c(e,r),method:`QUERY`})}},getPool:t=>s(typeof t==`string`?t:e(t)).pool,cleanup:async()=>{delete globalThis.__RAPIDO_HTTP_CLIENT_MOCK_AGENT__,a.clear(),o.clear(),await i.close(),i.clearCallHistory()},get calls(){return i.getCallHistory()?.calls()??[]},clearCallHistory:()=>i.clearCallHistory(),enableCallHistory:()=>{i.enableCallHistory()},disableCallHistory:()=>{i.disableCallHistory()},mockAgent:i}}export{n as setupRapidoHttpClientMock};
|
|
2
2
|
//# sourceMappingURL=testing.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./index.cjs`);let t=require(`undici`),n=require(`node:process`),r=require(`node:zlib`);var i=`0.3.
|
|
2
|
-
//# sourceMappingURL=utils-
|
|
1
|
+
const e=require(`./index.cjs`);let t=require(`undici`),n=require(`node:process`),r=require(`node:zlib`);var i=`0.3.6`;const a=()=>typeof r.createZstdDecompress==`function`,o={timeout:1e4,headers:{"User-Agent":`rapido-http-client/${i}`,"X-AF-AUTH":`ANYONE`,"X-IAF-ORIGIN-SERVICE":n.env.AF_SERVICE_NAME||``},keepAliveTimeout:5e3,keepAliveMaxTimeout:1e4,connections:10},s={...o,headers:{...o.headers,"Accept-Encoding":`${a()?`zstd, `:``}br, gzip`}},c=Object.getOwnPropertySymbols(t.RetryHandler).find(e=>typeof Object.getOwnPropertyDescriptor(t.RetryHandler,e)?.value==`function`&&e.toString().includes(`default retry`)),l=t.RetryHandler[c],u=e=>e instanceof FormData||Object.prototype.toString.call(e)===`[object FormData]`;function d(e){if(!e.serviceUrl&&!e.serviceName)throw Error(`At least one of the settings Missing serviceUrl or serviceName`);if(e.serviceUrl)return e.serviceUrl;let t=`${e.serviceName}_SERVICE_HOST`,r=n.env[t];if(!r&&n.env.NODE_ENV!==`test`)throw Error(`Environment variable ${t} is not set`);return`http://${r}`}const f=(e,t,n)=>`[${e.toUpperCase()}] ${t??`unknown-base-url`}${n}`,p=(e,t,n)=>{if(/^https?:\/\//i.test(e)){let t=new URL(e);return{origin:t.origin,path:t.pathname+t.search+t.hash}}let r=e;if(n){let t=n.endsWith(`/`),i=e.startsWith(`/`);r=t&&i?n+e.slice(1):!t&&!i?n+`/`+e:n+e}return{origin:t,path:r}},m=(e,t)=>{let n={...e,...t};return t.headers&&(n.headers={...e.headers,...t.headers}),n};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
2
|
+
//# sourceMappingURL=utils-BIXrZN8_.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-BIXrZN8_.cjs","names":["createZstdDecompress","defaultSettings: Omit<RapidoHttpClientSettings, 'logger'>","env","defaultSettingsWithDecompress: Omit<RapidoHttpClientSettings, 'logger'>","RetryHandler"],"sources":["../package.json","../src/utils.ts"],"sourcesContent":["","import { env } from 'node:process';\nimport { RetryHandler } from 'undici';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore createZstdDecompress is rather new, so our @types/node is unaware of it\nimport { createZstdDecompress } from 'node:zlib';\nimport type { RapidoHttpClientSettings } from '.';\nimport { version } from '../package.json' with { type: 'json' };\n\n/** The support for zstd in Node was added during 22 & 23, so this function checks if it's exists in runtime */\nexport const isZstdSupported = (): boolean => typeof createZstdDecompress === 'function';\n\nexport const defaultSettings: Omit<RapidoHttpClientSettings, 'logger'> = {\n timeout: 10_000,\n headers: {\n 'User-Agent': `rapido-http-client/${version}`,\n 'X-AF-AUTH': 'ANYONE',\n 'X-IAF-ORIGIN-SERVICE': env.AF_SERVICE_NAME || '',\n },\n keepAliveTimeout: 5_000,\n keepAliveMaxTimeout: 10_000,\n connections: 10,\n};\n\nexport const defaultSettingsWithDecompress: Omit<RapidoHttpClientSettings, 'logger'> = {\n ...defaultSettings,\n headers: {\n ...defaultSettings.headers,\n /* c8 ignore next */\n 'Accept-Encoding': `${isZstdSupported() ? 'zstd, ' : ''}br, gzip`,\n },\n};\n\nconst retryHandlerDefaultRetryKey = Object.getOwnPropertySymbols(RetryHandler)\n .find(k => typeof Object.getOwnPropertyDescriptor(RetryHandler, k)?.value === 'function' && k.toString().includes('default retry'))!;\nexport const defaultRetryMethod = (RetryHandler as any)[retryHandlerDefaultRetryKey] as RetryHandler.RetryCallback;\n\nexport const isFormData = (obj: unknown): obj is FormData => obj instanceof FormData || Object.prototype.toString.call(obj) === '[object FormData]';\n\n/**\n * Resolves a service configuration to a base URL\n *\n * @param config - Object with either serviceName or serviceUrl\n * @returns The resolved base URL\n * @throws Error if neither serviceName nor serviceUrl is provided, or if the environment variable for serviceName is not set\n */\nexport function resolveServiceUrl(config: { serviceName?: string; serviceUrl?: string; }): string {\n if (!config.serviceUrl && !config.serviceName) {\n throw new Error('At least one of the settings Missing serviceUrl or serviceName');\n }\n\n if (config.serviceUrl) {\n return config.serviceUrl;\n }\n\n const envServiceHostName = `${config.serviceName}_SERVICE_HOST`;\n const host = env[envServiceHostName];\n if (!host && env.NODE_ENV !== 'test') {\n throw new Error(`Environment variable ${envServiceHostName} is not set`);\n }\n return `http://${host}`;\n}\n\nexport const createRequestString = (method: string, baseURL: string | undefined, url: string): string => `[${method.toUpperCase()}] ${baseURL ?? 'unknown-base-url'}${url}`;\n\nexport const parseUrlAndOrigin = (url: string, baseURL: string, basePath?: string): { origin: string; path: string; } => {\n // Check if url is a full URL (starts with http:// or https://)\n const isFullUrl = /^https?:\\/\\//i.test(url);\n\n if (isFullUrl) {\n // Parse the full URL to extract origin and path\n const urlObj = new URL(url);\n return {\n origin: urlObj.origin,\n path: urlObj.pathname + urlObj.search + urlObj.hash,\n };\n }\n\n // Use base URL and the provided path, prepending basePath if provided\n let finalPath = url;\n if (basePath) {\n // Normalize: ensure exactly one slash between basePath and url\n const baseEndsWithSlash = basePath.endsWith('/');\n const urlStartsWithSlash = url.startsWith('/');\n\n if (baseEndsWithSlash && urlStartsWithSlash) {\n // Both have slash, remove one\n finalPath = basePath + url.slice(1);\n } else if (!baseEndsWithSlash && !urlStartsWithSlash) {\n // Neither has slash, add one\n finalPath = basePath + '/' + url;\n } else {\n // One has slash, just concatenate\n finalPath = basePath + url;\n }\n }\n return {\n origin: baseURL,\n path: finalPath,\n };\n};\n\nexport const mergeConfig = <T extends Record<string, any>, U extends Record<string, any>>(\n defaults: T,\n overrides: U,\n): T & U => {\n const result = { ...defaults, ...overrides };\n\n // Special handling for headers - merge them instead of replacing\n if (overrides.headers) {\n (result as unknown as { headers: Record<string, string>; }).headers = {\n ...defaults.headers,\n ...overrides.headers,\n };\n }\n\n return result;\n};\n"],"mappings":"sHCSA,MAAa,MAAiC,OAAOA,EAAAA,sBAAyB,WAEjEC,EAA4D,CACvE,QAAS,IACT,QAAS,CACP,aAAc,sBAAsB,IACpC,YAAa,SACb,uBAAwBC,EAAAA,IAAI,iBAAmB,GAChD,CACD,iBAAkB,IAClB,oBAAqB,IACrB,YAAa,GACd,CAEYC,EAA0E,CACrF,GAAG,EACH,QAAS,CACP,GAAG,EAAgB,QAEnB,kBAAmB,GAAG,GAAiB,CAAG,SAAW,GAAG,UACzD,CACF,CAEK,EAA8B,OAAO,sBAAsBC,EAAAA,aAAa,CAC3E,KAAK,GAAK,OAAO,OAAO,yBAAyBA,EAAAA,aAAc,EAAE,EAAE,OAAU,YAAc,EAAE,UAAU,CAAC,SAAS,gBAAgB,CAAC,CACxH,EAAsBA,EAAAA,aAAqB,GAE3C,EAAc,GAAkC,aAAe,UAAY,OAAO,UAAU,SAAS,KAAK,EAAI,GAAK,oBAShI,SAAgB,EAAkB,EAAgE,CAChG,GAAI,CAAC,EAAO,YAAc,CAAC,EAAO,YAChC,MAAU,MAAM,iEAAiE,CAGnF,GAAI,EAAO,WACT,OAAO,EAAO,WAGhB,IAAM,EAAqB,GAAG,EAAO,YAAY,eAC3C,EAAOF,EAAAA,IAAI,GACjB,GAAI,CAAC,GAAQA,EAAAA,IAAI,WAAa,OAC5B,MAAU,MAAM,wBAAwB,EAAmB,aAAa,CAE1E,MAAO,UAAU,IAGnB,MAAa,GAAuB,EAAgB,EAA6B,IAAwB,IAAI,EAAO,aAAa,CAAC,IAAI,GAAW,qBAAqB,IAEzJ,GAAqB,EAAa,EAAiB,IAAyD,CAIvH,GAFkB,gBAAgB,KAAK,EAAI,CAE5B,CAEb,IAAM,EAAS,IAAI,IAAI,EAAI,CAC3B,MAAO,CACL,OAAQ,EAAO,OACf,KAAM,EAAO,SAAW,EAAO,OAAS,EAAO,KAChD,CAIH,IAAI,EAAY,EAChB,GAAI,EAAU,CAEZ,IAAM,EAAoB,EAAS,SAAS,IAAI,CAC1C,EAAqB,EAAI,WAAW,IAAI,CAE9C,AAQE,EARE,GAAqB,EAEX,EAAW,EAAI,MAAM,EAAE,CAC1B,CAAC,GAAqB,CAAC,EAEpB,EAAW,IAAM,EAGjB,EAAW,EAG3B,MAAO,CACL,OAAQ,EACR,KAAM,EACP,EAGU,GACX,EACA,IACU,CACV,IAAM,EAAS,CAAE,GAAG,EAAU,GAAG,EAAW,CAU5C,OAPI,EAAU,UACX,EAA2D,QAAU,CACpE,GAAG,EAAS,QACZ,GAAG,EAAU,QACd,EAGI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{RetryHandler as e}from"undici";import{env as t}from"node:process";import{createZstdDecompress as n}from"node:zlib";var r=`0.3.
|
|
2
|
-
//# sourceMappingURL=utils-
|
|
1
|
+
import{RetryHandler as e}from"undici";import{env as t}from"node:process";import{createZstdDecompress as n}from"node:zlib";var r=`0.3.6`;const i=()=>typeof n==`function`,a={timeout:1e4,headers:{"User-Agent":`rapido-http-client/${r}`,"X-AF-AUTH":`ANYONE`,"X-IAF-ORIGIN-SERVICE":t.AF_SERVICE_NAME||``},keepAliveTimeout:5e3,keepAliveMaxTimeout:1e4,connections:10},o={...a,headers:{...a.headers,"Accept-Encoding":`${i()?`zstd, `:``}br, gzip`}},s=e[Object.getOwnPropertySymbols(e).find(t=>typeof Object.getOwnPropertyDescriptor(e,t)?.value==`function`&&t.toString().includes(`default retry`))],c=e=>e instanceof FormData||Object.prototype.toString.call(e)===`[object FormData]`;function l(e){if(!e.serviceUrl&&!e.serviceName)throw Error(`At least one of the settings Missing serviceUrl or serviceName`);if(e.serviceUrl)return e.serviceUrl;let n=`${e.serviceName}_SERVICE_HOST`,r=t[n];if(!r&&t.NODE_ENV!==`test`)throw Error(`Environment variable ${n} is not set`);return`http://${r}`}const u=(e,t,n)=>`[${e.toUpperCase()}] ${t??`unknown-base-url`}${n}`,d=(e,t,n)=>{if(/^https?:\/\//i.test(e)){let t=new URL(e);return{origin:t.origin,path:t.pathname+t.search+t.hash}}let r=e;if(n){let t=n.endsWith(`/`),i=e.startsWith(`/`);r=t&&i?n+e.slice(1):!t&&!i?n+`/`+e:n+e}return{origin:t,path:r}},f=(e,t)=>{let n={...e,...t};return t.headers&&(n.headers={...e.headers,...t.headers}),n};export{c as a,l as c,o as i,s as n,f as o,a as r,d as s,u as t};
|
|
2
|
+
//# sourceMappingURL=utils-CXxwjP2v.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-CXxwjP2v.js","names":["defaultSettings: Omit<RapidoHttpClientSettings, 'logger'>","defaultSettingsWithDecompress: Omit<RapidoHttpClientSettings, 'logger'>"],"sources":["../package.json","../src/utils.ts"],"sourcesContent":["","import { env } from 'node:process';\nimport { RetryHandler } from 'undici';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore createZstdDecompress is rather new, so our @types/node is unaware of it\nimport { createZstdDecompress } from 'node:zlib';\nimport type { RapidoHttpClientSettings } from '.';\nimport { version } from '../package.json' with { type: 'json' };\n\n/** The support for zstd in Node was added during 22 & 23, so this function checks if it's exists in runtime */\nexport const isZstdSupported = (): boolean => typeof createZstdDecompress === 'function';\n\nexport const defaultSettings: Omit<RapidoHttpClientSettings, 'logger'> = {\n timeout: 10_000,\n headers: {\n 'User-Agent': `rapido-http-client/${version}`,\n 'X-AF-AUTH': 'ANYONE',\n 'X-IAF-ORIGIN-SERVICE': env.AF_SERVICE_NAME || '',\n },\n keepAliveTimeout: 5_000,\n keepAliveMaxTimeout: 10_000,\n connections: 10,\n};\n\nexport const defaultSettingsWithDecompress: Omit<RapidoHttpClientSettings, 'logger'> = {\n ...defaultSettings,\n headers: {\n ...defaultSettings.headers,\n /* c8 ignore next */\n 'Accept-Encoding': `${isZstdSupported() ? 'zstd, ' : ''}br, gzip`,\n },\n};\n\nconst retryHandlerDefaultRetryKey = Object.getOwnPropertySymbols(RetryHandler)\n .find(k => typeof Object.getOwnPropertyDescriptor(RetryHandler, k)?.value === 'function' && k.toString().includes('default retry'))!;\nexport const defaultRetryMethod = (RetryHandler as any)[retryHandlerDefaultRetryKey] as RetryHandler.RetryCallback;\n\nexport const isFormData = (obj: unknown): obj is FormData => obj instanceof FormData || Object.prototype.toString.call(obj) === '[object FormData]';\n\n/**\n * Resolves a service configuration to a base URL\n *\n * @param config - Object with either serviceName or serviceUrl\n * @returns The resolved base URL\n * @throws Error if neither serviceName nor serviceUrl is provided, or if the environment variable for serviceName is not set\n */\nexport function resolveServiceUrl(config: { serviceName?: string; serviceUrl?: string; }): string {\n if (!config.serviceUrl && !config.serviceName) {\n throw new Error('At least one of the settings Missing serviceUrl or serviceName');\n }\n\n if (config.serviceUrl) {\n return config.serviceUrl;\n }\n\n const envServiceHostName = `${config.serviceName}_SERVICE_HOST`;\n const host = env[envServiceHostName];\n if (!host && env.NODE_ENV !== 'test') {\n throw new Error(`Environment variable ${envServiceHostName} is not set`);\n }\n return `http://${host}`;\n}\n\nexport const createRequestString = (method: string, baseURL: string | undefined, url: string): string => `[${method.toUpperCase()}] ${baseURL ?? 'unknown-base-url'}${url}`;\n\nexport const parseUrlAndOrigin = (url: string, baseURL: string, basePath?: string): { origin: string; path: string; } => {\n // Check if url is a full URL (starts with http:// or https://)\n const isFullUrl = /^https?:\\/\\//i.test(url);\n\n if (isFullUrl) {\n // Parse the full URL to extract origin and path\n const urlObj = new URL(url);\n return {\n origin: urlObj.origin,\n path: urlObj.pathname + urlObj.search + urlObj.hash,\n };\n }\n\n // Use base URL and the provided path, prepending basePath if provided\n let finalPath = url;\n if (basePath) {\n // Normalize: ensure exactly one slash between basePath and url\n const baseEndsWithSlash = basePath.endsWith('/');\n const urlStartsWithSlash = url.startsWith('/');\n\n if (baseEndsWithSlash && urlStartsWithSlash) {\n // Both have slash, remove one\n finalPath = basePath + url.slice(1);\n } else if (!baseEndsWithSlash && !urlStartsWithSlash) {\n // Neither has slash, add one\n finalPath = basePath + '/' + url;\n } else {\n // One has slash, just concatenate\n finalPath = basePath + url;\n }\n }\n return {\n origin: baseURL,\n path: finalPath,\n };\n};\n\nexport const mergeConfig = <T extends Record<string, any>, U extends Record<string, any>>(\n defaults: T,\n overrides: U,\n): T & U => {\n const result = { ...defaults, ...overrides };\n\n // Special handling for headers - merge them instead of replacing\n if (overrides.headers) {\n (result as unknown as { headers: Record<string, string>; }).headers = {\n ...defaults.headers,\n ...overrides.headers,\n };\n }\n\n return result;\n};\n"],"mappings":"wICSA,MAAa,MAAiC,OAAO,GAAyB,WAEjEA,EAA4D,CACvE,QAAS,IACT,QAAS,CACP,aAAc,sBAAsB,IACpC,YAAa,SACb,uBAAwB,EAAI,iBAAmB,GAChD,CACD,iBAAkB,IAClB,oBAAqB,IACrB,YAAa,GACd,CAEYC,EAA0E,CACrF,GAAG,EACH,QAAS,CACP,GAAG,EAAgB,QAEnB,kBAAmB,GAAG,GAAiB,CAAG,SAAW,GAAG,UACzD,CACF,CAIY,EAAsB,EAFC,OAAO,sBAAsB,EAAa,CAC3E,KAAK,GAAK,OAAO,OAAO,yBAAyB,EAAc,EAAE,EAAE,OAAU,YAAc,EAAE,UAAU,CAAC,SAAS,gBAAgB,CAAC,EAGxH,EAAc,GAAkC,aAAe,UAAY,OAAO,UAAU,SAAS,KAAK,EAAI,GAAK,oBAShI,SAAgB,EAAkB,EAAgE,CAChG,GAAI,CAAC,EAAO,YAAc,CAAC,EAAO,YAChC,MAAU,MAAM,iEAAiE,CAGnF,GAAI,EAAO,WACT,OAAO,EAAO,WAGhB,IAAM,EAAqB,GAAG,EAAO,YAAY,eAC3C,EAAO,EAAI,GACjB,GAAI,CAAC,GAAQ,EAAI,WAAa,OAC5B,MAAU,MAAM,wBAAwB,EAAmB,aAAa,CAE1E,MAAO,UAAU,IAGnB,MAAa,GAAuB,EAAgB,EAA6B,IAAwB,IAAI,EAAO,aAAa,CAAC,IAAI,GAAW,qBAAqB,IAEzJ,GAAqB,EAAa,EAAiB,IAAyD,CAIvH,GAFkB,gBAAgB,KAAK,EAAI,CAE5B,CAEb,IAAM,EAAS,IAAI,IAAI,EAAI,CAC3B,MAAO,CACL,OAAQ,EAAO,OACf,KAAM,EAAO,SAAW,EAAO,OAAS,EAAO,KAChD,CAIH,IAAI,EAAY,EAChB,GAAI,EAAU,CAEZ,IAAM,EAAoB,EAAS,SAAS,IAAI,CAC1C,EAAqB,EAAI,WAAW,IAAI,CAE9C,AAQE,EARE,GAAqB,EAEX,EAAW,EAAI,MAAM,EAAE,CAC1B,CAAC,GAAqB,CAAC,EAEpB,EAAW,IAAM,EAGjB,EAAW,EAG3B,MAAO,CACL,OAAQ,EACR,KAAM,EACP,EAGU,GACX,EACA,IACU,CACV,IAAM,EAAS,CAAE,GAAG,EAAU,GAAG,EAAW,CAU5C,OAPI,EAAU,UACX,EAA2D,QAAU,CACpE,GAAG,EAAS,QACZ,GAAG,EAAU,QACd,EAGI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/rapido-http-client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "Modern undici-based HTTP client with logging, retries, and global configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@types/node": "^20.0.0",
|
|
62
62
|
"nock": "^14.0.1",
|
|
63
63
|
"zod": "^4.2.1",
|
|
64
|
-
"@autofleet/logger": "^4.2.
|
|
65
|
-
"@autofleet/network": "^1.11.
|
|
66
|
-
"@autofleet/outbreak": "^2.6.
|
|
64
|
+
"@autofleet/logger": "^4.2.51",
|
|
65
|
+
"@autofleet/network": "^1.11.2",
|
|
66
|
+
"@autofleet/outbreak": "^2.6.7"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"test": "vitest",
|