import type { ApiAccessDto, DataApiEndpointDto, ExternalApplicationDetailDto } from '@/services/api/adminApi';
import { sanitizeFilename } from './themeExport';
export interface PostmanCollection {
    info: {
        _postman_id: string;
        name: string;
        description: string;
        schema: string;
    };
    auth: PostmanBearerAuth;
    item: PostmanFolder[];
    variable: PostmanVariable[];
}
export interface PostmanFolder {
    name: string;
    description?: string;
    item: PostmanRequest[];
}
export interface PostmanRequest {
    name: string;
    event?: PostmanEvent[];
    request: {
        method: string;
        header: {
            key: string;
            value: string;
            type: string;
        }[];
        url: {
            raw: string;
            host: string[];
            path: string[];
            variable?: {
                key: string;
                value: string;
                description?: string;
            }[];
            query?: {
                key: string;
                value: string;
                description?: string;
                disabled?: boolean;
            }[];
        };
        description?: string;
        body?: {
            mode: 'raw';
            raw: string;
            options: {
                raw: {
                    language: 'json';
                };
            };
        };
    };
    response: [];
}
export interface PostmanEvent {
    listen: 'prerequest' | 'test';
    script: {
        type: 'text/javascript';
        exec: string[];
    };
}
export interface PostmanBearerAuth {
    type: 'bearer';
    bearer: {
        key: 'token';
        value: string;
        type: 'string';
    }[];
}
export interface PostmanVariable {
    key: string;
    value: string;
    type: 'string';
    description?: string;
}
export interface PostmanEnvironment {
    id: string;
    name: string;
    values: {
        key: string;
        value: string;
        type: 'default' | 'secret';
        enabled: boolean;
    }[];
    _postman_variable_scope: 'environment';
}
export interface OpenApiDocument {
    openapi: string;
    info: {
        title: string;
        version: string;
        description: string;
    };
    servers: {
        url: string;
        description?: string;
    }[];
    paths: Record<string, Record<string, OpenApiOperation>>;
    components: {
        securitySchemes: {
            bearerAuth: {
                type: 'http';
                scheme: 'bearer';
                bearerFormat: 'JWT';
            };
        };
    };
    security: {
        bearerAuth: [];
    }[];
}
export interface OpenApiOperation {
    summary: string;
    description: string;
    operationId: string;
    tags: string[];
    parameters?: OpenApiParameter[];
    responses: Record<string, {
        description: string;
    }>;
}
export interface OpenApiParameter {
    name: string;
    in: 'path' | 'query' | 'header';
    required: boolean;
    schema: {
        type: string;
    };
    description?: string;
}
declare function splitHost(baseUrl: string): string[];
declare function extractPathParams(routeTemplate: string): string[];
declare function methodFromAccessType(accessType: string): string;
declare function effectiveRateLimit(endpoint: DataApiEndpointDto, accessMap: Map<string, ApiAccessDto>): number;
declare function effectiveMaxPageSize(endpoint: DataApiEndpointDto, accessMap: Map<string, ApiAccessDto>): number;
declare function groupByApplicationAndModule(endpoints: DataApiEndpointDto[]): Map<string, DataApiEndpointDto[]>;
export declare function buildPostmanCollection(app: ExternalApplicationDetailDto, endpoints: DataApiEndpointDto[], accessMap: Map<string, ApiAccessDto>): PostmanCollection;
export declare function buildPostmanEnvironment(app: ExternalApplicationDetailDto, baseUrl: string): PostmanEnvironment;
export declare function buildOpenApiSpec(app: ExternalApplicationDetailDto, endpoints: DataApiEndpointDto[], accessMap: Map<string, ApiAccessDto>, baseUrl: string): OpenApiDocument;
export declare function downloadJson(filename: string, content: unknown): void;
export declare function buildExportFilename(appName: string, kind: 'collection' | 'environment' | 'openapi'): string;
export { sanitizeFilename };
export declare function buildAccessMap(accessList: ApiAccessDto[]): Map<string, ApiAccessDto>;
export declare const __testing: {
    splitHost: typeof splitHost;
    extractPathParams: typeof extractPathParams;
    methodFromAccessType: typeof methodFromAccessType;
    groupByApplicationAndModule: typeof groupByApplicationAndModule;
    effectiveRateLimit: typeof effectiveRateLimit;
    effectiveMaxPageSize: typeof effectiveMaxPageSize;
};
//# sourceMappingURL=postmanExport.d.ts.map