@tamyla/clodo-framework 3.1.10 → 3.1.12

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 (86) 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 +3 -3
  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/validation/ValidationRegistry.js +1 -1
  19. package/dist/deployment/wrangler-deployer.js +1 -1
  20. package/dist/orchestration/cross-domain-coordinator.js +5 -5
  21. package/dist/security/index.js +1 -1
  22. package/dist/service-management/ConfirmationEngine.js +1 -1
  23. package/dist/service-management/ErrorTracker.js +1 -1
  24. package/dist/service-management/InputCollector.js +1 -1
  25. package/dist/service-management/ServiceCreator.js +1 -1
  26. package/dist/service-management/ServiceInitializer.js +1 -1
  27. package/dist/utils/config/unified-config-manager.js +1 -1
  28. package/dist/utils/deployment/config-cache.js +1 -1
  29. package/dist/utils/deployment/secret-generator.js +1 -1
  30. package/dist/utils/framework-config.js +1 -1
  31. package/dist/worker/integration.js +1 -1
  32. package/package.json +1 -6
  33. package/bin/README.md +0 -71
  34. package/bin/clodo-service.js +0 -72
  35. package/bin/database/README.md +0 -33
  36. package/bin/database/deployment-db-manager.js +0 -527
  37. package/bin/database/enterprise-db-manager.js +0 -738
  38. package/bin/database/wrangler-d1-manager.js +0 -775
  39. package/bin/security/security-cli.js +0 -117
  40. package/bin/service-management/README.md +0 -74
  41. package/bin/service-management/create-service.js +0 -129
  42. package/bin/service-management/init-service.js +0 -103
  43. package/bin/service-management/init-service.js.backup +0 -889
  44. package/bin/shared/cloudflare/domain-discovery.js +0 -637
  45. package/bin/shared/cloudflare/domain-manager.js +0 -952
  46. package/bin/shared/cloudflare/index.js +0 -8
  47. package/bin/shared/cloudflare/ops.js +0 -401
  48. package/bin/shared/config/ConfigurationManager.js +0 -539
  49. package/bin/shared/config/cache.js +0 -1230
  50. package/bin/shared/config/command-config-manager.js +0 -184
  51. package/bin/shared/config/index.js +0 -21
  52. package/bin/shared/config/manager.js +0 -315
  53. package/bin/shared/database/connection-manager.js +0 -374
  54. package/bin/shared/database/index.js +0 -7
  55. package/bin/shared/database/orchestrator.js +0 -727
  56. package/bin/shared/deployment/auditor.js +0 -970
  57. package/bin/shared/deployment/index.js +0 -10
  58. package/bin/shared/deployment/rollback-manager.js +0 -570
  59. package/bin/shared/deployment/validator.js +0 -779
  60. package/bin/shared/index.js +0 -32
  61. package/bin/shared/logging/Logger.js +0 -214
  62. package/bin/shared/monitoring/health-checker.js +0 -484
  63. package/bin/shared/monitoring/index.js +0 -8
  64. package/bin/shared/monitoring/memory-manager.js +0 -387
  65. package/bin/shared/monitoring/production-monitor.js +0 -403
  66. package/bin/shared/production-tester/api-tester.js +0 -82
  67. package/bin/shared/production-tester/auth-tester.js +0 -132
  68. package/bin/shared/production-tester/core.js +0 -197
  69. package/bin/shared/production-tester/database-tester.js +0 -109
  70. package/bin/shared/production-tester/index.js +0 -77
  71. package/bin/shared/production-tester/load-tester.js +0 -131
  72. package/bin/shared/production-tester/performance-tester.js +0 -103
  73. package/bin/shared/security/api-token-manager.js +0 -312
  74. package/bin/shared/security/index.js +0 -8
  75. package/bin/shared/security/secret-generator.js +0 -942
  76. package/bin/shared/security/secure-token-manager.js +0 -398
  77. package/bin/shared/utils/ErrorHandler.js +0 -675
  78. package/bin/shared/utils/error-recovery.js +0 -245
  79. package/bin/shared/utils/file-manager.js +0 -162
  80. package/bin/shared/utils/formatters.js +0 -247
  81. package/bin/shared/utils/graceful-shutdown-manager.js +0 -390
  82. package/bin/shared/utils/index.js +0 -19
  83. package/bin/shared/utils/interactive-prompts.js +0 -146
  84. package/bin/shared/utils/interactive-utils.js +0 -530
  85. package/bin/shared/utils/rate-limiter.js +0 -246
  86. package/bin/shared/validation/ValidationRegistry.js +0 -143
