@things-factory/labeling 9.1.19
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/CHANGELOG.md +87 -0
- package/ENTITY_IMPLEMENTATION.md +351 -0
- package/INTEGRATION_COMPLETE.md +531 -0
- package/MIGRATION_GUIDE.md +310 -0
- package/README.md +551 -0
- package/REFACTORING_SUMMARY.md +212 -0
- package/UI_DOCUMENTATION.md +552 -0
- package/dist-client/index.d.ts +3 -0
- package/dist-client/index.js +9 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/labeling-workflow-builder.d.ts +26 -0
- package/dist-client/pages/labeling-workflow-builder.js +636 -0
- package/dist-client/pages/labeling-workflow-builder.js.map +1 -0
- package/dist-client/pages/labeling-workflow-list.d.ts +24 -0
- package/dist-client/pages/labeling-workflow-list.js +495 -0
- package/dist-client/pages/labeling-workflow-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +47 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/entities/index.d.ts +5 -0
- package/dist-server/entities/index.js +11 -0
- package/dist-server/entities/index.js.map +1 -0
- package/dist-server/index.d.ts +3 -0
- package/dist-server/index.js +7 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/route.d.ts +2 -0
- package/dist-server/route.js +6 -0
- package/dist-server/route.js.map +1 -0
- package/dist-server/service/index.d.ts +8 -0
- package/dist-server/service/index.js +21 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/labeling-workflow-service.d.ts +69 -0
- package/dist-server/service/labeling-workflow-service.js +521 -0
- package/dist-server/service/labeling-workflow-service.js.map +1 -0
- package/dist-server/service/labeling-workflow.d.ts +30 -0
- package/dist-server/service/labeling-workflow.js +119 -0
- package/dist-server/service/labeling-workflow.js.map +1 -0
- package/dist-server/service/workflow-execution-step.d.ts +28 -0
- package/dist-server/service/workflow-execution-step.js +115 -0
- package/dist-server/service/workflow-execution-step.js.map +1 -0
- package/dist-server/service/workflow-execution.d.ts +27 -0
- package/dist-server/service/workflow-execution.js +110 -0
- package/dist-server/service/workflow-execution.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/types/workflow-types.d.ts +141 -0
- package/dist-server/types/workflow-types.js +488 -0
- package/dist-server/types/workflow-types.js.map +1 -0
- package/package.json +51 -0
- package/things-factory.config.js +11 -0
- package/translations/en.json +6 -0
- package/translations/ja.json +6 -0
- package/translations/ko.json +6 -0
- package/translations/ms.json +6 -0
- package/translations/zh.json +6 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelingWorkflow = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
const workflow_execution_js_1 = require("./workflow-execution.js");
|
|
10
|
+
const workflow_types_js_1 = require("../types/workflow-types.js");
|
|
11
|
+
/**
|
|
12
|
+
* LabelingWorkflow Entity
|
|
13
|
+
*
|
|
14
|
+
* Represents a labeling workflow definition with multiple steps.
|
|
15
|
+
* Stores workflow configuration, steps, and trigger settings.
|
|
16
|
+
*/
|
|
17
|
+
let LabelingWorkflow = class LabelingWorkflow {
|
|
18
|
+
};
|
|
19
|
+
exports.LabelingWorkflow = LabelingWorkflow;
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique workflow identifier' }),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], LabelingWorkflow.prototype, "id", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
27
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'Domain to which this workflow belongs' }),
|
|
28
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
29
|
+
], LabelingWorkflow.prototype, "domain", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.RelationId)((workflow) => workflow.domain),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], LabelingWorkflow.prototype, "domainId", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User),
|
|
36
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created the workflow' }),
|
|
37
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
38
|
+
], LabelingWorkflow.prototype, "creator", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.RelationId)((workflow) => workflow.creator),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], LabelingWorkflow.prototype, "creatorId", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
|
+
(0, type_graphql_1.Field)({ description: 'Workflow name' }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], LabelingWorkflow.prototype, "name", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
50
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Workflow description' }),
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
52
|
+
], LabelingWorkflow.prototype, "description", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
55
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Label Studio project ID' }),
|
|
56
|
+
tslib_1.__metadata("design:type", Number)
|
|
57
|
+
], LabelingWorkflow.prototype, "projectId", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50 }),
|
|
60
|
+
(0, type_graphql_1.Field)(type => String, { description: 'Trigger type (Manual, Schedule, etc.)' }),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], LabelingWorkflow.prototype, "triggerType", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Trigger configuration as JSON' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], LabelingWorkflow.prototype, "triggerConfig", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'jsonb' }),
|
|
70
|
+
tslib_1.__metadata("design:type", String)
|
|
71
|
+
], LabelingWorkflow.prototype, "steps", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, default: workflow_types_js_1.WorkflowStatus.Draft }),
|
|
74
|
+
(0, type_graphql_1.Field)(type => String, { description: 'Current workflow status' }),
|
|
75
|
+
tslib_1.__metadata("design:type", String)
|
|
76
|
+
], LabelingWorkflow.prototype, "status", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
79
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Last execution time' }),
|
|
80
|
+
tslib_1.__metadata("design:type", Date)
|
|
81
|
+
], LabelingWorkflow.prototype, "lastExecutedAt", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
84
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Next scheduled execution time' }),
|
|
85
|
+
tslib_1.__metadata("design:type", Date)
|
|
86
|
+
], LabelingWorkflow.prototype, "nextExecutionAt", void 0);
|
|
87
|
+
tslib_1.__decorate([
|
|
88
|
+
(0, typeorm_1.OneToMany)(type => workflow_execution_js_1.WorkflowExecution, execution => execution.workflow),
|
|
89
|
+
(0, type_graphql_1.Field)(type => [workflow_execution_js_1.WorkflowExecution], { nullable: true, description: 'Executions of this workflow' }),
|
|
90
|
+
tslib_1.__metadata("design:type", Array)
|
|
91
|
+
], LabelingWorkflow.prototype, "executions", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
94
|
+
(0, type_graphql_1.Field)({ description: 'Creation timestamp' }),
|
|
95
|
+
tslib_1.__metadata("design:type", Date)
|
|
96
|
+
], LabelingWorkflow.prototype, "createdAt", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
99
|
+
(0, type_graphql_1.Field)({ description: 'Last update timestamp' }),
|
|
100
|
+
tslib_1.__metadata("design:type", Date)
|
|
101
|
+
], LabelingWorkflow.prototype, "updatedAt", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
104
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp' }),
|
|
105
|
+
tslib_1.__metadata("design:type", Date)
|
|
106
|
+
], LabelingWorkflow.prototype, "deletedAt", void 0);
|
|
107
|
+
exports.LabelingWorkflow = LabelingWorkflow = tslib_1.__decorate([
|
|
108
|
+
(0, type_graphql_1.ObjectType)({
|
|
109
|
+
description: 'Entity representing a labeling workflow with orchestration steps'
|
|
110
|
+
}),
|
|
111
|
+
(0, typeorm_1.Entity)('labeling_workflows'),
|
|
112
|
+
(0, typeorm_1.Index)('ix_labeling_workflow_0', ['domain', 'projectId', 'status'], {
|
|
113
|
+
where: '"deleted_at" IS NULL'
|
|
114
|
+
}),
|
|
115
|
+
(0, typeorm_1.Index)('ix_labeling_workflow_1', ['domain', 'name'], {
|
|
116
|
+
where: '"deleted_at" IS NULL'
|
|
117
|
+
})
|
|
118
|
+
], LabelingWorkflow);
|
|
119
|
+
//# sourceMappingURL=labeling-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labeling-workflow.js","sourceRoot":"","sources":["../../server/service/labeling-workflow.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAyD;AACzD,iDAA8C;AAC9C,yDAAgD;AAChD,mEAA2D;AAC3D,kEAAwE;AAExE;;;;;GAKG;AAWI,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAqE5B,CAAA;AArEY,4CAAgB;AAG3B;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;4CACvD;AAIV;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;sCACvF,cAAM;gDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,QAA0B,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;;kDAC3C;AAIjB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACvB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;sCAC5E,gBAAI;iDAAA;AAGd;IAD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AgB;IAV5B,IAAA,yBAAU,EAAC;QACV,WAAW,EAAE,kEAAkE;KAChF,CAAC;IACD,IAAA,gBAAM,EAAC,oBAAoB,CAAC;IAC5B,IAAA,eAAK,EAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE;QAClE,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;QACnD,KAAK,EAAE,sBAAsB;KAC9B,CAAC;GACW,gBAAgB,CAqE5B","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, Int } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { WorkflowExecution } from './workflow-execution.js'\nimport { WorkflowStatus, TriggerType } from '../types/workflow-types.js'\n\n/**\n * LabelingWorkflow Entity\n *\n * Represents a labeling workflow definition with multiple steps.\n * Stores workflow configuration, steps, and trigger settings.\n */\n@ObjectType({\n description: 'Entity representing a labeling workflow with orchestration steps'\n})\n@Entity('labeling_workflows')\n@Index('ix_labeling_workflow_0', ['domain', 'projectId', 'status'], {\n where: '\"deleted_at\" IS NULL'\n})\n@Index('ix_labeling_workflow_1', ['domain', 'name'], {\n where: '\"deleted_at\" IS NULL'\n})\nexport class LabelingWorkflow {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique workflow identifier' })\n id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'Domain to which this workflow belongs' })\n domain?: Domain\n\n @RelationId((workflow: LabelingWorkflow) => workflow.domain)\n domainId?: string\n\n @ManyToOne(type => User)\n @Field(type => User, { nullable: true, description: 'User who created the workflow' })\n creator?: User\n\n @RelationId((workflow: LabelingWorkflow) => workflow.creator)\n creatorId?: string\n\n @Column()\n @Field({ description: 'Workflow name' })\n name: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Workflow description' })\n description?: string\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Label Studio project ID' })\n projectId: number\n\n @Column({ type: 'varchar', length: 50 })\n @Field(type => String, { description: 'Trigger type (Manual, Schedule, etc.)' })\n triggerType: TriggerType\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Trigger configuration as JSON' })\n triggerConfig?: string\n\n @Column({ type: 'jsonb' })\n steps: string // JSON string of WorkflowStep[] - internal storage\n\n @Column({ type: 'varchar', length: 50, default: WorkflowStatus.Draft })\n @Field(type => String, { description: 'Current workflow status' })\n status: WorkflowStatus\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Last execution time' })\n lastExecutedAt?: Date\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Next scheduled execution time' })\n nextExecutionAt?: Date\n\n @OneToMany(type => WorkflowExecution, execution => execution.workflow)\n @Field(type => [WorkflowExecution], { nullable: true, description: 'Executions of this workflow' })\n executions?: WorkflowExecution[]\n\n @CreateDateColumn({ type: 'timestamptz' })\n @Field({ description: 'Creation timestamp' })\n createdAt: Date\n\n @UpdateDateColumn({ type: 'timestamptz' })\n @Field({ description: 'Last update timestamp' })\n updatedAt: Date\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Soft delete timestamp' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { WorkflowExecution } from './workflow-execution.js';
|
|
3
|
+
import { WorkflowStepType } from '../types/workflow-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* WorkflowExecutionStep Entity
|
|
6
|
+
*
|
|
7
|
+
* Represents a single step within a workflow execution.
|
|
8
|
+
* Tracks step status, timing, output, and errors.
|
|
9
|
+
*/
|
|
10
|
+
export declare class WorkflowExecutionStep {
|
|
11
|
+
id: string;
|
|
12
|
+
domain?: Domain;
|
|
13
|
+
domainId?: string;
|
|
14
|
+
execution: WorkflowExecution;
|
|
15
|
+
executionId: string;
|
|
16
|
+
stepName: string;
|
|
17
|
+
stepType: WorkflowStepType;
|
|
18
|
+
order: number;
|
|
19
|
+
status: string;
|
|
20
|
+
output?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
startedAt?: Date;
|
|
23
|
+
completedAt?: Date;
|
|
24
|
+
durationMs?: number;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
updatedAt: Date;
|
|
27
|
+
deletedAt?: Date;
|
|
28
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowExecutionStep = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const workflow_execution_js_1 = require("./workflow-execution.js");
|
|
9
|
+
const workflow_types_js_1 = require("../types/workflow-types.js");
|
|
10
|
+
/**
|
|
11
|
+
* WorkflowExecutionStep Entity
|
|
12
|
+
*
|
|
13
|
+
* Represents a single step within a workflow execution.
|
|
14
|
+
* Tracks step status, timing, output, and errors.
|
|
15
|
+
*/
|
|
16
|
+
let WorkflowExecutionStep = class WorkflowExecutionStep {
|
|
17
|
+
};
|
|
18
|
+
exports.WorkflowExecutionStep = WorkflowExecutionStep;
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique step execution identifier' }),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], WorkflowExecutionStep.prototype, "id", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
26
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'Domain to which this step belongs' }),
|
|
27
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
28
|
+
], WorkflowExecutionStep.prototype, "domain", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.RelationId)((step) => step.domain),
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
32
|
+
], WorkflowExecutionStep.prototype, "domainId", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(type => workflow_execution_js_1.WorkflowExecution, execution => execution.steps),
|
|
35
|
+
(0, type_graphql_1.Field)(type => workflow_execution_js_1.WorkflowExecution, { description: 'Parent execution' }),
|
|
36
|
+
tslib_1.__metadata("design:type", workflow_execution_js_1.WorkflowExecution)
|
|
37
|
+
], WorkflowExecutionStep.prototype, "execution", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, typeorm_1.RelationId)((step) => step.execution),
|
|
40
|
+
(0, type_graphql_1.Field)({ description: 'Execution ID' }),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], WorkflowExecutionStep.prototype, "executionId", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
|
+
(0, type_graphql_1.Field)({ description: 'Step name' }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], WorkflowExecutionStep.prototype, "stepName", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50 }),
|
|
50
|
+
(0, type_graphql_1.Field)(type => String, { description: 'Step type' }),
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
52
|
+
], WorkflowExecutionStep.prototype, "stepType", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
55
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Step order in the workflow' }),
|
|
56
|
+
tslib_1.__metadata("design:type", Number)
|
|
57
|
+
], WorkflowExecutionStep.prototype, "order", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50 }),
|
|
60
|
+
(0, type_graphql_1.Field)({ description: 'Step status: pending, running, completed, failed, skipped' }),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], WorkflowExecutionStep.prototype, "status", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Step output data as JSON' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], WorkflowExecutionStep.prototype, "output", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
70
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Error message if failed' }),
|
|
71
|
+
tslib_1.__metadata("design:type", String)
|
|
72
|
+
], WorkflowExecutionStep.prototype, "error", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Step start time' }),
|
|
76
|
+
tslib_1.__metadata("design:type", Date)
|
|
77
|
+
], WorkflowExecutionStep.prototype, "startedAt", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
80
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Step completion time' }),
|
|
81
|
+
tslib_1.__metadata("design:type", Date)
|
|
82
|
+
], WorkflowExecutionStep.prototype, "completedAt", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
85
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Step duration in milliseconds' }),
|
|
86
|
+
tslib_1.__metadata("design:type", Number)
|
|
87
|
+
], WorkflowExecutionStep.prototype, "durationMs", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
90
|
+
(0, type_graphql_1.Field)({ description: 'Creation timestamp' }),
|
|
91
|
+
tslib_1.__metadata("design:type", Date)
|
|
92
|
+
], WorkflowExecutionStep.prototype, "createdAt", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
95
|
+
(0, type_graphql_1.Field)({ description: 'Last update timestamp' }),
|
|
96
|
+
tslib_1.__metadata("design:type", Date)
|
|
97
|
+
], WorkflowExecutionStep.prototype, "updatedAt", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
100
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp' }),
|
|
101
|
+
tslib_1.__metadata("design:type", Date)
|
|
102
|
+
], WorkflowExecutionStep.prototype, "deletedAt", void 0);
|
|
103
|
+
exports.WorkflowExecutionStep = WorkflowExecutionStep = tslib_1.__decorate([
|
|
104
|
+
(0, type_graphql_1.ObjectType)({
|
|
105
|
+
description: 'Entity representing a single step in a workflow execution'
|
|
106
|
+
}),
|
|
107
|
+
(0, typeorm_1.Entity)('workflow_execution_steps'),
|
|
108
|
+
(0, typeorm_1.Index)('ix_workflow_execution_step_0', ['domain', 'execution', 'status'], {
|
|
109
|
+
where: '"deleted_at" IS NULL'
|
|
110
|
+
}),
|
|
111
|
+
(0, typeorm_1.Index)('ix_workflow_execution_step_1', ['domain', 'execution', 'order'], {
|
|
112
|
+
where: '"deleted_at" IS NULL'
|
|
113
|
+
})
|
|
114
|
+
], WorkflowExecutionStep);
|
|
115
|
+
//# sourceMappingURL=workflow-execution-step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-execution-step.js","sourceRoot":"","sources":["../../server/service/workflow-execution-step.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAyD;AACzD,iDAA8C;AAC9C,mEAA2D;AAC3D,kEAA6D;AAE7D;;;;;GAKG;AAWI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAmEjC,CAAA;AAnEY,sDAAqB;AAGhC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;iDAC7D;AAIV;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;sCACnF,cAAM;qDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,IAA2B,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;uDACxC;AAIjB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,yCAAiB,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC;IAClE,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,yCAAiB,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;sCAC3D,yCAAiB;wDAAA;AAI5B;IAFC,IAAA,oBAAU,EAAC,CAAC,IAA2B,EAAE,EAAE,CAAC,IAAI,CAAC,SA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K,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EAAC,8BAA8B,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QACvE,KAAK,EAAE,sBAAsB;KAC9B,CAAC;GACW,qBAAqB,CAmEjC","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, Int } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { WorkflowExecution } from './workflow-execution.js'\nimport { WorkflowStepType } from '../types/workflow-types.js'\n\n/**\n * WorkflowExecutionStep Entity\n *\n * Represents a single step within a workflow execution.\n * Tracks step status, timing, output, and errors.\n */\n@ObjectType({\n description: 'Entity representing a single step in a workflow execution'\n})\n@Entity('workflow_execution_steps')\n@Index('ix_workflow_execution_step_0', ['domain', 'execution', 'status'], {\n where: '\"deleted_at\" IS NULL'\n})\n@Index('ix_workflow_execution_step_1', ['domain', 'execution', 'order'], {\n where: '\"deleted_at\" IS NULL'\n})\nexport class WorkflowExecutionStep {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique step execution identifier' })\n id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'Domain to which this step belongs' })\n domain?: Domain\n\n @RelationId((step: WorkflowExecutionStep) => step.domain)\n domainId?: string\n\n @ManyToOne(type => WorkflowExecution, execution => execution.steps)\n @Field(type => WorkflowExecution, { description: 'Parent execution' })\n execution: WorkflowExecution\n\n @RelationId((step: WorkflowExecutionStep) => step.execution)\n @Field({ description: 'Execution ID' })\n executionId: string\n\n @Column()\n @Field({ description: 'Step name' })\n stepName: string\n\n @Column({ type: 'varchar', length: 50 })\n @Field(type => String, { description: 'Step type' })\n stepType: WorkflowStepType\n\n @Column({ type: 'int' })\n @Field(type => Int, { description: 'Step order in the workflow' })\n order: number\n\n @Column({ type: 'varchar', length: 50 })\n @Field({ description: 'Step status: pending, running, completed, failed, skipped' })\n status: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Step output data as JSON' })\n output?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Error message if failed' })\n error?: string\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Step start time' })\n startedAt?: Date\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Step completion time' })\n completedAt?: Date\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'Step duration in milliseconds' })\n durationMs?: number\n\n @CreateDateColumn({ type: 'timestamptz' })\n @Field({ description: 'Creation timestamp' })\n createdAt: Date\n\n @UpdateDateColumn({ type: 'timestamptz' })\n @Field({ description: 'Last update timestamp' })\n updatedAt: Date\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Soft delete timestamp' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { LabelingWorkflow } from './labeling-workflow.js';
|
|
3
|
+
import { WorkflowExecutionStep } from './workflow-execution-step.js';
|
|
4
|
+
/**
|
|
5
|
+
* WorkflowExecution Entity
|
|
6
|
+
*
|
|
7
|
+
* Represents a single execution instance of a workflow.
|
|
8
|
+
* Tracks execution status, timing, and results.
|
|
9
|
+
*/
|
|
10
|
+
export declare class WorkflowExecution {
|
|
11
|
+
id: string;
|
|
12
|
+
domain?: Domain;
|
|
13
|
+
domainId?: string;
|
|
14
|
+
workflow: LabelingWorkflow;
|
|
15
|
+
workflowId: string;
|
|
16
|
+
workflowName: string;
|
|
17
|
+
status: string;
|
|
18
|
+
steps: WorkflowExecutionStep[];
|
|
19
|
+
summary?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
startedAt: Date;
|
|
22
|
+
completedAt?: Date;
|
|
23
|
+
totalDurationMs?: number;
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
deletedAt?: Date;
|
|
27
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowExecution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const labeling_workflow_js_1 = require("./labeling-workflow.js");
|
|
9
|
+
const workflow_execution_step_js_1 = require("./workflow-execution-step.js");
|
|
10
|
+
/**
|
|
11
|
+
* WorkflowExecution Entity
|
|
12
|
+
*
|
|
13
|
+
* Represents a single execution instance of a workflow.
|
|
14
|
+
* Tracks execution status, timing, and results.
|
|
15
|
+
*/
|
|
16
|
+
let WorkflowExecution = class WorkflowExecution {
|
|
17
|
+
};
|
|
18
|
+
exports.WorkflowExecution = WorkflowExecution;
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique execution identifier' }),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], WorkflowExecution.prototype, "id", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
26
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'Domain to which this execution belongs' }),
|
|
27
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
28
|
+
], WorkflowExecution.prototype, "domain", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.RelationId)((execution) => execution.domain),
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
32
|
+
], WorkflowExecution.prototype, "domainId", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(type => labeling_workflow_js_1.LabelingWorkflow, workflow => workflow.executions),
|
|
35
|
+
(0, type_graphql_1.Field)(type => labeling_workflow_js_1.LabelingWorkflow, { description: 'The workflow being executed' }),
|
|
36
|
+
tslib_1.__metadata("design:type", labeling_workflow_js_1.LabelingWorkflow)
|
|
37
|
+
], WorkflowExecution.prototype, "workflow", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, typeorm_1.RelationId)((execution) => execution.workflow),
|
|
40
|
+
(0, type_graphql_1.Field)({ description: 'Workflow ID' }),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], WorkflowExecution.prototype, "workflowId", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
|
+
(0, type_graphql_1.Field)({ description: 'Workflow name (cached)' }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], WorkflowExecution.prototype, "workflowName", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50 }),
|
|
50
|
+
(0, type_graphql_1.Field)({ description: 'Execution status: running, completed, failed' }),
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
52
|
+
], WorkflowExecution.prototype, "status", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.OneToMany)(type => workflow_execution_step_js_1.WorkflowExecutionStep, step => step.execution, { cascade: true }),
|
|
55
|
+
(0, type_graphql_1.Field)(type => [workflow_execution_step_js_1.WorkflowExecutionStep], { description: 'Execution steps' }),
|
|
56
|
+
tslib_1.__metadata("design:type", Array)
|
|
57
|
+
], WorkflowExecution.prototype, "steps", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
60
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Execution summary' }),
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
62
|
+
], WorkflowExecution.prototype, "summary", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Error message if failed' }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], WorkflowExecution.prototype, "error", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'timestamptz' }),
|
|
70
|
+
(0, type_graphql_1.Field)({ description: 'Execution start time' }),
|
|
71
|
+
tslib_1.__metadata("design:type", Date)
|
|
72
|
+
], WorkflowExecution.prototype, "startedAt", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
75
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Execution completion time' }),
|
|
76
|
+
tslib_1.__metadata("design:type", Date)
|
|
77
|
+
], WorkflowExecution.prototype, "completedAt", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
80
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Total duration in milliseconds' }),
|
|
81
|
+
tslib_1.__metadata("design:type", Number)
|
|
82
|
+
], WorkflowExecution.prototype, "totalDurationMs", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
85
|
+
(0, type_graphql_1.Field)({ description: 'Creation timestamp' }),
|
|
86
|
+
tslib_1.__metadata("design:type", Date)
|
|
87
|
+
], WorkflowExecution.prototype, "createdAt", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
90
|
+
(0, type_graphql_1.Field)({ description: 'Last update timestamp' }),
|
|
91
|
+
tslib_1.__metadata("design:type", Date)
|
|
92
|
+
], WorkflowExecution.prototype, "updatedAt", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
95
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Soft delete timestamp' }),
|
|
96
|
+
tslib_1.__metadata("design:type", Date)
|
|
97
|
+
], WorkflowExecution.prototype, "deletedAt", void 0);
|
|
98
|
+
exports.WorkflowExecution = WorkflowExecution = tslib_1.__decorate([
|
|
99
|
+
(0, type_graphql_1.ObjectType)({
|
|
100
|
+
description: 'Entity representing a workflow execution instance'
|
|
101
|
+
}),
|
|
102
|
+
(0, typeorm_1.Entity)('workflow_executions'),
|
|
103
|
+
(0, typeorm_1.Index)('ix_workflow_execution_0', ['domain', 'workflow', 'status'], {
|
|
104
|
+
where: '"deleted_at" IS NULL'
|
|
105
|
+
}),
|
|
106
|
+
(0, typeorm_1.Index)('ix_workflow_execution_1', ['domain', 'startedAt'], {
|
|
107
|
+
where: '"deleted_at" IS NULL'
|
|
108
|
+
})
|
|
109
|
+
], WorkflowExecution);
|
|
110
|
+
//# sourceMappingURL=workflow-execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-execution.js","sourceRoot":"","sources":["../../server/service/workflow-execution.ts"],"names":[],"mappings":";;;;AAAA,qCAUgB;AAChB,+CAAyD;AACzD,iDAA8C;AAC9C,iEAAyD;AACzD,6EAAoE;AAEpE;;;;;GAKG;AAWI,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CA+D7B,CAAA;AA/DY,8CAAiB;AAG5B;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAA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AC;IACzC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;sCACrC,IAAI;oDAAA;AAIf;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;sCACpD,IAAI;oDAAA;4BA9DL,iBAAiB;IAV7B,IAAA,yBAAU,EAAC;QACV,WAAW,EAAE,mDAAmD;KACjE,CAAC;IACD,IAAA,gBAAM,EAAC,qBAAqB,CAAC;IAC7B,IAAA,eAAK,EAAC,yBAAyB,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE;QAClE,KAAK,EAAE,sBAAsB;KAC9B,CAAC;IACD,IAAA,eAAK,EAAC,yBAAyB,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE;QACzD,KAAK,EAAE,sBAAsB;KAC9B,CAAC;GACW,iBAAiB,CA+D7B","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, Int } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { LabelingWorkflow } from './labeling-workflow.js'\nimport { WorkflowExecutionStep } from './workflow-execution-step.js'\n\n/**\n * WorkflowExecution Entity\n *\n * Represents a single execution instance of a workflow.\n * Tracks execution status, timing, and results.\n */\n@ObjectType({\n description: 'Entity representing a workflow execution instance'\n})\n@Entity('workflow_executions')\n@Index('ix_workflow_execution_0', ['domain', 'workflow', 'status'], {\n where: '\"deleted_at\" IS NULL'\n})\n@Index('ix_workflow_execution_1', ['domain', 'startedAt'], {\n where: '\"deleted_at\" IS NULL'\n})\nexport class WorkflowExecution {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique execution identifier' })\n id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'Domain to which this execution belongs' })\n domain?: Domain\n\n @RelationId((execution: WorkflowExecution) => execution.domain)\n domainId?: string\n\n @ManyToOne(type => LabelingWorkflow, workflow => workflow.executions)\n @Field(type => LabelingWorkflow, { description: 'The workflow being executed' })\n workflow: LabelingWorkflow\n\n @RelationId((execution: WorkflowExecution) => execution.workflow)\n @Field({ description: 'Workflow ID' })\n workflowId: string\n\n @Column()\n @Field({ description: 'Workflow name (cached)' })\n workflowName: string\n\n @Column({ type: 'varchar', length: 50 })\n @Field({ description: 'Execution status: running, completed, failed' })\n status: string\n\n @OneToMany(type => WorkflowExecutionStep, step => step.execution, { cascade: true })\n @Field(type => [WorkflowExecutionStep], { description: 'Execution steps' })\n steps: WorkflowExecutionStep[]\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Execution summary' })\n summary?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Error message if failed' })\n error?: string\n\n @Column({ type: 'timestamptz' })\n @Field({ description: 'Execution start time' })\n startedAt: Date\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Execution completion time' })\n completedAt?: Date\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'Total duration in milliseconds' })\n totalDurationMs?: number\n\n @CreateDateColumn({ type: 'timestamptz' })\n @Field({ description: 'Creation timestamp' })\n createdAt: Date\n\n @UpdateDateColumn({ type: 'timestamptz' })\n @Field({ description: 'Last update timestamp' })\n updatedAt: Date\n\n @Column({ type: 'timestamptz', nullable: true })\n @Field({ nullable: true, description: 'Soft delete timestamp' })\n deletedAt?: Date\n}\n"]}
|