@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.
Files changed (55) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/ENTITY_IMPLEMENTATION.md +351 -0
  3. package/INTEGRATION_COMPLETE.md +531 -0
  4. package/MIGRATION_GUIDE.md +310 -0
  5. package/README.md +551 -0
  6. package/REFACTORING_SUMMARY.md +212 -0
  7. package/UI_DOCUMENTATION.md +552 -0
  8. package/dist-client/index.d.ts +3 -0
  9. package/dist-client/index.js +9 -0
  10. package/dist-client/index.js.map +1 -0
  11. package/dist-client/pages/labeling-workflow-builder.d.ts +26 -0
  12. package/dist-client/pages/labeling-workflow-builder.js +636 -0
  13. package/dist-client/pages/labeling-workflow-builder.js.map +1 -0
  14. package/dist-client/pages/labeling-workflow-list.d.ts +24 -0
  15. package/dist-client/pages/labeling-workflow-list.js +495 -0
  16. package/dist-client/pages/labeling-workflow-list.js.map +1 -0
  17. package/dist-client/route.d.ts +1 -0
  18. package/dist-client/route.js +47 -0
  19. package/dist-client/route.js.map +1 -0
  20. package/dist-client/tsconfig.tsbuildinfo +1 -0
  21. package/dist-server/entities/index.d.ts +5 -0
  22. package/dist-server/entities/index.js +11 -0
  23. package/dist-server/entities/index.js.map +1 -0
  24. package/dist-server/index.d.ts +3 -0
  25. package/dist-server/index.js +7 -0
  26. package/dist-server/index.js.map +1 -0
  27. package/dist-server/route.d.ts +2 -0
  28. package/dist-server/route.js +6 -0
  29. package/dist-server/route.js.map +1 -0
  30. package/dist-server/service/index.d.ts +8 -0
  31. package/dist-server/service/index.js +21 -0
  32. package/dist-server/service/index.js.map +1 -0
  33. package/dist-server/service/labeling-workflow-service.d.ts +69 -0
  34. package/dist-server/service/labeling-workflow-service.js +521 -0
  35. package/dist-server/service/labeling-workflow-service.js.map +1 -0
  36. package/dist-server/service/labeling-workflow.d.ts +30 -0
  37. package/dist-server/service/labeling-workflow.js +119 -0
  38. package/dist-server/service/labeling-workflow.js.map +1 -0
  39. package/dist-server/service/workflow-execution-step.d.ts +28 -0
  40. package/dist-server/service/workflow-execution-step.js +115 -0
  41. package/dist-server/service/workflow-execution-step.js.map +1 -0
  42. package/dist-server/service/workflow-execution.d.ts +27 -0
  43. package/dist-server/service/workflow-execution.js +110 -0
  44. package/dist-server/service/workflow-execution.js.map +1 -0
  45. package/dist-server/tsconfig.tsbuildinfo +1 -0
  46. package/dist-server/types/workflow-types.d.ts +141 -0
  47. package/dist-server/types/workflow-types.js +488 -0
  48. package/dist-server/types/workflow-types.js.map +1 -0
  49. package/package.json +51 -0
  50. package/things-factory.config.js +11 -0
  51. package/translations/en.json +6 -0
  52. package/translations/ja.json +6 -0
  53. package/translations/ko.json +6 -0
  54. package/translations/ms.json +6 -0
  55. package/translations/zh.json +6 -0
