@socketsecurity/cli-with-sentry 0.14.67 → 0.14.69
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/blessed/lib/alias.js +521 -0
- package/dist/blessed/lib/blessed.js +34 -0
- package/dist/blessed/lib/colors.js +492 -0
- package/dist/blessed/lib/events.js +197 -0
- package/dist/blessed/lib/gpmclient.js +247 -0
- package/dist/blessed/lib/helpers.js +172 -0
- package/dist/blessed/lib/keys.js +514 -0
- package/dist/blessed/lib/program.js +4532 -0
- package/dist/blessed/lib/tput.js +3113 -0
- package/dist/blessed/lib/unicode.js +914 -0
- package/dist/blessed/lib/widget.js +62 -0
- package/dist/blessed/lib/widgets/ansiimage.js +175 -0
- package/dist/blessed/lib/widgets/bigtext.js +172 -0
- package/dist/blessed/lib/widgets/box.js +36 -0
- package/dist/blessed/lib/widgets/button.js +64 -0
- package/dist/blessed/lib/widgets/checkbox.js +97 -0
- package/dist/blessed/lib/widgets/element.js +2873 -0
- package/dist/blessed/lib/widgets/filemanager.js +225 -0
- package/dist/blessed/lib/widgets/form.js +303 -0
- package/dist/blessed/lib/widgets/image.js +73 -0
- package/dist/blessed/lib/widgets/input.js +36 -0
- package/dist/blessed/lib/widgets/layout.js +251 -0
- package/dist/blessed/lib/widgets/line.js +61 -0
- package/dist/blessed/lib/widgets/list.js +654 -0
- package/dist/blessed/lib/widgets/listbar.js +454 -0
- package/dist/blessed/lib/widgets/listtable.js +267 -0
- package/dist/blessed/lib/widgets/loading.js +90 -0
- package/dist/blessed/lib/widgets/log.js +84 -0
- package/dist/blessed/lib/widgets/message.js +147 -0
- package/dist/blessed/lib/widgets/node.js +316 -0
- package/dist/blessed/lib/widgets/overlayimage.js +796 -0
- package/dist/blessed/lib/widgets/progressbar.js +168 -0
- package/dist/blessed/lib/widgets/prompt.js +129 -0
- package/dist/blessed/lib/widgets/question.js +131 -0
- package/dist/blessed/lib/widgets/radiobutton.js +64 -0
- package/dist/blessed/lib/widgets/radioset.js +38 -0
- package/dist/blessed/lib/widgets/screen.js +2489 -0
- package/dist/blessed/lib/widgets/scrollablebox.js +417 -0
- package/dist/blessed/lib/widgets/scrollabletext.js +37 -0
- package/dist/blessed/lib/widgets/table.js +385 -0
- package/dist/blessed/lib/widgets/terminal.js +454 -0
- package/dist/blessed/lib/widgets/text.js +37 -0
- package/dist/blessed/lib/widgets/textarea.js +378 -0
- package/dist/blessed/lib/widgets/textbox.js +81 -0
- package/dist/blessed/lib/widgets/video.js +132 -0
- package/dist/blessed/usr/fonts/AUTHORS +1 -0
- package/dist/blessed/usr/fonts/LICENSE +94 -0
- package/dist/blessed/usr/fonts/README +340 -0
- package/dist/blessed/usr/fonts/ter-u14b.json +17826 -0
- package/dist/blessed/usr/fonts/ter-u14n.json +17826 -0
- 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 +243 -0
- package/dist/blessed/usr/xterm.terminfo +1977 -0
- package/dist/blessed/vendor/tng.js +1878 -0
- package/dist/constants.d.ts +271 -207
- package/dist/constants.js +271 -227
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.d.ts +1 -1
- package/dist/instrument-with-sentry.js +27 -24
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/artifact.d.ts +60 -26
- package/dist/module-sync/cli.d.ts +1 -1
- package/dist/module-sync/cli.js +6803 -4726
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/cmd.d.ts +4 -4
- package/dist/module-sync/config.d.ts +42 -17
- package/dist/module-sync/edge.d.ts +73 -60
- package/dist/module-sync/errors.d.ts +26 -11
- package/dist/module-sync/index.d.ts +31 -20
- package/dist/module-sync/node.d.ts +118 -83
- package/dist/module-sync/override-set.d.ts +39 -33
- package/dist/module-sync/package-environment.d.ts +83 -52
- package/dist/module-sync/path-resolve.d.ts +14 -9
- package/dist/module-sync/sdk.d.ts +9 -5
- package/dist/module-sync/shadow-bin.d.ts +5 -2
- package/dist/module-sync/shadow-bin.js +82 -66
- package/dist/module-sync/shadow-bin.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.d.ts +1 -1
- package/dist/module-sync/shadow-npm-inject.js +1231 -986
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/module-sync/shadow-npm-paths.d.ts +28 -14
- package/dist/module-sync/shadow-npm-paths.js +300 -208
- package/dist/module-sync/shadow-npm-paths.js.map +1 -1
- package/dist/module-sync/socket-package-alert.d.ts +95 -39
- package/dist/module-sync/types.d.ts +75 -47
- package/dist/module-sync/vendor.js +15055 -0
- package/dist/module-sync/vendor.js.map +1 -0
- package/dist/require/cli.d.ts +1 -1
- package/dist/require/cli.js +6802 -4724
- package/dist/require/cli.js.map +1 -1
- package/dist/require/vendor.js +2 -9145
- package/package.json +48 -38
- package/dist/require/vendor.js.map +0 -1
package/dist/constants.js
CHANGED
|
@@ -1,270 +1,314 @@
|
|
|
1
|
-
'use strict'
|
|
1
|
+
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
const fs = require('node:fs')
|
|
4
|
+
const os = require('node:os')
|
|
5
|
+
const path = require('node:path')
|
|
6
|
+
const process = require('node:process')
|
|
7
|
+
const registryConstants = require('@socketsecurity/registry/lib/constants')
|
|
8
|
+
const env = require('@socketsecurity/registry/lib/env')
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
11
|
NODE_MODULES,
|
|
12
12
|
NPM,
|
|
13
13
|
SOCKET_SECURITY_SCOPE,
|
|
14
14
|
kInternalsSymbol,
|
|
15
|
-
[kInternalsSymbol]: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
15
|
+
[kInternalsSymbol]: { createConstantsObject, getIpc }
|
|
16
|
+
} = registryConstants
|
|
17
|
+
const ALERT_TYPE_CRITICAL_CVE = 'criticalCVE'
|
|
18
|
+
const ALERT_TYPE_CVE = 'cve'
|
|
19
|
+
const ALERT_TYPE_MEDIUM_CVE = 'mediumCVE'
|
|
20
|
+
const ALERT_TYPE_MILD_CVE = 'mildCVE'
|
|
21
|
+
const API_V0_URL = 'https://api.socket.dev/v0/'
|
|
22
|
+
const BINARY_LOCK_EXT = '.lockb'
|
|
23
|
+
const BUN = 'bun'
|
|
24
|
+
const CLI = 'cli'
|
|
25
|
+
const CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER =
|
|
26
|
+
'firstPatchedVersionIdentifier'
|
|
27
|
+
const DRY_RUN_LABEL = '[DryRun]'
|
|
28
|
+
const DRY_RUN_BAIL_TEXT = `${DRY_RUN_LABEL}: Bailing now`
|
|
29
|
+
const INLINED_SOCKET_CLI_LEGACY_BUILD = 'INLINED_SOCKET_CLI_LEGACY_BUILD'
|
|
30
|
+
const INLINED_SOCKET_CLI_PUBLISHED_BUILD = 'INLINED_SOCKET_CLI_PUBLISHED_BUILD'
|
|
31
|
+
const INLINED_SOCKET_CLI_SENTRY_BUILD = 'INLINED_SOCKET_CLI_SENTRY_BUILD'
|
|
32
|
+
const LOCALAPPDATA = 'LOCALAPPDATA'
|
|
33
|
+
const LOCK_EXT = '.lock'
|
|
34
|
+
const MODULE_SYNC = 'module-sync'
|
|
35
|
+
const NPM_BUGGY_OVERRIDES_PATCHED_VERSION = '11.2.0'
|
|
36
|
+
const NPM_REGISTRY_URL = 'https://registry.npmjs.org'
|
|
37
|
+
const PNPM = 'pnpm'
|
|
38
|
+
const REDACTED = '<redacted>'
|
|
39
|
+
const REQUIRE = 'require'
|
|
40
|
+
const SHADOW_NPM_BIN = 'shadow-bin'
|
|
41
|
+
const SHADOW_NPM_INJECT = 'shadow-npm-inject'
|
|
42
|
+
const SHADOW_NPM_PATHS = 'shadow-npm-paths'
|
|
43
|
+
const SOCKET = 'socket'
|
|
44
|
+
const SOCKET_APP_DIR = 'socket/settings'
|
|
45
|
+
const SOCKET_CLI_ACCEPT_RISKS = 'SOCKET_CLI_ACCEPT_RISKS'
|
|
46
|
+
const SOCKET_CLI_BIN_NAME = 'socket'
|
|
47
|
+
const SOCKET_CLI_BIN_NAME_ALIAS = 'cli'
|
|
48
|
+
const SOCKET_CLI_DEBUG = 'SOCKET_CLI_DEBUG'
|
|
49
|
+
const SOCKET_CLI_FIX = 'SOCKET_CLI_FIX'
|
|
50
|
+
const SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues'
|
|
51
|
+
const SOCKET_CLI_LEGACY_PACKAGE_NAME = `${SOCKET_SECURITY_SCOPE}/cli`
|
|
52
|
+
const SOCKET_CLI_NO_API_TOKEN = 'SOCKET_CLI_NO_API_TOKEN'
|
|
53
|
+
const SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE'
|
|
54
|
+
const SOCKET_CLI_NPM_BIN_NAME = 'socket-npm'
|
|
55
|
+
const SOCKET_CLI_NPX_BIN_NAME = 'socket-npx'
|
|
56
|
+
const SOCKET_CLI_PACKAGE_NAME = 'socket'
|
|
57
|
+
const SOCKET_CLI_SAFE_BIN = 'SOCKET_CLI_SAFE_BIN'
|
|
58
|
+
const SOCKET_CLI_SAFE_PROGRESS = 'SOCKET_CLI_SAFE_PROGRESS'
|
|
59
|
+
const SOCKET_CLI_SENTRY_BIN_NAME = 'socket-with-sentry'
|
|
60
|
+
const SOCKET_CLI_SENTRY_BIN_NAME_ALIAS = 'cli-with-sentry'
|
|
61
|
+
const SOCKET_CLI_SENTRY_NPM_BIN_NAME = 'socket-npm-with-sentry'
|
|
62
|
+
const SOCKET_CLI_SENTRY_NPX_BIN_NAME = 'socket-npx-with-sentry'
|
|
63
|
+
const SOCKET_CLI_SENTRY_PACKAGE_NAME = `${SOCKET_SECURITY_SCOPE}/cli-with-sentry`
|
|
64
|
+
const SOCKET_CLI_VIEW_ALL_RISKS = 'SOCKET_CLI_VIEW_ALL_RISKS'
|
|
65
|
+
const SOCKET_SECURITY_API_BASE_URL = 'SOCKET_SECURITY_API_BASE_URL'
|
|
66
|
+
const SOCKET_SECURITY_API_PROXY = 'SOCKET_SECURITY_API_PROXY'
|
|
67
|
+
const SOCKET_SECURITY_API_TOKEN = 'SOCKET_SECURITY_API_TOKEN'
|
|
68
|
+
const VLT = 'vlt'
|
|
69
|
+
const WITH_SENTRY = 'with-sentry'
|
|
70
|
+
const XDG_DATA_HOME = 'XDG_DATA_HOME'
|
|
71
|
+
const YARN = 'yarn'
|
|
72
|
+
const YARN_BERRY = 'yarn/berry'
|
|
73
|
+
const YARN_CLASSIC = 'yarn/classic'
|
|
74
|
+
const YARN_LOCK = 'yarn.lock'
|
|
75
|
+
let _Sentry
|
|
76
|
+
const LAZY_DIST_TYPE = () =>
|
|
77
|
+
registryConstants.SUPPORTS_NODE_REQUIRE_MODULE ? MODULE_SYNC : REQUIRE
|
|
71
78
|
const LAZY_ENV = () => {
|
|
72
|
-
const {
|
|
73
|
-
env: env$1
|
|
74
|
-
} = process;
|
|
79
|
+
const { env: env$1 } = process
|
|
75
80
|
// We inline some environment values so that they CANNOT be influenced by user
|
|
76
81
|
// provided environment variables.
|
|
77
82
|
return Object.freeze({
|
|
78
83
|
// Lazily access registryConstants.ENV.
|
|
79
84
|
...registryConstants.ENV,
|
|
80
|
-
// Inlined flag
|
|
85
|
+
// Inlined flag to determine if this is the Legacy build.
|
|
81
86
|
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_LEGACY_BUILD]".
|
|
82
87
|
INLINED_SOCKET_CLI_LEGACY_BUILD: false,
|
|
83
|
-
// Inlined flag
|
|
88
|
+
// Inlined flag to determine if this is a published build.
|
|
84
89
|
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_PUBLISHED_BUILD]".
|
|
85
90
|
INLINED_SOCKET_CLI_PUBLISHED_BUILD: true,
|
|
86
|
-
// Inlined flag
|
|
91
|
+
// Inlined flag to determine if this is the Sentry build.
|
|
87
92
|
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_SENTRY_BUILD]".
|
|
88
93
|
INLINED_SOCKET_CLI_SENTRY_BUILD: true,
|
|
89
|
-
//
|
|
94
|
+
// The location of the %localappdata% folder on Windows used to store user-specific,
|
|
95
|
+
// non-roaming application data, like temporary files, cached data, and program
|
|
96
|
+
// settings, that are specific to the current machine and user.
|
|
97
|
+
LOCALAPPDATA: env.envAsString(env$1['LOCALAPPDATA']),
|
|
98
|
+
// Flag to accepts risks of safe-npm and safe-npx run.
|
|
99
|
+
SOCKET_CLI_ACCEPT_RISKS: env.envAsBoolean(env$1['SOCKET_CLI_ACCEPT_RISKS']),
|
|
100
|
+
// Flag to help debug Socket CLI.
|
|
90
101
|
SOCKET_CLI_DEBUG: env.envAsBoolean(env$1['SOCKET_CLI_DEBUG']),
|
|
91
|
-
// Flag
|
|
102
|
+
// Flag to make the default API token `undefined`.
|
|
92
103
|
SOCKET_CLI_NO_API_TOKEN: env.envAsBoolean(env$1['SOCKET_CLI_NO_API_TOKEN']),
|
|
93
|
-
// Flag
|
|
104
|
+
// Flag to view all risks of safe-npm and safe-npx run.
|
|
105
|
+
SOCKET_CLI_VIEW_ALL_RISKS: env.envAsBoolean(
|
|
106
|
+
env$1['SOCKET_CLI_VIEW_ALL_RISKS']
|
|
107
|
+
),
|
|
108
|
+
// Flag to change the base URL for all API-calls.
|
|
109
|
+
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development
|
|
110
|
+
SOCKET_SECURITY_API_BASE_URL: env.envAsString(
|
|
111
|
+
env$1['SOCKET_SECURITY_API_BASE_URL']
|
|
112
|
+
),
|
|
113
|
+
// Flag to set the proxy all requests are routed through.
|
|
114
|
+
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development
|
|
115
|
+
SOCKET_SECURITY_API_PROXY: env.envAsString(
|
|
116
|
+
env$1['SOCKET_SECURITY_API_PROXY']
|
|
117
|
+
),
|
|
118
|
+
// Flag to set the API token.
|
|
94
119
|
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables
|
|
95
|
-
SOCKET_SECURITY_API_TOKEN:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
120
|
+
SOCKET_SECURITY_API_TOKEN:
|
|
121
|
+
env.envAsString(env$1['SOCKET_SECURITY_API_TOKEN']) ||
|
|
122
|
+
// Keep 'SOCKET_SECURITY_API_KEY' as an alias of 'SOCKET_SECURITY_API_TOKEN'.
|
|
123
|
+
// TODO: Remove 'SOCKET_SECURITY_API_KEY' alias.
|
|
124
|
+
env.envAsString(env$1['SOCKET_SECURITY_API_KEY']),
|
|
125
|
+
// The location of the base directory on Linux and MacOS used to store
|
|
126
|
+
// user-specific data files, defaulting to $HOME/.local/share if not set or empty.
|
|
127
|
+
XDG_DATA_HOME: env.envAsString(env$1['XDG_DATA_HOME'])
|
|
128
|
+
})
|
|
129
|
+
}
|
|
101
130
|
const lazyBashRcPath = () =>
|
|
102
|
-
// Lazily access constants.homePath.
|
|
103
|
-
path.join(constants.homePath, '.bashrc')
|
|
131
|
+
// Lazily access constants.homePath.
|
|
132
|
+
path.join(constants.homePath, '.bashrc')
|
|
104
133
|
const lazyDistCliPath = () =>
|
|
105
|
-
// Lazily access constants.distPath.
|
|
106
|
-
path.join(constants.distPath, 'cli.js')
|
|
134
|
+
// Lazily access constants.distPath.
|
|
135
|
+
path.join(constants.distPath, 'cli.js')
|
|
107
136
|
const lazyDistInstrumentWithSentryPath = () =>
|
|
108
|
-
// Lazily access constants.rootDistPath.
|
|
109
|
-
path.join(constants.rootDistPath, 'instrument-with-sentry.js')
|
|
137
|
+
// Lazily access constants.rootDistPath.
|
|
138
|
+
path.join(constants.rootDistPath, 'instrument-with-sentry.js')
|
|
110
139
|
const lazyDistPath = () =>
|
|
111
|
-
// Lazily access constants.rootDistPath and constants.DIST_TYPE.
|
|
112
|
-
path.join(constants.rootDistPath, constants.DIST_TYPE)
|
|
140
|
+
// Lazily access constants.rootDistPath and constants.DIST_TYPE.
|
|
141
|
+
path.join(constants.rootDistPath, constants.DIST_TYPE)
|
|
113
142
|
const lazyDistShadowNpmBinPath = () =>
|
|
114
|
-
// Lazily access constants.distPath.
|
|
115
|
-
path.join(constants.distPath, `${SHADOW_NPM_BIN}.js`)
|
|
143
|
+
// Lazily access constants.distPath.
|
|
144
|
+
path.join(constants.distPath, `${SHADOW_NPM_BIN}.js`)
|
|
116
145
|
const lazyDistShadowNpmInjectPath = () =>
|
|
117
|
-
// Lazily access constants.distPath.
|
|
118
|
-
path.join(constants.distPath, `${SHADOW_NPM_INJECT}.js`)
|
|
119
|
-
const lazyHomePath = () => os.homedir()
|
|
120
|
-
const lazyMinimumVersionByAgent = () =>
|
|
121
|
-
|
|
122
|
-
//
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
//
|
|
129
|
-
// https://
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
//
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
//
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
// Lazily access constants.distPath.
|
|
147
|
+
path.join(constants.distPath, `${SHADOW_NPM_INJECT}.js`)
|
|
148
|
+
const lazyHomePath = () => os.homedir()
|
|
149
|
+
const lazyMinimumVersionByAgent = () =>
|
|
150
|
+
new Map([
|
|
151
|
+
// Bun >=1.1.39 supports the text-based lockfile.
|
|
152
|
+
// https://bun.sh/blog/bun-lock-text-lockfile
|
|
153
|
+
[BUN, '1.1.39'],
|
|
154
|
+
// The npm version bundled with Node 18.
|
|
155
|
+
// https://nodejs.org/en/about/previous-releases#looking-for-the-latest-release-of-a-version-branch
|
|
156
|
+
[NPM, '10.8.2'],
|
|
157
|
+
// 8.x is the earliest version to support Node 18.
|
|
158
|
+
// https://pnpm.io/installation#compatibility
|
|
159
|
+
// https://www.npmjs.com/package/pnpm?activeTab=versions
|
|
160
|
+
[PNPM, '8.15.9'],
|
|
161
|
+
// 4.x supports >= Node 18.12.0
|
|
162
|
+
// https://github.com/yarnpkg/berry/blob/%40yarnpkg/core/4.1.0/CHANGELOG.md#400
|
|
163
|
+
[YARN_BERRY, '4.0.0'],
|
|
164
|
+
// Latest 1.x.
|
|
165
|
+
// https://www.npmjs.com/package/yarn?activeTab=versions
|
|
166
|
+
[YARN_CLASSIC, '1.22.22'],
|
|
167
|
+
// vlt does not support overrides so we don't gate on it.
|
|
168
|
+
[VLT, '*']
|
|
169
|
+
])
|
|
139
170
|
const lazyNmBinPath = () =>
|
|
140
|
-
// Lazily access constants.rootPath.
|
|
141
|
-
path.join(constants.rootPath, `${NODE_MODULES}/.bin`)
|
|
171
|
+
// Lazily access constants.rootPath.
|
|
172
|
+
path.join(constants.rootPath, `${NODE_MODULES}/.bin`)
|
|
142
173
|
|
|
143
174
|
// Redefine registryConstants.nodeHardenFlags to account for the
|
|
144
175
|
// INLINED_SOCKET_CLI_SENTRY_BUILD environment variable.
|
|
145
176
|
const lazyNodeHardenFlags = () =>
|
|
146
|
-
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_SENTRY_BUILD]".
|
|
147
|
-
|
|
148
|
-
[] ;
|
|
177
|
+
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_SENTRY_BUILD]".
|
|
178
|
+
[]
|
|
149
179
|
const lazyRootBinPath = () =>
|
|
150
|
-
// Lazily access constants.rootPath.
|
|
151
|
-
path.join(constants.rootPath, 'bin')
|
|
180
|
+
// Lazily access constants.rootPath.
|
|
181
|
+
path.join(constants.rootPath, 'bin')
|
|
152
182
|
const lazyRootDistPath = () =>
|
|
153
|
-
// Lazily access constants.rootPath.
|
|
154
|
-
path.join(constants.rootPath, 'dist')
|
|
183
|
+
// Lazily access constants.rootPath.
|
|
184
|
+
path.join(constants.rootPath, 'dist')
|
|
155
185
|
const lazyRootPath = () =>
|
|
156
|
-
|
|
157
|
-
|
|
186
|
+
path.join(
|
|
187
|
+
fs.realpathSync.native(__dirname),
|
|
188
|
+
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_TEST_DIST_BUILD']".
|
|
189
|
+
'..'
|
|
190
|
+
)
|
|
158
191
|
const lazyShadowBinPath = () =>
|
|
159
|
-
// Lazily access constants.rootPath.
|
|
160
|
-
path.join(constants.rootPath, SHADOW_NPM_BIN)
|
|
192
|
+
// Lazily access constants.rootPath.
|
|
193
|
+
path.join(constants.rootPath, SHADOW_NPM_BIN)
|
|
161
194
|
const lazyZshRcPath = () =>
|
|
162
|
-
// Lazily access constants.homePath.
|
|
163
|
-
path.join(constants.homePath, '.zshrc')
|
|
164
|
-
const constants = createConstantsObject(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
distShadowNpmInjectPath: lazyDistShadowNpmInjectPath,
|
|
242
|
-
homePath: lazyHomePath,
|
|
243
|
-
minimumVersionByAgent: lazyMinimumVersionByAgent,
|
|
244
|
-
nmBinPath: lazyNmBinPath,
|
|
245
|
-
nodeHardenFlags: lazyNodeHardenFlags,
|
|
246
|
-
rootBinPath: lazyRootBinPath,
|
|
247
|
-
rootDistPath: lazyRootDistPath,
|
|
248
|
-
rootPath: lazyRootPath,
|
|
249
|
-
shadowBinPath: lazyShadowBinPath,
|
|
250
|
-
zshRcPath: lazyZshRcPath
|
|
195
|
+
// Lazily access constants.homePath.
|
|
196
|
+
path.join(constants.homePath, '.zshrc')
|
|
197
|
+
const constants = createConstantsObject(
|
|
198
|
+
{
|
|
199
|
+
ALERT_TYPE_CRITICAL_CVE,
|
|
200
|
+
ALERT_TYPE_CVE,
|
|
201
|
+
ALERT_TYPE_MEDIUM_CVE,
|
|
202
|
+
ALERT_TYPE_MILD_CVE,
|
|
203
|
+
API_V0_URL,
|
|
204
|
+
BINARY_LOCK_EXT,
|
|
205
|
+
BUN,
|
|
206
|
+
CLI,
|
|
207
|
+
CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,
|
|
208
|
+
// Lazily defined values are initialized as `undefined` to keep their key order.
|
|
209
|
+
DIST_TYPE: undefined,
|
|
210
|
+
DRY_RUN_LABEL,
|
|
211
|
+
DRY_RUN_BAIL_TEXT,
|
|
212
|
+
ENV: undefined,
|
|
213
|
+
INLINED_SOCKET_CLI_LEGACY_BUILD,
|
|
214
|
+
INLINED_SOCKET_CLI_PUBLISHED_BUILD,
|
|
215
|
+
INLINED_SOCKET_CLI_SENTRY_BUILD,
|
|
216
|
+
LOCALAPPDATA,
|
|
217
|
+
LOCK_EXT,
|
|
218
|
+
MODULE_SYNC,
|
|
219
|
+
NPM_BUGGY_OVERRIDES_PATCHED_VERSION,
|
|
220
|
+
NPM_REGISTRY_URL,
|
|
221
|
+
PNPM,
|
|
222
|
+
REDACTED,
|
|
223
|
+
REQUIRE,
|
|
224
|
+
SHADOW_NPM_BIN,
|
|
225
|
+
SHADOW_NPM_INJECT,
|
|
226
|
+
SHADOW_NPM_PATHS,
|
|
227
|
+
SOCKET,
|
|
228
|
+
SOCKET_APP_DIR,
|
|
229
|
+
SOCKET_CLI_ACCEPT_RISKS,
|
|
230
|
+
SOCKET_CLI_BIN_NAME,
|
|
231
|
+
SOCKET_CLI_BIN_NAME_ALIAS,
|
|
232
|
+
SOCKET_CLI_DEBUG,
|
|
233
|
+
SOCKET_CLI_FIX,
|
|
234
|
+
SOCKET_CLI_ISSUES_URL,
|
|
235
|
+
SOCKET_CLI_SENTRY_BIN_NAME_ALIAS,
|
|
236
|
+
SOCKET_CLI_LEGACY_PACKAGE_NAME,
|
|
237
|
+
SOCKET_CLI_NO_API_TOKEN,
|
|
238
|
+
SOCKET_CLI_NPM_BIN_NAME,
|
|
239
|
+
SOCKET_CLI_NPX_BIN_NAME,
|
|
240
|
+
SOCKET_CLI_OPTIMIZE,
|
|
241
|
+
SOCKET_CLI_PACKAGE_NAME,
|
|
242
|
+
SOCKET_CLI_SAFE_BIN,
|
|
243
|
+
SOCKET_CLI_SAFE_PROGRESS,
|
|
244
|
+
SOCKET_CLI_SENTRY_BIN_NAME,
|
|
245
|
+
SOCKET_CLI_SENTRY_NPM_BIN_NAME,
|
|
246
|
+
SOCKET_CLI_SENTRY_NPX_BIN_NAME,
|
|
247
|
+
SOCKET_CLI_SENTRY_PACKAGE_NAME,
|
|
248
|
+
SOCKET_CLI_VIEW_ALL_RISKS,
|
|
249
|
+
SOCKET_SECURITY_API_BASE_URL,
|
|
250
|
+
SOCKET_SECURITY_API_PROXY,
|
|
251
|
+
SOCKET_SECURITY_API_TOKEN,
|
|
252
|
+
VLT,
|
|
253
|
+
WITH_SENTRY,
|
|
254
|
+
XDG_DATA_HOME,
|
|
255
|
+
YARN,
|
|
256
|
+
YARN_BERRY,
|
|
257
|
+
YARN_CLASSIC,
|
|
258
|
+
YARN_LOCK,
|
|
259
|
+
bashRcPath: undefined,
|
|
260
|
+
distCliPath: undefined,
|
|
261
|
+
distInstrumentWithSentryPath: undefined,
|
|
262
|
+
distPath: undefined,
|
|
263
|
+
distShadowNpmBinPath: undefined,
|
|
264
|
+
distShadowNpmInjectPath: undefined,
|
|
265
|
+
homePath: undefined,
|
|
266
|
+
minimumVersionByAgent: undefined,
|
|
267
|
+
nmBinPath: undefined,
|
|
268
|
+
nodeHardenFlags: undefined,
|
|
269
|
+
rootBinPath: undefined,
|
|
270
|
+
rootDistPath: undefined,
|
|
271
|
+
rootPath: undefined,
|
|
272
|
+
shadowBinPath: undefined,
|
|
273
|
+
zshRcPath: undefined
|
|
251
274
|
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
275
|
+
{
|
|
276
|
+
getters: {
|
|
277
|
+
DIST_TYPE: LAZY_DIST_TYPE,
|
|
278
|
+
ENV: LAZY_ENV,
|
|
279
|
+
bashRcPath: lazyBashRcPath,
|
|
280
|
+
distCliPath: lazyDistCliPath,
|
|
281
|
+
distInstrumentWithSentryPath: lazyDistInstrumentWithSentryPath,
|
|
282
|
+
distPath: lazyDistPath,
|
|
283
|
+
distShadowNpmBinPath: lazyDistShadowNpmBinPath,
|
|
284
|
+
distShadowNpmInjectPath: lazyDistShadowNpmInjectPath,
|
|
285
|
+
homePath: lazyHomePath,
|
|
286
|
+
minimumVersionByAgent: lazyMinimumVersionByAgent,
|
|
287
|
+
nmBinPath: lazyNmBinPath,
|
|
288
|
+
nodeHardenFlags: lazyNodeHardenFlags,
|
|
289
|
+
rootBinPath: lazyRootBinPath,
|
|
290
|
+
rootDistPath: lazyRootDistPath,
|
|
291
|
+
rootPath: lazyRootPath,
|
|
292
|
+
shadowBinPath: lazyShadowBinPath,
|
|
293
|
+
zshRcPath: lazyZshRcPath
|
|
256
294
|
},
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return
|
|
295
|
+
internals: {
|
|
296
|
+
getIpc,
|
|
297
|
+
getSentry() {
|
|
298
|
+
return _Sentry
|
|
299
|
+
},
|
|
300
|
+
setSentry(Sentry) {
|
|
301
|
+
if (_Sentry === undefined) {
|
|
302
|
+
_Sentry = Sentry
|
|
303
|
+
return true
|
|
304
|
+
}
|
|
305
|
+
return false
|
|
261
306
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
});
|
|
307
|
+
},
|
|
308
|
+
mixin: registryConstants
|
|
309
|
+
}
|
|
310
|
+
)
|
|
267
311
|
|
|
268
|
-
module.exports = constants
|
|
269
|
-
//# debugId=
|
|
312
|
+
module.exports = constants
|
|
313
|
+
//# debugId=5b0e4686-31cf-4423-99c5-f986ce441719
|
|
270
314
|
//# sourceMappingURL=constants.js.map
|