@tamyla/clodo-framework 2.0.13 → 2.0.15
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
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [2.0.15](https://github.com/tamylaa/clodo-framework/compare/v2.0.14...v2.0.15) (2025-10-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* improve customer selection UX with number support ([2e10d56](https://github.com/tamylaa/clodo-framework/commit/2e10d562061c478ecc238e1185e2514af453d00e))
|
|
7
|
+
|
|
8
|
+
## [2.0.14](https://github.com/tamylaa/clodo-framework/compare/v2.0.13...v2.0.14) (2025-10-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add missing readdirSync import in config-persistence.js ([767efc4](https://github.com/tamylaa/clodo-framework/commit/767efc4aa839c7afa592fe3a1df21b62870bdf23))
|
|
14
|
+
* remove require() calls in ESM modules ([a1783f9](https://github.com/tamylaa/clodo-framework/commit/a1783f9c75c59ae8ce9daacbc223ad80b17d61bc))
|
|
15
|
+
|
|
1
16
|
## [2.0.13](https://github.com/tamylaa/clodo-framework/compare/v2.0.12...v2.0.13) (2025-10-12)
|
|
2
17
|
|
|
3
18
|
|
package/bin/clodo-service.js
CHANGED
|
@@ -516,8 +516,8 @@ program
|
|
|
516
516
|
const customers = configPersistence.getConfiguredCustomers();
|
|
517
517
|
if (customers.length > 0) {
|
|
518
518
|
console.log(chalk.cyan('💡 Configured customers:'));
|
|
519
|
-
customers.forEach(customer => {
|
|
520
|
-
console.log(chalk.white(`
|
|
519
|
+
customers.forEach((customer, index) => {
|
|
520
|
+
console.log(chalk.white(` ${index + 1}. ${customer}`));
|
|
521
521
|
});
|
|
522
522
|
console.log('');
|
|
523
523
|
}
|
|
@@ -527,8 +527,30 @@ program
|
|
|
527
527
|
if (!coreInputs.cloudflareAccountId) {
|
|
528
528
|
console.log(chalk.cyan('📊 Tier 1: Core Input Collection\n'));
|
|
529
529
|
|
|
530
|
-
// Collect basic info
|
|
531
|
-
|
|
530
|
+
// Collect basic info with smart customer selection
|
|
531
|
+
let customer = options.customer;
|
|
532
|
+
if (!customer) {
|
|
533
|
+
const customers = configPersistence.getConfiguredCustomers();
|
|
534
|
+
if (customers.length > 0) {
|
|
535
|
+
const selection = await inputCollector.question('Select customer (enter number or name): ');
|
|
536
|
+
|
|
537
|
+
// Try to parse as number first
|
|
538
|
+
const num = parseInt(selection);
|
|
539
|
+
if (!isNaN(num) && num >= 1 && num <= customers.length) {
|
|
540
|
+
customer = customers[num - 1];
|
|
541
|
+
console.log(chalk.green(`✓ Selected: ${customer}\n`));
|
|
542
|
+
} else if (customers.includes(selection)) {
|
|
543
|
+
customer = selection;
|
|
544
|
+
console.log(chalk.green(`✓ Selected: ${customer}\n`));
|
|
545
|
+
} else {
|
|
546
|
+
// New customer name
|
|
547
|
+
customer = selection;
|
|
548
|
+
console.log(chalk.yellow(`⚠️ Creating new customer: ${customer}\n`));
|
|
549
|
+
}
|
|
550
|
+
} else {
|
|
551
|
+
customer = await inputCollector.question('Customer name: ');
|
|
552
|
+
}
|
|
553
|
+
}
|
|
532
554
|
const environment = options.env || await inputCollector.collectEnvironment();
|
|
533
555
|
const serviceName = await inputCollector.collectServiceName();
|
|
534
556
|
const serviceType = await inputCollector.collectServiceType();
|
package/dist/modules/security.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConfigurationValidator } from '../security/ConfigurationValidator.js';
|
|
2
2
|
import { DeploymentManager } from '../security/DeploymentManager.js';
|
|
3
3
|
import { SecretGenerator } from '../security/SecretGenerator.js';
|
|
4
|
+
import { isValidEnvironment } from '../security/patterns/environment-rules.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Security Module for Clodo Framework
|
|
@@ -77,12 +78,7 @@ export const securityModule = {
|
|
|
77
78
|
utils: {
|
|
78
79
|
calculateKeyEntropy: key => SecretGenerator.calculateEntropy(key),
|
|
79
80
|
validateKeyStrength: (key, requirements) => SecretGenerator.validateKeyStrength(key, requirements),
|
|
80
|
-
isValidEnvironment: env =>
|
|
81
|
-
const {
|
|
82
|
-
isValidEnvironment
|
|
83
|
-
} = require('../security/patterns/environment-rules.js');
|
|
84
|
-
return isValidEnvironment(env);
|
|
85
|
-
}
|
|
81
|
+
isValidEnvironment: env => isValidEnvironment(env)
|
|
86
82
|
}
|
|
87
83
|
};
|
|
88
84
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Eliminating re-entry of account IDs, zone IDs, URLs, etc.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
11
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync } from 'fs';
|
|
12
12
|
import { join, dirname } from 'path';
|
|
13
13
|
import { fileURLToPath } from 'url';
|
|
14
14
|
|
|
@@ -275,8 +275,9 @@ export class ConfigPersistenceManager {
|
|
|
275
275
|
if (!existsSync(this.configDir)) {
|
|
276
276
|
return [];
|
|
277
277
|
}
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
|
|
279
|
+
// ESM-compatible fs import (already imported at top)
|
|
280
|
+
const entries = readdirSync(this.configDir, {
|
|
280
281
|
withFileTypes: true
|
|
281
282
|
});
|
|
282
283
|
return entries.filter(entry => entry.isDirectory() && entry.name !== 'template').map(entry => entry.name);
|