Hub & Commerce Types
Hub Configuration
Section titled “Hub Configuration”File: src/lib/modules/hubs/types/hub.ts
interface HubConfig { schemaVersion: string; // SemVer id: string; handle: string; // Unique handle (e.g., "john-smith") name: string; status: 'active' | 'suspended' | 'archived'; isPublished: boolean;
identity: Identity; branding: Branding; theme: ThemeTokens; navigation: NavItem[]; pages: Page[]; apps: InstalledApp[]; commerce: Commerce; portfolio: PortfolioItem[]; contact: ContactConfig; seo: SiteSEO; domain: DomainConfig; payments: PaymentsConfig; integrations: Integrations;}Identity & Branding
Section titled “Identity & Branding”interface Identity { displayName: string; tagline?: string; ownerUserId: string; contact: Contact; social: Social;}
interface Branding { logo: ImageRef; favicon?: ImageRef; cover?: ImageRef;}
interface ImageRef { url: string; alt?: string; width?: number; height?: number;}Pages & Blocks
Section titled “Pages & Blocks”interface Page { id: string; title: string; slug: string; blocks: BlockInstance[]; seo?: PageSEO; visibility?: 'public' | 'private'; indexable?: boolean;}
interface BlockInstance { id: string; // UUID type: string; // e.g., "hero.with-image-reviews" version: number; props: Record<string, unknown>; meta?: Record<string, unknown>;}Commerce Types
Section titled “Commerce Types”interface Commerce { currency: string; services: Service[]; products: Product[]; bundles: Bundle[]; bookings: BookingConfig;}
interface Service { id: string; title: string; description: string; category: string; subcategory?: string; packages: ServicePackage[]; faqs: FAQ[]; media: MediaItem[]; status: 'published' | 'archived' | 'draft'; stripeProductId?: string;}
interface ServicePackage { id: string; tier: 'basic' | 'standard' | 'premium'; name: string; price: number; // In cents deliveryDays: number; revisions: number; deliverables: string[]; addOns?: AddOn[]; stripePriceId?: string;}
interface Product { id: string; name: string; description: string; price: number; media: MediaItem[]; variants?: ProductVariant[]; stripeProductId?: string;}Theme, SEO & Domain
Section titled “Theme, SEO & Domain”interface ThemeTokens { colors: Record<string, string>; typography: Record<string, string>; radius: string; spacing: string;}
interface SiteSEO { title?: string; description?: string; ogImage?: string;}
interface DomainConfig { customDomain?: string; subdomain?: string; sslStatus?: 'provisioning' | 'active' | 'error';}
interface PaymentsConfig { provider: 'stripe'; stripeAccountId?: string; chargesEnabled?: boolean; payoutsEnabled?: boolean;}
interface Integrations { ga4?: { measurementId: string }; plausible?: { domain: string }; zapier?: { webhookUrl: string };}Team Types
Section titled “Team Types”interface HubMember { userId: string; role: 'owner' | 'editor' | 'viewer' | 'billing'; joinedAt: Timestamp;}
interface HubInvitation { id: string; email: string; role: 'editor' | 'viewer' | 'billing'; status: 'pending' | 'accepted' | 'declined'; invitedBy: string; createdAt: Timestamp;}Order Types
Section titled “Order Types”File: src/lib/modules/orders/types/order.ts
interface Order { id: string; amountInCents: number; applicationFeeAmount: number; buyerId: string; sellerId: string; serviceId: string; packageId: string; checkoutSessionId: string; stripeAccountId: string; status: 'pending' | 'in_progress' | 'completed' | 'cancelled' | 'refunded'; disputeId?: string | null; createdAt: Timestamp; updatedAt: Timestamp;}
interface Dispute { id: string; orderId: string; reporterId: string; reporterRole: 'buyer' | 'seller'; description: string; evidence: DisputeEvidence[]; status: 'open' | 'in_review' | 'resolved'; resolution: 'fee_refunded' | 'handle_directly' | null; createdAt: Timestamp;}HyvFlow Types
Section titled “HyvFlow Types”File: src/lib/modules/hyvflow/types/
interface Workspace { id: string; name: string; status: EntityStatus; members: string[]; teams: string[]; color?: string; logo?: string;}
interface Portfolio { id: string; name: string; status: EntityStatus; members: string[]; workspaceId: string;}
interface Project { id: string; name: string; description?: string; status: EntityStatus; startDate?: Timestamp; dueDate?: Timestamp; price?: number; vision?: string; objectives?: string; risks?: string; scope?: string; requirements?: string; resources?: string; members: string[]; color?: string;}
interface Milestone { id: string; name: string; description?: string; status: EntityStatus; priority: 'Urgent' | 'High' | 'Normal' | 'Low'; arrayStatus: ArrayStatus[]; // Custom status columns arraySprints: Sprint[]; timeEstimate?: string; trackTime?: string;}
interface Task { id: string; name: string; milestoneId: string; status: TaskStatus; taskType: 'Milestone' | 'Task'; priority?: 'Urgent' | 'High' | 'Normal' | 'Low'; sprintId?: string; parentId?: string; // For subtasks startDate?: Timestamp; dueDate?: Timestamp; assignees?: string[]; tags?: string[]; files?: FilesTask[]; activities?: Activity[]; checklist?: ChecklistItem[]; relationships?: Relationship[]; urldependencies?: URLDependency[];}
interface Sprint { id: string; name: string; position: number; startDate?: Timestamp; endDate?: Timestamp;}Chat Types
Section titled “Chat Types”File: src/lib/modules/connect/types/chat.ts
interface ChatConversation { id: string; members: string[]; type: 'DIRECT' | 'GROUP' | 'ONE_TO_ONE' | 'ORDER' | 'SYSTEM'; status: 'Requested' | 'Accepted' | 'Declined' | 'Expired'; archived: boolean; pinned: boolean; messages: ChatMessage[];}
interface ChatMessage { id: string; text: string; senderId: string; reactions: Record<string, string[]>; mentions: string[]; readBy: string[]; createdAt: Timestamp; editedAt?: Timestamp; deletedFor?: string[];}Blog Types
Section titled “Blog Types”File: src/lib/modules/blogs/types/blog.ts
interface Blog { id?: string; title: string; slug: string; content: OutputData; // EditorJS format (stored as JSON string) status: 'draft' | 'published' | 'archived'; visibility: 'public' | 'private' | 'unlisted'; hubId: string; createdBy: string; seoKey?: string; seoTitle?: string; seoDescription?: string; createdAt?: Timestamp; updatedAt?: Timestamp; publishedAt?: Timestamp;}