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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@infosel-sdk/users

v0.0.6

Published

Users SDK for Infosel financial services platform. Provides user management functionality including user creation and retrieval by connection ID.

Readme

@infosel-sdk/users

SDK de Usuarios para la plataforma de servicios financieros Infosel. Proporciona funcionalidades para la gestión de usuarios, incluyendo creación de usuarios y consulta por ID de conexión.

🚀 Características

  • Gestión de Usuarios: Creación y consulta de usuarios
  • Integración con Markets: Acceso a workspaces, widgets e instrumentos del usuario
  • Configuración Automática: Soporte para entornos QA y producción
  • Inyección de Dependencias: Arquitectura modular y extensible
  • Manejo de Errores: Integración con el sistema de errores del SDK Core

📦 Instalación

npm install @infosel-sdk/users

Dependencias

Peer Dependencies (requeridas):

  • @infosel-sdk/core: ^0.0.3
  • @infosel-sdk/markets: ^1.0.0

Dependencias Internas:

  • tslib: ^2.8.1

Nota sobre Peer Dependencies

Este paquete utiliza peer dependencies para evitar conflictos de versiones y dependencias circulares en el monorepo. Asegúrate de tener instaladas las versiones correctas de @infosel-sdk/core y @infosel-sdk/markets en tu proyecto.

🔧 Configuración

Inicialización Básica

import { InfoselSdkManager } from '@infosel-sdk/core';
import InfoselUsers from '@infosel-sdk/users';

// Inicializar el SDK Manager
const sdkManager = new InfoselSdkManager({
  baseUrl: 'https://api.infosel.com',
  mode: 'prod', // o 'qa'
});

await sdkManager.initialize();

// Inicializar el módulo de usuarios
const usersModule = InfoselUsers.init({ sdkManager });

Configuración por Entorno

// Entorno de Producción
const sdkManager = new InfoselSdkManager({
  baseUrl: 'https://api.infosel.com',
  mode: 'prod',
});

// Entorno de QA
const sdkManager = new InfoselSdkManager({
  baseUrl: 'https://api-qa.infosel.com',
  mode: 'qa',
});

👤 Gestión de Usuarios

Crear Usuario

import { CreateUserRequest } from '@infosel-sdk/users';

const createUserRequest: CreateUserRequest = {
  projectId: 'your-project-id',
  connectionId: 'user-connection-id',
};

try {
  const user = await usersModule.createUser(createUserRequest);
  console.log('Usuario creado:', user);
} catch (error) {
  console.error('Error al crear usuario:', error);
}

Obtener Usuario por Connection ID

try {
  const user = await usersModule.getUserByConnectionId('user-connection-id');
  console.log('Usuario encontrado:', user);

  // Acceder a los workspaces del usuario
  console.log('Workspaces:', user.workspaces);

  // Acceder a los widgets del usuario
  console.log('Widgets:', user.widgets);

  // Acceder a los instrumentos del usuario
  console.log('Instrumentos:', user.instruments);
} catch (error) {
  console.error('Error al obtener usuario:', error);
}

📊 Estructura de Datos

User Entity

interface User {
  readonly id: string;
  readonly connectionId: string;
  readonly workspaces: Workspace[];
  readonly widgets: WidgetsContainer;
  readonly instruments: InstrumentsContainer;
}

CreateUserRequest

interface CreateUserRequest {
  readonly projectId: string;
  readonly connectionId: string;
}

🚨 Manejo de Errores

import { SdkError, SdkErrorType } from '@infosel-sdk/core';

try {
  const user = await usersModule.createUser(request);
} catch (error) {
  if (error instanceof SdkError) {
    switch (error.type) {
      case SdkErrorType.REQUEST_OBJECT_IS_REQUIRED:
        console.error('Se requiere un objeto de solicitud');
        break;
      case SdkErrorType.INVALID_PROJECT_ID:
        console.error('ID de proyecto inválido');
        break;
      case SdkErrorType.INVALID_CONNECTION_ID:
        console.error('ID de conexión inválido');
        break;
      default:
        console.error('Error del SDK:', error.message);
    }
  }
}

📚 API Reference

Clases Principales

  • InfoselUsers: Componente principal para gestión de usuarios
  • CreateUserUseCase: Caso de uso para crear usuarios
  • GetUserByConnectionIdUseCase: Caso de uso para obtener usuarios por connection ID

Métodos Disponibles

createUser(request: CreateUserRequest): Promise<User>

Crea un nuevo usuario en el sistema.

Parámetros:

  • request: Objeto con projectId y connectionId

Retorna: Promise con el usuario creado

getUserByConnectionId(connectionId: string): Promise<User>

Obtiene un usuario existente por su ID de conexión.

Parámetros:

  • connectionId: ID de conexión del usuario

Retorna: Promise con el usuario encontrado

Tipos de Error

  • SdkErrorType.REQUEST_OBJECT_IS_REQUIRED: Objeto de solicitud requerido
  • SdkErrorType.INVALID_PROJECT_ID: ID de proyecto inválido
  • SdkErrorType.INVALID_CONNECTION_ID: ID de conexión inválido

🔗 Integración con Markets

El módulo de usuarios está integrado con el módulo de markets, proporcionando acceso a:

  • Workspaces: Espacios de trabajo del usuario
  • Widgets: Widgets configurados por el usuario
  • Instruments: Instrumentos financieros del usuario
const user = await usersModule.getUserByConnectionId('connection-id');

// Acceder a workspaces
user.workspaces.forEach(workspace => {
  console.log('Workspace:', workspace.name);
});

// Acceder a widgets
console.log('Widgets disponibles:', user.widgets);

// Acceder a instrumentos
console.log('Instrumentos:', user.instruments);

🧪 Testing

# Ejecutar tests unitarios
npm test

# Ejecutar tests con cobertura
npm run test:coverage

🤝 Contribución

  1. Fork el proyecto
  2. Crea una rama para tu feature (git checkout -b feature/AmazingFeature)
  3. Commit tus cambios (git commit -m 'Add some AmazingFeature')
  4. Push a la rama (git push origin feature/AmazingFeature)
  5. Abre un Pull Request

📄 Licencia

Este proyecto está bajo la Licencia MIT. Ver el archivo LICENSE para más detalles.