@socketsecurity/cli-with-sentry 0.14.67 → 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.
Files changed (96) hide show
  1. package/dist/blessed/lib/alias.js +521 -0
  2. package/dist/blessed/lib/blessed.js +34 -0
  3. package/dist/blessed/lib/colors.js +492 -0
  4. package/dist/blessed/lib/events.js +197 -0
  5. package/dist/blessed/lib/gpmclient.js +247 -0
  6. package/dist/blessed/lib/helpers.js +172 -0
  7. package/dist/blessed/lib/keys.js +514 -0
  8. package/dist/blessed/lib/program.js +4532 -0
  9. package/dist/blessed/lib/tput.js +3113 -0
  10. package/dist/blessed/lib/unicode.js +914 -0
  11. package/dist/blessed/lib/widget.js +62 -0
  12. package/dist/blessed/lib/widgets/ansiimage.js +175 -0
  13. package/dist/blessed/lib/widgets/bigtext.js +172 -0
  14. package/dist/blessed/lib/widgets/box.js +36 -0
  15. package/dist/blessed/lib/widgets/button.js +64 -0
  16. package/dist/blessed/lib/widgets/checkbox.js +97 -0
  17. package/dist/blessed/lib/widgets/element.js +2873 -0
  18. package/dist/blessed/lib/widgets/filemanager.js +225 -0
  19. package/dist/blessed/lib/widgets/form.js +303 -0
  20. package/dist/blessed/lib/widgets/image.js +73 -0
  21. package/dist/blessed/lib/widgets/input.js +36 -0
  22. package/dist/blessed/lib/widgets/layout.js +251 -0
  23. package/dist/blessed/lib/widgets/line.js +61 -0
  24. package/dist/blessed/lib/widgets/list.js +654 -0
  25. package/dist/blessed/lib/widgets/listbar.js +454 -0
  26. package/dist/blessed/lib/widgets/listtable.js +267 -0
  27. package/dist/blessed/lib/widgets/loading.js +90 -0
  28. package/dist/blessed/lib/widgets/log.js +84 -0
  29. package/dist/blessed/lib/widgets/message.js +147 -0
  30. package/dist/blessed/lib/widgets/node.js +316 -0
  31. package/dist/blessed/lib/widgets/overlayimage.js +796 -0
  32. package/dist/blessed/lib/widgets/progressbar.js +168 -0
  33. package/dist/blessed/lib/widgets/prompt.js +129 -0
  34. package/dist/blessed/lib/widgets/question.js +131 -0
  35. package/dist/blessed/lib/widgets/radiobutton.js +64 -0
  36. package/dist/blessed/lib/widgets/radioset.js +38 -0
  37. package/dist/blessed/lib/widgets/screen.js +2489 -0
  38. package/dist/blessed/lib/widgets/scrollablebox.js +417 -0
  39. package/dist/blessed/lib/widgets/scrollabletext.js +37 -0
  40. package/dist/blessed/lib/widgets/table.js +385 -0
  41. package/dist/blessed/lib/widgets/terminal.js +454 -0
  42. package/dist/blessed/lib/widgets/text.js +37 -0
  43. package/dist/blessed/lib/widgets/textarea.js +378 -0
  44. package/dist/blessed/lib/widgets/textbox.js +81 -0
  45. package/dist/blessed/lib/widgets/video.js +132 -0
  46. package/dist/blessed/usr/fonts/AUTHORS +1 -0
  47. package/dist/blessed/usr/fonts/LICENSE +94 -0
  48. package/dist/blessed/usr/fonts/README +340 -0
  49. package/dist/blessed/usr/fonts/ter-u14b.json +17826 -0
  50. package/dist/blessed/usr/fonts/ter-u14n.json +17826 -0
  51. package/dist/blessed/usr/linux +0 -0
  52. package/dist/blessed/usr/windows-ansi +0 -0
  53. package/dist/blessed/usr/xterm +0 -0
  54. package/dist/blessed/usr/xterm-256color +0 -0
  55. package/dist/blessed/usr/xterm.termcap +243 -0
  56. package/dist/blessed/usr/xterm.terminfo +1977 -0
  57. package/dist/blessed/vendor/tng.js +1878 -0
  58. package/dist/constants.d.ts +271 -207
  59. package/dist/constants.js +271 -227
  60. package/dist/constants.js.map +1 -1
  61. package/dist/instrument-with-sentry.d.ts +1 -1
  62. package/dist/instrument-with-sentry.js +27 -24
  63. package/dist/instrument-with-sentry.js.map +1 -1
  64. package/dist/module-sync/artifact.d.ts +60 -26
  65. package/dist/module-sync/cli.d.ts +1 -1
  66. package/dist/module-sync/cli.js +6624 -4527
  67. package/dist/module-sync/cli.js.map +1 -1
  68. package/dist/module-sync/cmd.d.ts +4 -4
  69. package/dist/module-sync/config.d.ts +30 -17
  70. package/dist/module-sync/edge.d.ts +73 -60
  71. package/dist/module-sync/errors.d.ts +26 -11
  72. package/dist/module-sync/fs.d.ts +61 -0
  73. package/dist/module-sync/index.d.ts +31 -20
  74. package/dist/module-sync/node.d.ts +118 -83
  75. package/dist/module-sync/override-set.d.ts +39 -33
  76. package/dist/module-sync/package-environment.d.ts +83 -52
  77. package/dist/module-sync/path-resolve.d.ts +14 -9
  78. package/dist/module-sync/sdk.d.ts +9 -5
  79. package/dist/module-sync/shadow-bin.d.ts +5 -2
  80. package/dist/module-sync/shadow-bin.js +82 -66
  81. package/dist/module-sync/shadow-bin.js.map +1 -1
  82. package/dist/module-sync/shadow-npm-inject.d.ts +1 -1
  83. package/dist/module-sync/shadow-npm-inject.js +1176 -983
  84. package/dist/module-sync/shadow-npm-inject.js.map +1 -1
  85. package/dist/module-sync/shadow-npm-paths.d.ts +28 -14
  86. package/dist/module-sync/shadow-npm-paths.js +285 -208
  87. package/dist/module-sync/shadow-npm-paths.js.map +1 -1
  88. package/dist/module-sync/socket-package-alert.d.ts +95 -39
  89. package/dist/module-sync/types.d.ts +75 -47
  90. package/dist/module-sync/vendor.js +11181 -0
  91. package/dist/{require → module-sync}/vendor.js.map +1 -1
  92. package/dist/require/cli.d.ts +1 -1
  93. package/dist/require/cli.js +6624 -4525
  94. package/dist/require/cli.js.map +1 -1
  95. package/dist/require/vendor.js +2 -9145
  96. package/package.json +46 -38
