@prisma/internals 6.6.0-dev.5 → 6.6.0-dev.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/Generator.d.ts +1 -1
  2. package/dist/Generator.js +3 -3
  3. package/dist/WasmPanicRegistry.js +3 -3
  4. package/dist/chunk-2A2DVAFZ.js +1015 -0
  5. package/dist/{chunk-CW5MRSDF.js → chunk-2FV6HEOU.js} +30 -34
  6. package/dist/chunk-2H6XXXKO.js +49 -0
  7. package/dist/chunk-2QTAK7KO.js +101 -0
  8. package/dist/{chunk-XLGODPZH.js → chunk-3DQANJMY.js} +12 -12
  9. package/dist/chunk-3TSSYJO2.js +1015 -0
  10. package/dist/{chunk-WWAWV7DQ.js → chunk-4VNS5WPM.js} +3 -33
  11. package/dist/{chunk-KQOJB3ZW.js → chunk-5AI4FIZ3.js} +10 -10
  12. package/dist/{chunk-7MD6344A.js → chunk-5DBOS77Y.js} +3 -5
  13. package/dist/{chunk-YG7D272D.js → chunk-5FVVC4L4.js} +11 -15
  14. package/dist/{chunk-TZCE3PWZ.js → chunk-5VQNKCKW.js} +7 -7
  15. package/dist/{chunk-I7IEEULS.js → chunk-6TTRTZXU.js} +5 -5
  16. package/dist/{chunk-MGZOEY6N.js → chunk-72UZXEBG.js} +6 -6
  17. package/dist/{chunk-CIH2HX7R.js → chunk-75AJJ2SV.js} +5 -5
  18. package/dist/{chunk-5RV3EMX6.js → chunk-75BIJ5PX.js} +57 -57
  19. package/dist/{chunk-LG5IW4IV.js → chunk-ABTIXQDX.js} +11 -9
  20. package/dist/{chunk-BGFWFIPR.js → chunk-AZV6HVKA.js} +5 -5
  21. package/dist/{chunk-X5YSMVVH.js → chunk-AZWZO6OY.js} +5 -5
  22. package/dist/{chunk-L3462R5V.js → chunk-BTWAF3S4.js} +22 -26
  23. package/dist/{chunk-VRT7T6MF.js → chunk-BWGDP6B5.js} +94 -105
  24. package/dist/{chunk-U6LD37KW.js → chunk-C7OA725J.js} +22 -26
  25. package/dist/{chunk-RK6MQ2H5.js → chunk-CEST7ZUQ.js} +12 -10
  26. package/dist/{chunk-5MCWLJSR.js → chunk-CR3XKUEA.js} +10 -10
  27. package/dist/{chunk-TSJICM5S.js → chunk-CRVLHWC5.js} +5 -5
  28. package/dist/{chunk-SHJNE6T7.js → chunk-D4VDA2TZ.js} +7 -7
  29. package/dist/{chunk-MUPZUVSI.js → chunk-D4VZUY3O.js} +14 -20
  30. package/dist/{chunk-KTBNIQ7N.js → chunk-DKSUHQGA.js} +8 -8
  31. package/dist/chunk-DODIJPCS.js +34 -0
  32. package/dist/{chunk-UNUCCAXA.js → chunk-DTPFRZWV.js} +5 -5
  33. package/dist/{chunk-ZYW3HGSH.js → chunk-DYVL6P7F.js} +7 -8
  34. package/dist/{chunk-NJQWZ447.js → chunk-EPXBOIA5.js} +6 -6
  35. package/dist/{chunk-7XNZDY2V.js → chunk-ETYWYJBX.js} +60 -60
  36. package/dist/{chunk-PIPE5DSU.js → chunk-EWWOTVR3.js} +6 -6
  37. package/dist/{chunk-5SN5JBT2.js → chunk-FXMGS3L5.js} +21 -40
  38. package/dist/{chunk-S57RMXZW.js → chunk-GHHABGYW.js} +5 -5
  39. package/dist/{chunk-XGDTIBRB.js → chunk-GIOVJ5SL.js} +46 -79
  40. package/dist/{chunk-L6GBFCXG.js → chunk-HAGJ64PM.js} +142 -155
  41. package/dist/{chunk-3ERIN7PH.js → chunk-HG3YOAAE.js} +10 -10
  42. package/dist/{chunk-U2L42IOL.js → chunk-I4O7TXOG.js} +23 -27
  43. package/dist/{chunk-GXDYIY4M.js → chunk-IDINCQMN.js} +56 -57
  44. package/dist/{chunk-EOWYER24.js → chunk-ISAD3N6L.js} +9 -9
  45. package/dist/{chunk-53LS3WUO.js → chunk-JOIIWB3U.js} +116 -116
  46. package/dist/{chunk-CZL7DCL2.js → chunk-JYMY3OAI.js} +6 -6
  47. package/dist/{chunk-C2WD2XUT.js → chunk-K5W6WZ6E.js} +971 -991
  48. package/dist/{chunk-TATYN3T2.js → chunk-KB5DKCI4.js} +29 -29
  49. package/dist/{chunk-LKTTJWFT.js → chunk-KDP6C3CB.js} +5 -5
  50. package/dist/{chunk-DARNQRUA.js → chunk-LHESHKC2.js} +9 -9
  51. package/dist/{chunk-ATFQZVBS.js → chunk-LMVSIVKQ.js} +9 -14
  52. package/dist/{chunk-ZKAW5JSN.js → chunk-LRJ4X43J.js} +5 -5
  53. package/dist/{chunk-ONHKZPSV.js → chunk-LRU47BGE.js} +6 -6
  54. package/dist/{chunk-4E7A3GDU.js → chunk-MM4ARWWY.js} +5 -5
  55. package/dist/{chunk-SC7OJHGV.js → chunk-MSQTODVE.js} +30 -34
  56. package/dist/{chunk-V2ZF7ETH.js → chunk-NVNI2SRU.js} +66 -68
  57. package/dist/{chunk-JHQHVXIR.js → chunk-OSHZ4P3G.js} +6 -7
  58. package/dist/{chunk-IPKE37QC.js → chunk-PFYALFCY.js} +6 -5
  59. package/dist/{chunk-SNY3IPJ5.js → chunk-PQE76XRR.js} +5 -5
  60. package/dist/{chunk-77IC3DNO.js → chunk-QGJH4P4N.js} +8 -8
  61. package/dist/{chunk-FCYHZHVW.js → chunk-R3J2O23S.js} +4 -4
  62. package/dist/{chunk-PFLLVWZX.js → chunk-R6QH57HZ.js} +5 -5
  63. package/dist/{chunk-Y3OWT3K2.js → chunk-TQFONRJP.js} +7 -7
  64. package/dist/{chunk-3BND5XB4.js → chunk-UTJGRVMG.js} +11 -11
  65. package/dist/{chunk-CHMJ5V7I.js → chunk-UZTXEBTM.js} +7 -7
  66. package/dist/{chunk-SNL3TWM6.js → chunk-V52H2SR4.js} +5 -5
  67. package/dist/{chunk-YXD4CJDK.js → chunk-VVPSLVOR.js} +27 -27
  68. package/dist/{chunk-6TXVGFQA.js → chunk-WSZXPLJQ.js} +11 -11
  69. package/dist/{chunk-BPZFDGKN.js → chunk-WXRVYSYN.js} +4 -7
  70. package/dist/{chunk-TPIOJZAZ.js → chunk-XKIMYV5V.js} +11 -15
  71. package/dist/{chunk-2MWIMEFK.js → chunk-XLTQGAI2.js} +6 -6
  72. package/dist/{chunk-AOEDMVV5.js → chunk-XQSHUIJ5.js} +23 -27
  73. package/dist/{chunk-EM3Z5VR6.js → chunk-XQYC6RGR.js} +46 -79
  74. package/dist/chunk-YR5KNFKN.js +1834 -0
  75. package/dist/{chunk-AZNLB67U.js → chunk-ZJWZK45Z.js} +5 -5
  76. package/dist/chunk-ZSINRHD4.js +43 -0
  77. package/dist/cli/Help.js +1 -1
  78. package/dist/cli/checkUnsupportedDataProxy.d.ts +12 -17
  79. package/dist/cli/checkUnsupportedDataProxy.js +77 -74
  80. package/dist/cli/directoryConfig.d.ts +7 -0
  81. package/dist/{get-generators/utils/check-feature-flags/checkFeatureFlags.js → cli/directoryConfig.js} +6 -6
  82. package/dist/cli/getGeneratorSuccessMessage.js +1 -1
  83. package/dist/cli/getSchema.d.ts +3 -28
  84. package/dist/cli/getSchema.js +80 -78
  85. package/dist/cli/getTypescriptVersion.js +1 -1
  86. package/dist/cli/hashes.d.ts +1 -2
  87. package/dist/cli/hashes.js +77 -74
  88. package/dist/cli/schemaContext.d.ts +59 -0
  89. package/dist/cli/schemaContext.js +139 -0
  90. package/dist/cli/utils.js +5 -5
  91. package/dist/client/getClientEngineType.d.ts +1 -1
  92. package/dist/client/getClientEngineType.js +1 -1
  93. package/dist/convertCredentials.d.ts +1 -1
  94. package/dist/convertCredentials.js +1 -1
  95. package/dist/dotenvExpand.js +1 -1
  96. package/dist/engine-commands/errorHelpers.js +5 -5
  97. package/dist/engine-commands/formatSchema.js +76 -73
  98. package/dist/engine-commands/getConfig.d.ts +1 -5
  99. package/dist/engine-commands/getConfig.js +16 -17
  100. package/dist/engine-commands/getDmmf.d.ts +3 -6
  101. package/dist/engine-commands/getDmmf.js +13 -14
  102. package/dist/engine-commands/getEngineVersion.js +12 -12
  103. package/dist/engine-commands/getEnginesMetaInfo.js +15 -15
  104. package/dist/engine-commands/index.js +87 -84
  105. package/dist/engine-commands/lintSchema.d.ts +1 -1
  106. package/dist/engine-commands/lintSchema.js +11 -12
  107. package/dist/engine-commands/mergeSchemas.js +13 -14
  108. package/dist/engine-commands/queryEngineCommons.js +8 -8
  109. package/dist/engine-commands/relativizePathInPSLError.js +1 -1
  110. package/dist/engine-commands/validate.js +13 -14
  111. package/dist/errorReporting.d.ts +0 -1
  112. package/dist/errorReporting.js +7 -7
  113. package/dist/get-generators/generatorResolvers/generatorResolvers.js +76 -73
  114. package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.js +4 -4
  115. package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.js +4 -4
  116. package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +7 -7
  117. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +76 -73
  118. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.js +4 -4
  119. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.js +4 -4
  120. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.js +1 -1
  121. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.test.js +1 -1
  122. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +77 -74
  123. package/dist/get-generators/getGenerators.d.ts +8 -4
  124. package/dist/get-generators/getGenerators.js +79 -76
  125. package/dist/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
  126. package/dist/get-generators/utils/binaryTypeToEngineType.js +1 -1
  127. package/dist/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
  128. package/dist/get-generators/utils/engineTypeToBinaryType.js +1 -1
  129. package/dist/get-generators/utils/fixBinaryTargets.d.ts +1 -1
  130. package/dist/get-generators/utils/fixBinaryTargets.js +1 -1
  131. package/dist/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
  132. package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -4
  133. package/dist/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
  134. package/dist/get-generators/utils/getEngineVersionForGenerator.js +1 -1
  135. package/dist/get-generators/utils/printGeneratorConfig.d.ts +1 -1
  136. package/dist/get-generators/utils/printGeneratorConfig.js +7 -7
  137. package/dist/getPackedPackage.js +9 -9
  138. package/dist/highlight/highlight.js +1 -1
  139. package/dist/highlight/languages/dml.js +1 -1
  140. package/dist/highlight/languages/sql.js +1 -1
  141. package/dist/highlight/prism.js +1 -1
  142. package/dist/highlight/theme.js +1 -1
  143. package/dist/index.d.ts +5 -3
  144. package/dist/index.js +143 -141
  145. package/dist/logger.js +9 -9
  146. package/dist/migrateTypes.d.ts +63 -0
  147. package/dist/{multipart-parser-32AROPTR.js → multipart-parser-3AFJFP6K.js} +7 -7
  148. package/dist/panic.d.ts +1 -4
  149. package/dist/panic.js +7 -7
  150. package/dist/resolveBinary.js +10 -10
  151. package/dist/resolveOutput.js +1 -1
  152. package/dist/schemaEngineCommands.js +13 -13
  153. package/dist/sendPanic.js +7 -111
  154. package/dist/types.d.ts +1 -1
  155. package/dist/utils/__tests__/isCi.test.js +1 -1
  156. package/dist/utils/__tests__/isInteractive.test.js +1 -1
  157. package/dist/utils/__tests__/maskSchema.test.js +1 -1
  158. package/dist/utils/assertAlways.js +1 -1
  159. package/dist/utils/assertNever.js +1 -1
  160. package/dist/utils/binaryTargetRegex.js +3 -3
  161. package/dist/utils/byline.js +1 -1
  162. package/dist/utils/callOnce.js +1 -1
  163. package/dist/utils/callOnce.test.js +1 -1
  164. package/dist/utils/canPrompt.js +4 -4
  165. package/dist/utils/chmodPlusX.js +1 -1
  166. package/dist/utils/cloudflareD1.js +4 -4
  167. package/dist/utils/drawBox.js +1 -1
  168. package/dist/utils/extractPreviewFeatures.d.ts +2 -2
  169. package/dist/utils/extractPreviewFeatures.js +3 -3
  170. package/dist/utils/formatTable.js +1 -1
  171. package/dist/utils/formatms.js +1 -1
  172. package/dist/utils/fs-functional.js +12 -12
  173. package/dist/utils/fs-utils.js +9 -9
  174. package/dist/utils/getCommandWithExecutor.js +4 -4
  175. package/dist/utils/getEnvPaths.d.ts +1 -1
  176. package/dist/utils/getEnvPaths.js +76 -73
  177. package/dist/utils/getGitHubIssueUrl.js +5 -4
  178. package/dist/utils/getMigrateConfigDir.js +1 -1
  179. package/dist/utils/getVersionFromPackageJson.js +4 -4
  180. package/dist/utils/handleEngineLoadingErrors.js +1 -1
  181. package/dist/utils/handlePanic.js +13 -110
  182. package/dist/utils/hasOwnProperty.js +1 -1
  183. package/dist/utils/isCi.js +1 -1
  184. package/dist/utils/isCurrentBinInstalledGlobally.js +3 -3
  185. package/dist/utils/isInContainer.js +1 -1
  186. package/dist/utils/isInNpmLifecycleHook.js +1 -1
  187. package/dist/utils/isInteractive.js +1 -1
  188. package/dist/utils/isPromiseLike.js +1 -1
  189. package/dist/utils/isValidJsIdentifier.js +4 -4
  190. package/dist/utils/keyBy.js +1 -1
  191. package/dist/utils/link.js +3 -3
  192. package/dist/utils/load.js +3 -3
  193. package/dist/utils/loadEnvFile.js +76 -73
  194. package/dist/utils/mapKeys.js +1 -1
  195. package/dist/utils/mapObjectValues.js +1 -1
  196. package/dist/utils/maskSchema.js +1 -1
  197. package/dist/utils/max.js +1 -1
  198. package/dist/utils/max.test.js +1 -1
  199. package/dist/utils/maybeInGitHook.js +1 -1
  200. package/dist/utils/missingDatasource.js +4 -4
  201. package/dist/utils/missingGeneratorMessage.js +6 -6
  202. package/dist/utils/now.js +1 -1
  203. package/dist/utils/omit.js +1 -1
  204. package/dist/utils/parseAWSNodejsRuntimeEnvVarVersion.js +1 -1
  205. package/dist/utils/parseEnvValue.d.ts +1 -1
  206. package/dist/utils/parseEnvValue.js +1 -1
  207. package/dist/utils/path.js +1 -1
  208. package/dist/utils/path.test.js +1 -1
  209. package/dist/utils/pick.js +1 -1
  210. package/dist/utils/printConfigWarnings.js +1 -1
  211. package/dist/utils/prismaPostgres.js +1 -1
  212. package/dist/utils/prismaPostgres.test.js +1 -1
  213. package/dist/utils/schemaFileInput.d.ts +0 -4
  214. package/dist/utils/schemaFileInput.js +3 -7
  215. package/dist/utils/serializeQueryEngineName.js +1 -1
  216. package/dist/utils/setClassName.js +1 -1
  217. package/dist/utils/toSchemasContainer.d.ts +2 -3
  218. package/dist/utils/toSchemasContainer.js +4 -5
  219. package/dist/utils/tryLoadEnvs.js +6 -6
  220. package/dist/utils/unique.js +1 -1
  221. package/dist/utils/vercelPkgPathRegex.js +1 -1
  222. package/dist/warnOnce.js +4 -4
  223. package/dist/wasm.js +6 -6
  224. package/package.json +14 -12
  225. package/dist/chunk-AOQIUJT4.js +0 -41
  226. package/dist/chunk-EPUNJXBL.js +0 -15631
  227. package/dist/chunk-IPWA5XTA.js +0 -15631
  228. package/dist/chunk-YRBRUREX.js +0 -57
  229. package/dist/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
