@prisma/composer-cli 0.36.0 → 0.37.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/{app-config-CErnR6NK-6QjHJ7q5.mjs → app-config-CErnR6NK-DnKH4Kqc.mjs} +2 -2
  2. package/dist/{app-config-CErnR6NK-6QjHJ7q5.mjs.map → app-config-CErnR6NK-DnKH4Kqc.mjs.map} +1 -1
  3. package/dist/app-configuration-file-CeJvBAti-Dk65W3Az.mjs +140 -0
  4. package/dist/app-configuration-file-CeJvBAti-Dk65W3Az.mjs.map +1 -0
  5. package/dist/{dev-current-Brb4qugP-BOI9FJdz.mjs → dev-current-D0Kn6Mf4-DaV3DWR6.mjs} +6 -6
  6. package/dist/{dev-current-Brb4qugP-BOI9FJdz.mjs.map → dev-current-D0Kn6Mf4-DaV3DWR6.mjs.map} +1 -1
  7. package/dist/{dev-environment-name-6eEr5PW8-lIZmJjfr.mjs → dev-environment-name-6eEr5PW8-DpdGjmTb.mjs} +3 -3
  8. package/dist/dev-environment-name-6eEr5PW8-DpdGjmTb.mjs.map +1 -0
  9. package/dist/{dist-B9-nLeho.mjs → dist-DizJD76s.mjs} +3 -6
  10. package/dist/{dist-B9-nLeho.mjs.map → dist-DizJD76s.mjs.map} +1 -1
  11. package/dist/{execute-deploy-destroy-CNt-xpE7-CMQCNQpY.mjs → execute-deploy-destroy-Dh1CQ9X6-XpXuMPxj.mjs} +62 -31
  12. package/dist/execute-deploy-destroy-Dh1CQ9X6-XpXuMPxj.mjs.map +1 -0
  13. package/dist/{execute-dev-BUk-XWBJ-DaB9ma8z.mjs → execute-dev-Bl-5Q-Av-DK5AoRw1.mjs} +93 -45
  14. package/dist/{execute-dev-BUk-XWBJ-DaB9ma8z.mjs.map → execute-dev-Bl-5Q-Av-DK5AoRw1.mjs.map} +1 -1
  15. package/dist/{execute-dev-current-BdEqeKAB-xCBBITAB.mjs → execute-dev-current-D3USgHJ4-frlaz_BC.mjs} +7 -7
  16. package/dist/{execute-dev-current-BdEqeKAB-xCBBITAB.mjs.map → execute-dev-current-D3USgHJ4-frlaz_BC.mjs.map} +1 -1
  17. package/dist/family.d.mts +2 -2
  18. package/dist/family.mjs +22 -5
  19. package/dist/family.mjs.map +1 -1
  20. package/dist/{generate-dev-stack-BkkU2HLE-Dek3CkAQ.mjs → generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs} +11 -5
  21. package/dist/generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs.map +1 -0
  22. package/dist/{list-deployed-B-N3imFH.mjs → list-deployed-B8aQ4KEm.mjs} +5 -5
  23. package/dist/list-deployed-B8aQ4KEm.mjs.map +1 -0
  24. package/dist/{family-B2JZ8O7U-P_rOUr4w.d.mts → redaction-Bf8FvTFH-M5hYsi--.d.mts} +368 -184
  25. package/dist/redaction-Bf8FvTFH-M5hYsi--.d.mts.map +1 -0
  26. package/dist/redaction-HnbkSFrK-BjFRb2aC.mjs +534 -0
  27. package/dist/redaction-HnbkSFrK-BjFRb2aC.mjs.map +1 -0
  28. package/dist/result-sR7PBi61.mjs +229 -0
  29. package/dist/result-sR7PBi61.mjs.map +1 -0
  30. package/dist/run-alchemy-OS_ix5g0-BzkuReFx.mjs +236 -0
  31. package/dist/run-alchemy-OS_ix5g0-BzkuReFx.mjs.map +1 -0
  32. package/dist/testing.d.mts +31 -2
  33. package/dist/testing.d.mts.map +1 -1
  34. package/dist/testing.mjs +8 -4
  35. package/dist/testing.mjs.map +1 -1
  36. package/dist/validate-environment-D_dECxgO-fg8lfCME.mjs +2513 -0
  37. package/dist/validate-environment-D_dECxgO-fg8lfCME.mjs.map +1 -0
  38. package/package.json +9 -9
  39. package/src/exports/testing.ts +3 -2
  40. package/dist/dev-environment-name-6eEr5PW8-lIZmJjfr.mjs.map +0 -1
  41. package/dist/execute-deploy-destroy-CNt-xpE7-CMQCNQpY.mjs.map +0 -1
  42. package/dist/family-B2JZ8O7U-P_rOUr4w.d.mts.map +0 -1
  43. package/dist/generate-dev-stack-BkkU2HLE-Dek3CkAQ.mjs.map +0 -1
  44. package/dist/list-deployed-B-N3imFH.mjs.map +0 -1
  45. package/dist/run-alchemy-Dl_MWw4g-DaWV9tkH.mjs +0 -667
  46. package/dist/run-alchemy-Dl_MWw4g-DaWV9tkH.mjs.map +0 -1
  47. package/dist/validate-environment-CEhUSEg2-ExABehBM.mjs +0 -1343
  48. package/dist/validate-environment-CEhUSEg2-ExABehBM.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction-Bf8FvTFH-M5hYsi--.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/errors.d.mts","../../../0-framework/0-foundation/foundation/dist/secret-CHOw4LBU.d.mts","../../../0-framework/0-foundation/foundation/dist/pointer-CyQZZugO.d.mts","../../../../node_modules/@standard-schema/spec/dist/index.d.ts","../../../0-framework/1-core/core/dist/graph-types-DRe9UUOp.d.mts","../../../0-framework/1-core/core/dist/app-config-Bf_y5R7o.d.mts","../../../0-framework/3-tooling/assemble/dist/index.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-Df-kx6UV.d.mts","../../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-BPnQtqnQ.d.mts","../../../0-framework/3-tooling/cli/dist/family-qagovuqK.d.mts","../../../0-framework/3-tooling/cli/dist/redaction-Bf8FvTFH.d.mts"],"x_google_ignoreList":[3],"mappings":";;;;;;;UACU,wBAAwB;WACvB;WACA;WACA;WACA;aACE;aACA;;WAEF;WACA,OAAO;WACP;;;;;;;;UAwBD;WACC;WACA;WACA;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;;;;;;;;;;;;cAoBG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;EACT,YAAY,6BAA6B,iBAA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;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;;;;iBAMF,YAAY,OAAO,UAAU,MAAM,gBAAgB,QAAQ,SAAO,YAAY;;;;;;UChQrF;WACC;WACA,mBAAmB;;UAEpB;WACC;WACA,gBAAgB;;;;;;KCJtB;WACM;;WAEA;WACA;;KAEN;WACM;WACA,MAAM;;WAEN;WACA,MAAM;WACN;WACA;;WAEA,OAAO,SAAS;;;cAGb;UACJ;;;;WAIC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;WAEA,YAAY,OAAO;;UAEpB;;;WAGC,SAAS;;WAET;;;;;iBAMM,eAAe,OAAO,aAAa,MAAM,gBAAgB,QAAQ,SAAO,eAAe;;;UAG9F;;WAEC,QAAQ;;WAER;;WAEA;;WAEA;;UAED;WACC;;WAEA;;WAEA;;WAEA;;WAEA;;UAED;WACC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAED;;WAEC;;WAEA;;WAEA;aACE;aACA;;;;iBAII,OAAO,OAAO,cAAc,QAAQ,SAAO,QAAQ;;iBAEnD,QAAQ,OAAO,eAAe,QAAQ,SAAO,YAAY;;;;;;;;;;;;UCvGhE;WACC,eAAe;WACf,YAAY;WACZ,eAAe;WACf,gBAAgB;;cAEb,gBAAgB;UACpB;;WAEC,aAAa;;WAEb,WAAW;;WAEX,qBAAqB;;;;;;UCnBtB;WACC;WACA;;;;;;cAMG;;EAEZ,YAAY,UAAU,SAAS;;EAE/B,IAAI,SAAS,SAAS;EACtB,UAAU;;;;;;EAMV,OAAO"}
