@things-factory/dataset 6.0.0-alpha.0 → 6.0.0-alpha.11

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 (63) hide show
  1. package/README.md +23 -19
  2. package/assets/diagram.jpg +0 -0
  3. package/client/pages/data-archive/data-archive-list-page.js +290 -0
  4. package/client/pages/data-archive/data-archive-request-popup.js +175 -0
  5. package/client/pages/data-key-set/data-key-set-list-page.js +1 -1
  6. package/client/pages/data-report/data-report-list-page.js +2 -2
  7. package/client/pages/data-set/data-set-list-page.js +1 -1
  8. package/client/route.js +4 -0
  9. package/config/config.development.js +11 -0
  10. package/config/config.production.js +11 -0
  11. package/dist-server/controllers/jasper-report.js +4 -4
  12. package/dist-server/controllers/jasper-report.js.map +1 -1
  13. package/dist-server/controllers/shiny-report.js +4 -7
  14. package/dist-server/controllers/shiny-report.js.map +1 -1
  15. package/dist-server/routes.js.map +1 -1
  16. package/dist-server/service/data-archive/data-archive-mutation.js +227 -0
  17. package/dist-server/service/data-archive/data-archive-mutation.js.map +1 -0
  18. package/dist-server/service/data-archive/data-archive-query.js +83 -0
  19. package/dist-server/service/data-archive/data-archive-query.js.map +1 -0
  20. package/dist-server/service/data-archive/data-archive-type.js +74 -0
  21. package/dist-server/service/data-archive/data-archive-type.js.map +1 -0
  22. package/dist-server/service/data-archive/data-archive.js +79 -0
  23. package/dist-server/service/data-archive/data-archive.js.map +1 -0
  24. package/dist-server/service/data-archive/index.js +9 -0
  25. package/dist-server/service/data-archive/index.js.map +1 -0
  26. package/dist-server/service/data-set/data-set-mutation.js +1 -1
  27. package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
  28. package/dist-server/service/index.js +5 -2
  29. package/dist-server/service/index.js.map +1 -1
  30. package/dist-server/tsconfig.tsbuildinfo +1 -1
  31. package/dist-server/utils/config-resolver.js +33 -0
  32. package/dist-server/utils/config-resolver.js.map +1 -0
  33. package/dist-server/utils/index.js +5 -0
  34. package/dist-server/utils/index.js.map +1 -0
  35. package/helps/dataset/data-archive.md +9 -0
  36. package/helps/dataset/data-entry-list.md +2 -0
  37. package/helps/dataset/data-key-set.md +10 -0
  38. package/helps/dataset/data-ooc.md +11 -0
  39. package/helps/dataset/data-report-list.md +4 -0
  40. package/helps/dataset/data-sample-search.md +2 -0
  41. package/helps/dataset/data-sample.md +11 -0
  42. package/helps/dataset/data-sensor.md +13 -0
  43. package/helps/dataset/data-set.md +28 -0
  44. package/helps/dataset/ui/data-item-list.md +19 -0
  45. package/helps/dataset/ui/data-key-item-list.md +2 -0
  46. package/package.json +8 -8
  47. package/server/controllers/jasper-report.ts +5 -4
  48. package/server/controllers/shiny-report.ts +4 -7
  49. package/server/routes.ts +1 -0
  50. package/server/service/data-archive/data-archive-mutation.ts +282 -0
  51. package/server/service/data-archive/data-archive-query.ts +55 -0
  52. package/server/service/data-archive/data-archive-type.ts +49 -0
  53. package/server/service/data-archive/data-archive.ts +69 -0
  54. package/server/service/data-archive/index.ts +6 -0
  55. package/server/service/data-set/data-set-mutation.ts +1 -1
  56. package/server/service/index.ts +5 -2
  57. package/server/utils/config-resolver.ts +29 -0
  58. package/server/utils/index.ts +1 -0
  59. package/things-factory.config.js +4 -0
  60. package/translations/en.json +18 -3
  61. package/translations/ko.json +15 -1
  62. package/translations/ms.json +1 -0
  63. package/translations/zh.json +1 -0
