vigor-fetch 3.1.7 → 3.1.9

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.d.ts CHANGED
@@ -1,38 +1,38 @@
1
1
  declare const VigorErrorMessageFuncs: {
2
- INVALID_TARGET: ({ expected, received }: {
2
+ readonly INVALID_TARGET: ({ expected, received }: {
3
3
  expected: Array<string>;
4
4
  received: unknown;
5
5
  }) => string;
6
- EXHAUSTED: ({ maxAttempts }: {
6
+ readonly EXHAUSTED: ({ maxAttempts }: {
7
7
  maxAttempts: number;
8
8
  }) => string;
9
- TIMED_OUT: ({ limit, attempt }: {
9
+ readonly TIMED_OUT: ({ limit, attempt }: {
10
10
  limit: number;
11
11
  attempt: number;
12
12
  }) => string;
13
- INVALID_CONTENT_TYPE: ({ expected, received, response }: {
13
+ readonly INVALID_CONTENT_TYPE: ({ expected, received, response }: {
14
14
  expected: Array<string>;
15
15
  received: unknown;
16
16
  response: Response;
17
17
  }) => string;
18
- PARSER_NOT_FOUND: ({ expected, received, response }: {
18
+ readonly PARSER_NOT_FOUND: ({ expected, received, response }: {
19
19
  expected: Array<string>;
20
20
  received: unknown;
21
21
  response: Response;
22
22
  }) => string;
23
- PARSER_ALL_FAILED: ({ tried, response }: {
23
+ readonly PARSER_ALL_FAILED: ({ tried, response }: {
24
24
  tried: Array<unknown>;
25
25
  response: Response;
26
26
  }) => string;
27
- INVALID_PROTOCOL: ({ expected, received }: {
27
+ readonly INVALID_PROTOCOL: ({ expected, received }: {
28
28
  expected: Array<string>;
29
29
  received: unknown;
30
30
  }) => string;
31
- INVALID_BODY: ({ expected, received }: {
31
+ readonly INVALID_BODY: ({ expected, received }: {
32
32
  expected: Array<string>;
33
33
  received: unknown;
34
34
  }) => string;
35
- FETCH_FAILED: ({ status, response, url, headers, body, statusText }: {
35
+ readonly FETCH_FAILED: ({ status, response, url, headers, body, statusText }: {
36
36
  status: number;
37
37
  response: Response;
38
38
  url: string;
@@ -40,7 +40,7 @@ declare const VigorErrorMessageFuncs: {
40
40
  body: unknown;
41
41
  statusText: string;
42
42
  }) => string;
43
- EMPTY_TARGET: ({}: {}) => string;
43
+ readonly EMPTY_TARGET: ({}: {}) => string;
44
44
  };
45
45
  type VigorErrorCodes = keyof typeof VigorErrorMessageFuncs;
46
46
  type VigorErrorDatas<C extends VigorErrorCodes> = Parameters<typeof VigorErrorMessageFuncs[C]> extends [infer A] ? A : undefined;
@@ -778,6 +778,7 @@ declare const VigorEntry: {
778
778
  error: typeof VigorAllError;
779
779
  };
780
780
  };
781
+ type VigorEntryType = typeof VigorEntry;
781
782
  declare const vigor: {
782
783
  use: <C, R>(func: (entry: typeof VigorEntry, config: C) => R | Promise<R>, config: C) => Promise<R>;
783
784
  fetch: (str: Parameters<VigorFetch["origin"]>[0]) => VigorFetch;
@@ -804,4 +805,5 @@ declare const vigor: {
804
805
  };
805
806
  };
806
807
 
807
- export { VigorEntry, vigor as default, vigor };
808
+ export { VigorAllError, VigorEntry, VigorFetchError, VigorParseError, VigorRetryError, vigor as default, vigor };
809
+ export type { VigorAllConfig, VigorAllContext, VigorAllEachContext, VigorAllEachInterceptorsApi, VigorAllEachInterceptorsFunctions, VigorAllInterceptorsApi, VigorAllInterceptorsFunctions, VigorAllSettingsConfig, VigorEntryType, VigorFetchConfig, VigorFetchContext, VigorFetchInterceptorsApi, VigorFetchInterceptorsFunctions, VigorFetchSettingsConfig, VigorParseConfig, VigorParseContext, VigorParseInterceptorsApi, VigorParseInterceptorsFunctions, VigorParseSettingsConfig, VigorRetryConfig, VigorRetryContext, VigorRetryInterceptorsApi, VigorRetryInterceptorsFunctions, VigorRetrySettingsConfig };
package/dist/index.js CHANGED
@@ -1104,7 +1104,7 @@ class VigorFetch extends VigorStatus {
1104
1104
  });
1105
1105
  try {
1106
1106
  try {
1107
- new URL(stats.origin[0]);
1107
+ new URL(stats.origin);
1108
1108
  }
1109
1109
  catch {
1110
1110
  throw new VigorFetchError("INVALID_PROTOCOL", {
@@ -1740,6 +1740,10 @@ const vigor = {
1740
1740
  }
1741
1741
  };
1742
1742
 
1743
+ exports.VigorAllError = VigorAllError;
1743
1744
  exports.VigorEntry = VigorEntry;
1745
+ exports.VigorFetchError = VigorFetchError;
1746
+ exports.VigorParseError = VigorParseError;
1747
+ exports.VigorRetryError = VigorRetryError;
1744
1748
  exports.default = vigor;
1745
1749
  exports.vigor = vigor;
package/dist/index.mjs CHANGED
@@ -1100,7 +1100,7 @@ class VigorFetch extends VigorStatus {
1100
1100
  });
1101
1101
  try {
1102
1102
  try {
1103
- new URL(stats.origin[0]);
1103
+ new URL(stats.origin);
1104
1104
  }
1105
1105
  catch {
1106
1106
  throw new VigorFetchError("INVALID_PROTOCOL", {
@@ -1736,4 +1736,4 @@ const vigor = {
1736
1736
  }
1737
1737
  };
1738
1738
 
1739
- export { VigorEntry, vigor as default, vigor };
1739
+ export { VigorAllError, VigorEntry, VigorFetchError, VigorParseError, VigorRetryError, vigor as default, vigor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigor-fetch",
3
- "version": "3.1.7",
3
+ "version": "3.1.9",
4
4
  "description": "Smart, zero-dependency HTTP client with self-healing retries for rate-limited servers.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",