@@ -0,0 +1,534 @@
1
+ import { i as CliStructuredError } from "./result-sR7PBi61.mjs";
2
+ import * as fs from "node:fs";
3
+ import * as path from "node:path";
4
+ //#region ../../0-framework/3-tooling/cli/dist/composer-config-DO_iG0iR.mjs
5
+ /**
6
+ * What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.
7
+ * It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.
8
+ */
9
+ const SECTION_FIX = "Write `composer: composer({ entry: './module.ts', extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.";
10
+ 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.`;
11
+ const SECTION_IS_THE_ONLY_SOURCE = "Composer reads its configuration only from the `composer` section of prisma.config.ts.";
12
+ const DESCRIPTOR_FIX = "Use the descriptor the extension factory returns, unchanged, instead of building one by hand.";
13
+ const RETIRED_FILE_NAMES = [
14
+ "ts",
15
+ "mts",
16
+ "mjs",
17
+ "js"
18
+ ].map((extension) => `prisma-composer.config.${extension}`);
19
+ const sectionMissing = {
20
+ code: "CONFIG.SECTION_MISSING",
21
+ summary: "No loaded prisma.config.ts declares a `composer` section.",
22
+ why: `${SECTION_IS_THE_ONLY_SOURCE} A prisma-composer.config.ts file is no longer read.`,
23
+ fix: MOVE_TO_SECTION_FIX
24
+ };
25
+ /** What the generated stack file throws when the file it imports has no `composer` export. */
26
+ function noComposerExportMessage(configFile) {
27
+ return `${configFile} declares no \`composer\` section. Pass the prisma.config.ts that declares it.`;
28
+ }
29
+ function configFileMissing(file) {
30
+ return {
31
+ code: "CONFIG.FILE_MISSING",
32
+ summary: `${file} does not exist.`,
33
+ fix: "Pass the path of the prisma.config.ts that declares the `composer` section.",
34
+ where: file
35
+ };
36
+ }
37
+ /** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */
38
+ /** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */
39
+ function realPath(file) {
40
+ try {
41
+ return fs.realpathSync(file);
42
+ } catch {
43
+ return file;
44
+ }
45
+ }
46
+ function retiredFileFinding(configFile) {
47
+ const directory = path.dirname(realPath(configFile));
48
+ const found = RETIRED_FILE_NAMES.map((name) => path.join(directory, name)).find((file) => fs.existsSync(file));
49
+ if (found === void 0) return void 0;
50
+ return {
51
+ code: "CONFIG.FILE_RETIRED",
52
+ summary: `${found} is no longer read.`,
53
+ why: SECTION_IS_THE_ONLY_SOURCE,
54
+ fix: MOVE_TO_SECTION_FIX,
55
+ where: found
56
+ };
57
+ }
58
+ function isObject(value) {
59
+ return typeof value === "object" && value !== null && !Array.isArray(value);
60
+ }
61
+ function isExtensionDescriptor(value) {
62
+ return isObject(value) && typeof value["id"] === "string" && value["id"].length > 0 && isObject(value["nodes"]);
63
+ }
64
+ function isStateDescriptor(value) {
65
+ return isObject(value) && typeof value["extension"] === "string" && typeof value["create"] === "function";
66
+ }
67
+ const stateInvalid = {
68
+ code: "CONFIG.FIELD_INVALID",
69
+ summary: "`composer.state` must be a state descriptor with a string `extension` and a `create` function.",
70
+ fix: "Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.",
71
+ field: "state"
72
+ };
73
+ const SECTION_FIELDS = /* @__PURE__ */ new Set([
74
+ "entry",
75
+ "extensions",
76
+ "state",
77
+ "config",
78
+ "secrets"
79
+ ]);
80
+ const entryInvalid = {
81
+ code: "CONFIG.FIELD_INVALID",
82
+ summary: "`composer.entry` must be a non-empty string: the path to the module whose default export is the app.",
83
+ fix: "Set `entry` to that module's path, relative to prisma.config.ts, e.g. `entry: './module.ts'`.",
84
+ field: "entry"
85
+ };
86
+ /** Neither the section's `entry` nor an override names the module whose default export is the app. */
87
+ const entryMissing = {
88
+ code: "CONFIG.ENTRY_MISSING",
89
+ summary: "No entry module is set, so there is no app to load.",
90
+ why: "The entry is the module whose default export is the app root, built with module(...).",
91
+ 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).",
92
+ field: "entry"
93
+ };
94
+ function unknownField(key) {
95
+ return {
96
+ code: "CONFIG.FIELD_UNKNOWN",
97
+ summary: `The \`composer\` section has no field \`${key}\`.`,
98
+ 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\`.`,
99
+ field: key
100
+ };
101
+ }
102
+ function checkExtensions(value) {
103
+ if (!Array.isArray(value)) return {
104
+ extensions: [],
105
+ findings: [{
106
+ code: "CONFIG.FIELD_INVALID",
107
+ summary: "`composer.extensions` must be an array of extension descriptors.",
108
+ fix: "Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.",
109
+ field: "extensions"
110
+ }]
111
+ };
112
+ const findings = [];
113
+ const extensions = [];
114
+ const seen = /* @__PURE__ */ new Set();
115
+ for (const [index, entry] of value.entries()) {
116
+ const field = `extensions[${index}]`;
117
+ if (!isObject(entry)) {
118
+ findings.push({
119
+ code: "CONFIG.FIELD_INVALID",
120
+ summary: `\`composer.${field}\` must be an extension descriptor object.`,
121
+ fix: "Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.",
122
+ field
123
+ });
124
+ continue;
125
+ }
126
+ const id = entry["id"];
127
+ if (typeof id !== "string" || id.length === 0) findings.push({
128
+ code: "CONFIG.FIELD_INVALID",
129
+ summary: `\`composer.${field}.id\` must be a non-empty string (the extension package name).`,
130
+ fix: DESCRIPTOR_FIX,
131
+ field: `${field}.id`
132
+ });
133
+ else if (seen.has(id)) findings.push({
134
+ code: "CONFIG.EXTENSION_DUPLICATE",
135
+ summary: `Extension "${id}" is listed more than once in \`composer.extensions\`.`,
136
+ fix: `Remove the repeated "${id}" entry from \`extensions\`.`,
137
+ field: `${field}.id`
138
+ });
139
+ else seen.add(id);
140
+ if (!isObject(entry["nodes"])) findings.push({
141
+ code: "CONFIG.FIELD_INVALID",
142
+ summary: `\`composer.${field}.nodes\` must be an object (the node-ID → control registry).`,
143
+ fix: DESCRIPTOR_FIX,
144
+ field: `${field}.nodes`
145
+ });
146
+ if (isExtensionDescriptor(entry)) extensions.push(entry);
147
+ }
148
+ return {
149
+ findings,
150
+ extensions
151
+ };
152
+ }
153
+ function isAdapterList(value) {
154
+ return Array.isArray(value) && value.every((entry) => typeof entry === "function");
155
+ }
156
+ function checkAdapters(list, value) {
157
+ if (value === void 0) return [];
158
+ if (!Array.isArray(value)) return [{
159
+ code: "CONFIG.FIELD_INVALID",
160
+ summary: `\`composer.${list}\` must be an array of adapters.`,
161
+ fix: `Set \`${list}\` to a list of adapters, e.g. \`${list}: [dotenv(), environmentVariables()]\`, imported from '@prisma/composer/config'.`,
162
+ field: list
163
+ }];
164
+ return value.flatMap((entry, index) => typeof entry === "function" ? [] : [{
165
+ code: "CONFIG.FIELD_INVALID",
166
+ summary: `\`composer.${list}[${index}]\` must be an adapter: a function that receives the environment and returns its values.`,
167
+ fix: "Put an adapter here, e.g. `dotenv()`.",
168
+ field: `${list}[${index}]`
169
+ }]);
170
+ }
171
+ function checkFields(section) {
172
+ if (Object.hasOwn(section, "configPath")) return {
173
+ ok: false,
174
+ findings: [{
175
+ code: "CONFIG.FIELD_RETIRED",
176
+ summary: "`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.",
177
+ why: SECTION_IS_THE_ONLY_SOURCE,
178
+ fix: `Replace \`configPath\` with the section itself. ${MOVE_TO_SECTION_FIX}`,
179
+ field: "configPath"
180
+ }]
181
+ };
182
+ if (Object.hasOwn(section, "composer")) return {
183
+ ok: false,
184
+ findings: [unknownField("composer")]
185
+ };
186
+ const findings = Object.keys(section).filter((key) => !SECTION_FIELDS.has(key)).map(unknownField);
187
+ const checked = checkExtensions(section["extensions"]);
188
+ findings.push(...checked.findings);
189
+ const state = section["state"];
190
+ if (!isStateDescriptor(state)) findings.push(stateInvalid);
191
+ const entry = section["entry"];
192
+ const entryValid = entry === void 0 || typeof entry === "string" && entry.length > 0;
193
+ if (!entryValid) findings.push(entryInvalid);
194
+ const config = section["config"];
195
+ const secrets = section["secrets"];
196
+ findings.push(...checkAdapters("config", config), ...checkAdapters("secrets", secrets));
197
+ const [first, ...rest] = findings;
198
+ if (first === void 0 && isStateDescriptor(state) && entryValid && (config === void 0 || isAdapterList(config)) && (secrets === void 0 || isAdapterList(secrets))) return {
199
+ ok: true,
200
+ value: {
201
+ extensions: checked.extensions,
202
+ state,
203
+ ...entry === void 0 ? {} : { entry },
204
+ ...config === void 0 ? {} : { config },
205
+ ...secrets === void 0 ? {} : { secrets }
206
+ }
207
+ };
208
+ return {
209
+ ok: false,
210
+ findings: [first ?? stateInvalid, ...rest]
211
+ };
212
+ }
213
+ /**
214
+ * Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.
215
+ * Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.
216
+ */
217
+ function checkComposerSection(raw) {
218
+ if (!isObject(raw)) return {
219
+ ok: false,
220
+ findings: [{
221
+ code: "CONFIG.FIELD_INVALID",
222
+ summary: "The `composer` section of prisma.config.ts must be an object.",
223
+ fix: SECTION_FIX
224
+ }]
225
+ };
226
+ try {
227
+ return checkFields({ ...raw });
228
+ } catch (cause) {
229
+ return {
230
+ ok: false,
231
+ findings: [{
232
+ code: "CONFIG.FIELD_INVALID",
233
+ summary: "The `composer` section of prisma.config.ts could not be read.",
234
+ why: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,
235
+ fix: SECTION_FIX
236
+ }]
237
+ };
238
+ }
239
+ }
240
+ /**
241
+ * 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.
242
+ */
243
+ function checkComposerConfig(raw, configFile) {
244
+ const retired = retiredFileFinding(configFile);
245
+ const checked = checkComposerSection(raw);
246
+ if (retired === void 0) return checked;
247
+ return {
248
+ ok: false,
249
+ findings: checked.ok ? [retired] : [retired, ...checked.findings]
250
+ };
251
+ }
252
+ //#endregion
253
+ //#region ../../0-framework/3-tooling/cli/dist/redaction-HnbkSFrK.mjs
254
+ const REDACTED = "[redacted]";
255
+ /** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */
256
+ const SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;
257
+ /**
258
+ * The credential-looking values in `variables`: text of eight characters or more under a name
259
+ * that looks like a credential's. The length limit keeps a one-letter placeholder from blanking
260
+ * every matching letter.
261
+ */
262
+ function credentialLookingValues(variables) {
263
+ return Object.entries(variables).flatMap(([name, value]) => SECRET_ENV_NAME.test(name) && typeof value === "string" && value.length >= 8 ? [value] : []);
264
+ }
265
+ /**
266
+ * Finds every secret in a text: one regular expression for all of them, built once. A match
267
+ * is the span of the longest secret that starts at a position, and spans that overlap are
268
+ * merged, so two overlapping secrets are hidden whole.
269
+ */
270
+ var SecretMatcher = class {
271
+ starts;
272
+ prefixes = /* @__PURE__ */ new Set();
273
+ longestPrefix;
274
+ constructor(values) {
275
+ const sorted = [...new Set(values)].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
276
+ this.starts = sorted.length === 0 ? void 0 : new RegExp(`(?=(${sorted.map((value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")}))`, "g");
277
+ for (const value of sorted) for (let length = 1; length < value.length; length++) this.prefixes.add(value.slice(0, length));
278
+ this.longestPrefix = Math.max(0, (sorted[0]?.length ?? 0) - 1);
279
+ }
280
+ /** The merged spans of every secret in `text`, in order, as `[start, end)`. */
281
+ spans(text) {
282
+ const spans = [];
283
+ if (this.starts === void 0) return spans;
284
+ for (const match of text.matchAll(this.starts)) {
285
+ const start = match.index;
286
+ const end = start + (match[1]?.length ?? 0);
287
+ const last = spans.at(-1);
288
+ if (last !== void 0 && start < last[1]) last[1] = Math.max(last[1], end);
289
+ else spans.push([start, end]);
290
+ }
291
+ return spans;
292
+ }
293
+ /** The length of the longest end of `text` that is the start, not the whole, of a secret. */
294
+ startOfSecretAtEnd(text) {
295
+ for (let length = Math.min(this.longestPrefix, text.length); length > 0; length--) if (this.prefixes.has(text.slice(text.length - length))) return length;
296
+ return 0;
297
+ }
298
+ /** `text` with each span replaced by `[redacted]`. */
299
+ redact(text) {
300
+ let out = "";
301
+ let from = 0;
302
+ for (const [start, end] of this.spans(text)) {
303
+ out += text.slice(from, start) + REDACTED;
304
+ from = end;
305
+ }
306
+ return from === 0 ? text : out + text.slice(from);
307
+ }
308
+ };
309
+ /** `text` with bearer and basic tokens, JWTs, the password in a URL, and `token=…`-style pairs replaced by `[redacted]`. */
310
+ function redactShapes(text) {
311
+ return text.replace(/\b(Bearer|Basic)\s+[\w.~+/=-]+/gi, `$1 ${REDACTED}`).replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]*/g, REDACTED).replace(/(\b[a-z][\w+.-]*:\/\/[^\s:/@]*:)[^\s/@]+@/gi, `$1${REDACTED}@`).replace(/\b((?:[\w-]*[_-])?(?:token|secret|password|passwd|api[_-]?key|access[_-]?key|private[_-]?key)["']?\s*[:=]\s*["']?)[^\s"',;&]+/gi, `$1${REDACTED}`);
312
+ }
313
+ /**
314
+ * The known secrets of one command: the values under the secrets keys the graph names, in the app
315
+ * secrets and the app configuration (ADR-0062). The app configuration file must not hold any of them.
316
+ */
317
+ var KnownSecrets = class {
318
+ #names = /* @__PURE__ */ new Map();
319
+ constructor(secrets = []) {
320
+ this.add(secrets);
321
+ }
322
+ /** Adds each secret whose value is not empty. A value already known keeps its first name. */
323
+ add(secrets) {
324
+ for (const { name, value } of secrets) if (value.length > 0 && !this.#names.has(value)) this.#names.set(value, name);
325
+ }
326
+ values() {
327
+ return new Set(this.#names.keys());
328
+ }
329
+ /**
330
+ * The name of a known secret `text` holds, or undefined. A secret of
331
+ * `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter
332
+ * one only when it is all of `text`.
333
+ */
334
+ nameIn(text) {
335
+ for (const [value, name] of this.#names) if (value.length >= 8 ? text.includes(value) : text === value) return name;
336
+ }
337
+ };
338
+ /**
339
+ * What one command hides from everything it prints, returns or reports (ADR-0062): its known
340
+ * secrets, and the credential-looking values, which only look like secrets by the name of the
341
+ * variable they are under. It starts with the credential-looking values of the process
342
+ * environment.
343
+ */
344
+ var SecretRedaction = class {
345
+ knownSecrets = new KnownSecrets();
346
+ credentialLooking = /* @__PURE__ */ new Set();
347
+ matcher;
348
+ constructor(env) {
349
+ this.addCredentialLookingValues(credentialLookingValues(env));
350
+ }
351
+ addKnownSecrets(secrets) {
352
+ this.knownSecrets.add(secrets);
353
+ }
354
+ addCredentialLookingValues(values) {
355
+ for (const value of values) if (value.length > 0) this.credentialLooking.add(value);
356
+ }
357
+ /** The known secrets and the credential-looking values, longest first. */
358
+ allValues() {
359
+ return [.../* @__PURE__ */ new Set([...this.knownSecrets.values(), ...this.credentialLooking])].sort((a, b) => b.length - a.length);
360
+ }
361
+ /** `text` with every known secret and credential-looking value replaced by `[redacted]` at any length, then bearer tokens, JWTs, URL passwords and `token=…` pairs. */
362
+ redact(text) {
363
+ const size = this.knownSecrets.values().size + this.credentialLooking.size;
364
+ if (this.matcher?.size !== size) this.matcher = {
365
+ size,
366
+ matcher: new SecretMatcher(this.allValues())
367
+ };
368
+ return redactShapes(this.matcher.matcher.redact(text));
369
+ }
370
+ };
371
+ /** The text under each name in `secretsKeys`, in the app configuration and in the app secrets, at any length. */
372
+ function valuesUnderSecretsKeys(configuration, secrets, secretsKeys) {
373
+ return secretsKeys.flatMap((name) => [configuration[name], secrets[name]].flatMap((value) => typeof value === "string" ? [{
374
+ name,
375
+ value
376
+ }] : []));
377
+ }
378
+ function redactData(value, redaction) {
379
+ if (typeof value === "string") return redaction.redact(value);
380
+ if (Array.isArray(value)) return value.map((member) => redactData(member, redaction));
381
+ if (typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype) return Object.fromEntries(Object.entries(value).map(([key, member]) => [key, redactData(member, redaction)]));
382
+ return value;
383
+ }
384
+ /**
385
+ * `error` with every value `redaction` hides removed from its summary, `why`, `fix` and every string in
386
+ * its `meta`. The code, severity, `where` and docs link are kept. The cause is dropped, because
387
+ * it holds the same text unredacted and a renderer may print it.
388
+ */
389
+ function redactError(error, redaction) {
390
+ return new CliStructuredError(error.code, redaction.redact(error.message), {
391
+ severity: error.severity,
392
+ ...error.why === void 0 ? {} : { why: redaction.redact(error.why) },
393
+ ...error.fix === void 0 ? {} : { fix: redaction.redact(error.fix) },
394
+ ...error.where === void 0 ? {} : { where: error.where },
395
+ ...error.meta === void 0 ? {} : { meta: Object.fromEntries(Object.entries(error.meta).map(([key, value]) => [key, redactData(value, redaction)])) },
396
+ ...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl }
397
+ });
398
+ }
399
+ function setOwn(error, name, value) {
400
+ Object.defineProperty(error, name, {
401
+ value,
402
+ writable: true,
403
+ configurable: true
404
+ });
405
+ }
406
+ const UNPRINTABLE = "A value was thrown that cannot be turned into text.";
407
+ function safeString(value) {
408
+ try {
409
+ return String(value);
410
+ } catch {
411
+ try {
412
+ return Object.prototype.toString.call(value);
413
+ } catch {
414
+ return UNPRINTABLE;
415
+ }
416
+ }
417
+ }
418
+ /**
419
+ * The error to rethrow in place of a thrown defect, with every secret removed from its message
420
+ * and stack, and from those of each error in its `cause` chain and in an `AggregateError`'s
421
+ * `errors`. A cause that is text or plain data becomes a redacted copy. Each error is redacted
422
+ * in place where it can be. One whose properties cannot change, such as a frozen error, is
423
+ * replaced by a new error with the redacted message, stack and cause. A thrown value that is not
424
+ * an `Error` becomes an `Error` whose message is its redacted text. Never throws: when reading
425
+ * the error fails, the result is a new `Error` holding the redacted text of what was thrown.
426
+ */
427
+ function redactThrown(thrown, redaction) {
428
+ try {
429
+ return thrown instanceof Error ? redactErrorChain(thrown, redaction, /* @__PURE__ */ new Map()) : new Error(redaction.redact(safeString(thrown)));
430
+ } catch {
431
+ return new Error(redaction.redact(safeString(thrown)));
432
+ }
433
+ }
434
+ function redactErrorChain(error, redaction, seen) {
435
+ const done = seen.get(error);
436
+ if (done !== void 0) return done;
437
+ seen.set(error, error);
438
+ const message = redaction.redact(typeof error.message === "string" ? error.message : safeString(error.message));
439
+ const stack = typeof error.stack === "string" ? redaction.redact(error.stack) : void 0;
440
+ const cause = error.cause instanceof Error ? redactErrorChain(error.cause, redaction, seen) : redactData(error.cause, redaction);
441
+ const members = error instanceof AggregateError ? error.errors.map((member) => member instanceof Error ? redactErrorChain(member, redaction, seen) : redactData(member, redaction)) : void 0;
442
+ try {
443
+ setOwn(error, "message", message);
444
+ if (stack !== void 0) setOwn(error, "stack", stack);
445
+ if (error.cause !== void 0) setOwn(error, "cause", cause);
446
+ if (members !== void 0) setOwn(error, "errors", members);
447
+ return error;
448
+ } catch {
449
+ const options = cause === void 0 ? void 0 : { cause };
450
+ const copy = members === void 0 ? new Error(message, options) : new AggregateError(members, message, options);
451
+ copy.name = error.name;
452
+ setOwn(copy, "stack", stack ?? `${error.name}: ${message}`);
453
+ seen.set(error, copy);
454
+ return copy;
455
+ }
456
+ }
457
+ /** `event` with every value `redaction` hides removed from the text it carries: a message, or a dev server's output line. */
458
+ function redactDevEvent(event, redaction) {
459
+ switch (event.kind) {
460
+ case "target-warning":
461
+ case "rebuild-failed":
462
+ case "watch-error":
463
+ case "stop-error": return {
464
+ ...event,
465
+ message: redaction.redact(event.message)
466
+ };
467
+ case "dev-server-output": return {
468
+ ...event,
469
+ line: redaction.redact(event.line)
470
+ };
471
+ default: return event;
472
+ }
473
+ }
474
+ /** `summary` with every value `redaction` hides removed from each entity's id, url and details. */
475
+ function redactSummary(summary, redaction) {
476
+ if (summary === void 0) return void 0;
477
+ return {
478
+ app: summary.app,
479
+ nodes: summary.nodes.map((node) => ({
480
+ address: node.address,
481
+ entities: node.entities.map((entity) => ({
482
+ ...entity,
483
+ id: redaction.redact(entity.id),
484
+ ...entity.url === void 0 ? {} : { url: redaction.redact(entity.url) },
485
+ ...entity.details === void 0 ? {} : { details: Object.fromEntries(Object.entries(entity.details).map(([key, value]) => [key, redaction.redact(value)])) }
486
+ }))
487
+ }))
488
+ };
489
+ }
490
+ function isHighSurrogate(code) {
491
+ return code >= 55296 && code <= 56319;
492
+ }
493
+ /**
494
+ * Redacts a stream of text chunk by chunk: every value in `values` becomes `[redacted]`, and
495
+ * overlapping values are hidden whole. It holds back only the end of the text that could still
496
+ * be part of a value: the longest end that could start one, or a match that a later value could
497
+ * extend. So a value split across two chunks is still replaced, and text that cannot start one,
498
+ * such as a prompt, is returned at once. It never splits a surrogate pair. `push` returns the
499
+ * text that is ready; `end` returns the rest.
500
+ */
501
+ var StreamRedactor = class {
502
+ held = "";
503
+ matcher;
504
+ constructor(values) {
505
+ this.matcher = new SecretMatcher(values);
506
+ }
507
+ push(chunk) {
508
+ const text = this.held + chunk;
509
+ const cut = text.length - this.matcher.startOfSecretAtEnd(text);
510
+ let out = "";
511
+ let from = 0;
512
+ let ready = cut;
513
+ for (const [start, end] of this.matcher.spans(text)) {
514
+ if (end > cut) {
515
+ ready = Math.min(cut, start);
516
+ break;
517
+ }
518
+ out += text.slice(from, start) + REDACTED;
519
+ from = end;
520
+ }
521
+ if (ready > from && ready < text.length && isHighSurrogate(text.charCodeAt(ready - 1))) ready -= 1;
522
+ this.held = text.slice(ready);
523
+ return out + text.slice(from, ready);
524
+ }
525
+ end() {
526
+ const text = this.held;
527
+ this.held = "";
528
+ return this.matcher.redact(text);
529
+ }
530
+ };
531
+ //#endregion
532
+ export { redactDevEvent as a, redactThrown as c, configFileMissing as d, entryMissing as f, credentialLookingValues as i, valuesUnderSecretsKeys as l, sectionMissing as m, SecretRedaction as n, redactError as o, noComposerExportMessage as p, StreamRedactor as r, redactSummary as s, KnownSecrets as t, checkComposerConfig as u };
533
+
534
+ //# sourceMappingURL=redaction-HnbkSFrK-BjFRb2aC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction-HnbkSFrK-BjFRb2aC.mjs","names":["#names"],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-DO_iG0iR.mjs","../../../0-framework/3-tooling/cli/dist/redaction-HnbkSFrK.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 module(...).\",\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-DO_iG0iR.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/redaction.ts\nconst REDACTED = \"[redacted]\";\n/** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */\nconst SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;\n/**\n* The credential-looking values in `variables`: text of eight characters or more under a name\n* that looks like a credential's. The length limit keeps a one-letter placeholder from blanking\n* every matching letter.\n*/\nfunction credentialLookingValues(variables) {\n\treturn Object.entries(variables).flatMap(([name, value]) => SECRET_ENV_NAME.test(name) && typeof value === \"string\" && value.length >= 8 ? [value] : []);\n}\n/**\n* Finds every secret in a text: one regular expression for all of them, built once. A match\n* is the span of the longest secret that starts at a position, and spans that overlap are\n* merged, so two overlapping secrets are hidden whole.\n*/\nvar SecretMatcher = class {\n\tstarts;\n\tprefixes = /* @__PURE__ */ new Set();\n\tlongestPrefix;\n\tconstructor(values) {\n\t\tconst sorted = [...new Set(values)].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);\n\t\tthis.starts = sorted.length === 0 ? void 0 : new RegExp(`(?=(${sorted.map((value) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")}))`, \"g\");\n\t\tfor (const value of sorted) for (let length = 1; length < value.length; length++) this.prefixes.add(value.slice(0, length));\n\t\tthis.longestPrefix = Math.max(0, (sorted[0]?.length ?? 0) - 1);\n\t}\n\t/** The merged spans of every secret in `text`, in order, as `[start, end)`. */\n\tspans(text) {\n\t\tconst spans = [];\n\t\tif (this.starts === void 0) return spans;\n\t\tfor (const match of text.matchAll(this.starts)) {\n\t\t\tconst start = match.index;\n\t\t\tconst end = start + (match[1]?.length ?? 0);\n\t\t\tconst last = spans.at(-1);\n\t\t\tif (last !== void 0 && start < last[1]) last[1] = Math.max(last[1], end);\n\t\t\telse spans.push([start, end]);\n\t\t}\n\t\treturn spans;\n\t}\n\t/** The length of the longest end of `text` that is the start, not the whole, of a secret. */\n\tstartOfSecretAtEnd(text) {\n\t\tfor (let length = Math.min(this.longestPrefix, text.length); length > 0; length--) if (this.prefixes.has(text.slice(text.length - length))) return length;\n\t\treturn 0;\n\t}\n\t/** `text` with each span replaced by `[redacted]`. */\n\tredact(text) {\n\t\tlet out = \"\";\n\t\tlet from = 0;\n\t\tfor (const [start, end] of this.spans(text)) {\n\t\t\tout += text.slice(from, start) + REDACTED;\n\t\t\tfrom = end;\n\t\t}\n\t\treturn from === 0 ? text : out + text.slice(from);\n\t}\n};\n/** `text` with each value in `values` replaced by `[redacted]`, at any length; an empty one is skipped. Overlapping values are hidden whole. */\nfunction redactValues(text, values) {\n\treturn new SecretMatcher(values).redact(text);\n}\n/** `text` with bearer and basic tokens, JWTs, the password in a URL, and `token=…`-style pairs replaced by `[redacted]`. */\nfunction redactShapes(text) {\n\treturn text.replace(/\\b(Bearer|Basic)\\s+[\\w.~+/=-]+/gi, `$1 ${REDACTED}`).replace(/\\beyJ[\\w-]+\\.[\\w-]+\\.[\\w-]*/g, REDACTED).replace(/(\\b[a-z][\\w+.-]*:\\/\\/[^\\s:/@]*:)[^\\s/@]+@/gi, `$1${REDACTED}@`).replace(/\\b((?:[\\w-]*[_-])?(?:token|secret|password|passwd|api[_-]?key|access[_-]?key|private[_-]?key)[\"']?\\s*[:=]\\s*[\"']?)[^\\s\"',;&]+/gi, `$1${REDACTED}`);\n}\n/**\n* `text` with the credential-looking values of `env` and the credential shapes replaced by\n* `[redacted]`. For a process that has no `SecretRedaction`; `SecretRedaction.redact` hides\n* the known secrets too.\n*/\nfunction redactCredentialLooking(text, env) {\n\treturn redactShapes(redactValues(text, credentialLookingValues(env)));\n}\n/**\n* The known secrets of one command: the values under the secrets keys the graph names, in the app\n* secrets and the app configuration (ADR-0062). The app configuration file must not hold any of them.\n*/\nvar KnownSecrets = class {\n\t#names = /* @__PURE__ */ new Map();\n\tconstructor(secrets = []) {\n\t\tthis.add(secrets);\n\t}\n\t/** Adds each secret whose value is not empty. A value already known keeps its first name. */\n\tadd(secrets) {\n\t\tfor (const { name, value } of secrets) if (value.length > 0 && !this.#names.has(value)) this.#names.set(value, name);\n\t}\n\tvalues() {\n\t\treturn new Set(this.#names.keys());\n\t}\n\t/**\n\t* The name of a known secret `text` holds, or undefined. A secret of\n\t* `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter\n\t* one only when it is all of `text`.\n\t*/\n\tnameIn(text) {\n\t\tfor (const [value, name] of this.#names) if (value.length >= 8 ? text.includes(value) : text === value) return name;\n\t}\n};\n/**\n* What one command hides from everything it prints, returns or reports (ADR-0062): its known\n* secrets, and the credential-looking values, which only look like secrets by the name of the\n* variable they are under. It starts with the credential-looking values of the process\n* environment.\n*/\nvar SecretRedaction = class {\n\tknownSecrets = new KnownSecrets();\n\tcredentialLooking = /* @__PURE__ */ new Set();\n\tmatcher;\n\tconstructor(env) {\n\t\tthis.addCredentialLookingValues(credentialLookingValues(env));\n\t}\n\taddKnownSecrets(secrets) {\n\t\tthis.knownSecrets.add(secrets);\n\t}\n\taddCredentialLookingValues(values) {\n\t\tfor (const value of values) if (value.length > 0) this.credentialLooking.add(value);\n\t}\n\t/** The known secrets and the credential-looking values, longest first. */\n\tallValues() {\n\t\treturn [.../* @__PURE__ */ new Set([...this.knownSecrets.values(), ...this.credentialLooking])].sort((a, b) => b.length - a.length);\n\t}\n\t/** `text` with every known secret and credential-looking value replaced by `[redacted]` at any length, then bearer tokens, JWTs, URL passwords and `token=…` pairs. */\n\tredact(text) {\n\t\tconst size = this.knownSecrets.values().size + this.credentialLooking.size;\n\t\tif (this.matcher?.size !== size) this.matcher = {\n\t\t\tsize,\n\t\t\tmatcher: new SecretMatcher(this.allValues())\n\t\t};\n\t\treturn redactShapes(this.matcher.matcher.redact(text));\n\t}\n};\n/** The text under each name in `secretsKeys`, in the app configuration and in the app secrets, at any length. */\nfunction valuesUnderSecretsKeys(configuration, secrets, secretsKeys) {\n\treturn secretsKeys.flatMap((name) => [configuration[name], secrets[name]].flatMap((value) => typeof value === \"string\" ? [{\n\t\tname,\n\t\tvalue\n\t}] : []));\n}\nfunction redactData(value, redaction) {\n\tif (typeof value === \"string\") return redaction.redact(value);\n\tif (Array.isArray(value)) return value.map((member) => redactData(member, redaction));\n\tif (typeof value === \"object\" && value !== null && Object.getPrototypeOf(value) === Object.prototype) return Object.fromEntries(Object.entries(value).map(([key, member]) => [key, redactData(member, redaction)]));\n\treturn value;\n}\n/**\n* `error` with every value `redaction` hides removed from its summary, `why`, `fix` and every string in\n* its `meta`. The code, severity, `where` and docs link are kept. The cause is dropped, because\n* it holds the same text unredacted and a renderer may print it.\n*/\nfunction redactError(error, redaction) {\n\treturn new CliStructuredError(error.code, redaction.redact(error.message), {\n\t\tseverity: error.severity,\n\t\t...error.why === void 0 ? {} : { why: redaction.redact(error.why) },\n\t\t...error.fix === void 0 ? {} : { fix: redaction.redact(error.fix) },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: Object.fromEntries(Object.entries(error.meta).map(([key, value]) => [key, redactData(value, redaction)])) },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl }\n\t});\n}\nfunction setOwn(error, name, value) {\n\tObject.defineProperty(error, name, {\n\t\tvalue,\n\t\twritable: true,\n\t\tconfigurable: true\n\t});\n}\nconst UNPRINTABLE = \"A value was thrown that cannot be turned into text.\";\nfunction safeString(value) {\n\ttry {\n\t\treturn String(value);\n\t} catch {\n\t\ttry {\n\t\t\treturn Object.prototype.toString.call(value);\n\t\t} catch {\n\t\t\treturn UNPRINTABLE;\n\t\t}\n\t}\n}\n/**\n* The error to rethrow in place of a thrown defect, with every secret removed from its message\n* and stack, and from those of each error in its `cause` chain and in an `AggregateError`'s\n* `errors`. A cause that is text or plain data becomes a redacted copy. Each error is redacted\n* in place where it can be. One whose properties cannot change, such as a frozen error, is\n* replaced by a new error with the redacted message, stack and cause. A thrown value that is not\n* an `Error` becomes an `Error` whose message is its redacted text. Never throws: when reading\n* the error fails, the result is a new `Error` holding the redacted text of what was thrown.\n*/\nfunction redactThrown(thrown, redaction) {\n\ttry {\n\t\treturn thrown instanceof Error ? redactErrorChain(thrown, redaction, /* @__PURE__ */ new Map()) : new Error(redaction.redact(safeString(thrown)));\n\t} catch {\n\t\treturn new Error(redaction.redact(safeString(thrown)));\n\t}\n}\nfunction redactErrorChain(error, redaction, seen) {\n\tconst done = seen.get(error);\n\tif (done !== void 0) return done;\n\tseen.set(error, error);\n\tconst message = redaction.redact(typeof error.message === \"string\" ? error.message : safeString(error.message));\n\tconst stack = typeof error.stack === \"string\" ? redaction.redact(error.stack) : void 0;\n\tconst cause = error.cause instanceof Error ? redactErrorChain(error.cause, redaction, seen) : redactData(error.cause, redaction);\n\tconst members = error instanceof AggregateError ? error.errors.map((member) => member instanceof Error ? redactErrorChain(member, redaction, seen) : redactData(member, redaction)) : void 0;\n\ttry {\n\t\tsetOwn(error, \"message\", message);\n\t\tif (stack !== void 0) setOwn(error, \"stack\", stack);\n\t\tif (error.cause !== void 0) setOwn(error, \"cause\", cause);\n\t\tif (members !== void 0) setOwn(error, \"errors\", members);\n\t\treturn error;\n\t} catch {\n\t\tconst options = cause === void 0 ? void 0 : { cause };\n\t\tconst copy = members === void 0 ? new Error(message, options) : new AggregateError(members, message, options);\n\t\tcopy.name = error.name;\n\t\tsetOwn(copy, \"stack\", stack ?? `${error.name}: ${message}`);\n\t\tseen.set(error, copy);\n\t\treturn copy;\n\t}\n}\n/** `event` with every value `redaction` hides removed from the text it carries: a message, or a dev server's output line. */\nfunction redactDevEvent(event, redaction) {\n\tswitch (event.kind) {\n\t\tcase \"target-warning\":\n\t\tcase \"rebuild-failed\":\n\t\tcase \"watch-error\":\n\t\tcase \"stop-error\": return {\n\t\t\t...event,\n\t\t\tmessage: redaction.redact(event.message)\n\t\t};\n\t\tcase \"dev-server-output\": return {\n\t\t\t...event,\n\t\t\tline: redaction.redact(event.line)\n\t\t};\n\t\tdefault: return event;\n\t}\n}\n/** `summary` with every value `redaction` hides removed from each entity's id, url and details. */\nfunction redactSummary(summary, redaction) {\n\tif (summary === void 0) return void 0;\n\treturn {\n\t\tapp: summary.app,\n\t\tnodes: summary.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities.map((entity) => ({\n\t\t\t\t...entity,\n\t\t\t\tid: redaction.redact(entity.id),\n\t\t\t\t...entity.url === void 0 ? {} : { url: redaction.redact(entity.url) },\n\t\t\t\t...entity.details === void 0 ? {} : { details: Object.fromEntries(Object.entries(entity.details).map(([key, value]) => [key, redaction.redact(value)])) }\n\t\t\t}))\n\t\t}))\n\t};\n}\nfunction isHighSurrogate(code) {\n\treturn code >= 55296 && code <= 56319;\n}\n/**\n* Redacts a stream of text chunk by chunk: every value in `values` becomes `[redacted]`, and\n* overlapping values are hidden whole. It holds back only the end of the text that could still\n* be part of a value: the longest end that could start one, or a match that a later value could\n* extend. So a value split across two chunks is still replaced, and text that cannot start one,\n* such as a prompt, is returned at once. It never splits a surrogate pair. `push` returns the\n* text that is ready; `end` returns the rest.\n*/\nvar StreamRedactor = class {\n\theld = \"\";\n\tmatcher;\n\tconstructor(values) {\n\t\tthis.matcher = new SecretMatcher(values);\n\t}\n\tpush(chunk) {\n\t\tconst text = this.held + chunk;\n\t\tconst cut = text.length - this.matcher.startOfSecretAtEnd(text);\n\t\tlet out = \"\";\n\t\tlet from = 0;\n\t\tlet ready = cut;\n\t\tfor (const [start, end] of this.matcher.spans(text)) {\n\t\t\tif (end > cut) {\n\t\t\t\tready = Math.min(cut, start);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tout += text.slice(from, start) + REDACTED;\n\t\t\tfrom = end;\n\t\t}\n\t\tif (ready > from && ready < text.length && isHighSurrogate(text.charCodeAt(ready - 1))) ready -= 1;\n\t\tthis.held = text.slice(ready);\n\t\treturn out + text.slice(from, ready);\n\t}\n\tend() {\n\t\tconst text = this.held;\n\t\tthis.held = \"\";\n\t\treturn this.matcher.redact(text);\n\t}\n};\n//#endregion\nexport { redactCredentialLooking as a, redactSummary as c, credentialLookingValues as i, redactThrown as l, SecretRedaction as n, redactDevEvent as o, StreamRedactor as r, redactError as s, KnownSecrets as t, valuesUnderSecretsKeys as u };\n\n//# sourceMappingURL=redaction-HnbkSFrK.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,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