@things-factory/resource-base 6.0.0-alpha.13 → 6.0.0-alpha.20
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/constants/del-strategy-type.js +10 -0
- package/dist-server/constants/del-strategy-type.js.map +1 -0
- package/dist-server/service/entity/entity-mutation.js +105 -6
- package/dist-server/service/entity/entity-mutation.js.map +1 -1
- package/dist-server/service/entity/entity-query.js +3 -3
- package/dist-server/service/entity/entity-query.js.map +1 -1
- package/dist-server/service/entity/entity-type.js +4 -0
- package/dist-server/service/entity/entity-type.js.map +1 -1
- package/dist-server/service/entity-column/entity-column-mutation.js +59 -6
- package/dist-server/service/entity-column/entity-column-mutation.js.map +1 -1
- package/dist-server/service/entity-column/entity-column-query.js +3 -3
- package/dist-server/service/entity-column/entity-column-query.js.map +1 -1
- package/dist-server/service/entity-column/entity-column-type.js +8 -0
- package/dist-server/service/entity-column/entity-column-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/server/constants/del-strategy-type.ts +6 -0
- package/server/service/entity/entity-mutation.ts +117 -4
- package/server/service/entity/entity-query.ts +2 -2
- package/server/service/entity/entity-type.ts +3 -0
- package/server/service/entity-column/entity-column-mutation.ts +69 -4
- package/server/service/entity-column/entity-column-query.ts +2 -2
- package/server/service/entity-column/entity-column-type.ts +7 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEL_STRATEGY = void 0;
|
|
4
|
+
exports.DEL_STRATEGY = {
|
|
5
|
+
DELETE: 'delete',
|
|
6
|
+
DESTROY: 'destroy',
|
|
7
|
+
NULLIFY: 'nullify',
|
|
8
|
+
RESTRICT_WITH_ERROR: 'restrict with error'
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=del-strategy-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"del-strategy-type.js","sourceRoot":"","sources":["../../server/constants/del-strategy-type.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,mBAAmB,EAAE,qBAAqB;CAC3C,CAAA","sourcesContent":["export const DEL_STRATEGY = {\n DELETE: 'delete',\n DESTROY: 'destroy',\n NULLIFY: 'nullify',\n RESTRICT_WITH_ERROR: 'restrict with error'\n}\n"]}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EntityMutation = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const del_strategy_type_1 = require("../../constants/del-strategy-type");
|
|
5
6
|
const type_graphql_1 = require("type-graphql");
|
|
6
7
|
const typeorm_1 = require("typeorm");
|
|
8
|
+
const entity_column_1 = require("../entity-column/entity-column");
|
|
7
9
|
const entity_1 = require("./entity");
|
|
8
10
|
const entity_type_1 = require("./entity-type");
|
|
9
11
|
let EntityMutation = class EntityMutation {
|
|
@@ -15,11 +17,11 @@ let EntityMutation = class EntityMutation {
|
|
|
15
17
|
}
|
|
16
18
|
return await repository.save(Object.assign(Object.assign({}, entity), { domain, creator: user, updater: user }));
|
|
17
19
|
}
|
|
18
|
-
async updateEntity(
|
|
20
|
+
async updateEntity(id, patch, context) {
|
|
19
21
|
const { domain, user, tx } = context.state;
|
|
20
22
|
const repository = tx.getRepository(entity_1.Entity);
|
|
21
23
|
const entity = repository.findOne({
|
|
22
|
-
where: { domain: { id: domain.id },
|
|
24
|
+
where: { domain: { id: domain.id }, id },
|
|
23
25
|
relations: ['master', 'children']
|
|
24
26
|
});
|
|
25
27
|
if (patch.master) {
|
|
@@ -30,9 +32,55 @@ let EntityMutation = class EntityMutation {
|
|
|
30
32
|
}
|
|
31
33
|
return await repository.save(Object.assign(Object.assign(Object.assign({}, entity), patch), { updater: user }));
|
|
32
34
|
}
|
|
33
|
-
async
|
|
35
|
+
async updateMultipleEntity(patches, context) {
|
|
36
|
+
const { domain, user, tx } = context.state;
|
|
37
|
+
let results = [];
|
|
38
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
39
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
40
|
+
const entityRepo = tx.getRepository(entity_1.Entity);
|
|
41
|
+
if (_createRecords.length > 0) {
|
|
42
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
43
|
+
const newRecord = _createRecords[i];
|
|
44
|
+
if (newRecord.master) {
|
|
45
|
+
newRecord.master = (await tx
|
|
46
|
+
.getRepository(entity_1.Entity)
|
|
47
|
+
.findOne({ where: { domain: { id: domain.id }, id: newRecord.master } }));
|
|
48
|
+
}
|
|
49
|
+
if (newRecord.children && newRecord.children.length) {
|
|
50
|
+
newRecord.children = (await tx.getRepository(entity_1.Entity).findBy({ id: (0, typeorm_1.In)(newRecord.children) }));
|
|
51
|
+
}
|
|
52
|
+
const result = await entityRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
53
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (_updateRecords.length > 0) {
|
|
57
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
58
|
+
const updateRecord = _updateRecords[i];
|
|
59
|
+
const entity = await entityRepo.findOneBy({ id: updateRecord.id });
|
|
60
|
+
if (updateRecord.master) {
|
|
61
|
+
updateRecord.master = (await tx
|
|
62
|
+
.getRepository(entity_1.Entity)
|
|
63
|
+
.findOne({ where: { domain: { id: domain.id }, id: updateRecord.master } }));
|
|
64
|
+
}
|
|
65
|
+
if (updateRecord.children && updateRecord.children.length) {
|
|
66
|
+
updateRecord.children = (await tx.getRepository(entity_1.Entity).findBy({ id: (0, typeorm_1.In)(updateRecord.children) }));
|
|
67
|
+
}
|
|
68
|
+
const result = await entityRepo.save(Object.assign(Object.assign(Object.assign({}, entity), updateRecord), { updater: user }));
|
|
69
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return results;
|
|
73
|
+
}
|
|
74
|
+
async deleteEntity(id, context) {
|
|
34
75
|
const { domain, tx } = context.state;
|
|
35
|
-
await
|
|
76
|
+
await deleteEntity(id, domain, tx);
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
async deleteEntities(ids, context) {
|
|
80
|
+
const { domain, tx } = context.state;
|
|
81
|
+
for (let i = 0; i < ids.length; i++) {
|
|
82
|
+
await deleteEntity(ids[i], domain, tx);
|
|
83
|
+
}
|
|
36
84
|
return true;
|
|
37
85
|
}
|
|
38
86
|
};
|
|
@@ -48,24 +96,75 @@ tslib_1.__decorate([
|
|
|
48
96
|
tslib_1.__decorate([
|
|
49
97
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
50
98
|
(0, type_graphql_1.Mutation)(returns => entity_1.Entity, { description: "To modify Entity' information" }),
|
|
51
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
99
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id', type => String)),
|
|
52
100
|
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch', type => entity_type_1.EntityPatch)),
|
|
53
101
|
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
54
102
|
tslib_1.__metadata("design:type", Function),
|
|
55
103
|
tslib_1.__metadata("design:paramtypes", [String, entity_type_1.EntityPatch, Object]),
|
|
56
104
|
tslib_1.__metadata("design:returntype", Promise)
|
|
57
105
|
], EntityMutation.prototype, "updateEntity", null);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
108
|
+
(0, type_graphql_1.Mutation)(returns => [entity_1.Entity], { description: "To modify multiple Entitys' information" }),
|
|
109
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [entity_type_1.EntityPatch])),
|
|
110
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
111
|
+
tslib_1.__metadata("design:type", Function),
|
|
112
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
113
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
114
|
+
], EntityMutation.prototype, "updateMultipleEntity", null);
|
|
58
115
|
tslib_1.__decorate([
|
|
59
116
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
60
117
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Entity' }),
|
|
61
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
118
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
62
119
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
63
120
|
tslib_1.__metadata("design:type", Function),
|
|
64
121
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
65
122
|
tslib_1.__metadata("design:returntype", Promise)
|
|
66
123
|
], EntityMutation.prototype, "deleteEntity", null);
|
|
124
|
+
tslib_1.__decorate([
|
|
125
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
126
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Entities' }),
|
|
127
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
128
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
129
|
+
tslib_1.__metadata("design:type", Function),
|
|
130
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
131
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
132
|
+
], EntityMutation.prototype, "deleteEntities", null);
|
|
67
133
|
EntityMutation = tslib_1.__decorate([
|
|
68
134
|
(0, type_graphql_1.Resolver)(entity_1.Entity)
|
|
69
135
|
], EntityMutation);
|
|
70
136
|
exports.EntityMutation = EntityMutation;
|
|
137
|
+
async function deleteEntityAndEntityColumns(id, domain, tx) {
|
|
138
|
+
const entity = tx.getRepository(entity_1.Entity).findOne({ domain: { id: domain.id }, id });
|
|
139
|
+
const columns = tx
|
|
140
|
+
.getRepository(entity_column_1.EntityColumn)
|
|
141
|
+
.find({ where: { entity: { id: entity.id }, domain: { id: domain.id } }, relations: ['entity'] });
|
|
142
|
+
if (columns && columns.length)
|
|
143
|
+
await tx.getRepository(entity_column_1.EntityColumn).delete(columns);
|
|
144
|
+
await tx.getRepository(entity_1.Entity).delete(entity);
|
|
145
|
+
}
|
|
146
|
+
async function deleteEntity(id, domain, tx) {
|
|
147
|
+
const entity = await tx.getRepository(entity_1.Entity).findOne({
|
|
148
|
+
where: {
|
|
149
|
+
domain: { id: domain.id },
|
|
150
|
+
id
|
|
151
|
+
},
|
|
152
|
+
relations: ['children']
|
|
153
|
+
});
|
|
154
|
+
if ((entity.children && entity.children.length) || entity.delStrategy === del_strategy_type_1.DEL_STRATEGY.NULLIFY) {
|
|
155
|
+
if (entity.delStrategy === del_strategy_type_1.DEL_STRATEGY.DELETE || entity.delStrategy === del_strategy_type_1.DEL_STRATEGY.DESTROY) {
|
|
156
|
+
const children = entity.children;
|
|
157
|
+
for (let i = 0; i < children.length; i++) {
|
|
158
|
+
await deleteEntityAndEntityColumns(children[i].id, domain, tx);
|
|
159
|
+
}
|
|
160
|
+
await deleteEntityAndEntityColumns(entity.id, domain, tx);
|
|
161
|
+
}
|
|
162
|
+
else if (entity.delStrategy === del_strategy_type_1.DEL_STRATEGY.RESTRICT_WITH_ERROR) {
|
|
163
|
+
throw new Error('entity cannot delete');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
await deleteEntityAndEntityColumns(entity.id, domain, tx);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
71
170
|
//# sourceMappingURL=entity-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-mutation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I,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;AAIK;IAFL,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'\nimport { In } from 'typeorm'\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: ResolverContext): 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 } })) as any\n }\n\n return await repository.save({\n ...(entity as any),\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: ResolverContext\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: { id: domain.id }, name },\n relations: ['master', 'children']\n })\n\n if (patch.master) {\n patch.master = (await repository.findOne({ where: { domain: { id: domain.id }, id: patch.master } })) as any\n }\n\n if (patch.children && patch.children.length) {\n patch.children = (await repository.findBy({ id: In(patch.children) })) as any\n }\n\n return await repository.save({\n ...entity,\n ...(patch as any),\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Entity' })\n async deleteEntity(@Arg('name') name: string, @Ctx() context: ResolverContext): 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
|
+
{"version":3,"file":"entity-mutation.js","sourceRoot":"","sources":["../../../server/service/entity/entity-mutation.ts"],"names":[],"mappings":";;;;AAAA,yEAAgE;AAChE,+CAAsE;AACtE,qCAA4B;AAC5B,kEAA6D;AAE7D,qCAAiC;AACjC,+CAAsD;AAG/C,IAAM,cAAc,GAApB,MAAM,cAAc;IAGnB,AAAN,KAAK,CAAC,YAAY,CAAgB,MAAiB,EAAS,OAAwB;QAClF,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,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAQ,CAAA;SACpF;QAED,OAAO,MAAM,UAAU,CAAC,IAAI,iCACtB,MAAc,KAClB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,YAAY,CACW,EAAU,EACF,KAAkB,EAC9C,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,M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KACF;SAAM;QACL,MAAM,4BAA4B,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;KAC1D;AACH,CAAC","sourcesContent":["import { DEL_STRATEGY } from '../../constants/del-strategy-type'\nimport { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { EntityColumn } from '../entity-column/entity-column'\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: ResolverContext): 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 } })) as any\n }\n\n return await repository.save({\n ...(entity as any),\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('id', type => String) id: string,\n @Arg('patch', type => EntityPatch) patch: EntityPatch,\n @Ctx() context: ResolverContext\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: { id: domain.id }, id },\n relations: ['master', 'children']\n })\n\n if (patch.master) {\n patch.master = (await repository.findOne({ where: { domain: { id: domain.id }, id: patch.master } })) as any\n }\n\n if (patch.children && patch.children.length) {\n patch.children = (await repository.findBy({ id: In(patch.children) })) as any\n }\n\n return await repository.save({\n ...entity,\n ...(patch as any),\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [Entity], { description: \"To modify multiple Entitys' information\" })\n async updateMultipleEntity(\n @Arg('patches', type => [EntityPatch]) patches: EntityPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Entity[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const entityRepo = tx.getRepository(Entity)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n if (newRecord.master) {\n newRecord.master = (await tx\n .getRepository(Entity)\n .findOne({ where: { domain: { id: domain.id }, id: newRecord.master } })) as any\n }\n\n if (newRecord.children && newRecord.children.length) {\n newRecord.children = (await tx.getRepository(Entity).findBy({ id: In(newRecord.children) })) as any\n }\n\n const result = await entityRepo.save({\n ...(newRecord as any),\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const entity = await entityRepo.findOneBy({ id: updateRecord.id })\n\n if (updateRecord.master) {\n updateRecord.master = (await tx\n .getRepository(Entity)\n .findOne({ where: { domain: { id: domain.id }, id: updateRecord.master } })) as any\n }\n\n if (updateRecord.children && updateRecord.children.length) {\n updateRecord.children = (await tx.getRepository(Entity).findBy({ id: In(updateRecord.children) })) as any\n }\n\n const result = await entityRepo.save({\n ...entity,\n ...(updateRecord as any),\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Entity' })\n async deleteEntity(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n await deleteEntity(id, domain, tx)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Entities' })\n async deleteEntities(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n for (let i = 0; i < ids.length; i++) {\n await deleteEntity(ids[i], domain, tx)\n }\n\n return true\n }\n}\n\nasync function deleteEntityAndEntityColumns(id, domain, tx) {\n const entity: Entity = tx.getRepository(Entity).findOne({ domain: { id: domain.id }, id })\n const columns: EntityColumn[] = tx\n .getRepository(EntityColumn)\n .find({ where: { entity: { id: entity.id }, domain: { id: domain.id } }, relations: ['entity'] })\n\n if (columns && columns.length) await tx.getRepository(EntityColumn).delete(columns)\n await tx.getRepository(Entity).delete(entity)\n}\n\nasync function deleteEntity(id, domain, tx) {\n const entity: Entity = await tx.getRepository(Entity).findOne({\n where: {\n domain: { id: domain.id },\n id\n },\n relations: ['children']\n })\n\n if ((entity.children && entity.children.length) || entity.delStrategy === DEL_STRATEGY.NULLIFY) {\n if (entity.delStrategy === DEL_STRATEGY.DELETE || entity.delStrategy === DEL_STRATEGY.DESTROY) {\n const children = entity.children\n for (let i = 0; i < children.length; i++) {\n await deleteEntityAndEntityColumns(children[i].id, domain, tx)\n }\n await deleteEntityAndEntityColumns(entity.id, domain, tx)\n } else if (entity.delStrategy === DEL_STRATEGY.RESTRICT_WITH_ERROR) {\n throw new Error('entity cannot delete')\n }\n } else {\n await deleteEntityAndEntityColumns(entity.id, domain, tx)\n }\n}\n"]}
|
|
@@ -9,10 +9,10 @@ const entity_column_1 = require("../entity-column/entity-column");
|
|
|
9
9
|
const entity_1 = require("./entity");
|
|
10
10
|
const entity_type_1 = require("./entity-type");
|
|
11
11
|
let EntityQuery = class EntityQuery {
|
|
12
|
-
async entity(
|
|
12
|
+
async entity(id, context) {
|
|
13
13
|
const { domain } = context.state;
|
|
14
14
|
return await (0, shell_1.getRepository)(entity_1.Entity).findOne({
|
|
15
|
-
where: { domain: { id: domain.id },
|
|
15
|
+
where: { domain: { id: domain.id }, id }
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
async entities(params, context) {
|
|
@@ -58,7 +58,7 @@ let EntityQuery = class EntityQuery {
|
|
|
58
58
|
};
|
|
59
59
|
tslib_1.__decorate([
|
|
60
60
|
(0, type_graphql_1.Query)(returns => entity_1.Entity, { description: 'To fetch a Entity' }),
|
|
61
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
61
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
62
62
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
63
63
|
tslib_1.__metadata("design:type", Function),
|
|
64
64
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-query.js","sourceRoot":"","sources":["../../../server/service/entity/entity-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,kEAA6D;AAC7D,qCAAiC;AACjC,+CAA0C;AAGnC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAEhB,AAAN,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"entity-query.js","sourceRoot":"","sources":["../../../server/service/entity/entity-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,kEAA6D;AAC7D,qCAAiC;AACjC,+CAA0C;AAGnC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAEhB,AAAN,KAAK,CAAC,MAAM,CAAY,EAAU,EAAS,OAAwB;QACjE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,eAAM,CAAC,CAAC,OAAO,CAAC;YACzC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAS,MAAiB,EAAS,OAAwB;QACvE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,UAAU,EAAE,IAAA,qBAAa,EAAC,eAAM,CAAC;YACjC,MAAM;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mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,eAAM;;0CAEnC;AAGK;IADL,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'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, 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('id') id: string, @Ctx() context: ResolverContext): Promise<Entity> {\n const { domain } = context.state\n\n return await getRepository(Entity).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => EntityList, { description: 'To fetch multiple Entities' })\n async entities(@Args() params: ListParam, @Ctx() context: ResolverContext): 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).findOneBy({ id: 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: { id: entity.id }\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: { id: entity.id }\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).findOneBy({ id: entity.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() entity: Entity): Promise<User> {\n return await getRepository(User).findOneBy({ id: entity.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() entity: Entity): Promise<User> {\n return await getRepository(User).findOneBy({ id: entity.creatorId })\n }\n}\n"]}
|
|
@@ -164,6 +164,10 @@ tslib_1.__decorate([
|
|
|
164
164
|
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
165
165
|
tslib_1.__metadata("design:type", Array)
|
|
166
166
|
], EntityPatch.prototype, "children", void 0);
|
|
167
|
+
tslib_1.__decorate([
|
|
168
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
169
|
+
tslib_1.__metadata("design:type", String)
|
|
170
|
+
], EntityPatch.prototype, "cuFlag", void 0);
|
|
167
171
|
EntityPatch = tslib_1.__decorate([
|
|
168
172
|
(0, type_graphql_1.InputType)()
|
|
169
173
|
], EntityPatch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-type.js","sourceRoot":"","sources":["../../../server/service/entity/entity-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,qCAAiC;AAG1B,IAAM,SAAS,GAAf,MAAM,SAAS;CAsDrB,CAAA;AArDC;IAAC,IAAA,oBAAK,GAAE;;uCACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACN;AAEpB;IAAC,IAAA,oBAAK,GAAE;;yCACM;AAEd;IAAC,IAAA,oBAAK,GAAE;;4CACS;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACL;AAErB;IAAC,IAAA,oBAAK,EAAC,EAA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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 @Field({ nullable: true })\n cuFlag?: 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"]}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EntityColumnMutation = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
6
7
|
const entity_1 = require("../entity/entity");
|
|
7
8
|
const entity_column_1 = require("./entity-column");
|
|
8
9
|
const entity_column_type_1 = require("./entity-column-type");
|
|
@@ -14,20 +15,54 @@ let EntityColumnMutation = class EntityColumnMutation {
|
|
|
14
15
|
}
|
|
15
16
|
return await tx.getRepository(entity_column_1.EntityColumn).save(Object.assign(Object.assign({}, entityColumn), { domain, creator: user, updater: user }));
|
|
16
17
|
}
|
|
17
|
-
async updateEntityColumn(
|
|
18
|
+
async updateEntityColumn(id, patch, context) {
|
|
18
19
|
const { domain, user, tx } = context.state;
|
|
19
20
|
const repository = tx.getRepository(entity_column_1.EntityColumn);
|
|
20
21
|
const entityColumn = await repository.findOne({
|
|
21
|
-
where: { domain: { id: domain.id },
|
|
22
|
+
where: { domain: { id: domain.id }, id }
|
|
22
23
|
});
|
|
23
24
|
if (patch.entity) {
|
|
24
25
|
patch.entity = (await tx.getRepository(entity_1.Entity).findOneBy({ id: patch.entity }));
|
|
25
26
|
}
|
|
26
27
|
return await repository.save(Object.assign(Object.assign(Object.assign({}, entityColumn), patch), { updater: user }));
|
|
27
28
|
}
|
|
28
|
-
async
|
|
29
|
+
async updateMultipleEntityColumn(patches, context) {
|
|
30
|
+
const { domain, user, tx } = context.state;
|
|
31
|
+
let results = [];
|
|
32
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
33
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
34
|
+
const entityColumnRepo = tx.getRepository(entity_column_1.EntityColumn);
|
|
35
|
+
if (_createRecords.length > 0) {
|
|
36
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
37
|
+
const newRecord = _createRecords[i];
|
|
38
|
+
if (newRecord.entity) {
|
|
39
|
+
newRecord.entity = (await tx.getRepository(entity_1.Entity).findOneBy({ id: newRecord.entity }));
|
|
40
|
+
}
|
|
41
|
+
const result = await entityColumnRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
42
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (_updateRecords.length > 0) {
|
|
46
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
47
|
+
const updateRecord = _updateRecords[i];
|
|
48
|
+
const entity = await entityColumnRepo.findOneBy({ id: updateRecord.id });
|
|
49
|
+
if (updateRecord.entity) {
|
|
50
|
+
updateRecord.entity = (await tx.getRepository(entity_1.Entity).findOneBy({ id: updateRecord.entity }));
|
|
51
|
+
}
|
|
52
|
+
const result = await entityColumnRepo.save(Object.assign(Object.assign(Object.assign({}, entity), updateRecord), { updater: user }));
|
|
53
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return results;
|
|
57
|
+
}
|
|
58
|
+
async deleteEntityColumn(id, context) {
|
|
29
59
|
const { domain, tx } = context.state;
|
|
30
|
-
await tx.getRepository(entity_column_1.EntityColumn).delete({ domain,
|
|
60
|
+
await tx.getRepository(entity_column_1.EntityColumn).delete({ domain: { id: domain.id }, id });
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
async deleteEntities(ids, context) {
|
|
64
|
+
const { domain, tx } = context.state;
|
|
65
|
+
await tx.getRepository(entity_column_1.EntityColumn).delete({ domain: { id: domain.id }, id: (0, typeorm_1.In)(ids) });
|
|
31
66
|
return true;
|
|
32
67
|
}
|
|
33
68
|
};
|
|
@@ -43,22 +78,40 @@ tslib_1.__decorate([
|
|
|
43
78
|
tslib_1.__decorate([
|
|
44
79
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
45
80
|
(0, type_graphql_1.Mutation)(returns => entity_column_1.EntityColumn, { description: 'To modify EntityColumn information' }),
|
|
46
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
47
82
|
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
48
83
|
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
49
84
|
tslib_1.__metadata("design:type", Function),
|
|
50
85
|
tslib_1.__metadata("design:paramtypes", [String, entity_column_type_1.EntityColumnPatch, Object]),
|
|
51
86
|
tslib_1.__metadata("design:returntype", Promise)
|
|
52
87
|
], EntityColumnMutation.prototype, "updateEntityColumn", null);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
90
|
+
(0, type_graphql_1.Mutation)(returns => [entity_column_1.EntityColumn], { description: "To modify multiple Entitys' information" }),
|
|
91
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [entity_column_type_1.EntityColumnPatch])),
|
|
92
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
93
|
+
tslib_1.__metadata("design:type", Function),
|
|
94
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
95
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
96
|
+
], EntityColumnMutation.prototype, "updateMultipleEntityColumn", null);
|
|
53
97
|
tslib_1.__decorate([
|
|
54
98
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
55
99
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete EntityColumn' }),
|
|
56
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
100
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
57
101
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
58
102
|
tslib_1.__metadata("design:type", Function),
|
|
59
103
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
60
104
|
tslib_1.__metadata("design:returntype", Promise)
|
|
61
105
|
], EntityColumnMutation.prototype, "deleteEntityColumn", null);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
108
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple EntityColumns' }),
|
|
109
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
110
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
111
|
+
tslib_1.__metadata("design:type", Function),
|
|
112
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
113
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
114
|
+
], EntityColumnMutation.prototype, "deleteEntities", null);
|
|
62
115
|
EntityColumnMutation = tslib_1.__decorate([
|
|
63
116
|
(0, type_graphql_1.Resolver)(entity_column_1.EntityColumn)
|
|
64
117
|
], EntityColumnMutation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-column-mutation.js","sourceRoot":"","sources":["../../../server/service/entity-column/entity-column-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;
|
|
1
|
+
{"version":3,"file":"entity-column-mutation.js","sourceRoot":"","sources":["../../../server/service/entity-column/entity-column-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,6CAAyC;AACzC,mDAA8C;AAC9C,6DAAyE;AAGlE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAGzB,AAAN,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,YAAY,CAAC,MAAM,EAAE;YACvB,YAAY,CAAC,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,aAA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AAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DAMvE;AArHU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAsHhC;AAtHY,oDAAoB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Entity } from '../entity/entity'\nimport { EntityColumn } from './entity-column'\nimport { EntityColumnPatch, NewEntityColumn } from './entity-column-type'\n\n@Resolver(EntityColumn)\nexport class EntityColumnMutation {\n @Directive('@transaction')\n @Mutation(returns => EntityColumn, { description: 'To create new EntityColumn' })\n async createEntityColumn(\n @Arg('entityColumn') entityColumn: NewEntityColumn,\n @Ctx() context: ResolverContext\n ): Promise<EntityColumn> {\n const { domain, user, tx } = context.state\n\n if (entityColumn.entity) {\n entityColumn.entity = (await tx.getRepository(Entity).findOne({ where: { id: entityColumn.entity } })) as any\n }\n\n return await tx.getRepository(EntityColumn).save({\n ...(entityColumn as any),\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => EntityColumn, { description: 'To modify EntityColumn information' })\n async updateEntityColumn(\n @Arg('id') id: string,\n @Arg('patch') patch: EntityColumnPatch,\n @Ctx() context: ResolverContext\n ): Promise<EntityColumn> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(EntityColumn)\n const entityColumn = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n if (patch.entity) {\n patch.entity = (await tx.getRepository(Entity).findOneBy({ id: patch.entity })) as any\n }\n\n return await repository.save({\n ...entityColumn,\n ...(patch as any),\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [EntityColumn], { description: \"To modify multiple Entitys' information\" })\n async updateMultipleEntityColumn(\n @Arg('patches', type => [EntityColumnPatch]) patches: EntityColumnPatch[],\n @Ctx() context: ResolverContext\n ): Promise<EntityColumn[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const entityColumnRepo = tx.getRepository(EntityColumn)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n if (newRecord.entity) {\n newRecord.entity = (await tx.getRepository(Entity).findOneBy({ id: newRecord.entity })) as any\n }\n\n const result = await entityColumnRepo.save({\n ...(newRecord as any),\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const entity = await entityColumnRepo.findOneBy({ id: updateRecord.id })\n\n if (updateRecord.entity) {\n updateRecord.entity = (await tx.getRepository(Entity).findOneBy({ id: updateRecord.entity })) as any\n }\n\n const result = await entityColumnRepo.save({\n ...entity,\n ...(updateRecord as any),\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete EntityColumn' })\n async deleteEntityColumn(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(EntityColumn).delete({ domain: { id: domain.id }, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple EntityColumns' })\n async deleteEntities(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(EntityColumn).delete({ domain: { id: domain.id }, id: In(ids) })\n\n return true\n }\n}\n"]}
|
|
@@ -9,10 +9,10 @@ const entity_1 = require("../entity/entity");
|
|
|
9
9
|
const entity_column_1 = require("./entity-column");
|
|
10
10
|
const entity_column_type_1 = require("./entity-column-type");
|
|
11
11
|
let EntityColumnQuery = class EntityColumnQuery {
|
|
12
|
-
async entityColumn(
|
|
12
|
+
async entityColumn(id, context) {
|
|
13
13
|
const { domain } = context.state;
|
|
14
14
|
return await (0, shell_1.getRepository)(entity_column_1.EntityColumn).findOne({
|
|
15
|
-
where: { domain: { id: domain.id },
|
|
15
|
+
where: { domain: { id: domain.id }, id }
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
async entityColumns(params, context) {
|
|
@@ -41,7 +41,7 @@ let EntityColumnQuery = class EntityColumnQuery {
|
|
|
41
41
|
};
|
|
42
42
|
tslib_1.__decorate([
|
|
43
43
|
(0, type_graphql_1.Query)(returns => entity_column_1.EntityColumn, { description: 'To fetch a EntityColumn' }),
|
|
44
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
44
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
45
45
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
46
46
|
tslib_1.__metadata("design:type", Function),
|
|
47
47
|
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-column-query.js","sourceRoot":"","sources":["../../../server/service/entity-column/entity-column-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,6CAAyC;AACzC,mDAA8C;AAC9C,6DAAuD;AAGhD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"entity-column-query.js","sourceRoot":"","sources":["../../../server/service/entity-column/entity-column-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,6CAAyC;AACzC,mDAA8C;AAC9C,6DAAuD;AAGhD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAwB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8CAAiB","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { Entity } from '../entity/entity'\nimport { EntityColumn } from './entity-column'\nimport { EntityColumnList } from './entity-column-type'\n\n@Resolver(EntityColumn)\nexport class EntityColumnQuery {\n @Query(returns => EntityColumn, { description: 'To fetch a EntityColumn' })\n async entityColumn(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<EntityColumn> {\n const { domain } = context.state\n\n return await getRepository(EntityColumn).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => EntityColumnList, { description: 'To fetch multiple EntityColumns' })\n async entityColumns(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<EntityColumnList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n repository: getRepository(EntityColumn),\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 entity(@Root() entityColumn: EntityColumn): Promise<Entity> {\n return await getRepository(Entity).findOneBy({ id: entityColumn.entityId })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() entityColumn: EntityColumn): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: entityColumn.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() entityColumn: EntityColumn): Promise<User> {\n return await getRepository(User).findOneBy({ id: entityColumn.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() entityColumn: EntityColumn): Promise<User> {\n return await getRepository(User).findOneBy({ id: entityColumn.creatorId })\n }\n}\n"]}
|
|
@@ -148,6 +148,10 @@ NewEntityColumn = tslib_1.__decorate([
|
|
|
148
148
|
exports.NewEntityColumn = NewEntityColumn;
|
|
149
149
|
let EntityColumnPatch = class EntityColumnPatch {
|
|
150
150
|
};
|
|
151
|
+
tslib_1.__decorate([
|
|
152
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
153
|
+
tslib_1.__metadata("design:type", String)
|
|
154
|
+
], EntityColumnPatch.prototype, "id", void 0);
|
|
151
155
|
tslib_1.__decorate([
|
|
152
156
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
153
157
|
tslib_1.__metadata("design:type", String)
|
|
@@ -284,6 +288,10 @@ tslib_1.__decorate([
|
|
|
284
288
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
285
289
|
tslib_1.__metadata("design:type", Boolean)
|
|
286
290
|
], EntityColumnPatch.prototype, "ignoreOnSav", void 0);
|
|
291
|
+
tslib_1.__decorate([
|
|
292
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
293
|
+
tslib_1.__metadata("design:type", String)
|
|
294
|
+
], EntityColumnPatch.prototype, "cuFlag", void 0);
|
|
287
295
|
EntityColumnPatch = tslib_1.__decorate([
|
|
288
296
|
(0, type_graphql_1.InputType)()
|
|
289
297
|
], EntityColumnPatch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-column-type.js","sourceRoot":"","sources":["../../../server/service/entity-column/entity-column-type.ts"],"names":[],"mappings":";;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"entity-column-type.js","sourceRoot":"","sources":["../../../server/service/entity-column/entity-column-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,mDAA8C;AAGvC,IAAM,eAAe,GAArB,MAAM,eAAe;CAsG3B,CAAA;AArGC;IAAC,IAAA,oBAAK,GAAE;;6CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAEpB;IAAC,IAAA,oBAAK,GAAE;;+CACM;AAEd;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE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ACR;AAElB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACtB;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACP;AAEnB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACJ;AAEtB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACP;AAEnB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACL;AAErB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;AA3GJ,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CA4G7B;AA5GY,8CAAiB;AA+GvB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAErB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;AALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B;AANY,4CAAgB","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { EntityColumn } from './entity-column'\n\n@InputType()\nexport class NewEntityColumn {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field()\n entity: string\n\n @Field({ nullable: true })\n rank?: number\n\n @Field({ nullable: true })\n term?: string\n\n @Field()\n colType: string\n\n @Field({ nullable: true })\n colSize?: number\n\n @Field({ nullable: true })\n nullable?: boolean\n\n @Field({ nullable: true })\n refType?: string\n\n @Field({ nullable: true })\n refName?: string\n\n @Field({ nullable: true })\n refUrl?: string\n\n @Field({ nullable: true })\n refParams?: string\n\n @Field({ nullable: true })\n refRelated?: string\n\n @Field(type => Int, { nullable: true })\n searchRank?: number\n\n @Field(type => Int, { nullable: true })\n sortRank?: number\n\n @Field({ nullable: true })\n reverseSort?: boolean\n\n @Field({ nullable: true })\n virtualField?: boolean\n\n @Field({ nullable: true })\n searchName?: string\n\n @Field({ nullable: true })\n searchEditor?: string\n\n @Field({ nullable: true })\n searchOper?: string\n\n @Field({ nullable: true })\n searchInitVal?: string\n\n @Field(type => Int, { nullable: true })\n gridRank?: number\n\n @Field({ nullable: true })\n gridEditor?: string\n\n @Field({ nullable: true })\n gridFormat?: string\n\n @Field({ nullable: true })\n gridValidator?: string\n\n @Field(type => Int, { nullable: true })\n gridWidth?: number\n\n @Field({ nullable: true })\n gridAlign?: string\n\n @Field(type => Int, { nullable: true })\n uniqRank?: number\n\n @Field({ nullable: true })\n formEditor?: string\n\n @Field({ nullable: true })\n formValidator?: string\n\n @Field({ nullable: true })\n formFormat?: string\n\n @Field({ nullable: true })\n defVal?: string\n\n @Field({ nullable: true })\n rangeVal?: string\n\n @Field({ nullable: true })\n ignoreOnSav?: boolean\n}\n\n@InputType()\nexport class EntityColumnPatch {\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 entity?: string\n\n @Field(type => Int, { nullable: true })\n rank?: number\n\n @Field({ nullable: true })\n term?: string\n\n @Field({ nullable: true })\n colType?: string\n\n @Field(type => Int, { nullable: true })\n colSize?: number\n\n @Field({ nullable: true })\n nullable?: boolean\n\n @Field({ nullable: true })\n refType?: string\n\n @Field({ nullable: true })\n refName?: string\n\n @Field({ nullable: true })\n refUrl?: string\n\n @Field({ nullable: true })\n refParams?: string\n\n @Field({ nullable: true })\n refRelated?: string\n\n @Field(type => Int, { nullable: true })\n searchRank?: number\n\n @Field({ nullable: true })\n sortRank?: number\n\n @Field({ nullable: true })\n reverseSort?: boolean\n\n @Field({ nullable: true })\n virtualField?: boolean\n\n @Field({ nullable: true })\n searchName?: string\n\n @Field({ nullable: true })\n searchEditor?: string\n\n @Field({ nullable: true })\n searchOper?: string\n\n @Field({ nullable: true })\n searchInitVal?: string\n\n @Field(type => Int, { nullable: true })\n gridRank?: number\n\n @Field({ nullable: true })\n gridEditor?: string\n\n @Field({ nullable: true })\n gridFormat?: string\n\n @Field({ nullable: true })\n gridValidator?: string\n\n @Field(type => Int, { nullable: true })\n gridWidth?: number\n\n @Field({ nullable: true })\n gridAlign?: string\n\n @Field(type => Int, { nullable: true })\n uniqRank?: number\n\n @Field({ nullable: true })\n formEditor?: string\n\n @Field({ nullable: true })\n formValidator?: string\n\n @Field({ nullable: true })\n formFormat?: string\n\n @Field({ nullable: true })\n defVal?: string\n\n @Field({ nullable: true })\n rangeVal?: string\n\n @Field({ nullable: true })\n ignoreOnSav?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class EntityColumnList {\n @Field(type => [EntityColumn])\n items: EntityColumn[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|