@prisma/internals 6.20.0-integration-merge-release-workflows2.1 → 6.20.0-integration-next.4
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/{chunk-GMW36QQF.js → chunk-22HIO2UL.js} +7 -7
- package/dist/{chunk-TBR6SNKL.js → chunk-2Z7PH5WX.js} +5 -5
- package/dist/{chunk-2GUGGLPK.js → chunk-3D4RRUYX.js} +56 -129
- package/dist/{chunk-I6WLABB2.js → chunk-3WXUQZS7.js} +14 -5
- package/dist/{chunk-HFFWZTVM.js → chunk-4B7YT7EE.js} +8 -18
- package/dist/{chunk-RS2R7COT.js → chunk-5I4ERIIY.js} +3 -9
- package/dist/{chunk-F2OZV76L.js → chunk-5MHUYAV3.js} +9 -9
- package/dist/{chunk-FRE4ZWRR.js → chunk-65KNJHQS.js} +13 -13
- package/dist/{chunk-WYQJ4JWO.js → chunk-6WBK35XU.js} +13 -13
- package/dist/{chunk-7QC5VORA.js → chunk-7SF6QSKE.js} +7 -8
- package/dist/{chunk-TH33KD3E.js → chunk-7VXI23OO.js} +5 -5
- package/dist/{chunk-E7DQNMQJ.js → chunk-7X4RB4O5.js} +5 -5
- package/dist/{chunk-WFNB7VRA.js → chunk-ARC7TW3L.js} +4 -14
- package/dist/{chunk-HHG4DGHC.js → chunk-CGLLQXZE.js} +11 -12
- package/dist/{chunk-AX5N26KG.js → chunk-CIGXHXCG.js} +18 -13
- package/dist/{chunk-FHZ5QJLR.js → chunk-D4EKBLXK.js} +5 -5
- package/dist/chunk-DYV47NUW.js +796 -0
- package/dist/{chunk-DVRZSMZ2.js → chunk-E4PYP2ZV.js} +5 -5
- package/dist/{chunk-IDINCQMN.js → chunk-FF7OLLBP.js} +12 -784
- package/dist/{chunk-4CGPN5SR.js → chunk-GJSFP4V4.js} +3 -9
- package/dist/{chunk-4JCVHBYR.js → chunk-GL7OANR6.js} +5 -5
- package/dist/{chunk-LV27YCGC.js → chunk-H4QG5ONG.js} +12 -12
- package/dist/{chunk-OAT7ZJED.js → chunk-H5STSTVK.js} +7 -20
- package/dist/{chunk-FYZCPL2Z.js → chunk-HNRMSI3R.js} +5 -8
- package/dist/{chunk-CCLAMTCA.js → chunk-HQDG2BBX.js} +7 -9
- package/dist/{chunk-W26QS5OG.js → chunk-J757IEPK.js} +56 -129
- package/dist/{chunk-NVNI2SRU.js → chunk-KNNTV7IN.js} +687 -213
- package/dist/{chunk-UQUWZJVN.js → chunk-LHTJCI5U.js} +7 -7
- package/dist/{chunk-5AI4FIZ3.js → chunk-MEOOYUIZ.js} +10 -10
- package/dist/{chunk-TQFONRJP.js → chunk-MLFKBBDL.js} +5 -5
- package/dist/{chunk-EYVG6XQS.js → chunk-OKVM3CW4.js} +3 -39
- package/dist/{chunk-T4UGPDF4.js → chunk-OSMLJTQN.js} +8 -10
- package/dist/{chunk-E4H6V3Z4.js → chunk-OV3PWX3C.js} +11 -11
- package/dist/{chunk-DYM2NTAG.js → chunk-Q5EKGHVB.js} +5 -5
- package/dist/{chunk-JOIIWB3U.js → chunk-QOZ7USPD.js} +193 -159
- package/dist/{chunk-BVJP43JS.js → chunk-QSVWJ2S2.js} +13 -784
- package/dist/{chunk-QJ3QPUM5.js → chunk-QWXKO4HW.js} +5 -5
- package/dist/{chunk-J32M37NY.js → chunk-R7L5ID34.js} +12 -12
- package/dist/{chunk-75BIJ5PX.js → chunk-SMJRM3EM.js} +9 -9
- package/dist/{chunk-JTS4UPHJ.js → chunk-TQZ7VRPF.js} +5 -5
- package/dist/{chunk-TQCLUNM2.js → chunk-VNIE2AZB.js} +4 -4
- package/dist/{chunk-TZJROXB3.js → chunk-WSZXPLJQ.js} +4 -4
- package/dist/{chunk-UQK76B5E.js → chunk-X6TWTGK6.js} +11 -11
- package/dist/{chunk-JYBUBKFO.js → chunk-XHZ4TZUD.js} +16 -38
- package/dist/{chunk-UHI6VYFX.js → chunk-XIYRAW5R.js} +15 -11
- package/dist/{chunk-SOKSKSEX.js → chunk-YJSJK7EC.js} +16 -38
- package/dist/cli/checkUnsupportedDataProxy.d.ts +3 -4
- package/dist/cli/checkUnsupportedDataProxy.js +56 -65
- package/dist/cli/getGeneratorSuccessMessage.js +2 -3
- package/dist/cli/getSchema.d.ts +1 -15
- package/dist/cli/getSchema.js +4 -5
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +3 -12
- package/dist/cli/schemaContext.js +57 -65
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +55 -64
- package/dist/engine-commands/getConfig.d.ts +1 -5
- package/dist/engine-commands/getConfig.js +10 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +6 -9
- package/dist/engine-commands/getEnginesInfo.d.ts +0 -1
- package/dist/engine-commands/getEnginesInfo.js +7 -9
- package/dist/engine-commands/index.d.ts +1 -1
- package/dist/engine-commands/index.js +65 -76
- package/dist/engine-commands/lintSchema.js +9 -9
- package/dist/engine-commands/mergeSchemas.js +10 -10
- package/dist/engine-commands/queryEngineCommons.js +6 -6
- package/dist/engine-commands/validate.js +10 -10
- package/dist/errorReporting.js +6 -6
- package/dist/get-generators/getGenerators.d.ts +0 -2
- package/dist/get-generators/getGenerators.js +58 -67
- package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
- package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +6 -5
- package/dist/getPackedPackage.js +4 -3
- package/dist/highlight/highlight.js +5 -5
- package/dist/index.d.ts +2 -14
- package/dist/index.js +98 -121
- package/dist/{multipart-parser-3AFJFP6K.js → multipart-parser-UV3WZSWW.js} +6 -6
- package/dist/resolveBinary.js +8 -7
- package/dist/schemaEngineCommands.js +9 -8
- package/dist/sendPanic.js +4 -5
- package/dist/utils/drawBox.js +2 -2
- package/dist/utils/fs-functional.js +10 -10
- package/dist/utils/fs-utils.js +8 -8
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +6 -7
- package/dist/utils/link.js +2 -2
- package/dist/utils/missingDatasource.js +5 -5
- package/dist/utils/missingGeneratorMessage.js +7 -7
- package/dist/wasm.js +5 -5
- package/package.json +15 -17
- package/dist/chunk-3FP46GUV.js +0 -471
- package/dist/chunk-46ABODUM.js +0 -186
- package/dist/chunk-6TTRTZXU.js +0 -37
- package/dist/chunk-D4VDA2TZ.js +0 -66
- package/dist/chunk-DZYINYAA.js +0 -68
- package/dist/chunk-ERSH2BQA.js +0 -58
- package/dist/chunk-HO5HRHFZ.js +0 -30
- package/dist/chunk-KDHESRKE.js +0 -49
- package/dist/chunk-PZMRR772.js +0 -41
- package/dist/chunk-T2PM5TKT.js +0 -55
- package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +0 -22
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +0 -135
- package/dist/client/getClientEngineType.d.ts +0 -7
- package/dist/client/getClientEngineType.js +0 -26
- package/dist/dotenvExpand.d.ts +0 -35
- package/dist/dotenvExpand.js +0 -25
- package/dist/utils/__tests__/maskSchema.test.js +0 -23
- package/dist/utils/cloudflareD1.d.ts +0 -5
- package/dist/utils/cloudflareD1.js +0 -27
- package/dist/utils/getEnvPaths.d.ts +0 -14
- package/dist/utils/getEnvPaths.js +0 -29
- package/dist/utils/handleEngineLoadingErrors.d.ts +0 -8
- package/dist/utils/handleEngineLoadingErrors.js +0 -27
- package/dist/utils/load.d.ts +0 -6
- package/dist/utils/load.js +0 -28
- package/dist/utils/loadEnvFile.d.ts +0 -10
- package/dist/utils/loadEnvFile.js +0 -30
- package/dist/utils/maskSchema.d.ts +0 -4
- package/dist/utils/maskSchema.js +0 -27
- package/dist/utils/serializeQueryEngineName.d.ts +0 -4
- package/dist/utils/serializeQueryEngineName.js +0 -25
- package/dist/utils/tryLoadEnvs.d.ts +0 -25
- package/dist/utils/tryLoadEnvs.js +0 -30
package/dist/wasm.js
CHANGED
|
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var wasm_exports = {};
|
|
20
20
|
__export(wasm_exports, {
|
|
21
|
-
prismaSchemaWasm: () =>
|
|
22
|
-
prismaSchemaWasmVersion: () =>
|
|
23
|
-
schemaEngineWasmVersion: () =>
|
|
21
|
+
prismaSchemaWasm: () => import_chunk_Q5EKGHVB.prismaSchemaWasm,
|
|
22
|
+
prismaSchemaWasmVersion: () => import_chunk_Q5EKGHVB.prismaSchemaWasmVersion,
|
|
23
|
+
schemaEngineWasmVersion: () => import_chunk_Q5EKGHVB.schemaEngineWasmVersion
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(wasm_exports);
|
|
26
|
-
var
|
|
27
|
-
var
|
|
26
|
+
var import_chunk_Q5EKGHVB = require("./chunk-Q5EKGHVB.js");
|
|
27
|
+
var import_chunk_OSMLJTQN = require("./chunk-OSMLJTQN.js");
|
|
28
28
|
var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
|
|
29
29
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/internals",
|
|
3
|
-
"version": "6.20.0-integration-
|
|
3
|
+
"version": "6.20.0-integration-next.4",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"README.md",
|
|
18
18
|
"dist",
|
|
19
|
-
"!**/libquery_engine*",
|
|
20
19
|
"!dist/get-generators/engines/*",
|
|
21
20
|
"scripts"
|
|
22
21
|
],
|
|
@@ -27,12 +26,11 @@
|
|
|
27
26
|
"@swc/jest": "0.2.37",
|
|
28
27
|
"@types/babel__helper-validator-identifier": "7.15.2",
|
|
29
28
|
"@types/jest": "29.5.14",
|
|
30
|
-
"@types/node": "
|
|
29
|
+
"@types/node": "~20.19.24",
|
|
31
30
|
"@types/resolve": "1.20.6",
|
|
32
31
|
"archiver": "6.0.2",
|
|
33
32
|
"checkpoint-client": "1.1.33",
|
|
34
33
|
"cli-truncate": "4.0.0",
|
|
35
|
-
"dotenv": "16.5.0",
|
|
36
34
|
"empathic": "2.0.0",
|
|
37
35
|
"escape-string-regexp": "5.0.0",
|
|
38
36
|
"execa": "8.0.1",
|
|
@@ -68,23 +66,23 @@
|
|
|
68
66
|
"yarn": "1.22.22"
|
|
69
67
|
},
|
|
70
68
|
"dependencies": {
|
|
71
|
-
"@prisma/prisma-schema-wasm": "6.
|
|
72
|
-
"@prisma/schema-engine-wasm": "6.
|
|
69
|
+
"@prisma/prisma-schema-wasm": "6.20.0-11.next-80ee0a44bf5668992b0c909c946a755b86b56c95",
|
|
70
|
+
"@prisma/schema-engine-wasm": "6.20.0-11.next-80ee0a44bf5668992b0c909c946a755b86b56c95",
|
|
73
71
|
"arg": "5.0.2",
|
|
74
72
|
"prompts": "2.4.2",
|
|
75
|
-
"@prisma/debug": "6.20.0-integration-
|
|
76
|
-
"@prisma/
|
|
77
|
-
"@prisma/dmmf": "6.20.0-integration-
|
|
78
|
-
"@prisma/
|
|
79
|
-
"@prisma/
|
|
80
|
-
"@prisma/
|
|
81
|
-
"@prisma/generator": "6.20.0-integration-
|
|
82
|
-
"@prisma/generator-helper": "6.20.0-integration-
|
|
83
|
-
"@prisma/get-platform": "6.20.0-integration-
|
|
84
|
-
"@prisma/schema-files-loader": "6.20.0-integration-
|
|
73
|
+
"@prisma/debug": "6.20.0-integration-next.4",
|
|
74
|
+
"@prisma/config": "6.20.0-integration-next.4",
|
|
75
|
+
"@prisma/dmmf": "6.20.0-integration-next.4",
|
|
76
|
+
"@prisma/driver-adapter-utils": "6.20.0-integration-next.4",
|
|
77
|
+
"@prisma/engines": "6.20.0-integration-next.4",
|
|
78
|
+
"@prisma/fetch-engine": "6.20.0-integration-next.4",
|
|
79
|
+
"@prisma/generator": "6.20.0-integration-next.4",
|
|
80
|
+
"@prisma/generator-helper": "6.20.0-integration-next.4",
|
|
81
|
+
"@prisma/get-platform": "6.20.0-integration-next.4",
|
|
82
|
+
"@prisma/schema-files-loader": "6.20.0-integration-next.4"
|
|
85
83
|
},
|
|
86
84
|
"peerDependencies": {
|
|
87
|
-
"typescript": ">=5.
|
|
85
|
+
"typescript": ">=5.4.0"
|
|
88
86
|
},
|
|
89
87
|
"peerDependenciesMeta": {
|
|
90
88
|
"typescript": {
|
package/dist/chunk-3FP46GUV.js
DELETED
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var chunk_3FP46GUV_exports = {};
|
|
30
|
-
__export(chunk_3FP46GUV_exports, {
|
|
31
|
-
exists: () => exists,
|
|
32
|
-
loadEnv: () => loadEnv,
|
|
33
|
-
pathsEqual: () => pathsEqual,
|
|
34
|
-
tryLoadEnvs: () => tryLoadEnvs
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(chunk_3FP46GUV_exports);
|
|
37
|
-
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
38
|
-
var import_chunk_T2PM5TKT = require("./chunk-T2PM5TKT.js");
|
|
39
|
-
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
40
|
-
var import_debug = __toESM(require("@prisma/debug"));
|
|
41
|
-
var import_fs = __toESM(require("fs"));
|
|
42
|
-
var import_path = __toESM(require("path"));
|
|
43
|
-
var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
44
|
-
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json"(exports, module2) {
|
|
45
|
-
module2.exports = {
|
|
46
|
-
name: "dotenv",
|
|
47
|
-
version: "16.5.0",
|
|
48
|
-
description: "Loads environment variables from .env file",
|
|
49
|
-
main: "lib/main.js",
|
|
50
|
-
types: "lib/main.d.ts",
|
|
51
|
-
exports: {
|
|
52
|
-
".": {
|
|
53
|
-
types: "./lib/main.d.ts",
|
|
54
|
-
require: "./lib/main.js",
|
|
55
|
-
default: "./lib/main.js"
|
|
56
|
-
},
|
|
57
|
-
"./config": "./config.js",
|
|
58
|
-
"./config.js": "./config.js",
|
|
59
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
60
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
61
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
62
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
63
|
-
"./package.json": "./package.json"
|
|
64
|
-
},
|
|
65
|
-
scripts: {
|
|
66
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
67
|
-
lint: "standard",
|
|
68
|
-
pretest: "npm run lint && npm run dts-check",
|
|
69
|
-
test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
70
|
-
"test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",
|
|
71
|
-
prerelease: "npm test",
|
|
72
|
-
release: "standard-version"
|
|
73
|
-
},
|
|
74
|
-
repository: {
|
|
75
|
-
type: "git",
|
|
76
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
77
|
-
},
|
|
78
|
-
homepage: "https://github.com/motdotla/dotenv#readme",
|
|
79
|
-
funding: "https://dotenvx.com",
|
|
80
|
-
keywords: [
|
|
81
|
-
"dotenv",
|
|
82
|
-
"env",
|
|
83
|
-
".env",
|
|
84
|
-
"environment",
|
|
85
|
-
"variables",
|
|
86
|
-
"config",
|
|
87
|
-
"settings"
|
|
88
|
-
],
|
|
89
|
-
readmeFilename: "README.md",
|
|
90
|
-
license: "BSD-2-Clause",
|
|
91
|
-
devDependencies: {
|
|
92
|
-
"@types/node": "^18.11.3",
|
|
93
|
-
decache: "^4.6.2",
|
|
94
|
-
sinon: "^14.0.1",
|
|
95
|
-
standard: "^17.0.0",
|
|
96
|
-
"standard-version": "^9.5.0",
|
|
97
|
-
tap: "^19.2.0",
|
|
98
|
-
typescript: "^4.8.4"
|
|
99
|
-
},
|
|
100
|
-
engines: {
|
|
101
|
-
node: ">=12"
|
|
102
|
-
},
|
|
103
|
-
browser: {
|
|
104
|
-
fs: false
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
var require_main = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
110
|
-
"../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js"(exports, module2) {
|
|
111
|
-
"use strict";
|
|
112
|
-
var fs2 = (0, import_chunk_4VNS5WPM.__require)("fs");
|
|
113
|
-
var path2 = (0, import_chunk_4VNS5WPM.__require)("path");
|
|
114
|
-
var os = (0, import_chunk_4VNS5WPM.__require)("os");
|
|
115
|
-
var crypto = (0, import_chunk_4VNS5WPM.__require)("crypto");
|
|
116
|
-
var packageJson = require_package();
|
|
117
|
-
var version = packageJson.version;
|
|
118
|
-
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
119
|
-
function parse(src) {
|
|
120
|
-
const obj = {};
|
|
121
|
-
let lines = src.toString();
|
|
122
|
-
lines = lines.replace(/\r\n?/mg, "\n");
|
|
123
|
-
let match;
|
|
124
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
125
|
-
const key = match[1];
|
|
126
|
-
let value = match[2] || "";
|
|
127
|
-
value = value.trim();
|
|
128
|
-
const maybeQuote = value[0];
|
|
129
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
130
|
-
if (maybeQuote === '"') {
|
|
131
|
-
value = value.replace(/\\n/g, "\n");
|
|
132
|
-
value = value.replace(/\\r/g, "\r");
|
|
133
|
-
}
|
|
134
|
-
obj[key] = value;
|
|
135
|
-
}
|
|
136
|
-
return obj;
|
|
137
|
-
}
|
|
138
|
-
function _parseVault(options) {
|
|
139
|
-
const vaultPath = _vaultPath(options);
|
|
140
|
-
const result = DotenvModule.configDotenv({ path: vaultPath });
|
|
141
|
-
if (!result.parsed) {
|
|
142
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
143
|
-
err.code = "MISSING_DATA";
|
|
144
|
-
throw err;
|
|
145
|
-
}
|
|
146
|
-
const keys = _dotenvKey(options).split(",");
|
|
147
|
-
const length = keys.length;
|
|
148
|
-
let decrypted;
|
|
149
|
-
for (let i = 0; i < length; i++) {
|
|
150
|
-
try {
|
|
151
|
-
const key = keys[i].trim();
|
|
152
|
-
const attrs = _instructions(result, key);
|
|
153
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
154
|
-
break;
|
|
155
|
-
} catch (error) {
|
|
156
|
-
if (i + 1 >= length) {
|
|
157
|
-
throw error;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return DotenvModule.parse(decrypted);
|
|
162
|
-
}
|
|
163
|
-
function _warn(message) {
|
|
164
|
-
console.log(`[dotenv@${version}][WARN] ${message}`);
|
|
165
|
-
}
|
|
166
|
-
function _debug(message) {
|
|
167
|
-
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
168
|
-
}
|
|
169
|
-
function _dotenvKey(options) {
|
|
170
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
171
|
-
return options.DOTENV_KEY;
|
|
172
|
-
}
|
|
173
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
174
|
-
return process.env.DOTENV_KEY;
|
|
175
|
-
}
|
|
176
|
-
return "";
|
|
177
|
-
}
|
|
178
|
-
function _instructions(result, dotenvKey) {
|
|
179
|
-
let uri;
|
|
180
|
-
try {
|
|
181
|
-
uri = new URL(dotenvKey);
|
|
182
|
-
} catch (error) {
|
|
183
|
-
if (error.code === "ERR_INVALID_URL") {
|
|
184
|
-
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
185
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
186
|
-
throw err;
|
|
187
|
-
}
|
|
188
|
-
throw error;
|
|
189
|
-
}
|
|
190
|
-
const key = uri.password;
|
|
191
|
-
if (!key) {
|
|
192
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
193
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
194
|
-
throw err;
|
|
195
|
-
}
|
|
196
|
-
const environment = uri.searchParams.get("environment");
|
|
197
|
-
if (!environment) {
|
|
198
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
199
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
200
|
-
throw err;
|
|
201
|
-
}
|
|
202
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
203
|
-
const ciphertext = result.parsed[environmentKey];
|
|
204
|
-
if (!ciphertext) {
|
|
205
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
206
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
207
|
-
throw err;
|
|
208
|
-
}
|
|
209
|
-
return { ciphertext, key };
|
|
210
|
-
}
|
|
211
|
-
function _vaultPath(options) {
|
|
212
|
-
let possibleVaultPath = null;
|
|
213
|
-
if (options && options.path && options.path.length > 0) {
|
|
214
|
-
if (Array.isArray(options.path)) {
|
|
215
|
-
for (const filepath of options.path) {
|
|
216
|
-
if (fs2.existsSync(filepath)) {
|
|
217
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
222
|
-
}
|
|
223
|
-
} else {
|
|
224
|
-
possibleVaultPath = path2.resolve(process.cwd(), ".env.vault");
|
|
225
|
-
}
|
|
226
|
-
if (fs2.existsSync(possibleVaultPath)) {
|
|
227
|
-
return possibleVaultPath;
|
|
228
|
-
}
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
function _resolveHome(envPath) {
|
|
232
|
-
return envPath[0] === "~" ? path2.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
233
|
-
}
|
|
234
|
-
function _configVault(options) {
|
|
235
|
-
const debug2 = Boolean(options && options.debug);
|
|
236
|
-
if (debug2) {
|
|
237
|
-
_debug("Loading env from encrypted .env.vault");
|
|
238
|
-
}
|
|
239
|
-
const parsed = DotenvModule._parseVault(options);
|
|
240
|
-
let processEnv = process.env;
|
|
241
|
-
if (options && options.processEnv != null) {
|
|
242
|
-
processEnv = options.processEnv;
|
|
243
|
-
}
|
|
244
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
245
|
-
return { parsed };
|
|
246
|
-
}
|
|
247
|
-
function configDotenv(options) {
|
|
248
|
-
const dotenvPath = path2.resolve(process.cwd(), ".env");
|
|
249
|
-
let encoding = "utf8";
|
|
250
|
-
const debug2 = Boolean(options && options.debug);
|
|
251
|
-
if (options && options.encoding) {
|
|
252
|
-
encoding = options.encoding;
|
|
253
|
-
} else {
|
|
254
|
-
if (debug2) {
|
|
255
|
-
_debug("No encoding is specified. UTF-8 is used by default");
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
let optionPaths = [dotenvPath];
|
|
259
|
-
if (options && options.path) {
|
|
260
|
-
if (!Array.isArray(options.path)) {
|
|
261
|
-
optionPaths = [_resolveHome(options.path)];
|
|
262
|
-
} else {
|
|
263
|
-
optionPaths = [];
|
|
264
|
-
for (const filepath of options.path) {
|
|
265
|
-
optionPaths.push(_resolveHome(filepath));
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
let lastError;
|
|
270
|
-
const parsedAll = {};
|
|
271
|
-
for (const path3 of optionPaths) {
|
|
272
|
-
try {
|
|
273
|
-
const parsed = DotenvModule.parse(fs2.readFileSync(path3, { encoding }));
|
|
274
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
|
275
|
-
} catch (e) {
|
|
276
|
-
if (debug2) {
|
|
277
|
-
_debug(`Failed to load ${path3} ${e.message}`);
|
|
278
|
-
}
|
|
279
|
-
lastError = e;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
let processEnv = process.env;
|
|
283
|
-
if (options && options.processEnv != null) {
|
|
284
|
-
processEnv = options.processEnv;
|
|
285
|
-
}
|
|
286
|
-
DotenvModule.populate(processEnv, parsedAll, options);
|
|
287
|
-
if (lastError) {
|
|
288
|
-
return { parsed: parsedAll, error: lastError };
|
|
289
|
-
} else {
|
|
290
|
-
return { parsed: parsedAll };
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function config(options) {
|
|
294
|
-
if (_dotenvKey(options).length === 0) {
|
|
295
|
-
return DotenvModule.configDotenv(options);
|
|
296
|
-
}
|
|
297
|
-
const vaultPath = _vaultPath(options);
|
|
298
|
-
if (!vaultPath) {
|
|
299
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
300
|
-
return DotenvModule.configDotenv(options);
|
|
301
|
-
}
|
|
302
|
-
return DotenvModule._configVault(options);
|
|
303
|
-
}
|
|
304
|
-
function decrypt(encrypted, keyStr) {
|
|
305
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
306
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
307
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
308
|
-
const authTag = ciphertext.subarray(-16);
|
|
309
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
310
|
-
try {
|
|
311
|
-
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
312
|
-
aesgcm.setAuthTag(authTag);
|
|
313
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
314
|
-
} catch (error) {
|
|
315
|
-
const isRange = error instanceof RangeError;
|
|
316
|
-
const invalidKeyLength = error.message === "Invalid key length";
|
|
317
|
-
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
318
|
-
if (isRange || invalidKeyLength) {
|
|
319
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
320
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
321
|
-
throw err;
|
|
322
|
-
} else if (decryptionFailed) {
|
|
323
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
324
|
-
err.code = "DECRYPTION_FAILED";
|
|
325
|
-
throw err;
|
|
326
|
-
} else {
|
|
327
|
-
throw error;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
function populate(processEnv, parsed, options = {}) {
|
|
332
|
-
const debug2 = Boolean(options && options.debug);
|
|
333
|
-
const override = Boolean(options && options.override);
|
|
334
|
-
if (typeof parsed !== "object") {
|
|
335
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
336
|
-
err.code = "OBJECT_REQUIRED";
|
|
337
|
-
throw err;
|
|
338
|
-
}
|
|
339
|
-
for (const key of Object.keys(parsed)) {
|
|
340
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
341
|
-
if (override === true) {
|
|
342
|
-
processEnv[key] = parsed[key];
|
|
343
|
-
}
|
|
344
|
-
if (debug2) {
|
|
345
|
-
if (override === true) {
|
|
346
|
-
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
347
|
-
} else {
|
|
348
|
-
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
} else {
|
|
352
|
-
processEnv[key] = parsed[key];
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
var DotenvModule = {
|
|
357
|
-
configDotenv,
|
|
358
|
-
_configVault,
|
|
359
|
-
_parseVault,
|
|
360
|
-
config,
|
|
361
|
-
decrypt,
|
|
362
|
-
parse,
|
|
363
|
-
populate
|
|
364
|
-
};
|
|
365
|
-
module2.exports.configDotenv = DotenvModule.configDotenv;
|
|
366
|
-
module2.exports._configVault = DotenvModule._configVault;
|
|
367
|
-
module2.exports._parseVault = DotenvModule._parseVault;
|
|
368
|
-
module2.exports.config = DotenvModule.config;
|
|
369
|
-
module2.exports.decrypt = DotenvModule.decrypt;
|
|
370
|
-
module2.exports.parse = DotenvModule.parse;
|
|
371
|
-
module2.exports.populate = DotenvModule.populate;
|
|
372
|
-
module2.exports = DotenvModule;
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
var import_dotenv = (0, import_chunk_4VNS5WPM.__toESM)(require_main());
|
|
376
|
-
var debug = (0, import_debug.default)("prisma:tryLoadEnv");
|
|
377
|
-
function tryLoadEnvs({
|
|
378
|
-
rootEnvPath,
|
|
379
|
-
schemaEnvPath
|
|
380
|
-
}, opts = {
|
|
381
|
-
conflictCheck: "none"
|
|
382
|
-
}) {
|
|
383
|
-
const rootEnvInfo = loadEnv(rootEnvPath);
|
|
384
|
-
if (opts.conflictCheck !== "none") {
|
|
385
|
-
checkForConflicts(rootEnvInfo, schemaEnvPath, opts.conflictCheck);
|
|
386
|
-
}
|
|
387
|
-
let schemaEnvInfo = null;
|
|
388
|
-
if (!pathsEqual(rootEnvInfo?.path, schemaEnvPath)) {
|
|
389
|
-
schemaEnvInfo = loadEnv(schemaEnvPath);
|
|
390
|
-
}
|
|
391
|
-
if (!rootEnvInfo && !schemaEnvInfo) {
|
|
392
|
-
debug("No Environment variables loaded");
|
|
393
|
-
}
|
|
394
|
-
if (schemaEnvInfo?.dotenvResult.error) {
|
|
395
|
-
return console.error((0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)("Schema Env Error: ")) + schemaEnvInfo.dotenvResult.error);
|
|
396
|
-
}
|
|
397
|
-
const messages = [rootEnvInfo?.message, schemaEnvInfo?.message].filter(Boolean);
|
|
398
|
-
return {
|
|
399
|
-
message: messages.join("\n"),
|
|
400
|
-
parsed: {
|
|
401
|
-
...rootEnvInfo?.dotenvResult?.parsed,
|
|
402
|
-
...schemaEnvInfo?.dotenvResult?.parsed
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
}
|
|
406
|
-
function checkForConflicts(rootEnvInfo, envPath, type) {
|
|
407
|
-
const parsedRootEnv = rootEnvInfo?.dotenvResult.parsed;
|
|
408
|
-
const areNotTheSame = !pathsEqual(rootEnvInfo?.path, envPath);
|
|
409
|
-
if (parsedRootEnv && envPath && areNotTheSame && import_fs.default.existsSync(envPath)) {
|
|
410
|
-
const envConfig = import_dotenv.default.parse(import_fs.default.readFileSync(envPath));
|
|
411
|
-
const conflicts = [];
|
|
412
|
-
for (const k in envConfig) {
|
|
413
|
-
if (parsedRootEnv[k] === envConfig[k]) {
|
|
414
|
-
conflicts.push(k);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
if (conflicts.length > 0) {
|
|
418
|
-
const relativeRootEnvPath = import_path.default.relative(process.cwd(), rootEnvInfo.path);
|
|
419
|
-
const relativeEnvPath = import_path.default.relative(process.cwd(), envPath);
|
|
420
|
-
if (type === "error") {
|
|
421
|
-
const message = `There is a conflict between env var${conflicts.length > 1 ? "s" : ""} in ${(0, import_chunk_PG5FDKSF.underline)(
|
|
422
|
-
relativeRootEnvPath
|
|
423
|
-
)} and ${(0, import_chunk_PG5FDKSF.underline)(relativeEnvPath)}
|
|
424
|
-
Conflicting env vars:
|
|
425
|
-
${conflicts.map((conflict) => ` ${(0, import_chunk_PG5FDKSF.bold)(conflict)}`).join("\n")}
|
|
426
|
-
|
|
427
|
-
We suggest to move the contents of ${(0, import_chunk_PG5FDKSF.underline)(relativeEnvPath)} to ${(0, import_chunk_PG5FDKSF.underline)(
|
|
428
|
-
relativeRootEnvPath
|
|
429
|
-
)} to consolidate your env vars.
|
|
430
|
-
`;
|
|
431
|
-
throw new Error(message);
|
|
432
|
-
} else if (type === "warn") {
|
|
433
|
-
const message = `Conflict for env var${conflicts.length > 1 ? "s" : ""} ${conflicts.map((c) => (0, import_chunk_PG5FDKSF.bold)(c)).join(", ")} in ${(0, import_chunk_PG5FDKSF.underline)(relativeRootEnvPath)} and ${(0, import_chunk_PG5FDKSF.underline)(relativeEnvPath)}
|
|
434
|
-
Env vars from ${(0, import_chunk_PG5FDKSF.underline)(relativeEnvPath)} overwrite the ones from ${(0, import_chunk_PG5FDKSF.underline)(relativeRootEnvPath)}
|
|
435
|
-
`;
|
|
436
|
-
console.warn(`${(0, import_chunk_PG5FDKSF.yellow)("warn(prisma)")} ${message}`);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
function loadEnv(envPath) {
|
|
442
|
-
if (exists(envPath)) {
|
|
443
|
-
debug(`Environment variables loaded from ${envPath}`);
|
|
444
|
-
const dotenvOutput = import_dotenv.default.config({
|
|
445
|
-
path: envPath,
|
|
446
|
-
// Useful to debug dotenv parsing, prints errors & warnings
|
|
447
|
-
// Set to any value to enable
|
|
448
|
-
// Example for empty .env file
|
|
449
|
-
// [dotenv][DEBUG] did not match key and value when parsing line 1:
|
|
450
|
-
//
|
|
451
|
-
// Value needs to be null or undefined, false is truthy
|
|
452
|
-
// https://github.com/motdotla/dotenv/blob/7301ac9be0b2c766f865bbe24280bf82586d25aa/lib/main.js#L89-L91
|
|
453
|
-
debug: process.env.DOTENV_CONFIG_DEBUG ? true : void 0
|
|
454
|
-
});
|
|
455
|
-
const dotenvExpandOutput = (0, import_chunk_T2PM5TKT.dotenvExpand)(dotenvOutput);
|
|
456
|
-
return {
|
|
457
|
-
dotenvResult: dotenvExpandOutput,
|
|
458
|
-
message: (0, import_chunk_PG5FDKSF.dim)(`Environment variables loaded from ${import_path.default.relative(process.cwd(), envPath)}`),
|
|
459
|
-
path: envPath
|
|
460
|
-
};
|
|
461
|
-
} else {
|
|
462
|
-
debug(`Environment variables not found at ${envPath}`);
|
|
463
|
-
}
|
|
464
|
-
return null;
|
|
465
|
-
}
|
|
466
|
-
function pathsEqual(path1, path2) {
|
|
467
|
-
return path1 && path2 && import_path.default.resolve(path1) === import_path.default.resolve(path2);
|
|
468
|
-
}
|
|
469
|
-
function exists(p) {
|
|
470
|
-
return Boolean(p && import_fs.default.existsSync(p));
|
|
471
|
-
}
|