@things-factory/dataset 5.0.0-alpha.12 → 5.0.0-alpha.15

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 (67) hide show
  1. package/client/bootstrap.js +3 -3
  2. package/client/pages/data-entry-form.js +14 -5
  3. package/client/pages/data-ooc.js +418 -0
  4. package/client/pages/data-sample.js +94 -47
  5. package/client/pages/data-sensor.js +1 -8
  6. package/client/pages/data-set.js +72 -10
  7. package/client/route.js +4 -0
  8. package/dist-server/controllers/data-use-case.js +57 -0
  9. package/dist-server/controllers/data-use-case.js.map +1 -0
  10. package/dist-server/controllers/index.js +17 -0
  11. package/dist-server/controllers/index.js.map +1 -1
  12. package/dist-server/index.js +1 -0
  13. package/dist-server/index.js.map +1 -1
  14. package/dist-server/service/data-item/data-item-type.js +6 -6
  15. package/dist-server/service/data-item/data-item-type.js.map +1 -1
  16. package/dist-server/service/data-item/data-item.js +1 -1
  17. package/dist-server/service/data-item/data-item.js.map +1 -1
  18. package/dist-server/service/data-ooc/data-ooc-mutation.js +130 -0
  19. package/dist-server/service/data-ooc/data-ooc-mutation.js.map +1 -0
  20. package/dist-server/service/data-ooc/data-ooc-query.js +115 -0
  21. package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -0
  22. package/dist-server/service/data-ooc/data-ooc-type.js +99 -0
  23. package/dist-server/service/data-ooc/data-ooc-type.js.map +1 -0
  24. package/dist-server/service/data-ooc/data-ooc.js +218 -0
  25. package/dist-server/service/data-ooc/data-ooc.js.map +1 -0
  26. package/dist-server/service/data-ooc/index.js +9 -0
  27. package/dist-server/service/data-ooc/index.js.map +1 -0
  28. package/dist-server/service/data-sample/data-sample-mutation.js +31 -89
  29. package/dist-server/service/data-sample/data-sample-mutation.js.map +1 -1
  30. package/dist-server/service/data-sample/data-sample-type.js +5 -43
  31. package/dist-server/service/data-sample/data-sample-type.js.map +1 -1
  32. package/dist-server/service/data-sample/data-sample.js +17 -3
  33. package/dist-server/service/data-sample/data-sample.js.map +1 -1
  34. package/dist-server/service/data-set/data-set-mutation.js +1 -2
  35. package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
  36. package/dist-server/service/data-set/data-set-query.js +12 -0
  37. package/dist-server/service/data-set/data-set-query.js.map +1 -1
  38. package/dist-server/service/data-set/data-set-type.js +19 -3
  39. package/dist-server/service/data-set/data-set-type.js.map +1 -1
  40. package/dist-server/service/data-set/data-set.js +22 -10
  41. package/dist-server/service/data-set/data-set.js.map +1 -1
  42. package/dist-server/service/index.js +6 -2
  43. package/dist-server/service/index.js.map +1 -1
  44. package/package.json +15 -14
  45. package/server/controllers/data-use-case.ts +85 -0
  46. package/server/controllers/index.ts +1 -0
  47. package/server/index.ts +1 -0
  48. package/server/service/data-item/data-item-type.ts +3 -4
  49. package/server/service/data-item/data-item.ts +1 -1
  50. package/server/service/data-ooc/data-ooc-mutation.ts +117 -0
  51. package/server/service/data-ooc/data-ooc-query.ts +63 -0
  52. package/server/service/data-ooc/data-ooc-type.ts +62 -0
  53. package/server/service/data-ooc/data-ooc.ts +188 -0
  54. package/server/service/data-ooc/index.ts +6 -0
  55. package/server/service/data-sample/data-sample-mutation.ts +35 -97
  56. package/server/service/data-sample/data-sample-type.ts +3 -31
  57. package/server/service/data-sample/data-sample.ts +19 -3
  58. package/server/service/data-set/data-set-mutation.ts +1 -4
  59. package/server/service/data-set/data-set-query.ts +8 -1
  60. package/server/service/data-set/data-set-type.ts +15 -4
  61. package/server/service/data-set/data-set.ts +17 -7
  62. package/server/service/index.ts +6 -2
  63. package/things-factory.config.js +4 -0
  64. package/translations/en.json +13 -2
  65. package/translations/ko.json +13 -2
  66. package/translations/ms.json +13 -2
  67. package/translations/zh.json +13 -2
