feat: persistent memories (#15953)

feat: memories

refactor

chore: use heart as favorite icon

fix: linting
This commit is contained in:
Jason Rasmussen 2025-02-21 13:31:37 -05:00 committed by GitHub
parent 502f6e020d
commit d350022dec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 585 additions and 70 deletions

View file

@ -3146,7 +3146,41 @@
"/memories": {
"get": {
"operationId": "searchMemories",
"parameters": [],
"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": {
@ -9882,7 +9916,9 @@
"enum": [
"person-cleanup",
"tag-cleanup",
"user-cleanup"
"user-cleanup",
"memory-cleanup",
"memory-create"
],
"type": "string"
},
@ -10039,6 +10075,10 @@
"format": "date-time",
"type": "string"
},
"hideAt": {
"format": "date-time",
"type": "string"
},
"id": {
"type": "string"
},
@ -10056,6 +10096,10 @@
"format": "date-time",
"type": "string"
},
"showAt": {
"format": "date-time",
"type": "string"
},
"type": {
"allOf": [
{

View file

@ -640,11 +640,13 @@ export type MemoryResponseDto = {
createdAt: string;
data: OnThisDayDto;
deletedAt?: string;
hideAt?: string;
id: string;
isSaved: boolean;
memoryAt: string;
ownerId: string;
seenAt?: string;
showAt?: string;
"type": MemoryType;
updatedAt: string;
};
@ -2222,11 +2224,21 @@ export function reverseGeocode({ lat, lon }: {
...opts
}));
}
export function searchMemories(opts?: Oazapfts.RequestOpts) {
export function searchMemories({ $for, isSaved, isTrashed, $type }: {
$for?: string;
isSaved?: boolean;
isTrashed?: boolean;
$type?: MemoryType;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: MemoryResponseDto[];
}>("/memories", {
}>(`/memories${QS.query(QS.explode({
"for": $for,
isSaved,
isTrashed,
"type": $type
}))}`, {
...opts
}));
}
@ -3565,7 +3577,9 @@ export enum AssetMediaSize {
export enum ManualJobName {
PersonCleanup = "person-cleanup",
TagCleanup = "tag-cleanup",
UserCleanup = "user-cleanup"
UserCleanup = "user-cleanup",
MemoryCleanup = "memory-cleanup",
MemoryCreate = "memory-create"
}
export enum JobName {
ThumbnailGeneration = "thumbnailGeneration",