@aws-sdk/middleware-user-agent 3.290.0 → 3.293.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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getUserAgentPlugin = exports.getUserAgentMiddlewareOptions = exports.userAgentMiddleware = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
+ const util_endpoints_1 = require("@aws-sdk/util-endpoints");
5
6
  const constants_1 = require("./constants");
6
7
  const userAgentMiddleware = (options) => (next, context) => async (args) => {
7
8
  var _a, _b;
@@ -12,7 +13,10 @@ const userAgentMiddleware = (options) => (next, context) => async (args) => {
12
13
  const userAgent = ((_a = context === null || context === void 0 ? void 0 : context.userAgent) === null || _a === void 0 ? void 0 : _a.map(escapeUserAgent)) || [];
13
14
  const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
14
15
  const customUserAgent = ((_b = options === null || options === void 0 ? void 0 : options.customUserAgent) === null || _b === void 0 ? void 0 : _b.map(escapeUserAgent)) || [];
15
- const sdkUserAgentValue = [...defaultUserAgent, ...userAgent, ...customUserAgent].join(constants_1.SPACE);
16
+ const prefix = (0, util_endpoints_1.getUserAgentPrefix)();
17
+ const sdkUserAgentValue = (prefix ? [prefix] : [])
18
+ .concat([...defaultUserAgent, ...userAgent, ...customUserAgent])
19
+ .join(constants_1.SPACE);
16
20
  const normalUAValue = [
17
21
  ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
18
22
  ...customUserAgent,
@@ -1,4 +1,5 @@
1
1
  import { HttpRequest } from "@aws-sdk/protocol-http";
2
+ import { getUserAgentPrefix } from "@aws-sdk/util-endpoints";
2
3
  import { SPACE, UA_ESCAPE_REGEX, USER_AGENT, X_AMZ_USER_AGENT } from "./constants";
3
4
  export const userAgentMiddleware = (options) => (next, context) => async (args) => {
4
5
  const { request } = args;
@@ -8,7 +9,10 @@ export const userAgentMiddleware = (options) => (next, context) => async (args)
8
9
  const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
9
10
  const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
10
11
  const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
11
- const sdkUserAgentValue = [...defaultUserAgent, ...userAgent, ...customUserAgent].join(SPACE);
12
+ const prefix = getUserAgentPrefix();
13
+ const sdkUserAgentValue = (prefix ? [prefix] : [])
14
+ .concat([...defaultUserAgent, ...userAgent, ...customUserAgent])
15
+ .join(SPACE);
12
16
  const normalUAValue = [
13
17
  ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
14
18
  ...customUserAgent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-user-agent",
3
- "version": "3.290.0",
3
+ "version": "3.293.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -20,17 +20,18 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/protocol-http": "3.290.0",
24
- "@aws-sdk/types": "3.290.0",
23
+ "@aws-sdk/protocol-http": "3.292.0",
24
+ "@aws-sdk/types": "3.292.0",
25
+ "@aws-sdk/util-endpoints": "3.293.0",
25
26
  "tslib": "^2.3.1"
26
27
  },
27
28
  "devDependencies": {
28
- "@aws-sdk/middleware-stack": "3.290.0",
29
+ "@aws-sdk/middleware-stack": "3.292.0",
29
30
  "@tsconfig/recommended": "1.0.1",
30
31
  "concurrently": "7.0.0",
31
32
  "downlevel-dts": "0.10.1",
32
33
  "rimraf": "3.0.2",
33
- "typedoc": "0.19.2",
34
+ "typedoc": "0.23.23",
34
35
  "typescript": "~4.6.2"
35
36
  },
36
37
  "engines": {
@@ -51,5 +52,8 @@
51
52
  "type": "git",
52
53
  "url": "https://github.com/aws/aws-sdk-js-v3.git",
53
54
  "directory": "packages/middleware-user-agent"
55
+ },
56
+ "typedoc": {
57
+ "entryPoint": "src/index.ts"
54
58
  }
55
59
  }