@things-factory/geography 5.0.7 → 6.0.0-alpha.0

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 (69) hide show
  1. package/dist-server/controllers/index.js.map +1 -1
  2. package/dist-server/index.js +4 -17
  3. package/dist-server/index.js.map +1 -1
  4. package/dist-server/middlewares/index.js.map +1 -1
  5. package/dist-server/migrations/index.js.map +1 -1
  6. package/dist-server/routes.js +0 -1
  7. package/dist-server/routes.js.map +1 -1
  8. package/dist-server/service/geo-area/geo-area-mutation.js +34 -45
  9. package/dist-server/service/geo-area/geo-area-mutation.js.map +1 -1
  10. package/dist-server/service/geo-area/geo-area-query.js +75 -48
  11. package/dist-server/service/geo-area/geo-area-query.js.map +1 -1
  12. package/dist-server/service/geo-area/geo-area-type.js +44 -52
  13. package/dist-server/service/geo-area/geo-area-type.js.map +1 -1
  14. package/dist-server/service/geo-area/geo-area.js +37 -46
  15. package/dist-server/service/geo-area/geo-area.js.map +1 -1
  16. package/dist-server/service/geo-area/index.js.map +1 -1
  17. package/dist-server/service/geo-city/geo-city-mutation.js +34 -45
  18. package/dist-server/service/geo-city/geo-city-mutation.js.map +1 -1
  19. package/dist-server/service/geo-city/geo-city-query.js +41 -54
  20. package/dist-server/service/geo-city/geo-city-query.js.map +1 -1
  21. package/dist-server/service/geo-city/geo-city-type.js +28 -36
  22. package/dist-server/service/geo-city/geo-city-type.js.map +1 -1
  23. package/dist-server/service/geo-city/geo-city.js +33 -42
  24. package/dist-server/service/geo-city/geo-city.js.map +1 -1
  25. package/dist-server/service/geo-city/index.js.map +1 -1
  26. package/dist-server/service/geo-continent/geo-continent-mutation.js +34 -45
  27. package/dist-server/service/geo-continent/geo-continent-mutation.js.map +1 -1
  28. package/dist-server/service/geo-continent/geo-continent-query.js +29 -42
  29. package/dist-server/service/geo-continent/geo-continent-query.js.map +1 -1
  30. package/dist-server/service/geo-continent/geo-continent-type.js +20 -28
  31. package/dist-server/service/geo-continent/geo-continent-type.js.map +1 -1
  32. package/dist-server/service/geo-continent/geo-continent.js +20 -29
  33. package/dist-server/service/geo-continent/geo-continent.js.map +1 -1
  34. package/dist-server/service/geo-continent/index.js.map +1 -1
  35. package/dist-server/service/geo-country/geo-country-mutation.js +34 -45
  36. package/dist-server/service/geo-country/geo-country-mutation.js.map +1 -1
  37. package/dist-server/service/geo-country/geo-country-query.js +46 -48
  38. package/dist-server/service/geo-country/geo-country-query.js.map +1 -1
  39. package/dist-server/service/geo-country/geo-country-type.js +24 -32
  40. package/dist-server/service/geo-country/geo-country-type.js.map +1 -1
  41. package/dist-server/service/geo-country/geo-country.js +26 -35
  42. package/dist-server/service/geo-country/geo-country.js.map +1 -1
  43. package/dist-server/service/geo-country/index.js.map +1 -1
  44. package/dist-server/service/geo-state/geo-state-mutation.js +34 -45
  45. package/dist-server/service/geo-state/geo-state-mutation.js.map +1 -1
  46. package/dist-server/service/geo-state/geo-state-query.js +35 -48
  47. package/dist-server/service/geo-state/geo-state-query.js.map +1 -1
  48. package/dist-server/service/geo-state/geo-state-type.js +28 -36
  49. package/dist-server/service/geo-state/geo-state-type.js.map +1 -1
  50. package/dist-server/service/geo-state/geo-state.js +28 -37
  51. package/dist-server/service/geo-state/geo-state.js.map +1 -1
  52. package/dist-server/service/geo-state/index.js.map +1 -1
  53. package/dist-server/service/index.js +6 -19
  54. package/dist-server/service/index.js.map +1 -1
  55. package/dist-server/tsconfig.tsbuildinfo +1 -0
  56. package/package.json +5 -5
  57. package/server/routes.ts +0 -2
  58. package/server/service/geo-area/geo-area-mutation.ts +11 -6
  59. package/server/service/geo-area/geo-area-query.ts +42 -8
  60. package/server/service/geo-area/geo-area.ts +1 -1
  61. package/server/service/geo-city/geo-city-mutation.ts +14 -6
  62. package/server/service/geo-city/geo-city-query.ts +10 -9
  63. package/server/service/geo-city/geo-city.ts +1 -1
  64. package/server/service/geo-continent/geo-continent-mutation.ts +10 -6
  65. package/server/service/geo-continent/geo-continent-query.ts +8 -7
  66. package/server/service/geo-country/geo-country-mutation.ts +13 -6
  67. package/server/service/geo-country/geo-country-query.ts +16 -8
  68. package/server/service/geo-state/geo-state-mutation.ts +10 -6
  69. package/server/service/geo-state/geo-state-query.ts +9 -8
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1,21 +1,8 @@
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
- __exportStar(require("./migrations"), exports);
18
- __exportStar(require("./middlewares"), exports);
19
- __exportStar(require("./service"), exports);
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./migrations"), exports);
5
+ tslib_1.__exportStar(require("./middlewares"), exports);
6
+ tslib_1.__exportStar(require("./service"), exports);
20
7
  require("./routes");
