@things-factory/dataset 7.0.0-alpha.22 → 7.0.0-alpha.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/dataset",
3
- "version": "7.0.0-alpha.22",
3
+ "version": "7.0.0-alpha.25",
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.0-alpha.22",
44
- "@things-factory/aws-base": "^7.0.0-alpha.22",
45
- "@things-factory/board-service": "^7.0.0-alpha.22",
46
- "@things-factory/env": "^7.0.0-alpha.0",
47
- "@things-factory/integration-base": "^7.0.0-alpha.22",
48
- "@things-factory/organization": "^7.0.0-alpha.22",
49
- "@things-factory/scheduler-client": "^7.0.0-alpha.22",
50
- "@things-factory/shell": "^7.0.0-alpha.21",
51
- "@things-factory/work-shift": "^7.0.0-alpha.22",
52
- "@things-factory/worklist": "^7.0.0-alpha.22",
43
+ "@things-factory/auth-base": "^7.0.0-alpha.25",
44
+ "@things-factory/aws-base": "^7.0.0-alpha.25",
45
+ "@things-factory/board-service": "^7.0.0-alpha.25",
46
+ "@things-factory/env": "^7.0.0-alpha.24",
47
+ "@things-factory/integration-base": "^7.0.0-alpha.25",
48
+ "@things-factory/organization": "^7.0.0-alpha.25",
49
+ "@things-factory/scheduler-client": "^7.0.0-alpha.25",
50
+ "@things-factory/shell": "^7.0.0-alpha.24",
51
+ "@things-factory/work-shift": "^7.0.0-alpha.25",
52
+ "@things-factory/worklist": "^7.0.0-alpha.25",
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": "be331d508c2f2801aaae04fc6e477e8232f5f9de"
58
+ "gitHead": "3cf1dac62563d3664642eec7280f74870aa1784d"
59
59
  }
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
- // const user: User = await tx.getRepository(User).findOne({
57
- // where: {
58
- // reference: sensor.appliance.id,
59
- // userType: 'appliance'
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