@socketsecurity/lib 6.0.4 → 6.0.6
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 +24 -0
- package/dist/ai/discover.js +3 -2
- package/dist/ai/spawn.js +8 -5
- package/dist/ai/worktree.js +11 -6
- package/dist/ansi/strip.js +2 -2
- package/dist/archives/_internal.js +4 -4
- package/dist/archives/zip.js +1 -1
- package/dist/arrays/_internal.js +2 -2
- package/dist/arrays/chunk.js +1 -1
- package/dist/arrays/join.js +2 -2
- package/dist/arrays/unique.js +1 -1
- package/dist/bin/acorn-bindgen.cjs +769 -0
- package/dist/bin/acorn.wasm +0 -0
- package/dist/bin/check-primordials.js +3 -2
- package/dist/bin/check.js +3 -2
- package/dist/bin/exec.js +1 -1
- package/dist/bin/prim.cjs +39064 -0
- package/dist/bin/resolve.js +1 -1
- package/dist/colors/socket-palette.js +2 -2
- package/dist/compression/_internal.js +3 -2
- package/dist/compression/brotli.js +5 -12
- package/dist/compression/gzip.js +5 -13
- package/dist/constants/agents.js +4 -4
- package/dist/constants/packages.js +6 -6
- package/dist/constants/socket.js +1 -1
- package/dist/crypto/hash.js +2 -2
- package/dist/debug/_internal.js +2 -2
- package/dist/debug/caller-info.js +1 -1
- package/dist/debug/namespace.js +5 -5
- package/dist/debug/output.js +3 -3
- package/dist/dlx/binary-download.js +3 -2
- package/dist/eco/npm/npm/flags.js +5 -5
- package/dist/eco/npm/pnpm/flags.js +3 -3
- package/dist/env/boolean.js +1 -1
- package/dist/env/ci.js +1 -1
- package/dist/env/debug.js +1 -1
- package/dist/env/github.js +8 -8
- package/dist/env/home.js +1 -1
- package/dist/env/locale.js +3 -3
- package/dist/env/node-auth-token.js +1 -1
- package/dist/env/node-env.js +1 -1
- package/dist/env/npm.js +5 -5
- package/dist/env/number.js +1 -1
- package/dist/env/package-manager.js +3 -3
- package/dist/env/path.js +1 -1
- package/dist/env/pre-commit.js +1 -1
- package/dist/env/rewire.js +2 -2
- package/dist/env/shell.js +1 -1
- package/dist/env/socket-cli.js +13 -13
- package/dist/env/socket.js +33 -32
- package/dist/env/string.js +1 -1
- package/dist/env/temp-dir.js +3 -3
- package/dist/env/term.js +1 -1
- package/dist/env/test.js +3 -3
- package/dist/env/windows.js +4 -4
- package/dist/env/xdg.js +3 -3
- package/dist/events/exit/_internal.js +5 -5
- package/dist/events/exit/handler.js +1 -1
- package/dist/events/exit/intercept.js +2 -2
- package/dist/events/exit/lifecycle.js +3 -3
- package/dist/events/exit/signals.js +1 -1
- package/dist/external/@sinclair/typebox/value.js +5 -1
- package/dist/external/@sinclair/typebox.js +5 -1
- package/dist/external/@socketregistry/packageurl-js.js +27 -0
- package/dist/external-tools/bazel/resolve.js +2 -1
- package/dist/external-tools/cdxgen/resolve.js +2 -1
- package/dist/external-tools/from-pip-venv.d.ts +73 -0
- package/dist/external-tools/from-pip-venv.js +98 -0
- package/dist/external-tools/janus/asset-names.js +1 -1
- package/dist/external-tools/janus/from-download.js +3 -5
- package/dist/external-tools/janus/resolve.js +2 -1
- package/dist/external-tools/jre/from-download.js +2 -1
- package/dist/external-tools/jre/resolve.js +2 -1
- package/dist/external-tools/manifest.js +7 -5
- package/dist/external-tools/opengrep/resolve.js +2 -1
- package/dist/external-tools/sbt/resolve.js +2 -1
- package/dist/external-tools/skillspector/from-dlx.d.ts +24 -0
- package/dist/external-tools/skillspector/from-dlx.js +41 -0
- package/dist/external-tools/skillspector/from-path.d.ts +8 -0
- package/dist/external-tools/skillspector/from-path.js +32 -0
- package/dist/external-tools/skillspector/from-vfs.d.ts +8 -0
- package/dist/external-tools/skillspector/from-vfs.js +27 -0
- package/dist/external-tools/skillspector/resolve.d.ts +34 -0
- package/dist/external-tools/skillspector/resolve.js +53 -0
- package/dist/external-tools/skillspector/types.d.ts +24 -0
- package/dist/external-tools/skillspector/types.js +2 -0
- package/dist/external-tools/synp/resolve.js +2 -1
- package/dist/external-tools/trivy/resolve.js +2 -1
- package/dist/external-tools/trufflehog/resolve.js +2 -1
- package/dist/external-tools/uv/resolve.js +2 -1
- package/dist/fs/access.js +4 -4
- package/dist/fs/encoding.js +2 -2
- package/dist/fs/find-up.js +2 -2
- package/dist/fs/inspect.js +6 -6
- package/dist/fs/read-dir.js +3 -3
- package/dist/fs/read-file.js +6 -6
- package/dist/fs/read-json.js +2 -2
- package/dist/fs/safe.js +2 -2
- package/dist/fs/unique.js +1 -1
- package/dist/fs/validate.js +1 -1
- package/dist/fs/write-json.js +1 -1
- package/dist/git/_internal.js +2 -1
- package/dist/globs/_internal.js +4 -4
- package/dist/globs/match.js +4 -3
- package/dist/globs/matcher.js +3 -3
- package/dist/globs/stream.js +1 -1
- package/dist/http-request/browser.js +17 -11
- package/dist/http-request/download.js +1 -1
- package/dist/http-request/headers.d.ts +32 -3
- package/dist/http-request/headers.js +42 -13
- package/dist/http-request/request-attempt.js +1 -0
- package/dist/http-request/request-types.d.ts +5 -0
- package/dist/http-request/request.js +32 -15
- package/dist/http-request/response-reader.d.ts +12 -1
- package/dist/http-request/response-reader.js +22 -2
- package/dist/http-request/user-agent.js +1 -1
- package/dist/json/edit.js +1 -1
- package/dist/json/parse.js +4 -4
- package/dist/logger/colors.js +2 -2
- package/dist/logger/console.js +1 -1
- package/dist/logger/node.js +0 -1
- package/dist/logger/symbols.js +1 -1
- package/dist/node/async-hooks.js +2 -2
- package/dist/node/child-process.js +2 -2
- package/dist/node/crypto.js +2 -2
- package/dist/node/events.js +2 -2
- package/dist/node/fs-promises.js +2 -2
- package/dist/node/fs.js +2 -2
- package/dist/node/http.js +2 -2
- package/dist/node/https.js +2 -2
- package/dist/node/module.js +3 -3
- package/dist/node/os.js +2 -2
- package/dist/node/path.js +2 -2
- package/dist/node/timers-promises.js +2 -2
- package/dist/node/url.js +2 -2
- package/dist/node/util.js +2 -2
- package/dist/objects/getters.js +2 -2
- package/dist/objects/inspect.js +3 -3
- package/dist/objects/mutate.js +1 -1
- package/dist/objects/predicates.js +4 -4
- package/dist/objects/sort.js +4 -4
- package/dist/packages/edit-class.js +1 -1
- package/dist/packages/edit.js +2 -2
- package/dist/packages/exports.js +6 -6
- package/dist/packages/licenses.js +8 -8
- package/dist/packages/manifest.js +3 -3
- package/dist/packages/normalize.js +4 -4
- package/dist/packages/operations.js +11 -11
- package/dist/packages/provenance.d.ts +6 -0
- package/dist/packages/provenance.js +12 -3
- package/dist/packages/specs.js +5 -5
- package/dist/packages/validation.js +3 -3
- package/dist/paths/_internal.js +3 -3
- package/dist/paths/conversion.js +4 -4
- package/dist/paths/normalize.js +3 -1
- package/dist/paths/packages.js +3 -3
- package/dist/paths/predicates.js +7 -7
- package/dist/paths/resolve.js +3 -3
- package/dist/process/spawn/_internal.js +3 -3
- package/dist/process/spawn/errors.js +2 -2
- package/dist/process/spawn/stdio.js +1 -1
- package/dist/promises/_internal.js +1 -1
- package/dist/promises/iterate.js +5 -5
- package/dist/promises/options.js +3 -3
- package/dist/promises/retry.js +1 -1
- package/dist/secrets/_internal.js +3 -2
- package/dist/secrets/keychain.js +5 -4
- package/dist/secrets/linux.js +6 -4
- package/dist/secrets/macos.js +5 -3
- package/dist/secrets/rc.js +9 -6
- package/dist/secrets/windows.js +7 -4
- package/dist/shell/parse.d.ts +108 -1
- package/dist/shell/parse.js +168 -2
- package/dist/smol/detect.js +1 -1
- package/dist/smol/http.js +1 -1
- package/dist/smol/https.js +1 -1
- package/dist/smol/manifest.js +1 -1
- package/dist/smol/path.js +1 -1
- package/dist/smol/primordial.js +1 -1
- package/dist/smol/purl.js +1 -1
- package/dist/smol/versions.js +1 -1
- package/dist/smol/vfs.js +1 -1
- package/dist/sorts/_internal.js +4 -4
- package/dist/sorts/natural.js +3 -3
- package/dist/sorts/semver.js +1 -1
- package/dist/sorts/strings.js +1 -1
- package/dist/spinner/default.js +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/ssri/convert.js +2 -2
- package/dist/ssri/parse.js +1 -1
- package/dist/ssri/validate.js +2 -2
- package/dist/stdio/prompts.js +1 -1
- package/dist/streams/parallel.js +2 -2
- package/dist/streams/transform.js +1 -1
- package/dist/strings/format.js +4 -4
- package/dist/strings/predicates.js +2 -2
- package/dist/strings/search.js +1 -1
- package/dist/strings/transform.js +3 -3
- package/dist/strings/width.js +3 -3
- package/dist/temporal/instant.js +4 -2
- package/dist/temporal/slots.js +3 -2
- package/dist/themes/context.js +2 -2
- package/dist/url/parse.js +2 -2
- package/dist/url/predicates.js +1 -1
- package/dist/url/search-params.js +6 -6
- package/dist/words/article.js +1 -1
- package/dist/words/capitalize.js +1 -1
- package/dist/words/pluralize.d.ts +24 -2
- package/dist/words/pluralize.js +37 -2
- package/dist/words/types.d.ts +25 -2
- package/package.json +45 -5
package/dist/paths/conversion.js
CHANGED
|
@@ -34,7 +34,7 @@ const require_paths_normalize = require('./normalize.js');
|
|
|
34
34
|
*
|
|
35
35
|
* @returns {string} Native Windows path or normalized Unix path
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
38
38
|
function fromUnixPath(pathLike) {
|
|
39
39
|
const normalized = /* @__PURE__ */ require_paths_normalize.normalizePath(pathLike);
|
|
40
40
|
/* c8 ignore start */
|
|
@@ -59,7 +59,7 @@ function fromUnixPath(pathLike) {
|
|
|
59
59
|
*
|
|
60
60
|
* @returns {string[]} Array of path segments, or empty array for empty paths
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
63
63
|
function splitPath(pathLike) {
|
|
64
64
|
const filepath = /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike);
|
|
65
65
|
if (filepath === "") return [];
|
|
@@ -83,7 +83,7 @@ function splitPath(pathLike) {
|
|
|
83
83
|
*
|
|
84
84
|
* @returns {string} Unix-style POSIX path
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
87
87
|
function toUnixPath(pathLike) {
|
|
88
88
|
const normalized = /* @__PURE__ */ require_paths_normalize.normalizePath(pathLike);
|
|
89
89
|
/* c8 ignore start */
|
|
@@ -107,7 +107,7 @@ function toUnixPath(pathLike) {
|
|
|
107
107
|
*
|
|
108
108
|
* @returns {string} The path without leading `./` / `.\`, or unchanged
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
111
111
|
function trimLeadingDotSlash(pathLike) {
|
|
112
112
|
const filepath = /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike);
|
|
113
113
|
if (require_primordials_string.StringPrototypeStartsWith(filepath, "./") || require_primordials_string.StringPrototypeStartsWith(filepath, ".\\")) return filepath.slice(2);
|
package/dist/paths/normalize.js
CHANGED
|
@@ -20,6 +20,7 @@ const require_paths_resolve = require('./resolve.js');
|
|
|
20
20
|
* namespace preservation
|
|
21
21
|
* - `msysDriveToNative` — `/c/path` → `C:/path` on Windows
|
|
22
22
|
*/
|
|
23
|
+
const DRIVE_LETTER_REGEXP = /^[A-Za-z]:$/;
|
|
23
24
|
function msysDriveToNative(normalized) {
|
|
24
25
|
/* c8 ignore start - Windows-only branch. */
|
|
25
26
|
if (require_constants_platform.WIN32) return normalized.replace(require_paths__internal.msysDriveRegExp, (_, letter, sep) => `${letter.toUpperCase()}:${sep || "/"}`);
|
|
@@ -58,7 +59,7 @@ function msysDriveToNative(normalized) {
|
|
|
58
59
|
* (HTTP requests, file uploads, URL parameters), you MUST validate for path traversal
|
|
59
60
|
* attacks BEFORE calling this function.
|
|
60
61
|
*/
|
|
61
|
-
|
|
62
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
62
63
|
function normalizePath(pathLike) {
|
|
63
64
|
const filepath = /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike);
|
|
64
65
|
const { length } = filepath;
|
|
@@ -196,6 +197,7 @@ function normalizePath(pathLike) {
|
|
|
196
197
|
}
|
|
197
198
|
/* c8 ignore stop */
|
|
198
199
|
if (collapsed.length === 0) return prefix || ".";
|
|
200
|
+
if (DRIVE_LETTER_REGEXP.test(collapsed) && (require_primordials_string.StringPrototypeCharCodeAt(filepath, 2) === 47 || require_primordials_string.StringPrototypeCharCodeAt(filepath, 2) === 92)) return msysDriveToNative(`${prefix}${collapsed}/`);
|
|
199
201
|
return msysDriveToNative(prefix + collapsed);
|
|
200
202
|
}
|
|
201
203
|
|
package/dist/paths/packages.js
CHANGED
|
@@ -14,14 +14,14 @@ const require_node_path = require('../node/path.js');
|
|
|
14
14
|
* POSIX and Windows-style separators so paths captured on either platform
|
|
15
15
|
* classify the same regardless of the host we're running on.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
18
18
|
function isPackageJsonFile(filepath) {
|
|
19
19
|
return filepath === "package.json" || require_primordials_string.StringPrototypeEndsWith(filepath, "/package.json") || require_primordials_string.StringPrototypeEndsWith(filepath, "\\package.json");
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Resolve directory path from a package.json file path.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
25
25
|
function resolvePackageJsonDirname(filepath) {
|
|
26
26
|
if (/* @__PURE__ */ isPackageJsonFile(filepath)) return /* @__PURE__ */ require_paths_normalize.normalizePath((/* @__PURE__ */ require_node_path.getNodePath()).dirname(filepath));
|
|
27
27
|
return /* @__PURE__ */ require_paths_normalize.normalizePath(filepath);
|
|
@@ -29,7 +29,7 @@ function resolvePackageJsonDirname(filepath) {
|
|
|
29
29
|
/**
|
|
30
30
|
* Resolve full path to package.json from a directory or file path.
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
33
33
|
function resolvePackageJsonPath(filepath) {
|
|
34
34
|
if (/* @__PURE__ */ isPackageJsonFile(filepath)) return /* @__PURE__ */ require_paths_normalize.normalizePath(filepath);
|
|
35
35
|
return /* @__PURE__ */ require_paths_normalize.normalizePath((/* @__PURE__ */ require_node_path.getNodePath()).join(filepath, "package.json"));
|
package/dist/paths/predicates.js
CHANGED
|
@@ -34,7 +34,7 @@ const require_primordials_regexp = require('../primordials/regexp.js');
|
|
|
34
34
|
*
|
|
35
35
|
* @returns {boolean} `true` if absolute, `false` otherwise
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
38
38
|
function isAbsolute(pathLike) {
|
|
39
39
|
const filepath = /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike);
|
|
40
40
|
const { length } = filepath;
|
|
@@ -64,7 +64,7 @@ function isAbsolute(pathLike) {
|
|
|
64
64
|
*
|
|
65
65
|
* @returns {boolean} `true` if the path contains `node_modules`
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
68
68
|
function isNodeModules(pathLike) {
|
|
69
69
|
return require_primordials_regexp.RegExpPrototypeTest(require_paths__internal.nodeModulesPathRegExp, /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike));
|
|
70
70
|
}
|
|
@@ -87,7 +87,7 @@ function isNodeModules(pathLike) {
|
|
|
87
87
|
*
|
|
88
88
|
* @returns {boolean} `true` if the value is a valid file path
|
|
89
89
|
*/
|
|
90
|
-
|
|
90
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
91
91
|
function isPath(pathLike) {
|
|
92
92
|
const filepath = /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike);
|
|
93
93
|
if (typeof filepath !== "string" || filepath.length === 0) return false;
|
|
@@ -117,7 +117,7 @@ function isPath(pathLike) {
|
|
|
117
117
|
*
|
|
118
118
|
* @returns {boolean} `true` if separator
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
121
121
|
function isPathSeparator(code) {
|
|
122
122
|
return code === 47 || code === 92;
|
|
123
123
|
}
|
|
@@ -137,7 +137,7 @@ function isPathSeparator(code) {
|
|
|
137
137
|
*
|
|
138
138
|
* @returns {boolean} `true` if the path is relative
|
|
139
139
|
*/
|
|
140
|
-
|
|
140
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
141
141
|
function isRelative(pathLike) {
|
|
142
142
|
const filepath = /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike);
|
|
143
143
|
/* c8 ignore start */
|
|
@@ -163,7 +163,7 @@ function isRelative(pathLike) {
|
|
|
163
163
|
*
|
|
164
164
|
* @returns {boolean} `true` if the path uses MSYS drive letter notation
|
|
165
165
|
*/
|
|
166
|
-
|
|
166
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
167
167
|
function isUnixPath(pathLike) {
|
|
168
168
|
const filepath = /* @__PURE__ */ require_paths__internal.pathLikeToString(pathLike);
|
|
169
169
|
return typeof filepath === "string" && require_primordials_regexp.RegExpPrototypeTest(require_paths__internal.msysDriveRegExp, filepath);
|
|
@@ -183,7 +183,7 @@ function isUnixPath(pathLike) {
|
|
|
183
183
|
* @returns {boolean} `true` if valid drive-letter code
|
|
184
184
|
*/
|
|
185
185
|
/* c8 ignore start - Only called from Windows-only branches. */
|
|
186
|
-
|
|
186
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
187
187
|
function isWindowsDeviceRoot(code) {
|
|
188
188
|
return code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
189
189
|
}
|
package/dist/paths/resolve.js
CHANGED
|
@@ -38,7 +38,7 @@ const require_paths_normalize = require('./normalize.js');
|
|
|
38
38
|
*
|
|
39
39
|
* @returns {string} Relative path from `from` to `to`, or empty string if equal
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
42
42
|
function relative(from, to) {
|
|
43
43
|
if (from === to) return "";
|
|
44
44
|
const actualFrom = /* @__PURE__ */ resolve(from);
|
|
@@ -106,7 +106,7 @@ function relative(from, to) {
|
|
|
106
106
|
*
|
|
107
107
|
* @returns {string} Normalized relative path, or empty string if equal
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
110
110
|
function relativeResolve(from, to) {
|
|
111
111
|
const rel = /* @__PURE__ */ relative(from, to);
|
|
112
112
|
if (rel === "") return "";
|
|
@@ -131,7 +131,7 @@ function relativeResolve(from, to) {
|
|
|
131
131
|
*
|
|
132
132
|
* @returns {string} The resolved absolute path
|
|
133
133
|
*/
|
|
134
|
-
|
|
134
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
135
135
|
function resolve(...segments) {
|
|
136
136
|
let resolvedPath = "";
|
|
137
137
|
let resolvedAbsolute = false;
|
|
@@ -20,9 +20,9 @@ let _npmCliPromiseSpawn;
|
|
|
20
20
|
* issues. Required because the upstream module uses CJS dynamic-require
|
|
21
21
|
* patterns that Webpack flags.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
24
24
|
function getNpmCliPromiseSpawn() {
|
|
25
|
-
if (_npmCliPromiseSpawn === void 0) _npmCliPromiseSpawn =
|
|
25
|
+
if (_npmCliPromiseSpawn === void 0) _npmCliPromiseSpawn = /*@__PURE__*/ require("../../external/@npmcli/promise-spawn");
|
|
26
26
|
return _npmCliPromiseSpawn;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
@@ -33,7 +33,7 @@ function getNpmCliPromiseSpawn() {
|
|
|
33
33
|
*
|
|
34
34
|
* @returns {unknown} The modified result object
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
37
37
|
function stripAnsiFromSpawnResult(result) {
|
|
38
38
|
const res = result;
|
|
39
39
|
const { stderr, stdout } = res;
|
|
@@ -34,7 +34,7 @@ let src_external_pony_cause = require("../../external/pony-cause");
|
|
|
34
34
|
* }
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
38
38
|
function enhanceSpawnError(error) {
|
|
39
39
|
if (error === null || typeof error !== "object") return error;
|
|
40
40
|
if (!/* @__PURE__ */ isSpawnError(error)) return error;
|
|
@@ -109,7 +109,7 @@ function enhanceSpawnError(error) {
|
|
|
109
109
|
*
|
|
110
110
|
* @returns {boolean} `true` if the value has spawn error properties
|
|
111
111
|
*/
|
|
112
|
-
|
|
112
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
113
113
|
function isSpawnError(value) {
|
|
114
114
|
if (value === null || typeof value !== "object") return false;
|
|
115
115
|
const err = value;
|
|
@@ -39,7 +39,7 @@ const require_arrays_predicates = require('../../arrays/predicates.js');
|
|
|
39
39
|
*
|
|
40
40
|
* @returns {boolean} `true` if stdio matches the type or is valid
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
43
43
|
function isStdioType(stdio, type) {
|
|
44
44
|
if (arguments.length === 1) return typeof stdio === "string" && [
|
|
45
45
|
"pipe",
|
package/dist/promises/iterate.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_promise = require('../primordials/promise.js');
|
|
4
5
|
const require_promises_options = require('./options.js');
|
|
5
6
|
const require_promises_retry = require('./retry.js');
|
|
6
|
-
const require_primordials_promise = require('../primordials/promise.js');
|
|
7
7
|
const require_arrays_chunk = require('../arrays/chunk.js');
|
|
8
8
|
|
|
9
9
|
//#region src/promises/iterate.ts
|
|
@@ -67,7 +67,7 @@ const require_arrays_chunk = require('../arrays/chunk.js');
|
|
|
67
67
|
*
|
|
68
68
|
* @returns Promise that resolves when all items are processed
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
71
71
|
async function pEach(array, callbackFn, options) {
|
|
72
72
|
const { concurrency, retries, signal } = /* @__PURE__ */ require_promises_options.normalizeIterationOptions(options);
|
|
73
73
|
const chunks = /* @__PURE__ */ require_arrays_chunk.arrayChunk(array, concurrency);
|
|
@@ -133,7 +133,7 @@ async function pEach(array, callbackFn, options) {
|
|
|
133
133
|
*
|
|
134
134
|
* @returns Promise that resolves when all chunks are processed
|
|
135
135
|
*/
|
|
136
|
-
|
|
136
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
137
137
|
async function pEachChunk(array, callbackFn, options) {
|
|
138
138
|
const { chunkSize = 100, ...retryOpts } = options || {};
|
|
139
139
|
const chunks = /* @__PURE__ */ require_arrays_chunk.arrayChunk(array, chunkSize);
|
|
@@ -194,7 +194,7 @@ async function pEachChunk(array, callbackFn, options) {
|
|
|
194
194
|
*
|
|
195
195
|
* @returns Promise resolving to filtered array
|
|
196
196
|
*/
|
|
197
|
-
|
|
197
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
198
198
|
async function pFilter(array, callbackFn, options) {
|
|
199
199
|
const iterOpts = /* @__PURE__ */ require_promises_options.normalizeIterationOptions(options);
|
|
200
200
|
return (await /* @__PURE__ */ pFilterChunk(/* @__PURE__ */ require_arrays_chunk.arrayChunk(array, iterOpts.concurrency), callbackFn, iterOpts.retries)).flat();
|
|
@@ -222,7 +222,7 @@ async function pFilter(array, callbackFn, options) {
|
|
|
222
222
|
*
|
|
223
223
|
* @returns Promise resolving to array of filtered chunks
|
|
224
224
|
*/
|
|
225
|
-
|
|
225
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
226
226
|
async function pFilterChunk(chunks, callbackFn, options) {
|
|
227
227
|
const retryOpts = /* @__PURE__ */ require_promises_options.normalizeRetryOptions(options);
|
|
228
228
|
const { signal } = retryOpts;
|
package/dist/promises/options.js
CHANGED
|
@@ -33,7 +33,7 @@ const require_promises__internal = require('./_internal.js');
|
|
|
33
33
|
*
|
|
34
34
|
* @returns Normalized options with concurrency, retries, and signal
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
37
37
|
function normalizeIterationOptions(options) {
|
|
38
38
|
const { concurrency = 1, retries, signal = require_promises__internal.abortSignal } = {
|
|
39
39
|
__proto__: null,
|
|
@@ -70,7 +70,7 @@ function normalizeIterationOptions(options) {
|
|
|
70
70
|
*
|
|
71
71
|
* @returns Normalized retry options with all properties set
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
74
74
|
function normalizeRetryOptions(options) {
|
|
75
75
|
const { args = [], backoffFactor = 2, baseDelayMs = 200, jitter = true, maxDelayMs = 1e4, onRetry, onRetryCancelOnFalse = false, onRetryRethrow = false, retries = 0, signal = require_promises__internal.abortSignal } = /* @__PURE__ */ resolveRetryOptions(options);
|
|
76
76
|
return {
|
|
@@ -105,7 +105,7 @@ function normalizeRetryOptions(options) {
|
|
|
105
105
|
*
|
|
106
106
|
* @returns Resolved retry options with defaults for basic properties
|
|
107
107
|
*/
|
|
108
|
-
|
|
108
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
109
109
|
function resolveRetryOptions(options) {
|
|
110
110
|
const defaults = {
|
|
111
111
|
__proto__: null,
|
package/dist/promises/retry.js
CHANGED
|
@@ -110,7 +110,7 @@ const require_promises_options = require('./options.js');
|
|
|
110
110
|
*
|
|
111
111
|
* @throws {Error} The last error if all retry attempts fail
|
|
112
112
|
*/
|
|
113
|
-
|
|
113
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
114
114
|
async function pRetry(callbackFn, options) {
|
|
115
115
|
const { args, backoffFactor, baseDelayMs, jitter, maxDelayMs, onRetry, onRetryCancelOnFalse, onRetryRethrow, retries, signal } = /* @__PURE__ */ require_promises_options.normalizeRetryOptions(options);
|
|
116
116
|
if (signal?.aborted) return;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
4
5
|
|
|
5
6
|
//#region src/secrets/_internal.ts
|
|
6
7
|
/**
|
|
@@ -29,8 +30,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
29
30
|
* undefined (entry missing), `undefined` is cached too — callers that want a
|
|
30
31
|
* re-check after creating the entry must call `invalidate`.
|
|
31
32
|
*/
|
|
32
|
-
const valueCache =
|
|
33
|
-
const inflight =
|
|
33
|
+
const valueCache = new require_primordials_map_set.MapCtor();
|
|
34
|
+
const inflight = new require_primordials_map_set.MapCtor();
|
|
34
35
|
function cacheKey(service, account) {
|
|
35
36
|
return `${service} ${account}`;
|
|
36
37
|
}
|
package/dist/secrets/keychain.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_error = require('../primordials/error.js');
|
|
4
5
|
const require_secrets__internal = require('./_internal.js');
|
|
5
6
|
const require_secrets_macos = require('./macos.js');
|
|
6
7
|
const require_secrets_linux = require('./linux.js');
|
|
@@ -228,9 +229,9 @@ function readSecretSync({ service, account }) {
|
|
|
228
229
|
* shouldn't show "rewrote N secrets" when nothing actually changed).
|
|
229
230
|
*/
|
|
230
231
|
async function writeSecret({ service, account, value, label }) {
|
|
231
|
-
if (!value || typeof value !== "string") throw new
|
|
232
|
+
if (!value || typeof value !== "string") throw new require_primordials_error.TypeErrorCtor("writeSecret: value must be a non-empty string");
|
|
232
233
|
const platform_ = detectPlatform();
|
|
233
|
-
if (platform_ === "other") throw new
|
|
234
|
+
if (platform_ === "other") throw new require_primordials_error.ErrorCtor(`Unsupported platform: ${(0, node_os.platform)()}. Secret storage requires macOS, Linux, or Windows.`);
|
|
234
235
|
if (await readSecret({
|
|
235
236
|
service,
|
|
236
237
|
account
|
|
@@ -251,9 +252,9 @@ async function writeSecret({ service, account, value, label }) {
|
|
|
251
252
|
return "written";
|
|
252
253
|
}
|
|
253
254
|
function writeSecretSync({ service, account, value, label }) {
|
|
254
|
-
if (!value || typeof value !== "string") throw new
|
|
255
|
+
if (!value || typeof value !== "string") throw new require_primordials_error.TypeErrorCtor("writeSecret: value must be a non-empty string");
|
|
255
256
|
const platform_ = detectPlatform();
|
|
256
|
-
if (platform_ === "other") throw new
|
|
257
|
+
if (platform_ === "other") throw new require_primordials_error.ErrorCtor(`Unsupported platform: ${(0, node_os.platform)()}. Secret storage requires macOS, Linux, or Windows.`);
|
|
257
258
|
if (readSecretSync({
|
|
258
259
|
service,
|
|
259
260
|
account
|
package/dist/secrets/linux.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
+
const require_primordials_promise = require('../primordials/promise.js');
|
|
4
6
|
let node_child_process = require("node:child_process");
|
|
5
7
|
|
|
6
8
|
//#region src/secrets/linux.ts
|
|
@@ -19,7 +21,7 @@ let node_child_process = require("node:child_process");
|
|
|
19
21
|
*/
|
|
20
22
|
const SECRET_TOOL_BIN = "secret-tool";
|
|
21
23
|
async function deleteLinux(service, account) {
|
|
22
|
-
return new
|
|
24
|
+
return new require_primordials_promise.PromiseCtor((resolve) => {
|
|
23
25
|
const child = (0, node_child_process.spawn)(SECRET_TOOL_BIN, [
|
|
24
26
|
"clear",
|
|
25
27
|
"service",
|
|
@@ -44,7 +46,7 @@ function isLinuxBackendAvailable() {
|
|
|
44
46
|
return (0, node_child_process.spawnSync)(SECRET_TOOL_BIN, ["--version"], { stdio: "ignore" }).status === 0;
|
|
45
47
|
}
|
|
46
48
|
async function readLinux(service, account) {
|
|
47
|
-
return new
|
|
49
|
+
return new require_primordials_promise.PromiseCtor((resolve) => {
|
|
48
50
|
const child = (0, node_child_process.spawn)(SECRET_TOOL_BIN, [
|
|
49
51
|
"lookup",
|
|
50
52
|
"service",
|
|
@@ -90,7 +92,7 @@ function readLinuxSync(service, account) {
|
|
|
90
92
|
return r.stdout.trim() || void 0;
|
|
91
93
|
}
|
|
92
94
|
async function writeLinux(service, account, value, label) {
|
|
93
|
-
return new
|
|
95
|
+
return new require_primordials_promise.PromiseCtor((resolve, reject) => {
|
|
94
96
|
const child = (0, node_child_process.spawn)(SECRET_TOOL_BIN, [
|
|
95
97
|
"store",
|
|
96
98
|
`--label=${label}`,
|
|
@@ -136,7 +138,7 @@ function writeLinuxSync(service, account, value, label) {
|
|
|
136
138
|
"pipe"
|
|
137
139
|
]
|
|
138
140
|
});
|
|
139
|
-
if (r.status !== 0) throw new
|
|
141
|
+
if (r.status !== 0) throw new require_primordials_error.ErrorCtor(`secret-tool store failed (status=${r.status}, user=${account}): ${r.stderr.trim()}. Install libsecret-tools (apt install libsecret-tools / dnf install libsecret) or ensure a Secret Service provider (gnome-keyring, kwallet) is running.`);
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
//#endregion
|
package/dist/secrets/macos.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
+
const require_primordials_promise = require('../primordials/promise.js');
|
|
4
6
|
let node_child_process = require("node:child_process");
|
|
5
7
|
|
|
6
8
|
//#region src/secrets/macos.ts
|
|
@@ -78,7 +80,7 @@ function readMacOSSync(service, account) {
|
|
|
78
80
|
return r.stdout.trim() || void 0;
|
|
79
81
|
}
|
|
80
82
|
function runAsync(args, opts = {}) {
|
|
81
|
-
return new
|
|
83
|
+
return new require_primordials_promise.PromiseCtor((resolve) => {
|
|
82
84
|
const child = (0, node_child_process.spawn)(SECURITY_BIN, args, { stdio: opts.stdio ?? [
|
|
83
85
|
"ignore",
|
|
84
86
|
"pipe",
|
|
@@ -128,7 +130,7 @@ async function writeMacOS(service, account, value, label) {
|
|
|
128
130
|
"-l",
|
|
129
131
|
label
|
|
130
132
|
]);
|
|
131
|
-
if (r.status !== 0) throw new
|
|
133
|
+
if (r.status !== 0) throw new require_primordials_error.ErrorCtor(`security(1) add-generic-password failed (status=${r.status}, account=${account}): ${r.stderr.trim()}`);
|
|
132
134
|
}
|
|
133
135
|
function writeMacOSSync(service, account, value, label) {
|
|
134
136
|
const r = (0, node_child_process.spawnSync)(SECURITY_BIN, [
|
|
@@ -155,7 +157,7 @@ function writeMacOSSync(service, account, value, label) {
|
|
|
155
157
|
"pipe"
|
|
156
158
|
]
|
|
157
159
|
});
|
|
158
|
-
if (r.status !== 0) throw new
|
|
160
|
+
if (r.status !== 0) throw new require_primordials_error.ErrorCtor(`security(1) add-generic-password failed (status=${r.status}, account=${account}): ${r.stderr.trim()}`);
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
//#endregion
|
package/dist/secrets/rc.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
6
|
+
const require_primordials_regexp = require('../primordials/regexp.js');
|
|
7
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
5
8
|
const require_env_home = require('../env/home.js');
|
|
6
9
|
let node_fs = require("node:fs");
|
|
7
10
|
let node_path = require("node:path");
|
|
@@ -54,7 +57,7 @@ function buildBlock(opts) {
|
|
|
54
57
|
const begin = `# BEGIN ${opts.service} env (managed)`;
|
|
55
58
|
const end = `# END ${opts.service} env (managed)`;
|
|
56
59
|
const noteLines = (opts.notes ?? []).map((line) => `# ${line}`);
|
|
57
|
-
const exportLines =
|
|
60
|
+
const exportLines = require_primordials_object.ObjectEntries(opts.exports).map(([name, value]) => `export ${name}=${shellSingleQuote(value)}`);
|
|
58
61
|
const body = [...noteLines, ...exportLines].join("\n");
|
|
59
62
|
return {
|
|
60
63
|
begin,
|
|
@@ -79,7 +82,7 @@ function clear(service, legacySentinels = []) {
|
|
|
79
82
|
const end = begin.replace(/\bBEGIN\b/, "END");
|
|
80
83
|
const endStripped = end.replace(/\s*\(managed\)\s*$/, "");
|
|
81
84
|
const endAlt = end === endStripped ? escapeRegExp(end) : `(?:${escapeRegExp(end)}|${escapeRegExp(endStripped)})`;
|
|
82
|
-
const re = new
|
|
85
|
+
const re = new require_primordials_regexp.RegExpCtor(`\n*${escapeRegExp(begin)}[\\s\\S]*?${endAlt}\n?`, "g");
|
|
83
86
|
const next = existing.replace(re, "\n");
|
|
84
87
|
if (next !== existing) {
|
|
85
88
|
removedAny = true;
|
|
@@ -96,7 +99,7 @@ function pickRcFile(shellOverride) {
|
|
|
96
99
|
const home = /* @__PURE__ */ require_env_home.getHome();
|
|
97
100
|
if (!home) return;
|
|
98
101
|
const shellPath = node_process.default.env["SHELL"] ?? "";
|
|
99
|
-
const shell = shellOverride ?? (
|
|
102
|
+
const shell = shellOverride ?? (require_primordials_string.StringPrototypeEndsWith(shellPath, "zsh") ? "zsh" : require_primordials_string.StringPrototypeEndsWith(shellPath, "bash") ? "bash" : require_primordials_string.StringPrototypeEndsWith(shellPath, "fish") ? "fish" : void 0);
|
|
100
103
|
if (shell === "zsh") return node_path.default.join(home, ".zshenv");
|
|
101
104
|
if (shell === "bash") {
|
|
102
105
|
const bashrc = node_path.default.join(home, ".bashrc");
|
|
@@ -149,10 +152,10 @@ function write(opts) {
|
|
|
149
152
|
const legacyEnd = legacyBegin.replace(/\bBEGIN\b/, "END");
|
|
150
153
|
const legacyEndStripped = legacyEnd.replace(/\s*\(managed\)\s*$/, "");
|
|
151
154
|
const endAlt = legacyEnd === legacyEndStripped ? escapeRegExp(legacyEnd) : `(?:${escapeRegExp(legacyEnd)}|${escapeRegExp(legacyEndStripped)})`;
|
|
152
|
-
const legacyRe = new
|
|
155
|
+
const legacyRe = new require_primordials_regexp.RegExpCtor(`\n*${escapeRegExp(legacyBegin)}[\\s\\S]*?${endAlt}\n?`, "g");
|
|
153
156
|
working = working.replace(legacyRe, "\n");
|
|
154
157
|
}
|
|
155
|
-
const match = new
|
|
158
|
+
const match = new require_primordials_regexp.RegExpCtor(`${escapeRegExp(begin)}[\\s\\S]*?${escapeRegExp(end)}`).exec(working);
|
|
156
159
|
if (match) {
|
|
157
160
|
if (match[0] === desiredBlock && working === onDisk) return {
|
|
158
161
|
rcPath,
|
|
@@ -164,7 +167,7 @@ function write(opts) {
|
|
|
164
167
|
outcome: "updated"
|
|
165
168
|
};
|
|
166
169
|
}
|
|
167
|
-
const prefix = working.length > 0 && !
|
|
170
|
+
const prefix = working.length > 0 && !require_primordials_string.StringPrototypeEndsWith(working, "\n\n") ? require_primordials_string.StringPrototypeEndsWith(working, "\n") ? "\n" : "\n\n" : "";
|
|
168
171
|
writeRcFile(rcPath, `${working}${prefix}${desiredBlock}\n`.replace(/\n{3,}/g, "\n\n"));
|
|
169
172
|
return {
|
|
170
173
|
rcPath,
|
package/dist/secrets/windows.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
+
const require_primordials_json = require('../primordials/json.js');
|
|
7
|
+
const require_primordials_promise = require('../primordials/promise.js');
|
|
5
8
|
let node_fs = require("node:fs");
|
|
6
9
|
let node_path = require("node:path");
|
|
7
10
|
node_path = require_runtime.__toESM(node_path);
|
|
@@ -125,7 +128,7 @@ function readWindowsSync(service, account) {
|
|
|
125
128
|
return readDpapiSync(getDpapiFilePath(service, account));
|
|
126
129
|
}
|
|
127
130
|
function runPsAsync(script, input) {
|
|
128
|
-
return new
|
|
131
|
+
return new require_primordials_promise.PromiseCtor((resolve) => {
|
|
129
132
|
const child = (0, node_child_process.spawn)(POWERSHELL_BIN, [
|
|
130
133
|
"-NoProfile",
|
|
131
134
|
"-Command",
|
|
@@ -189,7 +192,7 @@ function runPsSync(script, input) {
|
|
|
189
192
|
* identifiers (e.g. `socket-cli`, `SOCKET_API_KEY`), not paths.
|
|
190
193
|
*/
|
|
191
194
|
function validateKeychainComponent(value, name) {
|
|
192
|
-
if (/[\\/]/.test(value) || value.includes("..") || value.includes("\0") || value === "" || value === ".") throw new
|
|
195
|
+
if (/[\\/]/.test(value) || value.includes("..") || value.includes("\0") || value === "" || value === ".") throw new require_primordials_error.ErrorCtor(`secrets/windows: ${name} contains path-traversal characters: ${require_primordials_json.JSONStringify(value)}. Use a plain identifier (no \\\\, /, .., or NUL).`);
|
|
193
196
|
}
|
|
194
197
|
async function writeDpapi(filePath, value) {
|
|
195
198
|
const dir = node_path.default.dirname(filePath);
|
|
@@ -201,7 +204,7 @@ async function writeDpapi(filePath, value) {
|
|
|
201
204
|
$protected = [System.Security.Cryptography.ProtectedData]::Protect($bytes, $null, 'CurrentUser')
|
|
202
205
|
[Convert]::ToBase64String($protected) | Set-Content -Path ${quotePs(filePath)} -NoNewline
|
|
203
206
|
`, value);
|
|
204
|
-
if (r.status !== 0) throw new
|
|
207
|
+
if (r.status !== 0) throw new require_primordials_error.ErrorCtor(`DPAPI file write failed: ${r.stderr.trim()}. Install the CredentialManager PowerShell module (\`Install-Module CredentialManager -Scope CurrentUser\`) for a cleaner storage path.`);
|
|
205
208
|
}
|
|
206
209
|
function writeDpapiSync(filePath, value) {
|
|
207
210
|
const dir = node_path.default.dirname(filePath);
|
|
@@ -213,7 +216,7 @@ function writeDpapiSync(filePath, value) {
|
|
|
213
216
|
$protected = [System.Security.Cryptography.ProtectedData]::Protect($bytes, $null, 'CurrentUser')
|
|
214
217
|
[Convert]::ToBase64String($protected) | Set-Content -Path ${quotePs(filePath)} -NoNewline
|
|
215
218
|
`, value);
|
|
216
|
-
if (r.status !== 0) throw new
|
|
219
|
+
if (r.status !== 0) throw new require_primordials_error.ErrorCtor(`DPAPI file write failed: ${r.stderr.trim()}. Install the CredentialManager PowerShell module (\`Install-Module CredentialManager -Scope CurrentUser\`) for a cleaner storage path.`);
|
|
217
220
|
}
|
|
218
221
|
async function writeWindows(service, account, value, _label) {
|
|
219
222
|
if ((await runPsAsync(`
|