npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@irineocoria/libreria-consumidor-apis-frontend

v1.0.120

Published

Libreria para el consumo de apis desde los microfrontends de Red Unica

Downloads

2

Readme

@red-unica/libreria-consumidor-apis-frontend

Implementación de cliente para el consumo de APIs desde los micro-frontends para todo Red Única.

Intalación

$ npm install @red-unica/libreria-consumidor-apis-frontend

Uso

Cómo armar la peticion

import ConsumidorApisFrontEnd from '@red-unica/libreria-consumidor-apis-frontend';
import CelulasRedUnica from '@red-unica/libreria-consumidor-apis-frontend/src/configuracion/CelulasRedUnica';
import OrigenApis from '@red-unica/libreria-consumidor-apis-frontend/src/configuracion/OrigenApis';
import axios from 'axios';
const CancelToken = axios.CancelToken;
...

// Recurso de APIGee a ejecutar
const url = "/identidad-digital/cliente-unico/clientes/indicadores/v1/busquedas";

// OPCIONAL, Objeto que será enviado en el body de la peticion
const cuerpo = {
	"idPais": 1, 
	"idCanal": 24, 
	"idSucursal": 9495, 
	"folio": 1549
};

// OPCIONAL, Parametros que se enviaran como query string de la peticion
const parametros = {
	"idPais": 1, 
	"idCanal": 24, 
	"idSucursal": 9495, 
	"folio": 1549
}; 

// OPCIONAL, Arreglo de arreglos cadenas indicando llave/valor de cada cabecero para la peticion.
const cabeceros = [
	['x-id-acceso', 'ASDCRSADACASFD'],
	['x-id-plataforma', '1']
];

// OPCIONAL, tiempo en milisegundos que debe esperar antes de cancelar la peticion
const timeout = 5000;

// OPCIONAL, Token de cancelacion de Axios para permitir la cancelacion de la peticion de forma externa.
const tokenCancelacion = CancelToken.source();

// OPCIONAL, Valor de la Enumeracion que indica de que celula deben usarse las credenciales
const celula = CelulasRedUnica.RED_UNICA;

//OPCIONAL, En caso de que la celula cuente con más de unas credenciles, indica la posicion del arreglo que debe tomarse.
const credenciales = 0;

//OPCIONAL, En caso de que el consumo tenga que ser de AWS
const origenApis = OrigenApis.AWS;

const peticion = { 
	url, 
	cuerpo, 
	parametros, 
	cabeceros, 
	timeout, 
	tokenCancelacion, 
	celula, 
	credenciales,
	origenApis,
};

ConsumidorApisFrontEnd.ejecutaPeticionGet(peticion);
ConsumidorApisFrontEnd.ejecutaPeticionPost(peticion);
ConsumidorApisFrontEnd.ejecutaPeticionPut(peticion);
ConsumidorApisFrontEnd.ejecutaPeticionDelete(peticion);

Cómo realizar la peticion


// Opcion 1:
ConsumidorApisFrontEnd.ejecutaPeticionPost(peticion)
	.then(respuesta=>{
		//Manipular la respuesta exitosa
	}).catch(error=>{
		//Manipular el error
});

//Opcion 2:
try{
	const respuesta = await ConsumidorApisFrontEnd.ejecutaPeticionPost(peticion);
	//Manipular la respuesta exitosa
}catch(error){
	//Manipular el error
}

Variables de entorno

REACT_APP_JUEZ_FRASE_SECRETA

REACT_APP_URL_TOKEN

REACT_APP_URL_BASE_INT

REACT_APP_URL_BASE_EXT

REACT_APP_URL_BASE_AWS_INT

REACT_APP_URL_BASE_AWS_EXT

REACT_APP_TIPO_ARQUITECTURA_PC

REACT_APP_TIPO_ARQUITECTURA_TABLET

REACT_APP_TIPO_ARQUITECTURA_MOVIL

REACT_APP_APIGEE_CREDENCIALES_TRANSVERSAL

REACT_APP_APIGEE_CREDENCIALES_EMPLEADOS_Y_DESEMPENIO

REACT_APP_APIGEE_CREDENCIALES_CLIENTES_Y_PORTAFOLIO

REACT_APP_APIGEE_CREDENCIALES_COBRANZA_Y_CREDITO

REACT_APP_APIGEE_CREDENCIALES_COMERCIO

REACT_APP_APIGEE_CREDENCIALES_CAPTACION

REACT_APP_APIGEE_CREDENCIALES_BIG

REACT_APP_APIGEE_CREDENCIALES_SEGUROS_AZTECA

REACT_APP_APIGEE_CREDENCIALES_AFORE_AZTECA

REACT_APP_APIGEE_CREDENCIALES_SISTEMA_DE_PAGOS_Y_CAJA

Asegurarse que las variables de ambiente esten definidas dentro del frontend-contenedor-principal

License

ISC ©