Socket
Socket
Sign inDemoInstall

@aws-sdk/util-user-agent-node

Package Overview
Dependencies
Maintainers
5
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/util-user-agent-node - npm Package Compare versions

Comparing version 3.489.0 to 3.495.0

7

dist-cjs/crt-availability.js

@@ -1,6 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.crtAvailability = void 0;
exports.crtAvailability = {
isCrtAvailable: false,
};
module.exports = require("./index.js");

134

dist-cjs/index.js

@@ -1,44 +0,92 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultUserAgent = exports.UA_APP_ID_INI_NAME = exports.UA_APP_ID_ENV_NAME = exports.crtAvailability = void 0;
const node_config_provider_1 = require("@smithy/node-config-provider");
const os_1 = require("os");
const process_1 = require("process");
const is_crt_available_1 = require("./is-crt-available");
var crt_availability_1 = require("./crt-availability");
Object.defineProperty(exports, "crtAvailability", { enumerable: true, get: function () { return crt_availability_1.crtAvailability; } });
exports.UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
exports.UA_APP_ID_INI_NAME = "sdk-ua-app-id";
const defaultUserAgent = ({ serviceId, clientVersion }) => {
const sections = [
["aws-sdk-js", clientVersion],
["ua", "2.0"],
[`os/${(0, os_1.platform)()}`, (0, os_1.release)()],
["lang/js"],
["md/nodejs", `${process_1.versions.node}`],
];
const crtAvailable = (0, is_crt_available_1.isCrtAvailable)();
if (crtAvailable) {
sections.push(crtAvailable);
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
UA_APP_ID_ENV_NAME: () => UA_APP_ID_ENV_NAME,
UA_APP_ID_INI_NAME: () => UA_APP_ID_INI_NAME,
crtAvailability: () => crtAvailability,
defaultUserAgent: () => defaultUserAgent
});
module.exports = __toCommonJS(src_exports);
var import_node_config_provider = require("@smithy/node-config-provider");
var import_os = require("os");
var import_process = require("process");
// src/crt-availability.ts
var crtAvailability = {
isCrtAvailable: false
};
// src/is-crt-available.ts
var isCrtAvailable = /* @__PURE__ */ __name(() => {
if (crtAvailability.isCrtAvailable) {
return ["md/crt-avail"];
}
return null;
}, "isCrtAvailable");
// src/index.ts
var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
var UA_APP_ID_INI_NAME = "sdk-ua-app-id";
var defaultUserAgent = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
const sections = [
// sdk-metadata
["aws-sdk-js", clientVersion],
// ua-metadata
["ua", "2.0"],
// os-metadata
[`os/${(0, import_os.platform)()}`, (0, import_os.release)()],
// language-metadata
// ECMAScript edition doesn't matter in JS, so no version needed.
["lang/js"],
["md/nodejs", `${import_process.versions.node}`]
];
const crtAvailable = isCrtAvailable();
if (crtAvailable) {
sections.push(crtAvailable);
}
if (serviceId) {
sections.push([`api/${serviceId}`, clientVersion]);
}
if (import_process.env.AWS_EXECUTION_ENV) {
sections.push([`exec-env/${import_process.env.AWS_EXECUTION_ENV}`]);
}
const appIdPromise = (0, import_node_config_provider.loadConfig)({
environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME],
default: void 0
})();
let resolvedUserAgent = void 0;
return async () => {
if (!resolvedUserAgent) {
const appId = await appIdPromise;
resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
}
if (serviceId) {
sections.push([`api/${serviceId}`, clientVersion]);
}
if (process_1.env.AWS_EXECUTION_ENV) {
sections.push([`exec-env/${process_1.env.AWS_EXECUTION_ENV}`]);
}
const appIdPromise = (0, node_config_provider_1.loadConfig)({
environmentVariableSelector: (env) => env[exports.UA_APP_ID_ENV_NAME],
configFileSelector: (profile) => profile[exports.UA_APP_ID_INI_NAME],
default: undefined,
})();
let resolvedUserAgent = undefined;
return async () => {
if (!resolvedUserAgent) {
const appId = await appIdPromise;
resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
}
return resolvedUserAgent;
};
};
exports.defaultUserAgent = defaultUserAgent;
return resolvedUserAgent;
};
}, "defaultUserAgent");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
UA_APP_ID_ENV_NAME,
UA_APP_ID_INI_NAME,
crtAvailability,
defaultUserAgent
});

@@ -1,11 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCrtAvailable = void 0;
const crt_availability_1 = require("./crt-availability");
const isCrtAvailable = () => {
if (crt_availability_1.crtAvailability.isCrtAvailable) {
return ["md/crt-avail"];
}
return null;
};
exports.isCrtAvailable = isCrtAvailable;
module.exports = require("./index.js");
{
"name": "@aws-sdk/util-user-agent-node",
"version": "3.489.0",
"version": "3.495.0",
"scripts": {
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:cjs": "node ../../scripts/compilation/inline util-user-agent-node",
"build:es": "tsc -p tsconfig.es.json",

@@ -23,5 +23,5 @@ "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",

"dependencies": {
"@aws-sdk/types": "3.489.0",
"@smithy/node-config-provider": "^2.1.9",
"@smithy/types": "^2.8.0",
"@aws-sdk/types": "3.495.0",
"@smithy/node-config-provider": "^2.2.0",
"@smithy/types": "^2.9.0",
"tslib": "^2.5.0"

@@ -28,0 +28,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc