@prisma/internals 7.10.0-dev.5 → 7.10.0-dev.58

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.
Files changed (62) hide show
  1. package/dist/{chunk-ABMDX4EQ.js → chunk-3IMRWXIL.js} +15 -15
  2. package/dist/{chunk-EBLNHWW6.js → chunk-3VD46SL7.js} +9 -9
  3. package/dist/{chunk-AEI5DILY.js → chunk-5BDP445D.js} +5 -5
  4. package/dist/{chunk-4YZJJPK2.js → chunk-5P43324W.js} +15 -15
  5. package/dist/{chunk-GZY7QBBF.js → chunk-5WRIOIZY.js} +5 -5
  6. package/dist/{chunk-5SEUFFRY.js → chunk-6DUJVBF7.js} +29 -29
  7. package/dist/{chunk-LZ2DP3UC.js → chunk-6QMQ2JYG.js} +7 -7
  8. package/dist/{chunk-TZJROXB3.js → chunk-6Z766KGR.js} +6 -6
  9. package/dist/{chunk-KAH2NIWC.js → chunk-74RGCSUJ.js} +5 -5
  10. package/dist/{chunk-XAOAQYNN.js → chunk-AD2DKMII.js} +8 -8
  11. package/dist/{chunk-GZLJZGHX.js → chunk-DUDEWDFC.js} +7 -7
  12. package/dist/{chunk-2ZCAUSNJ.js → chunk-EWPXLBGE.js} +14 -14
  13. package/dist/{chunk-YXCPS3WU.js → chunk-FRVJZOHP.js} +6 -6
  14. package/dist/{chunk-MD47SEWA.js → chunk-HRNTJEMX.js} +14 -14
  15. package/dist/{chunk-HCOBBU2Q.js → chunk-IPVRPART.js} +5 -5
  16. package/dist/{chunk-QKQKSUQO.js → chunk-JFXHOFJA.js} +5 -5
  17. package/dist/{chunk-PP22IZ7I.js → chunk-JLFNVBTN.js} +5 -5
  18. package/dist/{chunk-PPSXRKJR.js → chunk-MBFQWFUB.js} +13 -13
  19. package/dist/{chunk-3RMP5ALU.js → chunk-MLTMKT3L.js} +5 -5
  20. package/dist/{chunk-3GIVRMID.js → chunk-PKF53VLJ.js} +5 -5
  21. package/dist/{chunk-L2BUQUNG.js → chunk-QBNYSYZK.js} +5 -5
  22. package/dist/{chunk-6S5MN3NA.js → chunk-QMNPESAP.js} +4 -4
  23. package/dist/{chunk-MAUT575G.js → chunk-R47SFJ5Z.js} +10 -10
  24. package/dist/{chunk-ZB2V476P.js → chunk-R4FWYJP7.js} +10 -10
  25. package/dist/{chunk-2BXDHSSY.js → chunk-TPCPXGC5.js} +5 -5
  26. package/dist/{chunk-6PILE32P.js → chunk-VUGB2H7M.js} +29 -29
  27. package/dist/{chunk-NUKBOD54.js → chunk-WFMA7DI5.js} +26 -22
  28. package/dist/{chunk-ZXAKMDG4.js → chunk-WOKQ6ZNV.js} +5 -5
  29. package/dist/{chunk-5P4WR3QW.js → chunk-XAAVALN7.js} +13 -13
  30. package/dist/chunk-YNDZCLVL.js +307 -0
  31. package/dist/{chunk-7IKUTPWQ.js → chunk-YXB6APHS.js} +5 -5
  32. package/dist/cli/checkUnsupportedDataProxy.d.ts +5 -5
  33. package/dist/cli/checkUnsupportedDataProxy.js +23 -23
  34. package/dist/cli/completion-values.js +24 -24
  35. package/dist/cli/getSchema.js +7 -7
  36. package/dist/cli/hashes.js +4 -4
  37. package/dist/cli/schemaContext.js +24 -24
  38. package/dist/engine-commands/errorHelpers.js +4 -4
  39. package/dist/engine-commands/formatSchema.js +22 -22
  40. package/dist/engine-commands/getConfig.js +9 -9
  41. package/dist/engine-commands/getDmmf.js +10 -10
  42. package/dist/engine-commands/getEnginesInfo.js +4 -4
  43. package/dist/engine-commands/index.js +33 -33
  44. package/dist/engine-commands/lintSchema.js +8 -8
  45. package/dist/engine-commands/mergeSchemas.js +9 -9
  46. package/dist/engine-commands/queryEngineCommons.js +6 -6
  47. package/dist/engine-commands/validate.js +9 -9
  48. package/dist/get-generators/getGenerators.d.ts +1 -0
  49. package/dist/get-generators/getGenerators.js +25 -25
  50. package/dist/index.js +75 -75
  51. package/dist/migrateTypes.d.ts +1 -1
  52. package/dist/sendPanic.js +3 -3
  53. package/dist/utils/getGitHubIssueUrl.js +4 -4
  54. package/dist/utils/getVersionFromPackageJson.js +3 -3
  55. package/dist/utils/handlePanic.js +5 -5
  56. package/dist/utils/missingGeneratorMessage.d.ts +3 -3
  57. package/dist/utils/missingGeneratorMessage.js +4 -4
  58. package/dist/utils/validatePrismaConfigWithDatasource.d.ts +2 -2
  59. package/dist/utils/validatePrismaConfigWithDatasource.js +3 -3
  60. package/dist/wasm.js +5 -5
  61. package/package.json +16 -16
  62. package/dist/chunk-XKZ6CBLA.js +0 -281