@@ -0,0 +1,49 @@
1
+ import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'
2
+ import { DataArchive } from './data-archive'
3
+ import { ObjectRef, ScalarObject } from '@things-factory/shell'
4
+
5
+ @InputType()
6
+ export class NewDataArchive {
7
+ @Field({ nullable: true })
8
+ type?: 'manual' | 'automatic' | string
9
+
10
+ @Field(type => ScalarObject, { nullable: true })
11
+ requestParams?: { [key: string]: any }
12
+
13
+ @Field({ nullable: true })
14
+ downloadUrl?: string
15
+
16
+ @Field({ nullable: true })
17
+ status?: string
18
+
19
+ }
20
+
21
+ @InputType()
22
+ export class DataArchivePatch {
23
+ @Field(type => ID, { nullable: true })
24
+ id?: string
25
+
26
+ @Field({ nullable: true })
27
+ type?: 'manual' | 'automatic' | string
28
+
29
+ @Field(type => ScalarObject, { nullable: true })
30
+ requestParams?: { [key: string]: any }
31
+
32
+ @Field({ nullable: true })
33
+ downloadUrl?: string
34
+
35
+ @Field({ nullable: true })
36
+ status?: string
37
+
38
+ @Field({ nullable: true })
39
+ cuFlag: string
40
+ }
41
+
42
+ @ObjectType()
43
+ export class DataArchiveList {
44
+ @Field(type => [DataArchive])
45
+ items: DataArchive[]
46
+
47
+ @Field(type => Int)
48
+ total: number
49
+ }
@@ -0,0 +1,69 @@
1
+ import { Field, ID, ObjectType, registerEnumType } from 'type-graphql'
2
+ import {
3
+ Column,
4
+ CreateDateColumn,
5
+ Entity,
6
+ Index,
7
+ ManyToOne,
8
+ PrimaryGeneratedColumn,
9
+ RelationId,
10
+ UpdateDateColumn,
11
+ VersionColumn
12
+ } from 'typeorm'
13
+
14
+ import { Role, User } from '@things-factory/auth-base'
15
+ import { Domain, ScalarObject } from '@things-factory/shell'
16
+
17
+ @Entity()
18
+ @Index('ix_data_archive_0', (dataArchive: DataArchive) => [dataArchive.id], { unique: true })
19
+ @ObjectType({ description: 'Entity for DataArchive' })
20
+ export class DataArchive {
21
+ @PrimaryGeneratedColumn('uuid')
22
+ @Field(type => ID)
23
+ readonly id: string
24
+
25
+ @ManyToOne(type => Domain)
26
+ @Field({ nullable: true })
27
+ domain?: Domain
28
+
29
+ @RelationId((dataArchive: DataArchive) => dataArchive.domain)
30
+ domainId?: string
31
+
32
+ @Column({ nullable: true })
33
+ @Field({ nullable: true })
34
+ type?: 'manual' | 'automatic' | string
35
+
36
+ @Column('simple-json', { nullable: true })
37
+ @Field(type => ScalarObject, { nullable: true })
38
+ requestParams?: { [key: string]: any }
39
+
40
+ @Column({ nullable: true })
41
+ @Field({ nullable: true })
42
+ downloadUrl?: string
43
+
44
+ @Column({ nullable: true })
45
+ @Field({ nullable: true })
46
+ status?: string
47
+
48
+ @CreateDateColumn()
49
+ @Field({ nullable: true })
50
+ createdAt?: Date
51
+
52
+ @UpdateDateColumn()
53
+ @Field({ nullable: true })
54
+ updatedAt?: Date
55
+
56
+ @ManyToOne(type => User, { nullable: true })
57
+ @Field({ nullable: true })
58
+ creator?: User
59
+
60
+ @RelationId((dataArchive: DataArchive) => dataArchive.creator)
61
+ creatorId?: string
62
+
63
+ @ManyToOne(type => User, { nullable: true })
64
+ @Field({ nullable: true })
65
+ updater?: User
66
+
67
+ @RelationId((dataArchive: DataArchive) => dataArchive.creator)
68
+ updaterId?: string
69
+ }
@@ -0,0 +1,6 @@
1
+ import { DataArchive } from './data-archive'
2
+ import { DataArchiveMutation } from './data-archive-mutation'
3
+ import { DataArchiveQuery } from './data-archive-query'
4
+
5
+ export const entities = [DataArchive]
6
+ export const resolvers = [DataArchiveQuery, DataArchiveMutation]
@@ -180,7 +180,7 @@ export class DataSetMutation {
180
180
  const originals = await dataSetRepo.find({
181
181
  where: {
182
182
  id: In(ids),
183
- domain
183
+ domain: { id: domain.id }
184
184
  },
185
185
  relations: ['domain', 'supervisoryRole', 'entryRole', 'dataKeySet']
186
186
  })
@@ -9,6 +9,7 @@ import {
9
9
  subscribers as DataSetHistorySubscribers
10
10
  } from './data-set-history'
11
11
  import { entities as DataSpecEntities, resolvers as DataSpecResolvers } from './data-spec'
12
+ import { entities as DataArchiveEntities, resolvers as DataArchiveResolvers } from './data-archive'
12
13
 
13
14
  /* EXPORT ENTITY TYPES */
14
15
  export * from './data-key-set/data-key-set'
@@ -28,7 +29,8 @@ export const entities = [
28
29
  ...DataSampleEntities,
29
30
  ...DataSetEntities,
30
31
  ...DataSetHistoryEntities,
31
- ...DataSpecEntities
32
+ ...DataSpecEntities,
33
+ ...DataArchiveEntities
32
34
  ]
33
35
 
34
36
  export const subscribers = [
@@ -45,6 +47,7 @@ export const schema = {
45
47
  ...DataSampleResolvers,
46
48
  ...DataSetResolvers,
47
49
  ...DataSetHistoryResolvers,
48
- ...DataSpecResolvers
50
+ ...DataSpecResolvers,
51
+ ...DataArchiveResolvers
49
52
  ]
50
53
  }
@@ -0,0 +1,29 @@
1
+
2
+ export function getEndpointUrl(endpoint:any, subpath:string=''):string {
3
+ const { url='', protocol='http', host='', port=80 } = endpoint
4
+
5
+ let _url = ''
6
+ let _protocol = protocol
7
+
8
+ if (url) {
9
+ _url = url
10
+ } else {
11
+ const hosts = host.split('://')
12
+ // host에 protocol을 포함한 경우
13
+ if (hosts.length == 2) {
14
+ const _host = hosts[1]
15
+ _protocol = hosts[0]
16
+ // host에 port를 포함한 경우
17
+ const _hosts = _host.split(':')
18
+ if (_hosts.length > 1) {
19
+ _url = `${_hosts[0]}:${_hosts[1]}`
20
+ } else {
21
+ _url = `${_host}:${port}`
22
+ }
23
+ } else if (hosts.length == 1) {
24
+ _url = `${host}:${port}`
25
+ }
26
+ }
27
+
28
+ return _protocol + '://' + _url.split('/').concat(subpath.split('/')).filter(x=>x).join('/')
29
+ }
@@ -0,0 +1 @@
1
+ export * from './config-resolver'
@@ -36,6 +36,10 @@ export default {
36
36
  tagname: 'data-report-samples-page',
37
37
  page: 'data-report-samples'
38
38
  },
39
+ {
40
+ tagname: 'data-archive-list-page',
41
+ page: 'data-archive-list'
42
+ },
39
43
  // {
40
44
  // tagname: 'jasper-report-samples-page',
41
45
  // page: 'jasper-report-samples'
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "button.corrected": "corrected",
3
+ "button.request": "request",
3
4
  "button.reviewed": "reviewed",
4
5
  "field.appliance": "appliance",
5
6
  "field.collected_at": "collected at",
@@ -12,6 +13,7 @@
12
13
  "field.data-sample": "data sample",
13
14
  "field.data-set": "data set",
14
15
  "field.device-id": "device id",
16
+ "field.download-url": "download url",
15
17
  "field.entry-role": "entry role",
16
18
  "field.entry-type": "entry type",
17
19
  "field.entry-view": "entry view",
@@ -37,6 +39,7 @@
37
39
  "field.report-template": "report template",
38
40
  "field.report-type": "report type",
39
41
  "field.report-view": "report view",
42
+ "field.request-params": "request parameters",
40
43
  "field.serial-no": "serial #",
41
44
  "field.spec": "spec",
42
45
  "field.status": "status",
@@ -49,28 +52,40 @@
49
52
  "field.work-shift": "work shift",
50
53
  "label.acceptables": "acceptables",
51
54
  "label.critical-limits": "critical limits",
55
+ "label.data-set-type": "type",
56
+ "label.end-date": "end date",
52
57
  "label.minimum value": "minimum value",
53
58
  "label.maximum value": "maximum value",
54
59
  "label.pass-limits": "pass limits",
60
+ "label.start-date": "start date",
55
61
  "label.target-limits": "target limits",
56
62
  "text.automatically collected": "automatically collected",
63
+ "text.data-archive request failed": "data archive request is failed",
64
+ "text.data-archive waits": "It'll take few minutes, You can find a push message when ready",
57
65
  "text.data sample created successfully": "a data sample created successfully",
58
66
  "text.data ooc updated successfully": "a data ooc updated successfully",
59
67
  "text.manually collected": "manually collected",
68
+ "text.presigned_url_created": "a presigned url of archive is created",
69
+ "title.data-archive downloads ready": "data archive download ready",
70
+ "title.data-archive request failed": "failed a data archive request",
71
+ "title.data-archive list": "data archive list",
72
+ "title.data-archive request popup": "data archive request",
60
73
  "title.data-entry-form": "data entry form",
61
74
  "title.data-entry list": "data entry list",
62
75
  "title.data-key-item list": "data key item list",
63
76
  "title.data-key-set list": "data key set list",
64
77
  "title.data-item list": "data item list",
65
78
  "title.data-monitor-view": "data monitor view",
66
- "title.data-report-view": "data report view",
67
- "title.data-report samples": "samples data report",
68
79
  "title.data-ooc list": "data OOC list",
69
80
  "title.data-ooc view": "data OOC view",
81
+ "title.data-report list": "data report list",
82
+ "title.data-report-view": "data report view",
83
+ "title.data-report samples": "samples data report",
70
84
  "title.data-sample list": "data sample list",
71
85
  "title.data-sample search": "data sample search",
72
86
  "title.data-sample view": "data sample view",
73
87
  "title.data-sensor list": "data sensor list",
74
88
  "title.data-set list": "data set list",
75
- "title.edit code": "edit code"
89
+ "title.edit code": "edit code",
90
+ "title.ready": "ready"
76
91
  }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "button.corrected": "조치완료",
