@friggframework/devtools 2.0.0--canary.400.bed3308.0 → 2.0.0--canary.404.e9d4980.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.
Files changed (182) hide show
  1. package/frigg-cli/build-command/index.js +3 -18
  2. package/frigg-cli/deploy-command/index.js +3 -19
  3. package/frigg-cli/index.js +1 -73
  4. package/frigg-cli/install-command/index.js +2 -15
  5. package/frigg-cli/start-command/index.js +2 -17
  6. package/infrastructure/create-frigg-infrastructure.js +2 -2
  7. package/infrastructure/serverless-template.js +79 -529
  8. package/package.json +5 -9
  9. package/frigg-cli/.eslintrc.js +0 -141
  10. package/frigg-cli/__tests__/jest.config.js +0 -102
  11. package/frigg-cli/__tests__/unit/commands/build.test.js +0 -483
  12. package/frigg-cli/__tests__/unit/commands/install.test.js +0 -418
  13. package/frigg-cli/__tests__/unit/commands/ui.test.js +0 -592
  14. package/frigg-cli/__tests__/utils/command-tester.js +0 -170
  15. package/frigg-cli/__tests__/utils/mock-factory.js +0 -270
  16. package/frigg-cli/__tests__/utils/test-fixtures.js +0 -463
  17. package/frigg-cli/__tests__/utils/test-setup.js +0 -286
  18. package/frigg-cli/generate-command/__tests__/generate-command.test.js +0 -312
  19. package/frigg-cli/generate-command/azure-generator.js +0 -43
  20. package/frigg-cli/generate-command/gcp-generator.js +0 -47
  21. package/frigg-cli/generate-command/index.js +0 -350
  22. package/frigg-cli/generate-command/terraform-generator.js +0 -555
  23. package/frigg-cli/generate-iam-command.js +0 -115
  24. package/frigg-cli/package.json +0 -75
  25. package/frigg-cli/ui-command/index.js +0 -167
  26. package/frigg-cli/utils/app-resolver.js +0 -319
  27. package/frigg-cli/utils/backend-path.js +0 -38
  28. package/frigg-cli/utils/process-manager.js +0 -199
  29. package/frigg-cli/utils/repo-detection.js +0 -405
  30. package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +0 -245
  31. package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +0 -620
  32. package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +0 -268
  33. package/infrastructure/GENERATE-IAM-DOCS.md +0 -253
  34. package/infrastructure/IAM-POLICY-TEMPLATES.md +0 -176
  35. package/infrastructure/README-TESTING.md +0 -332
  36. package/infrastructure/README.md +0 -421
  37. package/infrastructure/WEBSOCKET-CONFIGURATION.md +0 -105
  38. package/infrastructure/__tests__/fixtures/mock-aws-resources.js +0 -391
  39. package/infrastructure/__tests__/helpers/test-utils.js +0 -277
  40. package/infrastructure/aws-discovery.js +0 -568
  41. package/infrastructure/aws-discovery.test.js +0 -373
  42. package/infrastructure/build-time-discovery.js +0 -206
  43. package/infrastructure/build-time-discovery.test.js +0 -375
  44. package/infrastructure/frigg-deployment-iam-stack.yaml +0 -393
  45. package/infrastructure/iam-generator.js +0 -810
  46. package/infrastructure/iam-generator.test.js +0 -169
  47. package/infrastructure/iam-policy-basic.json +0 -236
  48. package/infrastructure/iam-policy-full.json +0 -305
  49. package/infrastructure/integration.test.js +0 -383
  50. package/infrastructure/run-discovery.js +0 -110
  51. package/infrastructure/serverless-template.test.js +0 -553
  52. package/management-ui/.eslintrc.js +0 -22
  53. package/management-ui/README.md +0 -203
  54. package/management-ui/components.json +0 -21
  55. package/management-ui/index.html +0 -13
  56. package/management-ui/merge-conflict-cleaner.py +0 -371
  57. package/management-ui/package-lock.json +0 -10997
  58. package/management-ui/package.json +0 -76
  59. package/management-ui/postcss.config.js +0 -6
  60. package/management-ui/server/api/backend.js +0 -256
  61. package/management-ui/server/api/cli.js +0 -315
  62. package/management-ui/server/api/codegen.js +0 -663
  63. package/management-ui/server/api/connections.js +0 -857
  64. package/management-ui/server/api/discovery.js +0 -185
  65. package/management-ui/server/api/environment/index.js +0 -1
  66. package/management-ui/server/api/environment/router.js +0 -378
  67. package/management-ui/server/api/environment.js +0 -328
  68. package/management-ui/server/api/integrations.js +0 -479
  69. package/management-ui/server/api/logs.js +0 -248
  70. package/management-ui/server/api/monitoring.js +0 -282
  71. package/management-ui/server/api/open-ide.js +0 -31
  72. package/management-ui/server/api/project.js +0 -553
  73. package/management-ui/server/api/users/sessions.js +0 -371
  74. package/management-ui/server/api/users/simulation.js +0 -254
  75. package/management-ui/server/api/users.js +0 -362
  76. package/management-ui/server/api-contract.md +0 -275
  77. package/management-ui/server/index.js +0 -428
  78. package/management-ui/server/middleware/errorHandler.js +0 -70
  79. package/management-ui/server/middleware/security.js +0 -32
  80. package/management-ui/server/processManager.js +0 -296
  81. package/management-ui/server/server.js +0 -188
  82. package/management-ui/server/services/aws-monitor.js +0 -413
  83. package/management-ui/server/services/npm-registry.js +0 -347
  84. package/management-ui/server/services/template-engine.js +0 -538
  85. package/management-ui/server/utils/cliIntegration.js +0 -220
  86. package/management-ui/server/utils/environment/auditLogger.js +0 -471
  87. package/management-ui/server/utils/environment/awsParameterStore.js +0 -264
  88. package/management-ui/server/utils/environment/encryption.js +0 -278
  89. package/management-ui/server/utils/environment/envFileManager.js +0 -286
  90. package/management-ui/server/utils/import-commonjs.js +0 -28
  91. package/management-ui/server/utils/response.js +0 -83
  92. package/management-ui/server/websocket/handler.js +0 -325
  93. package/management-ui/src/App.jsx +0 -51
  94. package/management-ui/src/assets/FriggLogo.svg +0 -1
  95. package/management-ui/src/components/AppRouter.jsx +0 -65
  96. package/management-ui/src/components/Button.jsx +0 -2
  97. package/management-ui/src/components/Card.jsx +0 -9
  98. package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
  99. package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
  100. package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
  101. package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
  102. package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
  103. package/management-ui/src/components/ErrorBoundary.jsx +0 -73
  104. package/management-ui/src/components/IntegrationCard.jsx +0 -199
  105. package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -490
  106. package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
  107. package/management-ui/src/components/IntegrationStatus.jsx +0 -235
  108. package/management-ui/src/components/Layout.jsx +0 -250
  109. package/management-ui/src/components/LoadingSpinner.jsx +0 -45
  110. package/management-ui/src/components/RepositoryPicker.jsx +0 -248
  111. package/management-ui/src/components/SessionMonitor.jsx +0 -255
  112. package/management-ui/src/components/StatusBadge.jsx +0 -70
  113. package/management-ui/src/components/UserContextSwitcher.jsx +0 -154
  114. package/management-ui/src/components/UserSimulation.jsx +0 -299
  115. package/management-ui/src/components/Welcome.jsx +0 -434
  116. package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
  117. package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
  118. package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
  119. package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
  120. package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
  121. package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
  122. package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
  123. package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
  124. package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
  125. package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
  126. package/management-ui/src/components/codegen/index.js +0 -10
  127. package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
  128. package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
  129. package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
  130. package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
  131. package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
  132. package/management-ui/src/components/connections/index.js +0 -5
  133. package/management-ui/src/components/index.js +0 -21
  134. package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
  135. package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
  136. package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
  137. package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
  138. package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
  139. package/management-ui/src/components/monitoring/index.js +0 -6
  140. package/management-ui/src/components/monitoring/monitoring.css +0 -218
  141. package/management-ui/src/components/theme-provider.jsx +0 -52
  142. package/management-ui/src/components/theme-toggle.jsx +0 -39
  143. package/management-ui/src/components/ui/badge.tsx +0 -36
  144. package/management-ui/src/components/ui/button.test.jsx +0 -56
  145. package/management-ui/src/components/ui/button.tsx +0 -57
  146. package/management-ui/src/components/ui/card.tsx +0 -76
  147. package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
  148. package/management-ui/src/components/ui/select.tsx +0 -157
  149. package/management-ui/src/components/ui/skeleton.jsx +0 -15
  150. package/management-ui/src/hooks/useFrigg.jsx +0 -387
  151. package/management-ui/src/hooks/useSocket.jsx +0 -58
  152. package/management-ui/src/index.css +0 -194
  153. package/management-ui/src/lib/utils.ts +0 -6
  154. package/management-ui/src/main.jsx +0 -10
  155. package/management-ui/src/pages/CodeGeneration.jsx +0 -14
  156. package/management-ui/src/pages/Connections.jsx +0 -252
  157. package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -427
  158. package/management-ui/src/pages/Dashboard.jsx +0 -311
  159. package/management-ui/src/pages/Environment.jsx +0 -314
  160. package/management-ui/src/pages/IntegrationConfigure.jsx +0 -544
  161. package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -479
  162. package/management-ui/src/pages/IntegrationTest.jsx +0 -494
  163. package/management-ui/src/pages/Integrations.jsx +0 -254
  164. package/management-ui/src/pages/Monitoring.jsx +0 -17
  165. package/management-ui/src/pages/Simulation.jsx +0 -155
  166. package/management-ui/src/pages/Users.jsx +0 -492
  167. package/management-ui/src/services/api.js +0 -41
  168. package/management-ui/src/services/apiModuleService.js +0 -193
  169. package/management-ui/src/services/websocket-handlers.js +0 -120
  170. package/management-ui/src/test/api/project.test.js +0 -273
  171. package/management-ui/src/test/components/Welcome.test.jsx +0 -378
  172. package/management-ui/src/test/mocks/server.js +0 -178
  173. package/management-ui/src/test/setup.js +0 -61
  174. package/management-ui/src/test/utils/test-utils.jsx +0 -134
  175. package/management-ui/src/utils/repository.js +0 -98
  176. package/management-ui/src/utils/repository.test.js +0 -118
  177. package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
  178. package/management-ui/tailwind.config.js +0 -63
  179. package/management-ui/tsconfig.json +0 -37
  180. package/management-ui/tsconfig.node.json +0 -10
  181. package/management-ui/vite.config.js +0 -26
  182. package/management-ui/vitest.config.js +0 -38
