import type { REDOCLY_ROUTE_RBAC, REDOCLY_TEAMS_RBAC, RbacScopeItems } from '@redocly/config';
export type App = {
    id: string;
    name: string;
    description?: string;
    callbackUrl?: string;
    attributes?: Attributes;
    clientId?: string;
    createdAt: string;
    lastModifiedAt?: string;
    scopes?: string[];
    apiProductIds?: string[];
    credentials?: Credential[];
    supportsLogs: boolean;
    canCreateKey: boolean;
};
export type ExpandedApp = {
    credentials: Credential[];
    _adapterIds?: string[];
} & App;
export type CatalogApiProduct = {
    [REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
    [REDOCLY_ROUTE_RBAC]?: {
        slug?: string;
        fsPath?: string;
    };
};
export type ApiProduct = {
    id: string;
    name: string;
    description?: string;
    attributes?: Attributes;
    createdAt?: string;
    lastModifiedAt?: string;
    approvalType?: 'manual' | 'auto';
    scopes?: string[];
};
export type ApprovalStatus = 'approved' | 'revoked' | 'pending';
export type ProductStatus = Pick<ApiProduct, 'id' | 'name'> & {
    status: ApprovalStatus;
};
export type Credential = {
    id: string;
    expiresAt: string;
    issuedAt: string;
    clientId?: string;
    clientSecret?: string;
    attributes: Attributes;
    status: ApprovalStatus;
    stage?: string;
    scopes?: string[];
    apiProductIds?: string[];
    apiProductsStatus: ProductStatus[];
    canBeRolled: boolean;
    canBeRevoked: boolean;
    valueToUseInHeader?: 'clientId' | 'clientSecret';
};
export type CredentialInput = Partial<Pick<Credential, 'clientId' | 'clientSecret' | 'attributes' | 'scopes' | 'expiresAt'>> & Required<Pick<Credential, 'apiProductIds'>>;
export type Attributes = Record<string, string>;
export type Paginated<T> = {
    data: T[];
    total: number;
    limit?: number;
    offset?: number;
};
export type PaginationOptions = {
    limit?: number;
    offset?: number;
};
export type Adapter = {
    adapterId: string;
    stage?: string;
    getApiProducts: (pagination?: PaginationOptions) => Promise<Paginated<ApiProduct>>;
    getApps: (pagination?: PaginationOptions) => Promise<Paginated<App>>;
    getApp: (appId: string) => Promise<ExpandedApp>;
    createApp: (app: App) => Promise<App>;
    updateApp: (appId: string, app: Partial<App>) => Promise<App | undefined>;
    deleteApp: (appId: string) => Promise<void>;
    createCredential: (appId: string, credential: CredentialInput) => Promise<Credential>;
    updateCredential: (appId: string, credentialId: string, credential: CredentialInput) => Promise<Credential>;
    deleteCredential: (appId: string, credentialId: string) => Promise<Credential>;
    getAppLogs: (appId: string, params: LogsParams) => Promise<Paginated<Log>>;
    getAppLogDetails: (appId: string, logId: string) => Promise<LogDetails>;
    getApiAccessStatus: (appId: string, expand?: boolean) => Promise<ApiAccessStatus>;
};
export type UserClaims = Record<string, string> & {
    email: string;
    authCookie: string;
};
export type LogsParams = {
    page?: number;
    size?: number;
    fromDate?: number;
    toDate?: number;
    order?: 'ASC' | 'DESC';
    filters: {
        apis?: string[];
        statusCodes?: number[];
        methods?: string[];
    };
};
type LogRequest = {
    headers: Record<string, string[]>;
    body?: string;
    contentLength: number;
};
type LogResponse = {
    headers: Record<string, string[]>;
    body?: string;
    contentLength: number;
};
export type Log = {
    id: string;
    timestamp: string;
    path: string;
    method: string;
    statusCode: number;
    responseTime: number;
    apiId: string;
};
export type LogDetails = {
    id: string;
    timestamp: string;
    ipAddress?: string;
    statusCode: number;
    path: string;
    request: LogRequest;
    response: LogResponse;
};
export type ApiAccessStatus = {
    status: 'NONE' | 'PENDING' | 'ACCEPTED';
    appId?: string;
    apps?: {
        id: string;
        title: string;
    }[] | undefined;
};
export {};
//# sourceMappingURL=types.d.ts.map