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

@hichchi/nest-connector

v0.0.9

Published

Comprehensive NestJS connector library providing standardized HTTP responses, authentication interfaces, CRUD operations, and shared utilities for the Hichchi ecosystem

Readme

🔗 @hichchi/nest-connector

Description

Comprehensive NestJS connector library providing standardized HTTP responses, authentication interfaces, CRUD operations, and shared utilities for the Hichchi ecosystem

npm version npm downloads License: MIT NestJS

Part of the Hichchi ecosystem - A powerful, scalable application built with Nx workspace

📚 Jump to Documentation


📋 Table of Contents


📦 Installation

npm install @hichchi/nest-connector

⚡ Quick Start

Get up and running with standardized API responses in just a few minutes:

// 1. Install the package
npm install @hichchi/nest-connector

// 2. Import response interfaces and builders
import {
  HttpResponse,
  SuccessResponse,
  ErrorResponse,
  SuccessResponseDto
} from '@hichchi/nest-connector';

// 3. Use in your NestJS controllers
@Controller('users')
export class UsersController {
  @Get()
  async getUsers(): Promise<SuccessResponse> {
    const users = await this.usersService.findAll();
    return new SuccessResponseDto(users, 'Users retrieved successfully');
  }
}

📋 Prerequisites

Before installing @hichchi/nest-connector, ensure you have:

Required Dependencies

  • Node.js: ^20.0.0
  • NestJS: ^11.0.0
  • TypeScript: ~5.9.3

Peer Dependencies

npm install @nestjs/common @nestjs/core
npm install rxjs reflect-metadata

Internal Dependencies

This package depends on:

npm install @hichchi/utils

Optional Dependencies

For enhanced features:

# For validation decorators
npm install class-validator class-transformer

🌟 Overview

🎯 Your standardized response toolkit for NestJS applications. Ensure consistent API responses across your entire application with pre-defined interfaces, builders, and response structures that follow industry best practices.

✨ Features

🏗️ Ready-to-Use Response Structures

  • 📋 HttpResponse Interface - Base interface for all API responses
  • SuccessResponse Interface - Standardized success response structure
  • ErrorResponse Interface - Consistent error response format
  • 🔢 HTTP Status Enums - Pre-defined status code enumerations

🛠️ Response Builders & DTOs

  • 🏭 SuccessResponseDto - Builder for success responses with data
  • 🎯 Response Code Types - Application-specific response codes
  • 📊 Status Code Management - Organized HTTP status code handling
  • 🔧 Type-Safe Responses - Full TypeScript support for response structures

🔐 Authentication Interfaces

  • 👤 Typed Auth User Interface - Generic User<Role, Permission, Tenant> typing for role/permission/tenant-aware authentication flows
  • 🏢 Tenant Interface Support - Dedicated tenant interfaces with owner/member user relationships for multi-tenant domains
  • 🧩 Composed Auth Models - Consistent Role, User, and Tenant interface exports for shared contracts across services

🎨 Developer Experience

  • 📝 Comprehensive Documentation - Detailed JSDoc comments for all interfaces
  • 🔍 IntelliSense Support - Full IDE autocomplete and type checking
  • 🎯 Consistent API Design - Standardized response patterns across applications
  • 🚀 Easy Integration - Drop-in replacement for custom response handling

🔧 Advanced Features

  • 🏷️ User Info Interfaces - Standardized user information structures
  • 🔀 Clear Context Separation - Base UserInfo for identity data, auth User interface for tenant-aware authentication context
  • 📦 Modular Design - Import only what you need
  • 🔄 Extensible Architecture - Easy to extend with custom response types
  • 🎪 Framework Agnostic Types - Core interfaces can be used beyond NestJS

🔧 Development

Building the Library

nx build nest-connector

Running Tests

nx test nest-connector

Linting

nx lint nest-connector

Made with ❤️ by Hichchi Dev

