| 116 | } |
| 117 | |
| 118 | public async runOperationFlow(id: string, data: unknown, context: Record<string, unknown>): Promise<unknown> { |
| 119 | if (this.reloadQueue.pending > 0) await this.reloadQueue.onIdle(); |
| 120 | |
| 121 | const logger = useLogger(); |
| 122 | |
| 123 | if (!(id in this.operationFlowHandlers)) { |
| 124 | logger.warn(`Couldn't find operation triggered flow with id "${id}"`); |
| 125 | return null; |
| 126 | } |
| 127 | |
| 128 | const handler = this.operationFlowHandlers[id]; |
| 129 | |
| 130 | return handler(data, context); |
| 131 | } |
| 132 | |
| 133 | public async runWebhookFlow( |
| 134 | id: string, |