@things-factory/dataset 5.0.0-alpha.5 → 5.0.0-alpha.50
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/README.md +9 -0
- package/assets/data-samples.jpg +0 -0
- package/client/bootstrap.js +21 -1
- package/client/pages/{data-entry-form.js → data-entry/data-entry-form.js} +15 -2
- package/client/pages/data-entry/data-entry-list-page.js +423 -0
- package/client/pages/data-ooc/data-ooc-list-page.js +483 -0
- package/client/pages/data-ooc/data-ooc-view.js +183 -0
- package/client/pages/data-report/data-report-embed-page.js +113 -0
- package/client/pages/data-report/data-report-list-page.js +465 -0
- package/client/pages/data-report/jasper-report-oocs-page.js +122 -0
- package/client/pages/data-report/jasper-report-samples-crosstab-page.js +122 -0
- package/client/pages/data-report/jasper-report-samples-page.js +122 -0
- package/client/pages/data-sample/data-sample-list-page.js +386 -0
- package/client/pages/data-sample/data-sample-view.js +98 -0
- package/client/pages/{data-sensor.js → data-sensor/data-sensor-list-page.js} +43 -64
- package/client/pages/{data-item-list.js → data-set/data-item-list.js} +37 -12
- package/client/pages/{data-set-importer.js → data-set/data-set-importer.js} +0 -0
- package/client/pages/data-set/data-set-list-page.js +746 -0
- package/client/route.js +34 -6
- package/config/config.development.js +13 -0
- package/config/config.production.js +1 -0
- package/dist-server/controllers/create-data-sample.js +133 -0
- package/dist-server/controllers/create-data-sample.js.map +1 -0
- package/dist-server/controllers/data-use-case.js +57 -0
- package/dist-server/controllers/data-use-case.js.map +1 -0
- package/dist-server/controllers/index.js +18 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/jasper-report.js +156 -0
- package/dist-server/controllers/jasper-report.js.map +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/routes.js +13 -24
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-item/data-item-mutation.js +5 -1
- package/dist-server/service/data-item/data-item-mutation.js.map +1 -1
- package/dist-server/service/data-item/data-item-query.js +7 -2
- package/dist-server/service/data-item/data-item-query.js.map +1 -1
- package/dist-server/service/data-item/data-item-type.js +15 -7
- package/dist-server/service/data-item/data-item-type.js.map +1 -1
- package/dist-server/service/data-item/data-item.js +17 -3
- package/dist-server/service/data-item/data-item.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-mutation.js +92 -0
- package/dist-server/service/data-ooc/data-ooc-mutation.js.map +1 -0
- package/dist-server/service/data-ooc/data-ooc-query.js +120 -0
- package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -0
- package/dist-server/service/data-ooc/data-ooc-subscription.js +65 -0
- package/dist-server/service/data-ooc/data-ooc-subscription.js.map +1 -0
- package/dist-server/service/data-ooc/data-ooc-type.js +107 -0
- package/dist-server/service/data-ooc/data-ooc-type.js.map +1 -0
- package/dist-server/service/data-ooc/data-ooc.js +237 -0
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -0
- package/dist-server/service/data-ooc/index.js +10 -0
- package/dist-server/service/data-ooc/index.js.map +1 -0
- package/dist-server/service/data-sample/data-sample-mutation.js +2 -138
- package/dist-server/service/data-sample/data-sample-mutation.js.map +1 -1
- package/dist-server/service/data-sample/data-sample-query.js +7 -2
- package/dist-server/service/data-sample/data-sample-query.js.map +1 -1
- package/dist-server/service/data-sample/data-sample-type.js +12 -42
- package/dist-server/service/data-sample/data-sample-type.js.map +1 -1
- package/dist-server/service/data-sample/data-sample.js +34 -3
- package/dist-server/service/data-sample/data-sample.js.map +1 -1
- package/dist-server/service/data-sensor/data-sensor-query.js +7 -2
- package/dist-server/service/data-sensor/data-sensor-query.js.map +1 -1
- package/dist-server/service/data-set/data-set-mutation.js +40 -14
- package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +185 -3
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/service/data-set/data-set-type.js +84 -3
- package/dist-server/service/data-set/data-set-type.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +110 -15
- package/dist-server/service/data-set/data-set.js.map +1 -1
- package/dist-server/service/index.js +6 -2
- package/dist-server/service/index.js.map +1 -1
- package/package.json +19 -13
- package/server/controllers/create-data-sample.ts +177 -0
- package/server/controllers/data-use-case.ts +85 -0
- package/server/controllers/index.ts +2 -0
- package/server/controllers/jasper-report.ts +170 -0
- package/server/index.ts +1 -0
- package/server/routes.ts +21 -31
- package/server/service/data-item/data-item-mutation.ts +6 -1
- package/server/service/data-item/data-item-query.ts +9 -3
- package/server/service/data-item/data-item-type.ts +10 -6
- package/server/service/data-item/data-item.ts +15 -4
- package/server/service/data-ooc/data-ooc-mutation.ts +150 -0
- package/server/service/data-ooc/data-ooc-query.ts +69 -0
- package/server/service/data-ooc/data-ooc-subscription.ts +51 -0
- package/server/service/data-ooc/data-ooc-type.ts +68 -0
- package/server/service/data-ooc/data-ooc.ts +204 -0
- package/server/service/data-ooc/index.ts +7 -0
- package/server/service/data-sample/data-sample-mutation.ts +3 -172
- package/server/service/data-sample/data-sample-query.ts +9 -3
- package/server/service/data-sample/data-sample-type.ts +7 -28
- package/server/service/data-sample/data-sample.ts +33 -3
- package/server/service/data-sensor/data-sensor-query.ts +9 -3
- package/server/service/data-set/data-set-mutation.ts +53 -14
- package/server/service/data-set/data-set-query.ts +156 -4
- package/server/service/data-set/data-set-type.ts +65 -4
- package/server/service/data-set/data-set.ts +100 -12
- package/server/service/index.ts +6 -2
- package/things-factory.config.js +35 -7
- package/translations/en.json +46 -3
- package/translations/ko.json +45 -3
- package/translations/ms.json +44 -3
- package/translations/zh.json +44 -3
- package/client/pages/data-sample.js +0 -316
- package/client/pages/data-set.js +0 -457
@@ -0,0 +1,237 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;AACzB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB;AAED,IAAA,+BAAgB,EAAC,aAAa,EAAE;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,+DAA+D;CAC7E,CAAC,CAAA;AAOF,IAAa,OAAO,GAApB,MAAa,OAAO;CAmKnB,CAAA;AAhKC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,cAAM,oBAAN,cAAM;uCAA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B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAClG,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACpG,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACtG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;GACjD,OAAO,CAmKnB;AAnKY,0BAAO"}
|
@@ -0,0 +1,10 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -11,111 +11,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
13
13
|
};
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
16
|
-
};
|
17
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
15
|
exports.DataSampleMutation = void 0;
|
19
16
|
const type_graphql_1 = require("type-graphql");
|
20
|
-
const typeorm_1 = require("typeorm");
|
21
|
-
const data_item_1 = require("../data-item/data-item");
|
22
|
-
const data_set_1 = require("../data-set/data-set");
|
23
17
|
const data_sample_1 = require("./data-sample");
|
24
18
|
const data_sample_type_1 = require("./data-sample-type");
|
25
|
-
const
|
19
|
+
const create_data_sample_1 = require("../../controllers/create-data-sample");
|
26
20
|
const debug = require('debug')('things-factory:dataset:data-sample:data-sample-mutation');
|
27
|
-
// parse variable javascript string pattern
|
28
|
-
const replaceVariables = (keys, dic) => {
|
29
|
-
for (const k in keys) {
|
30
|
-
const matches = keys[k].match(/\$\{\w*\}/g);
|
31
|
-
matches &&
|
32
|
-
matches.forEach(m => {
|
33
|
-
keys[k] = keys[k].replace(m, dic[m.slice(2, -1)]);
|
34
|
-
});
|
35
|
-
}
|
36
|
-
return keys;
|
37
|
-
};
|
38
|
-
// It is required UTC date for Partitioning File System like AWS S3.
|
39
|
-
// ex) %YYYY, %MM, %DD
|
40
|
-
const formatDate = (keys, _moment) => {
|
41
|
-
for (const k in keys) {
|
42
|
-
const matches = keys[k].match(/%\w*/g);
|
43
|
-
matches &&
|
44
|
-
matches.forEach(m => {
|
45
|
-
keys[k] = keys[k].replace(m, _moment.format(m.substr(1)));
|
46
|
-
});
|
47
|
-
}
|
48
|
-
return keys;
|
49
|
-
};
|
50
21
|
let DataSampleMutation = class DataSampleMutation {
|
51
22
|
async createDataSample(dataSample, context) {
|
52
|
-
|
53
|
-
const dataSet = await tx.getRepository(data_set_1.DataSet).findOne({ id: dataSample.dataSetId });
|
54
|
-
const dataItems = await tx.getRepository(data_item_1.DataItem).find({
|
55
|
-
where: {
|
56
|
-
domain,
|
57
|
-
dataSet
|
58
|
-
},
|
59
|
-
order: {
|
60
|
-
sequence: 'DESC'
|
61
|
-
}
|
62
|
-
});
|
63
|
-
const spec = dataItems.reduce((spec, dataItem) => {
|
64
|
-
spec[dataItem.tag] = Object.assign(Object.assign({}, dataItem.spec), { name: dataItem.name /* do we need ? */ });
|
65
|
-
return spec;
|
66
|
-
}, {});
|
67
|
-
var partitionKeys = Object.assign(Object.assign({}, dataSet.partitionKeys), { year: '%YYYY', month: '%MM', date: '%DD', variableX: '${x}', variableDataSetId: '${dataSetId}' });
|
68
|
-
const collectedAt = dataSample.collectedAt || new Date();
|
69
|
-
partitionKeys = formatDate(partitionKeys, (0, moment_1.default)(collectedAt).utc());
|
70
|
-
partitionKeys = replaceVariables(partitionKeys, Object.assign({ dataSetId: dataSample.dataSetId }, dataSample.data));
|
71
|
-
return await tx.getRepository(data_sample_1.DataSample).save(Object.assign(Object.assign({ name: dataSet.name, description: dataSet.description }, dataSample), { domain,
|
72
|
-
partitionKeys,
|
73
|
-
spec,
|
74
|
-
collectedAt, creator: user, updater: user }));
|
75
|
-
}
|
76
|
-
async updateDataSample(id, patch, context) {
|
77
|
-
const { domain, user, tx } = context.state;
|
78
|
-
const repository = tx.getRepository(data_sample_1.DataSample);
|
79
|
-
const dataSample = await repository.findOne({
|
80
|
-
where: { domain, id }
|
81
|
-
});
|
82
|
-
return await repository.save(Object.assign(Object.assign(Object.assign({}, dataSample), patch), { updater: user }));
|
83
|
-
}
|
84
|
-
async updateMultipleDataSample(patches, context) {
|
85
|
-
const { domain, user, tx } = context.state;
|
86
|
-
let results = [];
|
87
|
-
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
88
|
-
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
89
|
-
const dataSampleRepo = tx.getRepository(data_sample_1.DataSample);
|
90
|
-
if (_createRecords.length > 0) {
|
91
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
92
|
-
const newRecord = _createRecords[i];
|
93
|
-
const result = await dataSampleRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
94
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
95
|
-
}
|
96
|
-
}
|
97
|
-
if (_updateRecords.length > 0) {
|
98
|
-
for (let i = 0; i < _updateRecords.length; i++) {
|
99
|
-
const newRecord = _updateRecords[i];
|
100
|
-
const dataSample = await dataSampleRepo.findOne(newRecord.id);
|
101
|
-
const result = await dataSampleRepo.save(Object.assign(Object.assign(Object.assign({}, dataSample), newRecord), { updater: user }));
|
102
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
103
|
-
}
|
104
|
-
}
|
105
|
-
return results;
|
106
|
-
}
|
107
|
-
async deleteDataSample(id, context) {
|
108
|
-
const { domain, tx } = context.state;
|
109
|
-
await tx.getRepository(data_sample_1.DataSample).delete({ domain, id });
|
110
|
-
return true;
|
111
|
-
}
|
112
|
-
async deleteDataSamples(ids, context) {
|
113
|
-
const { domain, tx } = context.state;
|
114
|
-
await tx.getRepository(data_sample_1.DataSample).delete({
|
115
|
-
domain,
|
116
|
-
id: (0, typeorm_1.In)(ids)
|
117
|
-
});
|
118
|
-
return true;
|
23
|
+
return await (0, create_data_sample_1.createDataSample)(dataSample, context);
|
119
24
|
}
|
120
25
|
};
|
121
26
|
__decorate([
|
@@ -128,47 +33,6 @@ __decorate([
|
|
128
33
|
__metadata("design:paramtypes", [data_sample_type_1.NewDataSample, Object]),
|
129
34
|
__metadata("design:returntype", Promise)
|
130
35
|
], DataSampleMutation.prototype, "createDataSample", null);
|
131
|
-
__decorate([
|
132
|
-
(0, type_graphql_1.Directive)('@privilege(category: "data-sample", privilege: "mutation", domainOwnerGranted: true)'),
|
133
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
134
|
-
(0, type_graphql_1.Mutation)(returns => data_sample_1.DataSample, { description: 'To modify data sample information' }),
|
135
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
136
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
137
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
138
|
-
__metadata("design:type", Function),
|
139
|
-
__metadata("design:paramtypes", [String, data_sample_type_1.DataSamplePatch, Object]),
|
140
|
-
__metadata("design:returntype", Promise)
|
141
|
-
], DataSampleMutation.prototype, "updateDataSample", null);
|
142
|
-
__decorate([
|
143
|
-
(0, type_graphql_1.Directive)('@privilege(category: "data-sample", privilege: "mutation", domainOwnerGranted: true)'),
|
144
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
145
|
-
(0, type_graphql_1.Mutation)(returns => [data_sample_1.DataSample], { description: "To modify multiple data samples' information" }),
|
146
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [data_sample_type_1.DataSamplePatch])),
|
147
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
148
|
-
__metadata("design:type", Function),
|
149
|
-
__metadata("design:paramtypes", [Array, Object]),
|
150
|
-
__metadata("design:returntype", Promise)
|
151
|
-
], DataSampleMutation.prototype, "updateMultipleDataSample", null);
|
152
|
-
__decorate([
|
153
|
-
(0, type_graphql_1.Directive)('@privilege(category: "data-sample", privilege: "mutation", domainOwnerGranted: true)'),
|
154
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
155
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete a data sample' }),
|
156
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
157
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
158
|
-
__metadata("design:type", Function),
|
159
|
-
__metadata("design:paramtypes", [String, Object]),
|
160
|
-
__metadata("design:returntype", Promise)
|
161
|
-
], DataSampleMutation.prototype, "deleteDataSample", null);
|
162
|
-
__decorate([
|
163
|
-
(0, type_graphql_1.Directive)('@privilege(category: "data-sample", privilege: "mutation", domainOwnerGranted: true)'),
|
164
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
165
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple data samples' }),
|
166
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
167
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
168
|
-
__metadata("design:type", Function),
|
169
|
-
__metadata("design:paramtypes", [Array, Object]),
|
170
|
-
__metadata("design:returntype", Promise)
|
171
|
-
], DataSampleMutation.prototype, "deleteDataSamples", null);
|
172
36
|
DataSampleMutation = __decorate([
|
173
37
|
(0, type_graphql_1.Resolver)(data_sample_1.DataSample)
|
174
38
|
], DataSampleMutation);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data-sample-mutation.js","sourceRoot":"","sources":["../../../server/service/data-sample/data-sample-mutation.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"data-sample-mutation.js","sourceRoot":"","sources":["../../../server/service/data-sample/data-sample-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AAEtE,+CAA0C;AAC1C,yDAAkD;AAElD,6EAAuE;AAEvE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,yDAAyD,CAAC,CAAA;AAGzF,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAI7B,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAY;QACtF,OAAO,MAAM,IAAA,qCAAgB,EAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;CACF,CAAA;AAHC;IAHC,IAAA,wBAAS,EAAC,sFAAsF,CAAC;IACjG,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,wBAAU,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;IACtD,WAAA,IAAA,kBAAG,EAAC,YAAY,CAAC,CAAA;IAA6B,WAAA,IAAA,kBAAG,GAAE,CAAA;;qCAArB,gCAAa;;0DAElE;AANU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAO9B;AAPY,gDAAkB"}
|
@@ -30,8 +30,13 @@ let DataSampleQuery = class DataSampleQuery {
|
|
30
30
|
}
|
31
31
|
async dataSamples(params, context) {
|
32
32
|
const { domain } = context.state;
|
33
|
-
const
|
34
|
-
|
33
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
34
|
+
repository: (0, typeorm_1.getRepository)(data_sample_1.DataSample),
|
35
|
+
params,
|
36
|
+
domain,
|
37
|
+
alias: 'datasample'
|
38
|
+
});
|
39
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
35
40
|
return { items, total };
|
36
41
|
}
|
37
42
|
async dataSet(dataSample) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data-sample-query.js","sourceRoot":"","sources":["../../../server/service/data-sample/data-sample-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AAEvC,yDAAgD;AAChD,
|
1
|
+
{"version":3,"file":"data-sample-query.js","sourceRoot":"","sources":["../../../server/service/data-sample/data-sample-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AAEvC,yDAAgD;AAChD,iDAAwF;AAExF,mDAA8C;AAC9C,+CAA0C;AAC1C,yDAAmD;AAGnD,IAAa,eAAe,GAA5B,MAAa,eAAe;IAG1B,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAY;QACzD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IA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C,EAAE,CAAC,wBAAU,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IACtD,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;iDAM7C;AAID;IAFC,IAAA,wBAAS,EAAC,mFAAmF,CAAC;IAC9F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACjE,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;kDAa1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAO,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;6CAE1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AA9CU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CA+C3B;AA/CY,0CAAe"}
|
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
};
|
11
11
|
var _a, _b;
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
exports.DataSampleList = exports.
|
13
|
+
exports.DataSampleList = exports.NewDataSample = void 0;
|
14
14
|
const type_graphql_1 = require("type-graphql");
|
15
15
|
const shell_1 = require("@things-factory/shell");
|
16
16
|
const data_sample_1 = require("./data-sample");
|
@@ -25,12 +25,12 @@ __decorate([
|
|
25
25
|
__metadata("design:type", String)
|
26
26
|
], NewDataSample.prototype, "description", void 0);
|
27
27
|
__decorate([
|
28
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
29
|
-
__metadata("design:type",
|
30
|
-
], NewDataSample.prototype, "
|
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
|
+
], NewDataSample.prototype, "dataSet", void 0);
|
31
31
|
__decorate([
|
32
32
|
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
33
|
-
__metadata("design:type", typeof (
|
33
|
+
__metadata("design:type", typeof (_b = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _b : Object)
|
34
34
|
], NewDataSample.prototype, "data", void 0);
|
35
35
|
__decorate([
|
36
36
|
(0, type_graphql_1.Field)({ nullable: true }),
|
@@ -40,52 +40,22 @@ __decorate([
|
|
40
40
|
(0, type_graphql_1.Field)({ nullable: true }),
|
41
41
|
__metadata("design:type", String)
|
42
42
|
], NewDataSample.prototype, "source", void 0);
|
43
|
-
__decorate([
|
44
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
45
|
-
__metadata("design:type", Date)
|
46
|
-
], NewDataSample.prototype, "collectedAt", void 0);
|
47
|
-
NewDataSample = __decorate([
|
48
|
-
(0, type_graphql_1.InputType)()
|
49
|
-
], NewDataSample);
|
50
|
-
exports.NewDataSample = NewDataSample;
|
51
|
-
let DataSamplePatch = class DataSamplePatch {
|
52
|
-
};
|
53
|
-
__decorate([
|
54
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
55
|
-
__metadata("design:type", String)
|
56
|
-
], DataSamplePatch.prototype, "id", void 0);
|
57
43
|
__decorate([
|
58
44
|
(0, type_graphql_1.Field)({ nullable: true }),
|
59
45
|
__metadata("design:type", String)
|
60
|
-
],
|
46
|
+
], NewDataSample.prototype, "workDate", void 0);
|
61
47
|
__decorate([
|
62
48
|
(0, type_graphql_1.Field)({ nullable: true }),
|
63
49
|
__metadata("design:type", String)
|
64
|
-
],
|
50
|
+
], NewDataSample.prototype, "workShift", void 0);
|
65
51
|
__decorate([
|
66
52
|
(0, type_graphql_1.Field)({ nullable: true }),
|
67
|
-
__metadata("design:type",
|
68
|
-
],
|
69
|
-
__decorate([
|
70
|
-
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
71
|
-
__metadata("design:type", typeof (_b = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _b : Object)
|
72
|
-
], DataSamplePatch.prototype, "data", void 0);
|
73
|
-
__decorate([
|
74
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
75
|
-
__metadata("design:type", String)
|
76
|
-
], DataSamplePatch.prototype, "rawData", void 0);
|
77
|
-
__decorate([
|
78
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
79
|
-
__metadata("design:type", String)
|
80
|
-
], DataSamplePatch.prototype, "source", void 0);
|
81
|
-
__decorate([
|
82
|
-
(0, type_graphql_1.Field)(),
|
83
|
-
__metadata("design:type", String)
|
84
|
-
], DataSamplePatch.prototype, "cuFlag", void 0);
|
85
|
-
DataSamplePatch = __decorate([
|
53
|
+
__metadata("design:type", Date)
|
54
|
+
], NewDataSample.prototype, "collectedAt", void 0);
|
55
|
+
NewDataSample = __decorate([
|
86
56
|
(0, type_graphql_1.InputType)()
|
87
|
-
],
|
88
|
-
exports.
|
57
|
+
], NewDataSample);
|
58
|
+
exports.NewDataSample = NewDataSample;
|
89
59
|
let DataSampleList = class DataSampleList {
|
90
60
|
};
|
91
61
|
__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data-sample-type.js","sourceRoot":"","sources":["../../../server/service/data-sample/data-sample-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"data-sample-type.js","sourceRoot":"","sources":["../../../server/service/data-sample/data-sample-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAgE;AAEhE,iDAA+D;AAE/D,+CAA0C;AAG1C,IAAa,aAAa,GAA1B,MAAa,aAAa;CA2BzB,CAAA;AAzBC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACnC,iBAAS,oBAAT,iBAAS;8CAAA;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACzC,oBAAY,oBAAZ,oBAAY;2CAAA;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;kDAAA;AA1BP,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CA2BzB;AA3BY,sCAAa;AA8B1B,IAAa,cAAc,GAA3B,MAAa,cAAc;CAM1B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc"}
|
@@ -54,19 +54,25 @@ __decorate([
|
|
54
54
|
(0, type_graphql_1.Field)({ nullable: true }),
|
55
55
|
__metadata("design:type", String)
|
56
56
|
], DataSample.prototype, "type", void 0);
|
57
|
+
__decorate([
|
58
|
+
(0, typeorm_1.Column)({
|
59
|
+
nullable: true
|
60
|
+
}),
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
62
|
+
__metadata("design:type", String)
|
63
|
+
], DataSample.prototype, "useCase", void 0);
|
57
64
|
__decorate([
|
58
65
|
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
59
66
|
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
60
67
|
__metadata("design:type", typeof (_b = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _b : Object)
|
61
68
|
], DataSample.prototype, "partitionKeys", void 0);
|
62
69
|
__decorate([
|
63
|
-
(0, typeorm_1.ManyToOne)(type => data_set_1.DataSet
|
64
|
-
(0, type_graphql_1.Field)(type => data_set_1.DataSet, { nullable:
|
70
|
+
(0, typeorm_1.ManyToOne)(type => data_set_1.DataSet),
|
71
|
+
(0, type_graphql_1.Field)(type => data_set_1.DataSet, { nullable: false }),
|
65
72
|
__metadata("design:type", data_set_1.DataSet)
|
66
73
|
], DataSample.prototype, "dataSet", void 0);
|
67
74
|
__decorate([
|
68
75
|
(0, typeorm_1.RelationId)((dataSample) => dataSample.dataSet),
|
69
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
70
76
|
__metadata("design:type", String)
|
71
77
|
], DataSample.prototype, "dataSetId", void 0);
|
72
78
|
__decorate([
|
@@ -98,6 +104,30 @@ __decorate([
|
|
98
104
|
(0, type_graphql_1.Field)({ nullable: true }),
|
99
105
|
__metadata("design:type", String)
|
100
106
|
], DataSample.prototype, "source", void 0);
|
107
|
+
__decorate([
|
108
|
+
(0, typeorm_1.Column)({
|
109
|
+
nullable: true
|
110
|
+
}),
|
111
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
112
|
+
__metadata("design:type", Boolean)
|
113
|
+
], DataSample.prototype, "ooc", void 0);
|
114
|
+
__decorate([
|
115
|
+
(0, typeorm_1.Column)({
|
116
|
+
nullable: true
|
117
|
+
}),
|
118
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
119
|
+
__metadata("design:type", Boolean)
|
120
|
+
], DataSample.prototype, "oos", void 0);
|
121
|
+
__decorate([
|
122
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
123
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
124
|
+
__metadata("design:type", String)
|
125
|
+
], DataSample.prototype, "workDate", void 0);
|
126
|
+
__decorate([
|
127
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
128
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
129
|
+
__metadata("design:type", String)
|
130
|
+
], DataSample.prototype, "workShift", void 0);
|
101
131
|
__decorate([
|
102
132
|
(0, typeorm_1.Column)({ nullable: true }),
|
103
133
|
(0, type_graphql_1.Field)({ nullable: true }),
|
@@ -138,6 +168,7 @@ __decorate([
|
|
138
168
|
DataSample = __decorate([
|
139
169
|
(0, typeorm_1.Entity)(),
|
140
170
|
(0, typeorm_1.Index)('ix_data_sample_0', (dataSample) => [dataSample.domain, dataSample.dataSet], { unique: false }),
|
171
|
+
(0, typeorm_1.Index)('ix_data_sample_2', (dataSample) => [dataSample.domain, dataSample.dataSet, dataSample.collectedAt], { unique: false }),
|
141
172
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for DataSample' })
|
142
173
|
], DataSample);
|
143
174
|
exports.DataSample = DataSample;
|