openapi-modifier
Version:
This package allows you to automate the process of modifying OpenAPI specifications by applying a set of predefined rules
64 lines (63 loc) • 2.23 kB
TypeScript
import { z } from 'zod';
import { LoggerI } from './logger/interface';
import { AnyPipelineRule } from './rules/generated-types';
declare const configSchema: z.ZodObject<{
logger: z.ZodOptional<z.ZodObject<{
verbose: z.ZodOptional<z.ZodBoolean>;
minLevel: z.ZodOptional<z.ZodNumber>;
}, "strict", z.ZodTypeAny, {
verbose?: boolean | undefined;
minLevel?: number | undefined;
}, {
verbose?: boolean | undefined;
minLevel?: number | undefined;
}>>;
input: z.ZodOptional<z.ZodString>;
output: z.ZodOptional<z.ZodString>;
pipeline: z.ZodOptional<z.ZodArray<z.ZodObject<{
rule: z.ZodString;
disabled: z.ZodOptional<z.ZodBoolean>;
config: z.ZodOptional<z.ZodAny>;
}, "strict", z.ZodTypeAny, {
rule: string;
disabled?: boolean | undefined;
config?: any;
}, {
rule: string;
disabled?: boolean | undefined;
config?: any;
}>, "many">>;
}, "strict", z.ZodTypeAny, {
logger?: {
verbose?: boolean | undefined;
minLevel?: number | undefined;
} | undefined;
input?: string | undefined;
output?: string | undefined;
pipeline?: {
rule: string;
disabled?: boolean | undefined;
config?: any;
}[] | undefined;
}, {
logger?: {
verbose?: boolean | undefined;
minLevel?: number | undefined;
} | undefined;
input?: string | undefined;
output?: string | undefined;
pipeline?: {
rule: string;
disabled?: boolean | undefined;
config?: any;
}[] | undefined;
}>;
type ConfigT = Omit<z.infer<typeof configSchema>, 'pipeline'> & {
pipeline?: Array<AnyPipelineRule>;
};
declare const defaultConfig: ConfigT;
declare const getAbsoluteConfigPath: (configPath: string) => string;
declare const findConfigFile: <T>(baseLogger: LoggerI, configPath: string) => Promise<T>;
declare const checkIsValidConfig: (baseLogger: LoggerI, config: any) => config is ConfigT;
declare const mergeConfigs: (baseLogger: LoggerI, ...configs: Array<Partial<ConfigT>>) => ConfigT;
export { defaultConfig, findConfigFile, getAbsoluteConfigPath, checkIsValidConfig, mergeConfigs, ConfigT };