@things-factory/dataset 6.0.32 → 6.0.34
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/client/activities/activity-data-collect-edit.ts +100 -0
- package/client/activities/activity-data-collect-view.ts +1 -20
- package/client/activities/activity-ooc-resolve-edit.ts +174 -0
- package/client/activities/activity-ooc-resolve-view.ts +10 -37
- package/client/activities/activity-ooc-review-edit.ts +153 -0
- package/client/activities/activity-ooc-review-view.ts +10 -33
- package/client/bootstrap.ts +3 -0
- package/client/pages/data-set/data-set-list-page.ts +8 -8
- package/dist-client/activities/activity-data-collect-edit.d.ts +19 -0
- package/dist-client/activities/activity-data-collect-edit.js +101 -0
- package/dist-client/activities/activity-data-collect-edit.js.map +1 -0
- package/dist-client/activities/activity-data-collect-view.d.ts +0 -3
- package/dist-client/activities/activity-data-collect-view.js +2 -19
- package/dist-client/activities/activity-data-collect-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-edit.d.ts +1 -0
- package/dist-client/activities/activity-ooc-resolve-edit.js +175 -0
- package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -0
- package/dist-client/activities/activity-ooc-resolve-view.js +12 -36
- package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-edit.d.ts +1 -0
- package/dist-client/activities/activity-ooc-review-edit.js +155 -0
- package/dist-client/activities/activity-ooc-review-edit.js.map +1 -0
- package/dist-client/activities/activity-ooc-review-view.js +10 -29
- package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
- package/dist-client/bootstrap.d.ts +3 -0
- package/dist-client/bootstrap.js +3 -0
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/data-collect-activity-view.d.ts +19 -0
- package/dist-client/components/data-collect-activity-view.js +101 -0
- package/dist-client/components/data-collect-activity-view.js.map +1 -0
- package/dist-client/components/data-ooc-activity-view.d.ts +1 -0
- package/dist-client/components/data-ooc-activity-view.js +154 -0
- package/dist-client/components/data-ooc-activity-view.js.map +1 -0
- package/dist-client/components/ooc-resolve-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-resolve-activity-view.js +175 -0
- package/dist-client/components/ooc-resolve-activity-view.js.map +1 -0
- package/dist-client/components/ooc-review-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-review-activity-view.js +155 -0
- package/dist-client/components/ooc-review-activity-view.js.map +1 -0
- package/dist-client/pages/data-set/data-set-list-page.js +8 -8
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-data-collect.js +1 -1
- package/dist-server/activities/activity-data-collect.js.map +1 -1
- package/dist-server/activities/activity-ooc-resolve.js +2 -2
- package/dist-server/activities/activity-ooc-resolve.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +2 -2
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/activity-template/activity-data-collect.js +82 -0
- package/dist-server/controllers/activity-template/activity-data-collect.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js +100 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js +107 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc.js +59 -0
- package/dist-server/controllers/activity-template/activity-ooc.js.map +1 -0
- package/dist-server/routes.js +14 -4
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-set/data-set-mutation.js +8 -7
- package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +1 -1
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +2 -2
- package/dist-server/service/data-set/data-set.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/server/activities/activity-data-collect.ts +1 -1
- package/server/activities/activity-ooc-resolve.ts +2 -2
- package/server/activities/activity-ooc-review.ts +2 -2
- package/server/routes.ts +22 -5
- package/server/service/data-set/data-set-mutation.ts +6 -6
- package/server/service/data-set/data-set-query.ts +1 -1
- package/server/service/data-set/data-set.ts +2 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/dataset",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.34",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "dist-client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -35,17 +35,17 @@
|
|
35
35
|
"@operato/shell": "^1.0.1",
|
36
36
|
"@operato/styles": "^1.0.0",
|
37
37
|
"@operato/utils": "^1.0.1",
|
38
|
-
"@things-factory/auth-base": "^6.0.
|
39
|
-
"@things-factory/aws-base": "^6.0.
|
40
|
-
"@things-factory/board-service": "^6.0.
|
41
|
-
"@things-factory/env": "^6.0.
|
42
|
-
"@things-factory/organization": "^6.0.
|
43
|
-
"@things-factory/scheduler-client": "^6.0.
|
44
|
-
"@things-factory/shell": "^6.0.
|
45
|
-
"@things-factory/work-shift": "^6.0.
|
46
|
-
"@things-factory/worklist": "^6.0.
|
38
|
+
"@things-factory/auth-base": "^6.0.34",
|
39
|
+
"@things-factory/aws-base": "^6.0.34",
|
40
|
+
"@things-factory/board-service": "^6.0.34",
|
41
|
+
"@things-factory/env": "^6.0.34",
|
42
|
+
"@things-factory/organization": "^6.0.34",
|
43
|
+
"@things-factory/scheduler-client": "^6.0.34",
|
44
|
+
"@things-factory/shell": "^6.0.34",
|
45
|
+
"@things-factory/work-shift": "^6.0.34",
|
46
|
+
"@things-factory/worklist": "^6.0.34",
|
47
47
|
"cron-parser": "^4.3.0",
|
48
48
|
"moment-timezone": "^0.5.40"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "a460e5183f6e97e061be886d1efe9a114bd1316b"
|
51
51
|
}
|
@@ -76,7 +76,7 @@ export const ActivityDataCollect = {
|
|
76
76
|
}
|
77
77
|
],
|
78
78
|
uiType: 'custom-element',
|
79
|
-
uiSource: 'activity-data-collect-
|
79
|
+
uiSource: 'activity-data-collect-edit',
|
80
80
|
viewType: 'custom-element',
|
81
81
|
viewSource: 'activity-data-collect-view',
|
82
82
|
reportType: 'custom-element',
|
@@ -106,9 +106,9 @@ export const ActivityOocResolve = {
|
|
106
106
|
}
|
107
107
|
],
|
108
108
|
uiType: 'custom-element',
|
109
|
-
uiSource: 'activity-ooc-resolve-
|
109
|
+
uiSource: 'activity-ooc-resolve-edit',
|
110
110
|
viewType: 'custom-element',
|
111
|
-
viewSource: 'activity-
|
111
|
+
viewSource: 'activity-ooc-resolve-view',
|
112
112
|
reportType: 'custom-element',
|
113
113
|
reportSource: 'data-ooc-report-page',
|
114
114
|
thumbnail: '/assets/images/ooc.png',
|
@@ -110,9 +110,9 @@ export const ActivityOocReview = {
|
|
110
110
|
}
|
111
111
|
],
|
112
112
|
uiType: 'custom-element',
|
113
|
-
uiSource: 'activity-ooc-review-
|
113
|
+
uiSource: 'activity-ooc-review-edit',
|
114
114
|
viewType: 'custom-element',
|
115
|
-
viewSource: 'activity-
|
115
|
+
viewSource: 'activity-ooc-review-view',
|
116
116
|
reportType: 'custom-element',
|
117
117
|
reportSource: 'data-ooc-report-page',
|
118
118
|
thumbnail: '/assets/images/ooc.png',
|
package/server/routes.ts
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
import { logger } from '@things-factory/env'
|
1
2
|
import { Domain, getDataSource } from '@things-factory/shell'
|
2
3
|
import { User } from '@things-factory/auth-base'
|
3
4
|
import { Activity } from '@things-factory/worklist'
|
4
5
|
import { post } from '@things-factory/worklist/dist-server/controllers/activity-instance/post'
|
6
|
+
import { ScheduleRegisterRequest } from '@things-factory/scheduler-client'
|
5
7
|
|
6
8
|
import { createDataSample } from './controllers/create-data-sample'
|
7
9
|
import { renderJasperReport } from './controllers/jasper-report'
|
@@ -80,10 +82,25 @@ process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRout
|
|
80
82
|
|
81
83
|
/* When a callback occurs from the scheduler when a scheduled dataset is on schedule, data collection task for the dataset should be issued. */
|
82
84
|
globalPublicRouter.post('/callback-schedule-for-dataset', async (context, next) => {
|
83
|
-
const {
|
85
|
+
const { client } = context.request.body as ScheduleRegisterRequest
|
84
86
|
|
85
|
-
|
87
|
+
if (!client || typeof client !== 'object') {
|
88
|
+
throw new Error('client property should be a part of callback body.')
|
89
|
+
}
|
90
|
+
|
91
|
+
const { group: domainId, key: dataSetId } = client
|
92
|
+
|
93
|
+
if (!domainId || !dataSetId) {
|
94
|
+
throw new Error(`group(${domainId}) and key(${dataSetId}) properties should not be empty`)
|
95
|
+
}
|
96
|
+
|
97
|
+
await getDataSource().transaction(async tx => {
|
86
98
|
const domain = await tx.getRepository(Domain).findOneBy({ id: domainId })
|
99
|
+
|
100
|
+
if (!domain) {
|
101
|
+
throw new Error(`domain(${domainId}) not found`)
|
102
|
+
}
|
103
|
+
|
87
104
|
const dataSet = await tx.getRepository(DataSet).findOne({ where: { domain: { id: domainId }, id: dataSetId } })
|
88
105
|
|
89
106
|
const activity = (await tx.getRepository(Activity).findOneBy({
|
@@ -116,12 +133,12 @@ process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRout
|
|
116
133
|
|
117
134
|
await post(activityInstance, context)
|
118
135
|
} else {
|
119
|
-
|
120
|
-
`Assignees not set. So Data
|
136
|
+
throw new Error(
|
137
|
+
`Assignees not set. So Data Collect Activity for ${dataSet.name}($dataSet.id) could not be posted.`
|
121
138
|
)
|
122
139
|
}
|
123
140
|
} else {
|
124
|
-
|
141
|
+
throw new Error(`Data Collect Activity is not installed.`)
|
125
142
|
}
|
126
143
|
})
|
127
144
|
|
@@ -194,8 +194,8 @@ export class DataSetMutation {
|
|
194
194
|
}
|
195
195
|
},
|
196
196
|
data: {
|
197
|
-
|
198
|
-
|
197
|
+
domainId: domain.id,
|
198
|
+
dataSetId
|
199
199
|
},
|
200
200
|
history_check: true,
|
201
201
|
failed_policy: 'retry_dlq',
|
@@ -206,10 +206,10 @@ export class DataSetMutation {
|
|
206
206
|
|
207
207
|
return await repository.save({
|
208
208
|
...dataSet,
|
209
|
-
|
209
|
+
scheduleId: handle
|
210
210
|
})
|
211
211
|
} catch (err) {
|
212
|
-
console.error('
|
212
|
+
console.error('startDataCollectionSchedule', err)
|
213
213
|
}
|
214
214
|
}
|
215
215
|
|
@@ -238,11 +238,11 @@ export class DataSetMutation {
|
|
238
238
|
}
|
239
239
|
|
240
240
|
try {
|
241
|
-
await unregisterSchedule(dataSet.
|
241
|
+
await unregisterSchedule(dataSet.scheduleId)
|
242
242
|
|
243
243
|
return await repository.save({
|
244
244
|
...dataSet,
|
245
|
-
|
245
|
+
scheduleId: null
|
246
246
|
})
|
247
247
|
} catch (err) {
|
248
248
|
console.error('stopDataCollectionSchedule', err)
|
@@ -66,7 +66,7 @@ export class DataSetState {
|
|
66
66
|
id: string
|
67
67
|
|
68
68
|
@Field()
|
69
|
-
|
69
|
+
scheduleId: string
|
70
70
|
|
71
71
|
@Field()
|
72
72
|
state: string
|
@@ -197,7 +197,7 @@ export class DataSet {
|
|
197
197
|
|
198
198
|
@Column({ nullable: true })
|
199
199
|
@Field({ nullable: true })
|
200
|
-
|
200
|
+
scheduleId?: string
|
201
201
|
|
202
202
|
@CreateDateColumn()
|
203
203
|
@Field({ nullable: true })
|