(id: string, message: string, type: "info" | "success" | "error" = "info")
| 42 | } |
| 43 | |
| 44 | update(id: string, message: string, type: "info" | "success" | "error" = "info"): void { |
| 45 | const execution = this.executions.get(id); |
| 46 | if (!execution) { |
| 47 | console.warn(`No execution found for id: ${id}`); |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | const lastMessage = execution.messages[execution.messages.length - 1]; |
| 52 | |
| 53 | if (lastMessage && lastMessage.message === message && lastMessage.type === type) { |
| 54 | return; |
| 55 | } |
| 56 | |
| 57 | const progressMessage: ProgressMessage = { |
| 58 | timestamp: new Date().toISOString(), |
| 59 | message, |
| 60 | type, |
| 61 | }; |
| 62 | |
| 63 | execution.messages.push(progressMessage); |
| 64 | |
| 65 | // Notify all subscribers |
| 66 | execution.subscribers.forEach((callback) => callback(progressMessage)); |
| 67 | } |
| 68 | |
| 69 | complete(id: string, success: boolean = true): void { |
| 70 | const execution = this.executions.get(id); |
no outgoing calls
no test coverage detected