@@ -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 chunk_6PILE32P_exports = {};
30
- __export(chunk_6PILE32P_exports, {
29
+ var chunk_VUGB2H7M_exports = {};
30
+ __export(chunk_VUGB2H7M_exports, {
31
31
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
32
32
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
33
33
  formatSchema: () => formatSchema,
@@ -40,25 +40,25 @@ __export(chunk_6PILE32P_exports, {
40
40
  processSchemaResult: () => processSchemaResult,
41
41
  skipIndex: () => skipIndex
42
42
  });
43
- module.exports = __toCommonJS(chunk_6PILE32P_exports);
43
+ module.exports = __toCommonJS(chunk_VUGB2H7M_exports);
44
44
  var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
45
45
  var import_chunk_DZ4QWHTB = require("./chunk-DZ4QWHTB.js");
46
46
  var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
47
47
  var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
48
48
  var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
49
- var import_chunk_NUKBOD54 = require("./chunk-NUKBOD54.js");
49
+ var import_chunk_WFMA7DI5 = require("./chunk-WFMA7DI5.js");
50
50
  var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
51
51
  var import_chunk_BGMZPA2F = require("./chunk-BGMZPA2F.js");
52
52
  var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
53
- var import_chunk_4YZJJPK2 = require("./chunk-4YZJJPK2.js");
54
- var import_chunk_ZB2V476P = require("./chunk-ZB2V476P.js");
55
- var import_chunk_L2BUQUNG = require("./chunk-L2BUQUNG.js");
56
- var import_chunk_5P4WR3QW = require("./chunk-5P4WR3QW.js");
57
- var import_chunk_2BXDHSSY = require("./chunk-2BXDHSSY.js");
58
- var import_chunk_PP22IZ7I = require("./chunk-PP22IZ7I.js");
53
+ var import_chunk_3IMRWXIL = require("./chunk-3IMRWXIL.js");
54
+ var import_chunk_R47SFJ5Z = require("./chunk-R47SFJ5Z.js");
55
+ var import_chunk_QBNYSYZK = require("./chunk-QBNYSYZK.js");
56
+ var import_chunk_XAAVALN7 = require("./chunk-XAAVALN7.js");
57
+ var import_chunk_TPCPXGC5 = require("./chunk-TPCPXGC5.js");
58
+ var import_chunk_5BDP445D = require("./chunk-5BDP445D.js");
59
59
  var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
60
60
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
61
- var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
61
+ var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
62
62
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
63
63
  var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
64
64
  var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
@@ -76,7 +76,7 @@ var debug = (0, import_debug.default)("prisma:format");
76
76
  async function formatSchema({ schemas }, inputFormattingOptions) {
77
77
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
78
78
  handleFormatPanic(() => {
79
- import_chunk_PP22IZ7I.prismaSchemaWasm.debug_panic();
79
+ import_chunk_5BDP445D.prismaSchemaWasm.debug_panic();
80
80
  });
81
81
  }
82
82
  const defaultFormattingOptions = {
@@ -93,10 +93,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
93
93
  const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
94
94
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
95
95
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
96
- const lintDiagnostics2 = (0, import_chunk_L2BUQUNG.lintSchema)({ schemas: formattedMultipleSchemas2 });
96
+ const lintDiagnostics2 = (0, import_chunk_QBNYSYZK.lintSchema)({ schemas: formattedMultipleSchemas2 });
97
97
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
98
98
  });
99
- const lintWarnings = (0, import_chunk_L2BUQUNG.getLintWarningsAsText)(lintDiagnostics);
99
+ const lintWarnings = (0, import_chunk_QBNYSYZK.getLintWarningsAsText)(lintDiagnostics);
100
100
  if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
101
101
  console.warn(lintWarnings);
102
102
  }
@@ -123,7 +123,7 @@ function handleFormatPanic(tryCb) {
123
123
  }
124
124
  }
125
125
  function formatWasm(schema, documentFormattingParams) {
126
- const formattedSchema = import_chunk_PP22IZ7I.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
126
+ const formattedSchema = import_chunk_5BDP445D.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
127
127
  return formattedSchema;
128
128
  }
129
129
  async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
@@ -135,10 +135,10 @@ async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, sche
135
135
  }) {
136
136
  let schemaResult = null;
137
137
  if (allowNull) {
138
- schemaResult = await (0, import_chunk_2BXDHSSY.getSchemaWithPathOptional)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
138
+ schemaResult = await (0, import_chunk_TPCPXGC5.getSchemaWithPathOptional)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
139
139
  if (!schemaResult) return null;
140
140
  } else {
141
- schemaResult = await (0, import_chunk_2BXDHSSY.getSchemaWithPath)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
141
+ schemaResult = await (0, import_chunk_TPCPXGC5.getSchemaWithPath)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
142
142
  }
143
143
  return processSchemaResult({ schemaResult, printLoadMessage, cwd });
144
144
  }
