@tamyla/clodo-framework 3.1.9 → 3.1.11

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 (75) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/bin/clodo-service-old.js +2 -2
  3. package/dist/bin/commands/create.js +1 -1
  4. package/dist/bin/commands/diagnose.js +1 -1
  5. package/dist/bin/commands/update.js +1 -1
  6. package/dist/bin/commands/validate.js +1 -1
  7. package/dist/bin/database/enterprise-db-manager.js +4 -4
  8. package/dist/bin/deployment/enterprise-deploy.js +3 -3
  9. package/dist/bin/deployment/master-deploy.js +3 -3
  10. package/dist/bin/deployment/modular-enterprise-deploy.js +3 -3
  11. package/dist/bin/deployment/modules/DeploymentOrchestrator.js +1 -1
  12. package/dist/bin/deployment/modules/EnvironmentManager.js +2 -2
  13. package/dist/bin/portfolio/portfolio-manager.js +3 -3
  14. package/dist/bin/security/security-cli.js +1 -1
  15. package/dist/bin/service-management/create-service.js +1 -1
  16. package/dist/bin/service-management/init-service.js +1 -1
  17. package/dist/bin/shared/cloudflare/domain-manager.js +1 -1
  18. package/dist/bin/shared/config/index.js +1 -1
  19. package/dist/bin/shared/deployment/index.js +2 -2
  20. package/dist/bin/shared/validation/ValidationRegistry.js +1 -1
  21. package/package.json +1 -6
  22. package/bin/README.md +0 -71
  23. package/bin/clodo-service.js +0 -72
  24. package/bin/database/README.md +0 -33
  25. package/bin/database/deployment-db-manager.js +0 -527
  26. package/bin/database/enterprise-db-manager.js +0 -738
  27. package/bin/database/wrangler-d1-manager.js +0 -775
  28. package/bin/security/security-cli.js +0 -117
  29. package/bin/service-management/README.md +0 -74
  30. package/bin/service-management/create-service.js +0 -129
  31. package/bin/service-management/init-service.js +0 -103
  32. package/bin/service-management/init-service.js.backup +0 -889
  33. package/bin/shared/cloudflare/domain-discovery.js +0 -637
  34. package/bin/shared/cloudflare/domain-manager.js +0 -952
  35. package/bin/shared/cloudflare/index.js +0 -8
  36. package/bin/shared/cloudflare/ops.js +0 -401
  37. package/bin/shared/config/ConfigurationManager.js +0 -539
  38. package/bin/shared/config/cache.js +0 -1230
  39. package/bin/shared/config/command-config-manager.js +0 -184
  40. package/bin/shared/config/index.js +0 -21
  41. package/bin/shared/config/manager.js +0 -315
  42. package/bin/shared/database/connection-manager.js +0 -374
  43. package/bin/shared/database/index.js +0 -7
  44. package/bin/shared/database/orchestrator.js +0 -727
  45. package/bin/shared/deployment/auditor.js +0 -970
  46. package/bin/shared/deployment/index.js +0 -10
  47. package/bin/shared/deployment/rollback-manager.js +0 -570
  48. package/bin/shared/deployment/validator.js +0 -779
  49. package/bin/shared/index.js +0 -32
  50. package/bin/shared/logging/Logger.js +0 -214
  51. package/bin/shared/monitoring/health-checker.js +0 -484
  52. package/bin/shared/monitoring/index.js +0 -8
  53. package/bin/shared/monitoring/memory-manager.js +0 -387
  54. package/bin/shared/monitoring/production-monitor.js +0 -403
  55. package/bin/shared/production-tester/api-tester.js +0 -82
  56. package/bin/shared/production-tester/auth-tester.js +0 -132
  57. package/bin/shared/production-tester/core.js +0 -197
  58. package/bin/shared/production-tester/database-tester.js +0 -109
  59. package/bin/shared/production-tester/index.js +0 -77
  60. package/bin/shared/production-tester/load-tester.js +0 -131
  61. package/bin/shared/production-tester/performance-tester.js +0 -103
  62. package/bin/shared/security/api-token-manager.js +0 -312
  63. package/bin/shared/security/index.js +0 -8
  64. package/bin/shared/security/secret-generator.js +0 -942
  65. package/bin/shared/security/secure-token-manager.js +0 -398
  66. package/bin/shared/utils/ErrorHandler.js +0 -675
  67. package/bin/shared/utils/error-recovery.js +0 -245
  68. package/bin/shared/utils/file-manager.js +0 -162
  69. package/bin/shared/utils/formatters.js +0 -247
  70. package/bin/shared/utils/graceful-shutdown-manager.js +0 -390
  71. package/bin/shared/utils/index.js +0 -19
  72. package/bin/shared/utils/interactive-prompts.js +0 -146
  73. package/bin/shared/utils/interactive-utils.js +0 -530
  74. package/bin/shared/utils/rate-limiter.js +0 -246
  75. package/bin/shared/validation/ValidationRegistry.js +0 -143
