@smithy/fetch-http-handler 5.3.17 → 5.4.0

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
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var protocolHttp = require('@smithy/protocol-http');
4
- var querystringBuilder = require('@smithy/querystring-builder');
5
- var utilBase64 = require('@smithy/util-base64');
3
+ var protocols = require('@smithy/core/protocols');
4
+ var serde = require('@smithy/core/serde');
6
5
 
7
6
  function createRequest(url, requestOptions) {
8
7
  return new Request(url, requestOptions);
@@ -58,7 +57,7 @@ class FetchHttpHandler {
58
57
  return Promise.reject(abortError);
59
58
  }
60
59
  let path = request.path;
61
- const queryString = querystringBuilder.buildQueryString(request.query || {});
60
+ const queryString = protocols.buildQueryString(request.query || {});
62
61
  if (queryString) {
63
62
  path += `?${queryString}`;
64
63
  }
@@ -107,7 +106,7 @@ class FetchHttpHandler {
107
106
  const hasReadableStream = response.body != undefined;
108
107
  if (!hasReadableStream) {
109
108
  return response.blob().then((body) => ({
110
- response: new protocolHttp.HttpResponse({
109
+ response: new protocols.HttpResponse({
111
110
  headers: transformedHeaders,
112
111
  reason: response.statusText,
113
112
  statusCode: response.status,
@@ -116,7 +115,7 @@ class FetchHttpHandler {
116
115
  }));
117
116
  }
118
117
  return {
119
- response: new protocolHttp.HttpResponse({
118
+ response: new protocols.HttpResponse({
120
119
  headers: transformedHeaders,
121
120
  reason: response.statusText,
122
121
  statusCode: response.status,
@@ -186,7 +185,7 @@ const streamCollector = async (stream) => {
186
185
  };
187
186
  async function collectBlob(blob) {
188
187
  const base64 = await readToBase64(blob);
189
- const arrayBuffer = utilBase64.fromBase64(base64);
188
+ const arrayBuffer = serde.fromBase64(base64);
190
189
  return new Uint8Array(arrayBuffer);
191
190
  }
192
191
  async function collectStream(stream) {
@@ -1,5 +1,4 @@
1
- import { HttpResponse } from "@smithy/protocol-http";
2
- import { buildQueryString } from "@smithy/querystring-builder";
1
+ import { HttpResponse, buildQueryString } from "@smithy/core/protocols";
3
2
  import { createRequest } from "./create-request";
4
3
  import { requestTimeout as requestTimeoutFn } from "./request-timeout";
5
4
  export const keepAliveSupport = {
@@ -1,4 +1,4 @@
1
- import { fromBase64 } from "@smithy/util-base64";
1
+ import { fromBase64 } from "@smithy/core/serde";
2
2
  export const streamCollector = async (stream) => {
3
3
  if ((typeof Blob === "function" && stream instanceof Blob) || stream.constructor?.name === "Blob") {
4
4
  if (Blob.prototype.arrayBuffer !== undefined) {
@@ -1,7 +1,5 @@
1
- import type { HttpHandler, HttpRequest } from "@smithy/protocol-http";
2
- import { HttpResponse } from "@smithy/protocol-http";
3
- import type { FetchHttpHandlerOptions } from "@smithy/types";
4
- import type { HttpHandlerOptions, Provider } from "@smithy/types";
1
+ import { HttpResponse, type HttpHandler, type HttpRequest } from "@smithy/core/protocols";
2
+ import type { FetchHttpHandlerOptions, HttpHandlerOptions, Provider } from "@smithy/types";
5
3
  /**
6
4
  * @public
7
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "5.3.17",
3
+ "version": "5.4.0",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -27,10 +27,8 @@
27
27
  "module": "./dist-es/index.js",
28
28
  "types": "./dist-types/index.d.ts",
29
29
  "dependencies": {
30
- "@smithy/protocol-http": "^5.3.14",
31
- "@smithy/querystring-builder": "^4.2.14",
30
+ "@smithy/core": "^3.24.0",
32
31
  "@smithy/types": "^4.14.1",
33
- "@smithy/util-base64": "^4.3.2",
34
32
  "tslib": "^2.6.2"
35
33
  },
36
34
  "devDependencies": {