1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

chore: svelte-kit-2 (#6103)

* chore: upgrade svelte

* chore: type imports

* chore: types
This commit is contained in:
Jason Rasmussen 2024-01-20 13:47:41 -05:00 committed by GitHub
parent 4ebb9974ff
commit 6e066aa220
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
108 changed files with 376 additions and 1323 deletions

View File

@ -10,7 +10,8 @@
".": {
"import": "./build/esm/index.js",
"require": "./build/cjs/index.js",
"default": "./build/cjs/index.js"
"default": "./build/cjs/index.js",
"types": "./build/types/index.d.ts"
}
},
"scripts": {

1347
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,8 +23,9 @@
"devDependencies": {
"@faker-js/faker": "^8.0.0",
"@floating-ui/dom": "^1.5.1",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.0.6",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/svelte": "^4.0.3",
"@types/dom-to-image": "^2.6.4",
@ -49,7 +50,7 @@
"tailwindcss": "^3.2.7",
"tslib": "^2.5.0",
"typescript": "^5.0.0",
"vite": "^4.1.4",
"vite": "^5.0.10",
"vitest": "^1.0.4"
},
"type": "module",

View File

@ -7,7 +7,6 @@ import {
AssetJobName,
AuditApi,
AuthenticationApi,
ConfigurationParameters,
FaceApi,
JobApi,
JobName,
@ -53,7 +52,7 @@ class ImmichApi {
return !!this.key;
}
constructor(params: ConfigurationParameters) {
constructor(params: configuration.ConfigurationParameters) {
this.config = new configuration.Configuration(params);
this.activityApi = new ActivityApi(this.config);

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, UserResponseDto } from '@api';
import { api, type UserResponseDto } from '@api';
import { createEventDispatcher } from 'svelte';
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
import { handleError } from '../../utils/handle-error';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { locale } from '$lib/stores/preferences.store';
import { createEventDispatcher } from 'svelte';
import { JobCommand, JobCommandDto, JobCountsDto, QueueStatusDto } from '@api';
import { JobCommand, type JobCommandDto, type JobCountsDto, type QueueStatusDto } from '@api';
import Badge from '$lib/components/elements/badge.svelte';
import JobTileButton from './job-tile-button.svelte';
import JobTileStatus from './job-tile-status.svelte';

View File

@ -5,7 +5,7 @@
} from '$lib/components/shared-components/notification/notification';
import { featureFlags } from '$lib/stores/server-config.store';
import { handleError } from '$lib/utils/handle-error';
import { AllJobStatusResponseDto, api, JobCommand, JobCommandDto, JobName } from '@api';
import { type AllJobStatusResponseDto, api, JobCommand, type JobCommandDto, JobName } from '@api';
import type { ComponentType } from 'svelte';
import {
mdiFaceRecognition,

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, UserResponseDto } from '@api';
import { api, type UserResponseDto } from '@api';
import { createEventDispatcher } from 'svelte';
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';

View File

@ -1,7 +1,7 @@
<svelte:options accessors />
<script lang="ts">
import { SystemConfigDto, api } from '@api';
import { type SystemConfigDto, api } from '@api';
import {
notificationController,
NotificationType,

View File

@ -2,7 +2,7 @@
import {
AudioCodec,
CQMode,
SystemConfigDto,
type SystemConfigDto,
ToneMapping,
TranscodeHWAccel,
TranscodePolicy,

View File

@ -1,11 +1,11 @@
<script lang="ts">
import { api, JobName, SystemConfigDto, SystemConfigJobDto } from '@api';
import { api, JobName, type SystemConfigDto, type SystemConfigJobDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,13 +1,13 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingAccordion from '../setting-accordion.svelte';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import SettingSwitch from '../setting-switch.svelte';
import { isEqual } from 'lodash-es';
import { fade } from 'svelte/transition';
import SettingAccordion from '../setting-accordion.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,12 +1,12 @@
<script lang="ts">
import { LogLevel, SystemConfigDto } from '@api';
import { LogLevel, type SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { fade } from 'svelte/transition';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingSwitch from '../setting-switch.svelte';
import SettingSelect from '../setting-select.svelte';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingSelect from '../setting-select.svelte';
import SettingSwitch from '../setting-switch.svelte';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,14 +1,14 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingAccordion from '../setting-accordion.svelte';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import SettingSwitch from '../setting-switch.svelte';
import SettingAccordion from '../setting-accordion.svelte';
import SettingSelect from '../setting-select.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
import SettingSwitch from '../setting-switch.svelte';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,13 +1,13 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingAccordion from '../setting-accordion.svelte';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingSwitch from '../setting-switch.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
import SettingSwitch from '../setting-switch.svelte';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,11 +1,11 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingSwitch from '../setting-switch.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,13 +1,13 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import ConfirmDisableLogin from '../confirm-disable-login.svelte';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import SettingSwitch from '../setting-switch.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,12 +1,12 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import ConfirmDisableLogin from '../confirm-disable-login.svelte';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingSwitch from '../setting-switch.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,18 +1,18 @@
<script lang="ts">
import { api, SystemConfigDto, SystemConfigTemplateStorageOptionDto } from '@api';
import * as luxon from 'luxon';
import handlebar from 'handlebars';
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
import { user } from '$lib/stores/user.store';
import { api, type SystemConfigDto, type SystemConfigTemplateStorageOptionDto } from '@api';
import handlebar from 'handlebars';
import { isEqual } from 'lodash-es';
import * as luxon from 'luxon';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import SettingSwitch from '../setting-switch.svelte';
import SupportedDatetimePanel from './supported-datetime-panel.svelte';
import SupportedVariablesPanel from './supported-variables-panel.svelte';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import { isEqual } from 'lodash-es';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import { user } from '$lib/stores/user.store';
import { createEventDispatcher } from 'svelte';
import SettingSwitch from '../setting-switch.svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,11 +1,11 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingTextarea from '../setting-textarea.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,13 +1,13 @@
<script lang="ts">
import SettingSelect from '$lib/components/admin-page/settings/setting-select.svelte';
import { Colorspace, SystemConfigDto } from '@api';
import { fade } from 'svelte/transition';
import { isEqual } from 'lodash-es';
import SettingButtonsRow from '$lib/components/admin-page/settings/setting-buttons-row.svelte';
import SettingSelect from '$lib/components/admin-page/settings/setting-select.svelte';
import { Colorspace, type SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import SettingSwitch from '../setting-switch.svelte';
import { createEventDispatcher } from 'svelte';
import type { SettingsEventType } from '../admin-settings';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -1,12 +1,12 @@
<script lang="ts">
import type { SystemConfigDto } from '@api';
import { isEqual } from 'lodash-es';
import { fade } from 'svelte/transition';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingSwitch from '../setting-switch.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import type { SettingsEventType } from '../admin-settings';
import SettingButtonsRow from '../setting-buttons-row.svelte';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import SettingSwitch from '../setting-switch.svelte';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;

View File

@ -2,7 +2,7 @@ import { createObjectURLMock } from '$lib/__mocks__/jsdom-url.mock';
import { api, ThumbnailFormat } from '@api';
import { albumFactory } from '@test-data';
import '@testing-library/jest-dom';
import { fireEvent, render, RenderResult, waitFor } from '@testing-library/svelte';
import { fireEvent, render, type RenderResult, waitFor } from '@testing-library/svelte';
import AlbumCard from '../album-card.svelte';
import type { MockedObject } from 'vitest';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import noThumbnailUrl from '$lib/assets/no-thumbnail.png';
import { locale } from '$lib/stores/preferences.store';
import { AlbumResponseDto, api, ThumbnailFormat, UserResponseDto } from '@api';
import { type AlbumResponseDto, api, ThumbnailFormat, type UserResponseDto } from '@api';
import { createEventDispatcher, onMount } from 'svelte';
import IconButton from '../elements/buttons/icon-button.svelte';
import Icon from '$lib/components/elements/icon.svelte';

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { createEventDispatcher, onMount } from 'svelte';
import { AlbumResponseDto, api, UserResponseDto } from '@api';
import { type AlbumResponseDto, api, type UserResponseDto } from '@api';
import BaseModal from '../shared-components/base-modal.svelte';
import UserAvatar from '../shared-components/user-avatar.svelte';
import CircleIconButton from '../elements/buttons/circle-icon-button.svelte';

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { createEventDispatcher, onMount } from 'svelte';
import { AlbumResponseDto, api, SharedLinkResponseDto, UserResponseDto } from '@api';
import { type AlbumResponseDto, api, type SharedLinkResponseDto, type UserResponseDto } from '@api';
import BaseModal from '../shared-components/base-modal.svelte';
import UserAvatar from '../shared-components/user-avatar.svelte';
import { goto } from '$app/navigation';

View File

@ -3,7 +3,14 @@
import UserAvatar from '../shared-components/user-avatar.svelte';
import { mdiClose, mdiHeart, mdiSend, mdiDotsVertical } from '@mdi/js';
import Icon from '$lib/components/elements/icon.svelte';
import { ActivityResponseDto, api, AssetTypeEnum, ReactionType, ThumbnailFormat, type UserResponseDto } from '@api';
import {
type ActivityResponseDto,
api,
AssetTypeEnum,
ReactionType,
ThumbnailFormat,
type UserResponseDto,
} from '@api';
import { handleError } from '$lib/utils/handle-error';
import { isTenMinutesApart } from '$lib/utils/timesince';
import { clickOutside } from '$lib/utils/click-outside';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { AlbumResponseDto, ThumbnailFormat, api } from '@api';
import { type AlbumResponseDto, ThumbnailFormat, api } from '@api';
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher<{

View File

@ -3,7 +3,7 @@
import { photoZoomState } from '$lib/stores/zoom-image.store';
import { clickOutside } from '$lib/utils/click-outside';
import { getContextMenuPosition } from '$lib/utils/context-menu';
import { AssetJobName, AssetResponseDto, AssetTypeEnum, api } from '@api';
import { AssetJobName, type AssetResponseDto, AssetTypeEnum, api } from '@api';
import {
mdiAlertOutline,
mdiArrowLeft,

View File

@ -1,14 +1,14 @@
<script lang="ts">
import { goto } from '$app/navigation';
import {
ActivityResponseDto,
AlbumResponseDto,
type ActivityResponseDto,
type AlbumResponseDto,
api,
AssetJobName,
AssetResponseDto,
type AssetResponseDto,
AssetTypeEnum,
ReactionType,
SharedLinkResponseDto,
type SharedLinkResponseDto,
} from '@api';
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
import { fly } from 'svelte/transition';

View File

@ -2,7 +2,7 @@
import { locale } from '$lib/stores/preferences.store';
import { featureFlags } from '$lib/stores/server-config.store';
import { getAssetFilename } from '$lib/utils/asset-utils';
import { AlbumResponseDto, AssetResponseDto, ThumbnailFormat, api } from '@api';
import { type AlbumResponseDto, type AssetResponseDto, ThumbnailFormat, api } from '@api';
import { DateTime } from 'luxon';
import { createEventDispatcher, onDestroy } from 'svelte';
import { slide } from 'svelte/transition';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { DownloadProgress, downloadAssets, downloadManager, isDownloading } from '$lib/stores/download';
import { type DownloadProgress, downloadAssets, downloadManager, isDownloading } from '$lib/stores/download';
import { locale } from '$lib/stores/preferences.store';
import { fly, slide } from 'svelte/transition';
import { asByteUnitString } from '../../utils/byte-units';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { fade } from 'svelte/transition';
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
import { api, AssetResponseDto } from '@api';
import { api, type AssetResponseDto } from '@api';
import View360, { EquirectProjection } from '@egjs/svelte-view360';
import './panorama-viewer.css';

View File

@ -2,7 +2,7 @@
import { fade } from 'svelte/transition';
import { onDestroy, onMount } from 'svelte';
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
import { api, AssetResponseDto } from '@api';
import { api, type AssetResponseDto } from '@api';
import { notificationController, NotificationType } from '../shared-components/notification/notification';
import { useZoomImageWheel } from '@zoom-image/svelte';
import { photoZoomState } from '$lib/stores/zoom-image.store';

View File

@ -2,7 +2,7 @@
import { ProjectionType } from '$lib/constants';
import IntersectionObserver from '$lib/components/asset-viewer/intersection-observer.svelte';
import { timeToSeconds } from '$lib/utils/time-to-seconds';
import { api, AssetResponseDto, AssetTypeEnum, ThumbnailFormat } from '@api';
import { api, type AssetResponseDto, AssetTypeEnum, ThumbnailFormat } from '@api';
import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
import ImageThumbnail from './image-thumbnail.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { PersonResponseDto, api } from '@api';
import { type PersonResponseDto, api } from '@api';
import { createEventDispatcher } from 'svelte';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
import Button from '../elements/buttons/button.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { PersonResponseDto, api } from '@api';
import { type PersonResponseDto, api } from '@api';
import { getContextMenuPosition } from '$lib/utils/context-menu';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
import IconButton from '../elements/buttons/icon-button.svelte';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { fly } from 'svelte/transition';
import { linear } from 'svelte/easing';
import { api, type PersonResponseDto, AssetFaceResponseDto, AssetTypeEnum } from '@api';
import { api, type PersonResponseDto, type AssetFaceResponseDto, AssetTypeEnum } from '@api';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
import { handleError } from '$lib/utils/handle-error';
import { createEventDispatcher, onMount } from 'svelte';

View File

@ -3,7 +3,7 @@
import FaceThumbnail from './face-thumbnail.svelte';
import { quintOut } from 'svelte/easing';
import { fly } from 'svelte/transition';
import { api, AssetFaceUpdateItem, type PersonResponseDto } from '@api';
import { api, type AssetFaceUpdateItem, type PersonResponseDto } from '@api';
import ControlAppBar from '../shared-components/control-app-bar.svelte';
import Button from '../elements/buttons/button.svelte';
import { mdiPlus, mdiMerge } from '@mdi/js';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, UserResponseDto } from '@api';
import { api, type UserResponseDto } from '@api';
import { createEventDispatcher } from 'svelte';
import Button from '../elements/buttons/button.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { AlbumResponseDto, api } from '@api';
import { type AlbumResponseDto, api } from '@api';
import { createEventDispatcher } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte';
import Button from '../elements/buttons/button.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, UserResponseDto } from '@api';
import { api, type UserResponseDto } from '@api';
import { createEventDispatcher } from 'svelte';
import { notificationController, NotificationType } from '../shared-components/notification/notification';
import Button from '../elements/buttons/button.svelte';

View File

@ -3,7 +3,7 @@
import { createEventDispatcher, onMount } from 'svelte';
import { featureFlags } from '$lib/stores/server-config.store';
import StorageTemplateSettings from '../admin-page/settings/storage-template/storage-template-settings.svelte';
import { SystemConfigDto, api } from '@api';
import { type SystemConfigDto, api } from '@api';
import { user } from '$lib/stores/user.store';
import AdminSettings from '../admin-page/settings/admin-settings.svelte';
import { mdiArrowLeft, mdiCheck } from '@mdi/js';

View File

@ -7,7 +7,7 @@
notificationController,
} from '$lib/components/shared-components/notification/notification';
import { addAssetsToAlbum } from '$lib/utils/asset-utils';
import { AlbumResponseDto, api } from '@api';
import { type AlbumResponseDto, api } from '@api';
import { getMenuContext } from '../asset-select-context-menu.svelte';
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
import { AppRoute } from '$lib/constants';

View File

@ -5,7 +5,7 @@
import { createEventDispatcher } from 'svelte';
import { featureFlags } from '$lib/stores/server-config.store';
import { mdiTimerSand, mdiDeleteOutline } from '@mdi/js';
import { OnDelete, deleteAssets } from '$lib/utils/actions';
import { type OnDelete, deleteAssets } from '$lib/utils/actions';
import DeleteAssetDialog from '../delete-asset-dialog.svelte';
export let onAssetDelete: OnDelete;

View File

@ -5,7 +5,7 @@
NotificationType,
notificationController,
} from '$lib/components/shared-components/notification/notification';
import { AlbumResponseDto, api } from '@api';
import { type AlbumResponseDto, api } from '@api';
import MenuOption from '../../shared-components/context-menu/menu-option.svelte';
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
import { mdiDeleteOutline } from '@mdi/js';

View File

@ -1,6 +1,6 @@
<script lang="ts">
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import { SharedLinkResponseDto, api } from '@api';
import { type SharedLinkResponseDto, api } from '@api';
import ConfirmDialogue from '../../shared-components/confirm-dialogue.svelte';
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
import { NotificationType, notificationController } from '../../shared-components/notification/notification';

View File

@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader';
import { downloadArchive } from '$lib/utils/asset-utils';
import { api, AssetResponseDto, SharedLinkResponseDto } from '@api';
import { api, type AssetResponseDto, type SharedLinkResponseDto } from '@api';
import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store';
import CircleIconButton from '../elements/buttons/circle-icon-button.svelte';
import DownloadAction from '../photos-page/actions/download-action.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { AlbumResponseDto, api } from '@api';
import { type AlbumResponseDto, api } from '@api';
import { createEventDispatcher, onMount } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte';
import BaseModal from './base-modal.svelte';

View File

@ -5,7 +5,7 @@
import SettingSwitch from '$lib/components/admin-page/settings/setting-switch.svelte';
import Button from '$lib/components/elements/buttons/button.svelte';
import { handleError } from '$lib/utils/handle-error';
import { api, copyToClipboard, makeSharedLinkUrl, SharedLinkResponseDto, SharedLinkType } from '@api';
import { api, copyToClipboard, makeSharedLinkUrl, type SharedLinkResponseDto, SharedLinkType } from '@api';
import { createEventDispatcher, onMount } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte';
import BaseModal from '../base-modal.svelte';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte';
import { getThumbnailSize } from '$lib/utils/thumbnail-util';
import { AssetResponseDto, ThumbnailFormat } from '@api';
import { type AssetResponseDto, ThumbnailFormat } from '@api';
import { createEventDispatcher } from 'svelte';
import { flip } from 'svelte/animate';

View File

@ -2,7 +2,7 @@
import { page } from '$app/stores';
import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte';
import { handleError } from '$lib/utils/handle-error';
import { AssetResponseDto, ThumbnailFormat } from '@api';
import { type AssetResponseDto, ThumbnailFormat } from '@api';
import AssetViewer from '../../asset-viewer/asset-viewer.svelte';
import { flip } from 'svelte/animate';
import { getThumbnailSize } from '$lib/utils/thumbnail-util';

View File

@ -7,7 +7,7 @@
ControlButton,
Control,
ControlGroup,
Map,
type Map,
FullscreenControl,
GeolocateControl,
NavigationControl,
@ -15,7 +15,7 @@
Popup,
} from 'svelte-maplibre';
import { colorTheme, mapSettings } from '$lib/stores/preferences.store';
import { MapMarkerResponseDto, api } from '@api';
import { type MapMarkerResponseDto, api } from '@api';
import maplibregl from 'maplibre-gl';
import type { GeoJSONSource, LngLatLike, StyleSpecification } from 'maplibre-gl';
import type { Feature, Geometry, GeoJsonProperties, Point } from 'geojson';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { mdiClose } from '@mdi/js';
import { createEventDispatcher } from 'svelte';
import { UserAvatarColor, UserResponseDto } from '@api';
import { UserAvatarColor, type UserResponseDto } from '@api';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import FullScreenModal from '../full-screen-modal.svelte';
import UserAvatar from '../user-avatar.svelte';

View File

@ -30,7 +30,11 @@
const logOut = async () => {
resetSavedUser();
const { data } = await api.authenticationApi.logout();
goto(data.redirectUri || '/auth/login?autoLaunch=0');
if (!data.redirectUri.startsWith('/')) {
window.location.href = data.redirectUri;
} else {
goto(data.redirectUri);
}
};
</script>

View File

@ -1,5 +1,5 @@
import '@testing-library/jest-dom';
import { cleanup, render, RenderResult } from '@testing-library/svelte';
import { cleanup, render, type RenderResult } from '@testing-library/svelte';
import { NotificationType } from '../notification';
import NotificationCard from '../notification-card.svelte';

View File

@ -1,5 +1,5 @@
import '@testing-library/jest-dom';
import { render, RenderResult, waitFor } from '@testing-library/svelte';
import { render, type RenderResult, waitFor } from '@testing-library/svelte';
import { get } from 'svelte/store';
import { notificationController, NotificationType } from '../notification';
import NotificationList from '../notification-list.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { AssetResponseDto, api } from '@api';
import { type AssetResponseDto, api } from '@api';
import { createEventDispatcher, onMount } from 'svelte';
import { notificationController, NotificationType } from './notification/notification';
import { handleError } from '$lib/utils/handle-error';

View File

@ -2,7 +2,7 @@
import { page } from '$app/stores';
import { locale, sidebarSettings } from '$lib/stores/preferences.store';
import { featureFlags } from '$lib/stores/server-config.store';
import { AssetApiGetAssetStatisticsRequest, api } from '@api';
import { type AssetApiGetAssetStatisticsRequest, api } from '@api';
import {
mdiAccount,
mdiAccountMultiple,

View File

@ -2,7 +2,7 @@
import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store';
import { websocketStore } from '$lib/stores/websocket';
import { UserResponseDto, api } from '@api';
import { type UserResponseDto, api } from '@api';
import { onMount } from 'svelte';
import { asByteUnitString } from '../../utils/byte-units';
import LoadingSpinner from './loading-spinner.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, AssetResponseDto, SharedLinkResponseDto, SharedLinkType, ThumbnailFormat } from '@api';
import { api, type AssetResponseDto, type SharedLinkResponseDto, SharedLinkType, ThumbnailFormat } from '@api';
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import * as luxon from 'luxon';

View File

@ -3,7 +3,7 @@
notificationController,
NotificationType,
} from '$lib/components/shared-components/notification/notification';
import { api, ApiError } from '@api';
import { api, type ApiError } from '@api';
import { fade } from 'svelte/transition';
import SettingInputField, { SettingInputFieldType } from '../admin-page/settings/setting-input-field.svelte';
import Button from '../elements/buttons/button.svelte';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { locale } from '$lib/stores/preferences.store';
import type { AuthDeviceResponseDto } from '@api';
import { DateTime, ToRelativeCalendarOptions } from 'luxon';
import { DateTime, type ToRelativeCalendarOptions } from 'luxon';
import { createEventDispatcher } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte';
import {

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, AuthDeviceResponseDto } from '@api';
import { api, type AuthDeviceResponseDto } from '@api';
import { handleError } from '../../utils/handle-error';
import Button from '../elements/buttons/button.svelte';
import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, LibraryResponseDto, LibraryType, LibraryStatsResponseDto } from '@api';
import { api, type LibraryResponseDto, LibraryType, type LibraryStatsResponseDto } from '@api';
import { onMount } from 'svelte';
import Button from '../elements/buttons/button.svelte';
import { notificationController, NotificationType } from '../shared-components/notification/notification';

View File

@ -3,7 +3,7 @@
notificationController,
NotificationType,
} from '$lib/components/shared-components/notification/notification';
import { api, UserResponseDto } from '@api';
import { api, type UserResponseDto } from '@api';
import { fade } from 'svelte/transition';
import { handleError } from '../../utils/handle-error';
import SettingSwitch from '../admin-page/settings/setting-switch.svelte';

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { featureFlags } from '$lib/stores/server-config.store';
import { oauth, UserResponseDto } from '@api';
import { oauth, type UserResponseDto } from '@api';
import { onMount } from 'svelte';
import { fade } from 'svelte/transition';
import { handleError } from '../../utils/handle-error';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, UserResponseDto } from '@api';
import { api, type UserResponseDto } from '@api';
import BaseModal from '../shared-components/base-modal.svelte';
import UserAvatar from '../shared-components/user-avatar.svelte';
import ImmichLogo from '../shared-components/immich-logo.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { PartnerResponseDto, UserResponseDto, api } from '@api';
import { type PartnerResponseDto, type UserResponseDto, api } from '@api';
import UserAvatar from '../shared-components/user-avatar.svelte';
import Button from '../elements/buttons/button.svelte';
import PartnerSelectionModal from './partner-selection-modal.svelte';

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { api, APIKeyResponseDto } from '@api';
import { api, type APIKeyResponseDto } from '@api';
import Icon from '$lib/components/elements/icon.svelte';
import { fade } from 'svelte/transition';
import { handleError } from '../../utils/handle-error';

View File

@ -3,7 +3,7 @@
notificationController,
NotificationType,
} from '$lib/components/shared-components/notification/notification';
import { api, UserResponseDto } from '@api';
import { api, type UserResponseDto } from '@api';
import { fade } from 'svelte/transition';
import { handleError } from '../../utils/handle-error';
import SettingInputField, { SettingInputFieldType } from '../admin-page/settings/setting-input-field.svelte';

View File

@ -2,7 +2,7 @@
import { browser } from '$app/environment';
import { page } from '$app/stores';
import { featureFlags } from '$lib/stores/server-config.store';
import { APIKeyResponseDto, AuthDeviceResponseDto, oauth } from '@api';
import { type APIKeyResponseDto, type AuthDeviceResponseDto, oauth } from '@api';
import SettingAccordion from '../admin-page/settings/setting-accordion.svelte';
import ChangePasswordSettings from './change-password-settings.svelte';
import DeviceList from './device-list.svelte';

View File

@ -1,7 +1,7 @@
import { api, AssetApiGetTimeBucketsRequest, AssetResponseDto, TimeBucketSize } from '@api';
import { api, type AssetApiGetTimeBucketsRequest, type AssetResponseDto, TimeBucketSize } from '@api';
import { throttle } from 'lodash-es';
import { DateTime } from 'luxon';
import { Unsubscriber, writable } from 'svelte/store';
import { type Unsubscriber, writable } from 'svelte/store';
import { handleError } from '../utils/handle-error';
import { websocketStore } from './websocket';

View File

@ -1,4 +1,4 @@
import { api, ServerConfigDto, ServerFeaturesDto } from '@api';
import { api, type ServerConfigDto, type ServerFeaturesDto } from '@api';
import { writable } from 'svelte/store';
export type FeatureFlags = ServerFeaturesDto & { loaded: boolean };

View File

@ -2,12 +2,12 @@ import { notificationController, NotificationType } from '$lib/components/shared
import { downloadManager } from '$lib/stores/download';
import {
api,
BulkIdResponseDto,
AssetResponseDto,
DownloadResponseDto,
DownloadInfoDto,
type BulkIdResponseDto,
type AssetResponseDto,
type DownloadResponseDto,
type DownloadInfoDto,
AssetTypeEnum,
UserResponseDto,
type UserResponseDto,
} from '@api';
import { handleError } from './handle-error';

View File

@ -24,11 +24,11 @@ export const authenticate = async (options?: AuthOptions) => {
const user = savedUser || (await getAuthUser());
if (!user) {
throw redirect(302, AppRoute.AUTH_LOGIN);
redirect(302, AppRoute.AUTH_LOGIN);
}
if (options.admin && !user.isAdmin) {
throw redirect(302, AppRoute.PHOTOS);
redirect(302, AppRoute.PHOTOS);
}
if (!savedUser) {

View File

@ -1,6 +1,6 @@
import { uploadAssetsStore } from '$lib/stores/upload';
import { addAssetsToAlbum } from '$lib/utils/asset-utils';
import { api, AssetFileUploadResponseDto } from '@api';
import { api, type AssetFileUploadResponseDto } from '@api';
import { UploadState } from '$lib/models/upload-asset';
import { ExecutorQueue } from '$lib/utils/executor-queue';
import { getServerErrorMessage, handleError } from './handle-error';

View File

@ -37,7 +37,7 @@
import { downloadArchive } from '$lib/utils/asset-utils';
import { openFileUploadDialog } from '$lib/utils/file-uploader';
import { handleError } from '$lib/utils/handle-error';
import { ActivityResponseDto, ReactionLevel, ReactionType, UserResponseDto, api } from '@api';
import { type ActivityResponseDto, ReactionLevel, ReactionType, type UserResponseDto, api } from '@api';
import Icon from '$lib/components/elements/icon.svelte';
import type { PageData } from './$types';
import { clickOutside } from '$lib/utils/click-outside';

View File

@ -6,8 +6,8 @@ export const load: PageLoad = async ({ params }) => {
const albumId = params.albumId;
if (albumId) {
throw redirect(302, `${AppRoute.ALBUMS}/${albumId}`);
redirect(302, `${AppRoute.ALBUMS}/${albumId}`);
} else {
throw redirect(302, AppRoute.PHOTOS);
redirect(302, AppRoute.PHOTOS);
}
};

View File

@ -1,5 +1,5 @@
import { notificationController, NotificationType } from '$lib/components/shared-components/notification/notification';
import { api, CreateAlbumDto } from '@api';
import { api, type CreateAlbumDto } from '@api';
import { albumFactory } from '@test-data';
import { get } from 'svelte/store';
import { useAlbums } from '../albums.bloc';

View File

@ -1,6 +1,6 @@
import type { OnShowContextMenuDetail } from '$lib/components/album-page/album-card';
import { notificationController, NotificationType } from '$lib/components/shared-components/notification/notification';
import { AlbumResponseDto, api } from '@api';
import { type AlbumResponseDto, api } from '@api';
import { derived, get, writable } from 'svelte/store';
type AlbumsProps = { albums: AlbumResponseDto[] };

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
throw redirect(302, AppRoute.ARCHIVE);
redirect(302, AppRoute.ARCHIVE);
};

View File

@ -3,7 +3,7 @@
import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import { AppRoute } from '$lib/constants';
import { SearchExploreResponseDto, api } from '@api';
import { type SearchExploreResponseDto, api } from '@api';
import type { PageData } from './$types';
export let data: PageData;

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load: PageLoad = async () => {
throw redirect(302, AppRoute.FAVORITES);
redirect(302, AppRoute.FAVORITES);
};

View File

@ -8,7 +8,7 @@
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { mapSettings } from '$lib/stores/preferences.store';
import { featureFlags } from '$lib/stores/server-config.store';
import { MapMarkerResponseDto, api } from '@api';
import { type MapMarkerResponseDto, api } from '@api';
import { isEqual, omit } from 'lodash-es';
import { DateTime, Duration } from 'luxon';
import { onDestroy, onMount } from 'svelte';

View File

@ -5,5 +5,5 @@ import type { PageLoad } from './$types';
export const load = (async () => {
await authenticate();
throw redirect(302, AppRoute.MEMORY);
redirect(302, AppRoute.MEMORY);
}) satisfies PageLoad;

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load = (async () => {
throw redirect(302, AppRoute.PHOTOS);
redirect(302, AppRoute.PHOTOS);
}) satisfies PageLoad;

View File

@ -4,7 +4,7 @@
import PeopleCard from '$lib/components/faces-page/people-card.svelte';
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import Button from '$lib/components/elements/buttons/button.svelte';
import { api, PeopleUpdateItem, type PersonResponseDto } from '@api';
import { api, type PeopleUpdateItem, type PersonResponseDto } from '@api';
import { goto } from '$app/navigation';
import { AppRoute } from '$lib/constants';
import { handleError } from '$lib/utils/handle-error';

View File

@ -30,7 +30,7 @@
import { AssetStore } from '$lib/stores/assets.store';
import { websocketStore } from '$lib/stores/websocket';
import { handleError } from '$lib/utils/handle-error';
import { AssetResponseDto, PersonResponseDto, api } from '@api';
import { type AssetResponseDto, type PersonResponseDto, api } from '@api';
import { onMount } from 'svelte';
import type { PageData } from './$types';
import { clickOutside } from '$lib/utils/click-outside';

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load = (async ({ params }) => {
throw redirect(302, `${AppRoute.PEOPLE}/${params.personId}`);
redirect(302, `${AppRoute.PEOPLE}/${params.personId}`);
}) satisfies PageLoad;

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load = (async () => {
throw redirect(302, AppRoute.PHOTOS);
redirect(302, AppRoute.PHOTOS);
}) satisfies PageLoad;

View File

@ -1,5 +1,5 @@
import { authenticate } from '$lib/utils/auth';
import { SearchResponseDto, api } from '@api';
import { type SearchResponseDto, api } from '@api';
import type { PageLoad } from './$types';
export const load = (async (data) => {

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load = (async () => {
throw redirect(302, AppRoute.SEARCH);
redirect(302, AppRoute.SEARCH);
}) satisfies PageLoad;

View File

@ -37,7 +37,7 @@ export const load = (async ({ params }) => {
};
}
throw error(404, {
error(404, {
message: 'Invalid shared link',
});
}

View File

@ -1,6 +1,6 @@
<script lang="ts">
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
import { api, copyToClipboard, makeSharedLinkUrl, SharedLinkResponseDto } from '@api';
import { api, copyToClipboard, makeSharedLinkUrl, type SharedLinkResponseDto } from '@api';
import { goto } from '$app/navigation';
import SharedLinkCard from '$lib/components/sharedlinks-page/shared-link-card.svelte';
import {

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load = (async () => {
throw redirect(302, AppRoute.TRASH);
redirect(302, AppRoute.TRASH);
}) satisfies PageLoad;

View File

@ -18,7 +18,7 @@
import { api } from '@api';
import { closeWebsocketConnection, openWebsocketConnection } from '$lib/stores/websocket';
import { user } from '$lib/stores/user.store';
import { ThemeSetting, colorTheme, handleToggleTheme } from '$lib/stores/preferences.store';
import { type ThemeSetting, colorTheme, handleToggleTheme } from '$lib/stores/preferences.store';
import { Theme } from '$lib/constants';
let showNavigationLoadingBar = false;

View File

@ -10,13 +10,13 @@ export const csr = true;
export const load = (async () => {
const authenticated = await isLoggedIn();
if (authenticated) {
throw redirect(302, AppRoute.PHOTOS);
redirect(302, AppRoute.PHOTOS);
}
const { data } = await api.serverInfoApi.getServerConfig();
if (data.isInitialized) {
// Redirect to login page if there exists an admin account (i.e. server is initialized)
throw redirect(302, AppRoute.AUTH_LOGIN);
redirect(302, AppRoute.AUTH_LOGIN);
}
return {

View File

@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load = (async () => {
throw redirect(302, AppRoute.ADMIN_USER_MANAGEMENT);
redirect(302, AppRoute.ADMIN_USER_MANAGEMENT);
}) satisfies PageLoad;

View File

@ -3,7 +3,7 @@
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import { AppRoute } from '$lib/constants';
import { AllJobStatusResponseDto, api } from '@api';
import { type AllJobStatusResponseDto, api } from '@api';
import { onDestroy, onMount } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte';
import type { PageData } from './$types';

Some files were not shown because too many files have changed in this diff Show More