@gadmin2n/schematics 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/prisma/job.prisma +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/prisma/system.prisma +0 -21
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/prisma/workflow.prisma +171 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/AgendaJob.ts +60 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Event.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/WorkflowEventOutbox.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/WorkflowNodeInstance.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/WorkflowNodeType.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/.env +5 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/package.json +5 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/prisma.config.ts +14 -7
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/index.ts +4 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/permissions.ts +49 -3
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/workflow-node-types.ts +746 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/workflows.ts +786 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agenda/agenda.controller.ts +6 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agenda/agenda.service.ts +79 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.controller.spec.ts +20 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.controller.ts +145 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/{canvas/canvas.service.spec.ts → agendaJob/agendaJob.service.spec.ts} +71 -65
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.service.ts +83 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/index.ts +2 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/temporal.module.ts +9 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/temporal.service.ts +100 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-execution.dto.ts +19 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-export.dto.ts +43 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-export.service.ts +317 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-node-type.controller.ts +16 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-node-type.service.ts +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.controller.ts +220 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.dto.ts +82 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.module.ts +16 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.service.ts +505 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.controller.spec.ts +22 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.controller.ts +147 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.service.spec.ts +356 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.service.ts +110 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.controller.spec.ts +22 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.controller.ts +216 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.service.spec.ts +356 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.service.ts +168 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.controller.spec.ts +22 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.controller.ts +199 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.service.spec.ts +348 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.service.ts +106 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/yarn.lock +579 -1082
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/README.md +278 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/config/development-sql.yaml +5 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/docker-compose.yml +25 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/package.json +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/sql/create-event-trigger.sql +87 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/.env +7 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/SANDBOX.md +122 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/package-lock.json +4285 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/package.json +28 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/activities/code-execute.test.ts +44 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/activities/http-request.test.ts +87 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/helpers.test.ts +225 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/node-type-consistency.test.ts +101 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/code-execute.ts +51 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/db-execute.ts +85 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/db-query.ts +35 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/http-request.ts +54 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/index.ts +6 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/reporting.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/send-notification.ts +47 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/config.ts +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/condition.ts +101 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/context.ts +58 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/graph.ts +184 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/helpers.ts +133 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/node-types.ts +57 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/types.ts +77 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/index.ts +36 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/outbox-poller.ts +226 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/workflows/dsl-workflow.ts +411 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/tsconfig.json +19 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/vitest.config.ts +8 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/yarn.lock +1905 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/package-lock.json +17555 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/package.json +5 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/App.tsx +1 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/sider.tsx +5 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/title.tsx +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/config/routeRegistry.tsx +63 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/dev-shell/DevShell.tsx +91 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/list.tsx +48 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/show.tsx +43 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/locales/en/common.json +14 -9
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/locales/zh_CN/common.json +14 -9
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agenda/index.tsx +309 -56
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agenda/show.tsx +1 -3
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/create.tsx +108 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/edit.tsx +124 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/index.tsx +4 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/list.tsx +245 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/show.tsx +70 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CanvasListPage.tsx +0 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CanvasPage.tsx +160 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CanvasToolbar.tsx +120 -148
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CodeFloatWindow.tsx +74 -181
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/LivePreview.tsx +15 -13
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/canvasConfigRegistry.tsx +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/canvasContextMenuRegistry.tsx +338 -3
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/canvasDefaults.ts +18 -17
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/BarChartDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/LineChartDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/{ChartViewerConfigModal.tsx → MultiChartConfigModal.tsx} +30 -18
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/MultiChartDataSourceModal.tsx +427 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/NumCardDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/PromptModal.tsx +6 -14
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/RadarChartDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/TableDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/canvasModalProps.ts +24 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/demos.ts +45 -63
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/CustomNode.tsx +99 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/ExportModal.tsx +87 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/FlowRenderer.tsx +322 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/ImportModal.tsx +175 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/NodeEditModal.tsx +60 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/NodePropertyPanel.tsx +1150 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/RunWorkflowModal.tsx +101 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/StatusCards.tsx +198 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/VersionPanel.tsx +81 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/editor.tsx +566 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/hooks/useWorkflowAgent.ts +224 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/index.tsx +524 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/instance-detail.tsx +343 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/instances.tsx +243 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/components/CreateNodeInstanceModal.tsx +363 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/components/DynamicConfigForm.tsx +154 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/components/NodeInstanceForm.tsx +176 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/create.tsx +77 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/edit.tsx +112 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/index.tsx +305 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/show.tsx +282 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/show.tsx +469 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/types.ts +92 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/create.tsx +111 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/edit.tsx +127 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/index.tsx +4 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/list.tsx +254 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/show.tsx +74 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/yarn.lock +1501 -1199
- package/package.json +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/app.controller.spec.ts +0 -22
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/BarChart/index.tsx +0 -896
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/ChartSwitcher/index.tsx +0 -219
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/ChartViewer/index.tsx +0 -159
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/Filter/index.tsx +0 -192
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/LineChart/index.tsx +0 -1034
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/NumCard/NumCard.module.css +0 -8
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/NumCard/index.tsx +0 -509
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/NumLineCard/index.tsx +0 -66
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/PieChart/index.tsx +0 -552
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/RadarChart/index.tsx +0 -263
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/Section/index.tsx +0 -35
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/Table/index.tsx +0 -207
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/TreemapChart/index.tsx +0 -382
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/WorldMap/index.tsx +0 -135
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/chart-constants.ts +0 -53
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/icon/InfoIcon.tsx +0 -8
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/icon/index.ts +0 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/map/config.ts +0 -31
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/map/nameMap.json +0 -9
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/map/world.geo.json +0 -39349
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/metric-info-tooltip/index.tsx +0 -19
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
Delete,
|
|
5
|
+
Get,
|
|
6
|
+
Param,
|
|
7
|
+
ParseIntPipe,
|
|
8
|
+
Patch,
|
|
9
|
+
Post,
|
|
10
|
+
Query,
|
|
11
|
+
Req,
|
|
12
|
+
UnauthorizedException,
|
|
13
|
+
UseGuards,
|
|
14
|
+
} from '@nestjs/common';
|
|
15
|
+
import { ApiTags } from '@nestjs/swagger';
|
|
16
|
+
import AuthGuard, { AllowUnauthorizedRequest } from '../../lib/auth.guard';
|
|
17
|
+
import { TemporalService } from './temporal.service';
|
|
18
|
+
import {
|
|
19
|
+
ExecuteWorkflowDto,
|
|
20
|
+
SignalWorkflowDto,
|
|
21
|
+
} from './workflow-execution.dto';
|
|
22
|
+
import { ImportPayloadDto } from './workflow-export.dto';
|
|
23
|
+
import { WorkflowExportService } from './workflow-export.service';
|
|
24
|
+
import {
|
|
25
|
+
CreateWorkflowDto,
|
|
26
|
+
PublishVersionDto,
|
|
27
|
+
SaveDraftDto,
|
|
28
|
+
ToggleEnabledDto,
|
|
29
|
+
UpdateWorkflowDto,
|
|
30
|
+
WorkflowListQueryDto,
|
|
31
|
+
} from './workflow.dto';
|
|
32
|
+
import { WorkflowService } from './workflow.service';
|
|
33
|
+
|
|
34
|
+
@ApiTags('workflow')
|
|
35
|
+
@UseGuards(AuthGuard)
|
|
36
|
+
@Controller('workflow')
|
|
37
|
+
export class WorkflowController {
|
|
38
|
+
constructor(
|
|
39
|
+
private readonly workflowService: WorkflowService,
|
|
40
|
+
private readonly temporalService: TemporalService,
|
|
41
|
+
private readonly workflowExportService: WorkflowExportService,
|
|
42
|
+
) {}
|
|
43
|
+
|
|
44
|
+
@Get()
|
|
45
|
+
findAll(@Query() query: WorkflowListQueryDto) {
|
|
46
|
+
return this.workflowService.findMany({
|
|
47
|
+
status: query.status,
|
|
48
|
+
instanceStatus: query.instanceStatus,
|
|
49
|
+
name: query.name,
|
|
50
|
+
skip: query.skip,
|
|
51
|
+
limit: query.limit,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Get('overview')
|
|
56
|
+
getOverview() {
|
|
57
|
+
return this.workflowService.getOverview();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ─── Export/Import Endpoints ──────────────────────────────────────────────────
|
|
61
|
+
|
|
62
|
+
@Post(':id/export-token')
|
|
63
|
+
async generateExportToken(@Param('id', ParseIntPipe) id: number, @Req() req) {
|
|
64
|
+
const baseUrl = `${req.protocol}://${req.get('host')}/api`;
|
|
65
|
+
return this.workflowExportService.generateExportToken(BigInt(id), baseUrl);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@Get('export/:code')
|
|
69
|
+
@AllowUnauthorizedRequest()
|
|
70
|
+
async getExportPayload(
|
|
71
|
+
@Param('code') code: string,
|
|
72
|
+
@Query('token') token: string,
|
|
73
|
+
) {
|
|
74
|
+
if (!token) {
|
|
75
|
+
throw new UnauthorizedException('Export token is required');
|
|
76
|
+
}
|
|
77
|
+
return this.workflowExportService.getExportPayload(code, token);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@Post('import-preview')
|
|
81
|
+
async importPreview(@Body() dto: ImportPayloadDto) {
|
|
82
|
+
return this.workflowExportService.importPreview(dto.payload);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@Post('import-confirm')
|
|
86
|
+
async importConfirm(@Body() dto: ImportPayloadDto, @Req() req) {
|
|
87
|
+
return this.workflowExportService.importConfirm(
|
|
88
|
+
dto.payload,
|
|
89
|
+
req.user.userid,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@Post()
|
|
94
|
+
create(@Req() req, @Body() dto: CreateWorkflowDto) {
|
|
95
|
+
return this.workflowService.create(dto, req.user.userid);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@Get(':id')
|
|
99
|
+
findOne(@Param('id', ParseIntPipe) id: number) {
|
|
100
|
+
return this.workflowService.findOne(BigInt(id));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@Patch(':id')
|
|
104
|
+
update(
|
|
105
|
+
@Param('id', ParseIntPipe) id: number,
|
|
106
|
+
@Body() dto: UpdateWorkflowDto,
|
|
107
|
+
) {
|
|
108
|
+
return this.workflowService.update(BigInt(id), dto);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@Patch(':id/save')
|
|
112
|
+
saveDraft(@Param('id', ParseIntPipe) id: number, @Body() dto: SaveDraftDto) {
|
|
113
|
+
return this.workflowService.saveDraft(BigInt(id), dto.dsl);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@Patch(':id/toggle')
|
|
117
|
+
toggleEnabled(
|
|
118
|
+
@Param('id', ParseIntPipe) id: number,
|
|
119
|
+
@Body() dto: ToggleEnabledDto,
|
|
120
|
+
) {
|
|
121
|
+
return this.workflowService.toggleEnabled(BigInt(id), dto.enabled);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@Delete(':id')
|
|
125
|
+
remove(@Param('id', ParseIntPipe) id: number) {
|
|
126
|
+
return this.workflowService.remove(BigInt(id));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@Get(':id/versions')
|
|
130
|
+
getVersions(@Param('id', ParseIntPipe) id: number) {
|
|
131
|
+
return this.workflowService.getVersions(BigInt(id));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@Get(':id/versions/:version')
|
|
135
|
+
getVersionDsl(
|
|
136
|
+
@Param('id', ParseIntPipe) id: number,
|
|
137
|
+
@Param('version', ParseIntPipe) version: number,
|
|
138
|
+
) {
|
|
139
|
+
return this.workflowService.getVersionDsl(BigInt(id), version);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@Post(':id/publish')
|
|
143
|
+
publish(
|
|
144
|
+
@Param('id', ParseIntPipe) id: number,
|
|
145
|
+
@Req() req,
|
|
146
|
+
@Body() dto: PublishVersionDto,
|
|
147
|
+
) {
|
|
148
|
+
return this.workflowService.publish(BigInt(id), dto, req.user.userid);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@Get(':id/instances')
|
|
152
|
+
getInstances(
|
|
153
|
+
@Param('id', ParseIntPipe) id: number,
|
|
154
|
+
@Query() query: { status?: string; skip?: string; limit?: string },
|
|
155
|
+
) {
|
|
156
|
+
return this.workflowService.getInstances(BigInt(id), {
|
|
157
|
+
status: query.status,
|
|
158
|
+
skip: query.skip ? Number(query.skip) : undefined,
|
|
159
|
+
limit: query.limit ? Number(query.limit) : undefined,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@Get(':id/stats')
|
|
164
|
+
getStats(@Param('id', ParseIntPipe) id: number) {
|
|
165
|
+
return this.workflowService.getStats(BigInt(id));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// ─── Execution Endpoints ──────────────────────────────────────────────────────
|
|
169
|
+
|
|
170
|
+
@Post(':id/execute')
|
|
171
|
+
async execute(
|
|
172
|
+
@Param('id', ParseIntPipe) id: number,
|
|
173
|
+
@Req() req,
|
|
174
|
+
@Body() dto: ExecuteWorkflowDto,
|
|
175
|
+
) {
|
|
176
|
+
return this.workflowService.executeWorkflow(
|
|
177
|
+
BigInt(id),
|
|
178
|
+
dto,
|
|
179
|
+
req.user.userid,
|
|
180
|
+
this.temporalService,
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@Get('instance/:instanceId')
|
|
185
|
+
getInstanceDetail(@Param('instanceId', ParseIntPipe) instanceId: number) {
|
|
186
|
+
return this.workflowService.getInstanceDetail(BigInt(instanceId));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@Post('instance/:instanceId/cancel')
|
|
190
|
+
async cancelInstance(@Param('instanceId', ParseIntPipe) instanceId: number) {
|
|
191
|
+
return this.workflowService.cancelInstance(
|
|
192
|
+
BigInt(instanceId),
|
|
193
|
+
this.temporalService,
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@Post('instance/:instanceId/retry')
|
|
198
|
+
async retryInstance(
|
|
199
|
+
@Param('instanceId', ParseIntPipe) instanceId: number,
|
|
200
|
+
@Req() req,
|
|
201
|
+
) {
|
|
202
|
+
return this.workflowService.retryInstance(
|
|
203
|
+
BigInt(instanceId),
|
|
204
|
+
req.user.userid,
|
|
205
|
+
this.temporalService,
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@Post('instance/:instanceId/signal')
|
|
210
|
+
async signalInstance(
|
|
211
|
+
@Param('instanceId', ParseIntPipe) instanceId: number,
|
|
212
|
+
@Body() dto: SignalWorkflowDto,
|
|
213
|
+
) {
|
|
214
|
+
return this.workflowService.signalInstance(
|
|
215
|
+
BigInt(instanceId),
|
|
216
|
+
dto,
|
|
217
|
+
this.temporalService,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Prisma } from '@prisma/client';
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsOptional,
|
|
7
|
+
IsString,
|
|
8
|
+
Min,
|
|
9
|
+
} from 'class-validator';
|
|
10
|
+
|
|
11
|
+
export enum WorkflowStatusEnum {
|
|
12
|
+
DRAFT = 'DRAFT',
|
|
13
|
+
PUBLISHED = 'PUBLISHED',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum InstanceStatusEnum {
|
|
17
|
+
PENDING = 'PENDING',
|
|
18
|
+
RUNNING = 'RUNNING',
|
|
19
|
+
COMPLETED = 'COMPLETED',
|
|
20
|
+
FAILED = 'FAILED',
|
|
21
|
+
CANCELLED = 'CANCELLED',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class CreateWorkflowDto {
|
|
25
|
+
@IsString()
|
|
26
|
+
name: string;
|
|
27
|
+
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsString()
|
|
30
|
+
description?: string;
|
|
31
|
+
|
|
32
|
+
@IsOptional()
|
|
33
|
+
dsl?: Prisma.InputJsonValue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class UpdateWorkflowDto {
|
|
37
|
+
@IsOptional()
|
|
38
|
+
@IsString()
|
|
39
|
+
name?: string;
|
|
40
|
+
|
|
41
|
+
@IsOptional()
|
|
42
|
+
@IsString()
|
|
43
|
+
description?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class SaveDraftDto {
|
|
47
|
+
dsl: Prisma.InputJsonValue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export class PublishVersionDto {
|
|
51
|
+
@IsString()
|
|
52
|
+
changeSummary: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class ToggleEnabledDto {
|
|
56
|
+
@IsBoolean()
|
|
57
|
+
enabled: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class WorkflowListQueryDto {
|
|
61
|
+
@IsOptional()
|
|
62
|
+
@IsEnum(WorkflowStatusEnum)
|
|
63
|
+
status?: WorkflowStatusEnum;
|
|
64
|
+
|
|
65
|
+
@IsOptional()
|
|
66
|
+
@IsEnum(InstanceStatusEnum)
|
|
67
|
+
instanceStatus?: InstanceStatusEnum;
|
|
68
|
+
|
|
69
|
+
@IsOptional()
|
|
70
|
+
@IsString()
|
|
71
|
+
name?: string;
|
|
72
|
+
|
|
73
|
+
@IsOptional()
|
|
74
|
+
@IsInt()
|
|
75
|
+
@Min(0)
|
|
76
|
+
skip?: number;
|
|
77
|
+
|
|
78
|
+
@IsOptional()
|
|
79
|
+
@IsInt()
|
|
80
|
+
@Min(1)
|
|
81
|
+
limit?: number;
|
|
82
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Module } from '@nestjs/common';
|
|
2
|
+
import { UserModule } from '../user/user.module';
|
|
3
|
+
import { TemporalModule } from './temporal.module';
|
|
4
|
+
import { WorkflowExportService } from './workflow-export.service';
|
|
5
|
+
import { WorkflowNodeTypeController } from './workflow-node-type.controller';
|
|
6
|
+
import { WorkflowNodeTypeService } from './workflow-node-type.service';
|
|
7
|
+
import { WorkflowController } from './workflow.controller';
|
|
8
|
+
import { WorkflowService } from './workflow.service';
|
|
9
|
+
|
|
10
|
+
@Module({
|
|
11
|
+
imports: [UserModule, TemporalModule],
|
|
12
|
+
controllers: [WorkflowController, WorkflowNodeTypeController],
|
|
13
|
+
providers: [WorkflowService, WorkflowNodeTypeService, WorkflowExportService],
|
|
14
|
+
exports: [WorkflowService],
|
|
15
|
+
})
|
|
16
|
+
export class WorkflowModule {}
|