@ahoo-wang/fetcher 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,29 +1,29 @@
1
- function F(r) {
1
+ function C(r) {
2
2
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(r);
3
3
  }
4
- function C(r, e) {
5
- return F(e) ? e : e ? r.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : r;
4
+ function U(r, t) {
5
+ return C(t) ? t : t ? r.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : r;
6
6
  }
7
- var U = /* @__PURE__ */ ((r) => (r[r.UriTemplate = 0] = "UriTemplate", r[r.Express = 1] = "Express", r))(U || {});
7
+ var v = /* @__PURE__ */ ((r) => (r[r.UriTemplate = 0] = "UriTemplate", r[r.Express = 1] = "Express", r))(v || {});
8
8
  function D(r) {
9
- return r === 1 ? v : L;
9
+ return r === 1 ? M : L;
10
10
  }
11
- function q(r, e, t) {
12
- return t ? r.replace(e, (s, o) => {
13
- const n = t[o];
11
+ function w(r, t, e) {
12
+ return e ? r.replace(t, (s, o) => {
13
+ const n = e[o];
14
14
  if (n === void 0)
15
15
  throw new Error(`Missing required path parameter: ${o}`);
16
16
  return encodeURIComponent(n);
17
17
  }) : r;
18
18
  }
19
- function w(r, e) {
20
- const t = [];
19
+ function N(r, t) {
20
+ const e = [];
21
21
  let s;
22
- for (; (s = e.exec(r)) !== null; )
23
- t.push(s[1]);
24
- return t;
22
+ for (; (s = t.exec(r)) !== null; )
23
+ e.push(s[1]);
24
+ return e;
25
25
  }
26
- const h = class h {
26
+ const a = class a {
27
27
  /**
28
28
  * Extracts path parameters from a URL string.
29
29
  *
@@ -47,10 +47,10 @@ const h = class h {
47
47
  * // noParams = []
48
48
  * ```
49
49
  */
50
- extractPathParams(e) {
51
- return w(
52
- e,
53
- h.PATH_PARAM_REGEX
50
+ extractPathParams(t) {
51
+ return N(
52
+ t,
53
+ a.PATH_PARAM_REGEX
54
54
  );
55
55
  }
56
56
  /**
@@ -89,17 +89,17 @@ const h = class h {
89
89
  * }
90
90
  * ```
91
91
  */
92
- resolve(e, t) {
93
- return q(
94
- e,
95
- h.PATH_PARAM_REGEX,
96
- t
92
+ resolve(t, e) {
93
+ return w(
94
+ t,
95
+ a.PATH_PARAM_REGEX,
96
+ e
97
97
  );
98
98
  }
99
99
  };
100
- h.PATH_PARAM_REGEX = /{([^}]+)}/g;
101
- let P = h;
102
- const L = new P(), l = class l {
100
+ a.PATH_PARAM_REGEX = /{([^}]+)}/g;
101
+ let f = a;
102
+ const L = new f(), h = class h {
103
103
  /**
104
104
  * Extracts path parameters from an Express-style URL string.
105
105
  *
@@ -119,10 +119,10 @@ const L = new P(), l = class l {
119
119
  * // noParams = []
120
120
  * ```
121
121
  */
122
- extractPathParams(e) {
123
- return w(
124
- e,
125
- l.PATH_PARAM_REGEX
122
+ extractPathParams(t) {
123
+ return N(
124
+ t,
125
+ h.PATH_PARAM_REGEX
126
126
  );
127
127
  }
128
128
  /**
@@ -157,18 +157,18 @@ const L = new P(), l = class l {
157
157
  * }
158
158
  * ```
159
159
  */
160
- resolve(e, t) {
161
- return q(
162
- e,
163
- l.PATH_PARAM_REGEX,
164
- t
160
+ resolve(t, e) {
161
+ return w(
162
+ t,
163
+ h.PATH_PARAM_REGEX,
164
+ e
165
165
  );
166
166
  }
167
167
  };
168
- l.PATH_PARAM_REGEX = /:([^/]+)/g;
169
- let A = l;
170
- const v = new A();
171
- class x {
168
+ h.PATH_PARAM_REGEX = /:([^/]+)/g;
169
+ let P = h;
170
+ const M = new P();
171
+ class G {
172
172
  /**
173
173
  * Initializes a new UrlBuilder instance.
174
174
  *
@@ -186,8 +186,8 @@ class x {
186
186
  * const expressUrlBuilder = new UrlBuilder('https://api.example.com', UrlTemplateStyle.Express);
187
187
  * ```
188
188
  */
189
- constructor(e, t) {
190
- this.baseURL = e, this.urlTemplateResolver = D(t);
189
+ constructor(t, e) {
190
+ this.baseURL = t, this.urlTemplateResolver = D(e);
191
191
  }
192
192
  /**
193
193
  * Builds a complete URL, including path parameter replacement and query parameter addition.
@@ -207,14 +207,14 @@ class x {
207
207
  * // Result: https://api.example.com/users/123/posts/456?filter=active&limit=10
208
208
  * ```
209
209
  */
210
- build(e, t) {
211
- const s = t?.path, o = t?.query, n = C(this.baseURL, e);
212
- let u = this.urlTemplateResolver.resolve(n, s);
210
+ build(t, e) {
211
+ const s = e?.path, o = e?.query, n = U(this.baseURL, t);
212
+ let i = this.urlTemplateResolver.resolve(n, s);
213
213
  if (o) {
214
- const a = new URLSearchParams(o).toString();
215
- a && (u += "?" + a);
214
+ const u = new URLSearchParams(o).toString();
215
+ u && (i += "?" + u);
216
216
  }
217
- return u;
217
+ return i;
218
218
  }
219
219
  /**
220
220
  * Resolves a complete URL from a FetchRequest.
@@ -225,82 +225,82 @@ class x {
225
225
  * @param request - The FetchRequest containing URL and URL parameters
226
226
  * @returns Complete resolved URL string
227
227
  */
228
- resolveRequestUrl(e) {
229
- return this.build(e.url, e.urlParams);
228
+ resolveRequestUrl(t) {
229
+ return this.build(t.url, t.urlParams);
230
230
  }
231
231
  }
232
- class E extends Error {
232
+ class l extends Error {
233
233
  /**
234
234
  * Creates a new FetcherError instance.
235
235
  *
236
236
  * @param errorMsg - Optional error message. If not provided, will use the cause's message or a default message.
237
237
  * @param cause - Optional underlying error that caused this error.
238
238
  */
239
- constructor(e, t) {
240
- const s = e || t?.message || "An error occurred in the fetcher";
241
- super(s), this.cause = t, this.name = "FetcherError", t?.stack && (this.stack = t.stack), Object.setPrototypeOf(this, E.prototype);
239
+ constructor(t, e) {
240
+ const s = t || e?.message || "An error occurred in the fetcher";
241
+ super(s), this.cause = e, this.name = "FetcherError", e?.stack && (this.stack = e.stack), Object.setPrototypeOf(this, l.prototype);
242
242
  }
243
243
  }
244
- class I extends E {
244
+ class b extends l {
245
245
  /**
246
246
  * Creates a new FetchTimeoutError instance.
247
247
  *
248
248
  * @param request - The request options that timed out
249
249
  */
250
- constructor(e) {
251
- const t = e.method || "GET", s = `Request timeout of ${e.timeout}ms exceeded for ${t} ${e.url}`;
252
- super(s), this.name = "FetchTimeoutError", this.request = e, Object.setPrototypeOf(this, I.prototype);
250
+ constructor(t) {
251
+ const e = t.method || "GET", s = `Request timeout of ${t.timeout}ms exceeded for ${e} ${t.url}`;
252
+ super(s), this.name = "FetchTimeoutError", this.request = t, Object.setPrototypeOf(this, b.prototype);
253
253
  }
254
254
  }
255
- function G(r, e) {
256
- return typeof r < "u" ? r : e;
255
+ function H(r, t) {
256
+ return typeof r < "u" ? r : t;
257
257
  }
258
- async function M(r) {
259
- const e = r.url, t = r.timeout, s = r;
258
+ async function j(r) {
259
+ const t = r.url, e = r.timeout, s = r;
260
260
  if (r.signal)
261
- return fetch(e, s);
262
- if (!t)
263
- return r.abortController && (s.signal = r.abortController.signal), fetch(e, s);
261
+ return fetch(t, s);
262
+ if (!e)
263
+ return r.abortController && (s.signal = r.abortController.signal), fetch(t, s);
264
264
  const o = r.abortController ?? new AbortController();
265
265
  s.signal = o.signal;
266
266
  let n = null;
267
- const u = new Promise((a, m) => {
267
+ const i = new Promise((u, p) => {
268
268
  n = setTimeout(() => {
269
269
  n && clearTimeout(n);
270
- const _ = new I(r);
271
- o.abort(_), m(_);
272
- }, t);
270
+ const I = new b(r);
271
+ o.abort(I), p(I);
272
+ }, e);
273
273
  });
274
274
  try {
275
- return await Promise.race([fetch(e, s), u]);
275
+ return await Promise.race([fetch(t, s), i]);
276
276
  } finally {
277
277
  n && clearTimeout(n);
278
278
  }
279
279
  }
280
- const H = "UrlResolveInterceptor", N = Number.MIN_SAFE_INTEGER + 1e3;
281
- class j {
280
+ const B = "UrlResolveInterceptor", S = Number.MIN_SAFE_INTEGER + 1e3;
281
+ class $ {
282
282
  constructor() {
283
- this.name = H, this.order = N;
283
+ this.name = B, this.order = S;
284
284
  }
285
285
  /**
286
286
  * Resolves the final URL by combining the base URL, path parameters, and query parameters.
287
287
  *
288
288
  * @param exchange - The fetch exchange containing the request information
289
289
  */
290
- intercept(e) {
291
- const t = e.request;
292
- t.url = e.fetcher.urlBuilder.resolveRequestUrl(t);
290
+ intercept(t) {
291
+ const e = t.request;
292
+ e.url = t.fetcher.urlBuilder.resolveRequestUrl(e);
293
293
  }
294
294
  }
295
295
  var c = /* @__PURE__ */ ((r) => (r.GET = "GET", r.POST = "POST", r.PUT = "PUT", r.DELETE = "DELETE", r.PATCH = "PATCH", r.HEAD = "HEAD", r.OPTIONS = "OPTIONS", r))(c || {});
296
- const ce = "Content-Type", R = class R {
296
+ const Et = "Content-Type", d = class d {
297
297
  };
298
- R.APPLICATION_JSON = "application/json", R.TEXT_EVENT_STREAM = "text/event-stream";
299
- let d = R;
300
- const B = "RequestBodyInterceptor", $ = N + 1e3;
301
- class X {
298
+ d.APPLICATION_JSON = "application/json", d.TEXT_EVENT_STREAM = "text/event-stream";
299
+ let E = d;
300
+ const X = "RequestBodyInterceptor", V = S + 1e3;
301
+ class k {
302
302
  constructor() {
303
- this.name = B, this.order = $;
303
+ this.name = X, this.order = V;
304
304
  }
305
305
  /**
306
306
  * Attempts to convert request body to a valid fetch API body type.
@@ -339,20 +339,20 @@ class X {
339
339
  * // exchange.request.body will be '{"name":"John","age":30}'
340
340
  * // exchange.request.headers will include 'Content-Type: application/json'
341
341
  */
342
- intercept(e) {
343
- const t = e.request;
344
- if (t.body === void 0 || t.body === null || typeof t.body != "object" || t.body instanceof ArrayBuffer || ArrayBuffer.isView(t.body) || // Includes TypedArray and DataView
345
- t.body instanceof Blob || t.body instanceof File || t.body instanceof URLSearchParams || t.body instanceof FormData || t.body instanceof ReadableStream)
342
+ intercept(t) {
343
+ const e = t.request;
344
+ if (e.body === void 0 || e.body === null || typeof e.body != "object" || e.body instanceof ArrayBuffer || ArrayBuffer.isView(e.body) || // Includes TypedArray and DataView
345
+ e.body instanceof Blob || e.body instanceof File || e.body instanceof URLSearchParams || e.body instanceof FormData || e.body instanceof ReadableStream)
346
346
  return;
347
- e.request.body = JSON.stringify(t.body);
348
- const s = e.ensureRequestHeaders();
349
- s["Content-Type"] || (s["Content-Type"] = d.APPLICATION_JSON);
347
+ t.request.body = JSON.stringify(e.body);
348
+ const s = t.ensureRequestHeaders();
349
+ s["Content-Type"] || (s["Content-Type"] = E.APPLICATION_JSON);
350
350
  }
351
351
  }
352
- const V = "FetchInterceptor", J = Number.MAX_SAFE_INTEGER - 1e3;
353
- class k {
352
+ const J = "FetchInterceptor", Q = Number.MAX_SAFE_INTEGER - 1e3;
353
+ class Y {
354
354
  constructor() {
355
- this.name = V, this.order = J;
355
+ this.name = J, this.order = Q;
356
356
  }
357
357
  /**
358
358
  * Intercept and process HTTP requests.
@@ -379,14 +379,14 @@ class k {
379
379
  * await fetchInterceptor.intercept(exchange);
380
380
  * console.log(exchange.response); // HTTP response object
381
381
  */
382
- async intercept(e) {
383
- e.response = await M(e.request);
382
+ async intercept(t) {
383
+ t.response = await j(t.request);
384
384
  }
385
385
  }
386
- function T(r, e) {
387
- return e ? r.filter(e).sort((t, s) => t.order - s.order) : [...r].sort((t, s) => t.order - s.order);
386
+ function T(r, t) {
387
+ return t ? r.filter(t).sort((e, s) => e.order - s.order) : [...r].sort((e, s) => e.order - s.order);
388
388
  }
389
- class f {
389
+ class m {
390
390
  /**
391
391
  * Initializes a new InterceptorRegistry instance.
392
392
  *
@@ -396,8 +396,8 @@ class f {
396
396
  * The provided interceptors will be sorted by their order property immediately
397
397
  * upon construction.
398
398
  */
399
- constructor(e = []) {
400
- this.sortedInterceptors = [], this.sortedInterceptors = T(e);
399
+ constructor(t = []) {
400
+ this.sortedInterceptors = [], this.sortedInterceptors = T(t);
401
401
  }
402
402
  /**
403
403
  * Gets the name of this interceptor registry.
@@ -434,10 +434,10 @@ class f {
434
434
  *
435
435
  * After adding, interceptors are automatically sorted by their order property.
436
436
  */
437
- use(e) {
438
- return this.sortedInterceptors.some((t) => t.name === e.name) ? !1 : (this.sortedInterceptors = T([
437
+ use(t) {
438
+ return this.sortedInterceptors.some((e) => e.name === t.name) ? !1 : (this.sortedInterceptors = T([
439
439
  ...this.sortedInterceptors,
440
- e
440
+ t
441
441
  ]), !0);
442
442
  }
443
443
  /**
@@ -447,12 +447,12 @@ class f {
447
447
  * @returns True if an interceptor was removed, false if no interceptor with the
448
448
  * given name was found
449
449
  */
450
- eject(e) {
451
- const t = this.sortedInterceptors;
450
+ eject(t) {
451
+ const e = this.sortedInterceptors;
452
452
  return this.sortedInterceptors = T(
453
- t,
454
- (s) => s.name !== e
455
- ), t.length !== this.sortedInterceptors.length;
453
+ e,
454
+ (s) => s.name !== t
455
+ ), e.length !== this.sortedInterceptors.length;
456
456
  }
457
457
  /**
458
458
  * Removes all interceptors from this registry.
@@ -474,27 +474,27 @@ class f {
474
474
  * If any interceptor throws an error, the execution chain is broken and the error
475
475
  * is propagated to the caller.
476
476
  */
477
- async intercept(e) {
478
- for (const t of this.sortedInterceptors)
479
- await t.intercept(e);
477
+ async intercept(t) {
478
+ for (const e of this.sortedInterceptors)
479
+ await e.intercept(t);
480
480
  }
481
481
  }
482
- class O extends E {
483
- constructor(e) {
482
+ class _ extends l {
483
+ constructor(t) {
484
484
  super(
485
- `Request failed with status code ${e.response?.status} for ${e.request.url}`
486
- ), this.exchange = e, this.name = "HttpStatusValidationError", Object.setPrototypeOf(this, O.prototype);
485
+ `Request failed with status code ${t.response?.status} for ${t.request.url}`
486
+ ), this.exchange = t, this.name = "HttpStatusValidationError", Object.setPrototypeOf(this, _.prototype);
487
487
  }
488
488
  }
489
- const Y = (r) => r >= 200 && r < 300, z = "ValidateStatusInterceptor", Q = Number.MAX_SAFE_INTEGER - 1e3;
490
- class K {
489
+ const z = (r) => r >= 200 && r < 300, K = "ValidateStatusInterceptor", W = Number.MAX_SAFE_INTEGER - 1e3;
490
+ class Z {
491
491
  /**
492
492
  * Creates a new ValidateStatusInterceptor instance.
493
493
  *
494
494
  * @param validateStatus - Function that determines if a status code is valid
495
495
  */
496
- constructor(e = Y) {
497
- this.validateStatus = e;
496
+ constructor(t = z) {
497
+ this.validateStatus = t;
498
498
  }
499
499
  /**
500
500
  * Gets the name of this interceptor.
@@ -502,7 +502,7 @@ class K {
502
502
  * @returns The name of this interceptor
503
503
  */
504
504
  get name() {
505
- return z;
505
+ return K;
506
506
  }
507
507
  /**
508
508
  * Gets the order of this interceptor.
@@ -510,7 +510,7 @@ class K {
510
510
  * @returns VALIDATE_STATUS_INTERCEPTOR_ORDER, indicating this interceptor should execute early
511
511
  */
512
512
  get order() {
513
- return Q;
513
+ return W;
514
514
  }
515
515
  /**
516
516
  * Validates the response status code.
@@ -525,35 +525,35 @@ class K {
525
525
  * preventing other response handlers from attempting to process them. Valid responses
526
526
  * proceed through the rest of the response interceptor chain normally.
527
527
  */
528
- intercept(e) {
529
- if (!e.response)
528
+ intercept(t) {
529
+ if (!t.response)
530
530
  return;
531
- const t = e.response.status;
532
- if (!this.validateStatus(t))
533
- throw new O(e);
531
+ const e = t.response.status;
532
+ if (!this.validateStatus(e))
533
+ throw new _(t);
534
534
  }
535
535
  }
536
- class p extends E {
536
+ class R extends l {
537
537
  /**
538
538
  * Creates a new ExchangeError instance.
539
539
  *
540
540
  * @param exchange - The FetchExchange object containing request/response/error information.
541
541
  * @param errorMsg - An optional error message.
542
542
  */
543
- constructor(e, t) {
544
- const s = t || e.error?.message || e.response?.statusText || `Request to ${e.request.url} failed during exchange`;
545
- super(s, e.error), this.exchange = e, this.name = "ExchangeError", Object.setPrototypeOf(this, p.prototype);
543
+ constructor(t, e) {
544
+ const s = e || t.error?.message || t.response?.statusText || `Request to ${t.request.url} failed during exchange`;
545
+ super(s, t.error), this.exchange = t, this.name = "ExchangeError", Object.setPrototypeOf(this, R.prototype);
546
546
  }
547
547
  }
548
- class W {
548
+ class tt {
549
549
  constructor() {
550
- this.request = new f([
551
- new j(),
552
- new X(),
553
- new k()
554
- ]), this.response = new f([
555
- new K()
556
- ]), this.error = new f();
550
+ this.request = new m([
551
+ new $(),
552
+ new k(),
553
+ new Y()
554
+ ]), this.response = new m([
555
+ new Z()
556
+ ]), this.error = new m();
557
557
  }
558
558
  /**
559
559
  * Processes a FetchExchange through the interceptor pipeline.
@@ -641,25 +641,41 @@ class W {
641
641
  * const result = await fetcher.exchange(exchange);
642
642
  * ```
643
643
  */
644
- async exchange(e) {
644
+ async exchange(t) {
645
645
  try {
646
- return await this.request.intercept(e), await this.response.intercept(e), e;
647
- } catch (t) {
648
- if (e.error = t, await this.error.intercept(e), !e.hasError())
649
- return e;
650
- throw new p(e);
646
+ return await this.request.intercept(t), await this.response.intercept(t), t;
647
+ } catch (e) {
648
+ if (t.error = e, await this.error.intercept(t), !t.hasError())
649
+ return t;
650
+ throw new R(t);
651
651
  }
652
652
  }
653
653
  }
654
- const Z = (r) => r, ee = (r) => r.requiredResponse, te = (r) => r.requiredResponse.json(), re = (r) => r.requiredResponse.text(), i = {
655
- Exchange: Z,
656
- Response: ee,
657
- Json: te,
658
- Text: re
654
+ const et = (r) => r, rt = (r) => r.requiredResponse, st = (r) => r.requiredResponse.json(), ot = (r) => r.requiredResponse.text(), O = {
655
+ Exchange: et,
656
+ Response: rt,
657
+ Json: st,
658
+ Text: ot
659
659
  };
660
- class se {
661
- constructor(e) {
662
- this.fetcher = e.fetcher, this.request = e.request, this.resultExtractor = e.resultExtractor ?? i.Exchange, this.attributes = e.attributes ?? {}, this.response = e.response, this.error = e.error;
660
+ function g(r, t) {
661
+ if (!(r === void 0 && t === void 0))
662
+ return t === void 0 ? r : r === void 0 ? t : { ...r, ...t };
663
+ }
664
+ function nt(r, t) {
665
+ if (t ??= /* @__PURE__ */ new Map(), !r)
666
+ return t;
667
+ if (r instanceof Map) {
668
+ for (const [e, s] of r)
669
+ t.set(e, s);
670
+ return t;
671
+ }
672
+ for (const [e, s] of Object.entries(r))
673
+ t.set(e, s);
674
+ return t;
675
+ }
676
+ class it {
677
+ constructor(t) {
678
+ this.fetcher = t.fetcher, this.request = t.request, this.resultExtractor = t.resultExtractor ?? O.Exchange, this.attributes = nt(t.attributes), this._response = t.response, this.error = t.error;
663
679
  }
664
680
  /**
665
681
  * Ensures that request headers object exists, creating it if necessary.
@@ -698,6 +714,24 @@ class se {
698
714
  hasError() {
699
715
  return !!this.error;
700
716
  }
717
+ /**
718
+ * Sets the response object for this exchange.
719
+ * Also invalidates the cached extracted result to ensure data consistency
720
+ * when the response changes.
721
+ *
722
+ * @param response - The Response object to set, or undefined to clear the response
723
+ */
724
+ set response(t) {
725
+ this._response = t, this.cachedExtractedResult = void 0;
726
+ }
727
+ /**
728
+ * Gets the response object for this exchange.
729
+ *
730
+ * @returns The response object if available, undefined otherwise
731
+ */
732
+ get response() {
733
+ return this._response;
734
+ }
701
735
  /**
702
736
  * Checks if the exchange has a response.
703
737
  *
@@ -718,29 +752,61 @@ class se {
718
752
  */
719
753
  get requiredResponse() {
720
754
  if (!this.response)
721
- throw new p(
755
+ throw new R(
722
756
  this,
723
757
  `Request to ${this.request.url} failed with no response`
724
758
  );
725
759
  return this.response;
726
760
  }
727
761
  /**
728
- * Gets the extracted result by applying the result extractor to the exchange.
729
- * The result is cached after the first computation.
762
+ * Extracts the result by applying the result extractor to the exchange.
763
+ * The result is cached after the first computation to avoid repeated computations.
730
764
  *
731
- * @returns The extracted result or null if extraction failed
765
+ * @returns The extracted result
732
766
  */
733
- typedExtractedResult() {
767
+ extractResult() {
734
768
  return this.cachedExtractedResult !== void 0 ? this.cachedExtractedResult : (this.cachedExtractedResult = this.resultExtractor(this), this.cachedExtractedResult);
735
769
  }
736
770
  }
737
- const y = {
738
- "Content-Type": d.APPLICATION_JSON
739
- }, S = {
771
+ function dt(r, t) {
772
+ if (Object.keys(r).length === 0)
773
+ return t;
774
+ if (Object.keys(t).length === 0)
775
+ return r;
776
+ const e = {
777
+ path: g(r.urlParams?.path, t.urlParams?.path),
778
+ query: g(r.urlParams?.query, t.urlParams?.query)
779
+ }, s = {
780
+ ...r.headers,
781
+ ...t.headers
782
+ }, o = t.method ?? r.method, n = t.body ?? r.body, i = t.timeout ?? r.timeout, u = t.signal ?? r.signal, p = t.abortController ?? r.abortController;
783
+ return {
784
+ ...r,
785
+ ...t,
786
+ method: o,
787
+ urlParams: e,
788
+ headers: s,
789
+ body: n,
790
+ timeout: i,
791
+ signal: u,
792
+ abortController: p
793
+ };
794
+ }
795
+ function q(r, t) {
796
+ return t && t.resultExtractor && t.attributes ? t : {
797
+ resultExtractor: t?.resultExtractor ?? r?.resultExtractor ?? x.resultExtractor,
798
+ attributes: t?.attributes ?? r?.attributes
799
+ };
800
+ }
801
+ const A = {
802
+ "Content-Type": E.APPLICATION_JSON
803
+ }, F = {
740
804
  baseURL: "",
741
- headers: y
805
+ headers: A
806
+ }, x = { resultExtractor: O.Exchange }, ut = {
807
+ resultExtractor: O.Response
742
808
  };
743
- class oe {
809
+ class ct {
744
810
  /**
745
811
  * Initializes a new Fetcher instance with optional configuration.
746
812
  *
@@ -748,9 +814,14 @@ class oe {
748
814
  * If no interceptors are provided, a default set of interceptors will be used.
749
815
  *
750
816
  * @param options - Configuration options for the Fetcher instance
817
+ * @param options.baseURL - The base URL to prepend to all requests. Defaults to empty string.
818
+ * @param options.headers - Default headers to include in all requests. Defaults to JSON content type.
819
+ * @param options.timeout - Default timeout for requests in milliseconds. No timeout by default.
820
+ * @param options.urlTemplateStyle - Style for URL template parameter interpolation.
821
+ * @param options.interceptors - Interceptor manager for processing requests and responses.
751
822
  */
752
- constructor(e = S) {
753
- this.headers = y, this.urlBuilder = new x(e.baseURL, e.urlTemplateStyle), this.headers = e.headers ?? y, this.timeout = e.timeout, this.interceptors = e.interceptors ?? new W();
823
+ constructor(t = F) {
824
+ this.headers = A, this.urlBuilder = new G(t.baseURL, t.urlTemplateStyle), this.headers = t.headers ?? A, this.timeout = t.timeout, this.interceptors = t.interceptors ?? new tt();
754
825
  }
755
826
  /**
756
827
  * Processes an HTTP request through the Fetcher's internal workflow.
@@ -759,51 +830,57 @@ class oe {
759
830
  * creates a FetchExchange object, and passes it through the exchange method
760
831
  * for interceptor processing.
761
832
  *
833
+ * @template R - The type of the result to be returned
762
834
  * @param request - Complete request configuration object
763
- * @param resultExtractor - Function to extract the desired result from the exchange.
764
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
765
- * @param attributes - Optional shared attributes that can be accessed by interceptors
766
- * throughout the request lifecycle. These attributes allow passing
767
- * custom data between different interceptors.
835
+ * @param options - Request options including result extractor and attributes
836
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
837
+ * Defaults to ExchangeResultExtractor which returns the entire exchange object.
838
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
839
+ * throughout the request lifecycle. These attributes allow passing
840
+ * custom data between different interceptors.
768
841
  * @returns Promise that resolves to the extracted result based on resultExtractor
769
842
  * @throws Error if an unhandled error occurs during request processing
770
843
  */
771
- async request(e, t = i.Exchange, s) {
772
- const o = {
844
+ async request(t, e) {
845
+ const s = {
773
846
  ...this.headers,
774
- ...e.headers
775
- }, n = {
776
- ...e,
777
- headers: o,
778
- timeout: G(e.timeout, this.timeout)
779
- }, u = new se({
847
+ ...t.headers
848
+ }, o = {
849
+ ...t,
850
+ headers: s,
851
+ timeout: H(t.timeout, this.timeout)
852
+ }, {
853
+ resultExtractor: n,
854
+ attributes: i
855
+ } = q(x, e), u = new it({
780
856
  fetcher: this,
781
- request: n,
782
- resultExtractor: t,
783
- attributes: s
857
+ request: o,
858
+ resultExtractor: n,
859
+ attributes: i
784
860
  });
785
- return await this.interceptors.exchange(u), u.typedExtractedResult();
861
+ return await this.interceptors.exchange(u), u.extractResult();
786
862
  }
787
863
  /**
788
- * Executes an HTTP request with the specified URL and options.
789
- *
790
- * This is the primary method for making HTTP requests. It processes the request
791
- * through the interceptor chain and returns the resulting Response.
792
- *
793
- * @param url - The URL path for the request (relative to baseURL if set)
794
- * @param request - Request configuration including headers, body, parameters, etc.
795
- * @param resultExtractor - Function to extract the desired result from the exchange.
796
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
797
- * @param attributes - Optional shared attributes that can be accessed by interceptors
798
- * throughout the request lifecycle. These attributes allow passing
799
- * custom data between different interceptors.
800
-
801
- * @returns Promise that resolves to the HTTP response
802
- * @throws FetchError if the request fails and no response is generated
803
- */
804
- async fetch(e, t = {}, s = i.Response, o) {
805
- const n = t;
806
- return n.url = e, this.request(n, s, o);
864
+ * Executes an HTTP request with the specified URL and options.
865
+ *
866
+ * This is the primary method for making HTTP requests. It processes the request
867
+ * through the interceptor chain and returns the resulting Response.
868
+ *
869
+ * @template R - The type of the result to be returned
870
+ * @param url - The URL path for the request (relative to baseURL if set)
871
+ * @param request - Request configuration including headers, body, parameters, etc.
872
+ * @param options - Request options including result extractor and attributes
873
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
874
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
875
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
876
+ * throughout the request lifecycle. These attributes allow passing
877
+ * custom data between different interceptors.
878
+ * @returns Promise that resolves to the HTTP response
879
+ * @throws FetchError if the request fails and no response is generated
880
+ */
881
+ async fetch(t, e = {}, s) {
882
+ const o = e;
883
+ return o.url = t, this.request(o, q(ut, s));
807
884
  }
808
885
  /**
809
886
  * Internal helper method for making HTTP requests with a specific method.
@@ -811,25 +888,26 @@ class oe {
811
888
  * This private method is used by the public HTTP method methods (get, post, etc.)
812
889
  * to execute requests with the appropriate HTTP verb.
813
890
  *
891
+ * @template R - The type of the result to be returned
814
892
  * @param method - The HTTP method to use for the request
815
893
  * @param url - The URL path for the request
816
894
  * @param request - Additional request options
817
- * @param resultExtractor - Function to extract the desired result from the exchange.
818
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
819
- * @param attributes - Optional shared attributes that can be accessed by interceptors
820
- * throughout the request lifecycle. These attributes allow passing
821
- * custom data between different interceptors.
895
+ * @param options - Request options including result extractor and attributes
896
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
897
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
898
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
899
+ * throughout the request lifecycle. These attributes allow passing
900
+ * custom data between different interceptors.
822
901
  * @returns Promise that resolves to the HTTP response
823
902
  */
824
- async methodFetch(e, t, s = {}, o = i.Response, n) {
903
+ async methodFetch(t, e, s = {}, o) {
825
904
  return this.fetch(
826
- t,
905
+ e,
827
906
  {
828
907
  ...s,
829
- method: e
908
+ method: t
830
909
  },
831
- o,
832
- n
910
+ o
833
911
  );
834
912
  }
835
913
  /**
@@ -838,85 +916,95 @@ class oe {
838
916
  * Convenience method for making GET requests. The request body is omitted
839
917
  * as GET requests should not contain a body according to HTTP specification.
840
918
  *
919
+ * @template R - The type of the result to be returned
841
920
  * @param url - The URL path for the request
842
921
  * @param request - Request options excluding method and body
843
- * @param resultExtractor - Function to extract the desired result from the exchange.
844
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
845
- * @param attributes - Optional shared attributes that can be accessed by interceptors
846
- * throughout the request lifecycle. These attributes allow passing
847
- * custom data between different interceptors.
922
+ * @param options - Request options including result extractor and attributes
923
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
924
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
925
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
926
+ * throughout the request lifecycle. These attributes allow passing
927
+ * custom data between different interceptors.
848
928
  * @returns Promise that resolves to the HTTP response
849
929
  */
850
- async get(e, t = {}, s = i.Response, o) {
851
- return this.methodFetch(c.GET, e, t, s, o);
930
+ async get(t, e = {}, s) {
931
+ return this.methodFetch(c.GET, t, e, s);
852
932
  }
853
933
  /**
854
- * Makes a POST HTTP request.
934
+ * Makes a PUT HTTP request.
855
935
  *
856
- * Convenience method for making POST requests, commonly used for creating resources.
936
+ * Convenience method for making PUT requests, commonly used for updating resources.
857
937
  *
938
+ * @template R - The type of the result to be returned
858
939
  * @param url - The URL path for the request
859
940
  * @param request - Request options including body and other parameters
860
- * @param resultExtractor - Function to extract the desired result from the exchange.
861
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
862
- * @param attributes - Optional shared attributes that can be accessed by interceptors
863
- * throughout the request lifecycle. These attributes allow passing
864
- * custom data between different interceptors.
941
+ * @param options - Request options including result extractor and attributes
942
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
943
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
944
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
945
+ * throughout the request lifecycle. These attributes allow passing
946
+ * custom data between different interceptors.
865
947
  * @returns Promise that resolves to the HTTP response
866
948
  */
867
- async post(e, t = {}, s = i.Response, o) {
868
- return this.methodFetch(c.POST, e, t, s, o);
949
+ async put(t, e = {}, s) {
950
+ return this.methodFetch(c.PUT, t, e, s);
869
951
  }
870
952
  /**
871
- * Makes a PUT HTTP request.
953
+ * Makes a POST HTTP request.
872
954
  *
873
- * Convenience method for making PUT requests, commonly used for updating resources.
955
+ * Convenience method for making POST requests, commonly used for creating resources.
874
956
  *
957
+ * @template R - The type of the result to be returned
875
958
  * @param url - The URL path for the request
876
959
  * @param request - Request options including body and other parameters
877
- * @param resultExtractor - Function to extract the desired result from the exchange.
878
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
879
- * @param attributes - Optional shared attributes that can be accessed by interceptors
880
- * throughout the request lifecycle. These attributes allow passing
881
- * custom data between different interceptors.
960
+ * @param options - Request options including result extractor and attributes
961
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
962
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
963
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
964
+ * throughout the request lifecycle. These attributes allow passing
965
+ * custom data between different interceptors.
882
966
  * @returns Promise that resolves to the HTTP response
883
967
  */
884
- async put(e, t = {}, s = i.Response, o) {
885
- return this.methodFetch(c.PUT, e, t, s, o);
968
+ async post(t, e = {}, s) {
969
+ return this.methodFetch(c.POST, t, e, s);
886
970
  }
887
971
  /**
888
- * Makes a DELETE HTTP request.
972
+ * Makes a PATCH HTTP request.
889
973
  *
890
- * Convenience method for making DELETE requests, commonly used for deleting resources.
974
+ * Convenience method for making PATCH requests, commonly used for partial updates.
891
975
  *
976
+ * @template R - The type of the result to be returned
892
977
  * @param url - The URL path for the request
893
- * @param request - Request options excluding method and body
894
- * @param resultExtractor - Function to extract the desired result from the exchange.
895
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
896
- * @param attributes - Optional shared attributes that can be accessed by interceptors
897
- * throughout the request lifecycle. These attributes allow passing
898
- * custom data between different interceptors.
978
+ * @param request - Request options including body and other parameters
979
+ * @param options - Request options including result extractor and attributes
980
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
981
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
982
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
983
+ * throughout the request lifecycle. These attributes allow passing
984
+ * custom data between different interceptors.
899
985
  * @returns Promise that resolves to the HTTP response
900
986
  */
901
- async delete(e, t = {}, s = i.Response, o) {
902
- return this.methodFetch(c.DELETE, e, t, s, o);
987
+ async patch(t, e = {}, s) {
988
+ return this.methodFetch(c.PATCH, t, e, s);
903
989
  }
904
990
  /**
905
- * Makes a PATCH HTTP request.
991
+ * Makes a DELETE HTTP request.
906
992
  *
907
- * Convenience method for making PATCH requests, commonly used for partial updates.
993
+ * Convenience method for making DELETE requests, commonly used for deleting resources.
908
994
  *
995
+ * @template R - The type of the result to be returned
909
996
  * @param url - The URL path for the request
910
- * @param request - Request options including body and other parameters
911
- * @param resultExtractor - Function to extract the desired result from the exchange.
912
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
913
- * @param attributes - Optional shared attributes that can be accessed by interceptors
914
- * throughout the request lifecycle. These attributes allow passing
915
- * custom data between different interceptors.
997
+ * @param request - Request options excluding method and body
998
+ * @param options - Request options including result extractor and attributes
999
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
1000
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
1001
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
1002
+ * throughout the request lifecycle. These attributes allow passing
1003
+ * custom data between different interceptors.
916
1004
  * @returns Promise that resolves to the HTTP response
917
1005
  */
918
- async patch(e, t = {}, s = i.Response, o) {
919
- return this.methodFetch(c.PATCH, e, t, s, o);
1006
+ async delete(t, e = {}, s) {
1007
+ return this.methodFetch(c.DELETE, t, e, s);
920
1008
  }
921
1009
  /**
922
1010
  * Makes a HEAD HTTP request.
@@ -924,17 +1012,19 @@ class oe {
924
1012
  * Convenience method for making HEAD requests, which retrieve headers only.
925
1013
  * The request body is omitted as HEAD requests should not contain a body.
926
1014
  *
1015
+ * @template R - The type of the result to be returned
927
1016
  * @param url - The URL path for the request
928
1017
  * @param request - Request options excluding method and body
929
- * @param resultExtractor - Function to extract the desired result from the exchange.
930
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
931
- * @param attributes - Optional shared attributes that can be accessed by interceptors
932
- * throughout the request lifecycle. These attributes allow passing
933
- * custom data between different interceptors.
1018
+ * @param options - Request options including result extractor and attributes
1019
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
1020
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
1021
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
1022
+ * throughout the request lifecycle. These attributes allow passing
1023
+ * custom data between different interceptors.
934
1024
  * @returns Promise that resolves to the HTTP response
935
1025
  */
936
- async head(e, t = {}, s = i.Response, o) {
937
- return this.methodFetch(c.HEAD, e, t, s, o);
1026
+ async head(t, e = {}, s) {
1027
+ return this.methodFetch(c.HEAD, t, e, s);
938
1028
  }
939
1029
  /**
940
1030
  * Makes an OPTIONS HTTP request.
@@ -942,21 +1032,23 @@ class oe {
942
1032
  * Convenience method for making OPTIONS requests, commonly used for CORS preflight.
943
1033
  * The request body is omitted as OPTIONS requests typically don't contain a body.
944
1034
  *
1035
+ * @template R - The type of the result to be returned
945
1036
  * @param url - The URL path for the request
946
1037
  * @param request - Request options excluding method and body
947
- * @param resultExtractor - Function to extract the desired result from the exchange.
948
- * Defaults to ExchangeResultExtractor which returns the entire exchange object.
949
- * @param attributes - Optional shared attributes that can be accessed by interceptors
950
- * throughout the request lifecycle. These attributes allow passing
951
- * custom data between different interceptors.
1038
+ * @param options - Request options including result extractor and attributes
1039
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
1040
+ * Defaults to ResponseResultExtractor which returns the entire exchange object.
1041
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
1042
+ * throughout the request lifecycle. These attributes allow passing
1043
+ * custom data between different interceptors.
952
1044
  * @returns Promise that resolves to the HTTP response
953
1045
  */
954
- async options(e, t = {}, s = i.Response, o) {
955
- return this.methodFetch(c.OPTIONS, e, t, s, o);
1046
+ async options(t, e = {}, s) {
1047
+ return this.methodFetch(c.OPTIONS, t, e, s);
956
1048
  }
957
1049
  }
958
- const b = "default";
959
- class ne {
1050
+ const y = "default";
1051
+ class at {
960
1052
  constructor() {
961
1053
  this.registrar = /* @__PURE__ */ new Map();
962
1054
  }
@@ -969,8 +1061,8 @@ class ne {
969
1061
  * const fetcher = new Fetcher({ baseURL: 'https://api.example.com' });
970
1062
  * fetcherRegistrar.register('api', fetcher);
971
1063
  */
972
- register(e, t) {
973
- this.registrar.set(e, t);
1064
+ register(t, e) {
1065
+ this.registrar.set(t, e);
974
1066
  }
975
1067
  /**
976
1068
  * Unregister a Fetcher instance by name
@@ -983,8 +1075,8 @@ class ne {
983
1075
  * console.log('Fetcher unregistered successfully');
984
1076
  * }
985
1077
  */
986
- unregister(e) {
987
- return this.registrar.delete(e);
1078
+ unregister(t) {
1079
+ return this.registrar.delete(t);
988
1080
  }
989
1081
  /**
990
1082
  * Get a Fetcher instance by name
@@ -997,8 +1089,8 @@ class ne {
997
1089
  * // Use the fetcher
998
1090
  * }
999
1091
  */
1000
- get(e) {
1001
- return this.registrar.get(e);
1092
+ get(t) {
1093
+ return this.registrar.get(t);
1002
1094
  }
1003
1095
  /**
1004
1096
  * Get a Fetcher instance by name, throwing an error if not found
@@ -1014,11 +1106,11 @@ class ne {
1014
1106
  * console.error('Fetcher not found:', error.message);
1015
1107
  * }
1016
1108
  */
1017
- requiredGet(e) {
1018
- const t = this.get(e);
1019
- if (!t)
1020
- throw new Error(`Fetcher ${e} not found`);
1021
- return t;
1109
+ requiredGet(t) {
1110
+ const e = this.get(t);
1111
+ if (!e)
1112
+ throw new Error(`Fetcher ${t} not found`);
1113
+ return e;
1022
1114
  }
1023
1115
  /**
1024
1116
  * Get the default Fetcher instance
@@ -1029,7 +1121,7 @@ class ne {
1029
1121
  * const defaultFetcher = fetcherRegistrar.default;
1030
1122
  */
1031
1123
  get default() {
1032
- return this.requiredGet(b);
1124
+ return this.requiredGet(y);
1033
1125
  }
1034
1126
  /**
1035
1127
  * Set the default Fetcher instance
@@ -1039,8 +1131,8 @@ class ne {
1039
1131
  * const fetcher = new Fetcher({ baseURL: 'https://api.example.com' });
1040
1132
  * fetcherRegistrar.default = fetcher;
1041
1133
  */
1042
- set default(e) {
1043
- this.register(b, e);
1134
+ set default(t) {
1135
+ this.register(y, t);
1044
1136
  }
1045
1137
  /**
1046
1138
  * Get a copy of all registered fetchers
@@ -1056,36 +1148,8 @@ class ne {
1056
1148
  return new Map(this.registrar);
1057
1149
  }
1058
1150
  }
1059
- const ie = new ne();
1060
- function g(r, e) {
1061
- if (!(r === void 0 && e === void 0))
1062
- return e === void 0 ? r : r === void 0 ? e : { ...r, ...e };
1063
- }
1064
- function ae(r, e) {
1065
- if (Object.keys(r).length === 0)
1066
- return e;
1067
- if (Object.keys(e).length === 0)
1068
- return r;
1069
- const t = {
1070
- path: g(r.urlParams?.path, e.urlParams?.path),
1071
- query: g(r.urlParams?.query, e.urlParams?.query)
1072
- }, s = {
1073
- ...r.headers,
1074
- ...e.headers
1075
- }, o = e.method ?? r.method, n = e.body ?? r.body, u = e.timeout ?? r.timeout, a = e.signal ?? r.signal, m = e.abortController ?? r.abortController;
1076
- return {
1077
- ...r,
1078
- ...e,
1079
- method: o,
1080
- urlParams: t,
1081
- headers: s,
1082
- body: n,
1083
- timeout: u,
1084
- signal: a,
1085
- abortController: m
1086
- };
1087
- }
1088
- class ue extends oe {
1151
+ const ht = new at();
1152
+ class lt extends ct {
1089
1153
  /**
1090
1154
  * Create a NamedFetcher instance and automatically register it with the global fetcherRegistrar
1091
1155
  *
@@ -1103,61 +1167,65 @@ class ue extends oe {
1103
1167
  * headers: { 'Authorization': 'Bearer token' }
1104
1168
  * });
1105
1169
  */
1106
- constructor(e, t = S) {
1107
- super(t), this.name = e, ie.register(e, this);
1170
+ constructor(t, e = F) {
1171
+ super(e), this.name = t, ht.register(t, this);
1108
1172
  }
1109
1173
  }
1110
- const he = new ue(b);
1174
+ const Rt = new lt(y);
1111
1175
  export {
1112
- ce as CONTENT_TYPE_HEADER,
1113
- d as ContentTypeValues,
1114
- b as DEFAULT_FETCHER_NAME,
1115
- S as DEFAULT_OPTIONS,
1116
- p as ExchangeError,
1117
- Z as ExchangeResultExtractor,
1118
- A as ExpressUrlTemplateResolver,
1119
- V as FETCH_INTERCEPTOR_NAME,
1120
- J as FETCH_INTERCEPTOR_ORDER,
1121
- se as FetchExchange,
1122
- k as FetchInterceptor,
1123
- I as FetchTimeoutError,
1124
- oe as Fetcher,
1125
- E as FetcherError,
1126
- ne as FetcherRegistrar,
1176
+ Et as CONTENT_TYPE_HEADER,
1177
+ E as ContentTypeValues,
1178
+ y as DEFAULT_FETCHER_NAME,
1179
+ ut as DEFAULT_FETCH_OPTIONS,
1180
+ F as DEFAULT_OPTIONS,
1181
+ x as DEFAULT_REQUEST_OPTIONS,
1182
+ R as ExchangeError,
1183
+ et as ExchangeResultExtractor,
1184
+ P as ExpressUrlTemplateResolver,
1185
+ J as FETCH_INTERCEPTOR_NAME,
1186
+ Q as FETCH_INTERCEPTOR_ORDER,
1187
+ it as FetchExchange,
1188
+ Y as FetchInterceptor,
1189
+ b as FetchTimeoutError,
1190
+ ct as Fetcher,
1191
+ l as FetcherError,
1192
+ at as FetcherRegistrar,
1127
1193
  c as HttpMethod,
1128
- O as HttpStatusValidationError,
1129
- W as InterceptorManager,
1130
- f as InterceptorRegistry,
1131
- te as JsonResultExtractor,
1132
- ue as NamedFetcher,
1133
- B as REQUEST_BODY_INTERCEPTOR_NAME,
1134
- $ as REQUEST_BODY_INTERCEPTOR_ORDER,
1135
- X as RequestBodyInterceptor,
1136
- ee as ResponseResultExtractor,
1137
- i as ResultExtractors,
1138
- re as TextResultExtractor,
1139
- H as URL_RESOLVE_INTERCEPTOR_NAME,
1140
- N as URL_RESOLVE_INTERCEPTOR_ORDER,
1141
- P as UriTemplateResolver,
1142
- x as UrlBuilder,
1143
- j as UrlResolveInterceptor,
1144
- U as UrlTemplateStyle,
1145
- z as VALIDATE_STATUS_INTERCEPTOR_NAME,
1146
- Q as VALIDATE_STATUS_INTERCEPTOR_ORDER,
1147
- K as ValidateStatusInterceptor,
1148
- C as combineURLs,
1149
- v as expressUrlTemplateResolver,
1150
- he as fetcher,
1151
- ie as fetcherRegistrar,
1194
+ _ as HttpStatusValidationError,
1195
+ tt as InterceptorManager,
1196
+ m as InterceptorRegistry,
1197
+ st as JsonResultExtractor,
1198
+ lt as NamedFetcher,
1199
+ X as REQUEST_BODY_INTERCEPTOR_NAME,
1200
+ V as REQUEST_BODY_INTERCEPTOR_ORDER,
1201
+ k as RequestBodyInterceptor,
1202
+ rt as ResponseResultExtractor,
1203
+ O as ResultExtractors,
1204
+ ot as TextResultExtractor,
1205
+ B as URL_RESOLVE_INTERCEPTOR_NAME,
1206
+ S as URL_RESOLVE_INTERCEPTOR_ORDER,
1207
+ f as UriTemplateResolver,
1208
+ G as UrlBuilder,
1209
+ $ as UrlResolveInterceptor,
1210
+ v as UrlTemplateStyle,
1211
+ K as VALIDATE_STATUS_INTERCEPTOR_NAME,
1212
+ W as VALIDATE_STATUS_INTERCEPTOR_ORDER,
1213
+ Z as ValidateStatusInterceptor,
1214
+ U as combineURLs,
1215
+ M as expressUrlTemplateResolver,
1216
+ Rt as fetcher,
1217
+ ht as fetcherRegistrar,
1152
1218
  D as getUrlTemplateResolver,
1153
- F as isAbsoluteURL,
1219
+ C as isAbsoluteURL,
1220
+ nt as mergeRecordToMap,
1154
1221
  g as mergeRecords,
1155
- ae as mergeRequest,
1156
- G as resolveTimeout,
1157
- M as timeoutFetch,
1222
+ dt as mergeRequest,
1223
+ q as mergeRequestOptions,
1224
+ H as resolveTimeout,
1225
+ j as timeoutFetch,
1158
1226
  T as toSorted,
1159
1227
  L as uriTemplateResolver,
1160
- w as urlTemplateRegexExtract,
1161
- q as urlTemplateRegexResolve
1228
+ N as urlTemplateRegexExtract,
1229
+ w as urlTemplateRegexResolve
1162
1230
  };
1163
1231
  //# sourceMappingURL=index.es.js.map