mirror of
https://github.com/immich-app/immich.git
synced 2025-12-24 01:11:32 +03:00
feat(server): add memories statistics resource (#19035)
This commit is contained in:
@@ -3599,6 +3599,72 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/memories/statistics": {
|
||||
"get": {
|
||||
"operationId": "memoriesStatistics",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "for",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isSaved",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isTrashed",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "type",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MemoryType"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MemoryStatisticsResponseDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Memories"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/memories/{id}": {
|
||||
"delete": {
|
||||
"operationId": "deleteMemory",
|
||||
@@ -10827,6 +10893,17 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"MemoryStatisticsResponseDto": {
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"total"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"MemoryType": {
|
||||
"enum": [
|
||||
"on_this_day"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user