mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-04-05 17:13:08 +00:00
Add comprehensive security auditing combining n8n's built-in POST /audit API with deep workflow scanning using 50+ regex patterns for hardcoded secrets, unauthenticated webhook detection, error handling gap analysis, data retention risk assessment, and PII detection. The audit returns a compact markdown report grouped by workflow with a Remediation Playbook showing auto-fixable items (with tool chains), items requiring review, and items requiring user action. Also adds n8n_manage_credentials tool (list/get/create/update/delete/getSchema) enabling AI agents to create credentials and assign them to nodes as part of security remediation. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
78 lines
4.1 KiB
TypeScript
78 lines
4.1 KiB
TypeScript
import { Workflow, WorkflowListParams, WorkflowListResponse, Execution, ExecutionListParams, ExecutionListResponse, Credential, CredentialListParams, CredentialListResponse, Tag, TagListParams, TagListResponse, HealthCheckResponse, N8nVersionInfo, Variable, WebhookRequest, SourceControlStatus, SourceControlPullResult, SourceControlPushResult, DataTable, DataTableColumn, DataTableListParams, DataTableRow, DataTableRowListParams, DataTableInsertRowsParams, DataTableUpdateRowsParams, DataTableUpsertRowParams, DataTableDeleteRowsParams } from '../types/n8n-api';
|
|
export interface N8nApiClientConfig {
|
|
baseUrl: string;
|
|
apiKey: string;
|
|
timeout?: number;
|
|
maxRetries?: number;
|
|
}
|
|
export declare class N8nApiClient {
|
|
private client;
|
|
private maxRetries;
|
|
private baseUrl;
|
|
private versionInfo;
|
|
private versionPromise;
|
|
constructor(config: N8nApiClientConfig);
|
|
getVersion(): Promise<N8nVersionInfo | null>;
|
|
private fetchVersionOnce;
|
|
getCachedVersionInfo(): N8nVersionInfo | null;
|
|
healthCheck(): Promise<HealthCheckResponse>;
|
|
createWorkflow(workflow: Partial<Workflow>): Promise<Workflow>;
|
|
getWorkflow(id: string): Promise<Workflow>;
|
|
updateWorkflow(id: string, workflow: Partial<Workflow>): Promise<Workflow>;
|
|
deleteWorkflow(id: string): Promise<Workflow>;
|
|
transferWorkflow(id: string, destinationProjectId: string): Promise<void>;
|
|
activateWorkflow(id: string): Promise<Workflow>;
|
|
deactivateWorkflow(id: string): Promise<Workflow>;
|
|
listWorkflows(params?: WorkflowListParams): Promise<WorkflowListResponse>;
|
|
generateAudit(options?: {
|
|
categories?: string[];
|
|
daysAbandonedWorkflow?: number;
|
|
}): Promise<any>;
|
|
listAllWorkflows(): Promise<Workflow[]>;
|
|
getExecution(id: string, includeData?: boolean): Promise<Execution>;
|
|
listExecutions(params?: ExecutionListParams): Promise<ExecutionListResponse>;
|
|
deleteExecution(id: string): Promise<void>;
|
|
triggerWebhook(request: WebhookRequest): Promise<any>;
|
|
listCredentials(params?: CredentialListParams): Promise<CredentialListResponse>;
|
|
getCredential(id: string): Promise<Credential>;
|
|
createCredential(credential: Partial<Credential>): Promise<Credential>;
|
|
updateCredential(id: string, credential: Partial<Credential>): Promise<Credential>;
|
|
deleteCredential(id: string): Promise<void>;
|
|
getCredentialSchema(typeName: string): Promise<any>;
|
|
listTags(params?: TagListParams): Promise<TagListResponse>;
|
|
createTag(tag: Partial<Tag>): Promise<Tag>;
|
|
updateTag(id: string, tag: Partial<Tag>): Promise<Tag>;
|
|
deleteTag(id: string): Promise<void>;
|
|
updateWorkflowTags(workflowId: string, tagIds: string[]): Promise<Tag[]>;
|
|
getSourceControlStatus(): Promise<SourceControlStatus>;
|
|
pullSourceControl(force?: boolean): Promise<SourceControlPullResult>;
|
|
pushSourceControl(message: string, fileNames?: string[]): Promise<SourceControlPushResult>;
|
|
getVariables(): Promise<Variable[]>;
|
|
createVariable(variable: Partial<Variable>): Promise<Variable>;
|
|
updateVariable(id: string, variable: Partial<Variable>): Promise<Variable>;
|
|
deleteVariable(id: string): Promise<void>;
|
|
createDataTable(params: {
|
|
name: string;
|
|
columns?: DataTableColumn[];
|
|
}): Promise<DataTable>;
|
|
listDataTables(params?: DataTableListParams): Promise<{
|
|
data: DataTable[];
|
|
nextCursor?: string | null;
|
|
}>;
|
|
getDataTable(id: string): Promise<DataTable>;
|
|
updateDataTable(id: string, params: {
|
|
name: string;
|
|
}): Promise<DataTable>;
|
|
deleteDataTable(id: string): Promise<void>;
|
|
getDataTableRows(id: string, params?: DataTableRowListParams): Promise<{
|
|
data: DataTableRow[];
|
|
nextCursor?: string | null;
|
|
}>;
|
|
insertDataTableRows(id: string, params: DataTableInsertRowsParams): Promise<any>;
|
|
updateDataTableRows(id: string, params: DataTableUpdateRowsParams): Promise<any>;
|
|
upsertDataTableRow(id: string, params: DataTableUpsertRowParams): Promise<any>;
|
|
deleteDataTableRows(id: string, params: DataTableDeleteRowsParams): Promise<any>;
|
|
private serializeDataTableParams;
|
|
private validateListResponse;
|
|
}
|
|
//# sourceMappingURL=n8n-api-client.d.ts.map
|