@things-factory/geography 4.3.671 → 4.3.672

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist-server/controllers/index.js +1 -0
  2. package/dist-server/controllers/index.js.map +1 -0
  3. package/dist-server/index.js +21 -0
  4. package/dist-server/index.js.map +1 -0
  5. package/dist-server/middlewares/index.js +8 -0
  6. package/dist-server/middlewares/index.js.map +1 -0
  7. package/dist-server/migrations/index.js +12 -0
  8. package/dist-server/migrations/index.js.map +1 -0
  9. package/dist-server/routes.js +25 -0
  10. package/dist-server/routes.js.map +1 -0
  11. package/dist-server/service/geo-area/geo-area-mutation.js +119 -0
  12. package/dist-server/service/geo-area/geo-area-mutation.js.map +1 -0
  13. package/dist-server/service/geo-area/geo-area-query.js +126 -0
  14. package/dist-server/service/geo-area/geo-area-query.js.map +1 -0
  15. package/dist-server/service/geo-area/geo-area-type.js +113 -0
  16. package/dist-server/service/geo-area/geo-area-type.js.map +1 -0
  17. package/dist-server/service/geo-area/geo-area.js +108 -0
  18. package/dist-server/service/geo-area/geo-area.js.map +1 -0
  19. package/dist-server/service/geo-area/index.js +9 -0
  20. package/dist-server/service/geo-area/index.js.map +1 -0
  21. package/dist-server/service/geo-city/geo-city-mutation.js +119 -0
  22. package/dist-server/service/geo-city/geo-city-mutation.js.map +1 -0
  23. package/dist-server/service/geo-city/geo-city-query.js +97 -0
  24. package/dist-server/service/geo-city/geo-city-query.js.map +1 -0
  25. package/dist-server/service/geo-city/geo-city-type.js +81 -0
  26. package/dist-server/service/geo-city/geo-city-type.js.map +1 -0
  27. package/dist-server/service/geo-city/geo-city.js +104 -0
  28. package/dist-server/service/geo-city/geo-city.js.map +1 -0
  29. package/dist-server/service/geo-city/index.js +9 -0
  30. package/dist-server/service/geo-city/index.js.map +1 -0
  31. package/dist-server/service/geo-continent/geo-continent-mutation.js +119 -0
  32. package/dist-server/service/geo-continent/geo-continent-mutation.js.map +1 -0
  33. package/dist-server/service/geo-continent/geo-continent-query.js +75 -0
  34. package/dist-server/service/geo-continent/geo-continent-query.js.map +1 -0
  35. package/dist-server/service/geo-continent/geo-continent-type.js +65 -0
  36. package/dist-server/service/geo-continent/geo-continent-type.js.map +1 -0
  37. package/dist-server/service/geo-continent/geo-continent.js +74 -0
  38. package/dist-server/service/geo-continent/geo-continent.js.map +1 -0
  39. package/dist-server/service/geo-continent/index.js +9 -0
  40. package/dist-server/service/geo-continent/index.js.map +1 -0
  41. package/dist-server/service/geo-country/geo-country-mutation.js +119 -0
  42. package/dist-server/service/geo-country/geo-country-mutation.js.map +1 -0
  43. package/dist-server/service/geo-country/geo-country-query.js +112 -0
  44. package/dist-server/service/geo-country/geo-country-query.js.map +1 -0
  45. package/dist-server/service/geo-country/geo-country-type.js +77 -0
  46. package/dist-server/service/geo-country/geo-country-type.js.map +1 -0
  47. package/dist-server/service/geo-country/geo-country.js +96 -0
  48. package/dist-server/service/geo-country/geo-country.js.map +1 -0
  49. package/dist-server/service/geo-country/index.js +9 -0
  50. package/dist-server/service/geo-country/index.js.map +1 -0
  51. package/dist-server/service/geo-state/geo-state-mutation.js +119 -0
  52. package/dist-server/service/geo-state/geo-state-mutation.js.map +1 -0
  53. package/dist-server/service/geo-state/geo-state-query.js +86 -0
  54. package/dist-server/service/geo-state/geo-state-query.js.map +1 -0
  55. package/dist-server/service/geo-state/geo-state-type.js +81 -0
  56. package/dist-server/service/geo-state/geo-state-type.js.map +1 -0
  57. package/dist-server/service/geo-state/geo-state.js +94 -0
  58. package/dist-server/service/geo-state/geo-state.js.map +1 -0
  59. package/dist-server/service/geo-state/index.js +9 -0
  60. package/dist-server/service/geo-state/index.js.map +1 -0
  61. package/dist-server/service/index.js +48 -0
  62. package/dist-server/service/index.js.map +1 -0
  63. package/package.json +4 -4
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./migrations"), exports);
18
+ __exportStar(require("./middlewares"), exports);
19
+ __exportStar(require("./service"), exports);
20
+ require("./routes");
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,gDAA6B;AAC7B,4CAAyB;AAEzB,oBAAiB"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initMiddlewares = void 0;
4
+ function initMiddlewares(app) {
5
+ /* can add middlewares into app */
6
+ }
7
+ exports.initMiddlewares = initMiddlewares;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAAC,GAAG;IACjC,kCAAkC;AACpC,CAAC;AAFD,0CAEC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrations = void 0;
4
+ const glob = require('glob');
5
+ const path = require('path');
6
+ exports.migrations = [];
7
+ glob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function (file) {
8
+ if (file.indexOf('index.js') !== -1)
9
+ return;
10
+ exports.migrations = exports.migrations.concat(Object.values(require(path.resolve(file))) || []);
11
+ });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,25 @@
1
+ const debug = require('debug')('things-factory:geography:routes');
2
+ process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) => {
3
+ /*
4
+ * can add global public routes to application (auth not required, tenancy not required)
5
+ *
6
+ * ex) routes.get('/path', async(context, next) => {})
7
+ * ex) routes.post('/path', async(context, next) => {})
8
+ */
9
+ });
10
+ process.on('bootstrap-module-global-private-route', (app, globalPrivateRouter) => {
11
+ /*
12
+ * can add global private routes to application (auth required, tenancy not required)
13
+ */
14
+ });
15
+ process.on('bootstrap-module-domain-public-route', (app, domainPublicRouter) => {
16
+ /*
17
+ * can add domain public routes to application (auth not required, tenancy required)
18
+ */
19
+ });
20
+ process.on('bootstrap-module-domain-private-route', (app, domainPrivateRouter) => {
21
+ /*
22
+ * can add domain private routes to application (auth required, tenancy required)
23
+ */
24
+ });
25
+ //# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,iCAAiC,CAAC,CAAA;AAEjE,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;;;;OAKG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.GeoAreaMutation = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const geo_area_1 = require("./geo-area");
19
+ const geo_area_type_1 = require("./geo-area-type");
20
+ let GeoAreaMutation = class GeoAreaMutation {
21
+ async createGeoArea(geoArea, context) {
22
+ const { user, tx } = context.state;
23
+ return await tx.getRepository(geo_area_1.GeoArea).save(Object.assign(Object.assign({}, geoArea), { creator: user, updater: user }));
24
+ }
25
+ async updateGeoArea(id, patch, context) {
26
+ const { user, tx } = context.state;
27
+ const repository = tx.getRepository(geo_area_1.GeoArea);
28
+ const geoArea = await repository.findOne({
29
+ where: { id }
30
+ });
31
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, geoArea), patch), { updater: user }));
32
+ }
33
+ async updateMultipleGeoArea(patches, context) {
34
+ const { user, tx } = context.state;
35
+ let results = [];
36
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
37
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
38
+ const geoAreaRepo = tx.getRepository(geo_area_1.GeoArea);
39
+ if (_createRecords.length > 0) {
40
+ for (let i = 0; i < _createRecords.length; i++) {
41
+ const newRecord = _createRecords[i];
42
+ const result = await geoAreaRepo.save(Object.assign(Object.assign({}, newRecord), { creator: user, updater: user }));
43
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
44
+ }
45
+ }
46
+ if (_updateRecords.length > 0) {
47
+ for (let i = 0; i < _updateRecords.length; i++) {
48
+ const newRecord = _updateRecords[i];
49
+ const geoArea = await geoAreaRepo.findOne(newRecord.id);
50
+ const result = await geoAreaRepo.save(Object.assign(Object.assign(Object.assign({}, geoArea), newRecord), { updater: user }));
51
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
52
+ }
53
+ }
54
+ return results;
55
+ }
56
+ async deleteGeoArea(id, context) {
57
+ const { tx } = context.state;
58
+ await tx.getRepository(geo_area_1.GeoArea).delete({ id });
59
+ return true;
60
+ }
61
+ async deleteGeoAreas(ids, context) {
62
+ const { domain, tx } = context.state;
63
+ await tx.getRepository(geo_area_1.GeoArea).delete({
64
+ id: (0, typeorm_1.In)(ids)
65
+ });
66
+ return true;
67
+ }
68
+ };
69
+ __decorate([
70
+ (0, type_graphql_1.Directive)('@transaction'),
71
+ (0, type_graphql_1.Mutation)(returns => geo_area_1.GeoArea, { description: 'To create new GeoArea' }),
72
+ __param(0, (0, type_graphql_1.Arg)('geoArea')),
73
+ __param(1, (0, type_graphql_1.Ctx)()),
74
+ __metadata("design:type", Function),
75
+ __metadata("design:paramtypes", [geo_area_type_1.NewGeoArea, Object]),
76
+ __metadata("design:returntype", Promise)
77
+ ], GeoAreaMutation.prototype, "createGeoArea", null);
78
+ __decorate([
79
+ (0, type_graphql_1.Directive)('@transaction'),
80
+ (0, type_graphql_1.Mutation)(returns => geo_area_1.GeoArea, { description: 'To modify GeoArea 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_area_type_1.GeoAreaPatch, Object]),
86
+ __metadata("design:returntype", Promise)
87
+ ], GeoAreaMutation.prototype, "updateGeoArea", null);
88
+ __decorate([
89
+ (0, type_graphql_1.Directive)('@transaction'),
90
+ (0, type_graphql_1.Mutation)(returns => [geo_area_1.GeoArea], { description: "To modify multiple GeoAreas' information" }),
91
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [geo_area_type_1.GeoAreaPatch])),
92
+ __param(1, (0, type_graphql_1.Ctx)()),
93
+ __metadata("design:type", Function),
94
+ __metadata("design:paramtypes", [Array, Object]),
95
+ __metadata("design:returntype", Promise)
96
+ ], GeoAreaMutation.prototype, "updateMultipleGeoArea", null);
97
+ __decorate([
98
+ (0, type_graphql_1.Directive)('@transaction'),
99
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete GeoArea' }),
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)
105
+ ], GeoAreaMutation.prototype, "deleteGeoArea", null);
106
+ __decorate([
107
+ (0, type_graphql_1.Directive)('@transaction'),
108
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple geoAreas' }),
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)
114
+ ], GeoAreaMutation.prototype, "deleteGeoAreas", null);
115
+ GeoAreaMutation = __decorate([
116
+ (0, type_graphql_1.Resolver)(geo_area_1.GeoArea)
117
+ ], GeoAreaMutation);
118
+ exports.GeoAreaMutation = GeoAreaMutation;
119
+ //# sourceMappingURL=geo-area-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-area-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,yCAAoC;AACpC,mDAA0D;AAGnD,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAY;QAC1E,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,IAAI,iCACtC,OAAO,KACV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C,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAQvE;AA9FU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CA+F3B;AA/FY,0CAAe"}
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var _a;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.GeoAreaQuery = void 0;
17
+ const auth_base_1 = require("@things-factory/auth-base");
18
+ const shell_1 = require("@things-factory/shell");
19
+ const type_graphql_1 = require("type-graphql");
20
+ const typeorm_1 = require("typeorm");
21
+ const geo_city_1 = require("../geo-city/geo-city");
22
+ const geo_area_1 = require("./geo-area");
23
+ const geo_area_type_1 = require("./geo-area-type");
24
+ let GeoAreaQuery = class GeoAreaQuery {
25
+ async geoArea(id, context) {
26
+ return await (0, typeorm_1.getRepository)(geo_area_1.GeoArea).findOne({
27
+ where: { id }
28
+ });
29
+ }
30
+ async geoAreas(params, context) {
31
+ const convertedParams = (0, shell_1.convertListParams)(params);
32
+ const [items, total] = await (0, typeorm_1.getRepository)(geo_area_1.GeoArea).findAndCount(convertedParams);
33
+ return { items, total };
34
+ }
35
+ async geoAreasAllPostCode(context) {
36
+ const result = await (0, typeorm_1.getRepository)(geo_area_1.GeoArea)
37
+ .createQueryBuilder('ga')
38
+ .select('ga.postal_code')
39
+ .distinct(true)
40
+ .orderBy('ga.postal_code')
41
+ .getRawMany();
42
+ const items = result.map(item => {
43
+ return {
44
+ postalCode: item.postal_code
45
+ };
46
+ });
47
+ const total = items.length;
48
+ return { items, total };
49
+ }
50
+ async geoAreasGetStateAndCityByPosCode(postCode, context) {
51
+ let result = await (0, typeorm_1.getRepository)(geo_area_1.GeoArea)
52
+ .createQueryBuilder('ga')
53
+ .select('ga.city_name', "cityName")
54
+ .addSelect('ga.state_name', "stateName")
55
+ .distinct(true)
56
+ .where('ga.postal_code = :postCode', { postCode: postCode })
57
+ .getRawOne();
58
+ return result;
59
+ }
60
+ async geoCity(geoArea) {
61
+ return await (0, typeorm_1.getRepository)(geo_city_1.GeoCity).findOne(geoArea.geoCityId);
62
+ }
63
+ async updater(geoArea) {
64
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoArea.updaterId);
65
+ }
66
+ async creator(geoArea) {
67
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoArea.creatorId);
68
+ }
69
+ };
70
+ __decorate([
71
+ (0, type_graphql_1.Query)(returns => geo_area_1.GeoArea, { description: 'To fetch a GeoArea' }),
72
+ __param(0, (0, type_graphql_1.Arg)('id')),
73
+ __param(1, (0, type_graphql_1.Ctx)()),
74
+ __metadata("design:type", Function),
75
+ __metadata("design:paramtypes", [String, Object]),
76
+ __metadata("design:returntype", Promise)
77
+ ], GeoAreaQuery.prototype, "geoArea", null);
78
+ __decorate([
79
+ (0, type_graphql_1.Query)(returns => geo_area_type_1.GeoAreaList, { description: 'To fetch multiple GeoAreas' }),
80
+ __param(0, (0, type_graphql_1.Args)()),
81
+ __param(1, (0, type_graphql_1.Ctx)()),
82
+ __metadata("design:type", Function),
83
+ __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
84
+ __metadata("design:returntype", Promise)
85
+ ], GeoAreaQuery.prototype, "geoAreas", null);
86
+ __decorate([
87
+ (0, type_graphql_1.Query)(returns => geo_area_type_1.GeoAreaList),
88
+ __param(0, (0, type_graphql_1.Ctx)()),
89
+ __metadata("design:type", Function),
90
+ __metadata("design:paramtypes", [Object]),
91
+ __metadata("design:returntype", Promise)
92
+ ], GeoAreaQuery.prototype, "geoAreasAllPostCode", null);
93
+ __decorate([
94
+ (0, type_graphql_1.Query)(returns => geo_area_1.GeoArea),
95
+ __param(0, (0, type_graphql_1.Arg)('postCode')),
96
+ __param(1, (0, type_graphql_1.Ctx)()),
97
+ __metadata("design:type", Function),
98
+ __metadata("design:paramtypes", [String, Object]),
99
+ __metadata("design:returntype", Promise)
100
+ ], GeoAreaQuery.prototype, "geoAreasGetStateAndCityByPosCode", null);
101
+ __decorate([
102
+ (0, type_graphql_1.FieldResolver)(type => geo_city_1.GeoCity),
103
+ __param(0, (0, type_graphql_1.Root)()),
104
+ __metadata("design:type", Function),
105
+ __metadata("design:paramtypes", [geo_area_1.GeoArea]),
106
+ __metadata("design:returntype", Promise)
107
+ ], GeoAreaQuery.prototype, "geoCity", null);
108
+ __decorate([
109
+ (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", [geo_area_1.GeoArea]),
113
+ __metadata("design:returntype", Promise)
114
+ ], GeoAreaQuery.prototype, "updater", null);
115
+ __decorate([
116
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
117
+ __param(0, (0, type_graphql_1.Root)()),
118
+ __metadata("design:type", Function),
119
+ __metadata("design:paramtypes", [geo_area_1.GeoArea]),
120
+ __metadata("design:returntype", Promise)
121
+ ], GeoAreaQuery.prototype, "creator", null);
122
+ GeoAreaQuery = __decorate([
123
+ (0, type_graphql_1.Resolver)(geo_area_1.GeoArea)
124
+ ], GeoAreaQuery);
125
+ exports.GeoAreaQuery = GeoAreaQuery;
126
+ //# sourceMappingURL=geo-area-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-area-query.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAgD;AAChD,iDAAoE;AACpE,+CAAmF;AACnF,qCAAuC;AACvC,mDAA8C;AAC9C,yCAAoC;AACpC,mDAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAY;QACtD,OAAO,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAS,MAAiB,EAAS,OAAY;QAC3D,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEjF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,mBAAmB,CAAQ,OAAY;QAC3C,MAAM,MAAM,GAAG,MAAM,IAAA,uBAAa,EAAC,kBAAO,CAAC;aACxC,kBAAkB,CAAC,IAAI,CAAC;aACxB,MAAM,CAAC,gBAAgB,CAAC;aACxB,QAAQ,CAAC,IAAI,CAAC;aACd,OAAO,CAAC,gBAAgB,CAAC;aACzB,UAAU,E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,oBAAoB,EAAE,CAAC;IAClD,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;2CAI1C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAW,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IAC7D,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;4CAKvC;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,2BAAW,CAAC;IACH,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAiB/B;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,kBAAO,CAAC;IACc,WAAA,IAAA,kBAAG,EAAC,UAAU,CAAC,CAAA;IAAoB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;oEAU/E;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAO,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAU,kBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAU,kBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAU,kBAAO;;2CAErC;AA9DU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CA+DxB;AA/DY,oCAAY"}
@@ -0,0 +1,113 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GeoAreaList = exports.GeoAreaPatch = exports.NewGeoArea = void 0;
13
+ const type_graphql_1 = require("type-graphql");
14
+ const geo_area_1 = require("./geo-area");
15
+ let NewGeoArea = class NewGeoArea {
16
+ };
17
+ __decorate([
18
+ (0, type_graphql_1.Field)(),
19
+ __metadata("design:type", String)
20
+ ], NewGeoArea.prototype, "name", void 0);
21
+ __decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true }),
23
+ __metadata("design:type", String)
24
+ ], NewGeoArea.prototype, "description", void 0);
25
+ __decorate([
26
+ (0, type_graphql_1.Field)({ nullable: true }),
27
+ __metadata("design:type", String)
28
+ ], NewGeoArea.prototype, "countryCode", void 0);
29
+ __decorate([
30
+ (0, type_graphql_1.Field)({ nullable: true }),
31
+ __metadata("design:type", String)
32
+ ], NewGeoArea.prototype, "cityName", void 0);
33
+ __decorate([
34
+ (0, type_graphql_1.Field)({ nullable: true }),
35
+ __metadata("design:type", String)
36
+ ], NewGeoArea.prototype, "stateName", void 0);
37
+ __decorate([
38
+ (0, type_graphql_1.Field)({ nullable: true }),
39
+ __metadata("design:type", String)
40
+ ], NewGeoArea.prototype, "postalCode", void 0);
41
+ __decorate([
42
+ (0, type_graphql_1.Field)({ nullable: true }),
43
+ __metadata("design:type", String)
44
+ ], NewGeoArea.prototype, "latitude", void 0);
45
+ __decorate([
46
+ (0, type_graphql_1.Field)({ nullable: true }),
47
+ __metadata("design:type", String)
48
+ ], NewGeoArea.prototype, "longitude", void 0);
49
+ NewGeoArea = __decorate([
50
+ (0, type_graphql_1.InputType)()
51
+ ], NewGeoArea);
52
+ exports.NewGeoArea = NewGeoArea;
53
+ let GeoAreaPatch = class GeoAreaPatch {
54
+ };
55
+ __decorate([
56
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
57
+ __metadata("design:type", String)
58
+ ], GeoAreaPatch.prototype, "id", void 0);
59
+ __decorate([
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ __metadata("design:type", String)
62
+ ], GeoAreaPatch.prototype, "name", void 0);
63
+ __decorate([
64
+ (0, type_graphql_1.Field)({ nullable: true }),
65
+ __metadata("design:type", String)
66
+ ], GeoAreaPatch.prototype, "description", void 0);
67
+ __decorate([
68
+ (0, type_graphql_1.Field)({ nullable: true }),
69
+ __metadata("design:type", String)
70
+ ], GeoAreaPatch.prototype, "countryCode", void 0);
71
+ __decorate([
72
+ (0, type_graphql_1.Field)({ nullable: true }),
73
+ __metadata("design:type", String)
74
+ ], GeoAreaPatch.prototype, "cityName", void 0);
75
+ __decorate([
76
+ (0, type_graphql_1.Field)({ nullable: true }),
77
+ __metadata("design:type", String)
78
+ ], GeoAreaPatch.prototype, "stateName", void 0);
79
+ __decorate([
80
+ (0, type_graphql_1.Field)({ nullable: true }),
81
+ __metadata("design:type", String)
82
+ ], GeoAreaPatch.prototype, "postalCode", void 0);
83
+ __decorate([
84
+ (0, type_graphql_1.Field)({ nullable: true }),
85
+ __metadata("design:type", String)
86
+ ], GeoAreaPatch.prototype, "latitude", void 0);
87
+ __decorate([
88
+ (0, type_graphql_1.Field)({ nullable: true }),
89
+ __metadata("design:type", String)
90
+ ], GeoAreaPatch.prototype, "longitude", void 0);
91
+ __decorate([
92
+ (0, type_graphql_1.Field)(),
93
+ __metadata("design:type", String)
94
+ ], GeoAreaPatch.prototype, "cuFlag", void 0);
95
+ GeoAreaPatch = __decorate([
96
+ (0, type_graphql_1.InputType)()
97
+ ], GeoAreaPatch);
98
+ exports.GeoAreaPatch = GeoAreaPatch;
99
+ let GeoAreaList = class GeoAreaList {
100
+ };
101
+ __decorate([
102
+ (0, type_graphql_1.Field)(type => [geo_area_1.GeoArea]),
103
+ __metadata("design:type", Array)
104
+ ], GeoAreaList.prototype, "items", void 0);
105
+ __decorate([
106
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
107
+ __metadata("design:type", Number)
108
+ ], GeoAreaList.prototype, "total", void 0);
109
+ GeoAreaList = __decorate([
110
+ (0, type_graphql_1.ObjectType)()
111
+ ], GeoAreaList);
112
+ exports.GeoAreaList = GeoAreaList;
113
+ //# sourceMappingURL=geo-area-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-area-type.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAoE;AACpE,yCAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAwBtB,CAAA;AAvBC;IAAC,IAAA,oBAAK,GAAE;;wCACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACP;AAEnB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAvBP,UAAU;IADt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
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var _a, _b;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.GeoArea = void 0;
14
+ const auth_base_1 = require("@things-factory/auth-base");
15
+ const type_graphql_1 = require("type-graphql");
16
+ const typeorm_1 = require("typeorm");
17
+ const geo_city_1 = require("../geo-city/geo-city");
18
+ let GeoArea = class GeoArea {
19
+ };
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
22
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
23
+ __metadata("design:type", String)
24
+ ], GeoArea.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(type => geo_city_1.GeoCity),
27
+ (0, type_graphql_1.Field)({ nullable: true }),
28
+ __metadata("design:type", geo_city_1.GeoCity)
29
+ ], GeoArea.prototype, "geoCity", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.RelationId)((geoArea) => geoArea.geoCity),
32
+ __metadata("design:type", String)
33
+ ], GeoArea.prototype, "geoCityId", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)(),
36
+ (0, type_graphql_1.Field)(),
37
+ __metadata("design:type", String)
38
+ ], GeoArea.prototype, "name", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ nullable: true }),
41
+ (0, type_graphql_1.Field)({ nullable: true }),
42
+ __metadata("design:type", String)
43
+ ], GeoArea.prototype, "description", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ nullable: true }),
46
+ (0, type_graphql_1.Field)({ nullable: true }),
47
+ __metadata("design:type", String)
48
+ ], GeoArea.prototype, "countryCode", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ nullable: true }),
51
+ (0, type_graphql_1.Field)({ nullable: true }),
52
+ __metadata("design:type", String)
53
+ ], GeoArea.prototype, "cityName", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ nullable: true }),
56
+ (0, type_graphql_1.Field)({ nullable: true }),
57
+ __metadata("design:type", String)
58
+ ], GeoArea.prototype, "stateName", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ nullable: true }),
61
+ (0, type_graphql_1.Field)({ nullable: true }),
62
+ __metadata("design:type", String)
63
+ ], GeoArea.prototype, "postalCode", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ nullable: true }),
66
+ (0, type_graphql_1.Field)({ nullable: true }),
67
+ __metadata("design:type", String)
68
+ ], GeoArea.prototype, "latitude", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ nullable: true }),
71
+ (0, type_graphql_1.Field)({ nullable: true }),
72
+ __metadata("design:type", String)
73
+ ], GeoArea.prototype, "longitude", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.CreateDateColumn)(),
76
+ (0, type_graphql_1.Field)({ nullable: true }),
77
+ __metadata("design:type", Date)
78
+ ], GeoArea.prototype, "createdAt", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.UpdateDateColumn)(),
81
+ (0, type_graphql_1.Field)({ nullable: true }),
82
+ __metadata("design:type", Date)
83
+ ], GeoArea.prototype, "updatedAt", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
86
+ (0, type_graphql_1.Field)({ nullable: true }),
87
+ __metadata("design:type", typeof (_a = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _a : Object)
88
+ ], GeoArea.prototype, "creator", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.RelationId)((geoArea) => geoArea.creator),
91
+ __metadata("design:type", String)
92
+ ], GeoArea.prototype, "creatorId", void 0);
93
+ __decorate([
94
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
95
+ (0, type_graphql_1.Field)({ nullable: true }),
96
+ __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
97
+ ], GeoArea.prototype, "updater", void 0);
98
+ __decorate([
99
+ (0, typeorm_1.RelationId)((geoArea) => geoArea.creator),
100
+ __metadata("design:type", String)
101
+ ], GeoArea.prototype, "updaterId", void 0);
102
+ GeoArea = __decorate([
103
+ (0, typeorm_1.Entity)(),
104
+ (0, typeorm_1.Index)('ix_geo_area_0', (geoArea) => [geoArea.geoCity, geoArea.name, geoArea.postalCode, geoArea.stateName], { unique: true }),
105
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for GeoArea' })
106
+ ], GeoArea);
107
+ exports.GeoArea = GeoArea;
108
+ //# sourceMappingURL=geo-area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-area.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,mDAA8C;AAKvC,IAAM,OAAO,GAAb,MAAM,OAAO;CAiEnB,CAAA;AAhEC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAO,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8B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area");
5
+ const geo_area_query_1 = require("./geo-area-query");
6
+ const geo_area_mutation_1 = require("./geo-area-mutation");
7
+ exports.entities = [geo_area_1.GeoArea];
8
+ exports.resolvers = [geo_area_query_1.GeoAreaQuery, geo_area_mutation_1.GeoAreaMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/geo-area/index.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA+C;AAC/C,2DAAqD;AAExC,QAAA,QAAQ,GAAG,CAAC,kBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,6BAAY,EAAE,mCAAe,CAAC,CAAA"}