@@ -1,328 +0,0 @@
1
- import express from 'express'
2
- import path from 'path'
3
- import fs from 'fs-extra'
4
- import { createStandardResponse, createErrorResponse, ERROR_CODES, asyncHandler } from '../utils/response.js'
5
- import { wsHandler } from '../websocket/handler.js'
6
-
7
- const router = express.Router();
8
-
9
- // Helper to get .env file path
10
- async function getEnvFilePath() {
11
- const possiblePaths = [
12
- path.join(process.cwd(), '../../../backend/.env'),
13
- path.join(process.cwd(), '../../backend/.env'),
14
- path.join(process.cwd(), 'backend/.env'),
15
- path.join(process.cwd(), '.env')
16
- ];
17
-
18
- for (const envPath of possiblePaths) {
19
- if (await fs.pathExists(envPath)) {
20
- return envPath;
21
- }
22
- }
23
-
24
- // If no .env exists, create one in the most likely location
25
- const defaultPath = possiblePaths[0];
26
- await fs.ensureFile(defaultPath);
27
- return defaultPath;
28
- }
29
-
30
- // Parse .env file content
31
- function parseEnvFile(content) {
32
- const lines = content.split('\n');
33
- const variables = [];
34
-
35
- lines.forEach((line, index) => {
36
- const trimmedLine = line.trim();
37
-
38
- // Skip empty lines and comments
39
- if (!trimmedLine || trimmedLine.startsWith('#')) {
40
- return;
41
- }
42
-
43
- const equalIndex = trimmedLine.indexOf('=');
44
- if (equalIndex > 0) {
45
- const key = trimmedLine.substring(0, equalIndex).trim();
46
- const value = trimmedLine.substring(equalIndex + 1).trim();
47
-
48
- variables.push({
49
- key,
50
- value: value.replace(/^["']|["']$/g, ''), // Remove quotes
51
- line: index + 1
52
- });
53
- }
54
- });
55
-
56
- return variables;
57
- }
58
-
59
- // Build .env file content from variables
60
- function buildEnvContent(variables) {
61
- return variables
62
- .map(({ key, value }) => {
63
- // Add quotes if value contains spaces or special characters
64
- if (value && (value.includes(' ') || value.includes('#'))) {
65
- return `${key}="${value}"`;
66
- }
67
- return `${key}=${value}`;
68
- })
69
- .join('\n');
70
- }
71
-
72
- // Get all environment variables
73
- router.get('/', async (req, res) => {
74
- try {
75
- const envPath = await getEnvFilePath();
76
- const content = await fs.readFile(envPath, 'utf8');
77
- const variables = parseEnvFile(content);
78
-
79
- // Mask sensitive values
80
- const maskedVariables = variables.map(variable => {
81
- const isSensitive = [
82
- 'KEY', 'SECRET', 'PASSWORD', 'TOKEN', 'API', 'PRIVATE'
83
- ].some(keyword => variable.key.toUpperCase().includes(keyword));
84
-
85
- return {
86
- ...variable,
87
- value: isSensitive ? '***' : variable.value,
88
- masked: isSensitive
89
- };
90
- });
91
-
92
- res.json({
93
- variables: maskedVariables,
94
- path: envPath
95
- });
96
- } catch (error) {
97
- res.status(500).json({
98
- error: error.message,
99
- details: 'Failed to read environment variables'
100
- });
101
- }
102
- });
103
-
104
- // Get specific environment variable
105
- router.get('/:key', async (req, res) => {
106
- const { key } = req.params;
107
-
108
- try {
109
- const envPath = await getEnvFilePath();
110
- const content = await fs.readFile(envPath, 'utf8');
111
- const variables = parseEnvFile(content);
112
-
113
- const variable = variables.find(v => v.key === key);
114
-
115
- if (!variable) {
116
- return res.status(404).json({
117
- error: `Environment variable ${key} not found`
118
- });
119
- }
120
-
121
- // Check if it's sensitive
122
- const isSensitive = [
123
- 'KEY', 'SECRET', 'PASSWORD', 'TOKEN', 'API', 'PRIVATE'
124
- ].some(keyword => key.toUpperCase().includes(keyword));
125
-
126
- res.json({
127
- key: variable.key,
128
- value: isSensitive ? '***' : variable.value,
129
- masked: isSensitive
130
- });
131
- } catch (error) {
132
- res.status(500).json({
133
- error: error.message,
134
- details: 'Failed to read environment variable'
135
- });
136
- }
137
- });
138
-
139
- // Set environment variable
140
- router.post('/', async (req, res) => {
141
- const { key, value } = req.body;
142
-
143
- if (!key) {
144
- return res.status(400).json({
145
- error: 'Key is required'
146
- });
147
- }
148
-
149
- try {
150
- const envPath = await getEnvFilePath();
151
- const content = await fs.readFile(envPath, 'utf8');
152
- const variables = parseEnvFile(content);
153
-
154
- // Check if variable exists
155
- const existingIndex = variables.findIndex(v => v.key === key);
156
-
157
- if (existingIndex >= 0) {
158
- variables[existingIndex].value = value;
159
- } else {
160
- variables.push({ key, value });
161
- }
162
-
163
- // Write back to file
164
- const newContent = buildEnvContent(variables);
165
- await fs.writeFile(envPath, newContent);
166
-
167
- // Broadcast update
168
- wsHandler.broadcast('env-update', {
169
- action: existingIndex >= 0 ? 'updated' : 'created',
170
- key,
171
- timestamp: new Date().toISOString()
172
- });
173
-
174
- res.json({
175
- status: 'success',
176
- message: `Environment variable ${key} ${existingIndex >= 0 ? 'updated' : 'created'}`,
177
- key,
178
- value: value.includes('SECRET') || value.includes('KEY') ? '***' : value
179
- });
180
- } catch (error) {
181
- res.status(500).json({
182
- error: error.message,
183
- details: 'Failed to set environment variable'
184
- });
185
- }
186
- });
187
-
188
- // Update multiple environment variables
189
- router.put('/batch', async (req, res) => {
190
- const { variables } = req.body;
191
-
192
- if (!Array.isArray(variables)) {
193
- return res.status(400).json({
194
- error: 'Variables must be an array'
195
- });
196
- }
197
-
198
- try {
199
- const envPath = await getEnvFilePath();
200
- const content = await fs.readFile(envPath, 'utf8');
201
- const existingVariables = parseEnvFile(content);
202
-
203
- // Update or add variables
204
- variables.forEach(({ key, value }) => {
205
- const existingIndex = existingVariables.findIndex(v => v.key === key);
206
-
207
- if (existingIndex >= 0) {
208
- existingVariables[existingIndex].value = value;
209
- } else {
210
- existingVariables.push({ key, value });
211
- }
212
- });
213
-
214
- // Write back to file
215
- const newContent = buildEnvContent(existingVariables);
216
- await fs.writeFile(envPath, newContent);
217
-
218
- // Broadcast update
219
- wsHandler.broadcast('env-update', {
220
- action: 'batch-update',
221
- count: variables.length,
222
- timestamp: new Date().toISOString()
223
- });
224
-
225
- res.json({
226
- status: 'success',
227
- message: `Updated ${variables.length} environment variables`,
228
- updated: variables.length
229
- });
230
- } catch (error) {
231
- res.status(500).json({
232
- error: error.message,
233
- details: 'Failed to update environment variables'
234
- });
235
- }
236
- });
237
-
238
- // Delete environment variable
239
- router.delete('/:key', async (req, res) => {
240
- const { key } = req.params;
241
-
242
- try {
243
- const envPath = await getEnvFilePath();
244
- const content = await fs.readFile(envPath, 'utf8');
245
- const variables = parseEnvFile(content);
246
-
247
- const filteredVariables = variables.filter(v => v.key !== key);
248
-
249
- if (filteredVariables.length === variables.length) {
250
- return res.status(404).json({
251
- error: `Environment variable ${key} not found`
252
- });
253
- }
254
-
255
- // Write back to file
256
- const newContent = buildEnvContent(filteredVariables);
257
- await fs.writeFile(envPath, newContent);
258
-
259
- // Broadcast update
260
- wsHandler.broadcast('env-update', {
261
- action: 'deleted',
262
- key,
263
- timestamp: new Date().toISOString()
264
- });
265
-
266
- res.json({
267
- status: 'success',
268
- message: `Environment variable ${key} deleted`
269
- });
270
- } catch (error) {
271
- res.status(500).json({
272
- error: error.message,
273
- details: 'Failed to delete environment variable'
274
- });
275
- }
276
- });
277
-
278
- // Validate environment variables
279
- router.post('/validate', async (req, res) => {
280
- try {
281
- const envPath = await getEnvFilePath();
282
- const content = await fs.readFile(envPath, 'utf8');
283
- const variables = parseEnvFile(content);
284
-
285
- const issues = [];
286
-
287
- // Check for required variables
288
- const requiredVars = [
289
- 'DATABASE_URL',
290
- 'JWT_SECRET',
291
- 'NODE_ENV'
292
- ];
293
-
294
- requiredVars.forEach(reqVar => {
295
- if (!variables.find(v => v.key === reqVar)) {
296
- issues.push({
297
- type: 'missing',
298
- key: reqVar,
299
- message: `Required variable ${reqVar} is missing`
300
- });
301
- }
302
- });
303
-
304
- // Check for empty values
305
- variables.forEach(variable => {
306
- if (!variable.value || variable.value.trim() === '') {
307
- issues.push({
308
- type: 'empty',
309
- key: variable.key,
310
- message: `Variable ${variable.key} has an empty value`
311
- });
312
- }
313
- });
314
-
315
- res.json({
316
- valid: issues.length === 0,
317
- issues,
318
- totalVariables: variables.length
319
- });
320
- } catch (error) {
321
- res.status(500).json({
322
- error: error.message,
323
- details: 'Failed to validate environment variables'
324
- });
325
- }
326
- });
327
-
328
- export default router