@voltro/plugin-storage 0.85.0 → 0.87.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +5987 -0
  2. package/README.md +77 -0
  3. package/THIRD-PARTY-NOTICES.md +860 -249
  4. package/dist/access.js +47 -0
  5. package/dist/assetRef.js +13 -0
  6. package/dist/avatar.js +39 -0
  7. package/dist/byteSecurity.d.ts +3 -0
  8. package/dist/byteSecurity.js +7 -0
  9. package/dist/connection.js +99 -0
  10. package/dist/constraints.js +93 -0
  11. package/dist/custody.js +132 -0
  12. package/dist/derivatives.js +30 -0
  13. package/dist/env.js +162 -0
  14. package/dist/grant.js +132 -0
  15. package/dist/index.d.ts +525 -203
  16. package/dist/index.js +765 -3196
  17. package/dist/ingest.js +87 -0
  18. package/dist/ingestPolicy.js +1 -0
  19. package/dist/metadataError.js +19 -0
  20. package/dist/objectAbandon.js +16 -0
  21. package/dist/objectLifecycle.js +243 -0
  22. package/dist/objectMetadata.js +308 -0
  23. package/dist/objectWriter.js +87 -0
  24. package/dist/pathDurability.js +16 -0
  25. package/dist/physicalReferences.js +54 -0
  26. package/dist/providers.js +638 -0
  27. package/dist/referenceCatalogue.js +31 -0
  28. package/dist/renditionProof.js +82 -0
  29. package/dist/retainedCapture.js +391 -0
  30. package/dist/retainedObjects.js +190 -0
  31. package/dist/rpc.d.ts +3 -15
  32. package/dist/rpc.js +3 -1
  33. package/dist/scanners.js +46 -0
  34. package/dist/server.d.ts +153 -0
  35. package/dist/server.js +4 -0
  36. package/dist/service.js +1418 -0
  37. package/dist/sourceIdentity.js +14 -0
  38. package/dist/sourcePin.js +35 -0
  39. package/dist/storageNamespaces.js +80 -0
  40. package/dist/storageNumbers.js +13 -0
  41. package/dist/storageObjectNamespaces.js +243 -0
  42. package/dist/storageReferenceInstances.js +52 -0
  43. package/dist/storageRequest.js +10 -0
  44. package/dist/storageRouting.js +46 -0
  45. package/dist/streamBridge.js +33 -0
  46. package/dist/table.js +54 -0
  47. package/dist/transcodeVideo.js +91 -0
  48. package/dist/transform.js +94 -0
  49. package/dist/transformCache.js +31 -0
  50. package/dist/types.d.ts +116 -134
  51. package/dist/types.js +14 -14
  52. package/package.json +17 -6
