Expand description
Tauri commands for object listing and mutations.
§Commands
objects_list— hierarchical listing (delimiter="/") with SWR cache and validation gate.objects_list_flat— flat listing (no delimiter) with validation gate.object_copy— server-side copy with cross-account fallback.object_move— server-side copy + delete source.object_create_folder— PUT zero-byteprefix/placeholder.object_delete_batch— batched delete with partial-failure reporting (AC-4).object_set_metadata— replace user-defined metadata via self-overwrite CopyObject.object_set_tags— set or clear object tags via PutObjectTagging / DeleteObjectTagging.object_presign— generate a presigned GetObject URL with configurable expiry.cross_account_confirm— mint a one-time confirmation token for a large cross-account copy.
§Validation gate (AC-8 / round-1 finding #9)
All commands refuse to serve any data when profile.validated_at is None.
The cache itself also enforces this, but the command boundary check is
defence-in-depth: a future refactor of the cache must not silently lift the gate.
§Caching
Only first-page requests (no continuation_token) are cached, because the
token is derived from the previous page and is therefore not stable across
sessions. Subsequent pages bypass the cache and always hit S3.
The flat variant uses a separate cache key — the prefix is suffixed with
"__FLAT__" — so hierarchical and flat listings for the same prefix do
not collide in the cache.
§Mutation → cache invalidation → event
Every mutating command follows this sequence after a successful S3 call:
- Invalidate the affected
CacheKey::Objectsprefix(es). - Emit
objects:updated { profileId, bucket, prefix }for each affected prefix so the frontend’s TanStack Query adapter invalidates its local cache.
Structs§
- Delete
Key - One key (with optional version ID) in a batch delete request.
- Object
Ref - Reference to a single S3 object: bucket + full key.
- Objects
Updated 🔒Payload - Payload emitted as
objects:updatedafter every mutation.
Functions§
- cross_
account_ confirm - Mint a one-time confirmation token for a large cross-account copy.
- emit_
objects_ 🔒updated - Emit
objects:updatedfor one (profile, bucket, prefix) triple. - object_
copy - Copy
sourcetodestinationwith automatic cross-account fallback. - object_
create_ folder - Create a virtual folder placeholder at
bucket/prefix/. - object_
delete_ batch - Delete
keysfrombucketusing the S3 batchedDeleteObjectsAPI. - object_
get_ bytes - Fetch the first
max_bytesbytes of an S3 object as a base64-encoded string. - object_
get_ text - Fetch the first
max_bytesbytes of an S3 object as UTF-8 text. - object_
move - Move
sourcetodestination: server-side copy then delete source. - object_
presign - Generate a presigned
GetObjectURL forbucket/key. - object_
put_ text - Write a UTF-8 text body to
bucket/key. - object_
set_ metadata - Replace user-defined metadata on
bucket/key. - object_
set_ storage_ class - Change the storage class of one or more objects.
- object_
set_ tags - Set (or clear) the tags on
bucket/key. - objects_
list - List objects under
prefixusingdelimiter="/". - objects_
list_ flat - List all objects under
prefixwithout a delimiter (flat key tree).