@things-factory/dataset 7.0.0-alpha.8 → 7.0.1-alpha.0
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/pages/data-sample/data-sample-search-page.ts +4 -4
- package/dist-client/pages/data-sample/data-sample-search-page.d.ts +0 -12
- package/dist-client/pages/data-sample/data-sample-search-page.js +4 -4
- package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/create-data-sample.js +1 -1
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/engine/task/create-data-sample.js +2 -1
- package/dist-server/engine/task/create-data-sample.js.map +1 -1
- package/dist-server/routes.js +13 -10
- package/dist-server/routes.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/server/controllers/create-data-sample.ts +1 -1
- package/server/engine/task/create-data-sample.ts +2 -1
- package/server/routes.ts +14 -10
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/dataset",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.1-alpha.0",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "dist-client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -40,20 +40,20 @@
|
|
40
40
|
"@operato/shell": "^2.0.0-alpha.0",
|
41
41
|
"@operato/styles": "^2.0.0-alpha.0",
|
42
42
|
"@operato/utils": "^2.0.0-alpha.0",
|
43
|
-
"@things-factory/auth-base": "^7.0.
|
44
|
-
"@things-factory/aws-base": "^7.0.
|
45
|
-
"@things-factory/board-service": "^7.0.
|
46
|
-
"@things-factory/env": "^7.0.
|
47
|
-
"@things-factory/integration-base": "^7.0.
|
48
|
-
"@things-factory/organization": "^7.0.
|
49
|
-
"@things-factory/scheduler-client": "^7.0.
|
50
|
-
"@things-factory/shell": "^7.0.
|
51
|
-
"@things-factory/work-shift": "^7.0.
|
52
|
-
"@things-factory/worklist": "^7.0.
|
43
|
+
"@things-factory/auth-base": "^7.0.1-alpha.0",
|
44
|
+
"@things-factory/aws-base": "^7.0.1-alpha.0",
|
45
|
+
"@things-factory/board-service": "^7.0.1-alpha.0",
|
46
|
+
"@things-factory/env": "^7.0.1-alpha.0",
|
47
|
+
"@things-factory/integration-base": "^7.0.1-alpha.0",
|
48
|
+
"@things-factory/organization": "^7.0.1-alpha.0",
|
49
|
+
"@things-factory/scheduler-client": "^7.0.1-alpha.0",
|
50
|
+
"@things-factory/shell": "^7.0.1-alpha.0",
|
51
|
+
"@things-factory/work-shift": "^7.0.1-alpha.0",
|
52
|
+
"@things-factory/worklist": "^7.0.1-alpha.0",
|
53
53
|
"cron-parser": "^4.3.0",
|
54
54
|
"moment-timezone": "^0.5.40",
|
55
55
|
"simple-statistics": "^7.8.3",
|
56
56
|
"statistics": "^3.3.0"
|
57
57
|
},
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "d18cdb7648bd2003f11278ec7bc8df74edbd31fc"
|
59
59
|
}
|
@@ -63,7 +63,7 @@ export async function createDataSample(newDataSample: NewDataSample, context: Re
|
|
63
63
|
relations: ['dataKeySet']
|
64
64
|
})
|
65
65
|
|
66
|
-
const { dataItems, tag: publishTag, normalScenarioId, outlierScenarioId } = dataSet
|
66
|
+
const { dataItems = [], tag: publishTag, normalScenarioId, outlierScenarioId } = dataSet
|
67
67
|
const collectedAt = newDataSample.collectedAt || new Date()
|
68
68
|
|
69
69
|
const timezone = dataSet.timezone || domain.timezone || 'UTC'
|
@@ -10,7 +10,7 @@ import { createDataSample } from '../../controllers/create-data-sample'
|
|
10
10
|
async function CreateDataSample(step: InputStep, context: Context) {
|
11
11
|
const { logger, data, domain, user, lng } = context
|
12
12
|
var {
|
13
|
-
params: { dataset: dataSetId, source: sourceAccessor, rawData: rawDataAccessor, data: dataAccessor, timestamp }
|
13
|
+
params: { dataset: dataSetId, source: sourceAccessor, rawData: rawDataAccessor, data: dataAccessor, timestamp: timestampAccessor }
|
14
14
|
} = step
|
15
15
|
|
16
16
|
if (!dataSetId) {
|
@@ -28,6 +28,7 @@ async function CreateDataSample(step: InputStep, context: Context) {
|
|
28
28
|
var source = await access(sourceAccessor, data)
|
29
29
|
var extractedData = await access(dataAccessor, data)
|
30
30
|
var extractedRawData = rawDataAccessor && (await access(rawDataAccessor, data))
|
31
|
+
var timestamp = timestampAccessor && (await access(timestampAccessor, data))
|
31
32
|
|
32
33
|
const dataSample = await createDataSample(
|
33
34
|
{
|
package/server/routes.ts
CHANGED
@@ -47,20 +47,24 @@ process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRout
|
|
47
47
|
throw new Error(`Appliance of the sensor given deviceId(${deviceId}) is not set up`)
|
48
48
|
}
|
49
49
|
|
50
|
-
// if (!sensor.dataSet) {
|
51
|
-
// throw new Error(`DataSet of the sensor given deviceId(${deviceId}) is not set up`)
|
52
|
-
// }
|
53
|
-
|
54
50
|
const domain = sensor.domain
|
55
51
|
const dataSet = sensor.dataSet
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
52
|
+
|
53
|
+
/*
|
54
|
+
원칙적으로 user 인증정보를 가지고 요청해야 하지만, 인증정보를 보낼 수 없는 상황이라고 전제하여 처리한다.
|
55
|
+
앞으로, 보완되어야 한다.
|
56
|
+
*/
|
57
|
+
const user: User =
|
58
|
+
context.user ||
|
59
|
+
(await tx.getRepository(User).findOne({
|
60
|
+
where: {
|
61
|
+
reference: sensor.appliance.id,
|
62
|
+
userType: 'appliance'
|
63
|
+
}
|
64
|
+
}))
|
62
65
|
|
63
66
|
context.state = {
|
67
|
+
user,
|
64
68
|
...context.state,
|
65
69
|
domain,
|
66
70
|
tx
|