@things-factory/code-base 5.0.0 → 5.0.11
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 +3 -16
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/common-code/common-code-mutation.js +39 -50
- package/dist-server/service/common-code/common-code-mutation.js.map +1 -1
- package/dist-server/service/common-code/common-code-query.js +41 -52
- package/dist-server/service/common-code/common-code-query.js.map +1 -1
- package/dist-server/service/common-code/common-code-type.js +24 -32
- package/dist-server/service/common-code/common-code-type.js.map +1 -1
- package/dist-server/service/common-code/common-code.js +26 -34
- package/dist-server/service/common-code/common-code.js.map +1 -1
- package/dist-server/service/common-code/index.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail-mutation.js +39 -50
- package/dist-server/service/common-code-detail/common-code-detail-mutation.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail-query.js +33 -44
- package/dist-server/service/common-code-detail/common-code-detail-query.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail-type.js +28 -36
- package/dist-server/service/common-code-detail/common-code-detail-type.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail.js +30 -38
- package/dist-server/service/common-code-detail/common-code-detail.js.map +1 -1
- package/dist-server/service/common-code-detail/index.js.map +1 -1
- package/dist-server/service/index.js +3 -16
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -3
- package/dist-server/entities/common-code-detail.js +0 -70
- package/dist-server/entities/common-code-detail.js.map +0 -1
- package/dist-server/entities/common-code.js +0 -68
- package/dist-server/entities/common-code.js.map +0 -1
- package/dist-server/entities/index.js +0 -12
- package/dist-server/entities/index.js.map +0 -1
- package/dist-server/graphql/index.js +0 -34
- package/dist-server/graphql/index.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code/common-code-query.js +0 -39
- package/dist-server/graphql/resolvers/common-code/common-code-query.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code/create-common-code.js +0 -14
- package/dist-server/graphql/resolvers/common-code/create-common-code.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code/delete-common-code.js +0 -15
- package/dist-server/graphql/resolvers/common-code/delete-common-code.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code/delete-common-codes.js +0 -15
- package/dist-server/graphql/resolvers/common-code/delete-common-codes.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code/index.js +0 -15
- package/dist-server/graphql/resolvers/common-code/index.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code/update-common-code.js +0 -24
- package/dist-server/graphql/resolvers/common-code/update-common-code.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code/update-multiple-common-code.js +0 -32
- package/dist-server/graphql/resolvers/common-code/update-multiple-common-code.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code-detail/common-code-detail-query.js +0 -30
- package/dist-server/graphql/resolvers/common-code-detail/common-code-detail-query.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code-detail/create-common-code-detail.js +0 -14
- package/dist-server/graphql/resolvers/common-code-detail/create-common-code-detail.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code-detail/delete-common-code-detail.js +0 -15
- package/dist-server/graphql/resolvers/common-code-detail/delete-common-code-detail.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code-detail/delete-common-code-details.js +0 -15
- package/dist-server/graphql/resolvers/common-code-detail/delete-common-code-details.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code-detail/index.js +0 -15
- package/dist-server/graphql/resolvers/common-code-detail/index.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code-detail/update-common-code-detail.js +0 -15
- package/dist-server/graphql/resolvers/common-code-detail/update-common-code-detail.js.map +0 -1
- package/dist-server/graphql/resolvers/common-code-detail/update-multiple-common-code-detail.js +0 -39
- package/dist-server/graphql/resolvers/common-code-detail/update-multiple-common-code-detail.js.map +0 -1
- package/dist-server/graphql/resolvers/index.js +0 -19
- package/dist-server/graphql/resolvers/index.js.map +0 -1
- package/dist-server/graphql/types/common-code/common-code-list.js +0 -14
- package/dist-server/graphql/types/common-code/common-code-list.js.map +0 -1
- package/dist-server/graphql/types/common-code/common-code-patch.js +0 -17
- package/dist-server/graphql/types/common-code/common-code-patch.js.map +0 -1
- package/dist-server/graphql/types/common-code/common-code.js +0 -21
- package/dist-server/graphql/types/common-code/common-code.js.map +0 -1
- package/dist-server/graphql/types/common-code/index.js +0 -41
- package/dist-server/graphql/types/common-code/index.js.map +0 -1
- package/dist-server/graphql/types/common-code/new-common-code.js +0 -15
- package/dist-server/graphql/types/common-code/new-common-code.js.map +0 -1
- package/dist-server/graphql/types/common-code-detail/common-code-detail-list.js +0 -14
- package/dist-server/graphql/types/common-code-detail/common-code-detail-list.js.map +0 -1
- package/dist-server/graphql/types/common-code-detail/common-code-detail-patch.js +0 -18
- package/dist-server/graphql/types/common-code-detail/common-code-detail-patch.js.map +0 -1
- package/dist-server/graphql/types/common-code-detail/common-code-detail.js +0 -22
- package/dist-server/graphql/types/common-code-detail/common-code-detail.js.map +0 -1
- package/dist-server/graphql/types/common-code-detail/index.js +0 -39
- package/dist-server/graphql/types/common-code-detail/index.js.map +0 -1
- package/dist-server/graphql/types/common-code-detail/new-common-code-detail.js +0 -16
- package/dist-server/graphql/types/common-code-detail/new-common-code-detail.js.map +0 -1
- package/dist-server/graphql/types/index.js +0 -19
- package/dist-server/graphql/types/index.js.map +0 -1
package/dist-server/index.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
__exportStar(require("./
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./migrations"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./service"), exports);
|
|
19
6
|
//# sourceMappingURL=index.js.map
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,oDAAyB","sourcesContent":["export * from './migrations'\nexport * from './service'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA","sourcesContent":["const glob = require('glob')\nconst path = require('path')\n\nexport var migrations = []\n\nglob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function(file) {\n if (file.indexOf('index.js') !== -1) return\n migrations = migrations.concat(Object.values(require(path.resolve(file))) || [])\n})\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.CommonCodeMutation = 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 common_code_detail_1 = require("../common-code-detail/common-code-detail");
|
|
@@ -86,62 +75,62 @@ let CommonCodeMutation = class CommonCodeMutation {
|
|
|
86
75
|
return true;
|
|
87
76
|
}
|
|
88
77
|
};
|
|
89
|
-
__decorate([
|
|
78
|
+
tslib_1.__decorate([
|
|
90
79
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
91
80
|
(0, type_graphql_1.Mutation)(returns => common_code_1.CommonCode, { description: 'To create new CommonCode' }),
|
|
92
|
-
__param(0, (0, type_graphql_1.Arg)('commonCode')),
|
|
93
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
94
|
-
__metadata("design:type", Function),
|
|
95
|
-
__metadata("design:paramtypes", [common_code_type_1.NewCommonCode, Object]),
|
|
96
|
-
__metadata("design:returntype", Promise)
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('commonCode')),
|
|
82
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
83
|
+
tslib_1.__metadata("design:type", Function),
|
|
84
|
+
tslib_1.__metadata("design:paramtypes", [common_code_type_1.NewCommonCode, Object]),
|
|
85
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
97
86
|
], CommonCodeMutation.prototype, "createCommonCode", null);
|
|
98
|
-
__decorate([
|
|
87
|
+
tslib_1.__decorate([
|
|
99
88
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
100
89
|
(0, type_graphql_1.Mutation)(returns => common_code_1.CommonCode, { description: 'To modify CommonCode information' }),
|
|
101
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
102
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
103
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
104
|
-
__metadata("design:type", Function),
|
|
105
|
-
__metadata("design:paramtypes", [String, common_code_type_1.CommonCodePatch, Object]),
|
|
106
|
-
__metadata("design:returntype", Promise)
|
|
90
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
91
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
92
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
93
|
+
tslib_1.__metadata("design:type", Function),
|
|
94
|
+
tslib_1.__metadata("design:paramtypes", [String, common_code_type_1.CommonCodePatch, Object]),
|
|
95
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
107
96
|
], CommonCodeMutation.prototype, "updateCommonCode", null);
|
|
108
|
-
__decorate([
|
|
97
|
+
tslib_1.__decorate([
|
|
109
98
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
110
99
|
(0, type_graphql_1.Mutation)(returns => [common_code_1.CommonCode], { description: "To modify multiple CommonCodes' information" }),
|
|
111
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [common_code_type_1.CommonCodePatch])),
|
|
112
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
113
|
-
__metadata("design:type", Function),
|
|
114
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
115
|
-
__metadata("design:returntype", Promise)
|
|
100
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [common_code_type_1.CommonCodePatch])),
|
|
101
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
102
|
+
tslib_1.__metadata("design:type", Function),
|
|
103
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
104
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
116
105
|
], CommonCodeMutation.prototype, "updateMultipleCommonCode", null);
|
|
117
|
-
__decorate([
|
|
106
|
+
tslib_1.__decorate([
|
|
118
107
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
119
108
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete CommonCode' }),
|
|
120
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
121
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
122
|
-
__metadata("design:type", Function),
|
|
123
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
124
|
-
__metadata("design:returntype", Promise)
|
|
109
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
110
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
111
|
+
tslib_1.__metadata("design:type", Function),
|
|
112
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
113
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
125
114
|
], CommonCodeMutation.prototype, "deleteCommonCode", null);
|
|
126
|
-
__decorate([
|
|
115
|
+
tslib_1.__decorate([
|
|
127
116
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
128
117
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple CommonCodes' }),
|
|
129
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
130
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
131
|
-
__metadata("design:type", Function),
|
|
132
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
133
|
-
__metadata("design:returntype", Promise)
|
|
118
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
119
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
120
|
+
tslib_1.__metadata("design:type", Function),
|
|
121
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
122
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
134
123
|
], CommonCodeMutation.prototype, "deleteCommonCodes", null);
|
|
135
|
-
__decorate([
|
|
124
|
+
tslib_1.__decorate([
|
|
136
125
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
137
126
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple CommonCodes' }),
|
|
138
|
-
__param(0, (0, type_graphql_1.Arg)('commonCodes', type => [common_code_type_1.CommonCodePatch])),
|
|
139
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
140
|
-
__metadata("design:type", Function),
|
|
141
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
142
|
-
__metadata("design:returntype", Promise)
|
|
127
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('commonCodes', type => [common_code_type_1.CommonCodePatch])),
|
|
128
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
129
|
+
tslib_1.__metadata("design:type", Function),
|
|
130
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
131
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
143
132
|
], CommonCodeMutation.prototype, "importCommonCodes", null);
|
|
144
|
-
CommonCodeMutation = __decorate([
|
|
133
|
+
CommonCodeMutation = tslib_1.__decorate([
|
|
145
134
|
(0, type_graphql_1.Resolver)(common_code_1.CommonCode)
|
|
146
135
|
], CommonCodeMutation);
|
|
147
136
|
exports.CommonCodeMutation = CommonCodeMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-code-mutation.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common-code-mutation.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-mutation.ts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OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DAKnD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAS1E;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;IAC7C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAWP;AApIU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAqI9B;AArIY,gDAAkB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { getRepository, In } from 'typeorm'\n\nimport { CommonCodeDetail } from '../common-code-detail/common-code-detail'\nimport { CommonCode } from './common-code'\nimport { CommonCodePatch, NewCommonCode } from './common-code-type'\n\n@Resolver(CommonCode)\nexport class CommonCodeMutation {\n @Directive('@transaction')\n @Mutation(returns => CommonCode, { description: 'To create new CommonCode' })\n async createCommonCode(@Arg('commonCode') commonCode: NewCommonCode, @Ctx() context: any): Promise<CommonCode> {\n const { domain, user, tx } = context.state\n\n const details = await getRepository(CommonCodeDetail).findByIds(commonCode.details || [])\n\n return await tx.getRepository(CommonCode).save({\n ...commonCode,\n details,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => CommonCode, { description: 'To modify CommonCode information' })\n async updateCommonCode(\n @Arg('name') name: string,\n @Arg('patch') patch: CommonCodePatch,\n @Ctx() context: any\n ): Promise<CommonCode> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(CommonCode)\n const commonCode = await repository.findOne({\n where: { domain, name },\n relations: ['details']\n })\n\n const detailIds = commonCode.details.map(detail => detail.id)\n if (patch.details && patch.details.length) {\n patch.details.forEach((detailId: string) => {\n if (!detailIds.includes(detailId)) {\n detailIds.push(detailId)\n }\n })\n }\n\n return await repository.save({\n ...commonCode,\n ...patch,\n details: await getRepository(CommonCodeDetail).findByIds(detailIds),\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [CommonCode], { description: \"To modify multiple CommonCodes' information\" })\n async updateMultipleCommonCode(\n @Arg('patches', type => [CommonCodePatch]) patches: CommonCodePatch[],\n @Ctx() context: any\n ): Promise<CommonCode[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const commonCodeRepo = tx.getRepository(CommonCode)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await commonCodeRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\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 commonCode = await commonCodeRepo.findOne(newRecord.id)\n\n const result = await commonCodeRepo.save({\n ...commonCode,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete CommonCode' })\n async deleteCommonCode(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(CommonCode).delete({ domain, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple CommonCodes' })\n async deleteCommonCodes(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(CommonCode).delete({\n domain,\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple CommonCodes' })\n async importCommonCodes(\n @Arg('commonCodes', type => [CommonCodePatch]) commonCodes: CommonCodePatch[],\n @Ctx() context: any\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n commonCodes.map(async (commonCode: CommonCodePatch) => {\n const createdCommonCode: CommonCode = await tx.getRepository(CommonCode).save({ domain, ...commonCode })\n })\n )\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;
|
|
15
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
4
|
exports.CommonCodeQuery = 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");
|
|
@@ -59,60 +48,60 @@ let CommonCodeQuery = class CommonCodeQuery {
|
|
|
59
48
|
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(commonCode.creatorId);
|
|
60
49
|
}
|
|
61
50
|
};
|
|
62
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
63
52
|
(0, type_graphql_1.Query)(returns => common_code_1.CommonCode, { nullable: true, description: 'To fetch a CommonCode' }),
|
|
64
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
65
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
66
|
-
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
68
|
-
__metadata("design:returntype", Promise)
|
|
53
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
54
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
55
|
+
tslib_1.__metadata("design:type", Function),
|
|
56
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
57
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
69
58
|
], CommonCodeQuery.prototype, "commonCode", null);
|
|
70
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
71
60
|
(0, type_graphql_1.Query)(returns => common_code_type_1.CommonCodeList, { description: 'To fetch multiple CommonCodes' }),
|
|
72
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
73
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
74
|
-
__metadata("design:type", Function),
|
|
75
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
76
|
-
__metadata("design:returntype", Promise)
|
|
61
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
62
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
63
|
+
tslib_1.__metadata("design:type", Function),
|
|
64
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
65
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
77
66
|
], CommonCodeQuery.prototype, "commonCodes", null);
|
|
78
|
-
__decorate([
|
|
67
|
+
tslib_1.__decorate([
|
|
79
68
|
(0, type_graphql_1.Query)(returns => common_code_1.CommonCode, { description: "To fetch specific domain's CommonCodes by given name" }),
|
|
80
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
81
|
-
__param(1, (0, type_graphql_1.Arg)('partnerDomainId')),
|
|
82
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
83
|
-
__metadata("design:type", Function),
|
|
84
|
-
__metadata("design:paramtypes", [String, String, Object]),
|
|
85
|
-
__metadata("design:returntype", Promise)
|
|
69
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
70
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('partnerDomainId')),
|
|
71
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
72
|
+
tslib_1.__metadata("design:type", Function),
|
|
73
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Object]),
|
|
74
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
86
75
|
], CommonCodeQuery.prototype, "partnerCommonCode", null);
|
|
87
|
-
__decorate([
|
|
76
|
+
tslib_1.__decorate([
|
|
88
77
|
(0, type_graphql_1.FieldResolver)(type => [common_code_detail_1.CommonCodeDetail]),
|
|
89
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
90
|
-
__metadata("design:type", Function),
|
|
91
|
-
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
92
|
-
__metadata("design:returntype", Promise)
|
|
78
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
79
|
+
tslib_1.__metadata("design:type", Function),
|
|
80
|
+
tslib_1.__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
81
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
93
82
|
], CommonCodeQuery.prototype, "details", null);
|
|
94
|
-
__decorate([
|
|
83
|
+
tslib_1.__decorate([
|
|
95
84
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
96
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
97
|
-
__metadata("design:type", Function),
|
|
98
|
-
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
99
|
-
__metadata("design:returntype", Promise)
|
|
85
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
86
|
+
tslib_1.__metadata("design:type", Function),
|
|
87
|
+
tslib_1.__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
88
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
100
89
|
], CommonCodeQuery.prototype, "domain", null);
|
|
101
|
-
__decorate([
|
|
90
|
+
tslib_1.__decorate([
|
|
102
91
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
103
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
104
|
-
__metadata("design:type", Function),
|
|
105
|
-
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
106
|
-
__metadata("design:returntype", Promise)
|
|
92
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
93
|
+
tslib_1.__metadata("design:type", Function),
|
|
94
|
+
tslib_1.__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
95
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
107
96
|
], CommonCodeQuery.prototype, "updater", null);
|
|
108
|
-
__decorate([
|
|
97
|
+
tslib_1.__decorate([
|
|
109
98
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
110
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
113
|
-
__metadata("design:returntype", Promise)
|
|
99
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
100
|
+
tslib_1.__metadata("design:type", Function),
|
|
101
|
+
tslib_1.__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
102
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
114
103
|
], CommonCodeQuery.prototype, "creator", null);
|
|
115
|
-
CommonCodeQuery = __decorate([
|
|
104
|
+
CommonCodeQuery = tslib_1.__decorate([
|
|
116
105
|
(0, type_graphql_1.Resolver)(common_code_1.CommonCode)
|
|
117
106
|
], CommonCodeQuery);
|
|
118
107
|
exports.CommonCodeQuery = CommonCodeQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-code-query.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common-code-query.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAAwF;AAExF,iFAA2E;AAC3E,+CAA0C;AAC1C,yDAAmD;AAGnD,IAAa,eAAe,GAA5B,MAAa,eAAe;IAE1B,KAAK,CAAC,UAAU,CAAc,IAAY,EAAS,OAAY;QAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;IACJ,C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I,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAzDU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CA0D3B;AA1DY,0CAAe","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, ListParam } from '@things-factory/shell'\n\nimport { CommonCodeDetail } from '../common-code-detail/common-code-detail'\nimport { CommonCode } from './common-code'\nimport { CommonCodeList } from './common-code-type'\n\n@Resolver(CommonCode)\nexport class CommonCodeQuery {\n @Query(returns => CommonCode!, { nullable: true, description: 'To fetch a CommonCode' })\n async commonCode(@Arg('name') name: string, @Ctx() context: any): Promise<CommonCode> {\n const { domain } = context.state\n\n return await getRepository(CommonCode).findOne({\n where: { domain, name }\n })\n }\n\n @Query(returns => CommonCodeList, { description: 'To fetch multiple CommonCodes' })\n async commonCodes(@Args() params: ListParam, @Ctx() context: any): Promise<CommonCodeList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(CommonCode),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Query(returns => CommonCode, { description: \"To fetch specific domain's CommonCodes by given name\" })\n async partnerCommonCode(\n @Arg('name') name: string,\n @Arg('partnerDomainId') partnerDomainId: string,\n @Ctx() context: any\n ): Promise<CommonCode> {\n return await getRepository(CommonCode).findOne({\n where: { domain: partnerDomainId, name }\n })\n }\n\n @FieldResolver(type => [CommonCodeDetail])\n async details(@Root() commonCode: CommonCode): Promise<CommonCodeDetail[]> {\n return await getRepository(CommonCodeDetail).find({\n commonCode\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() commonCode: CommonCode): Promise<Domain> {\n return await getRepository(Domain).findOne(commonCode.domainId)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() commonCode: CommonCode): Promise<User> {\n return await getRepository(User).findOne(commonCode.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() commonCode: CommonCode): Promise<User> {\n return await getRepository(User).findOne(commonCode.creatorId)\n }\n}\n"]}
|
|
@@ -1,72 +1,64 @@
|
|
|
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.CommonCodeList = exports.CommonCodePatch = exports.NewCommonCode = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
13
5
|
const type_graphql_1 = require("type-graphql");
|
|
14
6
|
const common_code_1 = require("./common-code");
|
|
15
7
|
let NewCommonCode = class NewCommonCode {
|
|
16
8
|
};
|
|
17
|
-
__decorate([
|
|
9
|
+
tslib_1.__decorate([
|
|
18
10
|
(0, type_graphql_1.Field)(),
|
|
19
|
-
__metadata("design:type", String)
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
20
12
|
], NewCommonCode.prototype, "name", void 0);
|
|
21
|
-
__decorate([
|
|
13
|
+
tslib_1.__decorate([
|
|
22
14
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
|
-
__metadata("design:type", String)
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
24
16
|
], NewCommonCode.prototype, "description", void 0);
|
|
25
|
-
__decorate([
|
|
17
|
+
tslib_1.__decorate([
|
|
26
18
|
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
27
|
-
__metadata("design:type", Array)
|
|
19
|
+
tslib_1.__metadata("design:type", Array)
|
|
28
20
|
], NewCommonCode.prototype, "details", void 0);
|
|
29
|
-
NewCommonCode = __decorate([
|
|
21
|
+
NewCommonCode = tslib_1.__decorate([
|
|
30
22
|
(0, type_graphql_1.InputType)()
|
|
31
23
|
], NewCommonCode);
|
|
32
24
|
exports.NewCommonCode = NewCommonCode;
|
|
33
25
|
let CommonCodePatch = class CommonCodePatch {
|
|
34
26
|
};
|
|
35
|
-
__decorate([
|
|
27
|
+
tslib_1.__decorate([
|
|
36
28
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
37
|
-
__metadata("design:type", String)
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
38
30
|
], CommonCodePatch.prototype, "id", 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
|
], CommonCodePatch.prototype, "name", 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
|
], CommonCodePatch.prototype, "description", void 0);
|
|
47
|
-
__decorate([
|
|
39
|
+
tslib_1.__decorate([
|
|
48
40
|
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
49
|
-
__metadata("design:type", Array)
|
|
41
|
+
tslib_1.__metadata("design:type", Array)
|
|
50
42
|
], CommonCodePatch.prototype, "details", 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
|
], CommonCodePatch.prototype, "cuFlag", void 0);
|
|
55
|
-
CommonCodePatch = __decorate([
|
|
47
|
+
CommonCodePatch = tslib_1.__decorate([
|
|
56
48
|
(0, type_graphql_1.InputType)()
|
|
57
49
|
], CommonCodePatch);
|
|
58
50
|
exports.CommonCodePatch = CommonCodePatch;
|
|
59
51
|
let CommonCodeList = class CommonCodeList {
|
|
60
52
|
};
|
|
61
|
-
__decorate([
|
|
53
|
+
tslib_1.__decorate([
|
|
62
54
|
(0, type_graphql_1.Field)(type => [common_code_1.CommonCode]),
|
|
63
|
-
__metadata("design:type", Array)
|
|
55
|
+
tslib_1.__metadata("design:type", Array)
|
|
64
56
|
], CommonCodeList.prototype, "items", void 0);
|
|
65
|
-
__decorate([
|
|
57
|
+
tslib_1.__decorate([
|
|
66
58
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
67
|
-
__metadata("design:type", Number)
|
|
59
|
+
tslib_1.__metadata("design:type", Number)
|
|
68
60
|
], CommonCodeList.prototype, "total", void 0);
|
|
69
|
-
CommonCodeList = __decorate([
|
|
61
|
+
CommonCodeList = tslib_1.__decorate([
|
|
70
62
|
(0, type_graphql_1.ObjectType)()
|
|
71
63
|
], CommonCodeList);
|
|
72
64
|
exports.CommonCodeList = CommonCodeList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-code-type.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common-code-type.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,+CAA0C;AAG1C,IAAa,aAA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, Int, ObjectType } from 'type-graphql'\n\nimport { CommonCode } from './common-code'\n\n@InputType()\nexport class NewCommonCode {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [String], { nullable: true })\n details?: string[]\n}\n\n@InputType()\nexport class CommonCodePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => [String], { nullable: true })\n details?: string[]\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class CommonCodeList {\n @Field(type => [CommonCode])\n items: CommonCode[]\n\n @Field(type => Int)\n total: number\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.CommonCode = 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,69 +10,69 @@ const shell_1 = require("@things-factory/shell");
|
|
|
18
10
|
const common_code_detail_1 = require("../common-code-detail/common-code-detail");
|
|
19
11
|
let CommonCode = class CommonCode {
|
|
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
|
], CommonCode.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)({ 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
|
], CommonCode.prototype, "domain", void 0);
|
|
31
|
-
__decorate([
|
|
23
|
+
tslib_1.__decorate([
|
|
32
24
|
(0, typeorm_1.RelationId)((commonCode) => commonCode.domain),
|
|
33
|
-
__metadata("design:type", String)
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
34
26
|
], CommonCode.prototype, "domainId", void 0);
|
|
35
|
-
__decorate([
|
|
27
|
+
tslib_1.__decorate([
|
|
36
28
|
(0, typeorm_1.Column)(),
|
|
37
29
|
(0, type_graphql_1.Field)(),
|
|
38
|
-
__metadata("design:type", String)
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
39
31
|
], CommonCode.prototype, "name", void 0);
|
|
40
|
-
__decorate([
|
|
32
|
+
tslib_1.__decorate([
|
|
41
33
|
(0, typeorm_1.Column)({
|
|
42
34
|
nullable: true
|
|
43
35
|
}),
|
|
44
36
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
-
__metadata("design:type", String)
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
46
38
|
], CommonCode.prototype, "description", void 0);
|
|
47
|
-
__decorate([
|
|
39
|
+
tslib_1.__decorate([
|
|
48
40
|
(0, typeorm_1.OneToMany)(type => common_code_detail_1.CommonCodeDetail, commonCodeDetail => commonCodeDetail.commonCode),
|
|
49
|
-
__metadata("design:type", Array)
|
|
41
|
+
tslib_1.__metadata("design:type", Array)
|
|
50
42
|
], CommonCode.prototype, "details", void 0);
|
|
51
|
-
__decorate([
|
|
43
|
+
tslib_1.__decorate([
|
|
52
44
|
(0, typeorm_1.CreateDateColumn)(),
|
|
53
45
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
-
__metadata("design:type", Date)
|
|
46
|
+
tslib_1.__metadata("design:type", Date)
|
|
55
47
|
], CommonCode.prototype, "createdAt", void 0);
|
|
56
|
-
__decorate([
|
|
48
|
+
tslib_1.__decorate([
|
|
57
49
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
58
50
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
59
|
-
__metadata("design:type", Date)
|
|
51
|
+
tslib_1.__metadata("design:type", Date)
|
|
60
52
|
], CommonCode.prototype, "updatedAt", void 0);
|
|
61
|
-
__decorate([
|
|
53
|
+
tslib_1.__decorate([
|
|
62
54
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
63
55
|
nullable: true
|
|
64
56
|
}),
|
|
65
57
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
-
__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
58
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
67
59
|
], CommonCode.prototype, "creator", void 0);
|
|
68
|
-
__decorate([
|
|
60
|
+
tslib_1.__decorate([
|
|
69
61
|
(0, typeorm_1.RelationId)((commonCode) => commonCode.creator),
|
|
70
|
-
__metadata("design:type", String)
|
|
62
|
+
tslib_1.__metadata("design:type", String)
|
|
71
63
|
], CommonCode.prototype, "creatorId", void 0);
|
|
72
|
-
__decorate([
|
|
64
|
+
tslib_1.__decorate([
|
|
73
65
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
74
66
|
nullable: true
|
|
75
67
|
}),
|
|
76
68
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
-
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
69
|
+
tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
78
70
|
], CommonCode.prototype, "updater", void 0);
|
|
79
|
-
__decorate([
|
|
71
|
+
tslib_1.__decorate([
|
|
80
72
|
(0, typeorm_1.RelationId)((commonCode) => commonCode.creator),
|
|
81
|
-
__metadata("design:type", String)
|
|
73
|
+
tslib_1.__metadata("design:type", String)
|
|
82
74
|
], CommonCode.prototype, "updaterId", void 0);
|
|
83
|
-
CommonCode = __decorate([
|
|
75
|
+
CommonCode = tslib_1.__decorate([
|
|
84
76
|
(0, typeorm_1.Entity)(),
|
|
85
77
|
(0, typeorm_1.Index)('ix_common_code_0', (commonCode) => [commonCode.domain, commonCode.name], { unique: true }),
|
|
86
78
|
(0, typeorm_1.Index)('ix_common_code_1', (commonCode) => [commonCode.domain]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-code.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common-code.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code.ts"],"names":[],"mappings":";;;;;AAAA,+CAAoD;AACpD,qCAUgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,iFAA2E;AAM3E,IAAa,UAAU,GAAvB,MAAa,UAAU;CAkDtB,CAAA;AA/CC;I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B;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;0DAChB,gBAAI,oBAAJ,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAjDP,UAAU;IAJtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7G,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1E,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CAkDtB;AAlDY,gCAAU","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 { CommonCodeDetail } from '../common-code-detail/common-code-detail'\n\n@Entity()\n@Index('ix_common_code_0', (commonCode: CommonCode) => [commonCode.domain, commonCode.name], { unique: true })\n@Index('ix_common_code_1', (commonCode: CommonCode) => [commonCode.domain])\n@ObjectType({ description: 'Entity for CommonCode' })\nexport class CommonCode {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((commonCode: CommonCode) => commonCode.domain)\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 @OneToMany(type => CommonCodeDetail, commonCodeDetail => commonCodeDetail.commonCode)\n details: CommonCodeDetail[]\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 @RelationId((commonCode: CommonCode) => commonCode.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((commonCode: CommonCode) => commonCode.creator)\n updaterId?: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/common-code/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/common-code/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA","sourcesContent":["import { CommonCode } from './common-code'\nimport { CommonCodeQuery } from './common-code-query'\nimport { CommonCodeMutation } from './common-code-mutation'\n\nexport const entities = [CommonCode]\nexport const resolvers = [CommonCodeQuery, CommonCodeMutation]\n"]}
|