@things-factory/resource-base 5.0.0 → 5.0.11
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/index.js +3 -16
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/entity/entity-mutation.js +21 -32
- package/dist-server/service/entity/entity-mutation.js.map +1 -1
- package/dist-server/service/entity/entity-query.js +44 -55
- package/dist-server/service/entity/entity-query.js.map +1 -1
- package/dist-server/service/entity/entity-type.js +84 -92
- package/dist-server/service/entity/entity-type.js.map +1 -1
- package/dist-server/service/entity/entity.js +60 -68
- package/dist-server/service/entity/entity.js.map +1 -1
- package/dist-server/service/entity/index.js.map +1 -1
- package/dist-server/service/entity-column/entity-column-mutation.js +21 -32
- package/dist-server/service/entity-column/entity-column-mutation.js.map +1 -1
- package/dist-server/service/entity-column/entity-column-query.js +34 -45
- package/dist-server/service/entity-column/entity-column-query.js.map +1 -1
- package/dist-server/service/entity-column/entity-column-type.js +144 -152
- package/dist-server/service/entity-column/entity-column-type.js.map +1 -1
- package/dist-server/service/entity-column/entity-column.js +90 -98
- package/dist-server/service/entity-column/entity-column.js.map +1 -1
- package/dist-server/service/entity-column/index.js.map +1 -1
- package/dist-server/service/entity-metadata/entity-metadata-query.js +8 -19
- package/dist-server/service/entity-metadata/entity-metadata-query.js.map +1 -1
- package/dist-server/service/entity-metadata/entity-metadata.js +50 -58
- package/dist-server/service/entity-metadata/entity-metadata.js.map +1 -1
- package/dist-server/service/entity-metadata/index.js.map +1 -1
- package/dist-server/service/index.js +4 -17
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -3
package/dist-server/index.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./service"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./migrations"), exports);
|
|
19
6
|
//# sourceMappingURL=index.js.map
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB;AACzB,uDAA4B","sourcesContent":["export * from './service'\nexport * from './migrations'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA","sourcesContent":["const glob = require('glob')\nconst path = require('path')\n\nexport var migrations = []\n\nglob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function(file) {\n if (file.indexOf('index.js') !== -1) return\n migrations = migrations.concat(Object.values(require(path.resolve(file))) || [])\n})\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.EntityMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
6
|
const entity_1 = require("./entity");
|
|
18
7
|
const entity_type_1 = require("./entity-type");
|
|
@@ -46,35 +35,35 @@ let EntityMutation = class EntityMutation {
|
|
|
46
35
|
return true;
|
|
47
36
|
}
|
|
48
37
|
};
|
|
49
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
50
39
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
51
40
|
(0, type_graphql_1.Mutation)(returns => entity_1.Entity, { description: 'To create new Entity' }),
|
|
52
|
-
__param(0, (0, type_graphql_1.Arg)('entity')),
|
|
53
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
54
|
-
__metadata("design:type", Function),
|
|
55
|
-
__metadata("design:paramtypes", [entity_type_1.NewEntity, Object]),
|
|
56
|
-
__metadata("design:returntype", Promise)
|
|
41
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('entity')),
|
|
42
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
43
|
+
tslib_1.__metadata("design:type", Function),
|
|
44
|
+
tslib_1.__metadata("design:paramtypes", [entity_type_1.NewEntity, Object]),
|
|
45
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
57
46
|
], EntityMutation.prototype, "createEntity", null);
|
|
58
|
-
__decorate([
|
|
47
|
+
tslib_1.__decorate([
|
|
59
48
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
60
49
|
(0, type_graphql_1.Mutation)(returns => entity_1.Entity, { description: "To modify Entity' information" }),
|
|
61
|
-
__param(0, (0, type_graphql_1.Arg)('name', type => String)),
|
|
62
|
-
__param(1, (0, type_graphql_1.Arg)('patch', type => entity_type_1.EntityPatch)),
|
|
63
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
64
|
-
__metadata("design:type", Function),
|
|
65
|
-
__metadata("design:paramtypes", [String, entity_type_1.EntityPatch, Object]),
|
|
66
|
-
__metadata("design:returntype", Promise)
|
|
50
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name', type => String)),
|
|
51
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch', type => entity_type_1.EntityPatch)),
|
|
52
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
53
|
+
tslib_1.__metadata("design:type", Function),
|
|
54
|
+
tslib_1.__metadata("design:paramtypes", [String, entity_type_1.EntityPatch, Object]),
|
|
55
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
67
56
|
], EntityMutation.prototype, "updateEntity", null);
|
|
68
|
-
__decorate([
|
|
57
|
+
tslib_1.__decorate([
|
|
69
58
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
70
59
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Entity' }),
|
|
71
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
72
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
73
|
-
__metadata("design:type", Function),
|
|
74
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
75
|
-
__metadata("design:returntype", Promise)
|
|
60
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
61
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
62
|
+
tslib_1.__metadata("design:type", Function),
|
|
63
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
64
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
76
65
|
], EntityMutation.prototype, "deleteEntity", null);
|
|
77
|
-
EntityMutation = __decorate([
|
|
66
|
+
EntityMutation = tslib_1.__decorate([
|
|
78
67
|
(0, type_graphql_1.Resolver)(entity_1.Entity)
|
|
79
68
|
], EntityMutation);
|
|
80
69
|
exports.EntityMutation = EntityMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-mutation.js","sourceRoot":"","sources":["../../../server/service/entity/entity-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity-mutation.js","sourceRoot":"","sources":["../../../server/service/entity/entity-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,qCAAiC;AACjC,+CAAsD;AAGtD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAGzB,KAAK,CAAC,YAAY,CAAgB,MAAiB,EAAS,OAAY;QACtE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,eAAM,CAAC,CAAA;QAE3C,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,MAAM,CAAC,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;SAC3E;QAED,OAAO,MAAM,UAAU,CAAC,IAAI,iCACvB,MAAM,KACT,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,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AAC;CACF,CAAA;AAxDC;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,eAAM,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACjD,mBAAA,IAAA,kBAAG,EAAC,QAAQ,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,uBAAS;;kDAelD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,eAAM,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IAC3B,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,yBAAW,CAAC,CAAA;IACjC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADoC,yBAAW;;kDAwBtD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;kDAMnD;AA1DU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,eAAM,CAAC;GACJ,cAAc,CA2D1B;AA3DY,wCAAc","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\n\nimport { Entity } from './entity'\nimport { EntityPatch, NewEntity } from './entity-type'\n\n@Resolver(Entity)\nexport class EntityMutation {\n @Directive('@transaction')\n @Mutation(returns => Entity, { description: 'To create new Entity' })\n async createEntity(@Arg('entity') entity: NewEntity, @Ctx() context: any): Promise<Entity> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Entity)\n\n if (entity.master) {\n entity.master = await repository.findOne({ where: { id: entity.master } })\n }\n\n return await repository.save({\n ...entity,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Entity, { description: \"To modify Entity' information\" })\n async updateEntity(\n @Arg('name', type => String) name: string,\n @Arg('patch', type => EntityPatch) patch: EntityPatch,\n @Ctx() context: any\n ): Promise<Entity> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Entity)\n const entity = repository.findOne({\n where: { domain: context.state.domain, name },\n relations: ['master', 'children']\n })\n\n if (patch.master) {\n patch.master = await repository.findOne({ where: { domain: context.state.domain, id: patch.master } })\n }\n\n if (patch.children && patch.children.length) {\n patch.children = await repository.findByIds(patch.children)\n }\n\n return await repository.save({\n ...entity,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Entity' })\n async deleteEntity(@Arg('name') name: string, @Ctx() context: any): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Entity).delete({ domain, name })\n\n return true\n }\n}\n"]}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
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
2
|
var _a;
|
|
15
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
4
|
exports.EntityQuery = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
17
6
|
const type_graphql_1 = require("type-graphql");
|
|
18
7
|
const typeorm_1 = require("typeorm");
|
|
19
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
@@ -69,65 +58,65 @@ let EntityQuery = class EntityQuery {
|
|
|
69
58
|
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(entity.creatorId);
|
|
70
59
|
}
|
|
71
60
|
};
|
|
72
|
-
__decorate([
|
|
61
|
+
tslib_1.__decorate([
|
|
73
62
|
(0, type_graphql_1.Query)(returns => entity_1.Entity, { description: 'To fetch a Entity' }),
|
|
74
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
75
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
76
|
-
__metadata("design:type", Function),
|
|
77
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
78
|
-
__metadata("design:returntype", Promise)
|
|
63
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
64
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
65
|
+
tslib_1.__metadata("design:type", Function),
|
|
66
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
67
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
79
68
|
], EntityQuery.prototype, "entity", null);
|
|
80
|
-
__decorate([
|
|
69
|
+
tslib_1.__decorate([
|
|
81
70
|
(0, type_graphql_1.Query)(returns => entity_type_1.EntityList, { description: 'To fetch multiple Entities' }),
|
|
82
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
83
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
84
|
-
__metadata("design:type", Function),
|
|
85
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
86
|
-
__metadata("design:returntype", Promise)
|
|
71
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
72
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
73
|
+
tslib_1.__metadata("design:type", Function),
|
|
74
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
75
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
87
76
|
], EntityQuery.prototype, "entities", null);
|
|
88
|
-
__decorate([
|
|
77
|
+
tslib_1.__decorate([
|
|
89
78
|
(0, type_graphql_1.FieldResolver)(type => entity_1.Entity),
|
|
90
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
91
|
-
__metadata("design:type", Function),
|
|
92
|
-
__metadata("design:paramtypes", [entity_1.Entity]),
|
|
93
|
-
__metadata("design:returntype", Promise)
|
|
79
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
80
|
+
tslib_1.__metadata("design:type", Function),
|
|
81
|
+
tslib_1.__metadata("design:paramtypes", [entity_1.Entity]),
|
|
82
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
94
83
|
], EntityQuery.prototype, "master", null);
|
|
95
|
-
__decorate([
|
|
84
|
+
tslib_1.__decorate([
|
|
96
85
|
(0, type_graphql_1.FieldResolver)(type => [entity_1.Entity]),
|
|
97
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
98
|
-
__metadata("design:type", Function),
|
|
99
|
-
__metadata("design:paramtypes", [entity_1.Entity]),
|
|
100
|
-
__metadata("design:returntype", Promise)
|
|
86
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
87
|
+
tslib_1.__metadata("design:type", Function),
|
|
88
|
+
tslib_1.__metadata("design:paramtypes", [entity_1.Entity]),
|
|
89
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
101
90
|
], EntityQuery.prototype, "children", null);
|
|
102
|
-
__decorate([
|
|
91
|
+
tslib_1.__decorate([
|
|
103
92
|
(0, type_graphql_1.FieldResolver)(type => [entity_column_1.EntityColumn]),
|
|
104
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
105
|
-
__metadata("design:type", Function),
|
|
106
|
-
__metadata("design:paramtypes", [entity_1.Entity]),
|
|
107
|
-
__metadata("design:returntype", Promise)
|
|
93
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
94
|
+
tslib_1.__metadata("design:type", Function),
|
|
95
|
+
tslib_1.__metadata("design:paramtypes", [entity_1.Entity]),
|
|
96
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
108
97
|
], EntityQuery.prototype, "columns", null);
|
|
109
|
-
__decorate([
|
|
98
|
+
tslib_1.__decorate([
|
|
110
99
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
111
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
112
|
-
__metadata("design:type", Function),
|
|
113
|
-
__metadata("design:paramtypes", [entity_1.Entity]),
|
|
114
|
-
__metadata("design:returntype", Promise)
|
|
100
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
101
|
+
tslib_1.__metadata("design:type", Function),
|
|
102
|
+
tslib_1.__metadata("design:paramtypes", [entity_1.Entity]),
|
|
103
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
115
104
|
], EntityQuery.prototype, "domain", null);
|
|
116
|
-
__decorate([
|
|
105
|
+
tslib_1.__decorate([
|
|
117
106
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
118
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
119
|
-
__metadata("design:type", Function),
|
|
120
|
-
__metadata("design:paramtypes", [entity_1.Entity]),
|
|
121
|
-
__metadata("design:returntype", Promise)
|
|
107
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
108
|
+
tslib_1.__metadata("design:type", Function),
|
|
109
|
+
tslib_1.__metadata("design:paramtypes", [entity_1.Entity]),
|
|
110
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
122
111
|
], EntityQuery.prototype, "updater", null);
|
|
123
|
-
__decorate([
|
|
112
|
+
tslib_1.__decorate([
|
|
124
113
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
125
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
126
|
-
__metadata("design:type", Function),
|
|
127
|
-
__metadata("design:paramtypes", [entity_1.Entity]),
|
|
128
|
-
__metadata("design:returntype", Promise)
|
|
114
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
115
|
+
tslib_1.__metadata("design:type", Function),
|
|
116
|
+
tslib_1.__metadata("design:paramtypes", [entity_1.Entity]),
|
|
117
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
129
118
|
], EntityQuery.prototype, "creator", null);
|
|
130
|
-
EntityQuery = __decorate([
|
|
119
|
+
EntityQuery = tslib_1.__decorate([
|
|
131
120
|
(0, type_graphql_1.Resolver)(entity_1.Entity)
|
|
132
121
|
], EntityQuery);
|
|
133
122
|
exports.EntityQuery = EntityQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-query.js","sourceRoot":"","sources":["../../../server/service/entity/entity-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity-query.js","sourceRoot":"","sources":["../../../server/service/entity/entity-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAAwF;AAExF,kEAA6D;AAC7D,qCAAiC;AACjC,+CAA0C;AAG1C,IAAa,WAAW,GAAxB,MAAa,WAAW;IAEtB,KAAK,CAAC,MAAM,CAAc,IAAY,EAAS,OAAY;QACzD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA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I,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,eAAM;;yCAElC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,eAAM;;0CAEnC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,eAAM;;0CAEnC;AAjEU,WAAW;IADvB,IAAA,uBAAQ,EAAC,eAAM,CAAC;GACJ,WAAW,CAkEvB;AAlEY,kCAAW","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, ListParam } from '@things-factory/shell'\n\nimport { EntityColumn } from '../entity-column/entity-column'\nimport { Entity } from './entity'\nimport { EntityList } from './entity-type'\n\n@Resolver(Entity)\nexport class EntityQuery {\n @Query(returns => Entity, { description: 'To fetch a Entity' })\n async entity(@Arg('name') name: string, @Ctx() context: any): Promise<Entity> {\n const { domain } = context.state\n\n return await getRepository(Entity).findOne({\n where: { domain, name }\n })\n }\n\n @Query(returns => EntityList, { description: 'To fetch multiple Entities' })\n async entities(@Args() params: ListParam, @Ctx() context: any): Promise<EntityList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(Entity),\n params,\n domain,\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Entity)\n async master(@Root() entity: Entity): Promise<Entity> {\n return await getRepository(Entity).findOne(entity.masterId)\n }\n\n @FieldResolver(type => [Entity])\n async children(@Root() entity: Entity): Promise<Entity[]> {\n return await getRepository(Entity).find({\n where: {\n master: entity\n }\n })\n }\n\n @FieldResolver(type => [EntityColumn])\n async columns(@Root() entity: Entity): Promise<EntityColumn[]> {\n return await getRepository(EntityColumn).find({\n where: {\n entity\n },\n order: {\n rank: 'ASC'\n }\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() entity: Entity): Promise<Domain> {\n return await getRepository(Domain).findOne(entity.domainId)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() entity: Entity): Promise<User> {\n return await getRepository(User).findOne(entity.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() entity: Entity): Promise<User> {\n return await getRepository(User).findOne(entity.creatorId)\n }\n}\n"]}
|
|
@@ -1,192 +1,184 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.EntityList = exports.EntityPatch = exports.NewEntity = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
13
5
|
const type_graphql_1 = require("type-graphql");
|
|
14
6
|
const entity_1 = require("./entity");
|
|
15
7
|
let NewEntity = class NewEntity {
|
|
16
8
|
};
|
|
17
|
-
__decorate([
|
|
9
|
+
tslib_1.__decorate([
|
|
18
10
|
(0, type_graphql_1.Field)(),
|
|
19
|
-
__metadata("design:type", String)
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
20
12
|
], NewEntity.prototype, "name", void 0);
|
|
21
|
-
__decorate([
|
|
13
|
+
tslib_1.__decorate([
|
|
22
14
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
|
-
__metadata("design:type", String)
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
24
16
|
], NewEntity.prototype, "description", void 0);
|
|
25
|
-
__decorate([
|
|
17
|
+
tslib_1.__decorate([
|
|
26
18
|
(0, type_graphql_1.Field)(),
|
|
27
|
-
__metadata("design:type", String)
|
|
19
|
+
tslib_1.__metadata("design:type", String)
|
|
28
20
|
], NewEntity.prototype, "bundle", void 0);
|
|
29
|
-
__decorate([
|
|
21
|
+
tslib_1.__decorate([
|
|
30
22
|
(0, type_graphql_1.Field)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
32
24
|
], NewEntity.prototype, "tableName", void 0);
|
|
33
|
-
__decorate([
|
|
25
|
+
tslib_1.__decorate([
|
|
34
26
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
35
|
-
__metadata("design:type", String)
|
|
27
|
+
tslib_1.__metadata("design:type", String)
|
|
36
28
|
], NewEntity.prototype, "searchUrl", void 0);
|
|
37
|
-
__decorate([
|
|
29
|
+
tslib_1.__decorate([
|
|
38
30
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
39
|
-
__metadata("design:type", String)
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
40
32
|
], NewEntity.prototype, "multiSaveUrl", void 0);
|
|
41
|
-
__decorate([
|
|
33
|
+
tslib_1.__decorate([
|
|
42
34
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
43
|
-
__metadata("design:type", String)
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
44
36
|
], NewEntity.prototype, "idType", void 0);
|
|
45
|
-
__decorate([
|
|
37
|
+
tslib_1.__decorate([
|
|
46
38
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
-
__metadata("design:type", String)
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
48
40
|
], NewEntity.prototype, "idField", void 0);
|
|
49
|
-
__decorate([
|
|
41
|
+
tslib_1.__decorate([
|
|
50
42
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
-
__metadata("design:type", String)
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
52
44
|
], NewEntity.prototype, "titleField", void 0);
|
|
53
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
54
46
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
-
__metadata("design:type", String)
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
56
48
|
], NewEntity.prototype, "master", void 0);
|
|
57
|
-
__decorate([
|
|
49
|
+
tslib_1.__decorate([
|
|
58
50
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
59
|
-
__metadata("design:type", String)
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
60
52
|
], NewEntity.prototype, "association", void 0);
|
|
61
|
-
__decorate([
|
|
53
|
+
tslib_1.__decorate([
|
|
62
54
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
63
|
-
__metadata("design:type", String)
|
|
55
|
+
tslib_1.__metadata("design:type", String)
|
|
64
56
|
], NewEntity.prototype, "dataProp", void 0);
|
|
65
|
-
__decorate([
|
|
57
|
+
tslib_1.__decorate([
|
|
66
58
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
-
__metadata("design:type", String)
|
|
59
|
+
tslib_1.__metadata("design:type", String)
|
|
68
60
|
], NewEntity.prototype, "refField", void 0);
|
|
69
|
-
__decorate([
|
|
61
|
+
tslib_1.__decorate([
|
|
70
62
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
71
|
-
__metadata("design:type", String)
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
72
64
|
], NewEntity.prototype, "delStrategy", void 0);
|
|
73
|
-
__decorate([
|
|
65
|
+
tslib_1.__decorate([
|
|
74
66
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
75
|
-
__metadata("design:type", Number)
|
|
67
|
+
tslib_1.__metadata("design:type", Number)
|
|
76
68
|
], NewEntity.prototype, "fixedColumns", void 0);
|
|
77
|
-
__decorate([
|
|
69
|
+
tslib_1.__decorate([
|
|
78
70
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
79
|
-
__metadata("design:type", Boolean)
|
|
71
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
80
72
|
], NewEntity.prototype, "active", void 0);
|
|
81
|
-
__decorate([
|
|
73
|
+
tslib_1.__decorate([
|
|
82
74
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
83
|
-
__metadata("design:type", Boolean)
|
|
75
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
84
76
|
], NewEntity.prototype, "extEntity", void 0);
|
|
85
|
-
__decorate([
|
|
77
|
+
tslib_1.__decorate([
|
|
86
78
|
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
87
|
-
__metadata("design:type", Array)
|
|
79
|
+
tslib_1.__metadata("design:type", Array)
|
|
88
80
|
], NewEntity.prototype, "columns", void 0);
|
|
89
|
-
NewEntity = __decorate([
|
|
81
|
+
NewEntity = tslib_1.__decorate([
|
|
90
82
|
(0, type_graphql_1.InputType)()
|
|
91
83
|
], NewEntity);
|
|
92
84
|
exports.NewEntity = NewEntity;
|
|
93
85
|
let EntityPatch = class EntityPatch {
|
|
94
86
|
};
|
|
95
|
-
__decorate([
|
|
87
|
+
tslib_1.__decorate([
|
|
96
88
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
97
|
-
__metadata("design:type", String)
|
|
89
|
+
tslib_1.__metadata("design:type", String)
|
|
98
90
|
], EntityPatch.prototype, "id", void 0);
|
|
99
|
-
__decorate([
|
|
91
|
+
tslib_1.__decorate([
|
|
100
92
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
101
|
-
__metadata("design:type", String)
|
|
93
|
+
tslib_1.__metadata("design:type", String)
|
|
102
94
|
], EntityPatch.prototype, "name", void 0);
|
|
103
|
-
__decorate([
|
|
95
|
+
tslib_1.__decorate([
|
|
104
96
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
105
|
-
__metadata("design:type", String)
|
|
97
|
+
tslib_1.__metadata("design:type", String)
|
|
106
98
|
], EntityPatch.prototype, "description", void 0);
|
|
107
|
-
__decorate([
|
|
99
|
+
tslib_1.__decorate([
|
|
108
100
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
109
|
-
__metadata("design:type", String)
|
|
101
|
+
tslib_1.__metadata("design:type", String)
|
|
110
102
|
], EntityPatch.prototype, "bundle", void 0);
|
|
111
|
-
__decorate([
|
|
103
|
+
tslib_1.__decorate([
|
|
112
104
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
113
|
-
__metadata("design:type", String)
|
|
105
|
+
tslib_1.__metadata("design:type", String)
|
|
114
106
|
], EntityPatch.prototype, "tableName", void 0);
|
|
115
|
-
__decorate([
|
|
107
|
+
tslib_1.__decorate([
|
|
116
108
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
117
|
-
__metadata("design:type", String)
|
|
109
|
+
tslib_1.__metadata("design:type", String)
|
|
118
110
|
], EntityPatch.prototype, "searchUrl", void 0);
|
|
119
|
-
__decorate([
|
|
111
|
+
tslib_1.__decorate([
|
|
120
112
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
121
|
-
__metadata("design:type", String)
|
|
113
|
+
tslib_1.__metadata("design:type", String)
|
|
122
114
|
], EntityPatch.prototype, "multiSaveUrl", void 0);
|
|
123
|
-
__decorate([
|
|
115
|
+
tslib_1.__decorate([
|
|
124
116
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
125
|
-
__metadata("design:type", String)
|
|
117
|
+
tslib_1.__metadata("design:type", String)
|
|
126
118
|
], EntityPatch.prototype, "idType", void 0);
|
|
127
|
-
__decorate([
|
|
119
|
+
tslib_1.__decorate([
|
|
128
120
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
129
|
-
__metadata("design:type", String)
|
|
121
|
+
tslib_1.__metadata("design:type", String)
|
|
130
122
|
], EntityPatch.prototype, "idField", void 0);
|
|
131
|
-
__decorate([
|
|
123
|
+
tslib_1.__decorate([
|
|
132
124
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
133
|
-
__metadata("design:type", String)
|
|
125
|
+
tslib_1.__metadata("design:type", String)
|
|
134
126
|
], EntityPatch.prototype, "titleField", void 0);
|
|
135
|
-
__decorate([
|
|
127
|
+
tslib_1.__decorate([
|
|
136
128
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
137
|
-
__metadata("design:type", String)
|
|
129
|
+
tslib_1.__metadata("design:type", String)
|
|
138
130
|
], EntityPatch.prototype, "master", void 0);
|
|
139
|
-
__decorate([
|
|
131
|
+
tslib_1.__decorate([
|
|
140
132
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
141
|
-
__metadata("design:type", String)
|
|
133
|
+
tslib_1.__metadata("design:type", String)
|
|
142
134
|
], EntityPatch.prototype, "association", void 0);
|
|
143
|
-
__decorate([
|
|
135
|
+
tslib_1.__decorate([
|
|
144
136
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
145
|
-
__metadata("design:type", String)
|
|
137
|
+
tslib_1.__metadata("design:type", String)
|
|
146
138
|
], EntityPatch.prototype, "dataProp", void 0);
|
|
147
|
-
__decorate([
|
|
139
|
+
tslib_1.__decorate([
|
|
148
140
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
149
|
-
__metadata("design:type", String)
|
|
141
|
+
tslib_1.__metadata("design:type", String)
|
|
150
142
|
], EntityPatch.prototype, "refField", void 0);
|
|
151
|
-
__decorate([
|
|
143
|
+
tslib_1.__decorate([
|
|
152
144
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
153
|
-
__metadata("design:type", String)
|
|
145
|
+
tslib_1.__metadata("design:type", String)
|
|
154
146
|
], EntityPatch.prototype, "delStrategy", void 0);
|
|
155
|
-
__decorate([
|
|
147
|
+
tslib_1.__decorate([
|
|
156
148
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
157
|
-
__metadata("design:type", Number)
|
|
149
|
+
tslib_1.__metadata("design:type", Number)
|
|
158
150
|
], EntityPatch.prototype, "fixedColumns", void 0);
|
|
159
|
-
__decorate([
|
|
151
|
+
tslib_1.__decorate([
|
|
160
152
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
161
|
-
__metadata("design:type", Boolean)
|
|
153
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
162
154
|
], EntityPatch.prototype, "active", void 0);
|
|
163
|
-
__decorate([
|
|
155
|
+
tslib_1.__decorate([
|
|
164
156
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
165
|
-
__metadata("design:type", Boolean)
|
|
157
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
166
158
|
], EntityPatch.prototype, "extEntity", void 0);
|
|
167
|
-
__decorate([
|
|
159
|
+
tslib_1.__decorate([
|
|
168
160
|
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
169
|
-
__metadata("design:type", Array)
|
|
161
|
+
tslib_1.__metadata("design:type", Array)
|
|
170
162
|
], EntityPatch.prototype, "columns", void 0);
|
|
171
|
-
__decorate([
|
|
163
|
+
tslib_1.__decorate([
|
|
172
164
|
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
173
|
-
__metadata("design:type", Array)
|
|
165
|
+
tslib_1.__metadata("design:type", Array)
|
|
174
166
|
], EntityPatch.prototype, "children", void 0);
|
|
175
|
-
EntityPatch = __decorate([
|
|
167
|
+
EntityPatch = tslib_1.__decorate([
|
|
176
168
|
(0, type_graphql_1.InputType)()
|
|
177
169
|
], EntityPatch);
|
|
178
170
|
exports.EntityPatch = EntityPatch;
|
|
179
171
|
let EntityList = class EntityList {
|
|
180
172
|
};
|
|
181
|
-
__decorate([
|
|
173
|
+
tslib_1.__decorate([
|
|
182
174
|
(0, type_graphql_1.Field)(type => [entity_1.Entity]),
|
|
183
|
-
__metadata("design:type", Array)
|
|
175
|
+
tslib_1.__metadata("design:type", Array)
|
|
184
176
|
], EntityList.prototype, "items", void 0);
|
|
185
|
-
__decorate([
|
|
177
|
+
tslib_1.__decorate([
|
|
186
178
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
187
|
-
__metadata("design:type", Number)
|
|
179
|
+
tslib_1.__metadata("design:type", Number)
|
|
188
180
|
], EntityList.prototype, "total", void 0);
|
|
189
|
-
EntityList = __decorate([
|
|
181
|
+
EntityList = tslib_1.__decorate([
|
|
190
182
|
(0, type_graphql_1.ObjectType)()
|
|
191
183
|
], EntityList);
|
|
192
184
|
exports.EntityList = EntityList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-type.js","sourceRoot":"","sources":["../../../server/service/entity/entity-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity-type.js","sourceRoot":"","sources":["../../../server/service/entity/entity-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,qCAAiC;AAGjC,IAAa,SAAS,GAAtB,MAAa,SAAS;CAsDrB,CAAA;AApDC;IADC,IAAA,oBAAK,GAAE;;uCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACN;AAGpB;IADC,IAAA,oBAAK,GAAE;;yCACM;AAGd;IADC,IAAA,oBAAK,GAAE;;4CACS;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACL;AAGrB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACX;AAGf;IADC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;;8CACP;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC1B;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC1B;AA3DP,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CA4DvB;AA5DY,kCAAW;AA+DxB,IAAa,UAAU,GAAvB,MAAa,UAAU;CAMtB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,eAAM,CAAC,CAAC;;yCACT;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;yCACN;AALF,UAAU;IADtB,IAAA,yBAAU,GAAE;GACA,UAAU,CAMtB;AANY,gCAAU","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { Entity } from './entity'\n\n@InputType()\nexport class NewEntity {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field()\n bundle: string\n\n @Field()\n tableName: string\n\n @Field({ nullable: true })\n searchUrl?: string\n\n @Field({ nullable: true })\n multiSaveUrl?: string\n\n @Field({ nullable: true })\n idType?: string\n\n @Field({ nullable: true })\n idField?: string\n\n @Field({ nullable: true })\n titleField?: string\n\n @Field({ nullable: true })\n master?: string\n\n @Field({ nullable: true })\n association?: string\n\n @Field({ nullable: true })\n dataProp?: string\n\n @Field({ nullable: true })\n refField?: string\n\n @Field({ nullable: true })\n delStrategy?: string\n\n @Field(type => Int, { nullable: true })\n fixedColumns?: number\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n extEntity?: boolean\n\n @Field(type => [String], { nullable: true })\n columns?: string[]\n}\n\n@InputType()\nexport class EntityPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n bundle?: string\n\n @Field({ nullable: true })\n tableName?: string\n\n @Field({ nullable: true })\n searchUrl?: string\n\n @Field({ nullable: true })\n multiSaveUrl?: string\n\n @Field({ nullable: true })\n idType?: string\n\n @Field({ nullable: true })\n idField?: string\n\n @Field({ nullable: true })\n titleField?: string\n\n @Field({ nullable: true })\n master?: string\n\n @Field({ nullable: true })\n association?: string\n\n @Field({ nullable: true })\n dataProp?: string\n\n @Field({ nullable: true })\n refField?: string\n\n @Field({ nullable: true })\n delStrategy?: string\n\n @Field(type => Int, { nullable: true })\n fixedColumns?: number\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n extEntity?: boolean\n\n @Field(type => [String], { nullable: true })\n columns?: string[]\n\n @Field(type => [String], { nullable: true })\n children: string[]\n}\n\n@ObjectType()\nexport class EntityList {\n @Field(type => [Entity])\n items: Entity[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|