@umituz/web-cloudflare 1.1.0 → 1.3.0

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/README.md CHANGED
@@ -175,13 +175,15 @@ const versions = await wrangler.versionsList();
175
175
  await wrangler.versionsRollback(versions[0].id);
176
176
  ```
177
177
 
178
+ **Note:** Wrangler CLI and Workers services now follow Domain-Driven Design (DDD) architecture with their own domain structures at `src/domains/wrangler/` and `src/domains/workers/`.
179
+
178
180
  ## 📚 Subpath Exports
179
181
 
180
182
  ### Services
181
183
 
182
184
  ```typescript
183
- // Workers service
184
- import { WorkerService } from '@umituz/web-cloudflare/workers';
185
+ // Workers service (now in domains/)
186
+ import { WorkersService, workersService } from '@umituz/web-cloudflare/workers';
185
187
 
186
188
  // KV cache
187
189
  import { KVService } from '@umituz/web-cloudflare/kv';
@@ -646,9 +648,19 @@ Contributions are welcome!
646
648
  @umituz/web-cloudflare/
647
649
  ├── src/
648
650
  │ ├── config/ # Config patterns and types
649
- │ ├── domain/ # Domain entities
651
+ │ ├── domains/ # Domain-driven design structure
652
+ │ │ ├── wrangler/ # Wrangler CLI domain
653
+ │ │ │ ├── entities/ # Domain entities
654
+ │ │ │ ├── services/ # Domain services
655
+ │ │ │ ├── types/ # Domain types
656
+ │ │ │ └── index.ts # Domain exports
657
+ │ │ └── workers/ # Workers domain
658
+ │ │ ├── entities/ # Domain entities
659
+ │ │ ├── services/ # Domain services
660
+ │ │ ├── types/ # Domain types
661
+ │ │ └── index.ts # Domain exports
650
662
  │ ├── infrastructure/
651
- │ │ ├── services/ # Services (workers, kv, r2, d1, etc.)
663
+ │ │ ├── services/ # Services (kv, r2, d1, etc.)
652
664
  │ │ ├── router/ # Express-like router
653
665
  │ │ ├── middleware/ # Middleware collection
654
666
  │ │ └── utils/ # Helper functions
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@umituz/web-cloudflare",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Comprehensive Cloudflare Workers integration with config-based patterns, middleware, router, workflows, and AI",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
7
7
  "sideEffects": false,
8
8
  "exports": {
9
9
  ".": "./src/index.ts",
10
- "./workers": "./src/infrastructure/services/workers/index.ts",
10
+ "./workers": "./src/domains/workers/index.ts",
11
11
  "./kv": "./src/infrastructure/services/kv/index.ts",
12
12
  "./r2": "./src/infrastructure/services/r2/index.ts",
13
13
  "./d1": "./src/infrastructure/services/d1/index.ts",
@@ -16,7 +16,7 @@
16
16
  "./workflows": "./src/infrastructure/services/workflows/index.ts",
17
17
  "./ai-gateway": "./src/infrastructure/services/ai-gateway/index.ts",
18
18
  "./workers-ai": "./src/infrastructure/services/ai-gateway/index.ts",
19
- "./wrangler": "./src/infrastructure/services/wrangler/index.ts",
19
+ "./wrangler": "./src/domains/wrangler/index.ts",
20
20
  "./router": "./src/infrastructure/router/index.ts",
21
21
  "./middleware": "./src/infrastructure/middleware/index.ts",
22
22
  "./utils": "./src/infrastructure/utils/helpers.ts",
@@ -24,7 +24,6 @@
24
24
  "./config": "./src/config/patterns.ts",
25
25
  "./patterns": "./src/config/patterns.ts",
26
26
  "./types": "./src/config/types.ts",
27
- "./domain": "./src/domain/index.ts",
28
27
  "./package.json": "./package.json"
29
28
  },
