1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-27 22:22:45 +01:00

chore: enum support for new API ()

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Ben McCann 2024-02-14 06:38:57 -08:00 committed by GitHub
parent 6f5648569a
commit 87ae0be081
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
108 changed files with 353 additions and 343 deletions
open-api
web/src
api
lib
api
components
admin-page
album-page
asset-viewer
assets/thumbnail
faces-page
forms
memory-page
onboarding-page
photos-page
share-page
shared-components
sharedlinks-page
user-settings-page
stores
utils.ts
utils
routes/(user)

View file

@ -19,7 +19,7 @@ function dart {
function typescript { function typescript {
rm -rf ./typescript-sdk/client rm -rf ./typescript-sdk/client
npx --yes @openapitools/openapi-generator-cli generate -g typescript-axios -i ./immich-openapi-specs.json -o ./typescript-sdk/axios-client --additional-properties=useSingleRequestParameter=true,supportsES6=true npx --yes @openapitools/openapi-generator-cli generate -g typescript-axios -i ./immich-openapi-specs.json -o ./typescript-sdk/axios-client --additional-properties=useSingleRequestParameter=true,supportsES6=true
npx --yes oazapfts --optimistic --argumentStyle=object immich-openapi-specs.json typescript-sdk/fetch-client.ts npx --yes oazapfts --optimistic --argumentStyle=object --useEnumType immich-openapi-specs.json typescript-sdk/fetch-client.ts
npm --prefix typescript-sdk ci && npm --prefix typescript-sdk run build npm --prefix typescript-sdk ci && npm --prefix typescript-sdk run build
} }

Binary file not shown.

View file

@ -1,5 +1,5 @@
{ {
"include": ["fetch.ts"], "include": ["fetch.ts", "fetch-client.ts"],
"compilerOptions": { "compilerOptions": {
"target": "esnext", "target": "esnext",
"strict": true, "strict": true,

View file

@ -1,3 +0,0 @@
export * from './api';
export * from '@immich/sdk/axios';
export * from './utils';

View file

@ -1,8 +0,0 @@
import type { Configuration } from '@immich/sdk/axios';
/* eslint-disable @typescript-eslint/no-explicit-any */
export type ApiFp = (configuration: Configuration) => Record<any, (...arguments_: any) => any>;
export type OmitLast<T extends readonly unknown[]> = T extends readonly [...infer U, any?] ? U : [...T];
export type ApiParams<F extends ApiFp, K extends keyof ReturnType<F>> = OmitLast<Parameters<ReturnType<F>[K]>>;

View file

@ -1,63 +0,0 @@
import { finishOAuth, linkOAuthAccount, startOAuth, unlinkOAuthAccount } from '@immich/sdk';
import { type UserResponseDto } from '@immich/sdk/axios';
import type { AxiosError } from 'axios';
import {
NotificationType,
notificationController,
} from '../lib/components/shared-components/notification/notification';
import { handleError } from '../lib/utils/handle-error';
export type ApiError = AxiosError<{ message: string }>;
export const copyToClipboard = async (secret: string) => {
try {
await navigator.clipboard.writeText(secret);
notificationController.show({ message: 'Copied to clipboard!', type: NotificationType.Info });
} catch (error) {
handleError(error, 'Cannot copy to clipboard, make sure you are accessing the page through https');
}
};
export const makeSharedLinkUrl = (externalDomain: string, key: string) => {
let url = externalDomain || window.location.origin;
if (!url.endsWith('/')) {
url += '/';
}
return `${url}share/${key}`;
};
export const oauth = {
isCallback: (location: Location) => {
const search = location.search;
return search.includes('code=') || search.includes('error=');
},
isAutoLaunchDisabled: (location: Location) => {
const values = ['autoLaunch=0', 'password=1', 'password=true'];
for (const value of values) {
if (location.search.includes(value)) {
return true;
}
}
return false;
},
authorize: async (location: Location) => {
try {
const redirectUri = location.href.split('?')[0];
const { url } = await startOAuth({ oAuthConfigDto: { redirectUri } });
window.location.href = url;
return true;
} catch (error) {
handleError(error, 'Unable to login with OAuth');
return false;
}
},
login: (location: Location) => {
return finishOAuth({ oAuthCallbackDto: { url: location.href } });
},
link: (location: Location): Promise<UserResponseDto> => {
return linkOAuthAccount({ oAuthCallbackDto: { url: location.href } });
},
unlink: () => {
return unlinkOAuthAccount();
},
};

View file

@ -4,12 +4,10 @@ class ImmichApi {
public downloadApi: DownloadApi; public downloadApi: DownloadApi;
public assetApi: AssetApi; public assetApi: AssetApi;
private config: configuration.Configuration;
constructor(parameters: configuration.ConfigurationParameters) { constructor(parameters: configuration.ConfigurationParameters) {
this.config = new configuration.Configuration(parameters); const config = new configuration.Configuration(parameters);
this.downloadApi = new DownloadApi(this.config); this.downloadApi = new DownloadApi(config);
this.assetApi = new AssetApi(this.config); this.assetApi = new AssetApi(config);
} }
} }

View file

@ -3,8 +3,7 @@
import Button from '$lib/components/elements/buttons/button.svelte'; import Button from '$lib/components/elements/buttons/button.svelte';
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store'; import { locale } from '$lib/stores/preferences.store';
import { type JobCommandDto, type JobCountsDto, type QueueStatusDto } from '@immich/sdk'; import { JobCommand, type JobCommandDto, type JobCountsDto, type QueueStatusDto } from '@immich/sdk';
import { JobCommand } from '@immich/sdk/axios';
import { import {
mdiAlertCircle, mdiAlertCircle,
mdiAllInclusive, mdiAllInclusive,

View file

@ -6,8 +6,7 @@
import { featureFlags } from '$lib/stores/server-config.store'; import { featureFlags } from '$lib/stores/server-config.store';
import { getJobName } from '$lib/utils'; import { getJobName } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { sendJobCommand, type AllJobStatusResponseDto, type JobCommandDto } from '@immich/sdk'; import { JobCommand, JobName, sendJobCommand, type AllJobStatusResponseDto, type JobCommandDto } from '@immich/sdk';
import { JobCommand, JobName } from '@immich/sdk/axios';
import { import {
mdiFaceRecognition, mdiFaceRecognition,
mdiFileJpgBox, mdiFileJpgBox,

View file

@ -1,7 +1,14 @@
<script lang="ts"> <script lang="ts">
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { type SystemConfigDto } from '@immich/sdk'; import {
import { AudioCodec, CQMode, ToneMapping, TranscodeHWAccel, TranscodePolicy, VideoCodec } from '@immich/sdk/axios'; AudioCodec,
CQMode,
ToneMapping,
TranscodeHWAccel,
TranscodePolicy,
VideoCodec,
type SystemConfigDto,
} from '@immich/sdk';
import { mdiHelpCircleOutline } from '@mdi/js'; import { mdiHelpCircleOutline } from '@mdi/js';
import { isEqual, sortBy } from 'lodash-es'; import { isEqual, sortBy } from 'lodash-es';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';

View file

@ -1,7 +1,6 @@
<script lang="ts"> <script lang="ts">
import { getJobName } from '$lib/utils'; import { getJobName } from '$lib/utils';
import { type SystemConfigDto, type SystemConfigJobDto } from '@immich/sdk'; import { JobName, type SystemConfigDto, type SystemConfigJobDto } from '@immich/sdk';
import { JobName } from '@immich/sdk/axios';
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
@ -29,7 +28,8 @@
JobName.Migration, JobName.Migration,
]; ];
function isSystemConfigJobDto(jobName: JobName): jobName is keyof SystemConfigJobDto { // eslint-disable-next-line @typescript-eslint/no-explicit-any
function isSystemConfigJobDto(jobName: any): jobName is keyof SystemConfigJobDto {
return jobName in config.job; return jobName in config.job;
} }
</script> </script>

View file

@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import { type SystemConfigDto } from '@immich/sdk'; import { LogLevel, type SystemConfigDto } from '@immich/sdk';
import { LogLevel } from '@immich/sdk/axios';
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';

View file

@ -1,8 +1,7 @@
<script lang="ts"> <script lang="ts">
import SettingButtonsRow from '$lib/components/admin-page/settings/setting-buttons-row.svelte'; import SettingButtonsRow from '$lib/components/admin-page/settings/setting-buttons-row.svelte';
import SettingSelect from '$lib/components/admin-page/settings/setting-select.svelte'; import SettingSelect from '$lib/components/admin-page/settings/setting-select.svelte';
import { type SystemConfigDto } from '@immich/sdk'; import { Colorspace, type SystemConfigDto } from '@immich/sdk';
import { Colorspace } from '@immich/sdk/axios';
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';

View file

@ -1,12 +1,13 @@
import { createObjectURLMock } from '$lib/__mocks__/jsdom-url.mock'; import { createObjectURLMock } from '$lib/__mocks__/jsdom-url.mock';
import { api, ThumbnailFormat } from '@api'; import { api } from '$lib/api';
import { ThumbnailFormat } from '@immich/sdk';
import { albumFactory } from '@test-data'; import { albumFactory } from '@test-data';
import '@testing-library/jest-dom'; import '@testing-library/jest-dom';
import { fireEvent, render, type RenderResult, waitFor } from '@testing-library/svelte'; import { fireEvent, render, waitFor, type RenderResult } from '@testing-library/svelte';
import AlbumCard from '../album-card.svelte';
import type { MockedObject } from 'vitest'; import type { MockedObject } from 'vitest';
import AlbumCard from '../album-card.svelte';
vi.mock('@api'); vi.mock('$lib/api');
const apiMock: MockedObject<typeof api> = api as MockedObject<typeof api>; const apiMock: MockedObject<typeof api> = api as MockedObject<typeof api>;
describe('AlbumCard component', () => { describe('AlbumCard component', () => {

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import { api } from '$lib/api';
import noThumbnailUrl from '$lib/assets/no-thumbnail.png'; import noThumbnailUrl from '$lib/assets/no-thumbnail.png';
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store'; import { locale } from '$lib/stores/preferences.store';
import { user } from '$lib/stores/user.store'; import { user } from '$lib/stores/user.store';
import { getAssetThumbnailUrl } from '$lib/utils'; import { getAssetThumbnailUrl } from '$lib/utils';
import { ThumbnailFormat, api, type AlbumResponseDto } from '@api'; import { ThumbnailFormat, getUserById, type AlbumResponseDto } from '@immich/sdk';
import { getUserById } from '@immich/sdk';
import { mdiDotsVertical } from '@mdi/js'; import { mdiDotsVertical } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { getContextMenuPosition } from '../../utils/context-menu'; import { getContextMenuPosition } from '../../utils/context-menu';

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import Icon from '$lib/components/elements/icon.svelte';
import type { AlbumResponseDto, UserResponseDto } from '@immich/sdk';
import { mdiClose, mdiPlus } from '@mdi/js'; import { mdiClose, mdiPlus } from '@mdi/js';
import { createEventDispatcher } from 'svelte';
import SettingSwitch from '../admin-page/settings/setting-switch.svelte'; import SettingSwitch from '../admin-page/settings/setting-switch.svelte';
import CircleIconButton from '../elements/buttons/circle-icon-button.svelte'; import CircleIconButton from '../elements/buttons/circle-icon-button.svelte';
import FullScreenModal from '../shared-components/full-screen-modal.svelte'; import FullScreenModal from '../shared-components/full-screen-modal.svelte';
import UserAvatar from '../shared-components/user-avatar.svelte'; import UserAvatar from '../shared-components/user-avatar.svelte';
import { createEventDispatcher } from 'svelte';
import type { AlbumResponseDto, UserResponseDto } from '@api';
import Icon from '$lib/components/elements/icon.svelte';
export let album: AlbumResponseDto; export let album: AlbumResponseDto;
export let user: UserResponseDto; export let user: UserResponseDto;

View file

@ -5,7 +5,7 @@
import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store'; import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store';
import { locale } from '$lib/stores/preferences.store'; import { locale } from '$lib/stores/preferences.store';
import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader'; import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader';
import type { AlbumResponseDto, SharedLinkResponseDto, UserResponseDto } from '@api'; import type { AlbumResponseDto, SharedLinkResponseDto, UserResponseDto } from '@immich/sdk';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
import { dateFormats } from '../../constants'; import { dateFormats } from '../../constants';
import { createAssetInteractionStore } from '../../stores/asset-interaction.store'; import { createAssetInteractionStore } from '../../stores/asset-interaction.store';

View file

@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import { type AlbumResponseDto, type UserResponseDto } from '@immich/sdk'; import { getMyUserInfo, removeUserFromAlbum, type AlbumResponseDto, type UserResponseDto } from '@immich/sdk';
import { getMyUserInfo, removeUserFromAlbum } from '@immich/sdk';
import { mdiDotsVertical } from '@mdi/js'; import { mdiDotsVertical } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { getContextMenuPosition } from '../../utils/context-menu'; import { getContextMenuPosition } from '../../utils/context-menu';

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import type { AlbumResponseDto, AssetResponseDto } from '@api'; import type { AlbumResponseDto, AssetResponseDto } from '@immich/sdk';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { quintOut } from 'svelte/easing'; import { quintOut } from 'svelte/easing';
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition';

View file

@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import type { ActivityResponseDto } from '@immich/sdk';
import { mdiCommentOutline, mdiHeart, mdiHeartOutline } from '@mdi/js'; import { mdiCommentOutline, mdiHeart, mdiHeartOutline } from '@mdi/js';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import Icon from '../elements/icon.svelte'; import Icon from '../elements/icon.svelte';
import type { ActivityResponseDto } from '@api';
export let isLiked: ActivityResponseDto | null; export let isLiked: ActivityResponseDto | null;
export let numberOfComments: number | undefined; export let numberOfComments: number | undefined;

View file

@ -8,6 +8,8 @@
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { isTenMinutesApart } from '$lib/utils/timesince'; import { isTenMinutesApart } from '$lib/utils/timesince';
import { import {
ReactionType,
ThumbnailFormat,
createActivity, createActivity,
deleteActivity, deleteActivity,
getActivities, getActivities,
@ -15,7 +17,6 @@
type AssetTypeEnum, type AssetTypeEnum,
type UserResponseDto, type UserResponseDto,
} from '@immich/sdk'; } from '@immich/sdk';
import { ReactionType, ThumbnailFormat } from '@immich/sdk/axios';
import { mdiClose, mdiDotsVertical, mdiHeart, mdiSend } from '@mdi/js'; import { mdiClose, mdiDotsVertical, mdiHeart, mdiSend } from '@mdi/js';
import * as luxon from 'luxon'; import * as luxon from 'luxon';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';

View file

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { getAssetThumbnailUrl } from '$lib/utils'; import { getAssetThumbnailUrl } from '$lib/utils';
import { ThumbnailFormat, type AlbumResponseDto } from '@api'; import { ThumbnailFormat, type AlbumResponseDto } from '@immich/sdk';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher<{ const dispatch = createEventDispatcher<{

View file

@ -5,7 +5,7 @@
import { getAssetJobName } from '$lib/utils'; import { getAssetJobName } from '$lib/utils';
import { clickOutside } from '$lib/utils/click-outside'; import { clickOutside } from '$lib/utils/click-outside';
import { getContextMenuPosition } from '$lib/utils/context-menu'; import { getContextMenuPosition } from '$lib/utils/context-menu';
import { AssetJobName, AssetTypeEnum, type AssetResponseDto } from '@api'; import { AssetJobName, AssetTypeEnum, type AssetResponseDto } from '@immich/sdk';
import { import {
mdiAlertOutline, mdiAlertOutline,
mdiArrowLeft, mdiArrowLeft,

View file

@ -20,12 +20,6 @@
AssetJobName, AssetJobName,
AssetTypeEnum, AssetTypeEnum,
ReactionType, ReactionType,
type ActivityResponseDto,
type AlbumResponseDto,
type AssetResponseDto,
type SharedLinkResponseDto,
} from '@api';
import {
createActivity, createActivity,
createAlbum, createAlbum,
deleteActivity, deleteActivity,
@ -36,6 +30,10 @@
runAssetJobs, runAssetJobs,
updateAsset, updateAsset,
updateAssets, updateAssets,
type ActivityResponseDto,
type AlbumResponseDto,
type AssetResponseDto,
type SharedLinkResponseDto,
} from '@immich/sdk'; } from '@immich/sdk';
import { mdiChevronLeft, mdiChevronRight, mdiImageBrokenVariant } from '@mdi/js'; import { mdiChevronLeft, mdiChevronRight, mdiImageBrokenVariant } from '@mdi/js';
import { createEventDispatcher, onDestroy, onMount } from 'svelte'; import { createEventDispatcher, onDestroy, onMount } from 'svelte';

View file

@ -11,8 +11,13 @@
import { getAssetFilename } from '$lib/utils/asset-utils'; import { getAssetFilename } from '$lib/utils/asset-utils';
import { autoGrowHeight } from '$lib/utils/autogrow'; import { autoGrowHeight } from '$lib/utils/autogrow';
import { clickOutside } from '$lib/utils/click-outside'; import { clickOutside } from '$lib/utils/click-outside';
import { ThumbnailFormat, type AlbumResponseDto, type AssetResponseDto } from '@api'; import {
import { getAssetInfo, updateAsset } from '@immich/sdk'; ThumbnailFormat,
getAssetInfo,
updateAsset,
type AlbumResponseDto,
type AssetResponseDto,
} from '@immich/sdk';
import { import {
mdiCalendar, mdiCalendar,
mdiCameraIris, mdiCameraIris,

View file

@ -1,8 +1,9 @@
<script lang="ts"> <script lang="ts">
import { api } from '$lib/api';
import { getKey } from '$lib/utils';
import { type AssetResponseDto } from '@immich/sdk';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
import LoadingSpinner from '../shared-components/loading-spinner.svelte'; import LoadingSpinner from '../shared-components/loading-spinner.svelte';
import { api, type AssetResponseDto } from '@api';
import { getKey } from '$lib/utils';
export let asset: AssetResponseDto; export let asset: AssetResponseDto;

View file

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import { api } from '$lib/api';
import { photoViewer } from '$lib/stores/assets.store'; import { photoViewer } from '$lib/stores/assets.store';
import { boundingBoxesArray } from '$lib/stores/people.store'; import { boundingBoxesArray } from '$lib/stores/people.store';
import { alwaysLoadOriginalFile } from '$lib/stores/preferences.store'; import { alwaysLoadOriginalFile } from '$lib/stores/preferences.store';
@ -7,7 +8,7 @@
import { isWebCompatibleImage } from '$lib/utils/asset-utils'; import { isWebCompatibleImage } from '$lib/utils/asset-utils';
import { getBoundingBox } from '$lib/utils/people-utils'; import { getBoundingBox } from '$lib/utils/people-utils';
import { shouldIgnoreShortcut } from '$lib/utils/shortcut'; import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
import { api, type AssetResponseDto } from '@api'; import { type AssetResponseDto } from '@immich/sdk';
import { useZoomImageWheel } from '@zoom-image/svelte'; import { useZoomImageWheel } from '@zoom-image/svelte';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';

View file

@ -2,7 +2,7 @@
import { videoViewerVolume } from '$lib/stores/preferences.store'; import { videoViewerVolume } from '$lib/stores/preferences.store';
import { getAssetFileUrl, getAssetThumbnailUrl } from '$lib/utils'; import { getAssetFileUrl, getAssetThumbnailUrl } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { ThumbnailFormat } from '@api'; import { ThumbnailFormat } from '@immich/sdk';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
import LoadingSpinner from '../shared-components/loading-spinner.svelte'; import LoadingSpinner from '../shared-components/loading-spinner.svelte';

View file

@ -4,7 +4,7 @@
import { ProjectionType } from '$lib/constants'; import { ProjectionType } from '$lib/constants';
import { getAssetFileUrl, getAssetThumbnailUrl, isSharedLink } from '$lib/utils'; import { getAssetFileUrl, getAssetThumbnailUrl, isSharedLink } from '$lib/utils';
import { timeToSeconds } from '$lib/utils/time-to-seconds'; import { timeToSeconds } from '$lib/utils/time-to-seconds';
import { AssetTypeEnum, ThumbnailFormat, type AssetResponseDto } from '@api'; import { AssetTypeEnum, ThumbnailFormat, type AssetResponseDto } from '@immich/sdk';
import { import {
mdiArchiveArrowDownOutline, mdiArchiveArrowDownOutline,
mdiCameraBurst, mdiCameraBurst,

View file

@ -4,8 +4,13 @@
import { getAssetThumbnailUrl, getPeopleThumbnailUrl } from '$lib/utils'; import { getAssetThumbnailUrl, getPeopleThumbnailUrl } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { getPersonNameWithHiddenValue, searchNameLocal } from '$lib/utils/person'; import { getPersonNameWithHiddenValue, searchNameLocal } from '$lib/utils/person';
import { AssetTypeEnum, ThumbnailFormat, type AssetFaceResponseDto, type PersonResponseDto } from '@api'; import {
import { searchPerson } from '@immich/sdk'; AssetTypeEnum,
ThumbnailFormat,
searchPerson,
type AssetFaceResponseDto,
type PersonResponseDto,
} from '@immich/sdk';
import { mdiArrowLeftThin, mdiClose, mdiMagnify, mdiPlus } from '@mdi/js'; import { mdiArrowLeftThin, mdiClose, mdiMagnify, mdiPlus } from '@mdi/js';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { linear } from 'svelte/easing'; import { linear } from 'svelte/easing';

View file

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

View file

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { getPeopleThumbnailUrl } from '$lib/utils'; import { getPeopleThumbnailUrl } from '$lib/utils';
import { type PersonResponseDto } from '@api'; import { type PersonResponseDto } from '@immich/sdk';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte'; import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';

View file

@ -4,8 +4,7 @@
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { ActionQueryParameterValue, AppRoute, QueryParameter } from '$lib/constants'; import { ActionQueryParameterValue, AppRoute, QueryParameter } from '$lib/constants';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { type PersonResponseDto } from '@api'; import { getAllPeople, getPerson, mergePerson, type PersonResponseDto } from '@immich/sdk';
import { getAllPeople, getPerson, mergePerson } from '@immich/sdk';
import { mdiCallMerge, mdiMerge, mdiSwapHorizontal } from '@mdi/js'; import { mdiCallMerge, mdiMerge, mdiSwapHorizontal } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { flip } from 'svelte/animate'; import { flip } from 'svelte/animate';

View file

@ -2,7 +2,7 @@
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte'; import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import { getPeopleThumbnailUrl } from '$lib/utils'; import { getPeopleThumbnailUrl } from '$lib/utils';
import { type PersonResponseDto } from '@api'; import { type PersonResponseDto } from '@immich/sdk';
import { mdiArrowLeft, mdiClose, mdiMerge } from '@mdi/js'; import { mdiArrowLeft, mdiClose, mdiMerge } from '@mdi/js';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte'; import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';

View file

@ -3,7 +3,7 @@
import { AppRoute, QueryParameter } from '$lib/constants'; import { AppRoute, QueryParameter } from '$lib/constants';
import { getPeopleThumbnailUrl } from '$lib/utils'; import { getPeopleThumbnailUrl } from '$lib/utils';
import { getContextMenuPosition } from '$lib/utils/context-menu'; import { getContextMenuPosition } from '$lib/utils/context-menu';
import { type PersonResponseDto } from '@api'; import { type PersonResponseDto } from '@immich/sdk';
import { mdiDotsVertical } from '@mdi/js'; import { mdiDotsVertical } from '@mdi/js';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte'; import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';

View file

@ -2,8 +2,7 @@
import { maximumLengthSearchPeople, timeBeforeShowLoadingSpinner } from '$lib/constants'; import { maximumLengthSearchPeople, timeBeforeShowLoadingSpinner } from '$lib/constants';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { searchNameLocal } from '$lib/utils/person'; import { searchNameLocal } from '$lib/utils/person';
import { type PersonResponseDto } from '@api'; import { searchPerson, type PersonResponseDto } from '@immich/sdk';
import { searchPerson } from '@immich/sdk';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import FaceThumbnail from './face-thumbnail.svelte'; import FaceThumbnail from './face-thumbnail.svelte';
import SearchBar from './search-bar.svelte'; import SearchBar from './search-bar.svelte';

View file

@ -6,8 +6,15 @@
import { getPeopleThumbnailUrl } from '$lib/utils'; import { getPeopleThumbnailUrl } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { getPersonNameWithHiddenValue } from '$lib/utils/person'; import { getPersonNameWithHiddenValue } from '$lib/utils/person';
import { AssetTypeEnum, type AssetFaceResponseDto, type PersonResponseDto } from '@api'; import {
import { createPerson, getAllPeople, getFaces, reassignFacesById } from '@immich/sdk'; AssetTypeEnum,
createPerson,
getAllPeople,
getFaces,
reassignFacesById,
type AssetFaceResponseDto,
type PersonResponseDto,
} from '@immich/sdk';
import { mdiArrowLeftThin, mdiRestart } from '@mdi/js'; import { mdiArrowLeftThin, mdiRestart } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { linear } from 'svelte/easing'; import { linear } from 'svelte/easing';

View file

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import type { APIKeyResponseDto } from '@api'; import Icon from '$lib/components/elements/icon.svelte';
import type { ApiKeyResponseDto } from '@immich/sdk';
import { mdiKeyVariant } from '@mdi/js';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import Button from '../elements/buttons/button.svelte'; import Button from '../elements/buttons/button.svelte';
import FullScreenModal from '../shared-components/full-screen-modal.svelte'; import FullScreenModal from '../shared-components/full-screen-modal.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import { mdiKeyVariant } from '@mdi/js';
import { NotificationType, notificationController } from '../shared-components/notification/notification'; import { NotificationType, notificationController } from '../shared-components/notification/notification';
export let apiKey: Partial<APIKeyResponseDto>; export let apiKey: Partial<ApiKeyResponseDto>;
export let title = 'API Key'; export let title = 'API Key';
export let cancelText = 'Cancel'; export let cancelText = 'Cancel';
export let submitText = 'Save'; export let submitText = 'Save';
@ -15,7 +15,7 @@
const dispatch = createEventDispatcher<{ const dispatch = createEventDispatcher<{
cancel: void; cancel: void;
submit: Partial<APIKeyResponseDto>; submit: Partial<ApiKeyResponseDto>;
}>(); }>();
const handleCancel = () => dispatch('cancel'); const handleCancel = () => dispatch('cancel');
const handleSubmit = () => { const handleSubmit = () => {

View file

@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import Icon from '$lib/components/elements/icon.svelte';
import { copyToClipboard } from '$lib/utils';
import { mdiKeyVariant } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { copyToClipboard } from '@api';
import Button from '../elements/buttons/button.svelte'; import Button from '../elements/buttons/button.svelte';
import FullScreenModal from '../shared-components/full-screen-modal.svelte'; import FullScreenModal from '../shared-components/full-screen-modal.svelte';
import { mdiKeyVariant } from '@mdi/js';
import Icon from '$lib/components/elements/icon.svelte';
export let secret = ''; export let secret = '';

View file

@ -1,12 +1,11 @@
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from 'svelte';
import Button from '../elements/buttons/button.svelte';
import { handleError } from '../../utils/handle-error';
import LibraryImportPathForm from './library-import-path-form.svelte';
import { onMount } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import type { LibraryResponseDto } from '@api'; import type { LibraryResponseDto } from '@immich/sdk';
import { mdiPencilOutline } from '@mdi/js'; import { mdiPencilOutline } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte';
import { handleError } from '../../utils/handle-error';
import Button from '../elements/buttons/button.svelte';
import LibraryImportPathForm from './library-import-path-form.svelte';
export let library: Partial<LibraryResponseDto>; export let library: Partial<LibraryResponseDto>;

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { LibraryResponseDto } from '@immich/sdk';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import Button from '../elements/buttons/button.svelte'; import Button from '../elements/buttons/button.svelte';
import type { LibraryResponseDto } from '@api';
export let library: Partial<LibraryResponseDto>; export let library: Partial<LibraryResponseDto>;

View file

@ -1,12 +1,11 @@
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from 'svelte';
import Button from '../elements/buttons/button.svelte';
import { LibraryType, type LibraryResponseDto } from '@api';
import { handleError } from '../../utils/handle-error';
import { onMount } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import LibraryExclusionPatternForm from './library-exclusion-pattern-form.svelte'; import { LibraryType, type LibraryResponseDto } from '@immich/sdk';
import { mdiPencilOutline } from '@mdi/js'; import { mdiPencilOutline } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte';
import { handleError } from '../../utils/handle-error';
import Button from '../elements/buttons/button.svelte';
import LibraryExclusionPatternForm from './library-exclusion-pattern-form.svelte';
export let library: Partial<LibraryResponseDto>; export let library: Partial<LibraryResponseDto>;

View file

@ -3,8 +3,8 @@
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte'; import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
import { AppRoute } from '$lib/constants'; import { AppRoute } from '$lib/constants';
import { featureFlags, serverConfig } from '$lib/stores/server-config.store'; import { featureFlags, serverConfig } from '$lib/stores/server-config.store';
import { oauth } from '$lib/utils';
import { getServerErrorMessage, handleError } from '$lib/utils/handle-error'; import { getServerErrorMessage, handleError } from '$lib/utils/handle-error';
import { oauth } from '@api';
import { getServerConfig, login } from '@immich/sdk'; import { getServerConfig, login } from '@immich/sdk';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';

View file

@ -10,7 +10,7 @@
import { memoryStore } from '$lib/stores/memory.store'; import { memoryStore } from '$lib/stores/memory.store';
import { getAssetThumbnailUrl } from '$lib/utils'; import { getAssetThumbnailUrl } from '$lib/utils';
import { fromLocalDateTime } from '$lib/utils/timeline-util'; import { fromLocalDateTime } from '$lib/utils/timeline-util';
import { getMemoryLane } from '@immich/sdk'; import { ThumbnailFormat, getMemoryLane } from '@immich/sdk';
import { mdiChevronDown, mdiChevronLeft, mdiChevronRight, mdiChevronUp, mdiPause, mdiPlay } from '@mdi/js'; import { mdiChevronDown, mdiChevronLeft, mdiChevronRight, mdiChevronUp, mdiPause, mdiPlay } from '@mdi/js';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
@ -168,7 +168,9 @@
<button class="relative h-full w-full rounded-2xl" disabled={!previousMemory} on:click={toPreviousMemory}> <button class="relative h-full w-full rounded-2xl" disabled={!previousMemory} on:click={toPreviousMemory}>
<img <img
class="h-full w-full rounded-2xl object-cover" class="h-full w-full rounded-2xl object-cover"
src={previousMemory ? getAssetThumbnailUrl(previousMemory.assets[0].id, 'JPEG') : noThumbnailUrl} src={previousMemory
? getAssetThumbnailUrl(previousMemory.assets[0].id, ThumbnailFormat.Jpeg)
: noThumbnailUrl}
alt="" alt=""
draggable="false" draggable="false"
/> />
@ -191,7 +193,7 @@
<img <img
transition:fade transition:fade
class="h-full w-full rounded-2xl object-contain transition-all" class="h-full w-full rounded-2xl object-contain transition-all"
src={getAssetThumbnailUrl(currentAsset.id, 'JPEG')} src={getAssetThumbnailUrl(currentAsset.id, ThumbnailFormat.Jpeg)}
alt="" alt=""
draggable="false" draggable="false"
/> />
@ -231,7 +233,7 @@
<button class="relative h-full w-full rounded-2xl" on:click={toNextMemory} disabled={!nextMemory}> <button class="relative h-full w-full rounded-2xl" on:click={toNextMemory} disabled={!nextMemory}>
<img <img
class="h-full w-full rounded-2xl object-cover" class="h-full w-full rounded-2xl object-cover"
src={nextMemory ? getAssetThumbnailUrl(nextMemory.assets[0].id, 'JPEG') : noThumbnailUrl} src={nextMemory ? getAssetThumbnailUrl(nextMemory.assets[0].id, ThumbnailFormat.Jpeg) : noThumbnailUrl}
alt="" alt=""
draggable="false" draggable="false"
/> />

View file

@ -1,8 +1,7 @@
<script lang="ts"> <script lang="ts">
import { featureFlags } from '$lib/stores/server-config.store'; import { featureFlags } from '$lib/stores/server-config.store';
import { user } from '$lib/stores/user.store'; import { user } from '$lib/stores/user.store';
import { type SystemConfigDto } from '@api'; import { getConfig, type SystemConfigDto } from '@immich/sdk';
import { getConfig } from '@immich/sdk';
import { mdiArrowLeft, mdiCheck } from '@mdi/js'; import { mdiArrowLeft, mdiCheck } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import AdminSettings from '../admin-page/settings/admin-settings.svelte'; import AdminSettings from '../admin-page/settings/admin-settings.svelte';

View file

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

View file

@ -6,8 +6,7 @@
} from '$lib/components/shared-components/notification/notification'; } from '$lib/components/shared-components/notification/notification';
import { getAssetJobMessage, getAssetJobName } from '$lib/utils'; import { getAssetJobMessage, getAssetJobName } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { AssetJobName, AssetTypeEnum } from '@api'; import { AssetJobName, AssetTypeEnum, runAssetJobs } from '@immich/sdk';
import { runAssetJobs } from '@immich/sdk';
import { getAssetControlContext } from '../asset-select-control-bar.svelte'; import { getAssetControlContext } from '../asset-select-control-bar.svelte';
export let jobs: AssetJobName[] = [ export let jobs: AssetJobName[] = [

View file

@ -2,8 +2,7 @@
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte'; import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import { getKey } from '$lib/utils'; import { getKey } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { type SharedLinkResponseDto } from '@api'; import { removeSharedLinkAssets, type SharedLinkResponseDto } from '@immich/sdk';
import { removeSharedLinkAssets } from '@immich/sdk';
import { mdiDeleteOutline } from '@mdi/js'; import { mdiDeleteOutline } from '@mdi/js';
import ConfirmDialogue from '../../shared-components/confirm-dialogue.svelte'; import ConfirmDialogue from '../../shared-components/confirm-dialogue.svelte';
import { NotificationType, notificationController } from '../../shared-components/notification/notification'; import { NotificationType, notificationController } from '../../shared-components/notification/notification';

View file

@ -1,18 +1,17 @@
<script lang="ts"> <script lang="ts">
import Icon from '$lib/components/elements/icon.svelte';
import type { AssetInteractionStore } from '$lib/stores/asset-interaction.store';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import type { AssetStore, Viewport } from '$lib/stores/assets.store';
import { locale } from '$lib/stores/preferences.store'; import { locale } from '$lib/stores/preferences.store';
import { getAssetRatio } from '$lib/utils/asset-utils'; import { getAssetRatio } from '$lib/utils/asset-utils';
import { formatGroupTitle, fromLocalDateTime, splitBucketIntoDateGroups } from '$lib/utils/timeline-util'; import { formatGroupTitle, fromLocalDateTime, splitBucketIntoDateGroups } from '$lib/utils/timeline-util';
import type { AssetResponseDto } from '@api'; import type { AssetResponseDto } from '@immich/sdk';
import { mdiCheckCircle, mdiCircleOutline } from '@mdi/js';
import justifiedLayout from 'justified-layout'; import justifiedLayout from 'justified-layout';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte';
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition';
import Thumbnail from '../assets/thumbnail/thumbnail.svelte'; import Thumbnail from '../assets/thumbnail/thumbnail.svelte';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import type { AssetStore } from '$lib/stores/assets.store';
import type { AssetInteractionStore } from '$lib/stores/asset-interaction.store';
import type { Viewport } from '$lib/stores/assets.store';
import { mdiCheckCircle, mdiCircleOutline } from '@mdi/js';
export let assets: AssetResponseDto[]; export let assets: AssetResponseDto[];
export let bucketDate: string; export let bucketDate: string;

View file

@ -7,8 +7,11 @@
import { BucketPosition, type AssetStore, type Viewport } from '$lib/stores/assets.store'; import { BucketPosition, type AssetStore, type Viewport } from '$lib/stores/assets.store';
import { locale, showDeleteModal } from '$lib/stores/preferences.store'; import { locale, showDeleteModal } from '$lib/stores/preferences.store';
import { isSearchEnabled } from '$lib/stores/search.store'; import { isSearchEnabled } from '$lib/stores/search.store';
import { featureFlags } from '$lib/stores/server-config.store';
import { deleteAssets } from '$lib/utils/actions';
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
import { formatGroupTitle, splitBucketIntoDateGroups } from '$lib/utils/timeline-util'; import { formatGroupTitle, splitBucketIntoDateGroups } from '$lib/utils/timeline-util';
import type { AlbumResponseDto, AssetResponseDto } from '@api'; import type { AlbumResponseDto, AssetResponseDto } from '@immich/sdk';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import { createEventDispatcher, onDestroy, onMount } from 'svelte'; import { createEventDispatcher, onDestroy, onMount } from 'svelte';
import AssetViewer from '../asset-viewer/asset-viewer.svelte'; import AssetViewer from '../asset-viewer/asset-viewer.svelte';
@ -17,9 +20,6 @@
import Scrollbar from '../shared-components/scrollbar/scrollbar.svelte'; import Scrollbar from '../shared-components/scrollbar/scrollbar.svelte';
import ShowShortcuts from '../shared-components/show-shortcuts.svelte'; import ShowShortcuts from '../shared-components/show-shortcuts.svelte';
import AssetDateGroup from './asset-date-group.svelte'; import AssetDateGroup from './asset-date-group.svelte';
import { featureFlags } from '$lib/stores/server-config.store';
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
import { deleteAssets } from '$lib/utils/actions';
import DeleteAssetDialog from './delete-asset-dialog.svelte'; import DeleteAssetDialog from './delete-asset-dialog.svelte';
export let isSelectionMode = false; export let isSelectionMode = false;

View file

@ -14,9 +14,9 @@
<script lang="ts"> <script lang="ts">
import { locale } from '$lib/stores/preferences.store'; import { locale } from '$lib/stores/preferences.store';
import type { AssetResponseDto } from '@api'; import type { AssetResponseDto } from '@immich/sdk';
import ControlAppBar from '../shared-components/control-app-bar.svelte';
import { mdiClose } from '@mdi/js'; import { mdiClose } from '@mdi/js';
import ControlAppBar from '../shared-components/control-app-bar.svelte';
export let assets: Set<AssetResponseDto>; export let assets: Set<AssetResponseDto>;
export let clearSelect: () => void; export let clearSelect: () => void;

View file

@ -4,7 +4,7 @@
import { AppRoute, QueryParameter } from '$lib/constants'; import { AppRoute, QueryParameter } from '$lib/constants';
import { memoryStore } from '$lib/stores/memory.store'; import { memoryStore } from '$lib/stores/memory.store';
import { getAssetThumbnailUrl } from '$lib/utils'; import { getAssetThumbnailUrl } from '$lib/utils';
import { getMemoryLane } from '@immich/sdk'; import { ThumbnailFormat, getMemoryLane } from '@immich/sdk';
import { mdiChevronLeft, mdiChevronRight } from '@mdi/js'; import { mdiChevronLeft, mdiChevronRight } from '@mdi/js';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
@ -73,7 +73,7 @@
> >
<img <img
class="h-full w-full rounded-xl object-cover" class="h-full w-full rounded-xl object-cover"
src={getAssetThumbnailUrl(memory.assets[0].id, 'JPEG')} src={getAssetThumbnailUrl(memory.assets[0].id, ThumbnailFormat.Jpeg)}
alt={memory.title} alt={memory.title}
draggable="false" draggable="false"
/> />

View file

@ -6,8 +6,7 @@
import { downloadArchive } from '$lib/utils/asset-utils'; import { downloadArchive } from '$lib/utils/asset-utils';
import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader'; import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { type AssetResponseDto, type SharedLinkResponseDto } from '@api'; import { addSharedLinkAssets, type AssetResponseDto, type SharedLinkResponseDto } from '@immich/sdk';
import { addSharedLinkAssets } from '@immich/sdk';
import { mdiArrowLeft, mdiFileImagePlusOutline, mdiFolderDownloadOutline, mdiSelectAll } from '@mdi/js'; import { mdiArrowLeft, mdiFileImagePlusOutline, mdiFolderDownloadOutline, mdiSelectAll } from '@mdi/js';
import CircleIconButton from '../elements/buttons/circle-icon-button.svelte'; import CircleIconButton from '../elements/buttons/circle-icon-button.svelte';
import DownloadAction from '../photos-page/actions/download-action.svelte'; import DownloadAction from '../photos-page/actions/download-action.svelte';

View file

@ -1,7 +1,6 @@
<script lang="ts"> <script lang="ts">
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { type AlbumResponseDto } from '@api'; import { getAllAlbums, type AlbumResponseDto } from '@immich/sdk';
import { getAllAlbums } from '@immich/sdk';
import { mdiPlus } from '@mdi/js'; import { mdiPlus } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import AlbumListItem from '../asset-viewer/album-list-item.svelte'; import AlbumListItem from '../asset-viewer/album-list-item.svelte';

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import type { AssetResponseDto } from '@api'; import type { AssetResponseDto } from '@immich/sdk';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import ConfirmDialogue from './confirm-dialogue.svelte'; import ConfirmDialogue from './confirm-dialogue.svelte';
import Map from './map/map.svelte'; import Map from './map/map.svelte';

View file

@ -6,9 +6,9 @@
import Button from '$lib/components/elements/buttons/button.svelte'; import Button from '$lib/components/elements/buttons/button.svelte';
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { serverConfig } from '$lib/stores/server-config.store'; import { serverConfig } from '$lib/stores/server-config.store';
import { copyToClipboard, makeSharedLinkUrl } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { SharedLinkType, copyToClipboard, makeSharedLinkUrl, type SharedLinkResponseDto } from '@api'; import { SharedLinkType, createSharedLink, updateSharedLink, type SharedLinkResponseDto } from '@immich/sdk';
import { createSharedLink, updateSharedLink } from '@immich/sdk';
import { mdiLink } from '@mdi/js'; import { mdiLink } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import BaseModal from '../base-modal.svelte'; import BaseModal from '../base-modal.svelte';

View file

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

View file

@ -1,15 +1,14 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/stores'; import { page } from '$app/stores';
import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte'; import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte';
import { handleError } from '$lib/utils/handle-error';
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';
import { assetViewingStore } from '$lib/stores/asset-viewing.store'; import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { onDestroy } from 'svelte';
import { createEventDispatcher } from 'svelte';
import type { BucketPosition } from '$lib/stores/assets.store'; import type { BucketPosition } from '$lib/stores/assets.store';
import { handleError } from '$lib/utils/handle-error';
import { getThumbnailSize } from '$lib/utils/thumbnail-util';
import { ThumbnailFormat, type AssetResponseDto } from '@immich/sdk';
import { createEventDispatcher, onDestroy } from 'svelte';
import { flip } from 'svelte/animate';
import AssetViewer from '../../asset-viewer/asset-viewer.svelte';
const dispatch = createEventDispatcher<{ intersected: { container: HTMLDivElement; position: BucketPosition } }>(); const dispatch = createEventDispatcher<{ intersected: { container: HTMLDivElement; position: BucketPosition } }>();

View file

@ -3,7 +3,7 @@
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 } from '$lib/utils'; import { getAssetThumbnailUrl } from '$lib/utils';
import { getMapStyle, 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';
import type { GeoJSONSource, LngLatLike, StyleSpecification } from 'maplibre-gl'; import type { GeoJSONSource, LngLatLike, StyleSpecification } from 'maplibre-gl';
@ -38,7 +38,7 @@
$: style = (() => $: style = (() =>
getMapStyle({ getMapStyle({
theme: $mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT, theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme,
}) as Promise<StyleSpecification>)(); }) as Promise<StyleSpecification>)();
const dispatch = createEventDispatcher<{ const dispatch = createEventDispatcher<{

View file

@ -8,7 +8,7 @@
import { mdiCog, mdiLogout, mdiPencil } from '@mdi/js'; import { mdiCog, mdiLogout, mdiPencil } from '@mdi/js';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
import { NotificationType, notificationController } from '../notification/notification'; import { notificationController, NotificationType } from '../notification/notification';
import UserAvatar from '../user-avatar.svelte'; import UserAvatar from '../user-avatar.svelte';
import AvatarSelector from './avatar-selector.svelte'; import AvatarSelector from './avatar-selector.svelte';

View file

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

View file

@ -1,8 +1,7 @@
<script lang="ts"> <script lang="ts">
import { user } from '$lib/stores/user.store'; import { user } from '$lib/stores/user.store';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { type AssetResponseDto } from '@api'; import { createProfileImage, type AssetResponseDto } from '@immich/sdk';
import { createProfileImage } from '@immich/sdk';
import domtoimage from 'dom-to-image'; import domtoimage from 'dom-to-image';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import PhotoViewer from '../asset-viewer/photo-viewer.svelte'; import PhotoViewer from '../asset-viewer/photo-viewer.svelte';

View file

@ -4,7 +4,7 @@
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { getPeopleThumbnailUrl } from '$lib/utils'; import { getPeopleThumbnailUrl } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { SearchSuggestionType, type PersonResponseDto } from '@api'; import { SearchSuggestionType, type PersonResponseDto } from '@immich/sdk';
import { getAllPeople, getSearchSuggestions } from '@immich/sdk'; import { getAllPeople, getSearchSuggestions } from '@immich/sdk';
import { mdiArrowRight, mdiClose } from '@mdi/js'; import { mdiArrowRight, mdiClose } from '@mdi/js';
import { onMount } from 'svelte'; import { onMount } from 'svelte';

View file

@ -2,7 +2,6 @@
import { page } from '$app/stores'; import { page } from '$app/stores';
import { locale, sidebarSettings } from '$lib/stores/preferences.store'; import { locale, sidebarSettings } from '$lib/stores/preferences.store';
import { featureFlags } from '$lib/stores/server-config.store'; import { featureFlags } from '$lib/stores/server-config.store';
import { type AssetApiGetAssetStatisticsRequest } from '@api';
import { getAlbumCount, getAssetStatistics } from '@immich/sdk'; import { getAlbumCount, getAssetStatistics } from '@immich/sdk';
import { import {
mdiAccount, mdiAccount,
@ -24,7 +23,7 @@
import SideBarButton from './side-bar-button.svelte'; import SideBarButton from './side-bar-button.svelte';
import SideBarSection from './side-bar-section.svelte'; import SideBarSection from './side-bar-section.svelte';
const getStats = (dto: AssetApiGetAssetStatisticsRequest) => getAssetStatistics(dto); const getStats = (dto: Parameters<typeof getAssetStatistics>[0]) => getAssetStatistics(dto);
const handleAlbumCount = async () => { const handleAlbumCount = async () => {
try { try {

View file

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import type { ServerVersionResponseDto } from '@api';
import { websocketStore } from '$lib/stores/websocket'; import { websocketStore } from '$lib/stores/websocket';
import type { ServerVersionResponseDto } from '@immich/sdk';
import Button from '../elements/buttons/button.svelte'; import Button from '../elements/buttons/button.svelte';
import FullScreenModal from './full-screen-modal.svelte'; import FullScreenModal from './full-screen-modal.svelte';

View file

@ -4,8 +4,13 @@
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { AppRoute } from '$lib/constants'; import { AppRoute } from '$lib/constants';
import { getAssetThumbnailUrl } from '$lib/utils'; import { getAssetThumbnailUrl } from '$lib/utils';
import { SharedLinkType, ThumbnailFormat, type AssetResponseDto, type SharedLinkResponseDto } from '@api'; import {
import { getAssetInfo } from '@immich/sdk'; SharedLinkType,
ThumbnailFormat,
getAssetInfo,
type AssetResponseDto,
type SharedLinkResponseDto,
} from '@immich/sdk';
import { mdiCircleEditOutline, mdiContentCopy, mdiDelete, mdiOpenInNew } from '@mdi/js'; import { mdiCircleEditOutline, mdiContentCopy, mdiDelete, mdiOpenInNew } from '@mdi/js';
import * as luxon from 'luxon'; import * as luxon from 'luxon';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';

View file

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

View file

@ -1,19 +1,19 @@
<script lang="ts"> <script lang="ts">
import { locale } from '$lib/stores/preferences.store';
import type { AuthDeviceResponseDto } from '@api';
import { DateTime, type ToRelativeCalendarOptions } from 'luxon';
import { createEventDispatcher } from 'svelte';
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store';
import type { AuthDeviceResponseDto } from '@immich/sdk';
import { import {
mdiAndroid, mdiAndroid,
mdiApple, mdiApple,
mdiAppleSafari, mdiAppleSafari,
mdiMicrosoftWindows,
mdiLinux,
mdiGoogleChrome, mdiGoogleChrome,
mdiTrashCanOutline,
mdiHelp, mdiHelp,
mdiLinux,
mdiMicrosoftWindows,
mdiTrashCanOutline,
} from '@mdi/js'; } from '@mdi/js';
import { DateTime, type ToRelativeCalendarOptions } from 'luxon';
import { createEventDispatcher } from 'svelte';
export let device: AuthDeviceResponseDto; export let device: AuthDeviceResponseDto;

View file

@ -1,10 +1,9 @@
<script lang="ts"> <script lang="ts">
import { type AuthDeviceResponseDto } from '@api'; import { getAuthDevices, logoutAuthDevice, logoutAuthDevices, type AuthDeviceResponseDto } from '@immich/sdk';
import { getAuthDevices, logoutAuthDevice, logoutAuthDevices } from '@immich/sdk';
import { handleError } from '../../utils/handle-error'; import { handleError } from '../../utils/handle-error';
import Button from '../elements/buttons/button.svelte'; import Button from '../elements/buttons/button.svelte';
import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte'; import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte';
import { notificationController, NotificationType } from '../shared-components/notification/notification'; import { NotificationType, notificationController } from '../shared-components/notification/notification';
import DeviceCard from './device-card.svelte'; import DeviceCard from './device-card.svelte';
export let devices: AuthDeviceResponseDto[]; export let devices: AuthDeviceResponseDto[];

View file

@ -4,8 +4,8 @@
import { getBytesWithUnit } from '$lib/utils/byte-units'; import { getBytesWithUnit } from '$lib/utils/byte-units';
import { getContextMenuPosition } from '$lib/utils/context-menu'; import { getContextMenuPosition } from '$lib/utils/context-menu';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { LibraryType, type LibraryResponseDto, type LibraryStatsResponseDto } from '@api';
import { import {
LibraryType,
createLibrary, createLibrary,
deleteLibrary, deleteLibrary,
getLibraries, getLibraries,
@ -13,6 +13,8 @@
removeOfflineFiles, removeOfflineFiles,
scanLibrary, scanLibrary,
updateLibrary, updateLibrary,
type LibraryResponseDto,
type LibraryStatsResponseDto,
} from '@immich/sdk'; } from '@immich/sdk';
import { mdiDatabase, mdiDotsVertical, mdiUpload } from '@mdi/js'; import { mdiDatabase, mdiDotsVertical, mdiUpload } from '@mdi/js';
import { onMount } from 'svelte'; import { onMount } from 'svelte';

View file

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

View file

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

View file

@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import { type UserResponseDto } from '@api'; import { getAllUsers, getPartners, type UserResponseDto } from '@immich/sdk';
import { getAllUsers, getPartners } from '@immich/sdk';
import { createEventDispatcher, onMount } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import Button from '../elements/buttons/button.svelte'; import Button from '../elements/buttons/button.svelte';
import BaseModal from '../shared-components/base-modal.svelte'; import BaseModal from '../shared-components/base-modal.svelte';

View file

@ -1,6 +1,12 @@
<script lang="ts"> <script lang="ts">
import { type PartnerResponseDto, type UserResponseDto } from '@api'; import {
import { createPartner, getPartners, removePartner, updatePartner } from '@immich/sdk'; createPartner,
getPartners,
removePartner,
updatePartner,
type PartnerResponseDto,
type UserResponseDto,
} from '@immich/sdk';
import { mdiCheck, mdiClose } from '@mdi/js'; import { mdiCheck, mdiClose } from '@mdi/js';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { handleError } from '../../utils/handle-error'; import { handleError } from '../../utils/handle-error';

View file

@ -1,8 +1,7 @@
<script lang="ts"> <script lang="ts">
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store'; import { locale } from '$lib/stores/preferences.store';
import { type APIKeyResponseDto } from '@api'; import { createApiKey, deleteApiKey, getApiKeys, updateApiKey, type ApiKeyResponseDto } from '@immich/sdk';
import { createApiKey, deleteApiKey, getApiKeys, updateApiKey } from '@immich/sdk';
import { mdiPencilOutline, mdiTrashCanOutline } from '@mdi/js'; import { mdiPencilOutline, mdiTrashCanOutline } from '@mdi/js';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
import { handleError } from '../../utils/handle-error'; import { handleError } from '../../utils/handle-error';
@ -12,11 +11,11 @@
import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte'; import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte';
import { NotificationType, notificationController } from '../shared-components/notification/notification'; import { NotificationType, notificationController } from '../shared-components/notification/notification';
export let keys: APIKeyResponseDto[]; export let keys: ApiKeyResponseDto[];
let newKey: Partial<APIKeyResponseDto> | null = null; let newKey: Partial<ApiKeyResponseDto> | null = null;
let editKey: APIKeyResponseDto | null = null; let editKey: ApiKeyResponseDto | null = null;
let deleteKey: APIKeyResponseDto | null = null; let deleteKey: ApiKeyResponseDto | null = null;
let secret = ''; let secret = '';
const format: Intl.DateTimeFormatOptions = { const format: Intl.DateTimeFormatOptions = {
@ -29,7 +28,7 @@
keys = await getApiKeys(); keys = await getApiKeys();
} }
const handleCreate = async (detail: Partial<APIKeyResponseDto>) => { const handleCreate = async (detail: Partial<ApiKeyResponseDto>) => {
try { try {
const data = await createApiKey({ apiKeyCreateDto: detail }); const data = await createApiKey({ apiKeyCreateDto: detail });
secret = data.secret; secret = data.secret;
@ -41,7 +40,7 @@
} }
}; };
const handleUpdate = async (detail: Partial<APIKeyResponseDto>) => { const handleUpdate = async (detail: Partial<ApiKeyResponseDto>) => {
if (!editKey || !detail.name) { if (!editKey || !detail.name) {
return; return;
} }

View file

@ -1,25 +1,26 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment'; import { browser } from '$app/environment';
import { page } from '$app/stores'; import { page } from '$app/stores';
import { OpenSettingQueryParameterValue, QueryParameter } from '$lib/constants';
import { featureFlags } from '$lib/stores/server-config.store'; import { featureFlags } from '$lib/stores/server-config.store';
import { type APIKeyResponseDto, type AuthDeviceResponseDto, oauth } from '@api'; import { user } from '$lib/stores/user.store';
import { oauth } from '$lib/utils';
import { type ApiKeyResponseDto, type AuthDeviceResponseDto } from '@immich/sdk';
import SettingAccordion from '../admin-page/settings/setting-accordion.svelte'; import SettingAccordion from '../admin-page/settings/setting-accordion.svelte';
import AppearanceSettings from './appearance-settings.svelte';
import ChangePasswordSettings from './change-password-settings.svelte'; import ChangePasswordSettings from './change-password-settings.svelte';
import DeviceList from './device-list.svelte'; import DeviceList from './device-list.svelte';
import LibraryList from './library-list.svelte'; import LibraryList from './library-list.svelte';
import MemoriesSettings from './memories-settings.svelte'; import MemoriesSettings from './memories-settings.svelte';
import OAuthSettings from './oauth-settings.svelte'; import OAuthSettings from './oauth-settings.svelte';
import PartnerSettings from './partner-settings.svelte'; import PartnerSettings from './partner-settings.svelte';
import QualitySettings from './quality-settings.svelte';
import SidebarSettings from './sidebar-settings.svelte'; import SidebarSettings from './sidebar-settings.svelte';
import TrashSettings from './trash-settings.svelte';
import UserAPIKeyList from './user-api-key-list.svelte'; import UserAPIKeyList from './user-api-key-list.svelte';
import UserProfileSettings from './user-profile-settings.svelte'; import UserProfileSettings from './user-profile-settings.svelte';
import { user } from '$lib/stores/user.store';
import { OpenSettingQueryParameterValue, QueryParameter } from '$lib/constants';
import AppearanceSettings from './appearance-settings.svelte';
import TrashSettings from './trash-settings.svelte';
import QualitySettings from './quality-settings.svelte';
export let keys: APIKeyResponseDto[] = []; export let keys: ApiKeyResponseDto[] = [];
export let devices: AuthDeviceResponseDto[] = []; export let devices: AuthDeviceResponseDto[] = [];
let oauthOpen = false; let oauthOpen = false;

View file

@ -1,4 +1,4 @@
import type { AssetResponseDto } from '@api'; import type { AssetResponseDto } from '@immich/sdk';
import { derived, writable } from 'svelte/store'; import { derived, writable } from 'svelte/store';
export interface AssetInteractionStore { export interface AssetInteractionStore {

View file

@ -1,6 +1,5 @@
import { getKey } from '$lib/utils'; import { getKey } from '$lib/utils';
import { type AssetResponseDto } from '@api'; import { getAssetInfo, type AssetResponseDto } from '@immich/sdk';
import { getAssetInfo } from '@immich/sdk';
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
function createAssetViewingStore() { function createAssetViewingStore() {

View file

@ -1,6 +1,5 @@
import { getKey } from '$lib/utils'; import { getKey } from '$lib/utils';
import { getTimeBucket, getTimeBuckets, type AssetResponseDto } from '@immich/sdk'; import { TimeBucketSize, getTimeBucket, getTimeBuckets, type AssetResponseDto } from '@immich/sdk';
import { TimeBucketSize, type AssetApiGetTimeBucketsRequest } from '@immich/sdk/axios';
import { throttle } from 'lodash-es'; import { throttle } from 'lodash-es';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import { writable, type Unsubscriber } from 'svelte/store'; import { writable, type Unsubscriber } from 'svelte/store';
@ -13,7 +12,7 @@ export enum BucketPosition {
Visible = 'visible', Visible = 'visible',
Unknown = 'unknown', Unknown = 'unknown',
} }
type AssetApiGetTimeBucketsRequest = Parameters<typeof getTimeBuckets>[0];
export type AssetStoreOptions = Omit<AssetApiGetTimeBucketsRequest, 'size'>; export type AssetStoreOptions = Omit<AssetApiGetTimeBucketsRequest, 'size'>;
export interface Viewport { export interface Viewport {
@ -157,10 +156,7 @@ export class AssetStore {
this.assetToBucket = {}; this.assetToBucket = {};
this.albumAssets = new Set(); this.albumAssets = new Set();
const buckets = await getTimeBuckets({ const buckets = await getTimeBuckets({ ...this.options, key: getKey() });
...this.options,
key: getKey(),
});
this.initialized = true; this.initialized = true;

View file

@ -1,4 +1,4 @@
import type { MemoryLaneResponseDto } from '@immich/sdk';
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
import type { MemoryLaneResponseDto } from '@api';
export const memoryStore = writable<MemoryLaneResponseDto[]>(); export const memoryStore = writable<MemoryLaneResponseDto[]>();

View file

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

View file

@ -1,4 +1,4 @@
import type { ServerInfoResponseDto } from '@immich/sdk';
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
import type { ServerInfoResponseDto } from '@api';
export const serverInfo = writable<ServerInfoResponseDto>(); export const serverInfo = writable<ServerInfoResponseDto>();

View file

@ -1,4 +1,4 @@
import type { AssetResponseDto } from '@immich/sdk';
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
import type { AssetResponseDto } from '@api';
export const stackAssetsStore = writable<AssetResponseDto[]>([]); export const stackAssetsStore = writable<AssetResponseDto[]>([]);

View file

@ -1,5 +1,5 @@
import type { UserResponseDto } from '@immich/sdk';
import { writable } from 'svelte/store'; import { writable } from 'svelte/store';
import type { UserResponseDto } from '@api';
export let user = writable<UserResponseDto>(); export let user = writable<UserResponseDto>();

View file

@ -1,5 +1,5 @@
import type { AssetResponseDto, ServerVersionResponseDto } from '@api'; import type { AssetResponseDto, ServerVersionResponseDto } from '@immich/sdk';
import { type Socket, io } from 'socket.io-client'; import { io, type Socket } from 'socket.io-client';
import { get, writable } from 'svelte/store'; import { get, writable } from 'svelte/store';
import { loadConfig } from './server-config.store'; import { loadConfig } from './server-config.store';
import { user } from './user.store'; import { user } from './user.store';

View file

@ -1,7 +1,20 @@
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import { defaults } from '@immich/sdk'; import { NotificationType, notificationController } from '$lib/components/shared-components/notification/notification';
import { AssetJobName, JobName, ThumbnailFormat, common } from '@immich/sdk/axios'; import { handleError } from '$lib/utils/handle-error';
import {
AssetJobName,
JobName,
ThumbnailFormat,
defaults,
finishOAuth,
linkOAuthAccount,
startOAuth,
unlinkOAuthAccount,
type UserResponseDto,
} from '@immich/sdk';
import { common } from '@immich/sdk/axios';
import type { AxiosError } from 'axios';
import { get } from 'svelte/store'; import { get } from 'svelte/store';
interface UpdateParamAction { interface UpdateParamAction {
@ -121,3 +134,58 @@ export const getAssetJobMessage = (job: AssetJobName) => {
return messages[job]; return messages[job];
}; };
export type ApiError = AxiosError<{ message: string }>;
export const copyToClipboard = async (secret: string) => {
try {
await navigator.clipboard.writeText(secret);
notificationController.show({ message: 'Copied to clipboard!', type: NotificationType.Info });
} catch (error) {
handleError(error, 'Cannot copy to clipboard, make sure you are accessing the page through https');
}
};
export const makeSharedLinkUrl = (externalDomain: string, key: string) => {
let url = externalDomain || window.location.origin;
if (!url.endsWith('/')) {
url += '/';
}
return `${url}share/${key}`;
};
export const oauth = {
isCallback: (location: Location) => {
const search = location.search;
return search.includes('code=') || search.includes('error=');
},
isAutoLaunchDisabled: (location: Location) => {
const values = ['autoLaunch=0', 'password=1', 'password=true'];
for (const value of values) {
if (location.search.includes(value)) {
return true;
}
}
return false;
},
authorize: async (location: Location) => {
try {
const redirectUri = location.href.split('?')[0];
const { url } = await startOAuth({ oAuthConfigDto: { redirectUri } });
window.location.href = url;
return true;
} catch (error) {
handleError(error, 'Unable to login with OAuth');
return false;
}
},
login: (location: Location) => {
return finishOAuth({ oAuthCallbackDto: { url: location.href } });
},
link: (location: Location): Promise<UserResponseDto> => {
return linkOAuthAccount({ oAuthCallbackDto: { url: location.href } });
},
unlink: () => {
return unlinkOAuthAccount();
},
};

View file

@ -1,4 +1,4 @@
import type { AssetResponseDto } from '@api'; import type { AssetResponseDto } from '@immich/sdk';
import { getAssetFilename, getFilenameExtension } from './asset-utils'; import { getAssetFilename, getFilenameExtension } from './asset-utils';
describe('get file extension from filename', () => { describe('get file extension from filename', () => {

View file

@ -1,6 +1,6 @@
import { api } from '$lib/api';
import { notificationController, NotificationType } from '$lib/components/shared-components/notification/notification'; import { notificationController, NotificationType } from '$lib/components/shared-components/notification/notification';
import { downloadManager } from '$lib/stores/download'; import { downloadManager } from '$lib/stores/download';
import { api } from '@api';
import { import {
addAssetsToAlbum as addAssets, addAssetsToAlbum as addAssets,
getDownloadInfo, getDownloadInfo,

View file

@ -1,10 +1,10 @@
import { api } from '$lib/api';
import { UploadState } from '$lib/models/upload-asset'; import { UploadState } from '$lib/models/upload-asset';
import { uploadAssetsStore } from '$lib/stores/upload'; import { uploadAssetsStore } from '$lib/stores/upload';
import { getKey } from '$lib/utils'; import { getKey } from '$lib/utils';
import { addAssetsToAlbum } from '$lib/utils/asset-utils'; import { addAssetsToAlbum } from '$lib/utils/asset-utils';
import { ExecutorQueue } from '$lib/utils/executor-queue'; import { ExecutorQueue } from '$lib/utils/executor-queue';
import { api, type AssetFileUploadResponseDto } from '@api'; import { getSupportedMediaTypes, type AssetFileUploadResponseDto } from '@immich/sdk';
import { getSupportedMediaTypes } from '@immich/sdk';
import { getServerErrorMessage, handleError } from './handle-error'; import { getServerErrorMessage, handleError } from './handle-error';
let _extensions: string[]; let _extensions: string[];

View file

@ -1,4 +1,4 @@
import type { ApiError } from '@api'; import type { ApiError } from '$lib/utils';
import axios from 'axios'; import axios from 'axios';
import { notificationController, NotificationType } from '../components/shared-components/notification/notification'; import { notificationController, NotificationType } from '../components/shared-components/notification/notification';

View file

@ -1,4 +1,4 @@
import type { PersonResponseDto } from '@api'; import type { PersonResponseDto } from '@immich/sdk';
export const searchNameLocal = ( export const searchNameLocal = (
name: string, name: string,

View file

@ -1,4 +1,4 @@
import type { AssetResponseDto } from '@api'; import type { AssetResponseDto } from '@immich/sdk';
import { groupBy, sortBy } from 'lodash-es'; import { groupBy, sortBy } from 'lodash-es';
import { DateTime, Interval } from 'luxon'; import { DateTime, Interval } from 'luxon';

View file

@ -8,42 +8,41 @@
</script> </script>
<script lang="ts"> <script lang="ts">
import { albumViewSettings } from '$lib/stores/preferences.store';
import AlbumCard from '$lib/components/album-page/album-card.svelte';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import AlbumCard from '$lib/components/album-page/album-card.svelte';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import Dropdown from '$lib/components/elements/dropdown.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import TableHeader from '$lib/components/elements/table-header.svelte';
import EditAlbumForm from '$lib/components/forms/edit-album-form.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
import ContextMenu from '$lib/components/shared-components/context-menu/context-menu.svelte'; import ContextMenu from '$lib/components/shared-components/context-menu/context-menu.svelte';
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte'; import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import type { PageData } from './$types';
import { useAlbums } from './albums.bloc';
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte'; import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import { onMount } from 'svelte';
import { flip } from 'svelte/animate';
import Dropdown from '$lib/components/elements/dropdown.svelte';
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
import { AppRoute, dateFormats } from '$lib/constants';
import { locale, AlbumViewMode } from '$lib/stores/preferences.store';
import {
notificationController,
NotificationType,
} from '$lib/components/shared-components/notification/notification';
import type { AlbumResponseDto } from '@api';
import TableHeader from '$lib/components/elements/table-header.svelte';
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte'; import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import EditAlbumForm from '$lib/components/forms/edit-album-form.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import { orderBy } from 'lodash-es';
import { import {
mdiPlusBoxOutline, NotificationType,
notificationController,
} from '$lib/components/shared-components/notification/notification';
import { AppRoute, dateFormats } from '$lib/constants';
import { AlbumViewMode, albumViewSettings, locale } from '$lib/stores/preferences.store';
import type { AlbumResponseDto } from '@immich/sdk';
import {
mdiArrowDownThin, mdiArrowDownThin,
mdiArrowUpThin, mdiArrowUpThin,
mdiDeleteOutline,
mdiFormatListBulletedSquare, mdiFormatListBulletedSquare,
mdiPencilOutline, mdiPencilOutline,
mdiPlusBoxOutline,
mdiTrashCanOutline, mdiTrashCanOutline,
mdiViewGridOutline, mdiViewGridOutline,
mdiDeleteOutline,
} from '@mdi/js'; } from '@mdi/js';
import { orderBy } from 'lodash-es';
import { onMount } from 'svelte';
import { flip } from 'svelte/animate';
import type { PageData } from './$types';
import { useAlbums } from './albums.bloc';
export let data: PageData; export let data: PageData;

View file

@ -46,8 +46,9 @@
import { getContextMenuPosition } from '$lib/utils/context-menu'; import { getContextMenuPosition } from '$lib/utils/context-menu';
import { openFileUploadDialog } from '$lib/utils/file-uploader'; import { openFileUploadDialog } from '$lib/utils/file-uploader';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { ReactionLevel, ReactionType, type ActivityResponseDto, type UserResponseDto } from '@api';
import { import {
ReactionLevel,
ReactionType,
addAssetsToAlbum, addAssetsToAlbum,
addUsersToAlbum, addUsersToAlbum,
createActivity, createActivity,
@ -57,6 +58,8 @@
getActivityStatistics, getActivityStatistics,
getAlbumInfo, getAlbumInfo,
updateAlbumInfo, updateAlbumInfo,
type ActivityResponseDto,
type UserResponseDto,
} from '@immich/sdk'; } from '@immich/sdk';
import { import {
mdiArrowLeft, mdiArrowLeft,

View file

@ -10,8 +10,7 @@
import type { MapSettings } from '$lib/stores/preferences.store'; import type { MapSettings } from '$lib/stores/preferences.store';
import { mapSettings } from '$lib/stores/preferences.store'; import { mapSettings } from '$lib/stores/preferences.store';
import { featureFlags } from '$lib/stores/server-config.store'; import { featureFlags } from '$lib/stores/server-config.store';
import { type MapMarkerResponseDto } from '@api'; import { getMapMarkers, type MapMarkerResponseDto } from '@immich/sdk';
import { getMapMarkers } from '@immich/sdk';
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
import { DateTime, Duration } from 'luxon'; import { DateTime, Duration } from 'luxon';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';

View file

@ -28,8 +28,15 @@
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { searchNameLocal } from '$lib/utils/person'; import { searchNameLocal } from '$lib/utils/person';
import { shouldIgnoreShortcut } from '$lib/utils/shortcut'; import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
import { type PeopleUpdateItem, type PersonResponseDto } from '@api'; import {
import { getPerson, mergePerson, searchPerson, updatePeople, updatePerson } from '@immich/sdk'; getPerson,
mergePerson,
searchPerson,
updatePeople,
updatePerson,
type PeopleUpdateItem,
type PersonResponseDto,
} from '@immich/sdk';
import { mdiAccountOff, mdiEyeOutline } from '@mdi/js'; import { mdiAccountOff, mdiEyeOutline } from '@mdi/js';
import { onDestroy, onMount } from 'svelte'; import { onDestroy, onMount } from 'svelte';
import type { PageData } from './$types'; import type { PageData } from './$types';

View file

@ -31,6 +31,7 @@
import { assetViewingStore } from '$lib/stores/asset-viewing.store'; import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { AssetStore } from '$lib/stores/assets.store'; import { AssetStore } from '$lib/stores/assets.store';
import { websocketStore } from '$lib/stores/websocket'; import { websocketStore } from '$lib/stores/websocket';
import { getPeopleThumbnailUrl } from '$lib/utils';
import { clickOutside } from '$lib/utils/click-outside'; import { clickOutside } from '$lib/utils/click-outside';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { isExternalUrl } from '$lib/utils/navigation'; import { isExternalUrl } from '$lib/utils/navigation';
@ -46,7 +47,6 @@
import { mdiArrowLeft, mdiDotsVertical, mdiPlus } from '@mdi/js'; import { mdiArrowLeft, mdiDotsVertical, mdiPlus } from '@mdi/js';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import type { PageData } from './$types'; import type { PageData } from './$types';
import { getPeopleThumbnailUrl } from '$lib/utils';
export let data: PageData; export let data: PageData;

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { SearchExploreResponseDto } from '@api';
import type { PageData } from './$types';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import { mdiMapMarkerOff } from '@mdi/js';
import Icon from '$lib/components/elements/icon.svelte';
import { AppRoute } from '$lib/constants';
import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte'; import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import { AppRoute } from '$lib/constants';
import type { SearchExploreResponseDto } from '@immich/sdk';
import { mdiMapMarkerOff } from '@mdi/js';
import type { PageData } from './$types';
export let data: PageData; export let data: PageData;

View file

@ -1,6 +1,10 @@
<script lang="ts"> <script lang="ts">
import { browser } from '$app/environment';
import { afterNavigate, goto } from '$app/navigation'; import { afterNavigate, goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import AlbumCard from '$lib/components/album-page/album-card.svelte';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import AddToAlbum from '$lib/components/photos-page/actions/add-to-album.svelte'; import AddToAlbum from '$lib/components/photos-page/actions/add-to-album.svelte';
import ArchiveAction from '$lib/components/photos-page/actions/archive-action.svelte'; import ArchiveAction from '$lib/components/photos-page/actions/archive-action.svelte';
import ChangeDate from '$lib/components/photos-page/actions/change-date-action.svelte'; import ChangeDate from '$lib/components/photos-page/actions/change-date-action.svelte';
@ -14,20 +18,16 @@
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte'; import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte'; import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte';
import SearchBar from '$lib/components/shared-components/search-bar/search-bar.svelte'; import SearchBar from '$lib/components/shared-components/search-bar/search-bar.svelte';
import type { PageData } from './$types';
import Icon from '$lib/components/elements/icon.svelte';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import { AppRoute, QueryParameter } from '$lib/constants'; import { AppRoute, QueryParameter } from '$lib/constants';
import AlbumCard from '$lib/components/album-page/album-card.svelte';
import { flip } from 'svelte/animate';
import { onDestroy, onMount } from 'svelte';
import { browser } from '$app/environment';
import { assetViewingStore } from '$lib/stores/asset-viewing.store'; import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import { preventRaceConditionSearchBar } from '$lib/stores/search.store'; import { preventRaceConditionSearchBar } from '$lib/stores/search.store';
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
import { mdiArrowLeft, mdiDotsVertical, mdiImageOffOutline, mdiPlus, mdiSelectAll } from '@mdi/js';
import { search, type AssetResponseDto, type SearchResponseDto } from '@immich/sdk';
import { authenticate } from '$lib/utils/auth'; import { authenticate } from '$lib/utils/auth';
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
import { search, type AssetResponseDto, type SearchResponseDto } from '@immich/sdk';
import { mdiArrowLeft, mdiDotsVertical, mdiImageOffOutline, mdiPlus, mdiSelectAll } from '@mdi/js';
import { onDestroy, onMount } from 'svelte';
import { flip } from 'svelte/animate';
import type { PageData } from './$types';
export let data: PageData; export let data: PageData;

View file

@ -7,8 +7,7 @@
import ThemeButton from '$lib/components/shared-components/theme-button.svelte'; import ThemeButton from '$lib/components/shared-components/theme-button.svelte';
import { user } from '$lib/stores/user.store'; import { user } from '$lib/stores/user.store';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { SharedLinkType } from '@api'; import { getMySharedLink, SharedLinkType } from '@immich/sdk';
import { getMySharedLink } from '@immich/sdk';
import type { PageData } from './$types'; import type { PageData } from './$types';
export let data: PageData; export let data: PageData;

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