Skip to content

Hub & Commerce Types

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;
}
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;
}
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>;
}
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;
}
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 };
}
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;
}

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;
}

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;
}

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[];
}

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;
}