@things-factory/dataset 6.0.0-zeta.44 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/service/data-item/data-item-mutation.js +69 -0
- package/dist-server/service/data-item/data-item-mutation.js.map +1 -0
- package/dist-server/service/data-item/data-item-query.js +100 -0
- package/dist-server/service/data-item/data-item-query.js.map +1 -0
- package/dist-server/service/data-item/data-item-type.js +80 -0
- package/dist-server/service/data-item/data-item-type.js.map +1 -0
- package/dist-server/service/data-item/data-item.js +136 -0
- package/dist-server/service/data-item/data-item.js.map +1 -0
- package/dist-server/service/data-item/index.js +9 -0
- package/dist-server/service/data-item/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
@@ -0,0 +1,69 @@
|
|
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.DataItemMutation = void 0;
|
16
|
+
const type_graphql_1 = require("type-graphql");
|
17
|
+
const typeorm_1 = require("typeorm");
|
18
|
+
const data_set_1 = require("../data-set/data-set");
|
19
|
+
const data_item_1 = require("./data-item");
|
20
|
+
const data_item_type_1 = require("./data-item-type");
|
21
|
+
let DataItemMutation = class DataItemMutation {
|
22
|
+
async updateMultipleDataItem(dataSetId, patches, context) {
|
23
|
+
const { domain, user, tx } = context.state;
|
24
|
+
let results = [];
|
25
|
+
const dataItemRepo = tx.getRepository(data_item_1.DataItem);
|
26
|
+
const dataSet = await tx.getRepository(data_set_1.DataSet).findOne(dataSetId);
|
27
|
+
await dataItemRepo.delete({ domain, dataSet: dataSetId });
|
28
|
+
for (let i = 0; i < patches.length; i++) {
|
29
|
+
const result = await dataItemRepo.save(Object.assign(Object.assign({ quota: 1 }, patches[i]), { sequence: i, dataSet,
|
30
|
+
domain, creator: user, updater: user }));
|
31
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
32
|
+
}
|
33
|
+
return results;
|
34
|
+
}
|
35
|
+
async deleteDataItems(ids, context) {
|
36
|
+
const { domain, tx } = context.state;
|
37
|
+
await tx.getRepository(data_item_1.DataItem).delete({
|
38
|
+
domain,
|
39
|
+
id: (0, typeorm_1.In)(ids)
|
40
|
+
});
|
41
|
+
return true;
|
42
|
+
}
|
43
|
+
};
|
44
|
+
__decorate([
|
45
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "mutation", domainOwnerGranted: true)'),
|
46
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
47
|
+
(0, type_graphql_1.Mutation)(returns => [data_item_1.DataItem], { description: "To modify multiple DataItems' information" }),
|
48
|
+
__param(0, (0, type_graphql_1.Arg)('dataSetId')),
|
49
|
+
__param(1, (0, type_graphql_1.Arg)('patches', type => [data_item_type_1.DataItemPatch])),
|
50
|
+
__param(2, (0, type_graphql_1.Ctx)()),
|
51
|
+
__metadata("design:type", Function),
|
52
|
+
__metadata("design:paramtypes", [String, Array, Object]),
|
53
|
+
__metadata("design:returntype", Promise)
|
54
|
+
], DataItemMutation.prototype, "updateMultipleDataItem", null);
|
55
|
+
__decorate([
|
56
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "mutation", domainOwnerGranted: true)'),
|
57
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
58
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple dataItems' }),
|
59
|
+
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
60
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
61
|
+
__metadata("design:type", Function),
|
62
|
+
__metadata("design:paramtypes", [Array, Object]),
|
63
|
+
__metadata("design:returntype", Promise)
|
64
|
+
], DataItemMutation.prototype, "deleteDataItems", null);
|
65
|
+
DataItemMutation = __decorate([
|
66
|
+
(0, type_graphql_1.Resolver)(data_item_1.DataItem)
|
67
|
+
], DataItemMutation);
|
68
|
+
exports.DataItemMutation = DataItemMutation;
|
69
|
+
//# sourceMappingURL=data-item-mutation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"data-item-mutation.js","sourceRoot":"","sources":["../../../server/service/data-item/data-item-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA8C;AAC9C,2CAAsC;AACtC,qDAAgD;AAGzC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAIrB,AAAN,KAAK,CAAC,sBAAsB,CACR,SAAiB,EACM,OAAwB,EAC1D,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,YAAY,GAAG,EAAE,CAAC,aAAa,CAAC,oBAAQ,CAAC,CAAA;QAC/C,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAElE,MAAM,YAAY,CAAC,MAAM,CAAC,E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AC;IAC9F,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDASxE;AA9CU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,gBAAgB,CA+C5B;AA/CY,4CAAgB"}
|
@@ -0,0 +1,100 @@
|
|
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.DataItemQuery = 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_item_1 = require("./data-item");
|
23
|
+
const data_item_type_1 = require("./data-item-type");
|
24
|
+
let DataItemQuery = class DataItemQuery {
|
25
|
+
async dataItem(id, context) {
|
26
|
+
const { domain } = context.state;
|
27
|
+
return await (0, typeorm_1.getRepository)(data_item_1.DataItem).findOne({
|
28
|
+
where: { domain, id }
|
29
|
+
});
|
30
|
+
}
|
31
|
+
async dataItems(params, context) {
|
32
|
+
const { domain } = context.state;
|
33
|
+
const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
|
34
|
+
const [items, total] = await (0, typeorm_1.getRepository)(data_item_1.DataItem).findAndCount(convertedParams);
|
35
|
+
return { items, total };
|
36
|
+
}
|
37
|
+
async dataSet(dataItem) {
|
38
|
+
return await (0, typeorm_1.getRepository)(data_set_1.DataSet).findOne(dataItem.dataSetId);
|
39
|
+
}
|
40
|
+
async domain(dataItem) {
|
41
|
+
return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(dataItem.domainId);
|
42
|
+
}
|
43
|
+
async updater(dataItem) {
|
44
|
+
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(dataItem.updaterId);
|
45
|
+
}
|
46
|
+
async creator(dataItem) {
|
47
|
+
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(dataItem.creatorId);
|
48
|
+
}
|
49
|
+
};
|
50
|
+
__decorate([
|
51
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "query", domainOwnerGranted: true)'),
|
52
|
+
(0, type_graphql_1.Query)(returns => data_item_1.DataItem, { description: 'To fetch a DataItem' }),
|
53
|
+
__param(0, (0, type_graphql_1.Arg)('id')),
|
54
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
55
|
+
__metadata("design:type", Function),
|
56
|
+
__metadata("design:paramtypes", [String, Object]),
|
57
|
+
__metadata("design:returntype", Promise)
|
58
|
+
], DataItemQuery.prototype, "dataItem", null);
|
59
|
+
__decorate([
|
60
|
+
(0, type_graphql_1.Directive)('@privilege(category: "data-set", privilege: "query", domainOwnerGranted: true)'),
|
61
|
+
(0, type_graphql_1.Query)(returns => data_item_type_1.DataItemList, { description: 'To fetch multiple DataItems' }),
|
62
|
+
__param(0, (0, type_graphql_1.Args)()),
|
63
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
64
|
+
__metadata("design:type", Function),
|
65
|
+
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
66
|
+
__metadata("design:returntype", Promise)
|
67
|
+
], DataItemQuery.prototype, "dataItems", null);
|
68
|
+
__decorate([
|
69
|
+
(0, type_graphql_1.FieldResolver)(type => data_set_1.DataSet),
|
70
|
+
__param(0, (0, type_graphql_1.Root)()),
|
71
|
+
__metadata("design:type", Function),
|
72
|
+
__metadata("design:paramtypes", [data_item_1.DataItem]),
|
73
|
+
__metadata("design:returntype", Promise)
|
74
|
+
], DataItemQuery.prototype, "dataSet", null);
|
75
|
+
__decorate([
|
76
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
77
|
+
__param(0, (0, type_graphql_1.Root)()),
|
78
|
+
__metadata("design:type", Function),
|
79
|
+
__metadata("design:paramtypes", [data_item_1.DataItem]),
|
80
|
+
__metadata("design:returntype", Promise)
|
81
|
+
], DataItemQuery.prototype, "domain", null);
|
82
|
+
__decorate([
|
83
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
84
|
+
__param(0, (0, type_graphql_1.Root)()),
|
85
|
+
__metadata("design:type", Function),
|
86
|
+
__metadata("design:paramtypes", [data_item_1.DataItem]),
|
87
|
+
__metadata("design:returntype", Promise)
|
88
|
+
], DataItemQuery.prototype, "updater", null);
|
89
|
+
__decorate([
|
90
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
91
|
+
__param(0, (0, type_graphql_1.Root)()),
|
92
|
+
__metadata("design:type", Function),
|
93
|
+
__metadata("design:paramtypes", [data_item_1.DataItem]),
|
94
|
+
__metadata("design:returntype", Promise)
|
95
|
+
], DataItemQuery.prototype, "creator", null);
|
96
|
+
DataItemQuery = __decorate([
|
97
|
+
(0, type_graphql_1.Resolver)(data_item_1.DataItem)
|
98
|
+
], DataItemQuery);
|
99
|
+
exports.DataItemQuery = DataItemQuery;
|
100
|
+
//# sourceMappingURL=data-item-query.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"data-item-query.js","sourceRoot":"","sources":["../../../server/service/data-item/data-item-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8F;AAC9F,qCAAuC;AAEvC,yDAAgD;AAChD,iDAA4E;AAE5E,mDAA8C;AAC9C,2CAAsC;AACtC,qDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU,EAAS,OAAY;QACvD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,oBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAY;QAC5D,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,oBAAQ,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAElF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,QAAkB;QACtC,OAAO,MAAM,IAAA,uBAAa,EAAC,k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AI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAW,oBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAW,oBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAW,oBAAQ;;4CAEvC;AAxCU,aAAa;IADzB,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,aAAa,CAyCzB;AAzCY,sCAAa"}
|
@@ -0,0 +1,80 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.DataItemList = exports.DataItemPatch = void 0;
|
13
|
+
const type_graphql_1 = require("type-graphql");
|
14
|
+
const shell_1 = require("@things-factory/shell");
|
15
|
+
const data_item_1 = require("./data-item");
|
16
|
+
let DataItemPatch = class DataItemPatch {
|
17
|
+
};
|
18
|
+
__decorate([
|
19
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
20
|
+
__metadata("design:type", String)
|
21
|
+
], DataItemPatch.prototype, "id", void 0);
|
22
|
+
__decorate([
|
23
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
24
|
+
__metadata("design:type", String)
|
25
|
+
], DataItemPatch.prototype, "dataSetId", void 0);
|
26
|
+
__decorate([
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
28
|
+
__metadata("design:type", String)
|
29
|
+
], DataItemPatch.prototype, "name", void 0);
|
30
|
+
__decorate([
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
32
|
+
__metadata("design:type", String)
|
33
|
+
], DataItemPatch.prototype, "description", void 0);
|
34
|
+
__decorate([
|
35
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
36
|
+
__metadata("design:type", Number)
|
37
|
+
], DataItemPatch.prototype, "sequence", void 0);
|
38
|
+
__decorate([
|
39
|
+
(0, type_graphql_1.Field)(type => data_item_1.DataItemType, { nullable: true }),
|
40
|
+
__metadata("design:type", String)
|
41
|
+
], DataItemPatch.prototype, "type", void 0);
|
42
|
+
__decorate([
|
43
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
44
|
+
__metadata("design:type", Number)
|
45
|
+
], DataItemPatch.prototype, "quota", void 0);
|
46
|
+
__decorate([
|
47
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
48
|
+
__metadata("design:type", String)
|
49
|
+
], DataItemPatch.prototype, "options", void 0);
|
50
|
+
__decorate([
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
52
|
+
__metadata("design:type", Boolean)
|
53
|
+
], DataItemPatch.prototype, "active", void 0);
|
54
|
+
__decorate([
|
55
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
56
|
+
__metadata("design:type", Object)
|
57
|
+
], DataItemPatch.prototype, "spec", void 0);
|
58
|
+
__decorate([
|
59
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
60
|
+
__metadata("design:type", String)
|
61
|
+
], DataItemPatch.prototype, "cuFlag", void 0);
|
62
|
+
DataItemPatch = __decorate([
|
63
|
+
(0, type_graphql_1.InputType)()
|
64
|
+
], DataItemPatch);
|
65
|
+
exports.DataItemPatch = DataItemPatch;
|
66
|
+
let DataItemList = class DataItemList {
|
67
|
+
};
|
68
|
+
__decorate([
|
69
|
+
(0, type_graphql_1.Field)(type => [data_item_1.DataItem]),
|
70
|
+
__metadata("design:type", Array)
|
71
|
+
], DataItemList.prototype, "items", void 0);
|
72
|
+
__decorate([
|
73
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
74
|
+
__metadata("design:type", Number)
|
75
|
+
], DataItemList.prototype, "total", void 0);
|
76
|
+
DataItemList = __decorate([
|
77
|
+
(0, type_graphql_1.ObjectType)()
|
78
|
+
], DataItemList);
|
79
|
+
exports.DataItemList = DataItemList;
|
80
|
+
//# sourceMappingURL=data-item-type.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"data-item-type.js","sourceRoot":"","sources":["../../../server/service/data-item/data-item-type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoE;AAEpE,iDAAoD;AAEpD,2CAAoD;AAG7C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAiCzB,CAAA;AAhCC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACtB;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,wBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAEnB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACzB;AAEd;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACnC;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAhCJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAiCzB;AAjCY,sCAAa;AAoCnB,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,oBAAQ,CAAC,CAAC;;2CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;AALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB;AANY,oCAAY"}
|
@@ -0,0 +1,136 @@
|
|
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.DataItem = exports.DataItemType = 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 shell_1 = require("@things-factory/shell");
|
18
|
+
const data_set_1 = require("../data-set/data-set");
|
19
|
+
var DataItemType;
|
20
|
+
(function (DataItemType) {
|
21
|
+
DataItemType["number"] = "number";
|
22
|
+
DataItemType["text"] = "text";
|
23
|
+
DataItemType["boolean"] = "boolean";
|
24
|
+
DataItemType["select"] = "select";
|
25
|
+
})(DataItemType = exports.DataItemType || (exports.DataItemType = {}));
|
26
|
+
(0, type_graphql_1.registerEnumType)(DataItemType, {
|
27
|
+
name: 'DataItemType',
|
28
|
+
description: 'state enumeration of a data-item'
|
29
|
+
});
|
30
|
+
let DataItem = class DataItem {
|
31
|
+
};
|
32
|
+
__decorate([
|
33
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
34
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
35
|
+
__metadata("design:type", String)
|
36
|
+
], DataItem.prototype, "id", void 0);
|
37
|
+
__decorate([
|
38
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
39
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
40
|
+
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
41
|
+
], DataItem.prototype, "domain", void 0);
|
42
|
+
__decorate([
|
43
|
+
(0, typeorm_1.RelationId)((dataItem) => dataItem.domain),
|
44
|
+
__metadata("design:type", String)
|
45
|
+
], DataItem.prototype, "domainId", void 0);
|
46
|
+
__decorate([
|
47
|
+
(0, typeorm_1.Column)(),
|
48
|
+
(0, type_graphql_1.Field)(),
|
49
|
+
__metadata("design:type", String)
|
50
|
+
], DataItem.prototype, "name", void 0);
|
51
|
+
__decorate([
|
52
|
+
(0, typeorm_1.Column)({
|
53
|
+
nullable: true
|
54
|
+
}),
|
55
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
56
|
+
__metadata("design:type", String)
|
57
|
+
], DataItem.prototype, "description", void 0);
|
58
|
+
__decorate([
|
59
|
+
(0, typeorm_1.ManyToOne)(type => data_set_1.DataSet, dataSet => dataSet.dataItems, { onDelete: 'CASCADE' }),
|
60
|
+
(0, type_graphql_1.Field)(type => data_set_1.DataSet, { nullable: true }),
|
61
|
+
__metadata("design:type", data_set_1.DataSet)
|
62
|
+
], DataItem.prototype, "dataSet", void 0);
|
63
|
+
__decorate([
|
64
|
+
(0, typeorm_1.RelationId)((dataItem) => dataItem.dataSet),
|
65
|
+
__metadata("design:type", String)
|
66
|
+
], DataItem.prototype, "dataSetId", void 0);
|
67
|
+
__decorate([
|
68
|
+
(0, typeorm_1.Column)(),
|
69
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
70
|
+
__metadata("design:type", Number)
|
71
|
+
], DataItem.prototype, "sequence", void 0);
|
72
|
+
__decorate([
|
73
|
+
(0, typeorm_1.Column)({
|
74
|
+
nullable: true
|
75
|
+
}),
|
76
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
77
|
+
__metadata("design:type", Boolean)
|
78
|
+
], DataItem.prototype, "active", void 0);
|
79
|
+
__decorate([
|
80
|
+
(0, typeorm_1.Column)({
|
81
|
+
nullable: true
|
82
|
+
}),
|
83
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
84
|
+
__metadata("design:type", String)
|
85
|
+
], DataItem.prototype, "type", void 0);
|
86
|
+
__decorate([
|
87
|
+
(0, typeorm_1.Column)({
|
88
|
+
nullable: true
|
89
|
+
}),
|
90
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
91
|
+
__metadata("design:type", Number)
|
92
|
+
], DataItem.prototype, "quota", void 0);
|
93
|
+
__decorate([
|
94
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
95
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
|
96
|
+
__metadata("design:type", Object)
|
97
|
+
], DataItem.prototype, "spec", void 0);
|
98
|
+
__decorate([
|
99
|
+
(0, typeorm_1.CreateDateColumn)(),
|
100
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
101
|
+
__metadata("design:type", Date)
|
102
|
+
], DataItem.prototype, "createdAt", void 0);
|
103
|
+
__decorate([
|
104
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
105
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
106
|
+
__metadata("design:type", Date)
|
107
|
+
], DataItem.prototype, "updatedAt", void 0);
|
108
|
+
__decorate([
|
109
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
110
|
+
nullable: true
|
111
|
+
}),
|
112
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
113
|
+
__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
114
|
+
], DataItem.prototype, "creator", void 0);
|
115
|
+
__decorate([
|
116
|
+
(0, typeorm_1.RelationId)((dataItem) => dataItem.creator),
|
117
|
+
__metadata("design:type", String)
|
118
|
+
], DataItem.prototype, "creatorId", void 0);
|
119
|
+
__decorate([
|
120
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
121
|
+
nullable: true
|
122
|
+
}),
|
123
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
124
|
+
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
125
|
+
], DataItem.prototype, "updater", void 0);
|
126
|
+
__decorate([
|
127
|
+
(0, typeorm_1.RelationId)((dataItem) => dataItem.creator),
|
128
|
+
__metadata("design:type", String)
|
129
|
+
], DataItem.prototype, "updaterId", void 0);
|
130
|
+
DataItem = __decorate([
|
131
|
+
(0, typeorm_1.Entity)(),
|
132
|
+
(0, typeorm_1.Index)('ix_data_item_0', (dataItem) => [dataItem.domain, dataItem.dataSet, dataItem.name], { unique: true }),
|
133
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for DataItem' })
|
134
|
+
], DataItem);
|
135
|
+
exports.DataItem = DataItem;
|
136
|
+
//# sourceMappingURL=data-item.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"data-item.js","sourceRoot":"","sources":["../../../server/service/data-item/data-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAA2E;AAC3E,qCASgB;AAEhB,yDAAgD;AAChD,iDAA4D;AAE5D,mDAA8C;AAE9C,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAED,IAAA,+BAAgB,EAAC,YAAY,EAAE;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,kCAAkC;CAChD,CAAC,CAAA;AAKK,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAgFpB,CAAA;AA/EC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;oCACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ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MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAgFpB;AAhFY,4BAAQ"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
4
|
+
const data_item_1 = require("./data-item");
|
5
|
+
const data_item_query_1 = require("./data-item-query");
|
6
|
+
const data_item_mutation_1 = require("./data-item-mutation");
|
7
|
+
exports.entities = [data_item_1.DataItem];
|
8
|
+
exports.resolvers = [data_item_query_1.DataItemQuery, data_item_mutation_1.DataItemMutation];
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/data-item/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AACtC,uDAAiD;AACjD,6DAAuD;AAE1C,QAAA,QAAQ,GAAG,CAAC,oBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,+BAAa,EAAE,qCAAgB,CAAC,CAAA"}
|