@aws-sdk/middleware-endpoint-discovery 3.733.0 → 3.774.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
@@ -19,8 +19,8 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
 
21
21
  // src/index.ts
22
- var src_exports = {};
23
- __export(src_exports, {
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
24
  NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS: () => NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS,
25
25
  endpointDiscoveryMiddlewareOptions: () => endpointDiscoveryMiddlewareOptions,
26
26
  getEndpointDiscoveryOptionalPlugin: () => getEndpointDiscoveryOptionalPlugin,
@@ -28,14 +28,14 @@ __export(src_exports, {
28
28
  getEndpointDiscoveryRequiredPlugin: () => getEndpointDiscoveryRequiredPlugin,
29
29
  resolveEndpointDiscoveryConfig: () => resolveEndpointDiscoveryConfig
30
30
  });
31
- module.exports = __toCommonJS(src_exports);
31
+ module.exports = __toCommonJS(index_exports);
32
32
 
33
33
  // src/configurations.ts
34
34
  var ENV_ENDPOINT_DISCOVERY = ["AWS_ENABLE_ENDPOINT_DISCOVERY", "AWS_ENDPOINT_DISCOVERY_ENABLED"];
35
35
  var CONFIG_ENDPOINT_DISCOVERY = "endpoint_discovery_enabled";
36
36
  var isFalsy = /* @__PURE__ */ __name((value) => ["false", "0"].indexOf(value) >= 0, "isFalsy");
37
37
  var NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS = {
38
- environmentVariableSelector: (env) => {
38
+ environmentVariableSelector: /* @__PURE__ */ __name((env) => {
39
39
  for (let i = 0; i < ENV_ENDPOINT_DISCOVERY.length; i++) {
40
40
  const envKey = ENV_ENDPOINT_DISCOVERY[i];
41
41
  if (envKey in env) {
@@ -46,8 +46,8 @@ var NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS = {
46
46
  return !isFalsy(value);
47
47
  }
48
48
  }
49
- },
50
- configFileSelector: (profile) => {
49
+ }, "environmentVariableSelector"),
50
+ configFileSelector: /* @__PURE__ */ __name((profile) => {
51
51
  if (CONFIG_ENDPOINT_DISCOVERY in profile) {
52
52
  const value = profile[CONFIG_ENDPOINT_DISCOVERY];
53
53
  if (value === void 0) {
@@ -55,7 +55,7 @@ var NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS = {
55
55
  }
56
56
  return !isFalsy(value);
57
57
  }
58
- },
58
+ }, "configFileSelector"),
59
59
  default: void 0
60
60
  };
61
61
 
@@ -83,8 +83,7 @@ var updateDiscoveredEndpointInCache = /* @__PURE__ */ __name(async (config, opti
83
83
  const endpoints = endpointCache.get(cacheKey);
84
84
  if (endpoints && endpoints.length === 1 && endpoints[0].Address === "") {
85
85
  if (options.isDiscoveredEndpointRequired) {
86
- if (!requestQueue[cacheKey])
87
- requestQueue[cacheKey] = [];
86
+ if (!requestQueue[cacheKey]) requestQueue[cacheKey] = [];
88
87
  requestQueue[cacheKey].push({ resolve, reject });
89
88
  } else {
90
89
  resolve();
@@ -185,25 +184,25 @@ var endpointDiscoveryMiddlewareOptions = {
185
184
  override: true
186
185
  };
187
186
  var getEndpointDiscoveryPlugin = /* @__PURE__ */ __name((pluginConfig, middlewareConfig) => ({
188
- applyToStack: (commandStack) => {
187
+ applyToStack: /* @__PURE__ */ __name((commandStack) => {
189
188
  commandStack.add(endpointDiscoveryMiddleware(pluginConfig, middlewareConfig), endpointDiscoveryMiddlewareOptions);
190
- }
189
+ }, "applyToStack")
191
190
  }), "getEndpointDiscoveryPlugin");
192
191
  var getEndpointDiscoveryRequiredPlugin = /* @__PURE__ */ __name((pluginConfig, middlewareConfig) => ({
193
- applyToStack: (commandStack) => {
192
+ applyToStack: /* @__PURE__ */ __name((commandStack) => {
194
193
  commandStack.add(
195
194
  endpointDiscoveryMiddleware(pluginConfig, { ...middlewareConfig, isDiscoveredEndpointRequired: true }),
196
195
  endpointDiscoveryMiddlewareOptions
197
196
  );
198
- }
197
+ }, "applyToStack")
199
198
  }), "getEndpointDiscoveryRequiredPlugin");
200
199
  var getEndpointDiscoveryOptionalPlugin = /* @__PURE__ */ __name((pluginConfig, middlewareConfig) => ({
201
- applyToStack: (commandStack) => {
200
+ applyToStack: /* @__PURE__ */ __name((commandStack) => {
202
201
  commandStack.add(
203
202
  endpointDiscoveryMiddleware(pluginConfig, { ...middlewareConfig, isDiscoveredEndpointRequired: false }),
204
203
  endpointDiscoveryMiddlewareOptions
205
204
  );
206
- }
205
+ }, "applyToStack")
207
206
  }), "getEndpointDiscoveryOptionalPlugin");
208
207
 
209
208
  // src/resolveEndpointDiscoveryConfig.ts
@@ -1,2 +1,5 @@
1
1
  import { LoadedConfigSelectors } from "@smithy/node-config-provider";
2
+ /**
3
+ * @internal
4
+ */
2
5
  export declare const NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS: LoadedConfigSelectors<boolean | undefined>;
@@ -1,18 +1,29 @@
1
1
  import { BuildHandlerOptions, HttpHandlerOptions, MiddlewareStack, Pluggable } from "@smithy/types";
2
2
  import { EndpointDiscoveryResolvedConfig, PreviouslyResolved } from "./resolveEndpointDiscoveryConfig";
3
+ /**
4
+ * @internal
5
+ */
3
6
  export declare const endpointDiscoveryMiddlewareOptions: BuildHandlerOptions;
7
+ /**
8
+ * @public
9
+ */
4
10
  export interface EndpointDiscoveryMiddlewareConfig {
5
11
  isDiscoveredEndpointRequired: boolean;
6
12
  clientStack: MiddlewareStack<any, any>;
7
13
  options?: HttpHandlerOptions;
8
14
  identifiers?: Record<string, string>;
9
15
  }
16
+ /**
17
+ * @internal
18
+ */
10
19
  export declare const getEndpointDiscoveryPlugin: (pluginConfig: EndpointDiscoveryResolvedConfig & PreviouslyResolved, middlewareConfig: EndpointDiscoveryMiddlewareConfig) => Pluggable<any, any>;
11
20
  /**
21
+ * @internal
12
22
  * @deprecated Use getEndpointDiscoveryPlugin
13
23
  */
14
24
  export declare const getEndpointDiscoveryRequiredPlugin: (pluginConfig: EndpointDiscoveryResolvedConfig & PreviouslyResolved, middlewareConfig: Omit<EndpointDiscoveryMiddlewareConfig, "isDiscoveredEndpointRequired">) => Pluggable<any, any>;
15
25
  /**
26
+ * @internal
16
27
  * @deprecated Use getEndpointDiscoveryPlugin
17
28
  */
18
29
  export declare const getEndpointDiscoveryOptionalPlugin: (pluginConfig: EndpointDiscoveryResolvedConfig & PreviouslyResolved, middlewareConfig: Omit<EndpointDiscoveryMiddlewareConfig, "isDiscoveredEndpointRequired">) => Pluggable<any, any>;
@@ -1,5 +1,8 @@
1
1
  import { EndpointCache } from "@aws-sdk/endpoint-cache";
2
2
  import { AwsCredentialIdentity, MemoizedProvider, Provider } from "@smithy/types";
3
+ /**
4
+ * @internal
5
+ */
3
6
  export interface PreviouslyResolved {
4
7
  isCustomEndpoint?: boolean;
5
8
  credentials: MemoizedProvider<AwsCredentialIdentity>;
@@ -51,4 +54,7 @@ export interface EndpointDiscoveryConfigOptions {
51
54
  */
52
55
  endpointDiscoveryCommandCtor: new (comandConfig: any) => any;
53
56
  }
57
+ /**
58
+ * @internal
59
+ */
54
60
  export declare const resolveEndpointDiscoveryConfig: <T>(input: T & PreviouslyResolved & EndpointDiscoveryInputConfig, { endpointDiscoveryCommandCtor }: EndpointDiscoveryConfigOptions) => T & EndpointDiscoveryResolvedConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-endpoint-discovery",
3
- "version": "3.733.0",
3
+ "version": "3.774.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline middleware-endpoint-discovery",
@@ -9,6 +9,7 @@
9
9
  "build:types": "tsc -p tsconfig.types.json",
10
10
  "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
11
11
  "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
12
+ "extract:docs": "api-extractor run --local",
12
13
  "test": "yarn g:vitest run",
13
14
  "test:integration": "yarn g:vitest run -c vitest.config.integ.ts",
14
15
  "test:watch": "yarn g:vitest watch",
@@ -31,10 +32,10 @@
31
32
  },
32
33
  "dependencies": {
33
34
  "@aws-sdk/endpoint-cache": "3.723.0",
34
- "@aws-sdk/types": "3.731.0",
35
- "@smithy/node-config-provider": "^4.0.0",
36
- "@smithy/protocol-http": "^5.0.0",
37
- "@smithy/types": "^4.0.0",
35
+ "@aws-sdk/types": "3.734.0",
36
+ "@smithy/node-config-provider": "^4.0.1",
37
+ "@smithy/protocol-http": "^5.0.1",
38
+ "@smithy/types": "^4.1.0",
38
39
  "tslib": "^2.6.2"
39
40
  },
40
41
  "engines": {