fiscalia_bo-nest-helpers 0.0.28 → 0.0.29
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/http-service/http-service.pipes.js +1 -1
- package/dist/http-service/http-service.pipes.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -2
- package/dist/ms-geojson/dto/ms-geojson.dto.d.ts +0 -6
- package/dist/ms-geojson/dto/ms-geojson.dto.js +0 -33
- package/dist/ms-geojson/dto/ms-geojson.dto.js.map +0 -1
- package/dist/ms-geojson/index.d.ts +0 -2
- package/dist/ms-geojson/index.js +0 -8
- package/dist/ms-geojson/index.js.map +0 -1
- package/dist/ms-geojson/ms-geojson.module.d.ts +0 -5
- package/dist/ms-geojson/ms-geojson.module.js +0 -35
- package/dist/ms-geojson/ms-geojson.module.js.map +0 -1
- package/dist/ms-geojson/ms-geojson.service.d.ts +0 -5
- package/dist/ms-geojson/ms-geojson.service.js +0 -44
- package/dist/ms-geojson/ms-geojson.service.js.map +0 -1
@@ -71,7 +71,7 @@ const axiosResponseStatusMessages = {
|
|
71
71
|
exports.TransformHttpServiceResponse = (0, rxjs_1.map)((resp) => {
|
72
72
|
let response = {
|
73
73
|
error: true,
|
74
|
-
message: 'Error en el
|
74
|
+
message: 'Error en el servicio ' + resp.request.url,
|
75
75
|
response: {},
|
76
76
|
status: 500,
|
77
77
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"http-service.pipes.js","sourceRoot":"","sources":["../../src/http-service/http-service.pipes.ts"],"names":[],"mappings":";;;AACA,+BAA4D;AAG5D,MAAM,2BAA2B,GAAG;IAClC,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,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;IACzB,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,sCAAsC;IAC3C,GAAG,EAAE,2BAA2B;IAChC,GAAG,EAAE,0BAA0B;IAC/B,GAAG,EAAE,6BAA6B;IAClC,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,mCAAmC;IACxC,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,gCAAgC;CACtC,CAAC;AAGW,QAAA,4BAA4B,GAAG,IAAA,UAAG,EAC7C,CAAC,IAA6B,EAAoB,EAAE;IAClD,IAAI,QAAQ,GAAqB;QAC/B,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"http-service.pipes.js","sourceRoot":"","sources":["../../src/http-service/http-service.pipes.ts"],"names":[],"mappings":";;;AACA,+BAA4D;AAG5D,MAAM,2BAA2B,GAAG;IAClC,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,6BAA6B;IAClC,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,eAAe;IACp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aACH;SACF;KACF;IACD,IAAI,IAAI,CAAC,OAAO,KAAK,kBAAkB;QAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9D,OAAO,IAAA,SAAE,EAAC,IAAI,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
@@ -10,4 +10,5 @@ export * from './ms-seguridad/ms-seguridad.decorator';
|
|
10
10
|
export { PermissionsGuard } from './ms-seguridad/permision.guard';
|
11
11
|
export * from './ms-seguridad/token-auth.guard';
|
12
12
|
export * from './types';
|
13
|
+
export * from './helpers/request.helper';
|
13
14
|
export * as MsPersonas from './ms-personas';
|
package/dist/index.js
CHANGED
@@ -28,5 +28,6 @@ var permision_guard_1 = require("./ms-seguridad/permision.guard");
|
|
28
28
|
Object.defineProperty(exports, "PermissionsGuard", { enumerable: true, get: function () { return permision_guard_1.PermissionsGuard; } });
|
29
29
|
__exportStar(require("./ms-seguridad/token-auth.guard"), exports);
|
30
30
|
__exportStar(require("./types"), exports);
|
31
|
+
__exportStar(require("./helpers/request.helper"), exports);
|
31
32
|
exports.MsPersonas = require("./ms-personas");
|
32
33
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "fiscalia_bo-nest-helpers",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.29",
|
4
4
|
"author": "UTIC",
|
5
5
|
"contact": {
|
6
6
|
"name": "Unidad de Tecnologías de la Información y Comunicación - Ministerio Público",
|
@@ -13,7 +13,6 @@
|
|
13
13
|
"dist/ms-personas/*",
|
14
14
|
"dist/http-service/*",
|
15
15
|
"dist/services/*",
|
16
|
-
"dist/ms-geojson/*",
|
17
16
|
"dist/helpers/*",
|
18
17
|
"dist/types/*",
|
19
18
|
"dist/index.d.ts",
|
@@ -1,33 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.ValidateCoordinatesPolygonDTO = exports.Coordinates = void 0;
|
13
|
-
const class_transformer_1 = require("class-transformer");
|
14
|
-
const class_validator_1 = require("class-validator");
|
15
|
-
class Coordinates {
|
16
|
-
}
|
17
|
-
__decorate([
|
18
|
-
(0, class_transformer_1.Type)(() => Number),
|
19
|
-
(0, class_validator_1.IsArray)(),
|
20
|
-
(0, class_validator_1.IsNumber)({}, { each: true }),
|
21
|
-
__metadata("design:type", Array)
|
22
|
-
], Coordinates.prototype, "coordinates", void 0);
|
23
|
-
exports.Coordinates = Coordinates;
|
24
|
-
class ValidateCoordinatesPolygonDTO {
|
25
|
-
}
|
26
|
-
__decorate([
|
27
|
-
(0, class_transformer_1.Type)(() => Coordinates),
|
28
|
-
(0, class_validator_1.IsArray)(),
|
29
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
30
|
-
__metadata("design:type", Array)
|
31
|
-
], ValidateCoordinatesPolygonDTO.prototype, "polygonCoordinates", void 0);
|
32
|
-
exports.ValidateCoordinatesPolygonDTO = ValidateCoordinatesPolygonDTO;
|
33
|
-
//# sourceMappingURL=ms-geojson.dto.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ms-geojson.dto.js","sourceRoot":"","sources":["../../../src/ms-geojson/dto/ms-geojson.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAoE;AAEpE,MAAa,WAAW;CAKvB;AAJC;IAAC,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;gDACC;AAJhC,kCAKC;AAED,MAAa,6BAA6B;CAKzC;AAJC;IAAC,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,WAAW,CAAC;IACvB,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;yEACG;AAJpC,sEAKC"}
|
package/dist/ms-geojson/index.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.MsGeoJsonModule = exports.MsGeoJsonService = void 0;
|
4
|
-
var ms_geojson_service_1 = require("./ms-geojson.service");
|
5
|
-
Object.defineProperty(exports, "MsGeoJsonService", { enumerable: true, get: function () { return ms_geojson_service_1.MsGeoJsonService; } });
|
6
|
-
var ms_geojson_module_1 = require("./ms-geojson.module");
|
7
|
-
Object.defineProperty(exports, "MsGeoJsonModule", { enumerable: true, get: function () { return ms_geojson_module_1.MsGeoJsonModule; } });
|
8
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ms-geojson/index.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA"}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var MsGeoJsonModule_1;
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
exports.MsGeoJsonModule = void 0;
|
11
|
-
const common_1 = require("@nestjs/common");
|
12
|
-
const ms_geojson_service_1 = require("./ms-geojson.service");
|
13
|
-
let MsGeoJsonModule = MsGeoJsonModule_1 = class MsGeoJsonModule {
|
14
|
-
static register() {
|
15
|
-
return {
|
16
|
-
module: MsGeoJsonModule_1,
|
17
|
-
imports: [],
|
18
|
-
providers: [ms_geojson_service_1.MsGeoJsonService],
|
19
|
-
exports: [ms_geojson_service_1.MsGeoJsonService],
|
20
|
-
};
|
21
|
-
}
|
22
|
-
static async registerAsync() {
|
23
|
-
return {
|
24
|
-
module: MsGeoJsonModule_1,
|
25
|
-
imports: [],
|
26
|
-
providers: [MsGeoJsonModule_1],
|
27
|
-
exports: [MsGeoJsonModule_1],
|
28
|
-
};
|
29
|
-
}
|
30
|
-
};
|
31
|
-
MsGeoJsonModule = MsGeoJsonModule_1 = __decorate([
|
32
|
-
(0, common_1.Module)({})
|
33
|
-
], MsGeoJsonModule);
|
34
|
-
exports.MsGeoJsonModule = MsGeoJsonModule;
|
35
|
-
//# sourceMappingURL=ms-geojson.module.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ms-geojson.module.js","sourceRoot":"","sources":["../../src/ms-geojson/ms-geojson.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,6DAAwD;AAGjD,IAAM,eAAe,uBAArB,MAAM,eAAe;IAI1B,MAAM,CAAC,QAAQ;QACb,OAAO;YACL,MAAM,EAAE,iBAAe;YACvB,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,CAAC,qCAAgB,CAAC;YAC7B,OAAO,EAAE,CAAC,qCAAgB,CAAC;SAC5B,CAAC;IACJ,CAAC;IAKD,MAAM,CAAC,KAAK,CAAC,aAAa;QACxB,OAAO;YACL,MAAM,EAAE,iBAAe;YACvB,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,CAAC,iBAAe,CAAC;YAC5B,OAAO,EAAE,CAAC,iBAAe,CAAC;SAC3B,CAAC;IACJ,CAAC;CACF,CAAA;AAxBY,eAAe;IAD3B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,eAAe,CAwB3B;AAxBY,0CAAe"}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { Coordinates, ValidateCoordinatesPolygonDTO } from './dto/ms-geojson.dto';
|
2
|
-
export declare class MsGeoJsonService {
|
3
|
-
validateData(input: any): ValidateCoordinatesPolygonDTO;
|
4
|
-
validateCoordinatesGeoJson(coordinatesPolygon: any, { coordinates }: Coordinates): Promise<any>;
|
5
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
-
exports.MsGeoJsonService = void 0;
|
10
|
-
const common_1 = require("@nestjs/common");
|
11
|
-
const ms_geojson_dto_1 = require("./dto/ms-geojson.dto");
|
12
|
-
const class_validator_1 = require("class-validator");
|
13
|
-
const turf = require("@turf/turf");
|
14
|
-
let MsGeoJsonService = class MsGeoJsonService {
|
15
|
-
validateData(input) {
|
16
|
-
const dto = new ms_geojson_dto_1.ValidateCoordinatesPolygonDTO();
|
17
|
-
if (Array.isArray(input))
|
18
|
-
dto.polygonCoordinates = input === null || input === void 0 ? void 0 : input.map((coords) => ({ coordinates: coords }));
|
19
|
-
const errors = (0, class_validator_1.validateSync)(dto);
|
20
|
-
if (errors.length > 0) {
|
21
|
-
throw new Error('La entrada de datos es inválida.');
|
22
|
-
}
|
23
|
-
return dto;
|
24
|
-
}
|
25
|
-
async validateCoordinatesGeoJson(coordinatesPolygon, { coordinates }) {
|
26
|
-
try {
|
27
|
-
this.validateData(coordinatesPolygon);
|
28
|
-
const polygonCoordinates = coordinatesPolygon;
|
29
|
-
const pointCoordinates = coordinates;
|
30
|
-
const pointGeoJSON = turf.point(pointCoordinates);
|
31
|
-
const polygonGeoJSON = turf.polygon([polygonCoordinates]);
|
32
|
-
const isPointInside = turf.booleanPointInPolygon(pointGeoJSON, polygonGeoJSON);
|
33
|
-
return { isValid: isPointInside };
|
34
|
-
}
|
35
|
-
catch (error) {
|
36
|
-
throw error.message;
|
37
|
-
}
|
38
|
-
}
|
39
|
-
};
|
40
|
-
MsGeoJsonService = __decorate([
|
41
|
-
(0, common_1.Injectable)()
|
42
|
-
], MsGeoJsonService);
|
43
|
-
exports.MsGeoJsonService = MsGeoJsonService;
|
44
|
-
//# sourceMappingURL=ms-geojson.service.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ms-geojson.service.js","sourceRoot":"","sources":["../../src/ms-geojson/ms-geojson.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,yDAAkF;AAClF,qDAA+C;AAC/C,mCAAmC;AAG5B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAM3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