@scirexs/fetchy 0.6.1 → 0.8.1

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/esm/main.js CHANGED
@@ -1 +1 @@
1
- export{v as Fetchy,i as fetchy,h as HTTPStatusError,l as NO_RETRY_ERROR,b as RedirectError,s as sfetchy};const l="$$_NO_RETRY_$$",u={timeout:15,delay:0,interval:3,maxInterval:30,maxAttempts:3,retryAfter:!0,native:!1,redirect:"follow"};class h extends Error{static#t=80;status;body;constructor(t,r,n){super(t),this.name="HTTPStatusError",this.status=r,this.body=n}static async fromResponse(t){const r=await t.text(),n=r.length>this.#t?`${r.slice(0,this.#t)}... (more ${r.length-this.#t} chars)`:r||"(no response body)",a=`${t.status} ${t.statusText}: ${n}`;return new this(a,t.status,r)}}class b extends Error{status;constructor(t,r){super(t),this.name="RedirectError",this.status=r}static fromResponse(t){const r=`${t.status} ${t.statusText}`.trim();return new this(r,t.status)}}class v{url;body;timeout;retry;bearer;delay;native;constructor(t){Object.assign(this,t)}async fetch(t){return await i(t??null,this)}async text(t){return await i(t??null,this,"text")}async json(t){return await i(t??null,this,"json")}async bytes(t){return await i(t??null,this,"bytes")}async blob(t){return await i(t??null,this,"blob")}async buffer(t){return await i(t??null,this,"buffer")}async safe(t){return await s(t??null,this)}async stext(t){return await i(t??null,this,"text")}async sjson(t){return await i(t??null,this,"json")}async sbytes(t){return await i(t??null,this,"bytes")}async sblob(t){return await i(t??null,this,"blob")}async sbuffer(t){return await i(t??null,this,"buffer")}static async fetch(t,r){return await i(t,r)}static async text(t,r){return await i(t,r,"text")}static async json(t,r){return await i(t,r,"json")}static async bytes(t,r){return await i(t,r,"bytes")}static async blob(t,r){return await i(t,r,"blob")}static async buffer(t,r){return await i(t,r,"buffer")}static async safe(t,r){return await s(t,r)}static async stext(t,r){return await s(t,r,"text")}static async sjson(t,r){return await s(t,r,"json")}static async sbytes(t,r){return await s(t,r,"bytes")}static async sblob(t,r){return await s(t,r,"blob")}static async sbuffer(t,r){return await s(t,r,"buffer")}}async function s(e,t,r){try{return await m(e,t,r)}catch{return null}}async function i(e,t,r){try{return await m(e,t,r)}catch(n){throw n}}async function m(e,t,r){e||(e=t?.url??"");const n=N(t),a=await F(e,O(e,n,t),n);if(!a.ok&&!n.native)throw await h.fromResponse(a);return r?S(a,r):a}function j(e){return typeof e=="string"}function w(e){return typeof e=="number"}function d(e){return typeof e=="boolean"}function T(e){return!!(e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype)}function y(e,t,r=!1){return t===void 0||t<0?e:r?Math.trunc(t):t}function f(e,t,r){return d(r)?t:r===void 0||r[e]===void 0?u[e]:w(r[e])?y(u[e],r[e],e==="maxAttempts"):r[e]}function N(e){return{timeout:y(u.timeout,e?.timeout),delay:y(u.delay,e?.delay),interval:f("interval",0,e?.retry),maxInterval:f("maxInterval",0,e?.retry),maxAttempts:f("maxAttempts",0,e?.retry),retryAfter:f("retryAfter",!1,e?.retry),native:e?.native??u.native,redirect:e?.redirect??u.redirect}}function O(e,t,r){const{method:n,body:a,timeout:c,retry:J,bearer:L,native:Y,delay:k,redirect:o,signal:G,...A}=r??{};return{headers:$(r),method:n||(e instanceof Request?e.method:a==null?"GET":"POST"),signal:M(e,t.timeout,r?.signal),...o&&{redirect:o=="error"?"manual":o},...a&&{body:E(a)},...A}}function E(e){return x(e)?JSON.stringify(e):e}function x(e){return!!(e===null||w(e)||d(e)||Array.isArray(e)||T(e))}function $(e){const t=new Headers(e?.headers);if(t.has("Accept")||t.set("Accept","application/json, text/plain"),!t.has("Content-Type")){const r=I(e?.body);r&&t.append("Content-Type",r)}return e?.bearer&&t.set("Authorization",`Bearer ${e.bearer}`),t}function I(e){if(!(e==null||j(e)||e instanceof FormData||e instanceof URLSearchParams)&&!(e instanceof Blob&&e.type))return x(e)?"application/json":"application/octet-stream"}function M(e,t,r){const n=[];return e instanceof Request&&e.signal&&n.push(e.signal),r&&n.push(r),t>0&&n.push(AbortSignal.timeout(t*1e3+1)),n.length?AbortSignal.any(n):void 0}async function S(e,t){switch(t){case"json":return await e.json();case"text":return await e.text();case"bytes":return await e.bytes();case"blob":return await e.blob();case"buffer":return await e.arrayBuffer()}}async function _(e,t=!0){if(e<=0)return;const r=Math.trunc((t?Math.random():1)*e*1e3);await new Promise(n=>setTimeout(n,r))}function B(e){return e.status<400&&e.status>=300}function q(e){return e.status<500&&e.status>=400}async function R(e,t,r,n){if(e>=r.maxAttempts-1||t.signal?.aborted)return!0;if(n){if(n.ok||q(n)||r.native)return!0;if(B(n)){if(r.redirect=="manual")return!0;if(r.redirect=="error")throw r.maxAttempts=0,b.fromResponse(n)}}const a=P(e,r,n);return a>r.maxInterval?!0:(await _(a,!1),!1)}function P(e,t,r){return t.retryAfter&&r?.headers.has("Retry-After")?Math.max(D(r.headers.get("Retry-After")?.trim()??""),t.interval):Math.min(Math.pow(Math.max(1,t.interval),e),t.maxInterval)}function D(e){if(!e)return 1/0;const t=Number.parseInt(e,10);if(!Number.isNaN(t))return t;const r=Math.ceil((new Date(e).getTime()-Date.now())/1e3);return Number.isNaN(r)?1/0:r}function C(e,t,r){return r.redirected?(r.status==303&&(t.method="GET"),e instanceof Request?new Request(r.url,e):r.url):e}function H(e,t){return e instanceof Request&&t?e.clone():e}async function F(e,t,r){for(let n=0;n<r.maxAttempts;n++)try{const a=H(e,n<r.maxAttempts-1),c=await g(a,t,r);if(await R(n,t,r,c))return c;e=C(e,t,c);continue}catch(a){if(a instanceof Error&&a.message==l||await R(n,t,r))throw a;continue}return await g(e,t,r)}async function g(e,t,r){return await _(r.delay),await fetch(e,t)}
1
+ export{N as fetchy,U as fy,w as HTTPStatusError,k as setFetchy,M as sfetchy};const l="GET",m="HEAD",o="POST",F="PUT",_="PATCH",v="DELETE",d="fetch",y="Accept",T="Content-Type",b="application/json",u={a:15,b:0,c:3,d:30,e:3,f:!0,g:!1,h:[500,502,503,504,408,429],i:["retry-after","ratelimit-reset","x-ratelimit-reset"],j:!1},I=[o,_,"CONNECT"],E=["text","json","bytes","blob","arrayBuffer","formData"],L=[d,l,m,o,F,_,v];let g={};class w extends Error{status;response;constructor(e){super(`${e.status} ${e.url}`),this.name="HTTPStatusError",this.status=e.status,this.response=e}}function U(t){const e=S({},t);return D(e),D(e,!0),e}function M(t,e){return O(t,e,!0)}function N(t,e){return O(t,e)}function k(t){g=t}function O(t,e,n=!1){e=h(g,e);const r=G(t,e),i=V(r,t,e);return ct(at(t,r,i,n),n)}function h(t,e,n){return{...t,...e,...n&&{method:n}}}function J(t){return typeof t=="string"}function $(t){return typeof t=="number"}function H(t){return typeof t=="boolean"}function R(t){return t instanceof ReadableStream}function f(t){return t instanceof Request}function q(t){return!!(t&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype)}function S(t,e){return Object.assign(t,e)}function s(t,e){return(e??-1)>=0?e:t}function G(t,e){const{method:n,body:r,timeout:i,retry:c,bearer:a,native:ft,jitter:st,headers:ot,signal:lt,...B}=e??{};return{headers:Y(e,f(t)?t.headers:null),method:n?n.toUpperCase():f(t)?t.method:r==null?l:o,...W(r),...B}}function W(t){return R(t)?null:{body:j(t)?JSON.stringify(t):t}}function j(t){return!!($(t)||H(t)||Array.isArray(t)||q(t))}function Y(t,e){const n=new Headers(t?.headers);if(C(y,n,e)&&n.set(y,`${b}, text/plain`),C(T,n,e)){const r=z(t?.body);r&&n.set(T,r)}return t?.bearer&&n.set("Authorization",`Bearer ${t.bearer}`),n}function C(t,e,n){return!e.has(t)&&!n?.has(t)}function z(t){return j(t)?b:K(t)?"":"application/octet-stream"}function K(t){return t==null||J(t)||t instanceof FormData||t instanceof URLSearchParams||!!(t instanceof Blob&&t.type)}function Q(t,e){return H(e)?{...u,e:1}:{e:Math.max(s(u.e,e?.maxAttempts),1),c:Math.max(s(u.c,e?.interval),.01),d:Math.max(s(u.d,e?.maxInterval),1),f:e?.retryOnTimeout??u.f,g:e?.idempotentOnly?I.includes(t.method??""):!1,h:e?.statusCodes??u.h,i:e?.respectHeaders??u.i}}function V(t,e,n){return{...Q(t,n?.retry),a:s(u.a,n?.timeout),b:s(u.b,n?.jitter),j:n?.native??u.j,k:P(f(e)?e.signal:null,n?.signal),l:n?.url,m:n?.base,n:n?.body}}function P(t,e){if(!(!t&&!e))return t&&e?AbortSignal.any([t,e]):t||(e??void 0)}function X(t){return t.a<=0?t.k:P(AbortSignal.timeout(t.a*1e3),t.k)}async function x(t,e=!1){if(t<=0)return;const n=Math.trunc((e?Math.random():1)*t*1e3);await new Promise(r=>setTimeout(r,n))}function Z(t){return t>=400||t<100}async function A(t,e,n,r){if(e.g||t>=e.e-1||!r)return!1;if(n instanceof Response){if(e.j||!e.h.includes(n.status))return!1;const i=p(t,e,n.headers);return i>e.d?!1:(await x(i),!0)}else return n instanceof Error&&n.name=="TimeoutError"&&e.f}function p(t,e,n){return e.i.some(r=>n.has(r))?tt(e,n)??e.c:Math.min(e.c*2**t,e.d)}function tt(t,e){for(const n of t.i){const r=et(e.get(n)?.trim());if(!Number.isNaN(r))return Math.max(r,t.c)}}function et(t){if(!t)return NaN;const e=Number.parseInt(t,10);return Number.isNaN(e)?Math.ceil((new Date(t).getTime()-Date.now())/1e3):e}function nt(t,e){if(!R(e.n))return t;const n=[l,m].includes(t.method)?o:t.method;return new Request(t,{method:n,body:e.n})}function rt(t,e){return f(e)||(e||(e=t?.l??""),f(e))?e:new Request(URL.parse(e,t?.m)??"")}function it(t){let e;return async n=>{n&&await e?.body?.cancel();const r=e??t;return n||(e=e?e.clone():t.clone()),r}}async function at(t,e,n,r){let i;for(let c=0;c<n.e;c++)try{c===0&&(i=it(nt(rt(n,t),n)));const a=await ut(await i(),e,n);if(await A(c,n,a,i))continue;if(Z(a.status)&&!n.j)throw new w(a);return a}catch(a){if(await A(c,n,a,i))continue;if(r)return null;throw a}finally{await i?.(!0)}throw new Error}async function ut(t,e,n){return await x(n.b,!0),await fetch(t,{...e,signal:X(n)})}function ct(t,e){return S(t,Object.fromEntries([...e?E.map(n=>[n,()=>t.then(r=>r[n]()).catch(()=>null)]):E.map(n=>[n,()=>t.then(r=>r[n]())])]))}function D(t,e){for(const n of L){const r=(e?"s":"")+n.toLowerCase();t[r]=function(i,c){const a=n===d?h(this,c):h(this,c,n);return e?M(i,a):N(i,a)}}}
package/esm/mod.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Exports main functions and types for external.
3
3
  * @module
4
4
  */
5
- export { Fetchy, fetchy, HTTPStatusError, NO_RETRY_ERROR, RedirectError, sfetchy } from "./main.js";
5
+ export { fetchy, fy, HTTPStatusError, setFetchy, sfetchy } from "./main.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scirexs/fetchy",
3
- "version": "0.6.1",
3
+ "version": "0.8.1",
4
4
  "description": "A lightweight fetch wrapper.",
5
5
  "keywords": [
6
6
  "fetch",
package/types/main.d.ts CHANGED
@@ -1,171 +1,79 @@
1
- export { _cloneInput, _combineSignal, _correctNumber, _DEFAULT, _fetchWithJitter, _fetchWithRetry, _getBody, _getContentType, _getHeaders, _getNextInterval, _getOptions, _getRequestInit, _getRetryOption, _handleRedirectResponse, _isBool, _isJSONObject, _isNumber, _isPlainObject, _isString, _main, _parseBody, _parseRetryAfter, _shouldCorrectRequest, _shouldNotRetry, _shouldRedirect, _wait, Fetchy, fetchy, HTTPStatusError, NO_RETRY_ERROR, RedirectError, sfetchy, };
2
- import type { FetchyBody, FetchyOptions, RetryOptions } from "./types.js";
3
- /** Error message to simulate immediate failures without retry for writing tests. */
4
- declare const NO_RETRY_ERROR = "$$_NO_RETRY_$$";
1
+ export { _assign, _buildOption, _cloneRequestF, _correctNumber, _createRequest, _DEFAULT, _fetchWithJitter, _fetchWithRetry, _findRetryHeader, _genMethods, _getBody, _getContentType, _getHeaders, _getNextInterval, _getOptions, _getRequestInit, _getRetryOption, _handleByNative, _includeStream, _isBool, _isHttpError, _isJSONObject, _isNoHeader, _isNumber, _isPlain, _isRequest, _isStream, _isString, _main, _makeFetchyResponse, _mergeSignals, _parseRetryHeader, _shouldRetry, _wait, _withTimeout, fetchy, fy, HTTPStatusError, setFetchy, sfetchy, };
2
+ import type { Fetchy, FetchyBody, FetchyOptions, FetchyResponse, FetchySafeResponse, RetryOptions } from "./types.js";
5
3
  /** Default configuration values for fetchy. */
6
4
  declare const _DEFAULT: Options;
7
- /** Valid input types for fetch requests. */
8
- type Input = string | URL | Request;
9
- type FetchyReturn<T> = Response | string | Uint8Array<ArrayBuffer> | Blob | ArrayBuffer | T;
10
- /** Response body parsing method specification. */
11
- type ParseMethod = "text" | "json" | "bytes" | "blob" | "buffer";
12
5
  /** Internal normalized options used throughout the fetch process. */
13
6
  interface Options {
14
- timeout: number;
15
- delay: number;
16
- interval: number;
17
- maxInterval: number;
18
- maxAttempts: number;
19
- retryAfter: boolean;
20
- native: boolean;
21
- redirect: "follow" | "error" | "manual";
7
+ ztimeout: number;
8
+ zjitter: number;
9
+ zinterval: number;
10
+ zmaxInterval: number;
11
+ zmaxAttempts: number;
12
+ zonTimeout: boolean;
13
+ znoIdempotent: boolean;
14
+ zstatusCodes: number[];
15
+ zrespects: string[];
16
+ znative: boolean;
17
+ zsignal?: AbortSignal;
18
+ zurl?: string | URL | Request;
19
+ zbase?: string | URL;
20
+ zbody?: FetchyBody;
22
21
  }
22
+ /** URL argument type for fetchy functions. */
23
+ type InputArg = string | URL | Request | null;
24
+ /** Internal retry-related options extracted from RetryOptions. */
25
+ type InternalRetry = Pick<Options, "zinterval" | "zmaxInterval" | "zmaxAttempts" | "zonTimeout" | "znoIdempotent" | "zstatusCodes" | "zrespects">;
23
26
  /**
24
- * Error thrown when HTTP response has a non-OK status code (4xx, 5xx, ...).
25
- * Only thrown when throwError.onErrorStatus is set to true.
27
+ * Error thrown when HTTP response has a non-OK status code (4xx, 5xx).
28
+ * Only thrown when `native` option is set to false (default behavior).
26
29
  *
27
30
  * @example
28
31
  * ```ts
29
32
  * try {
30
- * await fetchy("https://api.example.com/data", {
31
- * throwError: { onErrorStatus: true }
32
- * });
33
+ * await fetchy("https://api.example.com/data");
33
34
  * } catch (error) {
34
35
  * if (error instanceof HTTPStatusError) {
35
- * console.error("HTTP error:", error.message); // e.g., "403 Forbidden: {success:false}"
36
+ * console.error(`HTTP ${error.status}:`, error.message);
37
+ * console.error("Response:", error.response);
36
38
  * }
37
39
  * }
38
40
  * ```
39
41
  */
40
42
  declare class HTTPStatusError extends Error {
41
- #private;
42
43
  status: number;
43
- body: string;
44
- constructor(msg: string, status: number, body: string);
45
- static fromResponse(resp: Response): Promise<HTTPStatusError>;
44
+ response: Response;
45
+ constructor(resp: Response);
46
46
  }
47
47
  /**
48
- * Error thrown when a redirect response is received and redirect option is set to "error".
49
- *
50
- * @example
51
- * ```ts
52
- * try {
53
- * await fetchy("https://example.com/redirect", {
54
- * redirect: "error"
55
- * });
56
- * } catch (error) {
57
- * if (error instanceof RedirectError) {
58
- * console.error("Unexpected redirect:", error.message);
59
- * }
60
- * }
61
- * ```
62
- */
63
- declare class RedirectError extends Error {
64
- status: number;
65
- constructor(msg: string, status: number);
66
- static fromResponse(resp: Response): RedirectError;
67
- }
68
- /**
69
- * A fluent HTTP client class that provides both instance and static methods for making HTTP requests.
48
+ * A fluent HTTP client that provides methods for making HTTP requests.
70
49
  * Supports features like timeout, retry with exponential backoff, automatic header management, and response parsing.
71
50
  *
72
- * This class can be used in two ways:
73
- * - Instance methods: Create an instance with default options, then call methods with optional URL override
74
- * - Static methods: Call methods directly with URL and options
51
+ * @param options - Configuration options to apply to all requests made with this instance.
52
+ * @returns An object that has Fetchy interface.
75
53
  *
76
54
  * @example
77
55
  * ```ts
78
- * // Instance usage - reuse configuration
79
- * const client = new Fetchy({
56
+ * import { fy } from "@scirexs/fetchy";
57
+ *
58
+ * const client = fy({
80
59
  * bearer: "token123",
81
60
  * timeout: 10,
82
- * retry: { max: 3 }
61
+ * base: "https://api.example.com"
83
62
  * });
84
- * const user = await client.json<User>("https://api.example.com/user");
85
- * const posts = await client.json<Post[]>("https://api.example.com/posts");
86
63
  *
87
- * // Static usage - one-off requests
88
- * const data = await Fetchy.json("https://api.example.com/data");
89
- * const response = await Fetchy.fetch("https://api.example.com/endpoint", {
90
- * body: { key: "value" },
91
- * timeout: 5
92
- * });
64
+ * const user = await client.get("/user").json<User>();
65
+ * const posts = await client.get("/posts").json<Post[]>();
93
66
  *
94
67
  * // Safe mode - returns null on error instead of throwing
95
- * const result = await Fetchy.sjson("https://api.example.com/data");
68
+ * const result = await client.sfetch("https://api.example.com/data").json<Data>();
96
69
  * if (result !== null) {
97
70
  * // Handle successful response
98
71
  * }
99
72
  * ```
100
73
  */
101
- declare class Fetchy implements FetchyOptions {
102
- /** Request URL. Used if call fetchy with null. */
103
- url?: string | URL;
104
- /** Request body content. Automatically serializes JSON objects. */
105
- body?: FetchyBody;
106
- /** Request timeout in seconds. Default is 15 seconds. */
107
- timeout?: number;
108
- /** Retry configuration. Set to false to disable retry functionality. */
109
- retry?: false | RetryOptions;
110
- /** Bearer token for Authorization header. Automatically adds "Bearer " prefix. */
111
- bearer?: string;
112
- /** Initial jitter delay in seconds before sending the request. Adds randomness to prevent thundering herd. */
113
- delay?: number;
114
- /** If receive response, does not throw error same with native fetch. */
115
- native?: true;
116
- constructor(options?: FetchyOptions);
117
- /** Call fetchy with instance options. */
118
- fetch(url?: Input | null): Promise<Response>;
119
- /** Call fetchy with instance options and parsing as text. */
120
- text(url?: Input | null): Promise<string>;
121
- /** Call fetchy with instance options and parsing as json. */
122
- json<T>(url?: Input | null): Promise<T>;
123
- /** Call fetchy with instance options and parsing as Uint8Array. */
124
- bytes(url?: Input | null): Promise<Uint8Array<ArrayBuffer>>;
125
- /** Call fetchy with instance options and parsing as Blob. */
126
- blob(url?: Input | null): Promise<Blob>;
127
- /** Call fetchy with instance options and parsing as ArrayBuffer. */
128
- buffer(url?: Input | null): Promise<ArrayBuffer>;
129
- /** Call sfetchy with instance options. */
130
- safe(url?: Input | null): Promise<Response | null>;
131
- /** Call sfetchy with instance options and parsing as text. */
132
- stext(url?: Input | null): Promise<string | null>;
133
- /** Call sfetchy with instance options and parsing as json. */
134
- sjson<T>(url?: Input | null): Promise<T | null>;
135
- /** Call sfetchy with instance options and parsing as Uint8Array. */
136
- sbytes(url?: Input | null): Promise<Uint8Array<ArrayBuffer> | null>;
137
- /** Call sfetchy with instance options and parsing as Blob. */
138
- sblob(url?: Input | null): Promise<Blob | null>;
139
- /** Call sfetchy with instance options and parsing as ArrayBuffer. */
140
- sbuffer(url?: Input | null): Promise<ArrayBuffer | null>;
141
- /** Call fetchy. */
142
- static fetch(url: Input | null, options?: FetchyOptions): Promise<Response>;
143
- /** Call fetchy with parsing as text. */
144
- static text(url: Input | null, options?: FetchyOptions): Promise<string>;
145
- /** Call fetchy with parsing as json. */
146
- static json<T>(url: Input | null, options?: FetchyOptions): Promise<T>;
147
- /** Call fetchy with parsing as Uint8Array. */
148
- static bytes(url: Input | null, options?: FetchyOptions): Promise<Uint8Array<ArrayBuffer>>;
149
- /** Call fetchy with parsing as Blob. */
150
- static blob(url: Input | null, options?: FetchyOptions): Promise<Blob>;
151
- /** Call fetchy with parsing as ArrayBuffer. */
152
- static buffer(url: Input | null, options?: FetchyOptions): Promise<ArrayBuffer>;
153
- /** Call sfetchy. */
154
- static safe(url: Input | null, options?: FetchyOptions): Promise<Response | null>;
155
- /** Call sfetchy with parsing as text. */
156
- static stext(url: Input | null, options?: FetchyOptions): Promise<string | null>;
157
- /** Call sfetchy with parsing as json. */
158
- static sjson<T>(url: Input | null, options?: FetchyOptions): Promise<T | null>;
159
- /** Call sfetchy with parsing as Uint8Array. */
160
- static sbytes(url: Input | null, options?: FetchyOptions): Promise<Uint8Array<ArrayBuffer> | null>;
161
- /** Call sfetchy with parsing as Blob. */
162
- static sblob(url: Input | null, options?: FetchyOptions): Promise<Blob | null>;
163
- /** Call sfetchy with parsing as ArrayBuffer. */
164
- static sbuffer(url: Input | null, options?: FetchyOptions): Promise<ArrayBuffer | null>;
165
- }
74
+ declare function fy(options?: FetchyOptions): Fetchy;
166
75
  /**
167
76
  * Performs an HTTP request with safe error handling that returns null on failure.
168
- * Automatically parses the response body based on the specified parse method.
169
77
  * Unlike `fetchy`, this function never throws errors - it returns null for any failure.
170
78
  *
171
79
  * This is useful when you want to handle errors gracefully without try-catch blocks,
@@ -173,59 +81,46 @@ declare class Fetchy implements FetchyOptions {
173
81
  *
174
82
  * @param url - The URL to fetch. Can be a string, URL object, Request object, or null (uses options.url).
175
83
  * @param options - Configuration options for the request (timeout, retry, headers, etc.).
176
- * @param parse - Optional response body parsing method. If omitted, returns Response object.
177
- * Supported values: "json", "text", "bytes", "blob", "buffer".
178
- * @returns Parsed response body, Response object, or null if request fails or response is not OK.
84
+ * @returns Promise that resolves to Response object or null if request fails.
179
85
  *
180
86
  * @example
181
87
  * ```ts
182
88
  * import { sfetchy } from "@scirexs/fetchy";
183
89
  *
184
90
  * // Returns null instead of throwing on error
185
- * const data = await sfetchy("https://api.example.com/user", {}, "json");
186
- * if (data === null) {
91
+ * const response = await sfetchy("https://api.example.com/user");
92
+ * if (response === null) {
187
93
  * console.log("Request failed, using default data");
188
94
  * // Handle failure case
95
+ * } else {
96
+ * const data = await response.json();
189
97
  * }
190
98
  *
191
- * // Explicit type assertion with JSON parsing
192
- * interface User { id: number; name: string; }
193
- * const user = await sfetchy<User>("https://api.example.com/user", {}, "json");
99
+ * // Using convenience methods
100
+ * const user = await sfetchy("https://api.example.com/user").json<User>();
101
+ * if (user !== null) {
102
+ * // Handle successful response
103
+ * }
194
104
  *
195
105
  * // Text response - returns null on any error
196
- * const text = await sfetchy("https://example.com/page", {}, "text");
106
+ * const text = await sfetchy("https://example.com/page").text();
197
107
  *
198
108
  * // Binary data with safe error handling
199
- * const bytes = await sfetchy("https://example.com/image.png", {}, "bytes");
109
+ * const bytes = await sfetchy("https://example.com/image.png").bytes();
200
110
  * if (bytes !== null) {
201
111
  * // Process binary data
202
112
  * }
203
- *
204
- * // Raw Response object (no parsing)
205
- * const response = await sfetchy("https://api.example.com/data");
206
- * if (response !== null && response.ok) {
207
- * // Handle response
208
- * }
209
113
  * ```
210
114
  */
211
- declare function sfetchy(url: Input | null, options?: FetchyOptions, parse?: undefined): Promise<Response | null>;
212
- declare function sfetchy<T>(url: Input | null, options: FetchyOptions | undefined, parse: "json"): Promise<T | null>;
213
- declare function sfetchy(url: Input | null, options: FetchyOptions | undefined, parse: "text"): Promise<string | null>;
214
- declare function sfetchy(url: Input | null, options: FetchyOptions | undefined, parse: "bytes"): Promise<Uint8Array<ArrayBuffer> | null>;
215
- declare function sfetchy(url: Input | null, options: FetchyOptions | undefined, parse: "blob"): Promise<Blob | null>;
216
- declare function sfetchy(url: Input | null, options: FetchyOptions | undefined, parse: "buffer"): Promise<ArrayBuffer | null>;
115
+ declare function sfetchy(url?: string | URL | Request | null, options?: FetchyOptions): FetchySafeResponse;
217
116
  /**
218
117
  * Performs an HTTP request with enhanced features like timeout, retry, and automatic header management.
219
118
  * Throws errors on failure unless configured otherwise via the `native` option.
220
- * Automatically parses the response body based on the specified parse method.
221
119
  *
222
120
  * @param url - The URL to fetch. Can be a string, URL object, Request object, or null (uses options.url).
223
121
  * @param options - Configuration options for the request (timeout, retry, headers, body, etc.).
224
- * @param parse - Optional response body parsing method. If omitted, returns Response object.
225
- * Supported values: "json", "text", "bytes", "blob", "buffer".
226
- * @returns Parsed response body or Response object.
227
- * @throws {HTTPStatusError} When response status is not OK (4xx, 5xx) - default behavior.
228
- * @throws {RedirectError} When redirect is encountered and redirect option is set to "error".
122
+ * @returns Promise that resolves to Response object.
123
+ * @throws {HTTPStatusError} When response status is not OK (4xx, 5xx) and native mode is disabled.
229
124
  * @throws {TypeError} When network error occurs (e.g., DNS resolution failure, connection refused).
230
125
  * @throws {DOMException} When request is aborted via timeout or AbortSignal.
231
126
  *
@@ -233,95 +128,127 @@ declare function sfetchy(url: Input | null, options: FetchyOptions | undefined,
233
128
  * ```ts
234
129
  * import { fetchy } from "@scirexs/fetchy";
235
130
  *
236
- * // Simple GET request returning Response object
131
+ * // Simple GET request
237
132
  * const response = await fetchy("https://api.example.com/data");
238
- * if (response.ok) {
239
- * const data = await response.json();
240
- * }
133
+ * const data = await response.json();
241
134
  *
242
- * // Direct JSON parsing with type assertion
243
- * interface User { id: number; name: string; }
244
- * const user = await fetchy<User>("https://api.example.com/user", {}, "json");
135
+ * // Using convenience methods
136
+ * const user = await fetchy("https://api.example.com/user").json<User>();
245
137
  *
246
138
  * // POST request with JSON body and authentication
247
139
  * const result = await fetchy("https://api.example.com/create", {
140
+ * method: MPOST,
248
141
  * body: { name: "John", age: 30 },
249
142
  * bearer: "your-token-here"
250
- * }, "json");
143
+ * }).json();
251
144
  *
252
145
  * // With retry, timeout, and error handling
253
146
  * try {
254
147
  * const data = await fetchy("https://api.example.com/data", {
255
148
  * timeout: 10,
256
- * retry: { max: 5, interval: 2, maxInterval: 30 }
257
- * }, "json");
149
+ * retry: { maxAttempts: 5, interval: 2, maxInterval: 30 }
150
+ * }).json();
258
151
  * } catch (error) {
259
152
  * if (error instanceof HTTPStatusError) {
260
- * console.error(`HTTP ${error.status}: ${error.body}`);
153
+ * console.error(`HTTP ${error.status}:`, error.message);
261
154
  * }
262
155
  * }
263
156
  *
264
- * // Native error mode - throws native fetch errors without HTTPStatusError
157
+ * // Native error mode - does not throw HTTPStatusError
265
158
  * const response = await fetchy("https://api.example.com/data", {
266
159
  * native: true
267
160
  * });
268
161
  * ```
269
162
  */
270
- declare function fetchy(url: Input | null, options?: FetchyOptions, parse?: undefined): Promise<Response>;
271
- declare function fetchy<T>(url: Input | null, options: FetchyOptions | undefined, parse: "json"): Promise<T>;
272
- declare function fetchy(url: Input | null, options: FetchyOptions | undefined, parse: "text"): Promise<string>;
273
- declare function fetchy(url: Input | null, options: FetchyOptions | undefined, parse: "bytes"): Promise<Uint8Array<ArrayBuffer>>;
274
- declare function fetchy(url: Input | null, options: FetchyOptions | undefined, parse: "blob"): Promise<Blob>;
275
- declare function fetchy(url: Input | null, options: FetchyOptions | undefined, parse: "buffer"): Promise<ArrayBuffer>;
276
- /** Main procedure of fetchy and sfetchy. */
277
- declare function _main<T>(url: Input | null, options?: FetchyOptions, parse?: ParseMethod): Promise<FetchyReturn<T>>;
278
- /** Checks if a value is a string. */
163
+ declare function fetchy(url?: string | URL | Request | null, options?: FetchyOptions): FetchyResponse;
164
+ /**
165
+ * Sets global default options for all fetchy instances.
166
+ * These options will be merged with instance-specific options, with instance options taking precedence.
167
+ *
168
+ * @param options - Default configuration options to apply globally.
169
+ *
170
+ * @example
171
+ * ```ts
172
+ * import { setFetchy, fetchy } from "@scirexs/fetchy";
173
+ *
174
+ * // Set global defaults
175
+ * setFetchy({
176
+ * timeout: 30,
177
+ * retry: { maxAttempts: 5 },
178
+ * bearer: "global-token"
179
+ * });
180
+ *
181
+ * // All subsequent requests use these defaults
182
+ * await fetchy("https://api.example.com/data");
183
+ * ```
184
+ */
185
+ declare function setFetchy(options: FetchyOptions): void;
186
+ /** Main procedure for fetchy and sfetchy. @internal */
187
+ declare function _main(url: InputArg | undefined, options: FetchyOptions | undefined, safe?: undefined): FetchyResponse;
188
+ declare function _main(url: InputArg | undefined, options: FetchyOptions | undefined, safe: true): FetchySafeResponse;
189
+ /** Creates new options object with specified HTTP method and temporal options. @internal */
190
+ declare function _buildOption(options?: FetchyOptions, temp?: FetchyOptions, method?: string): FetchyOptions;
191
+ /** Type guard: checks if value is a string. @internal */
279
192
  declare function _isString(v: unknown): v is string;
280
- /** Checks if a value is a number. */
193
+ /** Type guard: checks if value is a number. @internal */
281
194
  declare function _isNumber(v: unknown): v is number;
282
- /** Checks if a value is a boolean. */
195
+ /** Type guard: checks if value is a boolean. @internal */
283
196
  declare function _isBool(v: unknown): v is boolean;
284
- /** Checks if a value is a plain object (not array, null, or other object types). */
285
- declare function _isPlainObject(v: unknown): v is object;
286
- /** Corrects a number to be non-negative, using default if invalid. */
287
- declare function _correctNumber(dflt: number, num?: number, integer?: boolean): number;
288
- /** Gets retry option value from configuration with fallback to default. */
289
- declare function _getRetryOption(prop: keyof RetryOptions, off: number, options?: RetryOptions | false): number;
290
- declare function _getRetryOption(prop: keyof RetryOptions, off: boolean, options?: RetryOptions | false): boolean;
291
- /** Converts FetchyOptions to internal Options format with validated values. */
292
- declare function _getOptions(options?: FetchyOptions): Options;
293
- /** Converts FetchyOptions to standard RequestInit format. */
294
- declare function _getRequestInit(url: Input, opts: Options, options?: FetchyOptions): RequestInit;
295
- /** Converts FetchyBody to standard BodyInit format. */
296
- declare function _getBody(body: FetchyBody): BodyInit | undefined;
297
- /** Checks if a value should be treated as JSON object for serialization. */
197
+ /** Type guard: checks if value is a ReadableStream. @internal */
198
+ declare function _isStream(v: unknown): v is ReadableStream;
199
+ /** Type guard: checks if value is a Request. @internal */
200
+ declare function _isRequest(v: unknown): v is Request;
201
+ /** Type guard: checks if value is a plain object (not array, null, or other object types). @internal */
202
+ declare function _isPlain(v: unknown): v is object;
203
+ /** Corrects a number to be non-negative, using default if invalid. @internal */
204
+ declare function _assign<T extends {}>(target: T, source: unknown): T;
205
+ /** Corrects a number to be non-negative, using default if invalid. @internal */
206
+ declare function _correctNumber(dflt: number, num?: number): number;
207
+ /** Converts FetchyOptions to standard RequestInit format. @internal */
208
+ declare function _getRequestInit(url?: InputArg, options?: FetchyOptions): RequestInit;
209
+ /** Converts FetchyBody to standard BodyInit format. @internal */
210
+ declare function _getBody(body?: FetchyBody): Record<string, BodyInit> | null;
211
+ /** Checks if value should be treated as JSON for serialization. @internal */
298
212
  declare function _isJSONObject(arg?: FetchyBody): boolean;
299
- /** Constructs request headers with automatic Content-Type and Authorization. */
300
- declare function _getHeaders(options?: FetchyOptions): Headers;
301
- /** Determines Content-Type header based on body type. */
302
- declare function _getContentType(body?: FetchyBody): string | undefined;
303
- /** Combine abort signals. */
304
- declare function _combineSignal(url: Input, timeout: number, signal?: AbortSignal | null): AbortSignal | undefined;
305
- /** Parse response body. */
306
- declare function _parseBody<T>(resp: Response, method: ParseMethod): Promise<Exclude<FetchyReturn<T>, Response>>;
307
- /** Waits for specified seconds with optional randomization. */
213
+ /** Constructs request headers with automatic Content-Type and Authorization. @internal */
214
+ declare function _getHeaders(options?: FetchyOptions, reqHeaders?: Headers | null): Headers;
215
+ /** Checks if header is absent in both option headers and request headers. @internal */
216
+ declare function _isNoHeader(name: string, optionHeader: Headers, reqHeaders?: Headers | null): boolean;
217
+ /** Determines Content-Type header based on body type. @internal */
218
+ declare function _getContentType(body?: FetchyBody): string;
219
+ /** Checks if Content-Type should be handled by native fetch. @internal */
220
+ declare function _handleByNative(body?: FetchyBody): boolean;
221
+ /** Extracts retry-related options with defaults. @internal */
222
+ declare function _getRetryOption(init: RequestInit, options?: RetryOptions | false): InternalRetry;
223
+ /** Converts FetchyOptions to internal Options format with validated values. @internal */
224
+ declare function _getOptions(init: RequestInit, url?: InputArg, options?: FetchyOptions): Options;
225
+ /** Merges multiple AbortSignals into one. @internal */
226
+ declare function _mergeSignals(s1?: AbortSignal | null, s2?: AbortSignal | null): AbortSignal | undefined;
227
+ /** Creates timeout signal and merges with existing signal. @internal */
228
+ declare function _withTimeout(opts: Options): AbortSignal | undefined;
229
+ /** Waits for specified seconds with optional randomization. @internal */
308
230
  declare function _wait(sec: number, random?: boolean): Promise<void>;
309
- /** Checks if response is a redirect (3xx status). */
310
- declare function _shouldRedirect(resp: Response): boolean;
311
- /** Checks if response is a client error (4xx status). */
312
- declare function _shouldCorrectRequest(resp: Response): boolean;
313
- /** Determines if retry should stop based on conditions and waits if continuing. */
314
- declare function _shouldNotRetry(count: number, init: RequestInit, opts: Options, resp?: Response): Promise<boolean>;
315
- /** Calculates next retry interval using exponential backoff or Retry-After header. */
316
- declare function _getNextInterval(count: number, opts: Options, resp?: Response): number;
317
- /** Parses Retry-After header value to seconds. */
318
- declare function _parseRetryAfter(value: string): number;
319
- /** Updates URL and method for redirect responses. */
320
- declare function _handleRedirectResponse(url: Input, init: RequestInit, resp: Response): Input;
321
- /** Clone input if required. */
322
- declare function _cloneInput(url: Input, required: boolean): Input;
323
- /** Executes fetch with retry logic and exponential backoff. */
324
- declare function _fetchWithRetry(url: Input, init: RequestInit, opts: Options): Promise<Response>;
325
- /** Executes fetch with initial jitter delay. */
326
- declare function _fetchWithJitter(url: Input, init: RequestInit, opts: Options): Promise<Response>;
231
+ /** Checks if HTTP status code indicates an error. @internal */
232
+ declare function _isHttpError(stat: number): boolean;
233
+ /** Determines whether to retry based on conditions and waits before next attempt. @internal */
234
+ declare function _shouldRetry(count: number, opts: Options, r: Response | unknown, fn?: unknown): Promise<boolean>;
235
+ /** Calculates next retry interval using exponential backoff or response headers. @internal */
236
+ declare function _getNextInterval(count: number, opts: Options, headers: Headers): number;
237
+ /** Finds and parses retry timing from response headers. @internal */
238
+ declare function _findRetryHeader(opts: Options, headers: Headers): number | undefined;
239
+ /** Parses retry header value to seconds. @internal */
240
+ declare function _parseRetryHeader(value?: string | null): number;
241
+ /** Creates new Request with ReadableStream body if present in options. @internal */
242
+ declare function _includeStream(req: Request, opts: Options): Request;
243
+ /** Creates Request object from various input types. @internal */
244
+ declare function _createRequest(opts: Options, url?: InputArg): Request;
245
+ /** Creates request cloning function with abort handling. @internal */
246
+ declare function _cloneRequestF(req: Request): (cancel?: boolean) => Promise<Request>;
247
+ /** Executes fetch with retry logic and exponential backoff. @internal */
248
+ declare function _fetchWithRetry(url: InputArg | undefined, init: RequestInit, opts: Options, safe: boolean): Promise<Response | null>;
249
+ /** Executes fetch with initial jitter delay. @internal */
250
+ declare function _fetchWithJitter(req: Request, init: RequestInit, opts: Options): Promise<Response>;
251
+ /** Creates promise-like object with convenience parsing methods. @internal */
252
+ declare function _makeFetchyResponse(resp: Promise<Response | null>, safe: boolean): FetchyResponse | FetchySafeResponse;
253
+ declare function _genMethods(obj: object, safe?: boolean): void;
327
254
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,cAA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,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAkBnI;AACD,0DAA0D;AAC1D,iBAAe,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAGjG;AACD,8EAA8E;AAC9E,iBAAS,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,kBAAkB,CAa/G;AACD,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,QAS/C"}
package/types/mod.d.ts CHANGED
@@ -2,6 +2,6 @@
2
2
  * Exports main functions and types for external.
3
3
  * @module
4
4
  */
5
- export { Fetchy, fetchy, HTTPStatusError, NO_RETRY_ERROR, RedirectError, sfetchy } from "./main.js";
6
- export type { FetchyBody, FetchyOptions, JSONValue, RetryOptions } from "./types.js";
5
+ export { fetchy, fy, HTTPStatusError, setFetchy, sfetchy } from "./main.js";
6
+ export type { FetchyBody, FetchyOptions, FetchyResponse, FetchySafeResponse, JSONValue, RetryOptions } from "./types.js";
7
7
  //# sourceMappingURL=mod.d.ts.map