Hichchi Ecosystem Report Bug Request Feature

Standardizing API responses and connecting NestJS applications with consistent interfaces and shared utilities


📖 API Documentation

Complete technical reference for all classes, interfaces, methods, and types in this library.

Auto-generated by TypeDoc - Browse through detailed API references, code examples, and implementation guides below.


📋 API Table of Contents

Classes

SuccessResponseDto

Defined in: builders/success-response.dto.ts:55

Data Transfer Object for standardized success responses

This class provides a standardized way to create success response objects for API endpoints. It implements the SuccessResponse interface and ensures that all required properties are properly set with appropriate default values.

Key features:

  • Flexible constructor that accepts either individual parameters or a complete response object
  • Default values for all properties if not explicitly provided
  • Type-safe response code handling with autocomplete support
  • Consistent structure for all success responses across the application

The class is designed to be used in controllers and services to return standardized success responses to API clients.

Examples

// Creating a success response with custom message
@Post()
createUser(@Body() createUserDto: CreateUserDto): SuccessResponseDto {
  this.userService.create(createUserDto);
  return new SuccessResponseDto("User created successfully");
}
// Creating a success response from an existing response object
@Get()
getUsers(): SuccessResponseDto {
  const users = this.userService.findAll();
  const response = {
    statusCode: HttpSuccessStatus.OK,
    code: "USERS_RETRIEVED",
    message: "Users retrieved successfully",
    data: users
  };
  return new SuccessResponseDto(response);
}

See

Implements

Constructors

Constructor
new SuccessResponseDto(
   message?,
   code?,
   status?,
   description?): SuccessResponseDto;

Defined in: builders/success-response.dto.ts:118

Creates a new success response with individual parameters

This constructor overload allows creating a success response by specifying individual properties. Any properties not provided will use default values from SuccessResponses.SUCCESS.

Parameters

message?

string

Human-readable success message

code?

string

Unique code identifying the success type

status?

HttpSuccessStatus

HTTP status code for the response

description?

string

Optional detailed description

Returns

SuccessResponseDto

Example
// Basic success response with just a message
const response = new SuccessResponseDto("Operation completed successfully");

// Success response with custom code and status
const response = new SuccessResponseDto(
  "User created successfully",
  "USER_CREATED",
  HttpSuccessStatus.CREATED,
);
Constructor
new SuccessResponseDto(response): SuccessResponseDto;

Defined in: builders/success-response.dto.ts:140

Creates a new success response from an existing response object

This constructor overload allows creating a success response by providing an existing SuccessResponse object. Any properties not provided in the input object will use default values from SuccessResponses.SUCCESS.

Parameters

response

SuccessResponse

Existing success response object

Returns

SuccessResponseDto

Example
// Creating from an existing response object
const existingResponse = {
  statusCode: HttpSuccessStatus.OK,
  code: "DATA_RETRIEVED",
  message: "Data retrieved successfully",
};
const response = new SuccessResponseDto(existingResponse);

Properties

code

LooseAutocomplete<AuthSuccessResponseCode>

Unique code identifying the success response type

This property holds a string code that identifies the specific type of success. It uses LooseAutocomplete to provide type suggestions from AuthSuccessResponseCode while still allowing custom string values.

See

AuthSuccessResponseCode For predefined success codes

builders/success-response.dto.ts:75

description?

string

Optional detailed description of the success result

This property can contain additional information about the success result that might be useful for debugging or providing more context to developers.

builders/success-response.dto.ts:91

message

string

Human-readable success message

This property contains a user-friendly message describing the success result. It should be clear, concise, and suitable for displaying to end users.

builders/success-response.dto.ts:83

statusCode

HttpSuccessStatus

HTTP status code for the success response

This property holds the HTTP status code that should be returned to the client. It uses the HttpSuccessStatus enum to ensure only valid success status codes are used.

See

HttpSuccessStatus For available status codes

