@socketsecurity/cli 0.14.66 → 0.14.68
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 -205
- package/dist/constants.js +282 -228
- package/dist/constants.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 +6987 -4411
- 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 +32 -0
- 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 +78 -64
- 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 +1209 -1006
- 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 +286 -209
- 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 +11181 -0
- package/dist/{require → module-sync}/vendor.js.map +1 -1
- package/dist/require/cli.d.ts +1 -1
- package/dist/require/cli.js +6987 -4409
- package/dist/require/cli.js.map +1 -1
- package/dist/require/vendor.js +2 -9145
- package/package.json +48 -40
- package/dist/module-sync/settings.d.ts +0 -15
package/dist/constants.js
CHANGED
|
@@ -1,269 +1,323 @@
|
|
|
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
|
-
|
|
69
|
-
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
|
|
70
78
|
const LAZY_ENV = () => {
|
|
71
|
-
const {
|
|
72
|
-
env: env$1
|
|
73
|
-
} = process;
|
|
79
|
+
const { env: env$1 } = process
|
|
74
80
|
// We inline some environment values so that they CANNOT be influenced by user
|
|
75
81
|
// provided environment variables.
|
|
76
82
|
return Object.freeze({
|
|
77
83
|
// Lazily access registryConstants.ENV.
|
|
78
84
|
...registryConstants.ENV,
|
|
79
|
-
// Inlined flag
|
|
85
|
+
// Inlined flag to determine if this is the Legacy build.
|
|
80
86
|
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_LEGACY_BUILD]".
|
|
81
87
|
INLINED_SOCKET_CLI_LEGACY_BUILD: true,
|
|
82
|
-
// Inlined flag
|
|
88
|
+
// Inlined flag to determine if this is a published build.
|
|
83
89
|
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_PUBLISHED_BUILD]".
|
|
84
90
|
INLINED_SOCKET_CLI_PUBLISHED_BUILD: true,
|
|
85
|
-
// Inlined flag
|
|
91
|
+
// Inlined flag to determine if this is the Sentry build.
|
|
86
92
|
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_SENTRY_BUILD]".
|
|
87
93
|
INLINED_SOCKET_CLI_SENTRY_BUILD: false,
|
|
88
|
-
//
|
|
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.
|
|
89
101
|
SOCKET_CLI_DEBUG: env.envAsBoolean(env$1['SOCKET_CLI_DEBUG']),
|
|
90
|
-
// Flag
|
|
91
|
-
SOCKET_CLI_NO_API_TOKEN: env.envAsBoolean(env$1['SOCKET_CLI_NO_API_TOKEN'])
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
// Flag to make the default API token `undefined`.
|
|
103
|
+
SOCKET_CLI_NO_API_TOKEN: env.envAsBoolean(env$1['SOCKET_CLI_NO_API_TOKEN']),
|
|
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.
|
|
119
|
+
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables
|
|
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
|
+
}
|
|
94
130
|
const lazyBashRcPath = () =>
|
|
95
|
-
// Lazily access constants.homePath.
|
|
96
|
-
path.join(constants.homePath, '.bashrc')
|
|
131
|
+
// Lazily access constants.homePath.
|
|
132
|
+
path.join(constants.homePath, '.bashrc')
|
|
97
133
|
const lazyDistCliPath = () =>
|
|
98
|
-
// Lazily access constants.distPath.
|
|
99
|
-
path.join(constants.distPath, 'cli.js')
|
|
134
|
+
// Lazily access constants.distPath.
|
|
135
|
+
path.join(constants.distPath, 'cli.js')
|
|
100
136
|
const lazyDistInstrumentWithSentryPath = () =>
|
|
101
|
-
// Lazily access constants.rootDistPath.
|
|
102
|
-
path.join(constants.rootDistPath, 'instrument-with-sentry.js')
|
|
137
|
+
// Lazily access constants.rootDistPath.
|
|
138
|
+
path.join(constants.rootDistPath, 'instrument-with-sentry.js')
|
|
103
139
|
const lazyDistPath = () =>
|
|
104
|
-
// Lazily access constants.rootDistPath and constants.DIST_TYPE.
|
|
105
|
-
path.join(constants.rootDistPath, constants.DIST_TYPE)
|
|
140
|
+
// Lazily access constants.rootDistPath and constants.DIST_TYPE.
|
|
141
|
+
path.join(constants.rootDistPath, constants.DIST_TYPE)
|
|
106
142
|
const lazyDistShadowNpmBinPath = () =>
|
|
107
|
-
// Lazily access constants.distPath.
|
|
108
|
-
path.join(constants.distPath, `${SHADOW_NPM_BIN}.js`)
|
|
143
|
+
// Lazily access constants.distPath.
|
|
144
|
+
path.join(constants.distPath, `${SHADOW_NPM_BIN}.js`)
|
|
109
145
|
const lazyDistShadowNpmInjectPath = () =>
|
|
110
|
-
// Lazily access constants.distPath.
|
|
111
|
-
path.join(constants.distPath, `${SHADOW_NPM_INJECT}.js`)
|
|
112
|
-
const lazyHomePath = () => os.homedir()
|
|
113
|
-
const lazyMinimumVersionByAgent = () =>
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
//
|
|
122
|
-
// https://
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
+
])
|
|
132
170
|
const lazyNmBinPath = () =>
|
|
133
|
-
// Lazily access constants.rootPath.
|
|
134
|
-
path.join(constants.rootPath, `${NODE_MODULES}/.bin`)
|
|
171
|
+
// Lazily access constants.rootPath.
|
|
172
|
+
path.join(constants.rootPath, `${NODE_MODULES}/.bin`)
|
|
135
173
|
|
|
136
174
|
// Redefine registryConstants.nodeHardenFlags to account for the
|
|
137
175
|
// INLINED_SOCKET_CLI_SENTRY_BUILD environment variable.
|
|
138
176
|
const lazyNodeHardenFlags = () =>
|
|
139
|
-
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_SENTRY_BUILD]".
|
|
140
|
-
// Lazily access constants.WIN32.
|
|
141
|
-
constants.WIN32
|
|
142
|
-
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
// √ https://github.com/
|
|
148
|
-
|
|
177
|
+
// The '@rollup/plugin-replace' will replace "process.env[INLINED_SOCKET_CLI_SENTRY_BUILD]".
|
|
178
|
+
// Lazily access constants.WIN32.
|
|
179
|
+
constants.WIN32
|
|
180
|
+
? []
|
|
181
|
+
: // Harden Node security.
|
|
182
|
+
// https://nodejs.org/en/learn/getting-started/security-best-practices
|
|
183
|
+
// We have contributed the following patches to our dependencies to make
|
|
184
|
+
// Node's --frozen-intrinsics workable.
|
|
185
|
+
// √ https://github.com/SBoudrias/Inquirer.js/pull/1683
|
|
186
|
+
// √ https://github.com/pnpm/components/pull/23
|
|
187
|
+
['--disable-proto', 'delete', '--frozen-intrinsics', '--no-deprecation']
|
|
149
188
|
const lazyRootBinPath = () =>
|
|
150
|
-
// Lazily access constants.rootPath.
|
|
151
|
-
path.join(constants.rootPath, 'bin')
|
|
189
|
+
// Lazily access constants.rootPath.
|
|
190
|
+
path.join(constants.rootPath, 'bin')
|
|
152
191
|
const lazyRootDistPath = () =>
|
|
153
|
-
// Lazily access constants.rootPath.
|
|
154
|
-
path.join(constants.rootPath, 'dist')
|
|
192
|
+
// Lazily access constants.rootPath.
|
|
193
|
+
path.join(constants.rootPath, 'dist')
|
|
155
194
|
const lazyRootPath = () =>
|
|
156
|
-
|
|
157
|
-
|
|
195
|
+
path.join(
|
|
196
|
+
fs.realpathSync.native(__dirname),
|
|
197
|
+
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_TEST_DIST_BUILD']".
|
|
198
|
+
'..'
|
|
199
|
+
)
|
|
158
200
|
const lazyShadowBinPath = () =>
|
|
159
|
-
// Lazily access constants.rootPath.
|
|
160
|
-
path.join(constants.rootPath, SHADOW_NPM_BIN)
|
|
201
|
+
// Lazily access constants.rootPath.
|
|
202
|
+
path.join(constants.rootPath, SHADOW_NPM_BIN)
|
|
161
203
|
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
|
-
homePath: lazyHomePath,
|
|
242
|
-
minimumVersionByAgent: lazyMinimumVersionByAgent,
|
|
243
|
-
nmBinPath: lazyNmBinPath,
|
|
244
|
-
nodeHardenFlags: lazyNodeHardenFlags,
|
|
245
|
-
rootBinPath: lazyRootBinPath,
|
|
246
|
-
rootDistPath: lazyRootDistPath,
|
|
247
|
-
rootPath: lazyRootPath,
|
|
248
|
-
shadowBinPath: lazyShadowBinPath,
|
|
249
|
-
zshRcPath: lazyZshRcPath
|
|
204
|
+
// Lazily access constants.homePath.
|
|
205
|
+
path.join(constants.homePath, '.zshrc')
|
|
206
|
+
const constants = createConstantsObject(
|
|
207
|
+
{
|
|
208
|
+
ALERT_TYPE_CRITICAL_CVE,
|
|
209
|
+
ALERT_TYPE_CVE,
|
|
210
|
+
ALERT_TYPE_MEDIUM_CVE,
|
|
211
|
+
ALERT_TYPE_MILD_CVE,
|
|
212
|
+
API_V0_URL,
|
|
213
|
+
BINARY_LOCK_EXT,
|
|
214
|
+
BUN,
|
|
215
|
+
CLI,
|
|
216
|
+
CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,
|
|
217
|
+
// Lazily defined values are initialized as `undefined` to keep their key order.
|
|
218
|
+
DIST_TYPE: undefined,
|
|
219
|
+
DRY_RUN_LABEL,
|
|
220
|
+
DRY_RUN_BAIL_TEXT,
|
|
221
|
+
ENV: undefined,
|
|
222
|
+
INLINED_SOCKET_CLI_LEGACY_BUILD,
|
|
223
|
+
INLINED_SOCKET_CLI_PUBLISHED_BUILD,
|
|
224
|
+
INLINED_SOCKET_CLI_SENTRY_BUILD,
|
|
225
|
+
LOCALAPPDATA,
|
|
226
|
+
LOCK_EXT,
|
|
227
|
+
MODULE_SYNC,
|
|
228
|
+
NPM_BUGGY_OVERRIDES_PATCHED_VERSION,
|
|
229
|
+
NPM_REGISTRY_URL,
|
|
230
|
+
PNPM,
|
|
231
|
+
REDACTED,
|
|
232
|
+
REQUIRE,
|
|
233
|
+
SHADOW_NPM_BIN,
|
|
234
|
+
SHADOW_NPM_INJECT,
|
|
235
|
+
SHADOW_NPM_PATHS,
|
|
236
|
+
SOCKET,
|
|
237
|
+
SOCKET_APP_DIR,
|
|
238
|
+
SOCKET_CLI_ACCEPT_RISKS,
|
|
239
|
+
SOCKET_CLI_BIN_NAME,
|
|
240
|
+
SOCKET_CLI_BIN_NAME_ALIAS,
|
|
241
|
+
SOCKET_CLI_DEBUG,
|
|
242
|
+
SOCKET_CLI_FIX,
|
|
243
|
+
SOCKET_CLI_ISSUES_URL,
|
|
244
|
+
SOCKET_CLI_SENTRY_BIN_NAME_ALIAS,
|
|
245
|
+
SOCKET_CLI_LEGACY_PACKAGE_NAME,
|
|
246
|
+
SOCKET_CLI_NO_API_TOKEN,
|
|
247
|
+
SOCKET_CLI_NPM_BIN_NAME,
|
|
248
|
+
SOCKET_CLI_NPX_BIN_NAME,
|
|
249
|
+
SOCKET_CLI_OPTIMIZE,
|
|
250
|
+
SOCKET_CLI_PACKAGE_NAME,
|
|
251
|
+
SOCKET_CLI_SAFE_BIN,
|
|
252
|
+
SOCKET_CLI_SAFE_PROGRESS,
|
|
253
|
+
SOCKET_CLI_SENTRY_BIN_NAME,
|
|
254
|
+
SOCKET_CLI_SENTRY_NPM_BIN_NAME,
|
|
255
|
+
SOCKET_CLI_SENTRY_NPX_BIN_NAME,
|
|
256
|
+
SOCKET_CLI_SENTRY_PACKAGE_NAME,
|
|
257
|
+
SOCKET_CLI_VIEW_ALL_RISKS,
|
|
258
|
+
SOCKET_SECURITY_API_BASE_URL,
|
|
259
|
+
SOCKET_SECURITY_API_PROXY,
|
|
260
|
+
SOCKET_SECURITY_API_TOKEN,
|
|
261
|
+
VLT,
|
|
262
|
+
WITH_SENTRY,
|
|
263
|
+
XDG_DATA_HOME,
|
|
264
|
+
YARN,
|
|
265
|
+
YARN_BERRY,
|
|
266
|
+
YARN_CLASSIC,
|
|
267
|
+
YARN_LOCK,
|
|
268
|
+
bashRcPath: undefined,
|
|
269
|
+
distCliPath: undefined,
|
|
270
|
+
distInstrumentWithSentryPath: undefined,
|
|
271
|
+
distPath: undefined,
|
|
272
|
+
distShadowNpmBinPath: undefined,
|
|
273
|
+
distShadowNpmInjectPath: undefined,
|
|
274
|
+
homePath: undefined,
|
|
275
|
+
minimumVersionByAgent: undefined,
|
|
276
|
+
nmBinPath: undefined,
|
|
277
|
+
nodeHardenFlags: undefined,
|
|
278
|
+
rootBinPath: undefined,
|
|
279
|
+
rootDistPath: undefined,
|
|
280
|
+
rootPath: undefined,
|
|
281
|
+
shadowBinPath: undefined,
|
|
282
|
+
zshRcPath: undefined
|
|
250
283
|
},
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
284
|
+
{
|
|
285
|
+
getters: {
|
|
286
|
+
DIST_TYPE: LAZY_DIST_TYPE,
|
|
287
|
+
ENV: LAZY_ENV,
|
|
288
|
+
bashRcPath: lazyBashRcPath,
|
|
289
|
+
distCliPath: lazyDistCliPath,
|
|
290
|
+
distInstrumentWithSentryPath: lazyDistInstrumentWithSentryPath,
|
|
291
|
+
distPath: lazyDistPath,
|
|
292
|
+
distShadowNpmBinPath: lazyDistShadowNpmBinPath,
|
|
293
|
+
distShadowNpmInjectPath: lazyDistShadowNpmInjectPath,
|
|
294
|
+
homePath: lazyHomePath,
|
|
295
|
+
minimumVersionByAgent: lazyMinimumVersionByAgent,
|
|
296
|
+
nmBinPath: lazyNmBinPath,
|
|
297
|
+
nodeHardenFlags: lazyNodeHardenFlags,
|
|
298
|
+
rootBinPath: lazyRootBinPath,
|
|
299
|
+
rootDistPath: lazyRootDistPath,
|
|
300
|
+
rootPath: lazyRootPath,
|
|
301
|
+
shadowBinPath: lazyShadowBinPath,
|
|
302
|
+
zshRcPath: lazyZshRcPath
|
|
255
303
|
},
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return
|
|
304
|
+
internals: {
|
|
305
|
+
getIpc,
|
|
306
|
+
getSentry() {
|
|
307
|
+
return _Sentry
|
|
308
|
+
},
|
|
309
|
+
setSentry(Sentry) {
|
|
310
|
+
if (_Sentry === undefined) {
|
|
311
|
+
_Sentry = Sentry
|
|
312
|
+
return true
|
|
313
|
+
}
|
|
314
|
+
return false
|
|
260
315
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
});
|
|
316
|
+
},
|
|
317
|
+
mixin: registryConstants
|
|
318
|
+
}
|
|
319
|
+
)
|
|
266
320
|
|
|
267
|
-
module.exports = constants
|
|
268
|
-
//# debugId=
|
|
321
|
+
module.exports = constants
|
|
322
|
+
//# debugId=a3ca7dec-b2c1-4cc4-a1fb-f0643c3af444
|
|
269
323
|
//# sourceMappingURL=constants.js.map
|