@things-factory/shell 9.0.0-beta.0 → 9.0.0-beta.5
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/bin/things-factory-migration +6 -3
- package/dist-server/index.d.ts +12 -12
- package/dist-server/index.js +12 -12
- package/dist-server/index.js.map +1 -1
- package/dist-server/initializers/database.js +4 -10
- package/dist-server/initializers/database.js.map +1 -1
- package/dist-server/initializers/ormconfig.d.ts +2 -0
- package/dist-server/initializers/ormconfig.js +30 -0
- package/dist-server/initializers/ormconfig.js.map +1 -0
- package/dist-server/middlewares/domain-middleware.js +2 -2
- package/dist-server/middlewares/domain-middleware.js.map +1 -1
- package/dist-server/middlewares/index.d.ts +1 -1
- package/dist-server/middlewares/index.js +3 -3
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/1000000000000-SeedDomain.js +4 -4
- package/dist-server/migrations/1000000000000-SeedDomain.js.map +1 -1
- package/dist-server/migrations/index.js +5 -4
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/routers/domain-router.js +3 -3
- package/dist-server/routers/domain-router.js.map +1 -1
- package/dist-server/routers/global-router.js +6 -6
- package/dist-server/routers/global-router.js.map +1 -1
- package/dist-server/routers/index.d.ts +3 -3
- package/dist-server/routers/index.js +3 -3
- package/dist-server/routers/index.js.map +1 -1
- package/dist-server/schema.js +5 -4
- package/dist-server/schema.js.map +1 -1
- package/dist-server/server-dev.js +37 -37
- package/dist-server/server-dev.js.map +1 -1
- package/dist-server/server.js +33 -33
- package/dist-server/server.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-item-type.js +3 -3
- package/dist-server/service/attribute-set/attribute-set-item-type.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-mutation.d.ts +2 -2
- package/dist-server/service/attribute-set/attribute-set-mutation.js +16 -16
- package/dist-server/service/attribute-set/attribute-set-mutation.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-query.d.ts +3 -3
- package/dist-server/service/attribute-set/attribute-set-query.js +15 -15
- package/dist-server/service/attribute-set/attribute-set-query.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-type.d.ts +2 -2
- package/dist-server/service/attribute-set/attribute-set-type.js +5 -5
- package/dist-server/service/attribute-set/attribute-set-type.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set.d.ts +1 -1
- package/dist-server/service/attribute-set/attribute-set.js +2 -2
- package/dist-server/service/attribute-set/attribute-set.js.map +1 -1
- package/dist-server/service/attribute-set/index.d.ts +3 -3
- package/dist-server/service/attribute-set/index.js +5 -5
- package/dist-server/service/attribute-set/index.js.map +1 -1
- package/dist-server/service/common-types/index.d.ts +6 -6
- package/dist-server/service/common-types/index.js +6 -6
- package/dist-server/service/common-types/index.js.map +1 -1
- package/dist-server/service/common-types/list-param.js +2 -2
- package/dist-server/service/common-types/list-param.js.map +1 -1
- package/dist-server/service/common-types/log.js +2 -2
- package/dist-server/service/common-types/log.js.map +1 -1
- package/dist-server/service/common-types/scalar-object.d.ts +2 -1
- package/dist-server/service/common-types/scalar-object.js +2 -2
- package/dist-server/service/common-types/scalar-object.js.map +1 -1
- package/dist-server/service/directive-transaction/index.d.ts +1 -1
- package/dist-server/service/directive-transaction/index.js +1 -1
- package/dist-server/service/directive-transaction/index.js.map +1 -1
- package/dist-server/service/directive-transaction/transaction.js +2 -2
- package/dist-server/service/directive-transaction/transaction.js.map +1 -1
- package/dist-server/service/domain/domain-mutation.d.ts +2 -2
- package/dist-server/service/domain/domain-mutation.js +21 -21
- package/dist-server/service/domain/domain-mutation.js.map +1 -1
- package/dist-server/service/domain/domain-query.d.ts +3 -3
- package/dist-server/service/domain/domain-query.js +18 -18
- package/dist-server/service/domain/domain-query.js.map +1 -1
- package/dist-server/service/domain/domain-types.d.ts +2 -2
- package/dist-server/service/domain/domain-types.js +6 -6
- package/dist-server/service/domain/domain-types.js.map +1 -1
- package/dist-server/service/domain/domain.js +3 -3
- package/dist-server/service/domain/domain.js.map +1 -1
- package/dist-server/service/domain/index.d.ts +3 -3
- package/dist-server/service/domain/index.js +5 -5
- package/dist-server/service/domain/index.js.map +1 -1
- package/dist-server/service/index.d.ts +7 -7
- package/dist-server/service/index.js +16 -16
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/subscription-data/data-resolver.d.ts +1 -1
- package/dist-server/service/subscription-data/data-resolver.js +4 -4
- package/dist-server/service/subscription-data/data-resolver.js.map +1 -1
- package/dist-server/service/subscription-data/data-types.d.ts +1 -1
- package/dist-server/service/subscription-data/data-types.js +5 -5
- package/dist-server/service/subscription-data/data-types.js.map +1 -1
- package/dist-server/service/subscription-data/index.d.ts +1 -1
- package/dist-server/service/subscription-data/index.js +2 -2
- package/dist-server/service/subscription-data/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/typeorm/encrypt-transform.js +3 -3
- package/dist-server/typeorm/encrypt-transform.js.map +1 -1
- package/dist-server/utils/get-query-builder-from-list-params.d.ts +2 -2
- package/dist-server/utils/get-query-builder-from-list-params.js +5 -5
- package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
- package/dist-server/utils/index.d.ts +8 -8
- package/dist-server/utils/index.js +8 -8
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/list-param-adjuster.d.ts +1 -1
- package/dist-server/utils/list-param-adjuster.js.map +1 -1
- package/dist-server/utils/list-params-converter.d.ts +2 -2
- package/dist-server/utils/list-params-converter.js +2 -2
- package/dist-server/utils/list-params-converter.js.map +1 -1
- package/dist-server/utils/list-query-builder.d.ts +1 -1
- package/dist-server/utils/list-query-builder.js +7 -7
- package/dist-server/utils/list-query-builder.js.map +1 -1
- package/dist-server/utils/publish-progress.js +2 -2
- package/dist-server/utils/publish-progress.js.map +1 -1
- package/package.json +5 -7
- package/client/hot-client/hot.js +0 -140
- package/client/hot-client/index.js +0 -103
- package/client/hot-client/log.js +0 -44
- package/client/hot-client/socket.js +0 -63
- package/ormconfig.js +0 -31
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"attribute-set-mutation.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,
|
1
|
+
{"version":3,"file":"attribute-set-mutation.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yDAAiD;AACjD,mEAA4E;AAGrE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAIzB,AAAN,KAAK,CAAC,kBAAkB,CAAmB,SAA0B,EAAS,OAAY;QACxF,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE5B,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,+BAAY,CAAC,CAAC,IAAI,mBAC3C,SAAS,EACZ,CAAA;IACJ,CAAC;IAKK,AAAN,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAY;QAEnB,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE5B,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,+BAAY,CAAC,CAAA;QACjD,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACzC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,iCACvB,SAAS,GACT,KAAK,EACR,CAAA;IACJ,CAAC;IAKK,AAAN,KAAK,CAAC,0BAA0B,CACe,OAA4B,EAClE,OAAY;QAEnB,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE5B,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE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E,CAAA;;;;+DAQ5E;AAKK;IAHL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAE/E,mBAAA,IAAA,kBAAG,EAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,yCAAiB,CAAC,CAAC,CAAA;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAWP;+BApHU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,+BAAY,CAAC;GACV,oBAAoB,CAqHhC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { AttributeSet } from './attribute-set.js'\nimport { NewAttributeSet, AttributeSetPatch } from './attribute-set-type.js'\n\n@Resolver(AttributeSet)\nexport class AttributeSetMutation {\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => AttributeSet, { description: 'To create new AttributeSet' })\n async createAttributeSet(@Arg('attribute') attribute: NewAttributeSet, @Ctx() context: any): Promise<AttributeSet> {\n const { tx } = context.state\n\n return await tx.getRepository(AttributeSet).save({\n ...attribute\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => AttributeSet, { description: 'To modify AttributeSet information' })\n async updateAttributeSet(\n @Arg('id') id: string,\n @Arg('patch') patch: AttributeSetPatch,\n @Ctx() context: any\n ): Promise<AttributeSet> {\n const { tx } = context.state\n\n const repository = tx.getRepository(AttributeSet)\n const attribute = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...attribute,\n ...patch\n })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => [AttributeSet], { description: \"To modify multiple AttributeSets' information\" })\n async updateMultipleAttributeSet(\n @Arg('patches', type => [AttributeSetPatch]) patches: AttributeSetPatch[],\n @Ctx() context: any\n ): Promise<AttributeSet[]> {\n const { 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 attributeRepo = tx.getRepository(AttributeSet)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await attributeRepo.save({\n ...newRecord\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 attribute = await attributeRepo.findOneBy({ id: updateRecord.id })\n\n const result = await attributeRepo.save({\n ...attribute,\n ...updateRecord\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete AttributeSet' })\n async deleteAttributeSet(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(AttributeSet).delete({ id })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple AttributeSets' })\n async deleteAttributeSets(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(AttributeSet).delete({\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple AttributeSets' })\n async importAttributeSets(\n @Arg('attributes', type => [AttributeSetPatch]) attributes: AttributeSetPatch[],\n @Ctx() context: any\n ): Promise<boolean> {\n const { tx } = context.state\n\n await Promise.all(\n attributes.map(async (attribute: AttributeSetPatch) => {\n await tx.getRepository(AttributeSet).save(attribute)\n })\n )\n\n return true\n }\n}\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { AttributeSet } from './attribute-set';
|
2
|
-
import { AttributeSetList } from './attribute-set-type';
|
3
|
-
import { ListParam } from '../common-types';
|
1
|
+
import { AttributeSet } from './attribute-set.js';
|
2
|
+
import { AttributeSetList } from './attribute-set-type.js';
|
3
|
+
import { ListParam } from '../common-types/list-param.js';
|
4
4
|
export declare class AttributeSetQuery {
|
5
5
|
attributeSet(id: string, context: any): Promise<AttributeSet>;
|
6
6
|
attributeSetByEntity(entity: string, context: any): Promise<AttributeSet>;
|
@@ -3,26 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AttributeSetQuery = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
|
-
const
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const
|
6
|
+
const attribute_set_js_1 = require("./attribute-set.js");
|
7
|
+
const attribute_set_type_js_1 = require("./attribute-set-type.js");
|
8
|
+
const list_param_js_1 = require("../common-types/list-param.js");
|
9
|
+
const database_js_1 = require("../../initializers/database.js");
|
10
|
+
const get_query_builder_from_list_params_js_1 = require("../../utils/get-query-builder-from-list-params.js");
|
11
11
|
let AttributeSetQuery = class AttributeSetQuery {
|
12
12
|
async attributeSet(id, context) {
|
13
|
-
return await (0,
|
13
|
+
return await (0, database_js_1.getRepository)(attribute_set_js_1.AttributeSet).findOne({
|
14
14
|
where: { id }
|
15
15
|
});
|
16
16
|
}
|
17
17
|
async attributeSetByEntity(entity, context) {
|
18
|
-
return await (0,
|
18
|
+
return await (0, database_js_1.getRepository)(attribute_set_js_1.AttributeSet).findOne({
|
19
19
|
where: { entity }
|
20
20
|
});
|
21
21
|
}
|
22
22
|
async attributeSets(params, context) {
|
23
|
-
const queryBuilder = (0,
|
23
|
+
const queryBuilder = (0, get_query_builder_from_list_params_js_1.getQueryBuilderFromListParams)({
|
24
24
|
params,
|
25
|
-
repository: await (0,
|
25
|
+
repository: await (0, database_js_1.getRepository)(attribute_set_js_1.AttributeSet),
|
26
26
|
searchables: ['entity', 'description']
|
27
27
|
});
|
28
28
|
const [items, total] = await queryBuilder.getManyAndCount();
|
@@ -31,7 +31,7 @@ let AttributeSetQuery = class AttributeSetQuery {
|
|
31
31
|
};
|
32
32
|
exports.AttributeSetQuery = AttributeSetQuery;
|
33
33
|
tslib_1.__decorate([
|
34
|
-
(0, type_graphql_1.Query)(returns =>
|
34
|
+
(0, type_graphql_1.Query)(returns => attribute_set_js_1.AttributeSet, { nullable: true, description: 'To fetch a AttributeSet' }),
|
35
35
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
36
36
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
37
37
|
tslib_1.__metadata("design:type", Function),
|
@@ -39,7 +39,7 @@ tslib_1.__decorate([
|
|
39
39
|
tslib_1.__metadata("design:returntype", Promise)
|
40
40
|
], AttributeSetQuery.prototype, "attributeSet", null);
|
41
41
|
tslib_1.__decorate([
|
42
|
-
(0, type_graphql_1.Query)(returns =>
|
42
|
+
(0, type_graphql_1.Query)(returns => attribute_set_js_1.AttributeSet, { nullable: true, description: 'To fetch a AttributeSet by Entity name' }),
|
43
43
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('entity')),
|
44
44
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
45
45
|
tslib_1.__metadata("design:type", Function),
|
@@ -47,14 +47,14 @@ tslib_1.__decorate([
|
|
47
47
|
tslib_1.__metadata("design:returntype", Promise)
|
48
48
|
], AttributeSetQuery.prototype, "attributeSetByEntity", null);
|
49
49
|
tslib_1.__decorate([
|
50
|
-
(0, type_graphql_1.Query)(returns =>
|
51
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)(type =>
|
50
|
+
(0, type_graphql_1.Query)(returns => attribute_set_type_js_1.AttributeSetList, { description: 'To fetch multiple AttributeSets' }),
|
51
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)(type => list_param_js_1.ListParam)),
|
52
52
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
53
53
|
tslib_1.__metadata("design:type", Function),
|
54
|
-
tslib_1.__metadata("design:paramtypes", [
|
54
|
+
tslib_1.__metadata("design:paramtypes", [list_param_js_1.ListParam, Object]),
|
55
55
|
tslib_1.__metadata("design:returntype", Promise)
|
56
56
|
], AttributeSetQuery.prototype, "attributeSets", null);
|
57
57
|
exports.AttributeSetQuery = AttributeSetQuery = tslib_1.__decorate([
|
58
|
-
(0, type_graphql_1.Resolver)(
|
58
|
+
(0, type_graphql_1.Resolver)(attribute_set_js_1.AttributeSet)
|
59
59
|
], AttributeSetQuery);
|
60
60
|
//# sourceMappingURL=attribute-set-query.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"attribute-set-query.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,
|
1
|
+
{"version":3,"file":"attribute-set-query.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,yDAAiD;AACjD,mEAA0D;AAC1D,iEAAyD;AACzD,gEAA8D;AAC9D,6GAAiG;AAG1F,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAY;QAC3D,OAAO,MAAM,IAAA,2BAAa,EAAC,+BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,oBAAoB,CAAgB,MAAc,EAAS,OAAY;QAC3E,OAAO,MAAM,IAAA,2BAAa,EAAC,+BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,MAAM,EAAE;SAClB,CAAC,CAAA;IACJ,CA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FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { AttributeSet } from './attribute-set.js'\nimport { AttributeSetList } from './attribute-set-type.js'\nimport { ListParam } from '../common-types/list-param.js'\nimport { getRepository } from '../../initializers/database.js'\nimport { getQueryBuilderFromListParams } from '../../utils/get-query-builder-from-list-params.js'\n\n@Resolver(AttributeSet)\nexport class AttributeSetQuery {\n @Query(returns => AttributeSet!, { nullable: true, description: 'To fetch a AttributeSet' })\n async attributeSet(@Arg('id') id: string, @Ctx() context: any): Promise<AttributeSet> {\n return await getRepository(AttributeSet).findOne({\n where: { id }\n })\n }\n\n @Query(returns => AttributeSet!, { nullable: true, description: 'To fetch a AttributeSet by Entity name' })\n async attributeSetByEntity(@Arg('entity') entity: string, @Ctx() context: any): Promise<AttributeSet> {\n return await getRepository(AttributeSet).findOne({\n where: { entity }\n })\n }\n\n @Query(returns => AttributeSetList, { description: 'To fetch multiple AttributeSets' })\n async attributeSets(@Args(type => ListParam) params: ListParam, @Ctx() context: any): Promise<AttributeSetList> {\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(AttributeSet),\n searchables: ['entity', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n}\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { AttributeSet } from './attribute-set';
|
2
|
-
import { AttributeSetItemPatch } from './attribute-set-item-type';
|
1
|
+
import { AttributeSet } from './attribute-set.js';
|
2
|
+
import { AttributeSetItemPatch } from './attribute-set-item-type.js';
|
3
3
|
export declare class NewAttributeSet {
|
4
4
|
entity: string;
|
5
5
|
description?: string;
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AttributeSetList = exports.AttributeSetPatch = exports.NewAttributeSet = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
|
-
const
|
7
|
-
const
|
6
|
+
const attribute_set_js_1 = require("./attribute-set.js");
|
7
|
+
const attribute_set_item_type_js_1 = require("./attribute-set-item-type.js");
|
8
8
|
let NewAttributeSet = class NewAttributeSet {
|
9
9
|
};
|
10
10
|
exports.NewAttributeSet = NewAttributeSet;
|
@@ -17,7 +17,7 @@ tslib_1.__decorate([
|
|
17
17
|
tslib_1.__metadata("design:type", String)
|
18
18
|
], NewAttributeSet.prototype, "description", void 0);
|
19
19
|
tslib_1.__decorate([
|
20
|
-
(0, type_graphql_1.Field)(type => [
|
20
|
+
(0, type_graphql_1.Field)(type => [attribute_set_item_type_js_1.AttributeSetItemPatch], { nullable: true }),
|
21
21
|
tslib_1.__metadata("design:type", Array)
|
22
22
|
], NewAttributeSet.prototype, "items", void 0);
|
23
23
|
tslib_1.__decorate([
|
@@ -43,7 +43,7 @@ tslib_1.__decorate([
|
|
43
43
|
tslib_1.__metadata("design:type", String)
|
44
44
|
], AttributeSetPatch.prototype, "description", void 0);
|
45
45
|
tslib_1.__decorate([
|
46
|
-
(0, type_graphql_1.Field)(type => [
|
46
|
+
(0, type_graphql_1.Field)(type => [attribute_set_item_type_js_1.AttributeSetItemPatch], { nullable: true }),
|
47
47
|
tslib_1.__metadata("design:type", Array)
|
48
48
|
], AttributeSetPatch.prototype, "items", void 0);
|
49
49
|
tslib_1.__decorate([
|
@@ -57,7 +57,7 @@ let AttributeSetList = class AttributeSetList {
|
|
57
57
|
};
|
58
58
|
exports.AttributeSetList = AttributeSetList;
|
59
59
|
tslib_1.__decorate([
|
60
|
-
(0, type_graphql_1.Field)(type => [
|
60
|
+
(0, type_graphql_1.Field)(type => [attribute_set_js_1.AttributeSet]),
|
61
61
|
tslib_1.__metadata("design:type", Array)
|
62
62
|
], AttributeSetList.prototype, "items", void 0);
|
63
63
|
tslib_1.__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"attribute-set-type.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE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B;CAM5B,CAAA;AANY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,+BAAY,CAAC,CAAC;;+CACT;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;2BALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { AttributeSet } from './attribute-set.js'\nimport { AttributeSetItemPatch } from './attribute-set-item-type.js'\n\n@InputType()\nexport class NewAttributeSet {\n @Field()\n entity: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [AttributeSetItemPatch], { nullable: true })\n items?: AttributeSetItemPatch[]\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class AttributeSetPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n entity?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [AttributeSetItemPatch], { nullable: true })\n items?: AttributeSetItemPatch[]\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AttributeSetList {\n @Field(type => [AttributeSet])\n items: AttributeSet[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
@@ -4,7 +4,7 @@ exports.AttributeSet = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const typeorm_1 = require("typeorm");
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
7
|
-
const
|
7
|
+
const attribute_set_item_type_js_1 = require("./attribute-set-item-type.js");
|
8
8
|
let AttributeSet = class AttributeSet {
|
9
9
|
constructor() {
|
10
10
|
this.entity = '';
|
@@ -29,7 +29,7 @@ tslib_1.__decorate([
|
|
29
29
|
], AttributeSet.prototype, "description", void 0);
|
30
30
|
tslib_1.__decorate([
|
31
31
|
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
32
|
-
(0, type_graphql_1.Field)(type => [
|
32
|
+
(0, type_graphql_1.Field)(type => [attribute_set_item_type_js_1.AttributeSetItem], { nullable: true }),
|
33
33
|
tslib_1.__metadata("design:type", Array)
|
34
34
|
], AttributeSet.prototype, "items", void 0);
|
35
35
|
tslib_1.__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"attribute-set.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set.ts"],"names":[],"mappings":";;;;AAAA,qCAA2G;AAC3G,+CAAoD;AAEpD,
|
1
|
+
{"version":3,"file":"attribute-set.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set.ts"],"names":[],"mappings":";;;;AAAA,qCAA2G;AAC3G,+CAAoD;AAEpD,6EAA+D;AAOxD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QAOL,WAAM,GAAW,EAAE,CAAA;QAInB,gBAAW,GAAW,EAAE,CAAA;IAa1B,CAAC;CAAA,CAAA;AAxBY,oCAAY;AAGd;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;wCACC;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACP;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACF;AAIxB;IAFC,IAAA,gBAAM,EAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,6CAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAIzB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;+CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;+CAAA;uBAvBL,YAAY;IALxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,YAA0B,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;QAClF,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;GAC1C,YAAY,CAwBxB","sourcesContent":["import { CreateDateColumn, UpdateDateColumn, Entity, Index, Column, PrimaryGeneratedColumn } from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { AttributeSetItem } from './attribute-set-item-type.js'\n\n@Entity()\n@Index('ix_attribute_set_0', (attributeSet: AttributeSet) => [attributeSet.entity], {\n unique: true\n})\n@ObjectType({ description: 'Entity for AttributeSet' })\nexport class AttributeSet {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n entity: string = ''\n\n @Column({ nullable: true, default: '' })\n @Field({ nullable: true })\n description: string = ''\n\n @Column('simple-json', { nullable: true })\n @Field(type => [AttributeSetItem], { nullable: true })\n items: AttributeSetItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n}\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { AttributeSet } from './attribute-set';
|
2
|
-
import { AttributeSetQuery } from './attribute-set-query';
|
3
|
-
import { AttributeSetMutation } from './attribute-set-mutation';
|
1
|
+
import { AttributeSet } from './attribute-set.js';
|
2
|
+
import { AttributeSetQuery } from './attribute-set-query.js';
|
3
|
+
import { AttributeSetMutation } from './attribute-set-mutation.js';
|
4
4
|
export declare const entities: (typeof AttributeSet)[];
|
5
5
|
export declare const resolvers: (typeof AttributeSetQuery | typeof AttributeSetMutation)[];
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.resolvers = exports.entities = void 0;
|
4
|
-
const
|
5
|
-
const
|
6
|
-
const
|
7
|
-
exports.entities = [
|
8
|
-
exports.resolvers = [
|
4
|
+
const attribute_set_js_1 = require("./attribute-set.js");
|
5
|
+
const attribute_set_query_js_1 = require("./attribute-set-query.js");
|
6
|
+
const attribute_set_mutation_js_1 = require("./attribute-set-mutation.js");
|
7
|
+
exports.entities = [attribute_set_js_1.AttributeSet];
|
8
|
+
exports.resolvers = [attribute_set_query_js_1.AttributeSetQuery, attribute_set_mutation_js_1.AttributeSetMutation];
|
9
9
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/attribute-set/index.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/attribute-set/index.ts"],"names":[],"mappings":";;;AAAA,yDAAiD;AACjD,qEAA4D;AAC5D,2EAAkE;AAErD,QAAA,QAAQ,GAAG,CAAC,+BAAY,CAAC,CAAA;AACzB,QAAA,SAAS,GAAG,CAAC,0CAAiB,EAAE,gDAAoB,CAAC,CAAA","sourcesContent":["import { AttributeSet } from './attribute-set.js'\nimport { AttributeSetQuery } from './attribute-set-query.js'\nimport { AttributeSetMutation } from './attribute-set-mutation.js'\n\nexport const entities = [AttributeSet]\nexport const resolvers = [AttributeSetQuery, AttributeSetMutation]\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from './list-param';
|
2
|
-
export * from './scalar-any';
|
3
|
-
export * from './scalar-date';
|
4
|
-
export * from './scalar-object';
|
5
|
-
export * from './object-ref';
|
6
|
-
export * from './log';
|
1
|
+
export * from './list-param.js';
|
2
|
+
export * from './scalar-any.js';
|
3
|
+
export * from './scalar-date.js';
|
4
|
+
export * from './scalar-object.js';
|
5
|
+
export * from './object-ref.js';
|
6
|
+
export * from './log.js';
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
-
tslib_1.__exportStar(require("./list-param"), exports);
|
5
|
-
tslib_1.__exportStar(require("./scalar-any"), exports);
|
6
|
-
tslib_1.__exportStar(require("./scalar-date"), exports);
|
7
|
-
tslib_1.__exportStar(require("./scalar-object"), exports);
|
8
|
-
tslib_1.__exportStar(require("./object-ref"), exports);
|
9
|
-
tslib_1.__exportStar(require("./log"), exports);
|
4
|
+
tslib_1.__exportStar(require("./list-param.js"), exports);
|
5
|
+
tslib_1.__exportStar(require("./scalar-any.js"), exports);
|
6
|
+
tslib_1.__exportStar(require("./scalar-date.js"), exports);
|
7
|
+
tslib_1.__exportStar(require("./scalar-object.js"), exports);
|
8
|
+
tslib_1.__exportStar(require("./object-ref.js"), exports);
|
9
|
+
tslib_1.__exportStar(require("./log.js"), exports);
|
10
10
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/common-types/index.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/common-types/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B;AAC/B,0DAA+B;AAC/B,2DAAgC;AAChC,6DAAkC;AAClC,0DAA+B;AAC/B,mDAAwB","sourcesContent":["export * from './list-param.js'\nexport * from './scalar-any.js'\nexport * from './scalar-date.js'\nexport * from './scalar-object.js'\nexport * from './object-ref.js'\nexport * from './log.js'\n"]}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ListParam = exports.Filter = exports.Pagination = exports.Sorting = exports.InheritedValueType = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
|
-
const
|
6
|
+
const scalar_any_js_1 = require("./scalar-any.js");
|
7
7
|
var InheritedValueType;
|
8
8
|
(function (InheritedValueType) {
|
9
9
|
InheritedValueType["None"] = "None";
|
@@ -53,7 +53,7 @@ tslib_1.__decorate([
|
|
53
53
|
tslib_1.__metadata("design:type", String)
|
54
54
|
], Filter.prototype, "operator", void 0);
|
55
55
|
tslib_1.__decorate([
|
56
|
-
(0, type_graphql_1.Field)(type =>
|
56
|
+
(0, type_graphql_1.Field)(type => scalar_any_js_1.ScalarAny, { nullable: true }),
|
57
57
|
tslib_1.__metadata("design:type", Object)
|
58
58
|
], Filter.prototype, "value", void 0);
|
59
59
|
tslib_1.__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,
|
1
|
+
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,mDAA2C;AAE3C,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,yCAAmB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B;AAED,IAAA,+BAAgB,EAAC,kBAAkB,EAAE;IACnC,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAA;AAGK,IAAM,OAAO,GAAb,MAAM,OAAO;CAMnB,CAAA;AANY,0BAAO;AAElB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,uBAAuB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vB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACzB;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACxB;oBAXnB,SAAS;IADrB,IAAA,uBAAQ,GAAE;GACE,SAAS,CAYrB","sourcesContent":["import { ArgsType, Field, InputType, Int, registerEnumType } from 'type-graphql'\n\nimport { ScalarAny } from './scalar-any.js'\n\nexport enum InheritedValueType {\n None = 'None',\n Only = 'Only',\n Include = 'Include'\n}\n\nregisterEnumType(InheritedValueType, {\n name: 'InheritedValueType'\n})\n\n@InputType()\nexport class Sorting {\n @Field({ description: 'Field name to sort by' })\n name: string\n\n @Field({ nullable: true, description: 'Set to true if descending sort. Default is \"false\"' })\n desc?: boolean\n}\n\n@InputType()\nexport class Pagination {\n @Field(type => Int, { nullable: true })\n page?: number\n\n @Field(type => Int, { nullable: true })\n limit?: number\n}\n\n@InputType()\nexport class Filter {\n @Field()\n name: string\n\n @Field()\n operator: string\n\n @Field(type => ScalarAny, { nullable: true })\n value?: any\n\n @Field({ nullable: true })\n relation?: boolean\n}\n\n@ArgsType()\nexport class ListParam {\n @Field(type => [Filter], { nullable: true })\n filters?: Filter[]\n\n @Field(type => Pagination, { nullable: true })\n pagination?: Pagination\n\n @Field(type => [Sorting], { nullable: true })\n sortings?: Sorting[]\n\n @Field(type => InheritedValueType, { nullable: true })\n inherited?: InheritedValueType\n}\n"]}
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Log = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
|
-
const
|
6
|
+
const scalar_object_js_1 = require("./scalar-object.js");
|
7
7
|
let Log = class Log {
|
8
8
|
};
|
9
9
|
exports.Log = Log;
|
10
10
|
tslib_1.__decorate([
|
11
|
-
(0, type_graphql_1.Field)(() =>
|
11
|
+
(0, type_graphql_1.Field)(() => scalar_object_js_1.ScalarObject, { description: 'the source of the log' }),
|
12
12
|
tslib_1.__metadata("design:type", Object)
|
13
13
|
], Log.prototype, "source", void 0);
|
14
14
|
tslib_1.__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../server/service/common-types/log.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../server/service/common-types/log.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,yDAAiD;AAG1C,IAAM,GAAG,GAAT,MAAM,GAAG;CAYf,CAAA;AAZY,kBAAG;AAEd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,+BAAY,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;mCACtD;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;kCAClD;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;;oCAC5B;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;;sCACpC;cAXN,GAAG;IADf,IAAA,yBAAU,GAAE;GACA,GAAG,CAYf","sourcesContent":["import { ObjectType, Field } from 'type-graphql'\nimport { ScalarObject } from './scalar-object.js'\n\n@ObjectType()\nexport class Log {\n @Field(() => ScalarObject, { description: 'the source of the log' })\n source: object\n\n @Field({ description: 'log level (error, warning, info, ..)' })\n level: string\n\n @Field({ description: 'log body message' })\n message: string\n\n @Field({ description: 'timestamp the log occurred' })\n timestamp: string\n}\n"]}
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
import { GraphQLScalarType } from 'graphql';
|
2
|
+
export declare const ScalarObject: GraphQLScalarType<unknown, unknown>;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ScalarObject = void 0;
|
4
|
-
const
|
5
|
-
exports.ScalarObject = new GraphQLScalarType({
|
4
|
+
const graphql_1 = require("graphql");
|
5
|
+
exports.ScalarObject = new graphql_1.GraphQLScalarType({
|
6
6
|
name: 'Object',
|
7
7
|
description: 'Can be anything',
|
8
8
|
parseValue(value) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scalar-object.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-object.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"scalar-object.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-object.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAE9B,QAAA,YAAY,GAAG,IAAI,2BAAiB,CAAC;IAChD,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,iBAAiB;IAC9B,UAAU,CAAC,KAAK;QACd,OAAO,KAAK,CAAA;IACd,CAAC;IACD,SAAS,CAAC,KAAK;QACb,OAAO,KAAK,CAAA;IACd,CAAC;IACD,YAAY,CAAC,GAAG;QACd,OAAO,GAAG,CAAA;IACZ,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { GraphQLScalarType } from 'graphql'\n\nexport const ScalarObject = new GraphQLScalarType({\n name: 'Object',\n description: 'Can be anything',\n parseValue(value) {\n return value\n },\n serialize(value) {\n return value\n },\n parseLiteral(ast) {\n return ast\n }\n})\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
export * from './transaction';
|
1
|
+
export * from './transaction.js';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
-
tslib_1.__exportStar(require("./transaction"), exports);
|
4
|
+
tslib_1.__exportStar(require("./transaction.js"), exports);
|
5
5
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/index.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/index.ts"],"names":[],"mappings":";;;AAAA,2DAAgC","sourcesContent":["export * from './transaction.js'\n"]}
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
5
5
|
const graphql_1 = require("graphql");
|
6
6
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
7
7
|
const utils_1 = require("@graphql-tools/utils");
|
8
|
-
const
|
8
|
+
const database_js_1 = require("../../initializers/database.js");
|
9
9
|
const DIRECTIVE = 'transaction';
|
10
10
|
exports.transactionDirectiveTypeDefs = (0, graphql_tag_1.default) `
|
11
11
|
directive @${DIRECTIVE} on FIELD_DEFINITION
|
@@ -17,7 +17,7 @@ const transactionDirectiveResolver = (schema) => (0, utils_1.mapSchema)(schema,
|
|
17
17
|
if (transactionDirective) {
|
18
18
|
const { resolve = graphql_1.defaultFieldResolver } = fieldConfig;
|
19
19
|
fieldConfig.resolve = async function (source, args, context, info) {
|
20
|
-
return await (0,
|
20
|
+
return await (0, database_js_1.getDataSource)('tx').transaction(async (tx) => {
|
21
21
|
/* local-graphql-client로부터 invoke인 경우에는 context.req, context.res 가 없으므로, 빈 오브젝트로 대체해준다. */
|
22
22
|
let wrap = context.app.createContext(context.req || {}, context.res || {});
|
23
23
|
wrap.state = Object.assign(Object.assign({}, context.state), { tx });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAA6D;AAC7D,sEAA6B;AAE7B,gDAA0E;AAE1E,
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction.ts"],"names":[],"m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,CAAA;QACpB,CAAC;IACH,CAAC;CACF,CAAC,CAAA;AA3BS,QAAA,4BAA4B,gCA2BrC","sourcesContent":["import { defaultFieldResolver, GraphQLSchema } from 'graphql'\nimport gql from 'graphql-tag'\n\nimport { getDirective, MapperKind, mapSchema } from '@graphql-tools/utils'\n\nimport { getDataSource } from '../../initializers/database.js'\n\nconst DIRECTIVE = 'transaction'\n\nexport const transactionDirectiveTypeDefs = gql`\n directive @${DIRECTIVE} on FIELD_DEFINITION\n `\nexport const transactionDirectiveResolver = (schema: GraphQLSchema) =>\n mapSchema(schema, {\n [MapperKind.OBJECT_FIELD]: (fieldConfig, fieldName) => {\n const transactionDirective = getDirective(schema, fieldConfig, DIRECTIVE)?.[0]\n if (transactionDirective) {\n const { resolve = defaultFieldResolver } = fieldConfig\n\n fieldConfig.resolve = async function (source, args, context, info) {\n return await getDataSource('tx').transaction(async tx => {\n /* local-graphql-client로부터 invoke인 경우에는 context.req, context.res 가 없으므로, 빈 오브젝트로 대체해준다. */\n let wrap = context.app.createContext(context.req || {}, context.res || {})\n\n wrap.state = {\n ...context.state,\n tx\n }\n wrap.t = context.t\n\n let result = await resolve.call(this, source, args, wrap, info)\n\n return result\n })\n }\n\n return fieldConfig\n }\n }\n })\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Domain, IPList } from './domain';
|
2
|
-
import { DomainPatch } from './domain-types';
|
1
|
+
import { Domain, IPList } from './domain.js';
|
2
|
+
import { DomainPatch } from './domain-types.js';
|
3
3
|
export declare class DomainMutation {
|
4
4
|
createDomain(domainInput: DomainPatch): Promise<{
|
5
5
|
name: string;
|
@@ -5,14 +5,14 @@ const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
6
|
const typeorm_1 = require("typeorm");
|
7
7
|
const utils_1 = require("@things-factory/utils");
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const
|
11
|
-
const
|
8
|
+
const database_js_1 = require("../../initializers/database.js");
|
9
|
+
const domain_js_1 = require("./domain.js");
|
10
|
+
const domain_types_js_1 = require("./domain-types.js");
|
11
|
+
const scalar_object_js_1 = require("../common-types/scalar-object.js");
|
12
12
|
let DomainMutation = class DomainMutation {
|
13
13
|
async createDomain(domainInput) {
|
14
14
|
const { name, description } = domainInput;
|
15
|
-
const domainRepo = (0,
|
15
|
+
const domainRepo = (0, database_js_1.getRepository)(domain_js_1.Domain);
|
16
16
|
const subdomain = (0, utils_1.slugger)(name);
|
17
17
|
const domain = await domainRepo.findOneBy({ subdomain });
|
18
18
|
if (domain) {
|
@@ -21,15 +21,15 @@ let DomainMutation = class DomainMutation {
|
|
21
21
|
return await domainRepo.save({ name, description, subdomain });
|
22
22
|
}
|
23
23
|
async deleteDomain(name) {
|
24
|
-
return await (0,
|
24
|
+
return await (0, database_js_1.getRepository)(domain_js_1.Domain).delete({ name });
|
25
25
|
}
|
26
26
|
async deleteDomains(names) {
|
27
|
-
const domains = await (0,
|
27
|
+
const domains = await (0, database_js_1.getRepository)(domain_js_1.Domain).find({ where: { name: (0, typeorm_1.In)(names) } });
|
28
28
|
const domainIds = domains.map(domain => domain.id);
|
29
|
-
await (0,
|
29
|
+
await (0, database_js_1.getRepository)(domain_js_1.Domain).delete({ id: (0, typeorm_1.In)(domainIds) });
|
30
30
|
}
|
31
31
|
async updateDomain(name, patch) {
|
32
|
-
const repository = (0,
|
32
|
+
const repository = (0, database_js_1.getRepository)(domain_js_1.Domain);
|
33
33
|
const domain = await repository.findOneBy({ name });
|
34
34
|
if (patch.parent && patch.parent.id == domain.id) {
|
35
35
|
delete patch.parent;
|
@@ -37,7 +37,7 @@ let DomainMutation = class DomainMutation {
|
|
37
37
|
return await repository.save(Object.assign(Object.assign({}, domain), patch));
|
38
38
|
}
|
39
39
|
async updateDomains(patches) {
|
40
|
-
const domainRepo = (0,
|
40
|
+
const domainRepo = (0, database_js_1.getRepository)(domain_js_1.Domain);
|
41
41
|
const patchIds = patches.filter((patch) => patch.id);
|
42
42
|
if (patchIds.length > 0) {
|
43
43
|
patchIds.forEach(async (updateRecord) => {
|
@@ -55,7 +55,7 @@ let DomainMutation = class DomainMutation {
|
|
55
55
|
}
|
56
56
|
async updateSecureIPList(iplist, context) {
|
57
57
|
const { domain } = context.state;
|
58
|
-
const repository = (0,
|
58
|
+
const repository = (0, database_js_1.getRepository)(domain_js_1.Domain);
|
59
59
|
// const domain: Domain = await repository.findOneBy({ id })
|
60
60
|
const { iplist: result } = await repository.save(Object.assign(Object.assign({}, domain), { iplist }));
|
61
61
|
return result;
|
@@ -65,16 +65,16 @@ exports.DomainMutation = DomainMutation;
|
|
65
65
|
tslib_1.__decorate([
|
66
66
|
(0, type_graphql_1.Directive)('@transaction'),
|
67
67
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
68
|
-
(0, type_graphql_1.Mutation)(returns =>
|
68
|
+
(0, type_graphql_1.Mutation)(returns => domain_js_1.Domain, { description: 'To create domain (Only superuser is granted this privilege.)' }),
|
69
69
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('domainInput')),
|
70
70
|
tslib_1.__metadata("design:type", Function),
|
71
|
-
tslib_1.__metadata("design:paramtypes", [
|
71
|
+
tslib_1.__metadata("design:paramtypes", [domain_types_js_1.DomainPatch]),
|
72
72
|
tslib_1.__metadata("design:returntype", Promise)
|
73
73
|
], DomainMutation.prototype, "createDomain", null);
|
74
74
|
tslib_1.__decorate([
|
75
75
|
(0, type_graphql_1.Directive)('@transaction'),
|
76
76
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
77
|
-
(0, type_graphql_1.Mutation)(returns =>
|
77
|
+
(0, type_graphql_1.Mutation)(returns => domain_js_1.Domain, { description: 'To delete domain (Only superuser is granted this privilege.)' }),
|
78
78
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
79
79
|
tslib_1.__metadata("design:type", Function),
|
80
80
|
tslib_1.__metadata("design:paramtypes", [String]),
|
@@ -94,13 +94,13 @@ tslib_1.__decorate([
|
|
94
94
|
tslib_1.__decorate([
|
95
95
|
(0, type_graphql_1.Directive)('@transaction'),
|
96
96
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
97
|
-
(0, type_graphql_1.Mutation)(returns =>
|
97
|
+
(0, type_graphql_1.Mutation)(returns => domain_js_1.Domain, {
|
98
98
|
description: 'To update domain (Only superuser is granted this privilege.)'
|
99
99
|
}),
|
100
100
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
101
|
-
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch', () =>
|
101
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch', () => domain_types_js_1.DomainPatch)),
|
102
102
|
tslib_1.__metadata("design:type", Function),
|
103
|
-
tslib_1.__metadata("design:paramtypes", [String,
|
103
|
+
tslib_1.__metadata("design:paramtypes", [String, domain_types_js_1.DomainPatch]),
|
104
104
|
tslib_1.__metadata("design:returntype", Promise)
|
105
105
|
], DomainMutation.prototype, "updateDomain", null);
|
106
106
|
tslib_1.__decorate([
|
@@ -109,7 +109,7 @@ tslib_1.__decorate([
|
|
109
109
|
(0, type_graphql_1.Mutation)(returns => Boolean, {
|
110
110
|
description: 'To update multiple domains (Only superuser is granted this privilege.)'
|
111
111
|
}),
|
112
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', () => [
|
112
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', () => [domain_types_js_1.DomainPatch])),
|
113
113
|
tslib_1.__metadata("design:type", Function),
|
114
114
|
tslib_1.__metadata("design:paramtypes", [Array]),
|
115
115
|
tslib_1.__metadata("design:returntype", Promise)
|
@@ -117,14 +117,14 @@ tslib_1.__decorate([
|
|
117
117
|
tslib_1.__decorate([
|
118
118
|
(0, type_graphql_1.Directive)('@transaction'),
|
119
119
|
(0, type_graphql_1.Directive)('@privilege(category: "security", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)'),
|
120
|
-
(0, type_graphql_1.Mutation)(returns =>
|
121
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('iplist', type =>
|
120
|
+
(0, type_graphql_1.Mutation)(returns => scalar_object_js_1.ScalarObject, { nullable: true, description: 'To update secure IP list for domain' }),
|
121
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('iplist', type => scalar_object_js_1.ScalarObject)),
|
122
122
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
123
123
|
tslib_1.__metadata("design:type", Function),
|
124
124
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
125
125
|
tslib_1.__metadata("design:returntype", Promise)
|
126
126
|
], DomainMutation.prototype, "updateSecureIPList", null);
|
127
127
|
exports.DomainMutation = DomainMutation = tslib_1.__decorate([
|
128
|
-
(0, type_graphql_1.Resolver)(
|
128
|
+
(0, type_graphql_1.Resolver)(domain_js_1.Domain)
|
129
129
|
], DomainMutation);
|
130
130
|
//# sourceMappingURL=domain-mutation.js.map
|