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

@hsuite/users-types

v2.1.3

Published

A comprehensive TypeScript library providing type definitions and interfaces for user management in the HSuite ecosystem.

Readme

@hsuite/users-types

A comprehensive TypeScript library providing type definitions and interfaces for user management in the HSuite ecosystem.

Overview

The @hsuite/users-types library provides a robust set of TypeScript types, interfaces, and models for handling user-related data structures. It is designed to ensure type safety and consistency across applications using the HSuite platform.

Installation

npm install @hsuite/users-types

Dependencies

Peer Dependencies

  • @nestjs/common: ^10.4.2
  • @nestjs/core: ^10.4.2

Dependencies

  • @hsuite/nestjs-swagger: 1.0.3
  • @hsuite/auth-types: 2.0.0

Development Dependencies

  • @compodoc/compodoc: ^1.1.23

Features

  • Type-safe user entity definitions
  • Mongoose schema decorators for database integration
  • Swagger/OpenAPI documentation support
  • Integration with HSuite authentication system
  • Two-factor authentication type support

Usage

Importing Types

import { User, IUser } from '@hsuite/users-types';

User Model

The library provides a User.Safe class that implements the IAuth.ICredentials.IUser.IEntity interface. This class represents a safe version of the User entity with public properties:

Properties

| Property | Type | Required | Description | |----------|------|----------|-------------| | email | string | Yes | User's email address (unique, validated) | | username | string | Yes | Unique username for the user account | | created_at | number | Yes | Unix timestamp of user account creation | | updated_at | number | Yes | Unix timestamp of last user account update | | confirmed | boolean | Yes | Indicates if user has confirmed their account | | type | IAuth.ICredentials.IUser.IType | Yes | Type of user account | | role | 'user' | 'admin' | 'owner' | Yes | User's role in the system | | tags | Array<Auth.Credentials.User.Tags> | No | Tags for categorizing users | | banned | boolean | No | Indicates if user is banned | | twoFactorAuth | Auth.TwoFactor.Auth | Yes | Two-factor authentication configuration |

Example

const user: User.Safe = {
  email: "[email protected]",
  username: "johndoe",
  created_at: 1634567890,
  updated_at: 1634567890,
  confirmed: true,
  type: "standard",
  role: "user",
  tags: ["premium", "beta"],
  banned: false,
  twoFactorAuth: {
    // Two-factor authentication configuration
  }
};

Documentation

Generate detailed documentation using:

npm run compodoc

View documentation coverage:

npm run compodoc:coverage

Type Definitions

The library is organized into two main namespaces:

IUser Namespace

Contains interfaces and type definitions for user-related data structures.

User Namespace

Contains concrete implementations and models, including the User.Safe class for public user data representation.

Database Integration

The library uses @nestjs/mongoose decorators for MongoDB schema definition:

  • @Prop() decorators for property definitions
  • Built-in validation (e.g., email validation)
  • Support for unique constraints
  • Type safety with Mongoose schemas

API Documentation

The library includes Swagger/OpenAPI decorators (@ApiProperty) for automatic API documentation generation, making it compatible with NestJS Swagger integration.

Version

Current Version: 2.0.0

License

This package is part of the HbarSuite ecosystem and is covered by its license terms.