@things-factory/integration-base 7.0.6 → 7.0.10

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 (46) hide show
  1. package/dist-server/controllers/index.d.ts +1 -0
  2. package/dist-server/controllers/index.js +1 -0
  3. package/dist-server/controllers/index.js.map +1 -1
  4. package/dist-server/controllers/publish-data.d.ts +6 -0
  5. package/dist-server/controllers/publish-data.js +22 -0
  6. package/dist-server/controllers/publish-data.js.map +1 -0
  7. package/dist-server/engine/task/index.d.ts +1 -0
  8. package/dist-server/engine/task/index.js +1 -0
  9. package/dist-server/engine/task/index.js.map +1 -1
  10. package/dist-server/engine/task/state-group-read.d.ts +1 -0
  11. package/dist-server/engine/task/state-group-read.js +62 -0
  12. package/dist-server/engine/task/state-group-read.js.map +1 -0
  13. package/dist-server/service/index.d.ts +1 -1
  14. package/dist-server/service/scenario-instance/scenario-instance-type.js +6 -9
  15. package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
  16. package/dist-server/service/state-register/data-resolver.d.ts +6 -0
  17. package/dist-server/service/state-register/data-resolver.js +61 -0
  18. package/dist-server/service/state-register/data-resolver.js.map +1 -0
  19. package/dist-server/service/state-register/index.d.ts +2 -1
  20. package/dist-server/service/state-register/index.js +2 -1
  21. package/dist-server/service/state-register/index.js.map +1 -1
  22. package/dist-server/service/state-register/state-register-query.js +1 -1
  23. package/dist-server/service/state-register/state-register-query.js.map +1 -1
  24. package/dist-server/service/state-register/state-register-type.d.ts +6 -0
  25. package/dist-server/service/state-register/state-register-type.js +40 -16
  26. package/dist-server/service/state-register/state-register-type.js.map +1 -1
  27. package/dist-server/service/state-register/state-register.d.ts +3 -0
  28. package/dist-server/service/state-register/state-register.js +36 -13
  29. package/dist-server/service/state-register/state-register.js.map +1 -1
  30. package/dist-server/tsconfig.tsbuildinfo +1 -1
  31. package/helps/integration/task/state-group-read.ja.md +8 -0
  32. package/helps/integration/task/state-group-read.ko.md +8 -0
  33. package/helps/integration/task/state-group-read.md +10 -0
  34. package/helps/integration/task/state-group-read.ms.md +8 -0
  35. package/helps/integration/task/state-group-read.zh.md +8 -0
  36. package/package.json +8 -8
  37. package/server/controllers/index.ts +1 -0
  38. package/server/controllers/publish-data.ts +29 -0
  39. package/server/engine/task/index.ts +1 -0
  40. package/server/engine/task/state-group-read.ts +69 -0
  41. package/server/service/scenario-instance/scenario-instance-type.ts +6 -9
  42. package/server/service/state-register/data-resolver.ts +56 -0
  43. package/server/service/state-register/index.ts +2 -1
  44. package/server/service/state-register/state-register-query.ts +1 -1
  45. package/server/service/state-register/state-register-type.ts +36 -20
  46. package/server/service/state-register/state-register.ts +39 -17
@@ -9,27 +9,39 @@ let NewStateRegister = class NewStateRegister {
9
9
  };
10
10
  exports.NewStateRegister = NewStateRegister;
11
11
  tslib_1.__decorate([
12
- (0, type_graphql_1.Field)(),
12
+ (0, type_graphql_1.Field)({ description: 'Name of the state register' }),
13
13
  tslib_1.__metadata("design:type", String)
14
14
  ], NewStateRegister.prototype, "name", void 0);
15
15
  tslib_1.__decorate([
16
- (0, type_graphql_1.Field)({ nullable: true }),
16
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Description of the state register' }),
17
17
  tslib_1.__metadata("design:type", String)
18
18
  ], NewStateRegister.prototype, "description", void 0);
