@aws-sdk/util-user-agent-node 3.186.0 → 3.188.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 +8 -0
- package/dist-es/index.js +20 -30
- package/dist-es/is-crt-available.js +1 -1
- package/package.json +4 -4
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.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/util-user-agent-node
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-sdk/util-user-agent-node
|
package/dist-es/index.js
CHANGED
|
@@ -1,47 +1,37 @@
|
|
|
1
|
-
import { __awaiter, __generator, __read, __spreadArray } from "tslib";
|
|
2
1
|
import { loadConfig } from "@aws-sdk/node-config-provider";
|
|
3
2
|
import { platform, release } from "os";
|
|
4
3
|
import { env, versions } from "process";
|
|
5
4
|
import { isCrtAvailable } from "./is-crt-available";
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
var sections = [
|
|
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 = [
|
|
11
9
|
["aws-sdk-js", clientVersion],
|
|
12
|
-
[
|
|
10
|
+
[`os/${platform()}`, release()],
|
|
13
11
|
["lang/js"],
|
|
14
|
-
["md/nodejs",
|
|
12
|
+
["md/nodejs", `${versions.node}`],
|
|
15
13
|
];
|
|
16
|
-
|
|
14
|
+
const crtAvailable = isCrtAvailable();
|
|
17
15
|
if (crtAvailable) {
|
|
18
16
|
sections.push(crtAvailable);
|
|
19
17
|
}
|
|
20
18
|
if (serviceId) {
|
|
21
|
-
sections.push([
|
|
19
|
+
sections.push([`api/${serviceId}`, clientVersion]);
|
|
22
20
|
}
|
|
23
21
|
if (env.AWS_EXECUTION_ENV) {
|
|
24
|
-
sections.push([
|
|
22
|
+
sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]);
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
environmentVariableSelector:
|
|
28
|
-
configFileSelector:
|
|
24
|
+
const appIdPromise = loadConfig({
|
|
25
|
+
environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME],
|
|
26
|
+
configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME],
|
|
29
27
|
default: undefined,
|
|
30
28
|
})();
|
|
31
|
-
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
}); };
|
|
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
|
+
};
|
|
47
37
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-user-agent-node",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.188.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.
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
23
|
+
"@aws-sdk/node-config-provider": "3.188.0",
|
|
24
|
+
"@aws-sdk/types": "3.188.0",
|
|
25
25
|
"tslib": "^2.3.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@aws-sdk/protocol-http": "3.
|
|
28
|
+
"@aws-sdk/protocol-http": "3.188.0",
|
|
29
29
|
"@tsconfig/recommended": "1.0.1",
|
|
30
30
|
"@types/node": "^10.0.0",
|
|
31
31
|
"concurrently": "7.0.0",
|