(config: NestedConfig | undefined, getId: () => string)
| 7 | * Generate nested configuration questions |
| 8 | */ |
| 9 | export function generateNestedConfigQuestions(config: NestedConfig | undefined, getId: () => string): Question[] { |
| 10 | const questions: Question[] = [] |
| 11 | |
| 12 | if (!config) |
| 13 | return questions |
| 14 | |
| 15 | // Field retrieval: top-level config values |
| 16 | const fieldRetrievalQuestions = [ |
| 17 | { |
| 18 | prompt: 'What is the environment in the configuration?', |
| 19 | groundTruth: config.environment, |
| 20 | answerType: 'string' as const, |
| 21 | }, |
| 22 | { |
| 23 | prompt: 'What is the database host?', |
| 24 | groundTruth: config.database.host, |
| 25 | answerType: 'string' as const, |
| 26 | }, |
| 27 | { |
| 28 | prompt: 'What is the database port?', |
| 29 | groundTruth: String(config.database.port), |
| 30 | answerType: 'integer' as const, |
| 31 | }, |
| 32 | { |
| 33 | prompt: 'What is the maximum connection pool size?', |
| 34 | groundTruth: String(config.database.pool.max), |
| 35 | answerType: 'integer' as const, |
| 36 | }, |
| 37 | { |
| 38 | prompt: 'What is the session duration?', |
| 39 | groundTruth: String(config.authentication.session.duration), |
| 40 | answerType: 'integer' as const, |
| 41 | }, |
| 42 | { |
| 43 | prompt: 'What is the minimum connection pool size?', |
| 44 | groundTruth: String(config.database.pool.min), |
| 45 | answerType: 'integer' as const, |
| 46 | }, |
| 47 | { |
| 48 | prompt: 'What is the connection pool idle timeout?', |
| 49 | groundTruth: String(config.database.pool.idleTimeout), |
| 50 | answerType: 'integer' as const, |
| 51 | }, |
| 52 | { |
| 53 | prompt: 'What is the database name?', |
| 54 | groundTruth: config.database.name, |
| 55 | answerType: 'string' as const, |
| 56 | }, |
| 57 | { |
| 58 | prompt: 'What is the session refresh threshold?', |
| 59 | groundTruth: String(config.authentication.session.refreshThreshold), |
| 60 | answerType: 'integer' as const, |
| 61 | }, |
| 62 | { |
| 63 | prompt: 'What is the version in the configuration?', |
| 64 | groundTruth: config.version, |
| 65 | answerType: 'string' as const, |
| 66 | }, |
no test coverage detected
searching dependent graphs…