19
19
  tslib_1.__decorate([
20
- (0, type_graphql_1.Field)({ nullable: true }),
20
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Group name for the state register' }),
21
+ tslib_1.__metadata("design:type", String)
22
+ ], NewStateRegister.prototype, "group", void 0);
23
+ tslib_1.__decorate([
24
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Type of the state' }),
21
25
  tslib_1.__metadata("design:type", String)
22
26
  ], NewStateRegister.prototype, "type", void 0);
23
27
  tslib_1.__decorate([
24
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
28
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Number of decimal places if the state is a number type' }),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], NewStateRegister.prototype, "place", void 0);
31
+ tslib_1.__decorate([
32
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Unit of the state value' }),
33
+ tslib_1.__metadata("design:type", String)
34
+ ], NewStateRegister.prototype, "unit", void 0);
35
+ tslib_1.__decorate([
36
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'Current state value' }),
25
37
  tslib_1.__metadata("design:type", Object)
26
38
  ], NewStateRegister.prototype, "state", void 0);
27
39
  tslib_1.__decorate([
28
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
40
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Time to live for the state value in seconds' }),
29
41
  tslib_1.__metadata("design:type", Number)
30
42
  ], NewStateRegister.prototype, "ttl", void 0);
31
43
  tslib_1.__decorate([
32
- (0, type_graphql_1.Field)({ nullable: true }),
44
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' }),
33
45
  tslib_1.__metadata("design:type", String)
34
46
  ], NewStateRegister.prototype, "refBy", void 0);
35
47
  exports.NewStateRegister = NewStateRegister = tslib_1.__decorate([
@@ -39,35 +51,47 @@ let StateRegisterPatch = class StateRegisterPatch {
39
51
  };
40
52
  exports.StateRegisterPatch = StateRegisterPatch;
41
53
  tslib_1.__decorate([
42
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
54
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'ID of the state register' }),
43
55
  tslib_1.__metadata("design:type", String)
44
56
  ], StateRegisterPatch.prototype, "id", void 0);
45
57
  tslib_1.__decorate([
46
- (0, type_graphql_1.Field)({ nullable: true }),
58
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Name of the state register' }),
47
59
  tslib_1.__metadata("design:type", String)
48
60
  ], StateRegisterPatch.prototype, "name", void 0);
49
61
  tslib_1.__decorate([
50
- (0, type_graphql_1.Field)({ nullable: true }),
62
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Description of the state register' }),
51
63
  tslib_1.__metadata("design:type", String)
52
64
  ], StateRegisterPatch.prototype, "description", void 0);
53
65
  tslib_1.__decorate([
54
- (0, type_graphql_1.Field)({ nullable: true }),
66
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Group name for the state register' }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], StateRegisterPatch.prototype, "group", void 0);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Type of the state' }),
55
71
  tslib_1.__metadata("design:type", String)
56
72
  ], StateRegisterPatch.prototype, "type", void 0);
57
73
  tslib_1.__decorate([
58
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
74
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Number of decimal places if the state is a number type' }),
75
+ tslib_1.__metadata("design:type", String)
76
+ ], StateRegisterPatch.prototype, "place", void 0);
77
+ tslib_1.__decorate([
78
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Unit of the state value' }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], StateRegisterPatch.prototype, "unit", void 0);
81
+ tslib_1.__decorate([
82
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'Current state value' }),
59
83
  tslib_1.__metadata("design:type", Object)
60
84
  ], StateRegisterPatch.prototype, "state", void 0);
61
85
  tslib_1.__decorate([
62
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
86
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Time to live for the state value in seconds' }),
63
87
  tslib_1.__metadata("design:type", Number)
64
88
  ], StateRegisterPatch.prototype, "ttl", void 0);
