@hsuite/subscriptions-types v2.1.3
@hsuite/subscriptions-types
A comprehensive TypeScript library that provides type definitions and interfaces for managing subscription-related functionality in the HSuite ecosystem.
Overview
The @hsuite/subscriptions-types package is a core library that defines the type system for subscription management. It includes interfaces, enums, and models for handling subscription plans, billing periods, statuses, and related functionality, with specific support for Web3 and configuration management.
Installation
npm install @hsuite/subscriptions-typesDependencies
Peer Dependencies
@nestjs/common: ^10.4.2@nestjs/core: ^10.4.2
Dependencies
@hsuite/nestjs-swagger: 1.0.3@hsuite/smart-network-types: 2.0.0
Features
Subscription Plans
The library provides a standardized enumeration of subscription tiers:
BASIC: Entry-level plan with core featuresPREMIUM: Mid-tier plan with enhanced capabilitiesENTERPRISE: Top-tier plan with complete feature access and dedicated support
Billing Periods
Supported billing cycles include:
MONTHLY: Monthly billing and renewalYEARLY: Yearly billing and renewal
Subscription Statuses
Comprehensive status tracking for the entire subscription lifecycle:
PENDING: Awaiting processing or confirmationPROCESSING: Currently being processedMINTED: Subscription token minted on blockchainDELIVERED: Successfully delivered to userACTIVE: Currently active and in useCANCELLED: Terminated by user or systemEXPIRED: Reached end dateFAILED: Processing or activation failed
Namespaces
ISubscription
The main namespace that encapsulates all subscription-related functionality:
- Type definitions for subscription management
- Enums for plans, periodicities, and statuses
- Integration with Web3 and configuration subsystems
Web3 Integration
Dedicated namespace for blockchain-related subscription features:
- Web3 subscription entities
- Payment processing structures
- Analytics tracking
Configuration Management
Specialized namespace for subscription system configuration:
- Plan configurations
- System settings
- Entity configurations
Usage
import { ISubscription } from '@hsuite/subscriptions-types';
// Using subscription plans
const plan = ISubscription.IPlan.PREMIUM;
// Working with billing periods
const period = ISubscription.IPeriodicity.MONTHLY;
// Managing subscription status
const status = ISubscription.IStatus.ACTIVE;
// Web3 subscription handling
const web3Sub = new Subscription.Web3.Entity();
// Configuration management
const config = new Subscription.Config.Entity();Documentation
Detailed documentation can be generated using Compodoc:
npm run compodocFor documentation with coverage testing:
npm run compodoc:coverageVersion
Current version: 2.0.0
License
This package is part of the HSuite ecosystem. All rights reserved.