n8n
Version:
n8n Workflow Automation Tool
39 lines (38 loc) • 1.54 kB
TypeScript
import { CreateApiKeyRequestDto, UpdateApiKeyRequestDto } from '@n8n/api-types';
import type { RequestHandler } from 'express';
import { EventService } from '../events/event.service';
import { AuthenticatedRequest } from '../requests';
import { PublicApiKeyService } from '../services/public-api-key.service';
export declare const isApiEnabledMiddleware: RequestHandler;
export declare class ApiKeysController {
private readonly eventService;
private readonly publicApiKeyService;
constructor(eventService: EventService, publicApiKeyService: PublicApiKeyService);
createAPIKey(req: AuthenticatedRequest, _res: Response, { label, expiresAt }: CreateApiKeyRequestDto): Promise<{
apiKey: string;
rawApiKey: string;
expiresAt: number | null;
user: import("../databases/entities/user").User;
userId: string;
label: string;
id: string;
createdAt: Date;
updatedAt: Date;
}>;
getAPIKeys(req: AuthenticatedRequest): Promise<{
apiKey: string;
expiresAt: number | null;
user: import("../databases/entities/user").User;
userId: string;
label: string;
id: string;
createdAt: Date;
updatedAt: Date;
}[]>;
deleteAPIKey(req: AuthenticatedRequest, _res: Response, apiKeyId: string): Promise<{
success: boolean;
}>;
updateAPIKey(req: AuthenticatedRequest, _res: Response, apiKeyId: string, { label }: UpdateApiKeyRequestDto): Promise<{
success: boolean;
}>;
}