@things-factory/dataset 6.0.30 → 6.0.33
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 -9
- 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-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/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 +4 -2
- package/dist-server/activities/activity-data-collect.js.map +1 -1
- package/dist-server/activities/activity-ooc-resolve.js +4 -2
- package/dist-server/activities/activity-ooc-resolve.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +4 -2
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/activity-template/activity-data-collect.js.map +1 -1
- 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 +12 -8
- 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 +4 -2
- package/server/activities/activity-ooc-resolve.ts +4 -2
- package/server/activities/activity-ooc-review.ts +4 -2
- package/server/routes.ts +22 -5
- package/server/service/data-set/data-set-mutation.ts +12 -8
- 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.33",
|
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.32",
|
39
|
+
"@things-factory/aws-base": "^6.0.32",
|
40
|
+
"@things-factory/board-service": "^6.0.32",
|
41
|
+
"@things-factory/env": "^6.0.32",
|
42
|
+
"@things-factory/organization": "^6.0.32",
|
43
|
+
"@things-factory/scheduler-client": "^6.0.33",
|
44
|
+
"@things-factory/shell": "^6.0.32",
|
45
|
+
"@things-factory/work-shift": "^6.0.32",
|
46
|
+
"@things-factory/worklist": "^6.0.33",
|
47
47
|
"cron-parser": "^4.3.0",
|
48
48
|
"moment-timezone": "^0.5.40"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "6836e4138220146670154548575624faf260bca4"
|
51
51
|
}
|
@@ -76,8 +76,10 @@ export const ActivityDataCollect = {
|
|
76
76
|
}
|
77
77
|
],
|
78
78
|
uiType: 'custom-element',
|
79
|
-
uiSource: 'activity-data-collect-
|
80
|
-
|
79
|
+
uiSource: 'activity-data-collect-edit',
|
80
|
+
viewType: 'custom-element',
|
81
|
+
viewSource: 'activity-data-collect-view',
|
82
|
+
reportType: 'custom-element',
|
81
83
|
reportSource: 'activity-data-collect-view',
|
82
84
|
thumbnail: '/assets/images/data-collect.png',
|
83
85
|
callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
|
@@ -106,8 +106,10 @@ export const ActivityOocResolve = {
|
|
106
106
|
}
|
107
107
|
],
|
108
108
|
uiType: 'custom-element',
|
109
|
-
uiSource: 'activity-ooc-resolve-
|
110
|
-
|
109
|
+
uiSource: 'activity-ooc-resolve-edit',
|
110
|
+
viewType: 'custom-element',
|
111
|
+
viewSource: 'activity-ooc-resolve-view',
|
112
|
+
reportType: 'custom-element',
|
111
113
|
reportSource: 'data-ooc-report-page',
|
112
114
|
thumbnail: '/assets/images/ooc.png',
|
113
115
|
callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
|
@@ -110,8 +110,10 @@ export const ActivityOocReview = {
|
|
110
110
|
}
|
111
111
|
],
|
112
112
|
uiType: 'custom-element',
|
113
|
-
uiSource: 'activity-ooc-review-
|
114
|
-
|
113
|
+
uiSource: 'activity-ooc-review-edit',
|
114
|
+
viewType: 'custom-element',
|
115
|
+
viewSource: 'activity-ooc-review-view',
|
116
|
+
reportType: 'custom-element',
|
115
117
|
reportSource: 'data-ooc-report-page',
|
116
118
|
thumbnail: '/assets/images/ooc.png',
|
117
119
|
callback /* Called when there is a change in the lifecycle of a task (activity-instance). */
|
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
|
|
@@ -177,10 +177,13 @@ export class DataSetMutation {
|
|
177
177
|
client: {
|
178
178
|
application: 'operato-dataset',
|
179
179
|
group: `${domain.id}`,
|
180
|
-
|
180
|
+
type: 'data-set',
|
181
|
+
key: dataSet.id,
|
182
|
+
operation: 'schedule'
|
181
183
|
},
|
182
184
|
type: 'cron',
|
183
185
|
schedule: dataSet.schedule,
|
186
|
+
timezone: dataSet.timezone,
|
184
187
|
task: {
|
185
188
|
type: 'rest',
|
186
189
|
connection: {
|
@@ -191,21 +194,22 @@ export class DataSetMutation {
|
|
191
194
|
}
|
192
195
|
},
|
193
196
|
data: {
|
194
|
-
|
195
|
-
|
197
|
+
domainId: domain.id,
|
198
|
+
dataSetId
|
196
199
|
},
|
197
200
|
history_check: true,
|
198
201
|
failed_policy: 'retry_dlq',
|
199
|
-
max_retry_count: 3
|
202
|
+
max_retry_count: 3,
|
203
|
+
retry_period: 60
|
200
204
|
}
|
201
205
|
})
|
202
206
|
|
203
207
|
return await repository.save({
|
204
208
|
...dataSet,
|
205
|
-
|
209
|
+
scheduleId: handle
|
206
210
|
})
|
207
211
|
} catch (err) {
|
208
|
-
console.error('
|
212
|
+
console.error('startDataCollectionSchedule', err)
|
209
213
|
}
|
210
214
|
}
|
211
215
|
|
@@ -234,11 +238,11 @@ export class DataSetMutation {
|
|
234
238
|
}
|
235
239
|
|
236
240
|
try {
|
237
|
-
await unregisterSchedule(dataSet.
|
241
|
+
await unregisterSchedule(dataSet.scheduleId)
|
238
242
|
|
239
243
|
return await repository.save({
|
240
244
|
...dataSet,
|
241
|
-
|
245
|
+
scheduleId: null
|
242
246
|
})
|
243
247
|
} catch (err) {
|
244
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 })
|