3
3
  "button.reviewed": "검토완료",
4
+ "button.request": "요청",
4
5
  "field.appliance": "어플라이언스",
5
6
  "field.collected_at": "수집일시",
6
7
  "field.corrected-at": "조치 시간",
@@ -12,6 +13,7 @@
12
13
  "field.data-key": "데이타 키",
13
14
  "field.data-key-set": "데이타 키셋",
14
15
  "field.device-id": "디바이스 아이디",
16
+ "field.download-url": "다운로드 주소",
15
17
  "field.entry-role": "입력담당 역할",
16
18
  "field.entry-type": "입력용 화면종류",
17
19
  "field.entry-view": "입력용 화면",
@@ -37,6 +39,7 @@
37
39
  "field.report-template": "리포트용 템플릿",
38
40
  "field.report-type": "리포트용 화면종류",
39
41
  "field.report-view": "리포트용 화면",
42
+ "field.request-params": "요청 매개변수",
40
43
  "field.serial-no": "시리얼번호",
41
44
  "field.spec": "명세",
42
45
  "field.status": "상태",
@@ -49,14 +52,23 @@
49
52
  "field.work-shift": "교대근무조",
50
53
  "label.acceptables": "허용값",
51
54
  "label.critical-limits": "허용 한계범위",
55
+ "label.data-set-type": "유형",
56
+ "label.end-date": "종료일",
52
57
  "label.minimum value": "최소값",
