@things-factory/dataset 4.3.0-alpha.1 → 4.3.2

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 (40) hide show
  1. package/dist-server/index.js +1 -5
  2. package/dist-server/index.js.map +1 -1
  3. package/dist-server/service/index.js +1 -5
  4. package/dist-server/service/index.js.map +1 -1
  5. package/package.json +4 -4
  6. package/dist-server/controllers/create-data-sample.js +0 -133
  7. package/dist-server/controllers/create-data-sample.js.map +0 -1
  8. package/dist-server/controllers/data-use-case.js +0 -57
  9. package/dist-server/controllers/data-use-case.js.map +0 -1
  10. package/dist-server/service/data-ooc/data-ooc-mutation.js +0 -92
  11. package/dist-server/service/data-ooc/data-ooc-mutation.js.map +0 -1
  12. package/dist-server/service/data-ooc/data-ooc-query.js +0 -120
  13. package/dist-server/service/data-ooc/data-ooc-query.js.map +0 -1
  14. package/dist-server/service/data-ooc/data-ooc-subscription.js +0 -65
  15. package/dist-server/service/data-ooc/data-ooc-subscription.js.map +0 -1
  16. package/dist-server/service/data-ooc/data-ooc-type.js +0 -107
  17. package/dist-server/service/data-ooc/data-ooc-type.js.map +0 -1
  18. package/dist-server/service/data-ooc/data-ooc.js +0 -237
  19. package/dist-server/service/data-ooc/data-ooc.js.map +0 -1
  20. package/dist-server/service/data-ooc/index.js +0 -10
  21. package/dist-server/service/data-ooc/index.js.map +0 -1
  22. package/dist-server/service/data-sensor/data-sensor-mutation.js +0 -120
  23. package/dist-server/service/data-sensor/data-sensor-mutation.js.map +0 -1
  24. package/dist-server/service/data-sensor/data-sensor-query.js +0 -113
  25. package/dist-server/service/data-sensor/data-sensor-query.js.map +0 -1
  26. package/dist-server/service/data-sensor/data-sensor-type.js +0 -147
  27. package/dist-server/service/data-sensor/data-sensor-type.js.map +0 -1
  28. package/dist-server/service/data-sensor/data-sensor.js +0 -168
  29. package/dist-server/service/data-sensor/data-sensor.js.map +0 -1
  30. package/dist-server/service/data-sensor/index.js +0 -9
  31. package/dist-server/service/data-sensor/index.js.map +0 -1
  32. package/dist-server/service/data-spec/data-spec-manager.js +0 -20
  33. package/dist-server/service/data-spec/data-spec-manager.js.map +0 -1
  34. package/dist-server/service/data-spec/data-spec-query.js +0 -48
  35. package/dist-server/service/data-spec/data-spec-query.js.map +0 -1
  36. package/dist-server/service/data-spec/data-spec.js +0 -78
  37. package/dist-server/service/data-spec/data-spec.js.map +0 -1
  38. package/dist-server/service/data-spec/index.js +0 -8
  39. package/dist-server/service/data-spec/index.js.map +0 -1
  40. package/yarn-error.log +0 -23244
