@prisma/internals 6.6.0-dev.5 → 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/Generator.d.ts +1 -1
- package/dist/Generator.js +3 -3
- package/dist/WasmPanicRegistry.js +3 -3
- package/dist/chunk-2A2DVAFZ.js +1015 -0
- package/dist/{chunk-CW5MRSDF.js → chunk-2FV6HEOU.js} +30 -34
- package/dist/chunk-2H6XXXKO.js +49 -0
- package/dist/chunk-2QTAK7KO.js +101 -0
- package/dist/{chunk-XLGODPZH.js → chunk-3DQANJMY.js} +12 -12
- package/dist/chunk-3TSSYJO2.js +1015 -0
- package/dist/{chunk-WWAWV7DQ.js → chunk-4VNS5WPM.js} +3 -33
- package/dist/{chunk-KQOJB3ZW.js → chunk-5AI4FIZ3.js} +10 -10
- package/dist/{chunk-7MD6344A.js → chunk-5DBOS77Y.js} +3 -5
- package/dist/{chunk-YG7D272D.js → chunk-5FVVC4L4.js} +11 -15
- package/dist/{chunk-TZCE3PWZ.js → chunk-5VQNKCKW.js} +7 -7
- package/dist/{chunk-I7IEEULS.js → chunk-6TTRTZXU.js} +5 -5
- package/dist/{chunk-MGZOEY6N.js → chunk-72UZXEBG.js} +6 -6
- package/dist/{chunk-CIH2HX7R.js → chunk-75AJJ2SV.js} +5 -5
- package/dist/{chunk-5RV3EMX6.js → chunk-75BIJ5PX.js} +57 -57
- package/dist/{chunk-LG5IW4IV.js → chunk-ABTIXQDX.js} +11 -9
- package/dist/{chunk-BGFWFIPR.js → chunk-AZV6HVKA.js} +5 -5
- package/dist/{chunk-X5YSMVVH.js → chunk-AZWZO6OY.js} +5 -5
- package/dist/{chunk-L3462R5V.js → chunk-BTWAF3S4.js} +22 -26
- package/dist/{chunk-VRT7T6MF.js → chunk-BWGDP6B5.js} +94 -105
- package/dist/{chunk-U6LD37KW.js → chunk-C7OA725J.js} +22 -26
- package/dist/{chunk-RK6MQ2H5.js → chunk-CEST7ZUQ.js} +12 -10
- package/dist/{chunk-5MCWLJSR.js → chunk-CR3XKUEA.js} +10 -10
- package/dist/{chunk-TSJICM5S.js → chunk-CRVLHWC5.js} +5 -5
- package/dist/{chunk-SHJNE6T7.js → chunk-D4VDA2TZ.js} +7 -7
- package/dist/{chunk-MUPZUVSI.js → chunk-D4VZUY3O.js} +14 -20
- package/dist/{chunk-KTBNIQ7N.js → chunk-DKSUHQGA.js} +8 -8
- package/dist/chunk-DODIJPCS.js +34 -0
- package/dist/{chunk-UNUCCAXA.js → chunk-DTPFRZWV.js} +5 -5
- package/dist/{chunk-ZYW3HGSH.js → chunk-DYVL6P7F.js} +7 -8
- package/dist/{chunk-NJQWZ447.js → chunk-EPXBOIA5.js} +6 -6
- package/dist/{chunk-7XNZDY2V.js → chunk-ETYWYJBX.js} +60 -60
- package/dist/{chunk-PIPE5DSU.js → chunk-EWWOTVR3.js} +6 -6
- package/dist/{chunk-5SN5JBT2.js → chunk-FXMGS3L5.js} +21 -40
- package/dist/{chunk-S57RMXZW.js → chunk-GHHABGYW.js} +5 -5
- package/dist/{chunk-XGDTIBRB.js → chunk-GIOVJ5SL.js} +46 -79
- package/dist/{chunk-L6GBFCXG.js → chunk-HAGJ64PM.js} +142 -155
- package/dist/{chunk-3ERIN7PH.js → chunk-HG3YOAAE.js} +10 -10
- package/dist/{chunk-U2L42IOL.js → chunk-I4O7TXOG.js} +23 -27
- package/dist/{chunk-GXDYIY4M.js → chunk-IDINCQMN.js} +56 -57
- package/dist/{chunk-EOWYER24.js → chunk-ISAD3N6L.js} +9 -9
- package/dist/{chunk-53LS3WUO.js → chunk-JOIIWB3U.js} +116 -116
- package/dist/{chunk-CZL7DCL2.js → chunk-JYMY3OAI.js} +6 -6
- package/dist/{chunk-C2WD2XUT.js → chunk-K5W6WZ6E.js} +971 -991
- package/dist/{chunk-TATYN3T2.js → chunk-KB5DKCI4.js} +29 -29
- package/dist/{chunk-LKTTJWFT.js → chunk-KDP6C3CB.js} +5 -5
- package/dist/{chunk-DARNQRUA.js → chunk-LHESHKC2.js} +9 -9
- package/dist/{chunk-ATFQZVBS.js → chunk-LMVSIVKQ.js} +9 -14
- package/dist/{chunk-ZKAW5JSN.js → chunk-LRJ4X43J.js} +5 -5
- package/dist/{chunk-ONHKZPSV.js → chunk-LRU47BGE.js} +6 -6
- package/dist/{chunk-4E7A3GDU.js → chunk-MM4ARWWY.js} +5 -5
- package/dist/{chunk-SC7OJHGV.js → chunk-MSQTODVE.js} +30 -34
- package/dist/{chunk-V2ZF7ETH.js → chunk-NVNI2SRU.js} +66 -68
- package/dist/{chunk-JHQHVXIR.js → chunk-OSHZ4P3G.js} +6 -7
- package/dist/{chunk-IPKE37QC.js → chunk-PFYALFCY.js} +6 -5
- package/dist/{chunk-SNY3IPJ5.js → chunk-PQE76XRR.js} +5 -5
- package/dist/{chunk-77IC3DNO.js → chunk-QGJH4P4N.js} +8 -8
- package/dist/{chunk-FCYHZHVW.js → chunk-R3J2O23S.js} +4 -4
- package/dist/{chunk-PFLLVWZX.js → chunk-R6QH57HZ.js} +5 -5
- package/dist/{chunk-Y3OWT3K2.js → chunk-TQFONRJP.js} +7 -7
- package/dist/{chunk-3BND5XB4.js → chunk-UTJGRVMG.js} +11 -11
- package/dist/{chunk-CHMJ5V7I.js → chunk-UZTXEBTM.js} +7 -7
- package/dist/{chunk-SNL3TWM6.js → chunk-V52H2SR4.js} +5 -5
- package/dist/{chunk-YXD4CJDK.js → chunk-VVPSLVOR.js} +27 -27
- package/dist/{chunk-6TXVGFQA.js → chunk-WSZXPLJQ.js} +11 -11
- package/dist/{chunk-BPZFDGKN.js → chunk-WXRVYSYN.js} +4 -7
- package/dist/{chunk-TPIOJZAZ.js → chunk-XKIMYV5V.js} +11 -15
- package/dist/{chunk-2MWIMEFK.js → chunk-XLTQGAI2.js} +6 -6
- package/dist/{chunk-AOEDMVV5.js → chunk-XQSHUIJ5.js} +23 -27
- package/dist/{chunk-EM3Z5VR6.js → chunk-XQYC6RGR.js} +46 -79
- package/dist/chunk-YR5KNFKN.js +1834 -0
- package/dist/{chunk-AZNLB67U.js → chunk-ZJWZK45Z.js} +5 -5
- package/dist/chunk-ZSINRHD4.js +43 -0
- package/dist/cli/Help.js +1 -1
- package/dist/cli/checkUnsupportedDataProxy.d.ts +12 -17
- package/dist/cli/checkUnsupportedDataProxy.js +77 -74
- package/dist/cli/directoryConfig.d.ts +7 -0
- package/dist/{get-generators/utils/check-feature-flags/checkFeatureFlags.js → cli/directoryConfig.js} +6 -6
- package/dist/cli/getGeneratorSuccessMessage.js +1 -1
- package/dist/cli/getSchema.d.ts +3 -28
- package/dist/cli/getSchema.js +80 -78
- package/dist/cli/getTypescriptVersion.js +1 -1
- package/dist/cli/hashes.d.ts +1 -2
- package/dist/cli/hashes.js +77 -74
- package/dist/cli/schemaContext.d.ts +59 -0
- package/dist/cli/schemaContext.js +139 -0
- package/dist/cli/utils.js +5 -5
- package/dist/client/getClientEngineType.d.ts +1 -1
- package/dist/client/getClientEngineType.js +1 -1
- package/dist/convertCredentials.d.ts +1 -1
- package/dist/convertCredentials.js +1 -1
- package/dist/dotenvExpand.js +1 -1
- package/dist/engine-commands/errorHelpers.js +5 -5
- package/dist/engine-commands/formatSchema.js +76 -73
- package/dist/engine-commands/getConfig.d.ts +1 -5
- package/dist/engine-commands/getConfig.js +16 -17
- package/dist/engine-commands/getDmmf.d.ts +3 -6
- package/dist/engine-commands/getDmmf.js +13 -14
- package/dist/engine-commands/getEngineVersion.js +12 -12
- package/dist/engine-commands/getEnginesMetaInfo.js +15 -15
- package/dist/engine-commands/index.js +87 -84
- package/dist/engine-commands/lintSchema.d.ts +1 -1
- package/dist/engine-commands/lintSchema.js +11 -12
- package/dist/engine-commands/mergeSchemas.js +13 -14
- package/dist/engine-commands/queryEngineCommons.js +8 -8
- package/dist/engine-commands/relativizePathInPSLError.js +1 -1
- package/dist/engine-commands/validate.js +13 -14
- package/dist/errorReporting.d.ts +0 -1
- package/dist/errorReporting.js +7 -7
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +76 -73
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.js +4 -4
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.js +4 -4
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +7 -7
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +76 -73
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.js +4 -4
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.js +4 -4
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.js +1 -1
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.test.js +1 -1
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +77 -74
- package/dist/get-generators/getGenerators.d.ts +8 -4
- package/dist/get-generators/getGenerators.js +79 -76
- package/dist/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
- package/dist/get-generators/utils/binaryTypeToEngineType.js +1 -1
- package/dist/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
- package/dist/get-generators/utils/engineTypeToBinaryType.js +1 -1
- package/dist/get-generators/utils/fixBinaryTargets.d.ts +1 -1
- package/dist/get-generators/utils/fixBinaryTargets.js +1 -1
- package/dist/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -4
- package/dist/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
- package/dist/get-generators/utils/getEngineVersionForGenerator.js +1 -1
- package/dist/get-generators/utils/printGeneratorConfig.d.ts +1 -1
- package/dist/get-generators/utils/printGeneratorConfig.js +7 -7
- package/dist/getPackedPackage.js +9 -9
- package/dist/highlight/highlight.js +1 -1
- package/dist/highlight/languages/dml.js +1 -1
- package/dist/highlight/languages/sql.js +1 -1
- package/dist/highlight/prism.js +1 -1
- package/dist/highlight/theme.js +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +143 -141
- package/dist/logger.js +9 -9
- package/dist/migrateTypes.d.ts +63 -0
- package/dist/{multipart-parser-32AROPTR.js → multipart-parser-3AFJFP6K.js} +7 -7
- package/dist/panic.d.ts +1 -4
- package/dist/panic.js +7 -7
- package/dist/resolveBinary.js +10 -10
- package/dist/resolveOutput.js +1 -1
- package/dist/schemaEngineCommands.js +13 -13
- package/dist/sendPanic.js +7 -111
- package/dist/types.d.ts +1 -1
- package/dist/utils/__tests__/isCi.test.js +1 -1
- package/dist/utils/__tests__/isInteractive.test.js +1 -1
- package/dist/utils/__tests__/maskSchema.test.js +1 -1
- package/dist/utils/assertAlways.js +1 -1
- package/dist/utils/assertNever.js +1 -1
- package/dist/utils/binaryTargetRegex.js +3 -3
- package/dist/utils/byline.js +1 -1
- package/dist/utils/callOnce.js +1 -1
- package/dist/utils/callOnce.test.js +1 -1
- package/dist/utils/canPrompt.js +4 -4
- package/dist/utils/chmodPlusX.js +1 -1
- package/dist/utils/cloudflareD1.js +4 -4
- package/dist/utils/drawBox.js +1 -1
- package/dist/utils/extractPreviewFeatures.d.ts +2 -2
- package/dist/utils/extractPreviewFeatures.js +3 -3
- package/dist/utils/formatTable.js +1 -1
- package/dist/utils/formatms.js +1 -1
- package/dist/utils/fs-functional.js +12 -12
- package/dist/utils/fs-utils.js +9 -9
- package/dist/utils/getCommandWithExecutor.js +4 -4
- package/dist/utils/getEnvPaths.d.ts +1 -1
- package/dist/utils/getEnvPaths.js +76 -73
- package/dist/utils/getGitHubIssueUrl.js +5 -4
- package/dist/utils/getMigrateConfigDir.js +1 -1
- package/dist/utils/getVersionFromPackageJson.js +4 -4
- package/dist/utils/handleEngineLoadingErrors.js +1 -1
- package/dist/utils/handlePanic.js +13 -110
- package/dist/utils/hasOwnProperty.js +1 -1
- package/dist/utils/isCi.js +1 -1
- package/dist/utils/isCurrentBinInstalledGlobally.js +3 -3
- package/dist/utils/isInContainer.js +1 -1
- package/dist/utils/isInNpmLifecycleHook.js +1 -1
- package/dist/utils/isInteractive.js +1 -1
- package/dist/utils/isPromiseLike.js +1 -1
- package/dist/utils/isValidJsIdentifier.js +4 -4
- package/dist/utils/keyBy.js +1 -1
- package/dist/utils/link.js +3 -3
- package/dist/utils/load.js +3 -3
- package/dist/utils/loadEnvFile.js +76 -73
- package/dist/utils/mapKeys.js +1 -1
- package/dist/utils/mapObjectValues.js +1 -1
- package/dist/utils/maskSchema.js +1 -1
- package/dist/utils/max.js +1 -1
- package/dist/utils/max.test.js +1 -1
- package/dist/utils/maybeInGitHook.js +1 -1
- package/dist/utils/missingDatasource.js +4 -4
- package/dist/utils/missingGeneratorMessage.js +6 -6
- package/dist/utils/now.js +1 -1
- package/dist/utils/omit.js +1 -1
- package/dist/utils/parseAWSNodejsRuntimeEnvVarVersion.js +1 -1
- package/dist/utils/parseEnvValue.d.ts +1 -1
- package/dist/utils/parseEnvValue.js +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/path.test.js +1 -1
- package/dist/utils/pick.js +1 -1
- package/dist/utils/printConfigWarnings.js +1 -1
- package/dist/utils/prismaPostgres.js +1 -1
- package/dist/utils/prismaPostgres.test.js +1 -1
- package/dist/utils/schemaFileInput.d.ts +0 -4
- package/dist/utils/schemaFileInput.js +3 -7
- package/dist/utils/serializeQueryEngineName.js +1 -1
- package/dist/utils/setClassName.js +1 -1
- package/dist/utils/toSchemasContainer.d.ts +2 -3
- package/dist/utils/toSchemasContainer.js +4 -5
- package/dist/utils/tryLoadEnvs.js +6 -6
- package/dist/utils/unique.js +1 -1
- package/dist/utils/vercelPkgPathRegex.js +1 -1
- package/dist/warnOnce.js +4 -4
- package/dist/wasm.js +6 -6
- package/package.json +14 -12
- package/dist/chunk-AOQIUJT4.js +0 -41
- package/dist/chunk-EPUNJXBL.js +0 -15631
- package/dist/chunk-IPWA5XTA.js +0 -15631
- package/dist/chunk-YRBRUREX.js +0 -57
- package/dist/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
@@ -26,29 +26,28 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_2FV6HEOU_exports = {};
|
30
|
+
__export(chunk_2FV6HEOU_exports, {
|
31
31
|
GetConfigError: () => GetConfigError,
|
32
32
|
getConfig: () => getConfig,
|
33
33
|
getDirectUrl: () => getDirectUrl,
|
34
34
|
getEffectiveUrl: () => getEffectiveUrl,
|
35
35
|
resolveUrl: () => resolveUrl
|
36
36
|
});
|
37
|
-
module.exports = __toCommonJS(
|
38
|
-
var
|
39
|
-
var
|
37
|
+
module.exports = __toCommonJS(chunk_2FV6HEOU_exports);
|
38
|
+
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
39
|
+
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
40
40
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
41
|
-
var
|
42
|
-
var
|
41
|
+
var import_chunk_V52H2SR4 = require("./chunk-V52H2SR4.js");
|
42
|
+
var import_chunk_ISAD3N6L = require("./chunk-ISAD3N6L.js");
|
43
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
43
44
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
44
|
-
var
|
45
|
-
var import_chunk_ATFQZVBS = require("./chunk-ATFQZVBS.js");
|
46
|
-
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
45
|
+
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
47
46
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
48
|
-
var
|
47
|
+
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
49
48
|
var import_debug = __toESM(require("@prisma/debug"));
|
50
49
|
var import_get_platform = require("@prisma/get-platform");
|
51
|
-
var import_function = (0,
|
50
|
+
var import_function = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_R6QH57HZ.require_function)());
|
52
51
|
var debug = (0, import_debug.default)("prisma:getConfig");
|
53
52
|
var SCHEMA_VALIDATION_ERROR_CODE = "P1012";
|
54
53
|
var GetConfigError = class extends Error {
|
@@ -65,7 +64,7 @@ ${detailsHeader} ${message}`;
|
|
65
64
|
}).exhaustive();
|
66
65
|
const errorMessageWithContext = `${constructedErrorMessage}
|
67
66
|
[Context: getConfig]`;
|
68
|
-
super((0,
|
67
|
+
super((0, import_chunk_V52H2SR4.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
69
68
|
this.name = "GetConfigError";
|
70
69
|
}
|
71
70
|
};
|
@@ -83,14 +82,14 @@ function resolveUrl(envValue) {
|
|
83
82
|
return urlFromValue ?? urlEnvVarValue;
|
84
83
|
}
|
85
84
|
async function getConfig(options) {
|
86
|
-
const debugErrorType = (0,
|
85
|
+
const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "getConfigWasm");
|
87
86
|
debug(`Using getConfig Wasm`);
|
88
87
|
const configEither = (0, import_function.pipe)(
|
89
|
-
(0,
|
88
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
90
89
|
() => {
|
91
90
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
92
91
|
debug("Triggering a Rust panic...");
|
93
|
-
|
92
|
+
import_chunk_ISAD3N6L.prismaSchemaWasm.debug_panic();
|
94
93
|
}
|
95
94
|
const params = JSON.stringify({
|
96
95
|
prismaSchema: options.datamodel,
|
@@ -98,7 +97,7 @@ async function getConfig(options) {
|
|
98
97
|
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
99
98
|
env: process.env
|
100
99
|
});
|
101
|
-
const data =
|
100
|
+
const data = import_chunk_ISAD3N6L.prismaSchemaWasm.get_config(params);
|
102
101
|
return data;
|
103
102
|
},
|
104
103
|
(e) => ({
|
@@ -107,11 +106,11 @@ async function getConfig(options) {
|
|
107
106
|
error: e
|
108
107
|
})
|
109
108
|
),
|
110
|
-
(0,
|
111
|
-
(0,
|
109
|
+
(0, import_chunk_5DBOS77Y.map)((result) => ({ result })),
|
110
|
+
(0, import_chunk_5DBOS77Y.chainW)(
|
112
111
|
({ result }) => (
|
113
112
|
// NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
|
114
|
-
(0,
|
113
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
115
114
|
() => JSON.parse(result),
|
116
115
|
(e) => ({
|
117
116
|
type: "parse-json",
|
@@ -121,18 +120,18 @@ async function getConfig(options) {
|
|
121
120
|
)
|
122
121
|
)
|
123
122
|
),
|
124
|
-
(0,
|
123
|
+
(0, import_chunk_5DBOS77Y.chainW)((response) => {
|
125
124
|
if (response.errors.length > 0) {
|
126
|
-
return (0,
|
125
|
+
return (0, import_chunk_5DBOS77Y.left)({
|
127
126
|
type: "validation-error",
|
128
127
|
reason: "(get-config wasm)",
|
129
128
|
error: response.errors
|
130
129
|
});
|
131
130
|
}
|
132
|
-
return (0,
|
131
|
+
return (0, import_chunk_5DBOS77Y.right)(response.config);
|
133
132
|
})
|
134
133
|
);
|
135
|
-
if ((0,
|
134
|
+
if ((0, import_chunk_5DBOS77Y.isRight)(configEither)) {
|
136
135
|
debug("config data retrieved without errors in getConfig Wasm");
|
137
136
|
const { right: data } = configEither;
|
138
137
|
for (const generator of data.generators) {
|
@@ -142,30 +141,27 @@ async function getConfig(options) {
|
|
142
141
|
}
|
143
142
|
const error = (0, import_chunk_XKZ6CBLA.z)(configEither.left).with({ type: "wasm-error" }, (e) => {
|
144
143
|
debugErrorType(e);
|
145
|
-
if ((0,
|
146
|
-
const { message, stack } = (0,
|
147
|
-
const panic = new
|
144
|
+
if ((0, import_chunk_LMVSIVKQ.isWasmPanic)(e.error)) {
|
145
|
+
const { message, stack } = (0, import_chunk_LMVSIVKQ.getWasmError)(e.error);
|
146
|
+
const panic = new import_chunk_LMVSIVKQ.RustPanic(
|
148
147
|
/* message */
|
149
148
|
message,
|
150
149
|
/* rustStack */
|
151
150
|
stack,
|
152
151
|
/* request */
|
153
152
|
"@prisma/prisma-schema-wasm get_config",
|
154
|
-
"FMT_CLI"
|
155
|
-
/*
|
156
|
-
options.prismaPath,
|
157
|
-
/* schema */
|
158
|
-
(0, import_chunk_YRBRUREX.toMultipleSchemas)(options.datamodel)
|
153
|
+
"FMT_CLI"
|
154
|
+
/* FMT_CLI */
|
159
155
|
);
|
160
156
|
return panic;
|
161
157
|
}
|
162
158
|
const errorOutput = e.error.message;
|
163
|
-
return new GetConfigError((0,
|
159
|
+
return new GetConfigError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
164
160
|
}).with({ type: "validation-error" }, (e) => {
|
165
161
|
return new GetConfigError({
|
166
162
|
_tag: "parsed",
|
167
163
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
168
|
-
reason: (0,
|
164
|
+
reason: (0, import_chunk_WSZXPLJQ.createSchemaValidationError)(e.reason),
|
169
165
|
message: formatErrors(e.error)
|
170
166
|
});
|
171
167
|
}).otherwise((e) => {
|
@@ -0,0 +1,49 @@
|
|
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_2H6XXXKO_exports = {};
|
30
|
+
__export(chunk_2H6XXXKO_exports, {
|
31
|
+
inferDirectoryConfig: () => inferDirectoryConfig
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(chunk_2H6XXXKO_exports);
|
34
|
+
var import_path = __toESM(require("path"));
|
35
|
+
function inferDirectoryConfig(schemaContext, cwd = process.cwd()) {
|
36
|
+
const baseDir = (
|
37
|
+
// All default paths are relative to the `schema.prisma` file that contains the primary datasource.
|
38
|
+
// That schema file should usually be the users "root" aka main schema file.
|
39
|
+
schemaContext?.primaryDatasourceDirectory ?? // If no primary datasource exists we use the schemaRootDir.
|
40
|
+
// `schemaRootDir` is either the directory the user supplied as schemaPath or the directory the single schema file is in.
|
41
|
+
schemaContext?.schemaRootDir ?? // Should also that not be defined because there is no schema yet we fallback to CWD + `/prisma`.
|
42
|
+
import_path.default.join(cwd, "prisma")
|
43
|
+
);
|
44
|
+
return {
|
45
|
+
viewsDirPath: import_path.default.join(baseDir, "views"),
|
46
|
+
typedSqlDirPath: import_path.default.join(baseDir, "sql"),
|
47
|
+
migrationsDirPath: import_path.default.join(baseDir, "migrations")
|
48
|
+
};
|
49
|
+
}
|
@@ -0,0 +1,101 @@
|
|
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_2QTAK7KO_exports = {};
|
30
|
+
__export(chunk_2QTAK7KO_exports, {
|
31
|
+
handlePanic: () => handlePanic
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(chunk_2QTAK7KO_exports);
|
34
|
+
var import_chunk_HAGJ64PM = require("./chunk-HAGJ64PM.js");
|
35
|
+
var import_chunk_FXMGS3L5 = require("./chunk-FXMGS3L5.js");
|
36
|
+
var import_chunk_R3J2O23S = require("./chunk-R3J2O23S.js");
|
37
|
+
var import_chunk_YR5KNFKN = require("./chunk-YR5KNFKN.js");
|
38
|
+
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
39
|
+
var import_prompts = __toESM(require("prompts"));
|
40
|
+
async function handlePanic(args) {
|
41
|
+
if (!(0, import_chunk_R3J2O23S.canPrompt)()) {
|
42
|
+
throw args.error;
|
43
|
+
}
|
44
|
+
await panicDialog(args);
|
45
|
+
}
|
46
|
+
async function panicDialog({
|
47
|
+
error,
|
48
|
+
cliVersion,
|
49
|
+
enginesVersion,
|
50
|
+
command,
|
51
|
+
getDatabaseVersionSafe
|
52
|
+
}) {
|
53
|
+
const errorMessage = error.message.split("\n").slice(0, Math.max(20, process.stdout.rows)).join("\n");
|
54
|
+
console.log(`${(0, import_chunk_PG5FDKSF.red)("Oops, an unexpected error occurred!")}
|
55
|
+
${(0, import_chunk_PG5FDKSF.red)(errorMessage)}
|
56
|
+
|
57
|
+
${(0, import_chunk_PG5FDKSF.bold)("Please help us improve Prisma by submitting an error report.")}
|
58
|
+
${(0, import_chunk_PG5FDKSF.bold)("Error reports never contain personal or other sensitive information.")}
|
59
|
+
${(0, import_chunk_PG5FDKSF.dim)(`Learn more: ${(0, import_chunk_HAGJ64PM.link)("https://pris.ly/d/telemetry")}`)}
|
60
|
+
`);
|
61
|
+
const { value: shouldSubmitReport } = await (0, import_prompts.default)({
|
62
|
+
type: "select",
|
63
|
+
name: "value",
|
64
|
+
message: "Submit error report",
|
65
|
+
initial: 0,
|
66
|
+
choices: [
|
67
|
+
{
|
68
|
+
title: "Yes",
|
69
|
+
value: true,
|
70
|
+
description: `Send error report once`
|
71
|
+
},
|
72
|
+
{
|
73
|
+
title: "No",
|
74
|
+
value: false,
|
75
|
+
description: `Don't send error report`
|
76
|
+
}
|
77
|
+
]
|
78
|
+
});
|
79
|
+
if (shouldSubmitReport) {
|
80
|
+
try {
|
81
|
+
console.log("Submitting...");
|
82
|
+
const reportId = await (0, import_chunk_YR5KNFKN.sendPanic)({ error, cliVersion, enginesVersion, getDatabaseVersionSafe });
|
83
|
+
console.log(`
|
84
|
+
${(0, import_chunk_PG5FDKSF.bold)(`We successfully received the error report id: ${reportId}`)}`);
|
85
|
+
console.log(`
|
86
|
+
${(0, import_chunk_PG5FDKSF.bold)("Thanks a lot for your help! \u{1F64F}")}`);
|
87
|
+
} catch (error2) {
|
88
|
+
const reportFailedMessage = `${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.red)("Oops. We could not send the error report."))}`;
|
89
|
+
console.log(reportFailedMessage);
|
90
|
+
console.error(`${(0, import_chunk_PG5FDKSF.gray)("Error report submission failed due to: ")}`, error2);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
await (0, import_chunk_FXMGS3L5.wouldYouLikeToCreateANewIssue)({
|
94
|
+
prompt: !shouldSubmitReport,
|
95
|
+
error,
|
96
|
+
cliVersion,
|
97
|
+
enginesVersion,
|
98
|
+
command
|
99
|
+
});
|
100
|
+
process.exit(1);
|
101
|
+
}
|
@@ -16,30 +16,30 @@ 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_3DQANJMY_exports = {};
|
20
|
+
__export(chunk_3DQANJMY_exports, {
|
21
21
|
getEngineVersion: () => getEngineVersion,
|
22
22
|
safeGetEngineVersion: () => safeGetEngineVersion
|
23
23
|
});
|
24
|
-
module.exports = __toCommonJS(
|
25
|
-
var
|
26
|
-
var
|
27
|
-
var
|
28
|
-
var
|
29
|
-
var
|
24
|
+
module.exports = __toCommonJS(chunk_3DQANJMY_exports);
|
25
|
+
var import_chunk_6TTRTZXU = require("./chunk-6TTRTZXU.js");
|
26
|
+
var import_chunk_ETYWYJBX = require("./chunk-ETYWYJBX.js");
|
27
|
+
var import_chunk_HG3YOAAE = require("./chunk-HG3YOAAE.js");
|
28
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
29
|
+
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
30
30
|
var import_engines = require("@prisma/engines");
|
31
31
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
32
32
|
var import_get_platform = require("@prisma/get-platform");
|
33
|
-
var import_execa = (0,
|
33
|
+
var import_execa = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_ETYWYJBX.require_execa)());
|
34
34
|
async function getEngineVersion(enginePath, binaryName) {
|
35
35
|
if (!binaryName) {
|
36
36
|
binaryName = (0, import_engines.getCliQueryEngineBinaryType)();
|
37
37
|
}
|
38
|
-
enginePath = await (0,
|
38
|
+
enginePath = await (0, import_chunk_HG3YOAAE.resolveBinary)(binaryName, enginePath);
|
39
39
|
const platformInfo = await (0, import_get_platform.getPlatformInfo)();
|
40
40
|
if (binaryName === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
41
41
|
(0, import_get_platform.assertNodeAPISupported)();
|
42
|
-
const QE = (0,
|
42
|
+
const QE = (0, import_chunk_6TTRTZXU.loadLibrary)(enginePath, platformInfo);
|
43
43
|
return `${import_fetch_engine.BinaryType.QueryEngineLibrary} ${QE.version().commit}`;
|
44
44
|
} else {
|
45
45
|
const { stdout } = await (0, import_execa.default)(enginePath, ["--version"]);
|
@@ -47,7 +47,7 @@ async function getEngineVersion(enginePath, binaryName) {
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
function safeGetEngineVersion(enginePath, binaryName) {
|
50
|
-
return (0,
|
50
|
+
return (0, import_chunk_5DBOS77Y.tryCatch2)(
|
51
51
|
() => getEngineVersion(enginePath, binaryName),
|
52
52
|
(error) => error
|
53
53
|
);
|