53
58
  "label.maximum value": "최대값",
54
59
  "label.pass-limits": "통과 허용범위",
60
+ "label.start-date": "시작일",
55
61
  "label.target-limits": "관리 목표범위",
56
62
  "text.automatically collected": "자동 수집",
63
+ "text.data-archive request failed": "아카이브 다운로드 요청 실패",
64
+ "text.data-archive waits": "시간이 수 분 소요될 수 있습니다. 가능한 시점에 푸시 메시지로 알려드립니다.",
57
65
  "text.data ooc updated successfully": "이탈데이타 내용이 수정되었습니다",
58
66
  "text.data sample created successfully": "데이타 샘플이 성공적으로 생성되었습니다",
59
67
  "text.manually collected": "수동 수집",
68
+ "title.data-archive downloads ready": "아카이브 다운로드 가능",
69
+ "title.data-archive request failed": "아카이브 요청 실패",
70
+ "title.data-archive list": "아카이브 조회",
71
+ "title.data-archive request popup": "아카이브 요청",
60
72
  "title.data-entry-form": "데이타 입력",
61
73
  "title.data-key-item list": "데이타 키 상세",
62
74
  "title.data-key-set list": "데이타 키셋 조회",
@@ -64,6 +76,7 @@
64
76
  "title.data-monitor-view": "데이타 모니터",