builders/success-response.dto.ts:64

Enumerations

CommonErrorResponseCode

Defined in: enums/common-error-response-code.enum.ts:16

Common Error Response Codes Enum

This enum defines general-purpose error response codes that can be used across different services and modules in the application. Each code represents a specific error condition related to common operations such as data validation, resource access, and file operations.

The naming convention includes HTTP status codes (e.g., 400, 404, 500) for clarity, with the prefix "ERROR_" to distinguish them as error codes.

Enum Values are organized by HTTP status categories:

  • 400 series: Client errors (Bad Request, Unauthorized, Forbidden, Not Found)
  • 500 series: Server errors (Internal Server Error)
  • Generic errors without specific status codes

Enumeration Members

ERROR

"ERROR"

Generic unspecified error

Most general error code for cases where the specific error type cannot be determined or doesn't fit into any other category.

enums/common-error-response-code.enum.ts:129

ERROR_400

"ERROR_400"

Generic bad request error (400 Bad Request)

Generic error for bad requests when a more specific error code is not applicable.

enums/common-error-response-code.enum.ts:93

ERROR_400_EMPTY_ID

"ERROR_400_EMPTY_ID"

Empty ID error (400 Bad Request)

Occurs when an ID field is required but not provided or is empty.

enums/common-error-response-code.enum.ts:22

ERROR_400_EMPTY_IDS

"ERROR_400_EMPTY_IDS"

Empty IDs array error (400 Bad Request)

Occurs when an array of IDs is required but not provided or is empty.

enums/common-error-response-code.enum.ts:29

ERROR_400_INVALID_ID

"ERROR_400_INVALID_ID"

Invalid ID format or value (400 Bad Request)

Occurs when an ID is provided but has an invalid format or value.

enums/common-error-response-code.enum.ts:36

ERROR_400_INVALID_IDS

"ERROR_400_INVALID_IDS"

Invalid IDs array (400 Bad Request)

Occurs when an array of IDs contains one or more invalid entries.

enums/common-error-response-code.enum.ts:43

ERROR_400_INVALID_UUID

"ERROR_400_INVALID_UUID"

Invalid UUID format (400 Bad Request)

Occurs when a provided UUID doesn't conform to the required format.

enums/common-error-response-code.enum.ts:50

ERROR_400_NOT_ID_ARRAY

"ERROR_400_NOT_ID_ARRAY"

Not an array of IDs (400 Bad Request)

Occurs when a parameter expected to be an array of IDs is of the wrong type.

enums/common-error-response-code.enum.ts:57

ERROR_401

"ERROR_401"

Generic unauthorized error (401 Unauthorized)

Generic error for unauthorized access when a more specific error code is not applicable.

enums/common-error-response-code.enum.ts:100

ERROR_403

"ERROR_403"

Generic forbidden error (403 Forbidden)

Generic error for forbidden access when a more specific error code is not applicable.

enums/common-error-response-code.enum.ts:107

ERROR_404

"ERROR_404"

Generic not found error (404 Not Found)

Generic error for resource not found when a more specific error code is not applicable.

enums/common-error-response-code.enum.ts:114

ERROR_404_FILE_NOT_EXIST

"ERROR_404_FILE_NOT_EXIST"

File not found (404 Not Found)

Occurs when attempting to access a file that doesn't exist.

enums/common-error-response-code.enum.ts:64

ERROR_404_NOT_IMPLEMENTED

"ERROR_404_NOT_IMPLEMENTED"

Feature not implemented (404 Not Found)

Occurs when attempting to use a feature or endpoint that is not yet implemented. Note: While HTTP 501 is traditionally used for this, this uses 404 for specific cases.

enums/common-error-response-code.enum.ts:72

ERROR_500

"ERROR_500"

Generic server error (500 Internal Server Error)

Generic error for server-side issues when a more specific error code is not applicable.

enums/common-error-response-code.enum.ts:121

