@things-factory/geography 6.2.170 → 6.2.178

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 (75) hide show
  1. package/dist-server/controllers/index.d.ts +0 -0
  2. package/dist-server/index.d.ts +4 -0
  3. package/dist-server/middlewares/index.d.ts +1 -0
  4. package/dist-server/middlewares/index.js +1 -2
  5. package/dist-server/middlewares/index.js.map +1 -1
  6. package/dist-server/migrations/index.d.ts +1 -0
  7. package/dist-server/routes.d.ts +0 -0
  8. package/dist-server/service/geo-area/geo-area-mutation.d.ts +9 -0
  9. package/dist-server/service/geo-area/geo-area-mutation.js +2 -2
  10. package/dist-server/service/geo-area/geo-area-mutation.js.map +1 -1
  11. package/dist-server/service/geo-area/geo-area-query.d.ts +17 -0
  12. package/dist-server/service/geo-area/geo-area-query.js +2 -2
  13. package/dist-server/service/geo-area/geo-area-query.js.map +1 -1
  14. package/dist-server/service/geo-area/geo-area-type.d.ts +27 -0
  15. package/dist-server/service/geo-area/geo-area-type.js +6 -6
  16. package/dist-server/service/geo-area/geo-area-type.js.map +1 -1
  17. package/dist-server/service/geo-area/geo-area.d.ts +21 -0
  18. package/dist-server/service/geo-area/geo-area.js +2 -2
  19. package/dist-server/service/geo-area/geo-area.js.map +1 -1
  20. package/dist-server/service/geo-area/index.d.ts +5 -0
  21. package/dist-server/service/geo-city/geo-city-mutation.d.ts +9 -0
  22. package/dist-server/service/geo-city/geo-city-mutation.js +2 -2
  23. package/dist-server/service/geo-city/geo-city-mutation.js.map +1 -1
  24. package/dist-server/service/geo-city/geo-city-query.d.ts +14 -0
  25. package/dist-server/service/geo-city/geo-city-query.js +2 -2
  26. package/dist-server/service/geo-city/geo-city-query.js.map +1 -1
  27. package/dist-server/service/geo-city/geo-city-type.d.ts +19 -0
  28. package/dist-server/service/geo-city/geo-city-type.js +6 -6
  29. package/dist-server/service/geo-city/geo-city-type.js.map +1 -1
  30. package/dist-server/service/geo-city/geo-city.d.ts +20 -0
  31. package/dist-server/service/geo-city/geo-city.js +2 -2
  32. package/dist-server/service/geo-city/geo-city.js.map +1 -1
  33. package/dist-server/service/geo-city/index.d.ts +5 -0
  34. package/dist-server/service/geo-continent/geo-continent-mutation.d.ts +9 -0
  35. package/dist-server/service/geo-continent/geo-continent-mutation.js +2 -2
  36. package/dist-server/service/geo-continent/geo-continent-mutation.js.map +1 -1
  37. package/dist-server/service/geo-continent/geo-continent-query.d.ts +10 -0
  38. package/dist-server/service/geo-continent/geo-continent-query.js +2 -2
  39. package/dist-server/service/geo-continent/geo-continent-query.js.map +1 -1
  40. package/dist-server/service/geo-continent/geo-continent-type.d.ts +15 -0
  41. package/dist-server/service/geo-continent/geo-continent-type.js +6 -6
  42. package/dist-server/service/geo-continent/geo-continent-type.js.map +1 -1
  43. package/dist-server/service/geo-continent/geo-continent.d.ts +12 -0
  44. package/dist-server/service/geo-continent/geo-continent.js +2 -2
  45. package/dist-server/service/geo-continent/geo-continent.js.map +1 -1
  46. package/dist-server/service/geo-continent/index.d.ts +5 -0
  47. package/dist-server/service/geo-country/geo-country-mutation.d.ts +9 -0
  48. package/dist-server/service/geo-country/geo-country-mutation.js +2 -2
  49. package/dist-server/service/geo-country/geo-country-mutation.js.map +1 -1
  50. package/dist-server/service/geo-country/geo-country-query.d.ts +13 -0
  51. package/dist-server/service/geo-country/geo-country-query.js +2 -2
  52. package/dist-server/service/geo-country/geo-country-query.js.map +1 -1
  53. package/dist-server/service/geo-country/geo-country-type.d.ts +17 -0
  54. package/dist-server/service/geo-country/geo-country-type.js +6 -6
  55. package/dist-server/service/geo-country/geo-country-type.js.map +1 -1
  56. package/dist-server/service/geo-country/geo-country.d.ts +16 -0
  57. package/dist-server/service/geo-country/geo-country.js +2 -2
  58. package/dist-server/service/geo-country/geo-country.js.map +1 -1
  59. package/dist-server/service/geo-country/index.d.ts +5 -0
  60. package/dist-server/service/geo-state/geo-state-mutation.d.ts +9 -0
  61. package/dist-server/service/geo-state/geo-state-mutation.js +2 -2
  62. package/dist-server/service/geo-state/geo-state-mutation.js.map +1 -1
  63. package/dist-server/service/geo-state/geo-state-query.d.ts +12 -0
  64. package/dist-server/service/geo-state/geo-state-query.js +2 -2
  65. package/dist-server/service/geo-state/geo-state-query.js.map +1 -1
  66. package/dist-server/service/geo-state/geo-state-type.d.ts +19 -0
  67. package/dist-server/service/geo-state/geo-state-type.js +6 -6
  68. package/dist-server/service/geo-state/geo-state-type.js.map +1 -1
  69. package/dist-server/service/geo-state/geo-state.d.ts +17 -0
  70. package/dist-server/service/geo-state/geo-state.js +2 -2
  71. package/dist-server/service/geo-state/geo-state.js.map +1 -1
  72. package/dist-server/service/geo-state/index.d.ts +5 -0
  73. package/dist-server/service/index.d.ts +9 -0
  74. package/dist-server/tsconfig.tsbuildinfo +1 -1
  75. package/package.json +4 -4
