mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-28 21:49:40 +02:00
feat: add artifact list api services
This commit is contained in:
parent
875d3040fa
commit
11d63e4c68
4 changed files with 64 additions and 0 deletions
23
surfsense_web/lib/apis/image-generations-api.service.ts
Normal file
23
surfsense_web/lib/apis/image-generations-api.service.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import {
|
||||
imageGenerationDetail,
|
||||
imageGenerationList,
|
||||
} from "@/contracts/types/image-generations.types";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
||||
const BASE = "/api/v1/image-generations";
|
||||
|
||||
class ImageGenerationsApiService {
|
||||
list = async (searchSpaceId: number, limit = 100) => {
|
||||
const qs = new URLSearchParams({
|
||||
search_space_id: String(searchSpaceId),
|
||||
limit: String(limit),
|
||||
}).toString();
|
||||
return baseApiService.get(`${BASE}?${qs}`, imageGenerationList);
|
||||
};
|
||||
|
||||
getDetail = async (imageGenId: number) => {
|
||||
return baseApiService.get(`${BASE}/${imageGenId}`, imageGenerationDetail);
|
||||
};
|
||||
}
|
||||
|
||||
export const imageGenerationsApiService = new ImageGenerationsApiService();
|
||||
|
|
@ -3,6 +3,7 @@ import {
|
|||
languageOptions,
|
||||
type PodcastSpec,
|
||||
podcastDetail,
|
||||
podcastSummaryList,
|
||||
updateSpecRequest,
|
||||
voiceOption,
|
||||
} from "@/contracts/types/podcast.types";
|
||||
|
|
@ -14,6 +15,14 @@ const BASE = "/api/v1/podcasts";
|
|||
const voiceOptionList = z.array(voiceOption);
|
||||
|
||||
class PodcastsApiService {
|
||||
list = async (searchSpaceId: number, limit = 200) => {
|
||||
const qs = new URLSearchParams({
|
||||
search_space_id: String(searchSpaceId),
|
||||
limit: String(limit),
|
||||
}).toString();
|
||||
return baseApiService.get(`${BASE}?${qs}`, podcastSummaryList);
|
||||
};
|
||||
|
||||
// Full state including the deserialized brief and transcript; thin lifecycle
|
||||
// fields (status, spec, spec_version) also arrive live via Zero.
|
||||
getDetail = async (podcastId: number) => {
|
||||
|
|
|
|||
16
surfsense_web/lib/apis/reports-api.service.ts
Normal file
16
surfsense_web/lib/apis/reports-api.service.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { reportList } from "@/contracts/types/reports.types";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
||||
const BASE = "/api/v1/reports";
|
||||
|
||||
class ReportsApiService {
|
||||
list = async (searchSpaceId: number, limit = 200) => {
|
||||
const qs = new URLSearchParams({
|
||||
search_space_id: String(searchSpaceId),
|
||||
limit: String(limit),
|
||||
}).toString();
|
||||
return baseApiService.get(`${BASE}?${qs}`, reportList);
|
||||
};
|
||||
}
|
||||
|
||||
export const reportsApiService = new ReportsApiService();
|
||||
16
surfsense_web/lib/apis/video-presentations-api.service.ts
Normal file
16
surfsense_web/lib/apis/video-presentations-api.service.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { videoPresentationList } from "@/contracts/types/video-presentations.types";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
||||
const BASE = "/api/v1/video-presentations";
|
||||
|
||||
class VideoPresentationsApiService {
|
||||
list = async (searchSpaceId: number, limit = 200) => {
|
||||
const qs = new URLSearchParams({
|
||||
search_space_id: String(searchSpaceId),
|
||||
limit: String(limit),
|
||||
}).toString();
|
||||
return baseApiService.get(`${BASE}?${qs}`, videoPresentationList);
|
||||
};
|
||||
}
|
||||
|
||||
export const videoPresentationsApiService = new VideoPresentationsApiService();
|
||||
Loading…
Add table
Add a link
Reference in a new issue