export interface PostmanCollection { info: CollectionInfo; item: Item[]; variable?: Variable[]; auth?: Auth; event?: Event[]; } export interface CollectionInfo { name: string; _postman_id?: string; description?: string; schema: string; } export interface Item { name: string; item?: Item[]; request?: Request; response?: Response[]; event?: Event[]; protocolProfileBehavior?: Record; } export interface Request { method: HttpMethod; header?: Header[]; body?: Body; url: Url | string; auth?: Auth; description?: string; } export interface Response { name: string; originalRequest?: Request; status?: string; code?: number; _postman_previewlanguage?: string; header?: Header[]; cookie?: Cookie[]; body?: string; } export interface Variable { key: string; value: any; type?: string; disabled?: boolean; description?: string; } export interface Header { key: string; value: string; type?: string; disabled?: boolean; description?: string; } export interface Body { mode: 'raw' | 'urlencoded' | 'formdata' | 'file' | 'graphql'; raw?: string; urlencoded?: QueryParam[]; formdata?: FormDataParam[]; graphql?: GraphQLBody; options?: BodyOptions; } export interface Url { raw?: string; protocol?: string; host?: string[] | string; port?: string; path?: string[] | string; query?: QueryParam[]; hash?: string; variable?: UrlVariable[]; } export interface QueryParam { key: string; value?: string; disabled?: boolean; description?: string; } export interface FormDataParam extends QueryParam { type?: 'text' | 'file'; src?: string; } export interface UrlVariable { key: string; value?: string; description?: string; } export interface Auth { type: AuthType; bearer?: BearerAuth[]; basic?: BasicAuth[]; oauth2?: OAuth2Auth[]; apikey?: ApiKeyAuth[]; [key: string]: any; } export type AuthType = 'bearer' | 'basic' | 'oauth2' | 'apikey' | 'noauth' | 'digest' | 'hawk' | 'aws4' | 'ntlm'; export interface BearerAuth { key: string; value: string; type: string; } export interface BasicAuth { key: string; value: string; type: string; } export interface OAuth2Auth { key: string; value: any; type: string; } export interface ApiKeyAuth { key: string; value: string; type: string; } export interface Event { listen: string; script: Script; } export interface Script { type: string; exec?: string[]; } export interface Cookie { domain: string; expires?: string; httpOnly?: boolean; name: string; path: string; secure?: boolean; value: string; } export interface GraphQLBody { query: string; variables?: string; } export interface BodyOptions { raw?: { language?: string; }; } export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT'; export interface DefaultConfig { request: { method: HttpMethod; headers: Header[]; body: { raw: string; mode: Body['mode']; }; url: { protocol: string; host: string; path: string; }; }; response: { status: string; code: number; body: string; headers: Header[]; }; variable: { defaultValue: string; type: string; }; auth: { bearer: { token: string; }; basic: { username: string; password: string; }; apikey: { key: string; value: string; in: string; }; }; } export interface PipelineOptions { validateRequests?: boolean; validateVariables?: boolean; validateAuth?: boolean; validateResponses?: boolean; config?: DefaultConfig; } export interface ValidationResult { collection: PostmanCollection; stats: { totalItems: number; totalFolders: number; totalRequests: number; validatedVariables: number; addedVariables: number; validatedResponses: number; addedResponses: number; }; }