@smithy/fetch-http-handler
Advanced tools
Comparing version 2.2.7 to 2.3.0
@@ -11,2 +11,8 @@ "use strict"; | ||
class FetchHttpHandler { | ||
static create(instanceOrOptions) { | ||
if (typeof (instanceOrOptions === null || instanceOrOptions === void 0 ? void 0 : instanceOrOptions.handle) === "function") { | ||
return instanceOrOptions; | ||
} | ||
return new FetchHttpHandler(instanceOrOptions); | ||
} | ||
constructor(options) { | ||
@@ -13,0 +19,0 @@ if (typeof options === "function") { |
@@ -8,2 +8,8 @@ import { HttpResponse } from "@smithy/protocol-http"; | ||
export class FetchHttpHandler { | ||
static create(instanceOrOptions) { | ||
if (typeof instanceOrOptions?.handle === "function") { | ||
return instanceOrOptions; | ||
} | ||
return new FetchHttpHandler(instanceOrOptions); | ||
} | ||
constructor(options) { | ||
@@ -10,0 +16,0 @@ if (typeof options === "function") { |
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; | ||
import type { FetchHttpHandlerOptions } from "@smithy/types"; | ||
import { HttpHandlerOptions, Provider } from "@smithy/types"; | ||
/** | ||
* Represents the http options that can be passed to a browser http client. | ||
*/ | ||
export interface FetchHttpHandlerOptions { | ||
/** | ||
* The number of milliseconds a request can take before being automatically | ||
* terminated. | ||
*/ | ||
requestTimeout?: number; | ||
/** | ||
* Whether to allow the request to outlive the page. Default value is false. | ||
* | ||
* There may be limitations to the payload size, number of concurrent requests, | ||
* request duration etc. when using keepalive in browsers. | ||
* | ||
* These may change over time, so look for up to date information about | ||
* these limitations before enabling keepalive. | ||
*/ | ||
keepAlive?: boolean; | ||
} | ||
export { FetchHttpHandlerOptions }; | ||
type FetchHttpHandlerConfig = FetchHttpHandlerOptions; | ||
@@ -39,2 +21,7 @@ /** | ||
private configProvider; | ||
/** | ||
* @returns the input if it is an HttpHandler of any class, | ||
* or instantiates a new instance of this handler. | ||
*/ | ||
static create(instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerConfig): FetchHttpHandler | HttpHandler<any>; | ||
constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | undefined>); | ||
@@ -48,2 +35,1 @@ destroy(): void; | ||
} | ||
export {}; |
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; | ||
import { FetchHttpHandlerOptions } from "@smithy/types"; | ||
import { HttpHandlerOptions, Provider } from "@smithy/types"; | ||
/** | ||
* Represents the http options that can be passed to a browser http client. | ||
*/ | ||
export interface FetchHttpHandlerOptions { | ||
/** | ||
* The number of milliseconds a request can take before being automatically | ||
* terminated. | ||
*/ | ||
requestTimeout?: number; | ||
/** | ||
* Whether to allow the request to outlive the page. Default value is false. | ||
* | ||
* There may be limitations to the payload size, number of concurrent requests, | ||
* request duration etc. when using keepalive in browsers. | ||
* | ||
* These may change over time, so look for up to date information about | ||
* these limitations before enabling keepalive. | ||
*/ | ||
keepAlive?: boolean; | ||
} | ||
export { FetchHttpHandlerOptions }; | ||
type FetchHttpHandlerConfig = FetchHttpHandlerOptions; | ||
@@ -39,2 +21,7 @@ /** | ||
private configProvider; | ||
/** | ||
* @returns the input if it is an HttpHandler of any class, | ||
* or instantiates a new instance of this handler. | ||
*/ | ||
static create(instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerConfig): FetchHttpHandler | HttpHandler<any>; | ||
constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | undefined>); | ||
@@ -48,2 +35,1 @@ destroy(): void; | ||
} | ||
export {}; |
{ | ||
"name": "@smithy/fetch-http-handler", | ||
"version": "2.2.7", | ||
"version": "2.3.0", | ||
"description": "Provides a way to make requests", | ||
@@ -12,3 +12,3 @@ "scripts": { | ||
"stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz", | ||
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", | ||
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", | ||
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"", | ||
@@ -28,5 +28,5 @@ "format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"", | ||
"dependencies": { | ||
"@smithy/protocol-http": "^3.0.10", | ||
"@smithy/querystring-builder": "^2.0.14", | ||
"@smithy/types": "^2.6.0", | ||
"@smithy/protocol-http": "^3.0.11", | ||
"@smithy/querystring-builder": "^2.0.15", | ||
"@smithy/types": "^2.7.0", | ||
"@smithy/util-base64": "^2.0.1", | ||
@@ -36,3 +36,3 @@ "tslib": "^2.5.0" | ||
"devDependencies": { | ||
"@smithy/abort-controller": "^2.0.14", | ||
"@smithy/abort-controller": "^2.0.15", | ||
"@tsconfig/recommended": "1.0.1", | ||
@@ -39,0 +39,0 @@ "@types/chai-as-promised": "^7.1.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31451
432
5
Updated@smithy/types@^2.7.0