@@ -26,15 +26,15 @@ 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_5SN5JBT2_exports = {};
30
- __export(chunk_5SN5JBT2_exports, {
29
+ var chunk_FXMGS3L5_exports = {};
30
+ __export(chunk_FXMGS3L5_exports, {
31
31
  getGitHubIssueUrl: () => getGitHubIssueUrl,
32
- require_strip_ansi: () => require_strip_ansi,
33
32
  wouldYouLikeToCreateANewIssue: () => wouldYouLikeToCreateANewIssue
34
33
  });
35
- module.exports = __toCommonJS(chunk_5SN5JBT2_exports);
34
+ module.exports = __toCommonJS(chunk_FXMGS3L5_exports);
35
+ var import_chunk_ZSINRHD4 = require("./chunk-ZSINRHD4.js");
36
36
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
37
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
37
+ var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
38
38
  var import_get_platform = require("@prisma/get-platform");
39
39
  var import_node_process = __toESM(require("node:process"));
40
40
  var import_node_os = __toESM(require("node:os"));
@@ -42,7 +42,7 @@ var import_node_fs = __toESM(require("node:fs"));
42
42
  var import_node_fs2 = __toESM(require("node:fs"));
43
43
  var import_node_fs3 = __toESM(require("node:fs"));
44
44
  var import_prompts = __toESM(require("prompts"));
45
- var require_is_windows = (0, import_chunk_WWAWV7DQ.__commonJS)({
45
+ var require_is_windows = (0, import_chunk_4VNS5WPM.__commonJS)({
46
46
  "../../node_modules/.pnpm/is-windows@1.0.2/node_modules/is-windows/index.js"(exports, module2) {
47
47
  "use strict";
48
48
  (function(factory) {
@@ -67,7 +67,7 @@ var require_is_windows = (0, import_chunk_WWAWV7DQ.__commonJS)({
67
67
  });
68
68
  }
69
69
  });
70
- var require_new_github_issue_url = (0, import_chunk_WWAWV7DQ.__commonJS)({
70
+ var require_new_github_issue_url = (0, import_chunk_4VNS5WPM.__commonJS)({
71
71
  "../../node_modules/.pnpm/new-github-issue-url@0.2.1/node_modules/new-github-issue-url/index.js"(exports, module2) {
72
72
  "use strict";
73
73
  module2.exports = (options = {}) => {
@@ -107,10 +107,10 @@ var require_new_github_issue_url = (0, import_chunk_WWAWV7DQ.__commonJS)({
107
107
  module2.exports.default = module2.exports;
108
108
  }
109
109
  });
110
- var require_is_docker = (0, import_chunk_WWAWV7DQ.__commonJS)({
110
+ var require_is_docker = (0, import_chunk_4VNS5WPM.__commonJS)({
111
111
  "../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js"(exports, module2) {
112
112
  "use strict";
113
- var fs4 = (0, import_chunk_WWAWV7DQ.__require)("fs");
113
+ var fs4 = (0, import_chunk_4VNS5WPM.__require)("fs");
114
114
  var isDocker2;
115
115
  function hasDockerEnv2() {
116
116
  try {
@@ -135,11 +135,11 @@ var require_is_docker = (0, import_chunk_WWAWV7DQ.__commonJS)({
135
135
  };
136
136
  }
137
137
  });
138
- var require_is_wsl = (0, import_chunk_WWAWV7DQ.__commonJS)({
138
+ var require_is_wsl = (0, import_chunk_4VNS5WPM.__commonJS)({
139
139
  "../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports, module2) {
140
140
  "use strict";
141
- var os2 = (0, import_chunk_WWAWV7DQ.__require)("os");
142
- var fs4 = (0, import_chunk_WWAWV7DQ.__require)("fs");
141
+ var os2 = (0, import_chunk_4VNS5WPM.__require)("os");
142
+ var fs4 = (0, import_chunk_4VNS5WPM.__require)("fs");
143
143
  var isDocker2 = require_is_docker();
144
144
  var isWsl2 = () => {
145
145
  if (process.platform !== "linux") {
@@ -164,13 +164,13 @@ var require_is_wsl = (0, import_chunk_WWAWV7DQ.__commonJS)({
164
164
  }
165
165
  }
166
166
  });
167
- var require_open = (0, import_chunk_WWAWV7DQ.__commonJS)({
167
+ var require_open = (0, import_chunk_4VNS5WPM.__commonJS)({
168
168
  "../../node_modules/.pnpm/open@7.4.2/node_modules/open/index.js"(exports, module2) {
169
169
  "use strict";
170
- var { promisify } = (0, import_chunk_WWAWV7DQ.__require)("util");
171
- var path = (0, import_chunk_WWAWV7DQ.__require)("path");
172
- var childProcess = (0, import_chunk_WWAWV7DQ.__require)("child_process");
173
- var fs4 = (0, import_chunk_WWAWV7DQ.__require)("fs");
170
+ var { promisify } = (0, import_chunk_4VNS5WPM.__require)("util");
171
+ var path = (0, import_chunk_4VNS5WPM.__require)("path");
172
+ var childProcess = (0, import_chunk_4VNS5WPM.__require)("child_process");
173
+ var fs4 = (0, import_chunk_4VNS5WPM.__require)("fs");
174
174
  var isWsl2 = require_is_wsl();
175
175
  var isDocker2 = require_is_docker();
176
176
  var pAccess = promisify(fs4.access);
@@ -305,26 +305,7 @@ var require_open = (0, import_chunk_WWAWV7DQ.__commonJS)({
305
305
  };
306
306
  }
307
307
  });
308
- var require_ansi_regex = (0, import_chunk_WWAWV7DQ.__commonJS)({
309
- "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module2) {
310
- "use strict";
311
- module2.exports = ({ onlyFirst = false } = {}) => {
312
- const pattern = [
313
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
314
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
315
- ].join("|");
316
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
317
- };
318
- }
319
- });
320
- var require_strip_ansi = (0, import_chunk_WWAWV7DQ.__commonJS)({
321
- "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module2) {
322
- "use strict";
323
- var ansiRegex = require_ansi_regex();
324
- module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string;
325
- }
326
- });
327
- var import_is_windows = (0, import_chunk_WWAWV7DQ.__toESM)(require_is_windows());
308
+ var import_is_windows = (0, import_chunk_4VNS5WPM.__toESM)(require_is_windows());
328
309
  var isDockerCached;
329
310
  function hasDockerEnv() {
330
311
  try {
@@ -379,9 +360,9 @@ var isWsl = () => {
379
360
  }
380
361
  };
381
362
  var is_wsl_default = import_node_process.default.env.__IS_WSL_TEST__ ? isWsl : isWsl();
382
- var import_new_github_issue_url = (0, import_chunk_WWAWV7DQ.__toESM)(require_new_github_issue_url());
383
- var import_open = (0, import_chunk_WWAWV7DQ.__toESM)(require_open());
384
- var import_strip_ansi = (0, import_chunk_WWAWV7DQ.__toESM)(require_strip_ansi());
363
+ var import_new_github_issue_url = (0, import_chunk_4VNS5WPM.__toESM)(require_new_github_issue_url());
364
+ var import_open = (0, import_chunk_4VNS5WPM.__toESM)(require_open());
365
+ var import_strip_ansi = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_ZSINRHD4.require_strip_ansi)());
385
366
  function getGitHubIssueUrl({
386
367
  title,
387
368
  user = "prisma",
@@ -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 chunk_S57RMXZW_exports = {};
20
- __export(chunk_S57RMXZW_exports, {
19
+ var chunk_GHHABGYW_exports = {};
20
+ __export(chunk_GHHABGYW_exports, {
21
21
  isYarnUsed: () => isYarnUsed
22
22
  });
23
- module.exports = __toCommonJS(chunk_S57RMXZW_exports);
24
- var import_chunk_VRT7T6MF = require("./chunk-VRT7T6MF.js");
23
+ module.exports = __toCommonJS(chunk_GHHABGYW_exports);
24
+ var import_chunk_BWGDP6B5 = require("./chunk-BWGDP6B5.js");
25
25
  async function isYarnUsed(baseDir) {
26
- const packageManager = await (0, import_chunk_VRT7T6MF.detect)({ cwd: baseDir, autoInstall: false, programmatic: true });
26
+ const packageManager = await (0, import_chunk_BWGDP6B5.detect)({ cwd: baseDir, autoInstall: false, programmatic: true });
27
27
  return packageManager === "yarn" || packageManager === "yarn@berry";
28
28
  }
@@ -26,25 +26,23 @@ 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_XGDTIBRB_exports = {};
30
- __export(chunk_XGDTIBRB_exports, {
29
+ var chunk_GIOVJ5SL_exports = {};
30
+ __export(chunk_GIOVJ5SL_exports, {
31
31
  GetDmmfError: () => GetDmmfError,
32
32
  getDMMF: () => getDMMF
33
33
  });
34
- module.exports = __toCommonJS(chunk_XGDTIBRB_exports);
35
- var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
- var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
37
- var import_chunk_SNL3TWM6 = require("./chunk-SNL3TWM6.js");
38
- var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
34
+ module.exports = __toCommonJS(chunk_GIOVJ5SL_exports);
35
+ var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
+ var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
+ var import_chunk_PQE76XRR = require("./chunk-PQE76XRR.js");
38
+ var import_chunk_LHESHKC2 = require("./chunk-LHESHKC2.js");
39
+ var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
39
40
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
40
- var import_chunk_DARNQRUA = require("./chunk-DARNQRUA.js");
41
- var import_chunk_ATFQZVBS = require("./chunk-ATFQZVBS.js");
42
- var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
41
+ var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
43
42
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
44
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
43
+ var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
45
44
  var import_debug = __toESM(require("@prisma/debug"));
46
- var import_fs = __toESM(require("fs"));
47
- var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_PFLLVWZX.require_function)());
45
+ var import_function = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_R6QH57HZ.require_function)());
48
46
  var debug = (0, import_debug.default)("prisma:getDMMF");
49
47
  var GetDmmfError = class extends Error {
50
48
  constructor(params) {
@@ -60,104 +58,73 @@ ${detailsHeader} ${message}`;
60
58
  }).exhaustive();
61
59
  const errorMessageWithContext = `${constructedErrorMessage}
62
60
  [Context: getDmmf]`;
63
- super((0, import_chunk_SNL3TWM6.addVersionDetailsToErrorMessage)(errorMessageWithContext));
61
+ super((0, import_chunk_PQE76XRR.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
62
  this.name = "GetDmmfError";
65
63
  }
66
64
  };
67
65
  async function getDMMF(options) {
68
- const debugErrorType = (0, import_chunk_6TXVGFQA.createDebugErrorType)(debug, "getDmmfWasm");
66
+ const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "getDmmfWasm");
69
67
  debug(`Using getDmmf Wasm`);
70
68
  const dmmfPipeline = (0, import_function.pipe)(
71
- (0, import_chunk_7MD6344A.tryCatch2)(
69
+ (0, import_chunk_5DBOS77Y.tryCatch)(
72
70
  () => {
73
- if (options.datamodel) {
74
- debug("Using given datamodel");
75
- return Promise.resolve(options.datamodel);
71
+ if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
72
+ debug("Triggering a Rust panic...");
73
+ import_chunk_LHESHKC2.prismaSchemaWasm.debug_panic();
76
74
  }
77
- debug(`Reading datamodel from the given datamodel path ${options.datamodelPath}`);
78
- return import_fs.default.promises.readFile(options.datamodelPath, { encoding: "utf-8" });
75
+ const params = JSON.stringify({
76
+ prismaSchema: options.datamodel,
77
+ noColor: Boolean(process.env.NO_COLOR)
78
+ });
79
+ const data = import_chunk_LHESHKC2.prismaSchemaWasm.get_dmmf(params);
80
+ return data;
79
81
  },
80
82
  (e) => ({
81
- type: "read-datamodel-path",
82
- reason: "Error while trying to read the datamodel path",
83
- error: e,
84
- datamodelPath: options.datamodelPath
83
+ type: "wasm-error",
84
+ reason: "(get-dmmf wasm)",
85
+ error: e
85
86
  })
86
87
  ),
87
- (0, import_chunk_7MD6344A.chainW2)((datamodel) => {
88
- return (0, import_function.pipe)(
89
- (0, import_chunk_7MD6344A.tryCatch)(
90
- () => {
91
- if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
92
- debug("Triggering a Rust panic...");
93
- import_chunk_DARNQRUA.prismaSchemaWasm.debug_panic();
94
- }
95
- const params = JSON.stringify({
96
- prismaSchema: datamodel,
97
- noColor: Boolean(process.env.NO_COLOR)
98
- });
99
- const data = import_chunk_DARNQRUA.prismaSchemaWasm.get_dmmf(params);
100
- return data;
101
- },
88
+ (0, import_chunk_5DBOS77Y.map)((result) => ({ result })),
89
+ (0, import_chunk_5DBOS77Y.chainW)(
90
+ ({ result }) => (
91
+ // NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
92
+ (0, import_chunk_5DBOS77Y.tryCatch)(
93
+ () => JSON.parse(result),
102
94
  (e) => ({
103
- type: "wasm-error",
104
- reason: "(get-dmmf wasm)",
95
+ type: "parse-json",
96
+ reason: "Unable to parse JSON",
105
97
  error: e
106
98
  })
107
- ),
108
- (0, import_chunk_7MD6344A.map)((result) => ({ result })),
109
- (0, import_chunk_7MD6344A.chainW)(
110
- ({ result }) => (
111
- // NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
112
- (0, import_chunk_7MD6344A.tryCatch)(
113
- () => JSON.parse(result),
114
- (e) => ({
115
- type: "parse-json",
116
- reason: "Unable to parse JSON",
117
- error: e
118
- })
119
- )
120
- )
121
- ),
122
- import_chunk_7MD6344A.fromEither
123
- );
124
- })
99
+ )
100
+ )
101
+ ),
102
+ import_chunk_5DBOS77Y.fromEither
125
103
  );
126
104
  const dmmfEither = await dmmfPipeline();
127
- if ((0, import_chunk_7MD6344A.isRight)(dmmfEither)) {
105
+ if ((0, import_chunk_5DBOS77Y.isRight)(dmmfEither)) {
128
106
  debug("dmmf data retrieved without errors in getDmmf Wasm");
129
107
  const { right: data } = dmmfEither;
130
108
  return Promise.resolve(data);
131
109
  }
132
- const error = (0, import_chunk_XKZ6CBLA.z)(dmmfEither.left).with({ type: "read-datamodel-path" }, (e) => {
133
- debugErrorType(e);
134
- return new GetDmmfError({
135
- _tag: "unparsed",
136
- message: `${e.error.message}
137
- Datamodel path: "${e.datamodelPath}"`,
138
- reason: e.reason
139
- });
140
- }).with({ type: "wasm-error" }, (e) => {
110
+ const error = (0, import_chunk_XKZ6CBLA.z)(dmmfEither.left).with({ type: "wasm-error" }, (e) => {
141
111
  debugErrorType(e);
142
- if ((0, import_chunk_ATFQZVBS.isWasmPanic)(e.error)) {
143
- const { message, stack } = (0, import_chunk_ATFQZVBS.getWasmError)(e.error);
144
- const panic = new import_chunk_ATFQZVBS.RustPanic(
112
+ if ((0, import_chunk_LMVSIVKQ.isWasmPanic)(e.error)) {
113
+ const { message, stack } = (0, import_chunk_LMVSIVKQ.getWasmError)(e.error);
114
+ const panic = new import_chunk_LMVSIVKQ.RustPanic(
145
115
  /* message */
146
116
  message,
147
117
  /* rustStack */
148
118
  stack,
149
119
  /* request */
150
120
  "@prisma/prisma-schema-wasm get_dmmf",
151
- "FMT_CLI",
152
- /* schemaPath */
153
- options.prismaPath,
154
- /* schema */
155
- (0, import_chunk_YRBRUREX.toMultipleSchemas)(options.datamodel)
121
+ "FMT_CLI"
122
+ /* FMT_CLI */
156
123
  );
157
124
  return panic;
158
125
  }
159
126
  const errorOutput = e.error.message;
160
- return new GetDmmfError((0, import_chunk_6TXVGFQA.parseQueryEngineError)({ errorOutput, reason: e.reason }));
127
+ return new GetDmmfError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
161
128
  }).with({ type: "parse-json" }, (e) => {
162
129
  debugErrorType(e);
163
130
  return new GetDmmfError({ _tag: "unparsed", message: e.error.message, reason: e.reason });
@@ -16,139 +16,14 @@ 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_L6GBFCXG_exports = {};
20
- __export(chunk_L6GBFCXG_exports, {
19
+ var chunk_HAGJ64PM_exports = {};
20
+ __export(chunk_HAGJ64PM_exports, {
21
21
  link: () => link
22
22
  });
23
- module.exports = __toCommonJS(chunk_L6GBFCXG_exports);
23
+ module.exports = __toCommonJS(chunk_HAGJ64PM_exports);
24
24
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
25
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
26
- var require_ansi_escapes = (0, import_chunk_WWAWV7DQ.__commonJS)({
27
- "../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js"(exports, module2) {
28
- "use strict";
29
- var ansiEscapes = module2.exports;
30
- module2.exports.default = ansiEscapes;
31
- var ESC = "\x1B[";
32
- var OSC = "\x1B]";
33
- var BEL = "\x07";
34
- var SEP = ";";
35
- var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
36
- ansiEscapes.cursorTo = (x, y) => {
37
- if (typeof x !== "number") {
38
- throw new TypeError("The `x` argument is required");
39
- }
40
- if (typeof y !== "number") {
41
- return ESC + (x + 1) + "G";
42
- }
43
- return ESC + (y + 1) + ";" + (x + 1) + "H";
44
- };
45
- ansiEscapes.cursorMove = (x, y) => {
46
- if (typeof x !== "number") {
47
- throw new TypeError("The `x` argument is required");
48
- }
49
- let ret = "";
50
- if (x < 0) {
51
- ret += ESC + -x + "D";
52
- } else if (x > 0) {
53
- ret += ESC + x + "C";
54
- }
55
- if (y < 0) {
56
- ret += ESC + -y + "A";
57
- } else if (y > 0) {
58
- ret += ESC + y + "B";
59
- }
60
- return ret;
61
- };
62
- ansiEscapes.cursorUp = (count = 1) => ESC + count + "A";
63
- ansiEscapes.cursorDown = (count = 1) => ESC + count + "B";
64
- ansiEscapes.cursorForward = (count = 1) => ESC + count + "C";
65
- ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D";
66
- ansiEscapes.cursorLeft = ESC + "G";
67
- ansiEscapes.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
68
- ansiEscapes.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
69
- ansiEscapes.cursorGetPosition = ESC + "6n";
70
- ansiEscapes.cursorNextLine = ESC + "E";
71
- ansiEscapes.cursorPrevLine = ESC + "F";
72
- ansiEscapes.cursorHide = ESC + "?25l";
73
- ansiEscapes.cursorShow = ESC + "?25h";
74
- ansiEscapes.eraseLines = (count) => {
75
- let clear = "";
76
- for (let i = 0; i < count; i++) {
77
- clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : "");
78
- }
79
- if (count) {
80
- clear += ansiEscapes.cursorLeft;
81
- }
82
- return clear;
83
- };
84
- ansiEscapes.eraseEndLine = ESC + "K";
85
- ansiEscapes.eraseStartLine = ESC + "1K";
86
- ansiEscapes.eraseLine = ESC + "2K";
87
- ansiEscapes.eraseDown = ESC + "J";
88
- ansiEscapes.eraseUp = ESC + "1J";
89
- ansiEscapes.eraseScreen = ESC + "2J";
90
- ansiEscapes.scrollUp = ESC + "S";
91
- ansiEscapes.scrollDown = ESC + "T";
92
- ansiEscapes.clearScreen = "\x1Bc";
93
- ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : (
94
- // 1. Erases the screen (Only done in case `2` is not supported)
95
- // 2. Erases the whole screen including scrollback buffer
96
- // 3. Moves cursor to the top-left position
97
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
98
- `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`
99
- );
100
- ansiEscapes.beep = BEL;
101
- ansiEscapes.link = (text, url) => {
102
- return [
103
- OSC,
104
- "8",
105
- SEP,
106
- SEP,
107
- url,
108
- BEL,
109
- text,
110
- OSC,
111
- "8",
112
- SEP,
113
- SEP,
114
- BEL
115
- ].join("");
116
- };
117
- ansiEscapes.image = (buffer, options = {}) => {
118
- let ret = `${OSC}1337;File=inline=1`;
119
- if (options.width) {
120
- ret += `;width=${options.width}`;
121
- }
122
- if (options.height) {
123
- ret += `;height=${options.height}`;
124
- }
125
- if (options.preserveAspectRatio === false) {
126
- ret += ";preserveAspectRatio=0";
127
- }
128
- return ret + ":" + buffer.toString("base64") + BEL;
129
- };
130
- ansiEscapes.iTerm = {
131
- setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
132
- annotation: (message, options = {}) => {
133
- let ret = `${OSC}1337;`;
134
- const hasX = typeof options.x !== "undefined";
135
- const hasY = typeof options.y !== "undefined";
136
- if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== "undefined")) {
137
- throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");
138
- }
139
- message = message.replace(/\|/g, "");
140
- ret += options.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation=";
141
- if (options.length > 0) {
142
- ret += (hasX ? [message, options.length, options.x, options.y] : [options.length, message]).join("|");
143
- } else {
144
- ret += message;
145
- }
146
- return ret + BEL;
147
- }
148
- };
149
- }
150
- });
151
- var require_has_flag = (0, import_chunk_WWAWV7DQ.__commonJS)({
25
+ var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
26
+ var require_has_flag = (0, import_chunk_4VNS5WPM.__commonJS)({
152
27
  "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module2) {
153
28
  "use strict";
154
29
  module2.exports = (flag, argv = process.argv) => {
@@ -159,11 +34,11 @@ var require_has_flag = (0, import_chunk_WWAWV7DQ.__commonJS)({
159
34
  };
160
35
  }
161
36
  });
162
- var require_supports_color = (0, import_chunk_WWAWV7DQ.__commonJS)({
37
+ var require_supports_color = (0, import_chunk_4VNS5WPM.__commonJS)({
163
38
  "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) {
164
39
  "use strict";
165
- var os = (0, import_chunk_WWAWV7DQ.__require)("os");
166
- var tty = (0, import_chunk_WWAWV7DQ.__require)("tty");
40
+ var os = (0, import_chunk_4VNS5WPM.__require)("os");
41
+ var tty = (0, import_chunk_4VNS5WPM.__require)("tty");
167
42
  var hasFlag = require_has_flag();
168
43
  var { env } = process;
169
44
  var forceColor;
@@ -259,7 +134,7 @@ var require_supports_color = (0, import_chunk_WWAWV7DQ.__commonJS)({
259
134
  };
260
135
  }
261
136
  });
262
- var require_supports_hyperlinks = (0, import_chunk_WWAWV7DQ.__commonJS)({
137
+ var require_supports_hyperlinks = (0, import_chunk_4VNS5WPM.__commonJS)({
263
138
  "../../node_modules/.pnpm/supports-hyperlinks@2.3.0/node_modules/supports-hyperlinks/index.js"(exports, module2) {
264
139
  "use strict";
265
140
  var supportsColor = require_supports_color();
@@ -339,29 +214,141 @@ var require_supports_hyperlinks = (0, import_chunk_WWAWV7DQ.__commonJS)({
339
214
  };
340
215
  }
341
216
  });
342
- var require_terminal_link = (0, import_chunk_WWAWV7DQ.__commonJS)({
343
- "../../node_modules/.pnpm/terminal-link@2.1.1/node_modules/terminal-link/index.js"(exports, module2) {
344
- "use strict";
345
- var ansiEscapes = require_ansi_escapes();
346
- var supportsHyperlinks = require_supports_hyperlinks();
347
- var terminalLink2 = (text, url, { target = "stdout", ...options } = {}) => {
348
- if (!supportsHyperlinks[target]) {
349
- if (options.fallback === false) {
350
- return text;
351
- }
352
- return typeof options.fallback === "function" ? options.fallback(text, url) : `${text} (\u200B${url}\u200B)`;
353
- }
354
- return ansiEscapes.link(text, url);
355
- };
356
- module2.exports = (text, url, options = {}) => terminalLink2(text, url, options);
357
- module2.exports.stderr = (text, url, options = {}) => terminalLink2(text, url, { target: "stderr", ...options });
358
- module2.exports.isSupported = supportsHyperlinks.stdout;
359
- module2.exports.stderr.isSupported = supportsHyperlinks.stderr;
217
+ var ESC = "\x1B[";
218
+ var OSC = "\x1B]";
219
+ var BEL = "\x07";
220
+ var SEP = ";";
221
+ var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
222
+ var ansiEscapes = {};
223
+ ansiEscapes.cursorTo = (x, y) => {
224
+ if (typeof x !== "number") {
225
+ throw new TypeError("The `x` argument is required");
360
226
  }
361
- });
362
- var import_terminal_link = (0, import_chunk_WWAWV7DQ.__toESM)(require_terminal_link());
227
+ if (typeof y !== "number") {
228
+ return ESC + (x + 1) + "G";
229
+ }
230
+ return ESC + (y + 1) + ";" + (x + 1) + "H";
231
+ };
232
+ ansiEscapes.cursorMove = (x, y) => {
233
+ if (typeof x !== "number") {
234
+ throw new TypeError("The `x` argument is required");
235
+ }
236
+ let returnValue = "";
237
+ if (x < 0) {
238
+ returnValue += ESC + -x + "D";
239
+ } else if (x > 0) {
240
+ returnValue += ESC + x + "C";
241
+ }
242
+ if (y < 0) {
243
+ returnValue += ESC + -y + "A";
244
+ } else if (y > 0) {
245
+ returnValue += ESC + y + "B";
246
+ }
247
+ return returnValue;
248
+ };
249
+ ansiEscapes.cursorUp = (count = 1) => ESC + count + "A";
250
+ ansiEscapes.cursorDown = (count = 1) => ESC + count + "B";
251
+ ansiEscapes.cursorForward = (count = 1) => ESC + count + "C";
252
+ ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D";
253
+ ansiEscapes.cursorLeft = ESC + "G";
254
+ ansiEscapes.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
255
+ ansiEscapes.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
256
+ ansiEscapes.cursorGetPosition = ESC + "6n";
257
+ ansiEscapes.cursorNextLine = ESC + "E";
258
+ ansiEscapes.cursorPrevLine = ESC + "F";
259
+ ansiEscapes.cursorHide = ESC + "?25l";
260
+ ansiEscapes.cursorShow = ESC + "?25h";
261
+ ansiEscapes.eraseLines = (count) => {
262
+ let clear = "";
263
+ for (let i = 0; i < count; i++) {
264
+ clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : "");
265
+ }
266
+ if (count) {
267
+ clear += ansiEscapes.cursorLeft;
268
+ }
269
+ return clear;
270
+ };
271
+ ansiEscapes.eraseEndLine = ESC + "K";
272
+ ansiEscapes.eraseStartLine = ESC + "1K";
273
+ ansiEscapes.eraseLine = ESC + "2K";
274
+ ansiEscapes.eraseDown = ESC + "J";
275
+ ansiEscapes.eraseUp = ESC + "1J";
276
+ ansiEscapes.eraseScreen = ESC + "2J";
277
+ ansiEscapes.scrollUp = ESC + "S";
278
+ ansiEscapes.scrollDown = ESC + "T";
279
+ ansiEscapes.clearScreen = "\x1Bc";
280
+ ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : (
281
+ // 1. Erases the screen (Only done in case `2` is not supported)
282
+ // 2. Erases the whole screen including scrollback buffer
283
+ // 3. Moves cursor to the top-left position
284
+ // More info: https://www.real-world-systems.com/docs/ANSIcode.html
285
+ `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`
286
+ );
287
+ ansiEscapes.beep = BEL;
288
+ ansiEscapes.link = (text, url) => {
289
+ return [
290
+ OSC,
291
+ "8",
292
+ SEP,
293
+ SEP,
294
+ url,
295
+ BEL,
296
+ text,
297
+ OSC,
298
+ "8",
299
+ SEP,
300
+ SEP,
301
+ BEL
302
+ ].join("");
303
+ };
304
+ ansiEscapes.image = (buffer, options = {}) => {
305
+ let returnValue = `${OSC}1337;File=inline=1`;
306
+ if (options.width) {
307
+ returnValue += `;width=${options.width}`;
308
+ }
309
+ if (options.height) {
310
+ returnValue += `;height=${options.height}`;
311
+ }
312
+ if (options.preserveAspectRatio === false) {
313
+ returnValue += ";preserveAspectRatio=0";
314
+ }
315
+ return returnValue + ":" + buffer.toString("base64") + BEL;
316
+ };
317
+ ansiEscapes.iTerm = {
318
+ setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
319
+ annotation: (message, options = {}) => {
320
+ let returnValue = `${OSC}1337;`;
321
+ const hasX = typeof options.x !== "undefined";
322
+ const hasY = typeof options.y !== "undefined";
323
+ if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== "undefined")) {
324
+ throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");
325
+ }
326
+ message = message.replace(/\|/g, "");
327
+ returnValue += options.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation=";
328
+ if (options.length > 0) {
329
+ returnValue += (hasX ? [message, options.length, options.x, options.y] : [options.length, message]).join("|");
330
+ } else {
331
+ returnValue += message;
332
+ }
333
+ return returnValue + BEL;
334
+ }
335
+ };
336
+ var ansi_escapes_default = ansiEscapes;
337
+ var import_supports_hyperlinks = (0, import_chunk_4VNS5WPM.__toESM)(require_supports_hyperlinks(), 1);
338
+ function terminalLink(text, url, { target = "stdout", ...options } = {}) {
339
+ if (!import_supports_hyperlinks.default[target]) {
340
+ if (options.fallback === false) {
341
+ return text;
342
+ }
343
+ return typeof options.fallback === "function" ? options.fallback(text, url) : `${text} (\u200B${url}\u200B)`;
344
+ }
345
+ return ansi_escapes_default.link(text, url);
346
+ }
347
+ terminalLink.isSupported = import_supports_hyperlinks.default.stdout;
348
+ terminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, { target: "stderr", ...options });
349
+ terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
363
350
  function link(url) {
364
- return (0, import_terminal_link.default)(url, url, {
351
+ return terminalLink(url, url, {
365
352
  fallback: (url2) => (0, import_chunk_PG5FDKSF.underline)(url2)
366
353
  });
367
354
  }