ERROR_500_FILE_DELETE

"ERROR_500_FILE_DELETE"

File deletion error (500 Internal Server Error)

Occurs when there is a server-side error during file deletion.

enums/common-error-response-code.enum.ts:86

ERROR_500_FILE_UPLOAD

"ERROR_500_FILE_UPLOAD"

File upload error (500 Internal Server Error)

Occurs when there is a server-side error during file upload processing.

enums/common-error-response-code.enum.ts:79


CommonSuccessResponseCode

Defined in: enums/common-success-response-code.enum.ts:16

Common Success Response Codes Enum

This enum defines general-purpose success response codes that can be used across different services and modules in the application. Each code represents a specific success condition for operations and requests.

While HTTP status codes in the 2xx range (like 200 OK, 201 Created) provide a standardized way to indicate success at the protocol level, these application-specific success codes offer more granular information about the exact nature of the successful operation.

Currently, this enum contains a single generic success code, but it can be extended with more specific success codes as the application grows and more detailed success states need to be communicated.

Enumeration Members

SUCCESS

"SUCCESS"

Generic success response

Indicates that the requested operation completed successfully without any issues. This is the most general success code and can be used when a more specific success code is not necessary or has not been defined.

enums/common-success-response-code.enum.ts:24


Endpoint

Defined in: enums/endpoint.enum.ts:16

Base API Endpoints Enum

This enum defines the root-level API endpoints used throughout the application. Each value represents a top-level API route segment that serves as a namespace for more specific endpoints within that domain.

These root endpoints are typically combined with more specific sub-endpoints (defined in domain-specific endpoint enums) to form complete API paths. For example, the AUTH endpoint combined with an AuthEndpoint value would create a full authentication API route.

This approach allows for organized, hierarchical API routing and helps maintain consistency across the application's API structure.

Enumeration Members

AUTH

"auth"

Authentication API endpoint root

Base path segment for all authentication-related operations. This serves as the namespace for endpoints defined in AuthEndpoint enum.

Complete authentication endpoints are formed by combining this root with specific authentication operations, e.g., "/auth/sign-in" or "/auth/verify-email".

See

AuthEndpoint For specific authentication operation endpoints

enums/endpoint.enum.ts:28


Gateway

Defined in: enums/gateways.enum.ts:17

Application Gateways Enum

This enum defines the different communication gateways used in the application for real-time or streaming data exchange. Each value represents a specific gateway technology or implementation that enables bidirectional communication between clients and the server.

Gateways provide alternatives to traditional HTTP request/response patterns, allowing for push notifications, live updates, and interactive features.

The values in this enum can be used to identify and configure the appropriate gateway implementation for different parts of the application.

Enumeration Members

SOCKET

"socket"

WebSocket gateway

Represents the WebSocket-based communication gateway, which provides full-duplex communication channels over a single, long-lived TCP connection.

This gateway enables real-time data exchange between clients and the server without the overhead of repeatedly establishing new connections. It's particularly useful for applications requiring low-latency updates, notifications, or interactive features.

The implementation may use libraries like Socket.IO or native WebSockets.

enums/gateways.enum.ts:31


HttpClientErrorStatus

Defined in: enums/http-status.enums.ts:83

HTTP Client Error Status Codes (4xx)

This enum defines the standard HTTP status codes in the 4xx range (Client Error). These status codes indicate that the client seems to have made an error in the request.

The 4xx class of status codes is intended for situations in which the client appears to have erred, such as sending invalid authentication credentials, requesting a resource that doesn't exist, or submitting malformed data.

See

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses

Enumeration Members

BAD_REQUEST

400

enums/http-status.enums.ts:84

CONFLICT

409

enums/http-status.enums.ts:93

EXPECTATION_FAILED

417

enums/http-status.enums.ts:101

FAILED_DEPENDENCY

424

enums/http-status.enums.ts:106

FORBIDDEN

403

