@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.
- package/dist-server/index.js +4 -17
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/biz-option/biz-option-mutation.js +27 -38
- package/dist-server/service/biz-option/biz-option-mutation.js.map +1 -1
- package/dist-server/service/biz-option/biz-option-query.js +14 -25
- package/dist-server/service/biz-option/biz-option-query.js.map +1 -1
- package/dist-server/service/biz-option/biz-option-types.js +24 -32
- package/dist-server/service/biz-option/biz-option-types.js.map +1 -1
- package/dist-server/service/biz-option/biz-option.js +22 -30
- package/dist-server/service/biz-option/biz-option.js.map +1 -1
- package/dist-server/service/biz-option/index.js.map +1 -1
- package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js +27 -38
- package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js.map +1 -1
- package/dist-server/service/biz-option-detail/biz-option-detail-query.js +13 -24
- package/dist-server/service/biz-option-detail/biz-option-detail-query.js.map +1 -1
- package/dist-server/service/biz-option-detail/biz-option-detail-types.js +20 -28
- package/dist-server/service/biz-option-detail/biz-option-detail-types.js.map +1 -1
- package/dist-server/service/biz-option-detail/biz-option-detail.js +20 -28
- package/dist-server/service/biz-option-detail/biz-option-detail.js.map +1 -1
- package/dist-server/service/biz-option-detail/index.js.map +1 -1
- package/dist-server/service/bizplace/bizplace-mutation.js +38 -49
- package/dist-server/service/bizplace/bizplace-mutation.js.map +1 -1
- package/dist-server/service/bizplace/bizplace-query.js +65 -76
- package/dist-server/service/bizplace/bizplace-query.js.map +1 -1
- package/dist-server/service/bizplace/bizplace-types.js +53 -61
- package/dist-server/service/bizplace/bizplace-types.js.map +1 -1
- package/dist-server/service/bizplace/bizplace.js +33 -41
- package/dist-server/service/bizplace/bizplace.js.map +1 -1
- package/dist-server/service/bizplace/index.js.map +1 -1
- package/dist-server/service/company/company-mutation.js +32 -43
- package/dist-server/service/company/company-mutation.js.map +1 -1
- package/dist-server/service/company/company-query.js +23 -38
- package/dist-server/service/company/company-query.js.map +1 -1
- package/dist-server/service/company/company-types.js +42 -50
- package/dist-server/service/company/company-types.js.map +1 -1
- package/dist-server/service/company/company.js +38 -46
- package/dist-server/service/company/company.js.map +1 -1
- package/dist-server/service/company/index.js.map +1 -1
- package/dist-server/service/contact-point/contact-point-mutation.js +33 -44
- package/dist-server/service/contact-point/contact-point-mutation.js.map +1 -1
- package/dist-server/service/contact-point/contact-point-query.js +14 -25
- package/dist-server/service/contact-point/contact-point-query.js.map +1 -1
- package/dist-server/service/contact-point/contact-point-types.js +80 -88
- package/dist-server/service/contact-point/contact-point-types.js.map +1 -1
- package/dist-server/service/contact-point/contact-point.js +48 -56
- package/dist-server/service/contact-point/contact-point.js.map +1 -1
- package/dist-server/service/contact-point/index.js.map +1 -1
- package/dist-server/service/index.js +13 -26
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/worker/index.js.map +1 -1
- package/dist-server/service/worker/worker-mutation.js +32 -43
- package/dist-server/service/worker/worker-mutation.js.map +1 -1
- package/dist-server/service/worker/worker-query.js +14 -25
- package/dist-server/service/worker/worker-query.js.map +1 -1
- package/dist-server/service/worker/worker-types.js +28 -36
- package/dist-server/service/worker/worker-types.js.map +1 -1
- package/dist-server/service/worker/worker.js +22 -30
- package/dist-server/service/worker/worker.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/utils/get-permitted-bizplaces.js.map +1 -1
- package/dist-server/utils/index.js +2 -15
- package/dist-server/utils/index.js.map +1 -1
- package/package.json +3 -3
- package/server/service/bizplace/bizplace-query.ts +28 -27
- package/server/service/company/company-query.ts +0 -5
- package/server/service/contact-point/contact-point-mutation.ts +1 -1
- package/server/utils/get-permitted-bizplaces.ts +3 -3
|
@@ -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;
|
|
15
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
4
|
exports.CompanyQuery = 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");
|
|
@@ -22,11 +11,9 @@ const bizplace_1 = require("../bizplace/bizplace");
|
|
|
22
11
|
const bizplace_types_1 = require("../bizplace/bizplace-types");
|
|
23
12
|
const company_1 = require("./company");
|
|
24
13
|
const company_types_1 = require("./company-types");
|
|
25
|
-
const debug = require('debug')('things-factory:biz-base:company-resolver');
|
|
26
14
|
let CompanyQuery = class CompanyQuery {
|
|
27
15
|
async company(context) {
|
|
28
16
|
const { domain } = context.state;
|
|
29
|
-
debug('company', domain === null || domain === void 0 ? void 0 : domain.subdomain);
|
|
30
17
|
const foundCompany = await (0, typeorm_1.getRepository)(company_1.Company).findOne({
|
|
31
18
|
domain
|
|
32
19
|
});
|
|
@@ -42,7 +29,6 @@ let CompanyQuery = class CompanyQuery {
|
|
|
42
29
|
}
|
|
43
30
|
async companyBizplaces(context) {
|
|
44
31
|
const { domain, user } = context.state;
|
|
45
|
-
debug('companyBizplaces', domain === null || domain === void 0 ? void 0 : domain.subdomain);
|
|
46
32
|
const userDomains = await (0, auth_base_1.getUserDomains)(user);
|
|
47
33
|
const company = await (0, typeorm_1.getRepository)(company_1.Company).findOne({
|
|
48
34
|
domain
|
|
@@ -55,7 +41,6 @@ let CompanyQuery = class CompanyQuery {
|
|
|
55
41
|
}
|
|
56
42
|
async companyUsers(context) {
|
|
57
43
|
const { domain } = context.state;
|
|
58
|
-
debug('companyUsers', domain === null || domain === void 0 ? void 0 : domain.subdomain);
|
|
59
44
|
const items = await (0, auth_base_1.getDomainUsers)(domain);
|
|
60
45
|
return {
|
|
61
46
|
items,
|
|
@@ -63,40 +48,40 @@ let CompanyQuery = class CompanyQuery {
|
|
|
63
48
|
};
|
|
64
49
|
}
|
|
65
50
|
};
|
|
66
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
67
52
|
(0, type_graphql_1.Directive)('@privilege(category: "company", privilege: "query", domainOwnerGranted: true)'),
|
|
68
53
|
(0, type_graphql_1.Query)(returns => company_1.Company),
|
|
69
|
-
__param(0, (0, type_graphql_1.Ctx)()),
|
|
70
|
-
__metadata("design:type", Function),
|
|
71
|
-
__metadata("design:paramtypes", [Object]),
|
|
72
|
-
__metadata("design:returntype", Promise)
|
|
54
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
55
|
+
tslib_1.__metadata("design:type", Function),
|
|
56
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
57
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
73
58
|
], CompanyQuery.prototype, "company", null);
|
|
74
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
75
60
|
(0, type_graphql_1.Directive)('@privilege(category: "company", privilege: "query")'),
|
|
76
61
|
(0, type_graphql_1.Query)(returns => company_types_1.CompanyList),
|
|
77
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
78
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
79
|
-
__metadata("design:type", Function),
|
|
80
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
81
|
-
__metadata("design:returntype", Promise)
|
|
62
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
63
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
64
|
+
tslib_1.__metadata("design:type", Function),
|
|
65
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
66
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
82
67
|
], CompanyQuery.prototype, "companies", null);
|
|
83
|
-
__decorate([
|
|
68
|
+
tslib_1.__decorate([
|
|
84
69
|
(0, type_graphql_1.Directive)('@privilege(category: "company", privilege: "query", domainOwnerGranted: true)'),
|
|
85
70
|
(0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
|
|
86
|
-
__param(0, (0, type_graphql_1.Ctx)()),
|
|
87
|
-
__metadata("design:type", Function),
|
|
88
|
-
__metadata("design:paramtypes", [Object]),
|
|
89
|
-
__metadata("design:returntype", Promise)
|
|
71
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
72
|
+
tslib_1.__metadata("design:type", Function),
|
|
73
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
74
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
90
75
|
], CompanyQuery.prototype, "companyBizplaces", null);
|
|
91
|
-
__decorate([
|
|
76
|
+
tslib_1.__decorate([
|
|
92
77
|
(0, type_graphql_1.Directive)('@privilege(category: "company", privilege: "query", domainOwnerGranted: true)'),
|
|
93
78
|
(0, type_graphql_1.Query)(returns => auth_base_1.UserList),
|
|
94
|
-
__param(0, (0, type_graphql_1.Ctx)()),
|
|
95
|
-
__metadata("design:type", Function),
|
|
96
|
-
__metadata("design:paramtypes", [Object]),
|
|
97
|
-
__metadata("design:returntype", Promise)
|
|
79
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
80
|
+
tslib_1.__metadata("design:type", Function),
|
|
81
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
82
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
98
83
|
], CompanyQuery.prototype, "companyUsers", null);
|
|
99
|
-
CompanyQuery = __decorate([
|
|
84
|
+
CompanyQuery = tslib_1.__decorate([
|
|
100
85
|
(0, type_graphql_1.Resolver)(company_1.Company)
|
|
101
86
|
], CompanyQuery);
|
|
102
87
|
exports.CompanyQuery = CompanyQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company-query.js","sourceRoot":"","sources":["../../../server/service/company/company-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"company-query.js","sourceRoot":"","sources":["../../../server/service/company/company-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAAoE;AACpE,qCAA2C;AAE3C,yDAA0F;AAC1F,iDAA4E;AAE5E,mDAA+C;AAC/C,+DAAyD;AACzD,uCAAmC;AACnC,mDAA6C;AAG7C,IAAa,YAAY,GAAzB,MAAa,YAAY;IAGvB,KAAK,CAAC,OAAO,CAAQ,OAAY;QAC/B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAmB,MAAM,IAAA,uBAAa,EAAC,iBAAO,CAAC,CAAC,OAAO,CAAC;YACxE,MAAM;SACP,CAAC,CAAA;QAEF,IAAI,CAAC,YAAY;YAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CA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AO,CAAC,KAAK,CAAA;QAEhC,MAAM,KAAK,GAAW,MAAM,IAAA,0BAAc,EAAC,MAAM,CAAC,CAAA;QAElD,OAAO;YACL,KAAK;YACL,KAAK,EAAE,KAAK,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;CACF,CAAA;AAtDC;IAFC,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iBAAO,CAAC;IACX,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2CASnB;AAID;IAFC,IAAA,wBAAS,EAAC,qDAAqD,CAAC;IAChE,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAW,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;iEAAjB,iBAAS,oBAAT,iBAAS;;6CASxC;AAID;IAFC,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6BAAY,CAAC;IACP,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAc5B;AAID;IAFC,IAAA,wBAAS,EAAC,+EAA+E,CAAC;IAC1F,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oBAAQ,CAAC;IACP,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDASxB;AAxDU,YAAY;IADxB,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,YAAY,CAyDxB;AAzDY,oCAAY","sourcesContent":["import { Args, Ctx, Directive, Query, Resolver } from 'type-graphql'\nimport { getRepository, In } from 'typeorm'\n\nimport { getDomainUsers, getUserDomains, User, UserList } from '@things-factory/auth-base'\nimport { convertListParams, Domain, ListParam } from '@things-factory/shell'\n\nimport { Bizplace } from '../bizplace/bizplace'\nimport { BizplaceList } from '../bizplace/bizplace-types'\nimport { Company } from './company'\nimport { CompanyList } from './company-types'\n\n@Resolver(Company)\nexport class CompanyQuery {\n @Directive('@privilege(category: \"company\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => Company)\n async company(@Ctx() context: any): Promise<Company> {\n const { domain } = context.state\n\n const foundCompany: Company | null = await getRepository(Company).findOne({\n domain\n })\n\n if (!foundCompany) throw new Error(context.t('error.no x found', { x: context.t('field.company') }))\n return foundCompany\n }\n\n @Directive('@privilege(category: \"company\", privilege: \"query\")')\n @Query(returns => CompanyList)\n async companies(@Args() params: ListParam, @Ctx() context: any): Promise<CompanyList> {\n const { domain } = context.state\n const convertedParams = convertListParams(params, { domain })\n\n const [items, total] = await getRepository(Company).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater']\n })\n return { items, total }\n }\n\n @Directive('@privilege(category: \"company\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => BizplaceList)\n async companyBizplaces(@Ctx() context: any): Promise<BizplaceList> {\n const { domain, user } = context.state\n\n const userDomains: Domain[] = await getUserDomains(user)\n const company: Company = await getRepository(Company).findOne({\n domain\n })\n\n const [items, total] = await getRepository(Bizplace).findAndCount({\n where: { company, domain: In(userDomains.map(({ id }: Domain) => id)) },\n relations: ['domain']\n })\n\n return { items, total }\n }\n\n @Directive('@privilege(category: \"company\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => UserList)\n async companyUsers(@Ctx() context: any): Promise<UserList> {\n const { domain } = context.state\n\n const items: User[] = await getDomainUsers(domain)\n\n return {\n items,\n total: items.length\n }\n }\n}\n"]}
|
|
@@ -1,108 +1,100 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.NewCompany = exports.CompanyPatch = exports.CompanyList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
13
5
|
const type_graphql_1 = require("type-graphql");
|
|
14
6
|
const company_1 = require("./company");
|
|
15
7
|
let CompanyList = class CompanyList {
|
|
16
8
|
};
|
|
17
|
-
__decorate([
|
|
9
|
+
tslib_1.__decorate([
|
|
18
10
|
(0, type_graphql_1.Field)(type => [company_1.Company], { nullable: true }),
|
|
19
|
-
__metadata("design:type", Array)
|
|
11
|
+
tslib_1.__metadata("design:type", Array)
|
|
20
12
|
], CompanyList.prototype, "items", void 0);
|
|
21
|
-
__decorate([
|
|
13
|
+
tslib_1.__decorate([
|
|
22
14
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
23
|
-
__metadata("design:type", Number)
|
|
15
|
+
tslib_1.__metadata("design:type", Number)
|
|
24
16
|
], CompanyList.prototype, "total", void 0);
|
|
25
|
-
CompanyList = __decorate([
|
|
17
|
+
CompanyList = tslib_1.__decorate([
|
|
26
18
|
(0, type_graphql_1.ObjectType)()
|
|
27
19
|
], CompanyList);
|
|
28
20
|
exports.CompanyList = CompanyList;
|
|
29
21
|
let CompanyPatch = class CompanyPatch {
|
|
30
22
|
};
|
|
31
|
-
__decorate([
|
|
23
|
+
tslib_1.__decorate([
|
|
32
24
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
33
|
-
__metadata("design:type", String)
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
34
26
|
], CompanyPatch.prototype, "id", void 0);
|
|
35
|
-
__decorate([
|
|
27
|
+
tslib_1.__decorate([
|
|
36
28
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
-
__metadata("design:type", String)
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
38
30
|
], CompanyPatch.prototype, "name", void 0);
|
|
39
|
-
__decorate([
|
|
31
|
+
tslib_1.__decorate([
|
|
40
32
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
41
|
-
__metadata("design:type", String)
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
42
34
|
], CompanyPatch.prototype, "description", void 0);
|
|
43
|
-
__decorate([
|
|
35
|
+
tslib_1.__decorate([
|
|
44
36
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
-
__metadata("design:type", String)
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
46
38
|
], CompanyPatch.prototype, "countryCode", void 0);
|
|
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
|
], CompanyPatch.prototype, "brn", 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
|
], CompanyPatch.prototype, "address", 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
|
], CompanyPatch.prototype, "postalCode", void 0);
|
|
59
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
60
52
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
61
|
-
__metadata("design:type", String)
|
|
53
|
+
tslib_1.__metadata("design:type", String)
|
|
62
54
|
], CompanyPatch.prototype, "status", void 0);
|
|
63
|
-
__decorate([
|
|
55
|
+
tslib_1.__decorate([
|
|
64
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
-
__metadata("design:type", String)
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
66
58
|
], CompanyPatch.prototype, "cuFlag", void 0);
|
|
67
|
-
CompanyPatch = __decorate([
|
|
59
|
+
CompanyPatch = tslib_1.__decorate([
|
|
68
60
|
(0, type_graphql_1.InputType)()
|
|
69
61
|
], CompanyPatch);
|
|
70
62
|
exports.CompanyPatch = CompanyPatch;
|
|
71
63
|
let NewCompany = class NewCompany {
|
|
72
64
|
};
|
|
73
|
-
__decorate([
|
|
65
|
+
tslib_1.__decorate([
|
|
74
66
|
(0, type_graphql_1.Field)(),
|
|
75
|
-
__metadata("design:type", String)
|
|
67
|
+
tslib_1.__metadata("design:type", String)
|
|
76
68
|
], NewCompany.prototype, "name", void 0);
|
|
77
|
-
__decorate([
|
|
69
|
+
tslib_1.__decorate([
|
|
78
70
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
79
|
-
__metadata("design:type", String)
|
|
71
|
+
tslib_1.__metadata("design:type", String)
|
|
80
72
|
], NewCompany.prototype, "description", void 0);
|
|
81
|
-
__decorate([
|
|
73
|
+
tslib_1.__decorate([
|
|
82
74
|
(0, type_graphql_1.Field)(),
|
|
83
|
-
__metadata("design:type", String)
|
|
75
|
+
tslib_1.__metadata("design:type", String)
|
|
84
76
|
], NewCompany.prototype, "countryCode", void 0);
|
|
85
|
-
__decorate([
|
|
77
|
+
tslib_1.__decorate([
|
|
86
78
|
(0, type_graphql_1.Field)(),
|
|
87
|
-
__metadata("design:type", String)
|
|
79
|
+
tslib_1.__metadata("design:type", String)
|
|
88
80
|
], NewCompany.prototype, "brn", void 0);
|
|
89
|
-
__decorate([
|
|
81
|
+
tslib_1.__decorate([
|
|
90
82
|
(0, type_graphql_1.Field)(),
|
|
91
|
-
__metadata("design:type", String)
|
|
83
|
+
tslib_1.__metadata("design:type", String)
|
|
92
84
|
], NewCompany.prototype, "address", void 0);
|
|
93
|
-
__decorate([
|
|
85
|
+
tslib_1.__decorate([
|
|
94
86
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
95
|
-
__metadata("design:type", String)
|
|
87
|
+
tslib_1.__metadata("design:type", String)
|
|
96
88
|
], NewCompany.prototype, "postalCode", void 0);
|
|
97
|
-
__decorate([
|
|
89
|
+
tslib_1.__decorate([
|
|
98
90
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
99
|
-
__metadata("design:type", String)
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
100
92
|
], NewCompany.prototype, "type", void 0);
|
|
101
|
-
__decorate([
|
|
93
|
+
tslib_1.__decorate([
|
|
102
94
|
(0, type_graphql_1.Field)(),
|
|
103
|
-
__metadata("design:type", String)
|
|
95
|
+
tslib_1.__metadata("design:type", String)
|
|
104
96
|
], NewCompany.prototype, "status", void 0);
|
|
105
|
-
NewCompany = __decorate([
|
|
97
|
+
NewCompany = tslib_1.__decorate([
|
|
106
98
|
(0, type_graphql_1.InputType)()
|
|
107
99
|
], NewCompany);
|
|
108
100
|
exports.NewCompany = NewCompany;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company-types.js","sourceRoot":"","sources":["../../../server/service/company/company-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"company-types.js","sourceRoot":"","sources":["../../../server/service/company/company-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAChE,uCAAmC;AAGnC,IAAa,WAAW,GAAxB,MAAa,WAAW;CAMvB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC5B;AAGjB;IADC,IAAA,oBAAK,EAAC,IA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;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACb;AAGb;IADC,IAAA,oBAAK,GAAE;;0CACM;AAvBH,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAwBtB;AAxBY,gCAAU","sourcesContent":["import { ObjectType, InputType, Field, Int } from 'type-graphql'\nimport { Company } from './company'\n\n@ObjectType()\nexport class CompanyList {\n @Field(type => [Company], { nullable: true })\n items?: Company[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class CompanyPatch {\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 countryCode?: string\n\n @Field({ nullable: true })\n brn?: string\n\n @Field({ nullable: true })\n address?: string\n\n @Field({ nullable: true })\n postalCode?: string\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@InputType()\nexport class NewCompany {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field()\n countryCode: string\n\n @Field()\n brn: string\n\n @Field()\n address: string\n\n @Field({ nullable: true })\n postalCode: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field()\n status: string\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.Company = 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,107 +10,107 @@ const shell_1 = require("@things-factory/shell");
|
|
|
18
10
|
const bizplace_1 = require("../bizplace/bizplace");
|
|
19
11
|
let Company = class Company {
|
|
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
|
], Company.prototype, "id", void 0);
|
|
26
|
-
__decorate([
|
|
18
|
+
tslib_1.__decorate([
|
|
27
19
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
28
20
|
(0, type_graphql_1.Field)(type => shell_1.Domain),
|
|
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
|
], Company.prototype, "domain", void 0);
|
|
31
|
-
__decorate([
|
|
23
|
+
tslib_1.__decorate([
|
|
32
24
|
(0, typeorm_1.RelationId)((company) => company.domain),
|
|
33
25
|
(0, type_graphql_1.Field)(),
|
|
34
|
-
__metadata("design:type", String)
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
35
27
|
], Company.prototype, "domainId", void 0);
|
|
36
|
-
__decorate([
|
|
28
|
+
tslib_1.__decorate([
|
|
37
29
|
(0, typeorm_1.Column)(),
|
|
38
30
|
(0, type_graphql_1.Field)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
40
32
|
], Company.prototype, "name", void 0);
|
|
41
|
-
__decorate([
|
|
33
|
+
tslib_1.__decorate([
|
|
42
34
|
(0, typeorm_1.Column)({
|
|
43
35
|
nullable: true
|
|
44
36
|
}),
|
|
45
37
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
-
__metadata("design:type", String)
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
47
39
|
], Company.prototype, "description", void 0);
|
|
48
|
-
__decorate([
|
|
40
|
+
tslib_1.__decorate([
|
|
49
41
|
(0, typeorm_1.Column)(),
|
|
50
42
|
(0, type_graphql_1.Field)(),
|
|
51
|
-
__metadata("design:type", String)
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
52
44
|
], Company.prototype, "countryCode", void 0);
|
|
53
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
54
46
|
(0, typeorm_1.Column)(),
|
|
55
47
|
(0, type_graphql_1.Field)(),
|
|
56
|
-
__metadata("design:type", String)
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
57
49
|
], Company.prototype, "brn", void 0);
|
|
58
|
-
__decorate([
|
|
50
|
+
tslib_1.__decorate([
|
|
59
51
|
(0, typeorm_1.Column)(),
|
|
60
52
|
(0, type_graphql_1.Field)(),
|
|
61
|
-
__metadata("design:type", String)
|
|
53
|
+
tslib_1.__metadata("design:type", String)
|
|
62
54
|
], Company.prototype, "address", void 0);
|
|
63
|
-
__decorate([
|
|
55
|
+
tslib_1.__decorate([
|
|
64
56
|
(0, typeorm_1.Column)({
|
|
65
57
|
nullable: true
|
|
66
58
|
}),
|
|
67
59
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
68
|
-
__metadata("design:type", String)
|
|
60
|
+
tslib_1.__metadata("design:type", String)
|
|
69
61
|
], Company.prototype, "postalCode", void 0);
|
|
70
|
-
__decorate([
|
|
62
|
+
tslib_1.__decorate([
|
|
71
63
|
(0, typeorm_1.Column)({
|
|
72
64
|
nullable: true
|
|
73
65
|
}),
|
|
74
66
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
75
|
-
__metadata("design:type", String)
|
|
67
|
+
tslib_1.__metadata("design:type", String)
|
|
76
68
|
], Company.prototype, "type", void 0);
|
|
77
|
-
__decorate([
|
|
69
|
+
tslib_1.__decorate([
|
|
78
70
|
(0, typeorm_1.Column)({
|
|
79
71
|
nullable: true
|
|
80
72
|
}),
|
|
81
73
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
82
|
-
__metadata("design:type", String)
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
83
75
|
], Company.prototype, "status", void 0);
|
|
84
|
-
__decorate([
|
|
76
|
+
tslib_1.__decorate([
|
|
85
77
|
(0, typeorm_1.OneToMany)(type => bizplace_1.Bizplace, bizplace => bizplace.company),
|
|
86
78
|
(0, type_graphql_1.Field)(type => [bizplace_1.Bizplace]),
|
|
87
|
-
__metadata("design:type", Array)
|
|
79
|
+
tslib_1.__metadata("design:type", Array)
|
|
88
80
|
], Company.prototype, "bizplaces", void 0);
|
|
89
|
-
__decorate([
|
|
81
|
+
tslib_1.__decorate([
|
|
90
82
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
91
83
|
nullable: true
|
|
92
84
|
}),
|
|
93
85
|
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
94
|
-
__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
86
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
95
87
|
], Company.prototype, "creator", void 0);
|
|
96
|
-
__decorate([
|
|
88
|
+
tslib_1.__decorate([
|
|
97
89
|
(0, typeorm_1.RelationId)((company) => company.creator),
|
|
98
|
-
__metadata("design:type", String)
|
|
90
|
+
tslib_1.__metadata("design:type", String)
|
|
99
91
|
], Company.prototype, "creatorId", void 0);
|
|
100
|
-
__decorate([
|
|
92
|
+
tslib_1.__decorate([
|
|
101
93
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
102
94
|
nullable: true
|
|
103
95
|
}),
|
|
104
96
|
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
105
|
-
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
97
|
+
tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
106
98
|
], Company.prototype, "updater", void 0);
|
|
107
|
-
__decorate([
|
|
99
|
+
tslib_1.__decorate([
|
|
108
100
|
(0, typeorm_1.RelationId)((company) => company.updater),
|
|
109
|
-
__metadata("design:type", String)
|
|
101
|
+
tslib_1.__metadata("design:type", String)
|
|
110
102
|
], Company.prototype, "updaterId", void 0);
|
|
111
|
-
__decorate([
|
|
103
|
+
tslib_1.__decorate([
|
|
112
104
|
(0, typeorm_1.CreateDateColumn)(),
|
|
113
105
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
114
|
-
__metadata("design:type", Date)
|
|
106
|
+
tslib_1.__metadata("design:type", Date)
|
|
115
107
|
], Company.prototype, "createdAt", void 0);
|
|
116
|
-
__decorate([
|
|
108
|
+
tslib_1.__decorate([
|
|
117
109
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
118
110
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
119
|
-
__metadata("design:type", Date)
|
|
111
|
+
tslib_1.__metadata("design:type", Date)
|
|
120
112
|
], Company.prototype, "updatedAt", void 0);
|
|
121
|
-
Company = __decorate([
|
|
113
|
+
Company = tslib_1.__decorate([
|
|
122
114
|
(0, typeorm_1.Entity)(),
|
|
123
115
|
(0, typeorm_1.Index)('ix_companies_0', (company) => [company.name], { unique: true }),
|
|
124
116
|
(0, typeorm_1.Index)('ix_companies_1', (company) => [company.domain], { unique: false }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company.js","sourceRoot":"","sources":["../../../server/service/company/company.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"company.js","sourceRoot":"","sources":["../../../server/service/company/company.ts"],"names":[],"mappings":";;;;;AAAA,+CAAoD;AACpD,qCAUgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,mDAA+C;AAM/C,IAAa,OAAO,GAApB,MAAa,OAAO;CAkFnB,CAAA;AA/EC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;0DACd,cAAM,oBAAN,cAAM;uCAAA;AAId;IAFC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IAChD,IAAA,oBAAK,GAAE;;yCACQ;AAIhB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;qCACI;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACP;AAInB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;4CACW;AAInB;IAFC,IAAA,gBAAM,GAAE;IACR,IAA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AAC;0DAC/B,gBAAI,oBAAJ,gBAAI;wCAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CACjC;AAIjB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;0CAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;0CAAA;AAjFJ,OAAO;IAJnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/E,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAClF,IAAA,yBAAU,GAAE;GACA,OAAO,CAkFnB;AAlFY,0BAAO","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { Bizplace } from '../bizplace/bizplace'\n\n@Entity()\n@Index('ix_companies_0', (company: Company) => [company.name], { unique: true })\n@Index('ix_companies_1', (company: Company) => [company.domain], { unique: false })\n@ObjectType()\nexport class Company {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain: Domain\n\n @RelationId((company: Company) => company.domain)\n @Field()\n domainId: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @Column()\n @Field()\n countryCode: string\n\n @Column()\n @Field()\n brn: string\n\n @Column()\n @Field()\n address: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n postalCode: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n type: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n status: string\n\n @OneToMany(type => Bizplace, bizplace => bizplace.company)\n @Field(type => [Bizplace])\n bizplaces: Bizplace[]\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field(type => User, { nullable: true })\n creator: User\n\n @RelationId((company: Company) => company.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field(type => User, { nullable: true })\n updater: User\n\n @RelationId((company: Company) => company.updater)\n updaterId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/company/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/company/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA","sourcesContent":["import { Company } from './company'\nimport { CompanyMutation } from './company-mutation'\nimport { CompanyQuery } from './company-query'\n\nexport const entities = [Company]\nexport const resolvers = [CompanyQuery, CompanyMutation]\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.deleteContactPoint = exports.updateContactPoint = exports.createContactPoint = exports.ContactPointMutation = 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 bizplace_1 = require("../bizplace/bizplace");
|
|
@@ -77,53 +66,53 @@ let ContactPointMutation = class ContactPointMutation {
|
|
|
77
66
|
return true;
|
|
78
67
|
}
|
|
79
68
|
};
|
|
80
|
-
__decorate([
|
|
69
|
+
tslib_1.__decorate([
|
|
81
70
|
(0, type_graphql_1.Directive)('@privilege(category: "contact_point", privilege: "mutation")'),
|
|
82
71
|
(0, type_graphql_1.Mutation)(returns => contact_point_1.ContactPoint),
|
|
83
|
-
__param(0, (0, type_graphql_1.Arg)('contactPoint')),
|
|
84
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
85
|
-
__metadata("design:type", Function),
|
|
86
|
-
__metadata("design:paramtypes", [contact_point_types_1.NewContactPoint, Object]),
|
|
87
|
-
__metadata("design:returntype", Promise)
|
|
72
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('contactPoint')),
|
|
73
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
74
|
+
tslib_1.__metadata("design:type", Function),
|
|
75
|
+
tslib_1.__metadata("design:paramtypes", [contact_point_types_1.NewContactPoint, Object]),
|
|
76
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
88
77
|
], ContactPointMutation.prototype, "createContactPoint", null);
|
|
89
|
-
__decorate([
|
|
78
|
+
tslib_1.__decorate([
|
|
90
79
|
(0, type_graphql_1.Directive)('@privilege(category: "contact_point", privilege: "mutation")'),
|
|
91
80
|
(0, type_graphql_1.Mutation)(returns => contact_point_1.ContactPoint),
|
|
92
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
93
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
94
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
95
|
-
__metadata("design:type", Function),
|
|
96
|
-
__metadata("design:paramtypes", [String, contact_point_types_1.ContactPointPatch, Object]),
|
|
97
|
-
__metadata("design:returntype", Promise)
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
82
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
83
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
84
|
+
tslib_1.__metadata("design:type", Function),
|
|
85
|
+
tslib_1.__metadata("design:paramtypes", [String, contact_point_types_1.ContactPointPatch, Object]),
|
|
86
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
98
87
|
], ContactPointMutation.prototype, "updateContactPoint", null);
|
|
99
|
-
__decorate([
|
|
88
|
+
tslib_1.__decorate([
|
|
100
89
|
(0, type_graphql_1.Directive)('@privilege(category: "contact_point", privilege: "mutation")'),
|
|
101
90
|
(0, type_graphql_1.Mutation)(returns => [contact_point_1.ContactPoint]),
|
|
102
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [contact_point_types_1.ContactPointPatch])),
|
|
103
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
104
|
-
__metadata("design:type", Function),
|
|
105
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
106
|
-
__metadata("design:returntype", Promise)
|
|
91
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [contact_point_types_1.ContactPointPatch])),
|
|
92
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
93
|
+
tslib_1.__metadata("design:type", Function),
|
|
94
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
95
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
107
96
|
], ContactPointMutation.prototype, "updateMultipleContactPoint", null);
|
|
108
|
-
__decorate([
|
|
97
|
+
tslib_1.__decorate([
|
|
109
98
|
(0, type_graphql_1.Directive)('@privilege(category: "contact_point", privilege: "mutation")'),
|
|
110
99
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
111
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
112
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
113
|
-
__metadata("design:type", Function),
|
|
114
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
115
|
-
__metadata("design:returntype", Promise)
|
|
100
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
101
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
102
|
+
tslib_1.__metadata("design:type", Function),
|
|
103
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
104
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
116
105
|
], ContactPointMutation.prototype, "deleteContactPoint", null);
|
|
117
|
-
__decorate([
|
|
106
|
+
tslib_1.__decorate([
|
|
118
107
|
(0, type_graphql_1.Directive)('@privilege(category: "contact_point", privilege: "mutation")'),
|
|
119
108
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
120
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
121
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
122
|
-
__metadata("design:type", Function),
|
|
123
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
124
|
-
__metadata("design:returntype", Promise)
|
|
109
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
110
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
111
|
+
tslib_1.__metadata("design:type", Function),
|
|
112
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
113
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
125
114
|
], ContactPointMutation.prototype, "deleteContactPoints", null);
|
|
126
|
-
ContactPointMutation = __decorate([
|
|
115
|
+
ContactPointMutation = tslib_1.__decorate([
|
|
127
116
|
(0, type_graphql_1.Resolver)(contact_point_1.ContactPoint)
|
|
128
117
|
], ContactPointMutation);
|
|
129
118
|
exports.ContactPointMutation = ContactPointMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-point-mutation.js","sourceRoot":"","sources":["../../../server/service/contact-point/contact-point-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAAkE;AAKlE,mDAA+C;AAC/C,mDAA8C;AAC9C,+DAA0E;AAG1E,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAG/B,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAY;QAEnB,OAAO,MAAM,kBAAkB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACxD,CAAC;IAID,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAY;QAEnB,MAAM,YAAY,GAAG,MAAM,IAAA,uBAAa,EAAC,4BAAY,CA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C"}
|
|
1
|
+
{"version":3,"file":"contact-point-mutation.js","sourceRoot":"","sources":["../../../server/service/contact-point/contact-point-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAAkE;AAKlE,mDAA+C;AAC/C,mDAA8C;AAC9C,+DAA0E;AAG1E,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAG/B,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAY;QAEnB,OAAO,MAAM,kBAAkB,CAAC,YAAmB,EAAE,OAAO,CAAC,CAAA;IAC/D,CAAC;IAID,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAY;QAEnB,MAAM,YAAY,GAAG,MAAM,IAAA,uBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAElE,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE;YACvC,KAAK,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;SAC1E;QAED,OAAO,MAAM,IAAA,uBAAa,EAAC,4BAAY,CAAC,CAAC,IAAI,+CACxC,YAAY,GACZ,KAAK,KACR,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,0BAA0B,CACe,OAA4B,EAClE,OAAY;QAEnB,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;QACnD,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,MAAM,CACpE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YACjB,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE;gBACtC,O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AAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;KAC/D;IAED,OAAO,MAAM,gBAAgB,CAAC,IAAI,+CAC7B,YAAY,GACZ,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;AACJ,CAAC;AAzBD,gDAyBC;AAEM,KAAK,UAAU,kBAAkB,CAAC,EAAU,EAAE,EAAkB;IACrE,MAAM,gBAAgB,GAA6B,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,aAAa,CAAC,4BAAY,CAAC,KAAI,IAAA,uBAAa,EAAC,4BAAY,CAAC,CAAA;IACjH,MAAM,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AACnC,CAAC;AAHD,gDAGC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { EntityManager, getRepository, Repository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { Bizplace } from '../bizplace/bizplace'\nimport { ContactPoint } from './contact-point'\nimport { ContactPointPatch, NewContactPoint } from './contact-point-types'\n\n@Resolver(ContactPoint)\nexport class ContactPointMutation {\n @Directive('@privilege(category: \"contact_point\", privilege: \"mutation\")')\n @Mutation(returns => ContactPoint)\n async createContactPoint(\n @Arg('contactPoint') contactPoint: NewContactPoint,\n @Ctx() context: any\n ): Promise<ContactPoint> {\n return await createContactPoint(contactPoint as any, context)\n }\n\n @Directive('@privilege(category: \"contact_point\", privilege: \"mutation\")')\n @Mutation(returns => ContactPoint)\n async updateContactPoint(\n @Arg('id') id: string,\n @Arg('patch') patch: ContactPointPatch,\n @Ctx() context: any\n ): Promise<ContactPoint> {\n const contactPoint = await getRepository(ContactPoint).findOne(id)\n\n if (patch.bizplace && patch.bizplace.id) {\n patch.bizplace = await getRepository(Bizplace).findOne(patch.bizplace.id)\n }\n\n return await getRepository(ContactPoint).save({\n ...contactPoint,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Directive('@privilege(category: \"contact_point\", privilege: \"mutation\")')\n @Mutation(returns => [ContactPoint])\n async updateMultipleContactPoint(\n @Arg('patches', type => [ContactPointPatch]) patches: ContactPointPatch[],\n @Ctx() context: any\n ): Promise<ContactPoint[]> {\n const { tx }: { tx: EntityManager } = context.state\n let results = []\n const { createRecords, updateRecords, deleteRecords } = patches.reduce(\n (records, patch) => {\n if (patch.cuFlag.toUpperCase() === '+') {\n records.createRecords.push(patch)\n } else if (patch.cuFlag.toUpperCase() === 'M') {\n records.updateRecords.push(patch)\n } else {\n records.deleteRecords.push(patch)\n }\n return records\n },\n {\n createRecords: [],\n updateRecords: [],\n deleteRecords: []\n }\n )\n\n if (createRecords.length > 0) {\n for (let i = 0; i < createRecords.length; i++) {\n const result = await createContactPoint(createRecords[i], context, tx)\n results.push(result)\n }\n }\n\n if (updateRecords.length > 0) {\n for (let i = 0; i < updateRecords.length; i++) {\n const result = await updateContactPoint(updateRecords[i].id, updateRecords[i], context, tx)\n results.push(result)\n }\n }\n\n if (deleteRecords.length > 0) {\n for (let i = 0; i < deleteRecords.length; i++) {\n await deleteContactPoint(deleteRecords[i].id, tx)\n results.push(deleteRecords[i])\n }\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"contact_point\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteContactPoint(@Arg('id') id: string, @Ctx() context: any): Promise<Boolean> {\n await deleteContactPoint(id, context.state.tx)\n\n return true\n }\n\n @Directive('@privilege(category: \"contact_point\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteContactPoints(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<Boolean> {\n await getRepository(ContactPoint).delete(ids)\n\n return true\n }\n}\n\nexport async function createContactPoint(\n contactPoint: Partial<ContactPoint>,\n context: any,\n tx?: EntityManager\n): Promise<ContactPoint> {\n const { domain, user }: { domain: Domain; user: User } = context.state\n\n const bizplaceRepo: Repository<Bizplace> = tx?.getRepository(Bizplace) || getRepository(Bizplace)\n const contactPointRepo: Repository<ContactPoint> = tx?.getRepository(ContactPoint) || getRepository(ContactPoint)\n\n if (!contactPoint.bizplace?.id) {\n contactPoint.bizplace = await bizplaceRepo.findOne({ where: { name: domain.name } })\n } else {\n contactPoint.bizplace = await bizplaceRepo.findOne(contactPoint.bizplace.id)\n }\n\n return await contactPointRepo.save({\n ...contactPoint,\n domain,\n creator: user,\n updater: user\n })\n}\n\nexport async function updateContactPoint(\n id: string,\n patch: Partial<ContactPoint>,\n context: any,\n tx?: EntityManager\n): Promise<ContactPoint> {\n const bizplaceRepo: Repository<Bizplace> = tx?.getRepository(Bizplace) || getRepository(Bizplace)\n const contactPointRepo: Repository<ContactPoint> = tx?.getRepository(ContactPoint) || getRepository(ContactPoint)\n\n const { domain, user }: { domain: Domain; user: User } = context.state\n let contactPoint: ContactPoint = await contactPointRepo.findOne({ where: { id }, relations: ['bizplace'] })\n\n if (!contactPoint?.bizplace?.id) {\n patch.bizplace = await bizplaceRepo.findOne({ where: { name: domain.name } })\n }\n\n if (patch?.bizplace?.id) {\n patch.bizplace = await bizplaceRepo.findOne(patch.bizplace.id)\n }\n\n return await contactPointRepo.save({\n ...contactPoint,\n ...patch,\n updater: user\n })\n}\n\nexport async function deleteContactPoint(id: string, tx?: EntityManager): Promise<void> {\n const contactPointRepo: Repository<ContactPoint> = tx?.getRepository(ContactPoint) || getRepository(ContactPoint)\n await contactPointRepo.delete(id)\n}\n"]}
|