n8n
Version:
n8n Workflow Automation Tool
59 lines (58 loc) • 2.67 kB
TypeScript
import { InstanceSettings } from 'n8n-core';
import type { ExportableCredential } from './types/exportableCredential';
import type { Variables } from '../../databases/entities/Variables';
import type { WorkflowTagMapping } from '../../databases/entities/WorkflowTagMapping';
import type { TagEntity } from '../../databases/entities/TagEntity';
import { ActiveWorkflowManager } from '../../ActiveWorkflowManager';
import type { SourceControlWorkflowVersionId } from './types/sourceControlWorkflowVersionId';
import type { SourceControlledFile } from './types/sourceControlledFile';
import { VariablesService } from '../variables/variables.service.ee';
import { TagRepository } from '../../databases/repositories/tag.repository';
import { Logger } from '../../Logger';
export declare class SourceControlImportService {
private readonly logger;
private readonly variablesService;
private readonly activeWorkflowManager;
private readonly tagRepository;
private gitFolder;
private workflowExportFolder;
private credentialExportFolder;
constructor(logger: Logger, variablesService: VariablesService, activeWorkflowManager: ActiveWorkflowManager, tagRepository: TagRepository, instanceSettings: InstanceSettings);
getRemoteVersionIdsFromFiles(): Promise<SourceControlWorkflowVersionId[]>;
getLocalVersionIdsFromDb(): Promise<SourceControlWorkflowVersionId[]>;
getRemoteCredentialsFromFiles(): Promise<Array<ExportableCredential & {
filename: string;
}>>;
getLocalCredentialsFromDb(): Promise<Array<ExportableCredential & {
filename: string;
}>>;
getRemoteVariablesFromFile(): Promise<Variables[]>;
getLocalVariablesFromDb(): Promise<Variables[]>;
getRemoteTagsAndMappingsFromFile(): Promise<{
tags: TagEntity[];
mappings: WorkflowTagMapping[];
}>;
getLocalTagsAndMappingsFromDb(): Promise<{
tags: TagEntity[];
mappings: WorkflowTagMapping[];
}>;
importWorkflowFromWorkFolder(candidates: SourceControlledFile[], userId: string): Promise<{
id: string;
name: string;
}[]>;
importCredentialsFromWorkFolder(candidates: SourceControlledFile[], userId: string): Promise<{
id: string;
name: string;
type: string;
}[]>;
importTagsFromWorkFolder(candidate: SourceControlledFile): Promise<{
tags: TagEntity[];
mappings: WorkflowTagMapping[];
} | undefined>;
importVariablesFromWorkFolder(candidate: SourceControlledFile, valueOverrides?: {
[key: string]: string;
}): Promise<{
imported: string[];
} | undefined>;
private findOrCreateOwnerProject;
}