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-typesUsage
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,ApplicationIdStatus,Environment,ErrorCodePaginationParams,PaginationMeta
API Types
ApiRequest<T>,ApiResponse<T>PaginatedResponse<T>,ErrorResponseValidationError,RequestContext
Authentication Types
AccessTokenPayload,RefreshTokenPayloadUserSession,AuthContextDeviceType,LoginMethod,MFASetup
User Types
User,UserProfile,UserGroupUserDepartment,CreateUserRequestUserStatus,GroupMemberStatus
Tenant Types
Application,Tenant,PlanTenantProfile,Role,RoleMasterApplicationStatus,TenantStatus,PlanType
Billing Types
TenantBilling,Invoice,PaymentTransactionUsageBilling,InvoiceLineItemSubscriptionType,SubscriptionStatus
Branding Types
BrandingSettings,SEOSettingsThemeMode,LayoutStyle,ButtonStyleColorPalette,FontConfiguration
Event Types
BaseEvent<T>,EventHandler<T>- User events:
UserCreatedEvent,UserUpdatedEvent - Tenant events:
TenantCreatedEvent,TenantPlanChangedEvent - Billing events:
SubscriptionCreatedEvent,PaymentSucceededEvent
Database Types
DatabaseConfig,PoolConfigBaseRepository<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 formatLicense
MIT