1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-04 05:50:38 +02:00

feat(server): add memories statistics resource (#19035)

This commit is contained in:
Jonathan Gilbert
2025-06-10 23:47:46 +10:00
committed by GitHub
parent 16745e77d4
commit e88bd74fd2
12 changed files with 352 additions and 17 deletions

View File

@ -742,6 +742,9 @@ export type MemoryCreateDto = {
seenAt?: string;
"type": MemoryType;
};
export type MemoryStatisticsResponseDto = {
total: number;
};
export type MemoryUpdateDto = {
isSaved?: boolean;
memoryAt?: string;
@ -2509,6 +2512,24 @@ export function createMemory({ memoryCreateDto }: {
body: memoryCreateDto
})));
}
export function memoriesStatistics({ $for, isSaved, isTrashed, $type }: {
$for?: string;
isSaved?: boolean;
isTrashed?: boolean;
$type?: MemoryType;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: MemoryStatisticsResponseDto;
}>(`/memories/statistics${QS.query(QS.explode({
"for": $for,
isSaved,
isTrashed,
"type": $type
}))}`, {
...opts
}));
}
export function deleteMemory({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {