@npora/request 1.20.1 → 1.21.0
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/README.md +17 -219
- package/dist/{MockAdapter-DS80lrWx.d.cts → MockAdapter-CDWlJKqY.d.cts} +2 -2
- package/dist/{MockAdapter-6MdaHStI.d.ts → MockAdapter-Hi5uqQ8K.d.ts} +2 -2
- package/dist/{Plugin-BvvTFwQj.d.ts → Plugin-BG4NQC3T.d.ts} +1 -1
- package/dist/{Plugin-LFR-Mb-u.d.cts → Plugin-CCFavD-_.d.cts} +1 -1
- package/dist/{SchemaValidationError-erxAaNjo.d.ts → SchemaValidationError-DoonRNb0.d.ts} +6 -3
- package/dist/{SchemaValidationError-D5T7agcb.d.cts → SchemaValidationError-wCE-Wrnw.d.cts} +6 -3
- package/dist/{adapter-DkVzG4v_.d.ts → adapter-CcfItVkl.d.ts} +1 -1
- package/dist/{adapter-C6IM9_f3.d.cts → adapter-Cq9y_Fww.d.cts} +1 -1
- package/dist/{authPlugin-JZQ0ISdH.d.ts → authPlugin-DRCFibHZ.d.ts} +1 -1
- package/dist/{authPlugin-C-JOJhQ9.d.cts → authPlugin-DWpsWoVD.d.cts} +1 -1
- package/dist/{cachePlugin-LkXinWXp.js → cachePlugin-BGfwCJRI.js} +1 -1
- package/dist/{cachePlugin-wCADcVdJ.d.cts → cachePlugin-BlsRZKN2.d.cts} +2 -2
- package/dist/{cachePlugin-C5ge5iH6.cjs → cachePlugin-C9gu5JD0.cjs} +1 -1
- package/dist/{cachePlugin-DI1tXJPk.d.ts → cachePlugin-D2ONW9sl.d.ts} +2 -2
- package/dist/{circuitBreakerPlugin-Ch8uc67V.d.cts → circuitBreakerPlugin-BL5Pxslz.d.cts} +2 -2
- package/dist/{circuitBreakerPlugin-BA-Fb4e0.d.ts → circuitBreakerPlugin-DUyVrQlA.d.ts} +2 -2
- package/dist/{concurrencyPlugin-IDGEoShG.d.cts → concurrencyPlugin-DId5qkk9.d.cts} +2 -2
- package/dist/{concurrencyPlugin-DgiZSKYy.d.ts → concurrencyPlugin-DM66h5PD.d.ts} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +6 -5
- package/dist/core.d.ts +6 -5
- package/dist/core.js +1 -1
- package/dist/{createClient-DqORyBdY.cjs → createClient-BE0TKFpI.cjs} +1 -1
- package/dist/createClient-wLCkChly.js +1 -0
- package/dist/{downloadPlugin-TkaOEp9I.d.ts → downloadPlugin-BY3BVNw4.d.ts} +1 -1
- package/dist/{downloadPlugin-CDBxyGy8.d.cts → downloadPlugin-DtOzKGt_.d.cts} +1 -1
- package/dist/errorResponseTimeout-BEEJV0xA.js +5 -0
- package/dist/errorResponseTimeout-zXdbsbDE.cjs +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +18 -17
- package/dist/index.d.ts +18 -17
- package/dist/index.js +1 -1
- package/dist/loggerPlugin-ChJJN0ZA.d.ts +6 -0
- package/dist/loggerPlugin-DDEGhC31.d.cts +6 -0
- package/dist/{openTelemetryMetricsPlugin-BSlh7PDU.d.ts → openTelemetryMetricsPlugin-BEoeRl3q.d.ts} +2 -2
- package/dist/{openTelemetryMetricsPlugin-CAAyfWw-.d.cts → openTelemetryMetricsPlugin-DuF9OWoT.d.cts} +2 -2
- package/dist/{openTelemetryPlugin-hAAiIVka.d.ts → openTelemetryPlugin-DOhBE_uZ.d.ts} +2 -2
- package/dist/{openTelemetryPlugin-CWgLyQQV.d.cts → openTelemetryPlugin-Dpz6-bEj.d.cts} +2 -2
- package/dist/plugins/auth.d.cts +1 -1
- package/dist/plugins/auth.d.ts +1 -1
- package/dist/plugins/cache.cjs +1 -1
- package/dist/plugins/cache.d.cts +1 -1
- package/dist/plugins/cache.d.ts +1 -1
- package/dist/plugins/cache.js +1 -1
- package/dist/plugins/circuit-breaker.d.cts +1 -1
- package/dist/plugins/circuit-breaker.d.ts +1 -1
- package/dist/plugins/concurrency.d.cts +1 -1
- package/dist/plugins/concurrency.d.ts +1 -1
- package/dist/plugins/download.cjs +1 -1
- package/dist/plugins/download.d.cts +1 -1
- package/dist/plugins/download.d.ts +1 -1
- package/dist/plugins/download.js +1 -1
- package/dist/plugins/logger.d.cts +1 -1
- package/dist/plugins/logger.d.ts +1 -1
- package/dist/plugins/memory-cache.d.cts +1 -1
- package/dist/plugins/memory-cache.d.ts +1 -1
- package/dist/plugins/opentelemetry-metrics.d.cts +1 -1
- package/dist/plugins/opentelemetry-metrics.d.ts +1 -1
- package/dist/plugins/opentelemetry.d.cts +1 -1
- package/dist/plugins/opentelemetry.d.ts +1 -1
- package/dist/plugins/rate-limit.d.cts +1 -1
- package/dist/plugins/rate-limit.d.ts +1 -1
- package/dist/plugins/retry.d.cts +1 -1
- package/dist/plugins/retry.d.ts +1 -1
- package/dist/plugins/upload.cjs +1 -1
- package/dist/plugins/upload.d.cts +1 -1
- package/dist/plugins/upload.d.ts +1 -1
- package/dist/plugins/upload.js +1 -1
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.cts +12 -12
- package/dist/plugins.d.ts +12 -12
- package/dist/plugins.js +1 -1
- package/dist/{rateLimitPlugin-BUkgrdXu.d.cts → rateLimitPlugin-CRpne4Qz.d.cts} +2 -2
- package/dist/{rateLimitPlugin-B5a7LKCy.d.ts → rateLimitPlugin-Ce3bjrRw.d.ts} +2 -2
- package/dist/{response-LhB9NRBw.d.cts → response-BhOBjarL.d.ts} +5 -44
- package/dist/{response-LhB9NRBw.d.ts → response-CXF5lNlw.d.cts} +5 -44
- package/dist/retryPlugin-5vYHV92i.d.ts +6 -0
- package/dist/retryPlugin-uC02f2sm.d.cts +6 -0
- package/dist/schema-errors.cjs +1 -0
- package/dist/schema-errors.d.cts +12 -0
- package/dist/schema-errors.d.ts +12 -0
- package/dist/schema-errors.js +1 -0
- package/dist/standardSchema-CjWI0T2o.d.cts +44 -0
- package/dist/standardSchema-CjWI0T2o.d.ts +44 -0
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{uploadPlugin-BUH9XZoy.d.ts → uploadPlugin-CNdvddnT.d.ts} +1 -1
- package/dist/{uploadPlugin-ZP-i_dac.d.cts → uploadPlugin-_xtlBLNY.d.cts} +1 -1
- package/dist/{xhrTransport-zrL-rBvu.js → xhrTransport--NHaimro.js} +1 -1
- package/dist/{xhrTransport-C0mICH5q.cjs → xhrTransport-BeC2XSM2.cjs} +1 -1
- package/package.json +10 -3
- package/dist/createClient-DkuK3ABy.js +0 -1
- package/dist/errorResponseTimeout-CNU7mMr2.cjs +0 -5
- package/dist/errorResponseTimeout-CpuovLyt.js +0 -5
- package/dist/loggerPlugin-06w_0Hbs.d.cts +0 -6
- package/dist/loggerPlugin-DllEKlkQ.d.ts +0 -6
- package/dist/retryPlugin-CvTlR5xZ.d.ts +0 -6
- package/dist/retryPlugin-DkqM2IjS.d.cts +0 -6
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const e=require("./RequestError-DrCr_lwO.cjs"),t=require("./isBinaryBody-DNjjEzFS.cjs"),n=require("./validateResponseStatus-6FKeKyEV.cjs"),r=require("./isReadableStream-uWhOa7eR.cjs"),i=require("./waitForSignal-9c9DAqqS.cjs"),a=require("./isPromiseLike-B4LL7DlV.cjs"),o=Symbol.for(`@npora/request/SchemaValidationError`);var SchemaValidationError=class extends e.t{constructor(e,t,n,r=[],i,a){super(e,{code:`SCHEMA_ERROR`,response:t,cause:i}),Object.defineProperty(this,o,{value:!0}),this.name=`SchemaValidationError`,this.issues=r,this.schemaVendor=n,this.itemIndex=a?.itemIndex,this.lineNumber=a?.lineNumber,this.event=a?.event,this.eventId=a?.eventId,Object.setPrototypeOf(this,new.target.prototype)}};function isSchemaValidationError(e){if(typeof e!=`object`&&typeof e!=`function`||e===null)return!1;try{return Reflect.get(e,o)===!0}catch{return!1}}function c(t,n,r=`Request timeout after ${n}ms`){if(!n||n<=0||t?.aborted)return{signal:t,clear:l};let i=new AbortController,a,o,s=()=>{if(a!==void 0&&(clearTimeout(a),a=void 0),t&&o){try{t.removeEventListener(`abort`,o)}catch{}o=void 0}};if(t){o=()=>{s(),i.abort(t.reason??new e.t(`Request aborted`,{code:`ABORT_ERROR`}))};try{t.addEventListener(`abort`,o,{once:!0})}catch(e){throw s(),e}if(t.aborted&&!i.signal.aborted&&o(),i.signal.aborted)return{signal:i.signal,clear:s}}try{a=setTimeout(()=>{s(),i.abort(new e.t(r,{code:`TIMEOUT_ERROR`}))},n)}catch(e){throw s(),e}return i.signal.aborted&&s(),{signal:i.signal,clear:s}}function l(){}const u=Object.prototype.hasOwnProperty,d=Symbol(`nativeRequest`);function f(e){if(typeof e!=`object`||!e||typeof Request>`u`)return!1;try{let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return!1;let n=Object.getOwnPropertyDescriptor(Request.prototype,`url`)?.get;return n?(n.call(e),!0):!1}catch{return!1}}function p(e,t,n=t.body){e[d]={request:t,body:n}}function m(e,t){let n=e[d];return n&&n.body===t?n.request:void 0}const h={json:`application/json`,text:`text/*`,blob:`*/*`,arrayBuffer:`*/*`,bytes:`*/*`,formData:`multipart/form-data`,stream:`*/*`,sse:`text/event-stream`,ndjson:`application/x-ndjson, application/ndjson`},g=/^([^?#]*)(?:\?([^#]*))?(#.*)?$/;function _(e){return v(e,new Headers(e.headers))}function v(e,t){re(t,e.responseType);let n=se(e,t);D(n,e);let i={},a=n;n=k(n,e,i);let o=ie(e),s=ne(e,n,o,e.method),l={...e.fetchOptions,method:e.method??`GET`,headers:t,signal:e.signal};s||(l.body=n,n&&r.t(n)&&(l.duplex=`half`));let u=e.timeout&&e.timeout>0?c(e.signal,e.timeout):void 0;return u&&(l.signal=u.signal),{url:o,input:s,useNativeInput:s?ee(s,l,e.fetchOptions):!1,init:l,clear:u?.clear??ue,bodyError:n===a?void 0:i}}function ee(e,t,n){return t.method!==e.method||t.signal!==e.signal||!te(e.headers,t.headers)?!1:n===void 0||n.cache===e.cache&&n.credentials===e.credentials&&n.integrity===e.integrity&&n.keepalive===e.keepalive&&n.mode===e.mode&&n.redirect===e.redirect&&n.referrer===e.referrer&&n.referrerPolicy===e.referrerPolicy&&Reflect.ownKeys(n).length===8}function te(e,t){let n=new Headers(t),r=0;for(let[t,i]of e){if(n.get(t)!==i)return!1;r+=1}for(let e of n)--r;return r===0}function ne(e,t,n,r){let i=m(e,t);return i?.url===n&&i.method===(r??`GET`)?i:void 0}function re(e,t){!t||e.has(`accept`)||e.set(`accept`,h[t])}function ie(e){let t=ae(e.baseURL,String(e.url));if(!e.query&&!e.searchParams)return t;let n=y(e);if(!n)return t;let r=t.indexOf(`#`),i=r===-1?t:t.slice(0,r),a=r===-1?``:t.slice(r),o=i.charCodeAt(i.length-1);return`${i}${i.includes(`?`)?o===63||o===38?``:`&`:`?`}${n}${a}`}function y(t){if(t.searchParams)return t.searchParams.toString();let n=t.query;if(!t.querySerializer)return oe(n);let r;try{r=t.querySerializer(n)}catch(n){throw new e.t(`Request query serialization failed`,{code:`CONFIG_ERROR`,config:t,cause:n})}if(typeof r!=`string`)throw new e.t(`Request querySerializer must return a string`,{code:`CONFIG_ERROR`,config:t});return r.startsWith(`?`)?r.slice(1):r}function ae(e,t){if(!e||x(t))return t;if(!t)return e;let n=e.includes(`?`)||e.includes(`#`),r=t.charCodeAt(0);if(!n&&r!==63&&r!==35)return b(e,t);let i=g.exec(e),a=g.exec(t),o=b(i[1],a[1]),s=i[2]??``,c=a[2]??``,l=s&&c?`${s}&${c}`:s||c,u=a[3]||i[3]||``;return`${o}${l?`?${l}`:``}${u}`}function b(e,t){if(!t)return e;let n=e.length,r=0;for(;n>0&&e.charCodeAt(n-1)===47;)--n;for(;r<t.length&&t.charCodeAt(r)===47;)r+=1;return`${e.slice(0,n)}/${t.slice(r)}`}function x(e){if(e.startsWith(`//`))return!0;let t=e.indexOf(`:`);return t<=0?!1:/^[a-z][a-z\d+\-.]*$/i.test(e.slice(0,t))}function oe(e){let t=new URLSearchParams;for(let n in e)u.call(e,n)&&S(t,n,e[n]);return t.toString()}function S(e,t,n){if(n!==void 0){if(n===null){e.append(t,``);return}if(Array.isArray(n)){for(let r of n)r!==void 0&&e.append(t,r===null?``:String(r));return}e.append(t,String(n))}}function se(e,t){if(e.json!==void 0)return E(t,`application/json`),C(e.json,e);if(e.form!==void 0)return E(t,`application/x-www-form-urlencoded;charset=UTF-8`),w(e.form);if(e.formData!==void 0)return ce(e.formData,e.maxFormDataDepth);if(e.body!==null&&e.body!==void 0)return le(e.body)?(E(t,`application/json`),C(e.body,e)):e.body}function C(e,t){let n=t.stringifyJson?t.stringifyJson(e):JSON.stringify(e);if(typeof n!=`string`)throw TypeError(`Request JSON stringifier must return a string`);return n}function w(e){if(t.r(e))return e;let n=new URLSearchParams;for(let t in e)u.call(e,t)&&S(n,t,e[t]);return n}function ce(e,t=32){if(n.r(e))return e;let r=new FormData,i=new WeakSet;for(let n in e)u.call(e,n)&&T(r,n,e[n],0,t,i);return r}function T(e,n,r,i,a,o){if(r!=null){if(Array.isArray(r)){if(o.has(r))throw TypeError(`FormData arrays cannot contain circular references`);let t=i+1;if(t>a)throw RangeError(`FormData array depth exceeds maxFormDataDepth ${a}`);o.add(r);try{for(let i of r)T(e,n,i,t,a,o)}finally{o.delete(r)}return}if(t.n(r)){e.append(n,r);return}e.append(n,String(r))}}function E(e,t){e.has(`content-type`)||e.set(`content-type`,t)}function D(t,n){let r=n.maxRequestSize;if(!Number.isFinite(r)||t===void 0)return;let i=O(t);if(i!==void 0&&i>(r??1/0))throw new e.t(`Request body exceeds maxRequestSize ${r}`,{code:`REQUEST_TOO_LARGE`,config:n})}function O(e){if(typeof e==`string`)return A(e);if(t.r(e))return A(e.toString());if(t.n(e))return e.size;if(t.t(e)||ArrayBuffer.isView(e))return e.byteLength}function k(t,n,i){let a=n.maxRequestSize;if(!r.t(t)||!Number.isFinite(a))return t;let o=t,s,c=0;return new ReadableStream({async pull(t){s??(s=o.getReader());try{let r=await s.read();if(r.done){s.releaseLock(),s=void 0,t.close();return}if(c+=r.value.byteLength,c>(a??1/0)){let t=new e.t(`Request body exceeds maxRequestSize ${a}`,{code:`REQUEST_TOO_LARGE`,config:n});throw i.current=t,s.cancel(t).catch(()=>{}),s.releaseLock(),s=void 0,t}t.enqueue(r.value)}catch(e){throw s&&(s.releaseLock(),s=void 0),e}},async cancel(e){if(s)try{await s.cancel(e)}finally{s.releaseLock(),s=void 0}else o.locked||await o.cancel(e)}})}function A(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r<128)t+=1;else if(r<2048)t+=2;else if(r>=55296&&r<=56319&&n+1<e.length){let r=e.charCodeAt(n+1);r>=56320&&r<=57343?(t+=4,n+=1):t+=3}else t+=3}return t}function le(e){return Object.prototype.toString.call(e)===`[object Object]`}function ue(){}async function j(e,t,n,r){let o,s=`unknown`;i.i(n.config);try{let r=e[`~standard`];s=r.vendor;let c=r.validate(t);o=a.t(c)?await i.t(c,n.config):c,i.i(n.config)}catch(e){throw i.i(n.config),new SchemaValidationError(r.failed,n,s,[],e,r.location)}if(typeof o!=`object`||!o)throw M(r,n,s,`Expected a Standard Schema result`);let c=`issues`in o?o.issues:void 0;if(c!==void 0)throw Array.isArray(c)?new SchemaValidationError(r.rejected,n,s,c,void 0,r.location):M(r,n,s,`Expected Standard Schema issues to be an array`);if(!(`value`in o))throw M(r,n,s,`Expected a Standard Schema value`);return o.value}function M(e,t,n,r){return new SchemaValidationError(e.invalid,t,n,[],TypeError(r),e.location)}function N(e,t){let n=!1,r,i=e(()=>{n=!0});for(let e of[`return`,`throw`]){let a=i[e];i[e]=e=>{let o=!n;n=!0;let s=a.call(i,e);return!o&&!r?s:(o&&(r=Promise.resolve().then(t).catch(()=>{})),Promise.allSettled([s,r]).then(([e])=>{if(e.status===`rejected`)throw e.reason;return e.value}))}}return i}const de=new TextEncoder;function fe(e,t,n,r=t.signal){return N(i=>P(e.body,{config:t,response:e,signal:r,start:i},n),()=>e.body?.cancel())}function pe(e,t,n=t.signal){return N(r=>F(e.body,{config:t,response:e,signal:n,start:r}),()=>e.body?.cancel())}async function*P(e,t,n){t.start();let r=[],i=``,a=n?.initialId??``,o=n?.initialRetry,s=0;for await(let c of L(e,t,!0)){if(c===``){if(r.length>0){let e={data:r.join(`
|
|
2
|
+
`),event:i||`message`,id:a,...o===void 0?{}:{retry:o}};yield await I(e,t,{itemIndex:s,event:e.event,eventId:e.id},`SSE`),s+=1}r=[],i=``;continue}if(c.startsWith(`:`))continue;let e=c.indexOf(`:`),l=e===-1?c:c.slice(0,e),u=e===-1?``:c.slice(e+1);switch(u.startsWith(` `)&&(u=u.slice(1)),l){case`data`:r.push(u);break;case`event`:i=u;break;case`id`:u.includes(`\0`)||(a=u,n?.onId?.(u));break;case`retry`:if(/^\d+$/.test(u)){let e=Number(u);Number.isSafeInteger(e)&&(o=e,n?.onRetry?.(e))}}}}async function*F(t,n){n.start();let r=0,i=0;for await(let a of L(t,n))if(r+=1,a.trim()!==``)try{yield await I(JSON.parse(a),n,{itemIndex:i,lineNumber:r},`NDJSON`),i+=1}catch(t){throw e.n(t)?t:B(`Failed to parse NDJSON at line ${r}`,n,t)}}async function I(e,t,n,r){R(t);let i=t.config.itemSchema;if(!i)return e;let a={data:e,status:t.response.status,statusText:t.response.statusText,headers:t.response.headers,config:t.schemaConfig??t.config,raw:t.response},o=r===`NDJSON`?`item ${n.itemIndex+1} at line ${n.lineNumber}`:`item ${n.itemIndex+1}`;return await j(i,e,a,{failed:`${r} ${o} schema validator failed`,invalid:`${r} ${o} schema validator returned an invalid result`,rejected:`${r} ${o} schema validation failed`,location:n})}async function*L(t,n,r=!1){if(!t)return;let i=t.getReader(),a=new TextDecoder(`utf-8`,{fatal:!0}),o=[],s=!1,c=!1,l=0,u=0,d,f=n.config.itemSchema?new AbortController:void 0;if(f){let e=[f.signal];n.config.signal&&e.push(n.config.signal),n.signal&&n.signal!==n.config.signal&&e.push(n.signal),n.schemaConfig={...n.config,signal:e.length===1?f.signal:AbortSignal.any(e)}}i.closed.catch(t=>{d=t,f?.abort(e.n(t)?t:B(`Failed to parse streaming response`,n,t))});let p=()=>{if(R(n),d!==void 0)throw d},m=n.config.maxStreamLineSize,h=r?n.config.maxSseEventSize:void 0,g=e=>{(Number.isFinite(m)||Number.isFinite(h))&&(l+=de.encode(e).byteLength,z(l,m,`maxStreamLineSize`,n),z(u+l,h,`maxSseEventSize`,n))};try{for(;;){p();let e=await i.read();p(),c=e.done;let t=c?a.decode():a.decode(e.value,{stream:!0}),n=0;s&&t.length>0&&(t[0]===`
|
|
3
|
+
`&&(n=1),s=!1);for(let e=n;e<t.length;e+=1){let r=t[e];if(r!==`
|
|
4
|
+
`&&r!==`\r`)continue;let i=t.slice(n,e);g(i),o.length>0&&(o.push(i),i=o.join(``),o=[]),r===`\r`&&(t[e+1]===`
|
|
5
|
+
`?e+=1:e+1===t.length&&(s=!0)),n=e+1,u=i===``?0:u+l,p(),yield i,l=0}if(n<t.length){let e=t.slice(n);g(e),o.push(e)}if(c)break}p(),o.length>0&&(yield o.join(``))}catch(t){throw e.n(t)?t:B(`Failed to parse streaming response`,n,t)}finally{try{c||i.cancel().catch(()=>{})}catch{}finally{i.releaseLock()}}}function R(e){if(e.config.signal?.aborted)throw i.r(e.config.signal.reason,e.config);if(e.signal?.aborted)throw i.r(e.signal.reason,e.config)}function z(t,n,r,i){if(n!==void 0&&t>n)throw new e.t(`Streaming response exceeds ${r} ${n}`,{code:`RESPONSE_TOO_LARGE`,status:i.response.status,config:i.config})}function B(t,n,r){return new e.t(t,{code:`PARSER_ERROR`,status:n.response.status,config:n.config,cause:r})}const V=Symbol(`npora.sseControl`);function me(e,t){return{...e,[V]:t}}function he(e){return e[V]}const H=new TextDecoder;function ge(e,t){let n=t.maxResponseSize;if(n===void 0||!Number.isFinite(n)||!e.body)return e;U(e,n,t);let r=new Response(J(e,t,n),{status:e.status,statusText:e.statusText,headers:e.headers});return Z(e,r),r}function _e(e,t,n,r,i=1/0,a=n.streamIdleTimeout){if(!e.body)return r(),e;U(e,i,n);let o=J(e,n,i,t,r,a),s=new Response(o,{status:e.status,statusText:e.statusText,headers:e.headers});return Z(e,s),s}async function ve(t,n,r,i=n.maxResponseSize,a){let o=r??K(t,n),s=i;try{if(G(o))return s!==void 0&&Number.isFinite(s)&&(U(t,s,n),t=new Response(t.body?J(t,n,s):null,t)),Se(t,o,n,a);if(a||s!==void 0&&Number.isFinite(s)){let e=Number.isFinite(s)?s:1/0;return U(t,e,n),await be(await ye(t,e,n,a),o,t,n)}switch(o){case`json`:return n.parseJson?await W(await t.text(),n,t):await t.json();case`text`:return await t.text();case`blob`:return await t.blob();case`arrayBuffer`:return await t.arrayBuffer();case`bytes`:return await xe(t);case`formData`:return await t.formData();default:return await t.text()}}catch(r){throw e.n(r)?r:new e.t(`Failed to parse response`,{code:`PARSER_ERROR`,status:t.status,config:n,cause:r})}}function U(e,t,n){let r=Number(e.headers.get(`content-length`));if(!Number.isFinite(r)||r<=t)return;let i=Y(e,t,n);throw e.body?.cancel(i).catch(()=>{}),i}async function ye(e,t,n,r){if(!e.body)return new Uint8Array;let i=e.body.getReader(),a=[],o=0,s,c=r?()=>{s=r.reason??new DOMException(`The operation was aborted`,`AbortError`),i.cancel(s).catch(()=>{})}:void 0;try{for(r?.addEventListener(`abort`,c,{once:!0}),r?.aborted&&c();;){let r=await i.read();if(s!==void 0)throw s;if(r.done)break;if(o+=r.value.byteLength,o>t){let r=Y(e,t,n);throw i.cancel(r).catch(()=>{}),r}a.push(r.value)}}finally{if(c)try{r?.removeEventListener(`abort`,c)}catch{}i.releaseLock()}let l=new Uint8Array(o),u=0;for(let e of a)l.set(e,u),u+=e.byteLength;return l}async function be(e,t,n,r){switch(t){case`json`:return await W(H.decode(e),r,n);case`blob`:return new Blob([q(e)],{type:n.headers.get(`content-type`)??``});case`arrayBuffer`:return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);case`bytes`:return e;case`formData`:return await new Response(q(e),{headers:n.headers}).formData();default:return H.decode(e)}}function W(e,t,n){return t.parseJson?t.parseJson(e,{config:t,response:n}):JSON.parse(e)}async function xe(e){let t=e.bytes;return typeof t==`function`?t.call(e):new Uint8Array(await e.arrayBuffer())}function Se(e,t,n,r){switch(t){case`sse`:return fe(e,n,he(n),r);case`ndjson`:return pe(e,n,r);default:return e.body}}function G(e){return e===`stream`||e===`sse`||e===`ndjson`}function K(e,t){return t.responseType??Ce(e)}function q(e){return t.t(e.buffer)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):Uint8Array.from(e).buffer}function J(t,n,r,i,a,o){let s=t.body.getReader(),c=0,l=!1,u,d,f,p,m=()=>{p!==void 0&&clearTimeout(p),p=void 0},h=()=>{if(!l){if(l=!0,m(),d){try{i?.removeEventListener(`abort`,d)}catch{}d=void 0}s.releaseLock(),a?.()}},g=new ReadableStream({start(e){f=e},async pull(a){try{o&&(p=setTimeout(()=>_(new e.t(`Streaming response idle timeout after ${o}ms`,{code:`TIMEOUT_ERROR`,status:t.status,config:n})),o));let i=await s.read();if(m(),u){let e=u;h(),a.error(e);return}if(l)return;if(i.done){h(),a.close();return}if(c+=i.value.byteLength,c>r){_(Y(t,r,n));return}a.enqueue(i.value)}catch(e){if(l)return;h(),a.error(X(e,i,n))}},cancel(e){try{return s.cancel(e)}finally{h()}}});function _(e){l||(u=e,s.cancel(e).catch(()=>{}),h(),f.error(e))}if(i){d=()=>{l||u!==void 0||_(X(i.reason,i,n))};try{i.addEventListener(`abort`,d,{once:!0}),i.aborted&&d?.()}catch(e){throw s.cancel(e).catch(()=>{}).finally(h),e}}return g}function Y(t,n,r){return new e.t(`Response body exceeds maxResponseSize ${n}`,{code:`RESPONSE_TOO_LARGE`,status:t.status,config:r})}function X(t,n,r){return n?.aborted?e.n(n.reason)?new e.t(n.reason.message,{code:n.reason.code,status:n.reason.status,data:n.reason.data,response:n.reason.response,config:r,cause:n.reason}):new e.t(`Request aborted while consuming response`,{code:`ABORT_ERROR`,config:r,cause:n.reason??t}):t}function Z(e,t){for(let n of[`url`,`redirected`,`type`])try{Object.defineProperty(t,n,{value:e[n],configurable:!0})}catch{}}function Ce(e){let t=e.headers.get(`content-type`);if(!t||t===`text/plain`)return`text`;if(t===`application/json`)return`json`;let n=t.indexOf(`;`),r=t.slice(0,n===-1?void 0:n).trim().toLowerCase();return r===`text/event-stream`?`sse`:r===`application/x-ndjson`||r===`application/ndjson`||Q(r,`+ndjson`)?`ndjson`:r===`application/json`||Q(r,`+json`)?`json`:`text`}function Q(e,t){let n=e.indexOf(`/`),r=e.length-t.length;return n>0&&r>n+1&&e.endsWith(t)}function we(e){let t=e.maxErrorResponseSize??10485760,n=e.maxResponseSize;return Number.isFinite(t)&&(!Number.isFinite(n)||t<(n??1/0))?t:void 0}const $=Symbol(`ERROR_RESPONSE_DATA_UNAVAILABLE`);async function Te(t,n,r){let i=t.timeout??0,a=i>0?i:1e4,o=new AbortController,s,c=!1,l,u=()=>{try{r?.()}catch{}o.abort()};try{let r=new Promise((n,r)=>{s=setTimeout(()=>{if(c=!0,u(),i>0){r(new e.t(`Request timeout after ${i}ms`,{code:`TIMEOUT_ERROR`,config:t}));return}n($)},a)});l=n(o.signal);try{return await Promise.race([l,r])}catch(t){if(e.n(t)&&t.code===`PARSER_ERROR`)return $;throw t}}finally{s!==void 0&&!c&&clearTimeout(s),l?.catch(()=>{})}}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return SchemaValidationError}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return isSchemaValidationError}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return c}});
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./RequestError-DrCr_lwO.cjs"),t=require("./errorResponseTimeout-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./RequestError-DrCr_lwO.cjs"),t=require("./errorResponseTimeout-zXdbsbDE.cjs"),n=require("./createClient-BE0TKFpI.cjs"),r=require("./testing.cjs"),i=require("./PluginError-DT3VnlUB.cjs"),a=require("./plugins/auth.cjs"),o=require("./cachePlugin-C9gu5JD0.cjs"),s=require("./plugins/circuit-breaker.cjs"),c=require("./plugins/concurrency.cjs"),l=require("./plugins/download.cjs"),u=require("./plugins/logger.cjs"),d=require("./plugins/opentelemetry.cjs"),f=require("./plugins/opentelemetry-metrics.cjs"),p=require("./rateLimitPlugin-DWNa7AQu.cjs"),m=require("./plugins/retry.cjs"),h=require("./plugins/upload.cjs");require("./plugins.cjs"),exports.Client=n.n,exports.FetchAdapter=n.i,exports.IndexedDBCacheStore=o.r,exports.InterceptorManager=n.r,exports.MemoryCacheStore=o.i,exports.MockAdapter=r.MockAdapter,exports.PluginError=i.t,exports.RequestError=e.t,exports.SchemaValidationError=t.b,exports.TieredCacheStore=o.n,exports.WebStorageCacheStore=o.a,exports.authPlugin=a.authPlugin,exports.cachePlugin=o.t,exports.circuitBreakerPlugin=s.circuitBreakerPlugin,exports.concurrencyPlugin=c.concurrencyPlugin,exports.createClient=n.t,exports.downloadPlugin=l.downloadPlugin,exports.isRequestError=e.n,exports.isSchemaValidationError=t.x,exports.loggerPlugin=u.loggerPlugin,exports.openTelemetryMetricsPlugin=f.openTelemetryMetricsPlugin,exports.openTelemetryPlugin=d.openTelemetryPlugin,exports.rateLimitPlugin=p.t,exports.retryPlugin=m.retryPlugin,exports.uploadPlugin=h.uploadPlugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
1
|
+
import { A as LoggerEntry, B as RetryEvent, C as CircuitBreakerStateChange, D as DownloadOutput, E as DownloadOptions, F as OpenTelemetryOptions, G as UploadProgress, H as TransferProgress, I as RateLimitOptions, K as HttpMethod, L as RequestLogEntry, M as MemoryCacheOptions, N as OpenTelemetryAttributeValue, O as DownloadProgress, P as OpenTelemetryMetricsOptions, R as RequestLogger, S as CircuitBreakerOptions, T as ConcurrencyOptions, U as UploadData, V as RetryOptions, W as UploadOptions, _ as RequestInputConfig, a as SseStateObserver, b as AuthOptions, c as FetchOptions, d as JsonStringifier, f as QueryParams, g as RequestExtensions, h as RequestConfig, i as SseState, j as LoggerOptions, k as ErrorLogEntry, l as JsonParser, m as QueryValue, n as ServerSentEvent, o as StreamingSchemaLocation, p as QuerySerializer, r as SseReconnectOptions, s as FetchFunction, t as NporaResponse, u as JsonParserContext, v as RequestURL, w as CircuitState, x as CacheOptions, y as ResponseType, z as ResponseLogEntry } from "./response-CXF5lNlw.cjs";
|
|
2
|
+
import { t as StandardSchemaV1 } from "./standardSchema-CjWI0T2o.cjs";
|
|
3
|
+
import { t as Adapter } from "./adapter-Cq9y_Fww.cjs";
|
|
4
|
+
import { a as RequestErrorOptions, c as createClient, i as RequestErrorCode, l as Client, n as isSchemaValidationError, o as isRequestError, r as RequestError, s as FetchAdapter, t as SchemaValidationError, u as ClientOptions } from "./SchemaValidationError-wCE-Wrnw.cjs";
|
|
5
|
+
import { a as MockReplyHandler, c as MockRoute, i as MockReply, l as MockURLMatcher, n as MockAdapterOptions, o as MockRequestMatcher, r as MockHandler, s as MockResponseOptions, t as MockAdapter } from "./MockAdapter-CDWlJKqY.cjs";
|
|
6
|
+
import { a as PluginInterceptorManager, c as InterceptorOptions, i as PluginHookManager, n as PluginCleanup, o as Interceptor, r as PluginContext, s as InterceptorManager, t as Plugin } from "./Plugin-CCFavD-_.cjs";
|
|
6
7
|
import { n as PluginErrorCode, r as PluginErrorOptions, t as PluginError } from "./PluginError-DVP3pUt_.cjs";
|
|
7
|
-
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-
|
|
8
|
-
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-
|
|
9
|
-
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-
|
|
10
|
-
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-
|
|
11
|
-
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-
|
|
12
|
-
import { t as loggerPlugin } from "./loggerPlugin-
|
|
13
|
-
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-
|
|
14
|
-
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-
|
|
15
|
-
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-
|
|
16
|
-
import { t as retryPlugin } from "./retryPlugin-
|
|
17
|
-
import { t as uploadPlugin } from "./uploadPlugin-
|
|
18
|
-
export { Adapter, AuthOptions, AuthPluginOptions, AuthTokenStorage, type CacheEntry, type CacheEvent, type CacheEventType, CacheOptions, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, CircuitBreakerOptions, CircuitBreakerPlugin, CircuitBreakerPluginOptions, CircuitBreakerStateChange, CircuitState, Client, ClientOptions, ConcurrencyOptions, ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, DownloadOptions, DownloadOutput, DownloadPluginOptions, DownloadProgress, DownloadTransport, ErrorLogEntry, FetchAdapter, FetchFunction, FetchOptions, HttpMethod, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, Interceptor, InterceptorManager, InterceptorOptions, JsonParser, JsonParserContext, JsonStringifier, LoggerEntry, LoggerOptions, MemoryCacheOptions, MemoryCacheStore, type MemoryCacheStoreOptions, MockAdapter, MockAdapterOptions, MockHandler, MockReply, MockReplyHandler, MockRequestMatcher, MockResponseOptions, MockRoute, MockURLMatcher, NporaResponse, OpenTelemetryAttributeValue, OpenTelemetryContextApi, OpenTelemetryCounter, OpenTelemetryHeaderSetter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsOptions, OpenTelemetryMetricsPluginOptions, OpenTelemetryOptions, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, Plugin, PluginCleanup, PluginContext, PluginError, PluginErrorCode, PluginErrorOptions, PluginHookManager, PluginInterceptorManager, QueryParams, QuerySerializer, QueryValue, RateLimitOptions, RateLimitPlugin, RateLimitPluginOptions, RateLimitState, RequestConfig, RequestError, RequestErrorCode, RequestErrorOptions, RequestExtensions, RequestInputConfig, RequestLogEntry, RequestLogger, RequestURL, ResponseLogEntry, ResponseType, RetryEvent, RetryOptions, SchemaValidationError, ServerSentEvent, SseReconnectOptions, StandardSchemaV1, StreamingSchemaLocation, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, TransferProgress, UploadData, UploadOptions, UploadProgress, WebStorageCacheStore, type WebStorageCacheStoreOptions, authPlugin, cachePlugin, circuitBreakerPlugin, concurrencyPlugin, createClient, downloadPlugin, isRequestError, isSchemaValidationError, loggerPlugin, openTelemetryMetricsPlugin, openTelemetryPlugin, rateLimitPlugin, retryPlugin, uploadPlugin };
|
|
8
|
+
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-DWpsWoVD.cjs";
|
|
9
|
+
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-BlsRZKN2.cjs";
|
|
10
|
+
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-BL5Pxslz.cjs";
|
|
11
|
+
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-DId5qkk9.cjs";
|
|
12
|
+
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-DtOzKGt_.cjs";
|
|
13
|
+
import { t as loggerPlugin } from "./loggerPlugin-DDEGhC31.cjs";
|
|
14
|
+
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-Dpz6-bEj.cjs";
|
|
15
|
+
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-DuF9OWoT.cjs";
|
|
16
|
+
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-CRpne4Qz.cjs";
|
|
17
|
+
import { t as retryPlugin } from "./retryPlugin-uC02f2sm.cjs";
|
|
18
|
+
import { t as uploadPlugin } from "./uploadPlugin-_xtlBLNY.cjs";
|
|
19
|
+
export { Adapter, AuthOptions, AuthPluginOptions, AuthTokenStorage, type CacheEntry, type CacheEvent, type CacheEventType, CacheOptions, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, CircuitBreakerOptions, CircuitBreakerPlugin, CircuitBreakerPluginOptions, CircuitBreakerStateChange, CircuitState, Client, ClientOptions, ConcurrencyOptions, ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, DownloadOptions, DownloadOutput, DownloadPluginOptions, DownloadProgress, DownloadTransport, ErrorLogEntry, FetchAdapter, FetchFunction, FetchOptions, HttpMethod, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, Interceptor, InterceptorManager, InterceptorOptions, JsonParser, JsonParserContext, JsonStringifier, LoggerEntry, LoggerOptions, MemoryCacheOptions, MemoryCacheStore, type MemoryCacheStoreOptions, MockAdapter, MockAdapterOptions, MockHandler, MockReply, MockReplyHandler, MockRequestMatcher, MockResponseOptions, MockRoute, MockURLMatcher, NporaResponse, OpenTelemetryAttributeValue, OpenTelemetryContextApi, OpenTelemetryCounter, OpenTelemetryHeaderSetter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsOptions, OpenTelemetryMetricsPluginOptions, OpenTelemetryOptions, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, Plugin, PluginCleanup, PluginContext, PluginError, PluginErrorCode, PluginErrorOptions, PluginHookManager, PluginInterceptorManager, QueryParams, QuerySerializer, QueryValue, RateLimitOptions, RateLimitPlugin, RateLimitPluginOptions, RateLimitState, RequestConfig, RequestError, RequestErrorCode, RequestErrorOptions, RequestExtensions, RequestInputConfig, RequestLogEntry, RequestLogger, RequestURL, ResponseLogEntry, ResponseType, RetryEvent, RetryOptions, SchemaValidationError, ServerSentEvent, SseReconnectOptions, SseState, SseStateObserver, StandardSchemaV1, StreamingSchemaLocation, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, TransferProgress, UploadData, UploadOptions, UploadProgress, WebStorageCacheStore, type WebStorageCacheStoreOptions, authPlugin, cachePlugin, circuitBreakerPlugin, concurrencyPlugin, createClient, downloadPlugin, isRequestError, isSchemaValidationError, loggerPlugin, openTelemetryMetricsPlugin, openTelemetryPlugin, rateLimitPlugin, retryPlugin, uploadPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
1
|
+
import { A as LoggerEntry, B as RetryEvent, C as CircuitBreakerStateChange, D as DownloadOutput, E as DownloadOptions, F as OpenTelemetryOptions, G as UploadProgress, H as TransferProgress, I as RateLimitOptions, K as HttpMethod, L as RequestLogEntry, M as MemoryCacheOptions, N as OpenTelemetryAttributeValue, O as DownloadProgress, P as OpenTelemetryMetricsOptions, R as RequestLogger, S as CircuitBreakerOptions, T as ConcurrencyOptions, U as UploadData, V as RetryOptions, W as UploadOptions, _ as RequestInputConfig, a as SseStateObserver, b as AuthOptions, c as FetchOptions, d as JsonStringifier, f as QueryParams, g as RequestExtensions, h as RequestConfig, i as SseState, j as LoggerOptions, k as ErrorLogEntry, l as JsonParser, m as QueryValue, n as ServerSentEvent, o as StreamingSchemaLocation, p as QuerySerializer, r as SseReconnectOptions, s as FetchFunction, t as NporaResponse, u as JsonParserContext, v as RequestURL, w as CircuitState, x as CacheOptions, y as ResponseType, z as ResponseLogEntry } from "./response-BhOBjarL.js";
|
|
2
|
+
import { t as StandardSchemaV1 } from "./standardSchema-CjWI0T2o.js";
|
|
3
|
+
import { t as Adapter } from "./adapter-CcfItVkl.js";
|
|
4
|
+
import { a as RequestErrorOptions, c as createClient, i as RequestErrorCode, l as Client, n as isSchemaValidationError, o as isRequestError, r as RequestError, s as FetchAdapter, t as SchemaValidationError, u as ClientOptions } from "./SchemaValidationError-DoonRNb0.js";
|
|
5
|
+
import { a as MockReplyHandler, c as MockRoute, i as MockReply, l as MockURLMatcher, n as MockAdapterOptions, o as MockRequestMatcher, r as MockHandler, s as MockResponseOptions, t as MockAdapter } from "./MockAdapter-Hi5uqQ8K.js";
|
|
6
|
+
import { a as PluginInterceptorManager, c as InterceptorOptions, i as PluginHookManager, n as PluginCleanup, o as Interceptor, r as PluginContext, s as InterceptorManager, t as Plugin } from "./Plugin-BG4NQC3T.js";
|
|
6
7
|
import { n as PluginErrorCode, r as PluginErrorOptions, t as PluginError } from "./PluginError-DVP3pUt_.js";
|
|
7
|
-
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-
|
|
8
|
-
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-
|
|
9
|
-
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-
|
|
10
|
-
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-
|
|
11
|
-
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-
|
|
12
|
-
import { t as loggerPlugin } from "./loggerPlugin-
|
|
13
|
-
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-
|
|
14
|
-
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-
|
|
15
|
-
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-
|
|
16
|
-
import { t as retryPlugin } from "./retryPlugin-
|
|
17
|
-
import { t as uploadPlugin } from "./uploadPlugin-
|
|
18
|
-
export { Adapter, AuthOptions, AuthPluginOptions, AuthTokenStorage, type CacheEntry, type CacheEvent, type CacheEventType, CacheOptions, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, CircuitBreakerOptions, CircuitBreakerPlugin, CircuitBreakerPluginOptions, CircuitBreakerStateChange, CircuitState, Client, ClientOptions, ConcurrencyOptions, ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, DownloadOptions, DownloadOutput, DownloadPluginOptions, DownloadProgress, DownloadTransport, ErrorLogEntry, FetchAdapter, FetchFunction, FetchOptions, HttpMethod, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, Interceptor, InterceptorManager, InterceptorOptions, JsonParser, JsonParserContext, JsonStringifier, LoggerEntry, LoggerOptions, MemoryCacheOptions, MemoryCacheStore, type MemoryCacheStoreOptions, MockAdapter, MockAdapterOptions, MockHandler, MockReply, MockReplyHandler, MockRequestMatcher, MockResponseOptions, MockRoute, MockURLMatcher, NporaResponse, OpenTelemetryAttributeValue, OpenTelemetryContextApi, OpenTelemetryCounter, OpenTelemetryHeaderSetter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsOptions, OpenTelemetryMetricsPluginOptions, OpenTelemetryOptions, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, Plugin, PluginCleanup, PluginContext, PluginError, PluginErrorCode, PluginErrorOptions, PluginHookManager, PluginInterceptorManager, QueryParams, QuerySerializer, QueryValue, RateLimitOptions, RateLimitPlugin, RateLimitPluginOptions, RateLimitState, RequestConfig, RequestError, RequestErrorCode, RequestErrorOptions, RequestExtensions, RequestInputConfig, RequestLogEntry, RequestLogger, RequestURL, ResponseLogEntry, ResponseType, RetryEvent, RetryOptions, SchemaValidationError, ServerSentEvent, SseReconnectOptions, StandardSchemaV1, StreamingSchemaLocation, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, TransferProgress, UploadData, UploadOptions, UploadProgress, WebStorageCacheStore, type WebStorageCacheStoreOptions, authPlugin, cachePlugin, circuitBreakerPlugin, concurrencyPlugin, createClient, downloadPlugin, isRequestError, isSchemaValidationError, loggerPlugin, openTelemetryMetricsPlugin, openTelemetryPlugin, rateLimitPlugin, retryPlugin, uploadPlugin };
|
|
8
|
+
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-DRCFibHZ.js";
|
|
9
|
+
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-D2ONW9sl.js";
|
|
10
|
+
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-DUyVrQlA.js";
|
|
11
|
+
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-DM66h5PD.js";
|
|
12
|
+
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-BY3BVNw4.js";
|
|
13
|
+
import { t as loggerPlugin } from "./loggerPlugin-ChJJN0ZA.js";
|
|
14
|
+
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-DOhBE_uZ.js";
|
|
15
|
+
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-BEoeRl3q.js";
|
|
16
|
+
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-Ce3bjrRw.js";
|
|
17
|
+
import { t as retryPlugin } from "./retryPlugin-5vYHV92i.js";
|
|
18
|
+
import { t as uploadPlugin } from "./uploadPlugin-CNdvddnT.js";
|
|
19
|
+
export { Adapter, AuthOptions, AuthPluginOptions, AuthTokenStorage, type CacheEntry, type CacheEvent, type CacheEventType, CacheOptions, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, CircuitBreakerOptions, CircuitBreakerPlugin, CircuitBreakerPluginOptions, CircuitBreakerStateChange, CircuitState, Client, ClientOptions, ConcurrencyOptions, ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, DownloadOptions, DownloadOutput, DownloadPluginOptions, DownloadProgress, DownloadTransport, ErrorLogEntry, FetchAdapter, FetchFunction, FetchOptions, HttpMethod, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, Interceptor, InterceptorManager, InterceptorOptions, JsonParser, JsonParserContext, JsonStringifier, LoggerEntry, LoggerOptions, MemoryCacheOptions, MemoryCacheStore, type MemoryCacheStoreOptions, MockAdapter, MockAdapterOptions, MockHandler, MockReply, MockReplyHandler, MockRequestMatcher, MockResponseOptions, MockRoute, MockURLMatcher, NporaResponse, OpenTelemetryAttributeValue, OpenTelemetryContextApi, OpenTelemetryCounter, OpenTelemetryHeaderSetter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsOptions, OpenTelemetryMetricsPluginOptions, OpenTelemetryOptions, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, Plugin, PluginCleanup, PluginContext, PluginError, PluginErrorCode, PluginErrorOptions, PluginHookManager, PluginInterceptorManager, QueryParams, QuerySerializer, QueryValue, RateLimitOptions, RateLimitPlugin, RateLimitPluginOptions, RateLimitState, RequestConfig, RequestError, RequestErrorCode, RequestErrorOptions, RequestExtensions, RequestInputConfig, RequestLogEntry, RequestLogger, RequestURL, ResponseLogEntry, ResponseType, RetryEvent, RetryOptions, SchemaValidationError, ServerSentEvent, SseReconnectOptions, SseState, SseStateObserver, StandardSchemaV1, StreamingSchemaLocation, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, TransferProgress, UploadData, UploadOptions, UploadProgress, WebStorageCacheStore, type WebStorageCacheStoreOptions, authPlugin, cachePlugin, circuitBreakerPlugin, concurrencyPlugin, createClient, downloadPlugin, isRequestError, isSchemaValidationError, loggerPlugin, openTelemetryMetricsPlugin, openTelemetryPlugin, rateLimitPlugin, retryPlugin, uploadPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as isRequestError,t as e}from"./RequestError-B0HIY1zK.js";import{b as t,x as isSchemaValidationError}from"./errorResponseTimeout-
|
|
1
|
+
import{n as isRequestError,t as e}from"./RequestError-B0HIY1zK.js";import{b as t,x as isSchemaValidationError}from"./errorResponseTimeout-BEEJV0xA.js";import{i as n,n as r,r as i,t as createClient}from"./createClient-wLCkChly.js";import{MockAdapter as a}from"./testing.js";import{t as o}from"./PluginError-CcuPSIRv.js";import{authPlugin}from"./plugins/auth.js";import{a as s,i as c,n as l,r as u,t as cachePlugin}from"./cachePlugin-BGfwCJRI.js";import{circuitBreakerPlugin}from"./plugins/circuit-breaker.js";import{concurrencyPlugin}from"./plugins/concurrency.js";import{downloadPlugin}from"./plugins/download.js";import{loggerPlugin}from"./plugins/logger.js";import{openTelemetryPlugin}from"./plugins/opentelemetry.js";import{openTelemetryMetricsPlugin}from"./plugins/opentelemetry-metrics.js";import{t as rateLimitPlugin}from"./rateLimitPlugin-hVcAA_ZA.js";import{retryPlugin}from"./plugins/retry.js";import{uploadPlugin}from"./plugins/upload.js";import"./plugins.js";export{r as Client,n as FetchAdapter,u as IndexedDBCacheStore,i as InterceptorManager,c as MemoryCacheStore,a as MockAdapter,o as PluginError,e as RequestError,t as SchemaValidationError,l as TieredCacheStore,s as WebStorageCacheStore,authPlugin,cachePlugin,circuitBreakerPlugin,concurrencyPlugin,createClient,downloadPlugin,isRequestError,isSchemaValidationError,loggerPlugin,openTelemetryMetricsPlugin,openTelemetryPlugin,rateLimitPlugin,retryPlugin,uploadPlugin};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { j as LoggerOptions } from "./response-BhOBjarL.js";
|
|
2
|
+
import { t as Plugin } from "./Plugin-BG4NQC3T.js";
|
|
3
|
+
//#region src/plugins/loggerPlugin.d.ts
|
|
4
|
+
declare function loggerPlugin(defaultOptions?: LoggerOptions): Plugin;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { loggerPlugin as t };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { j as LoggerOptions } from "./response-CXF5lNlw.cjs";
|
|
2
|
+
import { t as Plugin } from "./Plugin-CCFavD-_.cjs";
|
|
3
|
+
//#region src/plugins/loggerPlugin.d.ts
|
|
4
|
+
declare function loggerPlugin(defaultOptions?: LoggerOptions): Plugin;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { loggerPlugin as t };
|
package/dist/{openTelemetryMetricsPlugin-BSlh7PDU.d.ts → openTelemetryMetricsPlugin-BEoeRl3q.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Plugin } from "./Plugin-
|
|
1
|
+
import { N as OpenTelemetryAttributeValue, h as RequestConfig } from "./response-BhOBjarL.js";
|
|
2
|
+
import { t as Plugin } from "./Plugin-BG4NQC3T.js";
|
|
3
3
|
//#region src/plugins/openTelemetryMetricsPlugin.d.ts
|
|
4
4
|
type OpenTelemetryMetricAttributes = Readonly<Record<string, OpenTelemetryAttributeValue>>;
|
|
5
5
|
interface OpenTelemetryCounter {
|
package/dist/{openTelemetryMetricsPlugin-CAAyfWw-.d.cts → openTelemetryMetricsPlugin-DuF9OWoT.d.cts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Plugin } from "./Plugin-
|
|
1
|
+
import { N as OpenTelemetryAttributeValue, h as RequestConfig } from "./response-CXF5lNlw.cjs";
|
|
2
|
+
import { t as Plugin } from "./Plugin-CCFavD-_.cjs";
|
|
3
3
|
//#region src/plugins/openTelemetryMetricsPlugin.d.ts
|
|
4
4
|
type OpenTelemetryMetricAttributes = Readonly<Record<string, OpenTelemetryAttributeValue>>;
|
|
5
5
|
interface OpenTelemetryCounter {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Plugin } from "./Plugin-
|
|
1
|
+
import { N as OpenTelemetryAttributeValue, h as RequestConfig } from "./response-BhOBjarL.js";
|
|
2
|
+
import { t as Plugin } from "./Plugin-BG4NQC3T.js";
|
|
3
3
|
//#region src/plugins/openTelemetryPlugin.d.ts
|
|
4
4
|
interface OpenTelemetrySpan {
|
|
5
5
|
setAttribute(name: string, value: OpenTelemetryAttributeValue): this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Plugin } from "./Plugin-
|
|
1
|
+
import { N as OpenTelemetryAttributeValue, h as RequestConfig } from "./response-CXF5lNlw.cjs";
|
|
2
|
+
import { t as Plugin } from "./Plugin-CCFavD-_.cjs";
|
|
3
3
|
//#region src/plugins/openTelemetryPlugin.d.ts
|
|
4
4
|
interface OpenTelemetrySpan {
|
|
5
5
|
setAttribute(name: string, value: OpenTelemetryAttributeValue): this;
|
package/dist/plugins/auth.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "../authPlugin-
|
|
1
|
+
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "../authPlugin-DWpsWoVD.cjs";
|
|
2
2
|
export { AuthPluginOptions, AuthTokenStorage, authPlugin };
|
package/dist/plugins/auth.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "../authPlugin-
|
|
1
|
+
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "../authPlugin-DRCFibHZ.js";
|
|
2
2
|
export { AuthPluginOptions, AuthTokenStorage, authPlugin };
|
package/dist/plugins/cache.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cachePlugin-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cachePlugin-C9gu5JD0.cjs");exports.IndexedDBCacheStore=e.r,exports.MemoryCacheStore=e.i,exports.TieredCacheStore=e.n,exports.WebStorageCacheStore=e.a,exports.cachePlugin=e.t;
|
package/dist/plugins/cache.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "../cachePlugin-
|
|
1
|
+
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "../cachePlugin-BlsRZKN2.cjs";
|
|
2
2
|
export { type CacheEntry, type CacheEvent, type CacheEventType, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, MemoryCacheStore, type MemoryCacheStoreOptions, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, WebStorageCacheStore, type WebStorageCacheStoreOptions, cachePlugin };
|
package/dist/plugins/cache.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "../cachePlugin-
|
|
1
|
+
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "../cachePlugin-D2ONW9sl.js";
|
|
2
2
|
export { type CacheEntry, type CacheEvent, type CacheEventType, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, MemoryCacheStore, type MemoryCacheStoreOptions, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, WebStorageCacheStore, type WebStorageCacheStoreOptions, cachePlugin };
|
package/dist/plugins/cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as cachePlugin}from"../cachePlugin-
|
|
1
|
+
import{a as e,i as t,n,r,t as cachePlugin}from"../cachePlugin-BGfwCJRI.js";export{r as IndexedDBCacheStore,t as MemoryCacheStore,n as TieredCacheStore,e as WebStorageCacheStore,cachePlugin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "../circuitBreakerPlugin-
|
|
1
|
+
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "../circuitBreakerPlugin-BL5Pxslz.cjs";
|
|
2
2
|
export { CircuitBreakerPlugin, CircuitBreakerPluginOptions, circuitBreakerPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "../circuitBreakerPlugin-
|
|
1
|
+
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "../circuitBreakerPlugin-DUyVrQlA.js";
|
|
2
2
|
export { CircuitBreakerPlugin, CircuitBreakerPluginOptions, circuitBreakerPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "../concurrencyPlugin-
|
|
1
|
+
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "../concurrencyPlugin-DId5qkk9.cjs";
|
|
2
2
|
export { ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, concurrencyPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "../concurrencyPlugin-
|
|
1
|
+
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "../concurrencyPlugin-DM66h5PD.js";
|
|
2
2
|
export { ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, concurrencyPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../RequestError-DrCr_lwO.cjs"),t=require("../isBinaryBody-DNjjEzFS.cjs"),n=require("../validateResponseStatus-6FKeKyEV.cjs"),r=require("../isReadableStream-uWhOa7eR.cjs"),i=require("../resolveExtensionConfig-D_eh4DjS.cjs"),a=require("../xhrTransport-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../RequestError-DrCr_lwO.cjs"),t=require("../isBinaryBody-DNjjEzFS.cjs"),n=require("../validateResponseStatus-6FKeKyEV.cjs"),r=require("../isReadableStream-uWhOa7eR.cjs"),i=require("../resolveExtensionConfig-D_eh4DjS.cjs"),a=require("../xhrTransport-BeC2XSM2.cjs");function downloadPlugin(t={}){let o=new WeakSet;return{name:`download`,install(u){u.interceptors.request.use(e=>{let n=i.t(e,`download`);if(!n)return e;if(s(n.output,e)===`stream`)return c(t.transport,e),{...e,responseType:`stream`};let r=n.onProgress&&!l(t.transport)?`stream`:e.responseType??`blob`;return{...e,responseType:r}}),u.hooks.onTransport(async n=>{if(n.response)return;let r=i.t(n.config,`download`),s=r?.onProgress;if(!(r?.output===`stream`||!s||!l(t.transport))){if(typeof XMLHttpRequest>`u`)throw new e.t(`XMLHttpRequest is unavailable for download progress`,{code:`CONFIG_ERROR`,config:n.config});n.response=await a.t(n.config,{onDownloadProgress:s,preserveRaw:n.preserveRaw}),o.add(n)}},{priority:-3e3}),u.hooks.onResponse(async t=>{if(o.has(t))return;let a=t.response;if(!a)return;let s=i.t(a.config,`download`),c=s?.onProgress;if(!s)return;let l=a.data,u=s.output===`stream`;if(l===void 0&&n.n(a.config.method,a.status,a.raw.type)){if(!u){c?.({loaded:0,total:0,bytes:0});return}l=new ReadableStream({start(e){e.close()}})}if(!u&&!c)return;if(!r.t(l))throw new e.t(`Download response stream is unavailable`,{code:`PARSER_ERROR`,status:a.status,config:a.config});if(u){t.response={...a,data:c?f(l,a,c):l};return}if(!c)return;let p=await d(l,a,c);t.response={...a,data:p}},{requiresRawResponse:!1})}}}function s(t,n){if(t===void 0||t===`blob`)return`blob`;if(t===`stream`)return t;throw new e.t(`Download output must be "blob" or "stream"`,{code:`CONFIG_ERROR`,config:n})}function c(t,n){if(t===`xhr`)throw new e.t(`Stream downloads require the Fetch transport`,{code:`CONFIG_ERROR`,config:n});if(!u())throw new e.t(`Fetch response streams are unavailable`,{code:`CONFIG_ERROR`,config:n})}function l(e=`auto`){return e===`xhr`||e!==`fetch`&&!u()&&typeof XMLHttpRequest<`u`}function u(){return typeof ReadableStream<`u`&&typeof Response<`u`&&`body`in Response.prototype}async function d(e,t,n){let r=e.getReader(),i=[],o=m(t.headers.get(`content-length`)),s=a.n(),c=0,l=!1;try{for(;;){let e=await r.read();if(e.done)break;let t=e.value;i.push(p(t)),c+=t.byteLength,l=!0,n(s(c,o))}l||n(s(0,o))}catch(e){try{await r.cancel(e)}catch{}throw e}finally{r.releaseLock()}return new Blob(i,{type:t.headers.get(`content-type`)??``})}function f(e,t,n){let r=e.getReader(),i=m(t.headers.get(`content-length`)),o=a.n(),s=0,c=!1,l=!1,u=()=>{l||(l=!0,r.releaseLock())};return new ReadableStream({async pull(e){try{let t=await r.read();if(t.done){c||n(o(0,i)),u(),e.close();return}s+=t.value.byteLength,c=!0,n(o(s,i)),e.enqueue(t.value)}catch(t){try{await r.cancel(t)}catch{}u(),e.error(t)}},async cancel(e){try{await r.cancel(e)}finally{u()}}},{highWaterMark:0})}function p(e){if(t.t(e.buffer))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);let n=new Uint8Array(e.byteLength);return n.set(e),n.buffer}function m(e){if(!e)return;let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}exports.downloadPlugin=downloadPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "../downloadPlugin-
|
|
1
|
+
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "../downloadPlugin-DtOzKGt_.cjs";
|
|
2
2
|
export { DownloadPluginOptions, DownloadTransport, downloadPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "../downloadPlugin-
|
|
1
|
+
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "../downloadPlugin-BY3BVNw4.js";
|
|
2
2
|
export { DownloadPluginOptions, DownloadTransport, downloadPlugin };
|
package/dist/plugins/download.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../RequestError-B0HIY1zK.js";import{t}from"../isBinaryBody-D-Wp2IPk.js";import{n}from"../validateResponseStatus-BzkEtZZi.js";import{t as r}from"../isReadableStream-DBMPCr6B.js";import{t as i}from"../resolveExtensionConfig-C_MshvkE.js";import{n as a,t as o}from"../xhrTransport
|
|
1
|
+
import{t as e}from"../RequestError-B0HIY1zK.js";import{t}from"../isBinaryBody-D-Wp2IPk.js";import{n}from"../validateResponseStatus-BzkEtZZi.js";import{t as r}from"../isReadableStream-DBMPCr6B.js";import{t as i}from"../resolveExtensionConfig-C_MshvkE.js";import{n as a,t as o}from"../xhrTransport--NHaimro.js";function downloadPlugin(t={}){let a=new WeakSet;return{name:`download`,install(s){s.interceptors.request.use(e=>{let n=i(e,`download`);if(!n)return e;if(c(n.output,e)===`stream`)return l(t.transport,e),{...e,responseType:`stream`};let r=n.onProgress&&!u(t.transport)?`stream`:e.responseType??`blob`;return{...e,responseType:r}}),s.hooks.onTransport(async n=>{if(n.response)return;let r=i(n.config,`download`),s=r?.onProgress;if(!(r?.output===`stream`||!s||!u(t.transport))){if(typeof XMLHttpRequest>`u`)throw new e(`XMLHttpRequest is unavailable for download progress`,{code:`CONFIG_ERROR`,config:n.config});n.response=await o(n.config,{onDownloadProgress:s,preserveRaw:n.preserveRaw}),a.add(n)}},{priority:-3e3}),s.hooks.onResponse(async t=>{if(a.has(t))return;let o=t.response;if(!o)return;let s=i(o.config,`download`),c=s?.onProgress;if(!s)return;let l=o.data,u=s.output===`stream`;if(l===void 0&&n(o.config.method,o.status,o.raw.type)){if(!u){c?.({loaded:0,total:0,bytes:0});return}l=new ReadableStream({start(e){e.close()}})}if(!u&&!c)return;if(!r(l))throw new e(`Download response stream is unavailable`,{code:`PARSER_ERROR`,status:o.status,config:o.config});if(u){t.response={...o,data:c?p(l,o,c):l};return}if(!c)return;let d=await f(l,o,c);t.response={...o,data:d}},{requiresRawResponse:!1})}}}function c(t,n){if(t===void 0||t===`blob`)return`blob`;if(t===`stream`)return t;throw new e(`Download output must be "blob" or "stream"`,{code:`CONFIG_ERROR`,config:n})}function l(t,n){if(t===`xhr`)throw new e(`Stream downloads require the Fetch transport`,{code:`CONFIG_ERROR`,config:n});if(!d())throw new e(`Fetch response streams are unavailable`,{code:`CONFIG_ERROR`,config:n})}function u(e=`auto`){return e===`xhr`||e!==`fetch`&&!d()&&typeof XMLHttpRequest<`u`}function d(){return typeof ReadableStream<`u`&&typeof Response<`u`&&`body`in Response.prototype}async function f(e,t,n){let r=e.getReader(),i=[],o=h(t.headers.get(`content-length`)),s=a(),c=0,l=!1;try{for(;;){let e=await r.read();if(e.done)break;let t=e.value;i.push(m(t)),c+=t.byteLength,l=!0,n(s(c,o))}l||n(s(0,o))}catch(e){try{await r.cancel(e)}catch{}throw e}finally{r.releaseLock()}return new Blob(i,{type:t.headers.get(`content-type`)??``})}function p(e,t,n){let r=e.getReader(),i=h(t.headers.get(`content-length`)),o=a(),s=0,c=!1,l=!1,u=()=>{l||(l=!0,r.releaseLock())};return new ReadableStream({async pull(e){try{let t=await r.read();if(t.done){c||n(o(0,i)),u(),e.close();return}s+=t.value.byteLength,c=!0,n(o(s,i)),e.enqueue(t.value)}catch(t){try{await r.cancel(t)}catch{}u(),e.error(t)}},async cancel(e){try{await r.cancel(e)}finally{u()}}},{highWaterMark:0})}function m(e){if(t(e.buffer))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);let n=new Uint8Array(e.byteLength);return n.set(e),n.buffer}function h(e){if(!e)return;let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}export{downloadPlugin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as loggerPlugin } from "../loggerPlugin-
|
|
1
|
+
import { t as loggerPlugin } from "../loggerPlugin-DDEGhC31.cjs";
|
|
2
2
|
export { loggerPlugin };
|
package/dist/plugins/logger.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as loggerPlugin } from "../loggerPlugin-
|
|
1
|
+
import { t as loggerPlugin } from "../loggerPlugin-ChJJN0ZA.js";
|
|
2
2
|
export { loggerPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "../openTelemetryMetricsPlugin-
|
|
1
|
+
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "../openTelemetryMetricsPlugin-DuF9OWoT.cjs";
|
|
2
2
|
export { OpenTelemetryCounter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsPluginOptions, openTelemetryMetricsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "../openTelemetryMetricsPlugin-
|
|
1
|
+
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "../openTelemetryMetricsPlugin-BEoeRl3q.js";
|
|
2
2
|
export { OpenTelemetryCounter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsPluginOptions, openTelemetryMetricsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "../openTelemetryPlugin-
|
|
1
|
+
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "../openTelemetryPlugin-Dpz6-bEj.cjs";
|
|
2
2
|
export { OpenTelemetryContextApi, OpenTelemetryHeaderSetter, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, openTelemetryPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "../openTelemetryPlugin-
|
|
1
|
+
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "../openTelemetryPlugin-DOhBE_uZ.js";
|
|
2
2
|
export { OpenTelemetryContextApi, OpenTelemetryHeaderSetter, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, openTelemetryPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "../rateLimitPlugin-
|
|
1
|
+
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "../rateLimitPlugin-CRpne4Qz.cjs";
|
|
2
2
|
export { RateLimitPlugin, RateLimitPluginOptions, RateLimitState, rateLimitPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "../rateLimitPlugin-
|
|
1
|
+
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "../rateLimitPlugin-Ce3bjrRw.js";
|
|
2
2
|
export { RateLimitPlugin, RateLimitPluginOptions, RateLimitState, rateLimitPlugin };
|
package/dist/plugins/retry.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as retryPlugin } from "../retryPlugin-
|
|
1
|
+
import { t as retryPlugin } from "../retryPlugin-uC02f2sm.cjs";
|
|
2
2
|
export { retryPlugin };
|
package/dist/plugins/retry.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as retryPlugin } from "../retryPlugin-
|
|
1
|
+
import { t as retryPlugin } from "../retryPlugin-5vYHV92i.js";
|
|
2
2
|
export { retryPlugin };
|
package/dist/plugins/upload.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../RequestError-DrCr_lwO.cjs"),t=require("../resolveExtensionConfig-D_eh4DjS.cjs"),n=require("../xhrTransport-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../RequestError-DrCr_lwO.cjs"),t=require("../resolveExtensionConfig-D_eh4DjS.cjs"),n=require("../xhrTransport-BeC2XSM2.cjs");function uploadPlugin(){return{name:`upload`,install(r){r.interceptors.request.use(e=>{let n=t.t(e,`upload`);return n?{...e,method:e.method??`POST`,formData:n.data}:e}),r.hooks.onTransport(async r=>{if(r.response)return;let i=t.t(r.config,`upload`);if(i?.onProgress){if(typeof XMLHttpRequest>`u`)throw new e.t(`XMLHttpRequest is unavailable for upload progress`,{code:`CONFIG_ERROR`,config:r.config});r.response=await n.t(r.config,{onUploadProgress:i.onProgress,preserveRaw:r.preserveRaw})}})}}}exports.uploadPlugin=uploadPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as uploadPlugin } from "../uploadPlugin-
|
|
1
|
+
import { t as uploadPlugin } from "../uploadPlugin-_xtlBLNY.cjs";
|
|
2
2
|
export { uploadPlugin };
|
package/dist/plugins/upload.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as uploadPlugin } from "../uploadPlugin-
|
|
1
|
+
import { t as uploadPlugin } from "../uploadPlugin-CNdvddnT.js";
|
|
2
2
|
export { uploadPlugin };
|
package/dist/plugins/upload.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../RequestError-B0HIY1zK.js";import{t}from"../resolveExtensionConfig-C_MshvkE.js";import{t as n}from"../xhrTransport
|
|
1
|
+
import{t as e}from"../RequestError-B0HIY1zK.js";import{t}from"../resolveExtensionConfig-C_MshvkE.js";import{t as n}from"../xhrTransport--NHaimro.js";function uploadPlugin(){return{name:`upload`,install(r){r.interceptors.request.use(e=>{let n=t(e,`upload`);return n?{...e,method:e.method??`POST`,formData:n.data}:e}),r.hooks.onTransport(async r=>{if(r.response)return;let i=t(r.config,`upload`);if(i?.onProgress){if(typeof XMLHttpRequest>`u`)throw new e(`XMLHttpRequest is unavailable for upload progress`,{code:`CONFIG_ERROR`,config:r.config});r.response=await n(r.config,{onUploadProgress:i.onProgress,preserveRaw:r.preserveRaw})}})}}}export{uploadPlugin};
|
package/dist/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./PluginError-DT3VnlUB.cjs"),t=require("./plugins/auth.cjs"),n=require("./cachePlugin-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./PluginError-DT3VnlUB.cjs"),t=require("./plugins/auth.cjs"),n=require("./cachePlugin-C9gu5JD0.cjs"),r=require("./plugins/circuit-breaker.cjs"),i=require("./plugins/concurrency.cjs"),a=require("./plugins/download.cjs"),o=require("./plugins/logger.cjs"),s=require("./plugins/opentelemetry.cjs"),c=require("./plugins/opentelemetry-metrics.cjs"),l=require("./rateLimitPlugin-DWNa7AQu.cjs"),u=require("./plugins/retry.cjs"),d=require("./plugins/upload.cjs");exports.IndexedDBCacheStore=n.r,exports.MemoryCacheStore=n.i,exports.PluginError=e.t,exports.TieredCacheStore=n.n,exports.WebStorageCacheStore=n.a,exports.authPlugin=t.authPlugin,exports.cachePlugin=n.t,exports.circuitBreakerPlugin=r.circuitBreakerPlugin,exports.concurrencyPlugin=i.concurrencyPlugin,exports.downloadPlugin=a.downloadPlugin,exports.loggerPlugin=o.loggerPlugin,exports.openTelemetryMetricsPlugin=c.openTelemetryMetricsPlugin,exports.openTelemetryPlugin=s.openTelemetryPlugin,exports.rateLimitPlugin=l.t,exports.retryPlugin=u.retryPlugin,exports.uploadPlugin=d.uploadPlugin;
|
package/dist/plugins.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as PluginInterceptorManager, i as PluginHookManager, n as PluginCleanup, r as PluginContext, t as Plugin } from "./Plugin-
|
|
1
|
+
import { a as PluginInterceptorManager, i as PluginHookManager, n as PluginCleanup, r as PluginContext, t as Plugin } from "./Plugin-CCFavD-_.cjs";
|
|
2
2
|
import { n as PluginErrorCode, r as PluginErrorOptions, t as PluginError } from "./PluginError-DVP3pUt_.cjs";
|
|
3
|
-
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-
|
|
4
|
-
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-
|
|
5
|
-
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-
|
|
6
|
-
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-
|
|
7
|
-
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-
|
|
8
|
-
import { t as loggerPlugin } from "./loggerPlugin-
|
|
9
|
-
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-
|
|
10
|
-
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-
|
|
11
|
-
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-
|
|
12
|
-
import { t as retryPlugin } from "./retryPlugin-
|
|
13
|
-
import { t as uploadPlugin } from "./uploadPlugin-
|
|
3
|
+
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-DWpsWoVD.cjs";
|
|
4
|
+
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-BlsRZKN2.cjs";
|
|
5
|
+
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-BL5Pxslz.cjs";
|
|
6
|
+
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-DId5qkk9.cjs";
|
|
7
|
+
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-DtOzKGt_.cjs";
|
|
8
|
+
import { t as loggerPlugin } from "./loggerPlugin-DDEGhC31.cjs";
|
|
9
|
+
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-Dpz6-bEj.cjs";
|
|
10
|
+
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-DuF9OWoT.cjs";
|
|
11
|
+
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-CRpne4Qz.cjs";
|
|
12
|
+
import { t as retryPlugin } from "./retryPlugin-uC02f2sm.cjs";
|
|
13
|
+
import { t as uploadPlugin } from "./uploadPlugin-_xtlBLNY.cjs";
|
|
14
14
|
export { AuthPluginOptions, AuthTokenStorage, type CacheEntry, type CacheEvent, type CacheEventType, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, CircuitBreakerPlugin, CircuitBreakerPluginOptions, ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, DownloadPluginOptions, DownloadTransport, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, MemoryCacheStore, type MemoryCacheStoreOptions, OpenTelemetryContextApi, OpenTelemetryCounter, OpenTelemetryHeaderSetter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsPluginOptions, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, Plugin, PluginCleanup, PluginContext, PluginError, PluginErrorCode, PluginErrorOptions, PluginHookManager, PluginInterceptorManager, RateLimitPlugin, RateLimitPluginOptions, RateLimitState, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, WebStorageCacheStore, type WebStorageCacheStoreOptions, authPlugin, cachePlugin, circuitBreakerPlugin, concurrencyPlugin, downloadPlugin, loggerPlugin, openTelemetryMetricsPlugin, openTelemetryPlugin, rateLimitPlugin, retryPlugin, uploadPlugin };
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as PluginInterceptorManager, i as PluginHookManager, n as PluginCleanup, r as PluginContext, t as Plugin } from "./Plugin-
|
|
1
|
+
import { a as PluginInterceptorManager, i as PluginHookManager, n as PluginCleanup, r as PluginContext, t as Plugin } from "./Plugin-BG4NQC3T.js";
|
|
2
2
|
import { n as PluginErrorCode, r as PluginErrorOptions, t as PluginError } from "./PluginError-DVP3pUt_.js";
|
|
3
|
-
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-
|
|
4
|
-
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-
|
|
5
|
-
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-
|
|
6
|
-
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-
|
|
7
|
-
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-
|
|
8
|
-
import { t as loggerPlugin } from "./loggerPlugin-
|
|
9
|
-
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-
|
|
10
|
-
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-
|
|
11
|
-
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-
|
|
12
|
-
import { t as retryPlugin } from "./retryPlugin-
|
|
13
|
-
import { t as uploadPlugin } from "./uploadPlugin-
|
|
3
|
+
import { n as AuthTokenStorage, r as authPlugin, t as AuthPluginOptions } from "./authPlugin-DRCFibHZ.js";
|
|
4
|
+
import { C as WebStorageCacheStore, S as MemoryCacheStoreOptions, _ as CacheStats, a as TieredCacheStoreOptions, b as CacheStore, c as IndexedDBCacheCompactionResult, d as IndexedDBCacheUsage, f as CacheEvent, g as CacheSetOptions, h as CachePluginOptions, i as TieredCacheStore, l as IndexedDBCacheStoreEvent, m as CachePlugin, n as TieredCacheBroadcastOptions, o as IndexedDBCacheStore, p as CacheEventType, r as TieredCacheCoordinationOptions, s as IndexedDBCacheCompactionOptions, t as cachePlugin, u as IndexedDBCacheStoreOptions, v as CacheEntry, w as WebStorageCacheStoreOptions, x as MemoryCacheStore, y as CacheRefreshLease } from "./cachePlugin-D2ONW9sl.js";
|
|
5
|
+
import { n as CircuitBreakerPluginOptions, r as circuitBreakerPlugin, t as CircuitBreakerPlugin } from "./circuitBreakerPlugin-DUyVrQlA.js";
|
|
6
|
+
import { i as concurrencyPlugin, n as ConcurrencyPluginOptions, r as ConcurrencyState, t as ConcurrencyPlugin } from "./concurrencyPlugin-DM66h5PD.js";
|
|
7
|
+
import { n as DownloadTransport, r as downloadPlugin, t as DownloadPluginOptions } from "./downloadPlugin-BY3BVNw4.js";
|
|
8
|
+
import { t as loggerPlugin } from "./loggerPlugin-ChJJN0ZA.js";
|
|
9
|
+
import { a as OpenTelemetrySpan, c as openTelemetryPlugin, i as OpenTelemetryPropagationApi, n as OpenTelemetryHeaderSetter, o as OpenTelemetryTraceApi, r as OpenTelemetryPluginOptions, s as OpenTelemetryTracer, t as OpenTelemetryContextApi } from "./openTelemetryPlugin-DOhBE_uZ.js";
|
|
10
|
+
import { a as OpenTelemetryMetricsPluginOptions, i as OpenTelemetryMetricAttributes, n as OpenTelemetryHistogram, o as openTelemetryMetricsPlugin, r as OpenTelemetryMeter, t as OpenTelemetryCounter } from "./openTelemetryMetricsPlugin-BEoeRl3q.js";
|
|
11
|
+
import { i as rateLimitPlugin, n as RateLimitPluginOptions, r as RateLimitState, t as RateLimitPlugin } from "./rateLimitPlugin-Ce3bjrRw.js";
|
|
12
|
+
import { t as retryPlugin } from "./retryPlugin-5vYHV92i.js";
|
|
13
|
+
import { t as uploadPlugin } from "./uploadPlugin-CNdvddnT.js";
|
|
14
14
|
export { AuthPluginOptions, AuthTokenStorage, type CacheEntry, type CacheEvent, type CacheEventType, type CachePlugin, type CachePluginOptions, type CacheRefreshLease, type CacheSetOptions, type CacheStats, type CacheStore, CircuitBreakerPlugin, CircuitBreakerPluginOptions, ConcurrencyPlugin, ConcurrencyPluginOptions, ConcurrencyState, DownloadPluginOptions, DownloadTransport, type IndexedDBCacheCompactionOptions, type IndexedDBCacheCompactionResult, IndexedDBCacheStore, type IndexedDBCacheStoreEvent, type IndexedDBCacheStoreOptions, type IndexedDBCacheUsage, MemoryCacheStore, type MemoryCacheStoreOptions, OpenTelemetryContextApi, OpenTelemetryCounter, OpenTelemetryHeaderSetter, OpenTelemetryHistogram, OpenTelemetryMeter, OpenTelemetryMetricAttributes, OpenTelemetryMetricsPluginOptions, OpenTelemetryPluginOptions, OpenTelemetryPropagationApi, OpenTelemetrySpan, OpenTelemetryTraceApi, OpenTelemetryTracer, Plugin, PluginCleanup, PluginContext, PluginError, PluginErrorCode, PluginErrorOptions, PluginHookManager, PluginInterceptorManager, RateLimitPlugin, RateLimitPluginOptions, RateLimitState, type TieredCacheBroadcastOptions, type TieredCacheCoordinationOptions, TieredCacheStore, type TieredCacheStoreOptions, WebStorageCacheStore, type WebStorageCacheStoreOptions, authPlugin, cachePlugin, circuitBreakerPlugin, concurrencyPlugin, downloadPlugin, loggerPlugin, openTelemetryMetricsPlugin, openTelemetryPlugin, rateLimitPlugin, retryPlugin, uploadPlugin };
|
package/dist/plugins.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./PluginError-CcuPSIRv.js";import{authPlugin}from"./plugins/auth.js";import{a as t,i as n,n as r,r as i,t as cachePlugin}from"./cachePlugin-
|
|
1
|
+
import{t as e}from"./PluginError-CcuPSIRv.js";import{authPlugin}from"./plugins/auth.js";import{a as t,i as n,n as r,r as i,t as cachePlugin}from"./cachePlugin-BGfwCJRI.js";import{circuitBreakerPlugin}from"./plugins/circuit-breaker.js";import{concurrencyPlugin}from"./plugins/concurrency.js";import{downloadPlugin}from"./plugins/download.js";import{loggerPlugin}from"./plugins/logger.js";import{openTelemetryPlugin}from"./plugins/opentelemetry.js";import{openTelemetryMetricsPlugin}from"./plugins/opentelemetry-metrics.js";import{t as rateLimitPlugin}from"./rateLimitPlugin-hVcAA_ZA.js";import{retryPlugin}from"./plugins/retry.js";import{uploadPlugin}from"./plugins/upload.js";export{i as IndexedDBCacheStore,n as MemoryCacheStore,e as PluginError,r as TieredCacheStore,t as WebStorageCacheStore,authPlugin,cachePlugin,circuitBreakerPlugin,concurrencyPlugin,downloadPlugin,loggerPlugin,openTelemetryMetricsPlugin,openTelemetryPlugin,rateLimitPlugin,retryPlugin,uploadPlugin};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Plugin } from "./Plugin-
|
|
1
|
+
import { h as RequestConfig } from "./response-CXF5lNlw.cjs";
|
|
2
|
+
import { t as Plugin } from "./Plugin-CCFavD-_.cjs";
|
|
3
3
|
//#region src/plugins/rateLimitPlugin.d.ts
|
|
4
4
|
interface RateLimitPluginOptions {
|
|
5
5
|
/** Maximum transport attempts admitted during each rolling interval. */
|