forked from ToolJet/ToolJet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflow-executions.controller.ts
More file actions
95 lines (85 loc) · 3.3 KB
/
workflow-executions.controller.ts
File metadata and controls
95 lines (85 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import { Body, Controller, Get, Param, Post, Query, Res, Sse } from '@nestjs/common';
import { Response } from 'express';
import { IWorkflowExecutionController } from '../interfaces/IWorkflowExecutionController';
import { CreateWorkflowExecutionDto } from '@dto/create-workflow-execution.dto';
import { WorkflowExecution } from 'src/entities/workflow_execution.entity';
import { PreviewWorkflowNodeDto } from '@dto/preview-workflow-node.dto';
import { User } from '@modules/app/decorators/user.decorator';
import { InitModule } from '@modules/app/decorators/init-module';
import { MODULES } from '@modules/app/constants/modules';
import { InitFeature } from '@modules/app/decorators/init-feature.decorator';
import { FEATURE_KEY } from '@modules/workflows/constants';
import { Observable } from 'rxjs';
@InitModule(MODULES.WORKFLOWS)
@Controller('workflow_executions')
export class WorkflowExecutionsController implements IWorkflowExecutionController {
constructor() {}
@InitFeature(FEATURE_KEY.EXECUTE_WORKFLOW)
@Post()
async create(
@User() user,
@Body() createWorkflowExecutionDto: CreateWorkflowExecutionDto,
@Res({ passthrough: true }) response: Response
): Promise<{ workflowExecution: WorkflowExecution; result: any }> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.WORKFLOW_EXECUTION_STATUS)
@Get(':id/status')
async status(@Param('id') id: any, @User() user): Promise<any> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.WORKFLOW_EXECUTION_DETAILS)
@Get(':id')
async show(@Param('id') id: any, @User() user): Promise<WorkflowExecution> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.LIST_WORKFLOW_EXECUTIONS)
@Get('all/:appVersionId')
async index(@Param('appVersionId') appVersionId: any, @User() user): Promise<WorkflowExecution[]> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.FETCH_EXECUTION_LOGS)
@Get()
async getExecutions(
@Query('appVersionId') appVersionId: string,
@Query('page') page = '1',
@Query('per_page') perPage = '10',
@User() user
): Promise<any> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.FETCH_EXECUTION_NODES)
@Get(':id/nodes')
async getExecutionNodes(
@Param('id') id: string,
@Query('page') page = '1',
@Query('per_page') perPage = '10',
@User() user
): Promise<any> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.PREVIEW_QUERY_NODE)
@Post('previewQueryNode')
async previewQueryNode(
@User() user,
@Body() previewNodeDto: PreviewWorkflowNodeDto,
@Res({ passthrough: true }) response: Response
): Promise<{ result: any }> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.EXECUTE_WORKFLOW)
@Post(':id/trigger')
async trigger(
@Param('id') id: string,
@Body() createWorkflowExecutionDto: CreateWorkflowExecutionDto,
@User() user,
@Res({ passthrough: true }) response: Response
): Promise<{ result: any }> {
throw new Error('Method not implemented.');
}
@InitFeature(FEATURE_KEY.WORKFLOW_EXECUTION_STATUS)
@Sse(':id/stream')
async streamWorkflowExecution(@Param('id') id: string): Promise<Observable<MessageEvent>> {
throw new Error('Method not implemented.');
}
}