···11+/**
22+ * Detect if the current session is interactive based on TTY status and environment variables.
33+ * This is used as a fallback when the user doesn't explicitly set the interactive option.
44+ * @internal
55+ */
66+export function detectInteractiveSession(): boolean {
77+ return Boolean(
88+ process.stdin.isTTY &&
99+ process.stdout.isTTY &&
1010+ !process.env.CI &&
1111+ !process.env.NO_INTERACTIVE &&
1212+ !process.env.NO_INTERACTION,
1313+ );
1414+}
···991010import type { Output, UserOutput } from './output';
11111212-export interface UserConfig {
1212+export type UserConfig = {
1313 /**
1414 * Path to the config file. Set this value if you don't use the default
1515 * config file name, or it's not located in the project root.
···8181 * @deprecated use `input.watch` instead
8282 */
8383 watch?: boolean | number | Watch;
8484-}
8484+};
85858686export type Config = Omit<
8787 Required<UserConfig>,
+39
packages/openapi-ts/src/config/validate.ts
···11+import { ConfigError } from '~/error';
22+33+import type { Job } from './expand';
44+import { getInput } from './input';
55+import { getOutput } from './output';
66+77+export interface ValidationResult {
88+ errors: Array<ConfigError>;
99+ job: Job;
1010+}
1111+1212+export function validateJobs(
1313+ jobs: ReadonlyArray<Job>,
1414+): ReadonlyArray<ValidationResult> {
1515+ return jobs.map((job) => {
1616+ const errors: Array<ConfigError> = [];
1717+ const { config } = job;
1818+1919+ const inputs = getInput(config);
2020+ if (!inputs.length) {
2121+ errors.push(
2222+ new ConfigError(
2323+ 'missing input - which OpenAPI specification should we use to generate your output?',
2424+ ),
2525+ );
2626+ }
2727+2828+ const output = getOutput(config);
2929+ if (!output.path) {
3030+ errors.push(
3131+ new ConfigError(
3232+ 'missing output - where should we generate your output?',
3333+ ),
3434+ );
3535+ }
3636+3737+ return { errors, job };
3838+ });
3939+}