package/README.md CHANGED
@@ -20,7 +20,84 @@ Installation, guides, the full API reference, and examples all live in the
20
20
  **[Voltro documentation](https://docs.voltro.dev/docs/intro/getting-started)** — the single source of truth. This README is
21
21
  deliberately short so there is nothing here to drift out of date.
22
22
 
23
+ ## Server helpers
24
+
25
+ Import transport connectors and signed grant/upload-session helpers from
26
+ `@voltro/plugin-storage/server` in server code. This entry uses the same
27
+ implementations as the plugin root without loading the plugin registration graph. Browser descriptors use `@voltro/plugin-storage/rpc` and
28
+ `@voltro/plugin-storage/errors`; the server entry is not browser-safe.
29
+
30
+ Server-side operation coordination can observe a durable put with
31
+ `makeStorageObjectMetadata(store).lookup(scope, claim)` without acquiring another
32
+ claim or accessing provider bytes. See the Storage docs for pending/deleted
33
+ states and the unverified execution status.
34
+
35
+ ### Bounded HTTP source reader
36
+
37
+ Server integrations may use `fetchIngestBody(url, maxBytes?, policy?)` to collect
38
+ bounded, interruptible HTTP bytes before validating an expected digest or size.
39
+ The default limit is 64 MiB. Redirects and internal addresses use `IngestPolicy`;
40
+ `allowHosts` exempts named internal hosts, not an exclusive source allow-list.
41
+ The reader creates no references and performs no authorization, scanning or
42
+ persistence. Use `StorageService.put` after validation for the complete storage
43
+ pipeline, bound request duration, and protect network egress against DNS rebinding.
44
+ Redact capability URLs from errors. Bounded buffering is not a process-RSS limit.
45
+
23
46
  ## License
24
47
 
48
+
25
49
  Proprietary. © 2026 Voltro UG. Your use is governed by the
26
50
  [Terms of Service](https://voltro.cloud/legal/terms). See the bundled `LICENSE`.
51
+
52
+
53
+ ### Reference catalogues and combined replica inspection
54
+
55
+ A physical provider namespace identifies object bytes. A reference catalogue identifies the metadata view that lists those objects. They are separate: independent reference stores may use the same provider, and one database may contain views for independent providers or named storage instances.
56
+
57
+ `RefStore.catalogueId` is a required `Effect<string, StorageError>` with a stable SHA-256 identity for its actual catalogue view. Replicas reading the same view must agree; independent catalogues must differ even if their reference IDs or contents match. Custom stores must retain this identity with their metadata. Wrappers forward the underlying effect. `memoryRefStore()` creates one identity per actual map, not per read.
58
+
59
+ Configured default stores initialize `_voltro_storage_reference_catalogue` after normal schema reconciliation. Production starts still require applying the normal schema first. Preserve the catalogue marker on restart, backup and restore. If database copies will run concurrently as independent catalogues, assign them distinct markers through a reviewed stopped-service data migration. Do not treat two independent copies as one catalogue merely because a backup copied its marker.
60
+
61
+ Direct `dataStoreRefStore` consumers register `storageReferenceCatalogueTable`, reconcile their schema and call `ensureStorageReferenceCatalogue(store)` once at boot before inspection. The adapter's `catalogueId` read never writes or repairs missing or corrupt identity. Its view identity additionally includes the configured storage instance and physical provider namespace.
62
+
63
+ The `/refs` and `/stats` inspect reads report their catalogue, provider namespace and storage instance in `source`. Combined reads expose `sources` and attach source identity and answering replica IDs to each reference. Shared catalogue rows and counters appear once; independent catalogues remain separate, including equal reference IDs. The observation envelope retains unavailable-replica evidence. Counts describe reference metadata, not a complete inventory of unindexed provider objects.
64
+
65
+ Each catalogue contributes up to 50 references for the requested page offset. Combined pages can therefore contain more than 50 files. Page advancement moves the same 50-reference window across all catalogues; ordering is newest first within the combined window. This is not global pagination across a single merged index. Divergent snapshots from the same shared catalogue are refused with an explicit comparison/retry message; no responder wins silently and counters are not guessed.
66
+
67
+ The shared Storage browser displays file provenance and catalogue page semantics. Choose one replica before uploading, downloading, sharing, revoking access or deleting. Multi-replica browsing does not fan out file operations. Custom hosts must pass `StoragePage.operationTargetAvailable={false}` while multiple replicas or all replicas are selected, and use a distinct upload scope when the target changes. Server authorization and explicit mutation-target checks remain authoritative.
68
+
69
+ Combined instance choosers offer only identical plugin declarations from every answering replica. Differing or absent installations are named explicitly; select a single replica to inspect those instances. Missing replica answers remain visible in the observation notice.
70
+
71
+ ## Through-app ticket retries
72
+
73
+ With the application's DataStore and default reference/grant stores bound, ordinary and Inspect through-app upload tickets carry one native object operation. The ordinary ticket response exposes its optional `operationId`. Keep the issued upload URL to retry the same transfer: repeated or concurrent POSTs with the same bytes converge on one reference in that physical storage namespace.
74
+
75
+ A provider failure retains the operation's intent and reservation until it is resumed or explicitly retired through the server's object-operation lifecycle. Ticket expiry alone does not release that reservation. Its reference becomes visible after the bytes are confirmed; retrying the same ticket resumes that intent. Different bytes or immutable inputs under that operation are refused with HTTP 409. Upload and resumable HTTP responses retain a provider's declared error status.
76
+
77
+ Pass the returned `operationId` in a fresh authorized `storage.mintUploadTicket` request with the same metadata to renew an expired ticket and resume its retained transfer. A caller can also choose a stable `operationId` before the first request to recover a lost ticket acknowledgement. This identity is scoped to the current upload owner, tenant and configured storage instance; it is not an authorization credential. Omitting `operationId` starts another operation. Custom reference or grant stores do not bind the native object-operation boundary and do not advertise its operation ID. Presigned, resumable and multipart transfers retain their separate transport contracts. Provider I/O stays outside retryable metadata transactions; the operation does not add a later business-authorization check.
78
+
79
+ `useUpload` retains an advertised ticket `operationId` across its automatic through-app retries. To recover a lost first mint reply or an explicit later UI retry, choose `operationId` before the first `upload(file, { operationId, prefer: 'through-app' })` call and retain it with that same file and metadata. A new file or business scope needs a new identity. `uploadMany` rejects one explicit identity shared by multiple files before dispatch. Without native operation support, omit the explicit identity; custom stores do not acquire an exactly-once guarantee. This does not persist a browser transfer across a page reload or extend presigned, resumable or multipart contracts.
80
+
81
+ Object keys are physical provider keys. Native operation-backed writes use their existing content-addressed namespace; use the reference ID and approved ticket binding instead of inferring authority from a logical path inside a physical key.
82
+
83
+ ## Observe a durable operation from trusted server code
84
+
85
+ `StorageService.operationStatus({ operationId, tenantId })` reads the exact original put identity in the selected service's configured instance, actual reference catalogue, physical namespace and logical bucket. Supply the tenant explicitly, including `null` for a global operation. Every result includes an opaque `scope` identifying that destination; recovery code must compare it with its retained scope.
86
+
87
+ The states are `absent`, `reserved`, `ready`, `deleting` and `deleted`. Only `ready` includes a matching readable `ref`. Unsupported, unbound, inconsistent or unavailable metadata fails with `StorageError`; it never becomes `absent`. The observation does not reserve, put, claim, delete, read provider bytes or retry a provider operation. Existing operation IDs and tables do not change.
88
+
89
+ Authorize the business operation before using this trusted server API. It is not a client RPC or access-policy check. Absence is an observation of this metadata view, not proof that an earlier provider request did nothing. Readiness does not prove current provider bytes, continued liveness or application-level artifact validity. Verify those separately, and keep the original operation identity when the outcome is uncertain. Custom `StorageServiceShape` implementations must add this method or return a typed unsupported `StorageError`; the standard service implements it.
90
+
91
+ ## HTTPS-only source reads
92
+
93
+ `IngestPolicy.requireHttps: true` requires HTTPS at the initial URL and every
94
+ redirect before fetching. Host allowlisting does not bypass it. The default is
95
+ false. This applies to `fetchIngestBody` and configured URL ingestion while
96
+ preserving the existing byte, redirect, address and cancellation boundaries.
97
+
98
+ ## Signed token deadlines
99
+
100
+ Native signed read grants and upload, finalize, resumable and multipart tickets expire at their signed Unix-second deadline. Verification refuses the exact deadline and every later instant; a zero-second lifetime grants no usable interval. Obtain a new token through the authorized issuer when another transfer or read is needed.
101
+
102
+ The ticket keeps its approved owner, tenant, key and access policy. Its deadline does not turn redemption into a session login or rerun the application's authorization function. Provider-presigned URLs retain their provider's expiry contract; this rule concerns Voltro's native signed tokens.
103
+