{"version":3,"file":"workspace-frXkQhDr.js","sources":["../../../shared/src/model/workspace.ts"],"sourcesContent":["import { Model, Ref } from \"./model\";\nimport { Media, MediaBase, MediaDAO } from \"./media\";\nimport { WorkspaceAccessRankKind } from \"./workspace-access\";\nimport { Link, LinkBase, LinkDAO } from \"./link\";\nimport { PlanCurrencyKind, PlanIntervalKind, PlanKind, SubscriptionStatusKind } from \"../types/plan\";\nimport { FeatureMap } from \"./feature\";\nimport { AIActionContextBase } from \"../types/ai-action-context\";\n\nexport const WORKSPACE_KINDS = [\"company\", \"personal\"] as const;\nexport type WorkspaceKind = (typeof WORKSPACE_KINDS)[number];\n\nexport const UTM_PARAMETERS = [\"utm_source\", \"utm_medium\", \"utm_campaign\", \"utm_content\", \"utm_term\"] as const;\nexport type UTMParameters = Partial & { referer: string }>;\n\nexport interface MsTenant {\n\tid: string;\n\trank: WorkspaceAccessRankKind;\n\tname?: string;\n}\n\nexport interface WorkspaceData {\n\tmsTenant?: MsTenant;\n\tkind?: WorkspaceKind;\n\taiContext?: AIActionContextBase;\n\tdisableAnalytics?: boolean;\n\tuseLocalAI?: boolean;\n\tinitialReferer?: UTMParameters;\n}\n\nexport interface WorkspaceStats {\n\tmembers: number;\n\tseats?: number;\n}\n\nexport interface WorkspaceBase extends Model {\n\t__entity?: \"Workspace\";\n\n\tname?: string;\n\tdescription?: string;\n\tdata?: WorkspaceData;\n\n\tlogo?: Ref;\n\tlink: Ref;\n}\n\nexport interface Workspace extends WorkspaceBase {\n\tlogo?: Ref;\n\trank?: WorkspaceAccessRankKind;\n\tlink: Ref;\n\n\tstats?: WorkspaceStats;\n\n\tplan?: PlanKind;\n\tfeatures?: FeatureMap;\n\tsubscriptionStatus?: SubscriptionStatusKind;\n}\n\nexport interface WorkspaceDAO extends WorkspaceBase {\n\tlogo?: Ref;\n\tlink: Ref;\n\n\tsubscription?: WorkspaceSubscription;\n}\n\nexport interface WorkspaceSubscription {\n\tstripe?: {\n\t\tcustomerId?: string;\n\t\tsubscriptionId?: string;\n\t};\n\n\tfixedQuantity?: boolean;\n\tstatus?: SubscriptionStatusKind;\n\tplan?: PlanKind;\n\tcurrency?: PlanCurrencyKind;\n\tinterval?: PlanIntervalKind;\n\tquantity?: number;\n\tlatestPaidQuantity?: number;\n\tcancelled?: boolean;\n\tpaused?: boolean;\n}\n"],"names":["WORKSPACE_KINDS","UTM_PARAMETERS"],"mappings":"AAQa,MAAAA,EAAkB,CAAC,UAAW,UAAU,EAGxCC,EAAiB,CAAC,aAAc,aAAc,eAAgB,cAAe,UAAU"}