@friggframework/devtools 2.0.0--canary.400.bed3308.0 → 2.0.0--canary.400.545e7a8.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 (167) hide show
  1. package/frigg-cli/build-command/index.js +2 -15
  2. package/frigg-cli/deploy-command/index.js +2 -15
  3. package/frigg-cli/index.js +4 -66
  4. package/frigg-cli/install-command/index.js +2 -15
  5. package/frigg-cli/start-command/index.js +2 -17
  6. package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +19 -43
  7. package/infrastructure/IAM-POLICY-TEMPLATES.md +1 -1
  8. package/infrastructure/frigg-deployment-iam-stack.yaml +2 -16
  9. package/infrastructure/iam-generator.js +6 -129
  10. package/infrastructure/iam-policy-basic.json +5 -29
  11. package/infrastructure/iam-policy-full.json +5 -28
  12. package/infrastructure/serverless-template.js +3 -190
  13. package/infrastructure/serverless-template.test.js +0 -12
  14. package/management-ui/dist/assets/index-CbM64Oba.js +1221 -0
  15. package/management-ui/dist/assets/index-CkvseXTC.css +1 -0
  16. package/management-ui/{index.html → dist/index.html} +2 -1
  17. package/package.json +5 -5
  18. package/frigg-cli/.eslintrc.js +0 -141
  19. package/frigg-cli/__tests__/jest.config.js +0 -102
  20. package/frigg-cli/__tests__/unit/commands/build.test.js +0 -483
  21. package/frigg-cli/__tests__/unit/commands/install.test.js +0 -418
  22. package/frigg-cli/__tests__/unit/commands/ui.test.js +0 -592
  23. package/frigg-cli/__tests__/utils/command-tester.js +0 -170
  24. package/frigg-cli/__tests__/utils/mock-factory.js +0 -270
  25. package/frigg-cli/__tests__/utils/test-fixtures.js +0 -463
  26. package/frigg-cli/__tests__/utils/test-setup.js +0 -286
  27. package/frigg-cli/generate-command/__tests__/generate-command.test.js +0 -312
  28. package/frigg-cli/generate-command/azure-generator.js +0 -43
  29. package/frigg-cli/generate-command/gcp-generator.js +0 -47
  30. package/frigg-cli/generate-command/index.js +0 -350
  31. package/frigg-cli/generate-command/terraform-generator.js +0 -555
  32. package/frigg-cli/package.json +0 -75
  33. package/frigg-cli/ui-command/index.js +0 -167
  34. package/frigg-cli/utils/app-resolver.js +0 -319
  35. package/frigg-cli/utils/backend-path.js +0 -38
  36. package/frigg-cli/utils/process-manager.js +0 -199
  37. package/frigg-cli/utils/repo-detection.js +0 -405
  38. package/management-ui/.eslintrc.js +0 -22
  39. package/management-ui/README.md +0 -203
  40. package/management-ui/components.json +0 -21
  41. package/management-ui/merge-conflict-cleaner.py +0 -371
  42. package/management-ui/package-lock.json +0 -10997
  43. package/management-ui/package.json +0 -76
  44. package/management-ui/postcss.config.js +0 -6
  45. package/management-ui/server/api/backend.js +0 -256
  46. package/management-ui/server/api/cli.js +0 -315
  47. package/management-ui/server/api/codegen.js +0 -663
  48. package/management-ui/server/api/connections.js +0 -857
  49. package/management-ui/server/api/discovery.js +0 -185
  50. package/management-ui/server/api/environment/index.js +0 -1
  51. package/management-ui/server/api/environment/router.js +0 -378
  52. package/management-ui/server/api/environment.js +0 -328
  53. package/management-ui/server/api/integrations.js +0 -479
  54. package/management-ui/server/api/logs.js +0 -248
  55. package/management-ui/server/api/monitoring.js +0 -282
  56. package/management-ui/server/api/open-ide.js +0 -31
  57. package/management-ui/server/api/project.js +0 -553
  58. package/management-ui/server/api/users/sessions.js +0 -371
  59. package/management-ui/server/api/users/simulation.js +0 -254
  60. package/management-ui/server/api/users.js +0 -362
  61. package/management-ui/server/api-contract.md +0 -275
  62. package/management-ui/server/index.js +0 -428
  63. package/management-ui/server/middleware/errorHandler.js +0 -70
  64. package/management-ui/server/middleware/security.js +0 -32
  65. package/management-ui/server/processManager.js +0 -296
  66. package/management-ui/server/server.js +0 -188
  67. package/management-ui/server/services/aws-monitor.js +0 -413
  68. package/management-ui/server/services/npm-registry.js +0 -347
  69. package/management-ui/server/services/template-engine.js +0 -538
  70. package/management-ui/server/utils/cliIntegration.js +0 -220
  71. package/management-ui/server/utils/environment/auditLogger.js +0 -471
  72. package/management-ui/server/utils/environment/awsParameterStore.js +0 -264
  73. package/management-ui/server/utils/environment/encryption.js +0 -278
  74. package/management-ui/server/utils/environment/envFileManager.js +0 -286
  75. package/management-ui/server/utils/import-commonjs.js +0 -28
  76. package/management-ui/server/utils/response.js +0 -83
  77. package/management-ui/server/websocket/handler.js +0 -325
  78. package/management-ui/src/App.jsx +0 -51
  79. package/management-ui/src/components/AppRouter.jsx +0 -65
  80. package/management-ui/src/components/Button.jsx +0 -2
  81. package/management-ui/src/components/Card.jsx +0 -9
  82. package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
  83. package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
  84. package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
  85. package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
  86. package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
  87. package/management-ui/src/components/ErrorBoundary.jsx +0 -73
  88. package/management-ui/src/components/IntegrationCard.jsx +0 -199
  89. package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -490
  90. package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
  91. package/management-ui/src/components/IntegrationStatus.jsx +0 -235
  92. package/management-ui/src/components/Layout.jsx +0 -250
  93. package/management-ui/src/components/LoadingSpinner.jsx +0 -45
  94. package/management-ui/src/components/RepositoryPicker.jsx +0 -248
  95. package/management-ui/src/components/SessionMonitor.jsx +0 -255
  96. package/management-ui/src/components/StatusBadge.jsx +0 -70
  97. package/management-ui/src/components/UserContextSwitcher.jsx +0 -154
  98. package/management-ui/src/components/UserSimulation.jsx +0 -299
  99. package/management-ui/src/components/Welcome.jsx +0 -434
  100. package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
  101. package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
  102. package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
  103. package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
  104. package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
  105. package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
  106. package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
  107. package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
  108. package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
  109. package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
  110. package/management-ui/src/components/codegen/index.js +0 -10
  111. package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
  112. package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
  113. package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
  114. package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
  115. package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
  116. package/management-ui/src/components/connections/index.js +0 -5
  117. package/management-ui/src/components/index.js +0 -21
  118. package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
  119. package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
  120. package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
  121. package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
  122. package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
  123. package/management-ui/src/components/monitoring/index.js +0 -6
  124. package/management-ui/src/components/monitoring/monitoring.css +0 -218
  125. package/management-ui/src/components/theme-provider.jsx +0 -52
  126. package/management-ui/src/components/theme-toggle.jsx +0 -39
  127. package/management-ui/src/components/ui/badge.tsx +0 -36
  128. package/management-ui/src/components/ui/button.test.jsx +0 -56
  129. package/management-ui/src/components/ui/button.tsx +0 -57
  130. package/management-ui/src/components/ui/card.tsx +0 -76
  131. package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
  132. package/management-ui/src/components/ui/select.tsx +0 -157
  133. package/management-ui/src/components/ui/skeleton.jsx +0 -15
  134. package/management-ui/src/hooks/useFrigg.jsx +0 -387
  135. package/management-ui/src/hooks/useSocket.jsx +0 -58
  136. package/management-ui/src/index.css +0 -194
  137. package/management-ui/src/lib/utils.ts +0 -6
  138. package/management-ui/src/main.jsx +0 -10
  139. package/management-ui/src/pages/CodeGeneration.jsx +0 -14
  140. package/management-ui/src/pages/Connections.jsx +0 -252
  141. package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -427
  142. package/management-ui/src/pages/Dashboard.jsx +0 -311
  143. package/management-ui/src/pages/Environment.jsx +0 -314
  144. package/management-ui/src/pages/IntegrationConfigure.jsx +0 -544
  145. package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -479
  146. package/management-ui/src/pages/IntegrationTest.jsx +0 -494
  147. package/management-ui/src/pages/Integrations.jsx +0 -254
  148. package/management-ui/src/pages/Monitoring.jsx +0 -17
  149. package/management-ui/src/pages/Simulation.jsx +0 -155
  150. package/management-ui/src/pages/Users.jsx +0 -492
  151. package/management-ui/src/services/api.js +0 -41
  152. package/management-ui/src/services/apiModuleService.js +0 -193
  153. package/management-ui/src/services/websocket-handlers.js +0 -120
  154. package/management-ui/src/test/api/project.test.js +0 -273
  155. package/management-ui/src/test/components/Welcome.test.jsx +0 -378
  156. package/management-ui/src/test/mocks/server.js +0 -178
  157. package/management-ui/src/test/setup.js +0 -61
  158. package/management-ui/src/test/utils/test-utils.jsx +0 -134
  159. package/management-ui/src/utils/repository.js +0 -98
  160. package/management-ui/src/utils/repository.test.js +0 -118
  161. package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
  162. package/management-ui/tailwind.config.js +0 -63
  163. package/management-ui/tsconfig.json +0 -37
  164. package/management-ui/tsconfig.node.json +0 -10
  165. package/management-ui/vite.config.js +0 -26
  166. package/management-ui/vitest.config.js +0 -38
  167. /package/management-ui/{src/assets/FriggLogo.svg → dist/assets/FriggLogo-B7Xx8ZW1.svg} +0 -0
