From f72b77537914679a8fa79dee49fb123ceb02292b Mon Sep 17 00:00:00 2001 From: maikrolf <40924921+maikrolf@users.noreply.github.com> Date: Sun, 19 Jul 2026 15:35:18 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20codebase=20opschoning=20=E2=80=94?= =?UTF-8?q?=20type=20safety,=20error=20handling,=20central=20config,=20pag?= =?UTF-8?q?e=20splits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - categorie A: alle catch(e: any) → catch(e: unknown) met instanceof check - categorie B: stille .catch() logging toegevoegd (SWRegister, admin, upload, auth) - categorie C: hardcoded 192.168.1.176 IPs vervangen door env var defaults - categorie D: page files >250L gesplitst (history, settings, explorer, admin/payment, ipns, users, upload, dashboard) in helpers/components - categorie E: eslint-disable vervangen in SearchInput.tsx - src/lib/config.ts centrale config module (localhost defaults) - CSP in next.config.ts dynamisch via env var - deploy.sh: geen hardcoded IP meer (REQUIRED arg) - lib/api/ lib/auth/ lib/wallet/ lib/search-index/ lib/storage/ gesplitst in modules - ongebruikte bestanden verwijderd: api.ts, auth.tsx, wallet.ts, search-index.ts, PaymentPanel.tsx, SearchBar.tsx, proxy.ts, serve-static.js --- .dockerignore | 1 - .env.example | 24 + .gitignore | 4 + deploy.sh | 16 +- graphify-out/.graphify_labels.json | 1 - graphify-out/.graphify_python | 1 - graphify-out/.graphify_root | 1 - graphify-out/GRAPH_REPORT.md | 111 - graphify-out/_query.py | 20 - graphify-out/_query2.py | 17 - ...578fd6f3f30c40ae57eb4ee0d57f2dd440ed1.json | 1 - ...36e2bc09b9dd2d7e3f8a3ecf01ddf9aaeba38.json | 1 - ...9a097b30f87d4f5fc666c2e5bebe5f26a3713.json | 1 - graphify-out/cache/stat-index.json | 1 - graphify-out/cost.json | 12 - graphify-out/graph.html | 307 - graphify-out/graph.json | 6726 ----------------- graphify-out/manifest.json | 187 - next.config.ts | 25 + public/favicon.svg | 11 +- public/manifest.json | 25 +- public/sw.js | 158 +- serve-static.js | 26 - src/app/admin/page.tsx | 8 +- src/app/admin/payment/components.tsx | 107 + .../admin/payment/components/PricingView.tsx | 6 +- .../admin/payment/components/TiersView.tsx | 3 +- .../admin/payment/components/TokensView.tsx | 3 +- src/app/admin/payment/helpers.ts | 12 + src/app/admin/payment/page.tsx | 152 +- src/app/api/[...path]/__tests__/route.test.ts | 111 +- src/app/api/[...path]/handlers.ts | 69 + src/app/api/[...path]/proxy-ipfs.ts | 132 + src/app/api/[...path]/proxy-user.ts | 34 + src/app/api/[...path]/route.ts | 260 +- src/app/api/[...path]/types.ts | 5 + src/app/api/auth/challenge/route.ts | 10 +- src/app/api/auth/login/route.ts | 12 +- src/app/api/auth/logout/route.ts | 11 +- src/app/api/auth/password/route.ts | 13 +- src/app/api/events/route.ts | 14 +- src/app/api/payment/verify/route.ts | 30 +- src/app/dashboard/helpers.ts | 19 + src/app/dashboard/page.tsx | 11 +- .../explorer/components/DirectoryListing.tsx | 6 +- src/app/explorer/components/FilePreview.tsx | 22 +- src/app/explorer/components/GatewayLink.tsx | 4 +- src/app/explorer/components/PinBadge.tsx | 6 +- src/app/explorer/helpers.ts | 37 + src/app/explorer/page.tsx | 67 +- src/app/globals.css | 15 + src/app/history/components.tsx | 374 + src/app/history/helpers.ts | 29 + src/app/history/page.tsx | 406 +- src/app/ipns/helpers.ts | 3 + src/app/ipns/page.tsx | 13 +- src/app/layout-portal.tsx | 14 +- src/app/login/page.tsx | 4 +- src/app/page.tsx | 6 +- src/app/peers/page.tsx | 8 +- src/app/pins/page.tsx | 16 +- src/app/profile/page.tsx | 4 +- src/app/register/page.tsx | 4 +- src/app/settings/components.tsx | 60 + src/app/settings/helpers.ts | 44 + src/app/settings/page.tsx | 150 +- src/app/upload/components/CryptoUpload.tsx | 12 +- src/app/upload/components/QuickUpload.tsx | 10 +- src/app/upload/helpers.ts | 3 + src/app/upload/page.tsx | 47 +- src/app/usage/page.tsx | 5 +- src/app/users/helpers.ts | 6 + src/app/users/page.tsx | 30 +- src/components/PaymentPanel.tsx | 390 - src/components/PortalHeader.tsx | 8 +- src/components/PortalSidebar.tsx | 29 +- src/components/SWRegister.tsx | 4 +- src/components/SearchBar.tsx | 234 - src/components/payment/PaymentHeader.tsx | 73 + src/components/payment/PaymentPanel.tsx | 206 + src/components/payment/PaymentResult.tsx | 73 + src/components/payment/PricingDisplay.tsx | 160 + src/components/payment/index.ts | 4 + src/components/search/SearchBar.tsx | 147 + src/components/search/SearchInput.tsx | 119 + src/components/search/SearchResultItem.tsx | 77 + src/components/search/SearchResultsList.tsx | 53 + src/components/search/index.ts | 10 + src/lib/__tests__/api.test.ts | 483 ++ src/lib/__tests__/helpers.test.ts | 69 +- src/lib/__tests__/storage.test.ts | 339 + src/lib/__tests__/wallet.test.ts | 7 +- src/lib/{api.ts => api.ts.bak} | 6 +- src/lib/api/client.ts | 44 + src/lib/api/explorer.ts | 30 + src/lib/api/files.ts | 28 + src/lib/api/gateway.ts | 52 + src/lib/api/index.ts | 9 + src/lib/api/ipns.ts | 32 + src/lib/api/pins.ts | 32 + src/lib/api/users.ts | 28 + src/lib/auth-server.ts | 10 +- src/lib/auth.tsx | 133 - src/lib/auth/context.tsx | 105 + src/lib/auth/hooks.ts | 11 + src/lib/auth/index.ts | 3 + src/lib/auth/types.ts | 21 + src/lib/config.ts | 54 + src/lib/download.ts | 1 + src/lib/helpers.ts | 12 +- src/lib/limits.ts | 9 +- src/lib/payment/abi.ts | 6 +- src/lib/payment/context.tsx | 25 + src/lib/payment/index.ts | 2 + src/lib/payment/read-service.ts | 49 +- src/lib/payment/service-types.ts | 37 + src/lib/payment/write-service.ts | 24 +- src/lib/search-index.ts | 207 - src/lib/search-index/crawler.ts | 44 + src/lib/search-index/extract.ts | 24 + src/lib/search-index/index-manager.ts | 36 + src/lib/search-index/index.ts | 17 + src/lib/search-index/search.ts | 76 + src/lib/search-index/storage.ts | 29 + src/lib/search-index/types.ts | 19 + src/lib/storage.ts | 127 +- src/lib/storage/history.ts | 50 + src/lib/storage/settings.ts | 31 + src/lib/storage/types.ts | 35 + src/lib/swr.ts | 165 +- src/lib/swr/fetcher.ts | 15 + src/lib/swr/hooks.ts | 126 + src/lib/swr/types.ts | 24 + src/lib/wallet.ts | 208 - src/lib/wallet/actions.ts | 79 + src/lib/wallet/chain.ts | 18 + src/lib/wallet/events.ts | 47 + src/lib/wallet/format.ts | 8 + src/lib/wallet/index.ts | 12 + src/lib/wallet/provider.ts | 78 + src/lib/wallet/types.ts | 36 + src/{proxy.ts => middleware.ts} | 2 +- start-pm2.sh | 2 +- tsconfig.json | 7 +- 144 files changed, 4644 insertions(+), 10230 deletions(-) create mode 100644 .env.example delete mode 100644 graphify-out/.graphify_labels.json delete mode 100644 graphify-out/.graphify_python delete mode 100644 graphify-out/.graphify_root delete mode 100644 graphify-out/GRAPH_REPORT.md delete mode 100644 graphify-out/_query.py delete mode 100644 graphify-out/_query2.py delete mode 100644 graphify-out/cache/ast/07d2ec4b6bf62550169c81f9ecd578fd6f3f30c40ae57eb4ee0d57f2dd440ed1.json delete mode 100644 graphify-out/cache/ast/93155dc8f78a78f135a0687f64636e2bc09b9dd2d7e3f8a3ecf01ddf9aaeba38.json delete mode 100644 graphify-out/cache/ast/b4d183d0a729b9f4854201b7a3e9a097b30f87d4f5fc666c2e5bebe5f26a3713.json delete mode 100644 graphify-out/cache/stat-index.json delete mode 100644 graphify-out/cost.json delete mode 100644 graphify-out/graph.html delete mode 100644 graphify-out/graph.json delete mode 100644 graphify-out/manifest.json delete mode 100644 serve-static.js create mode 100644 src/app/admin/payment/components.tsx create mode 100644 src/app/admin/payment/helpers.ts create mode 100644 src/app/api/[...path]/handlers.ts create mode 100644 src/app/api/[...path]/proxy-ipfs.ts create mode 100644 src/app/api/[...path]/proxy-user.ts create mode 100644 src/app/api/[...path]/types.ts create mode 100644 src/app/dashboard/helpers.ts create mode 100644 src/app/explorer/helpers.ts create mode 100644 src/app/history/components.tsx create mode 100644 src/app/history/helpers.ts create mode 100644 src/app/ipns/helpers.ts create mode 100644 src/app/settings/components.tsx create mode 100644 src/app/settings/helpers.ts create mode 100644 src/app/upload/helpers.ts create mode 100644 src/app/users/helpers.ts delete mode 100644 src/components/PaymentPanel.tsx delete mode 100644 src/components/SearchBar.tsx create mode 100644 src/components/payment/PaymentHeader.tsx create mode 100644 src/components/payment/PaymentPanel.tsx create mode 100644 src/components/payment/PaymentResult.tsx create mode 100644 src/components/payment/PricingDisplay.tsx create mode 100644 src/components/payment/index.ts create mode 100644 src/components/search/SearchBar.tsx create mode 100644 src/components/search/SearchInput.tsx create mode 100644 src/components/search/SearchResultItem.tsx create mode 100644 src/components/search/SearchResultsList.tsx create mode 100644 src/components/search/index.ts create mode 100644 src/lib/__tests__/api.test.ts create mode 100644 src/lib/__tests__/storage.test.ts rename src/lib/{api.ts => api.ts.bak} (97%) create mode 100644 src/lib/api/client.ts create mode 100644 src/lib/api/explorer.ts create mode 100644 src/lib/api/files.ts create mode 100644 src/lib/api/gateway.ts create mode 100644 src/lib/api/index.ts create mode 100644 src/lib/api/ipns.ts create mode 100644 src/lib/api/pins.ts create mode 100644 src/lib/api/users.ts delete mode 100644 src/lib/auth.tsx create mode 100644 src/lib/auth/context.tsx create mode 100644 src/lib/auth/hooks.ts create mode 100644 src/lib/auth/index.ts create mode 100644 src/lib/auth/types.ts create mode 100644 src/lib/config.ts create mode 100644 src/lib/payment/context.tsx create mode 100644 src/lib/payment/service-types.ts delete mode 100644 src/lib/search-index.ts create mode 100644 src/lib/search-index/crawler.ts create mode 100644 src/lib/search-index/extract.ts create mode 100644 src/lib/search-index/index-manager.ts create mode 100644 src/lib/search-index/index.ts create mode 100644 src/lib/search-index/search.ts create mode 100644 src/lib/search-index/storage.ts create mode 100644 src/lib/search-index/types.ts create mode 100644 src/lib/storage/history.ts create mode 100644 src/lib/storage/settings.ts create mode 100644 src/lib/storage/types.ts create mode 100644 src/lib/swr/fetcher.ts create mode 100644 src/lib/swr/hooks.ts create mode 100644 src/lib/swr/types.ts delete mode 100644 src/lib/wallet.ts create mode 100644 src/lib/wallet/actions.ts create mode 100644 src/lib/wallet/chain.ts create mode 100644 src/lib/wallet/events.ts create mode 100644 src/lib/wallet/format.ts create mode 100644 src/lib/wallet/index.ts create mode 100644 src/lib/wallet/provider.ts create mode 100644 src/lib/wallet/types.ts rename src/{proxy.ts => middleware.ts} (98%) diff --git a/.dockerignore b/.dockerignore index 8578669..fd0ea69 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,6 +3,5 @@ node_modules .gitignore *.md .env -.env.local .next out diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..35379a6 --- /dev/null +++ b/.env.example @@ -0,0 +1,24 @@ +# ── IPFS Portal Environment Variables ── +# Copy to .env.local (dev) or .env.production (prod) + +# JWT secret for session cookies (REQUIRED in production — generate with: openssl rand -hex 32) +# JWT_SECRET= + +# Python User Management API +# USER_API_BASE=http://localhost:8444 +# USER_API_ADMIN_KEY= + +# Kubo RPC API (optional — if behind proxy) +# KUBO_API_URL=http://localhost:5001 +# KUBO_BASIC_AUTH=user:password + +# zkSync Local RPC + Explorer (smart contract chain 270) +# ZKSYNC_RPC_URL=http://localhost:3050 +# NEXT_PUBLIC_ZKSYNC_RPC_URL=http://localhost:3050 +# NEXT_PUBLIC_ZKSYNC_EXPLORER_URL=http://localhost:3050 + +# Contract address (default deployed on chain 270) +# PAYMENT_CONTRACT_ADDRESS=0xCBc6b8aeea129c206F4836799621C833Bf8B9BDe + +# IPFS Gateway (for share links) +# NEXT_PUBLIC_GATEWAY_URL=https://ipfs.maos.dedyn.io diff --git a/.gitignore b/.gitignore index a83c529..a35c3cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Tool artifacts +.omo/ +graphify-out/ + # Dependencies node_modules/ diff --git a/deploy.sh b/deploy.sh index 057840a..65d8e04 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,7 +1,7 @@ #!/bin/bash # ── IPFS Portal Deploy Script ── # Usage: ./deploy.sh [remote_host] [remote_port] -# remote_host: SSH target (default: maik@192.168.1.176) +# remote_host: SSH target (required — e.g. maik@your-server) # remote_port: SSH port (default: 22) # # Builds Docker image locally, pushes to Docker Hub or saves as tar, @@ -19,7 +19,7 @@ set -euo pipefail -REMOTE_HOST="${1:-maik@192.168.1.176}" +REMOTE_HOST="${1:?Usage: $0 [port]}" REMOTE_PORT="${2:-22}" IMAGE_NAME="maos/ipfs-portal" TAG="$(date +%Y%m%d-%H%M%S)" @@ -81,10 +81,12 @@ services: - NODE_ENV=production - PORT=3445 - NEXT_TELEMETRY_DISABLED=1 - - USER_API_BASE=http://192.168.1.176:8444 - - USER_API_ADMIN_KEY=maos-admin-2024 - - KUBO_API_URL=http://192.168.1.176:8443 - - KUBO_BASIC_AUTH=portal:ipfs-portal-2024 + # ── Set these via .env.production or environment ── + - USER_API_BASE=${USER_API_BASE:-http://localhost:8444} + # - USER_API_ADMIN_KEY= # ← REQUIRED: set this! + # - KUBO_API_URL= # ← Kubo RPC if behind proxy + # - KUBO_BASIC_AUTH= # ← Kubo basic auth credentials + # - JWT_SECRET= # ← REQUIRED: generate a random string healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3445/api/health"] interval: 30s @@ -111,4 +113,4 @@ REMOTESHELL echo "" echo "═══ Deploy complete ═══" -echo " URL: https://maos.dedyn.io (via nginx) or http://192.168.1.176:3445" +echo " URL: https://maos.dedyn.io (via nginx)" diff --git a/graphify-out/.graphify_labels.json b/graphify-out/.graphify_labels.json deleted file mode 100644 index 8bcb850..0000000 --- a/graphify-out/.graphify_labels.json +++ /dev/null @@ -1 +0,0 @@ -{"0": "Portal Layout & Navigation", "1": "Landing & Payment UI", "2": "Payment Smart Contract", "3": "IPFS Gateway & History", "4": "Explorer Components", "5": "NPM Dependencies", "6": "TypeScript Config", "7": "API Routes & Proxy", "8": "File Preview", "9": "Static Server", "10": "Root Layout", "11": "Sidebar Navigation", "12": "Deploy Script", "13": "Next.js Config", "14": "Playwright Config", "15": "PostCSS Config", "16": "E2E Tests"} \ No newline at end of file diff --git a/graphify-out/.graphify_python b/graphify-out/.graphify_python deleted file mode 100644 index dc0ec2c..0000000 --- a/graphify-out/.graphify_python +++ /dev/null @@ -1 +0,0 @@ -C:\Users\maik\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\python.exe \ No newline at end of file diff --git a/graphify-out/.graphify_root b/graphify-out/.graphify_root deleted file mode 100644 index 89eb8ff..0000000 --- a/graphify-out/.graphify_root +++ /dev/null @@ -1 +0,0 @@ -H:\IPFS-portal \ No newline at end of file diff --git a/graphify-out/GRAPH_REPORT.md b/graphify-out/GRAPH_REPORT.md deleted file mode 100644 index ec9bf67..0000000 --- a/graphify-out/GRAPH_REPORT.md +++ /dev/null @@ -1,111 +0,0 @@ -# Graph Report - . (2026-06-27) - -## Corpus Check -- Corpus is ~21,600 words - fits in a single context window. You may not need a graph. - -## Summary -- 251 nodes · 401 edges · 17 communities (12 shown, 5 thin omitted) -- Extraction: 100% EXTRACTED · 0% INFERRED · 0% AMBIGUOUS · INFERRED: 2 edges (avg confidence: 0.8) -- Token cost: 0 input · 0 output - -## Community Hubs (Navigation) -- [[_COMMUNITY_Portal Layout & Navigation|Portal Layout & Navigation]] -- [[_COMMUNITY_Landing & Payment UI|Landing & Payment UI]] -- [[_COMMUNITY_Payment Smart Contract|Payment Smart Contract]] -- [[_COMMUNITY_IPFS Gateway & History|IPFS Gateway & History]] -- [[_COMMUNITY_Explorer Components|Explorer Components]] -- [[_COMMUNITY_NPM Dependencies|NPM Dependencies]] -- [[_COMMUNITY_TypeScript Config|TypeScript Config]] -- [[_COMMUNITY_API Routes & Proxy|API Routes & Proxy]] -- [[_COMMUNITY_File Preview|File Preview]] -- [[_COMMUNITY_Static Server|Static Server]] -- [[_COMMUNITY_Root Layout|Root Layout]] -- [[_COMMUNITY_Sidebar Navigation|Sidebar Navigation]] -- [[_COMMUNITY_Deploy Script|Deploy Script]] -- [[_COMMUNITY_Next.js Config|Next.js Config]] - -## God Nodes (most connected - your core abstractions) -1. `PaymentService` - 31 edges -2. `compilerOptions` - 16 edges -3. `WalletProvider` - 15 edges -4. `apiFetch()` - 12 edges -5. `getInjectedProvider()` - 7 edges -6. `GET()` - 6 edges -7. `formatWeiToETH()` - 6 edges -8. `proxyIPFS()` - 5 edges -9. `POST()` - 5 edges -10. `DELETE()` - 5 edges - -## Surprising Connections (you probably didn't know these) -- `AdminPaymentPage()` --calls--> `formatWeiToETH()` [EXTRACTED] - src/app/admin/payment/page.tsx → src/lib/wallet.ts -- `UploadPage()` --calls--> `GatewayLink()` [INFERRED] - src/app/upload/page.tsx → src/app/explorer/components/GatewayLink.tsx -- `PaymentPanel()` --calls--> `formatWeiToETH()` [EXTRACTED] - src/components/PaymentPanel.tsx → src/lib/wallet.ts -- `DirectoryListingProps` --references--> `IPFSEntry` [EXTRACTED] - src/app/explorer/components/DirectoryListing.tsx → src/lib/api.ts - -## Import Cycles -- None detected. - -## Communities (17 total, 5 thin omitted) - -### Community 0 - "Portal Layout & Navigation" -Cohesion: 0.08 -Nodes (28): PinBadgeProps, PeerData, PinData, Status, addPin(), apiFetch(), BWStats, checkHealth() (+20 more) - -### Community 1 - "Landing & Payment UI" -Cohesion: 0.08 -Nodes (30): PaymentPanel(), PaymentPanelProps, TOKEN_ICONS, listUsers(), ERC20_ABI, IPFS_PORTAL_PAYMENT_ABI, MAOSDiscountTier, PriceInfo (+22 more) - -### Community 3 - "IPFS Gateway & History" -Cohesion: 0.11 -Nodes (21): GatewayLink(), GatewayLinkProps, formatBytes(), HistoryPage(), uploadFile(), addToHistory(), clearHistory(), DEFAULT_SETTINGS (+13 more) - -### Community 4 - "Explorer Components" -Cohesion: 0.09 -Nodes (13): BreadcrumbSegment, BreadcrumbsProps, CIDInputProps, DirectoryListingProps, FileIconProps, BreadcrumbSegment, ExplorerPage(), ExplorerState (+5 more) - -### Community 5 - "NPM Dependencies" -Cohesion: 0.08 -Nodes (24): dependencies, clsx, lucide-react, next, postcss, react, react-dom, @tailwindcss/postcss (+16 more) - -### Community 6 - "TypeScript Config" -Cohesion: 0.10 -Nodes (19): compilerOptions, allowJs, esModuleInterop, incremental, isolatedModules, jsx, lib, module (+11 more) - -### Community 7 - "API Routes & Proxy" -Cohesion: 0.44 -Nodes (10): DELETE(), GET(), handleHealth(), mapToKuboAPI(), matchRoute(), POST(), proxyIPFS(), proxyResult() (+2 more) - -### Community 8 - "File Preview" -Cohesion: 0.38 -Nodes (4): detectFileType(), FilePreview(), FilePreviewProps, renderMarkdown() - -### Community 9 - "Static Server" -Cohesion: 0.33 -Nodes (5): fs, http, MIME, path, ROOT - -## Knowledge Gaps -- **79 isolated node(s):** `deploy.sh script`, `nextConfig`, `name`, `version`, `private` (+74 more) - These have ≤1 connection - possible missing edges or undocumented components. -- **5 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes. - -## Suggested Questions -_Questions this graph is uniquely positioned to answer:_ - -- **Why does `PaymentService` connect `Payment Smart Contract` to `Landing & Payment UI`?** - _High betweenness centrality (0.153) - this node is a cross-community bridge._ -- **Why does `http` connect `Static Server` to `Payment Smart Contract`?** - _High betweenness centrality (0.029) - this node is a cross-community bridge._ -- **Why does `WalletProvider` connect `Payment Smart Contract` to `Landing & Payment UI`?** - _High betweenness centrality (0.017) - this node is a cross-community bridge._ -- **What connects `deploy.sh script`, `nextConfig`, `name` to the rest of the system?** - _79 weakly-connected nodes found - possible documentation gaps or missing edges._ -- **Should `Portal Layout & Navigation` be split into smaller, more focused modules?** - _Cohesion score 0.08194905869324474 - nodes in this community are weakly interconnected._ -- **Should `Landing & Payment UI` be split into smaller, more focused modules?** - _Cohesion score 0.08305647840531562 - nodes in this community are weakly interconnected._ -- **Should `IPFS Gateway & History` be split into smaller, more focused modules?** - _Cohesion score 0.1111111111111111 - nodes in this community are weakly interconnected._ \ No newline at end of file diff --git a/graphify-out/_query.py b/graphify-out/_query.py deleted file mode 100644 index a9c5f0e..0000000 --- a/graphify-out/_query.py +++ /dev/null @@ -1,20 +0,0 @@ -import json -from pathlib import Path - -g = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) -nodes = g.get('nodes', []) -edges = g.get('edges', []) -print(f'Nodes: {len(nodes)}, Edges: {len(edges)}') - -communities = g.get('communities', g.get('clusters', {})) -if communities: - print(f'Communities: {len(communities)}') - -# Show node labels and types -for n in nodes[:40]: - nid = n.get('id', '?') - label = n.get('label', n.get('name', '?')) - ntype = n.get('type', n.get('node_type', '?')) - print(f' {nid}: {label} [{ntype}]') -if len(nodes) > 40: - print(f' ... and {len(nodes)-40} more') diff --git a/graphify-out/_query2.py b/graphify-out/_query2.py deleted file mode 100644 index 7aedb08..0000000 --- a/graphify-out/_query2.py +++ /dev/null @@ -1,17 +0,0 @@ -import json -from pathlib as Path -from collections import Counter - -g = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8')) -nodes = g.get('nodes', []) - -# Show all unique node labels to understand project structure -types = Counter() -labels = [] -for n in nodes: - label = n.get('label', n.get('name', '?')) - labels.append(label) - -# Show all labels -for lbl in sorted(labels): - print(lbl) diff --git a/graphify-out/cache/ast/07d2ec4b6bf62550169c81f9ecd578fd6f3f30c40ae57eb4ee0d57f2dd440ed1.json b/graphify-out/cache/ast/07d2ec4b6bf62550169c81f9ecd578fd6f3f30c40ae57eb4ee0d57f2dd440ed1.json deleted file mode 100644 index edbcf4c..0000000 --- a/graphify-out/cache/ast/07d2ec4b6bf62550169c81f9ecd578fd6f3f30c40ae57eb4ee0d57f2dd440ed1.json +++ /dev/null @@ -1 +0,0 @@ -{"nodes": [{"id": "h_ipfs_portal_tsconfig_json", "label": "tsconfig.json", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L1"}, {"id": "ipfs_portal_tsconfig_compileroptions", "label": "compilerOptions", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L2"}, {"id": "ipfs_portal_tsconfig_compileroptions_target", "label": "target", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L3"}, {"id": "ipfs_portal_tsconfig_compileroptions_lib", "label": "lib", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L4"}, {"id": "ipfs_portal_tsconfig_compileroptions_allowjs", "label": "allowJs", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L9"}, {"id": "ipfs_portal_tsconfig_compileroptions_skiplibcheck", "label": "skipLibCheck", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L10"}, {"id": "ipfs_portal_tsconfig_compileroptions_strict", "label": "strict", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L11"}, {"id": "ipfs_portal_tsconfig_compileroptions_noemit", "label": "noEmit", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L12"}, {"id": "ipfs_portal_tsconfig_compileroptions_esmoduleinterop", "label": "esModuleInterop", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L13"}, {"id": "ipfs_portal_tsconfig_compileroptions_module", "label": "module", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L14"}, {"id": "ipfs_portal_tsconfig_compileroptions_moduleresolution", "label": "moduleResolution", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L15"}, {"id": "ipfs_portal_tsconfig_compileroptions_resolvejsonmodule", "label": "resolveJsonModule", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L16"}, {"id": "ipfs_portal_tsconfig_compileroptions_isolatedmodules", "label": "isolatedModules", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L17"}, {"id": "ipfs_portal_tsconfig_compileroptions_jsx", "label": "jsx", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L18"}, {"id": "ipfs_portal_tsconfig_compileroptions_incremental", "label": "incremental", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L19"}, {"id": "ipfs_portal_tsconfig_compileroptions_plugins", "label": "plugins", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L20"}, {"id": "ipfs_portal_tsconfig_compileroptions_paths", "label": "paths", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L25"}, {"id": "ipfs_portal_tsconfig_paths", "label": "@/*", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L26"}, {"id": "ipfs_portal_tsconfig_include", "label": "include", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L31"}, {"id": "ipfs_portal_tsconfig_exclude", "label": "exclude", "file_type": "code", "source_file": "tsconfig.json", "source_location": "L40"}], "edges": [{"source": "h_ipfs_portal_tsconfig_json", "target": "ipfs_portal_tsconfig_compileroptions", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L2", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_target", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L3", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_lib", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L4", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions_lib", "target": "ref_dom", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L4", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_compileroptions_lib", "target": "ref_dom_iterable", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L4", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_compileroptions_lib", "target": "ref_esnext", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L4", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_allowjs", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L9", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_skiplibcheck", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L10", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_strict", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L11", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_noemit", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L12", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_esmoduleinterop", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L13", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_module", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L14", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_moduleresolution", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L15", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_resolvejsonmodule", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L16", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_isolatedmodules", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L17", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_jsx", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L18", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_incremental", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L19", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_plugins", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L20", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions", "target": "ipfs_portal_tsconfig_compileroptions_paths", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L25", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_compileroptions_paths", "target": "ipfs_portal_tsconfig_paths", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L26", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_paths", "target": "ref_src", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L26", "weight": 1.0, "context": "import"}, {"source": "h_ipfs_portal_tsconfig_json", "target": "ipfs_portal_tsconfig_include", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_include", "target": "ref_next_env_d_ts", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_include", "target": "ref_ts", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_include", "target": "ref_tsx", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_include", "target": "ref_next_types_ts", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_include", "target": "ref_next_dev_types_ts", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_include", "target": "ref_out_types_ts", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_include", "target": "ref_out_dev_types_ts", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L31", "weight": 1.0, "context": "import"}, {"source": "h_ipfs_portal_tsconfig_json", "target": "ipfs_portal_tsconfig_exclude", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L40", "weight": 1.0}, {"source": "ipfs_portal_tsconfig_exclude", "target": "ref_node_modules", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L40", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_tsconfig_exclude", "target": "ref_out", "relation": "extends", "confidence": "EXTRACTED", "source_file": "tsconfig.json", "source_location": "L40", "weight": 1.0, "context": "import"}]} \ No newline at end of file diff --git a/graphify-out/cache/ast/93155dc8f78a78f135a0687f64636e2bc09b9dd2d7e3f8a3ecf01ddf9aaeba38.json b/graphify-out/cache/ast/93155dc8f78a78f135a0687f64636e2bc09b9dd2d7e3f8a3ecf01ddf9aaeba38.json deleted file mode 100644 index 6aa9ffe..0000000 --- a/graphify-out/cache/ast/93155dc8f78a78f135a0687f64636e2bc09b9dd2d7e3f8a3ecf01ddf9aaeba38.json +++ /dev/null @@ -1 +0,0 @@ -{"nodes": [{"id": "h_ipfs_portal_deploy_sh", "label": "deploy.sh", "file_type": "code", "source_file": "deploy.sh", "source_location": "L1", "metadata": {"language": "bash", "kind": "file"}}, {"id": "h_ipfs_portal_deploy_sh__entry", "label": "deploy.sh script", "file_type": "code", "source_file": "deploy.sh", "source_location": "L1", "metadata": {"language": "bash", "kind": "bash_entrypoint"}}], "edges": [{"source": "h_ipfs_portal_deploy_sh", "target": "h_ipfs_portal_deploy_sh__entry", "relation": "contains", "confidence": "EXTRACTED", "source_file": "deploy.sh", "source_location": "L1", "weight": 1.0}]} \ No newline at end of file diff --git a/graphify-out/cache/ast/b4d183d0a729b9f4854201b7a3e9a097b30f87d4f5fc666c2e5bebe5f26a3713.json b/graphify-out/cache/ast/b4d183d0a729b9f4854201b7a3e9a097b30f87d4f5fc666c2e5bebe5f26a3713.json deleted file mode 100644 index 7ade225..0000000 --- a/graphify-out/cache/ast/b4d183d0a729b9f4854201b7a3e9a097b30f87d4f5fc666c2e5bebe5f26a3713.json +++ /dev/null @@ -1 +0,0 @@ -{"nodes": [{"id": "h_ipfs_portal_package_json", "label": "package.json", "file_type": "code", "source_file": "package.json", "source_location": "L1"}, {"id": "ipfs_portal_package_name", "label": "name", "file_type": "code", "source_file": "package.json", "source_location": "L2"}, {"id": "ipfs_portal_package_version", "label": "version", "file_type": "code", "source_file": "package.json", "source_location": "L3"}, {"id": "ipfs_portal_package_private", "label": "private", "file_type": "code", "source_file": "package.json", "source_location": "L4"}, {"id": "ipfs_portal_package_description", "label": "description", "file_type": "code", "source_file": "package.json", "source_location": "L5"}, {"id": "ipfs_portal_package_scripts", "label": "scripts", "file_type": "code", "source_file": "package.json", "source_location": "L6"}, {"id": "ipfs_portal_package_scripts_dev", "label": "dev", "file_type": "code", "source_file": "package.json", "source_location": "L7"}, {"id": "ipfs_portal_package_scripts_build", "label": "build", "file_type": "code", "source_file": "package.json", "source_location": "L8"}, {"id": "ipfs_portal_package_scripts_export", "label": "export", "file_type": "code", "source_file": "package.json", "source_location": "L9"}, {"id": "ipfs_portal_package_dependencies", "label": "dependencies", "file_type": "code", "source_file": "package.json", "source_location": "L11"}, {"id": "ipfs_portal_package_dependencies_tailwindcss_postcss", "label": "@tailwindcss/postcss", "file_type": "code", "source_file": "package.json", "source_location": "L12"}, {"id": "ipfs_portal_package_dependencies_clsx", "label": "clsx", "file_type": "code", "source_file": "package.json", "source_location": "L13"}, {"id": "ipfs_portal_package_dependencies_lucide_react", "label": "lucide-react", "file_type": "code", "source_file": "package.json", "source_location": "L14"}, {"id": "ipfs_portal_package_dependencies_next", "label": "next", "file_type": "code", "source_file": "package.json", "source_location": "L15"}, {"id": "ipfs_portal_package_dependencies_postcss", "label": "postcss", "file_type": "code", "source_file": "package.json", "source_location": "L16"}, {"id": "ipfs_portal_package_dependencies_react", "label": "react", "file_type": "code", "source_file": "package.json", "source_location": "L17"}, {"id": "ipfs_portal_package_dependencies_react_dom", "label": "react-dom", "file_type": "code", "source_file": "package.json", "source_location": "L18"}, {"id": "ipfs_portal_package_dependencies_viem", "label": "viem", "file_type": "code", "source_file": "package.json", "source_location": "L19"}, {"id": "ipfs_portal_package_devdependencies", "label": "devDependencies", "file_type": "code", "source_file": "package.json", "source_location": "L21"}, {"id": "ipfs_portal_package_devdependencies_playwright_test", "label": "@playwright/test", "file_type": "code", "source_file": "package.json", "source_location": "L22"}, {"id": "ipfs_portal_package_devdependencies_types_node", "label": "@types/node", "file_type": "code", "source_file": "package.json", "source_location": "L23"}, {"id": "ipfs_portal_package_devdependencies_types_react", "label": "@types/react", "file_type": "code", "source_file": "package.json", "source_location": "L24"}, {"id": "ipfs_portal_package_devdependencies_types_react_dom", "label": "@types/react-dom", "file_type": "code", "source_file": "package.json", "source_location": "L25"}, {"id": "ipfs_portal_package_devdependencies_tailwindcss", "label": "tailwindcss", "file_type": "code", "source_file": "package.json", "source_location": "L26"}, {"id": "ipfs_portal_package_devdependencies_typescript", "label": "typescript", "file_type": "code", "source_file": "package.json", "source_location": "L27"}], "edges": [{"source": "h_ipfs_portal_package_json", "target": "ipfs_portal_package_name", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L2", "weight": 1.0}, {"source": "h_ipfs_portal_package_json", "target": "ipfs_portal_package_version", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L3", "weight": 1.0}, {"source": "h_ipfs_portal_package_json", "target": "ipfs_portal_package_private", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L4", "weight": 1.0}, {"source": "h_ipfs_portal_package_json", "target": "ipfs_portal_package_description", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L5", "weight": 1.0}, {"source": "h_ipfs_portal_package_json", "target": "ipfs_portal_package_scripts", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L6", "weight": 1.0}, {"source": "ipfs_portal_package_scripts", "target": "ipfs_portal_package_scripts_dev", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L7", "weight": 1.0}, {"source": "ipfs_portal_package_scripts", "target": "ipfs_portal_package_scripts_build", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L8", "weight": 1.0}, {"source": "ipfs_portal_package_scripts", "target": "ipfs_portal_package_scripts_export", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L9", "weight": 1.0}, {"source": "h_ipfs_portal_package_json", "target": "ipfs_portal_package_dependencies", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L11", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_tailwindcss_postcss", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L12", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_tailwindcss_postcss", "target": "tailwindcss_postcss", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L12", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_clsx", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L13", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_clsx", "target": "clsx", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L13", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_lucide_react", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L14", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_lucide_react", "target": "lucide_react", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L14", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_next", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L15", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_next", "target": "next", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L15", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_postcss", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L16", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_postcss", "target": "postcss", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L16", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_react", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L17", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_react", "target": "react", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L17", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_react_dom", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L18", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_react_dom", "target": "react_dom", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L18", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_dependencies", "target": "ipfs_portal_package_dependencies_viem", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L19", "weight": 1.0}, {"source": "ipfs_portal_package_dependencies_viem", "target": "viem", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L19", "weight": 1.0, "context": "import"}, {"source": "h_ipfs_portal_package_json", "target": "ipfs_portal_package_devdependencies", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L21", "weight": 1.0}, {"source": "ipfs_portal_package_devdependencies", "target": "ipfs_portal_package_devdependencies_playwright_test", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L22", "weight": 1.0}, {"source": "ipfs_portal_package_devdependencies_playwright_test", "target": "playwright_test", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L22", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_devdependencies", "target": "ipfs_portal_package_devdependencies_types_node", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L23", "weight": 1.0}, {"source": "ipfs_portal_package_devdependencies_types_node", "target": "types_node", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L23", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_devdependencies", "target": "ipfs_portal_package_devdependencies_types_react", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L24", "weight": 1.0}, {"source": "ipfs_portal_package_devdependencies_types_react", "target": "types_react", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L24", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_devdependencies", "target": "ipfs_portal_package_devdependencies_types_react_dom", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L25", "weight": 1.0}, {"source": "ipfs_portal_package_devdependencies_types_react_dom", "target": "types_react_dom", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L25", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_devdependencies", "target": "ipfs_portal_package_devdependencies_tailwindcss", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L26", "weight": 1.0}, {"source": "ipfs_portal_package_devdependencies_tailwindcss", "target": "tailwindcss", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L26", "weight": 1.0, "context": "import"}, {"source": "ipfs_portal_package_devdependencies", "target": "ipfs_portal_package_devdependencies_typescript", "relation": "contains", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L27", "weight": 1.0}, {"source": "ipfs_portal_package_devdependencies_typescript", "target": "typescript", "relation": "imports", "confidence": "EXTRACTED", "source_file": "package.json", "source_location": "L27", "weight": 1.0, "context": "import"}]} \ No newline at end of file diff --git a/graphify-out/cache/stat-index.json b/graphify-out/cache/stat-index.json deleted file mode 100644 index 9b6a12e..0000000 --- a/graphify-out/cache/stat-index.json +++ /dev/null @@ -1 +0,0 @@ -{"H:\\IPFS-portal\\deploy.sh":{"size":3276,"mtime_ns":1782335829420010800,"hash":"93155dc8f78a78f135a0687f64636e2bc09b9dd2d7e3f8a3ecf01ddf9aaeba38"},"H:\\IPFS-portal\\package.json":{"size":741,"mtime_ns":1782331693806062100,"hash":"b4d183d0a729b9f4854201b7a3e9a097b30f87d4f5fc666c2e5bebe5f26a3713"},"H:\\IPFS-portal\\tsconfig.json":{"size":768,"mtime_ns":1782305238016408400,"hash":"07d2ec4b6bf62550169c81f9ecd578fd6f3f30c40ae57eb4ee0d57f2dd440ed1"}} \ No newline at end of file diff --git a/graphify-out/cost.json b/graphify-out/cost.json deleted file mode 100644 index 261c496..0000000 --- a/graphify-out/cost.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "runs": [ - { - "date": "2026-06-27T12:47:45.586275+00:00", - "input_tokens": 0, - "output_tokens": 0, - "files": 37 - } - ], - "total_input_tokens": 0, - "total_output_tokens": 0 -} \ No newline at end of file diff --git a/graphify-out/graph.html b/graphify-out/graph.html deleted file mode 100644 index 3e8606b..0000000 --- a/graphify-out/graph.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - -graphify - graphify-out/graph.html - - - - -
- - - - - \ No newline at end of file diff --git a/graphify-out/graph.json b/graphify-out/graph.json deleted file mode 100644 index 3ab94c2..0000000 --- a/graphify-out/graph.json +++ /dev/null @@ -1,6726 +0,0 @@ -{ - "directed": false, - "multigraph": false, - "graph": {}, - "nodes": [ - { - "label": "deploy.sh", - "file_type": "code", - "source_file": "deploy.sh", - "source_location": "L1", - "metadata": { - "language": "bash", - "kind": "file" - }, - "_origin": "ast", - "id": "deploy", - "community": 12, - "norm_label": "deploy.sh" - }, - { - "label": "deploy.sh script", - "file_type": "code", - "source_file": "deploy.sh", - "source_location": "L1", - "metadata": { - "language": "bash", - "kind": "bash_entrypoint" - }, - "_origin": "ast", - "id": "h_ipfs_portal_deploy_sh__entry", - "community": 12, - "norm_label": "deploy.sh script" - }, - { - "label": "next.config.ts", - "file_type": "code", - "source_file": "next.config.ts", - "source_location": "L1", - "_origin": "ast", - "id": "next_config", - "community": 13, - "norm_label": "next.config.ts" - }, - { - "label": "nextConfig", - "file_type": "code", - "source_file": "next.config.ts", - "source_location": "L3", - "_origin": "ast", - "id": "next_config_nextconfig", - "community": 13, - "norm_label": "nextconfig" - }, - { - "label": "package.json", - "file_type": "code", - "source_file": "package.json", - "source_location": "L1", - "_origin": "ast", - "id": "package", - "community": 5, - "norm_label": "package.json" - }, - { - "label": "name", - "file_type": "code", - "source_file": "package.json", - "source_location": "L2", - "_origin": "ast", - "id": "package_name", - "community": 5, - "norm_label": "name" - }, - { - "label": "version", - "file_type": "code", - "source_file": "package.json", - "source_location": "L3", - "_origin": "ast", - "id": "package_version", - "community": 5, - "norm_label": "version" - }, - { - "label": "private", - "file_type": "code", - "source_file": "package.json", - "source_location": "L4", - "_origin": "ast", - "id": "package_private", - "community": 5, - "norm_label": "private" - }, - { - "label": "description", - "file_type": "code", - "source_file": "package.json", - "source_location": "L5", - "_origin": "ast", - "id": "package_description", - "community": 5, - "norm_label": "description" - }, - { - "label": "scripts", - "file_type": "code", - "source_file": "package.json", - "source_location": "L6", - "_origin": "ast", - "id": "package_scripts", - "community": 5, - "norm_label": "scripts" - }, - { - "label": "dev", - "file_type": "code", - "source_file": "package.json", - "source_location": "L7", - "_origin": "ast", - "id": "package_scripts_dev", - "community": 5, - "norm_label": "dev" - }, - { - "label": "build", - "file_type": "code", - "source_file": "package.json", - "source_location": "L8", - "_origin": "ast", - "id": "package_scripts_build", - "community": 5, - "norm_label": "build" - }, - { - "label": "export", - "file_type": "code", - "source_file": "package.json", - "source_location": "L9", - "_origin": "ast", - "id": "package_scripts_export", - "community": 5, - "norm_label": "export" - }, - { - "label": "dependencies", - "file_type": "code", - "source_file": "package.json", - "source_location": "L11", - "_origin": "ast", - "id": "package_dependencies", - "community": 5, - "norm_label": "dependencies" - }, - { - "label": "@tailwindcss/postcss", - "file_type": "code", - "source_file": "package.json", - "source_location": "L12", - "_origin": "ast", - "id": "package_dependencies_tailwindcss_postcss", - "community": 5, - "norm_label": "@tailwindcss/postcss" - }, - { - "label": "clsx", - "file_type": "code", - "source_file": "package.json", - "source_location": "L13", - "_origin": "ast", - "id": "package_dependencies_clsx", - "community": 5, - "norm_label": "clsx" - }, - { - "label": "lucide-react", - "file_type": "code", - "source_file": "package.json", - "source_location": "L14", - "_origin": "ast", - "id": "package_dependencies_lucide_react", - "community": 5, - "norm_label": "lucide-react" - }, - { - "label": "next", - "file_type": "code", - "source_file": "package.json", - "source_location": "L15", - "_origin": "ast", - "id": "package_dependencies_next", - "community": 5, - "norm_label": "next" - }, - { - "label": "postcss", - "file_type": "code", - "source_file": "package.json", - "source_location": "L16", - "_origin": "ast", - "id": "package_dependencies_postcss", - "community": 5, - "norm_label": "postcss" - }, - { - "label": "react", - "file_type": "code", - "source_file": "package.json", - "source_location": "L17", - "_origin": "ast", - "id": "package_dependencies_react", - "community": 5, - "norm_label": "react" - }, - { - "label": "react-dom", - "file_type": "code", - "source_file": "package.json", - "source_location": "L18", - "_origin": "ast", - "id": "package_dependencies_react_dom", - "community": 5, - "norm_label": "react-dom" - }, - { - "label": "viem", - "file_type": "code", - "source_file": "package.json", - "source_location": "L19", - "_origin": "ast", - "id": "package_dependencies_viem", - "community": 5, - "norm_label": "viem" - }, - { - "label": "devDependencies", - "file_type": "code", - "source_file": "package.json", - "source_location": "L21", - "_origin": "ast", - "id": "package_devdependencies", - "community": 5, - "norm_label": "devdependencies" - }, - { - "label": "@playwright/test", - "file_type": "code", - "source_file": "package.json", - "source_location": "L22", - "_origin": "ast", - "id": "package_devdependencies_playwright_test", - "community": 5, - "norm_label": "@playwright/test" - }, - { - "label": "@types/node", - "file_type": "code", - "source_file": "package.json", - "source_location": "L23", - "_origin": "ast", - "id": "package_devdependencies_types_node", - "community": 5, - "norm_label": "@types/node" - }, - { - "label": "@types/react", - "file_type": "code", - "source_file": "package.json", - "source_location": "L24", - "_origin": "ast", - "id": "package_devdependencies_types_react", - "community": 5, - "norm_label": "@types/react" - }, - { - "label": "@types/react-dom", - "file_type": "code", - "source_file": "package.json", - "source_location": "L25", - "_origin": "ast", - "id": "package_devdependencies_types_react_dom", - "community": 5, - "norm_label": "@types/react-dom" - }, - { - "label": "tailwindcss", - "file_type": "code", - "source_file": "package.json", - "source_location": "L26", - "_origin": "ast", - "id": "package_devdependencies_tailwindcss", - "community": 5, - "norm_label": "tailwindcss" - }, - { - "label": "typescript", - "file_type": "code", - "source_file": "package.json", - "source_location": "L27", - "_origin": "ast", - "id": "package_devdependencies_typescript", - "community": 5, - "norm_label": "typescript" - }, - { - "label": "playwright.config.ts", - "file_type": "code", - "source_file": "playwright.config.ts", - "source_location": "L1", - "_origin": "ast", - "id": "playwright_config", - "community": 14, - "norm_label": "playwright.config.ts" - }, - { - "label": "postcss.config.mjs", - "file_type": "code", - "source_file": "postcss.config.mjs", - "source_location": "L1", - "_origin": "ast", - "id": "postcss_config", - "community": 15, - "norm_label": "postcss.config.mjs" - }, - { - "label": "serve-static.js", - "file_type": "code", - "source_file": "serve-static.js", - "source_location": "L1", - "_origin": "ast", - "id": "serve_static", - "community": 9, - "norm_label": "serve-static.js" - }, - { - "label": "http", - "file_type": "code", - "source_file": "serve-static.js", - "source_location": "L1", - "_origin": "ast", - "id": "serve_static_http", - "community": 9, - "norm_label": "http" - }, - { - "label": "fs", - "file_type": "code", - "source_file": "serve-static.js", - "source_location": "L2", - "_origin": "ast", - "id": "serve_static_fs", - "community": 9, - "norm_label": "fs" - }, - { - "label": "path", - "file_type": "code", - "source_file": "serve-static.js", - "source_location": "L3", - "_origin": "ast", - "id": "serve_static_path", - "community": 9, - "norm_label": "path" - }, - { - "label": "ROOT", - "file_type": "code", - "source_file": "serve-static.js", - "source_location": "L6", - "_origin": "ast", - "id": "serve_static_root", - "community": 9, - "norm_label": "root" - }, - { - "label": "MIME", - "file_type": "code", - "source_file": "serve-static.js", - "source_location": "L7", - "_origin": "ast", - "id": "serve_static_mime", - "community": 9, - "norm_label": "mime" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "payment_page", - "community": 1, - "norm_label": "page.tsx" - }, - { - "label": "ViewMode", - "file_type": "code", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L16", - "_origin": "ast", - "id": "payment_page_viewmode", - "community": 1, - "norm_label": "viewmode" - }, - { - "label": "TxStatus", - "file_type": "code", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L17", - "_origin": "ast", - "id": "payment_page_txstatus", - "community": 1, - "norm_label": "txstatus" - }, - { - "label": "AdminPaymentPage()", - "file_type": "code", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L19", - "_origin": "ast", - "id": "payment_page_adminpaymentpage", - "community": 1, - "norm_label": "adminpaymentpage()" - }, - { - "label": "route.ts", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L1", - "_origin": "ast", - "id": "path_route", - "community": 7, - "norm_label": "route.ts" - }, - { - "label": "RouteMatch", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L27", - "_origin": "ast", - "id": "path_route_routematch", - "community": 7, - "norm_label": "routematch" - }, - { - "label": "matchRoute()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L33", - "_origin": "ast", - "id": "path_route_matchroute", - "community": 7, - "norm_label": "matchroute()" - }, - { - "label": "proxyUserAPI()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L60", - "_origin": "ast", - "id": "path_route_proxyuserapi", - "community": 7, - "norm_label": "proxyuserapi()" - }, - { - "label": "proxyIPFS()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L80", - "_origin": "ast", - "id": "path_route_proxyipfs", - "community": 7, - "norm_label": "proxyipfs()" - }, - { - "label": "mapToKuboAPI()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L156", - "_origin": "ast", - "id": "path_route_maptokuboapi", - "community": 7, - "norm_label": "maptokuboapi()" - }, - { - "label": "GET()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L214", - "_origin": "ast", - "id": "path_route_get", - "community": 7, - "norm_label": "get()" - }, - { - "label": "POST()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L232", - "_origin": "ast", - "id": "path_route_post", - "community": 7, - "norm_label": "post()" - }, - { - "label": "DELETE()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L250", - "_origin": "ast", - "id": "path_route_delete", - "community": 7, - "norm_label": "delete()" - }, - { - "label": "handleHealth()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L270", - "_origin": "ast", - "id": "path_route_handlehealth", - "community": 7, - "norm_label": "handlehealth()" - }, - { - "label": "proxyResult()", - "file_type": "code", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L329", - "_origin": "ast", - "id": "path_route_proxyresult", - "community": 7, - "norm_label": "proxyresult()" - }, - { - "label": "route.ts", - "file_type": "code", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L1", - "_origin": "ast", - "id": "verify_route", - "community": 1, - "norm_label": "route.ts" - }, - { - "label": "CONTRACT_ADDRESS", - "file_type": "code", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L21", - "_origin": "ast", - "id": "verify_route_contract_address", - "community": 1, - "norm_label": "contract_address" - }, - { - "label": "zkSyncLocal", - "file_type": "code", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L23", - "_origin": "ast", - "id": "verify_route_zksynclocal", - "community": 1, - "norm_label": "zksynclocal" - }, - { - "label": "client", - "file_type": "code", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L30", - "_origin": "ast", - "id": "verify_route_client", - "community": 1, - "norm_label": "client" - }, - { - "label": "GET()", - "file_type": "code", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L39", - "_origin": "ast", - "id": "verify_route_get", - "community": 1, - "norm_label": "get()" - }, - { - "label": "POST()", - "file_type": "code", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L131", - "_origin": "ast", - "id": "verify_route_post", - "community": 1, - "norm_label": "post()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "dashboard_page", - "community": 0, - "norm_label": "page.tsx" - }, - { - "label": "PeerData", - "file_type": "code", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L20", - "_origin": "ast", - "id": "dashboard_page_peerdata", - "community": 0, - "norm_label": "peerdata" - }, - { - "label": "PinData", - "file_type": "code", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L21", - "_origin": "ast", - "id": "dashboard_page_pindata", - "community": 0, - "norm_label": "pindata" - }, - { - "label": "DashboardPage()", - "file_type": "code", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L23", - "_origin": "ast", - "id": "dashboard_page_dashboardpage", - "community": 0, - "norm_label": "dashboardpage()" - }, - { - "label": "Breadcrumbs.tsx", - "file_type": "code", - "source_file": "src/app/explorer/components/Breadcrumbs.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_breadcrumbs", - "community": 4, - "norm_label": "breadcrumbs.tsx" - }, - { - "label": "BreadcrumbSegment", - "file_type": "code", - "source_file": "src/app/explorer/components/Breadcrumbs.tsx", - "source_location": "L3", - "_origin": "ast", - "id": "components_breadcrumbs_breadcrumbsegment", - "community": 4, - "norm_label": "breadcrumbsegment" - }, - { - "label": "BreadcrumbsProps", - "file_type": "code", - "source_file": "src/app/explorer/components/Breadcrumbs.tsx", - "source_location": "L8", - "_origin": "ast", - "id": "components_breadcrumbs_breadcrumbsprops", - "community": 4, - "norm_label": "breadcrumbsprops" - }, - { - "label": "Breadcrumbs()", - "file_type": "code", - "source_file": "src/app/explorer/components/Breadcrumbs.tsx", - "source_location": "L13", - "_origin": "ast", - "id": "components_breadcrumbs_breadcrumbs", - "community": 4, - "norm_label": "breadcrumbs()" - }, - { - "label": "CIDInput.tsx", - "file_type": "code", - "source_file": "src/app/explorer/components/CIDInput.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_cidinput", - "community": 4, - "norm_label": "cidinput.tsx" - }, - { - "label": "CIDInputProps", - "file_type": "code", - "source_file": "src/app/explorer/components/CIDInput.tsx", - "source_location": "L6", - "_origin": "ast", - "id": "components_cidinput_cidinputprops", - "community": 4, - "norm_label": "cidinputprops" - }, - { - "label": "CIDInput()", - "file_type": "code", - "source_file": "src/app/explorer/components/CIDInput.tsx", - "source_location": "L10", - "_origin": "ast", - "id": "components_cidinput_cidinput", - "community": 4, - "norm_label": "cidinput()" - }, - { - "label": "DirectoryListing.tsx", - "file_type": "code", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_directorylisting", - "community": 4, - "norm_label": "directorylisting.tsx" - }, - { - "label": "DirectoryListingProps", - "file_type": "code", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L7", - "_origin": "ast", - "id": "components_directorylisting_directorylistingprops", - "community": 4, - "norm_label": "directorylistingprops" - }, - { - "label": "formatSize()", - "file_type": "code", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L15", - "_origin": "ast", - "id": "components_directorylisting_formatsize", - "community": 4, - "norm_label": "formatsize()" - }, - { - "label": "truncateHash()", - "file_type": "code", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L23", - "_origin": "ast", - "id": "components_directorylisting_truncatehash", - "community": 4, - "norm_label": "truncatehash()" - }, - { - "label": "SkeletonRow()", - "file_type": "code", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L28", - "_origin": "ast", - "id": "components_directorylisting_skeletonrow", - "community": 4, - "norm_label": "skeletonrow()" - }, - { - "label": "DirectoryListing()", - "file_type": "code", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L40", - "_origin": "ast", - "id": "components_directorylisting_directorylisting", - "community": 4, - "norm_label": "directorylisting()" - }, - { - "label": "FileIcon.tsx", - "file_type": "code", - "source_file": "src/app/explorer/components/FileIcon.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_fileicon", - "community": 4, - "norm_label": "fileicon.tsx" - }, - { - "label": "FileIconProps", - "file_type": "code", - "source_file": "src/app/explorer/components/FileIcon.tsx", - "source_location": "L12", - "_origin": "ast", - "id": "components_fileicon_fileiconprops", - "community": 4, - "norm_label": "fileiconprops" - }, - { - "label": "FileIcon()", - "file_type": "code", - "source_file": "src/app/explorer/components/FileIcon.tsx", - "source_location": "L18", - "_origin": "ast", - "id": "components_fileicon_fileicon", - "community": 4, - "norm_label": "fileicon()" - }, - { - "label": "FilePreview.tsx", - "file_type": "code", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_filepreview", - "community": 8, - "norm_label": "filepreview.tsx" - }, - { - "label": "FilePreviewProps", - "file_type": "code", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L5", - "_origin": "ast", - "id": "components_filepreview_filepreviewprops", - "community": 8, - "norm_label": "filepreviewprops" - }, - { - "label": "detectFileType()", - "file_type": "code", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L13", - "_origin": "ast", - "id": "components_filepreview_detectfiletype", - "community": 8, - "norm_label": "detectfiletype()" - }, - { - "label": "renderMarkdown()", - "file_type": "code", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L22", - "_origin": "ast", - "id": "components_filepreview_rendermarkdown", - "community": 8, - "norm_label": "rendermarkdown()" - }, - { - "label": "renderJson()", - "file_type": "code", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L36", - "_origin": "ast", - "id": "components_filepreview_renderjson", - "community": 8, - "norm_label": "renderjson()" - }, - { - "label": "JsonDisplay()", - "file_type": "code", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L46", - "_origin": "ast", - "id": "components_filepreview_jsondisplay", - "community": 8, - "norm_label": "jsondisplay()" - }, - { - "label": "FilePreview()", - "file_type": "code", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L81", - "_origin": "ast", - "id": "components_filepreview_filepreview", - "community": 8, - "norm_label": "filepreview()" - }, - { - "label": "GatewayLink.tsx", - "file_type": "code", - "source_file": "src/app/explorer/components/GatewayLink.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_gatewaylink", - "community": 3, - "norm_label": "gatewaylink.tsx" - }, - { - "label": "GatewayLinkProps", - "file_type": "code", - "source_file": "src/app/explorer/components/GatewayLink.tsx", - "source_location": "L6", - "_origin": "ast", - "id": "components_gatewaylink_gatewaylinkprops", - "community": 3, - "norm_label": "gatewaylinkprops" - }, - { - "label": "GatewayLink()", - "file_type": "code", - "source_file": "src/app/explorer/components/GatewayLink.tsx", - "source_location": "L11", - "_origin": "ast", - "id": "components_gatewaylink_gatewaylink", - "community": 3, - "norm_label": "gatewaylink()" - }, - { - "label": "PinBadge.tsx", - "file_type": "code", - "source_file": "src/app/explorer/components/PinBadge.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_pinbadge", - "community": 0, - "norm_label": "pinbadge.tsx" - }, - { - "label": "PinBadgeProps", - "file_type": "code", - "source_file": "src/app/explorer/components/PinBadge.tsx", - "source_location": "L7", - "_origin": "ast", - "id": "components_pinbadge_pinbadgeprops", - "community": 0, - "norm_label": "pinbadgeprops" - }, - { - "label": "PinBadge()", - "file_type": "code", - "source_file": "src/app/explorer/components/PinBadge.tsx", - "source_location": "L13", - "_origin": "ast", - "id": "components_pinbadge_pinbadge", - "community": 0, - "norm_label": "pinbadge()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "explorer_page", - "community": 4, - "norm_label": "page.tsx" - }, - { - "label": "BreadcrumbSegment", - "file_type": "code", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L17", - "_origin": "ast", - "id": "explorer_page_breadcrumbsegment", - "community": 4, - "norm_label": "breadcrumbsegment" - }, - { - "label": "loadRecentCids()", - "file_type": "code", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L22", - "_origin": "ast", - "id": "explorer_page_loadrecentcids", - "community": 4, - "norm_label": "loadrecentcids()" - }, - { - "label": "saveRecentCid()", - "file_type": "code", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L32", - "_origin": "ast", - "id": "explorer_page_saverecentcid", - "community": 4, - "norm_label": "saverecentcid()" - }, - { - "label": "ExplorerState", - "file_type": "code", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L42", - "_origin": "ast", - "id": "explorer_page_explorerstate", - "community": 4, - "norm_label": "explorerstate" - }, - { - "label": "ExplorerPage()", - "file_type": "code", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L44", - "_origin": "ast", - "id": "explorer_page_explorerpage", - "community": 4, - "norm_label": "explorerpage()" - }, - { - "label": "findFilename()", - "file_type": "code", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L242", - "_origin": "ast", - "id": "explorer_page_findfilename", - "community": 4, - "norm_label": "findfilename()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/history/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "history_page", - "community": 3, - "norm_label": "page.tsx" - }, - { - "label": "formatBytes()", - "file_type": "code", - "source_file": "src/app/history/page.tsx", - "source_location": "L14", - "_origin": "ast", - "id": "history_page_formatbytes", - "community": 3, - "norm_label": "formatbytes()" - }, - { - "label": "truncateCid()", - "file_type": "code", - "source_file": "src/app/history/page.tsx", - "source_location": "L22", - "_origin": "ast", - "id": "history_page_truncatecid", - "community": 3, - "norm_label": "truncatecid()" - }, - { - "label": "getMethodBadge()", - "file_type": "code", - "source_file": "src/app/history/page.tsx", - "source_location": "L27", - "_origin": "ast", - "id": "history_page_getmethodbadge", - "community": 3, - "norm_label": "getmethodbadge()" - }, - { - "label": "HistoryPage()", - "file_type": "code", - "source_file": "src/app/history/page.tsx", - "source_location": "L38", - "_origin": "ast", - "id": "history_page_historypage", - "community": 3, - "norm_label": "historypage()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "ipns_page", - "community": 0, - "norm_label": "page.tsx" - }, - { - "label": "Status", - "file_type": "code", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L7", - "_origin": "ast", - "id": "ipns_page_status", - "community": 0, - "norm_label": "status" - }, - { - "label": "IPNSPage()", - "file_type": "code", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L9", - "_origin": "ast", - "id": "ipns_page_ipnspage", - "community": 0, - "norm_label": "ipnspage()" - }, - { - "label": "layout-portal.tsx", - "file_type": "code", - "source_file": "src/app/layout-portal.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "app_layout_portal", - "community": 0, - "norm_label": "layout-portal.tsx" - }, - { - "label": "PortalLayout()", - "file_type": "code", - "source_file": "src/app/layout-portal.tsx", - "source_location": "L6", - "_origin": "ast", - "id": "app_layout_portal_portallayout", - "community": 0, - "norm_label": "portallayout()" - }, - { - "label": "layout.tsx", - "file_type": "code", - "source_file": "src/app/layout.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "app_layout", - "community": 10, - "norm_label": "layout.tsx" - }, - { - "label": "metadata", - "file_type": "code", - "source_file": "src/app/layout.tsx", - "source_location": "L4", - "_origin": "ast", - "id": "app_layout_metadata", - "community": 10, - "norm_label": "metadata" - }, - { - "label": "viewport", - "file_type": "code", - "source_file": "src/app/layout.tsx", - "source_location": "L9", - "_origin": "ast", - "id": "app_layout_viewport", - "community": 10, - "norm_label": "viewport" - }, - { - "label": "RootLayout()", - "file_type": "code", - "source_file": "src/app/layout.tsx", - "source_location": "L15", - "_origin": "ast", - "id": "app_layout_rootlayout", - "community": 10, - "norm_label": "rootlayout()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "app_page", - "community": 1, - "norm_label": "page.tsx" - }, - { - "label": "LandingPage()", - "file_type": "code", - "source_file": "src/app/page.tsx", - "source_location": "L9", - "_origin": "ast", - "id": "app_page_landingpage", - "community": 1, - "norm_label": "landingpage()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/peers/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "peers_page", - "community": 0, - "norm_label": "page.tsx" - }, - { - "label": "PeersPage()", - "file_type": "code", - "source_file": "src/app/peers/page.tsx", - "source_location": "L8", - "_origin": "ast", - "id": "peers_page_peerspage", - "community": 0, - "norm_label": "peerspage()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/pins/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "pins_page", - "community": 0, - "norm_label": "page.tsx" - }, - { - "label": "PinsPage()", - "file_type": "code", - "source_file": "src/app/pins/page.tsx", - "source_location": "L9", - "_origin": "ast", - "id": "pins_page_pinspage", - "community": 0, - "norm_label": "pinspage()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/settings/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "settings_page", - "community": 3, - "norm_label": "page.tsx" - }, - { - "label": "formatStorageMB()", - "file_type": "code", - "source_file": "src/app/settings/page.tsx", - "source_location": "L13", - "_origin": "ast", - "id": "settings_page_formatstoragemb", - "community": 3, - "norm_label": "formatstoragemb()" - }, - { - "label": "SettingsPage()", - "file_type": "code", - "source_file": "src/app/settings/page.tsx", - "source_location": "L20", - "_origin": "ast", - "id": "settings_page_settingspage", - "community": 3, - "norm_label": "settingspage()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/upload/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "upload_page", - "community": 3, - "norm_label": "page.tsx" - }, - { - "label": "ALLOWED_TYPES", - "file_type": "code", - "source_file": "src/app/upload/page.tsx", - "source_location": "L16", - "_origin": "ast", - "id": "upload_page_allowed_types", - "community": 3, - "norm_label": "allowed_types" - }, - { - "label": "formatBytes()", - "file_type": "code", - "source_file": "src/app/upload/page.tsx", - "source_location": "L19", - "_origin": "ast", - "id": "upload_page_formatbytes", - "community": 3, - "norm_label": "formatbytes()" - }, - { - "label": "FileEntry", - "file_type": "code", - "source_file": "src/app/upload/page.tsx", - "source_location": "L28", - "_origin": "ast", - "id": "upload_page_fileentry", - "community": 3, - "norm_label": "fileentry" - }, - { - "label": "TabMode", - "file_type": "code", - "source_file": "src/app/upload/page.tsx", - "source_location": "L38", - "_origin": "ast", - "id": "upload_page_tabmode", - "community": 3, - "norm_label": "tabmode" - }, - { - "label": "UploadPage()", - "file_type": "code", - "source_file": "src/app/upload/page.tsx", - "source_location": "L42", - "_origin": "ast", - "id": "upload_page_uploadpage", - "community": 3, - "norm_label": "uploadpage()" - }, - { - "label": "page.tsx", - "file_type": "code", - "source_file": "src/app/users/page.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "users_page", - "community": 1, - "norm_label": "page.tsx" - }, - { - "label": "UsersPage()", - "file_type": "code", - "source_file": "src/app/users/page.tsx", - "source_location": "L14", - "_origin": "ast", - "id": "users_page_userspage", - "community": 1, - "norm_label": "userspage()" - }, - { - "label": "PaymentPanel.tsx", - "file_type": "code", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_paymentpanel", - "community": 1, - "norm_label": "paymentpanel.tsx" - }, - { - "label": "TOKEN_ICONS", - "file_type": "code", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L15", - "_origin": "ast", - "id": "components_paymentpanel_token_icons", - "community": 1, - "norm_label": "token_icons" - }, - { - "label": "PaymentPanelProps", - "file_type": "code", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L21", - "_origin": "ast", - "id": "components_paymentpanel_paymentpanelprops", - "community": 1, - "norm_label": "paymentpanelprops" - }, - { - "label": "PaymentPanel()", - "file_type": "code", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L29", - "_origin": "ast", - "id": "components_paymentpanel_paymentpanel", - "community": 1, - "norm_label": "paymentpanel()" - }, - { - "label": "PortalHeader.tsx", - "file_type": "code", - "source_file": "src/components/PortalHeader.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_portalheader", - "community": 0, - "norm_label": "portalheader.tsx" - }, - { - "label": "PortalHeader()", - "file_type": "code", - "source_file": "src/components/PortalHeader.tsx", - "source_location": "L7", - "_origin": "ast", - "id": "components_portalheader_portalheader", - "community": 0, - "norm_label": "portalheader()" - }, - { - "label": "PortalSidebar.tsx", - "file_type": "code", - "source_file": "src/components/PortalSidebar.tsx", - "source_location": "L1", - "_origin": "ast", - "id": "components_portalsidebar", - "community": 11, - "norm_label": "portalsidebar.tsx" - }, - { - "label": "NAV_ITEMS", - "file_type": "code", - "source_file": "src/components/PortalSidebar.tsx", - "source_location": "L19", - "_origin": "ast", - "id": "components_portalsidebar_nav_items", - "community": 11, - "norm_label": "nav_items" - }, - { - "label": "PortalSidebar()", - "file_type": "code", - "source_file": "src/components/PortalSidebar.tsx", - "source_location": "L32", - "_origin": "ast", - "id": "components_portalsidebar_portalsidebar", - "community": 11, - "norm_label": "portalsidebar()" - }, - { - "label": "api.ts", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L1", - "_origin": "ast", - "id": "lib_api", - "community": 0, - "norm_label": "api.ts" - }, - { - "label": "IPFSNodeInfo", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L5", - "_origin": "ast", - "id": "lib_api_ipfsnodeinfo", - "community": 0, - "norm_label": "ipfsnodeinfo" - }, - { - "label": "IPFSPin", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L14", - "_origin": "ast", - "id": "lib_api_ipfspin", - "community": 0, - "norm_label": "ipfspin" - }, - { - "label": "IPFSUser", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L21", - "_origin": "ast", - "id": "lib_api_ipfsuser", - "community": 0, - "norm_label": "ipfsuser" - }, - { - "label": "apiFetch()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L28", - "_origin": "ast", - "id": "lib_api_apifetch", - "community": 0, - "norm_label": "apifetch()" - }, - { - "label": "getNodeInfo()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L42", - "_origin": "ast", - "id": "lib_api_getnodeinfo", - "community": 0, - "norm_label": "getnodeinfo()" - }, - { - "label": "getPeers()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L46", - "_origin": "ast", - "id": "lib_api_getpeers", - "community": 0, - "norm_label": "getpeers()" - }, - { - "label": "listPins()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L56", - "_origin": "ast", - "id": "lib_api_listpins", - "community": 0, - "norm_label": "listpins()" - }, - { - "label": "addPin()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L67", - "_origin": "ast", - "id": "lib_api_addpin", - "community": 0, - "norm_label": "addpin()" - }, - { - "label": "removePin()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L74", - "_origin": "ast", - "id": "lib_api_removepin", - "community": 0, - "norm_label": "removepin()" - }, - { - "label": "uploadFile()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L79", - "_origin": "ast", - "id": "lib_api_uploadfile", - "community": 3, - "norm_label": "uploadfile()" - }, - { - "label": "listFiles()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L91", - "_origin": "ast", - "id": "lib_api_listfiles", - "community": 0, - "norm_label": "listfiles()" - }, - { - "label": "listUsers()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L96", - "_origin": "ast", - "id": "lib_api_listusers", - "community": 1, - "norm_label": "listusers()" - }, - { - "label": "createUser()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L104", - "_origin": "ast", - "id": "lib_api_createuser", - "community": 0, - "norm_label": "createuser()" - }, - { - "label": "deleteUser()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L111", - "_origin": "ast", - "id": "lib_api_deleteuser", - "community": 0, - "norm_label": "deleteuser()" - }, - { - "label": "IPFSEntry", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L117", - "_origin": "ast", - "id": "lib_api_ipfsentry", - "community": 4, - "norm_label": "ipfsentry" - }, - { - "label": "explorerLs()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L124", - "_origin": "ast", - "id": "lib_api_explorerls", - "community": 0, - "norm_label": "explorerls()" - }, - { - "label": "explorerCat()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L128", - "_origin": "ast", - "id": "lib_api_explorercat", - "community": 4, - "norm_label": "explorercat()" - }, - { - "label": "explorerStat()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L140", - "_origin": "ast", - "id": "lib_api_explorerstat", - "community": 0, - "norm_label": "explorerstat()" - }, - { - "label": "IPNSKey", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L146", - "_origin": "ast", - "id": "lib_api_ipnskey", - "community": 0, - "norm_label": "ipnskey" - }, - { - "label": "listIPNSKeys()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L151", - "_origin": "ast", - "id": "lib_api_listipnskeys", - "community": 0, - "norm_label": "listipnskeys()" - }, - { - "label": "ipnsPublish()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L156", - "_origin": "ast", - "id": "lib_api_ipnspublish", - "community": 0, - "norm_label": "ipnspublish()" - }, - { - "label": "ipnsResolve()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L162", - "_origin": "ast", - "id": "lib_api_ipnsresolve", - "community": 0, - "norm_label": "ipnsresolve()" - }, - { - "label": "ipnsGenKey()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L167", - "_origin": "ast", - "id": "lib_api_ipnsgenkey", - "community": 0, - "norm_label": "ipnsgenkey()" - }, - { - "label": "RepoStats", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L173", - "_origin": "ast", - "id": "lib_api_repostats", - "community": 0, - "norm_label": "repostats" - }, - { - "label": "BWStats", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L181", - "_origin": "ast", - "id": "lib_api_bwstats", - "community": 0, - "norm_label": "bwstats" - }, - { - "label": "getRepoStats()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L188", - "_origin": "ast", - "id": "lib_api_getrepostats", - "community": 0, - "norm_label": "getrepostats()" - }, - { - "label": "getBWStats()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L202", - "_origin": "ast", - "id": "lib_api_getbwstats", - "community": 0, - "norm_label": "getbwstats()" - }, - { - "label": "checkHealth()", - "file_type": "code", - "source_file": "src/lib/api.ts", - "source_location": "L215", - "_origin": "ast", - "id": "lib_api_checkhealth", - "community": 0, - "norm_label": "checkhealth()" - }, - { - "label": "payment.ts", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L1", - "_origin": "ast", - "id": "lib_payment", - "community": 1, - "norm_label": "payment.ts" - }, - { - "label": "zkSyncLocal", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L16", - "_origin": "ast", - "id": "lib_payment_zksynclocal", - "community": 1, - "norm_label": "zksynclocal" - }, - { - "label": "IPFS_PORTAL_PAYMENT_ABI", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L29", - "_origin": "ast", - "id": "lib_payment_ipfs_portal_payment_abi", - "community": 1, - "norm_label": "ipfs_portal_payment_abi" - }, - { - "label": "ERC20_ABI", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L92", - "_origin": "ast", - "id": "lib_payment_erc20_abi", - "community": 1, - "norm_label": "erc20_abi" - }, - { - "label": "PriceInfo", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L101", - "_origin": "ast", - "id": "lib_payment_priceinfo", - "community": 1, - "norm_label": "priceinfo" - }, - { - "label": "UserUploadStats", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L108", - "_origin": "ast", - "id": "lib_payment_useruploadstats", - "community": 1, - "norm_label": "useruploadstats" - }, - { - "label": "TokenInfo", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L114", - "_origin": "ast", - "id": "lib_payment_tokeninfo", - "community": 1, - "norm_label": "tokeninfo" - }, - { - "label": "MAOSDiscountTier", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L122", - "_origin": "ast", - "id": "lib_payment_maosdiscounttier", - "community": 1, - "norm_label": "maosdiscounttier" - }, - { - "label": "UploadRecord", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L127", - "_origin": "ast", - "id": "lib_payment_uploadrecord", - "community": 1, - "norm_label": "uploadrecord" - }, - { - "label": "UserFullStats", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L135", - "_origin": "ast", - "id": "lib_payment_userfullstats", - "community": 1, - "norm_label": "userfullstats" - }, - { - "label": "PaymentService", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L144", - "_origin": "ast", - "id": "lib_payment_paymentservice", - "community": 2, - "norm_label": "paymentservice" - }, - { - "label": ".constructor()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L147", - "_origin": "ast", - "id": "lib_payment_paymentservice_constructor", - "community": 2, - "norm_label": ".constructor()" - }, - { - "label": ".setContractAddress()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L151", - "_origin": "ast", - "id": "lib_payment_paymentservice_setcontractaddress", - "community": 2, - "norm_label": ".setcontractaddress()" - }, - { - "label": ".getPublicClient()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L156", - "_origin": "ast", - "id": "lib_payment_paymentservice_getpublicclient", - "community": 2, - "norm_label": ".getpublicclient()" - }, - { - "label": ".getWalletClient()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L164", - "_origin": "ast", - "id": "lib_payment_paymentservice_getwalletclient", - "community": 2, - "norm_label": ".getwalletclient()" - }, - { - "label": ".getPrice()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L172", - "_origin": "ast", - "id": "lib_payment_paymentservice_getprice", - "community": 2, - "norm_label": ".getprice()" - }, - { - "label": ".getUserStats()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L189", - "_origin": "ast", - "id": "lib_payment_paymentservice_getuserstats", - "community": 2, - "norm_label": ".getuserstats()" - }, - { - "label": ".getUserUploads()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L205", - "_origin": "ast", - "id": "lib_payment_paymentservice_getuseruploads", - "community": 2, - "norm_label": ".getuseruploads()" - }, - { - "label": ".getSupportedTokens()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L232", - "_origin": "ast", - "id": "lib_payment_paymentservice_getsupportedtokens", - "community": 2, - "norm_label": ".getsupportedtokens()" - }, - { - "label": ".getMAOSDiscountTiers()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L261", - "_origin": "ast", - "id": "lib_payment_paymentservice_getmaosdiscounttiers", - "community": 2, - "norm_label": ".getmaosdiscounttiers()" - }, - { - "label": ".getFreeTierBytes()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L278", - "_origin": "ast", - "id": "lib_payment_paymentservice_getfreetierbytes", - "community": 2, - "norm_label": ".getfreetierbytes()" - }, - { - "label": ".getBasePricePerMB()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L289", - "_origin": "ast", - "id": "lib_payment_paymentservice_getbasepricepermb", - "community": 2, - "norm_label": ".getbasepricepermb()" - }, - { - "label": ".payWithETH()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L300", - "_origin": "ast", - "id": "lib_payment_paymentservice_paywitheth", - "community": 2, - "norm_label": ".paywitheth()" - }, - { - "label": ".approveAndPayWithToken()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L319", - "_origin": "ast", - "id": "lib_payment_paymentservice_approveandpaywithtoken", - "community": 2, - "norm_label": ".approveandpaywithtoken()" - }, - { - "label": ".encodePayWithETH()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L364", - "_origin": "ast", - "id": "lib_payment_paymentservice_encodepaywitheth", - "community": 2, - "norm_label": ".encodepaywitheth()" - }, - { - "label": ".getOwner()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L373", - "_origin": "ast", - "id": "lib_payment_paymentservice_getowner", - "community": 2, - "norm_label": ".getowner()" - }, - { - "label": ".getTotalRevenue()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L384", - "_origin": "ast", - "id": "lib_payment_paymentservice_gettotalrevenue", - "community": 2, - "norm_label": ".gettotalrevenue()" - }, - { - "label": ".getTotalUploads()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L395", - "_origin": "ast", - "id": "lib_payment_paymentservice_gettotaluploads", - "community": 2, - "norm_label": ".gettotaluploads()" - }, - { - "label": ".getTokenSymbols()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L406", - "_origin": "ast", - "id": "lib_payment_paymentservice_gettokensymbols", - "community": 2, - "norm_label": ".gettokensymbols()" - }, - { - "label": ".adminSetPricePerMB()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L417", - "_origin": "ast", - "id": "lib_payment_paymentservice_adminsetpricepermb", - "community": 2, - "norm_label": ".adminsetpricepermb()" - }, - { - "label": ".adminSetFreeTierBytes()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L430", - "_origin": "ast", - "id": "lib_payment_paymentservice_adminsetfreetierbytes", - "community": 2, - "norm_label": ".adminsetfreetierbytes()" - }, - { - "label": ".adminSetDiscountTier()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L443", - "_origin": "ast", - "id": "lib_payment_paymentservice_adminsetdiscounttier", - "community": 2, - "norm_label": ".adminsetdiscounttier()" - }, - { - "label": ".adminRemoveDiscountTier()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L456", - "_origin": "ast", - "id": "lib_payment_paymentservice_adminremovediscounttier", - "community": 2, - "norm_label": ".adminremovediscounttier()" - }, - { - "label": ".adminConfigureToken()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L469", - "_origin": "ast", - "id": "lib_payment_paymentservice_adminconfiguretoken", - "community": 2, - "norm_label": ".adminconfiguretoken()" - }, - { - "label": ".adminWithdrawETH()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L489", - "_origin": "ast", - "id": "lib_payment_paymentservice_adminwithdraweth", - "community": 2, - "norm_label": ".adminwithdraweth()" - }, - { - "label": ".adminWithdrawToken()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L502", - "_origin": "ast", - "id": "lib_payment_paymentservice_adminwithdrawtoken", - "community": 2, - "norm_label": ".adminwithdrawtoken()" - }, - { - "label": ".adminTransferOwnership()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L515", - "_origin": "ast", - "id": "lib_payment_paymentservice_admintransferownership", - "community": 2, - "norm_label": ".admintransferownership()" - }, - { - "label": ".isDeployed()", - "file_type": "code", - "source_file": "src/lib/payment.ts", - "source_location": "L528", - "_origin": "ast", - "id": "lib_payment_paymentservice_isdeployed", - "community": 2, - "norm_label": ".isdeployed()" - }, - { - "label": "storage.ts", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L1", - "_origin": "ast", - "id": "lib_storage", - "community": 3, - "norm_label": "storage.ts" - }, - { - "label": "PortalSettings", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L9", - "_origin": "ast", - "id": "lib_storage_portalsettings", - "community": 3, - "norm_label": "portalsettings" - }, - { - "label": "UploadRecord", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L17", - "_origin": "ast", - "id": "lib_storage_uploadrecord", - "community": 3, - "norm_label": "uploadrecord" - }, - { - "label": "DEFAULT_SETTINGS", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L31", - "_origin": "ast", - "id": "lib_storage_default_settings", - "community": 3, - "norm_label": "default_settings" - }, - { - "label": "getSettings()", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L41", - "_origin": "ast", - "id": "lib_storage_getsettings", - "community": 3, - "norm_label": "getsettings()" - }, - { - "label": "saveSettings()", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L52", - "_origin": "ast", - "id": "lib_storage_savesettings", - "community": 3, - "norm_label": "savesettings()" - }, - { - "label": "resetSettings()", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L61", - "_origin": "ast", - "id": "lib_storage_resetsettings", - "community": 3, - "norm_label": "resetsettings()" - }, - { - "label": "getHistory()", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L70", - "_origin": "ast", - "id": "lib_storage_gethistory", - "community": 3, - "norm_label": "gethistory()" - }, - { - "label": "addToHistory()", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L81", - "_origin": "ast", - "id": "lib_storage_addtohistory", - "community": 3, - "norm_label": "addtohistory()" - }, - { - "label": "clearHistory()", - "file_type": "code", - "source_file": "src/lib/storage.ts", - "source_location": "L94", - "_origin": "ast", - "id": "lib_storage_clearhistory", - "community": 3, - "norm_label": "clearhistory()" - }, - { - "label": "wallet.ts", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L1", - "_origin": "ast", - "id": "lib_wallet", - "community": 1, - "norm_label": "wallet.ts" - }, - { - "label": "WalletProvider", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L4", - "_origin": "ast", - "id": "lib_wallet_walletprovider", - "community": 2, - "norm_label": "walletprovider" - }, - { - "label": "WalletState", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L10", - "_origin": "ast", - "id": "lib_wallet_walletstate", - "community": 1, - "norm_label": "walletstate" - }, - { - "label": "DetectedWallet", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L18", - "_origin": "ast", - "id": "lib_wallet_detectedwallet", - "community": 1, - "norm_label": "detectedwallet" - }, - { - "label": "CHAIN_IDS", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L26", - "_origin": "ast", - "id": "lib_wallet_chain_ids", - "community": 1, - "norm_label": "chain_ids" - }, - { - "label": "ZKSYNC_LOCAL_CHAIN", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L34", - "_origin": "ast", - "id": "lib_wallet_zksync_local_chain", - "community": 1, - "norm_label": "zksync_local_chain" - }, - { - "label": "discoverWallets()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L43", - "_origin": "ast", - "id": "lib_wallet_discoverwallets", - "community": 1, - "norm_label": "discoverwallets()" - }, - { - "label": "getInjectedProvider()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L92", - "_origin": "ast", - "id": "lib_wallet_getinjectedprovider", - "community": 1, - "norm_label": "getinjectedprovider()" - }, - { - "label": "detectWalletType()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L102", - "_origin": "ast", - "id": "lib_wallet_detectwallettype", - "community": 1, - "norm_label": "detectwallettype()" - }, - { - "label": "connectWallet()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L116", - "_origin": "ast", - "id": "lib_wallet_connectwallet", - "community": 1, - "norm_label": "connectwallet()" - }, - { - "label": "switchToChain270()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L130", - "_origin": "ast", - "id": "lib_wallet_switchtochain270", - "community": 1, - "norm_label": "switchtochain270()" - }, - { - "label": "signMessage()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L158", - "_origin": "ast", - "id": "lib_wallet_signmessage", - "community": 1, - "norm_label": "signmessage()" - }, - { - "label": "getBalance()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L170", - "_origin": "ast", - "id": "lib_wallet_getbalance", - "community": 1, - "norm_label": "getbalance()" - }, - { - "label": "formatWeiToETH()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L183", - "_origin": "ast", - "id": "lib_wallet_formatweitoeth", - "community": 1, - "norm_label": "formatweitoeth()" - }, - { - "label": "formatBytes()", - "file_type": "code", - "source_file": "src/lib/wallet.ts", - "source_location": "L190", - "_origin": "ast", - "id": "lib_wallet_formatbytes", - "community": 1, - "norm_label": "formatbytes()" - }, - { - "label": "portal.spec.ts", - "file_type": "code", - "source_file": "tests/portal.spec.ts", - "source_location": "L1", - "_origin": "ast", - "id": "tests_portal_spec", - "community": 16, - "norm_label": "portal.spec.ts" - }, - { - "label": "tsconfig.json", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L1", - "_origin": "ast", - "id": "tsconfig", - "community": 6, - "norm_label": "tsconfig.json" - }, - { - "label": "compilerOptions", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L2", - "_origin": "ast", - "id": "tsconfig_compileroptions", - "community": 6, - "norm_label": "compileroptions" - }, - { - "label": "target", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L3", - "_origin": "ast", - "id": "tsconfig_compileroptions_target", - "community": 6, - "norm_label": "target" - }, - { - "label": "lib", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L4", - "_origin": "ast", - "id": "tsconfig_compileroptions_lib", - "community": 6, - "norm_label": "lib" - }, - { - "label": "allowJs", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L9", - "_origin": "ast", - "id": "tsconfig_compileroptions_allowjs", - "community": 6, - "norm_label": "allowjs" - }, - { - "label": "skipLibCheck", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L10", - "_origin": "ast", - "id": "tsconfig_compileroptions_skiplibcheck", - "community": 6, - "norm_label": "skiplibcheck" - }, - { - "label": "strict", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L11", - "_origin": "ast", - "id": "tsconfig_compileroptions_strict", - "community": 6, - "norm_label": "strict" - }, - { - "label": "noEmit", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L12", - "_origin": "ast", - "id": "tsconfig_compileroptions_noemit", - "community": 6, - "norm_label": "noemit" - }, - { - "label": "esModuleInterop", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L13", - "_origin": "ast", - "id": "tsconfig_compileroptions_esmoduleinterop", - "community": 6, - "norm_label": "esmoduleinterop" - }, - { - "label": "module", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L14", - "_origin": "ast", - "id": "tsconfig_compileroptions_module", - "community": 6, - "norm_label": "module" - }, - { - "label": "moduleResolution", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L15", - "_origin": "ast", - "id": "tsconfig_compileroptions_moduleresolution", - "community": 6, - "norm_label": "moduleresolution" - }, - { - "label": "resolveJsonModule", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L16", - "_origin": "ast", - "id": "tsconfig_compileroptions_resolvejsonmodule", - "community": 6, - "norm_label": "resolvejsonmodule" - }, - { - "label": "isolatedModules", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L17", - "_origin": "ast", - "id": "tsconfig_compileroptions_isolatedmodules", - "community": 6, - "norm_label": "isolatedmodules" - }, - { - "label": "jsx", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L18", - "_origin": "ast", - "id": "tsconfig_compileroptions_jsx", - "community": 6, - "norm_label": "jsx" - }, - { - "label": "incremental", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L19", - "_origin": "ast", - "id": "tsconfig_compileroptions_incremental", - "community": 6, - "norm_label": "incremental" - }, - { - "label": "plugins", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L20", - "_origin": "ast", - "id": "tsconfig_compileroptions_plugins", - "community": 6, - "norm_label": "plugins" - }, - { - "label": "paths", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L25", - "_origin": "ast", - "id": "tsconfig_compileroptions_paths", - "community": 6, - "norm_label": "paths" - }, - { - "label": "@/*", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L26", - "_origin": "ast", - "id": "tsconfig_paths", - "community": 6, - "norm_label": "@/*" - }, - { - "label": "include", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L31", - "_origin": "ast", - "id": "tsconfig_include", - "community": 6, - "norm_label": "include" - }, - { - "label": "exclude", - "file_type": "code", - "source_file": "tsconfig.json", - "source_location": "L40", - "_origin": "ast", - "id": "tsconfig_exclude", - "community": 6, - "norm_label": "exclude" - } - ], - "links": [ - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "deploy.sh", - "source_location": "L1", - "weight": 1.0, - "source": "deploy", - "target": "h_ipfs_portal_deploy_sh__entry", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "next.config.ts", - "source_location": "L3", - "weight": 1.0, - "source": "next_config", - "target": "next_config_nextconfig", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L11", - "weight": 1.0, - "source": "package", - "target": "package_dependencies", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L5", - "weight": 1.0, - "source": "package", - "target": "package_description", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L21", - "weight": 1.0, - "source": "package", - "target": "package_devdependencies", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L2", - "weight": 1.0, - "source": "package", - "target": "package_name", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L4", - "weight": 1.0, - "source": "package", - "target": "package_private", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L6", - "weight": 1.0, - "source": "package", - "target": "package_scripts", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L3", - "weight": 1.0, - "source": "package", - "target": "package_version", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L8", - "weight": 1.0, - "source": "package_scripts", - "target": "package_scripts_build", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L7", - "weight": 1.0, - "source": "package_scripts", - "target": "package_scripts_dev", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L9", - "weight": 1.0, - "source": "package_scripts", - "target": "package_scripts_export", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L13", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_clsx", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L14", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_lucide_react", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L15", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_next", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L16", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_postcss", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L17", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_react", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L18", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_react_dom", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L12", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_tailwindcss_postcss", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L19", - "weight": 1.0, - "source": "package_dependencies", - "target": "package_dependencies_viem", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L22", - "weight": 1.0, - "source": "package_devdependencies", - "target": "package_devdependencies_playwright_test", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L26", - "weight": 1.0, - "source": "package_devdependencies", - "target": "package_devdependencies_tailwindcss", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L23", - "weight": 1.0, - "source": "package_devdependencies", - "target": "package_devdependencies_types_node", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L24", - "weight": 1.0, - "source": "package_devdependencies", - "target": "package_devdependencies_types_react", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L25", - "weight": 1.0, - "source": "package_devdependencies", - "target": "package_devdependencies_types_react_dom", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "package.json", - "source_location": "L27", - "weight": 1.0, - "source": "package_devdependencies", - "target": "package_devdependencies_typescript", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "serve-static.js", - "source_location": "L2", - "weight": 1.0, - "source": "serve_static", - "target": "serve_static_fs", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "serve-static.js", - "source_location": "L1", - "weight": 1.0, - "source": "serve_static", - "target": "serve_static_http", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "serve-static.js", - "source_location": "L7", - "weight": 1.0, - "source": "serve_static", - "target": "serve_static_mime", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "serve-static.js", - "source_location": "L3", - "weight": 1.0, - "source": "serve_static", - "target": "serve_static_path", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "serve-static.js", - "source_location": "L6", - "weight": 1.0, - "source": "serve_static", - "target": "serve_static_root", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "INFERRED", - "confidence_score": 0.8, - "source_file": "src/lib/payment.ts", - "source_location": "L159", - "weight": 1.0, - "source": "lib_payment_paymentservice_getpublicclient", - "target": "serve_static_http" - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "payment_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "payment_page", - "target": "lib_payment", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "payment_page", - "target": "lib_payment_maosdiscounttier", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "payment_page", - "target": "lib_payment_paymentservice", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "payment_page", - "target": "lib_payment_tokeninfo", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "payment_page", - "target": "lib_wallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "payment_page", - "target": "lib_wallet_connectwallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "payment_page", - "target": "lib_wallet_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "payment_page", - "target": "lib_wallet_formatweitoeth", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "payment_page", - "target": "lib_wallet_getinjectedprovider", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "payment_page", - "target": "lib_wallet_switchtochain270", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "payment_page", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L19", - "weight": 1.0, - "source": "payment_page", - "target": "payment_page_adminpaymentpage", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L17", - "weight": 1.0, - "source": "payment_page", - "target": "payment_page_txstatus", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L16", - "weight": 1.0, - "source": "payment_page", - "target": "payment_page_viewmode", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "confidence_score": 1.0, - "source_file": "src/app/admin/payment/page.tsx", - "source_location": "L322", - "weight": 1.0, - "source": "payment_page_adminpaymentpage", - "target": "lib_wallet_formatweitoeth" - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L250", - "weight": 1.0, - "source": "path_route", - "target": "path_route_delete", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L214", - "weight": 1.0, - "source": "path_route", - "target": "path_route_get", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L270", - "weight": 1.0, - "source": "path_route", - "target": "path_route_handlehealth", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L156", - "weight": 1.0, - "source": "path_route", - "target": "path_route_maptokuboapi", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L33", - "weight": 1.0, - "source": "path_route", - "target": "path_route_matchroute", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L232", - "weight": 1.0, - "source": "path_route", - "target": "path_route_post", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L80", - "weight": 1.0, - "source": "path_route", - "target": "path_route_proxyipfs", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L329", - "weight": 1.0, - "source": "path_route", - "target": "path_route_proxyresult", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L60", - "weight": 1.0, - "source": "path_route", - "target": "path_route_proxyuserapi", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L27", - "weight": 1.0, - "source": "path_route", - "target": "path_route_routematch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L255", - "weight": 1.0, - "source": "path_route_delete", - "target": "path_route_matchroute", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L219", - "weight": 1.0, - "source": "path_route_get", - "target": "path_route_matchroute", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L237", - "weight": 1.0, - "source": "path_route_post", - "target": "path_route_matchroute", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L260", - "weight": 1.0, - "source": "path_route_delete", - "target": "path_route_proxyuserapi", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L226", - "weight": 1.0, - "source": "path_route_get", - "target": "path_route_proxyuserapi", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L242", - "weight": 1.0, - "source": "path_route_post", - "target": "path_route_proxyuserapi", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L262", - "weight": 1.0, - "source": "path_route_delete", - "target": "path_route_proxyipfs", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L228", - "weight": 1.0, - "source": "path_route_get", - "target": "path_route_proxyipfs", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L244", - "weight": 1.0, - "source": "path_route_post", - "target": "path_route_proxyipfs", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L93", - "weight": 1.0, - "source": "path_route_proxyipfs", - "target": "path_route_maptokuboapi", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L224", - "weight": 1.0, - "source": "path_route_get", - "target": "path_route_handlehealth", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L226", - "weight": 1.0, - "source": "path_route_get", - "target": "path_route_proxyresult", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L242", - "weight": 1.0, - "source": "path_route_post", - "target": "path_route_proxyresult", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/api/[...path]/route.ts", - "source_location": "L260", - "weight": 1.0, - "source": "path_route_delete", - "target": "path_route_proxyresult", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L18", - "weight": 1.0, - "source": "verify_route", - "target": "lib_payment", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L18", - "weight": 1.0, - "source": "verify_route", - "target": "lib_payment_ipfs_portal_payment_abi", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L30", - "weight": 1.0, - "source": "verify_route", - "target": "verify_route_client", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L21", - "weight": 1.0, - "source": "verify_route", - "target": "verify_route_contract_address", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L39", - "weight": 1.0, - "source": "verify_route", - "target": "verify_route_get", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L131", - "weight": 1.0, - "source": "verify_route", - "target": "verify_route_post", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/api/payment/verify/route.ts", - "source_location": "L23", - "weight": 1.0, - "source": "verify_route", - "target": "verify_route_zksynclocal", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "dashboard_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L23", - "weight": 1.0, - "source": "dashboard_page", - "target": "dashboard_page_dashboardpage", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L20", - "weight": 1.0, - "source": "dashboard_page", - "target": "dashboard_page_peerdata", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L21", - "weight": 1.0, - "source": "dashboard_page", - "target": "dashboard_page_pindata", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api_bwstats", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api_checkhealth", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api_getbwstats", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api_getpeers", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api_getrepostats", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api_listpins", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/dashboard/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "dashboard_page", - "target": "lib_api_repostats", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/Breadcrumbs.tsx", - "source_location": "L13", - "weight": 1.0, - "source": "components_breadcrumbs", - "target": "components_breadcrumbs_breadcrumbs", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/Breadcrumbs.tsx", - "source_location": "L3", - "weight": 1.0, - "source": "components_breadcrumbs", - "target": "components_breadcrumbs_breadcrumbsegment", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/Breadcrumbs.tsx", - "source_location": "L8", - "weight": 1.0, - "source": "components_breadcrumbs", - "target": "components_breadcrumbs_breadcrumbsprops", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L10", - "weight": 1.0, - "source": "explorer_page", - "target": "components_breadcrumbs", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/CIDInput.tsx", - "source_location": "L10", - "weight": 1.0, - "source": "components_cidinput", - "target": "components_cidinput_cidinput", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/CIDInput.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "components_cidinput", - "target": "components_cidinput_cidinputprops", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "explorer_page", - "target": "components_cidinput", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L40", - "weight": 1.0, - "source": "components_directorylisting", - "target": "components_directorylisting_directorylisting", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "components_directorylisting", - "target": "components_directorylisting_directorylistingprops", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L15", - "weight": 1.0, - "source": "components_directorylisting", - "target": "components_directorylisting_formatsize", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L28", - "weight": 1.0, - "source": "components_directorylisting", - "target": "components_directorylisting_skeletonrow", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L23", - "weight": 1.0, - "source": "components_directorylisting", - "target": "components_directorylisting_truncatehash", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_directorylisting", - "target": "components_fileicon", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L3", - "weight": 1.0, - "source": "components_directorylisting", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L3", - "weight": 1.0, - "source": "components_directorylisting", - "target": "lib_api_ipfsentry", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L8", - "weight": 1.0, - "source": "explorer_page", - "target": "components_directorylisting", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "field", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/DirectoryListing.tsx", - "source_location": "L8", - "weight": 1.0, - "source": "components_directorylisting_directorylistingprops", - "target": "lib_api_ipfsentry", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FileIcon.tsx", - "source_location": "L18", - "weight": 1.0, - "source": "components_fileicon", - "target": "components_fileicon_fileicon", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FileIcon.tsx", - "source_location": "L12", - "weight": 1.0, - "source": "components_fileicon", - "target": "components_fileicon_fileiconprops", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L13", - "weight": 1.0, - "source": "components_filepreview", - "target": "components_filepreview_detectfiletype", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L81", - "weight": 1.0, - "source": "components_filepreview", - "target": "components_filepreview_filepreview", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_filepreview", - "target": "components_filepreview_filepreviewprops", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L46", - "weight": 1.0, - "source": "components_filepreview", - "target": "components_filepreview_jsondisplay", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L36", - "weight": 1.0, - "source": "components_filepreview", - "target": "components_filepreview_renderjson", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L22", - "weight": 1.0, - "source": "components_filepreview", - "target": "components_filepreview_rendermarkdown", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L9", - "weight": 1.0, - "source": "explorer_page", - "target": "components_filepreview", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L82", - "weight": 1.0, - "source": "components_filepreview_filepreview", - "target": "components_filepreview_detectfiletype", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/FilePreview.tsx", - "source_location": "L123", - "weight": 1.0, - "source": "components_filepreview_filepreview", - "target": "components_filepreview_rendermarkdown", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/GatewayLink.tsx", - "source_location": "L11", - "weight": 1.0, - "source": "components_gatewaylink", - "target": "components_gatewaylink_gatewaylink", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/GatewayLink.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "components_gatewaylink", - "target": "components_gatewaylink_gatewaylinkprops", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L12", - "weight": 1.0, - "source": "explorer_page", - "target": "components_gatewaylink", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "INFERRED", - "confidence_score": 0.8, - "source_file": "src/app/upload/page.tsx", - "source_location": "L554", - "weight": 1.0, - "source": "upload_page_uploadpage", - "target": "components_gatewaylink_gatewaylink" - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/PinBadge.tsx", - "source_location": "L13", - "weight": 1.0, - "source": "components_pinbadge", - "target": "components_pinbadge_pinbadge", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/PinBadge.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "components_pinbadge", - "target": "components_pinbadge_pinbadgeprops", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/PinBadge.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_pinbadge", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/components/PinBadge.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_pinbadge", - "target": "lib_api_addpin", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L11", - "weight": 1.0, - "source": "explorer_page", - "target": "components_pinbadge", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "explorer_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L17", - "weight": 1.0, - "source": "explorer_page", - "target": "explorer_page_breadcrumbsegment", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L44", - "weight": 1.0, - "source": "explorer_page", - "target": "explorer_page_explorerpage", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L42", - "weight": 1.0, - "source": "explorer_page", - "target": "explorer_page_explorerstate", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L242", - "weight": 1.0, - "source": "explorer_page", - "target": "explorer_page_findfilename", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L22", - "weight": 1.0, - "source": "explorer_page", - "target": "explorer_page_loadrecentcids", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L32", - "weight": 1.0, - "source": "explorer_page", - "target": "explorer_page_saverecentcid", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "explorer_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "explorer_page", - "target": "lib_api_explorercat", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "explorer_page", - "target": "lib_api_explorerls", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "explorer_page", - "target": "lib_api_ipfsentry", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L34", - "weight": 1.0, - "source": "explorer_page_saverecentcid", - "target": "explorer_page_loadrecentcids", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/explorer/page.tsx", - "source_location": "L233", - "weight": 1.0, - "source": "explorer_page_explorerpage", - "target": "explorer_page_findfilename", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "history_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L14", - "weight": 1.0, - "source": "history_page", - "target": "history_page_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L27", - "weight": 1.0, - "source": "history_page", - "target": "history_page_getmethodbadge", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L38", - "weight": 1.0, - "source": "history_page", - "target": "history_page_historypage", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L22", - "weight": 1.0, - "source": "history_page", - "target": "history_page_truncatecid", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "history_page", - "target": "lib_storage", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "history_page", - "target": "lib_storage_clearhistory", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "history_page", - "target": "lib_storage_gethistory", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "history_page", - "target": "lib_storage_getsettings", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "history_page", - "target": "lib_storage_uploadrecord", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/history/page.tsx", - "source_location": "L100", - "weight": 1.0, - "source": "history_page_historypage", - "target": "history_page_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L9", - "weight": 1.0, - "source": "ipns_page", - "target": "ipns_page_ipnspage", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "ipns_page", - "target": "ipns_page_status", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "ipns_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "ipns_page", - "target": "lib_api_ipnsgenkey", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "ipns_page", - "target": "lib_api_ipnskey", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "ipns_page", - "target": "lib_api_ipnspublish", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "ipns_page", - "target": "lib_api_ipnsresolve", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/ipns/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "ipns_page", - "target": "lib_api_listipnskeys", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/layout-portal.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "app_layout_portal", - "target": "app_layout_portal_portallayout", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/layout-portal.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "app_layout_portal", - "target": "components_portalheader", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/layout-portal.tsx", - "source_location": "L3", - "weight": 1.0, - "source": "app_layout_portal", - "target": "components_portalsidebar", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/peers/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "peers_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/pins/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "pins_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "settings_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "upload_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "users_page", - "target": "app_layout_portal", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/layout.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "app_layout", - "target": "app_layout_metadata", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/layout.tsx", - "source_location": "L15", - "weight": 1.0, - "source": "app_layout", - "target": "app_layout_rootlayout", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/layout.tsx", - "source_location": "L9", - "weight": 1.0, - "source": "app_layout", - "target": "app_layout_viewport", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/page.tsx", - "source_location": "L9", - "weight": 1.0, - "source": "app_page", - "target": "app_page_landingpage", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "app_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "app_page", - "target": "lib_api_checkhealth", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "app_page", - "target": "lib_wallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "app_page", - "target": "lib_wallet_connectwallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "app_page", - "target": "lib_wallet_signmessage", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/peers/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "peers_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/peers/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "peers_page", - "target": "lib_api_getpeers", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/peers/page.tsx", - "source_location": "L8", - "weight": 1.0, - "source": "peers_page", - "target": "peers_page_peerspage", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/pins/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "pins_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/pins/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "pins_page", - "target": "lib_api_addpin", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/pins/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "pins_page", - "target": "lib_api_listpins", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/pins/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "pins_page", - "target": "lib_api_removepin", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/pins/page.tsx", - "source_location": "L9", - "weight": 1.0, - "source": "pins_page", - "target": "pins_page_pinspage", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "settings_page", - "target": "lib_storage", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "settings_page", - "target": "lib_storage_getsettings", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "settings_page", - "target": "lib_storage_portalsettings", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "settings_page", - "target": "lib_storage_resetsettings", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "settings_page", - "target": "lib_storage_savesettings", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L13", - "weight": 1.0, - "source": "settings_page", - "target": "settings_page_formatstoragemb", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L20", - "weight": 1.0, - "source": "settings_page", - "target": "settings_page_settingspage", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/settings/page.tsx", - "source_location": "L156", - "weight": 1.0, - "source": "settings_page_settingspage", - "target": "settings_page_formatstoragemb", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "upload_page", - "target": "components_paymentpanel", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "upload_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "upload_page", - "target": "lib_api_uploadfile", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "upload_page", - "target": "lib_storage", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "upload_page", - "target": "lib_storage_addtohistory", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "upload_page", - "target": "lib_storage_uploadrecord", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L16", - "weight": 1.0, - "source": "upload_page", - "target": "upload_page_allowed_types", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L28", - "weight": 1.0, - "source": "upload_page", - "target": "upload_page_fileentry", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L19", - "weight": 1.0, - "source": "upload_page", - "target": "upload_page_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L38", - "weight": 1.0, - "source": "upload_page", - "target": "upload_page_tabmode", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L42", - "weight": 1.0, - "source": "upload_page", - "target": "upload_page_uploadpage", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/app/upload/page.tsx", - "source_location": "L254", - "weight": 1.0, - "source": "upload_page_uploadpage", - "target": "upload_page_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "users_page", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "users_page", - "target": "lib_api_createuser", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "users_page", - "target": "lib_api_deleteuser", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "users_page", - "target": "lib_api_listusers", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "users_page", - "target": "lib_payment", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "users_page", - "target": "lib_payment_paymentservice", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "users_page", - "target": "lib_payment_uploadrecord", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L6", - "weight": 1.0, - "source": "users_page", - "target": "lib_payment_userfullstats", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "users_page", - "target": "lib_wallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "users_page", - "target": "lib_wallet_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "users_page", - "target": "lib_wallet_formatweitoeth", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/app/users/page.tsx", - "source_location": "L14", - "weight": 1.0, - "source": "users_page", - "target": "users_page_userspage", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L29", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "components_paymentpanel_paymentpanel", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L21", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "components_paymentpanel_paymentpanelprops", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L15", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "components_paymentpanel_token_icons", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_payment", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_payment_maosdiscounttier", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_payment_paymentservice", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_payment_priceinfo", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_payment_tokeninfo", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_payment_useruploadstats", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_wallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_wallet_connectwallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_wallet_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_wallet_formatweitoeth", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_wallet_getinjectedprovider", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_wallet_switchtochain270", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L5", - "weight": 1.0, - "source": "components_paymentpanel", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "confidence_score": 1.0, - "source_file": "src/components/PaymentPanel.tsx", - "source_location": "L270", - "weight": 1.0, - "source": "components_paymentpanel_paymentpanel", - "target": "lib_wallet_formatweitoeth" - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/components/PortalHeader.tsx", - "source_location": "L7", - "weight": 1.0, - "source": "components_portalheader", - "target": "components_portalheader_portalheader", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PortalHeader.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_portalheader", - "target": "lib_api", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/components/PortalHeader.tsx", - "source_location": "L4", - "weight": 1.0, - "source": "components_portalheader", - "target": "lib_api_checkhealth", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/components/PortalSidebar.tsx", - "source_location": "L19", - "weight": 1.0, - "source": "components_portalsidebar", - "target": "components_portalsidebar_nav_items", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/components/PortalSidebar.tsx", - "source_location": "L32", - "weight": 1.0, - "source": "components_portalsidebar", - "target": "components_portalsidebar_portalsidebar", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L67", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_addpin", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L28", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L181", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_bwstats", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L215", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_checkhealth", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L104", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_createuser", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L111", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_deleteuser", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L128", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_explorercat", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L124", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_explorerls", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L140", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_explorerstat", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L202", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_getbwstats", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L42", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_getnodeinfo", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L46", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_getpeers", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L188", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_getrepostats", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L117", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipfsentry", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L5", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipfsnodeinfo", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L14", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipfspin", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L21", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipfsuser", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L167", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipnsgenkey", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L146", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipnskey", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L156", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipnspublish", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L162", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_ipnsresolve", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L91", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_listfiles", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L151", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_listipnskeys", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L56", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_listpins", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L96", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_listusers", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L74", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_removepin", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L173", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_repostats", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L79", - "weight": 1.0, - "source": "lib_api", - "target": "lib_api_uploadfile", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L68", - "weight": 1.0, - "source": "lib_api_addpin", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L216", - "weight": 1.0, - "source": "lib_api_checkhealth", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L105", - "weight": 1.0, - "source": "lib_api_createuser", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L112", - "weight": 1.0, - "source": "lib_api_deleteuser", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L125", - "weight": 1.0, - "source": "lib_api_explorerls", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L141", - "weight": 1.0, - "source": "lib_api_explorerstat", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L43", - "weight": 1.0, - "source": "lib_api_getnodeinfo", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L168", - "weight": 1.0, - "source": "lib_api_ipnsgenkey", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L157", - "weight": 1.0, - "source": "lib_api_ipnspublish", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L92", - "weight": 1.0, - "source": "lib_api_listfiles", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/api.ts", - "source_location": "L75", - "weight": 1.0, - "source": "lib_api_removepin", - "target": "lib_api_apifetch", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L92", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_erc20_abi", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L29", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_ipfs_portal_payment_abi", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L122", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_maosdiscounttier", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L539", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_paymentservice", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L101", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_priceinfo", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L114", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_tokeninfo", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L127", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_uploadrecord", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L135", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_userfullstats", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L108", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_useruploadstats", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L16", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_payment_zksynclocal", - "confidence_score": 1.0 - }, - { - "relation": "imports_from", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L13", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_wallet", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L13", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_wallet_getinjectedprovider", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L13", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "imports", - "context": "import", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L13", - "weight": 1.0, - "source": "lib_payment", - "target": "lib_wallet_walletstate", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L469", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_adminconfiguretoken", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L456", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_adminremovediscounttier", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L443", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_adminsetdiscounttier", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L430", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_adminsetfreetierbytes", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L417", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_adminsetpricepermb", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L515", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_admintransferownership", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L489", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_adminwithdraweth", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L502", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_adminwithdrawtoken", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L319", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_approveandpaywithtoken", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L147", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_constructor", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L364", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_encodepaywitheth", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L289", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getbasepricepermb", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L278", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getfreetierbytes", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L261", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getmaosdiscounttiers", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L373", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getowner", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L172", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getprice", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L156", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L232", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getsupportedtokens", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L406", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_gettokensymbols", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L384", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_gettotalrevenue", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L395", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_gettotaluploads", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L189", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getuserstats", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L205", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getuseruploads", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L164", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L528", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_isdeployed", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L300", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_paywitheth", - "confidence_score": 1.0 - }, - { - "relation": "method", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L151", - "weight": 1.0, - "source": "lib_payment_paymentservice", - "target": "lib_payment_paymentservice_setcontractaddress", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L331", - "weight": 1.0, - "source": "lib_payment_paymentservice_approveandpaywithtoken", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L290", - "weight": 1.0, - "source": "lib_payment_paymentservice_getbasepricepermb", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L279", - "weight": 1.0, - "source": "lib_payment_paymentservice_getfreetierbytes", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L262", - "weight": 1.0, - "source": "lib_payment_paymentservice_getmaosdiscounttiers", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L374", - "weight": 1.0, - "source": "lib_payment_paymentservice_getowner", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L173", - "weight": 1.0, - "source": "lib_payment_paymentservice_getprice", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L233", - "weight": 1.0, - "source": "lib_payment_paymentservice_getsupportedtokens", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L407", - "weight": 1.0, - "source": "lib_payment_paymentservice_gettokensymbols", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L385", - "weight": 1.0, - "source": "lib_payment_paymentservice_gettotalrevenue", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L396", - "weight": 1.0, - "source": "lib_payment_paymentservice_gettotaluploads", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L190", - "weight": 1.0, - "source": "lib_payment_paymentservice_getuserstats", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L206", - "weight": 1.0, - "source": "lib_payment_paymentservice_getuseruploads", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L531", - "weight": 1.0, - "source": "lib_payment_paymentservice_isdeployed", - "target": "lib_payment_paymentservice_getpublicclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L477", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminconfiguretoken", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L457", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminremovediscounttier", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L444", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminsetdiscounttier", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L431", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminsetfreetierbytes", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L418", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminsetpricepermb", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L516", - "weight": 1.0, - "source": "lib_payment_paymentservice_admintransferownership", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L490", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminwithdraweth", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L503", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminwithdrawtoken", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L327", - "weight": 1.0, - "source": "lib_payment_paymentservice_approveandpaywithtoken", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L164", - "weight": 1.0, - "source": "lib_payment_paymentservice_getwalletclient", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L306", - "weight": 1.0, - "source": "lib_payment_paymentservice_paywitheth", - "target": "lib_payment_paymentservice_getwalletclient", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L313", - "weight": 1.0, - "source": "lib_payment_paymentservice_paywitheth", - "target": "lib_payment_paymentservice_encodepaywitheth", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L300", - "weight": 1.0, - "source": "lib_payment_paymentservice_paywitheth", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L319", - "weight": 1.0, - "source": "lib_payment_paymentservice_approveandpaywithtoken", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L417", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminsetpricepermb", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L430", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminsetfreetierbytes", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L443", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminsetdiscounttier", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L456", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminremovediscounttier", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L469", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminconfiguretoken", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L489", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminwithdraweth", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L502", - "weight": 1.0, - "source": "lib_payment_paymentservice_adminwithdrawtoken", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "references", - "context": "parameter_type", - "confidence": "EXTRACTED", - "source_file": "src/lib/payment.ts", - "source_location": "L515", - "weight": 1.0, - "source": "lib_payment_paymentservice_admintransferownership", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L81", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_addtohistory", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L94", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_clearhistory", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L31", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_default_settings", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L70", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_gethistory", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L41", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_getsettings", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L9", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_portalsettings", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L61", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_resetsettings", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L52", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_savesettings", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L17", - "weight": 1.0, - "source": "lib_storage", - "target": "lib_storage_uploadrecord", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L53", - "weight": 1.0, - "source": "lib_storage_savesettings", - "target": "lib_storage_getsettings", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/storage.ts", - "source_location": "L82", - "weight": 1.0, - "source": "lib_storage_addtohistory", - "target": "lib_storage_gethistory", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L26", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_chain_ids", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L116", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_connectwallet", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L18", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_detectedwallet", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L102", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_detectwallettype", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L43", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_discoverwallets", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L190", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_formatbytes", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L183", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_formatweitoeth", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L170", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_getbalance", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L92", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_getinjectedprovider", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L158", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_signmessage", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L130", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_switchtochain270", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L4", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_walletprovider", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L10", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_walletstate", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L34", - "weight": 1.0, - "source": "lib_wallet", - "target": "lib_wallet_zksync_local_chain", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L117", - "weight": 1.0, - "source": "lib_wallet_connectwallet", - "target": "lib_wallet_getinjectedprovider", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L172", - "weight": 1.0, - "source": "lib_wallet_getbalance", - "target": "lib_wallet_getinjectedprovider", - "confidence_score": 1.0 - }, - { - "relation": "calls", - "context": "call", - "confidence": "EXTRACTED", - "source_file": "src/lib/wallet.ts", - "source_location": "L131", - "weight": 1.0, - "source": "lib_wallet_switchtochain270", - "target": "lib_wallet_getinjectedprovider", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L2", - "weight": 1.0, - "source": "tsconfig", - "target": "tsconfig_compileroptions", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L40", - "weight": 1.0, - "source": "tsconfig", - "target": "tsconfig_exclude", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L31", - "weight": 1.0, - "source": "tsconfig", - "target": "tsconfig_include", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L9", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_allowjs", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L13", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_esmoduleinterop", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L19", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_incremental", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L17", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_isolatedmodules", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L18", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_jsx", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L4", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_lib", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L14", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_module", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L15", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_moduleresolution", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L12", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_noemit", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L25", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_paths", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L20", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_plugins", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L16", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_resolvejsonmodule", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L10", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_skiplibcheck", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L11", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_strict", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L3", - "weight": 1.0, - "source": "tsconfig_compileroptions", - "target": "tsconfig_compileroptions_target", - "confidence_score": 1.0 - }, - { - "relation": "contains", - "confidence": "EXTRACTED", - "source_file": "tsconfig.json", - "source_location": "L26", - "weight": 1.0, - "source": "tsconfig_compileroptions_paths", - "target": "tsconfig_paths", - "confidence_score": 1.0 - } - ], - "hyperedges": [], - "built_at_commit": "1ddc89479cc4576fc39efbb5f98578d61d736474" -} \ No newline at end of file diff --git a/graphify-out/manifest.json b/graphify-out/manifest.json deleted file mode 100644 index 82504a5..0000000 --- a/graphify-out/manifest.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "H:\\IPFS-portal\\deploy.sh": { - "mtime": 1782335829.4200108, - "ast_hash": "c2bab196ff38a17553535fe4f8bbe819", - "semantic_hash": "c2bab196ff38a17553535fe4f8bbe819" - }, - "H:\\IPFS-portal\\next.config.ts": { - "mtime": 1782323679.7429354, - "ast_hash": "e4e1a2f09cef4c8973680aada3492e6a", - "semantic_hash": "e4e1a2f09cef4c8973680aada3492e6a" - }, - "H:\\IPFS-portal\\package.json": { - "mtime": 1782331693.806062, - "ast_hash": "e27c51334fbc9da00b627bfb435c6f17", - "semantic_hash": "e27c51334fbc9da00b627bfb435c6f17" - }, - "H:\\IPFS-portal\\playwright.config.ts": { - "mtime": 1782323985.4343338, - "ast_hash": "6e5fed3d80cb43667faa997526898061", - "semantic_hash": "6e5fed3d80cb43667faa997526898061" - }, - "H:\\IPFS-portal\\postcss.config.mjs": { - "mtime": 1782310036.331215, - "ast_hash": "9a944fbda06979be39571bd9bd00b0d9", - "semantic_hash": "9a944fbda06979be39571bd9bd00b0d9" - }, - "H:\\IPFS-portal\\serve-static.js": { - "mtime": 1782305384.6641164, - "ast_hash": "bfab69b103dde3ffb47c529b702039c4", - "semantic_hash": "bfab69b103dde3ffb47c529b702039c4" - }, - "H:\\IPFS-portal\\src\\app\\admin\\payment\\page.tsx": { - "mtime": 1782329023.8102376, - "ast_hash": "5307f48b701258697597fe94b5556379", - "semantic_hash": "5307f48b701258697597fe94b5556379" - }, - "H:\\IPFS-portal\\src\\app\\api\\[...path]\\route.ts": { - "mtime": 1782323547.7908971, - "ast_hash": "f689f8997ccd50c7bf0d288d64658730", - "semantic_hash": "f689f8997ccd50c7bf0d288d64658730" - }, - "H:\\IPFS-portal\\src\\app\\api\\payment\\verify\\route.ts": { - "mtime": 1782327091.7359939, - "ast_hash": "5ad06957bde104f5a84f49207516c141", - "semantic_hash": "5ad06957bde104f5a84f49207516c141" - }, - "H:\\IPFS-portal\\src\\app\\dashboard\\page.tsx": { - "mtime": 1782323579.6307354, - "ast_hash": "317a7db415a3fe21e9efcd2910a2b571", - "semantic_hash": "317a7db415a3fe21e9efcd2910a2b571" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\components\\Breadcrumbs.tsx": { - "mtime": 1782311813.8024487, - "ast_hash": "7a8663d6921b01d4c5c40a4711cb604a", - "semantic_hash": "7a8663d6921b01d4c5c40a4711cb604a" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\components\\CIDInput.tsx": { - "mtime": 1782311809.727791, - "ast_hash": "65f143b625b84f2f2e3173e5a501bbc3", - "semantic_hash": "65f143b625b84f2f2e3173e5a501bbc3" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\components\\DirectoryListing.tsx": { - "mtime": 1782311847.8061457, - "ast_hash": "6b5535d5f6a9c217c5258cf2237d2d0a", - "semantic_hash": "6b5535d5f6a9c217c5258cf2237d2d0a" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\components\\FileIcon.tsx": { - "mtime": 1782311811.8335142, - "ast_hash": "eb56c4a87f86c02072213372fde78c57", - "semantic_hash": "eb56c4a87f86c02072213372fde78c57" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\components\\FilePreview.tsx": { - "mtime": 1782311858.0255232, - "ast_hash": "cd32e1869bcc9d2daf246ca28331adf6", - "semantic_hash": "cd32e1869bcc9d2daf246ca28331adf6" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\components\\GatewayLink.tsx": { - "mtime": 1782311816.2048059, - "ast_hash": "75c99a0ad5cec3c4a95e9a1b7c629f01", - "semantic_hash": "75c99a0ad5cec3c4a95e9a1b7c629f01" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\components\\PinBadge.tsx": { - "mtime": 1782311860.326526, - "ast_hash": "a9cfeed551301ba64baae63ae61af663", - "semantic_hash": "a9cfeed551301ba64baae63ae61af663" - }, - "H:\\IPFS-portal\\src\\app\\explorer\\page.tsx": { - "mtime": 1782311882.7185402, - "ast_hash": "54d9d6575bec7bb6d79bdfdd25ed2a91", - "semantic_hash": "54d9d6575bec7bb6d79bdfdd25ed2a91" - }, - "H:\\IPFS-portal\\src\\app\\history\\page.tsx": { - "mtime": 1782331561.210468, - "ast_hash": "49dbc35a3ac3741f194a9b669f4a0a22", - "semantic_hash": "49dbc35a3ac3741f194a9b669f4a0a22" - }, - "H:\\IPFS-portal\\src\\app\\ipns\\page.tsx": { - "mtime": 1782323444.911427, - "ast_hash": "c1df10e59827567593b103f4d2264cb1", - "semantic_hash": "c1df10e59827567593b103f4d2264cb1" - }, - "H:\\IPFS-portal\\src\\app\\layout-portal.tsx": { - "mtime": 1782245653.0417998, - "ast_hash": "d9fc9f177e5a1a6b9b7d3c055a5195d7", - "semantic_hash": "d9fc9f177e5a1a6b9b7d3c055a5195d7" - }, - "H:\\IPFS-portal\\src\\app\\layout.tsx": { - "mtime": 1782245634.5082266, - "ast_hash": "5a3014d8d3238f91d605ff08286e614b", - "semantic_hash": "5a3014d8d3238f91d605ff08286e614b" - }, - "H:\\IPFS-portal\\src\\app\\page.tsx": { - "mtime": 1782310269.774857, - "ast_hash": "2a7b2f606087627eeb707c544fbf758e", - "semantic_hash": "2a7b2f606087627eeb707c544fbf758e" - }, - "H:\\IPFS-portal\\src\\app\\peers\\page.tsx": { - "mtime": 1782245691.6038518, - "ast_hash": "611bdfac279b5c618f8e9463b560661e", - "semantic_hash": "611bdfac279b5c618f8e9463b560661e" - }, - "H:\\IPFS-portal\\src\\app\\pins\\page.tsx": { - "mtime": 1782311813.3564186, - "ast_hash": "a5f2b0b8faa633501c87a6bc4750ef9c", - "semantic_hash": "a5f2b0b8faa633501c87a6bc4750ef9c" - }, - "H:\\IPFS-portal\\src\\app\\settings\\page.tsx": { - "mtime": 1782335599.9904728, - "ast_hash": "6f75968e308d9c29703232ab04165e8f", - "semantic_hash": "6f75968e308d9c29703232ab04165e8f" - }, - "H:\\IPFS-portal\\src\\app\\upload\\page.tsx": { - "mtime": 1782335637.3023176, - "ast_hash": "23a4087203579b7238d395b3f8c48959", - "semantic_hash": "23a4087203579b7238d395b3f8c48959" - }, - "H:\\IPFS-portal\\src\\app\\users\\page.tsx": { - "mtime": 1782329529.5074713, - "ast_hash": "1e4c5ee26d4ce72bae3734bed5563ae4", - "semantic_hash": "1e4c5ee26d4ce72bae3734bed5563ae4" - }, - "H:\\IPFS-portal\\src\\components\\PaymentPanel.tsx": { - "mtime": 1782325710.1937659, - "ast_hash": "041ebb060c47ebb6b0e6fb5be0ca0f2e", - "semantic_hash": "041ebb060c47ebb6b0e6fb5be0ca0f2e" - }, - "H:\\IPFS-portal\\src\\components\\PortalHeader.tsx": { - "mtime": 1782245647.888308, - "ast_hash": "aa2056cf805a28927f51822d2acf1766", - "semantic_hash": "aa2056cf805a28927f51822d2acf1766" - }, - "H:\\IPFS-portal\\src\\components\\PortalSidebar.tsx": { - "mtime": 1782331656.858291, - "ast_hash": "d6c679be20bffe1fa35419769c9f7496", - "semantic_hash": "d6c679be20bffe1fa35419769c9f7496" - }, - "H:\\IPFS-portal\\src\\lib\\api.ts": { - "mtime": 1782329220.8041124, - "ast_hash": "7a394e3d0aa7f9cd76228bbe83b28137", - "semantic_hash": "7a394e3d0aa7f9cd76228bbe83b28137" - }, - "H:\\IPFS-portal\\src\\lib\\payment.ts": { - "mtime": 1782329623.6892607, - "ast_hash": "b90cabcab2fde7b9ac67995822a22c01", - "semantic_hash": "b90cabcab2fde7b9ac67995822a22c01" - }, - "H:\\IPFS-portal\\src\\lib\\storage.ts": { - "mtime": 1782331404.7951808, - "ast_hash": "3ad1d14d945bfb9d4febae0cb170ab37", - "semantic_hash": "3ad1d14d945bfb9d4febae0cb170ab37" - }, - "H:\\IPFS-portal\\src\\lib\\wallet.ts": { - "mtime": 1782325663.3287177, - "ast_hash": "765b52a55f741e10f2c002d393e191c5", - "semantic_hash": "765b52a55f741e10f2c002d393e191c5" - }, - "H:\\IPFS-portal\\tests\\portal.spec.ts": { - "mtime": 1782335736.5423336, - "ast_hash": "b637be3c8e2edfc09f7180a7a0247ebc", - "semantic_hash": "b637be3c8e2edfc09f7180a7a0247ebc" - }, - "H:\\IPFS-portal\\tsconfig.json": { - "mtime": 1782305238.0164084, - "ast_hash": "bb6977ff03c7e4d3028e1af49008da2f", - "semantic_hash": "bb6977ff03c7e4d3028e1af49008da2f" - } -} \ No newline at end of file diff --git a/next.config.ts b/next.config.ts index bf10ce4..7f50f76 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,8 +1,33 @@ import type { NextConfig } from 'next'; +const csp = [ + "default-src 'self'", + "script-src 'self' 'unsafe-eval' 'unsafe-inline'", // nodig voor Next.js + "style-src 'self' 'unsafe-inline'", + "img-src 'self' data: blob: https://ipfs.maos.dedyn.io https://*.maos.dedyn.io", + "media-src 'self' https://ipfs.maos.dedyn.io https://*.maos.dedyn.io", + "connect-src 'self' ws: wss: ${process.env.NEXT_PUBLIC_ZKSYNC_RPC_URL || 'http://localhost:3050'}", + "frame-src 'self'", + "base-uri 'self'", + "form-action 'self'", +].join('; '); + const nextConfig: NextConfig = { images: { unoptimized: true }, output: process.env.DOCKER_BUILD ? 'standalone' : undefined, + async headers() { + return [ + { + source: '/(.*)', + headers: [ + { key: 'Content-Security-Policy', value: csp }, + { key: 'X-Content-Type-Options', value: 'nosniff' }, + { key: 'X-Frame-Options', value: 'DENY' }, + { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' }, + ], + }, + ]; + }, }; export default nextConfig; diff --git a/public/favicon.svg b/public/favicon.svg index bc278be..8884417 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1,10 +1 @@ - - - - - - - - - M - +M diff --git a/public/manifest.json b/public/manifest.json index b532d3f..87765ba 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,31 +1,12 @@ { "name": "MAOS IPFS Portal", "short_name": "IPFS Portal", - "description": "Decentralized storage management for your IPFS node", + "description": "Decentralized storage management for IPFS", "start_url": "/", "display": "standalone", - "background_color": "#0a0e17", + "background_color": "#0f172a", "theme_color": "#0891b2", - "orientation": "any", - "categories": ["utilities", "productivity"], "icons": [ - { - "src": "/icon-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "any maskable" - }, - { - "src": "/icon-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "any maskable" - }, - { - "src": "/icon-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } + { "src": "/favicon.svg", "sizes": "any", "type": "image/svg+xml" } ] } diff --git a/public/sw.js b/public/sw.js index a924243..964aaa7 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,145 +1,31 @@ -/* ── IPFS Portal — Service Worker v3 ── - * - * Cache strategieën per route type: - * - Precache: alleen publieke pages (auth-protected pages worden - * gecachet via stale-while-revalidate tijdens normaal gebruik) - * - Cache-first: static assets (fonts, images, CSS, JS) - * - Network-first: API calls (/_next/data, /api/*) - * - Stale-while-revalidate: navigatie requests - * - * Let op: auth-protected pages (dashboard, upload, settings, etc.) - * worden NIET geprecached — tijdens installatie is er geen sessie- - * cookie, dus de middleware redirect naar /login. Alleen publieke - * pagina's in de precache. +/* ── IPFS Portal Service Worker ── + * Minimal offline cache for static assets. + * Auto-generated — do not edit manually. */ +const CACHE = 'ipfs-portal-v1'; +const PRECACHE = ['/', '/manifest.json', '/favicon.svg']; -const CACHE = 'ipfs-portal-v4'; -const STATIC_CACHE = 'ipfs-portal-static-v4'; -const DATA_CACHE = 'ipfs-portal-data-v4'; - -const PRECACHE_URLS = [ - '/', - '/login', -]; - -/* ── Install: precache app shell ── */ - -self.addEventListener('install', (event) => { - event.waitUntil( - caches.open(CACHE).then((cache) => cache.addAll(PRECACHE_URLS)) +self.addEventListener('install', (e) => { + e.waitUntil( + caches.open(CACHE).then((c) => c.addAll(PRECACHE)).then(() => self.skipWaiting()), ); - self.skipWaiting(); }); -/* ── Activate: clean old caches ── */ - -self.addEventListener('activate', (event) => { - event.waitUntil( - caches.keys().then((keys) => - Promise.all( - keys - .filter((k) => k !== CACHE && k !== STATIC_CACHE && k !== DATA_CACHE) - .map((k) => caches.delete(k)) - ) - ) +self.addEventListener('activate', (e) => { + e.waitUntil( + caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))), ); - self.clients.claim(); }); -/* ── Helper: is this a navigation request? ── */ - -function isNavigation(req) { - return req.mode === 'navigate'; -} - -function isStaticAsset(url) { - return /\.(png|jpg|jpeg|gif|svg|webp|ico|woff2?|ttf|eot|css|js|json)$/i.test(url.pathname); -} - -function isAPIRequest(url) { - return url.pathname.startsWith('/api/') || url.pathname.startsWith('/_next/data/'); -} - -/* ── Fetch handler ── */ - -self.addEventListener('fetch', (event) => { - const { request } = event; - const url = new URL(request.url); - - // Same-origin only - if (url.origin !== self.location.origin) return; - - // Only cache GET/HEAD — POST/PUT/DELETE/OPTIONS can't use Cache API - if (request.method !== 'GET' && request.method !== 'HEAD') { - return; // pass through, no caching - } - - // 1. Static assets → cache-first - if (isStaticAsset(url)) { - event.respondWith(cacheFirst(request, STATIC_CACHE)); - return; - } - - // 2. API / Next.js data → network-first - if (isAPIRequest(url)) { - event.respondWith(networkFirst(request, DATA_CACHE)); - return; - } - - // 3. Navigation → network-first (nooit stale HTML serveren, HMR breekt) - if (isNavigation(request)) { - event.respondWith(networkFirst(request, CACHE)); - return; - } - - // 4. All other requests → network-first with cache fallback - event.respondWith(networkFirst(request, CACHE)); +self.addEventListener('fetch', (e) => { + if (e.request.method !== 'GET') return; + e.respondWith( + caches.match(e.request).then((cached) => cached || fetch(e.request).then((res) => { + if (res.ok && res.url.startsWith(self.location.origin)) { + const clone = res.clone(); + caches.open(CACHE).then((c) => c.put(e.request, clone)); + } + return res; + })), + ); }); - -/* ── Cache strategies ── */ - -async function cacheFirst(request, cacheName) { - const cached = await caches.match(request); - if (cached) return cached; - try { - const response = await fetch(request); - // Cache API supports GET/HEAD only - if (response.ok && request.method === 'GET') { - const cache = await caches.open(cacheName); - cache.put(request, response.clone()); - } - return response; - } catch { - return new Response('Offline', { status: 503 }); - } -} - -async function networkFirst(request, cacheName) { - try { - const response = await fetch(request); - // Cache API supports GET/HEAD only — POST/PUT/DELETE must be skipped - if (response.ok && request.method === 'GET') { - const cache = await caches.open(cacheName); - cache.put(request, response.clone()); - } - return response; - } catch { - const cached = await caches.match(request); - if (cached) return cached; - return new Response('Offline', { status: 503 }); - } -} - -async function staleWhileRevalidate(request, cacheName) { - const cache = await caches.open(cacheName); - const cached = await cache.match(request); - - const fetchPromise = fetch(request) - .then((response) => { - if (response.ok && request.method === 'GET') cache.put(request, response.clone()); - return response; - }) - .catch(() => cached); - - return cached || fetchPromise; -} diff --git a/serve-static.js b/serve-static.js deleted file mode 100644 index 97c0c17..0000000 --- a/serve-static.js +++ /dev/null @@ -1,26 +0,0 @@ -const http = require('http'); -const fs = require('fs'); -const path = require('path'); - -const PORT = 3444; -const ROOT = path.join(__dirname, 'out'); -const MIME = { '.html':'text/html','.js':'text/javascript','.css':'text/css','.png':'image/png','.svg':'image/svg+xml','.ico':'image/x-icon','.json':'application/json' }; - -http.createServer((req, res) => { - let fp = path.join(ROOT, req.url === '/' ? 'index.html' : req.url); - // SPA fallback: serve index.html for non-file routes - if (!fs.existsSync(fp) || fs.statSync(fp).isDirectory()) { - fp = path.join(ROOT, 'index.html'); - } - if (fs.existsSync(fp)) { - const ext = path.extname(fp); - res.writeHead(200, { 'Content-Type': MIME[ext] || 'text/html' }); - fs.createReadStream(fp).pipe(res); - } else { - res.writeHead(404); - res.end('Not found'); - } -}).listen(PORT, () => { - console.log(IPFS Portal: http://localhost:); - console.log(Network: http://100.112.2.113:); -}); diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 8447a07..1ca945b 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -3,7 +3,9 @@ import { useEffect, useState } from 'react'; import PortalLayout from '@/app/layout-portal'; import AuthGuard from '@/components/AuthGuard'; -import { listUsers, getNodeInfo, checkHealth, type IPFSNodeInfo } from '@/lib/api'; +import { listUsers } from '@/lib/api/users'; +import { getNodeInfo, checkHealth } from '@/lib/api/gateway'; +import type { IPFSNodeInfo } from '@/lib/api/client'; import { SkeletonCard, SkeletonTable } from '@/components/Skeleton'; import Link from 'next/link'; import { @@ -22,14 +24,14 @@ export default function AdminPage() { useEffect(() => { listUsers() .then(setUsers) - .catch(() => {}) + .catch((err) => { console.error('[Admin] listUsers failed:', err); }) .finally(() => setLoadingUsers(false)); }, []); useEffect(() => { checkHealth() .then((h: any) => setHealth(h)) - .catch(() => {}) + .catch((err) => { console.error('[Admin] checkHealth failed:', err); }) .finally(() => setLoadingHealth(false)); }, []); diff --git a/src/app/admin/payment/components.tsx b/src/app/admin/payment/components.tsx new file mode 100644 index 0000000..498209b --- /dev/null +++ b/src/app/admin/payment/components.tsx @@ -0,0 +1,107 @@ +"use client"; + +import { Wallet, Loader2, CheckCircle, XCircle, AlertTriangle, LogOut } from "lucide-react"; +import type { ViewMode, TxStatus } from "./helpers"; +import { VIEW_LABELS } from "./helpers"; + +/* ── Wallet Connection ── */ +interface WalletConnectProps { + connecting: boolean; + onConnect: () => void; +} + +export function WalletConnect({ connecting, onConnect }: WalletConnectProps) { + return ( +
+ +

Connect wallet to view admin panel

+ +
+ ); +} + +/* ── Wrong chain warning ── */ +export function WrongChainWarning() { + return ( +
+ + Please switch to zkSync Local (chain 270) +
+ ); +} + +/* ── Wallet Info Header ── */ +interface WalletInfoProps { + address: string; + isOwner: boolean; + loading: boolean; + onRefresh: () => void; + onDisconnect: () => void; +} + +export function WalletInfo({ address, isOwner, loading, onRefresh, onDisconnect }: WalletInfoProps) { + return ( +
+ + {address.slice(0, 6)}...{address.slice(-4)} + + + + {isOwner ? "Owner" : "Viewer"} + + + +
+ ); +} + +/* ── Navigation Tabs ── */ +interface NavTabsProps { + view: ViewMode; + onChange: (view: ViewMode) => void; +} + +export function NavTabs({ view, onChange }: NavTabsProps) { + return ( +
+ {(Object.keys(VIEW_LABELS) as ViewMode[]).map((v) => ( + + ))} +
+ ); +} + +/* ── TX Status Toast ── */ +interface TxStatusToastProps { + status: TxStatus; +} + +export function TxStatusToast({ status }: TxStatusToastProps) { + if (!status) return null; + return ( +
+ {status.ok ? : } + {status.msg} +
+ ); +} diff --git a/src/app/admin/payment/components/PricingView.tsx b/src/app/admin/payment/components/PricingView.tsx index a2de36b..efe1e28 100644 --- a/src/app/admin/payment/components/PricingView.tsx +++ b/src/app/admin/payment/components/PricingView.tsx @@ -2,9 +2,10 @@ import { type Dispatch, type SetStateAction } from 'react'; import { Settings } from 'lucide-react'; -import { paymentService, type TokenInfo } from '@/lib/payment'; +import { usePaymentService, type TokenInfo } from '@/lib/payment'; +import { formatBytes } from '@/lib/helpers'; import type { WalletProvider } from '@/lib/wallet'; -import { formatWeiToETH, formatBytes } from '@/lib/wallet'; +import { formatWeiToETH } from '@/lib/wallet'; /* ── Props ── */ interface PricingViewProps { @@ -29,6 +30,7 @@ export default function PricingView({ priceInput, setPriceInput, freeInput, setFreeInput, doTx, provider, address, }: PricingViewProps) { + const paymentService = usePaymentService(); return (
diff --git a/src/app/admin/payment/components/TiersView.tsx b/src/app/admin/payment/components/TiersView.tsx index ce23732..465819a 100644 --- a/src/app/admin/payment/components/TiersView.tsx +++ b/src/app/admin/payment/components/TiersView.tsx @@ -2,7 +2,7 @@ import { type Dispatch, type SetStateAction } from 'react'; import { Tags, Plus, Trash2 } from 'lucide-react'; -import { paymentService, type MAOSDiscountTier } from '@/lib/payment'; +import { usePaymentService, type MAOSDiscountTier } from '@/lib/payment'; import type { WalletProvider } from '@/lib/wallet'; import { formatWeiToETH } from '@/lib/wallet'; @@ -25,6 +25,7 @@ export default function TiersView({ tierBalance, setTierBalance, tierBps, setTierBps, doTx, provider, }: TiersViewProps) { + const paymentService = usePaymentService(); return (
diff --git a/src/app/admin/payment/components/TokensView.tsx b/src/app/admin/payment/components/TokensView.tsx index 6e9d5b8..436d580 100644 --- a/src/app/admin/payment/components/TokensView.tsx +++ b/src/app/admin/payment/components/TokensView.tsx @@ -2,7 +2,7 @@ import { type Dispatch, type SetStateAction } from 'react'; import { Coins, PiggyBank } from 'lucide-react'; -import { paymentService, type TokenInfo } from '@/lib/payment'; +import { usePaymentService, type TokenInfo } from '@/lib/payment'; import type { WalletProvider } from '@/lib/wallet'; import { formatWeiToETH } from '@/lib/wallet'; @@ -34,6 +34,7 @@ export default function TokensView({ tokenDec, setTokenDec, tokenWei, setTokenWei, tokenEnabled, setTokenEnabled, doTx, provider, address, }: TokensViewProps) { + const paymentService = usePaymentService(); return (
diff --git a/src/app/admin/payment/helpers.ts b/src/app/admin/payment/helpers.ts new file mode 100644 index 0000000..91890ab --- /dev/null +++ b/src/app/admin/payment/helpers.ts @@ -0,0 +1,12 @@ +/* ── Admin Payment Helpers ── */ + +export type ViewMode = "overview" | "pricing" | "tokens" | "tiers"; + +export type TxStatus = { ok: boolean; msg: string } | null; + +export const VIEW_LABELS: Record = { + overview: "Overview", + pricing: "Pricing", + tokens: "Tokens", + tiers: "Discount Tiers", +}; diff --git a/src/app/admin/payment/page.tsx b/src/app/admin/payment/page.tsx index 6d12b72..1f3c0e5 100644 --- a/src/app/admin/payment/page.tsx +++ b/src/app/admin/payment/page.tsx @@ -3,22 +3,20 @@ import { useState, useEffect, useCallback } from 'react'; import PortalLayout from '@/app/layout-portal'; import AuthGuard from '@/components/AuthGuard'; -import { paymentService, type TokenInfo, type MAOSDiscountTier } from '@/lib/payment'; +import { paymentService, PaymentProvider, type TokenInfo, type MAOSDiscountTier } from '@/lib/payment'; import { - connectWallet, switchToChain270, getInjectedProvider, - formatWeiToETH, formatBytes, type WalletProvider, + connectWallet, switchToChain270, getInjectedProvider, addWalletListener, disconnectWallet, + type WalletProvider, } from '@/lib/wallet'; -import { - Wallet, Loader2, CheckCircle, XCircle, - RefreshCw, AlertTriangle, -} from 'lucide-react'; +import { SkeletonCard } from '@/components/Skeleton'; +import { useNotify } from '@/lib/notifications'; import Overview from './components/Overview'; import PricingView from './components/PricingView'; import TokensView from './components/TokensView'; import TiersView from './components/TiersView'; - -type ViewMode = 'overview' | 'pricing' | 'tokens' | 'tiers'; -type TxStatus = { ok: boolean; msg: string } | null; +import ErrorBoundary from '@/components/ErrorBoundary'; +import type { ViewMode, TxStatus } from './helpers'; +import { WalletConnect, WrongChainWarning, WalletInfo, NavTabs, TxStatusToast } from './components'; export default function AdminPaymentPage() { const [address, setAddress] = useState(null); @@ -42,13 +40,14 @@ export default function AdminPaymentPage() { const [contractBalance, setContractBalance] = useState>({}); const isOwner = !!(address && owner && address.toLowerCase() === owner.toLowerCase()); + const { notify } = useNotify(); // ── Load all contract state ── const refresh = useCallback(async () => { setLoading(true); setTxStatus(null); try { - paymentService.isDeployed().then(setDeployed).catch(() => setDeployed(false)); + paymentService.isDeployed().then(setDeployed).catch((err) => { console.error('[AdminPayment] Deploy check failed:', err); setDeployed(false); }); const [own, price, free, t, tiersData, uploads] = await Promise.all([ paymentService.getOwner(), paymentService.getBasePricePerMB(), @@ -62,7 +61,6 @@ export default function AdminPaymentPage() { setFreeTier(free); setTiers(tiersData); - // Deduplicate by symbol const seen = new Set(); const uniqueTokens = t.filter(tk => { if (seen.has(tk.symbol)) return false; @@ -72,32 +70,29 @@ export default function AdminPaymentPage() { setTokens(uniqueTokens); const symbols = uniqueTokens.map(tk => tk.symbol); - const revEntries = await Promise.all( - symbols.map(s => paymentService.getTotalRevenue(s)) - ); + const revEntries = await Promise.all(symbols.map(s => paymentService.getTotalRevenue(s))); const revMap: Record = {}; symbols.forEach((s, i) => { revMap[s] = revEntries[i]; }); setRevenues(revMap); - // Balances via RPC const balMap: Record = {}; for (const tk of t) { try { - const client = paymentService['getPublicClient'](); + const client = (paymentService as any)['getPublicClient'](); if (tk.symbol === 'ETH') { - const bal = await client.getBalance({ address: paymentService['contractAddress'] }); + const bal = await client.getBalance({ address: (paymentService as any)['contractAddress'] }); balMap['ETH'] = bal.toString(); } else if (tk.address && tk.address !== '0x0000000000000000000000000000000000000000') { - const ERC20_BAL_ABI = [{ type: 'function', name: 'balanceOf', inputs: [{ type: 'address' }], outputs: [{ type: 'uint256' }], stateMutability: 'view' }] as const; + const ERC20_BAL_ABI = [{ type: 'function' as const, name: 'balanceOf', inputs: [{ type: 'address' as const }], outputs: [{ type: 'uint256' as const }], stateMutability: 'view' as const }]; const bal = await client.readContract({ address: tk.address as `0x${string}`, abi: ERC20_BAL_ABI, functionName: 'balanceOf', - args: [paymentService['contractAddress']], + args: [(paymentService as any)['contractAddress']], }); balMap[tk.symbol] = (bal as bigint).toString(); } - } catch { /* skip */ } + } catch (err) { console.error('[AdminPayment] Failed to fetch balance for token:', err); } } setContractBalance(balMap); setTotalUploads(uploads); @@ -111,6 +106,22 @@ export default function AdminPaymentPage() { useEffect(() => { refresh(); }, [refresh]); + // ── Listen for external wallet disconnect ── + useEffect(() => { + if (!provider) return; + const cb = (accounts: string[]) => { + if (accounts.length === 0) { + setAddress(null); + setProvider(null); + setConnecting(false); + setWrongChain(false); + setWalletType(null); + notify({ type: 'info', title: 'Wallet disconnected' }); + } + }; + addWalletListener('accountsChanged', cb); + }, [provider, notify]); + // ── Connect wallet ── async function handleConnect() { setConnecting(true); @@ -129,14 +140,20 @@ export default function AdminPaymentPage() { else if (window.ethereum?.isRabby) setWalletType('Rabby'); else if (window.ethereum?.isMetaMask) setWalletType('MetaMask'); else setWalletType('Wallet'); - } catch (e: any) { - setTxStatus({ ok: false, msg: e.message || 'Connect failed' }); + } catch (e: unknown) { + setTxStatus({ ok: false, msg: e instanceof Error ? e.message : 'Connect failed' }); } finally { setConnecting(false); } } - // ── Admin action helper ── + function handleDisconnect() { + disconnectWallet(); + setAddress(null); setProvider(null); setConnecting(false); + setWrongChain(false); setWalletType(null); + notify({ type: 'success', title: 'Wallet disconnected' }); + } + async function doTx(label: string, fn: () => Promise) { if (!provider) return; setTxStatus(null); @@ -144,8 +161,8 @@ export default function AdminPaymentPage() { const hash = await fn(); setTxStatus({ ok: true, msg: `${label} success: ${hash.slice(0, 10)}...` }); await refresh(); - } catch (e: any) { - setTxStatus({ ok: false, msg: `${label} failed: ${e.message || e}` }); + } catch (e: unknown) { + setTxStatus({ ok: false, msg: `${label} failed: ${e instanceof Error ? e.message : String(e)}` }); } } @@ -164,64 +181,33 @@ export default function AdminPaymentPage() { return ( - {/* ── Header ── */} +

Payment Admin

Manage IPFS Portal payment contract

-
- {address && ( - - - {isOwner ? 'Owner' : 'Viewer'} - - )} - -
+ {address && ( + + )}
- {/* ── Connect wallet ── */} - {!address && ( -
- -

Connect wallet to view admin panel

- -
- )} - - {wrongChain && ( -
- - Please switch to zkSync Local (chain 270) -
- )} + {!address && } + {wrongChain && } {address && ( - <> - {/* ── Nav tabs ── */} -
- {(['overview', 'pricing', 'tokens', 'tiers'] as ViewMode[]).map(v => ( - - ))} -
+ + - {/* ── Loading ── */} {loading ? ( -
- Loading contract state... +
+ {Array.from({ length: 6 }).map((_, i) => )}
) : ( <> @@ -231,7 +217,7 @@ export default function AdminPaymentPage() { tokens={tokens} revenues={revenues} contractBalance={contractBalance} - contractAddress={paymentService['contractAddress']} + contractAddress={(paymentService as any)['contractAddress']} owner={owner} isOwner={isOwner} address={address} @@ -239,7 +225,6 @@ export default function AdminPaymentPage() { onNavigate={(v: string) => setView(v as ViewMode)} /> )} - {view === 'pricing' && ( )} - {view === 'tokens' && ( )} - {view === 'tiers' && ( )} - {/* ── TX Status ── */} - {txStatus && ( -
- {txStatus.ok ? : } - {txStatus.msg} -
- )} - + + )} + ); diff --git a/src/app/api/[...path]/__tests__/route.test.ts b/src/app/api/[...path]/__tests__/route.test.ts index 2d1a69d..ad21a77 100644 --- a/src/app/api/[...path]/__tests__/route.test.ts +++ b/src/app/api/[...path]/__tests__/route.test.ts @@ -3,85 +3,9 @@ import { describe, it, expect } from 'vitest'; /* ── Route matching & Kubo mapping tests ── * * These test the pure functions from route.ts in isolation. - * We import the source directly since these functions have no - * external dependencies (no fetch, no cookies, no process.env). + * They're now exported so we import directly instead of duplicating logic. */ - -// Inline import — vitest resolves @/ alias via vitest.config.ts -// We need to import the actual functions. Since they're not exported -// (they're module-private), we duplicate the logic here for testing. -// In a real project, consider exporting them for testability. - -function matchRoute(path: string[], method: string): { target: string; path: string; method: string } | null { - if (!path || path.length === 0) return null; - const [segment, ...rest] = path; - - switch (segment) { - case 'health': - return { target: 'health', path: '/health', method }; - case 'auth': - return { target: 'auth', path: '/' + (rest.length > 0 ? rest.join('/') : ''), method }; - case 'users': - return { target: 'users', path: '/users' + (rest.length > 0 ? '/' + rest.join('/') : ''), method }; - case 'explorer': - case 'ipns': - return { target: 'ipfs', path: '/' + path.join('/'), method }; - default: - return { target: 'ipfs', path: '/' + path.join('/'), method }; - } -} - -function mapToKuboAPI(path: string, method: string): string { - const p = path.replace(/^\/+/, '').replace(/\/+$/, ''); - switch (p) { - case 'node/info': - return '/api/v0/id'; - case 'peers': - return '/api/v0/swarm/peers'; - case 'pins': - return method === 'GET' ? '/api/v0/pin/ls' : '/api/v0/pin/add'; - default: - if (p.startsWith('pins/')) { - const cid = p.slice(5); - return `/api/v0/pin/rm?arg=${encodeURIComponent(cid)}`; - } - if (p === 'files/upload') { - return '/api/v0/add?pin=true'; - } - if (p.startsWith('files/')) { - return '/api/v0/ls'; - } - if (p.startsWith('explorer/ls/')) { - const cid = p.slice('explorer/ls/'.length); - return `/api/v0/ls?arg=${encodeURIComponent(cid)}`; - } - if (p.startsWith('explorer/cat/')) { - const cid = p.slice('explorer/cat/'.length); - return `/api/v0/cat?arg=${encodeURIComponent(cid)}`; - } - if (p.startsWith('explorer/stat/')) { - const cid = p.slice('explorer/stat/'.length); - return `/api/v0/object/stat?arg=${encodeURIComponent(cid)}`; - } - if (p.startsWith('explorer/resolve/')) { - const name = p.slice('explorer/resolve/'.length); - return `/api/v0/resolve?arg=${encodeURIComponent(name)}`; - } - if (p === 'ipns/publish') return '/api/v0/name/publish'; - if (p === 'ipns/keys') return '/api/v0/key/list'; - if (p.startsWith('ipns/resolve/')) { - const name = p.slice('ipns/resolve/'.length); - return `/api/v0/name/resolve?arg=${encodeURIComponent(name)}`; - } - if (p.startsWith('ipns/keys/gen/')) { - const name = p.slice('ipns/keys/gen/'.length); - return `/api/v0/key/gen?arg=${encodeURIComponent(name)}`; - } - if (p === 'repo/stats') return '/api/v0/repo/stat'; - if (p === 'bw/stats') return '/api/v0/bw/stats'; - return '/api/v0/' + p; - } -} +import { matchRoute, mapToKuboAPI } from '../route'; /* ════════════════════════ matchRoute ════════════════════════ */ @@ -96,37 +20,24 @@ describe('matchRoute', () => { expect(r?.path).toBe('/health'); }); - it('routes auth', () => { - const r = matchRoute(['auth'], 'GET'); - expect(r?.target).toBe('auth'); - expect(r?.path).toBe('/'); - }); - - it('routes auth/me', () => { - const r = matchRoute(['auth', 'me'], 'GET'); - expect(r?.target).toBe('auth'); - expect(r?.path).toBe('/me'); - }); - - it('routes auth/login with POST', () => { - const r = matchRoute(['auth', 'login'], 'POST'); - expect(r?.target).toBe('auth'); - expect(r?.path).toBe('/login'); - expect(r?.method).toBe('POST'); - }); - it('routes users', () => { const r = matchRoute(['users'], 'GET'); - expect(r?.target).toBe('users'); + expect(r?.target).toBe('user'); expect(r?.path).toBe('/users'); }); it('routes users with subpath', () => { const r = matchRoute(['users', 'create'], 'POST'); - expect(r?.target).toBe('users'); + expect(r?.target).toBe('user'); expect(r?.path).toBe('/users/create'); }); + it('routes node/info to user API', () => { + const r = matchRoute(['node', 'info'], 'GET'); + expect(r?.target).toBe('user'); + expect(r?.path).toBe('/node/info'); + }); + it('routes explorer to ipfs', () => { const r = matchRoute(['explorer', 'ls', 'QmTest'], 'GET'); expect(r?.target).toBe('ipfs'); @@ -212,7 +123,7 @@ describe('mapToKuboAPI', () => { }); it('maps bw/stats', () => { - expect(mapToKuboAPI('bw/stats', 'GET')).toBe('/api/v0/bw/stats'); + expect(mapToKuboAPI('bw/stats', 'GET')).toBe('/api/v0/bw'); }); it('falls through for unknown paths', () => { diff --git a/src/app/api/[...path]/handlers.ts b/src/app/api/[...path]/handlers.ts new file mode 100644 index 0000000..7a3d952 --- /dev/null +++ b/src/app/api/[...path]/handlers.ts @@ -0,0 +1,69 @@ +import { NextRequest, NextResponse } from 'next/server'; +import { userApiBase, userApiAdminKey } from '@/lib/config'; + +export async function handleHealth(req: NextRequest): Promise { + // Check User API reachability + let userApiOk = false; + let userApiMsg = 'unknown'; + try { + const r = await fetch(`${userApiBase()}/users`, { + headers: { 'X-Admin-Key': userApiAdminKey() }, + signal: AbortSignal.timeout(5000), + }); + if (r.ok) { + userApiOk = true; + userApiMsg = 'connected'; + } else { + userApiMsg = `status ${r.status}`; + } + } catch (e: unknown) { + userApiMsg = e instanceof Error ? e.message.substring(0, 60) : 'error'; + } + + // Check Kubo API reachability + let kuboApiOk = false; + let kuboApiMsg = 'not configured'; + const kuboSvc = process.env.KUBO_API_URL; + const kuboAuth = process.env.KUBO_BASIC_AUTH; + if (kuboSvc) { + try { + const headers: Record = {}; + if (kuboAuth) { + headers['Authorization'] = 'Basic ' + Buffer.from(kuboAuth).toString('base64'); + } + const r = await fetch(kuboSvc.replace(/\/+$/, '') + '/api/v0/version', { + method: 'POST', + headers, + signal: AbortSignal.timeout(5000), + }); + if (r.ok) { + const data = await r.json(); + kuboApiOk = true; + kuboApiMsg = `v${data.Version || 'unknown'}`; + } else { + kuboApiMsg = `status ${r.status}`; + } + } catch (e: unknown) { + kuboApiMsg = e instanceof Error ? e.message.substring(0, 60) : 'error'; + } + } + + const overall = userApiOk || kuboApiOk ? 'ok' : 'degraded'; + + return NextResponse.json({ + status: overall, + userApi: userApiMsg, + kuboApi: kuboApiMsg, + mode: process.env.KUBO_API_URL ? 'proxy' : 'minimal', + }); +} + +export async function proxyResult(res: Response): Promise { + const text = await res.text(); + return new NextResponse(text, { + status: res.status, + headers: { + 'Content-Type': 'application/json', + }, + }); +} diff --git a/src/app/api/[...path]/proxy-ipfs.ts b/src/app/api/[...path]/proxy-ipfs.ts new file mode 100644 index 0000000..31a019a --- /dev/null +++ b/src/app/api/[...path]/proxy-ipfs.ts @@ -0,0 +1,132 @@ +import { NextRequest, NextResponse } from 'next/server'; +import { kuboApiUrl, kuboBasicAuth } from '@/lib/config'; + +export async function proxyIPFS(path: string, method: string, req: NextRequest): Promise { + // In dev, the Kubo API is behind nginx with Basic Auth. + // If no KUBO_API_URL is configured, return a clear error. + const kuboSvc = kuboApiUrl(); + if (!kuboSvc) { + return NextResponse.json( + { error: 'IPFS proxy not configured', detail: 'Set KUBO_API_URL in env for dev, or use nginx routing in production' }, + { status: 501 } + ); + } + + // Map /api/explorer/ls/ → /api/v0/ls?arg=, etc. + const url = new URL(kuboSvc); + const kuboPath = mapToKuboAPI(path, method); + // Split pathname and query string — url.pathname encodes `?` as `%3F` + const [namePart, ...qsParts] = kuboPath.split('?'); + url.pathname = namePart; + if (qsParts.length > 0) { + url.search = qsParts.join('?'); + } else { + // Forward incoming query params (used by ipns/publish etc.) + const incomingSearch = req.nextUrl.search; + if (incomingSearch) { + url.search = incomingSearch; + } + } + + const headers: Record = {}; + const auth = kuboBasicAuth(); + if (auth) { + headers['Authorization'] = 'Basic ' + Buffer.from(auth).toString('base64'); + } + + // Forward Content-Type (preserves multipart boundary for file uploads) + const reqCt = req.headers.get('content-type'); + if (reqCt) { + headers['Content-Type'] = reqCt; + } + + // Kubo uses POST for everything + const body = method === 'POST' || method === 'DELETE' ? req.body : null; + const fetchOpts: RequestInit & { duplex?: string } = { + method: 'POST', + headers, + signal: AbortSignal.timeout(30000), + }; + // Node.js fetch requires duplex: 'half' when streaming a body + if (body) { + fetchOpts.duplex = 'half'; + fetchOpts.body = body; + } + + let res: Response; + try { + res = await fetch(url.toString(), fetchOpts); + } catch (fetchErr: unknown) { + const msg = fetchErr instanceof Error ? fetchErr.message : String(fetchErr); + console.error('[proxyIPFS] fetch error:', msg); + return NextResponse.json( + { error: 'IPFS proxy fetch failed', detail: msg.substring(0, 200) }, + { status: 502 }, + ); + } + + const text = await res.text(); + + return new NextResponse(text, { + status: res.status, + headers: { + 'Content-Type': res.headers.get('Content-Type') || 'application/json', + }, + }); +} + +export function mapToKuboAPI(path: string, method: string): string { + // Normalize: /api/node/info → /api/v0/id, etc. + const p = path.replace(/^\/+/, '').replace(/\/+$/, ''); + switch (p) { + case 'node/info': + return '/api/v0/id'; + case 'peers': + return '/api/v0/swarm/peers'; + case 'pins': + return method === 'GET' ? '/api/v0/pin/ls' : '/api/v0/pin/add'; + default: + if (p.startsWith('pins/')) { + const cid = p.slice(5); + return `/api/v0/pin/rm?arg=${encodeURIComponent(cid)}`; + } + if (p === 'files/upload') { + return '/api/v0/add?pin=true'; + } + if (p.startsWith('files/')) { + return '/api/v0/ls'; + } + // Explorer routes: /explorer/ls/, /explorer/cat/, etc. + if (p.startsWith('explorer/ls/')) { + const cid = p.slice('explorer/ls/'.length); + return `/api/v0/ls?arg=${encodeURIComponent(cid)}`; + } + if (p.startsWith('explorer/cat/')) { + const cid = p.slice('explorer/cat/'.length); + return `/api/v0/cat?arg=${encodeURIComponent(cid)}`; + } + if (p.startsWith('explorer/stat/')) { + const cid = p.slice('explorer/stat/'.length); + return `/api/v0/object/stat?arg=${encodeURIComponent(cid)}`; + } + if (p.startsWith('explorer/resolve/')) { + const name = p.slice('explorer/resolve/'.length); + return `/api/v0/resolve?arg=${encodeURIComponent(name)}`; + } + // IPNS routes + if (p === 'ipns/publish') return '/api/v0/name/publish'; + if (p === 'ipns/keys') return '/api/v0/key/list'; + if (p.startsWith('ipns/resolve/')) { + const name = p.slice('ipns/resolve/'.length); + return `/api/v0/name/resolve?arg=${encodeURIComponent(name)}`; + } + if (p.startsWith('ipns/keys/gen/')) { + const name = p.slice('ipns/keys/gen/'.length); + return `/api/v0/key/gen?arg=${encodeURIComponent(name)}`; + } + // Dashboard routes + if (p === 'repo/stats') return '/api/v0/repo/stat'; + if (p === 'bw/stats') return '/api/v0/bw'; + return '/api/v0/' + p; + } +} diff --git a/src/app/api/[...path]/proxy-user.ts b/src/app/api/[...path]/proxy-user.ts new file mode 100644 index 0000000..7ed9c9a --- /dev/null +++ b/src/app/api/[...path]/proxy-user.ts @@ -0,0 +1,34 @@ +import { NextRequest } from 'next/server'; +import { verifySessionJWT, SESSION_COOKIE } from '@/lib/auth-server'; +import { userApiBase, userApiAdminKey } from '@/lib/config'; + +async function getSessionToken(req: NextRequest): Promise { + const token = req.cookies.get(SESSION_COOKIE)?.value; + if (!token) return null; + const session = await verifySessionJWT(token); + return session?.sessionToken ?? null; +} + +export async function proxyUserAPI(path: string, method: string, body: ReadableStream | null, req: NextRequest): Promise { + const url = `${userApiBase()}${path}`; + const headers: Record = { + 'X-Admin-Key': userApiAdminKey(), + }; + + if (method === 'POST' || method === 'PUT') { + headers['Content-Type'] = 'application/json'; + } + + // Forward session token from JWT cookie to Python backend + const sessionToken = await getSessionToken(req); + if (sessionToken) { + headers['X-Session-Token'] = sessionToken; + } + + return fetch(url, { + method, + headers, + body, + signal: AbortSignal.timeout(15000), + }); +} diff --git a/src/app/api/[...path]/route.ts b/src/app/api/[...path]/route.ts index 3746acd..903d48c 100644 --- a/src/app/api/[...path]/route.ts +++ b/src/app/api/[...path]/route.ts @@ -11,24 +11,18 @@ */ import { NextRequest, NextResponse } from 'next/server'; -import { verifySessionJWT, SESSION_COOKIE } from '@/lib/auth-server'; +import type { RouteMatch } from './types'; +import { proxyUserAPI } from './proxy-user'; +import { proxyIPFS } from './proxy-ipfs'; +import { handleHealth, proxyResult } from './handlers'; + +export { mapToKuboAPI } from './proxy-ipfs'; export const dynamic = 'force-dynamic'; -/* ── Backend targets ── */ - -const USER_API_BASE = process.env.USER_API_BASE || 'http://192.168.1.176:8444'; -const ADMIN_KEY = process.env.USER_API_ADMIN_KEY || 'maos-admin-2024'; - /* ── Route matching ── */ -interface RouteMatch { - target: 'user' | 'ipfs' | 'health'; - path: string; // path relative to the backend - method: string; -} - -function matchRoute(path: string[], method: string): RouteMatch | null { +export function matchRoute(path: string[], method: string): RouteMatch | null { if (!path || path.length === 0) return null; const [segment, ...rest] = path; @@ -58,175 +52,6 @@ function matchRoute(path: string[], method: string): RouteMatch | null { } } -/* ── Extract session token from JWT cookie ── */ - -async function getSessionToken(req: NextRequest): Promise { - const token = req.cookies.get(SESSION_COOKIE)?.value; - if (!token) return null; - const session = await verifySessionJWT(token); - return session?.sessionToken ?? null; -} - -/* ── User API proxy ── */ - -async function proxyUserAPI(path: string, method: string, body: ReadableStream | null, req: NextRequest): Promise { - const url = `${USER_API_BASE}${path}`; - const headers: Record = { - 'X-Admin-Key': ADMIN_KEY, - }; - - if (method === 'POST' || method === 'PUT') { - headers['Content-Type'] = 'application/json'; - } - - // Forward session token from JWT cookie to Python backend - const sessionToken = await getSessionToken(req); - if (sessionToken) { - headers['X-Session-Token'] = sessionToken; - } - - return fetch(url, { - method, - headers, - body, - signal: AbortSignal.timeout(15000), - }); -} - -/* ── IPFS Kubo proxy (via nginx) ── */ - -async function proxyIPFS(path: string, method: string, req: NextRequest): Promise { - // In dev, the Kubo API is behind nginx with Basic Auth. - // If no KUBO_API_URL is configured, return a clear error. - const kuboSvc = process.env.KUBO_API_URL || process.env.NEXT_PUBLIC_KUBO_API_URL; - if (!kuboSvc) { - return NextResponse.json( - { error: 'IPFS proxy not configured', detail: 'Set KUBO_API_URL in env for dev, or use nginx routing in production' }, - { status: 501 } - ); - } - - // Map /api/explorer/ls/ → /api/v0/ls?arg=, etc. - const url = new URL(kuboSvc); - const kuboPath = mapToKuboAPI(path, method); - // Split pathname and query string — url.pathname encodes `?` as `%3F` - const [namePart, ...qsParts] = kuboPath.split('?'); - url.pathname = namePart; - if (qsParts.length > 0) { - url.search = qsParts.join('?'); - } else { - // Forward incoming query params (used by ipns/publish etc.) - const incomingSearch = req.nextUrl.search; - if (incomingSearch) { - url.search = incomingSearch; - } - } - - const headers: Record = {}; - const auth = process.env.KUBO_BASIC_AUTH; - if (auth) { - headers['Authorization'] = 'Basic ' + Buffer.from(auth).toString('base64'); - } - - // Forward Content-Type (preserves multipart boundary for file uploads) - const reqCt = req.headers.get('content-type'); - if (reqCt) { - headers['Content-Type'] = reqCt; - } - - // Kubo uses POST for everything - const fetchOpts: RequestInit & { duplex?: string } = { - method: 'POST', - headers, - signal: AbortSignal.timeout(30000), - }; - // Node.js fetch requires duplex: 'half' when streaming a body - if (method === 'POST' && req.body) { - fetchOpts.duplex = 'half'; - } - - // Forward body for add/pin operations - if (method === 'POST' && req.body) { - fetchOpts.body = req.body; - } - - let res: Response; - try { - res = await fetch(url.toString(), fetchOpts); - } catch (fetchErr: any) { - console.error('[proxyIPFS] fetch error:', fetchErr.message); - return NextResponse.json( - { error: 'IPFS proxy fetch failed', detail: fetchErr.message?.substring(0, 200) }, - { status: 502 }, - ); - } - - const text = await res.text(); - - return new NextResponse(text, { - status: res.status, - headers: { - 'Content-Type': res.headers.get('Content-Type') || 'application/json', - }, - }); -} - -function mapToKuboAPI(path: string, method: string): string { - // Normalize: /api/node/info → /api/v0/id, etc. - const p = path.replace(/^\/+/, '').replace(/\/+$/, ''); - switch (p) { - case 'node/info': - return '/api/v0/id'; - case 'peers': - return '/api/v0/swarm/peers'; - case 'pins': - return method === 'GET' ? '/api/v0/pin/ls' : '/api/v0/pin/add'; - default: - if (p.startsWith('pins/')) { - const cid = p.slice(5); - return `/api/v0/pin/rm?arg=${encodeURIComponent(cid)}`; - } - if (p === 'files/upload') { - return '/api/v0/add?pin=true'; - } - if (p.startsWith('files/')) { - return '/api/v0/ls'; - } - // Explorer routes: /explorer/ls/, /explorer/cat/, etc. - if (p.startsWith('explorer/ls/')) { - const cid = p.slice('explorer/ls/'.length); - return `/api/v0/ls?arg=${encodeURIComponent(cid)}`; - } - if (p.startsWith('explorer/cat/')) { - const cid = p.slice('explorer/cat/'.length); - return `/api/v0/cat?arg=${encodeURIComponent(cid)}`; - } - if (p.startsWith('explorer/stat/')) { - const cid = p.slice('explorer/stat/'.length); - return `/api/v0/object/stat?arg=${encodeURIComponent(cid)}`; - } - if (p.startsWith('explorer/resolve/')) { - const name = p.slice('explorer/resolve/'.length); - return `/api/v0/resolve?arg=${encodeURIComponent(name)}`; - } - // IPNS routes - if (p === 'ipns/publish') return '/api/v0/name/publish'; - if (p === 'ipns/keys') return '/api/v0/key/list'; - if (p.startsWith('ipns/resolve/')) { - const name = p.slice('ipns/resolve/'.length); - return `/api/v0/name/resolve?arg=${encodeURIComponent(name)}`; - } - if (p.startsWith('ipns/keys/gen/')) { - const name = p.slice('ipns/keys/gen/'.length); - return `/api/v0/key/gen?arg=${encodeURIComponent(name)}`; - } - // Dashboard routes - if (p === 'repo/stats') return '/api/v0/repo/stat'; - if (p === 'bw/stats') return '/api/v0/bw/stats'; - return '/api/v0/' + p; - } -} - /* ── Main handler ── */ export async function GET( @@ -282,74 +107,3 @@ export async function DELETE( return NextResponse.json({ error: 'Method not allowed' }, { status: 405 }); } } - -/* ── Health check ── */ - -async function handleHealth(req: NextRequest): Promise { - // Check User API reachability - let userApiOk = false; - let userApiMsg = 'unknown'; - try { - const r = await fetch(`${USER_API_BASE}/users`, { - headers: { 'X-Admin-Key': ADMIN_KEY }, - signal: AbortSignal.timeout(5000), - }); - if (r.ok) { - userApiOk = true; - userApiMsg = 'connected'; - } else { - userApiMsg = `status ${r.status}`; - } - } catch (e: any) { - userApiMsg = e.message?.substring(0, 60) || 'error'; - } - - // Check Kubo API reachability - let kuboApiOk = false; - let kuboApiMsg = 'not configured'; - const kuboSvc = process.env.KUBO_API_URL; - const kuboAuth = process.env.KUBO_BASIC_AUTH; - if (kuboSvc) { - try { - const headers: Record = {}; - if (kuboAuth) { - headers['Authorization'] = 'Basic ' + Buffer.from(kuboAuth).toString('base64'); - } - const r = await fetch(kuboSvc.replace(/\/+$/, '') + '/api/v0/version', { - method: 'POST', - headers, - signal: AbortSignal.timeout(5000), - }); - if (r.ok) { - const data = await r.json(); - kuboApiOk = true; - kuboApiMsg = `v${data.Version || 'unknown'}`; - } else { - kuboApiMsg = `status ${r.status}`; - } - } catch (e: any) { - kuboApiMsg = e.message?.substring(0, 60) || 'error'; - } - } - - const overall = userApiOk || kuboApiOk ? 'ok' : 'degraded'; - - return NextResponse.json({ - status: overall, - userApi: userApiMsg, - kuboApi: kuboApiMsg, - mode: process.env.KUBO_API_URL ? 'proxy' : 'minimal', - }); -} - -/* ── Helpers ── */ - -async function proxyResult(res: Response): Promise { - const text = await res.text(); - return new NextResponse(text, { - status: res.status, - headers: { - 'Content-Type': 'application/json', - }, - }); -} diff --git a/src/app/api/[...path]/types.ts b/src/app/api/[...path]/types.ts new file mode 100644 index 0000000..7f30d7c --- /dev/null +++ b/src/app/api/[...path]/types.ts @@ -0,0 +1,5 @@ +export interface RouteMatch { + target: 'user' | 'ipfs' | 'health'; + path: string; // path relative to the backend + method: string; +} diff --git a/src/app/api/auth/challenge/route.ts b/src/app/api/auth/challenge/route.ts index 9dfc8ee..82c79b7 100644 --- a/src/app/api/auth/challenge/route.ts +++ b/src/app/api/auth/challenge/route.ts @@ -5,11 +5,10 @@ */ import { NextRequest, NextResponse } from 'next/server'; +import { userApiBase } from '@/lib/config'; export const dynamic = 'force-dynamic'; -const USER_API_BASE = process.env.USER_API_BASE || 'http://192.168.1.176:8444'; - export async function POST(req: NextRequest) { try { const body = await req.json(); @@ -19,7 +18,7 @@ export async function POST(req: NextRequest) { return NextResponse.json({ error: 'Address required' }, { status: 400 }); } - const res = await fetch(`${USER_API_BASE}/auth/challenge`, { + const res = await fetch(`${userApiBase()}/auth/challenge`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address: address.toLowerCase() }), @@ -28,9 +27,10 @@ export async function POST(req: NextRequest) { const data = await res.json(); return NextResponse.json(data, { status: res.status }); - } catch (e: any) { + } catch (e: unknown) { + const msg = e instanceof Error ? e.message : String(e); return NextResponse.json( - { error: e.message || 'Challenge failed' }, + { error: msg || 'Challenge failed' }, { status: 500 }, ); } diff --git a/src/app/api/auth/login/route.ts b/src/app/api/auth/login/route.ts index 16210a5..3414e2b 100644 --- a/src/app/api/auth/login/route.ts +++ b/src/app/api/auth/login/route.ts @@ -6,11 +6,10 @@ import { NextRequest, NextResponse } from 'next/server'; import { createSessionJWT, cookieOptions } from '@/lib/auth-server'; +import { userApiBase } from '@/lib/config'; export const dynamic = 'force-dynamic'; -const USER_API_BASE = process.env.USER_API_BASE || 'http://192.168.1.176:8444'; - export async function POST(req: NextRequest) { try { const body = await req.json(); @@ -24,7 +23,7 @@ export async function POST(req: NextRequest) { } // Proxy login to Python User API - const res = await fetch(`${USER_API_BASE}/auth/login`, { + const res = await fetch(`${userApiBase()}/auth/login`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -48,7 +47,7 @@ export async function POST(req: NextRequest) { // Determine role — Python backend returns role info via /auth/verify let role: 'admin' | 'user' = 'user'; try { - const verifyRes = await fetch(`${USER_API_BASE}/auth/verify`, { + const verifyRes = await fetch(`${userApiBase()}/auth/verify`, { headers: { 'X-Session-Token': pythonSessionToken }, signal: AbortSignal.timeout(3000), }); @@ -76,9 +75,10 @@ export async function POST(req: NextRequest) { response.cookies.set('ipfs-portal-session', jwt, cookieOptions()); return response; - } catch (e: any) { + } catch (e: unknown) { + const msg = e instanceof Error ? e.message : String(e); return NextResponse.json( - { error: e.message || 'Login failed' }, + { error: msg || 'Login failed' }, { status: 500 }, ); } diff --git a/src/app/api/auth/logout/route.ts b/src/app/api/auth/logout/route.ts index f9d4f46..1cdf254 100644 --- a/src/app/api/auth/logout/route.ts +++ b/src/app/api/auth/logout/route.ts @@ -1,16 +1,16 @@ /* ── POST /api/auth/logout ── * * Logt uit bij Python backend en wist JWT cookie. + * Best-effort: als Python backend niet bereikbaar is, cookie wordt altijd gewist. */ import { cookies } from 'next/headers'; import { NextResponse } from 'next/server'; import { verifySessionJWT, SESSION_COOKIE } from '@/lib/auth-server'; +import { userApiBase } from '@/lib/config'; export const dynamic = 'force-dynamic'; -const USER_API_BASE = process.env.USER_API_BASE || 'http://192.168.1.176:8444'; - export async function POST() { const cookieStore = await cookies(); const jwt = cookieStore.get(SESSION_COOKIE)?.value; @@ -27,16 +27,17 @@ export async function POST() { // Notify Python backend (best effort) if (sessionToken) { try { - await fetch(`${USER_API_BASE}/auth/logout`, { + await fetch(`${userApiBase()}/auth/logout`, { method: 'POST', headers: { 'X-Session-Token': sessionToken }, signal: AbortSignal.timeout(3000), }); - } catch { - // Non-critical + } catch (e) { + console.warn('[logout] Python backend unreachable:', e); } } + // Wipe cookie regardless const response = NextResponse.json({ authenticated: false }); response.cookies.set(SESSION_COOKIE, '', { httpOnly: true, diff --git a/src/app/api/auth/password/route.ts b/src/app/api/auth/password/route.ts index a334ec7..715f398 100644 --- a/src/app/api/auth/password/route.ts +++ b/src/app/api/auth/password/route.ts @@ -6,9 +6,7 @@ import { NextRequest, NextResponse } from 'next/server'; import { cookies } from 'next/headers'; import { verifySessionJWT, SESSION_COOKIE } from '@/lib/auth-server'; - -const USER_API_BASE = process.env.USER_API_BASE || 'http://192.168.1.176:8444'; -const ADMIN_KEY = process.env.USER_API_ADMIN_KEY || 'maos-admin-2024'; +import { userApiBase, userApiAdminKey } from '@/lib/config'; export const dynamic = 'force-dynamic'; @@ -32,9 +30,9 @@ export async function POST(req: NextRequest) { return NextResponse.json({ error: 'Current and new password required' }, { status: 400 }); } - const res = await fetch(`${USER_API_BASE}/auth/password`, { + const res = await fetch(`${userApiBase()}/auth/password`, { method: 'POST', - headers: { 'Content-Type': 'application/json', 'X-Admin-Key': ADMIN_KEY }, + headers: { 'Content-Type': 'application/json', 'X-Admin-Key': userApiAdminKey() }, body: JSON.stringify({ address: session.address, currentPassword, @@ -52,7 +50,8 @@ export async function POST(req: NextRequest) { } return NextResponse.json({ success: true }); - } catch (e: any) { - return NextResponse.json({ error: e.message || 'Password change failed' }, { status: 500 }); + } catch (e: unknown) { + const msg = e instanceof Error ? e.message : String(e); + return NextResponse.json({ error: msg || 'Password change failed' }, { status: 500 }); } } diff --git a/src/app/api/events/route.ts b/src/app/api/events/route.ts index 0109405..1affbcc 100644 --- a/src/app/api/events/route.ts +++ b/src/app/api/events/route.ts @@ -9,11 +9,11 @@ * Alternatief voor WebSocket (werkt door proxy heen). */ +import { kuboApiUrl, kuboBasicAuth } from '@/lib/config'; + export const dynamic = 'force-dynamic'; export const runtime = 'nodejs'; -const KUBO_API = process.env.KUBO_API_URL || process.env.NEXT_PUBLIC_KUBO_API_URL; -const KUBO_AUTH = process.env.KUBO_BASIC_AUTH; const POLL_INTERVAL = 3_000; // 3 seconden /* ── Helpers ── */ @@ -23,13 +23,15 @@ function encodeSSE(event: string, data: unknown): string { } async function kuboFetch(path: string): Promise { - if (!KUBO_API) return null; + const api = kuboApiUrl(); + if (!api) return null; try { - const url = new URL(KUBO_API); + const url = new URL(api); url.pathname = path; const headers: Record = {}; - if (KUBO_AUTH) { - headers['Authorization'] = 'Basic ' + Buffer.from(KUBO_AUTH).toString('base64'); + const auth = kuboBasicAuth(); + if (auth) { + headers['Authorization'] = 'Basic ' + Buffer.from(auth).toString('base64'); } const res = await fetch(url.toString(), { method: 'POST', diff --git a/src/app/api/payment/verify/route.ts b/src/app/api/payment/verify/route.ts index 37ab49a..ab117a2 100644 --- a/src/app/api/payment/verify/route.ts +++ b/src/app/api/payment/verify/route.ts @@ -14,18 +14,12 @@ */ import { NextRequest, NextResponse } from 'next/server'; -import { createPublicClient, http, type Address, type Hash, type Chain } from 'viem'; -import { IPFS_PORTAL_PAYMENT_ABI } from '@/lib/payment'; +import { createPublicClient, http, type Address, type Hash } from 'viem'; +import { IPFS_PORTAL_PAYMENT_ABI, zkSyncLocal } from '@/lib/payment'; +import { zkSyncRpcUrl, paymentContractAddress } from '@/lib/config'; -const RPC_URL = process.env.ZKSYNC_RPC_URL || 'http://192.168.1.176:3050'; -const CONTRACT_ADDRESS = (process.env.PAYMENT_CONTRACT_ADDRESS || '0xCBc6b8aeea129c206F4836799621C833Bf8B9BDe') as Address; - -const zkSyncLocal: Chain = { - id: 270, - name: 'zkSync Local', - nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, - rpcUrls: { default: { http: [RPC_URL] } }, -}; +const RPC_URL = zkSyncRpcUrl(); +const CONTRACT_ADDRESS = paymentContractAddress() as Address; const client = createPublicClient({ chain: zkSyncLocal, @@ -117,11 +111,12 @@ export async function GET(req: NextRequest) { })), verified: matchingUpload !== null, }); - } catch (err: any) { - console.error('[payment/verify] Error:', err.message); + } catch (err: unknown) { + const msg = err instanceof Error ? err.message : String(err); + console.error('[payment/verify] Error:', msg); return NextResponse.json({ error: 'Verification failed', - detail: err.message?.substring(0, 200), + detail: msg.substring(0, 200), }, { status: 500 }); } } @@ -159,12 +154,13 @@ export async function POST(req: NextRequest) { gasUsed: receipt.gasUsed?.toString(), effectiveGasPrice: receipt.effectiveGasPrice?.toString(), }); - } catch (err: any) { - console.error('[payment/verify/tx] Error:', err.message); + } catch (err: unknown) { + const msg = err instanceof Error ? err.message : String(err); + console.error('[payment/verify/tx] Error:', msg); return NextResponse.json({ confirmed: false, error: 'Verification failed', - detail: err.message?.substring(0, 200), + detail: msg.substring(0, 200), }, { status: 500 }); } } diff --git a/src/app/dashboard/helpers.ts b/src/app/dashboard/helpers.ts new file mode 100644 index 0000000..7399003 --- /dev/null +++ b/src/app/dashboard/helpers.ts @@ -0,0 +1,19 @@ +/* ── Dashboard Page Helpers ── */ + +import type { LucideIcon } from "lucide-react"; + +export interface StatCard { + label: string; + value: string | number; + icon: LucideIcon; + color: string; + bg: string; +} + +export function formatRepoSize(bytes: number): string { + return (bytes / 1e9).toFixed(2); +} + +export function formatBandwidthMb(bytes: number): string { + return (bytes / 1e6).toFixed(1); +} diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index fd3a5e5..cfae3cc 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -16,6 +16,9 @@ import { Fingerprint, } from 'lucide-react'; +import ErrorBoundary from '@/components/ErrorBoundary'; +import { formatRepoSize, formatBandwidthMb } from './helpers'; + export default function DashboardPage() { const { data, isValidating } = useDashboard(); const realtime = useRealtime(); @@ -39,9 +42,9 @@ export default function DashboardPage() { const loading = isValidating && !data; - const repoSizeGb = repo ? (repo.repoSize / 1e9).toFixed(2) : '—'; - const bwIn = bw ? (bw.totalIn / 1e6).toFixed(1) : '—'; - const bwOut = bw ? (bw.totalOut / 1e6).toFixed(1) : '—'; + const repoSizeGb = repo ? formatRepoSize(repo.repoSize) : '—'; + const bwIn = bw ? formatBandwidthMb(bw.totalIn) : '—'; + const bwOut = bw ? formatBandwidthMb(bw.totalOut) : '—'; // Peer count from SSE (live) or SWR const peerCount = realtime.peers?.count ?? peers.length; @@ -57,6 +60,7 @@ export default function DashboardPage() { return ( + {/* Page header */}
@@ -258,6 +262,7 @@ export default function DashboardPage() { )}
+
); } diff --git a/src/app/explorer/components/DirectoryListing.tsx b/src/app/explorer/components/DirectoryListing.tsx index c3b6f9d..db56233 100644 --- a/src/app/explorer/components/DirectoryListing.tsx +++ b/src/app/explorer/components/DirectoryListing.tsx @@ -1,8 +1,7 @@ 'use client'; import { useState, useCallback } from 'react'; -import type { IPFSEntry } from '@/lib/api'; -import { explorerLs } from '@/lib/api'; +import { explorerLs, type IPFSEntry } from '@/lib/api/explorer'; import FileIcon from './FileIcon'; import { ChevronRight, CheckCircle, Download, Loader2 } from 'lucide-react'; import { truncateCid } from '@/lib/helpers'; @@ -221,7 +220,8 @@ export default function DirectoryListing({ try { const result = await explorerLs(cid); setSubdirEntries((e) => ({ ...e, [cid]: result })); - } catch { + } catch (err) { + console.error('[DirectoryListing] Failed to list subdirectory:', err); setSubdirEntries((e) => ({ ...e, [cid]: [] })); } finally { setLoadingSubdirs((l) => ({ ...l, [cid]: false })); diff --git a/src/app/explorer/components/FilePreview.tsx b/src/app/explorer/components/FilePreview.tsx index b685f0b..eaae4a8 100644 --- a/src/app/explorer/components/FilePreview.tsx +++ b/src/app/explorer/components/FilePreview.tsx @@ -3,6 +3,7 @@ import { useState, useEffect, useCallback } from 'react'; import { X, Download, Maximize2 } from 'lucide-react'; import { getSettings } from '@/lib/storage'; +import { gatewayUrl } from '@/lib/helpers'; interface FilePreviewProps { cid: string; @@ -12,11 +13,6 @@ interface FilePreviewProps { filename?: string; } -function gatewayUrl(cid: string): string { - const { gatewayUrl: base } = getSettings(); - return `${base}/${cid}`; -} - function detectFileType( filename: string | undefined, ): 'image' | 'markdown' | 'json' | 'text' | 'video' | 'audio' | 'pdf' | 'html' | 'other' { @@ -60,7 +56,8 @@ function renderJson(text: string): string { const parsed = JSON.parse(text); const syntax = JSON.stringify(parsed, null, 2); return syntax; - } catch { + } catch (err) { + console.error('[FilePreview] JSON parse failed in renderJson:', err); return text; } } @@ -69,13 +66,18 @@ function JsonDisplay({ text }: { text: string }) { let parsed: unknown; try { parsed = JSON.parse(text); - } catch { + } catch (err) { + console.error('[FilePreview] JSON parse failed in JsonDisplay:', err); return
{text}
; } const formatted = JSON.stringify(parsed, null, 2); + const escaped = formatted + .replace(/&/g, '&') + .replace(//g, '>'); - const colored = formatted.replace( + const colored = escaped.replace( /("(?:\\.|[^"\\])*")\s*:/g, '$1:', ).replace( @@ -205,7 +207,7 @@ export default function FilePreview({ cid, content, loading, onClose, filename } if (content) { return (