@socketsecurity/lib 3.3.0 → 3.3.2
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/CHANGELOG.md +14 -0
- package/README.md +3 -2
- package/dist/agent.d.ts +0 -4
- package/dist/agent.js +3 -7
- package/dist/constants/node.js +1 -1
- package/dist/constants/packages.d.ts +7 -0
- package/dist/constants/packages.js +13 -6
- package/dist/constants/socket.d.ts +1 -0
- package/dist/constants/socket.js +3 -0
- package/dist/dlx-package.js +27 -0
- package/dist/env/ci.d.ts +1 -0
- package/dist/env/ci.js +1 -0
- package/dist/env/debug.d.ts +1 -0
- package/dist/env/debug.js +1 -0
- package/dist/env/github.d.ts +8 -0
- package/dist/env/github.js +8 -0
- package/dist/env/helpers.d.ts +3 -0
- package/dist/env/helpers.js +3 -0
- package/dist/env/home.d.ts +1 -0
- package/dist/env/home.js +1 -0
- package/dist/env/locale.d.ts +3 -0
- package/dist/env/locale.js +3 -0
- package/dist/env/node-auth-token.d.ts +1 -0
- package/dist/env/node-auth-token.js +1 -0
- package/dist/env/node-env.d.ts +1 -0
- package/dist/env/node-env.js +1 -0
- package/dist/env/npm.d.ts +5 -0
- package/dist/env/npm.js +5 -0
- package/dist/env/package-manager.d.ts +3 -0
- package/dist/env/package-manager.js +5 -2
- package/dist/env/path.d.ts +1 -0
- package/dist/env/path.js +1 -0
- package/dist/env/pre-commit.d.ts +1 -0
- package/dist/env/pre-commit.js +1 -0
- package/dist/env/shell.d.ts +1 -0
- package/dist/env/shell.js +1 -0
- package/dist/env/socket-cli-shadow.d.ts +5 -0
- package/dist/env/socket-cli-shadow.js +5 -0
- package/dist/env/socket-cli.d.ts +14 -0
- package/dist/env/socket-cli.js +14 -0
- package/dist/env/socket.d.ts +15 -0
- package/dist/env/socket.js +15 -0
- package/dist/env/temp-dir.d.ts +3 -0
- package/dist/env/temp-dir.js +3 -0
- package/dist/env/term.d.ts +1 -0
- package/dist/env/term.js +1 -0
- package/dist/env/test.d.ts +3 -0
- package/dist/env/test.js +4 -1
- package/dist/env/windows.d.ts +4 -0
- package/dist/env/windows.js +4 -0
- package/dist/env/xdg.d.ts +3 -0
- package/dist/env/xdg.js +3 -0
- package/dist/external/@inquirer/checkbox.js +3361 -3
- package/dist/external/@inquirer/confirm.js +1 -0
- package/dist/external/@inquirer/input.js +1 -0
- package/dist/external/@inquirer/password.js +1 -0
- package/dist/external/@inquirer/search.js +1 -0
- package/dist/external/@inquirer/select.js +1 -0
- package/dist/external/@npmcli/arborist.js +5 -0
- package/dist/external/@yarnpkg/extensions.js +2 -2
- package/dist/external/cacache.js +4 -13036
- package/dist/external/libnpmpack.js +4 -67685
- package/dist/external/make-fetch-happen.js +4 -22639
- package/dist/external/normalize-package-data.js +4 -4478
- package/dist/external/npm-core.js +6588 -0
- package/dist/external/npm-pack.js +87518 -0
- package/dist/external/npm-package-arg.js +4 -4515
- package/dist/external/pacote.js +4 -50314
- package/dist/external/semver.js +4 -1934
- package/dist/fs.d.ts +0 -6
- package/dist/fs.js +0 -6
- package/dist/lifecycle-script-names.d.ts +1 -2
- package/dist/lifecycle-script-names.js +2 -4
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +4 -1
- package/dist/maintained-node-versions.d.ts +1 -2
- package/dist/maintained-node-versions.js +2 -4
- package/dist/package-default-node-range.d.ts +1 -2
- package/dist/package-default-node-range.js +3 -5
- package/dist/package-default-socket-categories.d.ts +1 -2
- package/dist/package-default-socket-categories.js +2 -4
- package/dist/package-extensions.d.ts +1 -2
- package/dist/package-extensions.js +2 -4
- package/dist/path.d.ts +11 -0
- package/dist/stdio/prompts.d.ts +17 -0
- package/dist/stdio/prompts.js +10 -11
- package/package.json +78 -73
- package/dist/external/@inquirer/core.js +0 -4
- package/dist/external/@inquirer/prompts.js +0 -4
package/dist/fs.d.ts
CHANGED
|
@@ -616,7 +616,6 @@ export declare function invalidatePathCache(): void;
|
|
|
616
616
|
* await safeDelete('./flaky-dir', { maxRetries: 5, retryDelay: 500 })
|
|
617
617
|
* ```
|
|
618
618
|
*/
|
|
619
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
620
619
|
export declare function safeDelete(filepath: PathLike | PathLike[], options?: RemoveOptions | undefined): Promise<void>;
|
|
621
620
|
/**
|
|
622
621
|
* Safely delete a file or directory synchronously with built-in protections.
|
|
@@ -642,7 +641,6 @@ export declare function safeDelete(filepath: PathLike | PathLike[], options?: Re
|
|
|
642
641
|
* safeDeleteSync('./important', { force: true })
|
|
643
642
|
* ```
|
|
644
643
|
*/
|
|
645
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
646
644
|
export declare function safeDeleteSync(filepath: PathLike | PathLike[], options?: RemoveOptions | undefined): void;
|
|
647
645
|
/**
|
|
648
646
|
* Safely create a directory asynchronously, ignoring EEXIST errors.
|
|
@@ -674,7 +672,6 @@ export declare function safeDeleteSync(filepath: PathLike | PathLike[], options?
|
|
|
674
672
|
* await safeMkdir('./single-level', { recursive: false })
|
|
675
673
|
* ```
|
|
676
674
|
*/
|
|
677
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
678
675
|
export declare function safeMkdir(path: PathLike, options?: MakeDirectoryOptions | undefined): Promise<void>;
|
|
679
676
|
/**
|
|
680
677
|
* Safely create a directory synchronously, ignoring EEXIST errors.
|
|
@@ -705,7 +702,6 @@ export declare function safeMkdir(path: PathLike, options?: MakeDirectoryOptions
|
|
|
705
702
|
* safeMkdirSync('./single-level', { recursive: false })
|
|
706
703
|
* ```
|
|
707
704
|
*/
|
|
708
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
709
705
|
export declare function safeMkdirSync(path: PathLike, options?: MakeDirectoryOptions | undefined): void;
|
|
710
706
|
/**
|
|
711
707
|
* Safely read a file asynchronously, returning undefined on error.
|
|
@@ -844,7 +840,6 @@ export declare function uniqueSync(filepath: PathLike): string;
|
|
|
844
840
|
* await writeJson('./win.json', data, { EOL: '\r\n' })
|
|
845
841
|
* ```
|
|
846
842
|
*/
|
|
847
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
848
843
|
export declare function writeJson(filepath: PathLike, jsonContent: unknown, options?: WriteJsonOptions | string): Promise<void>;
|
|
849
844
|
/**
|
|
850
845
|
* Write JSON content to a file synchronously with formatting.
|
|
@@ -870,5 +865,4 @@ export declare function writeJson(filepath: PathLike, jsonContent: unknown, opti
|
|
|
870
865
|
* writeJsonSync('./compact.json', data, { spaces: 0 })
|
|
871
866
|
* ```
|
|
872
867
|
*/
|
|
873
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
874
868
|
export declare function writeJsonSync(filepath: PathLike, jsonContent: unknown, options?: WriteJsonOptions | string | undefined): void;
|
package/dist/fs.js
CHANGED
|
@@ -442,7 +442,6 @@ function invalidatePathCache() {
|
|
|
442
442
|
_cachedAllowedDirs = void 0;
|
|
443
443
|
}
|
|
444
444
|
(0, import_rewire.registerCacheInvalidation)(invalidatePathCache);
|
|
445
|
-
// @__NO_SIDE_EFFECTS__
|
|
446
445
|
async function safeDelete(filepath, options) {
|
|
447
446
|
const { deleteAsync } = require("./external/del");
|
|
448
447
|
const opts = { __proto__: null, ...options };
|
|
@@ -474,7 +473,6 @@ async function safeDelete(filepath, options) {
|
|
|
474
473
|
onlyFiles: false
|
|
475
474
|
});
|
|
476
475
|
}
|
|
477
|
-
// @__NO_SIDE_EFFECTS__
|
|
478
476
|
function safeDeleteSync(filepath, options) {
|
|
479
477
|
const { deleteSync } = require("./external/del");
|
|
480
478
|
const opts = { __proto__: null, ...options };
|
|
@@ -506,7 +504,6 @@ function safeDeleteSync(filepath, options) {
|
|
|
506
504
|
onlyFiles: false
|
|
507
505
|
});
|
|
508
506
|
}
|
|
509
|
-
// @__NO_SIDE_EFFECTS__
|
|
510
507
|
async function safeMkdir(path, options) {
|
|
511
508
|
const fs = /* @__PURE__ */ getFs();
|
|
512
509
|
const opts = { __proto__: null, recursive: true, ...options };
|
|
@@ -518,7 +515,6 @@ async function safeMkdir(path, options) {
|
|
|
518
515
|
}
|
|
519
516
|
}
|
|
520
517
|
}
|
|
521
|
-
// @__NO_SIDE_EFFECTS__
|
|
522
518
|
function safeMkdirSync(path, options) {
|
|
523
519
|
const fs = /* @__PURE__ */ getFs();
|
|
524
520
|
const opts = { __proto__: null, recursive: true, ...options };
|
|
@@ -598,7 +594,6 @@ function uniqueSync(filepath) {
|
|
|
598
594
|
} while (fs.existsSync(uniquePath));
|
|
599
595
|
return (0, import_path.normalizePath)(uniquePath);
|
|
600
596
|
}
|
|
601
|
-
// @__NO_SIDE_EFFECTS__
|
|
602
597
|
async function writeJson(filepath, jsonContent, options) {
|
|
603
598
|
const opts = typeof options === "string" ? { encoding: options } : options;
|
|
604
599
|
const { EOL, finalEOL, replacer, spaces, ...fsOptions } = {
|
|
@@ -619,7 +614,6 @@ async function writeJson(filepath, jsonContent, options) {
|
|
|
619
614
|
__proto__: null
|
|
620
615
|
});
|
|
621
616
|
}
|
|
622
|
-
// @__NO_SIDE_EFFECTS__
|
|
623
617
|
function writeJsonSync(filepath, jsonContent, options) {
|
|
624
618
|
const opts = typeof options === "string" ? { encoding: options } : options;
|
|
625
619
|
const { EOL, finalEOL, replacer, spaces, ...fsOptions } = {
|
|
@@ -19,8 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var lifecycle_script_names_exports = {};
|
|
21
21
|
__export(lifecycle_script_names_exports, {
|
|
22
|
-
|
|
23
|
-
"module.exports": () => lifecycleScriptNames
|
|
22
|
+
lifecycleScriptNames: () => lifecycleScriptNames
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(lifecycle_script_names_exports);
|
|
26
25
|
const lifecycleScriptNames = new Set(
|
|
@@ -39,8 +38,7 @@ const lifecycleScriptNames = new Set(
|
|
|
39
38
|
].map((n) => [`pre${n}`, n, `post${n}`])
|
|
40
39
|
].flat()
|
|
41
40
|
);
|
|
42
|
-
var lifecycle_script_names_default = lifecycleScriptNames;
|
|
43
41
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
42
|
0 && (module.exports = {
|
|
45
|
-
|
|
43
|
+
lifecycleScriptNames
|
|
46
44
|
});
|
package/dist/logger.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* console.log(`${LOG_SYMBOLS.warn} Warning message`)
|
|
14
14
|
* console.log(`${LOG_SYMBOLS.info} Information message`)
|
|
15
15
|
* console.log(`${LOG_SYMBOLS.step} Processing step`)
|
|
16
|
+
* console.log(`${LOG_SYMBOLS.progress} Working on task`)
|
|
16
17
|
* console.log(`${LOG_SYMBOLS.reason} Working through logic`)
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
@@ -21,6 +22,8 @@ type LogSymbols = {
|
|
|
21
22
|
fail: string;
|
|
22
23
|
/** Blue colored information symbol (ℹ or i in ASCII) */
|
|
23
24
|
info: string;
|
|
25
|
+
/** Cyan colored progress indicator symbol (∴ or :. in ASCII) */
|
|
26
|
+
progress: string;
|
|
24
27
|
/** Dimmed yellow reasoning/working symbol (∴ or :. in ASCII) */
|
|
25
28
|
reason: string;
|
|
26
29
|
/** Cyan colored step symbol (→ or > in ASCII) */
|
|
@@ -79,6 +82,7 @@ export type { LogSymbols, LoggerMethods, Task };
|
|
|
79
82
|
*
|
|
80
83
|
* console.log(`${LOG_SYMBOLS.fail} Build failed`) // Theme error color ✖
|
|
81
84
|
* console.log(`${LOG_SYMBOLS.info} Starting process`) // Theme info color ℹ
|
|
85
|
+
* console.log(`${LOG_SYMBOLS.progress} Working on task`) // Theme step color ∴
|
|
82
86
|
* console.log(`${LOG_SYMBOLS.reason} Analyzing dependencies`) // Dimmed yellow ∴
|
|
83
87
|
* console.log(`${LOG_SYMBOLS.step} Processing files`) // Theme step color →
|
|
84
88
|
* console.log(`${LOG_SYMBOLS.success} Build completed`) // Theme success color ✔
|
package/dist/logger.js
CHANGED
|
@@ -88,6 +88,7 @@ const LOG_SYMBOLS = /* @__PURE__ */ (() => {
|
|
|
88
88
|
const stepColor = theme.colors.step;
|
|
89
89
|
target.fail = /* @__PURE__ */ applyColor(supported ? "\u2716" : "\xD7", errorColor, colors);
|
|
90
90
|
target.info = /* @__PURE__ */ applyColor(supported ? "\u2139" : "i", infoColor, colors);
|
|
91
|
+
target.progress = /* @__PURE__ */ applyColor(supported ? "\u2234" : ":.", stepColor, colors);
|
|
91
92
|
target.reason = colors.dim(
|
|
92
93
|
/* @__PURE__ */ applyColor(supported ? "\u2234" : ":.", warningColor, colors)
|
|
93
94
|
);
|
|
@@ -327,6 +328,7 @@ class Logger {
|
|
|
327
328
|
__proto__: null,
|
|
328
329
|
fail: /* @__PURE__ */ applyColor(supported ? "\u2716" : "\xD7", theme.colors.error, colors),
|
|
329
330
|
info: /* @__PURE__ */ applyColor(supported ? "\u2139" : "i", theme.colors.info, colors),
|
|
331
|
+
progress: /* @__PURE__ */ applyColor(supported ? "\u2234" : ":.", theme.colors.step, colors),
|
|
330
332
|
reason: colors.dim(
|
|
331
333
|
/* @__PURE__ */ applyColor(supported ? "\u2234" : ":.", theme.colors.warning, colors)
|
|
332
334
|
),
|
|
@@ -1060,7 +1062,8 @@ class Logger {
|
|
|
1060
1062
|
const con = this.#getConsole();
|
|
1061
1063
|
const stream = this.#getTargetStream();
|
|
1062
1064
|
const streamObj = stream === "stderr" ? con._stderr : con._stdout;
|
|
1063
|
-
|
|
1065
|
+
const symbols = this.#getSymbols();
|
|
1066
|
+
streamObj.write(`${symbols.progress} ${text}`);
|
|
1064
1067
|
this[lastWasBlankSymbol](false);
|
|
1065
1068
|
return this;
|
|
1066
1069
|
}
|
|
@@ -19,8 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var maintained_node_versions_exports = {};
|
|
21
21
|
__export(maintained_node_versions_exports, {
|
|
22
|
-
|
|
23
|
-
"module.exports": () => maintainedNodeVersions
|
|
22
|
+
maintainedNodeVersions: () => maintainedNodeVersions
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(maintained_node_versions_exports);
|
|
26
25
|
const ObjectFreeze = Object.freeze;
|
|
@@ -36,8 +35,7 @@ const maintainedNodeVersions = ObjectFreeze(
|
|
|
36
35
|
previous
|
|
37
36
|
})
|
|
38
37
|
);
|
|
39
|
-
var maintained_node_versions_default = maintainedNodeVersions;
|
|
40
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
39
|
0 && (module.exports = {
|
|
42
|
-
|
|
40
|
+
maintainedNodeVersions
|
|
43
41
|
});
|
|
@@ -19,15 +19,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var package_default_node_range_exports = {};
|
|
21
21
|
__export(package_default_node_range_exports, {
|
|
22
|
-
|
|
23
|
-
"module.exports": () => packageDefaultNodeRange
|
|
22
|
+
packageDefaultNodeRange: () => packageDefaultNodeRange
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(package_default_node_range_exports);
|
|
26
|
-
const maintainedNodeVersions = require("#lib/maintained-node-versions")
|
|
25
|
+
const { maintainedNodeVersions } = require("#lib/maintained-node-versions");
|
|
27
26
|
const semver = require("./external/semver");
|
|
28
27
|
const packageDefaultNodeRange = `>=${semver.parse(maintainedNodeVersions.last).major}`;
|
|
29
|
-
var package_default_node_range_default = packageDefaultNodeRange;
|
|
30
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
29
|
0 && (module.exports = {
|
|
32
|
-
|
|
30
|
+
packageDefaultNodeRange
|
|
33
31
|
});
|
|
@@ -19,13 +19,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var package_default_socket_categories_exports = {};
|
|
21
21
|
__export(package_default_socket_categories_exports, {
|
|
22
|
-
|
|
23
|
-
"module.exports": () => packageDefaultSocketCategories
|
|
22
|
+
packageDefaultSocketCategories: () => packageDefaultSocketCategories
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(package_default_socket_categories_exports);
|
|
26
25
|
const packageDefaultSocketCategories = Object.freeze(["cleanup"]);
|
|
27
|
-
var package_default_socket_categories_default = packageDefaultSocketCategories;
|
|
28
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
27
|
0 && (module.exports = {
|
|
30
|
-
|
|
28
|
+
packageDefaultSocketCategories
|
|
31
29
|
});
|
|
@@ -19,8 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var package_extensions_exports = {};
|
|
21
21
|
__export(package_extensions_exports, {
|
|
22
|
-
|
|
23
|
-
"module.exports": () => packageExtensions
|
|
22
|
+
packageExtensions: () => packageExtensions
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(package_extensions_exports);
|
|
26
25
|
const { freeze: ObjectFreeze } = Object;
|
|
@@ -65,8 +64,7 @@ const packageExtensions = ObjectFreeze(
|
|
|
65
64
|
return 0;
|
|
66
65
|
})
|
|
67
66
|
);
|
|
68
|
-
var package_extensions_default = packageExtensions;
|
|
69
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
70
68
|
0 && (module.exports = {
|
|
71
|
-
|
|
69
|
+
packageExtensions
|
|
72
70
|
});
|
package/dist/path.d.ts
CHANGED
|
@@ -162,6 +162,13 @@ export declare function isRelative(pathLike: string | Buffer | URL): boolean;
|
|
|
162
162
|
* @param {string | Buffer | URL} pathLike - The path to normalize
|
|
163
163
|
* @returns {string} The normalized path with forward slashes and collapsed segments
|
|
164
164
|
*
|
|
165
|
+
* @security
|
|
166
|
+
* **WARNING**: This function resolves `..` patterns as part of normalization, which means
|
|
167
|
+
* paths like `/../etc/passwd` become `/etc/passwd`. When processing untrusted user input
|
|
168
|
+
* (HTTP requests, file uploads, URL parameters), you MUST validate for path traversal
|
|
169
|
+
* attacks BEFORE calling this function. Check for patterns like `..`, `%2e%2e`, `\..`,
|
|
170
|
+
* and other traversal encodings first.
|
|
171
|
+
*
|
|
165
172
|
* @example
|
|
166
173
|
* ```typescript
|
|
167
174
|
* // Basic normalization
|
|
@@ -182,6 +189,10 @@ export declare function isRelative(pathLike: string | Buffer | URL): boolean;
|
|
|
182
189
|
* normalizePath('..') // '..'
|
|
183
190
|
* normalizePath('///foo///bar///') // '/foo/bar'
|
|
184
191
|
* normalizePath('foo/../..') // '..'
|
|
192
|
+
*
|
|
193
|
+
* // Security: Path traversal is resolved (intended behavior for trusted paths)
|
|
194
|
+
* normalizePath('/../etc/passwd') // '/etc/passwd' ⚠️
|
|
195
|
+
* normalizePath('/safe/../../unsafe') // '/unsafe' ⚠️
|
|
185
196
|
* ```
|
|
186
197
|
*/
|
|
187
198
|
/*@__NO_SIDE_EFFECTS__*/
|
package/dist/stdio/prompts.d.ts
CHANGED
|
@@ -98,6 +98,8 @@ export declare function createInquirerTheme(theme: Theme | ThemeName | unknown):
|
|
|
98
98
|
*/
|
|
99
99
|
/*@__NO_SIDE_EFFECTS__*/
|
|
100
100
|
export declare function wrapPrompt<T = unknown>(inquirerPrompt: (...args: unknown[]) => Promise<T>): (...args: unknown[]) => Promise<T | undefined>;
|
|
101
|
+
// c8 ignore start - Third-party inquirer library requires and exports not testable in isolation.
|
|
102
|
+
declare const checkboxRaw: any;
|
|
101
103
|
declare const confirmRaw: any;
|
|
102
104
|
declare const inputRaw: any;
|
|
103
105
|
declare const passwordRaw: any;
|
|
@@ -105,6 +107,21 @@ declare const searchRaw: any;
|
|
|
105
107
|
declare const selectRaw: any;
|
|
106
108
|
declare const ActualSeparator: any;
|
|
107
109
|
// c8 ignore stop
|
|
110
|
+
/**
|
|
111
|
+
* Prompt to select multiple items from a list of choices.
|
|
112
|
+
* Wrapped with spinner handling and abort signal support.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* const choices = await checkbox({
|
|
116
|
+
* message: 'Select options:',
|
|
117
|
+
* choices: [
|
|
118
|
+
* { name: 'Option 1', value: 'opt1' },
|
|
119
|
+
* { name: 'Option 2', value: 'opt2' },
|
|
120
|
+
* { name: 'Option 3', value: 'opt3' }
|
|
121
|
+
* ]
|
|
122
|
+
* })
|
|
123
|
+
*/
|
|
124
|
+
export declare const checkbox: typeof checkboxRaw;
|
|
108
125
|
/**
|
|
109
126
|
* Prompt for a yes/no confirmation.
|
|
110
127
|
* Wrapped with spinner handling and abort signal support.
|
package/dist/stdio/prompts.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var prompts_exports = {};
|
|
31
31
|
__export(prompts_exports, {
|
|
32
32
|
Separator: () => ActualSeparator,
|
|
33
|
+
checkbox: () => checkbox,
|
|
33
34
|
confirm: () => confirm,
|
|
34
35
|
createInquirerTheme: () => createInquirerTheme,
|
|
35
36
|
createSeparator: () => createSeparator,
|
|
@@ -140,17 +141,14 @@ function wrapPrompt(inquirerPrompt) {
|
|
|
140
141
|
return typeof result === "string" ? result.trim() : result;
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
const searchRaw = searchExport.default ?? searchExport;
|
|
152
|
-
const selectRaw = selectExport.default ?? selectExport;
|
|
153
|
-
const ActualSeparator = selectExport.Separator;
|
|
144
|
+
const checkboxRaw = require("../external/@inquirer/checkbox");
|
|
145
|
+
const confirmRaw = require("../external/@inquirer/confirm");
|
|
146
|
+
const inputRaw = require("../external/@inquirer/input");
|
|
147
|
+
const passwordRaw = require("../external/@inquirer/password");
|
|
148
|
+
const searchRaw = require("../external/@inquirer/search");
|
|
149
|
+
const selectRaw = require("../external/@inquirer/select");
|
|
150
|
+
const ActualSeparator = selectRaw.Separator;
|
|
151
|
+
const checkbox = /* @__PURE__ */ wrapPrompt(checkboxRaw);
|
|
154
152
|
const confirm = /* @__PURE__ */ wrapPrompt(confirmRaw);
|
|
155
153
|
const input = /* @__PURE__ */ wrapPrompt(inputRaw);
|
|
156
154
|
const password = /* @__PURE__ */ wrapPrompt(passwordRaw);
|
|
@@ -162,6 +160,7 @@ function createSeparator(text) {
|
|
|
162
160
|
// Annotate the CommonJS export names for ESM import in node:
|
|
163
161
|
0 && (module.exports = {
|
|
164
162
|
Separator,
|
|
163
|
+
checkbox,
|
|
165
164
|
confirm,
|
|
166
165
|
createInquirerTheme,
|
|
167
166
|
createSeparator,
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
|
+
"packageManager": "pnpm@10.22.0",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
6
7
|
"keywords": [
|
|
@@ -19,6 +20,76 @@
|
|
|
19
20
|
"email": "eng@socket.dev",
|
|
20
21
|
"url": "https://socket.dev"
|
|
21
22
|
},
|
|
23
|
+
"browser": {
|
|
24
|
+
"_http_agent": false,
|
|
25
|
+
"_http_client": false,
|
|
26
|
+
"_http_common": false,
|
|
27
|
+
"_http_incoming": false,
|
|
28
|
+
"_http_outgoing": false,
|
|
29
|
+
"_http_server": false,
|
|
30
|
+
"_stream_duplex": false,
|
|
31
|
+
"_stream_passthrough": false,
|
|
32
|
+
"_stream_readable": false,
|
|
33
|
+
"_stream_transform": false,
|
|
34
|
+
"_stream_wrap": false,
|
|
35
|
+
"_stream_writable": false,
|
|
36
|
+
"_tls_common": false,
|
|
37
|
+
"_tls_wrap": false,
|
|
38
|
+
"assert": false,
|
|
39
|
+
"assert/strict": false,
|
|
40
|
+
"async_hooks": false,
|
|
41
|
+
"buffer": false,
|
|
42
|
+
"child_process": false,
|
|
43
|
+
"cluster": false,
|
|
44
|
+
"console": false,
|
|
45
|
+
"constants": false,
|
|
46
|
+
"crypto": false,
|
|
47
|
+
"dgram": false,
|
|
48
|
+
"diagnostics_channel": false,
|
|
49
|
+
"dns": false,
|
|
50
|
+
"dns/promises": false,
|
|
51
|
+
"domain": false,
|
|
52
|
+
"events": false,
|
|
53
|
+
"fs": false,
|
|
54
|
+
"fs/promises": false,
|
|
55
|
+
"http": false,
|
|
56
|
+
"http2": false,
|
|
57
|
+
"https": false,
|
|
58
|
+
"inspector": false,
|
|
59
|
+
"inspector/promises": false,
|
|
60
|
+
"module": false,
|
|
61
|
+
"net": false,
|
|
62
|
+
"os": false,
|
|
63
|
+
"path": false,
|
|
64
|
+
"path/posix": false,
|
|
65
|
+
"path/win32": false,
|
|
66
|
+
"perf_hooks": false,
|
|
67
|
+
"process": false,
|
|
68
|
+
"punycode": false,
|
|
69
|
+
"querystring": false,
|
|
70
|
+
"readline": false,
|
|
71
|
+
"readline/promises": false,
|
|
72
|
+
"repl": false,
|
|
73
|
+
"stream": false,
|
|
74
|
+
"stream/consumers": false,
|
|
75
|
+
"stream/promises": false,
|
|
76
|
+
"stream/web": false,
|
|
77
|
+
"string_decoder": false,
|
|
78
|
+
"sys": false,
|
|
79
|
+
"timers": false,
|
|
80
|
+
"timers/promises": false,
|
|
81
|
+
"tls": false,
|
|
82
|
+
"trace_events": false,
|
|
83
|
+
"tty": false,
|
|
84
|
+
"url": false,
|
|
85
|
+
"util": false,
|
|
86
|
+
"util/types": false,
|
|
87
|
+
"v8": false,
|
|
88
|
+
"vm": false,
|
|
89
|
+
"wasi": false,
|
|
90
|
+
"worker_threads": false,
|
|
91
|
+
"zlib": false
|
|
92
|
+
},
|
|
22
93
|
"exports": {
|
|
23
94
|
"./abort": {
|
|
24
95
|
"types": "./dist/abort.d.ts",
|
|
@@ -578,7 +649,8 @@
|
|
|
578
649
|
"CHANGELOG.md"
|
|
579
650
|
],
|
|
580
651
|
"engines": {
|
|
581
|
-
"node": ">=22"
|
|
652
|
+
"node": ">=22",
|
|
653
|
+
"pnpm": ">=10.21.0"
|
|
582
654
|
},
|
|
583
655
|
"sideEffects": false,
|
|
584
656
|
"scripts": {
|
|
@@ -602,21 +674,24 @@
|
|
|
602
674
|
"@biomejs/biome": "2.2.4",
|
|
603
675
|
"@eslint/compat": "1.4.0",
|
|
604
676
|
"@eslint/js": "9.38.0",
|
|
677
|
+
"@inquirer/checkbox": "4.3.1",
|
|
605
678
|
"@inquirer/confirm": "5.1.16",
|
|
606
679
|
"@inquirer/input": "4.2.2",
|
|
607
680
|
"@inquirer/password": "4.0.18",
|
|
608
681
|
"@inquirer/search": "3.1.1",
|
|
609
682
|
"@inquirer/select": "4.3.2",
|
|
683
|
+
"@npmcli/arborist": "9.1.4",
|
|
610
684
|
"@npmcli/package-json": "7.0.0",
|
|
611
685
|
"@npmcli/promise-spawn": "8.0.3",
|
|
612
686
|
"@socketregistry/is-unicode-supported": "1.0.5",
|
|
613
687
|
"@socketregistry/packageurl-js": "1.3.5",
|
|
614
688
|
"@socketregistry/yocto-spinner": "1.0.25",
|
|
615
|
-
"@socketsecurity/lib-stable": "
|
|
689
|
+
"@socketsecurity/lib-stable": "npm:@socketsecurity/lib@3.3.1",
|
|
616
690
|
"@types/node": "24.9.2",
|
|
617
691
|
"@typescript/native-preview": "7.0.0-dev.20250920.1",
|
|
618
692
|
"@vitest/coverage-v8": "4.0.3",
|
|
619
693
|
"@vitest/ui": "4.0.3",
|
|
694
|
+
"@yarnpkg/core": "4.5.0",
|
|
620
695
|
"@yarnpkg/extensions": "2.0.6",
|
|
621
696
|
"cacache": "20.0.1",
|
|
622
697
|
"debug": "4.4.3",
|
|
@@ -667,75 +742,5 @@
|
|
|
667
742
|
"typescript": {
|
|
668
743
|
"optional": true
|
|
669
744
|
}
|
|
670
|
-
},
|
|
671
|
-
"browser": {
|
|
672
|
-
"_http_agent": false,
|
|
673
|
-
"_http_client": false,
|
|
674
|
-
"_http_common": false,
|
|
675
|
-
"_http_incoming": false,
|
|
676
|
-
"_http_outgoing": false,
|
|
677
|
-
"_http_server": false,
|
|
678
|
-
"_stream_duplex": false,
|
|
679
|
-
"_stream_passthrough": false,
|
|
680
|
-
"_stream_readable": false,
|
|
681
|
-
"_stream_transform": false,
|
|
682
|
-
"_stream_wrap": false,
|
|
683
|
-
"_stream_writable": false,
|
|
684
|
-
"_tls_common": false,
|
|
685
|
-
"_tls_wrap": false,
|
|
686
|
-
"assert": false,
|
|
687
|
-
"assert/strict": false,
|
|
688
|
-
"async_hooks": false,
|
|
689
|
-
"buffer": false,
|
|
690
|
-
"child_process": false,
|
|
691
|
-
"cluster": false,
|
|
692
|
-
"console": false,
|
|
693
|
-
"constants": false,
|
|
694
|
-
"crypto": false,
|
|
695
|
-
"dgram": false,
|
|
696
|
-
"diagnostics_channel": false,
|
|
697
|
-
"dns": false,
|
|
698
|
-
"dns/promises": false,
|
|
699
|
-
"domain": false,
|
|
700
|
-
"events": false,
|
|
701
|
-
"fs": false,
|
|
702
|
-
"fs/promises": false,
|
|
703
|
-
"http": false,
|
|
704
|
-
"http2": false,
|
|
705
|
-
"https": false,
|
|
706
|
-
"inspector": false,
|
|
707
|
-
"inspector/promises": false,
|
|
708
|
-
"module": false,
|
|
709
|
-
"net": false,
|
|
710
|
-
"os": false,
|
|
711
|
-
"path": false,
|
|
712
|
-
"path/posix": false,
|
|
713
|
-
"path/win32": false,
|
|
714
|
-
"perf_hooks": false,
|
|
715
|
-
"process": false,
|
|
716
|
-
"punycode": false,
|
|
717
|
-
"querystring": false,
|
|
718
|
-
"readline": false,
|
|
719
|
-
"readline/promises": false,
|
|
720
|
-
"repl": false,
|
|
721
|
-
"stream": false,
|
|
722
|
-
"stream/consumers": false,
|
|
723
|
-
"stream/promises": false,
|
|
724
|
-
"stream/web": false,
|
|
725
|
-
"string_decoder": false,
|
|
726
|
-
"sys": false,
|
|
727
|
-
"timers": false,
|
|
728
|
-
"timers/promises": false,
|
|
729
|
-
"tls": false,
|
|
730
|
-
"trace_events": false,
|
|
731
|
-
"tty": false,
|
|
732
|
-
"url": false,
|
|
733
|
-
"util": false,
|
|
734
|
-
"util/types": false,
|
|
735
|
-
"v8": false,
|
|
736
|
-
"vm": false,
|
|
737
|
-
"wasi": false,
|
|
738
|
-
"worker_threads": false,
|
|
739
|
-
"zlib": false
|
|
740
745
|
}
|
|
741
746
|
}
|