@@ -150,9 +150,9 @@ async function processSchemaResult({
150
150
  const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
151
151
  const schemaRootDir = schemaResult.schemaRootDir || cwd;
152
152
  if (printLoadMessage) {
153
- (0, import_chunk_2BXDHSSY.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
153
+ (0, import_chunk_TPCPXGC5.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
154
154
  }
155
- const configFromPsl = await (0, import_chunk_4YZJJPK2.getConfig)({ datamodel: schemaResult.schemas });
155
+ const configFromPsl = await (0, import_chunk_3IMRWXIL.getConfig)({ datamodel: schemaResult.schemas });
156
156
  const primaryDatasource = configFromPsl.datasources.at(0);
157
157
  return {
158
158
  schemaFiles: schemaResult.schemas,
@@ -206,12 +206,12 @@ async function getGenerators(options) {
206
206
  throw new Error(import_chunk_BGMZPA2F.missingDatasource);
207
207
  }
208
208
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
209
- const dmmf = await (0, import_chunk_ZB2V476P.getDMMF)({ datamodel: schemaContext.schemaFiles });
209
+ const dmmf = await (0, import_chunk_R47SFJ5Z.getDMMF)({ datamodel: schemaContext.schemaFiles });
210
210
  if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
211
211
  if (schemaContext.primaryDatasource.provider === "mongodb") {
212
- throw new Error(import_chunk_NUKBOD54.missingModelMessageMongoDB);
212
+ throw new Error((0, import_chunk_WFMA7DI5.missingModelMessageMongoDB)(options.cliCommand));
213
213
  }
214
- throw new Error(import_chunk_NUKBOD54.missingModelMessage);
214
+ throw new Error((0, import_chunk_WFMA7DI5.missingModelMessage)(options.cliCommand));
215
215
  }
216
216
  const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
217
217
  await validateGenerators(generatorConfigs);
@@ -226,7 +226,7 @@ async function getGenerators(options) {
226
226
  type: "rpc",
227
227
  generatorPath: providerValue
228
228
  };
229
- const generatorInstance = (0, import_chunk_XKZ6CBLA.z)(generatorDefinition).with({ type: "in-process" }, ({ generator }) => new import_chunk_BPDMLM32.InProcessGenerator(generatorConfig, generator)).with(
229
+ const generatorInstance = (0, import_chunk_YNDZCLVL.M)(generatorDefinition).with({ type: "in-process" }, ({ generator }) => new import_chunk_BPDMLM32.InProcessGenerator(generatorConfig, generator)).with(
230
230
  { type: "rpc" },
231
231
  ({ generatorPath, isNode }) => new import_chunk_BPDMLM32.JsonRpcGenerator(generatorPath, generatorConfig, isNode)
232
232
  ).exhaustive();
@@ -254,7 +254,7 @@ You need to define \`output\` in the generator block in the schema file.`
254
254
  fromEnvVar: null
255
255
  };
256
256
  }
257
- const datamodel = (0, import_chunk_5P4WR3QW.mergeSchemas)({ schemas: schemaContext.schemaFiles });
257
+ const datamodel = (0, import_chunk_XAAVALN7.mergeSchemas)({ schemas: schemaContext.schemaFiles });
258
258
  const options2 = {
259
259
  datamodel,
260
260
  datasources: schemaContext.datasources,
@@ -422,17 +422,17 @@ function filterGenerators(generators, generatorNames) {
422
422
  }
423
423
  return filtered;
424
424
  }
425
- var forbiddenCmdWithDataProxyFlagMessage = (cmd) => `
426
- Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} yet.
427
- Please use a direct connection to your database in \`prisma.config.ts\`.
425
+ var forbiddenCmdWithDataProxyFlagMessage = (command) => `
426
+ Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(command)} yet.
427
+ Please use a direct connection to your database in \`prisma7.config.ts\`.
428
428
 
429
429
  More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/accelerate-limitations")}
430
430
  `;
431
431
  function checkUnsupportedDataProxy({
432
- cmd,
432
+ command,
433
433
  validatedConfig
434
434
  }) {
435
435
  if (validatedConfig.datasource.url.startsWith("prisma://")) {
436
- throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
436
+ throw new Error(forbiddenCmdWithDataProxyFlagMessage(command));
437
437
  }
438
438
  }
@@ -16,73 +16,77 @@ 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 chunk_NUKBOD54_exports = {};
20
- __export(chunk_NUKBOD54_exports, {
19
+ var chunk_WFMA7DI5_exports = {};
20
+ __export(chunk_WFMA7DI5_exports, {
21
21
  missingGeneratorMessage: () => missingGeneratorMessage,
22
22
  missingModelMessage: () => missingModelMessage,
23
23
  missingModelMessageMongoDB: () => missingModelMessageMongoDB
24
24
  });
25
- module.exports = __toCommonJS(chunk_NUKBOD54_exports);
25
+ module.exports = __toCommonJS(chunk_WFMA7DI5_exports);
26
26
  var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
27
27
  var import_chunk_VNIE2AZB = require("./chunk-VNIE2AZB.js");
28
28
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
29
- var missingGeneratorMessage = `
29
+ function missingGeneratorMessage(cliCommand) {
30
+ return `
30
31
  ${(0, import_chunk_PG5FDKSF.blue)("info")} You don't have any generators defined in your ${(0, import_chunk_PG5FDKSF.bold)(
31
- "schema.prisma"
32
- )}, so nothing will be generated.
32
+ "schema.prisma"
33
+ )}, so nothing will be generated.
33
34
  Add the Prisma Client generator like this:
