amliq-dashboard 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +3 -0
- package/.env.production +1 -0
- package/Dockerfile +26 -0
- package/QUICK_START.md +267 -0
- package/README.md +161 -0
- package/TESTING_GUIDE.md +322 -0
- package/dist/.well-known/ai-plugin.json +15 -0
- package/dist/_headers +8 -0
- package/dist/_redirects +1 -0
- package/dist/assets/APIKeys-BvwFauIs.js +6 -0
- package/dist/assets/APIKeys-DaMSBZQL.js +1 -0
- package/dist/assets/AdverseMedia-DckXfMzS.js +4 -0
- package/dist/assets/AlertDetailPage-Bc2_zwu_.js +1 -0
- package/dist/assets/AlertQueue-DFtBiRoM.js +8 -0
- package/dist/assets/Analytics-DtruB5lQ.js +1 -0
- package/dist/assets/AuditTrail-BK68ePu0.js +1 -0
- package/dist/assets/AuthDivider-gRHEt7gx.js +1 -0
- package/dist/assets/Badge-B9VFkofy.js +1 -0
- package/dist/assets/BatchJobs-Bz6KFnXD.js +6 -0
- package/dist/assets/BillingPage-R9nQ5nFb.js +11 -0
- package/dist/assets/Card-Cw-T_-oU.js +1 -0
- package/dist/assets/CaseDetail-DYs7Zg_y.js +7 -0
- package/dist/assets/CaseManagement-B1Q4Dp1Y.js +1 -0
- package/dist/assets/ComplianceReport-Dhssqc9T.js +1 -0
- package/dist/assets/Configuration-B92kl9T0.js +1 -0
- package/dist/assets/CryptoScreening-C7yFlskC.js +1 -0
- package/dist/assets/Dashboard-w4-Nhv9q.js +17 -0
- package/dist/assets/DataSources-u3-Ri_5_.js +3 -0
- package/dist/assets/EDDWorkflow-CFzlEO0e.js +1 -0
- package/dist/assets/EmptyState-Do0xJAT9.js +6 -0
- package/dist/assets/ForgotPassword-BPYyQFQp.js +1 -0
- package/dist/assets/LandingPage-CjaP0zw4.js +41 -0
- package/dist/assets/ListsMarketplace-CG6KkT9B.js +6 -0
- package/dist/assets/Login-677LEGP1.js +1 -0
- package/dist/assets/MFASetup-BxqCPvui.js +1 -0
- package/dist/assets/Monitoring-9TN9MK4y.js +1 -0
- package/dist/assets/Onboarding-Cf0Y83lX.js +1 -0
- package/dist/assets/Operations-CcXwc2xw.js +10 -0
- package/dist/assets/Overview-B_Ky0VWV.js +1 -0
- package/dist/assets/PEPScreening-pUQjTH9c.js +1 -0
- package/dist/assets/PageHeader-BObHFn0i.js +1 -0
- package/dist/assets/PrivacyPolicy-DZ2xrKir.js +1 -0
- package/dist/assets/ResetPassword-AtxtpIG1.js +1 -0
- package/dist/assets/RiskAssessment-Dzuh1Usv.js +1 -0
- package/dist/assets/SARForm-D8w2ZGe-.js +1 -0
- package/dist/assets/SanctionsLists-CPA3UH2v.js +1 -0
- package/dist/assets/ScheduledTasks-Dsjk-6UR.js +1 -0
- package/dist/assets/ScreenEntity-D1U0YL7v.js +3 -0
- package/dist/assets/ScreeningProgress-BW49PzoB.js +66 -0
- package/dist/assets/SearchField-CulFKdiI.js +1 -0
- package/dist/assets/Signup-C0FmFOo_.js +1 -0
- package/dist/assets/SystemHealth-B_8u4eva.js +1 -0
- package/dist/assets/TaskHistory-BCmEM89q.js +3 -0
- package/dist/assets/Team-CUo_FlU7.js +1 -0
- package/dist/assets/TenantDetail-CgZQHUY8.js +1 -0
- package/dist/assets/Tenants-RB9E9ick.js +2 -0
- package/dist/assets/TermsOfService-BfL-kndX.js +1 -0
- package/dist/assets/TransactionMonitoring-DGh_T22s.js +14 -0
- package/dist/assets/TxnScreening-B7cm2-eh.js +1 -0
- package/dist/assets/UBOChain-falXAsCo.js +1 -0
- package/dist/assets/Users-Doakpg9c.js +1 -0
- package/dist/assets/Webhooks-BZpAfaxv.js +1 -0
- package/dist/assets/alert-triangle-YCFVm7B_.js +6 -0
- package/dist/assets/alerts-COUnTwWY.js +1 -0
- package/dist/assets/arrow-left-9ApLqP95.js +6 -0
- package/dist/assets/check-VTcvVtIU.js +6 -0
- package/dist/assets/check-circle-2-Dn-lG5YQ.js +6 -0
- package/dist/assets/code-DIJRWFVv.js +6 -0
- package/dist/assets/fingerprint-C0MGVtax.js +6 -0
- package/dist/assets/flag-B8_Gwxh6.js +6 -0
- package/dist/assets/index-CfdYcqRM.js +289 -0
- package/dist/assets/index-HPU_Rhdu.css +1 -0
- package/dist/assets/layers-zHz2o4vo.js +6 -0
- package/dist/assets/loader-B9_dNihg.js +6 -0
- package/dist/assets/mail-BijL2qwp.js +6 -0
- package/dist/assets/plus-i0oBIIPS.js +6 -0
- package/dist/assets/refresh-cw-CSuAwutt.js +6 -0
- package/dist/assets/useAnalytics-Bj8IONcw.js +72 -0
- package/dist/assets/x-circle-DLGKvijE.js +6 -0
- package/dist/favicon.svg +15 -0
- package/dist/index.html +51 -0
- package/dist/llms.txt +28 -0
- package/dist/logo.png +0 -0
- package/dist/logo.svg +17 -0
- package/dist/manifest.json +44 -0
- package/dist/robots.txt +15 -0
- package/dist/schema.json +13 -0
- package/dist/sitemap.xml +28 -0
- package/dist/sw.js +67 -0
- package/e2e/auth-setup.ts +20 -0
- package/e2e/billing.spec.ts +50 -0
- package/e2e/cases.spec.ts +53 -0
- package/e2e/compliance.spec.ts +65 -0
- package/e2e/config.spec.ts +56 -0
- package/e2e/dashboard.spec.ts +47 -0
- package/e2e/fixtures.ts +33 -0
- package/e2e/lists.spec.ts +43 -0
- package/e2e/login.spec.ts +64 -0
- package/e2e/media.spec.ts +48 -0
- package/e2e/mocks.ts +51 -0
- package/e2e/monitoring.spec.ts +44 -0
- package/e2e/navigation.spec.ts +56 -0
- package/e2e/onboarding.spec.ts +49 -0
- package/e2e/responsive.spec.ts +40 -0
- package/e2e/risk.spec.ts +61 -0
- package/e2e/screening.spec.ts +76 -0
- package/e2e/team.spec.ts +53 -0
- package/index.html +50 -0
- package/package.json +47 -0
- package/playwright.config.ts +35 -0
- package/postcss.config.js +6 -0
- package/public/.well-known/ai-plugin.json +15 -0
- package/public/_headers +8 -0
- package/public/_redirects +1 -0
- package/public/favicon.svg +15 -0
- package/public/llms.txt +28 -0
- package/public/logo.png +0 -0
- package/public/logo.svg +17 -0
- package/public/manifest.json +44 -0
- package/public/robots.txt +15 -0
- package/public/schema.json +13 -0
- package/public/sitemap.xml +28 -0
- package/public/sw.js +67 -0
- package/scripts/test-runner.sh +152 -0
- package/src/App.tsx +48 -0
- package/src/api/alerts.ts +19 -0
- package/src/api/analytics.ts +6 -0
- package/src/api/audit.ts +11 -0
- package/src/api/auth.ts +26 -0
- package/src/api/billing.ts +54 -0
- package/src/api/cases.ts +48 -0
- package/src/api/client.ts +50 -0
- package/src/api/config.ts +30 -0
- package/src/api/edd.ts +25 -0
- package/src/api/enforcement.ts +33 -0
- package/src/api/lists.ts +24 -0
- package/src/api/monitoring.ts +82 -0
- package/src/api/pep.ts +30 -0
- package/src/api/risk.ts +26 -0
- package/src/api/screening.ts +37 -0
- package/src/api/team.ts +27 -0
- package/src/api/transactions.ts +37 -0
- package/src/components/admin/TenantCards.tsx +51 -0
- package/src/components/alerts/AlertActions.test.tsx +80 -0
- package/src/components/alerts/AlertActions.tsx +68 -0
- package/src/components/alerts/AlertCard.test.tsx +86 -0
- package/src/components/alerts/AlertCard.tsx +60 -0
- package/src/components/alerts/AlertDetailSidebar.tsx +63 -0
- package/src/components/alerts/AlertFilters.test.tsx +73 -0
- package/src/components/alerts/AlertFilters.tsx +88 -0
- package/src/components/alerts/EntityDetailsCard.test.tsx +61 -0
- package/src/components/alerts/EntityDetailsCard.tsx +37 -0
- package/src/components/alerts/NotesCard.test.tsx +39 -0
- package/src/components/alerts/NotesCard.tsx +28 -0
- package/src/components/auth/AuthDivider.tsx +18 -0
- package/src/components/auth/LoginForm.tsx +62 -0
- package/src/components/auth/LoginLeftPanel.tsx +43 -0
- package/src/components/auth/PasswordStrength.tsx +26 -0
- package/src/components/auth/SignInButtons.tsx +46 -0
- package/src/components/auth/SignupLeftPanel.tsx +35 -0
- package/src/components/auth/countries.ts +17 -0
- package/src/components/charts/AreaChart.tsx +45 -0
- package/src/components/charts/BarChart.tsx +48 -0
- package/src/components/charts/DonutChart.tsx +47 -0
- package/src/components/compliance/CaseActions.tsx +74 -0
- package/src/components/compliance/CaseTimeline.tsx +68 -0
- package/src/components/compliance/MediaResultCard.tsx +87 -0
- package/src/components/compliance/PEPResultCard.tsx +78 -0
- package/src/components/config/MatchingModesCard.test.tsx +75 -0
- package/src/components/config/MatchingModesCard.tsx +40 -0
- package/src/components/config/ScreeningLayersCard.test.tsx +57 -0
- package/src/components/config/ScreeningLayersCard.tsx +36 -0
- package/src/components/config/ThresholdsCard.test.tsx +79 -0
- package/src/components/config/ThresholdsCard.tsx +51 -0
- package/src/components/dashboard/ActivityFeed.tsx +93 -0
- package/src/components/dashboard/DashboardGreeting.tsx +23 -0
- package/src/components/dashboard/DashboardSkeleton.tsx +35 -0
- package/src/components/dashboard/QuickActions.tsx +52 -0
- package/src/components/dashboard/TopEntitiesTable.tsx +63 -0
- package/src/components/data/ComplianceMetrics.test.tsx +32 -0
- package/src/components/data/ComplianceMetrics.tsx +40 -0
- package/src/components/data/ConfidenceScore.test.tsx +62 -0
- package/src/components/data/ConfidenceScore.tsx +27 -0
- package/src/components/data/StatCard.test.tsx +72 -0
- package/src/components/data/StatCard.tsx +63 -0
- package/src/components/data/StatusBadge.test.tsx +63 -0
- package/src/components/data/StatusBadge.tsx +39 -0
- package/src/components/layout/AppShell.tsx +48 -0
- package/src/components/layout/Breadcrumbs.tsx +48 -0
- package/src/components/layout/CommandPalette.tsx +81 -0
- package/src/components/layout/DashboardLayout.tsx +19 -0
- package/src/components/layout/MobileHeader.tsx +30 -0
- package/src/components/layout/NavGroup.test.tsx +63 -0
- package/src/components/layout/NavGroup.tsx +64 -0
- package/src/components/layout/NotificationBell.tsx +89 -0
- package/src/components/layout/PageHeader.test.tsx +61 -0
- package/src/components/layout/PageHeader.tsx +19 -0
- package/src/components/layout/ProtectedRoute.tsx +31 -0
- package/src/components/layout/PublicLayout.tsx +17 -0
- package/src/components/layout/Sidebar.test.tsx +67 -0
- package/src/components/layout/Sidebar.tsx +92 -0
- package/src/components/layout/Toolbar.test.tsx +47 -0
- package/src/components/layout/Toolbar.tsx +68 -0
- package/src/components/layout/navItems.ts +94 -0
- package/src/components/lists/ListCard.tsx +78 -0
- package/src/components/lists/ListMarketplaceCard.tsx +77 -0
- package/src/components/screening/CircularConfidence.tsx +38 -0
- package/src/components/screening/LimitReachedBanner.tsx +31 -0
- package/src/components/screening/ListSelector.tsx +64 -0
- package/src/components/screening/MatchDetailHeader.tsx +64 -0
- package/src/components/screening/MatchEntityInfo.tsx +56 -0
- package/src/components/screening/MatchEvidenceBars.tsx +65 -0
- package/src/components/screening/MatchMetadata.tsx +95 -0
- package/src/components/screening/ScreenResults.tsx +49 -0
- package/src/components/screening/ScreeningForm.test.tsx +83 -0
- package/src/components/screening/ScreeningForm.tsx +100 -0
- package/src/components/screening/ScreeningLayersList.test.tsx +33 -0
- package/src/components/screening/ScreeningLayersList.tsx +46 -0
- package/src/components/screening/ScreeningProgress.tsx +91 -0
- package/src/components/screening/ScreeningQuotaBanner.tsx +64 -0
- package/src/components/screening/ScreeningResultCard.tsx +47 -0
- package/src/components/screening/ScreeningResultRow.tsx +45 -0
- package/src/components/screening/ScreeningResults.test.tsx +37 -0
- package/src/components/screening/ScreeningResults.tsx +33 -0
- package/src/components/screening/ShareResults.tsx +103 -0
- package/src/components/screening/ThresholdSlider.tsx +23 -0
- package/src/components/transactions/WebhookCTA.tsx +63 -0
- package/src/components/ui/Avatar.test.tsx +47 -0
- package/src/components/ui/Avatar.tsx +35 -0
- package/src/components/ui/Badge.test.tsx +49 -0
- package/src/components/ui/Badge.tsx +33 -0
- package/src/components/ui/Button.test.tsx +56 -0
- package/src/components/ui/Button.tsx +46 -0
- package/src/components/ui/Card.test.tsx +61 -0
- package/src/components/ui/Card.tsx +29 -0
- package/src/components/ui/ConfirmModal.tsx +67 -0
- package/src/components/ui/Divider.test.tsx +24 -0
- package/src/components/ui/Divider.tsx +5 -0
- package/src/components/ui/EmptyState.test.tsx +49 -0
- package/src/components/ui/EmptyState.tsx +22 -0
- package/src/components/ui/ErrorBoundary.tsx +44 -0
- package/src/components/ui/ExportMenu.tsx +71 -0
- package/src/components/ui/LanguageSwitcher.tsx +37 -0
- package/src/components/ui/LoadingSpinner.test.tsx +41 -0
- package/src/components/ui/LoadingSpinner.tsx +21 -0
- package/src/components/ui/MetricCard.tsx +63 -0
- package/src/components/ui/ScoreRing.tsx +51 -0
- package/src/components/ui/SearchField.test.tsx +55 -0
- package/src/components/ui/SearchField.tsx +31 -0
- package/src/components/ui/SeverityBadge.tsx +57 -0
- package/src/components/ui/ThemeToggle.tsx +37 -0
- package/src/components/ui/Toast.test.tsx +79 -0
- package/src/components/ui/Toast.tsx +75 -0
- package/src/components/ui/Toggle.test.tsx +85 -0
- package/src/components/ui/Toggle.tsx +46 -0
- package/src/context/AuthContext.tsx +71 -0
- package/src/data/pepProfiles.ts +76 -0
- package/src/data/pepProfilesExtra.ts +58 -0
- package/src/hooks/useAlerts.ts +36 -0
- package/src/hooks/useAnalytics.ts +23 -0
- package/src/hooks/useApi.test.ts +79 -0
- package/src/hooks/useApi.ts +33 -0
- package/src/hooks/useAudit.ts +28 -0
- package/src/hooks/useBilling.ts +38 -0
- package/src/hooks/useConfig.ts +35 -0
- package/src/hooks/useDebounce.test.ts +84 -0
- package/src/hooks/useDebounce.ts +15 -0
- package/src/hooks/useDirection.ts +15 -0
- package/src/hooks/useLists.ts +34 -0
- package/src/hooks/useMediaQuery.test.ts +97 -0
- package/src/hooks/useMediaQuery.ts +28 -0
- package/src/hooks/useScreening.ts +33 -0
- package/src/hooks/useSidebar.ts +18 -0
- package/src/hooks/useUsage.ts +27 -0
- package/src/i18n/config.ts +33 -0
- package/src/i18n/locales/ar/admin.json +19 -0
- package/src/i18n/locales/ar/alerts.json +52 -0
- package/src/i18n/locales/ar/analytics.json +9 -0
- package/src/i18n/locales/ar/audit.json +12 -0
- package/src/i18n/locales/ar/auth.json +60 -0
- package/src/i18n/locales/ar/batch.json +5 -0
- package/src/i18n/locales/ar/billing.json +41 -0
- package/src/i18n/locales/ar/common.json +65 -0
- package/src/i18n/locales/ar/compliance.json +83 -0
- package/src/i18n/locales/ar/config.json +13 -0
- package/src/i18n/locales/ar/dashboard.json +19 -0
- package/src/i18n/locales/ar/errors.json +9 -0
- package/src/i18n/locales/ar/index.ts +29 -0
- package/src/i18n/locales/ar/legal.json +10 -0
- package/src/i18n/locales/ar/lists.json +6 -0
- package/src/i18n/locales/ar/marketing.json +110 -0
- package/src/i18n/locales/ar/monitoring.json +15 -0
- package/src/i18n/locales/ar/nav.json +35 -0
- package/src/i18n/locales/ar/onboarding.json +25 -0
- package/src/i18n/locales/ar/platform.json +23 -0
- package/src/i18n/locales/ar/screening.json +26 -0
- package/src/i18n/locales/ar/team.json +11 -0
- package/src/i18n/locales/en/admin.json +21 -0
- package/src/i18n/locales/en/alerts.json +52 -0
- package/src/i18n/locales/en/analytics.json +9 -0
- package/src/i18n/locales/en/audit.json +12 -0
- package/src/i18n/locales/en/auth.json +60 -0
- package/src/i18n/locales/en/batch.json +5 -0
- package/src/i18n/locales/en/billing.json +87 -0
- package/src/i18n/locales/en/common.json +65 -0
- package/src/i18n/locales/en/compliance.json +83 -0
- package/src/i18n/locales/en/config.json +29 -0
- package/src/i18n/locales/en/dashboard.json +23 -0
- package/src/i18n/locales/en/errors.json +9 -0
- package/src/i18n/locales/en/index.ts +29 -0
- package/src/i18n/locales/en/legal.json +114 -0
- package/src/i18n/locales/en/lists.json +6 -0
- package/src/i18n/locales/en/marketing.json +174 -0
- package/src/i18n/locales/en/monitoring.json +15 -0
- package/src/i18n/locales/en/nav.json +35 -0
- package/src/i18n/locales/en/onboarding.json +31 -0
- package/src/i18n/locales/en/platform.json +25 -0
- package/src/i18n/locales/en/screening.json +26 -0
- package/src/i18n/locales/en/team.json +12 -0
- package/src/i18n/locales/he/admin.json +19 -0
- package/src/i18n/locales/he/alerts.json +52 -0
- package/src/i18n/locales/he/analytics.json +9 -0
- package/src/i18n/locales/he/audit.json +12 -0
- package/src/i18n/locales/he/auth.json +60 -0
- package/src/i18n/locales/he/batch.json +5 -0
- package/src/i18n/locales/he/billing.json +41 -0
- package/src/i18n/locales/he/common.json +65 -0
- package/src/i18n/locales/he/compliance.json +83 -0
- package/src/i18n/locales/he/config.json +13 -0
- package/src/i18n/locales/he/dashboard.json +19 -0
- package/src/i18n/locales/he/errors.json +9 -0
- package/src/i18n/locales/he/index.ts +29 -0
- package/src/i18n/locales/he/legal.json +10 -0
- package/src/i18n/locales/he/lists.json +6 -0
- package/src/i18n/locales/he/marketing.json +110 -0
- package/src/i18n/locales/he/monitoring.json +15 -0
- package/src/i18n/locales/he/nav.json +35 -0
- package/src/i18n/locales/he/onboarding.json +25 -0
- package/src/i18n/locales/he/platform.json +23 -0
- package/src/i18n/locales/he/screening.json +26 -0
- package/src/i18n/locales/he/team.json +11 -0
- package/src/index.css +112 -0
- package/src/main.tsx +15 -0
- package/src/pages/APIKeys.tsx +120 -0
- package/src/pages/AddMonitorModal.tsx +30 -0
- package/src/pages/AdverseMedia.test.tsx +18 -0
- package/src/pages/AdverseMedia.tsx +89 -0
- package/src/pages/AlertDetailPage.tsx +64 -0
- package/src/pages/AlertQueue.test.tsx +48 -0
- package/src/pages/AlertQueue.tsx +63 -0
- package/src/pages/Analytics.tsx +50 -0
- package/src/pages/AuditTrail.tsx +64 -0
- package/src/pages/BatchJobs.tsx +79 -0
- package/src/pages/CaseDetail.tsx +72 -0
- package/src/pages/CaseManagement.test.tsx +31 -0
- package/src/pages/CaseManagement.tsx +92 -0
- package/src/pages/Configuration.test.tsx +96 -0
- package/src/pages/Configuration.tsx +123 -0
- package/src/pages/CryptoScreening.tsx +109 -0
- package/src/pages/Dashboard.test.tsx +51 -0
- package/src/pages/Dashboard.tsx +66 -0
- package/src/pages/EDDWorkflow.test.tsx +29 -0
- package/src/pages/EDDWorkflow.tsx +73 -0
- package/src/pages/ForgotPassword.test.tsx +49 -0
- package/src/pages/ForgotPassword.tsx +67 -0
- package/src/pages/ListsMarketplace.tsx +102 -0
- package/src/pages/Login.test.tsx +100 -0
- package/src/pages/Login.tsx +57 -0
- package/src/pages/MFASetup.tsx +114 -0
- package/src/pages/MonitorProfileCard.tsx +27 -0
- package/src/pages/Monitoring.tsx +68 -0
- package/src/pages/Onboarding.test.tsx +36 -0
- package/src/pages/Onboarding.tsx +60 -0
- package/src/pages/PEPScreening.test.tsx +15 -0
- package/src/pages/PEPScreening.tsx +100 -0
- package/src/pages/ResetPassword.tsx +81 -0
- package/src/pages/RiskAssessment.test.tsx +15 -0
- package/src/pages/RiskAssessment.tsx +108 -0
- package/src/pages/SanctionsLists.tsx +74 -0
- package/src/pages/ScreenEntity.test.tsx +82 -0
- package/src/pages/ScreenEntity.tsx +76 -0
- package/src/pages/Signup.test.tsx +98 -0
- package/src/pages/Signup.tsx +92 -0
- package/src/pages/TaskHistory.tsx +183 -0
- package/src/pages/Team.test.tsx +15 -0
- package/src/pages/Team.tsx +140 -0
- package/src/pages/TransactionMonitoring.test.tsx +18 -0
- package/src/pages/TransactionMonitoring.tsx +118 -0
- package/src/pages/TxnScreening.tsx +125 -0
- package/src/pages/UBOChain.test.tsx +35 -0
- package/src/pages/UBOChain.tsx +65 -0
- package/src/pages/Webhooks.tsx +137 -0
- package/src/pages/admin/DataSources.tsx +230 -0
- package/src/pages/admin/Operations.tsx +103 -0
- package/src/pages/admin/ScheduledTasks.tsx +155 -0
- package/src/pages/admin/SystemHealth.tsx +58 -0
- package/src/pages/admin/TenantDetail.tsx +62 -0
- package/src/pages/admin/Tenants.test.tsx +20 -0
- package/src/pages/admin/Tenants.tsx +63 -0
- package/src/pages/admin/opsRunners.ts +81 -0
- package/src/pages/admin/opsTerminal.tsx +63 -0
- package/src/pages/billing/ActiveSubscriptions.tsx +41 -0
- package/src/pages/billing/AddProductModal.tsx +99 -0
- package/src/pages/billing/BillingPage.test.tsx +30 -0
- package/src/pages/billing/BillingPage.tsx +67 -0
- package/src/pages/billing/CurrentPlan.tsx +50 -0
- package/src/pages/billing/InvoiceList.tsx +104 -0
- package/src/pages/billing/InvoiceRow.tsx +37 -0
- package/src/pages/billing/LemonSqueezySetup.tsx +51 -0
- package/src/pages/billing/PaymentAlert.tsx +33 -0
- package/src/pages/billing/PlanComparison.tsx +53 -0
- package/src/pages/billing/ProductUsage.tsx +43 -0
- package/src/pages/billing/PromoCodeInput.tsx +58 -0
- package/src/pages/billing/SeatManager.tsx +80 -0
- package/src/pages/billing/SeatRow.tsx +32 -0
- package/src/pages/billing/SubscriptionCard.tsx +73 -0
- package/src/pages/billing/UpgradeModal.tsx +53 -0
- package/src/pages/billing/UsageHistory.tsx +37 -0
- package/src/pages/billing/UsageMeter.tsx +26 -0
- package/src/pages/billing/UsageOverview.tsx +38 -0
- package/src/pages/legal/PrivacyPolicy.tsx +25 -0
- package/src/pages/legal/TermsOfService.tsx +25 -0
- package/src/pages/marketing/BundleCallout.tsx +24 -0
- package/src/pages/marketing/CTASection.tsx +48 -0
- package/src/pages/marketing/CaseStudy.tsx +37 -0
- package/src/pages/marketing/ComparisonTable.tsx +66 -0
- package/src/pages/marketing/CompetitiveEdge.tsx +55 -0
- package/src/pages/marketing/DataCoverage.tsx +54 -0
- package/src/pages/marketing/DataRain.tsx +30 -0
- package/src/pages/marketing/EnterpriseCTA.tsx +26 -0
- package/src/pages/marketing/FAQItem.tsx +27 -0
- package/src/pages/marketing/FAQSchema.tsx +43 -0
- package/src/pages/marketing/FAQSection.tsx +19 -0
- package/src/pages/marketing/FeatureDetail.tsx +19 -0
- package/src/pages/marketing/FeaturesGrid.tsx +60 -0
- package/src/pages/marketing/FeaturesSpotlight.tsx +68 -0
- package/src/pages/marketing/FooterSection.tsx +92 -0
- package/src/pages/marketing/GradientOrbs.tsx +26 -0
- package/src/pages/marketing/HeroSearch.tsx +113 -0
- package/src/pages/marketing/HeroSection.tsx +72 -0
- package/src/pages/marketing/LandingPage.tsx +45 -0
- package/src/pages/marketing/LogoCloud.tsx +31 -0
- package/src/pages/marketing/LogoMarquee.tsx +45 -0
- package/src/pages/marketing/MarketingNav.tsx +80 -0
- package/src/pages/marketing/MatchingLayers.tsx +78 -0
- package/src/pages/marketing/MobileMenu.tsx +45 -0
- package/src/pages/marketing/PricingCard.tsx +57 -0
- package/src/pages/marketing/PricingFeatureRow.tsx +16 -0
- package/src/pages/marketing/PricingSection.tsx +103 -0
- package/src/pages/marketing/PricingToggle.tsx +40 -0
- package/src/pages/marketing/ProductPricingCards.tsx +23 -0
- package/src/pages/marketing/ProductShowcase.tsx +81 -0
- package/src/pages/marketing/ProductTabs.tsx +45 -0
- package/src/pages/marketing/QuoteRotator.tsx +56 -0
- package/src/pages/marketing/StatsBar.tsx +81 -0
- package/src/pages/marketing/StatsSection.tsx +44 -0
- package/src/pages/marketing/TestimonialCard.tsx +38 -0
- package/src/pages/marketing/TestimonialsSection.tsx +32 -0
- package/src/pages/marketing/animations.tsx +56 -0
- package/src/pages/onboarding/CountryStep.tsx +38 -0
- package/src/pages/onboarding/ListsStep.tsx +44 -0
- package/src/pages/onboarding/StepIndicator.tsx +34 -0
- package/src/pages/onboarding/ThresholdStep.tsx +49 -0
- package/src/pages/platform/APIKeys.tsx +102 -0
- package/src/pages/platform/Overview.tsx +58 -0
- package/src/pages/platform/Users.tsx +110 -0
- package/src/pages/reporting/ComplianceReport.tsx +99 -0
- package/src/pages/reporting/SARForm.tsx +99 -0
- package/src/routes/appRoutes.tsx +60 -0
- package/src/routes/compliance.tsx +28 -0
- package/src/routes/lazyCompliance.ts +34 -0
- package/src/routes/lazyPages.ts +35 -0
- package/src/routes/lazyPlatform.ts +5 -0
- package/src/routes/platform.tsx +15 -0
- package/src/styles/effects.css +76 -0
- package/src/test/setup.ts +25 -0
- package/src/test/utils.tsx +49 -0
- package/src/types/alert.ts +31 -0
- package/src/types/analytics.ts +16 -0
- package/src/types/audit.ts +11 -0
- package/src/types/billing.ts +60 -0
- package/src/types/common.ts +15 -0
- package/src/types/config.ts +19 -0
- package/src/types/entity.ts +34 -0
- package/src/types/index.ts +8 -0
- package/src/types/list.ts +15 -0
- package/src/types/screening.ts +32 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +65 -0
- package/tsconfig.json +22 -0
- package/vite.config.ts +11 -0
- package/vitest.config.ts +19 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import { PageHeader } from '../components/layout/PageHeader'
|
|
3
|
+
import { Card } from '../components/ui/Card'
|
|
4
|
+
import { Button } from '../components/ui/Button'
|
|
5
|
+
import { Badge } from '../components/ui/Badge'
|
|
6
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner'
|
|
7
|
+
import { api } from '../api/client'
|
|
8
|
+
|
|
9
|
+
interface TxnResult {
|
|
10
|
+
decision: string; txn_id: string; risk_flags: string[];
|
|
11
|
+
sender_hits: any[]; receiver_hits: any[];
|
|
12
|
+
case_id: string; processing_ms: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function TxnScreening() {
|
|
16
|
+
const [form, setForm] = useState({
|
|
17
|
+
txn_id: '', sender_name: '', sender_country: '',
|
|
18
|
+
receiver_name: '', receiver_country: '',
|
|
19
|
+
amount_cents: 0, currency: 'USD',
|
|
20
|
+
})
|
|
21
|
+
const [result, setResult] = useState<TxnResult | null>(null)
|
|
22
|
+
const [loading, setLoading] = useState(false)
|
|
23
|
+
const [error, setError] = useState('')
|
|
24
|
+
|
|
25
|
+
const set = (k: string, v: string | number) => setForm({ ...form, [k]: v })
|
|
26
|
+
|
|
27
|
+
const screen = async () => {
|
|
28
|
+
if (!form.sender_name.trim()) return
|
|
29
|
+
setLoading(true); setError(''); setResult(null)
|
|
30
|
+
try {
|
|
31
|
+
const d = await api.post<TxnResult>('/txn/screen', form)
|
|
32
|
+
setResult(d)
|
|
33
|
+
} catch (err) {
|
|
34
|
+
setError(err instanceof Error ? err.message : 'Screening failed')
|
|
35
|
+
} finally {
|
|
36
|
+
setLoading(false)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div>
|
|
42
|
+
<PageHeader title="Transaction Screening"
|
|
43
|
+
description="Screen payment sender & receiver against sanctions + FATF lists" />
|
|
44
|
+
<Card className="mb-lg">
|
|
45
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-md mb-md">
|
|
46
|
+
<input placeholder="Sender name *" value={form.sender_name}
|
|
47
|
+
onChange={e => set('sender_name', e.target.value)} className="input-field" />
|
|
48
|
+
<input placeholder="Sender country (e.g. IR)" value={form.sender_country}
|
|
49
|
+
onChange={e => set('sender_country', e.target.value)} className="input-field" />
|
|
50
|
+
<input placeholder="Receiver name" value={form.receiver_name}
|
|
51
|
+
onChange={e => set('receiver_name', e.target.value)} className="input-field" />
|
|
52
|
+
<input placeholder="Receiver country" value={form.receiver_country}
|
|
53
|
+
onChange={e => set('receiver_country', e.target.value)} className="input-field" />
|
|
54
|
+
<input placeholder="Amount (cents)" type="number" value={form.amount_cents || ''}
|
|
55
|
+
onChange={e => set('amount_cents', +e.target.value)} className="input-field" />
|
|
56
|
+
<select value={form.currency} onChange={e => set('currency', e.target.value)} className="input-field">
|
|
57
|
+
{['USD', 'EUR', 'GBP', 'ILS', 'CHF', 'JPY'].map(c => <option key={c}>{c}</option>)}
|
|
58
|
+
</select>
|
|
59
|
+
</div>
|
|
60
|
+
<Button onClick={screen} disabled={loading || !form.sender_name.trim()} className="w-full">
|
|
61
|
+
{loading ? 'Screening...' : 'Screen Transaction'}
|
|
62
|
+
</Button>
|
|
63
|
+
</Card>
|
|
64
|
+
|
|
65
|
+
{loading && <LoadingSpinner />}
|
|
66
|
+
{error && <Card><p role="alert" className="text-apple-red sf-body">{error}</p></Card>}
|
|
67
|
+
{result && <TxnResultCard result={result} />}
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function TxnResultCard({ result }: { result: TxnResult }) {
|
|
73
|
+
const isClear = result.decision === 'CLEAR'
|
|
74
|
+
return (
|
|
75
|
+
<Card>
|
|
76
|
+
<div className="flex items-center justify-between mb-lg">
|
|
77
|
+
<span className={`text-2xl font-bold ${isClear ? 'text-apple-green' : 'text-apple-red'}`}>
|
|
78
|
+
{result.decision}
|
|
79
|
+
</span>
|
|
80
|
+
<span className="sf-caption text-white/40">{result.processing_ms}ms</span>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
{result.risk_flags?.length > 0 && (
|
|
84
|
+
<div className="flex flex-wrap gap-sm mb-lg">
|
|
85
|
+
{result.risk_flags.map(f => <Badge key={f} color="red" size="sm">{f}</Badge>)}
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
{result.case_id && (
|
|
90
|
+
<div className="p-md bg-apple-orange/10 border border-apple-orange/20 rounded-apple-md mb-lg">
|
|
91
|
+
<p className="sf-caption text-apple-orange">Case auto-created: <strong>{result.case_id}</strong></p>
|
|
92
|
+
</div>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
{result.sender_hits?.length > 0 && <HitsSection title="Sender Matches" hits={result.sender_hits} />}
|
|
96
|
+
{result.receiver_hits?.length > 0 && <HitsSection title="Receiver Matches" hits={result.receiver_hits} />}
|
|
97
|
+
|
|
98
|
+
{isClear && (
|
|
99
|
+
<div className="text-center py-lg">
|
|
100
|
+
<span className="text-3xl">✓</span>
|
|
101
|
+
<p className="sf-headline text-apple-green mt-sm">Transaction cleared</p>
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
</Card>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function HitsSection({ title, hits }: { title: string; hits: any[] }) {
|
|
109
|
+
return (
|
|
110
|
+
<div className="mb-lg">
|
|
111
|
+
<p className="sf-caption text-white/50 mb-sm">{title}</p>
|
|
112
|
+
{hits.map((h: any, i: number) => (
|
|
113
|
+
<div key={i} className="p-md bg-apple-red/5 border border-apple-red/10 rounded-apple-md mb-sm">
|
|
114
|
+
<p className="sf-headline">{h.entity_name}</p>
|
|
115
|
+
<div className="flex gap-sm mt-xs">
|
|
116
|
+
<Badge color="red" size="sm">{h.list_id}</Badge>
|
|
117
|
+
<Badge color="blue" size="sm">{Math.round((h.confidence ?? 0) * 100)}%</Badge>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
))}
|
|
121
|
+
</div>
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export default TxnScreening
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { render, screen, waitFor } from '@testing-library/react'
|
|
2
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
3
|
+
import { MemoryRouter, Route, Routes } from 'react-router-dom'
|
|
4
|
+
import { UBOChain } from './UBOChain'
|
|
5
|
+
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
global.fetch = vi.fn(() =>
|
|
8
|
+
Promise.resolve({
|
|
9
|
+
json: () => Promise.resolve({
|
|
10
|
+
data: {
|
|
11
|
+
owners: [
|
|
12
|
+
{ id: 'ubo_1', owner_name: 'Jane Smith', nationality: 'US',
|
|
13
|
+
ownership_pct: 30, is_direct_owner: true, is_pep: false },
|
|
14
|
+
],
|
|
15
|
+
total_ownership_pct: 30,
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
})
|
|
19
|
+
) as any
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
describe('UBOChain', () => {
|
|
23
|
+
it('renders title after load', async () => {
|
|
24
|
+
render(
|
|
25
|
+
<MemoryRouter initialEntries={['/compliance/ubo/org_1']}>
|
|
26
|
+
<Routes>
|
|
27
|
+
<Route path="/compliance/ubo/:id" element={<UBOChain />} />
|
|
28
|
+
</Routes>
|
|
29
|
+
</MemoryRouter>
|
|
30
|
+
)
|
|
31
|
+
await waitFor(() => {
|
|
32
|
+
expect(screen.getByText('Beneficial Ownership')).toBeInTheDocument()
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react'
|
|
2
|
+
import { useParams } from 'react-router-dom'
|
|
3
|
+
import { useTranslation } from 'react-i18next'
|
|
4
|
+
import { api } from '../api/client'
|
|
5
|
+
|
|
6
|
+
interface Owner {
|
|
7
|
+
id: string
|
|
8
|
+
owner_name: string
|
|
9
|
+
nationality: string
|
|
10
|
+
ownership_pct: number
|
|
11
|
+
is_direct_owner: boolean
|
|
12
|
+
is_pep: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function UBOChain() {
|
|
16
|
+
const { t } = useTranslation('compliance')
|
|
17
|
+
const { id } = useParams<{ id: string }>()
|
|
18
|
+
const [owners, setOwners] = useState<Owner[]>([])
|
|
19
|
+
const [totalPct, setTotalPct] = useState(0)
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!id) return
|
|
23
|
+
api.get<{ owners: Owner[]; total_ownership_pct: number }>(`/ubo/${id}`)
|
|
24
|
+
.then(d => {
|
|
25
|
+
setOwners(d?.owners ?? [])
|
|
26
|
+
setTotalPct(d?.total_ownership_pct ?? 0)
|
|
27
|
+
})
|
|
28
|
+
.catch(() => { setOwners([]); setTotalPct(0) })
|
|
29
|
+
}, [id])
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="px-md py-lg sm:p-8 max-w-4xl mx-auto">
|
|
33
|
+
<h1 className="text-xl sm:text-2xl font-semibold mb-2">{t('ubo.title')}</h1>
|
|
34
|
+
<p className="text-apple-label-secondary mb-6">{t('ubo.organization')} {id}</p>
|
|
35
|
+
<div className="card-vibrancy p-6 mb-4">
|
|
36
|
+
<div className="flex justify-between items-center mb-4">
|
|
37
|
+
<span className="text-sm text-apple-label-secondary">{t('ubo.total_identified')}</span>
|
|
38
|
+
<span className="text-lg font-bold">{totalPct.toFixed(1)}%</span>
|
|
39
|
+
</div>
|
|
40
|
+
<div className="w-full bg-apple-bg-tertiary rounded-full h-3 mb-6">
|
|
41
|
+
<div className="bg-apple-blue h-3 rounded-full"
|
|
42
|
+
style={{ width: `${Math.min(totalPct, 100)}%` }} />
|
|
43
|
+
</div>
|
|
44
|
+
{owners.map(o => (
|
|
45
|
+
<div key={o.id} className="flex flex-col sm:flex-row sm:items-center justify-between py-3 border-b border-white/10 gap-xs">
|
|
46
|
+
<div>
|
|
47
|
+
<p className="font-medium">{o.owner_name}</p>
|
|
48
|
+
<p className="text-xs text-apple-label-secondary">
|
|
49
|
+
{o.nationality} {o.is_direct_owner ? t('ubo.direct') : t('ubo.indirect')}
|
|
50
|
+
</p>
|
|
51
|
+
</div>
|
|
52
|
+
<div className="flex items-center gap-3">
|
|
53
|
+
{o.is_pep && (
|
|
54
|
+
<span className="text-xs px-2 py-0.5 bg-apple-orange/20 text-apple-orange rounded">
|
|
55
|
+
{t('ubo.pep_badge')}
|
|
56
|
+
</span>
|
|
57
|
+
)}
|
|
58
|
+
<span className="font-mono text-sm">{o.ownership_pct}%</span>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react'
|
|
2
|
+
import { PageHeader } from '../components/layout/PageHeader'
|
|
3
|
+
import { Card } from '../components/ui/Card'
|
|
4
|
+
import { Button } from '../components/ui/Button'
|
|
5
|
+
import { Badge } from '../components/ui/Badge'
|
|
6
|
+
import { LoadingSpinner } from '../components/ui/LoadingSpinner'
|
|
7
|
+
import { EmptyState } from '../components/ui/EmptyState'
|
|
8
|
+
import { api } from '../api/client'
|
|
9
|
+
|
|
10
|
+
interface Webhook {
|
|
11
|
+
id: string; url: string; events: string[]; active: boolean; created_at: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const EVENT_TYPES = [
|
|
15
|
+
'screening.completed', 'screening.match_found',
|
|
16
|
+
'alert.created', 'alert.resolved',
|
|
17
|
+
'case.created', 'case.escalated',
|
|
18
|
+
'list.updated', 'entity.added', 'entity.removed',
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
export function Webhooks() {
|
|
22
|
+
const [hooks, setHooks] = useState<Webhook[]>([])
|
|
23
|
+
const [loading, setLoading] = useState(true)
|
|
24
|
+
const [error, setError] = useState('')
|
|
25
|
+
const [showForm, setShowForm] = useState(false)
|
|
26
|
+
|
|
27
|
+
const load = useCallback(async () => {
|
|
28
|
+
try {
|
|
29
|
+
const d = await api.get<{ subscriptions: Webhook[] }>('/webhooks/subscriptions')
|
|
30
|
+
setHooks(d?.subscriptions ?? [])
|
|
31
|
+
} catch (err) {
|
|
32
|
+
setError(err instanceof Error ? err.message : 'Failed to load')
|
|
33
|
+
} finally {
|
|
34
|
+
setLoading(false)
|
|
35
|
+
}
|
|
36
|
+
}, [])
|
|
37
|
+
|
|
38
|
+
useEffect(() => { load() }, [load])
|
|
39
|
+
|
|
40
|
+
const remove = async (id: string) => {
|
|
41
|
+
if (!confirm('Delete this webhook?')) return
|
|
42
|
+
try { await api.del(`/webhooks/subscriptions/${id}`); load() }
|
|
43
|
+
catch (err) { setError(err instanceof Error ? err.message : 'Delete failed') }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const test = async () => {
|
|
47
|
+
try {
|
|
48
|
+
await api.post('/webhooks/test', {})
|
|
49
|
+
alert('Test webhook sent!')
|
|
50
|
+
} catch (err) {
|
|
51
|
+
setError(err instanceof Error ? err.message : 'Test failed')
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div>
|
|
57
|
+
<PageHeader title="Webhooks" description="Receive real-time notifications when events occur" />
|
|
58
|
+
<Card className="mb-lg">
|
|
59
|
+
<div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-md">
|
|
60
|
+
<p className="sf-body text-white/60">Get notified on screening matches, alerts, and list updates</p>
|
|
61
|
+
<div className="flex gap-sm w-full sm:w-auto">
|
|
62
|
+
<Button variant="secondary" onClick={test} className="flex-1 sm:flex-none">Test</Button>
|
|
63
|
+
<Button onClick={() => setShowForm(true)} className="flex-1 sm:flex-none">Add Webhook</Button>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</Card>
|
|
67
|
+
|
|
68
|
+
{showForm && <WebhookForm onSave={() => { setShowForm(false); load() }}
|
|
69
|
+
onCancel={() => setShowForm(false)} setError={setError} />}
|
|
70
|
+
|
|
71
|
+
{error && <Card className="mb-lg"><p role="alert" className="text-apple-red sf-body">{error}</p></Card>}
|
|
72
|
+
{loading && <LoadingSpinner />}
|
|
73
|
+
{!loading && hooks.length === 0 && !showForm && <EmptyState title="No webhooks configured" />}
|
|
74
|
+
|
|
75
|
+
{!loading && hooks.length > 0 && (
|
|
76
|
+
<Card>
|
|
77
|
+
{hooks.map(h => (
|
|
78
|
+
<div key={h.id} className="flex flex-col sm:flex-row sm:items-center justify-between px-lg py-md border-b border-white/[0.04] last:border-0 gap-sm">
|
|
79
|
+
<div className="min-w-0 flex-1">
|
|
80
|
+
<code className="text-sm text-white/80 break-all block">{h.url}</code>
|
|
81
|
+
<div className="flex gap-xs mt-xs flex-wrap">
|
|
82
|
+
{(h.events ?? []).map(e => <Badge key={e} size="sm" color="blue">{e}</Badge>)}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<button onClick={() => remove(h.id)}
|
|
86
|
+
className="text-apple-red/60 hover:text-apple-red text-sm cursor-pointer self-end sm:self-center shrink-0">Delete</button>
|
|
87
|
+
</div>
|
|
88
|
+
))}
|
|
89
|
+
</Card>
|
|
90
|
+
)}
|
|
91
|
+
</div>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function WebhookForm({ onSave, onCancel, setError }: {
|
|
96
|
+
onSave: () => void; onCancel: () => void; setError: (e: string) => void
|
|
97
|
+
}) {
|
|
98
|
+
const [url, setUrl] = useState('')
|
|
99
|
+
const [events, setEvents] = useState<string[]>(['screening.match_found'])
|
|
100
|
+
const [saving, setSaving] = useState(false)
|
|
101
|
+
|
|
102
|
+
const toggle = (evt: string) =>
|
|
103
|
+
setEvents(events.includes(evt) ? events.filter(e => e !== evt) : [...events, evt])
|
|
104
|
+
|
|
105
|
+
const save = async () => {
|
|
106
|
+
if (!url.trim()) return
|
|
107
|
+
setSaving(true)
|
|
108
|
+
try { await api.post('/webhooks/subscribe', { url, events }); onSave() }
|
|
109
|
+
catch (err) { setError(err instanceof Error ? err.message : 'Save failed') }
|
|
110
|
+
finally { setSaving(false) }
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Card className="mb-lg">
|
|
115
|
+
<input value={url} onChange={e => setUrl(e.target.value)}
|
|
116
|
+
placeholder="https://your-server.com/webhook" className="input-field w-full mb-md" />
|
|
117
|
+
<p className="sf-caption text-white/50 mb-sm">Events:</p>
|
|
118
|
+
<div className="flex flex-wrap gap-sm mb-lg">
|
|
119
|
+
{EVENT_TYPES.map(evt => (
|
|
120
|
+
<button key={evt} onClick={() => toggle(evt)}
|
|
121
|
+
className={`px-md py-xs rounded-full text-xs cursor-pointer transition-colors ${
|
|
122
|
+
events.includes(evt) ? 'bg-apple-blue text-white' : 'bg-white/[0.04] text-white/50'}`}>
|
|
123
|
+
{evt}
|
|
124
|
+
</button>
|
|
125
|
+
))}
|
|
126
|
+
</div>
|
|
127
|
+
<div className="flex gap-sm">
|
|
128
|
+
<Button onClick={save} disabled={saving || !url.trim()}>
|
|
129
|
+
{saving ? 'Saving...' : 'Save'}
|
|
130
|
+
</Button>
|
|
131
|
+
<Button variant="secondary" onClick={onCancel}>Cancel</Button>
|
|
132
|
+
</div>
|
|
133
|
+
</Card>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export default Webhooks
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { useEffect, useState, useRef } from 'react'
|
|
2
|
+
import { PageHeader } from '../../components/layout/PageHeader'
|
|
3
|
+
import { Card } from '../../components/ui/Card'
|
|
4
|
+
import { Button } from '../../components/ui/Button'
|
|
5
|
+
import { Badge } from '../../components/ui/Badge'
|
|
6
|
+
import { LoadingSpinner } from '../../components/ui/LoadingSpinner'
|
|
7
|
+
import { api } from '../../api/client'
|
|
8
|
+
|
|
9
|
+
interface LoadedSource {
|
|
10
|
+
list_id: string
|
|
11
|
+
count: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface SourcesData {
|
|
15
|
+
loaded: LoadedSource[]
|
|
16
|
+
total_entities: number
|
|
17
|
+
total_peps: number
|
|
18
|
+
total_profiles: number
|
|
19
|
+
available_count: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface UploadResult {
|
|
23
|
+
filename: string
|
|
24
|
+
list_id: string
|
|
25
|
+
imported: number
|
|
26
|
+
parsed: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function DataSources() {
|
|
30
|
+
const [data, setData] = useState<SourcesData | null>(null)
|
|
31
|
+
const [loading, setLoading] = useState(true)
|
|
32
|
+
const [uploading, setUploading] = useState(false)
|
|
33
|
+
const [uploadResult, setUploadResult] = useState<UploadResult | null>(null)
|
|
34
|
+
const [error, setError] = useState('')
|
|
35
|
+
const [refreshing, setRefreshing] = useState(false)
|
|
36
|
+
const fileRef = useRef<HTMLInputElement>(null!)
|
|
37
|
+
const [listId, setListId] = useState('icij_offshore')
|
|
38
|
+
|
|
39
|
+
const fetchSources = async () => {
|
|
40
|
+
try {
|
|
41
|
+
const d = await api.get<SourcesData>('/admin/data-sources')
|
|
42
|
+
setData(d)
|
|
43
|
+
} catch {
|
|
44
|
+
setError('Failed to load data sources')
|
|
45
|
+
} finally {
|
|
46
|
+
setLoading(false)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
useEffect(() => { fetchSources() }, [])
|
|
51
|
+
|
|
52
|
+
const handleUpload = async () => {
|
|
53
|
+
const file = fileRef.current?.files?.[0]
|
|
54
|
+
if (!file) return
|
|
55
|
+
setUploading(true)
|
|
56
|
+
setUploadResult(null)
|
|
57
|
+
setError('')
|
|
58
|
+
try {
|
|
59
|
+
const form = new FormData()
|
|
60
|
+
form.append('file', file)
|
|
61
|
+
form.append('list_id', listId)
|
|
62
|
+
const resp = await uploadFile(form)
|
|
63
|
+
setUploadResult(resp)
|
|
64
|
+
fetchSources()
|
|
65
|
+
} catch (err) {
|
|
66
|
+
setError(err instanceof Error ? err.message : 'Upload failed')
|
|
67
|
+
} finally {
|
|
68
|
+
setUploading(false)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const handleRefresh = async () => {
|
|
73
|
+
setRefreshing(true)
|
|
74
|
+
try {
|
|
75
|
+
await api.post('/admin/lists/refresh', {})
|
|
76
|
+
fetchSources()
|
|
77
|
+
} catch {
|
|
78
|
+
setError('Refresh failed')
|
|
79
|
+
} finally {
|
|
80
|
+
setRefreshing(false)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (loading) return <div className="flex items-center justify-center h-96"><LoadingSpinner /></div>
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div>
|
|
88
|
+
<PageHeader
|
|
89
|
+
title="Data Sources"
|
|
90
|
+
description="Manage sanctions lists, PEP databases, and custom entity sources"
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-lg mb-xl">
|
|
94
|
+
<StatCard label="Total Entities" value={data?.total_entities ?? 0} />
|
|
95
|
+
<StatCard label="PEP Profiles" value={data?.total_peps ?? 0} />
|
|
96
|
+
<StatCard label="Total Profiles" value={data?.total_profiles ?? 0} color="blue" />
|
|
97
|
+
<StatCard label="Active Lists" value={data?.loaded?.length ?? 0} />
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-lg">
|
|
101
|
+
<div className="lg:col-span-2">
|
|
102
|
+
<SourcesTable sources={data?.loaded ?? []} />
|
|
103
|
+
</div>
|
|
104
|
+
<div className="space-y-lg">
|
|
105
|
+
<UploadCard
|
|
106
|
+
fileRef={fileRef}
|
|
107
|
+
listId={listId}
|
|
108
|
+
setListId={setListId}
|
|
109
|
+
uploading={uploading}
|
|
110
|
+
onUpload={handleUpload}
|
|
111
|
+
result={uploadResult}
|
|
112
|
+
/>
|
|
113
|
+
<Card>
|
|
114
|
+
<h3 className="sf-headline mb-md">Sync Lists</h3>
|
|
115
|
+
<p className="sf-caption text-white/60 mb-lg">
|
|
116
|
+
Re-download all sanctions lists from official sources
|
|
117
|
+
</p>
|
|
118
|
+
<Button onClick={handleRefresh} disabled={refreshing} className="w-full">
|
|
119
|
+
{refreshing ? 'Syncing...' : 'Sync All Lists'}
|
|
120
|
+
</Button>
|
|
121
|
+
</Card>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{error && (
|
|
126
|
+
<Card className="mt-lg">
|
|
127
|
+
<p className="text-apple-red sf-body">{error}</p>
|
|
128
|
+
</Card>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function StatCard({ label, value, color = 'green' }: {
|
|
135
|
+
label: string; value: number; color?: string
|
|
136
|
+
}) {
|
|
137
|
+
const cls = color === 'blue' ? 'text-apple-blue' : 'text-apple-green'
|
|
138
|
+
return (
|
|
139
|
+
<Card>
|
|
140
|
+
<p className="sf-caption text-white/60">{label}</p>
|
|
141
|
+
<p className={`sf-headline text-2xl ${cls}`}>
|
|
142
|
+
{value.toLocaleString()}
|
|
143
|
+
</p>
|
|
144
|
+
</Card>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function SourcesTable({ sources }: { sources: LoadedSource[] }) {
|
|
149
|
+
return (
|
|
150
|
+
<Card>
|
|
151
|
+
<h3 className="sf-headline mb-lg">Loaded Sources</h3>
|
|
152
|
+
<div className="space-y-sm">
|
|
153
|
+
{sources.map(s => (
|
|
154
|
+
<div key={s.list_id}
|
|
155
|
+
className="flex items-center justify-between p-md rounded-apple-md bg-white/[0.03]">
|
|
156
|
+
<div className="flex items-center gap-md">
|
|
157
|
+
<Badge color={s.list_id.startsWith('ofac') ? 'red' : 'blue'} size="sm">
|
|
158
|
+
{s.list_id}
|
|
159
|
+
</Badge>
|
|
160
|
+
</div>
|
|
161
|
+
<span className="sf-body font-semibold">
|
|
162
|
+
{s.count.toLocaleString()}
|
|
163
|
+
</span>
|
|
164
|
+
</div>
|
|
165
|
+
))}
|
|
166
|
+
</div>
|
|
167
|
+
</Card>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function UploadCard({ fileRef, listId, setListId, uploading, onUpload, result }: {
|
|
172
|
+
fileRef: React.RefObject<HTMLInputElement>
|
|
173
|
+
listId: string
|
|
174
|
+
setListId: (v: string) => void
|
|
175
|
+
uploading: boolean
|
|
176
|
+
onUpload: () => void
|
|
177
|
+
result: UploadResult | null
|
|
178
|
+
}) {
|
|
179
|
+
return (
|
|
180
|
+
<Card>
|
|
181
|
+
<h3 className="sf-headline mb-md">Upload CSV</h3>
|
|
182
|
+
<p className="sf-caption text-white/60 mb-lg">
|
|
183
|
+
Import ICIJ, custom lists, or any CSV with entity names
|
|
184
|
+
</p>
|
|
185
|
+
<input
|
|
186
|
+
ref={fileRef}
|
|
187
|
+
type="file"
|
|
188
|
+
accept=".csv"
|
|
189
|
+
className="w-full mb-md text-sm text-white/60 file:mr-4 file:py-2 file:px-4
|
|
190
|
+
file:rounded-apple file:border-0 file:bg-apple-blue/20 file:text-apple-blue
|
|
191
|
+
file:font-semibold file:cursor-pointer"
|
|
192
|
+
/>
|
|
193
|
+
<input
|
|
194
|
+
type="text"
|
|
195
|
+
value={listId}
|
|
196
|
+
onChange={e => setListId(e.target.value)}
|
|
197
|
+
placeholder="List ID (e.g. icij_offshore)"
|
|
198
|
+
className="input-field w-full mb-md"
|
|
199
|
+
/>
|
|
200
|
+
<Button onClick={onUpload} disabled={uploading} className="w-full">
|
|
201
|
+
{uploading ? 'Uploading...' : 'Upload & Import'}
|
|
202
|
+
</Button>
|
|
203
|
+
{result && (
|
|
204
|
+
<div className="mt-md p-md rounded-apple-md bg-apple-green/10">
|
|
205
|
+
<p className="sf-caption text-apple-green">
|
|
206
|
+
Imported {result.imported.toLocaleString()} entities from {result.filename}
|
|
207
|
+
</p>
|
|
208
|
+
</div>
|
|
209
|
+
)}
|
|
210
|
+
</Card>
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async function uploadFile(form: FormData): Promise<UploadResult> {
|
|
215
|
+
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:8080'
|
|
216
|
+
const token = localStorage.getItem('amliq_token')
|
|
217
|
+
const resp = await fetch(`${API_BASE}/api/v1/admin/data-sources/upload`, {
|
|
218
|
+
method: 'POST',
|
|
219
|
+
headers: token ? { Authorization: `Bearer ${token}` } : {},
|
|
220
|
+
body: form,
|
|
221
|
+
})
|
|
222
|
+
if (!resp.ok) {
|
|
223
|
+
const body = await resp.json().catch(() => ({}))
|
|
224
|
+
throw new Error(body.message || 'Upload failed')
|
|
225
|
+
}
|
|
226
|
+
const json = await resp.json()
|
|
227
|
+
return json.data ?? json
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export default DataSources
|