@smithy/fetch-http-handler 5.3.14 → 5.3.16

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-cjs/index.js CHANGED
@@ -161,7 +161,10 @@ function buildAbortError(abortSignal) {
161
161
  : undefined;
162
162
  if (reason) {
163
163
  if (reason instanceof Error) {
164
- return reason;
164
+ const abortError = new Error("Request aborted");
165
+ abortError.name = "AbortError";
166
+ abortError.cause = reason;
167
+ return abortError;
165
168
  }
166
169
  const abortError = new Error(String(reason));
167
170
  abortError.name = "AbortError";
@@ -143,7 +143,10 @@ function buildAbortError(abortSignal) {
143
143
  : undefined;
144
144
  if (reason) {
145
145
  if (reason instanceof Error) {
146
- return reason;
146
+ const abortError = new Error("Request aborted");
147
+ abortError.name = "AbortError";
148
+ abortError.cause = reason;
149
+ return abortError;
147
150
  }
148
151
  const abortError = new Error(String(reason));
149
152
  abortError.name = "AbortError";
package/package.json CHANGED
@@ -1,22 +1,21 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "5.3.14",
3
+ "version": "5.3.16",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
- "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
7
- "build:cjs": "node ../../scripts/inline fetch-http-handler",
8
- "build:es": "yarn g:tsc -p tsconfig.es.json",
6
+ "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
7
+ "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline fetch-http-handler",
9
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
10
9
  "build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
11
- "stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
12
10
  "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
13
- "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
14
- "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
15
11
  "extract:docs": "api-extractor run --local",
12
+ "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
13
+ "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
14
+ "stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
16
15
  "test": "yarn g:vitest run && yarn test:browser",
17
- "test:watch": "yarn g:vitest watch",
18
16
  "test:browser": "yarn g:vitest run -c vitest.config.browser.mts",
19
- "test:browser:watch": "yarn g:vitest watch -c vitest.config.browser.mts"
17
+ "test:browser:watch": "yarn g:vitest watch -c vitest.config.browser.mts",
18
+ "test:watch": "yarn g:vitest watch"
20
19
  },
21
20
  "author": {
22
21
  "name": "AWS SDK for JavaScript Team",
@@ -28,14 +27,14 @@
28
27
  "module": "./dist-es/index.js",
29
28
  "types": "./dist-types/index.d.ts",
30
29
  "dependencies": {
31
- "@smithy/protocol-http": "^5.3.12",
32
- "@smithy/querystring-builder": "^4.2.12",
33
- "@smithy/types": "^4.13.1",
30
+ "@smithy/protocol-http": "^5.3.13",
31
+ "@smithy/querystring-builder": "^4.2.13",
32
+ "@smithy/types": "^4.14.0",
34
33
  "@smithy/util-base64": "^4.3.2",
35
34
  "tslib": "^2.6.2"
36
35
  },
37
36
  "devDependencies": {
38
- "@smithy/abort-controller": "^4.2.12",
37
+ "@smithy/abort-controller": "^4.2.13",
39
38
  "concurrently": "7.0.0",
40
39
  "downlevel-dts": "0.10.1",
41
40
  "premove": "4.0.0",
@@ -1,6 +0,0 @@
1
- import { AdditionalRequestParameters } from "./fetch-http-handler";
2
- /**
3
- * @internal
4
- * For mocking/interception.
5
- */
6
- export declare function createRequest(url: string, requestOptions?: RequestInit & AdditionalRequestParameters): Request;
@@ -1,42 +0,0 @@
1
- import { HttpHandler, HttpRequest } from "@smithy/protocol-http";
2
- import { HttpResponse } from "@smithy/protocol-http";
3
- import { FetchHttpHandlerOptions } from "@smithy/types";
4
- import { HttpHandlerOptions, Provider } from "@smithy/types";
5
- /**
6
- * @public
7
- */
8
- export { FetchHttpHandlerOptions };
9
- /**
10
- * @internal
11
- * Detection of keepalive support. Can be overridden for testing.
12
- */
13
- export declare const keepAliveSupport: {
14
- supported: undefined | boolean;
15
- };
16
- /**
17
- * @internal
18
- */
19
- export type AdditionalRequestParameters = {
20
- duplex?: "half";
21
- };
22
- /**
23
- * @public
24
- *
25
- * HttpHandler implementation using browsers' `fetch` global function.
26
- */
27
- export declare class FetchHttpHandler implements HttpHandler<FetchHttpHandlerOptions> {
28
- private config?;
29
- private configProvider;
30
- /**
31
- * @returns the input if it is an HttpHandler of any class,
32
- * or instantiates a new instance of this handler.
33
- */
34
- static create(instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>): FetchHttpHandler | HttpHandler<any>;
35
- constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>);
36
- destroy(): void;
37
- handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
38
- response: HttpResponse;
39
- }>;
40
- updateHttpClientConfig(key: keyof FetchHttpHandlerOptions, value: FetchHttpHandlerOptions[typeof key]): void;
41
- httpHandlerConfigs(): FetchHttpHandlerOptions;
42
- }
@@ -1,2 +0,0 @@
1
- export * from "./fetch-http-handler";
2
- export * from "./stream-collector";
@@ -1 +0,0 @@
1
- export declare function requestTimeout(timeoutInMs?: number): Promise<never>;
@@ -1,2 +0,0 @@
1
- import { StreamCollector } from "@smithy/types";
2
- export declare const streamCollector: StreamCollector;