@things-factory/geography 4.3.281 → 4.3.378
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/index 2.js +21 -0
- package/dist-server/index.js 2.map +1 -0
- package/dist-server/routes 2.js +25 -0
- package/dist-server/routes.js 2.map +1 -0
- package/dist-server/service/geo-country/geo-country-query.js +15 -1
- package/dist-server/service/geo-country/geo-country-query.js.map +1 -1
- package/package.json +4 -4
- package/server/service/geo-country/geo-country-query.ts +15 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./migrations"), exports);
|
|
18
|
+
__exportStar(require("./middlewares"), exports);
|
|
19
|
+
__exportStar(require("./service"), exports);
|
|
20
|
+
require("./routes");
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,gDAA6B;AAC7B,4CAAyB;AAEzB,oBAAiB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const debug = require('debug')('things-factory:geography:routes');
|
|
2
|
+
process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) => {
|
|
3
|
+
/*
|
|
4
|
+
* can add global public routes to application (auth not required, tenancy not required)
|
|
5
|
+
*
|
|
6
|
+
* ex) routes.get('/path', async(context, next) => {})
|
|
7
|
+
* ex) routes.post('/path', async(context, next) => {})
|
|
8
|
+
*/
|
|
9
|
+
});
|
|
10
|
+
process.on('bootstrap-module-global-private-route', (app, globalPrivateRouter) => {
|
|
11
|
+
/*
|
|
12
|
+
* can add global private routes to application (auth required, tenancy not required)
|
|
13
|
+
*/
|
|
14
|
+
});
|
|
15
|
+
process.on('bootstrap-module-domain-public-route', (app, domainPublicRouter) => {
|
|
16
|
+
/*
|
|
17
|
+
* can add domain public routes to application (auth not required, tenancy required)
|
|
18
|
+
*/
|
|
19
|
+
});
|
|
20
|
+
process.on('bootstrap-module-domain-private-route', (app, domainPrivateRouter) => {
|
|
21
|
+
/*
|
|
22
|
+
* can add domain private routes to application (auth required, tenancy required)
|
|
23
|
+
*/
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,iCAAiC,CAAC,CAAA;AAEjE,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;;;;OAKG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA"}
|
|
@@ -33,7 +33,21 @@ let GeoCountryQuery = class GeoCountryQuery {
|
|
|
33
33
|
return { items, total };
|
|
34
34
|
}
|
|
35
35
|
async geoCountriesWithoutParam(params, context) {
|
|
36
|
-
|
|
36
|
+
var _a, _b, _c;
|
|
37
|
+
const nameFilter = (_a = params.filters) === null || _a === void 0 ? void 0 : _a.find((param) => param.name == 'name');
|
|
38
|
+
const descFilter = (_b = params.filters) === null || _b === void 0 ? void 0 : _b.find((param) => param.name == 'description');
|
|
39
|
+
const qb = (0, typeorm_1.getRepository)(geo_country_1.GeoCountry).createQueryBuilder('gc');
|
|
40
|
+
if (((_c = params.filters) === null || _c === void 0 ? void 0 : _c.length) > 1) {
|
|
41
|
+
qb.where(`gc.name ilike :name`, { name: nameFilter.value });
|
|
42
|
+
qb.andWhere(`gc.description ilike :description`, { description: descFilter.value });
|
|
43
|
+
}
|
|
44
|
+
else if (nameFilter && nameFilter.value) {
|
|
45
|
+
qb.where(`gc.name ilike :name`, { name: nameFilter.value });
|
|
46
|
+
}
|
|
47
|
+
else if (descFilter && descFilter.value) {
|
|
48
|
+
qb.where(`gc.description ilike :description`, { description: descFilter.value });
|
|
49
|
+
}
|
|
50
|
+
const [items, total] = await qb.getManyAndCount();
|
|
37
51
|
return { items, total };
|
|
38
52
|
}
|
|
39
53
|
async geoContinent(geoCountry) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geo-country-query.js","sourceRoot":"","sources":["../../../server/service/geo-country/geo-country-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAgD;AAChD,iDAAoE;AACpE,+CAAmF;AACnF,qCAAuC;AACvC,kEA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AI,CAAC,EAAE,CAAC,4BAAY,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;mDAEhD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAlDU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAmD3B;AAnDY,0CAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/geography",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.378",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@things-factory/auth-base": "^4.3.
|
|
27
|
-
"@things-factory/shell": "^4.3.
|
|
26
|
+
"@things-factory/auth-base": "^4.3.378",
|
|
27
|
+
"@things-factory/shell": "^4.3.378"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "9de7af5e7b61574cdb4773876a41e1b9b77c1689"
|
|
30
30
|
}
|
|
@@ -25,7 +25,21 @@ export class GeoCountryQuery {
|
|
|
25
25
|
|
|
26
26
|
@Query(returns => GeoCountryList, { description: 'To fetch multiple GeoCountries without params' })
|
|
27
27
|
async geoCountriesWithoutParam(@Args() params: ListParam, @Ctx() context: any): Promise<GeoCountryList> {
|
|
28
|
-
const
|
|
28
|
+
const nameFilter : any = params.filters?.find((param:any) => param.name =='name')
|
|
29
|
+
const descFilter : any = params.filters?.find((param:any) => param.name =='description')
|
|
30
|
+
const qb = getRepository (GeoCountry).createQueryBuilder('gc')
|
|
31
|
+
|
|
32
|
+
if(params.filters?.length>1){
|
|
33
|
+
qb.where(`gc.name ilike :name` , {name: nameFilter.value })
|
|
34
|
+
qb.andWhere(`gc.description ilike :description` , {description: descFilter.value })
|
|
35
|
+
}
|
|
36
|
+
else if(nameFilter && nameFilter.value){
|
|
37
|
+
qb.where(`gc.name ilike :name` , {name: nameFilter.value })
|
|
38
|
+
} else if (descFilter && descFilter.value){
|
|
39
|
+
qb.where(`gc.description ilike :description` , {description: descFilter.value })
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const [items, total] = await qb.getManyAndCount()
|
|
29
43
|
|
|
30
44
|
return { items, total }
|
|
31
45
|
}
|