30
29
  "scripts": {
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Workers Domain
3
+ * Complete Cloudflare Workers integration with routing and middleware
4
+ */
5
+
6
+ // Entities
7
+ export * from './entities';
8
+
9
+ // Types
10
+ export * from './types';
11
+
12
+ // Services
13
+ export * from './services';
@@ -3,8 +3,8 @@
3
3
  * @description Cloudflare Workers HTTP handler and routing
4
4
  */
5
5
 
6
- import type { WorkerRequest, WorkerResponse, WorkerConfig } from "../../../domain/entities/worker.entity";
7
- import type { Env } from "../../../domain/interfaces/services.interface";
6
+ import type { WorkerRequest, WorkerResponse, WorkerConfig } from "../entities";
7
+ import type { Env } from "../types";
8
8
 
9
9
  export interface WorkerFetchOptions {
10
10
  readonly cache?: CacheControls;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Workers Environment Types
3
+ * @description Environment and event types for Workers
4
+ */
5
+
6
+ import type { WorkerRequest, WorkerResponse } from '../entities';
7
+
8
+ /**
9
+ * Worker environment bindings
10
+ */
11
+ export interface Env {
12
+ readonly KV?: Record<string, KVNamespace>;
13
+ readonly R2?: Record<string, R2Bucket>;
14
+ readonly D1?: Record<string, D1Database>;
15
+ }
16
+
17
+ /**
18
+ * Scheduled event for cron triggers
19
+ */
20
+ export interface ScheduledEvent {
21
+ readonly scheduledTime: number;
22
+ readonly cron: string;
23
+ }
24
+
25
+ /**
26
+ * Worker Service Interface
27
+ */
28
+ export interface IWorkerService {
29
+ fetch(request: WorkerRequest, env?: Env): Promise<WorkerResponse>;
30
+ scheduled(event: ScheduledEvent, env?: Env): Promise<void>;
31
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Workers Domain Types
3
+ */
4
+
5
+ export * from './env.types';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Wrangler Domain
3
+ * Complete Wrangler CLI integration with TypeScript
4
+ */
5
+
6
+ // Entities
7
+ export * from './entities';
8
+
9
+ // Types
10
+ export * from './types/service.interface';
11
+
12
+ // Services
13
+ export * from './services';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Wrangler Service Exports
3
+ */
4
+
5
+ export { WranglerService } from './wrangler.service';
6
+ export type { IWranglerService } from '../types/service.interface';
@@ -14,8 +14,8 @@ import type {
14
14
  D1DatabaseInfo,
15
15
  SecretInfo,
16
16
  WorkerVersionInfo,
17
- } from '../../../domain/entities/wrangler.entity';
18
- import type { IWranglerService } from '../../../domain/interfaces/wrangler.interface';
17
+ } from '../entities';
18
+ import type { IWranglerService } from '../types/service.interface';
19
19
 
20
20
  const execAsync = promisify(exec);
21
21
 
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@
15
15
  * - ./workflows - Workflows orchestration service
16
16
  * - ./ai-gateway - AI Gateway service
17
17
  * - ./workers-ai - Workers AI service
18
+ * - ./wrangler - Wrangler CLI service
18
19
  * - ./router - Express-like router
19
20
  * - ./middleware - Middleware collection
20
21
  * - ./utils - Utility helpers
@@ -22,15 +23,11 @@
22
23
  * - ./config - Configuration patterns
23
24
  * - ./patterns - Configuration patterns (alias for ./config)
24
25
  * - ./types - TypeScript types
25
- * - ./domain - Domain entities
26
26
  */
27
27
 
28
- // Domain entities
29
- export * from "./domain/entities";
30
- export * from "./domain/interfaces";
31
-
32
- // Infrastructure services
33
- export * from "./infrastructure/services/workers";
28
+ // Domains
29
+ export * from "./domains/wrangler";
30
+ export * from "./domains/workers";
34
31
  export * from "./infrastructure/services/kv";
35
32
  export * from "./infrastructure/services/r2";
36
33
  export * from "./infrastructure/services/d1";
@@ -38,7 +35,6 @@ export * from "./infrastructure/services/images";
38
35
  export * from "./infrastructure/services/analytics";
39
36
  export * from "./infrastructure/services/workflows";
40
37
  export * from "./infrastructure/services/ai-gateway";
41
- export * from "./infrastructure/services/wrangler";
42
38
 
43
39
  // Infrastructure - Router, Middleware, Utils
44
40
  export * from "./infrastructure/router";
@@ -1,17 +0,0 @@
1
- /**
2
- * Wrangler Service Exports
3
- */
4
-
5
- export { WranglerService } from './wrangler.service';
6
- export type {
7
- WranglerResult,
8
- WranglerCommandOptions,
9
- AuthInfo,
10
- KVNamespaceInfo,
11
- R2BucketInfo,
12
- D1DatabaseInfo,
13
- SecretInfo,
14
- WorkerVersionInfo,
15
- AnalyticsData,
16
- } from '../../domain/entities/wrangler.entity';
17
- export type { IWranglerService } from '../../domain/interfaces/wrangler.interface';