@aws-sdk/core 3.666.0 → 3.677.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.
@@ -22,15 +22,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  var client_exports = {};
23
23
  __export(client_exports, {
24
24
  emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion,
25
- setFeature: () => setFeature
25
+ setCredentialFeature: () => setCredentialFeature,
26
+ setFeature: () => setFeature,
27
+ state: () => state
26
28
  });
27
29
  module.exports = __toCommonJS(client_exports);
28
30
 
29
31
  // src/submodules/client/emitWarningIfUnsupportedVersion.ts
30
- var warningEmitted = false;
32
+ var state = {
33
+ warningEmitted: false
34
+ };
31
35
  var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => {
32
- if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
33
- warningEmitted = true;
36
+ if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
37
+ state.warningEmitted = true;
34
38
  process.emitWarning(
35
39
  `NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
36
40
  no longer support Node.js 16.x on January 6, 2025.
@@ -43,6 +47,16 @@ More information can be found at: https://a.co/74kJMmI`
43
47
  }
44
48
  }, "emitWarningIfUnsupportedVersion");
45
49
 
50
+ // src/submodules/client/setCredentialFeature.ts
51
+ function setCredentialFeature(credentials, feature, value) {
52
+ if (!credentials.$source) {
53
+ credentials.$source = {};
54
+ }
55
+ credentials.$source[feature] = value;
56
+ return credentials;
57
+ }
58
+ __name(setCredentialFeature, "setCredentialFeature");
59
+
46
60
  // src/submodules/client/setFeature.ts
