socket 0.14.42 → 0.14.44
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/README.md +14 -36
- package/bin/cli.js +17 -7
- package/bin/npm-cli.js +1 -1
- package/bin/npx-cli.js +1 -1
- package/dist/constants.d.ts +121 -11
- package/dist/constants.js +91 -10
- package/dist/constants.js.map +1 -0
- package/dist/init.gradle +250 -0
- package/dist/module-sync/cli.js +6115 -3836
- package/dist/module-sync/cli.js.map +1 -0
- package/dist/module-sync/edge.d.ts +66 -0
- package/dist/module-sync/errors.d.ts +6 -1
- package/dist/module-sync/index.d.ts +192 -0
- package/dist/module-sync/index.js +1879 -0
- package/dist/module-sync/index.js.map +1 -0
- package/dist/module-sync/logging.d.ts +3 -3
- package/dist/module-sync/node.d.ts +84 -0
- package/dist/module-sync/npm-injection.js +7 -1495
- package/dist/module-sync/npm-injection.js.map +1 -0
- package/dist/module-sync/npm-paths.d.ts +3 -2
- package/dist/module-sync/npm-paths.js +91 -42
- package/dist/module-sync/npm-paths.js.map +1 -0
- package/dist/module-sync/npm.d.ts +24 -0
- package/dist/module-sync/npm.js +99 -0
- package/dist/module-sync/npm.js.map +1 -0
- package/dist/module-sync/path-resolve.d.ts +1 -1
- package/dist/module-sync/proc-log.d.ts +3 -0
- package/dist/module-sync/reify.d.ts +1018 -0
- package/dist/module-sync/sdk.d.ts +5 -0
- package/dist/module-sync/settings.d.ts +5 -4
- package/dist/module-sync/shadow-bin.d.ts +1 -1
- package/dist/module-sync/shadow-bin.js +33 -12
- package/dist/module-sync/shadow-bin.js.map +1 -0
- package/dist/module-sync/types.d.ts +45 -0
- package/dist/require/cli.js +6114 -3836
- package/dist/require/constants.js +1 -1
- package/dist/require/index.js +3 -0
- package/dist/require/npm.js +3 -0
- package/dist/require/vendor.js +2336 -6
- package/package.json +65 -38
- package/dist/constants.d.ts.map +0 -1
- package/dist/module-sync/socket-url.d.ts +0 -40
- package/dist/module-sync/socket-url.js +0 -301
- package/dist/require/socket-url.js +0 -3
package/README.md
CHANGED
|
@@ -9,20 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
11
|
npm install -g socket
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
12
|
socket --help
|
|
16
|
-
socket info webtorrent@1.9.1
|
|
17
|
-
socket report create package.json --view
|
|
18
|
-
socket report view QXU8PmK7LfH608RAwfIKdbcHgwEd_ZeWJ9QEGv05FJUQ
|
|
19
|
-
socket wrapper --enable
|
|
20
13
|
```
|
|
21
14
|
|
|
22
15
|
## Commands
|
|
23
16
|
|
|
24
|
-
### Popular Commands
|
|
25
|
-
|
|
26
17
|
- `socket npm [args...]` and `socket npx [args...]` - Wraps `npm` and `npx` to
|
|
27
18
|
integrate Socket and preempt installation of alerted packages using the
|
|
28
19
|
builtin resolution of `npm` to precisely determine package installations.
|
|
@@ -30,41 +21,15 @@ socket wrapper --enable
|
|
|
30
21
|
- `socket optimize` - Optimize dependencies with
|
|
31
22
|
[`@socketregistry`](https://github.com/SocketDev/socket-registry) overrides!
|
|
32
23
|
_(👀 [our blog post](https://socket.dev/blog/introducing-socket-optimize))_
|
|
24
|
+
|
|
33
25
|
- `--pin` - Pin overrides to their latest version.
|
|
34
26
|
- `--prod` - Add overrides for only production dependencies.
|
|
35
27
|
|
|
36
|
-
### Other Commands
|
|
37
|
-
|
|
38
28
|
- `socket cdxgen [command]` - Call out to
|
|
39
29
|
[cdxgen](https://cyclonedx.github.io/cdxgen/#/?id=getting-started). See
|
|
40
30
|
[their documentation](https://cyclonedx.github.io/cdxgen/#/CLI?id=getting-help)
|
|
41
31
|
for commands.
|
|
42
32
|
|
|
43
|
-
- `socket info <package@version>` - Look up issues for a package.
|
|
44
|
-
|
|
45
|
-
- `socket raw-npm [args...]` and `socket raw-npx [args...]` - Temporarily
|
|
46
|
-
disable the Socket 'safe-npm' wrapper.
|
|
47
|
-
|
|
48
|
-
- `socket report create <path(s)-to-folder-or-file>` - Create a report on
|
|
49
|
-
[Socket.dev](https://socket.dev/)
|
|
50
|
-
|
|
51
|
-
Upload the specified `package.json` and lock files for JavaScript, Python, and
|
|
52
|
-
Go dependency manifests. If any folder is specified, the ones found in there
|
|
53
|
-
recursively are uploaded.
|
|
54
|
-
|
|
55
|
-
Glob patterns such as `**/package.json`, `**/requirements.txt`,
|
|
56
|
-
`**/pyproject.toml`, and `**/go.mod` is supported.
|
|
57
|
-
|
|
58
|
-
Intuitively ignores files matching your project's `.gitignore`, the
|
|
59
|
-
`projectIgnorePaths` in your project's
|
|
60
|
-
[`socket.yml`](https://docs.socket.dev/docs/socket-yml), and a sensible set of
|
|
61
|
-
[default ignore patterns](https://socket.dev/npm/package/ignore-by-default).
|
|
62
|
-
|
|
63
|
-
- `socket report view <report-id>` - Look up issues and scores from a report.
|
|
64
|
-
|
|
65
|
-
- `socket wrapper --enable` and `socket wrapper --disable` - Enable and disable
|
|
66
|
-
the Socket 'safe-npm' wrapper.
|
|
67
|
-
|
|
68
33
|
## Aliases
|
|
69
34
|
|
|
70
35
|
All aliases support the flags and arguments of the commands they alias.
|
|
@@ -121,6 +86,19 @@ use of the `projectIgnorePaths` to excludes files when creating a report.
|
|
|
121
86
|
|
|
122
87
|
## Contributing
|
|
123
88
|
|
|
89
|
+
### Setup
|
|
90
|
+
|
|
91
|
+
To run dev locally you can run these steps
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
npm install
|
|
95
|
+
npm run build:dist
|
|
96
|
+
npm exec socket
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
That should invoke it from local sources. If you make changes you run
|
|
100
|
+
`build:dist` again.
|
|
101
|
+
|
|
124
102
|
### Environment variables for development
|
|
125
103
|
|
|
126
104
|
- `SOCKET_SECURITY_API_BASE_URL` - if set, this will be the base for all
|
package/bin/cli.js
CHANGED
|
@@ -5,13 +5,15 @@ const process = require('node:process')
|
|
|
5
5
|
|
|
6
6
|
const constants = require('../dist/constants')
|
|
7
7
|
|
|
8
|
-
const { DIST_TYPE } = constants
|
|
8
|
+
const { CLI, DIST_TYPE, SOCKET_CLI_SENTRY_BUILD } = constants
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
if (
|
|
11
|
+
DIST_TYPE === 'require' &&
|
|
12
|
+
// Lazily access constants.ENV[SOCKET_CLI_SENTRY_BUILD].
|
|
13
|
+
!constants.ENV[SOCKET_CLI_SENTRY_BUILD]
|
|
14
|
+
) {
|
|
13
15
|
// Lazily access constants.distPath.
|
|
14
|
-
require(`${constants.distPath}
|
|
16
|
+
require(`${constants.distPath}/${CLI}.js`)
|
|
15
17
|
} else {
|
|
16
18
|
const path = require('node:path')
|
|
17
19
|
const spawn = require('@npmcli/promise-spawn')
|
|
@@ -19,13 +21,21 @@ if (DIST_TYPE === 'require') {
|
|
|
19
21
|
|
|
20
22
|
process.exitCode = 1
|
|
21
23
|
const spawnPromise = spawn(
|
|
22
|
-
// Lazily access constants.execPath
|
|
24
|
+
// Lazily access constants.execPath.
|
|
23
25
|
constants.execPath,
|
|
24
26
|
[
|
|
25
27
|
// Lazily access constants.nodeNoWarningsFlags.
|
|
26
28
|
...constants.nodeNoWarningsFlags,
|
|
29
|
+
// Lazily access constants.ENV[SOCKET_CLI_SENTRY_BUILD].
|
|
30
|
+
...(constants.ENV[SOCKET_CLI_SENTRY_BUILD]
|
|
31
|
+
? [
|
|
32
|
+
'--require',
|
|
33
|
+
// Lazily access constants.instrumentWithSentryPath.
|
|
34
|
+
constants.instrumentWithSentryPath
|
|
35
|
+
]
|
|
36
|
+
: []),
|
|
27
37
|
// Lazily access constants.distPath.
|
|
28
|
-
path.join(constants.distPath,
|
|
38
|
+
path.join(constants.distPath, `${CLI}.js`),
|
|
29
39
|
...process.argv.slice(2)
|
|
30
40
|
],
|
|
31
41
|
{
|
package/bin/npm-cli.js
CHANGED
package/bin/npx-cli.js
CHANGED
package/dist/constants.d.ts
CHANGED
|
@@ -1,45 +1,157 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import registryConstants from '@socketsecurity/registry/lib/constants';
|
|
3
|
+
import { Remap } from '@socketsecurity/registry/lib/objects';
|
|
2
4
|
type RegistryEnv = typeof registryConstants.ENV;
|
|
3
5
|
type RegistryInternals = (typeof registryConstants)['Symbol(kInternalsSymbol)'];
|
|
4
|
-
type
|
|
6
|
+
type Sentry = any;
|
|
7
|
+
type Internals = Remap<Omit<RegistryInternals, 'getIPC'> & Readonly<{
|
|
5
8
|
getIPC: {
|
|
6
9
|
(): Promise<IPC>;
|
|
7
10
|
<K extends keyof IPC | undefined>(key?: K): Promise<K extends keyof IPC ? IPC[K] : IPC>;
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
getSentry: () => Sentry;
|
|
13
|
+
setSentry(Sentry: Sentry): boolean;
|
|
14
|
+
}>>;
|
|
15
|
+
type ENV = Remap<RegistryEnv & Readonly<{
|
|
11
16
|
SOCKET_CLI_DEBUG: boolean;
|
|
12
|
-
|
|
17
|
+
SOCKET_CLI_LEGACY_BUILD: boolean;
|
|
18
|
+
SOCKET_CLI_PUBLISHED_BUILD: boolean;
|
|
19
|
+
SOCKET_CLI_SENTRY_BUILD: boolean;
|
|
20
|
+
SOCKET_CLI_VERSION_HASH: string;
|
|
21
|
+
}>>;
|
|
13
22
|
type IPC = Readonly<{
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
SOCKET_CLI_FIX?: string;
|
|
24
|
+
SOCKET_CLI_OPTIMIZE?: boolean;
|
|
25
|
+
SOCKET_CLI_SAFE_WRAPPER?: boolean;
|
|
16
26
|
}>;
|
|
17
|
-
|
|
27
|
+
declare const constants: {
|
|
28
|
+
readonly CI: "CI";
|
|
29
|
+
readonly [kInternalsSymbol]: registryConstants.Internals;
|
|
30
|
+
readonly NODE_MODULES: "node_modules";
|
|
31
|
+
readonly PACKAGE_JSON: "package.json";
|
|
32
|
+
readonly TAP: "TAP";
|
|
33
|
+
readonly kInternalsSymbol: unique symbol;
|
|
34
|
+
readonly NODE_AUTH_TOKEN: "NODE_AUTH_TOKEN";
|
|
35
|
+
readonly NODE_ENV: "NODE_ENV";
|
|
36
|
+
readonly PRE_COMMIT: "PRE_COMMIT";
|
|
37
|
+
readonly VITEST: "VITEST";
|
|
38
|
+
readonly AT_LATEST: "@latest";
|
|
39
|
+
readonly BIOME_JSON: "biome.json";
|
|
40
|
+
readonly COLUMN_LIMIT: 80;
|
|
41
|
+
readonly EMPTY_FILE: "/* empty */\n";
|
|
42
|
+
readonly ESLINT_CONFIG_JS: "eslint.config.js";
|
|
43
|
+
readonly ESNEXT: "esnext";
|
|
44
|
+
readonly EXTENSIONS: "extensions";
|
|
45
|
+
readonly EXTENSIONS_JSON: "extensions.json";
|
|
46
|
+
readonly GIT_IGNORE: ".gitignore";
|
|
47
|
+
readonly LATEST: "latest";
|
|
48
|
+
readonly LICENSE: "LICENSE";
|
|
49
|
+
readonly LICENSE_GLOB: "LICEN[CS]E{[.-]*,}";
|
|
50
|
+
readonly LICENSE_GLOB_RECURSIVE: "**/LICEN[CS]E{[.-]*,}";
|
|
51
|
+
readonly LICENSE_ORIGINAL: "LICENSE.original";
|
|
52
|
+
readonly LICENSE_ORIGINAL_GLOB: "*.original{.*,}";
|
|
53
|
+
readonly LICENSE_ORIGINAL_GLOB_RECURSIVE: "**/*.original{.*,}";
|
|
54
|
+
readonly LOOP_SENTINEL: 1000000;
|
|
55
|
+
readonly MANIFEST_JSON: "manifest.json";
|
|
56
|
+
readonly MIT: "MIT";
|
|
57
|
+
readonly NODE_MODULES_GLOB_RECURSIVE: "**/node_modules";
|
|
58
|
+
readonly NODE_WORKSPACES: "node_workspaces";
|
|
59
|
+
readonly NODE_VERSION: string;
|
|
60
|
+
readonly NPM: "npm";
|
|
61
|
+
readonly NPM_ORG: "socketregistry";
|
|
62
|
+
readonly OVERRIDES: "overrides";
|
|
63
|
+
readonly PACKAGE_DEFAULT_SOCKET_CATEGORIES: readonly ["cleanup"];
|
|
64
|
+
readonly PACKAGE_DEFAULT_NODE_RANGE: string;
|
|
65
|
+
readonly PACKAGE_DEFAULT_VERSION: "1.0.0";
|
|
66
|
+
readonly PACKAGE_LOCK: "package-lock.json";
|
|
67
|
+
readonly PACKAGE_SCOPE: "@socketregistry";
|
|
68
|
+
readonly README_GLOB: "README{.*,}";
|
|
69
|
+
readonly README_GLOB_RECURSIVE: "**/README{.*,}";
|
|
70
|
+
readonly README_MD: "README.md";
|
|
71
|
+
readonly REGISTRY: "registry";
|
|
72
|
+
readonly REGISTRY_SCOPE_DELIMITER: "__";
|
|
73
|
+
readonly RESOLUTIONS: "resolutions";
|
|
74
|
+
readonly SOCKET_IPC_HANDSHAKE: "SOCKET_IPC_HANDSHAKE";
|
|
75
|
+
readonly SOCKET_PUBLIC_API_KEY: string;
|
|
76
|
+
readonly SOCKET_PUBLIC_API_TOKEN: string;
|
|
77
|
+
readonly SOCKET_REPO_ORG: "SocketDev";
|
|
78
|
+
readonly SOCKET_REGISTRY_REPO_NAME: "socket-registry";
|
|
79
|
+
readonly SUPPORTS_NODE_DISABLE_WARNING_FLAG: boolean;
|
|
80
|
+
readonly SUPPORTS_NODE_REQUIRE_MODULE: boolean;
|
|
81
|
+
readonly SUPPORTS_NODE_RUN: boolean;
|
|
82
|
+
readonly SUPPORTS_PROCESS_SEND: boolean;
|
|
83
|
+
readonly TEMPLATE_CJS: "cjs";
|
|
84
|
+
readonly TEMPLATE_CJS_BROWSER: "cjs-browser";
|
|
85
|
+
readonly TEMPLATE_CJS_ESM: "cjs-esm";
|
|
86
|
+
readonly TEMPLATE_ES_SHIM_CONSTRUCTOR: "es-shim-constructor";
|
|
87
|
+
readonly TEMPLATE_ES_SHIM_PROTOTYPE_METHOD: "es-shim-prototype-method";
|
|
88
|
+
readonly TEMPLATE_ES_SHIM_STATIC_METHOD: "es-shim-static-method";
|
|
89
|
+
readonly TSCONFIG_JSON: "tsconfig.json";
|
|
90
|
+
readonly UNDEFINED_TOKEN: {};
|
|
91
|
+
readonly UNLICENCED: "UNLICENCED";
|
|
92
|
+
readonly UNLICENSED: "UNLICENSED";
|
|
93
|
+
readonly WIN32: boolean;
|
|
94
|
+
readonly abortController: AbortController;
|
|
95
|
+
readonly abortSignal: AbortSignal;
|
|
96
|
+
readonly copyLeftLicenses: ReadonlySet<string>;
|
|
97
|
+
readonly execPath: string;
|
|
98
|
+
readonly ignoreGlobs: readonly ["**/.git", "**/.npmrc", "**/bun.lockb?", "**/node_modules", "**/package-lock.json", "**/pnpm-lock.ya?ml", "**/yarn.lock", "**/.DS_Store", "**/.gitignore", "**/.hg", "**/.lock-wscript", "**/.npmignore", "**/.svn", "**/.wafpickle-*", "**/.*.swp", "**/._*/**", "**/archived-packages/**", "**/build/config.gypi", "**/CVS", "**/npm-debug.log", "**/*.orig", "**/.env", "**/.eslintcache", "**/.nvm", "**/.tap", "**/.tapci.yaml", "**/.vscode", "**/*.tsbuildinfo", "**/Thumbs.db"];
|
|
99
|
+
readonly lifecycleScriptNames: ReadonlySet<string>;
|
|
100
|
+
readonly maintainedNodeVersions: registryConstants.MaintainedNodeVersions;
|
|
101
|
+
readonly nodeNoWarningsFlags: readonly string[];
|
|
102
|
+
readonly npmExecPath: string;
|
|
103
|
+
readonly packageExtensions: readonly [string, object][];
|
|
104
|
+
readonly packumentCache: Map<unknown, unknown>;
|
|
105
|
+
readonly pacoteCachePath: string;
|
|
106
|
+
readonly parseArgsConfig: registryConstants.ParseArgsConfig;
|
|
107
|
+
readonly skipTestsByEcosystem: Readonly<Record<string, ReadonlySet<string>>>;
|
|
108
|
+
readonly tsLibsAvailable: ReadonlySet<string>;
|
|
109
|
+
readonly tsTypesAvailable: ReadonlySet<string>;
|
|
110
|
+
readonly win32EnsureTestsByEcosystem: Readonly<Record<string, ReadonlySet<string>>>;
|
|
18
111
|
readonly 'Symbol(kInternalsSymbol)': Internals;
|
|
112
|
+
readonly ALERT_TYPE_CRITICAL_CVE: 'criticalCVE';
|
|
113
|
+
readonly ALERT_TYPE_CVE: 'cve';
|
|
114
|
+
readonly ALERT_TYPE_MEDIUM_CVE: 'mediumCVE';
|
|
115
|
+
readonly ALERT_TYPE_MILD_CVE: 'mildCVE';
|
|
116
|
+
readonly ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE: 'socketUpgradeAvailable';
|
|
19
117
|
readonly API_V0_URL: 'https://api.socket.dev/v0';
|
|
20
118
|
readonly BABEL_RUNTIME: '@babel/runtime';
|
|
119
|
+
readonly BATCH_PURL_ENDPOINT: 'https://api.socket.dev/v0/purl?alerts=true&compact=true';
|
|
21
120
|
readonly BINARY_LOCK_EXT: '.lockb';
|
|
22
121
|
readonly BUN: 'bun';
|
|
122
|
+
readonly CLI: 'cli';
|
|
123
|
+
readonly CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER: 'firstPatchedVersionIdentifier';
|
|
124
|
+
readonly CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE: 'vulnerableVersionRange';
|
|
23
125
|
readonly ENV: ENV;
|
|
24
126
|
readonly DIST_TYPE: 'module-sync' | 'require';
|
|
25
127
|
readonly IPC: IPC;
|
|
26
128
|
readonly LOCK_EXT: '.lock';
|
|
27
129
|
readonly MODULE_SYNC: 'module-sync';
|
|
130
|
+
readonly NPM_INJECTION: 'npm-injection';
|
|
28
131
|
readonly NPM_REGISTRY_URL: 'https://registry.npmjs.org';
|
|
29
132
|
readonly NPX: 'npx';
|
|
30
133
|
readonly PNPM: 'pnpm';
|
|
31
134
|
readonly REQUIRE: 'require';
|
|
135
|
+
readonly SHADOW_BIN: 'shadow-bin';
|
|
136
|
+
readonly SOCKET: 'socket';
|
|
32
137
|
readonly SOCKET_CLI_DEBUG: 'SOCKET_CLI_DEBUG';
|
|
33
|
-
readonly
|
|
138
|
+
readonly SOCKET_CLI_FIX: 'SOCKET_CLI_FIX';
|
|
34
139
|
readonly SOCKET_CLI_ISSUES_URL: 'https://github.com/SocketDev/socket-cli/issues';
|
|
35
|
-
readonly
|
|
140
|
+
readonly SOCKET_CLI_LEGACY_BUILD: 'SOCKET_CLI_LEGACY_BUILD';
|
|
141
|
+
readonly SOCKET_CLI_OPTIMIZE: 'SOCKET_CLI_OPTIMIZE';
|
|
142
|
+
readonly SOCKET_CLI_PUBLISHED_BUILD: 'SOCKET_CLI_PUBLISHED_BUILD';
|
|
143
|
+
readonly SOCKET_CLI_SAFE_WRAPPER: 'SOCKET_CLI_SAFE_WRAPPER';
|
|
144
|
+
readonly SOCKET_CLI_SENTRY_BUILD: 'SOCKET_CLI_SENTRY_BUILD';
|
|
145
|
+
readonly SOCKET_CLI_VERSION_HASH: 'SOCKET_CLI_VERSION_HASH';
|
|
36
146
|
readonly VLT: 'vlt';
|
|
37
147
|
readonly YARN: 'yarn';
|
|
38
148
|
readonly YARN_BERRY: 'yarn/berry';
|
|
39
149
|
readonly YARN_CLASSIC: 'yarn/classic';
|
|
40
150
|
readonly cdxgenBinPath: string;
|
|
41
151
|
readonly distPath: string;
|
|
152
|
+
readonly instrumentWithSentryPath: string;
|
|
42
153
|
readonly nmBinPath: string;
|
|
154
|
+
readonly npmInjectionPath: string;
|
|
43
155
|
readonly rootBinPath: string;
|
|
44
156
|
readonly rootDistPath: string;
|
|
45
157
|
readonly rootPath: string;
|
|
@@ -47,6 +159,4 @@ type Constants = Omit<typeof registryConstants, 'Symbol(kInternalsSymbol)' | 'EN
|
|
|
47
159
|
readonly shadowBinPath: string;
|
|
48
160
|
readonly synpBinPath: string;
|
|
49
161
|
};
|
|
50
|
-
declare const constants: Constants;
|
|
51
162
|
export { constants as default };
|
|
52
|
-
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -7,36 +7,76 @@ var registryConstants = require('@socketsecurity/registry/lib/constants');
|
|
|
7
7
|
var env = require('@socketsecurity/registry/lib/env');
|
|
8
8
|
|
|
9
9
|
const {
|
|
10
|
+
NODE_MODULES,
|
|
10
11
|
PACKAGE_JSON,
|
|
12
|
+
TAP,
|
|
11
13
|
kInternalsSymbol,
|
|
12
14
|
[kInternalsSymbol]: {
|
|
13
15
|
createConstantsObject
|
|
14
16
|
}
|
|
15
17
|
} = registryConstants;
|
|
18
|
+
const ALERT_TYPE_CRITICAL_CVE = 'criticalCVE';
|
|
19
|
+
const ALERT_TYPE_CVE = 'cve';
|
|
20
|
+
const ALERT_TYPE_MEDIUM_CVE = 'mediumCVE';
|
|
21
|
+
const ALERT_TYPE_MILD_CVE = 'mildCVE';
|
|
22
|
+
const ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE = 'socketUpgradeAvailable';
|
|
16
23
|
const API_V0_URL = 'https://api.socket.dev/v0';
|
|
17
24
|
const BABEL_RUNTIME = '@babel/runtime';
|
|
18
25
|
const BINARY_LOCK_EXT = '.lockb';
|
|
19
26
|
const BUN = 'bun';
|
|
27
|
+
const CLI = 'cli';
|
|
28
|
+
const CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER = 'firstPatchedVersionIdentifier';
|
|
29
|
+
const CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE = 'vulnerableVersionRange';
|
|
20
30
|
const LOCK_EXT = '.lock';
|
|
21
31
|
const MODULE_SYNC = 'module-sync';
|
|
32
|
+
const NPM_INJECTION = 'npm-injection';
|
|
22
33
|
const NPM_REGISTRY_URL = 'https://registry.npmjs.org';
|
|
23
34
|
const NPX = 'npx';
|
|
24
35
|
const PNPM = 'pnpm';
|
|
25
36
|
const REQUIRE = 'require';
|
|
37
|
+
const SHADOW_BIN = 'shadow-bin';
|
|
38
|
+
const SOCKET = 'socket';
|
|
26
39
|
const SOCKET_CLI_DEBUG = 'SOCKET_CLI_DEBUG';
|
|
27
|
-
const
|
|
40
|
+
const SOCKET_CLI_FIX = 'SOCKET_CLI_FIX';
|
|
28
41
|
const SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues';
|
|
29
|
-
const
|
|
42
|
+
const SOCKET_CLI_LEGACY_BUILD = 'SOCKET_CLI_LEGACY_BUILD';
|
|
43
|
+
const SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE';
|
|
44
|
+
const SOCKET_CLI_PUBLISHED_BUILD = 'SOCKET_CLI_PUBLISHED_BUILD';
|
|
45
|
+
const SOCKET_CLI_SAFE_WRAPPER = 'SOCKET_CLI_SAFE_WRAPPER';
|
|
46
|
+
const SOCKET_CLI_SENTRY_BUILD = 'SOCKET_CLI_SENTRY_BUILD';
|
|
47
|
+
const SOCKET_CLI_VERSION_HASH = 'SOCKET_CLI_VERSION_HASH';
|
|
30
48
|
const VLT = 'vlt';
|
|
31
49
|
const YARN = 'yarn';
|
|
32
50
|
const YARN_BERRY = `${YARN}/berry`;
|
|
33
51
|
const YARN_CLASSIC = `${YARN}/classic`;
|
|
52
|
+
let _Sentry;
|
|
53
|
+
const LAZY_BATCH_PURL_ENDPOINT = () => {
|
|
54
|
+
const query = new URLSearchParams();
|
|
55
|
+
query.append('alerts', 'true');
|
|
56
|
+
query.append('compact', 'true');
|
|
57
|
+
return `${API_V0_URL}/purl?${query}`;
|
|
58
|
+
};
|
|
34
59
|
const LAZY_DIST_TYPE = () => registryConstants.SUPPORTS_NODE_REQUIRE_MODULE ? MODULE_SYNC : REQUIRE;
|
|
35
60
|
const LAZY_ENV = () => Object.freeze({
|
|
36
61
|
// Lazily access registryConstants.ENV.
|
|
37
62
|
...registryConstants.ENV,
|
|
38
63
|
// Flag set to help debug Socket CLI.
|
|
39
|
-
[SOCKET_CLI_DEBUG]: env.envAsBoolean(process.env[SOCKET_CLI_DEBUG])
|
|
64
|
+
[SOCKET_CLI_DEBUG]: env.envAsBoolean(process.env[SOCKET_CLI_DEBUG]),
|
|
65
|
+
// Inline the following environment values so that they CANNOT be influenced
|
|
66
|
+
// by user provided environment variables.
|
|
67
|
+
//
|
|
68
|
+
// Flag set to determine if this is the Legacy build.
|
|
69
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_LEGACY_BUILD]".
|
|
70
|
+
[SOCKET_CLI_LEGACY_BUILD]: false,
|
|
71
|
+
// Flag set to determine if this is a published build.
|
|
72
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_PUBLISHED_BUILD]".
|
|
73
|
+
[SOCKET_CLI_PUBLISHED_BUILD]: true,
|
|
74
|
+
// Flag set to determine if this is the Sentry build.
|
|
75
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_SENTRY_BUILD]".
|
|
76
|
+
[SOCKET_CLI_SENTRY_BUILD]: false,
|
|
77
|
+
// Flag set to determine the version hash of the build.
|
|
78
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_VERSION_HASH]".
|
|
79
|
+
[SOCKET_CLI_VERSION_HASH]: "0.14.44:d759761:627be68f:pub"
|
|
40
80
|
});
|
|
41
81
|
const lazyCdxgenBinPath = () =>
|
|
42
82
|
// Lazily access constants.nmBinPath.
|
|
@@ -44,9 +84,15 @@ path.join(constants.nmBinPath, 'cdxgen');
|
|
|
44
84
|
const lazyDistPath = () =>
|
|
45
85
|
// Lazily access constants.rootDistPath and constants.DIST_TYPE.
|
|
46
86
|
path.join(constants.rootDistPath, constants.DIST_TYPE);
|
|
87
|
+
const lazyInstrumentWithSentryPath = () =>
|
|
88
|
+
// Lazily access constants.rootDistPath.
|
|
89
|
+
path.join(constants.rootDistPath, 'instrument-with-sentry.js');
|
|
47
90
|
const lazyNmBinPath = () =>
|
|
48
91
|
// Lazily access constants.rootPath.
|
|
49
|
-
path.join(constants.rootPath,
|
|
92
|
+
path.join(constants.rootPath, `${NODE_MODULES}/.bin`);
|
|
93
|
+
const lazyNpmInjectionPath = () =>
|
|
94
|
+
// Lazily access constants.distPath.
|
|
95
|
+
path.join(constants.distPath, `${NPM_INJECTION}.js`);
|
|
50
96
|
const lazyRootBinPath = () =>
|
|
51
97
|
// Lazily access constants.rootPath.
|
|
52
98
|
path.join(constants.rootPath, 'bin');
|
|
@@ -54,43 +100,61 @@ const lazyRootDistPath = () =>
|
|
|
54
100
|
// Lazily access constants.rootPath.
|
|
55
101
|
path.join(constants.rootPath, 'dist');
|
|
56
102
|
const lazyRootPath = () =>
|
|
57
|
-
// The '@rollup/plugin-replace' will replace
|
|
58
|
-
// it will be dead code eliminated by Rollup.
|
|
103
|
+
// The '@rollup/plugin-replace' will replace "process.env.[TAP]".
|
|
59
104
|
path.resolve(fs.realpathSync.native(__dirname), '..');
|
|
60
105
|
const lazyRootPkgJsonPath = () =>
|
|
61
106
|
// Lazily access constants.rootPath.
|
|
62
107
|
path.join(constants.rootPath, PACKAGE_JSON);
|
|
63
108
|
const lazyShadowBinPath = () =>
|
|
64
109
|
// Lazily access constants.rootPath.
|
|
65
|
-
path.join(constants.rootPath,
|
|
110
|
+
path.join(constants.rootPath, SHADOW_BIN);
|
|
66
111
|
const lazySynpBinPath = () =>
|
|
67
112
|
// Lazily access constants.nmBinPath.
|
|
68
113
|
path.join(constants.nmBinPath, 'synp');
|
|
69
114
|
const constants = createConstantsObject({
|
|
115
|
+
ALERT_TYPE_CRITICAL_CVE,
|
|
116
|
+
ALERT_TYPE_CVE,
|
|
117
|
+
ALERT_TYPE_MEDIUM_CVE,
|
|
118
|
+
ALERT_TYPE_MILD_CVE,
|
|
119
|
+
ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE,
|
|
70
120
|
API_V0_URL,
|
|
71
121
|
BABEL_RUNTIME,
|
|
122
|
+
// Lazily defined values are initialized as `undefined` to keep their key order.
|
|
123
|
+
BATCH_PURL_ENDPOINT: undefined,
|
|
72
124
|
BINARY_LOCK_EXT,
|
|
73
125
|
BUN,
|
|
74
|
-
|
|
126
|
+
CLI,
|
|
127
|
+
CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,
|
|
128
|
+
CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE,
|
|
75
129
|
DIST_TYPE: undefined,
|
|
76
130
|
ENV: undefined,
|
|
77
131
|
LOCK_EXT,
|
|
78
132
|
MODULE_SYNC,
|
|
133
|
+
NPM_INJECTION,
|
|
79
134
|
NPM_REGISTRY_URL,
|
|
80
135
|
NPX,
|
|
81
136
|
PNPM,
|
|
82
137
|
REQUIRE,
|
|
138
|
+
SHADOW_BIN,
|
|
139
|
+
SOCKET,
|
|
83
140
|
SOCKET_CLI_DEBUG,
|
|
84
|
-
|
|
141
|
+
SOCKET_CLI_FIX,
|
|
85
142
|
SOCKET_CLI_ISSUES_URL,
|
|
86
|
-
|
|
143
|
+
SOCKET_CLI_LEGACY_BUILD,
|
|
144
|
+
SOCKET_CLI_OPTIMIZE,
|
|
145
|
+
SOCKET_CLI_PUBLISHED_BUILD,
|
|
146
|
+
SOCKET_CLI_SAFE_WRAPPER,
|
|
147
|
+
SOCKET_CLI_SENTRY_BUILD,
|
|
148
|
+
SOCKET_CLI_VERSION_HASH,
|
|
87
149
|
VLT,
|
|
88
150
|
YARN,
|
|
89
151
|
YARN_BERRY,
|
|
90
152
|
YARN_CLASSIC,
|
|
91
153
|
cdxgenBinPath: undefined,
|
|
92
154
|
distPath: undefined,
|
|
155
|
+
instrumentWithSentryPath: undefined,
|
|
93
156
|
nmBinPath: undefined,
|
|
157
|
+
npmInjectionPath: undefined,
|
|
94
158
|
rootBinPath: undefined,
|
|
95
159
|
rootDistPath: undefined,
|
|
96
160
|
rootPath: undefined,
|
|
@@ -99,11 +163,14 @@ const constants = createConstantsObject({
|
|
|
99
163
|
synpBinPath: undefined
|
|
100
164
|
}, {
|
|
101
165
|
getters: {
|
|
166
|
+
BATCH_PURL_ENDPOINT: LAZY_BATCH_PURL_ENDPOINT,
|
|
102
167
|
DIST_TYPE: LAZY_DIST_TYPE,
|
|
103
168
|
ENV: LAZY_ENV,
|
|
104
169
|
distPath: lazyDistPath,
|
|
105
170
|
cdxgenBinPath: lazyCdxgenBinPath,
|
|
171
|
+
instrumentWithSentryPath: lazyInstrumentWithSentryPath,
|
|
106
172
|
nmBinPath: lazyNmBinPath,
|
|
173
|
+
npmInjectionPath: lazyNpmInjectionPath,
|
|
107
174
|
rootBinPath: lazyRootBinPath,
|
|
108
175
|
rootDistPath: lazyRootDistPath,
|
|
109
176
|
rootPath: lazyRootPath,
|
|
@@ -111,7 +178,21 @@ const constants = createConstantsObject({
|
|
|
111
178
|
shadowBinPath: lazyShadowBinPath,
|
|
112
179
|
synpBinPath: lazySynpBinPath
|
|
113
180
|
},
|
|
181
|
+
internals: {
|
|
182
|
+
getSentry() {
|
|
183
|
+
return _Sentry;
|
|
184
|
+
},
|
|
185
|
+
setSentry(Sentry) {
|
|
186
|
+
if (_Sentry === undefined) {
|
|
187
|
+
_Sentry = Sentry;
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
},
|
|
114
193
|
mixin: registryConstants
|
|
115
194
|
});
|
|
116
195
|
|
|
117
196
|
module.exports = constants;
|
|
197
|
+
//# debugId=43200c8b-0de4-4686-ba0f-0fbc8f6029e1
|
|
198
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["import { realpathSync } from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\n\nimport registryConstants from '@socketsecurity/registry/lib/constants'\nimport { envAsBoolean } from '@socketsecurity/registry/lib/env'\n\nimport type { Remap } from '@socketsecurity/registry/lib/objects'\n\nconst {\n NODE_MODULES,\n PACKAGE_JSON,\n TAP,\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: {\n createConstantsObject\n }\n} = registryConstants\n\ntype RegistryEnv = typeof registryConstants.ENV\n\ntype RegistryInternals = (typeof registryConstants)['Symbol(kInternalsSymbol)']\n\ntype Sentry = any\n\ntype Internals = Remap<\n Omit<RegistryInternals, 'getIPC'> &\n Readonly<{\n getIPC: {\n (): Promise<IPC>\n <K extends keyof IPC | undefined>(\n key?: K\n ): Promise<K extends keyof IPC ? IPC[K] : IPC>\n }\n getSentry: () => Sentry\n setSentry(Sentry: Sentry): boolean\n }>\n>\n\ntype ENV = Remap<\n RegistryEnv &\n Readonly<{\n SOCKET_CLI_DEBUG: boolean\n SOCKET_CLI_LEGACY_BUILD: boolean\n SOCKET_CLI_PUBLISHED_BUILD: boolean\n SOCKET_CLI_SENTRY_BUILD: boolean\n SOCKET_CLI_VERSION_HASH: string\n }>\n>\n\ntype IPC = Readonly<{\n SOCKET_CLI_FIX?: string\n SOCKET_CLI_OPTIMIZE?: boolean\n SOCKET_CLI_SAFE_WRAPPER?: boolean\n}>\n\ntype Constants = Remap<\n Omit<typeof registryConstants, 'Symbol(kInternalsSymbol)' | 'ENV' | 'IPC'> & {\n readonly 'Symbol(kInternalsSymbol)': Internals\n readonly ALERT_TYPE_CRITICAL_CVE: 'criticalCVE'\n readonly ALERT_TYPE_CVE: 'cve'\n readonly ALERT_TYPE_MEDIUM_CVE: 'mediumCVE'\n readonly ALERT_TYPE_MILD_CVE: 'mildCVE'\n readonly ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE: 'socketUpgradeAvailable'\n readonly API_V0_URL: 'https://api.socket.dev/v0'\n readonly BABEL_RUNTIME: '@babel/runtime'\n readonly BATCH_PURL_ENDPOINT: 'https://api.socket.dev/v0/purl?alerts=true&compact=true'\n readonly BINARY_LOCK_EXT: '.lockb'\n readonly BUN: 'bun'\n readonly CLI: 'cli'\n readonly CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER: 'firstPatchedVersionIdentifier'\n readonly CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE: 'vulnerableVersionRange'\n readonly ENV: ENV\n readonly DIST_TYPE: 'module-sync' | 'require'\n readonly IPC: IPC\n readonly LOCK_EXT: '.lock'\n readonly MODULE_SYNC: 'module-sync'\n readonly NPM_INJECTION: 'npm-injection'\n readonly NPM_REGISTRY_URL: 'https://registry.npmjs.org'\n readonly NPX: 'npx'\n readonly PNPM: 'pnpm'\n readonly REQUIRE: 'require'\n readonly SHADOW_BIN: 'shadow-bin'\n readonly SOCKET: 'socket'\n readonly SOCKET_CLI_DEBUG: 'SOCKET_CLI_DEBUG'\n readonly SOCKET_CLI_FIX: 'SOCKET_CLI_FIX'\n readonly SOCKET_CLI_ISSUES_URL: 'https://github.com/SocketDev/socket-cli/issues'\n readonly SOCKET_CLI_LEGACY_BUILD: 'SOCKET_CLI_LEGACY_BUILD'\n readonly SOCKET_CLI_OPTIMIZE: 'SOCKET_CLI_OPTIMIZE'\n readonly SOCKET_CLI_PUBLISHED_BUILD: 'SOCKET_CLI_PUBLISHED_BUILD'\n readonly SOCKET_CLI_SAFE_WRAPPER: 'SOCKET_CLI_SAFE_WRAPPER'\n readonly SOCKET_CLI_SENTRY_BUILD: 'SOCKET_CLI_SENTRY_BUILD'\n readonly SOCKET_CLI_VERSION_HASH: 'SOCKET_CLI_VERSION_HASH'\n readonly VLT: 'vlt'\n readonly YARN: 'yarn'\n readonly YARN_BERRY: 'yarn/berry'\n readonly YARN_CLASSIC: 'yarn/classic'\n readonly cdxgenBinPath: string\n readonly distPath: string\n readonly instrumentWithSentryPath: string\n readonly nmBinPath: string\n readonly npmInjectionPath: string\n readonly rootBinPath: string\n readonly rootDistPath: string\n readonly rootPath: string\n readonly rootPkgJsonPath: string\n readonly shadowBinPath: string\n readonly synpBinPath: string\n }\n>\n\nconst ALERT_TYPE_CRITICAL_CVE = 'criticalCVE'\nconst ALERT_TYPE_CVE = 'cve'\nconst ALERT_TYPE_MEDIUM_CVE = 'mediumCVE'\nconst ALERT_TYPE_MILD_CVE = 'mildCVE'\nconst ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE = 'socketUpgradeAvailable'\nconst API_V0_URL = 'https://api.socket.dev/v0'\nconst BABEL_RUNTIME = '@babel/runtime'\nconst BINARY_LOCK_EXT = '.lockb'\nconst BUN = 'bun'\nconst CLI = 'cli'\nconst CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER =\n 'firstPatchedVersionIdentifier'\nconst CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE = 'vulnerableVersionRange'\nconst LOCK_EXT = '.lock'\nconst MODULE_SYNC = 'module-sync'\nconst NPM_INJECTION = 'npm-injection'\nconst NPM_REGISTRY_URL = 'https://registry.npmjs.org'\nconst NPX = 'npx'\nconst PNPM = 'pnpm'\nconst REQUIRE = 'require'\nconst SHADOW_BIN = 'shadow-bin'\nconst SOCKET = 'socket'\nconst SOCKET_CLI_DEBUG = 'SOCKET_CLI_DEBUG'\nconst SOCKET_CLI_FIX = 'SOCKET_CLI_FIX'\nconst SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues'\nconst SOCKET_CLI_LEGACY_BUILD = 'SOCKET_CLI_LEGACY_BUILD'\nconst SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE'\nconst SOCKET_CLI_PUBLISHED_BUILD = 'SOCKET_CLI_PUBLISHED_BUILD'\nconst SOCKET_CLI_SAFE_WRAPPER = 'SOCKET_CLI_SAFE_WRAPPER'\nconst SOCKET_CLI_SENTRY_BUILD = 'SOCKET_CLI_SENTRY_BUILD'\nconst SOCKET_CLI_VERSION_HASH = 'SOCKET_CLI_VERSION_HASH'\nconst VLT = 'vlt'\nconst YARN = 'yarn'\nconst YARN_BERRY = `${YARN}/berry`\nconst YARN_CLASSIC = `${YARN}/classic`\n\nlet _Sentry: any\n\nconst LAZY_BATCH_PURL_ENDPOINT = () => {\n const query = new URLSearchParams()\n query.append('alerts', 'true')\n query.append('compact', 'true')\n return `${API_V0_URL}/purl?${query}`\n}\n\nconst LAZY_DIST_TYPE = () =>\n registryConstants.SUPPORTS_NODE_REQUIRE_MODULE ? MODULE_SYNC : REQUIRE\n\nconst LAZY_ENV = () =>\n Object.freeze({\n // Lazily access registryConstants.ENV.\n ...registryConstants.ENV,\n // Flag set to help debug Socket CLI.\n [SOCKET_CLI_DEBUG]: envAsBoolean(process.env[SOCKET_CLI_DEBUG]),\n // Inline the following environment values so that they CANNOT be influenced\n // by user provided environment variables.\n //\n // Flag set to determine if this is the Legacy build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_LEGACY_BUILD]\".\n [SOCKET_CLI_LEGACY_BUILD]: process.env[SOCKET_CLI_LEGACY_BUILD],\n // Flag set to determine if this is a published build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_PUBLISHED_BUILD]\".\n [SOCKET_CLI_PUBLISHED_BUILD]: process.env[SOCKET_CLI_PUBLISHED_BUILD],\n // Flag set to determine if this is the Sentry build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_SENTRY_BUILD]\".\n [SOCKET_CLI_SENTRY_BUILD]: process.env[SOCKET_CLI_SENTRY_BUILD],\n // Flag set to determine the version hash of the build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_VERSION_HASH]\".\n [SOCKET_CLI_VERSION_HASH]: process.env[SOCKET_CLI_VERSION_HASH]\n })\n\nconst lazyCdxgenBinPath = () =>\n // Lazily access constants.nmBinPath.\n path.join(constants.nmBinPath, 'cdxgen')\n\nconst lazyDistPath = () =>\n // Lazily access constants.rootDistPath and constants.DIST_TYPE.\n path.join(constants.rootDistPath, constants.DIST_TYPE)\n\nconst lazyInstrumentWithSentryPath = () =>\n // Lazily access constants.rootDistPath.\n path.join(constants.rootDistPath, 'instrument-with-sentry.js')\n\nconst lazyNmBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, `${NODE_MODULES}/.bin`)\n\nconst lazyNpmInjectionPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, `${NPM_INJECTION}.js`)\n\nconst lazyRootBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'bin')\n\nconst lazyRootDistPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'dist')\n\nconst lazyRootPath = () =>\n // The '@rollup/plugin-replace' will replace \"process.env.[TAP]\".\n path.resolve(\n realpathSync.native(__dirname),\n process.env[TAP] ? '../..' : '..'\n )\n\nconst lazyRootPkgJsonPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, PACKAGE_JSON)\n\nconst lazyShadowBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, SHADOW_BIN)\n\nconst lazySynpBinPath = () =>\n // Lazily access constants.nmBinPath.\n path.join(constants.nmBinPath, 'synp')\n\nconst constants = <Constants>createConstantsObject(\n {\n ALERT_TYPE_CRITICAL_CVE,\n ALERT_TYPE_CVE,\n ALERT_TYPE_MEDIUM_CVE,\n ALERT_TYPE_MILD_CVE,\n ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE,\n API_V0_URL,\n BABEL_RUNTIME,\n // Lazily defined values are initialized as `undefined` to keep their key order.\n BATCH_PURL_ENDPOINT: undefined,\n BINARY_LOCK_EXT,\n BUN,\n CLI,\n CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,\n CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE,\n DIST_TYPE: undefined,\n ENV: undefined,\n LOCK_EXT,\n MODULE_SYNC,\n NPM_INJECTION,\n NPM_REGISTRY_URL,\n NPX,\n PNPM,\n REQUIRE,\n SHADOW_BIN,\n SOCKET,\n SOCKET_CLI_DEBUG,\n SOCKET_CLI_FIX,\n SOCKET_CLI_ISSUES_URL,\n SOCKET_CLI_LEGACY_BUILD,\n SOCKET_CLI_OPTIMIZE,\n SOCKET_CLI_PUBLISHED_BUILD,\n SOCKET_CLI_SAFE_WRAPPER,\n SOCKET_CLI_SENTRY_BUILD,\n SOCKET_CLI_VERSION_HASH,\n VLT,\n YARN,\n YARN_BERRY,\n YARN_CLASSIC,\n cdxgenBinPath: undefined,\n distPath: undefined,\n instrumentWithSentryPath: undefined,\n nmBinPath: undefined,\n npmInjectionPath: undefined,\n rootBinPath: undefined,\n rootDistPath: undefined,\n rootPath: undefined,\n rootPkgJsonPath: undefined,\n shadowBinPath: undefined,\n synpBinPath: undefined\n },\n {\n getters: {\n BATCH_PURL_ENDPOINT: LAZY_BATCH_PURL_ENDPOINT,\n DIST_TYPE: LAZY_DIST_TYPE,\n ENV: LAZY_ENV,\n distPath: lazyDistPath,\n cdxgenBinPath: lazyCdxgenBinPath,\n instrumentWithSentryPath: lazyInstrumentWithSentryPath,\n nmBinPath: lazyNmBinPath,\n npmInjectionPath: lazyNpmInjectionPath,\n rootBinPath: lazyRootBinPath,\n rootDistPath: lazyRootDistPath,\n rootPath: lazyRootPath,\n rootPkgJsonPath: lazyRootPkgJsonPath,\n shadowBinPath: lazyShadowBinPath,\n synpBinPath: lazySynpBinPath\n },\n internals: {\n getSentry() {\n return _Sentry\n },\n setSentry(Sentry: Sentry): boolean {\n if (_Sentry === undefined) {\n _Sentry = Sentry\n return true\n }\n return false\n }\n },\n mixin: registryConstants\n }\n)\n\nexport default constants\n"],"names":["createConstantsObject","query","path","constants","BATCH_PURL_ENDPOINT","DIST_TYPE","ENV","cdxgenBinPath","distPath","instrumentWithSentryPath","nmBinPath","npmInjectionPath","rootBinPath","rootDistPath","rootPath","rootPkgJsonPath","shadowBinPath","synpBinPath","getters","internals","getSentry","_Sentry","mixin"],"mappings":";;;;;;;;AASA;;;;;AAKE;AACEA;AACF;AACF;AA8FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACE;AACAC;AACAA;AACA;AACF;AAEA;AAGA;AAEI;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF;AAEF;AACE;AACAC;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAKF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEIC;;;;;;;;AASF;AACAC;;;;;;AAMAC;AACAC;;;;;;;;;;;;;;;;;;;;;;;AAuBAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACF;AAEEC;AACEd;AACAC;AACAC;AACAE;AACAD;AACAE;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;;AAEFE;AACEC;AACE;;;;AAIEC;AACA;AACF;AACA;AACF;;AAEFC;AACF;;","debugId":"43200c8b-0de4-4686-ba0f-0fbc8f6029e1"}
|