@prisma/composer-cli 0.39.0-dev.7 → 0.39.0-dev.8

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 (72) hide show
  1. package/dist/app-converge-CVlo9uw2-BZDypKX6.mjs +88 -0
  2. package/dist/app-converge-CVlo9uw2-BZDypKX6.mjs.map +1 -0
  3. package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs +254 -0
  4. package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs.map +1 -0
  5. package/dist/{validate-environment-XwVDifWN-BdYUHyVF.mjs → deploy-Br1yvLe3.mjs} +204 -1010
  6. package/dist/deploy-Br1yvLe3.mjs.map +1 -0
  7. package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs +256 -0
  8. package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs.map +1 -0
  9. package/dist/dev-converge-worker.d.mts +1 -0
  10. package/dist/dev-converge-worker.mjs +143 -0
  11. package/dist/dev-converge-worker.mjs.map +1 -0
  12. package/dist/{dev-current-gQnmjB4V-DrQ4Zzbl.mjs → dev-current-ByY2RrbK-Cni2T65J.mjs} +12 -18
  13. package/dist/dev-current-ByY2RrbK-Cni2T65J.mjs.map +1 -0
  14. package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs +43 -0
  15. package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs.map +1 -0
  16. package/dist/{dist-CRSv_9L8.mjs → dist-C0OGaDnj.mjs} +4 -3
  17. package/dist/{dist-CRSv_9L8.mjs.map → dist-C0OGaDnj.mjs.map} +1 -1
  18. package/dist/errors-CVYwN2km.mjs +93 -0
  19. package/dist/errors-CVYwN2km.mjs.map +1 -0
  20. package/dist/{execute-deploy-destroy-DKbsBkqK-D8pniqZg.mjs → execute-deploy-destroy-D1jnaYqU-L5pBQMUx.mjs} +245 -244
  21. package/dist/execute-deploy-destroy-D1jnaYqU-L5pBQMUx.mjs.map +1 -0
  22. package/dist/{execute-dev-DVCWURmI-D91UZq1o.mjs → execute-dev-BP0Shlpd-C6-D196L.mjs} +422 -166
  23. package/dist/execute-dev-BP0Shlpd-C6-D196L.mjs.map +1 -0
  24. package/dist/{execute-dev-current-Dt_9srY2-D8mAcSv4.mjs → execute-dev-current-B792f_1m-7ZE6ulr0.mjs} +9 -6
  25. package/dist/{execute-dev-current-Dt_9srY2-D8mAcSv4.mjs.map → execute-dev-current-B792f_1m-7ZE6ulr0.mjs.map} +1 -1
  26. package/dist/{family-D52hWFMF-FfSJ5SN2.d.mts → family-DfwviKFj-CS1L-EvS.d.mts} +171 -69
  27. package/dist/family-DfwviKFj-CS1L-EvS.d.mts.map +1 -0
  28. package/dist/family.d.mts +1 -1
  29. package/dist/family.mjs +87 -137
  30. package/dist/family.mjs.map +1 -1
  31. package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs +58 -0
  32. package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs.map +1 -0
  33. package/dist/{list-deployed-CIaiiV_l.mjs → list-deployed-bMQ8GJVV.mjs} +5 -4
  34. package/dist/{list-deployed-CIaiiV_l.mjs.map → list-deployed-bMQ8GJVV.mjs.map} +1 -1
  35. package/dist/local-target-CZzICh5R.mjs +34 -0
  36. package/dist/local-target-CZzICh5R.mjs.map +1 -0
  37. package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs +56 -0
  38. package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs.map +1 -0
  39. package/dist/{redaction-CjMYXtGp-CYefSG9A.mjs → redaction-DY6eDC12-BrK1aSN5.mjs} +17 -256
  40. package/dist/redaction-DY6eDC12-BrK1aSN5.mjs.map +1 -0
  41. package/dist/result-CttmabB6.mjs +91 -0
  42. package/dist/result-CttmabB6.mjs.map +1 -0
  43. package/dist/rolldown-runtime-C7HZzL1F.mjs +26 -0
  44. package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs +287 -0
  45. package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs.map +1 -0
  46. package/dist/testing.d.mts +2 -42
  47. package/dist/testing.d.mts.map +1 -1
  48. package/dist/testing.mjs +2 -5
  49. package/dist/testing.mjs.map +1 -1
  50. package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs +983 -0
  51. package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs.map +1 -0
  52. package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs +15 -0
  53. package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs.map +1 -0
  54. package/package.json +7 -7
  55. package/src/exports/dev-converge-worker.ts +2 -0
  56. package/src/exports/testing.ts +1 -4
  57. package/dist/app-configuration-file-Bbfq5PR3-CYdGtitc.mjs +0 -137
  58. package/dist/app-configuration-file-Bbfq5PR3-CYdGtitc.mjs.map +0 -1
  59. package/dist/dev-current-gQnmjB4V-DrQ4Zzbl.mjs.map +0 -1
  60. package/dist/dev-environment-name-6eEr5PW8-kDiScOL8.mjs +0 -71
  61. package/dist/dev-environment-name-6eEr5PW8-kDiScOL8.mjs.map +0 -1
  62. package/dist/execute-deploy-destroy-DKbsBkqK-D8pniqZg.mjs.map +0 -1
  63. package/dist/execute-dev-DVCWURmI-D91UZq1o.mjs.map +0 -1
  64. package/dist/family-D52hWFMF-FfSJ5SN2.d.mts.map +0 -1
  65. package/dist/generate-dev-stack-BEpqJ3AH-B7o7JyER.mjs +0 -100
  66. package/dist/generate-dev-stack-BEpqJ3AH-B7o7JyER.mjs.map +0 -1
  67. package/dist/redaction-CjMYXtGp-CYefSG9A.mjs.map +0 -1
  68. package/dist/result-DlBttLS8.mjs +0 -234
  69. package/dist/result-DlBttLS8.mjs.map +0 -1
  70. package/dist/run-alchemy-BlYyc4Oh-BnFv0AaY.mjs +0 -302
  71. package/dist/run-alchemy-BlYyc4Oh-BnFv0AaY.mjs.map +0 -1
  72. package/dist/validate-environment-XwVDifWN-BdYUHyVF.mjs.map +0 -1
