@tamyla/clodo-framework 4.0.1 → 4.0.2

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,10 @@
1
+ ## [4.0.2](https://github.com/tamylaa/clodo-framework/compare/v4.0.1...v4.0.2) (2025-12-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Pass API credentials through database creation workflow ([c245618](https://github.com/tamylaa/clodo-framework/commit/c245618290a7c71808de6d1934076bd53a0519c9))
7
+
1
8
  ## [4.0.1](https://github.com/tamylaa/clodo-framework/compare/v4.0.0...v4.0.1) (2025-12-07)
2
9
 
3
10
 
@@ -34,6 +34,8 @@ export class InteractiveDatabaseWorkflow {
34
34
  * @param {Object} options - Additional options
35
35
  * @param {string} [options.suggestedName] - Suggested database name
36
36
  * @param {boolean} [options.interactive=true] - Enable interactive prompts
37
+ * @param {string} [options.apiToken] - Cloudflare API token for API-based operations
38
+ * @param {string} [options.accountId] - Cloudflare account ID for API-based operations
37
39
  * @returns {Promise<Object>} Database configuration { name, id, created, reused }
38
40
  */
39
41
  async handleDatabaseSetup(domain, environment, options = {}) {
@@ -51,7 +53,10 @@ export class InteractiveDatabaseWorkflow {
51
53
  if (existingInfo.exists) {
52
54
  return await this.handleExistingDatabase(databaseName, existingInfo, options.interactive);
53
55
  } else {
54
- return await this.createNewDatabase(databaseName, options.interactive);
56
+ return await this.createNewDatabase(databaseName, options.interactive, {
57
+ apiToken: options.apiToken,
58
+ accountId: options.accountId
59
+ });
55
60
  }
56
61
  }
57
62
 
@@ -184,10 +189,20 @@ export class InteractiveDatabaseWorkflow {
184
189
  *
185
190
  * @param {string} name - Database name
186
191
  * @param {boolean} interactive - Enable interactive prompts
192
+ * @param {Object} credentials - Cloudflare API credentials
193
+ * @param {string} [credentials.apiToken] - API token for API-based creation
194
+ * @param {string} [credentials.accountId] - Account ID for API-based creation
187
195
  * @returns {Promise<Object>} Database configuration
188
196
  */
189
- async createNewDatabase(name, interactive = true) {
197
+ async createNewDatabase(name, interactive = true, credentials = {}) {
190
198
  console.log(`\nšŸ†• Creating new database: ${name}`);
199
+
200
+ // Log which method will be used
201
+ if (credentials.apiToken && credentials.accountId) {
202
+ console.log(' ā„¹ļø Using Cloudflare API for database creation');
203
+ } else {
204
+ console.log(' ā„¹ļø Using Wrangler CLI for database creation (no API credentials provided)');
205
+ }
191
206
  if (interactive) {
192
207
  const confirmCreate = await askYesNo('Proceed with database creation?', 'y');
193
208
  if (!confirmCreate) {
@@ -195,7 +210,10 @@ export class InteractiveDatabaseWorkflow {
195
210
  }
196
211
  }
197
212
  try {
198
- const databaseId = await createDatabase(name);
213
+ const databaseId = await createDatabase(name, {
214
+ apiToken: credentials.apiToken,
215
+ accountId: credentials.accountId
216
+ });
199
217
  console.log(` āœ… Database created with ID: ${databaseId}`);
200
218
 
201
219
  // Add to rollback actions
@@ -157,7 +157,9 @@ export class InteractiveDeploymentCoordinator {
157
157
  console.log('šŸ—„ļø Phase 2: Configuring Database Resources');
158
158
  console.log('─'.repeat(50));
159
159
  this.deploymentState.resources.database = await this.workflows.databaseWorkflow.handleDatabaseSetup(this.deploymentState.config.domain, this.deploymentState.config.environment, {
160
- interactive: true
160
+ interactive: true,
161
+ apiToken: this.deploymentState.config.credentials?.token,
162
+ accountId: this.deploymentState.config.credentials?.accountId
161
163
  });
162
164
  console.log('āœ… Database configuration complete\n');
163
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamyla/clodo-framework",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Reusable framework for Clodo-style software architecture on Cloudflare Workers + D1",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -1,28 +0,0 @@
1
- /**
2
- * Worker Entry Point
3
- * Minimal exports for Cloudflare Workers - excludes CLI/Node.js dependencies
4
- *
5
- * This is the entry point for wrangler.toml
6
- * Only exports worker-compatible code (no fs, path, child_process, etc.)
7
- */
8
-
9
- // Worker integration (no Node.js dependencies)
10
- export { initializeService, configManager } from './worker/integration.js';
11
-
12
- // Domain configuration (pure JS, no fs dependencies)
13
- export { getDomainFromEnv, createEnvironmentConfig } from './config/domains.js';
14
-
15
- // Framework version
16
- export const FRAMEWORK_VERSION = '1.0.0';
17
-
18
- // Default export for module worker format
19
- export default {
20
- async fetch(request, env, ctx) {
21
- return new Response('Clodo Framework Worker - Use initializeService() to set up your worker', {
22
- status: 200,
23
- headers: {
24
- 'content-type': 'text/plain'
25
- }
26
- });
27
- }
28
- };