feat: a wanted list — follow artists on release-type profiles; requests and re-acquisition become wants (M502 #5520)
release / govulncheck (push) Successful in 15s
release / web (push) Failing after 1m21s
release / go (push) Successful in 1m35s
release / integration (push) Failing after 4m57s
release / android (push) Successful in 5m11s
release / Build signed APK (releases and dev) (push) Successful in 5m28s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

Minstrel keeps its own list of what it is to get, keyed by MusicBrainz
release group. A want comes from an approved request, a new release by a
followed artist, or an album whose files went missing, and is held once the
library has a full edition of it.

- Migration 0081: release_type_profiles (Standard seeded: Album, EP,
  Single, studio only), follows, follow_seen_groups and wants.
  lidarr_requests becomes requests with plain *_mbid columns; approved
  album and track requests move onto the wanted list, approved artist
  requests become follows, and the library's album artists start out
  followed. missing_reacquisitions and the retry settings go.
- internal/wanted: follows are checked against MusicBrainz discographies
  daily. The first check sets a baseline, and only releases after it are
  wanted unless the follow asked for what already exists. Profiles filter
  by primary and secondary type, so live recordings stay out unless a
  profile ticks Live.
- internal/requests (was lidarrrequests): approving puts the request on
  the wanted list, and an artist request can be approved on a chosen
  profile. A request completes when its want is held.
- The re-acquisition sweeper wants a missing album back instead of asking
  Lidarr; searching for it is the search schedule's (#5521).
- Web: an admin Wanted page (Wanted, Missing files, Held, Following), a
  follow control on artist pages, a release-type profiles card on
  Integrations, "Approve on a profile" on Requests, and want state on
  Missing files. The artist detail API returns the artist's MBID.
- Android: the request body sends artist_mbid, album_mbid and track_mbid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 00:46:22 -04:00
co-authored by Claude Opus 5.5
parent 867f52358c
commit 04515a977c
93 changed files with 6522 additions and 4484 deletions
+8 -16
View File
@@ -32,7 +32,7 @@ import type {
LidarrConfig,
LidarrQualityProfile,
LidarrQuarantineActionRow,
LidarrRequest,
MusicRequest,
LidarrRootFolder
} from './types';
@@ -45,19 +45,17 @@ const baseConfig: LidarrConfig = {
default_root_folder_path: '/music'
};
const baseRow: LidarrRequest = {
const baseRow: MusicRequest = {
id: 'r1',
user_id: 'u1',
status: 'pending',
kind: 'album',
lidarr_artist_mbid: 'art-mbid',
lidarr_album_mbid: 'alb-mbid',
lidarr_track_mbid: null,
artist_mbid: 'art-mbid',
album_mbid: 'alb-mbid',
track_mbid: null,
artist_name: 'Aphex Twin',
album_title: 'Drukqs',
track_title: null,
quality_profile_id: null,
root_folder_path: null,
decided_at: null,
decided_by: null,
notes: null,
@@ -187,16 +185,10 @@ describe('approveRequest', () => {
expect(api.post).toHaveBeenCalledWith('/api/admin/requests/r1/approve', {});
});
test('forwards quality_profile_id + root_folder_path overrides', async () => {
test('sends the chosen release-type profile', async () => {
(api.post as ReturnType<typeof vi.fn>).mockResolvedValueOnce(baseRow);
await approveRequest('r1', {
quality_profile_id: 2,
root_folder_path: '/music'
});
expect(api.post).toHaveBeenCalledWith('/api/admin/requests/r1/approve', {
quality_profile_id: 2,
root_folder_path: '/music'
});
await approveRequest('r1', 'p1');
expect(api.post).toHaveBeenCalledWith('/api/admin/requests/r1/approve', { profile_id: 'p1' });
});
});
+18 -20
View File
@@ -16,8 +16,8 @@ import type {
LidarrMetadataProfile,
LidarrQualityProfile,
LidarrQuarantineActionRow,
LidarrRequest,
LidarrRequestStatus,
MusicRequest,
RequestStatus,
LidarrRootFolder,
LidarrTestResult,
PlaybackErrorResolution
@@ -57,31 +57,33 @@ export async function listRootFolders(): Promise<LidarrRootFolder[]> {
// Admin request queue -----------------------------------------------------
export async function listAdminRequests(
status?: LidarrRequestStatus,
status?: RequestStatus,
limit?: number
): Promise<LidarrRequest[]> {
): Promise<MusicRequest[]> {
const params = new URLSearchParams();
if (status) params.set('status', status);
if (limit !== undefined) params.set('limit', String(limit));
const qs = params.toString();
return api.get<LidarrRequest[]>(
return api.get<MusicRequest[]>(
qs ? `/api/admin/requests?${qs}` : '/api/admin/requests'
);
}
export async function approveRequest(
id: string,
overrides: { quality_profile_id?: number; root_folder_path?: string } = {}
): Promise<LidarrRequest> {
return api.post<LidarrRequest>(`/api/admin/requests/${id}/approve`, overrides);
// Approving puts the request on the wanted list (M502 #5520). An artist
// request is followed on profileId, or the default profile when omitted.
export async function approveRequest(id: string, profileId?: string): Promise<MusicRequest> {
return api.post<MusicRequest>(
`/api/admin/requests/${id}/approve`,
profileId ? { profile_id: profileId } : {}
);
}
export async function rejectRequest(
id: string,
notes?: string
): Promise<LidarrRequest> {
): Promise<MusicRequest> {
const body = notes !== undefined ? { notes } : {};
return api.post<LidarrRequest>(`/api/admin/requests/${id}/reject`, body);
return api.post<MusicRequest>(`/api/admin/requests/${id}/reject`, body);
}
// Query factories ---------------------------------------------------------
@@ -122,7 +124,7 @@ export function createRootFoldersQuery(enabled: boolean = true) {
});
}
export function createAdminRequestsQuery(status?: LidarrRequestStatus) {
export function createAdminRequestsQuery(status?: RequestStatus) {
return createQuery({
queryKey: qk.adminRequests(status),
queryFn: () => listAdminRequests(status),
@@ -131,13 +133,13 @@ export function createAdminRequestsQuery(status?: LidarrRequestStatus) {
// until the operator acts on them.
refetchInterval: (query) => {
if (status !== 'approved') return false;
const rows = query.state.data as LidarrRequest[] | undefined;
const rows = query.state.data as MusicRequest[] | undefined;
return hasInFlightRequest(rows) ? 12_000 : false;
}
});
}
function hasInFlightRequest(rows: readonly LidarrRequest[] | undefined): boolean {
function hasInFlightRequest(rows: readonly MusicRequest[] | undefined): boolean {
return rows?.some((r) => r.status === 'approved') ?? false;
}
@@ -973,12 +975,8 @@ export async function setSuspectVerdict(trackId: string, verdict: SuspectVerdict
export type ReacquisitionSettings = {
enabled: boolean;
grace_hours: number;
backoff_base_hours: number;
backoff_max_hours: number;
max_attempts: number;
max_per_pass: number;
auto_approve: boolean;
// Albums with missing files that can never be auto-requested because
// Albums with missing files that can never be wanted automatically because
// neither they nor their artist carries an MBID. Read-only; the server
// computes it, and the card states it so the gap isn't a mystery.
unnameable_albums: number;
+3 -3
View File
@@ -1,14 +1,14 @@
import { createQuery } from '@tanstack/svelte-query';
import { api } from './client';
import { qk } from './queries';
import type { CatalogueSearchResult, LidarrRequestKind } from './types';
import type { CatalogueSearchResult, RequestKind } from './types';
// searchCatalogue asks MusicBrainz through Minstrel's release catalogue
// (M502 #5519). URLSearchParams handles encoding (spaces, quotes,
// ampersands) so callers can pass q raw.
export async function searchCatalogue(
q: string,
kind: LidarrRequestKind
kind: RequestKind
): Promise<CatalogueSearchResult[]> {
const params = new URLSearchParams({ q, kind });
return api.get<CatalogueSearchResult[]>(`/api/catalogue/search?${params.toString()}`);
@@ -16,7 +16,7 @@ export async function searchCatalogue(
// MusicBrainz allows a request a second, so a repeated search within a minute
// is served from the client's cache rather than asked again.
export function createCatalogueSearchQuery(q: string, kind: LidarrRequestKind) {
export function createCatalogueSearchQuery(q: string, kind: RequestKind) {
return createQuery({
queryKey: qk.catalogueSearch(q, kind),
queryFn: () => searchCatalogue(q, kind),
+6
View File
@@ -39,6 +39,12 @@ export const qk = {
lidarrRootFolders: () => ['lidarrRootFolders'] as const,
adminRequests: (status?: string) =>
['adminRequests', { status: status ?? 'all' }] as const,
// Wanted list (M502 #5520). Wants sit under ['adminWants'] so one prefix
// invalidation refreshes every tab and its counts.
adminWants: (state: string) => ['adminWants', { state }] as const,
adminFollows: () => ['adminFollows'] as const,
adminFollow: (artistMbid: string) => ['adminFollow', artistMbid] as const,
releaseProfiles: () => ['releaseProfiles'] as const,
myQuarantine: () => ['myQuarantine'] as const,
adminQuarantine: () => ['adminQuarantine'] as const,
adminQuarantineActions: (limit?: number) =>
+21 -23
View File
@@ -19,21 +19,19 @@ import {
} from './requests';
import { api, apiFetch } from './client';
import { qk } from './queries';
import type { LidarrRequest } from './types';
import type { MusicRequest } from './types';
const mockRow: LidarrRequest = {
const mockRow: MusicRequest = {
id: 'r1',
user_id: 'u1',
status: 'pending',
kind: 'album',
lidarr_artist_mbid: 'art-mbid',
lidarr_album_mbid: 'alb-mbid',
lidarr_track_mbid: null,
artist_mbid: 'art-mbid',
album_mbid: 'alb-mbid',
track_mbid: null,
artist_name: 'Aphex Twin',
album_title: 'Selected Ambient Works',
track_title: null,
quality_profile_id: null,
root_folder_path: null,
decided_at: null,
decided_by: null,
notes: null,
@@ -60,16 +58,16 @@ describe('createRequest', () => {
(api.post as ReturnType<typeof vi.fn>).mockResolvedValueOnce(mockRow);
const out = await createRequest({
kind: 'album',
lidarr_artist_mbid: 'art-mbid',
lidarr_album_mbid: 'alb-mbid',
artist_mbid: 'art-mbid',
album_mbid: 'alb-mbid',
artist_name: 'Aphex Twin',
album_title: 'Selected Ambient Works'
});
expect(api.post).toHaveBeenCalledWith('/api/requests', {
kind: 'album',
lidarr_artist_mbid: 'art-mbid',
artist_mbid: 'art-mbid',
artist_name: 'Aphex Twin',
lidarr_album_mbid: 'alb-mbid',
album_mbid: 'alb-mbid',
album_title: 'Selected Ambient Works'
});
expect(out).toBe(mockRow);
@@ -79,10 +77,10 @@ describe('createRequest', () => {
(api.post as ReturnType<typeof vi.fn>).mockResolvedValueOnce(mockRow);
await createRequest({
kind: 'artist',
lidarr_artist_mbid: 'art-mbid',
artist_mbid: 'art-mbid',
artist_name: 'Aphex Twin',
lidarr_album_mbid: '',
lidarr_track_mbid: ''
album_mbid: '',
track_mbid: ''
});
const body = (api.post as ReturnType<typeof vi.fn>).mock.calls[0][1] as Record<
string,
@@ -90,11 +88,11 @@ describe('createRequest', () => {
>;
expect(body).toEqual({
kind: 'artist',
lidarr_artist_mbid: 'art-mbid',
artist_mbid: 'art-mbid',
artist_name: 'Aphex Twin'
});
expect(body).not.toHaveProperty('lidarr_album_mbid');
expect(body).not.toHaveProperty('lidarr_track_mbid');
expect(body).not.toHaveProperty('album_mbid');
expect(body).not.toHaveProperty('track_mbid');
expect(body).not.toHaveProperty('album_title');
expect(body).not.toHaveProperty('track_title');
});
@@ -103,19 +101,19 @@ describe('createRequest', () => {
(api.post as ReturnType<typeof vi.fn>).mockResolvedValueOnce(mockRow);
await createRequest({
kind: 'track',
lidarr_artist_mbid: 'art-mbid',
lidarr_album_mbid: 'alb-mbid',
lidarr_track_mbid: 'trk-mbid',
artist_mbid: 'art-mbid',
album_mbid: 'alb-mbid',
track_mbid: 'trk-mbid',
artist_name: 'Aphex Twin',
album_title: 'Drukqs',
track_title: 'Avril 14th'
});
expect(api.post).toHaveBeenCalledWith('/api/requests', {
kind: 'track',
lidarr_artist_mbid: 'art-mbid',
artist_mbid: 'art-mbid',
artist_name: 'Aphex Twin',
lidarr_album_mbid: 'alb-mbid',
lidarr_track_mbid: 'trk-mbid',
album_mbid: 'alb-mbid',
track_mbid: 'trk-mbid',
album_title: 'Drukqs',
track_title: 'Avril 14th'
});
+22 -22
View File
@@ -1,7 +1,7 @@
import { createQuery } from '@tanstack/svelte-query';
import { api, apiFetch } from './client';
import { qk } from './queries';
import type { LidarrRequest, LidarrRequestKind } from './types';
import type { MusicRequest, RequestKind } from './types';
/** Cadence for in-flight request polling. Tuned to match the operator's
"fast enough to feel live, slow enough to not hammer the server"
@@ -11,7 +11,7 @@ const POLL_INTERVAL_MS = 12_000;
/** True if any row is mid-ingest (status === 'approved'). The status flips
to 'completed' / 'rejected' when Lidarr finishes, so this predicate
lets the page poll exactly while there's something interesting to watch. */
export function hasInFlightRequest(rows: readonly LidarrRequest[] | undefined): boolean {
export function hasInFlightRequest(rows: readonly MusicRequest[] | undefined): boolean {
return rows?.some((r) => r.status === 'approved') ?? false;
}
@@ -20,21 +20,21 @@ export function hasInFlightRequest(rows: readonly LidarrRequest[] | undefined):
// strings (the backend tolerates either, but this keeps test expectations
// crisp and matches the spec §5 wire shape).
export type CreateRequestParams = {
kind: LidarrRequestKind;
lidarr_artist_mbid: string;
lidarr_album_mbid?: string;
lidarr_track_mbid?: string;
kind: RequestKind;
artist_mbid: string;
album_mbid?: string;
track_mbid?: string;
artist_name: string;
album_title?: string;
track_title?: string;
};
type CreateRequestBody = {
kind: LidarrRequestKind;
lidarr_artist_mbid: string;
kind: RequestKind;
artist_mbid: string;
artist_name: string;
lidarr_album_mbid?: string;
lidarr_track_mbid?: string;
album_mbid?: string;
track_mbid?: string;
album_title?: string;
track_title?: string;
};
@@ -42,33 +42,33 @@ type CreateRequestBody = {
function buildCreateBody(params: CreateRequestParams): CreateRequestBody {
const body: CreateRequestBody = {
kind: params.kind,
lidarr_artist_mbid: params.lidarr_artist_mbid,
artist_mbid: params.artist_mbid,
artist_name: params.artist_name
};
if (params.lidarr_album_mbid) body.lidarr_album_mbid = params.lidarr_album_mbid;
if (params.lidarr_track_mbid) body.lidarr_track_mbid = params.lidarr_track_mbid;
if (params.album_mbid) body.album_mbid = params.album_mbid;
if (params.track_mbid) body.track_mbid = params.track_mbid;
if (params.album_title) body.album_title = params.album_title;
if (params.track_title) body.track_title = params.track_title;
return body;
}
export async function createRequest(params: CreateRequestParams): Promise<LidarrRequest> {
return api.post<LidarrRequest>('/api/requests', buildCreateBody(params));
export async function createRequest(params: CreateRequestParams): Promise<MusicRequest> {
return api.post<MusicRequest>('/api/requests', buildCreateBody(params));
}
export async function listMyRequests(): Promise<LidarrRequest[]> {
return api.get<LidarrRequest[]>('/api/requests');
export async function listMyRequests(): Promise<MusicRequest[]> {
return api.get<MusicRequest[]>('/api/requests');
}
export async function getRequest(id: string): Promise<LidarrRequest> {
return api.get<LidarrRequest>(`/api/requests/${id}`);
export async function getRequest(id: string): Promise<MusicRequest> {
return api.get<MusicRequest>(`/api/requests/${id}`);
}
// Server returns the cancelled row body (not 204) so callers can patch the
// cache without a refetch. api.del's return type is fixed to null, so we
// drop down to apiFetch here to keep typing honest.
export async function cancelRequest(id: string): Promise<LidarrRequest> {
return apiFetch(`/api/requests/${id}`, { method: 'DELETE' }) as Promise<LidarrRequest>;
export async function cancelRequest(id: string): Promise<MusicRequest> {
return apiFetch(`/api/requests/${id}`, { method: 'DELETE' }) as Promise<MusicRequest>;
}
export function createMyRequestsQuery() {
@@ -81,7 +81,7 @@ export function createMyRequestsQuery() {
// refetchIntervalInBackground defaults to false → polling pauses
// while the tab is hidden and resumes on focus.
refetchInterval: (query) =>
hasInFlightRequest(query.state.data as LidarrRequest[] | undefined)
hasInFlightRequest(query.state.data as MusicRequest[] | undefined)
? POLL_INTERVAL_MS
: false
});
+82 -22
View File
@@ -51,6 +51,8 @@ export type ArtistDetail = ArtistRef & {
albums: AlbumRef[];
// Genres across this artist's tracks (#367). Server guarantees an array.
genres: string[];
// MusicBrainz id, which following is keyed by (M502 #5520); "" when none.
mbid: string;
};
export type AlbumDetail = AlbumRef & {
@@ -133,18 +135,18 @@ export type EventRequest =
export type PlayStartedResponse = { play_event_id: string; session_id: string };
export type EventOkResponse = { ok: true };
// Lidarr / requests shared enums + shapes.
// Status + Kind are used across lidarr.ts, requests.ts, and admin.ts so they
// live here. Per-module helpers (CreateRequestParams, etc.) stay in their
// Request shared enums + shapes.
// Status + Kind are used across catalogue.ts, requests.ts, and admin.ts so
// they live here. Per-module helpers (CreateRequestParams, etc.) stay in their
// respective modules.
export type LidarrRequestStatus =
export type RequestStatus =
| 'pending'
| 'approved'
| 'rejected'
| 'completed'
| 'failed';
export type LidarrRequestKind = 'artist' | 'album' | 'track';
export type RequestKind = 'artist' | 'album' | 'track';
// One row of the request search (GET /api/catalogue/search, M502 #5519).
// An album is a MusicBrainz release group; image_url is Minstrel's own art
@@ -163,19 +165,18 @@ export type CatalogueSearchResult = {
// pgtype.UUID and pgtype.Timestamptz JSON-marshal as a native string when
// Valid, and as `null` (or omitted, with omitempty) otherwise. We unify both
// "absent" cases as `string | null` so callers branch on a single check.
export type LidarrRequest = {
export type MusicRequest = {
id: string;
user_id: string;
status: LidarrRequestStatus;
kind: LidarrRequestKind;
lidarr_artist_mbid: string;
lidarr_album_mbid?: string | null;
lidarr_track_mbid?: string | null;
status: RequestStatus;
kind: RequestKind;
artist_mbid: string;
// The album's MusicBrainz release group.
album_mbid?: string | null;
track_mbid?: string | null;
artist_name: string;
album_title?: string | null;
track_title?: string | null;
quality_profile_id?: number | null;
root_folder_path?: string | null;
decided_at?: string | null;
decided_by?: string | null;
notes?: string | null;
@@ -397,16 +398,12 @@ export type AdminMissingTrack = {
last_played_at: string | null;
};
// What the re-acquisition sweeper has done about this group's album (#290).
// null when nothing has been attempted yet — the common case for a folder
// that just went missing, and distinct from attempts: 0, which cannot occur.
// What the wanted list says about this group's album (#290, M502 #5520):
// when it was wanted back, and when the library held it again. null while the
// album is inside the grace window, or when MusicBrainz can't name it.
export type AdminReacquisitionState = {
attempts: number;
last_attempt_at: string | null;
// Projected from the last attempt plus the configured backoff, so it moves
// when the operator edits the schedule. Null once the album has given up.
next_attempt_at: string | null;
gave_up_at: string | null;
wanted_at: string | null;
held_at: string | null;
};
// A directory's worth of missing tracks. The server groups because the unit an
@@ -569,3 +566,66 @@ export type ResolvedDuplicatesResponse = {
offset: number;
items: ResolvedDuplicateActivity[];
};
// Wanted list (M502 #5520) ------------------------------------------------
export type WantReason = 'request' | 'follow' | 'missing';
export type WantState = 'wanted' | 'missing' | 'held';
// One release group on the wanted list. held_at is set once the library
// holds it; artist_id and album_id link into the library when it has them.
export type Want = {
id: string;
release_group_mbid: string;
title: string;
artist_mbid: string;
artist_name: string;
artist_id?: string;
primary_type: string;
secondary_types: string[];
year: string;
reason: WantReason;
requested_by?: string;
album_id?: string;
wanted_at: string;
held_at: string | null;
image_url: string;
};
export type WantCounts = { wanted: number; missing: number; held: number; following: number };
export type WantsPage = Page<Want> & { counts: WantCounts };
export type Follow = {
artist_mbid: string;
artist_name: string;
artist_id?: string;
profile_id: string;
profile_name: string;
followed_at: string;
checked_at: string | null;
open_wants: number;
image_url: string;
};
export type FollowState = { following: boolean; profile_id?: string; profile_name?: string };
// A release-type profile: which kinds of release a follow wants. A group
// passes when its primary type is listed and every secondary type is too;
// no secondary types means studio releases only.
export type ReleaseProfile = {
id: string;
name: string;
primary_types: string[];
secondary_types: string[];
is_default: boolean;
follow_count: number;
};
export type ReleaseProfileInput = Omit<ReleaseProfile, 'id' | 'follow_count'>;
export type ReleaseProfilesResponse = {
profiles: ReleaseProfile[];
primary_types: string[];
secondary_types: string[];
};
+102
View File
@@ -0,0 +1,102 @@
import { createInfiniteQuery, createQuery } from '@tanstack/svelte-query';
import { api } from './client';
import { qk } from './queries';
import type {
Follow,
FollowState,
ReleaseProfile,
ReleaseProfileInput,
ReleaseProfilesResponse,
WantState,
WantsPage
} from './types';
// The wanted list (M502 #5520): release groups Minstrel is to get, the
// artists it follows for new releases, and the release-type profiles that
// say which kinds of release a follow wants.
export async function listWants(state: WantState, offset: number = 0): Promise<WantsPage> {
return api.get<WantsPage>(`/api/admin/wanted?state=${state}&offset=${offset}`);
}
export function wantsNextOffset(last: WantsPage): number | undefined {
const loaded = last.offset + last.items.length;
return last.items.length === 0 || loaded >= last.total ? undefined : loaded;
}
// Loads as the page scrolls (rule 172), one tab at a time.
export function createWantsQuery(state: WantState) {
return createInfiniteQuery({
queryKey: qk.adminWants(state),
queryFn: ({ pageParam }) => listWants(state, pageParam as number),
initialPageParam: 0,
getNextPageParam: wantsNextOffset,
staleTime: 30_000
});
}
export async function removeWant(id: string): Promise<void> {
await api.del(`/api/admin/wanted/${id}`);
}
export async function listFollows(): Promise<Follow[]> {
return api.get<Follow[]>('/api/admin/follows');
}
export function createFollowsQuery() {
return createQuery({
queryKey: qk.adminFollows(),
queryFn: listFollows,
staleTime: 30_000
});
}
export async function getFollow(artistMbid: string): Promise<FollowState> {
return api.get<FollowState>(`/api/admin/follows/${artistMbid}`);
}
export function createFollowQuery(artistMbid: string) {
return createQuery({
queryKey: qk.adminFollow(artistMbid),
queryFn: () => getFollow(artistMbid),
staleTime: 30_000
});
}
// Follows an artist, or moves a follow to another profile. wantExisting also
// wants what the artist has already released that the profile passes and the
// library doesn't hold. An omitted profile is the default.
export async function putFollow(
artistMbid: string,
body: { artist_name: string; profile_id?: string; want_existing?: boolean }
): Promise<FollowState> {
return api.put<FollowState>(`/api/admin/follows/${artistMbid}`, body);
}
export async function deleteFollow(artistMbid: string): Promise<void> {
await api.del(`/api/admin/follows/${artistMbid}`);
}
export async function listReleaseProfiles(): Promise<ReleaseProfilesResponse> {
return api.get<ReleaseProfilesResponse>('/api/admin/release-profiles');
}
export function createReleaseProfilesQuery() {
return createQuery({
queryKey: qk.releaseProfiles(),
queryFn: listReleaseProfiles,
staleTime: 60_000
});
}
export async function createReleaseProfile(body: ReleaseProfileInput): Promise<ReleaseProfile> {
return api.post<ReleaseProfile>('/api/admin/release-profiles', body);
}
export async function updateReleaseProfile(id: string, body: ReleaseProfileInput): Promise<ReleaseProfile> {
return api.put<ReleaseProfile>(`/api/admin/release-profiles/${id}`, body);
}
export async function deleteReleaseProfile(id: string): Promise<void> {
await api.del(`/api/admin/release-profiles/${id}`);
}