@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.
- package/infrastructure/domains/shared/types/app-definition.js +0 -21
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +15 -1
- package/infrastructure/infrastructure-composer.js +0 -2
- package/package.json +15 -7
- package/.eslintrc.json +0 -3
- package/CHANGELOG.md +0 -132
- package/infrastructure/domains/admin-scripts/admin-script-builder.js +0 -200
- package/infrastructure/domains/admin-scripts/admin-script-builder.test.js +0 -499
- package/infrastructure/domains/admin-scripts/index.js +0 -5
- package/layers/prisma/.build-complete +0 -3
- package/layers/prisma/nodejs/package.json +0 -8
- package/management-ui/.eslintrc.js +0 -22
- package/management-ui/components.json +0 -21
- package/management-ui/docs/phase2-integration-guide.md +0 -320
- package/management-ui/index.html +0 -13
- package/management-ui/package.json +0 -76
- package/management-ui/packages/devtools/frigg-cli/ui-command/index.js +0 -302
- package/management-ui/postcss.config.js +0 -6
- package/management-ui/server/api/backend.js +0 -256
- package/management-ui/server/api/cli.js +0 -315
- package/management-ui/server/api/codegen.js +0 -663
- package/management-ui/server/api/connections.js +0 -857
- package/management-ui/server/api/discovery.js +0 -185
- package/management-ui/server/api/environment/index.js +0 -1
- package/management-ui/server/api/environment/router.js +0 -378
- package/management-ui/server/api/environment.js +0 -328
- package/management-ui/server/api/integrations.js +0 -876
- package/management-ui/server/api/logs.js +0 -248
- package/management-ui/server/api/monitoring.js +0 -282
- package/management-ui/server/api/open-ide.js +0 -31
- package/management-ui/server/api/project.js +0 -1029
- package/management-ui/server/api/users/sessions.js +0 -371
- package/management-ui/server/api/users/simulation.js +0 -254
- package/management-ui/server/api/users.js +0 -362
- package/management-ui/server/api-contract.md +0 -275
- package/management-ui/server/index.js +0 -873
- package/management-ui/server/middleware/errorHandler.js +0 -93
- package/management-ui/server/middleware/security.js +0 -32
- package/management-ui/server/processManager.js +0 -296
- package/management-ui/server/server.js +0 -346
- package/management-ui/server/services/aws-monitor.js +0 -413
- package/management-ui/server/services/npm-registry.js +0 -347
- package/management-ui/server/services/template-engine.js +0 -538
- package/management-ui/server/utils/cliIntegration.js +0 -220
- package/management-ui/server/utils/environment/auditLogger.js +0 -471
- package/management-ui/server/utils/environment/awsParameterStore.js +0 -275
- package/management-ui/server/utils/environment/encryption.js +0 -278
- package/management-ui/server/utils/environment/envFileManager.js +0 -286
- package/management-ui/server/utils/import-commonjs.js +0 -28
- package/management-ui/server/utils/response.js +0 -83
- package/management-ui/server/websocket/handler.js +0 -325
- package/management-ui/src/App.jsx +0 -25
- package/management-ui/src/assets/FriggLogo.svg +0 -1
- package/management-ui/src/components/AppRouter.jsx +0 -65
- package/management-ui/src/components/Button.jsx +0 -70
- package/management-ui/src/components/Card.jsx +0 -97
- package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
- package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
- package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
- package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
- package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
- package/management-ui/src/components/ErrorBoundary.jsx +0 -73
- package/management-ui/src/components/IntegrationCard.jsx +0 -481
- package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -770
- package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
- package/management-ui/src/components/IntegrationStatus.jsx +0 -336
- package/management-ui/src/components/Layout.jsx +0 -716
- package/management-ui/src/components/LoadingSpinner.jsx +0 -113
- package/management-ui/src/components/RepositoryPicker.jsx +0 -248
- package/management-ui/src/components/SessionMonitor.jsx +0 -350
- package/management-ui/src/components/StatusBadge.jsx +0 -208
- package/management-ui/src/components/UserContextSwitcher.jsx +0 -212
- package/management-ui/src/components/UserSimulation.jsx +0 -327
- package/management-ui/src/components/Welcome.jsx +0 -434
- package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
- package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
- package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
- package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
- package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
- package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
- package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
- package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
- package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
- package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
- package/management-ui/src/components/codegen/index.js +0 -10
- package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
- package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
- package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
- package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
- package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
- package/management-ui/src/components/connections/index.js +0 -5
- package/management-ui/src/components/index.js +0 -21
- package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
- package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
- package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
- package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
- package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
- package/management-ui/src/components/monitoring/index.js +0 -6
- package/management-ui/src/components/monitoring/monitoring.css +0 -218
- package/management-ui/src/components/theme-provider.jsx +0 -52
- package/management-ui/src/components/theme-toggle.jsx +0 -39
- package/management-ui/src/components/ui/badge.tsx +0 -36
- package/management-ui/src/components/ui/button.test.jsx +0 -56
- package/management-ui/src/components/ui/button.tsx +0 -57
- package/management-ui/src/components/ui/card.tsx +0 -76
- package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
- package/management-ui/src/components/ui/select.tsx +0 -157
- package/management-ui/src/components/ui/skeleton.jsx +0 -15
- package/management-ui/src/hooks/useFrigg.jsx +0 -387
- package/management-ui/src/hooks/useSocket.jsx +0 -58
- package/management-ui/src/index.css +0 -193
- package/management-ui/src/lib/utils.ts +0 -6
- package/management-ui/src/main.jsx +0 -10
- package/management-ui/src/pages/CodeGeneration.jsx +0 -14
- package/management-ui/src/pages/Connections.jsx +0 -252
- package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -633
- package/management-ui/src/pages/Dashboard.jsx +0 -311
- package/management-ui/src/pages/Environment.jsx +0 -314
- package/management-ui/src/pages/IntegrationConfigure.jsx +0 -669
- package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -567
- package/management-ui/src/pages/IntegrationTest.jsx +0 -742
- package/management-ui/src/pages/Integrations.jsx +0 -253
- package/management-ui/src/pages/Monitoring.jsx +0 -17
- package/management-ui/src/pages/Simulation.jsx +0 -155
- package/management-ui/src/pages/Users.jsx +0 -492
- package/management-ui/src/services/api.js +0 -41
- package/management-ui/src/services/apiModuleService.js +0 -193
- package/management-ui/src/services/websocket-handlers.js +0 -120
- package/management-ui/src/test/api/project.test.js +0 -273
- package/management-ui/src/test/components/Welcome.test.jsx +0 -378
- package/management-ui/src/test/mocks/server.js +0 -178
- package/management-ui/src/test/setup.js +0 -61
- package/management-ui/src/test/utils/test-utils.jsx +0 -134
- package/management-ui/src/utils/repository.js +0 -98
- package/management-ui/src/utils/repository.test.js +0 -118
- package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
- package/management-ui/tailwind.config.js +0 -63
- package/management-ui/tsconfig.json +0 -37
- package/management-ui/tsconfig.node.json +0 -10
- package/management-ui/vite.config.js +0 -26
- package/management-ui/vitest.config.js +0 -38
- package/test/auther-definition-method-tester.js +0 -45
- package/test/index.js +0 -9
- package/test/integration-validator.js +0 -2
- package/test/mock-api-readme.md +0 -102
- package/test/mock-api.js +0 -284
- package/test/mock-integration.js +0 -78
|
@@ -106,25 +106,6 @@
|
|
|
106
106
|
* @property {string} Definition.name - Integration name
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
|
-
/**
|
|
110
|
-
* Admin script definition
|
|
111
|
-
* @typedef {Object} AdminScriptDefinition
|
|
112
|
-
* @property {Object} Definition - Static definition from script class
|
|
113
|
-
* @property {string} Definition.name - Script name identifier
|
|
114
|
-
* @property {string} Definition.version - Script version (semver)
|
|
115
|
-
* @property {string} [Definition.description] - Human-readable description
|
|
116
|
-
* @property {Object} [Definition.schedule] - Schedule configuration
|
|
117
|
-
* @property {boolean} [Definition.schedule.enabled] - Whether scheduling is enabled
|
|
118
|
-
* @property {string} [Definition.schedule.cronExpression] - Cron expression
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Admin configuration
|
|
123
|
-
* @typedef {Object} AdminConfig
|
|
124
|
-
* @property {boolean} [includeBuiltinScripts] - Whether to include built-in scripts
|
|
125
|
-
* @property {boolean} [enableScheduling] - Whether to enable EventBridge scheduling
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
109
|
/**
|
|
129
110
|
* Complete application definition
|
|
130
111
|
* @typedef {Object} AppDefinition
|
|
@@ -141,8 +122,6 @@
|
|
|
141
122
|
* @property {MigrationDefinition} [migrations] - Database migration configuration
|
|
142
123
|
* @property {WebsocketDefinition} [websockets] - WebSocket API configuration
|
|
143
124
|
* @property {IntegrationDefinition[]} [integrations] - Integration definitions
|
|
144
|
-
* @property {AdminScriptDefinition[]} [adminScripts] - Admin script definitions
|
|
145
|
-
* @property {AdminConfig} [admin] - Admin configuration
|
|
146
125
|
*
|
|
147
126
|
* @property {Object} [environment] - Environment variables
|
|
148
127
|
*/
|
|
@@ -81,7 +81,13 @@ function createBaseDefinition(
|
|
|
81
81
|
'node_modules/serverless-kms-grants/**',
|
|
82
82
|
// Note: DO NOT exclude serverless-http - it's a runtime dependency!
|
|
83
83
|
|
|
84
|
-
// Exclude local dev files
|
|
84
|
+
// Exclude local dev files and environment files (NEVER deploy .env files!)
|
|
85
|
+
'.env',
|
|
86
|
+
'.env.*',
|
|
87
|
+
'.env.local',
|
|
88
|
+
'.env.*.local',
|
|
89
|
+
'**/.env',
|
|
90
|
+
'**/.env.*',
|
|
85
91
|
'deploy.log',
|
|
86
92
|
'.env.backup',
|
|
87
93
|
'docker-compose.yml',
|
|
@@ -124,6 +130,14 @@ function createBaseDefinition(
|
|
|
124
130
|
'node_modules/@friggframework/core/node_modules/**',
|
|
125
131
|
'node_modules/@friggframework/devtools/node_modules/**',
|
|
126
132
|
|
|
133
|
+
// Exclude environment files (NEVER deploy .env files!)
|
|
134
|
+
'.env',
|
|
135
|
+
'.env.*',
|
|
136
|
+
'.env.local',
|
|
137
|
+
'.env.*.local',
|
|
138
|
+
'**/.env',
|
|
139
|
+
'**/.env.*',
|
|
140
|
+
|
|
127
141
|
// Exclude development/test files from backend project
|
|
128
142
|
'coverage/**',
|
|
129
143
|
'test/**',
|
|
@@ -16,7 +16,6 @@ const { MigrationBuilder } = require('./domains/database/migration-builder');
|
|
|
16
16
|
const { SsmBuilder } = require('./domains/parameters/ssm-builder');
|
|
17
17
|
const { WebsocketBuilder } = require('./domains/integration/websocket-builder');
|
|
18
18
|
const { IntegrationBuilder } = require('./domains/integration/integration-builder');
|
|
19
|
-
const { AdminScriptBuilder } = require('./domains/admin-scripts/admin-script-builder');
|
|
20
19
|
|
|
21
20
|
// Utilities
|
|
22
21
|
const { modifyHandlerPaths } = require('./domains/shared/utilities/handler-path-resolver');
|
|
@@ -52,7 +51,6 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
52
51
|
new SsmBuilder(),
|
|
53
52
|
new WebsocketBuilder(),
|
|
54
53
|
new IntegrationBuilder(),
|
|
55
|
-
new AdminScriptBuilder(),
|
|
56
54
|
]);
|
|
57
55
|
|
|
58
56
|
// Build all infrastructure (orchestrator handles validation, dependencies, parallel execution)
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.
|
|
4
|
+
"version": "2.0.0--canary.524.06156322a.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"frigg": "./frigg-cli/index.js"
|
|
7
7
|
},
|
|
8
|
+
"files": [
|
|
9
|
+
"frigg-cli/",
|
|
10
|
+
"infrastructure/",
|
|
11
|
+
"migrations/",
|
|
12
|
+
"management-ui/dist/",
|
|
13
|
+
"index.js",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
8
16
|
"dependencies": {
|
|
9
17
|
"@aws-sdk/client-cloudformation": "^3.705.0",
|
|
10
18
|
"@aws-sdk/client-ec2": "^3.835.0",
|
|
@@ -16,9 +24,9 @@
|
|
|
16
24
|
"@babel/eslint-parser": "^7.18.9",
|
|
17
25
|
"@babel/parser": "^7.25.3",
|
|
18
26
|
"@babel/traverse": "^7.25.3",
|
|
19
|
-
"@friggframework/core": "2.0.0--canary.
|
|
20
|
-
"@friggframework/schemas": "2.0.0--canary.
|
|
21
|
-
"@friggframework/test": "2.0.0--canary.
|
|
27
|
+
"@friggframework/core": "2.0.0--canary.524.06156322a.0",
|
|
28
|
+
"@friggframework/schemas": "2.0.0--canary.524.06156322a.0",
|
|
29
|
+
"@friggframework/test": "2.0.0--canary.524.06156322a.0",
|
|
22
30
|
"@hapi/boom": "^10.0.1",
|
|
23
31
|
"@inquirer/prompts": "^5.3.8",
|
|
24
32
|
"axios": "^1.7.2",
|
|
@@ -46,8 +54,8 @@
|
|
|
46
54
|
"validate-npm-package-name": "^5.0.0"
|
|
47
55
|
},
|
|
48
56
|
"devDependencies": {
|
|
49
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
50
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
57
|
+
"@friggframework/eslint-config": "2.0.0--canary.524.06156322a.0",
|
|
58
|
+
"@friggframework/prettier-config": "2.0.0--canary.524.06156322a.0",
|
|
51
59
|
"aws-sdk-client-mock": "^4.1.0",
|
|
52
60
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
53
61
|
"jest": "^30.1.3",
|
|
@@ -79,5 +87,5 @@
|
|
|
79
87
|
"publishConfig": {
|
|
80
88
|
"access": "public"
|
|
81
89
|
},
|
|
82
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "06156322ad1f226db572c1d0f2b16492f3318902"
|
|
83
91
|
}
|
package/.eslintrc.json
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# v1.2.0 (Tue Aug 06 2024)
|
|
2
|
-
|
|
3
|
-
#### 🚀 Enhancement
|
|
4
|
-
|
|
5
|
-
- CLI for Frigg - Install command for now [#322](https://github.com/friggframework/frigg/pull/322) ([@seanspeaks](https://github.com/seanspeaks))
|
|
6
|
-
|
|
7
|
-
#### 🐛 Bug Fix
|
|
8
|
-
|
|
9
|
-
- Add READMEs that will need updating, but for version releasing [#324](https://github.com/friggframework/frigg/pull/324) ([@seanspeaks](https://github.com/seanspeaks))
|
|
10
|
-
- Add READMEs that will need updating, but for version releasing ([@seanspeaks](https://github.com/seanspeaks))
|
|
11
|
-
- small update to integration testing / tooling [#304](https://github.com/friggframework/frigg/pull/304) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
12
|
-
- Added missing dependencies ([@seanspeaks](https://github.com/seanspeaks))
|
|
13
|
-
- Added a missing dependency ([@seanspeaks](https://github.com/seanspeaks))
|
|
14
|
-
- Updated to handle envs properly, also further refactoring, and better templating. ([@seanspeaks](https://github.com/seanspeaks))
|
|
15
|
-
- WIP with help from Tabnine AI chat. ([@seanspeaks](https://github.com/seanspeaks))
|
|
16
|
-
- Bump version to: v1.1.8 \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
17
|
-
- use the factory methods for creating the mock integration so that everything is set up (mostly events and userActions) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
18
|
-
- Bump version to: v1.1.5 \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
19
|
-
|
|
20
|
-
#### Authors: 2
|
|
21
|
-
|
|
22
|
-
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
23
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
# v1.1.8 (Thu Jul 18 2024)
|
|
28
|
-
|
|
29
|
-
#### 🐛 Bug Fix
|
|
30
|
-
|
|
31
|
-
- Revert open to support commonjs [#319](https://github.com/friggframework/frigg/pull/319) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
32
|
-
- Bump version to: v1.1.6 \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
33
|
-
|
|
34
|
-
#### Authors: 2
|
|
35
|
-
|
|
36
|
-
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
37
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
# v1.1.7 (Mon Jul 15 2024)
|
|
42
|
-
|
|
43
|
-
#### 🐛 Bug Fix
|
|
44
|
-
|
|
45
|
-
- getAuthorizationRequirements() async [#318](https://github.com/friggframework/frigg/pull/318) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
46
|
-
- await getAuthorizeRequirements() ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
47
|
-
- Bump version to: v1.1.6 \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
48
|
-
|
|
49
|
-
#### Authors: 2
|
|
50
|
-
|
|
51
|
-
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
52
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
# v1.1.6 (Fri Apr 26 2024)
|
|
57
|
-
|
|
58
|
-
#### 🐛 Bug Fix
|
|
59
|
-
|
|
60
|
-
- Small fix to validation errors and cleanup [#307](https://github.com/friggframework/frigg/pull/307) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
61
|
-
- also cleanup devtools since all versions will bump ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
62
|
-
- Bump version to: v1.1.5 \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
63
|
-
|
|
64
|
-
#### Authors: 2
|
|
65
|
-
|
|
66
|
-
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
67
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
# v1.1.5 (Tue Apr 09 2024)
|
|
72
|
-
|
|
73
|
-
#### 🐛 Bug Fix
|
|
74
|
-
|
|
75
|
-
- update router to include options and refresh [#301](https://github.com/friggframework/frigg/pull/301) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
76
|
-
- Bump version to: v1.1.4 \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
77
|
-
- Bump version to: v1.1.3 \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
78
|
-
|
|
79
|
-
#### Authors: 2
|
|
80
|
-
|
|
81
|
-
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
82
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
# v2.0.0 (Sat Mar 30 2024)
|
|
87
|
-
|
|
88
|
-
#### 💥 Breaking Change
|
|
89
|
-
|
|
90
|
-
- revert HEAD to a corrected v1-connectwise release [#283](https://github.com/friggframework/frigg/pull/283) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
91
|
-
|
|
92
|
-
#### 🚀 Enhancement
|
|
93
|
-
|
|
94
|
-
- Package redo [#294](https://github.com/friggframework/frigg/pull/294) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
95
|
-
|
|
96
|
-
#### 🐛 Bug Fix
|
|
97
|
-
|
|
98
|
-
- delete all node_modules and regenerate lock file to potentially address known bug ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
99
|
-
- add back the direct dependency on eslint as this might be leading to a deploy issue ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
100
|
-
- create test, eslint-config and prettier-config packages as base shared dependencies ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
101
|
-
- slight fix to mock integration module instantiation [#290](https://github.com/friggframework/frigg/pull/290) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
102
|
-
- slight fix to mock integration module instantiation ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
103
|
-
- Publish ([@seanspeaks](https://github.com/seanspeaks))
|
|
104
|
-
- Bump node and npm version for the whole repo (Fix CI) [#274](https://github.com/friggframework/frigg/pull/274) ([@seanspeaks](https://github.com/seanspeaks))
|
|
105
|
-
- Revert main to last release [#284](https://github.com/friggframework/frigg/pull/284) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
106
|
-
- Revert "set test environment STAGE to dev" ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
107
|
-
- Add stage to test env [#282](https://github.com/friggframework/frigg/pull/282) ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
108
|
-
- set test environment STAGE to dev ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
109
|
-
- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
110
|
-
|
|
111
|
-
#### Authors: 2
|
|
112
|
-
|
|
113
|
-
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
114
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
# v1.1.0 (Wed Mar 20 2024)
|
|
119
|
-
|
|
120
|
-
#### 🚀 Enhancement
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
#### 🐛 Bug Fix
|
|
124
|
-
|
|
125
|
-
- correct some bad automated edits, though they are not in relevant files ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber))
|
|
126
|
-
|
|
127
|
-
#### Authors: 4
|
|
128
|
-
|
|
129
|
-
- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber)
|
|
130
|
-
- Nicolas Leal ([@nicolasmelo1](https://github.com/nicolasmelo1))
|
|
131
|
-
- nmilcoff ([@nmilcoff](https://github.com/nmilcoff))
|
|
132
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Admin Script Builder
|
|
3
|
-
*
|
|
4
|
-
* Domain Layer - Hexagonal Architecture
|
|
5
|
-
*
|
|
6
|
-
* Responsible for:
|
|
7
|
-
* - Creating SQS queue for admin script execution
|
|
8
|
-
* - Creating Lambda function for script execution (worker)
|
|
9
|
-
* - Creating Lambda function for admin API routes (router)
|
|
10
|
-
* - Creating EventBridge Scheduler resources (Phase 2)
|
|
11
|
-
* - Creating IAM roles for scheduler to invoke Lambda
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const { InfrastructureBuilder, ValidationResult } = require('../shared/base-builder');
|
|
15
|
-
|
|
16
|
-
class AdminScriptBuilder extends InfrastructureBuilder {
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this.name = 'AdminScriptBuilder';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
shouldExecute(appDefinition) {
|
|
23
|
-
return Array.isArray(appDefinition.adminScripts) && appDefinition.adminScripts.length > 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getDependencies() {
|
|
27
|
-
return []; // Can run independently
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
validate(appDefinition) {
|
|
31
|
-
const result = new ValidationResult();
|
|
32
|
-
|
|
33
|
-
if (!appDefinition.adminScripts) {
|
|
34
|
-
return result; // Not an error, just no scripts
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (!Array.isArray(appDefinition.adminScripts)) {
|
|
38
|
-
result.addError('adminScripts must be an array');
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Validate each script
|
|
43
|
-
appDefinition.adminScripts.forEach((script, index) => {
|
|
44
|
-
if (!script?.Definition?.name) {
|
|
45
|
-
result.addError(`Admin script at index ${index} is missing Definition or name`);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async build(appDefinition, discoveredResources) {
|
|
53
|
-
console.log(`\n[${this.name}] Configuring admin scripts...`);
|
|
54
|
-
console.log(` Processing ${appDefinition.adminScripts.length} scripts...`);
|
|
55
|
-
|
|
56
|
-
const usePrismaLayer = appDefinition.usePrismaLambdaLayer !== false;
|
|
57
|
-
const adminConfig = appDefinition.admin || {};
|
|
58
|
-
|
|
59
|
-
const result = {
|
|
60
|
-
functions: {},
|
|
61
|
-
resources: {},
|
|
62
|
-
environment: {},
|
|
63
|
-
custom: {},
|
|
64
|
-
iamStatements: [],
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// Create admin script queue
|
|
68
|
-
this.createAdminScriptQueue(result);
|
|
69
|
-
|
|
70
|
-
// Create Lambda function for script execution
|
|
71
|
-
this.createScriptExecutorFunction(result, usePrismaLayer);
|
|
72
|
-
|
|
73
|
-
// Create API routes for script management
|
|
74
|
-
this.createAdminScriptRoutes(result, usePrismaLayer);
|
|
75
|
-
|
|
76
|
-
// Phase 2: Create EventBridge Scheduler resources
|
|
77
|
-
if (adminConfig.enableScheduling) {
|
|
78
|
-
this.createSchedulerResources(appDefinition, result);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Log registered scripts
|
|
82
|
-
appDefinition.adminScripts.forEach(script => {
|
|
83
|
-
const name = script.Definition?.name || 'unknown';
|
|
84
|
-
const schedule = script.Definition?.schedule;
|
|
85
|
-
console.log(` ✓ Registered: ${name}${schedule?.enabled ? ' (scheduled)' : ''}`);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
console.log(`[${this.name}] ✅ Admin script configuration completed`);
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
createAdminScriptQueue(result) {
|
|
93
|
-
result.resources.AdminScriptQueue = {
|
|
94
|
-
Type: 'AWS::SQS::Queue',
|
|
95
|
-
Properties: {
|
|
96
|
-
QueueName: '${self:service}-${self:provider.stage}-AdminScriptQueue',
|
|
97
|
-
MessageRetentionPeriod: 86400, // 1 day
|
|
98
|
-
VisibilityTimeout: 900, // 15 minutes (Lambda max)
|
|
99
|
-
RedrivePolicy: {
|
|
100
|
-
maxReceiveCount: 3,
|
|
101
|
-
deadLetterTargetArn: {
|
|
102
|
-
'Fn::GetAtt': ['InternalErrorQueue', 'Arn'],
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
result.environment.ADMIN_SCRIPT_QUEUE_URL = { Ref: 'AdminScriptQueue' };
|
|
109
|
-
console.log(' ✓ Created AdminScriptQueue');
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
createScriptExecutorFunction(result, usePrismaLayer) {
|
|
113
|
-
result.functions.adminScriptExecutor = {
|
|
114
|
-
handler: 'node_modules/@friggframework/admin-scripts/src/infrastructure/script-executor-handler.handler',
|
|
115
|
-
skipEsbuild: true,
|
|
116
|
-
...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
|
|
117
|
-
timeout: 900, // 15 minutes max
|
|
118
|
-
memorySize: 1024,
|
|
119
|
-
events: [
|
|
120
|
-
{
|
|
121
|
-
sqs: {
|
|
122
|
-
arn: { 'Fn::GetAtt': ['AdminScriptQueue', 'Arn'] },
|
|
123
|
-
batchSize: 1,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
};
|
|
128
|
-
console.log(' ✓ Created adminScriptExecutor function');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
createAdminScriptRoutes(result, usePrismaLayer) {
|
|
132
|
-
result.functions.adminScriptRouter = {
|
|
133
|
-
handler: 'node_modules/@friggframework/admin-scripts/src/infrastructure/admin-script-router.handler',
|
|
134
|
-
skipEsbuild: true,
|
|
135
|
-
...(usePrismaLayer && { layers: [{ Ref: 'PrismaLambdaLayer' }] }),
|
|
136
|
-
timeout: 30,
|
|
137
|
-
events: [
|
|
138
|
-
// List scripts
|
|
139
|
-
{ httpApi: { path: '/admin/scripts', method: 'GET' } },
|
|
140
|
-
// Get script details
|
|
141
|
-
{ httpApi: { path: '/admin/scripts/{scriptName}', method: 'GET' } },
|
|
142
|
-
// Execute script (sync or async)
|
|
143
|
-
{ httpApi: { path: '/admin/scripts/{scriptName}/execute', method: 'POST' } },
|
|
144
|
-
// Get execution status
|
|
145
|
-
{ httpApi: { path: '/admin/executions/{executionId}', method: 'GET' } },
|
|
146
|
-
// List executions
|
|
147
|
-
{ httpApi: { path: '/admin/executions', method: 'GET' } },
|
|
148
|
-
// Schedule management (Phase 2)
|
|
149
|
-
{ httpApi: { path: '/admin/scripts/{scriptName}/schedule', method: 'GET' } },
|
|
150
|
-
{ httpApi: { path: '/admin/scripts/{scriptName}/schedule', method: 'PUT' } },
|
|
151
|
-
{ httpApi: { path: '/admin/scripts/{scriptName}/schedule', method: 'DELETE' } },
|
|
152
|
-
],
|
|
153
|
-
};
|
|
154
|
-
console.log(' ✓ Created adminScriptRouter function');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
createSchedulerResources(appDefinition, result) {
|
|
158
|
-
// Create IAM role for EventBridge Scheduler
|
|
159
|
-
result.resources.AdminScriptSchedulerRole = {
|
|
160
|
-
Type: 'AWS::IAM::Role',
|
|
161
|
-
Properties: {
|
|
162
|
-
RoleName: '${self:service}-${self:provider.stage}-admin-script-scheduler',
|
|
163
|
-
AssumeRolePolicyDocument: {
|
|
164
|
-
Version: '2012-10-17',
|
|
165
|
-
Statement: [{
|
|
166
|
-
Effect: 'Allow',
|
|
167
|
-
Principal: { Service: 'scheduler.amazonaws.com' },
|
|
168
|
-
Action: 'sts:AssumeRole',
|
|
169
|
-
}],
|
|
170
|
-
},
|
|
171
|
-
Policies: [{
|
|
172
|
-
PolicyName: 'InvokeLambda',
|
|
173
|
-
PolicyDocument: {
|
|
174
|
-
Version: '2012-10-17',
|
|
175
|
-
Statement: [{
|
|
176
|
-
Effect: 'Allow',
|
|
177
|
-
Action: 'lambda:InvokeFunction',
|
|
178
|
-
Resource: { 'Fn::GetAtt': ['AdminScriptExecutorLambdaFunction', 'Arn'] },
|
|
179
|
-
}],
|
|
180
|
-
},
|
|
181
|
-
}],
|
|
182
|
-
},
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// Create schedule group
|
|
186
|
-
result.resources.AdminScriptScheduleGroup = {
|
|
187
|
-
Type: 'AWS::Scheduler::ScheduleGroup',
|
|
188
|
-
Properties: {
|
|
189
|
-
Name: '${self:service}-${self:provider.stage}-admin-scripts',
|
|
190
|
-
},
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
result.environment.SCHEDULER_ROLE_ARN = { 'Fn::GetAtt': ['AdminScriptSchedulerRole', 'Arn'] };
|
|
194
|
-
result.environment.SCHEDULE_GROUP_NAME = { Ref: 'AdminScriptScheduleGroup' };
|
|
195
|
-
|
|
196
|
-
console.log(' ✓ Created EventBridge Scheduler resources');
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
module.exports = { AdminScriptBuilder };
|