@socketsecurity/cli-with-sentry 0.14.93 → 0.14.95
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/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +177 -157
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-bin.js +3 -14
- package/dist/module-sync/shadow-bin.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +68 -59
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/module-sync/shadow-npm-paths.js +16 -29
- package/dist/module-sync/shadow-npm-paths.js.map +1 -1
- package/dist/module-sync/vendor.d.ts +0 -0
- package/dist/module-sync/vendor.js +85829 -12598
- package/dist/module-sync/vendor.js.map +1 -1
- package/dist/require/cli.js +159 -138
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-bin.d.ts +5 -0
- package/dist/require/shadow-bin.js +108 -1
- package/dist/require/shadow-bin.js.map +1 -0
- package/dist/require/shadow-npm-inject.d.ts +1 -0
- package/dist/require/shadow-npm-inject.js +2335 -1
- package/dist/require/shadow-npm-inject.js.map +1 -0
- package/dist/require/shadow-npm-paths.d.ts +29 -0
- package/dist/require/shadow-npm-paths.js +454 -1
- package/dist/require/shadow-npm-paths.js.map +1 -0
- package/package.json +29 -29
- package/dist/blessed/lib/alias.js +0 -521
- package/dist/blessed/lib/blessed.js +0 -34
- package/dist/blessed/lib/colors.js +0 -492
- package/dist/blessed/lib/events.js +0 -197
- package/dist/blessed/lib/gpmclient.js +0 -247
- package/dist/blessed/lib/helpers.js +0 -172
- package/dist/blessed/lib/keys.js +0 -514
- package/dist/blessed/lib/program.js +0 -4532
- package/dist/blessed/lib/tput.js +0 -3113
- package/dist/blessed/lib/unicode.js +0 -914
- package/dist/blessed/lib/widget.js +0 -62
- package/dist/blessed/lib/widgets/ansiimage.js +0 -175
- package/dist/blessed/lib/widgets/bigtext.js +0 -172
- package/dist/blessed/lib/widgets/box.js +0 -36
- package/dist/blessed/lib/widgets/button.js +0 -64
- package/dist/blessed/lib/widgets/checkbox.js +0 -97
- package/dist/blessed/lib/widgets/element.js +0 -2873
- package/dist/blessed/lib/widgets/filemanager.js +0 -225
- package/dist/blessed/lib/widgets/form.js +0 -303
- package/dist/blessed/lib/widgets/image.js +0 -73
- package/dist/blessed/lib/widgets/input.js +0 -36
- package/dist/blessed/lib/widgets/layout.js +0 -251
- package/dist/blessed/lib/widgets/line.js +0 -61
- package/dist/blessed/lib/widgets/list.js +0 -654
- package/dist/blessed/lib/widgets/listbar.js +0 -454
- package/dist/blessed/lib/widgets/listtable.js +0 -267
- package/dist/blessed/lib/widgets/loading.js +0 -90
- package/dist/blessed/lib/widgets/log.js +0 -84
- package/dist/blessed/lib/widgets/message.js +0 -147
- package/dist/blessed/lib/widgets/node.js +0 -315
- package/dist/blessed/lib/widgets/overlayimage.js +0 -796
- package/dist/blessed/lib/widgets/progressbar.js +0 -168
- package/dist/blessed/lib/widgets/prompt.js +0 -129
- package/dist/blessed/lib/widgets/question.js +0 -131
- package/dist/blessed/lib/widgets/radiobutton.js +0 -64
- package/dist/blessed/lib/widgets/radioset.js +0 -38
- package/dist/blessed/lib/widgets/screen.js +0 -2487
- package/dist/blessed/lib/widgets/scrollablebox.js +0 -417
- package/dist/blessed/lib/widgets/scrollabletext.js +0 -37
- package/dist/blessed/lib/widgets/table.js +0 -385
- package/dist/blessed/lib/widgets/terminal.js +0 -454
- package/dist/blessed/lib/widgets/text.js +0 -37
- package/dist/blessed/lib/widgets/textarea.js +0 -378
- package/dist/blessed/lib/widgets/textbox.js +0 -81
- package/dist/blessed/lib/widgets/video.js +0 -132
- package/dist/blessed/usr/fonts/AUTHORS +0 -1
- package/dist/blessed/usr/fonts/LICENSE +0 -94
- package/dist/blessed/usr/fonts/README +0 -340
- package/dist/blessed/usr/fonts/ter-u14b.json +0 -17826
- package/dist/blessed/usr/fonts/ter-u14n.json +0 -17826
- package/dist/blessed/usr/linux +0 -0
- package/dist/blessed/usr/windows-ansi +0 -0
- package/dist/blessed/usr/xterm +0 -0
- package/dist/blessed/usr/xterm-256color +0 -0
- package/dist/blessed/usr/xterm.termcap +0 -243
- package/dist/blessed/usr/xterm.terminfo +0 -1977
- package/dist/blessed/vendor/tng.js +0 -1878
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
function _socketInterop(e) {
|
|
4
|
-
let c = 0
|
|
5
|
-
for (const k in e ?? {}) {
|
|
6
|
-
c = c === 0 && k === 'default' ? 1 : 0
|
|
7
|
-
if (!c && k !== '__esModule') {
|
|
8
|
-
break
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return c ? e.default : e
|
|
12
|
-
}
|
|
13
|
-
|
|
14
3
|
const process = require('node:process')
|
|
15
4
|
const debug = require('@socketsecurity/registry/lib/debug')
|
|
16
5
|
const npm = require('@socketsecurity/registry/lib/npm')
|
|
17
6
|
const spawn = require('@socketsecurity/registry/lib/spawn')
|
|
18
7
|
const path = require('node:path')
|
|
19
|
-
const
|
|
8
|
+
const vendor = require('./vendor.js')
|
|
20
9
|
const shadowNpmPaths = require('./shadow-npm-paths.js')
|
|
21
10
|
const constants = require('./constants.js')
|
|
22
11
|
|
|
@@ -39,7 +28,7 @@ async function installLinks(realBinPath, binName) {
|
|
|
39
28
|
// Move our bin directory to front of PATH so its found first.
|
|
40
29
|
if (!shadowed) {
|
|
41
30
|
if (WIN32) {
|
|
42
|
-
await
|
|
31
|
+
await vendor.libExports(
|
|
43
32
|
// Lazily access constants.rootDistPath.
|
|
44
33
|
path.join(constants.rootDistPath, `${binName}-${CLI}.js`),
|
|
45
34
|
path.join(realBinPath, binName)
|
|
@@ -117,5 +106,5 @@ async function shadowBin(binName, args = process.argv.slice(2)) {
|
|
|
117
106
|
}
|
|
118
107
|
|
|
119
108
|
module.exports = shadowBin
|
|
120
|
-
//# debugId=
|
|
109
|
+
//# debugId=a3ff14de-2729-4213-91d1-6f1ab7249f1d
|
|
121
110
|
//# sourceMappingURL=shadow-bin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow-bin.js","sources":["../../src/shadow/npm/link.ts","../../src/shadow/npm/bin.ts"],"sourcesContent":["import path from 'node:path'\nimport process from 'node:process'\n\nimport cmdShim from 'cmd-shim'\n\nimport {\n getNpmBinPath,\n getNpxBinPath,\n isNpmBinPathShadowed,\n isNpxBinPathShadowed\n} from './paths'\nimport constants from '../../constants'\n\nconst { CLI, NPX } = constants\n\nexport async function installLinks(\n realBinPath: string,\n binName: 'npm' | 'npx'\n): Promise<string> {\n const isNpx = binName === NPX\n // Find package manager being shadowed by this process.\n const binPath = isNpx ? getNpxBinPath() : getNpmBinPath()\n // Lazily access constants.WIN32.\n const { WIN32 } = constants\n // TODO: Is this early exit needed?\n if (WIN32 && binPath) {\n return binPath\n }\n const shadowed = isNpx ? isNpxBinPathShadowed() : isNpmBinPathShadowed()\n // Move our bin directory to front of PATH so its found first.\n if (!shadowed) {\n if (WIN32) {\n await cmdShim(\n // Lazily access constants.rootDistPath.\n path.join(constants.rootDistPath, `${binName}-${CLI}.js`),\n path.join(realBinPath, binName)\n )\n }\n const { env } = process\n env['PATH'] = `${realBinPath}${path.delimiter}${env['PATH']}`\n }\n return binPath\n}\n","import process from 'node:process'\n\nimport { isDebug } from '@socketsecurity/registry/lib/debug'\nimport {\n isLoglevelFlag,\n isProgressFlag\n} from '@socketsecurity/registry/lib/npm'\nimport { spawn } from '@socketsecurity/registry/lib/spawn'\n\nimport { installLinks } from './link'\nimport constants from '../../constants'\n\nconst { SOCKET_CLI_SAFE_BIN, SOCKET_CLI_SAFE_PROGRESS, SOCKET_IPC_HANDSHAKE } =\n constants\n\nexport default async function shadowBin(\n binName: 'npm' | 'npx',\n args = process.argv.slice(2)\n) {\n process.exitCode = 1\n const useDebug = isDebug()\n const terminatorPos = args.indexOf('--')\n const rawBinArgs = terminatorPos === -1 ? args : args.slice(0, terminatorPos)\n const progressArg = rawBinArgs.findLast(isProgressFlag) !== '--no-progress'\n const binArgs = rawBinArgs.filter(a => !isProgressFlag(a))\n const otherArgs = terminatorPos === -1 ? [] : args.slice(terminatorPos)\n const isSilent = !useDebug && !binArgs.some(isLoglevelFlag)\n // The default value of loglevel is \"notice\". We default to \"error\" which is\n // two levels quieter.\n const logLevelArgs = isSilent ? ['--loglevel', 'error'] : []\n const spawnPromise = spawn(\n // Lazily access constants.execPath.\n constants.execPath,\n [\n // Lazily access constants.nodeHardenFlags.\n ...constants.nodeHardenFlags,\n // Lazily access constants.nodeNoWarningsFlags.\n ...constants.nodeNoWarningsFlags,\n // Lazily access process.env['INLINED_SOCKET_CLI_SENTRY_BUILD'].\n ...(process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\n ? [\n '--require',\n // Lazily access constants.distInstrumentWithSentryPath.\n constants.distInstrumentWithSentryPath\n ]\n : []),\n '--require',\n // Lazily access constants.distShadowNpmInjectPath.\n constants.distShadowNpmInjectPath,\n // Lazily access constants.shadowBinPath.\n await installLinks(constants.shadowBinPath, binName),\n // Add '--no-progress' to fix input being swallowed by the npm spinner.\n '--no-progress',\n // Add '--loglevel=error' if a loglevel flag is not provided and the\n // SOCKET_CLI_DEBUG environment variable is not truthy.\n ...logLevelArgs,\n ...binArgs,\n ...otherArgs\n ],\n {\n // 'inherit' + 'ipc'\n stdio: [0, 1, 2, 'ipc']\n }\n )\n // See https://nodejs.org/api/all.html#all_child_process_event-exit.\n spawnPromise.process.on('exit', (code, signalName) => {\n if (signalName) {\n process.kill(process.pid, signalName)\n } else if (code !== null) {\n // eslint-disable-next-line n/no-process-exit\n process.exit(code)\n }\n })\n spawnPromise.process.send({\n [SOCKET_IPC_HANDSHAKE]: {\n [SOCKET_CLI_SAFE_BIN]: binName,\n [SOCKET_CLI_SAFE_PROGRESS]: progressArg\n }\n })\n await spawnPromise\n}\n"],"names":["NPX","WIN32","env","SOCKET_IPC_HANDSHAKE","constants","process","spawnPromise"],"mappings":"
|
|
1
|
+
{"version":3,"file":"shadow-bin.js","sources":["../../src/shadow/npm/link.ts","../../src/shadow/npm/bin.ts"],"sourcesContent":["import path from 'node:path'\nimport process from 'node:process'\n\nimport cmdShim from 'cmd-shim'\n\nimport {\n getNpmBinPath,\n getNpxBinPath,\n isNpmBinPathShadowed,\n isNpxBinPathShadowed\n} from './paths'\nimport constants from '../../constants'\n\nconst { CLI, NPX } = constants\n\nexport async function installLinks(\n realBinPath: string,\n binName: 'npm' | 'npx'\n): Promise<string> {\n const isNpx = binName === NPX\n // Find package manager being shadowed by this process.\n const binPath = isNpx ? getNpxBinPath() : getNpmBinPath()\n // Lazily access constants.WIN32.\n const { WIN32 } = constants\n // TODO: Is this early exit needed?\n if (WIN32 && binPath) {\n return binPath\n }\n const shadowed = isNpx ? isNpxBinPathShadowed() : isNpmBinPathShadowed()\n // Move our bin directory to front of PATH so its found first.\n if (!shadowed) {\n if (WIN32) {\n await cmdShim(\n // Lazily access constants.rootDistPath.\n path.join(constants.rootDistPath, `${binName}-${CLI}.js`),\n path.join(realBinPath, binName)\n )\n }\n const { env } = process\n env['PATH'] = `${realBinPath}${path.delimiter}${env['PATH']}`\n }\n return binPath\n}\n","import process from 'node:process'\n\nimport { isDebug } from '@socketsecurity/registry/lib/debug'\nimport {\n isLoglevelFlag,\n isProgressFlag\n} from '@socketsecurity/registry/lib/npm'\nimport { spawn } from '@socketsecurity/registry/lib/spawn'\n\nimport { installLinks } from './link'\nimport constants from '../../constants'\n\nconst { SOCKET_CLI_SAFE_BIN, SOCKET_CLI_SAFE_PROGRESS, SOCKET_IPC_HANDSHAKE } =\n constants\n\nexport default async function shadowBin(\n binName: 'npm' | 'npx',\n args = process.argv.slice(2)\n) {\n process.exitCode = 1\n const useDebug = isDebug()\n const terminatorPos = args.indexOf('--')\n const rawBinArgs = terminatorPos === -1 ? args : args.slice(0, terminatorPos)\n const progressArg = rawBinArgs.findLast(isProgressFlag) !== '--no-progress'\n const binArgs = rawBinArgs.filter(a => !isProgressFlag(a))\n const otherArgs = terminatorPos === -1 ? [] : args.slice(terminatorPos)\n const isSilent = !useDebug && !binArgs.some(isLoglevelFlag)\n // The default value of loglevel is \"notice\". We default to \"error\" which is\n // two levels quieter.\n const logLevelArgs = isSilent ? ['--loglevel', 'error'] : []\n const spawnPromise = spawn(\n // Lazily access constants.execPath.\n constants.execPath,\n [\n // Lazily access constants.nodeHardenFlags.\n ...constants.nodeHardenFlags,\n // Lazily access constants.nodeNoWarningsFlags.\n ...constants.nodeNoWarningsFlags,\n // Lazily access process.env['INLINED_SOCKET_CLI_SENTRY_BUILD'].\n ...(process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\n ? [\n '--require',\n // Lazily access constants.distInstrumentWithSentryPath.\n constants.distInstrumentWithSentryPath\n ]\n : []),\n '--require',\n // Lazily access constants.distShadowNpmInjectPath.\n constants.distShadowNpmInjectPath,\n // Lazily access constants.shadowBinPath.\n await installLinks(constants.shadowBinPath, binName),\n // Add '--no-progress' to fix input being swallowed by the npm spinner.\n '--no-progress',\n // Add '--loglevel=error' if a loglevel flag is not provided and the\n // SOCKET_CLI_DEBUG environment variable is not truthy.\n ...logLevelArgs,\n ...binArgs,\n ...otherArgs\n ],\n {\n // 'inherit' + 'ipc'\n stdio: [0, 1, 2, 'ipc']\n }\n )\n // See https://nodejs.org/api/all.html#all_child_process_event-exit.\n spawnPromise.process.on('exit', (code, signalName) => {\n if (signalName) {\n process.kill(process.pid, signalName)\n } else if (code !== null) {\n // eslint-disable-next-line n/no-process-exit\n process.exit(code)\n }\n })\n spawnPromise.process.send({\n [SOCKET_IPC_HANDSHAKE]: {\n [SOCKET_CLI_SAFE_BIN]: binName,\n [SOCKET_CLI_SAFE_PROGRESS]: progressArg\n }\n })\n await spawnPromise\n}\n"],"names":["NPX","WIN32","env","SOCKET_IPC_HANDSHAKE","constants","process","spawnPromise"],"mappings":";;;;;;;;;;;AAaA;;AAAaA;AAAI;AAEV;AAIL;AACA;;AAEA;;AACQC;AAAM;AACd;;AAEE;AACF;;AAEA;;AAEE;AACE;AACE;;AAIJ;;AACQC;AAAI;AACZA;AACF;AACA;AACF;;AC9BA;;;AAAuDC;AAAqB;AAG7D;;AAKb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGE;;AAGE;;AAEA;;AAEA;;AAIM;AACAC;AAIN;AACAA;AACA;AACA;AACA;;AAEA;AACA;;AAMA;;AAEF;AAEF;;AAEE;;AAEA;AACE;AACAC;AACF;AACF;AACAC;AACE;;AAEE;AACF;AACF;AACA;AACF;;","debugId":"a3ff14de-2729-4213-91d1-6f1ab7249f1d"}
|
|
@@ -1,43 +1,26 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
function _socketInterop(e) {
|
|
4
|
-
let c = 0
|
|
5
|
-
for (const k in e ?? {}) {
|
|
6
|
-
c = c === 0 && k === 'default' ? 1 : 0
|
|
7
|
-
if (!c && k !== '__esModule') {
|
|
8
|
-
break
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return c ? e.default : e
|
|
12
|
-
}
|
|
13
|
-
|
|
14
3
|
const shadowNpmPaths = require('./shadow-npm-paths.js')
|
|
15
4
|
const process$1 = require('node:process')
|
|
16
|
-
const
|
|
5
|
+
const vendor = require('./vendor.js')
|
|
17
6
|
const logger = require('@socketsecurity/registry/lib/logger')
|
|
18
7
|
const constants = require('./constants.js')
|
|
19
|
-
const semver = _socketInterop(require('semver'))
|
|
20
8
|
const packageurlJs = require('@socketregistry/packageurl-js')
|
|
21
9
|
const registry = require('@socketsecurity/registry')
|
|
22
10
|
const arrays = require('@socketsecurity/registry/lib/arrays')
|
|
23
11
|
const debug = require('@socketsecurity/registry/lib/debug')
|
|
24
12
|
const objects = require('@socketsecurity/registry/lib/objects')
|
|
25
|
-
const npa = _socketInterop(require('npm-package-arg'))
|
|
26
|
-
const hpagent = _socketInterop(require('hpagent'))
|
|
27
13
|
const isInteractive = require('@socketregistry/is-interactive/index.cjs')
|
|
28
14
|
const registryConstants = require('@socketsecurity/registry/lib/constants')
|
|
29
15
|
const prompts = require('@socketsecurity/registry/lib/prompts')
|
|
30
16
|
const strings = require('@socketsecurity/registry/lib/strings')
|
|
31
17
|
const sdk = require('@socketsecurity/sdk')
|
|
32
|
-
const
|
|
18
|
+
const require$$0 = require('node:fs')
|
|
33
19
|
const os = require('node:os')
|
|
34
20
|
const path = require('node:path')
|
|
35
|
-
const config = require('@socketsecurity/config')
|
|
36
21
|
const promises = require('node:timers/promises')
|
|
37
|
-
const colors = _socketInterop(require('yoctocolors-cjs'))
|
|
38
22
|
const packages = require('@socketsecurity/registry/lib/packages')
|
|
39
23
|
const sorts = require('@socketsecurity/registry/lib/sorts')
|
|
40
|
-
const terminalLink = _socketInterop(require('terminal-link'))
|
|
41
24
|
const indentString = require('@socketregistry/indent-string/index.cjs')
|
|
42
25
|
|
|
43
26
|
const { abortSignal } = constants
|
|
@@ -53,7 +36,7 @@ async function findUp(name, { cwd = process$1.cwd(), signal = abortSignal }) {
|
|
|
53
36
|
const filePath = path.join(dir, name)
|
|
54
37
|
try {
|
|
55
38
|
// eslint-disable-next-line no-await-in-loop
|
|
56
|
-
const stats = await
|
|
39
|
+
const stats = await require$$0.promises.stat(filePath)
|
|
57
40
|
if (stats.isFile()) {
|
|
58
41
|
return filePath
|
|
59
42
|
}
|
|
@@ -64,14 +47,14 @@ async function findUp(name, { cwd = process$1.cwd(), signal = abortSignal }) {
|
|
|
64
47
|
return undefined
|
|
65
48
|
}
|
|
66
49
|
async function readFileBinary(filepath, options) {
|
|
67
|
-
return await
|
|
50
|
+
return await require$$0.promises.readFile(filepath, {
|
|
68
51
|
signal: abortSignal,
|
|
69
52
|
...options,
|
|
70
53
|
encoding: 'binary'
|
|
71
54
|
})
|
|
72
55
|
}
|
|
73
56
|
async function readFileUtf8(filepath, options) {
|
|
74
|
-
return await
|
|
57
|
+
return await require$$0.promises.readFile(filepath, {
|
|
75
58
|
signal: abortSignal,
|
|
76
59
|
...options,
|
|
77
60
|
encoding: 'utf8'
|
|
@@ -79,7 +62,7 @@ async function readFileUtf8(filepath, options) {
|
|
|
79
62
|
}
|
|
80
63
|
async function safeReadFile(filepath, options) {
|
|
81
64
|
try {
|
|
82
|
-
return await
|
|
65
|
+
return await require$$0.promises.readFile(filepath, {
|
|
83
66
|
encoding: 'utf8',
|
|
84
67
|
signal: abortSignal,
|
|
85
68
|
...(typeof options === 'string'
|
|
@@ -93,7 +76,7 @@ async function safeReadFile(filepath, options) {
|
|
|
93
76
|
}
|
|
94
77
|
function safeReadFileSync(filepath, options) {
|
|
95
78
|
try {
|
|
96
|
-
return
|
|
79
|
+
return require$$0.readFileSync(filepath, {
|
|
97
80
|
encoding: 'utf8',
|
|
98
81
|
...(typeof options === 'string'
|
|
99
82
|
? {
|
|
@@ -162,7 +145,7 @@ function overrideCachedConfig(jsonConfig) {
|
|
|
162
145
|
function overrideConfigApiToken(apiToken) {
|
|
163
146
|
// Set token to the local cached config and mark it read-only so it doesn't persist
|
|
164
147
|
_cachedConfig = {
|
|
165
|
-
...
|
|
148
|
+
...vendor.configExports,
|
|
166
149
|
...(apiToken === undefined
|
|
167
150
|
? {}
|
|
168
151
|
: {
|
|
@@ -195,7 +178,7 @@ function getConfigValues() {
|
|
|
195
178
|
updateConfigValue('apiToken', token)
|
|
196
179
|
}
|
|
197
180
|
} else {
|
|
198
|
-
|
|
181
|
+
require$$0.mkdirSync(path.dirname(configPath), {
|
|
199
182
|
recursive: true
|
|
200
183
|
})
|
|
201
184
|
}
|
|
@@ -267,7 +250,7 @@ function findSocketYmlSync(dir = process$1.cwd()) {
|
|
|
267
250
|
try {
|
|
268
251
|
return {
|
|
269
252
|
path: ymlPath,
|
|
270
|
-
parsed:
|
|
253
|
+
parsed: vendor.configExports.parseSocketConfig(yml)
|
|
271
254
|
}
|
|
272
255
|
} catch {
|
|
273
256
|
throw new Error(`Found file but was unable to parse ${ymlPath}`)
|
|
@@ -299,7 +282,7 @@ function updateConfigValue(key, value) {
|
|
|
299
282
|
_pendingSave = false
|
|
300
283
|
const configPath = getConfigPath()
|
|
301
284
|
if (configPath) {
|
|
302
|
-
|
|
285
|
+
require$$0.writeFileSync(
|
|
303
286
|
configPath,
|
|
304
287
|
Buffer.from(JSON.stringify(localConfig)).toString('base64')
|
|
305
288
|
)
|
|
@@ -397,7 +380,7 @@ async function setupSdk(
|
|
|
397
380
|
}
|
|
398
381
|
return new sdk.SocketSdk(apiToken, {
|
|
399
382
|
agent: proxy
|
|
400
|
-
? new
|
|
383
|
+
? new vendor.HttpsProxyAgent({
|
|
401
384
|
proxy
|
|
402
385
|
})
|
|
403
386
|
: undefined,
|
|
@@ -406,7 +389,7 @@ async function setupSdk(
|
|
|
406
389
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_NAME']".
|
|
407
390
|
name: '@socketsecurity/cli',
|
|
408
391
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
409
|
-
version: '0.14.
|
|
392
|
+
version: '0.14.95',
|
|
410
393
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_HOMEPAGE']".
|
|
411
394
|
homepage: 'https://github.com/SocketDev/socket-cli'
|
|
412
395
|
})
|
|
@@ -539,18 +522,21 @@ class SafeOverrideSet extends OverrideSet {
|
|
|
539
522
|
// We need to use the rawSpec here, because the spec has the overrides
|
|
540
523
|
// applied to it already. The rawSpec can be undefined, so we need to use
|
|
541
524
|
// the fallback value of spec if it is.
|
|
542
|
-
let spec =
|
|
525
|
+
let spec = vendor.npaExports(`${edge.name}@${edge.rawSpec || edge.spec}`)
|
|
543
526
|
if (spec.type === 'alias') {
|
|
544
527
|
spec = spec.subSpec
|
|
545
528
|
}
|
|
546
529
|
if (spec.type === 'git') {
|
|
547
|
-
if (
|
|
530
|
+
if (
|
|
531
|
+
spec.gitRange &&
|
|
532
|
+
vendor.semverExports.intersects(spec.gitRange, rule.keySpec)
|
|
533
|
+
) {
|
|
548
534
|
return rule
|
|
549
535
|
}
|
|
550
536
|
continue
|
|
551
537
|
}
|
|
552
538
|
if (spec.type === 'range' || spec.type === 'version') {
|
|
553
|
-
if (
|
|
539
|
+
if (vendor.semverExports.intersects(spec.fetchSpec, rule.keySpec)) {
|
|
554
540
|
return rule
|
|
555
541
|
}
|
|
556
542
|
continue
|
|
@@ -629,12 +615,15 @@ class SafeNode extends Node {
|
|
|
629
615
|
// is based on https://github.com/npm/cli/pull/8089.
|
|
630
616
|
//
|
|
631
617
|
// If we prefer dedupe, or if the version is equal, take the other.
|
|
632
|
-
if (preferDedupe ||
|
|
618
|
+
if (preferDedupe || vendor.semverExports.eq(other.version, this.version)) {
|
|
633
619
|
return true
|
|
634
620
|
}
|
|
635
621
|
// If our current version isn't the result of an override, then prefer to
|
|
636
622
|
// take the greater version.
|
|
637
|
-
if (
|
|
623
|
+
if (
|
|
624
|
+
!this.overridden &&
|
|
625
|
+
vendor.semverExports.gt(other.version, this.version)
|
|
626
|
+
) {
|
|
638
627
|
return true
|
|
639
628
|
}
|
|
640
629
|
return false
|
|
@@ -1256,18 +1245,22 @@ class ColorOrMarkdown {
|
|
|
1256
1245
|
this.useMarkdown = !!useMarkdown
|
|
1257
1246
|
}
|
|
1258
1247
|
bold(text) {
|
|
1259
|
-
return this.useMarkdown
|
|
1248
|
+
return this.useMarkdown
|
|
1249
|
+
? `**${text}**`
|
|
1250
|
+
: vendor.yoctocolorsCjsExports.bold(`${text}`)
|
|
1260
1251
|
}
|
|
1261
1252
|
header(text, level = 1) {
|
|
1262
1253
|
return this.useMarkdown
|
|
1263
1254
|
? `\n${''.padStart(level, '#')} ${text}\n`
|
|
1264
|
-
:
|
|
1255
|
+
: vendor.yoctocolorsCjsExports.underline(
|
|
1256
|
+
`\n${level === 1 ? vendor.yoctocolorsCjsExports.bold(text) : text}\n`
|
|
1257
|
+
)
|
|
1265
1258
|
}
|
|
1266
1259
|
hyperlink(text, url, { fallback = true, fallbackToUrl } = {}) {
|
|
1267
1260
|
if (url) {
|
|
1268
1261
|
return this.useMarkdown
|
|
1269
1262
|
? `[${text}](${url})`
|
|
1270
|
-
:
|
|
1263
|
+
: vendor.terminalLinkExports(text, url, {
|
|
1271
1264
|
fallback: fallbackToUrl ? (_text, url) => url : fallback
|
|
1272
1265
|
})
|
|
1273
1266
|
}
|
|
@@ -1277,7 +1270,9 @@ class ColorOrMarkdown {
|
|
|
1277
1270
|
return indentString(...args)
|
|
1278
1271
|
}
|
|
1279
1272
|
italic(text) {
|
|
1280
|
-
return this.useMarkdown
|
|
1273
|
+
return this.useMarkdown
|
|
1274
|
+
? `_${text}_`
|
|
1275
|
+
: vendor.yoctocolorsCjsExports.italic(`${text}`)
|
|
1281
1276
|
}
|
|
1282
1277
|
json(value) {
|
|
1283
1278
|
return this.useMarkdown
|
|
@@ -1432,7 +1427,7 @@ async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
|
|
|
1432
1427
|
const name = packages.resolvePackageName(artifact)
|
|
1433
1428
|
const { version } = artifact
|
|
1434
1429
|
const pkgId = `${name}@${version}`
|
|
1435
|
-
const major =
|
|
1430
|
+
const major = vendor.semverExports.major(version)
|
|
1436
1431
|
const socketYml = findSocketYmlSync()
|
|
1437
1432
|
const enabledState = {
|
|
1438
1433
|
__proto__: null,
|
|
@@ -1489,10 +1484,10 @@ async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
|
|
|
1489
1484
|
if (fixType === ALERT_FIX_TYPE.cve) {
|
|
1490
1485
|
const patchedVersion =
|
|
1491
1486
|
alert.props[CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER]
|
|
1492
|
-
const patchedMajor =
|
|
1487
|
+
const patchedMajor = vendor.semverExports.major(patchedVersion)
|
|
1493
1488
|
const oldHighest = highestForCve.get(patchedMajor)
|
|
1494
1489
|
const highest = oldHighest?.version ?? '0.0.0'
|
|
1495
|
-
if (
|
|
1490
|
+
if (vendor.semverExports.gt(patchedVersion, highest)) {
|
|
1496
1491
|
highestForCve.set(patchedMajor, {
|
|
1497
1492
|
alert: sockPkgAlert,
|
|
1498
1493
|
version: patchedVersion
|
|
@@ -1501,7 +1496,7 @@ async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
|
|
|
1501
1496
|
} else if (fixType === ALERT_FIX_TYPE.upgrade) {
|
|
1502
1497
|
const oldHighest = highestForUpgrade.get(major)
|
|
1503
1498
|
const highest = oldHighest?.version ?? '0.0.0'
|
|
1504
|
-
if (
|
|
1499
|
+
if (vendor.semverExports.gt(version, highest)) {
|
|
1505
1500
|
highestForUpgrade.set(major, {
|
|
1506
1501
|
alert: sockPkgAlert,
|
|
1507
1502
|
version
|
|
@@ -1555,7 +1550,7 @@ function getCveInfoByAlertsMap(alertsMap, options) {
|
|
|
1555
1550
|
alert.props
|
|
1556
1551
|
infos.push({
|
|
1557
1552
|
firstPatchedVersionIdentifier,
|
|
1558
|
-
vulnerableVersionRange: new
|
|
1553
|
+
vulnerableVersionRange: new vendor.semverExports.Range(
|
|
1559
1554
|
vulnerableVersionRange
|
|
1560
1555
|
).format()
|
|
1561
1556
|
})
|
|
@@ -1651,13 +1646,23 @@ function logAlertsMap(alertsMap, options) {
|
|
|
1651
1646
|
const severity = alert.raw.severity ?? ''
|
|
1652
1647
|
const attributes = [
|
|
1653
1648
|
...(severity
|
|
1654
|
-
? [
|
|
1649
|
+
? [
|
|
1650
|
+
vendor.yoctocolorsCjsExports[ALERT_SEVERITY_COLOR[severity]](
|
|
1651
|
+
getSeverityLabel(severity)
|
|
1652
|
+
)
|
|
1653
|
+
]
|
|
1654
|
+
: []),
|
|
1655
|
+
...(alert.blocked
|
|
1656
|
+
? [
|
|
1657
|
+
vendor.yoctocolorsCjsExports.bold(
|
|
1658
|
+
vendor.yoctocolorsCjsExports.red('blocked')
|
|
1659
|
+
)
|
|
1660
|
+
]
|
|
1655
1661
|
: []),
|
|
1656
|
-
...(alert.blocked ? [colors.bold(colors.red('blocked'))] : []),
|
|
1657
1662
|
...(alert.fixable ? ['fixable'] : [])
|
|
1658
1663
|
]
|
|
1659
1664
|
const maybeAttributes = attributes.length
|
|
1660
|
-
? ` ${
|
|
1665
|
+
? ` ${vendor.yoctocolorsCjsExports.italic(`(${attributes.join('; ')})`)}`
|
|
1661
1666
|
: ''
|
|
1662
1667
|
// Based data from { pageProps: { alertTypes } } of:
|
|
1663
1668
|
// https://socket.dev/_next/data/94666139314b6437ee4491a0864e72b264547585/en-US.json
|
|
@@ -1693,11 +1698,11 @@ function logAlertsMap(alertsMap, options) {
|
|
|
1693
1698
|
mentionedPkgIdsWithHiddenAlerts.add(pkgId)
|
|
1694
1699
|
if (hiddenAlertsCount === 1) {
|
|
1695
1700
|
output.write(
|
|
1696
|
-
` ${
|
|
1701
|
+
` ${vendor.yoctocolorsCjsExports.dim(`+1 Hidden ${getSeverityLabel(hiddenAlerts[0].raw.severity ?? 'low')} risk alert`)}\n`
|
|
1697
1702
|
)
|
|
1698
1703
|
} else {
|
|
1699
1704
|
output.write(
|
|
1700
|
-
` ${
|
|
1705
|
+
` ${vendor.yoctocolorsCjsExports.dim(`+${hiddenAlertsCount} Hidden alerts ${vendor.yoctocolorsCjsExports.italic(getHiddenRisksDescription(getHiddenRiskCounts(hiddenAlerts)))}`)}\n`
|
|
1701
1706
|
)
|
|
1702
1707
|
}
|
|
1703
1708
|
}
|
|
@@ -1723,7 +1728,7 @@ function logAlertsMap(alertsMap, options) {
|
|
|
1723
1728
|
totalRiskCounts.low += riskCounts.low
|
|
1724
1729
|
}
|
|
1725
1730
|
output.write(
|
|
1726
|
-
`${aboveTheFoldPkgIds.size ? '\n' : ''}${
|
|
1731
|
+
`${aboveTheFoldPkgIds.size ? '\n' : ''}${vendor.yoctocolorsCjsExports.dim(`${aboveTheFoldPkgIds.size ? '+' : ''}${additionalHiddenCount} Packages with hidden alerts ${vendor.yoctocolorsCjsExports.italic(getHiddenRisksDescription(totalRiskCounts))}`)}\n`
|
|
1727
1732
|
)
|
|
1728
1733
|
}
|
|
1729
1734
|
output.write('\n')
|
|
@@ -1763,7 +1768,9 @@ function applyRange(refRange, version, style = 'preserve') {
|
|
|
1763
1768
|
case 'lte':
|
|
1764
1769
|
return `<=${version}`
|
|
1765
1770
|
case 'preserve': {
|
|
1766
|
-
const comparators = [
|
|
1771
|
+
const comparators = [
|
|
1772
|
+
...new vendor.semverExports.Range(refRange).set
|
|
1773
|
+
].flat()
|
|
1767
1774
|
const { length } = comparators
|
|
1768
1775
|
return !length || length > 1
|
|
1769
1776
|
? version
|
|
@@ -1877,20 +1884,22 @@ function findBestPatchVersion(
|
|
|
1877
1884
|
const manifestData = registry.getManifestData(NPM$1, node.name)
|
|
1878
1885
|
let eligibleVersions
|
|
1879
1886
|
if (manifestData && manifestData.name === manifestData.package) {
|
|
1880
|
-
const major =
|
|
1881
|
-
eligibleVersions = availableVersions.filter(
|
|
1887
|
+
const major = vendor.semverExports.major(manifestData.version)
|
|
1888
|
+
eligibleVersions = availableVersions.filter(
|
|
1889
|
+
v => vendor.semverExports.major(v) === major
|
|
1890
|
+
)
|
|
1882
1891
|
} else {
|
|
1883
|
-
const major =
|
|
1892
|
+
const major = vendor.semverExports.major(node.version)
|
|
1884
1893
|
eligibleVersions = availableVersions.filter(
|
|
1885
1894
|
v =>
|
|
1886
1895
|
// Filter for versions that are within the current major version and
|
|
1887
1896
|
// are NOT in the vulnerable range.
|
|
1888
|
-
|
|
1897
|
+
vendor.semverExports.major(v) === major &&
|
|
1889
1898
|
(!vulnerableVersionRange ||
|
|
1890
|
-
!
|
|
1899
|
+
!vendor.semverExports.satisfies(v, vulnerableVersionRange))
|
|
1891
1900
|
)
|
|
1892
1901
|
}
|
|
1893
|
-
return
|
|
1902
|
+
return vendor.semverExports.maxSatisfying(eligibleVersions, '*')
|
|
1894
1903
|
}
|
|
1895
1904
|
function findPackageNode(tree, name, version) {
|
|
1896
1905
|
const queue = [tree]
|
|
@@ -2251,7 +2260,7 @@ class SafeArborist extends Arborist {
|
|
|
2251
2260
|
hideAt: viewAllRisks ? 'none' : 'middle',
|
|
2252
2261
|
output: process$1.stderr
|
|
2253
2262
|
})
|
|
2254
|
-
throw new Error(
|
|
2263
|
+
throw new Error(vendor.stripIndents`
|
|
2255
2264
|
Socket ${binName} exiting due to risks.${viewAllRisks ? '' : `\nView all risks - Rerun with environment variable ${SOCKET_CLI_VIEW_ALL_RISKS}=1.`}${acceptRisks ? '' : `\nAccept risks - Rerun with environment variable ${SOCKET_CLI_ACCEPT_RISKS}=1.`}
|
|
2256
2265
|
`)
|
|
2257
2266
|
} else if (!options['silent']) {
|
|
@@ -2324,5 +2333,5 @@ exports.supportedConfigKeys = supportedConfigKeys
|
|
|
2324
2333
|
exports.updateConfigValue = updateConfigValue
|
|
2325
2334
|
exports.updateNode = updateNode
|
|
2326
2335
|
exports.updatePackageJsonFromNode = updatePackageJsonFromNode
|
|
2327
|
-
//# debugId=
|
|
2336
|
+
//# debugId=4272984d-bd34-42be-a7cc-e1ca384ab62e
|
|
2328
2337
|
//# sourceMappingURL=shadow-npm-inject.js.map
|