65
89
  tslib_1.__decorate([
66
- (0, type_graphql_1.Field)({ nullable: true }),
90
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' }),
67
91
  tslib_1.__metadata("design:type", String)
68
92
  ], StateRegisterPatch.prototype, "refBy", void 0);
69
93
  tslib_1.__decorate([
70
- (0, type_graphql_1.Field)({ nullable: true }),
94
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Flag indicating create/update operations' }),
71
95
  tslib_1.__metadata("design:type", String)
72
96
  ], StateRegisterPatch.prototype, "cuFlag", void 0);
73
97
  exports.StateRegisterPatch = StateRegisterPatch = tslib_1.__decorate([
@@ -77,11 +101,11 @@ let StateRegisterList = class StateRegisterList {
77
101
  };
78
102
  exports.StateRegisterList = StateRegisterList;
79
103
  tslib_1.__decorate([
80
- (0, type_graphql_1.Field)(type => [state_register_1.StateRegister]),
104
+ (0, type_graphql_1.Field)(type => [state_register_1.StateRegister], { description: 'List of state registers' }),
81
105
  tslib_1.__metadata("design:type", Array)
82
106
  ], StateRegisterList.prototype, "items", void 0);
83
107
  tslib_1.__decorate([
84
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
108
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Total number of state registers' }),
85
109
  tslib_1.__metadata("design:type", Number)
86
110
  ], StateRegisterList.prototype, "total", void 0);
87
111
  exports.StateRegisterList = StateRegisterList = tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"state-register-type.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAEtF,iDAA+D;AAE/D,qDAAgD;AAGzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAkB5B,CAAA;AAlBY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,GAAE;;8CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ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AA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,8BAAa,CAAC,CAAC;;gDACT;AAGtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;gDACN;4BALF,iBAAiB;IAD7B,IAAA,yBAAU,GAAE;GACA,iBAAiB,CAM7B","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { StateRegister } from './state-register'\n\n@InputType()\nexport class NewStateRegister {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ScalarObject, { nullable: true })\n state?: any\n\n @Field(type => Int, { nullable: true })\n ttl?: number\n\n @Field({ nullable: true })\n refBy?: string\n}\n\n@InputType()\nexport class StateRegisterPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field(type => ScalarObject, { nullable: true })\n state?: any\n\n @Field(type => Int, { nullable: true })\n ttl?: number\n\n @Field({ nullable: true })\n refBy?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class StateRegisterList {\n @Field(type => [StateRegister])\n items: StateRegister[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"state-register-type.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iDAAoD;AAEpD,qDAAgD;AAGzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CA2B5B,CAAA;AA3BY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;8CAC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E,CAAC,CAAC,8BAAa,CAAC,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;gDACrD;AAGtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;;gDAC1D;4BALF,iBAAiB;IAD7B,IAAA,yBAAU,GAAE;GACA,iBAAiB,CAM7B","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\n\nimport { StateRegister } from './state-register'\n\n@InputType()\nexport class NewStateRegister {\n @Field({ description: 'Name of the state register' })\n name: string\n\n @Field({ nullable: true, description: 'Description of the state register' })\n description?: string\n\n @Field({ nullable: true, description: 'Group name for the state register' })\n group?: string\n\n @Field({ nullable: true, description: 'Type of the state' })\n type?: string\n\n @Field({ nullable: true, description: 'Number of decimal places if the state is a number type' })\n place?: string\n\n @Field({ nullable: true, description: 'Unit of the state value' })\n unit?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'Current state value' })\n state?: any\n\n @Field(type => Int, { nullable: true, description: 'Time to live for the state value in seconds' })\n ttl?: number\n\n @Field({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' })\n refBy?: string\n}\n\n@InputType()\nexport class StateRegisterPatch {\n @Field(type => ID, { nullable: true, description: 'ID of the state register' })\n id?: string\n\n @Field({ nullable: true, description: 'Name of the state register' })\n name?: string\n\n @Field({ nullable: true, description: 'Description of the state register' })\n description?: string\n\n @Field({ nullable: true, description: 'Group name for the state register' })\n group?: string\n\n @Field({ nullable: true, description: 'Type of the state' })\n type?: string\n\n @Field({ nullable: true, description: 'Number of decimal places if the state is a number type' })\n place?: string\n\n @Field({ nullable: true, description: 'Unit of the state value' })\n unit?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'Current state value' })\n state?: any\n\n @Field(type => Int, { nullable: true, description: 'Time to live for the state value in seconds' })\n ttl?: number\n\n @Field({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' })\n refBy?: string\n\n @Field({ nullable: true, description: 'Flag indicating create/update operations' })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class StateRegisterList {\n @Field(type => [StateRegister], { description: 'List of state registers' })\n items: StateRegister[]\n\n @Field(type => Int, { description: 'Total number of state registers' })\n total: number\n}\n"]}
@@ -6,7 +6,10 @@ export declare class StateRegister {
6
6
  domainId?: string;
7
7
  name?: string;
8
8
  description?: string;
9
+ group?: string;
9
10
  type?: string;
11
+ place?: string;
12
+ unit?: string;
10
13
  state?: any;
11
14
  ttl?: number;
12
15
  refBy?: string;
@@ -16,83 +16,102 @@ tslib_1.__decorate([
16
16
  ], StateRegister.prototype, "id", void 0);
17
17
  tslib_1.__decorate([
18
18
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
19
- (0, type_graphql_1.Field)(type => shell_1.Domain),
19
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { description: 'Associated domain for the state register' }),
20
20
  tslib_1.__metadata("design:type", shell_1.Domain)
21
21
  ], StateRegister.prototype, "domain", void 0);
22
22
  tslib_1.__decorate([
23
23
  (0, typeorm_1.RelationId)((stateRegister) => stateRegister.domain),
24
+ (0, type_graphql_1.Field)({ description: 'ID of the associated domain' }),
24
25
  tslib_1.__metadata("design:type", String)
25
26
  ], StateRegister.prototype, "domainId", void 0);
26
27
  tslib_1.__decorate([
27
28
  (0, typeorm_1.Column)(),
28
- (0, type_graphql_1.Field)({ nullable: true }),
29
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Name of the state register' }),
29
30
  tslib_1.__metadata("design:type", String)
30
31
  ], StateRegister.prototype, "name", void 0);
31
32
  tslib_1.__decorate([
32
33
  (0, typeorm_1.Column)({ nullable: true }),
33
- (0, type_graphql_1.Field)({ nullable: true }),
34
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Description of the state register' }),
34
35
  tslib_1.__metadata("design:type", String)
35
36
  ], StateRegister.prototype, "description", void 0);
36
37
  tslib_1.__decorate([
37
38
  (0, typeorm_1.Column)({ nullable: true }),
38
- (0, type_graphql_1.Field)({ nullable: true }),
39
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Group name for the state register' }),
40
+ tslib_1.__metadata("design:type", String)
41
+ ], StateRegister.prototype, "group", void 0);
42
+ tslib_1.__decorate([
43
+ (0, typeorm_1.Column)({ nullable: true }),
44
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Type of the state' }),
39
45
  tslib_1.__metadata("design:type", String)
40
46
  ], StateRegister.prototype, "type", void 0);
47
+ tslib_1.__decorate([
48
+ (0, typeorm_1.Column)({ nullable: true }),
49
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Number of decimal places if the state is a number type' }),
50
+ tslib_1.__metadata("design:type", String)
51
+ ], StateRegister.prototype, "place", void 0);
52
+ tslib_1.__decorate([
53
+ (0, typeorm_1.Column)({ nullable: true }),
54
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Unit of the state value' }),
55
+ tslib_1.__metadata("design:type", String)
56
+ ], StateRegister.prototype, "unit", void 0);
41
57
  tslib_1.__decorate([
42
58
  (0, typeorm_1.Column)('simple-json', { nullable: true, default: null }),
43
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
59
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'Current state value' }),
44
60
  tslib_1.__metadata("design:type", Object)
45
61
  ], StateRegister.prototype, "state", void 0);
