@prisma/migrate 6.6.0-dev.42 → 6.6.0-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +7 -7
- package/dist/{chunk-TGV6QGEF.js → chunk-QVMYNWAN.js} +191 -37
- package/dist/{chunk-4EPP5QEP.js → chunk-SA6K55XE.js} +24 -74
- package/dist/{chunk-IC2RT2YE.js → chunk-VHHIONLT.js} +25 -75
- package/dist/{chunk-QJT4H5N6.js → chunk-ZJ4IDCRR.js} +4 -4
- package/dist/commands/DbPull.js +3 -3
- package/dist/commands/MigrateDiff.js +3 -3
- package/dist/index.js +7 -10
- package/dist/internals/src/Generator.d.ts +1 -1
- package/dist/internals/src/cli/directoryConfig.d.ts +1 -1
- package/dist/internals/src/cli/getSchema.d.ts +3 -28
- package/dist/internals/src/cli/hashes.d.ts +1 -2
- package/dist/internals/src/cli/schemaContext.d.ts +5 -4
- package/dist/internals/src/client/getClientEngineType.d.ts +1 -1
- package/dist/internals/src/convertCredentials.d.ts +1 -1
- package/dist/internals/src/engine-commands/getConfig.d.ts +1 -1
- package/dist/internals/src/engine-commands/getDmmf.d.ts +2 -1
- package/dist/internals/src/get-generators/getGenerators.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +1 -1
- package/dist/internals/src/index.d.ts +2 -2
- package/dist/internals/src/types.d.ts +1 -1
- package/dist/internals/src/utils/extractPreviewFeatures.d.ts +1 -1
- package/dist/internals/src/utils/getEnvPaths.d.ts +1 -1
- package/dist/internals/src/utils/parseEnvValue.d.ts +1 -1
- package/dist/migrate/src/index.d.ts +0 -1
- package/dist/migrate/src/types.d.ts +1 -1
- package/dist/migrate/src/utils/createMigration.d.ts +1 -1
- package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +1 -1
- package/dist/migrate/src/utils/introspectSql.d.ts +1 -1
- package/dist/migrate/src/utils/printDatasources.d.ts +1 -1
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +1 -1
- package/dist/utils/setupPostgres.js +2 -2
- package/package.json +7 -8
- package/dist/chunk-GKDFIHM2.js +0 -45
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
- package/dist/utils/getSchemaPathAndPrint.js +0 -27
package/dist/bin.js
CHANGED
|
@@ -28,13 +28,13 @@ var import_chunk_O723A5JE = require("./chunk-O723A5JE.js");
|
|
|
28
28
|
var import_chunk_KN2W5IP7 = require("./chunk-KN2W5IP7.js");
|
|
29
29
|
var import_chunk_GKHRL6AR = require("./chunk-GKHRL6AR.js");
|
|
30
30
|
var import_chunk_GAKKKF5T = require("./chunk-GAKKKF5T.js");
|
|
31
|
-
var
|
|
31
|
+
var import_chunk_ZJ4IDCRR = require("./chunk-ZJ4IDCRR.js");
|
|
32
32
|
var import_chunk_IINN7QUV = require("./chunk-IINN7QUV.js");
|
|
33
|
-
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
34
33
|
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
35
34
|
var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
|
|
36
35
|
var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
|
|
37
36
|
var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
|
|
37
|
+
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
38
38
|
var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
|
|
39
39
|
var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
40
40
|
var import_chunk_3PIR4R46 = require("./chunk-3PIR4R46.js");
|
|
@@ -48,9 +48,9 @@ var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
|
|
|
48
48
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
49
49
|
var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
|
|
50
50
|
var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
|
|
51
|
-
var
|
|
52
|
-
var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
|
|
51
|
+
var import_chunk_VHHIONLT = require("./chunk-VHHIONLT.js");
|
|
53
52
|
var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
|
|
53
|
+
var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
|
|
54
54
|
var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
|
|
55
55
|
var import_chunk_PDCXVUV3 = require("./chunk-PDCXVUV3.js");
|
|
56
56
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
@@ -70,7 +70,7 @@ var import_config = require("@prisma/config");
|
|
|
70
70
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
71
71
|
var import_engines_version = require("@prisma/engines-version");
|
|
72
72
|
var import_internals = require("@prisma/internals");
|
|
73
|
-
var version = "6.6.0-dev.
|
|
73
|
+
var version = "6.6.0-dev.50";
|
|
74
74
|
process.on("uncaughtException", (e) => {
|
|
75
75
|
console.log(e);
|
|
76
76
|
});
|
|
@@ -97,11 +97,11 @@ async function main() {
|
|
|
97
97
|
resolve: import_chunk_KN2W5IP7.MigrateResolve.new(),
|
|
98
98
|
reset: import_chunk_O723A5JE.MigrateReset.new(),
|
|
99
99
|
deploy: import_chunk_HHVLUI3H.MigrateDeploy.new(),
|
|
100
|
-
diff:
|
|
100
|
+
diff: import_chunk_VHHIONLT.MigrateDiff.new()
|
|
101
101
|
}),
|
|
102
102
|
db: import_chunk_EJG7GKM7.DbCommand.new({
|
|
103
103
|
execute: import_chunk_GAKKKF5T.DbExecute.new(),
|
|
104
|
-
pull:
|
|
104
|
+
pull: import_chunk_ZJ4IDCRR.DbPull.new(),
|
|
105
105
|
push: import_chunk_3PIR4R46.DbPush.new(),
|
|
106
106
|
// drop: DbDrop.new(),
|
|
107
107
|
seed: import_chunk_B4SUSDC2.DbSeed.new()
|
|
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_QVMYNWAN_exports = {};
|
|
20
|
+
__export(chunk_QVMYNWAN_exports, {
|
|
21
21
|
require_lib: () => require_lib2
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_QVMYNWAN_exports);
|
|
24
24
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
25
25
|
var require_postgres_array = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
26
26
|
"../../node_modules/.pnpm/postgres-array@2.0.0/node_modules/postgres-array/index.js"(exports) {
|
|
@@ -938,7 +938,7 @@ var require_pg_types = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
938
938
|
}
|
|
939
939
|
});
|
|
940
940
|
var require_defaults = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
941
|
-
"../../node_modules/.pnpm/pg@8.
|
|
941
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/defaults.js"(exports, module2) {
|
|
942
942
|
"use strict";
|
|
943
943
|
module2.exports = {
|
|
944
944
|
// database host. defaults to localhost
|
|
@@ -998,7 +998,7 @@ var require_defaults = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
998
998
|
}
|
|
999
999
|
});
|
|
1000
1000
|
var require_utils = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1001
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1001
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/utils.js"(exports, module2) {
|
|
1002
1002
|
"use strict";
|
|
1003
1003
|
var defaults = require_defaults();
|
|
1004
1004
|
function escapeElement(elementRepresentation) {
|
|
@@ -1146,7 +1146,7 @@ var require_utils = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1146
1146
|
}
|
|
1147
1147
|
});
|
|
1148
1148
|
var require_utils_legacy = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1149
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1149
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/crypto/utils-legacy.js"(exports, module2) {
|
|
1150
1150
|
"use strict";
|
|
1151
1151
|
var nodeCrypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
1152
1152
|
function md5(string) {
|
|
@@ -1160,6 +1160,10 @@ var require_utils_legacy = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1160
1160
|
function sha256(text) {
|
|
1161
1161
|
return nodeCrypto.createHash("sha256").update(text).digest();
|
|
1162
1162
|
}
|
|
1163
|
+
function hashByName(hashName, text) {
|
|
1164
|
+
hashName = hashName.replace(/(\D)-/, "$1");
|
|
1165
|
+
return nodeCrypto.createHash(hashName).update(text).digest();
|
|
1166
|
+
}
|
|
1163
1167
|
function hmacSha256(key, msg) {
|
|
1164
1168
|
return nodeCrypto.createHmac("sha256", key).update(msg).digest();
|
|
1165
1169
|
}
|
|
@@ -1171,13 +1175,14 @@ var require_utils_legacy = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1171
1175
|
randomBytes: nodeCrypto.randomBytes,
|
|
1172
1176
|
deriveKey,
|
|
1173
1177
|
sha256,
|
|
1178
|
+
hashByName,
|
|
1174
1179
|
hmacSha256,
|
|
1175
1180
|
md5
|
|
1176
1181
|
};
|
|
1177
1182
|
}
|
|
1178
1183
|
});
|
|
1179
1184
|
var require_utils_webcrypto = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1180
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1185
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/crypto/utils-webcrypto.js"(exports, module2) {
|
|
1181
1186
|
"use strict";
|
|
1182
1187
|
var nodeCrypto = (0, import_chunk_2ESYSVXG.__require)("crypto");
|
|
1183
1188
|
module2.exports = {
|
|
@@ -1185,6 +1190,7 @@ var require_utils_webcrypto = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1185
1190
|
randomBytes,
|
|
1186
1191
|
deriveKey,
|
|
1187
1192
|
sha256,
|
|
1193
|
+
hashByName,
|
|
1188
1194
|
hmacSha256,
|
|
1189
1195
|
md5
|
|
1190
1196
|
};
|
|
@@ -1211,6 +1217,9 @@ var require_utils_webcrypto = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1211
1217
|
async function sha256(text) {
|
|
1212
1218
|
return await subtleCrypto.digest("SHA-256", text);
|
|
1213
1219
|
}
|
|
1220
|
+
async function hashByName(hashName, text) {
|
|
1221
|
+
return await subtleCrypto.digest(hashName, text);
|
|
1222
|
+
}
|
|
1214
1223
|
async function hmacSha256(keyBuffer, msg) {
|
|
1215
1224
|
const key = await subtleCrypto.importKey("raw", keyBuffer, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
1216
1225
|
return await subtleCrypto.sign("HMAC", key, textEncoder.encode(msg));
|
|
@@ -1223,7 +1232,7 @@ var require_utils_webcrypto = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1223
1232
|
}
|
|
1224
1233
|
});
|
|
1225
1234
|
var require_utils2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1226
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1235
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/crypto/utils.js"(exports, module2) {
|
|
1227
1236
|
"use strict";
|
|
1228
1237
|
var useLegacyCrypto = parseInt(process.versions && process.versions.node && process.versions.node.split(".")[0]) < 15;
|
|
1229
1238
|
if (useLegacyCrypto) {
|
|
@@ -1233,23 +1242,142 @@ var require_utils2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1233
1242
|
}
|
|
1234
1243
|
}
|
|
1235
1244
|
});
|
|
1245
|
+
var require_cert_signatures = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1246
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/crypto/cert-signatures.js"(exports, module2) {
|
|
1247
|
+
"use strict";
|
|
1248
|
+
function x509Error(msg, cert) {
|
|
1249
|
+
throw new Error("SASL channel binding: " + msg + " when parsing public certificate " + cert.toString("base64"));
|
|
1250
|
+
}
|
|
1251
|
+
function readASN1Length(data, index) {
|
|
1252
|
+
let length = data[index++];
|
|
1253
|
+
if (length < 128) return { length, index };
|
|
1254
|
+
const lengthBytes = length & 127;
|
|
1255
|
+
if (lengthBytes > 4) x509Error("bad length", data);
|
|
1256
|
+
length = 0;
|
|
1257
|
+
for (let i = 0; i < lengthBytes; i++) {
|
|
1258
|
+
length = length << 8 | data[index++];
|
|
1259
|
+
}
|
|
1260
|
+
return { length, index };
|
|
1261
|
+
}
|
|
1262
|
+
function readASN1OID(data, index) {
|
|
1263
|
+
if (data[index++] !== 6) x509Error("non-OID data", data);
|
|
1264
|
+
const { length: OIDLength, index: indexAfterOIDLength } = readASN1Length(data, index);
|
|
1265
|
+
index = indexAfterOIDLength;
|
|
1266
|
+
lastIndex = index + OIDLength;
|
|
1267
|
+
const byte1 = data[index++];
|
|
1268
|
+
let oid = (byte1 / 40 >> 0) + "." + byte1 % 40;
|
|
1269
|
+
while (index < lastIndex) {
|
|
1270
|
+
let value = 0;
|
|
1271
|
+
while (index < lastIndex) {
|
|
1272
|
+
const nextByte = data[index++];
|
|
1273
|
+
value = value << 7 | nextByte & 127;
|
|
1274
|
+
if (nextByte < 128) break;
|
|
1275
|
+
}
|
|
1276
|
+
oid += "." + value;
|
|
1277
|
+
}
|
|
1278
|
+
return { oid, index };
|
|
1279
|
+
}
|
|
1280
|
+
function expectASN1Seq(data, index) {
|
|
1281
|
+
if (data[index++] !== 48) x509Error("non-sequence data", data);
|
|
1282
|
+
return readASN1Length(data, index);
|
|
1283
|
+
}
|
|
1284
|
+
function signatureAlgorithmHashFromCertificate(data, index) {
|
|
1285
|
+
if (index === void 0) index = 0;
|
|
1286
|
+
index = expectASN1Seq(data, index).index;
|
|
1287
|
+
const { length: certInfoLength, index: indexAfterCertInfoLength } = expectASN1Seq(data, index);
|
|
1288
|
+
index = indexAfterCertInfoLength + certInfoLength;
|
|
1289
|
+
index = expectASN1Seq(data, index).index;
|
|
1290
|
+
const { oid, index: indexAfterOID } = readASN1OID(data, index);
|
|
1291
|
+
switch (oid) {
|
|
1292
|
+
// RSA
|
|
1293
|
+
case "1.2.840.113549.1.1.4":
|
|
1294
|
+
return "MD5";
|
|
1295
|
+
case "1.2.840.113549.1.1.5":
|
|
1296
|
+
return "SHA-1";
|
|
1297
|
+
case "1.2.840.113549.1.1.11":
|
|
1298
|
+
return "SHA-256";
|
|
1299
|
+
case "1.2.840.113549.1.1.12":
|
|
1300
|
+
return "SHA-384";
|
|
1301
|
+
case "1.2.840.113549.1.1.13":
|
|
1302
|
+
return "SHA-512";
|
|
1303
|
+
case "1.2.840.113549.1.1.14":
|
|
1304
|
+
return "SHA-224";
|
|
1305
|
+
case "1.2.840.113549.1.1.15":
|
|
1306
|
+
return "SHA512-224";
|
|
1307
|
+
case "1.2.840.113549.1.1.16":
|
|
1308
|
+
return "SHA512-256";
|
|
1309
|
+
// ECDSA
|
|
1310
|
+
case "1.2.840.10045.4.1":
|
|
1311
|
+
return "SHA-1";
|
|
1312
|
+
case "1.2.840.10045.4.3.1":
|
|
1313
|
+
return "SHA-224";
|
|
1314
|
+
case "1.2.840.10045.4.3.2":
|
|
1315
|
+
return "SHA-256";
|
|
1316
|
+
case "1.2.840.10045.4.3.3":
|
|
1317
|
+
return "SHA-384";
|
|
1318
|
+
case "1.2.840.10045.4.3.4":
|
|
1319
|
+
return "SHA-512";
|
|
1320
|
+
// RSASSA-PSS: hash is indicated separately
|
|
1321
|
+
case "1.2.840.113549.1.1.10":
|
|
1322
|
+
index = indexAfterOID;
|
|
1323
|
+
index = expectASN1Seq(data, index).index;
|
|
1324
|
+
if (data[index++] !== 160) x509Error("non-tag data", data);
|
|
1325
|
+
index = readASN1Length(data, index).index;
|
|
1326
|
+
index = expectASN1Seq(data, index).index;
|
|
1327
|
+
const { oid: hashOID } = readASN1OID(data, index);
|
|
1328
|
+
switch (hashOID) {
|
|
1329
|
+
// standalone hash OIDs
|
|
1330
|
+
case "1.2.840.113549.2.5":
|
|
1331
|
+
return "MD5";
|
|
1332
|
+
case "1.3.14.3.2.26":
|
|
1333
|
+
return "SHA-1";
|
|
1334
|
+
case "2.16.840.1.101.3.4.2.1":
|
|
1335
|
+
return "SHA-256";
|
|
1336
|
+
case "2.16.840.1.101.3.4.2.2":
|
|
1337
|
+
return "SHA-384";
|
|
1338
|
+
case "2.16.840.1.101.3.4.2.3":
|
|
1339
|
+
return "SHA-512";
|
|
1340
|
+
}
|
|
1341
|
+
x509Error("unknown hash OID " + hashOID, data);
|
|
1342
|
+
// Ed25519 -- see https: return//github.com/openssl/openssl/issues/15477
|
|
1343
|
+
case "1.3.101.110":
|
|
1344
|
+
case "1.3.101.112":
|
|
1345
|
+
return "SHA-512";
|
|
1346
|
+
// Ed448 -- still not in pg 17.2 (if supported, digest would be SHAKE256 x 64 bytes)
|
|
1347
|
+
case "1.3.101.111":
|
|
1348
|
+
case "1.3.101.113":
|
|
1349
|
+
x509Error("Ed448 certificate channel binding is not currently supported by Postgres");
|
|
1350
|
+
}
|
|
1351
|
+
x509Error("unknown OID " + oid, data);
|
|
1352
|
+
}
|
|
1353
|
+
module2.exports = { signatureAlgorithmHashFromCertificate };
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1236
1356
|
var require_sasl = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1237
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1357
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/crypto/sasl.js"(exports, module2) {
|
|
1238
1358
|
"use strict";
|
|
1239
1359
|
var crypto = require_utils2();
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1360
|
+
var { signatureAlgorithmHashFromCertificate } = require_cert_signatures();
|
|
1361
|
+
function startSession(mechanisms, stream) {
|
|
1362
|
+
const candidates = ["SCRAM-SHA-256"];
|
|
1363
|
+
if (stream) candidates.unshift("SCRAM-SHA-256-PLUS");
|
|
1364
|
+
const mechanism = candidates.find((candidate) => mechanisms.includes(candidate));
|
|
1365
|
+
if (!mechanism) {
|
|
1366
|
+
throw new Error("SASL: Only mechanism(s) " + candidates.join(" and ") + " are supported");
|
|
1367
|
+
}
|
|
1368
|
+
if (mechanism === "SCRAM-SHA-256-PLUS" && typeof stream.getPeerCertificate !== "function") {
|
|
1369
|
+
throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");
|
|
1243
1370
|
}
|
|
1244
1371
|
const clientNonce = crypto.randomBytes(18).toString("base64");
|
|
1372
|
+
const gs2Header = mechanism === "SCRAM-SHA-256-PLUS" ? "p=tls-server-end-point" : stream ? "y" : "n";
|
|
1245
1373
|
return {
|
|
1246
|
-
mechanism
|
|
1374
|
+
mechanism,
|
|
1247
1375
|
clientNonce,
|
|
1248
|
-
response: "
|
|
1376
|
+
response: gs2Header + ",,n=*,r=" + clientNonce,
|
|
1249
1377
|
message: "SASLInitialResponse"
|
|
1250
1378
|
};
|
|
1251
1379
|
}
|
|
1252
|
-
async function continueSession(session, password, serverData) {
|
|
1380
|
+
async function continueSession(session, password, serverData, stream) {
|
|
1253
1381
|
if (session.message !== "SASLInitialResponse") {
|
|
1254
1382
|
throw new Error("SASL: Last message was not SASLInitialResponse");
|
|
1255
1383
|
}
|
|
@@ -1270,7 +1398,16 @@ var require_sasl = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1270
1398
|
}
|
|
1271
1399
|
var clientFirstMessageBare = "n=*,r=" + session.clientNonce;
|
|
1272
1400
|
var serverFirstMessage = "r=" + sv.nonce + ",s=" + sv.salt + ",i=" + sv.iteration;
|
|
1273
|
-
|
|
1401
|
+
let channelBinding = stream ? "eSws" : "biws";
|
|
1402
|
+
if (session.mechanism === "SCRAM-SHA-256-PLUS") {
|
|
1403
|
+
const peerCert = stream.getPeerCertificate().raw;
|
|
1404
|
+
let hashName = signatureAlgorithmHashFromCertificate(peerCert);
|
|
1405
|
+
if (hashName === "MD5" || hashName === "SHA-1") hashName = "SHA-256";
|
|
1406
|
+
const certHash = await crypto.hashByName(hashName, peerCert);
|
|
1407
|
+
const bindingData = Buffer.concat([Buffer.from("p=tls-server-end-point,,"), Buffer.from(certHash)]);
|
|
1408
|
+
channelBinding = bindingData.toString("base64");
|
|
1409
|
+
}
|
|
1410
|
+
var clientFinalMessageWithoutProof = "c=" + channelBinding + ",r=" + sv.nonce;
|
|
1274
1411
|
var authMessage = clientFirstMessageBare + "," + serverFirstMessage + "," + clientFinalMessageWithoutProof;
|
|
1275
1412
|
var saltBytes = Buffer.from(sv.salt, "base64");
|
|
1276
1413
|
var saltedPassword = await crypto.deriveKey(password, saltBytes, sv.iteration);
|
|
@@ -1382,7 +1519,7 @@ var require_sasl = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1382
1519
|
}
|
|
1383
1520
|
});
|
|
1384
1521
|
var require_type_overrides = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1385
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1522
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/type-overrides.js"(exports, module2) {
|
|
1386
1523
|
"use strict";
|
|
1387
1524
|
var types = require_pg_types();
|
|
1388
1525
|
function TypeOverrides(userTypes) {
|
|
@@ -1498,7 +1635,7 @@ var require_pg_connection_string = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1498
1635
|
}
|
|
1499
1636
|
});
|
|
1500
1637
|
var require_connection_parameters = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1501
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1638
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/connection-parameters.js"(exports, module2) {
|
|
1502
1639
|
"use strict";
|
|
1503
1640
|
var dns = (0, import_chunk_2ESYSVXG.__require)("dns");
|
|
1504
1641
|
var defaults = require_defaults();
|
|
@@ -1634,7 +1771,7 @@ var require_connection_parameters = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1634
1771
|
}
|
|
1635
1772
|
});
|
|
1636
1773
|
var require_result = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1637
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1774
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/result.js"(exports, module2) {
|
|
1638
1775
|
"use strict";
|
|
1639
1776
|
var types = require_pg_types();
|
|
1640
1777
|
var matchRegexp = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;
|
|
@@ -1722,7 +1859,7 @@ var require_result = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1722
1859
|
}
|
|
1723
1860
|
});
|
|
1724
1861
|
var require_query = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1725
|
-
"../../node_modules/.pnpm/pg@8.
|
|
1862
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/query.js"(exports, module2) {
|
|
1726
1863
|
"use strict";
|
|
1727
1864
|
var { EventEmitter } = (0, import_chunk_2ESYSVXG.__require)("events");
|
|
1728
1865
|
var Result = require_result();
|
|
@@ -1852,7 +1989,12 @@ var require_query = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1852
1989
|
return new Error("Query values must be an array");
|
|
1853
1990
|
}
|
|
1854
1991
|
if (this.requiresPreparation()) {
|
|
1855
|
-
|
|
1992
|
+
connection.stream.cork && connection.stream.cork();
|
|
1993
|
+
try {
|
|
1994
|
+
this.prepare(connection);
|
|
1995
|
+
} finally {
|
|
1996
|
+
connection.stream.uncork && connection.stream.uncork();
|
|
1997
|
+
}
|
|
1856
1998
|
} else {
|
|
1857
1999
|
connection.query(this.text);
|
|
1858
2000
|
}
|
|
@@ -1913,7 +2055,7 @@ var require_query = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1913
2055
|
}
|
|
1914
2056
|
});
|
|
1915
2057
|
var require_messages = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1916
|
-
"../../node_modules/.pnpm/pg-protocol@1.
|
|
2058
|
+
"../../node_modules/.pnpm/pg-protocol@1.8.0/node_modules/pg-protocol/dist/messages.js"(exports) {
|
|
1917
2059
|
"use strict";
|
|
1918
2060
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1919
2061
|
exports.NoticeMessage = exports.DataRowMessage = exports.CommandCompleteMessage = exports.ReadyForQueryMessage = exports.NotificationResponseMessage = exports.BackendKeyDataMessage = exports.AuthenticationMD5Password = exports.ParameterStatusMessage = exports.ParameterDescriptionMessage = exports.RowDescriptionMessage = exports.Field = exports.CopyResponse = exports.CopyDataMessage = exports.DatabaseError = exports.copyDone = exports.emptyQuery = exports.replicationStart = exports.portalSuspended = exports.noData = exports.closeComplete = exports.bindComplete = exports.parseComplete = void 0;
|
|
@@ -2076,7 +2218,7 @@ var require_messages = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2076
2218
|
}
|
|
2077
2219
|
});
|
|
2078
2220
|
var require_buffer_writer = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2079
|
-
"../../node_modules/.pnpm/pg-protocol@1.
|
|
2221
|
+
"../../node_modules/.pnpm/pg-protocol@1.8.0/node_modules/pg-protocol/dist/buffer-writer.js"(exports) {
|
|
2080
2222
|
"use strict";
|
|
2081
2223
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2082
2224
|
exports.Writer = void 0;
|
|
@@ -2155,7 +2297,7 @@ var require_buffer_writer = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2155
2297
|
}
|
|
2156
2298
|
});
|
|
2157
2299
|
var require_serializer = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2158
|
-
"../../node_modules/.pnpm/pg-protocol@1.
|
|
2300
|
+
"../../node_modules/.pnpm/pg-protocol@1.8.0/node_modules/pg-protocol/dist/serializer.js"(exports) {
|
|
2159
2301
|
"use strict";
|
|
2160
2302
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2161
2303
|
exports.serialize = void 0;
|
|
@@ -2369,7 +2511,7 @@ var require_serializer = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2369
2511
|
}
|
|
2370
2512
|
});
|
|
2371
2513
|
var require_buffer_reader = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2372
|
-
"../../node_modules/.pnpm/pg-protocol@1.
|
|
2514
|
+
"../../node_modules/.pnpm/pg-protocol@1.8.0/node_modules/pg-protocol/dist/buffer-reader.js"(exports) {
|
|
2373
2515
|
"use strict";
|
|
2374
2516
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2375
2517
|
exports.BufferReader = void 0;
|
|
@@ -2427,7 +2569,7 @@ var require_buffer_reader = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2427
2569
|
}
|
|
2428
2570
|
});
|
|
2429
2571
|
var require_parser = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2430
|
-
"../../node_modules/.pnpm/pg-protocol@1.
|
|
2572
|
+
"../../node_modules/.pnpm/pg-protocol@1.8.0/node_modules/pg-protocol/dist/parser.js"(exports) {
|
|
2431
2573
|
"use strict";
|
|
2432
2574
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2433
2575
|
exports.Parser = void 0;
|
|
@@ -2716,7 +2858,7 @@ var require_parser = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2716
2858
|
}
|
|
2717
2859
|
});
|
|
2718
2860
|
var require_dist = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2719
|
-
"../../node_modules/.pnpm/pg-protocol@1.
|
|
2861
|
+
"../../node_modules/.pnpm/pg-protocol@1.8.0/node_modules/pg-protocol/dist/index.js"(exports) {
|
|
2720
2862
|
"use strict";
|
|
2721
2863
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2722
2864
|
exports.DatabaseError = exports.serialize = exports.parse = void 0;
|
|
@@ -2749,7 +2891,7 @@ var init_empty = (0, import_chunk_2ESYSVXG.__esm)({
|
|
|
2749
2891
|
}
|
|
2750
2892
|
});
|
|
2751
2893
|
var require_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2752
|
-
"../../node_modules/.pnpm/pg@8.
|
|
2894
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/stream.js"(exports, module2) {
|
|
2753
2895
|
"use strict";
|
|
2754
2896
|
var { getStream, getSecureStream } = getStreamFuncs();
|
|
2755
2897
|
module2.exports = {
|
|
@@ -2814,7 +2956,7 @@ var require_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2814
2956
|
}
|
|
2815
2957
|
});
|
|
2816
2958
|
var require_connection = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
2817
|
-
"../../node_modules/.pnpm/pg@8.
|
|
2959
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/connection.js"(exports, module2) {
|
|
2818
2960
|
"use strict";
|
|
2819
2961
|
var EventEmitter = (0, import_chunk_2ESYSVXG.__require)("events").EventEmitter;
|
|
2820
2962
|
var { parse, serialize } = require_dist();
|
|
@@ -3283,7 +3425,7 @@ var require_lib = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3283
3425
|
}
|
|
3284
3426
|
});
|
|
3285
3427
|
var require_client = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3286
|
-
"../../node_modules/.pnpm/pg@8.
|
|
3428
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/client.js"(exports, module2) {
|
|
3287
3429
|
"use strict";
|
|
3288
3430
|
var EventEmitter = (0, import_chunk_2ESYSVXG.__require)("events").EventEmitter;
|
|
3289
3431
|
var utils = require_utils();
|
|
@@ -3318,6 +3460,7 @@ var require_client = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3318
3460
|
this._connected = false;
|
|
3319
3461
|
this._connectionError = false;
|
|
3320
3462
|
this._queryable = true;
|
|
3463
|
+
this.enableChannelBinding = Boolean(c.enableChannelBinding);
|
|
3321
3464
|
this.connection = c.connection || new Connection({
|
|
3322
3465
|
stream: c.stream,
|
|
3323
3466
|
ssl: this.connectionParameters.ssl,
|
|
@@ -3367,6 +3510,9 @@ var require_client = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3367
3510
|
con._ending = true;
|
|
3368
3511
|
con.stream.destroy(new Error("timeout expired"));
|
|
3369
3512
|
}, this._connectionTimeoutMillis);
|
|
3513
|
+
if (this.connectionTimeoutHandle.unref) {
|
|
3514
|
+
this.connectionTimeoutHandle.unref();
|
|
3515
|
+
}
|
|
3370
3516
|
}
|
|
3371
3517
|
if (this.host && this.host.indexOf("/") === 0) {
|
|
3372
3518
|
con.connect(this.host + "/.s.PGSQL." + this.port);
|
|
@@ -3494,7 +3640,7 @@ var require_client = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3494
3640
|
_handleAuthSASL(msg) {
|
|
3495
3641
|
this._checkPgPass(() => {
|
|
3496
3642
|
try {
|
|
3497
|
-
this.saslSession = sasl.startSession(msg.mechanisms);
|
|
3643
|
+
this.saslSession = sasl.startSession(msg.mechanisms, this.enableChannelBinding && this.connection.stream);
|
|
3498
3644
|
this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response);
|
|
3499
3645
|
} catch (err) {
|
|
3500
3646
|
this.connection.emit("error", err);
|
|
@@ -3503,7 +3649,12 @@ var require_client = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3503
3649
|
}
|
|
3504
3650
|
async _handleAuthSASLContinue(msg) {
|
|
3505
3651
|
try {
|
|
3506
|
-
await sasl.continueSession(
|
|
3652
|
+
await sasl.continueSession(
|
|
3653
|
+
this.saslSession,
|
|
3654
|
+
this.password,
|
|
3655
|
+
msg.data,
|
|
3656
|
+
this.enableChannelBinding && this.connection.stream
|
|
3657
|
+
);
|
|
3507
3658
|
this.connection.sendSCRAMClientFinalMessage(this.saslSession.response);
|
|
3508
3659
|
} catch (err) {
|
|
3509
3660
|
this.connection.emit("error", err);
|
|
@@ -3799,7 +3950,7 @@ var require_client = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3799
3950
|
}
|
|
3800
3951
|
});
|
|
3801
3952
|
var require_pg_pool = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
3802
|
-
"../../node_modules/.pnpm/pg-pool@3.
|
|
3953
|
+
"../../node_modules/.pnpm/pg-pool@3.8.0_pg@8.14.1/node_modules/pg-pool/index.js"(exports, module2) {
|
|
3803
3954
|
"use strict";
|
|
3804
3955
|
var EventEmitter = (0, import_chunk_2ESYSVXG.__require)("events").EventEmitter;
|
|
3805
3956
|
var NOOP = function() {
|
|
@@ -3965,6 +4116,9 @@ var require_pg_pool = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3965
4116
|
pendingItem.timedOut = true;
|
|
3966
4117
|
response.callback(new Error("timeout exceeded when trying to connect"));
|
|
3967
4118
|
}, this.options.connectionTimeoutMillis);
|
|
4119
|
+
if (tid.unref) {
|
|
4120
|
+
tid.unref();
|
|
4121
|
+
}
|
|
3968
4122
|
this._pendingQueue.push(pendingItem);
|
|
3969
4123
|
return result;
|
|
3970
4124
|
}
|
|
@@ -4180,7 +4334,7 @@ var require_pg_pool = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
4180
4334
|
}
|
|
4181
4335
|
});
|
|
4182
4336
|
var require_query2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
4183
|
-
"../../node_modules/.pnpm/pg@8.
|
|
4337
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/native/query.js"(exports, module2) {
|
|
4184
4338
|
"use strict";
|
|
4185
4339
|
var EventEmitter = (0, import_chunk_2ESYSVXG.__require)("events").EventEmitter;
|
|
4186
4340
|
var util = (0, import_chunk_2ESYSVXG.__require)("util");
|
|
@@ -4320,7 +4474,7 @@ var require_query2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
4320
4474
|
}
|
|
4321
4475
|
});
|
|
4322
4476
|
var require_client2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
4323
|
-
"../../node_modules/.pnpm/pg@8.
|
|
4477
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/native/client.js"(exports, module2) {
|
|
4324
4478
|
"use strict";
|
|
4325
4479
|
var Native;
|
|
4326
4480
|
try {
|
|
@@ -4558,13 +4712,13 @@ var require_client2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
4558
4712
|
}
|
|
4559
4713
|
});
|
|
4560
4714
|
var require_native = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
4561
|
-
"../../node_modules/.pnpm/pg@8.
|
|
4715
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/native/index.js"(exports, module2) {
|
|
4562
4716
|
"use strict";
|
|
4563
4717
|
module2.exports = require_client2();
|
|
4564
4718
|
}
|
|
4565
4719
|
});
|
|
4566
4720
|
var require_lib2 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
4567
|
-
"../../node_modules/.pnpm/pg@8.
|
|
4721
|
+
"../../node_modules/.pnpm/pg@8.14.1/node_modules/pg/lib/index.js"(exports, module2) {
|
|
4568
4722
|
"use strict";
|
|
4569
4723
|
var Client = require_client();
|
|
4570
4724
|
var defaults = require_defaults();
|