@aws-sdk/util-user-agent-node 3.183.0 → 3.186.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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/util-user-agent-node
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
15
 
8
16
  **Note:** Version bump only for package @aws-sdk/util-user-agent-node
package/dist-es/index.js CHANGED
@@ -1,37 +1,47 @@
1
+ import { __awaiter, __generator, __read, __spreadArray } from "tslib";
1
2
  import { loadConfig } from "@aws-sdk/node-config-provider";
2
3
  import { platform, release } from "os";
3
4
  import { env, versions } from "process";
4
5
  import { isCrtAvailable } from "./is-crt-available";
5
- export const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
6
- export const UA_APP_ID_INI_NAME = "sdk-ua-app-id";
7
- export const defaultUserAgent = ({ serviceId, clientVersion }) => {
8
- const sections = [
6
+ export var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
7
+ export var UA_APP_ID_INI_NAME = "sdk-ua-app-id";
8
+ export var defaultUserAgent = function (_a) {
9
+ var serviceId = _a.serviceId, clientVersion = _a.clientVersion;
10
+ var sections = [
9
11
  ["aws-sdk-js", clientVersion],
10
- [`os/${platform()}`, release()],
12
+ ["os/".concat(platform()), release()],
11
13
  ["lang/js"],
12
- ["md/nodejs", `${versions.node}`],
14
+ ["md/nodejs", "".concat(versions.node)],
13
15
  ];
14
- const crtAvailable = isCrtAvailable();
16
+ var crtAvailable = isCrtAvailable();
15
17
  if (crtAvailable) {
16
18
  sections.push(crtAvailable);
17
19
  }
18
20
  if (serviceId) {
19
- sections.push([`api/${serviceId}`, clientVersion]);
21
+ sections.push(["api/".concat(serviceId), clientVersion]);
20
22
  }
21
23
  if (env.AWS_EXECUTION_ENV) {
22
- sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]);
24
+ sections.push(["exec-env/".concat(env.AWS_EXECUTION_ENV)]);
23
25
  }
24
- const appIdPromise = loadConfig({
25
- environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME],
26
- configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME],
26
+ var appIdPromise = loadConfig({
27
+ environmentVariableSelector: function (env) { return env[UA_APP_ID_ENV_NAME]; },
28
+ configFileSelector: function (profile) { return profile[UA_APP_ID_INI_NAME]; },
27
29
  default: undefined,
28
30
  })();
29
- let resolvedUserAgent = undefined;
30
- return async () => {
31
- if (!resolvedUserAgent) {
32
- const appId = await appIdPromise;
33
- resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
34
- }
35
- return resolvedUserAgent;
36
- };
31
+ var resolvedUserAgent = undefined;
32
+ return function () { return __awaiter(void 0, void 0, void 0, function () {
33
+ var appId;
34
+ return __generator(this, function (_a) {
35
+ switch (_a.label) {
36
+ case 0:
37
+ if (!!resolvedUserAgent) return [3, 2];
38
+ return [4, appIdPromise];
39
+ case 1:
40
+ appId = _a.sent();
41
+ resolvedUserAgent = appId ? __spreadArray(__spreadArray([], __read(sections), false), [["app/".concat(appId)]], false) : __spreadArray([], __read(sections), false);
42
+ _a.label = 2;
43
+ case 2: return [2, resolvedUserAgent];
44
+ }
45
+ });
46
+ }); };
37
47
  };
@@ -1,4 +1,4 @@
1
- export const isCrtAvailable = () => {
1
+ export var isCrtAvailable = function () {
2
2
  try {
3
3
  if (typeof require === "function" && typeof module !== "undefined" && module.require && require("aws-crt")) {
4
4
  return ["md/crt-avail"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-user-agent-node",
3
- "version": "3.183.0",
3
+ "version": "3.186.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,12 +20,12 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/node-config-provider": "3.183.0",
24
- "@aws-sdk/types": "3.183.0",
23
+ "@aws-sdk/node-config-provider": "3.186.0",
24
+ "@aws-sdk/types": "3.186.0",
25
25
  "tslib": "^2.3.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@aws-sdk/protocol-http": "3.183.0",
28
+ "@aws-sdk/protocol-http": "3.186.0",
29
29
  "@tsconfig/recommended": "1.0.1",
30
30
  "@types/node": "^10.0.0",
31
31
  "concurrently": "7.0.0",