@umituz/web-cloudflare 1.4.2 → 1.4.3

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
@@ -177,7 +177,7 @@ const versions = await wrangler.versionsList();
177
177
  await wrangler.versionsRollback(versions[0].id);
178
178
  ```
179
179
 
180
- **Note:** Wrangler CLI, Workers, AI Gateway, and R2 services now follow Domain-Driven Design (DDD) architecture with their own domain structures at `src/domains/wrangler/`, `src/domains/workers/`, `src/domains/ai-gateway/`, and `src/domains/r2/`.
180
+ **Note:** Wrangler CLI, Workers, AI Gateway, R2, and D1 services now follow Domain-Driven Design (DDD) architecture with their own domain structures at `src/domains/wrangler/`, `src/domains/workers/`, `src/domains/ai-gateway/`, `src/domains/r2/`, and `src/domains/d1/`.
181
181
 
182
182
  ## 📚 Subpath Exports
183
183
 
@@ -193,8 +193,8 @@ import { KVService } from '@umituz/web-cloudflare/kv';
193
193
  // R2 storage (now in domains/)
194
194
  import { R2Service, r2Service } from '@umituz/web-cloudflare/r2';
195
195
 
196
- // D1 database
197
- import { D1Service } from '@umituz/web-cloudflare/d1';
196
+ // D1 database (now in domains/)
197
+ import { D1Service, d1Service } from '@umituz/web-cloudflare/d1';
198
198
 
199
199
  // Images optimization
200
200
  import { ImagesService } from '@umituz/web-cloudflare/images';
@@ -675,13 +675,18 @@ Contributions are welcome!
675
675
  │ │ │ ├── entities/ # Domain entities
676
676
  │ │ │ ├── services/ # Domain services
677
677
  │ │ │ └── index.ts # Domain exports
678
- │ │ └── r2/ # R2 storage domain
678
+ │ │ ├── r2/ # R2 storage domain
679
+ │ │ │ ├── entities/ # Domain entities
680
+ │ │ │ ├── services/ # Domain services
681
+ │ │ │ ├── types/ # Domain types
682
+ │ │ │ └── index.ts # Domain exports
683
+ │ │ └── d1/ # D1 database domain
679
684
  │ │ ├── entities/ # Domain entities
680
685
  │ │ ├── services/ # Domain services
681
686
  │ │ ├── types/ # Domain types
682
687
  │ │ └── index.ts # Domain exports
683
688
  │ ├── infrastructure/
684
- │ │ ├── services/ # Services (kv, d1, etc.)
689
+ │ │ ├── services/ # Services (kv, images, analytics, workflows)
685
690
  │ │ ├── router/ # Express-like router
686
691
  │ │ ├── middleware/ # Middleware collection
687
692
  │ │ └── utils/ # Helper functions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/web-cloudflare",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Comprehensive Cloudflare Workers integration with config-based patterns, middleware, router, workflows, and AI (Patch-only versioning: only z in x.y.z increments)",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -10,7 +10,7 @@
10
10
  "./workers": "./src/domains/workers/index.ts",
11
11
  "./kv": "./src/infrastructure/services/kv/index.ts",
12
12
  "./r2": "./src/domains/r2/index.ts",
13
- "./d1": "./src/infrastructure/services/d1/index.ts",
13
+ "./d1": "./src/domains/d1/index.ts",
14
14
  "./images": "./src/infrastructure/services/images/index.ts",
15
15
  "./analytics": "./src/infrastructure/services/analytics/index.ts",
16
16
  "./workflows": "./src/infrastructure/services/workflows/index.ts",
@@ -0,0 +1,13 @@
1
+ /**
2
+ * D1 Domain
3
+ * Complete Cloudflare D1 database integration
4
+ */
5
+
6
+ // Entities
7
+ export * from './entities';
8
+
9
+ // Types
10
+ export * from './types';
11
+
12
+ // Services
13
+ export * from './services';
@@ -3,7 +3,7 @@
3
3
  * @description Cloudflare D1 database operations
4
4
  */
5
5
 
6
- import type { D1QueryResult, D1BatchResult } from "../../../domain/entities/d1.entity";
6
+ import type { D1QueryResult, D1BatchResult } from "../entities";
7
7
  import type { ID1Service } from "../../../domain/interfaces/services.interface";
8
8
 
9
9
  export interface D1ExecOptions {
@@ -5,3 +5,4 @@
5
5
 
6
6
  export { D1Service, d1Service } from "./d1.service";
7
7
  export type { D1ExecOptions } from "./d1.service";
8
+ export type { ID1Service } from '../types';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * D1 Domain Types
3
+ */
4
+
5
+ export * from './service.interface';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * D1 Service Interface
3
+ * @description Abstract interface for D1 database operations
4
+ */
5
+
6
+ import type { D1QueryResult, D1BatchResult } from '../entities';
7
+
8
+ export interface ID1Service {
9
+ query<T>(sql: string, params?: readonly unknown[]): Promise<D1QueryResult<T>>;
10
+ batch(statements: readonly { sql: string; params?: readonly unknown[] }[]): Promise<D1BatchResult>;
11
+ execute<T>(sql: string, params?: readonly unknown[]): Promise<D1QueryResult<T>>;
12
+ }
package/src/index.ts CHANGED
@@ -30,8 +30,8 @@ export * from "./domains/wrangler";
30
30
  export * from "./domains/workers";
31
31
  export * from "./domains/ai-gateway";
32
32
  export * from "./domains/r2";
33
+ export * from "./domains/d1";
33
34
  export * from "./infrastructure/services/kv";
34
- export * from "./infrastructure/services/d1";
35
35
  export * from "./infrastructure/services/images";
36
36
  export * from "./infrastructure/services/analytics";
37
37
  export * from "./infrastructure/services/workflows";