JSPM

@saas-platform/shared-types

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 5
    • Score
      100M100P100Q24439F
    • License MIT

    Common TypeScript interfaces and types for Multi-Tenant SaaS Platform

    Package Exports

    • @saas-platform/shared-types
    • @saas-platform/shared-types/dist/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@saas-platform/shared-types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @saas-platform/shared-types

    Common TypeScript interfaces and types for the Multi-Tenant SaaS Platform.

    Installation

    npm install @saas-platform/shared-types

    Usage

    import { User, Tenant, ApiResponse, UserCreatedEvent } from '@saas-platform/shared-types';
    
    // Use types in your service
    const user: User = {
      id: '123',
      tenantId: 'tenant-456',
      email: 'user@example.com',
      status: UserStatus.ACTIVE,
      // ... other properties
    };
    
    // API response formatting
    const response: ApiResponse<User> = {
      success: true,
      data: user,
      metadata: {
        requestId: 'req-123',
        timestamp: new Date().toISOString(),
        version: '1.0.0',
        service: 'user-service'
      }
    };

    Available Types

    Core Types

    • UUID, TenantId, UserId, ApplicationId
    • Status, Environment, ErrorCode
    • PaginationParams, PaginationMeta

    API Types

    • ApiRequest<T>, ApiResponse<T>
    • PaginatedResponse<T>, ErrorResponse
    • ValidationError, RequestContext

    Authentication Types

    • AccessTokenPayload, RefreshTokenPayload
    • UserSession, AuthContext
    • DeviceType, LoginMethod, MFASetup

    User Types

    • User, UserProfile, UserGroup
    • UserDepartment, CreateUserRequest
    • UserStatus, GroupMemberStatus

    Tenant Types

    • Application, Tenant, Plan
    • TenantProfile, Role, RoleMaster
    • ApplicationStatus, TenantStatus, PlanType

    Billing Types

    • TenantBilling, Invoice, PaymentTransaction
    • UsageBilling, InvoiceLineItem
    • SubscriptionType, SubscriptionStatus

    Branding Types

    • BrandingSettings, SEOSettings
    • ThemeMode, LayoutStyle, ButtonStyle
    • ColorPalette, FontConfiguration

    Event Types

    • BaseEvent<T>, EventHandler<T>
    • User events: UserCreatedEvent, UserUpdatedEvent
    • Tenant events: TenantCreatedEvent, TenantPlanChangedEvent
    • Billing events: SubscriptionCreatedEvent, PaymentSucceededEvent

    Database Types

    • DatabaseConfig, PoolConfig
    • BaseRepository<T>, TenantAwareRepository<T>
    • Migration, TransactionContext

    Development

    # Build the package
    npm run build
    
    # Watch for changes
    npm run build:watch
    
    # Lint code
    npm run lint
    
    # Format code
    npm run format

    License

    MIT

    saas-platform-shared-types

    saas-platform-shared-types

    saas-platform-shared-types