diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index 9f4d765f2d..5a2445846a 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -1855,7 +1855,7 @@ export interface ImportAssetDto { * @type {boolean} * @memberof ImportAssetDto */ - 'isFavorite': boolean; + 'isFavorite'?: boolean; /** * * @type {boolean} @@ -7868,11 +7868,11 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {string} deviceId * @param {string} fileCreatedAt * @param {string} fileModifiedAt - * @param {boolean} isFavorite * @param {string} [key] * @param {string} [duration] * @param {boolean} [isArchived] * @param {boolean} [isExternal] + * @param {boolean} [isFavorite] * @param {boolean} [isOffline] * @param {boolean} [isReadOnly] * @param {boolean} [isVisible] @@ -7882,7 +7882,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise => { + uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'assetData' is not null or undefined assertParamExists('uploadFile', 'assetData', assetData) // verify required parameter 'deviceAssetId' is not null or undefined @@ -7893,8 +7893,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration assertParamExists('uploadFile', 'fileCreatedAt', fileCreatedAt) // verify required parameter 'fileModifiedAt' is not null or undefined assertParamExists('uploadFile', 'fileModifiedAt', fileModifiedAt) - // verify required parameter 'isFavorite' is not null or undefined - assertParamExists('uploadFile', 'isFavorite', isFavorite) const localVarPath = `/asset/upload`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -8335,11 +8333,11 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {string} deviceId * @param {string} fileCreatedAt * @param {string} fileModifiedAt - * @param {boolean} isFavorite * @param {string} [key] * @param {string} [duration] * @param {boolean} [isArchived] * @param {boolean} [isExternal] + * @param {boolean} [isFavorite] * @param {boolean} [isOffline] * @param {boolean} [isReadOnly] * @param {boolean} [isVisible] @@ -8349,8 +8347,8 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key, duration, isArchived, isExternal, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options); + async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -8626,7 +8624,7 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath)); }, }; }; @@ -9274,13 +9272,6 @@ export interface AssetApiUploadFileRequest { */ readonly fileModifiedAt: string - /** - * - * @type {boolean} - * @memberof AssetApiUploadFile - */ - readonly isFavorite: boolean - /** * * @type {string} @@ -9309,6 +9300,13 @@ export interface AssetApiUploadFileRequest { */ readonly isExternal?: boolean + /** + * + * @type {boolean} + * @memberof AssetApiUploadFile + */ + readonly isFavorite?: boolean + /** * * @type {boolean} @@ -9681,7 +9679,7 @@ export class AssetApi extends BaseAPI { * @memberof AssetApi */ public uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath)); + return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index cf50f659df..e072c3ded9 100644 Binary files a/mobile/openapi/doc/AssetApi.md and b/mobile/openapi/doc/AssetApi.md differ diff --git a/mobile/openapi/doc/ImportAssetDto.md b/mobile/openapi/doc/ImportAssetDto.md index c9a5f25d2d..3f2747edce 100644 Binary files a/mobile/openapi/doc/ImportAssetDto.md and b/mobile/openapi/doc/ImportAssetDto.md differ diff --git a/mobile/openapi/lib/api/asset_api.dart b/mobile/openapi/lib/api/asset_api.dart index b0e9c822d2..4b74d29333 100644 Binary files a/mobile/openapi/lib/api/asset_api.dart and b/mobile/openapi/lib/api/asset_api.dart differ diff --git a/mobile/openapi/lib/model/import_asset_dto.dart b/mobile/openapi/lib/model/import_asset_dto.dart index 66ee3faee2..7ba26da9d7 100644 Binary files a/mobile/openapi/lib/model/import_asset_dto.dart and b/mobile/openapi/lib/model/import_asset_dto.dart differ diff --git a/mobile/openapi/test/asset_api_test.dart b/mobile/openapi/test/asset_api_test.dart index 453982cf1e..179b23bbab 100644 Binary files a/mobile/openapi/test/asset_api_test.dart and b/mobile/openapi/test/asset_api_test.dart differ diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index 75a57043f0..1fb05fbcf5 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -6655,8 +6655,7 @@ "deviceAssetId", "deviceId", "fileCreatedAt", - "fileModifiedAt", - "isFavorite" + "fileModifiedAt" ], "type": "object" }, @@ -7143,8 +7142,7 @@ "deviceAssetId", "deviceId", "fileCreatedAt", - "fileModifiedAt", - "isFavorite" + "fileModifiedAt" ], "type": "object" }, diff --git a/server/src/immich/api-v1/asset/dto/create-asset.dto.ts b/server/src/immich/api-v1/asset/dto/create-asset.dto.ts index de1f7f1bb5..0338fe792f 100644 --- a/server/src/immich/api-v1/asset/dto/create-asset.dto.ts +++ b/server/src/immich/api-v1/asset/dto/create-asset.dto.ts @@ -22,9 +22,10 @@ export class CreateAssetBase { @Type(() => Date) fileModifiedAt!: Date; + @Optional() @IsBoolean() @Transform(toBoolean) - isFavorite!: boolean; + isFavorite?: boolean; @Optional() @IsBoolean() diff --git a/server/test/e2e/asset.e2e-spec.ts b/server/test/e2e/asset.e2e-spec.ts index b9b10e1044..a6f8f48e75 100644 --- a/server/test/e2e/asset.e2e-spec.ts +++ b/server/test/e2e/asset.e2e-spec.ts @@ -146,7 +146,6 @@ describe(`${AssetController.name} (e2e)`, () => { { should: 'require `deviceId`', dto: { ...makeUploadDto({ omit: 'deviceId' }) } }, { should: 'require `fileCreatedAt`', dto: { ...makeUploadDto({ omit: 'fileCreatedAt' }) } }, { should: 'require `fileModifiedAt`', dto: { ...makeUploadDto({ omit: 'fileModifiedAt' }) } }, - { should: 'require `isFavorite`', dto: { ...makeUploadDto({ omit: 'isFavorite' }) } }, { should: 'require `duration`', dto: { ...makeUploadDto({ omit: 'duration' }) } }, { should: 'throw if `isFavorite` is not a boolean', dto: { ...makeUploadDto(), isFavorite: 'not-a-boolean' } }, { should: 'throw if `isVisible` is not a boolean', dto: { ...makeUploadDto(), isVisible: 'not-a-boolean' } }, diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 9f4d765f2d..5a2445846a 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -1855,7 +1855,7 @@ export interface ImportAssetDto { * @type {boolean} * @memberof ImportAssetDto */ - 'isFavorite': boolean; + 'isFavorite'?: boolean; /** * * @type {boolean} @@ -7868,11 +7868,11 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {string} deviceId * @param {string} fileCreatedAt * @param {string} fileModifiedAt - * @param {boolean} isFavorite * @param {string} [key] * @param {string} [duration] * @param {boolean} [isArchived] * @param {boolean} [isExternal] + * @param {boolean} [isFavorite] * @param {boolean} [isOffline] * @param {boolean} [isReadOnly] * @param {boolean} [isVisible] @@ -7882,7 +7882,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise => { + uploadFile: async (assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'assetData' is not null or undefined assertParamExists('uploadFile', 'assetData', assetData) // verify required parameter 'deviceAssetId' is not null or undefined @@ -7893,8 +7893,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration assertParamExists('uploadFile', 'fileCreatedAt', fileCreatedAt) // verify required parameter 'fileModifiedAt' is not null or undefined assertParamExists('uploadFile', 'fileModifiedAt', fileModifiedAt) - // verify required parameter 'isFavorite' is not null or undefined - assertParamExists('uploadFile', 'isFavorite', isFavorite) const localVarPath = `/asset/upload`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -8335,11 +8333,11 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {string} deviceId * @param {string} fileCreatedAt * @param {string} fileModifiedAt - * @param {boolean} isFavorite * @param {string} [key] * @param {string} [duration] * @param {boolean} [isArchived] * @param {boolean} [isExternal] + * @param {boolean} [isFavorite] * @param {boolean} [isOffline] * @param {boolean} [isReadOnly] * @param {boolean} [isVisible] @@ -8349,8 +8347,8 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, isFavorite: boolean, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, isFavorite, key, duration, isArchived, isExternal, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options); + async uploadFile(assetData: File, deviceAssetId: string, deviceId: string, fileCreatedAt: string, fileModifiedAt: string, key?: string, duration?: string, isArchived?: boolean, isExternal?: boolean, isFavorite?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, libraryId?: string, livePhotoData?: File, sidecarData?: File, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -8626,7 +8624,7 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(axios, basePath)); }, }; }; @@ -9274,13 +9272,6 @@ export interface AssetApiUploadFileRequest { */ readonly fileModifiedAt: string - /** - * - * @type {boolean} - * @memberof AssetApiUploadFile - */ - readonly isFavorite: boolean - /** * * @type {string} @@ -9309,6 +9300,13 @@ export interface AssetApiUploadFileRequest { */ readonly isExternal?: boolean + /** + * + * @type {boolean} + * @memberof AssetApiUploadFile + */ + readonly isFavorite?: boolean + /** * * @type {boolean} @@ -9681,7 +9679,7 @@ export class AssetApi extends BaseAPI { * @memberof AssetApi */ public uploadFile(requestParameters: AssetApiUploadFileRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.isFavorite, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath)); + return AssetApiFp(this.configuration).uploadFile(requestParameters.assetData, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.fileCreatedAt, requestParameters.fileModifiedAt, requestParameters.key, requestParameters.duration, requestParameters.isArchived, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.libraryId, requestParameters.livePhotoData, requestParameters.sidecarData, options).then((request) => request(this.axios, this.basePath)); } }