@things-factory/integration-base 7.0.7 → 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.
- package/dist-server/controllers/index.d.ts +1 -0
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/publish-data.d.ts +6 -0
- package/dist-server/controllers/publish-data.js +22 -0
- package/dist-server/controllers/publish-data.js.map +1 -0
- package/dist-server/engine/task/index.d.ts +1 -0
- package/dist-server/engine/task/index.js +1 -0
- package/dist-server/engine/task/index.js.map +1 -1
- package/dist-server/engine/task/state-group-read.d.ts +1 -0
- package/dist-server/engine/task/state-group-read.js +62 -0
- package/dist-server/engine/task/state-group-read.js.map +1 -0
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-type.js +6 -9
- package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
- package/dist-server/service/state-register/data-resolver.d.ts +6 -0
- package/dist-server/service/state-register/data-resolver.js +61 -0
- package/dist-server/service/state-register/data-resolver.js.map +1 -0
- package/dist-server/service/state-register/index.d.ts +2 -1
- package/dist-server/service/state-register/index.js +2 -1
- package/dist-server/service/state-register/index.js.map +1 -1
- package/dist-server/service/state-register/state-register-query.js +1 -1
- package/dist-server/service/state-register/state-register-query.js.map +1 -1
- package/dist-server/service/state-register/state-register-type.d.ts +6 -0
- package/dist-server/service/state-register/state-register-type.js +40 -16
- package/dist-server/service/state-register/state-register-type.js.map +1 -1
- package/dist-server/service/state-register/state-register.d.ts +3 -0
- package/dist-server/service/state-register/state-register.js +36 -13
- package/dist-server/service/state-register/state-register.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/integration/task/state-group-read.ja.md +8 -0
- package/helps/integration/task/state-group-read.ko.md +8 -0
- package/helps/integration/task/state-group-read.md +10 -0
- package/helps/integration/task/state-group-read.ms.md +8 -0
- package/helps/integration/task/state-group-read.zh.md +8 -0
- package/package.json +8 -8
- package/server/controllers/index.ts +1 -0
- package/server/controllers/publish-data.ts +29 -0
- package/server/engine/task/index.ts +1 -0
- package/server/engine/task/state-group-read.ts +69 -0
- package/server/service/scenario-instance/scenario-instance-type.ts +6 -9
- package/server/service/state-register/data-resolver.ts +56 -0
- package/server/service/state-register/index.ts +2 -1
- package/server/service/state-register/state-register-query.ts +1 -1
- package/server/service/state-register/state-register-type.ts +36 -20
- 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)(
|
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)(
|
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":";;;;
|
1
|
+
{"version":3,"file":"state-register-type.js","sourceRoot":"","sources":["../../../server/service/state-register/state-register-type.ts"],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0CAA0C,EAAE,CAAC;;kDACpE;6BAhCJ,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAiC9B;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAM7B,CAAA;AANY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,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"]}
|
@@ -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/state-register/state-register.ts"],"names":[],"mappings":";;;;AAAA,
|
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,CAAC;IAClE,IAAA,oBAAK,EAAC,EAAE,WA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,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"]}
|