@things-factory/shell 6.2.170 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/license.json +4 -4
- package/dist-server/initializers/database.js +6 -6
- package/dist-server/initializers/database.js.map +1 -1
- package/dist-server/middlewares/domain-middleware.js +1 -2
- package/dist-server/middlewares/domain-middleware.js.map +1 -1
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/pubsub.js +0 -1
- package/dist-server/pubsub.js.map +1 -1
- package/dist-server/routers/global-router.js.map +1 -1
- package/dist-server/schema.js +4 -4
- package/dist-server/schema.js.map +1 -1
- package/dist-server/server-dev.js.map +1 -1
- package/dist-server/server.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-item-type.js +5 -5
- package/dist-server/service/attribute-set/attribute-set-item-type.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-mutation.js +2 -2
- package/dist-server/service/attribute-set/attribute-set-mutation.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-query.js +2 -2
- package/dist-server/service/attribute-set/attribute-set-query.js.map +1 -1
- package/dist-server/service/attribute-set/attribute-set-type.js +6 -6
- package/dist-server/service/attribute-set/attribute-set-type.js.map +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/common-types/list-param.js +9 -9
- 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/object-ref.js +2 -2
- package/dist-server/service/common-types/object-ref.js.map +1 -1
- package/dist-server/service/common-types/scalar-any.js.map +1 -1
- package/dist-server/service/common-types/scalar-date.js.map +1 -1
- package/dist-server/service/directive-transaction/transaction.js.map +1 -1
- package/dist-server/service/domain/{domain-Mutation.js → domain-mutation.js} +3 -3
- package/dist-server/service/domain/domain-mutation.js.map +1 -0
- package/dist-server/service/domain/domain-query.js +2 -2
- package/dist-server/service/domain/domain-query.js.map +1 -1
- 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 +6 -7
- package/dist-server/service/domain/domain.js.map +1 -1
- package/dist-server/service/domain/index.d.ts +1 -1
- package/dist-server/service/domain/index.js +2 -2
- package/dist-server/service/domain/index.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/service/subscription-data/data-resolver.js +2 -2
- package/dist-server/service/subscription-data/data-resolver.js.map +1 -1
- package/dist-server/service/subscription-data/data-types.js +2 -2
- package/dist-server/service/subscription-data/data-types.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/typeorm/encrypt-transform.js +1 -1
- package/dist-server/typeorm/encrypt-transform.js.map +1 -1
- package/dist-server/typeorm/get-data-encryption-key.js.map +1 -1
- package/dist-server/typeorm/json5-transform.js.map +1 -1
- package/dist-server/utils/condition-builder.js.map +1 -1
- package/dist-server/utils/get-domain.d.ts +0 -1
- package/dist-server/utils/get-domain.js +7 -8
- package/dist-server/utils/get-domain.js.map +1 -1
- package/dist-server/utils/get-query-builder-from-list-params.js +1 -2
- package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
- package/dist-server/utils/get-times-for-period.js +2 -3
- package/dist-server/utils/get-times-for-period.js.map +1 -1
- package/dist-server/utils/list-param-adjuster.js +1 -2
- package/dist-server/utils/list-param-adjuster.js.map +1 -1
- package/dist-server/utils/list-params-converter.js +1 -2
- package/dist-server/utils/list-params-converter.js.map +1 -1
- package/dist-server/utils/list-query-builder.js.map +1 -1
- package/dist-server/utils/publish-progress.js +1 -2
- package/dist-server/utils/publish-progress.js.map +1 -1
- package/package.json +9 -12
- package/server/schema.ts +1 -1
- package/server/service/domain/index.ts +1 -1
- package/dist-server/service/domain/domain-Mutation.js.map +0 -1
- /package/dist-server/service/domain/{domain-Mutation.d.ts → domain-mutation.d.ts} +0 -0
@@ -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,mDAA8C;AAC9C,6DAAyE;AAGlE,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,4BAAY,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,4BAAY,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,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,aAAa,GAAG,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAA;QAEpD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;
|
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,mDAA8C;AAC9C,6DAAyE;AAGlE,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,4BAAY,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,4BAAY,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,KA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;IAAiB,mBAAA,IAAA,kBAAG,GAAE,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,sCAAiB,CAAC,CAAC,CAAA;IAC9C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAWP;+BApHU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAqHhC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { AttributeSet } from './attribute-set'\nimport { NewAttributeSet, AttributeSetPatch } from './attribute-set-type'\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"]}
|
@@ -29,6 +29,7 @@ let AttributeSetQuery = class AttributeSetQuery {
|
|
29
29
|
return { items, total };
|
30
30
|
}
|
31
31
|
};
|
32
|
+
exports.AttributeSetQuery = AttributeSetQuery;
|
32
33
|
tslib_1.__decorate([
|
33
34
|
(0, type_graphql_1.Query)(returns => attribute_set_1.AttributeSet, { nullable: true, description: 'To fetch a AttributeSet' }),
|
34
35
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
@@ -53,8 +54,7 @@ tslib_1.__decorate([
|
|
53
54
|
tslib_1.__metadata("design:paramtypes", [common_types_1.ListParam, Object]),
|
54
55
|
tslib_1.__metadata("design:returntype", Promise)
|
55
56
|
], AttributeSetQuery.prototype, "attributeSets", null);
|
56
|
-
AttributeSetQuery = tslib_1.__decorate([
|
57
|
+
exports.AttributeSetQuery = AttributeSetQuery = tslib_1.__decorate([
|
57
58
|
(0, type_graphql_1.Resolver)(attribute_set_1.AttributeSet)
|
58
59
|
], AttributeSetQuery);
|
59
|
-
exports.AttributeSetQuery = 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,mDAA8C;AAC9C,6DAAuD;AACvD,kDAA2C;AAC3C,0DAA2D;AAC3D,uCAA2D;AAGpD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAY;QAC3D,OAAO,MAAM,IAAA,wBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,oBAAoB,CAAgB,MAAc,EAAS,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,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,wBAAa,EAAC,4BAAY,CAAC;YAC7C,WAAW,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;SACvC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AA3BY,8CAAiB;AAEtB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,4BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACxE,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAI/C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,4BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAC/E,mBAAA,IAAA,kBAAG,EAAC,QAAQ,CAAC,CAAA;IAAkB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;6DAI/D;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,qCAAgB,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;IAClE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,wBAAS;;sDAU5C;4BA1BU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CA2B7B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { AttributeSet } from './attribute-set'\nimport { AttributeSetList } from './attribute-set-type'\nimport { ListParam } from '../common-types'\nimport { getRepository } from '../../initializers/database'\nimport { getQueryBuilderFromListParams } from '../../utils'\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() 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"]}
|
@@ -7,6 +7,7 @@ const attribute_set_1 = require("./attribute-set");
|
|
7
7
|
const attribute_set_item_type_1 = require("./attribute-set-item-type");
|
8
8
|
let NewAttributeSet = class NewAttributeSet {
|
9
9
|
};
|
10
|
+
exports.NewAttributeSet = NewAttributeSet;
|
10
11
|
tslib_1.__decorate([
|
11
12
|
(0, type_graphql_1.Field)(),
|
12
13
|
tslib_1.__metadata("design:type", String)
|
@@ -23,12 +24,12 @@ tslib_1.__decorate([
|
|
23
24
|
(0, type_graphql_1.Field)({ nullable: true }),
|
24
25
|
tslib_1.__metadata("design:type", Boolean)
|
25
26
|
], NewAttributeSet.prototype, "active", void 0);
|
26
|
-
NewAttributeSet = tslib_1.__decorate([
|
27
|
+
exports.NewAttributeSet = NewAttributeSet = tslib_1.__decorate([
|
27
28
|
(0, type_graphql_1.InputType)()
|
28
29
|
], NewAttributeSet);
|
29
|
-
exports.NewAttributeSet = NewAttributeSet;
|
30
30
|
let AttributeSetPatch = class AttributeSetPatch {
|
31
31
|
};
|
32
|
+
exports.AttributeSetPatch = AttributeSetPatch;
|
32
33
|
tslib_1.__decorate([
|
33
34
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
34
35
|
tslib_1.__metadata("design:type", String)
|
@@ -49,12 +50,12 @@ tslib_1.__decorate([
|
|
49
50
|
(0, type_graphql_1.Field)({ nullable: true }),
|
50
51
|
tslib_1.__metadata("design:type", String)
|
51
52
|
], AttributeSetPatch.prototype, "cuFlag", void 0);
|
52
|
-
AttributeSetPatch = tslib_1.__decorate([
|
53
|
+
exports.AttributeSetPatch = AttributeSetPatch = tslib_1.__decorate([
|
53
54
|
(0, type_graphql_1.InputType)()
|
54
55
|
], AttributeSetPatch);
|
55
|
-
exports.AttributeSetPatch = AttributeSetPatch;
|
56
56
|
let AttributeSetList = class AttributeSetList {
|
57
57
|
};
|
58
|
+
exports.AttributeSetList = AttributeSetList;
|
58
59
|
tslib_1.__decorate([
|
59
60
|
(0, type_graphql_1.Field)(type => [attribute_set_1.AttributeSet]),
|
60
61
|
tslib_1.__metadata("design:type", Array)
|
@@ -63,8 +64,7 @@ tslib_1.__decorate([
|
|
63
64
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
64
65
|
tslib_1.__metadata("design:type", Number)
|
65
66
|
], AttributeSetList.prototype, "total", void 0);
|
66
|
-
AttributeSetList = tslib_1.__decorate([
|
67
|
+
exports.AttributeSetList = AttributeSetList = tslib_1.__decorate([
|
67
68
|
(0, type_graphql_1.ObjectType)()
|
68
69
|
], AttributeSetList);
|
69
|
-
exports.AttributeSetList = AttributeSetList;
|
70
70
|
//# sourceMappingURL=attribute-set-type.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"attribute-set-type.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,mDAA8C;AAC9C,uEAAiE;AAG1D,IAAM,eAAe,GAArB,MAAM,e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AAM,gBAAgB;CAM5B,CAAA;AANY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,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'\nimport { AttributeSetItemPatch } from './attribute-set-item-type'\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"]}
|
@@ -11,6 +11,7 @@ let AttributeSet = class AttributeSet {
|
|
11
11
|
this.description = '';
|
12
12
|
}
|
13
13
|
};
|
14
|
+
exports.AttributeSet = AttributeSet;
|
14
15
|
tslib_1.__decorate([
|
15
16
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
16
17
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
@@ -41,12 +42,11 @@ tslib_1.__decorate([
|
|
41
42
|
(0, type_graphql_1.Field)({ nullable: true }),
|
42
43
|
tslib_1.__metadata("design:type", Date)
|
43
44
|
], AttributeSet.prototype, "updatedAt", void 0);
|
44
|
-
AttributeSet = tslib_1.__decorate([
|
45
|
+
exports.AttributeSet = AttributeSet = tslib_1.__decorate([
|
45
46
|
(0, typeorm_1.Entity)(),
|
46
47
|
(0, typeorm_1.Index)('ix_attribute_set_0', (attributeSet) => [attributeSet.entity], {
|
47
48
|
unique: true
|
48
49
|
}),
|
49
50
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for AttributeSet' })
|
50
51
|
], AttributeSet);
|
51
|
-
exports.AttributeSet = AttributeSet;
|
52
52
|
//# sourceMappingURL=attribute-set.js.map
|
@@ -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,uEAA4D;AAOrD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QAOL,WAAM,GAAW,EAAE,CAAA;QAInB,gBAAW,GAAW,EAAE,CAAA;IAa1B,CAAC;CAAA,CAAA;
|
1
|
+
{"version":3,"file":"attribute-set.js","sourceRoot":"","sources":["../../../server/service/attribute-set/attribute-set.ts"],"names":[],"mappings":";;;;AAAA,qCAA2G;AAC3G,+CAAoD;AAEpD,uEAA4D;AAOrD,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,0CAAgB,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'\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"]}
|
@@ -9,12 +9,13 @@ var InheritedValueType;
|
|
9
9
|
InheritedValueType["None"] = "None";
|
10
10
|
InheritedValueType["Only"] = "Only";
|
11
11
|
InheritedValueType["Include"] = "Include";
|
12
|
-
})(InheritedValueType
|
12
|
+
})(InheritedValueType || (exports.InheritedValueType = InheritedValueType = {}));
|
13
13
|
(0, type_graphql_1.registerEnumType)(InheritedValueType, {
|
14
14
|
name: 'InheritedValueType'
|
15
15
|
});
|
16
16
|
let Sorting = class Sorting {
|
17
17
|
};
|
18
|
+
exports.Sorting = Sorting;
|
18
19
|
tslib_1.__decorate([
|
19
20
|
(0, type_graphql_1.Field)({ description: 'Field name to sort by' }),
|
20
21
|
tslib_1.__metadata("design:type", String)
|
@@ -23,12 +24,12 @@ tslib_1.__decorate([
|
|
23
24
|
(0, type_graphql_1.Field)({ nullable: true, description: 'Set to true if descending sort. Default is "false"' }),
|
24
25
|
tslib_1.__metadata("design:type", Boolean)
|
25
26
|
], Sorting.prototype, "desc", void 0);
|
26
|
-
Sorting = tslib_1.__decorate([
|
27
|
+
exports.Sorting = Sorting = tslib_1.__decorate([
|
27
28
|
(0, type_graphql_1.InputType)()
|
28
29
|
], Sorting);
|
29
|
-
exports.Sorting = Sorting;
|
30
30
|
let Pagination = class Pagination {
|
31
31
|
};
|
32
|
+
exports.Pagination = Pagination;
|
32
33
|
tslib_1.__decorate([
|
33
34
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
34
35
|
tslib_1.__metadata("design:type", Number)
|
@@ -37,12 +38,12 @@ tslib_1.__decorate([
|
|
37
38
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
38
39
|
tslib_1.__metadata("design:type", Number)
|
39
40
|
], Pagination.prototype, "limit", void 0);
|
40
|
-
Pagination = tslib_1.__decorate([
|
41
|
+
exports.Pagination = Pagination = tslib_1.__decorate([
|
41
42
|
(0, type_graphql_1.InputType)()
|
42
43
|
], Pagination);
|
43
|
-
exports.Pagination = Pagination;
|
44
44
|
let Filter = class Filter {
|
45
45
|
};
|
46
|
+
exports.Filter = Filter;
|
46
47
|
tslib_1.__decorate([
|
47
48
|
(0, type_graphql_1.Field)(),
|
48
49
|
tslib_1.__metadata("design:type", String)
|
@@ -59,12 +60,12 @@ tslib_1.__decorate([
|
|
59
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
60
61
|
tslib_1.__metadata("design:type", Boolean)
|
61
62
|
], Filter.prototype, "relation", void 0);
|
62
|
-
Filter = tslib_1.__decorate([
|
63
|
+
exports.Filter = Filter = tslib_1.__decorate([
|
63
64
|
(0, type_graphql_1.InputType)()
|
64
65
|
], Filter);
|
65
|
-
exports.Filter = Filter;
|
66
66
|
let ListParam = class ListParam {
|
67
67
|
};
|
68
|
+
exports.ListParam = ListParam;
|
68
69
|
tslib_1.__decorate([
|
69
70
|
(0, type_graphql_1.Field)(type => [Filter], { nullable: true }),
|
70
71
|
tslib_1.__metadata("design:type", Array)
|
@@ -81,8 +82,7 @@ tslib_1.__decorate([
|
|
81
82
|
(0, type_graphql_1.Field)(type => InheritedValueType, { nullable: true }),
|
82
83
|
tslib_1.__metadata("design:type", String)
|
83
84
|
], ListParam.prototype, "inherited", void 0);
|
84
|
-
ListParam = tslib_1.__decorate([
|
85
|
+
exports.ListParam = ListParam = tslib_1.__decorate([
|
85
86
|
(0, type_graphql_1.ArgsType)()
|
86
87
|
], ListParam);
|
87
|
-
exports.ListParam = ListParam;
|
88
88
|
//# sourceMappingURL=list-param.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,6CAAwC;AAExC,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,yCAAmB,CAAA;AACrB,CAAC,EAJW,kBAAkB,
|
1
|
+
{"version":3,"file":"list-param.js","sourceRoot":"","sources":["../../../server/service/common-types/list-param.ts"],"names":[],"mappings":";;;;AAAA,+CAAgF;AAEhF,6CAAwC;AAExC,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,EAAE,CAAC;;qCACpC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC;;qCAC/E;kBALH,OAAO;IADnB,IAAA,wBAAS,GAAE;GACC,OAAO,CAMnB;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC1B;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACzB;qBALH,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAMtB;AAGM,IAAM,MAAM,GAAZ,MAAM,MAAM;CAYlB,CAAA;AAZY,wBAAM;AAEjB;IADC,IAAA,oBAAK,GAAE;;oCACI;AAGZ;IADC,IAAA,oBAAK,GAAE;;wCACQ;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCAClC;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACR;iBAXP,MAAM;IADlB,IAAA,wBAAS,GAAE;GACC,MAAM,CAYlB;AAGM,IAAM,SAAS,GAAf,MAAM,SAAS;CAYrB,CAAA;AAZY,8BAAS;AAEpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC1B;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,UAAU;6CAAA;AAGvB;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'\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"]}
|
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
|
|
6
6
|
const scalar_object_1 = require("./scalar-object");
|
7
7
|
let Log = class Log {
|
8
8
|
};
|
9
|
+
exports.Log = Log;
|
9
10
|
tslib_1.__decorate([
|
10
11
|
(0, type_graphql_1.Field)(() => scalar_object_1.ScalarObject, { description: 'the source of the log' }),
|
11
12
|
tslib_1.__metadata("design:type", Object)
|
@@ -22,8 +23,7 @@ tslib_1.__decorate([
|
|
22
23
|
(0, type_graphql_1.Field)({ description: 'timestamp the log occurred' }),
|
23
24
|
tslib_1.__metadata("design:type", String)
|
24
25
|
], Log.prototype, "timestamp", void 0);
|
25
|
-
Log = tslib_1.__decorate([
|
26
|
+
exports.Log = Log = tslib_1.__decorate([
|
26
27
|
(0, type_graphql_1.ObjectType)()
|
27
28
|
], Log);
|
28
|
-
exports.Log = Log;
|
29
29
|
//# sourceMappingURL=log.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../server/service/common-types/log.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,mDAA8C;AAGvC,IAAM,GAAG,GAAT,MAAM,GAAG;CAYf,CAAA;
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../server/service/common-types/log.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,mDAA8C;AAGvC,IAAM,GAAG,GAAT,MAAM,GAAG;CAYf,CAAA;AAZY,kBAAG;AAEd;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,4BAAY,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'\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"]}
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
6
6
|
let ObjectRef = class ObjectRef {
|
7
7
|
};
|
8
|
+
exports.ObjectRef = ObjectRef;
|
8
9
|
tslib_1.__decorate([
|
9
10
|
(0, type_graphql_1.Field)(() => type_graphql_1.ID, { description: 'Field id' }),
|
10
11
|
tslib_1.__metadata("design:type", String)
|
@@ -17,8 +18,7 @@ tslib_1.__decorate([
|
|
17
18
|
(0, type_graphql_1.Field)({ nullable: true, description: 'Field description' }),
|
18
19
|
tslib_1.__metadata("design:type", String)
|
19
20
|
], ObjectRef.prototype, "description", void 0);
|
20
|
-
ObjectRef = tslib_1.__decorate([
|
21
|
+
exports.ObjectRef = ObjectRef = tslib_1.__decorate([
|
21
22
|
(0, type_graphql_1.InputType)()
|
22
23
|
], ObjectRef);
|
23
|
-
exports.ObjectRef = ObjectRef;
|
24
24
|
//# sourceMappingURL=object-ref.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"object-ref.js","sourceRoot":"","sources":["../../../server/service/common-types/object-ref.ts"],"names":[],"mappings":";;;;AAAA,+CAAmD;AAG5C,IAAM,SAAS,GAAf,MAAM,SAAS;CASrB,CAAA;
|
1
|
+
{"version":3,"file":"object-ref.js","sourceRoot":"","sources":["../../../server/service/common-types/object-ref.ts"],"names":[],"mappings":";;;;AAAA,+CAAmD;AAG5C,IAAM,SAAS,GAAf,MAAM,SAAS;CASrB,CAAA;AATY,8BAAS;AAEpB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;qCACnC;AAGV;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;uCACxC;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;8CACxC;oBART,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CASrB","sourcesContent":["import { InputType, Field, ID } from 'type-graphql'\n\n@InputType()\nexport class ObjectRef {\n @Field(() => ID, { description: 'Field id' })\n id: string\n\n @Field({ nullable: true, description: 'Field name' })\n name?: string\n\n @Field({ nullable: true, description: 'Field description' })\n description?: string\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scalar-any.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-any.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEjD,SAAS,WAAW,CAAC,GAAG;IACtB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACjC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG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7C,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,6DAA6D;IAC1E,SAAS,CAAC,KAAK;QACb,oEAAoE;QACpE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,UAAU,CAAC,KAAK;QACd,oEAAoE;QACpE,OAAO,KAAK,CAAA;IACd,CAAC;IACD,YAAY,CAAC,GAAG;QACd,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\n\nfunction parseObject(ast) {\n const value = Object.create(null)\n ast.fields.forEach(field => {\n value[field.name.value] = parseAst(field.value)\n })\n return value\n}\n\nfunction parseAst(ast) {\n switch (ast.kind) {\n case Kind.INT:\n return parseInt(ast.value)\n case Kind.FLOAT:\n return parseFloat(ast.value)\n case Kind.BOOLEAN:\n return ast.value\n case Kind.STRING:\n return ast.value\n case Kind.LIST:\n return ast.values.map(parseAst)\n case Kind.OBJECT:\n return parseObject(ast)\n default:\n return null\n }\n}\n\nexport const ScalarAny = new GraphQLScalarType({\n name: 'Any',\n description: 'Any Scalar type (String, Boolean, Int, Float, Object, List)',\n serialize(value) {\n // Implement your own behavior here by setting the 'result' variable\n return value\n },\n parseValue(value) {\n // Implement your own behavior here by setting the 'result' variable\n return value\n },\n parseLiteral(ast) {\n return parseAst(ast)\n }\n})\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scalar-date.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-date.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEpC,QAAA,UAAU,GAAG,IAAI,2BAAiB,CAAC;IAC9C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,yBAAyB;IACtC,UAAU,CAAC,KAAK;QACd,OAAO,IAAI,IAAI,CAAC,KAAwB,CAAC,CAAA,CAAC,wBAAwB;IACpE,CAAC;IACD,SAAS,CAAC,KAAK;QACb;;;WAGG;QACH,OAAO,IAAI,IAAI,CAAC,KAAY,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,2BAA2B;IACrE,CAAC;IACD,YAAY,CAAC,GAAG;QACd,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,GAAG,EAAE;
|
1
|
+
{"version":3,"file":"scalar-date.js","sourceRoot":"","sources":["../../../server/service/common-types/scalar-date.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAEpC,QAAA,UAAU,GAAG,IAAI,2BAAiB,CAAC;IAC9C,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,yBAAyB;IACtC,UAAU,CAAC,KAAK;QACd,OAAO,IAAI,IAAI,CAAC,KAAwB,CAAC,CAAA,CAAC,wBAAwB;IACpE,CAAC;IACD,SAAS,CAAC,KAAK;QACb;;;WAGG;QACH,OAAO,IAAI,IAAI,CAAC,KAAY,CAAC,CAAC,OAAO,EAAE,CAAA,CAAC,2BAA2B;IACrE,CAAC;IACD,YAAY,CAAC,GAAG;QACd,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,GAAG,EAAE,CAAC;YAC1B,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA,CAAC,uCAAuC;QACrE,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { GraphQLScalarType, Kind } from 'graphql'\n\nexport const ScalarDate = new GraphQLScalarType({\n name: 'Date',\n description: 'Date custom scalar type',\n parseValue(value) {\n return new Date(value as string | number) // value from the client\n },\n serialize(value) {\n /**\n * Note: Allow value to be date only like \"2021-01-31\" to be serialize before passing data to clientside for TypeGraphql.\n * Usage: When database column datatype is \"date\" and data do not contain any time component.\n */\n return new Date(value as any).getTime() // value sent to the client\n },\n parseLiteral(ast) {\n if (ast.kind === Kind.INT) {\n return new Date(+ast.value) // ast value is always in string format\n }\n return null\n }\n})\n"]}
|
@@ -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,0DAA2D;AAE3D,MAAM,SAAS,GAAG,aAAa,CAAA;AAElB,QAAA,4BAA4B,GAAG,IAAA,qBAAG,EAAA;iBAC9B,SAAS;GACvB,CAAA;AACI,MAAM,4BAA4B,GAAG,CAAC,MAAqB,EAAE,EAAE,CACpE,IAAA,iBAAS,EAAC,MAAM,EAAE;IAChB,CAAC,kBAAU,CAAC,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE;;QACpD,MAAM,oBAAoB,GAAG,MAAA,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,0CAAG,CAAC,CAAC,CAAA;QAC9E,IAAI,oBAAoB,EAAE;
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../server/service/directive-transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,qCAA6D;AAC7D,sEAA6B;AAE7B,gDAA0E;AAE1E,0DAA2D;AAE3D,MAAM,SAAS,GAAG,aAAa,CAAA;AAElB,QAAA,4BAA4B,GAAG,IAAA,qBAAG,EAAA;iBAC9B,SAAS;GACvB,CAAA;AACI,MAAM,4BAA4B,GAAG,CAAC,MAAqB,EAAE,EAAE,CACpE,IAAA,iBAAS,EAAC,MAAM,EAAE;IAChB,CAAC,kBAAU,CAAC,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE;;QACpD,MAAM,oBAAoB,GAAG,MAAA,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,0CAAG,CAAC,CAAC,CAAA;QAC9E,IAAI,oBAAoB,EAAE,CAAC;YACzB,MAAM,EAAE,OAAO,GAAG,8BAAoB,EAAE,GAAG,WAAW,CAAA;YAEtD,WAAW,CAAC,OAAO,GAAG,KAAK,WAAW,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI;gBAC/D,OAAO,MAAM,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,WAAW,CAAC,KAAK,EAAC,EAAE,EAAC,EAAE;oBACtD,0FAA0F;oBAC1F,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;oBAE1E,IAAI,CAAC,KAAK,mCACL,OAAO,CAAC,KAAK,KAChB,EAAE,GACH,CAAA;oBACD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAA;oBAElB,IAAI,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;oBAE/D,OAAO,MAAM,CAAA;gBACf,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA;YAED,OAAO,WAAW,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'\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"]}
|
@@ -61,6 +61,7 @@ let DomainMutation = class DomainMutation {
|
|
61
61
|
return result;
|
62
62
|
}
|
63
63
|
};
|
64
|
+
exports.DomainMutation = DomainMutation;
|
64
65
|
tslib_1.__decorate([
|
65
66
|
(0, type_graphql_1.Directive)('@transaction'),
|
66
67
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
@@ -123,8 +124,7 @@ tslib_1.__decorate([
|
|
123
124
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
124
125
|
tslib_1.__metadata("design:returntype", Promise)
|
125
126
|
], DomainMutation.prototype, "updateSecureIPList", null);
|
126
|
-
DomainMutation = tslib_1.__decorate([
|
127
|
+
exports.DomainMutation = DomainMutation = tslib_1.__decorate([
|
127
128
|
(0, type_graphql_1.Resolver)(domain_1.Domain)
|
128
129
|
], DomainMutation);
|
129
|
-
|
130
|
-
//# sourceMappingURL=domain-Mutation.js.map
|
130
|
+
//# sourceMappingURL=domain-mutation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"domain-mutation.js","sourceRoot":"","sources":["../../../server/service/domain/domain-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAyF;AACzF,qCAAwC;AAExC,iDAA+C;AAE/C,0DAA2D;AAE3D,qCAAyC;AACzC,iDAA4C;AAC5C,kDAA8C;AAGvC,IAAM,cAAc,GAApB,MAAM,cAAc;IAInB,AAAN,KAAK,CAAC,YAAY,CAAqB,WAAwB;QAC7D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,WAAW,CAAA;QACzC,MAAM,UAAU,GAAuB,IAAA,wBAAa,EAAC,eAAM,CAAC,CAAA;QAC5D,MAAM,SAAS,GAAW,IAAA,eAAO,EAAC,IAAI,CAAC,CAAA;QA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AO,EAAE,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAA;;qDAAQ,0BAAW;;kDAYhG;AAOK;IALL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE;QAC5B,WAAW,EAAE,wEAAwE;KACtF,CAAC;IACmB,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC,CAAA;;;;mDAyBvD;AAOK;IALL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,wBAAS,EACR,2GAA2G,CAC5G;IACA,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAEvG,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,2BAAY,CAAC,CAAA;IACnC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAYP;yBA1GU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,eAAM,CAAC;GACJ,cAAc,CA2G1B","sourcesContent":["import { Arg, Args, Ctx, Directive, Mutation, Query, Resolver, Root } from 'type-graphql'\nimport { In, Repository } from 'typeorm'\n\nimport { slugger } from '@things-factory/utils'\n\nimport { getRepository } from '../../initializers/database'\n\nimport { Domain, IPList } from './domain'\nimport { DomainPatch } from './domain-types'\nimport { ScalarObject } from '../common-types'\n\n@Resolver(Domain)\nexport class DomainMutation {\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Domain, { description: 'To create domain (Only superuser is granted this privilege.)' })\n async createDomain(@Arg('domainInput') domainInput: DomainPatch) {\n const { name, description } = domainInput\n const domainRepo: Repository<Domain> = getRepository(Domain)\n const subdomain: string = slugger(name)\n\n const domain: Domain = await domainRepo.findOneBy({ subdomain })\n if (domain) {\n throw new Error('domain is duplicated')\n }\n\n return await domainRepo.save({ name, description, subdomain })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Domain, { description: 'To delete domain (Only superuser is granted this privilege.)' })\n async deleteDomain(@Arg('name') name: string) {\n return await getRepository(Domain).delete({ name })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, {\n description: 'To delete multiple domains (Only superuser is granted this privilege.)'\n })\n async deleteDomains(@Arg('names', () => [String]) names: string[]) {\n const domains: Domain[] = await getRepository(Domain).find({ where: { name: In(names) } })\n const domainIds: string[] = domains.map(domain => domain.id)\n\n await getRepository(Domain).delete({ id: In(domainIds) })\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Domain, {\n description: 'To update domain (Only superuser is granted this privilege.)'\n })\n async updateDomain(@Arg('name') name: string, @Arg('patch', () => DomainPatch) patch: DomainPatch) {\n const repository = getRepository(Domain)\n const domain: Domain = await repository.findOneBy({ name })\n\n if (patch.parent && patch.parent.id == domain.id) {\n delete patch.parent\n }\n\n return await repository.save({\n ...domain,\n ...patch\n } as any)\n }\n\n @Directive('@transaction')\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(returns => Boolean, {\n description: 'To update multiple domains (Only superuser is granted this privilege.)'\n })\n async updateDomains(@Arg('patches', () => [DomainPatch]) patches: DomainPatch[]): Promise<boolean> {\n const domainRepo: Repository<Domain> = getRepository(Domain)\n\n const patchIds = patches.filter((patch: any) => patch.id)\n\n if (patchIds.length > 0) {\n patchIds.forEach(async updateRecord => {\n const domain: Domain = await domainRepo.findOne({ where: { id: updateRecord.id } })\n\n if (updateRecord.name) {\n updateRecord.subdomain = slugger(updateRecord.name)\n }\n\n if (updateRecord.parent && updateRecord.parent.id == domain.id) {\n delete updateRecord.parent\n }\n\n await domainRepo.save({\n ...domain,\n ...updateRecord\n } as any)\n })\n }\n\n return true\n }\n\n @Directive('@transaction')\n @Directive(\n '@privilege(category: \"security\", privilege: \"mutation\", domainOwnerGranted: true, superUserGranted: true)'\n )\n @Mutation(returns => ScalarObject, { nullable: true, description: 'To update secure IP list for domain' })\n async updateSecureIPList(\n @Arg('iplist', type => ScalarObject) iplist: IPList,\n @Ctx() context: any\n ): Promise<IPList | null> {\n const { domain } = context.state\n const repository = getRepository(Domain)\n // const domain: Domain = await repository.findOneBy({ id })\n\n const { iplist: result } = await repository.save({\n ...domain,\n iplist\n } as any)\n\n return result\n }\n}\n"]}
|
@@ -32,6 +32,7 @@ let DomainQuery = class DomainQuery {
|
|
32
32
|
return domain.parentId && (await (0, database_1.getRepository)(domain_1.Domain).findOneBy({ id: domain.parentId }));
|
33
33
|
}
|
34
34
|
};
|
35
|
+
exports.DomainQuery = DomainQuery;
|
35
36
|
tslib_1.__decorate([
|
36
37
|
(0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
|
37
38
|
(0, type_graphql_1.Query)(returns => domain_1.Domain, { description: 'To fetch domain' }),
|
@@ -65,8 +66,7 @@ tslib_1.__decorate([
|
|
65
66
|
tslib_1.__metadata("design:paramtypes", [domain_1.Domain]),
|
66
67
|
tslib_1.__metadata("design:returntype", Promise)
|
67
68
|
], DomainQuery.prototype, "parent", null);
|
68
|
-
DomainQuery = tslib_1.__decorate([
|
69
|
+
exports.DomainQuery = DomainQuery = tslib_1.__decorate([
|
69
70
|
(0, type_graphql_1.Resolver)(domain_1.Domain)
|
70
71
|
], DomainQuery);
|
71
|
-
exports.DomainQuery = DomainQuery;
|
72
72
|
//# sourceMappingURL=domain-query.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain-query.js","sourceRoot":"","sources":["../../../server/service/domain/domain-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwG;AAGxG,0DAA2D;AAC3D,uGAA8F;AAE9F,2DAAsD;AACtD,qCAAyC;AACzC,iDAA2C;AAC3C,kD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AI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yCAIzC;AAIK;IAFL,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,yBAAU,EAAE,EAAE,WAAW,EAAE,kEAAkE,EAAE,CAAC;IACnG,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,sBAAS;;0CAWtC;AAIK;IAFL,IAAA,wBAAS,EAAC,wGAAwG,CAAC;IACnH,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/D,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAGxB;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,eAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,eAAM;;yCAElC;sBAlCU,WAAW;IADvB,IAAA,uBAAQ,EAAC,eAAM,CAAC;GACJ,WAAW,CAmCvB","sourcesContent":["import { Arg, Args, Ctx, Directive, Mutation, Query, Resolver, FieldResolver, Root } from 'type-graphql'\nimport { In, Repository } from 'typeorm'\n\nimport { getRepository } from '../../initializers/database'\nimport { getQueryBuilderFromListParams } from '../../utils/get-query-builder-from-list-params'\n\nimport { ListParam } from '../common-types/list-param'\nimport { Domain, IPList } from './domain'\nimport { DomainList } from './domain-types'\nimport { ScalarObject } from '../common-types'\n\n@Resolver(Domain)\nexport class DomainQuery {\n @Directive('@privilege(superUserGranted: true)')\n @Query(returns => Domain, { description: 'To fetch domain' })\n async domain(@Arg('id') id: string, @Ctx() context: any): Promise<Domain> {\n const repository = getRepository(Domain)\n\n return await repository.findOneBy({ id })\n }\n\n @Directive('@privilege(superUserGranted: true)')\n @Query(returns => DomainList, { description: 'To fetch all domains (Only superuser is granted this privilege.)' })\n async domains(@Args() params: ListParam, @Ctx() context: any): Promise<DomainList> {\n const queryBuilder = await getQueryBuilderFromListParams({\n repository: getRepository(Domain),\n alias: 'ContactPoint',\n params,\n searchables: ['name', 'description', 'subdomain']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true, superUserGranted: true)')\n @Query(returns => ScalarObject, { nullable: true, description: 'To fetch domain' })\n async secureIPList(@Ctx() context: any): Promise<IPList | null> {\n const { domain } = context.state\n return domain.iplist\n }\n\n @FieldResolver(type => Domain)\n async parent(@Root() domain: Domain): Promise<Domain> {\n return domain.parentId && (await getRepository(Domain).findOneBy({ id: domain.parentId }))\n }\n}\n"]}
|
@@ -7,6 +7,7 @@ const domain_1 = require("./domain");
|
|
7
7
|
const common_types_1 = require("../common-types");
|
8
8
|
let DomainInput = class DomainInput {
|
9
9
|
};
|
10
|
+
exports.DomainInput = DomainInput;
|
10
11
|
tslib_1.__decorate([
|
11
12
|
(0, type_graphql_1.Field)(),
|
12
13
|
tslib_1.__metadata("design:type", String)
|
@@ -15,12 +16,12 @@ tslib_1.__decorate([
|
|
15
16
|
(0, type_graphql_1.Field)({ nullable: true }),
|
16
17
|
tslib_1.__metadata("design:type", String)
|
17
18
|
], DomainInput.prototype, "description", void 0);
|
18
|
-
DomainInput = tslib_1.__decorate([
|
19
|
+
exports.DomainInput = DomainInput = tslib_1.__decorate([
|
19
20
|
(0, type_graphql_1.InputType)()
|
20
21
|
], DomainInput);
|
21
|
-
exports.DomainInput = DomainInput;
|
22
22
|
let DomainPatch = class DomainPatch {
|
23
23
|
};
|
24
|
+
exports.DomainPatch = DomainPatch;
|
24
25
|
tslib_1.__decorate([
|
25
26
|
(0, type_graphql_1.Field)({ nullable: true }),
|
26
27
|
tslib_1.__metadata("design:type", String)
|
@@ -73,12 +74,12 @@ tslib_1.__decorate([
|
|
73
74
|
(0, type_graphql_1.Field)({ nullable: true }),
|
74
75
|
tslib_1.__metadata("design:type", String)
|
75
76
|
], DomainPatch.prototype, "theme", void 0);
|
76
|
-
DomainPatch = tslib_1.__decorate([
|
77
|
+
exports.DomainPatch = DomainPatch = tslib_1.__decorate([
|
77
78
|
(0, type_graphql_1.InputType)()
|
78
79
|
], DomainPatch);
|
79
|
-
exports.DomainPatch = DomainPatch;
|
80
80
|
let DomainList = class DomainList {
|
81
81
|
};
|
82
|
+
exports.DomainList = DomainList;
|
82
83
|
tslib_1.__decorate([
|
83
84
|
(0, type_graphql_1.Field)(type => [domain_1.Domain], { nullable: true }),
|
84
85
|
tslib_1.__metadata("design:type", Array)
|
@@ -87,8 +88,7 @@ tslib_1.__decorate([
|
|
87
88
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
88
89
|
tslib_1.__metadata("design:type", Number)
|
89
90
|
], DomainList.prototype, "total", void 0);
|
90
|
-
DomainList = tslib_1.__decorate([
|
91
|
+
exports.DomainList = DomainList = tslib_1.__decorate([
|
91
92
|
(0, type_graphql_1.ObjectType)()
|
92
93
|
], DomainList);
|
93
|
-
exports.DomainList = DomainList;
|
94
94
|
//# sourceMappingURL=domain-types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain-types.js","sourceRoot":"","sources":["../../../server/service/domain/domain-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,qCAAyC;AACzC,kDAAyD;AAGlD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;
|
1
|
+
{"version":3,"file":"domain-types.js","sourceRoot":"","sources":["../../../server/service/domain/domain-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,qCAAyC;AACzC,kDAAyD;AAGlD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;IADC,IAAA,oBAAK,GAAE;;yCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,Q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AAC;;0CACZ;sBAtCH,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CAuCvB;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAU;CAMtB,CAAA;AANY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,eAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC7B;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC1B;qBALF,UAAU;IADtB,IAAA,yBAAU,GAAE;GACA,UAAU,CAMtB","sourcesContent":["import { ObjectType, InputType, Field, Int } from 'type-graphql'\nimport { Domain, IPList } from './domain'\nimport { ObjectRef, ScalarObject } from '../common-types'\n\n@InputType()\nexport class DomainInput {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class DomainPatch {\n @Field({ 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 timezone?: string\n\n @Field({ nullable: true })\n systemFlag?: Boolean\n\n @Field({ nullable: true })\n subdomain?: string\n\n @Field({ nullable: true })\n owner?: string\n\n @Field(type => ObjectRef, { nullable: true })\n parent?: ObjectRef\n\n @Field({ nullable: true })\n brandName?: string\n\n @Field({ nullable: true })\n brandImage?: string\n\n @Field({ nullable: true })\n contentImage?: string\n\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @Field({ nullable: true })\n theme?: string\n}\n\n@ObjectType()\nexport class DomainList {\n @Field(type => [Domain], { nullable: true })\n items: Domain[]\n\n @Field(type => Int, { nullable: true })\n total: number\n}\n"]}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var Domain_1;
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
3
|
exports.Domain = void 0;
|
5
4
|
const tslib_1 = require("tslib");
|
@@ -12,8 +11,9 @@ const generatedStrategy = ['uuid', 'rowid', 'increment', 'identity'];
|
|
12
11
|
const domainPrimaryOption = env_1.config.get('domainPrimaryOption');
|
13
12
|
const domainPrimaryType = domainPrimaryOption === null || domainPrimaryOption === void 0 ? void 0 : domainPrimaryOption.type;
|
14
13
|
const domainPrimaryStrategy = domainPrimaryOption === null || domainPrimaryOption === void 0 ? void 0 : domainPrimaryOption.strategy;
|
15
|
-
let Domain =
|
14
|
+
let Domain = class Domain {
|
16
15
|
};
|
16
|
+
exports.Domain = Domain;
|
17
17
|
tslib_1.__decorate([
|
18
18
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
19
19
|
(0, typeorm_1.Column)(domainPrimaryOption
|
@@ -80,7 +80,7 @@ tslib_1.__decorate([
|
|
80
80
|
], Domain.prototype, "subdomain", void 0);
|
81
81
|
tslib_1.__decorate([
|
82
82
|
(0, type_graphql_1.Field)({ nullable: true }),
|
83
|
-
(0, typeorm_1.ManyToOne)(type =>
|
83
|
+
(0, typeorm_1.ManyToOne)(type => Domain, { nullable: true }),
|
84
84
|
tslib_1.__metadata("design:type", Domain)
|
85
85
|
], Domain.prototype, "parent", void 0);
|
86
86
|
tslib_1.__decorate([
|
@@ -88,8 +88,8 @@ tslib_1.__decorate([
|
|
88
88
|
tslib_1.__metadata("design:type", String)
|
89
89
|
], Domain.prototype, "parentId", void 0);
|
90
90
|
tslib_1.__decorate([
|
91
|
-
(0, typeorm_1.OneToMany)(type =>
|
92
|
-
(0, type_graphql_1.Field)(type =>
|
91
|
+
(0, typeorm_1.OneToMany)(type => Domain, domain => domain.parent),
|
92
|
+
(0, type_graphql_1.Field)(type => Domain, { nullable: true }),
|
93
93
|
tslib_1.__metadata("design:type", Array)
|
94
94
|
], Domain.prototype, "children", void 0);
|
95
95
|
tslib_1.__decorate([
|
@@ -142,7 +142,7 @@ tslib_1.__decorate([
|
|
142
142
|
(0, type_graphql_1.Field)({ nullable: true }),
|
143
143
|
tslib_1.__metadata("design:type", Date)
|
144
144
|
], Domain.prototype, "deletedAt", void 0);
|
145
|
-
Domain =
|
145
|
+
exports.Domain = Domain = tslib_1.__decorate([
|
146
146
|
(0, typeorm_1.Entity)(),
|
147
147
|
(0, typeorm_1.Index)('ix_domain_0', (domain) => [domain.subdomain, domain.deletedAt], {
|
148
148
|
unique: true,
|
@@ -150,5 +150,4 @@ Domain = Domain_1 = tslib_1.__decorate([
|
|
150
150
|
}),
|
151
151
|
(0, type_graphql_1.ObjectType)()
|
152
152
|
], Domain);
|
153
|
-
exports.Domain = Domain;
|
154
153
|
//# sourceMappingURL=domain.js.map
|