enums/http-status.enums.ts:87

GONE

410

enums/http-status.enums.ts:94

IM_A_TEAPOT

418

enums/http-status.enums.ts:102

LENGTH_REQUIRED

411

enums/http-status.enums.ts:95

LOCKED

423

enums/http-status.enums.ts:105

METHOD_NOT_ALLOWED

405

enums/http-status.enums.ts:89

MISDIRECTED_REQUEST

421

enums/http-status.enums.ts:103

NOT_ACCEPTABLE

406

enums/http-status.enums.ts:90

NOT_FOUND

404

enums/http-status.enums.ts:88

PAYLOAD_TOO_LARGE

413

enums/http-status.enums.ts:97

PAYMENT_REQUIRED

402

enums/http-status.enums.ts:86

PRECONDITION_FAILED

412

enums/http-status.enums.ts:96

PRECONDITION_REQUIRED

428

enums/http-status.enums.ts:109

PROXY_AUTHENTICATION_REQUIRED

407

enums/http-status.enums.ts:91

RANGE_NOT_SATISFIABLE

416

enums/http-status.enums.ts:100

REQUEST_HEADER_FIELDS_TOO_LARGE

431

enums/http-status.enums.ts:111

REQUEST_TIMEOUT

408

enums/http-status.enums.ts:92

TOO_EARLY

425

enums/http-status.enums.ts:107

TOO_MANY_REQUESTS

429

enums/http-status.enums.ts:110

UNAUTHORIZED

401

enums/http-status.enums.ts:85

UNAVAILABLE_FOR_LEGAL_REASONS

451

enums/http-status.enums.ts:112

UNPROCESSABLE_ENTITY

422

enums/http-status.enums.ts:104

UNSUPPORTED_MEDIA_TYPE

415

enums/http-status.enums.ts:99

UPGRADE_REQUIRED

426

enums/http-status.enums.ts:108

URI_TOO_LONG

414

enums/http-status.enums.ts:98


HttpInfoStatus

Defined in: enums/http-status.enums.ts:15

HTTP Informational Status Codes (1xx)

This enum defines the standard HTTP status codes in the 1xx range (Informational). These status codes indicate a provisional response and require the client to continue with the request or ignore the response if the request is already finished.

The 1xx class of status codes represents preliminary information, indicating that the request was received and is continuing to be processed.

See

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#information_responses

Enumeration Members

CONTINUE

100

enums/http-status.enums.ts:16

EARLYHINTS

103

enums/http-status.enums.ts:19

PROCESSING

102

enums/http-status.enums.ts:18

SWITCHING_PROTOCOLS

101

enums/http-status.enums.ts:17


HttpRedirectionStatus

Defined in: enums/http-status.enums.ts:60

HTTP Redirection Status Codes (3xx)

This enum defines the standard HTTP status codes in the 3xx range (Redirection). These status codes indicate that further action needs to be taken by the client in order to complete the request, typically involving following a redirect.

The 3xx class of status codes indicates the client must take additional action to complete the request, such as following a new URL or using a cached version.

See

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages

Enumeration Members

FOUND

302

enums/http-status.enums.ts:63

MOVED_PERMANENTLY

301

enums/http-status.enums.ts:62

MULTIPLE_CHOICES

300

enums/http-status.enums.ts:61

NOT_MODIFIED

304

enums/http-status.enums.ts:65

PERMANENT_REDIRECT

308

enums/http-status.enums.ts:68

SEE_OTHER

303

enums/http-status.enums.ts:64

TEMPORARY_REDIRECT

307

enums/http-status.enums.ts:67

USE_PROXY

305

enums/http-status.enums.ts:66


HttpServerErrorStatus

Defined in: enums/http-status.enums.ts:128

HTTP Server Error Status Codes (5xx)

This enum defines the standard HTTP status codes in the 5xx range (Server Error). These status codes indicate that the server failed to fulfill a valid request.