package/dist/constants.js CHANGED
@@ -1,270 +1,314 @@
1
- 'use strict';
1
+ 'use strict'
2
2
 
3
- var fs = require('node:fs');
4
- var os = require('node:os');
5
- var path = require('node:path');
6
- var process = require('node:process');
7
- var registryConstants = require('@socketsecurity/registry/lib/constants');
8
- var env = require('@socketsecurity/registry/lib/env');
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
- createConstantsObject,
17
- getIpc
18
- }
19
- } = registryConstants;
20
- const ALERT_TYPE_CRITICAL_CVE = 'criticalCVE';
21
- const ALERT_TYPE_CVE = 'cve';
22
- const ALERT_TYPE_MEDIUM_CVE = 'mediumCVE';
23
- const ALERT_TYPE_MILD_CVE = 'mildCVE';
24
- const API_V0_URL = 'https://api.socket.dev/v0/';
25
- const BINARY_LOCK_EXT = '.lockb';
26
- const BUN = 'bun';
27
- const CLI = 'cli';
28
- const CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER = 'firstPatchedVersionIdentifier';
29
- const DRY_RUN_LABEL = '[DryRun]';
30
- const DRY_RUN_BAIL_TEXT = `${DRY_RUN_LABEL}: Bailing now`;
31
- const INLINED_SOCKET_CLI_LEGACY_BUILD = 'INLINED_SOCKET_CLI_LEGACY_BUILD';
32
- const INLINED_SOCKET_CLI_PUBLISHED_BUILD = 'INLINED_SOCKET_CLI_PUBLISHED_BUILD';
33
- const INLINED_SOCKET_CLI_SENTRY_BUILD = 'INLINED_SOCKET_CLI_SENTRY_BUILD';
34
- const LOCK_EXT = '.lock';
35
- const MODULE_SYNC = 'module-sync';
36
- const NPM_BUGGY_OVERRIDES_PATCHED_VERSION = '11.2.0';
37
- const NPM_REGISTRY_URL = 'https://registry.npmjs.org';
38
- const PNPM = 'pnpm';
39
- const REDACTED = '<redacted>';
40
- const REQUIRE = 'require';
41
- const SHADOW_NPM_BIN = 'shadow-bin';
42
- const SHADOW_NPM_INJECT = 'shadow-npm-inject';
43
- const SHADOW_NPM_PATHS = 'shadow-npm-paths';
44
- const SOCKET = 'socket';
45
- const SOCKET_CLI_BIN_NAME = 'socket';
46
- const SOCKET_CLI_BIN_NAME_ALIAS = 'cli';
47
- const SOCKET_CLI_DEBUG = 'SOCKET_CLI_DEBUG';
48
- const SOCKET_CLI_FIX = 'SOCKET_CLI_FIX';
49
- const SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues';
50
- const SOCKET_CLI_LEGACY_PACKAGE_NAME = `${SOCKET_SECURITY_SCOPE}/cli`;
51
- const SOCKET_CLI_NO_API_TOKEN = 'SOCKET_CLI_NO_API_TOKEN';
52
- const SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE';
53
- const SOCKET_CLI_NPM_BIN_NAME = 'socket-npm';
54
- const SOCKET_CLI_NPX_BIN_NAME = 'socket-npx';
55
- const SOCKET_CLI_PACKAGE_NAME = 'socket';
56
- const SOCKET_CLI_SAFE_WRAPPER = 'SOCKET_CLI_SAFE_WRAPPER';
57
- const SOCKET_CLI_SENTRY_BIN_NAME = 'socket-with-sentry';
58
- const SOCKET_CLI_SENTRY_BIN_NAME_ALIAS = 'cli-with-sentry';
59
- const SOCKET_CLI_SENTRY_NPM_BIN_NAME = 'socket-npm-with-sentry';
60
- const SOCKET_CLI_SENTRY_NPX_BIN_NAME = 'socket-npx-with-sentry';
61
- const SOCKET_CLI_SENTRY_PACKAGE_NAME = `${SOCKET_SECURITY_SCOPE}/cli-with-sentry`;
62
- const SOCKET_SECURITY_API_TOKEN = 'SOCKET_SECURITY_API_TOKEN';
63
- const VLT = 'vlt';
64
- const WITH_SENTRY = 'with-sentry';
65
- const YARN = 'yarn';
66
- const YARN_BERRY = 'yarn/berry';
67
- const YARN_CLASSIC = 'yarn/classic';
68
- const YARN_LOCK = 'yarn.lock';
69
- let _Sentry;
70
- const LAZY_DIST_TYPE = () => registryConstants.SUPPORTS_NODE_REQUIRE_MODULE ? MODULE_SYNC : REQUIRE;
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 set to determine if this is the Legacy build.
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 set to determine if this is a published build.
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 set to determine if this is the Sentry build.
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
- // Flag set to help debug Socket CLI.
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 set to make the default API token `undefined`.
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 set to set the 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.
94
119
  // https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables
95
- SOCKET_SECURITY_API_TOKEN: env.envAsString(env$1['SOCKET_SECURITY_API_TOKEN']) ||
96
- // Keep 'SOCKET_SECURITY_API_KEY' as an alias of 'SOCKET_SECURITY_API_TOKEN'.
97
- // TODO: Remove 'SOCKET_SECURITY_API_KEY' alias.
98
- env.envAsString(env$1['SOCKET_SECURITY_API_KEY'])
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 = () => new Map([
121
- // Bun >=1.1.39 supports the text-based lockfile.
122
- // https://bun.sh/blog/bun-lock-text-lockfile
123
- [BUN, '1.1.39'],
124
- // The npm version bundled with Node 18.
125
- // https://nodejs.org/en/about/previous-releases#looking-for-the-latest-release-of-a-version-branch
126
- [NPM, '10.8.2'],
127
- // 8.x is the earliest version to support Node 18.
128
- // https://pnpm.io/installation#compatibility
129
- // https://www.npmjs.com/package/pnpm?activeTab=versions
130
- [PNPM, '8.15.9'],
131
- // 4.x supports >= Node 18.12.0
132
- // https://github.com/yarnpkg/berry/blob/%40yarnpkg/core/4.1.0/CHANGELOG.md#400
133
- [YARN_BERRY, '4.0.0'],
134
- // Latest 1.x.
135
- // https://www.npmjs.com/package/yarn?activeTab=versions
136
- [YARN_CLASSIC, '1.22.22'],
137
- // vlt does not support overrides so we don't gate on it.
138
- [VLT, '*']]);
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
- // Lazily access constants.WIN32.
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
- // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_TEST_DIST_BUILD']".
157
- path.join(fs.realpathSync.native(__dirname), '..');
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
- ALERT_TYPE_CRITICAL_CVE,
166
- ALERT_TYPE_CVE,
167
- ALERT_TYPE_MEDIUM_CVE,
168
- ALERT_TYPE_MILD_CVE,
169
- API_V0_URL,
170
- BINARY_LOCK_EXT,
171
- BUN,
172
- CLI,
173
- CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,
174
- // Lazily defined values are initialized as `undefined` to keep their key order.
175
- DIST_TYPE: undefined,
176
- DRY_RUN_LABEL,
177
- DRY_RUN_BAIL_TEXT,
178
- ENV: undefined,
179
- INLINED_SOCKET_CLI_LEGACY_BUILD,
180
- INLINED_SOCKET_CLI_PUBLISHED_BUILD,
181
- INLINED_SOCKET_CLI_SENTRY_BUILD,
182
- LOCK_EXT,
183
- MODULE_SYNC,
184
- NPM_BUGGY_OVERRIDES_PATCHED_VERSION,
185
- NPM_REGISTRY_URL,
186
- PNPM,
187
- REDACTED,
188
- REQUIRE,
189
- SHADOW_NPM_BIN,
190
- SHADOW_NPM_INJECT,
191
- SHADOW_NPM_PATHS,
192
- SOCKET,
193
- SOCKET_CLI_BIN_NAME,
194
- SOCKET_CLI_BIN_NAME_ALIAS,
195
- SOCKET_CLI_DEBUG,
196
- SOCKET_CLI_FIX,
197
- SOCKET_CLI_ISSUES_URL,
198
- SOCKET_CLI_SENTRY_BIN_NAME_ALIAS,
199
- SOCKET_CLI_LEGACY_PACKAGE_NAME,
200
- SOCKET_CLI_NO_API_TOKEN,
201
- SOCKET_CLI_NPM_BIN_NAME,
202
- SOCKET_CLI_NPX_BIN_NAME,
203
- SOCKET_CLI_OPTIMIZE,
204
- SOCKET_CLI_PACKAGE_NAME,
205
- SOCKET_CLI_SAFE_WRAPPER,
206
- SOCKET_CLI_SENTRY_BIN_NAME,
207
- SOCKET_CLI_SENTRY_NPM_BIN_NAME,
208
- SOCKET_CLI_SENTRY_NPX_BIN_NAME,
209
- SOCKET_CLI_SENTRY_PACKAGE_NAME,
210
- SOCKET_SECURITY_API_TOKEN,
211
- VLT,
212
- WITH_SENTRY,
213
- YARN,
214
- YARN_BERRY,
215
- YARN_CLASSIC,
216
- YARN_LOCK,
217
- bashRcPath: undefined,
218
- distCliPath: undefined,
219
- distInstrumentWithSentryPath: undefined,
220
- distPath: undefined,
221
- distShadowNpmBinPath: undefined,
222
- distShadowNpmInjectPath: undefined,
223
- homePath: undefined,
224
- minimumVersionByAgent: undefined,
225
- nmBinPath: undefined,
226
- nodeHardenFlags: undefined,
227
- rootBinPath: undefined,
228
- rootDistPath: undefined,
229
- rootPath: undefined,
230
- shadowBinPath: undefined,
231
- zshRcPath: undefined
232
- }, {
233
- getters: {
234
- DIST_TYPE: LAZY_DIST_TYPE,
235
- ENV: LAZY_ENV,
236
- bashRcPath: lazyBashRcPath,
237
- distCliPath: lazyDistCliPath,
238
- distInstrumentWithSentryPath: lazyDistInstrumentWithSentryPath,
239
- distPath: lazyDistPath,
240
- distShadowNpmBinPath: lazyDistShadowNpmBinPath,
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
- internals: {
253
- getIpc,
254
- getSentry() {
255
- return _Sentry;
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
- setSentry(Sentry) {
258
- if (_Sentry === undefined) {
259
- _Sentry = Sentry;
260
- return true;
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
- return false;
263
- }
264
- },
265
- mixin: registryConstants
266
- });
307
+ },
308
+ mixin: registryConstants
309
+ }
310
+ )
267
311
 
268
- module.exports = constants;
269
- //# debugId=26ee0b57-8fcd-42bc-91fd-a5e0e6a12555
312
+ module.exports = constants
313
+ //# debugId=5b0e4686-31cf-4423-99c5-f986ce441719
270
314
  //# sourceMappingURL=constants.js.map