effect-cloudflare-r2-layer 1.0.18 → 1.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/index.js +4 -1
- package/cjs/index.js.map +1 -1
- package/dts/index.d.ts +1 -0
- package/dts/r2/implementations/get-file-url.effect.d.ts +1 -1
- 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/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/package.json +2 -2
package/cjs/index.js
CHANGED
@@ -17,10 +17,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
18
18
|
};
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
20
|
-
exports.FileStorageLayer = void 0;
|
20
|
+
exports.BucketNotFoundError = exports.FileStorageError = exports.FileStorageLayer = void 0;
|
21
21
|
const dotenv_1 = __importDefault(require("dotenv"));
|
22
22
|
dotenv_1.default.config();
|
23
23
|
const file_storage_layer_js_1 = require("./layer/file-storage.layer.js");
|
24
24
|
Object.defineProperty(exports, "FileStorageLayer", { enumerable: true, get: function () { return file_storage_layer_js_1.FileStorageLayer; } });
|
25
25
|
__exportStar(require("./r2/r2-file-storage.layer.js"), exports);
|
26
|
+
var index_js_1 = require("./errors/index.js");
|
27
|
+
Object.defineProperty(exports, "FileStorageError", { enumerable: true, get: function () { return index_js_1.FileStorageError; } });
|
28
|
+
Object.defineProperty(exports, "BucketNotFoundError", { enumerable: true, get: function () { return index_js_1.BucketNotFoundError; } });
|
26
29
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAGhB,yEAAiE;AAExD,iGAFA,wCAAgB,OAEA;AAEzB,gEAA8C"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAGhB,yEAAiE;AAExD,iGAFA,wCAAgB,OAEA;AAEzB,gEAA8C;AAW9C,8CAA0E;AAAjE,4GAAA,gBAAgB,OAAA;AAAE,+GAAA,mBAAmB,OAAA"}
|
package/dts/index.d.ts
CHANGED
@@ -5,3 +5,4 @@ export type { FileStorage };
|
|
5
5
|
export * from './r2/r2-file-storage.layer.js';
|
6
6
|
export type { PutObjectCommandOutput, CreateBucketCommandInput, CreateBucketCommandOutput, } from '@aws-sdk/client-s3';
|
7
7
|
export type { BucketInfosInput, BucketInfosResult, } from './r2/implementations/bucket-infos.effect.js';
|
8
|
+
export { FileStorageError, BucketNotFoundError } from './errors/index.js';
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { Effect } from 'effect';
|
2
|
-
export declare const getFileUrl: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<string, import("../../
|
2
|
+
export declare const getFileUrl: <TBucket extends string>(bucketName: TBucket, documentKey: string) => Effect.Effect<string, import("../../index.js").FileStorageError | import("effect/ConfigError").ConfigError, never>;
|
@@ -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("../../../
|
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, import("effect/Scope").Scope | HttpClient.HttpClient<import("@effect/platform/HttpClientError").HttpClientError, 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("../../
|
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/Scope").Scope | import("@effect/platform/HttpClient").HttpClient<import("@effect/platform/HttpClientError").HttpClientError, 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("../../
|
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/Scope").Scope | import("@effect/platform/HttpClient").HttpClient<import("@effect/platform/HttpClientError").HttpClientError, 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("../../
|
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/Scope").Scope | import("@effect/platform/HttpClient").HttpClient<import("@effect/platform/HttpClientError").HttpClientError, import("effect/Scope").Scope>>;
|
package/esm/index.js
CHANGED
@@ -3,4 +3,5 @@ dotenv.config();
|
|
3
3
|
import { FileStorageLayer } from './layer/file-storage.layer.js';
|
4
4
|
export { FileStorageLayer };
|
5
5
|
export * from './r2/r2-file-storage.layer.js';
|
6
|
+
export { FileStorageError, BucketNotFoundError } from './errors/index.js';
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,MAAM,CAAC,MAAM,EAAE,CAAC;AAGhB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,cAAc,+BAA+B,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,MAAM,CAAC,MAAM,EAAE,CAAC;AAGhB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,cAAc,+BAA+B,CAAC;AAW9C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
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.19",
|
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": [
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"dependencies": {
|
49
49
|
"@aws-sdk/client-s3": "^3.670.0",
|
50
50
|
"@aws-sdk/s3-request-presigner": "^3.670.0",
|
51
|
-
"@effect/platform": "^0.68.
|
51
|
+
"@effect/platform": "^0.68.6",
|
52
52
|
"dotenv": "^16.4.5",
|
53
53
|
"effect": "^3.9.2"
|
54
54
|
},
|