fiscalia_bo-nest-helpers 0.0.19 → 0.0.21
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.d.ts +4 -0
- package/dist/http-service/http-service.pipes.js +121 -0
- package/dist/http-service/http-service.pipes.js.map +1 -0
- package/dist/http-service/index.d.ts +1 -0
- package/dist/http-service/index.js +18 -0
- package/dist/http-service/index.js.map +1 -0
- package/dist/ms-personas/index.d.ts +3 -0
- package/dist/ms-personas/index.js +9 -0
- package/dist/ms-personas/index.js.map +1 -0
- package/dist/ms-personas/ms-personas.module.d.ts +10 -0
- package/dist/ms-personas/ms-personas.module.js +57 -0
- package/dist/ms-personas/ms-personas.module.js.map +1 -0
- package/dist/ms-personas/ms-personas.service.d.ts +17 -0
- package/dist/ms-personas/ms-personas.service.js +75 -0
- package/dist/ms-personas/ms-personas.service.js.map +1 -0
- package/dist/ms-personas/types.d.ts +180 -0
- package/dist/ms-personas/types.js +3 -0
- package/dist/ms-personas/types.js.map +1 -0
- package/package.json +5 -4
@@ -0,0 +1,4 @@
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
2
|
+
import { ResponseDTO } from 'src/types';
|
3
|
+
export declare const TransformHttpServiceResponse: import("rxjs").OperatorFunction<AxiosResponse<any, any>, ResponseDTO<any>>;
|
4
|
+
export declare const FilterHttpServiceResponse: import("rxjs").OperatorFunction<unknown, any>;
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FilterHttpServiceResponse = exports.TransformHttpServiceResponse = void 0;
|
4
|
+
const rxjs_1 = require("rxjs");
|
5
|
+
const axiosResponseStatusMessages = {
|
6
|
+
100: 'Continuar',
|
7
|
+
101: 'Cambiando Protocolos',
|
8
|
+
102: 'Procesando',
|
9
|
+
103: 'Indicios Tempranos',
|
10
|
+
200: 'Correcto',
|
11
|
+
201: 'Creado',
|
12
|
+
202: 'Aceptado',
|
13
|
+
203: 'Información no Autoritativa',
|
14
|
+
204: 'Sin Contenido',
|
15
|
+
205: 'Contenido Reiniciado',
|
16
|
+
206: 'Contenido Parcial',
|
17
|
+
207: 'Estado',
|
18
|
+
208: 'Ya Informado',
|
19
|
+
226: 'Usado IM',
|
20
|
+
300: 'Elecciones Múltiples',
|
21
|
+
301: 'Movido Permanentemente',
|
22
|
+
302: 'Encontrado',
|
23
|
+
303: 'Ver Otro',
|
24
|
+
304: 'No Modificado',
|
25
|
+
305: 'Usar Proxy',
|
26
|
+
306: 'Cambiar Proxy',
|
27
|
+
307: 'Redirección Temporal',
|
28
|
+
308: 'Redirección Permanente',
|
29
|
+
400: 'Solicitud Incorrecta',
|
30
|
+
401: 'No Autorizado',
|
31
|
+
402: 'Pago Requerido',
|
32
|
+
403: 'Prohibido',
|
33
|
+
404: 'No Encontrado',
|
34
|
+
405: 'Método no Permitido',
|
35
|
+
406: 'No Aceptable',
|
36
|
+
407: 'Autenticación de Proxy Requerida',
|
37
|
+
408: 'Tiempo de Solicitud Agotado',
|
38
|
+
409: 'Conflicto',
|
39
|
+
410: 'Desaparecido',
|
40
|
+
411: 'Longitud Requerida',
|
41
|
+
412: 'Precondición Fallida',
|
42
|
+
413: 'Carga Útil Demasiado Grande',
|
43
|
+
414: 'URI Demasiado Largo',
|
44
|
+
415: 'Tipo de Medio No Soportado',
|
45
|
+
416: 'Rango no Satisfactorio',
|
46
|
+
417: 'Expectativa Fallida',
|
47
|
+
418: 'Soy una tetera',
|
48
|
+
421: 'Solicitud Mal Dirigida',
|
49
|
+
422: 'Entidad No Procesable',
|
50
|
+
423: 'Bloqueado',
|
51
|
+
424: 'Dependencia Fallida',
|
52
|
+
425: 'Demasiado Temprano',
|
53
|
+
426: 'Actualización Requerida',
|
54
|
+
428: 'Precondición Requerida',
|
55
|
+
429: 'Demasiadas Solicitudes',
|
56
|
+
431: 'Campos de Encabezado de Solicitud Demasiado Grandes',
|
57
|
+
451: 'No Disponible por Razones Legales',
|
58
|
+
500: 'Error Interno del Servidor',
|
59
|
+
501: 'No Implementado',
|
60
|
+
502: 'Gateway Incorrecto',
|
61
|
+
503: 'Servicio No Disponible',
|
62
|
+
504: 'Tiempo de Espera del Gateway Agotado',
|
63
|
+
505: 'Versión HTTP No Soportada',
|
64
|
+
506: 'Variante También Negocia',
|
65
|
+
507: 'Almacenamiento Insuficiente',
|
66
|
+
508: 'Detección de Bucle',
|
67
|
+
509: 'Límite de Ancho de Banda Excedido',
|
68
|
+
510: 'No Extendido',
|
69
|
+
511: 'Autenticación de Red Requerida',
|
70
|
+
};
|
71
|
+
exports.TransformHttpServiceResponse = (0, rxjs_1.map)((resp) => {
|
72
|
+
let response = {
|
73
|
+
error: true,
|
74
|
+
message: 'Error en el micro servicio ms-files',
|
75
|
+
response: {},
|
76
|
+
status: 500,
|
77
|
+
};
|
78
|
+
response = resp.data;
|
79
|
+
if (typeof response.error === 'boolean' && typeof response.status === 'number')
|
80
|
+
return response;
|
81
|
+
else {
|
82
|
+
response = {
|
83
|
+
response: resp.data,
|
84
|
+
error: resp.status >= 400,
|
85
|
+
message: resp.statusText,
|
86
|
+
status: resp.status,
|
87
|
+
};
|
88
|
+
}
|
89
|
+
});
|
90
|
+
exports.FilterHttpServiceResponse = (0, rxjs_1.catchError)((error) => {
|
91
|
+
let resp = {
|
92
|
+
error: true,
|
93
|
+
message: 'Sucedió un error',
|
94
|
+
response: null,
|
95
|
+
status: 500,
|
96
|
+
};
|
97
|
+
if (error.isAxiosError) {
|
98
|
+
if (error.code === 'ENOTFOUND') {
|
99
|
+
resp.message = `Error: no se pudo connecter al servicio ${error.config.baseURL}${error.config.url}`;
|
100
|
+
}
|
101
|
+
else if (error.response) {
|
102
|
+
const respData = error.response.data;
|
103
|
+
if (typeof respData.status === 'number' && typeof respData.error === 'boolean') {
|
104
|
+
resp = respData;
|
105
|
+
}
|
106
|
+
else {
|
107
|
+
console.log('response fields: ', Object.keys(error.response));
|
108
|
+
resp = {
|
109
|
+
error: true,
|
110
|
+
message: axiosResponseStatusMessages[error.response.status],
|
111
|
+
response: null,
|
112
|
+
status: error.response.status,
|
113
|
+
};
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
if (resp.message === 'Sucedió un error')
|
118
|
+
console.error(error);
|
119
|
+
return (0, rxjs_1.of)(resp);
|
120
|
+
});
|
121
|
+
//# sourceMappingURL=http-service.pipes.js.map
|
@@ -0,0 +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,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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AAI,CAAC,OAAO,KAAK,kBAAkB;QAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9D,OAAO,IAAA,SAAE,EAAC,IAAI,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './http-service.pipes';
|
@@ -0,0 +1,18 @@
|
|
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("./http-service.pipes"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http-service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Types = exports.MsPersonasModule = exports.MsPersonasService = void 0;
|
4
|
+
var ms_personas_service_1 = require("./ms-personas.service");
|
5
|
+
Object.defineProperty(exports, "MsPersonasService", { enumerable: true, get: function () { return ms_personas_service_1.MsPersonasService; } });
|
6
|
+
var ms_personas_module_1 = require("./ms-personas.module");
|
7
|
+
Object.defineProperty(exports, "MsPersonasModule", { enumerable: true, get: function () { return ms_personas_module_1.MsPersonasModule; } });
|
8
|
+
exports.Types = require("./types");
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ms-personas/index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,mCAAiC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
2
|
+
type MsPersonasModuleOptions = {
|
3
|
+
global?: boolean;
|
4
|
+
urlMsPersonas?: string | undefined;
|
5
|
+
};
|
6
|
+
export declare class MsPersonasModule {
|
7
|
+
static register(options?: MsPersonasModuleOptions): DynamicModule;
|
8
|
+
static registerAsync(options: MsPersonasModuleOptions): Promise<DynamicModule>;
|
9
|
+
}
|
10
|
+
export {};
|
@@ -0,0 +1,57 @@
|
|
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 MsPersonasModule_1;
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
+
exports.MsPersonasModule = void 0;
|
11
|
+
const axios_1 = require("@nestjs/axios");
|
12
|
+
const common_1 = require("@nestjs/common");
|
13
|
+
const ms_personas_service_1 = require("./ms-personas.service");
|
14
|
+
const chalk_1 = require("chalk");
|
15
|
+
let MsPersonasModule = MsPersonasModule_1 = class MsPersonasModule {
|
16
|
+
static register(options) {
|
17
|
+
const url = (options === null || options === void 0 ? void 0 : options.urlMsPersonas) || process.env.ENV_SERVICE_MS_PERSONAS;
|
18
|
+
if (!url)
|
19
|
+
console.warn(chalk_1.bold.red(`ENV_SERVICE_MS_PERSONAS no definido en variables de entorno`));
|
20
|
+
return {
|
21
|
+
global: options.global,
|
22
|
+
module: MsPersonasModule_1,
|
23
|
+
imports: [
|
24
|
+
axios_1.HttpModule.register({
|
25
|
+
baseURL: url,
|
26
|
+
timeout: 5000,
|
27
|
+
maxRedirects: 5,
|
28
|
+
}),
|
29
|
+
],
|
30
|
+
providers: [ms_personas_service_1.MsPersonasService],
|
31
|
+
exports: [ms_personas_service_1.MsPersonasService],
|
32
|
+
};
|
33
|
+
}
|
34
|
+
static async registerAsync(options) {
|
35
|
+
const url = (options === null || options === void 0 ? void 0 : options.urlMsPersonas) || process.env.ENV_SERVICE_MS_PERSONAS;
|
36
|
+
if (!url)
|
37
|
+
console.warn(chalk_1.bold.red(`ENV_SERVICE_MS_PERSONAS no definido en variables de entorno`));
|
38
|
+
return {
|
39
|
+
global: options.global,
|
40
|
+
module: MsPersonasModule_1,
|
41
|
+
imports: [
|
42
|
+
axios_1.HttpModule.register({
|
43
|
+
baseURL: url,
|
44
|
+
timeout: 5000,
|
45
|
+
maxRedirects: 5,
|
46
|
+
}),
|
47
|
+
],
|
48
|
+
providers: [ms_personas_service_1.MsPersonasService],
|
49
|
+
exports: [ms_personas_service_1.MsPersonasService],
|
50
|
+
};
|
51
|
+
}
|
52
|
+
};
|
53
|
+
MsPersonasModule = MsPersonasModule_1 = __decorate([
|
54
|
+
(0, common_1.Module)({})
|
55
|
+
], MsPersonasModule);
|
56
|
+
exports.MsPersonasModule = MsPersonasModule;
|
57
|
+
//# sourceMappingURL=ms-personas.module.js.map
|
@@ -0,0 +1 @@
|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IAAI;oBACb,YAAY,EAAE,CAAC;iBAChB,CAAC;aACH;YACD,SAAS,EAAE,CAAC,uCAAiB,CAAC;YAC9B,OAAO,EAAE,CAAC,uCAAiB,CAAC;SAC7B,CAAC;IACJ,CAAC;CACF,CAAA;AA3CY,gBAAgB;IAD5B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CA2C5B;AA3CY,4CAAgB"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { RawAxiosRequestHeaders } from 'axios';
|
2
|
+
import 'dotenv/config';
|
3
|
+
import { HttpService } from '@nestjs/axios';
|
4
|
+
import { ResponseDTO } from 'src/types';
|
5
|
+
import { AbogadoItem, GetByIdResponse, PersonasBuscarRequest, PersonasBuscarResponse, PersonasListarRequest, PersonasListarResponse } from './types';
|
6
|
+
export declare class MsPersonasService {
|
7
|
+
private readonly httpService;
|
8
|
+
private requestHttpService;
|
9
|
+
constructor(httpService: HttpService);
|
10
|
+
personasBuscar(data: PersonasBuscarRequest, headers?: Partial<RawAxiosRequestHeaders>): Promise<ResponseDTO<PersonasBuscarResponse>>;
|
11
|
+
personasListar(data: PersonasListarRequest, headers?: Partial<RawAxiosRequestHeaders>): Promise<ResponseDTO<PersonasListarResponse>>;
|
12
|
+
personasGetByIdDb(personaId: number, headers?: Partial<RawAxiosRequestHeaders>): Promise<ResponseDTO<GetByIdResponse>>;
|
13
|
+
abogadosListar(headers?: Partial<RawAxiosRequestHeaders>): Promise<ResponseDTO<AbogadoItem[]>>;
|
14
|
+
abogadosInsert(personaId: number, headers?: Partial<RawAxiosRequestHeaders>): Promise<ResponseDTO<any>>;
|
15
|
+
abogadosUpdate(personaId: number, headers?: Partial<RawAxiosRequestHeaders>): Promise<ResponseDTO<any>>;
|
16
|
+
abogadosDelete(personaId: number, headers?: Partial<RawAxiosRequestHeaders>): Promise<ResponseDTO<any>>;
|
17
|
+
}
|
@@ -0,0 +1,75 @@
|
|
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.MsPersonasService = 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 MsPersonasService = class MsPersonasService {
|
18
|
+
constructor(httpService) {
|
19
|
+
this.httpService = httpService;
|
20
|
+
this.requestHttpService = (0, request_helper_1.newHttpServiceRequest)(httpService);
|
21
|
+
}
|
22
|
+
async personasBuscar(data, headers = {}) {
|
23
|
+
return this.requestHttpService({
|
24
|
+
url: '/api/personas/buscar',
|
25
|
+
data: data,
|
26
|
+
method: 'POST',
|
27
|
+
}, headers);
|
28
|
+
}
|
29
|
+
async personasListar(data, headers = {}) {
|
30
|
+
return this.requestHttpService({
|
31
|
+
url: '/api/personas/lista',
|
32
|
+
data: data,
|
33
|
+
method: 'POST',
|
34
|
+
}, headers);
|
35
|
+
}
|
36
|
+
async personasGetByIdDb(personaId, headers = {}) {
|
37
|
+
return this.requestHttpService({
|
38
|
+
url: `/api/personas/getpersona/${personaId}`,
|
39
|
+
method: 'GET',
|
40
|
+
}, headers);
|
41
|
+
}
|
42
|
+
async abogadosListar(headers = {}) {
|
43
|
+
return this.requestHttpService({
|
44
|
+
url: `/api/abogados/list`,
|
45
|
+
method: 'GET',
|
46
|
+
}, headers);
|
47
|
+
}
|
48
|
+
async abogadosInsert(personaId, headers = {}) {
|
49
|
+
return this.requestHttpService({
|
50
|
+
url: `/api/abogados/insert`,
|
51
|
+
method: 'GET',
|
52
|
+
data: {
|
53
|
+
personaId,
|
54
|
+
},
|
55
|
+
}, headers);
|
56
|
+
}
|
57
|
+
async abogadosUpdate(personaId, headers = {}) {
|
58
|
+
return this.requestHttpService({
|
59
|
+
url: `/api/abogados/update/${personaId}`,
|
60
|
+
method: 'GET',
|
61
|
+
}, headers);
|
62
|
+
}
|
63
|
+
async abogadosDelete(personaId, headers = {}) {
|
64
|
+
return this.requestHttpService({
|
65
|
+
url: `/api/abogados/delete/${personaId}`,
|
66
|
+
method: 'GET',
|
67
|
+
}, headers);
|
68
|
+
}
|
69
|
+
};
|
70
|
+
MsPersonasService = __decorate([
|
71
|
+
(0, common_1.Injectable)(),
|
72
|
+
__metadata("design:paramtypes", [axios_1.HttpService])
|
73
|
+
], MsPersonasService);
|
74
|
+
exports.MsPersonasService = MsPersonasService;
|
75
|
+
//# sourceMappingURL=ms-personas.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ms-personas.service.js","sourceRoot":"","sources":["../../src/ms-personas/ms-personas.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yBAAuB;AACvB,2CAA4C;AAC5C,yCAA4C;AAW5C,8DAAmE;AAG5D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAE5B,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;QACnD,IAAI,CAAC,kBAAkB,GAAG,IAAA,sCAAqB,EAAC,WAAW,CAAC,CAAC;IAC/D,CAAC;IAQD,KAAK,CAAC,cAAc,CAClB,IAA2B,EAC3B,UAA2C,EAAE;QAG7C,OAAO,IAAI,CAAC,kBAAkB,CAC5B;YACE,GAAG,EAA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E;YACxC,MAAM,EAAE,KAAK;SACd,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CAEF,CAAA;AA5JY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAG+B,mBAAW;GAF1C,iBAAiB,CA4J7B;AA5JY,8CAAiB"}
|
@@ -0,0 +1,180 @@
|
|
1
|
+
interface Pais {
|
2
|
+
id: number;
|
3
|
+
nombre: string;
|
4
|
+
codigoTelefonico: string;
|
5
|
+
}
|
6
|
+
interface Departamento {
|
7
|
+
id: number;
|
8
|
+
nombre: string;
|
9
|
+
alpha2: string;
|
10
|
+
alpha3: string;
|
11
|
+
codigoTelefonico: string;
|
12
|
+
codigoDepartamento: string;
|
13
|
+
idDistritoOj: number;
|
14
|
+
}
|
15
|
+
interface Provincia {
|
16
|
+
id: number;
|
17
|
+
nombre: string;
|
18
|
+
}
|
19
|
+
interface Municipio {
|
20
|
+
id: number;
|
21
|
+
nombre: {
|
22
|
+
nombre: string;
|
23
|
+
};
|
24
|
+
}
|
25
|
+
interface Nacimiento {
|
26
|
+
pais: Pais;
|
27
|
+
departamento: Departamento[];
|
28
|
+
provincia: Provincia;
|
29
|
+
municipio: Municipio;
|
30
|
+
}
|
31
|
+
interface Aplicacion {
|
32
|
+
sistema: string;
|
33
|
+
fechaImpresion: string;
|
34
|
+
institucion: string;
|
35
|
+
nombreUsuario: string;
|
36
|
+
nombreUsuarioFinal: string;
|
37
|
+
qr: string;
|
38
|
+
}
|
39
|
+
export interface PersonasBuscarRequest {
|
40
|
+
numeroDocumento: string;
|
41
|
+
nombres?: string;
|
42
|
+
primerApellido?: string;
|
43
|
+
segundoApellido?: string;
|
44
|
+
fechaNacimiento?: string;
|
45
|
+
actualizar: 0 | 1;
|
46
|
+
}
|
47
|
+
export interface PersonasBuscarResponse {
|
48
|
+
nacimiento: Nacimiento;
|
49
|
+
aplicacion: Aplicacion;
|
50
|
+
_id: string;
|
51
|
+
numeroDocumento: string;
|
52
|
+
nombres: string;
|
53
|
+
primerApellido: string;
|
54
|
+
segundoApellido: string;
|
55
|
+
fechaNacimiento: string;
|
56
|
+
nombreCompleto: string;
|
57
|
+
procedencia: string;
|
58
|
+
tipoRegistro: string;
|
59
|
+
domicilio: string;
|
60
|
+
profesion: string;
|
61
|
+
estadoCivil: string;
|
62
|
+
sexo: string;
|
63
|
+
fotoRuta: string;
|
64
|
+
certificadoRuta: string;
|
65
|
+
idDb: number;
|
66
|
+
carnetFileId: null;
|
67
|
+
celular: null;
|
68
|
+
email: null;
|
69
|
+
createdAt: string;
|
70
|
+
updatedAt: string;
|
71
|
+
}
|
72
|
+
export interface PersonasListarRequest {
|
73
|
+
id?: number;
|
74
|
+
sort?: [
|
75
|
+
{
|
76
|
+
field: string;
|
77
|
+
type: 'ASC' | 'DESC';
|
78
|
+
}
|
79
|
+
];
|
80
|
+
page?: number;
|
81
|
+
perPage?: number;
|
82
|
+
columnFilters?: {
|
83
|
+
nombre?: string;
|
84
|
+
numeroDocumento?: string;
|
85
|
+
primerApellido?: string;
|
86
|
+
segundoApellido?: string;
|
87
|
+
fechaNacimiento?: string;
|
88
|
+
sexo?: string;
|
89
|
+
nacionalidadId?: number;
|
90
|
+
celular?: string;
|
91
|
+
domicilio?: string;
|
92
|
+
esAbogado?: number;
|
93
|
+
esProfesor?: number;
|
94
|
+
esCiudadanoDigital?: number;
|
95
|
+
conSegip?: number;
|
96
|
+
};
|
97
|
+
}
|
98
|
+
interface PersonaItem {
|
99
|
+
idDb: number;
|
100
|
+
estado: number;
|
101
|
+
nombre: string;
|
102
|
+
primerApellido: string;
|
103
|
+
segundoApellido: string;
|
104
|
+
numeroDocumento: string;
|
105
|
+
celular: null | number;
|
106
|
+
domicilio: string;
|
107
|
+
fechaNacimiento: string;
|
108
|
+
nombreCompleto: string;
|
109
|
+
sexo: string;
|
110
|
+
nacionalidadId: number;
|
111
|
+
municipioResidenciaId: number;
|
112
|
+
ciudadResidenciaId: number;
|
113
|
+
esAbogado: number;
|
114
|
+
esProfesor: number;
|
115
|
+
esCiudadanoDigital: number;
|
116
|
+
latitud: null | number;
|
117
|
+
longitud: null | number;
|
118
|
+
conSegip: number;
|
119
|
+
email: null | string;
|
120
|
+
profesion: string;
|
121
|
+
estadoCivil: string;
|
122
|
+
fotoRuta: string;
|
123
|
+
certificadoRuta: string;
|
124
|
+
url: string;
|
125
|
+
nacionalidadNombre: string;
|
126
|
+
}
|
127
|
+
export interface PersonasListarResponse {
|
128
|
+
records: PersonaItem[];
|
129
|
+
total: number;
|
130
|
+
}
|
131
|
+
export interface GetByIdResponse {
|
132
|
+
personaId: number;
|
133
|
+
estado: number;
|
134
|
+
nombre: string;
|
135
|
+
primerApellido: string;
|
136
|
+
segundoApellido: string;
|
137
|
+
numeroDocumento: string;
|
138
|
+
celular: null | string;
|
139
|
+
domicilio: string;
|
140
|
+
fechaNacimiento: string;
|
141
|
+
nombreCompleto: string;
|
142
|
+
sexo: 'M' | 'F';
|
143
|
+
nacionalidadId: number;
|
144
|
+
municipioResidenciaId: number;
|
145
|
+
ciudadResidenciaId: number;
|
146
|
+
esAbogado: number;
|
147
|
+
esProfesor: number;
|
148
|
+
esCiudadanoDigital: number;
|
149
|
+
latitud: null | number;
|
150
|
+
longitud: null | number;
|
151
|
+
conSegip: number;
|
152
|
+
email: null | string;
|
153
|
+
profesion: string;
|
154
|
+
estadoCivil: string;
|
155
|
+
fotoRuta: string;
|
156
|
+
certificadoRuta: string;
|
157
|
+
url: string;
|
158
|
+
medioNotificacion: number;
|
159
|
+
medioNotificacionNombre: string;
|
160
|
+
carnetFileId: null | string;
|
161
|
+
celularVerificado: number;
|
162
|
+
emailVerificado: number;
|
163
|
+
telegramChatId: null | number;
|
164
|
+
tieneWhatsApp: number;
|
165
|
+
tieneTelegram: number;
|
166
|
+
fechaCaducidadCi: null | string;
|
167
|
+
}
|
168
|
+
export interface AbogadoItem {
|
169
|
+
Abogados_id: number;
|
170
|
+
Abogados_matricula: string;
|
171
|
+
Abogados_fechaRegistro: string;
|
172
|
+
Abogados_estadoRegistro: string;
|
173
|
+
Abogados_foto: string;
|
174
|
+
Abogados_buzonElectronico: number;
|
175
|
+
Abogados_fechaVencimiento: string;
|
176
|
+
Abogados_createdAt: string;
|
177
|
+
Abogados_updatedAt: string;
|
178
|
+
Abogados_personaId: number;
|
179
|
+
}
|
180
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ms-personas/types.ts"],"names":[],"mappings":""}
|
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.21",
|
4
4
|
"author": "UTIC",
|
5
5
|
"contact": {
|
6
6
|
"name": "Unidad de Tecnologías de la Información y Comunicación - Ministerio Público",
|
@@ -10,6 +10,8 @@
|
|
10
10
|
"files": [
|
11
11
|
"dist/ms-seguridad/*",
|
12
12
|
"dist/ms-redis/*",
|
13
|
+
"dist/ms-personas/*",
|
14
|
+
"dist/http-service/*",
|
13
15
|
"dist/services/*",
|
14
16
|
"dist/helpers/*",
|
15
17
|
"dist/types/*",
|
@@ -48,16 +50,15 @@
|
|
48
50
|
"peerDependencies": {
|
49
51
|
"@grpc/grpc-js": "^1.8.14",
|
50
52
|
"@nestjs/microservices": "^9.3.12",
|
53
|
+
"@nestjs/axios": "^2.0.0",
|
51
54
|
"axios": "^1.3.4",
|
52
55
|
"class-transformer": "^0.5.1",
|
53
56
|
"class-validator": "^0.14.0",
|
54
57
|
"rxjs": "^7.2.0"
|
55
58
|
},
|
56
59
|
"dependencies": {
|
57
|
-
"@nestjs/axios": "^2.0.0",
|
58
60
|
"@nestjs/common": "^9.0.0",
|
59
|
-
"dotenv": "^16.0.3"
|
60
|
-
"rxjs": "^7.2.0"
|
61
|
+
"dotenv": "^16.0.3"
|
61
62
|
},
|
62
63
|
"devDependencies": {
|
63
64
|
"@grpc/grpc-js": "^1.8.14",
|