effect-cloudflare-r2-layer 1.0.44 → 1.0.47
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -8
- package/dts/layer/file-storage.layer.d.ts +7 -7
- package/package.json +9 -9
package/README.md
CHANGED
@@ -83,7 +83,7 @@ type createBucket = (
|
|
83
83
|
input: CreateBucketCommandInput
|
84
84
|
) => Effect.Effect<
|
85
85
|
CreateBucketCommandOutput,
|
86
|
-
FileStorageError | ConfigError
|
86
|
+
FileStorageError | ConfigError,
|
87
87
|
FileStorage
|
88
88
|
>;
|
89
89
|
```
|
@@ -175,7 +175,7 @@ type uploadFile = <TBucket extends string>(
|
|
175
175
|
input: UploadFileInput<TBucket>
|
176
176
|
) => Effect.Effect<
|
177
177
|
PutObjectCommandOutput,
|
178
|
-
FileStorageError | ConfigError
|
178
|
+
FileStorageError | ConfigError,
|
179
179
|
FileStorage
|
180
180
|
>;
|
181
181
|
```
|
@@ -228,7 +228,7 @@ type deleteFile = <TBucket extends string>(
|
|
228
228
|
input: DeleteFileInput<TBucket>
|
229
229
|
) => Effect.Effect<
|
230
230
|
DeleteObjectCommandOutput,
|
231
|
-
FileStorageError | ConfigError
|
231
|
+
FileStorageError | ConfigError,
|
232
232
|
FileStorage
|
233
233
|
>;
|
234
234
|
```
|
@@ -275,7 +275,7 @@ type getFileUrl = <TBucket extends string>(
|
|
275
275
|
fileName: string,
|
276
276
|
) => Effect.Effect<
|
277
277
|
string,
|
278
|
-
FileStorageError | ConfigError
|
278
|
+
FileStorageError | ConfigError,
|
279
279
|
FileStorage
|
280
280
|
>;
|
281
281
|
```
|
@@ -315,8 +315,8 @@ type readAsJson = <
|
|
315
315
|
fileName: string
|
316
316
|
) => Effect.Effect<
|
317
317
|
TShape,
|
318
|
-
HttpClientError | FileStorageError | ConfigError
|
319
|
-
FileStorage | Scope | HttpClient
|
318
|
+
HttpClientError | FileStorageError | ConfigError,
|
319
|
+
FileStorage | Scope | HttpClient>
|
320
320
|
>;
|
321
321
|
```
|
322
322
|
|
@@ -367,7 +367,7 @@ readAsText: <TBucket extends string>(
|
|
367
367
|
Effect.Effect<
|
368
368
|
string,
|
369
369
|
ConfigError | HttpClientError | FileStorageError,
|
370
|
-
FileStorage | Scope | HttpClient
|
370
|
+
FileStorage | Scope | HttpClient
|
371
371
|
>;
|
372
372
|
```
|
373
373
|
|
@@ -413,7 +413,7 @@ readAsRawBinary: <TBucket extends string>(
|
|
413
413
|
Effect.Effect<
|
414
414
|
ArrayBuffer,
|
415
415
|
ConfigError | HttpClientError | FileStorageError,
|
416
|
-
FileStorage | Scope | HttpClient
|
416
|
+
FileStorage | Scope | HttpClient
|
417
417
|
>;
|
418
418
|
```
|
419
419
|
|
@@ -3,16 +3,16 @@ import { HttpClientError } from '@effect/platform/HttpClientError';
|
|
3
3
|
import type { ConfigError, Effect } from 'effect';
|
4
4
|
import { Context } from 'effect';
|
5
5
|
import { Scope } from 'effect/Scope';
|
6
|
-
import { HttpClient } from '@effect/platform
|
6
|
+
import { HttpClient } from '@effect/platform';
|
7
7
|
import type { BucketNotFoundError, FileStorageError } from './../errors/index.js';
|
8
8
|
import type { BucketInfosInput, BucketInfosResult, DeleteFileInput, UploadFileInput } from './../r2/implementations/index.js';
|
9
9
|
export interface FileStorage {
|
10
10
|
readonly createBucket: (input: CreateBucketCommandInput) => Effect.Effect<CreateBucketCommandOutput, ConfigError.ConfigError | FileStorageError, never>;
|
11
11
|
readonly bucketInfos: <TBucket extends string>(input: BucketInfosInput<TBucket>) => Effect.Effect<BucketInfosResult, ConfigError.ConfigError | FileStorageError | BucketNotFoundError, never>;
|
12
12
|
readonly getFileUrl: <TBucket extends string>(fileName: string, bucket: TBucket) => Effect.Effect<string, FileStorageError | ConfigError.ConfigError>;
|
13
|
-
readonly readAsRawBinary: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<ArrayBuffer, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient | Scope>;
|
14
|
-
readonly readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucketName: TBucket, documentKey: string) => Effect.Effect<TShape, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient | Scope>;
|
15
|
-
readonly readAsText: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<string, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient | Scope>;
|
13
|
+
readonly readAsRawBinary: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<ArrayBuffer, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient.HttpClient | Scope>;
|
14
|
+
readonly readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucketName: TBucket, documentKey: string) => Effect.Effect<TShape, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient.HttpClient | Scope>;
|
15
|
+
readonly readAsText: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<string, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient.HttpClient | Scope>;
|
16
16
|
readonly uploadFile: <TBucket extends string>({ bucketName, documentKey, data, contentType, }: UploadFileInput<TBucket>) => Effect.Effect<PutObjectCommandOutput, ConfigError.ConfigError | FileStorageError, never>;
|
17
17
|
readonly deleteFile: <TBucket extends string>({ bucketName, documentKey, }: DeleteFileInput<TBucket>) => Effect.Effect<DeleteObjectCommandOutput, ConfigError.ConfigError | FileStorageError, never>;
|
18
18
|
}
|
@@ -21,9 +21,9 @@ export declare const FileStorageLayer: {
|
|
21
21
|
createBucket: (input: CreateBucketCommandInput) => Effect.Effect<CreateBucketCommandOutput, FileStorageError | ConfigError.ConfigError, FileStorage>;
|
22
22
|
bucketInfos: <TBucket extends string>(input: BucketInfosInput<TBucket>) => Effect.Effect<BucketInfosResult, BucketNotFoundError | FileStorageError | ConfigError.ConfigError, FileStorage>;
|
23
23
|
getFileUrl: <TBucket extends string>(bucket: TBucket, fileName: string) => Effect.Effect<string, FileStorageError | ConfigError.ConfigError, FileStorage>;
|
24
|
-
readAsRawBinary: <TBucket extends string>(bucket: TBucket, fileName: string) => Effect.Effect<ArrayBuffer, FileStorageError | ConfigError.ConfigError | HttpClientError, HttpClient | Scope | FileStorage>;
|
25
|
-
readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucket: TBucket, fileName: string) => Effect.Effect<TShape, FileStorageError | ConfigError.ConfigError | HttpClientError, HttpClient | Scope | FileStorage>;
|
26
|
-
readAsText: <TBucket extends string>(bucket: TBucket, fileName: string) => Effect.Effect<string, FileStorageError | ConfigError.ConfigError | HttpClientError, HttpClient | Scope | FileStorage>;
|
24
|
+
readAsRawBinary: <TBucket extends string>(bucket: TBucket, fileName: string) => Effect.Effect<ArrayBuffer, FileStorageError | ConfigError.ConfigError | HttpClientError, HttpClient.HttpClient | Scope | FileStorage>;
|
25
|
+
readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucket: TBucket, fileName: string) => Effect.Effect<TShape, FileStorageError | ConfigError.ConfigError | HttpClientError, HttpClient.HttpClient | Scope | FileStorage>;
|
26
|
+
readAsText: <TBucket extends string>(bucket: TBucket, fileName: string) => Effect.Effect<string, FileStorageError | ConfigError.ConfigError | HttpClientError, HttpClient.HttpClient | Scope | FileStorage>;
|
27
27
|
uploadFile: <TBucket extends string>(input: UploadFileInput<TBucket>) => Effect.Effect<PutObjectCommandOutput, FileStorageError | ConfigError.ConfigError, FileStorage>;
|
28
28
|
deleteFile: <TBucket extends string>(input: DeleteFileInput<TBucket>) => Effect.Effect<DeleteObjectCommandOutput, FileStorageError | ConfigError.ConfigError, FileStorage>;
|
29
29
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "effect-cloudflare-r2-layer",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.47",
|
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": [
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"node": ">=20.x"
|
27
27
|
},
|
28
28
|
"scripts": {
|
29
|
-
"update-deps": "
|
29
|
+
"update-deps": "bun npm-check-updates --root --format group -i",
|
30
30
|
"copy-package": "copyfiles package.json ./dist/",
|
31
31
|
"copy-readme": "copyfiles README.md ./dist/",
|
32
32
|
"build": "del-cli ./dist && bun build-esm && bun build-cjs",
|
@@ -46,11 +46,11 @@
|
|
46
46
|
"sync-icons": "bun generateReadmeIcons -h 50"
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@aws-sdk/client-s3": "3.
|
50
|
-
"@aws-sdk/s3-request-presigner": "3.
|
51
|
-
"@effect/platform": "0.
|
49
|
+
"@aws-sdk/client-s3": "3.722.0",
|
50
|
+
"@aws-sdk/s3-request-presigner": "3.722.0",
|
51
|
+
"@effect/platform": "0.74.0",
|
52
52
|
"dotenv": "16.4.7",
|
53
|
-
"effect": "3.12.
|
53
|
+
"effect": "3.12.5"
|
54
54
|
},
|
55
55
|
"peerDependencies": {
|
56
56
|
"typescript": "5.7.2"
|
@@ -63,12 +63,12 @@
|
|
63
63
|
"comment-json": "4.2.5",
|
64
64
|
"copyfiles": "2.4.1",
|
65
65
|
"del-cli": "6.0.0",
|
66
|
-
"effect-errors": "1.8.
|
66
|
+
"effect-errors": "1.8.16",
|
67
67
|
"fs-extra": "11.2.0",
|
68
68
|
"glob": "11.0.0",
|
69
|
+
"npm-check-updates": "17.1.14",
|
69
70
|
"readme-package-icons": "1.1.16",
|
70
|
-
"
|
71
|
-
"ts-paths-resolver": "1.2.14",
|
71
|
+
"ts-paths-resolver": "1.2.20",
|
72
72
|
"tsx": "4.19.2",
|
73
73
|
"vitest": "2.1.8",
|
74
74
|
"vitest-mock-extended": "2.0.2"
|