(schema: JSONSchema7)
| 3357 | } |
| 3358 | |
| 3359 | function collectPythonSessionEventExportedTypeNames(schema: JSONSchema7): Set<string> { |
| 3360 | const definitions = collectDefinitionCollections(schema as Record<string, unknown>); |
| 3361 | const definitionNames = new Set([...Object.keys(definitions.definitions), ...Object.keys(definitions.$defs)]); |
| 3362 | const code = generatePythonSessionEventsCode(schema); |
| 3363 | const exported = new Set<string>(); |
| 3364 | const symbolPattern = /^(?:class\s+([A-Za-z_]\w*)\b|([A-Za-z_]\w*)\s*=)/gm; |
| 3365 | let match: RegExpExecArray | null; |
| 3366 | |
| 3367 | while ((match = symbolPattern.exec(code)) !== null) { |
| 3368 | const name = match[1] ?? match[2]; |
| 3369 | if (definitionNames.has(name)) { |
| 3370 | exported.add(name); |
| 3371 | } |
| 3372 | } |
| 3373 | |
| 3374 | return exported; |
| 3375 | } |
| 3376 | |
| 3377 | function emitPyApiGroup( |
| 3378 | lines: string[], |
no test coverage detected
searching dependent graphs…