The 5xx class of status codes is intended for cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request. These errors are typically related to server configuration issues, unexpected conditions, or temporary overloading.

See

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses

Enumeration Members

BAD_GATEWAY

502

enums/http-status.enums.ts:131

GATEWAY_TIMEOUT

504

enums/http-status.enums.ts:133

HTTP_VERSION_NOT_SUPPORTED

505

enums/http-status.enums.ts:134

INSUFFICIENT_STORAGE

507

enums/http-status.enums.ts:136

INTERNAL_SERVER_ERROR

500

enums/http-status.enums.ts:129

LOOP_DETECTED

508

enums/http-status.enums.ts:137

NETWORK_AUTHENTICATION_REQUIRED

511

enums/http-status.enums.ts:139

NOT_EXTENDED

510

enums/http-status.enums.ts:138

NOT_IMPLEMENTED

501

enums/http-status.enums.ts:130

SERVICE_UNAVAILABLE

503

enums/http-status.enums.ts:132

VARIANT_ALSO_NEGOTIATES

506

enums/http-status.enums.ts:135


HttpSuccessStatus

Defined in: enums/http-status.enums.ts:35

HTTP Success Status Codes (2xx)

This enum defines the standard HTTP status codes in the 2xx range (Success). These status codes indicate that the client's request was successfully received, understood, and accepted.

The 2xx class of status codes represents successful completion of the HTTP request, with different codes indicating specific types of success such as resource creation, accepted but not yet processed requests, or successful responses with no content.

See

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses

Enumeration Members

ACCEPTED

202

enums/http-status.enums.ts:38

ALREADY_REPORTED

208

enums/http-status.enums.ts:44

CONTENT_DIFFERENT

210

enums/http-status.enums.ts:45

CREATED

201

enums/http-status.enums.ts:37

MULTI_STATUS

207

enums/http-status.enums.ts:43

NO_CONTENT

204

enums/http-status.enums.ts:40

NON_AUTHORITATIVE_INFORMATION

203

enums/http-status.enums.ts:39

OK

200

enums/http-status.enums.ts:36

PARTIAL_CONTENT

206

enums/http-status.enums.ts:42

RESET_CONTENT

205

enums/http-status.enums.ts:41

Interfaces

ErrorResponse

Defined in: interfaces/response.interfaces.ts:126

Interface for error API responses that include error details.

The ErrorResponse interface extends the base HttpResponse interface to standardize error responses across the application. It includes properties for error identification, detailed error information, and optionally the original error object for debugging.

This structured approach to error responses makes it easier for clients to handle errors in a consistent way and for developers to debug issues in the system.

ErrorResponse

See

Extends

Properties

code

ErrorResponseCode

Application-specific error code.

This provides more granular information about the specific error case, allowing clients to handle different error scenarios distinctly.

See

ErrorResponseCode Type for error response codes

HttpResponse.code

interfaces/response.interfaces.ts:147

description?

string

Optional detailed description of the response.

When provided, this field contains additional information about the response that might be useful for debugging or logging purposes. Unlike the message field, this can contain technical details and is primarily intended for developers rather than end users.

HttpResponse.description

interfaces/response.interfaces.ts:66

message

string

Human-readable message describing the response.

This short message explains the result of the operation and is suitable for displaying to end users. It should be clear, concise, and avoid technical details that aren't relevant to users.

HttpResponse.message

interfaces/response.interfaces.ts:56

statusCode

| HttpClientErrorStatus | HttpServerErrorStatus

The HTTP status code, which will be an error code (4xx or 5xx).

For error responses, this will typically be:

  • 4xx range for client errors (e.g., 400 Bad Request, 404 Not Found)
  • 5xx range for server errors (e.g., 500 Internal Server Error)

See

HttpResponse.statusCode

interfaces/response.interfaces.ts:137


HttpResponse

Defined in: interfaces/response.interfaces.ts:21

