@voltro/plugin-storage 0.86.0 → 0.88.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 +5484 -0
- package/README.md +27 -0
- package/THIRD-PARTY-NOTICES.md +2503 -690
- package/dist/access.js +26 -27
- package/dist/assetRef.js +1 -2
- package/dist/avatar.js +1 -2
- package/dist/byteSecurity.d.ts +3 -0
- package/dist/byteSecurity.js +6 -0
- package/dist/connection.js +98 -0
- package/dist/constraints.js +1 -2
- package/dist/custody.js +131 -0
- package/dist/derivatives.js +1 -2
- package/dist/env.js +8 -3
- package/dist/grant.js +90 -71
- package/dist/index.d.ts +453 -215
- package/dist/index.js +709 -537
- package/dist/ingest.js +7 -2
- package/dist/ingestPolicy.js +1 -1
- package/dist/metadataError.js +8 -9
- package/dist/objectAbandon.js +15 -0
- package/dist/objectLifecycle.js +135 -102
- package/dist/objectMetadata.js +253 -96
- package/dist/objectWriter.js +51 -23
- package/dist/pathDurability.js +1 -2
- package/dist/physicalReferences.js +53 -0
- package/dist/providers.js +451 -307
- package/dist/referenceCatalogue.js +1 -2
- package/dist/renditionProof.js +81 -0
- package/dist/retainedCapture.js +390 -0
- package/dist/retainedObjects.js +189 -0
- package/dist/rpc.d.ts +1 -15
- package/dist/rpc.js +1 -2
- package/dist/scanners.js +1 -2
- package/dist/server.d.ts +153 -0
- package/dist/server.js +4 -0
- package/dist/service.js +879 -546
- package/dist/sourceIdentity.js +13 -0
- package/dist/sourcePin.js +34 -0
- package/dist/storageNamespaces.js +52 -29
- package/dist/storageNumbers.js +1 -2
- package/dist/storageObjectNamespaces.js +170 -122
- package/dist/storageReferenceInstances.js +1 -2
- package/dist/storageRequest.js +9 -0
- package/dist/storageRouting.js +45 -0
- package/dist/streamBridge.js +5 -3
- package/dist/table.js +2 -2
- package/dist/transcodeVideo.js +85 -48
- package/dist/transform.js +30 -27
- package/dist/transformCache.js +1 -2
- package/dist/types.d.ts +115 -137
- package/dist/types.js +15 -16
- package/package.json +22 -11
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import { ByteStream } from '@voltro/kv/storage';
|
|
1
2
|
import { Context } from 'effect';
|
|
2
3
|
import { Effect } from 'effect';
|
|
4
|
+
import { isStorageKey } from '@voltro/kv/storage';
|
|
5
|
+
import { ObjectMeta } from '@voltro/kv/storage';
|
|
3
6
|
import { Schema } from 'effect';
|
|
4
7
|
import { StorageAccessPolicy } from '@voltro/protocol';
|
|
5
8
|
import { StorageAccessRule } from '@voltro/protocol';
|
|
6
|
-
import {
|
|
9
|
+
import { StorageAddress } from '@voltro/kv/storage';
|
|
10
|
+
import { storageAddressIdentity } from '@voltro/kv/storage';
|
|
11
|
+
import { StorageDestination } from '@voltro/kv/storage';
|
|
12
|
+
import { StorageDestinationRouter } from '@voltro/kv/storage';
|
|
13
|
+
import { StorageError } from '@voltro/kv/storage';
|
|
14
|
+
import { StorageObjectLocation } from '@voltro/kv/storage';
|
|
15
|
+
import { StorageProvider } from '@voltro/kv/storage';
|
|
16
|
+
import { StorageProviderName } from '@voltro/kv/storage';
|
|
17
|
+
import { StoredObject } from '@voltro/kv/storage';
|
|
18
|
+
import { StoredStream } from '@voltro/kv/storage';
|
|
7
19
|
import { Subject } from '@voltro/protocol';
|
|
8
20
|
import { YieldableError } from 'effect/Cause';
|
|
9
21
|
|
|
@@ -17,14 +29,7 @@ export declare type AccessPolicy = StorageAccessPolicy;
|
|
|
17
29
|
*/
|
|
18
30
|
export declare type AccessRule = StorageAccessRule;
|
|
19
31
|
|
|
20
|
-
|
|
21
|
-
* A lazy stream of bytes — the streaming counterpart to {@link StoredObject}'s
|
|
22
|
-
* eager `bytes`. Backpressured: chunks are pulled on demand, so a multi-GB blob
|
|
23
|
-
* never fully materialises in memory. The error channel is {@link StorageError}
|
|
24
|
-
* so a stream handed to `putStream` carries the same typed failure the rest of
|
|
25
|
-
* the transport does (callers map their source errors into it).
|
|
26
|
-
*/
|
|
27
|
-
export declare type ByteStream = Stream.Stream<Uint8Array, StorageError>;
|
|
32
|
+
export { ByteStream }
|
|
28
33
|
|
|
29
34
|
/** Input to `StorageService.grant`. */
|
|
30
35
|
export declare interface GrantInput {
|
|
@@ -40,6 +45,8 @@ export declare type GrantPermission = 'read' | 'write';
|
|
|
40
45
|
|
|
41
46
|
export declare type GrantPrincipalType = 'user' | 'group' | 'apiKey';
|
|
42
47
|
|
|
48
|
+
export { isStorageKey }
|
|
49
|
+
|
|
43
50
|
/**
|
|
44
51
|
* Filter + page a `StorageService.listRefs` / media-library query. Every
|
|
45
52
|
* filter is optional and ANDed; omit them all to page the whole (tenant-scoped)
|
|
@@ -75,17 +82,15 @@ export declare interface ListRefsResult {
|
|
|
75
82
|
readonly nextOffset: number | null;
|
|
76
83
|
}
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
export declare interface ObjectMeta {
|
|
80
|
-
readonly size: number;
|
|
81
|
-
readonly etag?: string;
|
|
82
|
-
}
|
|
85
|
+
export { ObjectMeta }
|
|
83
86
|
|
|
84
87
|
/** A ref with the server-only `passwordHash` removed — safe to serialize. */
|
|
85
88
|
export declare type PublicStorageRef = Omit<StorageRef, 'passwordHash'>;
|
|
86
89
|
|
|
87
90
|
/** Input to `StorageService.put`. */
|
|
88
91
|
export declare interface PutInput {
|
|
92
|
+
/** Server-owned logical destination; omitted new writes use this plugin's selection. */
|
|
93
|
+
readonly destination?: string;
|
|
89
94
|
readonly bytes: Uint8Array;
|
|
90
95
|
readonly contentType: string;
|
|
91
96
|
/** Active org id — scopes the key prefix + the ref row. */
|
|
@@ -148,6 +153,8 @@ export declare type PutOutcome = 'created' | 'resumed' | 'joined';
|
|
|
148
153
|
/** One derived output a `Transcoder` produces from a source asset. Each becomes
|
|
149
154
|
* a normal storage ref linked back to the original via `derivedFrom`. */
|
|
150
155
|
export declare interface Rendition {
|
|
156
|
+
/** Optional structured producer attestation; unproven outputs keep it absent. */
|
|
157
|
+
readonly derivation?: RenditionDerivation;
|
|
151
158
|
readonly bytes: Uint8Array;
|
|
152
159
|
readonly contentType: string;
|
|
153
160
|
/** Derivative class — e.g. `'rendition'` (a playable variant) or `'poster'`. */
|
|
@@ -156,6 +163,39 @@ export declare interface Rendition {
|
|
|
156
163
|
readonly label?: string;
|
|
157
164
|
}
|
|
158
165
|
|
|
166
|
+
/** Producer attestation. Digests bind a normalized recipe and the observed
|
|
167
|
+
* engine build; the consumer still admits allowed recipes, engines and rights. */
|
|
168
|
+
export declare interface RenditionDerivation {
|
|
169
|
+
readonly recipe: {
|
|
170
|
+
readonly format: string;
|
|
171
|
+
readonly digest: string;
|
|
172
|
+
};
|
|
173
|
+
readonly engine: {
|
|
174
|
+
readonly name: string;
|
|
175
|
+
readonly version: string;
|
|
176
|
+
readonly digest: string;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Storage-verified input/output identity around a producer attestation.
|
|
181
|
+
* Not an approval, rights grant or proof of complete external dependencies. */
|
|
182
|
+
export declare interface RenditionProof extends RenditionDerivation {
|
|
183
|
+
readonly version: 1;
|
|
184
|
+
readonly source: {
|
|
185
|
+
readonly id: string;
|
|
186
|
+
readonly metadataDigest: string;
|
|
187
|
+
readonly checksum: string;
|
|
188
|
+
readonly size: number;
|
|
189
|
+
readonly contentType: string;
|
|
190
|
+
};
|
|
191
|
+
readonly output: {
|
|
192
|
+
readonly checksum: string;
|
|
193
|
+
readonly size: number;
|
|
194
|
+
readonly contentType: string;
|
|
195
|
+
};
|
|
196
|
+
readonly digest: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
159
199
|
/**
|
|
160
200
|
* Access to a private object was refused. Distinct from `StorageError` so
|
|
161
201
|
* handlers can tell "not allowed" (403) from "backend blew up" (5xx) and
|
|
@@ -169,20 +209,15 @@ declare const StorageAccessDenied_base: Schema.Class<StorageAccessDenied, Schema
|
|
|
169
209
|
readonly reason: Schema.String;
|
|
170
210
|
}>, YieldableError>;
|
|
171
211
|
|
|
172
|
-
|
|
173
|
-
* Storage failure. `transient` drives retry — `true` for 429 / 5xx /
|
|
174
|
-
* network blips, `false` for 4xx / config / not-found. Surfaced typed so
|
|
175
|
-
* handlers can `Effect.catchTag('StorageError', …)`.
|
|
176
|
-
*/
|
|
177
|
-
export declare class StorageError extends StorageError_base {
|
|
178
|
-
}
|
|
212
|
+
export { StorageAddress }
|
|
179
213
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
214
|
+
export { storageAddressIdentity }
|
|
215
|
+
|
|
216
|
+
export { StorageDestination }
|
|
217
|
+
|
|
218
|
+
export { StorageDestinationRouter }
|
|
219
|
+
|
|
220
|
+
export { StorageError }
|
|
186
221
|
|
|
187
222
|
/** A persisted, explicit share of one object with one principal. */
|
|
188
223
|
export declare interface StorageGrant {
|
|
@@ -202,100 +237,27 @@ export declare type StorageGuard = (ctx: {
|
|
|
202
237
|
readonly ref: StorageRef;
|
|
203
238
|
}) => boolean | Promise<boolean> | Effect.Effect<boolean>;
|
|
204
239
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
readonly
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
*/
|
|
223
|
-
readonly root?: string;
|
|
224
|
-
readonly name: string;
|
|
225
|
-
/** True when `getUrl` returns a real presigned URL (s3/minio). When
|
|
226
|
-
* false the service serves bytes via the `/_voltro/storage/:id`
|
|
227
|
-
* endpoint instead (filesystem/memory). */
|
|
228
|
-
readonly presigns: boolean;
|
|
229
|
-
readonly put: (key: string, bytes: Uint8Array, meta: {
|
|
230
|
-
readonly contentType: string;
|
|
231
|
-
readonly public?: boolean;
|
|
232
|
-
}) => Effect.Effect<ObjectMeta, StorageError>;
|
|
233
|
-
readonly get: (key: string) => Effect.Effect<StoredObject, StorageError>;
|
|
234
|
-
readonly delete: (key: string) => Effect.Effect<void, StorageError>;
|
|
235
|
-
/** Presigned GET (s3/minio) for private reads. */
|
|
236
|
-
readonly getUrl: (key: string, expiresInSec: number) => Effect.Effect<string, StorageError>;
|
|
237
|
-
/** A direct, cacheable URL for a PUBLIC object — virtual-hosted bucket
|
|
238
|
-
* URL or a configured CDN base. `null` when the provider can't serve
|
|
239
|
-
* publicly without the app (filesystem/memory) → the service falls
|
|
240
|
-
* back to the `/_voltro/storage/:id` route. */
|
|
241
|
-
readonly publicUrl?: (key: string) => string | null;
|
|
242
|
-
/** Make an object publicly readable at the provider, or not (s3/minio with
|
|
243
|
-
* per-object ACLs). Absent where the app decides per request (database,
|
|
244
|
-
* filesystem, memory) — there a ref's visibility is the whole answer. */
|
|
245
|
-
readonly setObjectPublic?: (key: string, isPublic: boolean) => Effect.Effect<void, StorageError>;
|
|
246
|
-
/** Presigned PUT for direct-to-bucket uploads (s3/minio). Absent on
|
|
247
|
-
* providers that can't presign uploads. */
|
|
248
|
-
readonly getUploadUrl?: (key: string, expiresInSec: number, contentType: string) => Effect.Effect<string, StorageError>;
|
|
249
|
-
readonly createMultipartUpload?: (key: string, contentType: string, opts?: {
|
|
250
|
-
readonly public?: boolean;
|
|
251
|
-
}) => Effect.Effect<{
|
|
252
|
-
readonly uploadId: string;
|
|
253
|
-
}, StorageError>;
|
|
254
|
-
readonly presignUploadPart?: (key: string, uploadId: string, partNumber: number, expiresInSec: number) => Effect.Effect<string, StorageError>;
|
|
255
|
-
readonly completeMultipartUpload?: (key: string, uploadId: string, parts: ReadonlyArray<{
|
|
256
|
-
readonly partNumber: number;
|
|
257
|
-
readonly etag: string;
|
|
258
|
-
}>) => Effect.Effect<{
|
|
259
|
-
readonly etag?: string;
|
|
260
|
-
}, StorageError>;
|
|
261
|
-
readonly abortMultipartUpload?: (key: string, uploadId: string) => Effect.Effect<void, StorageError>;
|
|
262
|
-
readonly head: (key: string) => Effect.Effect<ObjectMeta | null, StorageError>;
|
|
263
|
-
/**
|
|
264
|
-
* Stream an object's bytes in chunks instead of buffering the whole blob
|
|
265
|
-
* ({@link get}). Present on backends with a real streaming read (filesystem,
|
|
266
|
-
* s3, azure). OPTIONAL: when a provider omits it, {@link getObjectStream}
|
|
267
|
-
* transparently falls back to `get` + a chunked in-memory stream — correct
|
|
268
|
-
* for the small-blob backends (memory / database) that have nothing to
|
|
269
|
-
* stream from.
|
|
270
|
-
*/
|
|
271
|
-
readonly getStream?: (key: string) => Effect.Effect<StoredStream, StorageError>;
|
|
272
|
-
/**
|
|
273
|
-
* Consume a {@link ByteStream} and store it via the backend's chunked /
|
|
274
|
-
* multipart upload, so a large upload never fully materialises in memory.
|
|
275
|
-
* Present on filesystem (streamed atomic write), s3 (multipart via
|
|
276
|
-
* `@aws-sdk/lib-storage`), azure (`uploadStream`). OPTIONAL: when absent,
|
|
277
|
-
* {@link putObjectStream} buffers the stream and calls `put`. `totalSize`,
|
|
278
|
-
* when the caller knows it (e.g. from an export manifest), lets the backend
|
|
279
|
-
* report an accurate size without a follow-up HEAD.
|
|
280
|
-
*/
|
|
281
|
-
readonly putStream?: (key: string, stream: ByteStream, meta: {
|
|
282
|
-
readonly contentType: string;
|
|
283
|
-
readonly public?: boolean;
|
|
284
|
-
readonly totalSize?: number;
|
|
285
|
-
}) => Effect.Effect<ObjectMeta, StorageError>;
|
|
286
|
-
/**
|
|
287
|
-
* Read a byte range `[start, endInclusive]` (HTTP Range / fd offset). Enables
|
|
288
|
-
* seekable + resumable reads. OPTIONAL and best-effort: whole-object resume
|
|
289
|
-
* already works via content-addressing (skip an asset whose hash is present
|
|
290
|
-
* at the target), so this is an optimisation, not a correctness requirement.
|
|
291
|
-
*/
|
|
292
|
-
readonly getRange?: (key: string, start: number, endInclusive: number) => Effect.Effect<Uint8Array, StorageError>;
|
|
293
|
-
/** Providers that store bytes via the app's DataStore (e.g. `database`)
|
|
294
|
-
* receive it here once it exists — bound by the plugin at boot. */
|
|
295
|
-
readonly bindDataStore?: (store: unknown) => void;
|
|
296
|
-
}
|
|
240
|
+
export { StorageObjectLocation }
|
|
241
|
+
|
|
242
|
+
/** A durable metadata observation, not a claim on the object or a provider HEAD. */
|
|
243
|
+
export declare type StorageOperationState = {
|
|
244
|
+
readonly state: 'absent' | 'reserved' | 'deleting' | 'deleted';
|
|
245
|
+
} | {
|
|
246
|
+
readonly state: 'ready';
|
|
247
|
+
readonly ref: StorageRef;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/** Metadata state qualified by the actual selected storage destination. */
|
|
251
|
+
export declare type StorageOperationStatus = StorageOperationState & {
|
|
252
|
+
/** Configured instance, actual catalogue, physical namespace and logical bucket. */
|
|
253
|
+
readonly scope: string;
|
|
254
|
+
/** Selected logical destination; retain it with the scope before minting a ticket. */
|
|
255
|
+
readonly destination: string;
|
|
256
|
+
};
|
|
297
257
|
|
|
298
|
-
export
|
|
258
|
+
export { StorageProvider }
|
|
259
|
+
|
|
260
|
+
export { StorageProviderName }
|
|
299
261
|
|
|
300
262
|
/**
|
|
301
263
|
* Metadata row for a stored blob — the bytes live in object storage; this
|
|
@@ -335,8 +297,13 @@ export declare interface StorageRef {
|
|
|
335
297
|
readonly derivedFrom?: string | null;
|
|
336
298
|
/** Derivative label — e.g. `'rendition'` / `'poster'`; null on an original. */
|
|
337
299
|
readonly kind?: string | null;
|
|
300
|
+
/** Immutable provenance for an attested transcode; absent on older/unproven refs. */
|
|
301
|
+
readonly renditionProof?: RenditionProof | null;
|
|
338
302
|
}
|
|
339
303
|
|
|
304
|
+
/** Persisted destination ownership is independent of the current write selection. */
|
|
305
|
+
export declare const storageRefAddress: (ref: Pick<StorageRef, "bucket" | "tenantId" | "key">) => StorageAddress;
|
|
306
|
+
|
|
340
307
|
/** An upload was rejected by a constraint (size / content-type / magic-byte
|
|
341
308
|
* mismatch). `reason` is a stable code; `detail` is human-readable. */
|
|
342
309
|
export declare class StorageRejected extends StorageRejected_base {
|
|
@@ -378,8 +345,20 @@ declare const StorageService_base: Context.ServiceClass<StorageService, "@voltro
|
|
|
378
345
|
|
|
379
346
|
/** The service handlers consume: `const storage = yield* StorageService`. */
|
|
380
347
|
export declare interface StorageServiceShape {
|
|
348
|
+
/** Trusted server read of one raw durable put identity in this configured
|
|
349
|
+
* instance/physical namespace/bucket and the explicitly supplied tenant.
|
|
350
|
+
* No access-policy check, claim, byte read, retry write or provider HEAD.
|
|
351
|
+
* Unbound/unsupported/corrupt metadata refuses; it never becomes absence. */
|
|
352
|
+
readonly operationStatus: (input: {
|
|
353
|
+
readonly operationId: string;
|
|
354
|
+
readonly tenantId: string | null;
|
|
355
|
+
readonly destination?: string;
|
|
356
|
+
}) => Effect.Effect<StorageOperationStatus, StorageError>;
|
|
381
357
|
/** Opaque destination binding for manually signed upload-family credentials. */
|
|
382
|
-
readonly uploadTicketScope: (
|
|
358
|
+
readonly uploadTicketScope: (input?: {
|
|
359
|
+
readonly tenantId?: string | null;
|
|
360
|
+
readonly destination?: string;
|
|
361
|
+
}) => Effect.Effect<string, StorageError>;
|
|
383
362
|
/** Store bytes. The result is the ref plus this call's `outcome`. */
|
|
384
363
|
readonly put: (input: PutInput) => Effect.Effect<StoredRef, StorageError | StorageRejected | StorageScanRejected>;
|
|
385
364
|
/** Fetch an object's bytes by id. Enforces the tenant guard ONLY — it does
|
|
@@ -550,9 +529,9 @@ export declare interface StorageServiceShape {
|
|
|
550
529
|
readonly contentType: string;
|
|
551
530
|
readonly tenantId?: string | null;
|
|
552
531
|
readonly expiresInSec?: number;
|
|
553
|
-
}) => Effect.Effect<{
|
|
532
|
+
}) => Effect.Effect<StorageAddress & {
|
|
533
|
+
readonly writeScope: string;
|
|
554
534
|
readonly uploadUrl: string;
|
|
555
|
-
readonly key: string;
|
|
556
535
|
readonly expiresInSec: number;
|
|
557
536
|
}, StorageError>;
|
|
558
537
|
/** Promote a blob the client PUT directly to a TEMP `key` into a real ref:
|
|
@@ -561,6 +540,7 @@ export declare interface StorageServiceShape {
|
|
|
561
540
|
* scanned + a non-degraded ref — out of band from the direct PUT. On a scan
|
|
562
541
|
* reject the temp bytes are deleted (fail-closed, nothing promoted). */
|
|
563
542
|
readonly finalizeUpload: (input: {
|
|
543
|
+
readonly destination: string;
|
|
564
544
|
readonly key: string;
|
|
565
545
|
readonly contentType: string;
|
|
566
546
|
readonly tenantId?: string | null;
|
|
@@ -575,6 +555,7 @@ export declare interface StorageServiceShape {
|
|
|
575
555
|
/** Store one chunk of a resumable upload as its own durable `_incoming/<id>/
|
|
576
556
|
* <index>` object. Idempotent — re-PUTting the same index overwrites it. */
|
|
577
557
|
readonly putResumableChunk: (input: {
|
|
558
|
+
readonly destination: string;
|
|
578
559
|
readonly uploadId: string;
|
|
579
560
|
readonly index: number;
|
|
580
561
|
readonly bytes: Uint8Array;
|
|
@@ -584,6 +565,7 @@ export declare interface StorageServiceShape {
|
|
|
584
565
|
* 0 and returns the received byte `offset` + the `nextIndex` to send. Lets a
|
|
585
566
|
* reconnecting client resume instead of restarting. */
|
|
586
567
|
readonly resumableStatus: (input: {
|
|
568
|
+
readonly destination: string;
|
|
587
569
|
readonly uploadId: string;
|
|
588
570
|
readonly tenantId?: string | null;
|
|
589
571
|
}) => Effect.Effect<{
|
|
@@ -594,6 +576,7 @@ export declare interface StorageServiceShape {
|
|
|
594
576
|
* concatenate, run the FULL `put()` pipeline, then delete the chunk objects
|
|
595
577
|
* (on success AND on reject — fail-closed). */
|
|
596
578
|
readonly finalizeResumable: (input: {
|
|
579
|
+
readonly destination: string;
|
|
597
580
|
readonly uploadId: string;
|
|
598
581
|
readonly count: number;
|
|
599
582
|
readonly contentType: string;
|
|
@@ -625,12 +608,14 @@ export declare interface StorageServiceShape {
|
|
|
625
608
|
readonly tenantId?: string | null;
|
|
626
609
|
readonly visibility?: StorageVisibility;
|
|
627
610
|
readonly expiresInSec?: number;
|
|
628
|
-
}) => Effect.Effect<{
|
|
611
|
+
}) => Effect.Effect<StorageAddress & {
|
|
612
|
+
readonly writeScope: string;
|
|
629
613
|
readonly uploadId: string;
|
|
630
|
-
readonly key: string;
|
|
631
614
|
}, StorageError>;
|
|
632
615
|
/** Presign a PUT for one part (1-based `partNumber`). */
|
|
633
616
|
readonly signMultipartPart: (input: {
|
|
617
|
+
readonly destination: string;
|
|
618
|
+
readonly tenantId: string | null;
|
|
634
619
|
readonly key: string;
|
|
635
620
|
readonly uploadId: string;
|
|
636
621
|
readonly partNumber: number;
|
|
@@ -640,6 +625,7 @@ export declare interface StorageServiceShape {
|
|
|
640
625
|
* registered straight from it (size via HEAD, etag as checksum). No fetch-back,
|
|
641
626
|
* so NO scan/derivatives — scan multi-GB out of band. */
|
|
642
627
|
readonly completeMultipart: (input: {
|
|
628
|
+
readonly destination: string;
|
|
643
629
|
readonly key: string;
|
|
644
630
|
readonly uploadId: string;
|
|
645
631
|
readonly parts: ReadonlyArray<{
|
|
@@ -658,6 +644,8 @@ export declare interface StorageServiceShape {
|
|
|
658
644
|
}) => Effect.Effect<StorageRef, StorageError | StorageRejected>;
|
|
659
645
|
/** Abort a multipart session (client cancelled) — frees the bucket's parts. */
|
|
660
646
|
readonly abortMultipart: (input: {
|
|
647
|
+
readonly destination: string;
|
|
648
|
+
readonly tenantId: string | null;
|
|
661
649
|
readonly key: string;
|
|
662
650
|
readonly uploadId: string;
|
|
663
651
|
}) => Effect.Effect<void, StorageError>;
|
|
@@ -667,11 +655,7 @@ export declare interface StorageServiceShape {
|
|
|
667
655
|
* the ref's access policy + grants. Default for a new put is `private`. */
|
|
668
656
|
export declare type StorageVisibility = 'public' | 'private';
|
|
669
657
|
|
|
670
|
-
|
|
671
|
-
export declare interface StoredObject {
|
|
672
|
-
readonly bytes: Uint8Array;
|
|
673
|
-
readonly contentType: string;
|
|
674
|
-
}
|
|
658
|
+
export { StoredObject }
|
|
675
659
|
|
|
676
660
|
/** What `put` returns: the stored ref, plus what this call did to it. The
|
|
677
661
|
* `outcome` is a fact about the CALL, not the row — it is never persisted and
|
|
@@ -680,13 +664,7 @@ export declare type StoredRef = StorageRef & {
|
|
|
680
664
|
readonly outcome: PutOutcome;
|
|
681
665
|
};
|
|
682
666
|
|
|
683
|
-
|
|
684
|
-
* its content type and, when the backend reports it up front, its size. */
|
|
685
|
-
export declare interface StoredStream {
|
|
686
|
-
readonly stream: ByteStream;
|
|
687
|
-
readonly contentType: string;
|
|
688
|
-
readonly size?: number;
|
|
689
|
-
}
|
|
667
|
+
export { StoredStream }
|
|
690
668
|
|
|
691
669
|
/**
|
|
692
670
|
* App-supplied (or first-party `ffmpegTranscoder`) transcode step. Given a
|
package/dist/types.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
reason: t.String
|
|
11
|
-
}) {}, i = class extends t.TaggedError()("StorageRejected", {
|
|
12
|
-
reason: t.String,
|
|
13
|
-
detail: t.String
|
|
1
|
+
import { StorageAddress as e, StorageError as t, isStorageKey as n, storageAddressIdentity as r } from "@voltro/kv/storage";
|
|
2
|
+
import { Context as i, Schema as a } from "effect";
|
|
3
|
+
// src/types.ts
|
|
4
|
+
var o = class extends a.TaggedError()("StorageAccessDenied", {
|
|
5
|
+
refId: a.String,
|
|
6
|
+
reason: a.String
|
|
7
|
+
}) {}, s = class extends a.TaggedError()("StorageRejected", {
|
|
8
|
+
reason: a.String,
|
|
9
|
+
detail: a.String
|
|
14
10
|
}) {
|
|
15
11
|
get message() {
|
|
16
12
|
return this.detail;
|
|
17
13
|
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
}, c = class extends a.TaggedError()("StorageScanRejected", { threat: a.String }) {}, l = class extends i.Service()("@voltro/plugin-storage/StorageService") {}, u = (e) => ({
|
|
15
|
+
destination: e.bucket,
|
|
16
|
+
tenantId: e.tenantId,
|
|
17
|
+
key: e.key
|
|
18
|
+
});
|
|
19
|
+
export { o as StorageAccessDenied, e as StorageAddress, t as StorageError, s as StorageRejected, c as StorageScanRejected, l as StorageService, n as isStorageKey, r as storageAddressIdentity, u as storageRefAddress };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-storage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.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",
|
|
@@ -33,7 +33,17 @@
|
|
|
33
33
|
"import": "./dist/rpc.js",
|
|
34
34
|
"default": "./dist/rpc.js"
|
|
35
35
|
},
|
|
36
|
-
"./package.json": "./package.json"
|
|
36
|
+
"./package.json": "./package.json",
|
|
37
|
+
"./server": {
|
|
38
|
+
"types": "./dist/server.d.ts",
|
|
39
|
+
"import": "./dist/server.js",
|
|
40
|
+
"default": "./dist/server.js"
|
|
41
|
+
},
|
|
42
|
+
"./byte-security": {
|
|
43
|
+
"types": "./dist/byteSecurity.d.ts",
|
|
44
|
+
"import": "./dist/byteSecurity.js",
|
|
45
|
+
"default": "./dist/byteSecurity.js"
|
|
46
|
+
}
|
|
37
47
|
},
|
|
38
48
|
"main": "./dist/index.js",
|
|
39
49
|
"module": "./dist/index.js",
|
|
@@ -43,20 +53,21 @@
|
|
|
43
53
|
"node": ">=24.0.0"
|
|
44
54
|
},
|
|
45
55
|
"dependencies": {
|
|
46
|
-
"@voltro/database": "0.
|
|
47
|
-
"@voltro/env": "0.
|
|
48
|
-
"@voltro/
|
|
49
|
-
"@voltro/
|
|
56
|
+
"@voltro/database": "0.88.0",
|
|
57
|
+
"@voltro/env": "0.88.0",
|
|
58
|
+
"@voltro/kv": "0.88.0",
|
|
59
|
+
"@voltro/protocol": "0.88.0",
|
|
60
|
+
"@voltro/runtime": "0.88.0"
|
|
50
61
|
},
|
|
51
62
|
"optionalDependencies": {
|
|
52
|
-
"@aws-sdk/client-s3": "^3.
|
|
53
|
-
"@aws-sdk/lib-storage": "^3.
|
|
54
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
55
|
-
"@azure/storage-blob": "^12.
|
|
63
|
+
"@aws-sdk/client-s3": "^3.1159.0",
|
|
64
|
+
"@aws-sdk/lib-storage": "^3.1159.0",
|
|
65
|
+
"@aws-sdk/s3-request-presigner": "^3.1159.0",
|
|
66
|
+
"@azure/storage-blob": "^12.34.0",
|
|
56
67
|
"sharp": "^0.35.5"
|
|
57
68
|
},
|
|
58
69
|
"peerDependencies": {
|
|
59
|
-
"effect": "4.0
|
|
70
|
+
"effect": "4.1.0"
|
|
60
71
|
},
|
|
61
72
|
"publishConfig": {
|
|
62
73
|
"access": "public"
|