Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat: n8n transform

dextmorgn8a978aae76fa
diff --git a/flowsint-api/app/api/routes/transforms.py b/flowsint-api/app/api/routes/transforms.py
index 809318bb..564d52d4 100644
--- a/flowsint-api/app/api/routes/transforms.py
+++ b/flowsint-api/app/api/routes/transforms.py
@@ -7,6 +7,7 @@ from app.utils import extract_input_schema_transform
from app.scanners.registry import ScannerRegistry
from app.core.celery import celery
from app.types.domain import Domain
+from app.types.phrase import Phrase
from app.types.ip import Ip
from app.types.social import SocialProfile
from app.types.organization import Organization
@@ -64,8 +65,8 @@ def get_transforms(
# Returns the "raw_materials" for the transform editor
@router.get("/raw_materials")
async def get_material_list():
- scanners = ScannerRegistry.list_by_category()
- flattened_scanners = {
+ scanners = ScannerRegistry.list_by_categories()
+ scanner_categories = {
category: [
{
"class_name": scanner["class_name"],
@@ -85,8 +86,8 @@ async def get_material_list():
for category, scanner_list in scanners.items()
}
- # Ajoute les types comme des "scanners" spéciaux de type 'type'
object_inputs = [
+ extract_input_schema_transform(Phrase),
extract_input_schema_transform(Organization),
extract_input_schema_transform(Individual),
extract_input_schema_transform(Domain),
@@ -100,10 +101,20 @@ async def get_material_list():
extract_input_schema_transform(CryptoWalletTransaction),
extract_input_schema_transform(CryptoNFT)
]
- flattened_scanners["types"] = object_inputs
+
+ # Put types first, then add all scanner categories
+ flattened_scanners = {"types": object_inputs}
+ flattened_scanners.update(scanner_categories)
return {"items": flattened_scanners}
+# Returns the "raw_materials" for the transform editor
[email protected]("/input_type/{input_type}")
+async def get_material_list(input_type:str):
+ scanners = ScannerRegistry.list_by_input_type(input_type)
+ return {"items": scanners}
+
+
# Create a new transform
@router.post("/create", response_model=TransformRead, status_code=status.HTTP_201_CREATED)
diff --git a/flowsint-api/app/api/routes/types.py b/flowsint-api/app/api/routes/types.py
index 41853c32..bcc291a7 100644
--- a/flowsint-api/app/api/routes/types.py
+++ b/flowsint-api/app/api/routes/types.py
@@ -32,9 +32,10 @@ from app.types.weapon import Weapon
from app.types.bank_account import BankAccount
from app.types.credit_card import CreditCard
from app.types.web_tracker import WebTracker
-from app.types.script import Script
-from app.types.reputation_score import ReputationScore
-from app.types.risk_profile import RiskProfile
+from app.types.phrase import Phrase
+# from app.types.script import Script
+# from app.types.reputation_score import ReputationScore
+# from app.types.risk_profile import RiskProfile
router = APIRouter()
@@ -42,6 +43,17 @@ router = APIRouter()
@router.get("/")
async def get_types_list():
types = [
+ {
+ "id": uuid4(),
+ "type": "global",
+ "key": "global_category",
+ "icon": "phrase",
+ "label": "Global",
+ "fields": [],
+ "children": [
+ extract_input_schema(Phrase, label_key="text"),
+ ],
+ },
{
"id": uuid4(),
"type": "person",
@@ -51,9 +63,9 @@ async def get_types_list():
"fields": [],
"children": [
extract_input_schema(Individual, label_key="full_name"),
- extract_input_schema(SocialProfile, label_key="username", icon="username"),
+ extract_input_schema(SocialProfile, label_key="username", icon="socialprofile"),
extract_input_schema(Organization, label_key="name"),
- extract_input_schema(Username, label_key="username", icon="username"),
+ extract_input_schema(Username, label_key="username", icon="socialprofile"),
# extract_input_schema(Alias, label_key="alias", icon="alias"),
# extract_input_schema(Affiliation, label_key="organization", icon="affiliation"),
],
@@ -79,7 +91,7 @@ async def get_types_list():
"children": [
extract_input_schema(Phone, label_key="number"),
extract_input_schema(Email, label_key="email"),
- extract_input_schema(SocialProfile, label_key="username", icon="username"),
+ extract_input_schema(SocialProfile, label_key="username", icon="socialprofile"),
extract_input_schema(Message, label_key="content", icon="message"),
],
},
diff --git a/flowsint-api/app/scanners/base.py b/flowsint-api/app/scanners/base.py
index fd4d8ac3..5921c41e 100644
--- a/flowsint-api/app/scanners/base.py
+++ b/flowsint-api/app/scanners/base.py
@@ -52,16 +52,15 @@ class Scanner(ABC):
self.ParamsModel = build_params_model(self.params_schema)
self.params: Dict[str, Any] = params or {}
# Params is filled synchronously by the constructor. This params is generally constructed of
- # ApiKey references, not the key directly. The idea is that the real key values are resolved after calling
+ # vaultSecret references, not the key directly. The idea is that the real key values are resolved after calling
# async_init(), right before the execution.
async def async_init(self):
self.ParamsModel = build_params_model(self.params_schema)
- Logger.warn(self.sketch_id, {"message": f"Params raw: {str(self.params)}"})
# Resolve parameters (e.g. replace vaultSecret by real secrets)
if self.params:
resolved_params = self.resolve_params()
- Logger.warn(self.sketch_id, {"message": f"Resolved params: {str(resolved_params)}"})
+ Logger.debug(self.sketch_id, {"message": f"Resolved params: {str(resolved_params)}"})
else:
resolved_params = {}
# Strict validation after resolution
@@ -81,11 +80,25 @@ class Scanner(ABC):
Logger.warn(self.sketch_id, {"message": f"Param {i}: {str(param)}"})
i += 1
if param["type"] == "vaultSecret":
- resolved[param["name"]] = self.vault.get_secret(self.params[param["name"]])
+ # Check if the vault secret parameter is provided
+ if param["name"] in self.params and self.params[param["name"]]:
+ if self.vault is not None:
+ secret = self.vault.get_secret(self.params[param["name"]])
+ if secret is not None:
+ resolved[param["name"]] = secret
+ else:
+ # If secret not found in vault, keep the original parameter value
+ resolved[param["name"]] = self.params[param["name"]]
+ else:
+ # If vault is not available, use the parameter value as-is
+ resolved[param["name"]] = self.params[param["name"]]
+ elif param.get("default") is not None:
+ resolved[param["name"]] = param["default"]
+ # If not provided and no default, skip (optional parameter)
else:
- if self.params[param["name"]]:
+ if param["name"] in self.params and self.params[param["name"]]:
resolved[param["name"]] = self.params[param["name"]]
- elif param["default"] is not None:
+ elif param.get("default") is not None:
resolved[param["name"]] = param["default"]
else:
continue
diff --git a/flowsint-api/app/scanners/crypto/wallet_to_nfts.py b/flowsint-api/app/scanners/crypto/wallet_to_nfts.py
index 2eb3ec48..b87d6993 100644
--- a/flowsint-api/app/scanners/crypto/wallet_to_nfts.py
+++ b/flowsint-api/app/scanners/crypto/wallet_to_nfts.py
@@ -107,7 +107,7 @@ class CryptoWalletAddressToNFTs(Scanner):
cleaned.append(wallet_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
results: OutputType = []
results: OutputType = []
params = self.get_params()
diff --git a/flowsint-api/app/scanners/crypto/wallet_to_transactions.py b/flowsint-api/app/scanners/crypto/wallet_to_transactions.py
index 2326e623..a6ae78ee 100644
--- a/flowsint-api/app/scanners/crypto/wallet_to_transactions.py
+++ b/flowsint-api/app/scanners/crypto/wallet_to_transactions.py
@@ -65,7 +65,7 @@ class CryptoWalletAddressToTransactions(Scanner):
@classmethod
def category(cls) -> str:
- return "CryptoCryptoWallet"
+ return "CryptoWallet"
@classmethod
def key(cls) -> str:
diff --git a/flowsint-api/app/scanners/domains/domain_to_asn.py b/flowsint-api/app/scanners/domains/domain_to_asn.py
index 1eaba84e..624d44a7 100644
--- a/flowsint-api/app/scanners/domains/domain_to_asn.py
+++ b/flowsint-api/app/scanners/domains/domain_to_asn.py
@@ -68,7 +68,7 @@ class DomainToAsnScanner(Scanner):
cleaned.append(domain_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Find ASN information for domain name using asnmap."""
asns: OutputType = []
for domain in data:
diff --git a/flowsint-api/app/scanners/domains/resolve.py b/flowsint-api/app/scanners/domains/resolve.py
index 113548e3..6d05a8ab 100644
--- a/flowsint-api/app/scanners/domains/resolve.py
+++ b/flowsint-api/app/scanners/domains/resolve.py
@@ -68,7 +68,7 @@ class ResolveScanner(Scanner):
cleaned.append(domain_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
results: OutputType = []
for d in data:
try:
diff --git a/flowsint-api/app/scanners/domains/subdomains.py b/flowsint-api/app/scanners/domains/subdomains.py
index 45e65010..dff556c1 100644
--- a/flowsint-api/app/scanners/domains/subdomains.py
+++ b/flowsint-api/app/scanners/domains/subdomains.py
@@ -68,7 +68,7 @@ class SubdomainScanner(Scanner):
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Find subdomains using subfinder (if available) or fallback to crt.sh."""
domains: OutputType = []
use_subfinder = self.__is_subfinder_installed()
diff --git a/flowsint-api/app/scanners/domains/to_website.py b/flowsint-api/app/scanners/domains/to_website.py
index dc9c6c9e..1347815f 100644
--- a/flowsint-api/app/scanners/domains/to_website.py
+++ b/flowsint-api/app/scanners/domains/to_website.py
@@ -98,7 +98,7 @@ class DomainToWebsiteScanner(Scanner):
except requests.RequestException:
return False, url, []
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""To website"""
results: OutputType = []
for d in data:
diff --git a/flowsint-api/app/scanners/domains/whois.py b/flowsint-api/app/scanners/domains/whois.py
index cf2c639d..9d7071cb 100644
--- a/flowsint-api/app/scanners/domains/whois.py
+++ b/flowsint-api/app/scanners/domains/whois.py
@@ -70,7 +70,7 @@ class WhoisScanner(Scanner):
cleaned.append(domain_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Extract WHOIS data for each domain."""
results: OutputType = []
for d in data:
diff --git a/flowsint-api/app/scanners/emails/to_gravatar.py b/flowsint-api/app/scanners/emails/to_gravatar.py
index 5994d400..d3cb63b0 100644
--- a/flowsint-api/app/scanners/emails/to_gravatar.py
+++ b/flowsint-api/app/scanners/emails/to_gravatar.py
@@ -79,7 +79,7 @@ class EmailToGravatarScanner(Scanner):
cleaned.append(email_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Fetch gravatar from email."""
results: OutputType = []
for email in data:
diff --git a/flowsint-api/app/scanners/emails/to_leaks.py b/flowsint-api/app/scanners/emails/to_leaks.py
index 1fb43408..c959bf3d 100644
--- a/flowsint-api/app/scanners/emails/to_leaks.py
+++ b/flowsint-api/app/scanners/emails/to_leaks.py
@@ -86,7 +86,7 @@ class EmailToBreachesScanner(Scanner):
cleaned.append(email_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Fetch breaches from email using HaveIBeenPwned API."""
results: OutputType = []
if not HIBP_API_KEY:
diff --git a/flowsint-api/app/scanners/individuals/to_org.py b/flowsint-api/app/scanners/individuals/to_org.py
index d0824690..a8e8e05b 100644
--- a/flowsint-api/app/scanners/individuals/to_org.py
+++ b/flowsint-api/app/scanners/individuals/to_org.py
@@ -85,7 +85,7 @@ class IndividualToOrgScanner(Scanner):
Logger.error(self.sketch_id, {"message": "[INDIVIDUAL_TO_ORG] The input type did not match."})
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
results: OutputType = []
for indiv in data:
diff --git a/flowsint-api/app/scanners/ips/asn_to_cidrs.py b/flowsint-api/app/scanners/ips/asn_to_cidrs.py
index 14d51844..967921e1 100644
--- a/flowsint-api/app/scanners/ips/asn_to_cidrs.py
+++ b/flowsint-api/app/scanners/ips/asn_to_cidrs.py
@@ -68,7 +68,7 @@ class AsnToCidrsScanner(Scanner):
continue
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Find CIDR from ASN using asnmap."""
cidrs: OutputType = []
self._asn_to_cidrs_map = [] # Store mapping for postprocess
diff --git a/flowsint-api/app/scanners/ips/cidr_to_ips.py b/flowsint-api/app/scanners/ips/cidr_to_ips.py
index 8fa118df..a0a1bb28 100644
--- a/flowsint-api/app/scanners/ips/cidr_to_ips.py
+++ b/flowsint-api/app/scanners/ips/cidr_to_ips.py
@@ -65,7 +65,7 @@ class CidrToIpsScanner(Scanner):
continue
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Find IP addresses from CIDR using dnsx."""
ips: OutputType = []
for cidr in data:
diff --git a/flowsint-api/app/scanners/ips/geolocation.py b/flowsint-api/app/scanners/ips/geolocation.py
index 468a60e2..50bfb1d0 100644
--- a/flowsint-api/app/scanners/ips/geolocation.py
+++ b/flowsint-api/app/scanners/ips/geolocation.py
@@ -19,6 +19,10 @@ class GeolocationScanner(Scanner):
@classmethod
def category(cls) -> str:
return "Ip"
+
+ @classmethod
+ def key(cls) -> str:
+ return "address"
@classmethod
def input_schema(cls) -> Dict[str, Any]:
@@ -60,7 +64,7 @@ class GeolocationScanner(Scanner):
cleaned.append(ip_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
results: OutputType = []
for ip in data:
try:
diff --git a/flowsint-api/app/scanners/ips/ip_to_asn.py b/flowsint-api/app/scanners/ips/ip_to_asn.py
index 03e3e402..f0d88aaf 100644
--- a/flowsint-api/app/scanners/ips/ip_to_asn.py
+++ b/flowsint-api/app/scanners/ips/ip_to_asn.py
@@ -68,7 +68,7 @@ class IpToAsnScanner(Scanner):
cleaned.append(ip_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Find ASN information for IP addresses using asnmap."""
asns: OutputType = []
diff --git a/flowsint-api/app/scanners/ips/reverse_resolve.py b/flowsint-api/app/scanners/ips/reverse_resolve.py
index c4cb2e5b..df5c5033 100644
--- a/flowsint-api/app/scanners/ips/reverse_resolve.py
+++ b/flowsint-api/app/scanners/ips/reverse_resolve.py
@@ -71,7 +71,7 @@ class ReverseResolveScanner(Scanner):
cleaned.append(ip_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
results: OutputType = []
for ip in data:
try:
diff --git a/flowsint-api/app/scanners/leaks/hibp.py b/flowsint-api/app/scanners/leaks/hibp.py
index 6c3f157b..e67dcd33 100644
--- a/flowsint-api/app/scanners/leaks/hibp.py
+++ b/flowsint-api/app/scanners/leaks/hibp.py
@@ -34,7 +34,7 @@ class HibpScanner(Scanner):
def output_schema(self) -> Dict[str, str]:
return ["email", "breaches", "adobe", "data", "pastes", "password", "hashes"]
- def scan(self, emails: List[str]) -> List[Dict[str, Any]]:
+ async def scan(self, emails: List[str]) -> List[Dict[str, Any]]:
"""Performs a search on HaveIBeenPwned for a list of emails."""
results = []
for email in emails:
diff --git a/flowsint-api/app/scanners/n8n/connector.py b/flowsint-api/app/scanners/n8n/connector.py
new file mode 100644
index 00000000..289e8e07
--- /dev/null
+++ b/flowsint-api/app/scanners/n8n/connector.py
@@ -0,0 +1,115 @@
+import json
+import aiohttp
+from typing import List, Dict, Any, Optional, TypeAlias
+from app.scanners.base import Scanner
+from app.core.logger import Logger
+from app.core.graph_db import Neo4jConnection
+
+InputType: TypeAlias = List[dict]
+OutputType: TypeAlias = List[dict]
+
+class N8nConnector(Scanner):
+ """
+ Let's you use your custom n8n workflows to process data. The types are not checked on this connector, so make sure to use the correct types in your n8n workflows.
+ """
+ def __init__(
+ self,
+ sketch_id: Optional[str] = None,
+ scan_id: Optional[str] = None,
+ neo4j_conn: Optional[Neo4jConnection] = None,
+ vault=None,
+ params: Optional[Dict[str, Any]] = None
+ ):
+ super().__init__(
+ sketch_id=sketch_id,
+ scan_id=scan_id,
+ neo4j_conn=neo4j_conn,
+ params_schema=self.get_params_schema(),
+ vault=vault,
+ params=params
+ )
+
+ @classmethod
+ def name(cls) -> str:
+ return "n8n_connector"
+
+ @classmethod
+ def category(cls) -> str:
+ return "external"
+
+ @classmethod
+ def key(cls) -> str:
+ return "any"
+
+ @classmethod
+ def input_schema(cls) -> Dict[str, Any]:
+ return {
+ "type": "Any",
+ "properties": [
+ {"name": "value", "type": "object"}
+ ]
+ }
+
+ @classmethod
+ def output_schema(cls) -> Dict[str, Any]:
+ return {
+ "type": "Any",
+ "properties": [
+ {"name": "data", "type": "object"}
+ ]
+ }
+
+ @classmethod
+ def get_params_schema(cls) -> List[Dict[str, Any]]:
+ return [
+ {
+ "name": "webhook_url",
+ "type": "url",
+ "required": True,
+ "description": "The n8n webhook URL to send data to",
+ },
+ {
+ "name": "auth_token",
+ "type": "vaultSecret",
+ "required": False,
+ "description": "Optional authentication token for the webhook"
+ },
+ {
+ "name": "extra_payload",
+ "type": "string",
+ "required": False,
+ "description": "Optional JSON string with additional data to include in the payload"
+ }
+ ]
+
+ async def scan(self, values: list[str]) -> list[dict]:
+ params = self.get_params()
+ url = params["webhook_url"]
+ Logger.info(self.sketch_id, {"message": f"n8n connector url: {url}"})
+ headers = {"Content-Type": "application/json"}
+ if "auth_token" in params:
+ headers["Authorization"] = f"Bearer {params['auth_token']}"
+
+ payload = {
+ "inputs": values
+ }
+
+ # Ajout de données additionnelles dans le payload
+ if "extra_payload" in params and params["extra_payload"] is not None:
+ try:
+ extra = json.loads(params["extra_payload"])
+ payload.update(extra)
+ except json.JSONDecodeError:
+ Logger.warn(self.sketch_id, {"message": "extra_payload is not valid JSON"})
+
+ async with aiohttp.ClientSession() as session:
+ async with session.post(url, headers=headers, json=payload) as response:
+ if response.status != 200:
+ raise Exception(f"n8n responded with {response.status}: {await response.text()}")
+ data = await response.json()
+
+ return data
+
+ def postprocess(self, results: list[dict], original_input: list[dict]) -> list[dict]:
+ Logger.success(self.sketch_id, {"message": "n8n connector results", "results": results})
+ return results
diff --git a/flowsint-api/app/scanners/organizations/org_to_asn.py b/flowsint-api/app/scanners/organizations/org_to_asn.py
index 72c1a1b4..c03e1b7d 100644
--- a/flowsint-api/app/scanners/organizations/org_to_asn.py
+++ b/flowsint-api/app/scanners/organizations/org_to_asn.py
@@ -73,7 +73,7 @@ class OrgToAsnScanner(Scanner):
cleaned.append(org_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Find ASN information for organizations using asnmap."""
asns: OutputType = []
diff --git a/flowsint-api/app/scanners/organizations/to_infos.py b/flowsint-api/app/scanners/organizations/to_infos.py
index 1b3a58ce..963790f0 100644
--- a/flowsint-api/app/scanners/organizations/to_infos.py
+++ b/flowsint-api/app/scanners/organizations/to_infos.py
@@ -77,7 +77,7 @@ class OrgToInfosScanner(Scanner):
cleaned.append(item)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
results: OutputType = []
for org in data:
diff --git a/flowsint-api/app/scanners/registry.py b/flowsint-api/app/scanners/registry.py
index 8f5f167a..9cc216e9 100644
--- a/flowsint-api/app/scanners/registry.py
+++ b/flowsint-api/app/scanners/registry.py
@@ -22,6 +22,7 @@ from app.scanners.emails.to_leaks import EmailToBreachesScanner
from app.scanners.individuals.to_org import IndividualToOrgScanner
from app.scanners.organizations.to_infos import OrgToInfosScanner
from app.scanners.websites.to_webtrackers import WebsiteToWebtrackersScanner
+from app.scanners.n8n.connector import N8nConnector
class ScannerRegistry:
@@ -47,20 +48,22 @@ class ScannerRegistry:
def list(cls) -> Dict[str, Dict[str, str]]:
return {
name: {
- "class_name": scanner.__name__,
+ "class_name": scanner.__name__,
"name": scanner.name(),
- "category": scanner.category(),
"module": scanner.__module__,
"doc": scanner.__doc__,
- "key": scanner.key(),
- "params": scanner.get_params_schema(),
+ "category": scanner.category(),
+ "inputs": scanner.input_schema(),
+ "outputs": scanner.output_schema(),
+ "params": {},
+ "params_schema": scanner.get_params_schema(),
"requires_key": scanner.requires_key(),
}
for name, scanner in cls._scanners.items()
}
@classmethod
- def list_by_category(cls) -> Dict[str, Dict[str, str]]:
+ def list_by_categories(cls) -> Dict[str, Dict[str, str]]:
scanners_by_category = {}
for _, scanner in cls._scanners.items():
category = scanner.category()
@@ -80,6 +83,35 @@ class ScannerRegistry:
})
return scanners_by_category
+ @classmethod
+ def list_by_input_type(cls, input_type: str) -> Dict[str, Dict[str, str]]:
+ if input_type.lower() == "any":
+ return [{
+ "class_name": scanner.__name__,
+ "name": scanner.name(),
+ "module": scanner.__module__,
+ "doc": scanner.__doc__,
+ "category": scanner.category(),
+ "inputs": scanner.input_schema(),
+ "outputs": scanner.output_schema(),
+ "params": {},
+ "params_schema": scanner.get_params_schema(),
+ "requires_key": scanner.requires_key(),
+ } for _, scanner in cls._scanners.items()]
+
+ return [{
+ "class_name": scanner.__name__,
+ "name": scanner.name(),
+ "module": scanner.__module__,
+ "doc": scanner.__doc__,
+ "category": scanner.category(),
+ "inputs": scanner.input_schema(),
+ "outputs": scanner.output_schema(),
+ "params": {},
+ "params_schema": scanner.get_params_schema(),
+ "requires_key": scanner.requires_key(),
+ } for _, scanner in cls._scanners.items() if scanner.input_schema()["type"].lower() in ["any", input_type.lower()]]
+
ScannerRegistry.register(ReverseResolveScanner)
ScannerRegistry.register(ResolveScanner)
ScannerRegistry.register(SubdomainScanner)
@@ -103,4 +135,5 @@ ScannerRegistry.register(IndividualToOrgScanner)
ScannerRegistry.register(OrgToInfosScanner)
ScannerRegistry.register(IndividualToOrgScanner)
ScannerRegistry.register(WebsiteToWebtrackersScanner)
+ScannerRegistry.register(N8nConnector)
diff --git a/flowsint-api/app/scanners/socials/maigret.py b/flowsint-api/app/scanners/socials/maigret.py
index 66295f1d..47ca3f00 100644
--- a/flowsint-api/app/scanners/socials/maigret.py
+++ b/flowsint-api/app/scanners/socials/maigret.py
@@ -132,7 +132,7 @@ class MaigretScanner(Scanner):
return results
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
results: OutputType = []
for ms in data:
if not ms.username:
diff --git a/flowsint-api/app/scanners/socials/sherlock.py b/flowsint-api/app/scanners/socials/sherlock.py
index 5431893c..15c2205c 100644
--- a/flowsint-api/app/scanners/socials/sherlock.py
+++ b/flowsint-api/app/scanners/socials/sherlock.py
@@ -69,7 +69,7 @@ class SherlockScanner(Scanner):
cleaned.append(obj)
return cleaned
- def scan(self, usernames: List[str]) -> Dict[str, Any]:
+ async def scan(self, usernames: List[str]) -> Dict[str, Any]:
"""Performs the scan using Sherlock on the list of usernames."""
results_list = [] # List to store scan results for each username
diff --git a/flowsint-api/app/scanners/websites/to_crawler.py b/flowsint-api/app/scanners/websites/to_crawler.py
index 97130a6e..3a929a35 100644
--- a/flowsint-api/app/scanners/websites/to_crawler.py
+++ b/flowsint-api/app/scanners/websites/to_crawler.py
@@ -81,7 +81,7 @@ class WebsiteToCrawler(Scanner):
cleaned.append(website_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Crawl websites to extract emails and phone numbers."""
results = []
diff --git a/flowsint-api/app/scanners/websites/to_domain.py b/flowsint-api/app/scanners/websites/to_domain.py
index 24cdd685..4829ad8e 100644
--- a/flowsint-api/app/scanners/websites/to_domain.py
+++ b/flowsint-api/app/scanners/websites/to_domain.py
@@ -86,7 +86,7 @@ class WebsiteToDomainScanner(Scanner):
except Exception:
return ""
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Extract domain from website."""
results: OutputType = []
for website in data:
diff --git a/flowsint-api/app/scanners/websites/to_webtrackers.py b/flowsint-api/app/scanners/websites/to_webtrackers.py
index cfce2c29..f7398e03 100644
--- a/flowsint-api/app/scanners/websites/to_webtrackers.py
+++ b/flowsint-api/app/scanners/websites/to_webtrackers.py
@@ -1,4 +1,4 @@
-from typing import List, Dict, Any, TypeAlias, Union
+from typing import List, Dict, Any, TypeAlias, Union, Optional
from app.utils import resolve_type
from app.scanners.base import Scanner
from app.types.website import Website
@@ -6,6 +6,8 @@ from app.types.domain import Domain
from app.types.web_tracker import WebTracker
from pydantic import TypeAdapter
from app.core.logger import Logger
+from app.core.graph_db import Neo4jConnection
+from app.core.vault import VaultProtocol
from recontrack import TrackingCodeExtractor
@@ -16,8 +18,16 @@ OutputType: TypeAlias = List[WebTracker]
class WebsiteToWebtrackersScanner(Scanner):
"""From website to webtrackers."""
- def __init__(self, sketch_id: str, scan_id: str, neo4j_conn=None):
- super().__init__(sketch_id, scan_id, neo4j_conn)
+ def __init__(
+ self,
+ sketch_id: str,
+ scan_id: str,
+ neo4j_conn: Optional[Neo4jConnection] = None,
+ params_schema: Optional[List[Dict[str, Any]]] = None,
+ vault: Optional[VaultProtocol] = None,
+ params: Optional[Dict[str, Any]] = None
+ ):
+ super().__init__(sketch_id, scan_id, neo4j_conn, params_schema, vault, params)
self.tracker_website_mapping: List[tuple[WebTracker, Website]] = []
@classmethod
@@ -80,7 +90,7 @@ class WebsiteToWebtrackersScanner(Scanner):
cleaned.append(website_obj)
return cleaned
- def scan(self, data: InputType) -> OutputType:
+ async def scan(self, data: InputType) -> OutputType:
"""Extract domain from website."""
results: OutputType = []
# Clear the mapping for this scan
diff --git a/flowsint-api/app/types/address.py b/flowsint-api/app/types/address.py
index 6280652b..e7e84602 100644
--- a/flowsint-api/app/types/address.py
+++ b/flowsint-api/app/types/address.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional
class PhysicalAddress(BaseModel):
+ """Represents a physical address with geographical coordinates."""
address: str = Field(..., description="Street address", title="Street Address")
city: str = Field(..., description="City name", title="City")
country: str = Field(..., description="Country name", title="Country")
diff --git a/flowsint-api/app/types/affiliation.py b/flowsint-api/app/types/affiliation.py
index 6f0a906f..0c0527f3 100644
--- a/flowsint-api/app/types/affiliation.py
+++ b/flowsint-api/app/types/affiliation.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Affiliation(BaseModel):
+ """Represents an organizational affiliation or employment relationship."""
organization: str = Field(..., description="Organization or group name", title="Organization")
role: Optional[str] = Field(None, description="Role or position within organization", title="Role")
start_date: Optional[str] = Field(None, description="Start date of affiliation", title="Start Date")
diff --git a/flowsint-api/app/types/alias.py b/flowsint-api/app/types/alias.py
index deceb6c7..aab7f7b2 100644
--- a/flowsint-api/app/types/alias.py
+++ b/flowsint-api/app/types/alias.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Alias(BaseModel):
+ """Represents an alias or alternative name used by an entity."""
alias: str = Field(..., description="Alias or alternative name", title="Alias")
type: Optional[str] = Field(None, description="Type of alias (nickname, code name, etc.)", title="Alias Type")
context: Optional[str] = Field(None, description="Context where alias is used", title="Context")
diff --git a/flowsint-api/app/types/asn.py b/flowsint-api/app/types/asn.py
index d7e10cee..61a29015 100644
--- a/flowsint-api/app/types/asn.py
+++ b/flowsint-api/app/types/asn.py
@@ -3,6 +3,7 @@ from pydantic import BaseModel, Field
from .cidr import CIDR
class ASN(BaseModel):
+ """Represents an Autonomous System Number with associated network information."""
number: int = Field(..., description="Autonomous System Number (e.g., 15169)", title="ASN Number")
name: Optional[str] = Field(None, description="Name of the organization owning the ASN", title="Organization Name")
country: Optional[str] = Field(None, description="ISO 3166-1 alpha-2 country code", title="Country Code")
diff --git a/flowsint-api/app/types/bank_account.py b/flowsint-api/app/types/bank_account.py
index 9f7ae822..fbee130e 100644
--- a/flowsint-api/app/types/bank_account.py
+++ b/flowsint-api/app/types/bank_account.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class BankAccount(BaseModel):
+ """Represents a bank account with financial and security information."""
account_number: str = Field(..., description="Bank account number", title="Account Number")
bank_name: Optional[str] = Field(None, description="Bank name", title="Bank Name")
account_type: Optional[str] = Field(None, description="Type of account (checking, savings, etc.)", title="Account Type")
diff --git a/flowsint-api/app/types/breach.py b/flowsint-api/app/types/breach.py
index b28458d0..53ae5730 100644
--- a/flowsint-api/app/types/breach.py
+++ b/flowsint-api/app/types/breach.py
@@ -2,6 +2,7 @@ from typing import List, Optional, Dict
from pydantic import BaseModel, Field
class Breach(BaseModel):
+ """Represents a data breach incident with affected accounts and details."""
name: str = Field(..., description="The name of the breach or service", title="Breach Name")
title: Optional[str] = Field(None, description="Title of the breach", title="Breach Title")
domain: Optional[str] = Field(None, description="Domain of the breached service", title="Domain")
diff --git a/flowsint-api/app/types/cidr.py b/flowsint-api/app/types/cidr.py
index 682eabdf..ec58c351 100644
--- a/flowsint-api/app/types/cidr.py
+++ b/flowsint-api/app/types/cidr.py
@@ -1,4 +1,5 @@
from pydantic import BaseModel, IPvAnyNetwork, Field
class CIDR(BaseModel):
+ """Represents a CIDR (Classless Inter-Domain Routing) network block."""
network: IPvAnyNetwork = Field(..., description="CIDR block (e.g., 8.8.8.0/24)", title="Network Block")
diff --git a/flowsint-api/app/types/credential.py b/flowsint-api/app/types/credential.py
index f433a16d..38094ad5 100644
--- a/flowsint-api/app/types/credential.py
+++ b/flowsint-api/app/types/credential.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Credential(BaseModel):
+ """Represents user credentials with compromise and usage information."""
username: str = Field(..., description="Username or identifier", title="Username")
service: Optional[str] = Field(None, description="Service or platform where credential is used", title="Service")
type: Optional[str] = Field(None, description="Type of credential (password, token, key, etc.)", title="Credential Type")
diff --git a/flowsint-api/app/types/credit_card.py b/flowsint-api/app/types/credit_card.py
index ea14e1c1..a2ab78d1 100644
--- a/flowsint-api/app/types/credit_card.py
+++ b/flowsint-api/app/types/credit_card.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class CreditCard(BaseModel):
+ """Represents a credit card with financial details and security status."""
card_number: str = Field(..., description="Credit card number", title="Card Number")
card_type: Optional[str] = Field(None, description="Type of card (Visa, Mastercard, etc.)", title="Card Type")
issuer: Optional[str] = Field(None, description="Card issuer bank", title="Issuer")
diff --git a/flowsint-api/app/types/device.py b/flowsint-api/app/types/device.py
index bd685f81..d2d04b99 100644
--- a/flowsint-api/app/types/device.py
+++ b/flowsint-api/app/types/device.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Device(BaseModel):
+ """Represents a device with hardware, software, and network information."""
device_id: str = Field(..., description="Unique device identifier", title="Device ID")
type: Optional[str] = Field(None, description="Type of device (mobile, desktop, server, etc.)", title="Device Type")
manufacturer: Optional[str] = Field(None, description="Device manufacturer", title="Manufacturer")
diff --git a/flowsint-api/app/types/dns_record.py b/flowsint-api/app/types/dns_record.py
index fd86518f..bb5fb1f6 100644
--- a/flowsint-api/app/types/dns_record.py
+++ b/flowsint-api/app/types/dns_record.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class DNSRecord(BaseModel):
+ """Represents a DNS record with type, value, and security information."""
record_type: str = Field(..., description="Type of DNS record (A, AAAA, CNAME, MX, etc.)", title="Record Type")
name: str = Field(..., description="Domain name", title="Domain Name")
value: str = Field(..., description="Record value", title="Record Value")
diff --git a/flowsint-api/app/types/document.py b/flowsint-api/app/types/document.py
index 79757406..7c5c8bd6 100644
--- a/flowsint-api/app/types/document.py
+++ b/flowsint-api/app/types/document.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Document(BaseModel):
+ """Represents a document with metadata, security, and content information."""
title: str = Field(..., description="Document title", title="Title")
type: Optional[str] = Field(None, description="Type of document (PDF, DOC, etc.)", title="Document Type")
file_size: Optional[int] = Field(None, description="File size in bytes", title="File Size")
diff --git a/flowsint-api/app/types/domain.py b/flowsint-api/app/types/domain.py
index 37a9bcc7..eaba0822 100644
--- a/flowsint-api/app/types/domain.py
+++ b/flowsint-api/app/types/domain.py
@@ -2,6 +2,7 @@ from typing import Optional
from pydantic import BaseModel, Field
class Domain(BaseModel):
+ """Represents a domain name and its properties."""
domain: str = Field(..., description="Domain name", title="Domain Name")
root: Optional[bool]= Field(True, description="Is root or not", title="Is Root Domain")
diff --git a/flowsint-api/app/types/email.py b/flowsint-api/app/types/email.py
index 617fadcb..9a4818e4 100644
--- a/flowsint-api/app/types/email.py
+++ b/flowsint-api/app/types/email.py
@@ -1,4 +1,5 @@
from pydantic import BaseModel, Field
class Email(BaseModel):
+ """Represents an email address."""
email: str = Field(..., description="Email address", title="Email Address")
\ No newline at end of file
diff --git a/flowsint-api/app/types/file.py b/flowsint-api/app/types/file.py
index a448fe68..046264d2 100644
--- a/flowsint-api/app/types/file.py
+++ b/flowsint-api/app/types/file.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class File(BaseModel):
+ """Represents a file with metadata, type information, and security assessment."""
filename: str = Field(..., description="File name", title="Filename")
file_type: Optional[str] = Field(None, description="File type or extension", title="File Type")
file_size: Optional[int] = Field(None, description="File size in bytes", title="File Size")
diff --git a/flowsint-api/app/types/gravatar.py b/flowsint-api/app/types/gravatar.py
index 87e61526..eddc149a 100644
--- a/flowsint-api/app/types/gravatar.py
+++ b/flowsint-api/app/types/gravatar.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field, HttpUrl
from typing import Optional, List
class Gravatar(BaseModel):
+ """Represents a Gravatar profile with image and user information."""
src: HttpUrl = Field(..., description="Gravatar image URL", title="Image URL")
hash: str = Field(..., description="Gravatar hash", title="Hash")
size: Optional[int] = Field(None, description="Image size in pixels", title="Image Size")
diff --git a/flowsint-api/app/types/individual.py b/flowsint-api/app/types/individual.py
index 18adb2c4..a7693d32 100644
--- a/flowsint-api/app/types/individual.py
+++ b/flowsint-api/app/types/individual.py
@@ -1,9 +1,119 @@
from pydantic import BaseModel, Field
-from typing import Optional, Literal
+from typing import Optional, Literal, List
+from .address import PhysicalAddress
class Individual(BaseModel):
+ """Represents an individual person with comprehensive personal information."""
+ # Basic Information
first_name: str = Field(..., description="First name of the individual", title="First Name")
last_name: str = Field(..., description="Last name of the individual", title="Last Name")
full_name: str = Field(..., description="Full name of the individual", title="Full Name")
+ middle_name: Optional[str] = Field(None, description="Middle name or initial", title="Middle Name")
+ maiden_name: Optional[str] = Field(None, description="Maiden name (if applicable)", title="Maiden Name")
+ aliases: Optional[List[str]] = Field(None, description="Known aliases or nicknames", title="Aliases")
+
+ # Birth Information
birth_date: Optional[str] = Field(None, description="Date of birth", title="Date of Birth")
- gender: Optional[Literal["male", "female", "other"]] = Field(None, description="Gender of the individual", title="Gender")
\ No newline at end of file
+ birth_place: Optional[PhysicalAddress] = Field(None, description="Place of birth", title="Birth Place")
+ age: Optional[int] = Field(None, description="Current age", title="Age")
+
+ # Physical Characteristics
+ gender: Optional[Literal["male", "female", "other"]] = Field(None, description="Gender of the individual", title="Gender")
+ height: Optional[str] = Field(None, description="Height (e.g., '5ft 10in' or '178cm')", title="Height")
+ weight: Optional[str] = Field(None, description="Weight (e.g., '170lbs' or '77kg')", title="Weight")
+ eye_color: Optional[Literal["brown", "blue", "green", "hazel", "gray", "amber", "other"]] = Field(None, description="Eye color", title="Eye Color")
+ hair_color: Optional[Literal["black", "brown", "blonde", "red", "gray", "white", "bald", "other"]] = Field(None, description="Hair color", title="Hair Color")
+ skin_tone: Optional[str] = Field(None, description="Skin tone description", title="Skin Tone")
+ ethnicity: Optional[str] = Field(None, description="Ethnicity or ethnic background", title="Ethnicity")
+ blood_type: Optional[Literal["A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-"]] = Field(None, description="Blood type", title="Blood Type")
+ distinguishing_marks: Optional[List[str]] = Field(None, description="Distinguishing marks, scars, tattoos, etc.", title="Distinguishing Marks")
+ disabilities: Optional[List[str]] = Field(None, description="Known disabilities or medical conditions", title="Disabilities")
+
+ # Health and Lifestyle
+ is_smoker: Optional[bool] = Field(None, description="Whether the individual smokes", title="Is Smoker")
+ is_deceased: Optional[bool] = Field(None, description="Whether the individual is deceased", title="Is Deceased")
+ death_date: Optional[str] = Field(None, description="Date of death (if applicable)", title="Death Date")
+ death_place: Optional[PhysicalAddress] = Field(None, description="Place of death (if applicable)", title="Death Place")
+ cause_of_death: Optional[str] = Field(None, description="Cause of death (if applicable)", title="Cause of Death")
+
+ # Contact Information
+ phone_numbers: Optional[List[str]] = Field(None, description="Known phone numbers", title="Phone Numbers")
+ email_addresses: Optional[List[str]] = Field(None, description="Known email addresses", title="Email Addresses")
+ social_media_profiles: Optional[List[str]] = Field(None, description="Social media profile URLs or usernames", title="Social Media Profiles")
+
+ # Location Information
+ current_address: Optional[PhysicalAddress] = Field(None, description="Current residential address", title="Current Address")
+ previous_addresses: Optional[List[PhysicalAddress]] = Field(None, description="Previous known addresses", title="Previous Addresses")
+ nationality: Optional[str] = Field(None, description="Nationality or country of citizenship", title="Nationality")
+ citizenship: Optional[List[str]] = Field(None, description="Countries of citizenship (dual citizenship possible)", title="Citizenship")
+ place_of_residence: Optional[str] = Field(None, description="Current place of residence (city/state/country)", title="Place of Residence")
+
+ # Identification Documents
+ passport_number: Optional[str] = Field(None, description="Passport number", title="Passport Number")
+ drivers_license: Optional[str] = Field(None, description="Driver's license number", title="Driver's License")
+ social_security_number: Optional[str] = Field(None, description="Social Security Number (SSN)", title="Social Security Number")
+ national_id: Optional[str] = Field(None, description="National ID number", title="National ID")
+ voter_id: Optional[str] = Field(None, description="Voter ID number", title="Voter ID")
+ tax_id: Optional[str] = Field(None, description="Tax identification number", title="Tax ID")
+
+ # Personal Relationships
+ marital_status: Optional[Literal["single", "married", "divorced", "widowed", "separated", "domestic_partnership"]] = Field(None, description="Marital status", title="Marital Status")
+ spouse_name: Optional[str] = Field(None, description="Name of spouse or partner", title="Spouse Name")
+ children_count: Optional[int] = Field(None, description="Number of children", title="Children Count")
+ children_names: Optional[List[str]] = Field(None, description="Names of children", title="Children Names")
+ parents_names: Optional[List[str]] = Field(None, description="Names of parents", title="Parents Names")
+ emergency_contact: Optional[str] = Field(None, description="Emergency contact information", title="Emergency Contact")
+
+ # Professional Information
+ occupation: Optional[str] = Field(None, description="Current occupation or job title", title="Occupation")
+ employer: Optional[str] = Field(None, description="Current employer", title="Employer")
+ employer_address: Optional[PhysicalAddress] = Field(None, description="Employer's address", title="Employer Address")
+ job_title: Optional[str] = Field(None, description="Current job title or position", title="Job Title")
+ annual_income: Optional[float] = Field(None, description="Annual income", title="Annual Income")
+ employment_history: Optional[List[str]] = Field(None, description="Previous employment history", title="Employment History")
+
+ # Education
+ education_level: Optional[Literal["elementary", "high_school", "bachelor", "master", "doctorate", "other"]] = Field(None, description="Highest education level achieved", title="Education Level")
+ schools_attended: Optional[List[str]] = Field(None, description="Schools or universities attended", title="Schools Attended")
+ degrees: Optional[List[str]] = Field(None, description="Degrees or certifications obtained", title="Degrees")
+
+ # Personal Characteristics
+ languages_spoken: Optional[List[str]] = Field(None, description="Languages spoken", title="Languages Spoken")
+ religion: Optional[str] = Field(None, description="Religious affiliation", title="Religion")
+ political_affiliation: Optional[str] = Field(None, description="Political party affiliation", title="Political Affiliation")
+ hobbies: Optional[List[str]] = Field(None, description="Known hobbies or interests", title="Hobbies")
+ personality_traits: Optional[List[str]] = Field(None, description="Known personality traits", title="Personality Traits")
+
+ # Biometric Information
+ fingerprints: Optional[str] = Field(None, description="Fingerprint data or hash", title="Fingerprints")
+ dna_profile: Optional[str] = Field(None, description="DNA profile or hash", title="DNA Profile")
+ facial_recognition_id: Optional[str] = Field(None, description="Facial recognition system ID", title="Facial Recognition ID")
+ iris_scan: Optional[str] = Field(None, description="Iris scan data or hash", title="Iris Scan")
+ voice_print: Optional[str] = Field(None, description="Voice print data or hash", title="Voice Print")
+
+ # Financial Information
+ bank_accounts: Optional[List[str]] = Field(None, description="Known bank account numbers", title="Bank Accounts")
+ credit_score: Optional[int] = Field(None, description="Credit score", title="Credit Score")
+ net_worth: Optional[float] = Field(None, description="Estimated net worth", title="Net Worth")
+ assets: Optional[List[str]] = Field(None, description="Known assets (property, vehicles, etc.)", title="Assets")
+
+ # Legal Information
+ criminal_record: Optional[bool] = Field(None, description="Whether individual has a criminal record", title="Criminal Record")
+ arrest_history: Optional[List[str]] = Field(None, description="Known arrests or charges", title="Arrest History")
+ convictions: Optional[List[str]] = Field(None, description="Criminal convictions", title="Convictions")
+ civil_cases: Optional[List[str]] = Field(None, description="Civil court cases", title="Civil Cases")
+ security_clearance: Optional[str] = Field(None, description="Security clearance level", title="Security Clearance")
+
+ # Digital Footprint
+ ip_addresses: Optional[List[str]] = Field(None, description="Known IP addresses", title="IP Addresses")
+ usernames: Optional[List[str]] = Field(None, description="Known online usernames", title="Usernames")
+ device_ids: Optional[List[str]] = Field(None, description="Known device identifiers", title="Device IDs")
+
+ # Metadata
+ first_seen: Optional[str] = Field(None, description="First time individual was observed in system", title="First Seen")
+ last_seen: Optional[str] = Field(None, description="Last time individual was observed in system", title="Last Seen")
+ source: Optional[str] = Field(None, description="Source of individual information", title="Source")
+ confidence: Optional[float] = Field(None, description="Confidence score for individual data", title="Confidence")
+ notes: Optional[str] = Field(None, description="Additional notes or observations", title="Notes")
+ src: Optional[str] = Field(None, description="URL to profile picture", title="Profile Picture URL")
+ last_updated: Optional[str] = Field(None, description="Last update timestamp", title="Last Updated")
\ No newline at end of file
diff --git a/flowsint-api/app/types/ip.py b/flowsint-api/app/types/ip.py
index ac32423b..f3fe3d6f 100644
--- a/flowsint-api/app/types/ip.py
+++ b/flowsint-api/app/types/ip.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional
class Ip(BaseModel):
+ """Represents an IP address with geolocation and ISP information."""
address: str = Field(..., description="IP address", title="IP Address")
latitude: Optional[float] = Field(None, description="Latitude coordinate of the IP location", title="Latitude")
longitude: Optional[float] = Field(None, description="Longitude coordinate of the IP location", title="Longitude")
diff --git a/flowsint-api/app/types/leak.py b/flowsint-api/app/types/leak.py
index d6c40b52..0aaf97e1 100644
--- a/flowsint-api/app/types/leak.py
+++ b/flowsint-api/app/types/leak.py
@@ -2,5 +2,6 @@ from typing import List, Dict, Optional
from pydantic import BaseModel, Field
class Leak(BaseModel):
+ """Represents a data leak or breach with associated data."""
name: str = Field(..., description= "The name of the leak or service brea", title="Leak Name")
leak: Optional[List[Dict]] = Field(None, description="List of data leaks found", title="Leak Data")
diff --git a/flowsint-api/app/types/malware.py b/flowsint-api/app/types/malware.py
index 41184460..5e80d25f 100644
--- a/flowsint-api/app/types/malware.py
+++ b/flowsint-api/app/types/malware.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Malware(BaseModel):
+ """Represents malware with family, capabilities, and threat intelligence."""
name: str = Field(..., description="Malware name or identifier", title="Name")
family: Optional[str] = Field(None, description="Malware family", title="Family")
type: Optional[str] = Field(None, description="Type of malware (trojan, ransomware, etc.)", title="Type")
diff --git a/flowsint-api/app/types/message.py b/flowsint-api/app/types/message.py
index 950c2a0a..b642b030 100644
--- a/flowsint-api/app/types/message.py
+++ b/flowsint-api/app/types/message.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Message(BaseModel):
+ """Represents a message with content, metadata, and security analysis."""
message_id: str = Field(..., description="Unique message identifier", title="Message ID")
content: str = Field(..., description="Message content", title="Content")
sender: Optional[str] = Field(None, description="Message sender", title="Sender")
diff --git a/flowsint-api/app/types/organization.py b/flowsint-api/app/types/organization.py
index 19cf03cf..7b610e6f 100644
--- a/flowsint-api/app/types/organization.py
+++ b/flowsint-api/app/types/organization.py
@@ -4,6 +4,7 @@ from .individual import Individual
from .address import PhysicalAddress
class Organization(BaseModel):
+ """Represents an organization with detailed business and administrative information."""
# Basic information
name: str = Field(..., description="Organization name", title="Organization Name")
siren: Optional[str] = Field(None, description="SIREN number", title="SIREN Number")
diff --git a/flowsint-api/app/types/phone.py b/flowsint-api/app/types/phone.py
index 7086b342..0c5eb04a 100644
--- a/flowsint-api/app/types/phone.py
+++ b/flowsint-api/app/types/phone.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional
class Phone(BaseModel):
+ """Represents a phone number with country and carrier information."""
number: str = Field(..., description="Phone number", title="Phone Number")
country: Optional[str] = Field(None, description="Country code (ISO 3166-1 alpha-2)", title="Country Code")
carrier: Optional[str] = Field(None, description="Mobile carrier or service provider", title="Carrier")
\ No newline at end of file
diff --git a/flowsint-api/app/types/phrase.py b/flowsint-api/app/types/phrase.py
new file mode 100644
index 00000000..0e22f37c
--- /dev/null
+++ b/flowsint-api/app/types/phrase.py
@@ -0,0 +1,7 @@
+from pydantic import BaseModel, Field
+from typing import Optional
+
+class Phrase(BaseModel):
+ """Represents a phrase or text content."""
+ text: str = Field(..., description="The content of the phrase.", title="Phrase text value.")
+
diff --git a/flowsint-api/app/types/reputation_score.py b/flowsint-api/app/types/reputation_score.py
index 8871ee16..81cc0928 100644
--- a/flowsint-api/app/types/reputation_score.py
+++ b/flowsint-api/app/types/reputation_score.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class ReputationScore(BaseModel):
+ """Represents a reputation score for an entity with historical data and trends."""
entity_id: str = Field(..., description="Entity identifier", title="Entity ID")
entity_type: Optional[str] = Field(None, description="Type of entity (domain, IP, email, etc.)", title="Entity Type")
score: Optional[float] = Field(None, description="Reputation score (0-100)", title="Score")
diff --git a/flowsint-api/app/types/risk_profile.py b/flowsint-api/app/types/risk_profile.py
index 72526486..677a672e 100644
--- a/flowsint-api/app/types/risk_profile.py
+++ b/flowsint-api/app/types/risk_profile.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class RiskProfile(BaseModel):
+ """Represents a comprehensive risk assessment profile for an entity."""
entity_id: str = Field(..., description="Entity identifier", title="Entity ID")
entity_type: Optional[str] = Field(None, description="Type of entity", title="Entity Type")
overall_risk_score: Optional[float] = Field(None, description="Overall risk score (0-100)", title="Overall Risk Score")
diff --git a/flowsint-api/app/types/script.py b/flowsint-api/app/types/script.py
index 1fc8183b..833cfbdf 100644
--- a/flowsint-api/app/types/script.py
+++ b/flowsint-api/app/types/script.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Script(BaseModel):
+ """Represents a script or code file with analysis and security information."""
script_id: str = Field(..., description="Unique script identifier", title="Script ID")
name: Optional[str] = Field(None, description="Script name", title="Name")
language: Optional[str] = Field(None, description="Programming language", title="Language")
diff --git a/flowsint-api/app/types/session.py b/flowsint-api/app/types/session.py
index 021106f0..7d4294bd 100644
--- a/flowsint-api/app/types/session.py
+++ b/flowsint-api/app/types/session.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Session(BaseModel):
+ """Represents a user session with device and activity information."""
session_id: str = Field(..., description="Unique session identifier", title="Session ID")
user_id: Optional[str] = Field(None, description="User identifier", title="User ID")
service: Optional[str] = Field(None, description="Service or platform", title="Service")
diff --git a/flowsint-api/app/types/social.py b/flowsint-api/app/types/social.py
index 27621c75..37726c1e 100644
--- a/flowsint-api/app/types/social.py
+++ b/flowsint-api/app/types/social.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional
class SocialProfile(BaseModel):
+ """Represents a social media profile with engagement metrics."""
username: str = Field(..., description="Username on the social platform", title="Username")
profile_url: Optional[str] = Field(None, description="URL to the user's profile page", title="Profile URL")
platform: Optional[str] = Field(None, description="Name of the social media platform", title="Platform")
diff --git a/flowsint-api/app/types/ssl_certificate.py b/flowsint-api/app/types/ssl_certificate.py
index 9c15a10b..5f3ccabb 100644
--- a/flowsint-api/app/types/ssl_certificate.py
+++ b/flowsint-api/app/types/ssl_certificate.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class SSLCertificate(BaseModel):
+ """Represents an SSL/TLS certificate with validation and security details."""
subject: str = Field(..., description="Certificate subject (domain name)", title="Subject")
issuer: Optional[str] = Field(None, description="Certificate authority that issued the certificate", title="Issuer")
serial_number: Optional[str] = Field(None, description="Certificate serial number", title="Serial Number")
diff --git a/flowsint-api/app/types/transform.py b/flowsint-api/app/types/transform.py
index a0c1e033..2cad7cd8 100644
--- a/flowsint-api/app/types/transform.py
+++ b/flowsint-api/app/types/transform.py
@@ -2,12 +2,14 @@ from pydantic import BaseModel, Field
from typing import Dict, List, Any, Optional, Literal
class Node(BaseModel):
+ """Represents a node in a transformation flow with position and data."""
id: str = Field(..., description="Unique identifier for the node", title="Node ID")
data: Dict[str, Any] = Field(..., description="Data payload associated with the node", title="Node Data")
position: Optional[Dict[str, float]] = Field(None, description="X and Y coordinates for node positioning", title="Position")
type: Optional[str] = Field(None, description="Type of node (e.g., input, output, process)", title="Node Type")
class Edge(BaseModel):
+ """Represents an edge connecting two nodes in a transformation flow."""
id: str = Field(..., description="Unique identifier for the edge", title="Edge ID")
data: Optional[Dict[str, Any]] = Field(None, description="Data payload associated with the edge", title="Edge Data")
source: str = Field(..., description="ID of the source node", title="Source Node")
@@ -16,6 +18,7 @@ class Edge(BaseModel):
targetHandle: Optional[str] = Field(None, description="Handle ID on the target node", title="Target Handle")
class FlowStep(BaseModel):
+ """Represents a single step in a transformation flow with execution status."""
nodeId: str = Field(..., description="ID of the associated node", title="Node ID")
params: Optional[Dict[str, Any]] = Field(None, description="Parameters for the step", title="Parameters")
type: Literal["type", "scanner"] = Field(..., description="Type of step - either type transformation or scanner", title="Step Type")
@@ -26,6 +29,7 @@ class FlowStep(BaseModel):
depth: int = Field(..., description="Depth level of this step in the flow", title="Depth")
class FlowBranch(BaseModel):
+ """Represents a branch containing a sequence of transformation steps."""
id: str = Field(..., description="Unique identifier for the branch", title="Branch ID")
name: str = Field(..., description="Human-readable name of the branch", title="Branch Name")
steps: List[FlowStep] = Field(..., description="List of steps in this branch", title="Steps")
\ No newline at end of file
diff --git a/flowsint-api/app/types/username.py b/flowsint-api/app/types/username.py
index 03037b99..7c73bf39 100644
--- a/flowsint-api/app/types/username.py
+++ b/flowsint-api/app/types/username.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class Username(BaseModel):
+ """Represents a username or handle on a platform with associated profile information."""
username: str = Field(..., description="Username or handle", title="Username")
platform: Optional[str] = Field(None, description="Platform or service where username is used", title="Platform")
display_name: Optional[str] = Field(None, description="Display name associated with username", title="Display Name")
diff --git a/flowsint-api/app/types/weapon.py b/flowsint-api/app/types/weapon.py
index 27adffe2..417ce6b3 100644
--- a/flowsint-api/app/types/weapon.py
+++ b/flowsint-api/app/types/weapon.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Literal, Optional, List
class Weapon(BaseModel):
+ """Represents a weapon with detailed specifications and forensic information."""
name: str = Field(..., description="Weapon name or identifier", title="Name")
type: Optional[Literal["firearm", "melee", "explosive", "bladed", "blunt", "chemical", "biological", "radiological", "nuclear", "other"]] = Field(None, description="Weapon category (handgun, rifle, shotgun, knife, etc.)", title="Category")
description: Optional[str] = Field(None, description="Weapon description", title="Description")
diff --git a/flowsint-api/app/types/web_tracker.py b/flowsint-api/app/types/web_tracker.py
index 25fe2e65..09f9386b 100644
--- a/flowsint-api/app/types/web_tracker.py
+++ b/flowsint-api/app/types/web_tracker.py
@@ -2,6 +2,7 @@ from pydantic import BaseModel, Field
from typing import Optional, List
class WebTracker(BaseModel):
+ """Represents a web tracking technology with privacy and compliance information."""
tracker_id: str = Field(..., description="Unique tracker identifier", title="Tracker ID")
name: Optional[str] = Field(None, description="Tracker name", title="Name")
type: Optional[str] = Field(None, description="Type of tracker (analytics, advertising, etc.)", title="Type")
diff --git a/flowsint-api/app/types/website.py b/flowsint-api/app/types/website.py
index 5669975f..ad13f7a0 100644
--- a/flowsint-api/app/types/website.py
+++ b/flowsint-api/app/types/website.py
@@ -3,6 +3,7 @@ from pydantic import BaseModel, Field, HttpUrl
from app.types.domain import Domain
class Website(BaseModel):
+ """Represents a website with its URL, domain, and redirect information."""
url: HttpUrl = Field(..., description="Full URL of the website", title="Website URL")
redirects: Optional[List[HttpUrl]] = Field([], description="List of redirects from the website", title="Redirects")
domain: Optional[Domain] = Field(None, description="Domain information for the website", title="Domain")
diff --git a/flowsint-api/app/types/whois.py b/flowsint-api/app/types/whois.py
index 142e47f0..92c03619 100644
--- a/flowsint-api/app/types/whois.py
+++ b/flowsint-api/app/types/whois.py
@@ -3,6 +3,7 @@ from pydantic import BaseModel, Field
from app.types.email import Email
class Whois(BaseModel):
+ """Represents WHOIS domain registration information."""
registrar: Optional[str] = Field(None, description="Domain registrar name", title="Registrar")
org: Optional[str] = Field(None, description="Organization name associated with the domain", title="Organization")
city: Optional[str] = Field(None, description="City where the domain is registered", title="City")
diff --git a/flowsint-api/tests/fixtures/database.py b/flowsint-api/tests/fixtures/database.py
new file mode 100644
index 00000000..c9dee25b
--- /dev/null
+++ b/flowsint-api/tests/fixtures/database.py
@@ -0,0 +1,136 @@
+import pytest
+import uuid
+from unittest.mock import Mock
+from sqlalchemy import create_engine
+from sqlalchemy.orm import sessionmaker
+from app.models.base import Base
+from app.models.models import Profile, Key
+from app.core.vault import Vault
+import tempfile
+import os
+
+
[email protected](scope="function")
+def test_db_session():
+ """Create an in-memory SQLite database for testing"""
+ # Create in-memory SQLite database
+ engine = create_engine("sqlite:///:memory:", echo=False)
+
+ # Only create specific tables we need for testing (to avoid ARRAY type issues)
+ Profile.__table__.create(engine)
+ Key.__table__.create(engine)
+
+ # Create session
+ TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
+ session = TestingSessionLocal()
+
+ yield session
+
+ # Clean up
+ session.close()
+ engine.dispose()
+
+
[email protected](scope="function")
+def test_owner_id():
+ """Generate a test owner ID"""
+ return uuid.uuid4()
+
+
[email protected](scope="function")
+def test_profile(test_db_session, test_owner_id):
+ """Create a test profile in the database"""
+ profile = Profile(
+ id=test_owner_id,
+ email=f"test_{uuid.uuid4().hex[:8]}@example.com",
+ hashed_password="hashed_test_password",
+ is_active=True,
+ first_name="Test",
+ last_name="User"
+ )
+
+ test_db_session.add(profile)
+ test_db_session.commit()
+ test_db_session.refresh(profile)
+
+ return profile
+
+
[email protected](scope="function")
+def test_api_key(test_db_session, test_owner_id):
+ """Create a test API key in the database"""
+ key = Key(
+ id=uuid.uuid4(),
+ name="test_etherscan_key",
+ owner_id=test_owner_id,
+ encrypted_key="test_api_key_12345"
+ )
+
+ test_db_session.add(key)
+ test_db_session.commit()
+ test_db_session.refresh(key)
+
+ return key
+
+
[email protected](scope="function")
+def test_vault(test_db_session, test_owner_id, test_profile, test_api_key):
+ """Create a test vault instance with test data"""
+ return Vault(db=test_db_session, owner_id=test_owner_id)
+
+
[email protected](scope="function")
+def mock_logger():
+ """Create a mock logger for testing"""
+ logger = Mock()
+ logger.info = Mock()
+ logger.error = Mock()
+ logger.warn = Mock()
+ logger.debug = Mock()
+ logger.success = Mock()
+ return logger
+
+
[email protected](scope="function")
+def test_sketch_scan_ids():
+ """Generate test sketch and scan IDs"""
+ return {
+ "sketch_id": str(uuid.uuid4()),
+ "scan_id": str(uuid.uuid4())
+ }
+
+
[email protected](scope="function")
+def multiple_test_keys(test_db_session, test_owner_id):
+ """Create multiple test API keys for comprehensive testing"""
+ keys = []
+
+ # Create keys with different names
+ key_configs = [
+ {"name": "etherscan_api_key", "value": "test_etherscan_key_123"},
+ {"name": "another_service_key", "value": "test_another_key_456"},
+ {"name": "vaultKey1", "value": "test_vault_key_789"}
+ ]
+
+ for config in key_configs:
+ key = Key(
+ id=uuid.uuid4(),
+ name=config["name"],
+ owner_id=test_owner_id,
+ encrypted_key=config["value"]
+ )
+ test_db_session.add(key)
+ keys.append(key)
+
+ test_db_session.commit()
+
+ for key in keys:
+ test_db_session.refresh(key)
+
+ return keys
+
+
[email protected](scope="function")
+def test_vault_with_multiple_keys(test_db_session, test_owner_id, test_profile, multiple_test_keys):
+ """Create a test vault with multiple keys for comprehensive testing"""
+ return Vault(db=test_db_session, owner_id=test_owner_id)
\ No newline at end of file
diff --git a/flowsint-api/tests/scanners/test_crypto_with_vault.py b/flowsint-api/tests/scanners/test_crypto_with_vault.py
new file mode 100644
index 00000000..16255cbc
--- /dev/null
+++ b/flowsint-api/tests/scanners/test_crypto_with_vault.py
@@ -0,0 +1,303 @@
+import pytest
+import uuid
+from unittest.mock import Mock, patch, AsyncMock
+from app.scanners.crypto.wallet_to_transactions import CryptoWalletAddressToTransactions
+from app.scanners.crypto.wallet_to_nfts import CryptoWalletAddressToNFTs
+from app.core.vault import Vault
+from tests.fixtures.database import (
+ test_db_session, test_owner_id, test_profile, test_api_key,
+ test_vault, test_vault_with_multiple_keys, multiple_test_keys,
+ test_sketch_scan_ids
+)
+
+
+class TestVaultIntegration:
+ """Test suite for Vault integration"""
+
+ def test_vault_creation(self, test_vault, test_owner_id):
+ """Test vault creation with valid owner ID"""
+ assert test_vault.owner_id == test_owner_id
+ assert test_vault.db is not None
+
+ def test_vault_creation_without_owner_id(self, test_db_session):
+ """Test vault creation fails without owner ID"""
+ with pytest.raises(ValueError, match="owner_id is required to use the vault"):
+ Vault(db=test_db_session, owner_id=None)
+
+ def test_vault_get_secret_by_name(self, test_vault_with_multiple_keys):
+ """Test retrieving secret by key name"""
+ secret = test_vault_with_multiple_keys.get_secret("vaultKey1")
+ assert secret == "test_vault_key_789"
+
+ def test_vault_get_secret_by_uuid(self, test_vault_with_multiple_keys, multiple_test_keys):
+ """Test retrieving secret by key UUID"""
+ # Get the UUID of the first key
+ key_uuid = str(multiple_test_keys[0].id)
+ secret = test_vault_with_multiple_keys.get_secret(key_uuid)
+ assert secret == "test_etherscan_key_123"
+
+ def test_vault_get_secret_nonexistent(self, test_vault):
+ """Test retrieving non-existent secret returns None"""
+ secret = test_vault.get_secret("nonexistent_key")
+ assert secret is None
+
+ def test_vault_get_secret_wrong_owner(self, test_db_session, test_api_key):
+ """Test retrieving secret with wrong owner ID returns None"""
+ wrong_owner_id = uuid.uuid4()
+ vault = Vault(db=test_db_session, owner_id=wrong_owner_id)
+ secret = vault.get_secret("test_etherscan_key")
+ assert secret is None
+
+
+class TestCryptoWalletAddressToTransactions:
+ """Test suite for CryptoWalletAddressToTransactions scanner with vault integration"""
+
+ def test_scanner_creation_with_vault(self, test_vault, test_sketch_scan_ids):
+ """Test scanner creation with vault"""
+ scanner = CryptoWalletAddressToTransactions(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault,
+ params={
+ "ETHERSCAN_API_KEY": "test_etherscan_key",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ assert scanner.sketch_id == test_sketch_scan_ids["sketch_id"]
+ assert scanner.scan_id == test_sketch_scan_ids["scan_id"]
+ assert scanner.vault == test_vault
+
+ def test_scanner_creation_without_vault(self, test_sketch_scan_ids):
+ """Test scanner creation without vault"""
+ scanner = CryptoWalletAddressToTransactions(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ params={
+ "ETHERSCAN_API_KEY": "direct_api_key",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ assert scanner.vault is None
+
+ @pytest.mark.asyncio
+ async def test_async_init_with_vault_key_exists(self, test_vault_with_multiple_keys, test_sketch_scan_ids):
+ """Test async_init when vault key exists"""
+ scanner = CryptoWalletAddressToTransactions(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault_with_multiple_keys,
+ params={
+ "ETHERSCAN_API_KEY": "vaultKey1", # This key exists in vault
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ # Get params before async_init
+ params_before = scanner.get_params()
+ assert params_before["ETHERSCAN_API_KEY"] == "vaultKey1"
+
+ # Initialize scanner
+ await scanner.async_init()
+
+ # Get params after async_init - should be resolved from vault
+ params_after = scanner.get_params()
+ assert params_after["ETHERSCAN_API_KEY"] == "test_vault_key_789"
+
+ @pytest.mark.asyncio
+ async def test_async_init_with_vault_key_not_exists(self, test_vault, test_sketch_scan_ids):
+ """Test async_init when vault key doesn't exist"""
+ scanner = CryptoWalletAddressToTransactions(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault,
+ params={
+ "ETHERSCAN_API_KEY": "nonexistent_key", # This key doesn't exist
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ # Get params before async_init
+ params_before = scanner.get_params()
+ assert params_before["ETHERSCAN_API_KEY"] == "nonexistent_key"
+
+ # Initialize scanner
+ await scanner.async_init()
+
+ # Get params after async_init - should remain unchanged since key not found
+ params_after = scanner.get_params()
+ assert params_after["ETHERSCAN_API_KEY"] == "nonexistent_key"
+
+ @pytest.mark.asyncio
+ async def test_async_init_without_vault(self, test_sketch_scan_ids):
+ """Test async_init without vault"""
+ scanner = CryptoWalletAddressToTransactions(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ params={
+ "ETHERSCAN_API_KEY": "direct_api_key",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ # Get params before async_init
+ params_before = scanner.get_params()
+ assert params_before["ETHERSCAN_API_KEY"] == "direct_api_key"
+
+ # Initialize scanner
+ await scanner.async_init()
+
+ # Get params after async_init - should remain unchanged
+ params_after = scanner.get_params()
+ assert params_after["ETHERSCAN_API_KEY"] == "direct_api_key"
+
+ def test_scanner_properties(self, test_vault, test_sketch_scan_ids):
+ """Test scanner static properties"""
+ assert CryptoWalletAddressToTransactions.name() == "wallet_to_transactions"
+ assert CryptoWalletAddressToTransactions.category() == "CryptoWallet"
+ assert isinstance(CryptoWalletAddressToTransactions.requires_key(), bool)
+
+
+class TestCryptoWalletAddressToNFTs:
+ """Test suite for CryptoWalletAddressToNFTs scanner with vault integration"""
+
+ def test_scanner_creation_with_vault(self, test_vault, test_sketch_scan_ids):
+ """Test scanner creation with vault"""
+ scanner = CryptoWalletAddressToNFTs(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault,
+ params={
+ "ETHERSCAN_API_KEY": "test_etherscan_key",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ assert scanner.sketch_id == test_sketch_scan_ids["sketch_id"]
+ assert scanner.scan_id == test_sketch_scan_ids["scan_id"]
+ assert scanner.vault == test_vault
+
+ @pytest.mark.asyncio
+ async def test_async_init_with_vault_multiple_keys(self, test_vault_with_multiple_keys, test_sketch_scan_ids):
+ """Test async_init with multiple vault keys"""
+ scanner = CryptoWalletAddressToNFTs(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault_with_multiple_keys,
+ params={
+ "ETHERSCAN_API_KEY": "etherscan_api_key", # This key exists in vault
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ # Initialize scanner
+ await scanner.async_init()
+
+ # Get params after async_init - should be resolved from vault
+ params_after = scanner.get_params()
+ assert params_after["ETHERSCAN_API_KEY"] == "test_etherscan_key_123"
+
+ def test_scanner_properties(self):
+ """Test scanner static properties"""
+ assert CryptoWalletAddressToNFTs.name() == "wallet_to_nfts"
+ assert CryptoWalletAddressToNFTs.category() == "CryptoWallet"
+ assert isinstance(CryptoWalletAddressToNFTs.requires_key(), bool)
+
+
+class TestBothCryptoScannersIntegration:
+ """Test suite for testing both crypto scanners together"""
+
+ @pytest.mark.asyncio
+ async def test_multiple_scanners_same_vault(self, test_vault_with_multiple_keys, test_sketch_scan_ids):
+ """Test multiple scanners using the same vault"""
+ scanner1 = CryptoWalletAddressToTransactions(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault_with_multiple_keys,
+ params={
+ "ETHERSCAN_API_KEY": "vaultKey1",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ scanner2 = CryptoWalletAddressToNFTs(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault_with_multiple_keys,
+ params={
+ "ETHERSCAN_API_KEY": "vaultKey1",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ # Initialize both scanners
+ await scanner1.async_init()
+ await scanner2.async_init()
+
+ # Both should have resolved the same key
+ params1 = scanner1.get_params()
+ params2 = scanner2.get_params()
+
+ assert params1["ETHERSCAN_API_KEY"] == "test_vault_key_789"
+ assert params2["ETHERSCAN_API_KEY"] == "test_vault_key_789"
+
+ @pytest.mark.asyncio
+ async def test_multiple_scanners_different_keys(self, test_vault_with_multiple_keys, test_sketch_scan_ids):
+ """Test multiple scanners using different vault keys"""
+ scanner1 = CryptoWalletAddressToTransactions(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault_with_multiple_keys,
+ params={
+ "ETHERSCAN_API_KEY": "vaultKey1",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ scanner2 = CryptoWalletAddressToNFTs(
+ sketch_id=test_sketch_scan_ids["sketch_id"],
+ scan_id=test_sketch_scan_ids["scan_id"],
+ vault=test_vault_with_multiple_keys,
+ params={
+ "ETHERSCAN_API_KEY": "etherscan_api_key",
+ "ETHERSCAN_API_URL": "https://api.etherscan.io/api"
+ }
+ )
+
+ # Initialize both scanners
+ await scanner1.async_init()
+ await scanner2.async_init()
+
+ # Should have resolved different keys
+ params1 = scanner1.get_params()
+ params2 = scanner2.get_params()
+
+ assert params1["ETHERSCAN_API_KEY"] == "test_vault_key_789"
+ assert params2["ETHERSCAN_API_KEY"] == "test_etherscan_key_123"
+
+ def test_scanner_schemas_consistency(self):
+ """Test that both crypto scanners have consistent schemas"""
+ transactions_schema = CryptoWalletAddressToTransactions.input_schema()
+ nfts_schema = CryptoWalletAddressToNFTs.input_schema()
+
+ # Both should accept the same input type (crypto wallet)
+ assert transactions_schema["type"] == nfts_schema["type"]
+
+ # Both should have param schemas with ETHERSCAN_API_KEY
+ transactions_params = CryptoWalletAddressToTransactions.get_params_schema()
+ nfts_params = CryptoWalletAddressToNFTs.get_params_schema()
+
+ # Check that both have ETHERSCAN_API_KEY parameter
+ transactions_api_key = next(
+ (param for param in transactions_params if param["name"] == "ETHERSCAN_API_KEY"),
+ None
+ )
+ nfts_api_key = next(
+ (param for param in nfts_params if param["name"] == "ETHERSCAN_API_KEY"),
+ None
+ )
+
+ assert transactions_api_key is not None
+ assert nfts_api_key is not None
+ assert transactions_api_key["required"] == nfts_api_key["required"]
\ No newline at end of file
diff --git a/flowsint-api/tests/scanners/test_registry.py b/flowsint-api/tests/scanners/test_registry.py
new file mode 100644
index 00000000..c0d32c30
--- /dev/null
+++ b/flowsint-api/tests/scanners/test_registry.py
@@ -0,0 +1,163 @@
+import pytest
+from app.scanners.registry import ScannerRegistry
+from app.scanners.base import Scanner
+from unittest.mock import Mock
+
+
+class TestScannerRegistry:
+ """Test suite for ScannerRegistry functionality"""
+
+ def test_registry_is_populated(self):
+ """Test that the registry is populated with scanners"""
+ scanners = ScannerRegistry.list()
+ assert len(scanners) > 0
+ assert isinstance(scanners, dict)
+
+ def test_list_returns_proper_structure(self):
+ """Test that list() returns the expected structure"""
+ scanners = ScannerRegistry.list()
+
+ # Check that each scanner has the expected keys
+ for name, scanner_info in scanners.items():
+ assert "class_name" in scanner_info
+ assert "name" in scanner_info
+ assert "module" in scanner_info
+ assert "doc" in scanner_info
+ assert "category" in scanner_info
+ assert "inputs" in scanner_info
+ assert "outputs" in scanner_info
+ assert "params" in scanner_info
+ assert "params_schema" in scanner_info
+ assert "requires_key" in scanner_info
+
+ # Check that name matches the key
+ assert scanner_info["name"] == name
+
+ def test_list_by_categories_structure(self):
+ """Test that list_by_categories() returns the expected structure"""
+ scanners_by_category = ScannerRegistry.list_by_categories()
+
+ assert isinstance(scanners_by_category, dict)
+
+ # Check that each category contains a list of scanners
+ for category, scanners in scanners_by_category.items():
+ assert isinstance(scanners, list)
+ assert len(scanners) > 0
+
+ for scanner_info in scanners:
+ assert "class_name" in scanner_info
+ assert "name" in scanner_info
+ assert "category" in scanner_info
+ assert scanner_info["category"] == category
+
+ def test_list_by_input_type_filtering(self):
+ """Test that list_by_input_type() properly filters scanners"""
+ # Test with a known input type
+ domain_scanners = ScannerRegistry.list_by_input_type("Domain")
+
+ for name, scanner_info in domain_scanners.items():
+ input_type = scanner_info["inputs"]["type"]
+ assert input_type in ["Any", "Domain"]
+
+ def test_scanner_exists_method(self):
+ """Test the scanner_exists method"""
+ # Get a real scanner name from the registry
+ scanners = ScannerRegistry.list()
+ if scanners:
+ real_scanner_name = list(scanners.keys())[0]
+ assert ScannerRegistry.scanner_exists(real_scanner_name) is True
+
+ # Test with non-existent scanner
+ assert ScannerRegistry.scanner_exists("non_existent_scanner") is False
+
+ def test_get_scanner_valid(self):
+ """Test getting a valid scanner instance"""
+ scanners = ScannerRegistry.list()
+ if scanners:
+ scanner_name = list(scanners.keys())[0]
+ scanner_instance = ScannerRegistry.get_scanner(
+ scanner_name,
+ sketch_id="test_sketch",
+ scan_id="test_scan"
+ )
+ assert isinstance(scanner_instance, Scanner)
+ assert scanner_instance.sketch_id == "test_sketch"
+ assert scanner_instance.scan_id == "test_scan"
+
+ def test_get_scanner_invalid(self):
+ """Test getting an invalid scanner raises exception"""
+ with pytest.raises(Exception, match="Scanner 'invalid_scanner' not found"):
+ ScannerRegistry.get_scanner(
+ "invalid_scanner",
+ sketch_id="test_sketch",
+ scan_id="test_scan"
+ )
+
+ def test_specific_scanners_are_registered(self):
+ """Test that specific expected scanners are registered"""
+ scanners = ScannerRegistry.list()
+
+ # Check for some key scanners that should be registered
+ expected_scanners = [
+ "domain_resolve_scanner",
+ "domain_subdomains_scanner",
+ "to_whois",
+ "ip_geolocation_scanner",
+ "holehe_scanner",
+ "maigret_scanner"
+ ]
+
+ for expected_scanner in expected_scanners:
+ assert expected_scanner in scanners, f"Scanner '{expected_scanner}' not found in registry"
+
+ def test_crypto_scanners_are_registered(self):
+ """Test that crypto scanners are registered"""
+ scanners = ScannerRegistry.list()
+
+ crypto_scanners = [
+ "wallet_to_transactions",
+ "wallet_to_nfts"
+ ]
+
+ for crypto_scanner in crypto_scanners:
+ assert crypto_scanner in scanners, f"Crypto scanner '{crypto_scanner}' not found in registry"
+
+ def test_scanner_categories_are_valid(self):
+ """Test that all scanners have valid categories"""
+ scanners = ScannerRegistry.list()
+
+ valid_categories = {
+ "Domain", "IP", "Email", "Social", "Organization",
+ "Website", "Crypto", "Individual", "ASN", "CIDR"
+ }
+
+ for name, scanner_info in scanners.items():
+ category = scanner_info["category"]
+ assert isinstance(category, str), f"Scanner '{name}' has invalid category type: {type(category)}"
+ # Note: We don't enforce that category must be in valid_categories
+ # since new categories might be added
+
+ def test_scanner_input_output_schemas_exist(self):
+ """Test that all scanners have input and output schemas"""
+ scanners = ScannerRegistry.list()
+
+ for name, scanner_info in scanners.items():
+ # Check input schema
+ input_schema = scanner_info["inputs"]
+ assert isinstance(input_schema, dict)
+ assert "type" in input_schema
+ assert "properties" in input_schema
+
+ # Check output schema
+ output_schema = scanner_info["outputs"]
+ assert isinstance(output_schema, dict)
+ assert "type" in output_schema
+ assert "properties" in output_schema
+
+ def test_scanner_requires_key_is_boolean(self):
+ """Test that requires_key returns a boolean for all scanners"""
+ scanners = ScannerRegistry.list()
+
+ for name, scanner_info in scanners.items():
+ requires_key = scanner_info["requires_key"]
+ assert isinstance(requires_key, bool), f"Scanner '{name}' requires_key is not boolean: {type(requires_key)}"
\ No newline at end of file
diff --git a/flowsint-api/tests/test.py b/flowsint-api/tests/test.py
deleted file mode 100644
index 5c3db4c8..00000000
--- a/flowsint-api/tests/test.py
+++ /dev/null
@@ -1,101 +0,0 @@
-import sys
-import os
-import asyncio
-import uuid
-import random
-
-# Add the parent directory to Python path so we can import from app
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
-
-from app.scanners.crypto.wallet_to_transactions import CryptoWalletAddressToTransactions
-from app.scanners.crypto.wallet_to_nfts import CryptoWalletAddressToNFTs
-from app.core.vault import Vault
-from app.core.postgre_db import SessionLocal
-from app.models.models import Key, Profile
-
-def setup_test_data(db_session, owner_id: uuid.UUID):
- """Set up test data including user and API keys"""
-
- # Generate a unique email for testing
- unique_email = f"test_{random.randint(1000, 9999)}@example.com"
-
- # First, create a test user/profile
- test_user = Profile(
- id=owner_id,
- email=unique_email,
- hashed_password="test_hashed_password",
- is_active=True
- )
-
- db_session.add(test_user)
- db_session.commit() # Commit the user first
-
- # Now create a test API key for ETHERSCAN_API_KEY
- test_key = Key(
- id=uuid.uuid4(),
- name="vaultKey1", # This matches the vaultRef in scanner params
- owner_id=owner_id,
- encrypted_key="test_etherscan_api_key_12345" # Mock API key
- )
-
- db_session.add(test_key)
- db_session.commit()
-
- print(f"Created test user with email: {test_user.email}")
- print(f"Created test API key with name: {test_key.name}")
- return test_key
-
-async def main():
- # Create database session using the existing get_db pattern
- db_session = SessionLocal()
-
- try:
- # Create a test owner ID (in real app this would be from authentication)
- owner_id = uuid.uuid4()
-
- # Set up test data
- test_key = setup_test_data(db_session, owner_id)
-
- # Create vault instance
- vault = Vault(db=db_session, owner_id=owner_id)
-
- # Create scanners with vault
- scanner = CryptoWalletAddressToTransactions(
- sketch_id="sketch_123",
- scan_id="scan_123",
- vault=vault, # Pass the vault
- params={"ETHERSCAN_API_KEY": "vaultKey1doesntexist",
- "ETHERSCAN_API_URL": "https://api.etherscan.io/api"}
- )
-
- scanner2 = CryptoWalletAddressToNFTs(
- sketch_id="sketch_123",
- scan_id="scan_123",
- vault=vault, # Pass the vault
- params={"ETHERSCAN_API_KEY": "vaultKey1doesntexist",
- "ETHERSCAN_API_URL": "https://api.etherscan.io/api"}
- )
-
- print("Scanner 1 params (before async_init):", scanner.get_params())
- print("Scanner 2 params (before async_init):", scanner2.get_params())
-
- # Initialize scanners asynchronously
- await scanner.async_init()
- await scanner2.async_init()
-
- print("Scanner 1 params (after async_init):", scanner.get_params())
- print("Scanner 2 params (after async_init):", scanner2.get_params())
-
- # Test vault directly
- secret = vault.get_secret("vaultKey1")
- print(f"Retrieved secret from vault: {secret}")
-
- # Test vault with non-existent key
- secret_none = vault.get_secret("nonexistent")
- print(f"Retrieved secret for non-existent key: {secret_none}")
-
- finally:
- db_session.close()
-
-if __name__ == "__main__":
- asyncio.run(main())
diff --git a/flowsint-app/src/renderer/public/icons/4375165_card_credit_logo_visa_icon.svg b/flowsint-app/src/renderer/public/icons/4375165_card_credit_logo_visa_icon.svg
deleted file mode 100644
index c05e42f7..00000000
--- a/flowsint-app/src/renderer/public/icons/4375165_card_credit_logo_visa_icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0"?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="512px" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="_x33_63-visa_x2C__Credit_card"><g><path d="M485.999,115.445v281.108c0,21.165-17.17,38.335-38.333,38.335H64.334 c-21.163,0-38.333-17.17-38.333-38.335V115.445c0-21.164,17.17-38.334,38.333-38.334h383.332 C468.829,77.111,485.999,94.282,485.999,115.445z" style="fill:#0353A5;"/><g><path d="M421.791,192.111h-24.837c-7.666,0-13.498,2.237-16.771,10.302l-47.678,113.8h33.702 c0,0,5.511-15.332,6.708-18.606h41.209c0.956,4.392,3.832,18.606,3.832,18.606h29.709L421.791,192.111z M382.179,272.211 c2.637-7.106,12.778-34.738,12.778-34.738c-0.16,0.239,2.636-7.268,4.233-11.9l2.235,10.702c0,0,6.07,29.708,7.428,35.937 H382.179z" style="fill:#FFFFFF;"/><path d="M164.32,192.111l-31.385,84.653l-3.435-17.171l-11.181-57.021 c-1.837-7.906-7.507-10.142-14.535-10.461H52.116l-0.56,2.476c12.618,3.195,23.879,7.827,33.701,13.656l28.591,107.813h33.94 l50.471-123.944H164.32z" style="fill:#FFFFFF;"/><polygon points="211.197,192.111 191.152,316.214 223.178,316.214 243.302,192.111 " style="fill:#FFFFFF;"/><path d="M307.989,241.865c-11.26-5.67-18.128-9.504-18.128-15.333c0.159-5.271,5.829-10.702,18.448-10.702 c10.461-0.24,18.128,2.237,23.877,4.711l2.876,1.358l4.392-26.833c-6.31-2.477-16.371-5.272-28.75-5.272 c-31.704,0-53.985,16.932-54.145,41.049c-0.24,17.809,15.971,27.713,28.11,33.701c12.379,6.068,16.611,10.063,16.611,15.413 c-0.159,8.307-10.063,12.14-19.247,12.14c-12.777,0-19.646-1.998-30.105-6.627l-4.234-1.999l-4.472,27.871 c7.505,3.435,21.402,6.47,35.777,6.631c33.701,0.078,55.663-16.614,55.902-42.328 C335.063,261.511,326.438,250.729,307.989,241.865z" style="fill:#FFFFFF;"/></g></g></g><g id="Layer_1"/></svg>
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/public/icons/cidr.svg b/flowsint-app/src/renderer/public/icons/cidr.svg
index 93e48861..31e40f14 100644
--- a/flowsint-app/src/renderer/public/icons/cidr.svg
+++ b/flowsint-app/src/renderer/public/icons/cidr.svg
@@ -1,255 +1 @@
-<?xml version="1.0" ?><svg id="Layer_1" style="enable-background:new 0 0 50 50;" version="1.1" viewBox="0 0 50 50" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style type="text/css">
- .st0{fill:none;}
- .st1{fill:#A2D4BF;}
- .st2{fill:#A2D4BF;}
- .st3{fill:#A2D4BF;}
- .st4{fill:#A2D4BF;}
- .st5{fill:#A2D4BF;}
- .st6{fill:#FFFFFF;}
- .st7{fill:#A2D4BF;}
- .st8{fill:#A2D4BF;}
- .st9{fill:#A2D4BF;}
- .st10{enable-background:new ;}
- .st11{fill:url(#SVGID_1_);}
- .st12{fill:url(#SVGID_2_);}
- .st13{fill:url(#);}
- .st14{fill:url(#SVGID_3_);}
- .st15{fill:url(#SVGID_4_);}
- .st16{fill:url(#SVGID_5_);}
- .st17{fill:url(#SVGID_6_);}
- .st18{fill:url(#SVGID_7_);}
- .st19{fill:#A2D4BF;}
- .st20{fill:#A2D4BF;}
- .st21{fill:#A2D4BF;}
- .st22{fill:url(#SVGID_8_);}
- .st23{fill:url(#SVGID_9_);}
- .st24{fill:url(#SVGID_10_);}
- .st25{fill:url(#SVGID_11_);}
- .st26{fill:url(#SVGID_12_);}
- .st27{fill:url(#SVGID_13_);}
- .st28{fill:url(#SVGID_14_);}
- .st29{fill:url(#SVGID_15_);}
- .st30{fill:url(#SVGID_16_);}
- .st31{fill:url(#SVGID_17_);}
- .st32{fill:url(#SVGID_18_);}
- .st33{fill:url(#SVGID_19_);}
- .st34{fill:url(#SVGID_20_);}
- .st35{fill:url(#SVGID_21_);}
- .st36{fill:url(#SVGID_22_);}
- .st37{fill:url(#SVGID_23_);}
- .st38{fill:url(#SVGID_24_);}
- .st39{fill:url(#SVGID_25_);}
- .st40{fill:url(#SVGID_26_);}
- .st41{fill:url(#SVGID_27_);}
- .st42{fill:url(#SVGID_28_);}
- .st43{fill:url(#SVGID_29_);}
- .st44{fill:url(#SVGID_30_);}
- .st45{fill:url(#SVGID_31_);}
- .st46{fill:url(#SVGID_32_);}
- .st47{fill:url(#SVGID_33_);}
- .st48{fill:url(#SVGID_34_);}
- .st49{fill:url(#SVGID_35_);}
- .st50{fill:url(#SVGID_36_);}
- .st51{fill:url(#SVGID_37_);}
- .st52{fill:url(#SVGID_38_);}
- .st53{fill:url(#SVGID_39_);}
- .st54{fill:url(#SVGID_40_);}
- .st55{fill:url(#SVGID_41_);}
- .st56{fill:url(#SVGID_42_);}
- .st57{fill:url(#SVGID_43_);}
- .st58{fill:url(#SVGID_44_);}
- .st59{fill:url(#SVGID_45_);}
- .st60{fill:url(#SVGID_46_);}
- .st61{fill:url(#SVGID_47_);}
- .st62{fill:url(#SVGID_48_);}
- .st63{fill:url(#SVGID_49_);}
- .st64{fill:url(#SVGID_50_);}
- .st65{fill:url(#SVGID_51_);}
- .st66{fill:url(#SVGID_52_);}
- .st67{fill:url(#SVGID_53_);}
- .st68{fill:url(#SVGID_54_);}
- .st69{fill:url(#SVGID_55_);}
- .st70{fill:url(#SVGID_56_);}
- .st71{fill:url(#SVGID_57_);}
- .st72{fill:url(#SVGID_58_);}
- .st73{fill:url(#SVGID_59_);}
- .st74{fill:url(#SVGID_60_);}
- .st75{fill:url(#SVGID_61_);}
- .st76{fill:url(#SVGID_62_);}
- .st77{fill:url(#SVGID_63_);}
- .st78{fill:url(#SVGID_64_);}
- .st79{fill:url(#SVGID_65_);}
- .st80{fill:url(#SVGID_66_);}
- .st81{fill:url(#SVGID_67_);}
- .st82{fill:url(#SVGID_68_);}
- .st83{fill:url(#SVGID_69_);}
- .st84{fill:url(#SVGID_70_);}
- .st85{fill:url(#SVGID_71_);}
- .st86{fill:url(#SVGID_72_);}
- .st87{fill:url(#SVGID_73_);}
- .st88{fill:url(#SVGID_74_);}
- .st89{fill:url(#SVGID_75_);}
- .st90{fill:url(#SVGID_76_);}
- .st91{fill:url(#SVGID_77_);}
- .st92{fill:url(#SVGID_78_);}
- .st93{fill:url(#SVGID_79_);}
- .st94{fill:url(#SVGID_80_);}
- .st95{fill:url(#SVGID_81_);}
- .st96{fill:url(#SVGID_82_);}
- .st97{fill:url(#SVGID_83_);}
- .st98{fill:url(#SVGID_84_);}
- .st99{fill:url(#SVGID_85_);}
- .st100{fill:url(#SVGID_86_);}
- .st101{fill:url(#SVGID_87_);}
- .st102{fill:url(#SVGID_88_);}
- .st103{fill:url(#SVGID_89_);}
- .st104{fill:url(#SVGID_90_);}
- .st105{fill:url(#SVGID_91_);}
- .st106{fill:url(#SVGID_92_);}
- .st107{fill:url(#SVGID_93_);}
- .st108{fill:url(#SVGID_94_);}
- .st109{fill:url(#SVGID_95_);}
- .st110{fill:url(#SVGID_96_);}
- .st111{fill:url(#SVGID_97_);}
- .st112{fill:url(#SVGID_98_);}
- .st113{fill:url(#SVGID_99_);}
- .st114{fill:#A2D4BF;}
- .st115{fill:url(#SVGID_100_);}
- .st116{fill:url(#SVGID_101_);}
- .st117{fill:url(#SVGID_102_);}
- .st118{fill:url(#SVGID_103_);}
- .st119{fill:url(#SVGID_104_);}
- .st120{fill:url(#SVGID_105_);}
- .st121{fill:url(#SVGID_106_);}
- .st122{fill:url(#SVGID_107_);}
- .st123{fill:url(#SVGID_108_);}
- .st124{fill:url(#SVGID_109_);}
- .st125{fill:url(#SVGID_110_);}
- .st126{fill:url(#SVGID_111_);}
- .st127{fill:url(#SVGID_112_);}
- .st128{fill:url(#SVGID_113_);}
- .st129{fill:url(#SVGID_114_);}
- .st130{fill:url(#SVGID_115_);}
- .st131{fill:#A2D4BF;}
- .st132{fill:#A2D4BF;}
- .st133{fill:#A2D4BF;}
- .st134{opacity:0.3;}
- .st135{fill:url(#SVGID_116_);}
- .st136{fill:url(#SVGID_117_);}
- .st137{fill:url(#SVGID_118_);}
- .st138{fill:url(#SVGID_119_);}
- .st139{fill:url(#SVGID_120_);}
- .st140{fill:url(#SVGID_121_);}
- .st141{fill:url(#SVGID_122_);}
- .st142{fill:url(#SVGID_123_);}
- .st143{fill:url(#SVGID_124_);}
- .st144{opacity:0.3;fill:#A2D4BF;}
- .st145{fill:url(#SVGID_125_);}
- .st146{fill:url(#SVGID_126_);}
- .st147{fill:url(#SVGID_127_);}
- .st148{fill:url(#SVGID_128_);}
- .st149{fill:url(#SVGID_129_);}
- .st150{fill:url(#SVGID_130_);}
- .st151{fill:url(#SVGID_131_);}
- .st152{fill:url(#SVGID_132_);}
- .st153{fill:url(#SVGID_133_);}
- .st154{fill:url(#SVGID_134_);}
- .st155{fill:url(#SVGID_135_);}
- .st156{fill:url(#SVGID_136_);}
- .st157{fill:url(#SVGID_137_);}
- .st158{fill:url(#SVGID_138_);}
- .st159{fill:url(#SVGID_139_);}
- .st160{fill:url(#SVGID_140_);}
- .st161{fill:url(#SVGID_141_);}
- .st162{fill:url(#SVGID_142_);}
- .st163{fill:url(#SVGID_143_);}
- .st164{fill:url(#SVGID_144_);}
- .st165{fill:url(#SVGID_145_);}
- .st166{fill:url(#SVGID_146_);}
- .st167{fill:url(#SVGID_147_);}
- .st168{fill:url(#SVGID_148_);}
- .st169{fill:url(#SVGID_149_);}
- .st170{fill:url(#SVGID_150_);}
- .st171{fill:url(#SVGID_151_);}
- .st172{fill:url(#SVGID_152_);}
- .st173{opacity:0.2;}
- .st174{fill:url(#SVGID_153_);}
- .st175{fill:url(#SVGID_154_);}
- .st176{fill:url(#SVGID_155_);}
- .st177{fill:url(#SVGID_156_);}
- .st178{fill:url(#SVGID_157_);}
- .st179{fill:url(#SVGID_158_);}
- .st180{fill:url(#SVGID_159_);}
- .st181{fill:url(#SVGID_160_);}
- .st182{fill:url(#SVGID_161_);}
- .st183{fill:url(#SVGID_162_);}
- .st184{fill:url(#SVGID_163_);}
- .st185{fill:url(#SVGID_164_);}
- .st186{fill:url(#SVGID_165_);}
- .st187{fill:url(#SVGID_166_);}
- .st188{fill:url(#SVGID_167_);}
- .st189{fill:url(#SVGID_168_);}
- .st190{fill:url(#SVGID_169_);}
- .st191{fill:url(#SVGID_170_);}
- .st192{fill:url(#SVGID_171_);}
- .st193{fill:url(#SVGID_172_);}
- .st194{fill:url(#SVGID_173_);}
- .st195{fill:url(#SVGID_174_);}
- .st196{fill:url(#SVGID_175_);}
- .st197{fill:url(#SVGID_176_);}
- .st198{fill:url(#SVGID_177_);}
- .st199{fill:url(#SVGID_178_);}
- .st200{fill:url(#SVGID_179_);}
- .st201{fill:url(#SVGID_180_);}
- .st202{fill:url(#SVGID_181_);}
- .st203{fill:url(#SVGID_182_);}
- .st204{fill:url(#SVGID_183_);}
- .st205{fill:url(#SVGID_184_);}
- .st206{fill:url(#SVGID_185_);}
- .st207{fill:url(#SVGID_186_);}
- .st208{fill:url(#SVGID_187_);}
- .st209{fill:url(#SVGID_188_);}
- .st210{fill:url(#SVGID_189_);}
- .st211{fill:url(#SVGID_190_);}
- .st212{fill:url(#SVGID_191_);}
- .st213{fill:url(#SVGID_192_);}
- .st214{fill:url(#SVGID_193_);}
- .st215{fill:url(#SVGID_194_);}
- .st216{fill:url(#SVGID_195_);}
- .st217{fill:url(#SVGID_196_);}
- .st218{fill:url(#SVGID_197_);}
- .st219{fill:url(#SVGID_198_);}
- .st220{fill:url(#SVGID_199_);}
- .st221{fill:url(#SVGID_200_);}
- .st222{fill:url(#SVGID_201_);}
- .st223{fill:url(#SVGID_202_);}
- .st224{fill:url(#SVGID_203_);}
- .st225{fill:url(#SVGID_204_);}
- .st226{fill:url(#SVGID_205_);}
- .st227{fill:url(#SVGID_206_);}
- .st228{fill:url(#SVGID_207_);}
- .st229{fill:url(#SVGID_208_);}
- .st230{fill:url(#SVGID_209_);}
- .st231{fill:url(#SVGID_210_);}
- .st232{fill:url(#SVGID_211_);}
- .st233{fill:url(#SVGID_212_);}
- .st234{fill:url(#SVGID_213_);}
- .st235{fill:url(#SVGID_214_);}
- .st236{fill:url(#SVGID_215_);}
- .st237{fill:url(#SVGID_216_);}
- .st238{fill:url(#SVGID_217_);}
- .st239{fill:url(#SVGID_218_);}
- .st240{fill:url(#SVGID_219_);}
- .st241{fill:url(#SVGID_220_);}
- .st242{fill:url(#SVGID_221_);}
- .st243{fill:url(#SVGID_222_);}
- .st244{fill:url(#SVGID_223_);}
- .st245{fill:url(#SVGID_224_);}
- .st246{fill:url(#SVGID_225_);}
- .st247{fill:url(#SVGID_226_);}
- .st248{fill:url(#SVGID_227_);}
- .st249{fill:url(#SVGID_228_);}
- .st250{fill:url(#SVGID_229_);}
- .st251{fill:url(#SVGID_230_);}
- .st252{fill:url(#SVGID_231_);}
-</style><pattern height="32.25219" id="Unnamed_Pattern_11" patternUnits="userSpaceOnUse" style="overflow:visible;" viewBox="0 -32.25219 32.25219 32.25219" width="32.25219"><g><rect class="st0" height="32.25219" width="32.25219" y="-32.25219"/><g><rect class="st1" height="32.25219" width="32.25219" x="0" y="-32.25219"/></g></g></pattern><pattern height="32.25219" id="Unnamed_Pattern_12" patternUnits="userSpaceOnUse" style="overflow:visible;" viewBox="0 -32.25219 32.25219 32.25219" width="32.25219"><g><rect class="st0" height="32.25219" width="32.25219" y="-32.25219"/><g><rect class="st2" height="32.25219" width="32.25219" x="0" y="-32.25219"/></g></g></pattern><pattern height="32.25219" id="Unnamed_Pattern_17" patternUnits="userSpaceOnUse" style="overflow:visible;" viewBox="0 -32.25219 32.25219 32.25219" width="32.25219"><g><rect class="st0" height="32.25219" width="32.25219" y="-32.25219"/><g><rect class="st3" height="32.25219" width="32.25219" x="0" y="-32.25219"/></g></g></pattern><pattern height="32.25219" id="Unnamed_Pattern_8" patternUnits="userSpaceOnUse" style="overflow:visible;" viewBox="0 -32.25219 32.25219 32.25219" width="32.25219"><g><rect class="st0" height="32.25219" width="32.25219" y="-32.25219"/><g><rect class="st4" height="32.25219" width="32.25219" x="0" y="-32.25219"/></g></g></pattern><g><g><g><g><path class="st20" d="M41.13838,34.52532l-0.0111,5.13829c-0.00106,0.44381-0.2927,0.88655-0.87493,1.2247l-13.07856,7.60072 c-1.17239,0.68103-3.07918,0.68156-4.25896,0L9.75067,40.88884c-0.59386-0.34289-0.89025-0.79251-0.8892-1.24213l0.0111-5.13565 c0,0.44803,14.05282,8.83968,14.05282,8.83968c1.18032,0.68103,3.0871,0.68103,4.25949-0.00053 C27.18488,43.35021,41.13732,34.9686,41.13838,34.52532z"/><path class="st19" d="M21.76243,43.91474L10.8618,37.62093c-0.28178-0.16269-0.63402,0.04066-0.63402,0.36604v1.70024 c0,0.30202,0.16113,0.58109,0.42268,0.73209l10.90062,6.29336c0.28178,0.16269,0.63401-0.04067,0.63401-0.36605v-1.6998 C22.18509,44.34482,22.02398,44.06575,21.76243,43.91474z"/><g><g><g><pattern id="SVGID_1_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7787.85449)" xlink:href="#Unnamed_Pattern_8"/><path class="st11" d="M27.83607,44.35159c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C28.08719,44.33585,27.97453,44.27165,27.83607,44.35159z"/></g><g><pattern id="SVGID_2_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7788.7207)" xlink:href="#Unnamed_Pattern_11"/><path class="st12" d="M27.97476,46.19764l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.02781c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C27.86329,46.55061,27.97521,46.35675,27.97476,46.19764z"/></g></g><g><g><pattern id="SVGID_3_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7787.5957)" xlink:href="#Unnamed_Pattern_8"/><path class="st14" d="M38.60205,38.09484c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C38.85318,38.0791,38.74052,38.0149,38.60205,38.09484z"/></g><g><pattern id="SVGID_4_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7788.75293)" xlink:href="#Unnamed_Pattern_11"/><path class="st15" d="M38.74075,39.9409l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.02781c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C38.62928,40.29386,38.7412,40.1,38.74075,39.9409z"/></g></g><g><g><pattern id="SVGID_5_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7786.70215)" xlink:href="#Unnamed_Pattern_8"/><path class="st16" d="M37.06406,38.98866c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C37.31518,38.97292,37.20252,38.90872,37.06406,38.98866z"/></g><g><pattern id="SVGID_6_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7787.85938)" xlink:href="#Unnamed_Pattern_11"/><path class="st17" d="M37.20275,40.83472l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05613-0.18163,0.04113-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C37.09127,41.18768,37.2032,40.99382,37.20275,40.83472z"/></g></g><g><g><pattern id="SVGID_7_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7785.80811)" xlink:href="#Unnamed_Pattern_8"/><path class="st18" d="M35.52606,39.88248c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C35.77718,39.86674,35.66452,39.80254,35.52606,39.88248z"/></g><g><pattern id="SVGID_8_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7786.96533)" xlink:href="#Unnamed_Pattern_11"/><path class="st22" d="M35.66475,41.72854l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.1591-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05613-0.18163,0.04113-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C35.55328,42.0815,35.6652,41.88765,35.66475,41.72854z"/></g></g><g><g><pattern id="SVGID_9_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7784.91455)" xlink:href="#Unnamed_Pattern_8"/><path class="st23" d="M33.98806,40.77631c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C34.23918,40.76056,34.12653,40.69636,33.98806,40.77631z"/></g><g><pattern id="SVGID_10_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7786.07178)" xlink:href="#Unnamed_Pattern_11"/><path class="st24" d="M34.12675,42.62236l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05613-0.18163,0.04113-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C34.01528,42.97533,34.1272,42.78147,34.12675,42.62236z"/></g></g><g><g><pattern id="SVGID_11_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7784.02051)" xlink:href="#Unnamed_Pattern_8"/><path class="st25" d="M32.45006,41.67013c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C32.70118,41.65438,32.58853,41.59018,32.45006,41.67013z"/></g><g><pattern id="SVGID_12_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7785.17773)" xlink:href="#Unnamed_Pattern_11"/><path class="st26" d="M32.58875,43.51618l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10563-0.03416 C32.47728,43.86914,32.5892,43.67529,32.58875,43.51618z"/></g></g><g><g><pattern id="SVGID_13_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7783.12695)" xlink:href="#Unnamed_Pattern_8"/><path class="st27" d="M30.91206,42.56395c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C31.16318,42.54821,31.05053,42.484,30.91206,42.56395z"/></g><g><pattern id="SVGID_14_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7784.28418)" xlink:href="#Unnamed_Pattern_11"/><path class="st28" d="M31.05075,44.41l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C30.93928,44.76297,31.0512,44.56911,31.05075,44.41z"/></g></g><g><g><pattern id="SVGID_15_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7782.23291)" xlink:href="#Unnamed_Pattern_8"/><path class="st29" d="M29.37406,43.45777c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C29.62519,43.44202,29.51253,43.37783,29.37406,43.45777z"/></g><g><pattern id="SVGID_16_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7783.39014)" xlink:href="#Unnamed_Pattern_11"/><path class="st30" d="M29.51276,45.30382l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.02781c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C29.40128,45.65679,29.51321,45.46293,29.51276,45.30382z"/></g></g></g><path class="st19" d="M40.24947,33.28313c1.17997,0.68126,1.18618,1.78553,0.01388,2.4668l-13.07866,7.60049 c-1.1723,0.68127-3.07907,0.68147-4.25904,0.00022L9.76142,35.75027c-1.17997-0.68126-1.18585-1.78573-0.01355-2.467 l13.07866-7.60049c1.1723-0.68127,3.07874-0.68128,4.25871-0.00002L40.24947,33.28313z"/><g><path class="st20" d="M35.13433,33.97103c0.52195,0.30135,0.52435,0.78969,0.00579,1.09105l-9.15985,5.32312 c-0.51856,0.30135-1.36164,0.30156-1.88359,0.00021l-9.21977-5.32304c-0.52195-0.30135-0.5247-0.7899-0.00614-1.09125 l9.15985-5.32312c0.51856-0.30135,1.36199-0.30136,1.88395-0.00001L35.13433,33.97103z"/></g><g><g><pattern id="SVGID_17_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7469.59229)" xlink:href="#Unnamed_Pattern_12"/><path class="st31" d="M11.57185,39.0591c0.25806,0.14899,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21033,0.41629-0.46838,0.26731c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80659 C11.10397,39.02929,11.3138,38.91011,11.57185,39.0591z"/></g><g><pattern id="SVGID_18_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7469.59229)" xlink:href="#Unnamed_Pattern_12"/><path class="st32" d="M13.07633,39.92771c0.25772,0.1488,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21066,0.4161-0.46839,0.2673c-0.25805-0.14899-0.46652-0.51006-0.46568-0.80658 C12.60846,39.8979,12.81828,39.77872,13.07633,39.92771z"/></g><g><pattern id="SVGID_19_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7469.59229)" xlink:href="#Unnamed_Pattern_12"/><path class="st33" d="M14.58082,40.79632c0.25772,0.1488,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21067,0.4161-0.46839,0.2673c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80658 C14.11294,40.76652,14.32276,40.64733,14.58082,40.79632z"/></g></g></g></g><polygon class="st9" points="20.82406,44.29959 17.33488,42.28501 17.33488,43.60646 20.82406,45.62094 "/></g><g><g><pattern id="SVGID_20_" patternTransform="matrix(0.05026 0 0 0.05026 -7629.47119 -7494.01416)" xlink:href="#Unnamed_Pattern_17"/><path class="st34" d="M40.35224,28.48818l-0.01056,4.88799c-0.001,0.42218-0.27844,0.84337-0.83231,1.16504l-12.44147,7.23047 c-1.11528,0.64786-2.92918,0.64836-4.0515,0l-12.5229-7.22997c-0.56493-0.32619-0.84689-0.75391-0.84589-1.18163l0.01056-4.88548 c0,0.42621,0.28196,0.85342,0.84538,1.17861l12.5229,7.23047c1.12282,0.64786,2.93672,0.64786,4.052-0.0005l12.44148-7.22997 C40.0738,29.33105,40.35123,28.90987,40.35224,28.48818z"/><g><path class="st20" d="M41.13838,26.46805l-0.0111,5.13829c-0.00106,0.4438-0.2927,0.88655-0.87493,1.2247l-13.07856,7.60072 c-1.17239,0.68103-3.07918,0.68156-4.25896,0L9.75067,32.83156c-0.59386-0.34289-0.89025-0.79251-0.8892-1.24213l0.0111-5.13565 c0,0.44803,14.05282,8.83968,14.05282,8.83968c1.18032,0.68103,3.0871,0.68103,4.25949-0.00053 C27.18488,35.29294,41.13732,26.91133,41.13838,26.46805z"/><path class="st19" d="M21.76243,35.85747L10.8618,29.56366c-0.28178-0.16269-0.63402,0.04066-0.63402,0.36604v1.70024 c0,0.30202,0.16113,0.58109,0.42268,0.73209l10.90062,6.29336c0.28178,0.16269,0.63401-0.04067,0.63401-0.36605v-1.6998 C22.18509,36.28754,22.02398,36.00848,21.76243,35.85747z"/><g><g><g><pattern id="SVGID_21_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7795.91211)" xlink:href="#Unnamed_Pattern_8"/><path class="st35" d="M27.83607,36.29432c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C28.08719,36.27857,27.97453,36.21437,27.83607,36.29432z"/></g><g><pattern id="SVGID_22_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7796.77783)" xlink:href="#Unnamed_Pattern_11"/><path class="st36" d="M27.97476,38.14037l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.02781c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C27.86329,38.49334,27.97521,38.29948,27.97476,38.14037z"/></g></g><g><g><pattern id="SVGID_23_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7795.65332)" xlink:href="#Unnamed_Pattern_8"/><path class="st37" d="M38.60205,30.03757c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C38.85318,30.02183,38.74052,29.95763,38.60205,30.03757z"/></g><g><pattern id="SVGID_24_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7796.81055)" xlink:href="#Unnamed_Pattern_11"/><path class="st38" d="M38.74075,31.88362l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.02781c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C38.62928,32.23659,38.7412,32.04273,38.74075,31.88362z"/></g></g><g><g><pattern id="SVGID_25_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7794.75928)" xlink:href="#Unnamed_Pattern_8"/><path class="st39" d="M37.06406,30.93139c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C37.31518,30.91565,37.20252,30.85145,37.06406,30.93139z"/></g><g><pattern id="SVGID_26_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7795.9165)" xlink:href="#Unnamed_Pattern_11"/><path class="st40" d="M37.20275,32.77744l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.02781c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C37.09127,33.13041,37.2032,32.93655,37.20275,32.77744z"/></g></g><g><g><pattern id="SVGID_27_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7793.86523)" xlink:href="#Unnamed_Pattern_8"/><path class="st41" d="M35.52606,31.82521c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C35.77718,31.80947,35.66452,31.74527,35.52606,31.82521z"/></g><g><pattern id="SVGID_28_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7795.02295)" xlink:href="#Unnamed_Pattern_11"/><path class="st42" d="M35.66475,33.67126l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05613-0.18163,0.04113-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C35.55328,34.02423,35.6652,33.83037,35.66475,33.67126z"/></g></g><g><g><pattern id="SVGID_29_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7792.97168)" xlink:href="#Unnamed_Pattern_8"/><path class="st43" d="M33.98806,32.71903c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C34.23918,32.70329,34.12653,32.63909,33.98806,32.71903z"/></g><g><pattern id="SVGID_30_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7794.12891)" xlink:href="#Unnamed_Pattern_11"/><path class="st44" d="M34.12675,34.56509l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05613-0.18163,0.04113-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C34.01528,34.91805,34.1272,34.72419,34.12675,34.56509z"/></g></g><g><g><pattern id="SVGID_31_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7792.07764)" xlink:href="#Unnamed_Pattern_8"/><path class="st45" d="M32.45006,33.61285c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C32.70118,33.59711,32.58853,33.53291,32.45006,33.61285z"/></g><g><pattern id="SVGID_32_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7793.23486)" xlink:href="#Unnamed_Pattern_11"/><path class="st46" d="M32.58875,35.4589l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04113-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10563-0.03416 C32.47728,35.81187,32.5892,35.61801,32.58875,35.4589z"/></g></g><g><g><pattern id="SVGID_33_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7791.18408)" xlink:href="#Unnamed_Pattern_8"/><path class="st47" d="M30.91206,34.50668c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C31.16318,34.49093,31.05053,34.42673,30.91206,34.50668z"/></g><g><pattern id="SVGID_34_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7792.34131)" xlink:href="#Unnamed_Pattern_11"/><path class="st48" d="M31.05075,36.35273l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C30.93928,36.70569,31.0512,36.51183,31.05075,36.35273z"/></g></g><g><g><pattern id="SVGID_35_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7790.29004)" xlink:href="#Unnamed_Pattern_8"/><path class="st49" d="M29.37406,35.4005c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C29.62519,35.38475,29.51253,35.32055,29.37406,35.4005z"/></g><g><pattern id="SVGID_36_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7791.44727)" xlink:href="#Unnamed_Pattern_11"/><path class="st50" d="M29.51276,37.24655l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C29.40128,37.59951,29.51321,37.40565,29.51276,37.24655z"/></g></g></g><path class="st19" d="M40.24947,25.22585c1.17997,0.68126,1.18618,1.78554,0.01388,2.4668l-13.07866,7.60049 c-1.1723,0.68127-3.07907,0.68147-4.25904,0.00022L9.76142,27.69299c-1.17997-0.68126-1.18585-1.78573-0.01355-2.467 l13.07866-7.60049c1.1723-0.68127,3.07874-0.68128,4.25871-0.00002L40.24947,25.22585z"/><g><path class="st20" d="M35.13433,25.91375c0.52195,0.30135,0.52435,0.78969,0.00579,1.09105l-9.15985,5.32312 c-0.51856,0.30135-1.36164,0.30156-1.88359,0.00021l-9.21977-5.32303c-0.52195-0.30135-0.5247-0.7899-0.00614-1.09125 l9.15985-5.32312c0.51856-0.30136,1.36199-0.30136,1.88395-0.00001L35.13433,25.91375z"/></g><g><g><pattern id="SVGID_37_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7477.6499)" xlink:href="#Unnamed_Pattern_12"/><path class="st51" d="M11.57185,31.00182c0.25806,0.14899,0.46618,0.50947,0.46534,0.806 c-0.00084,0.29653-0.21033,0.41629-0.46838,0.26731c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80659 C11.10397,30.97202,11.3138,30.85283,11.57185,31.00182z"/></g><g><pattern id="SVGID_38_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7477.6499)" xlink:href="#Unnamed_Pattern_12"/><path class="st52" d="M13.07633,31.87043c0.25772,0.1488,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21066,0.4161-0.46839,0.2673c-0.25805-0.14899-0.46652-0.51006-0.46568-0.80658 C12.60846,31.84063,12.81828,31.72145,13.07633,31.87043z"/></g><g><pattern id="SVGID_39_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7477.6499)" xlink:href="#Unnamed_Pattern_12"/><path class="st53" d="M14.58082,32.73905c0.25772,0.1488,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21067,0.4161-0.46839,0.2673c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80658 C14.11294,32.70924,14.32276,32.59006,14.58082,32.73905z"/></g></g></g></g><polygon class="st9" points="20.82406,36.24232 17.33488,34.22774 17.33488,35.54919 20.82406,37.56367 "/></g><g><g><pattern id="SVGID_40_" patternTransform="matrix(0.05026 0 0 0.05026 -7629.47119 -7502.07129)" xlink:href="#Unnamed_Pattern_17"/><path class="st54" d="M40.35224,20.43091l-0.01056,4.88799c-0.001,0.42219-0.27844,0.84337-0.83231,1.16504l-12.44147,7.23047 c-1.11528,0.64786-2.92918,0.64836-4.0515,0l-12.5229-7.22997c-0.56493-0.32619-0.84689-0.75391-0.84589-1.18162l0.01056-4.88548 c0,0.42621,0.28196,0.85342,0.84538,1.17861l12.5229,7.23047c1.12282,0.64786,2.93672,0.64786,4.052-0.0005l12.44148-7.22997 C40.0738,21.27378,40.35123,20.85259,40.35224,20.43091z"/><g><path class="st20" d="M41.13838,18.41078l-0.0111,5.13829c-0.00106,0.4438-0.2927,0.88655-0.87493,1.2247l-13.07856,7.60072 c-1.17239,0.68103-3.07918,0.68156-4.25896,0L9.75067,24.77429c-0.59386-0.34289-0.89025-0.79251-0.8892-1.24213l0.0111-5.13565 c0,0.44803,14.05282,8.83968,14.05282,8.83968c1.18032,0.68103,3.0871,0.68103,4.25949-0.00053 C27.18488,27.23566,41.13732,18.85405,41.13838,18.41078z"/><path class="st19" d="M21.76243,27.80019l-10.90063-6.2938c-0.28178-0.16269-0.63402,0.04066-0.63402,0.36604v1.70024 c0,0.30202,0.16113,0.58109,0.42268,0.73209l10.90062,6.29336c0.28178,0.16269,0.63401-0.04067,0.63401-0.36605v-1.6998 C22.18509,28.23027,22.02398,27.9512,21.76243,27.80019z"/><g><g><g><pattern id="SVGID_41_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7803.96924)" xlink:href="#Unnamed_Pattern_8"/><path class="st55" d="M27.83607,28.23704c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C28.08719,28.2213,27.97453,28.1571,27.83607,28.23704z"/></g><g><pattern id="SVGID_42_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7804.83545)" xlink:href="#Unnamed_Pattern_11"/><path class="st56" d="M27.97476,30.0831l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C27.86329,30.43606,27.97521,30.2422,27.97476,30.0831z"/></g></g><g><g><pattern id="SVGID_43_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7803.71045)" xlink:href="#Unnamed_Pattern_8"/><path class="st57" d="M38.60205,21.9803c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C38.85318,21.96455,38.74052,21.90035,38.60205,21.9803z"/></g><g><pattern id="SVGID_44_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7804.86768)" xlink:href="#Unnamed_Pattern_11"/><path class="st58" d="M38.74075,23.82635l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C38.62928,24.17931,38.7412,23.98545,38.74075,23.82635z"/></g></g><g><g><pattern id="SVGID_45_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7802.81641)" xlink:href="#Unnamed_Pattern_8"/><path class="st59" d="M37.06406,22.87412c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C37.31518,22.85837,37.20252,22.79417,37.06406,22.87412z"/></g><g><pattern id="SVGID_46_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7803.97363)" xlink:href="#Unnamed_Pattern_11"/><path class="st60" d="M37.20275,24.72017l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C37.09127,25.07314,37.2032,24.87928,37.20275,24.72017z"/></g></g><g><g><pattern id="SVGID_47_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7801.92285)" xlink:href="#Unnamed_Pattern_8"/><path class="st61" d="M35.52606,23.76794c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C35.77718,23.75219,35.66452,23.68799,35.52606,23.76794z"/></g><g><pattern id="SVGID_48_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7803.08008)" xlink:href="#Unnamed_Pattern_11"/><path class="st62" d="M35.66475,25.61399l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C35.55328,25.96696,35.6652,25.7731,35.66475,25.61399z"/></g></g><g><g><pattern id="SVGID_49_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7801.02881)" xlink:href="#Unnamed_Pattern_8"/><path class="st63" d="M33.98806,24.66176c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C34.23918,24.64602,34.12653,24.58182,33.98806,24.66176z"/></g><g><pattern id="SVGID_50_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7802.18604)" xlink:href="#Unnamed_Pattern_11"/><path class="st64" d="M34.12675,26.50781l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C34.01528,26.86078,34.1272,26.66692,34.12675,26.50781z"/></g></g><g><g><pattern id="SVGID_51_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7800.13525)" xlink:href="#Unnamed_Pattern_8"/><path class="st65" d="M32.45006,25.55558c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C32.70118,25.53984,32.58853,25.47564,32.45006,25.55558z"/></g><g><pattern id="SVGID_52_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7801.29248)" xlink:href="#Unnamed_Pattern_11"/><path class="st66" d="M32.58875,27.40163l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10563-0.03416 C32.47728,27.7546,32.5892,27.56074,32.58875,27.40163z"/></g></g><g><g><pattern id="SVGID_53_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7799.24121)" xlink:href="#Unnamed_Pattern_8"/><path class="st67" d="M30.91206,26.4494c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C31.16318,26.43366,31.05053,26.36946,30.91206,26.4494z"/></g><g><pattern id="SVGID_54_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7800.39844)" xlink:href="#Unnamed_Pattern_11"/><path class="st68" d="M31.05075,28.29545l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C30.93928,28.64842,31.0512,28.45456,31.05075,28.29545z"/></g></g><g><g><pattern id="SVGID_55_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7798.34766)" xlink:href="#Unnamed_Pattern_8"/><path class="st69" d="M29.37406,27.34322c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C29.62519,27.32748,29.51253,27.26328,29.37406,27.34322z"/></g><g><pattern id="SVGID_56_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7799.50488)" xlink:href="#Unnamed_Pattern_11"/><path class="st70" d="M29.51276,29.18927l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C29.40128,29.54224,29.51321,29.34838,29.51276,29.18927z"/></g></g></g><path class="st19" d="M40.24947,17.16858c1.17997,0.68126,1.18618,1.78554,0.01388,2.4668l-13.07866,7.60049 c-1.1723,0.68127-3.07907,0.68147-4.25904,0.00021L9.76142,19.63572c-1.17997-0.68126-1.18585-1.78573-0.01355-2.467 l13.07866-7.60049c1.1723-0.68127,3.07874-0.68128,4.25871-0.00002L40.24947,17.16858z"/><g><path class="st20" d="M35.13433,17.85648c0.52195,0.30135,0.52435,0.78969,0.00579,1.09105l-9.15985,5.32312 c-0.51856,0.30136-1.36164,0.30156-1.88359,0.00021l-9.21977-5.32304c-0.52195-0.30135-0.5247-0.7899-0.00614-1.09125 l9.15985-5.32312c0.51856-0.30135,1.36199-0.30136,1.88395-0.00001L35.13433,17.85648z"/></g><g><g><pattern id="SVGID_57_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7485.70703)" xlink:href="#Unnamed_Pattern_12"/><path class="st71" d="M11.57185,22.94455c0.25806,0.14899,0.46618,0.50947,0.46534,0.806 c-0.00084,0.29653-0.21033,0.41629-0.46838,0.26731c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80659 C11.10397,22.91474,11.3138,22.79556,11.57185,22.94455z"/></g><g><pattern id="SVGID_58_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7485.70703)" xlink:href="#Unnamed_Pattern_12"/><path class="st72" d="M13.07633,23.81316c0.25772,0.1488,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21066,0.4161-0.46839,0.2673c-0.25805-0.14898-0.46652-0.51006-0.46568-0.80658 C12.60846,23.78336,12.81828,23.66418,13.07633,23.81316z"/></g><g><pattern id="SVGID_59_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7485.70703)" xlink:href="#Unnamed_Pattern_12"/><path class="st73" d="M14.58082,24.68177c0.25772,0.14879,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21067,0.4161-0.46839,0.2673c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80658 C14.11294,24.65197,14.32276,24.53279,14.58082,24.68177z"/></g></g></g></g><polygon class="st9" points="20.82406,28.18505 17.33488,26.17046 17.33488,27.49191 20.82406,29.5064 "/></g><g><g><pattern id="SVGID_60_" patternTransform="matrix(0.05026 0 0 0.05026 -7629.47119 -7510.12842)" xlink:href="#Unnamed_Pattern_17"/><path class="st74" d="M40.35224,12.37363l-0.01056,4.88799c-0.001,0.42219-0.27844,0.84337-0.83231,1.16504l-12.44147,7.23047 c-1.11528,0.64786-2.92918,0.64836-4.0515,0l-12.5229-7.22997c-0.56493-0.32619-0.84689-0.75391-0.84589-1.18162l0.01056-4.88548 c0,0.42621,0.28196,0.85342,0.84538,1.17861l12.5229,7.23047c1.12282,0.64786,2.93672,0.64786,4.052-0.0005l12.44148-7.22997 C40.0738,13.2165,40.35123,12.79532,40.35224,12.37363z"/><g><path class="st20" d="M41.13838,10.3535l-0.0111,5.13829c-0.00106,0.4438-0.2927,0.88655-0.87493,1.2247l-13.07856,7.60072 c-1.17239,0.68103-3.07918,0.68156-4.25896,0L9.75067,16.71702c-0.59386-0.34289-0.89025-0.79251-0.8892-1.24213l0.0111-5.13565 c0,0.44803,14.05282,8.83968,14.05282,8.83968c1.18032,0.68103,3.0871,0.68103,4.25949-0.00053 C27.18488,19.17839,41.13732,10.79678,41.13838,10.3535z"/><path class="st19" d="M21.76243,19.74292L10.8618,13.44911c-0.28178-0.16269-0.63402,0.04066-0.63402,0.36604v1.70024 c0,0.30202,0.16113,0.58109,0.42268,0.73209l10.90062,6.29336c0.28178,0.16269,0.63401-0.04067,0.63401-0.36605V20.475 C22.18509,20.173,22.02398,19.89393,21.76243,19.74292z"/><g><g><g><pattern id="SVGID_61_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7812.02637)" xlink:href="#Unnamed_Pattern_8"/><path class="st75" d="M27.83607,20.17977c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C28.08719,20.16403,27.97453,20.09983,27.83607,20.17977z"/></g><g><pattern id="SVGID_62_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.60742 -7812.89258)" xlink:href="#Unnamed_Pattern_11"/><path class="st76" d="M27.97476,22.02582l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C27.86329,22.37879,27.97521,22.18493,27.97476,22.02582z"/></g></g><g><g><pattern id="SVGID_63_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7811.76758)" xlink:href="#Unnamed_Pattern_8"/><path class="st77" d="M38.60205,13.92302c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C38.85318,13.90728,38.74052,13.84308,38.60205,13.92302z"/></g><g><pattern id="SVGID_64_" patternTransform="matrix(-0.01188 0 0 0.01188 -8135.57275 -7812.9248)" xlink:href="#Unnamed_Pattern_11"/><path class="st78" d="M38.74075,15.76907l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C38.62928,16.12204,38.7412,15.92818,38.74075,15.76907z"/></g></g><g><g><pattern id="SVGID_65_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7810.87402)" xlink:href="#Unnamed_Pattern_8"/><path class="st79" d="M37.06406,14.81684c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C37.31518,14.8011,37.20252,14.7369,37.06406,14.81684z"/></g><g><pattern id="SVGID_66_" patternTransform="matrix(-0.01188 0 0 0.01188 -8137.11084 -7812.03125)" xlink:href="#Unnamed_Pattern_11"/><path class="st80" d="M37.20275,16.6629l-0.005-1.76465c-0.00013-0.04741-0.0103-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C37.09127,17.01586,37.2032,16.822,37.20275,16.6629z"/></g></g><g><g><pattern id="SVGID_67_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7809.97998)" xlink:href="#Unnamed_Pattern_8"/><path class="st81" d="M35.52606,15.71066c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C35.77718,15.69492,35.66452,15.63072,35.52606,15.71066z"/></g><g><pattern id="SVGID_68_" patternTransform="matrix(-0.01188 0 0 0.01188 -8138.64893 -7811.13721)" xlink:href="#Unnamed_Pattern_11"/><path class="st82" d="M35.66475,17.55672l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C35.55328,17.90968,35.6652,17.71582,35.66475,17.55672z"/></g></g><g><g><pattern id="SVGID_69_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7809.08643)" xlink:href="#Unnamed_Pattern_8"/><path class="st83" d="M33.98806,16.60448c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C34.23918,16.58874,34.12653,16.52454,33.98806,16.60448z"/></g><g><pattern id="SVGID_70_" patternTransform="matrix(-0.01188 0 0 0.01188 -8140.18701 -7810.24365)" xlink:href="#Unnamed_Pattern_11"/><path class="st84" d="M34.12675,18.45054l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C34.01528,18.8035,34.1272,18.60964,34.12675,18.45054z"/></g></g><g><g><pattern id="SVGID_71_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7808.19238)" xlink:href="#Unnamed_Pattern_8"/><path class="st85" d="M32.45006,17.49831c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.2233,0.25157,0.14336s0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C32.70118,17.48256,32.58853,17.41836,32.45006,17.49831z"/></g><g><pattern id="SVGID_72_" patternTransform="matrix(-0.01188 0 0 0.01188 -8141.7251 -7809.34961)" xlink:href="#Unnamed_Pattern_11"/><path class="st86" d="M32.58875,19.34436l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08585-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10563-0.03416 C32.47728,19.69732,32.5892,19.50347,32.58875,19.34436z"/></g></g><g><g><pattern id="SVGID_73_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7807.29834)" xlink:href="#Unnamed_Pattern_8"/><path class="st87" d="M30.91206,18.39213c-0.13847,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C31.16318,18.37638,31.05053,18.31219,30.91206,18.39213z"/></g><g><pattern id="SVGID_74_" patternTransform="matrix(-0.01188 0 0 0.01188 -8143.2627 -7808.45557)" xlink:href="#Unnamed_Pattern_11"/><path class="st88" d="M31.05075,20.23818l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01239,0.10562-0.03416 C30.93928,20.59115,31.0512,20.39729,31.05075,20.23818z"/></g></g><g><g><pattern id="SVGID_75_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7806.40479)" xlink:href="#Unnamed_Pattern_8"/><path class="st89" d="M29.37406,19.28595c-0.13846,0.07994-0.25039,0.2738-0.24994,0.43291l0.005,1.76465 c0.00045,0.15911,0.11311,0.22331,0.25157,0.14336c0.13847-0.07994,0.25039-0.2738,0.24994-0.43291l-0.005-1.76465 C29.62519,19.2702,29.51253,19.20601,29.37406,19.28595z"/></g><g><pattern id="SVGID_76_" patternTransform="matrix(-0.01188 0 0 0.01188 -8144.80078 -7807.56201)" xlink:href="#Unnamed_Pattern_11"/><path class="st90" d="M29.51276,21.132l-0.005-1.76465c-0.00013-0.04741-0.01029-0.08631-0.02806-0.11556 c0.08586-0.00369,0.14562,0.06175,0.14595,0.17752l0.005,1.76465c0.00045,0.15911-0.11147,0.35297-0.24994,0.43291 c-0.09721,0.05612-0.18163,0.04112-0.22351-0.0278c0.03214-0.00138,0.06791-0.01238,0.10562-0.03416 C29.40128,21.48497,29.51321,21.29111,29.51276,21.132z"/></g></g></g><path class="st19" d="M40.24947,9.11131c1.17997,0.68126,1.18618,1.78553,0.01388,2.4668L27.18469,19.1786 c-1.1723,0.68127-3.07907,0.68147-4.25904,0.00022L9.76142,11.57844c-1.17997-0.68126-1.18585-1.78573-0.01355-2.467 l13.07866-7.60049c1.1723-0.68127,3.07874-0.68128,4.25871-0.00002L40.24947,9.11131z"/><g><path class="st20" d="M35.13433,9.7992c0.52195,0.30135,0.52435,0.78969,0.00579,1.09105l-9.15985,5.32312 c-0.51856,0.30136-1.36164,0.30156-1.88359,0.00021l-9.21977-5.32304c-0.52195-0.30135-0.5247-0.7899-0.00614-1.09125 l9.15985-5.32312c0.51856-0.30135,1.36199-0.30136,1.88395-0.00001L35.13433,9.7992z"/></g><g><g><pattern id="SVGID_77_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7493.76416)" xlink:href="#Unnamed_Pattern_12"/><path class="st91" d="M11.57185,14.88728c0.25806,0.14899,0.46618,0.50947,0.46534,0.806 c-0.00084,0.29653-0.21033,0.4163-0.46838,0.26731c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80659 C11.10397,14.85747,11.3138,14.73829,11.57185,14.88728z"/></g><g><pattern id="SVGID_78_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7493.76416)" xlink:href="#Unnamed_Pattern_12"/><path class="st92" d="M13.07633,15.75589c0.25772,0.1488,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21066,0.4161-0.46839,0.2673c-0.25805-0.14898-0.46652-0.51006-0.46568-0.80658 C12.60846,15.72608,12.81828,15.6069,13.07633,15.75589z"/></g><g><pattern id="SVGID_79_" patternTransform="matrix(0.05283 0 0 0.05283 -7612.17334 -7493.76416)" xlink:href="#Unnamed_Pattern_12"/><path class="st93" d="M14.58082,16.6245c0.25772,0.14879,0.46618,0.50948,0.46534,0.806 c-0.00084,0.29653-0.21067,0.4161-0.46839,0.2673c-0.25806-0.14899-0.46652-0.51006-0.46568-0.80658 C14.11294,16.5947,14.32276,16.47551,14.58082,16.6245z"/></g></g></g></g><polygon class="st9" points="20.82406,20.12777 17.33488,18.11319 17.33488,19.43464 20.82406,21.44913 "/></g></g></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#B8E6B8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grid2x2-check-icon lucide-grid-2x2-check"><path d="M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3"/><path d="m16 19 2 2 4-4"/></svg>
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/public/icons/image.svg b/flowsint-app/src/renderer/public/icons/image.svg
new file mode 100644
index 00000000..1e04596c
--- /dev/null
+++ b/flowsint-app/src/renderer/public/icons/image.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image-up-icon lucide-image-up"><path d="M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21"/><path d="m14 19.5 3-3 3 3"/><path d="M17 22v-5.5"/><circle cx="9" cy="9" r="2"/></svg>
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/public/icons/phrase.svg b/flowsint-app/src/renderer/public/icons/phrase.svg
new file mode 100644
index 00000000..a25dd4f5
--- /dev/null
+++ b/flowsint-app/src/renderer/public/icons/phrase.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#D4A5D4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-baseline-icon lucide-baseline"><path d="M4 20h16"/><path d="m6 16 6-12 6 12"/><path d="M8 12h8"/></svg>
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/public/icons/username.svg b/flowsint-app/src/renderer/public/icons/socialprofile.svg
similarity index 100%
rename from flowsint-app/src/renderer/public/icons/username.svg
rename to flowsint-app/src/renderer/public/icons/socialprofile.svg
diff --git a/flowsint-app/src/renderer/src/api/transfrom-service.ts b/flowsint-app/src/renderer/src/api/transfrom-service.ts
index 8e3d9c59..9322ca02 100644
--- a/flowsint-app/src/renderer/src/api/transfrom-service.ts
+++ b/flowsint-app/src/renderer/src/api/transfrom-service.ts
@@ -47,4 +47,9 @@ export const transformService = {
method: 'GET',
});
},
+ getRawMaterialForType: async (type: string): Promise<any> => {
+ return fetchWithAuth(`/api/transforms/input_type/${type}`, {
+ method: 'GET',
+ });
+ },
};
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/command.tsx b/flowsint-app/src/renderer/src/components/command.tsx
index 760ff68b..6e938c1e 100644
--- a/flowsint-app/src/renderer/src/components/command.tsx
+++ b/flowsint-app/src/renderer/src/components/command.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import {
diff --git a/flowsint-app/src/renderer/src/components/copy.tsx b/flowsint-app/src/renderer/src/components/copy.tsx
index f99d5be5..dc44b5f2 100644
--- a/flowsint-app/src/renderer/src/components/copy.tsx
+++ b/flowsint-app/src/renderer/src/components/copy.tsx
@@ -1,4 +1,3 @@
-"use client"
import { useState, useCallback } from "react"
import { CheckIcon, CopyIcon } from "lucide-react"
diff --git a/flowsint-app/src/renderer/src/components/graphs/draggable-item.tsx b/flowsint-app/src/renderer/src/components/graphs/draggable-item.tsx
index 6520d9a0..3bfc87b1 100644
--- a/flowsint-app/src/renderer/src/components/graphs/draggable-item.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/draggable-item.tsx
@@ -1,4 +1,3 @@
-"use client"
import { memo, useState } from "react"
import { useIcon } from "@/hooks/use-icon"
diff --git a/flowsint-app/src/renderer/src/components/graphs/dynamic-form.tsx b/flowsint-app/src/renderer/src/components/graphs/dynamic-form.tsx
index 3b100620..ce9eae89 100644
--- a/flowsint-app/src/renderer/src/components/graphs/dynamic-form.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/dynamic-form.tsx
@@ -1,4 +1,3 @@
-"use client"
import { useState, useMemo } from "react"
import { useForm, Controller } from "react-hook-form"
diff --git a/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx b/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx
index 72415403..0ed2e492 100644
--- a/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx
@@ -23,8 +23,6 @@ const Graph = lazy(() => import('./graph'))
const NODE_COUNT_THRESHOLD = 500;
-
-
// Separate component for the drag overlay
const DragOverlay = memo(({ isDragging }: { isDragging: boolean }) => (
<div
diff --git a/flowsint-app/src/renderer/src/components/graphs/graph-react-force.tsx b/flowsint-app/src/renderer/src/components/graphs/graph-react-force.tsx
index b2a4a60e..c6fde359 100644
--- a/flowsint-app/src/renderer/src/components/graphs/graph-react-force.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/graph-react-force.tsx
@@ -47,7 +47,7 @@ const GraphReactForce: React.FC<GraphReactForceProps> = () => {
const transformedNodes = nodes.map(node => {
const type = node.data?.type as ItemType;
const color = colors[type] || '#0074D9';
- const size = getSize(type);
+ const size = getSize(type)-2;
let nodeLabel = node.data.label;
if (!nodeLabel && 'caption' in node) nodeLabel = (node as any).caption;
if (!nodeLabel) nodeLabel = node.id;
diff --git a/flowsint-app/src/renderer/src/components/graphs/items-panel.tsx b/flowsint-app/src/renderer/src/components/graphs/items-panel.tsx
index 9e685b9e..34c2729e 100644
--- a/flowsint-app/src/renderer/src/components/graphs/items-panel.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/items-panel.tsx
@@ -1,5 +1,3 @@
-"use client"
-
import { Button } from "@/components/ui/button"
import { PlusIcon, Search } from "lucide-react"
import { memo, useCallback, useState } from "react"
diff --git a/flowsint-app/src/renderer/src/components/graphs/launch-transform.tsx b/flowsint-app/src/renderer/src/components/graphs/launch-transform.tsx
index d7f77428..61eab43d 100644
--- a/flowsint-app/src/renderer/src/components/graphs/launch-transform.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/launch-transform.tsx
@@ -1,4 +1,3 @@
-"use client"
import { useCallback, useState } from "react"
import { Button } from "@/components/ui/button"
diff --git a/flowsint-app/src/renderer/src/components/graphs/metadata-field.tsx b/flowsint-app/src/renderer/src/components/graphs/metadata-field.tsx
index 424f6693..db3b9871 100644
--- a/flowsint-app/src/renderer/src/components/graphs/metadata-field.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/metadata-field.tsx
@@ -1,4 +1,3 @@
-"use client"
import { useState } from "react"
import { PlusCircle, X } from "lucide-react"
diff --git a/flowsint-app/src/renderer/src/components/graphs/new-sketch.tsx b/flowsint-app/src/renderer/src/components/graphs/new-sketch.tsx
index feaf26a8..ac7a1773 100644
--- a/flowsint-app/src/renderer/src/components/graphs/new-sketch.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/new-sketch.tsx
@@ -1,4 +1,3 @@
-"use client"
import React, { useState } from "react"
import { useForm } from "react-hook-form"
diff --git a/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx b/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx
index 4832d03e..178078ea 100644
--- a/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx
@@ -1,4 +1,3 @@
-"use client"
import { Button } from "@/components/ui/button"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
diff --git a/flowsint-app/src/renderer/src/components/graphs/wall/custom/context-menu.tsx b/flowsint-app/src/renderer/src/components/graphs/wall/custom/context-menu.tsx
index 7b7520bf..46af4b18 100644
--- a/flowsint-app/src/renderer/src/components/graphs/wall/custom/context-menu.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/wall/custom/context-menu.tsx
@@ -11,6 +11,21 @@ import { useLaunchTransform } from '@/hooks/use-launch-transform';
import { useParams } from '@tanstack/react-router';
import { capitalizeFirstLetter, cn } from '@/lib/utils';
import NodeActions from '../../node-actions';
+import BaseContextMenu from '@/components/xyflow/context-menu';
+
+interface GraphContextMenuProps {
+ node: GraphNode;
+ top: number;
+ left: number;
+ right: number;
+ bottom: number;
+ wrapperWidth: number;
+ wrapperHeight: number;
+ onEdit?: () => void;
+ onDelete?: () => void;
+ setMenu: (menu: any | null) => void;
+ [key: string]: any;
+}
export default function ContextMenu({
node,
@@ -24,19 +39,7 @@ export default function ContextMenu({
onDelete,
setMenu,
...props
-}: {
- node: GraphNode;
- top: number;
- left: number;
- right: number;
- bottom: number;
- wrapperWidth: number;
- wrapperHeight: number;
- onEdit?: () => void;
- onDelete?: () => void;
- setMenu: (menu: any | null) => void;
- [key: string]: any;
-}) {
+}: GraphContextMenuProps) {
const { id: sketchId } = useParams({ strict: false })
const [searchQuery, setSearchQuery] = useState('');
const { launchTransform } = useLaunchTransform(false);
@@ -54,50 +57,6 @@ export default function ContextMenu({
return matchesName || matchesDescription;
}) || [];
- // Calculate dynamic dimensions based on available space
- const maxWidth = 320; // Default width (w-80)
- const maxHeight = 500; // Default height (h-96)
- const minWidth = 280; // Minimum width
- const minHeight = 200; // Minimum height
-
- // Calculate available space based on menu position and wrapper dimensions
- let availableWidth = maxWidth;
- let availableHeight = maxHeight;
-
- if (left > 0) {
- // Menu is positioned from left, so available width is from left to right edge
- availableWidth = wrapperWidth - left - 20; // 20px padding from right edge
- } else if (right > 0) {
- // Menu is positioned from right, so available width is from left edge to right position
- availableWidth = wrapperWidth - right - 20; // 20px padding from left edge
- }
-
- if (top > 0) {
- // Menu is positioned from top, so available height is from top to bottom edge
- availableHeight = wrapperHeight - top - 20; // 20px padding from bottom edge
- } else if (bottom > 0) {
- // Menu is positioned from bottom, so available height is from top edge to bottom position
- availableHeight = wrapperHeight - bottom - 20; // 20px padding from top edge
- }
-
- // Determine dynamic dimensions
- const dynamicWidth = Math.min(maxWidth, Math.max(minWidth, availableWidth));
- const dynamicHeight = Math.min(maxHeight, Math.max(minHeight, availableHeight));
-
- // Calculate dynamic styles
- const dynamicStyles = {
- width: `${dynamicWidth}px`,
- maxHeight: `${dynamicHeight}px`,
- top: top > 0 ? `${top}px` : 'auto',
- left: left > 0 ? `${left}px` : 'auto',
- right: right > 0 ? `${right}px` : 'auto',
- bottom: bottom > 0 ? `${bottom}px` : 'auto',
- };
-
- const handleMenuClick = (e: React.MouseEvent) => {
- e.stopPropagation();
- };
-
const handleTransformClick = (e: React.MouseEvent, transformId: string) => {
e.stopPropagation();
launchTransform([node.data.label], transformId, sketchId)
@@ -105,10 +64,14 @@ export default function ContextMenu({
};
return (
- <div
- style={dynamicStyles}
- className="bg-background/90 backdrop-blur-sm border border-border flex flex-col rounded-lg shadow-lg absolute z-50"
- onClick={handleMenuClick}
+ <BaseContextMenu
+ node={node}
+ top={top}
+ left={left}
+ right={right}
+ bottom={bottom}
+ wrapperWidth={wrapperWidth}
+ wrapperHeight={wrapperHeight}
{...props}
>
{/* Header with title and action buttons */}
@@ -138,7 +101,7 @@ export default function ContextMenu({
</div>
{/* Transforms list */}
- <div className="flex-1 overflow-auto min-h-0">
+ <div className="flex-1 grow overflow-auto min-h-0">
{isLoading ? (
<div className="p-2 space-y-2">
{[...Array(3)].map((_, i) => (
@@ -188,7 +151,7 @@ export default function ContextMenu({
</div>
)}
</div>
- </div>
+ </BaseContextMenu>
);
}
diff --git a/flowsint-app/src/renderer/src/components/graphs/wall/wall.tsx b/flowsint-app/src/renderer/src/components/graphs/wall/wall.tsx
index 0510bb60..029b9c01 100644
--- a/flowsint-app/src/renderer/src/components/graphs/wall/wall.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/wall/wall.tsx
@@ -1,4 +1,3 @@
-"use client"
import type React from "react"
import { useState, useCallback, useRef, useEffect, memo, useMemo } from "react"
@@ -14,7 +13,6 @@ import {
BackgroundVariant,
// EdgeTypes,
MarkerType,
- EdgeTypes,
ConnectionMode,
} from "@xyflow/react"
import "@xyflow/react/dist/style.css"
@@ -29,7 +27,6 @@ import { useGraphControls } from "@/stores/graph-controls-store"
import { useNodesDisplaySettings } from "@/stores/node-display-settings"
import ContextMenu from './custom/context-menu';
import { useLayoutStore } from "@/stores/layout-store"
-import SimpleFloatingEdge from './custom/floating-edge';
const nodeTypes = {
custom: CustomNode,
@@ -317,7 +314,6 @@ const Wall = memo(({ theme, edges }: { theme: ColorMode, edges: GraphEdge[] }) =
<ReactFlow {...reactFlowProps}>
<Background variant={"dots" as BackgroundVariant} bgColor="var(--background)" />
{menu && <ContextMenu
- onClick={onPaneClick}
{...menu}
/>}
<MiniMap nodeBorderRadius={80} nodeClassName={"h-16 w-16 text-center"} nodeColor={(node) => colors[node.data.type as keyof typeof colors]} className="bg-background" position="bottom-right" pannable zoomable />
diff --git a/flowsint-app/src/renderer/src/components/investigations/new-investigation.tsx b/flowsint-app/src/renderer/src/components/investigations/new-investigation.tsx
index e681fb6b..9d85adb4 100644
--- a/flowsint-app/src/renderer/src/components/investigations/new-investigation.tsx
+++ b/flowsint-app/src/renderer/src/components/investigations/new-investigation.tsx
@@ -1,4 +1,3 @@
-"use client"
import type React from "react"
import { useState } from "react"
diff --git a/flowsint-app/src/renderer/src/components/layout/log-panel.tsx b/flowsint-app/src/renderer/src/components/layout/log-panel.tsx
index bce712a5..2d46031f 100644
--- a/flowsint-app/src/renderer/src/components/layout/log-panel.tsx
+++ b/flowsint-app/src/renderer/src/components/layout/log-panel.tsx
@@ -1,4 +1,3 @@
-"use client"
import { ScrollArea } from "../ui/scroll-area"
import { Badge } from "../ui/badge"
diff --git a/flowsint-app/src/renderer/src/components/nav-user.tsx b/flowsint-app/src/renderer/src/components/nav-user.tsx
index 836e07f8..56167d32 100644
--- a/flowsint-app/src/renderer/src/components/nav-user.tsx
+++ b/flowsint-app/src/renderer/src/components/nav-user.tsx
@@ -1,4 +1,3 @@
-"use client"
import {
LogOut,
diff --git a/flowsint-app/src/renderer/src/components/transforms/context-menu.tsx b/flowsint-app/src/renderer/src/components/transforms/context-menu.tsx
new file mode 100644
index 00000000..0cd36f6e
--- /dev/null
+++ b/flowsint-app/src/renderer/src/components/transforms/context-menu.tsx
@@ -0,0 +1,76 @@
+import React, { memo, useCallback, useState } from 'react';
+import { Button } from '@/components/ui/button';
+import { Info, Pencil, Star, Trash } from 'lucide-react';
+import { GraphNode } from '@/stores/graph-store';
+import { cn } from '@/lib/utils';
+import BaseContextMenu from '@/components/xyflow/context-menu';
+import { TransformNode, useTransformStore } from '@/stores/transform-store';
+
+interface GraphContextMenuProps {
+ node: GraphNode | TransformNode;
+ top: number;
+ left: number;
+ right: number;
+ bottom: number;
+ wrapperWidth: number;
+ wrapperHeight: number;
+ onEdit?: () => void;
+ onDelete?: () => void;
+ setMenu: (menu: any | null) => void;
+ [key: string]: any;
+}
+
+export default function ContextMenu({
+ node,
+ top,
+ left,
+ right,
+ bottom,
+ wrapperWidth,
+ wrapperHeight,
+ onEdit,
+ onDelete,
+ setMenu,
+ ...props
+}: GraphContextMenuProps) {
+
+ const setOpenParamsDialog = useTransformStore(s => s.setOpenParamsDialog)
+ const handleOpenParamsModal = useCallback(() => {
+ setOpenParamsDialog(true, node as TransformNode)
+ setMenu(null)
+ }, [setOpenParamsDialog, node, setMenu])
+
+ return (
+ <BaseContextMenu
+ node={node}
+ top={top}
+ left={left}
+ right={right}
+ bottom={bottom}
+ wrapperWidth={wrapperWidth}
+ wrapperHeight={wrapperHeight}
+ {...props}
+ >
+ {/* Header with title and action buttons */}
+ <div className="px-3 py-2 border-b gap-1 border-border flex items-center justify-between flex-shrink-0">
+ <div className='flex text-xs items-center gap-1 truncate'>
+ <span className='block truncate'>{node.data.name}</span>
+ </div>
+ </div>
+ <div className='flex flex-col gap-1 p-1'>
+ {/* Transforms list */}
+ <button
+ onClick={handleOpenParamsModal}
+ className="w-full flex items-center gap-2 p-2 rounded-sm hover:bg-muted text-left transition-colors"
+ >
+ <Pencil className="h-4 w-4 opacity-60" /> Edit
+ </button>
+ <button
+ className="w-full flex items-center gap-2 p-2 rounded-sm hover:bg-muted text-left transition-colors"
+ >
+ <Trash className="h-4 w-4 text-red-500 opacity-60" /> Delete
+ </button>
+ </div>
+ </BaseContextMenu >
+ );
+}
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/transforms/controls.tsx b/flowsint-app/src/renderer/src/components/transforms/controls.tsx
index 332503cd..7468e9d1 100644
--- a/flowsint-app/src/renderer/src/components/transforms/controls.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/controls.tsx
@@ -1,4 +1,3 @@
-"use client"
import { Button } from "@/components/ui/button"
import { Panel } from "@xyflow/react"
diff --git a/flowsint-app/src/renderer/src/components/transforms/editor.tsx b/flowsint-app/src/renderer/src/components/transforms/editor.tsx
index 44c678c5..c337136f 100644
--- a/flowsint-app/src/renderer/src/components/transforms/editor.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/editor.tsx
@@ -1,4 +1,3 @@
-"use client"
import type React from "react"
import { useState, useCallback, useRef, useEffect, memo } from "react"
@@ -17,9 +16,10 @@ import {
MiniMap,
} from "@xyflow/react"
import "@xyflow/react/dist/style.css"
-import { TrashIcon, Play, Pause, SkipForward, RefreshCw } from "lucide-react"
+import { Play, Pause, SkipForward, RefreshCw } from "lucide-react"
import { Button } from "@/components/ui/button"
import ScannerNode from "./scanner-node"
+import TypeNode from "./type-node"
import { type ScannerNodeData } from "@/types/transform"
import { categoryColors } from "./scanner-data"
import { FlowControls } from "./controls"
@@ -40,9 +40,12 @@ import {
} from "@/components/ui/select"
import { useTheme } from "../theme-provider"
import ParamsDialog from "./params-dialog"
+import TransformSheet from "./transform-sheet"
+import ContextMenu from "./context-menu"
const nodeTypes: NodeTypes = {
scanner: ScannerNode,
+ type: TypeNode,
}
interface TransformEditorProps {
@@ -80,7 +83,6 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
// #### Transform Store State ####
const nodes = useTransformStore(state => state.nodes)
const edges = useTransformStore(state => state.edges)
- const selectedNode = useTransformStore(state => state.selectedNode)
const loading = useTransformStore(state => state.loading)
const setNodes = useTransformStore(state => state.setNodes)
const setEdges = useTransformStore(state => state.setEdges)
@@ -89,7 +91,17 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
const onConnect = useTransformStore(state => state.onConnect)
const setSelectedNode = useTransformStore(state => state.setSelectedNode)
const setLoading = useTransformStore(state => state.setLoading)
- const deleteNode = useTransformStore(state => state.deleteNode)
+
+ const [menu, setMenu] = useState<{
+ node: TransformNode;
+ top: number;
+ left: number;
+ right: number;
+ bottom: number;
+ wrapperWidth: number;
+ wrapperHeight: number;
+ setMenu: (menu: any | null) => void;
+ } | null>(null);
// #### Initialization Effects ####
// Initialize store with initial data
@@ -101,18 +113,72 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
}
}, [initialNodes, initialEdges, setNodes, setEdges])
+ const onNodeContextMenu = useCallback(
+ (event: React.MouseEvent, node: Node) => {
+ // Prevent native context menu from showing
+ event.preventDefault();
+
+ // Calculate position of the context menu. We want to make sure it
+ // doesn't get positioned off-screen.
+ if (!reactFlowWrapper.current) return;
+
+ const pane = reactFlowWrapper.current.getBoundingClientRect();
+ const relativeX = event.clientX - pane.left;
+ const relativeY = event.clientY - pane.top;
+
+ // Calculate available space in each direction
+ const menuWidth = 320; // Default menu width
+ const menuHeight = 250; // Use a more reasonable height for overflow calculation
+ const padding = 20; // Minimum padding from edges
+
+ // Determine if menu would overflow in each direction
+ const wouldOverflowRight = relativeX + menuWidth + padding > pane.width;
+ const wouldOverflowBottom = relativeY + menuHeight + padding > pane.height;
+
+ // Calculate final position
+ let finalTop = 0;
+ let finalLeft = 0;
+ let finalRight = 0;
+ let finalBottom = 0;
+
+ if (wouldOverflowRight) {
+ finalRight = pane.width - relativeX;
+ } else {
+ finalLeft = relativeX;
+ }
+
+ if (wouldOverflowBottom) {
+ finalBottom = pane.height - relativeY;
+ } else {
+ finalTop = relativeY;
+ }
+
+ setMenu({
+ node: node as TransformNode,
+ top: finalTop,
+ left: finalLeft,
+ right: finalRight,
+ bottom: finalBottom,
+ wrapperWidth: pane.width,
+ wrapperHeight: pane.height,
+ setMenu: setMenu,
+ });
+ },
+ [setMenu],
+ );
+
// Center view on selected node
- useEffect(() => {
- if (selectedNode && reactFlowInstance) {
- const nodeWidth = selectedNode.measured?.width ?? 0
- const nodeHeight = selectedNode.measured?.height ?? 0
- setCenter(
- selectedNode.position.x + nodeWidth / 2,
- selectedNode.position.y + nodeHeight / 2 + 20,
- { duration: 500, zoom: 1.5 }
- )
- }
- }, [selectedNode, reactFlowInstance, setCenter])
+ // useEffect(() => {
+ // if (selectedNode && reactFlowInstance) {
+ // const nodeWidth = selectedNode.measured?.width ?? 0
+ // const nodeHeight = selectedNode.measured?.height ?? 0
+ // setCenter(
+ // selectedNode.position.x + nodeWidth / 2,
+ // selectedNode.position.y + nodeHeight / 2 + 20,
+ // { duration: 500, zoom: 1.5 }
+ // )
+ // }
+ // }, [selectedNode, reactFlowInstance, setCenter])
// #### Drag and Drop Handlers ####
const onDragOver = useCallback((event: React.DragEvent<HTMLDivElement>) => {
@@ -142,10 +208,11 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
})
const newNode: TransformNode = {
id: `${scannerData.name}-${Date.now()}`,
- type: "scanner",
+ type: scannerData.type === "type" ? "type" : "scanner",
position,
data: {
- class_name: scannerData.name,
+ id: scannerData.id,
+ class_name: scannerData.class_name,
module: scannerData.module || "",
key: scannerData.name,
color: categoryColors[scannerData.category] || "#94a3b8",
@@ -177,19 +244,20 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
(_: React.MouseEvent, node: Node) => {
const typedNode = node as TransformNode
setSelectedNode(typedNode)
- const nodeWidth = typedNode.measured?.width ?? 0
- const nodeHeight = typedNode.measured?.height ?? 0
- setCenter(typedNode.position.x + nodeWidth / 2, typedNode.position.y + nodeHeight / 2 + 20, {
- duration: 500,
- zoom: 1.5,
- })
+ // const nodeWidth = typedNode.measured?.width ?? 0
+ // const nodeHeight = typedNode.measured?.height ?? 0
+ // setCenter(typedNode.position.x + nodeWidth / 2, typedNode.position.y + nodeHeight / 2 + 20, {
+ // duration: 500,
+ // zoom: 1.5,
+ // })
},
[setCenter, setSelectedNode],
)
const onPaneClick = useCallback(() => {
setSelectedNode(null)
- }, [setSelectedNode])
+ setMenu(null)
+ }, [setSelectedNode, setMenu])
// #### Layout and Node Management ####
const onLayout = useCallback(() => {
@@ -218,12 +286,6 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
}, 100)
}, [nodes, edges, setNodes, setEdges, fitView])
- const handleDeleteNode = useCallback(() => {
- if (selectedNode) {
- deleteNode(selectedNode.id)
- }
- }, [selectedNode, deleteNode])
-
// #### Transform CRUD Operations ####
const saveTransform = useCallback(
async (name: string, description: string) => {
@@ -392,11 +454,11 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
} else {
// End of simulation
fitView({ duration: 500 })
- setIsSimulating(false)
+ resetSimulation()
}
return () => clearTimeout(timer)
- }, [isSimulating, currentStepIndex, simulationSpeed, loading, transformBranches, updateNodeState])
+ }, [isSimulating, currentStepIndex, simulationSpeed, loading, transformBranches, updateNodeState, setCurrentStepIndex])
// #### Simulation Control Functions ####
const startSimulation = () => {
@@ -507,6 +569,7 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
onDragOver={onDragOver}
onNodeClick={onNodeClick}
onPaneClick={onPaneClick}
+ onNodeContextMenu={onNodeContextMenu}
nodeTypes={nodeTypes}
fitView
proOptions={{ hideAttribution: true }}
@@ -557,12 +620,18 @@ const TransformEditorFlow = memo(({ initialEdges, initialNodes, theme, transform
/>
<Background bgColor="var(--background)" />
<ParamsDialog />
+ {menu && <ContextMenu
+ {...menu}
+ >
+ <div>
+
+ fdff</div>
+ </ContextMenu>}
<MiniMap className="bg-background" position="bottom-left" pannable zoomable />
- {selectedNode && (
- <NodePanel node={selectedNode} onDelete={handleDeleteNode} />
- )}
+
</ReactFlow>
</div>
+ <TransformSheet onLayout={onLayout} />
<TransformModal open={showModal} onOpenChange={setShowModal} onSave={saveTransform} isLoading={loading} />
</>
)
@@ -598,31 +667,6 @@ function TransformEditor({
)
}
-// #### Node Panel Component ####
-const NodePanel = memo(({ node, onDelete }: { node: TransformNode; onDelete: () => void }) => (
- <Panel position="bottom-right" className="bg-card p-3 rounded-md shadow-md border w-72">
- <div className="flex justify-between items-start mb-2">
- <h3 className="font-medium">{node.data.name}</h3>
- <Button variant="ghost" size="icon" className="h-6 w-6" onClick={onDelete}>
- <TrashIcon className="h-4 w-4" />
- </Button>
- </div>
- <div className="text-sm space-y-2">
- <p>
- <span className="font-medium">Module:</span> {node.data.module}
- </p>
- <p>
- <span className="font-medium">Key:</span> {node.data.key}
- </p>
- {node.data.doc && (
- <p>
- <span className="font-medium">Description:</span> {node.data.doc}
- </p>
- )}
- </div>
- </Panel>
-))
-
-NodePanel.displayName = "NodePanel"
+
export default TransformEditor
diff --git a/flowsint-app/src/renderer/src/components/transforms/params-dialog.tsx b/flowsint-app/src/renderer/src/components/transforms/params-dialog.tsx
index 45273101..c6fcd40a 100644
--- a/flowsint-app/src/renderer/src/components/transforms/params-dialog.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/params-dialog.tsx
@@ -60,19 +60,17 @@ const ParamsDialog = () => {
<Dialog open={openParamsDialog} onOpenChange={setOpenParamsDialog}>
<DialogContent className="sm:max-w-[725px]">
<DialogHeader>
- <DialogTitle>Configure Transform</DialogTitle>
- <DialogDescription>Configure parameters and settings for your transform.</DialogDescription>
+ <DialogTitle>Configure <span className="text-primary">{selectedNode.data.class_name}</span></DialogTitle>
+ <DialogDescription>{selectedNode.data.doc}</DialogDescription>
</DialogHeader>
-
<Tabs defaultValue="parameters" className="w-full">
<TabsList className="grid w-full grid-cols-2">
<TabsTrigger value="parameters">Parameters</TabsTrigger>
<TabsTrigger value="settings">Settings</TabsTrigger>
</TabsList>
-
<TabsContent value="parameters" className="space-y-4 mt-4">
<div className="grid gap-4">
- {selectedNode.data.params_schema.map((param: ScannerParamSchemaItem) => (
+ {selectedNode?.data?.params_schema?.map((param: ScannerParamSchemaItem) => (
<div className="space-y-2" key={param.name}>
<div className="flex items-start flex-col">
<Label htmlFor={param.name} className="text-sm font-medium">
diff --git a/flowsint-app/src/renderer/src/components/transforms/raw-material.tsx b/flowsint-app/src/renderer/src/components/transforms/raw-material.tsx
index bb814997..4efde110 100644
--- a/flowsint-app/src/renderer/src/components/transforms/raw-material.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/raw-material.tsx
@@ -13,7 +13,7 @@ export default function RawMaterial() {
const { data: materials, isLoading, error } = useQuery({
queryKey: ["raw_material"],
- queryFn: transformService.getRawMaterial,
+ queryFn: () => transformService.getRawMaterial(),
})
const [searchTerm, setSearchTerm] = useState<string>("")
diff --git a/flowsint-app/src/renderer/src/components/transforms/save-modal.tsx b/flowsint-app/src/renderer/src/components/transforms/save-modal.tsx
index 18dc81f2..8ee561ef 100644
--- a/flowsint-app/src/renderer/src/components/transforms/save-modal.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/save-modal.tsx
@@ -1,4 +1,3 @@
-"use client"
import { useState } from "react"
import { Button } from "@/components/ui/button"
diff --git a/flowsint-app/src/renderer/src/components/transforms/scanner-item.tsx b/flowsint-app/src/renderer/src/components/transforms/scanner-item.tsx
index 22a078e9..57cfe734 100644
--- a/flowsint-app/src/renderer/src/components/transforms/scanner-item.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/scanner-item.tsx
@@ -1,14 +1,14 @@
-"use client"
import type React from "react"
import { memo, useCallback, useState } from "react"
import { Button } from "@/components/ui/button"
-import { Info, GripVertical, KeySquare } from "lucide-react"
-import { TooltipProvider } from "@/components/ui/tooltip"
+import { Info, GripVertical, KeySquare, TriangleAlert } from "lucide-react"
+import { TooltipProvider, Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"
import { useNodesDisplaySettings } from "@/stores/node-display-settings"
import { Badge } from "../ui/badge"
import { type Scanner, type ScannerItemProps } from "@/types/transform"
+import { useIcon } from "@/hooks/use-icon"
// Custom equality function for ScannerItem
function areEqual(prevProps: ScannerItemProps, nextProps: ScannerItemProps) {
@@ -26,6 +26,8 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
const colors = useNodesDisplaySettings(s => s.colors)
const borderInputColor = colors[scanner.inputs.type.toLowerCase()]
const borderOutputColor = colors[scanner.outputs.type.toLowerCase()]
+ const Icon = scanner.type === "type" ? useIcon(scanner.outputs.type.toLowerCase() as string, null) : null
+
const [isDialogOpen, setIsDialogOpen] = useState(false)
@@ -39,6 +41,8 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
[scanner, category],
)
+ const isConfigurationRequired = scanner.requires_key
+
return (
<TooltipProvider>
<Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>
@@ -54,7 +58,11 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
<GripVertical className="h-5 w-5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" />
</div>
<div className="space-y-1 truncate">
- <h3 className="text-sm font-medium truncate text-ellipsis">{scanner.class_name}</h3>
+ <div className="flex items-center gap-2 truncate text-ellipsis">
+ {Icon && <Icon size={24} />}
+ <h3 className="text-sm font-medium truncate text-ellipsis">{scanner.class_name}</h3>
+ </div>
+ <p className="text-xs font-normal truncate text-ellipsis opacity-60">{scanner.doc}</p>
{scanner.type !== "type" &&
<div className="mt-2 text-xs">
<div className="flex items-center gap-1">
@@ -76,9 +84,16 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
</DialogTrigger>
</div>
</div>
- {scanner.requires_key &&
+ {isConfigurationRequired &&
<div className="absolute bottom-3 right-3">
- <KeySquare className="h-4 w-4 text-yellow-500" />
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <TriangleAlert className="h-4 w-4 text-yellow-500" />
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Configuration required</p>
+ </TooltipContent>
+ </Tooltip>
</div>}
</div>
<DialogContent className="sm:max-w-[725px] max-h-[90vh] overflow-y-auto">
@@ -89,11 +104,12 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
</DialogTitle>
</DialogHeader>
<div className="grid gap-4 py-4">
- {scanner.requires_key &&
- <Badge variant={"outline"} className=" top-3 right-3">
- Key required <KeySquare className="h-4 w-4 text-yellow-500" />
- </Badge>
- }
+ {isConfigurationRequired &&
+ <div>
+ <Badge variant={"outline"} className=" top-3 right-3">
+ Configuration required <TriangleAlert className="h-4 w-4 text-orange-500" />
+ </Badge>
+ </div>}
<div className="space-y-2">
<h4 className="font-medium text-sm" style={{ color: borderInputColor }}>Description</h4>
<p className="text-sm text-muted-foreground">{scanner.doc || "No description available"}</p>
@@ -105,7 +121,7 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
<div className="space-y-2">
<h4 className="font-medium text-sm" style={{ color: borderInputColor }}>Input Properties</h4>
<div className="space-y-1">
- {scanner.inputs.properties.map((prop, index) => (
+ {scanner?.inputs?.properties?.map((prop, index) => (
<div key={index} className="text-sm">
<span className="font-medium">{prop.name}:</span>{" "}
<span className="text-muted-foreground">{prop.type}</span>
@@ -116,7 +132,7 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
<div className="space-y-2">
<h4 className="font-medium text-sm" style={{ color: borderOutputColor }}>Output Properties</h4>
<div className="space-y-1">
- {scanner.outputs.properties.map((prop, index) => (
+ {scanner?.outputs?.properties?.map((prop, index) => (
<div key={index} className="text-sm">
<span className="font-medium">{prop.name}:</span>{" "}
<span className="text-muted-foreground">{prop.type}</span>
@@ -124,9 +140,6 @@ const ScannerItem = memo(({ scanner, category }: ScannerItemProps) => {
))}
</div>
</div>
- <div className="space-y-2">
- {JSON.stringify(scanner)}
- </div>
</div>
</DialogContent>
</Dialog>
diff --git a/flowsint-app/src/renderer/src/components/transforms/scanner-node.tsx b/flowsint-app/src/renderer/src/components/transforms/scanner-node.tsx
index ac7e0304..89d4e4da 100644
--- a/flowsint-app/src/renderer/src/components/transforms/scanner-node.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/scanner-node.tsx
@@ -1,15 +1,16 @@
import { memo, useCallback } from "react"
import { Position } from "@xyflow/react"
-import { LabeledHandle } from "../ui/labeled-handle"
import { Badge } from "../ui/badge"
-import { BaseNodeSchema } from "../ui/base-node"
-import { NodeStatusIndicator } from "../ui/node-status-indicator"
+import { BaseNode } from "../xyflow/base-node"
+import { NodeStatusIndicator } from "../xyflow/node-status-indicator"
import { useNodesDisplaySettings } from "@/stores/node-display-settings"
-import { useIcon } from "@/hooks/use-icon"
import { cn } from "@/lib/utils"
-import { KeySquare } from "lucide-react"
+import { Plus, TriangleAlert } from "lucide-react"
import { type ScannerNodeProps } from "@/types/transform"
import { TransformNode, useTransformStore } from "@/stores/transform-store"
+import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip"
+import { Button } from "../ui/button"
+import { ButtonHandle } from "../xyflow/button-handle"
// Custom equality function to prevent unnecessary re-renders
function areEqual(prevProps: ScannerNodeProps, nextProps: ScannerNodeProps) {
@@ -41,20 +42,17 @@ const getStateColor = (state?: string) => {
}
}
-// Memoized scanner node component with custom equality check
+// Scanner node component for transform/scanner nodes only
const ScannerNode = memo(({ data, selected, isConnectable }: ScannerNodeProps) => {
const colors = useNodesDisplaySettings(s => s.colors)
const inputColor = colors[data.inputs.type.toLowerCase()]
const outputColor = colors[data.outputs.type.toLowerCase()]
const opacity = data.computationState === "pending" ? 0.5 : 1
- const InputIconComponent = useIcon(data.inputs.type.toLowerCase() as string, null);
- const OutputIconComponent = useIcon(data.outputs.type.toLowerCase() as string, null);
- const setOpenParamsDialog = useTransformStore(s => s.setOpenParamsDialog)
-
- const handleOpenParamsModal = useCallback(() => {
- setOpenParamsDialog(true, data as unknown as TransformNode)
- }, [setOpenParamsDialog, data])
+ const setOpenTransformSheet = useTransformStore(state => state.setOpenTransformSheet)
+ const handleAddConnector = useCallback(() => {
+ setOpenTransformSheet(true, data as unknown as TransformNode)
+ }, [setOpenTransformSheet, data])
const getStatusVariant = (state?: string) => {
switch (state) {
@@ -70,63 +68,102 @@ const ScannerNode = memo(({ data, selected, isConnectable }: ScannerNodeProps) =
return undefined
}
}
+ const isConfigurationRequired = data.requires_key
return (
- <NodeStatusIndicator variant={getStatusVariant(data.computationState)} showStatus={data.type !== "type"}>
- <BaseNodeSchema
- className={cn("shadow-md relative p-0 bg-background ", data.type === "type" ? "rounded-full !max-w-[240px]" : "rounded-md !max-w-[340px]")}
- style={{ borderLeftWidth: 5, borderRightWidth: 5, borderLeftColor: inputColor ?? outputColor, borderRightColor: outputColor, cursor: "grab", opacity }}
- selected={selected}
+ <NodeStatusIndicator variant={getStatusVariant(data.computationState)} showStatus={true}>
+ <BaseNode
+ className={cn("shadow-md relative p-0 bg-background rounded-md !w-[300px]")}
+ style={{
+ borderLeftWidth: 5,
+ borderRightWidth: 5,
+ borderLeftColor: inputColor ?? outputColor,
+ borderRightColor: outputColor,
+ cursor: "grab",
+ opacity
+ }}
+ // selected={selected}
>
- {data.type !== "type" &&
- <div className="p-3 bg-card rounded-t-md">
- <div className="flex flex-col items-start gap-1 relative">
- <div className="absolute top-0 right-0 flex items-center gap-2">
- {data.computationState && data.type !== "type" && (
- <Badge className={getStateColor(data.computationState)}>
- {data.computationState}
- </Badge>
- )}
- </div>
- <div className="font-semibold text-sm">{data.class_name}</div>
- <p className="text-xs text-muted-foreground mt-2">{data.doc}</p>
+ <div className="p-3 bg-card rounded-t-md">
+ <div className="flex flex-col items-start gap-1 relative">
+ <div className="absolute top-0 right-0 flex items-center gap-2">
+ {data.computationState && (
+ <Badge className={getStateColor(data.computationState)}>
+ {data.computationState}
+ </Badge>
+ )}
</div>
+ <div className="font-semibold text-sm">{data.class_name}</div>
+ <p className="text-xs text-muted-foreground mt-2 line-clamp-2">{data.doc}</p>
</div>
- }
+ </div>
<div>
- <div className={cn("grid grid-cols-2 py-1", data.type === "type" ? "grid-cols-1 p-2" : "grid-cols-2")}>
+ <div className="grid grid-cols-2 py-1">
<div className="pl-0 pr-6">
- {data.inputs.properties.length > 0 && (
- <LabeledHandle
+ {data?.inputs?.properties?.length > 0 && (
+ <ButtonHandle
+ connectionCount={1}
+ showButton={false}
isConnectable={isConnectable}
id={data.inputs.type}
- label={<span className="flex items-center gap-1">{data.inputs.type}<InputIconComponent size={12} /></span>}
- description={`${data.inputs.properties.length} properties`}
+ label={data.inputs.type}
type="target"
position={Position.Left}
- />
+ >
+ <Button
+ onClick={handleAddConnector}
+ size="icon"
+ variant="secondary"
+ className="rounded-full"
+ >
+ <Plus size={10} />
+ </Button>
+ </ButtonHandle>
)}
</div>
<div className="pr-0">
- {data.outputs.properties.length > 0 && (
- <LabeledHandle
+ {data?.outputs?.properties?.length > 0 && (
+ <ButtonHandle
+ showButton={!data.computationState}
isConnectable={isConnectable}
id={data.outputs.type}
- label={<span className="flex items-center gap-1"><OutputIconComponent size={12} />{data.outputs.type}</span>}
- description={`${data.inputs.properties.length} properties`}
+ label={data.outputs.type}
type="source"
position={Position.Right}
- />
+ >
+ <Button
+ onClick={handleAddConnector}
+ size="icon"
+ variant="secondary"
+ className="rounded-full"
+ >
+ <Plus size={10} />
+ </Button>
+ </ButtonHandle>
)}
</div>
</div>
- {data.requires_key &&
- <Badge onClick={handleOpenParamsModal} variant={"outline"} className="absolute top-3 right-3">
- Key required <KeySquare className="h-4 w-4 text-yellow-500" />
- </Badge>
- }
+ <div className="flex items-center justify-between px-3 gap-1 py-1">
+ {data?.inputs?.properties?.length > 0 && (
+ <Badge variant="outline">{data.inputs.type}</Badge>
+ )}
+ {data?.outputs?.properties?.length > 0 && (
+ <Badge variant="outline">{data.outputs.type}</Badge>
+ )}
+ </div>
+ {isConfigurationRequired &&
+ <div className="absolute top-3 right-3">
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <TriangleAlert className="h-4 w-4 text-yellow-500" />
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Configuration required</p>
+ </TooltipContent>
+ </Tooltip>
+ </div>}
</div>
- </BaseNodeSchema>
+ </BaseNode>
</NodeStatusIndicator>
)
}, areEqual)
diff --git a/flowsint-app/src/renderer/src/components/transforms/test-transform.tsx b/flowsint-app/src/renderer/src/components/transforms/test-transform.tsx
index 8ce98077..caff3088 100644
--- a/flowsint-app/src/renderer/src/components/transforms/test-transform.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/test-transform.tsx
@@ -1,4 +1,3 @@
-"use client"
import { memo } from "react"
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "../ui/dialog"
diff --git a/flowsint-app/src/renderer/src/components/transforms/transform-item.tsx b/flowsint-app/src/renderer/src/components/transforms/transform-item.tsx
index d8343981..25f5304f 100644
--- a/flowsint-app/src/renderer/src/components/transforms/transform-item.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/transform-item.tsx
@@ -1,4 +1,3 @@
-"use client"
import { Badge } from "@/components/ui/badge"
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@/components/ui/card"
import { hexToRgba } from "@/lib/utils"
diff --git a/flowsint-app/src/renderer/src/components/transforms/transform-name-panel.tsx b/flowsint-app/src/renderer/src/components/transforms/transform-name-panel.tsx
index 1c791224..4290ea70 100644
--- a/flowsint-app/src/renderer/src/components/transforms/transform-name-panel.tsx
+++ b/flowsint-app/src/renderer/src/components/transforms/transform-name-panel.tsx
@@ -1,4 +1,3 @@
-"use client"
import { useState, useEffect, type KeyboardEvent, useRef } from "react"
import { Panel } from "@xyflow/react"
diff --git a/flowsint-app/src/renderer/src/components/transforms/transform-sheet.tsx b/flowsint-app/src/renderer/src/components/transforms/transform-sheet.tsx
new file mode 100644
index 00000000..d039a08b
--- /dev/null
+++ b/flowsint-app/src/renderer/src/components/transforms/transform-sheet.tsx
@@ -0,0 +1,204 @@
+import {
+ Sheet,
+ SheetContent,
+ SheetHeader,
+ SheetTitle,
+ SheetDescription,
+
+} from "@/components/ui/sheet"
+import { TransformEdge, TransformNode, useTransformStore } from "@/stores/transform-store"
+import { memo, useCallback, useMemo, useState } from "react"
+import { TriangleAlert, Loader2, ArrowRight } from "lucide-react"
+import { TooltipProvider, Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"
+import { useNodesDisplaySettings } from "@/stores/node-display-settings"
+import { Scanner } from "@/types/transform"
+import { useQuery } from "@tanstack/react-query"
+import { transformService } from "@/api/transfrom-service"
+import { Input } from "../ui/input"
+import { Alert, AlertDescription } from "../ui/alert"
+import { categoryColors } from "./scanner-data"
+
+const TransformSheet = ({ onLayout }: { onLayout: () => void }) => {
+ const openTransformSheet = useTransformStore(state => state.openTransformSheet)
+ const setOpenTransformSheet = useTransformStore(state => state.setOpenTransformSheet)
+ const selectedNode = useTransformStore(state => state.selectedNode)
+ const setNodes = useTransformStore(state => state.setNodes)
+ const setEdges = useTransformStore(state => state.setEdges)
+
+ const { data: materials, isLoading, error } = useQuery({
+ queryKey: ["raw_material", selectedNode?.data.outputs.type],
+ enabled: !!selectedNode?.data.outputs.type,
+ queryFn: () => transformService.getRawMaterialForType(selectedNode?.data.outputs.type.toLowerCase() || ""),
+ })
+ const [searchTerm, setSearchTerm] = useState<string>("")
+
+ const filteredScanners = useMemo(() => {
+ if (!materials?.items || !selectedNode) return []
+ if (!searchTerm.trim()) {
+ return materials?.items
+ }
+ const term = searchTerm.toLowerCase()
+ return materials?.items.filter((scanner: Scanner) => {
+ return (
+ scanner.class_name.toLowerCase().includes(term) ||
+ scanner.name.toLowerCase().includes(term) ||
+ scanner.module.toLowerCase().includes(term) ||
+ scanner.inputs.type.toLowerCase().includes(term) ||
+ scanner.outputs.type.toLowerCase().includes(term) ||
+ (scanner.doc && scanner.doc.toLowerCase().includes(term))
+ )
+ })
+ }, [searchTerm, materials?.items, selectedNode])
+
+ const handleClick = useCallback((scanner: Scanner) => {
+ if (!selectedNode) return
+ const position = { x: selectedNode.position.x + 350, y: selectedNode.position.y }
+ const newNode: TransformNode = {
+ id: `${scanner.name}-${Date.now()}`,
+ type: scanner.type === "type" ? "type" : "scanner",
+ position,
+ data: {
+ id: scanner.id,
+ class_name: scanner.class_name,
+ module: scanner.module || "",
+ key: scanner.name,
+ color: categoryColors[scanner.category] || "#94a3b8",
+ name: scanner.name,
+ category: scanner.category,
+ type: scanner.type,
+ inputs: scanner.inputs,
+ outputs: scanner.outputs,
+ doc: scanner.doc,
+ requires_key: scanner.requires_key,
+ params: scanner.params,
+ params_schema: scanner.params_schema
+ },
+ }
+ setNodes((prev) => ([...prev, newNode]))
+
+ const connection: TransformEdge = {
+ id: `${selectedNode.id}-${newNode.id}`,
+ source: selectedNode.id,
+ target: newNode.id,
+ sourceHandle: selectedNode.data.outputs.type,
+ targetHandle: scanner.inputs.type
+ }
+ setEdges((prev) => ([...prev, connection]))
+ // onLayout && onLayout()
+ setOpenTransformSheet(false)
+ }, [selectedNode, setNodes, setEdges, onLayout, setOpenTransformSheet])
+
+ return (
+ <div>
+ <Sheet open={openTransformSheet} onOpenChange={setOpenTransformSheet}>
+ <SheetContent className="sm:max-w-xl">
+ <SheetHeader>
+ <SheetTitle>Add connector to {selectedNode?.data.name}</SheetTitle>
+ <SheetDescription>Choose a transform to launch from the list below.</SheetDescription>
+ </SheetHeader>
+ <div className="p-4 grow overflow-auto">
+ <Input
+ placeholder="Search transforms..."
+ value={searchTerm}
+ onChange={(e) => setSearchTerm(e.target.value)}
+ className="mb-4"
+ />
+
+ {isLoading && (
+ <div className="flex items-center justify-center py-8">
+ <Loader2 className="h-6 w-6 animate-spin" />
+ <span className="ml-2">Loading transforms...</span>
+ </div>
+ )}
+
+ {error && (
+ <Alert variant="destructive" className="mb-4">
+ <TriangleAlert className="h-4 w-4" />
+ <AlertDescription>
+ Failed to load transforms. Please try again.
+ </AlertDescription>
+ </Alert>
+ )}
+
+ {!isLoading && !error && (
+ <div className="flex flex-col gap-2">
+ {filteredScanners.length === 0 ? (
+ <div className="text-center py-8 text-muted-foreground">
+ {searchTerm.trim() ? 'No transforms found matching your search.' : 'No transforms available for this node type.'}
+ </div>
+ ) : (
+ filteredScanners.map((scanner: Scanner) => (
+ <ScannerItem key={scanner.id} scanner={scanner} onClick={() => handleClick(scanner)} />
+ ))
+ )}
+ </div>
+ )}
+ </div>
+ </SheetContent>
+ </Sheet>
+ </div>
+ )
+}
+
+
+export default TransformSheet
+
+// Custom equality function for ScannerItem
+function areEqual(prevProps: { scanner: Scanner }, nextProps: { scanner: Scanner }) {
+ return (
+ prevProps.scanner.class_name === nextProps.scanner.class_name &&
+ prevProps.scanner.name === nextProps.scanner.name &&
+ prevProps.scanner.module === nextProps.scanner.module &&
+ prevProps.scanner.doc === nextProps.scanner.doc
+ )
+}
+
+// Memoized scanner item component for the sidebar
+const ScannerItem = memo(({ scanner, onClick }: { scanner: Scanner, onClick: () => void }) => {
+ const colors = useNodesDisplaySettings(s => s.colors)
+ const borderInputColor = colors[scanner.inputs.type.toLowerCase()]
+ const borderOutputColor = colors[scanner.outputs.type.toLowerCase()]
+
+ return (
+ <TooltipProvider>
+ <button
+ onClick={onClick}
+ className="p-3 rounded-md relative w-full overflow-hidden cursor-grab bg-card border ring-2 ring-transparent hover:ring-primary transition-all group"
+ style={{ borderLeftWidth: "5px", borderRightWidth: "5px", borderLeftColor: borderInputColor ?? borderOutputColor, borderRightColor: borderOutputColor, cursor: "grab" }}
+ >
+ <div className="flex justify-between grow items-start">
+ <div className="flex items-start gap-2 grow truncate text-ellipsis">
+ <div className="space-y-1 truncate text-left">
+ <h3 className="text-sm font-medium truncate text-ellipsis">{scanner.class_name}</h3>
+ <p className="text-sm font-normal opacity-60 truncate text-ellipsis">{scanner.doc}</p>
+ <div className="mt-2 flex items-center gap-2 text-xs">
+ <div className="flex items-center gap-1">
+ <span className="text-muted-foreground">Takes</span>
+ <span className="font-bold truncate text-ellipsis">{scanner.inputs.type}</span>
+ </div>
+ <span><ArrowRight className="h-3 w-3" /></span>
+ <div className="flex items-center gap-1">
+ <span className="text-muted-foreground">Returns</span>
+ <span className="font-bold truncate text-ellipsis">{scanner.outputs.type}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ {scanner.requires_key &&
+ <div className="absolute bottom-3 right-3">
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <TriangleAlert className="h-4 w-4 text-yellow-500" />
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>API key required</p>
+ </TooltipContent>
+ </Tooltip>
+ </div>}
+ </button>
+ </TooltipProvider >
+ )
+}, areEqual)
+
+ScannerItem.displayName = "ScannerItem"
diff --git a/flowsint-app/src/renderer/src/components/transforms/type-node.tsx b/flowsint-app/src/renderer/src/components/transforms/type-node.tsx
new file mode 100644
index 00000000..85c8ec83
--- /dev/null
+++ b/flowsint-app/src/renderer/src/components/transforms/type-node.tsx
@@ -0,0 +1,86 @@
+import { memo, useCallback } from "react"
+import { Position } from "@xyflow/react"
+import { useNodesDisplaySettings } from "@/stores/node-display-settings"
+import { useIcon } from "@/hooks/use-icon"
+import { cn } from "@/lib/utils"
+import { Plus } from "lucide-react"
+import { type ScannerNodeProps } from "@/types/transform"
+import { ButtonHandle } from "@/components/xyflow/button-handle"
+import { Button } from "../ui/button"
+
+
+import {
+ NodeTooltip,
+ NodeTooltipContent,
+ NodeTooltipTrigger,
+} from "@/components/xyflow/node-tooltip";
+import { BaseNode, BaseNodeContent } from "@/components/xyflow/base-node";
+import { TransformNode, useTransformStore } from "@/stores/transform-store"
+
+// Custom equality function to prevent unnecessary re-renders
+function areEqual(prevProps: ScannerNodeProps, nextProps: ScannerNodeProps) {
+ return (
+ prevProps.data.class_name === nextProps.data.class_name &&
+ prevProps.data.name === nextProps.data.name &&
+ prevProps.data.color === nextProps.data.color &&
+ prevProps.isConnectable === nextProps.isConnectable
+ )
+}
+
+// Type node component for data types (domains, websites, IPs, etc.)
+const TypeNode = memo(({ data, selected }: ScannerNodeProps) => {
+ const colors = useNodesDisplaySettings(s => s.colors)
+ const outputColor = colors[data.outputs.type.toLowerCase()]
+ const Icon = useIcon(data.outputs.type.toLowerCase() as string, null)
+ const setOpenTransformSheet = useTransformStore(state => state.setOpenTransformSheet)
+ const key = data.outputs.properties[0].name
+
+ const handleAddConnector = useCallback(() => {
+ setOpenTransformSheet(true, data as unknown as TransformNode)
+ }, [setOpenTransformSheet, data])
+
+ return (
+ <NodeTooltip>
+ <NodeTooltipContent isVisible={true} position={Position.Top} className="text-center bg-background text-foreground border shadow-md">
+ {data.name}
+ </NodeTooltipContent>
+ <BaseNode className={cn("shadow-md relative p-0 pl-1.5 bg-background !max-w-[240px]")}
+ style={{
+ borderWidth: 2,
+ borderColor: outputColor,
+ cursor: "grab",
+ borderRadius: "35px 10px 10px 35px"
+ }}
+ // selected={selected}
+ >
+ <BaseNodeContent>
+ <NodeTooltipTrigger>
+ <div className="p-4 flex items-center justify-center">
+ <Icon size={32} />
+ </div>
+ <ButtonHandle
+ type="source"
+ id={data.outputs.type}
+ position={Position.Right}
+ showButton={true}
+ label={key}
+ >
+ <Button
+ onClick={handleAddConnector}
+ size="icon"
+ variant="secondary"
+ className="rounded-full"
+ >
+ <Plus size={10} />
+ </Button>
+ </ButtonHandle>
+ </NodeTooltipTrigger>
+ </BaseNodeContent>
+ </BaseNode>
+ </NodeTooltip>
+ )
+}, areEqual)
+
+TypeNode.displayName = "TypeNode"
+
+export default TypeNode
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/ui/alert-dialog.tsx b/flowsint-app/src/renderer/src/components/ui/alert-dialog.tsx
index 0863e40d..5885897a 100644
--- a/flowsint-app/src/renderer/src/components/ui/alert-dialog.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/alert-dialog.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
diff --git a/flowsint-app/src/renderer/src/components/ui/avatar.tsx b/flowsint-app/src/renderer/src/components/ui/avatar.tsx
index 52dadb5b..fe146254 100644
--- a/flowsint-app/src/renderer/src/components/ui/avatar.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/avatar.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"
diff --git a/flowsint-app/src/renderer/src/components/ui/base-node.tsx b/flowsint-app/src/renderer/src/components/ui/base-node.tsx
deleted file mode 100644
index 5b5c408a..00000000
--- a/flowsint-app/src/renderer/src/components/ui/base-node.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { forwardRef, type HTMLAttributes } from "react";
-import { cn } from "@/lib/utils";
-
-export const BaseNode = forwardRef<
- HTMLDivElement,
- HTMLAttributes<HTMLDivElement> & { selected?: boolean }
->(({ className, selected, ...props }, ref) => (
- <div
- ref={ref}
- className={cn(
- "relative rounded-md ring ring-transparent bg-background p-2 flex flex-col items-center justify-between text-card-foreground truncate",
- className,
- selected ? "ring-primary shadow-lg" : "",
- "hover:ring-primary",
- )}
- tabIndex={0}
- {...props}
- />
-));
-
-BaseNode.displayName = "BaseNode";
-
-
-export const BaseNodeSchema = forwardRef<
- HTMLDivElement,
- HTMLAttributes<HTMLDivElement> & { selected?: boolean }
->(({ className, selected, style, ...props }, ref) => (
- <div
- ref={ref}
- style={style}
- className={cn(
- "relative rounded-md border-border bg-card p-5 text-card-foreground",
- className,
- selected ? "shadow-lg" : "",
- "hover:ring-1 hover:ring-primary",
- )}
- tabIndex={0}
- {...props}
- />
-));
-
-BaseNodeSchema.displayName = "BaseNodeSchema";
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/ui/carousel.tsx b/flowsint-app/src/renderer/src/components/ui/carousel.tsx
index 0e05a77e..278a19d7 100644
--- a/flowsint-app/src/renderer/src/components/ui/carousel.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/carousel.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import useEmblaCarousel, {
diff --git a/flowsint-app/src/renderer/src/components/ui/checkbox.tsx b/flowsint-app/src/renderer/src/components/ui/checkbox.tsx
index ef22a5d8..5decb128 100644
--- a/flowsint-app/src/renderer/src/components/ui/checkbox.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/checkbox.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
diff --git a/flowsint-app/src/renderer/src/components/ui/command.tsx b/flowsint-app/src/renderer/src/components/ui/command.tsx
index 8cb4ca7a..195a9d18 100644
--- a/flowsint-app/src/renderer/src/components/ui/command.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/command.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import { Command as CommandPrimitive } from "cmdk"
diff --git a/flowsint-app/src/renderer/src/components/ui/context-menu.tsx b/flowsint-app/src/renderer/src/components/ui/context-menu.tsx
index e29ad05f..feb7a9e0 100644
--- a/flowsint-app/src/renderer/src/components/ui/context-menu.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/context-menu.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
diff --git a/flowsint-app/src/renderer/src/components/ui/dropdown-menu.tsx b/flowsint-app/src/renderer/src/components/ui/dropdown-menu.tsx
index ec51e9cc..4ce8e00d 100644
--- a/flowsint-app/src/renderer/src/components/ui/dropdown-menu.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/dropdown-menu.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
diff --git a/flowsint-app/src/renderer/src/components/ui/input-otp.tsx b/flowsint-app/src/renderer/src/components/ui/input-otp.tsx
index 614f70e3..7ff903d7 100644
--- a/flowsint-app/src/renderer/src/components/ui/input-otp.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/input-otp.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import { OTPInput, OTPInputContext } from "input-otp"
diff --git a/flowsint-app/src/renderer/src/components/ui/label.tsx b/flowsint-app/src/renderer/src/components/ui/label.tsx
index fb5fbc3e..aef28ff9 100644
--- a/flowsint-app/src/renderer/src/components/ui/label.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/label.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
diff --git a/flowsint-app/src/renderer/src/components/ui/popover.tsx b/flowsint-app/src/renderer/src/components/ui/popover.tsx
index 01e468b6..40d08490 100644
--- a/flowsint-app/src/renderer/src/components/ui/popover.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/popover.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as PopoverPrimitive from "@radix-ui/react-popover"
diff --git a/flowsint-app/src/renderer/src/components/ui/radio-group.tsx b/flowsint-app/src/renderer/src/components/ui/radio-group.tsx
index 5e6778cb..2fb41270 100644
--- a/flowsint-app/src/renderer/src/components/ui/radio-group.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/radio-group.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
diff --git a/flowsint-app/src/renderer/src/components/ui/scroll-area.tsx b/flowsint-app/src/renderer/src/components/ui/scroll-area.tsx
index 8e4fa13f..4274ea61 100644
--- a/flowsint-app/src/renderer/src/components/ui/scroll-area.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/scroll-area.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
diff --git a/flowsint-app/src/renderer/src/components/ui/separator.tsx b/flowsint-app/src/renderer/src/components/ui/separator.tsx
index 275381ca..f331b1ae 100644
--- a/flowsint-app/src/renderer/src/components/ui/separator.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/separator.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
diff --git a/flowsint-app/src/renderer/src/components/ui/sidebar.tsx b/flowsint-app/src/renderer/src/components/ui/sidebar.tsx
index 1ee5a457..5db2f593 100644
--- a/flowsint-app/src/renderer/src/components/ui/sidebar.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/sidebar.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
diff --git a/flowsint-app/src/renderer/src/components/ui/slider.tsx b/flowsint-app/src/renderer/src/components/ui/slider.tsx
index 09391e86..234fd5b7 100644
--- a/flowsint-app/src/renderer/src/components/ui/slider.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/slider.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as SliderPrimitive from "@radix-ui/react-slider"
diff --git a/flowsint-app/src/renderer/src/components/ui/switch.tsx b/flowsint-app/src/renderer/src/components/ui/switch.tsx
index 6a2b5241..802c8a90 100644
--- a/flowsint-app/src/renderer/src/components/ui/switch.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/switch.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as SwitchPrimitive from "@radix-ui/react-switch"
diff --git a/flowsint-app/src/renderer/src/components/ui/tabs.tsx b/flowsint-app/src/renderer/src/components/ui/tabs.tsx
index 7ae5faae..df191637 100644
--- a/flowsint-app/src/renderer/src/components/ui/tabs.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/tabs.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
diff --git a/flowsint-app/src/renderer/src/components/ui/toggle-group.tsx b/flowsint-app/src/renderer/src/components/ui/toggle-group.tsx
index 5eed401b..86c2bef8 100644
--- a/flowsint-app/src/renderer/src/components/ui/toggle-group.tsx
+++ b/flowsint-app/src/renderer/src/components/ui/toggle-group.tsx
@@ -1,4 +1,3 @@
-"use client"
import * as React from "react"
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
diff --git a/flowsint-app/src/renderer/src/components/ui/base-handle.tsx b/flowsint-app/src/renderer/src/components/xyflow/base-handle.tsx
similarity index 84%
rename from flowsint-app/src/renderer/src/components/ui/base-handle.tsx
rename to flowsint-app/src/renderer/src/components/xyflow/base-handle.tsx
index 28f2ee81..d14b5073 100644
--- a/flowsint-app/src/renderer/src/components/ui/base-handle.tsx
+++ b/flowsint-app/src/renderer/src/components/xyflow/base-handle.tsx
@@ -12,7 +12,7 @@ export const BaseHandle = forwardRef<HTMLDivElement, BaseHandleProps>(
ref={ref}
{...props}
className={cn(
- "!h-[11px] !w-[11px] rounded-full border border-slate-300 bg-slate-100 transition dark:border-secondary dark:bg-secondary",
+ "!h-[11px] !w-[11px] rounded-full border border-slate-300 transition dark:border-secondary dark:bg-secondary",
className,
)}
{...props}
diff --git a/flowsint-app/src/renderer/src/components/xyflow/base-node.tsx b/flowsint-app/src/renderer/src/components/xyflow/base-node.tsx
new file mode 100644
index 00000000..20168519
--- /dev/null
+++ b/flowsint-app/src/renderer/src/components/xyflow/base-node.tsx
@@ -0,0 +1,93 @@
+import { cn } from "@/lib/utils";
+import { forwardRef, HTMLAttributes } from "react";
+
+export const BaseNode = forwardRef<
+ HTMLDivElement,
+ HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "relative rounded-md border bg-card text-card-foreground",
+ "hover:ring-1",
+ // React Flow displays node elements inside of a `NodeWrapper` component,
+ // which compiles down to a div with the class `react-flow__node`.
+ // When a node is selected, the class `selected` is added to the
+ // `react-flow__node` element. This allows us to style the node when it
+ // is selected, using Tailwind's `&` selector.
+ "[.react-flow\\_\\_node.selected_&]:border-muted-foreground",
+ "[.react-flow\\_\\_node.selected_&]:shadow-lg",
+ className,
+ )}
+ tabIndex={0}
+ {...props}
+ />
+));
+BaseNode.displayName = "BaseNode";
+
+/**
+ * A container for a consistent header layout intended to be used inside the
+ * `<BaseNode />` component.
+ */
+export const BaseNodeHeader = forwardRef<
+ HTMLElement,
+ HTMLAttributes<HTMLElement>
+>(({ className, ...props }, ref) => (
+ <header
+ ref={ref}
+ {...props}
+ className={cn(
+ "mx-0 my-0 -mb-1 flex flex-row items-center justify-between gap-2 px-3 py-2",
+ // Remove or modify these classes if you modify the padding in the
+ // `<BaseNode />` component.
+ className,
+ )}
+ />
+));
+BaseNodeHeader.displayName = "BaseNodeHeader";
+
+/**
+ * The title text for the node. To maintain a native application feel, the title
+ * text is not selectable.
+ */
+export const BaseNodeHeaderTitle = forwardRef<
+ HTMLHeadingElement,
+ HTMLAttributes<HTMLHeadingElement>
+>(({ className, ...props }, ref) => (
+ <h3
+ ref={ref}
+ data-slot="base-node-title"
+ className={cn("user-select-none flex-1 font-semibold", className)}
+ {...props}
+ />
+));
+BaseNodeHeaderTitle.displayName = "BaseNodeHeaderTitle";
+
+export const BaseNodeContent = forwardRef<
+ HTMLDivElement,
+ HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ data-slot="base-node-content"
+ className={cn("flex flex-col gap-y-2 p-3", className)}
+ {...props}
+ />
+));
+BaseNodeContent.displayName = "BaseNodeContent";
+
+export const BaseNodeFooter = forwardRef<
+ HTMLDivElement,
+ HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ data-slot="base-node-footer"
+ className={cn(
+ "flex flex-col items-center gap-y-2 border-t px-3 pb-3 pt-2",
+ className,
+ )}
+ {...props}
+ />
+));
+BaseNodeFooter.displayName = "BaseNodeFooter";
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/xyflow/button-handle.tsx b/flowsint-app/src/renderer/src/components/xyflow/button-handle.tsx
new file mode 100644
index 00000000..0213f638
--- /dev/null
+++ b/flowsint-app/src/renderer/src/components/xyflow/button-handle.tsx
@@ -0,0 +1,71 @@
+import { HandleProps, Position, useNodeConnections } from "@xyflow/react";
+import { BaseHandle } from "./base-handle";
+
+const wrapperClassNames: Record<Position, string> = {
+ [Position.Top]:
+ "flex-col-reverse left-1/2 -translate-y-full -translate-x-1/2",
+ [Position.Bottom]: "flex-col left-1/2 translate-y-[10px] -translate-x-1/2",
+ [Position.Left]:
+ "flex-row-reverse top-1/2 -translate-x-full -translate-y-1/2",
+ [Position.Right]: "top-1/2 -translate-y-1/2 translate-x-[10px]",
+};
+
+export const ButtonHandle = ({
+ showButton = true,
+ position = Position.Bottom,
+ label = "",
+ children,
+ connectionCount = 5,
+ color,
+ ...props
+}: HandleProps & {
+ showButton?: boolean,
+ label?: string,
+ connectionCount?: number,
+ color?: string
+}) => {
+ const wrapperClassName = wrapperClassNames[position || Position.Bottom];
+ const vertical = position === Position.Top || position === Position.Bottom;
+ const connections = useNodeConnections({
+ handleType: props.type,
+ });
+ const hasConnections = connections.length > 0;
+ const hasReachedConnectionLimit = connections.length >= connectionCount;
+
+ return (
+ <BaseHandle
+ isConnectable={!hasReachedConnectionLimit && props.isConnectable}
+ position={position}
+ id={props.id}
+ style={{
+ backgroundColor: hasReachedConnectionLimit ? "#d1d5db" : "#10b981",
+ }}
+ {...props}
+ >
+ {showButton && (
+ <div
+ className={`absolute group flex items-center ${wrapperClassName} ${!hasConnections ? 'pointer-events-none' : ''}`}
+ >
+ {/* Larger hitbox for hover detection when there are connections */}
+ {hasConnections && (
+ <div className="absolute inset-0 -m-4 pointer-events-auto" />
+ )}
+
+ {!hasConnections ?
+ <>
+ <div
+ className={`bg-gray-300 ${vertical ? "h-16 w-[1px]" : "h-[1px] w-16"}`}
+ />
+
+ <div className="nodrag nopan pointer-events-auto">{children}</div>
+ </> : !hasReachedConnectionLimit &&
+ <div className="nodrag opacity-0 scale-25 group-hover:opacity-100 group-hover:scale-75 transition-all duration-200 ease-out z-10 nopan pointer-events-auto">
+ {children}
+ </div>
+ }
+ {label && <span className="absolute max-w-15 bg-background z-1 truncate text-ellipsis top-1/2 -translate-y-1/2 left-1 text-xs text-muted-foreground">{label}</span>}
+ </div>
+ )}
+ </BaseHandle>
+ );
+};
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/xyflow/context-menu.tsx b/flowsint-app/src/renderer/src/components/xyflow/context-menu.tsx
new file mode 100644
index 00000000..fdf10c1d
--- /dev/null
+++ b/flowsint-app/src/renderer/src/components/xyflow/context-menu.tsx
@@ -0,0 +1,80 @@
+import React from 'react';
+import type { Node } from '@xyflow/react';
+
+interface ContextMenuProps<T extends Node = Node> {
+ node: T;
+ top: number;
+ left: number;
+ right: number;
+ bottom: number;
+ wrapperWidth: number;
+ wrapperHeight: number;
+ children: React.ReactNode;
+}
+
+export default function ContextMenu<T extends Node = Node>({
+ node,
+ top,
+ left,
+ right,
+ bottom,
+ wrapperWidth,
+ wrapperHeight,
+ children,
+ ...props
+}: ContextMenuProps<T>) {
+ // Calculate dynamic dimensions based on available space
+ const maxWidth = 320; // Default width (w-80)
+ const maxHeight = 500; // Default height (h-96)
+ const minWidth = 280; // Minimum width
+ const minHeight = 200; // Minimum height
+
+ // Calculate available space based on menu position and wrapper dimensions
+ let availableWidth = maxWidth;
+ let availableHeight = maxHeight;
+
+ if (left > 0) {
+ // Menu is positioned from left, so available width is from left to right edge
+ availableWidth = wrapperWidth - left - 20; // 20px padding from right edge
+ } else if (right > 0) {
+ // Menu is positioned from right, so available width is from left edge to right position
+ availableWidth = wrapperWidth - right - 20; // 20px padding from left edge
+ }
+
+ if (top > 0) {
+ // Menu is positioned from top, so available height is from top to bottom edge
+ availableHeight = wrapperHeight - top - 20; // 20px padding from bottom edge
+ } else if (bottom > 0) {
+ // Menu is positioned from bottom, so available height is from top edge to bottom position
+ availableHeight = wrapperHeight - bottom - 20; // 20px padding from top edge
+ }
+
+ // Determine dynamic dimensions
+ const dynamicWidth = Math.min(maxWidth, Math.max(minWidth, availableWidth));
+ const dynamicHeight = Math.min(maxHeight, Math.max(minHeight, availableHeight));
+
+ // Calculate dynamic styles
+ const dynamicStyles = {
+ width: `${dynamicWidth}px`,
+ maxHeight: `${dynamicHeight}px`,
+ top: top > 0 ? `${top}px` : 'auto',
+ left: left > 0 ? `${left}px` : 'auto',
+ right: right > 0 ? `${right}px` : 'auto',
+ bottom: bottom > 0 ? `${bottom}px` : 'auto',
+ };
+
+ const handleMenuClick = (e: React.MouseEvent) => {
+ e.stopPropagation();
+ };
+
+ return (
+ <div
+ style={dynamicStyles}
+ className="bg-background/90 backdrop-blur-sm border border-border flex flex-col rounded-lg shadow-lg absolute z-50"
+ onClick={handleMenuClick}
+ {...props}
+ >
+ {children}
+ </div>
+ );
+}
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/ui/labeled-handle.tsx b/flowsint-app/src/renderer/src/components/xyflow/labeled-handle.tsx
similarity index 92%
rename from flowsint-app/src/renderer/src/components/ui/labeled-handle.tsx
rename to flowsint-app/src/renderer/src/components/xyflow/labeled-handle.tsx
index 51eb8ef0..854a46ce 100644
--- a/flowsint-app/src/renderer/src/components/ui/labeled-handle.tsx
+++ b/flowsint-app/src/renderer/src/components/xyflow/labeled-handle.tsx
@@ -2,7 +2,7 @@ import { forwardRef, ReactNode, type HTMLAttributes } from "react";
import { cn } from "@/lib/utils";
import { type HandleProps } from "@xyflow/react";
-import { BaseHandle } from "@/components/ui/base-handle";
+import { BaseHandle } from "@/components/xyflow/base-handle";
import { Badge } from "@/components/ui/badge";
const flexDirections = {
diff --git a/flowsint-app/src/renderer/src/components/ui/node-status-indicator.tsx b/flowsint-app/src/renderer/src/components/xyflow/node-status-indicator.tsx
similarity index 100%
rename from flowsint-app/src/renderer/src/components/ui/node-status-indicator.tsx
rename to flowsint-app/src/renderer/src/components/xyflow/node-status-indicator.tsx
diff --git a/flowsint-app/src/renderer/src/components/xyflow/node-tooltip.tsx b/flowsint-app/src/renderer/src/components/xyflow/node-tooltip.tsx
new file mode 100644
index 00000000..bdaa234d
--- /dev/null
+++ b/flowsint-app/src/renderer/src/components/xyflow/node-tooltip.tsx
@@ -0,0 +1,111 @@
+import { cn } from "@/lib/utils";
+import { NodeToolbar, NodeToolbarProps } from "@xyflow/react";
+import React, {
+ createContext,
+ forwardRef,
+ HTMLAttributes,
+ useCallback,
+ useContext,
+ useState,
+} from "react";
+
+/* TOOLTIP CONTEXT ---------------------------------------------------------- */
+
+type TooltipContextType = {
+ isVisible: boolean;
+ showTooltip: () => void;
+ hideTooltip: () => void;
+};
+
+const TooltipContext = createContext<TooltipContextType | null>(null);
+
+/* TOOLTIP NODE ------------------------------------------------------------- */
+
+export const NodeTooltip = forwardRef<
+ HTMLDivElement,
+ HTMLAttributes<HTMLDivElement>
+>(({ children }, ref) => {
+ const [isVisible, setIsVisible] = useState(false);
+
+ const showTooltip = useCallback(() => setIsVisible(true), []);
+ const hideTooltip = useCallback(() => setIsVisible(false), []);
+
+ return (
+ <TooltipContext.Provider value={{ isVisible, showTooltip, hideTooltip }}>
+ <div ref={ref}>{children}</div>
+ </TooltipContext.Provider>
+ );
+});
+NodeTooltip.displayName = "NodeTooltip";
+
+/* TOOLTIP TRIGGER ---------------------------------------------------------- */
+
+export const NodeTooltipTrigger = forwardRef<
+ HTMLDivElement,
+ HTMLAttributes<HTMLDivElement>
+>((props, ref) => {
+ const tooltipContext = useContext(TooltipContext);
+ if (!tooltipContext) {
+ throw new Error("NodeTooltipTrigger must be used within NodeTooltip");
+ }
+ const { showTooltip, hideTooltip } = tooltipContext;
+
+ const onMouseEnter = useCallback(
+ (e: React.MouseEvent<HTMLDivElement>) => {
+ props.onMouseEnter?.(e);
+ showTooltip();
+ },
+ [props, showTooltip],
+ );
+
+ const onMouseLeave = useCallback(
+ (e: React.MouseEvent<HTMLDivElement>) => {
+ props.onMouseLeave?.(e);
+ hideTooltip();
+ },
+ [props, hideTooltip],
+ );
+
+ return (
+ <div
+ ref={ref}
+ onMouseEnter={onMouseEnter}
+ onMouseLeave={onMouseLeave}
+ {...props}
+ />
+ );
+});
+NodeTooltipTrigger.displayName = "NodeTooltipTrigger";
+
+/* TOOLTIP CONTENT ---------------------------------------------------------- */
+
+// /**
+// * A component that displays the tooltip content based on visibility context.
+// */
+
+export const NodeTooltipContent = forwardRef<HTMLDivElement, NodeToolbarProps>(
+ ({ children, position, className, ...props }, ref) => {
+ const tooltipContext = useContext(TooltipContext);
+ if (!tooltipContext) {
+ throw new Error("NodeTooltipContent must be used within NodeTooltip");
+ }
+ const { isVisible } = tooltipContext;
+
+ return (
+ <div ref={ref}>
+ <NodeToolbar
+ isVisible={isVisible}
+ className={cn(
+ "rounded-sm bg-primary p-2 text-primary-foreground",
+ className,
+ )}
+ tabIndex={1}
+ position={position}
+ {...props}
+ >
+ {children}
+ </NodeToolbar>
+ </div>
+ );
+ },
+);
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/hooks/use-debounce.ts b/flowsint-app/src/renderer/src/hooks/use-debounce.ts
index 7db2cc66..cd5e2ae6 100644
--- a/flowsint-app/src/renderer/src/hooks/use-debounce.ts
+++ b/flowsint-app/src/renderer/src/hooks/use-debounce.ts
@@ -1,4 +1,3 @@
-"use client"
import { useEffect, useState } from "react"
diff --git a/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts b/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts
index 57b711d8..dfe10f27 100644
--- a/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts
+++ b/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts
@@ -1,4 +1,3 @@
-"use client"
import { useEffect, useState } from "react"
diff --git a/flowsint-app/src/renderer/src/hooks/use-launch-transform.ts b/flowsint-app/src/renderer/src/hooks/use-launch-transform.ts
index 3f811eec..d2baaa82 100644
--- a/flowsint-app/src/renderer/src/hooks/use-launch-transform.ts
+++ b/flowsint-app/src/renderer/src/hooks/use-launch-transform.ts
@@ -1,4 +1,3 @@
-"use client"
import { toast } from "sonner"
import { useConfirm } from "@/components/use-confirm-dialog"
import { transformService } from "@/api/transfrom-service"
diff --git a/flowsint-app/src/renderer/src/stores/node-display-settings.ts b/flowsint-app/src/renderer/src/stores/node-display-settings.ts
index 2ae34fa0..33cf4a2d 100644
--- a/flowsint-app/src/renderer/src/stores/node-display-settings.ts
+++ b/flowsint-app/src/renderer/src/stores/node-display-settings.ts
@@ -1,4 +1,3 @@
-"use client"
import { create } from "zustand"
import { persist } from "zustand/middleware"
@@ -55,6 +54,7 @@ export type ItemType =
| "creditcard"
| "alias"
| "affiliation"
+ | "phrase"
export const ITEM_TYPES: ItemType[] = [
"individual",
@@ -108,7 +108,8 @@ export const ITEM_TYPES: ItemType[] = [
"bank",
"creditcard",
"alias",
- "affiliation"
+ "affiliation",
+ "phrase"
]
const DEFAULT_COLORS: Record<ItemType, string> = {
@@ -163,7 +164,8 @@ const DEFAULT_COLORS: Record<ItemType, string> = {
bank: "#F7D154", // gold
creditcard: "#0253A4", // warm yellow
alias: "#D4A5D4", // dusty violet
- affiliation: "#A6D0BF" // sage
+ affiliation: "#A6D0BF", // sage
+ phrase: "#D4A5D4" // warm beige
}
// Définition des icônes par défaut pour chaque type d'élément
@@ -219,7 +221,8 @@ const DEFAULT_ICONS: Record<ItemType, string> = {
bank: "🏦",
creditcard: "💳",
alias: "👤",
- affiliation: "🤝"
+ affiliation: "🤝",
+ phrase: "��"
};
const DEFAULT_SIZES: Record<ItemType, number> = {
@@ -274,7 +277,8 @@ const DEFAULT_SIZES: Record<ItemType, number> = {
bank: 7,
creditcard: 7,
alias: 7,
- affiliation: 7
+ affiliation: 7,
+ phrase: 7
}
interface NodesDisplaySettingsState {
diff --git a/flowsint-app/src/renderer/src/stores/transform-store.ts b/flowsint-app/src/renderer/src/stores/transform-store.ts
index e3f32aff..ec650a52 100644
--- a/flowsint-app/src/renderer/src/stores/transform-store.ts
+++ b/flowsint-app/src/renderer/src/stores/transform-store.ts
@@ -28,6 +28,7 @@ export interface TransformState {
// UI State
loading: boolean
openParamsDialog: boolean
+ openTransformSheet: boolean
// Node Actions
setNodes: (nodes: TransformNode[] | ((prev: TransformNode[]) => TransformNode[])) => void
onNodesChange: OnNodesChange
@@ -41,6 +42,7 @@ export interface TransformState {
// UI Actions
setLoading: (loading: boolean) => void
setOpenParamsDialog: (openParamsDialog: boolean, node?: TransformNode) => void
+ setOpenTransformSheet: (openTransformSheet: boolean, node?: TransformNode) => void
}
// ================================
@@ -71,6 +73,7 @@ export const useTransformStore = create<TransformState>((set, get) => ({
// UI State
loading: false,
openParamsDialog: false,
+ openTransformSheet: false,
// ================================
// NODE ACTIONS
// ================================
@@ -104,7 +107,7 @@ export const useTransformStore = create<TransformState>((set, get) => ({
})
},
onConnect: (connection: Connection) => {
- if (connection.sourceHandle !== connection.targetHandle) {
+ if ([connection.targetHandle, "Any"].includes(connection.sourceHandle)) {
toast.error(`Cannot connect ${connection.sourceHandle} to ${connection.targetHandle}.`)
return
}
@@ -136,4 +139,15 @@ export const useTransformStore = create<TransformState>((set, get) => ({
}
set({ openParamsDialog })
},
+ setOpenTransformSheet: (openTransformSheet, node) => {
+ // Only allow opening the dialog if there's a selected node
+ if (node) {
+ set({ selectedNode: node })
+ }
+ if (openTransformSheet && !get().selectedNode) {
+ toast.error("Please select a node first to add a connector.")
+ return
+ }
+ set({ openTransformSheet })
+ }
}))
diff --git a/flowsint-app/src/renderer/src/types/transform.ts b/flowsint-app/src/renderer/src/types/transform.ts
index 4903acef..8c02e2e7 100644
--- a/flowsint-app/src/renderer/src/types/transform.ts
+++ b/flowsint-app/src/renderer/src/types/transform.ts
@@ -25,6 +25,7 @@ export interface ScannerParamSchemaItem {
}
export interface Scanner {
+ id: string
class_name: string
category: string
name: string
diff --git a/flowsint-app/src/renderer/src/use-debounce.ts b/flowsint-app/src/renderer/src/use-debounce.ts
index 7db2cc66..cd5e2ae6 100644
--- a/flowsint-app/src/renderer/src/use-debounce.ts
+++ b/flowsint-app/src/renderer/src/use-debounce.ts
@@ -1,4 +1,3 @@
-"use client"
import { useEffect, useState } from "react"