@friggframework/devtools 2.0.0--canary.517.35ee143.0 → 2.0.0--canary.524.06156322a.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 (147) hide show
  1. package/infrastructure/domains/shared/types/app-definition.js +0 -21
  2. package/infrastructure/domains/shared/utilities/base-definition-factory.js +15 -1
  3. package/infrastructure/infrastructure-composer.js +0 -2
  4. package/package.json +15 -7
  5. package/.eslintrc.json +0 -3
  6. package/CHANGELOG.md +0 -132
  7. package/infrastructure/domains/admin-scripts/admin-script-builder.js +0 -200
  8. package/infrastructure/domains/admin-scripts/admin-script-builder.test.js +0 -499
  9. package/infrastructure/domains/admin-scripts/index.js +0 -5
  10. package/layers/prisma/.build-complete +0 -3
  11. package/layers/prisma/nodejs/package.json +0 -8
  12. package/management-ui/.eslintrc.js +0 -22
  13. package/management-ui/components.json +0 -21
  14. package/management-ui/docs/phase2-integration-guide.md +0 -320
  15. package/management-ui/index.html +0 -13
  16. package/management-ui/package.json +0 -76
  17. package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +0 -302
  18. package/management-ui/postcss.config.js +0 -6
  19. package/management-ui/server/api/backend.js +0 -256
  20. package/management-ui/server/api/cli.js +0 -315
  21. package/management-ui/server/api/codegen.js +0 -663
  22. package/management-ui/server/api/connections.js +0 -857
  23. package/management-ui/server/api/discovery.js +0 -185
  24. package/management-ui/server/api/environment/index.js +0 -1
  25. package/management-ui/server/api/environment/router.js +0 -378
  26. package/management-ui/server/api/environment.js +0 -328
  27. package/management-ui/server/api/integrations.js +0 -876
  28. package/management-ui/server/api/logs.js +0 -248
  29. package/management-ui/server/api/monitoring.js +0 -282
  30. package/management-ui/server/api/open-ide.js +0 -31
  31. package/management-ui/server/api/project.js +0 -1029
  32. package/management-ui/server/api/users/sessions.js +0 -371
  33. package/management-ui/server/api/users/simulation.js +0 -254
  34. package/management-ui/server/api/users.js +0 -362
  35. package/management-ui/server/api-contract.md +0 -275
  36. package/management-ui/server/index.js +0 -873
  37. package/management-ui/server/middleware/errorHandler.js +0 -93
  38. package/management-ui/server/middleware/security.js +0 -32
  39. package/management-ui/server/processManager.js +0 -296
  40. package/management-ui/server/server.js +0 -346
  41. package/management-ui/server/services/aws-monitor.js +0 -413
  42. package/management-ui/server/services/npm-registry.js +0 -347
  43. package/management-ui/server/services/template-engine.js +0 -538
  44. package/management-ui/server/utils/cliIntegration.js +0 -220
  45. package/management-ui/server/utils/environment/auditLogger.js +0 -471
  46. package/management-ui/server/utils/environment/awsParameterStore.js +0 -275
  47. package/management-ui/server/utils/environment/encryption.js +0 -278
  48. package/management-ui/server/utils/environment/envFileManager.js +0 -286
  49. package/management-ui/server/utils/import-commonjs.js +0 -28
  50. package/management-ui/server/utils/response.js +0 -83
  51. package/management-ui/server/websocket/handler.js +0 -325
  52. package/management-ui/src/App.jsx +0 -25
  53. package/management-ui/src/assets/FriggLogo.svg +0 -1
  54. package/management-ui/src/components/AppRouter.jsx +0 -65
  55. package/management-ui/src/components/Button.jsx +0 -70
  56. package/management-ui/src/components/Card.jsx +0 -97
  57. package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
  58. package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
  59. package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
  60. package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
  61. package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
  62. package/management-ui/src/components/ErrorBoundary.jsx +0 -73
  63. package/management-ui/src/components/IntegrationCard.jsx +0 -481
  64. package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -770
  65. package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
  66. package/management-ui/src/components/IntegrationStatus.jsx +0 -336
  67. package/management-ui/src/components/Layout.jsx +0 -716
  68. package/management-ui/src/components/LoadingSpinner.jsx +0 -113
  69. package/management-ui/src/components/RepositoryPicker.jsx +0 -248
  70. package/management-ui/src/components/SessionMonitor.jsx +0 -350
  71. package/management-ui/src/components/StatusBadge.jsx +0 -208
  72. package/management-ui/src/components/UserContextSwitcher.jsx +0 -212
  73. package/management-ui/src/components/UserSimulation.jsx +0 -327
  74. package/management-ui/src/components/Welcome.jsx +0 -434
  75. package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
  76. package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
  77. package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
  78. package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
  79. package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
  80. package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
  81. package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
  82. package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
  83. package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
  84. package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
  85. package/management-ui/src/components/codegen/index.js +0 -10
  86. package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
  87. package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
  88. package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
  89. package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
  90. package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
  91. package/management-ui/src/components/connections/index.js +0 -5
  92. package/management-ui/src/components/index.js +0 -21
  93. package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
  94. package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
  95. package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
  96. package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
  97. package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
  98. package/management-ui/src/components/monitoring/index.js +0 -6
  99. package/management-ui/src/components/monitoring/monitoring.css +0 -218
  100. package/management-ui/src/components/theme-provider.jsx +0 -52
  101. package/management-ui/src/components/theme-toggle.jsx +0 -39
  102. package/management-ui/src/components/ui/badge.tsx +0 -36
  103. package/management-ui/src/components/ui/button.test.jsx +0 -56
  104. package/management-ui/src/components/ui/button.tsx +0 -57
  105. package/management-ui/src/components/ui/card.tsx +0 -76
  106. package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
  107. package/management-ui/src/components/ui/select.tsx +0 -157
  108. package/management-ui/src/components/ui/skeleton.jsx +0 -15
  109. package/management-ui/src/hooks/useFrigg.jsx +0 -387
  110. package/management-ui/src/hooks/useSocket.jsx +0 -58
  111. package/management-ui/src/index.css +0 -193
  112. package/management-ui/src/lib/utils.ts +0 -6
  113. package/management-ui/src/main.jsx +0 -10
  114. package/management-ui/src/pages/CodeGeneration.jsx +0 -14
  115. package/management-ui/src/pages/Connections.jsx +0 -252
  116. package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -633
  117. package/management-ui/src/pages/Dashboard.jsx +0 -311
  118. package/management-ui/src/pages/Environment.jsx +0 -314
  119. package/management-ui/src/pages/IntegrationConfigure.jsx +0 -669
  120. package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -567
  121. package/management-ui/src/pages/IntegrationTest.jsx +0 -742
  122. package/management-ui/src/pages/Integrations.jsx +0 -253
  123. package/management-ui/src/pages/Monitoring.jsx +0 -17
  124. package/management-ui/src/pages/Simulation.jsx +0 -155
  125. package/management-ui/src/pages/Users.jsx +0 -492
  126. package/management-ui/src/services/api.js +0 -41
  127. package/management-ui/src/services/apiModuleService.js +0 -193
  128. package/management-ui/src/services/websocket-handlers.js +0 -120
  129. package/management-ui/src/test/api/project.test.js +0 -273
  130. package/management-ui/src/test/components/Welcome.test.jsx +0 -378
  131. package/management-ui/src/test/mocks/server.js +0 -178
  132. package/management-ui/src/test/setup.js +0 -61
  133. package/management-ui/src/test/utils/test-utils.jsx +0 -134
  134. package/management-ui/src/utils/repository.js +0 -98
  135. package/management-ui/src/utils/repository.test.js +0 -118
  136. package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
  137. package/management-ui/tailwind.config.js +0 -63
  138. package/management-ui/tsconfig.json +0 -37
  139. package/management-ui/tsconfig.node.json +0 -10
  140. package/management-ui/vite.config.js +0 -26
  141. package/management-ui/vitest.config.js +0 -38
  142. package/test/auther-definition-method-tester.js +0 -45
  143. package/test/index.js +0 -9
  144. package/test/integration-validator.js +0 -2
  145. package/test/mock-api-readme.md +0 -102
  146. package/test/mock-api.js +0 -284
  147. package/test/mock-integration.js +0 -78
@@ -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
- }