drizzle-kit 0.20.0-572b8ee → 0.20.0-588929f
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/{index.cjs → bin.cjs} +986 -676
- package/cli/utils.d.ts +11 -0
- package/cli/validations/mysql.d.ts +77 -126
- package/cli/validations/studio.d.ts +118 -73
- package/global.d.ts +1 -0
- package/index.d.mts +105 -0
- package/index.d.ts +2 -2
- package/index.js +31 -0
- package/index.mjs +7 -0
- package/orm-extenstions/d1-driver/session.d.ts +2 -3
- package/package.json +24 -8
- package/serializer/studioUtils.d.ts +20 -3
- package/utils.d.ts +1 -2
- package/utils.js +1071 -956
package/utils.js
CHANGED
|
@@ -4495,7 +4495,7 @@ var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, d
|
|
|
4495
4495
|
var init_mysqlSchema = __esm({
|
|
4496
4496
|
"src/serializer/mysqlSchema.ts"() {
|
|
4497
4497
|
init_global();
|
|
4498
|
-
|
|
4498
|
+
init_utils5();
|
|
4499
4499
|
init_lib();
|
|
4500
4500
|
index = objectType({
|
|
4501
4501
|
name: stringType(),
|
|
@@ -4745,7 +4745,7 @@ var indexV2, columnV2, tableV2, enumSchema, pgSchemaV2, references, columnV1, ta
|
|
|
4745
4745
|
var init_pgSchema = __esm({
|
|
4746
4746
|
"src/serializer/pgSchema.ts"() {
|
|
4747
4747
|
init_global();
|
|
4748
|
-
|
|
4748
|
+
init_utils5();
|
|
4749
4749
|
init_lib();
|
|
4750
4750
|
indexV2 = objectType({
|
|
4751
4751
|
name: stringType(),
|
|
@@ -5074,7 +5074,7 @@ var index3, fk3, compositePK3, column3, tableV33, uniqueConstraint3, table3, dia
|
|
|
5074
5074
|
var init_sqliteSchema = __esm({
|
|
5075
5075
|
"src/serializer/sqliteSchema.ts"() {
|
|
5076
5076
|
init_global();
|
|
5077
|
-
|
|
5077
|
+
init_utils5();
|
|
5078
5078
|
init_lib();
|
|
5079
5079
|
index3 = objectType({
|
|
5080
5080
|
name: stringType(),
|
|
@@ -8005,7 +8005,7 @@ var require_node2 = __commonJS({
|
|
|
8005
8005
|
if (!fs32.existsSync || !fs32.readFileSync) {
|
|
8006
8006
|
fs32 = null;
|
|
8007
8007
|
}
|
|
8008
|
-
} catch (
|
|
8008
|
+
} catch (err2) {
|
|
8009
8009
|
}
|
|
8010
8010
|
var bufferFrom = require_buffer_from();
|
|
8011
8011
|
function dynamicRequire(mod, request) {
|
|
@@ -8552,17 +8552,17 @@ var require_node2 = __commonJS({
|
|
|
8552
8552
|
function _next(value) {
|
|
8553
8553
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
8554
8554
|
}
|
|
8555
|
-
function _throw(
|
|
8556
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw",
|
|
8555
|
+
function _throw(err2) {
|
|
8556
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err2);
|
|
8557
8557
|
}
|
|
8558
8558
|
_next(void 0);
|
|
8559
8559
|
});
|
|
8560
8560
|
};
|
|
8561
8561
|
}
|
|
8562
8562
|
var readFile = (fp) => new Promise((resolve, reject) => {
|
|
8563
|
-
_fs.default.readFile(fp, "utf8", (
|
|
8564
|
-
if (
|
|
8565
|
-
return reject(
|
|
8563
|
+
_fs.default.readFile(fp, "utf8", (err2, data) => {
|
|
8564
|
+
if (err2)
|
|
8565
|
+
return reject(err2);
|
|
8566
8566
|
resolve(data);
|
|
8567
8567
|
});
|
|
8568
8568
|
});
|
|
@@ -8570,8 +8570,8 @@ var require_node2 = __commonJS({
|
|
|
8570
8570
|
return _fs.default.readFileSync(fp, "utf8");
|
|
8571
8571
|
};
|
|
8572
8572
|
var pathExists = (fp) => new Promise((resolve) => {
|
|
8573
|
-
_fs.default.access(fp, (
|
|
8574
|
-
resolve(!
|
|
8573
|
+
_fs.default.access(fp, (err2) => {
|
|
8574
|
+
resolve(!err2);
|
|
8575
8575
|
});
|
|
8576
8576
|
});
|
|
8577
8577
|
var pathExistsSync = _fs.default.existsSync;
|
|
@@ -8609,9 +8609,9 @@ var require_node2 = __commonJS({
|
|
|
8609
8609
|
this.loaders.delete(loader);
|
|
8610
8610
|
}
|
|
8611
8611
|
}
|
|
8612
|
-
} catch (
|
|
8612
|
+
} catch (err2) {
|
|
8613
8613
|
_didIteratorError = true;
|
|
8614
|
-
_iteratorError =
|
|
8614
|
+
_iteratorError = err2;
|
|
8615
8615
|
} finally {
|
|
8616
8616
|
try {
|
|
8617
8617
|
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
@@ -8654,9 +8654,9 @@ var require_node2 = __commonJS({
|
|
|
8654
8654
|
}
|
|
8655
8655
|
continue;
|
|
8656
8656
|
}
|
|
8657
|
-
} catch (
|
|
8657
|
+
} catch (err2) {
|
|
8658
8658
|
_didIteratorError4 = true;
|
|
8659
|
-
_iteratorError4 =
|
|
8659
|
+
_iteratorError4 = err2;
|
|
8660
8660
|
} finally {
|
|
8661
8661
|
try {
|
|
8662
8662
|
if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
|
|
@@ -8700,9 +8700,9 @@ var require_node2 = __commonJS({
|
|
|
8700
8700
|
}
|
|
8701
8701
|
continue;
|
|
8702
8702
|
}
|
|
8703
|
-
} catch (
|
|
8703
|
+
} catch (err2) {
|
|
8704
8704
|
_didIteratorError2 = true;
|
|
8705
|
-
_iteratorError2 =
|
|
8705
|
+
_iteratorError2 = err2;
|
|
8706
8706
|
} finally {
|
|
8707
8707
|
try {
|
|
8708
8708
|
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
@@ -8821,9 +8821,9 @@ var require_node2 = __commonJS({
|
|
|
8821
8821
|
return loader;
|
|
8822
8822
|
}
|
|
8823
8823
|
}
|
|
8824
|
-
} catch (
|
|
8824
|
+
} catch (err2) {
|
|
8825
8825
|
_didIteratorError3 = true;
|
|
8826
|
-
_iteratorError3 =
|
|
8826
|
+
_iteratorError3 = err2;
|
|
8827
8827
|
} finally {
|
|
8828
8828
|
try {
|
|
8829
8829
|
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
@@ -8878,7 +8878,7 @@ var require_node2 = __commonJS({
|
|
|
8878
8878
|
try {
|
|
8879
8879
|
var stats = fs32.statSync(path4);
|
|
8880
8880
|
return stats.isFile();
|
|
8881
|
-
} catch (
|
|
8881
|
+
} catch (err2) {
|
|
8882
8882
|
return false;
|
|
8883
8883
|
}
|
|
8884
8884
|
}
|
|
@@ -8891,8 +8891,8 @@ var require_node2 = __commonJS({
|
|
|
8891
8891
|
}
|
|
8892
8892
|
exports2.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
8893
8893
|
function readJsonFromDiskAsync(path4, callback) {
|
|
8894
|
-
fs32.readFile(path4, "utf8", function(
|
|
8895
|
-
if (
|
|
8894
|
+
fs32.readFile(path4, "utf8", function(err2, result) {
|
|
8895
|
+
if (err2 || !result) {
|
|
8896
8896
|
return callback();
|
|
8897
8897
|
}
|
|
8898
8898
|
var json = JSON.parse(result);
|
|
@@ -8901,8 +8901,8 @@ var require_node2 = __commonJS({
|
|
|
8901
8901
|
}
|
|
8902
8902
|
exports2.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
8903
8903
|
function fileExistsAsync(path22, callback2) {
|
|
8904
|
-
fs32.stat(path22, function(
|
|
8905
|
-
if (
|
|
8904
|
+
fs32.stat(path22, function(err2, stats) {
|
|
8905
|
+
if (err2) {
|
|
8906
8906
|
return callback2(void 0, false);
|
|
8907
8907
|
}
|
|
8908
8908
|
callback2(void 0, stats ? stats.isFile() : false);
|
|
@@ -9154,9 +9154,9 @@ var require_node2 = __commonJS({
|
|
|
9154
9154
|
return tryNext();
|
|
9155
9155
|
}
|
|
9156
9156
|
var mappedFilePath = path4.join(path4.dirname(packageJsonPath), mainFieldMapping);
|
|
9157
|
-
fileExistsAsync(mappedFilePath, function(
|
|
9158
|
-
if (
|
|
9159
|
-
return doneCallback(
|
|
9157
|
+
fileExistsAsync(mappedFilePath, function(err2, exists) {
|
|
9158
|
+
if (err2) {
|
|
9159
|
+
return doneCallback(err2);
|
|
9160
9160
|
}
|
|
9161
9161
|
if (exists) {
|
|
9162
9162
|
return doneCallback(void 0, mappedFilePath);
|
|
@@ -9173,9 +9173,9 @@ var require_node2 = __commonJS({
|
|
|
9173
9173
|
}
|
|
9174
9174
|
var tryPath = tryPaths[index4];
|
|
9175
9175
|
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
9176
|
-
fileExists(tryPath.path, function(
|
|
9177
|
-
if (
|
|
9178
|
-
return doneCallback(
|
|
9176
|
+
fileExists(tryPath.path, function(err2, exists) {
|
|
9177
|
+
if (err2) {
|
|
9178
|
+
return doneCallback(err2);
|
|
9179
9179
|
}
|
|
9180
9180
|
if (exists) {
|
|
9181
9181
|
return doneCallback(void 0, TryPath.getStrippedPath(tryPath));
|
|
@@ -9186,9 +9186,9 @@ var require_node2 = __commonJS({
|
|
|
9186
9186
|
return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index4 + 1, mainFields);
|
|
9187
9187
|
});
|
|
9188
9188
|
} else if (tryPath.type === "package") {
|
|
9189
|
-
readJson(tryPath.path, function(
|
|
9190
|
-
if (
|
|
9191
|
-
return doneCallback(
|
|
9189
|
+
readJson(tryPath.path, function(err2, packageJson) {
|
|
9190
|
+
if (err2) {
|
|
9191
|
+
return doneCallback(err2);
|
|
9192
9192
|
}
|
|
9193
9193
|
if (packageJson) {
|
|
9194
9194
|
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists, function(mainFieldErr, mainFieldMappedFile) {
|
|
@@ -9804,9 +9804,9 @@ var require_node2 = __commonJS({
|
|
|
9804
9804
|
}
|
|
9805
9805
|
read();
|
|
9806
9806
|
}
|
|
9807
|
-
} catch (
|
|
9807
|
+
} catch (err2) {
|
|
9808
9808
|
_didIteratorError = true;
|
|
9809
|
-
_iteratorError =
|
|
9809
|
+
_iteratorError = err2;
|
|
9810
9810
|
} finally {
|
|
9811
9811
|
try {
|
|
9812
9812
|
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
@@ -10052,10 +10052,10 @@ var require_node2 = __commonJS({
|
|
|
10052
10052
|
return c2;
|
|
10053
10053
|
}
|
|
10054
10054
|
function syntaxError(message) {
|
|
10055
|
-
var
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
return
|
|
10055
|
+
var err2 = new SyntaxError(message);
|
|
10056
|
+
err2.lineNumber = line;
|
|
10057
|
+
err2.columnNumber = column5;
|
|
10058
|
+
return err2;
|
|
10059
10059
|
}
|
|
10060
10060
|
module22.exports = exports2["default"];
|
|
10061
10061
|
});
|
|
@@ -10117,9 +10117,9 @@ var require_node2 = __commonJS({
|
|
|
10117
10117
|
propertyList.push(item);
|
|
10118
10118
|
}
|
|
10119
10119
|
}
|
|
10120
|
-
} catch (
|
|
10120
|
+
} catch (err2) {
|
|
10121
10121
|
_didIteratorError = true;
|
|
10122
|
-
_iteratorError =
|
|
10122
|
+
_iteratorError = err2;
|
|
10123
10123
|
} finally {
|
|
10124
10124
|
try {
|
|
10125
10125
|
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
@@ -10212,9 +10212,9 @@ var require_node2 = __commonJS({
|
|
|
10212
10212
|
}
|
|
10213
10213
|
product += c;
|
|
10214
10214
|
}
|
|
10215
|
-
} catch (
|
|
10215
|
+
} catch (err2) {
|
|
10216
10216
|
_didIteratorError2 = true;
|
|
10217
|
-
_iteratorError2 =
|
|
10217
|
+
_iteratorError2 = err2;
|
|
10218
10218
|
} finally {
|
|
10219
10219
|
try {
|
|
10220
10220
|
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
@@ -10257,9 +10257,9 @@ var require_node2 = __commonJS({
|
|
|
10257
10257
|
partial.push(member);
|
|
10258
10258
|
}
|
|
10259
10259
|
}
|
|
10260
|
-
} catch (
|
|
10260
|
+
} catch (err2) {
|
|
10261
10261
|
_didIteratorError3 = true;
|
|
10262
|
-
_iteratorError3 =
|
|
10262
|
+
_iteratorError3 = err2;
|
|
10263
10263
|
} finally {
|
|
10264
10264
|
try {
|
|
10265
10265
|
if (!_iteratorNormalCompletion3 && _iterator3.return) {
|
|
@@ -11060,9 +11060,9 @@ var require_node2 = __commonJS({
|
|
|
11060
11060
|
debug("%s", js);
|
|
11061
11061
|
const warnings = result.warnings;
|
|
11062
11062
|
if (warnings && warnings.length > 0) {
|
|
11063
|
-
for (const
|
|
11064
|
-
console.log(
|
|
11065
|
-
console.log(
|
|
11063
|
+
for (const warning2 of warnings) {
|
|
11064
|
+
console.log(warning2.location);
|
|
11065
|
+
console.log(warning2.text);
|
|
11066
11066
|
}
|
|
11067
11067
|
}
|
|
11068
11068
|
if (format === "esm")
|
|
@@ -14538,7 +14538,7 @@ var init_migrate = __esm({
|
|
|
14538
14538
|
init_pgSchema();
|
|
14539
14539
|
init_sqliteSchema();
|
|
14540
14540
|
init_mysqlSchema();
|
|
14541
|
-
|
|
14541
|
+
init_utils5();
|
|
14542
14542
|
init_words();
|
|
14543
14543
|
init_outputs();
|
|
14544
14544
|
prepareAndMigratePg = async (config) => {
|
|
@@ -16912,7 +16912,7 @@ var init_snapshotsDiffer = __esm({
|
|
|
16912
16912
|
init_lib();
|
|
16913
16913
|
init_jsonDiffer();
|
|
16914
16914
|
init_jsonStatements();
|
|
16915
|
-
|
|
16915
|
+
init_utils5();
|
|
16916
16916
|
init_sqliteSchema();
|
|
16917
16917
|
init_mysqlSchema();
|
|
16918
16918
|
makeChanged = (schema4) => {
|
|
@@ -17531,7 +17531,7 @@ var init_pgUp = __esm({
|
|
|
17531
17531
|
init_source();
|
|
17532
17532
|
init_global();
|
|
17533
17533
|
init_pgSchema();
|
|
17534
|
-
|
|
17534
|
+
init_utils5();
|
|
17535
17535
|
}
|
|
17536
17536
|
});
|
|
17537
17537
|
|
|
@@ -17540,7 +17540,7 @@ var init_mysqlUp = __esm({
|
|
|
17540
17540
|
"src/cli/commands/mysqlUp.ts"() {
|
|
17541
17541
|
init_source();
|
|
17542
17542
|
init_mysqlSchema();
|
|
17543
|
-
|
|
17543
|
+
init_utils5();
|
|
17544
17544
|
}
|
|
17545
17545
|
});
|
|
17546
17546
|
|
|
@@ -17552,7 +17552,7 @@ var init_upFolders = __esm({
|
|
|
17552
17552
|
init_mysqlSchema();
|
|
17553
17553
|
init_sqliteSchema();
|
|
17554
17554
|
init_snapshotsDiffer();
|
|
17555
|
-
|
|
17555
|
+
init_utils5();
|
|
17556
17556
|
init_words();
|
|
17557
17557
|
init_pgUp();
|
|
17558
17558
|
init_pgSchema();
|
|
@@ -20582,9 +20582,9 @@ var require_pg_types = __commonJS({
|
|
|
20582
20582
|
}
|
|
20583
20583
|
});
|
|
20584
20584
|
|
|
20585
|
-
// node_modules/.pnpm/pg@8.
|
|
20585
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/defaults.js
|
|
20586
20586
|
var require_defaults = __commonJS({
|
|
20587
|
-
"node_modules/.pnpm/pg@8.
|
|
20587
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/defaults.js"(exports, module2) {
|
|
20588
20588
|
"use strict";
|
|
20589
20589
|
module2.exports = {
|
|
20590
20590
|
// database host. defaults to localhost
|
|
@@ -20644,11 +20644,10 @@ var require_defaults = __commonJS({
|
|
|
20644
20644
|
}
|
|
20645
20645
|
});
|
|
20646
20646
|
|
|
20647
|
-
// node_modules/.pnpm/pg@8.
|
|
20647
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/utils.js
|
|
20648
20648
|
var require_utils2 = __commonJS({
|
|
20649
|
-
"node_modules/.pnpm/pg@8.
|
|
20649
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/utils.js"(exports, module2) {
|
|
20650
20650
|
"use strict";
|
|
20651
|
-
var crypto = require("crypto");
|
|
20652
20651
|
var defaults3 = require_defaults();
|
|
20653
20652
|
function escapeElement(elementRepresentation) {
|
|
20654
20653
|
var escaped = elementRepresentation.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
@@ -20763,30 +20762,138 @@ var require_utils2 = __commonJS({
|
|
|
20763
20762
|
}
|
|
20764
20763
|
return config;
|
|
20765
20764
|
}
|
|
20766
|
-
var
|
|
20767
|
-
return
|
|
20765
|
+
var escapeIdentifier = function(str) {
|
|
20766
|
+
return '"' + str.replace(/"/g, '""') + '"';
|
|
20768
20767
|
};
|
|
20769
|
-
var
|
|
20770
|
-
var
|
|
20771
|
-
var
|
|
20772
|
-
|
|
20768
|
+
var escapeLiteral = function(str) {
|
|
20769
|
+
var hasBackslash = false;
|
|
20770
|
+
var escaped = "'";
|
|
20771
|
+
for (var i = 0; i < str.length; i++) {
|
|
20772
|
+
var c = str[i];
|
|
20773
|
+
if (c === "'") {
|
|
20774
|
+
escaped += c + c;
|
|
20775
|
+
} else if (c === "\\") {
|
|
20776
|
+
escaped += c + c;
|
|
20777
|
+
hasBackslash = true;
|
|
20778
|
+
} else {
|
|
20779
|
+
escaped += c;
|
|
20780
|
+
}
|
|
20781
|
+
}
|
|
20782
|
+
escaped += "'";
|
|
20783
|
+
if (hasBackslash === true) {
|
|
20784
|
+
escaped = " E" + escaped;
|
|
20785
|
+
}
|
|
20786
|
+
return escaped;
|
|
20773
20787
|
};
|
|
20774
20788
|
module2.exports = {
|
|
20775
20789
|
prepareValue: function prepareValueWrapper(value) {
|
|
20776
20790
|
return prepareValue(value);
|
|
20777
20791
|
},
|
|
20778
20792
|
normalizeQueryConfig,
|
|
20793
|
+
escapeIdentifier,
|
|
20794
|
+
escapeLiteral
|
|
20795
|
+
};
|
|
20796
|
+
}
|
|
20797
|
+
});
|
|
20798
|
+
|
|
20799
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/utils-legacy.js
|
|
20800
|
+
var require_utils_legacy = __commonJS({
|
|
20801
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/utils-legacy.js"(exports, module2) {
|
|
20802
|
+
"use strict";
|
|
20803
|
+
var nodeCrypto = require("crypto");
|
|
20804
|
+
function md5(string) {
|
|
20805
|
+
return nodeCrypto.createHash("md5").update(string, "utf-8").digest("hex");
|
|
20806
|
+
}
|
|
20807
|
+
function postgresMd5PasswordHash(user, password, salt) {
|
|
20808
|
+
var inner = md5(password + user);
|
|
20809
|
+
var outer = md5(Buffer.concat([Buffer.from(inner), salt]));
|
|
20810
|
+
return "md5" + outer;
|
|
20811
|
+
}
|
|
20812
|
+
function sha256(text) {
|
|
20813
|
+
return nodeCrypto.createHash("sha256").update(text).digest();
|
|
20814
|
+
}
|
|
20815
|
+
function hmacSha256(key, msg) {
|
|
20816
|
+
return nodeCrypto.createHmac("sha256", key).update(msg).digest();
|
|
20817
|
+
}
|
|
20818
|
+
async function deriveKey(password, salt, iterations) {
|
|
20819
|
+
return nodeCrypto.pbkdf2Sync(password, salt, iterations, 32, "sha256");
|
|
20820
|
+
}
|
|
20821
|
+
module2.exports = {
|
|
20779
20822
|
postgresMd5PasswordHash,
|
|
20823
|
+
randomBytes: nodeCrypto.randomBytes,
|
|
20824
|
+
deriveKey,
|
|
20825
|
+
sha256,
|
|
20826
|
+
hmacSha256,
|
|
20780
20827
|
md5
|
|
20781
20828
|
};
|
|
20782
20829
|
}
|
|
20783
20830
|
});
|
|
20784
20831
|
|
|
20785
|
-
// node_modules/.pnpm/pg@8.
|
|
20832
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/utils-webcrypto.js
|
|
20833
|
+
var require_utils_webcrypto = __commonJS({
|
|
20834
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/utils-webcrypto.js"(exports, module2) {
|
|
20835
|
+
var nodeCrypto = require("crypto");
|
|
20836
|
+
module2.exports = {
|
|
20837
|
+
postgresMd5PasswordHash,
|
|
20838
|
+
randomBytes,
|
|
20839
|
+
deriveKey,
|
|
20840
|
+
sha256,
|
|
20841
|
+
hmacSha256,
|
|
20842
|
+
md5
|
|
20843
|
+
};
|
|
20844
|
+
var webCrypto = nodeCrypto.webcrypto || globalThis.crypto;
|
|
20845
|
+
var subtleCrypto = webCrypto.subtle;
|
|
20846
|
+
var textEncoder = new TextEncoder();
|
|
20847
|
+
function randomBytes(length) {
|
|
20848
|
+
return webCrypto.getRandomValues(Buffer.alloc(length));
|
|
20849
|
+
}
|
|
20850
|
+
async function md5(string) {
|
|
20851
|
+
try {
|
|
20852
|
+
return nodeCrypto.createHash("md5").update(string, "utf-8").digest("hex");
|
|
20853
|
+
} catch (e) {
|
|
20854
|
+
const data = typeof string === "string" ? textEncoder.encode(string) : string;
|
|
20855
|
+
const hash = await subtleCrypto.digest("MD5", data);
|
|
20856
|
+
return Array.from(new Uint8Array(hash)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
20857
|
+
}
|
|
20858
|
+
}
|
|
20859
|
+
async function postgresMd5PasswordHash(user, password, salt) {
|
|
20860
|
+
var inner = await md5(password + user);
|
|
20861
|
+
var outer = await md5(Buffer.concat([Buffer.from(inner), salt]));
|
|
20862
|
+
return "md5" + outer;
|
|
20863
|
+
}
|
|
20864
|
+
async function sha256(text) {
|
|
20865
|
+
return await subtleCrypto.digest("SHA-256", text);
|
|
20866
|
+
}
|
|
20867
|
+
async function hmacSha256(keyBuffer, msg) {
|
|
20868
|
+
const key = await subtleCrypto.importKey("raw", keyBuffer, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
20869
|
+
return await subtleCrypto.sign("HMAC", key, textEncoder.encode(msg));
|
|
20870
|
+
}
|
|
20871
|
+
async function deriveKey(password, salt, iterations) {
|
|
20872
|
+
const key = await subtleCrypto.importKey("raw", textEncoder.encode(password), "PBKDF2", false, ["deriveBits"]);
|
|
20873
|
+
const params = { name: "PBKDF2", hash: "SHA-256", salt, iterations };
|
|
20874
|
+
return await subtleCrypto.deriveBits(params, key, 32 * 8, ["deriveBits"]);
|
|
20875
|
+
}
|
|
20876
|
+
}
|
|
20877
|
+
});
|
|
20878
|
+
|
|
20879
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/utils.js
|
|
20880
|
+
var require_utils3 = __commonJS({
|
|
20881
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/utils.js"(exports, module2) {
|
|
20882
|
+
"use strict";
|
|
20883
|
+
var useLegacyCrypto = parseInt(process.versions && process.versions.node && process.versions.node.split(".")[0]) < 15;
|
|
20884
|
+
if (useLegacyCrypto) {
|
|
20885
|
+
module2.exports = require_utils_legacy();
|
|
20886
|
+
} else {
|
|
20887
|
+
module2.exports = require_utils_webcrypto();
|
|
20888
|
+
}
|
|
20889
|
+
}
|
|
20890
|
+
});
|
|
20891
|
+
|
|
20892
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/sasl.js
|
|
20786
20893
|
var require_sasl = __commonJS({
|
|
20787
|
-
"node_modules/.pnpm/pg@8.
|
|
20894
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/crypto/sasl.js"(exports, module2) {
|
|
20788
20895
|
"use strict";
|
|
20789
|
-
var crypto =
|
|
20896
|
+
var crypto = require_utils3();
|
|
20790
20897
|
function startSession(mechanisms) {
|
|
20791
20898
|
if (mechanisms.indexOf("SCRAM-SHA-256") === -1) {
|
|
20792
20899
|
throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");
|
|
@@ -20799,13 +20906,16 @@ var require_sasl = __commonJS({
|
|
|
20799
20906
|
message: "SASLInitialResponse"
|
|
20800
20907
|
};
|
|
20801
20908
|
}
|
|
20802
|
-
function continueSession(session, password, serverData) {
|
|
20909
|
+
async function continueSession(session, password, serverData) {
|
|
20803
20910
|
if (session.message !== "SASLInitialResponse") {
|
|
20804
20911
|
throw new Error("SASL: Last message was not SASLInitialResponse");
|
|
20805
20912
|
}
|
|
20806
20913
|
if (typeof password !== "string") {
|
|
20807
20914
|
throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");
|
|
20808
20915
|
}
|
|
20916
|
+
if (password === "") {
|
|
20917
|
+
throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");
|
|
20918
|
+
}
|
|
20809
20919
|
if (typeof serverData !== "string") {
|
|
20810
20920
|
throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");
|
|
20811
20921
|
}
|
|
@@ -20815,21 +20925,20 @@ var require_sasl = __commonJS({
|
|
|
20815
20925
|
} else if (sv.nonce.length === session.clientNonce.length) {
|
|
20816
20926
|
throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");
|
|
20817
20927
|
}
|
|
20818
|
-
var saltBytes = Buffer.from(sv.salt, "base64");
|
|
20819
|
-
var saltedPassword = Hi(password, saltBytes, sv.iteration);
|
|
20820
|
-
var clientKey = hmacSha256(saltedPassword, "Client Key");
|
|
20821
|
-
var storedKey = sha256(clientKey);
|
|
20822
20928
|
var clientFirstMessageBare = "n=*,r=" + session.clientNonce;
|
|
20823
20929
|
var serverFirstMessage = "r=" + sv.nonce + ",s=" + sv.salt + ",i=" + sv.iteration;
|
|
20824
20930
|
var clientFinalMessageWithoutProof = "c=biws,r=" + sv.nonce;
|
|
20825
20931
|
var authMessage = clientFirstMessageBare + "," + serverFirstMessage + "," + clientFinalMessageWithoutProof;
|
|
20826
|
-
var
|
|
20827
|
-
var
|
|
20828
|
-
var
|
|
20829
|
-
var
|
|
20830
|
-
var
|
|
20932
|
+
var saltBytes = Buffer.from(sv.salt, "base64");
|
|
20933
|
+
var saltedPassword = await crypto.deriveKey(password, saltBytes, sv.iteration);
|
|
20934
|
+
var clientKey = await crypto.hmacSha256(saltedPassword, "Client Key");
|
|
20935
|
+
var storedKey = await crypto.sha256(clientKey);
|
|
20936
|
+
var clientSignature = await crypto.hmacSha256(storedKey, authMessage);
|
|
20937
|
+
var clientProof = xorBuffers(Buffer.from(clientKey), Buffer.from(clientSignature)).toString("base64");
|
|
20938
|
+
var serverKey = await crypto.hmacSha256(saltedPassword, "Server Key");
|
|
20939
|
+
var serverSignatureBytes = await crypto.hmacSha256(serverKey, authMessage);
|
|
20831
20940
|
session.message = "SASLResponse";
|
|
20832
|
-
session.serverSignature = serverSignatureBytes.toString("base64");
|
|
20941
|
+
session.serverSignature = Buffer.from(serverSignatureBytes).toString("base64");
|
|
20833
20942
|
session.response = clientFinalMessageWithoutProof + ",p=" + clientProof;
|
|
20834
20943
|
}
|
|
20835
20944
|
function finalizeSession(session, serverData) {
|
|
@@ -20922,21 +21031,6 @@ var require_sasl = __commonJS({
|
|
|
20922
21031
|
}
|
|
20923
21032
|
return Buffer.from(a.map((_, i) => a[i] ^ b[i]));
|
|
20924
21033
|
}
|
|
20925
|
-
function sha256(text) {
|
|
20926
|
-
return crypto.createHash("sha256").update(text).digest();
|
|
20927
|
-
}
|
|
20928
|
-
function hmacSha256(key, msg) {
|
|
20929
|
-
return crypto.createHmac("sha256", key).update(msg).digest();
|
|
20930
|
-
}
|
|
20931
|
-
function Hi(password, saltBytes, iterations) {
|
|
20932
|
-
var ui1 = hmacSha256(password, Buffer.concat([saltBytes, Buffer.from([0, 0, 0, 1])]));
|
|
20933
|
-
var ui = ui1;
|
|
20934
|
-
for (var i = 0; i < iterations - 1; i++) {
|
|
20935
|
-
ui1 = hmacSha256(password, ui1);
|
|
20936
|
-
ui = xorBuffers(ui, ui1);
|
|
20937
|
-
}
|
|
20938
|
-
return ui;
|
|
20939
|
-
}
|
|
20940
21034
|
module2.exports = {
|
|
20941
21035
|
startSession,
|
|
20942
21036
|
continueSession,
|
|
@@ -20945,303 +21039,9 @@ var require_sasl = __commonJS({
|
|
|
20945
21039
|
}
|
|
20946
21040
|
});
|
|
20947
21041
|
|
|
20948
|
-
// node_modules/.pnpm/
|
|
20949
|
-
var require_split2 = __commonJS({
|
|
20950
|
-
"node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js"(exports, module2) {
|
|
20951
|
-
"use strict";
|
|
20952
|
-
var { Transform: Transform2 } = require("stream");
|
|
20953
|
-
var { StringDecoder } = require("string_decoder");
|
|
20954
|
-
var kLast = Symbol("last");
|
|
20955
|
-
var kDecoder = Symbol("decoder");
|
|
20956
|
-
function transform(chunk, enc, cb) {
|
|
20957
|
-
let list;
|
|
20958
|
-
if (this.overflow) {
|
|
20959
|
-
const buf = this[kDecoder].write(chunk);
|
|
20960
|
-
list = buf.split(this.matcher);
|
|
20961
|
-
if (list.length === 1)
|
|
20962
|
-
return cb();
|
|
20963
|
-
list.shift();
|
|
20964
|
-
this.overflow = false;
|
|
20965
|
-
} else {
|
|
20966
|
-
this[kLast] += this[kDecoder].write(chunk);
|
|
20967
|
-
list = this[kLast].split(this.matcher);
|
|
20968
|
-
}
|
|
20969
|
-
this[kLast] = list.pop();
|
|
20970
|
-
for (let i = 0; i < list.length; i++) {
|
|
20971
|
-
try {
|
|
20972
|
-
push(this, this.mapper(list[i]));
|
|
20973
|
-
} catch (error2) {
|
|
20974
|
-
return cb(error2);
|
|
20975
|
-
}
|
|
20976
|
-
}
|
|
20977
|
-
this.overflow = this[kLast].length > this.maxLength;
|
|
20978
|
-
if (this.overflow && !this.skipOverflow) {
|
|
20979
|
-
cb(new Error("maximum buffer reached"));
|
|
20980
|
-
return;
|
|
20981
|
-
}
|
|
20982
|
-
cb();
|
|
20983
|
-
}
|
|
20984
|
-
function flush(cb) {
|
|
20985
|
-
this[kLast] += this[kDecoder].end();
|
|
20986
|
-
if (this[kLast]) {
|
|
20987
|
-
try {
|
|
20988
|
-
push(this, this.mapper(this[kLast]));
|
|
20989
|
-
} catch (error2) {
|
|
20990
|
-
return cb(error2);
|
|
20991
|
-
}
|
|
20992
|
-
}
|
|
20993
|
-
cb();
|
|
20994
|
-
}
|
|
20995
|
-
function push(self2, val) {
|
|
20996
|
-
if (val !== void 0) {
|
|
20997
|
-
self2.push(val);
|
|
20998
|
-
}
|
|
20999
|
-
}
|
|
21000
|
-
function noop2(incoming) {
|
|
21001
|
-
return incoming;
|
|
21002
|
-
}
|
|
21003
|
-
function split(matcher, mapper, options) {
|
|
21004
|
-
matcher = matcher || /\r?\n/;
|
|
21005
|
-
mapper = mapper || noop2;
|
|
21006
|
-
options = options || {};
|
|
21007
|
-
switch (arguments.length) {
|
|
21008
|
-
case 1:
|
|
21009
|
-
if (typeof matcher === "function") {
|
|
21010
|
-
mapper = matcher;
|
|
21011
|
-
matcher = /\r?\n/;
|
|
21012
|
-
} else if (typeof matcher === "object" && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
|
|
21013
|
-
options = matcher;
|
|
21014
|
-
matcher = /\r?\n/;
|
|
21015
|
-
}
|
|
21016
|
-
break;
|
|
21017
|
-
case 2:
|
|
21018
|
-
if (typeof matcher === "function") {
|
|
21019
|
-
options = mapper;
|
|
21020
|
-
mapper = matcher;
|
|
21021
|
-
matcher = /\r?\n/;
|
|
21022
|
-
} else if (typeof mapper === "object") {
|
|
21023
|
-
options = mapper;
|
|
21024
|
-
mapper = noop2;
|
|
21025
|
-
}
|
|
21026
|
-
}
|
|
21027
|
-
options = Object.assign({}, options);
|
|
21028
|
-
options.autoDestroy = true;
|
|
21029
|
-
options.transform = transform;
|
|
21030
|
-
options.flush = flush;
|
|
21031
|
-
options.readableObjectMode = true;
|
|
21032
|
-
const stream = new Transform2(options);
|
|
21033
|
-
stream[kLast] = "";
|
|
21034
|
-
stream[kDecoder] = new StringDecoder("utf8");
|
|
21035
|
-
stream.matcher = matcher;
|
|
21036
|
-
stream.mapper = mapper;
|
|
21037
|
-
stream.maxLength = options.maxLength;
|
|
21038
|
-
stream.skipOverflow = options.skipOverflow || false;
|
|
21039
|
-
stream.overflow = false;
|
|
21040
|
-
stream._destroy = function(err, cb) {
|
|
21041
|
-
this._writableState.errorEmitted = false;
|
|
21042
|
-
cb(err);
|
|
21043
|
-
};
|
|
21044
|
-
return stream;
|
|
21045
|
-
}
|
|
21046
|
-
module2.exports = split;
|
|
21047
|
-
}
|
|
21048
|
-
});
|
|
21049
|
-
|
|
21050
|
-
// node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/helper.js
|
|
21051
|
-
var require_helper = __commonJS({
|
|
21052
|
-
"node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/helper.js"(exports, module2) {
|
|
21053
|
-
"use strict";
|
|
21054
|
-
var path4 = require("path");
|
|
21055
|
-
var Stream = require("stream").Stream;
|
|
21056
|
-
var split = require_split2();
|
|
21057
|
-
var util2 = require("util");
|
|
21058
|
-
var defaultPort = 5432;
|
|
21059
|
-
var isWin = process.platform === "win32";
|
|
21060
|
-
var warnStream = process.stderr;
|
|
21061
|
-
var S_IRWXG = 56;
|
|
21062
|
-
var S_IRWXO = 7;
|
|
21063
|
-
var S_IFMT = 61440;
|
|
21064
|
-
var S_IFREG = 32768;
|
|
21065
|
-
function isRegFile(mode) {
|
|
21066
|
-
return (mode & S_IFMT) == S_IFREG;
|
|
21067
|
-
}
|
|
21068
|
-
var fieldNames = ["host", "port", "database", "user", "password"];
|
|
21069
|
-
var nrOfFields = fieldNames.length;
|
|
21070
|
-
var passKey = fieldNames[nrOfFields - 1];
|
|
21071
|
-
function warn() {
|
|
21072
|
-
var isWritable = warnStream instanceof Stream && true === warnStream.writable;
|
|
21073
|
-
if (isWritable) {
|
|
21074
|
-
var args = Array.prototype.slice.call(arguments).concat("\n");
|
|
21075
|
-
warnStream.write(util2.format.apply(util2, args));
|
|
21076
|
-
}
|
|
21077
|
-
}
|
|
21078
|
-
Object.defineProperty(module2.exports, "isWin", {
|
|
21079
|
-
get: function() {
|
|
21080
|
-
return isWin;
|
|
21081
|
-
},
|
|
21082
|
-
set: function(val) {
|
|
21083
|
-
isWin = val;
|
|
21084
|
-
}
|
|
21085
|
-
});
|
|
21086
|
-
module2.exports.warnTo = function(stream) {
|
|
21087
|
-
var old = warnStream;
|
|
21088
|
-
warnStream = stream;
|
|
21089
|
-
return old;
|
|
21090
|
-
};
|
|
21091
|
-
module2.exports.getFileName = function(rawEnv) {
|
|
21092
|
-
var env2 = rawEnv || process.env;
|
|
21093
|
-
var file = env2.PGPASSFILE || (isWin ? path4.join(env2.APPDATA || "./", "postgresql", "pgpass.conf") : path4.join(env2.HOME || "./", ".pgpass"));
|
|
21094
|
-
return file;
|
|
21095
|
-
};
|
|
21096
|
-
module2.exports.usePgPass = function(stats, fname) {
|
|
21097
|
-
if (Object.prototype.hasOwnProperty.call(process.env, "PGPASSWORD")) {
|
|
21098
|
-
return false;
|
|
21099
|
-
}
|
|
21100
|
-
if (isWin) {
|
|
21101
|
-
return true;
|
|
21102
|
-
}
|
|
21103
|
-
fname = fname || "<unkn>";
|
|
21104
|
-
if (!isRegFile(stats.mode)) {
|
|
21105
|
-
warn('WARNING: password file "%s" is not a plain file', fname);
|
|
21106
|
-
return false;
|
|
21107
|
-
}
|
|
21108
|
-
if (stats.mode & (S_IRWXG | S_IRWXO)) {
|
|
21109
|
-
warn('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less', fname);
|
|
21110
|
-
return false;
|
|
21111
|
-
}
|
|
21112
|
-
return true;
|
|
21113
|
-
};
|
|
21114
|
-
var matcher = module2.exports.match = function(connInfo, entry) {
|
|
21115
|
-
return fieldNames.slice(0, -1).reduce(function(prev, field, idx) {
|
|
21116
|
-
if (idx == 1) {
|
|
21117
|
-
if (Number(connInfo[field] || defaultPort) === Number(entry[field])) {
|
|
21118
|
-
return prev && true;
|
|
21119
|
-
}
|
|
21120
|
-
}
|
|
21121
|
-
return prev && (entry[field] === "*" || entry[field] === connInfo[field]);
|
|
21122
|
-
}, true);
|
|
21123
|
-
};
|
|
21124
|
-
module2.exports.getPassword = function(connInfo, stream, cb) {
|
|
21125
|
-
var pass;
|
|
21126
|
-
var lineStream = stream.pipe(split());
|
|
21127
|
-
function onLine(line) {
|
|
21128
|
-
var entry = parseLine(line);
|
|
21129
|
-
if (entry && isValidEntry(entry) && matcher(connInfo, entry)) {
|
|
21130
|
-
pass = entry[passKey];
|
|
21131
|
-
lineStream.end();
|
|
21132
|
-
}
|
|
21133
|
-
}
|
|
21134
|
-
var onEnd = function() {
|
|
21135
|
-
stream.destroy();
|
|
21136
|
-
cb(pass);
|
|
21137
|
-
};
|
|
21138
|
-
var onErr = function(err) {
|
|
21139
|
-
stream.destroy();
|
|
21140
|
-
warn("WARNING: error on reading file: %s", err);
|
|
21141
|
-
cb(void 0);
|
|
21142
|
-
};
|
|
21143
|
-
stream.on("error", onErr);
|
|
21144
|
-
lineStream.on("data", onLine).on("end", onEnd).on("error", onErr);
|
|
21145
|
-
};
|
|
21146
|
-
var parseLine = module2.exports.parseLine = function(line) {
|
|
21147
|
-
if (line.length < 11 || line.match(/^\s+#/)) {
|
|
21148
|
-
return null;
|
|
21149
|
-
}
|
|
21150
|
-
var curChar = "";
|
|
21151
|
-
var prevChar = "";
|
|
21152
|
-
var fieldIdx = 0;
|
|
21153
|
-
var startIdx = 0;
|
|
21154
|
-
var endIdx = 0;
|
|
21155
|
-
var obj = {};
|
|
21156
|
-
var isLastField = false;
|
|
21157
|
-
var addToObj = function(idx, i0, i1) {
|
|
21158
|
-
var field = line.substring(i0, i1);
|
|
21159
|
-
if (!Object.hasOwnProperty.call(process.env, "PGPASS_NO_DEESCAPE")) {
|
|
21160
|
-
field = field.replace(/\\([:\\])/g, "$1");
|
|
21161
|
-
}
|
|
21162
|
-
obj[fieldNames[idx]] = field;
|
|
21163
|
-
};
|
|
21164
|
-
for (var i = 0; i < line.length - 1; i += 1) {
|
|
21165
|
-
curChar = line.charAt(i + 1);
|
|
21166
|
-
prevChar = line.charAt(i);
|
|
21167
|
-
isLastField = fieldIdx == nrOfFields - 1;
|
|
21168
|
-
if (isLastField) {
|
|
21169
|
-
addToObj(fieldIdx, startIdx);
|
|
21170
|
-
break;
|
|
21171
|
-
}
|
|
21172
|
-
if (i >= 0 && curChar == ":" && prevChar !== "\\") {
|
|
21173
|
-
addToObj(fieldIdx, startIdx, i + 1);
|
|
21174
|
-
startIdx = i + 2;
|
|
21175
|
-
fieldIdx += 1;
|
|
21176
|
-
}
|
|
21177
|
-
}
|
|
21178
|
-
obj = Object.keys(obj).length === nrOfFields ? obj : null;
|
|
21179
|
-
return obj;
|
|
21180
|
-
};
|
|
21181
|
-
var isValidEntry = module2.exports.isValidEntry = function(entry) {
|
|
21182
|
-
var rules = {
|
|
21183
|
-
// host
|
|
21184
|
-
0: function(x) {
|
|
21185
|
-
return x.length > 0;
|
|
21186
|
-
},
|
|
21187
|
-
// port
|
|
21188
|
-
1: function(x) {
|
|
21189
|
-
if (x === "*") {
|
|
21190
|
-
return true;
|
|
21191
|
-
}
|
|
21192
|
-
x = Number(x);
|
|
21193
|
-
return isFinite(x) && x > 0 && x < 9007199254740992 && Math.floor(x) === x;
|
|
21194
|
-
},
|
|
21195
|
-
// database
|
|
21196
|
-
2: function(x) {
|
|
21197
|
-
return x.length > 0;
|
|
21198
|
-
},
|
|
21199
|
-
// username
|
|
21200
|
-
3: function(x) {
|
|
21201
|
-
return x.length > 0;
|
|
21202
|
-
},
|
|
21203
|
-
// password
|
|
21204
|
-
4: function(x) {
|
|
21205
|
-
return x.length > 0;
|
|
21206
|
-
}
|
|
21207
|
-
};
|
|
21208
|
-
for (var idx = 0; idx < fieldNames.length; idx += 1) {
|
|
21209
|
-
var rule = rules[idx];
|
|
21210
|
-
var value = entry[fieldNames[idx]] || "";
|
|
21211
|
-
var res = rule(value);
|
|
21212
|
-
if (!res) {
|
|
21213
|
-
return false;
|
|
21214
|
-
}
|
|
21215
|
-
}
|
|
21216
|
-
return true;
|
|
21217
|
-
};
|
|
21218
|
-
}
|
|
21219
|
-
});
|
|
21220
|
-
|
|
21221
|
-
// node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js
|
|
21222
|
-
var require_lib = __commonJS({
|
|
21223
|
-
"node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js"(exports, module2) {
|
|
21224
|
-
"use strict";
|
|
21225
|
-
var path4 = require("path");
|
|
21226
|
-
var fs6 = require("fs");
|
|
21227
|
-
var helper = require_helper();
|
|
21228
|
-
module2.exports = function(connInfo, cb) {
|
|
21229
|
-
var file = helper.getFileName();
|
|
21230
|
-
fs6.stat(file, function(err, stat) {
|
|
21231
|
-
if (err || !helper.usePgPass(stat, file)) {
|
|
21232
|
-
return cb(void 0);
|
|
21233
|
-
}
|
|
21234
|
-
var st = fs6.createReadStream(file);
|
|
21235
|
-
helper.getPassword(connInfo, st, cb);
|
|
21236
|
-
});
|
|
21237
|
-
};
|
|
21238
|
-
module2.exports.warnTo = helper.warnTo;
|
|
21239
|
-
}
|
|
21240
|
-
});
|
|
21241
|
-
|
|
21242
|
-
// node_modules/.pnpm/pg@8.8.0/node_modules/pg/lib/type-overrides.js
|
|
21042
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/type-overrides.js
|
|
21243
21043
|
var require_type_overrides = __commonJS({
|
|
21244
|
-
"node_modules/.pnpm/pg@8.
|
|
21044
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/type-overrides.js"(exports, module2) {
|
|
21245
21045
|
"use strict";
|
|
21246
21046
|
var types = require_pg_types();
|
|
21247
21047
|
function TypeOverrides(userTypes) {
|
|
@@ -21359,9 +21159,9 @@ var require_pg_connection_string = __commonJS({
|
|
|
21359
21159
|
}
|
|
21360
21160
|
});
|
|
21361
21161
|
|
|
21362
|
-
// node_modules/.pnpm/pg@8.
|
|
21162
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/connection-parameters.js
|
|
21363
21163
|
var require_connection_parameters = __commonJS({
|
|
21364
|
-
"node_modules/.pnpm/pg@8.
|
|
21164
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/connection-parameters.js"(exports, module2) {
|
|
21365
21165
|
"use strict";
|
|
21366
21166
|
var dns = require("dns");
|
|
21367
21167
|
var defaults3 = require_defaults();
|
|
@@ -21486,9 +21286,9 @@ var require_connection_parameters = __commonJS({
|
|
|
21486
21286
|
if (this.client_encoding) {
|
|
21487
21287
|
params.push("client_encoding=" + quoteParamValue(this.client_encoding));
|
|
21488
21288
|
}
|
|
21489
|
-
dns.lookup(this.host, function(
|
|
21490
|
-
if (
|
|
21491
|
-
return cb(
|
|
21289
|
+
dns.lookup(this.host, function(err2, address) {
|
|
21290
|
+
if (err2)
|
|
21291
|
+
return cb(err2, null);
|
|
21492
21292
|
params.push("hostaddr=" + quoteParamValue(address));
|
|
21493
21293
|
return cb(null, params.join(" "));
|
|
21494
21294
|
});
|
|
@@ -21498,9 +21298,9 @@ var require_connection_parameters = __commonJS({
|
|
|
21498
21298
|
}
|
|
21499
21299
|
});
|
|
21500
21300
|
|
|
21501
|
-
// node_modules/.pnpm/pg@8.
|
|
21301
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/result.js
|
|
21502
21302
|
var require_result = __commonJS({
|
|
21503
|
-
"node_modules/.pnpm/pg@8.
|
|
21303
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/result.js"(exports, module2) {
|
|
21504
21304
|
"use strict";
|
|
21505
21305
|
var types = require_pg_types();
|
|
21506
21306
|
var matchRegexp = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;
|
|
@@ -21518,6 +21318,7 @@ var require_result = __commonJS({
|
|
|
21518
21318
|
if (this.rowAsArray) {
|
|
21519
21319
|
this.parseRow = this._parseRowAsArray;
|
|
21520
21320
|
}
|
|
21321
|
+
this._prebuiltEmptyResultObject = null;
|
|
21521
21322
|
}
|
|
21522
21323
|
// adds a command complete message
|
|
21523
21324
|
addCommandComplete(msg) {
|
|
@@ -21550,14 +21351,12 @@ var require_result = __commonJS({
|
|
|
21550
21351
|
return row;
|
|
21551
21352
|
}
|
|
21552
21353
|
parseRow(rowData) {
|
|
21553
|
-
var row = {};
|
|
21354
|
+
var row = { ...this._prebuiltEmptyResultObject };
|
|
21554
21355
|
for (var i = 0, len = rowData.length; i < len; i++) {
|
|
21555
21356
|
var rawValue = rowData[i];
|
|
21556
21357
|
var field = this.fields[i].name;
|
|
21557
21358
|
if (rawValue !== null) {
|
|
21558
21359
|
row[field] = this._parsers[i](rawValue);
|
|
21559
|
-
} else {
|
|
21560
|
-
row[field] = null;
|
|
21561
21360
|
}
|
|
21562
21361
|
}
|
|
21563
21362
|
return row;
|
|
@@ -21578,15 +21377,23 @@ var require_result = __commonJS({
|
|
|
21578
21377
|
this._parsers[i] = types.getTypeParser(desc.dataTypeID, desc.format || "text");
|
|
21579
21378
|
}
|
|
21580
21379
|
}
|
|
21380
|
+
this._createPrebuiltEmptyResultObject();
|
|
21381
|
+
}
|
|
21382
|
+
_createPrebuiltEmptyResultObject() {
|
|
21383
|
+
var row = {};
|
|
21384
|
+
for (var i = 0; i < this.fields.length; i++) {
|
|
21385
|
+
row[this.fields[i].name] = null;
|
|
21386
|
+
}
|
|
21387
|
+
this._prebuiltEmptyResultObject = { ...row };
|
|
21581
21388
|
}
|
|
21582
21389
|
};
|
|
21583
21390
|
module2.exports = Result;
|
|
21584
21391
|
}
|
|
21585
21392
|
});
|
|
21586
21393
|
|
|
21587
|
-
// node_modules/.pnpm/pg@8.
|
|
21394
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/query.js
|
|
21588
21395
|
var require_query = __commonJS({
|
|
21589
|
-
"node_modules/.pnpm/pg@8.
|
|
21396
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/query.js"(exports, module2) {
|
|
21590
21397
|
"use strict";
|
|
21591
21398
|
var { EventEmitter } = require("events");
|
|
21592
21399
|
var Result = require_result();
|
|
@@ -21652,8 +21459,8 @@ var require_query = __commonJS({
|
|
|
21652
21459
|
}
|
|
21653
21460
|
try {
|
|
21654
21461
|
row = this._result.parseRow(msg.fields);
|
|
21655
|
-
} catch (
|
|
21656
|
-
this._canceledDueToError =
|
|
21462
|
+
} catch (err2) {
|
|
21463
|
+
this._canceledDueToError = err2;
|
|
21657
21464
|
return;
|
|
21658
21465
|
}
|
|
21659
21466
|
this.emit("row", row, this._result);
|
|
@@ -21677,15 +21484,15 @@ var require_query = __commonJS({
|
|
|
21677
21484
|
connection.sync();
|
|
21678
21485
|
}
|
|
21679
21486
|
}
|
|
21680
|
-
handleError(
|
|
21487
|
+
handleError(err2, connection) {
|
|
21681
21488
|
if (this._canceledDueToError) {
|
|
21682
|
-
|
|
21489
|
+
err2 = this._canceledDueToError;
|
|
21683
21490
|
this._canceledDueToError = false;
|
|
21684
21491
|
}
|
|
21685
21492
|
if (this.callback) {
|
|
21686
|
-
return this.callback(
|
|
21493
|
+
return this.callback(err2);
|
|
21687
21494
|
}
|
|
21688
|
-
this.emit("error",
|
|
21495
|
+
this.emit("error", err2);
|
|
21689
21496
|
}
|
|
21690
21497
|
handleReadyForQuery(con) {
|
|
21691
21498
|
if (this._canceledDueToError) {
|
|
@@ -21694,9 +21501,9 @@ var require_query = __commonJS({
|
|
|
21694
21501
|
if (this.callback) {
|
|
21695
21502
|
try {
|
|
21696
21503
|
this.callback(null, this._results);
|
|
21697
|
-
} catch (
|
|
21504
|
+
} catch (err2) {
|
|
21698
21505
|
process.nextTick(() => {
|
|
21699
|
-
throw
|
|
21506
|
+
throw err2;
|
|
21700
21507
|
});
|
|
21701
21508
|
}
|
|
21702
21509
|
}
|
|
@@ -21755,8 +21562,8 @@ var require_query = __commonJS({
|
|
|
21755
21562
|
binary: this.binary,
|
|
21756
21563
|
valueMapper: utils.prepareValue
|
|
21757
21564
|
});
|
|
21758
|
-
} catch (
|
|
21759
|
-
this.handleError(
|
|
21565
|
+
} catch (err2) {
|
|
21566
|
+
this.handleError(err2, connection);
|
|
21760
21567
|
return;
|
|
21761
21568
|
}
|
|
21762
21569
|
connection.describe({
|
|
@@ -22612,13 +22419,50 @@ var require_dist = __commonJS({
|
|
|
22612
22419
|
}
|
|
22613
22420
|
});
|
|
22614
22421
|
|
|
22615
|
-
// node_modules/.pnpm/pg@
|
|
22422
|
+
// node_modules/.pnpm/pg-cloudflare@1.1.1/node_modules/pg-cloudflare/dist/empty.js
|
|
22423
|
+
var empty_exports = {};
|
|
22424
|
+
__export(empty_exports, {
|
|
22425
|
+
default: () => empty_default
|
|
22426
|
+
});
|
|
22427
|
+
var empty_default;
|
|
22428
|
+
var init_empty = __esm({
|
|
22429
|
+
"node_modules/.pnpm/pg-cloudflare@1.1.1/node_modules/pg-cloudflare/dist/empty.js"() {
|
|
22430
|
+
empty_default = {};
|
|
22431
|
+
}
|
|
22432
|
+
});
|
|
22433
|
+
|
|
22434
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/stream.js
|
|
22435
|
+
var require_stream = __commonJS({
|
|
22436
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/stream.js"(exports, module2) {
|
|
22437
|
+
module2.exports.getStream = function getStream(ssl) {
|
|
22438
|
+
const net = require("net");
|
|
22439
|
+
if (typeof net.Socket === "function") {
|
|
22440
|
+
return new net.Socket();
|
|
22441
|
+
} else {
|
|
22442
|
+
const { CloudflareSocket } = (init_empty(), __toCommonJS(empty_exports));
|
|
22443
|
+
return new CloudflareSocket(ssl);
|
|
22444
|
+
}
|
|
22445
|
+
};
|
|
22446
|
+
module2.exports.getSecureStream = function getSecureStream(options) {
|
|
22447
|
+
var tls = require("tls");
|
|
22448
|
+
if (tls.connect) {
|
|
22449
|
+
return tls.connect(options);
|
|
22450
|
+
} else {
|
|
22451
|
+
options.socket.startTls(options);
|
|
22452
|
+
return options.socket;
|
|
22453
|
+
}
|
|
22454
|
+
};
|
|
22455
|
+
}
|
|
22456
|
+
});
|
|
22457
|
+
|
|
22458
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/connection.js
|
|
22616
22459
|
var require_connection = __commonJS({
|
|
22617
|
-
"node_modules/.pnpm/pg@8.
|
|
22460
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/connection.js"(exports, module2) {
|
|
22618
22461
|
"use strict";
|
|
22619
22462
|
var net = require("net");
|
|
22620
22463
|
var EventEmitter = require("events").EventEmitter;
|
|
22621
22464
|
var { parse, serialize } = require_dist();
|
|
22465
|
+
var { getStream, getSecureStream } = require_stream();
|
|
22622
22466
|
var flushBuffer = serialize.flush();
|
|
22623
22467
|
var syncBuffer = serialize.sync();
|
|
22624
22468
|
var endBuffer = serialize.end();
|
|
@@ -22626,7 +22470,10 @@ var require_connection = __commonJS({
|
|
|
22626
22470
|
constructor(config) {
|
|
22627
22471
|
super();
|
|
22628
22472
|
config = config || {};
|
|
22629
|
-
this.stream = config.stream ||
|
|
22473
|
+
this.stream = config.stream || getStream(config.ssl);
|
|
22474
|
+
if (typeof this.stream === "function") {
|
|
22475
|
+
this.stream = this.stream(config);
|
|
22476
|
+
}
|
|
22630
22477
|
this._keepAlive = config.keepAlive;
|
|
22631
22478
|
this._keepAliveInitialDelayMillis = config.keepAliveInitialDelayMillis;
|
|
22632
22479
|
this.lastBuffer = false;
|
|
@@ -22677,7 +22524,6 @@ var require_connection = __commonJS({
|
|
|
22677
22524
|
self2.stream.end();
|
|
22678
22525
|
return self2.emit("error", new Error("There was an error establishing an SSL connection"));
|
|
22679
22526
|
}
|
|
22680
|
-
var tls = require("tls");
|
|
22681
22527
|
const options = {
|
|
22682
22528
|
socket: self2.stream
|
|
22683
22529
|
};
|
|
@@ -22687,13 +22533,14 @@ var require_connection = __commonJS({
|
|
|
22687
22533
|
options.key = self2.ssl.key;
|
|
22688
22534
|
}
|
|
22689
22535
|
}
|
|
22690
|
-
|
|
22536
|
+
var net2 = require("net");
|
|
22537
|
+
if (net2.isIP && net2.isIP(host) === 0) {
|
|
22691
22538
|
options.servername = host;
|
|
22692
22539
|
}
|
|
22693
22540
|
try {
|
|
22694
|
-
self2.stream =
|
|
22695
|
-
} catch (
|
|
22696
|
-
return self2.emit("error",
|
|
22541
|
+
self2.stream = getSecureStream(options);
|
|
22542
|
+
} catch (err2) {
|
|
22543
|
+
return self2.emit("error", err2);
|
|
22697
22544
|
}
|
|
22698
22545
|
self2.attachListeners(self2.stream);
|
|
22699
22546
|
self2.stream.on("error", reportStreamError);
|
|
@@ -22701,9 +22548,6 @@ var require_connection = __commonJS({
|
|
|
22701
22548
|
});
|
|
22702
22549
|
}
|
|
22703
22550
|
attachListeners(stream) {
|
|
22704
|
-
stream.on("end", () => {
|
|
22705
|
-
this.emit("end");
|
|
22706
|
-
});
|
|
22707
22551
|
parse(stream, (msg) => {
|
|
22708
22552
|
var eventName = msg.name === "error" ? "errorMessage" : msg.name;
|
|
22709
22553
|
if (this._emitMessage) {
|
|
@@ -22758,7 +22602,6 @@ var require_connection = __commonJS({
|
|
|
22758
22602
|
}
|
|
22759
22603
|
sync() {
|
|
22760
22604
|
this._ending = true;
|
|
22761
|
-
this._send(flushBuffer);
|
|
22762
22605
|
this._send(syncBuffer);
|
|
22763
22606
|
}
|
|
22764
22607
|
ref() {
|
|
@@ -22797,20 +22640,313 @@ var require_connection = __commonJS({
|
|
|
22797
22640
|
}
|
|
22798
22641
|
});
|
|
22799
22642
|
|
|
22800
|
-
// node_modules/.pnpm/
|
|
22643
|
+
// node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js
|
|
22644
|
+
var require_split2 = __commonJS({
|
|
22645
|
+
"node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js"(exports, module2) {
|
|
22646
|
+
"use strict";
|
|
22647
|
+
var { Transform: Transform2 } = require("stream");
|
|
22648
|
+
var { StringDecoder } = require("string_decoder");
|
|
22649
|
+
var kLast = Symbol("last");
|
|
22650
|
+
var kDecoder = Symbol("decoder");
|
|
22651
|
+
function transform(chunk, enc, cb) {
|
|
22652
|
+
let list;
|
|
22653
|
+
if (this.overflow) {
|
|
22654
|
+
const buf = this[kDecoder].write(chunk);
|
|
22655
|
+
list = buf.split(this.matcher);
|
|
22656
|
+
if (list.length === 1)
|
|
22657
|
+
return cb();
|
|
22658
|
+
list.shift();
|
|
22659
|
+
this.overflow = false;
|
|
22660
|
+
} else {
|
|
22661
|
+
this[kLast] += this[kDecoder].write(chunk);
|
|
22662
|
+
list = this[kLast].split(this.matcher);
|
|
22663
|
+
}
|
|
22664
|
+
this[kLast] = list.pop();
|
|
22665
|
+
for (let i = 0; i < list.length; i++) {
|
|
22666
|
+
try {
|
|
22667
|
+
push(this, this.mapper(list[i]));
|
|
22668
|
+
} catch (error2) {
|
|
22669
|
+
return cb(error2);
|
|
22670
|
+
}
|
|
22671
|
+
}
|
|
22672
|
+
this.overflow = this[kLast].length > this.maxLength;
|
|
22673
|
+
if (this.overflow && !this.skipOverflow) {
|
|
22674
|
+
cb(new Error("maximum buffer reached"));
|
|
22675
|
+
return;
|
|
22676
|
+
}
|
|
22677
|
+
cb();
|
|
22678
|
+
}
|
|
22679
|
+
function flush(cb) {
|
|
22680
|
+
this[kLast] += this[kDecoder].end();
|
|
22681
|
+
if (this[kLast]) {
|
|
22682
|
+
try {
|
|
22683
|
+
push(this, this.mapper(this[kLast]));
|
|
22684
|
+
} catch (error2) {
|
|
22685
|
+
return cb(error2);
|
|
22686
|
+
}
|
|
22687
|
+
}
|
|
22688
|
+
cb();
|
|
22689
|
+
}
|
|
22690
|
+
function push(self2, val) {
|
|
22691
|
+
if (val !== void 0) {
|
|
22692
|
+
self2.push(val);
|
|
22693
|
+
}
|
|
22694
|
+
}
|
|
22695
|
+
function noop2(incoming) {
|
|
22696
|
+
return incoming;
|
|
22697
|
+
}
|
|
22698
|
+
function split(matcher, mapper, options) {
|
|
22699
|
+
matcher = matcher || /\r?\n/;
|
|
22700
|
+
mapper = mapper || noop2;
|
|
22701
|
+
options = options || {};
|
|
22702
|
+
switch (arguments.length) {
|
|
22703
|
+
case 1:
|
|
22704
|
+
if (typeof matcher === "function") {
|
|
22705
|
+
mapper = matcher;
|
|
22706
|
+
matcher = /\r?\n/;
|
|
22707
|
+
} else if (typeof matcher === "object" && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
|
|
22708
|
+
options = matcher;
|
|
22709
|
+
matcher = /\r?\n/;
|
|
22710
|
+
}
|
|
22711
|
+
break;
|
|
22712
|
+
case 2:
|
|
22713
|
+
if (typeof matcher === "function") {
|
|
22714
|
+
options = mapper;
|
|
22715
|
+
mapper = matcher;
|
|
22716
|
+
matcher = /\r?\n/;
|
|
22717
|
+
} else if (typeof mapper === "object") {
|
|
22718
|
+
options = mapper;
|
|
22719
|
+
mapper = noop2;
|
|
22720
|
+
}
|
|
22721
|
+
}
|
|
22722
|
+
options = Object.assign({}, options);
|
|
22723
|
+
options.autoDestroy = true;
|
|
22724
|
+
options.transform = transform;
|
|
22725
|
+
options.flush = flush;
|
|
22726
|
+
options.readableObjectMode = true;
|
|
22727
|
+
const stream = new Transform2(options);
|
|
22728
|
+
stream[kLast] = "";
|
|
22729
|
+
stream[kDecoder] = new StringDecoder("utf8");
|
|
22730
|
+
stream.matcher = matcher;
|
|
22731
|
+
stream.mapper = mapper;
|
|
22732
|
+
stream.maxLength = options.maxLength;
|
|
22733
|
+
stream.skipOverflow = options.skipOverflow || false;
|
|
22734
|
+
stream.overflow = false;
|
|
22735
|
+
stream._destroy = function(err2, cb) {
|
|
22736
|
+
this._writableState.errorEmitted = false;
|
|
22737
|
+
cb(err2);
|
|
22738
|
+
};
|
|
22739
|
+
return stream;
|
|
22740
|
+
}
|
|
22741
|
+
module2.exports = split;
|
|
22742
|
+
}
|
|
22743
|
+
});
|
|
22744
|
+
|
|
22745
|
+
// node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/helper.js
|
|
22746
|
+
var require_helper = __commonJS({
|
|
22747
|
+
"node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/helper.js"(exports, module2) {
|
|
22748
|
+
"use strict";
|
|
22749
|
+
var path4 = require("path");
|
|
22750
|
+
var Stream = require("stream").Stream;
|
|
22751
|
+
var split = require_split2();
|
|
22752
|
+
var util2 = require("util");
|
|
22753
|
+
var defaultPort = 5432;
|
|
22754
|
+
var isWin = process.platform === "win32";
|
|
22755
|
+
var warnStream = process.stderr;
|
|
22756
|
+
var S_IRWXG = 56;
|
|
22757
|
+
var S_IRWXO = 7;
|
|
22758
|
+
var S_IFMT = 61440;
|
|
22759
|
+
var S_IFREG = 32768;
|
|
22760
|
+
function isRegFile(mode) {
|
|
22761
|
+
return (mode & S_IFMT) == S_IFREG;
|
|
22762
|
+
}
|
|
22763
|
+
var fieldNames = ["host", "port", "database", "user", "password"];
|
|
22764
|
+
var nrOfFields = fieldNames.length;
|
|
22765
|
+
var passKey = fieldNames[nrOfFields - 1];
|
|
22766
|
+
function warn() {
|
|
22767
|
+
var isWritable = warnStream instanceof Stream && true === warnStream.writable;
|
|
22768
|
+
if (isWritable) {
|
|
22769
|
+
var args = Array.prototype.slice.call(arguments).concat("\n");
|
|
22770
|
+
warnStream.write(util2.format.apply(util2, args));
|
|
22771
|
+
}
|
|
22772
|
+
}
|
|
22773
|
+
Object.defineProperty(module2.exports, "isWin", {
|
|
22774
|
+
get: function() {
|
|
22775
|
+
return isWin;
|
|
22776
|
+
},
|
|
22777
|
+
set: function(val) {
|
|
22778
|
+
isWin = val;
|
|
22779
|
+
}
|
|
22780
|
+
});
|
|
22781
|
+
module2.exports.warnTo = function(stream) {
|
|
22782
|
+
var old = warnStream;
|
|
22783
|
+
warnStream = stream;
|
|
22784
|
+
return old;
|
|
22785
|
+
};
|
|
22786
|
+
module2.exports.getFileName = function(rawEnv) {
|
|
22787
|
+
var env2 = rawEnv || process.env;
|
|
22788
|
+
var file = env2.PGPASSFILE || (isWin ? path4.join(env2.APPDATA || "./", "postgresql", "pgpass.conf") : path4.join(env2.HOME || "./", ".pgpass"));
|
|
22789
|
+
return file;
|
|
22790
|
+
};
|
|
22791
|
+
module2.exports.usePgPass = function(stats, fname) {
|
|
22792
|
+
if (Object.prototype.hasOwnProperty.call(process.env, "PGPASSWORD")) {
|
|
22793
|
+
return false;
|
|
22794
|
+
}
|
|
22795
|
+
if (isWin) {
|
|
22796
|
+
return true;
|
|
22797
|
+
}
|
|
22798
|
+
fname = fname || "<unkn>";
|
|
22799
|
+
if (!isRegFile(stats.mode)) {
|
|
22800
|
+
warn('WARNING: password file "%s" is not a plain file', fname);
|
|
22801
|
+
return false;
|
|
22802
|
+
}
|
|
22803
|
+
if (stats.mode & (S_IRWXG | S_IRWXO)) {
|
|
22804
|
+
warn('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less', fname);
|
|
22805
|
+
return false;
|
|
22806
|
+
}
|
|
22807
|
+
return true;
|
|
22808
|
+
};
|
|
22809
|
+
var matcher = module2.exports.match = function(connInfo, entry) {
|
|
22810
|
+
return fieldNames.slice(0, -1).reduce(function(prev, field, idx) {
|
|
22811
|
+
if (idx == 1) {
|
|
22812
|
+
if (Number(connInfo[field] || defaultPort) === Number(entry[field])) {
|
|
22813
|
+
return prev && true;
|
|
22814
|
+
}
|
|
22815
|
+
}
|
|
22816
|
+
return prev && (entry[field] === "*" || entry[field] === connInfo[field]);
|
|
22817
|
+
}, true);
|
|
22818
|
+
};
|
|
22819
|
+
module2.exports.getPassword = function(connInfo, stream, cb) {
|
|
22820
|
+
var pass;
|
|
22821
|
+
var lineStream = stream.pipe(split());
|
|
22822
|
+
function onLine(line) {
|
|
22823
|
+
var entry = parseLine(line);
|
|
22824
|
+
if (entry && isValidEntry(entry) && matcher(connInfo, entry)) {
|
|
22825
|
+
pass = entry[passKey];
|
|
22826
|
+
lineStream.end();
|
|
22827
|
+
}
|
|
22828
|
+
}
|
|
22829
|
+
var onEnd = function() {
|
|
22830
|
+
stream.destroy();
|
|
22831
|
+
cb(pass);
|
|
22832
|
+
};
|
|
22833
|
+
var onErr = function(err2) {
|
|
22834
|
+
stream.destroy();
|
|
22835
|
+
warn("WARNING: error on reading file: %s", err2);
|
|
22836
|
+
cb(void 0);
|
|
22837
|
+
};
|
|
22838
|
+
stream.on("error", onErr);
|
|
22839
|
+
lineStream.on("data", onLine).on("end", onEnd).on("error", onErr);
|
|
22840
|
+
};
|
|
22841
|
+
var parseLine = module2.exports.parseLine = function(line) {
|
|
22842
|
+
if (line.length < 11 || line.match(/^\s+#/)) {
|
|
22843
|
+
return null;
|
|
22844
|
+
}
|
|
22845
|
+
var curChar = "";
|
|
22846
|
+
var prevChar = "";
|
|
22847
|
+
var fieldIdx = 0;
|
|
22848
|
+
var startIdx = 0;
|
|
22849
|
+
var endIdx = 0;
|
|
22850
|
+
var obj = {};
|
|
22851
|
+
var isLastField = false;
|
|
22852
|
+
var addToObj = function(idx, i0, i1) {
|
|
22853
|
+
var field = line.substring(i0, i1);
|
|
22854
|
+
if (!Object.hasOwnProperty.call(process.env, "PGPASS_NO_DEESCAPE")) {
|
|
22855
|
+
field = field.replace(/\\([:\\])/g, "$1");
|
|
22856
|
+
}
|
|
22857
|
+
obj[fieldNames[idx]] = field;
|
|
22858
|
+
};
|
|
22859
|
+
for (var i = 0; i < line.length - 1; i += 1) {
|
|
22860
|
+
curChar = line.charAt(i + 1);
|
|
22861
|
+
prevChar = line.charAt(i);
|
|
22862
|
+
isLastField = fieldIdx == nrOfFields - 1;
|
|
22863
|
+
if (isLastField) {
|
|
22864
|
+
addToObj(fieldIdx, startIdx);
|
|
22865
|
+
break;
|
|
22866
|
+
}
|
|
22867
|
+
if (i >= 0 && curChar == ":" && prevChar !== "\\") {
|
|
22868
|
+
addToObj(fieldIdx, startIdx, i + 1);
|
|
22869
|
+
startIdx = i + 2;
|
|
22870
|
+
fieldIdx += 1;
|
|
22871
|
+
}
|
|
22872
|
+
}
|
|
22873
|
+
obj = Object.keys(obj).length === nrOfFields ? obj : null;
|
|
22874
|
+
return obj;
|
|
22875
|
+
};
|
|
22876
|
+
var isValidEntry = module2.exports.isValidEntry = function(entry) {
|
|
22877
|
+
var rules = {
|
|
22878
|
+
// host
|
|
22879
|
+
0: function(x) {
|
|
22880
|
+
return x.length > 0;
|
|
22881
|
+
},
|
|
22882
|
+
// port
|
|
22883
|
+
1: function(x) {
|
|
22884
|
+
if (x === "*") {
|
|
22885
|
+
return true;
|
|
22886
|
+
}
|
|
22887
|
+
x = Number(x);
|
|
22888
|
+
return isFinite(x) && x > 0 && x < 9007199254740992 && Math.floor(x) === x;
|
|
22889
|
+
},
|
|
22890
|
+
// database
|
|
22891
|
+
2: function(x) {
|
|
22892
|
+
return x.length > 0;
|
|
22893
|
+
},
|
|
22894
|
+
// username
|
|
22895
|
+
3: function(x) {
|
|
22896
|
+
return x.length > 0;
|
|
22897
|
+
},
|
|
22898
|
+
// password
|
|
22899
|
+
4: function(x) {
|
|
22900
|
+
return x.length > 0;
|
|
22901
|
+
}
|
|
22902
|
+
};
|
|
22903
|
+
for (var idx = 0; idx < fieldNames.length; idx += 1) {
|
|
22904
|
+
var rule = rules[idx];
|
|
22905
|
+
var value = entry[fieldNames[idx]] || "";
|
|
22906
|
+
var res = rule(value);
|
|
22907
|
+
if (!res) {
|
|
22908
|
+
return false;
|
|
22909
|
+
}
|
|
22910
|
+
}
|
|
22911
|
+
return true;
|
|
22912
|
+
};
|
|
22913
|
+
}
|
|
22914
|
+
});
|
|
22915
|
+
|
|
22916
|
+
// node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js
|
|
22917
|
+
var require_lib = __commonJS({
|
|
22918
|
+
"node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js"(exports, module2) {
|
|
22919
|
+
"use strict";
|
|
22920
|
+
var path4 = require("path");
|
|
22921
|
+
var fs6 = require("fs");
|
|
22922
|
+
var helper = require_helper();
|
|
22923
|
+
module2.exports = function(connInfo, cb) {
|
|
22924
|
+
var file = helper.getFileName();
|
|
22925
|
+
fs6.stat(file, function(err2, stat) {
|
|
22926
|
+
if (err2 || !helper.usePgPass(stat, file)) {
|
|
22927
|
+
return cb(void 0);
|
|
22928
|
+
}
|
|
22929
|
+
var st = fs6.createReadStream(file);
|
|
22930
|
+
helper.getPassword(connInfo, st, cb);
|
|
22931
|
+
});
|
|
22932
|
+
};
|
|
22933
|
+
module2.exports.warnTo = helper.warnTo;
|
|
22934
|
+
}
|
|
22935
|
+
});
|
|
22936
|
+
|
|
22937
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/client.js
|
|
22801
22938
|
var require_client = __commonJS({
|
|
22802
|
-
"node_modules/.pnpm/pg@8.
|
|
22939
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/client.js"(exports, module2) {
|
|
22803
22940
|
"use strict";
|
|
22804
22941
|
var EventEmitter = require("events").EventEmitter;
|
|
22805
|
-
var util2 = require("util");
|
|
22806
22942
|
var utils = require_utils2();
|
|
22807
22943
|
var sasl = require_sasl();
|
|
22808
|
-
var pgPass = require_lib();
|
|
22809
22944
|
var TypeOverrides = require_type_overrides();
|
|
22810
22945
|
var ConnectionParameters = require_connection_parameters();
|
|
22811
22946
|
var Query = require_query();
|
|
22812
22947
|
var defaults3 = require_defaults();
|
|
22813
22948
|
var Connection = require_connection();
|
|
22949
|
+
var crypto = require_utils3();
|
|
22814
22950
|
var Client2 = class extends EventEmitter {
|
|
22815
22951
|
constructor(config) {
|
|
22816
22952
|
super();
|
|
@@ -22830,6 +22966,7 @@ var require_client = __commonJS({
|
|
|
22830
22966
|
this._Promise = c.Promise || global.Promise;
|
|
22831
22967
|
this._types = new TypeOverrides(c.types);
|
|
22832
22968
|
this._ending = false;
|
|
22969
|
+
this._ended = false;
|
|
22833
22970
|
this._connecting = false;
|
|
22834
22971
|
this._connected = false;
|
|
22835
22972
|
this._connectionError = false;
|
|
@@ -22853,10 +22990,10 @@ var require_client = __commonJS({
|
|
|
22853
22990
|
}
|
|
22854
22991
|
this._connectionTimeoutMillis = c.connectionTimeoutMillis || 0;
|
|
22855
22992
|
}
|
|
22856
|
-
_errorAllQueries(
|
|
22993
|
+
_errorAllQueries(err2) {
|
|
22857
22994
|
const enqueueError = (query) => {
|
|
22858
22995
|
process.nextTick(() => {
|
|
22859
|
-
query.handleError(
|
|
22996
|
+
query.handleError(err2, this.connection);
|
|
22860
22997
|
});
|
|
22861
22998
|
};
|
|
22862
22999
|
if (this.activeQuery) {
|
|
@@ -22871,9 +23008,9 @@ var require_client = __commonJS({
|
|
|
22871
23008
|
var con = this.connection;
|
|
22872
23009
|
this._connectionCallback = callback;
|
|
22873
23010
|
if (this._connecting || this._connected) {
|
|
22874
|
-
const
|
|
23011
|
+
const err2 = new Error("Client has already been connected. You cannot reuse a client.");
|
|
22875
23012
|
process.nextTick(() => {
|
|
22876
|
-
callback(
|
|
23013
|
+
callback(err2);
|
|
22877
23014
|
});
|
|
22878
23015
|
return;
|
|
22879
23016
|
}
|
|
@@ -22905,6 +23042,7 @@ var require_client = __commonJS({
|
|
|
22905
23042
|
const error2 = this._ending ? new Error("Connection terminated") : new Error("Connection terminated unexpectedly");
|
|
22906
23043
|
clearTimeout(this.connectionTimeoutHandle);
|
|
22907
23044
|
this._errorAllQueries(error2);
|
|
23045
|
+
this._ended = true;
|
|
22908
23046
|
if (!this._ending) {
|
|
22909
23047
|
if (this._connecting && !this._connectionError) {
|
|
22910
23048
|
if (this._connectionCallback) {
|
|
@@ -22973,18 +23111,23 @@ var require_client = __commonJS({
|
|
|
22973
23111
|
this.connectionParameters.password = this.password = null;
|
|
22974
23112
|
}
|
|
22975
23113
|
cb();
|
|
22976
|
-
}).catch((
|
|
22977
|
-
con.emit("error",
|
|
23114
|
+
}).catch((err2) => {
|
|
23115
|
+
con.emit("error", err2);
|
|
22978
23116
|
});
|
|
22979
23117
|
} else if (this.password !== null) {
|
|
22980
23118
|
cb();
|
|
22981
23119
|
} else {
|
|
22982
|
-
|
|
22983
|
-
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
|
-
|
|
23120
|
+
try {
|
|
23121
|
+
const pgPass = require_lib();
|
|
23122
|
+
pgPass(this.connectionParameters, (pass) => {
|
|
23123
|
+
if (void 0 !== pass) {
|
|
23124
|
+
this.connectionParameters.password = this.password = pass;
|
|
23125
|
+
}
|
|
23126
|
+
cb();
|
|
23127
|
+
});
|
|
23128
|
+
} catch (e) {
|
|
23129
|
+
this.emit("error", e);
|
|
23130
|
+
}
|
|
22988
23131
|
}
|
|
22989
23132
|
}
|
|
22990
23133
|
_handleAuthCleartextPassword(msg) {
|
|
@@ -22993,24 +23136,40 @@ var require_client = __commonJS({
|
|
|
22993
23136
|
});
|
|
22994
23137
|
}
|
|
22995
23138
|
_handleAuthMD5Password(msg) {
|
|
22996
|
-
this._checkPgPass(() => {
|
|
22997
|
-
|
|
22998
|
-
|
|
23139
|
+
this._checkPgPass(async () => {
|
|
23140
|
+
try {
|
|
23141
|
+
const hashedPassword = await crypto.postgresMd5PasswordHash(this.user, this.password, msg.salt);
|
|
23142
|
+
this.connection.password(hashedPassword);
|
|
23143
|
+
} catch (e) {
|
|
23144
|
+
this.emit("error", e);
|
|
23145
|
+
}
|
|
22999
23146
|
});
|
|
23000
23147
|
}
|
|
23001
23148
|
_handleAuthSASL(msg) {
|
|
23002
23149
|
this._checkPgPass(() => {
|
|
23003
|
-
|
|
23004
|
-
|
|
23150
|
+
try {
|
|
23151
|
+
this.saslSession = sasl.startSession(msg.mechanisms);
|
|
23152
|
+
this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response);
|
|
23153
|
+
} catch (err2) {
|
|
23154
|
+
this.connection.emit("error", err2);
|
|
23155
|
+
}
|
|
23005
23156
|
});
|
|
23006
23157
|
}
|
|
23007
|
-
_handleAuthSASLContinue(msg) {
|
|
23008
|
-
|
|
23009
|
-
|
|
23158
|
+
async _handleAuthSASLContinue(msg) {
|
|
23159
|
+
try {
|
|
23160
|
+
await sasl.continueSession(this.saslSession, this.password, msg.data);
|
|
23161
|
+
this.connection.sendSCRAMClientFinalMessage(this.saslSession.response);
|
|
23162
|
+
} catch (err2) {
|
|
23163
|
+
this.connection.emit("error", err2);
|
|
23164
|
+
}
|
|
23010
23165
|
}
|
|
23011
23166
|
_handleAuthSASLFinal(msg) {
|
|
23012
|
-
|
|
23013
|
-
|
|
23167
|
+
try {
|
|
23168
|
+
sasl.finalizeSession(this.saslSession, msg.data);
|
|
23169
|
+
this.saslSession = null;
|
|
23170
|
+
} catch (err2) {
|
|
23171
|
+
this.connection.emit("error", err2);
|
|
23172
|
+
}
|
|
23014
23173
|
}
|
|
23015
23174
|
_handleBackendKeyData(msg) {
|
|
23016
23175
|
this.processID = msg.processID;
|
|
@@ -23037,27 +23196,27 @@ var require_client = __commonJS({
|
|
|
23037
23196
|
}
|
|
23038
23197
|
// if we receieve an error event or error message
|
|
23039
23198
|
// during the connection process we handle it here
|
|
23040
|
-
_handleErrorWhileConnecting(
|
|
23199
|
+
_handleErrorWhileConnecting(err2) {
|
|
23041
23200
|
if (this._connectionError) {
|
|
23042
23201
|
return;
|
|
23043
23202
|
}
|
|
23044
23203
|
this._connectionError = true;
|
|
23045
23204
|
clearTimeout(this.connectionTimeoutHandle);
|
|
23046
23205
|
if (this._connectionCallback) {
|
|
23047
|
-
return this._connectionCallback(
|
|
23206
|
+
return this._connectionCallback(err2);
|
|
23048
23207
|
}
|
|
23049
|
-
this.emit("error",
|
|
23208
|
+
this.emit("error", err2);
|
|
23050
23209
|
}
|
|
23051
23210
|
// if we're connected and we receive an error event from the connection
|
|
23052
23211
|
// this means the socket is dead - do a hard abort of all queries and emit
|
|
23053
23212
|
// the socket error on the client as well
|
|
23054
|
-
_handleErrorEvent(
|
|
23213
|
+
_handleErrorEvent(err2) {
|
|
23055
23214
|
if (this._connecting) {
|
|
23056
|
-
return this._handleErrorWhileConnecting(
|
|
23215
|
+
return this._handleErrorWhileConnecting(err2);
|
|
23057
23216
|
}
|
|
23058
23217
|
this._queryable = false;
|
|
23059
|
-
this._errorAllQueries(
|
|
23060
|
-
this.emit("error",
|
|
23218
|
+
this._errorAllQueries(err2);
|
|
23219
|
+
this.emit("error", err2);
|
|
23061
23220
|
}
|
|
23062
23221
|
// handle error messages from the postgres backend
|
|
23063
23222
|
_handleErrorMessage(msg) {
|
|
@@ -23152,30 +23311,14 @@ var require_client = __commonJS({
|
|
|
23152
23311
|
getTypeParser(oid, format) {
|
|
23153
23312
|
return this._types.getTypeParser(oid, format);
|
|
23154
23313
|
}
|
|
23155
|
-
//
|
|
23314
|
+
// escapeIdentifier and escapeLiteral moved to utility functions & exported
|
|
23315
|
+
// on PG
|
|
23316
|
+
// re-exported here for backwards compatibility
|
|
23156
23317
|
escapeIdentifier(str) {
|
|
23157
|
-
return
|
|
23318
|
+
return utils.escapeIdentifier(str);
|
|
23158
23319
|
}
|
|
23159
|
-
// Ported from PostgreSQL 9.2.4 source code in src/interfaces/libpq/fe-exec.c
|
|
23160
23320
|
escapeLiteral(str) {
|
|
23161
|
-
|
|
23162
|
-
var escaped = "'";
|
|
23163
|
-
for (var i = 0; i < str.length; i++) {
|
|
23164
|
-
var c = str[i];
|
|
23165
|
-
if (c === "'") {
|
|
23166
|
-
escaped += c + c;
|
|
23167
|
-
} else if (c === "\\") {
|
|
23168
|
-
escaped += c + c;
|
|
23169
|
-
hasBackslash = true;
|
|
23170
|
-
} else {
|
|
23171
|
-
escaped += c;
|
|
23172
|
-
}
|
|
23173
|
-
}
|
|
23174
|
-
escaped += "'";
|
|
23175
|
-
if (hasBackslash === true) {
|
|
23176
|
-
escaped = " E" + escaped;
|
|
23177
|
-
}
|
|
23178
|
-
return escaped;
|
|
23321
|
+
return utils.escapeLiteral(str);
|
|
23179
23322
|
}
|
|
23180
23323
|
_pulseQueryQueue() {
|
|
23181
23324
|
if (this.readyForQuery === true) {
|
|
@@ -23216,7 +23359,10 @@ var require_client = __commonJS({
|
|
|
23216
23359
|
query = new Query(config, values, callback);
|
|
23217
23360
|
if (!query.callback) {
|
|
23218
23361
|
result = new this._Promise((resolve, reject) => {
|
|
23219
|
-
query.callback = (
|
|
23362
|
+
query.callback = (err2, res) => err2 ? reject(err2) : resolve(res);
|
|
23363
|
+
}).catch((err2) => {
|
|
23364
|
+
Error.captureStackTrace(err2);
|
|
23365
|
+
throw err2;
|
|
23220
23366
|
});
|
|
23221
23367
|
}
|
|
23222
23368
|
}
|
|
@@ -23236,9 +23382,9 @@ var require_client = __commonJS({
|
|
|
23236
23382
|
}
|
|
23237
23383
|
this._pulseQueryQueue();
|
|
23238
23384
|
}, readTimeout);
|
|
23239
|
-
query.callback = (
|
|
23385
|
+
query.callback = (err2, res) => {
|
|
23240
23386
|
clearTimeout(readTimeoutTimer);
|
|
23241
|
-
queryCallback(
|
|
23387
|
+
queryCallback(err2, res);
|
|
23242
23388
|
};
|
|
23243
23389
|
}
|
|
23244
23390
|
if (this.binary && !query.binary) {
|
|
@@ -23271,7 +23417,7 @@ var require_client = __commonJS({
|
|
|
23271
23417
|
}
|
|
23272
23418
|
end(cb) {
|
|
23273
23419
|
this._ending = true;
|
|
23274
|
-
if (!this.connection._connecting) {
|
|
23420
|
+
if (!this.connection._connecting || this._ended) {
|
|
23275
23421
|
if (cb) {
|
|
23276
23422
|
cb();
|
|
23277
23423
|
} else {
|
|
@@ -23297,9 +23443,9 @@ var require_client = __commonJS({
|
|
|
23297
23443
|
}
|
|
23298
23444
|
});
|
|
23299
23445
|
|
|
23300
|
-
// node_modules/.pnpm/pg-pool@3.6.1_pg@8.
|
|
23446
|
+
// node_modules/.pnpm/pg-pool@3.6.1_pg@8.11.3/node_modules/pg-pool/index.js
|
|
23301
23447
|
var require_pg_pool = __commonJS({
|
|
23302
|
-
"node_modules/.pnpm/pg-pool@3.6.1_pg@8.
|
|
23448
|
+
"node_modules/.pnpm/pg-pool@3.6.1_pg@8.11.3/node_modules/pg-pool/index.js"(exports, module2) {
|
|
23303
23449
|
"use strict";
|
|
23304
23450
|
var EventEmitter = require("events").EventEmitter;
|
|
23305
23451
|
var NOOP = function() {
|
|
@@ -23329,27 +23475,27 @@ var require_pg_pool = __commonJS({
|
|
|
23329
23475
|
}
|
|
23330
23476
|
let rej;
|
|
23331
23477
|
let res;
|
|
23332
|
-
const cb = function(
|
|
23333
|
-
|
|
23478
|
+
const cb = function(err2, client) {
|
|
23479
|
+
err2 ? rej(err2) : res(client);
|
|
23334
23480
|
};
|
|
23335
23481
|
const result = new Promise2(function(resolve, reject) {
|
|
23336
23482
|
res = resolve;
|
|
23337
23483
|
rej = reject;
|
|
23338
|
-
}).catch((
|
|
23339
|
-
Error.captureStackTrace(
|
|
23340
|
-
throw
|
|
23484
|
+
}).catch((err2) => {
|
|
23485
|
+
Error.captureStackTrace(err2);
|
|
23486
|
+
throw err2;
|
|
23341
23487
|
});
|
|
23342
23488
|
return { callback: cb, result };
|
|
23343
23489
|
}
|
|
23344
23490
|
function makeIdleListener(pool, client) {
|
|
23345
|
-
return function idleListener(
|
|
23346
|
-
|
|
23491
|
+
return function idleListener(err2) {
|
|
23492
|
+
err2.client = client;
|
|
23347
23493
|
client.removeListener("error", idleListener);
|
|
23348
23494
|
client.on("error", () => {
|
|
23349
|
-
pool.log("additional client error after disconnection due to error",
|
|
23495
|
+
pool.log("additional client error after disconnection due to error", err2);
|
|
23350
23496
|
});
|
|
23351
23497
|
pool._remove(client);
|
|
23352
|
-
pool.emit("error",
|
|
23498
|
+
pool.emit("error", err2, client);
|
|
23353
23499
|
};
|
|
23354
23500
|
}
|
|
23355
23501
|
var Pool = class extends EventEmitter {
|
|
@@ -23442,8 +23588,8 @@ var require_pg_pool = __commonJS({
|
|
|
23442
23588
|
}
|
|
23443
23589
|
connect(cb) {
|
|
23444
23590
|
if (this.ending) {
|
|
23445
|
-
const
|
|
23446
|
-
return cb ? cb(
|
|
23591
|
+
const err2 = new Error("Cannot use a pool after calling end on the pool");
|
|
23592
|
+
return cb ? cb(err2) : this.Promise.reject(err2);
|
|
23447
23593
|
}
|
|
23448
23594
|
const response = promisify2(this.Promise, cb);
|
|
23449
23595
|
const result = response.result;
|
|
@@ -23455,9 +23601,9 @@ var require_pg_pool = __commonJS({
|
|
|
23455
23601
|
this._pendingQueue.push(new PendingItem(response.callback));
|
|
23456
23602
|
return result;
|
|
23457
23603
|
}
|
|
23458
|
-
const queueCallback = (
|
|
23604
|
+
const queueCallback = (err2, res, done) => {
|
|
23459
23605
|
clearTimeout(tid);
|
|
23460
|
-
response.callback(
|
|
23606
|
+
response.callback(err2, res, done);
|
|
23461
23607
|
};
|
|
23462
23608
|
const pendingItem = new PendingItem(queueCallback);
|
|
23463
23609
|
const tid = setTimeout(() => {
|
|
@@ -23486,20 +23632,20 @@ var require_pg_pool = __commonJS({
|
|
|
23486
23632
|
}, this.options.connectionTimeoutMillis);
|
|
23487
23633
|
}
|
|
23488
23634
|
this.log("connecting new client");
|
|
23489
|
-
client.connect((
|
|
23635
|
+
client.connect((err2) => {
|
|
23490
23636
|
if (tid) {
|
|
23491
23637
|
clearTimeout(tid);
|
|
23492
23638
|
}
|
|
23493
23639
|
client.on("error", idleListener);
|
|
23494
|
-
if (
|
|
23495
|
-
this.log("client failed to connect",
|
|
23640
|
+
if (err2) {
|
|
23641
|
+
this.log("client failed to connect", err2);
|
|
23496
23642
|
this._clients = this._clients.filter((c) => c !== client);
|
|
23497
23643
|
if (timeoutHit) {
|
|
23498
|
-
|
|
23644
|
+
err2.message = "Connection terminated due to connection timeout";
|
|
23499
23645
|
}
|
|
23500
23646
|
this._pulseQueue();
|
|
23501
23647
|
if (!pendingItem.timedOut) {
|
|
23502
|
-
pendingItem.callback(
|
|
23648
|
+
pendingItem.callback(err2, void 0, NOOP);
|
|
23503
23649
|
}
|
|
23504
23650
|
} else {
|
|
23505
23651
|
this.log("new client connected");
|
|
@@ -23511,7 +23657,7 @@ var require_pg_pool = __commonJS({
|
|
|
23511
23657
|
if (idleIndex !== -1) {
|
|
23512
23658
|
this._acquireClient(
|
|
23513
23659
|
client,
|
|
23514
|
-
new PendingItem((
|
|
23660
|
+
new PendingItem((err3, client2, clientRelease) => clientRelease()),
|
|
23515
23661
|
idleListener,
|
|
23516
23662
|
false
|
|
23517
23663
|
);
|
|
@@ -23534,10 +23680,10 @@ var require_pg_pool = __commonJS({
|
|
|
23534
23680
|
client.removeListener("error", idleListener);
|
|
23535
23681
|
if (!pendingItem.timedOut) {
|
|
23536
23682
|
if (isNew && this.options.verify) {
|
|
23537
|
-
this.options.verify(client, (
|
|
23538
|
-
if (
|
|
23539
|
-
client.release(
|
|
23540
|
-
return pendingItem.callback(
|
|
23683
|
+
this.options.verify(client, (err2) => {
|
|
23684
|
+
if (err2) {
|
|
23685
|
+
client.release(err2);
|
|
23686
|
+
return pendingItem.callback(err2, void 0, NOOP);
|
|
23541
23687
|
}
|
|
23542
23688
|
pendingItem.callback(void 0, client, client.release);
|
|
23543
23689
|
});
|
|
@@ -23555,21 +23701,21 @@ var require_pg_pool = __commonJS({
|
|
|
23555
23701
|
// returns a function that wraps _release and throws if called more than once
|
|
23556
23702
|
_releaseOnce(client, idleListener) {
|
|
23557
23703
|
let released = false;
|
|
23558
|
-
return (
|
|
23704
|
+
return (err2) => {
|
|
23559
23705
|
if (released) {
|
|
23560
23706
|
throwOnDoubleRelease();
|
|
23561
23707
|
}
|
|
23562
23708
|
released = true;
|
|
23563
|
-
this._release(client, idleListener,
|
|
23709
|
+
this._release(client, idleListener, err2);
|
|
23564
23710
|
};
|
|
23565
23711
|
}
|
|
23566
23712
|
// release a client back to the poll, include an error
|
|
23567
23713
|
// to remove it from the pool
|
|
23568
|
-
_release(client, idleListener,
|
|
23714
|
+
_release(client, idleListener, err2) {
|
|
23569
23715
|
client.on("error", idleListener);
|
|
23570
23716
|
client._poolUseCount = (client._poolUseCount || 0) + 1;
|
|
23571
|
-
this.emit("release",
|
|
23572
|
-
if (
|
|
23717
|
+
this.emit("release", err2, client);
|
|
23718
|
+
if (err2 || this.ending || !client._queryable || client._ending || client._poolUseCount >= this.options.maxUses) {
|
|
23573
23719
|
if (client._poolUseCount >= this.options.maxUses) {
|
|
23574
23720
|
this.log("remove expended client");
|
|
23575
23721
|
}
|
|
@@ -23615,38 +23761,38 @@ var require_pg_pool = __commonJS({
|
|
|
23615
23761
|
}
|
|
23616
23762
|
const response = promisify2(this.Promise, cb);
|
|
23617
23763
|
cb = response.callback;
|
|
23618
|
-
this.connect((
|
|
23619
|
-
if (
|
|
23620
|
-
return cb(
|
|
23764
|
+
this.connect((err2, client) => {
|
|
23765
|
+
if (err2) {
|
|
23766
|
+
return cb(err2);
|
|
23621
23767
|
}
|
|
23622
23768
|
let clientReleased = false;
|
|
23623
|
-
const onError = (
|
|
23769
|
+
const onError = (err3) => {
|
|
23624
23770
|
if (clientReleased) {
|
|
23625
23771
|
return;
|
|
23626
23772
|
}
|
|
23627
23773
|
clientReleased = true;
|
|
23628
|
-
client.release(
|
|
23629
|
-
cb(
|
|
23774
|
+
client.release(err3);
|
|
23775
|
+
cb(err3);
|
|
23630
23776
|
};
|
|
23631
23777
|
client.once("error", onError);
|
|
23632
23778
|
this.log("dispatching query");
|
|
23633
23779
|
try {
|
|
23634
|
-
client.query(text, values, (
|
|
23780
|
+
client.query(text, values, (err3, res) => {
|
|
23635
23781
|
this.log("query dispatched");
|
|
23636
23782
|
client.removeListener("error", onError);
|
|
23637
23783
|
if (clientReleased) {
|
|
23638
23784
|
return;
|
|
23639
23785
|
}
|
|
23640
23786
|
clientReleased = true;
|
|
23641
|
-
client.release(
|
|
23642
|
-
if (
|
|
23643
|
-
return cb(
|
|
23787
|
+
client.release(err3);
|
|
23788
|
+
if (err3) {
|
|
23789
|
+
return cb(err3);
|
|
23644
23790
|
}
|
|
23645
23791
|
return cb(void 0, res);
|
|
23646
23792
|
});
|
|
23647
|
-
} catch (
|
|
23648
|
-
client.release(
|
|
23649
|
-
return cb(
|
|
23793
|
+
} catch (err3) {
|
|
23794
|
+
client.release(err3);
|
|
23795
|
+
return cb(err3);
|
|
23650
23796
|
}
|
|
23651
23797
|
});
|
|
23652
23798
|
return response.result;
|
|
@@ -23654,8 +23800,8 @@ var require_pg_pool = __commonJS({
|
|
|
23654
23800
|
end(cb) {
|
|
23655
23801
|
this.log("ending");
|
|
23656
23802
|
if (this.ending) {
|
|
23657
|
-
const
|
|
23658
|
-
return cb ? cb(
|
|
23803
|
+
const err2 = new Error("Called end on pool more than once");
|
|
23804
|
+
return cb ? cb(err2) : this.Promise.reject(err2);
|
|
23659
23805
|
}
|
|
23660
23806
|
this.ending = true;
|
|
23661
23807
|
const promised = promisify2(this.Promise, cb);
|
|
@@ -23680,72 +23826,9 @@ var require_pg_pool = __commonJS({
|
|
|
23680
23826
|
}
|
|
23681
23827
|
});
|
|
23682
23828
|
|
|
23683
|
-
// node_modules/.pnpm/pg@8.
|
|
23684
|
-
var require_package = __commonJS({
|
|
23685
|
-
"node_modules/.pnpm/pg@8.8.0/node_modules/pg/package.json"(exports, module2) {
|
|
23686
|
-
module2.exports = {
|
|
23687
|
-
name: "pg",
|
|
23688
|
-
version: "8.8.0",
|
|
23689
|
-
description: "PostgreSQL client - pure javascript & libpq with the same API",
|
|
23690
|
-
keywords: [
|
|
23691
|
-
"database",
|
|
23692
|
-
"libpq",
|
|
23693
|
-
"pg",
|
|
23694
|
-
"postgre",
|
|
23695
|
-
"postgres",
|
|
23696
|
-
"postgresql",
|
|
23697
|
-
"rdbms"
|
|
23698
|
-
],
|
|
23699
|
-
homepage: "https://github.com/brianc/node-postgres",
|
|
23700
|
-
repository: {
|
|
23701
|
-
type: "git",
|
|
23702
|
-
url: "git://github.com/brianc/node-postgres.git",
|
|
23703
|
-
directory: "packages/pg"
|
|
23704
|
-
},
|
|
23705
|
-
author: "Brian Carlson <brian.m.carlson@gmail.com>",
|
|
23706
|
-
main: "./lib",
|
|
23707
|
-
dependencies: {
|
|
23708
|
-
"buffer-writer": "2.0.0",
|
|
23709
|
-
"packet-reader": "1.0.0",
|
|
23710
|
-
"pg-connection-string": "^2.5.0",
|
|
23711
|
-
"pg-pool": "^3.5.2",
|
|
23712
|
-
"pg-protocol": "^1.5.0",
|
|
23713
|
-
"pg-types": "^2.1.0",
|
|
23714
|
-
pgpass: "1.x"
|
|
23715
|
-
},
|
|
23716
|
-
devDependencies: {
|
|
23717
|
-
async: "2.6.4",
|
|
23718
|
-
bluebird: "3.5.2",
|
|
23719
|
-
co: "4.6.0",
|
|
23720
|
-
"pg-copy-streams": "0.3.0"
|
|
23721
|
-
},
|
|
23722
|
-
peerDependencies: {
|
|
23723
|
-
"pg-native": ">=3.0.1"
|
|
23724
|
-
},
|
|
23725
|
-
peerDependenciesMeta: {
|
|
23726
|
-
"pg-native": {
|
|
23727
|
-
optional: true
|
|
23728
|
-
}
|
|
23729
|
-
},
|
|
23730
|
-
scripts: {
|
|
23731
|
-
test: "make test-all"
|
|
23732
|
-
},
|
|
23733
|
-
files: [
|
|
23734
|
-
"lib",
|
|
23735
|
-
"SPONSORS.md"
|
|
23736
|
-
],
|
|
23737
|
-
license: "MIT",
|
|
23738
|
-
engines: {
|
|
23739
|
-
node: ">= 8.0.0"
|
|
23740
|
-
},
|
|
23741
|
-
gitHead: "c99fb2c127ddf8d712500db2c7b9a5491a178655"
|
|
23742
|
-
};
|
|
23743
|
-
}
|
|
23744
|
-
});
|
|
23745
|
-
|
|
23746
|
-
// node_modules/.pnpm/pg@8.8.0/node_modules/pg/lib/native/query.js
|
|
23829
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/native/query.js
|
|
23747
23830
|
var require_query2 = __commonJS({
|
|
23748
|
-
"node_modules/.pnpm/pg@8.
|
|
23831
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/native/query.js"(exports, module2) {
|
|
23749
23832
|
"use strict";
|
|
23750
23833
|
var EventEmitter = require("events").EventEmitter;
|
|
23751
23834
|
var util2 = require("util");
|
|
@@ -23784,18 +23867,18 @@ var require_query2 = __commonJS({
|
|
|
23784
23867
|
sourceLine: "line",
|
|
23785
23868
|
sourceFunction: "routine"
|
|
23786
23869
|
};
|
|
23787
|
-
NativeQuery.prototype.handleError = function(
|
|
23870
|
+
NativeQuery.prototype.handleError = function(err2) {
|
|
23788
23871
|
var fields = this.native.pq.resultErrorFields();
|
|
23789
23872
|
if (fields) {
|
|
23790
23873
|
for (var key in fields) {
|
|
23791
23874
|
var normalizedFieldName = errorFieldMap[key] || key;
|
|
23792
|
-
|
|
23875
|
+
err2[normalizedFieldName] = fields[key];
|
|
23793
23876
|
}
|
|
23794
23877
|
}
|
|
23795
23878
|
if (this.callback) {
|
|
23796
|
-
this.callback(
|
|
23879
|
+
this.callback(err2);
|
|
23797
23880
|
} else {
|
|
23798
|
-
this.emit("error",
|
|
23881
|
+
this.emit("error", err2);
|
|
23799
23882
|
}
|
|
23800
23883
|
this.state = "error";
|
|
23801
23884
|
};
|
|
@@ -23821,13 +23904,13 @@ var require_query2 = __commonJS({
|
|
|
23821
23904
|
var self2 = this;
|
|
23822
23905
|
this.native = client.native;
|
|
23823
23906
|
client.native.arrayMode = this._arrayMode;
|
|
23824
|
-
var after = function(
|
|
23907
|
+
var after = function(err2, rows, results) {
|
|
23825
23908
|
client.native.arrayMode = false;
|
|
23826
23909
|
setImmediate(function() {
|
|
23827
23910
|
self2.emit("_done");
|
|
23828
23911
|
});
|
|
23829
|
-
if (
|
|
23830
|
-
return self2.handleError(
|
|
23912
|
+
if (err2) {
|
|
23913
|
+
return self2.handleError(err2);
|
|
23831
23914
|
}
|
|
23832
23915
|
if (self2._emitRowEvents) {
|
|
23833
23916
|
if (results.length > 1) {
|
|
@@ -23860,21 +23943,21 @@ var require_query2 = __commonJS({
|
|
|
23860
23943
|
var values = (this.values || []).map(utils.prepareValue);
|
|
23861
23944
|
if (client.namedQueries[this.name]) {
|
|
23862
23945
|
if (this.text && client.namedQueries[this.name] !== this.text) {
|
|
23863
|
-
const
|
|
23864
|
-
return after(
|
|
23946
|
+
const err2 = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);
|
|
23947
|
+
return after(err2);
|
|
23865
23948
|
}
|
|
23866
23949
|
return client.native.execute(this.name, values, after);
|
|
23867
23950
|
}
|
|
23868
|
-
return client.native.prepare(this.name, this.text, values.length, function(
|
|
23869
|
-
if (
|
|
23870
|
-
return after(
|
|
23951
|
+
return client.native.prepare(this.name, this.text, values.length, function(err2) {
|
|
23952
|
+
if (err2)
|
|
23953
|
+
return after(err2);
|
|
23871
23954
|
client.namedQueries[self2.name] = self2.text;
|
|
23872
23955
|
return self2.native.execute(self2.name, values, after);
|
|
23873
23956
|
});
|
|
23874
23957
|
} else if (this.values) {
|
|
23875
23958
|
if (!Array.isArray(this.values)) {
|
|
23876
|
-
const
|
|
23877
|
-
return after(
|
|
23959
|
+
const err2 = new Error("Query values must be an array");
|
|
23960
|
+
return after(err2);
|
|
23878
23961
|
}
|
|
23879
23962
|
var vals = this.values.map(utils.prepareValue);
|
|
23880
23963
|
client.native.query(this.text, vals, after);
|
|
@@ -23885,13 +23968,17 @@ var require_query2 = __commonJS({
|
|
|
23885
23968
|
}
|
|
23886
23969
|
});
|
|
23887
23970
|
|
|
23888
|
-
// node_modules/.pnpm/pg@8.
|
|
23971
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/native/client.js
|
|
23889
23972
|
var require_client2 = __commonJS({
|
|
23890
|
-
"node_modules/.pnpm/pg@8.
|
|
23973
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/native/client.js"(exports, module2) {
|
|
23891
23974
|
"use strict";
|
|
23892
|
-
var Native
|
|
23975
|
+
var Native;
|
|
23976
|
+
try {
|
|
23977
|
+
Native = require("pg-native");
|
|
23978
|
+
} catch (e) {
|
|
23979
|
+
throw e;
|
|
23980
|
+
}
|
|
23893
23981
|
var TypeOverrides = require_type_overrides();
|
|
23894
|
-
var pkg = require_package();
|
|
23895
23982
|
var EventEmitter = require("events").EventEmitter;
|
|
23896
23983
|
var util2 = require("util");
|
|
23897
23984
|
var ConnectionParameters = require_connection_parameters();
|
|
@@ -23910,6 +23997,8 @@ var require_client2 = __commonJS({
|
|
|
23910
23997
|
this._connected = false;
|
|
23911
23998
|
this._queryable = true;
|
|
23912
23999
|
var cp = this.connectionParameters = new ConnectionParameters(config);
|
|
24000
|
+
if (config.nativeConnectionString)
|
|
24001
|
+
cp.nativeConnectionString = config.nativeConnectionString;
|
|
23913
24002
|
this.user = cp.user;
|
|
23914
24003
|
Object.defineProperty(this, "password", {
|
|
23915
24004
|
configurable: true,
|
|
@@ -23924,11 +24013,11 @@ var require_client2 = __commonJS({
|
|
|
23924
24013
|
};
|
|
23925
24014
|
Client2.Query = NativeQuery;
|
|
23926
24015
|
util2.inherits(Client2, EventEmitter);
|
|
23927
|
-
Client2.prototype._errorAllQueries = function(
|
|
24016
|
+
Client2.prototype._errorAllQueries = function(err2) {
|
|
23928
24017
|
const enqueueError = (query) => {
|
|
23929
24018
|
process.nextTick(() => {
|
|
23930
24019
|
query.native = this.native;
|
|
23931
|
-
query.handleError(
|
|
24020
|
+
query.handleError(err2);
|
|
23932
24021
|
});
|
|
23933
24022
|
};
|
|
23934
24023
|
if (this._hasActiveQuery()) {
|
|
@@ -23945,19 +24034,21 @@ var require_client2 = __commonJS({
|
|
|
23945
24034
|
return;
|
|
23946
24035
|
}
|
|
23947
24036
|
this._connecting = true;
|
|
23948
|
-
this.connectionParameters.getLibpqConnectionString(function(
|
|
23949
|
-
if (
|
|
23950
|
-
|
|
23951
|
-
|
|
23952
|
-
|
|
24037
|
+
this.connectionParameters.getLibpqConnectionString(function(err2, conString) {
|
|
24038
|
+
if (self2.connectionParameters.nativeConnectionString)
|
|
24039
|
+
conString = self2.connectionParameters.nativeConnectionString;
|
|
24040
|
+
if (err2)
|
|
24041
|
+
return cb(err2);
|
|
24042
|
+
self2.native.connect(conString, function(err3) {
|
|
24043
|
+
if (err3) {
|
|
23953
24044
|
self2.native.end();
|
|
23954
|
-
return cb(
|
|
24045
|
+
return cb(err3);
|
|
23955
24046
|
}
|
|
23956
24047
|
self2._connected = true;
|
|
23957
|
-
self2.native.on("error", function(
|
|
24048
|
+
self2.native.on("error", function(err4) {
|
|
23958
24049
|
self2._queryable = false;
|
|
23959
|
-
self2._errorAllQueries(
|
|
23960
|
-
self2.emit("error",
|
|
24050
|
+
self2._errorAllQueries(err4);
|
|
24051
|
+
self2.emit("error", err4);
|
|
23961
24052
|
});
|
|
23962
24053
|
self2.native.on("notification", function(msg) {
|
|
23963
24054
|
self2.emit("notification", {
|
|
@@ -24008,8 +24099,11 @@ var require_client2 = __commonJS({
|
|
|
24008
24099
|
result = new this._Promise((resolve, reject) => {
|
|
24009
24100
|
resolveOut = resolve;
|
|
24010
24101
|
rejectOut = reject;
|
|
24102
|
+
}).catch((err2) => {
|
|
24103
|
+
Error.captureStackTrace(err2);
|
|
24104
|
+
throw err2;
|
|
24011
24105
|
});
|
|
24012
|
-
query.callback = (
|
|
24106
|
+
query.callback = (err2, res) => err2 ? rejectOut(err2) : resolveOut(res);
|
|
24013
24107
|
}
|
|
24014
24108
|
}
|
|
24015
24109
|
if (readTimeout) {
|
|
@@ -24028,9 +24122,9 @@ var require_client2 = __commonJS({
|
|
|
24028
24122
|
}
|
|
24029
24123
|
this._pulseQueryQueue();
|
|
24030
24124
|
}, readTimeout);
|
|
24031
|
-
query.callback = (
|
|
24125
|
+
query.callback = (err2, res) => {
|
|
24032
24126
|
clearTimeout(readTimeoutTimer);
|
|
24033
|
-
queryCallback(
|
|
24127
|
+
queryCallback(err2, res);
|
|
24034
24128
|
};
|
|
24035
24129
|
}
|
|
24036
24130
|
if (!this._queryable) {
|
|
@@ -24060,7 +24154,7 @@ var require_client2 = __commonJS({
|
|
|
24060
24154
|
var result;
|
|
24061
24155
|
if (!cb) {
|
|
24062
24156
|
result = new this._Promise(function(resolve, reject) {
|
|
24063
|
-
cb = (
|
|
24157
|
+
cb = (err2) => err2 ? reject(err2) : resolve();
|
|
24064
24158
|
});
|
|
24065
24159
|
}
|
|
24066
24160
|
this.native.end(function() {
|
|
@@ -24118,23 +24212,24 @@ var require_client2 = __commonJS({
|
|
|
24118
24212
|
}
|
|
24119
24213
|
});
|
|
24120
24214
|
|
|
24121
|
-
// node_modules/.pnpm/pg@8.
|
|
24215
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/native/index.js
|
|
24122
24216
|
var require_native = __commonJS({
|
|
24123
|
-
"node_modules/.pnpm/pg@8.
|
|
24217
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/native/index.js"(exports, module2) {
|
|
24124
24218
|
"use strict";
|
|
24125
24219
|
module2.exports = require_client2();
|
|
24126
24220
|
}
|
|
24127
24221
|
});
|
|
24128
24222
|
|
|
24129
|
-
// node_modules/.pnpm/pg@8.
|
|
24223
|
+
// node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/index.js
|
|
24130
24224
|
var require_lib2 = __commonJS({
|
|
24131
|
-
"node_modules/.pnpm/pg@8.
|
|
24225
|
+
"node_modules/.pnpm/pg@8.11.3/node_modules/pg/lib/index.js"(exports, module2) {
|
|
24132
24226
|
"use strict";
|
|
24133
24227
|
var Client2 = require_client();
|
|
24134
24228
|
var defaults3 = require_defaults();
|
|
24135
24229
|
var Connection = require_connection();
|
|
24136
24230
|
var Pool = require_pg_pool();
|
|
24137
24231
|
var { DatabaseError } = require_dist();
|
|
24232
|
+
var { escapeIdentifier, escapeLiteral } = require_utils2();
|
|
24138
24233
|
var poolFactory = (Client3) => {
|
|
24139
24234
|
return class BoundPool extends Pool {
|
|
24140
24235
|
constructor(options) {
|
|
@@ -24151,6 +24246,8 @@ var require_lib2 = __commonJS({
|
|
|
24151
24246
|
this.Connection = Connection;
|
|
24152
24247
|
this.types = require_pg_types();
|
|
24153
24248
|
this.DatabaseError = DatabaseError;
|
|
24249
|
+
this.escapeIdentifier = escapeIdentifier;
|
|
24250
|
+
this.escapeLiteral = escapeLiteral;
|
|
24154
24251
|
};
|
|
24155
24252
|
if (typeof process.env.NODE_PG_FORCE_NATIVE !== "undefined") {
|
|
24156
24253
|
module2.exports = new PG(require_native());
|
|
@@ -24163,9 +24260,9 @@ var require_lib2 = __commonJS({
|
|
|
24163
24260
|
var native = null;
|
|
24164
24261
|
try {
|
|
24165
24262
|
native = new PG(require_native());
|
|
24166
|
-
} catch (
|
|
24167
|
-
if (
|
|
24168
|
-
throw
|
|
24263
|
+
} catch (err2) {
|
|
24264
|
+
if (err2.code !== "MODULE_NOT_FOUND") {
|
|
24265
|
+
throw err2;
|
|
24169
24266
|
}
|
|
24170
24267
|
}
|
|
24171
24268
|
Object.defineProperty(module2.exports, "native", {
|
|
@@ -24666,6 +24763,13 @@ var init_sqliteIntrospect = __esm({
|
|
|
24666
24763
|
}
|
|
24667
24764
|
});
|
|
24668
24765
|
|
|
24766
|
+
// src/cli/utils.ts
|
|
24767
|
+
var init_utils3 = __esm({
|
|
24768
|
+
"src/cli/utils.ts"() {
|
|
24769
|
+
init_views();
|
|
24770
|
+
}
|
|
24771
|
+
});
|
|
24772
|
+
|
|
24669
24773
|
// node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/lib/SqlString.js
|
|
24670
24774
|
var require_SqlString = __commonJS({
|
|
24671
24775
|
"node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/lib/SqlString.js"(exports) {
|
|
@@ -33107,12 +33211,12 @@ var require_packet = __commonJS({
|
|
|
33107
33211
|
sqlState = this.readBuffer(5).toString();
|
|
33108
33212
|
}
|
|
33109
33213
|
const message = this.readString(void 0, encoding);
|
|
33110
|
-
const
|
|
33111
|
-
|
|
33112
|
-
|
|
33113
|
-
|
|
33114
|
-
|
|
33115
|
-
return
|
|
33214
|
+
const err2 = new Error(message);
|
|
33215
|
+
err2.code = ErrorCodeToName[errorCode];
|
|
33216
|
+
err2.errno = errorCode;
|
|
33217
|
+
err2.sqlState = sqlState;
|
|
33218
|
+
err2.sqlMessage = message;
|
|
33219
|
+
return err2;
|
|
33116
33220
|
}
|
|
33117
33221
|
writeInt32(n) {
|
|
33118
33222
|
this.buffer.writeUInt32LE(n, this.offset);
|
|
@@ -34510,9 +34614,9 @@ var require_handshake = __commonJS({
|
|
|
34510
34614
|
this.autPluginName = args.autPluginName;
|
|
34511
34615
|
}
|
|
34512
34616
|
setScrambleData(cb) {
|
|
34513
|
-
require("crypto").randomBytes(20, (
|
|
34514
|
-
if (
|
|
34515
|
-
cb(
|
|
34617
|
+
require("crypto").randomBytes(20, (err2, data) => {
|
|
34618
|
+
if (err2) {
|
|
34619
|
+
cb(err2);
|
|
34516
34620
|
return;
|
|
34517
34621
|
}
|
|
34518
34622
|
this.authPluginData1 = data.slice(0, 8);
|
|
@@ -35268,17 +35372,17 @@ var require_command = __commonJS({
|
|
|
35268
35372
|
connection._resetSequenceId();
|
|
35269
35373
|
}
|
|
35270
35374
|
if (packet && packet.isError()) {
|
|
35271
|
-
const
|
|
35272
|
-
|
|
35375
|
+
const err2 = packet.asError(connection.clientEncoding);
|
|
35376
|
+
err2.sql = this.sql || this.query;
|
|
35273
35377
|
if (this.queryTimeout) {
|
|
35274
35378
|
Timers.clearTimeout(this.queryTimeout);
|
|
35275
35379
|
this.queryTimeout = null;
|
|
35276
35380
|
}
|
|
35277
35381
|
if (this.onResult) {
|
|
35278
|
-
this.onResult(
|
|
35382
|
+
this.onResult(err2);
|
|
35279
35383
|
this.emit("end");
|
|
35280
35384
|
} else {
|
|
35281
|
-
this.emit("error",
|
|
35385
|
+
this.emit("error", err2);
|
|
35282
35386
|
this.emit("end");
|
|
35283
35387
|
}
|
|
35284
35388
|
return true;
|
|
@@ -35499,9 +35603,9 @@ var require_auth_switch = __commonJS({
|
|
|
35499
35603
|
if (connection.config.authSwitchHandler && pluginName !== "mysql_native_password") {
|
|
35500
35604
|
const legacySwitchHandler = connection.config.authSwitchHandler;
|
|
35501
35605
|
warnLegacyAuthSwitch();
|
|
35502
|
-
legacySwitchHandler({ pluginName, pluginData }, (
|
|
35503
|
-
if (
|
|
35504
|
-
return authSwitchPluginError(
|
|
35606
|
+
legacySwitchHandler({ pluginName, pluginData }, (err2, data) => {
|
|
35607
|
+
if (err2) {
|
|
35608
|
+
return authSwitchPluginError(err2, command);
|
|
35505
35609
|
}
|
|
35506
35610
|
connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket());
|
|
35507
35611
|
});
|
|
@@ -35520,8 +35624,8 @@ var require_auth_switch = __commonJS({
|
|
|
35520
35624
|
if (data) {
|
|
35521
35625
|
connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket());
|
|
35522
35626
|
}
|
|
35523
|
-
}).catch((
|
|
35524
|
-
authSwitchPluginError(
|
|
35627
|
+
}).catch((err2) => {
|
|
35628
|
+
authSwitchPluginError(err2, command);
|
|
35525
35629
|
});
|
|
35526
35630
|
}
|
|
35527
35631
|
function authSwitchRequestMoreData(packet, connection, command) {
|
|
@@ -35529,9 +35633,9 @@ var require_auth_switch = __commonJS({
|
|
|
35529
35633
|
if (connection.config.authSwitchHandler) {
|
|
35530
35634
|
const legacySwitchHandler = connection.config.authSwitchHandler;
|
|
35531
35635
|
warnLegacyAuthSwitch();
|
|
35532
|
-
legacySwitchHandler({ pluginData: data }, (
|
|
35533
|
-
if (
|
|
35534
|
-
return authSwitchPluginError(
|
|
35636
|
+
legacySwitchHandler({ pluginData: data }, (err2, data2) => {
|
|
35637
|
+
if (err2) {
|
|
35638
|
+
return authSwitchPluginError(err2, command);
|
|
35535
35639
|
}
|
|
35536
35640
|
connection.writePacket(new Packets.AuthSwitchResponse(data2).toPacket());
|
|
35537
35641
|
});
|
|
@@ -35546,8 +35650,8 @@ var require_auth_switch = __commonJS({
|
|
|
35546
35650
|
if (data2) {
|
|
35547
35651
|
connection.writePacket(new Packets.AuthSwitchResponse(data2).toPacket());
|
|
35548
35652
|
}
|
|
35549
|
-
}).catch((
|
|
35550
|
-
authSwitchPluginError(
|
|
35653
|
+
}).catch((err2) => {
|
|
35654
|
+
authSwitchPluginError(err2, command);
|
|
35551
35655
|
});
|
|
35552
35656
|
}
|
|
35553
35657
|
module2.exports = {
|
|
@@ -35653,8 +35757,8 @@ var require_seq_queue = __commonJS({
|
|
|
35653
35757
|
return res;
|
|
35654
35758
|
}
|
|
35655
35759
|
});
|
|
35656
|
-
} catch (
|
|
35657
|
-
self2.emit("error",
|
|
35760
|
+
} catch (err2) {
|
|
35761
|
+
self2.emit("error", err2, task);
|
|
35658
35762
|
process.nextTick(function() {
|
|
35659
35763
|
self2._next(task.id);
|
|
35660
35764
|
});
|
|
@@ -35690,9 +35794,9 @@ var require_compressed_protocol = __commonJS({
|
|
|
35690
35794
|
const body = packet.readBuffer();
|
|
35691
35795
|
if (deflatedLength !== 0) {
|
|
35692
35796
|
connection.inflateQueue.push((task) => {
|
|
35693
|
-
zlib.inflate(body, (
|
|
35694
|
-
if (
|
|
35695
|
-
connection._handleNetworkError(
|
|
35797
|
+
zlib.inflate(body, (err2, data) => {
|
|
35798
|
+
if (err2) {
|
|
35799
|
+
connection._handleNetworkError(err2);
|
|
35696
35800
|
return;
|
|
35697
35801
|
}
|
|
35698
35802
|
connection._bumpCompressedSequenceId(packet.numPackets);
|
|
@@ -35726,9 +35830,9 @@ var require_compressed_protocol = __commonJS({
|
|
|
35726
35830
|
const compressHeader = Buffer.allocUnsafe(7);
|
|
35727
35831
|
(function(seqId) {
|
|
35728
35832
|
connection.deflateQueue.push((task) => {
|
|
35729
|
-
zlib.deflate(buffer, (
|
|
35730
|
-
if (
|
|
35731
|
-
connection._handleFatalError(
|
|
35833
|
+
zlib.deflate(buffer, (err2, compressed) => {
|
|
35834
|
+
if (err2) {
|
|
35835
|
+
connection._handleFatalError(err2);
|
|
35732
35836
|
return;
|
|
35733
35837
|
}
|
|
35734
35838
|
let compressedLength = compressed.length;
|
|
@@ -35881,19 +35985,19 @@ var require_client_handshake = __commonJS({
|
|
|
35881
35985
|
this.clientFlags = this.clientFlags | connection.config.compress;
|
|
35882
35986
|
if (connection.config.ssl) {
|
|
35883
35987
|
if (!serverSSLSupport) {
|
|
35884
|
-
const
|
|
35885
|
-
|
|
35886
|
-
|
|
35887
|
-
this.emit("error",
|
|
35988
|
+
const err2 = new Error("Server does not support secure connnection");
|
|
35989
|
+
err2.code = "HANDSHAKE_NO_SSL_SUPPORT";
|
|
35990
|
+
err2.fatal = true;
|
|
35991
|
+
this.emit("error", err2);
|
|
35888
35992
|
return false;
|
|
35889
35993
|
}
|
|
35890
35994
|
this.clientFlags |= ClientConstants.SSL;
|
|
35891
35995
|
this.sendSSLRequest(connection);
|
|
35892
|
-
connection.startTLS((
|
|
35893
|
-
if (
|
|
35894
|
-
|
|
35895
|
-
|
|
35896
|
-
this.emit("error",
|
|
35996
|
+
connection.startTLS((err2) => {
|
|
35997
|
+
if (err2) {
|
|
35998
|
+
err2.code = "HANDSHAKE_SSL_ERROR";
|
|
35999
|
+
err2.fatal = true;
|
|
36000
|
+
this.emit("error", err2);
|
|
35897
36001
|
return;
|
|
35898
36002
|
}
|
|
35899
36003
|
this.sendCredentials(connection);
|
|
@@ -35914,25 +36018,25 @@ var require_client_handshake = __commonJS({
|
|
|
35914
36018
|
authSwitch.authSwitchRequest(packet, connection, this);
|
|
35915
36019
|
}
|
|
35916
36020
|
return _ClientHandshake.prototype.handshakeResult;
|
|
35917
|
-
} catch (
|
|
35918
|
-
|
|
35919
|
-
|
|
36021
|
+
} catch (err2) {
|
|
36022
|
+
err2.code = "AUTH_SWITCH_PLUGIN_ERROR";
|
|
36023
|
+
err2.fatal = true;
|
|
35920
36024
|
if (this.onResult) {
|
|
35921
|
-
this.onResult(
|
|
36025
|
+
this.onResult(err2);
|
|
35922
36026
|
} else {
|
|
35923
|
-
this.emit("error",
|
|
36027
|
+
this.emit("error", err2);
|
|
35924
36028
|
}
|
|
35925
36029
|
return null;
|
|
35926
36030
|
}
|
|
35927
36031
|
}
|
|
35928
36032
|
if (marker !== 0) {
|
|
35929
|
-
const
|
|
35930
|
-
|
|
35931
|
-
|
|
36033
|
+
const err2 = new Error("Unexpected packet during handshake phase");
|
|
36034
|
+
err2.code = "HANDSHAKE_UNKNOWN_ERROR";
|
|
36035
|
+
err2.fatal = true;
|
|
35932
36036
|
if (this.onResult) {
|
|
35933
|
-
this.onResult(
|
|
36037
|
+
this.onResult(err2);
|
|
35934
36038
|
} else {
|
|
35935
|
-
this.emit("error",
|
|
36039
|
+
this.emit("error", err2);
|
|
35936
36040
|
}
|
|
35937
36041
|
return null;
|
|
35938
36042
|
}
|
|
@@ -35969,8 +36073,8 @@ var require_server_handshake = __commonJS({
|
|
|
35969
36073
|
start(packet, connection) {
|
|
35970
36074
|
const serverHelloPacket = new Packets.Handshake(this.args);
|
|
35971
36075
|
this.serverHello = serverHelloPacket;
|
|
35972
|
-
serverHelloPacket.setScrambleData((
|
|
35973
|
-
if (
|
|
36076
|
+
serverHelloPacket.setScrambleData((err2) => {
|
|
36077
|
+
if (err2) {
|
|
35974
36078
|
connection.emit("error", new Error("Error generating random bytes"));
|
|
35975
36079
|
return;
|
|
35976
36080
|
}
|
|
@@ -35991,7 +36095,7 @@ var require_server_handshake = __commonJS({
|
|
|
35991
36095
|
authPluginData2: this.serverHello.authPluginData2,
|
|
35992
36096
|
authToken: clientHelloReply.authToken
|
|
35993
36097
|
},
|
|
35994
|
-
(
|
|
36098
|
+
(err2, mysqlError) => {
|
|
35995
36099
|
if (!mysqlError) {
|
|
35996
36100
|
connection.writeOk();
|
|
35997
36101
|
} else {
|
|
@@ -36379,7 +36483,7 @@ var require_helpers = __commonJS({
|
|
|
36379
36483
|
var cardinalRecommended = false;
|
|
36380
36484
|
try {
|
|
36381
36485
|
highlightFn = require("cardinal").highlight;
|
|
36382
|
-
} catch (
|
|
36486
|
+
} catch (err2) {
|
|
36383
36487
|
highlightFn = (text) => {
|
|
36384
36488
|
if (!cardinalRecommended) {
|
|
36385
36489
|
console.log("For nicer debug output consider install cardinal@^2.0.0");
|
|
@@ -36832,9 +36936,9 @@ var require_query4 = __commonJS({
|
|
|
36832
36936
|
this._connection = null;
|
|
36833
36937
|
}
|
|
36834
36938
|
then() {
|
|
36835
|
-
const
|
|
36836
|
-
console.log(
|
|
36837
|
-
throw new Error(
|
|
36939
|
+
const err2 = "You have tried to call .then(), .catch(), or invoked await on the result of query that is not a promise, which is a programming error. Try calling con.promise().query(), or require('mysql2/promise') instead of 'mysql2' for a promise-compatible version of the query interface. To learn how to use async/await or Promises check out documentation at https://www.npmjs.com/package/mysql2#using-promise-wrapper, or the mysql2 documentation at https://github.com/sidorares/node-mysql2/tree/master/documentation/Promise-Wrapper.md";
|
|
36940
|
+
console.log(err2);
|
|
36941
|
+
throw new Error(err2);
|
|
36838
36942
|
}
|
|
36839
36943
|
/* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */
|
|
36840
36944
|
start(_packet, connection) {
|
|
@@ -36949,8 +37053,8 @@ var require_query4 = __commonJS({
|
|
|
36949
37053
|
connection.removeListener("error", onConnectionError);
|
|
36950
37054
|
connection.writePacket(EmptyPacket);
|
|
36951
37055
|
};
|
|
36952
|
-
const onError = (
|
|
36953
|
-
this._localStreamError =
|
|
37056
|
+
const onError = (err2) => {
|
|
37057
|
+
this._localStreamError = err2;
|
|
36954
37058
|
connection.removeListener("error", onConnectionError);
|
|
36955
37059
|
connection.writePacket(EmptyPacket);
|
|
36956
37060
|
};
|
|
@@ -37016,8 +37120,8 @@ var require_query4 = __commonJS({
|
|
|
37016
37120
|
this._fields[this._resultIndex],
|
|
37017
37121
|
this.options
|
|
37018
37122
|
);
|
|
37019
|
-
} catch (
|
|
37020
|
-
this._localStreamError =
|
|
37123
|
+
} catch (err2) {
|
|
37124
|
+
this._localStreamError = err2;
|
|
37021
37125
|
return this.doneInsert(null);
|
|
37022
37126
|
}
|
|
37023
37127
|
if (this.onResult) {
|
|
@@ -37044,8 +37148,8 @@ var require_query4 = __commonJS({
|
|
|
37044
37148
|
}
|
|
37045
37149
|
stream.emit("result", row);
|
|
37046
37150
|
});
|
|
37047
|
-
this.on("error", (
|
|
37048
|
-
stream.emit("error",
|
|
37151
|
+
this.on("error", (err2) => {
|
|
37152
|
+
stream.emit("error", err2);
|
|
37049
37153
|
});
|
|
37050
37154
|
this.on("end", () => {
|
|
37051
37155
|
stream.push(null);
|
|
@@ -37070,14 +37174,14 @@ var require_query4 = __commonJS({
|
|
|
37070
37174
|
Timers.clearTimeout(this.queryTimeout);
|
|
37071
37175
|
this.queryTimeout = null;
|
|
37072
37176
|
}
|
|
37073
|
-
const
|
|
37074
|
-
|
|
37075
|
-
|
|
37076
|
-
|
|
37177
|
+
const err2 = new Error("Query inactivity timeout");
|
|
37178
|
+
err2.errorno = "PROTOCOL_SEQUENCE_TIMEOUT";
|
|
37179
|
+
err2.code = "PROTOCOL_SEQUENCE_TIMEOUT";
|
|
37180
|
+
err2.syscall = "query";
|
|
37077
37181
|
if (this.onResult) {
|
|
37078
|
-
this.onResult(
|
|
37182
|
+
this.onResult(err2);
|
|
37079
37183
|
} else {
|
|
37080
|
-
this.emit("error",
|
|
37184
|
+
this.emit("error", err2);
|
|
37081
37185
|
}
|
|
37082
37186
|
}
|
|
37083
37187
|
};
|
|
@@ -38141,7 +38245,7 @@ var require_connection_config = __commonJS({
|
|
|
38141
38245
|
parsedUrl.searchParams.forEach((value, key) => {
|
|
38142
38246
|
try {
|
|
38143
38247
|
options[key] = JSON.parse(value);
|
|
38144
|
-
} catch (
|
|
38248
|
+
} catch (err2) {
|
|
38145
38249
|
options[key] = value;
|
|
38146
38250
|
}
|
|
38147
38251
|
});
|
|
@@ -39426,9 +39530,9 @@ var require_connection2 = __commonJS({
|
|
|
39426
39530
|
this.threadId = handshakeCommand.handshake.connectionId;
|
|
39427
39531
|
this.emit("connect", handshakeCommand.handshake);
|
|
39428
39532
|
});
|
|
39429
|
-
handshakeCommand.on("error", (
|
|
39533
|
+
handshakeCommand.on("error", (err2) => {
|
|
39430
39534
|
this._closing = true;
|
|
39431
|
-
this._notifyError(
|
|
39535
|
+
this._notifyError(err2);
|
|
39432
39536
|
});
|
|
39433
39537
|
this.addCommand(handshakeCommand);
|
|
39434
39538
|
}
|
|
@@ -39446,35 +39550,35 @@ var require_connection2 = __commonJS({
|
|
|
39446
39550
|
return new PromiseConnection(this, promiseImpl);
|
|
39447
39551
|
}
|
|
39448
39552
|
_addCommandClosedState(cmd) {
|
|
39449
|
-
const
|
|
39553
|
+
const err2 = new Error(
|
|
39450
39554
|
"Can't add new command when connection is in closed state"
|
|
39451
39555
|
);
|
|
39452
|
-
|
|
39556
|
+
err2.fatal = true;
|
|
39453
39557
|
if (cmd.onResult) {
|
|
39454
|
-
cmd.onResult(
|
|
39558
|
+
cmd.onResult(err2);
|
|
39455
39559
|
} else {
|
|
39456
|
-
this.emit("error",
|
|
39560
|
+
this.emit("error", err2);
|
|
39457
39561
|
}
|
|
39458
39562
|
}
|
|
39459
|
-
_handleFatalError(
|
|
39460
|
-
|
|
39563
|
+
_handleFatalError(err2) {
|
|
39564
|
+
err2.fatal = true;
|
|
39461
39565
|
this.stream.removeAllListeners("data");
|
|
39462
39566
|
this.addCommand = this._addCommandClosedState;
|
|
39463
39567
|
this.write = () => {
|
|
39464
39568
|
this.emit("error", new Error("Can't write in closed state"));
|
|
39465
39569
|
};
|
|
39466
|
-
this._notifyError(
|
|
39467
|
-
this._fatalError =
|
|
39570
|
+
this._notifyError(err2);
|
|
39571
|
+
this._fatalError = err2;
|
|
39468
39572
|
}
|
|
39469
|
-
_handleNetworkError(
|
|
39573
|
+
_handleNetworkError(err2) {
|
|
39470
39574
|
if (this.connectTimeout) {
|
|
39471
39575
|
Timers.clearTimeout(this.connectTimeout);
|
|
39472
39576
|
this.connectTimeout = null;
|
|
39473
39577
|
}
|
|
39474
|
-
if (
|
|
39578
|
+
if (err2.errno === "ECONNRESET" && this._closing) {
|
|
39475
39579
|
return;
|
|
39476
39580
|
}
|
|
39477
|
-
this._handleFatalError(
|
|
39581
|
+
this._handleFatalError(err2);
|
|
39478
39582
|
}
|
|
39479
39583
|
_handleTimeoutError() {
|
|
39480
39584
|
if (this.connectTimeout) {
|
|
@@ -39482,15 +39586,15 @@ var require_connection2 = __commonJS({
|
|
|
39482
39586
|
this.connectTimeout = null;
|
|
39483
39587
|
}
|
|
39484
39588
|
this.stream.destroy && this.stream.destroy();
|
|
39485
|
-
const
|
|
39486
|
-
|
|
39487
|
-
|
|
39488
|
-
|
|
39489
|
-
this._handleNetworkError(
|
|
39589
|
+
const err2 = new Error("connect ETIMEDOUT");
|
|
39590
|
+
err2.errorno = "ETIMEDOUT";
|
|
39591
|
+
err2.code = "ETIMEDOUT";
|
|
39592
|
+
err2.syscall = "connect";
|
|
39593
|
+
this._handleNetworkError(err2);
|
|
39490
39594
|
}
|
|
39491
39595
|
// notify all commands in the queue and bubble error as connection "error"
|
|
39492
39596
|
// called on stream error or unexpected termination
|
|
39493
|
-
_notifyError(
|
|
39597
|
+
_notifyError(err2) {
|
|
39494
39598
|
if (this.connectTimeout) {
|
|
39495
39599
|
Timers.clearTimeout(this.connectTimeout);
|
|
39496
39600
|
this.connectTimeout = null;
|
|
@@ -39501,29 +39605,29 @@ var require_connection2 = __commonJS({
|
|
|
39501
39605
|
let command;
|
|
39502
39606
|
let bubbleErrorToConnection = !this._command;
|
|
39503
39607
|
if (this._command && this._command.onResult) {
|
|
39504
|
-
this._command.onResult(
|
|
39608
|
+
this._command.onResult(err2);
|
|
39505
39609
|
this._command = null;
|
|
39506
39610
|
} else if (!(this._command && this._command.constructor === Commands.ClientHandshake && this._commands.length > 0)) {
|
|
39507
39611
|
bubbleErrorToConnection = true;
|
|
39508
39612
|
}
|
|
39509
39613
|
while (command = this._commands.shift()) {
|
|
39510
39614
|
if (command.onResult) {
|
|
39511
|
-
command.onResult(
|
|
39615
|
+
command.onResult(err2);
|
|
39512
39616
|
} else {
|
|
39513
39617
|
bubbleErrorToConnection = true;
|
|
39514
39618
|
}
|
|
39515
39619
|
}
|
|
39516
39620
|
if (bubbleErrorToConnection || this._pool) {
|
|
39517
|
-
this.emit("error",
|
|
39621
|
+
this.emit("error", err2);
|
|
39518
39622
|
}
|
|
39519
|
-
if (
|
|
39623
|
+
if (err2.fatal) {
|
|
39520
39624
|
this.close();
|
|
39521
39625
|
}
|
|
39522
39626
|
}
|
|
39523
39627
|
write(buffer) {
|
|
39524
|
-
const result = this.stream.write(buffer, (
|
|
39525
|
-
if (
|
|
39526
|
-
this._handleNetworkError(
|
|
39628
|
+
const result = this.stream.write(buffer, (err2) => {
|
|
39629
|
+
if (err2) {
|
|
39630
|
+
this._handleNetworkError(err2);
|
|
39527
39631
|
}
|
|
39528
39632
|
});
|
|
39529
39633
|
if (!result) {
|
|
@@ -39612,11 +39716,11 @@ var require_connection2 = __commonJS({
|
|
|
39612
39716
|
secureContext,
|
|
39613
39717
|
isServer: false
|
|
39614
39718
|
});
|
|
39615
|
-
secureSocket.on("_tlsError", (
|
|
39719
|
+
secureSocket.on("_tlsError", (err2) => {
|
|
39616
39720
|
if (secureEstablished) {
|
|
39617
|
-
this._handleNetworkError(
|
|
39721
|
+
this._handleNetworkError(err2);
|
|
39618
39722
|
} else {
|
|
39619
|
-
onSecure(
|
|
39723
|
+
onSecure(err2);
|
|
39620
39724
|
}
|
|
39621
39725
|
});
|
|
39622
39726
|
secureSocket.on("secure", () => {
|
|
@@ -39650,10 +39754,10 @@ var require_connection2 = __commonJS({
|
|
|
39650
39754
|
if (this._closing) {
|
|
39651
39755
|
return;
|
|
39652
39756
|
}
|
|
39653
|
-
const
|
|
39654
|
-
|
|
39655
|
-
|
|
39656
|
-
this.emit("error",
|
|
39757
|
+
const err2 = new Error(message);
|
|
39758
|
+
err2.fatal = true;
|
|
39759
|
+
err2.code = code || "PROTOCOL_ERROR";
|
|
39760
|
+
this.emit("error", err2);
|
|
39657
39761
|
}
|
|
39658
39762
|
handlePacket(packet) {
|
|
39659
39763
|
if (this._paused) {
|
|
@@ -39662,13 +39766,13 @@ var require_connection2 = __commonJS({
|
|
|
39662
39766
|
}
|
|
39663
39767
|
if (packet) {
|
|
39664
39768
|
if (this.sequenceId !== packet.sequenceId) {
|
|
39665
|
-
const
|
|
39769
|
+
const err2 = new Error(
|
|
39666
39770
|
`Warning: got packets out of order. Expected ${this.sequenceId} but received ${packet.sequenceId}`
|
|
39667
39771
|
);
|
|
39668
|
-
|
|
39669
|
-
|
|
39670
|
-
this.emit("warn",
|
|
39671
|
-
console.error(
|
|
39772
|
+
err2.expected = this.sequenceId;
|
|
39773
|
+
err2.received = packet.sequenceId;
|
|
39774
|
+
this.emit("warn", err2);
|
|
39775
|
+
console.error(err2.message);
|
|
39672
39776
|
}
|
|
39673
39777
|
this._bumpSequenceId(packet.numPackets);
|
|
39674
39778
|
}
|
|
@@ -39859,15 +39963,15 @@ var require_connection2 = __commonJS({
|
|
|
39859
39963
|
});
|
|
39860
39964
|
}
|
|
39861
39965
|
const executeCommand = new Commands.Execute(options, cb);
|
|
39862
|
-
const prepareCommand = new Commands.Prepare(options, (
|
|
39863
|
-
if (
|
|
39966
|
+
const prepareCommand = new Commands.Prepare(options, (err2, stmt) => {
|
|
39967
|
+
if (err2) {
|
|
39864
39968
|
executeCommand.start = function() {
|
|
39865
39969
|
return null;
|
|
39866
39970
|
};
|
|
39867
39971
|
if (cb) {
|
|
39868
|
-
cb(
|
|
39972
|
+
cb(err2);
|
|
39869
39973
|
} else {
|
|
39870
|
-
executeCommand.emit("error",
|
|
39974
|
+
executeCommand.emit("error", err2);
|
|
39871
39975
|
}
|
|
39872
39976
|
executeCommand.emit("end");
|
|
39873
39977
|
return;
|
|
@@ -39895,12 +39999,12 @@ var require_connection2 = __commonJS({
|
|
|
39895
39999
|
charsetNumber,
|
|
39896
40000
|
currentConfig: this.config
|
|
39897
40001
|
},
|
|
39898
|
-
(
|
|
39899
|
-
if (
|
|
39900
|
-
|
|
40002
|
+
(err2) => {
|
|
40003
|
+
if (err2) {
|
|
40004
|
+
err2.fatal = true;
|
|
39901
40005
|
}
|
|
39902
40006
|
if (callback) {
|
|
39903
|
-
callback(
|
|
40007
|
+
callback(err2);
|
|
39904
40008
|
}
|
|
39905
40009
|
}
|
|
39906
40010
|
)
|
|
@@ -40144,11 +40248,11 @@ var require_pool_connection = __commonJS({
|
|
|
40144
40248
|
return new PromisePoolConnection(this, promiseImpl);
|
|
40145
40249
|
}
|
|
40146
40250
|
end() {
|
|
40147
|
-
const
|
|
40251
|
+
const err2 = new Error(
|
|
40148
40252
|
"Calling conn.end() to release a pooled connection is deprecated. In next version calling conn.end() will be restored to default conn.end() behavior. Use conn.release() instead."
|
|
40149
40253
|
);
|
|
40150
|
-
this.emit("warn",
|
|
40151
|
-
console.warn(
|
|
40254
|
+
this.emit("warn", err2);
|
|
40255
|
+
console.warn(err2.message);
|
|
40152
40256
|
this.release();
|
|
40153
40257
|
}
|
|
40154
40258
|
destroy() {
|
|
@@ -40218,12 +40322,12 @@ var require_pool = __commonJS({
|
|
|
40218
40322
|
config: this.config.connectionConfig
|
|
40219
40323
|
});
|
|
40220
40324
|
this._allConnections.push(connection);
|
|
40221
|
-
return connection.connect((
|
|
40325
|
+
return connection.connect((err2) => {
|
|
40222
40326
|
if (this._closed) {
|
|
40223
40327
|
return cb(new Error("Pool is closed."));
|
|
40224
40328
|
}
|
|
40225
|
-
if (
|
|
40226
|
-
return cb(
|
|
40329
|
+
if (err2) {
|
|
40330
|
+
return cb(err2);
|
|
40227
40331
|
}
|
|
40228
40332
|
this.emit("connection", connection);
|
|
40229
40333
|
this.emit("acquire", connection);
|
|
@@ -40257,22 +40361,22 @@ var require_pool = __commonJS({
|
|
|
40257
40361
|
end(cb) {
|
|
40258
40362
|
this._closed = true;
|
|
40259
40363
|
if (typeof cb !== "function") {
|
|
40260
|
-
cb = function(
|
|
40261
|
-
if (
|
|
40262
|
-
throw
|
|
40364
|
+
cb = function(err2) {
|
|
40365
|
+
if (err2) {
|
|
40366
|
+
throw err2;
|
|
40263
40367
|
}
|
|
40264
40368
|
};
|
|
40265
40369
|
}
|
|
40266
40370
|
let calledBack = false;
|
|
40267
40371
|
let closedConnections = 0;
|
|
40268
40372
|
let connection;
|
|
40269
|
-
const endCB = function(
|
|
40373
|
+
const endCB = function(err2) {
|
|
40270
40374
|
if (calledBack) {
|
|
40271
40375
|
return;
|
|
40272
40376
|
}
|
|
40273
|
-
if (
|
|
40377
|
+
if (err2 || ++closedConnections >= this._allConnections.length) {
|
|
40274
40378
|
calledBack = true;
|
|
40275
|
-
cb(
|
|
40379
|
+
cb(err2);
|
|
40276
40380
|
return;
|
|
40277
40381
|
}
|
|
40278
40382
|
}.bind(this);
|
|
@@ -40295,12 +40399,12 @@ var require_pool = __commonJS({
|
|
|
40295
40399
|
if (typeof cmdQuery.namedPlaceholders === "undefined") {
|
|
40296
40400
|
cmdQuery.namedPlaceholders = this.config.connectionConfig.namedPlaceholders;
|
|
40297
40401
|
}
|
|
40298
|
-
this.getConnection((
|
|
40299
|
-
if (
|
|
40402
|
+
this.getConnection((err2, conn) => {
|
|
40403
|
+
if (err2) {
|
|
40300
40404
|
if (typeof cmdQuery.onResult === "function") {
|
|
40301
|
-
cmdQuery.onResult(
|
|
40405
|
+
cmdQuery.onResult(err2);
|
|
40302
40406
|
} else {
|
|
40303
|
-
cmdQuery.emit("error",
|
|
40407
|
+
cmdQuery.emit("error", err2);
|
|
40304
40408
|
}
|
|
40305
40409
|
return;
|
|
40306
40410
|
}
|
|
@@ -40320,9 +40424,9 @@ var require_pool = __commonJS({
|
|
|
40320
40424
|
cb = values;
|
|
40321
40425
|
values = [];
|
|
40322
40426
|
}
|
|
40323
|
-
this.getConnection((
|
|
40324
|
-
if (
|
|
40325
|
-
return cb(
|
|
40427
|
+
this.getConnection((err2, conn) => {
|
|
40428
|
+
if (err2) {
|
|
40429
|
+
return cb(err2);
|
|
40326
40430
|
}
|
|
40327
40431
|
try {
|
|
40328
40432
|
conn.execute(sql2, values, cb).once("end", () => {
|
|
@@ -40414,9 +40518,9 @@ var require_pool_cluster = __commonJS({
|
|
|
40414
40518
|
if (clusterNode === null) {
|
|
40415
40519
|
return cb(new Error("Pool does Not exists."));
|
|
40416
40520
|
}
|
|
40417
|
-
return this._cluster._getConnection(clusterNode, (
|
|
40418
|
-
if (
|
|
40419
|
-
return cb(
|
|
40521
|
+
return this._cluster._getConnection(clusterNode, (err2, connection) => {
|
|
40522
|
+
if (err2) {
|
|
40523
|
+
return cb(err2);
|
|
40420
40524
|
}
|
|
40421
40525
|
if (connection === "retry") {
|
|
40422
40526
|
return this.getConnection(cb);
|
|
@@ -40433,12 +40537,12 @@ var require_pool_cluster = __commonJS({
|
|
|
40433
40537
|
*/
|
|
40434
40538
|
query(sql2, values, cb) {
|
|
40435
40539
|
const query = Connection.createQuery(sql2, values, cb, {});
|
|
40436
|
-
this.getConnection((
|
|
40437
|
-
if (
|
|
40540
|
+
this.getConnection((err2, conn) => {
|
|
40541
|
+
if (err2) {
|
|
40438
40542
|
if (typeof query.onResult === "function") {
|
|
40439
|
-
query.onResult(
|
|
40543
|
+
query.onResult(err2);
|
|
40440
40544
|
} else {
|
|
40441
|
-
query.emit("error",
|
|
40545
|
+
query.emit("error", err2);
|
|
40442
40546
|
}
|
|
40443
40547
|
return;
|
|
40444
40548
|
}
|
|
@@ -40464,9 +40568,9 @@ var require_pool_cluster = __commonJS({
|
|
|
40464
40568
|
cb = values;
|
|
40465
40569
|
values = [];
|
|
40466
40570
|
}
|
|
40467
|
-
this.getConnection((
|
|
40468
|
-
if (
|
|
40469
|
-
return cb(
|
|
40571
|
+
this.getConnection((err2, conn) => {
|
|
40572
|
+
if (err2) {
|
|
40573
|
+
return cb(err2);
|
|
40470
40574
|
}
|
|
40471
40575
|
try {
|
|
40472
40576
|
conn.execute(sql2, values, cb).once("end", () => {
|
|
@@ -40544,9 +40648,9 @@ var require_pool_cluster = __commonJS({
|
|
|
40544
40648
|
namespace.getConnection(cb);
|
|
40545
40649
|
}
|
|
40546
40650
|
end(callback) {
|
|
40547
|
-
const cb = callback !== void 0 ? callback : (
|
|
40548
|
-
if (
|
|
40549
|
-
throw
|
|
40651
|
+
const cb = callback !== void 0 ? callback : (err2) => {
|
|
40652
|
+
if (err2) {
|
|
40653
|
+
throw err2;
|
|
40550
40654
|
}
|
|
40551
40655
|
};
|
|
40552
40656
|
if (this._closed) {
|
|
@@ -40556,10 +40660,10 @@ var require_pool_cluster = __commonJS({
|
|
|
40556
40660
|
this._closed = true;
|
|
40557
40661
|
let calledBack = false;
|
|
40558
40662
|
let waitingClose = 0;
|
|
40559
|
-
const onEnd = (
|
|
40560
|
-
if (!calledBack && (
|
|
40663
|
+
const onEnd = (err2) => {
|
|
40664
|
+
if (!calledBack && (err2 || --waitingClose <= 0)) {
|
|
40561
40665
|
calledBack = true;
|
|
40562
|
-
return cb(
|
|
40666
|
+
return cb(err2);
|
|
40563
40667
|
}
|
|
40564
40668
|
};
|
|
40565
40669
|
for (const id in this._nodes) {
|
|
@@ -40609,15 +40713,15 @@ var require_pool_cluster = __commonJS({
|
|
|
40609
40713
|
}
|
|
40610
40714
|
}
|
|
40611
40715
|
_getConnection(node, cb) {
|
|
40612
|
-
node.pool.getConnection((
|
|
40613
|
-
if (
|
|
40716
|
+
node.pool.getConnection((err2, connection) => {
|
|
40717
|
+
if (err2) {
|
|
40614
40718
|
this._increaseErrorCount(node);
|
|
40615
40719
|
if (this._canRetry) {
|
|
40616
|
-
this.emit("warn",
|
|
40617
|
-
console.warn(`[Error] PoolCluster : ${
|
|
40720
|
+
this.emit("warn", err2);
|
|
40721
|
+
console.warn(`[Error] PoolCluster : ${err2}`);
|
|
40618
40722
|
return cb(null, "retry");
|
|
40619
40723
|
}
|
|
40620
|
-
return cb(
|
|
40724
|
+
return cb(err2);
|
|
40621
40725
|
}
|
|
40622
40726
|
this._decreaseErrorCount(node);
|
|
40623
40727
|
connection._clusterId = node.id;
|
|
@@ -40743,14 +40847,14 @@ var require_promise = __commonJS({
|
|
|
40743
40847
|
var core = require_mysql2();
|
|
40744
40848
|
var EventEmitter = require("events").EventEmitter;
|
|
40745
40849
|
function makeDoneCb(resolve, reject, localErr) {
|
|
40746
|
-
return function(
|
|
40747
|
-
if (
|
|
40748
|
-
localErr.message =
|
|
40749
|
-
localErr.code =
|
|
40750
|
-
localErr.errno =
|
|
40751
|
-
localErr.sql =
|
|
40752
|
-
localErr.sqlState =
|
|
40753
|
-
localErr.sqlMessage =
|
|
40850
|
+
return function(err2, rows, fields) {
|
|
40851
|
+
if (err2) {
|
|
40852
|
+
localErr.message = err2.message;
|
|
40853
|
+
localErr.code = err2.code;
|
|
40854
|
+
localErr.errno = err2.errno;
|
|
40855
|
+
localErr.sql = err2.sql;
|
|
40856
|
+
localErr.sqlState = err2.sqlState;
|
|
40857
|
+
localErr.sqlMessage = err2.sqlMessage;
|
|
40754
40858
|
reject(localErr);
|
|
40755
40859
|
} else {
|
|
40756
40860
|
resolve([rows, fields]);
|
|
@@ -40892,13 +40996,13 @@ var require_promise = __commonJS({
|
|
|
40892
40996
|
const c = this.connection;
|
|
40893
40997
|
const localErr = new Error();
|
|
40894
40998
|
return new this.Promise((resolve, reject) => {
|
|
40895
|
-
c.connect((
|
|
40896
|
-
if (
|
|
40897
|
-
localErr.message =
|
|
40898
|
-
localErr.code =
|
|
40899
|
-
localErr.errno =
|
|
40900
|
-
localErr.sqlState =
|
|
40901
|
-
localErr.sqlMessage =
|
|
40999
|
+
c.connect((err2, param) => {
|
|
41000
|
+
if (err2) {
|
|
41001
|
+
localErr.message = err2.message;
|
|
41002
|
+
localErr.code = err2.code;
|
|
41003
|
+
localErr.errno = err2.errno;
|
|
41004
|
+
localErr.sqlState = err2.sqlState;
|
|
41005
|
+
localErr.sqlMessage = err2.sqlMessage;
|
|
40902
41006
|
reject(localErr);
|
|
40903
41007
|
} else {
|
|
40904
41008
|
resolve(param);
|
|
@@ -40911,13 +41015,13 @@ var require_promise = __commonJS({
|
|
|
40911
41015
|
const promiseImpl = this.Promise;
|
|
40912
41016
|
const localErr = new Error();
|
|
40913
41017
|
return new this.Promise((resolve, reject) => {
|
|
40914
|
-
c.prepare(options, (
|
|
40915
|
-
if (
|
|
40916
|
-
localErr.message =
|
|
40917
|
-
localErr.code =
|
|
40918
|
-
localErr.errno =
|
|
40919
|
-
localErr.sqlState =
|
|
40920
|
-
localErr.sqlMessage =
|
|
41018
|
+
c.prepare(options, (err2, statement) => {
|
|
41019
|
+
if (err2) {
|
|
41020
|
+
localErr.message = err2.message;
|
|
41021
|
+
localErr.code = err2.code;
|
|
41022
|
+
localErr.errno = err2.errno;
|
|
41023
|
+
localErr.sqlState = err2.sqlState;
|
|
41024
|
+
localErr.sqlMessage = err2.sqlMessage;
|
|
40921
41025
|
reject(localErr);
|
|
40922
41026
|
} else {
|
|
40923
41027
|
const wrappedStatement = new PromisePreparedStatementInfo(
|
|
@@ -40933,13 +41037,13 @@ var require_promise = __commonJS({
|
|
|
40933
41037
|
const c = this.connection;
|
|
40934
41038
|
const localErr = new Error();
|
|
40935
41039
|
return new this.Promise((resolve, reject) => {
|
|
40936
|
-
c.changeUser(options, (
|
|
40937
|
-
if (
|
|
40938
|
-
localErr.message =
|
|
40939
|
-
localErr.code =
|
|
40940
|
-
localErr.errno =
|
|
40941
|
-
localErr.sqlState =
|
|
40942
|
-
localErr.sqlMessage =
|
|
41040
|
+
c.changeUser(options, (err2) => {
|
|
41041
|
+
if (err2) {
|
|
41042
|
+
localErr.message = err2.message;
|
|
41043
|
+
localErr.code = err2.code;
|
|
41044
|
+
localErr.errno = err2.errno;
|
|
41045
|
+
localErr.sqlState = err2.sqlState;
|
|
41046
|
+
localErr.sqlMessage = err2.sqlMessage;
|
|
40943
41047
|
reject(localErr);
|
|
40944
41048
|
} else {
|
|
40945
41049
|
resolve();
|
|
@@ -40967,11 +41071,11 @@ var require_promise = __commonJS({
|
|
|
40967
41071
|
coreConnection.once("connect", () => {
|
|
40968
41072
|
resolve(new PromiseConnection(coreConnection, thePromise));
|
|
40969
41073
|
});
|
|
40970
|
-
coreConnection.once("error", (
|
|
40971
|
-
createConnectionErr.message =
|
|
40972
|
-
createConnectionErr.code =
|
|
40973
|
-
createConnectionErr.errno =
|
|
40974
|
-
createConnectionErr.sqlState =
|
|
41074
|
+
coreConnection.once("error", (err2) => {
|
|
41075
|
+
createConnectionErr.message = err2.message;
|
|
41076
|
+
createConnectionErr.code = err2.code;
|
|
41077
|
+
createConnectionErr.errno = err2.errno;
|
|
41078
|
+
createConnectionErr.sqlState = err2.sqlState;
|
|
40975
41079
|
reject(createConnectionErr);
|
|
40976
41080
|
});
|
|
40977
41081
|
});
|
|
@@ -41024,9 +41128,9 @@ var require_promise = __commonJS({
|
|
|
41024
41128
|
getConnection() {
|
|
41025
41129
|
const corePool = this.pool;
|
|
41026
41130
|
return new this.Promise((resolve, reject) => {
|
|
41027
|
-
corePool.getConnection((
|
|
41028
|
-
if (
|
|
41029
|
-
reject(
|
|
41131
|
+
corePool.getConnection((err2, coreConnection) => {
|
|
41132
|
+
if (err2) {
|
|
41133
|
+
reject(err2);
|
|
41030
41134
|
} else {
|
|
41031
41135
|
resolve(new PromisePoolConnection(coreConnection, this.Promise));
|
|
41032
41136
|
}
|
|
@@ -41071,13 +41175,13 @@ var require_promise = __commonJS({
|
|
|
41071
41175
|
const corePool = this.pool;
|
|
41072
41176
|
const localErr = new Error();
|
|
41073
41177
|
return new this.Promise((resolve, reject) => {
|
|
41074
|
-
corePool.end((
|
|
41075
|
-
if (
|
|
41076
|
-
localErr.message =
|
|
41077
|
-
localErr.code =
|
|
41078
|
-
localErr.errno =
|
|
41079
|
-
localErr.sqlState =
|
|
41080
|
-
localErr.sqlMessage =
|
|
41178
|
+
corePool.end((err2) => {
|
|
41179
|
+
if (err2) {
|
|
41180
|
+
localErr.message = err2.message;
|
|
41181
|
+
localErr.code = err2.code;
|
|
41182
|
+
localErr.errno = err2.errno;
|
|
41183
|
+
localErr.sqlState = err2.sqlState;
|
|
41184
|
+
localErr.sqlMessage = err2.sqlMessage;
|
|
41081
41185
|
reject(localErr);
|
|
41082
41186
|
} else {
|
|
41083
41187
|
resolve();
|
|
@@ -41123,9 +41227,9 @@ var require_promise = __commonJS({
|
|
|
41123
41227
|
getConnection() {
|
|
41124
41228
|
const corePoolCluster = this.poolCluster;
|
|
41125
41229
|
return new this.Promise((resolve, reject) => {
|
|
41126
|
-
corePoolCluster.getConnection((
|
|
41127
|
-
if (
|
|
41128
|
-
reject(
|
|
41230
|
+
corePoolCluster.getConnection((err2, coreConnection) => {
|
|
41231
|
+
if (err2) {
|
|
41232
|
+
reject(err2);
|
|
41129
41233
|
} else {
|
|
41130
41234
|
resolve(new PromisePoolConnection(coreConnection, this.Promise));
|
|
41131
41235
|
}
|
|
@@ -41168,13 +41272,13 @@ var require_promise = __commonJS({
|
|
|
41168
41272
|
const corePoolCluster = this.poolCluster;
|
|
41169
41273
|
const localErr = new Error();
|
|
41170
41274
|
return new this.Promise((resolve, reject) => {
|
|
41171
|
-
corePoolCluster.end((
|
|
41172
|
-
if (
|
|
41173
|
-
localErr.message =
|
|
41174
|
-
localErr.code =
|
|
41175
|
-
localErr.errno =
|
|
41176
|
-
localErr.sqlState =
|
|
41177
|
-
localErr.sqlMessage =
|
|
41275
|
+
corePoolCluster.end((err2) => {
|
|
41276
|
+
if (err2) {
|
|
41277
|
+
localErr.message = err2.message;
|
|
41278
|
+
localErr.code = err2.code;
|
|
41279
|
+
localErr.errno = err2.errno;
|
|
41280
|
+
localErr.sqlState = err2.sqlState;
|
|
41281
|
+
localErr.sqlMessage = err2.sqlMessage;
|
|
41178
41282
|
reject(localErr);
|
|
41179
41283
|
} else {
|
|
41180
41284
|
resolve();
|
|
@@ -41258,9 +41362,12 @@ var init_session = __esm({
|
|
|
41258
41362
|
};
|
|
41259
41363
|
_a = import_drizzle_orm9.entityKind;
|
|
41260
41364
|
SQLiteWranglerD1Session[_a] = "SQLiteD1Session";
|
|
41261
|
-
PreparedQuery = class extends import_sqlite_core3.
|
|
41365
|
+
PreparedQuery = class extends import_sqlite_core3.SQLitePreparedQuery {
|
|
41262
41366
|
constructor(stmt, configPath, dbName, queryString, params, logger, fields, executeMethod, customResultMapper) {
|
|
41263
|
-
super("async", executeMethod
|
|
41367
|
+
super("async", executeMethod, {
|
|
41368
|
+
sql: queryString,
|
|
41369
|
+
params
|
|
41370
|
+
});
|
|
41264
41371
|
this.stmt = stmt;
|
|
41265
41372
|
this.configPath = configPath;
|
|
41266
41373
|
this.dbName = dbName;
|
|
@@ -41319,7 +41426,11 @@ var init_session = __esm({
|
|
|
41319
41426
|
async values(placeholderValues) {
|
|
41320
41427
|
const params = (0, import_drizzle_orm11.fillPlaceholders)(this.params, placeholderValues ?? {});
|
|
41321
41428
|
this.logger.logQuery(this.queryString, params);
|
|
41322
|
-
const wranglerRes = await this.stmt(
|
|
41429
|
+
const wranglerRes = await this.stmt(
|
|
41430
|
+
this.queryString,
|
|
41431
|
+
this.configPath,
|
|
41432
|
+
this.dbName
|
|
41433
|
+
);
|
|
41323
41434
|
return this.d1ToRawMapping(wranglerRes.results);
|
|
41324
41435
|
}
|
|
41325
41436
|
};
|
|
@@ -41842,8 +41953,8 @@ var require_duplexer = __commonJS({
|
|
|
41842
41953
|
args.unshift("end");
|
|
41843
41954
|
stream.emit.apply(stream, args);
|
|
41844
41955
|
}
|
|
41845
|
-
function reemit(
|
|
41846
|
-
stream.emit("error",
|
|
41956
|
+
function reemit(err2) {
|
|
41957
|
+
stream.emit("error", err2);
|
|
41847
41958
|
}
|
|
41848
41959
|
}
|
|
41849
41960
|
}
|
|
@@ -41884,21 +41995,21 @@ var require_map_stream = __commonJS({
|
|
|
41884
41995
|
end();
|
|
41885
41996
|
}
|
|
41886
41997
|
}
|
|
41887
|
-
function next(
|
|
41998
|
+
function next(err2, data, number) {
|
|
41888
41999
|
if (destroyed)
|
|
41889
42000
|
return;
|
|
41890
42001
|
inNext = true;
|
|
41891
|
-
if (!
|
|
42002
|
+
if (!err2 || self2.opts.failures) {
|
|
41892
42003
|
queueData(data, number);
|
|
41893
42004
|
}
|
|
41894
|
-
if (
|
|
41895
|
-
stream.emit.apply(stream, [errorEventName,
|
|
42005
|
+
if (err2) {
|
|
42006
|
+
stream.emit.apply(stream, [errorEventName, err2]);
|
|
41896
42007
|
}
|
|
41897
42008
|
inNext = false;
|
|
41898
42009
|
}
|
|
41899
42010
|
function wrappedMapper(input, number, callback) {
|
|
41900
|
-
return mapper.call(null, input, function(
|
|
41901
|
-
callback(
|
|
42011
|
+
return mapper.call(null, input, function(err2, data) {
|
|
42012
|
+
callback(err2, data, number);
|
|
41902
42013
|
});
|
|
41903
42014
|
}
|
|
41904
42015
|
stream.write = function(data) {
|
|
@@ -41910,10 +42021,10 @@ var require_map_stream = __commonJS({
|
|
|
41910
42021
|
var written = wrappedMapper(data, inputs, next);
|
|
41911
42022
|
paused = written === false;
|
|
41912
42023
|
return !paused;
|
|
41913
|
-
} catch (
|
|
42024
|
+
} catch (err2) {
|
|
41914
42025
|
if (inNext)
|
|
41915
|
-
throw
|
|
41916
|
-
next(
|
|
42026
|
+
throw err2;
|
|
42027
|
+
next(err2);
|
|
41917
42028
|
return !paused;
|
|
41918
42029
|
}
|
|
41919
42030
|
};
|
|
@@ -41974,8 +42085,8 @@ var require_split = __commonJS({
|
|
|
41974
42085
|
if (mapper) {
|
|
41975
42086
|
try {
|
|
41976
42087
|
piece = mapper(piece);
|
|
41977
|
-
} catch (
|
|
41978
|
-
return stream.emit("error",
|
|
42088
|
+
} catch (err2) {
|
|
42089
|
+
return stream.emit("error", err2);
|
|
41979
42090
|
}
|
|
41980
42091
|
if ("undefined" !== typeof piece)
|
|
41981
42092
|
stream.queue(piece);
|
|
@@ -42154,9 +42265,9 @@ var require_event_stream = __commonJS({
|
|
|
42154
42265
|
stream.on("end", function() {
|
|
42155
42266
|
ended = true;
|
|
42156
42267
|
});
|
|
42157
|
-
function get(
|
|
42158
|
-
if (
|
|
42159
|
-
stream.emit("error",
|
|
42268
|
+
function get(err2, data) {
|
|
42269
|
+
if (err2) {
|
|
42270
|
+
stream.emit("error", err2);
|
|
42160
42271
|
if (!continueOnError)
|
|
42161
42272
|
stream.emit("end");
|
|
42162
42273
|
} else if (arguments.length > 1)
|
|
@@ -42170,8 +42281,8 @@ var require_event_stream = __commonJS({
|
|
|
42170
42281
|
reading = false;
|
|
42171
42282
|
get.apply(null, arguments);
|
|
42172
42283
|
});
|
|
42173
|
-
} catch (
|
|
42174
|
-
stream.emit("error",
|
|
42284
|
+
} catch (err3) {
|
|
42285
|
+
stream.emit("error", err3);
|
|
42175
42286
|
}
|
|
42176
42287
|
});
|
|
42177
42288
|
}
|
|
@@ -42195,8 +42306,8 @@ var require_event_stream = __commonJS({
|
|
|
42195
42306
|
var mappedData;
|
|
42196
42307
|
try {
|
|
42197
42308
|
mappedData = sync2(data);
|
|
42198
|
-
} catch (
|
|
42199
|
-
return this.emit("error",
|
|
42309
|
+
} catch (err2) {
|
|
42310
|
+
return this.emit("error", err2);
|
|
42200
42311
|
}
|
|
42201
42312
|
if (mappedData !== void 0)
|
|
42202
42313
|
this.emit("data", mappedData);
|
|
@@ -42222,10 +42333,10 @@ var require_event_stream = __commonJS({
|
|
|
42222
42333
|
try {
|
|
42223
42334
|
if (data)
|
|
42224
42335
|
obj = JSON.parse(data.toString());
|
|
42225
|
-
} catch (
|
|
42336
|
+
} catch (err2) {
|
|
42226
42337
|
if (emitError)
|
|
42227
|
-
return this.emit("error",
|
|
42228
|
-
return console.error(
|
|
42338
|
+
return this.emit("error", err2);
|
|
42339
|
+
return console.error(err2, "attempting to parse:", data);
|
|
42229
42340
|
}
|
|
42230
42341
|
if (obj !== void 0)
|
|
42231
42342
|
this.emit("data", obj);
|
|
@@ -42311,7 +42422,7 @@ var require_ps_tree = __commonJS({
|
|
|
42311
42422
|
}
|
|
42312
42423
|
return cb(null, row);
|
|
42313
42424
|
}),
|
|
42314
|
-
es.writeArray(function(
|
|
42425
|
+
es.writeArray(function(err2, ps) {
|
|
42315
42426
|
var parents = {}, children = [];
|
|
42316
42427
|
parents[pid] = true;
|
|
42317
42428
|
ps.forEach(function(proc) {
|
|
@@ -42753,7 +42864,7 @@ var init_core = __esm({
|
|
|
42753
42864
|
defaults2.shell = import_which.default.sync("bash");
|
|
42754
42865
|
defaults2.prefix = "set -euo pipefail;";
|
|
42755
42866
|
defaults2.quote = quote;
|
|
42756
|
-
} catch (
|
|
42867
|
+
} catch (err2) {
|
|
42757
42868
|
if (process.platform == "win32") {
|
|
42758
42869
|
defaults2.shell = import_which.default.sync("powershell.exe");
|
|
42759
42870
|
defaults2.quote = quotePowerShell;
|
|
@@ -42851,10 +42962,10 @@ var init_core = __esm({
|
|
|
42851
42962
|
}
|
|
42852
42963
|
this._resolved = true;
|
|
42853
42964
|
});
|
|
42854
|
-
this.child.on("error", (
|
|
42855
|
-
const message = `${
|
|
42856
|
-
errno: ${
|
|
42857
|
-
code: ${
|
|
42965
|
+
this.child.on("error", (err2) => {
|
|
42966
|
+
const message = `${err2.message}
|
|
42967
|
+
errno: ${err2.errno} (${errnoMessage(err2.errno)})
|
|
42968
|
+
code: ${err2.code}
|
|
42858
42969
|
at ${this._from}`;
|
|
42859
42970
|
this._reject(new ProcessOutput(null, null, stdout, stderr, combined, message));
|
|
42860
42971
|
this._resolved = true;
|
|
@@ -43080,8 +43191,8 @@ var require_merge2 = __commonJS({
|
|
|
43080
43191
|
}
|
|
43081
43192
|
next();
|
|
43082
43193
|
}
|
|
43083
|
-
function onerror(
|
|
43084
|
-
mergedStream.emit("error",
|
|
43194
|
+
function onerror(err2) {
|
|
43195
|
+
mergedStream.emit("error", err2);
|
|
43085
43196
|
}
|
|
43086
43197
|
if (stream._readableState.endEmitted) {
|
|
43087
43198
|
return next();
|
|
@@ -43432,7 +43543,7 @@ var require_glob_parent = __commonJS({
|
|
|
43432
43543
|
});
|
|
43433
43544
|
|
|
43434
43545
|
// node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js
|
|
43435
|
-
var
|
|
43546
|
+
var require_utils4 = __commonJS({
|
|
43436
43547
|
"node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js"(exports) {
|
|
43437
43548
|
"use strict";
|
|
43438
43549
|
exports.isInteger = (num) => {
|
|
@@ -43519,7 +43630,7 @@ var require_utils3 = __commonJS({
|
|
|
43519
43630
|
var require_stringify = __commonJS({
|
|
43520
43631
|
"node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.js"(exports, module2) {
|
|
43521
43632
|
"use strict";
|
|
43522
|
-
var utils =
|
|
43633
|
+
var utils = require_utils4();
|
|
43523
43634
|
module2.exports = (ast, options = {}) => {
|
|
43524
43635
|
let stringify = (node, parent = {}) => {
|
|
43525
43636
|
let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
|
@@ -43985,7 +44096,7 @@ var require_compile = __commonJS({
|
|
|
43985
44096
|
"node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.js"(exports, module2) {
|
|
43986
44097
|
"use strict";
|
|
43987
44098
|
var fill = require_fill_range();
|
|
43988
|
-
var utils =
|
|
44099
|
+
var utils = require_utils4();
|
|
43989
44100
|
var compile = (ast, options = {}) => {
|
|
43990
44101
|
let walk = (node, parent = {}) => {
|
|
43991
44102
|
let invalidBlock = utils.isInvalidBrace(parent);
|
|
@@ -44037,7 +44148,7 @@ var require_expand = __commonJS({
|
|
|
44037
44148
|
"use strict";
|
|
44038
44149
|
var fill = require_fill_range();
|
|
44039
44150
|
var stringify = require_stringify();
|
|
44040
|
-
var utils =
|
|
44151
|
+
var utils = require_utils4();
|
|
44041
44152
|
var append = (queue = "", stash = "", enclose = false) => {
|
|
44042
44153
|
let result = [];
|
|
44043
44154
|
queue = [].concat(queue);
|
|
@@ -44734,7 +44845,7 @@ var require_constants2 = __commonJS({
|
|
|
44734
44845
|
});
|
|
44735
44846
|
|
|
44736
44847
|
// node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
|
|
44737
|
-
var
|
|
44848
|
+
var require_utils5 = __commonJS({
|
|
44738
44849
|
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports) {
|
|
44739
44850
|
"use strict";
|
|
44740
44851
|
var path4 = require("path");
|
|
@@ -44800,7 +44911,7 @@ var require_utils4 = __commonJS({
|
|
|
44800
44911
|
var require_scan = __commonJS({
|
|
44801
44912
|
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js"(exports, module2) {
|
|
44802
44913
|
"use strict";
|
|
44803
|
-
var utils =
|
|
44914
|
+
var utils = require_utils5();
|
|
44804
44915
|
var {
|
|
44805
44916
|
CHAR_ASTERISK,
|
|
44806
44917
|
/* * */
|
|
@@ -45134,7 +45245,7 @@ var require_parse2 = __commonJS({
|
|
|
45134
45245
|
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js"(exports, module2) {
|
|
45135
45246
|
"use strict";
|
|
45136
45247
|
var constants = require_constants2();
|
|
45137
|
-
var utils =
|
|
45248
|
+
var utils = require_utils5();
|
|
45138
45249
|
var {
|
|
45139
45250
|
MAX_LENGTH,
|
|
45140
45251
|
POSIX_REGEX_SOURCE,
|
|
@@ -45917,7 +46028,7 @@ var require_picomatch = __commonJS({
|
|
|
45917
46028
|
var path4 = require("path");
|
|
45918
46029
|
var scan = require_scan();
|
|
45919
46030
|
var parse = require_parse2();
|
|
45920
|
-
var utils =
|
|
46031
|
+
var utils = require_utils5();
|
|
45921
46032
|
var constants = require_constants2();
|
|
45922
46033
|
var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
45923
46034
|
var picomatch = (glob2, options, returnState = false) => {
|
|
@@ -46043,9 +46154,9 @@ var require_picomatch = __commonJS({
|
|
|
46043
46154
|
try {
|
|
46044
46155
|
const opts = options || {};
|
|
46045
46156
|
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
46046
|
-
} catch (
|
|
46157
|
+
} catch (err2) {
|
|
46047
46158
|
if (options && options.debug === true)
|
|
46048
|
-
throw
|
|
46159
|
+
throw err2;
|
|
46049
46160
|
return /$^/;
|
|
46050
46161
|
}
|
|
46051
46162
|
};
|
|
@@ -46069,7 +46180,7 @@ var require_micromatch = __commonJS({
|
|
|
46069
46180
|
var util2 = require("util");
|
|
46070
46181
|
var braces = require_braces();
|
|
46071
46182
|
var picomatch = require_picomatch2();
|
|
46072
|
-
var utils =
|
|
46183
|
+
var utils = require_utils5();
|
|
46073
46184
|
var isEmptyString = (val) => val === "" || val === "./";
|
|
46074
46185
|
var micromatch = (list, patterns, options) => {
|
|
46075
46186
|
patterns = [].concat(patterns);
|
|
@@ -46373,7 +46484,7 @@ var require_pattern = __commonJS({
|
|
|
46373
46484
|
});
|
|
46374
46485
|
|
|
46375
46486
|
// node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/utils/stream.js
|
|
46376
|
-
var
|
|
46487
|
+
var require_stream2 = __commonJS({
|
|
46377
46488
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/utils/stream.js"(exports) {
|
|
46378
46489
|
"use strict";
|
|
46379
46490
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -46413,7 +46524,7 @@ var require_string2 = __commonJS({
|
|
|
46413
46524
|
});
|
|
46414
46525
|
|
|
46415
46526
|
// node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/utils/index.js
|
|
46416
|
-
var
|
|
46527
|
+
var require_utils6 = __commonJS({
|
|
46417
46528
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/utils/index.js"(exports) {
|
|
46418
46529
|
"use strict";
|
|
46419
46530
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -46428,7 +46539,7 @@ var require_utils5 = __commonJS({
|
|
|
46428
46539
|
exports.path = path4;
|
|
46429
46540
|
var pattern = require_pattern();
|
|
46430
46541
|
exports.pattern = pattern;
|
|
46431
|
-
var stream =
|
|
46542
|
+
var stream = require_stream2();
|
|
46432
46543
|
exports.stream = stream;
|
|
46433
46544
|
var string = require_string2();
|
|
46434
46545
|
exports.string = string;
|
|
@@ -46441,7 +46552,7 @@ var require_tasks = __commonJS({
|
|
|
46441
46552
|
"use strict";
|
|
46442
46553
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46443
46554
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
46444
|
-
var utils =
|
|
46555
|
+
var utils = require_utils6();
|
|
46445
46556
|
function generate(input, settings) {
|
|
46446
46557
|
const patterns = processPatterns(input, settings);
|
|
46447
46558
|
const ignore = processPatterns(settings.ignore, settings);
|
|
@@ -46682,8 +46793,8 @@ var require_out = __commonJS({
|
|
|
46682
46793
|
var require_queue_microtask = __commonJS({
|
|
46683
46794
|
"node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js"(exports, module2) {
|
|
46684
46795
|
var promise;
|
|
46685
|
-
module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((
|
|
46686
|
-
throw
|
|
46796
|
+
module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err2) => setTimeout(() => {
|
|
46797
|
+
throw err2;
|
|
46687
46798
|
}, 0));
|
|
46688
46799
|
}
|
|
46689
46800
|
});
|
|
@@ -46704,10 +46815,10 @@ var require_run_parallel = __commonJS({
|
|
|
46704
46815
|
results = {};
|
|
46705
46816
|
pending = keys.length;
|
|
46706
46817
|
}
|
|
46707
|
-
function done(
|
|
46818
|
+
function done(err2) {
|
|
46708
46819
|
function end() {
|
|
46709
46820
|
if (cb)
|
|
46710
|
-
cb(
|
|
46821
|
+
cb(err2, results);
|
|
46711
46822
|
cb = null;
|
|
46712
46823
|
}
|
|
46713
46824
|
if (isSync)
|
|
@@ -46715,24 +46826,24 @@ var require_run_parallel = __commonJS({
|
|
|
46715
46826
|
else
|
|
46716
46827
|
end();
|
|
46717
46828
|
}
|
|
46718
|
-
function each(i,
|
|
46829
|
+
function each(i, err2, result) {
|
|
46719
46830
|
results[i] = result;
|
|
46720
|
-
if (--pending === 0 ||
|
|
46721
|
-
done(
|
|
46831
|
+
if (--pending === 0 || err2) {
|
|
46832
|
+
done(err2);
|
|
46722
46833
|
}
|
|
46723
46834
|
}
|
|
46724
46835
|
if (!pending) {
|
|
46725
46836
|
done(null);
|
|
46726
46837
|
} else if (keys) {
|
|
46727
46838
|
keys.forEach(function(key) {
|
|
46728
|
-
tasks[key](function(
|
|
46729
|
-
each(key,
|
|
46839
|
+
tasks[key](function(err2, result) {
|
|
46840
|
+
each(key, err2, result);
|
|
46730
46841
|
});
|
|
46731
46842
|
});
|
|
46732
46843
|
} else {
|
|
46733
46844
|
tasks.forEach(function(task, i) {
|
|
46734
|
-
task(function(
|
|
46735
|
-
each(i,
|
|
46845
|
+
task(function(err2, result) {
|
|
46846
|
+
each(i, err2, result);
|
|
46736
46847
|
});
|
|
46737
46848
|
});
|
|
46738
46849
|
}
|
|
@@ -46787,7 +46898,7 @@ var require_fs3 = __commonJS({
|
|
|
46787
46898
|
});
|
|
46788
46899
|
|
|
46789
46900
|
// node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js
|
|
46790
|
-
var
|
|
46901
|
+
var require_utils7 = __commonJS({
|
|
46791
46902
|
"node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) {
|
|
46792
46903
|
"use strict";
|
|
46793
46904
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -46822,7 +46933,7 @@ var require_async2 = __commonJS({
|
|
|
46822
46933
|
var fsStat = require_out();
|
|
46823
46934
|
var rpl = require_run_parallel();
|
|
46824
46935
|
var constants_1 = require_constants3();
|
|
46825
|
-
var utils =
|
|
46936
|
+
var utils = require_utils7();
|
|
46826
46937
|
var common = require_common2();
|
|
46827
46938
|
function read(directory, settings, callback) {
|
|
46828
46939
|
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
@@ -46931,7 +47042,7 @@ var require_sync2 = __commonJS({
|
|
|
46931
47042
|
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
|
|
46932
47043
|
var fsStat = require_out();
|
|
46933
47044
|
var constants_1 = require_constants3();
|
|
46934
|
-
var utils =
|
|
47045
|
+
var utils = require_utils7();
|
|
46935
47046
|
var common = require_common2();
|
|
46936
47047
|
function read(directory, settings) {
|
|
46937
47048
|
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
@@ -47263,16 +47374,16 @@ var require_queue = __commonJS({
|
|
|
47263
47374
|
this.context = null;
|
|
47264
47375
|
this.errorHandler = null;
|
|
47265
47376
|
var self2 = this;
|
|
47266
|
-
this.worked = function worked(
|
|
47377
|
+
this.worked = function worked(err2, result) {
|
|
47267
47378
|
var callback = self2.callback;
|
|
47268
47379
|
var errorHandler = self2.errorHandler;
|
|
47269
47380
|
var val = self2.value;
|
|
47270
47381
|
self2.value = null;
|
|
47271
47382
|
self2.callback = noop2;
|
|
47272
47383
|
if (self2.errorHandler) {
|
|
47273
|
-
errorHandler(
|
|
47384
|
+
errorHandler(err2, val);
|
|
47274
47385
|
}
|
|
47275
|
-
callback.call(self2.context,
|
|
47386
|
+
callback.call(self2.context, err2, result);
|
|
47276
47387
|
self2.release(self2);
|
|
47277
47388
|
};
|
|
47278
47389
|
}
|
|
@@ -47296,9 +47407,9 @@ var require_queue = __commonJS({
|
|
|
47296
47407
|
return queue;
|
|
47297
47408
|
function push(value) {
|
|
47298
47409
|
var p = new Promise(function(resolve, reject) {
|
|
47299
|
-
pushCb(value, function(
|
|
47300
|
-
if (
|
|
47301
|
-
reject(
|
|
47410
|
+
pushCb(value, function(err2, result) {
|
|
47411
|
+
if (err2) {
|
|
47412
|
+
reject(err2);
|
|
47302
47413
|
return;
|
|
47303
47414
|
}
|
|
47304
47415
|
resolve(result);
|
|
@@ -47309,9 +47420,9 @@ var require_queue = __commonJS({
|
|
|
47309
47420
|
}
|
|
47310
47421
|
function unshift(value) {
|
|
47311
47422
|
var p = new Promise(function(resolve, reject) {
|
|
47312
|
-
unshiftCb(value, function(
|
|
47313
|
-
if (
|
|
47314
|
-
reject(
|
|
47423
|
+
unshiftCb(value, function(err2, result) {
|
|
47424
|
+
if (err2) {
|
|
47425
|
+
reject(err2);
|
|
47315
47426
|
return;
|
|
47316
47427
|
}
|
|
47317
47428
|
resolve(result);
|
|
@@ -47532,7 +47643,7 @@ var require_async4 = __commonJS({
|
|
|
47532
47643
|
});
|
|
47533
47644
|
|
|
47534
47645
|
// node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js
|
|
47535
|
-
var
|
|
47646
|
+
var require_stream3 = __commonJS({
|
|
47536
47647
|
"node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) {
|
|
47537
47648
|
"use strict";
|
|
47538
47649
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -47695,7 +47806,7 @@ var require_out3 = __commonJS({
|
|
|
47695
47806
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47696
47807
|
exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
|
|
47697
47808
|
var async_1 = require_async4();
|
|
47698
|
-
var stream_1 =
|
|
47809
|
+
var stream_1 = require_stream3();
|
|
47699
47810
|
var sync_1 = require_sync4();
|
|
47700
47811
|
var settings_1 = require_settings3();
|
|
47701
47812
|
exports.Settings = settings_1.default;
|
|
@@ -47735,7 +47846,7 @@ var require_reader2 = __commonJS({
|
|
|
47735
47846
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47736
47847
|
var path4 = require("path");
|
|
47737
47848
|
var fsStat = require_out();
|
|
47738
|
-
var utils =
|
|
47849
|
+
var utils = require_utils6();
|
|
47739
47850
|
var Reader = class {
|
|
47740
47851
|
constructor(_settings) {
|
|
47741
47852
|
this._settings = _settings;
|
|
@@ -47768,7 +47879,7 @@ var require_reader2 = __commonJS({
|
|
|
47768
47879
|
});
|
|
47769
47880
|
|
|
47770
47881
|
// node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/readers/stream.js
|
|
47771
|
-
var
|
|
47882
|
+
var require_stream4 = __commonJS({
|
|
47772
47883
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/readers/stream.js"(exports) {
|
|
47773
47884
|
"use strict";
|
|
47774
47885
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -47831,7 +47942,7 @@ var require_async5 = __commonJS({
|
|
|
47831
47942
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47832
47943
|
var fsWalk = require_out3();
|
|
47833
47944
|
var reader_1 = require_reader2();
|
|
47834
|
-
var stream_1 =
|
|
47945
|
+
var stream_1 = require_stream4();
|
|
47835
47946
|
var ReaderAsync = class extends reader_1.default {
|
|
47836
47947
|
constructor() {
|
|
47837
47948
|
super(...arguments);
|
|
@@ -47868,7 +47979,7 @@ var require_matcher = __commonJS({
|
|
|
47868
47979
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) {
|
|
47869
47980
|
"use strict";
|
|
47870
47981
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47871
|
-
var utils =
|
|
47982
|
+
var utils = require_utils6();
|
|
47872
47983
|
var Matcher = class {
|
|
47873
47984
|
constructor(_patterns, _settings, _micromatchOptions) {
|
|
47874
47985
|
this._patterns = _patterns;
|
|
@@ -47956,7 +48067,7 @@ var require_deep = __commonJS({
|
|
|
47956
48067
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/filters/deep.js"(exports) {
|
|
47957
48068
|
"use strict";
|
|
47958
48069
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47959
|
-
var utils =
|
|
48070
|
+
var utils = require_utils6();
|
|
47960
48071
|
var partial_1 = require_partial();
|
|
47961
48072
|
var DeepFilter = class {
|
|
47962
48073
|
constructor(_settings, _micromatchOptions) {
|
|
@@ -48021,7 +48132,7 @@ var require_entry = __commonJS({
|
|
|
48021
48132
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/filters/entry.js"(exports) {
|
|
48022
48133
|
"use strict";
|
|
48023
48134
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48024
|
-
var utils =
|
|
48135
|
+
var utils = require_utils6();
|
|
48025
48136
|
var EntryFilter = class {
|
|
48026
48137
|
constructor(_settings, _micromatchOptions) {
|
|
48027
48138
|
this._settings = _settings;
|
|
@@ -48087,7 +48198,7 @@ var require_error = __commonJS({
|
|
|
48087
48198
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/filters/error.js"(exports) {
|
|
48088
48199
|
"use strict";
|
|
48089
48200
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48090
|
-
var utils =
|
|
48201
|
+
var utils = require_utils6();
|
|
48091
48202
|
var ErrorFilter = class {
|
|
48092
48203
|
constructor(_settings) {
|
|
48093
48204
|
this._settings = _settings;
|
|
@@ -48108,7 +48219,7 @@ var require_entry2 = __commonJS({
|
|
|
48108
48219
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/transformers/entry.js"(exports) {
|
|
48109
48220
|
"use strict";
|
|
48110
48221
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48111
|
-
var utils =
|
|
48222
|
+
var utils = require_utils6();
|
|
48112
48223
|
var EntryTransformer = class {
|
|
48113
48224
|
constructor(_settings) {
|
|
48114
48225
|
this._settings = _settings;
|
|
@@ -48219,12 +48330,12 @@ var require_async6 = __commonJS({
|
|
|
48219
48330
|
});
|
|
48220
48331
|
|
|
48221
48332
|
// node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/stream.js
|
|
48222
|
-
var
|
|
48333
|
+
var require_stream5 = __commonJS({
|
|
48223
48334
|
"node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/stream.js"(exports) {
|
|
48224
48335
|
"use strict";
|
|
48225
48336
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48226
48337
|
var stream_1 = require("stream");
|
|
48227
|
-
var stream_2 =
|
|
48338
|
+
var stream_2 = require_stream4();
|
|
48228
48339
|
var provider_1 = require_provider();
|
|
48229
48340
|
var ProviderStream = class extends provider_1.default {
|
|
48230
48341
|
constructor() {
|
|
@@ -48395,10 +48506,10 @@ var require_out4 = __commonJS({
|
|
|
48395
48506
|
"use strict";
|
|
48396
48507
|
var taskManager = require_tasks();
|
|
48397
48508
|
var async_1 = require_async6();
|
|
48398
|
-
var stream_1 =
|
|
48509
|
+
var stream_1 = require_stream5();
|
|
48399
48510
|
var sync_1 = require_sync6();
|
|
48400
48511
|
var settings_1 = require_settings4();
|
|
48401
|
-
var utils =
|
|
48512
|
+
var utils = require_utils6();
|
|
48402
48513
|
async function FastGlob(source, options) {
|
|
48403
48514
|
assertPatternsInput2(source);
|
|
48404
48515
|
const works = getWorks(source, async_1.default, options);
|
|
@@ -51107,12 +51218,12 @@ var require_log = __commonJS({
|
|
|
51107
51218
|
if (logLevel === "debug")
|
|
51108
51219
|
console.log(...messages);
|
|
51109
51220
|
}
|
|
51110
|
-
function warn(logLevel,
|
|
51221
|
+
function warn(logLevel, warning2) {
|
|
51111
51222
|
if (logLevel === "debug" || logLevel === "warn") {
|
|
51112
51223
|
if (typeof process !== "undefined" && process.emitWarning)
|
|
51113
|
-
process.emitWarning(
|
|
51224
|
+
process.emitWarning(warning2);
|
|
51114
51225
|
else
|
|
51115
|
-
console.warn(
|
|
51226
|
+
console.warn(warning2);
|
|
51116
51227
|
}
|
|
51117
51228
|
}
|
|
51118
51229
|
exports.debug = debug;
|
|
@@ -54472,9 +54583,9 @@ var require_composer = __commonJS({
|
|
|
54472
54583
|
this.prelude = [];
|
|
54473
54584
|
this.errors = [];
|
|
54474
54585
|
this.warnings = [];
|
|
54475
|
-
this.onError = (source, code, message,
|
|
54586
|
+
this.onError = (source, code, message, warning2) => {
|
|
54476
54587
|
const pos = getErrorPos(source);
|
|
54477
|
-
if (
|
|
54588
|
+
if (warning2)
|
|
54478
54589
|
this.warnings.push(new errors.YAMLWarning(pos, code, message));
|
|
54479
54590
|
else
|
|
54480
54591
|
this.errors.push(new errors.YAMLParseError(pos, code, message));
|
|
@@ -54545,10 +54656,10 @@ ${cb}` : comment;
|
|
|
54545
54656
|
console.dir(token, { depth: null });
|
|
54546
54657
|
switch (token.type) {
|
|
54547
54658
|
case "directive":
|
|
54548
|
-
this.directives.add(token.source, (offset, message,
|
|
54659
|
+
this.directives.add(token.source, (offset, message, warning2) => {
|
|
54549
54660
|
const pos = getErrorPos(token);
|
|
54550
54661
|
pos[0] += offset;
|
|
54551
|
-
this.onError(pos, "BAD_DIRECTIVE", message,
|
|
54662
|
+
this.onError(pos, "BAD_DIRECTIVE", message, warning2);
|
|
54552
54663
|
});
|
|
54553
54664
|
this.prelude.push(token.source);
|
|
54554
54665
|
this.atDirectives = true;
|
|
@@ -56542,7 +56653,7 @@ var require_public_api = __commonJS({
|
|
|
56542
56653
|
const doc = parseDocument(src, options);
|
|
56543
56654
|
if (!doc)
|
|
56544
56655
|
return null;
|
|
56545
|
-
doc.warnings.forEach((
|
|
56656
|
+
doc.warnings.forEach((warning2) => log2.warn(doc.options.logLevel, warning2));
|
|
56546
56657
|
if (doc.errors.length > 0) {
|
|
56547
56658
|
if (doc.options.logLevel !== "silent")
|
|
56548
56659
|
throw doc.errors[0];
|
|
@@ -56631,7 +56742,7 @@ var require_dist2 = __commonJS({
|
|
|
56631
56742
|
});
|
|
56632
56743
|
|
|
56633
56744
|
// node_modules/.pnpm/webpod@0.0.2/node_modules/webpod/dist/utils.js
|
|
56634
|
-
var
|
|
56745
|
+
var init_utils4 = __esm({
|
|
56635
56746
|
"node_modules/.pnpm/webpod@0.0.2/node_modules/webpod/dist/utils.js"() {
|
|
56636
56747
|
}
|
|
56637
56748
|
});
|
|
@@ -56639,7 +56750,7 @@ var init_utils3 = __esm({
|
|
|
56639
56750
|
// node_modules/.pnpm/webpod@0.0.2/node_modules/webpod/dist/ssh.js
|
|
56640
56751
|
var init_ssh = __esm({
|
|
56641
56752
|
"node_modules/.pnpm/webpod@0.0.2/node_modules/webpod/dist/ssh.js"() {
|
|
56642
|
-
|
|
56753
|
+
init_utils4();
|
|
56643
56754
|
}
|
|
56644
56755
|
});
|
|
56645
56756
|
|
|
@@ -56685,8 +56796,17 @@ __export(wrangler_client_exports, {
|
|
|
56685
56796
|
execute: () => execute
|
|
56686
56797
|
});
|
|
56687
56798
|
async function execute(query, configPath, dbName) {
|
|
56688
|
-
|
|
56689
|
-
|
|
56799
|
+
try {
|
|
56800
|
+
const response = await $`NO_D1_WARNING=true wrangler d1 execute ${dbName} --config=${configPath} --command=${query} --json`;
|
|
56801
|
+
return { results: JSON.parse(response.stdout)[0].results };
|
|
56802
|
+
} catch (e) {
|
|
56803
|
+
try {
|
|
56804
|
+
await $`NO_D1_WARNING=true wrangler d1 execute ${dbName} --config=${configPath} --command=${query}`;
|
|
56805
|
+
} catch (e1) {
|
|
56806
|
+
throw new Error(e1.stdout);
|
|
56807
|
+
}
|
|
56808
|
+
throw e;
|
|
56809
|
+
}
|
|
56690
56810
|
}
|
|
56691
56811
|
var init_wrangler_client = __esm({
|
|
56692
56812
|
"src/orm-extenstions/d1-driver/wrangler-client.ts"() {
|
|
@@ -56704,12 +56824,18 @@ var init_studioUtils = __esm({
|
|
|
56704
56824
|
import_pg_core4 = require("drizzle-orm/pg-core");
|
|
56705
56825
|
import_sqlite_core5 = require("drizzle-orm/sqlite-core");
|
|
56706
56826
|
init_utils();
|
|
56827
|
+
init_utils3();
|
|
56828
|
+
init_global();
|
|
56707
56829
|
init_serializer();
|
|
56708
|
-
drizzleDb = async (drizzleConfig, models, logger
|
|
56830
|
+
drizzleDb = async (drizzleConfig, models, logger) => {
|
|
56709
56831
|
if (drizzleConfig.driver === "pg") {
|
|
56710
56832
|
const { drizzle: drizzle2 } = await import("drizzle-orm/node-postgres");
|
|
56833
|
+
const pg = await Promise.resolve().then(() => __toESM(require_lib2()));
|
|
56834
|
+
const db = drizzle2(new pg.default.Pool(drizzleConfig.dbCredentials), {
|
|
56835
|
+
logger
|
|
56836
|
+
});
|
|
56711
56837
|
return {
|
|
56712
|
-
db
|
|
56838
|
+
db,
|
|
56713
56839
|
type: "pg",
|
|
56714
56840
|
schema: models.pgSchema
|
|
56715
56841
|
};
|
|
@@ -56717,12 +56843,7 @@ var init_studioUtils = __esm({
|
|
|
56717
56843
|
const { drizzle: drizzle2 } = await import("drizzle-orm/mysql2");
|
|
56718
56844
|
const { createPool } = await Promise.resolve().then(() => __toESM(require_promise()));
|
|
56719
56845
|
const client = createPool({
|
|
56720
|
-
|
|
56721
|
-
host: drizzleConfig.dbCredentials.type === "params" ? drizzleConfig.dbCredentials.host : void 0,
|
|
56722
|
-
port: drizzleConfig.dbCredentials.type === "params" ? drizzleConfig.dbCredentials.port : void 0,
|
|
56723
|
-
user: drizzleConfig.dbCredentials.type === "params" ? drizzleConfig.dbCredentials.user : void 0,
|
|
56724
|
-
database: drizzleConfig.dbCredentials.type === "params" ? drizzleConfig.dbCredentials.database : void 0,
|
|
56725
|
-
password: drizzleConfig.dbCredentials.type === "params" ? drizzleConfig.dbCredentials.password : void 0,
|
|
56846
|
+
...drizzleConfig.dbCredentials,
|
|
56726
56847
|
connectionLimit: 1
|
|
56727
56848
|
});
|
|
56728
56849
|
return {
|
|
@@ -56773,7 +56894,6 @@ var utils_exports = {};
|
|
|
56773
56894
|
__export(utils_exports, {
|
|
56774
56895
|
assertV1OutFolder: () => assertV1OutFolder,
|
|
56775
56896
|
columnRenameKey: () => columnRenameKey,
|
|
56776
|
-
defineConfig: () => defineConfig,
|
|
56777
56897
|
dryJournal: () => dryJournal,
|
|
56778
56898
|
generateDrizzleJson: () => generateDrizzleJson,
|
|
56779
56899
|
generateMigration: () => generateMigration,
|
|
@@ -56791,11 +56911,8 @@ __export(utils_exports, {
|
|
|
56791
56911
|
validateWithReport: () => validateWithReport
|
|
56792
56912
|
});
|
|
56793
56913
|
module.exports = __toCommonJS(utils_exports);
|
|
56794
|
-
function defineConfig(config) {
|
|
56795
|
-
return config;
|
|
56796
|
-
}
|
|
56797
56914
|
var import_fs4, import_path3, import_crypto2, assertV1OutFolder, dryJournal, snapshotsPriorV4, prepareOutFolder2, mapValues, validatorForDialect, validateWithReport, prepareMigrationFolder, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey, kloudMeta, statementsForDiffs, generateDrizzleJson, generateMigration, pushSchema, prepareFrom;
|
|
56798
|
-
var
|
|
56915
|
+
var init_utils5 = __esm({
|
|
56799
56916
|
"src/utils.ts"() {
|
|
56800
56917
|
import_fs4 = require("fs");
|
|
56801
56918
|
init_views();
|
|
@@ -57164,8 +57281,7 @@ var init_utils4 = __esm({
|
|
|
57164
57281
|
// @ts-ignore I don't know how to fix it yet. But will find a way
|
|
57165
57282
|
connection,
|
|
57166
57283
|
{ pgSchema: models },
|
|
57167
|
-
false
|
|
57168
|
-
client
|
|
57284
|
+
false
|
|
57169
57285
|
);
|
|
57170
57286
|
}
|
|
57171
57287
|
return response;
|
|
@@ -57174,12 +57290,11 @@ var init_utils4 = __esm({
|
|
|
57174
57290
|
};
|
|
57175
57291
|
}
|
|
57176
57292
|
});
|
|
57177
|
-
|
|
57293
|
+
init_utils5();
|
|
57178
57294
|
// Annotate the CommonJS export names for ESM import in node:
|
|
57179
57295
|
0 && (module.exports = {
|
|
57180
57296
|
assertV1OutFolder,
|
|
57181
57297
|
columnRenameKey,
|
|
57182
|
-
defineConfig,
|
|
57183
57298
|
dryJournal,
|
|
57184
57299
|
generateDrizzleJson,
|
|
57185
57300
|
generateMigration,
|