@socketsecurity/cli 0.14.28 → 0.14.29
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/bin/cli.js +9 -0
- package/bin/npm-cli.js +9 -0
- package/bin/npx-cli.js +9 -0
- package/bin/shadow/module-sync/npm +3 -0
- package/bin/shadow/module-sync/npx +3 -0
- package/bin/shadow/require/npm +3 -0
- package/bin/shadow/require/npx +3 -0
- package/dist/module-sync/cli.d.ts.map +1 -0
- package/dist/module-sync/cli.js +5256 -0
- package/dist/module-sync/constants.d.ts +15 -0
- package/dist/module-sync/constants.js +62 -0
- package/dist/module-sync/npm-cli.js +85 -0
- package/dist/module-sync/npm-injection.js +1595 -0
- package/dist/module-sync/npx-cli.js +61 -0
- package/dist/{sdk.d.ts → module-sync/sdk.d.ts} +1 -5
- package/dist/module-sync/sdk.js +253 -0
- package/dist/require/cli.d.ts +3 -0
- package/dist/require/cli.d.ts.map +1 -0
- package/dist/{cli.js → require/cli.js} +70 -74
- package/dist/require/color-or-markdown.d.ts +23 -0
- package/dist/require/constants.d.ts +15 -0
- package/dist/require/constants.js +57 -0
- package/dist/require/errors.d.ts +7 -0
- package/dist/require/link.d.ts +2 -0
- package/dist/require/link.js +45 -0
- package/dist/require/npm-cli.d.ts +2 -0
- package/dist/{npm-cli.js → require/npm-cli.js} +12 -10
- package/dist/require/npm-injection.d.ts +1 -0
- package/dist/{npm-injection.js → require/npm-injection.js} +124 -104
- package/dist/require/npx-cli.d.ts +2 -0
- package/dist/{npx-cli.js → require/npx-cli.js} +12 -12
- package/dist/require/path-resolve.d.ts +8 -0
- package/dist/require/path-resolve.js +183 -0
- package/dist/require/sdk.d.ts +9 -0
- package/dist/{sdk.js → require/sdk.js} +16 -36
- package/dist/require/settings.d.ts +9 -0
- package/dist/{vendor.js → require/vendor.js} +6 -1
- package/package.json +53 -18
- package/bin/npm +0 -2
- package/bin/npx +0 -2
- package/dist/cli.d.ts.map +0 -1
- /package/dist/{cli.d.ts → module-sync/cli.d.ts} +0 -0
- /package/dist/{color-or-markdown.d.ts → module-sync/color-or-markdown.d.ts} +0 -0
- /package/dist/{errors.d.ts → module-sync/errors.d.ts} +0 -0
- /package/dist/{link.d.ts → module-sync/link.d.ts} +0 -0
- /package/dist/{link.js → module-sync/link.js} +0 -0
- /package/dist/{npm-cli.d.ts → module-sync/npm-cli.d.ts} +0 -0
- /package/dist/{npm-injection.d.ts → module-sync/npm-injection.d.ts} +0 -0
- /package/dist/{npx-cli.d.ts → module-sync/npx-cli.d.ts} +0 -0
- /package/dist/{path-resolve.d.ts → module-sync/path-resolve.d.ts} +0 -0
- /package/dist/{path-resolve.js → module-sync/path-resolve.js} +0 -0
- /package/dist/{settings.d.ts → module-sync/settings.d.ts} +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var require$$1$1 = require('node:fs/promises');
|
|
4
|
+
var require$$1 = require('node:path');
|
|
5
|
+
var require$$2 = require('ignore');
|
|
6
|
+
var require$$3 = require('micromatch');
|
|
7
|
+
var require$$8 = require('tinyglobby');
|
|
8
|
+
|
|
9
|
+
var pathResolve = {};
|
|
10
|
+
|
|
11
|
+
var ignoreByDefault = {};
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(ignoreByDefault, "__esModule", {
|
|
14
|
+
value: true
|
|
15
|
+
});
|
|
16
|
+
ignoreByDefault.directoryPatterns = directoryPatterns;
|
|
17
|
+
const ignoredDirs = [
|
|
18
|
+
// Taken from ignore-by-default:
|
|
19
|
+
// https://github.com/novemberborn/ignore-by-default/blob/v2.1.0/index.js
|
|
20
|
+
'.git',
|
|
21
|
+
// Git repository files, see <https://git-scm.com/>
|
|
22
|
+
'.log',
|
|
23
|
+
// Log files emitted by tools such as `tsserver`, see <https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29>
|
|
24
|
+
'.nyc_output',
|
|
25
|
+
// Temporary directory where nyc stores coverage data, see <https://github.com/bcoe/nyc>
|
|
26
|
+
'.sass-cache',
|
|
27
|
+
// Cache folder for node-sass, see <https://github.com/sass/node-sass>
|
|
28
|
+
'.yarn',
|
|
29
|
+
// Where node modules are installed when using Yarn, see <https://yarnpkg.com/>
|
|
30
|
+
'bower_components',
|
|
31
|
+
// Where Bower packages are installed, see <http://bower.io/>
|
|
32
|
+
'coverage',
|
|
33
|
+
// Standard output directory for code coverage reports, see <https://github.com/gotwarlost/istanbul>
|
|
34
|
+
'node_modules',
|
|
35
|
+
// Where Node modules are installed, see <https://nodejs.org/>
|
|
36
|
+
// Taken from globby:
|
|
37
|
+
// https://github.com/sindresorhus/globby/blob/v14.0.2/ignore.js#L11-L16
|
|
38
|
+
'flow-typed'];
|
|
39
|
+
const ignoredDirPatterns = ignoredDirs.map(i => `**/${i}`);
|
|
40
|
+
function directoryPatterns() {
|
|
41
|
+
return [...ignoredDirPatterns];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Object.defineProperty(pathResolve, "__esModule", {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
47
|
+
pathResolve.findRoot = findRoot;
|
|
48
|
+
pathResolve.getPackageFiles = getPackageFiles;
|
|
49
|
+
pathResolve.getPackageFilesFullScans = getPackageFilesFullScans;
|
|
50
|
+
var _promises = require$$1$1;
|
|
51
|
+
var _nodePath = require$$1;
|
|
52
|
+
var _ignore = require$$2;
|
|
53
|
+
var _micromatch = require$$3;
|
|
54
|
+
var _tinyglobby = require$$8;
|
|
55
|
+
var _ignoreByDefault = ignoreByDefault;
|
|
56
|
+
async function filterGlobResultToSupportedFiles(entries, supportedFiles) {
|
|
57
|
+
const patterns = ['golang', 'npm', 'pypi'].reduce((r, n) => {
|
|
58
|
+
const supported = supportedFiles[n];
|
|
59
|
+
r.push(...(supported ? Object.values(supported).map(p => `**/${p.pattern}`) : []));
|
|
60
|
+
return r;
|
|
61
|
+
}, []);
|
|
62
|
+
return entries.filter(p => _micromatch.some(p, patterns));
|
|
63
|
+
}
|
|
64
|
+
async function globWithGitIgnore(patterns, options) {
|
|
65
|
+
const {
|
|
66
|
+
cwd = process.cwd(),
|
|
67
|
+
socketConfig,
|
|
68
|
+
...additionalOptions
|
|
69
|
+
} = {
|
|
70
|
+
__proto__: null,
|
|
71
|
+
...options
|
|
72
|
+
};
|
|
73
|
+
const projectIgnorePaths = socketConfig?.projectIgnorePaths;
|
|
74
|
+
const ignoreFiles = await (0, _tinyglobby.glob)(['**/.gitignore'], {
|
|
75
|
+
absolute: true,
|
|
76
|
+
cwd,
|
|
77
|
+
expandDirectories: true
|
|
78
|
+
});
|
|
79
|
+
const ignores = [...(0, _ignoreByDefault.directoryPatterns)(), ...(Array.isArray(projectIgnorePaths) ? ignoreFileLinesToGlobPatterns(projectIgnorePaths, _nodePath.join(cwd, '.gitignore'), cwd) : []), ...(await Promise.all(ignoreFiles.map(async filepath => ignoreFileToGlobPatterns(await _promises.readFile(filepath, 'utf8'), filepath, cwd)))).flat()];
|
|
80
|
+
const hasNegatedPattern = ignores.some(p => p.charCodeAt(0) === 33 /*'!'*/);
|
|
81
|
+
const globOptions = {
|
|
82
|
+
absolute: true,
|
|
83
|
+
cwd,
|
|
84
|
+
expandDirectories: false,
|
|
85
|
+
ignore: hasNegatedPattern ? [] : ignores,
|
|
86
|
+
...additionalOptions
|
|
87
|
+
};
|
|
88
|
+
const result = await (0, _tinyglobby.glob)(patterns, globOptions);
|
|
89
|
+
if (!hasNegatedPattern) {
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
const {
|
|
93
|
+
absolute
|
|
94
|
+
} = globOptions;
|
|
95
|
+
const filtered = _ignore().add(ignores).filter(absolute ? result.map(p => _nodePath.relative(cwd, p)) : result);
|
|
96
|
+
return absolute ? filtered.map(p => _nodePath.resolve(cwd, p)) : filtered;
|
|
97
|
+
}
|
|
98
|
+
function ignoreFileLinesToGlobPatterns(lines, filepath, cwd) {
|
|
99
|
+
const base = _nodePath.relative(cwd, _nodePath.dirname(filepath)).replace(/\\/g, '/');
|
|
100
|
+
const patterns = [];
|
|
101
|
+
for (let i = 0, {
|
|
102
|
+
length
|
|
103
|
+
} = lines; i < length; i += 1) {
|
|
104
|
+
const pattern = lines[i].trim();
|
|
105
|
+
if (pattern.length > 0 && pattern.charCodeAt(0) !== 35 /*'#'*/) {
|
|
106
|
+
patterns.push(ignorePatternToMinimatch(pattern.length && pattern.charCodeAt(0) === 33 /*'!'*/ ? `!${_nodePath.posix.join(base, pattern.slice(1))}` : _nodePath.posix.join(base, pattern)));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return patterns;
|
|
110
|
+
}
|
|
111
|
+
function ignoreFileToGlobPatterns(content, filepath, cwd) {
|
|
112
|
+
return ignoreFileLinesToGlobPatterns(content.split(/\r?\n/), filepath, cwd);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Based on `@eslint/compat` convertIgnorePatternToMinimatch.
|
|
116
|
+
// Apache v2.0 licensed
|
|
117
|
+
// Copyright Nicholas C. Zakas
|
|
118
|
+
// https://github.com/eslint/rewrite/blob/compat-v1.2.1/packages/compat/src/ignore-file.js#L28
|
|
119
|
+
function ignorePatternToMinimatch(pattern) {
|
|
120
|
+
const isNegated = pattern.startsWith('!');
|
|
121
|
+
const negatedPrefix = isNegated ? '!' : '';
|
|
122
|
+
const patternToTest = (isNegated ? pattern.slice(1) : pattern).trimEnd();
|
|
123
|
+
// Special cases.
|
|
124
|
+
if (patternToTest === '' || patternToTest === '**' || patternToTest === '/**' || patternToTest === '**') {
|
|
125
|
+
return `${negatedPrefix}${patternToTest}`;
|
|
126
|
+
}
|
|
127
|
+
const firstIndexOfSlash = patternToTest.indexOf('/');
|
|
128
|
+
const matchEverywherePrefix = firstIndexOfSlash === -1 || firstIndexOfSlash === patternToTest.length - 1 ? '**/' : '';
|
|
129
|
+
const patternWithoutLeadingSlash = firstIndexOfSlash === 0 ? patternToTest.slice(1) : patternToTest;
|
|
130
|
+
// Escape `{` and `(` because in gitignore patterns they are just
|
|
131
|
+
// literal characters without any specific syntactic meaning,
|
|
132
|
+
// while in minimatch patterns they can form brace expansion or extglob syntax.
|
|
133
|
+
//
|
|
134
|
+
// For example, gitignore pattern `src/{a,b}.js` ignores file `src/{a,b}.js`.
|
|
135
|
+
// But, the same minimatch pattern `src/{a,b}.js` ignores files `src/a.js` and `src/b.js`.
|
|
136
|
+
// Minimatch pattern `src/\{a,b}.js` is equivalent to gitignore pattern `src/{a,b}.js`.
|
|
137
|
+
const escapedPatternWithoutLeadingSlash = patternWithoutLeadingSlash.replaceAll(/(?=((?:\\.|[^{(])*))\1([{(])/guy, '$1\\$2');
|
|
138
|
+
const matchInsideSuffix = patternToTest.endsWith('/**') ? '/*' : '';
|
|
139
|
+
return `${negatedPrefix}${matchEverywherePrefix}${escapedPatternWithoutLeadingSlash}${matchInsideSuffix}`;
|
|
140
|
+
}
|
|
141
|
+
function pathsToPatterns(paths) {
|
|
142
|
+
return paths.map(p => p === '.' ? '**/*' : p);
|
|
143
|
+
}
|
|
144
|
+
function findRoot(filepath) {
|
|
145
|
+
let curPath = filepath;
|
|
146
|
+
while (true) {
|
|
147
|
+
if (_nodePath.basename(curPath) === 'npm') {
|
|
148
|
+
return curPath;
|
|
149
|
+
}
|
|
150
|
+
const parent = _nodePath.dirname(curPath);
|
|
151
|
+
if (parent === curPath) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
curPath = parent;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async function getPackageFiles(cwd, inputPaths, config, supportedFiles, debugLog = () => {}) {
|
|
158
|
+
debugLog(`Globbed resolving ${inputPaths.length} paths:`, inputPaths);
|
|
159
|
+
|
|
160
|
+
// TODO: Does not support `~/` paths
|
|
161
|
+
const entries = await globWithGitIgnore(pathsToPatterns(inputPaths), {
|
|
162
|
+
cwd,
|
|
163
|
+
socketConfig: config
|
|
164
|
+
});
|
|
165
|
+
debugLog(`Globbed resolved ${inputPaths.length} paths to ${entries.length} paths:`, entries);
|
|
166
|
+
const packageFiles = await filterGlobResultToSupportedFiles(entries, supportedFiles);
|
|
167
|
+
debugLog(`Mapped ${entries.length} entries to ${packageFiles.length} files:`, packageFiles);
|
|
168
|
+
return packageFiles;
|
|
169
|
+
}
|
|
170
|
+
async function getPackageFilesFullScans(cwd, inputPaths, supportedFiles, debugLog = () => {}) {
|
|
171
|
+
debugLog(`Globbed resolving ${inputPaths.length} paths:`, inputPaths);
|
|
172
|
+
|
|
173
|
+
// TODO: Does not support `~/` paths
|
|
174
|
+
const entries = await globWithGitIgnore(pathsToPatterns(inputPaths), {
|
|
175
|
+
cwd
|
|
176
|
+
});
|
|
177
|
+
debugLog(`Globbed resolved ${inputPaths.length} paths to ${entries.length} paths:`, entries);
|
|
178
|
+
const packageFiles = await filterGlobResultToSupportedFiles(entries, supportedFiles);
|
|
179
|
+
debugLog(`Mapped ${entries.length} entries to ${packageFiles.length} files:`, packageFiles);
|
|
180
|
+
return packageFiles;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
exports.pathResolve = pathResolve;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { SocketSdk } from '@socketsecurity/sdk';
|
|
3
|
+
declare function createDebugLogger(printDebugLogs?: boolean): typeof console.error;
|
|
4
|
+
declare function isErrnoException(value: unknown): value is NodeJS.ErrnoException;
|
|
5
|
+
declare function stringJoinWithSeparateFinalSeparator(list: (string | undefined)[], separator?: string): string;
|
|
6
|
+
declare const FREE_API_KEY = "sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api";
|
|
7
|
+
declare function getDefaultKey(): string | undefined;
|
|
8
|
+
declare function setupSdk(apiKey?: string | undefined, apiBaseUrl?: string | undefined, proxy?: string | undefined): Promise<SocketSdk>;
|
|
9
|
+
export { createDebugLogger, isErrnoException, stringJoinWithSeparateFinalSeparator, FREE_API_KEY, getDefaultKey, setupSdk };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var require$$0 = require('@socketsecurity/registry/lib/env');
|
|
4
3
|
var vendor = require('./vendor.js');
|
|
5
4
|
var require$$1 = require('yoctocolors-cjs');
|
|
6
|
-
var require$$1$3 = require('
|
|
7
|
-
var require$$
|
|
8
|
-
var require$$
|
|
9
|
-
var
|
|
10
|
-
var require$$
|
|
11
|
-
var require$$0$1 = require('node:fs');
|
|
5
|
+
var require$$1$3 = require('@inquirer/prompts');
|
|
6
|
+
var require$$2 = require('hpagent');
|
|
7
|
+
var require$$4 = require('@socketsecurity/sdk');
|
|
8
|
+
var constants = require('./constants.js');
|
|
9
|
+
var require$$0 = require('node:fs');
|
|
12
10
|
var require$$1$1 = require('node:os');
|
|
11
|
+
var require$$1$2 = require('node:path');
|
|
13
12
|
var require$$3 = require('@socketregistry/yocto-spinner');
|
|
14
13
|
|
|
15
14
|
var errors = {};
|
|
@@ -28,19 +27,6 @@ class InputError extends Error {
|
|
|
28
27
|
}
|
|
29
28
|
errors.InputError = InputError;
|
|
30
29
|
|
|
31
|
-
var constants = {};
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(constants, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
});
|
|
36
|
-
constants.ENV = constants.API_V0_URL = void 0;
|
|
37
|
-
var _env = require$$0;
|
|
38
|
-
constants.API_V0_URL = 'https://api.socket.dev/v0';
|
|
39
|
-
constants.ENV = Object.freeze({
|
|
40
|
-
// Flag set by the optimize command to bypass the packagesHaveRiskyIssues check.
|
|
41
|
-
UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE: (0, _env.envAsBoolean)(process.env['UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE'])
|
|
42
|
-
});
|
|
43
|
-
|
|
44
30
|
var colorOrMarkdown = {};
|
|
45
31
|
|
|
46
32
|
var _interopRequireDefault$1 = vendor.interopRequireDefault.default;
|
|
@@ -153,17 +139,17 @@ Object.defineProperty(settings$1, "__esModule", {
|
|
|
153
139
|
});
|
|
154
140
|
settings$1.getSetting = getSetting;
|
|
155
141
|
settings$1.updateSetting = updateSetting;
|
|
156
|
-
var _nodeFs = require$$0
|
|
142
|
+
var _nodeFs = require$$0;
|
|
157
143
|
var _nodeOs = require$$1$1;
|
|
158
|
-
var _nodePath
|
|
144
|
+
var _nodePath = require$$1$2;
|
|
159
145
|
var _yoctoSpinner = require$$3;
|
|
160
146
|
let dataHome = process.platform === 'win32' ? process.env['LOCALAPPDATA'] : process.env['XDG_DATA_HOME'];
|
|
161
147
|
if (!dataHome) {
|
|
162
148
|
if (process.platform === 'win32') throw new Error('missing %LOCALAPPDATA%');
|
|
163
149
|
const home = _nodeOs.homedir();
|
|
164
|
-
dataHome = _nodePath
|
|
150
|
+
dataHome = _nodePath.join(home, ...(process.platform === 'darwin' ? ['Library', 'Application Support'] : ['.local', 'share']));
|
|
165
151
|
}
|
|
166
|
-
const settingsPath = _nodePath
|
|
152
|
+
const settingsPath = _nodePath.join(dataHome, 'socket', 'settings');
|
|
167
153
|
let settings = {};
|
|
168
154
|
if ((0, _nodeFs.existsSync)(settingsPath)) {
|
|
169
155
|
const raw = (0, _nodeFs.readFileSync)(settingsPath, 'utf-8');
|
|
@@ -173,7 +159,7 @@ if ((0, _nodeFs.existsSync)(settingsPath)) {
|
|
|
173
159
|
_yoctoSpinner().warning(`Failed to parse settings at ${settingsPath}`);
|
|
174
160
|
}
|
|
175
161
|
} else {
|
|
176
|
-
(0, _nodeFs.mkdirSync)(_nodePath
|
|
162
|
+
(0, _nodeFs.mkdirSync)(_nodePath.dirname(settingsPath), {
|
|
177
163
|
recursive: true
|
|
178
164
|
});
|
|
179
165
|
}
|
|
@@ -199,16 +185,13 @@ Object.defineProperty(sdk, "__esModule", {
|
|
|
199
185
|
sdk.FREE_API_KEY = void 0;
|
|
200
186
|
sdk.getDefaultKey = getDefaultKey;
|
|
201
187
|
sdk.setupSdk = setupSdk;
|
|
202
|
-
var
|
|
203
|
-
var
|
|
204
|
-
var _prompts = require$$1$4;
|
|
205
|
-
var _hpagent = require$$4;
|
|
188
|
+
var _prompts = require$$1$3;
|
|
189
|
+
var _hpagent = require$$2;
|
|
206
190
|
var _isInteractive = _interopRequireDefault(vendor.isInteractive);
|
|
207
|
-
var _sdk = require$$
|
|
191
|
+
var _sdk = require$$4;
|
|
192
|
+
var _constants = constants.constants;
|
|
208
193
|
var _errors = errors;
|
|
209
194
|
var _settings = settings$1;
|
|
210
|
-
const distPath = __dirname;
|
|
211
|
-
const rootPath = _nodePath.resolve(distPath, '..');
|
|
212
195
|
sdk.FREE_API_KEY = 'sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api';
|
|
213
196
|
|
|
214
197
|
// This API key should be stored globally for the duration of the CLI execution
|
|
@@ -252,18 +235,15 @@ async function setupSdk(apiKey = getDefaultKey(), apiBaseUrl = getDefaultAPIBase
|
|
|
252
235
|
})
|
|
253
236
|
};
|
|
254
237
|
}
|
|
255
|
-
const packageJsonPath = _nodePath.join(rootPath, 'package.json');
|
|
256
|
-
const packageJson = await _promises.readFile(packageJsonPath, 'utf8');
|
|
257
238
|
const sdkOptions = {
|
|
258
239
|
agent,
|
|
259
240
|
baseUrl: apiBaseUrl,
|
|
260
|
-
userAgent: (0, _sdk.createUserAgentFromPkgJson)(
|
|
241
|
+
userAgent: (0, _sdk.createUserAgentFromPkgJson)(require(_constants.rootPkgJsonPath))
|
|
261
242
|
};
|
|
262
243
|
return new _sdk.SocketSdk(apiKey || '', sdkOptions);
|
|
263
244
|
}
|
|
264
245
|
|
|
265
246
|
exports.colorOrMarkdown = colorOrMarkdown;
|
|
266
|
-
exports.constants = constants;
|
|
267
247
|
exports.errors = errors;
|
|
268
248
|
exports.misc = misc;
|
|
269
249
|
exports.sdk = sdk;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Settings {
|
|
2
|
+
apiKey?: string | null;
|
|
3
|
+
enforcedOrgs?: string[] | null;
|
|
4
|
+
apiBaseUrl?: string | null;
|
|
5
|
+
apiProxy?: string | null;
|
|
6
|
+
}
|
|
7
|
+
declare function getSetting<Key extends keyof Settings>(key: Key): Settings[Key];
|
|
8
|
+
declare function updateSetting<Key extends keyof Settings>(key: Key, value: Settings[Key]): void;
|
|
9
|
+
export { getSetting, updateSetting };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var require$$1$1 = require('node:path');
|
|
4
3
|
var require$$8 = require('node:url');
|
|
5
4
|
var require$$0 = require('node:fs');
|
|
6
5
|
var require$$1 = require('node:os');
|
|
6
|
+
var require$$1$1 = require('node:path');
|
|
7
7
|
var require$$0$1 = require('node:process');
|
|
8
8
|
var require$$0$2 = require('node:util');
|
|
9
9
|
var require$$1$2 = require('node:tty');
|
|
@@ -13,6 +13,10 @@ var require$$2$2 = require('node:buffer');
|
|
|
13
13
|
var require$$2$1 = require('node:child_process');
|
|
14
14
|
|
|
15
15
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
16
|
+
function getDefaultExportFromCjs (x) {
|
|
17
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
var interopRequireWildcard = {};
|
|
17
21
|
|
|
18
22
|
var _typeof$1 = {};
|
|
@@ -9976,6 +9980,7 @@ open$1.default = open;
|
|
|
9976
9980
|
|
|
9977
9981
|
exports.build = build;
|
|
9978
9982
|
exports.dist = dist$1;
|
|
9983
|
+
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
9979
9984
|
exports.interopRequireDefault = interopRequireDefault;
|
|
9980
9985
|
exports.interopRequireWildcard = interopRequireWildcard;
|
|
9981
9986
|
exports.isInteractive = isInteractive$1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.29",
|
|
4
4
|
"description": "CLI tool for Socket.dev",
|
|
5
5
|
"homepage": "http://github.com/SocketDev/socket-cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,10 +14,44 @@
|
|
|
14
14
|
"url": "https://socket.dev"
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|
|
17
|
-
"cli": "
|
|
18
|
-
"socket": "
|
|
19
|
-
"socket-npm": "
|
|
20
|
-
"socket-npx": "
|
|
17
|
+
"cli": "./bin/cli.js",
|
|
18
|
+
"socket": "./bin/cli.js",
|
|
19
|
+
"socket-npm": "./bin/npm-cli.js",
|
|
20
|
+
"socket-npx": "./bin/npx-cli.js"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
"./bin/cli.js": {
|
|
24
|
+
"module-sync": {
|
|
25
|
+
"types": "./dist/module-sync/cli.d.ts",
|
|
26
|
+
"default": "./dist/module-sync/cli.js"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./dist/require/cli.d.ts",
|
|
30
|
+
"default": "./dist/require/cli.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"./bin/npm-cli.js": {
|
|
34
|
+
"module-sync": {
|
|
35
|
+
"types": "./dist/module-sync/npm-cli.d.ts",
|
|
36
|
+
"default": "./dist/module-sync/npm-cli.js"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./dist/require/npm-cli.d.ts",
|
|
40
|
+
"default": "./dist/require/npm-cli.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"./bin/npx-cli.js": {
|
|
44
|
+
"module-sync": {
|
|
45
|
+
"types": "./dist/module-sync/npx-cli.d.ts",
|
|
46
|
+
"default": "./dist/module-sync/npx-cli.js"
|
|
47
|
+
},
|
|
48
|
+
"require": {
|
|
49
|
+
"types": "./dist/require/npx-cli.d.ts",
|
|
50
|
+
"default": "./dist/require/npx-cli.js"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"./package.json": "./package.json",
|
|
54
|
+
"./translations.json": "./translations.json"
|
|
21
55
|
},
|
|
22
56
|
"scripts": {
|
|
23
57
|
"build": "run-s build:*",
|
|
@@ -32,12 +66,12 @@
|
|
|
32
66
|
"lint": "oxlint -c=./.oxlintrc.json --ignore-path=./.prettierignore --tsconfig=./tsconfig.json .",
|
|
33
67
|
"lint:fix": "npm run lint -- --fix && npm run lint:fix:fast",
|
|
34
68
|
"lint:fix:fast": "prettier --cache --log-level warn --write .",
|
|
35
|
-
"prepare": "husky",
|
|
69
|
+
"prepare": "husky && custompatch",
|
|
36
70
|
"test": "run-s check build:* test:*",
|
|
37
71
|
"test:c8": "c8 --reporter=none node --test 'test/socket-npm.test.cjs'",
|
|
38
72
|
"test-ci": "run-s build:* test:*",
|
|
39
|
-
"test:unit": "tap",
|
|
40
|
-
"test:coverage": "cp -r .tap/coverage/*.json coverage/tmp && c8 --reporter=lcov --reporter=text --include 'dist/*.js' --exclude 'dist/vendor.js' report"
|
|
73
|
+
"test:unit": "tap-run",
|
|
74
|
+
"test:coverage": "cp -r .tap/coverage/*.json coverage/tmp && c8 --reporter=lcov --reporter=text --include 'dist/{module-sync,require}/*.js' --exclude 'dist/require/vendor.js' report"
|
|
41
75
|
},
|
|
42
76
|
"dependencies": {
|
|
43
77
|
"@apideck/better-ajv-errors": "^0.3.6",
|
|
@@ -47,7 +81,7 @@
|
|
|
47
81
|
"@socketregistry/hyrious__bun.lockb": "1.0.5",
|
|
48
82
|
"@socketregistry/yocto-spinner": "^1.0.1",
|
|
49
83
|
"@socketsecurity/config": "^2.1.3",
|
|
50
|
-
"@socketsecurity/registry": "^1.0.
|
|
84
|
+
"@socketsecurity/registry": "^1.0.33",
|
|
51
85
|
"@socketsecurity/sdk": "^1.3.0",
|
|
52
86
|
"blessed": "^0.1.81",
|
|
53
87
|
"blessed-contrib": "^4.11.0",
|
|
@@ -72,18 +106,19 @@
|
|
|
72
106
|
"@babel/plugin-proposal-export-default-from": "^7.25.9",
|
|
73
107
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
74
108
|
"@babel/plugin-transform-export-namespace-from": "^7.25.9",
|
|
75
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
109
|
+
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
|
|
76
110
|
"@babel/plugin-transform-runtime": "^7.25.9",
|
|
77
111
|
"@babel/preset-env": "^7.26.0",
|
|
78
112
|
"@babel/preset-typescript": "^7.26.0",
|
|
79
113
|
"@babel/runtime": "^7.26.0",
|
|
80
|
-
"@eslint/compat": "^1.2.
|
|
114
|
+
"@eslint/compat": "^1.2.4",
|
|
81
115
|
"@eslint/js": "^9.16.0",
|
|
82
116
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
83
117
|
"@rollup/plugin-json": "^6.1.0",
|
|
84
118
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
85
119
|
"@rollup/plugin-replace": "^6.0.1",
|
|
86
120
|
"@rollup/pluginutils": "^5.1.3",
|
|
121
|
+
"@tapjs/run": "^4.0.1",
|
|
87
122
|
"@types/blessed": "^0.1.25",
|
|
88
123
|
"@types/micromatch": "^4.0.9",
|
|
89
124
|
"@types/mocha": "^10.0.10",
|
|
@@ -99,29 +134,29 @@
|
|
|
99
134
|
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
|
100
135
|
"@typescript-eslint/parser": "^8.17.0",
|
|
101
136
|
"c8": "^10.1.2",
|
|
137
|
+
"custompatch": "^1.0.28",
|
|
102
138
|
"eslint": "^9.16.0",
|
|
103
|
-
"eslint-import-resolver-oxc": "^0.
|
|
139
|
+
"eslint-import-resolver-oxc": "^0.6.0",
|
|
104
140
|
"eslint-plugin-depend": "^0.12.0",
|
|
105
|
-
"eslint-plugin-import-x": "^4.
|
|
141
|
+
"eslint-plugin-import-x": "^4.5.0",
|
|
106
142
|
"eslint-plugin-n": "^17.14.0",
|
|
107
143
|
"eslint-plugin-sort-destructure-keys": "^2.0.0",
|
|
108
144
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
109
145
|
"husky": "^9.1.7",
|
|
110
146
|
"is-interactive": "^2.0.0",
|
|
111
147
|
"is-unicode-supported": "^2.1.0",
|
|
112
|
-
"knip": "^5.39.
|
|
148
|
+
"knip": "^5.39.2",
|
|
113
149
|
"magic-string": "^0.30.14",
|
|
114
150
|
"meow": "^13.2.0",
|
|
115
151
|
"mock-fs": "^5.4.1",
|
|
116
152
|
"nock": "^13.5.6",
|
|
117
153
|
"npm-run-all2": "^7.0.1",
|
|
118
154
|
"open": "^10.1.0",
|
|
119
|
-
"oxlint": "0.14.
|
|
120
|
-
"prettier": "3.4.
|
|
155
|
+
"oxlint": "0.14.1",
|
|
156
|
+
"prettier": "3.4.2",
|
|
121
157
|
"read-package-up": "^11.0.0",
|
|
122
|
-
"rollup": "4.28.
|
|
158
|
+
"rollup": "4.28.1",
|
|
123
159
|
"rollup-plugin-ts": "^3.4.5",
|
|
124
|
-
"tap": "^21.0.1",
|
|
125
160
|
"terminal-link": "^3.0.0",
|
|
126
161
|
"tiny-updater": "^3.5.2",
|
|
127
162
|
"type-coverage": "^2.29.7",
|
package/bin/npm
DELETED
package/bin/npx
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts","../src/utils/formatting.ts","../src/flags.ts","../src/utils/meow-with-subcommands.ts","../src/commands/cdxgen.ts","../src/utils/api-helpers.ts","../src/utils/objects.ts","../src/utils/format-issues.ts","../src/commands/info.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/npm.ts","../src/commands/npx.ts","../src/utils/fs.ts","../src/utils/package-manager-detector.ts","../src/commands/optimize.ts","../src/commands/organization.ts","../src/commands/raw-npm.ts","../src/commands/raw-npx.ts","../src/commands/report/view.ts","../src/commands/report/create.ts","../src/commands/report/index.ts","../src/commands/wrapper.ts","../src/commands/scan/create.ts","../src/commands/scan/delete.ts","../src/commands/scan/list.ts","../src/commands/scan/metadata.ts","../src/commands/scan/stream.ts","../src/commands/scan/index.ts","../src/commands/audit-log.ts","../src/commands/repos/create.ts","../src/commands/repos/delete.ts","../src/commands/repos/list.ts","../src/commands/repos/update.ts","../src/commands/repos/view.ts","../src/commands/repos/index.ts","../src/commands/dependencies.ts","../src/commands/analytics.ts","../src/commands/diff-scan/get.ts","../src/commands/diff-scan/index.ts","../src/commands/threat-feed.ts","../src/commands/index.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|