@@ -1,117 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { SecurityCLI } from '../../dist/security/SecurityCLI.js';
4
-
5
- const command = process.argv[2];
6
- const args = process.argv.slice(3);
7
-
8
- async function main() {
9
- const cli = new SecurityCLI();
10
-
11
- switch (command) {
12
- case 'validate':
13
- const [customer, environment] = args;
14
- const result = await cli.validateConfiguration(customer, environment);
15
- if (result.valid) {
16
- console.log('āœ… Security validation passed');
17
- } else {
18
- console.log('āŒ Security issues found');
19
- result.securityIssues.forEach(issue => {
20
- console.log(` ${issue.severity.toUpperCase()}: ${issue.message}`);
21
- });
22
- }
23
- process.exit(result.valid ? 0 : 1);
24
- break;
25
-
26
- case 'generate-key':
27
- const [type, lengthStr] = args;
28
- const length = lengthStr ? parseInt(lengthStr) : undefined;
29
- const keyResult = cli.generateKey(type, length);
30
- if (keyResult.success) {
31
- console.log(`Generated ${keyResult.type}: ${keyResult.key}`);
32
- } else {
33
- console.error(`Key generation failed: ${keyResult.error}`);
34
- process.exit(1);
35
- }
36
- break;
37
-
38
- case 'deploy':
39
- // Check for help flag first
40
- if (args.includes('--help') || args.includes('-h')) {
41
- console.log('Deploy with security validation');
42
- console.log('');
43
- console.log('Usage:');
44
- console.log(' clodo-security deploy <customer> <environment> [options]');
45
- console.log('');
46
- console.log('Arguments:');
47
- console.log(' customer Customer name (e.g., wetechfounders)');
48
- console.log(' environment Target environment (development, staging, production)');
49
- console.log('');
50
- console.log('Options:');
51
- console.log(' --dry-run Simulate deployment without making changes');
52
- console.log(' --help, -h Display this help message');
53
- console.log('');
54
- console.log('Examples:');
55
- console.log(' clodo-security deploy wetechfounders development');
56
- console.log(' clodo-security deploy greatidude production --dry-run');
57
- break;
58
- }
59
-
60
- const [deployCustomer, deployEnvironment] = args.filter(arg => !arg.startsWith('--'));
61
- const dryRun = args.includes('--dry-run');
62
- const deployResult = await cli.deployWithSecurity(deployCustomer, deployEnvironment, { dryRun });
63
- if (deployResult.success) {
64
- console.log(`āœ… Deployment ${dryRun ? 'validation' : 'completed'} successfully`);
65
- } else {
66
- console.error(`Deployment failed: ${deployResult.error}`);
67
- process.exit(1);
68
- }
69
- break;
70
-
71
- case 'generate-config':
72
- const [configCustomer, configEnvironment] = args;
73
- const configResult = cli.generateSecureConfig(configCustomer, configEnvironment);
74
- if (configResult.success) {
75
- console.log('Generated secure configuration:');
76
- console.log(JSON.stringify(configResult.config, null, 2));
77
- } else {
78
- console.error(`Config generation failed: ${configResult.error}`);
79
- process.exit(1);
80
- }
81
- break;
82
-
83
- case 'check-readiness':
84
- const [readyCustomer, readyEnvironment] = args;
85
- const readinessResult = cli.checkDeploymentReadiness(readyCustomer, readyEnvironment);
86
- if (readinessResult.ready) {
87
- console.log('āœ… Deployment ready');
88
- } else {
89
- console.log('āŒ Deployment not ready:');
90
- readinessResult.issues.forEach(issue => console.log(` - ${issue}`));
91
- process.exit(1);
92
- }
93
- break;
94
-
95
- default:
96
- console.log('Clodo Framework Security CLI');
97
- console.log('');
98
- console.log('Commands:');
99
- console.log(' validate <customer> <environment> - Validate configuration security');
100
- console.log(' generate-key [type] [length] - Generate secure key (api/jwt)');
101
- console.log(' deploy <customer> <environment> - Deploy with security validation');
102
- console.log(' generate-config <customer> <env> - Generate secure configuration');
103
- console.log(' check-readiness <customer> <env> - Check deployment readiness');
104
- console.log('');
105
- console.log('Examples:');
106
- console.log(' clodo-security validate tamyla production');
107
- console.log(' clodo-security generate-key jwt 64');
108
- console.log(' clodo-security generate-key content-skimmer');
109
- console.log(' clodo-security deploy tamyla staging --dry-run');
110
- break;
111
- }
112
- }
113
-
114
- main().catch(error => {
115
- console.error(`Unexpected error: ${error.message}`);
116
- process.exit(1);
117
- });
@@ -1,74 +0,0 @@
1
- # Service Management Tools
2
-
3
- Command-line tools for creating and initializing Clodo Framework services.
4
-
5
- ## Tools
6
-
7
- ### create-service.js
8
- Create new services from predefined templates.
9
-
10
- **Features:**
11
- - Multiple service types (data-service, auth-service, content-service, api-gateway, generic)
12
- - Template-based service generation
13
- - Customizable service configurations
14
- - Automatic directory structure creation
15
-
16
- **Usage:**
17
- ```bash
18
- node bin/service-management/create-service.js my-service --type api-gateway --output ./services
19
- ```
20
-
21
- **Options:**
22
- - `-t, --type <type>` - Service type (default: generic)
23
- - `-o, --output <path>` - Output directory (default: current directory)
24
- - `-f, --force` - Overwrite existing service directory
25
- - `-h, --help` - Show help message
26
-
27
- ### init-service.js
28
- Initialize services with auto-generated configurations and multi-domain support.
29
-
30
- **Features:**
31
- - Auto-generated wrangler.toml configurations
32
- - Domain-specific settings for multiple domains
33
- - Service type detection and optimization
34
- - Cloudflare account and zone integration
35
- - Multi-domain deployment support
36
-
37
- **Usage:**
38
- ```bash
39
- # Single domain
40
- node bin/service-management/init-service.js my-service --type api-gateway --domains api.example.com
41
-
42
- # Multiple domains with account/zone info
43
- node bin/service-management/init-service.js my-service --type api-gateway \
44
- --domains "api.example.com:account1:zone1,staging.example.com:account2:zone2"
45
- ```
46
-
47
- **Options:**
48
- - `-t, --type <type>` - Service type (default: generic)
49
- - `-d, --domains <domains>` - Comma-separated domains (can include account:zone)
50
- - `-e, --env <environment>` - Target environment (default: development)
51
- - `--api-token <token>` - Cloudflare API token for domain discovery
52
- - `--account-id <id>` - Default Cloudflare account ID
53
- - `--zone-id <id>` - Default Cloudflare zone ID
54
- - `-o, --output <path>` - Output directory (services created in services/ subdirectory)
55
- - `-f, --force` - Overwrite existing service directory
56
- - `--dry-run` - Show what would be created without creating files
57
- - `--multi-domain` - Generate configurations for multiple domains
58
-
59
- ## Directory Structure
60
-
61
- Services are automatically organized as:
62
-
63
- ```
64
- your-project/
65
- ā”œā”€ā”€ services/ # Auto-created services directory
66
- │ ā”œā”€ā”€ my-api-service/ # Individual service directories
67
- │ │ ā”œā”€ā”€ wrangler.toml # Cloudflare config
68
- │ │ ā”œā”€ā”€ src/config/domains.js # Domain configurations
69
- │ │ ā”œā”€ā”€ src/worker/index.js # Service worker
70
- │ │ └── package.json # Dependencies
71
- │ ā”œā”€ā”€ auth-service/ # Another service
72
- │ └── data-service/ # Another service
73
- └── other-project-files/
74
- ```
@@ -1,129 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Clodo Framework - Service Template Generator
5
- * Creates new ser console.log(`āœ“ Using Clodo Framework ServiceCreator module`);ices from predefined templates
6
- */
7
-
8
- import { ServiceCreator } from '../../dist/service-management/ServiceCreator.js';
9
-
10
- const SERVICE_TYPES = ['data-service', 'auth-service', 'content-service', 'api-gateway', 'generic'];
11
-
12
- function showUsage() {
13
- console.log(`
14
- Clodo Framework - Service Template Generator
15
-
16
- Usage: clodo-create-service <service-name> [options]
17
-
18
- Arguments:
19
- service-name Name of the service to create (required)
20
-
21
- Options:
22
- -t, --type <type> Service type: ${SERVICE_TYPES.join(', ')} (default: generic)
23
- -o, --output <path> Output directory (default: current directory)
24
- -f, --force Overwrite existing service directory
25
- -h, --help Show this help message
26
-
27
- Examples:
28
- clodo-create-service my-data-service --type data-service
29
- clodo-create-service auth-api --type auth-service --output ./services
30
- clodo-create-service my-service --force
31
- `);
32
- }
33
-
34
- function parseArgs(args) {
35
- const options = {
36
- type: 'generic',
37
- output: process.cwd(),
38
- force: false
39
- };
40
-
41
- let serviceName = null;
42
-
43
- for (let i = 0; i < args.length; i++) {
44
- const arg = args[i];
45
-
46
- switch (arg) {
47
- case '-t':
48
- case '--type':
49
- options.type = args[++i];
50
- break;
51
- case '-o':
52
- case '--output':
53
- options.output = args[++i];
54
- break;
55
- case '-f':
56
- case '--force':
57
- options.force = true;
58
- break;
59
- case '-h':
60
- case '--help':
61
- showUsage();
62
- process.exit(0);
63
- break;
64
- default:
65
- if (!arg.startsWith('-') && !serviceName) {
66
- serviceName = arg;
67
- } else {
68
- console.error(`Unknown option: ${arg}`);
69
- showUsage();
70
- process.exit(1);
71
- }
72
- }
73
- }
74
-
75
- if (!serviceName) {
76
- console.error('Error: Service name is required');
77
- showUsage();
78
- process.exit(1);
79
- }
80
-
81
- if (!SERVICE_TYPES.includes(options.type)) {
82
- console.error(`Error: Invalid service type. Must be one of: ${SERVICE_TYPES.join(', ')}`);
83
- process.exit(1);
84
- }
85
-
86
- return { serviceName, options };
87
- }
88
-
89
- // Main execution
90
- async function main() {
91
- try {
92
- const args = process.argv.slice(2);
93
- const { serviceName, options } = parseArgs(args);
94
-
95
- console.log(`šŸš€ Creating ${options.type} service: ${serviceName}`);
96
- console.log(`āœ“ Using Clodo Framework ServiceCreator module`);
97
- console.log('');
98
-
99
- const creator = new ServiceCreator();
100
- const result = await creator.createService(serviceName, options);
101
-
102
- if (result.success) {
103
- console.log('āœ… Service created successfully!');
104
- console.log('');
105
- console.log('šŸ“ Next steps:');
106
- console.log(` cd ${result.serviceDir.split('/').pop() || result.serviceDir.split('\\').pop()}`);
107
- console.log(' npm install');
108
- console.log(' npm run setup # Configure domain and Cloudflare settings');
109
- console.log(' npm run dev # Start development server');
110
- console.log('');
111
- console.log('šŸ“š Documentation:');
112
- console.log(' README.md # Service documentation');
113
- console.log(' API.md # API documentation');
114
- console.log('');
115
- console.log('šŸ”— Useful commands:');
116
- console.log(' npm test # Run tests');
117
- console.log(' npm run deploy # Deploy to Cloudflare');
118
- } else {
119
- console.error('āŒ Service creation failed:', result.error);
120
- process.exit(1);
121
- }
122
- } catch (error) {
123
- console.error('āŒ Unexpected error:', error.message);
124
- process.exit(1);
125
- }
126
- }
127
-
128
- // Run the generator
129
- main();
@@ -1,103 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Clodo Framework - Service Initializer
5
- *
6
- * Initializes a new service with auto-generated configurations,
7
- * eliminating the need for manual wrangler.toml and domains.js setup.
8
- *
9
- * This solves the workflow order problem by making configuration
10
- * generation the first step, not a prerequisite.
11
- */
12
-
13
- import { program } from 'commander';
14
- import { ServiceInitializer } from '../../dist/service-management/ServiceInitializer.js';
15
-
16
- const SERVICE_TYPES = ['generic', 'data-service', 'auth-service', 'content-service', 'api-gateway'];
17
-
18
- class ServiceInitializerCLI {
19
- constructor() {
20
- this.setupCLI();
21
- }
22
-
23
- setupCLI() {
24
- program
25
- .name('clodo-init-service')
26
- .description('Initialize a Clodo Framework service with auto-generated configurations')
27
- .version('1.0.0')
28
- .argument('<service-name>', 'Name of the service to initialize')
29
- .option('-t, --type <type>', 'Service type', 'generic')
30
- .option('-d, --domains <domains>', 'Comma-separated list of domains (can include account info)')
31
- .option('-e, --env <environment>', 'Target environment', 'development')
32
- .option('--api-token <token>', 'Cloudflare API token for domain discovery')
33
- .option('--account-id <id>', 'Default Cloudflare account ID')
34
- .option('--zone-id <id>', 'Default Cloudflare zone ID')
35
- .option('-o, --output <path>', 'Output directory (services will be created in a services/ subdirectory)', process.cwd())
36
- .option('-f, --force', 'Overwrite existing service directory')
37
- .option('--dry-run', 'Show what would be created without creating files')
38
- .option('--multi-domain', 'Generate configurations for multiple domains')
39
- .action((serviceName, options) => {
40
- this.initializeService(serviceName, options);
41
- });
42
-
43
- program.on('--help', () => {
44
- console.log('\nExamples:');
45
- console.log(' clodo-init-service my-api --type api-gateway --domains "api.example.com,staging.example.com"');
46
- console.log(' clodo-init-service data-service --type data-service --api-token $CF_TOKEN');
47
- console.log(' clodo-init-service my-service --env production --account-id $CF_ACCOUNT_ID');
48
- console.log('\nServices are created in: ./services/{service-name}/');
49
- console.log('\nEnvironment Variables:');
50
- console.log(' CLOUDFLARE_API_TOKEN - API token for domain discovery');
51
- console.log(' CLOUDFLARE_ACCOUNT_ID - Account ID for configurations');
52
- console.log(' CLOUDFLARE_ZONE_ID - Zone ID for domain configurations');
53
- });
54
- }
55
-
56
- async initializeService(serviceName, options) {
57
- try {
58
- console.log('šŸš€ Clodo Framework - Service Initializer');
59
- console.log('=' .repeat(50));
60
- console.log('šŸ“¦ Using Clodo Framework ServiceInitializer module');
61
- console.log('');
62
-
63
- const initializer = new ServiceInitializer();
64
- const result = await initializer.initializeService(serviceName, {
65
- type: options.type,
66
- domains: options.domains,
67
- env: options.env,
68
- apiToken: options.apiToken,
69
- accountId: options.accountId,
70
- zoneId: options.zoneId,
71
- output: options.output,
72
- force: options.force,
73
- dryRun: options.dryRun
74
- });
75
-
76
- if (result.success) {
77
- if (result.dryRun) {
78
- console.log('šŸ“‹ Dry run - would create the following:');
79
- const configs = Array.isArray(result.configs) ? result.configs : [result.configs];
80
- console.log('Files:', configs.filter(Boolean).join(', '));
81
- return;
82
- }
83
-
84
- console.log('\nāœ… Service initialized successfully!');
85
- console.log('\nšŸ“ Next steps:');
86
- console.log(` cd services/${serviceName}`);
87
- console.log(' npm install');
88
- console.log(' npm run dev # Start development server');
89
- console.log(' npm run deploy # Deploy to Cloudflare');
90
- } else {
91
- console.error('\nāŒ Initialization failed:', result.error);
92
- process.exit(1);
93
- }
94
- } catch (error) {
95
- console.error('\nāŒ Unexpected error:', error.message);
96
- process.exit(1);
97
- }
98
- }
99
- }
100
-
101
- // Run the CLI
102
- const cli = new ServiceInitializerCLI();
103
- program.parse();