@voltro/plugin-storage 0.81.0 → 0.82.0
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/CHANGELOG.md +1520 -6
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/index.d.ts +88 -1
- package/dist/index.js +665 -510
- package/dist/types.d.ts +30 -0
- package/package.json +4 -4
package/dist/types.d.ts
CHANGED
|
@@ -255,6 +255,10 @@ export declare interface StorageProvider {
|
|
|
255
255
|
* publicly without the app (filesystem/memory) → the service falls
|
|
256
256
|
* back to the `/_voltro/storage/:id` route. */
|
|
257
257
|
readonly publicUrl?: (key: string) => string | null;
|
|
258
|
+
/** Make an object publicly readable at the provider, or not (s3/minio with
|
|
259
|
+
* per-object ACLs). Absent where the app decides per request (database,
|
|
260
|
+
* filesystem, memory) — there a ref's visibility is the whole answer. */
|
|
261
|
+
readonly setObjectPublic?: (key: string, isPublic: boolean) => Effect.Effect<void, StorageError>;
|
|
258
262
|
/** Presigned PUT for direct-to-bucket uploads (s3/minio). Absent on
|
|
259
263
|
* providers that can't presign uploads. */
|
|
260
264
|
readonly getUploadUrl?: (key: string, expiresInSec: number, contentType: string) => Effect.Effect<string, StorageError>;
|
|
@@ -485,6 +489,30 @@ export declare interface StorageServiceShape {
|
|
|
485
489
|
* caller's `tenantId` / `ownerId` for an end-user surface, and deliver any
|
|
486
490
|
* listed private object through `mintUrl`. */
|
|
487
491
|
readonly listRefs: (input?: ListRefsInput) => Effect.Effect<ListRefsResult, StorageError>;
|
|
492
|
+
/**
|
|
493
|
+
* A short-lived URL that delivers the bytes WITHOUT an access check — for
|
|
494
|
+
* server code that has already decided the reader may see them (a shared
|
|
495
|
+
* preview whose link was verified). Public: its public URL. Private: a
|
|
496
|
+
* presigned GET (s3/minio) or the serve URL with a signed grant token. Never
|
|
497
|
+
* hand one to a caller whose access you have not checked.
|
|
498
|
+
*/
|
|
499
|
+
readonly signedUrl: (id: string, opts?: {
|
|
500
|
+
readonly tenantId?: string | null;
|
|
501
|
+
readonly expiresInSec?: number;
|
|
502
|
+
}) => Effect.Effect<string, StorageError>;
|
|
503
|
+
/**
|
|
504
|
+
* Make a stored object public or private after the fact — an image that goes
|
|
505
|
+
* public when its page is published, and private again when it is taken
|
|
506
|
+
* down. Checks the tenant like `delete`. Where objects are served from a
|
|
507
|
+
* public base (`cdnBaseUrl`) a public object cannot be taken back: that is
|
|
508
|
+
* refused (`StorageRejected`, reason `visibility-unsupported`) rather than
|
|
509
|
+
* left public. On s3 with per-object ACLs the object follows its refs: it
|
|
510
|
+
* stays public while any ref to the same bytes is. A public object's earlier
|
|
511
|
+
* responses may remain in browser and CDN caches.
|
|
512
|
+
*/
|
|
513
|
+
readonly setVisibility: (id: string, visibility: StorageVisibility, opts?: {
|
|
514
|
+
readonly tenantId?: string | null;
|
|
515
|
+
}) => Effect.Effect<StorageRef, StorageError | StorageRejected>;
|
|
488
516
|
readonly grant: (input: GrantInput) => Effect.Effect<StorageGrant, StorageError>;
|
|
489
517
|
readonly revoke: (grantId: string) => Effect.Effect<void, StorageError>;
|
|
490
518
|
/** One grant by id, or null. Server-side read — the RPC layer uses it to
|
|
@@ -523,6 +551,8 @@ export declare interface StorageServiceShape {
|
|
|
523
551
|
readonly operationId?: string;
|
|
524
552
|
readonly ownerId?: string | null;
|
|
525
553
|
readonly visibility?: StorageVisibility;
|
|
554
|
+
/** The access policy of a private object, as on `put`. */
|
|
555
|
+
readonly access?: AccessPolicy;
|
|
526
556
|
readonly key?: string;
|
|
527
557
|
readonly folder?: string;
|
|
528
558
|
readonly tags?: ReadonlyArray<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-storage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"description": "File-storage plugin — one StorageProvider contract, switchable backends (S3 / MinIO / Azure / filesystem / memory / database). Public (CDN-direct) + private (access policy + per-object grants) objects, upload constraints, virus-scan hook, on-the-fly image transforms.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"node": ">=24.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@voltro/database": "0.
|
|
47
|
-
"@voltro/env": "0.
|
|
48
|
-
"@voltro/protocol": "0.
|
|
46
|
+
"@voltro/database": "0.82.0",
|
|
47
|
+
"@voltro/env": "0.82.0",
|
|
48
|
+
"@voltro/protocol": "0.82.0"
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
51
|
"@aws-sdk/client-s3": "^3.1134.0",
|