@things-factory/geography 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/controllers/index.js.map +1 -1
- 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/routes.js +0 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/geo-area/geo-area-mutation.js +33 -44
- package/dist-server/service/geo-area/geo-area-mutation.js.map +1 -1
- package/dist-server/service/geo-area/geo-area-query.js +29 -40
- package/dist-server/service/geo-area/geo-area-query.js.map +1 -1
- package/dist-server/service/geo-area/geo-area-type.js +44 -52
- package/dist-server/service/geo-area/geo-area-type.js.map +1 -1
- package/dist-server/service/geo-area/geo-area.js +36 -44
- package/dist-server/service/geo-area/geo-area.js.map +1 -1
- package/dist-server/service/geo-area/index.js.map +1 -1
- package/dist-server/service/geo-city/geo-city-mutation.js +33 -44
- package/dist-server/service/geo-city/geo-city-mutation.js.map +1 -1
- package/dist-server/service/geo-city/geo-city-query.js +34 -45
- package/dist-server/service/geo-city/geo-city-query.js.map +1 -1
- package/dist-server/service/geo-city/geo-city-type.js +28 -36
- package/dist-server/service/geo-city/geo-city-type.js.map +1 -1
- package/dist-server/service/geo-city/geo-city.js +32 -40
- package/dist-server/service/geo-city/geo-city.js.map +1 -1
- package/dist-server/service/geo-city/index.js.map +1 -1
- package/dist-server/service/geo-continent/geo-continent-mutation.js +33 -44
- package/dist-server/service/geo-continent/geo-continent-mutation.js.map +1 -1
- package/dist-server/service/geo-continent/geo-continent-query.js +24 -35
- package/dist-server/service/geo-continent/geo-continent-query.js.map +1 -1
- package/dist-server/service/geo-continent/geo-continent-type.js +20 -28
- package/dist-server/service/geo-continent/geo-continent-type.js.map +1 -1
- package/dist-server/service/geo-continent/geo-continent.js +20 -28
- package/dist-server/service/geo-continent/geo-continent.js.map +1 -1
- package/dist-server/service/geo-continent/index.js.map +1 -1
- package/dist-server/service/geo-country/geo-country-mutation.js +33 -44
- package/dist-server/service/geo-country/geo-country-mutation.js.map +1 -1
- package/dist-server/service/geo-country/geo-country-query.js +29 -40
- package/dist-server/service/geo-country/geo-country-query.js.map +1 -1
- package/dist-server/service/geo-country/geo-country-type.js +24 -32
- package/dist-server/service/geo-country/geo-country-type.js.map +1 -1
- package/dist-server/service/geo-country/geo-country.js +26 -34
- package/dist-server/service/geo-country/geo-country.js.map +1 -1
- package/dist-server/service/geo-country/index.js.map +1 -1
- package/dist-server/service/geo-state/geo-state-mutation.js +33 -44
- package/dist-server/service/geo-state/geo-state-mutation.js.map +1 -1
- package/dist-server/service/geo-state/geo-state-query.js +29 -40
- package/dist-server/service/geo-state/geo-state-query.js.map +1 -1
- package/dist-server/service/geo-state/geo-state-type.js +28 -36
- package/dist-server/service/geo-state/geo-state-type.js.map +1 -1
- package/dist-server/service/geo-state/geo-state.js +28 -36
- package/dist-server/service/geo-state/geo-state.js.map +1 -1
- package/dist-server/service/geo-state/index.js.map +1 -1
- package/dist-server/service/index.js +6 -19
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +4 -4
- package/server/routes.ts +0 -2
|
@@ -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.GeoContinentMutation = 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 geo_continent_1 = require("./geo-continent");
|
|
@@ -66,53 +55,53 @@ let GeoContinentMutation = class GeoContinentMutation {
|
|
|
66
55
|
return true;
|
|
67
56
|
}
|
|
68
57
|
};
|
|
69
|
-
__decorate([
|
|
58
|
+
tslib_1.__decorate([
|
|
70
59
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
71
60
|
(0, type_graphql_1.Mutation)(returns => geo_continent_1.GeoContinent, { description: 'To create new GeoContinent' }),
|
|
72
|
-
__param(0, (0, type_graphql_1.Arg)('geoContinent')),
|
|
73
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
74
|
-
__metadata("design:type", Function),
|
|
75
|
-
__metadata("design:paramtypes", [geo_continent_type_1.NewGeoContinent, Object]),
|
|
76
|
-
__metadata("design:returntype", Promise)
|
|
61
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('geoContinent')),
|
|
62
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
63
|
+
tslib_1.__metadata("design:type", Function),
|
|
64
|
+
tslib_1.__metadata("design:paramtypes", [geo_continent_type_1.NewGeoContinent, Object]),
|
|
65
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
77
66
|
], GeoContinentMutation.prototype, "createGeoContinent", null);
|
|
78
|
-
__decorate([
|
|
67
|
+
tslib_1.__decorate([
|
|
79
68
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
80
69
|
(0, type_graphql_1.Mutation)(returns => geo_continent_1.GeoContinent, { description: 'To modify GeoContinent information' }),
|
|
81
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
82
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
83
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
84
|
-
__metadata("design:type", Function),
|
|
85
|
-
__metadata("design:paramtypes", [String, geo_continent_type_1.GeoContinentPatch, Object]),
|
|
86
|
-
__metadata("design:returntype", Promise)
|
|
70
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
71
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
72
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
73
|
+
tslib_1.__metadata("design:type", Function),
|
|
74
|
+
tslib_1.__metadata("design:paramtypes", [String, geo_continent_type_1.GeoContinentPatch, Object]),
|
|
75
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
87
76
|
], GeoContinentMutation.prototype, "updateGeoContinent", null);
|
|
88
|
-
__decorate([
|
|
77
|
+
tslib_1.__decorate([
|
|
89
78
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
90
79
|
(0, type_graphql_1.Mutation)(returns => [geo_continent_1.GeoContinent], { description: "To modify multiple GeoContinents' information" }),
|
|
91
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [geo_continent_type_1.GeoContinentPatch])),
|
|
92
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
93
|
-
__metadata("design:type", Function),
|
|
94
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
95
|
-
__metadata("design:returntype", Promise)
|
|
80
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [geo_continent_type_1.GeoContinentPatch])),
|
|
81
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
82
|
+
tslib_1.__metadata("design:type", Function),
|
|
83
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
84
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
96
85
|
], GeoContinentMutation.prototype, "updateMultipleGeoContinent", null);
|
|
97
|
-
__decorate([
|
|
86
|
+
tslib_1.__decorate([
|
|
98
87
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
99
88
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete GeoContinent' }),
|
|
100
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
101
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
102
|
-
__metadata("design:type", Function),
|
|
103
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
104
|
-
__metadata("design:returntype", Promise)
|
|
89
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
90
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
91
|
+
tslib_1.__metadata("design:type", Function),
|
|
92
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
93
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
105
94
|
], GeoContinentMutation.prototype, "deleteGeoContinent", null);
|
|
106
|
-
__decorate([
|
|
95
|
+
tslib_1.__decorate([
|
|
107
96
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
108
97
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple geoContinents' }),
|
|
109
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
110
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
113
|
-
__metadata("design:returntype", Promise)
|
|
98
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
99
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
100
|
+
tslib_1.__metadata("design:type", Function),
|
|
101
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
102
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
114
103
|
], GeoContinentMutation.prototype, "deleteGeoContinents", null);
|
|
115
|
-
GeoContinentMutation = __decorate([
|
|
104
|
+
GeoContinentMutation = tslib_1.__decorate([
|
|
116
105
|
(0, type_graphql_1.Resolver)(geo_continent_1.GeoContinent)
|
|
117
106
|
], GeoContinentMutation);
|
|
118
107
|
exports.GeoContinentMutation = GeoContinentMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-continent-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geo-continent-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,mDAA8C;AAC9C,6DAAyE;AAGzE,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAG/B,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAY;QAEnB,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAC,IAAI,iCAC3C,YAAY,KACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAY;QAEnB,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,4BAAY,CAAC,CAAA;QACjD,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,YAAY,GACZ,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AAC,IAAI,CAAC,CAAA;IACT,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,sCAAiB;;8DAevC;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;IAEnG,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,sCAAiB,CAAC,CAAC,CAAA;IAC3C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sEAuCP;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8DAKrD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAQ5E;AArGU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAsGhC;AAtGY,oDAAoB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { GeoContinent } from './geo-continent'\nimport { GeoContinentPatch, NewGeoContinent } from './geo-continent-type'\n\n@Resolver(GeoContinent)\nexport class GeoContinentMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoContinent, { description: 'To create new GeoContinent' })\n async createGeoContinent(\n @Arg('geoContinent') geoContinent: NewGeoContinent,\n @Ctx() context: any\n ): Promise<GeoContinent> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoContinent).save({\n ...geoContinent,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoContinent, { description: 'To modify GeoContinent information' })\n async updateGeoContinent(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoContinentPatch,\n @Ctx() context: any\n ): Promise<GeoContinent> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoContinent)\n const geoContinent = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoContinent,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoContinent], { description: \"To modify multiple GeoContinents' information\" })\n async updateMultipleGeoContinent(\n @Arg('patches', type => [GeoContinentPatch]) patches: GeoContinentPatch[],\n @Ctx() context: any\n ): Promise<GeoContinent[]> {\n const { 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 geoContinentRepo = tx.getRepository(GeoContinent)\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 geoContinentRepo.save({\n ...newRecord,\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 geoContinent = await geoContinentRepo.findOne(newRecord.id)\n\n const result = await geoContinentRepo.save({\n ...geoContinent,\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 GeoContinent' })\n async deleteGeoContinent(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoContinent).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoContinents' })\n async deleteGeoContinents(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoContinent).delete({\n id: In(ids)\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.GeoContinentQuery = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
17
6
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
18
7
|
const shell_1 = require("@things-factory/shell");
|
|
19
8
|
const type_graphql_1 = require("type-graphql");
|
|
@@ -38,37 +27,37 @@ let GeoContinentQuery = class GeoContinentQuery {
|
|
|
38
27
|
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoContinent.creatorId);
|
|
39
28
|
}
|
|
40
29
|
};
|
|
41
|
-
__decorate([
|
|
30
|
+
tslib_1.__decorate([
|
|
42
31
|
(0, type_graphql_1.Query)(returns => geo_continent_1.GeoContinent, { description: 'To fetch a GeoContinent' }),
|
|
43
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
44
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
45
|
-
__metadata("design:type", Function),
|
|
46
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
47
|
-
__metadata("design:returntype", Promise)
|
|
32
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
33
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
34
|
+
tslib_1.__metadata("design:type", Function),
|
|
35
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
36
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
48
37
|
], GeoContinentQuery.prototype, "geoContinent", null);
|
|
49
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
50
39
|
(0, type_graphql_1.Query)(returns => geo_continent_type_1.GeoContinentList, { description: 'To fetch multiple GeoContinents' }),
|
|
51
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
52
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
53
|
-
__metadata("design:type", Function),
|
|
54
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
55
|
-
__metadata("design:returntype", Promise)
|
|
40
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
41
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
42
|
+
tslib_1.__metadata("design:type", Function),
|
|
43
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
44
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
56
45
|
], GeoContinentQuery.prototype, "geoContinents", null);
|
|
57
|
-
__decorate([
|
|
46
|
+
tslib_1.__decorate([
|
|
58
47
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
59
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
60
|
-
__metadata("design:type", Function),
|
|
61
|
-
__metadata("design:paramtypes", [geo_continent_1.GeoContinent]),
|
|
62
|
-
__metadata("design:returntype", Promise)
|
|
48
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
49
|
+
tslib_1.__metadata("design:type", Function),
|
|
50
|
+
tslib_1.__metadata("design:paramtypes", [geo_continent_1.GeoContinent]),
|
|
51
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
63
52
|
], GeoContinentQuery.prototype, "updater", null);
|
|
64
|
-
__decorate([
|
|
53
|
+
tslib_1.__decorate([
|
|
65
54
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
66
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
67
|
-
__metadata("design:type", Function),
|
|
68
|
-
__metadata("design:paramtypes", [geo_continent_1.GeoContinent]),
|
|
69
|
-
__metadata("design:returntype", Promise)
|
|
55
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
56
|
+
tslib_1.__metadata("design:type", Function),
|
|
57
|
+
tslib_1.__metadata("design:paramtypes", [geo_continent_1.GeoContinent]),
|
|
58
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
70
59
|
], GeoContinentQuery.prototype, "creator", null);
|
|
71
|
-
GeoContinentQuery = __decorate([
|
|
60
|
+
GeoContinentQuery = tslib_1.__decorate([
|
|
72
61
|
(0, type_graphql_1.Resolver)(geo_continent_1.GeoContinent)
|
|
73
62
|
], GeoContinentQuery);
|
|
74
63
|
exports.GeoContinentQuery = GeoContinentQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-continent-query.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geo-continent-query.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-query.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,iDAAoE;AACpE,+CAAmF;AACnF,qCAAuC;AACvC,mDAA8C;AAC9C,6DAAuD;AAGvD,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAE5B,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAY;QAC3D,OAAO,MAAM,IAAA,uBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,aAAa,CAAS,MAAiB,EAAS,OAAY;QAChE,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,4BAAY,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEtF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,OAAO,CAAS,YAA0B;QAC9C,OAAO,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IAClE,CAAC;IAGD,KAAK,CAAC,OAAO,CAAS,YAA0B;QAC9C,OAAO,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IAClE,CAAC;CACF,CAAA;AAvBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,4BAAY,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAI/C;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,qCAAgB,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;IAClE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;iEAAjB,iBAAS,oBAAT,iBAAS;;sDAK5C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAxBU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CAyB7B;AAzBY,8CAAiB","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { convertListParams, ListParam } from '@things-factory/shell'\nimport { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\nimport { GeoContinent } from './geo-continent'\nimport { GeoContinentList } from './geo-continent-type'\n\n@Resolver(GeoContinent)\nexport class GeoContinentQuery {\n @Query(returns => GeoContinent, { description: 'To fetch a GeoContinent' })\n async geoContinent(@Arg('id') id: string, @Ctx() context: any): Promise<GeoContinent> {\n return await getRepository(GeoContinent).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoContinentList, { description: 'To fetch multiple GeoContinents' })\n async geoContinents(@Args() params: ListParam, @Ctx() context: any): Promise<GeoContinentList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoContinent).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOne(geoContinent.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOne(geoContinent.creatorId)\n }\n}\n"]}
|
|
@@ -1,64 +1,56 @@
|
|
|
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.GeoContinentList = exports.GeoContinentPatch = exports.NewGeoContinent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
13
5
|
const type_graphql_1 = require("type-graphql");
|
|
14
6
|
const geo_continent_1 = require("./geo-continent");
|
|
15
7
|
let NewGeoContinent = class NewGeoContinent {
|
|
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
|
], NewGeoContinent.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
|
], NewGeoContinent.prototype, "description", void 0);
|
|
25
|
-
NewGeoContinent = __decorate([
|
|
17
|
+
NewGeoContinent = tslib_1.__decorate([
|
|
26
18
|
(0, type_graphql_1.InputType)()
|
|
27
19
|
], NewGeoContinent);
|
|
28
20
|
exports.NewGeoContinent = NewGeoContinent;
|
|
29
21
|
let GeoContinentPatch = class GeoContinentPatch {
|
|
30
22
|
};
|
|
31
|
-
__decorate([
|
|
23
|
+
tslib_1.__decorate([
|
|
32
24
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
33
|
-
__metadata("design:type", String)
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
34
26
|
], GeoContinentPatch.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
|
], GeoContinentPatch.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
|
], GeoContinentPatch.prototype, "description", void 0);
|
|
43
|
-
__decorate([
|
|
35
|
+
tslib_1.__decorate([
|
|
44
36
|
(0, type_graphql_1.Field)(),
|
|
45
|
-
__metadata("design:type", String)
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
46
38
|
], GeoContinentPatch.prototype, "cuFlag", void 0);
|
|
47
|
-
GeoContinentPatch = __decorate([
|
|
39
|
+
GeoContinentPatch = tslib_1.__decorate([
|
|
48
40
|
(0, type_graphql_1.InputType)()
|
|
49
41
|
], GeoContinentPatch);
|
|
50
42
|
exports.GeoContinentPatch = GeoContinentPatch;
|
|
51
43
|
let GeoContinentList = class GeoContinentList {
|
|
52
44
|
};
|
|
53
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
54
46
|
(0, type_graphql_1.Field)(type => [geo_continent_1.GeoContinent]),
|
|
55
|
-
__metadata("design:type", Array)
|
|
47
|
+
tslib_1.__metadata("design:type", Array)
|
|
56
48
|
], GeoContinentList.prototype, "items", void 0);
|
|
57
|
-
__decorate([
|
|
49
|
+
tslib_1.__decorate([
|
|
58
50
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
59
|
-
__metadata("design:type", Number)
|
|
51
|
+
tslib_1.__metadata("design:type", Number)
|
|
60
52
|
], GeoContinentList.prototype, "total", void 0);
|
|
61
|
-
GeoContinentList = __decorate([
|
|
53
|
+
GeoContinentList = tslib_1.__decorate([
|
|
62
54
|
(0, type_graphql_1.ObjectType)()
|
|
63
55
|
], GeoContinentList);
|
|
64
56
|
exports.GeoContinentList = GeoContinentList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-continent-type.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geo-continent-type.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,mDAA8C;AAG9C,IAAa,eAAe,GAA5B,MAAa,eAAe;CAM3B,CAAA;AAJC;IADC,IAAA,oBAAK,GAAE;;6CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AALT,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAM3B;AANY,0CAAe;AAS5B,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;CAY7B,CAAA;AAVC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACN;AAGpB;IADC,IAAA,oBAAK,GAAE;;iDACM;AAXH,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAY7B;AAZY,8CAAiB;AAe9B,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAM5B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;AALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B;AANY,4CAAgB","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoContinent } from './geo-continent'\n\n@InputType()\nexport class NewGeoContinent {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class GeoContinentPatch {\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()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoContinentList {\n @Field(type => [GeoContinent])\n items: GeoContinent[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -1,71 +1,63 @@
|
|
|
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;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.GeoContinent = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
14
6
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
15
7
|
const type_graphql_1 = require("type-graphql");
|
|
16
8
|
const typeorm_1 = require("typeorm");
|
|
17
9
|
let GeoContinent = class GeoContinent {
|
|
18
10
|
};
|
|
19
|
-
__decorate([
|
|
11
|
+
tslib_1.__decorate([
|
|
20
12
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
13
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
22
|
-
__metadata("design:type", String)
|
|
14
|
+
tslib_1.__metadata("design:type", String)
|
|
23
15
|
], GeoContinent.prototype, "id", void 0);
|
|
24
|
-
__decorate([
|
|
16
|
+
tslib_1.__decorate([
|
|
25
17
|
(0, typeorm_1.Column)(),
|
|
26
18
|
(0, type_graphql_1.Field)(),
|
|
27
|
-
__metadata("design:type", String)
|
|
19
|
+
tslib_1.__metadata("design:type", String)
|
|
28
20
|
], GeoContinent.prototype, "name", void 0);
|
|
29
|
-
__decorate([
|
|
21
|
+
tslib_1.__decorate([
|
|
30
22
|
(0, typeorm_1.Column)({
|
|
31
23
|
nullable: true
|
|
32
24
|
}),
|
|
33
25
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
34
|
-
__metadata("design:type", String)
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
35
27
|
], GeoContinent.prototype, "description", void 0);
|
|
36
|
-
__decorate([
|
|
28
|
+
tslib_1.__decorate([
|
|
37
29
|
(0, typeorm_1.CreateDateColumn)(),
|
|
38
30
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
39
|
-
__metadata("design:type", Date)
|
|
31
|
+
tslib_1.__metadata("design:type", Date)
|
|
40
32
|
], GeoContinent.prototype, "createdAt", void 0);
|
|
41
|
-
__decorate([
|
|
33
|
+
tslib_1.__decorate([
|
|
42
34
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
43
35
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
44
|
-
__metadata("design:type", Date)
|
|
36
|
+
tslib_1.__metadata("design:type", Date)
|
|
45
37
|
], GeoContinent.prototype, "updatedAt", void 0);
|
|
46
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
47
39
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
48
40
|
nullable: true
|
|
49
41
|
}),
|
|
50
42
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
-
__metadata("design:type", typeof (_a = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _a : Object)
|
|
43
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _a : Object)
|
|
52
44
|
], GeoContinent.prototype, "creator", void 0);
|
|
53
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
54
46
|
(0, typeorm_1.RelationId)((geoContinent) => geoContinent.creator),
|
|
55
|
-
__metadata("design:type", String)
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
56
48
|
], GeoContinent.prototype, "creatorId", void 0);
|
|
57
|
-
__decorate([
|
|
49
|
+
tslib_1.__decorate([
|
|
58
50
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
59
51
|
nullable: true
|
|
60
52
|
}),
|
|
61
53
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
|
-
__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
54
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
63
55
|
], GeoContinent.prototype, "updater", void 0);
|
|
64
|
-
__decorate([
|
|
56
|
+
tslib_1.__decorate([
|
|
65
57
|
(0, typeorm_1.RelationId)((geoContinent) => geoContinent.creator),
|
|
66
|
-
__metadata("design:type", String)
|
|
58
|
+
tslib_1.__metadata("design:type", String)
|
|
67
59
|
], GeoContinent.prototype, "updaterId", void 0);
|
|
68
|
-
GeoContinent = __decorate([
|
|
60
|
+
GeoContinent = tslib_1.__decorate([
|
|
69
61
|
(0, typeorm_1.Entity)(),
|
|
70
62
|
(0, typeorm_1.Index)('ix_geo_continent_0', (geoContinent) => [geoContinent.name], { unique: true }),
|
|
71
63
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for GeoContinent' })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-continent.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geo-continent.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent.ts"],"names":[],"mappings":";;;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAKhB,IAAa,YAAY,GAAzB,MAAa,YAAY;CAwCxB,CAAA;AArCC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;wCACC;AAInB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;0CACI;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAIpB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;+CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;+CAAA;AAMhB;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;6CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC;;+CAC/C;AAMlB;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;6CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,YAA0B,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC;;+CAC/C;AAvCP,YAAY;IAHxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,YAA0B,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;GAC1C,YAAY,CAwCxB;AAxCY,oCAAY","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\n@Entity()\n@Index('ix_geo_continent_0', (geoContinent: GeoContinent) => [geoContinent.name], { unique: true })\n@ObjectType({ description: 'Entity for GeoContinent' })\nexport class GeoContinent {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: 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 @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((geoContinent: GeoContinent) => geoContinent.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoContinent: GeoContinent) => geoContinent.creator)\n updaterId?: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/geo-continent/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,+DAAyD;AACzD,qEAA+D;AAElD,QAAA,QAAQ,GAAG,CAAC,4BAAY,CAAC,CAAA;AACzB,QAAA,SAAS,GAAG,CAAC,uCAAiB,EAAE,6CAAoB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/geo-continent/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,+DAAyD;AACzD,qEAA+D;AAElD,QAAA,QAAQ,GAAG,CAAC,4BAAY,CAAC,CAAA;AACzB,QAAA,SAAS,GAAG,CAAC,uCAAiB,EAAE,6CAAoB,CAAC,CAAA","sourcesContent":["import { GeoContinent } from './geo-continent'\nimport { GeoContinentQuery } from './geo-continent-query'\nimport { GeoContinentMutation } from './geo-continent-mutation'\n\nexport const entities = [GeoContinent]\nexport const resolvers = [GeoContinentQuery, GeoContinentMutation]\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.GeoCountryMutation = 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 geo_country_1 = require("./geo-country");
|
|
@@ -66,53 +55,53 @@ let GeoCountryMutation = class GeoCountryMutation {
|
|
|
66
55
|
return true;
|
|
67
56
|
}
|
|
68
57
|
};
|
|
69
|
-
__decorate([
|
|
58
|
+
tslib_1.__decorate([
|
|
70
59
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
71
60
|
(0, type_graphql_1.Mutation)(returns => geo_country_1.GeoCountry, { description: 'To create new GeoCountry' }),
|
|
72
|
-
__param(0, (0, type_graphql_1.Arg)('geoCountry')),
|
|
73
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
74
|
-
__metadata("design:type", Function),
|
|
75
|
-
__metadata("design:paramtypes", [geo_country_type_1.NewGeoCountry, Object]),
|
|
76
|
-
__metadata("design:returntype", Promise)
|
|
61
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('geoCountry')),
|
|
62
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
63
|
+
tslib_1.__metadata("design:type", Function),
|
|
64
|
+
tslib_1.__metadata("design:paramtypes", [geo_country_type_1.NewGeoCountry, Object]),
|
|
65
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
77
66
|
], GeoCountryMutation.prototype, "createGeoCountry", null);
|
|
78
|
-
__decorate([
|
|
67
|
+
tslib_1.__decorate([
|
|
79
68
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
80
69
|
(0, type_graphql_1.Mutation)(returns => geo_country_1.GeoCountry, { description: 'To modify GeoCountry information' }),
|
|
81
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
82
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
83
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
84
|
-
__metadata("design:type", Function),
|
|
85
|
-
__metadata("design:paramtypes", [String, geo_country_type_1.GeoCountryPatch, Object]),
|
|
86
|
-
__metadata("design:returntype", Promise)
|
|
70
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
71
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
72
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
73
|
+
tslib_1.__metadata("design:type", Function),
|
|
74
|
+
tslib_1.__metadata("design:paramtypes", [String, geo_country_type_1.GeoCountryPatch, Object]),
|
|
75
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
87
76
|
], GeoCountryMutation.prototype, "updateGeoCountry", null);
|
|
88
|
-
__decorate([
|
|
77
|
+
tslib_1.__decorate([
|
|
89
78
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
90
79
|
(0, type_graphql_1.Mutation)(returns => [geo_country_1.GeoCountry], { description: "To modify multiple GeoCountries' information" }),
|
|
91
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [geo_country_type_1.GeoCountryPatch])),
|
|
92
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
93
|
-
__metadata("design:type", Function),
|
|
94
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
95
|
-
__metadata("design:returntype", Promise)
|
|
80
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [geo_country_type_1.GeoCountryPatch])),
|
|
81
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
82
|
+
tslib_1.__metadata("design:type", Function),
|
|
83
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
84
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
96
85
|
], GeoCountryMutation.prototype, "updateMultipleGeoCountry", null);
|
|
97
|
-
__decorate([
|
|
86
|
+
tslib_1.__decorate([
|
|
98
87
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
99
88
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete GeoCountry' }),
|
|
100
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
101
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
102
|
-
__metadata("design:type", Function),
|
|
103
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
104
|
-
__metadata("design:returntype", Promise)
|
|
89
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
90
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
91
|
+
tslib_1.__metadata("design:type", Function),
|
|
92
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
93
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
105
94
|
], GeoCountryMutation.prototype, "deleteGeoCountry", null);
|
|
106
|
-
__decorate([
|
|
95
|
+
tslib_1.__decorate([
|
|
107
96
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
108
97
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple geoCountrys' }),
|
|
109
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
110
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
113
|
-
__metadata("design:returntype", Promise)
|
|
98
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
99
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
100
|
+
tslib_1.__metadata("design:type", Function),
|
|
101
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
102
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
114
103
|
], GeoCountryMutation.prototype, "deleteGeoCountries", null);
|
|
115
|
-
GeoCountryMutation = __decorate([
|
|
104
|
+
GeoCountryMutation = tslib_1.__decorate([
|
|
116
105
|
(0, type_graphql_1.Resolver)(geo_country_1.GeoCountry)
|
|
117
106
|
], GeoCountryMutation);
|
|
118
107
|
exports.GeoCountryMutation = GeoCountryMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-country-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geo-country-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,+CAA0C;AAC1C,yDAAmE;AAGnE,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAG7B,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAY;QACtF,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACzC,UAAU,KACb,OAAO,EAAE,IAAI,EAC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,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DAQ3E;AAlGU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAmG9B;AAnGY,gDAAkB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { GeoCountry } from './geo-country'\nimport { GeoCountryPatch, NewGeoCountry } from './geo-country-type'\n\n@Resolver(GeoCountry)\nexport class GeoCountryMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoCountry, { description: 'To create new GeoCountry' })\n async createGeoCountry(@Arg('geoCountry') geoCountry: NewGeoCountry, @Ctx() context: any): Promise<GeoCountry> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoCountry).save({\n ...geoCountry,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoCountry, { description: 'To modify GeoCountry information' })\n async updateGeoCountry(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoCountryPatch,\n @Ctx() context: any\n ): Promise<GeoCountry> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoCountry)\n const geoCountry = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoCountry,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoCountry], { description: \"To modify multiple GeoCountries' information\" })\n async updateMultipleGeoCountry(\n @Arg('patches', type => [GeoCountryPatch]) patches: GeoCountryPatch[],\n @Ctx() context: any\n ): Promise<GeoCountry[]> {\n const { 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 geoCountryRepo = tx.getRepository(GeoCountry)\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 geoCountryRepo.save({\n ...newRecord,\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 geoCountry = await geoCountryRepo.findOne(newRecord.id)\n\n const result = await geoCountryRepo.save({\n ...geoCountry,\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 GeoCountry' })\n async deleteGeoCountry(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCountry).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoCountrys' })\n async deleteGeoCountries(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCountry).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
|