refactor(server)!: move markers and style to dedicated map endpoint/controller (#9832)

* move markers and style to dedicated map endpoint

* chore: open api

* chore: clean up repos

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Daniel Dietzler
2024-05-29 17:51:01 +02:00
committed by GitHub
parent 5ef144bf79
commit 5463660746
38 changed files with 980 additions and 839 deletions
+135 -135
View File
@@ -1598,92 +1598,6 @@
]
}
},
"/asset/map-marker": {
"get": {
"operationId": "getMapMarkers",
"parameters": [
{
"name": "fileCreatedAfter",
"required": false,
"in": "query",
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"name": "fileCreatedBefore",
"required": false,
"in": "query",
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"name": "isArchived",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "isFavorite",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "withPartners",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "withSharedAlbums",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/MapMarkerResponseDto"
},
"type": "array"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Asset"
]
}
},
"/asset/memory-lane": {
"get": {
"operationId": "getMemoryLane",
@@ -3131,6 +3045,141 @@
]
}
},
"/map/markers": {
"get": {
"operationId": "getMapMarkers",
"parameters": [
{
"name": "fileCreatedAfter",
"required": false,
"in": "query",
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"name": "fileCreatedBefore",
"required": false,
"in": "query",
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"name": "isArchived",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "isFavorite",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "withPartners",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "withSharedAlbums",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/MapMarkerResponseDto"
},
"type": "array"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Map"
]
}
},
"/map/style.json": {
"get": {
"operationId": "getMapStyle",
"parameters": [
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "theme",
"required": true,
"in": "query",
"schema": {
"$ref": "#/components/schemas/MapTheme"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Map"
]
}
},
"/memories": {
"get": {
"operationId": "searchMemories",
@@ -5512,55 +5561,6 @@
]
}
},
"/system-config/map/style.json": {
"get": {
"operationId": "getMapStyle",
"parameters": [
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "theme",
"required": true,
"in": "query",
"schema": {
"$ref": "#/components/schemas/MapTheme"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"System Config"
]
}
},
"/system-config/storage-template-options": {
"get": {
"operationId": "getStorageTemplateOptions",
+48 -48
View File
@@ -303,14 +303,6 @@ export type AssetJobsDto = {
assetIds: string[];
name: AssetJobName;
};
export type MapMarkerResponseDto = {
city: string | null;
country: string | null;
id: string;
lat: number;
lon: number;
state: string | null;
};
export type MemoryLaneResponseDto = {
assets: AssetResponseDto[];
yearsAgo: number;
@@ -516,6 +508,14 @@ export type ValidateLibraryImportPathResponseDto = {
export type ValidateLibraryResponseDto = {
importPaths?: ValidateLibraryImportPathResponseDto[];
};
export type MapMarkerResponseDto = {
city: string | null;
country: string | null;
id: string;
lat: number;
lon: number;
state: string | null;
};
export type OnThisDayDto = {
year: number;
};
@@ -1518,28 +1518,6 @@ export function runAssetJobs({ assetJobsDto }: {
body: assetJobsDto
})));
}
export function getMapMarkers({ fileCreatedAfter, fileCreatedBefore, isArchived, isFavorite, withPartners, withSharedAlbums }: {
fileCreatedAfter?: string;
fileCreatedBefore?: string;
isArchived?: boolean;
isFavorite?: boolean;
withPartners?: boolean;
withSharedAlbums?: boolean;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: MapMarkerResponseDto[];
}>(`/asset/map-marker${QS.query(QS.explode({
fileCreatedAfter,
fileCreatedBefore,
isArchived,
isFavorite,
withPartners,
withSharedAlbums
}))}`, {
...opts
}));
}
export function getMemoryLane({ day, month }: {
day: number;
month: number;
@@ -1930,6 +1908,42 @@ export function validate({ id, validateLibraryDto }: {
body: validateLibraryDto
})));
}
export function getMapMarkers({ fileCreatedAfter, fileCreatedBefore, isArchived, isFavorite, withPartners, withSharedAlbums }: {
fileCreatedAfter?: string;
fileCreatedBefore?: string;
isArchived?: boolean;
isFavorite?: boolean;
withPartners?: boolean;
withSharedAlbums?: boolean;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: MapMarkerResponseDto[];
}>(`/map/markers${QS.query(QS.explode({
fileCreatedAfter,
fileCreatedBefore,
isArchived,
isFavorite,
withPartners,
withSharedAlbums
}))}`, {
...opts
}));
}
export function getMapStyle({ key, theme }: {
key?: string;
theme: MapTheme;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: object;
}>(`/map/style.json${QS.query(QS.explode({
key,
theme
}))}`, {
...opts
}));
}
export function searchMemories(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
@@ -2568,20 +2582,6 @@ export function getConfigDefaults(opts?: Oazapfts.RequestOpts) {
...opts
}));
}
export function getMapStyle({ key, theme }: {
key?: string;
theme: MapTheme;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: object;
}>(`/system-config/map/style.json${QS.query(QS.explode({
key,
theme
}))}`, {
...opts
}));
}
export function getStorageTemplateOptions(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
@@ -2977,6 +2977,10 @@ export enum JobCommand {
Empty = "empty",
ClearFailed = "clear-failed"
}
export enum MapTheme {
Light = "light",
Dark = "dark"
}
export enum Type2 {
OnThisDay = "on_this_day"
}
@@ -3073,10 +3077,6 @@ export enum ModelType {
FacialRecognition = "facial-recognition",
Clip = "clip"
}
export enum MapTheme {
Light = "light",
Dark = "dark"
}
export enum TimeBucketSize {
Day = "DAY",
Month = "MONTH"