import type { ApiContext, PaginatedResult } from './_shared';
export interface ExternalApplicationDto {
    id: string;
    name: string;
    description: string | null;
    clientId: string;
    secretPrefix: string;
    primarySecretCreatedAt: string | null;
    secondarySecretPrefix: string | null;
    secondarySecretCreatedAt: string | null;
    isActive: boolean;
    allowedIpAddresses: string | null;
    tokenExpirationMinutes: number;
    lastAuthenticatedAt: string | null;
    createdAt: string;
    createdBy: string | null;
    updatedAt: string | null;
    updatedBy: string | null;
    authenticationCount: number;
}
export interface ExternalApplicationDetailDto extends ExternalApplicationDto {
    roles: ExternalApplicationRoleDto[];
}
export interface ExternalApplicationCreatedDto extends ExternalApplicationDetailDto {
    clientSecret: string;
}
export interface RotateSecretResponse {
    clientSecret: string;
    secretPrefix: string;
    keySlot: string;
}
export interface ExternalApplicationRoleDto {
    roleId: string;
    roleName: string;
    tenantId: string | null;
    tenantName: string | null;
    isGlobal: boolean;
    assignedAt: string;
    assignedBy: string | null;
}
export interface CreateExternalApplicationRequest {
    name: string;
    description?: string;
    allowedIpAddresses?: string;
    tokenExpirationMinutes?: number;
}
export interface UpdateExternalApplicationRequest {
    name: string;
    description?: string;
    allowedIpAddresses?: string;
    tokenExpirationMinutes?: number;
}
export interface AssignRoleToExternalAppRequest {
    roleId: string;
    tenantId?: string;
}
export interface GeneratedSecretDto {
    clientSecret: string;
}
export interface ExternalAppAuditLogDto {
    id: string;
    clientId: string;
    ipAddress: string;
    action: string;
    success: boolean;
    errorCode: string | null;
    errorMessage: string | null;
    userAgent: string | null;
    keyUsed: string | null;
    endpointCode: string | null;
    durationMs: number | null;
    createdAt: string;
}
export interface ExternalAppUsageStatsDto {
    totalRequests: number;
    successfulRequests: number;
    failedRequests: number;
    topIpAddresses: IpUsageDto[];
    dailyUsage: DailyUsageDto[];
}
export interface IpUsageDto {
    ipAddress: string;
    requestCount: number;
    lastSeenAt: string;
}
export interface DailyUsageDto {
    date: string;
    success: number;
    failed: number;
}
export interface KeyUsageStatsDto {
    primary: KeySlotStatsDto;
    secondary: KeySlotStatsDto | null;
}
export interface KeySlotStatsDto {
    keySlot: string;
    secretPrefix: string | null;
    createdAt: string | null;
    totalUses: number;
    successfulUses: number;
    failedUses: number;
    lastUsedAt: string | null;
    lastIpAddress: string | null;
    topCallers: CallerStatsDto[];
}
export interface CallerStatsDto {
    userAgent: string;
    requestCount: number;
    lastSeenAt: string;
}
export interface DataApiEndpointDto {
    id: string;
    code: string;
    name: string;
    description: string | null;
    routeTemplate: string;
    requiredPermission: string;
    entityType: string;
    accessType: string;
    isActive: boolean;
    defaultRateLimitPerMinute: number;
    defaultMaxPageSize: number;
    navigationApplicationId: string;
    applicationCode: string;
    applicationLabel: string;
    navigationModuleId: string;
    moduleCode: string;
    moduleLabel: string;
}
export interface ApiAccessDto {
    id: string;
    externalApplicationId: string;
    dataApiEndpointId: string;
    endpointCode: string;
    endpointName: string;
    isEnabled: boolean;
    rateLimitPerMinute: number | null;
    maxPageSize: number | null;
    lastAccessedAt: string | null;
    totalRequestCount: number;
}
export interface UpdateApiAccessRequest {
    isEnabled: boolean;
    rateLimitPerMinute?: number;
    maxPageSize?: number;
}
export interface ModuleLookupDto {
    id: string;
    code: string;
    label: string;
}
export interface ApplicationLookupDto {
    id: string;
    code: string;
    label: string;
    modules: ModuleLookupDto[];
}
export declare const createExternalAppsApi: (apiContext: ApiContext) => {
    getAll: (params?: {
        search?: string;
        isActive?: boolean;
    }) => Promise<ExternalApplicationDto[]>;
    getById: (id: string) => Promise<ExternalApplicationDetailDto>;
    create: (data: CreateExternalApplicationRequest) => Promise<ExternalApplicationCreatedDto>;
    update: (id: string, data: UpdateExternalApplicationRequest) => Promise<ExternalApplicationDetailDto>;
    delete: (id: string) => Promise<unknown>;
    activate: (id: string) => Promise<unknown>;
    deactivate: (id: string) => Promise<unknown>;
    rotateSecret: (id: string, keySlot?: "Primary" | "Secondary") => Promise<RotateSecretResponse>;
    revokeSecondarySecret: (id: string) => Promise<unknown>;
    assignRole: (id: string, data: AssignRoleToExternalAppRequest) => Promise<unknown>;
    removeRole: (id: string, roleId: string, tenantId?: string) => Promise<unknown>;
    generateSecret: () => Promise<GeneratedSecretDto>;
    getAuditLogs: (id: string, page?: number, pageSize?: number) => Promise<PaginatedResult<ExternalAppAuditLogDto>>;
    getUsageStats: (id: string, days?: number) => Promise<ExternalAppUsageStatsDto>;
    getKeyUsage: (id: string) => Promise<KeyUsageStatsDto>;
    getApiEndpoints: () => Promise<DataApiEndpointDto[]>;
    getAppApiAccess: (appId: string) => Promise<ApiAccessDto[]>;
    updateApiAccess: (appId: string, endpointId: string, data: UpdateApiAccessRequest) => Promise<ApiAccessDto>;
    removeApiAccess: (appId: string, endpointId: string) => Promise<unknown>;
};
export declare const createApiCatalogApi: (apiContext: ApiContext) => {
    getNavigationLookup: () => Promise<ApplicationLookupDto[]>;
};
//# sourceMappingURL=externalApps.d.ts.map