@@ -0,0 +1,310 @@
1
+ # Migration Guide: labeling-scenario → labeling (workflow)
2
+
3
+ ## Overview
4
+
5
+ This guide covers the migration from the old `labeling-scenario` implementation in `@things-factory/integration-label-studio` to the new `@things-factory/labeling` package with `workflow` terminology.
6
+
7
+ ## What Changed
8
+
9
+ ### 1. Package Structure
10
+
11
+ **Before:**
12
+ ```
13
+ packages/integration-label-studio/
14
+ server/
15
+ types/scenario-types.ts
16
+ service/labeling-scenario-service.ts
17
+ ```
18
+
19
+ **After:**
20
+ ```
21
+ packages/labeling/ # NEW PACKAGE
22
+ server/
23
+ types/workflow-types.ts # Renamed from scenario-types
24
+ service/labeling-workflow-service.ts # Renamed from labeling-scenario-service
25
+ ```
26
+
27
+ ### 2. Terminology Changes
28
+
29
+ All `Scenario` terms have been renamed to `Workflow`:
30
+
31
+ | Old Term | New Term |
32
+ |----------|----------|
33
+ | `LabelingScenario` | `LabelingWorkflow` |
34
+ | `ScenarioStep` | `WorkflowStep` |
35
+ | `ScenarioStepType` | `WorkflowStepType` |
36
+ | `ScenarioStatus` | `WorkflowStatus` |
37
+ | `ScenarioExecution` | `WorkflowExecution` |
38
+ | `ScenarioExecutionStep` | `WorkflowExecutionStep` |
39
+ | `CreateScenarioRequest` | `CreateWorkflowRequest` |
40
+ | `ExecuteScenarioRequest` | `ExecuteWorkflowRequest` |
41
+ | `LabelingScenarioList` | `LabelingWorkflowList` |
42
+ | `ScenarioExecutionList` | `WorkflowExecutionList` |
43
+ | `LabelingScenarioService` | `LabelingWorkflowService` |
44
+
45
+ ### 3. GraphQL API Changes
46
+
47
+ #### Mutations
48
+
49
+ | Old Mutation | New Mutation |
50
+ |-------------|-------------|
51
+ | `createLabelingScenario` | `createLabelingWorkflow` |
52
+ | `executeScenario` | `executeLabelingWorkflow` |
53
+ | `pauseScenario` | `pauseLabelingWorkflow` |
54
+ | `resumeScenario` | `resumeLabelingWorkflow` |
55
+
56
+ #### Queries
57
+
58
+ | Old Query | New Query |
59
+ |-----------|-----------|
60
+ | `labelingScenario` | `labelingWorkflow` |
61
+ | `labelingScenarios` | `labelingWorkflows` |
62
+ | `scenarioExecution` | `workflowExecution` |
63
+ | `scenarioExecutions` | `workflowExecutions` |
64
+
65
+ #### Arguments
66
+
67
+ | Old Argument | New Argument |
68
+ |-------------|-------------|
69
+ | `scenarioId` | `workflowId` |
70
+
71
+ ## Migration Steps
72
+
73
+ ### For Backend Code
74
+
75
+ 1. **Update package dependencies** in your `package.json`:
76
+
77
+ ```json
78
+ {
79
+ "dependencies": {
80
+ "@things-factory/labeling": "^9.1.0"
81
+ }
82
+ }
83
+ ```
84
+
85
+ 2. **Update imports**:
86
+
87
+ **Before:**
88
+ ```typescript
89
+ import {
90
+ LabelingScenario,
91
+ ScenarioStep,
92
+ CreateScenarioRequest
93
+ } from '@things-factory/integration-label-studio/dist-server/types/scenario-types.js'
94
+ ```
95
+
96
+ **After:**
97
+ ```typescript
98
+ import {
99
+ LabelingWorkflow,
100
+ WorkflowStep,
101
+ CreateWorkflowRequest
102
+ } from '@things-factory/labeling/dist-server/types/workflow-types.js'
103
+ ```
104
+
105
+ 3. **Update type references** in your code:
106
+
107
+ ```typescript
108
+ // Replace all occurrences
109
+ LabelingScenario → LabelingWorkflow
110
+ ScenarioStep → WorkflowStep
111
+ ScenarioStatus → WorkflowStatus
112
+ // etc.
113
+ ```
114
+
115
+ ### For GraphQL Queries/Mutations
116
+
117
+ 1. **Update mutation calls**:
118
+
119
+ **Before:**
120
+ ```graphql
121
+ mutation {
122
+ createLabelingScenario(input: {
123
+ name: "My Scenario"
124
+ projectId: 123
125
+ steps: [...]
126
+ }) {
127
+ id
128
+ name
129
+ }
130
+ }
131
+ ```
132
+
133
+ **After:**
134
+ ```graphql
135
+ mutation {
136
+ createLabelingWorkflow(input: {
137
+ name: "My Workflow"
138
+ projectId: 123
139
+ steps: [...]
140
+ }) {
141
+ id
142
+ name
143
+ }
144
+ }
145
+ ```
146
+
147
+ 2. **Update query calls**:
148
+
149
+ **Before:**
150
+ ```graphql
151
+ query {
152
+ labelingScenarios(projectId: 123) {
153
+ items {
154
+ id
155
+ name
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ **After:**
162
+ ```graphql
163
+ query {
164
+ labelingWorkflows(projectId: 123) {
165
+ items {
166
+ id
167
+ name
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ 3. **Update execution calls**:
174
+
175
+ **Before:**
176
+ ```graphql
177
+ mutation {
178
+ executeScenario(input: {
179
+ scenarioId: "uuid"
180
+ }) {
181
+ executionId
182
+ }
183
+ }
184
+ ```
185
+
186
+ **After:**
187
+ ```graphql
188
+ mutation {
189
+ executeLabelingWorkflow(input: {
190
+ workflowId: "uuid"
191
+ }) {
192
+ executionId
193
+ }
194
+ }
195
+ ```
196
+
197
+ ### For Frontend Code
198
+
199
+ 1. **Update GraphQL query strings** in your components:
200
+
201
+ ```typescript
202
+ // Before
203
+ const GET_SCENARIOS = gql`
204
+ query {
205
+ labelingScenarios {
206
+ items {
207
+ id
208
+ name
209
+ }
210
+ }
211
+ }
212
+ `
213
+
214
+ // After
215
+ const GET_WORKFLOWS = gql`
216
+ query {
217
+ labelingWorkflows {
218
+ items {
219
+ id
220
+ name
221
+ }
222
+ }
223
+ }
224
+ `
225
+ ```
226
+
227
+ 2. **Update component props and state**:
228
+
229
+ ```typescript
230
+ // Before
231
+ interface Props {
232
+ scenario: LabelingScenario
233
+ }
234
+
235
+ // After
236
+ interface Props {
237
+ workflow: LabelingWorkflow
238
+ }
239
+ ```
240
+
241
+ ## Breaking Changes
242
+
243
+ ### 1. GraphQL Schema
244
+
245
+ All GraphQL operations have new names. Old operations will not work and must be updated.
246
+
247
+ ### 2. Package Location
248
+
249
+ The service is no longer in `@things-factory/integration-label-studio`. You must add `@things-factory/labeling` as a dependency.
250
+
251
+ ### 3. Privilege Categories
252
+
253
+ The privilege category has changed from `"label-studio"` to `"labeling"`:
254
+
255
+ **Before:**
256
+ ```typescript
257
+ @Directive('@privilege(category: "label-studio", privilege: "mutation")')
258
+ ```
259
+
260
+ **After:**
261
+ ```typescript
262
+ @Directive('@privilege(category: "labeling", privilege: "mutation")')
263
+ ```
264
+
265
+ You may need to update your user roles and permissions accordingly.
266
+
267
+ ## Backward Compatibility
268
+
269
+ **There is NO backward compatibility.** This is a breaking change that requires:
270
+
271
+ 1. Updating all code references
272
+ 2. Updating all GraphQL queries/mutations
273
+ 3. Migrating any stored scenario data (if applicable)
274
+
275
+ The old files have been marked as `.deprecated` in `integration-label-studio` and will be removed in a future version.
276
+
277
+ ## Data Migration
278
+
279
+ If you have existing scenario data stored in a database or configuration:
280
+
281
+ 1. Export existing scenario definitions
282
+ 2. Transform field names: `scenarioId` → `workflowId`, etc.
283
+ 3. Update GraphQL type names in JSON configs
284
+ 4. Re-import using the new workflow API
285
+
286
+ ## Testing Checklist
287
+
288
+ - [ ] All imports updated to use `@things-factory/labeling`
289
+ - [ ] All type references changed from `Scenario*` to `Workflow*`
290
+ - [ ] All GraphQL queries/mutations updated
291
+ - [ ] Privilege categories updated to `"labeling"`
292
+ - [ ] Frontend components updated
293
+ - [ ] Integration tests passing
294
+ - [ ] End-to-end workflow execution verified
295
+
296
+ ## Support
297
+
298
+ If you encounter issues during migration, please:
299
+
300
+ 1. Check this guide for common problems
301
+ 2. Review the [README.md](./README.md) for usage examples
302
+ 3. Contact the Things-Factory team
303
+
304
+ ## Timeline
305
+
306
+ - **Current Version**: `9.1.0` - New `@things-factory/labeling` package introduced
307
+ - **Deprecation**: Old scenario files marked as `.deprecated`
308
+ - **Future Version**: Old files will be removed entirely
309
+
310
+ Please migrate as soon as possible to avoid disruption.