@tamyla/clodo-framework 3.1.21 → 3.1.22
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/CHANGELOG.md +9 -0
- package/README.md +53 -0
- package/dist/bin/clodo-service.js +47 -15
- package/dist/bin/commands/deploy.js +115 -83
- package/dist/bin/commands/helpers/deployment-ui.js +138 -0
- package/dist/bin/commands/helpers/deployment-verification.js +251 -0
- package/dist/bin/commands/helpers/error-recovery.js +80 -0
- package/dist/bin/commands/helpers/resource-detection.js +113 -0
- package/dist/bin/commands/validate.js +1 -1
- package/dist/bin/security/security-cli.js +1 -1
- package/dist/bin/shared/cache/configuration-cache.js +82 -0
- package/dist/bin/shared/cloudflare/domain-manager.js +1 -1
- package/dist/bin/shared/cloudflare/index.js +1 -1
- package/dist/bin/shared/cloudflare/ops.js +6 -4
- package/dist/bin/shared/config/ConfigurationManager.js +23 -1
- package/dist/bin/shared/config/command-config-manager.js +19 -3
- package/dist/bin/shared/config/index.js +1 -1
- package/dist/bin/shared/deployment/credential-collector.js +30 -7
- package/dist/bin/shared/deployment/index.js +2 -2
- package/dist/bin/shared/deployment/rollback-manager.js +4 -520
- package/dist/bin/shared/deployment/utilities/d1-error-recovery.js +177 -0
- package/dist/bin/shared/deployment/validator.js +40 -10
- package/dist/bin/shared/deployment/workflows/deployment-summary.js +214 -0
- package/dist/bin/shared/deployment/workflows/interactive-confirmation.js +188 -0
- package/dist/bin/shared/deployment/workflows/interactive-database-workflow.js +234 -0
- package/dist/bin/shared/deployment/workflows/interactive-domain-info-gatherer.js +240 -0
- package/dist/bin/shared/deployment/workflows/interactive-secret-workflow.js +228 -0
- package/dist/bin/shared/deployment/workflows/interactive-testing-workflow.js +235 -0
- package/dist/bin/shared/deployment/workflows/interactive-validation.js +218 -0
- package/dist/bin/shared/error-handling/error-classifier.js +46 -0
- package/dist/bin/shared/monitoring/health-checker.js +129 -1
- package/dist/bin/shared/monitoring/memory-manager.js +17 -6
- package/dist/bin/shared/routing/domain-router.js +1 -1
- package/dist/bin/shared/utils/deployment-validator.js +97 -0
- package/dist/bin/shared/utils/formatters.js +10 -0
- package/dist/bin/shared/utils/index.js +13 -1
- package/dist/bin/shared/utils/interactive-prompts.js +34 -18
- package/dist/bin/shared/utils/progress-manager.js +2 -2
- package/dist/bin/shared/utils/progress-spinner.js +53 -0
- package/dist/bin/shared/utils/sensitive-redactor.js +91 -0
- package/dist/bin/shared/validation/ValidationRegistry.js +1 -1
- package/dist/security/index.js +1 -1
- package/dist/security/patterns/insecure-patterns.js +1 -1
- package/dist/utils/constants.js +102 -0
- package/dist/utils/deployment/wrangler-config-manager.js +215 -48
- package/dist/utils/framework-config.js +2 -2
- package/dist/utils/interactive-prompts.js +10 -59
- package/package.json +16 -8
- package/dist/bin/clodo-service-old.js +0 -868
- package/dist/bin/clodo-service-test.js +0 -10
- package/dist/bin/commands/assess.js +0 -91
- package/dist/bin/commands/create.js +0 -77
- package/dist/bin/commands/diagnose.js +0 -83
- package/dist/bin/commands/helpers.js +0 -138
- package/dist/bin/commands/update.js +0 -75
- package/dist/bin/database/deployment-db-manager.js +0 -423
- package/dist/bin/database/enterprise-db-manager.js +0 -457
- package/dist/bin/database/wrangler-d1-manager.js +0 -685
- package/dist/bin/deployment/enterprise-deploy.js +0 -877
- package/dist/bin/deployment/master-deploy.js +0 -1376
- package/dist/bin/deployment/modular-enterprise-deploy.js +0 -466
- package/dist/bin/deployment/modules/DeploymentConfiguration.js +0 -395
- package/dist/bin/deployment/modules/DeploymentOrchestrator.js +0 -492
- package/dist/bin/deployment/modules/EnvironmentManager.js +0 -517
- package/dist/bin/deployment/modules/MonitoringIntegration.js +0 -560
- package/dist/bin/deployment/modules/ValidationManager.js +0 -342
- package/dist/bin/deployment/orchestration/BaseDeploymentOrchestrator.js +0 -426
- package/dist/bin/deployment/orchestration/EnterpriseOrchestrator.js +0 -401
- package/dist/bin/deployment/orchestration/PortfolioOrchestrator.js +0 -273
- package/dist/bin/deployment/orchestration/SingleServiceOrchestrator.js +0 -231
- package/dist/bin/deployment/orchestration/UnifiedDeploymentOrchestrator.js +0 -662
- package/dist/bin/deployment/test-interactive-utils.js +0 -66
- package/dist/bin/portfolio/portfolio-manager.js +0 -487
- package/dist/bin/service-management/create-service.js +0 -122
- package/dist/bin/service-management/init-service.js +0 -79
- package/dist/config/customers.js +0 -623
- package/dist/config/domains.js +0 -186
- package/dist/config/index.js +0 -6
- package/dist/database/database-orchestrator.js +0 -795
- package/dist/database/index.js +0 -4
- package/dist/deployment/index.js +0 -11
- package/dist/deployment/orchestration/BaseDeploymentOrchestrator.js +0 -426
- package/dist/deployment/orchestration/EnterpriseOrchestrator.js +0 -401
- package/dist/deployment/orchestration/PortfolioOrchestrator.js +0 -273
- package/dist/deployment/orchestration/SingleServiceOrchestrator.js +0 -231
- package/dist/deployment/orchestration/UnifiedDeploymentOrchestrator.js +0 -662
- package/dist/deployment/orchestration/index.js +0 -17
- package/dist/deployment/rollback-manager.js +0 -36
- package/dist/deployment/wrangler-deployer.js +0 -640
- package/dist/handlers/GenericRouteHandler.js +0 -532
- package/dist/migration/MigrationAdapters.js +0 -562
- package/dist/modules/ModuleManager.js +0 -668
- package/dist/modules/security.js +0 -96
- package/dist/orchestration/cross-domain-coordinator.js +0 -1083
- package/dist/orchestration/index.js +0 -5
- package/dist/orchestration/modules/DeploymentCoordinator.js +0 -368
- package/dist/orchestration/modules/DomainResolver.js +0 -198
- package/dist/orchestration/modules/StateManager.js +0 -332
- package/dist/orchestration/multi-domain-orchestrator.js +0 -724
- package/dist/routing/EnhancedRouter.js +0 -158
- package/dist/schema/SchemaManager.js +0 -778
- package/dist/service-management/ConfirmationEngine.js +0 -412
- package/dist/service-management/ErrorTracker.js +0 -299
- package/dist/service-management/GenerationEngine.js +0 -447
- package/dist/service-management/InputCollector.js +0 -619
- package/dist/service-management/ServiceCreator.js +0 -265
- package/dist/service-management/ServiceInitializer.js +0 -453
- package/dist/service-management/ServiceOrchestrator.js +0 -633
- package/dist/service-management/generators/BaseGenerator.js +0 -233
- package/dist/service-management/generators/GeneratorRegistry.js +0 -254
- package/dist/service-management/generators/cicd/CiWorkflowGenerator.js +0 -87
- package/dist/service-management/generators/cicd/DeployWorkflowGenerator.js +0 -106
- package/dist/service-management/generators/code/ServiceHandlersGenerator.js +0 -235
- package/dist/service-management/generators/code/ServiceMiddlewareGenerator.js +0 -116
- package/dist/service-management/generators/code/ServiceUtilsGenerator.js +0 -246
- package/dist/service-management/generators/code/WorkerIndexGenerator.js +0 -143
- package/dist/service-management/generators/config/DevelopmentEnvGenerator.js +0 -101
- package/dist/service-management/generators/config/DomainsConfigGenerator.js +0 -175
- package/dist/service-management/generators/config/EnvExampleGenerator.js +0 -178
- package/dist/service-management/generators/config/ProductionEnvGenerator.js +0 -97
- package/dist/service-management/generators/config/StagingEnvGenerator.js +0 -97
- package/dist/service-management/generators/config/WranglerTomlGenerator.js +0 -238
- package/dist/service-management/generators/core/PackageJsonGenerator.js +0 -243
- package/dist/service-management/generators/core/SiteConfigGenerator.js +0 -115
- package/dist/service-management/generators/documentation/ApiDocsGenerator.js +0 -331
- package/dist/service-management/generators/documentation/ConfigurationDocsGenerator.js +0 -294
- package/dist/service-management/generators/documentation/DeploymentDocsGenerator.js +0 -244
- package/dist/service-management/generators/documentation/ReadmeGenerator.js +0 -196
- package/dist/service-management/generators/schemas/ServiceSchemaGenerator.js +0 -190
- package/dist/service-management/generators/scripts/DeployScriptGenerator.js +0 -123
- package/dist/service-management/generators/scripts/HealthCheckScriptGenerator.js +0 -101
- package/dist/service-management/generators/scripts/SetupScriptGenerator.js +0 -88
- package/dist/service-management/generators/service-types/StaticSiteGenerator.js +0 -342
- package/dist/service-management/generators/testing/EslintConfigGenerator.js +0 -85
- package/dist/service-management/generators/testing/IntegrationTestsGenerator.js +0 -237
- package/dist/service-management/generators/testing/JestConfigGenerator.js +0 -72
- package/dist/service-management/generators/testing/UnitTestsGenerator.js +0 -277
- package/dist/service-management/generators/tooling/DockerComposeGenerator.js +0 -71
- package/dist/service-management/generators/tooling/GitignoreGenerator.js +0 -143
- package/dist/service-management/generators/utils/FileWriter.js +0 -179
- package/dist/service-management/generators/utils/PathResolver.js +0 -157
- package/dist/service-management/generators/utils/ServiceManifestGenerator.js +0 -111
- package/dist/service-management/generators/utils/TemplateEngine.js +0 -185
- package/dist/service-management/generators/utils/index.js +0 -18
- package/dist/service-management/handlers/ConfirmationHandler.js +0 -71
- package/dist/service-management/handlers/GenerationHandler.js +0 -80
- package/dist/service-management/handlers/InputHandler.js +0 -59
- package/dist/service-management/handlers/ValidationHandler.js +0 -203
- package/dist/service-management/index.js +0 -14
- package/dist/service-management/routing/DomainRouteMapper.js +0 -311
- package/dist/service-management/routing/RouteGenerator.js +0 -266
- package/dist/service-management/routing/WranglerRoutesBuilder.js +0 -273
- package/dist/service-management/routing/index.js +0 -14
- package/dist/service-management/services/DirectoryStructureService.js +0 -56
- package/dist/service-management/services/GenerationCoordinator.js +0 -208
- package/dist/service-management/services/GeneratorRegistry.js +0 -174
- package/dist/services/GenericDataService.js +0 -501
- package/dist/ui-structures/concepts/second-order-acquisition-strategy.md +0 -286
- package/dist/ui-structures/concepts/service-lifecycle-management.md +0 -150
- package/dist/ui-structures/concepts/service-manifest-guide.md +0 -309
- package/dist/ui-structures/concepts/three-tier-categorization-strategy.md +0 -231
- package/dist/ui-structures/creation/automated-generation-ui.json +0 -246
- package/dist/ui-structures/creation/core-inputs-ui.json +0 -217
- package/dist/ui-structures/creation/smart-confirmable-ui.json +0 -451
- package/dist/ui-structures/reference/absolutely-required-inputs.json +0 -315
- package/dist/ui-structures/reference/service-manifest-template.json +0 -342
- package/dist/version/VersionDetector.js +0 -723
- package/dist/worker/index.js +0 -4
- package/dist/worker/integration.js +0 -351
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single Service Orchestrator
|
|
3
|
-
*
|
|
4
|
-
* Handles orchestration for single-service deployments (modular/standalone services).
|
|
5
|
-
* Optimized for simple, direct deployments without complex multi-service coordination.
|
|
6
|
-
*
|
|
7
|
-
* Phase Implementation:
|
|
8
|
-
* 1. Initialize - Setup single service environment
|
|
9
|
-
* 2. Validate - Validate service prerequisites
|
|
10
|
-
* 3. Prepare - Prepare service resources
|
|
11
|
-
* 4. Deploy - Deploy single service
|
|
12
|
-
* 5. Verify - Verify service deployment
|
|
13
|
-
* 6. Monitor - Setup monitoring for service
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import { BaseDeploymentOrchestrator } from './BaseDeploymentOrchestrator.js';
|
|
17
|
-
export class SingleServiceOrchestrator extends BaseDeploymentOrchestrator {
|
|
18
|
-
/**
|
|
19
|
-
* Constructor for single service orchestrator
|
|
20
|
-
* @param {Object} options - Configuration options
|
|
21
|
-
* @param {string} options.deploymentId - Unique deployment identifier
|
|
22
|
-
* @param {Object} options.config - Service configuration
|
|
23
|
-
* @param {string} options.config.domain - Service domain
|
|
24
|
-
* @param {string} options.config.environment - Deployment environment
|
|
25
|
-
* @param {Object} options.auditor - Deployment auditor (optional)
|
|
26
|
-
*/
|
|
27
|
-
constructor(options = {}) {
|
|
28
|
-
super(options);
|
|
29
|
-
this.orchestratorType = 'single-service';
|
|
30
|
-
this.serviceConfig = options.config || {};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Initialization Phase
|
|
35
|
-
* Setup single service environment and validate prerequisites
|
|
36
|
-
*/
|
|
37
|
-
async onInitialize() {
|
|
38
|
-
console.log(' 🚀 Initializing single service environment');
|
|
39
|
-
const initialization = {
|
|
40
|
-
timestamp: new Date().toISOString(),
|
|
41
|
-
service: this.serviceConfig.domain || 'unnamed',
|
|
42
|
-
environment: this.serviceConfig.environment || 'development',
|
|
43
|
-
features: ['modular-deployment', 'single-service', 'lightweight']
|
|
44
|
-
};
|
|
45
|
-
console.log(` ✅ Service: ${initialization.service}`);
|
|
46
|
-
console.log(` ✅ Environment: ${initialization.environment}`);
|
|
47
|
-
console.log(` ✅ Features: ${initialization.features.join(', ')}`);
|
|
48
|
-
return {
|
|
49
|
-
status: 'initialized',
|
|
50
|
-
orchestratorType: this.orchestratorType,
|
|
51
|
-
...initialization
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Validation Phase
|
|
57
|
-
* Validate service prerequisites and configuration
|
|
58
|
-
*/
|
|
59
|
-
async onValidation() {
|
|
60
|
-
console.log(' 🔍 Validating service prerequisites');
|
|
61
|
-
const validation = {
|
|
62
|
-
checks: {
|
|
63
|
-
authentication: true,
|
|
64
|
-
configuration: true,
|
|
65
|
-
resources: true,
|
|
66
|
-
permissions: true
|
|
67
|
-
},
|
|
68
|
-
warnings: []
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// Validate domain configuration
|
|
72
|
-
if (!this.serviceConfig.domain) {
|
|
73
|
-
validation.warnings.push('Domain not specified, using default');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Validate environment
|
|
77
|
-
const validEnvironments = ['development', 'staging', 'production'];
|
|
78
|
-
if (!validEnvironments.includes(this.serviceConfig.environment)) {
|
|
79
|
-
validation.warnings.push(`Environment "${this.serviceConfig.environment}" not standard`);
|
|
80
|
-
}
|
|
81
|
-
console.log(` ✅ Authentication: ${validation.checks.authentication ? 'passed' : 'failed'}`);
|
|
82
|
-
console.log(` ✅ Configuration: ${validation.checks.configuration ? 'passed' : 'failed'}`);
|
|
83
|
-
console.log(` ✅ Resources: ${validation.checks.resources ? 'passed' : 'failed'}`);
|
|
84
|
-
console.log(` ✅ Permissions: ${validation.checks.permissions ? 'passed' : 'failed'}`);
|
|
85
|
-
return {
|
|
86
|
-
status: 'validated',
|
|
87
|
-
allChecksPassed: Object.values(validation.checks).every(v => v),
|
|
88
|
-
checks: validation.checks,
|
|
89
|
-
warnings: validation.warnings
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Preparation Phase
|
|
95
|
-
* Prepare service resources for deployment
|
|
96
|
-
*/
|
|
97
|
-
async onPrepare() {
|
|
98
|
-
console.log(' 📦 Preparing service resources');
|
|
99
|
-
const resources = {
|
|
100
|
-
worker: {
|
|
101
|
-
status: 'prepared',
|
|
102
|
-
location: 'dist/worker.js'
|
|
103
|
-
},
|
|
104
|
-
database: {
|
|
105
|
-
status: 'prepared',
|
|
106
|
-
name: this.serviceConfig.domain || 'default_db'
|
|
107
|
-
},
|
|
108
|
-
secrets: {
|
|
109
|
-
status: 'prepared',
|
|
110
|
-
count: 5
|
|
111
|
-
},
|
|
112
|
-
configuration: {
|
|
113
|
-
status: 'prepared',
|
|
114
|
-
cached: true
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
console.log(` ✅ Worker: ${resources.worker.location}`);
|
|
118
|
-
console.log(` ✅ Database: ${resources.database.name}`);
|
|
119
|
-
console.log(` ✅ Secrets: ${resources.secrets.count} configured`);
|
|
120
|
-
console.log(` ✅ Configuration: cached and validated`);
|
|
121
|
-
return {
|
|
122
|
-
status: 'prepared',
|
|
123
|
-
resources,
|
|
124
|
-
readyForDeployment: true
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Deployment Phase
|
|
130
|
-
* Execute single service deployment
|
|
131
|
-
*/
|
|
132
|
-
async onDeploy() {
|
|
133
|
-
console.log(' 🚀 Deploying single service');
|
|
134
|
-
const deployment = {
|
|
135
|
-
status: 'deployed',
|
|
136
|
-
service: this.serviceConfig.domain || 'service',
|
|
137
|
-
version: '1.0.0',
|
|
138
|
-
url: `https://${this.serviceConfig.domain || 'localhost'}`,
|
|
139
|
-
timestamp: new Date().toISOString(),
|
|
140
|
-
duration: '2.5s'
|
|
141
|
-
};
|
|
142
|
-
console.log(` ✅ Service deployed: ${deployment.service}`);
|
|
143
|
-
console.log(` ✅ Version: ${deployment.version}`);
|
|
144
|
-
console.log(` ✅ URL: ${deployment.url}`);
|
|
145
|
-
console.log(` ✅ Duration: ${deployment.duration}`);
|
|
146
|
-
return deployment;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Verification Phase
|
|
151
|
-
* Verify single service deployment success
|
|
152
|
-
*/
|
|
153
|
-
async onVerify() {
|
|
154
|
-
console.log(' ✔️ Verifying deployment');
|
|
155
|
-
const verification = {
|
|
156
|
-
status: 'verified',
|
|
157
|
-
healthCheck: 'passed',
|
|
158
|
-
endpoints: {
|
|
159
|
-
main: {
|
|
160
|
-
status: 'ok',
|
|
161
|
-
responseTime: '125ms'
|
|
162
|
-
},
|
|
163
|
-
health: {
|
|
164
|
-
status: 'ok',
|
|
165
|
-
responseTime: '45ms'
|
|
166
|
-
},
|
|
167
|
-
metrics: {
|
|
168
|
-
status: 'ok',
|
|
169
|
-
responseTime: '78ms'
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
uptime: '100%',
|
|
173
|
-
errorRate: '0%'
|
|
174
|
-
};
|
|
175
|
-
console.log(` ✅ Health check: ${verification.healthCheck}`);
|
|
176
|
-
console.log(` ✅ Uptime: ${verification.uptime}`);
|
|
177
|
-
console.log(` ✅ Error rate: ${verification.errorRate}`);
|
|
178
|
-
return verification;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Monitoring Phase
|
|
183
|
-
* Setup monitoring and alerting for deployed service
|
|
184
|
-
*/
|
|
185
|
-
async onMonitor() {
|
|
186
|
-
console.log(' 📊 Setting up monitoring and alerts');
|
|
187
|
-
const monitoring = {
|
|
188
|
-
status: 'monitoring_enabled',
|
|
189
|
-
alerts: [{
|
|
190
|
-
name: 'error_rate',
|
|
191
|
-
threshold: '> 1%',
|
|
192
|
-
enabled: true
|
|
193
|
-
}, {
|
|
194
|
-
name: 'latency',
|
|
195
|
-
threshold: '> 500ms',
|
|
196
|
-
enabled: true
|
|
197
|
-
}, {
|
|
198
|
-
name: 'memory',
|
|
199
|
-
threshold: '> 80%',
|
|
200
|
-
enabled: true
|
|
201
|
-
}, {
|
|
202
|
-
name: 'cpu',
|
|
203
|
-
threshold: '> 75%',
|
|
204
|
-
enabled: true
|
|
205
|
-
}],
|
|
206
|
-
dashboards: ['overview', 'performance', 'errors'],
|
|
207
|
-
logLevel: 'info',
|
|
208
|
-
retentionDays: 7
|
|
209
|
-
};
|
|
210
|
-
console.log(` ✅ Alerts enabled: ${monitoring.alerts.length}`);
|
|
211
|
-
console.log(` ✅ Dashboards: ${monitoring.dashboards.join(', ')}`);
|
|
212
|
-
console.log(` ✅ Log retention: ${monitoring.retentionDays} days`);
|
|
213
|
-
return monitoring;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Get orchestrator metadata
|
|
218
|
-
* @returns {Object} Metadata about this orchestrator
|
|
219
|
-
*/
|
|
220
|
-
getMetadata() {
|
|
221
|
-
return {
|
|
222
|
-
type: this.orchestratorType,
|
|
223
|
-
name: 'SingleServiceOrchestrator',
|
|
224
|
-
deploymentType: 'single-service',
|
|
225
|
-
capabilities: ['modular-deployment', 'lightweight', 'fast-iteration', 'simple-rollback'],
|
|
226
|
-
maxPhases: 6,
|
|
227
|
-
averageDeploymentTime: '2-5 minutes'
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
export default SingleServiceOrchestrator;
|