fiscalia_bo-nest-helpers 0.0.34 → 0.0.36

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.
@@ -95,7 +95,11 @@ exports.FilterHttpServiceResponse = (0, rxjs_1.catchError)((error) => {
95
95
  status: 500,
96
96
  };
97
97
  if (error.isAxiosError) {
98
- if (error.code === 'ENOTFOUND') {
98
+ if (error.code === 'ECONNREFUSED') {
99
+ const err = error;
100
+ resp.message = `Error: no se pudo connecter al HOST [http(s)://${err.address}${err.request._options.path}]`;
101
+ }
102
+ else if (error.code === 'ENOTFOUND') {
99
103
  resp.message = `Error: no se pudo connecter al servicio ${error.config.baseURL}${error.config.url}`;
100
104
  }
101
105
  else if (error.response) {
@@ -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,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,e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QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM;iBAC9B,CAAC;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"}
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;IACpB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,kCAAkC;IACvC,GAAG,EAAE,6BAA6B;IAClC,GAAG,EAAE,WAAW;IAChB,GAA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AE,IAAI;oBACd,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM;iBAC9B,CAAC;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
@@ -15,3 +15,4 @@ export * from './ms-seguridad/token-auth.guard';
15
15
  export * from './types';
16
16
  export * from './helpers/request.helper';
17
17
  export * as MsPersonas from './ms-personas';
18
+ export * as MsPdf from './ms-pdf';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.MsPersonas = exports.PermissionsGuard = exports.MsSeguridadHttpError = void 0;
17
+ exports.MsPdf = exports.MsPersonas = exports.PermissionsGuard = exports.MsSeguridadHttpError = void 0;
18
18
  __exportStar(require("./services/ms-files.service"), exports);
19
19
  __exportStar(require("./ms-redis/ms-redis.module"), exports);
20
20
  __exportStar(require("./ms-redis/ms-redis.service"), exports);
@@ -34,4 +34,5 @@ __exportStar(require("./ms-seguridad/token-auth.guard"), exports);
34
34
  __exportStar(require("./types"), exports);
35
35
  __exportStar(require("./helpers/request.helper"), exports);
36
36
  exports.MsPersonas = require("./ms-personas");
37
+ exports.MsPdf = require("./ms-pdf");
37
38
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { Coordinates, ValidateCoordinatesPolygonDTO } from './dto/ms-geojson.dto';
2
2
  export declare class MsGeoJsonService {
3
3
  validateJson(input: any): ValidateCoordinatesPolygonDTO;
4
- validateArrayCoordinatesGeoJson(coordinatesPolygon: any, { coordinates }: Coordinates, reverseCoordinates: Boolean): Promise<any>;
4
+ validateArrayCoordinatesGeoJson(coordinatesPolygon: any, { coordinates }: Coordinates, reverseCoordinates: boolean): Promise<any>;
5
5
  }
@@ -17,7 +17,9 @@ let MsGeoJsonService = class MsGeoJsonService {
17
17
  const dto = new ms_geojson_dto_1.ValidateCoordinatesPolygonDTO();
18
18
  if (input && ((_a = input.geometry) === null || _a === void 0 ? void 0 : _a.coordinates) && Array.isArray(input.geometry.coordinates[0])) {
19
19
  const arrayCoordinates = input.geometry.coordinates[0];
20
- dto.polygonCoordinates = arrayCoordinates === null || arrayCoordinates === void 0 ? void 0 : arrayCoordinates.map((coords) => ({ coordinates: coords }));
20
+ dto.polygonCoordinates = arrayCoordinates === null || arrayCoordinates === void 0 ? void 0 : arrayCoordinates.map((coords) => ({
21
+ coordinates: coords,
22
+ }));
21
23
  }
22
24
  const errors = (0, class_validator_1.validateSync)(dto);
23
25
  if (errors.length > 0) {
@@ -25,13 +27,12 @@ let MsGeoJsonService = class MsGeoJsonService {
25
27
  }
26
28
  return dto;
27
29
  }
28
- ;
29
30
  async validateArrayCoordinatesGeoJson(coordinatesPolygon, { coordinates }, reverseCoordinates) {
30
31
  try {
31
32
  this.validateJson(coordinatesPolygon);
32
33
  let dataCoordinates = coordinatesPolygon.geometry.coordinates[0];
33
34
  if (reverseCoordinates) {
34
- dataCoordinates = dataCoordinates.map(e => [e[1], e[0]]);
35
+ dataCoordinates = dataCoordinates.map((e) => [e[1], e[0]]);
35
36
  }
36
37
  const pointCoordinates = coordinates;
37
38
  const pointGeoJSON = turf.point(pointCoordinates);
@@ -1 +1 @@
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;IAMzB,YAAY,CAAC,KAAU;;QACnB,MAAM,GA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AC;IAUD,KAAK,CAAC,+BAA+B,CACnC,kBAAuB,EACvB,EAAE,WAAW,EAAe,EAC5B,kBAA2B;QAE3B,IAAI;YACF,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;YACtC,IAAI,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACjE,IAAI,kBAAkB,EAAE;gBACtB,eAAe,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5D;YACD,MAAM,gBAAgB,GAAG,WAAW,CAAC;YACrC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAClD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;YACvD,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;YAC/E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;SACnC;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAC,OAAO,CAAC;SACrB;IACH,CAAC;CACF,CAAA;AAjDY,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;GACA,gBAAgB,CAiD5B;AAjDY,4CAAgB"}
@@ -0,0 +1,3 @@
1
+ export { MsPdfService } from './ms-pdf.service';
2
+ export { MsPdfModule } from './ms-pdf.module';
3
+ export * as Types from './types';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Types = exports.MsPdfModule = exports.MsPdfService = void 0;
4
+ var ms_pdf_service_1 = require("./ms-pdf.service");
5
+ Object.defineProperty(exports, "MsPdfService", { enumerable: true, get: function () { return ms_pdf_service_1.MsPdfService; } });
6
+ var ms_pdf_module_1 = require("./ms-pdf.module");
7
+ Object.defineProperty(exports, "MsPdfModule", { enumerable: true, get: function () { return ms_pdf_module_1.MsPdfModule; } });
8
+ exports.Types = require("./types");
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ms-pdf/index.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,mCAAiC"}
@@ -0,0 +1,12 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ type MsPersonasModuleOptions = {
3
+ global?: boolean;
4
+ urlMsPdf?: string | undefined;
5
+ maxBodyLength?: number;
6
+ maxContentLength?: number;
7
+ };
8
+ export declare class MsPdfModule {
9
+ static register(options?: MsPersonasModuleOptions): DynamicModule;
10
+ static registerAsync(options: MsPersonasModuleOptions): Promise<DynamicModule>;
11
+ }
12
+ export {};
@@ -0,0 +1,61 @@
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 MsPdfModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.MsPdfModule = void 0;
11
+ const axios_1 = require("@nestjs/axios");
12
+ const common_1 = require("@nestjs/common");
13
+ const ms_pdf_service_1 = require("./ms-pdf.service");
14
+ const chalk_1 = require("chalk");
15
+ let MsPdfModule = MsPdfModule_1 = class MsPdfModule {
16
+ static register(options) {
17
+ const url = (options === null || options === void 0 ? void 0 : options.urlMsPdf) || process.env.ENV_SERVICE_MS_PDF;
18
+ if (!url)
19
+ console.warn(chalk_1.bold.red(`ENV_SERVICE_MS_PDF no definido en variables de entorno`));
20
+ return {
21
+ global: options.global,
22
+ module: MsPdfModule_1,
23
+ imports: [
24
+ axios_1.HttpModule.register({
25
+ baseURL: url,
26
+ timeout: 5000,
27
+ maxRedirects: 5,
28
+ maxBodyLength: options.maxBodyLength,
29
+ maxContentLength: options.maxContentLength,
30
+ }),
31
+ ],
32
+ providers: [ms_pdf_service_1.MsPdfService],
33
+ exports: [ms_pdf_service_1.MsPdfService],
34
+ };
35
+ }
36
+ static async registerAsync(options) {
37
+ const url = (options === null || options === void 0 ? void 0 : options.urlMsPdf) || process.env.ENV_SERVICE_MS_PDF;
38
+ if (!url)
39
+ console.warn(chalk_1.bold.red(`ENV_SERVICE_MS_PDF no definido en variables de entorno`));
40
+ return {
41
+ global: options.global,
42
+ module: MsPdfModule_1,
43
+ imports: [
44
+ axios_1.HttpModule.register({
45
+ baseURL: url,
46
+ timeout: 5000,
47
+ maxRedirects: 5,
48
+ maxBodyLength: options.maxBodyLength,
49
+ maxContentLength: options.maxContentLength,
50
+ }),
51
+ ],
52
+ providers: [ms_pdf_service_1.MsPdfService],
53
+ exports: [ms_pdf_service_1.MsPdfService],
54
+ };
55
+ }
56
+ };
57
+ MsPdfModule = MsPdfModule_1 = __decorate([
58
+ (0, common_1.Module)({})
59
+ ], MsPdfModule);
60
+ exports.MsPdfModule = MsPdfModule;
61
+ //# sourceMappingURL=ms-pdf.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ms-pdf.module.js","sourceRoot":"","sources":["../../src/ms-pdf/ms-pdf.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAuD;AACvD,qDAAgD;AAChD,iCAA6B;AAUtB,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAItB,MAAM,CAAC,QAAQ,CAAC,OAAiC;QAC/C,MAAM,GAAG,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,CAAC;SACxB,CAAC;IACJ,CAAC;CACF,CAAA;AA/CY,WAAW;IADvB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,WAAW,CA+CvB;AA/CY,kCAAW"}
@@ -0,0 +1,11 @@
1
+ import 'dotenv/config';
2
+ import { HttpService } from '@nestjs/axios';
3
+ import { ResponseDTO } from 'src/types';
4
+ import { MsPdfCkeditorDataType, MsPdfResponseType, MsPdfCkMustacheDataType } from './types';
5
+ export declare class MsPdfService {
6
+ private readonly httpService;
7
+ private requestHttpService;
8
+ constructor(httpService: HttpService);
9
+ generarPdfCkeditorV1(data: MsPdfCkeditorDataType): Promise<ResponseDTO<MsPdfResponseType>>;
10
+ generarPdfCkMustacheV1<T>(data: MsPdfCkMustacheDataType<T | any>): Promise<ResponseDTO<MsPdfResponseType>>;
11
+ }
@@ -0,0 +1,42 @@
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.MsPdfService = void 0;
13
+ require("dotenv/config");
14
+ const common_1 = require("@nestjs/common");
15
+ const axios_1 = require("@nestjs/axios");
16
+ const request_helper_1 = require("../helpers/request.helper");
17
+ let MsPdfService = class MsPdfService {
18
+ constructor(httpService) {
19
+ this.httpService = httpService;
20
+ this.requestHttpService = (0, request_helper_1.newHttpServiceRequest)(httpService);
21
+ }
22
+ generarPdfCkeditorV1(data) {
23
+ return this.requestHttpService({
24
+ url: '/v1/html-pdf/ckeditor',
25
+ method: 'post',
26
+ data,
27
+ });
28
+ }
29
+ generarPdfCkMustacheV1(data) {
30
+ return this.requestHttpService({
31
+ url: '/v1/html-pdf/ckmustache',
32
+ method: 'post',
33
+ data,
34
+ });
35
+ }
36
+ };
37
+ MsPdfService = __decorate([
38
+ (0, common_1.Injectable)(),
39
+ __metadata("design:paramtypes", [axios_1.HttpService])
40
+ ], MsPdfService);
41
+ exports.MsPdfService = MsPdfService;
42
+ //# sourceMappingURL=ms-pdf.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ms-pdf.service.js","sourceRoot":"","sources":["../../src/ms-pdf/ms-pdf.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAAuB;AACvB,2CAA4C;AAC5C,yCAA4C;AAI5C,8DAAmE;AAG5D,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEvB,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;QACnD,IAAI,CAAC,kBAAkB,GAAG,IAAA,sCAAqB,EAAC,WAAW,CAAC,CAAC;IAC/D,CAAC;IAOD,oBAAoB,CAAC,IAA2B;QAC9C,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,GAAG,EAAE,uBAAuB;YAC5B,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAOD,sBAAsB,CACpB,IAAsC;QAEtC,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,GAAG,EAAE,yBAAyB;YAC9B,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAjCY,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAG+B,mBAAW;GAF1C,YAAY,CAiCxB;AAjCY,oCAAY"}
@@ -0,0 +1,51 @@
1
+ export type MsPdfDataHeader = {
2
+ title1?: string;
3
+ title2?: string;
4
+ urlLogo?: string;
5
+ urlQr?: string;
6
+ valueQrCode?: string;
7
+ hide?: boolean;
8
+ };
9
+ export type MsPdfDataFooter = {
10
+ tipoDocumento?: string;
11
+ aprobacionUrl?: string;
12
+ fechaHora?: string;
13
+ aprobadoFirmadoTexto?: string;
14
+ hide?: boolean;
15
+ };
16
+ type DataToRender = {
17
+ headerData?: MsPdfDataHeader;
18
+ footerData?: MsPdfDataFooter;
19
+ content: string;
20
+ };
21
+ export type MsPdfPageConfig = {
22
+ format?: string;
23
+ orientation?: string;
24
+ width?: string;
25
+ height?: string;
26
+ isHorizontal?: boolean;
27
+ };
28
+ export type MsPdfBorderConfig = {
29
+ top: string;
30
+ right: string;
31
+ bottom: string;
32
+ left: string;
33
+ };
34
+ export type MsPdfCkeditorDataType = {
35
+ pageConfig?: MsPdfPageConfig;
36
+ border?: MsPdfBorderConfig;
37
+ data: DataToRender;
38
+ };
39
+ export type MsPdfCkMustacheDataType<T> = {
40
+ pageConfig?: MsPdfPageConfig;
41
+ border?: MsPdfBorderConfig;
42
+ data: DataToRender & {
43
+ jsonData: {
44
+ [key: string]: any;
45
+ } | T;
46
+ };
47
+ };
48
+ export type MsPdfResponseType = {
49
+ base64: string;
50
+ };
51
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ms-pdf/types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"token-auth.guard.js","sourceRoot":"","sources":["../../src/ms-seguridad/token-auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,iEAA4D;AAC5D,gFAA2E;AAGpE,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,gBAAoC;QAApC,qBAAgB,GAAhB,gBAAgB,CAAoB;IAAG,CAAC;IAErE,KAAK,C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AW,CAAC,OAAyB;QACzC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;QAEjD,IAAI,CAAC,UAAU,EAAE;YAEf,MAAM,IAAI,8CAAoB,CAAC,oDAAoD,EAAE,GAAG,CAAC,CAAC;SAC3F;QAED,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,GAAG,MAAM,EAAE,CAAC,WAAW,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE;YAEpD,MAAM,IAAI,8CAAoB,CAC5B,yDAAyD,EACzD,GAAG,CACJ,CAAC;SACH;QAGD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAErF,IAAI,KAAK,EAAE;YACT,MAAM,IAAI,8CAAoB,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,uBAAuB,EAAE,GAAG,CAAC,CAAC;SACzE;QAED,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAhCY,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEoC,yCAAkB;GADtD,cAAc,CAgC1B;AAhCY,wCAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiscalia_bo-nest-helpers",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "author": "UTIC",
5
5
  "contact": {
6
6
  "name": "Unidad de Tecnologías de la Información y Comunicación - Ministerio Público",
@@ -11,6 +11,7 @@
11
11
  "dist/ms-seguridad/*",
12
12
  "dist/ms-redis/*",
13
13
  "dist/ms-personas/*",
14
+ "dist/ms-pdf/*",
14
15
  "dist/http-service/*",
15
16
  "dist/services/*",
16
17
  "dist/ms-geojson/*",