65
77
  "title.data-ooc list": "데이타 이탈점 조회",
66
78
  "title.data-ooc view": "데이타 이탈점 상세",
79
+ "title.data-report list": "데이타 리포트 조회",
67
80
  "title.data-report-view": "데이타 리포트",
68
81
  "title.data-report samples": "샘플 데이타 리포트",
69
82
  "title.data-sample list": "데이타 샘플 조회",
@@ -71,5 +84,6 @@
71
84
  "title.data-sample view": "데이타 샘플 상세",
72
85
  "title.data-sensor list": "데이타 센서 조회",
73
86
  "title.data-set list": "데이타 셋 조회",
74
- "title.edit code": "코드 편집"
87
+ "title.edit code": "코드 편집",
88
+ "title.ready": "준비 중"
75
89
  }
@@ -48,6 +48,7 @@
48
48
  "field.work-shift": "work shift",
49
49
  "label.acceptables": "acceptables",
50
50
  "label.critical-limits": "critical limits",
51
+ "label.data-set-type": "type",
51
52
  "label.minimum value": "minimum value",
52
53
  "label.maximum value": "maximum value",
53
54
  "label.pass-limits": "pass limits",
@@ -48,6 +48,7 @@
48
48
  "field.work-shift": "work shift",
49
49
  "label.acceptables": "acceptables",
50
50
  "label.critical-limits": "critical limits",
51
+ "label.data-set-type": "type",
51
52
  "label.minimum value": "minimum value",
52
53
  "label.maximum value": "maximum value",
53
54
  "label.pass-limits": "pass limits",