@things-factory/biz-base 4.3.591 → 4.3.671

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 (74) hide show
  1. package/package.json +3 -3
  2. package/server/service/bizplace/bizplace-query.ts +19 -10
  3. package/dist-server/index.js +0 -20
  4. package/dist-server/index.js.map +0 -1
  5. package/dist-server/middlewares/index.js +0 -1
  6. package/dist-server/middlewares/index.js.map +0 -1
  7. package/dist-server/migrations/index.js +0 -12
  8. package/dist-server/migrations/index.js.map +0 -1
  9. package/dist-server/service/biz-option/biz-option-mutation.js +0 -80
  10. package/dist-server/service/biz-option/biz-option-mutation.js.map +0 -1
  11. package/dist-server/service/biz-option/biz-option-query.js +0 -55
  12. package/dist-server/service/biz-option/biz-option-query.js.map +0 -1
  13. package/dist-server/service/biz-option/biz-option-types.js +0 -75
  14. package/dist-server/service/biz-option/biz-option-types.js.map +0 -1
  15. package/dist-server/service/biz-option/biz-option.js +0 -86
  16. package/dist-server/service/biz-option/biz-option.js.map +0 -1
  17. package/dist-server/service/biz-option/index.js +0 -9
  18. package/dist-server/service/biz-option/index.js.map +0 -1
  19. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js +0 -80
  20. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js.map +0 -1
  21. package/dist-server/service/biz-option-detail/biz-option-detail-query.js +0 -54
  22. package/dist-server/service/biz-option-detail/biz-option-detail-query.js.map +0 -1
  23. package/dist-server/service/biz-option-detail/biz-option-detail-types.js +0 -67
  24. package/dist-server/service/biz-option-detail/biz-option-detail-types.js.map +0 -1
  25. package/dist-server/service/biz-option-detail/biz-option-detail.js +0 -82
  26. package/dist-server/service/biz-option-detail/biz-option-detail.js.map +0 -1
  27. package/dist-server/service/biz-option-detail/index.js +0 -9
  28. package/dist-server/service/biz-option-detail/index.js.map +0 -1
  29. package/dist-server/service/bizplace/bizplace-mutation.js +0 -144
  30. package/dist-server/service/bizplace/bizplace-mutation.js.map +0 -1
  31. package/dist-server/service/bizplace/bizplace-query.js +0 -279
  32. package/dist-server/service/bizplace/bizplace-query.js.map +0 -1
  33. package/dist-server/service/bizplace/bizplace-types.js +0 -189
  34. package/dist-server/service/bizplace/bizplace-types.js.map +0 -1
  35. package/dist-server/service/bizplace/bizplace.js +0 -194
  36. package/dist-server/service/bizplace/bizplace.js.map +0 -1
  37. package/dist-server/service/bizplace/index.js +0 -9
  38. package/dist-server/service/bizplace/index.js.map +0 -1
  39. package/dist-server/service/company/company-mutation.js +0 -141
  40. package/dist-server/service/company/company-mutation.js.map +0 -1
  41. package/dist-server/service/company/company-query.js +0 -102
  42. package/dist-server/service/company/company-query.js.map +0 -1
  43. package/dist-server/service/company/company-types.js +0 -109
  44. package/dist-server/service/company/company-types.js.map +0 -1
  45. package/dist-server/service/company/company.js +0 -135
  46. package/dist-server/service/company/company.js.map +0 -1
  47. package/dist-server/service/company/index.js +0 -9
  48. package/dist-server/service/company/index.js.map +0 -1
  49. package/dist-server/service/contact-point/contact-point-mutation.js +0 -164
  50. package/dist-server/service/contact-point/contact-point-mutation.js.map +0 -1
  51. package/dist-server/service/contact-point/contact-point-query.js +0 -63
  52. package/dist-server/service/contact-point/contact-point-query.js.map +0 -1
  53. package/dist-server/service/contact-point/contact-point-types.js +0 -171
  54. package/dist-server/service/contact-point/contact-point-types.js.map +0 -1
  55. package/dist-server/service/contact-point/contact-point.js +0 -139
  56. package/dist-server/service/contact-point/contact-point.js.map +0 -1
  57. package/dist-server/service/contact-point/index.js +0 -9
  58. package/dist-server/service/contact-point/index.js.map +0 -1
  59. package/dist-server/service/index.js +0 -67
  60. package/dist-server/service/index.js.map +0 -1
  61. package/dist-server/service/worker/index.js +0 -9
  62. package/dist-server/service/worker/index.js.map +0 -1
  63. package/dist-server/service/worker/worker-mutation.js +0 -134
  64. package/dist-server/service/worker/worker-mutation.js.map +0 -1
  65. package/dist-server/service/worker/worker-query.js +0 -63
  66. package/dist-server/service/worker/worker-query.js.map +0 -1
  67. package/dist-server/service/worker/worker-types.js +0 -83
  68. package/dist-server/service/worker/worker-types.js.map +0 -1
  69. package/dist-server/service/worker/worker.js +0 -83
  70. package/dist-server/service/worker/worker.js.map +0 -1
  71. package/dist-server/utils/get-permitted-bizplaces.js +0 -285
  72. package/dist-server/utils/get-permitted-bizplaces.js.map +0 -1
  73. package/dist-server/utils/index.js +0 -18
  74. package/dist-server/utils/index.js.map +0 -1
