@things-factory/biz-base 5.0.1 → 5.0.14

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.
Files changed (69) hide show
  1. package/dist-server/index.js +4 -17
  2. package/dist-server/index.js.map +1 -1
  3. package/dist-server/middlewares/index.js.map +1 -1
  4. package/dist-server/migrations/index.js.map +1 -1
  5. package/dist-server/service/biz-option/biz-option-mutation.js +27 -38
  6. package/dist-server/service/biz-option/biz-option-mutation.js.map +1 -1
  7. package/dist-server/service/biz-option/biz-option-query.js +14 -25
  8. package/dist-server/service/biz-option/biz-option-query.js.map +1 -1
  9. package/dist-server/service/biz-option/biz-option-types.js +24 -32
  10. package/dist-server/service/biz-option/biz-option-types.js.map +1 -1
  11. package/dist-server/service/biz-option/biz-option.js +22 -30
  12. package/dist-server/service/biz-option/biz-option.js.map +1 -1
  13. package/dist-server/service/biz-option/index.js.map +1 -1
  14. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js +27 -38
  15. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js.map +1 -1
  16. package/dist-server/service/biz-option-detail/biz-option-detail-query.js +13 -24
  17. package/dist-server/service/biz-option-detail/biz-option-detail-query.js.map +1 -1
  18. package/dist-server/service/biz-option-detail/biz-option-detail-types.js +20 -28
  19. package/dist-server/service/biz-option-detail/biz-option-detail-types.js.map +1 -1
  20. package/dist-server/service/biz-option-detail/biz-option-detail.js +20 -28
  21. package/dist-server/service/biz-option-detail/biz-option-detail.js.map +1 -1
  22. package/dist-server/service/biz-option-detail/index.js.map +1 -1
  23. package/dist-server/service/bizplace/bizplace-mutation.js +38 -49
  24. package/dist-server/service/bizplace/bizplace-mutation.js.map +1 -1
  25. package/dist-server/service/bizplace/bizplace-query.js +65 -76
  26. package/dist-server/service/bizplace/bizplace-query.js.map +1 -1
  27. package/dist-server/service/bizplace/bizplace-types.js +53 -61
  28. package/dist-server/service/bizplace/bizplace-types.js.map +1 -1
  29. package/dist-server/service/bizplace/bizplace.js +33 -41
  30. package/dist-server/service/bizplace/bizplace.js.map +1 -1
  31. package/dist-server/service/bizplace/index.js.map +1 -1
  32. package/dist-server/service/company/company-mutation.js +32 -43
  33. package/dist-server/service/company/company-mutation.js.map +1 -1
  34. package/dist-server/service/company/company-query.js +23 -38
  35. package/dist-server/service/company/company-query.js.map +1 -1
  36. package/dist-server/service/company/company-types.js +42 -50
  37. package/dist-server/service/company/company-types.js.map +1 -1
  38. package/dist-server/service/company/company.js +38 -46
  39. package/dist-server/service/company/company.js.map +1 -1
  40. package/dist-server/service/company/index.js.map +1 -1
  41. package/dist-server/service/contact-point/contact-point-mutation.js +33 -44
  42. package/dist-server/service/contact-point/contact-point-mutation.js.map +1 -1
  43. package/dist-server/service/contact-point/contact-point-query.js +14 -25
  44. package/dist-server/service/contact-point/contact-point-query.js.map +1 -1
  45. package/dist-server/service/contact-point/contact-point-types.js +80 -88
  46. package/dist-server/service/contact-point/contact-point-types.js.map +1 -1
  47. package/dist-server/service/contact-point/contact-point.js +48 -56
  48. package/dist-server/service/contact-point/contact-point.js.map +1 -1
  49. package/dist-server/service/contact-point/index.js.map +1 -1
  50. package/dist-server/service/index.js +13 -26
  51. package/dist-server/service/index.js.map +1 -1
  52. package/dist-server/service/worker/index.js.map +1 -1
  53. package/dist-server/service/worker/worker-mutation.js +32 -43
  54. package/dist-server/service/worker/worker-mutation.js.map +1 -1
  55. package/dist-server/service/worker/worker-query.js +14 -25
  56. package/dist-server/service/worker/worker-query.js.map +1 -1
  57. package/dist-server/service/worker/worker-types.js +28 -36
  58. package/dist-server/service/worker/worker-types.js.map +1 -1
  59. package/dist-server/service/worker/worker.js +22 -30
  60. package/dist-server/service/worker/worker.js.map +1 -1
  61. package/dist-server/tsconfig.tsbuildinfo +1 -0
  62. package/dist-server/utils/get-permitted-bizplaces.js.map +1 -1
  63. package/dist-server/utils/index.js +2 -15
  64. package/dist-server/utils/index.js.map +1 -1
  65. package/package.json +3 -3
  66. package/server/service/bizplace/bizplace-query.ts +28 -27
  67. package/server/service/company/company-query.ts +0 -5
  68. package/server/service/contact-point/contact-point-mutation.ts +1 -1
  69. package/server/utils/get-permitted-bizplaces.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-detail-query.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8D;AAC9D,qCAAuC;AAEvC,iDAAoE;AAEpE,2DAAqD;AACrD,uEAA+D;AAG/D,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAE/B,KAAK,CAAC,eAAe,CAAc,IAAY,EAAS,OAAY;QAClE,OAAO,MAAM,IAAA,uBAAa,EAAC,mCAAe,CAAC,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;YAC7C,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC;SACzD,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,gBAAgB,CAAS,MAAiB;QAC9C,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,mCAAe,CAAC,CAAC,YAAY,iCACnE,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,IACxD,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAhBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,mCAAe,CAAC;IACX,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAKtD;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6CAAmB,CAAC;IACd,WAAA,IAAA,mBAAI,GAAE,CAAA;;yDAAS,iBAAS,oBAAT,iBAAS;;4DAO/C;AAjBU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,mCAAe,CAAC;GACb,oBAAoB,CAkBhC;AAlBY,oDAAoB"}
