API Reference
TypeScript Types
Complete TypeScript type definitions for Insolitum Universe modules, marketplace, and subscriptions.
TypeScript Types
All types are available from @insolitum/types. For partner modules using the starter template, types are embedded in the module code.
Module Types
interface Module {
id: string;
name: string;
slug: ModuleSlug;
description: string;
icon: string;
version: string;
is_active: boolean;
pricing: ModulePricing;
}
type BuiltInModuleSlug =
| 'lexshift'
| 'neurosense'
| 'waterandice'
| 'production'
| 'gamification'
| 'agenda'
| 'provisio'
| 'fabrica'
| 'nexus';
// Accepts both built-in and dynamic (partner) slugs
type ModuleSlug = BuiltInModuleSlug | (string & {});
interface ModulePricing {
monthly: number;
yearly: number;
perpetual: number;
currency: string;
tiers: PricingTier[];
}
interface PricingTier {
name: string;
price: number;
features: string[];
limits: Record<string, number>;
}Module Configuration
interface ModuleConfig {
slug: ModuleSlug;
name: string;
url: string;
remoteName: string;
exposedModule: string;
}
interface ModuleRegistryEntry {
id: string;
slug: string;
name: string;
deploy_url: string;
icon?: string;
description?: string;
is_builtin: boolean;
category?: string;
version?: string;
}Subscription Types
interface ModuleSubscription {
id: string;
organization_id: string;
module_id: string;
plan: string;
status: SubscriptionStatus;
current_period_start: string;
current_period_end: string;
created_at: string;
}
type SubscriptionStatus =
| 'active'
| 'trialing'
| 'past_due'
| 'canceled'
| 'unpaid';Marketplace Types
type ModuleCategory =
| 'hr' | 'iot' | 'production' | 'finance'
| 'analytics' | 'communication' | 'compliance'
| 'ai' | 'other';
type ModuleAuthorType = 'internal' | 'partner';
type ModuleSubmissionStatus =
| 'draft' | 'submitted' | 'in_review'
| 'changes_requested' | 'approved'
| 'rejected' | 'published' | 'suspended';
interface MarketplaceModule {
id: string;
name: string;
description: string;
long_description?: string;
icon: string;
version: string;
category: ModuleCategory;
tags: string[];
status: 'active' | 'beta' | 'deprecated';
is_public: boolean;
author_type: ModuleAuthorType;
author_organization_id?: string;
submission_status: ModuleSubmissionStatus;
deploy_url?: string;
screenshots: string[];
featured: boolean;
total_installs: number;
avg_rating: number;
review_count: number;
price_starter: number;
price_professional: number;
price_enterprise: number;
price_perpetual: number;
revenue_share_percent: number;
min_shell_version: string;
changelog: ChangelogEntry[];
}
interface ChangelogEntry {
version: string;
date: string;
changes: string[];
}Event Types
interface NatsEvent<T = unknown> {
subject: string;
data: T;
timestamp: string;
}
interface TelemetryReading {
device_id: string;
sensor_id: string;
tenant_id: string;
temperature?: number;
humidity?: number;
battery?: number;
rssi?: number;
timestamp: string;
}
interface AlertEvent {
id: string;
tenant_id: string;
device_id: string;
type: 'temperature_high' | 'temperature_low' | 'humidity_high'
| 'humidity_low' | 'battery_low' | 'device_offline' | 'custom';
severity: 'info' | 'warning' | 'critical';
message: string;
value?: number;
threshold?: number;
created_at: string;
}
interface ModuleEvent {
module_id: string;
tenant_id: string;
event_type: string;
payload: Record<string, unknown>;
timestamp: string;
}Validation Types
interface ValidationResult {
passed: boolean;
score: number; // 0-100
checks: ValidationCheck[];
}
interface ValidationCheck {
id: string;
name: string;
category: 'security' | 'performance' | 'accessibility'
| 'compatibility' | 'quality';
status: 'passed' | 'failed' | 'warning' | 'skipped';
message: string;
details?: string;
}
interface ReviewChecklist {
security_scan_passed: boolean;
performance_acceptable: boolean;
accessibility_compliant: boolean;
documentation_complete: boolean;
screenshots_provided: boolean;
privacy_policy_provided: boolean;
no_malicious_code: boolean;
api_contract_valid: boolean;
branding_guidelines_met: boolean;
tested_with_shell: boolean;
}