21
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,gDAA6B;AAC7B,4CAAyB;AAEzB,oBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,wDAA6B;AAC7B,oDAAyB;AAEzB,oBAAiB","sourcesContent":["export * from './migrations'\nexport * from './middlewares'\nexport * from './service'\n\nimport './routes'\n"]}
@@ -1 +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"}
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","sourcesContent":["export function initMiddlewares(app) {\n /* can add middlewares into app */\n}\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,4 +1,3 @@
1
- const debug = require('debug')('things-factory:geography:routes');
2
1
  process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) => {
3
2
  /*
4
3
  * can add global public routes to application (auth not required, tenancy not required)
@@ -1 +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"}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":"AAAA,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","sourcesContent":["process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n /*\n * can add global public routes to application (auth not required, tenancy not required)\n *\n * ex) routes.get('/path', async(context, next) => {})\n * ex) routes.post('/path', async(context, next) => {})\n */\n})\n\nprocess.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {\n /*\n * can add global private routes to application (auth required, tenancy not required)\n */\n})\n\nprocess.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {\n /*\n * can add domain public routes to application (auth not required, tenancy required)\n */\n})\n\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {\n /*\n * can add domain private routes to application (auth required, tenancy required)\n */\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.GeoAreaMutation = 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_area_1 = require("./geo-area");
@@ -46,7 +35,7 @@ let GeoAreaMutation = class GeoAreaMutation {
46
35
  if (_updateRecords.length > 0) {
47
36
  for (let i = 0; i < _updateRecords.length; i++) {
48
37
  const newRecord = _updateRecords[i];
49
- const geoArea = await geoAreaRepo.findOne(newRecord.id);
38
+ const geoArea = await geoAreaRepo.findOneBy({ id: newRecord.id });
50
39
  const result = await geoAreaRepo.save(Object.assign(Object.assign(Object.assign({}, geoArea), newRecord), { updater: user }));
51
40
  results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
52
41
  }
@@ -66,53 +55,53 @@ let GeoAreaMutation = class GeoAreaMutation {
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_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)
61
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('geoArea')),
62
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
63
+ tslib_1.__metadata("design:type", Function),
64
+ tslib_1.__metadata("design:paramtypes", [geo_area_type_1.NewGeoArea, Object]),
65
+ tslib_1.__metadata("design:returntype", Promise)
77
66
  ], GeoAreaMutation.prototype, "createGeoArea", null);