1
+ {"version":3,"file":"biz-option-detail-query.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAA8D;AAC9D,qCAAuC;AAEvC,iDAAoE;AAEpE,2DAAqD;AACrD,uEAA+D;AAG/D,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAE/B,KAAK,CAAC,eAAe,CAAc,IAAY,EAAS,OAAY;QAClE,OAAO,MAAM,IAAA,uBAAa,EAAC,mCAAe,CAAC,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;YAC7C,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC;SACzD,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,gBAAgB,CAAS,MAAiB;QAC9C,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,mCAAe,CAAC,CAAC,YAAY,iCACnE,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,IACxD,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAhBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,mCAAe,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAKtD;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6CAAmB,CAAC;IACd,mBAAA,IAAA,mBAAI,GAAE,CAAA;;iEAAS,iBAAS,oBAAT,iBAAS;;4DAO/C;AAjBU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,mCAAe,CAAC;GACb,oBAAoB,CAkBhC;AAlBY,oDAAoB","sourcesContent":["import { Arg, Args, Ctx, Query, Resolver } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { convertListParams, ListParam } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\nimport { BizOptionDetailList } from './biz-option-detail-types'\n\n@Resolver(BizOptionDetail)\nexport class BizOptionDetailQuery {\n @Query(returns => BizOptionDetail)\n async bizOptionDetail(@Arg('name') name: string, @Ctx() context: any): Promise<BizOptionDetail> {\n return await getRepository(BizOptionDetail).findOne({\n where: { domain: context.state.domain, name },\n relations: ['domain', 'bizOption', 'creator', 'updater']\n })\n }\n\n @Query(returns => BizOptionDetailList)\n async bizOptionDetails(@Args() params: ListParam): Promise<BizOptionDetailList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(BizOptionDetail).findAndCount({\n ...convertedParams,\n relations: ['domain', 'bizOption', 'creator', 'updater']\n })\n return { items, total }\n }\n}\n"]}
@@ -1,66 +1,58 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  var _a;
12
3
  Object.defineProperty(exports, "__esModule", { value: true });
13
4
  exports.BizOptionDetailPatch = exports.NewBizOptionDetail = exports.BizOptionDetailList = void 0;
5
+ const tslib_1 = require("tslib");
14
6
  const type_graphql_1 = require("type-graphql");
15
7
  const shell_1 = require("@things-factory/shell");
16
8
  const biz_option_detail_1 = require("./biz-option-detail");
17
9
  let BizOptionDetailList = class BizOptionDetailList {
18
10
  };