@@ -1,286 +0,0 @@
1
- import fs from 'fs/promises';
2
- import path from 'path';
3
- import { parse, stringify } from 'dotenv';
4
-
5
- class EnvFileManager {
6
- constructor(projectRoot) {
7
- this.projectRoot = projectRoot;
8
- this.environments = {
9
- local: '.env.local',
10
- staging: '.env.staging',
11
- production: '.env.production'
12
- };
13
- }
14
-
15
- /**
16
- * Read environment variables from a specific environment file
17
- */
18
- async readEnvFile(environment = 'local') {
19
- const fileName = this.environments[environment] || '.env';
20
- const filePath = path.join(this.projectRoot, fileName);
21
-
22
- try {
23
- const content = await fs.readFile(filePath, 'utf-8');
24
- const parsed = parse(content);
25
-
26
- // Convert to our variable format
27
- const variables = Object.entries(parsed).map(([key, value]) => ({
28
- id: `${environment}-${key}`,
29
- key,
30
- value,
31
- description: this.extractDescription(content, key),
32
- isSecret: this.isSecretVariable(key),
33
- environment
34
- }));
35
-
36
- return variables;
37
- } catch (error) {
38
- if (error.code === 'ENOENT') {
39
- // File doesn't exist, return empty array
40
- return [];
41
- }
42
- throw error;
43
- }
44
- }
45
-
46
- /**
47
- * Write environment variables to a specific environment file
48
- */
49
- async writeEnvFile(environment, variables) {
50
- const fileName = this.environments[environment] || '.env';
51
- const filePath = path.join(this.projectRoot, fileName);
52
-
53
- // Create backup first
54
- await this.createBackup(filePath);
55
-
56
- // Build the content
57
- let content = '';
58
- const sortedVars = [...variables].sort((a, b) => a.key.localeCompare(b.key));
59
-
60
- for (const variable of sortedVars) {
61
- // Add description as comment if exists
62
- if (variable.description) {
63
- content += `# ${variable.description}\n`;
64
- }
65
-
66
- // Add the variable
67
- const value = this.escapeValue(variable.value);
68
- content += `${variable.key}=${value}\n`;
69
-
70
- // Add extra newline between variables for readability
71
- content += '\n';
72
- }
73
-
74
- // Write the file
75
- await fs.writeFile(filePath, content.trim());
76
-
77
- return { success: true, path: filePath };
78
- }
79
-
80
- /**
81
- * Create a backup of the env file before modifying
82
- */
83
- async createBackup(filePath) {
84
- try {
85
- const backupPath = `${filePath}.backup.${Date.now()}`;
86
- await fs.copyFile(filePath, backupPath);
87
-
88
- // Keep only last 5 backups
89
- await this.cleanupOldBackups(filePath);
90
- } catch (error) {
91
- // Ignore if file doesn't exist
92
- if (error.code !== 'ENOENT') {
93
- throw error;
94
- }
95
- }
96
- }
97
-
98
- /**
99
- * Clean up old backup files
100
- */
101
- async cleanupOldBackups(filePath) {
102
- const dir = path.dirname(filePath);
103
- const basename = path.basename(filePath);
104
- const backupPattern = new RegExp(`^${basename}\\.backup\\.\\d+$`);
105
-
106
- const files = await fs.readdir(dir);
107
- const backups = files
108
- .filter(f => backupPattern.test(f))
109
- .map(f => ({
110
- name: f,
111
- path: path.join(dir, f)
112
- }));
113
-
114
- // Sort by timestamp (newest first)
115
- backups.sort((a, b) => {
116
- const timeA = parseInt(a.name.split('.').pop());
117
- const timeB = parseInt(b.name.split('.').pop());
118
- return timeB - timeA;
119
- });
120
-
121
- // Delete old backups
122
- for (let i = 5; i < backups.length; i++) {
123
- await fs.unlink(backups[i].path);
124
- }
125
- }
126
-
127
- /**
128
- * Extract description comment for a variable from the file content
129
- */
130
- extractDescription(content, key) {
131
- const lines = content.split('\n');
132
- for (let i = 0; i < lines.length; i++) {
133
- const line = lines[i].trim();
134
- if (line.startsWith(`${key}=`)) {
135
- // Check previous line for comment
136
- if (i > 0 && lines[i - 1].trim().startsWith('#')) {
137
- return lines[i - 1].trim().substring(1).trim();
138
- }
139
- break;
140
- }
141
- }
142
- return '';
143
- }
144
-
145
- /**
146
- * Determine if a variable should be treated as secret based on its name
147
- */
148
- isSecretVariable(key) {
149
- const secretPatterns = [
150
- /password/i,
151
- /secret/i,
152
- /key/i,
153
- /token/i,
154
- /credential/i,
155
- /auth/i,
156
- /private/i,
157
- /api_key/i
158
- ];
159
-
160
- return secretPatterns.some(pattern => pattern.test(key));
161
- }
162
-
163
- /**
164
- * Escape value for .env file format
165
- */
166
- escapeValue(value) {
167
- // If value contains spaces, newlines, or quotes, wrap in quotes
168
- if (/[\s"'`]/.test(value) || value === '') {
169
- // Escape any double quotes in the value
170
- const escaped = value.replace(/"/g, '\\"');
171
- return `"${escaped}"`;
172
- }
173
- return value;
174
- }
175
-
176
- /**
177
- * Validate environment variables
178
- */
179
- validateVariables(variables) {
180
- const errors = [];
181
- const seen = new Set();
182
-
183
- for (const variable of variables) {
184
- // Check for duplicates
185
- if (seen.has(variable.key)) {
186
- errors.push({
187
- id: variable.id,
188
- error: `Duplicate key: ${variable.key}`
189
- });
190
- }
191
- seen.add(variable.key);
192
-
193
- // Validate key format
194
- if (!/^[A-Z_][A-Z0-9_]*$/i.test(variable.key)) {
195
- errors.push({
196
- id: variable.id,
197
- error: `Invalid key format: ${variable.key}`
198
- });
199
- }
200
-
201
- // Type-specific validation
202
- if (variable.key.endsWith('_PORT') && variable.value) {
203
- const port = parseInt(variable.value);
204
- if (isNaN(port) || port < 1 || port > 65535) {
205
- errors.push({
206
- id: variable.id,
207
- error: `Invalid port value: ${variable.value}`
208
- });
209
- }
210
- }
211
-
212
- if (variable.key.endsWith('_URL') && variable.value) {
213
- try {
214
- new URL(variable.value);
215
- } catch {
216
- errors.push({
217
- id: variable.id,
218
- error: `Invalid URL format: ${variable.value}`
219
- });
220
- }
221
- }
222
- }
223
-
224
- return errors;
225
- }
226
-
227
- /**
228
- * Merge variables from multiple sources (e.g., file and AWS)
229
- */
230
- mergeVariables(fileVars, externalVars, preferExternal = false) {
231
- const merged = new Map();
232
-
233
- // Add file variables first
234
- for (const v of fileVars) {
235
- merged.set(v.key, v);
236
- }
237
-
238
- // Merge or override with external variables
239
- for (const v of externalVars) {
240
- if (preferExternal || !merged.has(v.key)) {
241
- merged.set(v.key, v);
242
- }
243
- }
244
-
245
- return Array.from(merged.values());
246
- }
247
-
248
- /**
249
- * Get all environments and their variables
250
- */
251
- async getAllEnvironments() {
252
- const result = {};
253
-
254
- for (const [env, _] of Object.entries(this.environments)) {
255
- try {
256
- result[env] = await this.readEnvFile(env);
257
- } catch (error) {
258
- console.error(`Error reading ${env} environment:`, error);
259
- result[env] = [];
260
- }
261
- }
262
-
263
- return result;
264
- }
265
-
266
- /**
267
- * Copy variables from one environment to another
268
- */
269
- async copyEnvironment(source, target, excludeSecrets = true) {
270
- const sourceVars = await this.readEnvFile(source);
271
-
272
- const targetVars = sourceVars
273
- .filter(v => !excludeSecrets || !v.isSecret)
274
- .map(v => ({
275
- ...v,
276
- environment: target,
277
- id: `${target}-${v.key}`
278
- }));
279
-
280
- await this.writeEnvFile(target, targetVars);
281
-
282
- return targetVars;
283
- }
284
- }
285
-
286
- export default EnvFileManager;
@@ -1,28 +0,0 @@
1
- import { createRequire } from 'module';
2
- import { pathToFileURL } from 'url';
3
-
4
- /**
5
- * Helper function to import CommonJS modules in an ES module environment
6
- * @param {string} modulePath - The path to the CommonJS module
7
- * @returns {Promise<any>} The imported module
8
- */
9
- export async function importCommonJS(modulePath) {
10
- try {
11
- // First try dynamic import (works if the module supports ESM)
12
- const moduleURL = pathToFileURL(modulePath).href;
13
- return await import(moduleURL);
14
- } catch (error) {
15
- // If dynamic import fails, try using createRequire
16
- try {
17
- const require = createRequire(import.meta.url);
18
- const module = require(modulePath);
19
- // Wrap in an object to match ESM import structure
20
- return { default: module, ...module };
21
- } catch (requireError) {
22
- console.error('Failed to import module:', modulePath);
23
- console.error('Dynamic import error:', error.message);
24
- console.error('Require error:', requireError.message);
25
- throw new Error(`Unable to import module at ${modulePath}`);
26
- }
27
- }
28
- }
@@ -1,83 +0,0 @@
1
- /**
2
- * Utility functions for creating standardized API responses
3
- * Implements the API contract defined in api-contract.md
4
- */
5
-
6
- /**
7
- * Create a standardized success response
8
- * @param {any} data - The response data
9
- * @param {string} message - Optional success message
10
- * @returns {object} Standardized success response
11
- */
12
- export function createStandardResponse(data, message = null) {
13
- return {
14
- status: 'success',
15
- data,
16
- message,
17
- timestamp: new Date().toISOString()
18
- }
19
- }
20
-
21
- /**
22
- * Create a standardized error response
23
- * @param {string} code - Error code
24
- * @param {string} message - Error message
25
- * @param {any} details - Optional error details
26
- * @returns {object} Standardized error response
27
- */
28
- export function createErrorResponse(code, message, details = null) {
29
- return {
30
- status: 'error',
31
- error: {
32
- code,
33
- message,
34
- details
35
- },
36
- timestamp: new Date().toISOString()
37
- }
38
- }
39
-
40
- /**
41
- * Error codes for different types of errors
42
- */
43
- export const ERROR_CODES = {
44
- // General errors
45
- INVALID_REQUEST: 'INVALID_REQUEST',
46
- UNAUTHORIZED: 'UNAUTHORIZED',
47
- FORBIDDEN: 'FORBIDDEN',
48
- NOT_FOUND: 'NOT_FOUND',
49
- INTERNAL_ERROR: 'INTERNAL_ERROR',
50
-
51
- // Project errors
52
- PROJECT_NOT_FOUND: 'PROJECT_NOT_FOUND',
53
- PROJECT_ALREADY_RUNNING: 'PROJECT_ALREADY_RUNNING',
54
- PROJECT_NOT_RUNNING: 'PROJECT_NOT_RUNNING',
55
- PROJECT_START_FAILED: 'PROJECT_START_FAILED',
56
- PROJECT_STOP_FAILED: 'PROJECT_STOP_FAILED',
57
-
58
- // Integration errors
59
- INTEGRATION_NOT_FOUND: 'INTEGRATION_NOT_FOUND',
60
- INTEGRATION_ALREADY_INSTALLED: 'INTEGRATION_ALREADY_INSTALLED',
61
- INTEGRATION_INSTALL_FAILED: 'INTEGRATION_INSTALL_FAILED',
62
- INTEGRATION_CONFIG_INVALID: 'INTEGRATION_CONFIG_INVALID',
63
-
64
- // Environment errors
65
- ENV_READ_FAILED: 'ENV_READ_FAILED',
66
- ENV_WRITE_FAILED: 'ENV_WRITE_FAILED',
67
- ENV_SYNC_FAILED: 'ENV_SYNC_FAILED',
68
-
69
- // CLI errors
70
- CLI_COMMAND_FAILED: 'CLI_COMMAND_FAILED',
71
- CLI_COMMAND_NOT_FOUND: 'CLI_COMMAND_NOT_FOUND'
72
- }
73
-
74
- /**
75
- * Wrap async route handlers to catch errors automatically
76
- * @param {Function} fn - Async route handler function
77
- * @returns {Function} Wrapped function with error handling
78
- */
79
- export function asyncHandler(fn) {
80
- return (req, res, next) => {
81
- Promise.resolve(fn(req, res, next)).catch(next)
82
- }
83
- }