(d)
| 250 | const refs = new Set(); |
| 251 | const tools = new Set(); |
| 252 | function walk(d) { |
| 253 | for (const entry of fs.readdirSync(d, { withFileTypes: true })) { |
| 254 | const p = path.join(d, entry.name); |
| 255 | if (entry.isDirectory()) { walk(p); continue; } |
| 256 | if (!entry.name.endsWith('-request.json')) continue; |
| 257 | let schema; |
| 258 | try { schema = JSON.parse(fs.readFileSync(p, 'utf8')); } |
| 259 | catch { continue; } |
| 260 | const required = Array.isArray(schema.required) ? schema.required : []; |
| 261 | if (required.includes('idempotency_key')) { |
| 262 | refs.add(path.relative(schemasDir, p)); |
| 263 | // Task name ↔ filename: "create-media-buy-request.json" → "create_media_buy" |
| 264 | tools.add(entry.name.replace(/-request\.json$/, '').replace(/-/g, '_')); |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | walk(schemasDir); |
| 269 | return { refs, tools }; |
| 270 | } |
no test coverage detected