46
62
  tslib_1.__decorate([
47
63
  (0, typeorm_1.Column)({ nullable: true, default: null }),
48
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
64
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'Time to live for the state value in seconds' }),
49
65
  tslib_1.__metadata("design:type", Number)
50
66
  ], StateRegister.prototype, "ttl", void 0);
51
67
  tslib_1.__decorate([
52
68
  (0, typeorm_1.Column)({ nullable: true }),
53
- (0, type_graphql_1.Field)({ nullable: true }),
69
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' }),
54
70
  tslib_1.__metadata("design:type", String)
55
71
  ], StateRegister.prototype, "refBy", void 0);
56
72
  tslib_1.__decorate([
57
73
  (0, typeorm_1.Column)({ nullable: true }),
58
- (0, type_graphql_1.Field)({ nullable: true }),
74
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Time when the state was recorded' }),
59
75
  tslib_1.__metadata("design:type", Date)
60
76
  ], StateRegister.prototype, "wroteAt", void 0);
61
77
  tslib_1.__decorate([
62
78
  (0, typeorm_1.CreateDateColumn)(),
63
- (0, type_graphql_1.Field)({ nullable: true }),
79
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Creation time of the state register' }),
64
80
  tslib_1.__metadata("design:type", Date)
65
81
  ], StateRegister.prototype, "createdAt", void 0);