@@ -0,0 +1,130 @@
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.DataOocMutation = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const data_ooc_1 = require("./data-ooc");
19
+ const data_ooc_type_1 = require("./data-ooc-type");
20
+ let DataOocMutation = class DataOocMutation {
21
+ async createDataOoc(dataOoc, context) {
22
+ const { domain, user, tx } = context.state;
23
+ return await tx.getRepository(data_ooc_1.DataOoc).save(Object.assign(Object.assign({}, dataOoc), { domain, creator: user, updater: user }));
24
+ }
25
+ async updateDataOoc(id, patch, context) {
26
+ const { domain, user, tx } = context.state;
27
+ const repository = tx.getRepository(data_ooc_1.DataOoc);
28
+ const dataOoc = await repository.findOne({
29
+ where: { domain, id }
30
+ });
31
+ const more = {};
32
+ if (patch.correctiveAction) {
33
+ more.corrector = user;
34
+ more.state = data_ooc_1.DataOocStatus.CORRECTED;
35
+ }
36
+ return await repository.save(Object.assign(Object.assign(Object.assign(Object.assign({}, dataOoc), patch), more), { updater: user }));
37
+ }
38
+ async updateMultipleDataOoc(patches, context) {
39
+ const { domain, user, tx } = context.state;
40
+ let results = [];
41
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
42
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
43
+ const dataOocRepo = tx.getRepository(data_ooc_1.DataOoc);
44
+ if (_createRecords.length > 0) {
45
+ for (let i = 0; i < _createRecords.length; i++) {
46
+ const newRecord = _createRecords[i];
47
+ const result = await dataOocRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
48
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
49
+ }
50
+ }
51
+ if (_updateRecords.length > 0) {
52
+ for (let i = 0; i < _updateRecords.length; i++) {
53
+ const newRecord = _updateRecords[i];
54
+ const dataOoc = await dataOocRepo.findOne(newRecord.id);
55
+ const result = await dataOocRepo.save(Object.assign(Object.assign(Object.assign({}, dataOoc), newRecord), { updater: user }));
56
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
57
+ }
58
+ }
59
+ return results;
60
+ }
61
+ async deleteDataOoc(id, context) {
62
+ const { domain, tx } = context.state;
63
+ await tx.getRepository(data_ooc_1.DataOoc).delete({ domain, id });
64
+ return true;
65
+ }
66
+ async deleteDataOocs(ids, context) {
67
+ const { domain, tx } = context.state;
68
+ await tx.getRepository(data_ooc_1.DataOoc).delete({
69
+ domain,
70
+ id: (0, typeorm_1.In)(ids)
71
+ });
72
+ return true;
73
+ }
74
+ };
75
+ __decorate([
76
+ (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "mutation", domainOwnerGranted: true)'),
77
+ (0, type_graphql_1.Directive)('@transaction'),
78
+ (0, type_graphql_1.Mutation)(returns => data_ooc_1.DataOoc, { description: 'To create new DataOoc' }),
79
+ __param(0, (0, type_graphql_1.Arg)('dataOoc')),
80
+ __param(1, (0, type_graphql_1.Ctx)()),
81
+ __metadata("design:type", Function),
82
+ __metadata("design:paramtypes", [data_ooc_type_1.NewDataOoc, Object]),
83
+ __metadata("design:returntype", Promise)
84
+ ], DataOocMutation.prototype, "createDataOoc", null);
85
+ __decorate([
86
+ (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "mutation", domainOwnerGranted: true)'),
87
+ (0, type_graphql_1.Directive)('@transaction'),
88
+ (0, type_graphql_1.Mutation)(returns => data_ooc_1.DataOoc, { description: 'To modify DataOoc information' }),
89
+ __param(0, (0, type_graphql_1.Arg)('id')),
90
+ __param(1, (0, type_graphql_1.Arg)('patch')),
91
+ __param(2, (0, type_graphql_1.Ctx)()),
92
+ __metadata("design:type", Function),
93
+ __metadata("design:paramtypes", [String, data_ooc_type_1.DataOocPatch, Object]),
94
+ __metadata("design:returntype", Promise)
95
+ ], DataOocMutation.prototype, "updateDataOoc", null);
96
+ __decorate([
97
+ (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "mutation", domainOwnerGranted: true)'),
98
+ (0, type_graphql_1.Directive)('@transaction'),
99
+ (0, type_graphql_1.Mutation)(returns => [data_ooc_1.DataOoc], { description: "To modify multiple DataOoc' information" }),
100
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [data_ooc_type_1.DataOocPatch])),
101
+ __param(1, (0, type_graphql_1.Ctx)()),
102
+ __metadata("design:type", Function),
103
+ __metadata("design:paramtypes", [Array, Object]),
104
+ __metadata("design:returntype", Promise)
105
+ ], DataOocMutation.prototype, "updateMultipleDataOoc", null);
106
+ __decorate([
107
+ (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "mutation", domainOwnerGranted: true)'),
108
+ (0, type_graphql_1.Directive)('@transaction'),
109
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete DataOoc' }),
110
+ __param(0, (0, type_graphql_1.Arg)('id')),
111
+ __param(1, (0, type_graphql_1.Ctx)()),
112
+ __metadata("design:type", Function),
113
+ __metadata("design:paramtypes", [String, Object]),
114
+ __metadata("design:returntype", Promise)
115
+ ], DataOocMutation.prototype, "deleteDataOoc", null);
116
+ __decorate([
117
+ (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "mutation", domainOwnerGranted: true)'),
118
+ (0, type_graphql_1.Directive)('@transaction'),
119
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple dataOocs' }),
120
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
121
+ __param(1, (0, type_graphql_1.Ctx)()),
122
+ __metadata("design:type", Function),
123
+ __metadata("design:paramtypes", [Array, Object]),
124
+ __metadata("design:returntype", Promise)
125
+ ], DataOocMutation.prototype, "deleteDataOocs", null);
126
+ DataOocMutation = __decorate([
127
+ (0, type_graphql_1.Resolver)(data_ooc_1.DataOoc)
128
+ ], DataOocMutation);
129
+ exports.DataOocMutation = DataOocMutation;
130
+ //# sourceMappingURL=data-ooc-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-ooc-mutation.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAC3C,yCAAmD;AACnD,mDAA0D;AAG1D,IAAa,eAAe,GAA5B,MAAa,eAAe;IAI1B,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAY;QAC1E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,IAAI,iCACtC,OAAO,KACV,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAKD,KAAK,CAAC,aAAa,CAAY,EAAU,EAAgB,KAAmB,EAAS,OAAY;QAC/F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACvC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,EAAS,CAAA;QACtB,IAAI,KAAK,CAA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EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDASvE;AA7GU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CA8G3B;AA9GY,0CAAe"}
@@ -0,0 +1,115 @@
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.DataOocQuery = 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_sample_1 = require("../data-sample/data-sample");
22
+ const data_set_1 = require("../data-set/data-set");
23
+ const data_ooc_1 = require("./data-ooc");
24
+ const data_ooc_type_1 = require("./data-ooc-type");
25
+ let DataOocQuery = class DataOocQuery {
26
+ async dataOoc(id, context) {
27
+ const { domain } = context.state;
28
+ return await (0, typeorm_1.getRepository)(data_ooc_1.DataOoc).findOne({
29
+ where: { domain, id }
30
+ });
31
+ }
32
+ async dataOocs(params, context) {
33
+ const { domain } = context.state;
34
+ const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
35
+ const [items, total] = await (0, typeorm_1.getRepository)(data_ooc_1.DataOoc).findAndCount(convertedParams);
36
+ return { items, total };
37
+ }
38
+ async dataSet(dataOoc) {
39
+ return await (0, typeorm_1.getRepository)(data_set_1.DataSet).findOne({
40
+ id: dataOoc.dataSetId
41
+ });
42
+ }
43
+ async dataSample(dataOoc) {
44
+ return await (0, typeorm_1.getRepository)(data_sample_1.DataSample).findOne({
45
+ id: dataOoc.dataSampleId
46
+ });
47
+ }
48
+ async domain(dataOoc) {
49
+ return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(dataOoc.domainId);
50
+ }
51
+ async updater(dataOoc) {
52
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(dataOoc.updaterId);
53
+ }
54
+ async creator(dataOoc) {
55
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(dataOoc.creatorId);
56
+ }
57
+ };
58
+ __decorate([
59
+ (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "query", domainOwnerGranted: true)'),
60
+ (0, type_graphql_1.Query)(returns => data_ooc_1.DataOoc, { description: 'To fetch a DataOoc' }),
61
+ __param(0, (0, type_graphql_1.Arg)('id')),
62
+ __param(1, (0, type_graphql_1.Ctx)()),
63
+ __metadata("design:type", Function),
64
+ __metadata("design:paramtypes", [String, Object]),
65
+ __metadata("design:returntype", Promise)
66
+ ], DataOocQuery.prototype, "dataOoc", null);
67
+ __decorate([
68
+ (0, type_graphql_1.Directive)('@privilege(category: "data-ooc", privilege: "query", domainOwnerGranted: true)'),
69
+ (0, type_graphql_1.Query)(returns => data_ooc_type_1.DataOocList, { description: 'To fetch multiple DataOoc' }),
70
+ __param(0, (0, type_graphql_1.Args)()),
71
+ __param(1, (0, type_graphql_1.Ctx)()),
72
+ __metadata("design:type", Function),
73
+ __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
74
+ __metadata("design:returntype", Promise)
75
+ ], DataOocQuery.prototype, "dataOocs", null);
76
+ __decorate([
77
+ (0, type_graphql_1.FieldResolver)(type => data_set_1.DataSet),
78
+ __param(0, (0, type_graphql_1.Root)()),
79
+ __metadata("design:type", Function),
80
+ __metadata("design:paramtypes", [data_ooc_1.DataOoc]),
81
+ __metadata("design:returntype", Promise)
82
+ ], DataOocQuery.prototype, "dataSet", null);
83
+ __decorate([
84
+ (0, type_graphql_1.FieldResolver)(type => data_sample_1.DataSample),
85
+ __param(0, (0, type_graphql_1.Root)()),
86
+ __metadata("design:type", Function),
87
+ __metadata("design:paramtypes", [data_ooc_1.DataOoc]),
88
+ __metadata("design:returntype", Promise)
89
+ ], DataOocQuery.prototype, "dataSample", null);
90
+ __decorate([
91
+ (0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
92
+ __param(0, (0, type_graphql_1.Root)()),
93
+ __metadata("design:type", Function),
94
+ __metadata("design:paramtypes", [data_ooc_1.DataOoc]),
95
+ __metadata("design:returntype", Promise)
96
+ ], DataOocQuery.prototype, "domain", null);
97
+ __decorate([
98
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
99
+ __param(0, (0, type_graphql_1.Root)()),
100
+ __metadata("design:type", Function),
101
+ __metadata("design:paramtypes", [data_ooc_1.DataOoc]),
102
+ __metadata("design:returntype", Promise)
103
+ ], DataOocQuery.prototype, "updater", null);
104
+ __decorate([
105
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
106
+ __param(0, (0, type_graphql_1.Root)()),
107
+ __metadata("design:type", Function),
108
+ __metadata("design:paramtypes", [data_ooc_1.DataOoc]),
109
+ __metadata("design:returntype", Promise)
110
+ ], DataOocQuery.prototype, "creator", null);
111
+ DataOocQuery = __decorate([
112
+ (0, type_graphql_1.Resolver)(data_ooc_1.DataOoc)
113
+ ], DataOocQuery);
114
+ exports.DataOocQuery = DataOocQuery;
115
+ //# sourceMappingURL=data-ooc-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-ooc-query.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AAEvC,yDAAgD;AAChD,iDAA4E;AAE5E,4DAAuD;AACvD,mDAA8C;AAC9C,yCAAoC;AACpC,mDAA6C;AAG7C,IAAa,YAAY,GAAzB,MAAa,YAAY;IAGvB,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAY;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,QAAQ,CAAS,MAAiB,EAAS,OAAY;QAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEjF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,OAAO,CAAS,OAAgB;QACpC,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,EAAE,EAAE,OAAO,CAAC,SAAS;SACtB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,UAAU,CAAS,OAAgB;QACvC,OAAO,MAAM,IAAA,uBAAa,E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C,IAAI,CAAC,EAAE,CAAC,wBAAU,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAU,kBAAO;;8CAIxC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAU,kBAAO;;0CAEpC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAU,kBAAO;;2CAErC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAU,kBAAO;;2CAErC;AAjDU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CAkDxB;AAlDY,oCAAY"}
@@ -0,0 +1,99 @@
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 data_ooc_1 = require("./data-ooc");
15
+ const type_graphql_1 = require("type-graphql");
16
+ const shell_1 = require("@things-factory/shell");
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", Date)
62
+ ], NewDataOoc.prototype, "collectedAt", void 0);
63
+ NewDataOoc = __decorate([
64
+ (0, type_graphql_1.InputType)()
65
+ ], NewDataOoc);
66
+ exports.NewDataOoc = NewDataOoc;
67
+ let DataOocPatch = class DataOocPatch {
68
+ };
69
+ __decorate([
70
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
71
+ __metadata("design:type", String)
72
+ ], DataOocPatch.prototype, "id", void 0);
73
+ __decorate([
74
+ (0, type_graphql_1.Field)(type => data_ooc_1.DataOocStatus, { nullable: true }),
75
+ __metadata("design:type", String)
76
+ ], DataOocPatch.prototype, "state", void 0);
77
+ __decorate([
78
+ (0, type_graphql_1.Field)({ nullable: true }),
79
+ __metadata("design:type", String)
80
+ ], DataOocPatch.prototype, "correctiveAction", void 0);
81
+ DataOocPatch = __decorate([
82
+ (0, type_graphql_1.InputType)()
83
+ ], DataOocPatch);
84
+ exports.DataOocPatch = DataOocPatch;
85
+ let DataOocList = class DataOocList {
86
+ };
87
+ __decorate([
88
+ (0, type_graphql_1.Field)(type => [data_ooc_1.DataOoc]),
89
+ __metadata("design:type", Array)
90
+ ], DataOocList.prototype, "items", void 0);
91
+ __decorate([
92
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
93
+ __metadata("design:type", Number)
94
+ ], DataOocList.prototype, "total", void 0);
95
+ DataOocList = __decorate([
96
+ (0, type_graphql_1.ObjectType)()
97
+ ], DataOocList);
98
+ exports.DataOocList = DataOocList;
99
+ //# sourceMappingURL=data-ooc-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-ooc-type.js","sourceRoot":"","sources":["../../../server/service/data-ooc/data-ooc-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yCAAmD;AACnD,+CAAsF;AACtF,iDAA+D;AAK/D,IAAa,UAAU,GAAvB,MAAa,UAAU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,CAAC,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"}
@@ -0,0 +1,218 @@
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;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.DataOoc = exports.DataOocStatus = void 0;
14
+ const typeorm_1 = require("typeorm");
15
+ const shell_1 = require("@things-factory/shell");
16
+ const type_graphql_1 = require("type-graphql");
17
+ const data_sample_1 = require("../data-sample/data-sample");
18
+ const data_set_1 = require("../data-set/data-set");
19
+ const auth_base_1 = require("@things-factory/auth-base");
20
+ const env_1 = require("@things-factory/env");
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["SUBMITTED"] = "SUBMITTED";
29
+ DataOocStatus["APPROVED"] = "APPROVED";
30
+ DataOocStatus["REJECTED"] = "REJECTED";
31
+ })(DataOocStatus = exports.DataOocStatus || (exports.DataOocStatus = {}));
32
+ (0, type_graphql_1.registerEnumType)(DataOocStatus, {
33
+ name: 'DataOocStatus',
34
+ description: 'Out of control data corrective action process progress status'
35
+ });
36
+ let DataOoc = class DataOoc {
37
+ };
38
+ __decorate([
39
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
40
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
41
+ __metadata("design:type", String)
42
+ ], DataOoc.prototype, "id", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
47
+ ], DataOoc.prototype, "domain", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.RelationId)((dataOoc) => dataOoc.domain),
50
+ __metadata("design:type", String)
51
+ ], DataOoc.prototype, "domainId", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)(),
54
+ (0, type_graphql_1.Field)(),
55
+ __metadata("design:type", String)
56
+ ], DataOoc.prototype, "name", 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
+ ], DataOoc.prototype, "description", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.ManyToOne)(type => data_set_1.DataSet),
66
+ (0, type_graphql_1.Field)(type => data_set_1.DataSet, { nullable: true }),
67
+ __metadata("design:type", data_set_1.DataSet)
68
+ ], DataOoc.prototype, "dataSet", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.RelationId)((dataOoc) => dataOoc.dataSet),
71
+ __metadata("design:type", String)
72
+ ], DataOoc.prototype, "dataSetId", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.OneToOne)(type => data_sample_1.DataSample),
75
+ (0, typeorm_1.JoinColumn)(),
76
+ (0, type_graphql_1.Field)(type => data_sample_1.DataSample, { nullable: true }),
77
+ __metadata("design:type", data_sample_1.DataSample)
78
+ ], DataOoc.prototype, "dataSample", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.RelationId)((dataOoc) => dataOoc.dataSample),
81
+ __metadata("design:type", String)
82
+ ], DataOoc.prototype, "dataSampleId", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({
85
+ nullable: true
86
+ }),
87
+ (0, type_graphql_1.Field)({ nullable: true }),
88
+ __metadata("design:type", Boolean)
89
+ ], DataOoc.prototype, "ooc", void 0);
90
+ __decorate([
91
+ (0, typeorm_1.Column)({
92
+ nullable: true
93
+ }),
94
+ (0, type_graphql_1.Field)({ nullable: true }),
95
+ __metadata("design:type", Boolean)
96
+ ], DataOoc.prototype, "oos", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.Column)({
99
+ nullable: true
100
+ }),
101
+ (0, type_graphql_1.Field)({ nullable: true }),
102
+ __metadata("design:type", String)
103
+ ], DataOoc.prototype, "state", void 0);
104
+ __decorate([
105
+ (0, typeorm_1.Column)({
106
+ nullable: true,
107
+ type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
108
+ ? 'longtext'
109
+ : DATABASE_TYPE == 'oracle'
110
+ ? 'clob'
111
+ : 'varchar'
112
+ }),
113
+ (0, type_graphql_1.Field)({ nullable: true }),
114
+ __metadata("design:type", String)
115
+ ], DataOoc.prototype, "correctiveAction", void 0);
116
+ __decorate([
117
+ (0, typeorm_1.Column)({
118
+ nullable: true
119
+ }),
120
+ (0, type_graphql_1.Field)({ nullable: true }),
121
+ __metadata("design:type", String)
122
+ ], DataOoc.prototype, "type", void 0);
123
+ __decorate([
124
+ (0, typeorm_1.Column)('simple-json', { nullable: true }),
125
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
126
+ __metadata("design:type", typeof (_b = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _b : Object)
127
+ ], DataOoc.prototype, "partitionKeys", void 0);
128
+ __decorate([
129
+ (0, typeorm_1.Column)('simple-json', { nullable: true }),
130
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
131
+ __metadata("design:type", typeof (_c = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _c : Object)
132
+ ], DataOoc.prototype, "data", void 0);
133
+ __decorate([
134
+ (0, typeorm_1.Column)('simple-json', { nullable: true }),
135
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
136
+ __metadata("design:type", typeof (_d = typeof shell_1.ScalarObject !== "undefined" && shell_1.ScalarObject) === "function" ? _d : Object)
137
+ ], DataOoc.prototype, "spec", void 0);
138
+ __decorate([
139
+ (0, typeorm_1.Column)({
140
+ nullable: true,
141
+ type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
142
+ ? 'longtext'
143
+ : DATABASE_TYPE == 'oracle'
144
+ ? 'clob'
145
+ : 'varchar'
146
+ }),
147
+ (0, type_graphql_1.Field)({ nullable: true }),
148
+ __metadata("design:type", String)
149
+ ], DataOoc.prototype, "rawData", void 0);
150
+ __decorate([
151
+ (0, typeorm_1.Column)({
152
+ nullable: true
153
+ }),
154
+ (0, type_graphql_1.Field)({ nullable: true }),
155
+ __metadata("design:type", String)
156
+ ], DataOoc.prototype, "source", void 0);
157
+ __decorate([
158
+ (0, typeorm_1.Column)({ nullable: true }),
159
+ (0, type_graphql_1.Field)({ nullable: true }),
160
+ __metadata("design:type", Date)
161
+ ], DataOoc.prototype, "collectedAt", void 0);
162
+ __decorate([
163
+ (0, typeorm_1.Column)({ nullable: true }),
164
+ (0, type_graphql_1.Field)({ nullable: true }),
165
+ __metadata("design:type", Date)
166
+ ], DataOoc.prototype, "correctedAt", void 0);
167
+ __decorate([
168
+ (0, typeorm_1.CreateDateColumn)(),
169
+ (0, type_graphql_1.Field)({ nullable: true }),
170
+ __metadata("design:type", Date)
171
+ ], DataOoc.prototype, "createdAt", void 0);
172
+ __decorate([
173
+ (0, typeorm_1.UpdateDateColumn)(),
174
+ (0, type_graphql_1.Field)({ nullable: true }),
175
+ __metadata("design:type", Date)
176
+ ], DataOoc.prototype, "updatedAt", void 0);
177
+ __decorate([
178
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
179
+ nullable: true
180
+ }),
181
+ (0, type_graphql_1.Field)({ nullable: true }),
182
+ __metadata("design:type", typeof (_e = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _e : Object)
183
+ ], DataOoc.prototype, "corrector", void 0);
184
+ __decorate([
185
+ (0, typeorm_1.RelationId)((dataOoc) => dataOoc.corrector),
186
+ __metadata("design:type", String)
187
+ ], DataOoc.prototype, "correctorId", void 0);
188
+ __decorate([
189
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
190
+ nullable: true
191
+ }),
192
+ (0, type_graphql_1.Field)({ nullable: true }),
193
+ __metadata("design:type", typeof (_f = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _f : Object)
194
+ ], DataOoc.prototype, "creator", void 0);
195
+ __decorate([
196
+ (0, typeorm_1.RelationId)((dataOoc) => dataOoc.creator),
197
+ __metadata("design:type", String)
198
+ ], DataOoc.prototype, "creatorId", void 0);
199
+ __decorate([
200
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
201
+ nullable: true
202
+ }),
203
+ (0, type_graphql_1.Field)({ nullable: true }),
204
+ __metadata("design:type", typeof (_g = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _g : Object)
205
+ ], DataOoc.prototype, "updater", void 0);
206
+ __decorate([
207
+ (0, typeorm_1.RelationId)((dataOoc) => dataOoc.creator),
208
+ __metadata("design:type", String)
209
+ ], DataOoc.prototype, "updaterId", void 0);
210
+ DataOoc = __decorate([
211
+ (0, typeorm_1.Entity)(),
212
+ (0, typeorm_1.Index)('ix_data_ooc_0', (dataOoc) => [dataOoc.domain, dataOoc.dataSet], { unique: false }),
213
+ (0, typeorm_1.Index)('ix_data_ooc_1', (dataOoc) => [dataOoc.domain, dataOoc.dataSample], { unique: true }),
214
+ (0, typeorm_1.Index)('ix_data_ooc_2', (dataOoc) => [dataOoc.domain, dataOoc.collectedAt], { unique: false }),
215
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for Out of control data' })
216
+ ], DataOoc);
217
+ exports.DataOoc = DataOoc;
218
+ //# 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,qCAWgB;AAChB,iDAA4D;AAC5D,+CAA2E;AAE3E,4DAAuD;AACvD,mDAA8C;AAC9C,yDAAgD;AAChD,6CAA4C;AAE5C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,sCAAqB,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,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,CAiJnB;AAjJY,0BAAO"}
@@ -0,0 +1,9 @@
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
+ exports.entities = [data_ooc_1.DataOoc];
8
+ exports.resolvers = [data_ooc_query_1.DataOocQuery, data_ooc_mutation_1.DataOocMutation];
9
+ //# 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;AAElC,QAAA,QAAQ,GAAG,CAAC,kBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,6BAAY,EAAE,mCAAe,CAAC,CAAA"}