@friggframework/devtools 2.0.0--canary.522.cbd3d5a.0 → 2.0.0--canary.517.21b69ac.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/.eslintrc.json +3 -0
- package/CHANGELOG.md +132 -0
- package/frigg-cli/README.md +1 -1
- package/frigg-cli/__tests__/unit/commands/doctor.test.js +2 -0
- package/frigg-cli/__tests__/unit/commands/install.test.js +17 -21
- package/frigg-cli/doctor-command/index.js +16 -17
- package/frigg-cli/index.js +6 -21
- package/frigg-cli/index.test.js +1 -7
- package/frigg-cli/init-command/backend-first-handler.js +42 -124
- package/frigg-cli/init-command/index.js +1 -2
- package/frigg-cli/init-command/template-handler.js +3 -13
- package/frigg-cli/install-command/backend-js.js +3 -3
- package/frigg-cli/install-command/environment-variables.js +19 -16
- package/frigg-cli/install-command/environment-variables.test.js +13 -12
- package/frigg-cli/install-command/index.js +9 -14
- package/frigg-cli/install-command/integration-file.js +3 -3
- package/frigg-cli/install-command/logger.js +12 -0
- package/frigg-cli/install-command/validate-package.js +9 -5
- package/frigg-cli/jest.config.js +1 -4
- package/frigg-cli/repair-command/index.js +128 -101
- package/frigg-cli/start-command/index.js +2 -246
- package/frigg-cli/ui-command/index.js +36 -58
- package/frigg-cli/utils/repo-detection.js +37 -85
- package/infrastructure/docs/iam-policy-templates.md +1 -1
- package/infrastructure/domains/networking/vpc-builder.test.js +4 -2
- package/infrastructure/domains/networking/vpc-resolver.test.js +1 -1
- package/infrastructure/domains/shared/cloudformation-discovery.test.js +7 -4
- package/infrastructure/domains/shared/resource-discovery.js +5 -5
- package/infrastructure/domains/shared/types/discovery-result.test.js +1 -1
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +2 -25
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +2 -2
- package/infrastructure/infrastructure-composer.test.js +2 -2
- package/layers/prisma/.build-complete +3 -0
- package/layers/prisma/nodejs/package.json +8 -0
- package/management-ui/.eslintrc.js +22 -0
- package/management-ui/README.md +109 -245
- package/management-ui/components.json +21 -0
- package/management-ui/docs/phase2-integration-guide.md +320 -0
- package/management-ui/index.html +13 -0
- package/management-ui/package.json +76 -0
- package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +302 -0
- package/management-ui/postcss.config.js +6 -0
- package/management-ui/server/api/backend.js +256 -0
- package/management-ui/server/api/cli.js +315 -0
- package/management-ui/server/api/codegen.js +663 -0
- package/management-ui/server/api/connections.js +857 -0
- package/management-ui/server/api/discovery.js +185 -0
- package/management-ui/server/api/environment/index.js +1 -0
- package/management-ui/server/api/environment/router.js +378 -0
- package/management-ui/server/api/environment.js +328 -0
- package/management-ui/server/api/integrations.js +876 -0
- package/management-ui/server/api/logs.js +248 -0
- package/management-ui/server/api/monitoring.js +282 -0
- package/management-ui/server/api/open-ide.js +31 -0
- package/management-ui/server/api/project.js +1029 -0
- package/management-ui/server/api/users/sessions.js +371 -0
- package/management-ui/server/api/users/simulation.js +254 -0
- package/management-ui/server/api/users.js +362 -0
- package/management-ui/server/api-contract.md +275 -0
- package/management-ui/server/index.js +873 -0
- package/management-ui/server/middleware/errorHandler.js +93 -0
- package/management-ui/server/middleware/security.js +32 -0
- package/management-ui/server/processManager.js +296 -0
- package/management-ui/server/server.js +346 -0
- package/management-ui/server/services/aws-monitor.js +413 -0
- package/management-ui/server/services/npm-registry.js +347 -0
- package/management-ui/server/services/template-engine.js +538 -0
- package/management-ui/server/utils/cliIntegration.js +220 -0
- package/management-ui/server/utils/environment/auditLogger.js +471 -0
- package/management-ui/server/utils/environment/awsParameterStore.js +275 -0
- package/management-ui/server/utils/environment/encryption.js +278 -0
- package/management-ui/server/utils/environment/envFileManager.js +286 -0
- package/management-ui/server/utils/import-commonjs.js +28 -0
- package/management-ui/server/utils/response.js +83 -0
- package/management-ui/server/websocket/handler.js +325 -0
- package/management-ui/src/App.jsx +25 -0
- package/management-ui/src/assets/FriggLogo.svg +1 -0
- package/management-ui/src/components/AppRouter.jsx +65 -0
- package/management-ui/src/components/Button.jsx +70 -0
- package/management-ui/src/components/Card.jsx +97 -0
- package/management-ui/src/components/EnvironmentCompare.jsx +400 -0
- package/management-ui/src/components/EnvironmentEditor.jsx +372 -0
- package/management-ui/src/components/EnvironmentImportExport.jsx +469 -0
- package/management-ui/src/components/EnvironmentSchema.jsx +491 -0
- package/management-ui/src/components/EnvironmentSecurity.jsx +463 -0
- package/management-ui/src/components/ErrorBoundary.jsx +73 -0
- package/management-ui/src/components/IntegrationCard.jsx +481 -0
- package/management-ui/src/components/IntegrationCardEnhanced.jsx +770 -0
- package/management-ui/src/components/IntegrationExplorer.jsx +379 -0
- package/management-ui/src/components/IntegrationStatus.jsx +336 -0
- package/management-ui/src/components/Layout.jsx +716 -0
- package/management-ui/src/components/LoadingSpinner.jsx +113 -0
- package/management-ui/src/components/RepositoryPicker.jsx +248 -0
- package/management-ui/src/components/SessionMonitor.jsx +350 -0
- package/management-ui/src/components/StatusBadge.jsx +208 -0
- package/management-ui/src/components/UserContextSwitcher.jsx +212 -0
- package/management-ui/src/components/UserSimulation.jsx +327 -0
- package/management-ui/src/components/Welcome.jsx +434 -0
- package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +637 -0
- package/management-ui/src/components/codegen/APIModuleSelector.jsx +227 -0
- package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +247 -0
- package/management-ui/src/components/codegen/CodePreviewEditor.jsx +316 -0
- package/management-ui/src/components/codegen/DynamicModuleForm.jsx +271 -0
- package/management-ui/src/components/codegen/FormBuilder.jsx +737 -0
- package/management-ui/src/components/codegen/IntegrationGenerator.jsx +855 -0
- package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +797 -0
- package/management-ui/src/components/codegen/SchemaBuilder.jsx +303 -0
- package/management-ui/src/components/codegen/TemplateSelector.jsx +586 -0
- package/management-ui/src/components/codegen/index.js +10 -0
- package/management-ui/src/components/connections/ConnectionConfigForm.jsx +362 -0
- package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +182 -0
- package/management-ui/src/components/connections/ConnectionTester.jsx +200 -0
- package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +292 -0
- package/management-ui/src/components/connections/OAuthFlow.jsx +204 -0
- package/management-ui/src/components/connections/index.js +5 -0
- package/management-ui/src/components/index.js +21 -0
- package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +222 -0
- package/management-ui/src/components/monitoring/LambdaMetrics.jsx +169 -0
- package/management-ui/src/components/monitoring/MetricsChart.jsx +197 -0
- package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +393 -0
- package/management-ui/src/components/monitoring/SQSMetrics.jsx +246 -0
- package/management-ui/src/components/monitoring/index.js +6 -0
- package/management-ui/src/components/monitoring/monitoring.css +218 -0
- package/management-ui/src/components/theme-provider.jsx +52 -0
- package/management-ui/src/components/theme-toggle.jsx +39 -0
- package/management-ui/src/components/ui/badge.tsx +36 -0
- package/management-ui/src/components/ui/button.test.jsx +56 -0
- package/management-ui/src/components/ui/button.tsx +57 -0
- package/management-ui/src/components/ui/card.tsx +76 -0
- package/management-ui/src/components/ui/dropdown-menu.tsx +199 -0
- package/management-ui/src/components/ui/select.tsx +157 -0
- package/management-ui/src/components/ui/skeleton.jsx +15 -0
- package/management-ui/src/hooks/useFrigg.jsx +387 -0
- package/management-ui/src/hooks/useSocket.jsx +58 -0
- package/management-ui/src/index.css +193 -0
- package/management-ui/src/lib/utils.ts +6 -0
- package/management-ui/src/main.jsx +10 -0
- package/management-ui/src/pages/CodeGeneration.jsx +14 -0
- package/management-ui/src/pages/Connections.jsx +252 -0
- package/management-ui/src/pages/ConnectionsEnhanced.jsx +633 -0
- package/management-ui/src/pages/Dashboard.jsx +311 -0
- package/management-ui/src/pages/Environment.jsx +314 -0
- package/management-ui/src/pages/IntegrationConfigure.jsx +669 -0
- package/management-ui/src/pages/IntegrationDiscovery.jsx +567 -0
- package/management-ui/src/pages/IntegrationTest.jsx +742 -0
- package/management-ui/src/pages/Integrations.jsx +253 -0
- package/management-ui/src/pages/Monitoring.jsx +17 -0
- package/management-ui/src/pages/Simulation.jsx +155 -0
- package/management-ui/src/pages/Users.jsx +492 -0
- package/management-ui/src/services/api.js +41 -0
- package/management-ui/src/services/apiModuleService.js +193 -0
- package/management-ui/src/services/websocket-handlers.js +120 -0
- package/management-ui/src/test/api/project.test.js +273 -0
- package/management-ui/src/test/components/Welcome.test.jsx +378 -0
- package/management-ui/src/test/mocks/server.js +178 -0
- package/management-ui/src/test/setup.js +61 -0
- package/management-ui/src/test/utils/test-utils.jsx +134 -0
- package/management-ui/src/utils/repository.js +98 -0
- package/management-ui/src/utils/repository.test.js +118 -0
- package/management-ui/src/workflows/phase2-integration-workflows.js +884 -0
- package/management-ui/tailwind.config.js +63 -0
- package/management-ui/tsconfig.json +37 -0
- package/management-ui/tsconfig.node.json +10 -0
- package/management-ui/vite.config.js +26 -0
- package/management-ui/vitest.config.js +38 -0
- package/package.json +7 -17
- package/frigg-cli/__tests__/application/use-cases/AddApiModuleToIntegrationUseCase.test.js +0 -326
- package/frigg-cli/__tests__/application/use-cases/CreateApiModuleUseCase.test.js +0 -337
- package/frigg-cli/__tests__/domain/entities/ApiModule.test.js +0 -373
- package/frigg-cli/__tests__/domain/entities/AppDefinition.test.js +0 -313
- package/frigg-cli/__tests__/domain/services/IntegrationValidator.test.js +0 -269
- package/frigg-cli/__tests__/domain/value-objects/IntegrationName.test.js +0 -82
- package/frigg-cli/__tests__/infrastructure/adapters/IntegrationJsUpdater.test.js +0 -408
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemApiModuleRepository.test.js +0 -583
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemAppDefinitionRepository.test.js +0 -314
- package/frigg-cli/__tests__/infrastructure/repositories/FileSystemIntegrationRepository.test.js +0 -430
- package/frigg-cli/__tests__/unit/commands/init.test.js +0 -406
- package/frigg-cli/__tests__/unit/commands/repair.test.js +0 -275
- package/frigg-cli/__tests__/unit/start-command/application/RunPreflightChecksUseCase.test.js +0 -411
- package/frigg-cli/__tests__/unit/start-command/infrastructure/DatabaseAdapter.test.js +0 -405
- package/frigg-cli/__tests__/unit/start-command/infrastructure/DockerAdapter.test.js +0 -496
- package/frigg-cli/__tests__/unit/start-command/presentation/InteractivePromptAdapter.test.js +0 -474
- package/frigg-cli/__tests__/unit/utils/output.test.js +0 -196
- package/frigg-cli/application/use-cases/AddApiModuleToIntegrationUseCase.js +0 -93
- package/frigg-cli/application/use-cases/CreateApiModuleUseCase.js +0 -93
- package/frigg-cli/application/use-cases/CreateIntegrationUseCase.js +0 -103
- package/frigg-cli/container.js +0 -172
- package/frigg-cli/docs/OUTPUT_MIGRATION_GUIDE.md +0 -286
- package/frigg-cli/domain/entities/ApiModule.js +0 -272
- package/frigg-cli/domain/entities/AppDefinition.js +0 -227
- package/frigg-cli/domain/entities/Integration.js +0 -198
- package/frigg-cli/domain/exceptions/DomainException.js +0 -24
- package/frigg-cli/domain/ports/IApiModuleRepository.js +0 -53
- package/frigg-cli/domain/ports/IAppDefinitionRepository.js +0 -43
- package/frigg-cli/domain/ports/IIntegrationRepository.js +0 -61
- package/frigg-cli/domain/services/IntegrationValidator.js +0 -185
- package/frigg-cli/domain/value-objects/IntegrationId.js +0 -42
- package/frigg-cli/domain/value-objects/IntegrationName.js +0 -60
- package/frigg-cli/domain/value-objects/SemanticVersion.js +0 -70
- package/frigg-cli/infrastructure/UnitOfWork.js +0 -46
- package/frigg-cli/infrastructure/adapters/BackendJsUpdater.js +0 -197
- package/frigg-cli/infrastructure/adapters/FileSystemAdapter.js +0 -224
- package/frigg-cli/infrastructure/adapters/IntegrationJsUpdater.js +0 -249
- package/frigg-cli/infrastructure/adapters/SchemaValidator.js +0 -92
- package/frigg-cli/infrastructure/repositories/FileSystemApiModuleRepository.js +0 -373
- package/frigg-cli/infrastructure/repositories/FileSystemAppDefinitionRepository.js +0 -116
- package/frigg-cli/infrastructure/repositories/FileSystemIntegrationRepository.js +0 -277
- package/frigg-cli/package-lock.json +0 -16226
- package/frigg-cli/start-command/application/RunPreflightChecksUseCase.js +0 -376
- package/frigg-cli/start-command/infrastructure/DatabaseAdapter.js +0 -591
- package/frigg-cli/start-command/infrastructure/DockerAdapter.js +0 -306
- package/frigg-cli/start-command/presentation/InteractivePromptAdapter.js +0 -329
- package/frigg-cli/templates/backend/.env.example +0 -62
- package/frigg-cli/templates/backend/.eslintrc.json +0 -12
- package/frigg-cli/templates/backend/.prettierrc +0 -6
- package/frigg-cli/templates/backend/docker-compose.yml +0 -22
- package/frigg-cli/templates/backend/index.js +0 -96
- package/frigg-cli/templates/backend/infrastructure.js +0 -12
- package/frigg-cli/templates/backend/jest.config.js +0 -17
- package/frigg-cli/templates/backend/package.json +0 -50
- package/frigg-cli/templates/backend/src/api-modules/.gitkeep +0 -10
- package/frigg-cli/templates/backend/src/base/.gitkeep +0 -7
- package/frigg-cli/templates/backend/src/integrations/.gitkeep +0 -10
- package/frigg-cli/templates/backend/src/integrations/ExampleIntegration.js +0 -65
- package/frigg-cli/templates/backend/src/utils/.gitkeep +0 -7
- package/frigg-cli/templates/backend/test/setup.js +0 -30
- package/frigg-cli/templates/backend/ui-extensions/.gitkeep +0 -0
- package/frigg-cli/templates/backend/ui-extensions/README.md +0 -77
- package/frigg-cli/utils/__tests__/repo-detection.test.js +0 -436
- package/frigg-cli/utils/output.js +0 -382
- package/frigg-cli/validate-command/__tests__/adapters/validate-command.test.js +0 -205
- package/frigg-cli/validate-command/__tests__/application/validate-app-use-case.test.js +0 -104
- package/frigg-cli/validate-command/__tests__/domain/fix-suggestion.test.js +0 -153
- package/frigg-cli/validate-command/__tests__/domain/validation-error.test.js +0 -162
- package/frigg-cli/validate-command/__tests__/domain/validation-result.test.js +0 -152
- package/frigg-cli/validate-command/__tests__/infrastructure/api-module-validator.test.js +0 -332
- package/frigg-cli/validate-command/__tests__/infrastructure/app-definition-validator.test.js +0 -191
- package/frigg-cli/validate-command/__tests__/infrastructure/integration-class-validator.test.js +0 -146
- package/frigg-cli/validate-command/__tests__/infrastructure/template-validation.test.js +0 -155
- package/frigg-cli/validate-command/adapters/cli/validate-command.js +0 -199
- package/frigg-cli/validate-command/application/use-cases/validate-app-use-case.js +0 -35
- package/frigg-cli/validate-command/domain/entities/validation-result.js +0 -74
- package/frigg-cli/validate-command/domain/value-objects/fix-suggestion.js +0 -74
- package/frigg-cli/validate-command/domain/value-objects/validation-error.js +0 -68
- package/frigg-cli/validate-command/infrastructure/validators/api-module-validator.js +0 -181
- package/frigg-cli/validate-command/infrastructure/validators/app-definition-validator.js +0 -128
- package/frigg-cli/validate-command/infrastructure/validators/integration-class-validator.js +0 -113
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { motion, AnimatePresence } from 'framer-motion'
|
|
3
|
+
import { Search, Filter, Package, Code, GitBranch, ExternalLink, Download, Eye } from 'lucide-react'
|
|
4
|
+
import { RefreshCw } from 'lucide-react'
|
|
5
|
+
import { Card } from './ui/card'
|
|
6
|
+
import { Button } from './ui/button'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Visual Integration Explorer using @friggframework/ui-react components
|
|
10
|
+
* Shows available integrations, installed integrations, and code analysis
|
|
11
|
+
*/
|
|
12
|
+
export default function IntegrationExplorer({ mode = 'browse' }) {
|
|
13
|
+
const [integrations, setIntegrations] = useState([])
|
|
14
|
+
const [loading, setLoading] = useState(true)
|
|
15
|
+
const [searchTerm, setSearchTerm] = useState('')
|
|
16
|
+
const [selectedCategory, setSelectedCategory] = useState('all')
|
|
17
|
+
const [viewMode, setViewMode] = useState('grid') // 'grid', 'list', 'code'
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
fetchIntegrations()
|
|
21
|
+
}, [])
|
|
22
|
+
|
|
23
|
+
const fetchIntegrations = async () => {
|
|
24
|
+
try {
|
|
25
|
+
setLoading(true)
|
|
26
|
+
const response = await fetch('/api/integrations')
|
|
27
|
+
const data = await response.json()
|
|
28
|
+
|
|
29
|
+
// Combine installed integrations and available API modules
|
|
30
|
+
const allIntegrations = [
|
|
31
|
+
...data.integrations.map(int => ({ ...int, source: 'installed' })),
|
|
32
|
+
...data.availableApiModules.map(mod => ({ ...mod, source: 'available' }))
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
setIntegrations(allIntegrations)
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error('Failed to fetch integrations:', error)
|
|
38
|
+
} finally {
|
|
39
|
+
setLoading(false)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const filteredIntegrations = integrations.filter(integration => {
|
|
44
|
+
const matchesSearch = integration.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
45
|
+
integration.displayName?.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
46
|
+
integration.description?.toLowerCase().includes(searchTerm.toLowerCase())
|
|
47
|
+
|
|
48
|
+
const matchesCategory = selectedCategory === 'all' ||
|
|
49
|
+
integration.category?.toLowerCase() === selectedCategory.toLowerCase()
|
|
50
|
+
|
|
51
|
+
return matchesSearch && matchesCategory
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const categories = ['all', ...new Set(integrations.map(i => i.category).filter(Boolean))]
|
|
55
|
+
|
|
56
|
+
const handleInstall = async (integration) => {
|
|
57
|
+
try {
|
|
58
|
+
const response = await fetch('/api/integrations/install', {
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: { 'Content-Type': 'application/json' },
|
|
61
|
+
body: JSON.stringify({ packageName: integration.name })
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
if (response.ok) {
|
|
65
|
+
await fetchIntegrations() // Refresh the list
|
|
66
|
+
}
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error('Failed to install integration:', error)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const handleViewCode = (integration) => {
|
|
73
|
+
// Open code view for this integration
|
|
74
|
+
setViewMode('code')
|
|
75
|
+
// In a real implementation, you'd fetch and display the integration's source code
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (loading) {
|
|
79
|
+
return (
|
|
80
|
+
<div className="flex items-center justify-center py-12">
|
|
81
|
+
<RefreshCw className="w-8 h-8 animate-spin text-primary" />
|
|
82
|
+
<span className="ml-3">Loading integrations...</span>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className="space-y-6">
|
|
89
|
+
{/* Header with Search and Filters */}
|
|
90
|
+
<div className="flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between">
|
|
91
|
+
<div className="flex items-center gap-4">
|
|
92
|
+
<h3 className="text-xl font-semibold">Integration Explorer</h3>
|
|
93
|
+
<div className="flex gap-2">
|
|
94
|
+
<Button
|
|
95
|
+
variant={viewMode === 'grid' ? 'default' : 'outline'}
|
|
96
|
+
size="sm"
|
|
97
|
+
onClick={() => setViewMode('grid')}
|
|
98
|
+
>
|
|
99
|
+
Grid
|
|
100
|
+
</Button>
|
|
101
|
+
<Button
|
|
102
|
+
variant={viewMode === 'list' ? 'default' : 'outline'}
|
|
103
|
+
size="sm"
|
|
104
|
+
onClick={() => setViewMode('list')}
|
|
105
|
+
>
|
|
106
|
+
List
|
|
107
|
+
</Button>
|
|
108
|
+
<Button
|
|
109
|
+
variant={viewMode === 'code' ? 'default' : 'outline'}
|
|
110
|
+
size="sm"
|
|
111
|
+
onClick={() => setViewMode('code')}
|
|
112
|
+
>
|
|
113
|
+
Code
|
|
114
|
+
</Button>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div className="flex gap-3">
|
|
119
|
+
{/* Search */}
|
|
120
|
+
<div className="relative">
|
|
121
|
+
<Search className="w-4 h-4 absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground" />
|
|
122
|
+
<input
|
|
123
|
+
type="text"
|
|
124
|
+
placeholder="Search integrations..."
|
|
125
|
+
value={searchTerm}
|
|
126
|
+
onChange={(e) => setSearchTerm(e.target.value)}
|
|
127
|
+
className="pl-10 pr-4 py-2 border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
128
|
+
/>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
{/* Category Filter */}
|
|
132
|
+
<select
|
|
133
|
+
value={selectedCategory}
|
|
134
|
+
onChange={(e) => setSelectedCategory(e.target.value)}
|
|
135
|
+
className="px-3 py-2 border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
136
|
+
>
|
|
137
|
+
{categories.map(category => (
|
|
138
|
+
<option key={category} value={category}>
|
|
139
|
+
{category === 'all' ? 'All Categories' : category}
|
|
140
|
+
</option>
|
|
141
|
+
))}
|
|
142
|
+
</select>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
{/* Results Summary */}
|
|
147
|
+
<div className="text-sm text-muted-foreground">
|
|
148
|
+
Found {filteredIntegrations.length} integrations
|
|
149
|
+
{searchTerm && ` matching "${searchTerm}"`}
|
|
150
|
+
{selectedCategory !== 'all' && ` in ${selectedCategory}`}
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
{/* Integration Views */}
|
|
154
|
+
<AnimatePresence mode="wait">
|
|
155
|
+
{viewMode === 'grid' && (
|
|
156
|
+
<motion.div
|
|
157
|
+
key="grid"
|
|
158
|
+
initial={{ opacity: 0, y: 20 }}
|
|
159
|
+
animate={{ opacity: 1, y: 0 }}
|
|
160
|
+
exit={{ opacity: 0, y: -20 }}
|
|
161
|
+
className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
|
|
162
|
+
>
|
|
163
|
+
{filteredIntegrations.map((integration, index) => (
|
|
164
|
+
<motion.div
|
|
165
|
+
key={integration.name}
|
|
166
|
+
initial={{ opacity: 0, y: 20 }}
|
|
167
|
+
animate={{ opacity: 1, y: 0 }}
|
|
168
|
+
transition={{ delay: index * 0.05 }}
|
|
169
|
+
>
|
|
170
|
+
<Card className="p-4 hover:shadow-lg transition-all">
|
|
171
|
+
<div className="flex items-center justify-between">
|
|
172
|
+
<div className="flex items-center gap-3">
|
|
173
|
+
<div className={`w-3 h-3 rounded-full ${
|
|
174
|
+
integration.source === 'installed' ? 'bg-green-500' : 'bg-gray-400'
|
|
175
|
+
}`} />
|
|
176
|
+
<div>
|
|
177
|
+
<h4 className="font-semibold">{integration.displayName || integration.name}</h4>
|
|
178
|
+
<p className="text-sm text-muted-foreground">{integration.description}</p>
|
|
179
|
+
<div className="flex items-center gap-2 mt-1">
|
|
180
|
+
<span className="text-xs bg-primary/10 text-primary px-2 py-1 rounded">
|
|
181
|
+
{integration.category}
|
|
182
|
+
</span>
|
|
183
|
+
<span className="text-xs text-muted-foreground">
|
|
184
|
+
{integration.source === 'installed' ? 'Installed' : 'Available'}
|
|
185
|
+
</span>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div className="flex gap-2">
|
|
191
|
+
<Button size="sm" variant="outline" onClick={() => handleViewCode(integration)}>
|
|
192
|
+
<Code className="w-4 h-4" />
|
|
193
|
+
</Button>
|
|
194
|
+
{integration.source === 'available' && (
|
|
195
|
+
<Button size="sm" onClick={() => handleInstall(integration)}>
|
|
196
|
+
<Download className="w-4 h-4" />
|
|
197
|
+
</Button>
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</Card>
|
|
202
|
+
</motion.div>
|
|
203
|
+
))}
|
|
204
|
+
</motion.div>
|
|
205
|
+
)}
|
|
206
|
+
|
|
207
|
+
{viewMode === 'list' && (
|
|
208
|
+
<motion.div
|
|
209
|
+
key="list"
|
|
210
|
+
initial={{ opacity: 0, y: 20 }}
|
|
211
|
+
animate={{ opacity: 1, y: 0 }}
|
|
212
|
+
exit={{ opacity: 0, y: -20 }}
|
|
213
|
+
className="space-y-3"
|
|
214
|
+
>
|
|
215
|
+
{filteredIntegrations.map((integration, index) => (
|
|
216
|
+
<motion.div
|
|
217
|
+
key={integration.name}
|
|
218
|
+
initial={{ opacity: 0, x: -20 }}
|
|
219
|
+
animate={{ opacity: 1, x: 0 }}
|
|
220
|
+
transition={{ delay: index * 0.03 }}
|
|
221
|
+
>
|
|
222
|
+
<Card className="p-4 hover:shadow-md transition-all">
|
|
223
|
+
<div className="flex items-center justify-between">
|
|
224
|
+
<div className="flex items-center gap-4">
|
|
225
|
+
<div className={`w-3 h-3 rounded-full ${
|
|
226
|
+
integration.source === 'installed' ? 'bg-green-500' : 'bg-gray-400'
|
|
227
|
+
}`} />
|
|
228
|
+
<div>
|
|
229
|
+
<h4 className="font-semibold">{integration.displayName || integration.name}</h4>
|
|
230
|
+
<p className="text-sm text-muted-foreground">{integration.description}</p>
|
|
231
|
+
<div className="flex items-center gap-2 mt-1">
|
|
232
|
+
<span className="text-xs bg-primary/10 text-primary px-2 py-1 rounded">
|
|
233
|
+
{integration.category}
|
|
234
|
+
</span>
|
|
235
|
+
<span className="text-xs text-muted-foreground">
|
|
236
|
+
{integration.source === 'installed' ? 'Installed' : 'Available'}
|
|
237
|
+
</span>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<div className="flex gap-2">
|
|
243
|
+
<Button size="sm" variant="outline" onClick={() => handleViewCode(integration)}>
|
|
244
|
+
<Eye className="w-4 h-4" />
|
|
245
|
+
View
|
|
246
|
+
</Button>
|
|
247
|
+
{integration.source === 'available' && (
|
|
248
|
+
<Button size="sm" onClick={() => handleInstall(integration)}>
|
|
249
|
+
<Download className="w-4 h-4" />
|
|
250
|
+
Install
|
|
251
|
+
</Button>
|
|
252
|
+
)}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</Card>
|
|
256
|
+
</motion.div>
|
|
257
|
+
))}
|
|
258
|
+
</motion.div>
|
|
259
|
+
)}
|
|
260
|
+
|
|
261
|
+
{viewMode === 'code' && (
|
|
262
|
+
<motion.div
|
|
263
|
+
key="code"
|
|
264
|
+
initial={{ opacity: 0, y: 20 }}
|
|
265
|
+
animate={{ opacity: 1, y: 0 }}
|
|
266
|
+
exit={{ opacity: 0, y: -20 }}
|
|
267
|
+
>
|
|
268
|
+
<CodeAnalysisView integrations={filteredIntegrations} />
|
|
269
|
+
</motion.div>
|
|
270
|
+
)}
|
|
271
|
+
</AnimatePresence>
|
|
272
|
+
|
|
273
|
+
{filteredIntegrations.length === 0 && (
|
|
274
|
+
<div className="text-center py-12">
|
|
275
|
+
<Package className="w-16 h-16 mx-auto text-muted-foreground mb-4" />
|
|
276
|
+
<h3 className="text-lg font-semibold mb-2">No integrations found</h3>
|
|
277
|
+
<p className="text-muted-foreground">
|
|
278
|
+
Try adjusting your search terms or category filter
|
|
279
|
+
</p>
|
|
280
|
+
</div>
|
|
281
|
+
)}
|
|
282
|
+
</div>
|
|
283
|
+
)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Code Analysis View showing integration structure and relationships
|
|
288
|
+
*/
|
|
289
|
+
function CodeAnalysisView({ integrations }) {
|
|
290
|
+
const installedIntegrations = integrations.filter(i => i.source === 'installed')
|
|
291
|
+
|
|
292
|
+
return (
|
|
293
|
+
<div className="space-y-6">
|
|
294
|
+
<div className="flex items-center gap-2">
|
|
295
|
+
<GitBranch className="w-5 h-5" />
|
|
296
|
+
<h4 className="text-lg font-semibold">Integration Code Structure</h4>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
{installedIntegrations.length === 0 ? (
|
|
300
|
+
<Card className="p-8 text-center">
|
|
301
|
+
<Code className="w-12 h-12 mx-auto text-muted-foreground mb-4" />
|
|
302
|
+
<h3 className="font-semibold mb-2">No Installed Integrations</h3>
|
|
303
|
+
<p className="text-muted-foreground">Install some integrations to analyze their code structure</p>
|
|
304
|
+
</Card>
|
|
305
|
+
) : (
|
|
306
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
|
307
|
+
{installedIntegrations.map(integration => (
|
|
308
|
+
<Card key={integration.name} className="p-6">
|
|
309
|
+
<div className="flex items-center gap-3 mb-4">
|
|
310
|
+
<div className="w-8 h-8 bg-primary/10 rounded-lg flex items-center justify-center">
|
|
311
|
+
<Code className="w-4 h-4 text-primary" />
|
|
312
|
+
</div>
|
|
313
|
+
<div>
|
|
314
|
+
<h4 className="font-semibold">{integration.displayName}</h4>
|
|
315
|
+
<p className="text-sm text-muted-foreground">{integration.className}</p>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
<div className="space-y-3">
|
|
320
|
+
{integration.constructor && (
|
|
321
|
+
<div>
|
|
322
|
+
<h5 className="font-medium text-sm mb-2">Constructor Properties</h5>
|
|
323
|
+
<div className="space-y-1 text-sm">
|
|
324
|
+
<div className="flex justify-between">
|
|
325
|
+
<span>Has Config:</span>
|
|
326
|
+
<span className={integration.constructor.hasConfig ? 'text-green-600' : 'text-gray-500'}>
|
|
327
|
+
{integration.constructor.hasConfig ? 'Yes' : 'No'}
|
|
328
|
+
</span>
|
|
329
|
+
</div>
|
|
330
|
+
<div className="flex justify-between">
|
|
331
|
+
<span>Has Options:</span>
|
|
332
|
+
<span className={integration.constructor.hasOptions ? 'text-green-600' : 'text-gray-500'}>
|
|
333
|
+
{integration.constructor.hasOptions ? 'Yes' : 'No'}
|
|
334
|
+
</span>
|
|
335
|
+
</div>
|
|
336
|
+
<div className="flex justify-between">
|
|
337
|
+
<span>Has Modules:</span>
|
|
338
|
+
<span className={integration.constructor.hasModules ? 'text-green-600' : 'text-gray-500'}>
|
|
339
|
+
{integration.constructor.hasModules ? 'Yes' : 'No'}
|
|
340
|
+
</span>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
)}
|
|
345
|
+
|
|
346
|
+
{integration.apiModules && integration.apiModules.length > 0 && (
|
|
347
|
+
<div>
|
|
348
|
+
<h5 className="font-medium text-sm mb-2">API Modules</h5>
|
|
349
|
+
<div className="space-y-1">
|
|
350
|
+
{integration.apiModules.map(module => (
|
|
351
|
+
<div key={module.name} className="text-xs bg-gray-50 p-2 rounded">
|
|
352
|
+
<div className="font-medium">{module.name}</div>
|
|
353
|
+
<div className="text-muted-foreground">{module.description}</div>
|
|
354
|
+
</div>
|
|
355
|
+
))}
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
)}
|
|
359
|
+
|
|
360
|
+
{integration.events && integration.events.length > 0 && (
|
|
361
|
+
<div>
|
|
362
|
+
<h5 className="font-medium text-sm mb-2">Events</h5>
|
|
363
|
+
<div className="flex flex-wrap gap-1">
|
|
364
|
+
{integration.events.map(event => (
|
|
365
|
+
<span key={event} className="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded">
|
|
366
|
+
{event}
|
|
367
|
+
</span>
|
|
368
|
+
))}
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
)}
|
|
372
|
+
</div>
|
|
373
|
+
</Card>
|
|
374
|
+
))}
|
|
375
|
+
</div>
|
|
376
|
+
)}
|
|
377
|
+
</div>
|
|
378
|
+
)
|
|
379
|
+
}
|