@@ -1,32 +0,0 @@
1
- /**
2
- * Shared Modules Index
3
- * Organized exports from all shared utility modules
4
- *
5
- * Usage:
6
- * import { DeploymentValidator, CloudflareDomainManager } from '../shared';
7
- * import { ProductionTester } from '../shared/production-tester';
8
- */
9
-
10
- // Cloudflare Integration
11
- export * from './cloudflare/index.js';
12
-
13
- // Deployment Management
14
- export * from './deployment/index.js';
15
-
16
- // Security & Authentication
17
- export * from './security/index.js';
18
-
19
- // Configuration Management
20
- export * from './config/index.js';
21
-
22
- // Database Management
23
- export * from './database/index.js';
24
-
25
- // Monitoring & Health Checks
26
- export * from './monitoring/index.js';
27
-
28
- // General Utilities
29
- export * from './utils/index.js';
30
-
31
- // Production Testing (kept separate due to size)
32
- export { ProductionTester } from './production-tester/index.js';
@@ -1,214 +0,0 @@
1
- /**
2
- * Unified Logger for Clodo Framework
3
- * Replaces: 6 separate logging implementations
4
- * Savings: 300+ lines, unified logging across entire codebase
5
- *
6
- * @version 1.0.0
7
- */
8
-
9
- import { appendFileSync, mkdirSync, existsSync } from 'fs';
10
- import { dirname } from 'path';
11
-
12
- const LOG_LEVELS = {
13
- DEBUG: 0,
14
- INFO: 1,
15
- WARN: 2,
16
- ERROR: 3,
17
- FATAL: 4
18
- };
19
-
20
- export class Logger {
21
- constructor(context = {}) {
22
- this.context = context;
23
- this.logLevel = this._parseLogLevel(process.env.LOG_LEVEL || 'info');
24
- this.logDir = process.env.LOG_DIR || null;
25
- this.logFile = null;
26
- this.cache = new Map();
27
- this.isDev = process.env.NODE_ENV !== 'production';
28
-
29
- if (this.logDir) {
30
- mkdirSync(this.logDir, { recursive: true });
31
- }
32
- }
33
-
34
- /**
35
- * DEBUG level logging
36
- */
37
- debug(message, data = {}) {
38
- if (this.logLevel > LOG_LEVELS.DEBUG) return;
39
- this._log('DEBUG', message, data);
40
- }
41
-
42
- /**
43
- * INFO level logging
44
- */
45
- info(message, data = {}) {
46
- if (this.logLevel > LOG_LEVELS.INFO) return;
47
- this._log('INFO', message, data);
48
- }
49
-
50
- /**
51
- * WARN level logging
52
- */
53
- warn(message, data = {}) {
54
- if (this.logLevel > LOG_LEVELS.WARN) return;
55
- this._log('WARN', message, data);
56
- }
57
-
58
- /**
59
- * ERROR level logging
60
- */
61
- error(message, data = {}) {
62
- if (this.logLevel > LOG_LEVELS.ERROR) return;
63
- this._log('ERROR', message, data);
64
- }
65
-
66
- /**
67
- * FATAL level logging (exits process)
68
- */
69
- fatal(message, data = {}) {
70
- this._log('FATAL', message, data);
71
- if (!this.isDev) {
72
- process.exit(1);
73
- }
74
- }
75
-
76
- /**
77
- * Log HTTP request
78
- */
79
- logRequest(request, context = {}) {
80
- this.info('HTTP Request', {
81
- method: request.method,
82
- url: request.url,
83
- userAgent: request.headers?.get?.('User-Agent'),
84
- ...context
85
- });
86
- }
87
-
88
- /**
89
- * Log deployment event
90
- */
91
- logDeployment(deploymentId, message, context = {}) {
92
- this.info(`[Deployment ${deploymentId}] ${message}`, {
93
- deploymentId,
94
- ...context
95
- });
96
- }
97
-
98
- /**
99
- * Log audit event
100
- */
101
- logAudit(eventType, domain, details = {}) {
102
- this.info(`[Audit] ${eventType} for ${domain}`, {
103
- eventType,
104
- domain,
105
- ...details
106
- });
107
- }
108
-
109
- /**
110
- * Log performance metric
111
- */
112
- logPerformance(operation, durationMs, context = {}) {
113
- const level = durationMs > 5000 ? 'warn' : 'info';
114
- this[level](`Performance: ${operation}`, {
115
- operation,
116
- durationMs,
117
- ...context
118
- });
119
- }
120
-
121
- /**
122
- * Redact sensitive information from text
123
- */
124
- redact(text) {
125
- if (typeof text !== 'string') return text;
126
-
127
- const patterns = [
128
- // Cloudflare tokens
129
- [/(CLOUDFLARE_API_TOKEN=?)(\w{20,})/gi, '$1[REDACTED]'],
130
- // Generic tokens
131
- [/(token|api[_-]?key|auth[_-]?token)["']?[:=]\s*["']?([a-zA-Z0-9_-]{20,})["']?/gi, '$1: [REDACTED]'],
132
- // Passwords
133
- [/(password|passwd|pwd)["']?[:=]\s*["']?([^"'\s]{3,})["']?/gi, '$1: [REDACTED]'],
134
- // Secrets
135
- [/(secret|key)["']?[:=]\s*["']?([a-zA-Z0-9_-]{10,})["']?/gi, '$1: [REDACTED]'],
136
- // Account/Zone IDs (partial)
137
- [/(account[_-]?id|zone[_-]?id)["']?[:=]\s*["']?([a-zA-Z0-9]{8})([a-zA-Z0-9]{24,})["']?/gi, '$1: $2[REDACTED]']
138
- ];
139
-
140
- let redacted = text;
141
- patterns.forEach(([pattern, replacement]) => {
142
- redacted = redacted.replace(pattern, replacement);
143
- });
144
- return redacted;
145
- }
146
-
147
- /**
148
- * Set log file for file output
149
- */
150
- setLogFile(filePath) {
151
- this.logFile = filePath;
152
- const dir = dirname(filePath);
153
- if (!existsSync(dir)) {
154
- mkdirSync(dir, { recursive: true });
155
- }
156
- }
157
-
158
- /**
159
- * Private: Core logging implementation
160
- */
161
- _log(level, message, data = {}) {
162
- const timestamp = new Date().toISOString();
163
- const contextStr = Object.keys(this.context).length > 0
164
- ? ` [${JSON.stringify(this.context)}]`
165
- : '';
166
-
167
- const logMessage = `[${timestamp}] ${level}${contextStr}: ${message}`;
168
- const redactedMessage = this.redact(logMessage);
169
-
170
- // Console output
171
- const display = data && Object.keys(data).length > 0
172
- ? `${redactedMessage} ${this.redact(JSON.stringify(data))}`
173
- : redactedMessage;
174
-
175
- console.log(display);
176
-
177
- // File output
178
- if (this.logFile) {
179
- try {
180
- const fileEntry = JSON.stringify({
181
- timestamp,
182
- level,
183
- message: this.redact(message),
184
- context: this.context,
185
- data: this.redact(JSON.stringify(data))
186
- }) + '\n';
187
-
188
- appendFileSync(this.logFile, fileEntry);
189
- } catch (error) {
190
- console.error('Failed to write to log file:', error.message);
191
- }
192
- }
193
- }
194
-
195
- /**
196
- * Parse log level string to numeric value
197
- */
198
- _parseLogLevel(levelStr) {
199
- const upper = levelStr.toUpperCase();
200
- return LOG_LEVELS[upper] ?? LOG_LEVELS.INFO;
201
- }
202
- }
203
-
204
- /**
205
- * Export singleton logger
206
- */
207
- export const logger = new Logger({ framework: 'clodo' });
208
-
209
- /**
210
- * Backwards compatible factory function (for gradual migration)
211
- */
212
- export const createLogger = (prefix = 'ClodoFramework') => {
213
- return new Logger({ prefix });
214
- };