forked from Cutlery/immich
parent
fcc3b81745
commit
25c9b779e4
6
mobile/openapi/doc/SystemConfigApi.md
generated
6
mobile/openapi/doc/SystemConfigApi.md
generated
@ -119,7 +119,7 @@ This endpoint does not need any parameter.
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **getMapStyle**
|
# **getMapStyle**
|
||||||
> Object getMapStyle(theme)
|
> Object getMapStyle(theme, key)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -143,9 +143,10 @@ import 'package:openapi/api.dart';
|
|||||||
|
|
||||||
final api_instance = SystemConfigApi();
|
final api_instance = SystemConfigApi();
|
||||||
final theme = ; // MapTheme |
|
final theme = ; // MapTheme |
|
||||||
|
final key = key_example; // String |
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.getMapStyle(theme);
|
final result = api_instance.getMapStyle(theme, key);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling SystemConfigApi->getMapStyle: $e\n');
|
print('Exception when calling SystemConfigApi->getMapStyle: $e\n');
|
||||||
@ -157,6 +158,7 @@ try {
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**theme** | [**MapTheme**](.md)| |
|
**theme** | [**MapTheme**](.md)| |
|
||||||
|
**key** | **String**| | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
13
mobile/openapi/lib/api/system_config_api.dart
generated
13
mobile/openapi/lib/api/system_config_api.dart
generated
@ -102,7 +102,9 @@ class SystemConfigApi {
|
|||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [MapTheme] theme (required):
|
/// * [MapTheme] theme (required):
|
||||||
Future<Response> getMapStyleWithHttpInfo(MapTheme theme,) async {
|
///
|
||||||
|
/// * [String] key:
|
||||||
|
Future<Response> getMapStyleWithHttpInfo(MapTheme theme, { String? key, }) async {
|
||||||
// ignore: prefer_const_declarations
|
// ignore: prefer_const_declarations
|
||||||
final path = r'/system-config/map/style.json';
|
final path = r'/system-config/map/style.json';
|
||||||
|
|
||||||
@ -113,6 +115,9 @@ class SystemConfigApi {
|
|||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
final formParams = <String, String>{};
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
if (key != null) {
|
||||||
|
queryParams.addAll(_queryParams('', 'key', key));
|
||||||
|
}
|
||||||
queryParams.addAll(_queryParams('', 'theme', theme));
|
queryParams.addAll(_queryParams('', 'theme', theme));
|
||||||
|
|
||||||
const contentTypes = <String>[];
|
const contentTypes = <String>[];
|
||||||
@ -132,8 +137,10 @@ class SystemConfigApi {
|
|||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [MapTheme] theme (required):
|
/// * [MapTheme] theme (required):
|
||||||
Future<Object?> getMapStyle(MapTheme theme,) async {
|
///
|
||||||
final response = await getMapStyleWithHttpInfo(theme,);
|
/// * [String] key:
|
||||||
|
Future<Object?> getMapStyle(MapTheme theme, { String? key, }) async {
|
||||||
|
final response = await getMapStyleWithHttpInfo(theme, key: key, );
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
2
mobile/openapi/test/system_config_api_test.dart
generated
2
mobile/openapi/test/system_config_api_test.dart
generated
@ -27,7 +27,7 @@ void main() {
|
|||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
//Future<Object> getMapStyle(MapTheme theme) async
|
//Future<Object> getMapStyle(MapTheme theme, { String key }) async
|
||||||
test('test getMapStyle', () async {
|
test('test getMapStyle', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
@ -5348,6 +5348,14 @@
|
|||||||
"get": {
|
"get": {
|
||||||
"operationId": "getMapStyle",
|
"operationId": "getMapStyle",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "key",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "theme",
|
"name": "theme",
|
||||||
"required": true,
|
"required": true,
|
||||||
|
@ -2422,13 +2422,15 @@ export function getConfigDefaults(opts?: Oazapfts.RequestOpts) {
|
|||||||
...opts
|
...opts
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
export function getMapStyle({ theme }: {
|
export function getMapStyle({ key, theme }: {
|
||||||
|
key?: string;
|
||||||
theme: MapTheme;
|
theme: MapTheme;
|
||||||
}, opts?: Oazapfts.RequestOpts) {
|
}, opts?: Oazapfts.RequestOpts) {
|
||||||
return oazapfts.ok(oazapfts.fetchJson<{
|
return oazapfts.ok(oazapfts.fetchJson<{
|
||||||
status: 200;
|
status: 200;
|
||||||
data: object;
|
data: object;
|
||||||
}>(`/system-config/map/style.json${QS.query(QS.explode({
|
}>(`/system-config/map/style.json${QS.query(QS.explode({
|
||||||
|
key,
|
||||||
theme
|
theme
|
||||||
}))}`, {
|
}))}`, {
|
||||||
...opts
|
...opts
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import Icon from '$lib/components/elements/icon.svelte';
|
import Icon from '$lib/components/elements/icon.svelte';
|
||||||
import { Theme } from '$lib/constants';
|
import { Theme } from '$lib/constants';
|
||||||
import { colorTheme, mapSettings } from '$lib/stores/preferences.store';
|
import { colorTheme, mapSettings } from '$lib/stores/preferences.store';
|
||||||
import { getAssetThumbnailUrl, handlePromiseError } from '$lib/utils';
|
import { getAssetThumbnailUrl, getKey, handlePromiseError } from '$lib/utils';
|
||||||
import { getMapStyle, MapTheme, type MapMarkerResponseDto } from '@immich/sdk';
|
import { getMapStyle, MapTheme, type MapMarkerResponseDto } from '@immich/sdk';
|
||||||
import { mdiCog, mdiMapMarker } from '@mdi/js';
|
import { mdiCog, mdiMapMarker } from '@mdi/js';
|
||||||
import type { Feature, GeoJsonProperties, Geometry, Point } from 'geojson';
|
import type { Feature, GeoJsonProperties, Geometry, Point } from 'geojson';
|
||||||
@ -50,6 +50,7 @@
|
|||||||
$: style = (() =>
|
$: style = (() =>
|
||||||
getMapStyle({
|
getMapStyle({
|
||||||
theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme,
|
theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme,
|
||||||
|
key: getKey(),
|
||||||
}) as Promise<StyleSpecification>)();
|
}) as Promise<StyleSpecification>)();
|
||||||
|
|
||||||
const dispatch = createEventDispatcher<{
|
const dispatch = createEventDispatcher<{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user