@umituz/web-cloudflare 1.4.0 → 1.4.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/README.md +20 -5
- package/package.json +3 -3
- package/src/domains/r2/index.ts +13 -0
- package/src/{infrastructure/services/r2 → domains/r2/services}/index.ts +1 -0
- package/src/{infrastructure/services/r2 → domains/r2/services}/r2.service.ts +2 -2
- package/src/domains/r2/types/index.ts +5 -0
- package/src/domains/r2/types/service.interface.ts +14 -0
- package/src/index.ts +1 -1
- /package/src/{domain/entities/r2.entity.ts → domains/r2/entities/index.ts} +0 -0
- /package/src/{worker.example.ts → domains/workers/examples/worker.example.ts} +0 -0
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,
|
|
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/`.
|
|
181
181
|
|
|
182
182
|
## 📚 Subpath Exports
|
|
183
183
|
|
|
@@ -190,8 +190,8 @@ import { WorkersService, workersService } from '@umituz/web-cloudflare/workers';
|
|
|
190
190
|
// KV cache
|
|
191
191
|
import { KVService } from '@umituz/web-cloudflare/kv';
|
|
192
192
|
|
|
193
|
-
// R2 storage
|
|
194
|
-
import { R2Service } from '@umituz/web-cloudflare/r2';
|
|
193
|
+
// R2 storage (now in domains/)
|
|
194
|
+
import { R2Service, r2Service } from '@umituz/web-cloudflare/r2';
|
|
195
195
|
|
|
196
196
|
// D1 database
|
|
197
197
|
import { D1Service } from '@umituz/web-cloudflare/d1';
|
|
@@ -636,6 +636,15 @@ const result = await retry(
|
|
|
636
636
|
await sleep(1000); // 1 second
|
|
637
637
|
```
|
|
638
638
|
|
|
639
|
+
## 📋 Version Strategy
|
|
640
|
+
|
|
641
|
+
**Important:** This package follows a **patch-only versioning strategy**. Only the patch version will increment (e.g., 1.4.0 → 1.4.1 → 1.4.2). Major version bumps (2.0.0) will never occur. This ensures stability and prevents breaking changes from version updates.
|
|
642
|
+
|
|
643
|
+
## 📁 Example Files
|
|
644
|
+
|
|
645
|
+
Example files are located within their respective domains:
|
|
646
|
+
- **Worker Example**: `src/domains/workers/examples/worker.example.ts`
|
|
647
|
+
|
|
639
648
|
## 📝 License
|
|
640
649
|
|
|
641
650
|
MIT
|
|
@@ -660,13 +669,19 @@ Contributions are welcome!
|
|
|
660
669
|
│ │ │ ├── entities/ # Domain entities
|
|
661
670
|
│ │ │ ├── services/ # Domain services
|
|
662
671
|
│ │ │ ├── types/ # Domain types
|
|
672
|
+
│ │ │ ├── examples/ # Example files
|
|
673
|
+
│ │ │ └── index.ts # Domain exports
|
|
674
|
+
│ │ ├── ai-gateway/ # AI Gateway domain
|
|
675
|
+
│ │ │ ├── entities/ # Domain entities
|
|
676
|
+
│ │ │ ├── services/ # Domain services
|
|
663
677
|
│ │ │ └── index.ts # Domain exports
|
|
664
|
-
│ │ └──
|
|
678
|
+
│ │ └── r2/ # R2 storage domain
|
|
665
679
|
│ │ ├── entities/ # Domain entities
|
|
666
680
|
│ │ ├── services/ # Domain services
|
|
681
|
+
│ │ ├── types/ # Domain types
|
|
667
682
|
│ │ └── index.ts # Domain exports
|
|
668
683
|
│ ├── infrastructure/
|
|
669
|
-
│ │ ├── services/ # Services (kv,
|
|
684
|
+
│ │ ├── services/ # Services (kv, d1, etc.)
|
|
670
685
|
│ │ ├── router/ # Express-like router
|
|
671
686
|
│ │ ├── middleware/ # Middleware collection
|
|
672
687
|
│ │ └── utils/ # Helper functions
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/web-cloudflare",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "Comprehensive Cloudflare Workers integration with config-based patterns, middleware, router, workflows, and AI",
|
|
3
|
+
"version": "1.4.2",
|
|
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",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
".": "./src/index.ts",
|
|
10
10
|
"./workers": "./src/domains/workers/index.ts",
|
|
11
11
|
"./kv": "./src/infrastructure/services/kv/index.ts",
|
|
12
|
-
"./r2": "./src/
|
|
12
|
+
"./r2": "./src/domains/r2/index.ts",
|
|
13
13
|
"./d1": "./src/infrastructure/services/d1/index.ts",
|
|
14
14
|
"./images": "./src/infrastructure/services/images/index.ts",
|
|
15
15
|
"./analytics": "./src/infrastructure/services/analytics/index.ts",
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @description Cloudflare R2 object storage operations
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { R2Object, R2ListOptions, R2ListResult, R2PutOptions, R2PresignedURL } from "
|
|
6
|
+
import type { R2Object, R2ListOptions, R2ListResult, R2PutOptions, R2PresignedURL } from "../entities";
|
|
7
7
|
import type { IR2Service } from "../../../domain/interfaces/services.interface";
|
|
8
|
-
import { validationUtils } from "
|
|
8
|
+
import { validationUtils } from "../../../infrastructure/utils";
|
|
9
9
|
|
|
10
10
|
export interface R2UploadOptions extends R2PutOptions {
|
|
11
11
|
readonly binding?: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* R2 Service Interface
|
|
3
|
+
* @description Abstract interface for R2 storage operations
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { R2Object, R2ListOptions, R2ListResult, R2PutOptions, R2PresignedURL } from '../entities';
|
|
7
|
+
|
|
8
|
+
export interface IR2Service {
|
|
9
|
+
get(key: string, binding?: string): Promise<R2Object | null>;
|
|
10
|
+
put(key: string, data: ReadableStream | ArrayBuffer | string, options?: R2PutOptions): Promise<void>;
|
|
11
|
+
delete(key: string, binding?: string): Promise<boolean>;
|
|
12
|
+
list(options?: R2ListOptions): Promise<R2ListResult>;
|
|
13
|
+
getPresignedURL(key: string, expiresIn?: number): Promise<R2PresignedURL>;
|
|
14
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
export * from "./domains/wrangler";
|
|
30
30
|
export * from "./domains/workers";
|
|
31
31
|
export * from "./domains/ai-gateway";
|
|
32
|
+
export * from "./domains/r2";
|
|
32
33
|
export * from "./infrastructure/services/kv";
|
|
33
|
-
export * from "./infrastructure/services/r2";
|
|
34
34
|
export * from "./infrastructure/services/d1";
|
|
35
35
|
export * from "./infrastructure/services/images";
|
|
36
36
|
export * from "./infrastructure/services/analytics";
|
|
File without changes
|
|
File without changes
|