mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 23:59:08 +03:00
Adds the query and mutation hooks the version history UI needs, written to the studio `queryOptions` conventions with the endpoint calls stubbed. No mock fixtures: `useObjectVersionsQuery` resolves to an empty list until the Storage API exists, so the version history renders its empty state rather than fabricated data, and swapping in the real endpoint is a one-function change per file. - `object-versions-query.ts` — the version list, plus the `ObjectVersion` and `LifecyclePolicy` types - `object-version-restore-mutation.ts` — promote a noncurrent version to current - `object-version-delete-mutation.ts` — remove one specific version - `object-purge-mutation.ts` — delete an object and all of its versions, bypassing versioning - `VersionHistory.utils.ts` — `computeVersionFate`, the pure rule deciding what removal outlook each version row shows - `BroomSparklesIcon.tsx` — inline SVG for a glyph absent from lucide-react 0.436 The bucket's lifecycle policy is part of the `objectVersions` query key. The prototype read it inside `queryFn` while leaving it out of the key, which left stale expiry labels behind after a policy edit. `computeVersionFate` is carried over from the prototype with its 9 reference cases intact, minus four non-null assertions — the bounds are now narrowed through a nullable local instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>