From 6d9dc466196065adbd1dfea22399b129285b3760 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Fri, 23 Jan 2026 09:24:25 -0500 Subject: [PATCH] chore: include sync dtos (#25470) --- open-api/bin/generate-open-api.sh | 2 +- open-api/typescript-sdk/src/fetch-client.ts | 209 ++++++++++++++++++++ web/src/lib/stores/websocket.ts | 3 +- 3 files changed, 212 insertions(+), 2 deletions(-) diff --git a/open-api/bin/generate-open-api.sh b/open-api/bin/generate-open-api.sh index 43292089d7..522063185f 100755 --- a/open-api/bin/generate-open-api.sh +++ b/open-api/bin/generate-open-api.sh @@ -27,7 +27,7 @@ function dart { } function typescript { - pnpm dlx oazapfts --optimistic --argumentStyle=object --useEnumType immich-openapi-specs.json typescript-sdk/src/fetch-client.ts + pnpm dlx oazapfts --optimistic --argumentStyle=object --useEnumType --allSchemas immich-openapi-specs.json typescript-sdk/src/fetch-client.ts pnpm --filter @immich/sdk install --frozen-lockfile pnpm --filter @immich/sdk build } diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index c18ae9f475..41d4f2689d 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -1875,6 +1875,210 @@ export type WorkflowUpdateDto = { name?: string; triggerType?: PluginTriggerType; }; +export type SyncAckV1 = {}; +export type SyncAlbumDeleteV1 = { + albumId: string; +}; +export type SyncAlbumToAssetDeleteV1 = { + albumId: string; + assetId: string; +}; +export type SyncAlbumToAssetV1 = { + albumId: string; + assetId: string; +}; +export type SyncAlbumUserDeleteV1 = { + albumId: string; + userId: string; +}; +export type SyncAlbumUserV1 = { + albumId: string; + role: AlbumUserRole; + userId: string; +}; +export type SyncAlbumV1 = { + createdAt: string; + description: string; + id: string; + isActivityEnabled: boolean; + name: string; + order: AssetOrder; + ownerId: string; + thumbnailAssetId: string | null; + updatedAt: string; +}; +export type SyncAssetDeleteV1 = { + assetId: string; +}; +export type SyncAssetExifV1 = { + assetId: string; + city: string | null; + country: string | null; + dateTimeOriginal: string | null; + description: string | null; + exifImageHeight: number | null; + exifImageWidth: number | null; + exposureTime: string | null; + fNumber: number | null; + fileSizeInByte: number | null; + focalLength: number | null; + fps: number | null; + iso: number | null; + latitude: number | null; + lensModel: string | null; + longitude: number | null; + make: string | null; + model: string | null; + modifyDate: string | null; + orientation: string | null; + profileDescription: string | null; + projectionType: string | null; + rating: number | null; + state: string | null; + timeZone: string | null; +}; +export type SyncAssetFaceDeleteV1 = { + assetFaceId: string; +}; +export type SyncAssetFaceV1 = { + assetId: string; + boundingBoxX1: number; + boundingBoxX2: number; + boundingBoxY1: number; + boundingBoxY2: number; + id: string; + imageHeight: number; + imageWidth: number; + personId: string | null; + sourceType: string; +}; +export type SyncAssetMetadataDeleteV1 = { + assetId: string; + key: string; +}; +export type SyncAssetMetadataV1 = { + assetId: string; + key: string; + value: object; +}; +export type SyncAssetV1 = { + checksum: string; + deletedAt: string | null; + duration: string | null; + fileCreatedAt: string | null; + fileModifiedAt: string | null; + height: number | null; + id: string; + isEdited: boolean; + isFavorite: boolean; + libraryId: string | null; + livePhotoVideoId: string | null; + localDateTime: string | null; + originalFileName: string; + ownerId: string; + stackId: string | null; + thumbhash: string | null; + "type": AssetTypeEnum; + visibility: AssetVisibility; + width: number | null; +}; +export type SyncAuthUserV1 = { + avatarColor: (UserAvatarColor) | null; + deletedAt: string | null; + email: string; + hasProfileImage: boolean; + id: string; + isAdmin: boolean; + name: string; + oauthId: string; + pinCode: string | null; + profileChangedAt: string; + quotaSizeInBytes: number | null; + quotaUsageInBytes: number; + storageLabel: string | null; +}; +export type SyncCompleteV1 = {}; +export type SyncMemoryAssetDeleteV1 = { + assetId: string; + memoryId: string; +}; +export type SyncMemoryAssetV1 = { + assetId: string; + memoryId: string; +}; +export type SyncMemoryDeleteV1 = { + memoryId: string; +}; +export type SyncMemoryV1 = { + createdAt: string; + data: object; + deletedAt: string | null; + hideAt: string | null; + id: string; + isSaved: boolean; + memoryAt: string; + ownerId: string; + seenAt: string | null; + showAt: string | null; + "type": MemoryType; + updatedAt: string; +}; +export type SyncPartnerDeleteV1 = { + sharedById: string; + sharedWithId: string; +}; +export type SyncPartnerV1 = { + inTimeline: boolean; + sharedById: string; + sharedWithId: string; +}; +export type SyncPersonDeleteV1 = { + personId: string; +}; +export type SyncPersonV1 = { + birthDate: string | null; + color: string | null; + createdAt: string; + faceAssetId: string | null; + id: string; + isFavorite: boolean; + isHidden: boolean; + name: string; + ownerId: string; + updatedAt: string; +}; +export type SyncResetV1 = {}; +export type SyncStackDeleteV1 = { + stackId: string; +}; +export type SyncStackV1 = { + createdAt: string; + id: string; + ownerId: string; + primaryAssetId: string; + updatedAt: string; +}; +export type SyncUserDeleteV1 = { + userId: string; +}; +export type SyncUserMetadataDeleteV1 = { + key: UserMetadataKey; + userId: string; +}; +export type SyncUserMetadataV1 = { + key: UserMetadataKey; + userId: string; + value: object; +}; +export type SyncUserV1 = { + avatarColor: (UserAvatarColor) | null; + deletedAt: string | null; + email: string; + hasProfileImage: boolean; + id: string; + name: string; + profileChangedAt: string; +}; /** * List all activities */ @@ -5939,3 +6143,8 @@ export enum OAuthTokenEndpointAuthMethod { ClientSecretPost = "client_secret_post", ClientSecretBasic = "client_secret_basic" } +export enum UserMetadataKey { + Preferences = "preferences", + License = "license", + Onboarding = "onboarding" +} diff --git a/web/src/lib/stores/websocket.ts b/web/src/lib/stores/websocket.ts index 5e197fbb3f..335ec188ea 100644 --- a/web/src/lib/stores/websocket.ts +++ b/web/src/lib/stores/websocket.ts @@ -12,6 +12,7 @@ import { type MaintenanceStatusResponseDto, type NotificationDto, type ServerVersionResponseDto, + type SyncAssetV1, } from '@immich/sdk'; import { io, type Socket } from 'socket.io-client'; import { get, writable } from 'svelte/store'; @@ -40,7 +41,7 @@ export interface Events { AppRestartV1: (event: AppRestartEvent) => void; MaintenanceStatusV1: (event: MaintenanceStatusResponseDto) => void; - AssetEditReadyV1: (data: { asset: { id: string } }) => void; + AssetEditReadyV1: (data: { asset: SyncAssetV1 }) => void; } const websocket: Socket = io({