A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.
feat: proper types
dextmorgnbdc30cfb0fee
diff --git a/backend/supabase/migrations/20250412163409_remote_schema.sql b/backend/supabase/migrations/20250412163409_remote_schema.sqlindex 29fe83d9..86e48ad7 100644--- a/backend/supabase/migrations/20250412163409_remote_schema.sql+++ b/backend/supabase/migrations/20250412163409_remote_schema.sql@@ -181,7 +181,7 @@ CREATE OR REPLACE FUNCTION "public"."update_investigation_last_updated"() RETURNEND IF;-- Si la mise à jour concerne une table liée, mettre à jour 'investigations' et 'projects' seulement si 10s sont écoulées- ELSIF TG_TABLE_NAME IN ('emails', 'individuals', 'relationships', 'physical_addresses', 'social_accounts', 'ip_addresses', 'phone_numbers') THEN+ ELSIF TG_TABLE_NAME IN ('emails', 'individuals', 'relationships', 'physical_addresses', 'social_accounts', 'ip_addresses', 'phones') THENIF (SELECT last_updated_at FROM sketches WHERE id = NEW.sketch_id) < NOW() - INTERVAL '10 seconds' THENUPDATE sketchesSET last_updated_at = NOW()@@ -220,7 +220,7 @@ BEGINELSIF TG_TABLE_NAME IN ('emails', 'individuals', 'relationships','physical_addresses', 'social_accounts',- 'ip_addresses', 'phone_numbers'+ 'ip_addresses', 'phones') THENIF (SELECT last_updated_at FROM sketches WHERE id = NEW.sketch_id) IS NULL OR(SELECT last_updated_at FROM sketches WHERE id = NEW.sketch_id) < NOW() - INTERVAL '10 seconds' THEN@@ -587,7 +587,7 @@ ALTER TABLE "public"."organizations_organizations" ALTER COLUMN "id" ADD GENERAT-CREATE TABLE IF NOT EXISTS "public"."phone_numbers" (+CREATE TABLE IF NOT EXISTS "public"."phones" ("id" "uuid" DEFAULT "extensions"."uuid_generate_v4"() NOT NULL,"individual_id" "uuid","sketch_id" "uuid",@@ -598,7 +598,7 @@ CREATE TABLE IF NOT EXISTS "public"."phone_numbers" ();-ALTER TABLE "public"."phone_numbers" OWNER TO "postgres";+ALTER TABLE "public"."phones" OWNER TO "postgres";CREATE TABLE IF NOT EXISTS "public"."physical_addresses" (@@ -736,10 +736,10 @@ CREATE OR REPLACE VIEW "public"."sketch_table" WITH ("security_invoker"='on') AS"jsonb_build_object"('id', "emails"."id", 'type', 'email', 'label', "emails"."email", 'email', "emails"."email", 'breach_found', "emails"."breach_found", 'created_at', "emails"."created_at") AS "data"FROM "public"."emails"UNION ALL- SELECT "phone_numbers"."id",- "phone_numbers"."sketch_id",- "jsonb_build_object"('id', "phone_numbers"."id", 'type', 'phone', 'label', "phone_numbers"."phone_number", 'phone_number', "phone_numbers"."phone_number", 'country', "phone_numbers"."country", 'created_at', "phone_numbers"."created_at") AS "data"- FROM "public"."phone_numbers"+ SELECT "phones"."id",+ "phones"."sketch_id",+ "jsonb_build_object"('id', "phones"."id", 'type', 'phone', 'label', "phones"."phone_number", 'phone_number', "phones"."phone_number", 'country', "phones"."country", 'created_at', "phones"."created_at") AS "data"+ FROM "public"."phones"UNION ALLSELECT "websites"."id","websites"."sketch_id",@@ -856,13 +856,13 @@ ALTER TABLE ONLY "public"."organizations"-ALTER TABLE ONLY "public"."phone_numbers"- ADD CONSTRAINT "phone_numbers_phone_number_key" UNIQUE ("phone_number");+ALTER TABLE ONLY "public"."phones"+ ADD CONSTRAINT "phones_phone_number_key" UNIQUE ("phone_number");-ALTER TABLE ONLY "public"."phone_numbers"- ADD CONSTRAINT "phone_numbers_pkey" PRIMARY KEY ("id");+ALTER TABLE ONLY "public"."phones"+ ADD CONSTRAINT "phones_pkey" PRIMARY KEY ("id");@@ -975,7 +975,7 @@ CREATE INDEX "idx_organizations_sketch_id" ON "public"."organizations" USING "bt-CREATE INDEX "idx_phone_numbers_sketch_id" ON "public"."phone_numbers" USING "btree" ("sketch_id");+CREATE INDEX "idx_phones_sketch_id" ON "public"."phones" USING "btree" ("sketch_id");@@ -1017,7 +1017,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') AS"i"."full_name","i"."sketch_id","json_agg"(DISTINCT "jsonb_build_object"('id', "e_1"."id", 'email', "e_1"."email")) FILTER (WHERE ("e_1"."id" IS NOT NULL)) AS "emails",- "json_agg"(DISTINCT "jsonb_build_object"('id', "p"."id", 'phone_number', "p"."phone_number")) FILTER (WHERE ("p"."id" IS NOT NULL)) AS "phone_numbers",+ "json_agg"(DISTINCT "jsonb_build_object"('id', "p"."id", 'phone_number', "p"."phone_number")) FILTER (WHERE ("p"."id" IS NOT NULL)) AS "phones","json_agg"(DISTINCT "jsonb_build_object"('id', "s"."id", 'platform', "s"."platform", 'username', "s"."username")) FILTER (WHERE ("s"."id" IS NOT NULL)) AS "social_accounts","json_agg"(DISTINCT "jsonb_build_object"('id', "ip"."id", 'ip_address', "ip"."ip_address")) FILTER (WHERE ("ip"."id" IS NOT NULL)) AS "ip_addresses","json_agg"(DISTINCT "jsonb_build_object"('id', "v"."id", 'plate', "v"."plate", 'model', "v"."model", 'brand', "v"."brand", 'type', "v"."type")) FILTER (WHERE ("v"."id" IS NOT NULL)) AS "vehicles",@@ -1025,7 +1025,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') AS"json_agg"(DISTINCT "jsonb_build_object"('id', "pa"."id", 'address', "pa"."address", 'city', "pa"."city", 'country', "pa"."country")) FILTER (WHERE ("pa"."id" IS NOT NULL)) AS "physical_addresses"FROM ((((((("public"."individuals" "i"LEFT JOIN "public"."emails" "e_1" ON (("i"."id" = "e_1"."individual_id")))- LEFT JOIN "public"."phone_numbers" "p" ON (("i"."id" = "p"."individual_id")))+ LEFT JOIN "public"."phones" "p" ON (("i"."id" = "p"."individual_id")))LEFT JOIN "public"."social_accounts" "s" ON (("i"."id" = "s"."individual_id")))LEFT JOIN "public"."ip_addresses" "ip" ON (("i"."id" = "ip"."individual_id")))LEFT JOIN "public"."vehicles" "v" ON (("i"."id" = "v"."individual_id")))@@ -1039,7 +1039,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') AS"o"."founding_date","o"."sketch_id","json_agg"(DISTINCT "jsonb_build_object"('id', "poa"."id", 'address', "poa"."address", 'city', "poa"."city", 'country', "poa"."country")) FILTER (WHERE ("poa"."id" IS NOT NULL)) AS "addresses",- "json_agg"(DISTINCT "jsonb_build_object"('id', "op"."id", 'phone_number', "op"."phone_number")) FILTER (WHERE ("op"."id" IS NOT NULL)) AS "phone_numbers",+ "json_agg"(DISTINCT "jsonb_build_object"('id', "op"."id", 'phone_number', "op"."phone_number")) FILTER (WHERE ("op"."id" IS NOT NULL)) AS "phones","json_agg"(DISTINCT "jsonb_build_object"('id', "e_1"."id", 'email', "e_1"."email")) FILTER (WHERE ("e_1"."id" IS NOT NULL)) AS "emails","json_agg"(DISTINCT "jsonb_build_object"('id', "s"."id", 'platform', "s"."platform", 'username', "s"."username")) FILTER (WHERE ("s"."id" IS NOT NULL)) AS "social_accounts","json_agg"(DISTINCT "jsonb_build_object"('id', "ip"."id", 'ip_address', "ip"."ip_address")) FILTER (WHERE ("ip"."id" IS NOT NULL)) AS "ip_addresses",@@ -1047,7 +1047,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') AS"json_agg"(DISTINCT "jsonb_build_object"('id', "w"."id", 'url', "w"."url", 'registration_date', "w"."registration_date", 'registrar', "w"."registrar", 'ip_address', "w"."ip_address")) FILTER (WHERE ("w"."id" IS NOT NULL)) AS "websites"FROM ((((((("public"."organizations" "o"LEFT JOIN "public"."physical_addresses" "poa" ON (("poa"."organization_id" = "o"."id")))- LEFT JOIN "public"."phone_numbers" "op" ON (("op"."organization_id" = "o"."id")))+ LEFT JOIN "public"."phones" "op" ON (("op"."organization_id" = "o"."id")))LEFT JOIN "public"."emails" "e_1" ON (("e_1"."organization_id" = "o"."id")))LEFT JOIN "public"."social_accounts" "s" ON (("s"."organization_id" = "o"."id")))LEFT JOIN "public"."ip_addresses" "ip" ON (("ip"."organization_id" = "o"."id")))@@ -1068,7 +1068,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') ASSELECT "id"."sketch_id","jsonb_build_object"('id', ("p"."value" ->> 'id'::"text"), 'type', 'custom', 'data', "jsonb_build_object"('id', ("p"."value" ->> 'id'::"text"), 'phone_number', ("p"."value" ->> 'phone_number'::"text"), 'label', ("p"."value" ->> 'phone_number'::"text"), 'type', 'phone'), 'position', "jsonb_build_object"('x', '-100'::integer, 'y', 100)) AS "node"FROM "individual_data" "id",- LATERAL "json_array_elements"("id"."phone_numbers") "p"("value")+ LATERAL "json_array_elements"("id"."phones") "p"("value")WHERE (("p"."value" ->> 'id'::"text") IS NOT NULL)UNION ALLSELECT "id"."sketch_id",@@ -1114,7 +1114,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') ASSELECT "od"."sketch_id","jsonb_build_object"('id', ("p"."value" ->> 'id'::"text"), 'type', 'custom', 'data', "jsonb_build_object"('id', ("p"."value" ->> 'id'::"text"), 'phone_number', ("p"."value" ->> 'phone_number'::"text"), 'label', ("p"."value" ->> 'phone_number'::"text"), 'type', 'phone'), 'position', "jsonb_build_object"('x', '-100'::integer, 'y', 100)) AS "node"FROM "organization_data" "od",- LATERAL "json_array_elements"("od"."phone_numbers") "p"("value")+ LATERAL "json_array_elements"("od"."phones") "p"("value")WHERE (("p"."value" ->> 'id'::"text") IS NOT NULL)UNION ALLSELECT "od"."sketch_id",@@ -1156,7 +1156,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') ASSELECT "id"."sketch_id","jsonb_build_object"('id', "concat"("id"."id", '-', ("p"."value" ->> 'id'::"text")), 'source', ("id"."id")::"text", 'target', ("p"."value" ->> 'id'::"text"), 'type', 'custom', 'label', 'phone') AS "edge"FROM "individual_data" "id",- LATERAL "json_array_elements"("id"."phone_numbers") "p"("value")+ LATERAL "json_array_elements"("id"."phones") "p"("value")WHERE (("p"."value" ->> 'id'::"text") IS NOT NULL)UNION ALLSELECT "id"."sketch_id",@@ -1198,7 +1198,7 @@ CREATE OR REPLACE VIEW "public"."sketch_graph" WITH ("security_invoker"='on') ASSELECT "od"."sketch_id","jsonb_build_object"('id', "concat"("od"."id", '-', ("p"."value" ->> 'id'::"text")), 'source', ("od"."id")::"text", 'target', ("p"."value" ->> 'id'::"text"), 'type', 'custom', 'label', 'phone') AS "edge"FROM "organization_data" "od",- LATERAL "json_array_elements"("od"."phone_numbers") "p"("value")+ LATERAL "json_array_elements"("od"."phones") "p"("value")WHERE (("p"."value" ->> 'id'::"text") IS NOT NULL)UNION ALLSELECT "od"."sketch_id",@@ -1320,7 +1320,7 @@ CREATE OR REPLACE TRIGGER "trigger_update_project_last_updated_ip_addresses" AFT-CREATE OR REPLACE TRIGGER "trigger_update_project_last_updated_phone_numbers" AFTER INSERT OR DELETE OR UPDATE ON "public"."phone_numbers" FOR EACH ROW EXECUTE FUNCTION "public"."update_investigation_last_updated"();+CREATE OR REPLACE TRIGGER "trigger_update_project_last_updated_phones" AFTER INSERT OR DELETE OR UPDATE ON "public"."phones" FOR EACH ROW EXECUTE FUNCTION "public"."update_investigation_last_updated"();@@ -1449,18 +1449,18 @@ ALTER TABLE ONLY "public"."organizations"-ALTER TABLE ONLY "public"."phone_numbers"- ADD CONSTRAINT "phone_numbers_individual_id_fkey" FOREIGN KEY ("individual_id") REFERENCES "public"."individuals"("id") ON DELETE CASCADE;+ALTER TABLE ONLY "public"."phones"+ ADD CONSTRAINT "phones_individual_id_fkey" FOREIGN KEY ("individual_id") REFERENCES "public"."individuals"("id") ON DELETE CASCADE;-ALTER TABLE ONLY "public"."phone_numbers"- ADD CONSTRAINT "phone_numbers_organization_id_fkey" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE SET NULL;+ALTER TABLE ONLY "public"."phones"+ ADD CONSTRAINT "phones_organization_id_fkey" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE SET NULL;-ALTER TABLE ONLY "public"."phone_numbers"- ADD CONSTRAINT "phone_numbers_sketch_id_fkey" FOREIGN KEY ("sketch_id") REFERENCES "public"."sketches"("id") ON DELETE CASCADE;+ALTER TABLE ONLY "public"."phones"+ ADD CONSTRAINT "phones_sketch_id_fkey" FOREIGN KEY ("sketch_id") REFERENCES "public"."sketches"("id") ON DELETE CASCADE;@@ -1617,9 +1617,9 @@ CREATE POLICY "Can delete organizations_organizations if you have access to th"-CREATE POLICY "Can delete phone_numbers if you have access to the sketch" ON "public"."phone_numbers" FOR DELETE TO "authenticated" USING ((EXISTS ( SELECT 1+CREATE POLICY "Can delete phones if you have access to the sketch" ON "public"."phones" FOR DELETE TO "authenticated" USING ((EXISTS ( SELECT 1FROM "public"."sketches_profiles" "sp"- WHERE (("sp"."sketch_id" = "phone_numbers"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));+ WHERE (("sp"."sketch_id" = "phones"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));@@ -1689,9 +1689,9 @@ CREATE POLICY "Can insert organizations_organizations if you have access to th"-CREATE POLICY "Can insert phone_numbers if you have access to the sketch" ON "public"."phone_numbers" FOR INSERT TO "authenticated" WITH CHECK ((EXISTS ( SELECT 1+CREATE POLICY "Can insert phones if you have access to the sketch" ON "public"."phones" FOR INSERT TO "authenticated" WITH CHECK ((EXISTS ( SELECT 1FROM "public"."sketches_profiles" "sp"- WHERE (("sp"."sketch_id" = "phone_numbers"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));+ WHERE (("sp"."sketch_id" = "phones"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));@@ -1771,9 +1771,9 @@ CREATE POLICY "Can read organizations_organizations if you have access to the "-CREATE POLICY "Can read phone_numbers if you have access to the sketch" ON "public"."phone_numbers" FOR SELECT TO "authenticated" USING ((EXISTS ( SELECT 1+CREATE POLICY "Can read phones if you have access to the sketch" ON "public"."phones" FOR SELECT TO "authenticated" USING ((EXISTS ( SELECT 1FROM "public"."sketches_profiles" "sp"- WHERE (("sp"."sketch_id" = "phone_numbers"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));+ WHERE (("sp"."sketch_id" = "phones"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));@@ -1847,9 +1847,9 @@ CREATE POLICY "Can update organizations_organizations if you have access to th"-CREATE POLICY "Can update phone_numbers if you have access to the sketch" ON "public"."phone_numbers" FOR UPDATE TO "authenticated" USING ((EXISTS ( SELECT 1+CREATE POLICY "Can update phones if you have access to the sketch" ON "public"."phones" FOR UPDATE TO "authenticated" USING ((EXISTS ( SELECT 1FROM "public"."sketches_profiles" "sp"- WHERE (("sp"."sketch_id" = "phone_numbers"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));+ WHERE (("sp"."sketch_id" = "phones"."sketch_id") AND ("sp"."profile_id" = "auth"."uid"())))));@@ -2002,7 +2002,7 @@ ALTER TABLE "public"."organizations_individuals" ENABLE ROW LEVEL SECURITY;ALTER TABLE "public"."organizations_organizations" ENABLE ROW LEVEL SECURITY;-ALTER TABLE "public"."phone_numbers" ENABLE ROW LEVEL SECURITY;+ALTER TABLE "public"."phones" ENABLE ROW LEVEL SECURITY;ALTER TABLE "public"."physical_addresses" ENABLE ROW LEVEL SECURITY;@@ -2410,9 +2410,9 @@ GRANT ALL ON SEQUENCE "public"."organizations_organizations_id_seq" TO "service_-GRANT ALL ON TABLE "public"."phone_numbers" TO "anon";-GRANT ALL ON TABLE "public"."phone_numbers" TO "authenticated";-GRANT ALL ON TABLE "public"."phone_numbers" TO "service_role";+GRANT ALL ON TABLE "public"."phones" TO "anon";+GRANT ALL ON TABLE "public"."phones" TO "authenticated";+GRANT ALL ON TABLE "public"."phones" TO "service_role";diff --git a/flowsint-api/app/core/celery.py b/flowsint-api/app/core/celery.pyindex 8dc08d80..8630b082 100644--- a/flowsint-api/app/core/celery.py+++ b/flowsint-api/app/core/celery.py@@ -2,7 +2,7 @@ from celery import Celerycelery_app = Celery("flowsint",- broker="redis://redis:6379/0",- backend="redis://redis:6379/0",+ broker="redis://127.0.0.1:6379/0",+ backend="redis://127.0.0.1:6379/0",include=["app.tasks.scanner"])\ No newline at end of filediff --git a/flowsint-api/app/main.py b/flowsint-api/app/main.pyindex 0f50f180..ca275bed 100644--- a/flowsint-api/app/main.py+++ b/flowsint-api/app/main.py@@ -1,10 +1,18 @@+from uuid import UUIDfrom fastapi import FastAPI, HTTPException, Dependsfrom pydantic import BaseModel, Fieldfrom app.core.celery import celery_app+from app.core.db import get_dbfrom app.scanners.registry import ScannerRegistryfrom app.scanners.orchestrator import TransformOrchestrator-from app.core.auth import get_current_user-from app.models.types import OSINTTypeUtils+from app.core.auth import get_current_user+from app.utils import extract_input_schema+# Import types+from app.types.domain import MinimalDomain, Domain+from app.types.ip import MinimalIp, Ip+from app.types.whois import Whois++from typing import Listapp = FastAPI()@@ -50,11 +58,12 @@ async def scan(except Exception as e:return {"valid": False, "reason": str(e)}+@app.get("/transforms/nodes")async def get_scans_list():scanners = ScannerRegistry.list_by_category()-- # Aplatir les scanners par catégorie en une liste++ # Flatten scanner nodesflattened_scanners = {category: [{@@ -62,19 +71,38 @@ async def get_scans_list():"name": scanner["name"],"module": scanner["module"],"doc": scanner["doc"],- "key": scanner["key"],"inputs": scanner["inputs"],"outputs": scanner["outputs"],+ "type": "scanner"}for scanner in scanner_list]for category, scanner_list in scanners.items()}-- # Ajouter la clé "types" avec les types OSINT- flattened_scanners["types"] = OSINTTypeUtils.get_osint_type_nodes()++ # Add your object types under a dedicated category (e.g., "types")+ object_inputs = [+ extract_input_schema("MinimalDomain", MinimalDomain),+ extract_input_schema("MinimalIp", MinimalIp),+ ]++ flattened_scanners["inputs"] = object_inputsreturn {"items": flattened_scanners}+[email protected]("/transforms/{transform_id}")+async def get_transform(transform_id: UUID):+ db=get_db()++ try:+ response = db.table("transforms").select("*").eq("id", str(transform_id)).single().execute()+ if response.data is None:+ raise HTTPException(status_code=404, detail="Transform not found")+ except Exception as e:+ raise HTTPException(status_code=404, detail="Transform not found")++ return response.data+@app.get("/health")async def health():return {"status": "ok"}diff --git a/flowsint-api/app/models/types.py b/flowsint-api/app/models/types.pydeleted file mode 100644index da1152ea..00000000--- a/flowsint-api/app/models/types.py+++ /dev/null@@ -1,92 +0,0 @@-from enum import Enum-from typing import List, Dict---class OSINTType(str, Enum):- EMAIL = "email"- USERNAME = "username"- PHONE_NUMBER = "phone_number"- URL = "url"- DOMAIN = "domain"- IP_ADDRESS = "ip_address"- FULL_NAME = "full_name"- TEXT = "text"- ARRAY = "array"- SOCIAL_PROFILE = "social_profile"- LEAK_INFO = "leak_info"---OSINT_TYPE_METADATA = {- OSINTType.EMAIL: {- "label": "Email address",- "regex": r"^[^@]+@[^@]+\.[^@]+$",- "description": "A standard email address like [email protected]"- },- OSINTType.USERNAME: {- "label": "Username",- "regex": r"^[a-zA-Z0-9_.-]+$",- "description": "A generic username used on platforms and forums"- },- OSINTType.PHONE_NUMBER: {- "label": "Phone number",- "regex": r"^\+?[0-9]{7,15}$",- "description": "A phone number with optional international prefix"- },- OSINTType.URL: {- "label": "Website URL",- "regex": r"^https?://.+",- "description": "A fully qualified website URL starting with http(s)"- },- OSINTType.DOMAIN: {- "label": "Domain",- "regex": r"^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$",- "description": "A domain like example.com"- },- OSINTType.IP_ADDRESS: {- "label": "IP address",- "regex": r"^\d{1,3}(\.\d{1,3}){3}$",- "description": "An IPv4 address"- },- OSINTType.FULL_NAME: {- "label": "Full name",- "regex": r"^[\p{L} .'-]{2,}$",- "description": "A person's full name"- },- OSINTType.TEXT: {- "label": "Text",- "regex": r"^.*$",- "description": "Any free text input"- },- OSINTType.ARRAY: {- "label": "Array",- "regex": r"^\[.*\]$",- "description": "A JSON array of values"- },- OSINTType.SOCIAL_PROFILE: {- "label": "Social profile",- "regex": r"^https?://(?:www\.)?[a-z0-9.-]+\.[a-z]{2,}(?:/[^\s]*)?$",- "description": "A URL pointing to a social media profile"- },- OSINTType.LEAK_INFO: {- "label": "Leak info",- "regex": r"^.*$",- "description": "Information extracted from data breaches"- }-}---class OSINTTypeUtils:- @staticmethod- def get_osint_type_nodes() -> List[Dict[str, str]]:- return [- {- "id": f"type::{t.value}",- "class_name": meta["label"],- "description": meta["description"],- "regex": meta["regex"],- "name": t.value,- "outputs": [t.value],- "inputs": [t.value],- }- for t, meta in OSINT_TYPE_METADATA.items()- ]diff --git a/flowsint-api/app/scanners/base.py b/flowsint-api/app/scanners/base.pyindex facabda2..fe2f147f 100644--- a/flowsint-api/app/scanners/base.py+++ b/flowsint-api/app/scanners/base.py@@ -1,6 +1,5 @@from abc import ABC, abstractmethodfrom typing import List, Dict, Any-from app.models.types import OSINT_TYPE_METADATA, OSINTTypeclass Scanner(ABC):def __init__(self, scan_id: str):@@ -16,22 +15,11 @@ class Scanner(ABC):def category(self) -> str:pass- @classmethod- @abstractmethod- def key(self) -> str:- """- This is the key used to identify the items' key to search for. Ex:- Individual -> full_name- Phone -> phone_number- """- pass-@classmethod@abstractmethoddef input_schema(cls) -> Dict[str, str]:"""Returns the input fields and their types.- Example: { "email": "string" }"""pass@@ -40,7 +28,6 @@ class Scanner(ABC):def output_schema(cls) -> Dict[str, str]:"""Returns the output fields and their types.- Example: { "leaks": "array", "sources": "array" }"""passdiff --git a/flowsint-api/app/scanners/domains/domain_infos.py b/flowsint-api/app/scanners/domains/domain_infos.pydeleted file mode 100644index 6999235c..00000000--- a/flowsint-api/app/scanners/domains/domain_infos.py+++ /dev/null@@ -1,97 +0,0 @@-import json-import uuid-from typing import Dict, Any, List-import requests-import whois-import pydig-from app.utils import is_valid_url-from app.scanners.base import Scanner---class DomainInfosScanner(Scanner):- """Scan for WHOIS, DNS, subdomains, and geolocation data of a domain."""-- @classmethod- def name(cls) -> str:- return "domain_infos_scanner"-- @classmethod- def category(cls) -> str:- return "websites"-- @classmethod- def key(cls) -> str:- return "url"-- @classmethod- def input_schema(cls) -> Dict[str, str]:- return ["domain", "url"]-- @classmethod- def output_schema(self) -> Dict[str, str]:- return ["ip_address", "url", "whois_raw", "subdomains", "ips", "ipinfo"]-- def _get_subdomains_from_crtsh(self, domain: str) -> List[str]:- url = f"https://crt.sh/?q=%25.{domain}&output=json"- try:- resp = requests.get(url, timeout=100)- if resp.status_code != 200:- return []-- data = resp.json()- subdomains = set()-- for entry in data:- name = entry.get("name_value")- if name:- for sub in name.splitlines():- sub = sub.strip().lower().lstrip('*.')- if sub.endswith(domain):- subdomains.add(sub)-- return sorted(subdomains)- except Exception as e:- return [f"[crt.sh] Error: {str(e)}"]-- def preprocess(self, domains: List[str]) -> List[str]:- """Preprocess the domains by validating them."""- return [is_valid_url(domain) for domain in domains]-- def scan(self, domains: List[str]) -> List[Dict[str, Any]]:- """Scan multiple domains and return a list of results."""- results = []- for domain in domains:- result = {"domain": domain }- # WHOIS info- try:- w = whois.whois(domain)- result["whois_raw"] = json.dumps(w, default=str, indent=2)- except Exception as e:- result["whois_raw"] = json.dumps({"error": str(e)})-- # DNS lookup- try:- result["ips"] = pydig.query(domain, 'A')- except Exception as e:- result["ips"] = []- result["ips_error"] = f"[error] {str(e)}"-- # IP Geolocation- ipinfo_data = []- for ip in result.get("ips", []):- try:- resp = requests.get(f"https://ipinfo.io/{ip}/json", timeout=10)- ipinfo_data.append(resp.json())- except Exception:- ipinfo_data.append({"ip": ip, "error": "Failed to fetch ipinfo"})- result["ipinfo"] = ipinfo_data- # Subdomains- result["subdomains"] = self._get_subdomains_from_crtsh(domain)-- results.append(result)-- return results-- def postprocess(self, results: List[Dict[str, Any]]) -> List[Dict[str, Any]]:- """Post-process the results by adding additional information."""- return {"output": {"domains": results}}diff --git a/flowsint-api/app/scanners/domains/resolve.py b/flowsint-api/app/scanners/domains/resolve.pynew file mode 100644index 00000000..2ba5cdaf--- /dev/null+++ b/flowsint-api/app/scanners/domains/resolve.py@@ -0,0 +1,53 @@+import socket+from typing import List, Dict, Any, TypeAlias+from pydantic import TypeAdapter+from app.scanners.base import Scanner+from app.types.domain import MinimalDomain+from app.types.ip import MinimalIp+from app.utils import is_valid_domain, resolve_type++InputType: TypeAlias = List[MinimalDomain]+OutputType: TypeAlias = List[MinimalIp]++class ResolveScanner(Scanner):+ """Resolve domain names to IP addresses."""++ @classmethod+ def name(cls) -> str:+ return "domain_resolve_scanner"++ @classmethod+ def category(cls) -> str:+ return "domains"++ @classmethod+ def input_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(InputType)+ return [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["MinimalDomain"]["properties"].items()+ ]++ @classmethod+ def output_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(OutputType)+ return [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["MinimalIp"]["properties"].items()+ ]++ def preprocess(self, data: InputType) -> InputType:+ return [d for d in data if is_valid_domain(d.domain) != "invalid"]++ def scan(self, data: InputType) -> OutputType:+ results: OutputType = []+ for d in data:+ try:+ ip = socket.gethostbyname(d.domain)+ results.append(MinimalIp(ip=ip))+ except Exception as e:+ print(f"Error resolving {d.domain}: {e}")+ return results++ def postprocess(self, results: OutputType) -> OutputType:+ return resultsdiff --git a/flowsint-api/app/scanners/domains/subdomains.py b/flowsint-api/app/scanners/domains/subdomains.pynew file mode 100644index 00000000..0554ba34--- /dev/null+++ b/flowsint-api/app/scanners/domains/subdomains.py@@ -0,0 +1,72 @@+import requests+from typing import List, Dict, Any, TypeAlias+from app.scanners.base import Scanner+from app.types.domain import MinimalDomain+from app.utils import is_valid_domain, resolve_type+from pydantic import TypeAdapter++InputType: TypeAlias = List[MinimalDomain]+OutputType: TypeAlias = List[MinimalDomain]++class SubdomainScanner(Scanner):+ """Scanner to find subdomains associated to a domain."""++ @classmethod+ def name(cls) -> str:+ return "subdomain_scanner"++ @classmethod+ def category(cls) -> str:+ return "domains"++ @classmethod+ def key(cls) -> str:+ return "subdomains"++ @classmethod+ def input_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(InputType)+ schema = [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["MinimalDomain"]["properties"].items()+ ]+ return schema++ @classmethod+ def output_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(OutputType)+ schema = [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["MinimalDomain"]["properties"].items()+ ]+ return schema++ def preprocess(self, data: InputType) -> InputType:+ """Filter out invalid domains."""+ return[d for d in data if is_valid_domain(d.domain) != "invalid"]++ def scan(self, data: InputType) -> OutputType:+ """Find subdomains using crt.sh."""++ found_subdomains: set[str] = set()++ for d in data:+ try:+ response = requests.get(+ f"https://crt.sh/?q=%25.{d.domain}&output=json",+ timeout=10+ )+ if response.ok:+ entries = response.json()+ for entry in entries:+ name_value = entry.get("name_value", "")+ for subdomain in name_value.split("\n"):+ if is_valid_domain(subdomain) and subdomain.endswith(d.domain):+ found_subdomains.add(subdomain.lower())+ except Exception:+ continue++ return [MinimalDomain(domain=sub) for sub in sorted(found_subdomains)]++ def postprocess(self, results: OutputType) -> OutputType:+ return resultsdiff --git a/flowsint-api/app/scanners/domains/whois.py b/flowsint-api/app/scanners/domains/whois.pynew file mode 100644index 00000000..b5b69a8a--- /dev/null+++ b/flowsint-api/app/scanners/domains/whois.py@@ -0,0 +1,75 @@+import json+from typing import List, Dict, Any, TypeAlias+import whois+from app.utils import is_valid_domain, resolve_type+from app.scanners.base import Scanner+from app.types.domain import MinimalDomain+from app.types.whois import Whois+from app.types.email import Email+from pydantic import TypeAdapter++InputType: TypeAlias = List[MinimalDomain]+OutputType: TypeAlias = List[Whois]+++class WhoisScanner(Scanner):+ """Scan for WHOIS information of a domain."""++ @classmethod+ def name(cls) -> str:+ return "domain_whois_scanner"++ @classmethod+ def category(cls) -> str:+ return "domains"++ @classmethod+ def input_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(InputType)+ schema = [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["MinimalDomain"]["properties"].items()+ ]+ return schema++ @classmethod+ def output_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(OutputType)+ schema = [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["Whois"]["properties"].items()+ ]+ return schema++ def preprocess(self, data: InputType) -> InputType:+ """Filter out invalid domains."""+ return[d for d in data if is_valid_domain(d.domain) != "invalid"]++ def scan(self, data: InputType) -> OutputType:+ """Extract WHOIS data for each domain."""+ results: OutputType = []++ for d in data:+ try:+ w = whois.whois(d.domain)+ w_data = json.loads(json.dumps(w, default=str))+ whois_obj = Whois(+ registrar=w_data.get("registrar"),+ org=w_data.get("org"),+ city=w_data.get("city"),+ country=w_data.get("country"),+ email=Email(email=w_data["emails"][0]) if isinstance(w_data.get("emails"), list) else None,+ creation_date=str(w_data.get("creation_date")) if w_data.get("creation_date") else None,+ expiration_date=str(w_data.get("expiration_date")) if w_data.get("expiration_date") else None,+ )+ results.append(whois_obj)++ except Exception as e:+ print(e)+ continue++ return results++ def postprocess(self, results: OutputType) -> OutputType:+ print(results)+ return resultsdiff --git a/flowsint-api/app/scanners/emails/ghunt.py b/flowsint-api/app/scanners/emails/ghunt.pyindex f5414cdf..77d9c8e6 100644--- a/flowsint-api/app/scanners/emails/ghunt.py+++ b/flowsint-api/app/scanners/emails/ghunt.py@@ -1,11 +1,8 @@-import asyncioimport jsonimport uuidfrom typing import Dict, Any, Listfrom pathlib import Pathfrom app.scanners.base import Scanner-from app.models.types import OSINTType-from app.utils import DataTypeimport tempfileclass GHuntGmailScanner(Scanner):@@ -27,7 +24,7 @@ class GHuntGmailScanner(Scanner):@classmethoddef output_schema(self) -> Dict[str, str]:- return ["full_name", "social_profile", "leak_info", "email", "phone_number", "location", "profile_picture", "metadata"]+ return ["full_name", "social_profile", "leak_info", "email", "number", "location", "profile_picture", "metadata"]async def scan(self, emails: List[str]) -> List[Dict[str, Any]]:results = []diff --git a/flowsint-api/app/scanners/ips/reverse_resolve.py b/flowsint-api/app/scanners/ips/reverse_resolve.pynew file mode 100644index 00000000..5e305a66--- /dev/null+++ b/flowsint-api/app/scanners/ips/reverse_resolve.py@@ -0,0 +1,53 @@+import socket+from typing import List, Dict, Any, TypeAlias+from pydantic import TypeAdapter+from app.scanners.base import Scanner+from app.types.domain import MinimalDomain+from app.types.ip import MinimalIp+from app.utils import resolve_type++InputType: TypeAlias = List[MinimalIp]+OutputType: TypeAlias =List[MinimalDomain]++class ReverseResolveScanner(Scanner):+ """Resolve IP addresses to domain names."""++ @classmethod+ def name(cls) -> str:+ return "ip_reverse_resolve_scanner"++ @classmethod+ def category(cls) -> str:+ return "ips"++ @classmethod+ def input_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(InputType)+ return [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["MinimalIp"]["properties"].items()+ ]++ @classmethod+ def output_schema(cls) -> Dict[str, Any]:+ adapter = TypeAdapter(OutputType)+ return [+ {"name": prop, "type": resolve_type(details)}+ for prop, details in adapter.json_schema()["$defs"]["MinimalDomain"]["properties"].items()+ ]++ def preprocess(self, data: InputType) -> InputType:+ return [ip for ip in data if ip.ip]++ def scan(self, data: InputType) -> OutputType:+ results: OutputType = []+ for ip in data:+ try:+ domain = socket.gethostbyaddr(ip.ip)[0]+ results.append(MinimalDomain(domain=domain))+ except Exception as e:+ print(f"Error reverse resolving {ip.ip}: {e}")+ return results++ def postprocess(self, results: OutputType) -> OutputType:+ return resultsdiff --git a/flowsint-api/app/scanners/leaks/hibp.py b/flowsint-api/app/scanners/leaks/hibp.pyindex cf021e3b..6c3f157b 100644--- a/flowsint-api/app/scanners/leaks/hibp.py+++ b/flowsint-api/app/scanners/leaks/hibp.py@@ -28,7 +28,7 @@ class HibpScanner(Scanner):@classmethoddef input_schema(self) -> Dict[str, str]:- return ["email", "phone_number", "full_name", "username"]+ return ["email", "number", "full_name", "username"]@classmethoddef output_schema(self) -> Dict[str, str]:diff --git a/flowsint-api/app/scanners/orchestrator.py b/flowsint-api/app/scanners/orchestrator.pyindex abbb7b99..9059fabb 100644--- a/flowsint-api/app/scanners/orchestrator.py+++ b/flowsint-api/app/scanners/orchestrator.py@@ -6,17 +6,18 @@ class TransformOrchestrator(Scanner):def __init__(self, scan_id: str, scanner_names: List[str]):super().__init__(scan_id)self.scanner_names = scanner_names- self.scanners = []+ self.scanners: List[Scanner] = []+ self._load_scanners()- def _load_scanners(self) -> List[Scanner]:- scanners = []- if (self.scanner_names is None) or (len(self.scanner_names) == 0):+ def _load_scanners(self) -> None:+ if not self.scanner_names:raise ValueError("No scanners provided")+for name in self.scanner_names:if not ScannerRegistry.scanner_exists(name):raise ValueError(f"Scanner '{name}' not found in registry")- scanners.append(ScannerRegistry.get_scanner(name, self.scan_id))- return scanners+ scanner = ScannerRegistry.get_scanner(name, self.scan_id)+ self.scanners.append(scanner)@classmethoddef name(cls) -> str:@@ -36,25 +37,34 @@ class TransformOrchestrator(Scanner):@classmethoddef output_schema(cls) -> Dict[str, str]:- return {"scanners": "array", "results": "dict"}-- def preprocess(cls) -> Dict[str, Any]:- cls.scanners = cls._load_scanners()- return True+ return {+ "scanners": "array",+ "results": "dict"+ }def scan(self, value: str) -> Dict[str, Any]:results = {- "value": value,+ "initial_value": value,"scanners": [],"results": {}}+ current_values = [value]+for scanner in self.scanners:try:- res = scanner.execute(value)+ res = scanner.execute(current_values)results["scanners"].append(scanner.name())results["results"][scanner.name()] = res+ if isinstance(res, list):+ current_values = res+ elif isinstance(res, dict) and "values" in res:+ current_values = res["values"]+ else:+ raise ValueError(f"Unsupported output format from scanner '{scanner.name()}'")except Exception as e:results["results"][scanner.name()] = {"error": str(e)}+ breakreturn results+diff --git a/flowsint-api/app/scanners/phones/ignorant.py b/flowsint-api/app/scanners/phones/ignorant.pyindex d7bf1daa..af44eab4 100644--- a/flowsint-api/app/scanners/phones/ignorant.py+++ b/flowsint-api/app/scanners/phones/ignorant.py@@ -1,7 +1,7 @@import asynciofrom typing import Dict, Any, Listfrom app.scanners.base import Scanner-from app.utils import is_valid_phone_number+from app.utils import is_valid_numberimport httpxclass IgnorantScanner(Scanner):@@ -15,35 +15,35 @@ class IgnorantScanner(Scanner):@classmethoddef key(self) -> str:- return "phone_number"+ return "number"@classmethoddef input_schema(self) -> Dict[str, str]:- return ["phone_number"]+ return ["number"]@classmethoddef output_schema(self) -> Dict[str, str]:return ["exists"]- async def scan(self, phone_numbers: List[str]) -> List[Dict[str, Any]]:+ async def scan(self, phones: List[str]) -> List[Dict[str, Any]]:"""Performs the Ignorant search for each specified phone number."""results = []- for phone in phone_numbers:+ for phone in phones:try:- cleaned_phone = is_valid_phone_number(phone)+ cleaned_phone = is_valid_number(phone)if cleaned_phone:result = await self._perform_ignorant_research(cleaned_phone)results.append(result)else:results.append({- "phone_number": phone,+ "number": phone,"error": "Invalid phone number"})except Exception as e:results.append({- "phone_number": phone,+ "number": phone,"error": f"Unexpected error in Ignorant scan: {str(e)}"})return results@@ -73,7 +73,7 @@ class IgnorantScanner(Scanner):except Exception as e:return {- "phone_number": phone,+ "number": phone,"error": f"Error in Ignorant research: {str(e)}"}diff --git a/flowsint-api/app/scanners/registry.py b/flowsint-api/app/scanners/registry.pyindex e80aac12..4be1f891 100644--- a/flowsint-api/app/scanners/registry.py+++ b/flowsint-api/app/scanners/registry.py@@ -1,13 +1,10 @@from typing import Dict, Typefrom app.scanners.base import Scanner-from app.scanners.usernames.sherlock import SherlockScanner-from app.scanners.usernames.maigret import MaigretScanner-from app.scanners.emails.holehe import HoleheScanner-from app.scanners.domains.domain_infos import DomainInfosScanner-from app.scanners.emails.ghunt import GHuntGmailScanner-from app.scanners.phones.ignorant import IgnorantScanner-from app.scanners.leaks.hibp import HibpScanner+from app.scanners.domains.subdomains import SubdomainScanner+from app.scanners.domains.whois import WhoisScanner+from app.scanners.domains.resolve import ResolveScanner+from app.scanners.ips.reverse_resolve import ReverseResolveScannerclass ScannerRegistry:@@ -56,16 +53,12 @@ class ScannerRegistry:"name": scanner.name(),"module": scanner.__module__,"doc": scanner.__doc__,- "key": scanner.key(),"inputs": scanner.input_schema(),"outputs": scanner.output_schema(),})return scanners_by_category--ScannerRegistry.register(SherlockScanner)-ScannerRegistry.register(HoleheScanner)-ScannerRegistry.register(MaigretScanner)-ScannerRegistry.register(DomainInfosScanner)-ScannerRegistry.register(GHuntGmailScanner)-ScannerRegistry.register(IgnorantScanner)-ScannerRegistry.register(HibpScanner)\ No newline at end of file++ScannerRegistry.register(ReverseResolveScanner)+ScannerRegistry.register(ResolveScanner)+ScannerRegistry.register(SubdomainScanner)+ScannerRegistry.register(WhoisScanner)\ No newline at end of filediff --git a/flowsint-api/tests/api/__init__.py b/flowsint-api/app/types/__init__.pysimilarity index 100%rename from flowsint-api/tests/api/__init__.pyrename to flowsint-api/app/types/__init__.pydiff --git a/flowsint-api/app/types/address.py b/flowsint-api/app/types/address.pynew file mode 100644index 00000000..d5924df6--- /dev/null+++ b/flowsint-api/app/types/address.py@@ -0,0 +1,12 @@++from pydantic import BaseModel+from typing import Optional++class Address(BaseModel):+ address: str+ city: str+ country: str+ zip: str+ latitude: Optional[float] = None+ longitude: Optional[float] = None+diff --git a/flowsint-api/app/types/domain.py b/flowsint-api/app/types/domain.pynew file mode 100644index 00000000..f6017fc7--- /dev/null+++ b/flowsint-api/app/types/domain.py@@ -0,0 +1,15 @@+from pydantic import BaseModel+from typing import List, Optional+from .whois import Whois+from .ip import Ip++class MinimalDomain(BaseModel):+ domain: str++class Domain(MinimalDomain):+ whois: Optional[Whois] = None+ subdomains: Optional[List["Domain"]] = []+ ips: Optional[List[Ip]] = []++Domain.model_rebuild()+diff --git a/flowsint-api/app/types/email.py b/flowsint-api/app/types/email.pynew file mode 100644index 00000000..f441d4b4--- /dev/null+++ b/flowsint-api/app/types/email.py@@ -0,0 +1,4 @@+from pydantic import BaseModel, EmailStr++class Email(BaseModel):+ email: EmailStrdiff --git a/flowsint-api/app/types/individual.py b/flowsint-api/app/types/individual.pynew file mode 100644index 00000000..8a72ebf3--- /dev/null+++ b/flowsint-api/app/types/individual.py@@ -0,0 +1,9 @@+from pydantic import BaseModel+from typing import Optional++class Individual(BaseModel):+ first_name: str+ last_name: str+ full_name: str+ birth_date: Optional[str] = None+ gender: Optional[str] = None\ No newline at end of filediff --git a/flowsint-api/app/types/ip.py b/flowsint-api/app/types/ip.pynew file mode 100644index 00000000..2988dbb4--- /dev/null+++ b/flowsint-api/app/types/ip.py@@ -0,0 +1,12 @@+from pydantic import BaseModel+from typing import Optional++class MinimalIp(BaseModel):+ address: str++class Ip(MinimalIp):+ latitude: Optional[float] = None+ longitude: Optional[float] = None+ country: Optional[str] = None+ city: Optional[str] = None+ isp: Optional[str] = Nonediff --git a/flowsint-api/app/types/leak.py b/flowsint-api/app/types/leak.pynew file mode 100644index 00000000..74e10879--- /dev/null+++ b/flowsint-api/app/types/leak.py@@ -0,0 +1,7 @@+from typing import List, Dict+from pydantic import BaseModel+from typing import Optional++class Leak(BaseModel):+ leaks: Optional[List[Dict]] = None+ breaches: Optional[List[Dict]] = Nonediff --git a/flowsint-api/app/types/organization.py b/flowsint-api/app/types/organization.pynew file mode 100644index 00000000..36f5ea16--- /dev/null+++ b/flowsint-api/app/types/organization.py@@ -0,0 +1,15 @@+from pydantic import BaseModel+from typing import Optional, List++class Identifier(BaseModel):+ type: str # Example: "SIREN", "SIRET", "DUNS", "VAT", "LEI", etc.+ value: str+ country: Optional[str] = None+ issued_by: Optional[str] = None++class Organization(BaseModel):+ name: str+ founding_date: Optional[str] = None+ country: Optional[str] = None+ description: Optional[str] = None+ identifiers: Optional[List[Identifier]] = None\ No newline at end of filediff --git a/flowsint-api/app/types/phone.py b/flowsint-api/app/types/phone.pynew file mode 100644index 00000000..2c6b8681--- /dev/null+++ b/flowsint-api/app/types/phone.py@@ -0,0 +1,7 @@+from pydantic import BaseModel+from typing import Optional++class Phone(BaseModel):+ number: str+ country: Optional[str] = None+ carrier: Optional[str] = None\ No newline at end of filediff --git a/flowsint-api/app/types/social.py b/flowsint-api/app/types/social.pynew file mode 100644index 00000000..cbf5a68d--- /dev/null+++ b/flowsint-api/app/types/social.py@@ -0,0 +1,14 @@+from pydantic import BaseModel, HttpUrl+from typing import Optional+++class Social(BaseModel):+ username: Optional[str] = None+ profile_url: HttpUrl+ platform: Optional[str] = None+ profile_picture_url: Optional[str] = None+ bio: Optional[str] = None+ followers_count: Optional[int] = None+ following_count: Optional[int] = None+ posts_count: Optional[int] = None+\ No newline at end of filediff --git a/flowsint-api/app/types/website.py b/flowsint-api/app/types/website.pynew file mode 100644index 00000000..19f6ecc7--- /dev/null+++ b/flowsint-api/app/types/website.py@@ -0,0 +1,7 @@+from typing import Optional+from pydantic import BaseModel, HttpUrl+from app.types.domain import Domain++class Website(BaseModel):+ url: HttpUrl+ domain: Domain\ No newline at end of filediff --git a/flowsint-api/app/types/whois.py b/flowsint-api/app/types/whois.pynew file mode 100644index 00000000..e386e1f0--- /dev/null+++ b/flowsint-api/app/types/whois.py@@ -0,0 +1,12 @@+from typing import Optional+from pydantic import BaseModel+from app.types.email import Email++class Whois(BaseModel):+ registrar: Optional[str] = None+ org: Optional[str] = None+ city: Optional[str] = None+ country: Optional[str] = None+ email: Optional[Email] = None+ creation_date: Optional[str] = None+ expiration_date: Optional[str] = Nonediff --git a/flowsint-api/app/utils.py b/flowsint-api/app/utils.pyindex 82bc033b..11492b1c 100644--- a/flowsint-api/app/utils.py+++ b/flowsint-api/app/utils.py@@ -1,11 +1,11 @@from urllib.parse import urlparse-from enum import Enumimport phonenumbersfrom phonenumbers import NumberParseException-+from pydantic import TypeAdapter, BaseModelfrom urllib.parse import urlparseimport re+def is_valid_username(username: str) -> bool:if not re.match(r"^[a-zA-Z0-9_-]{3,30}$", username):raise ValueError(@@ -13,20 +13,20 @@ def is_valid_username(username: str) -> bool:)return username-def is_valid_url(url_or_domain: str) -> str:- """- Extracts the hostname from a URL or domain-like input.- Raises a ValueError if the domain is clearly invalid.- """+def is_valid_domain(url_or_domain: str) -> str:+parsed = urlparse(url_or_domain if "://" in url_or_domain else "http://" + url_or_domain)hostname = parsed.hostname or url_or_domain+if not hostname or "." not in hostname:- raise ValueError(f"Invalid domain: {url_or_domain}")+ return "invalid"+if not re.match(r"^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$", hostname):- raise ValueError(f"Malformed domain: {hostname}")+ return "invalid"+return hostname-def is_valid_phone_number(phone: str, region: str = "FR") -> None:+def is_valid_number(phone: str, region: str = "FR") -> None:"""Validates a phone number. Raises InvalidPhoneNumberError if invalid.- `region` should be ISO 3166-1 alpha-2 country code (e.g., 'FR' for France)@@ -37,10 +37,43 @@ def is_valid_phone_number(phone: str, region: str = "FR") -> None:raise ValueError(f"Invalid phone number: {phone}")except NumberParseException:raise ValueError(f"Invalid phone number: {phone}")++def resolve_type(details: dict) -> str:+ if "anyOf" in details:+ types = []+ for option in details["anyOf"]:+ if "$ref" in option:+ ref = option["$ref"].split("/")[-1]+ types.append(ref)+ else:+ types.append(option.get("type", "unknown"))+ return " | ".join(types)++ if "type" in details:+ if details["type"] == "array":+ item_type = resolve_type(details.get("items", {}))+ return f"{item_type}[]"+ return details["type"]++ return "any"++def extract_input_schema(name: str, model: BaseModel) -> dict:+ adapter = TypeAdapter(model)+ schema = adapter.json_schema()+ properties = schema.get("properties", {})-class DataType(str, Enum):- STRING = "string"- NUMBER = "number"- BOOLEAN = "boolean"- ARRAY = "array"- OBJECT = "object"+ return {+ "class_name": name,+ "name": name,+ "module": model.__module__,+ "doc": model.__doc__,+ "outputs": [+ {+ "name": prop,+ "type": resolve_type(val)+ }+ for prop, val in properties.items()+ ],+ "inputs": [],+ "type": "input"+ }diff --git a/flowsint-api/requirements.txt b/flowsint-api/requirements.txtindex f2729266..d7c6a537 100644--- a/flowsint-api/requirements.txt+++ b/flowsint-api/requirements.txt@@ -16,4 +16,5 @@ pydigghuntignoranthibpwned-phonenumbers\ No newline at end of file+phonenumbers+pydantic[email]\ No newline at end of filediff --git a/flowsint-api/tests/api/test_api.py b/flowsint-api/tests/api/test_api.pydeleted file mode 100644index 967ef27f..00000000--- a/flowsint-api/tests/api/test_api.py+++ /dev/null@@ -1,87 +0,0 @@-from fastapi.testclient import TestClient-from app.main import app--client = TestClient(app)--def test_start_scan_no_body():- body = {}- response = client.post("/scan", data=body)- assert response.status_code == 403- data = response.json()- assert(data["detail"] == "Not authenticated")- assert data is not None--def test_get_scans_list():- response = client.get("/scanners")- assert response.status_code == 200- data = response.json()-- assert "scanners" in data- assert isinstance(data["scanners"], dict)- for key in data["scanners"].keys():- scanner = data["scanners"][key]- assert isinstance(scanner, dict)- assert "class_name" in scanner- assert "name" in scanner- assert "module" in scanner- assert "key" in scanner--def test_get_scans_list_for_editor():- response = client.get("/transforms/nodes")- assert response.status_code == 200- data = response.json()-- assert "items" in data- assert isinstance(data["items"], dict)-- categories = ["social_account", "emails", "websites", "phones", "leaks"]- for category in categories:- assert category in data["items"]- assert isinstance(data["items"][category], list)- assert len(data["items"][category]) > 0-- for scanner in data["items"][category]:- assert isinstance(scanner, dict)- assert "class_name" in scanner- assert "name" in scanner- assert "module" in scanner- assert "key" in scanner-- assert isinstance(scanner["class_name"], str)- assert len(scanner["class_name"]) > 0- assert isinstance(scanner["name"], str)- assert len(scanner["name"]) > 0-- assert "types" in data["items"]- assert isinstance(data["items"]["types"], list)- assert len(data["items"]["types"]) > 0-- for osint_type in data["items"]["types"]:- assert isinstance(osint_type, dict)- assert "name" in osint_type- assert "regex" in osint_type- assert "description" in osint_type-- assert isinstance(osint_type["regex"], str)- assert len(osint_type["regex"]) > 0---def test_vaildate_transform_no_scans():- body = {"scanners": []}- response = client.post("/transforms/validate", json=body)- data = response.json()- assert(data["valid"] == False)- assert(data["reason"] == "No scanners provided")--def test_vaildate_transform_invalid_scans():- body = {"scanners": ["sherlock_scanner", "maigret_scanner", "dummy_scanner"]}- response = client.post("/transforms/validate", json=body)- data = response.json()- assert(data["valid"] == False)- assert(data["reason"] == "Scanner 'dummy_scanner' not found in registry")--def test_vaildate_transform_valid_scans():- body = {"scanners": ["sherlock_scanner", "maigret_scanner", "ignorant_scanner"]}- response = client.post("/transforms/validate", json=body)- data = response.json()- assert(data["valid"] == True)\ No newline at end of filediff --git a/flowsint-api/tests/scanners/domains/__init__.py b/flowsint-api/tests/scanners/domains/__init__.pynew file mode 100644index 00000000..e69de29bdiff --git a/flowsint-api/tests/scanners/domains/subdomains.py b/flowsint-api/tests/scanners/domains/subdomains.pynew file mode 100644index 00000000..acb51a27--- /dev/null+++ b/flowsint-api/tests/scanners/domains/subdomains.py@@ -0,0 +1,74 @@+import pytest+from app.scanners.domains.subdomains import SubdomainScanner+from app.types.domain import Domain++scanner = SubdomainScanner("123")++def test_preprocess_filters_invalid_domains():+ domains = [+ Domain(domain="example.com"),+ Domain(domain="invalid_domain") # devrait être filtré+ ]+ result = scanner.preprocess(domains)++ result_domains = [d.domain for d in result]+ assert "example.com" in result_domains+ assert "invalid_domain" not in result_domains+ assert len(result_domains) == 1+++def test_scan_extracts_subdomains(monkeypatch):+ mock_response = [+ {"name_value": "mail.example.com\nwww.example.com"},+ {"name_value": "api.example.com"},+ {"name_value": "invalid_domain"}, # devrait être ignoré+ ]++ class MockRequestsResponse:+ def __init__(self, json_data):+ self._json_data = json_data+ self.status_code = 200++ def json(self):+ return self._json_data++ @property+ def ok(self):+ return True++ def mock_get(url, timeout):+ assert "example.com" in url+ return MockRequestsResponse(mock_response)++ # Patch la requête réseau dans le module scanner+ monkeypatch.setattr("requests.get", mock_get)++ input_data = [Domain(domain="example.com")]+ result = scanner.scan(input_data)++ found = sorted([d.domain for d in result])+ expected = sorted([+ "mail.example.com",+ "www.example.com",+ "api.example.com"+ ])+ assert found == expected+++def test_scan_handles_network_errors(monkeypatch):+ def raise_timeout(url, timeout):+ raise Exception("Network error")++ monkeypatch.setattr("requests.get", raise_timeout)++ input_data = [Domain(domain="example.com")]+ result = scanner.scan(input_data)++ assert result == []+++def test_schemas():+ input_schema = scanner.input_schema()+ output_schema = scanner.output_schema()+ assert input_schema == [{'name': 'domain', 'type': 'string'}]+ assert output_schema == [{'name': 'domain', 'type': 'string'}]diff --git a/flowsint-api/tests/scanners/domains/whois.py b/flowsint-api/tests/scanners/domains/whois.pynew file mode 100644index 00000000..38316c00--- /dev/null+++ b/flowsint-api/tests/scanners/domains/whois.py@@ -0,0 +1,68 @@+from app.scanners.domains.whois import WhoisScanner+from app.types.domain import Domain+from app.types.whois import Whois+from app.types.email import Email++scanner = WhoisScanner("123")++def test_preprocess_valid_domains():+ domains = [+ Domain(domain="example.com"),+ Domain(domain="example2.com"),+ ]+ result = scanner.preprocess(domains)++ result_domains = [d.domain for d in result]+ expected_domains = [d.domain for d in domains]++ assert result_domains == expected_domains++def test_preprocess_invalid_domains():+ domains = [+ Domain(domain="example.com"),+ Domain(domain="invalid_domain"),+ Domain(domain="example.org"),+ ]+ result = scanner.preprocess(domains)++ result_domains = [d.domain for d in result]+ assert "example.com" in result_domains+ assert "example.org" in result_domains+ assert "invalid_domain" not in result_domains++def test_scan_returns_whois_objects(monkeypatch):+ # Patch `whois.whois` to avoid real network call+ mock_whois = lambda domain: {+ "registrar": "MockRegistrar",+ "org": "MockOrg",+ "city": "MockCity",+ "country": "MockCountry",+ "emails": ["[email protected]"],+ "creation_date": "2020-01-01",+ "expiration_date": "2030-01-01"+ }++ monkeypatch.setattr("whois.whois", mock_whois)++ input_data = [Domain(domain="example.com")]+ output = scanner.execute(input_data)+ assert isinstance(output, list)+ # assert isinstance(output[0], Whois)+ assert output[0].org == "MockOrg"+ # assert isinstance(output[0].email, Email)+ assert output[0].email.email == "[email protected]"++def test_scan_handles_whois_error(monkeypatch):+ monkeypatch.setattr("app.scanners.domains.whois.whois", lambda domain: (_ for _ in ()).throw(Exception("fail")))++ input_data = [Domain(domain="example.com")]+ output = scanner.scan(input_data)++ # WHOIS failed, result should be empty or skipped+ assert output == []++def test_schemas():+ input_schema = scanner.input_schema()+ output_schema = scanner.output_schema()+ assert input_schema == [{'name': 'domain', 'type': 'string'}]+ assert output_schema == [{'name': 'registrar', 'type': 'string | null'}, {'name': 'org', 'type': 'string | null'}, {'name': 'city', 'type': 'string | null'}, {'name': 'country', 'type': 'string | null'}, {'name': 'email', 'type': 'Email | null'}, {'name': 'creation_date', 'type': 'string | null'}, {'name': 'expiration_date', 'type': 'string | null'}]diff --git a/flowsint-api/tests/scanners/test_domain_infos_scanner.py b/flowsint-api/tests/scanners/test_domain_infos_scanner.pydeleted file mode 100644index 1d06645b..00000000--- a/flowsint-api/tests/scanners/test_domain_infos_scanner.py+++ /dev/null@@ -1,38 +0,0 @@-import pytest-from app.scanners.domains.domain_infos import DomainInfosScanner--SCAN_ID = "1234567890"-VALID_DOMAIN = "example.com"-INVALID_DOMAIN = "thisisnotadomain"--def scanner():- return DomainInfosScanner(SCAN_ID)--def test_name(scanner):- assert scanner.name() == "domain_infos_scanner"--def test_category(scanner):- assert scanner.category() == "websites"--def test_key(scanner):- assert scanner.key() == "url"-[email protected](True, reason="Skip long-running test")-def test_scan_valid_domain(scanner):- results = scanner.execute([VALID_DOMAIN])- assert isinstance(results.get("output", {}), dict)--def test_preprocess(scanner):- with pytest.raises(ValueError, match="Invalid domain"):- scanner.preprocess([INVALID_DOMAIN])--def test_postprocess(scanner):- raw_results = [{'domain': 'example.com', 'whois_raw': '', 'subdomains': ['dev.example.com', 'm.example.com']}]- enriched = scanner.postprocess(raw_results)- assert isinstance(enriched["output"], dict)- assert enriched["output"]["domains"][0]["domain"] == "example.com"- assert len(enriched["output"]["domains"]) == 1- assert isinstance(enriched["output"]["domains"][0]["whois_raw"], str)- assert isinstance(enriched["output"]["domains"][0]["subdomains"], list)-diff --git a/flowsint-api/tests/scanners/test_ignorant_scanner.py b/flowsint-api/tests/scanners/test_ignorant_scanner.pydeleted file mode 100644index f79f6fb8..00000000--- a/flowsint-api/tests/scanners/test_ignorant_scanner.py+++ /dev/null@@ -1,29 +0,0 @@-import pytest-from app.scanners.phones.ignorant import IgnorantScanner--SCAN_ID = "1234567890"-VALID_PHONE_NUMBER = "0621218225"-INVALID_PHONE_NUMBER = "WHAT IS THIS #@!$"--def scanner():- return IgnorantScanner(SCAN_ID)--def test_name(scanner):- assert scanner.name() == "ignorant_scanner"--def test_category(scanner):- assert scanner.category() == "phones"--def test_key(scanner):- assert scanner.key() == "phone_number"-[email protected](True, reason="Skip long-running test")-def test_scan_valid_username(scanner):- results = scanner.execute([VALID_PHONE_NUMBER])- assert isinstance(results.get("output", {}), dict)--def test_postprocess(scanner):- raw_results = []- enriched = scanner.postprocess(raw_results)- assert isinstance(enriched.get("output", {}), dict)diff --git a/flowsint-api/tests/scanners/test_maigret_scanner.py b/flowsint-api/tests/scanners/test_maigret_scanner.pydeleted file mode 100644index 7c0766b1..00000000--- a/flowsint-api/tests/scanners/test_maigret_scanner.py+++ /dev/null@@ -1,47 +0,0 @@-import pytest-from app.scanners.usernames.maigret import MaigretScanner--SCAN_ID = "1234567890"-VALID_USERNAME = "toto123"-INVALID_USERNAME = "Wow this is wrong #@!$"--def scanner():- return MaigretScanner(SCAN_ID)--def test_name(scanner):- assert scanner.name() == "maigret_scanner"--def test_category(scanner):- assert scanner.category() == "social_account"--def test_key(scanner):- assert scanner.key() == "username"-[email protected](True, reason="Skip long-running test")-def test_scan_valid_username(scanner):- results = scanner.execute([VALID_USERNAME])- assert isinstance(results.get("output", {}), dict)--def test_postprocess(scanner):- raw_results = {- "BikeRadar": {- "rank": 14858,- "site": {- "url": "https://forum.bikeradar.com/profile/{username}",- "tags": [- "forum",- "gb",- "us"- ],- "urlMain": "https://forum.bikeradar.com",- "alexaRank": 14858,- "checkType": "status_code",- "usernameClaimed": "adam",- "usernameUnclaimed": "noonewouldeverusethis7"- }}}-- enriched = scanner.postprocess(raw_results)- assert isinstance(enriched["output"], dict)--diff --git a/flowsint-api/tests/scanners/test_sherlock_scanner.py b/flowsint-api/tests/scanners/test_sherlock_scanner.pydeleted file mode 100644index c957212f..00000000--- a/flowsint-api/tests/scanners/test_sherlock_scanner.py+++ /dev/null@@ -1,37 +0,0 @@-import pytest-from app.scanners.usernames.sherlock import SherlockScanner--SCAN_ID = "1234567890"-VALID_USERNAME = "toto123"-INVALID_USERNAME = "Wow this is wrong #@!$"--def scanner():- return SherlockScanner(SCAN_ID)--def test_name(scanner):- assert scanner.name() == "sherlock_scanner"--def test_category(scanner):- assert scanner.category() == "social_account"--def test_key(scanner):- assert scanner.key() == "username"-[email protected](True, reason="Skip long-running test")-def test_scan_valid_username(scanner):- results = scanner.execute(VALID_USERNAME)- assert isinstance(results.get("output", []), dict)--def test_postprocess(scanner):- raw_results = {- "x.com":"https://x.com/toto123",- "music.yandex":"https://music.yandex/users/toto123/playlists",- "www.smule.com":"https://www.smule.com/toto123"- }-- enriched = scanner.postprocess(raw_results)- assert isinstance(enriched["output"], dict)---diff --git a/flowsint-api/tests/scanners/test_transform_orchestrator b/flowsint-api/tests/scanners/test_transform_orchestratordeleted file mode 100644index 5baa67e8..00000000--- a/flowsint-api/tests/scanners/test_transform_orchestrator+++ /dev/null@@ -1,37 +0,0 @@-import pytest-from app.scanners.orchestrator import TransformOrchestrator--VALID_USERNAME = "johnsmith"-INVALID_SCANNER_NAME = "does_not_exist"--def test_transform_orchestrator_valid_execution():- orchestrator = TransformOrchestrator(- scan_id="test-scan-123",- scanner_names=["sherlock_scanner", "maigret_scanner"]- )- results = orchestrator.execute(VALID_USERNAME)-- assert results["value"] == VALID_USERNAME- assert "scanners" in results- assert "results" in results- assert "sherlock_scanner" in results["results"]- assert "maigret_scanner" in results["results"]--def test_transform_orchestrator_with_invalid_scanner_name():- with pytest.raises(ValueError) as exc:- TransformOrchestrator(- scan_id="test-scan-456",- scanner_names=["sherlock_scanner", INVALID_SCANNER_NAME]- )- assert "not found in registry" in str(exc.value)--def test_transform_orchestrator_output_structure():- orchestrator = TransformOrchestrator(- scan_id="test-scan-789",- scanner_names=["sherlock_scanner"]- )- results = orchestrator.execute(VALID_USERNAME)-- assert isinstance(results, dict)- assert isinstance(results["scanners"], list)- assert isinstance(results["results"], dict)diff --git a/flowsint-web/package.json b/flowsint-web/package.jsonindex a718b856..db8c8ab9 100644--- a/flowsint-web/package.json+++ b/flowsint-web/package.json@@ -79,6 +79,7 @@"next-themes": "^0.4.4","nextjs-toploader": "^3.7.15","nuqs": "^2.4.0",+ "openapi-typescript": "^7.6.1","popover": "^2.4.1","postcss": "^8.5.1","react": "^19.1.0",@@ -129,4 +130,4 @@"@tailwindcss/oxide-linux-x64-gnu": "^4.0.1","lightningcss-linux-x64-gnu": "^1.29.1"}-}+}\ No newline at end of filediff --git a/flowsint-web/src/app/api/investigations/[investigation_id]/individuals/[individual_id]/route.ts b/flowsint-web/src/app/api/investigations/[investigation_id]/individuals/[individual_id]/route.tsindex ce57c57d..52ef14d9 100644--- a/flowsint-web/src/app/api/investigations/[investigation_id]/individuals/[individual_id]/route.ts+++ b/flowsint-web/src/app/api/investigations/[investigation_id]/individuals/[individual_id]/route.ts@@ -16,8 +16,8 @@ export async function GET(_: Request, { params }: { params: Promise<{ individual.from('individuals').select(`*,- ip_addresses(*),- phone_numbers(*),+ ips(*),+ phones(*),social_accounts(*),emails(*)`)diff --git a/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/individuals/route.ts b/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/individuals/route.tsindex 5f6329ac..5b91c1be 100644--- a/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/individuals/route.ts+++ b/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/individuals/route.ts@@ -21,7 +21,7 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{.from('individuals').select([`*`,includeEmails && "emails(email)",- includePhones && "phone_numbers(phone_number)",+ includePhones && "phones(number)",].filter(Boolean).join(', '), { count: "exact" }).order("created_at", { ascending: false }).eq("sketch_id", sketch_id)diff --git a/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/ips/route.ts b/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/ips/route.tsindex 08f3334c..4ef14232 100644--- a/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/ips/route.ts+++ b/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/ips/route.ts@@ -13,7 +13,7 @@ export async function GET(_: Request, { params }: { params: Promise<{ sketch_id:return NextResponse.json({ error: "Unauthorized" }, { status: 401 })}const { data: ips, error } = await supabase- .from('ip_addresses')+ .from('ips').select(`*`).eq("sketch_id", sketch_id)diff --git a/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/phones/route.ts b/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/phones/route.tsindex 3c530add..139f8ca8 100644--- a/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/phones/route.ts+++ b/flowsint-web/src/app/api/investigations/[investigation_id]/sketches/[sketch_id]/phones/route.ts@@ -13,7 +13,7 @@ export async function GET(_: Request, { params }: { params: Promise<{ sketch_id:return NextResponse.json({ error: "Unauthorized" }, { status: 401 })}const { data: phones, error } = await supabase- .from('phone_numbers')+ .from('phones').select(`*`).eq("sketch_id", sketch_id)diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsxindex 9e778845..982d212e 100644--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsx+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/table/data-table.tsx@@ -183,11 +183,11 @@ const columns: ColumnDef<any>[] = [enableHiding: false,},{- accessorKey: "phone_numbers",+ accessorKey: "phones",header: "Phone(s)",cell: ({ row }: any) => {return <Badge variant="outline" className="px-1.5 text-muted-foreground flex items-center gap-2 max-w-[290px]">- <span className="truncate text-ellipsis">{row.original.data?.phone_numbers?.map(({ phone_number }: any) => phone_number).join(", ") || <span className="italic opacity-60">No phone number yet.</span>}</span>+ <span className="truncate text-ellipsis">{row.original.data?.phones?.map(({ number }: any) => number).join(", ") || <span className="italic opacity-60">No phone number yet.</span>}</span></Badge>},enableHiding: false,diff --git a/flowsint-web/src/app/dashboard/transforms/[transform_id]/page.tsx b/flowsint-web/src/app/dashboard/transforms/[transform_id]/page.tsxindex a8799f7a..96e43b47 100644--- a/flowsint-web/src/app/dashboard/transforms/[transform_id]/page.tsx+++ b/flowsint-web/src/app/dashboard/transforms/[transform_id]/page.tsx@@ -3,9 +3,7 @@ import { createClient } from "@/lib/supabase/server"import { notFound } from "next/navigation"async function fetchNodes() {- const res = await fetch(`${process.env.NEXT_PUBLIC_DOCKER_FLOWSINT_API}/transforms/nodes`, {- next: { revalidate: 3600 }- })+ const res = await fetch(`${process.env.NEXT_PUBLIC_DOCKER_FLOWSINT_API}/transforms/nodes`)if (!res.ok) {notFound()}diff --git a/flowsint-web/src/components/dashboard/main-nav.tsx b/flowsint-web/src/components/dashboard/main-nav.tsxindex 45078d2a..b692db84 100644--- a/flowsint-web/src/components/dashboard/main-nav.tsx+++ b/flowsint-web/src/components/dashboard/main-nav.tsx@@ -3,7 +3,7 @@ import type React from "react"import Link from "next/link"import { cn } from "@/lib/utils"import InvestigationSelector from "../investigations/investigation-selector"-import CaseSelector from "../sketches/case-selector"+import CaseSelector from "../sketches/sketch-selector"import { useParams, usePathname } from "next/navigation"export function MainNav({ className, ...props }: React.HTMLAttributes<HTMLElement>) {diff --git a/flowsint-web/src/components/investigations/investigation-selector.tsx b/flowsint-web/src/components/investigations/investigation-selector.tsxindex 4ee10de5..d78b00cd 100644--- a/flowsint-web/src/components/investigations/investigation-selector.tsx+++ b/flowsint-web/src/components/investigations/investigation-selector.tsx@@ -33,7 +33,7 @@ export default function InvestigationSelector() {{isLoading ? <Skeleton className="h-8 w-40 bg-foreground/10" /> :// @ts-ignore<Select onValueChange={handleSelectionChange} defaultValue={investigation_id}>- <SelectTrigger className="min-w-none h-8 w-full hover:bg-foreground/10 rounded-sm font-medium shadow-none border-none text-ellipsis truncate gap-1">+ <SelectTrigger className="min-w-none h-8 w-full hover:bg-foreground/10 rounded-sm font-medium shadow-none border-none text-ellipsis truncate gap-1 inset-shadow-none"><SelectValue placeholder="Select an investigation" /><Badge variant="outline" className="ml-1 rounded-full shadow-none">Case</Badge></SelectTrigger><SelectContent>diff --git a/flowsint-web/src/components/sketches/add-contributor.tsx b/flowsint-web/src/components/sketches/add-contributor.tsxindex 47aa61be..f9f6fa6a 100644--- a/flowsint-web/src/components/sketches/add-contributor.tsx+++ b/flowsint-web/src/components/sketches/add-contributor.tsx@@ -175,10 +175,10 @@ export function AddInvestigationModal({ sketchId, open, setOpen }: AddInvestigat{mutation.isPending ? (<div className="flex items-center gap-2"><Loader2 className="h-4 w-4 animate-spin" />- <span>Ajout en cours...</span>+ <span>Adding...</span></div>) : (- "Ajouter à l'investigation"+ "Add contributor")}</Button></DialogFooter>diff --git a/flowsint-web/src/components/sketches/dynamic-form.tsx b/flowsint-web/src/components/sketches/dynamic-form.tsxnew file mode 100644index 00000000..b3c734d4--- /dev/null+++ b/flowsint-web/src/components/sketches/dynamic-form.tsx@@ -0,0 +1,443 @@+"use client"++import { useState, useMemo } from "react"+import { useForm, Controller } from "react-hook-form"+import { zodResolver } from "@hookform/resolvers/zod"+import * as z from "zod"+import { format } from "date-fns"+import { fr } from "date-fns/locale"+import { CalendarIcon, Loader2, InfoIcon } from "lucide-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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"+import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"+import { Calendar } from "@/components/ui/calendar"+import { cn } from "@/lib/utils"+import { actionItems } from "@/lib/action-items"+import type { FormField } from "@/lib/action-items"+import { MetadataField } from "@/components/sketches/metadata-field"+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"+import { toast } from "sonner"++interface DynamicFormProps {+ type: string+ initialData?: Record<string, any>+ onSubmit?: (data: any) => Promise<void>+ isForm?: boolean+ loading?: boolean+}++export function DynamicForm({ type, initialData = {}, onSubmit, isForm = true, loading = false }: DynamicFormProps) {+ const [isSubmitting, setIsSubmitting] = useState(false)++ const actionItem = useMemo(() => {+ return (+ actionItems.find((item) => item.type === type) ||+ actionItems+ .filter((item) => item.children)+ .flatMap((item) => item.children || [])+ .find((item) => item.type === type)+ )+ }, [type])++ const dynamicSchema = useMemo(() => {+ const createDynamicSchema = () => {+ const schemaMap: Record<string, z.ZodType<any>> = {}+ if (!actionItem) return z.object(schemaMap)+ actionItem.fields.forEach((field) => {+ switch (field.type) {+ case "email":+ schemaMap[field.name] = field.required+ ? z+ .string()+ .min(1, { message: `${field.label} est requis` })+ .email({ message: "Email invalide" })+ : z.string().email({ message: "Email invalide" }).optional()+ break+ case "url":+ schemaMap[field.name] = field.required+ ? z+ .string()+ .min(1, { message: `${field.label} est requis` })+ .url({ message: "URL invalide" })+ : z.string().url({ message: "URL invalide" }).optional()+ break+ case "number":+ schemaMap[field.name] = field.required+ ? z+ .string()+ .min(1, { message: `${field.label} est requis` })+ .refine((val) => !isNaN(Number(val)), {+ message: "Doit être un nombre valide",+ })+ : z+ .string()+ .refine((val) => val === "" || !isNaN(Number(val)), {+ message: "Doit être un nombre valide",+ })+ .optional()+ break+ case "select":+ if (field.options && field.options.length > 0) {+ const validValues = field.options.map((option) => option.value)+ schemaMap[field.name] = field.required+ ? z+ .string()+ .min(1, { message: `${field.label} est requis` })+ .refine((val) => validValues.includes(val), {+ message: "Valeur non valide",+ })+ : z+ .string()+ .refine((val) => val === "" || validValues.includes(val), {+ message: "Valeur non valide",+ })+ .optional()+ } else {+ schemaMap[field.name] = field.required+ ? z.string().min(1, { message: `${field.label} est requis` })+ : z.string().optional()+ }+ break+ case "date":+ schemaMap[field.name] = field.required+ ? z.string().min(1, { message: `${field.label} est requis` })+ : z.string().optional()+ break+ case "hidden":+ schemaMap[field.name] = z.string()+ break+ case "textarea":+ schemaMap[field.name] = field.required+ ? z.string().min(1, { message: `${field.label} est requis` })+ : z.string().optional()+ break+ case "metadata":+ schemaMap[field.name] = field.required+ ? z.record(z.string(), z.string()).refine((val) => Object.keys(val).length > 0, {+ message: "Au moins une métadonnée est requise",+ })+ : z.record(z.string(), z.string()).optional()+ break+ default:+ schemaMap[field.name] = field.required+ ? z.string().min(1, { message: `${field.label} est requis` })+ : z.string().optional()+ }+ })+ return z.object(schemaMap)+ }+ return createDynamicSchema()+ }, [actionItem])++ type FormValues = z.infer<typeof dynamicSchema>+ const getDefaultValues = () => {+ const defaults: Record<string, any> = {}++ if (!actionItem) return defaults++ actionItem.fields.forEach((field) => {+ // Si nous avons des données initiales pour ce champ, les utiliser+ if (initialData && initialData[field.name] !== undefined) {+ defaults[field.name] = initialData[field.name]+ }+ // Sinon, gérer les différents types de champs+ else if (field.type === "hidden") {+ const fieldKey = actionItem.key+ const match = fieldKey.match(/_([^_]+)$/)+ if ((match && match[1] && field.name === "platform") || field.name === "type") {+ defaults[field.name] = match?.[1]+ } else {+ defaults[field.name] = ""+ }+ } else if (field.type === "select") {+ // Pour les champs select, vérifier s'il y a des options+ if (field.options && field.options.length > 0) {+ // Si requis, utilisez la première option comme valeur par défaut+ // Sinon, utilisez une chaîne vide car un champ facultatif peut être vide+ defaults[field.name] = field.required && field.options.length > 0 ? field.options[0].value : ""+ } else {+ defaults[field.name] = ""+ }+ } else if (field.type === "date") {+ // Pour les champs de date, nous laissons une chaîne vide+ // mais nous nous assurerons plus tard que les manipulations de dates sont robustes+ defaults[field.name] = ""+ } else if (field.type === "metadata") {+ defaults[field.name] = {}+ } else {+ defaults[field.name] = ""+ }+ })++ return defaults+ }++ const {+ register,+ handleSubmit,+ control,+ formState: { errors },+ } = useForm<FormValues>({+ resolver: zodResolver(dynamicSchema),+ defaultValues: getDefaultValues(),+ })++ const handleFormSubmit = async (data: FormValues) => {+ if (!isForm) return+ try {+ setIsSubmitting(true)+ if (onSubmit) {+ await onSubmit(data)+ }+ } catch (error) {+ console.log(error)+ toast.error("An error occurred while submitting the form.")+ } finally {+ setIsSubmitting(false)+ }+ }++ const renderField = (field: FormField) => {+ if (field.type === "hidden") {+ return <input key={field.name} type="hidden" {...register(field.name)} />+ }+ const FieldDescription = field.description ? (+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <InfoIcon className="h-4 w-4 text-muted-foreground ml-1 cursor-help" />+ </TooltipTrigger>+ <TooltipContent>+ <p className="max-w-xs">{field.description}</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ ) : null++ switch (field.type) {+ case "text":+ case "email":+ case "tel":+ case "number":+ return (+ <div className="space-y-2" key={field.name}>+ <div className="flex items-center">+ <Label htmlFor={field.name} className="text-sm font-medium">+ {field.label}+ {field.required && <span className="text-destructive ml-1">*</span>}+ </Label>+ {FieldDescription}+ </div>+ <Input+ id={field.name}+ type={field.type}+ placeholder={field.placeholder || `Enter ${field.label.toLowerCase()}`}+ className={errors[field.name] ? "border-destructive" : ""}+ {...register(field.name)}+ />+ {errors[field.name] && <p className="text-xs text-destructive">{String(errors[field.name]?.message)}</p>}+ </div>+ )++ case "textarea":+ return (+ <div className="space-y-2" key={field.name}>+ <div className="flex items-center">+ <Label htmlFor={field.name} className="text-sm font-medium">+ {field.label}+ {field.required && <span className="text-destructive ml-1">*</span>}+ </Label>+ {FieldDescription}+ </div>+ <Textarea+ id={field.name}+ placeholder={field.placeholder || `Enter ${field.label.toLowerCase()}`}+ className={errors[field.name] ? "border-destructive" : ""}+ {...register(field.name)}+ />+ {errors[field.name] && <p className="text-xs text-destructive">{String(errors[field.name]?.message)}</p>}+ </div>+ )++ case "select":+ return (+ <div className="space-y-2" key={field.name}>+ <div className="flex items-center">+ <Label htmlFor={field.name} className="text-sm font-medium">+ {field.label}+ {field.required && <span className="text-destructive ml-1">*</span>}+ </Label>+ {FieldDescription}+ </div>+ <Controller+ control={control}+ name={field.name}+ render={({ field: { onChange, value, ref } }) => (+ <Select+ onValueChange={onChange}+ value={value || ""}+ defaultValue={value || ""}+ >+ <SelectTrigger+ ref={ref}+ id={field.name}+ className={errors[field.name] ? "border-destructive" : ""}+ >+ <SelectValue placeholder={field.placeholder || `Select ${field.label.toLowerCase()}`} />+ </SelectTrigger>+ <SelectContent>+ {!field.required && (+ <SelectItem value=" ">-- Sélectionner --</SelectItem>+ )}+ {field.options?.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ {errors[field.name] && <p className="text-xs text-destructive">{String(errors[field.name]?.message)}</p>}+ </div>+ )++ case "date":+ return (+ <div className="space-y-2" key={field.name}>+ <div className="flex items-center">+ <Label htmlFor={field.name} className="text-sm font-medium">+ {field.label}+ {field.required && <span className="text-destructive ml-1">*</span>}+ </Label>+ {FieldDescription}+ </div>+ <Controller+ control={control}+ name={field.name}+ render={({ field: { onChange, value, ref } }) => {+ // Sécurisation des valeurs de date+ const dateValue = value ?+ (typeof value === 'string' && value.trim() !== '' ? new Date(value) : null) :+ null;++ // Validation pour éviter les dates invalides+ const isValidDate = dateValue instanceof Date && !isNaN(dateValue.getTime());++ return (+ <Popover>+ <PopoverTrigger asChild>+ <Button+ ref={ref}+ type="button"+ variant="outline"+ className={cn(+ "w-full justify-start text-left font-normal",+ !isValidDate && "text-muted-foreground",+ errors[field.name] && "border-destructive",+ )}+ >+ <CalendarIcon className="mr-2 h-4 w-4" />+ {isValidDate+ ? format(dateValue as Date, "PPP", { locale: fr })+ : field.placeholder || `Sélectionner une date`}+ </Button>+ </PopoverTrigger>+ <PopoverContent className="w-auto p-0" align="start">+ <Calendar+ mode="single"+ selected={isValidDate ? dateValue as Date : undefined}+ onSelect={(date) => {+ // Assurer une bonne conversion vers ISO string+ onChange(date ? date.toISOString() : "")+ }}+ initialFocus+ />+ </PopoverContent>+ </Popover>+ )+ }}+ />+ {errors[field.name] && <p className="text-xs text-destructive">{String(errors[field.name]?.message)}</p>}+ </div>+ )++ case "url":+ return (+ <div className="space-y-2" key={field.name}>+ <div className="flex items-center">+ <Label htmlFor={field.name} className="text-sm font-medium">+ {field.label}+ {field.required && <span className="text-destructive ml-1">*</span>}+ </Label>+ {FieldDescription}+ </div>+ <Input+ id={field.name}+ type="url"+ placeholder={field.placeholder || `Enter ${field.label.toLowerCase()}`}+ className={errors[field.name] ? "border-destructive" : ""}+ {...register(field.name)}+ />+ {errors[field.name] && <p className="text-xs text-destructive">{String(errors[field.name]?.message)}</p>}+ </div>+ )++ case "metadata":+ return (+ <div className="space-y-2" key={field.name}>+ <div className="flex items-center">+ <Label htmlFor={field.name} className="text-sm font-medium">+ {field.label}+ {field.required && <span className="text-destructive ml-1">*</span>}+ </Label>+ {FieldDescription}+ </div>+ <Controller+ control={control}+ name={field.name}+ render={({ field: { onChange, value } }) => (+ <MetadataField+ value={value || {}}+ onChange={onChange}+ error={errors[field.name]?.message as string}+ className="border rounded-md p-3 bg-muted/30"+ />+ )}+ />+ </div>+ )+ default:+ return null+ }+ }++ if (!actionItem) {+ return <div className="p-4 text-center text-muted-foreground">Could not find this item.</div>+ }+ if (!isForm) {+ return <div className="space-y-4">{actionItem.fields.map(renderField)}</div>+ }+ return (+ <form onSubmit={handleSubmit(handleFormSubmit)} className="space-y-4">+ <div className="space-y-4">{actionItem.fields.map(renderField)}</div>++ <div className="flex justify-end space-x-2 pt-2">+ <Button type="submit" disabled={isSubmitting || loading}>+ {isSubmitting || loading ? (+ <>+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />+ Submitting...+ </>+ ) : (+ `Add ${actionItem.label}`+ )}+ </Button>+ </div>+ </form>+ )+}\ No newline at end of filediff --git a/flowsint-web/src/components/sketches/metadata-field.tsx b/flowsint-web/src/components/sketches/metadata-field.tsxnew file mode 100644index 00000000..424f6693--- /dev/null+++ b/flowsint-web/src/components/sketches/metadata-field.tsx@@ -0,0 +1,132 @@+"use client"++import { useState } from "react"+import { PlusCircle, X } from "lucide-react"+import { Button } from "@/components/ui/button"+import { Input } from "@/components/ui/input"+import { cn } from "@/lib/utils"++interface MetadataFieldProps {+ value: Record<string, string>+ onChange: (value: Record<string, string>) => void+ error?: string+ className?: string+}++export function MetadataField({ value = {}, onChange, error, className }: MetadataFieldProps) {+ const [newKey, setNewKey] = useState("")+ const [newValue, setNewValue] = useState("")+ const [localError, setLocalError] = useState<string | null>(null)++ const handleAddPair = () => {+ if (!newKey.trim()) {+ setLocalError("Key cannot be empty.")+ return+ }++ if (value[newKey]) {+ setLocalError(`Key "${newKey}" already exists`)+ return+ }++ const updatedMetadata = {+ ...value,+ [newKey]: newValue,+ }++ onChange(updatedMetadata)+ setNewKey("")+ setNewValue("")+ setLocalError(null)+ }++ const handleRemovePair = (key: string) => {+ const updatedMetadata = { ...value }+ delete updatedMetadata[key]+ onChange(updatedMetadata)+ }++ const handleKeyChange = (oldKey: string, newKey: string, itemValue: string) => {+ if (!newKey.trim()) {+ return+ }++ if (newKey !== oldKey && value[newKey]) {+ setLocalError(`Key "${newKey}" already exists`)+ return+ }++ const updatedMetadata = { ...value }+ delete updatedMetadata[oldKey]+ updatedMetadata[newKey] = itemValue+ onChange(updatedMetadata)+ setLocalError(null)+ }++ const handleValueChange = (key: string, newValue: string) => {+ const updatedMetadata = {+ ...value,+ [key]: newValue,+ }+ onChange(updatedMetadata)+ }++ return (+ <div className={cn("space-y-3", className)}>+ {Object.entries(value).length > 0 && (+ <div className="space-y-2">+ {Object.entries(value).map(([key, val]) => (+ <div key={key} className="flex items-center gap-2">+ <Input+ value={key}+ onChange={(e) => handleKeyChange(key, e.target.value, val)}+ placeholder="Clé"+ className="flex-1"+ />+ <span className="text-muted-foreground">:</span>+ <Input+ value={val}+ onChange={(e) => handleValueChange(key, e.target.value)}+ placeholder="Valeur"+ className="flex-1"+ />+ <Button+ type="button"+ variant="ghost"+ size="icon"+ onClick={() => handleRemovePair(key)}+ className="h-8 w-8 text-destructive"+ >+ <X className="h-4 w-4" />+ <span className="sr-only">Supprimer</span>+ </Button>+ </div>+ ))}+ </div>+ )}++ {/* Formulaire pour ajouter une nouvelle paire */}+ <div className="flex items-end gap-2">+ <div className="space-y-1 flex-1">+ <Input+ value={newKey}+ onChange={(e) => setNewKey(e.target.value)}+ placeholder="Key"+ className={localError ? "border-destructive" : ""}+ />+ </div>+ <span className="text-muted-foreground mb-2.5">:</span>+ <div className="space-y-1 flex-1">+ <Input value={newValue} onChange={(e) => setNewValue(e.target.value)} placeholder="Value" />+ </div>+ <Button type="button" size="sm" variant="outline" onClick={handleAddPair} className="mb-0.5">+ <PlusCircle className="h-4 w-4 mr-1" />+ Add+ </Button>+ </div>++ {/* Affichage des erreurs */}+ {(localError || error) && <p className="text-xs text-destructive">{localError || error}</p>}+ </div>+ )+}diff --git a/flowsint-web/src/components/sketches/new-actions.tsx b/flowsint-web/src/components/sketches/new-actions.tsxindex 77a55fe2..f5e22b95 100644--- a/flowsint-web/src/components/sketches/new-actions.tsx+++ b/flowsint-web/src/components/sketches/new-actions.tsx@@ -1,25 +1,30 @@"use client"+import type React from "react"import { useState } from "react"import { useParams } from "next/navigation"import { supabase } from "@/lib/supabase/client"import { Button } from "@/components/ui/button"-import { Input } from "@/components/ui/input"-import { AlertCircle, ArrowLeft, ArrowRight } from "lucide-react"+import { ArrowLeft, ArrowRight } from 'lucide-react'import { toast } from "sonner"-import { cn, nodesTypes } from "@/lib/utils"-import { Alert, AlertTitle, AlertDescription } from "../ui/alert"-import { Badge } from "../ui/badge"-import { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle } from "../ui/dialog"+import { cn } from "@/lib/utils"+import { Dialog, DialogContent, DialogDescription, DialogTitle } from "@/components/ui/dialog"import { actionItems, type ActionItem } from "@/lib/action-items"-import { useSketchStore } from "@/store/sketch-store"import { Card, CardContent } from "@/components/ui/card"import { AnimatePresence, motion } from "framer-motion"+import { DynamicForm } from "@/components/sketches/dynamic-form"+import { Badge } from "@/components/ui/badge"-export default function NewActions({ addNodes, children }: { addNodes: any, children: React.ReactNode }) {+interface ActionDialogProps {+ children: React.ReactNode+ addNodes?: (node: any) => void+ setCurrentNode?: (node: any) => void+}++export default function ActionDialog({ children, addNodes, setCurrentNode }: ActionDialogProps) {const { sketch_id } = useParams()+ const [openDialog, setOpenDialog] = useState(false)const [openAddNodeModal, setOpenNodeModal] = useState(false)- const { setCurrentNode, openActionDialog, setOpenActionDialog } = useSketchStore((state) => state)const [currentNodeType, setCurrentNodeType] = useState<any | null>(null)const [error, setError] = useState<string | null>(null)const [loading, setLoading] = useState(false)@@ -27,41 +32,48 @@ export default function NewActions({ addNodes, children }: { addNodes: any, chilconst [navigationHistory, setNavigationHistory] = useState<ActionItem[]>([])const handleOpenAddNodeModal = (key: string) => {- if (!nodesTypes[key as keyof typeof nodesTypes]) {- toast.error("Invalid node type.")+ const selectedItem = actionItems.find(item => item.type === key) ||+ actionItems+ .filter(item => item.children)+ .flatMap(item => item.children || [])+ .find(item => item.type === key)++ if (!selectedItem) {+ toast.error("Invalid node type selected.")return}- setCurrentNodeType(nodesTypes[key as keyof typeof nodesTypes])++ setCurrentNodeType(selectedItem)setError(null)- setOpenActionDialog(false)+ setOpenDialog(false)setOpenNodeModal(true)}- const onSubmitNewNodeModal = async (e: {- preventDefault: () => void- currentTarget: HTMLFormElement | undefined- }) => {- e.preventDefault()- const data = Object.fromEntries(new FormData(e.currentTarget))- await handleAddNode(data)- }-const handleAddNode = async (data: any) => {try {setLoading(true)+ if (!currentNodeType || !sketch_id) {+ toast.error("Invalid node type or sketch ID.")+ setLoading(false)+ return+ }+const dataToInsert = { ...data, sketch_id }+const { data: nodeData, error: insertError } = await supabase.from(currentNodeType.table).insert(dataToInsert).select("*").single()+if (insertError) {- toast.error("Failed to create node." + JSON.stringify(insertError))+ toast.error("Could not insert new node." + insertError.message)setLoading(false)return}+if (!nodeData) {- toast.error("Failed to create node.")+ toast.error("Could not insert new node.")setLoading(false)return}@@ -69,20 +81,27 @@ export default function NewActions({ addNodes, children }: { addNodes: any, chilid: nodeData.id,type: "custom",data: {- ...nodeData, label: data[currentNodeType.fields[0]], type: currentNodeType.type,+ ...nodeData,+ label: data[currentNodeType.fields[0].name],+ type: currentNodeType.type,},position: { x: 0, y: 0 },}- addNodes(newNode)- setCurrentNode(newNode)+ if (addNodes) {+ addNodes(newNode)+ }+ if (setCurrentNode) {+ setCurrentNode(newNode)+ }setOpenNodeModal(false)setError(null)+ toast.success(`${currentNodeType.label} successfully created.`)} catch (error) {- toast.error("An unexpected error occurred")- setOpenActionDialog(false)+ toast.error("Error submitting form.")+ setOpenDialog(false)} finally {setLoading(false)- setOpenActionDialog(false)+ setOpenDialog(false)}}@@ -115,7 +134,7 @@ export default function NewActions({ addNodes, children }: { addNodes: any, chil<ActionCardkey={item.id}item={item}- onSelect={item.children ? () => navigateToSubItems(item) : () => handleOpenAddNodeModal(item.key)}+ onSelect={item.children ? () => navigateToSubItems(item) : () => handleOpenAddNodeModal(item.type)}/>))}</motion.div>@@ -125,12 +144,8 @@ export default function NewActions({ addNodes, children }: { addNodes: any, chilreturn (<>- <Button asChild onClick={() => setOpenActionDialog(true)}>- {children}- </Button>-- {/* Action Selection Dialog */}- <Dialog open={openActionDialog} onOpenChange={setOpenActionDialog}>+ <Button asChild onClick={() => setOpenDialog(true)}>{children}</Button>+ <Dialog open={openDialog} onOpenChange={setOpenDialog}><DialogContent className="sm:max-w-[700px] h-[80vh] overflow-hidden flex flex-col"><DialogTitle className="flex items-center">{currentParent && (@@ -138,55 +153,36 @@ export default function NewActions({ addNodes, children }: { addNodes: any, chil<ArrowLeft className="h-4 w-4" /></Button>)}- {currentParent ? currentParent.label : "Select action"}+ {currentParent ? currentParent.label : "Sélectionner une action"}</DialogTitle><DialogDescription>{currentParent- ? `Select a ${currentParent.label} type to add`- : "Choose an action to add to your investigation"}+ ? `Sélectionnez un type de ${currentParent.label.toLowerCase()} à ajouter`+ : "Choisissez une action à ajouter"}</DialogDescription><div className="overflow-y-auto overflow-x-hidden pr-1 -mr-1 flex-grow">{renderActionCards()}</div></DialogContent></Dialog>- {/* Node Creation Dialog */}- <Dialog open={openAddNodeModal && currentNodeType} onOpenChange={setOpenNodeModal}>+ <Dialog open={openAddNodeModal} onOpenChange={setOpenNodeModal}><DialogContent>- <DialogTitle>New {currentNodeType?.type}</DialogTitle>- <DialogDescription>Add a new related {currentNodeType?.type}.</DialogDescription>- <form onSubmit={onSubmitNewNodeModal}>- <div className="flex flex-col gap-3">- {currentNodeType?.fields.map((field: any, i: number) => {- const [key, value] = field.split(":")- return (- <label key={i}>- <p className="my-2">{key}</p>- <Input defaultValue={value || ""} name={key} placeholder={`Your value here (${key})`} />- </label>- )- })}- </div>- {error && (- <Alert variant="destructive">- <AlertCircle className="h-4 w-4" />- <AlertTitle>Error</AlertTitle>- <AlertDescription>{error}</AlertDescription>- </Alert>+ <DialogTitle>+ {currentNodeType && (+ <>Add {currentNodeType.label.toLowerCase()}</>)}- <div className="flex items-center gap-2 justify-end mt-4">- <DialogClose asChild>- <Button type="button" variant="outline">- Cancel- </Button>- </DialogClose>- <Button disabled={loading} type="submit">- Save- </Button>- </div>- </form>- </DialogContent>- </Dialog>+ </DialogTitle>+ <DialogDescription>Feel the required data</DialogDescription>+ {currentNodeType && (+ <DynamicForm+ type={currentNodeType.type}+ isForm={true}+ loading={loading}+ onSubmit={handleAddNode}+ />+ )}+ </DialogContent >+ </Dialog ></>)}@@ -211,17 +207,21 @@ function ActionCard({ item, onSelect }: ActionCardProps) {<CardContent className="p-4 relative flex flex-col items-center text-center h-full"><divclassName="w-8 h-8 rounded-full flex items-center justify-center mb-3 mt-2"- style={{ backgroundColor: `${item.color}20` }} // Light background based on item color+ style={{ backgroundColor: item.color ? `${item.color}20` : "var(--primary-20)" }}>- <Icon style={{ color: item.color }} className="h-6 w-6 opacity-60 text-primary" />+ <Icon style={{ color: item.color }} className={cn("h-6 w-6 opacity-60", item.color ? "" : "text-primary")} /></div><div className="font-medium text-sm">{item.label}</div>{item.disabled && (<Badge variant="outline" className="mt-2 absolute top-2 left-2">- soon+ bientôt</Badge>)}- {item.children && <div className="absolute top-3 right-4 text-xs text-muted-foreground mt-1"><ArrowRight className="h-4 w-4" /></div>}+ {item.children && (+ <div className="absolute top-3 right-4 text-xs text-muted-foreground mt-1">+ <ArrowRight className="h-4 w-4" />+ </div>+ )}{item.children && <div className="text-xs text-muted-foreground mt-1">{item.children.length} options</div>}</CardContent></Card>diff --git a/flowsint-web/src/components/sketches/case-selector.tsx b/flowsint-web/src/components/sketches/sketch-selector.tsxsimilarity index 97%rename from flowsint-web/src/components/sketches/case-selector.tsxrename to flowsint-web/src/components/sketches/sketch-selector.tsxindex b3aa0060..9a977e73 100644--- a/flowsint-web/src/components/sketches/case-selector.tsx+++ b/flowsint-web/src/components/sketches/sketch-selector.tsx@@ -30,7 +30,7 @@ export default function CaseSelector() {<div className="flex items-center">{isLoading || sketch.isLoading ? <Skeleton className="h-8 w-40 bg-foreground/10" /> :<Select onValueChange={handleSelectionChange} defaultValue={sketch?.data?.id}>- <SelectTrigger className="min-w-none h-8 rounded-sm w-full hover:bg-foreground/10 font-medium shadow-none border-none text-ellipsis truncate gap-1">+ <SelectTrigger className="min-w-none h-8 rounded-sm w-full hover:bg-foreground/10 font-medium shadow-none border-none text-ellipsis truncate gap-1 inset-shadow-none"><SelectValue defaultValue={sketch?.data?.title || ""} placeholder="Select an investigation" /></SelectTrigger><SelectContent>diff --git a/flowsint-web/src/components/sketches/sketch/large-data-graph.tsx b/flowsint-web/src/components/sketches/sketch/large-data-graph.tsxindex 92fe9fbe..166a7478 100644--- a/flowsint-web/src/components/sketches/sketch/large-data-graph.tsx+++ b/flowsint-web/src/components/sketches/sketch/large-data-graph.tsx@@ -153,7 +153,6 @@ function LayoutFlow({ refetch, theme }: LayoutFlowProps) {ctx.fillStyle = theme === "dark" ? "#fff" : "#000"ctx.fillText(label, node.x, node.y)- // Ajouter un effet de surbrillance pour les nœuds en survolif (highlightNodes.has(node.id)) {ctx.strokeStyle = theme === "dark" ? "#fff" : "#000"ctx.lineWidth = 2@@ -163,7 +162,6 @@ function LayoutFlow({ refetch, theme }: LayoutFlowProps) {[highlightNodes, theme],)- // Amélioration des interactionsconst handleNodeHover = useCallback((node: ForceGraphNode | null) => {setHoverNode(node)@@ -175,7 +173,6 @@ function LayoutFlow({ refetch, theme }: LayoutFlowProps) {edges.forEach((edge) => {if (edge.source === node.id || edge.target === node.id) {connectedLinks.add(`${edge.source}-${edge.target}`)- // Ajouter les nœuds connectés à la surbrillance// @ts-ignoresetHighlightNodes((prev) => new Set([...prev, edge.source, edge.target]))}diff --git a/flowsint-web/src/components/sketches/sketch/nodes/custom-node.tsx b/flowsint-web/src/components/sketches/sketch/nodes/custom-node.tsxindex a987fb42..67495312 100644--- a/flowsint-web/src/components/sketches/sketch/nodes/custom-node.tsx+++ b/flowsint-web/src/components/sketches/sketch/nodes/custom-node.tsx@@ -29,15 +29,9 @@ export default memo(({ data }: any) => {<Badge variant="secondary" className={cn("p-0 rounded-full", item?.size || "h-5 w-5")}><Icon className="h-4 w-4" /></Badge>- {showNodeLabel && <div className="flex items-center gap-1">- <span className="text-sm">{data.label}</span>- <CopyButton className="rounded-full h-7 w-7 text-xs" content={data.label} />- </div>}</div></TooltipTrigger>- {!showNodeLabel &&- <TooltipContent selected={active} position={Position.Top}>{data.label}<CopyButton className="h-6 w-6" content={data.label} /></TooltipContent>- }+ <TooltipContent selected={active} position={Position.Top}>{data.label}<CopyButton className="h-6 w-6" content={data.label} /></TooltipContent><Handletype="target"style={{ visibility: "hidden" }}diff --git a/flowsint-web/src/components/sketches/sketch/nodes/node-context-menu.tsx b/flowsint-web/src/components/sketches/sketch/nodes/node-context-menu.tsxindex 8c50c53d..2d2d97ae 100644--- a/flowsint-web/src/components/sketches/sketch/nodes/node-context-menu.tsx+++ b/flowsint-web/src/components/sketches/sketch/nodes/node-context-menu.tsx@@ -27,6 +27,7 @@ import { NodeNotesEditor } from "./node-notes-editor"import { nodesTypes } from "@/lib/utils"import { actionItems, type ActionItem } from "@/lib/action-items"import { useLaunchSan } from "@/hooks/use-launch-scan"+import { DynamicForm } from "../../dynamic-form"// Node Context Menu componentinterface NodeContextMenuProps {@@ -107,16 +108,7 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {setError(null)setOpenNodeModal(true)}-- const onSubmitNewNodeModal = async (e: {- preventDefault: () => void- currentTarget: HTMLFormElement | undefined- }) => {- e.preventDefault()- const data = Object.fromEntries(new FormData(e.currentTarget))- await handleAddNode(data)- }-+const handleAddNode = async (data: any) => {try {setLoading(true)@@ -302,36 +294,12 @@ const NodeContextMenu = memo(({ x, y, onClose }: NodeContextMenuProps) => {<DialogContent><DialogTitle>New {nodeToInsert?.type}</DialogTitle><DialogDescription>Add a new related {nodeToInsert?.type}.</DialogDescription>- <form onSubmit={onSubmitNewNodeModal}>- <div className="flex flex-col gap-3">- {nodeToInsert?.fields.map((field: any, i: number) => {- const [key, value] = field.split(":")- return (- <label key={i}>- <p className="my-2">{key}</p>- <Input defaultValue={value || ""} name={key} placeholder={`Your value here(${key})`} />- </label>- )- })}- </div>- {error && (- <Alert variant="destructive">- <AlertCircle className="h-4 w-4" />- <AlertTitle>Error</AlertTitle>- <AlertDescription>{error}</AlertDescription>- </Alert>- )}- <div className="flex items-center gap-2 justify-end mt-4">- <DialogClose asChild>- <Button type="button" variant="outline">- Cancel- </Button>- </DialogClose>- <Button disabled={loading} type="submit">- Save- </Button>- </div>- </form>+ <DynamicForm+ type={nodeToInsert?.type}+ isForm={true}+ loading={loading}+ onSubmit={handleAddNode}+ /></DialogContent></Dialog>{currentNode.id && (diff --git a/flowsint-web/src/components/transforms/controls.tsx b/flowsint-web/src/components/transforms/controls.tsxindex db9c8dfa..e65ec23b 100644--- a/flowsint-web/src/components/transforms/controls.tsx+++ b/flowsint-web/src/components/transforms/controls.tsx@@ -1,9 +1,11 @@-import { memo } from "react";+import { memo, useCallback, useState } from "react";import { Button } from "@/components/ui/button";-import { MaximizeIcon, ZoomInIcon, ZoomOutIcon, NetworkIcon, PlayIcon, SaveIcon, TrashIcon } from "lucide-react";+import { MaximizeIcon, ZoomInIcon, ZoomOutIcon, NetworkIcon, PlayIcon, SaveIcon, TrashIcon, XIcon } from "lucide-react";import FullscreenButton from "../full-screen-button";import { Panel } from "@xyflow/react";import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";+import { InfoCircledIcon } from "@radix-ui/react-icons";+import useLocalStorage from "@/lib/hooks/use-local-storage";export const FlowControls = memo(({handleSaveSimulation,loading,@@ -13,6 +15,10 @@ export const FlowControls = memo(({zoomOut,handleDeleteSimulation}: any) => {+ const [hide, setHide] = useLocalStorage('hide-transform-message', false)+ const handleHide = useCallback(() => {+ setHide(true)+ }, [])return (<><Panel position="top-left" className="flex flex-col items-center gap-1">@@ -82,6 +88,20 @@ export const FlowControls = memo(({<TooltipContent>Zoom out</TooltipContent></Tooltip></Panel>+ {!hide && (+ <Panel position="bottom-right" className="flex flex-col items-center gap-1">+ <div className="max-w-lg relative text-sm p-3 border border-orange-500 dark:border-orange-800/70 bg-orange-300 dark:bg-orange-700/30 text-white rounded-md">+ <p className="flex items-center gap-1 font-bold mb-1"><InfoCircledIcon className="text-orange-500" /> Note</p>+ <p>+ Every input and output is under the list format. For example, SubdomainScanner will take a list of MinimalDomain and return a list of MinimalDomain.+ </p>+ <div className="absolute top-1 right-1">+ <Button onClick={handleHide} variant={"ghost"} size="icon" className="h-6 w-6">+ <XIcon />+ </Button>+ </div>+ </div>+ </Panel>)}</>)});\ No newline at end of filediff --git a/flowsint-web/src/components/transforms/editor.tsx b/flowsint-web/src/components/transforms/editor.tsxindex 58b0f86b..4141aca4 100644--- a/flowsint-web/src/components/transforms/editor.tsx+++ b/flowsint-web/src/components/transforms/editor.tsx@@ -47,7 +47,7 @@ const FlowEditor = memo(initialNodes,theme,}: { nodesData: { items: any[] }; theme: any; initialEdges: Edge[]; initialNodes: Node[] }) => {- const { fitView, zoomIn, zoomOut, setCenter } = useReactFlow()+ const { fitView, zoomIn, zoomOut, setCenter, getNode } = useReactFlow()const [nodes, setNodes, onNodesChange] = useNodesState<any>(initialNodes)const [edges, setEdges, onEdgesChange] = useEdgesState<Edge<Record<string, unknown>>>(initialEdges)const [selectedNode, setSelectedNode] = useState<Node<any> | null>(null)@@ -94,6 +94,9 @@ const FlowEditor = memo((params) => {if (params.sourceHandle !== params.targetHandle)return toast.error(`Canot connect ${params.sourceHandle} to ${params.targetHandle}`)+ const node = getNode(params.source);+ console.log(node)+setEdges((eds) =>addEdge({@@ -124,7 +127,13 @@ const FlowEditor = memo(event.preventDefault()if (!reactFlowWrapper.current || !reactFlowInstance) returnconst reactFlowBounds = reactFlowWrapper.current.getBoundingClientRect()- const scannerData = JSON.parse(event.dataTransfer.getData("application/json")) as Scanner & { category: string }+ const scannerData = JSON.parse(event.dataTransfer.getData("application/json")) as ScannerNodeData & { category: string }+ if (scannerData.type === "input") {+ const existsInput = nodes.find((node) => node.data.type === "input")+ if (existsInput) {+ return toast.error("Only one input node is allowed")+ }+ }const position = reactFlowInstance.screenToFlowPosition({x: event.clientX - reactFlowBounds.left,y: event.clientY - reactFlowBounds.top,diff --git a/flowsint-web/src/components/transforms/scanner-data.tsx b/flowsint-web/src/components/transforms/scanner-data.tsxindex 228a43d3..64d2bcce 100644--- a/flowsint-web/src/components/transforms/scanner-data.tsx+++ b/flowsint-web/src/components/transforms/scanner-data.tsx@@ -1,25 +1,28 @@// Types for the scannersexport interface Scanner {- class_name: string- name: string- module: string- doc: string | null- key: string- }-- export interface ScansData {- [category: string]: Scanner[]- }-- export interface ScannerData {- items: ScansData- }-- // Colors for each category- export const categoryColors: Record<string, string> = {- social_account: "#3b82f6", // blue-500- emails: "#10b981", // emerald-500- websites: "#f59e0b", // amber-500- phones: "#8b5cf6", // violet-500- leaks: "#ef4444", // red-500- }\ No newline at end of file+ class_name: string+ name: string+ module: string+ doc: string | null+ key: string+}++export interface ScansData {+ [category: string]: Scanner[]+}++export interface ScannerData {+ items: ScansData+}++// Colors for each category+export const categoryColors: Record<string, string> = {+ social_account: "#3b82f6",+ emails: "#10b981",+ websites: "#f59e0b",+ phones: "#8b5cf6",+ ips: "#ef4444",+ domains: "#10b981",+ inputs: "#f59e0b",++}\ No newline at end of filediff --git a/flowsint-web/src/components/transforms/scanner-item.tsx b/flowsint-web/src/components/transforms/scanner-item.tsxindex 1e560177..002cc3b9 100644--- a/flowsint-web/src/components/transforms/scanner-item.tsx+++ b/flowsint-web/src/components/transforms/scanner-item.tsx@@ -13,6 +13,7 @@ export interface Scanner {module: stringdoc: string | nullkey: string+ type: stringinputs: string[],outputs: string[]}@@ -53,11 +54,12 @@ const ScannerItem = memo(({ scanner, category, color }: ScannerItemProps) => {<divdraggableonDragStart={onDragStart}- className="p-3 rounded-md cursor-grab bg-card border hover:shadow-md transition-shadow"+ className="p-3 rounded-md relative cursor-grab bg-card border hover:shadow-md transition-shadow"style={{ borderLeftWidth: "4px", borderLeftColor: color, cursor: "grab" }}><div className="flex justify-between items-start">- <div>+ <div className="space-y-1">+ {/* <Badge variant={"outline"} className="">{scanner.type}</Badge> */}<h3 className="text-sm font-medium">{scanner.class_name}</h3><p className="text-xs text-muted-foreground">{scanner.name}</p></div>diff --git a/flowsint-web/src/components/transforms/scanner-node.tsx b/flowsint-web/src/components/transforms/scanner-node.tsxindex 214b9d67..ac4d66f9 100644--- a/flowsint-web/src/components/transforms/scanner-node.tsx+++ b/flowsint-web/src/components/transforms/scanner-node.tsx@@ -2,6 +2,7 @@ import { memo } from "react"import { Position } from "@xyflow/react"import { DatabaseSchemaNode, DatabaseSchemaNodeBody, DatabaseSchemaNodeHeader, DatabaseSchemaTableCell, DatabaseSchemaTableRow } from "../ui/schema-node"import { LabeledHandle } from "../ui/labeled-handle"+import { Badge } from "../ui/badge"// Types for the scanner nodeexport interface ScannerNodeData extends Record<string, unknown> {@@ -9,11 +10,11 @@ export interface ScannerNodeData extends Record<string, unknown> {name: stringmodule: stringdoc: string | null- key: stringcategory: string+ type: stringcolor: string- inputs: string[]- outputs: string[]+ inputs: { name: string, type: string }[]+ outputs: { name: string, type: string }[]}interface ScannerNodeProps {@@ -39,39 +40,44 @@ function areEqual(prevProps: ScannerNodeProps, nextProps: ScannerNodeProps) {// Memoized scanner node component with custom equality checkconst ScannerNode = memo(({ data, selected, isConnectable }: ScannerNodeProps) => {return (- <DatabaseSchemaNode className="shadow-md !border-l-2 p-0" style={{ borderLeftColor: data.color }} selected={selected}>+ <DatabaseSchemaNode className="shadow-md !border-l-2 p-0" style={{ borderLeftWidth: "8px", borderLeftColor: data.color, cursor: "grab" }}+ selected={selected}><DatabaseSchemaNodeHeader>- <div className="flex flex-col items-start gap-1">+ <div className="flex flex-col items-start gap-1 relative">+ <div className="absolute top-0 right-0">+ <Badge variant={"outline"} className="">{data.type}</Badge>+ </div><div className="font-semibold text-sm">{data.class_name}</div><p className="text-xs text-muted-foreground">- {data.name}+ {data.doc}</p></div></DatabaseSchemaNodeHeader><div><div className="grid grid-cols-2 py-1"><div className="pl-0 pr-6">- {data.inputs.map((entry: string) => (+ {data.inputs.map((entry: { name: string, type: string }, i: number) => (<LabeledHandleisConnectable={isConnectable}- id={entry}- title={entry}- key={entry}+ id={entry.name}+ name={entry.name}+ dataType={entry.type}+ key={i}type="target"position={Position.Left}/>))}</div><div className="pr-0">- {data.outputs.map((entry: string) => (+ {data.outputs.map((entry: { name: string, type: string }, i: number) => (<LabeledHandleisConnectable={isConnectable}- className="pr-2 text-right"- id={entry}- key={entry}- title={entry}+ id={entry.name}+ name={entry.name}+ dataType={entry.type}+ key={i}type="source"position={Position.Right}/>diff --git a/flowsint-web/src/components/ui/button.tsx b/flowsint-web/src/components/ui/button.tsxindex d0689daa..5c589598 100644--- a/flowsint-web/src/components/ui/button.tsx+++ b/flowsint-web/src/components/ui/button.tsx@@ -14,7 +14,7 @@ const buttonVariants = cva(destructive:"bg-destructive text-destructive-foregroundhover:bg-destructive/90",outline:- "border border-input bg-card hover:bg-background hover:text-accent-foreground",+ "border border bg-card hover:bg-background hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foregroundhover:bg-secondary/80",ghost: "hover:bg-background hover:text-accent-foreground",diff --git a/flowsint-web/src/components/ui/card.tsx b/flowsint-web/src/components/ui/card.tsxindex d0b904b9..f6a7d6ae 100644--- a/flowsint-web/src/components/ui/card.tsx+++ b/flowsint-web/src/components/ui/card.tsx@@ -7,7 +7,7 @@ function Card({ className, ...props }: React.ComponentProps<"div">) {<divdata-slot="card"className={cn(- "bg-card text-card-foreground rounded-xl border shadow-xs",+ "bg-card text-card-foreground rounded-md border shadow-xs",className)}{...props}diff --git a/flowsint-web/src/components/ui/checkbox.tsx b/flowsint-web/src/components/ui/checkbox.tsxindex dcc0fe7a..1d7f1618 100644--- a/flowsint-web/src/components/ui/checkbox.tsx+++ b/flowsint-web/src/components/ui/checkbox.tsx@@ -14,7 +14,7 @@ function Checkbox({<CheckboxPrimitive.Rootdata-slot="checkbox"className={cn(- "peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 size-4 shrink-0 rounded-[4px] border shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-0",+ "peer border data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 size-4 shrink-0 rounded-[4px] border shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-0",className)}{...props}diff --git a/flowsint-web/src/components/ui/input-otp.tsx b/flowsint-web/src/components/ui/input-otp.tsxindex d1300fd7..126fab11 100644--- a/flowsint-web/src/components/ui/input-otp.tsx+++ b/flowsint-web/src/components/ui/input-otp.tsx@@ -51,7 +51,7 @@ function InputOTPSlot({data-slot="input-otp-slot"data-active={isActive}className={cn(- "border-input ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-4 data-[active=true]:outline-1",+ "border ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-4 data-[active=true]:outline-1",className)}{...props}diff --git a/flowsint-web/src/components/ui/input.tsx b/flowsint-web/src/components/ui/input.tsxindex 596f8066..15fbfcd9 100644--- a/flowsint-web/src/components/ui/input.tsx+++ b/flowsint-web/src/components/ui/input.tsx@@ -8,7 +8,7 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {type={type}data-slot="input"className={cn(- "border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground aria-invalid:outline-destructive/60 aria-invalid:ring-destructive/20 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/40 aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-4 focus-visible:outline-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-[3px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-4",+ "border file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground aria-invalid:outline-destructive/60 aria-invalid:ring-destructive/20 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/40 aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base bg-card transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 inset-shadow-sm file:bg-transparent file:text-sm file:font-medium focus-visible:ring-4 focus-visible:outline-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-[3px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-4",className)}{...props}diff --git a/flowsint-web/src/components/ui/labeled-handle.tsx b/flowsint-web/src/components/ui/labeled-handle.tsxindex 9568b870..3582963b 100644--- a/flowsint-web/src/components/ui/labeled-handle.tsx+++ b/flowsint-web/src/components/ui/labeled-handle.tsx@@ -16,13 +16,14 @@ export const LabeledHandle = forwardRef<HTMLDivElement,HandleProps &HTMLAttributes<HTMLDivElement> & {- title: string | (string & Element);+ name: string | (string & Element);+ dataType: string,handleClassName?: string;labelClassName?: string;}>((- { className, labelClassName, handleClassName, title, position, ...props },+ { className, labelClassName, handleClassName, name, position, dataType, ...props },ref,) => (<div@@ -35,7 +36,7 @@ export const LabeledHandle = forwardRef<><BaseHandle position={position} className={handleClassName} {...props} /><label className={cn("px-3 text-foreground", labelClassName)}>- {title}+ {name} <Badge variant={"outline"}>{dataType}</Badge></label></div>),diff --git a/flowsint-web/src/components/ui/radio-group.tsx b/flowsint-web/src/components/ui/radio-group.tsxindex 97688a18..b4a67269 100644--- a/flowsint-web/src/components/ui/radio-group.tsx+++ b/flowsint-web/src/components/ui/radio-group.tsx@@ -27,7 +27,7 @@ function RadioGroupItem({<RadioGroupPrimitive.Itemdata-slot="radio-group-item"className={cn(- "border-input text-primary ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-0",+ "border text-primary ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-0",className)}{...props}diff --git a/flowsint-web/src/components/ui/select.tsx b/flowsint-web/src/components/ui/select.tsxindex 8f7648e6..212fe0df 100644--- a/flowsint-web/src/components/ui/select.tsx+++ b/flowsint-web/src/components/ui/select.tsx@@ -33,7 +33,7 @@ function SelectTrigger({<SelectPrimitive.Triggerdata-slot="select-trigger"className={cn(- "border-input data-[placeholder]:text-muted-foreground aria-invalid:border-destructive ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-0 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>span]:line-clamp-1",+ "border data-[placeholder]:text-muted-foreground aria-invalid:border-destructive ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm bg-card border transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-0 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>span]:line-clamp-1 inset-shadow-sm",className)}{...props}@@ -57,7 +57,7 @@ function SelectContent({<SelectPrimitive.Contentdata-slot="select-content"className={cn(- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow",+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border",position === "popper" &&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",classNamediff --git a/flowsint-web/src/components/ui/textarea.tsx b/flowsint-web/src/components/ui/textarea.tsxindex 65cf71f0..3029e770 100644--- a/flowsint-web/src/components/ui/textarea.tsx+++ b/flowsint-web/src/components/ui/textarea.tsx@@ -7,7 +7,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {<textareadata-slot="textarea"className={cn(- "border-input placeholder:text-muted-foreground ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/40 aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/50 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-[3px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-4",+ "border placeholder:text-muted-foreground ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/40 aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/50 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-[3px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-4",className)}{...props}diff --git a/flowsint-web/src/components/ui/toggle.tsx b/flowsint-web/src/components/ui/toggle.tsxindex 82bb4998..aa314814 100644--- a/flowsint-web/src/components/ui/toggle.tsx+++ b/flowsint-web/src/components/ui/toggle.tsx@@ -13,7 +13,7 @@ const toggleVariants = cva(variant: {default: "bg-transparent",outline:- "border border-input bg-transparent shadow-xs hover:bg-background hover:text-accent-foreground",+ "border border bg-transparent shadow-xs hover:bg-background hover:text-accent-foreground",},size: {default: "h-9 px-2 min-w-9",diff --git a/flowsint-web/src/lib/action-items.ts b/flowsint-web/src/lib/action-items.tsindex 67d68a8a..3c36f46d 100644--- a/flowsint-web/src/lib/action-items.ts+++ b/flowsint-web/src/lib/action-items.ts@@ -1,27 +1,13 @@import {- Activity,- ArrowRightLeft,AtSign,Bike,- Bitcoin,Building2,- Calendar,- Camera,Car,- CreditCard,- DollarSign,Facebook,- FileIcon,- Fingerprint,- Footprints,Ghost,Github,Globe,- GraduationCap,- ImageIcon,Instagram,- Key,- Laptop,Linkedin,Locate,MapPin,@@ -32,34 +18,54 @@ import {Plane,Sailboat,Send,- ShoppingCart,- Smartphone,- Tablet,Twitch,Twitter,User,- Users,Video,- Wifi,type LucideIcon,} from "lucide-react"-// Enhanced ActionItem type that includes fields from nodesTypes-export type ActionItem = {++export type FieldType = "text" | "date" | "email" | "number" | "select" | "textarea" | "hidden" | "tel" | "url" | "metadata"++export interface SelectOption {+ label: string+ value: string+}++export interface FormField {+ name: string+ label: string+ type: FieldType+ required: boolean+ options?: SelectOption[]+ placeholder?: string+ description?: string+}+export interface ActionItem {id: numbertype: stringtable: string+ key: stringicon: LucideIcon- color?: stringlabel: string- key: string,- fields: string[]+ color?: string+ fields: FormField[]+ size?: stringdisabled?: booleancomingSoon?: booleanchildren?: ActionItem[]- size?: string}+const countries = [+ { label: "France", value: "france" },+ { label: "United States", value: "usa" },+ { label: "United Kingdom", value: "uk" },+ { label: "Germany", value: "germany" },+ { label: "Japan", value: "japan" },+ { label: "Canada", value: "canada" },+ { label: "Australia", value: "australia" },+]export const actionItems: ActionItem[] = [{id: 24,@@ -68,8 +74,25 @@ export const actionItems: ActionItem[] = [key: "organizations",icon: Building2,label: "Organization",- fields: ["name", "registration_number", "founding_date"],- size: "h-8 w-8"+ fields: [+ { name: "name", label: "Name", type: "text", required: true },+ { name: "founding_date", label: "Founding date", type: "date", required: false },+ {+ name: "country",+ label: "Country",+ type: "select",+ required: false,+ options: countries,+ },+ {+ name: "metadata",+ label: "Metadata",+ type: "metadata",+ required: false,+ description: "Add additional information under the format key:value"+ }+ ],+ size: "h-8 w-8",},{id: 1,@@ -78,28 +101,59 @@ export const actionItems: ActionItem[] = [key: "individuals",icon: User,label: "New individual",- fields: ["full_name"],- size: "h-7 w-7"+ fields: [{ name: "first_name", label: "Firstname", type: "text", required: true },+ { name: "last_name", label: "Lastname", type: "text", required: true },+ { name: "birth_date", label: "Birth date", type: "date", required: false },+ {+ name: "gender",+ label: "Gender",+ type: "select",+ required: false,+ options: [+ { label: "Male", value: "male" },+ { label: "Female", value: "female" },+ { label: "Non-binary", value: "non-binary" },+ { label: "Prefer not to say", value: "not_specified" },+ ],+ },+ ],+ size: "h-7 w-7",},{id: 2,type: "phone",- table: "phone_numbers",- key: "phone_numbers",+ table: "phones",+ key: "phones",icon: Phone,label: "Phone number",- fields: ["phone_number"],- size: "h-5 w-5"+ fields: [{ name: "number", label: "Phone number", type: "tel", required: true },+ {+ name: "country",+ label: "Country",+ type: "select",+ required: false,+ options: countries,+ },+ { name: "carrier", label: "Carrier", type: "text", required: false }+ ],+ size: "h-5 w-5",},{id: 3,type: "address",- table: "physical_addresses",- key: "physical_addresses",+ table: "addresses",+ key: "addresses",icon: MapPin,label: "Physical address",- fields: ["address", "city", "country", "zip"],- size: "h-5 w-5"+ fields: [+ { name: "address", label: "Address", type: "text", required: true },+ { name: "city", label: "City", type: "text", required: true },+ { name: "country", label: "Country", type: "text", required: true },+ { name: "zip", label: "ZIP/Postal code", type: "text", required: false },+ { name: "latitude", label: "Latitude", type: "text", required: false },+ { name: "longitude", label: "Longitude", type: "text", required: false },+ ],+ size: "h-5 w-5",},{id: 4,@@ -108,18 +162,18 @@ export const actionItems: ActionItem[] = [key: "emails",icon: AtSign,label: "Email address",- fields: ["email"],- size: "h-5 w-5"+ fields: [{ name: "email", label: "Email", type: "email", required: true }],+ size: "h-5 w-5",},{id: 5,type: "ip",- table: "ip_addresses",- key: "ip_addresses",+ table: "ips",+ key: "ips",icon: Locate,label: "IP address",- fields: ["ip_address"],- size: "h-5 w-5"+ fields: [{ name: "address", label: "IP address", type: "text", required: true }],+ size: "h-5 w-5",},{id: 6,@@ -139,8 +193,12 @@ export const actionItems: ActionItem[] = [icon: Facebook,color: "#1d4ed8",label: "Facebook",- fields: ["profile_url", "username", "platform:facebook"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 8,@@ -150,8 +208,12 @@ export const actionItems: ActionItem[] = [icon: Instagram,color: "#db2777",label: "Instagram",- fields: ["profile_url", "username", "platform:instagram"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 9,@@ -161,8 +223,12 @@ export const actionItems: ActionItem[] = [icon: Send,color: "#0369a1",label: "Telegram",- fields: ["profile_url", "username", "platform:telegram"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 10,@@ -172,8 +238,12 @@ export const actionItems: ActionItem[] = [icon: MessageCircleDashed,color: "#3B45FC",label: "Signal",- fields: ["profile_url", "username", "platform:signal"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 11,@@ -183,8 +253,12 @@ export const actionItems: ActionItem[] = [color: "#FEFC00",icon: Ghost,label: "Snapchat",- fields: ["profile_url", "username", "platform:snapchat"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 12,@@ -193,8 +267,12 @@ export const actionItems: ActionItem[] = [key: "social_accounts_github",icon: Github,label: "Github",- fields: ["profile_url", "username", "platform:github"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 13,@@ -203,10 +281,14 @@ export const actionItems: ActionItem[] = [key: "social_accounts_coco",icon: Send,label: "Coco",- fields: ["profile_url", "username", "platform:coco"],+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],disabled: true,comingSoon: true,- size: "h-5 w-5"+ size: "h-5 w-5",},{id: 18,@@ -216,8 +298,12 @@ export const actionItems: ActionItem[] = [color: "#116AC9",icon: Linkedin,label: "LinkedIn",- fields: ["profile_url", "username", "platform:linkedin"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 19,@@ -226,8 +312,12 @@ export const actionItems: ActionItem[] = [key: "social_accounts_twitter",icon: Twitter,label: "Twitter",- fields: ["profile_url", "username", "platform:twitter"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 20,@@ -236,8 +326,12 @@ export const actionItems: ActionItem[] = [key: "social_accounts_tiktok",icon: Video,label: "TikTok",- fields: ["profile_url", "username", "platform:tiktok"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 21,@@ -247,8 +341,12 @@ export const actionItems: ActionItem[] = [icon: MessageSquare,color: "#FF4B13",label: "Reddit",- fields: ["profile_url", "username", "platform:reddit"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 22,@@ -258,8 +356,12 @@ export const actionItems: ActionItem[] = [icon: MessageCircle,color: "#525FEE",label: "Discord",- fields: ["profile_url", "username", "platform:discord"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 2343,@@ -269,8 +371,12 @@ export const actionItems: ActionItem[] = [icon: Twitch,color: "#A96FFF",label: "Twitch",- fields: ["profile_url", "username", "platform:twitch"],- size: "h-5 w-5"+ fields: [+ { name: "profile_url", label: "Profile URL", type: "url", required: true },+ { name: "username", label: "Username", type: "text", required: false },+ { name: "platform", label: "Platform", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},],},@@ -290,8 +396,14 @@ export const actionItems: ActionItem[] = [key: "vehicles_car",icon: Car,label: "Car",- fields: ["plate", "model", "brand", "year", "type:car"],- size: "h-5 w-5"+ fields: [+ { name: "plate", label: "License plate", type: "text", required: true },+ { name: "model", label: "Model", type: "text", required: false },+ { name: "brand", label: "Brand", type: "text", required: false },+ { name: "year", label: "Year", type: "number", required: false },+ { name: "type", label: "Type", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 16,@@ -300,8 +412,14 @@ export const actionItems: ActionItem[] = [key: "vehicles_motorcycle",icon: Bike,label: "Motorcycle",- fields: ["plate", "model", "brand", "year", "type:motorcycle"],- size: "h-5 w-5"+ fields: [+ { name: "plate", label: "License plate", type: "text", required: true },+ { name: "model", label: "Model", type: "text", required: false },+ { name: "brand", label: "Brand", type: "text", required: false },+ { name: "year", label: "Year", type: "number", required: false },+ { name: "type", label: "Type", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 17,@@ -310,8 +428,14 @@ export const actionItems: ActionItem[] = [key: "vehicles_boat",icon: Sailboat,label: "Boat",- fields: ["plate", "model", "brand", "year", "type:boat"],- size: "h-5 w-5"+ fields: [+ { name: "plate", label: "Registration number", type: "text", required: true },+ { name: "model", label: "Model", type: "text", required: false },+ { name: "brand", label: "Brand", type: "text", required: false },+ { name: "year", label: "Year", type: "number", required: false },+ { name: "type", label: "Type", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},{id: 23,@@ -320,8 +444,14 @@ export const actionItems: ActionItem[] = [key: "vehicles_aircraft",icon: Plane,label: "Aircraft",- fields: ["registration", "model", "manufacturer", "year", "type:aircraft"],- size: "h-5 w-5"+ fields: [+ { name: "registration", label: "Registration", type: "text", required: true },+ { name: "model", label: "Model", type: "text", required: false },+ { name: "manufacturer", label: "Manufacturer", type: "text", required: false },+ { name: "year", label: "Year", type: "number", required: false },+ { name: "type", label: "Type", type: "hidden", required: true },+ ],+ size: "h-5 w-5",},],},@@ -332,230 +462,14 @@ export const actionItems: ActionItem[] = [key: "websites",icon: Globe,label: "Website",- fields: ["url", "registration_date", "registrar", "ip_address"],- size: "h-5 w-5"- },- {- id: 26,- type: "document",- table: "documents",- key: "documents",- icon: FileIcon,- label: "Document",- fields: ["title", "author", "creation_date", "file_hash", "file_type"],- size: "h-5 w-5",- disabled: true,- },- {- id: 27,- type: "financial",- table: "",- key: "financial",- icon: DollarSign,- label: "Financial",- fields: [],- disabled: true,- children: [- {- id: 28,- type: "financial",- table: "crypto_wallets",- key: "crypto_wallets",- icon: Bitcoin,- label: "Crypto Wallet",- fields: ["address", "currency", "platform"],- size: "h-5 w-5",- disabled: true,- },- {- id: 29,- type: "financial",- table: "bank_accounts",- key: "bank_accounts",- icon: CreditCard,- label: "Bank Account",- fields: ["account_number", "bank_name", "iban", "bic"],- size: "h-5 w-5",- disabled: true,- },- {- id: 30,- type: "financial",- table: "transactions",- key: "transactions",- icon: ArrowRightLeft,- label: "Transaction",- fields: ["amount", "date", "sender", "recipient", "currency"],- size: "h-5 w-5",- disabled: true,- },- ],- },- {- id: 31,- type: "event",- table: "events",- key: "events",- icon: Calendar,- label: "Event",- fields: ["name", "date", "location", "description", "participants"],- size: "h-5 w-5",- disabled: true,- },- {- id: 32,- type: "device",- table: "",- key: "device",- icon: Smartphone,- label: "Device",- fields: [],- disabled: true,- children: [- {- id: 33,- type: "device",- table: "devices",- key: "devices_phone",- icon: Smartphone,- label: "Phone",- fields: ["imei", "model", "manufacturer", "serial_number", "type:phone"],- size: "h-5 w-5",- disabled: true,- },- {- id: 34,- type: "device",- table: "devices",- key: "devices_computer",- icon: Laptop,- label: "Computer",- fields: ["mac_address", "model", "manufacturer", "serial_number", "type:computer"],- size: "h-5 w-5",- disabled: true,- },- {- id: 35,- type: "device",- table: "devices",- key: "devices_tablet",- icon: Tablet,- label: "Tablet",- fields: ["imei", "model", "manufacturer", "serial_number", "type:tablet"],- size: "h-5 w-5",- disabled: true,- },- {- id: 36,- type: "device",- table: "devices",- key: "devices_iot",- icon: Wifi,- label: "IoT Device",- fields: ["mac_address", "model", "manufacturer", "serial_number", "type:iot"],- size: "h-5 w-5",- disabled: true,- },- ],- },- {- id: 37,- type: "media",- table: "media",- key: "media",- icon: ImageIcon,- label: "Media",- fields: ["filename", "hash", "creation_date", "location", "exif_data"],- size: "h-5 w-5",- disabled: true,- },- {- id: 38,- type: "education",- table: "education",- key: "education",- icon: GraduationCap,- label: "Education",- fields: ["institution", "degree", "field", "start_date", "end_date"],- size: "h-5 w-5",- disabled: true,- },- {- id: 40,- type: "online_activity",- table: "",- key: "online_activity",- icon: Activity,- label: "Online Activity",- fields: [],- disabled: true,- children: [- {- id: 41,- type: "online_activity",- table: "forum_posts",- key: "forum_posts",- icon: MessageSquare,- label: "Forum Post",- fields: ["forum", "username", "post_date", "post_content", "post_url", "type:forum_post"],- size: "h-5 w-5",- disabled: true,- },- {- id: 42,- type: "online_activity",- table: "comments",- key: "comments",- icon: MessageCircle,- label: "Comment",- fields: ["platform", "username", "comment_date", "comment_content", "comment_url", "type:comment"],- size: "h-5 w-5",- disabled: true,- },- {- id: 43,- type: "online_activity",- table: "online_purchases",- key: "online_purchases",- icon: ShoppingCart,- label: "Online Purchase",- fields: ["platform", "username", "purchase_date", "item", "price", "type:purchase"],- size: "h-5 w-5",- disabled: true,- },+ fields: [+ { name: "url", label: "URL", type: "url", required: true },+ { name: "registration_date", label: "Registration date", type: "date", required: false },+ { name: "registrar", label: "Registrar", type: "text", required: false },+ { name: "address", label: "IP address", type: "text", required: false },],- },- {- id: 44,- type: "digital_footprint",- table: "digital_footprints",- key: "digital_footprints",- icon: Footprints,- label: "Digital Footprint",- fields: ["platform", "username", "date_discovered", "data_type", "source_url"],size: "h-5 w-5",- disabled: true,},- {- id: 45,- type: "biometric",- table: "biometric_data",- key: "biometric_data",- icon: Fingerprint,- label: "Biometric Data",- fields: ["type", "identifier", "date_collected", "source"],- size: "h-5 w-5",- disabled: true,- },- {- id: 46,- type: "credential",- table: "credentials",- key: "credentials",- icon: Key,- label: "Credential",- fields: ["service", "username", "hash", "breach_date", "breach_source"],- size: "h-5 w-5",- disabled: true,- },-]\ No newline at end of file+]++diff --git a/flowsint-web/src/lib/utils.ts b/flowsint-web/src/lib/utils.tsindex 9e681b7a..d2ae7c72 100644--- a/flowsint-web/src/lib/utils.ts+++ b/flowsint-web/src/lib/utils.ts@@ -2,6 +2,9 @@ import { clsx, type ClassValue } from "clsx"import { twMerge } from "tailwind-merge"import Dagre from '@dagrejs/dagre';import { redirect } from "next/navigation";++import { actionItems } from "./action-items"+import type { ActionItem, FormField } from "./action-items"//@ts-ignoreimport * as d3 from "d3-force"@@ -261,189 +264,44 @@ export const formatFileSize = (bytes: number) => {else return (bytes / 1048576).toFixed(1) + " MB"}-export const nodesTypes = {- emails: { table: "emails", type: "email", fields: ["email"] },- individuals: { table: "individuals", type: "individual", fields: ["full_name"] },- phone_numbers: { table: "phone_numbers", type: "phone", fields: ["phone_number"] },- ip_addresses: { table: "ip_addresses", type: "ip", fields: ["ip_address"] },- social_accounts_facebook: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:facebook"],- },- social_accounts_instagram: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:instagram"],- },- social_accounts_telegram: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:telegram"],- },- social_accounts_snapchat: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:snapchat"],- },- social_accounts_signal: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:signal"],- },- social_accounts_github: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:github"],- },- physical_addresses: { table: "physical_addresses", type: "address", fields: ["address", "city", "country", "zip"] },- vehicles_car: {- table: "vehicles",- type: "vehicle",- fields: ["plate", "model", "year", "brand", "type:car"],- },- vehicles_motorcycle: {- table: "vehicles",- type: "vehicle",- fields: ["plate", "model", "year", "brand", "type:motorcycle"],- },- vehicles_boat: {- table: "vehicles",- type: "vehicle",- fields: ["plate", "model", "year", "brand", "type:boat"],- },- social_accounts_linkedin: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:linkedin"],- },- social_accounts_twitter: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:twitter"],- },- social_accounts_tiktok: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:tiktok"],- },- social_accounts_reddit: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:reddit"],- },- social_accounts_discord: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:discord"],- },- social_accounts_twitch: {- table: "social_accounts",- type: "social",- fields: ["profile_url", "username", "platform:twitch"],- },- vehicles_aircraft: {- table: "vehicles",- type: "vehicle",- fields: ["registration", "model", "year", "manufacturer", "type:aircraft"],- },- organizations: {- table: "organizations",- type: "organization",- fields: ["name", "registration_number", "founding_date"],- },- websites: {- table: "websites",- type: "website",- fields: ["url", "registration_date", "registrar", "ip_address"],- },- documents: {- table: "documents",- type: "document",- fields: ["title", "author", "creation_date", "file_hash", "file_type"],- },- crypto_wallets: {- table: "crypto_wallets",- type: "financial",- fields: ["address", "currency", "platform"],- },- bank_accounts: {- table: "bank_accounts",- type: "financial",- fields: ["account_number", "bank_name", "iban", "bic"],- },- transactions: {- table: "transactions",- type: "financial",- fields: ["amount", "date", "sender", "recipient", "currency"],- },- events: {- table: "events",- type: "event",- fields: ["name", "date", "location", "description", "participants"],- },- devices_phone: {- table: "devices",- type: "device",- fields: ["imei", "model", "manufacturer", "serial_number", "type:phone"],- },- devices_computer: {- table: "devices",- type: "device",- fields: ["mac_address", "model", "manufacturer", "serial_number", "type:computer"],- },- devices_tablet: {- table: "devices",- type: "device",- fields: ["imei", "model", "manufacturer", "serial_number", "type:tablet"],- },- devices_iot: {- table: "devices",- type: "device",- fields: ["mac_address", "model", "manufacturer", "serial_number", "type:iot"],- },- media: {- table: "media",- type: "media",- fields: ["filename", "hash", "creation_date", "location", "exif_data"],- },- education: {- table: "education",- type: "education",- fields: ["institution", "degree", "field", "start_date", "end_date"],- },- forum_posts: {- table: "forum_posts",- type: "online_activity",- fields: ["forum", "username", "post_date", "post_content", "post_url", "type:forum_post"],- },- comments: {- table: "comments",- type: "online_activity",- fields: ["platform", "username", "comment_date", "comment_content", "comment_url", "type:comment"],- },- online_purchases: {- table: "online_purchases",- type: "online_activity",- fields: ["platform", "username", "purchase_date", "item", "price", "type:purchase"],- },- digital_footprints: {- table: "digital_footprints",- type: "digital_footprint",- fields: ["platform", "username", "date_discovered", "data_type", "source_url"],- },- biometric_data: {- table: "biometric_data",- type: "biometric",- fields: ["type", "identifier", "date_collected", "source"],- },- credentials: {- table: "credentials",- type: "credential",- fields: ["service", "username", "hash", "breach_date", "breach_source"],- },++function convertFieldToSimpleFormat(field: FormField): string {+ if ((field.type === "hidden" && field.name === "platform") || field.name === "type") {+ const defaultValue = field.options?.[0]?.value || ""+ if (defaultValue) {+ return `${field.name}:${defaultValue}`+ }+ }+ return field.name}+export function generateNodeTypes() {+ const nodeTypes: Record<string, { table: string; type: string; fields: string[] }> = {}++ function processItems(items: ActionItem[]) {+ items.forEach((item) => {+ if (item.table && !item.disabled) {+ nodeTypes[item.key] = {+ table: item.table,+ type: item.type,+ fields: item.fields.map(convertFieldToSimpleFormat),+ }+ }++ // Traiter les enfants récursivement+ if (item.children && item.children.length > 0) {+ processItems(item.children)+ }+ })+ }++ processItems(actionItems)+ return nodeTypes+}++export const nodesTypes = generateNodeTypes()++export const typeColorMap: Record<string, string> = {individual: "bg-gradient-to-br from-slate-50 to-slate-100 border-slate-200 shadow dark:from-slate-800 dark:to-slate-900 dark:border-slate-700 dark:shadow-slate-900/30",phone: "bg-gradient-to-br from-sky-50 to-sky-100 border-sky-200 shadow dark:from-sky-800 dark:to-sky-900 dark:border-sky-700 dark:shadow-sky-900/30",@@ -509,7 +367,7 @@ export function encodedRedirect(type: "error" | "success",path: string,message: string,-) {+): never {return redirect(`${path}?${type}=${encodeURIComponent(message)}`);}@@ -542,7 +400,7 @@ export const scans = [name: "phone",scan_name: "ignorant_scanner",description: "",- key: "phone_number"+ key: "number"}]diff --git a/flowsint-web/src/types/sketch.ts b/flowsint-web/src/types/sketch.tsindex b6c9bbc7..adff1faf 100644--- a/flowsint-web/src/types/sketch.ts+++ b/flowsint-web/src/types/sketch.ts@@ -29,7 +29,7 @@ export interface Email {export interface Phone {id: string,- phone_number: string+ number: string}export interface Social {@@ -41,7 +41,7 @@ export interface Social {export interface IP {id: string- ip_address: string+ address: string}export interface Address {diff --git a/flowsint-web/styles/globals.css b/flowsint-web/styles/globals.cssindex 3f181cda..eed6cf70 100644--- a/flowsint-web/styles/globals.css+++ b/flowsint-web/styles/globals.css@@ -3,12 +3,7 @@@plugin "tailwindcss-animate";@custom-variant dark (&:is(.dark *));-/*-[data-radius='full'] {- --radius-factor: 3 !important;- --radius-full: 999999px !important;- --radius-thumb: 999999px !important;-} */+@layer base {:root {@@ -208,4 +203,150 @@--shadow-lg: var(--shadow-lg);--shadow-xl: var(--shadow-xl);--shadow-2xl: var(--shadow-2xl);-}\ No newline at end of file+}+:root {+ --background: oklch(0.96 0 0);+ --foreground: oklch(0.32 0 0);+ --card: oklch(0.97 0 0);+ --card-foreground: oklch(0.32 0 0);+ --popover: oklch(0.97 0 0);+ --popover-foreground: oklch(0.32 0 0);+ --primary: oklch(0.78 0.13 182.27);+ --primary-foreground: oklch(1.00 0 0);+ --secondary: oklch(0.91 0 0);+ --secondary-foreground: oklch(0.32 0 0);+ --muted: oklch(0.89 0 0);+ --muted-foreground: oklch(0.51 0 0);+ --accent: oklch(0.81 0 0);+ --accent-foreground: oklch(0.32 0 0);+ --destructive: oklch(0.56 0.19 25.86);+ --destructive-foreground: oklch(1.00 0 0);+ --border: oklch(0.86 0 0);+ --input: oklch(0.91 0 0);+ --ring: oklch(0.49 0 0);+ --chart-1: oklch(0.78 0.13 182.27);+ --chart-2: oklch(0.49 0.04 196.03);+ --chart-3: oklch(0.65 0 0);+ --chart-4: oklch(0.73 0 0);+ --chart-5: oklch(0.81 0 0);+ --sidebar: oklch(0.94 0 0);+ --sidebar-foreground: oklch(0.32 0 0);+ --sidebar-primary: oklch(0.49 0 0);+ --sidebar-primary-foreground: oklch(1.00 0 0);+ --sidebar-accent: oklch(0.81 0 0);+ --sidebar-accent-foreground: oklch(0.32 0 0);+ --sidebar-border: oklch(0.86 0 0);+ --sidebar-ring: oklch(0.49 0 0);+ --font-sans: Montserrat, sans-serif;+ --font-serif: Georgia, serif;+ --font-mono: Fira Code, monospace;+ --radius: 0.35rem;+ --shadow-2xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);+ --shadow-xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);+ --shadow-sm: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);+ --shadow: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);+ --shadow-md: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 2px 4px -1px hsl(0 0% 20% / 0.15);+ --shadow-lg: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 4px 6px -1px hsl(0 0% 20% / 0.15);+ --shadow-xl: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 8px 10px -1px hsl(0 0% 20% / 0.15);+ --shadow-2xl: 0px 2px 0px 0px hsl(0 0% 20% / 0.38);+ }++ .dark {+ --background: oklch(0.22 0 0);+ --foreground: oklch(0.89 0 0);+ --card: oklch(0.24 0 0);+ --card-foreground: oklch(0.89 0 0);+ --popover: oklch(0.24 0 0);+ --popover-foreground: oklch(0.89 0 0);+ --primary: oklch(0.78 0.13 182.87);+ --primary-foreground: oklch(1.00 0 0);+ --secondary: oklch(0.31 0 0);+ --secondary-foreground: oklch(0.89 0 0);+ --muted: oklch(0.29 0 0);+ --muted-foreground: oklch(0.60 0 0);+ --accent: oklch(0.37 0 0);+ --accent-foreground: oklch(0.89 0 0);+ --destructive: oklch(0.66 0.15 22.17);+ --destructive-foreground: oklch(1.00 0 0);+ --border: oklch(0.33 0 0);+ --input: oklch(0.31 0 0);+ --ring: oklch(0.71 0 0);+ --chart-1: oklch(0.78 0.13 182.87);+ --chart-2: oklch(0.67 0.03 206.35);+ --chart-3: oklch(0.55 0 0);+ --chart-4: oklch(0.46 0 0);+ --chart-5: oklch(0.37 0 0);+ --sidebar: oklch(0.24 0 0);+ --sidebar-foreground: oklch(0.89 0 0);+ --sidebar-primary: oklch(0.71 0 0);+ --sidebar-primary-foreground: oklch(0.22 0 0);+ --sidebar-accent: oklch(0.37 0 0);+ --sidebar-accent-foreground: oklch(0.89 0 0);+ --sidebar-border: oklch(0.33 0 0);+ --sidebar-ring: oklch(0.71 0 0);+ --font-sans: Inter, sans-serif;+ --font-serif: Georgia, serif;+ --font-mono: Fira Code, monospace;+ --radius: 0.35rem;+ --shadow-2xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);+ --shadow-xs: 0px 2px 0px 0px hsl(0 0% 20% / 0.07);+ --shadow-sm: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);+ --shadow: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 1px 2px -1px hsl(0 0% 20% / 0.15);+ --shadow-md: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 2px 4px -1px hsl(0 0% 20% / 0.15);+ --shadow-lg: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 4px 6px -1px hsl(0 0% 20% / 0.15);+ --shadow-xl: 0px 2px 0px 0px hsl(0 0% 20% / 0.15), 0px 8px 10px -1px hsl(0 0% 20% / 0.15);+ --shadow-2xl: 0px 2px 0px 0px hsl(0 0% 20% / 0.38);+ }++ @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);+ }\ No newline at end of filediff --git a/flowsint-web/yarn.lock b/flowsint-web/yarn.lockindex a8d00c08..8a85cae6 100644--- a/flowsint-web/yarn.lock+++ b/flowsint-web/yarn.lock@@ -59,6 +59,15 @@resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30"integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==+"@babel/code-frame@^7.26.2":+ version "7.26.2"+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.26.2.tgz#4b5fab97d33338eff916235055f0ebc21e573a85"+ integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==+ dependencies:+ "@babel/helper-validator-identifier" "^7.25.9"+ js-tokens "^4.0.0"+ picocolors "^1.0.0"+"@babel/helper-string-parser@^7.25.9":version "7.25.9"resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c"@@ -1422,6 +1431,36 @@resolved "https://registry.yarnpkg.com/@react-types/shared/-/shared-3.27.0.tgz#167c163139efc98c2194aba090076c03b658c07d"integrity sha512-gvznmLhi6JPEf0bsq7SwRYTHAKKq/wcmKqFez9sRdbED+SPMUmK5omfZ6w3EwUFQHbYUa4zPBYedQ7Knv70RMw==+"@redocly/ajv@^8.11.2":+ version "8.11.2"+ resolved "https://registry.yarnpkg.com/@redocly/ajv/-/ajv-8.11.2.tgz#46e1bf321ec0ac1e0fd31dea41a3d1fcbdcda0b5"+ integrity sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==+ dependencies:+ fast-deep-equal "^3.1.1"+ json-schema-traverse "^1.0.0"+ require-from-string "^2.0.2"+ uri-js-replace "^1.0.1"++"@redocly/config@^0.22.0":+ version "0.22.2"+ resolved "https://registry.yarnpkg.com/@redocly/config/-/config-0.22.2.tgz#9a05e694816d53a5236cf8768d3cad0e49d8b116"+ integrity sha512-roRDai8/zr2S9YfmzUfNhKjOF0NdcOIqF7bhf4MVC5UxpjIysDjyudvlAiVbpPHp3eDRWbdzUgtkK1a7YiDNyQ==++"@redocly/openapi-core@^1.28.0":+ version "1.34.2"+ resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.34.2.tgz#859de74a3261fb09a3dc695be4a8d9b1f2059d75"+ integrity sha512-glfkQFJizLdq2fBkNvc2FJW0sxDb5exd0wIXhFk+WHaFLMREBC3CxRo2Zq7uJIdfV9U3YTceMbXJklpDfmmwFQ==+ dependencies:+ "@redocly/ajv" "^8.11.2"+ "@redocly/config" "^0.22.0"+ colorette "^1.2.0"+ https-proxy-agent "^7.0.5"+ js-levenshtein "^1.1.6"+ js-yaml "^4.1.0"+ minimatch "^5.0.1"+ pluralize "^8.0.0"+ yaml-ast-parser "0.0.43"+"@remirror/[email protected]":version "3.0.0"resolved "https://registry.yarnpkg.com/@remirror/core-constants/-/core-constants-3.0.0.tgz#96fdb89d25c62e7b6a5d08caf0ce5114370e3b8f"@@ -2256,6 +2295,11 @@ acorn@^8.9.0:resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0"integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==+agent-base@^7.1.2:+ version "7.1.3"+ resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1"+ integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==+ai@^4.1.34:version "4.1.34"resolved "https://registry.yarnpkg.com/ai/-/ai-4.1.34.tgz#6a7c8140dfb4c5f17f0c243eab0ac395c1e67ad6"@@ -2278,6 +2322,11 @@ ajv@^6.12.4:json-schema-traverse "^0.4.1"uri-js "^4.2.2"+ansi-colors@^4.1.3:+ version "4.1.3"+ resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b"+ integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==+ansi-regex@^5.0.1:version "5.0.1"resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"@@ -2556,6 +2605,11 @@ chalk@^5.3.0:resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8"integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==+change-case@^5.4.4:+ version "5.4.4"+ resolved "https://registry.yarnpkg.com/change-case/-/change-case-5.4.4.tgz#0d52b507d8fb8f204343432381d1a6d7bff97a02"+ integrity sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==+character-entities-html4@^2.0.0:version "2.1.0"resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b"@@ -2639,6 +2693,11 @@ color@^4.2.3:color-convert "^2.0.1"color-string "^1.9.0"+colorette@^1.2.0:+ version "1.4.0"+ resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"+ integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==+comma-separated-tokens@^2.0.0:version "2.0.3"resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee"@@ -3071,6 +3130,13 @@ debounce@~1.0.0:resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.0.2.tgz#503cc674d8d7f737099664fb75ddbd36b9626dc6"integrity sha512-AW9SsfJ9CYtgGys1gzmNV21U8OR6xkJX7XZPSWRhzkwwJbfCBiHMLRCJFCpty2ZC1LxXZqRBT8VX7hZY01v2/w==+debug@4, debug@^4.0.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.7:+ version "4.4.0"+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a"+ integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==+ dependencies:+ ms "^2.1.3"+debug@^3.2.7:version "3.2.7"resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"@@ -3078,13 +3144,6 @@ debug@^3.2.7:dependencies:ms "^2.1.1"-debug@^4.0.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.7:- version "4.4.0"- resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a"- integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==- dependencies:- ms "^2.1.3"-decimal.js-light@^2.4.1:version "2.5.1"resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934"@@ -4039,6 +4098,14 @@ html-url-attributes@^3.0.0:resolved "https://registry.yarnpkg.com/html-url-attributes/-/html-url-attributes-3.0.1.tgz#83b052cd5e437071b756cd74ae70f708870c2d87"integrity sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==+https-proxy-agent@^7.0.5:+ version "7.0.6"+ resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9"+ integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==+ dependencies:+ agent-base "^7.1.2"+ debug "4"+version "0.6.3"resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"@@ -4069,6 +4136,11 @@ index-array-by@1:resolved "https://registry.yarnpkg.com/index-array-by/-/index-array-by-1.4.2.tgz#d6f82e9fbff3201c4dab64ba415d4d2923242fea"integrity sha512-SP23P27OUKzXWEC/TOyWlwLviofQkCSCKONnc62eItjp69yCZZPqDQtr3Pw5gJDnPeUMqExmKydNZaJO0FU9pw==+index-to-position@^1.1.0:+ version "1.1.0"+ resolved "https://registry.yarnpkg.com/index-to-position/-/index-to-position-1.1.0.tgz#2e50bd54c8040bdd6d9b3d95ec2a8fedf86b4d44"+ integrity sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg==+inflight@^1.0.4:version "1.0.6"resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"@@ -4380,7 +4452,12 @@ jiti@^2.4.2:resolved "https://registry.yarnpkg.com/jiti/-/jiti-2.4.2.tgz#d19b7732ebb6116b06e2038da74a55366faef560"integrity sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==-"js-tokens@^3.0.0 || ^4.0.0":+js-levenshtein@^1.1.6:+ version "1.1.6"+ resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d"+ integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==++"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:version "4.0.0"resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==@@ -4402,6 +4479,11 @@ json-schema-traverse@^0.4.1:resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==+json-schema-traverse@^1.0.0:+ version "1.0.0"+ resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"+ integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==+json-schema@^0.4.0:version "0.4.0"resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5"@@ -4944,6 +5026,13 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:dependencies:brace-expansion "^1.1.7"+minimatch@^5.0.1:+ version "5.1.6"+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96"+ integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==+ dependencies:+ brace-expansion "^2.0.1"+minimatch@^9.0.4:version "9.0.5"resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5"@@ -5128,6 +5217,18 @@ once@^1.3.0:dependencies:wrappy "1"+openapi-typescript@^7.6.1:+ version "7.6.1"+ resolved "https://registry.yarnpkg.com/openapi-typescript/-/openapi-typescript-7.6.1.tgz#e39d1e21ebf43f91712703f7063118246d099d19"+ integrity sha512-F7RXEeo/heF3O9lOXo2bNjCOtfp7u+D6W3a3VNEH2xE6v+fxLtn5nq0uvUcA1F5aT+CMhNeC5Uqtg5tlXFX/ag==+ dependencies:+ "@redocly/openapi-core" "^1.28.0"+ ansi-colors "^4.1.3"+ change-case "^5.4.4"+ parse-json "^8.1.0"+ supports-color "^9.4.0"+ yargs-parser "^21.1.1"+optionator@^0.9.3:version "0.9.4"resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734"@@ -5188,6 +5289,15 @@ parse-entities@^4.0.0:is-decimal "^2.0.0"is-hexadecimal "^2.0.0"+parse-json@^8.1.0:+ version "8.3.0"+ resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-8.3.0.tgz#88a195a2157025139a2317a4f2f9252b61304ed5"+ integrity sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==+ dependencies:+ "@babel/code-frame" "^7.26.2"+ index-to-position "^1.1.0"+ type-fest "^4.39.1"+path-exists@^4.0.0:version "4.0.0"resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"@@ -5218,6 +5328,11 @@ picomatch@^2.3.1:resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==+pluralize@^8.0.0:+ version "8.0.0"+ resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1"+ integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==+popover@^2.4.1:version "2.4.1"resolved "https://registry.yarnpkg.com/popover/-/popover-2.4.1.tgz#aeec30d9628b9399ebf13e10f8aafcc154e57a9e"@@ -5738,6 +5853,11 @@ remark-rehype@^11.0.0:unified "^11.0.0"vfile "^6.0.0"+require-from-string@^2.0.2:+ version "2.0.2"+ resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"+ integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==+resolve-from@^4.0.0:version "4.0.0"resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"@@ -6124,6 +6244,11 @@ supports-color@^7.1.0:dependencies:has-flag "^4.0.0"+supports-color@^9.4.0:+ version "9.4.0"+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.4.0.tgz#17bfcf686288f531db3dea3215510621ccb55954"+ integrity sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==+supports-preserve-symlinks-flag@^1.0.0:version "1.0.0"resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"@@ -6270,6 +6395,11 @@ type-fest@^0.20.2:resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==+type-fest@^4.39.1:+ version "4.40.0"+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.40.0.tgz#62bc09caccb99a75e1ad6b9b4653e8805e5e1eee"+ integrity sha512-ABHZ2/tS2JkvH1PEjxFDTUWC8dB5OsIGZP4IFLhR293GqT5Y5qB1WwL2kMPYhQW9DVgVD8Hd7I8gjwPIf5GFkw==+typed-array-buffer@^1.0.3:version "1.0.3"resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536"@@ -6404,6 +6534,11 @@ update-browserslist-db@^1.1.1:escalade "^3.2.0"picocolors "^1.1.1"+uri-js-replace@^1.0.1:+ version "1.0.1"+ resolved "https://registry.yarnpkg.com/uri-js-replace/-/uri-js-replace-1.0.1.tgz#c285bb352b701c9dfdaeffc4da5be77f936c9048"+ integrity sha512-W+C9NWNLFOoBI2QWDp4UT9pv65r2w5Cx+3sTYFvtMdDBxkKt1syCqsUdSFAChbEe1uK5TfS04wt/nGwmaeIQ0g==+uri-js@^4.2.2:version "4.4.1"resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"@@ -6585,6 +6720,16 @@ [email protected]:dependencies:"@babel/runtime-corejs3" "^7.16.5"+ version "0.0.43"+ resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb"+ integrity sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==++yargs-parser@^21.1.1:+ version "21.1.1"+ resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"+ integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==+yocto-queue@^0.1.0:version "0.1.0"resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"