Base interface for all HTTP responses in the application.

The HttpResponse interface defines the standard structure for API responses throughout the application. It ensures a consistent response format that includes status information, a specific response code, and descriptive messages.

This standardized format makes it easier for clients to process responses and handle different scenarios (success, error, etc.) in a consistent manner.

HttpResponse

See

Extended by

Properties

code

ResponseCode

Application-specific response code.

This code provides more detailed information about the specific result of the operation beyond what the HTTP status code indicates. It allows for fine-grained categorization of responses within each HTTP status category.

See

interfaces/response.interfaces.ts:47

description?

string

Optional detailed description of the response.

When provided, this field contains additional information about the response that might be useful for debugging or logging purposes. Unlike the message field, this can contain technical details and is primarily intended for developers rather than end users.

interfaces/response.interfaces.ts:66

message

string

Human-readable message describing the response.

This short message explains the result of the operation and is suitable for displaying to end users. It should be clear, concise, and avoid technical details that aren't relevant to users.

interfaces/response.interfaces.ts:56

statusCode

HttpStatus

The HTTP status code for the response.

This corresponds to standard HTTP status codes (200, 400, 500, etc.) and provides a quick way for clients to determine the general category of the response (success, client error, server error).

See

interfaces/response.interfaces.ts:34


SuccessResponse

Defined in: interfaces/response.interfaces.ts:84

Interface for successful API responses that include data payload.

The SuccessResponse interface extends the base HttpResponse interface to include a data property containing the operation's result. This interface is used for all successful API responses that need to return data to the client.

The generic type parameter T allows for type-safe specification of the data structure being returned, ensuring consistency between backend definitions and frontend expectations.

SuccessResponse

See

HttpResponse Base interface for all responses

Extends

Properties

code

SuccessResponseCode

Application-specific success code.

This provides more granular information about the specific success case, allowing clients to handle different success scenarios distinctly if needed.

See

SuccessResponseCode Type for success response codes

HttpResponse.code

interfaces/response.interfaces.ts:105

description?

string

Optional detailed description of the response.

When provided, this field contains additional information about the response that might be useful for debugging or logging purposes. Unlike the message field, this can contain technical details and is primarily intended for developers rather than end users.

HttpResponse.description

interfaces/response.interfaces.ts:66

message

string

Human-readable message describing the response.

This short message explains the result of the operation and is suitable for displaying to end users. It should be clear, concise, and avoid technical details that aren't relevant to users.

HttpResponse.message

interfaces/response.interfaces.ts:56

statusCode

HttpSuccessStatus

The HTTP status code, which will be a success code (2xx).

For successful responses, this will typically be:

  • 200 (OK) for general success
  • 201 (Created) when a resource was successfully created
  • 204 (No Content) when an operation succeeded but returns no data

See

HttpSuccessStatus Enum of available success status codes

HttpResponse.statusCode

interfaces/response.interfaces.ts:95


UserInfo

Defined in: interfaces/user-info.interface.ts:38

Interface representing essential user information.

The UserInfo interface defines the core identifying information for a user that is commonly needed throughout the application. It contains only the essential properties needed to identify and display basic user information, without including sensitive or authentication-related data.

This interface is designed to be embedded within other entities for tracking user associations, such as who created or modified a record. It's a lightweight alternative to embedding or referencing the complete user entity.

Common use cases:

  • Audit trails for entity creation and modification
  • Activity logs showing which user performed an action
  • User attribution in collaborative features
  • Display of user information in UI components

See

  • Model Uses this interface for tracking entity ownership and changes
  • EntityId Type used for the user identifier

Example

// Example of a blog post entity using UserInfo
interface BlogPost {
  id: EntityId;
  title: string;
  content: string;
  author: UserInfo; // The user who wrote the post
  lastEditedBy?: UserInfo; // The user who last edited the post
}

Properties

firstName

string

The user's