@@ -0,0 +1,5 @@
1
+ import { GeoCity } from './geo-city';
2
+ import { GeoCityQuery } from './geo-city-query';
3
+ import { GeoCityMutation } from './geo-city-mutation';
4
+ export declare const entities: (typeof GeoCity)[];
5
+ export declare const resolvers: (typeof GeoCityQuery | typeof GeoCityMutation)[];
@@ -0,0 +1,9 @@
1
+ import { GeoContinent } from './geo-continent';
2
+ import { GeoContinentPatch, NewGeoContinent } from './geo-continent-type';
3
+ export declare class GeoContinentMutation {
4
+ createGeoContinent(geoContinent: NewGeoContinent, context: ResolverContext): Promise<GeoContinent>;
5
+ updateGeoContinent(id: string, patch: GeoContinentPatch, context: ResolverContext): Promise<GeoContinent>;
6
+ updateMultipleGeoContinent(patches: GeoContinentPatch[], context: ResolverContext): Promise<GeoContinent[]>;
7
+ deleteGeoContinent(id: string, context: ResolverContext): Promise<boolean>;
8
+ deleteGeoContinents(ids: string[], context: ResolverContext): Promise<boolean>;
9
+ }
@@ -55,6 +55,7 @@ let GeoContinentMutation = class GeoContinentMutation {
55
55
  return true;
56
56
  }
57
57
  };
58
+ exports.GeoContinentMutation = GeoContinentMutation;
58
59
  tslib_1.__decorate([
59
60
  (0, type_graphql_1.Directive)('@transaction'),
60
61
  (0, type_graphql_1.Mutation)(returns => geo_continent_1.GeoContinent, { description: 'To create new GeoContinent' }),
@@ -101,8 +102,7 @@ tslib_1.__decorate([
101
102
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
102
103
  tslib_1.__metadata("design:returntype", Promise)
103
104
  ], GeoContinentMutation.prototype, "deleteGeoContinents", null);
104
- GeoContinentMutation = tslib_1.__decorate([
105
+ exports.GeoContinentMutation = GeoContinentMutation = tslib_1.__decorate([
105
106
  (0, type_graphql_1.Resolver)(geo_continent_1.GeoContinent)
106
107
  ], GeoContinentMutation);
107
- exports.GeoContinentMutation = GeoContinentMutation;
108
108
  //# sourceMappingURL=geo-continent-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-continent-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA8C;AAC9C,6DAAyE;AAGlE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAGzB,AAAN,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAwB;QAE/B,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;IAIK,AAAN,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAwB;QAE/B,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,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ent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\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: ResolverContext\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: ResolverContext\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: ResolverContext\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.findOneBy({ id: 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: ResolverContext): 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(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): 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
+ {"version":3,"file":"geo-continent-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA8C;AAC9C,6DAAyE;AAGlE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAGzB,AAAN,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAwB;QAE/B,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;IAIK,AAAN,KAAK,CAAC,kBAAkB,CACX,EAAU,EACP,KAAwB,EAC/B,OAAwB;QAE/B,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,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,CAAA;;;;+DASP;+BAxGU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAyGhC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\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: ResolverContext\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: ResolverContext\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: ResolverContext\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.findOneBy({ id: 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: ResolverContext): 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(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): 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"]}
@@ -0,0 +1,10 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { ListParam } from '@things-factory/shell';
3
+ import { GeoContinent } from './geo-continent';
4
+ import { GeoContinentList } from './geo-continent-type';
5
+ export declare class GeoContinentQuery {
6
+ geoContinent(id: string, context: ResolverContext): Promise<GeoContinent>;
7
+ geoContinents(params: ListParam, context: ResolverContext): Promise<GeoContinentList>;
8
+ updater(geoContinent: GeoContinent): Promise<User>;
9
+ creator(geoContinent: GeoContinent): Promise<User>;
10
+ }
@@ -25,6 +25,7 @@ let GeoContinentQuery = class GeoContinentQuery {
25
25
  return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoContinent.creatorId });
26
26
  }
27
27
  };
