@keynv/cli 0.1.0-rc.23 → 0.1.0-rc.25
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/dist/index.js +196 -154
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import * as nodePath from 'path';
|
|
4
|
-
import { relative, join, isAbsolute, resolve,
|
|
4
|
+
import { relative, join, isAbsolute, resolve, dirname, sep, basename } from 'path';
|
|
5
5
|
import { createHash } from 'crypto';
|
|
6
6
|
import { readFileSync, existsSync, writeFileSync, statSync, realpathSync, readdirSync, renameSync, mkdirSync, rmSync, constants as constants$1, lstatSync } from 'fs';
|
|
7
7
|
import { homedir, hostname, platform } from 'os';
|
|
@@ -1070,7 +1070,7 @@ var require_lib = __commonJS({
|
|
|
1070
1070
|
var VERSION, AGENT;
|
|
1071
1071
|
var init_version = __esm({
|
|
1072
1072
|
"src/version.ts"() {
|
|
1073
|
-
VERSION = "0.1.0-rc.
|
|
1073
|
+
VERSION = "0.1.0-rc.25" ;
|
|
1074
1074
|
AGENT = `keynv-cli/${VERSION}`;
|
|
1075
1075
|
}
|
|
1076
1076
|
});
|
|
@@ -1156,7 +1156,7 @@ function findAliasesInArgv(argv2) {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
return result;
|
|
1158
1158
|
}
|
|
1159
|
-
function replaceAliases(text,
|
|
1159
|
+
function replaceAliases(text, resolve6, opts = {}) {
|
|
1160
1160
|
if (typeof text !== "string" || text.length === 0)
|
|
1161
1161
|
return text;
|
|
1162
1162
|
const matches = findAliases(text, opts);
|
|
@@ -1167,7 +1167,7 @@ function replaceAliases(text, resolve4, opts = {}) {
|
|
|
1167
1167
|
const m = matches[i];
|
|
1168
1168
|
if (!m)
|
|
1169
1169
|
continue;
|
|
1170
|
-
const replacement =
|
|
1170
|
+
const replacement = resolve6(m);
|
|
1171
1171
|
if (parseAlias(replacement) !== null) {
|
|
1172
1172
|
throw new Error(`replaceAliases: resolved value for ${m.literal} is itself a valid alias (${replacement}). Circular or misconfigured resolution detected.`);
|
|
1173
1173
|
}
|
|
@@ -6223,12 +6223,12 @@ async function startRpcServer(registry) {
|
|
|
6223
6223
|
socket.on("error", () => {
|
|
6224
6224
|
});
|
|
6225
6225
|
});
|
|
6226
|
-
return new Promise((
|
|
6226
|
+
return new Promise((resolve6, reject) => {
|
|
6227
6227
|
server.once("error", reject);
|
|
6228
6228
|
server.listen(path, () => {
|
|
6229
6229
|
void chmodIfExists(path, 384).catch(() => {
|
|
6230
6230
|
});
|
|
6231
|
-
|
|
6231
|
+
resolve6({
|
|
6232
6232
|
socketPath: path,
|
|
6233
6233
|
close: () => new Promise((res) => {
|
|
6234
6234
|
server.close(() => res());
|
|
@@ -6290,7 +6290,7 @@ function handleLine(line, socket, registry) {
|
|
|
6290
6290
|
async function registerValueWithWatcher(value, timeoutMs = 200) {
|
|
6291
6291
|
if (value.length === 0) return null;
|
|
6292
6292
|
const path = socketPath();
|
|
6293
|
-
return new Promise((
|
|
6293
|
+
return new Promise((resolve6) => {
|
|
6294
6294
|
const socket = createConnection(path);
|
|
6295
6295
|
let buffer = "";
|
|
6296
6296
|
let settled = false;
|
|
@@ -6298,7 +6298,7 @@ async function registerValueWithWatcher(value, timeoutMs = 200) {
|
|
|
6298
6298
|
if (settled) return;
|
|
6299
6299
|
settled = true;
|
|
6300
6300
|
socket.destroy();
|
|
6301
|
-
|
|
6301
|
+
resolve6(result);
|
|
6302
6302
|
};
|
|
6303
6303
|
const timer = setTimeout(() => settle(null), timeoutMs);
|
|
6304
6304
|
socket.once("error", () => {
|
|
@@ -6626,20 +6626,30 @@ var init_collision = __esm({
|
|
|
6626
6626
|
KEY_RE3 = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;
|
|
6627
6627
|
}
|
|
6628
6628
|
});
|
|
6629
|
-
function findProjectRoot(startDir) {
|
|
6630
|
-
const
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
if (
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
}
|
|
6641
|
-
|
|
6642
|
-
|
|
6629
|
+
function findProjectRoot(startDir, boundaryDir = homedir()) {
|
|
6630
|
+
const start = resolve(startDir);
|
|
6631
|
+
const boundary = resolve(boundaryDir);
|
|
6632
|
+
let dir = start;
|
|
6633
|
+
for (let i = 0; i < 64; i++) {
|
|
6634
|
+
if (dir === boundary || isAncestorOf(dir, boundary)) break;
|
|
6635
|
+
const marker = markerAt(dir);
|
|
6636
|
+
if (marker) return buildRoot(dir, marker);
|
|
6637
|
+
const parent = dirname(dir);
|
|
6638
|
+
if (parent === dir) break;
|
|
6639
|
+
dir = parent;
|
|
6640
|
+
}
|
|
6641
|
+
return buildRoot(start, "current directory");
|
|
6642
|
+
}
|
|
6643
|
+
function markerAt(dir) {
|
|
6644
|
+
for (const marker of PROJECT_MARKERS) {
|
|
6645
|
+
if (existsSync(join(dir, marker))) return marker;
|
|
6646
|
+
}
|
|
6647
|
+
if (existsSync(join(dir, GIT_MARKER))) return GIT_MARKER;
|
|
6648
|
+
return null;
|
|
6649
|
+
}
|
|
6650
|
+
function isAncestorOf(ancestor, descendant) {
|
|
6651
|
+
const rel = relative(resolve(ancestor), resolve(descendant));
|
|
6652
|
+
return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
|
|
6643
6653
|
}
|
|
6644
6654
|
function buildRoot(dir, marker) {
|
|
6645
6655
|
let suggestedName = basename(dir);
|
|
@@ -6671,6 +6681,7 @@ function buildRoot(dir, marker) {
|
|
|
6671
6681
|
function findEnvFilesRecursive(rootDir, opts = {}) {
|
|
6672
6682
|
const maxDepth = Math.max(1, opts.maxDepth ?? DEFAULT_MAX_DEPTH);
|
|
6673
6683
|
const ignore = opts.ignore ?? IGNORE_DIRS;
|
|
6684
|
+
const limit = Math.max(1, opts.limit ?? DEFAULT_MAX_RESULTS);
|
|
6674
6685
|
let rootReal;
|
|
6675
6686
|
try {
|
|
6676
6687
|
rootReal = realpathSync(rootDir);
|
|
@@ -6712,6 +6723,7 @@ function findEnvFilesRecursive(rootDir, opts = {}) {
|
|
|
6712
6723
|
if (isFile) {
|
|
6713
6724
|
if (!ENV_GLOB.test(entry2.name)) continue;
|
|
6714
6725
|
if (ENV_EXAMPLE.test(entry2.name)) continue;
|
|
6726
|
+
if (ENV_BACKUP_EXCLUDE.test(entry2.name)) continue;
|
|
6715
6727
|
if (KEYNV_ENV_EXCLUDE.test(entry2.name)) continue;
|
|
6716
6728
|
const suffixMatch = entry2.name.match(/^\.env\.(.+)$/);
|
|
6717
6729
|
const suffix = suffixMatch ? suffixMatch[1] : null;
|
|
@@ -6725,10 +6737,15 @@ function findEnvFilesRecursive(rootDir, opts = {}) {
|
|
|
6725
6737
|
relativeDir,
|
|
6726
6738
|
containingDir: dir
|
|
6727
6739
|
});
|
|
6740
|
+
if (hits.length >= limit) {
|
|
6741
|
+
queue.length = 0;
|
|
6742
|
+
break;
|
|
6743
|
+
}
|
|
6728
6744
|
continue;
|
|
6729
6745
|
}
|
|
6730
6746
|
if (isDir && depth + 1 < maxDepth) {
|
|
6731
6747
|
if (ignore.has(entry2.name)) continue;
|
|
6748
|
+
if (entry2.name.startsWith(".")) continue;
|
|
6732
6749
|
let realDir;
|
|
6733
6750
|
try {
|
|
6734
6751
|
realDir = realpathSync(full);
|
|
@@ -6776,10 +6793,9 @@ function suggestedEnvForSuffix(suffix) {
|
|
|
6776
6793
|
function hasExistingKeynvEnv(rootDir) {
|
|
6777
6794
|
return existsSync(join(rootDir, KEYNV_ENV_BASENAME));
|
|
6778
6795
|
}
|
|
6779
|
-
var PROJECT_MARKERS, GIT_MARKER, ENV_GLOB, ENV_EXAMPLE, KEYNV_ENV_BASENAME, KEYNV_ENV_EXCLUDE, IGNORE_DIRS, DEFAULT_MAX_DEPTH;
|
|
6796
|
+
var PROJECT_MARKERS, GIT_MARKER, ENV_GLOB, ENV_EXAMPLE, ENV_BACKUP_EXCLUDE, KEYNV_ENV_BASENAME, KEYNV_ENV_EXCLUDE, IGNORE_DIRS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_RESULTS;
|
|
6780
6797
|
var init_detect = __esm({
|
|
6781
6798
|
"src/init/detect.ts"() {
|
|
6782
|
-
init_fs();
|
|
6783
6799
|
PROJECT_MARKERS = [
|
|
6784
6800
|
"package.json",
|
|
6785
6801
|
"pyproject.toml",
|
|
@@ -6793,6 +6809,7 @@ var init_detect = __esm({
|
|
|
6793
6809
|
GIT_MARKER = ".git";
|
|
6794
6810
|
ENV_GLOB = /^\.env(\.[A-Za-z0-9_-]+)?$/;
|
|
6795
6811
|
ENV_EXAMPLE = /^\.env\.(example|sample|template|dist|defaults)$/;
|
|
6812
|
+
ENV_BACKUP_EXCLUDE = /^\.env\.backup(-\d{8}-\d{4}(-\d+)?)?$/;
|
|
6796
6813
|
KEYNV_ENV_BASENAME = ".keynv.env";
|
|
6797
6814
|
KEYNV_ENV_EXCLUDE = /^\.keynv\.(.+\.)?env$/;
|
|
6798
6815
|
IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
@@ -6862,6 +6879,7 @@ var init_detect = __esm({
|
|
|
6862
6879
|
".fleet"
|
|
6863
6880
|
]);
|
|
6864
6881
|
DEFAULT_MAX_DEPTH = 5;
|
|
6882
|
+
DEFAULT_MAX_RESULTS = 100;
|
|
6865
6883
|
}
|
|
6866
6884
|
});
|
|
6867
6885
|
function shannonEntropyBits(s) {
|
|
@@ -9315,7 +9333,13 @@ async function runInitFlow(client, opts) {
|
|
|
9315
9333
|
if (root.packageJsonInvalid) {
|
|
9316
9334
|
R2.warn(`package.json at ${root.path} is not valid JSON \u2014 script wrapping will be skipped.`);
|
|
9317
9335
|
}
|
|
9318
|
-
const
|
|
9336
|
+
const atHome = resolve(root.path) === resolve(homedir());
|
|
9337
|
+
if (atHome) {
|
|
9338
|
+
R2.warn(
|
|
9339
|
+
"Running in your home directory \u2014 scanning only this folder, not the whole tree. cd into a project directory for a focused setup."
|
|
9340
|
+
);
|
|
9341
|
+
}
|
|
9342
|
+
const envFiles = findEnvFilesRecursive(root.path, atHome ? { maxDepth: 1 } : void 0);
|
|
9319
9343
|
const intoExisting = hasExistingKeynvEnv(root.path);
|
|
9320
9344
|
if (envFiles.length === 0 && !intoExisting) {
|
|
9321
9345
|
Se(
|
|
@@ -9334,22 +9358,40 @@ async function runInitFlow(client, opts) {
|
|
|
9334
9358
|
ye("Create your first secret with `keynv secret create`.");
|
|
9335
9359
|
return { exitCode: 0 };
|
|
9336
9360
|
}
|
|
9361
|
+
if (envFiles.length >= DEFAULT_MAX_RESULTS) {
|
|
9362
|
+
R2.warn(
|
|
9363
|
+
`Found ${envFiles.length}+ env files \u2014 that usually means keynv is running too high up the tree. Consider cd-ing into a specific project.`
|
|
9364
|
+
);
|
|
9365
|
+
}
|
|
9337
9366
|
Se(
|
|
9338
9367
|
[
|
|
9339
9368
|
`Project root: ${root.path}`,
|
|
9340
9369
|
`Marker: ${root.marker}`,
|
|
9341
|
-
envFiles.length
|
|
9342
|
-
${envFiles.map((f) => ` ${displayName(f)}`).join("\n")}` : "Found env files: (none)",
|
|
9370
|
+
envFiles.length === 0 ? "Found env files: (none)" : envFiles.length === 1 ? `Found env file: ${displayName(envFiles[0])}` : `Found ${envFiles.length} env files`,
|
|
9343
9371
|
intoExisting ? "Existing root .keynv.env detected \u2014 will merge new entries in." : ""
|
|
9344
9372
|
].filter(Boolean).join("\n"),
|
|
9345
9373
|
"Detected"
|
|
9346
9374
|
);
|
|
9375
|
+
let selectedFiles = envFiles;
|
|
9376
|
+
if (envFiles.length > 1) {
|
|
9377
|
+
const initialValues = envFiles.filter((f) => f.relativeDir === "").map((f) => f.path);
|
|
9378
|
+
const picked = unwrap(
|
|
9379
|
+
await ve({
|
|
9380
|
+
message: "Which env files do you want to import?",
|
|
9381
|
+
options: envFiles.map((f) => ({ value: f.path, label: displayName(f) })),
|
|
9382
|
+
initialValues,
|
|
9383
|
+
required: true
|
|
9384
|
+
})
|
|
9385
|
+
);
|
|
9386
|
+
const pickedSet = new Set(picked);
|
|
9387
|
+
selectedFiles = envFiles.filter((f) => pickedSet.has(f.path));
|
|
9388
|
+
}
|
|
9347
9389
|
const projectChoice = await pickOrCreateProject(client, root.suggestedName);
|
|
9348
9390
|
if (projectChoice === null) {
|
|
9349
9391
|
me("No project selected.");
|
|
9350
9392
|
return { exitCode: 130 };
|
|
9351
9393
|
}
|
|
9352
|
-
const fileMapping = await pickFileEnvMapping(
|
|
9394
|
+
const fileMapping = await pickFileEnvMapping(selectedFiles, projectChoice);
|
|
9353
9395
|
if (fileMapping === null) {
|
|
9354
9396
|
me("No env mapping selected.");
|
|
9355
9397
|
return { exitCode: 130 };
|
|
@@ -9461,7 +9503,7 @@ ${detail}`
|
|
|
9461
9503
|
for (const g of groups.values()) {
|
|
9462
9504
|
const dirs = [...new Set(g.sources.map((s) => s.source.relativeDir || "<root>"))];
|
|
9463
9505
|
if (dirs.length > 1) g.label = `${g.label} (shared by ${dirs.join(", ")})`;
|
|
9464
|
-
else if (
|
|
9506
|
+
else if (selectedFiles.some((f) => f.relativeDir !== "")) {
|
|
9465
9507
|
const only = dirs[0];
|
|
9466
9508
|
if (only && only !== "<root>") g.label = `${g.label} [${only}]`;
|
|
9467
9509
|
}
|
|
@@ -9638,7 +9680,7 @@ ${detail}`
|
|
|
9638
9680
|
);
|
|
9639
9681
|
}
|
|
9640
9682
|
}
|
|
9641
|
-
for (const f of
|
|
9683
|
+
for (const f of selectedFiles) {
|
|
9642
9684
|
const relSrc = relFromRoot(root.path, f.path);
|
|
9643
9685
|
try {
|
|
9644
9686
|
const { renamedTo } = backupEnvFile(f.path);
|
|
@@ -9881,7 +9923,7 @@ var init_tty = __esm({
|
|
|
9881
9923
|
}
|
|
9882
9924
|
});
|
|
9883
9925
|
function sleep(ms) {
|
|
9884
|
-
return new Promise((
|
|
9926
|
+
return new Promise((resolve6) => setTimeout(resolve6, ms));
|
|
9885
9927
|
}
|
|
9886
9928
|
async function errorMessage(res, fallback) {
|
|
9887
9929
|
const text = await res.text();
|
|
@@ -10145,16 +10187,16 @@ async function runSecretMenu(client, project, alias2) {
|
|
|
10145
10187
|
async function copyToClipboard(value) {
|
|
10146
10188
|
const platform4 = process.platform;
|
|
10147
10189
|
const cmd = platform4 === "darwin" ? ["pbcopy", []] : platform4 === "win32" ? ["clip", []] : ["xclip", ["-selection", "clipboard"]];
|
|
10148
|
-
return new Promise((
|
|
10190
|
+
return new Promise((resolve6) => {
|
|
10149
10191
|
try {
|
|
10150
10192
|
const child = spawn(cmd[0], cmd[1], {
|
|
10151
10193
|
stdio: ["pipe", "ignore", "ignore"]
|
|
10152
10194
|
});
|
|
10153
|
-
child.on("error", () =>
|
|
10154
|
-
child.on("exit", (code) =>
|
|
10195
|
+
child.on("error", () => resolve6(false));
|
|
10196
|
+
child.on("exit", (code) => resolve6(code === 0));
|
|
10155
10197
|
child.stdin.end(value);
|
|
10156
10198
|
} catch {
|
|
10157
|
-
|
|
10199
|
+
resolve6(false);
|
|
10158
10200
|
}
|
|
10159
10201
|
});
|
|
10160
10202
|
}
|
|
@@ -27082,11 +27124,11 @@ var require_connection = __commonJS({
|
|
|
27082
27124
|
const config = this.config;
|
|
27083
27125
|
tracePromise(
|
|
27084
27126
|
connectChannel,
|
|
27085
|
-
() => new Promise((
|
|
27127
|
+
() => new Promise((resolve6, reject) => {
|
|
27086
27128
|
let onConnect, onError;
|
|
27087
27129
|
onConnect = (param) => {
|
|
27088
27130
|
this.removeListener("error", onError);
|
|
27089
|
-
|
|
27131
|
+
resolve6(param);
|
|
27090
27132
|
};
|
|
27091
27133
|
onError = (err) => {
|
|
27092
27134
|
this.removeListener("connect", onConnect);
|
|
@@ -27511,9 +27553,9 @@ var require_connection = __commonJS({
|
|
|
27511
27553
|
} else if (shouldTrace(queryChannel)) {
|
|
27512
27554
|
tracePromise(
|
|
27513
27555
|
queryChannel,
|
|
27514
|
-
() => new Promise((
|
|
27556
|
+
() => new Promise((resolve6, reject) => {
|
|
27515
27557
|
cmdQuery.once("error", reject);
|
|
27516
|
-
cmdQuery.once("end", () =>
|
|
27558
|
+
cmdQuery.once("end", () => resolve6());
|
|
27517
27559
|
this.addCommand(cmdQuery);
|
|
27518
27560
|
}),
|
|
27519
27561
|
() => {
|
|
@@ -27660,12 +27702,12 @@ var require_connection = __commonJS({
|
|
|
27660
27702
|
} else if (shouldTrace(executeChannel)) {
|
|
27661
27703
|
tracePromise(
|
|
27662
27704
|
executeChannel,
|
|
27663
|
-
() => new Promise((
|
|
27705
|
+
() => new Promise((resolve6, reject) => {
|
|
27664
27706
|
prepareAndExecute((err) => {
|
|
27665
27707
|
executeCommand.emit("error", err);
|
|
27666
27708
|
});
|
|
27667
27709
|
executeCommand.once("error", reject);
|
|
27668
|
-
executeCommand.once("end", () =>
|
|
27710
|
+
executeCommand.once("end", () => resolve6());
|
|
27669
27711
|
}),
|
|
27670
27712
|
() => {
|
|
27671
27713
|
const server = getServerContext(this.config);
|
|
@@ -27930,13 +27972,13 @@ var require_capture_local_err = __commonJS({
|
|
|
27930
27972
|
var require_make_done_cb = __commonJS({
|
|
27931
27973
|
"../../node_modules/.pnpm/mysql2@3.22.3_@types+node@24.12.3/node_modules/mysql2/lib/promise/make_done_cb.js"(exports, module) {
|
|
27932
27974
|
var { applyCapturedStack } = require_capture_local_err();
|
|
27933
|
-
function makeDoneCb(
|
|
27975
|
+
function makeDoneCb(resolve6, reject, stackHolder) {
|
|
27934
27976
|
return function(err, rows, fields) {
|
|
27935
27977
|
if (err) {
|
|
27936
27978
|
applyCapturedStack(err, stackHolder);
|
|
27937
27979
|
reject(err);
|
|
27938
27980
|
} else {
|
|
27939
|
-
|
|
27981
|
+
resolve6([rows, fields]);
|
|
27940
27982
|
}
|
|
27941
27983
|
};
|
|
27942
27984
|
}
|
|
@@ -27959,8 +28001,8 @@ var require_prepared_statement_info = __commonJS({
|
|
|
27959
28001
|
const stackHolder = captureStackHolder(
|
|
27960
28002
|
_PromisePreparedStatementInfo.prototype.execute
|
|
27961
28003
|
);
|
|
27962
|
-
return new this.Promise((
|
|
27963
|
-
const done = makeDoneCb(
|
|
28004
|
+
return new this.Promise((resolve6, reject) => {
|
|
28005
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
27964
28006
|
if (parameters) {
|
|
27965
28007
|
s.execute(parameters, done);
|
|
27966
28008
|
} else {
|
|
@@ -27969,9 +28011,9 @@ var require_prepared_statement_info = __commonJS({
|
|
|
27969
28011
|
});
|
|
27970
28012
|
}
|
|
27971
28013
|
close() {
|
|
27972
|
-
return new this.Promise((
|
|
28014
|
+
return new this.Promise((resolve6) => {
|
|
27973
28015
|
this.statement.close();
|
|
27974
|
-
|
|
28016
|
+
resolve6();
|
|
27975
28017
|
});
|
|
27976
28018
|
}
|
|
27977
28019
|
};
|
|
@@ -28042,8 +28084,8 @@ var require_connection2 = __commonJS({
|
|
|
28042
28084
|
"Callback function is not available with promise clients."
|
|
28043
28085
|
);
|
|
28044
28086
|
}
|
|
28045
|
-
return new this.Promise((
|
|
28046
|
-
const done = makeDoneCb(
|
|
28087
|
+
return new this.Promise((resolve6, reject) => {
|
|
28088
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
28047
28089
|
if (params !== void 0) {
|
|
28048
28090
|
c2.query(query, params, done);
|
|
28049
28091
|
} else {
|
|
@@ -28059,8 +28101,8 @@ var require_connection2 = __commonJS({
|
|
|
28059
28101
|
"Callback function is not available with promise clients."
|
|
28060
28102
|
);
|
|
28061
28103
|
}
|
|
28062
|
-
return new this.Promise((
|
|
28063
|
-
const done = makeDoneCb(
|
|
28104
|
+
return new this.Promise((resolve6, reject) => {
|
|
28105
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
28064
28106
|
if (params !== void 0) {
|
|
28065
28107
|
c2.execute(query, params, done);
|
|
28066
28108
|
} else {
|
|
@@ -28069,8 +28111,8 @@ var require_connection2 = __commonJS({
|
|
|
28069
28111
|
});
|
|
28070
28112
|
}
|
|
28071
28113
|
end() {
|
|
28072
|
-
return new this.Promise((
|
|
28073
|
-
this.connection.end(
|
|
28114
|
+
return new this.Promise((resolve6) => {
|
|
28115
|
+
this.connection.end(resolve6);
|
|
28074
28116
|
});
|
|
28075
28117
|
}
|
|
28076
28118
|
async [Symbol.asyncDispose]() {
|
|
@@ -28083,16 +28125,16 @@ var require_connection2 = __commonJS({
|
|
|
28083
28125
|
const stackHolder = captureStackHolder(
|
|
28084
28126
|
_PromiseConnection.prototype.beginTransaction
|
|
28085
28127
|
);
|
|
28086
|
-
return new this.Promise((
|
|
28087
|
-
const done = makeDoneCb(
|
|
28128
|
+
return new this.Promise((resolve6, reject) => {
|
|
28129
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
28088
28130
|
c2.beginTransaction(done);
|
|
28089
28131
|
});
|
|
28090
28132
|
}
|
|
28091
28133
|
commit() {
|
|
28092
28134
|
const c2 = this.connection;
|
|
28093
28135
|
const stackHolder = captureStackHolder(_PromiseConnection.prototype.commit);
|
|
28094
|
-
return new this.Promise((
|
|
28095
|
-
const done = makeDoneCb(
|
|
28136
|
+
return new this.Promise((resolve6, reject) => {
|
|
28137
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
28096
28138
|
c2.commit(done);
|
|
28097
28139
|
});
|
|
28098
28140
|
}
|
|
@@ -28101,21 +28143,21 @@ var require_connection2 = __commonJS({
|
|
|
28101
28143
|
const stackHolder = captureStackHolder(
|
|
28102
28144
|
_PromiseConnection.prototype.rollback
|
|
28103
28145
|
);
|
|
28104
|
-
return new this.Promise((
|
|
28105
|
-
const done = makeDoneCb(
|
|
28146
|
+
return new this.Promise((resolve6, reject) => {
|
|
28147
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
28106
28148
|
c2.rollback(done);
|
|
28107
28149
|
});
|
|
28108
28150
|
}
|
|
28109
28151
|
ping() {
|
|
28110
28152
|
const c2 = this.connection;
|
|
28111
28153
|
const stackHolder = captureStackHolder(_PromiseConnection.prototype.ping);
|
|
28112
|
-
return new this.Promise((
|
|
28154
|
+
return new this.Promise((resolve6, reject) => {
|
|
28113
28155
|
c2.ping((err) => {
|
|
28114
28156
|
if (err) {
|
|
28115
28157
|
applyCapturedStack(err, stackHolder);
|
|
28116
28158
|
reject(err);
|
|
28117
28159
|
} else {
|
|
28118
|
-
|
|
28160
|
+
resolve6(true);
|
|
28119
28161
|
}
|
|
28120
28162
|
});
|
|
28121
28163
|
});
|
|
@@ -28123,13 +28165,13 @@ var require_connection2 = __commonJS({
|
|
|
28123
28165
|
reset() {
|
|
28124
28166
|
const c2 = this.connection;
|
|
28125
28167
|
const stackHolder = captureStackHolder(_PromiseConnection.prototype.reset);
|
|
28126
|
-
return new this.Promise((
|
|
28168
|
+
return new this.Promise((resolve6, reject) => {
|
|
28127
28169
|
c2.reset((err) => {
|
|
28128
28170
|
if (err) {
|
|
28129
28171
|
applyCapturedStack(err, stackHolder);
|
|
28130
28172
|
reject(err);
|
|
28131
28173
|
} else {
|
|
28132
|
-
|
|
28174
|
+
resolve6();
|
|
28133
28175
|
}
|
|
28134
28176
|
});
|
|
28135
28177
|
});
|
|
@@ -28137,13 +28179,13 @@ var require_connection2 = __commonJS({
|
|
|
28137
28179
|
connect() {
|
|
28138
28180
|
const c2 = this.connection;
|
|
28139
28181
|
const stackHolder = captureStackHolder(_PromiseConnection.prototype.connect);
|
|
28140
|
-
return new this.Promise((
|
|
28182
|
+
return new this.Promise((resolve6, reject) => {
|
|
28141
28183
|
c2.connect((err, param) => {
|
|
28142
28184
|
if (err) {
|
|
28143
28185
|
applyCapturedStack(err, stackHolder);
|
|
28144
28186
|
reject(err);
|
|
28145
28187
|
} else {
|
|
28146
|
-
|
|
28188
|
+
resolve6(param);
|
|
28147
28189
|
}
|
|
28148
28190
|
});
|
|
28149
28191
|
});
|
|
@@ -28152,7 +28194,7 @@ var require_connection2 = __commonJS({
|
|
|
28152
28194
|
const c2 = this.connection;
|
|
28153
28195
|
const promiseImpl = this.Promise;
|
|
28154
28196
|
const stackHolder = captureStackHolder(_PromiseConnection.prototype.prepare);
|
|
28155
|
-
return new this.Promise((
|
|
28197
|
+
return new this.Promise((resolve6, reject) => {
|
|
28156
28198
|
c2.prepare(options, (err, statement) => {
|
|
28157
28199
|
if (err) {
|
|
28158
28200
|
applyCapturedStack(err, stackHolder);
|
|
@@ -28162,7 +28204,7 @@ var require_connection2 = __commonJS({
|
|
|
28162
28204
|
statement,
|
|
28163
28205
|
promiseImpl
|
|
28164
28206
|
);
|
|
28165
|
-
|
|
28207
|
+
resolve6(wrappedStatement);
|
|
28166
28208
|
}
|
|
28167
28209
|
});
|
|
28168
28210
|
});
|
|
@@ -28172,13 +28214,13 @@ var require_connection2 = __commonJS({
|
|
|
28172
28214
|
const stackHolder = captureStackHolder(
|
|
28173
28215
|
_PromiseConnection.prototype.changeUser
|
|
28174
28216
|
);
|
|
28175
|
-
return new this.Promise((
|
|
28217
|
+
return new this.Promise((resolve6, reject) => {
|
|
28176
28218
|
c2.changeUser(options, (err) => {
|
|
28177
28219
|
if (err) {
|
|
28178
28220
|
applyCapturedStack(err, stackHolder);
|
|
28179
28221
|
reject(err);
|
|
28180
28222
|
} else {
|
|
28181
|
-
|
|
28223
|
+
resolve6();
|
|
28182
28224
|
}
|
|
28183
28225
|
});
|
|
28184
28226
|
});
|
|
@@ -28640,12 +28682,12 @@ var require_pool2 = __commonJS({
|
|
|
28640
28682
|
}
|
|
28641
28683
|
getConnection() {
|
|
28642
28684
|
const corePool = this.pool;
|
|
28643
|
-
return new this.Promise((
|
|
28685
|
+
return new this.Promise((resolve6, reject) => {
|
|
28644
28686
|
corePool.getConnection((err, coreConnection) => {
|
|
28645
28687
|
if (err) {
|
|
28646
28688
|
reject(err);
|
|
28647
28689
|
} else {
|
|
28648
|
-
|
|
28690
|
+
resolve6(new PromisePoolConnection(coreConnection, this.Promise));
|
|
28649
28691
|
}
|
|
28650
28692
|
});
|
|
28651
28693
|
});
|
|
@@ -28661,8 +28703,8 @@ var require_pool2 = __commonJS({
|
|
|
28661
28703
|
"Callback function is not available with promise clients."
|
|
28662
28704
|
);
|
|
28663
28705
|
}
|
|
28664
|
-
return new this.Promise((
|
|
28665
|
-
const done = makeDoneCb(
|
|
28706
|
+
return new this.Promise((resolve6, reject) => {
|
|
28707
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
28666
28708
|
if (args !== void 0) {
|
|
28667
28709
|
corePool.query(sql, args, done);
|
|
28668
28710
|
} else {
|
|
@@ -28678,8 +28720,8 @@ var require_pool2 = __commonJS({
|
|
|
28678
28720
|
"Callback function is not available with promise clients."
|
|
28679
28721
|
);
|
|
28680
28722
|
}
|
|
28681
|
-
return new this.Promise((
|
|
28682
|
-
const done = makeDoneCb(
|
|
28723
|
+
return new this.Promise((resolve6, reject) => {
|
|
28724
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
28683
28725
|
if (args) {
|
|
28684
28726
|
corePool.execute(sql, args, done);
|
|
28685
28727
|
} else {
|
|
@@ -28690,13 +28732,13 @@ var require_pool2 = __commonJS({
|
|
|
28690
28732
|
end() {
|
|
28691
28733
|
const corePool = this.pool;
|
|
28692
28734
|
const stackHolder = captureStackHolder(_PromisePool.prototype.end);
|
|
28693
|
-
return new this.Promise((
|
|
28735
|
+
return new this.Promise((resolve6, reject) => {
|
|
28694
28736
|
corePool.end((err) => {
|
|
28695
28737
|
if (err) {
|
|
28696
28738
|
applyCapturedStack(err, stackHolder);
|
|
28697
28739
|
reject(err);
|
|
28698
28740
|
} else {
|
|
28699
|
-
|
|
28741
|
+
resolve6();
|
|
28700
28742
|
}
|
|
28701
28743
|
});
|
|
28702
28744
|
});
|
|
@@ -29121,12 +29163,12 @@ var require_pool_cluster2 = __commonJS({
|
|
|
29121
29163
|
}
|
|
29122
29164
|
getConnection() {
|
|
29123
29165
|
const corePoolNamespace = this.poolNamespace;
|
|
29124
|
-
return new this.Promise((
|
|
29166
|
+
return new this.Promise((resolve6, reject) => {
|
|
29125
29167
|
corePoolNamespace.getConnection((err, coreConnection) => {
|
|
29126
29168
|
if (err) {
|
|
29127
29169
|
reject(err);
|
|
29128
29170
|
} else {
|
|
29129
|
-
|
|
29171
|
+
resolve6(new PromisePoolConnection(coreConnection, this.Promise));
|
|
29130
29172
|
}
|
|
29131
29173
|
});
|
|
29132
29174
|
});
|
|
@@ -29141,8 +29183,8 @@ var require_pool_cluster2 = __commonJS({
|
|
|
29141
29183
|
"Callback function is not available with promise clients."
|
|
29142
29184
|
);
|
|
29143
29185
|
}
|
|
29144
|
-
return new this.Promise((
|
|
29145
|
-
const done = makeDoneCb(
|
|
29186
|
+
return new this.Promise((resolve6, reject) => {
|
|
29187
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
29146
29188
|
corePoolNamespace.query(sql, values, done);
|
|
29147
29189
|
});
|
|
29148
29190
|
}
|
|
@@ -29156,8 +29198,8 @@ var require_pool_cluster2 = __commonJS({
|
|
|
29156
29198
|
"Callback function is not available with promise clients."
|
|
29157
29199
|
);
|
|
29158
29200
|
}
|
|
29159
|
-
return new this.Promise((
|
|
29160
|
-
const done = makeDoneCb(
|
|
29201
|
+
return new this.Promise((resolve6, reject) => {
|
|
29202
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
29161
29203
|
corePoolNamespace.execute(sql, values, done);
|
|
29162
29204
|
});
|
|
29163
29205
|
}
|
|
@@ -29195,9 +29237,9 @@ var require_promise = __commonJS({
|
|
|
29195
29237
|
"no Promise implementation available.Use promise-enabled node version or pass userland Promise implementation as parameter, for example: { Promise: require('bluebird') }"
|
|
29196
29238
|
);
|
|
29197
29239
|
}
|
|
29198
|
-
return new thePromise((
|
|
29240
|
+
return new thePromise((resolve6, reject) => {
|
|
29199
29241
|
coreConnection.once("connect", () => {
|
|
29200
|
-
|
|
29242
|
+
resolve6(new PromiseConnection(coreConnection, thePromise));
|
|
29201
29243
|
});
|
|
29202
29244
|
coreConnection.once("error", (err) => {
|
|
29203
29245
|
applyCapturedStack(err, stackHolder);
|
|
@@ -29224,7 +29266,7 @@ var require_promise = __commonJS({
|
|
|
29224
29266
|
}
|
|
29225
29267
|
getConnection(pattern, selector) {
|
|
29226
29268
|
const corePoolCluster = this.poolCluster;
|
|
29227
|
-
return new this.Promise((
|
|
29269
|
+
return new this.Promise((resolve6, reject) => {
|
|
29228
29270
|
corePoolCluster.getConnection(
|
|
29229
29271
|
pattern,
|
|
29230
29272
|
selector,
|
|
@@ -29232,7 +29274,7 @@ var require_promise = __commonJS({
|
|
|
29232
29274
|
if (err) {
|
|
29233
29275
|
reject(err);
|
|
29234
29276
|
} else {
|
|
29235
|
-
|
|
29277
|
+
resolve6(new PromisePoolConnection(coreConnection, this.Promise));
|
|
29236
29278
|
}
|
|
29237
29279
|
}
|
|
29238
29280
|
);
|
|
@@ -29246,8 +29288,8 @@ var require_promise = __commonJS({
|
|
|
29246
29288
|
"Callback function is not available with promise clients."
|
|
29247
29289
|
);
|
|
29248
29290
|
}
|
|
29249
|
-
return new this.Promise((
|
|
29250
|
-
const done = makeDoneCb(
|
|
29291
|
+
return new this.Promise((resolve6, reject) => {
|
|
29292
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
29251
29293
|
corePoolCluster.query(sql, args, done);
|
|
29252
29294
|
});
|
|
29253
29295
|
}
|
|
@@ -29261,8 +29303,8 @@ var require_promise = __commonJS({
|
|
|
29261
29303
|
"Callback function is not available with promise clients."
|
|
29262
29304
|
);
|
|
29263
29305
|
}
|
|
29264
|
-
return new this.Promise((
|
|
29265
|
-
const done = makeDoneCb(
|
|
29306
|
+
return new this.Promise((resolve6, reject) => {
|
|
29307
|
+
const done = makeDoneCb(resolve6, reject, stackHolder);
|
|
29266
29308
|
corePoolCluster.execute(sql, args, done);
|
|
29267
29309
|
});
|
|
29268
29310
|
}
|
|
@@ -29275,13 +29317,13 @@ var require_promise = __commonJS({
|
|
|
29275
29317
|
end() {
|
|
29276
29318
|
const corePoolCluster = this.poolCluster;
|
|
29277
29319
|
const stackHolder = captureStackHolder(_PromisePoolCluster.prototype.end);
|
|
29278
|
-
return new this.Promise((
|
|
29320
|
+
return new this.Promise((resolve6, reject) => {
|
|
29279
29321
|
corePoolCluster.end((err) => {
|
|
29280
29322
|
if (err) {
|
|
29281
29323
|
applyCapturedStack(err, stackHolder);
|
|
29282
29324
|
reject(err);
|
|
29283
29325
|
} else {
|
|
29284
|
-
|
|
29326
|
+
resolve6();
|
|
29285
29327
|
}
|
|
29286
29328
|
});
|
|
29287
29329
|
});
|
|
@@ -32356,7 +32398,7 @@ var require_dist = __commonJS({
|
|
|
32356
32398
|
function parse(stream, callback) {
|
|
32357
32399
|
const parser = new parser_1.Parser();
|
|
32358
32400
|
stream.on("data", (buffer) => parser.parse(buffer, callback));
|
|
32359
|
-
return new Promise((
|
|
32401
|
+
return new Promise((resolve6) => stream.on("end", () => resolve6()));
|
|
32360
32402
|
}
|
|
32361
32403
|
exports.parse = parse;
|
|
32362
32404
|
}
|
|
@@ -33081,12 +33123,12 @@ var require_client2 = __commonJS({
|
|
|
33081
33123
|
this._connect(callback);
|
|
33082
33124
|
return;
|
|
33083
33125
|
}
|
|
33084
|
-
return new this._Promise((
|
|
33126
|
+
return new this._Promise((resolve6, reject) => {
|
|
33085
33127
|
this._connect((error) => {
|
|
33086
33128
|
if (error) {
|
|
33087
33129
|
reject(error);
|
|
33088
33130
|
} else {
|
|
33089
|
-
|
|
33131
|
+
resolve6(this);
|
|
33090
33132
|
}
|
|
33091
33133
|
});
|
|
33092
33134
|
});
|
|
@@ -33432,8 +33474,8 @@ var require_client2 = __commonJS({
|
|
|
33432
33474
|
readTimeout = config.query_timeout || this.connectionParameters.query_timeout;
|
|
33433
33475
|
query = new Query2(config, values, callback);
|
|
33434
33476
|
if (!query.callback) {
|
|
33435
|
-
result = new this._Promise((
|
|
33436
|
-
query.callback = (err, res) => err ? reject(err) :
|
|
33477
|
+
result = new this._Promise((resolve6, reject) => {
|
|
33478
|
+
query.callback = (err, res) => err ? reject(err) : resolve6(res);
|
|
33437
33479
|
}).catch((err) => {
|
|
33438
33480
|
Error.captureStackTrace(err);
|
|
33439
33481
|
throw err;
|
|
@@ -33510,8 +33552,8 @@ var require_client2 = __commonJS({
|
|
|
33510
33552
|
if (cb) {
|
|
33511
33553
|
this.connection.once("end", cb);
|
|
33512
33554
|
} else {
|
|
33513
|
-
return new this._Promise((
|
|
33514
|
-
this.connection.once("end",
|
|
33555
|
+
return new this._Promise((resolve6) => {
|
|
33556
|
+
this.connection.once("end", resolve6);
|
|
33515
33557
|
});
|
|
33516
33558
|
}
|
|
33517
33559
|
}
|
|
@@ -33559,8 +33601,8 @@ var require_pg_pool = __commonJS({
|
|
|
33559
33601
|
const cb = function(err, client) {
|
|
33560
33602
|
err ? rej(err) : res(client);
|
|
33561
33603
|
};
|
|
33562
|
-
const result = new Promise2(function(
|
|
33563
|
-
res =
|
|
33604
|
+
const result = new Promise2(function(resolve6, reject) {
|
|
33605
|
+
res = resolve6;
|
|
33564
33606
|
rej = reject;
|
|
33565
33607
|
}).catch((err) => {
|
|
33566
33608
|
Error.captureStackTrace(err);
|
|
@@ -33621,7 +33663,7 @@ var require_pg_pool = __commonJS({
|
|
|
33621
33663
|
if (typeof Promise2.try === "function") {
|
|
33622
33664
|
return Promise2.try(f);
|
|
33623
33665
|
}
|
|
33624
|
-
return new Promise2((
|
|
33666
|
+
return new Promise2((resolve6) => resolve6(f()));
|
|
33625
33667
|
}
|
|
33626
33668
|
_isFull() {
|
|
33627
33669
|
return this._clients.length >= this.options.max;
|
|
@@ -34013,8 +34055,8 @@ var require_query4 = __commonJS({
|
|
|
34013
34055
|
NativeQuery.prototype._getPromise = function() {
|
|
34014
34056
|
if (this._promise) return this._promise;
|
|
34015
34057
|
this._promise = new Promise(
|
|
34016
|
-
function(
|
|
34017
|
-
this._once("end",
|
|
34058
|
+
function(resolve6, reject) {
|
|
34059
|
+
this._once("end", resolve6);
|
|
34018
34060
|
this._once("error", reject);
|
|
34019
34061
|
}.bind(this)
|
|
34020
34062
|
);
|
|
@@ -34191,12 +34233,12 @@ var require_client3 = __commonJS({
|
|
|
34191
34233
|
this._connect(callback);
|
|
34192
34234
|
return;
|
|
34193
34235
|
}
|
|
34194
|
-
return new this._Promise((
|
|
34236
|
+
return new this._Promise((resolve6, reject) => {
|
|
34195
34237
|
this._connect((error) => {
|
|
34196
34238
|
if (error) {
|
|
34197
34239
|
reject(error);
|
|
34198
34240
|
} else {
|
|
34199
|
-
|
|
34241
|
+
resolve6(this);
|
|
34200
34242
|
}
|
|
34201
34243
|
});
|
|
34202
34244
|
});
|
|
@@ -34220,8 +34262,8 @@ var require_client3 = __commonJS({
|
|
|
34220
34262
|
query = new NativeQuery(config, values, callback);
|
|
34221
34263
|
if (!query.callback) {
|
|
34222
34264
|
let resolveOut, rejectOut;
|
|
34223
|
-
result = new this._Promise((
|
|
34224
|
-
resolveOut =
|
|
34265
|
+
result = new this._Promise((resolve6, reject) => {
|
|
34266
|
+
resolveOut = resolve6;
|
|
34225
34267
|
rejectOut = reject;
|
|
34226
34268
|
}).catch((err) => {
|
|
34227
34269
|
Error.captureStackTrace(err);
|
|
@@ -34281,8 +34323,8 @@ var require_client3 = __commonJS({
|
|
|
34281
34323
|
}
|
|
34282
34324
|
let result;
|
|
34283
34325
|
if (!cb) {
|
|
34284
|
-
result = new this._Promise(function(
|
|
34285
|
-
cb = (err) => err ? reject(err) :
|
|
34326
|
+
result = new this._Promise(function(resolve6, reject) {
|
|
34327
|
+
cb = (err) => err ? reject(err) : resolve6();
|
|
34286
34328
|
});
|
|
34287
34329
|
}
|
|
34288
34330
|
this.native.end(function() {
|
|
@@ -39389,7 +39431,7 @@ var require_Command = __commonJS({
|
|
|
39389
39431
|
}
|
|
39390
39432
|
}
|
|
39391
39433
|
initPromise() {
|
|
39392
|
-
const promise = new Promise((
|
|
39434
|
+
const promise = new Promise((resolve6, reject) => {
|
|
39393
39435
|
if (!this.transformed) {
|
|
39394
39436
|
this.transformed = true;
|
|
39395
39437
|
const transformer = _Command._transformer.argument[this.name];
|
|
@@ -39398,7 +39440,7 @@ var require_Command = __commonJS({
|
|
|
39398
39440
|
}
|
|
39399
39441
|
this.stringifyArguments();
|
|
39400
39442
|
}
|
|
39401
|
-
this.resolve = this._convertValue(
|
|
39443
|
+
this.resolve = this._convertValue(resolve6);
|
|
39402
39444
|
this.reject = (err) => {
|
|
39403
39445
|
this._clearTimers();
|
|
39404
39446
|
if (this.errorStack) {
|
|
@@ -39431,11 +39473,11 @@ var require_Command = __commonJS({
|
|
|
39431
39473
|
/**
|
|
39432
39474
|
* Convert the value from buffer to the target encoding.
|
|
39433
39475
|
*/
|
|
39434
|
-
_convertValue(
|
|
39476
|
+
_convertValue(resolve6) {
|
|
39435
39477
|
return (value) => {
|
|
39436
39478
|
try {
|
|
39437
39479
|
this._clearTimers();
|
|
39438
|
-
|
|
39480
|
+
resolve6(this.transformReply(value));
|
|
39439
39481
|
this.isResolved = true;
|
|
39440
39482
|
} catch (err) {
|
|
39441
39483
|
this.reject(err);
|
|
@@ -39713,13 +39755,13 @@ var require_autoPipelining = __commonJS({
|
|
|
39713
39755
|
if (client.isCluster && !client.slots.length) {
|
|
39714
39756
|
if (client.status === "wait")
|
|
39715
39757
|
client.connect().catch(lodash_1.noop);
|
|
39716
|
-
return (0, standard_as_callback_1.default)(new Promise(function(
|
|
39758
|
+
return (0, standard_as_callback_1.default)(new Promise(function(resolve6, reject) {
|
|
39717
39759
|
client.delayUntilReady((err) => {
|
|
39718
39760
|
if (err) {
|
|
39719
39761
|
reject(err);
|
|
39720
39762
|
return;
|
|
39721
39763
|
}
|
|
39722
|
-
executeWithAutoPipelining(client, functionName, commandName, args, null).then(
|
|
39764
|
+
executeWithAutoPipelining(client, functionName, commandName, args, null).then(resolve6, reject);
|
|
39723
39765
|
});
|
|
39724
39766
|
}), callback);
|
|
39725
39767
|
}
|
|
@@ -39740,13 +39782,13 @@ var require_autoPipelining = __commonJS({
|
|
|
39740
39782
|
pipeline[exports.kExec] = true;
|
|
39741
39783
|
setImmediate(executeAutoPipeline, client, slotKey);
|
|
39742
39784
|
}
|
|
39743
|
-
const autoPipelinePromise = new Promise(function(
|
|
39785
|
+
const autoPipelinePromise = new Promise(function(resolve6, reject) {
|
|
39744
39786
|
pipeline[exports.kCallbacks].push(function(err, value) {
|
|
39745
39787
|
if (err) {
|
|
39746
39788
|
reject(err);
|
|
39747
39789
|
return;
|
|
39748
39790
|
}
|
|
39749
|
-
|
|
39791
|
+
resolve6(value);
|
|
39750
39792
|
});
|
|
39751
39793
|
if (functionName === "call") {
|
|
39752
39794
|
args.unshift(commandName);
|
|
@@ -39981,8 +40023,8 @@ var require_Pipeline = __commonJS({
|
|
|
39981
40023
|
this[name] = redis[name];
|
|
39982
40024
|
this[name + "Buffer"] = redis[name + "Buffer"];
|
|
39983
40025
|
});
|
|
39984
|
-
this.promise = new Promise((
|
|
39985
|
-
this.resolve =
|
|
40026
|
+
this.promise = new Promise((resolve6, reject) => {
|
|
40027
|
+
this.resolve = resolve6;
|
|
39986
40028
|
this.reject = reject;
|
|
39987
40029
|
});
|
|
39988
40030
|
const _this = this;
|
|
@@ -40282,13 +40324,13 @@ var require_transaction = __commonJS({
|
|
|
40282
40324
|
if (this.isCluster && !this.redis.slots.length) {
|
|
40283
40325
|
if (this.redis.status === "wait")
|
|
40284
40326
|
this.redis.connect().catch(utils_1.noop);
|
|
40285
|
-
return (0, standard_as_callback_1.default)(new Promise((
|
|
40327
|
+
return (0, standard_as_callback_1.default)(new Promise((resolve6, reject) => {
|
|
40286
40328
|
this.redis.delayUntilReady((err) => {
|
|
40287
40329
|
if (err) {
|
|
40288
40330
|
reject(err);
|
|
40289
40331
|
return;
|
|
40290
40332
|
}
|
|
40291
|
-
this.exec(pipeline).then(
|
|
40333
|
+
this.exec(pipeline).then(resolve6, reject);
|
|
40292
40334
|
});
|
|
40293
40335
|
}), callback);
|
|
40294
40336
|
}
|
|
@@ -41417,7 +41459,7 @@ var require_cluster = __commonJS({
|
|
|
41417
41459
|
* Connect to a cluster
|
|
41418
41460
|
*/
|
|
41419
41461
|
connect() {
|
|
41420
|
-
return new Promise((
|
|
41462
|
+
return new Promise((resolve6, reject) => {
|
|
41421
41463
|
if (this.status === "connecting" || this.status === "connect" || this.status === "ready") {
|
|
41422
41464
|
reject(new Error("Redis is already connecting/connected"));
|
|
41423
41465
|
return;
|
|
@@ -41446,7 +41488,7 @@ var require_cluster = __commonJS({
|
|
|
41446
41488
|
this.retryAttempts = 0;
|
|
41447
41489
|
this.executeOfflineCommands();
|
|
41448
41490
|
this.resetNodesRefreshInterval();
|
|
41449
|
-
|
|
41491
|
+
resolve6();
|
|
41450
41492
|
};
|
|
41451
41493
|
let closeListener = void 0;
|
|
41452
41494
|
const refreshListener = () => {
|
|
@@ -42056,7 +42098,7 @@ var require_cluster = __commonJS({
|
|
|
42056
42098
|
});
|
|
42057
42099
|
}
|
|
42058
42100
|
resolveSrv(hostname2) {
|
|
42059
|
-
return new Promise((
|
|
42101
|
+
return new Promise((resolve6, reject) => {
|
|
42060
42102
|
this.options.resolveSrv(hostname2, (err, records) => {
|
|
42061
42103
|
if (err) {
|
|
42062
42104
|
return reject(err);
|
|
@@ -42070,7 +42112,7 @@ var require_cluster = __commonJS({
|
|
|
42070
42112
|
if (!group.records.length) {
|
|
42071
42113
|
sortedKeys.shift();
|
|
42072
42114
|
}
|
|
42073
|
-
self2.dnsLookup(record.name).then((host) =>
|
|
42115
|
+
self2.dnsLookup(record.name).then((host) => resolve6({
|
|
42074
42116
|
host,
|
|
42075
42117
|
port: record.port
|
|
42076
42118
|
}), tryFirstOne);
|
|
@@ -42080,14 +42122,14 @@ var require_cluster = __commonJS({
|
|
|
42080
42122
|
});
|
|
42081
42123
|
}
|
|
42082
42124
|
dnsLookup(hostname2) {
|
|
42083
|
-
return new Promise((
|
|
42125
|
+
return new Promise((resolve6, reject) => {
|
|
42084
42126
|
this.options.dnsLookup(hostname2, (err, address) => {
|
|
42085
42127
|
if (err) {
|
|
42086
42128
|
debug2("failed to resolve hostname %s to IP: %s", hostname2, err.message);
|
|
42087
42129
|
reject(err);
|
|
42088
42130
|
} else {
|
|
42089
42131
|
debug2("resolved hostname %s to IP %s", hostname2, address);
|
|
42090
|
-
|
|
42132
|
+
resolve6(address);
|
|
42091
42133
|
}
|
|
42092
42134
|
});
|
|
42093
42135
|
});
|
|
@@ -42242,7 +42284,7 @@ var require_StandaloneConnector = __commonJS({
|
|
|
42242
42284
|
if (options.tls) {
|
|
42243
42285
|
Object.assign(connectionOptions, options.tls);
|
|
42244
42286
|
}
|
|
42245
|
-
return new Promise((
|
|
42287
|
+
return new Promise((resolve6, reject) => {
|
|
42246
42288
|
process.nextTick(() => {
|
|
42247
42289
|
if (!this.connecting) {
|
|
42248
42290
|
reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG));
|
|
@@ -42261,7 +42303,7 @@ var require_StandaloneConnector = __commonJS({
|
|
|
42261
42303
|
this.stream.once("error", (err) => {
|
|
42262
42304
|
this.firstError = err;
|
|
42263
42305
|
});
|
|
42264
|
-
|
|
42306
|
+
resolve6(this.stream);
|
|
42265
42307
|
});
|
|
42266
42308
|
});
|
|
42267
42309
|
}
|
|
@@ -42417,7 +42459,7 @@ var require_SentinelConnector = __commonJS({
|
|
|
42417
42459
|
const error = new Error(errorMsg);
|
|
42418
42460
|
if (typeof retryDelay === "number") {
|
|
42419
42461
|
eventEmitter("error", error);
|
|
42420
|
-
await new Promise((
|
|
42462
|
+
await new Promise((resolve6) => setTimeout(resolve6, retryDelay));
|
|
42421
42463
|
return connectToNext();
|
|
42422
42464
|
} else {
|
|
42423
42465
|
throw error;
|
|
@@ -43734,7 +43776,7 @@ var require_Redis = __commonJS({
|
|
|
43734
43776
|
* if the connection fails, times out, or if Redis is already connecting/connected.
|
|
43735
43777
|
*/
|
|
43736
43778
|
connect(callback) {
|
|
43737
|
-
const promise = new Promise((
|
|
43779
|
+
const promise = new Promise((resolve6, reject) => {
|
|
43738
43780
|
if (this.status === "connecting" || this.status === "connect" || this.status === "ready") {
|
|
43739
43781
|
reject(new Error("Redis is already connecting/connected"));
|
|
43740
43782
|
return;
|
|
@@ -43813,7 +43855,7 @@ var require_Redis = __commonJS({
|
|
|
43813
43855
|
}
|
|
43814
43856
|
const connectionReadyHandler = function() {
|
|
43815
43857
|
_this.removeListener("close", connectionCloseHandler);
|
|
43816
|
-
|
|
43858
|
+
resolve6();
|
|
43817
43859
|
};
|
|
43818
43860
|
var connectionCloseHandler = function() {
|
|
43819
43861
|
_this.removeListener("ready", connectionReadyHandler);
|
|
@@ -43907,10 +43949,10 @@ var require_Redis = __commonJS({
|
|
|
43907
43949
|
monitor: true,
|
|
43908
43950
|
lazyConnect: false
|
|
43909
43951
|
});
|
|
43910
|
-
return (0, standard_as_callback_1.default)(new Promise(function(
|
|
43952
|
+
return (0, standard_as_callback_1.default)(new Promise(function(resolve6, reject) {
|
|
43911
43953
|
monitorInstance.once("error", reject);
|
|
43912
43954
|
monitorInstance.once("monitoring", function() {
|
|
43913
|
-
|
|
43955
|
+
resolve6(monitorInstance);
|
|
43914
43956
|
});
|
|
43915
43957
|
}), callback);
|
|
43916
43958
|
}
|
|
@@ -47884,7 +47926,7 @@ function resolverSocketPath() {
|
|
|
47884
47926
|
}
|
|
47885
47927
|
function resolveReferenceToken(token, timeoutMs = 5e3) {
|
|
47886
47928
|
const path = resolverSocketPath();
|
|
47887
|
-
return new Promise((
|
|
47929
|
+
return new Promise((resolve6) => {
|
|
47888
47930
|
const socket = createConnection(path);
|
|
47889
47931
|
let buffer = "";
|
|
47890
47932
|
let settled = false;
|
|
@@ -47892,7 +47934,7 @@ function resolveReferenceToken(token, timeoutMs = 5e3) {
|
|
|
47892
47934
|
if (settled) return;
|
|
47893
47935
|
settled = true;
|
|
47894
47936
|
socket.destroy();
|
|
47895
|
-
|
|
47937
|
+
resolve6(result);
|
|
47896
47938
|
};
|
|
47897
47939
|
const timer = setTimeout(
|
|
47898
47940
|
() => settle({ ok: false, error: "timed out waiting for keynv-mcp resolver" }),
|
|
@@ -48095,7 +48137,7 @@ function spawnPrivileged(opts) {
|
|
|
48095
48137
|
}, opts.timeoutS * 1e3);
|
|
48096
48138
|
timer.unref();
|
|
48097
48139
|
}
|
|
48098
|
-
return new Promise((
|
|
48140
|
+
return new Promise((resolve6, reject) => {
|
|
48099
48141
|
child.on("error", (err) => {
|
|
48100
48142
|
if (timer) clearTimeout(timer);
|
|
48101
48143
|
clearSensitiveReferences(env2, literals);
|
|
@@ -48104,7 +48146,7 @@ function spawnPrivileged(opts) {
|
|
|
48104
48146
|
child.on("close", (code, signal) => {
|
|
48105
48147
|
if (timer) clearTimeout(timer);
|
|
48106
48148
|
clearSensitiveReferences(env2, literals);
|
|
48107
|
-
|
|
48149
|
+
resolve6({
|
|
48108
48150
|
exitCode: code ?? 0,
|
|
48109
48151
|
signal,
|
|
48110
48152
|
durationMs: Date.now() - startedAt
|
|
@@ -49049,7 +49091,7 @@ async function promptHidden(prompt) {
|
|
|
49049
49091
|
process.stdin.setRawMode(true);
|
|
49050
49092
|
process.stdin.resume();
|
|
49051
49093
|
process.stdin.setEncoding("utf8");
|
|
49052
|
-
return new Promise((
|
|
49094
|
+
return new Promise((resolve6) => {
|
|
49053
49095
|
let buf = "";
|
|
49054
49096
|
const onData = (chunk) => {
|
|
49055
49097
|
for (const ch of chunk) {
|
|
@@ -49058,7 +49100,7 @@ async function promptHidden(prompt) {
|
|
|
49058
49100
|
process.stdin.pause();
|
|
49059
49101
|
process.stdin.removeListener("data", onData);
|
|
49060
49102
|
process.stdout.write("\n");
|
|
49061
|
-
|
|
49103
|
+
resolve6(buf);
|
|
49062
49104
|
return;
|
|
49063
49105
|
}
|
|
49064
49106
|
if (ch === "") {
|
|
@@ -49076,10 +49118,10 @@ async function promptHidden(prompt) {
|
|
|
49076
49118
|
}
|
|
49077
49119
|
async function promptLine(prompt) {
|
|
49078
49120
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
49079
|
-
return new Promise((
|
|
49121
|
+
return new Promise((resolve6) => {
|
|
49080
49122
|
rl.question(prompt, (answer) => {
|
|
49081
49123
|
rl.close();
|
|
49082
|
-
|
|
49124
|
+
resolve6(answer.trim());
|
|
49083
49125
|
});
|
|
49084
49126
|
});
|
|
49085
49127
|
}
|
|
@@ -49474,9 +49516,9 @@ here (see the streaming-mode limitation in the redactor package).
|
|
|
49474
49516
|
`
|
|
49475
49517
|
});
|
|
49476
49518
|
async execute() {
|
|
49477
|
-
return new Promise((
|
|
49519
|
+
return new Promise((resolve6, reject) => {
|
|
49478
49520
|
const transform = createRedactStream();
|
|
49479
|
-
this.context.stdin.pipe(transform).pipe(this.context.stdout).on("error", reject).on("finish", () =>
|
|
49521
|
+
this.context.stdin.pipe(transform).pipe(this.context.stdout).on("error", reject).on("finish", () => resolve6(0));
|
|
49480
49522
|
this.context.stdin.on("error", reject);
|
|
49481
49523
|
});
|
|
49482
49524
|
}
|
|
@@ -49738,11 +49780,11 @@ async function copyToClipboard2(value) {
|
|
|
49738
49780
|
);
|
|
49739
49781
|
}
|
|
49740
49782
|
function pipeToCommand(cmd, args, input) {
|
|
49741
|
-
return new Promise((
|
|
49783
|
+
return new Promise((resolve6, reject) => {
|
|
49742
49784
|
const child = spawn(cmd, args, { stdio: ["pipe", "ignore", "ignore"] });
|
|
49743
49785
|
child.on("error", reject);
|
|
49744
49786
|
child.on("close", (code) => {
|
|
49745
|
-
if (code === 0)
|
|
49787
|
+
if (code === 0) resolve6();
|
|
49746
49788
|
else reject(new Error(`${cmd} exited with code ${code}`));
|
|
49747
49789
|
});
|
|
49748
49790
|
child.stdin.on("error", reject);
|
|
@@ -50966,7 +51008,7 @@ var sshTester = {
|
|
|
50966
51008
|
}
|
|
50967
51009
|
const start = Date.now();
|
|
50968
51010
|
const { Client: Client2 } = await import('ssh2');
|
|
50969
|
-
return new Promise((
|
|
51011
|
+
return new Promise((resolve6) => {
|
|
50970
51012
|
const client = new Client2();
|
|
50971
51013
|
let settled = false;
|
|
50972
51014
|
const settle = (result) => {
|
|
@@ -50977,7 +51019,7 @@ var sshTester = {
|
|
|
50977
51019
|
client.end();
|
|
50978
51020
|
} catch {
|
|
50979
51021
|
}
|
|
50980
|
-
|
|
51022
|
+
resolve6(result);
|
|
50981
51023
|
};
|
|
50982
51024
|
client.once("ready", () => {
|
|
50983
51025
|
client.exec("true", (err, stream) => {
|
|
@@ -51062,12 +51104,12 @@ function sanitizeResult(result, secret) {
|
|
|
51062
51104
|
|
|
51063
51105
|
// ../../packages/testers/dist/run.js
|
|
51064
51106
|
function withTimeout(promise, ms) {
|
|
51065
|
-
return new Promise((
|
|
51107
|
+
return new Promise((resolve6, reject) => {
|
|
51066
51108
|
const t = setTimeout(() => reject(new Error(`tester timed out after ${ms}ms`)), ms);
|
|
51067
51109
|
t.unref();
|
|
51068
51110
|
promise.then((v2) => {
|
|
51069
51111
|
clearTimeout(t);
|
|
51070
|
-
|
|
51112
|
+
resolve6(v2);
|
|
51071
51113
|
}, (err) => {
|
|
51072
51114
|
clearTimeout(t);
|
|
51073
51115
|
reject(err);
|
|
@@ -51428,8 +51470,8 @@ async function runWatcher(options = {}) {
|
|
|
51428
51470
|
awaitWriteFinish: false,
|
|
51429
51471
|
...options.usePolling ? { usePolling: true, interval: 500 } : {}
|
|
51430
51472
|
});
|
|
51431
|
-
const readyPromise2 = new Promise((
|
|
51432
|
-
watcher.once("ready", () =>
|
|
51473
|
+
const readyPromise2 = new Promise((resolve6) => {
|
|
51474
|
+
watcher.once("ready", () => resolve6());
|
|
51433
51475
|
});
|
|
51434
51476
|
watcher.on("add", (path) => {
|
|
51435
51477
|
if (matchesExt(path)) filesWatched += 1;
|