@prisma/internals 6.4.0-dev.44 → 6.4.0-dev.46
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-CNKG5Y32.js → chunk-CPUS6VXL.js} +21 -38
- package/dist/{chunk-6OA7WJCQ.js → chunk-CTMFIZW2.js} +5 -5
- package/dist/{chunk-ZRCVKMT6.js → chunk-E4ME6VIK.js} +8 -8
- package/dist/{chunk-WVOKQKUE.js → chunk-EF6MMNTU.js} +5 -5
- package/dist/{chunk-WSXIOEQM.js → chunk-K56K36J5.js} +5 -22
- package/dist/{chunk-64E2ACBK.js → chunk-LMT7YHRJ.js} +8 -8
- package/dist/{chunk-4JX23JRF.js → chunk-NCT4NDMX.js} +7 -7
- package/dist/{chunk-5VYA5A43.js → chunk-QB3BFLLS.js} +5 -5
- package/dist/{chunk-RCQUO2FX.js → chunk-RGZUQC4J.js} +8 -8
- package/dist/{chunk-GNARNLJA.js → chunk-XJG2LJU6.js} +5 -5
- package/dist/{chunk-37P25TBL.js → chunk-YHX36Y63.js} +4 -4
- package/dist/cli/checkUnsupportedDataProxy.js +12 -12
- package/dist/cli/getSchema.d.ts +1 -39
- package/dist/cli/getSchema.js +17 -17
- package/dist/cli/hashes.js +12 -12
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +11 -11
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/index.js +20 -20
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +7 -7
- package/dist/engine-commands/validate.js +7 -7
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +11 -11
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +11 -11
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +12 -12
- package/dist/get-generators/getGenerators.js +14 -14
- package/dist/index.d.ts +2 -1
- package/dist/index.js +39 -39
- package/dist/sendPanic.js +11 -11
- package/dist/utils/getEnvPaths.js +11 -11
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +11 -11
- package/dist/utils/loadEnvFile.js +11 -11
- package/dist/utils/toSchemasContainer.d.ts +1 -1
- package/dist/wasm.js +4 -4
- package/package.json +8 -8
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export2(
|
29
|
+
var chunk_CPUS6VXL_exports = {};
|
30
|
+
__export2(chunk_CPUS6VXL_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug6,
|
@@ -55,7 +55,7 @@ __export2(chunk_CNKG5Y32_exports, {
|
|
55
55
|
sendPanic: () => sendPanic,
|
56
56
|
skipIndex: () => skipIndex
|
57
57
|
});
|
58
|
-
module.exports = __toCommonJS2(
|
58
|
+
module.exports = __toCommonJS2(chunk_CPUS6VXL_exports);
|
59
59
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
60
60
|
var import_chunk_IPKE37QC = require("./chunk-IPKE37QC.js");
|
61
61
|
var import_chunk_PIPE5DSU = require("./chunk-PIPE5DSU.js");
|
@@ -80,14 +80,14 @@ var import_chunk_AC6EAR56 = require("./chunk-AC6EAR56.js");
|
|
80
80
|
var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
|
81
81
|
var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
|
82
82
|
var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
|
83
|
-
var
|
84
|
-
var
|
83
|
+
var import_chunk_QB3BFLLS = require("./chunk-QB3BFLLS.js");
|
84
|
+
var import_chunk_NCT4NDMX = require("./chunk-NCT4NDMX.js");
|
85
85
|
var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
|
86
|
-
var
|
87
|
-
var
|
86
|
+
var import_chunk_E4ME6VIK = require("./chunk-E4ME6VIK.js");
|
87
|
+
var import_chunk_RGZUQC4J = require("./chunk-RGZUQC4J.js");
|
88
88
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
89
89
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
90
|
-
var
|
90
|
+
var import_chunk_CTMFIZW2 = require("./chunk-CTMFIZW2.js");
|
91
91
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
92
92
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
93
93
|
var import_chunk_QIVUAERL = require("./chunk-QIVUAERL.js");
|
@@ -14734,7 +14734,7 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, { cwd = process.cwd
|
|
14734
14734
|
}
|
14735
14735
|
async function readSchemaFromSingleFile(schemaPath2) {
|
14736
14736
|
debug2("Reading schema from single file", schemaPath2);
|
14737
|
-
const typeError = await ensureType(schemaPath2, "file");
|
14737
|
+
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
14738
14738
|
if (typeError) {
|
14739
14739
|
return { ok: false, error: typeError };
|
14740
14740
|
}
|
@@ -14747,13 +14747,13 @@ async function readSchemaFromSingleFile(schemaPath2) {
|
|
14747
14747
|
}
|
14748
14748
|
async function readSchemaFromDirectory(schemaPath2) {
|
14749
14749
|
debug2("Reading schema from multiple files", schemaPath2);
|
14750
|
-
const typeError = await ensureType(schemaPath2, "directory");
|
14750
|
+
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "directory");
|
14751
14751
|
if (typeError) {
|
14752
14752
|
return { ok: false, error: typeError };
|
14753
14753
|
}
|
14754
14754
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
14755
14755
|
debug2("Loading config");
|
14756
|
-
const config2 = await (0,
|
14756
|
+
const config2 = await (0, import_chunk_E4ME6VIK.getConfig)({
|
14757
14757
|
datamodel: files,
|
14758
14758
|
ignoreEnvVarErrors: true
|
14759
14759
|
});
|
@@ -14763,23 +14763,6 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
14763
14763
|
}
|
14764
14764
|
return { ok: true, schema: { schemaPath: schemaPath2, schemaRootDir: schemaPath2, schemas: files } };
|
14765
14765
|
}
|
14766
|
-
async function ensureType(entryPath, expectedType) {
|
14767
|
-
try {
|
14768
|
-
const pathStat = await stat(entryPath);
|
14769
|
-
if (expectedType === "file" && pathStat.isFile()) {
|
14770
|
-
return void 0;
|
14771
|
-
}
|
14772
|
-
if (expectedType === "directory" && pathStat.isDirectory()) {
|
14773
|
-
return void 0;
|
14774
|
-
}
|
14775
|
-
return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
|
14776
|
-
} catch (e) {
|
14777
|
-
if (e.code === "ENOENT") {
|
14778
|
-
return { kind: "NotFound", path: entryPath, expectedType };
|
14779
|
-
}
|
14780
|
-
throw e;
|
14781
|
-
}
|
14782
|
-
}
|
14783
14766
|
async function readSchemaFromFileOrDirectory(schemaPath2) {
|
14784
14767
|
let stats;
|
14785
14768
|
try {
|
@@ -15067,8 +15050,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
|
|
15067
15050
|
if (argName.includes("schema")) {
|
15068
15051
|
await loadEnvFile({ schemaPath: argValue, printMessage: false, config: (0, import_config.defaultTestConfig)() });
|
15069
15052
|
const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
|
15070
|
-
const config2 = await (0,
|
15071
|
-
const url = (0,
|
15053
|
+
const config2 = await (0, import_chunk_E4ME6VIK.getConfig)({ datamodel, ignoreEnvVarErrors: true });
|
15054
|
+
const url = (0, import_chunk_E4ME6VIK.resolveUrl)((0, import_chunk_E4ME6VIK.getEffectiveUrl)(config2.datasources[0]));
|
15072
15055
|
if (url?.startsWith("prisma://")) {
|
15073
15056
|
return forbiddenCmdWithDataProxyFlagMessage(command);
|
15074
15057
|
}
|
@@ -15240,7 +15223,7 @@ async function getGenerators(options) {
|
|
15240
15223
|
prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
|
15241
15224
|
}
|
15242
15225
|
}
|
15243
|
-
const config = await (0,
|
15226
|
+
const config = await (0, import_chunk_E4ME6VIK.getConfig)({
|
15244
15227
|
datamodel: schemas,
|
15245
15228
|
datamodelPath: schemaPath,
|
15246
15229
|
prismaPath,
|
@@ -15251,7 +15234,7 @@ async function getGenerators(options) {
|
|
15251
15234
|
}
|
15252
15235
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
|
15253
15236
|
const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
|
15254
|
-
const dmmf = await (0,
|
15237
|
+
const dmmf = await (0, import_chunk_RGZUQC4J.getDMMF)({
|
15255
15238
|
datamodel: schemas,
|
15256
15239
|
datamodelPath: schemaPath,
|
15257
15240
|
prismaPath,
|
@@ -15312,7 +15295,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
15312
15295
|
fromEnvVar: "null"
|
15313
15296
|
};
|
15314
15297
|
}
|
15315
|
-
const datamodel = (0,
|
15298
|
+
const datamodel = (0, import_chunk_NCT4NDMX.mergeSchemas)({ schemas });
|
15316
15299
|
const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
|
15317
15300
|
const options2 = {
|
15318
15301
|
datamodel,
|
@@ -15395,7 +15378,7 @@ generator gen {
|
|
15395
15378
|
debug7({ generatorBinaryPaths });
|
15396
15379
|
generator.setBinaryPaths(generatorBinaryPaths);
|
15397
15380
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
15398
|
-
const customDmmf = await (0,
|
15381
|
+
const customDmmf = await (0, import_chunk_RGZUQC4J.getDMMF)({
|
15399
15382
|
datamodel: schemas,
|
15400
15383
|
datamodelPath: schemaPath,
|
15401
15384
|
prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
|
@@ -15693,7 +15676,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
15693
15676
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
15694
15677
|
handleFormatPanic(
|
15695
15678
|
() => {
|
15696
|
-
|
15679
|
+
import_chunk_CTMFIZW2.prismaSchemaWasm.debug_panic();
|
15697
15680
|
},
|
15698
15681
|
{ schemas: schemas2 }
|
15699
15682
|
);
|
@@ -15713,12 +15696,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
15713
15696
|
() => {
|
15714
15697
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
|
15715
15698
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
15716
|
-
const lintDiagnostics2 = (0,
|
15699
|
+
const lintDiagnostics2 = (0, import_chunk_QB3BFLLS.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
15717
15700
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
15718
15701
|
},
|
15719
15702
|
{ schemas: schemas2 }
|
15720
15703
|
);
|
15721
|
-
const lintWarnings = (0,
|
15704
|
+
const lintWarnings = (0, import_chunk_QB3BFLLS.getLintWarningsAsText)(lintDiagnostics);
|
15722
15705
|
if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
|
15723
15706
|
console.warn(lintWarnings);
|
15724
15707
|
}
|
@@ -15748,7 +15731,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
|
|
15748
15731
|
}
|
15749
15732
|
}
|
15750
15733
|
function formatWasm(schema, documentFormattingParams) {
|
15751
|
-
const formattedSchema =
|
15734
|
+
const formattedSchema = import_chunk_CTMFIZW2.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
15752
15735
|
return formattedSchema;
|
15753
15736
|
}
|
15754
15737
|
/*! Bundled license information:
|
@@ -26,14 +26,14 @@ 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_CTMFIZW2_exports = {};
|
30
|
+
__export(chunk_CTMFIZW2_exports, {
|
31
31
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
32
32
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
|
33
33
|
wasm_exports: () => wasm_exports
|
34
34
|
});
|
35
|
-
module.exports = __toCommonJS(
|
36
|
-
var
|
35
|
+
module.exports = __toCommonJS(chunk_CTMFIZW2_exports);
|
36
|
+
var import_chunk_YHX36Y63 = require("./chunk-YHX36Y63.js");
|
37
37
|
var import_chunk_HOZFIXMD = require("./chunk-HOZFIXMD.js");
|
38
38
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
39
39
|
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
@@ -42,6 +42,6 @@ var wasm_exports = {};
|
|
42
42
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
43
43
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion
|
44
44
|
});
|
45
|
-
var { dependencies } = (0,
|
45
|
+
var { dependencies } = (0, import_chunk_YHX36Y63.require_package)();
|
46
46
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
47
47
|
globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_HOZFIXMD.WasmPanicRegistry();
|
@@ -26,22 +26,22 @@ 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_E4ME6VIK_exports = {};
|
30
|
+
__export(chunk_E4ME6VIK_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(
|
37
|
+
module.exports = __toCommonJS(chunk_E4ME6VIK_exports);
|
38
38
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
39
39
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
40
40
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
41
|
-
var
|
41
|
+
var import_chunk_EF6MMNTU = require("./chunk-EF6MMNTU.js");
|
42
42
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
43
43
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
44
|
-
var
|
44
|
+
var import_chunk_CTMFIZW2 = require("./chunk-CTMFIZW2.js");
|
45
45
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
46
46
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
47
47
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -65,7 +65,7 @@ ${detailsHeader} ${message}`;
|
|
65
65
|
}).exhaustive();
|
66
66
|
const errorMessageWithContext = `${constructedErrorMessage}
|
67
67
|
[Context: getConfig]`;
|
68
|
-
super((0,
|
68
|
+
super((0, import_chunk_EF6MMNTU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
69
69
|
this.name = "GetConfigError";
|
70
70
|
}
|
71
71
|
};
|
@@ -90,7 +90,7 @@ async function getConfig(options) {
|
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
92
92
|
debug("Triggering a Rust panic...");
|
93
|
-
|
93
|
+
import_chunk_CTMFIZW2.prismaSchemaWasm.debug_panic();
|
94
94
|
}
|
95
95
|
const params = JSON.stringify({
|
96
96
|
prismaSchema: options.datamodel,
|
@@ -98,7 +98,7 @@ async function getConfig(options) {
|
|
98
98
|
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
99
99
|
env: process.env
|
100
100
|
});
|
101
|
-
const data =
|
101
|
+
const data = import_chunk_CTMFIZW2.prismaSchemaWasm.get_config(params);
|
102
102
|
return data;
|
103
103
|
},
|
104
104
|
(e) => ({
|
@@ -16,15 +16,15 @@ 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_EF6MMNTU_exports = {};
|
20
|
+
__export(chunk_EF6MMNTU_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_EF6MMNTU_exports);
|
24
|
+
var import_chunk_XJG2LJU6 = require("./chunk-XJG2LJU6.js");
|
25
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
27
|
-
const rows = [["Prisma CLI Version",
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_XJG2LJU6.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export2(
|
29
|
+
var chunk_K56K36J5_exports = {};
|
30
|
+
__export2(chunk_K56K36J5_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug6,
|
@@ -55,7 +55,7 @@ __export2(chunk_WSXIOEQM_exports, {
|
|
55
55
|
sendPanic: () => sendPanic,
|
56
56
|
skipIndex: () => skipIndex
|
57
57
|
});
|
58
|
-
module.exports = __toCommonJS2(
|
58
|
+
module.exports = __toCommonJS2(chunk_K56K36J5_exports);
|
59
59
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
60
60
|
var import_chunk_IPKE37QC = require("./chunk-IPKE37QC.js");
|
61
61
|
var import_chunk_PIPE5DSU = require("./chunk-PIPE5DSU.js");
|
@@ -14734,7 +14734,7 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, { cwd = process.cwd
|
|
14734
14734
|
}
|
14735
14735
|
async function readSchemaFromSingleFile(schemaPath2) {
|
14736
14736
|
debug2("Reading schema from single file", schemaPath2);
|
14737
|
-
const typeError = await ensureType(schemaPath2, "file");
|
14737
|
+
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
14738
14738
|
if (typeError) {
|
14739
14739
|
return { ok: false, error: typeError };
|
14740
14740
|
}
|
@@ -14747,7 +14747,7 @@ async function readSchemaFromSingleFile(schemaPath2) {
|
|
14747
14747
|
}
|
14748
14748
|
async function readSchemaFromDirectory(schemaPath2) {
|
14749
14749
|
debug2("Reading schema from multiple files", schemaPath2);
|
14750
|
-
const typeError = await ensureType(schemaPath2, "directory");
|
14750
|
+
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "directory");
|
14751
14751
|
if (typeError) {
|
14752
14752
|
return { ok: false, error: typeError };
|
14753
14753
|
}
|
@@ -14763,23 +14763,6 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
14763
14763
|
}
|
14764
14764
|
return { ok: true, schema: { schemaPath: schemaPath2, schemaRootDir: schemaPath2, schemas: files } };
|
14765
14765
|
}
|
14766
|
-
async function ensureType(entryPath, expectedType) {
|
14767
|
-
try {
|
14768
|
-
const pathStat = await stat(entryPath);
|
14769
|
-
if (expectedType === "file" && pathStat.isFile()) {
|
14770
|
-
return void 0;
|
14771
|
-
}
|
14772
|
-
if (expectedType === "directory" && pathStat.isDirectory()) {
|
14773
|
-
return void 0;
|
14774
|
-
}
|
14775
|
-
return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
|
14776
|
-
} catch (e) {
|
14777
|
-
if (e.code === "ENOENT") {
|
14778
|
-
return { kind: "NotFound", path: entryPath, expectedType };
|
14779
|
-
}
|
14780
|
-
throw e;
|
14781
|
-
}
|
14782
|
-
}
|
14783
14766
|
async function readSchemaFromFileOrDirectory(schemaPath2) {
|
14784
14767
|
let stats;
|
14785
14768
|
try {
|
@@ -26,19 +26,19 @@ 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_LMT7YHRJ_exports = {};
|
30
|
+
__export(chunk_LMT7YHRJ_exports, {
|
31
31
|
ValidateError: () => ValidateError,
|
32
32
|
validate: () => validate
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_LMT7YHRJ_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
36
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
38
|
+
var import_chunk_EF6MMNTU = require("./chunk-EF6MMNTU.js");
|
39
39
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
|
-
var
|
41
|
+
var import_chunk_CTMFIZW2 = require("./chunk-CTMFIZW2.js");
|
42
42
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
43
43
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
44
44
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: validate]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_EF6MMNTU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "ValidateError";
|
65
65
|
}
|
66
66
|
};
|
@@ -72,13 +72,13 @@ function validate(options) {
|
|
72
72
|
() => {
|
73
73
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
74
74
|
debug("Triggering a Rust panic...");
|
75
|
-
|
75
|
+
import_chunk_CTMFIZW2.prismaSchemaWasm.debug_panic();
|
76
76
|
}
|
77
77
|
const params = JSON.stringify({
|
78
78
|
prismaSchema: options.schemas,
|
79
79
|
noColor: Boolean(process.env.NO_COLOR)
|
80
80
|
});
|
81
|
-
|
81
|
+
import_chunk_CTMFIZW2.prismaSchemaWasm.validate(params);
|
82
82
|
},
|
83
83
|
(e) => ({
|
84
84
|
type: "wasm-error",
|
@@ -26,19 +26,19 @@ 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_NCT4NDMX_exports = {};
|
30
|
+
__export(chunk_NCT4NDMX_exports, {
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
32
32
|
mergeSchemas: () => mergeSchemas
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_NCT4NDMX_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
36
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
38
|
+
var import_chunk_EF6MMNTU = require("./chunk-EF6MMNTU.js");
|
39
39
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
|
-
var
|
41
|
+
var import_chunk_CTMFIZW2 = require("./chunk-CTMFIZW2.js");
|
42
42
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
43
43
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
44
44
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: mergeSchemas]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_EF6MMNTU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "MergeSchemasError";
|
65
65
|
}
|
66
66
|
};
|
@@ -73,7 +73,7 @@ function mergeSchemas(options) {
|
|
73
73
|
const params = JSON.stringify({
|
74
74
|
schema: options.schemas
|
75
75
|
});
|
76
|
-
return
|
76
|
+
return import_chunk_CTMFIZW2.prismaSchemaWasm.merge_schemas(params);
|
77
77
|
},
|
78
78
|
(e) => ({
|
79
79
|
type: "wasm-error",
|
@@ -16,21 +16,21 @@ 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_QB3BFLLS_exports = {};
|
20
|
+
__export(chunk_QB3BFLLS_exports, {
|
21
21
|
getLintWarnings: () => getLintWarnings,
|
22
22
|
getLintWarningsAsText: () => getLintWarningsAsText,
|
23
23
|
handleLintPanic: () => handleLintPanic,
|
24
24
|
lintSchema: () => lintSchema,
|
25
25
|
warningToString: () => warningToString
|
26
26
|
});
|
27
|
-
module.exports = __toCommonJS(
|
27
|
+
module.exports = __toCommonJS(chunk_QB3BFLLS_exports);
|
28
28
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
29
|
-
var
|
29
|
+
var import_chunk_CTMFIZW2 = require("./chunk-CTMFIZW2.js");
|
30
30
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
31
31
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
32
32
|
function lintSchema({ schemas }) {
|
33
|
-
const lintResult =
|
33
|
+
const lintResult = import_chunk_CTMFIZW2.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
34
34
|
const lintDiagnostics = JSON.parse(lintResult);
|
35
35
|
return lintDiagnostics;
|
36
36
|
}
|
@@ -26,18 +26,18 @@ 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_RGZUQC4J_exports = {};
|
30
|
+
__export(chunk_RGZUQC4J_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_RGZUQC4J_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
36
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
37
|
-
var
|
37
|
+
var import_chunk_EF6MMNTU = require("./chunk-EF6MMNTU.js");
|
38
38
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
39
39
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
40
|
-
var
|
40
|
+
var import_chunk_CTMFIZW2 = require("./chunk-CTMFIZW2.js");
|
41
41
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
42
42
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
43
43
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: getDmmf]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_EF6MMNTU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "GetDmmfError";
|
65
65
|
}
|
66
66
|
};
|
@@ -90,13 +90,13 @@ async function getDMMF(options) {
|
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
92
92
|
debug("Triggering a Rust panic...");
|
93
|
-
|
93
|
+
import_chunk_CTMFIZW2.prismaSchemaWasm.debug_panic();
|
94
94
|
}
|
95
95
|
const params = JSON.stringify({
|
96
96
|
prismaSchema: datamodel,
|
97
97
|
noColor: Boolean(process.env.NO_COLOR)
|
98
98
|
});
|
99
|
-
const data =
|
99
|
+
const data = import_chunk_CTMFIZW2.prismaSchemaWasm.get_dmmf(params);
|
100
100
|
return data;
|
101
101
|
},
|
102
102
|
(e) => ({
|
@@ -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_XJG2LJU6_exports = {};
|
20
|
+
__export(chunk_XJG2LJU6_exports, {
|
21
21
|
version: () => version
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
25
|
-
var packageJson = (0,
|
23
|
+
module.exports = __toCommonJS(chunk_XJG2LJU6_exports);
|
24
|
+
var import_chunk_YHX36Y63 = require("./chunk-YHX36Y63.js");
|
25
|
+
var packageJson = (0, import_chunk_YHX36Y63.require_package)();
|
26
26
|
var version = packageJson.version;
|
@@ -16,17 +16,17 @@ 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_YHX36Y63_exports = {};
|
20
|
+
__export(chunk_YHX36Y63_exports, {
|
21
21
|
require_package: () => require_package
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
23
|
+
module.exports = __toCommonJS(chunk_YHX36Y63_exports);
|
24
24
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
25
25
|
var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
26
26
|
"package.json"(exports, module2) {
|
27
27
|
module2.exports = {
|
28
28
|
name: "@prisma/internals",
|
29
|
-
version: "6.4.0-dev.
|
29
|
+
version: "6.4.0-dev.46",
|
30
30
|
description: "This package is intended for Prisma's internal use",
|
31
31
|
main: "dist/index.js",
|
32
32
|
types: "dist/index.d.ts",
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
19
|
var checkUnsupportedDataProxy_exports = {};
|
20
20
|
__export(checkUnsupportedDataProxy_exports, {
|
21
|
-
checkUnsupportedDataProxy: () =>
|
22
|
-
forbiddenCmdWithDataProxyFlagMessage: () =>
|
21
|
+
checkUnsupportedDataProxy: () => import_chunk_CPUS6VXL.checkUnsupportedDataProxy,
|
22
|
+
forbiddenCmdWithDataProxyFlagMessage: () => import_chunk_CPUS6VXL.forbiddenCmdWithDataProxyFlagMessage
|
23
23
|
});
|
24
24
|
module.exports = __toCommonJS(checkUnsupportedDataProxy_exports);
|
25
|
-
var
|
25
|
+
var import_chunk_CPUS6VXL = require("../chunk-CPUS6VXL.js");
|
26
26
|
var import_chunk_EUTJYQDW = require("../chunk-EUTJYQDW.js");
|
27
27
|
var import_chunk_IPKE37QC = require("../chunk-IPKE37QC.js");
|
28
28
|
var import_chunk_PIPE5DSU = require("../chunk-PIPE5DSU.js");
|
@@ -74,22 +74,22 @@ var import_chunk_Y4TOGY6I = require("../chunk-Y4TOGY6I.js");
|
|
74
74
|
var import_chunk_IL7PSY44 = require("../chunk-IL7PSY44.js");
|
75
75
|
var import_chunk_AOQIUJT4 = require("../chunk-AOQIUJT4.js");
|
76
76
|
var import_chunk_L6KOIJJ5 = require("../chunk-L6KOIJJ5.js");
|
77
|
-
var
|
78
|
-
var
|
79
|
-
var
|
77
|
+
var import_chunk_QB3BFLLS = require("../chunk-QB3BFLLS.js");
|
78
|
+
var import_chunk_NCT4NDMX = require("../chunk-NCT4NDMX.js");
|
79
|
+
var import_chunk_LMT7YHRJ = require("../chunk-LMT7YHRJ.js");
|
80
80
|
var import_chunk_TQCLUNM2 = require("../chunk-TQCLUNM2.js");
|
81
81
|
var import_chunk_OIVPX3BR = require("../chunk-OIVPX3BR.js");
|
82
82
|
var import_chunk_CYAS6B5N = require("../chunk-CYAS6B5N.js");
|
83
83
|
var import_chunk_HPVMQFIY = require("../chunk-HPVMQFIY.js");
|
84
84
|
var import_chunk_E23HYCQJ = require("../chunk-E23HYCQJ.js");
|
85
85
|
var import_chunk_MUPZUVSI = require("../chunk-MUPZUVSI.js");
|
86
|
-
var
|
87
|
-
var
|
86
|
+
var import_chunk_E4ME6VIK = require("../chunk-E4ME6VIK.js");
|
87
|
+
var import_chunk_RGZUQC4J = require("../chunk-RGZUQC4J.js");
|
88
88
|
var import_chunk_YRBRUREX = require("../chunk-YRBRUREX.js");
|
89
89
|
var import_chunk_6TXVGFQA = require("../chunk-6TXVGFQA.js");
|
90
90
|
var import_chunk_C47SCASR = require("../chunk-C47SCASR.js");
|
91
|
-
var
|
92
|
-
var
|
91
|
+
var import_chunk_EF6MMNTU = require("../chunk-EF6MMNTU.js");
|
92
|
+
var import_chunk_XJG2LJU6 = require("../chunk-XJG2LJU6.js");
|
93
93
|
var import_chunk_QN6PSQY7 = require("../chunk-QN6PSQY7.js");
|
94
94
|
var import_chunk_OYLZC5OV = require("../chunk-OYLZC5OV.js");
|
95
95
|
var import_chunk_PFLLVWZX = require("../chunk-PFLLVWZX.js");
|
@@ -97,8 +97,8 @@ var import_chunk_IWJ2BUYF = require("../chunk-IWJ2BUYF.js");
|
|
97
97
|
var import_chunk_I7IEEULS = require("../chunk-I7IEEULS.js");
|
98
98
|
var import_chunk_DZYINYAA = require("../chunk-DZYINYAA.js");
|
99
99
|
var import_chunk_XKZ6CBLA = require("../chunk-XKZ6CBLA.js");
|
100
|
-
var
|
101
|
-
var
|
100
|
+
var import_chunk_CTMFIZW2 = require("../chunk-CTMFIZW2.js");
|
101
|
+
var import_chunk_YHX36Y63 = require("../chunk-YHX36Y63.js");
|
102
102
|
var import_chunk_6JE6QGSJ = require("../chunk-6JE6QGSJ.js");
|
103
103
|
var import_chunk_QVVSDACW = require("../chunk-QVVSDACW.js");
|
104
104
|
var import_chunk_XYCIH36R = require("../chunk-XYCIH36R.js");
|
package/dist/cli/getSchema.d.ts
CHANGED
@@ -1,49 +1,11 @@
|
|
1
|
+
import type { GetSchemaResult, LookupResult, SuccessfulLookupResult } from '@prisma/schema-files-loader';
|
1
2
|
import type { MultipleSchemas } from '../utils/schemaFileInput';
|
2
|
-
type PathType = 'file' | 'directory';
|
3
|
-
type SuccessfulLookupResult = {
|
4
|
-
ok: true;
|
5
|
-
schema: GetSchemaResult;
|
6
|
-
};
|
7
|
-
type NonFatalLookupError = {
|
8
|
-
kind: 'NotFound';
|
9
|
-
expectedType?: PathType;
|
10
|
-
path: string;
|
11
|
-
} | {
|
12
|
-
kind: 'WrongType';
|
13
|
-
path: string;
|
14
|
-
expectedTypes: PathType[];
|
15
|
-
} | {
|
16
|
-
kind: 'FolderPreviewNotEnabled';
|
17
|
-
path: string;
|
18
|
-
};
|
19
|
-
type LookupResult = SuccessfulLookupResult | {
|
20
|
-
ok: false;
|
21
|
-
error: NonFatalLookupError;
|
22
|
-
};
|
23
3
|
type PackageJsonLookupResult = SuccessfulLookupResult | {
|
24
4
|
ok: false;
|
25
5
|
error: {
|
26
6
|
kind: 'PackageJsonNotConfigured';
|
27
7
|
};
|
28
8
|
};
|
29
|
-
export type GetSchemaResult = {
|
30
|
-
/**
|
31
|
-
* A path from which schema was loaded
|
32
|
-
* Can be either folder or a single file
|
33
|
-
*/
|
34
|
-
schemaPath: string;
|
35
|
-
/**
|
36
|
-
* Base dir for all of the schema files.
|
37
|
-
* In-multi file mode, this is equal to `schemaPath`.
|
38
|
-
* In single-file mode, this is a parent directory of
|
39
|
-
* a file
|
40
|
-
*/
|
41
|
-
schemaRootDir: string;
|
42
|
-
/**
|
43
|
-
* All loaded schema files
|
44
|
-
*/
|
45
|
-
schemas: MultipleSchemas;
|
46
|
-
};
|
47
9
|
export type GetSchemaOptions = {
|
48
10
|
cwd?: string;
|
49
11
|
argumentName?: string;
|