@prisma/internals 7.2.0 → 7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1
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-QMSPMDFJ.js → chunk-262R2PBW.js} +5 -5
- package/dist/chunk-3FP46GUV.js +471 -0
- package/dist/chunk-46ABODUM.js +186 -0
- package/dist/{chunk-GJSFP4V4.js → chunk-4CGPN5SR.js} +9 -3
- package/dist/{chunk-KAH2NIWC.js → chunk-4JCVHBYR.js} +6 -6
- package/dist/{chunk-EIO44IYO.js → chunk-55ZV2II2.js} +38 -16
- package/dist/{chunk-AADMLOWX.js → chunk-5ETP2F4G.js} +5 -5
- package/dist/{chunk-UWK6LIYC.js → chunk-5PEHPZHO.js} +11 -11
- package/dist/{chunk-T6BPU44Y.js → chunk-656EKQL7.js} +5 -5
- package/dist/{chunk-MW6NA5W7.js → chunk-65XSDXPY.js} +13 -13
- package/dist/chunk-6TTRTZXU.js +37 -0
- package/dist/{chunk-Q5XW7CMJ.js → chunk-75BIJ5PX.js} +9 -9
- package/dist/{chunk-DXWYZA7B.js → chunk-7QC5VORA.js} +4 -3
- package/dist/{chunk-AQOVQMBO.js → chunk-7QKLIARO.js} +10 -8
- package/dist/{chunk-CQVWHHIJ.js → chunk-AX5N26KG.js} +6 -11
- package/dist/{chunk-NBWRGVYR.js → chunk-BCQZ6JQE.js} +6 -4
- package/dist/{chunk-BXIKQUP5.js → chunk-BVJP43JS.js} +7 -7
- package/dist/chunk-D4VDA2TZ.js +66 -0
- package/dist/{chunk-G6VGFCRW.js → chunk-D6JNJJI7.js} +146 -58
- package/dist/chunk-DZYINYAA.js +68 -0
- package/dist/{chunk-C6MDA273.js → chunk-E2QTLJH5.js} +13 -13
- package/dist/chunk-ERSH2BQA.js +58 -0
- package/dist/{chunk-2BXDHSSY.js → chunk-EYVG6XQS.js} +68 -56
- package/dist/{chunk-GH2WAX5Y.js → chunk-F2OZV76L.js} +7 -7
- package/dist/{chunk-R3J2O23S.js → chunk-FCYHZHVW.js} +4 -4
- package/dist/{chunk-DQWKFZPY.js → chunk-FYZCPL2Z.js} +7 -4
- package/dist/{chunk-2GPDFPDR.js → chunk-GMW36QQF.js} +7 -7
- package/dist/{chunk-OVTE2A4Y.js → chunk-H43XC5ET.js} +5 -5
- package/dist/{chunk-YXCPS3WU.js → chunk-HFFWZTVM.js} +15 -5
- package/dist/chunk-HO5HRHFZ.js +30 -0
- package/dist/chunk-HW5RCZSE.js +1 -0
- package/dist/{chunk-YV4IFLW4.js → chunk-JOIIWB3U.js} +129 -128
- package/dist/chunk-KDHESRKE.js +49 -0
- package/dist/{chunk-KJKLC73N.js → chunk-KH7FI42S.js} +11 -11
- package/dist/chunk-L6KOIJJ5.js +125 -0
- package/dist/{chunk-3U4QB2G3.js → chunk-LYFOJ5NK.js} +6 -4
- package/dist/{chunk-Q75TMXCR.js → chunk-OAT7ZJED.js} +20 -7
- package/dist/{chunk-GCMOJALQ.js → chunk-OPLMJ5WZ.js} +146 -58
- package/dist/{chunk-SP2ETLT2.js → chunk-OSHZ4P3G.js} +5 -5
- package/dist/{chunk-6JD4VENT.js → chunk-OWUYXGDF.js} +12 -12
- package/dist/chunk-PZMRR772.js +41 -0
- package/dist/{chunk-HFLFMWOT.js → chunk-QDT7TGYZ.js} +5 -5
- package/dist/{chunk-QRW4PODC.js → chunk-QLOP3Z4E.js} +38 -16
- package/dist/{chunk-HNOCAIKC.js → chunk-QPQF4VGD.js} +12 -12
- package/dist/chunk-RFB2U4GQ.js +41 -0
- package/dist/{chunk-5I4ERIIY.js → chunk-RS2R7COT.js} +9 -3
- package/dist/chunk-T2PM5TKT.js +55 -0
- package/dist/{chunk-G7GV3UAA.js → chunk-THADADEM.js} +9 -7
- package/dist/{chunk-5BRXEOYH.js → chunk-TQFONRJP.js} +5 -5
- package/dist/{chunk-WSZXPLJQ.js → chunk-TZJROXB3.js} +4 -4
- package/dist/{chunk-YJVCIN4F.js → chunk-UHI6VYFX.js} +14 -16
- package/dist/{chunk-NYNXYKR4.js → chunk-UQUWZJVN.js} +7 -7
- package/dist/{chunk-P3FYX4Y7.js → chunk-W6J5YFD2.js} +5 -5
- package/dist/{chunk-J3JTMPWZ.js → chunk-WDPDHAFW.js} +5 -5
- package/dist/{chunk-ARC7TW3L.js → chunk-WFNB7VRA.js} +14 -4
- package/dist/{chunk-P47PM3SY.js → chunk-WKP2TVYB.js} +5 -5
- package/dist/cli/checkUnsupportedDataProxy.d.ts +9 -7
- package/dist/cli/checkUnsupportedDataProxy.js +65 -53
- package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +22 -0
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +135 -0
- package/dist/cli/directoryConfig.d.ts +2 -5
- package/dist/cli/directoryConfig.js +2 -2
- package/dist/cli/getGeneratorSuccessMessage.js +3 -2
- package/dist/cli/getSchema.d.ts +20 -28
- package/dist/cli/getSchema.js +5 -7
- package/dist/cli/hashes.d.ts +1 -2
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +22 -5
- package/dist/cli/schemaContext.js +65 -54
- package/dist/cli/types.d.ts +1 -1
- package/dist/client/getClientEngineType.d.ts +7 -0
- package/dist/client/getClientEngineType.js +26 -0
- package/dist/convertCredentials.js +4 -4
- package/dist/dotenvExpand.d.ts +35 -0
- package/dist/dotenvExpand.js +25 -0
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +64 -52
- package/dist/engine-commands/getConfig.d.ts +5 -1
- package/dist/engine-commands/getConfig.js +13 -10
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +9 -5
- package/dist/engine-commands/getEnginesInfo.d.ts +1 -0
- package/dist/engine-commands/getEnginesInfo.js +9 -6
- package/dist/engine-commands/index.d.ts +1 -1
- package/dist/engine-commands/index.js +76 -62
- 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/get-generators/getGenerators.d.ts +2 -0
- package/dist/get-generators/getGenerators.js +67 -55
- 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 +4 -4
- package/dist/getPackedPackage.js +3 -3
- package/dist/index.d.ts +19 -5
- package/dist/index.js +125 -99
- package/dist/resolveBinary.js +7 -7
- package/dist/schemaEngineCommands.js +8 -8
- package/dist/sendPanic.js +3 -2
- package/dist/tracing/types.d.ts +54 -0
- package/dist/tracing/types.js +2 -0
- package/dist/types.d.ts +0 -15
- package/dist/utils/__tests__/maskSchema.test.js +23 -0
- package/dist/utils/byline.d.ts +4 -0
- package/dist/utils/byline.js +28 -0
- package/dist/utils/canPrompt.js +3 -3
- package/dist/utils/cloudflareD1.d.ts +5 -0
- package/dist/utils/cloudflareD1.js +27 -0
- package/dist/utils/fs-functional.js +10 -10
- package/dist/utils/fs-utils.js +8 -8
- package/dist/utils/getEnvPaths.d.ts +14 -0
- package/dist/utils/{validatePrismaConfigWithDatasource.js → getEnvPaths.js} +8 -7
- package/dist/utils/getMigrateConfigDir.d.ts +2 -0
- package/dist/utils/getMigrateConfigDir.js +25 -0
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handleEngineLoadingErrors.d.ts +8 -0
- package/dist/utils/handleEngineLoadingErrors.js +27 -0
- package/dist/utils/handlePanic.js +7 -6
- package/dist/utils/load.d.ts +6 -0
- package/dist/utils/load.js +28 -0
- package/dist/utils/loadEnvFile.d.ts +10 -0
- package/dist/utils/loadEnvFile.js +30 -0
- package/dist/utils/maskSchema.d.ts +4 -0
- package/dist/utils/maskSchema.js +27 -0
- package/dist/utils/missingDatasource.js +2 -2
- package/dist/utils/missingGeneratorMessage.js +4 -4
- package/dist/utils/serializeQueryEngineName.d.ts +4 -0
- package/dist/utils/serializeQueryEngineName.js +25 -0
- package/dist/utils/toSchemasContainer.d.ts +1 -1
- package/dist/utils/toSchemasContainer.js +3 -3
- package/dist/utils/tryLoadEnvs.d.ts +25 -0
- package/dist/utils/tryLoadEnvs.js +30 -0
- package/dist/wasm.js +5 -5
- package/package.json +17 -15
- package/dist/chunk-QKQKSUQO.js +0 -46
- package/dist/utils/validatePrismaConfigWithDatasource.d.ts +0 -17
|
@@ -16,15 +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_4CGPN5SR_exports = {};
|
|
20
|
+
__export(chunk_4CGPN5SR_exports, {
|
|
21
21
|
engineTypeToBinaryType: () => engineTypeToBinaryType
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_4CGPN5SR_exports);
|
|
24
24
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
25
25
|
function engineTypeToBinaryType(engineType) {
|
|
26
26
|
if (engineType === "schemaEngine") {
|
|
27
27
|
return import_fetch_engine.BinaryType.SchemaEngineBinary;
|
|
28
28
|
}
|
|
29
|
+
if (engineType === "queryEngine") {
|
|
30
|
+
return import_fetch_engine.BinaryType.QueryEngineBinary;
|
|
31
|
+
}
|
|
32
|
+
if (engineType === "libqueryEngine") {
|
|
33
|
+
return import_fetch_engine.BinaryType.QueryEngineLibrary;
|
|
34
|
+
}
|
|
29
35
|
throw new Error(`Could not convert engine type ${engineType}`);
|
|
30
36
|
}
|
|
@@ -26,16 +26,16 @@ 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_4JCVHBYR_exports = {};
|
|
30
|
+
__export(chunk_4JCVHBYR_exports, {
|
|
31
31
|
getCLIPathHash: () => getCLIPathHash,
|
|
32
32
|
getProjectHash: () => getProjectHash
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_4JCVHBYR_exports);
|
|
35
|
+
var import_chunk_EYVG6XQS = require("./chunk-EYVG6XQS.js");
|
|
36
36
|
var import_crypto = __toESM(require("crypto"));
|
|
37
|
-
async function getProjectHash(
|
|
38
|
-
const projectPath = (await (0,
|
|
37
|
+
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
|
38
|
+
const projectPath = (await (0, import_chunk_EYVG6XQS.getSchemaWithPath)(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
|
39
39
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
|
40
40
|
}
|
|
41
41
|
function getCLIPathHash() {
|
|
@@ -26,17 +26,20 @@ 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_55ZV2II2_exports = {};
|
|
30
|
+
__export(chunk_55ZV2II2_exports, {
|
|
31
31
|
GetConfigError: () => GetConfigError,
|
|
32
|
-
getConfig: () => getConfig
|
|
32
|
+
getConfig: () => getConfig,
|
|
33
|
+
getDirectUrl: () => getDirectUrl,
|
|
34
|
+
getEffectiveUrl: () => getEffectiveUrl,
|
|
35
|
+
resolveUrl: () => resolveUrl
|
|
33
36
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
36
|
-
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
|
+
module.exports = __toCommonJS(chunk_55ZV2II2_exports);
|
|
38
|
+
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
|
37
39
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
+
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
41
|
+
var import_chunk_QDT7TGYZ = require("./chunk-QDT7TGYZ.js");
|
|
42
|
+
var import_chunk_WKP2TVYB = require("./chunk-WKP2TVYB.js");
|
|
40
43
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
44
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
45
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -61,22 +64,41 @@ ${detailsHeader} ${message}`;
|
|
|
61
64
|
}).exhaustive();
|
|
62
65
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
63
66
|
[Context: getConfig]`;
|
|
64
|
-
super((0,
|
|
67
|
+
super((0, import_chunk_QDT7TGYZ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
65
68
|
this.name = "GetConfigError";
|
|
66
69
|
}
|
|
67
70
|
};
|
|
71
|
+
function getEffectiveUrl(ds) {
|
|
72
|
+
if (ds.directUrl !== void 0) return ds.directUrl;
|
|
73
|
+
return ds.url;
|
|
74
|
+
}
|
|
75
|
+
function getDirectUrl(ds) {
|
|
76
|
+
return ds.directUrl;
|
|
77
|
+
}
|
|
78
|
+
function resolveUrl(envValue) {
|
|
79
|
+
const urlFromValue = envValue?.value;
|
|
80
|
+
const urlEnvVarName = envValue?.fromEnvVar;
|
|
81
|
+
const urlEnvVarValue = urlEnvVarName ? process.env[urlEnvVarName] : void 0;
|
|
82
|
+
return urlFromValue ?? urlEnvVarValue;
|
|
83
|
+
}
|
|
68
84
|
async function getConfig(options) {
|
|
69
|
-
const debugErrorType = (0,
|
|
85
|
+
const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "getConfigWasm");
|
|
70
86
|
debug(`Using getConfig Wasm`);
|
|
71
87
|
const configEither = (0, import_function.pipe)(
|
|
72
88
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
73
89
|
() => {
|
|
74
|
-
if (process.env.
|
|
90
|
+
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
|
75
91
|
debug("Triggering a Rust panic...");
|
|
76
|
-
|
|
92
|
+
import_chunk_WKP2TVYB.prismaSchemaWasm.debug_panic();
|
|
77
93
|
}
|
|
78
|
-
const params = JSON.stringify({
|
|
79
|
-
|
|
94
|
+
const params = JSON.stringify({
|
|
95
|
+
prismaSchema: options.datamodel,
|
|
96
|
+
datasourceOverrides: {},
|
|
97
|
+
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
|
98
|
+
env: process.env
|
|
99
|
+
});
|
|
100
|
+
const data = import_chunk_WKP2TVYB.prismaSchemaWasm.get_config(params);
|
|
101
|
+
return data;
|
|
80
102
|
},
|
|
81
103
|
(e) => ({
|
|
82
104
|
type: "wasm-error",
|
|
@@ -134,12 +156,12 @@ async function getConfig(options) {
|
|
|
134
156
|
return panic;
|
|
135
157
|
}
|
|
136
158
|
const errorOutput = e.error.message;
|
|
137
|
-
return new GetConfigError((0,
|
|
159
|
+
return new GetConfigError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
138
160
|
}).with({ type: "validation-error" }, (e) => {
|
|
139
161
|
return new GetConfigError({
|
|
140
162
|
_tag: "parsed",
|
|
141
163
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
|
142
|
-
reason: (0,
|
|
164
|
+
reason: (0, import_chunk_TZJROXB3.createSchemaValidationError)(e.reason),
|
|
143
165
|
message: formatErrors(e.error)
|
|
144
166
|
});
|
|
145
167
|
}).otherwise((e) => {
|
|
@@ -16,20 +16,20 @@ 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_5ETP2F4G_exports = {};
|
|
20
|
+
__export(chunk_5ETP2F4G_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(
|
|
28
|
-
var
|
|
27
|
+
module.exports = __toCommonJS(chunk_5ETP2F4G_exports);
|
|
28
|
+
var import_chunk_WKP2TVYB = require("./chunk-WKP2TVYB.js");
|
|
29
29
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
30
30
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
31
31
|
function lintSchema({ schemas }) {
|
|
32
|
-
const lintResult =
|
|
32
|
+
const lintResult = import_chunk_WKP2TVYB.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
|
33
33
|
const lintDiagnostics = JSON.parse(lintResult);
|
|
34
34
|
return lintDiagnostics;
|
|
35
35
|
}
|
|
@@ -26,17 +26,17 @@ 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_5PEHPZHO_exports = {};
|
|
30
|
+
__export(chunk_5PEHPZHO_exports, {
|
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
|
32
32
|
mergeSchemas: () => mergeSchemas
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
36
|
-
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
34
|
+
module.exports = __toCommonJS(chunk_5PEHPZHO_exports);
|
|
35
|
+
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
|
37
36
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
37
|
+
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
38
|
+
var import_chunk_QDT7TGYZ = require("./chunk-QDT7TGYZ.js");
|
|
39
|
+
var import_chunk_WKP2TVYB = require("./chunk-WKP2TVYB.js");
|
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -59,12 +59,12 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: mergeSchemas]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_QDT7TGYZ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "MergeSchemasError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
function mergeSchemas(options) {
|
|
67
|
-
const debugErrorType = (0,
|
|
67
|
+
const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "mergeSchemasWasm");
|
|
68
68
|
debug(`Using mergeSchemas Wasm`);
|
|
69
69
|
const mergeSchemasEither = (0, import_function.pipe)(
|
|
70
70
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
|
|
|
72
72
|
const params = JSON.stringify({
|
|
73
73
|
schema: options.schemas
|
|
74
74
|
});
|
|
75
|
-
return
|
|
75
|
+
return import_chunk_WKP2TVYB.prismaSchemaWasm.merge_schemas(params);
|
|
76
76
|
},
|
|
77
77
|
(e) => ({
|
|
78
78
|
type: "wasm-error",
|
|
@@ -104,7 +104,7 @@ function mergeSchemas(options) {
|
|
|
104
104
|
return panic;
|
|
105
105
|
}
|
|
106
106
|
const errorOutput = e.error.message;
|
|
107
|
-
return new MergeSchemasError((0,
|
|
107
|
+
return new MergeSchemasError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
108
108
|
}).exhaustive();
|
|
109
109
|
throw error;
|
|
110
110
|
}
|
|
@@ -16,20 +16,20 @@ 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_656EKQL7_exports = {};
|
|
20
|
+
__export(chunk_656EKQL7_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(
|
|
28
|
-
var
|
|
27
|
+
module.exports = __toCommonJS(chunk_656EKQL7_exports);
|
|
28
|
+
var import_chunk_262R2PBW = require("./chunk-262R2PBW.js");
|
|
29
29
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
30
30
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
31
31
|
function lintSchema({ schemas }) {
|
|
32
|
-
const lintResult =
|
|
32
|
+
const lintResult = import_chunk_262R2PBW.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
|
33
33
|
const lintDiagnostics = JSON.parse(lintResult);
|
|
34
34
|
return lintDiagnostics;
|
|
35
35
|
}
|
|
@@ -26,17 +26,17 @@ 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_65XSDXPY_exports = {};
|
|
30
|
+
__export(chunk_65XSDXPY_exports, {
|
|
31
31
|
ValidateError: () => ValidateError,
|
|
32
32
|
validate: () => validate
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
36
|
-
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
34
|
+
module.exports = __toCommonJS(chunk_65XSDXPY_exports);
|
|
35
|
+
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
|
37
36
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
37
|
+
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
38
|
+
var import_chunk_QDT7TGYZ = require("./chunk-QDT7TGYZ.js");
|
|
39
|
+
var import_chunk_WKP2TVYB = require("./chunk-WKP2TVYB.js");
|
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -59,25 +59,25 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: validate]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_QDT7TGYZ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "ValidateError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
function validate(options) {
|
|
67
|
-
const debugErrorType = (0,
|
|
67
|
+
const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "validateWasm");
|
|
68
68
|
debug(`Using validate Wasm`);
|
|
69
69
|
const validateEither = (0, import_function.pipe)(
|
|
70
70
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
71
71
|
() => {
|
|
72
|
-
if (process.env.
|
|
72
|
+
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
|
73
73
|
debug("Triggering a Rust panic...");
|
|
74
|
-
|
|
74
|
+
import_chunk_WKP2TVYB.prismaSchemaWasm.debug_panic();
|
|
75
75
|
}
|
|
76
76
|
const params = JSON.stringify({
|
|
77
77
|
prismaSchema: options.schemas,
|
|
78
78
|
noColor: Boolean(process.env.NO_COLOR)
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
import_chunk_WKP2TVYB.prismaSchemaWasm.validate(params);
|
|
81
81
|
},
|
|
82
82
|
(e) => ({
|
|
83
83
|
type: "wasm-error",
|
|
@@ -109,7 +109,7 @@ function validate(options) {
|
|
|
109
109
|
return panic;
|
|
110
110
|
}
|
|
111
111
|
const errorOutput = e.error.message;
|
|
112
|
-
return new ValidateError((0,
|
|
112
|
+
return new ValidateError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
113
113
|
}).exhaustive();
|
|
114
114
|
throw error;
|
|
115
115
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chunk_6TTRTZXU_exports = {};
|
|
20
|
+
__export(chunk_6TTRTZXU_exports, {
|
|
21
|
+
loadLibrary: () => loadLibrary
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(chunk_6TTRTZXU_exports);
|
|
24
|
+
var import_chunk_DZYINYAA = require("./chunk-DZYINYAA.js");
|
|
25
|
+
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
26
|
+
function loadLibrary(id, platformInfo) {
|
|
27
|
+
try {
|
|
28
|
+
return (0, import_chunk_4VNS5WPM.__require)(id);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
const errorMessage = (0, import_chunk_DZYINYAA.handleLibraryLoadingErrors)({
|
|
31
|
+
e,
|
|
32
|
+
platformInfo,
|
|
33
|
+
id
|
|
34
|
+
});
|
|
35
|
+
throw new Error(errorMessage);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -26,8 +26,8 @@ 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_75BIJ5PX_exports = {};
|
|
30
|
+
__export(chunk_75BIJ5PX_exports, {
|
|
31
31
|
createDirIfNotExists: () => createDirIfNotExists2,
|
|
32
32
|
fs_functional_exports: () => fs_functional_exports,
|
|
33
33
|
getFilesInDir: () => getFilesInDir2,
|
|
@@ -37,8 +37,8 @@ __export(chunk_Q5XW7CMJ_exports, {
|
|
|
37
37
|
removeFile: () => removeFile,
|
|
38
38
|
writeFile: () => writeFile2
|
|
39
39
|
});
|
|
40
|
-
module.exports = __toCommonJS(
|
|
41
|
-
var
|
|
40
|
+
module.exports = __toCommonJS(chunk_75BIJ5PX_exports);
|
|
41
|
+
var import_chunk_TQFONRJP = require("./chunk-TQFONRJP.js");
|
|
42
42
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
43
43
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
44
44
|
var import_promises = __toESM(require("fs/promises"));
|
|
@@ -3981,13 +3981,13 @@ var fs_functional_exports = {};
|
|
|
3981
3981
|
});
|
|
3982
3982
|
var import_function = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_R6QH57HZ.require_function)());
|
|
3983
3983
|
var TE = (0, import_chunk_4VNS5WPM.__toESM)(require_TaskEither());
|
|
3984
|
-
var createDirIfNotExists2 = (dir) => TE.tryCatch(() => (0,
|
|
3985
|
-
var writeFile2 = (params) => TE.tryCatch(() => (0,
|
|
3986
|
-
var removeEmptyDirs2 = (dir) => TE.tryCatch(() => (0,
|
|
3984
|
+
var createDirIfNotExists2 = (dir) => TE.tryCatch(() => (0, import_chunk_TQFONRJP.createDirIfNotExists)(dir), createTaggedSystemError("fs-create-dir", { dir }));
|
|
3985
|
+
var writeFile2 = (params) => TE.tryCatch(() => (0, import_chunk_TQFONRJP.writeFile)(params), createTaggedSystemError("fs-write-file", params));
|
|
3986
|
+
var removeEmptyDirs2 = (dir) => TE.tryCatch(() => (0, import_chunk_TQFONRJP.removeEmptyDirs)(dir), createTaggedSystemError("fs-remove-empty-dirs", { dir }));
|
|
3987
3987
|
var removeDir = (dir) => (0, import_function.pipe)(TE.tryCatch(() => import_promises.default.rm(dir, { recursive: true }), createTaggedSystemError("fs-remove-dir", { dir })));
|
|
3988
3988
|
var removeFile = (filePath) => (0, import_function.pipe)(TE.tryCatch(() => import_promises.default.unlink(filePath), createTaggedSystemError("fs-remove-file", { filePath })));
|
|
3989
|
-
var getNestedFoldersInDir2 = (dir) => () => (0,
|
|
3990
|
-
var getFilesInDir2 = (dir, pattern = "**") => () => (0,
|
|
3989
|
+
var getNestedFoldersInDir2 = (dir) => () => (0, import_chunk_TQFONRJP.getNestedFoldersInDir)(dir);
|
|
3990
|
+
var getFilesInDir2 = (dir, pattern = "**") => () => (0, import_chunk_TQFONRJP.getFilesInDir)(dir, pattern);
|
|
3991
3991
|
function createTaggedSystemError(type, meta) {
|
|
3992
3992
|
return (e) => ({
|
|
3993
3993
|
type,
|
|
@@ -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_7QC5VORA_exports = {};
|
|
20
|
+
__export(chunk_7QC5VORA_exports, {
|
|
21
21
|
missingDatasource: () => missingDatasource
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_7QC5VORA_exports);
|
|
24
24
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
25
25
|
var import_chunk_TQCLUNM2 = require("./chunk-TQCLUNM2.js");
|
|
26
26
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
@@ -31,6 +31,7 @@ You can define a datasource like this:
|
|
|
31
31
|
${(0, import_chunk_PG5FDKSF.bold)(
|
|
32
32
|
(0, import_chunk_TQCLUNM2.highlightDatamodel)(`datasource db {
|
|
33
33
|
provider = "postgresql"
|
|
34
|
+
url = env("DB_URL")
|
|
34
35
|
}`)
|
|
35
36
|
)}
|
|
36
37
|
|
|
@@ -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_7QKLIARO_exports = {};
|
|
20
|
+
__export(chunk_7QKLIARO_exports, {
|
|
21
21
|
require_package: () => require_package
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_7QKLIARO_exports);
|
|
24
24
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
25
25
|
var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
26
26
|
"package.json"(exports, module2) {
|
|
27
27
|
module2.exports = {
|
|
28
28
|
name: "@prisma/internals",
|
|
29
|
-
version: "7.
|
|
29
|
+
version: "7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1",
|
|
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",
|
|
@@ -48,6 +48,7 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
48
48
|
files: [
|
|
49
49
|
"README.md",
|
|
50
50
|
"dist",
|
|
51
|
+
"!**/libquery_engine*",
|
|
51
52
|
"!dist/get-generators/engines/*",
|
|
52
53
|
"scripts"
|
|
53
54
|
],
|
|
@@ -58,11 +59,12 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
58
59
|
"@swc/jest": "0.2.37",
|
|
59
60
|
"@types/babel__helper-validator-identifier": "7.15.2",
|
|
60
61
|
"@types/jest": "29.5.14",
|
|
61
|
-
"@types/node": "
|
|
62
|
+
"@types/node": "18.19.76",
|
|
62
63
|
"@types/resolve": "1.20.6",
|
|
63
64
|
archiver: "6.0.2",
|
|
64
65
|
"checkpoint-client": "1.1.33",
|
|
65
66
|
"cli-truncate": "4.0.0",
|
|
67
|
+
dotenv: "16.5.0",
|
|
66
68
|
empathic: "2.0.0",
|
|
67
69
|
"escape-string-regexp": "5.0.0",
|
|
68
70
|
execa: "8.0.1",
|
|
@@ -107,14 +109,14 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
107
109
|
"@prisma/generator": "workspace:*",
|
|
108
110
|
"@prisma/generator-helper": "workspace:*",
|
|
109
111
|
"@prisma/get-platform": "workspace:*",
|
|
110
|
-
"@prisma/prisma-schema-wasm": "7.
|
|
111
|
-
"@prisma/schema-engine-wasm": "7.
|
|
112
|
+
"@prisma/prisma-schema-wasm": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
|
|
113
|
+
"@prisma/schema-engine-wasm": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
|
|
112
114
|
"@prisma/schema-files-loader": "workspace:*",
|
|
113
115
|
arg: "5.0.2",
|
|
114
116
|
prompts: "2.4.2"
|
|
115
117
|
},
|
|
116
118
|
peerDependencies: {
|
|
117
|
-
typescript: ">=5.
|
|
119
|
+
typescript: ">=5.1.0"
|
|
118
120
|
},
|
|
119
121
|
peerDependenciesMeta: {
|
|
120
122
|
typescript: {
|
|
@@ -16,13 +16,13 @@ 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_AX5N26KG_exports = {};
|
|
20
|
+
__export(chunk_AX5N26KG_exports, {
|
|
21
21
|
missingGeneratorMessage: () => missingGeneratorMessage,
|
|
22
22
|
missingModelMessage: () => missingModelMessage,
|
|
23
23
|
missingModelMessageMongoDB: () => missingModelMessageMongoDB
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(chunk_AX5N26KG_exports);
|
|
26
26
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
27
27
|
var import_chunk_TQCLUNM2 = require("./chunk-TQCLUNM2.js");
|
|
28
28
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
@@ -30,18 +30,13 @@ var missingGeneratorMessage = `
|
|
|
30
30
|
${(0, import_chunk_PG5FDKSF.blue)("info")} You don't have any generators defined in your ${(0, import_chunk_PG5FDKSF.bold)(
|
|
31
31
|
"schema.prisma"
|
|
32
32
|
)}, so nothing will be generated.
|
|
33
|
-
|
|
33
|
+
You can define them like this:
|
|
34
34
|
|
|
35
35
|
${(0, import_chunk_PG5FDKSF.bold)(
|
|
36
36
|
(0, import_chunk_TQCLUNM2.highlightDatamodel)(`generator client {
|
|
37
|
-
provider = "prisma-client"
|
|
38
|
-
output = "../src/generated/prisma"
|
|
37
|
+
provider = "prisma-client-js"
|
|
39
38
|
}`)
|
|
40
|
-
)}
|
|
41
|
-
|
|
42
|
-
More information in our documentation:
|
|
43
|
-
${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/prisma-schema")}
|
|
44
|
-
`;
|
|
39
|
+
)}`;
|
|
45
40
|
var missingModelMessage = `
|
|
46
41
|
You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your ${(0, import_chunk_PG5FDKSF.bold)(
|
|
47
42
|
"schema.prisma"
|
|
@@ -26,15 +26,17 @@ 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_BCQZ6JQE_exports = {};
|
|
30
|
+
__export(chunk_BCQZ6JQE_exports, {
|
|
31
31
|
inferDirectoryConfig: () => inferDirectoryConfig
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_BCQZ6JQE_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"));
|
|
35
35
|
function inferDirectoryConfig(schemaContext, config, cwd = process.cwd()) {
|
|
36
36
|
const baseDir = (
|
|
37
|
-
//
|
|
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.
|
|
38
40
|
// `schemaRootDir` is either the directory the user supplied as schemaPath or the directory the single schema file is in.
|
|
39
41
|
schemaContext?.schemaRootDir ?? // Should also that not be defined because there is no schema yet we fallback to CWD + `/prisma`.
|
|
40
42
|
import_node_path.default.join(cwd, "prisma")
|
|
@@ -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_BVJP43JS_exports = {};
|
|
30
|
+
__export(chunk_BVJP43JS_exports, {
|
|
31
31
|
getPackedPackage: () => getPackedPackage,
|
|
32
32
|
require_p_map: () => require_p_map
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_BVJP43JS_exports);
|
|
35
35
|
var import_chunk_KDP6C3CB = require("./chunk-KDP6C3CB.js");
|
|
36
|
-
var
|
|
36
|
+
var import_chunk_JOIIWB3U = require("./chunk-JOIIWB3U.js");
|
|
37
37
|
var import_chunk_UMM35VP5 = require("./chunk-UMM35VP5.js");
|
|
38
38
|
var import_chunk_5VQNKCKW = require("./chunk-5VQNKCKW.js");
|
|
39
39
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
@@ -6254,9 +6254,9 @@ var require_del = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
6254
6254
|
"use strict";
|
|
6255
6255
|
var { promisify } = (0, import_chunk_4VNS5WPM.__require)("util");
|
|
6256
6256
|
var path2 = (0, import_chunk_4VNS5WPM.__require)("path");
|
|
6257
|
-
var globby = (0,
|
|
6258
|
-
var isGlob = (0,
|
|
6259
|
-
var slash = (0,
|
|
6257
|
+
var globby = (0, import_chunk_JOIIWB3U.require_globby)();
|
|
6258
|
+
var isGlob = (0, import_chunk_JOIIWB3U.require_is_glob)();
|
|
6259
|
+
var slash = (0, import_chunk_JOIIWB3U.require_slash)();
|
|
6260
6260
|
var gracefulFs = require_graceful_fs();
|
|
6261
6261
|
var isPathCwd = require_is_path_cwd();
|
|
6262
6262
|
var isPathInside = require_is_path_inside();
|
|
@@ -0,0 +1,66 @@
|
|
|
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_D4VDA2TZ_exports = {};
|
|
30
|
+
__export(chunk_D4VDA2TZ_exports, {
|
|
31
|
+
locateLocalCloudflareD1: () => locateLocalCloudflareD1
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(chunk_D4VDA2TZ_exports);
|
|
34
|
+
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
35
|
+
var import_chunk_JOIIWB3U = require("./chunk-JOIIWB3U.js");
|
|
36
|
+
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
37
|
+
var import_node_path = __toESM(require("node:path"));
|
|
38
|
+
var import_node_process = __toESM(require("node:process"));
|
|
39
|
+
var import_fast_glob = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_JOIIWB3U.require_out)());
|
|
40
|
+
var import_globby = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_JOIIWB3U.require_globby)());
|
|
41
|
+
var defaultD1DirPath = import_node_path.default.join(".wrangler", "state", "v3", "d1", "miniflare-D1DatabaseObject");
|
|
42
|
+
async function locateLocalCloudflareD1({ arg }) {
|
|
43
|
+
const cwd = import_node_process.default.cwd();
|
|
44
|
+
const d1DirPath = import_node_path.default.posix.join(cwd, defaultD1DirPath);
|
|
45
|
+
const pathConverted = (0, import_fast_glob.convertPathToPattern)(d1DirPath);
|
|
46
|
+
const d1Databases = await (0, import_globby.default)(import_node_path.default.posix.join(pathConverted, "*.sqlite"), {});
|
|
47
|
+
if (d1Databases.length === 0) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`No Cloudflare D1 databases found in ${defaultD1DirPath}. Did you run \`wrangler d1 create <DATABASE_NAME>\` and \`wrangler dev\`?`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
if (d1Databases.length > 1) {
|
|
53
|
+
const { originalArg, recommendedArg } = (0, import_chunk_XKZ6CBLA.z)(arg).with("--to-local-d1", (originalArg2) => ({
|
|
54
|
+
originalArg: originalArg2,
|
|
55
|
+
recommendedArg: "--to-url file:"
|
|
56
|
+
})).with("--from-local-d1", (originalArg2) => ({
|
|
57
|
+
originalArg: originalArg2,
|
|
58
|
+
recommendedArg: "--from-url file:"
|
|
59
|
+
})).exhaustive();
|
|
60
|
+
throw new Error(
|
|
61
|
+
`Multiple Cloudflare D1 databases found in ${defaultD1DirPath}. Please manually specify the local D1 database with \`${recommendedArg}\`, without using the \`${originalArg}\` flag.`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
const d1Database = d1Databases[0];
|
|
65
|
+
return d1Database;
|
|
66
|
+
}
|