From f1390febf35e086528434e0d6ff5592d7a9503c7 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 14 Oct 2025 11:43:53 +0200 Subject: [PATCH] feat: partner sharing from specific date --- e2e/src/api/specs/partner.e2e-spec.ts | 101 +- open-api/typescript-sdk/src/fetch-client.ts | 8047 ++++++++++------- server/src/database.ts | 1 + server/src/dtos/partner.dto.ts | 9 +- server/src/repositories/access.repository.ts | 9 +- server/src/repositories/asset.repository.ts | 86 +- .../1760433605815-AddPartnerStartDate.ts | 9 + server/src/schema/tables/partner.table.ts | 3 + server/src/services/partner.service.spec.ts | 36 + server/src/services/partner.service.ts | 13 +- 10 files changed, 5218 insertions(+), 3096 deletions(-) create mode 100644 server/src/schema/migrations/1760433605815-AddPartnerStartDate.ts diff --git a/e2e/src/api/specs/partner.e2e-spec.ts b/e2e/src/api/specs/partner.e2e-spec.ts index 9047a97055..19e38e3612 100644 --- a/e2e/src/api/specs/partner.e2e-spec.ts +++ b/e2e/src/api/specs/partner.e2e-spec.ts @@ -1,4 +1,4 @@ -import { LoginResponseDto, createPartner } from '@immich/sdk'; +import { LoginResponseDto, createPartner, getAssetInfo } from '@immich/sdk'; import { createUserDto } from 'src/fixtures'; import { errorDto } from 'src/responses'; import { app, asBearerAuth, utils } from 'src/utils'; @@ -101,6 +101,105 @@ describe('/partners', () => { expect(status).toBe(200); expect(body).toEqual(expect.objectContaining({ id: user2.userId, inTimeline: false })); }); + + it('should update partner with startDate', async () => { + const startDate = '2024-01-01T00:00:00.000Z'; + const { status, body } = await request(app) + .put(`/partners/${user2.userId}`) + .set('Authorization', `Bearer ${user1.accessToken}`) + .send({ inTimeline: true, startDate }); + + expect(status).toBe(200); + expect(body).toEqual(expect.objectContaining({ id: user2.userId, inTimeline: true, startDate })); + }); + + it('should clear partner startDate when set to null', async () => { + const { status, body } = await request(app) + .put(`/partners/${user2.userId}`) + .set('Authorization', `Bearer ${user1.accessToken}`) + .send({ inTimeline: true, startDate: null }); + + expect(status).toBe(200); + expect(body).toEqual(expect.objectContaining({ id: user2.userId, inTimeline: true })); + expect(body.startDate).toBeUndefined(); + }); + }); + + describe('POST /partners with startDate', () => { + it('should create partner with startDate', async () => { + const startDate = '2024-06-01T00:00:00.000Z'; + const { status, body } = await request(app) + .post('/partners') + .set('Authorization', `Bearer ${user1.accessToken}`) + .send({ sharedWithId: user3.userId, startDate }); + + expect(status).toBe(201); + expect(body).toEqual(expect.objectContaining({ id: user3.userId, startDate })); + + // Clean up + await request(app).delete(`/partners/${user3.userId}`).set('Authorization', `Bearer ${user1.accessToken}`); + }); + }); + + describe('GET /partners with startDate', () => { + it('should return partner with startDate in response', async () => { + const startDate = '2023-12-01T00:00:00.000Z'; + + // Create partner with startDate + await request(app) + .post('/partners') + .set('Authorization', `Bearer ${user1.accessToken}`) + .send({ sharedWithId: user3.userId, startDate }); + + const { status, body } = await request(app) + .get('/partners') + .set('Authorization', `Bearer ${user1.accessToken}`) + .query({ direction: 'shared-by' }); + + expect(status).toBe(200); + const partner = body.find((p: any) => p.id === user3.userId); + expect(partner).toBeDefined(); + expect(partner.startDate).toBe(startDate); + + // Clean up + await request(app).delete(`/partners/${user3.userId}`).set('Authorization', `Bearer ${user1.accessToken}`); + }); + }); + + describe('Partner asset access with startDate', () => { + it('should filter partner assets by startDate', async () => { + // Create assets with different dates for user2 + const oldAsset = await utils.createAsset(user2.accessToken, { + fileCreatedAt: new Date('2023-01-01T00:00:00.000Z').toISOString(), + }); + const newAsset = await utils.createAsset(user2.accessToken, { + fileCreatedAt: new Date('2024-06-01T00:00:00.000Z').toISOString(), + }); + + // Set partner startDate to 2024-01-01 + const startDate = '2024-01-01T00:00:00.000Z'; + await request(app) + .put(`/partners/${user2.userId}`) + .set('Authorization', `Bearer ${user1.accessToken}`) + .send({ inTimeline: true, startDate }); + + // User1 should be able to access the new asset + const newAssetInfo = await getAssetInfo( + { id: newAsset.id }, + { headers: asBearerAuth(user1.accessToken) }, + ); + expect(newAssetInfo.id).toBe(newAsset.id); + + // User1 should NOT be able to access the old asset (before startDate) + // Note: Access check happens at permission level, not returning the asset + // We verify by checking if it appears in timeline/search results + const { status: oldStatus } = await request(app) + .get(`/assets/${oldAsset.id}`) + .set('Authorization', `Bearer ${user1.accessToken}`); + + // The old asset should be denied access (403) or not found (404) due to startDate filter + expect([403, 404]).toContain(oldStatus); + }); }); describe('DELETE /partners/:id', () => { diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index c8a69dfe8c..c8e2cf7d6b 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -7,3377 +7,4599 @@ import * as Oazapfts from "@oazapfts/runtime"; import * as QS from "@oazapfts/runtime/query"; export const defaults: Oazapfts.Defaults = { - headers: {}, - baseUrl: "/api", + headers: {}, + baseUrl: "/api", }; const oazapfts = Oazapfts.runtime(defaults); export const servers = { - server1: "/api" + server1: "/api", }; export type UserResponseDto = { - avatarColor: UserAvatarColor; - email: string; - id: string; - name: string; - profileChangedAt: string; - profileImagePath: string; + avatarColor: UserAvatarColor; + email: string; + id: string; + name: string; + profileChangedAt: string; + profileImagePath: string; }; export type ActivityResponseDto = { - assetId: string | null; - comment?: string | null; - createdAt: string; - id: string; - "type": ReactionType; - user: UserResponseDto; + assetId: string | null; + comment?: string | null; + createdAt: string; + id: string; + type: ReactionType; + user: UserResponseDto; }; export type ActivityCreateDto = { - albumId: string; - assetId?: string; - comment?: string; - "type": ReactionType; + albumId: string; + assetId?: string; + comment?: string; + type: ReactionType; }; export type ActivityStatisticsResponseDto = { - comments: number; - likes: number; + comments: number; + likes: number; }; export type NotificationCreateDto = { - data?: object; - description?: string | null; - level?: NotificationLevel; - readAt?: string | null; - title: string; - "type"?: NotificationType; - userId: string; + data?: object; + description?: string | null; + level?: NotificationLevel; + readAt?: string | null; + title: string; + type?: NotificationType; + userId: string; }; export type NotificationDto = { - createdAt: string; - data?: object; - description?: string; - id: string; - level: NotificationLevel; - readAt?: string; - title: string; - "type": NotificationType; + createdAt: string; + data?: object; + description?: string; + id: string; + level: NotificationLevel; + readAt?: string; + title: string; + type: NotificationType; }; export type TemplateDto = { - template: string; + template: string; }; export type TemplateResponseDto = { - html: string; - name: string; + html: string; + name: string; }; export type SystemConfigSmtpTransportDto = { - host: string; - ignoreCert: boolean; - password: string; - port: number; - username: string; + host: string; + ignoreCert: boolean; + password: string; + port: number; + username: string; }; export type SystemConfigSmtpDto = { - enabled: boolean; - "from": string; - replyTo: string; - transport: SystemConfigSmtpTransportDto; + enabled: boolean; + from: string; + replyTo: string; + transport: SystemConfigSmtpTransportDto; }; export type TestEmailResponseDto = { - messageId: string; + messageId: string; }; export type UserLicense = { - activatedAt: string; - activationKey: string; - licenseKey: string; + activatedAt: string; + activationKey: string; + licenseKey: string; }; export type UserAdminResponseDto = { - avatarColor: UserAvatarColor; - createdAt: string; - deletedAt: string | null; - email: string; - id: string; - isAdmin: boolean; - license: (UserLicense) | null; - name: string; - oauthId: string; - profileChangedAt: string; - profileImagePath: string; - quotaSizeInBytes: number | null; - quotaUsageInBytes: number | null; - shouldChangePassword: boolean; - status: UserStatus; - storageLabel: string | null; - updatedAt: string; + avatarColor: UserAvatarColor; + createdAt: string; + deletedAt: string | null; + email: string; + id: string; + isAdmin: boolean; + license: UserLicense | null; + name: string; + oauthId: string; + profileChangedAt: string; + profileImagePath: string; + quotaSizeInBytes: number | null; + quotaUsageInBytes: number | null; + shouldChangePassword: boolean; + status: UserStatus; + storageLabel: string | null; + updatedAt: string; }; export type UserAdminCreateDto = { - avatarColor?: (UserAvatarColor) | null; - email: string; - isAdmin?: boolean; - name: string; - notify?: boolean; - password: string; - quotaSizeInBytes?: number | null; - shouldChangePassword?: boolean; - storageLabel?: string | null; + avatarColor?: UserAvatarColor | null; + email: string; + isAdmin?: boolean; + name: string; + notify?: boolean; + password: string; + quotaSizeInBytes?: number | null; + shouldChangePassword?: boolean; + storageLabel?: string | null; }; export type UserAdminDeleteDto = { - force?: boolean; + force?: boolean; }; export type UserAdminUpdateDto = { - avatarColor?: (UserAvatarColor) | null; - email?: string; - isAdmin?: boolean; - name?: string; - password?: string; - pinCode?: string | null; - quotaSizeInBytes?: number | null; - shouldChangePassword?: boolean; - storageLabel?: string | null; + avatarColor?: UserAvatarColor | null; + email?: string; + isAdmin?: boolean; + name?: string; + password?: string; + pinCode?: string | null; + quotaSizeInBytes?: number | null; + shouldChangePassword?: boolean; + storageLabel?: string | null; }; export type AlbumsResponse = { - defaultAssetOrder: AssetOrder; + defaultAssetOrder: AssetOrder; }; export type CastResponse = { - gCastEnabled: boolean; + gCastEnabled: boolean; }; export type DownloadResponse = { - archiveSize: number; - includeEmbeddedVideos: boolean; + archiveSize: number; + includeEmbeddedVideos: boolean; }; export type EmailNotificationsResponse = { - albumInvite: boolean; - albumUpdate: boolean; - enabled: boolean; + albumInvite: boolean; + albumUpdate: boolean; + enabled: boolean; }; export type FoldersResponse = { - enabled: boolean; - sidebarWeb: boolean; + enabled: boolean; + sidebarWeb: boolean; }; export type MemoriesResponse = { - enabled: boolean; + enabled: boolean; }; export type PeopleResponse = { - enabled: boolean; - sidebarWeb: boolean; + enabled: boolean; + sidebarWeb: boolean; }; export type PurchaseResponse = { - hideBuyButtonUntil: string; - showSupportBadge: boolean; + hideBuyButtonUntil: string; + showSupportBadge: boolean; }; export type RatingsResponse = { - enabled: boolean; + enabled: boolean; }; export type SharedLinksResponse = { - enabled: boolean; - sidebarWeb: boolean; + enabled: boolean; + sidebarWeb: boolean; }; export type TagsResponse = { - enabled: boolean; - sidebarWeb: boolean; + enabled: boolean; + sidebarWeb: boolean; }; export type UserPreferencesResponseDto = { - albums: AlbumsResponse; - cast: CastResponse; - download: DownloadResponse; - emailNotifications: EmailNotificationsResponse; - folders: FoldersResponse; - memories: MemoriesResponse; - people: PeopleResponse; - purchase: PurchaseResponse; - ratings: RatingsResponse; - sharedLinks: SharedLinksResponse; - tags: TagsResponse; + albums: AlbumsResponse; + cast: CastResponse; + download: DownloadResponse; + emailNotifications: EmailNotificationsResponse; + folders: FoldersResponse; + memories: MemoriesResponse; + people: PeopleResponse; + purchase: PurchaseResponse; + ratings: RatingsResponse; + sharedLinks: SharedLinksResponse; + tags: TagsResponse; }; export type AlbumsUpdate = { - defaultAssetOrder?: AssetOrder; + defaultAssetOrder?: AssetOrder; }; export type AvatarUpdate = { - color?: UserAvatarColor; + color?: UserAvatarColor; }; export type CastUpdate = { - gCastEnabled?: boolean; + gCastEnabled?: boolean; }; export type DownloadUpdate = { - archiveSize?: number; - includeEmbeddedVideos?: boolean; + archiveSize?: number; + includeEmbeddedVideos?: boolean; }; export type EmailNotificationsUpdate = { - albumInvite?: boolean; - albumUpdate?: boolean; - enabled?: boolean; + albumInvite?: boolean; + albumUpdate?: boolean; + enabled?: boolean; }; export type FoldersUpdate = { - enabled?: boolean; - sidebarWeb?: boolean; + enabled?: boolean; + sidebarWeb?: boolean; }; export type MemoriesUpdate = { - enabled?: boolean; + enabled?: boolean; }; export type PeopleUpdate = { - enabled?: boolean; - sidebarWeb?: boolean; + enabled?: boolean; + sidebarWeb?: boolean; }; export type PurchaseUpdate = { - hideBuyButtonUntil?: string; - showSupportBadge?: boolean; + hideBuyButtonUntil?: string; + showSupportBadge?: boolean; }; export type RatingsUpdate = { - enabled?: boolean; + enabled?: boolean; }; export type SharedLinksUpdate = { - enabled?: boolean; - sidebarWeb?: boolean; + enabled?: boolean; + sidebarWeb?: boolean; }; export type TagsUpdate = { - enabled?: boolean; - sidebarWeb?: boolean; + enabled?: boolean; + sidebarWeb?: boolean; }; export type UserPreferencesUpdateDto = { - albums?: AlbumsUpdate; - avatar?: AvatarUpdate; - cast?: CastUpdate; - download?: DownloadUpdate; - emailNotifications?: EmailNotificationsUpdate; - folders?: FoldersUpdate; - memories?: MemoriesUpdate; - people?: PeopleUpdate; - purchase?: PurchaseUpdate; - ratings?: RatingsUpdate; - sharedLinks?: SharedLinksUpdate; - tags?: TagsUpdate; + albums?: AlbumsUpdate; + avatar?: AvatarUpdate; + cast?: CastUpdate; + download?: DownloadUpdate; + emailNotifications?: EmailNotificationsUpdate; + folders?: FoldersUpdate; + memories?: MemoriesUpdate; + people?: PeopleUpdate; + purchase?: PurchaseUpdate; + ratings?: RatingsUpdate; + sharedLinks?: SharedLinksUpdate; + tags?: TagsUpdate; }; export type AssetStatsResponseDto = { - images: number; - total: number; - videos: number; + images: number; + total: number; + videos: number; }; export type AlbumUserResponseDto = { - role: AlbumUserRole; - user: UserResponseDto; + role: AlbumUserRole; + user: UserResponseDto; }; export type ExifResponseDto = { - 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; - iso?: number | null; - latitude?: number | null; - lensModel?: string | null; - longitude?: number | null; - make?: string | null; - model?: string | null; - modifyDate?: string | null; - orientation?: string | null; - projectionType?: string | null; - rating?: number | null; - state?: string | null; - timeZone?: string | null; + 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; + iso?: number | null; + latitude?: number | null; + lensModel?: string | null; + longitude?: number | null; + make?: string | null; + model?: string | null; + modifyDate?: string | null; + orientation?: string | null; + projectionType?: string | null; + rating?: number | null; + state?: string | null; + timeZone?: string | null; }; export type AssetFaceWithoutPersonResponseDto = { - boundingBoxX1: number; - boundingBoxX2: number; - boundingBoxY1: number; - boundingBoxY2: number; - id: string; - imageHeight: number; - imageWidth: number; - sourceType?: SourceType; + boundingBoxX1: number; + boundingBoxX2: number; + boundingBoxY1: number; + boundingBoxY2: number; + id: string; + imageHeight: number; + imageWidth: number; + sourceType?: SourceType; }; export type PersonWithFacesResponseDto = { - birthDate: string | null; - /** This property was added in v1.126.0 */ - color?: string; - faces: AssetFaceWithoutPersonResponseDto[]; - id: string; - /** This property was added in v1.126.0 */ - isFavorite?: boolean; - isHidden: boolean; - name: string; - thumbnailPath: string; - /** This property was added in v1.107.0 */ - updatedAt?: string; + birthDate: string | null; + /** This property was added in v1.126.0 */ + color?: string; + faces: AssetFaceWithoutPersonResponseDto[]; + id: string; + /** This property was added in v1.126.0 */ + isFavorite?: boolean; + isHidden: boolean; + name: string; + thumbnailPath: string; + /** This property was added in v1.107.0 */ + updatedAt?: string; }; export type AssetStackResponseDto = { - assetCount: number; - id: string; - primaryAssetId: string; + assetCount: number; + id: string; + primaryAssetId: string; }; export type TagResponseDto = { - color?: string; - createdAt: string; - id: string; - name: string; - parentId?: string; - updatedAt: string; - value: string; + color?: string; + createdAt: string; + id: string; + name: string; + parentId?: string; + updatedAt: string; + value: string; }; export type AssetResponseDto = { - /** base64 encoded sha1 hash */ - checksum: string; - /** The UTC timestamp when the asset was originally uploaded to Immich. */ - createdAt: string; - deviceAssetId: string; - deviceId: string; - duplicateId?: string | null; - duration: string; - exifInfo?: ExifResponseDto; - /** The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken. */ - fileCreatedAt: string; - /** The UTC timestamp when the file was last modified on the filesystem. This reflects the last time the physical file was changed, which may be different from when the photo was originally taken. */ - fileModifiedAt: string; - hasMetadata: boolean; - id: string; - isArchived: boolean; - isFavorite: boolean; - isOffline: boolean; - isTrashed: boolean; - /** This property was deprecated in v1.106.0 */ - libraryId?: string | null; - livePhotoVideoId?: string | null; - /** The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by "local" days and months. */ - localDateTime: string; - originalFileName: string; - originalMimeType?: string; - originalPath: string; - owner?: UserResponseDto; - ownerId: string; - people?: PersonWithFacesResponseDto[]; - /** This property was deprecated in v1.113.0 */ - resized?: boolean; - stack?: (AssetStackResponseDto) | null; - tags?: TagResponseDto[]; - thumbhash: string | null; - "type": AssetTypeEnum; - unassignedFaces?: AssetFaceWithoutPersonResponseDto[]; - /** The UTC timestamp when the asset record was last updated in the database. This is automatically maintained by the database and reflects when any field in the asset was last modified. */ - updatedAt: string; - visibility: AssetVisibility; + /** base64 encoded sha1 hash */ + checksum: string; + /** The UTC timestamp when the asset was originally uploaded to Immich. */ + createdAt: string; + deviceAssetId: string; + deviceId: string; + duplicateId?: string | null; + duration: string; + exifInfo?: ExifResponseDto; + /** The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken. */ + fileCreatedAt: string; + /** The UTC timestamp when the file was last modified on the filesystem. This reflects the last time the physical file was changed, which may be different from when the photo was originally taken. */ + fileModifiedAt: string; + hasMetadata: boolean; + id: string; + isArchived: boolean; + isFavorite: boolean; + isOffline: boolean; + isTrashed: boolean; + /** This property was deprecated in v1.106.0 */ + libraryId?: string | null; + livePhotoVideoId?: string | null; + /** The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by "local" days and months. */ + localDateTime: string; + originalFileName: string; + originalMimeType?: string; + originalPath: string; + owner?: UserResponseDto; + ownerId: string; + people?: PersonWithFacesResponseDto[]; + /** This property was deprecated in v1.113.0 */ + resized?: boolean; + stack?: AssetStackResponseDto | null; + tags?: TagResponseDto[]; + thumbhash: string | null; + type: AssetTypeEnum; + unassignedFaces?: AssetFaceWithoutPersonResponseDto[]; + /** The UTC timestamp when the asset record was last updated in the database. This is automatically maintained by the database and reflects when any field in the asset was last modified. */ + updatedAt: string; + visibility: AssetVisibility; }; export type AlbumResponseDto = { - albumName: string; - albumThumbnailAssetId: string | null; - albumUsers: AlbumUserResponseDto[]; - assetCount: number; - assets: AssetResponseDto[]; - createdAt: string; - description: string; - endDate?: string; - hasSharedLink: boolean; - id: string; - isActivityEnabled: boolean; - lastModifiedAssetTimestamp?: string; - order?: AssetOrder; - owner: UserResponseDto; - ownerId: string; - shared: boolean; - startDate?: string; - updatedAt: string; + albumName: string; + albumThumbnailAssetId: string | null; + albumUsers: AlbumUserResponseDto[]; + assetCount: number; + assets: AssetResponseDto[]; + createdAt: string; + description: string; + endDate?: string; + hasSharedLink: boolean; + id: string; + isActivityEnabled: boolean; + lastModifiedAssetTimestamp?: string; + order?: AssetOrder; + owner: UserResponseDto; + ownerId: string; + shared: boolean; + startDate?: string; + updatedAt: string; }; export type AlbumUserCreateDto = { - role: AlbumUserRole; - userId: string; + role: AlbumUserRole; + userId: string; }; export type CreateAlbumDto = { - albumName: string; - albumUsers?: AlbumUserCreateDto[]; - assetIds?: string[]; - description?: string; + albumName: string; + albumUsers?: AlbumUserCreateDto[]; + assetIds?: string[]; + description?: string; }; export type AlbumsAddAssetsDto = { - albumIds: string[]; - assetIds: string[]; + albumIds: string[]; + assetIds: string[]; }; export type AlbumsAddAssetsResponseDto = { - error?: BulkIdErrorReason; - success: boolean; + error?: BulkIdErrorReason; + success: boolean; }; export type AlbumStatisticsResponseDto = { - notShared: number; - owned: number; - shared: number; + notShared: number; + owned: number; + shared: number; }; export type UpdateAlbumDto = { - albumName?: string; - albumThumbnailAssetId?: string; - description?: string; - isActivityEnabled?: boolean; - order?: AssetOrder; + albumName?: string; + albumThumbnailAssetId?: string; + description?: string; + isActivityEnabled?: boolean; + order?: AssetOrder; }; export type BulkIdsDto = { - ids: string[]; + ids: string[]; }; export type BulkIdResponseDto = { - error?: Error; - id: string; - success: boolean; + error?: Error; + id: string; + success: boolean; }; export type UpdateAlbumUserDto = { - role: AlbumUserRole; + role: AlbumUserRole; }; export type AlbumUserAddDto = { - role?: AlbumUserRole; - userId: string; + role?: AlbumUserRole; + userId: string; }; export type AddUsersDto = { - albumUsers: AlbumUserAddDto[]; + albumUsers: AlbumUserAddDto[]; }; export type ApiKeyResponseDto = { - createdAt: string; - id: string; - name: string; - permissions: Permission[]; - updatedAt: string; + createdAt: string; + id: string; + name: string; + permissions: Permission[]; + updatedAt: string; }; export type ApiKeyCreateDto = { - name?: string; - permissions: Permission[]; + name?: string; + permissions: Permission[]; }; export type ApiKeyCreateResponseDto = { - apiKey: ApiKeyResponseDto; - secret: string; + apiKey: ApiKeyResponseDto; + secret: string; }; export type ApiKeyUpdateDto = { - name?: string; - permissions?: Permission[]; + name?: string; + permissions?: Permission[]; }; export type AssetBulkDeleteDto = { - force?: boolean; - ids: string[]; + force?: boolean; + ids: string[]; }; export type AssetMetadataUpsertItemDto = { - key: AssetMetadataKey; - value: object; + key: AssetMetadataKey; + value: object; }; export type AssetMediaCreateDto = { - assetData: Blob; - deviceAssetId: string; - deviceId: string; - duration?: string; - fileCreatedAt: string; - fileModifiedAt: string; - filename?: string; - isFavorite?: boolean; - livePhotoVideoId?: string; - metadata: AssetMetadataUpsertItemDto[]; - sidecarData?: Blob; - visibility?: AssetVisibility; + assetData: Blob; + deviceAssetId: string; + deviceId: string; + duration?: string; + fileCreatedAt: string; + fileModifiedAt: string; + filename?: string; + isFavorite?: boolean; + livePhotoVideoId?: string; + metadata: AssetMetadataUpsertItemDto[]; + sidecarData?: Blob; + visibility?: AssetVisibility; }; export type AssetMediaResponseDto = { - id: string; - status: AssetMediaStatus; + id: string; + status: AssetMediaStatus; }; export type AssetBulkUpdateDto = { - dateTimeOriginal?: string; - dateTimeRelative?: number; - description?: string; - duplicateId?: string | null; - ids: string[]; - isFavorite?: boolean; - latitude?: number; - longitude?: number; - rating?: number; - timeZone?: string; - visibility?: AssetVisibility; + dateTimeOriginal?: string; + dateTimeRelative?: number; + description?: string; + duplicateId?: string | null; + ids: string[]; + isFavorite?: boolean; + latitude?: number; + longitude?: number; + rating?: number; + timeZone?: string; + visibility?: AssetVisibility; }; export type AssetBulkUploadCheckItem = { - /** base64 or hex encoded sha1 hash */ - checksum: string; - id: string; + /** base64 or hex encoded sha1 hash */ + checksum: string; + id: string; }; export type AssetBulkUploadCheckDto = { - assets: AssetBulkUploadCheckItem[]; + assets: AssetBulkUploadCheckItem[]; }; export type AssetBulkUploadCheckResult = { - action: Action; - assetId?: string; - id: string; - isTrashed?: boolean; - reason?: Reason; + action: Action; + assetId?: string; + id: string; + isTrashed?: boolean; + reason?: Reason; }; export type AssetBulkUploadCheckResponseDto = { - results: AssetBulkUploadCheckResult[]; + results: AssetBulkUploadCheckResult[]; }; export type CheckExistingAssetsDto = { - deviceAssetIds: string[]; - deviceId: string; + deviceAssetIds: string[]; + deviceId: string; }; export type CheckExistingAssetsResponseDto = { - existingIds: string[]; + existingIds: string[]; }; export type AssetJobsDto = { - assetIds: string[]; - name: AssetJobName; + assetIds: string[]; + name: AssetJobName; }; export type UpdateAssetDto = { - dateTimeOriginal?: string; - description?: string; - isFavorite?: boolean; - latitude?: number; - livePhotoVideoId?: string | null; - longitude?: number; - rating?: number; - visibility?: AssetVisibility; + dateTimeOriginal?: string; + description?: string; + isFavorite?: boolean; + latitude?: number; + livePhotoVideoId?: string | null; + longitude?: number; + rating?: number; + visibility?: AssetVisibility; }; export type AssetMetadataResponseDto = { - key: AssetMetadataKey; - updatedAt: string; - value: object; + key: AssetMetadataKey; + updatedAt: string; + value: object; }; export type AssetMetadataUpsertDto = { - items: AssetMetadataUpsertItemDto[]; + items: AssetMetadataUpsertItemDto[]; }; export type AssetMediaReplaceDto = { - assetData: Blob; - deviceAssetId: string; - deviceId: string; - duration?: string; - fileCreatedAt: string; - fileModifiedAt: string; - filename?: string; + assetData: Blob; + deviceAssetId: string; + deviceId: string; + duration?: string; + fileCreatedAt: string; + fileModifiedAt: string; + filename?: string; }; export type SignUpDto = { - email: string; - name: string; - password: string; + email: string; + name: string; + password: string; }; export type ChangePasswordDto = { - newPassword: string; - password: string; + newPassword: string; + password: string; }; export type LoginCredentialDto = { - email: string; - password: string; + email: string; + password: string; }; export type LoginResponseDto = { - accessToken: string; - isAdmin: boolean; - isOnboarded: boolean; - name: string; - profileImagePath: string; - shouldChangePassword: boolean; - userEmail: string; - userId: string; + accessToken: string; + isAdmin: boolean; + isOnboarded: boolean; + name: string; + profileImagePath: string; + shouldChangePassword: boolean; + userEmail: string; + userId: string; }; export type LogoutResponseDto = { - redirectUri: string; - successful: boolean; + redirectUri: string; + successful: boolean; }; export type PinCodeResetDto = { - password?: string; - pinCode?: string; + password?: string; + pinCode?: string; }; export type PinCodeSetupDto = { - pinCode: string; + pinCode: string; }; export type PinCodeChangeDto = { - newPinCode: string; - password?: string; - pinCode?: string; + newPinCode: string; + password?: string; + pinCode?: string; }; export type SessionUnlockDto = { - password?: string; - pinCode?: string; + password?: string; + pinCode?: string; }; export type AuthStatusResponseDto = { - expiresAt?: string; - isElevated: boolean; - password: boolean; - pinCode: boolean; - pinExpiresAt?: string; + expiresAt?: string; + isElevated: boolean; + password: boolean; + pinCode: boolean; + pinExpiresAt?: string; }; export type ValidateAccessTokenResponseDto = { - authStatus: boolean; + authStatus: boolean; }; export type AssetIdsDto = { - assetIds: string[]; + assetIds: string[]; }; export type DownloadInfoDto = { - albumId?: string; - archiveSize?: number; - assetIds?: string[]; - userId?: string; + albumId?: string; + archiveSize?: number; + assetIds?: string[]; + userId?: string; }; export type DownloadArchiveInfo = { - assetIds: string[]; - size: number; + assetIds: string[]; + size: number; }; export type DownloadResponseDto = { - archives: DownloadArchiveInfo[]; - totalSize: number; + archives: DownloadArchiveInfo[]; + totalSize: number; }; export type DuplicateResponseDto = { - assets: AssetResponseDto[]; - duplicateId: string; + assets: AssetResponseDto[]; + duplicateId: string; }; export type PersonResponseDto = { - birthDate: string | null; - /** This property was added in v1.126.0 */ - color?: string; - id: string; - /** This property was added in v1.126.0 */ - isFavorite?: boolean; - isHidden: boolean; - name: string; - thumbnailPath: string; - /** This property was added in v1.107.0 */ - updatedAt?: string; + birthDate: string | null; + /** This property was added in v1.126.0 */ + color?: string; + id: string; + /** This property was added in v1.126.0 */ + isFavorite?: boolean; + isHidden: boolean; + name: string; + thumbnailPath: string; + /** This property was added in v1.107.0 */ + updatedAt?: string; }; export type AssetFaceResponseDto = { - boundingBoxX1: number; - boundingBoxX2: number; - boundingBoxY1: number; - boundingBoxY2: number; - id: string; - imageHeight: number; - imageWidth: number; - person: (PersonResponseDto) | null; - sourceType?: SourceType; + boundingBoxX1: number; + boundingBoxX2: number; + boundingBoxY1: number; + boundingBoxY2: number; + id: string; + imageHeight: number; + imageWidth: number; + person: PersonResponseDto | null; + sourceType?: SourceType; }; export type AssetFaceCreateDto = { - assetId: string; - height: number; - imageHeight: number; - imageWidth: number; - personId: string; - width: number; - x: number; - y: number; + assetId: string; + height: number; + imageHeight: number; + imageWidth: number; + personId: string; + width: number; + x: number; + y: number; }; export type AssetFaceDeleteDto = { - force: boolean; + force: boolean; }; export type FaceDto = { - id: string; + id: string; }; export type JobCountsDto = { - active: number; - completed: number; - delayed: number; - failed: number; - paused: number; - waiting: number; + active: number; + completed: number; + delayed: number; + failed: number; + paused: number; + waiting: number; }; export type QueueStatusDto = { - isActive: boolean; - isPaused: boolean; + isActive: boolean; + isPaused: boolean; }; export type JobStatusDto = { - jobCounts: JobCountsDto; - queueStatus: QueueStatusDto; + jobCounts: JobCountsDto; + queueStatus: QueueStatusDto; }; export type AllJobStatusResponseDto = { - backgroundTask: JobStatusDto; - backupDatabase: JobStatusDto; - duplicateDetection: JobStatusDto; - faceDetection: JobStatusDto; - facialRecognition: JobStatusDto; - library: JobStatusDto; - metadataExtraction: JobStatusDto; - migration: JobStatusDto; - notifications: JobStatusDto; - search: JobStatusDto; - sidecar: JobStatusDto; - smartSearch: JobStatusDto; - storageTemplateMigration: JobStatusDto; - thumbnailGeneration: JobStatusDto; - videoConversion: JobStatusDto; + backgroundTask: JobStatusDto; + backupDatabase: JobStatusDto; + duplicateDetection: JobStatusDto; + faceDetection: JobStatusDto; + facialRecognition: JobStatusDto; + library: JobStatusDto; + metadataExtraction: JobStatusDto; + migration: JobStatusDto; + notifications: JobStatusDto; + search: JobStatusDto; + sidecar: JobStatusDto; + smartSearch: JobStatusDto; + storageTemplateMigration: JobStatusDto; + thumbnailGeneration: JobStatusDto; + videoConversion: JobStatusDto; }; export type JobCreateDto = { - name: ManualJobName; + name: ManualJobName; }; export type JobCommandDto = { - command: JobCommand; - force?: boolean; + command: JobCommand; + force?: boolean; }; export type LibraryResponseDto = { - assetCount: number; - createdAt: string; - exclusionPatterns: string[]; - id: string; - importPaths: string[]; - name: string; - ownerId: string; - refreshedAt: string | null; - updatedAt: string; + assetCount: number; + createdAt: string; + exclusionPatterns: string[]; + id: string; + importPaths: string[]; + name: string; + ownerId: string; + refreshedAt: string | null; + updatedAt: string; }; export type CreateLibraryDto = { - exclusionPatterns?: string[]; - importPaths?: string[]; - name?: string; - ownerId: string; + exclusionPatterns?: string[]; + importPaths?: string[]; + name?: string; + ownerId: string; }; export type UpdateLibraryDto = { - exclusionPatterns?: string[]; - importPaths?: string[]; - name?: string; + exclusionPatterns?: string[]; + importPaths?: string[]; + name?: string; }; export type LibraryStatsResponseDto = { - photos: number; - total: number; - usage: number; - videos: number; + photos: number; + total: number; + usage: number; + videos: number; }; export type ValidateLibraryDto = { - exclusionPatterns?: string[]; - importPaths?: string[]; + exclusionPatterns?: string[]; + importPaths?: string[]; }; export type ValidateLibraryImportPathResponseDto = { - importPath: string; - isValid: boolean; - message?: string; + importPath: string; + isValid: boolean; + message?: string; }; export type ValidateLibraryResponseDto = { - importPaths?: ValidateLibraryImportPathResponseDto[]; + importPaths?: ValidateLibraryImportPathResponseDto[]; }; export type MapMarkerResponseDto = { - city: string | null; - country: string | null; - id: string; - lat: number; - lon: number; - state: string | null; + city: string | null; + country: string | null; + id: string; + lat: number; + lon: number; + state: string | null; }; export type MapReverseGeocodeResponseDto = { - city: string | null; - country: string | null; - state: string | null; + city: string | null; + country: string | null; + state: string | null; }; export type OnThisDayDto = { - year: number; + year: number; }; export type MemoryResponseDto = { - assets: AssetResponseDto[]; - createdAt: string; - data: OnThisDayDto; - deletedAt?: string; - hideAt?: string; - id: string; - isSaved: boolean; - memoryAt: string; - ownerId: string; - seenAt?: string; - showAt?: string; - "type": MemoryType; - updatedAt: string; + assets: AssetResponseDto[]; + createdAt: string; + data: OnThisDayDto; + deletedAt?: string; + hideAt?: string; + id: string; + isSaved: boolean; + memoryAt: string; + ownerId: string; + seenAt?: string; + showAt?: string; + type: MemoryType; + updatedAt: string; }; export type MemoryCreateDto = { - assetIds?: string[]; - data: OnThisDayDto; - isSaved?: boolean; - memoryAt: string; - seenAt?: string; - "type": MemoryType; + assetIds?: string[]; + data: OnThisDayDto; + isSaved?: boolean; + memoryAt: string; + seenAt?: string; + type: MemoryType; }; export type MemoryStatisticsResponseDto = { - total: number; + total: number; }; export type MemoryUpdateDto = { - isSaved?: boolean; - memoryAt?: string; - seenAt?: string; + isSaved?: boolean; + memoryAt?: string; + seenAt?: string; }; export type NotificationDeleteAllDto = { - ids: string[]; + ids: string[]; }; export type NotificationUpdateAllDto = { - ids: string[]; - readAt?: string | null; + ids: string[]; + readAt?: string | null; }; export type NotificationUpdateDto = { - readAt?: string | null; + readAt?: string | null; }; export type OAuthConfigDto = { - codeChallenge?: string; - redirectUri: string; - state?: string; + codeChallenge?: string; + redirectUri: string; + state?: string; }; export type OAuthAuthorizeResponseDto = { - url: string; + url: string; }; export type OAuthCallbackDto = { - codeVerifier?: string; - state?: string; - url: string; + codeVerifier?: string; + state?: string; + url: string; }; export type PartnerResponseDto = { - avatarColor: UserAvatarColor; - email: string; - id: string; - inTimeline?: boolean; - name: string; - profileChangedAt: string; - profileImagePath: string; + avatarColor: UserAvatarColor; + email: string; + id: string; + inTimeline?: boolean; + name: string; + profileChangedAt: string; + profileImagePath: string; + startDate?: string; }; export type PartnerCreateDto = { - sharedWithId: string; + sharedWithId: string; + startDate?: string; }; export type PartnerUpdateDto = { - inTimeline: boolean; + inTimeline: boolean; + startDate?: string; }; export type PeopleResponseDto = { - /** This property was added in v1.110.0 */ - hasNextPage?: boolean; - hidden: number; - people: PersonResponseDto[]; - total: number; + /** This property was added in v1.110.0 */ + hasNextPage?: boolean; + hidden: number; + people: PersonResponseDto[]; + total: number; }; export type PersonCreateDto = { - /** Person date of birth. + /** Person date of birth. Note: the mobile app cannot currently set the birth date to null. */ - birthDate?: string | null; - color?: string | null; - isFavorite?: boolean; - /** Person visibility */ - isHidden?: boolean; - /** Person name. */ - name?: string; + birthDate?: string | null; + color?: string | null; + isFavorite?: boolean; + /** Person visibility */ + isHidden?: boolean; + /** Person name. */ + name?: string; }; export type PeopleUpdateItem = { - /** Person date of birth. + /** Person date of birth. Note: the mobile app cannot currently set the birth date to null. */ - birthDate?: string | null; - color?: string | null; - /** Asset is used to get the feature face thumbnail. */ - featureFaceAssetId?: string; - /** Person id. */ - id: string; - isFavorite?: boolean; - /** Person visibility */ - isHidden?: boolean; - /** Person name. */ - name?: string; + birthDate?: string | null; + color?: string | null; + /** Asset is used to get the feature face thumbnail. */ + featureFaceAssetId?: string; + /** Person id. */ + id: string; + isFavorite?: boolean; + /** Person visibility */ + isHidden?: boolean; + /** Person name. */ + name?: string; }; export type PeopleUpdateDto = { - people: PeopleUpdateItem[]; + people: PeopleUpdateItem[]; }; export type PersonUpdateDto = { - /** Person date of birth. + /** Person date of birth. Note: the mobile app cannot currently set the birth date to null. */ - birthDate?: string | null; - color?: string | null; - /** Asset is used to get the feature face thumbnail. */ - featureFaceAssetId?: string; - isFavorite?: boolean; - /** Person visibility */ - isHidden?: boolean; - /** Person name. */ - name?: string; + birthDate?: string | null; + color?: string | null; + /** Asset is used to get the feature face thumbnail. */ + featureFaceAssetId?: string; + isFavorite?: boolean; + /** Person visibility */ + isHidden?: boolean; + /** Person name. */ + name?: string; }; export type MergePersonDto = { - ids: string[]; + ids: string[]; }; export type AssetFaceUpdateItem = { - assetId: string; - personId: string; + assetId: string; + personId: string; }; export type AssetFaceUpdateDto = { - data: AssetFaceUpdateItem[]; + data: AssetFaceUpdateItem[]; }; export type PersonStatisticsResponseDto = { - assets: number; + assets: number; }; export type SearchExploreItem = { - data: AssetResponseDto; - value: string; + data: AssetResponseDto; + value: string; }; export type SearchExploreResponseDto = { - fieldName: string; - items: SearchExploreItem[]; + fieldName: string; + items: SearchExploreItem[]; }; export type MetadataSearchDto = { - albumIds?: string[]; - checksum?: string; - city?: string | null; - country?: string | null; - createdAfter?: string; - createdBefore?: string; - description?: string; - deviceAssetId?: string; - deviceId?: string; - encodedVideoPath?: string; - id?: string; - isEncoded?: boolean; - isFavorite?: boolean; - isMotion?: boolean; - isNotInAlbum?: boolean; - isOffline?: boolean; - lensModel?: string | null; - libraryId?: string | null; - make?: string; - model?: string | null; - order?: AssetOrder; - originalFileName?: string; - originalPath?: string; - page?: number; - personIds?: string[]; - previewPath?: string; - rating?: number; - size?: number; - state?: string | null; - tagIds?: string[] | null; - takenAfter?: string; - takenBefore?: string; - thumbnailPath?: string; - trashedAfter?: string; - trashedBefore?: string; - "type"?: AssetTypeEnum; - updatedAfter?: string; - updatedBefore?: string; - visibility?: AssetVisibility; - withDeleted?: boolean; - withExif?: boolean; - withPeople?: boolean; - withStacked?: boolean; + albumIds?: string[]; + checksum?: string; + city?: string | null; + country?: string | null; + createdAfter?: string; + createdBefore?: string; + description?: string; + deviceAssetId?: string; + deviceId?: string; + encodedVideoPath?: string; + id?: string; + isEncoded?: boolean; + isFavorite?: boolean; + isMotion?: boolean; + isNotInAlbum?: boolean; + isOffline?: boolean; + lensModel?: string | null; + libraryId?: string | null; + make?: string; + model?: string | null; + order?: AssetOrder; + originalFileName?: string; + originalPath?: string; + page?: number; + personIds?: string[]; + previewPath?: string; + rating?: number; + size?: number; + state?: string | null; + tagIds?: string[] | null; + takenAfter?: string; + takenBefore?: string; + thumbnailPath?: string; + trashedAfter?: string; + trashedBefore?: string; + type?: AssetTypeEnum; + updatedAfter?: string; + updatedBefore?: string; + visibility?: AssetVisibility; + withDeleted?: boolean; + withExif?: boolean; + withPeople?: boolean; + withStacked?: boolean; }; export type SearchFacetCountResponseDto = { - count: number; - value: string; + count: number; + value: string; }; export type SearchFacetResponseDto = { - counts: SearchFacetCountResponseDto[]; - fieldName: string; + counts: SearchFacetCountResponseDto[]; + fieldName: string; }; export type SearchAlbumResponseDto = { - count: number; - facets: SearchFacetResponseDto[]; - items: AlbumResponseDto[]; - total: number; + count: number; + facets: SearchFacetResponseDto[]; + items: AlbumResponseDto[]; + total: number; }; export type SearchAssetResponseDto = { - count: number; - facets: SearchFacetResponseDto[]; - items: AssetResponseDto[]; - nextPage: string | null; - total: number; + count: number; + facets: SearchFacetResponseDto[]; + items: AssetResponseDto[]; + nextPage: string | null; + total: number; }; export type SearchResponseDto = { - albums: SearchAlbumResponseDto; - assets: SearchAssetResponseDto; + albums: SearchAlbumResponseDto; + assets: SearchAssetResponseDto; }; export type PlacesResponseDto = { - admin1name?: string; - admin2name?: string; - latitude: number; - longitude: number; - name: string; + admin1name?: string; + admin2name?: string; + latitude: number; + longitude: number; + name: string; }; export type RandomSearchDto = { - albumIds?: string[]; - city?: string | null; - country?: string | null; - createdAfter?: string; - createdBefore?: string; - deviceId?: string; - isEncoded?: boolean; - isFavorite?: boolean; - isMotion?: boolean; - isNotInAlbum?: boolean; - isOffline?: boolean; - lensModel?: string | null; - libraryId?: string | null; - make?: string; - model?: string | null; - personIds?: string[]; - rating?: number; - size?: number; - state?: string | null; - tagIds?: string[] | null; - takenAfter?: string; - takenBefore?: string; - trashedAfter?: string; - trashedBefore?: string; - "type"?: AssetTypeEnum; - updatedAfter?: string; - updatedBefore?: string; - visibility?: AssetVisibility; - withDeleted?: boolean; - withExif?: boolean; - withPeople?: boolean; - withStacked?: boolean; + albumIds?: string[]; + city?: string | null; + country?: string | null; + createdAfter?: string; + createdBefore?: string; + deviceId?: string; + isEncoded?: boolean; + isFavorite?: boolean; + isMotion?: boolean; + isNotInAlbum?: boolean; + isOffline?: boolean; + lensModel?: string | null; + libraryId?: string | null; + make?: string; + model?: string | null; + personIds?: string[]; + rating?: number; + size?: number; + state?: string | null; + tagIds?: string[] | null; + takenAfter?: string; + takenBefore?: string; + trashedAfter?: string; + trashedBefore?: string; + type?: AssetTypeEnum; + updatedAfter?: string; + updatedBefore?: string; + visibility?: AssetVisibility; + withDeleted?: boolean; + withExif?: boolean; + withPeople?: boolean; + withStacked?: boolean; }; export type SmartSearchDto = { - albumIds?: string[]; - city?: string | null; - country?: string | null; - createdAfter?: string; - createdBefore?: string; - deviceId?: string; - isEncoded?: boolean; - isFavorite?: boolean; - isMotion?: boolean; - isNotInAlbum?: boolean; - isOffline?: boolean; - language?: string; - lensModel?: string | null; - libraryId?: string | null; - make?: string; - model?: string | null; - page?: number; - personIds?: string[]; - query?: string; - queryAssetId?: string; - rating?: number; - size?: number; - state?: string | null; - tagIds?: string[] | null; - takenAfter?: string; - takenBefore?: string; - trashedAfter?: string; - trashedBefore?: string; - "type"?: AssetTypeEnum; - updatedAfter?: string; - updatedBefore?: string; - visibility?: AssetVisibility; - withDeleted?: boolean; - withExif?: boolean; + albumIds?: string[]; + city?: string | null; + country?: string | null; + createdAfter?: string; + createdBefore?: string; + deviceId?: string; + isEncoded?: boolean; + isFavorite?: boolean; + isMotion?: boolean; + isNotInAlbum?: boolean; + isOffline?: boolean; + language?: string; + lensModel?: string | null; + libraryId?: string | null; + make?: string; + model?: string | null; + page?: number; + personIds?: string[]; + query?: string; + queryAssetId?: string; + rating?: number; + size?: number; + state?: string | null; + tagIds?: string[] | null; + takenAfter?: string; + takenBefore?: string; + trashedAfter?: string; + trashedBefore?: string; + type?: AssetTypeEnum; + updatedAfter?: string; + updatedBefore?: string; + visibility?: AssetVisibility; + withDeleted?: boolean; + withExif?: boolean; }; export type StatisticsSearchDto = { - albumIds?: string[]; - city?: string | null; - country?: string | null; - createdAfter?: string; - createdBefore?: string; - description?: string; - deviceId?: string; - isEncoded?: boolean; - isFavorite?: boolean; - isMotion?: boolean; - isNotInAlbum?: boolean; - isOffline?: boolean; - lensModel?: string | null; - libraryId?: string | null; - make?: string; - model?: string | null; - personIds?: string[]; - rating?: number; - state?: string | null; - tagIds?: string[] | null; - takenAfter?: string; - takenBefore?: string; - trashedAfter?: string; - trashedBefore?: string; - "type"?: AssetTypeEnum; - updatedAfter?: string; - updatedBefore?: string; - visibility?: AssetVisibility; + albumIds?: string[]; + city?: string | null; + country?: string | null; + createdAfter?: string; + createdBefore?: string; + description?: string; + deviceId?: string; + isEncoded?: boolean; + isFavorite?: boolean; + isMotion?: boolean; + isNotInAlbum?: boolean; + isOffline?: boolean; + lensModel?: string | null; + libraryId?: string | null; + make?: string; + model?: string | null; + personIds?: string[]; + rating?: number; + state?: string | null; + tagIds?: string[] | null; + takenAfter?: string; + takenBefore?: string; + trashedAfter?: string; + trashedBefore?: string; + type?: AssetTypeEnum; + updatedAfter?: string; + updatedBefore?: string; + visibility?: AssetVisibility; }; export type SearchStatisticsResponseDto = { - total: number; + total: number; }; export type ServerAboutResponseDto = { - build?: string; - buildImage?: string; - buildImageUrl?: string; - buildUrl?: string; - exiftool?: string; - ffmpeg?: string; - imagemagick?: string; - libvips?: string; - licensed: boolean; - nodejs?: string; - repository?: string; - repositoryUrl?: string; - sourceCommit?: string; - sourceRef?: string; - sourceUrl?: string; - thirdPartyBugFeatureUrl?: string; - thirdPartyDocumentationUrl?: string; - thirdPartySourceUrl?: string; - thirdPartySupportUrl?: string; - version: string; - versionUrl: string; + build?: string; + buildImage?: string; + buildImageUrl?: string; + buildUrl?: string; + exiftool?: string; + ffmpeg?: string; + imagemagick?: string; + libvips?: string; + licensed: boolean; + nodejs?: string; + repository?: string; + repositoryUrl?: string; + sourceCommit?: string; + sourceRef?: string; + sourceUrl?: string; + thirdPartyBugFeatureUrl?: string; + thirdPartyDocumentationUrl?: string; + thirdPartySourceUrl?: string; + thirdPartySupportUrl?: string; + version: string; + versionUrl: string; }; export type ServerApkLinksDto = { - arm64v8a: string; - armeabiv7a: string; - universal: string; - x86_64: string; + arm64v8a: string; + armeabiv7a: string; + universal: string; + x86_64: string; }; export type ServerConfigDto = { - externalDomain: string; - isInitialized: boolean; - isOnboarded: boolean; - loginPageMessage: string; - mapDarkStyleUrl: string; - mapLightStyleUrl: string; - oauthButtonText: string; - publicUsers: boolean; - trashDays: number; - userDeleteDelay: number; + externalDomain: string; + isInitialized: boolean; + isOnboarded: boolean; + loginPageMessage: string; + mapDarkStyleUrl: string; + mapLightStyleUrl: string; + oauthButtonText: string; + publicUsers: boolean; + trashDays: number; + userDeleteDelay: number; }; export type ServerFeaturesDto = { - configFile: boolean; - duplicateDetection: boolean; - email: boolean; - facialRecognition: boolean; - importFaces: boolean; - map: boolean; - oauth: boolean; - oauthAutoLaunch: boolean; - passwordLogin: boolean; - reverseGeocoding: boolean; - search: boolean; - sidecar: boolean; - smartSearch: boolean; - trash: boolean; + configFile: boolean; + duplicateDetection: boolean; + email: boolean; + facialRecognition: boolean; + importFaces: boolean; + map: boolean; + oauth: boolean; + oauthAutoLaunch: boolean; + passwordLogin: boolean; + reverseGeocoding: boolean; + search: boolean; + sidecar: boolean; + smartSearch: boolean; + trash: boolean; }; export type LicenseResponseDto = { - activatedAt: string; - activationKey: string; - licenseKey: string; + activatedAt: string; + activationKey: string; + licenseKey: string; }; export type LicenseKeyDto = { - activationKey: string; - licenseKey: string; + activationKey: string; + licenseKey: string; }; export type ServerMediaTypesResponseDto = { - image: string[]; - sidecar: string[]; - video: string[]; + image: string[]; + sidecar: string[]; + video: string[]; }; export type ServerPingResponse = {}; export type ServerPingResponseRead = { - res: string; + res: string; }; export type UsageByUserDto = { - photos: number; - quotaSizeInBytes: number | null; - usage: number; - usagePhotos: number; - usageVideos: number; - userId: string; - userName: string; - videos: number; + photos: number; + quotaSizeInBytes: number | null; + usage: number; + usagePhotos: number; + usageVideos: number; + userId: string; + userName: string; + videos: number; }; export type ServerStatsResponseDto = { - photos: number; - usage: number; - usageByUser: UsageByUserDto[]; - usagePhotos: number; - usageVideos: number; - videos: number; + photos: number; + usage: number; + usageByUser: UsageByUserDto[]; + usagePhotos: number; + usageVideos: number; + videos: number; }; export type ServerStorageResponseDto = { - diskAvailable: string; - diskAvailableRaw: number; - diskSize: string; - diskSizeRaw: number; - diskUsagePercentage: number; - diskUse: string; - diskUseRaw: number; + diskAvailable: string; + diskAvailableRaw: number; + diskSize: string; + diskSizeRaw: number; + diskUsagePercentage: number; + diskUse: string; + diskUseRaw: number; }; export type ServerThemeDto = { - customCss: string; + customCss: string; }; export type ServerVersionResponseDto = { - major: number; - minor: number; - patch: number; + major: number; + minor: number; + patch: number; }; export type VersionCheckStateResponseDto = { - checkedAt: string | null; - releaseVersion: string | null; + checkedAt: string | null; + releaseVersion: string | null; }; export type ServerVersionHistoryResponseDto = { - createdAt: string; - id: string; - version: string; + createdAt: string; + id: string; + version: string; }; export type SessionResponseDto = { - createdAt: string; - current: boolean; - deviceOS: string; - deviceType: string; - expiresAt?: string; - id: string; - isPendingSyncReset: boolean; - updatedAt: string; + createdAt: string; + current: boolean; + deviceOS: string; + deviceType: string; + expiresAt?: string; + id: string; + isPendingSyncReset: boolean; + updatedAt: string; }; export type SessionCreateDto = { - deviceOS?: string; - deviceType?: string; - /** session duration, in seconds */ - duration?: number; + deviceOS?: string; + deviceType?: string; + /** session duration, in seconds */ + duration?: number; }; export type SessionCreateResponseDto = { - createdAt: string; - current: boolean; - deviceOS: string; - deviceType: string; - expiresAt?: string; - id: string; - isPendingSyncReset: boolean; - token: string; - updatedAt: string; + createdAt: string; + current: boolean; + deviceOS: string; + deviceType: string; + expiresAt?: string; + id: string; + isPendingSyncReset: boolean; + token: string; + updatedAt: string; }; export type SessionUpdateDto = { - isPendingSyncReset?: boolean; + isPendingSyncReset?: boolean; }; export type SharedLinkResponseDto = { - album?: AlbumResponseDto; - allowDownload: boolean; - allowUpload: boolean; - assets: AssetResponseDto[]; - createdAt: string; - description: string | null; - expiresAt: string | null; - id: string; - key: string; - password: string | null; - showMetadata: boolean; - slug: string | null; - token?: string | null; - "type": SharedLinkType; - userId: string; + album?: AlbumResponseDto; + allowDownload: boolean; + allowUpload: boolean; + assets: AssetResponseDto[]; + createdAt: string; + description: string | null; + expiresAt: string | null; + id: string; + key: string; + password: string | null; + showMetadata: boolean; + slug: string | null; + token?: string | null; + type: SharedLinkType; + userId: string; }; export type SharedLinkCreateDto = { - albumId?: string; - allowDownload?: boolean; - allowUpload?: boolean; - assetIds?: string[]; - description?: string | null; - expiresAt?: string | null; - password?: string | null; - showMetadata?: boolean; - slug?: string | null; - "type": SharedLinkType; + albumId?: string; + allowDownload?: boolean; + allowUpload?: boolean; + assetIds?: string[]; + description?: string | null; + expiresAt?: string | null; + password?: string | null; + showMetadata?: boolean; + slug?: string | null; + type: SharedLinkType; }; export type SharedLinkEditDto = { - allowDownload?: boolean; - allowUpload?: boolean; - /** Few clients cannot send null to set the expiryTime to never. + allowDownload?: boolean; + allowUpload?: boolean; + /** Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this. */ - changeExpiryTime?: boolean; - description?: string | null; - expiresAt?: string | null; - password?: string | null; - showMetadata?: boolean; - slug?: string | null; + changeExpiryTime?: boolean; + description?: string | null; + expiresAt?: string | null; + password?: string | null; + showMetadata?: boolean; + slug?: string | null; }; export type AssetIdsResponseDto = { - assetId: string; - error?: Error2; - success: boolean; + assetId: string; + error?: Error2; + success: boolean; }; export type StackResponseDto = { - assets: AssetResponseDto[]; - id: string; - primaryAssetId: string; + assets: AssetResponseDto[]; + id: string; + primaryAssetId: string; }; export type StackCreateDto = { - /** first asset becomes the primary */ - assetIds: string[]; + /** first asset becomes the primary */ + assetIds: string[]; }; export type StackUpdateDto = { - primaryAssetId?: string; + primaryAssetId?: string; }; export type SyncAckDeleteDto = { - types?: SyncEntityType[]; + types?: SyncEntityType[]; }; export type SyncAckDto = { - ack: string; - "type": SyncEntityType; + ack: string; + type: SyncEntityType; }; export type SyncAckSetDto = { - acks: string[]; + acks: string[]; }; export type AssetDeltaSyncDto = { - updatedAfter: string; - userIds: string[]; + updatedAfter: string; + userIds: string[]; }; export type AssetDeltaSyncResponseDto = { - deleted: string[]; - needsFullSync: boolean; - upserted: AssetResponseDto[]; + deleted: string[]; + needsFullSync: boolean; + upserted: AssetResponseDto[]; }; export type AssetFullSyncDto = { - lastId?: string; - limit: number; - updatedUntil: string; - userId?: string; + lastId?: string; + limit: number; + updatedUntil: string; + userId?: string; }; export type SyncStreamDto = { - reset?: boolean; - types: SyncRequestType[]; + reset?: boolean; + types: SyncRequestType[]; }; export type DatabaseBackupConfig = { - cronExpression: string; - enabled: boolean; - keepLastAmount: number; + cronExpression: string; + enabled: boolean; + keepLastAmount: number; }; export type SystemConfigBackupsDto = { - database: DatabaseBackupConfig; + database: DatabaseBackupConfig; }; export type SystemConfigFFmpegDto = { - accel: TranscodeHWAccel; - accelDecode: boolean; - acceptedAudioCodecs: AudioCodec[]; - acceptedContainers: VideoContainer[]; - acceptedVideoCodecs: VideoCodec[]; - bframes: number; - cqMode: CQMode; - crf: number; - gopSize: number; - maxBitrate: string; - preferredHwDevice: string; - preset: string; - refs: number; - targetAudioCodec: AudioCodec; - targetResolution: string; - targetVideoCodec: VideoCodec; - temporalAQ: boolean; - threads: number; - tonemap: ToneMapping; - transcode: TranscodePolicy; - twoPass: boolean; + accel: TranscodeHWAccel; + accelDecode: boolean; + acceptedAudioCodecs: AudioCodec[]; + acceptedContainers: VideoContainer[]; + acceptedVideoCodecs: VideoCodec[]; + bframes: number; + cqMode: CQMode; + crf: number; + gopSize: number; + maxBitrate: string; + preferredHwDevice: string; + preset: string; + refs: number; + targetAudioCodec: AudioCodec; + targetResolution: string; + targetVideoCodec: VideoCodec; + temporalAQ: boolean; + threads: number; + tonemap: ToneMapping; + transcode: TranscodePolicy; + twoPass: boolean; }; export type SystemConfigGeneratedFullsizeImageDto = { - enabled: boolean; - format: ImageFormat; - quality: number; + enabled: boolean; + format: ImageFormat; + quality: number; }; export type SystemConfigGeneratedImageDto = { - format: ImageFormat; - quality: number; - size: number; + format: ImageFormat; + quality: number; + size: number; }; export type SystemConfigImageDto = { - colorspace: Colorspace; - extractEmbedded: boolean; - fullsize: SystemConfigGeneratedFullsizeImageDto; - preview: SystemConfigGeneratedImageDto; - thumbnail: SystemConfigGeneratedImageDto; + colorspace: Colorspace; + extractEmbedded: boolean; + fullsize: SystemConfigGeneratedFullsizeImageDto; + preview: SystemConfigGeneratedImageDto; + thumbnail: SystemConfigGeneratedImageDto; }; export type JobSettingsDto = { - concurrency: number; + concurrency: number; }; export type SystemConfigJobDto = { - backgroundTask: JobSettingsDto; - faceDetection: JobSettingsDto; - library: JobSettingsDto; - metadataExtraction: JobSettingsDto; - migration: JobSettingsDto; - notifications: JobSettingsDto; - search: JobSettingsDto; - sidecar: JobSettingsDto; - smartSearch: JobSettingsDto; - thumbnailGeneration: JobSettingsDto; - videoConversion: JobSettingsDto; + backgroundTask: JobSettingsDto; + faceDetection: JobSettingsDto; + library: JobSettingsDto; + metadataExtraction: JobSettingsDto; + migration: JobSettingsDto; + notifications: JobSettingsDto; + search: JobSettingsDto; + sidecar: JobSettingsDto; + smartSearch: JobSettingsDto; + thumbnailGeneration: JobSettingsDto; + videoConversion: JobSettingsDto; }; export type SystemConfigLibraryScanDto = { - cronExpression: string; - enabled: boolean; + cronExpression: string; + enabled: boolean; }; export type SystemConfigLibraryWatchDto = { - enabled: boolean; + enabled: boolean; }; export type SystemConfigLibraryDto = { - scan: SystemConfigLibraryScanDto; - watch: SystemConfigLibraryWatchDto; + scan: SystemConfigLibraryScanDto; + watch: SystemConfigLibraryWatchDto; }; export type SystemConfigLoggingDto = { - enabled: boolean; - level: LogLevel; + enabled: boolean; + level: LogLevel; }; export type MachineLearningAvailabilityChecksDto = { - enabled: boolean; - interval: number; - timeout: number; + enabled: boolean; + interval: number; + timeout: number; }; export type ClipConfig = { - enabled: boolean; - modelName: string; + enabled: boolean; + modelName: string; }; export type DuplicateDetectionConfig = { - enabled: boolean; - maxDistance: number; + enabled: boolean; + maxDistance: number; }; export type FacialRecognitionConfig = { - enabled: boolean; - maxDistance: number; - minFaces: number; - minScore: number; - modelName: string; + enabled: boolean; + maxDistance: number; + minFaces: number; + minScore: number; + modelName: string; }; export type SystemConfigMachineLearningDto = { - availabilityChecks: MachineLearningAvailabilityChecksDto; - clip: ClipConfig; - duplicateDetection: DuplicateDetectionConfig; - enabled: boolean; - facialRecognition: FacialRecognitionConfig; - urls: string[]; + availabilityChecks: MachineLearningAvailabilityChecksDto; + clip: ClipConfig; + duplicateDetection: DuplicateDetectionConfig; + enabled: boolean; + facialRecognition: FacialRecognitionConfig; + urls: string[]; }; export type SystemConfigMapDto = { - darkStyle: string; - enabled: boolean; - lightStyle: string; + darkStyle: string; + enabled: boolean; + lightStyle: string; }; export type SystemConfigFacesDto = { - "import": boolean; + import: boolean; }; export type SystemConfigMetadataDto = { - faces: SystemConfigFacesDto; + faces: SystemConfigFacesDto; }; export type SystemConfigNewVersionCheckDto = { - enabled: boolean; + enabled: boolean; }; export type SystemConfigNightlyTasksDto = { - clusterNewFaces: boolean; - databaseCleanup: boolean; - generateMemories: boolean; - missingThumbnails: boolean; - startTime: string; - syncQuotaUsage: boolean; + clusterNewFaces: boolean; + databaseCleanup: boolean; + generateMemories: boolean; + missingThumbnails: boolean; + startTime: string; + syncQuotaUsage: boolean; }; export type SystemConfigNotificationsDto = { - smtp: SystemConfigSmtpDto; + smtp: SystemConfigSmtpDto; }; export type SystemConfigOAuthDto = { - autoLaunch: boolean; - autoRegister: boolean; - buttonText: string; - clientId: string; - clientSecret: string; - defaultStorageQuota: number | null; - enabled: boolean; - issuerUrl: string; - mobileOverrideEnabled: boolean; - mobileRedirectUri: string; - profileSigningAlgorithm: string; - roleClaim: string; - scope: string; - signingAlgorithm: string; - storageLabelClaim: string; - storageQuotaClaim: string; - timeout: number; - tokenEndpointAuthMethod: OAuthTokenEndpointAuthMethod; + autoLaunch: boolean; + autoRegister: boolean; + buttonText: string; + clientId: string; + clientSecret: string; + defaultStorageQuota: number | null; + enabled: boolean; + issuerUrl: string; + mobileOverrideEnabled: boolean; + mobileRedirectUri: string; + profileSigningAlgorithm: string; + roleClaim: string; + scope: string; + signingAlgorithm: string; + storageLabelClaim: string; + storageQuotaClaim: string; + timeout: number; + tokenEndpointAuthMethod: OAuthTokenEndpointAuthMethod; }; export type SystemConfigPasswordLoginDto = { - enabled: boolean; + enabled: boolean; }; export type SystemConfigReverseGeocodingDto = { - enabled: boolean; + enabled: boolean; }; export type SystemConfigServerDto = { - externalDomain: string; - loginPageMessage: string; - publicUsers: boolean; + externalDomain: string; + loginPageMessage: string; + publicUsers: boolean; }; export type SystemConfigStorageTemplateDto = { - enabled: boolean; - hashVerificationEnabled: boolean; - template: string; + enabled: boolean; + hashVerificationEnabled: boolean; + template: string; }; export type SystemConfigTemplateEmailsDto = { - albumInviteTemplate: string; - albumUpdateTemplate: string; - welcomeTemplate: string; + albumInviteTemplate: string; + albumUpdateTemplate: string; + welcomeTemplate: string; }; export type SystemConfigTemplatesDto = { - email: SystemConfigTemplateEmailsDto; + email: SystemConfigTemplateEmailsDto; }; export type SystemConfigThemeDto = { - customCss: string; + customCss: string; }; export type SystemConfigTrashDto = { - days: number; - enabled: boolean; + days: number; + enabled: boolean; }; export type SystemConfigUserDto = { - deleteDelay: number; + deleteDelay: number; }; export type SystemConfigDto = { - backup: SystemConfigBackupsDto; - ffmpeg: SystemConfigFFmpegDto; - image: SystemConfigImageDto; - job: SystemConfigJobDto; - library: SystemConfigLibraryDto; - logging: SystemConfigLoggingDto; - machineLearning: SystemConfigMachineLearningDto; - map: SystemConfigMapDto; - metadata: SystemConfigMetadataDto; - newVersionCheck: SystemConfigNewVersionCheckDto; - nightlyTasks: SystemConfigNightlyTasksDto; - notifications: SystemConfigNotificationsDto; - oauth: SystemConfigOAuthDto; - passwordLogin: SystemConfigPasswordLoginDto; - reverseGeocoding: SystemConfigReverseGeocodingDto; - server: SystemConfigServerDto; - storageTemplate: SystemConfigStorageTemplateDto; - templates: SystemConfigTemplatesDto; - theme: SystemConfigThemeDto; - trash: SystemConfigTrashDto; - user: SystemConfigUserDto; + backup: SystemConfigBackupsDto; + ffmpeg: SystemConfigFFmpegDto; + image: SystemConfigImageDto; + job: SystemConfigJobDto; + library: SystemConfigLibraryDto; + logging: SystemConfigLoggingDto; + machineLearning: SystemConfigMachineLearningDto; + map: SystemConfigMapDto; + metadata: SystemConfigMetadataDto; + newVersionCheck: SystemConfigNewVersionCheckDto; + nightlyTasks: SystemConfigNightlyTasksDto; + notifications: SystemConfigNotificationsDto; + oauth: SystemConfigOAuthDto; + passwordLogin: SystemConfigPasswordLoginDto; + reverseGeocoding: SystemConfigReverseGeocodingDto; + server: SystemConfigServerDto; + storageTemplate: SystemConfigStorageTemplateDto; + templates: SystemConfigTemplatesDto; + theme: SystemConfigThemeDto; + trash: SystemConfigTrashDto; + user: SystemConfigUserDto; }; export type SystemConfigTemplateStorageOptionDto = { - dayOptions: string[]; - hourOptions: string[]; - minuteOptions: string[]; - monthOptions: string[]; - presetOptions: string[]; - secondOptions: string[]; - weekOptions: string[]; - yearOptions: string[]; + dayOptions: string[]; + hourOptions: string[]; + minuteOptions: string[]; + monthOptions: string[]; + presetOptions: string[]; + secondOptions: string[]; + weekOptions: string[]; + yearOptions: string[]; }; export type AdminOnboardingUpdateDto = { - isOnboarded: boolean; + isOnboarded: boolean; }; export type ReverseGeocodingStateResponseDto = { - lastImportFileName: string | null; - lastUpdate: string | null; + lastImportFileName: string | null; + lastUpdate: string | null; }; export type TagCreateDto = { - color?: string; - name: string; - parentId?: string | null; + color?: string; + name: string; + parentId?: string | null; }; export type TagUpsertDto = { - tags: string[]; + tags: string[]; }; export type TagBulkAssetsDto = { - assetIds: string[]; - tagIds: string[]; + assetIds: string[]; + tagIds: string[]; }; export type TagBulkAssetsResponseDto = { - count: number; + count: number; }; export type TagUpdateDto = { - color?: string | null; + color?: string | null; }; export type TimeBucketAssetResponseDto = { - /** Array of city names extracted from EXIF GPS data */ - city: (string | null)[]; - /** Array of country names extracted from EXIF GPS data */ - country: (string | null)[]; - /** Array of video durations in HH:MM:SS format (null for images) */ - duration: (string | null)[]; - /** Array of file creation timestamps in UTC (ISO 8601 format, without timezone) */ - fileCreatedAt: string[]; - /** Array of asset IDs in the time bucket */ - id: string[]; - /** Array indicating whether each asset is favorited */ - isFavorite: boolean[]; - /** Array indicating whether each asset is an image (false for videos) */ - isImage: boolean[]; - /** Array indicating whether each asset is in the trash */ - isTrashed: boolean[]; - /** Array of latitude coordinates extracted from EXIF GPS data */ - latitude?: (number | null)[]; - /** Array of live photo video asset IDs (null for non-live photos) */ - livePhotoVideoId: (string | null)[]; - /** Array of UTC offset hours at the time each photo was taken. Positive values are east of UTC, negative values are west of UTC. Values may be fractional (e.g., 5.5 for +05:30, -9.75 for -09:45). Applying this offset to 'fileCreatedAt' will give you the time the photo was taken from the photographer's perspective. */ - localOffsetHours: number[]; - /** Array of longitude coordinates extracted from EXIF GPS data */ - longitude?: (number | null)[]; - /** Array of owner IDs for each asset */ - ownerId: string[]; - /** Array of projection types for 360° content (e.g., "EQUIRECTANGULAR", "CUBEFACE", "CYLINDRICAL") */ - projectionType: (string | null)[]; - /** Array of aspect ratios (width/height) for each asset */ - ratio: number[]; - /** Array of stack information as [stackId, assetCount] tuples (null for non-stacked assets) */ - stack?: (string[] | null)[]; - /** Array of BlurHash strings for generating asset previews (base64 encoded) */ - thumbhash: (string | null)[]; - /** Array of visibility statuses for each asset (e.g., ARCHIVE, TIMELINE, HIDDEN, LOCKED) */ - visibility: AssetVisibility[]; + /** Array of city names extracted from EXIF GPS data */ + city: (string | null)[]; + /** Array of country names extracted from EXIF GPS data */ + country: (string | null)[]; + /** Array of video durations in HH:MM:SS format (null for images) */ + duration: (string | null)[]; + /** Array of file creation timestamps in UTC (ISO 8601 format, without timezone) */ + fileCreatedAt: string[]; + /** Array of asset IDs in the time bucket */ + id: string[]; + /** Array indicating whether each asset is favorited */ + isFavorite: boolean[]; + /** Array indicating whether each asset is an image (false for videos) */ + isImage: boolean[]; + /** Array indicating whether each asset is in the trash */ + isTrashed: boolean[]; + /** Array of latitude coordinates extracted from EXIF GPS data */ + latitude?: (number | null)[]; + /** Array of live photo video asset IDs (null for non-live photos) */ + livePhotoVideoId: (string | null)[]; + /** Array of UTC offset hours at the time each photo was taken. Positive values are east of UTC, negative values are west of UTC. Values may be fractional (e.g., 5.5 for +05:30, -9.75 for -09:45). Applying this offset to 'fileCreatedAt' will give you the time the photo was taken from the photographer's perspective. */ + localOffsetHours: number[]; + /** Array of longitude coordinates extracted from EXIF GPS data */ + longitude?: (number | null)[]; + /** Array of owner IDs for each asset */ + ownerId: string[]; + /** Array of projection types for 360° content (e.g., "EQUIRECTANGULAR", "CUBEFACE", "CYLINDRICAL") */ + projectionType: (string | null)[]; + /** Array of aspect ratios (width/height) for each asset */ + ratio: number[]; + /** Array of stack information as [stackId, assetCount] tuples (null for non-stacked assets) */ + stack?: (string[] | null)[]; + /** Array of BlurHash strings for generating asset previews (base64 encoded) */ + thumbhash: (string | null)[]; + /** Array of visibility statuses for each asset (e.g., ARCHIVE, TIMELINE, HIDDEN, LOCKED) */ + visibility: AssetVisibility[]; }; export type TimeBucketsResponseDto = { - /** Number of assets in this time bucket */ - count: number; - /** Time bucket identifier in YYYY-MM-DD format representing the start of the time period */ - timeBucket: string; + /** Number of assets in this time bucket */ + count: number; + /** Time bucket identifier in YYYY-MM-DD format representing the start of the time period */ + timeBucket: string; }; export type TrashResponseDto = { - count: number; + count: number; }; export type UserUpdateMeDto = { - avatarColor?: (UserAvatarColor) | null; - email?: string; - name?: string; - password?: string; + avatarColor?: UserAvatarColor | null; + email?: string; + name?: string; + password?: string; }; export type OnboardingResponseDto = { - isOnboarded: boolean; + isOnboarded: boolean; }; export type OnboardingDto = { - isOnboarded: boolean; + isOnboarded: boolean; }; export type CreateProfileImageDto = { - file: Blob; + file: Blob; }; export type CreateProfileImageResponseDto = { - profileChangedAt: string; - profileImagePath: string; - userId: string; + profileChangedAt: string; + profileImagePath: string; + userId: string; }; /** * This endpoint requires the `activity.read` permission. */ -export function getActivities({ albumId, assetId, level, $type, userId }: { +export function getActivities( + { + albumId, + assetId, + level, + $type, + userId, + }: { albumId: string; assetId?: string; level?: ReactionLevel; $type?: ReactionType; userId?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ActivityResponseDto[]; - }>(`/activities${QS.query(QS.explode({ - albumId, - assetId, - level, - "type": $type, - userId - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ActivityResponseDto[]; + }>( + `/activities${QS.query( + QS.explode({ + albumId, + assetId, + level, + type: $type, + userId, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `activity.create` permission. */ -export function createActivity({ activityCreateDto }: { +export function createActivity( + { + activityCreateDto, + }: { activityCreateDto: ActivityCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: ActivityResponseDto; - }>("/activities", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: ActivityResponseDto; + }>( + "/activities", + oazapfts.json({ ...opts, method: "POST", - body: activityCreateDto - }))); + body: activityCreateDto, + }), + ), + ); } /** * This endpoint requires the `activity.statistics` permission. */ -export function getActivityStatistics({ albumId, assetId }: { +export function getActivityStatistics( + { + albumId, + assetId, + }: { albumId: string; assetId?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ActivityStatisticsResponseDto; - }>(`/activities/statistics${QS.query(QS.explode({ - albumId, - assetId - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ActivityStatisticsResponseDto; + }>( + `/activities/statistics${QS.query( + QS.explode({ + albumId, + assetId, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `activity.delete` permission. */ -export function deleteActivity({ id }: { +export function deleteActivity( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/activities/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/activities/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint is an admin-only route, and requires the `adminAuth.unlinkAll` permission. */ export function unlinkAllOAuthAccountsAdmin(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/admin/auth/unlink-all", { - ...opts, - method: "POST" - })); + return oazapfts.ok( + oazapfts.fetchText("/admin/auth/unlink-all", { + ...opts, + method: "POST", + }), + ); } -export function createNotification({ notificationCreateDto }: { +export function createNotification( + { + notificationCreateDto, + }: { notificationCreateDto: NotificationCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: NotificationDto; - }>("/admin/notifications", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: NotificationDto; + }>( + "/admin/notifications", + oazapfts.json({ ...opts, method: "POST", - body: notificationCreateDto - }))); + body: notificationCreateDto, + }), + ), + ); } -export function getNotificationTemplateAdmin({ name, templateDto }: { +export function getNotificationTemplateAdmin( + { + name, + templateDto, + }: { name: string; templateDto: TemplateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TemplateResponseDto; - }>(`/admin/notifications/templates/${encodeURIComponent(name)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TemplateResponseDto; + }>( + `/admin/notifications/templates/${encodeURIComponent(name)}`, + oazapfts.json({ ...opts, method: "POST", - body: templateDto - }))); + body: templateDto, + }), + ), + ); } -export function sendTestEmailAdmin({ systemConfigSmtpDto }: { +export function sendTestEmailAdmin( + { + systemConfigSmtpDto, + }: { systemConfigSmtpDto: SystemConfigSmtpDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TestEmailResponseDto; - }>("/admin/notifications/test-email", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TestEmailResponseDto; + }>( + "/admin/notifications/test-email", + oazapfts.json({ ...opts, method: "POST", - body: systemConfigSmtpDto - }))); + body: systemConfigSmtpDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.read` permission. */ -export function searchUsersAdmin({ id, withDeleted }: { +export function searchUsersAdmin( + { + id, + withDeleted, + }: { id?: string; withDeleted?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto[]; - }>(`/admin/users${QS.query(QS.explode({ - id, - withDeleted - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto[]; + }>( + `/admin/users${QS.query( + QS.explode({ + id, + withDeleted, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.create` permission. */ -export function createUserAdmin({ userAdminCreateDto }: { +export function createUserAdmin( + { + userAdminCreateDto, + }: { userAdminCreateDto: UserAdminCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: UserAdminResponseDto; - }>("/admin/users", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: UserAdminResponseDto; + }>( + "/admin/users", + oazapfts.json({ ...opts, method: "POST", - body: userAdminCreateDto - }))); + body: userAdminCreateDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.delete` permission. */ -export function deleteUserAdmin({ id, userAdminDeleteDto }: { +export function deleteUserAdmin( + { + id, + userAdminDeleteDto, + }: { id: string; userAdminDeleteDto: UserAdminDeleteDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; - }>(`/admin/users/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; + }>( + `/admin/users/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "DELETE", - body: userAdminDeleteDto - }))); + body: userAdminDeleteDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.read` permission. */ -export function getUserAdmin({ id }: { +export function getUserAdmin( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; }>(`/admin/users/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.update` permission. */ -export function updateUserAdmin({ id, userAdminUpdateDto }: { +export function updateUserAdmin( + { + id, + userAdminUpdateDto, + }: { id: string; userAdminUpdateDto: UserAdminUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; - }>(`/admin/users/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; + }>( + `/admin/users/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: userAdminUpdateDto - }))); + body: userAdminUpdateDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.read` permission. */ -export function getUserPreferencesAdmin({ id }: { +export function getUserPreferencesAdmin( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserPreferencesResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserPreferencesResponseDto; }>(`/admin/users/${encodeURIComponent(id)}/preferences`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.update` permission. */ -export function updateUserPreferencesAdmin({ id, userPreferencesUpdateDto }: { +export function updateUserPreferencesAdmin( + { + id, + userPreferencesUpdateDto, + }: { id: string; userPreferencesUpdateDto: UserPreferencesUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserPreferencesResponseDto; - }>(`/admin/users/${encodeURIComponent(id)}/preferences`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserPreferencesResponseDto; + }>( + `/admin/users/${encodeURIComponent(id)}/preferences`, + oazapfts.json({ ...opts, method: "PUT", - body: userPreferencesUpdateDto - }))); + body: userPreferencesUpdateDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.delete` permission. */ -export function restoreUserAdmin({ id }: { +export function restoreUserAdmin( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; }>(`/admin/users/${encodeURIComponent(id)}/restore`, { - ...opts, - method: "POST" - })); + ...opts, + method: "POST", + }), + ); } /** * This endpoint is an admin-only route, and requires the `adminUser.read` permission. */ -export function getUserStatisticsAdmin({ id, isFavorite, isTrashed, visibility }: { +export function getUserStatisticsAdmin( + { + id, + isFavorite, + isTrashed, + visibility, + }: { id: string; isFavorite?: boolean; isTrashed?: boolean; visibility?: AssetVisibility; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetStatsResponseDto; - }>(`/admin/users/${encodeURIComponent(id)}/statistics${QS.query(QS.explode({ - isFavorite, - isTrashed, - visibility - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetStatsResponseDto; + }>( + `/admin/users/${encodeURIComponent(id)}/statistics${QS.query( + QS.explode({ + isFavorite, + isTrashed, + visibility, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `album.read` permission. */ -export function getAllAlbums({ assetId, shared }: { +export function getAllAlbums( + { + assetId, + shared, + }: { assetId?: string; shared?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AlbumResponseDto[]; - }>(`/albums${QS.query(QS.explode({ - assetId, - shared - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AlbumResponseDto[]; + }>( + `/albums${QS.query( + QS.explode({ + assetId, + shared, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `album.create` permission. */ -export function createAlbum({ createAlbumDto }: { +export function createAlbum( + { + createAlbumDto, + }: { createAlbumDto: CreateAlbumDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: AlbumResponseDto; - }>("/albums", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: AlbumResponseDto; + }>( + "/albums", + oazapfts.json({ ...opts, method: "POST", - body: createAlbumDto - }))); + body: createAlbumDto, + }), + ), + ); } /** * This endpoint requires the `albumAsset.create` permission. */ -export function addAssetsToAlbums({ key, slug, albumsAddAssetsDto }: { +export function addAssetsToAlbums( + { + key, + slug, + albumsAddAssetsDto, + }: { key?: string; slug?: string; albumsAddAssetsDto: AlbumsAddAssetsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AlbumsAddAssetsResponseDto; - }>(`/albums/assets${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AlbumsAddAssetsResponseDto; + }>( + `/albums/assets${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.json({ ...opts, method: "PUT", - body: albumsAddAssetsDto - }))); + body: albumsAddAssetsDto, + }), + ), + ); } /** * This endpoint requires the `album.statistics` permission. */ export function getAlbumStatistics(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AlbumStatisticsResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AlbumStatisticsResponseDto; }>("/albums/statistics", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `album.delete` permission. */ -export function deleteAlbum({ id }: { +export function deleteAlbum( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/albums/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/albums/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `album.read` permission. */ -export function getAlbumInfo({ id, key, slug, withoutAssets }: { +export function getAlbumInfo( + { + id, + key, + slug, + withoutAssets, + }: { id: string; key?: string; slug?: string; withoutAssets?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AlbumResponseDto; - }>(`/albums/${encodeURIComponent(id)}${QS.query(QS.explode({ - key, - slug, - withoutAssets - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AlbumResponseDto; + }>( + `/albums/${encodeURIComponent(id)}${QS.query( + QS.explode({ + key, + slug, + withoutAssets, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `album.update` permission. */ -export function updateAlbumInfo({ id, updateAlbumDto }: { +export function updateAlbumInfo( + { + id, + updateAlbumDto, + }: { id: string; updateAlbumDto: UpdateAlbumDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AlbumResponseDto; - }>(`/albums/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AlbumResponseDto; + }>( + `/albums/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PATCH", - body: updateAlbumDto - }))); + body: updateAlbumDto, + }), + ), + ); } /** * This endpoint requires the `albumAsset.delete` permission. */ -export function removeAssetFromAlbum({ id, bulkIdsDto }: { +export function removeAssetFromAlbum( + { + id, + bulkIdsDto, + }: { id: string; bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>(`/albums/${encodeURIComponent(id)}/assets`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + `/albums/${encodeURIComponent(id)}/assets`, + oazapfts.json({ ...opts, method: "DELETE", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `albumAsset.create` permission. */ -export function addAssetsToAlbum({ id, key, slug, bulkIdsDto }: { +export function addAssetsToAlbum( + { + id, + key, + slug, + bulkIdsDto, + }: { id: string; key?: string; slug?: string; bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>(`/albums/${encodeURIComponent(id)}/assets${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + `/albums/${encodeURIComponent(id)}/assets${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.json({ ...opts, method: "PUT", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `albumUser.delete` permission. */ -export function removeUserFromAlbum({ id, userId }: { +export function removeUserFromAlbum( + { + id, + userId, + }: { id: string; userId: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/albums/${encodeURIComponent(id)}/user/${encodeURIComponent(userId)}`, { + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + `/albums/${encodeURIComponent(id)}/user/${encodeURIComponent(userId)}`, + { ...opts, - method: "DELETE" - })); + method: "DELETE", + }, + ), + ); } /** * This endpoint requires the `albumUser.update` permission. */ -export function updateAlbumUser({ id, userId, updateAlbumUserDto }: { +export function updateAlbumUser( + { + id, + userId, + updateAlbumUserDto, + }: { id: string; userId: string; updateAlbumUserDto: UpdateAlbumUserDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/albums/${encodeURIComponent(id)}/user/${encodeURIComponent(userId)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + `/albums/${encodeURIComponent(id)}/user/${encodeURIComponent(userId)}`, + oazapfts.json({ ...opts, method: "PUT", - body: updateAlbumUserDto - }))); + body: updateAlbumUserDto, + }), + ), + ); } /** * This endpoint requires the `albumUser.create` permission. */ -export function addUsersToAlbum({ id, addUsersDto }: { +export function addUsersToAlbum( + { + id, + addUsersDto, + }: { id: string; addUsersDto: AddUsersDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AlbumResponseDto; - }>(`/albums/${encodeURIComponent(id)}/users`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AlbumResponseDto; + }>( + `/albums/${encodeURIComponent(id)}/users`, + oazapfts.json({ ...opts, method: "PUT", - body: addUsersDto - }))); + body: addUsersDto, + }), + ), + ); } /** * This endpoint requires the `apiKey.read` permission. */ export function getApiKeys(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ApiKeyResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ApiKeyResponseDto[]; }>("/api-keys", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `apiKey.create` permission. */ -export function createApiKey({ apiKeyCreateDto }: { +export function createApiKey( + { + apiKeyCreateDto, + }: { apiKeyCreateDto: ApiKeyCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: ApiKeyCreateResponseDto; - }>("/api-keys", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: ApiKeyCreateResponseDto; + }>( + "/api-keys", + oazapfts.json({ ...opts, method: "POST", - body: apiKeyCreateDto - }))); + body: apiKeyCreateDto, + }), + ), + ); } export function getMyApiKey(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ApiKeyResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ApiKeyResponseDto; }>("/api-keys/me", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `apiKey.delete` permission. */ -export function deleteApiKey({ id }: { +export function deleteApiKey( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/api-keys/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/api-keys/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `apiKey.read` permission. */ -export function getApiKey({ id }: { +export function getApiKey( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ApiKeyResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ApiKeyResponseDto; }>(`/api-keys/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `apiKey.update` permission. */ -export function updateApiKey({ id, apiKeyUpdateDto }: { +export function updateApiKey( + { + id, + apiKeyUpdateDto, + }: { id: string; apiKeyUpdateDto: ApiKeyUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ApiKeyResponseDto; - }>(`/api-keys/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ApiKeyResponseDto; + }>( + `/api-keys/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: apiKeyUpdateDto - }))); + body: apiKeyUpdateDto, + }), + ), + ); } /** * This endpoint requires the `asset.delete` permission. */ -export function deleteAssets({ assetBulkDeleteDto }: { +export function deleteAssets( + { + assetBulkDeleteDto, + }: { assetBulkDeleteDto: AssetBulkDeleteDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/assets", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/assets", + oazapfts.json({ ...opts, method: "DELETE", - body: assetBulkDeleteDto - }))); + body: assetBulkDeleteDto, + }), + ), + ); } /** * This endpoint requires the `asset.upload` permission. */ -export function uploadAsset({ key, slug, xImmichChecksum, assetMediaCreateDto }: { +export function uploadAsset( + { + key, + slug, + xImmichChecksum, + assetMediaCreateDto, + }: { key?: string; slug?: string; xImmichChecksum?: string; assetMediaCreateDto: AssetMediaCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: AssetMediaResponseDto; - }>(`/assets${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.multipart({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: AssetMediaResponseDto; + }>( + `/assets${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.multipart({ ...opts, method: "POST", body: assetMediaCreateDto, headers: oazapfts.mergeHeaders(opts?.headers, { - "x-immich-checksum": xImmichChecksum - }) - }))); + "x-immich-checksum": xImmichChecksum, + }), + }), + ), + ); } /** * This endpoint requires the `asset.update` permission. */ -export function updateAssets({ assetBulkUpdateDto }: { +export function updateAssets( + { + assetBulkUpdateDto, + }: { assetBulkUpdateDto: AssetBulkUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/assets", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/assets", + oazapfts.json({ ...opts, method: "PUT", - body: assetBulkUpdateDto - }))); + body: assetBulkUpdateDto, + }), + ), + ); } /** * checkBulkUpload */ -export function checkBulkUpload({ assetBulkUploadCheckDto }: { +export function checkBulkUpload( + { + assetBulkUploadCheckDto, + }: { assetBulkUploadCheckDto: AssetBulkUploadCheckDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetBulkUploadCheckResponseDto; - }>("/assets/bulk-upload-check", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetBulkUploadCheckResponseDto; + }>( + "/assets/bulk-upload-check", + oazapfts.json({ ...opts, method: "POST", - body: assetBulkUploadCheckDto - }))); + body: assetBulkUploadCheckDto, + }), + ), + ); } /** * getAllUserAssetsByDeviceId */ -export function getAllUserAssetsByDeviceId({ deviceId }: { +export function getAllUserAssetsByDeviceId( + { + deviceId, + }: { deviceId: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: string[]; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: string[]; }>(`/assets/device/${encodeURIComponent(deviceId)}`, { - ...opts - })); + ...opts, + }), + ); } /** * checkExistingAssets */ -export function checkExistingAssets({ checkExistingAssetsDto }: { +export function checkExistingAssets( + { + checkExistingAssetsDto, + }: { checkExistingAssetsDto: CheckExistingAssetsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: CheckExistingAssetsResponseDto; - }>("/assets/exist", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: CheckExistingAssetsResponseDto; + }>( + "/assets/exist", + oazapfts.json({ ...opts, method: "POST", - body: checkExistingAssetsDto - }))); + body: checkExistingAssetsDto, + }), + ), + ); } -export function runAssetJobs({ assetJobsDto }: { +export function runAssetJobs( + { + assetJobsDto, + }: { assetJobsDto: AssetJobsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/assets/jobs", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/assets/jobs", + oazapfts.json({ ...opts, method: "POST", - body: assetJobsDto - }))); + body: assetJobsDto, + }), + ), + ); } /** * This property was deprecated in v1.116.0. This endpoint requires the `asset.read` permission. */ -export function getRandom({ count }: { +export function getRandom( + { + count, + }: { count?: number; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto[]; - }>(`/assets/random${QS.query(QS.explode({ - count - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto[]; + }>( + `/assets/random${QS.query( + QS.explode({ + count, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.statistics` permission. */ -export function getAssetStatistics({ isFavorite, isTrashed, visibility }: { +export function getAssetStatistics( + { + isFavorite, + isTrashed, + visibility, + }: { isFavorite?: boolean; isTrashed?: boolean; visibility?: AssetVisibility; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetStatsResponseDto; - }>(`/assets/statistics${QS.query(QS.explode({ - isFavorite, - isTrashed, - visibility - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetStatsResponseDto; + }>( + `/assets/statistics${QS.query( + QS.explode({ + isFavorite, + isTrashed, + visibility, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function getAssetInfo({ id, key, slug }: { +export function getAssetInfo( + { + id, + key, + slug, + }: { id: string; key?: string; slug?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto; - }>(`/assets/${encodeURIComponent(id)}${QS.query(QS.explode({ - key, - slug - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto; + }>( + `/assets/${encodeURIComponent(id)}${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.update` permission. */ -export function updateAsset({ id, updateAssetDto }: { +export function updateAsset( + { + id, + updateAssetDto, + }: { id: string; updateAssetDto: UpdateAssetDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto; - }>(`/assets/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto; + }>( + `/assets/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: updateAssetDto - }))); + body: updateAssetDto, + }), + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function getAssetMetadata({ id }: { +export function getAssetMetadata( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetMetadataResponseDto[]; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetMetadataResponseDto[]; }>(`/assets/${encodeURIComponent(id)}/metadata`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `asset.update` permission. */ -export function updateAssetMetadata({ id, assetMetadataUpsertDto }: { +export function updateAssetMetadata( + { + id, + assetMetadataUpsertDto, + }: { id: string; assetMetadataUpsertDto: AssetMetadataUpsertDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetMetadataResponseDto[]; - }>(`/assets/${encodeURIComponent(id)}/metadata`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetMetadataResponseDto[]; + }>( + `/assets/${encodeURIComponent(id)}/metadata`, + oazapfts.json({ ...opts, method: "PUT", - body: assetMetadataUpsertDto - }))); + body: assetMetadataUpsertDto, + }), + ), + ); } /** * This endpoint requires the `asset.update` permission. */ -export function deleteAssetMetadata({ id, key }: { +export function deleteAssetMetadata( + { + id, + key, + }: { id: string; key: AssetMetadataKey; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/assets/${encodeURIComponent(id)}/metadata/${encodeURIComponent(key)}`, { + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + `/assets/${encodeURIComponent(id)}/metadata/${encodeURIComponent(key)}`, + { ...opts, - method: "DELETE" - })); + method: "DELETE", + }, + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function getAssetMetadataByKey({ id, key }: { +export function getAssetMetadataByKey( + { + id, + key, + }: { id: string; key: AssetMetadataKey; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetMetadataResponseDto; - }>(`/assets/${encodeURIComponent(id)}/metadata/${encodeURIComponent(key)}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetMetadataResponseDto; + }>( + `/assets/${encodeURIComponent(id)}/metadata/${encodeURIComponent(key)}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.download` permission. */ -export function downloadAsset({ id, key, slug }: { +export function downloadAsset( + { + id, + key, + slug, + }: { id: string; key?: string; slug?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchBlob<{ - status: 200; - data: Blob; - }>(`/assets/${encodeURIComponent(id)}/original${QS.query(QS.explode({ - key, - slug - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchBlob<{ + status: 200; + data: Blob; + }>( + `/assets/${encodeURIComponent(id)}/original${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * Replace the asset with new file, without changing its id */ -export function replaceAsset({ id, key, slug, assetMediaReplaceDto }: { +export function replaceAsset( + { + id, + key, + slug, + assetMediaReplaceDto, + }: { id: string; key?: string; slug?: string; assetMediaReplaceDto: AssetMediaReplaceDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetMediaResponseDto; - }>(`/assets/${encodeURIComponent(id)}/original${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.multipart({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetMediaResponseDto; + }>( + `/assets/${encodeURIComponent(id)}/original${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.multipart({ ...opts, method: "PUT", - body: assetMediaReplaceDto - }))); + body: assetMediaReplaceDto, + }), + ), + ); } /** * This endpoint requires the `asset.view` permission. */ -export function viewAsset({ id, key, size, slug }: { +export function viewAsset( + { + id, + key, + size, + slug, + }: { id: string; key?: string; size?: AssetMediaSize; slug?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchBlob<{ - status: 200; - data: Blob; - }>(`/assets/${encodeURIComponent(id)}/thumbnail${QS.query(QS.explode({ - key, - size, - slug - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchBlob<{ + status: 200; + data: Blob; + }>( + `/assets/${encodeURIComponent(id)}/thumbnail${QS.query( + QS.explode({ + key, + size, + slug, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.view` permission. */ -export function playAssetVideo({ id, key, slug }: { +export function playAssetVideo( + { + id, + key, + slug, + }: { id: string; key?: string; slug?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchBlob<{ - status: 200; - data: Blob; - }>(`/assets/${encodeURIComponent(id)}/video/playback${QS.query(QS.explode({ - key, - slug - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchBlob<{ + status: 200; + data: Blob; + }>( + `/assets/${encodeURIComponent(id)}/video/playback${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + { + ...opts, + }, + ), + ); } -export function signUpAdmin({ signUpDto }: { +export function signUpAdmin( + { + signUpDto, + }: { signUpDto: SignUpDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: UserAdminResponseDto; - }>("/auth/admin-sign-up", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: UserAdminResponseDto; + }>( + "/auth/admin-sign-up", + oazapfts.json({ ...opts, method: "POST", - body: signUpDto - }))); + body: signUpDto, + }), + ), + ); } /** * This endpoint requires the `auth.changePassword` permission. */ -export function changePassword({ changePasswordDto }: { +export function changePassword( + { + changePasswordDto, + }: { changePasswordDto: ChangePasswordDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; - }>("/auth/change-password", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; + }>( + "/auth/change-password", + oazapfts.json({ ...opts, method: "POST", - body: changePasswordDto - }))); + body: changePasswordDto, + }), + ), + ); } -export function login({ loginCredentialDto }: { +export function login( + { + loginCredentialDto, + }: { loginCredentialDto: LoginCredentialDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: LoginResponseDto; - }>("/auth/login", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: LoginResponseDto; + }>( + "/auth/login", + oazapfts.json({ ...opts, method: "POST", - body: loginCredentialDto - }))); + body: loginCredentialDto, + }), + ), + ); } export function logout(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LogoutResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LogoutResponseDto; }>("/auth/logout", { - ...opts, - method: "POST" - })); + ...opts, + method: "POST", + }), + ); } /** * This endpoint requires the `pinCode.delete` permission. */ -export function resetPinCode({ pinCodeResetDto }: { +export function resetPinCode( + { + pinCodeResetDto, + }: { pinCodeResetDto: PinCodeResetDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/auth/pin-code", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/auth/pin-code", + oazapfts.json({ ...opts, method: "DELETE", - body: pinCodeResetDto - }))); + body: pinCodeResetDto, + }), + ), + ); } /** * This endpoint requires the `pinCode.create` permission. */ -export function setupPinCode({ pinCodeSetupDto }: { +export function setupPinCode( + { + pinCodeSetupDto, + }: { pinCodeSetupDto: PinCodeSetupDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/auth/pin-code", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/auth/pin-code", + oazapfts.json({ ...opts, method: "POST", - body: pinCodeSetupDto - }))); + body: pinCodeSetupDto, + }), + ), + ); } /** * This endpoint requires the `pinCode.update` permission. */ -export function changePinCode({ pinCodeChangeDto }: { +export function changePinCode( + { + pinCodeChangeDto, + }: { pinCodeChangeDto: PinCodeChangeDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/auth/pin-code", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/auth/pin-code", + oazapfts.json({ ...opts, method: "PUT", - body: pinCodeChangeDto - }))); + body: pinCodeChangeDto, + }), + ), + ); } export function lockAuthSession(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/auth/session/lock", { - ...opts, - method: "POST" - })); + return oazapfts.ok( + oazapfts.fetchText("/auth/session/lock", { + ...opts, + method: "POST", + }), + ); } -export function unlockAuthSession({ sessionUnlockDto }: { +export function unlockAuthSession( + { + sessionUnlockDto, + }: { sessionUnlockDto: SessionUnlockDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/auth/session/unlock", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/auth/session/unlock", + oazapfts.json({ ...opts, method: "POST", - body: sessionUnlockDto - }))); + body: sessionUnlockDto, + }), + ), + ); } export function getAuthStatus(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AuthStatusResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AuthStatusResponseDto; }>("/auth/status", { - ...opts - })); + ...opts, + }), + ); } export function validateAccessToken(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ValidateAccessTokenResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ValidateAccessTokenResponseDto; }>("/auth/validateToken", { - ...opts, - method: "POST" - })); + ...opts, + method: "POST", + }), + ); } /** * This endpoint requires the `asset.download` permission. */ -export function downloadArchive({ key, slug, assetIdsDto }: { +export function downloadArchive( + { + key, + slug, + assetIdsDto, + }: { key?: string; slug?: string; assetIdsDto: AssetIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchBlob<{ - status: 200; - data: Blob; - }>(`/download/archive${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchBlob<{ + status: 200; + data: Blob; + }>( + `/download/archive${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.json({ ...opts, method: "POST", - body: assetIdsDto - }))); + body: assetIdsDto, + }), + ), + ); } /** * This endpoint requires the `asset.download` permission. */ -export function getDownloadInfo({ key, slug, downloadInfoDto }: { +export function getDownloadInfo( + { + key, + slug, + downloadInfoDto, + }: { key?: string; slug?: string; downloadInfoDto: DownloadInfoDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: DownloadResponseDto; - }>(`/download/info${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: DownloadResponseDto; + }>( + `/download/info${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.json({ ...opts, method: "POST", - body: downloadInfoDto - }))); + body: downloadInfoDto, + }), + ), + ); } /** * This endpoint requires the `duplicate.delete` permission. */ -export function deleteDuplicates({ bulkIdsDto }: { +export function deleteDuplicates( + { + bulkIdsDto, + }: { bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/duplicates", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/duplicates", + oazapfts.json({ ...opts, method: "DELETE", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `duplicate.read` permission. */ export function getAssetDuplicates(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: DuplicateResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: DuplicateResponseDto[]; }>("/duplicates", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `duplicate.delete` permission. */ -export function deleteDuplicate({ id }: { +export function deleteDuplicate( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/duplicates/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/duplicates/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `face.read` permission. */ -export function getFaces({ id }: { +export function getFaces( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetFaceResponseDto[]; - }>(`/faces${QS.query(QS.explode({ - id - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetFaceResponseDto[]; + }>( + `/faces${QS.query( + QS.explode({ + id, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `face.create` permission. */ -export function createFace({ assetFaceCreateDto }: { +export function createFace( + { + assetFaceCreateDto, + }: { assetFaceCreateDto: AssetFaceCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/faces", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/faces", + oazapfts.json({ ...opts, method: "POST", - body: assetFaceCreateDto - }))); + body: assetFaceCreateDto, + }), + ), + ); } /** * This endpoint requires the `face.delete` permission. */ -export function deleteFace({ id, assetFaceDeleteDto }: { +export function deleteFace( + { + id, + assetFaceDeleteDto, + }: { id: string; assetFaceDeleteDto: AssetFaceDeleteDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/faces/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + `/faces/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "DELETE", - body: assetFaceDeleteDto - }))); + body: assetFaceDeleteDto, + }), + ), + ); } /** * This endpoint requires the `face.update` permission. */ -export function reassignFacesById({ id, faceDto }: { +export function reassignFacesById( + { + id, + faceDto, + }: { id: string; faceDto: FaceDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PersonResponseDto; - }>(`/faces/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PersonResponseDto; + }>( + `/faces/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: faceDto - }))); + body: faceDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `job.read` permission. */ export function getAllJobsStatus(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AllJobStatusResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AllJobStatusResponseDto; }>("/jobs", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `job.create` permission. */ -export function createJob({ jobCreateDto }: { +export function createJob( + { + jobCreateDto, + }: { jobCreateDto: JobCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/jobs", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/jobs", + oazapfts.json({ ...opts, method: "POST", - body: jobCreateDto - }))); + body: jobCreateDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `job.create` permission. */ -export function sendJobCommand({ id, jobCommandDto }: { +export function sendJobCommand( + { + id, + jobCommandDto, + }: { id: JobName; jobCommandDto: JobCommandDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: JobStatusDto; - }>(`/jobs/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: JobStatusDto; + }>( + `/jobs/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: jobCommandDto - }))); + body: jobCommandDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `library.read` permission. */ export function getAllLibraries(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LibraryResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LibraryResponseDto[]; }>("/libraries", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `library.create` permission. */ -export function createLibrary({ createLibraryDto }: { +export function createLibrary( + { + createLibraryDto, + }: { createLibraryDto: CreateLibraryDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: LibraryResponseDto; - }>("/libraries", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: LibraryResponseDto; + }>( + "/libraries", + oazapfts.json({ ...opts, method: "POST", - body: createLibraryDto - }))); + body: createLibraryDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `library.delete` permission. */ -export function deleteLibrary({ id }: { +export function deleteLibrary( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/libraries/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/libraries/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint is an admin-only route, and requires the `library.read` permission. */ -export function getLibrary({ id }: { +export function getLibrary( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LibraryResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LibraryResponseDto; }>(`/libraries/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `library.update` permission. */ -export function updateLibrary({ id, updateLibraryDto }: { +export function updateLibrary( + { + id, + updateLibraryDto, + }: { id: string; updateLibraryDto: UpdateLibraryDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LibraryResponseDto; - }>(`/libraries/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LibraryResponseDto; + }>( + `/libraries/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: updateLibraryDto - }))); + body: updateLibraryDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `library.update` permission. */ -export function scanLibrary({ id }: { +export function scanLibrary( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/libraries/${encodeURIComponent(id)}/scan`, { - ...opts, - method: "POST" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/libraries/${encodeURIComponent(id)}/scan`, { + ...opts, + method: "POST", + }), + ); } /** * This endpoint is an admin-only route, and requires the `library.statistics` permission. */ -export function getLibraryStatistics({ id }: { +export function getLibraryStatistics( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LibraryStatsResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LibraryStatsResponseDto; }>(`/libraries/${encodeURIComponent(id)}/statistics`, { - ...opts - })); + ...opts, + }), + ); } -export function validate({ id, validateLibraryDto }: { +export function validate( + { + id, + validateLibraryDto, + }: { id: string; validateLibraryDto: ValidateLibraryDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ValidateLibraryResponseDto; - }>(`/libraries/${encodeURIComponent(id)}/validate`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ValidateLibraryResponseDto; + }>( + `/libraries/${encodeURIComponent(id)}/validate`, + oazapfts.json({ ...opts, method: "POST", - body: validateLibraryDto - }))); + body: validateLibraryDto, + }), + ), + ); } -export function getMapMarkers({ isArchived, isFavorite, fileCreatedAfter, fileCreatedBefore, withPartners, withSharedAlbums }: { +export function getMapMarkers( + { + isArchived, + isFavorite, + fileCreatedAfter, + fileCreatedBefore, + withPartners, + withSharedAlbums, + }: { isArchived?: boolean; isFavorite?: boolean; fileCreatedAfter?: string; fileCreatedBefore?: string; withPartners?: boolean; withSharedAlbums?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: MapMarkerResponseDto[]; - }>(`/map/markers${QS.query(QS.explode({ - isArchived, - isFavorite, - fileCreatedAfter, - fileCreatedBefore, - withPartners, - withSharedAlbums - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: MapMarkerResponseDto[]; + }>( + `/map/markers${QS.query( + QS.explode({ + isArchived, + isFavorite, + fileCreatedAfter, + fileCreatedBefore, + withPartners, + withSharedAlbums, + }), + )}`, + { + ...opts, + }, + ), + ); } -export function reverseGeocode({ lat, lon }: { +export function reverseGeocode( + { + lat, + lon, + }: { lat: number; lon: number; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: MapReverseGeocodeResponseDto[]; - }>(`/map/reverse-geocode${QS.query(QS.explode({ - lat, - lon - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: MapReverseGeocodeResponseDto[]; + }>( + `/map/reverse-geocode${QS.query( + QS.explode({ + lat, + lon, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `memory.read` permission. */ -export function searchMemories({ $for, isSaved, isTrashed, $type }: { +export function searchMemories( + { + $for, + isSaved, + isTrashed, + $type, + }: { $for?: string; isSaved?: boolean; isTrashed?: boolean; $type?: MemoryType; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: MemoryResponseDto[]; - }>(`/memories${QS.query(QS.explode({ - "for": $for, - isSaved, - isTrashed, - "type": $type - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: MemoryResponseDto[]; + }>( + `/memories${QS.query( + QS.explode({ + for: $for, + isSaved, + isTrashed, + type: $type, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `memory.create` permission. */ -export function createMemory({ memoryCreateDto }: { +export function createMemory( + { + memoryCreateDto, + }: { memoryCreateDto: MemoryCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: MemoryResponseDto; - }>("/memories", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: MemoryResponseDto; + }>( + "/memories", + oazapfts.json({ ...opts, method: "POST", - body: memoryCreateDto - }))); + body: memoryCreateDto, + }), + ), + ); } /** * This endpoint requires the `memory.statistics` permission. */ -export function memoriesStatistics({ $for, isSaved, isTrashed, $type }: { +export function memoriesStatistics( + { + $for, + isSaved, + isTrashed, + $type, + }: { $for?: string; isSaved?: boolean; isTrashed?: boolean; $type?: MemoryType; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: MemoryStatisticsResponseDto; - }>(`/memories/statistics${QS.query(QS.explode({ - "for": $for, - isSaved, - isTrashed, - "type": $type - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: MemoryStatisticsResponseDto; + }>( + `/memories/statistics${QS.query( + QS.explode({ + for: $for, + isSaved, + isTrashed, + type: $type, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `memory.delete` permission. */ -export function deleteMemory({ id }: { +export function deleteMemory( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/memories/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/memories/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `memory.read` permission. */ -export function getMemory({ id }: { +export function getMemory( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: MemoryResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: MemoryResponseDto; }>(`/memories/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `memory.update` permission. */ -export function updateMemory({ id, memoryUpdateDto }: { +export function updateMemory( + { + id, + memoryUpdateDto, + }: { id: string; memoryUpdateDto: MemoryUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: MemoryResponseDto; - }>(`/memories/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: MemoryResponseDto; + }>( + `/memories/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: memoryUpdateDto - }))); + body: memoryUpdateDto, + }), + ), + ); } /** * This endpoint requires the `memoryAsset.delete` permission. */ -export function removeMemoryAssets({ id, bulkIdsDto }: { +export function removeMemoryAssets( + { + id, + bulkIdsDto, + }: { id: string; bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>(`/memories/${encodeURIComponent(id)}/assets`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + `/memories/${encodeURIComponent(id)}/assets`, + oazapfts.json({ ...opts, method: "DELETE", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `memoryAsset.create` permission. */ -export function addMemoryAssets({ id, bulkIdsDto }: { +export function addMemoryAssets( + { + id, + bulkIdsDto, + }: { id: string; bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>(`/memories/${encodeURIComponent(id)}/assets`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + `/memories/${encodeURIComponent(id)}/assets`, + oazapfts.json({ ...opts, method: "PUT", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `notification.delete` permission. */ -export function deleteNotifications({ notificationDeleteAllDto }: { +export function deleteNotifications( + { + notificationDeleteAllDto, + }: { notificationDeleteAllDto: NotificationDeleteAllDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/notifications", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/notifications", + oazapfts.json({ ...opts, method: "DELETE", - body: notificationDeleteAllDto - }))); + body: notificationDeleteAllDto, + }), + ), + ); } /** * This endpoint requires the `notification.read` permission. */ -export function getNotifications({ id, level, $type, unread }: { +export function getNotifications( + { + id, + level, + $type, + unread, + }: { id?: string; level?: NotificationLevel; $type?: NotificationType; unread?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: NotificationDto[]; - }>(`/notifications${QS.query(QS.explode({ - id, - level, - "type": $type, - unread - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: NotificationDto[]; + }>( + `/notifications${QS.query( + QS.explode({ + id, + level, + type: $type, + unread, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `notification.update` permission. */ -export function updateNotifications({ notificationUpdateAllDto }: { +export function updateNotifications( + { + notificationUpdateAllDto, + }: { notificationUpdateAllDto: NotificationUpdateAllDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/notifications", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/notifications", + oazapfts.json({ ...opts, method: "PUT", - body: notificationUpdateAllDto - }))); + body: notificationUpdateAllDto, + }), + ), + ); } /** * This endpoint requires the `notification.delete` permission. */ -export function deleteNotification({ id }: { +export function deleteNotification( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/notifications/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/notifications/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `notification.read` permission. */ -export function getNotification({ id }: { +export function getNotification( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: NotificationDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: NotificationDto; }>(`/notifications/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `notification.update` permission. */ -export function updateNotification({ id, notificationUpdateDto }: { +export function updateNotification( + { + id, + notificationUpdateDto, + }: { id: string; notificationUpdateDto: NotificationUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: NotificationDto; - }>(`/notifications/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: NotificationDto; + }>( + `/notifications/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: notificationUpdateDto - }))); + body: notificationUpdateDto, + }), + ), + ); } -export function startOAuth({ oAuthConfigDto }: { +export function startOAuth( + { + oAuthConfigDto, + }: { oAuthConfigDto: OAuthConfigDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: OAuthAuthorizeResponseDto; - }>("/oauth/authorize", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: OAuthAuthorizeResponseDto; + }>( + "/oauth/authorize", + oazapfts.json({ ...opts, method: "POST", - body: oAuthConfigDto - }))); + body: oAuthConfigDto, + }), + ), + ); } -export function finishOAuth({ oAuthCallbackDto }: { +export function finishOAuth( + { + oAuthCallbackDto, + }: { oAuthCallbackDto: OAuthCallbackDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: LoginResponseDto; - }>("/oauth/callback", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: LoginResponseDto; + }>( + "/oauth/callback", + oazapfts.json({ ...opts, method: "POST", - body: oAuthCallbackDto - }))); + body: oAuthCallbackDto, + }), + ), + ); } -export function linkOAuthAccount({ oAuthCallbackDto }: { +export function linkOAuthAccount( + { + oAuthCallbackDto, + }: { oAuthCallbackDto: OAuthCallbackDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; - }>("/oauth/link", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; + }>( + "/oauth/link", + oazapfts.json({ ...opts, method: "POST", - body: oAuthCallbackDto - }))); + body: oAuthCallbackDto, + }), + ), + ); } export function redirectOAuthToMobile(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/oauth/mobile-redirect", { - ...opts - })); + return oazapfts.ok( + oazapfts.fetchText("/oauth/mobile-redirect", { + ...opts, + }), + ); } export function unlinkOAuthAccount(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; }>("/oauth/unlink", { - ...opts, - method: "POST" - })); + ...opts, + method: "POST", + }), + ); } /** * This endpoint requires the `partner.read` permission. */ -export function getPartners({ direction }: { +export function getPartners( + { + direction, + }: { direction: PartnerDirection; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PartnerResponseDto[]; - }>(`/partners${QS.query(QS.explode({ - direction - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PartnerResponseDto[]; + }>( + `/partners${QS.query( + QS.explode({ + direction, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `partner.create` permission. */ -export function createPartner({ partnerCreateDto }: { +export function createPartner( + { + partnerCreateDto, + }: { partnerCreateDto: PartnerCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: PartnerResponseDto; - }>("/partners", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: PartnerResponseDto; + }>( + "/partners", + oazapfts.json({ ...opts, method: "POST", - body: partnerCreateDto - }))); + body: partnerCreateDto, + }), + ), + ); } /** * This endpoint requires the `partner.delete` permission. */ -export function removePartner({ id }: { +export function removePartner( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/partners/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/partners/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This property was deprecated in v1.141.0. This endpoint requires the `partner.create` permission. */ -export function createPartnerDeprecated({ id }: { +export function createPartnerDeprecated( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: PartnerResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: PartnerResponseDto; }>(`/partners/${encodeURIComponent(id)}`, { - ...opts, - method: "POST" - })); + ...opts, + method: "POST", + }), + ); } /** * This endpoint requires the `partner.update` permission. */ -export function updatePartner({ id, partnerUpdateDto }: { +export function updatePartner( + { + id, + partnerUpdateDto, + }: { id: string; partnerUpdateDto: PartnerUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PartnerResponseDto; - }>(`/partners/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PartnerResponseDto; + }>( + `/partners/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: partnerUpdateDto - }))); + body: partnerUpdateDto, + }), + ), + ); } /** * This endpoint requires the `person.delete` permission. */ -export function deletePeople({ bulkIdsDto }: { +export function deletePeople( + { + bulkIdsDto, + }: { bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/people", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/people", + oazapfts.json({ ...opts, method: "DELETE", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `person.read` permission. */ -export function getAllPeople({ closestAssetId, closestPersonId, page, size, withHidden }: { +export function getAllPeople( + { + closestAssetId, + closestPersonId, + page, + size, + withHidden, + }: { closestAssetId?: string; closestPersonId?: string; page?: number; size?: number; withHidden?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PeopleResponseDto; - }>(`/people${QS.query(QS.explode({ - closestAssetId, - closestPersonId, - page, - size, - withHidden - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PeopleResponseDto; + }>( + `/people${QS.query( + QS.explode({ + closestAssetId, + closestPersonId, + page, + size, + withHidden, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `person.create` permission. */ -export function createPerson({ personCreateDto }: { +export function createPerson( + { + personCreateDto, + }: { personCreateDto: PersonCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: PersonResponseDto; - }>("/people", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: PersonResponseDto; + }>( + "/people", + oazapfts.json({ ...opts, method: "POST", - body: personCreateDto - }))); + body: personCreateDto, + }), + ), + ); } /** * This endpoint requires the `person.update` permission. */ -export function updatePeople({ peopleUpdateDto }: { +export function updatePeople( + { + peopleUpdateDto, + }: { peopleUpdateDto: PeopleUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>("/people", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + "/people", + oazapfts.json({ ...opts, method: "PUT", - body: peopleUpdateDto - }))); + body: peopleUpdateDto, + }), + ), + ); } /** * This endpoint requires the `person.delete` permission. */ -export function deletePerson({ id }: { +export function deletePerson( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/people/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/people/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `person.read` permission. */ -export function getPerson({ id }: { +export function getPerson( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PersonResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PersonResponseDto; }>(`/people/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `person.update` permission. */ -export function updatePerson({ id, personUpdateDto }: { +export function updatePerson( + { + id, + personUpdateDto, + }: { id: string; personUpdateDto: PersonUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PersonResponseDto; - }>(`/people/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PersonResponseDto; + }>( + `/people/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: personUpdateDto - }))); + body: personUpdateDto, + }), + ), + ); } /** * This endpoint requires the `person.merge` permission. */ -export function mergePerson({ id, mergePersonDto }: { +export function mergePerson( + { + id, + mergePersonDto, + }: { id: string; mergePersonDto: MergePersonDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>(`/people/${encodeURIComponent(id)}/merge`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + `/people/${encodeURIComponent(id)}/merge`, + oazapfts.json({ ...opts, method: "POST", - body: mergePersonDto - }))); + body: mergePersonDto, + }), + ), + ); } /** * This endpoint requires the `person.reassign` permission. */ -export function reassignFaces({ id, assetFaceUpdateDto }: { +export function reassignFaces( + { + id, + assetFaceUpdateDto, + }: { id: string; assetFaceUpdateDto: AssetFaceUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PersonResponseDto[]; - }>(`/people/${encodeURIComponent(id)}/reassign`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PersonResponseDto[]; + }>( + `/people/${encodeURIComponent(id)}/reassign`, + oazapfts.json({ ...opts, method: "PUT", - body: assetFaceUpdateDto - }))); + body: assetFaceUpdateDto, + }), + ), + ); } /** * This endpoint requires the `person.statistics` permission. */ -export function getPersonStatistics({ id }: { +export function getPersonStatistics( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PersonStatisticsResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PersonStatisticsResponseDto; }>(`/people/${encodeURIComponent(id)}/statistics`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `person.read` permission. */ -export function getPersonThumbnail({ id }: { +export function getPersonThumbnail( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchBlob<{ - status: 200; - data: Blob; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchBlob<{ + status: 200; + data: Blob; }>(`/people/${encodeURIComponent(id)}/thumbnail`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `asset.read` permission. */ export function getAssetsByCity(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto[]; }>("/search/cities", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `asset.read` permission. */ export function getExploreData(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SearchExploreResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SearchExploreResponseDto[]; }>("/search/explore", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function searchLargeAssets({ albumIds, city, country, createdAfter, createdBefore, deviceId, isEncoded, isFavorite, isMotion, isNotInAlbum, isOffline, lensModel, libraryId, make, minFileSize, model, personIds, rating, size, state, tagIds, takenAfter, takenBefore, trashedAfter, trashedBefore, $type, updatedAfter, updatedBefore, visibility, withDeleted, withExif }: { +export function searchLargeAssets( + { + albumIds, + city, + country, + createdAfter, + createdBefore, + deviceId, + isEncoded, + isFavorite, + isMotion, + isNotInAlbum, + isOffline, + lensModel, + libraryId, + make, + minFileSize, + model, + personIds, + rating, + size, + state, + tagIds, + takenAfter, + takenBefore, + trashedAfter, + trashedBefore, + $type, + updatedAfter, + updatedBefore, + visibility, + withDeleted, + withExif, + }: { albumIds?: string[]; city?: string | null; country?: string | null; @@ -3409,899 +4631,1409 @@ export function searchLargeAssets({ albumIds, city, country, createdAfter, creat visibility?: AssetVisibility; withDeleted?: boolean; withExif?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto[]; - }>(`/search/large-assets${QS.query(QS.explode({ - albumIds, - city, - country, - createdAfter, - createdBefore, - deviceId, - isEncoded, - isFavorite, - isMotion, - isNotInAlbum, - isOffline, - lensModel, - libraryId, - make, - minFileSize, - model, - personIds, - rating, - size, - state, - tagIds, - takenAfter, - takenBefore, - trashedAfter, - trashedBefore, - "type": $type, - updatedAfter, - updatedBefore, - visibility, - withDeleted, - withExif - }))}`, { + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto[]; + }>( + `/search/large-assets${QS.query( + QS.explode({ + albumIds, + city, + country, + createdAfter, + createdBefore, + deviceId, + isEncoded, + isFavorite, + isMotion, + isNotInAlbum, + isOffline, + lensModel, + libraryId, + make, + minFileSize, + model, + personIds, + rating, + size, + state, + tagIds, + takenAfter, + takenBefore, + trashedAfter, + trashedBefore, + type: $type, + updatedAfter, + updatedBefore, + visibility, + withDeleted, + withExif, + }), + )}`, + { ...opts, - method: "POST" - })); + method: "POST", + }, + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function searchAssets({ metadataSearchDto }: { +export function searchAssets( + { + metadataSearchDto, + }: { metadataSearchDto: MetadataSearchDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SearchResponseDto; - }>("/search/metadata", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SearchResponseDto; + }>( + "/search/metadata", + oazapfts.json({ ...opts, method: "POST", - body: metadataSearchDto - }))); + body: metadataSearchDto, + }), + ), + ); } /** * This endpoint requires the `person.read` permission. */ -export function searchPerson({ name, withHidden }: { +export function searchPerson( + { + name, + withHidden, + }: { name: string; withHidden?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PersonResponseDto[]; - }>(`/search/person${QS.query(QS.explode({ - name, - withHidden - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PersonResponseDto[]; + }>( + `/search/person${QS.query( + QS.explode({ + name, + withHidden, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function searchPlaces({ name }: { +export function searchPlaces( + { + name, + }: { name: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: PlacesResponseDto[]; - }>(`/search/places${QS.query(QS.explode({ - name - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: PlacesResponseDto[]; + }>( + `/search/places${QS.query( + QS.explode({ + name, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function searchRandom({ randomSearchDto }: { +export function searchRandom( + { + randomSearchDto, + }: { randomSearchDto: RandomSearchDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto[]; - }>("/search/random", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto[]; + }>( + "/search/random", + oazapfts.json({ ...opts, method: "POST", - body: randomSearchDto - }))); + body: randomSearchDto, + }), + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function searchSmart({ smartSearchDto }: { +export function searchSmart( + { + smartSearchDto, + }: { smartSearchDto: SmartSearchDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SearchResponseDto; - }>("/search/smart", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SearchResponseDto; + }>( + "/search/smart", + oazapfts.json({ ...opts, method: "POST", - body: smartSearchDto - }))); + body: smartSearchDto, + }), + ), + ); } /** * This endpoint requires the `asset.statistics` permission. */ -export function searchAssetStatistics({ statisticsSearchDto }: { +export function searchAssetStatistics( + { + statisticsSearchDto, + }: { statisticsSearchDto: StatisticsSearchDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SearchStatisticsResponseDto; - }>("/search/statistics", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SearchStatisticsResponseDto; + }>( + "/search/statistics", + oazapfts.json({ ...opts, method: "POST", - body: statisticsSearchDto - }))); + body: statisticsSearchDto, + }), + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function getSearchSuggestions({ country, includeNull, make, model, state, $type }: { +export function getSearchSuggestions( + { + country, + includeNull, + make, + model, + state, + $type, + }: { country?: string; includeNull?: boolean; make?: string; model?: string; state?: string; $type: SearchSuggestionType; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: string[]; - }>(`/search/suggestions${QS.query(QS.explode({ - country, - includeNull, - make, - model, - state, - "type": $type - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: string[]; + }>( + `/search/suggestions${QS.query( + QS.explode({ + country, + includeNull, + make, + model, + state, + type: $type, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `server.about` permission. */ export function getAboutInfo(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerAboutResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerAboutResponseDto; }>("/server/about", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `server.apkLinks` permission. */ export function getApkLinks(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerApkLinksDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerApkLinksDto; }>("/server/apk-links", { - ...opts - })); + ...opts, + }), + ); } export function getServerConfig(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerConfigDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerConfigDto; }>("/server/config", { - ...opts - })); + ...opts, + }), + ); } export function getServerFeatures(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerFeaturesDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerFeaturesDto; }>("/server/features", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `serverLicense.delete` permission. */ export function deleteServerLicense(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/server/license", { - ...opts, - method: "DELETE" - })); + return oazapfts.ok( + oazapfts.fetchText("/server/license", { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint is an admin-only route, and requires the `serverLicense.read` permission. */ export function getServerLicense(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LicenseResponseDto; - } | { - status: 404; - }>("/server/license", { - ...opts - })); + return oazapfts.ok( + oazapfts.fetchJson< + | { + status: 200; + data: LicenseResponseDto; + } + | { + status: 404; + } + >("/server/license", { + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `serverLicense.update` permission. */ -export function setServerLicense({ licenseKeyDto }: { +export function setServerLicense( + { + licenseKeyDto, + }: { licenseKeyDto: LicenseKeyDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LicenseResponseDto; - }>("/server/license", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LicenseResponseDto; + }>( + "/server/license", + oazapfts.json({ ...opts, method: "PUT", - body: licenseKeyDto - }))); + body: licenseKeyDto, + }), + ), + ); } export function getSupportedMediaTypes(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerMediaTypesResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerMediaTypesResponseDto; }>("/server/media-types", { - ...opts - })); + ...opts, + }), + ); } export function pingServer(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerPingResponseRead; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerPingResponseRead; }>("/server/ping", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `server.statistics` permission. */ export function getServerStatistics(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerStatsResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerStatsResponseDto; }>("/server/statistics", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `server.storage` permission. */ export function getStorage(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerStorageResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerStorageResponseDto; }>("/server/storage", { - ...opts - })); + ...opts, + }), + ); } export function getTheme(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerThemeDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerThemeDto; }>("/server/theme", { - ...opts - })); + ...opts, + }), + ); } export function getServerVersion(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerVersionResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerVersionResponseDto; }>("/server/version", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `server.versionCheck` permission. */ export function getVersionCheck(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: VersionCheckStateResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: VersionCheckStateResponseDto; }>("/server/version-check", { - ...opts - })); + ...opts, + }), + ); } export function getVersionHistory(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ServerVersionHistoryResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ServerVersionHistoryResponseDto[]; }>("/server/version-history", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `session.delete` permission. */ export function deleteAllSessions(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/sessions", { - ...opts, - method: "DELETE" - })); + return oazapfts.ok( + oazapfts.fetchText("/sessions", { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `session.read` permission. */ export function getSessions(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SessionResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SessionResponseDto[]; }>("/sessions", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `session.create` permission. */ -export function createSession({ sessionCreateDto }: { +export function createSession( + { + sessionCreateDto, + }: { sessionCreateDto: SessionCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: SessionCreateResponseDto; - }>("/sessions", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: SessionCreateResponseDto; + }>( + "/sessions", + oazapfts.json({ ...opts, method: "POST", - body: sessionCreateDto - }))); + body: sessionCreateDto, + }), + ), + ); } /** * This endpoint requires the `session.delete` permission. */ -export function deleteSession({ id }: { +export function deleteSession( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/sessions/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/sessions/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `session.update` permission. */ -export function updateSession({ id, sessionUpdateDto }: { +export function updateSession( + { + id, + sessionUpdateDto, + }: { id: string; sessionUpdateDto: SessionUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SessionResponseDto; - }>(`/sessions/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SessionResponseDto; + }>( + `/sessions/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: sessionUpdateDto - }))); + body: sessionUpdateDto, + }), + ), + ); } /** * This endpoint requires the `session.lock` permission. */ -export function lockSession({ id }: { +export function lockSession( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/sessions/${encodeURIComponent(id)}/lock`, { - ...opts, - method: "POST" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/sessions/${encodeURIComponent(id)}/lock`, { + ...opts, + method: "POST", + }), + ); } /** * This endpoint requires the `sharedLink.read` permission. */ -export function getAllSharedLinks({ albumId }: { +export function getAllSharedLinks( + { + albumId, + }: { albumId?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SharedLinkResponseDto[]; - }>(`/shared-links${QS.query(QS.explode({ - albumId - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SharedLinkResponseDto[]; + }>( + `/shared-links${QS.query( + QS.explode({ + albumId, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `sharedLink.create` permission. */ -export function createSharedLink({ sharedLinkCreateDto }: { +export function createSharedLink( + { + sharedLinkCreateDto, + }: { sharedLinkCreateDto: SharedLinkCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: SharedLinkResponseDto; - }>("/shared-links", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: SharedLinkResponseDto; + }>( + "/shared-links", + oazapfts.json({ ...opts, method: "POST", - body: sharedLinkCreateDto - }))); + body: sharedLinkCreateDto, + }), + ), + ); } -export function getMySharedLink({ password, token, key, slug }: { +export function getMySharedLink( + { + password, + token, + key, + slug, + }: { password?: string; token?: string; key?: string; slug?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SharedLinkResponseDto; - }>(`/shared-links/me${QS.query(QS.explode({ - password, - token, - key, - slug - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SharedLinkResponseDto; + }>( + `/shared-links/me${QS.query( + QS.explode({ + password, + token, + key, + slug, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `sharedLink.delete` permission. */ -export function removeSharedLink({ id }: { +export function removeSharedLink( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/shared-links/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/shared-links/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `sharedLink.read` permission. */ -export function getSharedLinkById({ id }: { +export function getSharedLinkById( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SharedLinkResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SharedLinkResponseDto; }>(`/shared-links/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `sharedLink.update` permission. */ -export function updateSharedLink({ id, sharedLinkEditDto }: { +export function updateSharedLink( + { + id, + sharedLinkEditDto, + }: { id: string; sharedLinkEditDto: SharedLinkEditDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SharedLinkResponseDto; - }>(`/shared-links/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SharedLinkResponseDto; + }>( + `/shared-links/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PATCH", - body: sharedLinkEditDto - }))); + body: sharedLinkEditDto, + }), + ), + ); } -export function removeSharedLinkAssets({ id, key, slug, assetIdsDto }: { +export function removeSharedLinkAssets( + { + id, + key, + slug, + assetIdsDto, + }: { id: string; key?: string; slug?: string; assetIdsDto: AssetIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetIdsResponseDto[]; - }>(`/shared-links/${encodeURIComponent(id)}/assets${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetIdsResponseDto[]; + }>( + `/shared-links/${encodeURIComponent(id)}/assets${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.json({ ...opts, method: "DELETE", - body: assetIdsDto - }))); + body: assetIdsDto, + }), + ), + ); } -export function addSharedLinkAssets({ id, key, slug, assetIdsDto }: { +export function addSharedLinkAssets( + { + id, + key, + slug, + assetIdsDto, + }: { id: string; key?: string; slug?: string; assetIdsDto: AssetIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetIdsResponseDto[]; - }>(`/shared-links/${encodeURIComponent(id)}/assets${QS.query(QS.explode({ - key, - slug - }))}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetIdsResponseDto[]; + }>( + `/shared-links/${encodeURIComponent(id)}/assets${QS.query( + QS.explode({ + key, + slug, + }), + )}`, + oazapfts.json({ ...opts, method: "PUT", - body: assetIdsDto - }))); + body: assetIdsDto, + }), + ), + ); } /** * This endpoint requires the `stack.delete` permission. */ -export function deleteStacks({ bulkIdsDto }: { +export function deleteStacks( + { + bulkIdsDto, + }: { bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/stacks", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/stacks", + oazapfts.json({ ...opts, method: "DELETE", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `stack.read` permission. */ -export function searchStacks({ primaryAssetId }: { +export function searchStacks( + { + primaryAssetId, + }: { primaryAssetId?: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: StackResponseDto[]; - }>(`/stacks${QS.query(QS.explode({ - primaryAssetId - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: StackResponseDto[]; + }>( + `/stacks${QS.query( + QS.explode({ + primaryAssetId, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `stack.create` permission. */ -export function createStack({ stackCreateDto }: { +export function createStack( + { + stackCreateDto, + }: { stackCreateDto: StackCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: StackResponseDto; - }>("/stacks", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: StackResponseDto; + }>( + "/stacks", + oazapfts.json({ ...opts, method: "POST", - body: stackCreateDto - }))); + body: stackCreateDto, + }), + ), + ); } /** * This endpoint requires the `stack.delete` permission. */ -export function deleteStack({ id }: { +export function deleteStack( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/stacks/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/stacks/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `stack.read` permission. */ -export function getStack({ id }: { +export function getStack( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: StackResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: StackResponseDto; }>(`/stacks/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `stack.update` permission. */ -export function updateStack({ id, stackUpdateDto }: { +export function updateStack( + { + id, + stackUpdateDto, + }: { id: string; stackUpdateDto: StackUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: StackResponseDto; - }>(`/stacks/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: StackResponseDto; + }>( + `/stacks/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: stackUpdateDto - }))); + body: stackUpdateDto, + }), + ), + ); } /** * This endpoint requires the `stack.update` permission. */ -export function removeAssetFromStack({ assetId, id }: { +export function removeAssetFromStack( + { + assetId, + id, + }: { assetId: string; id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/stacks/${encodeURIComponent(id)}/assets/${encodeURIComponent(assetId)}`, { + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + `/stacks/${encodeURIComponent(id)}/assets/${encodeURIComponent(assetId)}`, + { ...opts, - method: "DELETE" - })); + method: "DELETE", + }, + ), + ); } /** * This endpoint requires the `syncCheckpoint.delete` permission. */ -export function deleteSyncAck({ syncAckDeleteDto }: { +export function deleteSyncAck( + { + syncAckDeleteDto, + }: { syncAckDeleteDto: SyncAckDeleteDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/sync/ack", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/sync/ack", + oazapfts.json({ ...opts, method: "DELETE", - body: syncAckDeleteDto - }))); + body: syncAckDeleteDto, + }), + ), + ); } /** * This endpoint requires the `syncCheckpoint.read` permission. */ export function getSyncAck(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SyncAckDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SyncAckDto[]; }>("/sync/ack", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `syncCheckpoint.update` permission. */ -export function sendSyncAck({ syncAckSetDto }: { +export function sendSyncAck( + { + syncAckSetDto, + }: { syncAckSetDto: SyncAckSetDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/sync/ack", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/sync/ack", + oazapfts.json({ ...opts, method: "POST", - body: syncAckSetDto - }))); + body: syncAckSetDto, + }), + ), + ); } -export function getDeltaSync({ assetDeltaSyncDto }: { +export function getDeltaSync( + { + assetDeltaSyncDto, + }: { assetDeltaSyncDto: AssetDeltaSyncDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetDeltaSyncResponseDto; - }>("/sync/delta-sync", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetDeltaSyncResponseDto; + }>( + "/sync/delta-sync", + oazapfts.json({ ...opts, method: "POST", - body: assetDeltaSyncDto - }))); + body: assetDeltaSyncDto, + }), + ), + ); } -export function getFullSyncForUser({ assetFullSyncDto }: { +export function getFullSyncForUser( + { + assetFullSyncDto, + }: { assetFullSyncDto: AssetFullSyncDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto[]; - }>("/sync/full-sync", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto[]; + }>( + "/sync/full-sync", + oazapfts.json({ ...opts, method: "POST", - body: assetFullSyncDto - }))); + body: assetFullSyncDto, + }), + ), + ); } /** * This endpoint requires the `sync.stream` permission. */ -export function getSyncStream({ syncStreamDto }: { +export function getSyncStream( + { + syncStreamDto, + }: { syncStreamDto: SyncStreamDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/sync/stream", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/sync/stream", + oazapfts.json({ ...opts, method: "POST", - body: syncStreamDto - }))); + body: syncStreamDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `systemConfig.read` permission. */ export function getConfig(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SystemConfigDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SystemConfigDto; }>("/system-config", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `systemConfig.update` permission. */ -export function updateConfig({ systemConfigDto }: { +export function updateConfig( + { + systemConfigDto, + }: { systemConfigDto: SystemConfigDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SystemConfigDto; - }>("/system-config", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SystemConfigDto; + }>( + "/system-config", + oazapfts.json({ ...opts, method: "PUT", - body: systemConfigDto - }))); + body: systemConfigDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `systemConfig.read` permission. */ export function getConfigDefaults(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SystemConfigDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SystemConfigDto; }>("/system-config/defaults", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `systemConfig.read` permission. */ export function getStorageTemplateOptions(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: SystemConfigTemplateStorageOptionDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: SystemConfigTemplateStorageOptionDto; }>("/system-config/storage-template-options", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `systemMetadata.read` permission. */ export function getAdminOnboarding(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AdminOnboardingUpdateDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AdminOnboardingUpdateDto; }>("/system-metadata/admin-onboarding", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `systemMetadata.update` permission. */ -export function updateAdminOnboarding({ adminOnboardingUpdateDto }: { +export function updateAdminOnboarding( + { + adminOnboardingUpdateDto, + }: { adminOnboardingUpdateDto: AdminOnboardingUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/system-metadata/admin-onboarding", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText( + "/system-metadata/admin-onboarding", + oazapfts.json({ ...opts, method: "POST", - body: adminOnboardingUpdateDto - }))); + body: adminOnboardingUpdateDto, + }), + ), + ); } /** * This endpoint is an admin-only route, and requires the `systemMetadata.read` permission. */ export function getReverseGeocodingState(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: ReverseGeocodingStateResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: ReverseGeocodingStateResponseDto; }>("/system-metadata/reverse-geocoding-state", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint is an admin-only route, and requires the `systemMetadata.read` permission. */ export function getVersionCheckState(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: VersionCheckStateResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: VersionCheckStateResponseDto; }>("/system-metadata/version-check-state", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `tag.read` permission. */ export function getAllTags(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TagResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TagResponseDto[]; }>("/tags", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `tag.create` permission. */ -export function createTag({ tagCreateDto }: { +export function createTag( + { + tagCreateDto, + }: { tagCreateDto: TagCreateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: TagResponseDto; - }>("/tags", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: TagResponseDto; + }>( + "/tags", + oazapfts.json({ ...opts, method: "POST", - body: tagCreateDto - }))); + body: tagCreateDto, + }), + ), + ); } /** * This endpoint requires the `tag.create` permission. */ -export function upsertTags({ tagUpsertDto }: { +export function upsertTags( + { + tagUpsertDto, + }: { tagUpsertDto: TagUpsertDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TagResponseDto[]; - }>("/tags", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TagResponseDto[]; + }>( + "/tags", + oazapfts.json({ ...opts, method: "PUT", - body: tagUpsertDto - }))); + body: tagUpsertDto, + }), + ), + ); } /** * This endpoint requires the `tag.asset` permission. */ -export function bulkTagAssets({ tagBulkAssetsDto }: { +export function bulkTagAssets( + { + tagBulkAssetsDto, + }: { tagBulkAssetsDto: TagBulkAssetsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TagBulkAssetsResponseDto; - }>("/tags/assets", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TagBulkAssetsResponseDto; + }>( + "/tags/assets", + oazapfts.json({ ...opts, method: "PUT", - body: tagBulkAssetsDto - }))); + body: tagBulkAssetsDto, + }), + ), + ); } /** * This endpoint requires the `tag.delete` permission. */ -export function deleteTag({ id }: { +export function deleteTag( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText(`/tags/${encodeURIComponent(id)}`, { - ...opts, - method: "DELETE" - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchText(`/tags/${encodeURIComponent(id)}`, { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `tag.read` permission. */ -export function getTagById({ id }: { +export function getTagById( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TagResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TagResponseDto; }>(`/tags/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `tag.update` permission. */ -export function updateTag({ id, tagUpdateDto }: { +export function updateTag( + { + id, + tagUpdateDto, + }: { id: string; tagUpdateDto: TagUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TagResponseDto; - }>(`/tags/${encodeURIComponent(id)}`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TagResponseDto; + }>( + `/tags/${encodeURIComponent(id)}`, + oazapfts.json({ ...opts, method: "PUT", - body: tagUpdateDto - }))); + body: tagUpdateDto, + }), + ), + ); } /** * This endpoint requires the `tag.asset` permission. */ -export function untagAssets({ id, bulkIdsDto }: { +export function untagAssets( + { + id, + bulkIdsDto, + }: { id: string; bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>(`/tags/${encodeURIComponent(id)}/assets`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + `/tags/${encodeURIComponent(id)}/assets`, + oazapfts.json({ ...opts, method: "DELETE", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `tag.asset` permission. */ -export function tagAssets({ id, bulkIdsDto }: { +export function tagAssets( + { + id, + bulkIdsDto, + }: { id: string; bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: BulkIdResponseDto[]; - }>(`/tags/${encodeURIComponent(id)}/assets`, oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: BulkIdResponseDto[]; + }>( + `/tags/${encodeURIComponent(id)}/assets`, + oazapfts.json({ ...opts, method: "PUT", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function getTimeBucket({ albumId, isFavorite, isTrashed, key, order, personId, slug, tagId, timeBucket, userId, visibility, withCoordinates, withPartners, withStacked }: { +export function getTimeBucket( + { + albumId, + isFavorite, + isTrashed, + key, + order, + personId, + slug, + tagId, + timeBucket, + userId, + visibility, + withCoordinates, + withPartners, + withStacked, + }: { albumId?: string; isFavorite?: boolean; isTrashed?: boolean; @@ -4316,33 +6048,57 @@ export function getTimeBucket({ albumId, isFavorite, isTrashed, key, order, pers withCoordinates?: boolean; withPartners?: boolean; withStacked?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TimeBucketAssetResponseDto; - }>(`/timeline/bucket${QS.query(QS.explode({ - albumId, - isFavorite, - isTrashed, - key, - order, - personId, - slug, - tagId, - timeBucket, - userId, - visibility, - withCoordinates, - withPartners, - withStacked - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TimeBucketAssetResponseDto; + }>( + `/timeline/bucket${QS.query( + QS.explode({ + albumId, + isFavorite, + isTrashed, + key, + order, + personId, + slug, + tagId, + timeBucket, + userId, + visibility, + withCoordinates, + withPartners, + withStacked, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.read` permission. */ -export function getTimeBuckets({ albumId, isFavorite, isTrashed, key, order, personId, slug, tagId, userId, visibility, withCoordinates, withPartners, withStacked }: { +export function getTimeBuckets( + { + albumId, + isFavorite, + isTrashed, + key, + order, + personId, + slug, + tagId, + userId, + visibility, + withCoordinates, + withPartners, + withStacked, + }: { albumId?: string; isFavorite?: boolean; isTrashed?: boolean; @@ -4356,687 +6112,804 @@ export function getTimeBuckets({ albumId, isFavorite, isTrashed, key, order, per withCoordinates?: boolean; withPartners?: boolean; withStacked?: boolean; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TimeBucketsResponseDto[]; - }>(`/timeline/buckets${QS.query(QS.explode({ - albumId, - isFavorite, - isTrashed, - key, - order, - personId, - slug, - tagId, - userId, - visibility, - withCoordinates, - withPartners, - withStacked - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TimeBucketsResponseDto[]; + }>( + `/timeline/buckets${QS.query( + QS.explode({ + albumId, + isFavorite, + isTrashed, + key, + order, + personId, + slug, + tagId, + userId, + visibility, + withCoordinates, + withPartners, + withStacked, + }), + )}`, + { + ...opts, + }, + ), + ); } /** * This endpoint requires the `asset.delete` permission. */ export function emptyTrash(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TrashResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TrashResponseDto; }>("/trash/empty", { - ...opts, - method: "POST" - })); + ...opts, + method: "POST", + }), + ); } /** * This endpoint requires the `asset.delete` permission. */ export function restoreTrash(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TrashResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TrashResponseDto; }>("/trash/restore", { - ...opts, - method: "POST" - })); + ...opts, + method: "POST", + }), + ); } /** * This endpoint requires the `asset.delete` permission. */ -export function restoreAssets({ bulkIdsDto }: { +export function restoreAssets( + { + bulkIdsDto, + }: { bulkIdsDto: BulkIdsDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: TrashResponseDto; - }>("/trash/restore/assets", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: TrashResponseDto; + }>( + "/trash/restore/assets", + oazapfts.json({ ...opts, method: "POST", - body: bulkIdsDto - }))); + body: bulkIdsDto, + }), + ), + ); } /** * This endpoint requires the `user.read` permission. */ export function searchUsers(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserResponseDto[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserResponseDto[]; }>("/users", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `user.read` permission. */ export function getMyUser(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; }>("/users/me", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `user.update` permission. */ -export function updateMyUser({ userUpdateMeDto }: { +export function updateMyUser( + { + userUpdateMeDto, + }: { userUpdateMeDto: UserUpdateMeDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserAdminResponseDto; - }>("/users/me", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserAdminResponseDto; + }>( + "/users/me", + oazapfts.json({ ...opts, method: "PUT", - body: userUpdateMeDto - }))); + body: userUpdateMeDto, + }), + ), + ); } /** * This endpoint requires the `userLicense.delete` permission. */ export function deleteUserLicense(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/users/me/license", { - ...opts, - method: "DELETE" - })); + return oazapfts.ok( + oazapfts.fetchText("/users/me/license", { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `userLicense.read` permission. */ export function getUserLicense(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LicenseResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LicenseResponseDto; }>("/users/me/license", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `userLicense.update` permission. */ -export function setUserLicense({ licenseKeyDto }: { +export function setUserLicense( + { + licenseKeyDto, + }: { licenseKeyDto: LicenseKeyDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: LicenseResponseDto; - }>("/users/me/license", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: LicenseResponseDto; + }>( + "/users/me/license", + oazapfts.json({ ...opts, method: "PUT", - body: licenseKeyDto - }))); + body: licenseKeyDto, + }), + ), + ); } /** * This endpoint requires the `userOnboarding.delete` permission. */ export function deleteUserOnboarding(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/users/me/onboarding", { - ...opts, - method: "DELETE" - })); + return oazapfts.ok( + oazapfts.fetchText("/users/me/onboarding", { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `userOnboarding.read` permission. */ export function getUserOnboarding(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: OnboardingResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: OnboardingResponseDto; }>("/users/me/onboarding", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `userOnboarding.update` permission. */ -export function setUserOnboarding({ onboardingDto }: { +export function setUserOnboarding( + { + onboardingDto, + }: { onboardingDto: OnboardingDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: OnboardingResponseDto; - }>("/users/me/onboarding", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: OnboardingResponseDto; + }>( + "/users/me/onboarding", + oazapfts.json({ ...opts, method: "PUT", - body: onboardingDto - }))); + body: onboardingDto, + }), + ), + ); } /** * This endpoint requires the `userPreference.read` permission. */ export function getMyPreferences(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserPreferencesResponseDto; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserPreferencesResponseDto; }>("/users/me/preferences", { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `userPreference.update` permission. */ -export function updateMyPreferences({ userPreferencesUpdateDto }: { +export function updateMyPreferences( + { + userPreferencesUpdateDto, + }: { userPreferencesUpdateDto: UserPreferencesUpdateDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserPreferencesResponseDto; - }>("/users/me/preferences", oazapfts.json({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserPreferencesResponseDto; + }>( + "/users/me/preferences", + oazapfts.json({ ...opts, method: "PUT", - body: userPreferencesUpdateDto - }))); + body: userPreferencesUpdateDto, + }), + ), + ); } /** * This endpoint requires the `userProfileImage.delete` permission. */ export function deleteProfileImage(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchText("/users/profile-image", { - ...opts, - method: "DELETE" - })); + return oazapfts.ok( + oazapfts.fetchText("/users/profile-image", { + ...opts, + method: "DELETE", + }), + ); } /** * This endpoint requires the `userProfileImage.update` permission. */ -export function createProfileImage({ createProfileImageDto }: { +export function createProfileImage( + { + createProfileImageDto, + }: { createProfileImageDto: CreateProfileImageDto; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 201; - data: CreateProfileImageResponseDto; - }>("/users/profile-image", oazapfts.multipart({ + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 201; + data: CreateProfileImageResponseDto; + }>( + "/users/profile-image", + oazapfts.multipart({ ...opts, method: "POST", - body: createProfileImageDto - }))); + body: createProfileImageDto, + }), + ), + ); } /** * This endpoint requires the `user.read` permission. */ -export function getUser({ id }: { +export function getUser( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: UserResponseDto; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: UserResponseDto; }>(`/users/${encodeURIComponent(id)}`, { - ...opts - })); + ...opts, + }), + ); } /** * This endpoint requires the `userProfileImage.read` permission. */ -export function getProfileImage({ id }: { +export function getProfileImage( + { + id, + }: { id: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchBlob<{ - status: 200; - data: Blob; + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchBlob<{ + status: 200; + data: Blob; }>(`/users/${encodeURIComponent(id)}/profile-image`, { - ...opts - })); + ...opts, + }), + ); } -export function getAssetsByOriginalPath({ path }: { +export function getAssetsByOriginalPath( + { + path, + }: { path: string; -}, opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto[]; - }>(`/view/folder${QS.query(QS.explode({ - path - }))}`, { - ...opts - })); + }, + opts?: Oazapfts.RequestOpts, +) { + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: AssetResponseDto[]; + }>( + `/view/folder${QS.query( + QS.explode({ + path, + }), + )}`, + { + ...opts, + }, + ), + ); } export function getUniqueOriginalPaths(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: string[]; + return oazapfts.ok( + oazapfts.fetchJson<{ + status: 200; + data: string[]; }>("/view/folder/unique-paths", { - ...opts - })); + ...opts, + }), + ); } export enum ReactionLevel { - Album = "album", - Asset = "asset" + Album = "album", + Asset = "asset", } export enum ReactionType { - Comment = "comment", - Like = "like" + Comment = "comment", + Like = "like", } export enum UserAvatarColor { - Primary = "primary", - Pink = "pink", - Red = "red", - Yellow = "yellow", - Blue = "blue", - Green = "green", - Purple = "purple", - Orange = "orange", - Gray = "gray", - Amber = "amber" + Primary = "primary", + Pink = "pink", + Red = "red", + Yellow = "yellow", + Blue = "blue", + Green = "green", + Purple = "purple", + Orange = "orange", + Gray = "gray", + Amber = "amber", } export enum NotificationLevel { - Success = "success", - Error = "error", - Warning = "warning", - Info = "info" + Success = "success", + Error = "error", + Warning = "warning", + Info = "info", } export enum NotificationType { - JobFailed = "JobFailed", - BackupFailed = "BackupFailed", - SystemMessage = "SystemMessage", - Custom = "Custom" + JobFailed = "JobFailed", + BackupFailed = "BackupFailed", + SystemMessage = "SystemMessage", + Custom = "Custom", } export enum UserStatus { - Active = "active", - Removing = "removing", - Deleted = "deleted" + Active = "active", + Removing = "removing", + Deleted = "deleted", } export enum AssetOrder { - Asc = "asc", - Desc = "desc" + Asc = "asc", + Desc = "desc", } export enum AssetVisibility { - Archive = "archive", - Timeline = "timeline", - Hidden = "hidden", - Locked = "locked" + Archive = "archive", + Timeline = "timeline", + Hidden = "hidden", + Locked = "locked", } export enum AlbumUserRole { - Editor = "editor", - Viewer = "viewer" + Editor = "editor", + Viewer = "viewer", } export enum SourceType { - MachineLearning = "machine-learning", - Exif = "exif", - Manual = "manual" + MachineLearning = "machine-learning", + Exif = "exif", + Manual = "manual", } export enum AssetTypeEnum { - Image = "IMAGE", - Video = "VIDEO", - Audio = "AUDIO", - Other = "OTHER" + Image = "IMAGE", + Video = "VIDEO", + Audio = "AUDIO", + Other = "OTHER", } export enum BulkIdErrorReason { - Duplicate = "duplicate", - NoPermission = "no_permission", - NotFound = "not_found", - Unknown = "unknown" + Duplicate = "duplicate", + NoPermission = "no_permission", + NotFound = "not_found", + Unknown = "unknown", } export enum Error { - Duplicate = "duplicate", - NoPermission = "no_permission", - NotFound = "not_found", - Unknown = "unknown" + Duplicate = "duplicate", + NoPermission = "no_permission", + NotFound = "not_found", + Unknown = "unknown", } export enum Permission { - All = "all", - ActivityCreate = "activity.create", - ActivityRead = "activity.read", - ActivityUpdate = "activity.update", - ActivityDelete = "activity.delete", - ActivityStatistics = "activity.statistics", - ApiKeyCreate = "apiKey.create", - ApiKeyRead = "apiKey.read", - ApiKeyUpdate = "apiKey.update", - ApiKeyDelete = "apiKey.delete", - AssetRead = "asset.read", - AssetUpdate = "asset.update", - AssetDelete = "asset.delete", - AssetStatistics = "asset.statistics", - AssetShare = "asset.share", - AssetView = "asset.view", - AssetDownload = "asset.download", - AssetUpload = "asset.upload", - AssetReplace = "asset.replace", - AlbumCreate = "album.create", - AlbumRead = "album.read", - AlbumUpdate = "album.update", - AlbumDelete = "album.delete", - AlbumStatistics = "album.statistics", - AlbumShare = "album.share", - AlbumDownload = "album.download", - AlbumAssetCreate = "albumAsset.create", - AlbumAssetDelete = "albumAsset.delete", - AlbumUserCreate = "albumUser.create", - AlbumUserUpdate = "albumUser.update", - AlbumUserDelete = "albumUser.delete", - AuthChangePassword = "auth.changePassword", - AuthDeviceDelete = "authDevice.delete", - ArchiveRead = "archive.read", - DuplicateRead = "duplicate.read", - DuplicateDelete = "duplicate.delete", - FaceCreate = "face.create", - FaceRead = "face.read", - FaceUpdate = "face.update", - FaceDelete = "face.delete", - JobCreate = "job.create", - JobRead = "job.read", - LibraryCreate = "library.create", - LibraryRead = "library.read", - LibraryUpdate = "library.update", - LibraryDelete = "library.delete", - LibraryStatistics = "library.statistics", - TimelineRead = "timeline.read", - TimelineDownload = "timeline.download", - MemoryCreate = "memory.create", - MemoryRead = "memory.read", - MemoryUpdate = "memory.update", - MemoryDelete = "memory.delete", - MemoryStatistics = "memory.statistics", - MemoryAssetCreate = "memoryAsset.create", - MemoryAssetDelete = "memoryAsset.delete", - NotificationCreate = "notification.create", - NotificationRead = "notification.read", - NotificationUpdate = "notification.update", - NotificationDelete = "notification.delete", - PartnerCreate = "partner.create", - PartnerRead = "partner.read", - PartnerUpdate = "partner.update", - PartnerDelete = "partner.delete", - PersonCreate = "person.create", - PersonRead = "person.read", - PersonUpdate = "person.update", - PersonDelete = "person.delete", - PersonStatistics = "person.statistics", - PersonMerge = "person.merge", - PersonReassign = "person.reassign", - PinCodeCreate = "pinCode.create", - PinCodeUpdate = "pinCode.update", - PinCodeDelete = "pinCode.delete", - ServerAbout = "server.about", - ServerApkLinks = "server.apkLinks", - ServerStorage = "server.storage", - ServerStatistics = "server.statistics", - ServerVersionCheck = "server.versionCheck", - ServerLicenseRead = "serverLicense.read", - ServerLicenseUpdate = "serverLicense.update", - ServerLicenseDelete = "serverLicense.delete", - SessionCreate = "session.create", - SessionRead = "session.read", - SessionUpdate = "session.update", - SessionDelete = "session.delete", - SessionLock = "session.lock", - SharedLinkCreate = "sharedLink.create", - SharedLinkRead = "sharedLink.read", - SharedLinkUpdate = "sharedLink.update", - SharedLinkDelete = "sharedLink.delete", - StackCreate = "stack.create", - StackRead = "stack.read", - StackUpdate = "stack.update", - StackDelete = "stack.delete", - SyncStream = "sync.stream", - SyncCheckpointRead = "syncCheckpoint.read", - SyncCheckpointUpdate = "syncCheckpoint.update", - SyncCheckpointDelete = "syncCheckpoint.delete", - SystemConfigRead = "systemConfig.read", - SystemConfigUpdate = "systemConfig.update", - SystemMetadataRead = "systemMetadata.read", - SystemMetadataUpdate = "systemMetadata.update", - TagCreate = "tag.create", - TagRead = "tag.read", - TagUpdate = "tag.update", - TagDelete = "tag.delete", - TagAsset = "tag.asset", - UserRead = "user.read", - UserUpdate = "user.update", - UserLicenseCreate = "userLicense.create", - UserLicenseRead = "userLicense.read", - UserLicenseUpdate = "userLicense.update", - UserLicenseDelete = "userLicense.delete", - UserOnboardingRead = "userOnboarding.read", - UserOnboardingUpdate = "userOnboarding.update", - UserOnboardingDelete = "userOnboarding.delete", - UserPreferenceRead = "userPreference.read", - UserPreferenceUpdate = "userPreference.update", - UserProfileImageCreate = "userProfileImage.create", - UserProfileImageRead = "userProfileImage.read", - UserProfileImageUpdate = "userProfileImage.update", - UserProfileImageDelete = "userProfileImage.delete", - AdminUserCreate = "adminUser.create", - AdminUserRead = "adminUser.read", - AdminUserUpdate = "adminUser.update", - AdminUserDelete = "adminUser.delete", - AdminAuthUnlinkAll = "adminAuth.unlinkAll" + All = "all", + ActivityCreate = "activity.create", + ActivityRead = "activity.read", + ActivityUpdate = "activity.update", + ActivityDelete = "activity.delete", + ActivityStatistics = "activity.statistics", + ApiKeyCreate = "apiKey.create", + ApiKeyRead = "apiKey.read", + ApiKeyUpdate = "apiKey.update", + ApiKeyDelete = "apiKey.delete", + AssetRead = "asset.read", + AssetUpdate = "asset.update", + AssetDelete = "asset.delete", + AssetStatistics = "asset.statistics", + AssetShare = "asset.share", + AssetView = "asset.view", + AssetDownload = "asset.download", + AssetUpload = "asset.upload", + AssetReplace = "asset.replace", + AlbumCreate = "album.create", + AlbumRead = "album.read", + AlbumUpdate = "album.update", + AlbumDelete = "album.delete", + AlbumStatistics = "album.statistics", + AlbumShare = "album.share", + AlbumDownload = "album.download", + AlbumAssetCreate = "albumAsset.create", + AlbumAssetDelete = "albumAsset.delete", + AlbumUserCreate = "albumUser.create", + AlbumUserUpdate = "albumUser.update", + AlbumUserDelete = "albumUser.delete", + AuthChangePassword = "auth.changePassword", + AuthDeviceDelete = "authDevice.delete", + ArchiveRead = "archive.read", + DuplicateRead = "duplicate.read", + DuplicateDelete = "duplicate.delete", + FaceCreate = "face.create", + FaceRead = "face.read", + FaceUpdate = "face.update", + FaceDelete = "face.delete", + JobCreate = "job.create", + JobRead = "job.read", + LibraryCreate = "library.create", + LibraryRead = "library.read", + LibraryUpdate = "library.update", + LibraryDelete = "library.delete", + LibraryStatistics = "library.statistics", + TimelineRead = "timeline.read", + TimelineDownload = "timeline.download", + MemoryCreate = "memory.create", + MemoryRead = "memory.read", + MemoryUpdate = "memory.update", + MemoryDelete = "memory.delete", + MemoryStatistics = "memory.statistics", + MemoryAssetCreate = "memoryAsset.create", + MemoryAssetDelete = "memoryAsset.delete", + NotificationCreate = "notification.create", + NotificationRead = "notification.read", + NotificationUpdate = "notification.update", + NotificationDelete = "notification.delete", + PartnerCreate = "partner.create", + PartnerRead = "partner.read", + PartnerUpdate = "partner.update", + PartnerDelete = "partner.delete", + PersonCreate = "person.create", + PersonRead = "person.read", + PersonUpdate = "person.update", + PersonDelete = "person.delete", + PersonStatistics = "person.statistics", + PersonMerge = "person.merge", + PersonReassign = "person.reassign", + PinCodeCreate = "pinCode.create", + PinCodeUpdate = "pinCode.update", + PinCodeDelete = "pinCode.delete", + ServerAbout = "server.about", + ServerApkLinks = "server.apkLinks", + ServerStorage = "server.storage", + ServerStatistics = "server.statistics", + ServerVersionCheck = "server.versionCheck", + ServerLicenseRead = "serverLicense.read", + ServerLicenseUpdate = "serverLicense.update", + ServerLicenseDelete = "serverLicense.delete", + SessionCreate = "session.create", + SessionRead = "session.read", + SessionUpdate = "session.update", + SessionDelete = "session.delete", + SessionLock = "session.lock", + SharedLinkCreate = "sharedLink.create", + SharedLinkRead = "sharedLink.read", + SharedLinkUpdate = "sharedLink.update", + SharedLinkDelete = "sharedLink.delete", + StackCreate = "stack.create", + StackRead = "stack.read", + StackUpdate = "stack.update", + StackDelete = "stack.delete", + SyncStream = "sync.stream", + SyncCheckpointRead = "syncCheckpoint.read", + SyncCheckpointUpdate = "syncCheckpoint.update", + SyncCheckpointDelete = "syncCheckpoint.delete", + SystemConfigRead = "systemConfig.read", + SystemConfigUpdate = "systemConfig.update", + SystemMetadataRead = "systemMetadata.read", + SystemMetadataUpdate = "systemMetadata.update", + TagCreate = "tag.create", + TagRead = "tag.read", + TagUpdate = "tag.update", + TagDelete = "tag.delete", + TagAsset = "tag.asset", + UserRead = "user.read", + UserUpdate = "user.update", + UserLicenseCreate = "userLicense.create", + UserLicenseRead = "userLicense.read", + UserLicenseUpdate = "userLicense.update", + UserLicenseDelete = "userLicense.delete", + UserOnboardingRead = "userOnboarding.read", + UserOnboardingUpdate = "userOnboarding.update", + UserOnboardingDelete = "userOnboarding.delete", + UserPreferenceRead = "userPreference.read", + UserPreferenceUpdate = "userPreference.update", + UserProfileImageCreate = "userProfileImage.create", + UserProfileImageRead = "userProfileImage.read", + UserProfileImageUpdate = "userProfileImage.update", + UserProfileImageDelete = "userProfileImage.delete", + AdminUserCreate = "adminUser.create", + AdminUserRead = "adminUser.read", + AdminUserUpdate = "adminUser.update", + AdminUserDelete = "adminUser.delete", + AdminAuthUnlinkAll = "adminAuth.unlinkAll", } export enum AssetMetadataKey { - MobileApp = "mobile-app" + MobileApp = "mobile-app", } export enum AssetMediaStatus { - Created = "created", - Replaced = "replaced", - Duplicate = "duplicate" + Created = "created", + Replaced = "replaced", + Duplicate = "duplicate", } export enum Action { - Accept = "accept", - Reject = "reject" + Accept = "accept", + Reject = "reject", } export enum Reason { - Duplicate = "duplicate", - UnsupportedFormat = "unsupported-format" + Duplicate = "duplicate", + UnsupportedFormat = "unsupported-format", } export enum AssetJobName { - RefreshFaces = "refresh-faces", - RefreshMetadata = "refresh-metadata", - RegenerateThumbnail = "regenerate-thumbnail", - TranscodeVideo = "transcode-video" + RefreshFaces = "refresh-faces", + RefreshMetadata = "refresh-metadata", + RegenerateThumbnail = "regenerate-thumbnail", + TranscodeVideo = "transcode-video", } export enum AssetMediaSize { - Fullsize = "fullsize", - Preview = "preview", - Thumbnail = "thumbnail" + Fullsize = "fullsize", + Preview = "preview", + Thumbnail = "thumbnail", } export enum ManualJobName { - PersonCleanup = "person-cleanup", - TagCleanup = "tag-cleanup", - UserCleanup = "user-cleanup", - MemoryCleanup = "memory-cleanup", - MemoryCreate = "memory-create", - BackupDatabase = "backup-database" + PersonCleanup = "person-cleanup", + TagCleanup = "tag-cleanup", + UserCleanup = "user-cleanup", + MemoryCleanup = "memory-cleanup", + MemoryCreate = "memory-create", + BackupDatabase = "backup-database", } export enum JobName { - ThumbnailGeneration = "thumbnailGeneration", - MetadataExtraction = "metadataExtraction", - VideoConversion = "videoConversion", - FaceDetection = "faceDetection", - FacialRecognition = "facialRecognition", - SmartSearch = "smartSearch", - DuplicateDetection = "duplicateDetection", - BackgroundTask = "backgroundTask", - StorageTemplateMigration = "storageTemplateMigration", - Migration = "migration", - Search = "search", - Sidecar = "sidecar", - Library = "library", - Notifications = "notifications", - BackupDatabase = "backupDatabase" + ThumbnailGeneration = "thumbnailGeneration", + MetadataExtraction = "metadataExtraction", + VideoConversion = "videoConversion", + FaceDetection = "faceDetection", + FacialRecognition = "facialRecognition", + SmartSearch = "smartSearch", + DuplicateDetection = "duplicateDetection", + BackgroundTask = "backgroundTask", + StorageTemplateMigration = "storageTemplateMigration", + Migration = "migration", + Search = "search", + Sidecar = "sidecar", + Library = "library", + Notifications = "notifications", + BackupDatabase = "backupDatabase", } export enum JobCommand { - Start = "start", - Pause = "pause", - Resume = "resume", - Empty = "empty", - ClearFailed = "clear-failed" + Start = "start", + Pause = "pause", + Resume = "resume", + Empty = "empty", + ClearFailed = "clear-failed", } export enum MemoryType { - OnThisDay = "on_this_day" + OnThisDay = "on_this_day", } export enum PartnerDirection { - SharedBy = "shared-by", - SharedWith = "shared-with" + SharedBy = "shared-by", + SharedWith = "shared-with", } export enum SearchSuggestionType { - Country = "country", - State = "state", - City = "city", - CameraMake = "camera-make", - CameraModel = "camera-model" + Country = "country", + State = "state", + City = "city", + CameraMake = "camera-make", + CameraModel = "camera-model", } export enum SharedLinkType { - Album = "ALBUM", - Individual = "INDIVIDUAL" + Album = "ALBUM", + Individual = "INDIVIDUAL", } export enum Error2 { - Duplicate = "duplicate", - NoPermission = "no_permission", - NotFound = "not_found" + Duplicate = "duplicate", + NoPermission = "no_permission", + NotFound = "not_found", } export enum SyncEntityType { - AuthUserV1 = "AuthUserV1", - UserV1 = "UserV1", - UserDeleteV1 = "UserDeleteV1", - AssetV1 = "AssetV1", - AssetDeleteV1 = "AssetDeleteV1", - AssetExifV1 = "AssetExifV1", - AssetMetadataV1 = "AssetMetadataV1", - AssetMetadataDeleteV1 = "AssetMetadataDeleteV1", - PartnerV1 = "PartnerV1", - PartnerDeleteV1 = "PartnerDeleteV1", - PartnerAssetV1 = "PartnerAssetV1", - PartnerAssetBackfillV1 = "PartnerAssetBackfillV1", - PartnerAssetDeleteV1 = "PartnerAssetDeleteV1", - PartnerAssetExifV1 = "PartnerAssetExifV1", - PartnerAssetExifBackfillV1 = "PartnerAssetExifBackfillV1", - PartnerStackBackfillV1 = "PartnerStackBackfillV1", - PartnerStackDeleteV1 = "PartnerStackDeleteV1", - PartnerStackV1 = "PartnerStackV1", - AlbumV1 = "AlbumV1", - AlbumDeleteV1 = "AlbumDeleteV1", - AlbumUserV1 = "AlbumUserV1", - AlbumUserBackfillV1 = "AlbumUserBackfillV1", - AlbumUserDeleteV1 = "AlbumUserDeleteV1", - AlbumAssetCreateV1 = "AlbumAssetCreateV1", - AlbumAssetUpdateV1 = "AlbumAssetUpdateV1", - AlbumAssetBackfillV1 = "AlbumAssetBackfillV1", - AlbumAssetExifCreateV1 = "AlbumAssetExifCreateV1", - AlbumAssetExifUpdateV1 = "AlbumAssetExifUpdateV1", - AlbumAssetExifBackfillV1 = "AlbumAssetExifBackfillV1", - AlbumToAssetV1 = "AlbumToAssetV1", - AlbumToAssetDeleteV1 = "AlbumToAssetDeleteV1", - AlbumToAssetBackfillV1 = "AlbumToAssetBackfillV1", - MemoryV1 = "MemoryV1", - MemoryDeleteV1 = "MemoryDeleteV1", - MemoryToAssetV1 = "MemoryToAssetV1", - MemoryToAssetDeleteV1 = "MemoryToAssetDeleteV1", - StackV1 = "StackV1", - StackDeleteV1 = "StackDeleteV1", - PersonV1 = "PersonV1", - PersonDeleteV1 = "PersonDeleteV1", - AssetFaceV1 = "AssetFaceV1", - AssetFaceDeleteV1 = "AssetFaceDeleteV1", - UserMetadataV1 = "UserMetadataV1", - UserMetadataDeleteV1 = "UserMetadataDeleteV1", - SyncAckV1 = "SyncAckV1", - SyncResetV1 = "SyncResetV1", - SyncCompleteV1 = "SyncCompleteV1" + AuthUserV1 = "AuthUserV1", + UserV1 = "UserV1", + UserDeleteV1 = "UserDeleteV1", + AssetV1 = "AssetV1", + AssetDeleteV1 = "AssetDeleteV1", + AssetExifV1 = "AssetExifV1", + AssetMetadataV1 = "AssetMetadataV1", + AssetMetadataDeleteV1 = "AssetMetadataDeleteV1", + PartnerV1 = "PartnerV1", + PartnerDeleteV1 = "PartnerDeleteV1", + PartnerAssetV1 = "PartnerAssetV1", + PartnerAssetBackfillV1 = "PartnerAssetBackfillV1", + PartnerAssetDeleteV1 = "PartnerAssetDeleteV1", + PartnerAssetExifV1 = "PartnerAssetExifV1", + PartnerAssetExifBackfillV1 = "PartnerAssetExifBackfillV1", + PartnerStackBackfillV1 = "PartnerStackBackfillV1", + PartnerStackDeleteV1 = "PartnerStackDeleteV1", + PartnerStackV1 = "PartnerStackV1", + AlbumV1 = "AlbumV1", + AlbumDeleteV1 = "AlbumDeleteV1", + AlbumUserV1 = "AlbumUserV1", + AlbumUserBackfillV1 = "AlbumUserBackfillV1", + AlbumUserDeleteV1 = "AlbumUserDeleteV1", + AlbumAssetCreateV1 = "AlbumAssetCreateV1", + AlbumAssetUpdateV1 = "AlbumAssetUpdateV1", + AlbumAssetBackfillV1 = "AlbumAssetBackfillV1", + AlbumAssetExifCreateV1 = "AlbumAssetExifCreateV1", + AlbumAssetExifUpdateV1 = "AlbumAssetExifUpdateV1", + AlbumAssetExifBackfillV1 = "AlbumAssetExifBackfillV1", + AlbumToAssetV1 = "AlbumToAssetV1", + AlbumToAssetDeleteV1 = "AlbumToAssetDeleteV1", + AlbumToAssetBackfillV1 = "AlbumToAssetBackfillV1", + MemoryV1 = "MemoryV1", + MemoryDeleteV1 = "MemoryDeleteV1", + MemoryToAssetV1 = "MemoryToAssetV1", + MemoryToAssetDeleteV1 = "MemoryToAssetDeleteV1", + StackV1 = "StackV1", + StackDeleteV1 = "StackDeleteV1", + PersonV1 = "PersonV1", + PersonDeleteV1 = "PersonDeleteV1", + AssetFaceV1 = "AssetFaceV1", + AssetFaceDeleteV1 = "AssetFaceDeleteV1", + UserMetadataV1 = "UserMetadataV1", + UserMetadataDeleteV1 = "UserMetadataDeleteV1", + SyncAckV1 = "SyncAckV1", + SyncResetV1 = "SyncResetV1", + SyncCompleteV1 = "SyncCompleteV1", } export enum SyncRequestType { - AlbumsV1 = "AlbumsV1", - AlbumUsersV1 = "AlbumUsersV1", - AlbumToAssetsV1 = "AlbumToAssetsV1", - AlbumAssetsV1 = "AlbumAssetsV1", - AlbumAssetExifsV1 = "AlbumAssetExifsV1", - AssetsV1 = "AssetsV1", - AssetExifsV1 = "AssetExifsV1", - AssetMetadataV1 = "AssetMetadataV1", - AuthUsersV1 = "AuthUsersV1", - MemoriesV1 = "MemoriesV1", - MemoryToAssetsV1 = "MemoryToAssetsV1", - PartnersV1 = "PartnersV1", - PartnerAssetsV1 = "PartnerAssetsV1", - PartnerAssetExifsV1 = "PartnerAssetExifsV1", - PartnerStacksV1 = "PartnerStacksV1", - StacksV1 = "StacksV1", - UsersV1 = "UsersV1", - PeopleV1 = "PeopleV1", - AssetFacesV1 = "AssetFacesV1", - UserMetadataV1 = "UserMetadataV1" + AlbumsV1 = "AlbumsV1", + AlbumUsersV1 = "AlbumUsersV1", + AlbumToAssetsV1 = "AlbumToAssetsV1", + AlbumAssetsV1 = "AlbumAssetsV1", + AlbumAssetExifsV1 = "AlbumAssetExifsV1", + AssetsV1 = "AssetsV1", + AssetExifsV1 = "AssetExifsV1", + AssetMetadataV1 = "AssetMetadataV1", + AuthUsersV1 = "AuthUsersV1", + MemoriesV1 = "MemoriesV1", + MemoryToAssetsV1 = "MemoryToAssetsV1", + PartnersV1 = "PartnersV1", + PartnerAssetsV1 = "PartnerAssetsV1", + PartnerAssetExifsV1 = "PartnerAssetExifsV1", + PartnerStacksV1 = "PartnerStacksV1", + StacksV1 = "StacksV1", + UsersV1 = "UsersV1", + PeopleV1 = "PeopleV1", + AssetFacesV1 = "AssetFacesV1", + UserMetadataV1 = "UserMetadataV1", } export enum TranscodeHWAccel { - Nvenc = "nvenc", - Qsv = "qsv", - Vaapi = "vaapi", - Rkmpp = "rkmpp", - Disabled = "disabled" + Nvenc = "nvenc", + Qsv = "qsv", + Vaapi = "vaapi", + Rkmpp = "rkmpp", + Disabled = "disabled", } export enum AudioCodec { - Mp3 = "mp3", - Aac = "aac", - Libopus = "libopus", - PcmS16Le = "pcm_s16le" + Mp3 = "mp3", + Aac = "aac", + Libopus = "libopus", + PcmS16Le = "pcm_s16le", } export enum VideoContainer { - Mov = "mov", - Mp4 = "mp4", - Ogg = "ogg", - Webm = "webm" + Mov = "mov", + Mp4 = "mp4", + Ogg = "ogg", + Webm = "webm", } export enum VideoCodec { - H264 = "h264", - Hevc = "hevc", - Vp9 = "vp9", - Av1 = "av1" + H264 = "h264", + Hevc = "hevc", + Vp9 = "vp9", + Av1 = "av1", } export enum CQMode { - Auto = "auto", - Cqp = "cqp", - Icq = "icq" + Auto = "auto", + Cqp = "cqp", + Icq = "icq", } export enum ToneMapping { - Hable = "hable", - Mobius = "mobius", - Reinhard = "reinhard", - Disabled = "disabled" + Hable = "hable", + Mobius = "mobius", + Reinhard = "reinhard", + Disabled = "disabled", } export enum TranscodePolicy { - All = "all", - Optimal = "optimal", - Bitrate = "bitrate", - Required = "required", - Disabled = "disabled" + All = "all", + Optimal = "optimal", + Bitrate = "bitrate", + Required = "required", + Disabled = "disabled", } export enum Colorspace { - Srgb = "srgb", - P3 = "p3" + Srgb = "srgb", + P3 = "p3", } export enum ImageFormat { - Jpeg = "jpeg", - Webp = "webp" + Jpeg = "jpeg", + Webp = "webp", } export enum LogLevel { - Verbose = "verbose", - Debug = "debug", - Log = "log", - Warn = "warn", - Error = "error", - Fatal = "fatal" + Verbose = "verbose", + Debug = "debug", + Log = "log", + Warn = "warn", + Error = "error", + Fatal = "fatal", } export enum OAuthTokenEndpointAuthMethod { - ClientSecretPost = "client_secret_post", - ClientSecretBasic = "client_secret_basic" + ClientSecretPost = "client_secret_post", + ClientSecretBasic = "client_secret_basic", } diff --git a/server/src/database.ts b/server/src/database.ts index f472c643ee..bd9b00d34e 100644 --- a/server/src/database.ts +++ b/server/src/database.ts @@ -215,6 +215,7 @@ export type Partner = { updatedAt: Date; updateId: string; inTimeline: boolean; + startDate: Date | null; }; export type Place = { diff --git a/server/src/dtos/partner.dto.ts b/server/src/dtos/partner.dto.ts index 599213f662..7703f3b64d 100644 --- a/server/src/dtos/partner.dto.ts +++ b/server/src/dtos/partner.dto.ts @@ -1,16 +1,22 @@ import { IsNotEmpty } from 'class-validator'; import { UserResponseDto } from 'src/dtos/user.dto'; import { PartnerDirection } from 'src/repositories/partner.repository'; -import { ValidateEnum, ValidateUUID } from 'src/validation'; +import { ValidateDate, ValidateEnum, ValidateUUID } from 'src/validation'; export class PartnerCreateDto { @ValidateUUID() sharedWithId!: string; + + @ValidateDate({ optional: true, nullable: true, format: 'date-time' }) + startDate?: Date | null; } export class PartnerUpdateDto { @IsNotEmpty() inTimeline!: boolean; + + @ValidateDate({ optional: true, nullable: true, format: 'date-time' }) + startDate?: Date | null; } export class PartnerSearchDto { @@ -20,4 +26,5 @@ export class PartnerSearchDto { export class PartnerResponseDto extends UserResponseDto { inTimeline?: boolean; + startDate?: Date | null; } diff --git a/server/src/repositories/access.repository.ts b/server/src/repositories/access.repository.ts index ca12ff040b..16bbba3d65 100644 --- a/server/src/repositories/access.repository.ts +++ b/server/src/repositories/access.repository.ts @@ -207,7 +207,14 @@ class AssetAccess { eb('asset.visibility', '=', sql.lit(AssetVisibility.Hidden)), ]), ) - + .$if(true, (qb) => + qb.where((eb) => + eb.or([ + eb('partner.startDate', 'is', null), + eb('asset.localDateTime', '>=', eb.ref('partner.startDate')), + ]), + ), + ) .where('asset.id', 'in', [...assetIds]) .execute() .then((assets) => new Set(assets.map((asset) => asset.id))); diff --git a/server/src/repositories/asset.repository.ts b/server/src/repositories/asset.repository.ts index 5c3bd8996c..76dc42daf2 100644 --- a/server/src/repositories/asset.repository.ts +++ b/server/src/repositories/asset.repository.ts @@ -542,6 +542,25 @@ export class AssetRepository { .$call(withExif) .$call(withDefaultVisibility) .where('ownerId', '=', anyUuid(userIds)) + .$if(userIds.length > 1, (qb) => + qb + .leftJoin('partner', (join) => + join + .onRef('partner.sharedById', '=', 'asset.ownerId') + .on((eb) => + eb.or( + userIds.map((uid) => eb('partner.sharedWithId', '=', uid)) + ) + ) + ) + .where((eb) => + eb.or([ + eb('partner.startDate', 'is', null), + eb('partner.sharedById', 'is', null), + eb('asset.localDateTime', '>=', eb.ref('partner.startDate')), + ]) + ) + ) .where('deletedAt', 'is', null) .orderBy((eb) => eb.fn('random')) .limit(take) @@ -572,7 +591,29 @@ export class AssetRepository { ) .where((eb) => eb.or([eb('asset.stackId', 'is', null), eb(eb.table('stack'), 'is not', null)])), ) - .$if(!!options.userIds, (qb) => qb.where('asset.ownerId', '=', anyUuid(options.userIds!))) + .$if(!!options.userIds, (qb) => + qb + .where('asset.ownerId', '=', anyUuid(options.userIds!)) + .$if(options.userIds!.length > 1, (qb2) => + qb2 + .leftJoin('partner', (join) => + join + .onRef('partner.sharedById', '=', 'asset.ownerId') + .on((eb) => + eb.or( + options.userIds!.map((uid) => eb('partner.sharedWithId', '=', uid)) + ) + ) + ) + .where((eb) => + eb.or([ + eb('partner.startDate', 'is', null), + eb('partner.sharedById', 'is', null), + eb('asset.localDateTime', '>=', eb.ref('partner.startDate')), + ]) + ) + ) + ) .$if(options.isFavorite !== undefined, (qb) => qb.where('asset.isFavorite', '=', options.isFavorite!)) .$if(!!options.assetType, (qb) => qb.where('asset.type', '=', options.assetType!)) .$if(options.isDuplicate !== undefined, (qb) => @@ -645,7 +686,29 @@ export class AssetRepository { ), ) .$if(!!options.personId, (qb) => hasPeople(qb, [options.personId!])) - .$if(!!options.userIds, (qb) => qb.where('asset.ownerId', '=', anyUuid(options.userIds!))) + .$if(!!options.userIds, (qb) => + qb + .where('asset.ownerId', '=', anyUuid(options.userIds!)) + .$if(options.userIds!.length > 1, (qb2) => + qb2 + .leftJoin('partner', (join) => + join + .onRef('partner.sharedById', '=', 'asset.ownerId') + .on((eb) => + eb.or( + options.userIds!.map((uid) => eb('partner.sharedWithId', '=', uid)) + ) + ) + ) + .where((eb) => + eb.or([ + eb('partner.startDate', 'is', null), + eb('partner.sharedById', 'is', null), + eb('asset.localDateTime', '>=', eb.ref('partner.startDate')), + ]) + ) + ) + ) .$if(options.isFavorite !== undefined, (qb) => qb.where('asset.isFavorite', '=', options.isFavorite!)) .$if(!!options.withStacked, (qb) => qb @@ -804,6 +867,25 @@ export class AssetRepository { ) .select((eb) => eb.fn.toJson(eb.table('stacked_assets').$castTo()).as('stack')) .where('asset.ownerId', '=', anyUuid(options.userIds)) + .$if(options.userIds.length > 1, (qb) => + qb + .leftJoin('partner', (join) => + join + .onRef('partner.sharedById', '=', 'asset.ownerId') + .on((eb) => + eb.or( + options.userIds.map((uid) => eb('partner.sharedWithId', '=', uid)) + ) + ) + ) + .where((eb) => + eb.or([ + eb('partner.startDate', 'is', null), + eb('partner.sharedById', 'is', null), + eb('asset.localDateTime', '>=', eb.ref('partner.startDate')), + ]) + ) + ) .where('asset.visibility', '!=', AssetVisibility.Hidden) .where('asset.updatedAt', '>', options.updatedAfter) .limit(options.limit) diff --git a/server/src/schema/migrations/1760433605815-AddPartnerStartDate.ts b/server/src/schema/migrations/1760433605815-AddPartnerStartDate.ts new file mode 100644 index 0000000000..f724706903 --- /dev/null +++ b/server/src/schema/migrations/1760433605815-AddPartnerStartDate.ts @@ -0,0 +1,9 @@ +import { Kysely, sql } from 'kysely'; + +export async function up(db: Kysely): Promise { + await sql`ALTER TABLE "partner" ADD "startDate" timestamp with time zone;`.execute(db); +} + +export async function down(db: Kysely): Promise { + await sql`ALTER TABLE "partner" DROP COLUMN "startDate";`.execute(db); +} diff --git a/server/src/schema/tables/partner.table.ts b/server/src/schema/tables/partner.table.ts index 8fc332cb12..bf53332054 100644 --- a/server/src/schema/tables/partner.table.ts +++ b/server/src/schema/tables/partner.table.ts @@ -44,6 +44,9 @@ export class PartnerTable { @Column({ type: 'boolean', default: false }) inTimeline!: Generated; + @Column({ type: 'timestamp with time zone', nullable: true }) + startDate!: Timestamp | null; + @UpdateIdColumn({ index: true }) updateId!: Generated; } diff --git a/server/src/services/partner.service.spec.ts b/server/src/services/partner.service.spec.ts index db057a453a..95edb9d1b6 100644 --- a/server/src/services/partner.service.spec.ts +++ b/server/src/services/partner.service.spec.ts @@ -61,6 +61,25 @@ describe(PartnerService.name, () => { }); }); + it('should create a new partner with startDate', async () => { + const user1 = factory.user(); + const user2 = factory.user(); + const startDate = new Date('2024-01-01T00:00:00.000Z'); + const partner = factory.partner({ sharedBy: user1, sharedWith: user2, startDate }); + const auth = factory.auth({ user: { id: user1.id } }); + + mocks.partner.get.mockResolvedValue(void 0); + mocks.partner.create.mockResolvedValue(partner); + + await expect(sut.create(auth, { sharedWithId: user2.id, startDate })).resolves.toBeDefined(); + + expect(mocks.partner.create).toHaveBeenCalledWith({ + sharedById: partner.sharedById, + sharedWithId: partner.sharedWithId, + startDate, + }); + }); + it('should throw an error when the partner already exists', async () => { const user1 = factory.user(); const user2 = factory.user(); @@ -124,5 +143,22 @@ describe(PartnerService.name, () => { { inTimeline: true }, ); }); + + it('should update partner with startDate', async () => { + const user1 = factory.user(); + const user2 = factory.user(); + const startDate = new Date('2024-01-01T00:00:00.000Z'); + const partner = factory.partner({ sharedBy: user1, sharedWith: user2, startDate }); + const auth = factory.auth({ user: { id: user1.id } }); + + mocks.access.partner.checkUpdateAccess.mockResolvedValue(new Set([user2.id])); + mocks.partner.update.mockResolvedValue(partner); + + await expect(sut.update(auth, user2.id, { inTimeline: true, startDate })).resolves.toBeDefined(); + expect(mocks.partner.update).toHaveBeenCalledWith( + { sharedById: user2.id, sharedWithId: user1.id }, + { inTimeline: true, startDate }, + ); + }); }); }); diff --git a/server/src/services/partner.service.ts b/server/src/services/partner.service.ts index 628efa9d49..52463d02a5 100644 --- a/server/src/services/partner.service.ts +++ b/server/src/services/partner.service.ts @@ -9,14 +9,14 @@ import { BaseService } from 'src/services/base.service'; @Injectable() export class PartnerService extends BaseService { - async create(auth: AuthDto, { sharedWithId }: PartnerCreateDto): Promise { + async create(auth: AuthDto, { sharedWithId, startDate }: PartnerCreateDto): Promise { const partnerId: PartnerIds = { sharedById: auth.user.id, sharedWithId }; const exists = await this.partnerRepository.get(partnerId); if (exists) { throw new BadRequestException(`Partner already exists`); } - const partner = await this.partnerRepository.create(partnerId); + const partner = await this.partnerRepository.create({ ...partnerId, startDate: startDate || null }); return this.mapPartner(partner, PartnerDirection.SharedBy); } @@ -43,7 +43,12 @@ export class PartnerService extends BaseService { await this.requireAccess({ auth, permission: Permission.PartnerUpdate, ids: [sharedById] }); const partnerId: PartnerIds = { sharedById, sharedWithId: auth.user.id }; - const entity = await this.partnerRepository.update(partnerId, { inTimeline: dto.inTimeline }); + const updateData: { inTimeline: boolean; startDate?: Date | null } = { inTimeline: dto.inTimeline }; + if (dto.startDate !== undefined) { + updateData.startDate = dto.startDate; + } + + const entity = await this.partnerRepository.update(partnerId, updateData); return this.mapPartner(entity, PartnerDirection.SharedWith); } @@ -53,6 +58,6 @@ export class PartnerService extends BaseService { direction === PartnerDirection.SharedBy ? partner.sharedWith : partner.sharedBy, ) as PartnerResponseDto; - return { ...user, inTimeline: partner.inTimeline }; + return { ...user, inTimeline: partner.inTimeline, startDate: partner.startDate }; } }