@things-factory/product-base 7.0.1-beta.14 → 7.0.1-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/service/product/product-query.js +8 -5
- package/dist-server/service/product/product-query.js.map +1 -1
- package/dist-server/service/product-bundle/product-bundle-query.js +2 -2
- package/dist-server/service/product-bundle/product-bundle-query.js.map +1 -1
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js +2 -2
- package/dist-server/service/product-bundle-setting/product-bundle-setting-query.js.map +1 -1
- package/dist-server/service/product-combination/product-combination-query.js +1 -1
- package/dist-server/service/product-combination/product-combination-query.js.map +1 -1
- package/dist-server/service/product-combination/product-combination.js +2 -2
- package/dist-server/service/product-combination/product-combination.js.map +1 -1
- package/dist-server/service/product-combination-setting/product-combination-setting-query.js +2 -2
- package/dist-server/service/product-combination-setting/product-combination-setting-query.js.map +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js +1 -1
- package/dist-server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.js.map +1 -1
- package/dist-server/service/product-set/product-set-mutation.d.ts +1 -19
- package/dist-server/service/product-set/product-set-mutation.js.map +1 -1
- package/dist-server/service/product-set/product-set-query.js +2 -2
- package/dist-server/service/product-set/product-set-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/product/product-query.ts +25 -6
- package/server/service/product-bundle/product-bundle-query.ts +5 -2
- package/server/service/product-bundle-setting/product-bundle-setting-query.ts +2 -2
- package/server/service/product-combination/product-combination-query.ts +1 -1
- package/server/service/product-combination/product-combination.ts +2 -2
- package/server/service/product-combination-setting/product-combination-setting-query.ts +2 -2
- package/server/service/product-detail-bizplace-setting/product-detail-bizplace-setting-query.ts +1 -1
- package/server/service/product-set/product-set-mutation.ts +5 -1
- package/server/service/product-set/product-set-query.ts +8 -2
|
@@ -73,7 +73,7 @@ exports.ProductSetQuery = ProductSetQuery;
|
|
|
73
73
|
tslib_1.__decorate([
|
|
74
74
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query", domainOwnerGranted: true)'),
|
|
75
75
|
(0, type_graphql_1.Query)(returns => product_set_types_1.ProductSetList),
|
|
76
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
76
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
77
77
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
78
78
|
tslib_1.__metadata("design:type", Function),
|
|
79
79
|
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
@@ -82,7 +82,7 @@ tslib_1.__decorate([
|
|
|
82
82
|
tslib_1.__decorate([
|
|
83
83
|
(0, type_graphql_1.Directive)('@privilege(category: "order", privilege: "query", domainOwnerGranted: true)'),
|
|
84
84
|
(0, type_graphql_1.Query)(returns => product_set_types_1.ProductSetList),
|
|
85
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
85
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
86
86
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
87
87
|
tslib_1.__metadata("design:type", Function),
|
|
88
88
|
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-set-query.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qCAAsD;AAEtD,yDAAgD;AAChD,uDAAsF;AACtF,iDAAuH;AAEvH,+CAA0C;AAC1C,2DAAoD;AAG7C,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"product-set-query.js","sourceRoot":"","sources":["../../../server/service/product-set/product-set-query.ts"],"names":[],"mappings":";;;;AAAA,+C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AA,IAAA,kBAAG,GAAE,CAAA;;;;iDAQjD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BArGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAsG3B","sourcesContent":["import { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { Brackets, SelectQueryBuilder } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace, getCompanyBizplace, getMyBizplace } from '@things-factory/biz-base'\nimport { buildCondition, buildQuery, convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'\n\nimport { ProductSet } from './product-set'\nimport { ProductSetList } from './product-set-types'\n\n@Resolver(ProductSet)\nexport class ProductSetQuery {\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSetList)\n async myBizplaceProductSets(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<ProductSetList> {\n const { domain, user } = context.state\n const qb: SelectQueryBuilder<ProductSet> = getRepository(ProductSet).createQueryBuilder()\n\n const productFilters = params.filters.filter(x => x.name == 'product_set_info')\n const filters = params.filters.filter(x => x.name != 'product_set_info')\n const productFilterColumns = ['name', 'description']\n\n if (!params.filters.find(filter => filter.name === 'bizplace_id')) {\n const companyBizplace: Bizplace = await getCompanyBizplace(domain, user)\n const myBizplace: Bizplace = await getMyBizplace(domain, user)\n params.filters = [...filters, { name: 'bizplace_id', operator: 'in', value: [companyBizplace.id, myBizplace.id] }]\n }\n\n buildQuery(qb, params, context, { domainRef: false })\n if (productFilters && productFilters.length > 0) {\n let productInfo = productFilters[0]\n qb.andWhere(\n new Brackets(qb2 => {\n productFilterColumns.forEach(filter => {\n const condition = buildCondition(\n qb.alias,\n filter,\n productInfo.operator,\n productInfo.value,\n productInfo.relation,\n Object.keys(qb.getParameters()).length\n )\n\n qb2.orWhere(condition.clause, condition.parameters)\n })\n })\n )\n }\n\n const [items, total] = await qb\n .leftJoinAndSelect('ProductSet.bizplace', 'Bizplace')\n .leftJoinAndSelect('ProductSet.creator', 'Creator')\n .leftJoinAndSelect('ProductSet.updater', 'Updater')\n .leftJoinAndSelect('ProductSet.product', 'Product')\n .getManyAndCount()\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSetList)\n async productSets(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<ProductSetList> {\n const { domain, user } = context.state\n\n if (!params.filters.find((filter: any) => filter.name === 'bizplace_id')) {\n let bizplaceFilter = params.filters.find((filter: any) => filter.name === 'bizplace_id')\n const companyBizplace: Bizplace = await getCompanyBizplace(domain, user)\n const myBizplace: Bizplace = await getMyBizplace(domain, user)\n\n bizplaceFilter = { name: 'bizplace_id', operator: 'in', value: [companyBizplace.id, myBizplace.id] }\n }\n\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(ProductSet).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater', 'product']\n })\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"order\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => ProductSet)\n async productSet(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<ProductSet> {\n const { domain, user } = context.state\n const repository = getRepository(ProductSet)\n\n return await repository.findOne({\n where: { domain: { id: domain.id }, name },\n relations: ['domain', 'creator', 'updater']\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() productSet: ProductSet): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: productSet.domainId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() productSet: ProductSet): Promise<User> {\n return await getRepository(User).findOneBy({ id: productSet.creatorId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() productSet: ProductSet): Promise<User> {\n return await getRepository(User).findOneBy({ id: productSet.updaterId })\n }\n}\n"]}
|