@@ -1,67 +0,0 @@
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 _a;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.BizOptionDetailPatch = exports.NewBizOptionDetail = exports.BizOptionDetailList = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const shell_1 = require("@things-factory/shell");
16
- const biz_option_detail_1 = require("./biz-option-detail");
17
- let BizOptionDetailList = class BizOptionDetailList {
18
- };
19
- __decorate([
20
- (0, type_graphql_1.Field)(type => [biz_option_detail_1.BizOptionDetail], { nullable: true }),
21
- __metadata("design:type", Array)
22
- ], BizOptionDetailList.prototype, "items", void 0);
23
- __decorate([
24
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
25
- __metadata("design:type", Number)
26
- ], BizOptionDetailList.prototype, "total", void 0);
27
- BizOptionDetailList = __decorate([
28
- (0, type_graphql_1.ObjectType)()
29
- ], BizOptionDetailList);
30
- exports.BizOptionDetailList = BizOptionDetailList;
31
- let NewBizOptionDetail = class NewBizOptionDetail {
32
- };
33
- __decorate([
34
- (0, type_graphql_1.Field)(),
35
- __metadata("design:type", String)
36
- ], NewBizOptionDetail.prototype, "name", void 0);
37
- __decorate([
38
- (0, type_graphql_1.Field)({ nullable: true }),
39
- __metadata("design:type", String)
40
- ], NewBizOptionDetail.prototype, "description", void 0);
41
- NewBizOptionDetail = __decorate([
42
- (0, type_graphql_1.InputType)()
43
- ], NewBizOptionDetail);
44
- exports.NewBizOptionDetail = NewBizOptionDetail;
45
- let BizOptionDetailPatch = class BizOptionDetailPatch {
46
- };
47
- __decorate([
48
- (0, type_graphql_1.Field)({ nullable: true }),
49
- __metadata("design:type", String)
50
- ], BizOptionDetailPatch.prototype, "id", void 0);
51
- __decorate([
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", String)
54
- ], BizOptionDetailPatch.prototype, "name", void 0);
55
- __decorate([
56
- (0, type_graphql_1.Field)({ nullable: true }),
57
- __metadata("design:type", String)
58
- ], BizOptionDetailPatch.prototype, "description", void 0);
59
- __decorate([
60
- (0, type_graphql_1.Field)({ nullable: true }),
61
- __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
62
- ], BizOptionDetailPatch.prototype, "bizOption", void 0);
63
- BizOptionDetailPatch = __decorate([
64
- (0, type_graphql_1.InputType)()
65
- ], BizOptionDetailPatch);
66
- exports.BizOptionDetailPatch = BizOptionDetailPatch;
67
- //# sourceMappingURL=biz-option-detail-types.js.map
@@ -1 +0,0 @@
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;AAG9C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAM/B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mCAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;AAEzB;IAAC,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;AASzB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAM9B,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;gDACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;AALT,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAM9B;AANY,gDAAkB;AASxB,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAYhC,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACf;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACN;AAEpB;IAAC,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,82 +0,0 @@
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 _a, _b, _c;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.BizOptionDetail = void 0;
14
- const type_graphql_1 = require("type-graphql");
15
- const typeorm_1 = require("typeorm");
16
- const auth_base_1 = require("@things-factory/auth-base");
17
- const shell_1 = require("@things-factory/shell");
18
- const biz_option_1 = require("../biz-option/biz-option");
19
- let BizOptionDetail = class BizOptionDetail {
20
- };
21
- __decorate([
22
- (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
24
- __metadata("design:type", String)
25
- ], BizOptionDetail.prototype, "id", void 0);
26
- __decorate([
27
- (0, typeorm_1.ManyToOne)(type => shell_1.Domain, { nullable: true }),
28
- (0, type_graphql_1.Field)({ nullable: true }),
29
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
30
- ], BizOptionDetail.prototype, "domain", void 0);
31
- __decorate([
32
- (0, typeorm_1.Column)(),
33
- (0, type_graphql_1.Field)(),
34
- __metadata("design:type", String)
35
- ], BizOptionDetail.prototype, "name", void 0);
36
- __decorate([
37
- (0, typeorm_1.ManyToOne)(type => biz_option_1.BizOption, bizOption => bizOption.bizOptionDetails, {
38
- nullable: false
39
- }),
40
- (0, type_graphql_1.Field)(type => biz_option_1.BizOption, { nullable: true }),
41
- __metadata("design:type", biz_option_1.BizOption)
42
- ], BizOptionDetail.prototype, "bizOption", void 0);
43
- __decorate([
44
- (0, typeorm_1.Column)({
45
- nullable: true
46
- }),
47
- (0, type_graphql_1.Field)({ nullable: true }),
48
- __metadata("design:type", String)
49
- ], BizOptionDetail.prototype, "description", void 0);
50
- __decorate([
51
- (0, typeorm_1.CreateDateColumn)(),
52
- (0, type_graphql_1.Field)({ nullable: true }),
53
- __metadata("design:type", Date)
54
- ], BizOptionDetail.prototype, "createdAt", void 0);
55
- __decorate([
56
- (0, typeorm_1.UpdateDateColumn)(),
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- __metadata("design:type", Date)
59
- ], BizOptionDetail.prototype, "updatedAt", void 0);
60
- __decorate([
61
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
62
- nullable: true
63
- }),
64
- (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)
66
- ], BizOptionDetail.prototype, "creator", void 0);
67
- __decorate([
68
- (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
69
- nullable: true
70
- }),
71
- (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)
73
- ], BizOptionDetail.prototype, "updater", void 0);
74
- BizOptionDetail = __decorate([
75
- (0, typeorm_1.Entity)(),
76
- (0, typeorm_1.Index)('ix_biz-option-detail_0', (bizOptionDetail) => [bizOptionDetail.bizOption, bizOptionDetail.name], {
77
- unique: true
78
- }),
79
- (0, type_graphql_1.ObjectType)()
80
- ], BizOptionDetail);
81
- exports.BizOptionDetail = BizOptionDetail;
82
- //# sourceMappingURL=biz-option-detail.js.map
@@ -1 +0,0 @@
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;AAW7C,IAAM,eAAe,GAArB,MAAM,eAAe;CA4C3B,CAAA;AA3CC;IAAC,IAAA,gCAAsB,EAAC,MA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AC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,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"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvers = exports.entities = void 0;
4
- const biz_option_detail_1 = require("./biz-option-detail");
5
- const biz_option_detail_mutation_1 = require("./biz-option-detail-mutation");
6
- const biz_option_detail_query_1 = require("./biz-option-detail-query");
7
- exports.entities = [biz_option_detail_1.BizOptionDetail];
8
- exports.resolvers = [biz_option_detail_query_1.BizOptionDetailQuery, biz_option_detail_mutation_1.BizOptionDetailMutation];
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,144 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.BizplaceMutation = void 0;
16
- const type_graphql_1 = require("type-graphql");
17
- const typeorm_1 = require("typeorm");
18
- const shell_1 = require("@things-factory/shell");
19
- const utils_1 = require("@things-factory/utils");
20
- const company_1 = require("../company/company");
21
- const bizplace_1 = require("./bizplace");
22
- const bizplace_types_1 = require("./bizplace-types");
23
- let BizplaceMutation = class BizplaceMutation {
24
- async createBizplace(bizplace, context) {
25
- const { domain, user } = context.state;
26
- if (bizplace.company && bizplace.company.id) {
27
- bizplace.company = await (0, typeorm_1.getRepository)(company_1.Company).findOne(bizplace.company.id);
28
- }
29
- return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).save(Object.assign(Object.assign({}, bizplace), { domain, creator: user, updater: user }));
30
- }
31
- async updateBizplace(name, patch, context) {
32
- const bizplace = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({ domain: context.state.domain, name });
33
- if (patch.company && patch.company.id) {
34
- patch.company = await (0, typeorm_1.getRepository)(company_1.Company).findOne(patch.company.id);
35
- }
36
- return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).save(Object.assign(Object.assign(Object.assign({}, bizplace), patch), { updater: context.state.user }));
37
- }
38
- async updateMultipleBizplace(patches, context) {
39
- let results = [];
40
- const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
41
- const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
42
- const bizplaceRepo = (0, typeorm_1.getRepository)(bizplace_1.Bizplace);
43
- const companyRepo = (0, typeorm_1.getRepository)(company_1.Company);
44
- if (_createRecords.length > 0) {
45
- for (let i = 0; i < _createRecords.length; i++) {
46
- const newRecord = _createRecords[i];
47
- if (newRecord.company && newRecord.company.id) {
48
- newRecord.company = await companyRepo.findOne(newRecord.company.id);
49
- }
50
- const result = await bizplaceRepo.save(Object.assign({ domain: context.state.domain, creator: context.state.user, updater: context.state.user }, newRecord));
51
- results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
52
- }
53
- }
54
- if (_updateRecords.length > 0) {
55
- for (let i = 0; i < _updateRecords.length; i++) {
56
- const newRecord = _updateRecords[i];
57
- const bizplace = await bizplaceRepo.findOne(newRecord.id);
58
- if (newRecord.company && newRecord.company.id) {
59
- newRecord.company = await companyRepo.findOne(newRecord.company.id);
60
- }
61
- const result = await bizplaceRepo.save(Object.assign(Object.assign(Object.assign({}, bizplace), newRecord), { updater: context.state.user }));
62
- results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
63
- }
64
- }
65
- return results;
66
- }
67
- async updateBizplaceCheckDomain(name, patch, context) {
68
- let bizplace = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({ where: { name }, relations: ['domain'] });
69
- let domain = bizplace.domain;
70
- if (domain) {
71
- if (bizplace.name !== patch.name) {
72
- domain = await (0, typeorm_1.getRepository)(shell_1.Domain).save(Object.assign(Object.assign({}, domain), { name: patch.name, subdomain: (0, utils_1.slugger)(patch.name) }));
73
- }
74
- }
75
- return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).save(Object.assign(Object.assign(Object.assign({}, bizplace), patch), { updater: context.state.user }));
76
- }
77
- async deleteBizplace(id) {
78
- await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).delete(id);
79
- return true;
80
- }
81
- async deleteBizplaces(ids) {
82
- await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).delete(ids);
83
- return true;
84
- }
85
- };
86
- __decorate([
87
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
88
- (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)
94
- ], BizplaceMutation.prototype, "createBizplace", null);
95
- __decorate([
96
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
97
- (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)
104
- ], BizplaceMutation.prototype, "updateBizplace", null);
105
- __decorate([
106
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
107
- (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)
113
- ], BizplaceMutation.prototype, "updateMultipleBizplace", null);
114
- __decorate([
115
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
116
- (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)
123
- ], BizplaceMutation.prototype, "updateBizplaceCheckDomain", null);
124
- __decorate([
125
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
126
- (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)
131
- ], BizplaceMutation.prototype, "deleteBizplace", null);
132
- __decorate([
133
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
134
- (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)
139
- ], BizplaceMutation.prototype, "deleteBizplaces", null);
140
- BizplaceMutation = __decorate([
141
- (0, type_graphql_1.Resolver)(bizplace_1.Bizplace)
142
- ], BizplaceMutation);
143
- exports.BizplaceMutation = BizplaceMutation;
144
- //# sourceMappingURL=bizplace-mutation.js.map
@@ -1 +0,0 @@
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;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,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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AE,CAAC,OAAO,CAAC;IACP,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;;;;sDAI9B;AAIK;IAFL,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACN,WAAA,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"}
@@ -1,279 +0,0 @@
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
- var _a, _b, _c, _d, _e;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.bizplaceUsers = exports.BizplaceQuery = void 0;
17
- const type_graphql_1 = require("type-graphql");
18
- const typeorm_1 = require("typeorm");
19
- const auth_base_1 = require("@things-factory/auth-base");
20
- const shell_1 = require("@things-factory/shell");
21
- const utils_1 = require("../../utils");
22
- const bizplace_1 = require("./bizplace");
23
- const bizplace_types_1 = require("./bizplace-types");
24
- let BizplaceQuery = class BizplaceQuery {
25
- async customerBizplaces(context) {
26
- const { domain, user } = context.state;
27
- return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).find({
28
- where: {
29
- domain,
30
- id: (0, typeorm_1.Not)((0, typeorm_1.In)([await (0, utils_1.getMyBizplace)(domain, user)]))
31
- },
32
- relations: ['domain', 'creator', 'updater']
33
- });
34
- }
35
- async businessBizplace(context) {
36
- const { domain, user } = context.state;
37
- const myBizplace = await (0, utils_1.getMyBizplace)(domain, user);
38
- return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({
39
- where: { id: myBizplace.id },
40
- relations: ['company', 'domain', 'users', 'creator', 'updater']
41
- });
42
- }
43
- async userBizplaces(email, context) {
44
- const user = await (0, typeorm_1.getRepository)(auth_base_1.User).findOne({
45
- domain: context.state.domain,
46
- 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
- });
64
- }
65
- async bizplaces(params, context) {
66
- let bizplace_ids = [];
67
- let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
68
- if (bizplaceIndex > -1) {
69
- bizplace_ids = params.filters
70
- .filter(x => x.name === 'bizplace')
71
- .map(item => {
72
- return item.value;
73
- });
74
- params.filters.splice(bizplaceIndex, 1);
75
- }
76
- const convertedParams = (0, shell_1.convertListParams)(params);
77
- let domainIndex = params.filters.findIndex(x => x.name === 'domain');
78
- if (domainIndex > -1) {
79
- convertedParams.where.id = (0, typeorm_1.In)(await (0, utils_1.getPartnerBizplaceIds)(context.state.domain, context.state.user));
80
- }
81
- else {
82
- if (!(bizplace_ids.length > 0))
83
- convertedParams.where.id = (0, typeorm_1.In)(await (0, utils_1.getPermittedBizplaceIds)(context.state.domain, context.state.user));
84
- else
85
- convertedParams.where.id = (0, typeorm_1.In)(bizplace_ids);
86
- }
87
- const [items, total] = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'company', 'users', 'creator', 'updater'] }));
88
- return { items, total };
89
- }
90
- async bizplace(id) {
91
- return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({
92
- where: { id },
93
- relations: ['company', 'domain', 'users', 'users.roles', 'creator', 'updater']
94
- });
95
- }
96
- async bizplaceUsers(params, context) {
97
- const { domain, user } = context.state;
98
- const myBizplace = await (0, utils_1.getMyBizplace)(domain, user);
99
- return await bizplaceUsers(myBizplace, Object.assign(Object.assign({}, (await (0, shell_1.convertListParams)(params))), { relations: ['domain', 'domains', 'roles', 'roles.privileges', 'roles.users'] }));
100
- }
101
- async partnersBizplaces(params, context) {
102
- let partnersBizplaceIds = [];
103
- let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
104
- if (bizplaceIndex > -1) {
105
- partnersBizplaceIds = params.filters
106
- .filter(x => x.name === 'bizplace')
107
- .map(item => {
108
- return item.value;
109
- });
110
- params.filters.splice(bizplaceIndex, 1);
111
- }
112
- const convertedParams = (0, shell_1.convertListParams)(params);
113
- if (!(partnersBizplaceIds.length > 0)) {
114
- const partnersBizplaces = await (0, utils_1.getPartnersBizplaces)(context.state.domain, context.state.user);
115
- partnersBizplaceIds = partnersBizplaces.map((bizplace) => bizplace.id || null);
116
- convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
117
- }
118
- else {
119
- convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
120
- }
121
- const [items, total] = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'company', 'users', 'creator', 'updater'] }));
122
- return { items, total };
123
- }
124
- async permittedPartnersCompanyBizplaces(params, context) {
125
- let partnersBizplaceIds = [];
126
- let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
127
- if (bizplaceIndex > -1) {
128
- partnersBizplaceIds = params.filters
129
- .filter(x => x.name === 'bizplace')
130
- .map(item => {
131
- return item.value;
132
- });
133
- params.filters.splice(bizplaceIndex, 1);
134
- }
135
- const convertedParams = (0, shell_1.convertListParams)(params);
136
- if (!(partnersBizplaceIds.length > 0)) {
137
- const partnersBizplaces = await (0, utils_1.getPartnersCompanyBizplaces)(context.state.domain, context.state.user, true);
138
- partnersBizplaceIds = partnersBizplaces.map((bizplace) => bizplace.id || null);
139
- convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
140
- }
141
- else {
142
- convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
143
- }
144
- const [items, total] = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'company', 'users', 'creator', 'updater'] }));
145
- return { items, total };
146
- }
147
- async lmdBizplaces(params, context) {
148
- var _a;
149
- let partnersBizplaceIds = [];
150
- let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
151
- if (bizplaceIndex > -1) {
152
- partnersBizplaceIds = params.filters
153
- .filter(x => x.name === 'bizplace')
154
- .map(item => {
155
- return item.value;
156
- });
157
- params.filters.splice(bizplaceIndex, 1);
158
- }
159
- //filter popup for lmd
160
- let lmdBizplaceFilter = params.filters.reduce(item => item.name == 'lmdBizplaceIds');
161
- if (lmdBizplaceFilter) {
162
- params.filters = params.filters.filter(param => param.name !== 'lmdBizplaceIds');
163
- }
164
- const convertedParams = (0, shell_1.convertListParams)(params);
165
- if (!(partnersBizplaceIds.length > 0)) {
166
- const partnersBizplaces = await (0, utils_1.getPartnersBizplaces)(context.state.domain, context.state.user);
167
- partnersBizplaceIds = partnersBizplaces.map((bizplace) => bizplace.id || null);
168
- convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
169
- }
170
- else {
171
- convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
172
- }
173
- const qb = (0, typeorm_1.getRepository)(bizplace_1.Bizplace).createQueryBuilder('b');
174
- (0, shell_1.buildQuery)(qb, params, context);
175
- qb.leftJoinAndSelect('domains', 'd', 'd.id = b.domain_id');
176
- qb.leftJoinAndSelect('companies', 'c', 'c.id = b.company_id');
177
- qb.where('b.id IN (:...partnersBizplaceIds)', { partnersBizplaceIds: partnersBizplaceIds });
178
- if (((_a = lmdBizplaceFilter === null || lmdBizplaceFilter === void 0 ? void 0 : lmdBizplaceFilter.value) === null || _a === void 0 ? void 0 : _a.length) > 0) {
179
- qb.andWhere('b.id NOT IN (:...lmdBizplaceIds)', { lmdBizplaceIds: lmdBizplaceFilter.value });
180
- }
181
- const [items, total] = await qb.getManyAndCount();
182
- return { items, total };
183
- }
184
- };
185
- __decorate([
186
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query")'),
187
- (0, type_graphql_1.Query)(returns => [bizplace_1.Bizplace]),
188
- __param(0, (0, type_graphql_1.Ctx)()),
189
- __metadata("design:type", Function),
190
- __metadata("design:paramtypes", [Object]),
191
- __metadata("design:returntype", Promise)
192
- ], BizplaceQuery.prototype, "customerBizplaces", null);
193
- __decorate([
194
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
195
- (0, type_graphql_1.Query)(returns => bizplace_1.Bizplace),
196
- __param(0, (0, type_graphql_1.Ctx)()),
197
- __metadata("design:type", Function),
198
- __metadata("design:paramtypes", [Object]),
199
- __metadata("design:returntype", Promise)
200
- ], BizplaceQuery.prototype, "businessBizplace", null);
201
- __decorate([
202
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
203
- (0, type_graphql_1.Query)(returns => [bizplace_types_1.UserBizplace]),
204
- __param(0, (0, type_graphql_1.Arg)('email')),
205
- __param(1, (0, type_graphql_1.Ctx)()),
206
- __metadata("design:type", Function),
207
- __metadata("design:paramtypes", [String, Object]),
208
- __metadata("design:returntype", Promise)
209
- ], BizplaceQuery.prototype, "userBizplaces", null);
210
- __decorate([
211
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
212
- (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
213
- __param(0, (0, type_graphql_1.Args)()),
214
- __param(1, (0, type_graphql_1.Ctx)()),
215
- __metadata("design:type", Function),
216
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
217
- __metadata("design:returntype", Promise)
218
- ], BizplaceQuery.prototype, "bizplaces", null);
219
- __decorate([
220
- (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
221
- (0, type_graphql_1.Query)(returns => bizplace_1.Bizplace),
222
- __param(0, (0, type_graphql_1.Arg)('id')),
223
- __metadata("design:type", Function),
224
- __metadata("design:paramtypes", [String]),
225
- __metadata("design:returntype", Promise)
226
- ], BizplaceQuery.prototype, "bizplace", null);
227
- __decorate([
228
- (0, type_graphql_1.Query)(returns => auth_base_1.UserList),
229
- __param(0, (0, type_graphql_1.Args)()),
230
- __param(1, (0, type_graphql_1.Ctx)()),
231
- __metadata("design:type", Function),
232
- __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
233
- __metadata("design:returntype", Promise)
234
- ], BizplaceQuery.prototype, "bizplaceUsers", null);
235
- __decorate([
236
- (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
237
- __param(0, (0, type_graphql_1.Args)()),
238
- __param(1, (0, type_graphql_1.Ctx)()),
239
- __metadata("design:type", Function),
240
- __metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
241
- __metadata("design:returntype", Promise)
242
- ], BizplaceQuery.prototype, "partnersBizplaces", null);
243
- __decorate([
244
- (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
245
- __param(0, (0, type_graphql_1.Args)()),
246
- __param(1, (0, type_graphql_1.Ctx)()),
247
- __metadata("design:type", Function),
248
- __metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
249
- __metadata("design:returntype", Promise)
250
- ], BizplaceQuery.prototype, "permittedPartnersCompanyBizplaces", null);
251
- __decorate([
252
- (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
253
- __param(0, (0, type_graphql_1.Args)()),
254
- __param(1, (0, type_graphql_1.Ctx)()),
255
- __metadata("design:type", Function),
256
- __metadata("design:paramtypes", [typeof (_e = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _e : Object, Object]),
257
- __metadata("design:returntype", Promise)
258
- ], BizplaceQuery.prototype, "lmdBizplaces", null);
259
- BizplaceQuery = __decorate([
260
- (0, type_graphql_1.Resolver)(bizplace_1.Bizplace)
261
- ], BizplaceQuery);
262
- exports.BizplaceQuery = BizplaceQuery;
263
- async function bizplaceUsers(bizplace, params, trxMgr) {
264
- var _a;
265
- const bizplaceRepo = (trxMgr === null || trxMgr === void 0 ? void 0 : trxMgr.getRepository(bizplace_1.Bizplace)) || (0, typeorm_1.getRepository)(bizplace_1.Bizplace);
266
- const userRepo = (trxMgr === null || trxMgr === void 0 ? void 0 : trxMgr.getRepository(auth_base_1.User)) || (0, typeorm_1.getRepository)(auth_base_1.User);
267
- if (!((_a = bizplace === null || bizplace === void 0 ? void 0 : bizplace.users) === null || _a === void 0 ? void 0 : _a.length)) {
268
- bizplace = await bizplaceRepo.findOne(bizplace, { relations: ['users'] });
269
- }
270
- const users = bizplace.users;
271
- const userIds = users.map((user) => user.id);
272
- const [items, total] = await userRepo.findAndCount(Object.assign(Object.assign({}, params), { where: Object.assign(Object.assign({}, params.where), { id: (0, typeorm_1.In)(userIds) }) }));
273
- return {
274
- items,
275
- total
276
- };
277
- }
278
- exports.bizplaceUsers = bizplaceUsers;
279
- //# sourceMappingURL=bizplace-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bizplace-query.js","sourceRoot":"","sources":["../../../server/service/bizplace/bizplace-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAyE;AACzE,qCAA+G;AAE/G,yDAA0D;AAC1D,iDAA+E;AAE/E,uCAMoB;AACpB,yCAAqC;AACrC,qDAA6D;AAGtD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,iBAAiB,CAAQ,OAAY;QACzC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,CAAC;YACxC,KAAK,EAAE;gBACL,MAAM;gBACN,EAAE,EAAE,IAAA,aAAG,EAAC,IAAA,YAAE,EAAC,CAAC,MAAM,IAAA,qBAAa,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;aACjD;YACD,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CAAQ,OAAY;QACxC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,MAAM,UAAU,GAAG,MAAM,IAAA,qBAAa,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACpD,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE;YAC5B,SAAS,EAAE,CAA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