66
82
  tslib_1.__decorate([
67
83
  (0, typeorm_1.UpdateDateColumn)(),
68
- (0, type_graphql_1.Field)({ nullable: true }),
84
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Last update time of the state register' }),
69
85
  tslib_1.__metadata("design:type", Date)
70
86
  ], StateRegister.prototype, "updatedAt", void 0);
71
87
  tslib_1.__decorate([
72
88
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
73
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
89
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who wrote the state' }),
74
90
  tslib_1.__metadata("design:type", auth_base_1.User)
75
91
  ], StateRegister.prototype, "writer", void 0);
76
92
  tslib_1.__decorate([
77
93
  (0, typeorm_1.RelationId)((stateRegister) => stateRegister.writer),
94
+ (0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who wrote the state' }),
78
95
  tslib_1.__metadata("design:type", String)
79
96
  ], StateRegister.prototype, "writerId", void 0);
80
97
  tslib_1.__decorate([
81
98
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
82
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
99
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who created the state register' }),
83
100
  tslib_1.__metadata("design:type", auth_base_1.User)
84
101
  ], StateRegister.prototype, "creator", void 0);
85
102
  tslib_1.__decorate([
86
103
  (0, typeorm_1.RelationId)((stateRegister) => stateRegister.creator),
104
+ (0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who created the state register' }),
87
105
  tslib_1.__metadata("design:type", String)
88
106
  ], StateRegister.prototype, "creatorId", void 0);
89
107
  tslib_1.__decorate([
90
108
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
91
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
109
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'User who last updated the state register' }),
92
110
  tslib_1.__metadata("design:type", auth_base_1.User)
93
111
  ], StateRegister.prototype, "updater", void 0);
94
112
  tslib_1.__decorate([
95
113
  (0, typeorm_1.RelationId)((stateRegister) => stateRegister.updater),
114
+ (0, type_graphql_1.Field)({ nullable: true, description: 'ID of the user who last updated the state register' }),
96
115
  tslib_1.__metadata("design:type", String)
97
116
  ], StateRegister.prototype, "updaterId", void 0);
