effect-cloudflare-r2-layer 1.0.42 → 1.0.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 +5 -0
- package/dts/layer/file-storage.layer.d.ts +6 -6
- package/dts/r2/implementations/internal/fetch-file.effect.d.ts +1 -1
- package/dts/r2/implementations/read-as-json.effect.d.ts +1 -1
- package/dts/r2/implementations/read-as-raw-binary.effect.d.ts +1 -1
- package/dts/r2/implementations/read-as-text.effect.d.ts +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# effect-cloudflare-r2-layer
|
2
2
|
|
3
|
+
[](https://github.dev/jpb06/effect-cloudflare-r2-layer)
|
4
|
+

|
5
|
+

|
6
|
+

|
7
|
+
|
3
8
|
An effect layer to interact with Cloudware R2 storage service.
|
4
9
|
|
5
10
|
<!-- readme-package-icons start -->
|
@@ -10,9 +10,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
|
14
|
-
readonly readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucketName: TBucket, documentKey: string) => Effect.Effect<TShape, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient
|
15
|
-
readonly readAsText: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<string, ConfigError.ConfigError | HttpClientError | FileStorageError, HttpClient
|
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>;
|
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,
|
25
|
-
readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucket: TBucket, fileName: string) => Effect.Effect<TShape, FileStorageError | ConfigError.ConfigError | HttpClientError,
|
26
|
-
readAsText: <TBucket extends string>(bucket: TBucket, fileName: string) => Effect.Effect<string, FileStorageError | ConfigError.ConfigError | HttpClientError,
|
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>;
|
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
|
};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { HttpClient } from '@effect/platform';
|
2
2
|
import { Effect } from 'effect';
|
3
|
-
export declare const fetchFile: (bucketName: string, documentKey: string) => Effect.Effect<import("@effect/platform/HttpClientResponse").HttpClientResponse, import("../../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError,
|
3
|
+
export declare const fetchFile: (bucketName: string, documentKey: string) => Effect.Effect<import("@effect/platform/HttpClientResponse").HttpClientResponse, import("../../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError, HttpClient.HttpClient | import("effect/Scope").Scope>;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { Effect } from 'effect';
|
2
|
-
export declare const readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucketName: TBucket, documentKey: string) => Effect.Effect<TShape, import("../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError, import("
|
2
|
+
export declare const readAsJson: <TBucket extends string, TShape extends Record<string, unknown>>(bucketName: TBucket, documentKey: string) => Effect.Effect<TShape, import("../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError, import("@effect/platform/HttpClient").HttpClient | import("effect/Scope").Scope>;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { Effect } from 'effect';
|
2
|
-
export declare const readAsRawBinary: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<ArrayBuffer, import("../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError, import("
|
2
|
+
export declare const readAsRawBinary: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<ArrayBuffer, import("../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError, import("@effect/platform/HttpClient").HttpClient | import("effect/Scope").Scope>;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { Effect } from 'effect';
|
2
|
-
export declare const readAsText: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<string, import("../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError, import("
|
2
|
+
export declare const readAsText: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<string, import("../../index.js").FileStorageError | import("effect/ConfigError").ConfigError | import("@effect/platform/HttpClientError").HttpClientError, import("@effect/platform/HttpClient").HttpClient | import("effect/Scope").Scope>;
|
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.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": [
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"node": ">=20.x"
|
27
27
|
},
|
28
28
|
"scripts": {
|
29
|
-
"update-deps": "taze -I",
|
29
|
+
"update-deps": "taze -f -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",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"dependencies": {
|
49
49
|
"@aws-sdk/client-s3": "3.717.0",
|
50
50
|
"@aws-sdk/s3-request-presigner": "3.717.0",
|
51
|
-
"@effect/platform": "0.
|
51
|
+
"@effect/platform": "0.72.0",
|
52
52
|
"dotenv": "16.4.7",
|
53
53
|
"effect": "3.12.0"
|
54
54
|
},
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"glob": "11.0.0",
|
69
69
|
"readme-package-icons": "1.1.16",
|
70
70
|
"taze": "0.18.0",
|
71
|
-
"ts-paths-resolver": "1.2.
|
71
|
+
"ts-paths-resolver": "1.2.14",
|
72
72
|
"tsx": "4.19.2",
|
73
73
|
"vitest": "2.1.8",
|
74
74
|
"vitest-mock-extended": "2.0.2"
|