47
61
  function setFeature(context, feature, value) {
48
62
  if (!context.__aws_sdk_context) {
@@ -58,5 +72,7 @@ __name(setFeature, "setFeature");
58
72
  // Annotate the CommonJS export names for ESM import in node:
59
73
  0 && (module.exports = {
60
74
  emitWarningIfUnsupportedVersion,
61
- setFeature
75
+ setCredentialFeature,
76
+ setFeature,
77
+ state
62
78
  });
@@ -191,11 +191,14 @@ var NODE_SIGV4A_CONFIG_OPTIONS = {
191
191
  };
192
192
 
193
193
  // src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts
194
+ var import_client = require("@aws-sdk/core/client");
194
195
  var import_core2 = require("@smithy/core");
195
196
  var import_signature_v4 = require("@smithy/signature-v4");
196
197
  var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
198
+ let isUserSupplied = false;
197
199
  let normalizedCreds;
198
200
  if (config.credentials) {
201
+ isUserSupplied = true;
199
202
  normalizedCreds = (0, import_core2.memoizeIdentityProvider)(config.credentials, import_core2.isIdentityExpired, import_core2.doesIdentityRequireRefresh);
200
203
  }
201
204
  if (!normalizedCreds) {
@@ -280,7 +283,9 @@ var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
280
283
  ...config,
281
284
  systemClockOffset,
282
285
  signingEscapePath,
283
- credentials: normalizedCreds,
286
+ credentials: isUserSupplied ? async () => normalizedCreds().then(
287
+ (creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_CODE", "e")
288
+ ) : normalizedCreds,
284
289
  signer
285
290
  };
286
291
  }, "resolveAwsSdkSigV4Config");
@@ -1,7 +1,9 @@
1
- let warningEmitted = false;
1
+ export const state = {
2
+ warningEmitted: false,
3
+ };
2
4
  export const emitWarningIfUnsupportedVersion = (version) => {
3
- if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
4
- warningEmitted = true;
5
+ if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
6
+ state.warningEmitted = true;
5
7
  process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
6
8
  no longer support Node.js 16.x on January 6, 2025.
7
9
 
@@ -1,2 +1,3 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export * from "./setCredentialFeature";
2
3
  export * from "./setFeature";
@@ -0,0 +1,7 @@
1
+ export function setCredentialFeature(credentials, feature, value) {
2
+ if (!credentials.$source) {
3
+ credentials.$source = {};
4
+ }
5
+ credentials.$source[feature] = value;
6
+ return credentials;
7
+ }
@@ -1,8 +1,11 @@
1
+ import { setCredentialFeature } from "@aws-sdk/core/client";
1
2
  import { doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider, normalizeProvider, } from "@smithy/core";
2
3
  import { SignatureV4 } from "@smithy/signature-v4";
3
4
  export const resolveAwsSdkSigV4Config = (config) => {
5
+ let isUserSupplied = false;
4
6
  let normalizedCreds;
5
7
  if (config.credentials) {
8
+ isUserSupplied = true;
6
9
  normalizedCreds = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh);
7
10
  }
8
11
  if (!normalizedCreds) {
@@ -75,7 +78,9 @@ export const resolveAwsSdkSigV4Config = (config) => {
75
78
  ...config,
76
79
  systemClockOffset,
77
80
  signingEscapePath,
78
- credentials: normalizedCreds,
81
+ credentials: isUserSupplied
82
+ ? async () => normalizedCreds().then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e"))
83
+ : normalizedCreds,
79
84
  signer,
80
85
  };
81
86
  };
@@ -1,3 +1,6 @@
1
+ export declare const state: {
2
+ warningEmitted: boolean;
3
+ };
1
4
  /**
2
5
  * @internal
3
6
  *
@@ -1,2 +1,3 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export * from "./setCredentialFeature";
2
3
  export * from "./setFeature";
@@ -0,0 +1,7 @@
1
+ import type { AttributedAwsCredentialIdentity, AwsSdkCredentialsFeatures } from "@aws-sdk/types";
2
+ /**
3
+ * @internal
4
+ *
5
+ * @returns the credentials with source feature attribution.
6
+ */
7
+ export declare function setCredentialFeature<F extends keyof AwsSdkCredentialsFeatures>(credentials: AttributedAwsCredentialIdentity, feature: F, value: AwsSdkCredentialsFeatures[F]): AttributedAwsCredentialIdentity;
@@ -1 +1,4 @@
1
+ export declare const state: {
2
+ warningEmitted: boolean;
3
+ };
1
4
  export declare const emitWarningIfUnsupportedVersion: (version: string) => void;
@@ -1,2 +1,3 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export * from "./setCredentialFeature";
2
3
  export * from "./setFeature";
@@ -0,0 +1,11 @@
1
+ import {
2
+ AttributedAwsCredentialIdentity,
3
+ AwsSdkCredentialsFeatures,
4
+ } from "@aws-sdk/types";
5
+ export declare function setCredentialFeature<
6
+ F extends keyof AwsSdkCredentialsFeatures
7
+ >(
8
+ credentials: AttributedAwsCredentialIdentity,
9
+ feature: F,
10
+ value: AwsSdkCredentialsFeatures[F]
11
+ ): AttributedAwsCredentialIdentity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.666.0",
3
+ "version": "3.677.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients.",
5
5
  "scripts": {
6
6
  "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
@@ -12,8 +12,8 @@
12
12
  "lint": "node ./scripts/lint.js",
13
13
  "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
14
14
  "extract:docs": "api-extractor run --local",
15
- "test": "jest",
16
- "test:integration": "jest -c jest.config.integ.js"
15
+ "test": "vitest run",
16
+ "test:integration": "vitest run -c vitest.config.integ.ts"
17
17
  },
18
18
  "main": "./dist-cjs/index.js",
19
19
  "module": "./dist-es/index.js",
@@ -79,7 +79,7 @@
79
79
  },
80
80
  "license": "Apache-2.0",
81
81
  "dependencies": {
82
- "@aws-sdk/types": "3.664.0",
82
+ "@aws-sdk/types": "3.667.0",
83
83
  "@smithy/core": "^2.4.8",
84
84
  "@smithy/node-config-provider": "^3.1.8",
85
85
  "@smithy/property-provider": "^3.1.7",