78
- __decorate([
67
+ tslib_1.__decorate([
79
68
  (0, type_graphql_1.Directive)('@transaction'),
80
69
  (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)
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_area_type_1.GeoAreaPatch, Object]),
75
+ tslib_1.__metadata("design:returntype", Promise)
87
76
  ], GeoAreaMutation.prototype, "updateGeoArea", null);
88
- __decorate([
77
+ tslib_1.__decorate([
89
78
  (0, type_graphql_1.Directive)('@transaction'),
90
79
  (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)
80
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [geo_area_type_1.GeoAreaPatch])),
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
  ], GeoAreaMutation.prototype, "updateMultipleGeoArea", 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 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)
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
  ], GeoAreaMutation.prototype, "deleteGeoArea", 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 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)
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
  ], GeoAreaMutation.prototype, "deleteGeoAreas", null);
115
- GeoAreaMutation = __decorate([
104
+ GeoAreaMutation = tslib_1.__decorate([
116
105
  (0, type_graphql_1.Resolver)(geo_area_1.GeoArea)
117
106
  ], GeoAreaMutation);
118
107
  exports.GeoAreaMutation = GeoAreaMutation;
@@ -1 +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;AAG1D,IAAa,eAAe,GAA5B,MAAa,eAAe;IAG1B,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,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,aAAa,CAAY,EAAU,EAAgB,KAAmB,EAAS,OAAY;QAC/F,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACvC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,OAAO,GACP,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,qBAAqB,CACe,OAAuB,EACxD,OAAY;QAEnB,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,IAA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IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAQvE;AAlGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CAmG3B;AAnGY,0CAAe","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GeoArea } from './geo-area'\nimport { GeoAreaPatch, NewGeoArea } from './geo-area-type'\n\n@Resolver(GeoArea)\nexport class GeoAreaMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoArea, { description: 'To create new GeoArea' })\n async createGeoArea(@Arg('geoArea') geoArea: NewGeoArea, @Ctx() context: ResolverContext): Promise<GeoArea> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoArea).save({\n ...geoArea,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoArea, { description: 'To modify GeoArea information' })\n async updateGeoArea(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoAreaPatch,\n @Ctx() context: ResolverContext\n ): Promise<GeoArea> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoArea)\n const geoArea = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoArea,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoArea], { description: \"To modify multiple GeoAreas' information\" })\n async updateMultipleGeoArea(\n @Arg('patches', type => [GeoAreaPatch]) patches: GeoAreaPatch[],\n @Ctx() context: ResolverContext\n ): Promise<GeoArea[]> {\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 geoAreaRepo = tx.getRepository(GeoArea)\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 geoAreaRepo.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 geoArea = await geoAreaRepo.findOneBy({ id: newRecord.id })\n\n const result = await geoAreaRepo.save({\n ...geoArea,\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 GeoArea' })\n async deleteGeoArea(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoArea).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoAreas' })\n async deleteGeoAreas(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(GeoArea).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -1,85 +1,112 @@
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
- var _a;
15
2
  Object.defineProperty(exports, "__esModule", { value: true });
16
3
  exports.GeoAreaQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
17
6
  const auth_base_1 = require("@things-factory/auth-base");
18
7
  const shell_1 = require("@things-factory/shell");
19
- const type_graphql_1 = require("type-graphql");
20
- const typeorm_1 = require("typeorm");
21
8
  const geo_city_1 = require("../geo-city/geo-city");
22
9
  const geo_area_1 = require("./geo-area");
23
10
  const geo_area_type_1 = require("./geo-area-type");
24
11
  let GeoAreaQuery = class GeoAreaQuery {
25
12
  async geoArea(id, context) {
26
- return await (0, typeorm_1.getRepository)(geo_area_1.GeoArea).findOne({
13
+ return await (0, shell_1.getRepository)(geo_area_1.GeoArea).findOne({
27
14
  where: { id }
28
15
  });
29
16
  }
30
17
  async geoAreas(params, context) {
31
18
  const convertedParams = (0, shell_1.convertListParams)(params);
32
- const [items, total] = await (0, typeorm_1.getRepository)(geo_area_1.GeoArea).findAndCount(convertedParams);
19
+ const [items, total] = await (0, shell_1.getRepository)(geo_area_1.GeoArea).findAndCount(convertedParams);
33
20
  return { items, total };
34
21
  }
22
+ async geoAreasAllPostCode(context) {
23
+ const result = await (0, shell_1.getRepository)(geo_area_1.GeoArea)
24
+ .createQueryBuilder('ga')
25
+ .select('ga.postal_code')
26
+ .distinct(true)
27
+ .orderBy('ga.postal_code')
28
+ .getRawMany();
29
+ const items = result.map(item => {
30
+ return {
31
+ postalCode: item.postal_code
32
+ };
33
+ });
34
+ const total = items.length;
35
+ return { items, total };
36
+ }
37
+ async geoAreasGetStateAndCityByPosCode(postCode, context) {
38
+ let result = await (0, shell_1.getRepository)(geo_area_1.GeoArea)
39
+ .createQueryBuilder('ga')
40
+ .select('ga.city_name', 'cityName')
41
+ .addSelect('ga.state_name', 'stateName')
42
+ .distinct(true)
43
+ .where('ga.postal_code = :postCode', { postCode: postCode })
44
+ .getRawOne();
45
+ return result;
46
+ }
35
47
  async geoCity(geoArea) {
36
- return await (0, typeorm_1.getRepository)(geo_city_1.GeoCity).findOne(geoArea.geoCityId);
48
+ return await (0, shell_1.getRepository)(geo_city_1.GeoCity).findOneBy({ id: geoArea.geoCityId });
37
49
  }
38
50
  async updater(geoArea) {
39
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoArea.updaterId);
51
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoArea.updaterId });
40
52
  }
41
53
  async creator(geoArea) {
42
- return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(geoArea.creatorId);
54
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoArea.creatorId });
43
55
  }
