UNPKG

@socketsecurity/lib

Version:

Core utilities and infrastructure for Socket.dev security tools

99 lines (98 loc) 4.56 kB
"use strict"; /* Socket Lib - Built with esbuild */ var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; 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); var socket_cli_exports = {}; __export(socket_cli_exports, { getSocketCliAcceptRisks: () => getSocketCliAcceptRisks, getSocketCliApiBaseUrl: () => getSocketCliApiBaseUrl, getSocketCliApiProxy: () => getSocketCliApiProxy, getSocketCliApiTimeout: () => getSocketCliApiTimeout, getSocketCliApiToken: () => getSocketCliApiToken, getSocketCliBootstrapCacheDir: () => getSocketCliBootstrapCacheDir, getSocketCliBootstrapSpec: () => getSocketCliBootstrapSpec, getSocketCliConfig: () => getSocketCliConfig, getSocketCliFix: () => getSocketCliFix, getSocketCliGithubToken: () => getSocketCliGithubToken, getSocketCliNoApiToken: () => getSocketCliNoApiToken, getSocketCliOptimize: () => getSocketCliOptimize, getSocketCliOrgSlug: () => getSocketCliOrgSlug, getSocketCliViewAllRisks: () => getSocketCliViewAllRisks }); module.exports = __toCommonJS(socket_cli_exports); var import_helpers = require("#env/helpers"); var import_rewire = require("#env/rewire"); function getSocketCliAcceptRisks() { return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("SOCKET_CLI_ACCEPT_RISKS")); } function getSocketCliApiBaseUrl() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_API_BASE_URL") || (0, import_rewire.getEnvValue)("SOCKET_SECURITY_API_BASE_URL"); } function getSocketCliApiProxy() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_API_PROXY") || (0, import_rewire.getEnvValue)("SOCKET_SECURITY_API_PROXY") || (0, import_rewire.getEnvValue)("HTTPS_PROXY") || (0, import_rewire.getEnvValue)("https_proxy") || (0, import_rewire.getEnvValue)("HTTP_PROXY") || (0, import_rewire.getEnvValue)("http_proxy"); } function getSocketCliApiTimeout() { return (0, import_helpers.envAsNumber)((0, import_rewire.getEnvValue)("SOCKET_CLI_API_TIMEOUT")); } function getSocketCliApiToken() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_API_TOKEN") || (0, import_rewire.getEnvValue)("SOCKET_CLI_API_KEY") || (0, import_rewire.getEnvValue)("SOCKET_SECURITY_API_TOKEN") || (0, import_rewire.getEnvValue)("SOCKET_SECURITY_API_KEY"); } function getSocketCliConfig() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_CONFIG"); } function getSocketCliFix() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_FIX"); } function getSocketCliNoApiToken() { return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("SOCKET_CLI_NO_API_TOKEN")); } function getSocketCliOptimize() { return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("SOCKET_CLI_OPTIMIZE")); } function getSocketCliOrgSlug() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_ORG_SLUG") || (0, import_rewire.getEnvValue)("SOCKET_ORG_SLUG"); } function getSocketCliViewAllRisks() { return (0, import_helpers.envAsBoolean)((0, import_rewire.getEnvValue)("SOCKET_CLI_VIEW_ALL_RISKS")); } function getSocketCliGithubToken() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_GITHUB_TOKEN") || (0, import_rewire.getEnvValue)("SOCKET_SECURITY_GITHUB_PAT") || (0, import_rewire.getEnvValue)("GITHUB_TOKEN"); } function getSocketCliBootstrapSpec() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_BOOTSTRAP_SPEC"); } function getSocketCliBootstrapCacheDir() { return (0, import_rewire.getEnvValue)("SOCKET_CLI_BOOTSTRAP_CACHE_DIR"); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { getSocketCliAcceptRisks, getSocketCliApiBaseUrl, getSocketCliApiProxy, getSocketCliApiTimeout, getSocketCliApiToken, getSocketCliBootstrapCacheDir, getSocketCliBootstrapSpec, getSocketCliConfig, getSocketCliFix, getSocketCliGithubToken, getSocketCliNoApiToken, getSocketCliOptimize, getSocketCliOrgSlug, getSocketCliViewAllRisks });