@aws-sdk/client-dynamodb 3.654.0 → 3.656.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.
@@ -6,7 +6,7 @@ const util_endpoints_2 = require("@smithy/util-endpoints");
6
6
  const ruleset_1 = require("./ruleset");
7
7
  const cache = new util_endpoints_2.EndpointCache({
8
8
  size: 50,
9
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
9
+ params: ["AccountId", "AccountIdEndpointMode", "Endpoint", "Region", "UseDualStack", "UseFIPS"],
10
10
  });
11
11
  const defaultEndpointResolver = (endpointParams, context = {}) => {
12
12
  return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ruleSet = void 0;
4
- const w = "required", x = "fn", y = "argv", z = "ref";
5
- const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = "stringEquals", j = { [w]: false, "type": "String" }, k = { [w]: true, "default": false, "type": "Boolean" }, l = { [z]: "Endpoint" }, m = { [x]: c, [y]: [{ [z]: "UseFIPS" }, true] }, n = { [x]: c, [y]: [{ [z]: "UseDualStack" }, true] }, o = {}, p = { [z]: "Region" }, q = { [x]: h, [y]: [{ [z]: g }, "supportsFIPS"] }, r = { [z]: g }, s = { [x]: c, [y]: [true, { [x]: h, [y]: [r, "supportsDualStack"] }] }, t = [m], u = [n], v = [p];
6
- const _data = { version: "1.0", parameters: { Region: j, UseDualStack: k, UseFIPS: k, Endpoint: j }, rules: [{ conditions: [{ [x]: b, [y]: [l] }], rules: [{ conditions: t, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: u, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: l, properties: o, headers: o }, type: e }], type: f }, { conditions: [{ [x]: b, [y]: v }], rules: [{ conditions: [{ [x]: "aws.partition", [y]: v, assign: g }], rules: [{ conditions: [m, n], rules: [{ conditions: [{ [x]: c, [y]: [a, q] }, s], rules: [{ endpoint: { url: "https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: o, headers: o }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: t, rules: [{ conditions: [{ [x]: c, [y]: [q, a] }], rules: [{ conditions: [{ [x]: i, [y]: [{ [x]: h, [y]: [r, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://dynamodb.{Region}.amazonaws.com", properties: o, headers: o }, type: e }, { endpoint: { url: "https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", properties: o, headers: o }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: u, rules: [{ conditions: [s], rules: [{ endpoint: { url: "https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: o, headers: o }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { conditions: [{ [x]: i, [y]: [p, "local"] }], endpoint: { url: "http://localhost:8000", properties: { authSchemes: [{ name: "sigv4", signingName: "dynamodb", signingRegion: "us-east-1" }] }, headers: o }, type: e }, { endpoint: { url: "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", properties: o, headers: o }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
4
+ const H = "required", I = "type", J = "fn", K = "argv", L = "ref", M = "url", N = "properties", O = "headers";
5
+ const a = false, b = "isSet", c = "error", d = "endpoint", e = "tree", f = "PartitionResult", g = "stringEquals", h = "not", i = { [H]: false, [I]: "String" }, j = { [H]: true, "default": false, [I]: "Boolean" }, k = { [J]: "booleanEquals", [K]: [{ [L]: "UseFIPS" }, true] }, l = { [J]: "booleanEquals", [K]: [{ [L]: "UseDualStack" }, true] }, m = {}, n = { [L]: "Region" }, o = { [J]: b, [K]: [{ [L]: "AccountIdEndpointMode" }] }, p = { [L]: "AccountIdEndpointMode" }, q = { [J]: b, [K]: [{ [L]: "AccountId" }] }, r = { [L]: "AccountId" }, s = { [J]: g, [K]: [{ [J]: "getAttr", [K]: [{ [L]: f }, "name"] }, "aws"] }, t = { [J]: "getAttr", [K]: [{ [L]: f }, "name"] }, u = { [J]: h, [K]: [k] }, v = { [J]: h, [K]: [l] }, w = { [J]: "booleanEquals", [K]: [{ [J]: "getAttr", [K]: [{ [L]: f }, "supportsFIPS"] }, true] }, x = { [J]: "booleanEquals", [K]: [{ [J]: "getAttr", [K]: [{ [L]: f }, "supportsDualStack"] }, true] }, y = { [M]: "https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", [N]: {}, [O]: {} }, z = { "conditions": [o, { [J]: g, [K]: [p, "disabled"] }], [d]: { [M]: "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", [N]: {}, [O]: {} }, [I]: d }, A = { [d]: { [M]: "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", [N]: {}, [O]: {} }, [I]: d }, B = { [M]: "https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", [N]: {}, [O]: {} }, C = { [M]: "https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", [N]: {}, [O]: {} }, D = [k], E = [l], F = [n], G = [o, { [J]: g, [K]: [p, "disabled"] }];
6
+ const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i, AccountId: i, AccountIdEndpointMode: i }, rules: [{ conditions: [{ [J]: b, [K]: [{ [L]: "Endpoint" }] }], rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [I]: c }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [I]: c }, { endpoint: { [M]: "{Endpoint}", [N]: m, [O]: m }, [I]: d }], [I]: e }, { conditions: [{ [J]: b, [K]: F }], rules: [{ conditions: [{ [J]: "aws.partition", [K]: F, assign: f }], rules: [{ conditions: [{ [J]: g, [K]: [n, "local"] }], rules: [{ conditions: D, error: "Invalid Configuration: FIPS and local endpoint are not supported", [I]: c }, { conditions: E, error: "Invalid Configuration: Dualstack and local endpoint are not supported", [I]: c }, { endpoint: { [M]: "http://localhost:8000", [N]: { authSchemes: [{ name: "sigv4", signingName: "dynamodb", signingRegion: "us-east-1" }] }, [O]: m }, [I]: d }], [I]: e }, { conditions: [o, { [J]: g, [K]: [p, "required"] }, { [J]: h, [K]: [q] }], error: "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded.", [I]: c }, { conditions: [q, s, u, v, { [J]: h, [K]: [{ [J]: "isValidHostLabel", [K]: [r, a] }] }], error: "Credentials-sourced account ID parameter is invalid", [I]: c }, { conditions: [k, l], rules: [{ conditions: [w, x], rules: [{ conditions: G, endpoint: y, [I]: d }, { endpoint: y, [I]: d }], [I]: e }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [I]: c }], [I]: e }, { conditions: D, rules: [{ conditions: [w], rules: [{ conditions: [{ [J]: g, [K]: [t, "aws-us-gov"] }], rules: [z, A], [I]: e }, { conditions: G, endpoint: B, [I]: d }, { endpoint: B, [I]: d }], [I]: e }, { error: "FIPS is enabled but this partition does not support FIPS", [I]: c }], [I]: e }, { conditions: E, rules: [{ conditions: [x], rules: [{ conditions: G, endpoint: C, [I]: d }, { endpoint: C, [I]: d }], [I]: e }, { error: "DualStack is enabled but this partition does not support DualStack", [I]: c }], [I]: e }, z, { conditions: [q, s, u, v], endpoint: { [M]: "https://{AccountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", [N]: m, [O]: m }, [I]: d }, A], [I]: e }], [I]: e }, { error: "Invalid Configuration: Missing Region", [I]: c }] };
7
7
  exports.ruleSet = _data;
package/dist-cjs/index.js CHANGED
@@ -198,9 +198,11 @@ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
198
198
  }, "resolveClientEndpointParameters");
199
199
  var commonParams = {
200
200
  UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
201
+ AccountId: { type: "builtInParams", name: "accountId" },
201
202
  Endpoint: { type: "builtInParams", name: "endpoint" },
202
203
  Region: { type: "builtInParams", name: "region" },
203
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
204
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
205
+ AccountIdEndpointMode: { type: "builtInParams", name: "accountIdEndpointMode" }
204
206
  };
205
207
 
206
208
  // src/protocols/Aws_json1_0.ts
@@ -4,6 +4,7 @@ exports.getRuntimeConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
6
  const sha256_browser_1 = require("@aws-crypto/sha256-browser");
7
+ const account_id_endpoint_1 = require("@aws-sdk/core/account-id-endpoint");
7
8
  const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
8
9
  const config_resolver_1 = require("@smithy/config-resolver");
9
10
  const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
@@ -22,6 +23,7 @@ const getRuntimeConfig = (config) => {
22
23
  ...config,
23
24
  runtime: "browser",
24
25
  defaultsMode,
26
+ accountIdEndpointMode: config?.accountIdEndpointMode ?? (() => Promise.resolve(account_id_endpoint_1.DEFAULT_ACCOUNT_ID_ENDPOINT_MODE)),
25
27
  bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
26
28
  credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
27
29
  defaultUserAgentProvider: config?.defaultUserAgentProvider ??
@@ -4,6 +4,7 @@ exports.getRuntimeConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
6
  const core_1 = require("@aws-sdk/core");
7
+ const account_id_endpoint_1 = require("@aws-sdk/core/account-id-endpoint");
7
8
  const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
8
9
  const middleware_endpoint_discovery_1 = require("@aws-sdk/middleware-endpoint-discovery");
9
10
  const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
@@ -29,6 +30,7 @@ const getRuntimeConfig = (config) => {
29
30
  ...config,
30
31
  runtime: "node",
31
32
  defaultsMode,
33
+ accountIdEndpointMode: config?.accountIdEndpointMode ?? (0, node_config_provider_1.loadConfig)(account_id_endpoint_1.NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS),
32
34
  bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
33
35
  credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,
34
36
  defaultUserAgentProvider: config?.defaultUserAgentProvider ??
@@ -8,7 +8,9 @@ export const resolveClientEndpointParameters = (options) => {
8
8
  };
9
9
  export const commonParams = {
10
10
  UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ AccountId: { type: "builtInParams", name: "accountId" },
11
12
  Endpoint: { type: "builtInParams", name: "endpoint" },
12
13
  Region: { type: "builtInParams", name: "region" },
13
14
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
15
+ AccountIdEndpointMode: { type: "builtInParams", name: "accountIdEndpointMode" },
14
16
  };
@@ -3,7 +3,7 @@ import { customEndpointFunctions, EndpointCache, resolveEndpoint } from "@smithy
3
3
  import { ruleSet } from "./ruleset";
4
4
  const cache = new EndpointCache({
5
5
  size: 50,
6
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
6
+ params: ["AccountId", "AccountIdEndpointMode", "Endpoint", "Region", "UseDualStack", "UseFIPS"],
7
7
  });
8
8
  export const defaultEndpointResolver = (endpointParams, context = {}) => {
9
9
  return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
@@ -1,4 +1,4 @@
1
- const w = "required", x = "fn", y = "argv", z = "ref";
2
- const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = "stringEquals", j = { [w]: false, "type": "String" }, k = { [w]: true, "default": false, "type": "Boolean" }, l = { [z]: "Endpoint" }, m = { [x]: c, [y]: [{ [z]: "UseFIPS" }, true] }, n = { [x]: c, [y]: [{ [z]: "UseDualStack" }, true] }, o = {}, p = { [z]: "Region" }, q = { [x]: h, [y]: [{ [z]: g }, "supportsFIPS"] }, r = { [z]: g }, s = { [x]: c, [y]: [true, { [x]: h, [y]: [r, "supportsDualStack"] }] }, t = [m], u = [n], v = [p];
3
- const _data = { version: "1.0", parameters: { Region: j, UseDualStack: k, UseFIPS: k, Endpoint: j }, rules: [{ conditions: [{ [x]: b, [y]: [l] }], rules: [{ conditions: t, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: u, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: l, properties: o, headers: o }, type: e }], type: f }, { conditions: [{ [x]: b, [y]: v }], rules: [{ conditions: [{ [x]: "aws.partition", [y]: v, assign: g }], rules: [{ conditions: [m, n], rules: [{ conditions: [{ [x]: c, [y]: [a, q] }, s], rules: [{ endpoint: { url: "https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: o, headers: o }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: t, rules: [{ conditions: [{ [x]: c, [y]: [q, a] }], rules: [{ conditions: [{ [x]: i, [y]: [{ [x]: h, [y]: [r, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://dynamodb.{Region}.amazonaws.com", properties: o, headers: o }, type: e }, { endpoint: { url: "https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", properties: o, headers: o }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: u, rules: [{ conditions: [s], rules: [{ endpoint: { url: "https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: o, headers: o }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { conditions: [{ [x]: i, [y]: [p, "local"] }], endpoint: { url: "http://localhost:8000", properties: { authSchemes: [{ name: "sigv4", signingName: "dynamodb", signingRegion: "us-east-1" }] }, headers: o }, type: e }, { endpoint: { url: "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", properties: o, headers: o }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
1
+ const H = "required", I = "type", J = "fn", K = "argv", L = "ref", M = "url", N = "properties", O = "headers";
2
+ const a = false, b = "isSet", c = "error", d = "endpoint", e = "tree", f = "PartitionResult", g = "stringEquals", h = "not", i = { [H]: false, [I]: "String" }, j = { [H]: true, "default": false, [I]: "Boolean" }, k = { [J]: "booleanEquals", [K]: [{ [L]: "UseFIPS" }, true] }, l = { [J]: "booleanEquals", [K]: [{ [L]: "UseDualStack" }, true] }, m = {}, n = { [L]: "Region" }, o = { [J]: b, [K]: [{ [L]: "AccountIdEndpointMode" }] }, p = { [L]: "AccountIdEndpointMode" }, q = { [J]: b, [K]: [{ [L]: "AccountId" }] }, r = { [L]: "AccountId" }, s = { [J]: g, [K]: [{ [J]: "getAttr", [K]: [{ [L]: f }, "name"] }, "aws"] }, t = { [J]: "getAttr", [K]: [{ [L]: f }, "name"] }, u = { [J]: h, [K]: [k] }, v = { [J]: h, [K]: [l] }, w = { [J]: "booleanEquals", [K]: [{ [J]: "getAttr", [K]: [{ [L]: f }, "supportsFIPS"] }, true] }, x = { [J]: "booleanEquals", [K]: [{ [J]: "getAttr", [K]: [{ [L]: f }, "supportsDualStack"] }, true] }, y = { [M]: "https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", [N]: {}, [O]: {} }, z = { "conditions": [o, { [J]: g, [K]: [p, "disabled"] }], [d]: { [M]: "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", [N]: {}, [O]: {} }, [I]: d }, A = { [d]: { [M]: "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", [N]: {}, [O]: {} }, [I]: d }, B = { [M]: "https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", [N]: {}, [O]: {} }, C = { [M]: "https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", [N]: {}, [O]: {} }, D = [k], E = [l], F = [n], G = [o, { [J]: g, [K]: [p, "disabled"] }];
3
+ const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i, AccountId: i, AccountIdEndpointMode: i }, rules: [{ conditions: [{ [J]: b, [K]: [{ [L]: "Endpoint" }] }], rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [I]: c }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [I]: c }, { endpoint: { [M]: "{Endpoint}", [N]: m, [O]: m }, [I]: d }], [I]: e }, { conditions: [{ [J]: b, [K]: F }], rules: [{ conditions: [{ [J]: "aws.partition", [K]: F, assign: f }], rules: [{ conditions: [{ [J]: g, [K]: [n, "local"] }], rules: [{ conditions: D, error: "Invalid Configuration: FIPS and local endpoint are not supported", [I]: c }, { conditions: E, error: "Invalid Configuration: Dualstack and local endpoint are not supported", [I]: c }, { endpoint: { [M]: "http://localhost:8000", [N]: { authSchemes: [{ name: "sigv4", signingName: "dynamodb", signingRegion: "us-east-1" }] }, [O]: m }, [I]: d }], [I]: e }, { conditions: [o, { [J]: g, [K]: [p, "required"] }, { [J]: h, [K]: [q] }], error: "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded.", [I]: c }, { conditions: [q, s, u, v, { [J]: h, [K]: [{ [J]: "isValidHostLabel", [K]: [r, a] }] }], error: "Credentials-sourced account ID parameter is invalid", [I]: c }, { conditions: [k, l], rules: [{ conditions: [w, x], rules: [{ conditions: G, endpoint: y, [I]: d }, { endpoint: y, [I]: d }], [I]: e }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [I]: c }], [I]: e }, { conditions: D, rules: [{ conditions: [w], rules: [{ conditions: [{ [J]: g, [K]: [t, "aws-us-gov"] }], rules: [z, A], [I]: e }, { conditions: G, endpoint: B, [I]: d }, { endpoint: B, [I]: d }], [I]: e }, { error: "FIPS is enabled but this partition does not support FIPS", [I]: c }], [I]: e }, { conditions: E, rules: [{ conditions: [x], rules: [{ conditions: G, endpoint: C, [I]: d }, { endpoint: C, [I]: d }], [I]: e }, { error: "DualStack is enabled but this partition does not support DualStack", [I]: c }], [I]: e }, z, { conditions: [q, s, u, v], endpoint: { [M]: "https://{AccountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", [N]: m, [O]: m }, [I]: d }, A], [I]: e }], [I]: e }, { error: "Invalid Configuration: Missing Region", [I]: c }] };
4
4
  export const ruleSet = _data;
@@ -1,5 +1,6 @@
1
1
  import packageInfo from "../package.json";
2
2
  import { Sha256 } from "@aws-crypto/sha256-browser";
3
+ import { DEFAULT_ACCOUNT_ID_ENDPOINT_MODE } from "@aws-sdk/core/account-id-endpoint";
3
4
  import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
4
5
  import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
5
6
  import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
@@ -18,6 +19,7 @@ export const getRuntimeConfig = (config) => {
18
19
  ...config,
19
20
  runtime: "browser",
20
21
  defaultsMode,
22
+ accountIdEndpointMode: config?.accountIdEndpointMode ?? (() => Promise.resolve(DEFAULT_ACCOUNT_ID_ENDPOINT_MODE)),
21
23
  bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
22
24
  credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
23
25
  defaultUserAgentProvider: config?.defaultUserAgentProvider ??
@@ -1,5 +1,6 @@
1
1
  import packageInfo from "../package.json";
2
2
  import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
3
+ import { NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS } from "@aws-sdk/core/account-id-endpoint";
3
4
  import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
4
5
  import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "@aws-sdk/middleware-endpoint-discovery";
5
6
  import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
@@ -25,6 +26,7 @@ export const getRuntimeConfig = (config) => {
25
26
  ...config,
26
27
  runtime: "node",
27
28
  defaultsMode,
29
+ accountIdEndpointMode: config?.accountIdEndpointMode ?? loadNodeConfig(NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS),
28
30
  bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
29
31
  credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
30
32
  defaultUserAgentProvider: config?.defaultUserAgentProvider ??
@@ -1,3 +1,4 @@
1
+ import { AccountIdEndpointMode } from "@aws-sdk/core/account-id-endpoint";
1
2
  import { EndpointDiscoveryInputConfig, EndpointDiscoveryResolvedConfig } from "@aws-sdk/middleware-endpoint-discovery";
2
3
  import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
3
4
  import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
@@ -152,6 +153,10 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
152
153
  * The AWS region to which this client will send requests
153
154
  */
154
155
  region?: string | __Provider<string>;
156
+ /**
157
+ * Defines if the AWS AccountId will be used for endpoint routing.
158
+ */
159
+ accountIdEndpointMode?: AccountIdEndpointMode | __Provider<AccountIdEndpointMode>;
155
160
  /**
156
161
  * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
157
162
  * @internal
@@ -7,6 +7,8 @@ export interface ClientInputEndpointParameters {
7
7
  useDualstackEndpoint?: boolean | Provider<boolean>;
8
8
  useFipsEndpoint?: boolean | Provider<boolean>;
9
9
  endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
10
+ accountId?: string | Provider<string>;
11
+ accountIdEndpointMode?: string | Provider<string>;
10
12
  }
11
13
  export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & {
12
14
  defaultSigningName: string;
@@ -19,6 +21,10 @@ export declare const commonParams: {
19
21
  readonly type: "builtInParams";
20
22
  readonly name: "useFipsEndpoint";
21
23
  };
24
+ readonly AccountId: {
25
+ readonly type: "builtInParams";
26
+ readonly name: "accountId";
27
+ };
22
28
  readonly Endpoint: {
23
29
  readonly type: "builtInParams";
24
30
  readonly name: "endpoint";
@@ -31,10 +37,16 @@ export declare const commonParams: {
31
37
  readonly type: "builtInParams";
32
38
  readonly name: "useDualstackEndpoint";
33
39
  };
40
+ readonly AccountIdEndpointMode: {
41
+ readonly type: "builtInParams";
42
+ readonly name: "accountIdEndpointMode";
43
+ };
34
44
  };
35
45
  export interface EndpointParameters extends __EndpointParameters {
36
46
  Region?: string;
37
47
  UseDualStack?: boolean;
38
48
  UseFIPS?: boolean;
39
49
  Endpoint?: string;
50
+ AccountId?: string;
51
+ AccountIdEndpointMode?: string;
40
52
  }
@@ -6,6 +6,7 @@ import { DynamoDBClientConfig } from "./DynamoDBClient";
6
6
  export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
7
7
  runtime: string;
8
8
  defaultsMode: import("@smithy/types").Provider<import("@smithy/smithy-client").ResolvedDefaultsMode>;
9
+ accountIdEndpointMode: "disabled" | "preferred" | "required" | (() => Promise<string>);
9
10
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
10
11
  credentialDefaultProvider: (input: any) => import("@smithy/types").AwsCredentialIdentityProvider;
11
12
  defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
@@ -47,4 +48,5 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
47
48
  signerConstructor?: (new (options: import("@smithy/signature-v4").SignatureV4Init & import("@smithy/signature-v4").SignatureV4CryptoInit) => import("@smithy/types").RequestSigner) | undefined;
48
49
  endpointCacheSize?: number | undefined;
49
50
  endpointDiscoveryEnabled?: boolean | undefined;
51
+ accountId?: string | import("@smithy/types").Provider<string> | undefined;
50
52
  };
@@ -6,6 +6,7 @@ import { DynamoDBClientConfig } from "./DynamoDBClient";
6
6
  export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
7
7
  runtime: string;
8
8
  defaultsMode: import("@smithy/types").Provider<import("@smithy/smithy-client").ResolvedDefaultsMode>;
9
+ accountIdEndpointMode: "disabled" | "preferred" | "required" | import("@smithy/types").Provider<import("@aws-sdk/core/account-id-endpoint").AccountIdEndpointMode>;
9
10
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
10
11
  credentialDefaultProvider: (init?: import("@aws-sdk/credential-provider-node").DefaultProviderInit | undefined) => import("@smithy/types").MemoizedProvider<import("@smithy/types").AwsCredentialIdentity>;
11
12
  defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
@@ -47,4 +48,5 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
47
48
  signerConstructor?: (new (options: import("@smithy/signature-v4").SignatureV4Init & import("@smithy/signature-v4").SignatureV4CryptoInit) => import("@smithy/types").RequestSigner) | undefined;
48
49
  endpointCacheSize?: number | undefined;
49
50
  endpointDiscoveryEnabled?: boolean | undefined;
51
+ accountId?: string | import("@smithy/types").Provider<string> | undefined;
50
52
  };
@@ -20,6 +20,7 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
20
20
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
21
21
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
22
22
  region: string | import("@smithy/types").Provider<any>;
23
+ accountIdEndpointMode: "disabled" | "preferred" | "required" | (() => Promise<string>);
23
24
  defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
24
25
  credentialDefaultProvider: (input: any) => import("@smithy/types").AwsCredentialIdentityProvider;
25
26
  maxAttempts: number | import("@smithy/types").Provider<number>;
@@ -46,4 +47,5 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
46
47
  signerConstructor?: (new (options: import("@smithy/signature-v4").SignatureV4Init & import("@smithy/signature-v4").SignatureV4CryptoInit) => import("@smithy/types").RequestSigner) | undefined;
47
48
  endpointCacheSize?: number | undefined;
48
49
  endpointDiscoveryEnabled?: boolean | undefined;
50
+ accountId?: string | import("@smithy/types").Provider<string> | undefined;
49
51
  };
@@ -1,3 +1,4 @@
1
+ import { AccountIdEndpointMode } from "@aws-sdk/core/account-id-endpoint";
1
2
  import {
2
3
  EndpointDiscoveryInputConfig,
3
4
  EndpointDiscoveryResolvedConfig,
@@ -411,6 +412,9 @@ export interface ClientDefaults
411
412
  useDualstackEndpoint?: boolean | __Provider<boolean>;
412
413
  useFipsEndpoint?: boolean | __Provider<boolean>;
413
414
  region?: string | __Provider<string>;
415
+ accountIdEndpointMode?:
416
+ | AccountIdEndpointMode
417
+ | __Provider<AccountIdEndpointMode>;
414
418
  defaultUserAgentProvider?: Provider<__UserAgent>;
415
419
  credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
416
420
  maxAttempts?: number | __Provider<number>;
@@ -15,6 +15,8 @@ export interface ClientInputEndpointParameters {
15
15
  | Provider<Endpoint>
16
16
  | EndpointV2
17
17
  | Provider<EndpointV2>;
18
+ accountId?: string | Provider<string>;
19
+ accountIdEndpointMode?: string | Provider<string>;
18
20
  }
19
21
  export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & {
20
22
  defaultSigningName: string;
@@ -30,6 +32,10 @@ export declare const commonParams: {
30
32
  readonly type: "builtInParams";
31
33
  readonly name: "useFipsEndpoint";
32
34
  };
35
+ readonly AccountId: {
36
+ readonly type: "builtInParams";
37
+ readonly name: "accountId";
38
+ };
33
39
  readonly Endpoint: {
34
40
  readonly type: "builtInParams";
35
41
  readonly name: "endpoint";
@@ -42,10 +48,16 @@ export declare const commonParams: {
42
48
  readonly type: "builtInParams";
43
49
  readonly name: "useDualstackEndpoint";
44
50
  };
51
+ readonly AccountIdEndpointMode: {
52
+ readonly type: "builtInParams";
53
+ readonly name: "accountIdEndpointMode";
54
+ };
45
55
  };
46
56
  export interface EndpointParameters extends __EndpointParameters {
47
57
  Region?: string;
48
58
  UseDualStack?: boolean;
49
59
  UseFIPS?: boolean;
50
60
  Endpoint?: string;
61
+ AccountId?: string;
62
+ AccountIdEndpointMode?: string;
51
63
  }
@@ -5,6 +5,11 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
5
5
  defaultsMode: import("@smithy/types").Provider<
6
6
  import("@smithy/smithy-client").ResolvedDefaultsMode
7
7
  >;
8
+ accountIdEndpointMode:
9
+ | "disabled"
10
+ | "preferred"
11
+ | "required"
12
+ | (() => Promise<string>);
8
13
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
9
14
  credentialDefaultProvider: (
10
15
  input: any
@@ -89,4 +94,5 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
89
94
  | undefined;
90
95
  endpointCacheSize?: number | undefined;
91
96
  endpointDiscoveryEnabled?: boolean | undefined;
97
+ accountId?: string | import("@smithy/types").Provider<string> | undefined;
92
98
  };
@@ -5,6 +5,13 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
5
5
  defaultsMode: import("@smithy/types").Provider<
6
6
  import("@smithy/smithy-client").ResolvedDefaultsMode
7
7
  >;
8
+ accountIdEndpointMode:
9
+ | "disabled"
10
+ | "preferred"
11
+ | "required"
12
+ | import("@smithy/types").Provider<
13
+ import("@aws-sdk/core/account-id-endpoint").AccountIdEndpointMode
14
+ >;
8
15
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
9
16
  credentialDefaultProvider: (
10
17
  init?:
@@ -93,4 +100,5 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
93
100
  | undefined;
94
101
  endpointCacheSize?: number | undefined;
95
102
  endpointDiscoveryEnabled?: boolean | undefined;
103
+ accountId?: string | import("@smithy/types").Provider<string> | undefined;
96
104
  };
@@ -22,6 +22,11 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
22
22
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
23
23
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
24
24
  region: string | import("@smithy/types").Provider<any>;
25
+ accountIdEndpointMode:
26
+ | "disabled"
27
+ | "preferred"
28
+ | "required"
29
+ | (() => Promise<string>);
25
30
  defaultUserAgentProvider: import("@smithy/types").Provider<
26
31
  import("@smithy/types").UserAgent
27
32
  >;
@@ -83,4 +88,5 @@ export declare const getRuntimeConfig: (config: DynamoDBClientConfig) => {
83
88
  | undefined;
84
89
  endpointCacheSize?: number | undefined;
85
90
  endpointDiscoveryEnabled?: boolean | undefined;
91
+ accountId?: string | import("@smithy/types").Provider<string> | undefined;
86
92
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-dynamodb",
3
3
  "description": "AWS SDK for JavaScript Dynamodb Client for Node.js, Browser and React Native",
4
- "version": "3.654.0",
4
+ "version": "3.656.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-dynamodb",