@@ -1,107 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a, _b, _c;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.DataOocList = exports.DataOocPatch = exports.NewDataOoc = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const shell_1 = require("@things-factory/shell");
16
- const data_ooc_1 = require("./data-ooc");
17
- let NewDataOoc = class NewDataOoc {
18
- };
19
- __decorate([
20
- (0, type_graphql_1.Field)(),
21
- __metadata("design:type", String)
22
- ], NewDataOoc.prototype, "name", void 0);
23
- __decorate([
24
- (0, type_graphql_1.Field)({ nullable: true }),
25
- __metadata("design:type", String)
26
- ], NewDataOoc.prototype, "description", void 0);
27
- __decorate([
28
- (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
29
- __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
30
- ], NewDataOoc.prototype, "dataSet", void 0);
31
- __decorate([
32
- (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
33
- __metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
34
- ], NewDataOoc.prototype, "dataSample", void 0);
35
- __decorate([
36
- (0, type_graphql_1.Field)(type => data_ooc_1.DataOocStatus, { nullable: true }),
37
- __metadata("design:type", String)
38
- ], NewDataOoc.prototype, "state", void 0);
39
- __decorate([
40
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
41
- __metadata("design:type", typeof (_c = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _c : Object)
42
- ], NewDataOoc.prototype, "data", void 0);
43
- __decorate([
44
- (0, type_graphql_1.Field)({ nullable: true }),
45
- __metadata("design:type", String)
46
- ], NewDataOoc.prototype, "rawData", void 0);
47
- __decorate([
48
- (0, type_graphql_1.Field)({ nullable: true }),
49
- __metadata("design:type", String)
50
- ], NewDataOoc.prototype, "source", void 0);
51
- __decorate([
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", Boolean)
54
- ], NewDataOoc.prototype, "ooc", void 0);
55
- __decorate([
56
- (0, type_graphql_1.Field)({ nullable: true }),
57
- __metadata("design:type", Boolean)
58
- ], NewDataOoc.prototype, "oos", void 0);
59
- __decorate([
60
- (0, type_graphql_1.Field)({ nullable: true }),
61
- __metadata("design:type", String)
62
- ], NewDataOoc.prototype, "workDate", void 0);
63
- __decorate([
64
- (0, type_graphql_1.Field)({ nullable: true }),
65
- __metadata("design:type", String)
66
- ], NewDataOoc.prototype, "workShift", void 0);
67
- __decorate([
68
- (0, type_graphql_1.Field)({ nullable: true }),
69
- __metadata("design:type", Date)
70
- ], NewDataOoc.prototype, "collectedAt", void 0);
71
- NewDataOoc = __decorate([
72
- (0, type_graphql_1.InputType)()
73
- ], NewDataOoc);
74
- exports.NewDataOoc = NewDataOoc;
75
- let DataOocPatch = class DataOocPatch {
76
- };
77
- __decorate([
78
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
79
- __metadata("design:type", String)
80
- ], DataOocPatch.prototype, "id", void 0);
81
- __decorate([
82
- (0, type_graphql_1.Field)(type => data_ooc_1.DataOocStatus, { nullable: true }),
83
- __metadata("design:type", String)
84
- ], DataOocPatch.prototype, "state", void 0);
85
- __decorate([
86
- (0, type_graphql_1.Field)({ nullable: true }),
87
- __metadata("design:type", String)
88
- ], DataOocPatch.prototype, "correctiveAction", void 0);
89
- DataOocPatch = __decorate([
90
- (0, type_graphql_1.InputType)()
91
- ], DataOocPatch);
92
- exports.DataOocPatch = DataOocPatch;
93
- let DataOocList = class DataOocList {
94
- };
95
- __decorate([
96
- (0, type_graphql_1.Field)(type => [data_ooc_1.DataOoc]),
97
- __metadata("design:type", Array)
98
- ], DataOocList.prototype, "items", void 0);
99
- __decorate([
100
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
101
- __metadata("design:type", Number)
102
- ], DataOocList.prototype, "total", void 0);
103
- DataOocList = __decorate([
104
- (0, type_graphql_1.ObjectType)()
105
- ], DataOocList);
106
- exports.DataOocList = DataOocList;
107
- //# sourceMappingURL=data-ooc-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-ooc-type.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoE;AAEpE,iDAA+D;AAE/D,yCAAmD;AAGnD,IAAa,UAAU,GAAvB,MAAa,UAAU;CAuCtB,CAAA;AArCC;IADC,IAAA,oBAAK,GAAE;;wCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,oBAAK,EAA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iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,wBAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC5B;AAGrB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACD;AARd,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CASxB;AATY,oCAAY;AAYzB,IAAa,WAAW,GAAxB,MAAa,WAAW;CAMvB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,CAAC;;0CACT;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;AALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB;AANY,kCAAW"}
@@ -1,237 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a, _b, _c, _d, _e, _f, _g, _h;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.DataOoc = exports.DataOocStatus = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const typeorm_1 = require("typeorm");
16
- const auth_base_1 = require("@things-factory/auth-base");
17
- const env_1 = require("@things-factory/env");
18
- const shell_1 = require("@things-factory/shell");
19
- const data_sample_1 = require("../data-sample/data-sample");
20
- const data_set_1 = require("../data-set/data-set");
21
- const ORMCONFIG = env_1.config.get('ormconfig', {});
22
- const DATABASE_TYPE = ORMCONFIG.type;
23
- var DataOocStatus;
24
- (function (DataOocStatus) {
25
- DataOocStatus["CREATED"] = "CREATED";
26
- DataOocStatus["REVIEWED"] = "REVIEWED";
27
- DataOocStatus["CORRECTED"] = "CORRECTED";
28
- })(DataOocStatus = exports.DataOocStatus || (exports.DataOocStatus = {}));
29
- (0, type_graphql_1.registerEnumType)(DataOocStatus, {
30
- name: 'DataOocStatus',
31
- description: 'Out of control data corrective action process progress status'
32
- });
33
- let DataOoc = class DataOoc {
34
- };
35
- __decorate([
36
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
37
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
38
- __metadata("design:type", String)
39
- ], DataOoc.prototype, "id", void 0);
40
- __decorate([
41
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
42
- (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
44
- ], DataOoc.prototype, "domain", void 0);
45
- __decorate([
46
- (0, typeorm_1.RelationId)((dataOoc) => dataOoc.domain),
47
- __metadata("design:type", String)
48
- ], DataOoc.prototype, "domainId", void 0);
49
- __decorate([
50
- (0, typeorm_1.Column)(),
51
- (0, type_graphql_1.Field)(),
52
- __metadata("design:type", String)
53
- ], DataOoc.prototype, "name", void 0);
54
- __decorate([
55
- (0, typeorm_1.Column)({
56
- nullable: true
57
- }),
58
- (0, type_graphql_1.Field)({ nullable: true }),
59
- __metadata("design:type", String)
60
- ], DataOoc.prototype, "description", void 0);
61
- __decorate([
62
- (0, typeorm_1.ManyToOne)(type => data_set_1.DataSet),
63
- (0, type_graphql_1.Field)(type => data_set_1.DataSet, { nullable: true }),
64
- __metadata("design:type", data_set_1.DataSet)
65
- ], DataOoc.prototype, "dataSet", void 0);
66
- __decorate([
67
- (0, typeorm_1.RelationId)((dataOoc) => dataOoc.dataSet),
68
- __metadata("design:type", String)
69
- ], DataOoc.prototype, "dataSetId", void 0);
70
- __decorate([
71
- (0, typeorm_1.OneToOne)(type => data_sample_1.DataSample),
72
- (0, typeorm_1.JoinColumn)(),
73
- (0, type_graphql_1.Field)(type => data_sample_1.DataSample, { nullable: true }),
74
- __metadata("design:type", data_sample_1.DataSample)
75
- ], DataOoc.prototype, "dataSample", void 0);
76
- __decorate([
77
- (0, typeorm_1.RelationId)((dataOoc) => dataOoc.dataSample),
78
- __metadata("design:type", String)
79
- ], DataOoc.prototype, "dataSampleId", void 0);
80
- __decorate([
81
- (0, typeorm_1.Column)({
82
- nullable: true
83
- }),
84
- (0, type_graphql_1.Field)({ nullable: true }),
85
- __metadata("design:type", Boolean)
86
- ], DataOoc.prototype, "ooc", void 0);
87
- __decorate([
88
- (0, typeorm_1.Column)({
89
- nullable: true
90
- }),
91
- (0, type_graphql_1.Field)({ nullable: true }),
92
- __metadata("design:type", Boolean)
93
- ], DataOoc.prototype, "oos", void 0);
94
- __decorate([
95
- (0, typeorm_1.Column)({
96
- nullable: true
97
- }),
98
- (0, type_graphql_1.Field)({ nullable: true }),
99
- __metadata("design:type", String)
100
- ], DataOoc.prototype, "state", void 0);
101
- __decorate([
102
- (0, typeorm_1.Column)({
103
- nullable: true,
104
- type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
105
- ? 'longtext'
106
- : DATABASE_TYPE == 'oracle'
107
- ? 'clob'
108
- : 'varchar'
109
- }),
110
- (0, type_graphql_1.Field)({ nullable: true }),
111
- __metadata("design:type", String)
112
- ], DataOoc.prototype, "correctiveAction", void 0);
113
- __decorate([
114
- (0, typeorm_1.Column)({
115
- nullable: true
116
- }),
117
- (0, type_graphql_1.Field)({ nullable: true }),
118
- __metadata("design:type", String)
119
- ], DataOoc.prototype, "type", void 0);
120
- __decorate([
121
- (0, typeorm_1.Column)({
122
- nullable: true
123
- }),
124
- (0, type_graphql_1.Field)({ nullable: true }),
125
- __metadata("design:type", String)
126
- ], DataOoc.prototype, "useCase", void 0);
127
- __decorate([
128
- (0, typeorm_1.Column)('simple-json', { nullable: true }),
129
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
130
- __metadata("design:type", typeof (_b = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _b : Object)
131
- ], DataOoc.prototype, "partitionKeys", void 0);
132
- __decorate([
133
- (0, typeorm_1.Column)('simple-json', { nullable: true }),
134
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
135
- __metadata("design:type", typeof (_c = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _c : Object)
136
- ], DataOoc.prototype, "data", void 0);
137
- __decorate([
138
- (0, typeorm_1.Column)('simple-json', { nullable: true }),
139
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
140
- __metadata("design:type", typeof (_d = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _d : Object)
141
- ], DataOoc.prototype, "spec", void 0);
142
- __decorate([
143
- (0, typeorm_1.Column)('simple-json', { nullable: true }),
144
- (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
145
- __metadata("design:type", typeof (_e = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _e : Object)
146
- ], DataOoc.prototype, "history", void 0);
147
- __decorate([
148
- (0, typeorm_1.Column)({
149
- nullable: true,
150
- type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
151
- ? 'longtext'
152
- : DATABASE_TYPE == 'oracle'
153
- ? 'clob'
154
- : 'varchar'
155
- }),
156
- (0, type_graphql_1.Field)({ nullable: true }),
157
- __metadata("design:type", String)
158
- ], DataOoc.prototype, "rawData", void 0);
159
- __decorate([
160
- (0, typeorm_1.Column)({
161
- nullable: true
162
- }),
163
- (0, type_graphql_1.Field)({ nullable: true }),
164
- __metadata("design:type", String)
165
- ], DataOoc.prototype, "source", void 0);
166
- __decorate([
167
- (0, typeorm_1.Column)({ nullable: true }),
168
- (0, type_graphql_1.Field)({ nullable: true }),
169
- __metadata("design:type", String)
170
- ], DataOoc.prototype, "workDate", void 0);
171
- __decorate([
172
- (0, typeorm_1.Column)({ nullable: true }),
173
- (0, type_graphql_1.Field)({ nullable: true }),
174
- __metadata("design:type", String)
175
- ], DataOoc.prototype, "workShift", void 0);
176
- __decorate([
177
- (0, typeorm_1.Column)({ nullable: true }),
178
- (0, type_graphql_1.Field)({ nullable: true }),
179
- __metadata("design:type", Date)
180
- ], DataOoc.prototype, "collectedAt", void 0);
181
- __decorate([
182
- (0, typeorm_1.Column)({ nullable: true }),
183
- (0, type_graphql_1.Field)({ nullable: true }),
184
- __metadata("design:type", Date)
185
- ], DataOoc.prototype, "correctedAt", void 0);
186
- __decorate([
187
- (0, typeorm_1.CreateDateColumn)(),
188
- (0, type_graphql_1.Field)({ nullable: true }),
189
- __metadata("design:type", Date)
190
- ], DataOoc.prototype, "createdAt", void 0);
191
- __decorate([
192
- (0, typeorm_1.UpdateDateColumn)(),
193
- (0, type_graphql_1.Field)({ nullable: true }),
194
- __metadata("design:type", Date)
195
- ], DataOoc.prototype, "updatedAt", void 0);
196
- __decorate([
197
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
198
- nullable: true
199
- }),
200
- (0, type_graphql_1.Field)({ nullable: true }),
201
- __metadata("design:type", typeof (_f = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _f : Object)
202
- ], DataOoc.prototype, "corrector", void 0);
203
- __decorate([
204
- (0, typeorm_1.RelationId)((dataOoc) => dataOoc.corrector),
205
- __metadata("design:type", String)
206
- ], DataOoc.prototype, "correctorId", void 0);
207
- __decorate([
208
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
209
- nullable: true
210
- }),
211
- (0, type_graphql_1.Field)({ nullable: true }),
212
- __metadata("design:type", typeof (_g = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _g : Object)
213
- ], DataOoc.prototype, "creator", void 0);
214
- __decorate([
215
- (0, typeorm_1.RelationId)((dataOoc) => dataOoc.creator),
216
- __metadata("design:type", String)
217
- ], DataOoc.prototype, "creatorId", void 0);
218
- __decorate([
219
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
220
- nullable: true
221
- }),
222
- (0, type_graphql_1.Field)({ nullable: true }),
223
- __metadata("design:type", typeof (_h = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _h : Object)
224
- ], DataOoc.prototype, "updater", void 0);
225
- __decorate([
226
- (0, typeorm_1.RelationId)((dataOoc) => dataOoc.creator),
227
- __metadata("design:type", String)
228
- ], DataOoc.prototype, "updaterId", void 0);
229
- DataOoc = __decorate([
230
- (0, typeorm_1.Entity)(),
231
- (0, typeorm_1.Index)('ix_data_ooc_0', (dataOoc) => [dataOoc.domain, dataOoc.dataSet], { unique: false }),
232
- (0, typeorm_1.Index)('ix_data_ooc_1', (dataOoc) => [dataOoc.domain, dataOoc.dataSample], { unique: true }),
233
- (0, typeorm_1.Index)('ix_data_ooc_2', (dataOoc) => [dataOoc.domain, dataOoc.collectedAt], { unique: false }),
234
- (0, type_graphql_1.ObjectType)({ description: 'Entity for Out of control data' })
235
- ], DataOoc);
236
- exports.DataOoc = DataOoc;
237
- //# sourceMappingURL=data-ooc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-ooc.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAWgB;AAEhB,yDAAgD;AAChD,6CAA4C;AAC5C,iDAA4D;AAE5D,4DAAuD;AACvD,mDAA8C;AAE9C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAA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OAAO,CAmKnB;AAnKY,0BAAO"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvers = exports.entities = void 0;
4
- const data_ooc_1 = require("./data-ooc");
5
- const data_ooc_mutation_1 = require("./data-ooc-mutation");
6
- const data_ooc_query_1 = require("./data-ooc-query");
7
- const data_ooc_subscription_1 = require("./data-ooc-subscription");
8
- exports.entities = [data_ooc_1.DataOoc];
9
- exports.resolvers = [data_ooc_query_1.DataOocQuery, data_ooc_mutation_1.DataOocMutation, data_ooc_subscription_1.DataOocSubscription];
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/data-ooc/index.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,2DAAqD;AACrD,qDAA+C;AAC/C,mEAA6D;AAEhD,QAAA,QAAQ,GAAG,CAAC,kBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,6BAAY,EAAE,mCAAe,EAAE,2CAAmB,CAAC,CAAA"}
@@ -1,120 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.DataSensorMutation = void 0;
16
- const type_graphql_1 = require("type-graphql");
17
- const typeorm_1 = require("typeorm");
18
- const data_sensor_1 = require("./data-sensor");
19
- const data_sensor_type_1 = require("./data-sensor-type");
20
- let DataSensorMutation = class DataSensorMutation {
21
- async createDataSensor(dataSensor, context) {
22
- const { domain, user, tx } = context.state;
23
- return await tx.getRepository(data_sensor_1.DataSensor).save(Object.assign(Object.assign({}, dataSensor), { domain, creator: user, updater: user }));
24
- }
25
- async updateDataSensor(id, patch, context) {
26
- const { domain, user, tx } = context.state;
27
- const repository = tx.getRepository(data_sensor_1.DataSensor);
28
- const dataSensor = await repository.findOne({
29
- where: { domain, id }
30
- });
31
- return await repository.save(Object.assign(Object.assign(Object.assign({}, dataSensor), patch), { updater: user }));
32
- }
33
- async updateMultipleDataSensor(patches, context) {
34
- const { domain, user, tx } = context.state;
35
- let results = [];
36
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
37
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
38
- const dataSensorRepo = tx.getRepository(data_sensor_1.DataSensor);
39
- if (_createRecords.length > 0) {
40
- for (let i = 0; i < _createRecords.length; i++) {
41
- const newRecord = _createRecords[i];
42
- const result = await dataSensorRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
43
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
44
- }
45
- }
46
- if (_updateRecords.length > 0) {
47
- for (let i = 0; i < _updateRecords.length; i++) {
48
- const newRecord = _updateRecords[i];
49
- const dataSensor = await dataSensorRepo.findOne(newRecord.id);
50
- const result = await dataSensorRepo.save(Object.assign(Object.assign(Object.assign({}, dataSensor), newRecord), { updater: user }));
51
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
52
- }
53
- }
54
- return results;
55
- }
56
- async deleteDataSensor(id, context) {
57
- const { domain, tx } = context.state;
58
- await tx.getRepository(data_sensor_1.DataSensor).delete({ domain, id });
59
- return true;
60
- }
61
- async deleteDataSensors(ids, context) {
62
- const { domain, tx } = context.state;
63
- await tx.getRepository(data_sensor_1.DataSensor).delete({
64
- domain,
65
- id: (0, typeorm_1.In)(ids)
66
- });
67
- return true;
68
- }
69
- };
70
- __decorate([
71
- (0, type_graphql_1.Directive)('@transaction'),
72
- (0, type_graphql_1.Mutation)(returns => data_sensor_1.DataSensor, { description: 'To create new DataSensor' }),
73
- __param(0, (0, type_graphql_1.Arg)('dataSensor')),
74
- __param(1, (0, type_graphql_1.Ctx)()),
75
- __metadata("design:type", Function),
76
- __metadata("design:paramtypes", [data_sensor_type_1.NewDataSensor, Object]),
77
- __metadata("design:returntype", Promise)
78
- ], DataSensorMutation.prototype, "createDataSensor", null);
79
- __decorate([
80
- (0, type_graphql_1.Directive)('@transaction'),
81
- (0, type_graphql_1.Mutation)(returns => data_sensor_1.DataSensor, { description: 'To modify DataSensor information' }),
82
- __param(0, (0, type_graphql_1.Arg)('id')),
83
- __param(1, (0, type_graphql_1.Arg)('patch')),
84
- __param(2, (0, type_graphql_1.Ctx)()),
85
- __metadata("design:type", Function),
86
- __metadata("design:paramtypes", [String, data_sensor_type_1.DataSensorPatch, Object]),
87
- __metadata("design:returntype", Promise)
88
- ], DataSensorMutation.prototype, "updateDataSensor", null);
89
- __decorate([
90
- (0, type_graphql_1.Directive)('@transaction'),
91
- (0, type_graphql_1.Mutation)(returns => [data_sensor_1.DataSensor], { description: "To modify multiple DataSensors' information" }),
92
- __param(0, (0, type_graphql_1.Arg)('patches', type => [data_sensor_type_1.DataSensorPatch])),
93
- __param(1, (0, type_graphql_1.Ctx)()),
94
- __metadata("design:type", Function),
95
- __metadata("design:paramtypes", [Array, Object]),
96
- __metadata("design:returntype", Promise)
97
- ], DataSensorMutation.prototype, "updateMultipleDataSensor", null);
98
- __decorate([
99
- (0, type_graphql_1.Directive)('@transaction'),
100
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete DataSensor' }),
101
- __param(0, (0, type_graphql_1.Arg)('id')),
102
- __param(1, (0, type_graphql_1.Ctx)()),
103
- __metadata("design:type", Function),
104
- __metadata("design:paramtypes", [String, Object]),
105
- __metadata("design:returntype", Promise)
106
- ], DataSensorMutation.prototype, "deleteDataSensor", null);
107
- __decorate([
108
- (0, type_graphql_1.Directive)('@transaction'),
109
- (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple dataSensors' }),
110
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
111
- __param(1, (0, type_graphql_1.Ctx)()),
112
- __metadata("design:type", Function),
113
- __metadata("design:paramtypes", [Array, Object]),
114
- __metadata("design:returntype", Promise)
115
- ], DataSensorMutation.prototype, "deleteDataSensors", null);
116
- DataSensorMutation = __decorate([
117
- (0, type_graphql_1.Resolver)(data_sensor_1.DataSensor)
118
- ], DataSensorMutation);
119
- exports.DataSensorMutation = DataSensorMutation;
120
- //# sourceMappingURL=data-sensor-mutation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-sensor-mutation.js","sourceRoot":"","sources":["../../../server/service/data-sensor/data-sensor-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,+CAA0C;AAC1C,yDAAmE;AAGnE,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAG7B,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAY;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACzC,UAAU,KACb,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,O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AAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAS1E;AArGU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAsG9B;AAtGY,gDAAkB"}
@@ -1,113 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var _a;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.DataSensorQuery = void 0;
17
- const type_graphql_1 = require("type-graphql");
18
- const typeorm_1 = require("typeorm");
19
- const auth_base_1 = require("@things-factory/auth-base");
20
- const shell_1 = require("@things-factory/shell");
21
- const data_set_1 = require("../data-set/data-set");
22
- const data_sensor_1 = require("./data-sensor");
23
- const data_sensor_type_1 = require("./data-sensor-type");
24
- let DataSensorQuery = class DataSensorQuery {
25
- async dataSensor(id, context) {
26
- const { domain } = context.state;
27
- return await (0, typeorm_1.getRepository)(data_sensor_1.DataSensor).findOne({
28
- where: { domain, id }
29
- });
30
- }
31
- async dataSensors(params, context) {
32
- const { domain } = context.state;
33
- const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
34
- repository: (0, typeorm_1.getRepository)(data_sensor_1.DataSensor),
35
- params,
36
- domain,
37
- alias: 'datasensor'
38
- });
39
- const [items, total] = await queryBuilder.getManyAndCount();
40
- return { items, total };
41
- }
42
- async appliance(dataSensor) {
43
- return await (0, typeorm_1.getRepository)(auth_base_1.Appliance).findOne(dataSensor.applianceId || '');
44
- }
45
- async dataSet(dataSensor) {
46
- return await (0, typeorm_1.getRepository)(data_set_1.DataSet).findOne(dataSensor.dataSetId || '');
47
- }
48
- async domain(dataSensor) {
49
- return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(dataSensor.domainId);
50
- }
51
- async updater(dataSensor) {
52
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(dataSensor.updaterId);
53
- }
54
- async creator(dataSensor) {
55
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(dataSensor.creatorId);
56
- }
57
- };
58
- __decorate([
59
- (0, type_graphql_1.Query)(returns => data_sensor_1.DataSensor, { description: 'To fetch a DataSensor' }),
60
- __param(0, (0, type_graphql_1.Arg)('id')),
61
- __param(1, (0, type_graphql_1.Ctx)()),
62
- __metadata("design:type", Function),
63
- __metadata("design:paramtypes", [String, Object]),
64
- __metadata("design:returntype", Promise)
65
- ], DataSensorQuery.prototype, "dataSensor", null);
66
- __decorate([
67
- (0, type_graphql_1.Query)(returns => data_sensor_type_1.DataSensorList, { description: 'To fetch multiple DataSensors' }),
68
- __param(0, (0, type_graphql_1.Args)()),
69
- __param(1, (0, type_graphql_1.Ctx)()),
70
- __metadata("design:type", Function),
71
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
72
- __metadata("design:returntype", Promise)
73
- ], DataSensorQuery.prototype, "dataSensors", null);
74
- __decorate([
75
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.Appliance),
76
- __param(0, (0, type_graphql_1.Root)()),
77
- __metadata("design:type", Function),
78
- __metadata("design:paramtypes", [data_sensor_1.DataSensor]),
79
- __metadata("design:returntype", Promise)
80
- ], DataSensorQuery.prototype, "appliance", null);
81
- __decorate([
82
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.Appliance),
83
- __param(0, (0, type_graphql_1.Root)()),
84
- __metadata("design:type", Function),
85
- __metadata("design:paramtypes", [data_sensor_1.DataSensor]),
86
- __metadata("design:returntype", Promise)
87
- ], DataSensorQuery.prototype, "dataSet", null);
88
- __decorate([
89
- (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
90
- __param(0, (0, type_graphql_1.Root)()),
91
- __metadata("design:type", Function),
92
- __metadata("design:paramtypes", [data_sensor_1.DataSensor]),
93
- __metadata("design:returntype", Promise)
94
- ], DataSensorQuery.prototype, "domain", null);
95
- __decorate([
96
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
97
- __param(0, (0, type_graphql_1.Root)()),
98
- __metadata("design:type", Function),
99
- __metadata("design:paramtypes", [data_sensor_1.DataSensor]),
100
- __metadata("design:returntype", Promise)
101
- ], DataSensorQuery.prototype, "updater", null);
102
- __decorate([
103
- (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
104
- __param(0, (0, type_graphql_1.Root)()),
105
- __metadata("design:type", Function),
106
- __metadata("design:paramtypes", [data_sensor_1.DataSensor]),
107
- __metadata("design:returntype", Promise)
108
- ], DataSensorQuery.prototype, "creator", null);
109
- DataSensorQuery = __decorate([
110
- (0, type_graphql_1.Resolver)(data_sensor_1.DataSensor)
111
- ], DataSensorQuery);
112
- exports.DataSensorQuery = DataSensorQuery;
113
- //# sourceMappingURL=data-sensor-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-sensor-query.js","sourceRoot":"","sources":["../../../server/service/data-sensor/data-sensor-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAA2D;AAC3D,iDAAwF;AAExF,mDAA8C;AAC9C,+CAA0C;AAC1C,yDAAmD;AAGnD,IAAa,eAAe,GAA5B,MAAa,eAAe;IAE1B,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAY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