98
117
  exports.StateRegister = StateRegister = tslib_1.__decorate([
@@ -100,6 +119,10 @@ exports.StateRegister = StateRegister = tslib_1.__decorate([
100
119
  (0, typeorm_1.Index)('ix_state_register_0', (stateRegister) => [stateRegister.domain, stateRegister.name], {
101
120
  unique: true
102
121
  }),
122
+ (0, typeorm_1.Index)('ix_state_register_1', (stateRegister) => [stateRegister.domain, stateRegister.group, stateRegister.name], {
123
+ unique: true,
124
+ where: '"group" IS NOT NULL'
125
+ }),
103
126
  (0, type_graphql_1.ObjectType)({ description: 'Entity for StateRegister' })
104
127
  ], StateRegister);
105
128
  //# sourceMappingURL=state-register.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"state-register.js","sourceRoot":"","sources":["../../../server/service/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AAO,CAAC;;gDAClD;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;8CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;;gDAClD;wBAnEP,aAAa;IALzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE;QAC1G,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;GAC3C,aAAa,CAoEzB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain, ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_state_register_0', (stateRegister: StateRegister) => [stateRegister.domain, stateRegister.name], {\n unique: true\n})\n@ObjectType({ description: 'Entity for StateRegister' })\nexport class StateRegister {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((stateRegister: StateRegister) => stateRegister.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n type?: string\n\n @Column('simple-json', { nullable: true, default: null })\n @Field(type => ScalarObject, { nullable: true })\n state?: any\n\n @Column({ nullable: true, default: null })\n @Field(type => Int, { nullable: true })\n ttl?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n refBy?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n wroteAt?: Date\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n writer?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.writer)\n writerId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"state-register.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAyD;AAEzD,iDAA4D;AAC5D,yDAAgD;AAezC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAoFzB,CAAA;AApFY,sCAAa;AAGf;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;yCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;sCAC1E,cAAM;6CAAA;AAIf;IAFC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,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qB,EACrB,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,EACjG;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,qBAAqB;KAC7B,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;GAC3C,aAAa,CAoFzB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { Domain, ScalarObject } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_state_register_0', (stateRegister: StateRegister) => [stateRegister.domain, stateRegister.name], {\n unique: true\n})\n@Index(\n 'ix_state_register_1',\n (stateRegister: StateRegister) => [stateRegister.domain, stateRegister.group, stateRegister.name],\n {\n unique: true,\n where: '\"group\" IS NOT NULL'\n }\n)\n@ObjectType({ description: 'Entity for StateRegister' })\nexport class StateRegister {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { description: 'Associated domain for the state register' })\n domain?: Domain\n\n @RelationId((stateRegister: StateRegister) => stateRegister.domain)\n @Field({ description: 'ID of the associated domain' })\n domainId?: string\n\n @Column()\n @Field({ nullable: true, description: 'Name of the state register' })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Description of the state register' })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Group name for the state register' })\n group?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Type of the state' })\n type?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Number of decimal places if the state is a number type' })\n place?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Unit of the state value' })\n unit?: string\n\n @Column('simple-json', { nullable: true, default: null })\n @Field(type => ScalarObject, { nullable: true, description: 'Current state value' })\n state?: any\n\n @Column({ nullable: true, default: null })\n @Field(type => Int, { nullable: true, description: 'Time to live for the state value in seconds' })\n ttl?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Reference to an external entity or data, used as a flexible foreign key' })\n refBy?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Time when the state was recorded' })\n wroteAt?: Date\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'Creation time of the state register' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'Last update time of the state register' })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who wrote the state' })\n writer?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.writer)\n @Field({ nullable: true, description: 'ID of the user who wrote the state' })\n writerId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who created the state register' })\n creator?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.creator)\n @Field({ nullable: true, description: 'ID of the user who created the state register' })\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'User who last updated the state register' })\n updater?: User\n\n @RelationId((stateRegister: StateRegister) => stateRegister.updater)\n @Field({ nullable: true, description: 'ID of the user who last updated the state register' })\n updaterId?: string\n}\n"]}