34
35
 
35
36
  ${(0, import_chunk_PG5FDKSF.bold)(
36
- (0, import_chunk_VNIE2AZB.highlightDatamodel)(`generator client {
37
+ (0, import_chunk_VNIE2AZB.highlightDatamodel)(`generator client {
37
38
  provider = "prisma-client"
38
39
  output = "../src/generated/prisma"
39
40
  }`)
40
- )}
41
+ )}
42
+
43
+ Then run ${(0, import_chunk_PG5FDKSF.dim)("$")} ${cliCommand} generate.
41
44
 
42
45
  More information in our documentation:
43
46
  ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/prisma-schema")}
44
47
  `;
45
- var missingModelMessage = `
46
- You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your ${(0, import_chunk_PG5FDKSF.bold)(
47
- "schema.prisma"
48
- )}, so nothing will be generated.
48
+ }
49
+ function missingModelMessage(cliCommand) {
50
+ return `
51
+ You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your ${(0, import_chunk_PG5FDKSF.bold)("schema.prisma")}, so nothing will be generated.
49
52
 
50
53
  Prisma Client is typically generated from models defined in your schema. If you plan to use raw SQL queries only (e.g. ${(0, import_chunk_PG5FDKSF.bold)("$queryRaw")}), remove the ${(0, import_chunk_PG5FDKSF.bold)("--require-models")} flag to generate the client without models:
51
54
 
52
- ${(0, import_chunk_PG5FDKSF.dim)("$")} prisma generate
55
+ ${(0, import_chunk_PG5FDKSF.dim)("$")} ${cliCommand} generate
53
56
 
54
57
  Otherwise, you can define a model like this:
55
58
 
56
59
  ${(0, import_chunk_PG5FDKSF.bold)(
57
- (0, import_chunk_VNIE2AZB.highlightDatamodel)(`model User {
60
+ (0, import_chunk_VNIE2AZB.highlightDatamodel)(`model User {
58
61
  id Int @id @default(autoincrement())
59
62
  email String @unique
60
63
  name String?
61
64
  }`)
62
- )}
65
+ )}
63
66
 
64
67
  More information in our documentation:
65
68
  ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/prisma-schema")}
66
69
  `;
67
- var missingModelMessageMongoDB = `
68
- You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your ${(0, import_chunk_PG5FDKSF.bold)(
69
- "schema.prisma"
70
- )}, so nothing will be generated.
70
+ }
71
+ function missingModelMessageMongoDB(cliCommand) {
72
+ return `
73
+ You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your ${(0, import_chunk_PG5FDKSF.bold)("schema.prisma")}, so nothing will be generated.
71
74
 
72
75
  Prisma Client is typically generated from models defined in your schema. If you plan to use raw queries only, remove the ${(0, import_chunk_PG5FDKSF.bold)("--require-models")} flag to generate the client without models:
73
76
 
74
- ${(0, import_chunk_PG5FDKSF.dim)("$")} prisma generate
77
+ ${(0, import_chunk_PG5FDKSF.dim)("$")} ${cliCommand} generate
75
78
 
76
79
  Otherwise, you can define a model like this:
77
80
 
78
81
  ${(0, import_chunk_PG5FDKSF.bold)(
79
- (0, import_chunk_VNIE2AZB.highlightDatamodel)(`model User {
82
+ (0, import_chunk_VNIE2AZB.highlightDatamodel)(`model User {
80
83
  id String @id @default(auto()) @map("_id") @db.ObjectId
81
84
  email String @unique
82
85
  name String?
83
86
  }`)
84
- )}
87
+ )}
85
88
 
86
89
  More information in our documentation:
87
90
  ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/prisma-schema")}
88
91
  `;
92
+ }
@@ -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 chunk_ZXAKMDG4_exports = {};
20
- __export(chunk_ZXAKMDG4_exports, {
19
+ var chunk_WOKQ6ZNV_exports = {};
20
+ __export(chunk_WOKQ6ZNV_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(chunk_ZXAKMDG4_exports);
28
- var import_chunk_AEI5DILY = require("./chunk-AEI5DILY.js");
27
+ module.exports = __toCommonJS(chunk_WOKQ6ZNV_exports);
28
+ var import_chunk_JLFNVBTN = require("./chunk-JLFNVBTN.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 = import_chunk_AEI5DILY.prismaSchemaWasm.lint(JSON.stringify(schemas));
32
+ const lintResult = import_chunk_JLFNVBTN.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
33
  const lintDiagnostics = JSON.parse(lintResult);
34
34
  return lintDiagnostics;
35
35
  }
@@ -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 chunk_5P4WR3QW_exports = {};
30
- __export(chunk_5P4WR3QW_exports, {
29
+ var chunk_XAAVALN7_exports = {};
30
+ __export(chunk_XAAVALN7_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_5P4WR3QW_exports);
35
- var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
34
+ module.exports = __toCommonJS(chunk_XAAVALN7_exports);
35
+ var import_chunk_6Z766KGR = require("./chunk-6Z766KGR.js");
36
36
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
37
37
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
38
- var import_chunk_GZY7QBBF = require("./chunk-GZY7QBBF.js");
39
- var import_chunk_PP22IZ7I = require("./chunk-PP22IZ7I.js");
38
+ var import_chunk_5WRIOIZY = require("./chunk-5WRIOIZY.js");
39
+ var import_chunk_5BDP445D = require("./chunk-5BDP445D.js");
40
40
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
- var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
41
+ var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
42
42
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
43
43
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
44
44
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
@@ -47,7 +47,7 @@ var import_function = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_R6QH57
47
47
  var debug = (0, import_debug.default)("prisma:mergeSchemas");
48
48
  var MergeSchemasError = class extends Error {
49
49
  constructor(params) {
50
- const constructedErrorMessage = (0, import_chunk_XKZ6CBLA.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
50
+ const constructedErrorMessage = (0, import_chunk_YNDZCLVL.M)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
51
51
  const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
52
52
  return `${reason}
53
53
  ${errorCodeMessage}
@@ -59,12 +59,12 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: mergeSchemas]`;
62
- super((0, import_chunk_GZY7QBBF.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_5WRIOIZY.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "MergeSchemasError";
64
64
  }
65
65
  };
66
66
  function mergeSchemas(options) {
67
- const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "mergeSchemasWasm");
67
+ const debugErrorType = (0, import_chunk_6Z766KGR.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 import_chunk_PP22IZ7I.prismaSchemaWasm.merge_schemas(params);
75
+ return import_chunk_5BDP445D.prismaSchemaWasm.merge_schemas(params);
76
76
  },
77
77
  (e) => ({
78
78
  type: "wasm-error",
@@ -84,7 +84,7 @@ function mergeSchemas(options) {
84
84
  if ((0, import_chunk_5DBOS77Y.isRight)(mergeSchemasEither)) {
85
85
  return mergeSchemasEither.right;
86
86
  }
87
- const error = (0, import_chunk_XKZ6CBLA.z)(mergeSchemasEither.left).with({ type: "wasm-error" }, (e) => {
87
+ const error = (0, import_chunk_YNDZCLVL.M)(mergeSchemasEither.left).with({ type: "wasm-error" }, (e) => {
88
88
  debugErrorType(e);
89
89
  console.error("");
90
90
  if ((0, import_chunk_LMVSIVKQ.isWasmPanic)(e.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, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
107
+ return new MergeSchemasError((0, import_chunk_6Z766KGR.parseQueryEngineError)({ errorOutput, reason: e.reason }));
108
108
  }).exhaustive();
109
109
  throw error;
110
110
  }
@@ -0,0 +1,307 @@
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_YNDZCLVL_exports = {};
20
+ __export(chunk_YNDZCLVL_exports, {
21
+ M: () => M,
22
+ z: () => z
23
+ });
24
+ module.exports = __toCommonJS(chunk_YNDZCLVL_exports);
25
+ var t = Symbol.for("@ts-pattern/matcher");
26
+ var e = Symbol.for("@ts-pattern/isVariadic");
27
+ var n = "@ts-pattern/anonymous-select-key";
28
+ var r = (t2) => Boolean(t2 && "object" == typeof t2);
29
+ var i = (e2) => e2 && !!e2[t];
30
+ var o = (n2, s2, c2) => {
31
+ if (i(n2)) {
32
+ const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2);
33
+ return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
34
+ }
35
+ if (r(n2)) {
36
+ if (!r(s2)) return false;
37
+ if (Array.isArray(n2)) {
38
+ if (!Array.isArray(s2)) return false;
39
+ let t2 = [], r2 = [], u2 = [];
40
+ for (const o2 of n2.keys()) {
41
+ const s3 = n2[o2];
42
+ i(s3) && s3[e] ? u2.push(s3) : u2.length ? r2.push(s3) : t2.push(s3);
43
+ }
44
+ if (u2.length) {
45
+ if (u2.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
46
+ if (s2.length < t2.length + r2.length) return false;
47
+ const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
48
+ return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === u2.length || o(u2[0], i2, c2));
49
+ }
50
+ return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2));
51
+ }
52
+ return Reflect.ownKeys(n2).every((e2) => {
53
+ const r2 = n2[e2];
54
+ return (e2 in s2 || i(u2 = r2) && "optional" === u2[t]().matcherType) && o(r2, s2[e2], c2);
55
+ var u2;
56
+ });
57
+ }
58
+ return Object.is(s2, n2);
59
+ };
60
+ var s = (e2) => {
61
+ var n2, o2, u2;
62
+ return r(e2) ? i(e2) ? null != (n2 = null == (o2 = (u2 = e2[t]()).getSelectionKeys) ? void 0 : o2.call(u2)) ? n2 : [] : Array.isArray(e2) ? c(e2, s) : c(Object.values(e2), s) : [];
63
+ };
64
+ var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
65
+ function u(...t2) {
66
+ if (1 === t2.length) {
67
+ const [e2] = t2;
68
+ return (t3) => o(e2, t3, () => {
69
+ });
70
+ }
71
+ if (2 === t2.length) {
72
+ const [e2, n2] = t2;
73
+ return o(e2, n2, () => {
74
+ });
75
+ }
76
+ throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
77
+ }
78
+ function a(t2) {
79
+ return Object.assign(t2, { optional: () => h(t2), and: (e2) => d(t2, e2), or: (e2) => y(t2, e2), select: (e2) => void 0 === e2 ? v(t2) : v(e2, t2) });
80
+ }
81
+ function l(t2) {
82
+ return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
83
+ let n2 = 0;
84
+ const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
85
+ return { next: () => {
86
+ var t4;
87
+ return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
88
+ } };
89
+ } }))(t2), { optional: () => l(h(t2)), select: (e2) => l(void 0 === e2 ? v(t2) : v(e2, t2)) });
90
+ }
91
+ function h(e2) {
92
+ return a({ [t]: () => ({ match: (t2) => {
93
+ let n2 = {};
94
+ const r2 = (t3, e3) => {
95
+ n2[t3] = e3;
96
+ };
97
+ return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 };
98
+ }, getSelectionKeys: () => s(e2), matcherType: "optional" }) });
99
+ }
100
+ var f = (t2, e2) => {
101
+ for (const n2 of t2) if (!e2(n2)) return false;
102
+ return true;
103
+ };
104
+ var g = (t2, e2) => {
105
+ for (const [n2, r2] of t2.entries()) if (!e2(r2, n2)) return false;
106
+ return true;
107
+ };
108
+ var m = (t2, e2) => {
109
+ const n2 = Reflect.ownKeys(t2);
110
+ for (const r2 of n2) if (!e2(r2, t2[r2])) return false;
111
+ return true;
112
+ };
113
+ function d(...e2) {
114
+ return a({ [t]: () => ({ match: (t2) => {
115
+ let n2 = {};
116
+ const r2 = (t3, e3) => {
117
+ n2[t3] = e3;
118
+ };
119
+ return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 };
120
+ }, getSelectionKeys: () => c(e2, s), matcherType: "and" }) });
121
+ }
122
+ function y(...e2) {
123
+ return a({ [t]: () => ({ match: (t2) => {
124
+ let n2 = {};
125
+ const r2 = (t3, e3) => {
126
+ n2[t3] = e3;
127
+ };
128
+ return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 };
129
+ }, getSelectionKeys: () => c(e2, s), matcherType: "or" }) });
130
+ }
131
+ function p(e2) {
132
+ return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
133
+ }
134
+ function v(...e2) {
135
+ const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
136
+ return a({ [t]: () => ({ match: (t2) => {
137
+ let e3 = { [null != r2 ? r2 : n]: t2 };
138
+ return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => {
139
+ e3[t3] = n2;
140
+ }), selections: e3 };
141
+ }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) });
142
+ }
143
+ function b(t2) {
144
+ return true;
145
+ }
146
+ function w(t2) {
147
+ return "number" == typeof t2;
148
+ }
149
+ function S(t2) {
150
+ return "string" == typeof t2;
151
+ }
152
+ function j(t2) {
153
+ return "bigint" == typeof t2;
154
+ }
155
+ var K = a(p(b));
156
+ var O = a(p(b));
157
+ var E = K;
158
+ var x = (t2) => Object.assign(a(t2), { startsWith: (e2) => {
159
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && t3.startsWith(n2)))));
160
+ var n2;
161
+ }, endsWith: (e2) => {
162
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && t3.endsWith(n2)))));
163
+ var n2;
164
+ }, minLength: (e2) => x(d(t2, ((t3) => p((e3) => S(e3) && e3.length >= t3))(e2))), length: (e2) => x(d(t2, ((t3) => p((e3) => S(e3) && e3.length === t3))(e2))), maxLength: (e2) => x(d(t2, ((t3) => p((e3) => S(e3) && e3.length <= t3))(e2))), includes: (e2) => {
165
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && t3.includes(n2)))));
166
+ var n2;
167
+ }, regex: (e2) => {
168
+ return x(d(t2, (n2 = e2, p((t3) => S(t3) && Boolean(t3.match(n2))))));
169
+ var n2;
170
+ } });
171
+ var A = x(p(S));
172
+ var N = (t2) => Object.assign(a(t2), { between: (e2, n2) => N(d(t2, ((t3, e3) => p((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => N(d(t2, ((t3) => p((e3) => w(e3) && e3 >= t3))(e2))), int: () => N(d(t2, p((t3) => w(t3) && Number.isInteger(t3)))), finite: () => N(d(t2, p((t3) => w(t3) && Number.isFinite(t3)))), positive: () => N(d(t2, p((t3) => w(t3) && t3 > 0))), negative: () => N(d(t2, p((t3) => w(t3) && t3 < 0))) });
173
+ var P = N(p(w));
174
+ var k = (t2) => Object.assign(a(t2), { between: (e2, n2) => k(d(t2, ((t3, e3) => p((n3) => j(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 < t3))(e2))), gt: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 > t3))(e2))), lte: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 <= t3))(e2))), gte: (e2) => k(d(t2, ((t3) => p((e3) => j(e3) && e3 >= t3))(e2))), positive: () => k(d(t2, p((t3) => j(t3) && t3 > 0))), negative: () => k(d(t2, p((t3) => j(t3) && t3 < 0))) });
175
+ var T = k(p(j));
176
+ var B = a(p(function(t2) {
177
+ return "boolean" == typeof t2;
178
+ }));
179
+ var _ = a(p(function(t2) {
180
+ return "symbol" == typeof t2;
181
+ }));
182
+ var W = a(p(function(t2) {
183
+ return null == t2;
184
+ }));
185
+ var $ = a(p(function(t2) {
186
+ return null != t2;
187
+ }));
188
+ var z = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
189
+ return l({ [t]: () => ({ match: (t2) => {
190
+ if (!Array.isArray(t2)) return { matched: false };
191
+ if (0 === e2.length) return { matched: true };
192
+ const n2 = e2[0];
193
+ let r2 = {};
194
+ if (0 === t2.length) return s(n2).forEach((t3) => {
195
+ r2[t3] = [];
196
+ }), { matched: true, selections: r2 };
197
+ const i2 = (t3, e3) => {
198
+ r2[t3] = (r2[t3] || []).concat([e3]);
199
+ };
200
+ return { matched: t2.every((t3) => o(n2, t3, i2)), selections: r2 };
201
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
202
+ }, set: function(...e2) {
203
+ return a({ [t]: () => ({ match: (t2) => {
204
+ if (!(t2 instanceof Set)) return { matched: false };
205
+ let n2 = {};
206
+ if (0 === t2.size) return { matched: true, selections: n2 };
207
+ if (0 === e2.length) return { matched: true };
208
+ const r2 = (t3, e3) => {
209
+ n2[t3] = (n2[t3] || []).concat([e3]);
210
+ }, i2 = e2[0];
211
+ return { matched: f(t2, (t3) => o(i2, t3, r2)), selections: n2 };
212
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
213
+ }, map: function(...e2) {
214
+ return a({ [t]: () => ({ match: (t2) => {
215
+ if (!(t2 instanceof Map)) return { matched: false };
216
+ let n2 = {};
217
+ if (0 === t2.size) return { matched: true, selections: n2 };
218
+ const r2 = (t3, e3) => {
219
+ n2[t3] = (n2[t3] || []).concat([e3]);
220
+ };
221
+ if (0 === e2.length) return { matched: true };
222
+ var i2;
223
+ if (1 === e2.length) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
224
+ const [s2, c2] = e2;
225
+ return { matched: g(t2, (t3, e3) => {
226
+ const n3 = o(s2, e3, r2), i3 = o(c2, t3, r2);
227
+ return n3 && i3;
228
+ }), selections: n2 };
229
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
230
+ }, record: function(...e2) {
231
+ return a({ [t]: () => ({ match: (t2) => {
232
+ if (null === t2 || "object" != typeof t2 || Array.isArray(t2)) return { matched: false };
233
+ var n2;
234
+ if (0 === e2.length) throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${null == (n2 = e2[0]) ? void 0 : n2.toString()}`);
235
+ let r2 = {};
236
+ const i2 = (t3, e3) => {
237
+ r2[t3] = (r2[t3] || []).concat([e3]);
238
+ }, [s2, c2] = 1 === e2.length ? [A, e2[0]] : e2;
239
+ return { matched: m(t2, (t3, e3) => {
240
+ const n3 = "string" != typeof t3 || Number.isNaN(Number(t3)) ? null : Number(t3), r3 = null !== n3 && o(s2, n3, i2), u2 = o(s2, t3, i2), a2 = o(c2, e3, i2);
241
+ return (u2 || r3) && a2;
242
+ }), selections: r2 };
243
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
244
+ }, intersection: d, union: y, not: function(e2) {
245
+ return a({ [t]: () => ({ match: (t2) => ({ matched: !o(e2, t2, () => {
246
+ }) }), getSelectionKeys: () => [], matcherType: "not" }) });
247
+ }, when: p, select: v, any: K, unknown: O, _: E, string: A, number: P, bigint: T, boolean: B, symbol: _, nullish: W, nonNullable: $, instanceOf: function(t2) {
248
+ return a(p(/* @__PURE__ */ function(t3) {
249
+ return (e2) => e2 instanceof t3;
250
+ }(t2)));
251
+ }, shape: function(t2) {
252
+ return a(p(u(t2)));
253
+ } };
254
+ var I = class extends Error {
255
+ constructor(t2) {
256
+ let e2;
257
+ try {
258
+ e2 = JSON.stringify(t2);
259
+ } catch (n2) {
260
+ e2 = t2;
261
+ }
262
+ super(`Pattern matching error: no pattern matches value ${e2}`), this.input = void 0, this.input = t2;
263
+ }
264
+ };
265
+ var L = { matched: false, value: void 0 };
266
+ function M(t2) {
267
+ return new R(t2, L);
268
+ }
269
+ var R = class _R {
270
+ constructor(t2, e2) {
271
+ this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
272
+ }
273
+ with(...t2) {
274
+ if (this.state.matched) return this;
275
+ const e2 = t2[t2.length - 1], r2 = [t2[0]];
276
+ let i2;
277
+ 3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
278
+ let s2 = false, c2 = {};
279
+ const u2 = (t3, e3) => {
280
+ s2 = true, c2[t3] = e3;
281
+ }, a2 = !r2.some((t3) => o(t3, this.input, u2)) || i2 && !Boolean(i2(this.input)) ? L : { matched: true, value: e2(s2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
282
+ return new _R(this.input, a2);
283
+ }
284
+ when(t2, e2) {
285
+ if (this.state.matched) return this;
286
+ const n2 = Boolean(t2(this.input));
287
+ return new _R(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : L);
288
+ }
289
+ otherwise(t2) {
290
+ return this.state.matched ? this.state.value : t2(this.input);
291
+ }
292
+ exhaustive(t2 = F) {
293
+ return this.state.matched ? this.state.value : t2(this.input);
294
+ }
295
+ run() {
296
+ return this.exhaustive();
297
+ }
298
+ returnType() {
299
+ return this;
300
+ }
301
+ narrow() {
302
+ return this;
303
+ }
304
+ };
305
+ function F(t2) {
306
+ throw new I(t2);
307
+ }