@things-factory/operato-dataset 9.1.18 → 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/LABELING_INTEGRATION.md +584 -0
- package/dist-client/menu.d.ts +9 -0
- package/dist-client/menu.js +27 -0
- package/dist-client/menu.js.map +1 -1
- package/dist-client/pages/dataset-labeling-workflow-list.d.ts +18 -0
- package/dist-client/pages/dataset-labeling-workflow-list.js +283 -0
- package/dist-client/pages/dataset-labeling-workflow-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +2 -2
- package/dist-server/index.js +3 -2
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/index.d.ts +2 -1
- package/dist-server/service/index.js +3 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/labeling/dataset-labeling-workflow.d.ts +54 -0
- package/dist-server/service/labeling/dataset-labeling-workflow.js +264 -0
- package/dist-server/service/labeling/dataset-labeling-workflow.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -40
- package/schema.graphql +1592 -0
- package/things-factory.config.js +1 -1
- package/translations/en.json +1 -1
- package/translations/ja.json +1 -1
- package/translations/ko.json +1 -1
- package/translations/ms.json +1 -1
- package/translations/zh.json +1 -1
package/dist-server/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import './routes';
|
|
1
|
+
export * from './service/index.js';
|
|
2
|
+
import './routes.js';
|
package/dist-server/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("
|
|
4
|
-
require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./service/index.js"), exports);
|
|
5
|
+
require("./routes.js");
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAElC,uBAAoB","sourcesContent":["export * from './service/index.js'\n\nimport './routes.js'\n"]}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.schema = exports.entities = void 0;
|
|
5
5
|
/* IMPORT ENTITIES AND RESOLVERS */
|
|
6
|
+
const dataset_labeling_workflow_js_1 = require("./labeling/dataset-labeling-workflow.js");
|
|
6
7
|
exports.entities = [
|
|
7
8
|
/* ENTITIES */
|
|
8
9
|
];
|
|
9
10
|
exports.schema = {
|
|
10
11
|
resolverClasses: [
|
|
11
|
-
|
|
12
|
+
/* RESOLVER CLASSES */
|
|
13
|
+
dataset_labeling_workflow_js_1.DatasetLabelingWorkflow
|
|
12
14
|
]
|
|
13
15
|
};
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";AAAA,yBAAyB;;;AAEzB,mCAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";AAAA,yBAAyB;;;AAEzB,mCAAmC;AACnC,0FAAiF;AAEpE,QAAA,QAAQ,GAAG;AACtB,cAAc;CACf,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,sDAAuB;KACxB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { DatasetLabelingWorkflow } from './labeling/dataset-labeling-workflow.js'\n\nexport const entities = [\n /* ENTITIES */\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n DatasetLabelingWorkflow\n ]\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LabelingWorkflow, WorkflowExecution, WorkflowExecutionResult } from '@things-factory/labeling';
|
|
2
|
+
type ResolverContext = {
|
|
3
|
+
state: {
|
|
4
|
+
domain: any;
|
|
5
|
+
user: any;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Dataset Labeling Workflow Resolver
|
|
10
|
+
*
|
|
11
|
+
* operato-dataset에서 labeling workflow 기능을 사용하기 위한 통합 레이어
|
|
12
|
+
*
|
|
13
|
+
* 주요 기능:
|
|
14
|
+
* - DataSet과 연동된 자동 레이블링 워크플로우
|
|
15
|
+
* - DataSet 업데이트 시 자동 워크플로우 트리거
|
|
16
|
+
* - DataSet별 워크플로우 조회
|
|
17
|
+
*/
|
|
18
|
+
export declare class DatasetLabelingWorkflow {
|
|
19
|
+
private workflowService;
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* DataSet을 위한 자동 레이블링 워크플로우 생성
|
|
23
|
+
*/
|
|
24
|
+
createDatasetLabelingWorkflow(context: ResolverContext, dataSetId: string, projectId: number, workflowName: string, modelId?: string, autoStart?: boolean): Promise<LabelingWorkflow>;
|
|
25
|
+
/**
|
|
26
|
+
* 빠른 레이블링 워크플로우 (AI 예측 없이 수동 레이블링만)
|
|
27
|
+
*/
|
|
28
|
+
createQuickLabelingWorkflow(context: ResolverContext, dataSetId: string, projectId: number, workflowName: string): Promise<LabelingWorkflow>;
|
|
29
|
+
/**
|
|
30
|
+
* 워크플로우 실행
|
|
31
|
+
*/
|
|
32
|
+
executeDatasetWorkflow(context: ResolverContext, workflowId: string, parameters?: string): Promise<WorkflowExecutionResult>;
|
|
33
|
+
/**
|
|
34
|
+
* DataSet의 워크플로우 목록 조회
|
|
35
|
+
*/
|
|
36
|
+
datasetLabelingWorkflows(context: ResolverContext, projectId?: number): Promise<LabelingWorkflow[]>;
|
|
37
|
+
/**
|
|
38
|
+
* 워크플로우 상세 조회
|
|
39
|
+
*/
|
|
40
|
+
datasetLabelingWorkflow(context: ResolverContext, workflowId: string): Promise<LabelingWorkflow>;
|
|
41
|
+
/**
|
|
42
|
+
* 워크플로우 실행 상태 조회
|
|
43
|
+
*/
|
|
44
|
+
datasetWorkflowExecution(context: ResolverContext, executionId: string): Promise<WorkflowExecution>;
|
|
45
|
+
/**
|
|
46
|
+
* 워크플로우 일시정지
|
|
47
|
+
*/
|
|
48
|
+
pauseDatasetWorkflow(context: ResolverContext, workflowId: string): Promise<LabelingWorkflow>;
|
|
49
|
+
/**
|
|
50
|
+
* 워크플로우 재개
|
|
51
|
+
*/
|
|
52
|
+
resumeDatasetWorkflow(context: ResolverContext, workflowId: string): Promise<LabelingWorkflow>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatasetLabelingWorkflow = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const labeling_1 = require("@things-factory/labeling");
|
|
7
|
+
/**
|
|
8
|
+
* Dataset Labeling Workflow Resolver
|
|
9
|
+
*
|
|
10
|
+
* operato-dataset에서 labeling workflow 기능을 사용하기 위한 통합 레이어
|
|
11
|
+
*
|
|
12
|
+
* 주요 기능:
|
|
13
|
+
* - DataSet과 연동된 자동 레이블링 워크플로우
|
|
14
|
+
* - DataSet 업데이트 시 자동 워크플로우 트리거
|
|
15
|
+
* - DataSet별 워크플로우 조회
|
|
16
|
+
*/
|
|
17
|
+
let DatasetLabelingWorkflow = class DatasetLabelingWorkflow {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.workflowService = new labeling_1.LabelingWorkflowService();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* DataSet을 위한 자동 레이블링 워크플로우 생성
|
|
23
|
+
*/
|
|
24
|
+
async createDatasetLabelingWorkflow(context, dataSetId, projectId, workflowName, modelId, autoStart) {
|
|
25
|
+
// DataSet → Label Studio 자동 레이블링 워크플로우
|
|
26
|
+
const workflowRequest = {
|
|
27
|
+
name: workflowName || `Auto-label DataSet ${dataSetId}`,
|
|
28
|
+
description: `Automatic labeling workflow for dataset ${dataSetId}`,
|
|
29
|
+
projectId,
|
|
30
|
+
triggerType: labeling_1.TriggerType.Manual,
|
|
31
|
+
steps: [
|
|
32
|
+
{
|
|
33
|
+
name: 'Import Data from DataSet',
|
|
34
|
+
type: labeling_1.WorkflowStepType.ImportData,
|
|
35
|
+
config: JSON.stringify({
|
|
36
|
+
sourceType: 'dataset',
|
|
37
|
+
dataSetId,
|
|
38
|
+
imageField: 'image',
|
|
39
|
+
limit: 1000
|
|
40
|
+
}),
|
|
41
|
+
continueOnError: false
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Generate AI Predictions',
|
|
45
|
+
type: labeling_1.WorkflowStepType.GeneratePredictions,
|
|
46
|
+
config: JSON.stringify({
|
|
47
|
+
modelId: modelId || 'default-model',
|
|
48
|
+
confidenceThreshold: 0.7,
|
|
49
|
+
forceRegenerate: false
|
|
50
|
+
}),
|
|
51
|
+
continueOnError: true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Wait for Human Annotation',
|
|
55
|
+
type: labeling_1.WorkflowStepType.WaitForAnnotations,
|
|
56
|
+
config: JSON.stringify({
|
|
57
|
+
minCompletionRate: 0.9,
|
|
58
|
+
autoProceed: false
|
|
59
|
+
}),
|
|
60
|
+
continueOnError: false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Sync Annotations Back to DataSet',
|
|
64
|
+
type: labeling_1.WorkflowStepType.SyncAnnotations,
|
|
65
|
+
config: JSON.stringify({
|
|
66
|
+
completedOnly: true
|
|
67
|
+
}),
|
|
68
|
+
continueOnError: false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'Validate Quality',
|
|
72
|
+
type: labeling_1.WorkflowStepType.ValidateQuality,
|
|
73
|
+
config: JSON.stringify({
|
|
74
|
+
minQualityScore: 0.8
|
|
75
|
+
}),
|
|
76
|
+
continueOnError: true
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
autoStart: autoStart || false
|
|
80
|
+
};
|
|
81
|
+
return await this.workflowService.createLabelingWorkflow(workflowRequest, context);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 빠른 레이블링 워크플로우 (AI 예측 없이 수동 레이블링만)
|
|
85
|
+
*/
|
|
86
|
+
async createQuickLabelingWorkflow(context, dataSetId, projectId, workflowName) {
|
|
87
|
+
const workflowRequest = {
|
|
88
|
+
name: workflowName || `Quick Label DataSet ${dataSetId}`,
|
|
89
|
+
description: `Quick manual labeling workflow for dataset ${dataSetId}`,
|
|
90
|
+
projectId,
|
|
91
|
+
triggerType: labeling_1.TriggerType.Manual,
|
|
92
|
+
steps: [
|
|
93
|
+
{
|
|
94
|
+
name: 'Import Data from DataSet',
|
|
95
|
+
type: labeling_1.WorkflowStepType.ImportData,
|
|
96
|
+
config: JSON.stringify({
|
|
97
|
+
sourceType: 'dataset',
|
|
98
|
+
dataSetId,
|
|
99
|
+
imageField: 'image',
|
|
100
|
+
limit: 100
|
|
101
|
+
}),
|
|
102
|
+
continueOnError: false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Wait for Annotation',
|
|
106
|
+
type: labeling_1.WorkflowStepType.WaitForAnnotations,
|
|
107
|
+
config: JSON.stringify({
|
|
108
|
+
minCompletionRate: 1.0,
|
|
109
|
+
autoProceed: false
|
|
110
|
+
}),
|
|
111
|
+
continueOnError: false
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'Sync to DataSet',
|
|
115
|
+
type: labeling_1.WorkflowStepType.SyncAnnotations,
|
|
116
|
+
config: JSON.stringify({
|
|
117
|
+
completedOnly: true
|
|
118
|
+
}),
|
|
119
|
+
continueOnError: false
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
autoStart: false
|
|
123
|
+
};
|
|
124
|
+
return await this.workflowService.createLabelingWorkflow(workflowRequest, context);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 워크플로우 실행
|
|
128
|
+
*/
|
|
129
|
+
async executeDatasetWorkflow(context, workflowId, parameters) {
|
|
130
|
+
return await this.workflowService.executeLabelingWorkflow({ workflowId, parameters }, context);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* DataSet의 워크플로우 목록 조회
|
|
134
|
+
*/
|
|
135
|
+
async datasetLabelingWorkflows(context, projectId) {
|
|
136
|
+
const result = await this.workflowService.labelingWorkflows(projectId, context);
|
|
137
|
+
return result.items;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 워크플로우 상세 조회
|
|
141
|
+
*/
|
|
142
|
+
async datasetLabelingWorkflow(context, workflowId) {
|
|
143
|
+
return await this.workflowService.labelingWorkflow(workflowId, context);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* 워크플로우 실행 상태 조회
|
|
147
|
+
*/
|
|
148
|
+
async datasetWorkflowExecution(context, executionId) {
|
|
149
|
+
return await this.workflowService.workflowExecution(executionId, context);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 워크플로우 일시정지
|
|
153
|
+
*/
|
|
154
|
+
async pauseDatasetWorkflow(context, workflowId) {
|
|
155
|
+
return await this.workflowService.pauseLabelingWorkflow(workflowId, context);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* 워크플로우 재개
|
|
159
|
+
*/
|
|
160
|
+
async resumeDatasetWorkflow(context, workflowId) {
|
|
161
|
+
return await this.workflowService.resumeLabelingWorkflow(workflowId, context);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
exports.DatasetLabelingWorkflow = DatasetLabelingWorkflow;
|
|
165
|
+
tslib_1.__decorate([
|
|
166
|
+
(0, type_graphql_1.Mutation)(returns => labeling_1.LabelingWorkflow, {
|
|
167
|
+
description: 'Create automatic labeling workflow for a dataset'
|
|
168
|
+
}),
|
|
169
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "mutation")'),
|
|
170
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
171
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('dataSetId')),
|
|
172
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('projectId', type => type_graphql_1.Int)),
|
|
173
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('workflowName')),
|
|
174
|
+
tslib_1.__param(4, (0, type_graphql_1.Arg)('modelId', { nullable: true })),
|
|
175
|
+
tslib_1.__param(5, (0, type_graphql_1.Arg)('autoStart', { nullable: true, defaultValue: false })),
|
|
176
|
+
tslib_1.__metadata("design:type", Function),
|
|
177
|
+
tslib_1.__metadata("design:paramtypes", [Object, String, Number, String, String, Boolean]),
|
|
178
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
179
|
+
], DatasetLabelingWorkflow.prototype, "createDatasetLabelingWorkflow", null);
|
|
180
|
+
tslib_1.__decorate([
|
|
181
|
+
(0, type_graphql_1.Mutation)(returns => labeling_1.LabelingWorkflow, {
|
|
182
|
+
description: 'Create manual-only labeling workflow for quick annotation'
|
|
183
|
+
}),
|
|
184
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "mutation")'),
|
|
185
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
186
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('dataSetId')),
|
|
187
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('projectId', type => type_graphql_1.Int)),
|
|
188
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('workflowName')),
|
|
189
|
+
tslib_1.__metadata("design:type", Function),
|
|
190
|
+
tslib_1.__metadata("design:paramtypes", [Object, String, Number, String]),
|
|
191
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
192
|
+
], DatasetLabelingWorkflow.prototype, "createQuickLabelingWorkflow", null);
|
|
193
|
+
tslib_1.__decorate([
|
|
194
|
+
(0, type_graphql_1.Mutation)(returns => labeling_1.WorkflowExecutionResult, {
|
|
195
|
+
description: 'Execute a labeling workflow'
|
|
196
|
+
}),
|
|
197
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "mutation")'),
|
|
198
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
199
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('workflowId')),
|
|
200
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('parameters', { nullable: true })),
|
|
201
|
+
tslib_1.__metadata("design:type", Function),
|
|
202
|
+
tslib_1.__metadata("design:paramtypes", [Object, String, String]),
|
|
203
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
204
|
+
], DatasetLabelingWorkflow.prototype, "executeDatasetWorkflow", null);
|
|
205
|
+
tslib_1.__decorate([
|
|
206
|
+
(0, type_graphql_1.Query)(returns => [labeling_1.LabelingWorkflow], {
|
|
207
|
+
description: 'Get labeling workflows for a specific project'
|
|
208
|
+
}),
|
|
209
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "query")'),
|
|
210
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
211
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('projectId', type => type_graphql_1.Int, { nullable: true })),
|
|
212
|
+
tslib_1.__metadata("design:type", Function),
|
|
213
|
+
tslib_1.__metadata("design:paramtypes", [Object, Number]),
|
|
214
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
215
|
+
], DatasetLabelingWorkflow.prototype, "datasetLabelingWorkflows", null);
|
|
216
|
+
tslib_1.__decorate([
|
|
217
|
+
(0, type_graphql_1.Query)(returns => labeling_1.LabelingWorkflow, {
|
|
218
|
+
description: 'Get workflow details'
|
|
219
|
+
}),
|
|
220
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "query")'),
|
|
221
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
222
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('workflowId')),
|
|
223
|
+
tslib_1.__metadata("design:type", Function),
|
|
224
|
+
tslib_1.__metadata("design:paramtypes", [Object, String]),
|
|
225
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
226
|
+
], DatasetLabelingWorkflow.prototype, "datasetLabelingWorkflow", null);
|
|
227
|
+
tslib_1.__decorate([
|
|
228
|
+
(0, type_graphql_1.Query)(returns => labeling_1.WorkflowExecution, {
|
|
229
|
+
description: 'Get workflow execution status'
|
|
230
|
+
}),
|
|
231
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "query")'),
|
|
232
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
233
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('executionId')),
|
|
234
|
+
tslib_1.__metadata("design:type", Function),
|
|
235
|
+
tslib_1.__metadata("design:paramtypes", [Object, String]),
|
|
236
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
237
|
+
], DatasetLabelingWorkflow.prototype, "datasetWorkflowExecution", null);
|
|
238
|
+
tslib_1.__decorate([
|
|
239
|
+
(0, type_graphql_1.Mutation)(returns => labeling_1.LabelingWorkflow, {
|
|
240
|
+
description: 'Pause a workflow'
|
|
241
|
+
}),
|
|
242
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "mutation")'),
|
|
243
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
244
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('workflowId')),
|
|
245
|
+
tslib_1.__metadata("design:type", Function),
|
|
246
|
+
tslib_1.__metadata("design:paramtypes", [Object, String]),
|
|
247
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
248
|
+
], DatasetLabelingWorkflow.prototype, "pauseDatasetWorkflow", null);
|
|
249
|
+
tslib_1.__decorate([
|
|
250
|
+
(0, type_graphql_1.Mutation)(returns => labeling_1.LabelingWorkflow, {
|
|
251
|
+
description: 'Resume a paused workflow'
|
|
252
|
+
}),
|
|
253
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "mutation")'),
|
|
254
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
255
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('workflowId')),
|
|
256
|
+
tslib_1.__metadata("design:type", Function),
|
|
257
|
+
tslib_1.__metadata("design:paramtypes", [Object, String]),
|
|
258
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
259
|
+
], DatasetLabelingWorkflow.prototype, "resumeDatasetWorkflow", null);
|
|
260
|
+
exports.DatasetLabelingWorkflow = DatasetLabelingWorkflow = tslib_1.__decorate([
|
|
261
|
+
(0, type_graphql_1.Resolver)(),
|
|
262
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
263
|
+
], DatasetLabelingWorkflow);
|
|
264
|
+
//# sourceMappingURL=dataset-labeling-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset-labeling-workflow.js","sourceRoot":"","sources":["../../../server/service/labeling/dataset-labeling-workflow.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAClF,uDAUiC;AASjC;;;;;;;;;GASG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGlC;QACE,IAAI,CAAC,eAAe,GAAG,IAAI,kCAAuB,EAAE,CAAA;IACtD,CAAC;IAED;;OAEG;IAKG,AAAN,KAAK,CAAC,6BAA6B,CAC1B,OAAwB,EACb,SAAiB,EACJ,SAAiB,EAC3B,YAAoB,EACL,OAAgB,EACO,SAAmB;QAE9E,uCAAuC;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AElE,mBAAA,IAAA,kBAAG,GAAE,CAAA;IACL,mBAAA,IAAA,kBAAG,EAAC,YAAY,CAAC,CAAA;;;;oEAGnB;kCA5NU,uBAAuB;IADnC,IAAA,uBAAQ,GAAE;;GACE,uBAAuB,CA6NnC","sourcesContent":["import { Resolver, Query, Mutation, Arg, Ctx, Int, Directive } from 'type-graphql'\nimport {\n LabelingWorkflowService,\n CreateWorkflowRequest,\n ExecuteWorkflowRequest,\n LabelingWorkflow,\n WorkflowExecution,\n WorkflowExecutionResult,\n WorkflowStatus,\n WorkflowStepType,\n TriggerType\n} from '@things-factory/labeling'\n\ntype ResolverContext = {\n state: {\n domain: any\n user: any\n }\n}\n\n/**\n * Dataset Labeling Workflow Resolver\n *\n * operato-dataset에서 labeling workflow 기능을 사용하기 위한 통합 레이어\n *\n * 주요 기능:\n * - DataSet과 연동된 자동 레이블링 워크플로우\n * - DataSet 업데이트 시 자동 워크플로우 트리거\n * - DataSet별 워크플로우 조회\n */\n@Resolver()\nexport class DatasetLabelingWorkflow {\n private workflowService: LabelingWorkflowService\n\n constructor() {\n this.workflowService = new LabelingWorkflowService()\n }\n\n /**\n * DataSet을 위한 자동 레이블링 워크플로우 생성\n */\n @Mutation(returns => LabelingWorkflow, {\n description: 'Create automatic labeling workflow for a dataset'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"mutation\")')\n async createDatasetLabelingWorkflow(\n @Ctx() context: ResolverContext,\n @Arg('dataSetId') dataSetId: string,\n @Arg('projectId', type => Int) projectId: number,\n @Arg('workflowName') workflowName: string,\n @Arg('modelId', { nullable: true }) modelId?: string,\n @Arg('autoStart', { nullable: true, defaultValue: false }) autoStart?: boolean\n ): Promise<LabelingWorkflow> {\n // DataSet → Label Studio 자동 레이블링 워크플로우\n const workflowRequest: CreateWorkflowRequest = {\n name: workflowName || `Auto-label DataSet ${dataSetId}`,\n description: `Automatic labeling workflow for dataset ${dataSetId}`,\n projectId,\n triggerType: TriggerType.Manual,\n steps: [\n {\n name: 'Import Data from DataSet',\n type: WorkflowStepType.ImportData,\n config: JSON.stringify({\n sourceType: 'dataset',\n dataSetId,\n imageField: 'image',\n limit: 1000\n }),\n continueOnError: false\n },\n {\n name: 'Generate AI Predictions',\n type: WorkflowStepType.GeneratePredictions,\n config: JSON.stringify({\n modelId: modelId || 'default-model',\n confidenceThreshold: 0.7,\n forceRegenerate: false\n }),\n continueOnError: true\n },\n {\n name: 'Wait for Human Annotation',\n type: WorkflowStepType.WaitForAnnotations,\n config: JSON.stringify({\n minCompletionRate: 0.9,\n autoProceed: false\n }),\n continueOnError: false\n },\n {\n name: 'Sync Annotations Back to DataSet',\n type: WorkflowStepType.SyncAnnotations,\n config: JSON.stringify({\n completedOnly: true\n }),\n continueOnError: false\n },\n {\n name: 'Validate Quality',\n type: WorkflowStepType.ValidateQuality,\n config: JSON.stringify({\n minQualityScore: 0.8\n }),\n continueOnError: true\n }\n ],\n autoStart: autoStart || false\n }\n\n return await this.workflowService.createLabelingWorkflow(workflowRequest, context)\n }\n\n /**\n * 빠른 레이블링 워크플로우 (AI 예측 없이 수동 레이블링만)\n */\n @Mutation(returns => LabelingWorkflow, {\n description: 'Create manual-only labeling workflow for quick annotation'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"mutation\")')\n async createQuickLabelingWorkflow(\n @Ctx() context: ResolverContext,\n @Arg('dataSetId') dataSetId: string,\n @Arg('projectId', type => Int) projectId: number,\n @Arg('workflowName') workflowName: string\n ): Promise<LabelingWorkflow> {\n const workflowRequest: CreateWorkflowRequest = {\n name: workflowName || `Quick Label DataSet ${dataSetId}`,\n description: `Quick manual labeling workflow for dataset ${dataSetId}`,\n projectId,\n triggerType: TriggerType.Manual,\n steps: [\n {\n name: 'Import Data from DataSet',\n type: WorkflowStepType.ImportData,\n config: JSON.stringify({\n sourceType: 'dataset',\n dataSetId,\n imageField: 'image',\n limit: 100\n }),\n continueOnError: false\n },\n {\n name: 'Wait for Annotation',\n type: WorkflowStepType.WaitForAnnotations,\n config: JSON.stringify({\n minCompletionRate: 1.0,\n autoProceed: false\n }),\n continueOnError: false\n },\n {\n name: 'Sync to DataSet',\n type: WorkflowStepType.SyncAnnotations,\n config: JSON.stringify({\n completedOnly: true\n }),\n continueOnError: false\n }\n ],\n autoStart: false\n }\n\n return await this.workflowService.createLabelingWorkflow(workflowRequest, context)\n }\n\n /**\n * 워크플로우 실행\n */\n @Mutation(returns => WorkflowExecutionResult, {\n description: 'Execute a labeling workflow'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"mutation\")')\n async executeDatasetWorkflow(\n @Ctx() context: ResolverContext,\n @Arg('workflowId') workflowId: string,\n @Arg('parameters', { nullable: true }) parameters?: string\n ): Promise<WorkflowExecutionResult> {\n return await this.workflowService.executeLabelingWorkflow({ workflowId, parameters }, context)\n }\n\n /**\n * DataSet의 워크플로우 목록 조회\n */\n @Query(returns => [LabelingWorkflow], {\n description: 'Get labeling workflows for a specific project'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"query\")')\n async datasetLabelingWorkflows(\n @Ctx() context: ResolverContext,\n @Arg('projectId', type => Int, { nullable: true }) projectId?: number\n ): Promise<LabelingWorkflow[]> {\n const result = await this.workflowService.labelingWorkflows(projectId, context)\n return result.items\n }\n\n /**\n * 워크플로우 상세 조회\n */\n @Query(returns => LabelingWorkflow, {\n description: 'Get workflow details'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"query\")')\n async datasetLabelingWorkflow(\n @Ctx() context: ResolverContext,\n @Arg('workflowId') workflowId: string\n ): Promise<LabelingWorkflow> {\n return await this.workflowService.labelingWorkflow(workflowId, context)\n }\n\n /**\n * 워크플로우 실행 상태 조회\n */\n @Query(returns => WorkflowExecution, {\n description: 'Get workflow execution status'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"query\")')\n async datasetWorkflowExecution(\n @Ctx() context: ResolverContext,\n @Arg('executionId') executionId: string\n ): Promise<WorkflowExecution> {\n return await this.workflowService.workflowExecution(executionId, context)\n }\n\n /**\n * 워크플로우 일시정지\n */\n @Mutation(returns => LabelingWorkflow, {\n description: 'Pause a workflow'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"mutation\")')\n async pauseDatasetWorkflow(\n @Ctx() context: ResolverContext,\n @Arg('workflowId') workflowId: string\n ): Promise<LabelingWorkflow> {\n return await this.workflowService.pauseLabelingWorkflow(workflowId, context)\n }\n\n /**\n * 워크플로우 재개\n */\n @Mutation(returns => LabelingWorkflow, {\n description: 'Resume a paused workflow'\n })\n @Directive('@privilege(category: \"data-set\", privilege: \"mutation\")')\n async resumeDatasetWorkflow(\n @Ctx() context: ResolverContext,\n @Arg('workflowId') workflowId: string\n ): Promise<LabelingWorkflow> {\n return await this.workflowService.resumeLabelingWorkflow(workflowId, context)\n }\n}\n"]}
|