A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.
feat(app): custom types builder and usage
dextmorgna9ed99ae0872
diff --git a/flowsint-app/src/api/custom-type-service.ts b/flowsint-app/src/api/custom-type-service.tsnew file mode 100644index 00000000..c174cbdb--- /dev/null+++ b/flowsint-app/src/api/custom-type-service.ts@@ -0,0 +1,91 @@+import { fetchWithAuth } from './api'++export interface CustomType {+ id: string+ name: string+ owner_id: string+ schema: Record<string, any>+ status: 'draft' | 'published' | 'archived'+ checksum?: string+ description?: string+ created_at: string+ updated_at: string+}++export interface CustomTypeCreate {+ name: string+ schema: Record<string, any>+ description?: string+ status?: 'draft' | 'published'+}++export interface CustomTypeUpdate {+ name?: string+ schema?: Record<string, any>+ description?: string+ status?: 'draft' | 'published' | 'archived'+}++export interface ValidatePayload {+ payload: Record<string, any>+}++export interface ValidateResponse {+ valid: boolean+ errors?: string[]+}++export const customTypeService = {+ // List all custom types (optionally filtered by status)+ list: async (status?: string): Promise<CustomType[]> => {+ const url = status ? `/api/custom-types?status=${status}` : '/api/custom-types'+ return fetchWithAuth(url, {+ method: 'GET'+ })+ },++ // Get a specific custom type by ID+ getById: async (id: string): Promise<CustomType> => {+ return fetchWithAuth(`/api/custom-types/${id}`, {+ method: 'GET'+ })+ },++ // Get the raw JSON Schema for a custom type+ getSchema: async (id: string): Promise<Record<string, any>> => {+ return fetchWithAuth(`/api/custom-types/${id}/schema`, {+ method: 'GET'+ })+ },++ // Create a new custom type+ create: async (data: CustomTypeCreate): Promise<CustomType> => {+ return fetchWithAuth('/api/custom-types', {+ method: 'POST',+ body: JSON.stringify(data)+ })+ },++ // Update an existing custom type+ update: async (id: string, data: CustomTypeUpdate): Promise<CustomType> => {+ return fetchWithAuth(`/api/custom-types/${id}`, {+ method: 'PUT',+ body: JSON.stringify(data)+ })+ },++ // Delete a custom type+ delete: async (id: string): Promise<void> => {+ return fetchWithAuth(`/api/custom-types/${id}`, {+ method: 'DELETE'+ })+ },++ // Validate a payload against a custom type's schema+ validate: async (id: string, data: ValidatePayload): Promise<ValidateResponse> => {+ return fetchWithAuth(`/api/custom-types/${id}/validate`, {+ method: 'POST',+ body: JSON.stringify(data)+ })+ }+}diff --git a/flowsint-app/src/components/graphs/context-menu.tsx b/flowsint-app/src/components/graphs/context-menu.tsxindex ef83bc7e..c1851a4c 100644--- a/flowsint-app/src/components/graphs/context-menu.tsx+++ b/flowsint-app/src/components/graphs/context-menu.tsx@@ -7,7 +7,7 @@ import { Button } from '@/components/ui/button'import { Input } from '@/components/ui/input'import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs'import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'-import { FileCode2, Search, Info, Zap } from 'lucide-react'+import { FileCode2, Search, Info, Zap, BadgeCheck, BadgeAlert } from 'lucide-react'import { Transform, Flow, GraphNode } from '@/types'import { useLaunchFlow } from '@/hooks/use-launch-flow'import { useLaunchTransform } from '@/hooks/use-launch-transform'@@ -173,8 +173,8 @@ export default function ContextMenu({><Zap className="h-4 w-4 text-muted-foreground flex-shrink-0" /><div className="flex-1 min-w-0">- <p className="text-sm font-medium truncate">- {transform.name || '(Unnamed transform)'}+ <p className="text-sm font-medium flex gap-1 items-center truncate">+ <span>{transform.wobblyType ? <BadgeAlert className='h-3 w-3 text-orange-400' /> : <BadgeCheck className='h-3 w-3 text-green-400' />} </span> {transform.name || '(Unnamed transform)'}</p>{transform.description && (<p className="text-xs text-muted-foreground truncate">@@ -243,8 +243,8 @@ export default function ContextMenu({><FileCode2 className="h-4 w-4 text-muted-foreground flex-shrink-0" /><div className="flex-1 min-w-0">- <p className="text-sm font-medium truncate">- {flow.name || '(Unnamed flow)'}+ <p className="flex items-center gap-1 text-sm font-medium truncate">+ <span>{flow.wobblyType ? <BadgeAlert className='h-3 w-3 text-orange-400' /> : <BadgeCheck className='h-3 w-3 text-green-400' />} </span> {flow.name || '(Unnamed flow)'}</p>{flow.description && (<p className="text-xs text-muted-foreground truncate">{flow.description}</p>diff --git a/flowsint-app/src/components/layout/secondary-navigation.tsx b/flowsint-app/src/components/layout/secondary-navigation.tsxindex 31c442f3..581771ef 100644--- a/flowsint-app/src/components/layout/secondary-navigation.tsx+++ b/flowsint-app/src/components/layout/secondary-navigation.tsx@@ -47,7 +47,7 @@ const SecondaryNavigation = memo(() => {</div>)}- return <div>secondary-navigation</div>+ return null})export default SecondaryNavigationdiff --git a/flowsint-app/src/components/layout/sidebar.tsx b/flowsint-app/src/components/layout/sidebar.tsxindex f4acaef0..fa1f3872 100644--- a/flowsint-app/src/components/layout/sidebar.tsx+++ b/flowsint-app/src/components/layout/sidebar.tsx@@ -1,4 +1,4 @@-import { Home, Lock, type LucideIcon, PanelLeft, Workflow } from 'lucide-react'+import { Home, Lock, type LucideIcon, PanelLeft, Workflow, Shapes } from 'lucide-react'import { Link } from '@tanstack/react-router'import { useLayoutStore } from '@/stores/layout-store'import { Button } from '../ui/button'@@ -19,6 +19,7 @@ export const Sidebar = memo(() => {const navItems: NavItem[] = [{ icon: Home, label: 'Dashboard', href: '/dashboard/' },{ icon: Workflow, label: 'Flows', href: '/dashboard/flows' },+ { icon: Shapes, label: 'Custom types', href: '/dashboard/custom-types' },{ icon: Lock, label: 'Vault', href: '/dashboard/vault' }]diff --git a/flowsint-app/src/components/layout/sketch-selector.tsx b/flowsint-app/src/components/layout/sketch-selector.tsxindex 934bb534..2e1905eb 100644--- a/flowsint-app/src/components/layout/sketch-selector.tsx+++ b/flowsint-app/src/components/layout/sketch-selector.tsx@@ -23,6 +23,7 @@ export default function CaseSelector() {const { data: investigation, isLoading: isLoadingInvestigation } = useQuery({queryKey: queryKeys.sketches.dashboard(investigationId as string),queryFn: () => investigationService.getById(investigationId as string),+ enabled: !!investigationId,refetchOnWindowFocus: true})diff --git a/flowsint-app/src/routeTree.gen.ts b/flowsint-app/src/routeTree.gen.tsindex d2608acf..3be142c4 100644--- a/flowsint-app/src/routeTree.gen.ts+++ b/flowsint-app/src/routeTree.gen.ts@@ -20,7 +20,9 @@ import { Route as AuthDashboardVaultRouteImport } from './routes/_auth.dashboardimport { Route as AuthDashboardToolsRouteImport } from './routes/_auth.dashboard.tools'import { Route as AuthDashboardInvestigationsIndexRouteImport } from './routes/_auth.dashboard.investigations.index'import { Route as AuthDashboardFlowsIndexRouteImport } from './routes/_auth.dashboard.flows.index'+import { Route as AuthDashboardCustomTypesIndexRouteImport } from './routes/_auth.dashboard.custom-types.index'import { Route as AuthDashboardFlowsFlowIdRouteImport } from './routes/_auth.dashboard.flows.$flowId'+import { Route as AuthDashboardCustomTypesIdRouteImport } from './routes/_auth.dashboard.custom-types.$id'import { Route as AuthDashboardInvestigationsInvestigationIdIndexRouteImport } from './routes/_auth.dashboard.investigations.$investigationId.index'import { Route as AuthDashboardInvestigationsInvestigationIdTypeIdRouteImport } from './routes/_auth.dashboard.investigations.$investigationId.$type.$id'@@ -79,12 +81,24 @@ const AuthDashboardFlowsIndexRoute = AuthDashboardFlowsIndexRouteImport.update({path: '/flows/',getParentRoute: () => AuthDashboardRoute,} as any)+const AuthDashboardCustomTypesIndexRoute =+ AuthDashboardCustomTypesIndexRouteImport.update({+ id: '/custom-types/',+ path: '/custom-types/',+ getParentRoute: () => AuthDashboardRoute,+ } as any)const AuthDashboardFlowsFlowIdRoute =AuthDashboardFlowsFlowIdRouteImport.update({id: '/flows/$flowId',path: '/flows/$flowId',getParentRoute: () => AuthDashboardRoute,} as any)+const AuthDashboardCustomTypesIdRoute =+ AuthDashboardCustomTypesIdRouteImport.update({+ id: '/custom-types/$id',+ path: '/custom-types/$id',+ getParentRoute: () => AuthDashboardRoute,+ } as any)const AuthDashboardInvestigationsInvestigationIdIndexRoute =AuthDashboardInvestigationsInvestigationIdIndexRouteImport.update({id: '/investigations/$investigationId/',@@ -107,7 +121,9 @@ export interface FileRoutesByFullPath {'/dashboard/tools': typeof AuthDashboardToolsRoute'/dashboard/vault': typeof AuthDashboardVaultRoute'/dashboard/': typeof AuthDashboardIndexRoute+ '/dashboard/custom-types/$id': typeof AuthDashboardCustomTypesIdRoute'/dashboard/flows/$flowId': typeof AuthDashboardFlowsFlowIdRoute+ '/dashboard/custom-types': typeof AuthDashboardCustomTypesIndexRoute'/dashboard/flows': typeof AuthDashboardFlowsIndexRoute'/dashboard/investigations': typeof AuthDashboardInvestigationsIndexRoute'/dashboard/investigations/$investigationId': typeof AuthDashboardInvestigationsInvestigationIdIndexRoute@@ -121,7 +137,9 @@ export interface FileRoutesByTo {'/dashboard/tools': typeof AuthDashboardToolsRoute'/dashboard/vault': typeof AuthDashboardVaultRoute'/dashboard': typeof AuthDashboardIndexRoute+ '/dashboard/custom-types/$id': typeof AuthDashboardCustomTypesIdRoute'/dashboard/flows/$flowId': typeof AuthDashboardFlowsFlowIdRoute+ '/dashboard/custom-types': typeof AuthDashboardCustomTypesIndexRoute'/dashboard/flows': typeof AuthDashboardFlowsIndexRoute'/dashboard/investigations': typeof AuthDashboardInvestigationsIndexRoute'/dashboard/investigations/$investigationId': typeof AuthDashboardInvestigationsInvestigationIdIndexRoute@@ -138,7 +156,9 @@ export interface FileRoutesById {'/_auth/dashboard/tools': typeof AuthDashboardToolsRoute'/_auth/dashboard/vault': typeof AuthDashboardVaultRoute'/_auth/dashboard/': typeof AuthDashboardIndexRoute+ '/_auth/dashboard/custom-types/$id': typeof AuthDashboardCustomTypesIdRoute'/_auth/dashboard/flows/$flowId': typeof AuthDashboardFlowsFlowIdRoute+ '/_auth/dashboard/custom-types/': typeof AuthDashboardCustomTypesIndexRoute'/_auth/dashboard/flows/': typeof AuthDashboardFlowsIndexRoute'/_auth/dashboard/investigations/': typeof AuthDashboardInvestigationsIndexRoute'/_auth/dashboard/investigations/$investigationId/': typeof AuthDashboardInvestigationsInvestigationIdIndexRoute@@ -155,7 +175,9 @@ export interface FileRouteTypes {| '/dashboard/tools'| '/dashboard/vault'| '/dashboard/'+ | '/dashboard/custom-types/$id'| '/dashboard/flows/$flowId'+ | '/dashboard/custom-types'| '/dashboard/flows'| '/dashboard/investigations'| '/dashboard/investigations/$investigationId'@@ -169,7 +191,9 @@ export interface FileRouteTypes {| '/dashboard/tools'| '/dashboard/vault'| '/dashboard'+ | '/dashboard/custom-types/$id'| '/dashboard/flows/$flowId'+ | '/dashboard/custom-types'| '/dashboard/flows'| '/dashboard/investigations'| '/dashboard/investigations/$investigationId'@@ -185,7 +209,9 @@ export interface FileRouteTypes {| '/_auth/dashboard/tools'| '/_auth/dashboard/vault'| '/_auth/dashboard/'+ | '/_auth/dashboard/custom-types/$id'| '/_auth/dashboard/flows/$flowId'+ | '/_auth/dashboard/custom-types/'| '/_auth/dashboard/flows/'| '/_auth/dashboard/investigations/'| '/_auth/dashboard/investigations/$investigationId/'@@ -279,6 +305,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof AuthDashboardFlowsIndexRouteImportparentRoute: typeof AuthDashboardRoute}+ '/_auth/dashboard/custom-types/': {+ id: '/_auth/dashboard/custom-types/'+ path: '/custom-types'+ fullPath: '/dashboard/custom-types'+ preLoaderRoute: typeof AuthDashboardCustomTypesIndexRouteImport+ parentRoute: typeof AuthDashboardRoute+ }'/_auth/dashboard/flows/$flowId': {id: '/_auth/dashboard/flows/$flowId'path: '/flows/$flowId'@@ -286,6 +319,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof AuthDashboardFlowsFlowIdRouteImportparentRoute: typeof AuthDashboardRoute}+ '/_auth/dashboard/custom-types/$id': {+ id: '/_auth/dashboard/custom-types/$id'+ path: '/custom-types/$id'+ fullPath: '/dashboard/custom-types/$id'+ preLoaderRoute: typeof AuthDashboardCustomTypesIdRouteImport+ parentRoute: typeof AuthDashboardRoute+ }'/_auth/dashboard/investigations/$investigationId/': {id: '/_auth/dashboard/investigations/$investigationId/'path: '/investigations/$investigationId'@@ -307,7 +347,9 @@ interface AuthDashboardRouteChildren {AuthDashboardToolsRoute: typeof AuthDashboardToolsRouteAuthDashboardVaultRoute: typeof AuthDashboardVaultRouteAuthDashboardIndexRoute: typeof AuthDashboardIndexRoute+ AuthDashboardCustomTypesIdRoute: typeof AuthDashboardCustomTypesIdRouteAuthDashboardFlowsFlowIdRoute: typeof AuthDashboardFlowsFlowIdRoute+ AuthDashboardCustomTypesIndexRoute: typeof AuthDashboardCustomTypesIndexRouteAuthDashboardFlowsIndexRoute: typeof AuthDashboardFlowsIndexRouteAuthDashboardInvestigationsIndexRoute: typeof AuthDashboardInvestigationsIndexRouteAuthDashboardInvestigationsInvestigationIdIndexRoute: typeof AuthDashboardInvestigationsInvestigationIdIndexRoute@@ -318,7 +360,9 @@ const AuthDashboardRouteChildren: AuthDashboardRouteChildren = {AuthDashboardToolsRoute: AuthDashboardToolsRoute,AuthDashboardVaultRoute: AuthDashboardVaultRoute,AuthDashboardIndexRoute: AuthDashboardIndexRoute,+ AuthDashboardCustomTypesIdRoute: AuthDashboardCustomTypesIdRoute,AuthDashboardFlowsFlowIdRoute: AuthDashboardFlowsFlowIdRoute,+ AuthDashboardCustomTypesIndexRoute: AuthDashboardCustomTypesIndexRoute,AuthDashboardFlowsIndexRoute: AuthDashboardFlowsIndexRoute,AuthDashboardInvestigationsIndexRoute: AuthDashboardInvestigationsIndexRoute,AuthDashboardInvestigationsInvestigationIdIndexRoute:diff --git a/flowsint-app/src/routes/_auth.dashboard.custom-types.$id.tsx b/flowsint-app/src/routes/_auth.dashboard.custom-types.$id.tsxnew file mode 100644index 00000000..849463f6--- /dev/null+++ b/flowsint-app/src/routes/_auth.dashboard.custom-types.$id.tsx@@ -0,0 +1,557 @@+import { createFileRoute, useNavigate } from '@tanstack/react-router'+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'+import { useState, useEffect } from 'react'+import { Button } from '@/components/ui/button'+import { Input } from '@/components/ui/input'+import { Label } from '@/components/ui/label'+import { Textarea } from '@/components/ui/textarea'+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'+import { customTypeService, CustomType } from '@/api/custom-type-service'+import { toast } from 'sonner'+import { ArrowLeft, Save, Plus, Trash2, AlertCircle, ChevronDown, ChevronRight } from 'lucide-react'+import { Badge } from '@/components/ui/badge'+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'+import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'+import { Switch } from '@/components/ui/switch'+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from '@/components/ui/table'+import {+ Collapsible,+ CollapsibleContent,+ CollapsibleTrigger,+} from '@/components/ui/collapsible'++export const Route = createFileRoute('/_auth/dashboard/custom-types/$id')({+ component: CustomTypeEditor+})++interface SchemaField {+ id: string+ key: string+ title: string+ type: string+ format?: string+ description?: string+ required: boolean+}++function CustomTypeEditor() {+ const { id } = Route.useParams()+ const navigate = useNavigate()+ const queryClient = useQueryClient()+ const isNew = id === 'new'++ // Form state+ const [name, setName] = useState('')+ const [description, setDescription] = useState('')+ const [status, setStatus] = useState<'draft' | 'published'>('draft')+ const [fields, setFields] = useState<SchemaField[]>([])+ const [expandedFields, setExpandedFields] = useState<Set<string>>(new Set())++ // Load existing type if editing+ const { data: existingType, isLoading } = useQuery<CustomType>({+ queryKey: ['custom-type', id],+ queryFn: () => customTypeService.getById(id),+ enabled: !isNew+ })++ useEffect(() => {+ if (existingType) {+ setName(existingType.name)+ setDescription(existingType.description || '')+ setStatus(existingType.status === 'archived' ? 'draft' : existingType.status)+ parseSchemaToFields(existingType.schema)+ } else if (isNew) {+ // Start with one empty field+ addField()+ }+ }, [existingType, isNew])++ // Parse JSON Schema to fields array+ const parseSchemaToFields = (schema: any) => {+ const properties = schema.properties || {}+ const required = schema.required || []+ const parsedFields: SchemaField[] = Object.entries(properties).map(([key, value]: [string, any]) => ({+ id: Math.random().toString(36).substr(2, 9),+ key,+ title: value.title || key,+ type: value.type || 'string',+ format: value.format,+ description: value.description,+ required: required.includes(key)+ }))+ setFields(parsedFields)+ }++ // Convert fields array to JSON Schema+ const fieldsToSchema = () => {+ const properties: any = {}+ const required: string[] = []++ fields.forEach((field) => {+ if (!field.key.trim()) return // Skip empty keys++ const prop: any = {+ type: field.type,+ title: field.title || field.key,+ }+ if (field.description) prop.description = field.description+ if (field.format && field.format !== 'none') prop.format = field.format++ properties[field.key] = prop++ if (field.required) {+ required.push(field.key)+ }+ })++ return {+ title: name || 'MyCustomType',+ type: 'object',+ properties,+ required+ }+ }++ // Add new field+ const addField = () => {+ const newField: SchemaField = {+ id: Math.random().toString(36).substr(2, 9),+ key: '',+ title: '',+ type: 'string',+ required: false+ }+ setFields([...fields, newField])+ }++ // Update field+ const updateField = (id: string, updates: Partial<SchemaField>) => {+ setFields(fields.map(f => f.id === id ? { ...f, ...updates } : f))+ }++ // Delete field+ const deleteField = (id: string) => {+ setFields(fields.filter(f => f.id !== id))+ }++ // Toggle field expansion+ const toggleFieldExpansion = (fieldId: string) => {+ const newExpanded = new Set(expandedFields)+ if (newExpanded.has(fieldId)) {+ newExpanded.delete(fieldId)+ } else {+ newExpanded.add(fieldId)+ }+ setExpandedFields(newExpanded)+ }++ // Create mutation+ const createMutation = useMutation({+ mutationFn: (data: any) => customTypeService.create(data),+ onSuccess: () => {+ queryClient.invalidateQueries({ queryKey: ['custom-types'] })+ toast.success('Custom type created successfully')+ navigate({ to: '/dashboard/custom-types' })+ },+ onError: (error: Error) => {+ toast.error(`Failed to create custom type: ${error.message}`)+ }+ })++ // Update mutation+ const updateMutation = useMutation({+ mutationFn: (data: any) => customTypeService.update(id, data),+ onSuccess: () => {+ queryClient.invalidateQueries({ queryKey: ['custom-types'] })+ queryClient.invalidateQueries({ queryKey: ['custom-type', id] })+ toast.success('Custom type updated successfully')+ },+ onError: (error: Error) => {+ toast.error(`Failed to update custom type: ${error.message}`)+ }+ })++ const handleSave = () => {+ if (!name.trim()) {+ toast.error('Please enter a name for the custom type')+ return+ }++ // Check for duplicate or empty keys+ const keys = fields.map(f => f.key.trim()).filter(k => k)+ const uniqueKeys = new Set(keys)+ if (keys.length !== uniqueKeys.size) {+ toast.error('Field keys must be unique')+ return+ }++ if (fields.length === 0 || fields.every(f => !f.key.trim())) {+ toast.error('Please add at least one field')+ return+ }++ const schema = fieldsToSchema()++ const data = {+ name: name.trim(),+ description: description.trim() || undefined,+ schema,+ status+ }++ if (isNew) {+ createMutation.mutate(data)+ } else {+ updateMutation.mutate(data)+ }+ }++ if (!isNew && isLoading) {+ return (+ <div className="h-full w-full flex items-center justify-center">+ <div className="text-muted-foreground">Loading...</div>+ </div>+ )+ }++ return (+ <div className="h-full w-full overflow-y-auto bg-background">+ {/* Header */}+ <div className="sticky top-0 z-10 border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">+ <div className="max-w-7xl mx-auto px-8 py-4">+ <div className="flex items-center justify-between">+ <div className="flex items-center gap-4">+ <Button+ variant="ghost"+ size="sm"+ onClick={() => navigate({ to: '/dashboard/custom-types' })}+ >+ <ArrowLeft className="w-4 h-4 mr-2" />+ Back+ </Button>+ <div className="border-l pl-4">+ <h1 className="text-2xl font-bold text-foreground">+ {isNew ? 'New custom type' : name || 'Edit custom type'}+ </h1>+ <p className="text-sm text-muted-foreground">+ {isNew ? 'Define your custom data structure' : 'Update your custom type definition'}+ </p>+ </div>+ </div>+ <Button+ onClick={handleSave}+ disabled={createMutation.isPending || updateMutation.isPending}+ >+ <Save className="w-4 h-4 mr-2" />+ {isNew ? 'Create' : 'Save Changes'}+ </Button>+ </div>+ </div>+ </div>++ {/* Content */}+ <div className="max-w-7xl mx-auto p-8">+ <Tabs defaultValue="basic" className="w-full">+ <TabsList className="mb-6">+ <TabsTrigger value="basic">Basic Information</TabsTrigger>+ <TabsTrigger value="fields">+ Fields {fields.filter(f => f.key.trim()).length > 0 && (+ <Badge variant="secondary" className="ml-2">+ {fields.filter(f => f.key.trim()).length}+ </Badge>+ )}+ </TabsTrigger>+ <TabsTrigger value="preview">Preview</TabsTrigger>+ </TabsList>++ {/* Basic Info Tab */}+ <TabsContent value="basic" className="space-y-6">+ <Card>+ <CardHeader>+ <CardTitle>Type details</CardTitle>+ <CardDescription>+ Configure the basic properties of your custom type+ </CardDescription>+ </CardHeader>+ <CardContent className="space-y-4">+ <div className="grid grid-cols-2 gap-4">+ <div className="space-y-2">+ <Label htmlFor="name">Name *</Label>+ <Input+ id="name"+ value={name}+ onChange={(e) => setName(e.target.value)}+ placeholder="e.g., Contact, Asset, Threat Actor"+ />+ <p className="text-xs text-muted-foreground">+ A descriptive name for this type+ </p>+ </div>++ <div className="space-y-2">+ <Label htmlFor="status">Status</Label>+ <Select value={status} onValueChange={(v: any) => setStatus(v)}>+ <SelectTrigger>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="draft">Draft</SelectItem>+ <SelectItem value="published">Published</SelectItem>+ </SelectContent>+ </Select>+ <p className="text-xs text-muted-foreground">+ Only published types are available for use+ </p>+ </div>+ </div>++ <div className="space-y-2">+ <Label htmlFor="description">Description</Label>+ <Textarea+ id="description"+ value={description}+ onChange={(e) => setDescription(e.target.value)}+ placeholder="Describe what this custom type represents and how it should be used..."+ rows={4}+ />+ </div>+ </CardContent>+ </Card>+ </TabsContent>++ {/* Fields Tab */}+ <TabsContent value="fields" className="space-y-6">+ <Card>+ <CardHeader>+ <div className="flex items-center justify-between">+ <div>+ <CardTitle>Field Definitions</CardTitle>+ <CardDescription>+ Define the properties that make up this type+ </CardDescription>+ </div>+ <Button onClick={addField} size="sm">+ <Plus className="w-4 h-4 mr-2" />+ Add Field+ </Button>+ </div>+ </CardHeader>+ <CardContent>+ {fields.length === 0 ? (+ <div className="text-center py-12 border-2 border-dashed rounded-lg">+ <p className="text-muted-foreground mb-4">No fields defined yet</p>+ <Button onClick={addField} variant="outline" size="sm">+ <Plus className="w-4 h-4 mr-2" />+ Add Your First Field+ </Button>+ </div>+ ) : (+ <div className="space-y-3">+ {fields.map((field, index) => (+ <Collapsible+ key={field.id}+ open={expandedFields.has(field.id)}+ onOpenChange={() => toggleFieldExpansion(field.id)}+ >+ <div className="border rounded-lg">+ {/* Collapsed view */}+ <div className="flex items-center gap-3 p-3">+ <CollapsibleTrigger asChild>+ <Button variant="ghost" size="sm" className="h-8 w-8 p-0">+ {expandedFields.has(field.id) ? (+ <ChevronDown className="h-4 w-4" />+ ) : (+ <ChevronRight className="h-4 w-4" />+ )}+ </Button>+ </CollapsibleTrigger>++ <div className="flex-1 grid grid-cols-5 gap-3 items-center">+ <Input+ value={field.key}+ onChange={(e) => updateField(field.id, { key: e.target.value })}+ placeholder="field_key"+ className="h-9"+ />+ <Input+ value={field.title}+ onChange={(e) => updateField(field.id, { title: e.target.value })}+ placeholder="Display Name"+ className="h-9"+ />+ <Select+ value={field.type}+ onValueChange={(v) => updateField(field.id, { type: v })}+ >+ <SelectTrigger className="h-9">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="string">String</SelectItem>+ <SelectItem value="number">Number</SelectItem>+ <SelectItem value="integer">Integer</SelectItem>+ <SelectItem value="boolean">Boolean</SelectItem>+ <SelectItem value="array">Array</SelectItem>+ <SelectItem value="object">Object</SelectItem>+ </SelectContent>+ </Select>+ <Select+ value={field.format || 'none'}+ onValueChange={(v) => updateField(field.id, { format: v === 'none' ? undefined : v })}+ >+ <SelectTrigger className="h-9">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="none">-</SelectItem>+ <SelectItem value="email">Email</SelectItem>+ <SelectItem value="uri">URI</SelectItem>+ <SelectItem value="date">Date</SelectItem>+ <SelectItem value="date-time">DateTime</SelectItem>+ <SelectItem value="ipv4">IPv4</SelectItem>+ <SelectItem value="ipv6">IPv6</SelectItem>+ </SelectContent>+ </Select>+ <div className="flex items-center gap-2">+ <Switch+ checked={field.required}+ onCheckedChange={(checked) => updateField(field.id, { required: checked })}+ />+ <span className="text-xs text-muted-foreground">Required</span>+ </div>+ </div>++ <Button+ variant="ghost"+ size="sm"+ onClick={() => deleteField(field.id)}+ className="h-9 w-9 p-0"+ >+ <Trash2 className="w-4 h-4 text-muted-foreground hover:text-destructive" />+ </Button>+ </div>++ {/* Expanded view with description */}+ <CollapsibleContent>+ <div className="px-3 pb-3 pt-0 border-t mt-3">+ <div className="pt-3 space-y-2">+ <Label htmlFor={`desc-${field.id}`} className="text-xs">+ Description (optional)+ </Label>+ <Textarea+ id={`desc-${field.id}`}+ value={field.description || ''}+ onChange={(e) => updateField(field.id, { description: e.target.value })}+ placeholder="Describe this field's purpose and expected values..."+ rows={3}+ className="text-sm"+ />+ </div>+ </div>+ </CollapsibleContent>+ </div>+ </Collapsible>+ ))}++ <Button onClick={addField} variant="outline" className="w-full">+ <Plus className="w-4 h-4 mr-2" />+ New field+ </Button>+ </div>+ )}+ </CardContent>+ </Card>++ {fields.length > 0 && (+ <Card className="border-blue-200 bg-blue-50/50 dark:bg-blue-950/20 dark:border-blue-900">+ <CardContent className="pt-6">+ <div className="flex gap-3">+ <AlertCircle className="w-5 h-5 text-blue-600 dark:text-blue-400 flex-shrink-0 mt-0.5" />+ <div className="space-y-1">+ <p className="text-sm font-medium text-blue-900 dark:text-blue-100">+ Tips for defining fields+ </p>+ <ul className="text-xs text-blue-700 dark:text-blue-300 space-y-1">+ <li>• Field keys should be lowercase with underscores (e.g., email_address)</li>+ <li>• Display names are shown to users in forms and tables</li>+ <li>• Use formats to enable validation (e.g., email, date, ipv4)</li>+ <li>• Mark critical fields as required to ensure data quality</li>+ </ul>+ </div>+ </div>+ </CardContent>+ </Card>+ )}+ </TabsContent>++ {/* Preview Tab */}+ <TabsContent value="preview" className="space-y-6">+ <Card>+ <CardHeader>+ <CardTitle>Schema Preview</CardTitle>+ <CardDescription>+ JSON Schema representation of your custom type+ </CardDescription>+ </CardHeader>+ <CardContent>+ <pre className="p-4 bg-muted rounded-lg text-sm overflow-x-auto">+ {JSON.stringify(fieldsToSchema(), null, 2)}+ </pre>+ </CardContent>+ </Card>++ <Card>+ <CardHeader>+ <CardTitle>Field Summary</CardTitle>+ <CardDescription>+ Overview of all defined fields+ </CardDescription>+ </CardHeader>+ <CardContent>+ {fields.filter(f => f.key.trim()).length === 0 ? (+ <p className="text-sm text-muted-foreground">No fields defined yet</p>+ ) : (+ <div className="space-y-3">+ {fields.filter(f => f.key.trim()).map((field) => (+ <div key={field.id} className="flex items-start justify-between p-3 border rounded-lg">+ <div className="space-y-1">+ <div className="flex items-center gap-2">+ <span className="font-medium text-sm">{field.title || field.key}</span>+ {field.required && (+ <Badge variant="outline" className="text-xs">Required</Badge>+ )}+ </div>+ <p className="text-xs text-muted-foreground">Key: {field.key}</p>+ {field.description && (+ <p className="text-xs text-muted-foreground">{field.description}</p>+ )}+ </div>+ <div className="flex flex-col items-end gap-1">+ <Badge variant="secondary" className="text-xs">+ {field.type}+ </Badge>+ {field.format && (+ <Badge variant="outline" className="text-xs">+ {field.format}+ </Badge>+ )}+ </div>+ </div>+ ))}+ </div>+ )}+ </CardContent>+ </Card>+ </TabsContent>+ </Tabs>+ </div>+ </div>+ )+}diff --git a/flowsint-app/src/routes/_auth.dashboard.custom-types.index.tsx b/flowsint-app/src/routes/_auth.dashboard.custom-types.index.tsxnew file mode 100644index 00000000..8633bcca--- /dev/null+++ b/flowsint-app/src/routes/_auth.dashboard.custom-types.index.tsx@@ -0,0 +1,220 @@+import { createFileRoute } from '@tanstack/react-router'+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'+import { Button } from '@/components/ui/button'+import { PlusIcon, Clock, FileX, Trash2, Edit } from 'lucide-react'+import { useNavigate } from '@tanstack/react-router'+import { SkeletonList } from '@/components/shared/skeleton-list'+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'+import { formatDistanceToNow } from 'date-fns'+import { Badge } from '@/components/ui/badge'+import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'+import { customTypeService, CustomType } from '@/api/custom-type-service'+import ErrorState from '@/components/shared/error-state'+import { toast } from 'sonner'+import { useState } from 'react'+import { useConfirm } from '@/components/use-confirm-dialog'++export const Route = createFileRoute('/_auth/dashboard/custom-types/')({+ component: CustomTypesPage+})++const getStatusBadge = (status: string) => {+ const variants: Record<string, 'default' | 'secondary' | 'outline'> = {+ draft: 'outline',+ published: 'default',+ archived: 'secondary'+ }+ return (+ <Badge variant={variants[status] || 'default'}>+ {status}+ </Badge>+ )+}++function CustomTypesPage() {+ const navigate = useNavigate()+ const queryClient = useQueryClient()+ const { confirm } = useConfirm()+ const {+ data: customTypes,+ isLoading,+ error,+ refetch+ } = useQuery<CustomType[]>({+ queryKey: ['custom-types'],+ queryFn: () => customTypeService.list()+ })++ const deleteMutation = useMutation({+ mutationFn: (id: string) => customTypeService.delete(id),+ onSuccess: () => {+ queryClient.invalidateQueries({ queryKey: ['custom-types'] })+ toast.success('Custom type deleted successfully')+ },+ onError: (error: Error) => {+ toast.error(`Failed to delete custom type: ${error.message}`)+ }+ })++ const confirmDelete = (customType: CustomType) => {+ deleteMutation.mutate(customType.id)++ }+ const handleDelete = async (customType: CustomType) => {+ if (await confirm({ title: "Are you sure you want to delete this custom type ?", message: "this action is irreversible." }))+ confirmDelete(customType)+ }++++ // Group by status+ const draftTypes = customTypes?.filter((t) => t.status === 'draft') || []+ const publishedTypes = customTypes?.filter((t) => t.status === 'published') || []+ const archivedTypes = customTypes?.filter((t) => t.status === 'archived') || []++ return (+ <div className="h-full w-full overflow-y-auto bg-background">+ <div className="border-b border-border z-10">+ <div className="max-w-7xl mx-auto p-8">+ <div className="flex items-center justify-between">+ <div className="space-y-1">+ <h1 className="text-3xl font-bold text-foreground">Custom types</h1>+ <p className="text-muted-foreground">Create and manage your custom data types.</p>+ </div>+ <div className="flex items-center gap-2">+ <Button+ size="sm"+ // @ts-ignore+ onClick={() => navigate({ to: '/dashboard/custom-types/new' })}+ >+ <PlusIcon className="w-4 h-4 mr-2" />+ New custom type+ </Button>+ </div>+ </div>+ </div>+ </div>++ <div className="max-w-7xl mx-auto p-8 space-y-8">+ {isLoading ? (+ <div className="p-2">+ <SkeletonList rowCount={6} mode="card" />+ </div>+ ) : error ? (+ <ErrorState+ title="Couldn't load custom types"+ description="Something went wrong while fetching data. Please try again."+ error={error}+ onRetry={() => refetch()}+ />+ ) : !customTypes?.length ? (+ <div className="flex flex-col items-center justify-center py-12 text-center">+ <div className="rounded-full bg-muted/50 p-4 mb-4">+ <FileX className="w-8 h-8 text-muted-foreground" />+ </div>+ <h3 className="text-xl font-semibold mb-2">No custom types yet</h3>+ <p className="text-muted-foreground mb-6 max-w-md">+ Get started by creating your first custom type. Custom types allow you to define+ your own data structures for use in flows and investigations.+ </p>+ <Button onClick={() => navigate({+ // @ts-ignore+ to: '/dashboard/custom-types/new'+ })}>+ <PlusIcon className="w-4 h-4 mr-2" />+ Create your first custom type+ </Button>+ </div>+ ) : (+ <Tabs defaultValue="all" className="w-full">+ <TabsList>+ <TabsTrigger value="all">All ({customTypes.length})</TabsTrigger>+ <TabsTrigger value="published">Published ({publishedTypes.length})</TabsTrigger>+ <TabsTrigger value="draft">Drafts ({draftTypes.length})</TabsTrigger>+ <TabsTrigger value="archived">Archived ({archivedTypes.length})</TabsTrigger>+ </TabsList>++ <TabsContent value="all" className="mt-6">+ <CustomTypesList types={customTypes} onDelete={handleDelete} navigate={navigate} />+ </TabsContent>++ <TabsContent value="published" className="mt-6">+ <CustomTypesList types={publishedTypes} onDelete={handleDelete} navigate={navigate} />+ </TabsContent>++ <TabsContent value="draft" className="mt-6">+ <CustomTypesList types={draftTypes} onDelete={handleDelete} navigate={navigate} />+ </TabsContent>++ <TabsContent value="archived" className="mt-6">+ <CustomTypesList types={archivedTypes} onDelete={handleDelete} navigate={navigate} />+ </TabsContent>+ </Tabs>+ )}+ </div>+ </div>+ )+}++interface CustomTypesListProps {+ types: CustomType[]+ onDelete: (type: CustomType) => void+ navigate: any+}++function CustomTypesList({ types, onDelete, navigate }: CustomTypesListProps) {+ if (types.length === 0) {+ return (+ <div className="flex flex-col items-center justify-center py-12 text-center">+ <FileX className="w-12 h-12 text-muted-foreground mb-4" />+ <p className="text-muted-foreground">No custom types in this category</p>+ </div>+ )+ }++ return (+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">+ {types.map((customType) => (+ <Card key={customType.id} className="hover:border-primary/50 transition-colors">+ <CardHeader>+ <div className="flex items-start justify-between">+ <div className="space-y-1 flex-1">+ <CardTitle className="text-lg">{customType.name}</CardTitle>+ <CardDescription className="line-clamp-2">+ {customType.description || 'No description'}+ </CardDescription>+ </div>+ {getStatusBadge(customType.status)}+ </div>+ </CardHeader>+ <CardContent>+ <div className="flex items-center gap-2 text-sm text-muted-foreground mb-4">+ <Clock className="w-4 h-4" />+ <span>+ Updated {formatDistanceToNow(new Date(customType.updated_at), { addSuffix: true })}+ </span>+ </div>+ <div className="flex items-center gap-2">+ <Button+ variant="outline"+ size="sm"+ className="flex-1"+ onClick={() => navigate({ to: `/dashboard/custom-types/${customType.id}` })}+ >+ <Edit className="w-4 h-4 mr-2" />+ Edit+ </Button>+ <Button+ variant="outline"+ size="sm"+ onClick={() => onDelete(customType)}+ >+ <Trash2 className="w-4 h-4" />+ </Button>+ </div>+ </CardContent>+ </Card>+ ))}+ </div>+ )+}diff --git a/flowsint-app/src/styles.css b/flowsint-app/src/styles.cssindex d9cf88df..d00a3bf8 100644--- a/flowsint-app/src/styles.css+++ b/flowsint-app/src/styles.css@@ -440,7 +440,7 @@ html {--font-sans: Inter, sans-serif;--font-serif: Source Serif 4, serif;--font-mono: JetBrains Mono, monospace;- --radius: 0.280rem;+ --radius: 0.580rem;--shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);--shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);--shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);@@ -487,7 +487,7 @@ html {--font-sans: Inter, sans-serif;--font-serif: Source Serif 4, serif;--font-mono: JetBrains Mono, monospace;- --radius: 0.975rem;+ --radius: 0.580rem;--shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);--shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);--shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);@@ -716,165 +716,6 @@ html {font-weight: 700;}-:root {- --background: oklch(1.0000 0 0);- --foreground: oklch(0.2686 0 0);- --card: oklch(1.0000 0 0);- --card-foreground: oklch(0.2686 0 0);- --popover: oklch(1.0000 0 0);- --popover-foreground: oklch(0.2686 0 0);- --primary: oklch(0.6612 0.2003 37.74);- --primary-foreground: oklch(0 0 0);- --secondary: oklch(0.9670 0.0029 264.5419);- --secondary-foreground: oklch(0.4461 0.0263 256.8018);- --muted: oklch(0.9846 0.0017 247.8389);- --muted-foreground: oklch(0.5510 0.0234 264.3637);- --accent: oklch(0.9869 0.0214 95.2774);- --accent-foreground: oklch(0.4732 0.1247 46.2007);- --destructive: oklch(0.6368 0.2078 25.3313);- --destructive-foreground: oklch(1.0000 0 0);- --border: oklch(0.9276 0.0058 264.5313);- --input: oklch(0.9276 0.0058 264.5313);- --ring: oklch(0.7686 0.1647 70.0804);- --chart-1: oklch(0.7686 0.1647 70.0804);- --chart-2: oklch(0.6658 0.1574 58.3183);- --chart-3: oklch(0.5553 0.1455 48.9975);- --chart-4: oklch(0.4732 0.1247 46.2007);- --chart-5: oklch(0.4137 0.1054 45.9038);- --sidebar: oklch(0.9846 0.0017 247.8389);- --sidebar-foreground: oklch(0.2686 0 0);- --sidebar-primary: oklch(0.7686 0.1647 70.0804);- --sidebar-primary-foreground: oklch(1.0000 0 0);- --sidebar-accent: oklch(0.9869 0.0214 95.2774);- --sidebar-accent-foreground: oklch(0.4732 0.1247 46.2007);- --sidebar-border: oklch(0.9276 0.0058 264.5313);- --sidebar-ring: oklch(0.7686 0.1647 70.0804);- --font-sans: Inter, sans-serif;- --font-serif: Source Serif 4, serif;- --font-mono: JetBrains Mono, monospace;- --radius: .275rem;- --shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);- --shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);- --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);- --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);- --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 2px 4px -2px hsl(0 0% 0% / 0.10);- --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 4px 6px -2px hsl(0 0% 0% / 0.10);- --shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 8px 10px -2px hsl(0 0% 0% / 0.10);- --shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);- --tracking-normal: 0em;- --spacing: 0.25rem;-}--.dark {- --background: oklch(0.20 0 0);- --foreground: oklch(0.9219 0 0);- --card: oklch(0.2186 0 0);- --card-foreground: oklch(0.9219 0 0);- --popover: oklch(0.2186 0 0);- --popover-foreground: oklch(0.9219 0 0);- --primary: oklch(0.6612 0.2003 37.74);- --primary-foreground: oklch(0 0 0);- --secondary: oklch(0.2686 0 0);- --secondary-foreground: oklch(0.9219 0 0);- --muted: oklch(0.2686 0 0);- --muted-foreground: oklch(0.7155 0 0);- --accent: oklch(0.4732 0.1247 46.2007);- --accent-foreground: oklch(0.9243 0.1151 95.7459);- --destructive: oklch(0.6368 0.2078 25.3313);- --destructive-foreground: oklch(1.0000 0 0);- --border: oklch(0.3215 0 0);- --input: oklch(0.3715 0 0);- --ring: oklch(0.7686 0.1647 70.0804);- --chart-1: oklch(0.8369 0.1644 84.4286);- --chart-2: oklch(0.6658 0.1574 58.3183);- --chart-3: oklch(0.4732 0.1247 46.2007);- --chart-4: oklch(0.5553 0.1455 48.9975);- --chart-5: oklch(0.4732 0.1247 46.2007);- --sidebar: oklch(0.1684 0 0);- --sidebar-foreground: oklch(0.9219 0 0);- --sidebar-primary: oklch(0.7686 0.1647 70.0804);- --sidebar-primary-foreground: oklch(1.0000 0 0);- --sidebar-accent: oklch(0.4732 0.1247 46.2007);- --sidebar-accent-foreground: oklch(0.9243 0.1151 95.7459);- --sidebar-border: oklch(0.3715 0 0);- --sidebar-ring: oklch(0.7686 0.1647 70.0804);- --font-sans: Inter, sans-serif;- --font-serif: Source Serif 4, serif;- --font-mono: JetBrains Mono, monospace;- --radius: .275rem;- --shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);- --shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);- --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);- --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);- --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 2px 4px -2px hsl(0 0% 0% / 0.10);- --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 4px 6px -2px hsl(0 0% 0% / 0.10);- --shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 8px 10px -2px hsl(0 0% 0% / 0.10);- --shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);-}--@theme inline {- --color-background: var(--background);- --color-foreground: var(--foreground);- --color-card: var(--card);- --color-card-foreground: var(--card-foreground);- --color-popover: var(--popover);- --color-popover-foreground: var(--popover-foreground);- --color-primary: var(--primary);- --color-primary-foreground: var(--primary-foreground);- --color-secondary: var(--secondary);- --color-secondary-foreground: var(--secondary-foreground);- --color-muted: var(--muted);- --color-muted-foreground: var(--muted-foreground);- --color-accent: var(--accent);- --color-accent-foreground: var(--accent-foreground);- --color-destructive: var(--destructive);- --color-destructive-foreground: var(--destructive-foreground);- --color-border: var(--border);- --color-input: var(--input);- --color-ring: var(--ring);- --color-chart-1: var(--chart-1);- --color-chart-2: var(--chart-2);- --color-chart-3: var(--chart-3);- --color-chart-4: var(--chart-4);- --color-chart-5: var(--chart-5);- --color-sidebar: var(--sidebar);- --color-sidebar-foreground: var(--sidebar-foreground);- --color-sidebar-primary: var(--sidebar-primary);- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);- --color-sidebar-accent: var(--sidebar-accent);- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);- --color-sidebar-border: var(--sidebar-border);- --color-sidebar-ring: var(--sidebar-ring);-- --font-sans: var(--font-sans);- --font-mono: var(--font-mono);- --font-serif: var(--font-serif);-- --radius-sm: calc(var(--radius) - 4px);- --radius-md: calc(var(--radius) - 2px);- --radius-lg: var(--radius);- --radius-xl: calc(var(--radius) + 4px);-- --shadow-2xs: var(--shadow-2xs);- --shadow-xs: var(--shadow-xs);- --shadow-sm: var(--shadow-sm);- --shadow: var(--shadow);- --shadow-md: var(--shadow-md);- --shadow-lg: var(--shadow-lg);- --shadow-xl: var(--shadow-xl);- --shadow-2xl: var(--shadow-2xl);-}--body {- @apply m-0;- font-family:- -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',- 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;- -webkit-font-smoothing: antialiased;- -moz-osx-font-smoothing: grayscale;- letter-spacing: var(--tracking-normal);-}-.tr {display: flex;}@@ -985,163 +826,6 @@ pre {@apply rounded-2xl overflow-hidden bg-background border border-border;}--:root {- --background: oklch(1.0000 0 0);- --foreground: oklch(0.2101 0.0318 264.6645);- --card: oklch(1.0000 0 0);- --card-foreground: oklch(0.2101 0.0318 264.6645);- --popover: oklch(1.0000 0 0);- --popover-foreground: oklch(0.2101 0.0318 264.6645);- --primary: oklch(0.6716 0.1368 48.5130);- --primary-foreground: oklch(1.0000 0 0);- --secondary: oklch(0.5360 0.0398 196.0280);- --secondary-foreground: oklch(1.0000 0 0);- --muted: oklch(0.9670 0.0029 264.5419);- --muted-foreground: oklch(0.5510 0.0234 264.3637);- --accent: oklch(0.9491 0 0);- --accent-foreground: oklch(0.2101 0.0318 264.6645);- --destructive: oklch(0.6368 0.2078 25.3313);- --destructive-foreground: oklch(0.9851 0 0);- --border: oklch(0.9276 0.0058 264.5313);- --input: oklch(0.9276 0.0058 264.5313);- --ring: oklch(0.6716 0.1368 48.5130);- --chart-1: oklch(0.5940 0.0443 196.0233);- --chart-2: oklch(0.7214 0.1337 49.9802);- --chart-3: oklch(0.8721 0.0864 68.5474);- --chart-4: oklch(0.6268 0 0);- --chart-5: oklch(0.6830 0 0);- --sidebar: oklch(0.9670 0.0029 264.5419);- --sidebar-foreground: oklch(0.2101 0.0318 264.6645);- --sidebar-primary: oklch(0.6716 0.1368 48.5130);- --sidebar-primary-foreground: oklch(1.0000 0 0);- --sidebar-accent: oklch(1.0000 0 0);- --sidebar-accent-foreground: oklch(0.2101 0.0318 264.6645);- --sidebar-border: oklch(0.9276 0.0058 264.5313);- --sidebar-ring: oklch(0.6716 0.1368 48.5130);- --font-sans: Geist Mono, ui-monospace, monospace;- --font-serif: serif;- --font-mono: JetBrains Mono, monospace;- --radius: 0.280rem;- --shadow-2xs: 0px 1px 4px 0px hsl(0 0% 0% / 0.03);- --shadow-xs: 0px 1px 4px 0px hsl(0 0% 0% / 0.03);- --shadow-sm: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 1px 2px -1px hsl(0 0% 0% / 0.05);- --shadow: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 1px 2px -1px hsl(0 0% 0% / 0.05);- --shadow-md: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 2px 4px -1px hsl(0 0% 0% / 0.05);- --shadow-lg: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 4px 6px -1px hsl(0 0% 0% / 0.05);- --shadow-xl: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 8px 10px -1px hsl(0 0% 0% / 0.05);- --shadow-2xl: 0px 1px 4px 0px hsl(0 0% 0% / 0.13);- --tracking-normal: 0rem;- --spacing: 0.25rem;-}--.dark {- --background: oklch(0.20 0 0);- --foreground: oklch(0.8109 0 0);- --card: oklch(0.1822 0 0);- --card-foreground: oklch(0.8109 0 0);- --popover: oklch(0.1797 0.0043 308.1928);- --popover-foreground: oklch(0.8109 0 0);- --primary: oklch(0.7214 0.1337 49.9802);- --primary-foreground: oklch(0.1797 0.0043 308.1928);- --secondary: oklch(0.5940 0.0443 196.0233);- --secondary-foreground: oklch(0.1797 0.0043 308.1928);- --muted: oklch(0.2520 0 0);- --muted-foreground: oklch(0.6268 0 0);- --accent: oklch(0.3211 0 0);- --accent-foreground: oklch(0.8109 0 0);- --destructive: oklch(0.6368 0.2078 25.3313);- --destructive-foreground: oklch(0.1797 0.0043 308.1928);- --border: oklch(0.2520 0 0);- --input: oklch(0.2520 0 0);- --ring: oklch(0.7214 0.1337 49.9802);- --chart-1: oklch(0.5940 0.0443 196.0233);- --chart-2: oklch(0.7214 0.1337 49.9802);- --chart-3: oklch(0.8721 0.0864 68.5474);- --chart-4: oklch(0.6268 0 0);- --chart-5: oklch(0.6830 0 0);- --sidebar: oklch(0.1822 0 0);- --sidebar-foreground: oklch(0.8109 0 0);- --sidebar-primary: oklch(0.7214 0.1337 49.9802);- --sidebar-primary-foreground: oklch(0.1797 0.0043 308.1928);- --sidebar-accent: oklch(0.3211 0 0);- --sidebar-accent-foreground: oklch(0.8109 0 0);- --sidebar-border: oklch(0.2520 0 0);- --sidebar-ring: oklch(0.7214 0.1337 49.9802);- --font-sans: Geist Mono, ui-monospace, monospace;- --font-serif: serif;- --font-mono: JetBrains Mono, monospace;- --radius: 0.280rem;- --shadow-2xs: 0px 1px 4px 0px hsl(0 0% 0% / 0.03);- --shadow-xs: 0px 1px 4px 0px hsl(0 0% 0% / 0.03);- --shadow-sm: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 1px 2px -1px hsl(0 0% 0% / 0.05);- --shadow: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 1px 2px -1px hsl(0 0% 0% / 0.05);- --shadow-md: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 2px 4px -1px hsl(0 0% 0% / 0.05);- --shadow-lg: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 4px 6px -1px hsl(0 0% 0% / 0.05);- --shadow-xl: 0px 1px 4px 0px hsl(0 0% 0% / 0.05), 0px 8px 10px -1px hsl(0 0% 0% / 0.05);- --shadow-2xl: 0px 1px 4px 0px hsl(0 0% 0% / 0.13);-}--@theme inline {- --color-background: var(--background);- --color-foreground: var(--foreground);- --color-card: var(--card);- --color-card-foreground: var(--card-foreground);- --color-popover: var(--popover);- --color-popover-foreground: var(--popover-foreground);- --color-primary: var(--primary);- --color-primary-foreground: var(--primary-foreground);- --color-secondary: var(--secondary);- --color-secondary-foreground: var(--secondary-foreground);- --color-muted: var(--muted);- --color-muted-foreground: var(--muted-foreground);- --color-accent: var(--accent);- --color-accent-foreground: var(--accent-foreground);- --color-destructive: var(--destructive);- --color-destructive-foreground: var(--destructive-foreground);- --color-border: var(--border);- --color-input: var(--input);- --color-ring: var(--ring);- --color-chart-1: var(--chart-1);- --color-chart-2: var(--chart-2);- --color-chart-3: var(--chart-3);- --color-chart-4: var(--chart-4);- --color-chart-5: var(--chart-5);- --color-sidebar: var(--sidebar);- --color-sidebar-foreground: var(--sidebar-foreground);- --color-sidebar-primary: var(--sidebar-primary);- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);- --color-sidebar-accent: var(--sidebar-accent);- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);- --color-sidebar-border: var(--sidebar-border);- --color-sidebar-ring: var(--sidebar-ring);-- --font-sans: var(--font-sans);- --font-mono: var(--font-mono);- --font-serif: var(--font-serif);-- --radius-sm: calc(var(--radius) - 4px);- --radius-md: calc(var(--radius) - 2px);- --radius-lg: var(--radius);- --radius-xl: calc(var(--radius) + 4px);-- --shadow-2xs: var(--shadow-2xs);- --shadow-xs: var(--shadow-xs);- --shadow-sm: var(--shadow-sm);- --shadow: var(--shadow);- --shadow-md: var(--shadow-md);- --shadow-lg: var(--shadow-lg);- --shadow-xl: var(--shadow-xl);- --shadow-2xl: var(--shadow-2xl);-- --tracking-tighter: calc(var(--tracking-normal) - 0.05em);- --tracking-tight: calc(var(--tracking-normal) - 0.025em);- --tracking-normal: var(--tracking-normal);- --tracking-wide: calc(var(--tracking-normal) + 0.025em);- --tracking-wider: calc(var(--tracking-normal) + 0.05em);- --tracking-widest: calc(var(--tracking-normal) + 0.1em);-}-body {letter-spacing: var(--tracking-normal);}diff --git a/flowsint-app/src/types/flow.ts b/flowsint-app/src/types/flow.tsindex d58d55ef..e41be2b0 100644--- a/flowsint-app/src/types/flow.ts+++ b/flowsint-app/src/types/flow.ts@@ -12,6 +12,7 @@ export interface Flow {category: stringcreated_at: stringlast_updated_at: string+ wobblyType?: boolean}// ================================