effect-cloudflare-r2-layer 1.1.42 → 1.1.44
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 +4 -19
- package/package.json +5 -9
package/README.md
CHANGED
@@ -242,7 +242,6 @@ import {
|
|
242
242
|
CloudflareR2StorageLayerLive,
|
243
243
|
FileStorageLayer,
|
244
244
|
} from 'effect-cloudflare-r2-layer';
|
245
|
-
import { readFile } from 'fs-extra';
|
246
245
|
|
247
246
|
type Buckets = 'assets' | 'config';
|
248
247
|
const fileName = 'yolo.jpg';
|
@@ -250,11 +249,6 @@ const filePath = './assets/yolo.jpg';
|
|
250
249
|
|
251
250
|
const task = pipe(
|
252
251
|
Effect.gen(function* () {
|
253
|
-
const fileData = yield* Effect.tryPromise({
|
254
|
-
try: () => readFile(filePath),
|
255
|
-
catch: (e) => new FsError({ cause: e }),
|
256
|
-
});
|
257
|
-
|
258
252
|
yield* FileStorageLayer.deleteFile<Buckets>({
|
259
253
|
bucketName: 'assets',
|
260
254
|
documentKey: fileName,
|
@@ -422,17 +416,12 @@ readAsRawBinary: <TBucket extends string>(
|
|
422
416
|
|
423
417
|
```typescript
|
424
418
|
import { FetchHttpClient } from '@effect/platform';
|
419
|
+
import { FileSystem } from '@effect/platform/FileSystem';
|
425
420
|
import { Effect, Layer, pipe } from 'effect';
|
426
421
|
import {
|
427
422
|
CloudflareR2StorageLayerLive,
|
428
423
|
FileStorageLayer,
|
429
424
|
} from 'effect-cloudflare-r2-layer';
|
430
|
-
import fs from 'fs-extra';
|
431
|
-
import { TaggedError } from 'effect/Data';
|
432
|
-
|
433
|
-
export class FsError extends TaggedError('FsError')<{
|
434
|
-
cause?: unknown;
|
435
|
-
}> {}
|
436
425
|
|
437
426
|
type Buckets = 'assets' | 'config';
|
438
427
|
|
@@ -444,13 +433,9 @@ const task = pipe(
|
|
444
433
|
'yolo.jpg'
|
445
434
|
);
|
446
435
|
|
447
|
-
yield*
|
448
|
-
|
449
|
-
|
450
|
-
encoding: 'utf-8',
|
451
|
-
}),
|
452
|
-
catch: (e) => new FsError({ cause: e }),
|
453
|
-
});
|
436
|
+
const fs = yield* FileSystem;
|
437
|
+
const buffer = Buffer.from(data);
|
438
|
+
yield* fs.writeFile('./file.jpg', buffer);
|
454
439
|
}),
|
455
440
|
Effect.scoped,
|
456
441
|
Effect.provide(
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "effect-cloudflare-r2-layer",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.44",
|
4
4
|
"author": "jpb06 <jp.bois.06@outlook.fr>",
|
5
5
|
"description": "An effect layer to interact with Cloudware R2 storage service",
|
6
6
|
"keywords": [
|
@@ -50,8 +50,8 @@
|
|
50
50
|
"sync-icons": "bun generateReadmeIcons -h 50"
|
51
51
|
},
|
52
52
|
"dependencies": {
|
53
|
-
"@aws-sdk/client-s3": "3.
|
54
|
-
"@aws-sdk/s3-request-presigner": "3.
|
53
|
+
"@aws-sdk/client-s3": "3.850.0",
|
54
|
+
"@aws-sdk/s3-request-presigner": "3.850.0",
|
55
55
|
"dotenv-flow": "4.1.0"
|
56
56
|
},
|
57
57
|
"peerDependencies": {
|
@@ -59,17 +59,13 @@
|
|
59
59
|
"effect": "3.x"
|
60
60
|
},
|
61
61
|
"devDependencies": {
|
62
|
-
"@biomejs/biome": "2.1.
|
62
|
+
"@biomejs/biome": "2.1.2",
|
63
63
|
"@types/bun": "latest",
|
64
|
-
"@types/fs-extra": "11.0.4",
|
65
64
|
"@vitest/coverage-v8": "3.2.4",
|
66
|
-
"comment-json": "4.2.5",
|
67
65
|
"copyfiles": "2.4.1",
|
68
66
|
"del-cli": "6.0.0",
|
69
67
|
"effect-errors": "1.10.14",
|
70
|
-
"
|
71
|
-
"glob": "11.0.3",
|
72
|
-
"npm-check-updates": "18.0.1",
|
68
|
+
"npm-check-updates": "18.0.2",
|
73
69
|
"readme-package-icons": "1.2.2",
|
74
70
|
"ts-paths-resolver": "1.2.68",
|
75
71
|
"tsx": "4.20.3",
|