19
- __decorate([
11
+ tslib_1.__decorate([
20
12
  (0, type_graphql_1.Field)(type => [biz_option_detail_1.BizOptionDetail], { nullable: true }),
21
- __metadata("design:type", Array)
13
+ tslib_1.__metadata("design:type", Array)
22
14
  ], BizOptionDetailList.prototype, "items", void 0);
23
- __decorate([
15
+ tslib_1.__decorate([
24
16
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
25
- __metadata("design:type", Number)
17
+ tslib_1.__metadata("design:type", Number)
26
18
  ], BizOptionDetailList.prototype, "total", void 0);
27
- BizOptionDetailList = __decorate([
19
+ BizOptionDetailList = tslib_1.__decorate([
28
20
  (0, type_graphql_1.ObjectType)()
29
21
  ], BizOptionDetailList);
30
22
  exports.BizOptionDetailList = BizOptionDetailList;
31
23
  let NewBizOptionDetail = class NewBizOptionDetail {
32
24
  };
33
- __decorate([
25
+ tslib_1.__decorate([
34
26
  (0, type_graphql_1.Field)(),
35
- __metadata("design:type", String)
27
+ tslib_1.__metadata("design:type", String)
36
28
  ], NewBizOptionDetail.prototype, "name", void 0);
37
- __decorate([
29
+ tslib_1.__decorate([
38
30
  (0, type_graphql_1.Field)({ nullable: true }),
39
- __metadata("design:type", String)
31
+ tslib_1.__metadata("design:type", String)
40
32
  ], NewBizOptionDetail.prototype, "description", void 0);
41
- NewBizOptionDetail = __decorate([
33
+ NewBizOptionDetail = tslib_1.__decorate([
42
34
  (0, type_graphql_1.InputType)()
43
35
  ], NewBizOptionDetail);
44
36
  exports.NewBizOptionDetail = NewBizOptionDetail;
45
37
  let BizOptionDetailPatch = class BizOptionDetailPatch {
46
38
  };
47
- __decorate([
39
+ tslib_1.__decorate([
48
40
  (0, type_graphql_1.Field)({ nullable: true }),
49
- __metadata("design:type", String)
41
+ tslib_1.__metadata("design:type", String)
50
42
  ], BizOptionDetailPatch.prototype, "id", void 0);
51
- __decorate([
43
+ tslib_1.__decorate([
52
44
  (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", String)
45
+ tslib_1.__metadata("design:type", String)
54
46
  ], BizOptionDetailPatch.prototype, "name", void 0);
55
- __decorate([
47
+ tslib_1.__decorate([
56
48
  (0, type_graphql_1.Field)({ nullable: true }),
57
- __metadata("design:type", String)
49
+ tslib_1.__metadata("design:type", String)
58
50
  ], BizOptionDetailPatch.prototype, "description", void 0);
59
- __decorate([
51
+ tslib_1.__decorate([
60
52
  (0, type_graphql_1.Field)({ nullable: true }),
61
- __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
53
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
62
54
  ], BizOptionDetailPatch.prototype, "bizOption", void 0);
63
- BizOptionDetailPatch = __decorate([
55
+ BizOptionDetailPatch = tslib_1.__decorate([
64
56
  (0, type_graphql_1.InputType)()
65
57
  ], BizOptionDetailPatch);
66
58
  exports.BizOptionDetailPatch = BizOptionDetailPatch;
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-detail-types.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,2DAAqD;AAGrD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;CAM/B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mCAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACzB;AALH,mBAAmB;IAD/B,IAAA,yBAAU,GAAE;GACA,mBAAmB,CAM/B;AANY,kDAAmB;AAShC,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;CAM9B,CAAA;AAJC;IADC,IAAA,oBAAK,GAAE;;gDACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;AALT,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAM9B;AANY,gDAAkB;AAS/B,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;CAYhC,CAAA;AAVC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACf;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACd,iBAAS,oBAAT,iBAAS;uDAAA;AAXV,oBAAoB;IADhC,IAAA,wBAAS,GAAE;GACC,oBAAoB,CAYhC;AAZY,oDAAoB"}
1
+ {"version":3,"file":"biz-option-detail-types.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-types.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,2DAAqD;AAGrD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;CAM/B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mCAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACzB;AALH,mBAAmB;IAD/B,IAAA,yBAAU,GAAE;GACA,mBAAmB,CAM/B;AANY,kDAAmB;AAShC,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;CAM9B,CAAA;AAJC;IADC,IAAA,oBAAK,GAAE;;gDACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;AALT,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAM9B;AANY,gDAAkB;AAS/B,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;CAYhC,CAAA;AAVC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACf;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACd,iBAAS,oBAAT,iBAAS;uDAAA;AAXV,oBAAoB;IADhC,IAAA,wBAAS,GAAE;GACC,oBAAoB,CAYhC;AAZY,oDAAoB","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\n\n@ObjectType()\nexport class BizOptionDetailList {\n @Field(type => [BizOptionDetail], { nullable: true })\n items?: BizOptionDetail[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class NewBizOptionDetail {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class BizOptionDetailPatch {\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 bizOption?: ObjectRef\n}\n"]}
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  var _a, _b, _c;
12
3
  Object.defineProperty(exports, "__esModule", { value: true });
13
4
  exports.BizOptionDetail = void 0;
5
+ const tslib_1 = require("tslib");
14
6
  const type_graphql_1 = require("type-graphql");
15
7
  const typeorm_1 = require("typeorm");
16
8
  const auth_base_1 = require("@things-factory/auth-base");
@@ -18,60 +10,60 @@ const shell_1 = require("@things-factory/shell");
18
10
  const biz_option_1 = require("../biz-option/biz-option");
19
11
  let BizOptionDetail = class BizOptionDetail {
20
12
  };
21
- __decorate([
13
+ tslib_1.__decorate([
22
14
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
15
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
24
- __metadata("design:type", String)
16
+ tslib_1.__metadata("design:type", String)
25
17
  ], BizOptionDetail.prototype, "id", void 0);
26
- __decorate([
18
+ tslib_1.__decorate([
27
19
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain, { nullable: true }),
28
20
  (0, type_graphql_1.Field)({ nullable: true }),
29
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
21
+ tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
30
22
  ], BizOptionDetail.prototype, "domain", void 0);
31
- __decorate([
23
+ tslib_1.__decorate([
32
24
  (0, typeorm_1.Column)(),
33
25
  (0, type_graphql_1.Field)(),
34
- __metadata("design:type", String)
26
+ tslib_1.__metadata("design:type", String)
35
27
  ], BizOptionDetail.prototype, "name", void 0);
36
- __decorate([
28
+ tslib_1.__decorate([
37
29
  (0, typeorm_1.ManyToOne)(type => biz_option_1.BizOption, bizOption => bizOption.bizOptionDetails, {
38
30
  nullable: false
39
31
  }),
40
32
  (0, type_graphql_1.Field)(type => biz_option_1.BizOption, { nullable: true }),
41
- __metadata("design:type", biz_option_1.BizOption)
33
+ tslib_1.__metadata("design:type", biz_option_1.BizOption)
42
34
  ], BizOptionDetail.prototype, "bizOption", void 0);
43
- __decorate([
35
+ tslib_1.__decorate([
44
36
  (0, typeorm_1.Column)({
45
37
  nullable: true
46
38
  }),
47
39
  (0, type_graphql_1.Field)({ nullable: true }),
48
- __metadata("design:type", String)
40
+ tslib_1.__metadata("design:type", String)
49
41
  ], BizOptionDetail.prototype, "description", void 0);
50
- __decorate([
42
+ tslib_1.__decorate([
51
43
  (0, typeorm_1.CreateDateColumn)(),
52
44
  (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", Date)
45
+ tslib_1.__metadata("design:type", Date)
54
46
  ], BizOptionDetail.prototype, "createdAt", void 0);
55
- __decorate([
47
+ tslib_1.__decorate([
56
48
  (0, typeorm_1.UpdateDateColumn)(),
57
49
  (0, type_graphql_1.Field)({ nullable: true }),
58
- __metadata("design:type", Date)
50
+ tslib_1.__metadata("design:type", Date)
59
51
  ], BizOptionDetail.prototype, "updatedAt", void 0);
60
- __decorate([
52
+ tslib_1.__decorate([
61
53
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
62
54
  nullable: true
63
55
  }),
64
56
  (0, type_graphql_1.Field)({ nullable: true }),
65
- __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
57
+ tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
66
58
  ], BizOptionDetail.prototype, "creator", void 0);
67
- __decorate([
59
+ tslib_1.__decorate([
68
60
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
69
61
  nullable: true
70
62
  }),
71
63
  (0, type_graphql_1.Field)({ nullable: true }),
72
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
64
+ tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
73
65
  ], BizOptionDetail.prototype, "updater", void 0);
74
- BizOptionDetail = __decorate([
66
+ BizOptionDetail = tslib_1.__decorate([
75
67
  (0, typeorm_1.Entity)(),
76
68
  (0, typeorm_1.Index)('ix_biz-option-detail_0', (bizOptionDetail) => [bizOptionDetail.bizOption, bizOptionDetail.name], {
77
69
  unique: true
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-detail.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCAAsH;AAEtH,yDAAgD;AAChD,iDAA8C;AAE9C,yDAAoD;AAWpD,IAAa,eAAe,GAA5B,MAAa,eAAe;CA4C3B,CAAA;AAzCC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;2CACR;AAIV;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,C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,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,wBAAwB,EACxB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,IAAI,CAAC,EACvF;QACE,MAAM,EAAE,IAAI;KACb,CACF;IACA,IAAA,yBAAU,GAAE;GACA,eAAe,CA4C3B;AA5CY,0CAAe"}
1
+ {"version":3,"file":"biz-option-detail.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail.ts"],"names":[],"mappings":";;;;;AAAA,+CAAoD;AACpD,qCAAsH;AAEtH,yDAAgD;AAChD,iDAA8C;AAE9C,yDAAoD;AAWpD,IAAa,eAAe,GAA5B,MAAa,eAAe;CA4C3B,CAAA;AAzCC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;2CACR;AAIV;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DAClB,cAAM,oBAAN,cAAM;+CAAA;AAId;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;6CACI;AAMZ;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE;QACrE,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAClC,sBAAS;kDAAA;AAMpB;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACP;AAInB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;kDAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;kDAAA;AAMf;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACjB,gBAAI,oBAAJ,gBAAI;gDAAA;AAMb;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACjB,gBAAI,oBAAJ,gBAAI;gDAAA;AA3CF,eAAe;IAT3B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,wBAAwB,EACxB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,IAAI,CAAC,EACvF;QACE,MAAM,EAAE,IAAI;KACb,CACF;IACA,IAAA,yBAAU,GAAE;GACA,eAAe,CA4C3B;AA5CY,0CAAe","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { BizOption } from '../biz-option/biz-option'\n\n@Entity()\n@Index(\n 'ix_biz-option-detail_0',\n (bizOptionDetail: BizOptionDetail) => [bizOptionDetail.bizOption, bizOptionDetail.name],\n {\n unique: true\n }\n)\n@ObjectType()\nexport class BizOptionDetail {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n id: string\n\n @ManyToOne(type => Domain, { nullable: true })\n @Field({ nullable: true })\n domain: Domain\n\n @Column()\n @Field()\n name: string\n\n @ManyToOne(type => BizOption, bizOption => bizOption.bizOptionDetails, {\n nullable: false\n })\n @Field(type => BizOption, { nullable: true })\n bizOption: BizOption\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AACrD,6EAAsE;AACtE,uEAAgE;AAEnD,QAAA,QAAQ,GAAG,CAAC,mCAAe,CAAC,CAAA;AAC5B,QAAA,SAAS,GAAG,CAAC,8CAAoB,EAAE,oDAAuB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AACrD,6EAAsE;AACtE,uEAAgE;AAEnD,QAAA,QAAQ,GAAG,CAAC,mCAAe,CAAC,CAAA;AAC5B,QAAA,SAAS,GAAG,CAAC,8CAAoB,EAAE,oDAAuB,CAAC,CAAA","sourcesContent":["import { BizOptionDetail } from './biz-option-detail'\nimport { BizOptionDetailMutation } from './biz-option-detail-mutation'\nimport { BizOptionDetailQuery } from './biz-option-detail-query'\n\nexport const entities = [BizOptionDetail]\nexport const resolvers = [BizOptionDetailQuery, BizOptionDetailMutation]\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
2
  Object.defineProperty(exports, "__esModule", { value: true });
15
3
  exports.BizplaceMutation = void 0;
4
+ const tslib_1 = require("tslib");
16
5
  const type_graphql_1 = require("type-graphql");
17
6
  const typeorm_1 = require("typeorm");
18
7
  const shell_1 = require("@things-factory/shell");
@@ -83,61 +72,61 @@ let BizplaceMutation = class BizplaceMutation {
83
72
  return true;
84
73
  }
85
74
  };
86
- __decorate([
75
+ tslib_1.__decorate([
87
76
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
88
77
  (0, type_graphql_1.Mutation)(returns => bizplace_1.Bizplace),
89
- __param(0, (0, type_graphql_1.Arg)('bizplace')),
90
- __param(1, (0, type_graphql_1.Ctx)()),
91
- __metadata("design:type", Function),
92
- __metadata("design:paramtypes", [bizplace_types_1.NewBizplace, Object]),
93
- __metadata("design:returntype", Promise)
78
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('bizplace')),
79
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
80
+ tslib_1.__metadata("design:type", Function),
81
+ tslib_1.__metadata("design:paramtypes", [bizplace_types_1.NewBizplace, Object]),
82
+ tslib_1.__metadata("design:returntype", Promise)
94
83
  ], BizplaceMutation.prototype, "createBizplace", null);
95
- __decorate([
84
+ tslib_1.__decorate([
96
85
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
97
86
  (0, type_graphql_1.Mutation)(returns => bizplace_1.Bizplace),
98
- __param(0, (0, type_graphql_1.Arg)('name')),
99
- __param(1, (0, type_graphql_1.Arg)('patch')),
100
- __param(2, (0, type_graphql_1.Ctx)()),
101
- __metadata("design:type", Function),
102
- __metadata("design:paramtypes", [String, bizplace_types_1.BizplacePatch, Object]),
103
- __metadata("design:returntype", Promise)
87
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
88
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
89
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
90
+ tslib_1.__metadata("design:type", Function),
91
+ tslib_1.__metadata("design:paramtypes", [String, bizplace_types_1.BizplacePatch, Object]),
92
+ tslib_1.__metadata("design:returntype", Promise)
104
93
  ], BizplaceMutation.prototype, "updateBizplace", null);
105
- __decorate([
94
+ tslib_1.__decorate([
106
95
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
107
96
  (0, type_graphql_1.Mutation)(returns => [bizplace_1.Bizplace]),
108
- __param(0, (0, type_graphql_1.Arg)('patches', type => [bizplace_types_1.BizplacePatch])),
109
- __param(1, (0, type_graphql_1.Ctx)()),
110
- __metadata("design:type", Function),
111
- __metadata("design:paramtypes", [Array, Object]),
112
- __metadata("design:returntype", Promise)
97
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [bizplace_types_1.BizplacePatch])),
98
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
99
+ tslib_1.__metadata("design:type", Function),
100
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
101
+ tslib_1.__metadata("design:returntype", Promise)
113
102
  ], BizplaceMutation.prototype, "updateMultipleBizplace", null);
114
- __decorate([
103
+ tslib_1.__decorate([
115
104
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
116
105
  (0, type_graphql_1.Mutation)(returns => bizplace_1.Bizplace),
117
- __param(0, (0, type_graphql_1.Arg)('name')),
118
- __param(1, (0, type_graphql_1.Arg)('patch')),
119
- __param(2, (0, type_graphql_1.Ctx)()),
120
- __metadata("design:type", Function),
121
- __metadata("design:paramtypes", [String, bizplace_types_1.BizplacePatch, Object]),
122
- __metadata("design:returntype", Promise)
106
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
107
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
108
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
109
+ tslib_1.__metadata("design:type", Function),
110
+ tslib_1.__metadata("design:paramtypes", [String, bizplace_types_1.BizplacePatch, Object]),
111
+ tslib_1.__metadata("design:returntype", Promise)
123
112
  ], BizplaceMutation.prototype, "updateBizplaceCheckDomain", null);
124
- __decorate([
113
+ tslib_1.__decorate([
125
114
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
126
115
  (0, type_graphql_1.Mutation)(returns => Boolean),
127
- __param(0, (0, type_graphql_1.Arg)('id')),
128
- __metadata("design:type", Function),
129
- __metadata("design:paramtypes", [String]),
130
- __metadata("design:returntype", Promise)
116
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
117
+ tslib_1.__metadata("design:type", Function),
118
+ tslib_1.__metadata("design:paramtypes", [String]),
119
+ tslib_1.__metadata("design:returntype", Promise)
131
120
  ], BizplaceMutation.prototype, "deleteBizplace", null);
132
- __decorate([
121
+ tslib_1.__decorate([
133
122
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
134
123
  (0, type_graphql_1.Mutation)(returns => Boolean),
135
- __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
136
- __metadata("design:type", Function),
137
- __metadata("design:paramtypes", [Array]),
138
- __metadata("design:returntype", Promise)
124
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
125
+ tslib_1.__metadata("design:type", Function),
126
+ tslib_1.__metadata("design:paramtypes", [Array]),
127
+ tslib_1.__metadata("design:returntype", Promise)
139
128
  ], BizplaceMutation.prototype, "deleteBizplaces", null);
140
- BizplaceMutation = __decorate([
129
+ BizplaceMutation = tslib_1.__decorate([
141
130
  (0, type_graphql_1.Resolver)(bizplace_1.Bizplace)
142
131
  ], BizplaceMutation);
143
132
  exports.BizplaceMutation = BizplaceMutation;
@@ -1 +1 @@
1
- {"version":3,"file":"bizplace-mutation.js","sourceRoot":"","sources":["../../../server/service/bizplace/bizplace-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAAuC;AAEvC,iDAA8C;AAC9C,iDAA+C;AAE/C,gDAA4C;AAC5C,yCAAqC;AACrC,qDAA6D;AAG7D,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAG3B,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAY;QAC9E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE;YAC3C,QAAQ,CAAC,OAAO,GAAG,MAAM,IAAA,uBAAa,EAAC,iBAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;SAC7E;QAED,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,iCACpC,QAAQ,KACX,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,cAAc,CACL,IAAY,EACX,KAAoB,EAC3B,OAAY;QAEnB,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,C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BAAa,CAAC,CAAC,CAAA;IACvC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8DA+CP;AAID;IAFC,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,mBAAQ,CAAC;IAE3B,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,8BAAa;;iEAqBnC;AAID;IAFC,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACP,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;;;;sDAI9B;AAID;IAFC,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACN,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;;;;uDAIlD;AAnIU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CAoI5B;AApIY,4CAAgB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { Domain } from '@things-factory/shell'\nimport { slugger } from '@things-factory/utils'\n\nimport { Company } from '../company/company'\nimport { Bizplace } from './bizplace'\nimport { BizplacePatch, NewBizplace } from './bizplace-types'\n\n@Resolver(Bizplace)\nexport class BizplaceMutation {\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async createBizplace(@Arg('bizplace') bizplace: NewBizplace, @Ctx() context: any): Promise<Bizplace> {\n const { domain, user } = context.state\n if (bizplace.company && bizplace.company.id) {\n bizplace.company = await getRepository(Company).findOne(bizplace.company.id)\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async updateBizplace(\n @Arg('name') name: string,\n @Arg('patch') patch: BizplacePatch,\n @Ctx() context: any\n ): Promise<Bizplace> {\n const bizplace = await getRepository(Bizplace).findOne({ domain: context.state.domain, name })\n\n if (patch.company && patch.company.id) {\n patch.company = await getRepository(Company).findOne(patch.company.id)\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => [Bizplace])\n async updateMultipleBizplace(\n @Arg('patches', type => [BizplacePatch]) patches: BizplacePatch[],\n @Ctx() context: any\n ): Promise<Bizplace[]> {\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 bizplaceRepo = getRepository(Bizplace)\n const companyRepo = getRepository(Company)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n if (newRecord.company && newRecord.company.id) {\n newRecord.company = await companyRepo.findOne(newRecord.company.id)\n }\n\n const result = await bizplaceRepo.save({\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user,\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 newRecord = _updateRecords[i]\n const bizplace = await bizplaceRepo.findOne(newRecord.id)\n\n if (newRecord.company && newRecord.company.id) {\n newRecord.company = await companyRepo.findOne(newRecord.company.id)\n }\n\n const result = await bizplaceRepo.save({\n ...bizplace,\n ...newRecord,\n updater: context.state.user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async updateBizplaceCheckDomain(\n @Arg('name') name: string,\n @Arg('patch') patch: BizplacePatch,\n @Ctx() context: any\n ): Promise<Bizplace> {\n let bizplace: Bizplace = await getRepository(Bizplace).findOne({ where: { name }, relations: ['domain'] })\n let domain: Domain = bizplace.domain\n\n if (domain) {\n if (bizplace.name !== patch.name) {\n domain = await getRepository(Domain).save({\n ...domain,\n name: patch.name,\n subdomain: slugger(patch.name)\n })\n }\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteBizplace(@Arg('id') id: string): Promise<Boolean> {\n await getRepository(Bizplace).delete(id)\n\n return true\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteBizplaces(@Arg('ids', type => [String]) ids: string[]): Promise<Boolean> {\n await getRepository(Bizplace).delete(ids)\n\n return true\n }\n}\n"]}
@@ -1,19 +1,8 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
2
  var _a, _b, _c, _d;
15
3
  Object.defineProperty(exports, "__esModule", { value: true });
16
4
  exports.bizplaceUsers = exports.BizplaceQuery = void 0;
5
+ const tslib_1 = require("tslib");
17
6
  const type_graphql_1 = require("type-graphql");
18
7
  const typeorm_1 = require("typeorm");
19
8
  const auth_base_1 = require("@things-factory/auth-base");
@@ -40,27 +29,27 @@ let BizplaceQuery = class BizplaceQuery {
40
29
  relations: ['company', 'domain', 'users', 'creator', 'updater']
41
30
  });
42
31
  }
32
+ /* TODO make it work */
43
33
  async userBizplaces(email, context) {
34
+ const { domain } = context.state;
44
35
  const user = await (0, typeorm_1.getRepository)(auth_base_1.User).findOne({
45
- domain: context.state.domain,
46
36
  email: email != '' ? email : context.state.user.email
47
- }, {
48
- relations: ['bizplaces']
49
- });
50
- const bizplaces = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).find({ domain: context.state.domain });
51
- const userBizplaces = user.bizplaces;
52
- return bizplaces.map((bizplace) => {
53
- return {
54
- id: bizplace.id,
55
- name: bizplace.name,
56
- description: bizplace.description,
57
- userBizplaceId: userBizplaces
58
- .map(userBiz => userBiz.bizplace.id)
59
- .slice(0, 1)
60
- .shift(),
61
- assigned: userBizplaces.filter((userBizplace) => userBizplace.id === bizplace.id).length > 0
62
- };
63
37
  });
38
+ return await (0, utils_1.getUserBizplaces)(user);
39
+ // const bizplaces = await getRepository(Bizplace).find({ domain })
40
+ // // const userBizplaces = user.bizplaces
41
+ // return bizplaces.map((bizplace: Bizplace) => {
42
+ // return {
43
+ // id: bizplace.id,
44
+ // name: bizplace.name,
45
+ // description: bizplace.description,
46
+ // userBizplaceId: userBizplaces
47
+ // .map(userBiz => userBiz.bizplace.id)
48
+ // .slice(0, 1)
49
+ // .shift(),
50
+ // assigned: userBizplaces.filter((userBizplace: Bizplace) => userBizplace.id === bizplace.id).length > 0
51
+ // }
52
+ // })
64
53
  }
65
54
  async bizplaces(params, context) {
66
55
  let bizplace_ids = [];
@@ -155,73 +144,73 @@ let BizplaceQuery = class BizplaceQuery {
155
144
  return { items, total };
156
145
  }
157
146
  };
158
- __decorate([
147
+ tslib_1.__decorate([
159
148
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query")'),
160
149
  (0, type_graphql_1.Query)(returns => [bizplace_1.Bizplace]),
161
- __param(0, (0, type_graphql_1.Ctx)()),
162
- __metadata("design:type", Function),
163
- __metadata("design:paramtypes", [Object]),
164
- __metadata("design:returntype", Promise)
150
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
151
+ tslib_1.__metadata("design:type", Function),
152
+ tslib_1.__metadata("design:paramtypes", [Object]),
153
+ tslib_1.__metadata("design:returntype", Promise)
165
154
  ], BizplaceQuery.prototype, "customerBizplaces", null);
166
- __decorate([
155
+ tslib_1.__decorate([
167
156
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
168
157
  (0, type_graphql_1.Query)(returns => bizplace_1.Bizplace),
169
- __param(0, (0, type_graphql_1.Ctx)()),
170
- __metadata("design:type", Function),
171
- __metadata("design:paramtypes", [Object]),
172
- __metadata("design:returntype", Promise)
158
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
159
+ tslib_1.__metadata("design:type", Function),
160
+ tslib_1.__metadata("design:paramtypes", [Object]),
161
+ tslib_1.__metadata("design:returntype", Promise)
173
162
  ], BizplaceQuery.prototype, "businessBizplace", null);
174
- __decorate([
163
+ tslib_1.__decorate([
175
164
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
176
- (0, type_graphql_1.Query)(returns => [bizplace_types_1.UserBizplace]),
177
- __param(0, (0, type_graphql_1.Arg)('email')),
178
- __param(1, (0, type_graphql_1.Ctx)()),
179
- __metadata("design:type", Function),
180
- __metadata("design:paramtypes", [String, Object]),
181
- __metadata("design:returntype", Promise)
165
+ (0, type_graphql_1.Query)(returns => [bizplace_1.Bizplace]),
166
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('email')),
167
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
168
+ tslib_1.__metadata("design:type", Function),
169
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
170
+ tslib_1.__metadata("design:returntype", Promise)
182
171
  ], BizplaceQuery.prototype, "userBizplaces", null);
183
- __decorate([
172
+ tslib_1.__decorate([
184
173
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
185
174
  (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
186
- __param(0, (0, type_graphql_1.Args)()),
187
- __param(1, (0, type_graphql_1.Ctx)()),
188
- __metadata("design:type", Function),
189
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
190
- __metadata("design:returntype", Promise)
175
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
176
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
177
+ tslib_1.__metadata("design:type", Function),
178
+ tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
179
+ tslib_1.__metadata("design:returntype", Promise)
191
180
  ], BizplaceQuery.prototype, "bizplaces", null);
192
- __decorate([
181
+ tslib_1.__decorate([
193
182
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
194
183
  (0, type_graphql_1.Query)(returns => bizplace_1.Bizplace),
195
- __param(0, (0, type_graphql_1.Arg)('id')),
196
- __metadata("design:type", Function),
197
- __metadata("design:paramtypes", [String]),
198
- __metadata("design:returntype", Promise)
184
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
185
+ tslib_1.__metadata("design:type", Function),
186
+ tslib_1.__metadata("design:paramtypes", [String]),
187
+ tslib_1.__metadata("design:returntype", Promise)
199
188
  ], BizplaceQuery.prototype, "bizplace", null);
200
- __decorate([
189
+ tslib_1.__decorate([
201
190
  (0, type_graphql_1.Query)(returns => auth_base_1.UserList),
202
- __param(0, (0, type_graphql_1.Args)()),
203
- __param(1, (0, type_graphql_1.Ctx)()),
204
- __metadata("design:type", Function),
205
- __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
206
- __metadata("design:returntype", Promise)
191
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
192
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
193
+ tslib_1.__metadata("design:type", Function),
194
+ tslib_1.__metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
195
+ tslib_1.__metadata("design:returntype", Promise)
207
196
  ], BizplaceQuery.prototype, "bizplaceUsers", null);
208
- __decorate([
197
+ tslib_1.__decorate([
209
198
  (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
210
- __param(0, (0, type_graphql_1.Args)()),
211
- __param(1, (0, type_graphql_1.Ctx)()),
212
- __metadata("design:type", Function),
213
- __metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
214
- __metadata("design:returntype", Promise)
199
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
200
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
201
+ tslib_1.__metadata("design:type", Function),
202
+ tslib_1.__metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
203
+ tslib_1.__metadata("design:returntype", Promise)
215
204
  ], BizplaceQuery.prototype, "partnersBizplaces", null);
216
- __decorate([
205
+ tslib_1.__decorate([
217
206
  (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
218
- __param(0, (0, type_graphql_1.Args)()),
219
- __param(1, (0, type_graphql_1.Ctx)()),
220
- __metadata("design:type", Function),
221
- __metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
222
- __metadata("design:returntype", Promise)
207
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
208
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
209
+ tslib_1.__metadata("design:type", Function),
210
+ tslib_1.__metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
211
+ tslib_1.__metadata("design:returntype", Promise)
223
212
  ], BizplaceQuery.prototype, "permittedPartnersCompanyBizplaces", null);
224
- BizplaceQuery = __decorate([
213
+ BizplaceQuery = tslib_1.__decorate([
225
214
  (0, type_graphql_1.Resolver)(bizplace_1.Bizplace)
226
215
  ], BizplaceQuery);
227
216
  exports.BizplaceQuery = BizplaceQuery;