@@ -0,0 +1,88 @@
1
+ import { n as blindCast } from "./internal-error-Dfur7Zqt-B8J8e7ac.mjs";
2
+ import { t as CliStructuredError } from "./errors-CVYwN2km.mjs";
3
+ import { createRequire } from "node:module";
4
+ import * as fs from "node:fs";
5
+ import * as path from "node:path";
6
+ import { pathToFileURL } from "node:url";
7
+ //#region ../../0-framework/3-tooling/cli/dist/app-converge-CVlo9uw2.mjs
8
+ var version = "0.39.0-dev.8";
9
+ const ENTRY = "@prisma/composer/internal/converge";
10
+ const CONTRACT_ENTRY = "@prisma/composer/internal/converge-contract";
11
+ const ENTRY_FUNCTIONS = [
12
+ "lower",
13
+ "convergeInProcess",
14
+ "localTargetProviders",
15
+ "devState"
16
+ ];
17
+ /** The Composer version this host runs; every Composer package carries the same one. */
18
+ const HOST_COMPOSER_VERSION = version;
19
+ function unresolvable(appDir, detail, cause) {
20
+ return new CliStructuredError("DEPS.CONVERGE_UNRESOLVABLE", `Could not load the converge from the app's @prisma/composer in "${appDir}": ${detail}`, {
21
+ why: "`prisma deploy` and `prisma dev` run the lowering and Alchemy from the app's own install of @prisma/composer, so the app, its extensions and Alchemy share one copy of alchemy.",
22
+ fix: "Install @prisma/composer in the app, at the same version as the Composer the `prisma` CLI runs.",
23
+ ...cause === void 0 ? {} : { cause }
24
+ });
25
+ }
26
+ function installedVersion(require) {
27
+ try {
28
+ const parsed = JSON.parse(fs.readFileSync(require.resolve("@prisma/composer/package.json"), "utf8"));
29
+ return typeof parsed === "object" && parsed !== null && "version" in parsed && typeof parsed.version === "string" ? parsed.version : void 0;
30
+ } catch {
31
+ return;
32
+ }
33
+ }
34
+ async function importFile(appDir, file) {
35
+ try {
36
+ return await import(pathToFileURL(file).href);
37
+ } catch (error) {
38
+ throw unresolvable(appDir, `${file} failed to load: ${error instanceof Error ? error.message : String(error)}`, error);
39
+ }
40
+ }
41
+ function contractMismatch(host, app) {
42
+ const appVersion = app.version ?? "an unknown version";
43
+ const update = app.contract < host.contract ? `Upgrade the app's @prisma/composer to a release that speaks converge contract ${host.contract}, such as ${host.version}.` : `Upgrade the \`prisma\` CLI to one that runs a Composer speaking converge contract ${app.contract}, such as ${appVersion}.`;
44
+ return new CliStructuredError("DEPS.CONVERGE_CONTRACT_MISMATCH", `The app's @prisma/composer ${appVersion} speaks converge contract ${app.contract}, and the \`prisma\` CLI's Composer ${host.version} speaks contract ${host.contract}.`, {
45
+ why: "Deploy and dev call the app's @prisma/composer from the CLI's Composer, and the two read each other's data only when they speak the same converge contract.",
46
+ fix: update
47
+ });
48
+ }
49
+ /**
50
+ * The app's `lower`, converge and local target functions, from the install `appDir` resolves. Reads the app's
51
+ * converge contract before loading anything else. Raises
52
+ * DEPS.CONVERGE_UNRESOLVABLE when the install is missing or predates the
53
+ * in-process converge, and DEPS.CONVERGE_CONTRACT_MISMATCH when it speaks
54
+ * another contract than `host`.
55
+ */
56
+ async function loadAppConvergeEntry(appDir, host = {
57
+ contract: 2,
58
+ version: HOST_COMPOSER_VERSION
59
+ }) {
60
+ const require = createRequire(path.join(appDir, "package.json"));
61
+ let contractFile;
62
+ let file;
63
+ try {
64
+ contractFile = require.resolve(CONTRACT_ENTRY);
65
+ file = require.resolve(ENTRY);
66
+ } catch (error) {
67
+ throw unresolvable(appDir, `${CONTRACT_ENTRY} or ${ENTRY} does not resolve.`, error);
68
+ }
69
+ const { CONVERGE_CONTRACT: appContract } = await importFile(appDir, contractFile);
70
+ if (typeof appContract !== "number") throw unresolvable(appDir, `${contractFile} exports no CONVERGE_CONTRACT.`);
71
+ if (appContract !== host.contract) throw contractMismatch(host, {
72
+ contract: appContract,
73
+ version: installedVersion(require)
74
+ });
75
+ const entry = await importFile(appDir, file);
76
+ const missing = ENTRY_FUNCTIONS.filter((name) => typeof entry[name] !== "function");
77
+ if (missing.length > 0) throw unresolvable(appDir, `${file} exports no ${missing.join(", ")}.`);
78
+ return blindCast({
79
+ lower: entry["lower"],
80
+ converge: entry["convergeInProcess"],
81
+ localTargetProviders: entry["localTargetProviders"],
82
+ devState: entry["devState"]
83
+ });
84
+ }
85
+ //#endregion
86
+ export { loadAppConvergeEntry as t };
87
+
88
+ //# sourceMappingURL=app-converge-CVlo9uw2-BZDypKX6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-converge-CVlo9uw2-BZDypKX6.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/app-converge-CVlo9uw2.mjs"],"sourcesContent":["import \"./converge-contract-DrO0Jt9l.mjs\";\nimport { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region package.json\nvar version = \"0.39.0-dev.8\";\n//#endregion\n//#region src/app-converge.ts\nconst ENTRY = \"@prisma/composer/internal/converge\";\nconst CONTRACT_ENTRY = \"@prisma/composer/internal/converge-contract\";\nconst ENTRY_FUNCTIONS = [\n\t\"lower\",\n\t\"convergeInProcess\",\n\t\"localTargetProviders\",\n\t\"devState\"\n];\n/** The Composer version this host runs; every Composer package carries the same one. */\nconst HOST_COMPOSER_VERSION = version;\nfunction unresolvable(appDir, detail, cause) {\n\treturn new CliStructuredError(\"DEPS.CONVERGE_UNRESOLVABLE\", `Could not load the converge from the app's @prisma/composer in \"${appDir}\": ${detail}`, {\n\t\twhy: \"`prisma deploy` and `prisma dev` run the lowering and Alchemy from the app's own install of @prisma/composer, so the app, its extensions and Alchemy share one copy of alchemy.\",\n\t\tfix: \"Install @prisma/composer in the app, at the same version as the Composer the `prisma` CLI runs.\",\n\t\t...cause === void 0 ? {} : { cause }\n\t});\n}\nfunction installedVersion(require) {\n\ttry {\n\t\tconst parsed = JSON.parse(fs.readFileSync(require.resolve(\"@prisma/composer/package.json\"), \"utf8\"));\n\t\treturn typeof parsed === \"object\" && parsed !== null && \"version\" in parsed && typeof parsed.version === \"string\" ? parsed.version : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nasync function importFile(appDir, file) {\n\ttry {\n\t\treturn await import(pathToFileURL(file).href);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${file} failed to load: ${error instanceof Error ? error.message : String(error)}`, error);\n\t}\n}\nfunction contractMismatch(host, app) {\n\tconst appVersion = app.version ?? \"an unknown version\";\n\tconst update = app.contract < host.contract ? `Upgrade the app's @prisma/composer to a release that speaks converge contract ${host.contract}, such as ${host.version}.` : `Upgrade the \\`prisma\\` CLI to one that runs a Composer speaking converge contract ${app.contract}, such as ${appVersion}.`;\n\treturn new CliStructuredError(\"DEPS.CONVERGE_CONTRACT_MISMATCH\", `The app's @prisma/composer ${appVersion} speaks converge contract ${app.contract}, and the \\`prisma\\` CLI's Composer ${host.version} speaks contract ${host.contract}.`, {\n\t\twhy: \"Deploy and dev call the app's @prisma/composer from the CLI's Composer, and the two read each other's data only when they speak the same converge contract.\",\n\t\tfix: update\n\t});\n}\n/**\n* The app's `lower`, converge and local target functions, from the install `appDir` resolves. Reads the app's\n* converge contract before loading anything else. Raises\n* DEPS.CONVERGE_UNRESOLVABLE when the install is missing or predates the\n* in-process converge, and DEPS.CONVERGE_CONTRACT_MISMATCH when it speaks\n* another contract than `host`.\n*/\nasync function loadAppConvergeEntry(appDir, host = {\n\tcontract: 2,\n\tversion: HOST_COMPOSER_VERSION\n}) {\n\tconst require = createRequire(path.join(appDir, \"package.json\"));\n\tlet contractFile;\n\tlet file;\n\ttry {\n\t\tcontractFile = require.resolve(CONTRACT_ENTRY);\n\t\tfile = require.resolve(ENTRY);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${CONTRACT_ENTRY} or ${ENTRY} does not resolve.`, error);\n\t}\n\tconst { CONVERGE_CONTRACT: appContract } = await importFile(appDir, contractFile);\n\tif (typeof appContract !== \"number\") throw unresolvable(appDir, `${contractFile} exports no CONVERGE_CONTRACT.`);\n\tif (appContract !== host.contract) throw contractMismatch(host, {\n\t\tcontract: appContract,\n\t\tversion: installedVersion(require)\n\t});\n\tconst entry = await importFile(appDir, file);\n\tconst missing = ENTRY_FUNCTIONS.filter((name) => typeof entry[name] !== \"function\");\n\tif (missing.length > 0) throw unresolvable(appDir, `${file} exports no ${missing.join(\", \")}.`);\n\treturn blindCast({\n\t\tlower: entry[\"lower\"],\n\t\tconverge: entry[\"convergeInProcess\"],\n\t\tlocalTargetProviders: entry[\"localTargetProviders\"],\n\t\tdevState: entry[\"devState\"]\n\t});\n}\n//#endregion\nexport { loadAppConvergeEntry as t };\n\n//# sourceMappingURL=app-converge-CVlo9uw2.mjs.map"],"mappings":";;;;;;;AAQA,IAAI,UAAU;AAGd,MAAM,QAAQ;AACd,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;AACD;;AAEA,MAAM,wBAAwB;AAC9B,SAAS,aAAa,QAAQ,QAAQ,OAAO;CAC5C,OAAO,IAAI,mBAAmB,8BAA8B,mEAAmE,OAAO,KAAK,UAAU;EACpJ,KAAK;EACL,KAAK;EACL,GAAG,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM;CACpC,CAAC;AACF;AACA,SAAS,iBAAiB,SAAS;CAClC,IAAI;EACH,MAAM,SAAS,KAAK,MAAM,GAAG,aAAa,QAAQ,QAAQ,+BAA+B,GAAG,MAAM,CAAC;EACnG,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,aAAa,UAAU,OAAO,OAAO,YAAY,WAAW,OAAO,UAAU,KAAK;CAC3I,QAAQ;EACP;CACD;AACD;AACA,eAAe,WAAW,QAAQ,MAAM;CACvC,IAAI;EACH,OAAO,MAAM,OAAO,cAAc,IAAI,CAAC,CAAC;CACzC,SAAS,OAAO;EACf,MAAM,aAAa,QAAQ,GAAG,KAAK,mBAAmB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,KAAK,KAAK;CACtH;AACD;AACA,SAAS,iBAAiB,MAAM,KAAK;CACpC,MAAM,aAAa,IAAI,WAAW;CAClC,MAAM,SAAS,IAAI,WAAW,KAAK,WAAW,iFAAiF,KAAK,SAAS,YAAY,KAAK,QAAQ,KAAK,qFAAqF,IAAI,SAAS,YAAY,WAAW;CACpS,OAAO,IAAI,mBAAmB,mCAAmC,8BAA8B,WAAW,4BAA4B,IAAI,SAAS,sCAAsC,KAAK,QAAQ,mBAAmB,KAAK,SAAS,IAAI;EAC1O,KAAK;EACL,KAAK;CACN,CAAC;AACF;;;;;;;;AAQA,eAAe,qBAAqB,QAAQ,OAAO;CAClD,UAAU;CACV,SAAS;AACV,GAAG;CACF,MAAM,UAAU,cAAc,KAAK,KAAK,QAAQ,cAAc,CAAC;CAC/D,IAAI;CACJ,IAAI;CACJ,IAAI;EACH,eAAe,QAAQ,QAAQ,cAAc;EAC7C,OAAO,QAAQ,QAAQ,KAAK;CAC7B,SAAS,OAAO;EACf,MAAM,aAAa,QAAQ,GAAG,eAAe,MAAM,MAAM,qBAAqB,KAAK;CACpF;CACA,MAAM,EAAE,mBAAmB,gBAAgB,MAAM,WAAW,QAAQ,YAAY;CAChF,IAAI,OAAO,gBAAgB,UAAU,MAAM,aAAa,QAAQ,GAAG,aAAa,+BAA+B;CAC/G,IAAI,gBAAgB,KAAK,UAAU,MAAM,iBAAiB,MAAM;EAC/D,UAAU;EACV,SAAS,iBAAiB,OAAO;CAClC,CAAC;CACD,MAAM,QAAQ,MAAM,WAAW,QAAQ,IAAI;CAC3C,MAAM,UAAU,gBAAgB,QAAQ,SAAS,OAAO,MAAM,UAAU,UAAU;CAClF,IAAI,QAAQ,SAAS,GAAG,MAAM,aAAa,QAAQ,GAAG,KAAK,cAAc,QAAQ,KAAK,IAAI,EAAE,EAAE;CAC9F,OAAO,UAAU;EAChB,OAAO,MAAM;EACb,UAAU,MAAM;EAChB,sBAAsB,MAAM;EAC5B,UAAU,MAAM;CACjB,CAAC;AACF"}
@@ -0,0 +1,254 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ //#region ../../0-framework/3-tooling/cli/dist/composer-config-QKdY85G-.mjs
4
+ /**
5
+ * What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.
6
+ * It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.
7
+ */
8
+ const SECTION_FIX = "Write `composer: composer({ entry: './module.ts', extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.";
9
+ const MOVE_TO_SECTION_FIX = `${SECTION_FIX} If the project has a prisma-composer.config.ts, move its extensions and state into that section and delete the file.`;
10
+ const SECTION_IS_THE_ONLY_SOURCE = "Composer reads its configuration only from the `composer` section of prisma.config.ts.";
11
+ const DESCRIPTOR_FIX = "Use the descriptor the extension factory returns, unchanged, instead of building one by hand.";
12
+ const RETIRED_FILE_NAMES = [
13
+ "ts",
14
+ "mts",
15
+ "mjs",
16
+ "js"
17
+ ].map((extension) => `prisma-composer.config.${extension}`);
18
+ const sectionMissing = {
19
+ code: "CONFIG.SECTION_MISSING",
20
+ summary: "No loaded prisma.config.ts declares a `composer` section.",
21
+ why: `${SECTION_IS_THE_ONLY_SOURCE} A prisma-composer.config.ts file is no longer read.`,
22
+ fix: MOVE_TO_SECTION_FIX
23
+ };
24
+ /** What the generated stack file throws when the file it imports has no `composer` export. */
25
+ function noComposerExportMessage(configFile) {
26
+ return `${configFile} declares no \`composer\` section. Pass the prisma.config.ts that declares it.`;
27
+ }
28
+ function configFileMissing(file) {
29
+ return {
30
+ code: "CONFIG.FILE_MISSING",
31
+ summary: `${file} does not exist.`,
32
+ fix: "Pass the path of the prisma.config.ts that declares the `composer` section.",
33
+ where: file
34
+ };
35
+ }
36
+ /** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */
37
+ /** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */
38
+ function realPath(file) {
39
+ try {
40
+ return fs.realpathSync(file);
41
+ } catch {
42
+ return file;
43
+ }
44
+ }
45
+ function retiredFileFinding(configFile) {
46
+ const directory = path.dirname(realPath(configFile));
47
+ const found = RETIRED_FILE_NAMES.map((name) => path.join(directory, name)).find((file) => fs.existsSync(file));
48
+ if (found === void 0) return void 0;
49
+ return {
50
+ code: "CONFIG.FILE_RETIRED",
51
+ summary: `${found} is no longer read.`,
52
+ why: SECTION_IS_THE_ONLY_SOURCE,
53
+ fix: MOVE_TO_SECTION_FIX,
54
+ where: found
55
+ };
56
+ }
57
+ function isObject(value) {
58
+ return typeof value === "object" && value !== null && !Array.isArray(value);
59
+ }
60
+ function isExtensionDescriptor(value) {
61
+ return isObject(value) && typeof value["id"] === "string" && value["id"].length > 0 && isObject(value["nodes"]);
62
+ }
63
+ function isStateDescriptor(value) {
64
+ return isObject(value) && typeof value["extension"] === "string" && typeof value["create"] === "function";
65
+ }
66
+ const stateInvalid = {
67
+ code: "CONFIG.FIELD_INVALID",
68
+ summary: "`composer.state` must be a state descriptor with a string `extension` and a `create` function.",
69
+ fix: "Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.",
70
+ field: "state"
71
+ };
72
+ const SECTION_FIELDS = /* @__PURE__ */ new Set([
73
+ "entry",
74
+ "extensions",
75
+ "state",
76
+ "config",
77
+ "secrets"
78
+ ]);
79
+ const entryInvalid = {
80
+ code: "CONFIG.FIELD_INVALID",
81
+ summary: "`composer.entry` must be a non-empty string: the path to the module whose default export is the app.",
82
+ fix: "Set `entry` to that module's path, relative to prisma.config.ts, e.g. `entry: './module.ts'`.",
83
+ field: "entry"
84
+ };
85
+ /** Neither the section's `entry` nor an override names the module whose default export is the app. */
86
+ const entryMissing = {
87
+ code: "CONFIG.ENTRY_MISSING",
88
+ summary: "No entry module is set, so there is no app to load.",
89
+ why: "The entry is the module whose default export is the app root, built with appRoot(...).",
90
+ fix: "Set `entry: './module.ts'` in the `composer` section of prisma.config.ts, or pass `--entry <path>` (the `entry` input when calling @prisma/composer/control).",
91
+ field: "entry"
92
+ };
93
+ function unknownField(key) {
94
+ return {
95
+ code: "CONFIG.FIELD_UNKNOWN",
96
+ summary: `The \`composer\` section has no field \`${key}\`.`,
97
+ fix: key === "composer" ? "Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `entry`, `extensions`, `state`, `config` and `secrets`." : `Remove \`${key}\`. The section takes only \`entry\`, \`extensions\`, \`state\`, \`config\` and \`secrets\`.`,
98
+ field: key
99
+ };
100
+ }
101
+ function checkExtensions(value) {
102
+ if (!Array.isArray(value)) return {
103
+ extensions: [],
104
+ findings: [{
105
+ code: "CONFIG.FIELD_INVALID",
106
+ summary: "`composer.extensions` must be an array of extension descriptors.",
107
+ fix: "Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.",
108
+ field: "extensions"
109
+ }]
110
+ };
111
+ const findings = [];
112
+ const extensions = [];
113
+ const seen = /* @__PURE__ */ new Set();
114
+ for (const [index, entry] of value.entries()) {
115
+ const field = `extensions[${index}]`;
116
+ if (!isObject(entry)) {
117
+ findings.push({
118
+ code: "CONFIG.FIELD_INVALID",
119
+ summary: `\`composer.${field}\` must be an extension descriptor object.`,
120
+ fix: "Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.",
121
+ field
122
+ });
123
+ continue;
124
+ }
125
+ const id = entry["id"];
126
+ if (typeof id !== "string" || id.length === 0) findings.push({
127
+ code: "CONFIG.FIELD_INVALID",
128
+ summary: `\`composer.${field}.id\` must be a non-empty string (the extension package name).`,
129
+ fix: DESCRIPTOR_FIX,
130
+ field: `${field}.id`
131
+ });
132
+ else if (seen.has(id)) findings.push({
133
+ code: "CONFIG.EXTENSION_DUPLICATE",
134
+ summary: `Extension "${id}" is listed more than once in \`composer.extensions\`.`,
135
+ fix: `Remove the repeated "${id}" entry from \`extensions\`.`,
136
+ field: `${field}.id`
137
+ });
138
+ else seen.add(id);
139
+ if (!isObject(entry["nodes"])) findings.push({
140
+ code: "CONFIG.FIELD_INVALID",
141
+ summary: `\`composer.${field}.nodes\` must be an object (the node-ID → control registry).`,
142
+ fix: DESCRIPTOR_FIX,
143
+ field: `${field}.nodes`
144
+ });
145
+ if (isExtensionDescriptor(entry)) extensions.push(entry);
146
+ }
147
+ return {
148
+ findings,
149
+ extensions
150
+ };
151
+ }
152
+ function isAdapterList(value) {
153
+ return Array.isArray(value) && value.every((entry) => typeof entry === "function");
154
+ }
155
+ function checkAdapters(list, value) {
156
+ if (value === void 0) return [];
157
+ if (!Array.isArray(value)) return [{
158
+ code: "CONFIG.FIELD_INVALID",
159
+ summary: `\`composer.${list}\` must be an array of adapters.`,
160
+ fix: `Set \`${list}\` to a list of adapters, e.g. \`${list}: [dotenv(), environmentVariables()]\`, imported from '@prisma/composer/config'.`,
161
+ field: list
162
+ }];
163
+ return value.flatMap((entry, index) => typeof entry === "function" ? [] : [{
164
+ code: "CONFIG.FIELD_INVALID",
165
+ summary: `\`composer.${list}[${index}]\` must be an adapter: a function that receives the environment and returns its values.`,
166
+ fix: "Put an adapter here, e.g. `dotenv()`.",
167
+ field: `${list}[${index}]`
168
+ }]);
169
+ }
170
+ function checkFields(section) {
171
+ if (Object.hasOwn(section, "configPath")) return {
172
+ ok: false,
173
+ findings: [{
174
+ code: "CONFIG.FIELD_RETIRED",
175
+ summary: "`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.",
176
+ why: SECTION_IS_THE_ONLY_SOURCE,
177
+ fix: `Replace \`configPath\` with the section itself. ${MOVE_TO_SECTION_FIX}`,
178
+ field: "configPath"
179
+ }]
180
+ };
181
+ if (Object.hasOwn(section, "composer")) return {
182
+ ok: false,
183
+ findings: [unknownField("composer")]
184
+ };
185
+ const findings = Object.keys(section).filter((key) => !SECTION_FIELDS.has(key)).map(unknownField);
186
+ const checked = checkExtensions(section["extensions"]);
187
+ findings.push(...checked.findings);
188
+ const state = section["state"];
189
+ if (!isStateDescriptor(state)) findings.push(stateInvalid);
190
+ const entry = section["entry"];
191
+ const entryValid = entry === void 0 || typeof entry === "string" && entry.length > 0;
192
+ if (!entryValid) findings.push(entryInvalid);
193
+ const config = section["config"];
194
+ const secrets = section["secrets"];
195
+ findings.push(...checkAdapters("config", config), ...checkAdapters("secrets", secrets));
196
+ const [first, ...rest] = findings;
197
+ if (first === void 0 && isStateDescriptor(state) && entryValid && (config === void 0 || isAdapterList(config)) && (secrets === void 0 || isAdapterList(secrets))) return {
198
+ ok: true,
199
+ value: {
200
+ extensions: checked.extensions,
201
+ state,
202
+ ...entry === void 0 ? {} : { entry },
203
+ ...config === void 0 ? {} : { config },
204
+ ...secrets === void 0 ? {} : { secrets }
205
+ }
206
+ };
207
+ return {
208
+ ok: false,
209
+ findings: [first ?? stateInvalid, ...rest]
210
+ };
211
+ }
212
+ /**
213
+ * Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.
214
+ * Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.
215
+ */
216
+ function checkComposerSection(raw) {
217
+ if (!isObject(raw)) return {
218
+ ok: false,
219
+ findings: [{
220
+ code: "CONFIG.FIELD_INVALID",
221
+ summary: "The `composer` section of prisma.config.ts must be an object.",
222
+ fix: SECTION_FIX
223
+ }]
224
+ };
225
+ try {
226
+ return checkFields({ ...raw });
227
+ } catch (cause) {
228
+ return {
229
+ ok: false,
230
+ findings: [{
231
+ code: "CONFIG.FIELD_INVALID",
232
+ summary: "The `composer` section of prisma.config.ts could not be read.",
233
+ why: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,
234
+ fix: SECTION_FIX
235
+ }]
236
+ };
237
+ }
238
+ }
239
+ /**
240
+ * The whole check, shared by the section validator and the programmatic operations so both report the same findings in the same order: the retired file beside the declaring `configFile` (resolved through symlinks), then every field finding.
241
+ */
242
+ function checkComposerConfig(raw, configFile) {
243
+ const retired = retiredFileFinding(configFile);
244
+ const checked = checkComposerSection(raw);
245
+ if (retired === void 0) return checked;
246
+ return {
247
+ ok: false,
248
+ findings: checked.ok ? [retired] : [retired, ...checked.findings]
249
+ };
250
+ }
251
+ //#endregion
252
+ export { sectionMissing as a, noComposerExportMessage as i, configFileMissing as n, entryMissing as r, checkComposerConfig as t };
253
+
254
+ //# sourceMappingURL=composer-config-QKdY85G--CEXrb2Uc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer-config-QKdY85G--CEXrb2Uc.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-QKdY85G-.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/composer-config.ts\n/**\n* What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.\n* It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.\n*/\nconst SECTION_FIX = \"Write `composer: composer({ entry: './module.ts', extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.\";\nconst MOVE_TO_SECTION_FIX = `${SECTION_FIX} If the project has a prisma-composer.config.ts, move its extensions and state into that section and delete the file.`;\nconst SECTION_IS_THE_ONLY_SOURCE = \"Composer reads its configuration only from the `composer` section of prisma.config.ts.\";\nconst DESCRIPTOR_FIX = \"Use the descriptor the extension factory returns, unchanged, instead of building one by hand.\";\nconst RETIRED_FILE_NAMES = [\n\t\"ts\",\n\t\"mts\",\n\t\"mjs\",\n\t\"js\"\n].map((extension) => `prisma-composer.config.${extension}`);\nconst sectionMissing = {\n\tcode: \"CONFIG.SECTION_MISSING\",\n\tsummary: \"No loaded prisma.config.ts declares a `composer` section.\",\n\twhy: `${SECTION_IS_THE_ONLY_SOURCE} A prisma-composer.config.ts file is no longer read.`,\n\tfix: MOVE_TO_SECTION_FIX\n};\n/** What the generated stack file throws when the file it imports has no `composer` export. */\nfunction noComposerExportMessage(configFile) {\n\treturn `${configFile} declares no \\`composer\\` section. Pass the prisma.config.ts that declares it.`;\n}\nfunction configFileMissing(file) {\n\treturn {\n\t\tcode: \"CONFIG.FILE_MISSING\",\n\t\tsummary: `${file} does not exist.`,\n\t\tfix: \"Pass the path of the prisma.config.ts that declares the `composer` section.\",\n\t\twhere: file\n\t};\n}\n/** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */\n/** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */\nfunction realPath(file) {\n\ttry {\n\t\treturn fs.realpathSync(file);\n\t} catch {\n\t\treturn file;\n\t}\n}\nfunction retiredFileFinding(configFile) {\n\tconst directory = path.dirname(realPath(configFile));\n\tconst found = RETIRED_FILE_NAMES.map((name) => path.join(directory, name)).find((file) => fs.existsSync(file));\n\tif (found === void 0) return void 0;\n\treturn {\n\t\tcode: \"CONFIG.FILE_RETIRED\",\n\t\tsummary: `${found} is no longer read.`,\n\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\tfix: MOVE_TO_SECTION_FIX,\n\t\twhere: found\n\t};\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isExtensionDescriptor(value) {\n\treturn isObject(value) && typeof value[\"id\"] === \"string\" && value[\"id\"].length > 0 && isObject(value[\"nodes\"]);\n}\nfunction isStateDescriptor(value) {\n\treturn isObject(value) && typeof value[\"extension\"] === \"string\" && typeof value[\"create\"] === \"function\";\n}\nconst stateInvalid = {\n\tcode: \"CONFIG.FIELD_INVALID\",\n\tsummary: \"`composer.state` must be a state descriptor with a string `extension` and a `create` function.\",\n\tfix: \"Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.\",\n\tfield: \"state\"\n};\nconst SECTION_FIELDS = /* @__PURE__ */ new Set([\n\t\"entry\",\n\t\"extensions\",\n\t\"state\",\n\t\"config\",\n\t\"secrets\"\n]);\nconst entryInvalid = {\n\tcode: \"CONFIG.FIELD_INVALID\",\n\tsummary: \"`composer.entry` must be a non-empty string: the path to the module whose default export is the app.\",\n\tfix: \"Set `entry` to that module's path, relative to prisma.config.ts, e.g. `entry: './module.ts'`.\",\n\tfield: \"entry\"\n};\n/** Neither the section's `entry` nor an override names the module whose default export is the app. */\nconst entryMissing = {\n\tcode: \"CONFIG.ENTRY_MISSING\",\n\tsummary: \"No entry module is set, so there is no app to load.\",\n\twhy: \"The entry is the module whose default export is the app root, built with appRoot(...).\",\n\tfix: \"Set `entry: './module.ts'` in the `composer` section of prisma.config.ts, or pass `--entry <path>` (the `entry` input when calling @prisma/composer/control).\",\n\tfield: \"entry\"\n};\nfunction unknownField(key) {\n\treturn {\n\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`.`,\n\t\tfix: key === \"composer\" ? \"Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `entry`, `extensions`, `state`, `config` and `secrets`.\" : `Remove \\`${key}\\`. The section takes only \\`entry\\`, \\`extensions\\`, \\`state\\`, \\`config\\` and \\`secrets\\`.`,\n\t\tfield: key\n\t};\n}\nfunction checkExtensions(value) {\n\tif (!Array.isArray(value)) return {\n\t\textensions: [],\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"`composer.extensions` must be an array of extension descriptors.\",\n\t\t\tfix: \"Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.\",\n\t\t\tfield: \"extensions\"\n\t\t}]\n\t};\n\tconst findings = [];\n\tconst extensions = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const [index, entry] of value.entries()) {\n\t\tconst field = `extensions[${index}]`;\n\t\tif (!isObject(entry)) {\n\t\t\tfindings.push({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: `\\`composer.${field}\\` must be an extension descriptor object.`,\n\t\t\t\tfix: \"Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.\",\n\t\t\t\tfield\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst id = entry[\"id\"];\n\t\tif (typeof id !== \"string\" || id.length === 0) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.id\\` must be a non-empty string (the extension package name).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse if (seen.has(id)) findings.push({\n\t\t\tcode: \"CONFIG.EXTENSION_DUPLICATE\",\n\t\t\tsummary: `Extension \"${id}\" is listed more than once in \\`composer.extensions\\`.`,\n\t\t\tfix: `Remove the repeated \"${id}\" entry from \\`extensions\\`.`,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse seen.add(id);\n\t\tif (!isObject(entry[\"nodes\"])) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.nodes\\` must be an object (the node-ID → control registry).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.nodes`\n\t\t});\n\t\tif (isExtensionDescriptor(entry)) extensions.push(entry);\n\t}\n\treturn {\n\t\tfindings,\n\t\textensions\n\t};\n}\nfunction isAdapterList(value) {\n\treturn Array.isArray(value) && value.every((entry) => typeof entry === \"function\");\n}\nfunction checkAdapters(list, value) {\n\tif (value === void 0) return [];\n\tif (!Array.isArray(value)) return [{\n\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\tsummary: `\\`composer.${list}\\` must be an array of adapters.`,\n\t\tfix: `Set \\`${list}\\` to a list of adapters, e.g. \\`${list}: [dotenv(), environmentVariables()]\\`, imported from '@prisma/composer/config'.`,\n\t\tfield: list\n\t}];\n\treturn value.flatMap((entry, index) => typeof entry === \"function\" ? [] : [{\n\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\tsummary: `\\`composer.${list}[${index}]\\` must be an adapter: a function that receives the environment and returns its values.`,\n\t\tfix: \"Put an adapter here, e.g. `dotenv()`.\",\n\t\tfield: `${list}[${index}]`\n\t}]);\n}\nfunction checkFields(section) {\n\tif (Object.hasOwn(section, \"configPath\")) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_RETIRED\",\n\t\t\tsummary: \"`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.\",\n\t\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\t\tfix: `Replace \\`configPath\\` with the section itself. ${MOVE_TO_SECTION_FIX}`,\n\t\t\tfield: \"configPath\"\n\t\t}]\n\t};\n\tif (Object.hasOwn(section, \"composer\")) return {\n\t\tok: false,\n\t\tfindings: [unknownField(\"composer\")]\n\t};\n\tconst findings = Object.keys(section).filter((key) => !SECTION_FIELDS.has(key)).map(unknownField);\n\tconst checked = checkExtensions(section[\"extensions\"]);\n\tfindings.push(...checked.findings);\n\tconst state = section[\"state\"];\n\tif (!isStateDescriptor(state)) findings.push(stateInvalid);\n\tconst entry = section[\"entry\"];\n\tconst entryValid = entry === void 0 || typeof entry === \"string\" && entry.length > 0;\n\tif (!entryValid) findings.push(entryInvalid);\n\tconst config = section[\"config\"];\n\tconst secrets = section[\"secrets\"];\n\tfindings.push(...checkAdapters(\"config\", config), ...checkAdapters(\"secrets\", secrets));\n\tconst [first, ...rest] = findings;\n\tif (first === void 0 && isStateDescriptor(state) && entryValid && (config === void 0 || isAdapterList(config)) && (secrets === void 0 || isAdapterList(secrets))) return {\n\t\tok: true,\n\t\tvalue: {\n\t\t\textensions: checked.extensions,\n\t\t\tstate,\n\t\t\t...entry === void 0 ? {} : { entry },\n\t\t\t...config === void 0 ? {} : { config },\n\t\t\t...secrets === void 0 ? {} : { secrets }\n\t\t}\n\t};\n\treturn {\n\t\tok: false,\n\t\tfindings: [first ?? stateInvalid, ...rest]\n\t};\n}\n/**\n* Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.\n* Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.\n*/\nfunction checkComposerSection(raw) {\n\tif (!isObject(raw)) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: SECTION_FIX\n\t\t}]\n\t};\n\ttry {\n\t\treturn checkFields({ ...raw });\n\t} catch (cause) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tfindings: [{\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: SECTION_FIX\n\t\t\t}]\n\t\t};\n\t}\n}\n/**\n* The whole check, shared by the section validator and the programmatic operations so both report the same findings in the same order: the retired file beside the declaring `configFile` (resolved through symlinks), then every field finding.\n*/\nfunction checkComposerConfig(raw, configFile) {\n\tconst retired = retiredFileFinding(configFile);\n\tconst checked = checkComposerSection(raw);\n\tif (retired === void 0) return checked;\n\treturn {\n\t\tok: false,\n\t\tfindings: checked.ok ? [retired] : [retired, ...checked.findings]\n\t};\n}\n//#endregion\nexport { sectionMissing as a, noComposerExportMessage as i, configFileMissing as n, entryMissing as r, checkComposerConfig as t };\n\n//# sourceMappingURL=composer-config-QKdY85G-.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,cAAc;AACpB,MAAM,sBAAsB,GAAG,YAAY;AAC3C,MAAM,6BAA6B;AACnC,MAAM,iBAAiB;AACvB,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;AACD,CAAC,CAAC,KAAK,cAAc,0BAA0B,WAAW;AAC1D,MAAM,iBAAiB;CACtB,MAAM;CACN,SAAS;CACT,KAAK,GAAG,2BAA2B;CACnC,KAAK;AACN;;AAEA,SAAS,wBAAwB,YAAY;CAC5C,OAAO,GAAG,WAAW;AACtB;AACA,SAAS,kBAAkB,MAAM;CAChC,OAAO;EACN,MAAM;EACN,SAAS,GAAG,KAAK;EACjB,KAAK;EACL,OAAO;CACR;AACD;;;AAGA,SAAS,SAAS,MAAM;CACvB,IAAI;EACH,OAAO,GAAG,aAAa,IAAI;CAC5B,QAAQ;EACP,OAAO;CACR;AACD;AACA,SAAS,mBAAmB,YAAY;CACvC,MAAM,YAAY,KAAK,QAAQ,SAAS,UAAU,CAAC;CACnD,MAAM,QAAQ,mBAAmB,KAAK,SAAS,KAAK,KAAK,WAAW,IAAI,CAAC,CAAC,CAAC,MAAM,SAAS,GAAG,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