(path: string, output: FeishuBotAddedPayloadVerificationOutput)
| 2350 | } |
| 2351 | |
| 2352 | function writeBotAddedPayloadEvidenceFile(path: string, output: FeishuBotAddedPayloadVerificationOutput): void { |
| 2353 | const serialized = JSON.stringify(output); |
| 2354 | if (!output.valid) { |
| 2355 | throw new SmokeCliError({ |
| 2356 | code: "feishu.smoke.bot_added_payload_evidence_verification_failed", |
| 2357 | message: "Feishu bot-added payload evidence failed validation before writing.", |
| 2358 | issues: output.issues, |
| 2359 | reason: "verification_failed", |
| 2360 | }); |
| 2361 | } |
| 2362 | if (containsSecretLikeEvidence(serialized) || containsRawFeishuEvidenceIdentifier(serialized)) { |
| 2363 | throw new SmokeCliError({ |
| 2364 | code: "feishu.smoke.bot_added_payload_evidence_redaction_failed", |
| 2365 | message: "Feishu bot-added payload evidence contains unredacted sensitive values and was not written.", |
| 2366 | reason: "redaction_failed", |
| 2367 | }); |
| 2368 | } |
| 2369 | const directory = dirname(path); |
| 2370 | if (directory && directory !== ".") { |
| 2371 | mkdirSync(directory, { recursive: true }); |
| 2372 | } |
| 2373 | writeFileSync(path, `${JSON.stringify(output, null, 2)}\n`, "utf8"); |
| 2374 | } |
| 2375 | |
| 2376 | function summarizeSteps(input: { |
| 2377 | live: boolean; |
no test coverage detected