28
+ exports.GeoContinentQuery = GeoContinentQuery;
28
29
  tslib_1.__decorate([
29
30
  (0, type_graphql_1.Query)(returns => geo_continent_1.GeoContinent, { description: 'To fetch a GeoContinent' }),
30
31
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
@@ -55,8 +56,7 @@ tslib_1.__decorate([
55
56
  tslib_1.__metadata("design:paramtypes", [geo_continent_1.GeoContinent]),
56
57
  tslib_1.__metadata("design:returntype", Promise)
57
58
  ], GeoContinentQuery.prototype, "creator", null);
58
- GeoContinentQuery = tslib_1.__decorate([
59
+ exports.GeoContinentQuery = GeoContinentQuery = tslib_1.__decorate([
59
60
  (0, type_graphql_1.Resolver)(geo_continent_1.GeoContinent)
60
61
  ], GeoContinentQuery);
61
- exports.GeoContinentQuery = GeoContinentQuery;
62
62
  //# sourceMappingURL=geo-continent-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-continent-query.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,mDAA8C;AAC9C,6DAAuD;AAGhD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAwB;QACvE,OAAO,MAAM,IAAA,qBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,aAAa,CAAS,MAAiB,EAAS,OAAwB;QAC5E,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,4BAAY,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEtF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,YAA0B;QAC9C,OAAO,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,CAAA;IAC5E,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,YAA0B;QAC9C,OAAO,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,CAAA;IAC5E,CAAC;CACF,CAAA;AAvBO;IADL,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;AAGK;IADL,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;;6CAAjB,iBAAS;;sDAK5C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAGK;IADL,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 { 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 { 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: ResolverContext): 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: ResolverContext): 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).findOneBy({ id: geoContinent.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoContinent.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"geo-continent-query.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,mDAA8C;AAC9C,6DAAuD;AAGhD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,YAAY,CAAY,EAAU,EAAS,OAAwB;QACvE,OAAO,MAAM,IAAA,qBAAa,EAAC,4BAAY,CAAC,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,aAAa,CAAS,MAAiB,EAAS,OAAwB;QAC5E,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,4BAAY,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEtF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,YAA0B;QAC9C,OAAO,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,CAAA;IAC5E,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAS,YAA0B;QAC9C,OAAO,MAAM,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,CAAA;IAC5E,CAAC;CACF,CAAA;AAzBY,8CAAiB;AAEtB;IADL,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;AAGK;IADL,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;;6CAAjB,iBAAS;;sDAK5C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;gDAE/C;4BAxBU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CAyB7B","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 { 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: ResolverContext): 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: ResolverContext): 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).findOneBy({ id: geoContinent.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoContinent: GeoContinent): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoContinent.creatorId })\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { GeoContinent } from './geo-continent';
2
+ export declare class NewGeoContinent {
3
+ name: string;
4
+ description?: string;
5
+ }
6
+ export declare class GeoContinentPatch {
7
+ id?: string;
8
+ name?: string;
9
+ description?: string;
10
+ cuFlag: string;
11
+ }
12
+ export declare class GeoContinentList {
13
+ items: GeoContinent[];
14
+ total: number;
15
+ }
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
6
6
  const geo_continent_1 = require("./geo-continent");
7
7
  let NewGeoContinent = class NewGeoContinent {
8
8
  };
9
+ exports.NewGeoContinent = NewGeoContinent;
9
10
  tslib_1.__decorate([
10
11
  (0, type_graphql_1.Field)(),
11
12
  tslib_1.__metadata("design:type", String)
@@ -14,12 +15,12 @@ tslib_1.__decorate([
14
15
  (0, type_graphql_1.Field)({ nullable: true }),
15
16
  tslib_1.__metadata("design:type", String)
16
17
  ], NewGeoContinent.prototype, "description", void 0);
17
- NewGeoContinent = tslib_1.__decorate([
18
+ exports.NewGeoContinent = NewGeoContinent = tslib_1.__decorate([
18
19
  (0, type_graphql_1.InputType)()
19
20
  ], NewGeoContinent);
20
- exports.NewGeoContinent = NewGeoContinent;
21
21
  let GeoContinentPatch = class GeoContinentPatch {
22
22
  };
23
+ exports.GeoContinentPatch = GeoContinentPatch;
23
24
  tslib_1.__decorate([
24
25
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
25
26
  tslib_1.__metadata("design:type", String)
@@ -36,12 +37,12 @@ tslib_1.__decorate([
36
37
  (0, type_graphql_1.Field)(),
37
38
  tslib_1.__metadata("design:type", String)
38
39
  ], GeoContinentPatch.prototype, "cuFlag", void 0);
39
- GeoContinentPatch = tslib_1.__decorate([
40
+ exports.GeoContinentPatch = GeoContinentPatch = tslib_1.__decorate([
40
41
  (0, type_graphql_1.InputType)()
41
42
  ], GeoContinentPatch);
42
- exports.GeoContinentPatch = GeoContinentPatch;
43
43
  let GeoContinentList = class GeoContinentList {
44
44
  };
45
+ exports.GeoContinentList = GeoContinentList;
45
46
  tslib_1.__decorate([
46
47
  (0, type_graphql_1.Field)(type => [geo_continent_1.GeoContinent]),
47
48
  tslib_1.__metadata("design:type", Array)
@@ -50,8 +51,7 @@ tslib_1.__decorate([
50
51
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
51
52
  tslib_1.__metadata("design:type", Number)
52
53
  ], GeoContinentList.prototype, "total", void 0);
53
- GeoContinentList = tslib_1.__decorate([
54
+ exports.GeoContinentList = GeoContinentList = tslib_1.__decorate([
54
55
  (0, type_graphql_1.ObjectType)()
55
56
  ], GeoContinentList);
56
- exports.GeoContinentList = GeoContinentList;
57
57
  //# sourceMappingURL=geo-continent-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-continent-type.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,mDAA8C;AAGvC,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;6CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AALT,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAM3B;AANY,0CAAe;AASrB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAY7B,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACN;AAEpB;IAAC,IAAA,oBAAK,GAAE;;iDACM;AAXH,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAY7B;AAZY,8CAAiB;AAevB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAErB;IAAC,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
+ {"version":3,"file":"geo-continent-type.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,mDAA8C;AAGvC,IAAM,eAAe,GAArB,MAAM,eAAe;CAM3B,CAAA;AANY,0CAAe;AAE1B;IADC,IAAA,oBAAK,GAAE;;6CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;0BALT,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAM3B;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAY7B,CAAA;AAZY,8CAAiB;AAE5B;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;4BAXH,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAY7B;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AANY,4CAAgB;AAE3B;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;2BALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B","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"]}
@@ -0,0 +1,12 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ export declare class GeoContinent {
3
+ readonly id: string;
4
+ name: string;
5
+ description?: string;
6
+ createdAt?: Date;
7
+ updatedAt?: Date;
8
+ creator?: User;
9
+ creatorId?: string;
10
+ updater?: User;
11
+ updaterId?: string;
12
+ }
@@ -7,6 +7,7 @@ const type_graphql_1 = require("type-graphql");
7
7
  const typeorm_1 = require("typeorm");
8
8
  let GeoContinent = class GeoContinent {
9
9
  };
10
+ exports.GeoContinent = GeoContinent;
10
11
  tslib_1.__decorate([
11
12
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
12
13
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -56,10 +57,9 @@ tslib_1.__decorate([
56
57
  (0, typeorm_1.RelationId)((geoContinent) => geoContinent.updater),
57
58
  tslib_1.__metadata("design:type", String)
58
59
  ], GeoContinent.prototype, "updaterId", void 0);
59
- GeoContinent = tslib_1.__decorate([
60
+ exports.GeoContinent = GeoContinent = tslib_1.__decorate([
60
61
  (0, typeorm_1.Entity)(),
61
62
  (0, typeorm_1.Index)('ix_geo_continent_0', (geoContinent) => [geoContinent.name], { unique: true }),
62
63
  (0, type_graphql_1.ObjectType)({ description: 'Entity for GeoContinent' })
63
64
  ], GeoContinent);
64
- exports.GeoContinent = GeoContinent;
65
65
  //# sourceMappingURL=geo-continent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-continent.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent.ts"],"names":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AAY;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.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"geo-continent.js","sourceRoot":"","sources":["../../../server/service/geo-continent/geo-continent.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAKT,IAAM,YAAY,GAAlB,MAAM,YAAY;CAwCxB,CAAA;AAxCY,oCAAY;AAGd;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAA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,CAAC;IAClG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;GAC1C,YAAY,CAwCxB","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.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { GeoContinent } from './geo-continent';
2
+ import { GeoContinentQuery } from './geo-continent-query';
3
+ import { GeoContinentMutation } from './geo-continent-mutation';
4
+ export declare const entities: (typeof GeoContinent)[];
5
+ export declare const resolvers: (typeof GeoContinentQuery | typeof GeoContinentMutation)[];
@@ -0,0 +1,9 @@
1
+ import { GeoCountry } from './geo-country';
2
+ import { GeoCountryPatch, NewGeoCountry } from './geo-country-type';
3
+ export declare class GeoCountryMutation {
4
+ createGeoCountry(geoCountry: NewGeoCountry, context: ResolverContext): Promise<GeoCountry>;
5
+ updateGeoCountry(id: string, patch: GeoCountryPatch, context: ResolverContext): Promise<GeoCountry>;
6
+ updateMultipleGeoCountry(patches: GeoCountryPatch[], context: ResolverContext): Promise<GeoCountry[]>;
7
+ deleteGeoCountry(id: string, context: ResolverContext): Promise<boolean>;
8
+ deleteGeoCountries(ids: string[], context: ResolverContext): Promise<boolean>;
9
+ }
@@ -55,6 +55,7 @@ let GeoCountryMutation = class GeoCountryMutation {
55
55
  return true;
56
56
  }
57
57
  };
58
+ exports.GeoCountryMutation = GeoCountryMutation;
58
59
  tslib_1.__decorate([
59
60
  (0, type_graphql_1.Directive)('@transaction'),
60
61
  (0, type_graphql_1.Mutation)(returns => geo_country_1.GeoCountry, { description: 'To create new GeoCountry' }),
@@ -101,8 +102,7 @@ tslib_1.__decorate([
101
102
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
102
103
  tslib_1.__metadata("design:returntype", Promise)
103
104
  ], GeoCountryMutation.prototype, "deleteGeoCountries", null);
104
- GeoCountryMutation = tslib_1.__decorate([
105
+ exports.GeoCountryMutation = GeoCountryMutation = tslib_1.__decorate([
105
106
  (0, type_graphql_1.Resolver)(geo_country_1.GeoCountry)
106
107
  ], GeoCountryMutation);
107
- exports.GeoCountryMutation = GeoCountryMutation;
108
108
  //# sourceMappingURL=geo-country-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-country-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,+CAA0C;AAC1C,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CACD,UAAyB,EACrC,OAAwB;QAE/B,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,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IAC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AE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DASP;AAxGU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAyG9B;AAzGY,gDAAkB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\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(\n @Arg('geoCountry') geoCountry: NewGeoCountry,\n @Ctx() context: ResolverContext\n ): 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: ResolverContext\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: ResolverContext\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.findOneBy({ id: 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: ResolverContext): 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(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): 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"]}
1
+ {"version":3,"file":"geo-country-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,+CAA0C;AAC1C,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CACD,UAAyB,EACrC,OAAwB;QAE/B,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,EACb,OAA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AAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DASP;6BAxGU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAyG9B","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\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(\n @Arg('geoCountry') geoCountry: NewGeoCountry,\n @Ctx() context: ResolverContext\n ): 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: ResolverContext\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: ResolverContext\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.findOneBy({ id: 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: ResolverContext): 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(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): 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"]}
@@ -0,0 +1,13 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { ListParam } from '@things-factory/shell';
3
+ import { GeoContinent } from '../geo-continent/geo-continent';
4
+ import { GeoCountry } from './geo-country';
5
+ import { GeoCountryList } from './geo-country-type';
6
+ export declare class GeoCountryQuery {
7
+ geoCountry(id: string, context: ResolverContext): Promise<GeoCountry>;
8
+ geoCountries(params: ListParam, context: ResolverContext): Promise<GeoCountryList>;
9
+ geoCountriesWithoutParam(context: ResolverContext): Promise<GeoCountryList>;
10
+ geoContinent(geoCountry: GeoCountry): Promise<GeoContinent>;
11
+ updater(geoCountry: GeoCountry): Promise<User>;
12
+ creator(geoCountry: GeoCountry): Promise<User>;
13
+ }
@@ -33,6 +33,7 @@ let GeoCountryQuery = class GeoCountryQuery {
33
33
  return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoCountry.creatorId });
34
34
  }
35
35
  };
36
+ exports.GeoCountryQuery = GeoCountryQuery;
36
37
  tslib_1.__decorate([
37
38
  (0, type_graphql_1.Query)(returns => geo_country_1.GeoCountry, { description: 'To fetch a GeoCountry' }),
38
39
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
@@ -77,8 +78,7 @@ tslib_1.__decorate([
77
78
  tslib_1.__metadata("design:paramtypes", [geo_country_1.GeoCountry]),
78
79
  tslib_1.__metadata("design:returntype", Promise)
79
80
  ], GeoCountryQuery.prototype, "creator", null);
80
- GeoCountryQuery = tslib_1.__decorate([
81
+ exports.GeoCountryQuery = GeoCountryQuery = tslib_1.__decorate([
81
82
  (0, type_graphql_1.Resolver)(geo_country_1.GeoCountry)
82
83
  ], GeoCountryQuery);
83
- exports.GeoCountryQuery = GeoCountryQuery;
84
84
  //# sourceMappingURL=geo-country-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-country-query.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,kEAA6D;AAC7D,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,YAAY,CAAS,MAAiB,EAAS,OAAwB;QAC3E,MAAM,eAAe,GAAG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OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAChE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;mDAK3C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;IACnE,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAIpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAY,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;mDAEhD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AApCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAqC3B;AArCY,0CAAe","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 { GeoContinent } from '../geo-continent/geo-continent'\nimport { GeoCountry } from './geo-country'\nimport { GeoCountryList } from './geo-country-type'\n\n@Resolver(GeoCountry)\nexport class GeoCountryQuery {\n @Query(returns => GeoCountry, { description: 'To fetch a GeoCountry' })\n async geoCountry(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GeoCountry> {\n return await getRepository(GeoCountry).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoCountryList, { description: 'To fetch multiple GeoCountries' })\n async geoCountries(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<GeoCountryList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoCountry).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @Query(returns => GeoCountryList, { description: 'To fetch multiple GeoCountries without params' })\n async geoCountriesWithoutParam(@Ctx() context: ResolverContext): Promise<GeoCountryList> {\n const [items, total] = await getRepository(GeoCountry).findAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => GeoContinent)\n async geoContinent(@Root() geoCountry: GeoCountry): Promise<GeoContinent> {\n return await getRepository(GeoContinent).findOneBy({ id: geoCountry.geoContinentId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoCountry: GeoCountry): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCountry.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoCountry: GeoCountry): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCountry.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"geo-country-query.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,kEAA6D;AAC7D,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,YAAY,CAAS,MAAiB,EAAS,OAAwB;QAC3E,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,wBAAU,C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CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;mDAK3C;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;IACnE,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAIpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAY,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;mDAEhD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BApCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAqC3B","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 { GeoContinent } from '../geo-continent/geo-continent'\nimport { GeoCountry } from './geo-country'\nimport { GeoCountryList } from './geo-country-type'\n\n@Resolver(GeoCountry)\nexport class GeoCountryQuery {\n @Query(returns => GeoCountry, { description: 'To fetch a GeoCountry' })\n async geoCountry(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GeoCountry> {\n return await getRepository(GeoCountry).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoCountryList, { description: 'To fetch multiple GeoCountries' })\n async geoCountries(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<GeoCountryList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoCountry).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @Query(returns => GeoCountryList, { description: 'To fetch multiple GeoCountries without params' })\n async geoCountriesWithoutParam(@Ctx() context: ResolverContext): Promise<GeoCountryList> {\n const [items, total] = await getRepository(GeoCountry).findAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => GeoContinent)\n async geoContinent(@Root() geoCountry: GeoCountry): Promise<GeoContinent> {\n return await getRepository(GeoContinent).findOneBy({ id: geoCountry.geoContinentId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoCountry: GeoCountry): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCountry.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoCountry: GeoCountry): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCountry.creatorId })\n }\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { GeoCountry } from './geo-country';
2
+ export declare class NewGeoCountry {
3
+ name: string;
4
+ description?: string;
5
+ isoCode?: string;
6
+ }
7
+ export declare class GeoCountryPatch {
8
+ id?: string;
9
+ name?: string;
10
+ description?: string;
11
+ isoCode?: string;
12
+ cuFlag: string;
13
+ }
14
+ export declare class GeoCountryList {
15
+ items: GeoCountry[];
16
+ total: number;
17
+ }
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
6
6
  const geo_country_1 = require("./geo-country");
7
7
  let NewGeoCountry = class NewGeoCountry {
8
8
  };
9
+ exports.NewGeoCountry = NewGeoCountry;
9
10
  tslib_1.__decorate([
10
11
  (0, type_graphql_1.Field)(),
11
12
  tslib_1.__metadata("design:type", String)
@@ -18,12 +19,12 @@ tslib_1.__decorate([
18
19
  (0, type_graphql_1.Field)({ nullable: true }),
19
20
  tslib_1.__metadata("design:type", String)
20
21
  ], NewGeoCountry.prototype, "isoCode", void 0);
21
- NewGeoCountry = tslib_1.__decorate([
22
+ exports.NewGeoCountry = NewGeoCountry = tslib_1.__decorate([
22
23
  (0, type_graphql_1.InputType)()
23
24
  ], NewGeoCountry);
24
- exports.NewGeoCountry = NewGeoCountry;
25
25
  let GeoCountryPatch = class GeoCountryPatch {
26
26
  };
27
+ exports.GeoCountryPatch = GeoCountryPatch;
27
28
  tslib_1.__decorate([
28
29
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
29
30
  tslib_1.__metadata("design:type", String)
@@ -44,12 +45,12 @@ tslib_1.__decorate([
44
45
  (0, type_graphql_1.Field)(),
45
46
  tslib_1.__metadata("design:type", String)
46
47
  ], GeoCountryPatch.prototype, "cuFlag", void 0);
47
- GeoCountryPatch = tslib_1.__decorate([
48
+ exports.GeoCountryPatch = GeoCountryPatch = tslib_1.__decorate([
48
49
  (0, type_graphql_1.InputType)()
49
50
  ], GeoCountryPatch);
50
- exports.GeoCountryPatch = GeoCountryPatch;
51
51
  let GeoCountryList = class GeoCountryList {
52
52
  };
53
+ exports.GeoCountryList = GeoCountryList;
53
54
  tslib_1.__decorate([
54
55
  (0, type_graphql_1.Field)(type => [geo_country_1.GeoCountry]),
55
56
  tslib_1.__metadata("design:type", Array)
@@ -58,8 +59,7 @@ tslib_1.__decorate([
58
59
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
59
60
  tslib_1.__metadata("design:type", Number)
60
61
  ], GeoCountryList.prototype, "total", void 0);
61
- GeoCountryList = tslib_1.__decorate([
62
+ exports.GeoCountryList = GeoCountryList = tslib_1.__decorate([
62
63
  (0, type_graphql_1.ObjectType)()
63
64
  ], GeoCountryList);
64
- exports.GeoCountryList = GeoCountryList;
65
65
  //# sourceMappingURL=geo-country-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-country-type.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,+CAA0C;AAGnC,IAAM,aAAa,GAAnB,MAAM,aAAa;CASzB,CAAA;AARC;IAAC,IAAA,oBAAK,GAAE;;2CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;AARL,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CASzB;AATY,sCAAa;AAYnB,IAAM,eAAe,GAArB,MAAM,eAAe;CAe3B,CAAA;AAdC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAEhB;IAAC,IAAA,oBAAK,GAAE;;+CACM;AAdH,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAe3B;AAfY,0CAAe;AAkBrB,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAEnB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoCountry } from './geo-country'\n\n@InputType()\nexport class NewGeoCountry {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n isoCode?: string\n}\n\n@InputType()\nexport class GeoCountryPatch {\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 isoCode?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoCountryList {\n @Field(type => [GeoCountry])\n items: GeoCountry[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"geo-country-type.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,+CAA0C;AAGnC,IAAM,aAAa,GAAnB,MAAM,aAAa;CASzB,CAAA;AATY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACV;wBARL,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CASzB;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAe3B,CAAA;AAfY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACV;AAGhB;IADC,IAAA,oBAAK,GAAE;;+CACM;0BAdH,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAe3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoCountry } from './geo-country'\n\n@InputType()\nexport class NewGeoCountry {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n isoCode?: string\n}\n\n@InputType()\nexport class GeoCountryPatch {\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 isoCode?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoCountryList {\n @Field(type => [GeoCountry])\n items: GeoCountry[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { GeoContinent } from '../geo-continent/geo-continent';
3
+ export declare class GeoCountry {
4
+ readonly id: string;
5
+ geoContinent: GeoContinent;
6
+ geoContinentId: string;
7
+ name: string;
8
+ description?: string;
9
+ isoCode?: string;
10
+ createdAt?: Date;
11
+ updatedAt?: Date;
12
+ creator?: User;
13
+ creatorId?: string;
14
+ updater?: User;
15
+ updaterId?: string;
16
+ }
@@ -8,6 +8,7 @@ const typeorm_1 = require("typeorm");
8
8
  const geo_continent_1 = require("../geo-continent/geo-continent");
9
9
  let GeoCountry = class GeoCountry {
10
10
  };
11
+ exports.GeoCountry = GeoCountry;
11
12
  tslib_1.__decorate([
12
13
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
13
14
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -71,10 +72,9 @@ tslib_1.__decorate([
71
72
  (0, typeorm_1.RelationId)((geoCountry) => geoCountry.updater),
72
73
  tslib_1.__metadata("design:type", String)
73
74
  ], GeoCountry.prototype, "updaterId", void 0);
74
- GeoCountry = tslib_1.__decorate([
75
+ exports.GeoCountry = GeoCountry = tslib_1.__decorate([
75
76
  (0, typeorm_1.Entity)(),
76
77
  (0, typeorm_1.Index)('ix_geo_country_0', (geoCountry) => [geoCountry.geoContinent, geoCountry.name], { unique: true }),
77
78
  (0, type_graphql_1.ObjectType)({ description: 'Entity for GeoCountry' })
78
79
  ], GeoCountry);
79
- exports.GeoCountry = GeoCountry;
80
80
  //# sourceMappingURL=geo-country.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-country.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,kEAA6D;AAKtD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAmDtB,CAAA;AAlDC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAY,CAAC;IAC/B,IAAA,oBAAK,GAAE;sCACM,4BAAY;gDAAA;AAE1B;IAAC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;;kDAC1C;AAEtB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;wCACI;AAEZ;IAAC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAEpB;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACV;AAEhB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;6CAAA;AAEhB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;6CAAA;AAEhB;IAAC,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;sCAChB,gBAAI;2CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAElB;IAAC,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;sCAChB,gBAAI;2CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAlDP,UAAU;IAHtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACnH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CAmDtB;AAnDY,gCAAU","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'\nimport { GeoContinent } from '../geo-continent/geo-continent'\n\n@Entity()\n@Index('ix_geo_country_0', (geoCountry: GeoCountry) => [geoCountry.geoContinent, geoCountry.name], { unique: true })\n@ObjectType({ description: 'Entity for GeoCountry' })\nexport class GeoCountry {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoContinent)\n @Field()\n geoContinent: GeoContinent\n\n @RelationId((geoCountry: GeoCountry) => geoCountry.geoContinent)\n geoContinentId: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n isoCode?: 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((geoCountry: GeoCountry) => geoCountry.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoCountry: GeoCountry) => geoCountry.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"geo-country.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,kEAA6D;AAKtD,IAAM,UAAU,GAAhB,MAAM,UAAU;CAmDtB,CAAA;AAnDY,gCAAU;AAGZ;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAY,CAAC;IAC/B,IAAA,oBAAK,GAAE;sCACM,4BAAY;gDAAA;AAG1B;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;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AsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACnH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CAmDtB","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'\nimport { GeoContinent } from '../geo-continent/geo-continent'\n\n@Entity()\n@Index('ix_geo_country_0', (geoCountry: GeoCountry) => [geoCountry.geoContinent, geoCountry.name], { unique: true })\n@ObjectType({ description: 'Entity for GeoCountry' })\nexport class GeoCountry {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoContinent)\n @Field()\n geoContinent: GeoContinent\n\n @RelationId((geoCountry: GeoCountry) => geoCountry.geoContinent)\n geoContinentId: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n isoCode?: 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((geoCountry: GeoCountry) => geoCountry.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoCountry: GeoCountry) => geoCountry.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { GeoCountry } from './geo-country';
2
+ import { GeoCountryQuery } from './geo-country-query';
3
+ import { GeoCountryMutation } from './geo-country-mutation';
4
+ export declare const entities: (typeof GeoCountry)[];
5
+ export declare const resolvers: (typeof GeoCountryQuery | typeof GeoCountryMutation)[];
@@ -0,0 +1,9 @@
1
+ import { GeoState } from './geo-state';
2
+ import { GeoStatePatch, NewGeoState } from './geo-state-type';
3
+ export declare class GeoStateMutation {
4
+ createGeoState(geoState: NewGeoState, context: ResolverContext): Promise<GeoState>;
5
+ updateGeoState(id: string, patch: GeoStatePatch, context: ResolverContext): Promise<GeoState>;
6
+ updateMultipleGeoState(patches: GeoStatePatch[], context: ResolverContext): Promise<GeoState[]>;
7
+ deleteGeoState(id: string, context: ResolverContext): Promise<boolean>;
8
+ deleteGeoStates(ids: string[], context: ResolverContext): Promise<boolean>;
9
+ }
@@ -55,6 +55,7 @@ let GeoStateMutation = class GeoStateMutation {
55
55
  return true;
56
56
  }
57
57
  };
58
+ exports.GeoStateMutation = GeoStateMutation;
58
59
  tslib_1.__decorate([
59
60
  (0, type_graphql_1.Directive)('@transaction'),
60
61
  (0, type_graphql_1.Mutation)(returns => geo_state_1.GeoState, { description: 'To create new GeoState' }),
@@ -101,8 +102,7 @@ tslib_1.__decorate([
101
102
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
102
103
  tslib_1.__metadata("design:returntype", Promise)
103
104
  ], GeoStateMutation.prototype, "deleteGeoStates", null);
104
- GeoStateMutation = tslib_1.__decorate([
105
+ exports.GeoStateMutation = GeoStateMutation = tslib_1.__decorate([
105
106
  (0, type_graphql_1.Resolver)(geo_state_1.GeoState)
106
107
  ], GeoStateMutation);
107
- exports.GeoStateMutation = GeoStateMutation;
108
108
  //# sourceMappingURL=geo-state-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo-state-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-state/geo-state-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,2CAAsC;AACtC,qDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,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,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDAKjD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDASP;AArGU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,gBAAgB,CAsG5B;AAtGY,4CAAgB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GeoState } from './geo-state'\nimport { GeoStatePatch, NewGeoState } from './geo-state-type'\n\n@Resolver(GeoState)\nexport class GeoStateMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoState, { description: 'To create new GeoState' })\n async createGeoState(@Arg('geoState') geoState: NewGeoState, @Ctx() context: ResolverContext): Promise<GeoState> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoState).save({\n ...geoState,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoState, { description: 'To modify GeoState information' })\n async updateGeoState(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoStatePatch,\n @Ctx() context: ResolverContext\n ): Promise<GeoState> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoState)\n const geoState = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoState,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoState], { description: \"To modify multiple GeoStates' information\" })\n async updateMultipleGeoState(\n @Arg('patches', type => [GeoStatePatch]) patches: GeoStatePatch[],\n @Ctx() context: ResolverContext\n ): Promise<GeoState[]> {\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 geoStateRepo = tx.getRepository(GeoState)\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 geoStateRepo.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 geoState = await geoStateRepo.findOneBy({ id: newRecord.id })\n\n const result = await geoStateRepo.save({\n ...geoState,\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 GeoState' })\n async deleteGeoState(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoState).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoStates' })\n async deleteGeoStates(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoState).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"geo-state-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-state/geo-state-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,2CAAsC;AACtC,qDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAwB;QAC1F,MAAM,EAAE,IAAI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AE,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDAKjD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDASP;2BArGU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,oBAAQ,CAAC;GACN,gBAAgB,CAsG5B","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GeoState } from './geo-state'\nimport { GeoStatePatch, NewGeoState } from './geo-state-type'\n\n@Resolver(GeoState)\nexport class GeoStateMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoState, { description: 'To create new GeoState' })\n async createGeoState(@Arg('geoState') geoState: NewGeoState, @Ctx() context: ResolverContext): Promise<GeoState> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoState).save({\n ...geoState,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoState, { description: 'To modify GeoState information' })\n async updateGeoState(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoStatePatch,\n @Ctx() context: ResolverContext\n ): Promise<GeoState> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoState)\n const geoState = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoState,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoState], { description: \"To modify multiple GeoStates' information\" })\n async updateMultipleGeoState(\n @Arg('patches', type => [GeoStatePatch]) patches: GeoStatePatch[],\n @Ctx() context: ResolverContext\n ): Promise<GeoState[]> {\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 geoStateRepo = tx.getRepository(GeoState)\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 geoStateRepo.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 geoState = await geoStateRepo.findOneBy({ id: newRecord.id })\n\n const result = await geoStateRepo.save({\n ...geoState,\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 GeoState' })\n async deleteGeoState(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoState).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoStates' })\n async deleteGeoStates(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoState).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { ListParam } from '@things-factory/shell';
3
+ import { GeoCountry } from '../geo-country/geo-country';
4
+ import { GeoState } from './geo-state';
5
+ import { GeoStateList } from './geo-state-type';
6
+ export declare class GeoStateQuery {
7
+ geoState(id: string, context: ResolverContext): Promise<GeoState>;
8
+ geoStates(params: ListParam, context: ResolverContext): Promise<GeoStateList>;
9
+ geoCountry(geoState: GeoState): Promise<GeoCountry>;
10
+ updater(geoState: GeoState): Promise<User>;
11
+ creator(geoState: GeoState): Promise<User>;
12
+ }