@aws-sdk/util-user-agent-node 3.485.0 → 3.495.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.
@@ -1,6 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.crtAvailability = void 0;
4
- exports.crtAvailability = {
5
- isCrtAvailable: false,
6
- };
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,44 +1,92 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = exports.crtAvailability = void 0;
4
- const node_config_provider_1 = require("@smithy/node-config-provider");
5
- const os_1 = require("os");
6
- const process_1 = require("process");
7
- const is_crt_available_1 = require("./is-crt-available");
8
- var crt_availability_1 = require("./crt-availability");
9
- Object.defineProperty(exports, "crtAvailability", { enumerable: true, get: function () { return crt_availability_1.crtAvailability; } });
10
- exports.UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
11
- exports.UA_APP_ID_INI_NAME = "sdk-ua-app-id";
12
- const defaultUserAgent = ({ serviceId, clientVersion }) => {
13
- const sections = [
14
- ["aws-sdk-js", clientVersion],
15
- ["ua", "2.0"],
16
- [`os/${(0, os_1.platform)()}`, (0, os_1.release)()],
17
- ["lang/js"],
18
- ["md/nodejs", `${process_1.versions.node}`],
19
- ];
20
- const crtAvailable = (0, is_crt_available_1.isCrtAvailable)();
21
- if (crtAvailable) {
22
- sections.push(crtAvailable);
23
- }
24
- if (serviceId) {
25
- sections.push([`api/${serviceId}`, clientVersion]);
26
- }
27
- if (process_1.env.AWS_EXECUTION_ENV) {
28
- sections.push([`exec-env/${process_1.env.AWS_EXECUTION_ENV}`]);
29
- }
30
- const appIdPromise = (0, node_config_provider_1.loadConfig)({
31
- environmentVariableSelector: (env) => env[exports.UA_APP_ID_ENV_NAME],
32
- configFileSelector: (profile) => profile[exports.UA_APP_ID_INI_NAME],
33
- default: undefined,
34
- })();
35
- let resolvedUserAgent = undefined;
36
- return async () => {
37
- if (!resolvedUserAgent) {
38
- const appId = await appIdPromise;
39
- resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
40
- }
41
- return resolvedUserAgent;
42
- };
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
43
9
  };
44
- exports.defaultUserAgent = defaultUserAgent;
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME,
24
+ UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME,
25
+ crtAvailability: () => crtAvailability,
26
+ defaultUserAgent: () => defaultUserAgent
27
+ });
28
+ module.exports = __toCommonJS(src_exports);
29
+ var import_node_config_provider = require("@smithy/node-config-provider");
30
+ var import_os = require("os");
31
+ var import_process = require("process");
32
+
33
+ // src/crt-availability.ts
34
+ var crtAvailability = {
35
+ isCrtAvailable: false
36
+ };
37
+
38
+ // src/is-crt-available.ts
39
+ var isCrtAvailable = /* @__PURE__ */ __name(() => {
40
+ if (crtAvailability.isCrtAvailable) {
41
+ return ["md/crt-avail"];
42
+ }
43
+ return null;
44
+ }, "isCrtAvailable");
45
+
46
+ // src/index.ts
47
+ var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
48
+ var UA_APP_ID_INI_NAME = "sdk-ua-app-id";
49
+ var defaultUserAgent = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
50
+ const sections = [
51
+ // sdk-metadata
52
+ ["aws-sdk-js", clientVersion],
53
+ // ua-metadata
54
+ ["ua", "2.0"],
55
+ // os-metadata
56
+ [`os/${(0, import_os.platform)()}`, (0, import_os.release)()],
57
+ // language-metadata
58
+ // ECMAScript edition doesn't matter in JS, so no version needed.
59
+ ["lang/js"],
60
+ ["md/nodejs", `${import_process.versions.node}`]
61
+ ];
62
+ const crtAvailable = isCrtAvailable();
63
+ if (crtAvailable) {
64
+ sections.push(crtAvailable);
65
+ }
66
+ if (serviceId) {
67
+ sections.push([`api/${serviceId}`, clientVersion]);
68
+ }
69
+ if (import_process.env.AWS_EXECUTION_ENV) {
70
+ sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]);
71
+ }
72
+ const appIdPromise = (0, import_node_config_provider.loadConfig)({
73
+ environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
74
+ configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME],
75
+ default: void 0
76
+ })();
77
+ let resolvedUserAgent = void 0;
78
+ return async () => {
79
+ if (!resolvedUserAgent) {
80
+ const appId = await appIdPromise;
81
+ resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
82
+ }
83
+ return resolvedUserAgent;
84
+ };
85
+ }, "defaultUserAgent");
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ UA_APP_ID_ENV_NAME,
89
+ UA_APP_ID_INI_NAME,
90
+ crtAvailability,
91
+ defaultUserAgent
92
+ });
@@ -1,11 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isCrtAvailable = void 0;
4
- const crt_availability_1 = require("./crt-availability");
5
- const isCrtAvailable = () => {
6
- if (crt_availability_1.crtAvailability.isCrtAvailable) {
7
- return ["md/crt-avail"];
8
- }
9
- return null;
10
- };
11
- exports.isCrtAvailable = isCrtAvailable;
1
+ module.exports = require("./index.js");
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-user-agent-node",
3
- "version": "3.485.0",
3
+ "version": "3.495.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
- "build:cjs": "tsc -p tsconfig.cjs.json",
6
+ "build:cjs": "node ../../scripts/compilation/inline util-user-agent-node",
7
7
  "build:es": "tsc -p tsconfig.es.json",
8
8
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
9
9
  "build:types": "tsc -p tsconfig.types.json",
@@ -20,9 +20,9 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/types": "3.485.0",
24
- "@smithy/node-config-provider": "^2.1.9",
25
- "@smithy/types": "^2.8.0",
23
+ "@aws-sdk/types": "3.495.0",
24
+ "@smithy/node-config-provider": "^2.2.0",
25
+ "@smithy/types": "^2.9.0",
26
26
  "tslib": "^2.5.0"
27
27
  },
28
28
  "devDependencies": {