44
56
  };
45
- __decorate([
57
+ tslib_1.__decorate([
46
58
  (0, type_graphql_1.Query)(returns => geo_area_1.GeoArea, { description: 'To fetch a GeoArea' }),
47
- __param(0, (0, type_graphql_1.Arg)('id')),
48
- __param(1, (0, type_graphql_1.Ctx)()),
49
- __metadata("design:type", Function),
50
- __metadata("design:paramtypes", [String, Object]),
51
- __metadata("design:returntype", Promise)
59
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
60
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
61
+ tslib_1.__metadata("design:type", Function),
62
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
63
+ tslib_1.__metadata("design:returntype", Promise)
52
64
  ], GeoAreaQuery.prototype, "geoArea", null);
53
- __decorate([
65
+ tslib_1.__decorate([
54
66
  (0, type_graphql_1.Query)(returns => geo_area_type_1.GeoAreaList, { description: 'To fetch multiple GeoAreas' }),
55
- __param(0, (0, type_graphql_1.Args)()),
56
- __param(1, (0, type_graphql_1.Ctx)()),
57
- __metadata("design:type", Function),
58
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
59
- __metadata("design:returntype", Promise)
67
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
68
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
69
+ tslib_1.__metadata("design:type", Function),
70
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
71
+ tslib_1.__metadata("design:returntype", Promise)
60
72
  ], GeoAreaQuery.prototype, "geoAreas", null);
61
- __decorate([
73
+ tslib_1.__decorate([
74
+ (0, type_graphql_1.Query)(returns => geo_area_type_1.GeoAreaList),
75
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
76
+ tslib_1.__metadata("design:type", Function),
77
+ tslib_1.__metadata("design:paramtypes", [Object]),
78
+ tslib_1.__metadata("design:returntype", Promise)
79
+ ], GeoAreaQuery.prototype, "geoAreasAllPostCode", null);
80
+ tslib_1.__decorate([
81
+ (0, type_graphql_1.Query)(returns => geo_area_1.GeoArea),
82
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('postCode')),
83
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
84
+ tslib_1.__metadata("design:type", Function),
85
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
86
+ tslib_1.__metadata("design:returntype", Promise)
87
+ ], GeoAreaQuery.prototype, "geoAreasGetStateAndCityByPosCode", null);
88
+ tslib_1.__decorate([
62
89
  (0, type_graphql_1.FieldResolver)(type => geo_city_1.GeoCity),
63
- __param(0, (0, type_graphql_1.Root)()),
64
- __metadata("design:type", Function),
65
- __metadata("design:paramtypes", [geo_area_1.GeoArea]),
66
- __metadata("design:returntype", Promise)
90
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
91
+ tslib_1.__metadata("design:type", Function),
92
+ tslib_1.__metadata("design:paramtypes", [geo_area_1.GeoArea]),
93
+ tslib_1.__metadata("design:returntype", Promise)
67
94
  ], GeoAreaQuery.prototype, "geoCity", null);
68
- __decorate([
95
+ tslib_1.__decorate([
69
96
  (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
70
- __param(0, (0, type_graphql_1.Root)()),
71
- __metadata("design:type", Function),
72
- __metadata("design:paramtypes", [geo_area_1.GeoArea]),
73
- __metadata("design:returntype", Promise)
97
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
98
+ tslib_1.__metadata("design:type", Function),
99
+ tslib_1.__metadata("design:paramtypes", [geo_area_1.GeoArea]),
100
+ tslib_1.__metadata("design:returntype", Promise)
74
101
  ], GeoAreaQuery.prototype, "updater", null);
75
- __decorate([
102
+ tslib_1.__decorate([
76
103
  (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
77
- __param(0, (0, type_graphql_1.Root)()),
78
- __metadata("design:type", Function),
79
- __metadata("design:paramtypes", [geo_area_1.GeoArea]),
80
- __metadata("design:returntype", Promise)
104
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
105
+ tslib_1.__metadata("design:type", Function),
106
+ tslib_1.__metadata("design:paramtypes", [geo_area_1.GeoArea]),
107
+ tslib_1.__metadata("design:returntype", Promise)
81
108
  ], GeoAreaQuery.prototype, "creator", null);
82
- GeoAreaQuery = __decorate([
109
+ GeoAreaQuery = tslib_1.__decorate([
83
110
  (0, type_graphql_1.Resolver)(geo_area_1.GeoArea)
84
111
  ], GeoAreaQuery);
85
112
  exports.GeoAreaQuery = GeoAreaQuery;
@@ -1 +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;AAG7C,IAAa,YAAY,GAAzB,MAAa,YAAY;IAEvB,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,CAA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,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CA+DxB;AA/DY,oCAAY","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { GeoCity } from '../geo-city/geo-city'\nimport { GeoArea } from './geo-area'\nimport { GeoAreaList } from './geo-area-type'\n\n@Resolver(GeoArea)\nexport class GeoAreaQuery {\n @Query(returns => GeoArea, { description: 'To fetch a GeoArea' })\n async geoArea(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GeoArea> {\n return await getRepository(GeoArea).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoAreaList, { description: 'To fetch multiple GeoAreas' })\n async geoAreas(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<GeoAreaList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoArea).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @Query(returns => GeoAreaList)\n async geoAreasAllPostCode(@Ctx() context: ResolverContext) {\n const result = await getRepository(GeoArea)\n .createQueryBuilder('ga')\n .select('ga.postal_code')\n .distinct(true)\n .orderBy('ga.postal_code')\n .getRawMany()\n\n const items: any[] = result.map(item => {\n return {\n postalCode: item.postal_code\n }\n })\n\n const total = items.length\n\n return { items, total }\n }\n\n @Query(returns => GeoArea)\n async geoAreasGetStateAndCityByPosCode(@Arg('postCode') postCode: string, @Ctx() context: ResolverContext) {\n let result = await getRepository(GeoArea)\n .createQueryBuilder('ga')\n .select('ga.city_name', 'cityName')\n .addSelect('ga.state_name', 'stateName')\n .distinct(true)\n .where('ga.postal_code = :postCode', { postCode: postCode })\n .getRawOne()\n\n return result\n }\n\n @FieldResolver(type => GeoCity)\n async geoCity(@Root() geoArea: GeoArea): Promise<GeoCity> {\n return await getRepository(GeoCity).findOneBy({ id: geoArea.geoCityId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoArea: GeoArea): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoArea.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoArea: GeoArea): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoArea.creatorId })\n }\n}\n"]}
@@ -1,112 +1,104 @@
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.GeoAreaList = exports.GeoAreaPatch = exports.NewGeoArea = void 0;
4
+ const tslib_1 = require("tslib");
13
5
  const type_graphql_1 = require("type-graphql");
14
6
  const geo_area_1 = require("./geo-area");
15
7
  let NewGeoArea = class NewGeoArea {
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
  ], NewGeoArea.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
  ], NewGeoArea.prototype, "description", void 0);
25
- __decorate([
17
+ tslib_1.__decorate([
26
18
  (0, type_graphql_1.Field)({ nullable: true }),
27
- __metadata("design:type", String)
19
+ tslib_1.__metadata("design:type", String)
28
20
  ], NewGeoArea.prototype, "countryCode", void 0);
29
- __decorate([
21
+ tslib_1.__decorate([
30
22
  (0, type_graphql_1.Field)({ nullable: true }),
31
- __metadata("design:type", String)
23
+ tslib_1.__metadata("design:type", String)
32
24
  ], NewGeoArea.prototype, "cityName", void 0);
33
- __decorate([
25
+ tslib_1.__decorate([
34
26
  (0, type_graphql_1.Field)({ nullable: true }),
35
- __metadata("design:type", String)
27
+ tslib_1.__metadata("design:type", String)
36
28
  ], NewGeoArea.prototype, "stateName", void 0);
37
- __decorate([
29
+ tslib_1.__decorate([
38
30
  (0, type_graphql_1.Field)({ nullable: true }),
39
- __metadata("design:type", String)
31
+ tslib_1.__metadata("design:type", String)
40
32
  ], NewGeoArea.prototype, "postalCode", void 0);
41
- __decorate([
33
+ tslib_1.__decorate([
42
34
  (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", String)
35
+ tslib_1.__metadata("design:type", String)
44
36
  ], NewGeoArea.prototype, "latitude", void 0);
45
- __decorate([
37
+ tslib_1.__decorate([
46
38
  (0, type_graphql_1.Field)({ nullable: true }),
47
- __metadata("design:type", String)
39
+ tslib_1.__metadata("design:type", String)
48
40
  ], NewGeoArea.prototype, "longitude", void 0);
49
- NewGeoArea = __decorate([
41
+ NewGeoArea = tslib_1.__decorate([
50
42
  (0, type_graphql_1.InputType)()
51
43
  ], NewGeoArea);
52
44
  exports.NewGeoArea = NewGeoArea;
53
45
  let GeoAreaPatch = class GeoAreaPatch {
54
46
  };
55
- __decorate([
47
+ tslib_1.__decorate([
56
48
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
57
- __metadata("design:type", String)
49
+ tslib_1.__metadata("design:type", String)
58
50
  ], GeoAreaPatch.prototype, "id", void 0);
59
- __decorate([
51
+ tslib_1.__decorate([
60
52
  (0, type_graphql_1.Field)({ nullable: true }),
61
- __metadata("design:type", String)
53
+ tslib_1.__metadata("design:type", String)
62
54
  ], GeoAreaPatch.prototype, "name", void 0);
63
- __decorate([
55
+ tslib_1.__decorate([
64
56
  (0, type_graphql_1.Field)({ nullable: true }),
65
- __metadata("design:type", String)
57
+ tslib_1.__metadata("design:type", String)
66
58
  ], GeoAreaPatch.prototype, "description", void 0);
67
- __decorate([
59
+ tslib_1.__decorate([
68
60
  (0, type_graphql_1.Field)({ nullable: true }),
69
- __metadata("design:type", String)
61
+ tslib_1.__metadata("design:type", String)
70
62
  ], GeoAreaPatch.prototype, "countryCode", void 0);
71
- __decorate([
63
+ tslib_1.__decorate([
72
64
  (0, type_graphql_1.Field)({ nullable: true }),
73
- __metadata("design:type", String)
65
+ tslib_1.__metadata("design:type", String)
74
66
  ], GeoAreaPatch.prototype, "cityName", void 0);
75
- __decorate([
67
+ tslib_1.__decorate([
76
68
  (0, type_graphql_1.Field)({ nullable: true }),
77
- __metadata("design:type", String)
69
+ tslib_1.__metadata("design:type", String)
78
70
  ], GeoAreaPatch.prototype, "stateName", void 0);
79
- __decorate([
71
+ tslib_1.__decorate([
80
72
  (0, type_graphql_1.Field)({ nullable: true }),
81
- __metadata("design:type", String)
73
+ tslib_1.__metadata("design:type", String)
82
74
  ], GeoAreaPatch.prototype, "postalCode", void 0);
83
- __decorate([
75
+ tslib_1.__decorate([
84
76
  (0, type_graphql_1.Field)({ nullable: true }),
85
- __metadata("design:type", String)
77
+ tslib_1.__metadata("design:type", String)
86
78
  ], GeoAreaPatch.prototype, "latitude", void 0);
87
- __decorate([
79
+ tslib_1.__decorate([
88
80
  (0, type_graphql_1.Field)({ nullable: true }),
89
- __metadata("design:type", String)
81
+ tslib_1.__metadata("design:type", String)
90
82
  ], GeoAreaPatch.prototype, "longitude", void 0);
91
- __decorate([
83
+ tslib_1.__decorate([
92
84
  (0, type_graphql_1.Field)(),
93
- __metadata("design:type", String)
85
+ tslib_1.__metadata("design:type", String)
94
86
  ], GeoAreaPatch.prototype, "cuFlag", void 0);
95
- GeoAreaPatch = __decorate([
87
+ GeoAreaPatch = tslib_1.__decorate([
96
88
  (0, type_graphql_1.InputType)()
97
89
  ], GeoAreaPatch);
98
90
  exports.GeoAreaPatch = GeoAreaPatch;
99
91
  let GeoAreaList = class GeoAreaList {
100
92
  };
101
- __decorate([
93
+ tslib_1.__decorate([
102
94
  (0, type_graphql_1.Field)(type => [geo_area_1.GeoArea]),
103
- __metadata("design:type", Array)
95
+ tslib_1.__metadata("design:type", Array)
104
96
  ], GeoAreaList.prototype, "items", void 0);
105
- __decorate([
97
+ tslib_1.__decorate([
106
98
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
107
- __metadata("design:type", Number)
99
+ tslib_1.__metadata("design:type", Number)
108
100
  ], GeoAreaList.prototype, "total", void 0);
109
- GeoAreaList = __decorate([
101
+ GeoAreaList = tslib_1.__decorate([
110
102
  (0, type_graphql_1.ObjectType)()
111
103
  ], GeoAreaList);
112
104
  exports.GeoAreaList = GeoAreaList;
@@ -1 +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;AAGpC,IAAa,UAAU,GAAvB,MAAa,UAAU;CAwBtB,CAAA;AAtBC;IADC,IAAA,oBAAK,GAAE;;wCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAA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AI,EAAE,CAAC;;iDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACR;AAGlB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACR;AAGlB;IADC,IAAA,oBAAK,GAAE;;4CACM;AA7BH,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CA8BxB;AA9BY,oCAAY;AAiCzB,IAAa,WAAW,GAAxB,MAAa,WAAW;CAMvB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,CAAC;;0CACT;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;AALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB;AANY,kCAAW","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoArea } from './geo-area'\n\n@InputType()\nexport class NewGeoArea {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n countryCode?: string\n\n @Field({ nullable: true })\n cityName?: string\n\n @Field({ nullable: true })\n stateName?: string\n\n @Field({ nullable: true })\n postalCode?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n}\n\n@InputType()\nexport class GeoAreaPatch {\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({ nullable: true })\n countryCode?: string\n\n @Field({ nullable: true })\n cityName?: string\n\n @Field({ nullable: true })\n stateName?: string\n\n @Field({ nullable: true })\n postalCode?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoAreaList {\n @Field(type => [GeoArea])\n items: GeoArea[]\n\n @Field(type => Int)\n total: number\n}\n"]}