From b6c147def108b2c7e1e69d87a8a37573a0042240 Mon Sep 17 00:00:00 2001 From: zirkelc Date: Sun, 24 Mar 2024 09:08:49 +0100 Subject: [PATCH 1/2] upgrade deps to @smithy --- dist/index.cjs | 170 +++++++++--------- dist/index.d.cts | 16 +- dist/index.d.ts | 16 +- dist/index.js | 142 ++++++++------- package.json | 9 +- pnpm-lock.yaml | 324 ++++++++--------------------------- src/create-signed-fetcher.ts | 4 +- 7 files changed, 234 insertions(+), 447 deletions(-) diff --git a/dist/index.cjs b/dist/index.cjs index e94ebbb..6cea735 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -3,120 +3,108 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { - if ((from && typeof from === "object") || typeof from === "function") { - for (const key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable, - }); - } - return to; + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; }; -var __toCommonJS = (mod) => - __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var src_exports = {}; __export(src_exports, { - createSignedFetcher: () => createSignedFetcher, + createSignedFetcher: () => createSignedFetcher }); module.exports = __toCommonJS(src_exports); // src/create-signed-fetcher.ts var import_sha256_js = require("@aws-crypto/sha256-js"); var import_credential_provider_node = require("@aws-sdk/credential-provider-node"); -var import_protocol_http = require("@aws-sdk/protocol-http"); -var import_signature_v4 = require("@aws-sdk/signature-v4"); +var import_protocol_http = require("@smithy/protocol-http"); +var import_signature_v4 = require("@smithy/signature-v4"); // src/get-fetch.ts var getFetchFn = (customFetchFn) => { - if (customFetchFn) { - return customFetchFn; - } - if (typeof window !== "undefined" && typeof window.fetch === "function") { - return window.fetch.bind(window); - } - if ( - typeof globalThis !== "undefined" && - typeof globalThis.fetch === "function" - ) { - return globalThis.fetch.bind(globalThis); - } - throw new Error("No fetch implementation found"); + if (customFetchFn) { + return customFetchFn; + } + if (typeof window !== "undefined" && typeof window.fetch === "function") { + return window.fetch.bind(window); + } + if (typeof globalThis !== "undefined" && typeof globalThis.fetch === "function") { + return globalThis.fetch.bind(globalThis); + } + throw new Error("No fetch implementation found"); }; // src/get-headers.ts var getHeaders = (init) => { - const headers = /* @__PURE__ */ new Map(); - if (init === void 0) return headers; - if (Array.isArray(init)) { - init.forEach((header) => headers.set(header[0], header[1])); - return headers; - } - if ("forEach" in init && typeof init.forEach === "function") { - init.forEach((value, key) => headers.set(key, value)); - return headers; - } - if (typeof init === "object") { - Object.entries(init).forEach(([key, value]) => headers.set(key, value)); - return headers; - } - throw new Error("Invalid headers"); + const headers = /* @__PURE__ */ new Map(); + if (init === void 0) + return headers; + if (Array.isArray(init)) { + init.forEach((header) => headers.set(header[0], header[1])); + return headers; + } + if ("forEach" in init && typeof init.forEach === "function") { + init.forEach((value, key) => headers.set(key, value)); + return headers; + } + if (typeof init === "object") { + Object.entries(init).forEach(([key, value]) => headers.set(key, value)); + return headers; + } + throw new Error("Invalid headers"); }; // src/create-signed-fetcher.ts var createSignedFetcher = (opts) => { - const service = opts.service; - const region = opts.region || "us-east-1"; - const credentials = - opts.credentials || (0, import_credential_provider_node.defaultProvider)(); - const fetchFn = getFetchFn(opts.fetch); - return async (input, init) => { - const url = new URL( - typeof input === "string" - ? input - : input instanceof URL - ? input.href - : input.url, - ); - const headers = getHeaders(init?.headers); - headers.set("host", url.host); - const request = new import_protocol_http.HttpRequest({ - hostname: url.hostname, - path: url.pathname, - protocol: url.protocol, - port: url.port ? Number(url.port) : void 0, - username: url.username, - password: url.password, - method: init?.method.toUpperCase(), - // method must be uppercase - body: init?.body, - query: Object.fromEntries(url.searchParams.entries()), - fragment: url.hash, - headers: Object.fromEntries(headers.entries()), - }); - const signer = new import_signature_v4.SignatureV4({ - credentials, - service, - region, - sha256: import_sha256_js.Sha256, - }); - const signedRequest = await signer.sign(request); - return fetchFn(input, { - ...init, - headers: signedRequest.headers, - body: signedRequest.body, - method: signedRequest.method, - }); - }; + const service = opts.service; + const region = opts.region || "us-east-1"; + const credentials = opts.credentials || (0, import_credential_provider_node.defaultProvider)(); + const fetchFn = getFetchFn(opts.fetch); + return async (input, init) => { + const url = new URL( + typeof input === "string" ? input : input instanceof URL ? input.href : input.url + ); + const headers = getHeaders(init?.headers); + headers.set("host", url.host); + const request = new import_protocol_http.HttpRequest({ + hostname: url.hostname, + path: url.pathname, + protocol: url.protocol, + port: url.port ? Number(url.port) : void 0, + username: url.username, + password: url.password, + method: init?.method?.toUpperCase() ?? "GET", + // method must be uppercase + body: init?.body, + query: Object.fromEntries(url.searchParams.entries()), + fragment: url.hash, + headers: Object.fromEntries(headers.entries()) + }); + const signer = new import_signature_v4.SignatureV4({ + credentials, + service, + region, + sha256: import_sha256_js.Sha256 + }); + const signedRequest = await signer.sign(request); + return fetchFn(input, { + ...init, + headers: signedRequest.headers, + body: signedRequest.body, + method: signedRequest.method + }); + }; }; // Annotate the CommonJS export names for ESM import in node: -0 && - (module.exports = { - createSignedFetcher, - }); +0 && (module.exports = { + createSignedFetcher +}); diff --git a/dist/index.d.cts b/dist/index.d.cts index fb4cf31..c74c23e 100644 --- a/dist/index.d.cts +++ b/dist/index.d.cts @@ -1,16 +1,12 @@ -import { AwsCredentialIdentity, Provider } from "@aws-sdk/types"; +import { AwsCredentialIdentity, Provider } from '@aws-sdk/types'; type SignedFetcherOptions = { - service: string; - region?: string; - credentials?: AwsCredentialIdentity | Provider; - fetch?: typeof fetch; + service: string; + region?: string; + credentials?: AwsCredentialIdentity | Provider; + fetch?: typeof fetch; }; type CreateSignedFetcher = (init: SignedFetcherOptions) => typeof fetch; declare const createSignedFetcher: CreateSignedFetcher; -export { - type CreateSignedFetcher, - type SignedFetcherOptions, - createSignedFetcher, -}; +export { type CreateSignedFetcher, type SignedFetcherOptions, createSignedFetcher }; diff --git a/dist/index.d.ts b/dist/index.d.ts index fb4cf31..c74c23e 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,16 +1,12 @@ -import { AwsCredentialIdentity, Provider } from "@aws-sdk/types"; +import { AwsCredentialIdentity, Provider } from '@aws-sdk/types'; type SignedFetcherOptions = { - service: string; - region?: string; - credentials?: AwsCredentialIdentity | Provider; - fetch?: typeof fetch; + service: string; + region?: string; + credentials?: AwsCredentialIdentity | Provider; + fetch?: typeof fetch; }; type CreateSignedFetcher = (init: SignedFetcherOptions) => typeof fetch; declare const createSignedFetcher: CreateSignedFetcher; -export { - type CreateSignedFetcher, - type SignedFetcherOptions, - createSignedFetcher, -}; +export { type CreateSignedFetcher, type SignedFetcherOptions, createSignedFetcher }; diff --git a/dist/index.js b/dist/index.js index 4e33381..9b83357 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,88 +1,84 @@ // src/create-signed-fetcher.ts import { Sha256 } from "@aws-crypto/sha256-js"; import { defaultProvider } from "@aws-sdk/credential-provider-node"; -import { HttpRequest } from "@aws-sdk/protocol-http"; -import { SignatureV4 } from "@aws-sdk/signature-v4"; +import { HttpRequest } from "@smithy/protocol-http"; +import { SignatureV4 } from "@smithy/signature-v4"; // src/get-fetch.ts var getFetchFn = (customFetchFn) => { - if (customFetchFn) { - return customFetchFn; - } - if (typeof window !== "undefined" && typeof window.fetch === "function") { - return window.fetch.bind(window); - } - if ( - typeof globalThis !== "undefined" && - typeof globalThis.fetch === "function" - ) { - return globalThis.fetch.bind(globalThis); - } - throw new Error("No fetch implementation found"); + if (customFetchFn) { + return customFetchFn; + } + if (typeof window !== "undefined" && typeof window.fetch === "function") { + return window.fetch.bind(window); + } + if (typeof globalThis !== "undefined" && typeof globalThis.fetch === "function") { + return globalThis.fetch.bind(globalThis); + } + throw new Error("No fetch implementation found"); }; // src/get-headers.ts var getHeaders = (init) => { - const headers = /* @__PURE__ */ new Map(); - if (init === void 0) return headers; - if (Array.isArray(init)) { - init.forEach((header) => headers.set(header[0], header[1])); - return headers; - } - if ("forEach" in init && typeof init.forEach === "function") { - init.forEach((value, key) => headers.set(key, value)); - return headers; - } - if (typeof init === "object") { - Object.entries(init).forEach(([key, value]) => headers.set(key, value)); - return headers; - } - throw new Error("Invalid headers"); + const headers = /* @__PURE__ */ new Map(); + if (init === void 0) + return headers; + if (Array.isArray(init)) { + init.forEach((header) => headers.set(header[0], header[1])); + return headers; + } + if ("forEach" in init && typeof init.forEach === "function") { + init.forEach((value, key) => headers.set(key, value)); + return headers; + } + if (typeof init === "object") { + Object.entries(init).forEach(([key, value]) => headers.set(key, value)); + return headers; + } + throw new Error("Invalid headers"); }; // src/create-signed-fetcher.ts var createSignedFetcher = (opts) => { - const service = opts.service; - const region = opts.region || "us-east-1"; - const credentials = opts.credentials || defaultProvider(); - const fetchFn = getFetchFn(opts.fetch); - return async (input, init) => { - const url = new URL( - typeof input === "string" - ? input - : input instanceof URL - ? input.href - : input.url, - ); - const headers = getHeaders(init?.headers); - headers.set("host", url.host); - const request = new HttpRequest({ - hostname: url.hostname, - path: url.pathname, - protocol: url.protocol, - port: url.port ? Number(url.port) : void 0, - username: url.username, - password: url.password, - method: init?.method.toUpperCase(), - // method must be uppercase - body: init?.body, - query: Object.fromEntries(url.searchParams.entries()), - fragment: url.hash, - headers: Object.fromEntries(headers.entries()), - }); - const signer = new SignatureV4({ - credentials, - service, - region, - sha256: Sha256, - }); - const signedRequest = await signer.sign(request); - return fetchFn(input, { - ...init, - headers: signedRequest.headers, - body: signedRequest.body, - method: signedRequest.method, - }); - }; + const service = opts.service; + const region = opts.region || "us-east-1"; + const credentials = opts.credentials || defaultProvider(); + const fetchFn = getFetchFn(opts.fetch); + return async (input, init) => { + const url = new URL( + typeof input === "string" ? input : input instanceof URL ? input.href : input.url + ); + const headers = getHeaders(init?.headers); + headers.set("host", url.host); + const request = new HttpRequest({ + hostname: url.hostname, + path: url.pathname, + protocol: url.protocol, + port: url.port ? Number(url.port) : void 0, + username: url.username, + password: url.password, + method: init?.method?.toUpperCase() ?? "GET", + // method must be uppercase + body: init?.body, + query: Object.fromEntries(url.searchParams.entries()), + fragment: url.hash, + headers: Object.fromEntries(headers.entries()) + }); + const signer = new SignatureV4({ + credentials, + service, + region, + sha256: Sha256 + }); + const signedRequest = await signer.sign(request); + return fetchFn(input, { + ...init, + headers: signedRequest.headers, + body: signedRequest.body, + method: signedRequest.method + }); + }; +}; +export { + createSignedFetcher }; -export { createSignedFetcher }; diff --git a/package.json b/package.json index 98574ae..c83f826 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ ], "scripts": { "test": "vitest", - "pretest": "pnpm build && pnpm start", + "pretest": "pnpm build", "build": "tsup src/index.ts --format cjs,esm --dts --clean", "watch": "pnpm build -- --watch src", "prepublishOnly": "pnpm build", @@ -45,10 +45,9 @@ "@aws-crypto/sha256-js": "^4.0.0", "@aws-sdk/client-cognito-identity-provider": "^3.359.0", "@aws-sdk/credential-provider-node": "^3.358.0", - "@aws-sdk/protocol-http": "^3.357.0", - "@aws-sdk/querystring-parser": "^3.357.0", - "@aws-sdk/signature-v4": "^3.357.0", - "@aws-sdk/types": "^3.357.0" + "@aws-sdk/types": "^3.357.0", + "@smithy/protocol-http": "^3.3.0", + "@smithy/signature-v4": "^2.2.0" }, "devDependencies": { "@biomejs/biome": "1.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cd8ce90..82c704e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,18 +17,15 @@ importers: '@aws-sdk/credential-provider-node': specifier: ^3.358.0 version: 3.451.0 - '@aws-sdk/protocol-http': - specifier: ^3.357.0 - version: 3.374.0 - '@aws-sdk/querystring-parser': - specifier: ^3.357.0 - version: 3.374.0 - '@aws-sdk/signature-v4': - specifier: ^3.357.0 - version: 3.374.0 '@aws-sdk/types': specifier: ^3.357.0 version: 3.451.0 + '@smithy/protocol-http': + specifier: ^3.3.0 + version: 3.3.0 + '@smithy/signature-v4': + specifier: ^2.2.0 + version: 2.2.0 devDependencies: '@biomejs/biome': specifier: 1.5.1 @@ -73,7 +70,7 @@ packages: resolution: {integrity: sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==} dependencies: '@aws-crypto/util': 3.0.0 - '@aws-sdk/types': 3.451.0 + '@aws-sdk/types': 3.535.0 tslib: 1.14.1 dev: false @@ -263,7 +260,7 @@ packages: '@smithy/middleware-stack': 2.0.7 '@smithy/node-config-provider': 2.1.5 '@smithy/node-http-handler': 2.1.9 - '@smithy/protocol-http': 3.0.9 + '@smithy/protocol-http': 3.3.0 '@smithy/smithy-client': 2.1.15 '@smithy/types': 2.5.0 '@smithy/url-parser': 2.0.13 @@ -357,9 +354,9 @@ packages: '@smithy/middleware-stack': 2.0.7 '@smithy/node-config-provider': 2.1.5 '@smithy/node-http-handler': 2.1.9 - '@smithy/protocol-http': 3.0.9 + '@smithy/protocol-http': 3.3.0 '@smithy/smithy-client': 2.1.15 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/url-parser': 2.0.13 '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 @@ -368,7 +365,7 @@ packages: '@smithy/util-defaults-mode-node': 2.0.25 '@smithy/util-endpoints': 1.0.4 '@smithy/util-retry': 2.0.6 - '@smithy/util-utf8': 2.0.2 + '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 transitivePeerDependencies: - aws-crt @@ -450,9 +447,9 @@ packages: '@smithy/middleware-stack': 2.0.7 '@smithy/node-config-provider': 2.1.5 '@smithy/node-http-handler': 2.1.9 - '@smithy/protocol-http': 3.0.9 + '@smithy/protocol-http': 3.3.0 '@smithy/smithy-client': 2.1.15 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/url-parser': 2.0.13 '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 @@ -461,7 +458,7 @@ packages: '@smithy/util-defaults-mode-node': 2.0.25 '@smithy/util-endpoints': 1.0.4 '@smithy/util-retry': 2.0.6 - '@smithy/util-utf8': 2.0.2 + '@smithy/util-utf8': 2.3.0 fast-xml-parser: 4.2.5 tslib: 2.6.2 transitivePeerDependencies: @@ -732,8 +729,8 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.451.0 - '@smithy/protocol-http': 3.0.9 - '@smithy/types': 2.5.0 + '@smithy/protocol-http': 3.3.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -752,7 +749,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.451.0 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -770,8 +767,8 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.451.0 - '@smithy/protocol-http': 3.0.9 - '@smithy/types': 2.5.0 + '@smithy/protocol-http': 3.3.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -801,7 +798,7 @@ packages: dependencies: '@aws-sdk/middleware-signing': 3.451.0 '@aws-sdk/types': 3.451.0 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -811,10 +808,10 @@ packages: dependencies: '@aws-sdk/types': 3.451.0 '@smithy/property-provider': 2.0.14 - '@smithy/protocol-http': 3.0.9 - '@smithy/signature-v4': 2.0.15 - '@smithy/types': 2.5.0 - '@smithy/util-middleware': 2.0.6 + '@smithy/protocol-http': 3.3.0 + '@smithy/signature-v4': 2.2.0 + '@smithy/types': 2.12.0 + '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 dev: false @@ -824,8 +821,8 @@ packages: dependencies: '@aws-sdk/types': 3.451.0 '@aws-sdk/util-endpoints': 3.451.0 - '@smithy/protocol-http': 3.0.9 - '@smithy/types': 2.5.0 + '@smithy/protocol-http': 3.3.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -840,32 +837,14 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/protocol-http@3.374.0: - resolution: {integrity: sha512-9WpRUbINdGroV3HiZZIBoJvL2ndoWk39OfwxWs2otxByppJZNN14bg/lvCx5e8ggHUti7IBk5rb0nqQZ4m05pg==} - engines: {node: '>=14.0.0'} - deprecated: This package has moved to @smithy/protocol-http - dependencies: - '@smithy/protocol-http': 1.2.0 - tslib: 2.6.2 - dev: false - - /@aws-sdk/querystring-parser@3.374.0: - resolution: {integrity: sha512-5qeZn9uAGzg+kbxgaMTYH7se1YGIBBOxHifek6ZGXwQs4Oxr3NuO0JXbOJUu2NZHD+NVQs48sFHeGkabcptFug==} - engines: {node: '>=14.0.0'} - deprecated: This package has moved to @smithy/querystring-parser - dependencies: - '@smithy/querystring-parser': 1.1.0 - tslib: 2.6.2 - dev: false - /@aws-sdk/region-config-resolver@3.451.0: resolution: {integrity: sha512-3iMf4OwzrFb4tAAmoROXaiORUk2FvSejnHIw/XHvf/jjR4EqGGF95NZP/n/MeFZMizJWVssrwS412GmoEyoqhg==} engines: {node: '>=14.0.0'} dependencies: '@smithy/node-config-provider': 2.1.5 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/util-config-provider': 2.0.0 - '@smithy/util-middleware': 2.0.6 + '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 dev: false @@ -881,15 +860,6 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/signature-v4@3.374.0: - resolution: {integrity: sha512-2xLJvSdzcZZAg0lsDLUAuSQuihzK0dcxIK7WmfuJeF7DGKJFmp9czQmz5f3qiDz6IDQzvgK1M9vtJSVCslJbyQ==} - engines: {node: '>=14.0.0'} - deprecated: This package has moved to @smithy/signature-v4 - dependencies: - '@smithy/signature-v4': 1.1.0 - tslib: 2.6.2 - dev: false - /@aws-sdk/token-providers@3.451.0: resolution: {integrity: sha512-ij1L5iUbn6CwxVOT1PG4NFjsrsKN9c4N1YEM0lkl6DwmaNOscjLKGSNyj9M118vSWsOs1ZDbTwtj++h0O/BWrQ==} engines: {node: '>=14.0.0'} @@ -917,10 +887,10 @@ packages: '@smithy/node-config-provider': 2.1.5 '@smithy/node-http-handler': 2.1.9 '@smithy/property-provider': 2.0.14 - '@smithy/protocol-http': 3.0.9 + '@smithy/protocol-http': 3.3.0 '@smithy/shared-ini-file-loader': 2.2.4 '@smithy/smithy-client': 2.1.15 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/url-parser': 2.0.13 '@smithy/util-base64': 2.0.1 '@smithy/util-body-length-browser': 2.0.0 @@ -929,7 +899,7 @@ packages: '@smithy/util-defaults-mode-node': 2.0.25 '@smithy/util-endpoints': 1.0.4 '@smithy/util-retry': 2.0.6 - '@smithy/util-utf8': 2.0.2 + '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 transitivePeerDependencies: - aws-crt @@ -996,7 +966,7 @@ packages: resolution: {integrity: sha512-Ws5mG3J0TQifH7OTcMrCTexo7HeSAc3cBgjfhS/ofzPUzVCtsyg0G7I6T7wl7vJJETix2Kst2cpOsxygPgPD9w==} dependencies: '@aws-sdk/types': 3.451.0 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 bowser: 2.11.0 tslib: 2.6.2 dev: false @@ -1021,7 +991,7 @@ packages: dependencies: '@aws-sdk/types': 3.451.0 '@smithy/node-config-provider': 2.1.5 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -1728,7 +1698,7 @@ packages: resolution: {integrity: sha512-eeOPD+GF9BzF/Mjy3PICLePx4l0f3rG/nQegQHRLTloN5p1lSJJNZsyn+FzDnW8P2AduragZqJdtKNCxXozB1Q==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -1745,9 +1715,9 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@smithy/node-config-provider': 2.1.5 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/util-config-provider': 2.0.0 - '@smithy/util-middleware': 2.0.6 + '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 dev: false @@ -1798,24 +1768,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/eventstream-codec@1.1.0: - resolution: {integrity: sha512-3tEbUb8t8an226jKB6V/Q2XU/J53lCwCzULuBPEaF4JjSh+FlCMp7TmogE/Aij5J9DwlsZ4VAD/IRDuQ/0ZtMw==} - dependencies: - '@aws-crypto/crc32': 3.0.0 - '@smithy/types': 1.2.0 - '@smithy/util-hex-encoding': 1.1.0 - tslib: 2.6.2 - dev: false - - /@smithy/eventstream-codec@2.0.13: - resolution: {integrity: sha512-CExbelIYp+DxAHG8RIs0l9QL7ElqhG4ym9BNoSpkPa4ptBQfzJdep3LbOSVJIE2VUdBAeObdeL6EDB3Jo85n3g==} - dependencies: - '@aws-crypto/crc32': 3.0.0 - '@smithy/types': 2.5.0 - '@smithy/util-hex-encoding': 2.0.0 - tslib: 2.6.2 - dev: false - /@smithy/eventstream-codec@2.2.0: resolution: {integrity: sha512-8janZoJw85nJmQZc4L8TuePp2pk1nxLgkxIR0TUjKJ5Dkj5oelB9WtiSSGXCQvNsJl0VSTvK/2ueMXxvpa9GVw==} dependencies: @@ -1828,9 +1780,9 @@ packages: /@smithy/fetch-http-handler@2.2.6: resolution: {integrity: sha512-PStY3XO1Ksjwn3wMKye5U6m6zxXpXrXZYqLy/IeCbh3nM9QB3Jgw/B0PUSLUWKdXg4U8qgEu300e3ZoBvZLsDg==} dependencies: - '@smithy/protocol-http': 3.0.9 + '@smithy/protocol-http': 3.3.0 '@smithy/querystring-builder': 2.0.13 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/util-base64': 2.0.1 tslib: 2.6.2 dev: false @@ -1849,9 +1801,9 @@ packages: resolution: {integrity: sha512-t/qjEJZu/G46A22PAk1k/IiJZT4ncRkG5GOCNWN9HPPy5rCcSZUbh7gwp7CGKgJJ7ATMMg+0Td7i9o1lQTwOfQ==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/util-buffer-from': 2.0.0 - '@smithy/util-utf8': 2.0.2 + '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 dev: false @@ -1868,7 +1820,7 @@ packages: /@smithy/invalid-dependency@2.0.13: resolution: {integrity: sha512-XsGYhVhvEikX1Yz0kyIoLssJf2Rs6E0U2w2YuKdT4jSra5A/g8V2oLROC1s56NldbgnpesTYB2z55KCHHbKyjw==} dependencies: - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -1879,20 +1831,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/is-array-buffer@1.1.0: - resolution: {integrity: sha512-twpQ/n+3OWZJ7Z+xu43MJErmhB/WO/mMTnqR6PwWQShvSJ/emx5d1N59LQZk6ZpTAeuRWrc+eHhkzTp9NFjNRQ==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - - /@smithy/is-array-buffer@2.0.0: - resolution: {integrity: sha512-z3PjFjMyZNI98JFRJi/U0nGoLWMSJlDjAW4QUX2WNZLas5C0CmVV6LJ01JI0k90l7FvpmixjWxPFmENSClQ7ug==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - /@smithy/is-array-buffer@2.2.0: resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} engines: {node: '>=14.0.0'} @@ -1904,8 +1842,8 @@ packages: resolution: {integrity: sha512-xH4kRBw01gJgWiU+/mNTrnyFXeozpZHw39gLb3JKGsFDVmSrJZ8/tRqu27tU/ki1gKkxr2wApu+dEYjI3QwV1Q==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/protocol-http': 3.0.9 - '@smithy/types': 2.5.0 + '@smithy/protocol-http': 3.3.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -1925,9 +1863,9 @@ packages: '@smithy/middleware-serde': 2.0.13 '@smithy/node-config-provider': 2.1.5 '@smithy/shared-ini-file-loader': 2.2.4 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/url-parser': 2.0.13 - '@smithy/util-middleware': 2.0.6 + '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 dev: false @@ -1949,10 +1887,10 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@smithy/node-config-provider': 2.1.5 - '@smithy/protocol-http': 3.0.9 + '@smithy/protocol-http': 3.3.0 '@smithy/service-error-classification': 2.0.6 - '@smithy/types': 2.5.0 - '@smithy/util-middleware': 2.0.6 + '@smithy/types': 2.12.0 + '@smithy/util-middleware': 2.2.0 '@smithy/util-retry': 2.0.6 tslib: 2.6.2 uuid: 8.3.2 @@ -1977,7 +1915,7 @@ packages: resolution: {integrity: sha512-tBGbeXw+XsE6pPr4UaXOh+UIcXARZeiA8bKJWxk2IjJcD1icVLhBSUQH9myCIZLNNzJIH36SDjUX8Wqk4xJCJg==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -1993,7 +1931,7 @@ packages: resolution: {integrity: sha512-L1KLAAWkXbGx1t2jjCI/mDJ2dDNq+rp4/ifr/HcC6FHngxho5O7A5bQLpKHGlkfATH6fUnOEx0VICEVFA4sUzw==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -2011,7 +1949,7 @@ packages: dependencies: '@smithy/property-provider': 2.0.14 '@smithy/shared-ini-file-loader': 2.2.4 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -2030,9 +1968,9 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@smithy/abort-controller': 2.0.13 - '@smithy/protocol-http': 3.0.9 + '@smithy/protocol-http': 3.3.0 '@smithy/querystring-builder': 2.0.13 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -2063,22 +2001,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/protocol-http@1.2.0: - resolution: {integrity: sha512-GfGfruksi3nXdFok5RhgtOnWe5f6BndzYfmEXISD+5gAGdayFGpjWu5pIqIweTudMtse20bGbc+7MFZXT1Tb8Q==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 1.2.0 - tslib: 2.6.2 - dev: false - - /@smithy/protocol-http@3.0.9: - resolution: {integrity: sha512-U1wl+FhYu4/BC+rjwh1lg2gcJChQhytiNQSggREgQ9G2FzmoK9sACBZvx7thyWMvRyHQTE22mO2d5UM8gMKDBg==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - dev: false - /@smithy/protocol-http@3.3.0: resolution: {integrity: sha512-Xy5XK1AFWW2nlY/biWZXu6/krgbaf2dg0q492D8M5qthsnU2H+UgFeZLbM76FnH7s6RO/xhQRkj+T6KBO3JzgQ==} engines: {node: '>=14.0.0'} @@ -2091,8 +2013,8 @@ packages: resolution: {integrity: sha512-JhXKwp3JtsFUe96XLHy/nUPEbaXqn6r7xE4sNaH8bxEyytE5q1fwt0ew/Ke6+vIC7gP87HCHgQpJHg1X1jN2Fw==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/types': 2.5.0 - '@smithy/util-uri-escape': 2.0.0 + '@smithy/types': 2.12.0 + '@smithy/util-uri-escape': 2.2.0 tslib: 2.6.2 dev: false @@ -2105,22 +2027,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/querystring-parser@1.1.0: - resolution: {integrity: sha512-Lm/FZu2qW3XX+kZ4WPwr+7aAeHf1Lm84UjNkKyBu16XbmEV7ukfhXni2aIwS2rcVf8Yv5E7wchGGpOFldj9V4Q==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 1.2.0 - tslib: 2.6.2 - dev: false - - /@smithy/querystring-parser@2.0.13: - resolution: {integrity: sha512-TEiT6o8CPZVxJ44Rly/rrsATTQsE+b/nyBVzsYn2sa75xAaZcurNxsFd8z1haoUysONiyex24JMHoJY6iCfLdA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - dev: false - /@smithy/querystring-parser@2.2.0: resolution: {integrity: sha512-BvHCDrKfbG5Yhbpj4vsbuPV2GgcpHiAkLeIlcA1LtfpMz3jrqizP1+OguSNSj1MwBHEiN+jwNisXLGdajGDQJA==} engines: {node: '>=14.0.0'} @@ -2133,7 +2039,7 @@ packages: resolution: {integrity: sha512-fCQ36frtYra2fqY2/DV8+3/z2d0VB/1D1hXbjRcM5wkxTToxq6xHbIY/NGGY6v4carskMyG8FHACxgxturJ9Pg==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 dev: false /@smithy/service-error-classification@2.1.5: @@ -2159,34 +2065,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/signature-v4@1.1.0: - resolution: {integrity: sha512-fDo3m7YqXBs7neciOePPd/X9LPm5QLlDMdIC4m1H6dgNLnXfLMFNIxEfPyohGA8VW9Wn4X8lygnPSGxDZSmp0Q==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/eventstream-codec': 1.1.0 - '@smithy/is-array-buffer': 1.1.0 - '@smithy/types': 1.2.0 - '@smithy/util-hex-encoding': 1.1.0 - '@smithy/util-middleware': 1.1.0 - '@smithy/util-uri-escape': 1.1.0 - '@smithy/util-utf8': 1.1.0 - tslib: 2.6.2 - dev: false - - /@smithy/signature-v4@2.0.15: - resolution: {integrity: sha512-SRTEJSEhQYVlBKIIdZ9SZpqW+KFqxqcNnEcBX+8xkDdWx+DItme9VcCDkdN32yTIrICC+irUufnUdV7mmHPjoA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/eventstream-codec': 2.0.13 - '@smithy/is-array-buffer': 2.0.0 - '@smithy/types': 2.5.0 - '@smithy/util-hex-encoding': 2.0.0 - '@smithy/util-middleware': 2.0.6 - '@smithy/util-uri-escape': 2.0.0 - '@smithy/util-utf8': 2.0.2 - tslib: 2.6.2 - dev: false - /@smithy/signature-v4@2.2.0: resolution: {integrity: sha512-+B5TNzj/fRZzVW3z8UUJOkNx15+4E0CLuvJmJUA1JUIZFp3rdJ/M2H5r2SqltaVPXL0oIxv/6YK92T9TsFGbFg==} engines: {node: '>=14.0.0'} @@ -2206,7 +2084,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@smithy/middleware-stack': 2.0.7 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/util-stream': 2.0.20 tslib: 2.6.2 dev: false @@ -2223,13 +2101,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/types@1.2.0: - resolution: {integrity: sha512-z1r00TvBqF3dh4aHhya7nz1HhvCg4TRmw51fjMrh5do3h+ngSstt/yKlNbHeb9QxJmFbmN8KEVSWgb1bRvfEoA==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - /@smithy/types@2.12.0: resolution: {integrity: sha512-QwYgloJ0sVNBeBuBs65cIkTbfzV/Q6ZNPCJ99EICFEdJYG50nGIY/uYXp+TbsdJReIuPr0a0kXmCvren3MbRRw==} engines: {node: '>=14.0.0'} @@ -2247,8 +2118,8 @@ packages: /@smithy/url-parser@2.0.13: resolution: {integrity: sha512-okWx2P/d9jcTsZWTVNnRMpFOE7fMkzloSFyM53fA7nLKJQObxM2T4JlZ5KitKKuXq7pxon9J6SF2kCwtdflIrA==} dependencies: - '@smithy/querystring-parser': 2.0.13 - '@smithy/types': 2.5.0 + '@smithy/querystring-parser': 2.2.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -2303,19 +2174,11 @@ packages: tslib: 2.6.2 dev: false - /@smithy/util-buffer-from@1.1.0: - resolution: {integrity: sha512-9m6NXE0ww+ra5HKHCHig20T+FAwxBAm7DIdwc/767uGWbRcY720ybgPacQNB96JMOI7xVr/CDa3oMzKmW4a+kw==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/is-array-buffer': 1.1.0 - tslib: 2.6.2 - dev: false - /@smithy/util-buffer-from@2.0.0: resolution: {integrity: sha512-/YNnLoHsR+4W4Vf2wL5lGv0ksg8Bmk3GEGxn2vEQt52AQaPSCuaO5PM5VM7lP1K9qHRKHwrPGktqVoAHKWHxzw==} engines: {node: '>=14.0.0'} dependencies: - '@smithy/is-array-buffer': 2.0.0 + '@smithy/is-array-buffer': 2.2.0 tslib: 2.6.2 dev: false @@ -2347,7 +2210,7 @@ packages: dependencies: '@smithy/property-provider': 2.0.14 '@smithy/smithy-client': 2.1.15 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 bowser: 2.11.0 tslib: 2.6.2 dev: false @@ -2372,7 +2235,7 @@ packages: '@smithy/node-config-provider': 2.1.5 '@smithy/property-provider': 2.0.14 '@smithy/smithy-client': 2.1.15 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -2394,7 +2257,7 @@ packages: engines: {node: '>= 14.0.0'} dependencies: '@smithy/node-config-provider': 2.1.5 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -2407,20 +2270,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/util-hex-encoding@1.1.0: - resolution: {integrity: sha512-7UtIE9eH0u41zpB60Jzr0oNCQ3hMJUabMcKRUVjmyHTXiWDE4vjSqN6qlih7rCNeKGbioS7f/y2Jgym4QZcKFg==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - - /@smithy/util-hex-encoding@2.0.0: - resolution: {integrity: sha512-c5xY+NUnFqG6d7HFh1IFfrm3mGl29lC+vF+geHv4ToiuJCBmIfzx6IeHLg+OgRdPFKDXIw6pvi+p3CsscaMcMA==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - /@smithy/util-hex-encoding@2.2.0: resolution: {integrity: sha512-7iKXR+/4TpLK194pVjKiasIyqMtTYJsgKgM242Y9uzt5dhHnUDvMNb+3xIhRJ9QhvqGii/5cRUt4fJn3dtXNHQ==} engines: {node: '>=14.0.0'} @@ -2428,21 +2277,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/util-middleware@1.1.0: - resolution: {integrity: sha512-6hhckcBqVgjWAqLy2vqlPZ3rfxLDhFWEmM7oLh2POGvsi7j0tHkbN7w4DFhuBExVJAbJ/qqxqZdRY6Fu7/OezQ==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - - /@smithy/util-middleware@2.0.6: - resolution: {integrity: sha512-7W4uuwBvSLgKoLC1x4LfeArCVcbuHdtVaC4g30kKsD1erfICyQ45+tFhhs/dZNeQg+w392fhunCm/+oCcb6BSA==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/types': 2.5.0 - tslib: 2.6.2 - dev: false - /@smithy/util-middleware@2.2.0: resolution: {integrity: sha512-L1qpleXf9QD6LwLCJ5jddGkgWyuSvWBkJwWAZ6kFkdifdso+sk3L3O1HdmPvCdnCK3IS4qWyPxev01QMnfHSBw==} engines: {node: '>=14.0.0'} @@ -2456,7 +2290,7 @@ packages: engines: {node: '>= 14.0.0'} dependencies: '@smithy/service-error-classification': 2.0.6 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 tslib: 2.6.2 dev: false @@ -2475,11 +2309,11 @@ packages: dependencies: '@smithy/fetch-http-handler': 2.2.6 '@smithy/node-http-handler': 2.1.9 - '@smithy/types': 2.5.0 + '@smithy/types': 2.12.0 '@smithy/util-base64': 2.0.1 - '@smithy/util-buffer-from': 2.0.0 - '@smithy/util-hex-encoding': 2.0.0 - '@smithy/util-utf8': 2.0.2 + '@smithy/util-buffer-from': 2.2.0 + '@smithy/util-hex-encoding': 2.2.0 + '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 dev: false @@ -2497,20 +2331,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/util-uri-escape@1.1.0: - resolution: {integrity: sha512-/jL/V1xdVRt5XppwiaEU8Etp5WHZj609n0xMTuehmCqdoOFbId1M+aEeDWZsQ+8JbEB/BJ6ynY2SlYmOaKtt8w==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - - /@smithy/util-uri-escape@2.0.0: - resolution: {integrity: sha512-ebkxsqinSdEooQduuk9CbKcI+wheijxEb3utGXkCoYQkJnwTnLbH1JXGimJtUkQwNQbsbuYwG2+aFVyZf5TLaw==} - engines: {node: '>=14.0.0'} - dependencies: - tslib: 2.6.2 - dev: false - /@smithy/util-uri-escape@2.2.0: resolution: {integrity: sha512-jtmJMyt1xMD/d8OtbVJ2gFZOSKc+ueYJZPW20ULW1GOp/q/YIM0wNh+u8ZFao9UaIGz4WoPW8hC64qlWLIfoDA==} engines: {node: '>=14.0.0'} @@ -2518,14 +2338,6 @@ packages: tslib: 2.6.2 dev: false - /@smithy/util-utf8@1.1.0: - resolution: {integrity: sha512-p/MYV+JmqmPyjdgyN2UxAeYDj9cBqCjp0C/NsTWnnjoZUVqoeZ6IrW915L9CAKWVECgv9lVQGc4u/yz26/bI1A==} - engines: {node: '>=14.0.0'} - dependencies: - '@smithy/util-buffer-from': 1.1.0 - tslib: 2.6.2 - dev: false - /@smithy/util-utf8@2.0.2: resolution: {integrity: sha512-qOiVORSPm6Ce4/Yu6hbSgNHABLP2VMv8QOC3tTDNHHlWY19pPyc++fBTbZPtx6egPXi4HQxKDnMxVxpbtX2GoA==} engines: {node: '>=14.0.0'} diff --git a/src/create-signed-fetcher.ts b/src/create-signed-fetcher.ts index 2b098c5..fb3cddd 100644 --- a/src/create-signed-fetcher.ts +++ b/src/create-signed-fetcher.ts @@ -1,8 +1,8 @@ import { Sha256 } from "@aws-crypto/sha256-js"; import { defaultProvider } from "@aws-sdk/credential-provider-node"; -import { HttpRequest } from "@aws-sdk/protocol-http"; -import { SignatureV4 } from "@aws-sdk/signature-v4"; import type { AwsCredentialIdentity, Provider } from "@aws-sdk/types"; +import { HttpRequest } from "@smithy/protocol-http"; +import { SignatureV4 } from "@smithy/signature-v4"; import { getFetchFn } from "./get-fetch.js"; import { getHeaders } from "./get-headers.js"; From 05477bbb83fb61d4a91471b64e38dc61177d5b89 Mon Sep 17 00:00:00 2001 From: zirkelc Date: Sun, 24 Mar 2024 09:10:03 +0100 Subject: [PATCH 2/2] 3.0.1-alpha.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c83f826..87ced5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-sigv4-fetch", - "version": "3.0.0", + "version": "3.0.1-alpha.0", "description": "SignatureV4 fetch implemented with official @aws-sdk v3", "packageManager": "pnpm@8.8.0", "type": "module", @@ -58,4 +58,4 @@ "typescript": "^5.2.0", "vitest": "^0.34.6" } -} \ No newline at end of file +}