@things-factory/geography 7.0.1-beta.0 → 7.0.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/controllers/index.d.ts +0 -0
- package/dist-server/index.d.ts +4 -0
- package/dist-server/middlewares/index.d.ts +1 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/routes.d.ts +0 -0
- package/dist-server/service/geo-area/geo-area-mutation.d.ts +9 -0
- package/dist-server/service/geo-area/geo-area-mutation.js +2 -2
- package/dist-server/service/geo-area/geo-area-mutation.js.map +1 -1
- package/dist-server/service/geo-area/geo-area-query.d.ts +17 -0
- package/dist-server/service/geo-area/geo-area-query.js +2 -2
- package/dist-server/service/geo-area/geo-area-query.js.map +1 -1
- package/dist-server/service/geo-area/geo-area-type.d.ts +27 -0
- package/dist-server/service/geo-area/geo-area-type.js +6 -6
- package/dist-server/service/geo-area/geo-area-type.js.map +1 -1
- package/dist-server/service/geo-area/geo-area.d.ts +21 -0
- package/dist-server/service/geo-area/geo-area.js +2 -2
- package/dist-server/service/geo-area/geo-area.js.map +1 -1
- package/dist-server/service/geo-area/index.d.ts +5 -0
- package/dist-server/service/geo-city/geo-city-mutation.d.ts +9 -0
- package/dist-server/service/geo-city/geo-city-mutation.js +2 -2
- package/dist-server/service/geo-city/geo-city-mutation.js.map +1 -1
- package/dist-server/service/geo-city/geo-city-query.d.ts +14 -0
- package/dist-server/service/geo-city/geo-city-query.js +2 -2
- package/dist-server/service/geo-city/geo-city-query.js.map +1 -1
- package/dist-server/service/geo-city/geo-city-type.d.ts +19 -0
- package/dist-server/service/geo-city/geo-city-type.js +6 -6
- package/dist-server/service/geo-city/geo-city-type.js.map +1 -1
- package/dist-server/service/geo-city/geo-city.d.ts +20 -0
- package/dist-server/service/geo-city/geo-city.js +2 -2
- package/dist-server/service/geo-city/geo-city.js.map +1 -1
- package/dist-server/service/geo-city/index.d.ts +5 -0
- package/dist-server/service/geo-continent/geo-continent-mutation.d.ts +9 -0
- package/dist-server/service/geo-continent/geo-continent-mutation.js +2 -2
- package/dist-server/service/geo-continent/geo-continent-mutation.js.map +1 -1
- package/dist-server/service/geo-continent/geo-continent-query.d.ts +10 -0
- package/dist-server/service/geo-continent/geo-continent-query.js +2 -2
- package/dist-server/service/geo-continent/geo-continent-query.js.map +1 -1
- package/dist-server/service/geo-continent/geo-continent-type.d.ts +15 -0
- package/dist-server/service/geo-continent/geo-continent-type.js +6 -6
- package/dist-server/service/geo-continent/geo-continent-type.js.map +1 -1
- package/dist-server/service/geo-continent/geo-continent.d.ts +12 -0
- package/dist-server/service/geo-continent/geo-continent.js +2 -2
- package/dist-server/service/geo-continent/geo-continent.js.map +1 -1
- package/dist-server/service/geo-continent/index.d.ts +5 -0
- package/dist-server/service/geo-country/geo-country-mutation.d.ts +9 -0
- package/dist-server/service/geo-country/geo-country-mutation.js +2 -2
- package/dist-server/service/geo-country/geo-country-mutation.js.map +1 -1
- package/dist-server/service/geo-country/geo-country-query.d.ts +13 -0
- package/dist-server/service/geo-country/geo-country-query.js +2 -2
- package/dist-server/service/geo-country/geo-country-query.js.map +1 -1
- package/dist-server/service/geo-country/geo-country-type.d.ts +17 -0
- package/dist-server/service/geo-country/geo-country-type.js +6 -6
- package/dist-server/service/geo-country/geo-country-type.js.map +1 -1
- package/dist-server/service/geo-country/geo-country.d.ts +16 -0
- package/dist-server/service/geo-country/geo-country.js +2 -2
- package/dist-server/service/geo-country/geo-country.js.map +1 -1
- package/dist-server/service/geo-country/index.d.ts +5 -0
- package/dist-server/service/geo-state/geo-state-mutation.d.ts +9 -0
- package/dist-server/service/geo-state/geo-state-mutation.js +2 -2
- package/dist-server/service/geo-state/geo-state-mutation.js.map +1 -1
- package/dist-server/service/geo-state/geo-state-query.d.ts +12 -0
- package/dist-server/service/geo-state/geo-state-query.js +2 -2
- package/dist-server/service/geo-state/geo-state-query.js.map +1 -1
- package/dist-server/service/geo-state/geo-state-type.d.ts +19 -0
- package/dist-server/service/geo-state/geo-state-type.js +6 -6
- package/dist-server/service/geo-state/geo-state-type.js.map +1 -1
- package/dist-server/service/geo-state/geo-state.d.ts +17 -0
- package/dist-server/service/geo-state/geo-state.js +2 -2
- package/dist-server/service/geo-state/geo-state.js.map +1 -1
- package/dist-server/service/geo-state/index.d.ts +5 -0
- package/dist-server/service/index.d.ts +9 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initMiddlewares(app: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare var migrations: any[];
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GeoArea } from './geo-area';
|
|
2
|
+
import { GeoAreaPatch, NewGeoArea } from './geo-area-type';
|
|
3
|
+
export declare class GeoAreaMutation {
|
|
4
|
+
createGeoArea(geoArea: NewGeoArea, context: ResolverContext): Promise<GeoArea>;
|
|
5
|
+
updateGeoArea(id: string, patch: GeoAreaPatch, context: ResolverContext): Promise<GeoArea>;
|
|
6
|
+
updateMultipleGeoArea(patches: GeoAreaPatch[], context: ResolverContext): Promise<GeoArea[]>;
|
|
7
|
+
deleteGeoArea(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteGeoAreas(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
}
|
|
@@ -55,6 +55,7 @@ let GeoAreaMutation = class GeoAreaMutation {
|
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
exports.GeoAreaMutation = GeoAreaMutation;
|
|
58
59
|
tslib_1.__decorate([
|
|
59
60
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
60
61
|
(0, type_graphql_1.Mutation)(returns => geo_area_1.GeoArea, { description: 'To create new GeoArea' }),
|
|
@@ -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
|
], GeoAreaMutation.prototype, "deleteGeoAreas", null);
|
|
104
|
-
GeoAreaMutation = tslib_1.__decorate([
|
|
105
|
+
exports.GeoAreaMutation = GeoAreaMutation = tslib_1.__decorate([
|
|
105
106
|
(0, type_graphql_1.Resolver)(geo_area_1.GeoArea)
|
|
106
107
|
], GeoAreaMutation);
|
|
107
|
-
exports.GeoAreaMutation = GeoAreaMutation;
|
|
108
108
|
//# sourceMappingURL=geo-area-mutation.js.map
|
|
@@ -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;AAE5B,yCAAoC;AACpC,mDAA0D;AAGnD,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,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;IAIK,AAAN,KAAK,CAAC,aAAa,CACN,EAAU,EACP,KAAmB,EAC1B,OAAwB;QAE/B,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,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C,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAQvE;0BAlGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CAmG3B","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"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { ListParam } from '@things-factory/shell';
|
|
3
|
+
import { GeoCity } from '../geo-city/geo-city';
|
|
4
|
+
import { GeoArea } from './geo-area';
|
|
5
|
+
import { GeoAreaList } from './geo-area-type';
|
|
6
|
+
export declare class GeoAreaQuery {
|
|
7
|
+
geoArea(id: string, context: ResolverContext): Promise<GeoArea>;
|
|
8
|
+
geoAreas(params: ListParam, context: ResolverContext): Promise<GeoAreaList>;
|
|
9
|
+
geoAreasAllPostCode(context: ResolverContext): Promise<{
|
|
10
|
+
items: any[];
|
|
11
|
+
total: number;
|
|
12
|
+
}>;
|
|
13
|
+
geoAreasGetStateAndCityByPosCode(postCode: string, context: ResolverContext): Promise<any>;
|
|
14
|
+
geoCity(geoArea: GeoArea): Promise<GeoCity>;
|
|
15
|
+
updater(geoArea: GeoArea): Promise<User>;
|
|
16
|
+
creator(geoArea: GeoArea): Promise<User>;
|
|
17
|
+
}
|
|
@@ -54,6 +54,7 @@ let GeoAreaQuery = class GeoAreaQuery {
|
|
|
54
54
|
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoArea.creatorId });
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
+
exports.GeoAreaQuery = GeoAreaQuery;
|
|
57
58
|
tslib_1.__decorate([
|
|
58
59
|
(0, type_graphql_1.Query)(returns => geo_area_1.GeoArea, { description: 'To fetch a GeoArea' }),
|
|
59
60
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
@@ -106,8 +107,7 @@ tslib_1.__decorate([
|
|
|
106
107
|
tslib_1.__metadata("design:paramtypes", [geo_area_1.GeoArea]),
|
|
107
108
|
tslib_1.__metadata("design:returntype", Promise)
|
|
108
109
|
], GeoAreaQuery.prototype, "creator", null);
|
|
109
|
-
GeoAreaQuery = tslib_1.__decorate([
|
|
110
|
+
exports.GeoAreaQuery = GeoAreaQuery = tslib_1.__decorate([
|
|
110
111
|
(0, type_graphql_1.Resolver)(geo_area_1.GeoArea)
|
|
111
112
|
], GeoAreaQuery);
|
|
112
|
-
exports.GeoAreaQuery = GeoAreaQuery;
|
|
113
113
|
//# sourceMappingURL=geo-area-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-area-query.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,mDAA8C;AAC9C,yCAAoC;AACpC,mDAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,OAAO,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QA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A,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;uBA9DU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CA+DxB","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"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GeoArea } from './geo-area';
|
|
2
|
+
export declare class NewGeoArea {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
countryCode?: string;
|
|
6
|
+
cityName?: string;
|
|
7
|
+
stateName?: string;
|
|
8
|
+
postalCode?: string;
|
|
9
|
+
latitude?: string;
|
|
10
|
+
longitude?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class GeoAreaPatch {
|
|
13
|
+
id?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
countryCode?: string;
|
|
17
|
+
cityName?: string;
|
|
18
|
+
stateName?: string;
|
|
19
|
+
postalCode?: string;
|
|
20
|
+
latitude?: string;
|
|
21
|
+
longitude?: string;
|
|
22
|
+
cuFlag: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class GeoAreaList {
|
|
25
|
+
items: GeoArea[];
|
|
26
|
+
total: number;
|
|
27
|
+
}
|
|
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
|
|
|
6
6
|
const geo_area_1 = require("./geo-area");
|
|
7
7
|
let NewGeoArea = class NewGeoArea {
|
|
8
8
|
};
|
|
9
|
+
exports.NewGeoArea = NewGeoArea;
|
|
9
10
|
tslib_1.__decorate([
|
|
10
11
|
(0, type_graphql_1.Field)(),
|
|
11
12
|
tslib_1.__metadata("design:type", String)
|
|
@@ -38,12 +39,12 @@ tslib_1.__decorate([
|
|
|
38
39
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
39
40
|
tslib_1.__metadata("design:type", String)
|
|
40
41
|
], NewGeoArea.prototype, "longitude", void 0);
|
|
41
|
-
NewGeoArea = tslib_1.__decorate([
|
|
42
|
+
exports.NewGeoArea = NewGeoArea = tslib_1.__decorate([
|
|
42
43
|
(0, type_graphql_1.InputType)()
|
|
43
44
|
], NewGeoArea);
|
|
44
|
-
exports.NewGeoArea = NewGeoArea;
|
|
45
45
|
let GeoAreaPatch = class GeoAreaPatch {
|
|
46
46
|
};
|
|
47
|
+
exports.GeoAreaPatch = GeoAreaPatch;
|
|
47
48
|
tslib_1.__decorate([
|
|
48
49
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
49
50
|
tslib_1.__metadata("design:type", String)
|
|
@@ -84,12 +85,12 @@ tslib_1.__decorate([
|
|
|
84
85
|
(0, type_graphql_1.Field)(),
|
|
85
86
|
tslib_1.__metadata("design:type", String)
|
|
86
87
|
], GeoAreaPatch.prototype, "cuFlag", void 0);
|
|
87
|
-
GeoAreaPatch = tslib_1.__decorate([
|
|
88
|
+
exports.GeoAreaPatch = GeoAreaPatch = tslib_1.__decorate([
|
|
88
89
|
(0, type_graphql_1.InputType)()
|
|
89
90
|
], GeoAreaPatch);
|
|
90
|
-
exports.GeoAreaPatch = GeoAreaPatch;
|
|
91
91
|
let GeoAreaList = class GeoAreaList {
|
|
92
92
|
};
|
|
93
|
+
exports.GeoAreaList = GeoAreaList;
|
|
93
94
|
tslib_1.__decorate([
|
|
94
95
|
(0, type_graphql_1.Field)(type => [geo_area_1.GeoArea]),
|
|
95
96
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -98,8 +99,7 @@ tslib_1.__decorate([
|
|
|
98
99
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
99
100
|
tslib_1.__metadata("design:type", Number)
|
|
100
101
|
], GeoAreaList.prototype, "total", void 0);
|
|
101
|
-
GeoAreaList = tslib_1.__decorate([
|
|
102
|
+
exports.GeoAreaList = GeoAreaList = tslib_1.__decorate([
|
|
102
103
|
(0, type_graphql_1.ObjectType)()
|
|
103
104
|
], GeoAreaList);
|
|
104
|
-
exports.GeoAreaList = GeoAreaList;
|
|
105
105
|
//# sourceMappingURL=geo-area-type.js.map
|
|
@@ -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;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAwBtB,CAAA;
|
|
1
|
+
{"version":3,"file":"geo-area-type.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAwBtB,CAAA;AAxBY,gCAAU;AAErB;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,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;qBAvBP,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAwBtB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CA8BxB,CAAA;AA9BY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,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;uBA7BH,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CA8BxB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;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;sBALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB","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"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { GeoCity } from '../geo-city/geo-city';
|
|
3
|
+
export declare class GeoArea {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
geoCity?: GeoCity;
|
|
6
|
+
geoCityId?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
countryCode?: string;
|
|
10
|
+
cityName?: string;
|
|
11
|
+
stateName?: string;
|
|
12
|
+
postalCode?: string;
|
|
13
|
+
latitude?: string;
|
|
14
|
+
longitude?: string;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
creator?: User;
|
|
18
|
+
creatorId?: string;
|
|
19
|
+
updater?: User;
|
|
20
|
+
updaterId?: string;
|
|
21
|
+
}
|
|
@@ -8,6 +8,7 @@ const typeorm_1 = require("typeorm");
|
|
|
8
8
|
const geo_city_1 = require("../geo-city/geo-city");
|
|
9
9
|
let GeoArea = class GeoArea {
|
|
10
10
|
};
|
|
11
|
+
exports.GeoArea = GeoArea;
|
|
11
12
|
tslib_1.__decorate([
|
|
12
13
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
13
14
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -90,12 +91,11 @@ tslib_1.__decorate([
|
|
|
90
91
|
(0, typeorm_1.RelationId)((geoArea) => geoArea.updater),
|
|
91
92
|
tslib_1.__metadata("design:type", String)
|
|
92
93
|
], GeoArea.prototype, "updaterId", void 0);
|
|
93
|
-
GeoArea = tslib_1.__decorate([
|
|
94
|
+
exports.GeoArea = GeoArea = tslib_1.__decorate([
|
|
94
95
|
(0, typeorm_1.Entity)(),
|
|
95
96
|
(0, typeorm_1.Index)('ix_geo_area_0', (geoArea) => [geoArea.geoCity, geoArea.name, geoArea.postalCode, geoArea.stateName], {
|
|
96
97
|
unique: true
|
|
97
98
|
}),
|
|
98
99
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for GeoArea' })
|
|
99
100
|
], GeoArea);
|
|
100
|
-
exports.GeoArea = GeoArea;
|
|
101
101
|
//# sourceMappingURL=geo-area.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-area.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,mDAA8C;AAOvC,IAAM,OAAO,GAAb,MAAM,OAAO;CAiEnB,CAAA;
|
|
1
|
+
{"version":3,"file":"geo-area.js","sourceRoot":"","sources":["../../../server/service/geo-area/geo-area.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,mDAA8C;AAOvC,IAAM,OAAO,GAAb,MAAM,OAAO;CAiEnB,CAAA;AAjEY,0BAAO;AAGT;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;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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 { GeoCity } from '../geo-city/geo-city'\n\n@Entity()\n@Index('ix_geo_area_0', (geoArea: GeoArea) => [geoArea.geoCity, geoArea.name, geoArea.postalCode, geoArea.stateName], {\n unique: true\n})\n@ObjectType({ description: 'Entity for GeoArea' })\nexport class GeoArea {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoCity)\n @Field({ nullable: true })\n geoCity?: GeoCity\n\n @RelationId((geoArea: GeoArea) => geoArea.geoCity)\n geoCityId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n countryCode?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n cityName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n stateName?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n postalCode?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n latitude?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n longitude?: 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, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((geoArea: GeoArea) => geoArea.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoArea: GeoArea) => geoArea.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GeoArea } from './geo-area';
|
|
2
|
+
import { GeoAreaQuery } from './geo-area-query';
|
|
3
|
+
import { GeoAreaMutation } from './geo-area-mutation';
|
|
4
|
+
export declare const entities: (typeof GeoArea)[];
|
|
5
|
+
export declare const resolvers: (typeof GeoAreaQuery | typeof GeoAreaMutation)[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GeoCity } from './geo-city';
|
|
2
|
+
import { GeoCityPatch, NewGeoCity } from './geo-city-type';
|
|
3
|
+
export declare class GeoCityMutation {
|
|
4
|
+
createGeoCity(geoCity: NewGeoCity, context: ResolverContext): Promise<GeoCity>;
|
|
5
|
+
updateGeoCity(id: string, patch: GeoCityPatch, context: ResolverContext): Promise<GeoCity>;
|
|
6
|
+
updateMultipleGeoCity(patches: GeoCityPatch[], context: ResolverContext): Promise<GeoCity[]>;
|
|
7
|
+
deleteGeoCity(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteGeoCities(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
}
|
|
@@ -55,6 +55,7 @@ let GeoCityMutation = class GeoCityMutation {
|
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
+
exports.GeoCityMutation = GeoCityMutation;
|
|
58
59
|
tslib_1.__decorate([
|
|
59
60
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
60
61
|
(0, type_graphql_1.Mutation)(returns => geo_city_1.GeoCity, { description: 'To create new GeoCity' }),
|
|
@@ -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
|
], GeoCityMutation.prototype, "deleteGeoCities", null);
|
|
104
|
-
GeoCityMutation = tslib_1.__decorate([
|
|
105
|
+
exports.GeoCityMutation = GeoCityMutation = tslib_1.__decorate([
|
|
105
106
|
(0, type_graphql_1.Resolver)(geo_city_1.GeoCity)
|
|
106
107
|
], GeoCityMutation);
|
|
107
|
-
exports.GeoCityMutation = GeoCityMutation;
|
|
108
108
|
//# sourceMappingURL=geo-city-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-city-mutation.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,yCAAoC;AACpC,mDAA0D;AAGnD,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,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;IAIK,AAAN,KAAK,CAAC,aAAa,CACN,EAAU,EACP,KAAmB,EAC1B,OAAwB;QAE/B,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;IAIK,AAAN,KAAK,CAAC,qBAAqB,CACe,OAAuB,EACxD,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAElC,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,M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AA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,4BAAY;;oDAelC;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,kBAAO,CAAC,EAAE,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;IAE1F,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC,CAAA;IACtC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DAuCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKhD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAE1E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sDASP;0BArGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,eAAe,CAsG3B","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { GeoCity } from './geo-city'\nimport { GeoCityPatch, NewGeoCity } from './geo-city-type'\n\n@Resolver(GeoCity)\nexport class GeoCityMutation {\n @Directive('@transaction')\n @Mutation(returns => GeoCity, { description: 'To create new GeoCity' })\n async createGeoCity(@Arg('geoCity') geoCity: NewGeoCity, @Ctx() context: ResolverContext): Promise<GeoCity> {\n const { user, tx } = context.state\n\n return await tx.getRepository(GeoCity).save({\n ...geoCity,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => GeoCity, { description: 'To modify GeoCity information' })\n async updateGeoCity(\n @Arg('id') id: string,\n @Arg('patch') patch: GeoCityPatch,\n @Ctx() context: ResolverContext\n ): Promise<GeoCity> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(GeoCity)\n const geoCity = await repository.findOne({\n where: { id }\n })\n\n return await repository.save({\n ...geoCity,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [GeoCity], { description: \"To modify multiple GeoCities' information\" })\n async updateMultipleGeoCity(\n @Arg('patches', type => [GeoCityPatch]) patches: GeoCityPatch[],\n @Ctx() context: ResolverContext\n ): Promise<GeoCity[]> {\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 geoCityRepo = tx.getRepository(GeoCity)\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 geoCityRepo.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 geoCity = await geoCityRepo.findOneBy({ id: newRecord.id })\n\n const result = await geoCityRepo.save({\n ...geoCity,\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 GeoCity' })\n async deleteGeoCity(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCity).delete({ id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple geoCitys' })\n async deleteGeoCities(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(GeoCity).delete({\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
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/geo-state';
|
|
5
|
+
import { GeoCity } from './geo-city';
|
|
6
|
+
import { GeoCityList } from './geo-city-type';
|
|
7
|
+
export declare class GeoCityQuery {
|
|
8
|
+
geoCity(id: string, context: ResolverContext): Promise<GeoCity>;
|
|
9
|
+
geoCities(params: ListParam, context: ResolverContext): Promise<GeoCityList>;
|
|
10
|
+
geoCountry(geoCity: GeoCity): Promise<GeoCountry>;
|
|
11
|
+
geoState(geoCity: GeoCity): Promise<GeoState>;
|
|
12
|
+
updater(geoCity: GeoCity): Promise<User>;
|
|
13
|
+
creator(geoCity: GeoCity): Promise<User>;
|
|
14
|
+
}
|
|
@@ -33,6 +33,7 @@ let GeoCityQuery = class GeoCityQuery {
|
|
|
33
33
|
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: geoCity.creatorId });
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
+
exports.GeoCityQuery = GeoCityQuery;
|
|
36
37
|
tslib_1.__decorate([
|
|
37
38
|
(0, type_graphql_1.Query)(returns => geo_city_1.GeoCity, { description: 'To fetch a GeoCity' }),
|
|
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_city_1.GeoCity]),
|
|
78
79
|
tslib_1.__metadata("design:returntype", Promise)
|
|
79
80
|
], GeoCityQuery.prototype, "creator", null);
|
|
80
|
-
GeoCityQuery = tslib_1.__decorate([
|
|
81
|
+
exports.GeoCityQuery = GeoCityQuery = tslib_1.__decorate([
|
|
81
82
|
(0, type_graphql_1.Resolver)(geo_city_1.GeoCity)
|
|
82
83
|
], GeoCityQuery);
|
|
83
|
-
exports.GeoCityQuery = GeoCityQuery;
|
|
84
84
|
//# sourceMappingURL=geo-city-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-city-query.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAmF;AAEnF,4DAAuD;AACvD,sDAAiD;AACjD,yCAAoC;AACpC,mDAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,OAAO,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAwB;QACxE,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,kBAAO,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEjF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CAAS,OAAgB;QACvC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,C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;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,wBAAU,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;8CAExC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAQ,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;4CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,kBAAO;;2CAErC;uBAlCU,YAAY;IADxB,IAAA,uBAAQ,EAAC,kBAAO,CAAC;GACL,YAAY,CAmCxB","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 { GeoCountry } from '../geo-country/geo-country'\nimport { GeoState } from '../geo-state/geo-state'\nimport { GeoCity } from './geo-city'\nimport { GeoCityList } from './geo-city-type'\n\n@Resolver(GeoCity)\nexport class GeoCityQuery {\n @Query(returns => GeoCity, { description: 'To fetch a GeoCity' })\n async geoCity(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<GeoCity> {\n return await getRepository(GeoCity).findOne({\n where: { id }\n })\n }\n\n @Query(returns => GeoCityList, { description: 'To fetch multiple GeoCities' })\n async geoCities(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<GeoCityList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(GeoCity).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => GeoCountry)\n async geoCountry(@Root() geoCity: GeoCity): Promise<GeoCountry> {\n return await getRepository(GeoCountry).findOneBy({ id: geoCity.geoCountryId })\n }\n\n @FieldResolver(type => GeoState)\n async geoState(@Root() geoCity: GeoCity): Promise<GeoState> {\n return await getRepository(GeoState).findOneBy({ id: geoCity.geoStateId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() geoCity: GeoCity): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCity.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() geoCity: GeoCity): Promise<User> {\n return await getRepository(User).findOneBy({ id: geoCity.creatorId })\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GeoCity } from './geo-city';
|
|
2
|
+
export declare class NewGeoCity {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
latitude?: string;
|
|
6
|
+
longitude?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class GeoCityPatch {
|
|
9
|
+
id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
latitude?: string;
|
|
13
|
+
longitude?: string;
|
|
14
|
+
cuFlag: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class GeoCityList {
|
|
17
|
+
items: GeoCity[];
|
|
18
|
+
total: number;
|
|
19
|
+
}
|
|
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
|
|
|
6
6
|
const geo_city_1 = require("./geo-city");
|
|
7
7
|
let NewGeoCity = class NewGeoCity {
|
|
8
8
|
};
|
|
9
|
+
exports.NewGeoCity = NewGeoCity;
|
|
9
10
|
tslib_1.__decorate([
|
|
10
11
|
(0, type_graphql_1.Field)(),
|
|
11
12
|
tslib_1.__metadata("design:type", String)
|
|
@@ -22,12 +23,12 @@ tslib_1.__decorate([
|
|
|
22
23
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
24
|
tslib_1.__metadata("design:type", String)
|
|
24
25
|
], NewGeoCity.prototype, "longitude", void 0);
|
|
25
|
-
NewGeoCity = tslib_1.__decorate([
|
|
26
|
+
exports.NewGeoCity = NewGeoCity = tslib_1.__decorate([
|
|
26
27
|
(0, type_graphql_1.InputType)()
|
|
27
28
|
], NewGeoCity);
|
|
28
|
-
exports.NewGeoCity = NewGeoCity;
|
|
29
29
|
let GeoCityPatch = class GeoCityPatch {
|
|
30
30
|
};
|
|
31
|
+
exports.GeoCityPatch = GeoCityPatch;
|
|
31
32
|
tslib_1.__decorate([
|
|
32
33
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
33
34
|
tslib_1.__metadata("design:type", String)
|
|
@@ -52,12 +53,12 @@ tslib_1.__decorate([
|
|
|
52
53
|
(0, type_graphql_1.Field)(),
|
|
53
54
|
tslib_1.__metadata("design:type", String)
|
|
54
55
|
], GeoCityPatch.prototype, "cuFlag", void 0);
|
|
55
|
-
GeoCityPatch = tslib_1.__decorate([
|
|
56
|
+
exports.GeoCityPatch = GeoCityPatch = tslib_1.__decorate([
|
|
56
57
|
(0, type_graphql_1.InputType)()
|
|
57
58
|
], GeoCityPatch);
|
|
58
|
-
exports.GeoCityPatch = GeoCityPatch;
|
|
59
59
|
let GeoCityList = class GeoCityList {
|
|
60
60
|
};
|
|
61
|
+
exports.GeoCityList = GeoCityList;
|
|
61
62
|
tslib_1.__decorate([
|
|
62
63
|
(0, type_graphql_1.Field)(type => [geo_city_1.GeoCity]),
|
|
63
64
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -66,8 +67,7 @@ tslib_1.__decorate([
|
|
|
66
67
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
67
68
|
tslib_1.__metadata("design:type", Number)
|
|
68
69
|
], GeoCityList.prototype, "total", void 0);
|
|
69
|
-
GeoCityList = tslib_1.__decorate([
|
|
70
|
+
exports.GeoCityList = GeoCityList = tslib_1.__decorate([
|
|
70
71
|
(0, type_graphql_1.ObjectType)()
|
|
71
72
|
], GeoCityList);
|
|
72
|
-
exports.GeoCityList = GeoCityList;
|
|
73
73
|
//# sourceMappingURL=geo-city-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-city-type.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAYtB,CAAA;
|
|
1
|
+
{"version":3,"file":"geo-city-type.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAoC;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAYtB,CAAA;AAZY,gCAAU;AAErB;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;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACR;qBAXP,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAYtB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAkBxB,CAAA;AAlBY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,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,GAAE;;4CACM;uBAjBH,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAkBxB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;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;sBALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport { GeoCity } from './geo-city'\n\n@InputType()\nexport class NewGeoCity {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n}\n\n@InputType()\nexport class GeoCityPatch {\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 latitude?: string\n\n @Field({ nullable: true })\n longitude?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class GeoCityList {\n @Field(type => [GeoCity])\n items: GeoCity[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { GeoCountry } from '../geo-country/geo-country';
|
|
3
|
+
import { GeoState } from '../geo-state/geo-state';
|
|
4
|
+
export declare class GeoCity {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
geoCountry: GeoCountry;
|
|
7
|
+
geoCountryId?: string;
|
|
8
|
+
geoState?: GeoState;
|
|
9
|
+
geoStateId?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
latitude?: string;
|
|
13
|
+
longitude?: string;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
creator?: User;
|
|
17
|
+
creatorId?: string;
|
|
18
|
+
updater?: User;
|
|
19
|
+
updaterId?: string;
|
|
20
|
+
}
|
|
@@ -9,6 +9,7 @@ const geo_country_1 = require("../geo-country/geo-country");
|
|
|
9
9
|
const geo_state_1 = require("../geo-state/geo-state");
|
|
10
10
|
let GeoCity = class GeoCity {
|
|
11
11
|
};
|
|
12
|
+
exports.GeoCity = GeoCity;
|
|
12
13
|
tslib_1.__decorate([
|
|
13
14
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
14
15
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -86,10 +87,9 @@ tslib_1.__decorate([
|
|
|
86
87
|
(0, typeorm_1.RelationId)((geoCity) => geoCity.updater),
|
|
87
88
|
tslib_1.__metadata("design:type", String)
|
|
88
89
|
], GeoCity.prototype, "updaterId", void 0);
|
|
89
|
-
GeoCity = tslib_1.__decorate([
|
|
90
|
+
exports.GeoCity = GeoCity = tslib_1.__decorate([
|
|
90
91
|
(0, typeorm_1.Entity)(),
|
|
91
92
|
(0, typeorm_1.Index)('ix_geo_city_0', (geoCity) => [geoCity.geoCountry, geoCity.name, geoCity.geoState], { unique: true }),
|
|
92
93
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for GeoCity' })
|
|
93
94
|
], GeoCity);
|
|
94
|
-
exports.GeoCity = GeoCity;
|
|
95
95
|
//# sourceMappingURL=geo-city.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-city.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,+CAAoD;AACpD,qCASgB;AAChB,4DAAuD;AACvD,sDAAiD;AAK1C,IAAM,OAAO,GAAb,MAAM,OAAO;CA8DnB,CAAA;
|
|
1
|
+
{"version":3,"file":"geo-city.js","sourceRoot":"","sources":["../../../server/service/geo-city/geo-city.ts"],"names":[],"mappings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AE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;0CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;0CAAA;AAMhB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;AAMlB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;kBA7DP,OAAO;IAHnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACpH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;GACrC,OAAO,CA8DnB","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 { GeoCountry } from '../geo-country/geo-country'\nimport { GeoState } from '../geo-state/geo-state'\n\n@Entity()\n@Index('ix_geo_city_0', (geoCity: GeoCity) => [geoCity.geoCountry, geoCity.name, geoCity.geoState], { unique: true })\n@ObjectType({ description: 'Entity for GeoCity' })\nexport class GeoCity {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => GeoCountry)\n @Field()\n geoCountry: GeoCountry\n\n @RelationId((geoCity: GeoCity) => geoCity.geoCountry)\n geoCountryId?: string\n\n @ManyToOne(type => GeoState)\n @Field({ nullable: true })\n geoState?: GeoState\n\n @RelationId((geoCity: GeoCity) => geoCity.geoState)\n geoStateId?: 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 latitude?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n longitude?: 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((geoCity: GeoCity) => geoCity.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((geoCity: GeoCity) => geoCity.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -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
|
+
}
|