|
1 | 1 | import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron'; |
2 | | -import type { Repository, Task, TaskStep, GlobalSettings, LogLevel, ProjectSuggestion, LocalPathState, DetailedStatus, Commit, BranchInfo, DebugLogEntry, VcsType, ProjectInfo, Category, AppDataContextState, ReleaseInfo, CommitDiffFile } from '../types'; |
| 2 | +import type { Repository, Task, TaskStep, GlobalSettings, LogLevel, ProjectSuggestion, LocalPathState, DetailedStatus, Commit, BranchInfo, DebugLogEntry, VcsType, ProjectInfo, Category, AppDataContextState, ReleaseInfo, CommitDiffFile, WorkflowFileSummary, WorkflowTemplateSuggestion } from '../types'; |
3 | 3 |
|
4 | 4 | const taskLogChannel = 'task-log'; |
5 | 5 | const taskStepEndChannel = 'task-step-end'; |
@@ -31,6 +31,7 @@ contextBridge.exposeInMainWorld('electronAPI', { |
31 | 31 | // Smart Scripts |
32 | 32 | getProjectInfo: (repoPath: string): Promise<ProjectInfo> => ipcRenderer.invoke('get-project-info', repoPath), |
33 | 33 | getProjectSuggestions: (args: { repoPath: string, repoName: string }): Promise<ProjectSuggestion[]> => ipcRenderer.invoke('get-project-suggestions', args), |
| 34 | + getWorkflowTemplates: (args: { repoPath: string; repoName: string }): Promise<WorkflowTemplateSuggestion[]> => ipcRenderer.invoke('get-workflow-templates', args), |
34 | 35 | getDelphiVersions: (): Promise<{ name: string; version: string }[]> => ipcRenderer.invoke('get-delphi-versions'), |
35 | 36 |
|
36 | 37 | // Version Control |
@@ -69,6 +70,14 @@ contextBridge.exposeInMainWorld('electronAPI', { |
69 | 70 | pathJoin: (...args: string[]): Promise<string> => ipcRenderer.invoke('path-join', ...args), |
70 | 71 | detectExecutables: (repoPath: string): Promise<string[]> => ipcRenderer.invoke('detect-executables', repoPath), |
71 | 72 | launchExecutable: (args: { repoPath: string, executablePath: string }): Promise<{ success: boolean; output: string }> => ipcRenderer.invoke('launch-executable', args), |
| 73 | + listWorkflowFiles: (repoPath: string): Promise<WorkflowFileSummary[]> => ipcRenderer.invoke('list-workflow-files', repoPath), |
| 74 | + readWorkflowFile: (args: { repoPath: string; relativePath: string }): Promise<{ success: boolean; content?: string; error?: string }> => ipcRenderer.invoke('read-workflow-file', args), |
| 75 | + writeWorkflowFile: (args: { repoPath: string; relativePath: string; content: string }): Promise<{ success: boolean; error?: string }> => ipcRenderer.invoke('write-workflow-file', args), |
| 76 | + createWorkflowFromTemplate: (args: { repoPath: string; relativePath: string; content: string; overwrite?: boolean }): Promise<{ success: boolean; error?: string }> => ipcRenderer.invoke('create-workflow-from-template', args), |
| 77 | + commitWorkflowFiles: (args: { repo: Repository; filePaths: string[]; message: string }): Promise<{ success: boolean; error?: string }> => ipcRenderer.invoke('commit-workflow-files', args), |
| 78 | + validateWorkflow: (args: { repo: Repository; relativePath: string; executionId: string }) => { |
| 79 | + ipcRenderer.send('validate-workflow', args); |
| 80 | + }, |
72 | 81 | openLocalPath: (path: string): Promise<{ success: boolean; error?: string }> => ipcRenderer.invoke('open-local-path', path), |
73 | 82 | openInstallationFolder: (): Promise<{ success: boolean; error?: string; path?: string }> => ipcRenderer.invoke('open-installation-folder'), |
74 | 83 | openWeblink: (url: string): Promise<{ success: boolean; error?: string }> => ipcRenderer.invoke('open-weblink', url), |
|
0 commit comments