diff --git a/mobile/openapi/.openapi-generator/FILES b/mobile/openapi/.openapi-generator/FILES index aeb3d49cb4..f42a9c82ca 100644 --- a/mobile/openapi/.openapi-generator/FILES +++ b/mobile/openapi/.openapi-generator/FILES @@ -90,6 +90,7 @@ doc/MapMarkerResponseDto.md doc/MapTheme.md doc/MemoryLaneResponseDto.md doc/MergePersonDto.md +doc/MetadataSearchDto.md doc/ModelType.md doc/OAuthApi.md doc/OAuthAuthorizeResponseDto.md @@ -137,6 +138,7 @@ doc/SharedLinkResponseDto.md doc/SharedLinkType.md doc/SignUpDto.md doc/SmartInfoResponseDto.md +doc/SmartSearchDto.md doc/SystemConfigApi.md doc/SystemConfigDto.md doc/SystemConfigFFmpegDto.md @@ -288,6 +290,7 @@ lib/model/map_marker_response_dto.dart lib/model/map_theme.dart lib/model/memory_lane_response_dto.dart lib/model/merge_person_dto.dart +lib/model/metadata_search_dto.dart lib/model/model_type.dart lib/model/o_auth_authorize_response_dto.dart lib/model/o_auth_callback_dto.dart @@ -329,6 +332,7 @@ lib/model/shared_link_response_dto.dart lib/model/shared_link_type.dart lib/model/sign_up_dto.dart lib/model/smart_info_response_dto.dart +lib/model/smart_search_dto.dart lib/model/system_config_dto.dart lib/model/system_config_f_fmpeg_dto.dart lib/model/system_config_job_dto.dart @@ -457,6 +461,7 @@ test/map_marker_response_dto_test.dart test/map_theme_test.dart test/memory_lane_response_dto_test.dart test/merge_person_dto_test.dart +test/metadata_search_dto_test.dart test/model_type_test.dart test/o_auth_api_test.dart test/o_auth_authorize_response_dto_test.dart @@ -504,6 +509,7 @@ test/shared_link_response_dto_test.dart test/shared_link_type_test.dart test/sign_up_dto_test.dart test/smart_info_response_dto_test.dart +test/smart_search_dto_test.dart test/system_config_api_test.dart test/system_config_dto_test.dart test/system_config_f_fmpeg_dto_test.dart diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 12d20ea13d..9e241b0a44 100644 Binary files a/mobile/openapi/README.md and b/mobile/openapi/README.md differ diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index 963e2e66c5..5691965bc7 100644 Binary files a/mobile/openapi/doc/AssetApi.md and b/mobile/openapi/doc/AssetApi.md differ diff --git a/mobile/openapi/doc/MetadataSearchDto.md b/mobile/openapi/doc/MetadataSearchDto.md new file mode 100644 index 0000000000..bfbf81749e Binary files /dev/null and b/mobile/openapi/doc/MetadataSearchDto.md differ diff --git a/mobile/openapi/doc/SearchApi.md b/mobile/openapi/doc/SearchApi.md index 8c924428f6..f975e94484 100644 Binary files a/mobile/openapi/doc/SearchApi.md and b/mobile/openapi/doc/SearchApi.md differ diff --git a/mobile/openapi/doc/SmartSearchDto.md b/mobile/openapi/doc/SmartSearchDto.md new file mode 100644 index 0000000000..5d34143df2 Binary files /dev/null and b/mobile/openapi/doc/SmartSearchDto.md differ diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index f2903e3516..3816a05b3b 100644 Binary files a/mobile/openapi/lib/api.dart and b/mobile/openapi/lib/api.dart differ diff --git a/mobile/openapi/lib/api/asset_api.dart b/mobile/openapi/lib/api/asset_api.dart index 97c9e7cbec..bdcb874092 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/api/search_api.dart b/mobile/openapi/lib/api/search_api.dart index 16d2b3003e..062ca4a50b 100644 Binary files a/mobile/openapi/lib/api/search_api.dart and b/mobile/openapi/lib/api/search_api.dart differ diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index a8cf4c34c1..3a0e535e73 100644 Binary files a/mobile/openapi/lib/api_client.dart and b/mobile/openapi/lib/api_client.dart differ diff --git a/mobile/openapi/lib/model/metadata_search_dto.dart b/mobile/openapi/lib/model/metadata_search_dto.dart new file mode 100644 index 0000000000..47756cd527 Binary files /dev/null and b/mobile/openapi/lib/model/metadata_search_dto.dart differ diff --git a/mobile/openapi/lib/model/smart_search_dto.dart b/mobile/openapi/lib/model/smart_search_dto.dart new file mode 100644 index 0000000000..b82a3345fb Binary files /dev/null and b/mobile/openapi/lib/model/smart_search_dto.dart differ diff --git a/mobile/openapi/test/asset_api_test.dart b/mobile/openapi/test/asset_api_test.dart index a6d6af813e..06375c6b49 100644 Binary files a/mobile/openapi/test/asset_api_test.dart and b/mobile/openapi/test/asset_api_test.dart differ diff --git a/mobile/openapi/test/metadata_search_dto_test.dart b/mobile/openapi/test/metadata_search_dto_test.dart new file mode 100644 index 0000000000..f1635de4e0 Binary files /dev/null and b/mobile/openapi/test/metadata_search_dto_test.dart differ diff --git a/mobile/openapi/test/search_api_test.dart b/mobile/openapi/test/search_api_test.dart index d89c47e748..14169e461d 100644 Binary files a/mobile/openapi/test/search_api_test.dart and b/mobile/openapi/test/search_api_test.dart differ diff --git a/mobile/openapi/test/smart_search_dto_test.dart b/mobile/openapi/test/smart_search_dto_test.dart new file mode 100644 index 0000000000..858c7769c8 Binary files /dev/null and b/mobile/openapi/test/smart_search_dto_test.dart differ diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 66a65fcb3d..5dd394108e 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -2256,6 +2256,14 @@ "type": "boolean" } }, + { + "name": "isNotInAlbum", + "required": false, + "in": "query", + "schema": { + "type": "boolean" + } + }, { "name": "isOffline", "required": false, @@ -2345,6 +2353,17 @@ "type": "number" } }, + { + "name": "personIds", + "required": false, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "resizePath", "required": false, @@ -4526,350 +4545,21 @@ } }, "/search/metadata": { - "get": { + "post": { "operationId": "searchMetadata", - "parameters": [ - { - "name": "checksum", - "required": false, - "in": "query", - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetadataSearchDto" + } } }, - { - "name": "city", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "country", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "createdAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "deviceAssetId", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "deviceId", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "encodedVideoPath", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "id", - "required": false, - "in": "query", - "schema": { - "format": "uuid", - "type": "string" - } - }, - { - "name": "isArchived", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isEncoded", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isExternal", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isFavorite", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isMotion", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isOffline", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isReadOnly", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isVisible", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "lensModel", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "libraryId", - "required": false, - "in": "query", - "schema": { - "format": "uuid", - "type": "string" - } - }, - { - "name": "make", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "model", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "order", - "required": false, - "in": "query", - "schema": { - "$ref": "#/components/schemas/AssetOrder" - } - }, - { - "name": "originalFileName", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "originalPath", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "page", - "required": false, - "in": "query", - "schema": { - "type": "number" - } - }, - { - "name": "resizePath", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "size", - "required": false, - "in": "query", - "schema": { - "type": "number" - } - }, - { - "name": "state", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "takenAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "takenBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "trashedAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "trashedBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "type", - "required": false, - "in": "query", - "schema": { - "$ref": "#/components/schemas/AssetTypeEnum" - } - }, - { - "name": "updatedAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "webpPath", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "withArchived", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "withDeleted", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "withExif", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "withPeople", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "withStacked", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - } - ], + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { @@ -4949,269 +4639,21 @@ } }, "/search/smart": { - "get": { + "post": { "operationId": "searchSmart", - "parameters": [ - { - "name": "city", - "required": false, - "in": "query", - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SmartSearchDto" + } } }, - { - "name": "country", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "createdAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "deviceId", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "isArchived", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isEncoded", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isExternal", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isFavorite", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isMotion", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isOffline", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isReadOnly", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "isVisible", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "lensModel", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "libraryId", - "required": false, - "in": "query", - "schema": { - "format": "uuid", - "type": "string" - } - }, - { - "name": "make", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "model", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "page", - "required": false, - "in": "query", - "schema": { - "type": "number" - } - }, - { - "name": "query", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "size", - "required": false, - "in": "query", - "schema": { - "type": "number" - } - }, - { - "name": "state", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "takenAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "takenBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "trashedAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "trashedBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "type", - "required": false, - "in": "query", - "schema": { - "$ref": "#/components/schemas/AssetTypeEnum" - } - }, - { - "name": "updatedAfter", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedBefore", - "required": false, - "in": "query", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "withArchived", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "withDeleted", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "withExif", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - } - ], + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { @@ -8805,6 +8247,153 @@ ], "type": "object" }, + "MetadataSearchDto": { + "properties": { + "checksum": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "createdAfter": { + "format": "date-time", + "type": "string" + }, + "createdBefore": { + "format": "date-time", + "type": "string" + }, + "deviceAssetId": { + "type": "string" + }, + "deviceId": { + "type": "string" + }, + "encodedVideoPath": { + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isEncoded": { + "type": "boolean" + }, + "isExternal": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "isMotion": { + "type": "boolean" + }, + "isNotInAlbum": { + "type": "boolean" + }, + "isOffline": { + "type": "boolean" + }, + "isReadOnly": { + "type": "boolean" + }, + "isVisible": { + "type": "boolean" + }, + "lensModel": { + "type": "string" + }, + "libraryId": { + "format": "uuid", + "type": "string" + }, + "make": { + "type": "string" + }, + "model": { + "type": "string" + }, + "order": { + "$ref": "#/components/schemas/AssetOrder" + }, + "originalFileName": { + "type": "string" + }, + "originalPath": { + "type": "string" + }, + "page": { + "type": "number" + }, + "personIds": { + "items": { + "type": "string" + }, + "type": "array" + }, + "resizePath": { + "type": "string" + }, + "size": { + "type": "number" + }, + "state": { + "type": "string" + }, + "takenAfter": { + "format": "date-time", + "type": "string" + }, + "takenBefore": { + "format": "date-time", + "type": "string" + }, + "trashedAfter": { + "format": "date-time", + "type": "string" + }, + "trashedBefore": { + "format": "date-time", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/AssetTypeEnum" + }, + "updatedAfter": { + "format": "date-time", + "type": "string" + }, + "updatedBefore": { + "format": "date-time", + "type": "string" + }, + "webpPath": { + "type": "string" + }, + "withArchived": { + "type": "boolean" + }, + "withDeleted": { + "type": "boolean" + }, + "withExif": { + "type": "boolean" + }, + "withPeople": { + "type": "boolean" + }, + "withStacked": { + "type": "boolean" + } + }, + "type": "object" + }, "ModelType": { "enum": [ "facial-recognition", @@ -9760,6 +9349,116 @@ }, "type": "object" }, + "SmartSearchDto": { + "properties": { + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "createdAfter": { + "format": "date-time", + "type": "string" + }, + "createdBefore": { + "format": "date-time", + "type": "string" + }, + "deviceId": { + "type": "string" + }, + "isArchived": { + "type": "boolean" + }, + "isEncoded": { + "type": "boolean" + }, + "isExternal": { + "type": "boolean" + }, + "isFavorite": { + "type": "boolean" + }, + "isMotion": { + "type": "boolean" + }, + "isOffline": { + "type": "boolean" + }, + "isReadOnly": { + "type": "boolean" + }, + "isVisible": { + "type": "boolean" + }, + "lensModel": { + "type": "string" + }, + "libraryId": { + "format": "uuid", + "type": "string" + }, + "make": { + "type": "string" + }, + "model": { + "type": "string" + }, + "page": { + "type": "number" + }, + "query": { + "type": "string" + }, + "size": { + "type": "number" + }, + "state": { + "type": "string" + }, + "takenAfter": { + "format": "date-time", + "type": "string" + }, + "takenBefore": { + "format": "date-time", + "type": "string" + }, + "trashedAfter": { + "format": "date-time", + "type": "string" + }, + "trashedBefore": { + "format": "date-time", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/AssetTypeEnum" + }, + "updatedAfter": { + "format": "date-time", + "type": "string" + }, + "updatedBefore": { + "format": "date-time", + "type": "string" + }, + "withArchived": { + "type": "boolean" + }, + "withDeleted": { + "type": "boolean" + }, + "withExif": { + "type": "boolean" + } + }, + "required": [ + "query" + ], + "type": "object" + }, "SystemConfigDto": { "properties": { "ffmpeg": { diff --git a/open-api/typescript-sdk/axios-client/api.ts b/open-api/typescript-sdk/axios-client/api.ts index 16fcd79cd7..5d37706904 100644 --- a/open-api/typescript-sdk/axios-client/api.ts +++ b/open-api/typescript-sdk/axios-client/api.ts @@ -2330,6 +2330,273 @@ export interface MergePersonDto { */ 'ids': Array; } +/** + * + * @export + * @interface MetadataSearchDto + */ +export interface MetadataSearchDto { + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'checksum'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'city'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'country'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'createdAfter'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'createdBefore'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'deviceAssetId'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'deviceId'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'encodedVideoPath'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'id'?: string; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isArchived'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isEncoded'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isExternal'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isFavorite'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isMotion'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isNotInAlbum'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isOffline'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isReadOnly'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'isVisible'?: boolean; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'lensModel'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'libraryId'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'make'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'model'?: string; + /** + * + * @type {AssetOrder} + * @memberof MetadataSearchDto + */ + 'order'?: AssetOrder; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'originalFileName'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'originalPath'?: string; + /** + * + * @type {number} + * @memberof MetadataSearchDto + */ + 'page'?: number; + /** + * + * @type {Array} + * @memberof MetadataSearchDto + */ + 'personIds'?: Array; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'resizePath'?: string; + /** + * + * @type {number} + * @memberof MetadataSearchDto + */ + 'size'?: number; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'state'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'takenAfter'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'takenBefore'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'trashedAfter'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'trashedBefore'?: string; + /** + * + * @type {AssetTypeEnum} + * @memberof MetadataSearchDto + */ + 'type'?: AssetTypeEnum; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'updatedAfter'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'updatedBefore'?: string; + /** + * + * @type {string} + * @memberof MetadataSearchDto + */ + 'webpPath'?: string; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'withArchived'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'withDeleted'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'withExif'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'withPeople'?: boolean; + /** + * + * @type {boolean} + * @memberof MetadataSearchDto + */ + 'withStacked'?: boolean; +} + + /** * * @export @@ -3547,6 +3814,201 @@ export interface SmartInfoResponseDto { */ 'tags'?: Array | null; } +/** + * + * @export + * @interface SmartSearchDto + */ +export interface SmartSearchDto { + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'city'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'country'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'createdAfter'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'createdBefore'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'deviceId'?: string; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isArchived'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isEncoded'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isExternal'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isFavorite'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isMotion'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isOffline'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isReadOnly'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'isVisible'?: boolean; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'lensModel'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'libraryId'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'make'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'model'?: string; + /** + * + * @type {number} + * @memberof SmartSearchDto + */ + 'page'?: number; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'query': string; + /** + * + * @type {number} + * @memberof SmartSearchDto + */ + 'size'?: number; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'state'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'takenAfter'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'takenBefore'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'trashedAfter'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'trashedBefore'?: string; + /** + * + * @type {AssetTypeEnum} + * @memberof SmartSearchDto + */ + 'type'?: AssetTypeEnum; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'updatedAfter'?: string; + /** + * + * @type {string} + * @memberof SmartSearchDto + */ + 'updatedBefore'?: string; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'withArchived'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'withDeleted'?: boolean; + /** + * + * @type {boolean} + * @memberof SmartSearchDto + */ + 'withExif'?: boolean; +} + + /** * * @export @@ -7766,6 +8228,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {boolean} [isExternal] * @param {boolean} [isFavorite] * @param {boolean} [isMotion] + * @param {boolean} [isNotInAlbum] * @param {boolean} [isOffline] * @param {boolean} [isReadOnly] * @param {boolean} [isVisible] @@ -7777,6 +8240,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {string} [originalFileName] * @param {string} [originalPath] * @param {number} [page] + * @param {Array} [personIds] * @param {string} [resizePath] * @param {number} [size] * @param {string} [state] @@ -7797,7 +8261,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @deprecated * @throws {RequiredError} */ - searchAssets: async (checksum?: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceAssetId?: string, deviceId?: string, encodedVideoPath?: string, id?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, order?: AssetOrder, originalFileName?: string, originalPath?: string, page?: number, resizePath?: string, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, webpPath?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, withPeople?: boolean, withStacked?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + searchAssets: async (checksum?: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceAssetId?: string, deviceId?: string, encodedVideoPath?: string, id?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isNotInAlbum?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, order?: AssetOrder, originalFileName?: string, originalPath?: string, page?: number, personIds?: Array, resizePath?: string, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, webpPath?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, withPeople?: boolean, withStacked?: boolean, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/assets`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -7879,6 +8343,10 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['isMotion'] = isMotion; } + if (isNotInAlbum !== undefined) { + localVarQueryParameter['isNotInAlbum'] = isNotInAlbum; + } + if (isOffline !== undefined) { localVarQueryParameter['isOffline'] = isOffline; } @@ -7923,6 +8391,10 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration localVarQueryParameter['page'] = page; } + if (personIds) { + localVarQueryParameter['personIds'] = personIds; + } + if (resizePath !== undefined) { localVarQueryParameter['resizePath'] = resizePath; } @@ -8598,6 +9070,7 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {boolean} [isExternal] * @param {boolean} [isFavorite] * @param {boolean} [isMotion] + * @param {boolean} [isNotInAlbum] * @param {boolean} [isOffline] * @param {boolean} [isReadOnly] * @param {boolean} [isVisible] @@ -8609,6 +9082,7 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {string} [originalFileName] * @param {string} [originalPath] * @param {number} [page] + * @param {Array} [personIds] * @param {string} [resizePath] * @param {number} [size] * @param {string} [state] @@ -8629,8 +9103,8 @@ export const AssetApiFp = function(configuration?: Configuration) { * @deprecated * @throws {RequiredError} */ - async searchAssets(checksum?: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceAssetId?: string, deviceId?: string, encodedVideoPath?: string, id?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, order?: AssetOrder, originalFileName?: string, originalPath?: string, page?: number, resizePath?: string, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, webpPath?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, withPeople?: boolean, withStacked?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchAssets(checksum, city, country, createdAfter, createdBefore, deviceAssetId, deviceId, encodedVideoPath, id, isArchived, isEncoded, isExternal, isFavorite, isMotion, isOffline, isReadOnly, isVisible, lensModel, libraryId, make, model, order, originalFileName, originalPath, page, resizePath, size, state, takenAfter, takenBefore, trashedAfter, trashedBefore, type, updatedAfter, updatedBefore, webpPath, withArchived, withDeleted, withExif, withPeople, withStacked, options); + async searchAssets(checksum?: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceAssetId?: string, deviceId?: string, encodedVideoPath?: string, id?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isNotInAlbum?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, order?: AssetOrder, originalFileName?: string, originalPath?: string, page?: number, personIds?: Array, resizePath?: string, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, webpPath?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, withPeople?: boolean, withStacked?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchAssets(checksum, city, country, createdAfter, createdBefore, deviceAssetId, deviceId, encodedVideoPath, id, isArchived, isEncoded, isExternal, isFavorite, isMotion, isNotInAlbum, isOffline, isReadOnly, isVisible, lensModel, libraryId, make, model, order, originalFileName, originalPath, page, personIds, resizePath, size, state, takenAfter, takenBefore, trashedAfter, trashedBefore, type, updatedAfter, updatedBefore, webpPath, withArchived, withDeleted, withExif, withPeople, withStacked, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['AssetApi.searchAssets']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); @@ -8882,7 +9356,7 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ searchAssets(requestParameters: AssetApiSearchAssetsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.searchAssets(requestParameters.checksum, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.encodedVideoPath, requestParameters.id, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.order, requestParameters.originalFileName, requestParameters.originalPath, requestParameters.page, requestParameters.resizePath, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.webpPath, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, requestParameters.withPeople, requestParameters.withStacked, options).then((request) => request(axios, basePath)); + return localVarFp.searchAssets(requestParameters.checksum, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.encodedVideoPath, requestParameters.id, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isNotInAlbum, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.order, requestParameters.originalFileName, requestParameters.originalPath, requestParameters.page, requestParameters.personIds, requestParameters.resizePath, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.webpPath, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, requestParameters.withPeople, requestParameters.withStacked, options).then((request) => request(axios, basePath)); }, /** * @@ -9484,6 +9958,13 @@ export interface AssetApiSearchAssetsRequest { */ readonly isMotion?: boolean + /** + * + * @type {boolean} + * @memberof AssetApiSearchAssets + */ + readonly isNotInAlbum?: boolean + /** * * @type {boolean} @@ -9561,6 +10042,13 @@ export interface AssetApiSearchAssetsRequest { */ readonly page?: number + /** + * + * @type {Array} + * @memberof AssetApiSearchAssets + */ + readonly personIds?: Array + /** * * @type {string} @@ -10077,7 +10565,7 @@ export class AssetApi extends BaseAPI { * @memberof AssetApi */ public searchAssets(requestParameters: AssetApiSearchAssetsRequest = {}, options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).searchAssets(requestParameters.checksum, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.encodedVideoPath, requestParameters.id, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.order, requestParameters.originalFileName, requestParameters.originalPath, requestParameters.page, requestParameters.resizePath, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.webpPath, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, requestParameters.withPeople, requestParameters.withStacked, options).then((request) => request(this.axios, this.basePath)); + return AssetApiFp(this.configuration).searchAssets(requestParameters.checksum, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.encodedVideoPath, requestParameters.id, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isNotInAlbum, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.order, requestParameters.originalFileName, requestParameters.originalPath, requestParameters.page, requestParameters.personIds, requestParameters.resizePath, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.webpPath, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, requestParameters.withPeople, requestParameters.withStacked, options).then((request) => request(this.axios, this.basePath)); } /** @@ -14705,51 +15193,13 @@ export const SearchApiAxiosParamCreator = function (configuration?: Configuratio }, /** * - * @param {string} [checksum] - * @param {string} [city] - * @param {string} [country] - * @param {string} [createdAfter] - * @param {string} [createdBefore] - * @param {string} [deviceAssetId] - * @param {string} [deviceId] - * @param {string} [encodedVideoPath] - * @param {string} [id] - * @param {boolean} [isArchived] - * @param {boolean} [isEncoded] - * @param {boolean} [isExternal] - * @param {boolean} [isFavorite] - * @param {boolean} [isMotion] - * @param {boolean} [isOffline] - * @param {boolean} [isReadOnly] - * @param {boolean} [isVisible] - * @param {string} [lensModel] - * @param {string} [libraryId] - * @param {string} [make] - * @param {string} [model] - * @param {AssetOrder} [order] - * @param {string} [originalFileName] - * @param {string} [originalPath] - * @param {number} [page] - * @param {string} [resizePath] - * @param {number} [size] - * @param {string} [state] - * @param {string} [takenAfter] - * @param {string} [takenBefore] - * @param {string} [trashedAfter] - * @param {string} [trashedBefore] - * @param {AssetTypeEnum} [type] - * @param {string} [updatedAfter] - * @param {string} [updatedBefore] - * @param {string} [webpPath] - * @param {boolean} [withArchived] - * @param {boolean} [withDeleted] - * @param {boolean} [withExif] - * @param {boolean} [withPeople] - * @param {boolean} [withStacked] + * @param {MetadataSearchDto} metadataSearchDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - searchMetadata: async (checksum?: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceAssetId?: string, deviceId?: string, encodedVideoPath?: string, id?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, order?: AssetOrder, originalFileName?: string, originalPath?: string, page?: number, resizePath?: string, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, webpPath?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, withPeople?: boolean, withStacked?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + searchMetadata: async (metadataSearchDto: MetadataSearchDto, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'metadataSearchDto' is not null or undefined + assertParamExists('searchMetadata', 'metadataSearchDto', metadataSearchDto) const localVarPath = `/search/metadata`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -14758,7 +15208,7 @@ export const SearchApiAxiosParamCreator = function (configuration?: Configuratio baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -14771,191 +15221,14 @@ export const SearchApiAxiosParamCreator = function (configuration?: Configuratio // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) - if (checksum !== undefined) { - localVarQueryParameter['checksum'] = checksum; - } - - if (city !== undefined) { - localVarQueryParameter['city'] = city; - } - - if (country !== undefined) { - localVarQueryParameter['country'] = country; - } - - if (createdAfter !== undefined) { - localVarQueryParameter['createdAfter'] = (createdAfter as any instanceof Date) ? - (createdAfter as any).toISOString() : - createdAfter; - } - - if (createdBefore !== undefined) { - localVarQueryParameter['createdBefore'] = (createdBefore as any instanceof Date) ? - (createdBefore as any).toISOString() : - createdBefore; - } - - if (deviceAssetId !== undefined) { - localVarQueryParameter['deviceAssetId'] = deviceAssetId; - } - - if (deviceId !== undefined) { - localVarQueryParameter['deviceId'] = deviceId; - } - - if (encodedVideoPath !== undefined) { - localVarQueryParameter['encodedVideoPath'] = encodedVideoPath; - } - - if (id !== undefined) { - localVarQueryParameter['id'] = id; - } - - if (isArchived !== undefined) { - localVarQueryParameter['isArchived'] = isArchived; - } - - if (isEncoded !== undefined) { - localVarQueryParameter['isEncoded'] = isEncoded; - } - - if (isExternal !== undefined) { - localVarQueryParameter['isExternal'] = isExternal; - } - - if (isFavorite !== undefined) { - localVarQueryParameter['isFavorite'] = isFavorite; - } - - if (isMotion !== undefined) { - localVarQueryParameter['isMotion'] = isMotion; - } - - if (isOffline !== undefined) { - localVarQueryParameter['isOffline'] = isOffline; - } - - if (isReadOnly !== undefined) { - localVarQueryParameter['isReadOnly'] = isReadOnly; - } - - if (isVisible !== undefined) { - localVarQueryParameter['isVisible'] = isVisible; - } - - if (lensModel !== undefined) { - localVarQueryParameter['lensModel'] = lensModel; - } - - if (libraryId !== undefined) { - localVarQueryParameter['libraryId'] = libraryId; - } - - if (make !== undefined) { - localVarQueryParameter['make'] = make; - } - - if (model !== undefined) { - localVarQueryParameter['model'] = model; - } - - if (order !== undefined) { - localVarQueryParameter['order'] = order; - } - - if (originalFileName !== undefined) { - localVarQueryParameter['originalFileName'] = originalFileName; - } - - if (originalPath !== undefined) { - localVarQueryParameter['originalPath'] = originalPath; - } - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (resizePath !== undefined) { - localVarQueryParameter['resizePath'] = resizePath; - } - - if (size !== undefined) { - localVarQueryParameter['size'] = size; - } - - if (state !== undefined) { - localVarQueryParameter['state'] = state; - } - - if (takenAfter !== undefined) { - localVarQueryParameter['takenAfter'] = (takenAfter as any instanceof Date) ? - (takenAfter as any).toISOString() : - takenAfter; - } - - if (takenBefore !== undefined) { - localVarQueryParameter['takenBefore'] = (takenBefore as any instanceof Date) ? - (takenBefore as any).toISOString() : - takenBefore; - } - - if (trashedAfter !== undefined) { - localVarQueryParameter['trashedAfter'] = (trashedAfter as any instanceof Date) ? - (trashedAfter as any).toISOString() : - trashedAfter; - } - - if (trashedBefore !== undefined) { - localVarQueryParameter['trashedBefore'] = (trashedBefore as any instanceof Date) ? - (trashedBefore as any).toISOString() : - trashedBefore; - } - - if (type !== undefined) { - localVarQueryParameter['type'] = type; - } - - if (updatedAfter !== undefined) { - localVarQueryParameter['updatedAfter'] = (updatedAfter as any instanceof Date) ? - (updatedAfter as any).toISOString() : - updatedAfter; - } - - if (updatedBefore !== undefined) { - localVarQueryParameter['updatedBefore'] = (updatedBefore as any instanceof Date) ? - (updatedBefore as any).toISOString() : - updatedBefore; - } - - if (webpPath !== undefined) { - localVarQueryParameter['webpPath'] = webpPath; - } - - if (withArchived !== undefined) { - localVarQueryParameter['withArchived'] = withArchived; - } - - if (withDeleted !== undefined) { - localVarQueryParameter['withDeleted'] = withDeleted; - } - - if (withExif !== undefined) { - localVarQueryParameter['withExif'] = withExif; - } - - if (withPeople !== undefined) { - localVarQueryParameter['withPeople'] = withPeople; - } - - if (withStacked !== undefined) { - localVarQueryParameter['withStacked'] = withStacked; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(metadataSearchDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -15014,43 +15287,13 @@ export const SearchApiAxiosParamCreator = function (configuration?: Configuratio }, /** * - * @param {string} query - * @param {string} [city] - * @param {string} [country] - * @param {string} [createdAfter] - * @param {string} [createdBefore] - * @param {string} [deviceId] - * @param {boolean} [isArchived] - * @param {boolean} [isEncoded] - * @param {boolean} [isExternal] - * @param {boolean} [isFavorite] - * @param {boolean} [isMotion] - * @param {boolean} [isOffline] - * @param {boolean} [isReadOnly] - * @param {boolean} [isVisible] - * @param {string} [lensModel] - * @param {string} [libraryId] - * @param {string} [make] - * @param {string} [model] - * @param {number} [page] - * @param {number} [size] - * @param {string} [state] - * @param {string} [takenAfter] - * @param {string} [takenBefore] - * @param {string} [trashedAfter] - * @param {string} [trashedBefore] - * @param {AssetTypeEnum} [type] - * @param {string} [updatedAfter] - * @param {string} [updatedBefore] - * @param {boolean} [withArchived] - * @param {boolean} [withDeleted] - * @param {boolean} [withExif] + * @param {SmartSearchDto} smartSearchDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - searchSmart: async (query: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceId?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, page?: number, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'query' is not null or undefined - assertParamExists('searchSmart', 'query', query) + searchSmart: async (smartSearchDto: SmartSearchDto, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'smartSearchDto' is not null or undefined + assertParamExists('searchSmart', 'smartSearchDto', smartSearchDto) const localVarPath = `/search/smart`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -15059,7 +15302,7 @@ export const SearchApiAxiosParamCreator = function (configuration?: Configuratio baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -15072,151 +15315,14 @@ export const SearchApiAxiosParamCreator = function (configuration?: Configuratio // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) - if (city !== undefined) { - localVarQueryParameter['city'] = city; - } - - if (country !== undefined) { - localVarQueryParameter['country'] = country; - } - - if (createdAfter !== undefined) { - localVarQueryParameter['createdAfter'] = (createdAfter as any instanceof Date) ? - (createdAfter as any).toISOString() : - createdAfter; - } - - if (createdBefore !== undefined) { - localVarQueryParameter['createdBefore'] = (createdBefore as any instanceof Date) ? - (createdBefore as any).toISOString() : - createdBefore; - } - - if (deviceId !== undefined) { - localVarQueryParameter['deviceId'] = deviceId; - } - - if (isArchived !== undefined) { - localVarQueryParameter['isArchived'] = isArchived; - } - - if (isEncoded !== undefined) { - localVarQueryParameter['isEncoded'] = isEncoded; - } - - if (isExternal !== undefined) { - localVarQueryParameter['isExternal'] = isExternal; - } - - if (isFavorite !== undefined) { - localVarQueryParameter['isFavorite'] = isFavorite; - } - - if (isMotion !== undefined) { - localVarQueryParameter['isMotion'] = isMotion; - } - - if (isOffline !== undefined) { - localVarQueryParameter['isOffline'] = isOffline; - } - - if (isReadOnly !== undefined) { - localVarQueryParameter['isReadOnly'] = isReadOnly; - } - - if (isVisible !== undefined) { - localVarQueryParameter['isVisible'] = isVisible; - } - - if (lensModel !== undefined) { - localVarQueryParameter['lensModel'] = lensModel; - } - - if (libraryId !== undefined) { - localVarQueryParameter['libraryId'] = libraryId; - } - - if (make !== undefined) { - localVarQueryParameter['make'] = make; - } - - if (model !== undefined) { - localVarQueryParameter['model'] = model; - } - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (query !== undefined) { - localVarQueryParameter['query'] = query; - } - - if (size !== undefined) { - localVarQueryParameter['size'] = size; - } - - if (state !== undefined) { - localVarQueryParameter['state'] = state; - } - - if (takenAfter !== undefined) { - localVarQueryParameter['takenAfter'] = (takenAfter as any instanceof Date) ? - (takenAfter as any).toISOString() : - takenAfter; - } - - if (takenBefore !== undefined) { - localVarQueryParameter['takenBefore'] = (takenBefore as any instanceof Date) ? - (takenBefore as any).toISOString() : - takenBefore; - } - - if (trashedAfter !== undefined) { - localVarQueryParameter['trashedAfter'] = (trashedAfter as any instanceof Date) ? - (trashedAfter as any).toISOString() : - trashedAfter; - } - - if (trashedBefore !== undefined) { - localVarQueryParameter['trashedBefore'] = (trashedBefore as any instanceof Date) ? - (trashedBefore as any).toISOString() : - trashedBefore; - } - - if (type !== undefined) { - localVarQueryParameter['type'] = type; - } - - if (updatedAfter !== undefined) { - localVarQueryParameter['updatedAfter'] = (updatedAfter as any instanceof Date) ? - (updatedAfter as any).toISOString() : - updatedAfter; - } - - if (updatedBefore !== undefined) { - localVarQueryParameter['updatedBefore'] = (updatedBefore as any instanceof Date) ? - (updatedBefore as any).toISOString() : - updatedBefore; - } - - if (withArchived !== undefined) { - localVarQueryParameter['withArchived'] = withArchived; - } - - if (withDeleted !== undefined) { - localVarQueryParameter['withDeleted'] = withDeleted; - } - - if (withExif !== undefined) { - localVarQueryParameter['withExif'] = withExif; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(smartSearchDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -15284,52 +15390,12 @@ export const SearchApiFp = function(configuration?: Configuration) { }, /** * - * @param {string} [checksum] - * @param {string} [city] - * @param {string} [country] - * @param {string} [createdAfter] - * @param {string} [createdBefore] - * @param {string} [deviceAssetId] - * @param {string} [deviceId] - * @param {string} [encodedVideoPath] - * @param {string} [id] - * @param {boolean} [isArchived] - * @param {boolean} [isEncoded] - * @param {boolean} [isExternal] - * @param {boolean} [isFavorite] - * @param {boolean} [isMotion] - * @param {boolean} [isOffline] - * @param {boolean} [isReadOnly] - * @param {boolean} [isVisible] - * @param {string} [lensModel] - * @param {string} [libraryId] - * @param {string} [make] - * @param {string} [model] - * @param {AssetOrder} [order] - * @param {string} [originalFileName] - * @param {string} [originalPath] - * @param {number} [page] - * @param {string} [resizePath] - * @param {number} [size] - * @param {string} [state] - * @param {string} [takenAfter] - * @param {string} [takenBefore] - * @param {string} [trashedAfter] - * @param {string} [trashedBefore] - * @param {AssetTypeEnum} [type] - * @param {string} [updatedAfter] - * @param {string} [updatedBefore] - * @param {string} [webpPath] - * @param {boolean} [withArchived] - * @param {boolean} [withDeleted] - * @param {boolean} [withExif] - * @param {boolean} [withPeople] - * @param {boolean} [withStacked] + * @param {MetadataSearchDto} metadataSearchDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async searchMetadata(checksum?: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceAssetId?: string, deviceId?: string, encodedVideoPath?: string, id?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, order?: AssetOrder, originalFileName?: string, originalPath?: string, page?: number, resizePath?: string, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, webpPath?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, withPeople?: boolean, withStacked?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchMetadata(checksum, city, country, createdAfter, createdBefore, deviceAssetId, deviceId, encodedVideoPath, id, isArchived, isEncoded, isExternal, isFavorite, isMotion, isOffline, isReadOnly, isVisible, lensModel, libraryId, make, model, order, originalFileName, originalPath, page, resizePath, size, state, takenAfter, takenBefore, trashedAfter, trashedBefore, type, updatedAfter, updatedBefore, webpPath, withArchived, withDeleted, withExif, withPeople, withStacked, options); + async searchMetadata(metadataSearchDto: MetadataSearchDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchMetadata(metadataSearchDto, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['SearchApi.searchMetadata']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); @@ -15349,42 +15415,12 @@ export const SearchApiFp = function(configuration?: Configuration) { }, /** * - * @param {string} query - * @param {string} [city] - * @param {string} [country] - * @param {string} [createdAfter] - * @param {string} [createdBefore] - * @param {string} [deviceId] - * @param {boolean} [isArchived] - * @param {boolean} [isEncoded] - * @param {boolean} [isExternal] - * @param {boolean} [isFavorite] - * @param {boolean} [isMotion] - * @param {boolean} [isOffline] - * @param {boolean} [isReadOnly] - * @param {boolean} [isVisible] - * @param {string} [lensModel] - * @param {string} [libraryId] - * @param {string} [make] - * @param {string} [model] - * @param {number} [page] - * @param {number} [size] - * @param {string} [state] - * @param {string} [takenAfter] - * @param {string} [takenBefore] - * @param {string} [trashedAfter] - * @param {string} [trashedBefore] - * @param {AssetTypeEnum} [type] - * @param {string} [updatedAfter] - * @param {string} [updatedBefore] - * @param {boolean} [withArchived] - * @param {boolean} [withDeleted] - * @param {boolean} [withExif] + * @param {SmartSearchDto} smartSearchDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async searchSmart(query: string, city?: string, country?: string, createdAfter?: string, createdBefore?: string, deviceId?: string, isArchived?: boolean, isEncoded?: boolean, isExternal?: boolean, isFavorite?: boolean, isMotion?: boolean, isOffline?: boolean, isReadOnly?: boolean, isVisible?: boolean, lensModel?: string, libraryId?: string, make?: string, model?: string, page?: number, size?: number, state?: string, takenAfter?: string, takenBefore?: string, trashedAfter?: string, trashedBefore?: string, type?: AssetTypeEnum, updatedAfter?: string, updatedBefore?: string, withArchived?: boolean, withDeleted?: boolean, withExif?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.searchSmart(query, city, country, createdAfter, createdBefore, deviceId, isArchived, isEncoded, isExternal, isFavorite, isMotion, isOffline, isReadOnly, isVisible, lensModel, libraryId, make, model, page, size, state, takenAfter, takenBefore, trashedAfter, trashedBefore, type, updatedAfter, updatedBefore, withArchived, withDeleted, withExif, options); + async searchSmart(smartSearchDto: SmartSearchDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.searchSmart(smartSearchDto, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['SearchApi.searchSmart']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); @@ -15432,8 +15468,8 @@ export const SearchApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - searchMetadata(requestParameters: SearchApiSearchMetadataRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.searchMetadata(requestParameters.checksum, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.encodedVideoPath, requestParameters.id, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.order, requestParameters.originalFileName, requestParameters.originalPath, requestParameters.page, requestParameters.resizePath, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.webpPath, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, requestParameters.withPeople, requestParameters.withStacked, options).then((request) => request(axios, basePath)); + searchMetadata(requestParameters: SearchApiSearchMetadataRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.searchMetadata(requestParameters.metadataSearchDto, options).then((request) => request(axios, basePath)); }, /** * @@ -15451,7 +15487,7 @@ export const SearchApiFactory = function (configuration?: Configuration, basePat * @throws {RequiredError} */ searchSmart(requestParameters: SearchApiSearchSmartRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.searchSmart(requestParameters.query, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceId, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.page, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, options).then((request) => request(axios, basePath)); + return localVarFp.searchSmart(requestParameters.smartSearchDto, options).then((request) => request(axios, basePath)); }, }; }; @@ -15583,290 +15619,10 @@ export interface SearchApiSearchRequest { export interface SearchApiSearchMetadataRequest { /** * - * @type {string} + * @type {MetadataSearchDto} * @memberof SearchApiSearchMetadata */ - readonly checksum?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly city?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly country?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly createdAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly createdBefore?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly deviceAssetId?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly deviceId?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly encodedVideoPath?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly id?: string - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isArchived?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isEncoded?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isExternal?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isFavorite?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isMotion?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isOffline?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isReadOnly?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly isVisible?: boolean - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly lensModel?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly libraryId?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly make?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly model?: string - - /** - * - * @type {AssetOrder} - * @memberof SearchApiSearchMetadata - */ - readonly order?: AssetOrder - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly originalFileName?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly originalPath?: string - - /** - * - * @type {number} - * @memberof SearchApiSearchMetadata - */ - readonly page?: number - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly resizePath?: string - - /** - * - * @type {number} - * @memberof SearchApiSearchMetadata - */ - readonly size?: number - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly state?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly takenAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly takenBefore?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly trashedAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly trashedBefore?: string - - /** - * - * @type {AssetTypeEnum} - * @memberof SearchApiSearchMetadata - */ - readonly type?: AssetTypeEnum - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly updatedAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly updatedBefore?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchMetadata - */ - readonly webpPath?: string - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly withArchived?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly withDeleted?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly withExif?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly withPeople?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchMetadata - */ - readonly withStacked?: boolean + readonly metadataSearchDto: MetadataSearchDto } /** @@ -15898,220 +15654,10 @@ export interface SearchApiSearchPersonRequest { export interface SearchApiSearchSmartRequest { /** * - * @type {string} + * @type {SmartSearchDto} * @memberof SearchApiSearchSmart */ - readonly query: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly city?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly country?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly createdAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly createdBefore?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly deviceId?: string - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isArchived?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isEncoded?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isExternal?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isFavorite?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isMotion?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isOffline?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isReadOnly?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly isVisible?: boolean - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly lensModel?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly libraryId?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly make?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly model?: string - - /** - * - * @type {number} - * @memberof SearchApiSearchSmart - */ - readonly page?: number - - /** - * - * @type {number} - * @memberof SearchApiSearchSmart - */ - readonly size?: number - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly state?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly takenAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly takenBefore?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly trashedAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly trashedBefore?: string - - /** - * - * @type {AssetTypeEnum} - * @memberof SearchApiSearchSmart - */ - readonly type?: AssetTypeEnum - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly updatedAfter?: string - - /** - * - * @type {string} - * @memberof SearchApiSearchSmart - */ - readonly updatedBefore?: string - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly withArchived?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly withDeleted?: boolean - - /** - * - * @type {boolean} - * @memberof SearchApiSearchSmart - */ - readonly withExif?: boolean + readonly smartSearchDto: SmartSearchDto } /** @@ -16161,8 +15707,8 @@ export class SearchApi extends BaseAPI { * @throws {RequiredError} * @memberof SearchApi */ - public searchMetadata(requestParameters: SearchApiSearchMetadataRequest = {}, options?: RawAxiosRequestConfig) { - return SearchApiFp(this.configuration).searchMetadata(requestParameters.checksum, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceAssetId, requestParameters.deviceId, requestParameters.encodedVideoPath, requestParameters.id, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.order, requestParameters.originalFileName, requestParameters.originalPath, requestParameters.page, requestParameters.resizePath, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.webpPath, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, requestParameters.withPeople, requestParameters.withStacked, options).then((request) => request(this.axios, this.basePath)); + public searchMetadata(requestParameters: SearchApiSearchMetadataRequest, options?: RawAxiosRequestConfig) { + return SearchApiFp(this.configuration).searchMetadata(requestParameters.metadataSearchDto, options).then((request) => request(this.axios, this.basePath)); } /** @@ -16184,7 +15730,7 @@ export class SearchApi extends BaseAPI { * @memberof SearchApi */ public searchSmart(requestParameters: SearchApiSearchSmartRequest, options?: RawAxiosRequestConfig) { - return SearchApiFp(this.configuration).searchSmart(requestParameters.query, requestParameters.city, requestParameters.country, requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.deviceId, requestParameters.isArchived, requestParameters.isEncoded, requestParameters.isExternal, requestParameters.isFavorite, requestParameters.isMotion, requestParameters.isOffline, requestParameters.isReadOnly, requestParameters.isVisible, requestParameters.lensModel, requestParameters.libraryId, requestParameters.make, requestParameters.model, requestParameters.page, requestParameters.size, requestParameters.state, requestParameters.takenAfter, requestParameters.takenBefore, requestParameters.trashedAfter, requestParameters.trashedBefore, requestParameters.type, requestParameters.updatedAfter, requestParameters.updatedBefore, requestParameters.withArchived, requestParameters.withDeleted, requestParameters.withExif, options).then((request) => request(this.axios, this.basePath)); + return SearchApiFp(this.configuration).searchSmart(requestParameters.smartSearchDto, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/open-api/typescript-sdk/fetch-client.ts b/open-api/typescript-sdk/fetch-client.ts index 8eef9b3a5c..0f42ff9178 100644 Binary files a/open-api/typescript-sdk/fetch-client.ts and b/open-api/typescript-sdk/fetch-client.ts differ diff --git a/server/src/domain/repositories/search.repository.ts b/server/src/domain/repositories/search.repository.ts index 4d720f98ad..35ead53dbc 100644 --- a/server/src/domain/repositories/search.repository.ts +++ b/server/src/domain/repositories/search.repository.ts @@ -66,13 +66,14 @@ export interface SearchAssetIDOptions { id?: string; } -export interface SearchUserIDOptions { +export interface SearchUserIdOptions { deviceId?: string; libraryId?: string; ownerId?: string; + userIds?: string[]; } -export type SearchIDOptions = SearchAssetIDOptions & SearchUserIDOptions; +export type SearchIdOptions = SearchAssetIDOptions & SearchUserIdOptions; export interface SearchStatusOptions { isArchived?: boolean; @@ -83,6 +84,7 @@ export interface SearchStatusOptions { isOffline?: boolean; isReadOnly?: boolean; isVisible?: boolean; + isNotInAlbum?: boolean; type?: AssetType; withArchived?: boolean; withDeleted?: boolean; @@ -132,6 +134,10 @@ export interface SearchEmbeddingOptions { userIds: string[]; } +export interface SearchPeopleOptions { + personIds?: string[]; +} + export interface SearchOrderOptions { orderDirection?: 'ASC' | 'DESC'; } @@ -142,12 +148,14 @@ export interface SearchPaginationOptions { } export type AssetSearchOptions = SearchDateOptions & - SearchIDOptions & + SearchIdOptions & SearchExifOptions & SearchOrderOptions & SearchPathOptions & SearchRelationOptions & - SearchStatusOptions; + SearchStatusOptions & + SearchUserIdOptions & + SearchPeopleOptions; export type AssetSearchBuilderOptions = Omit; @@ -156,7 +164,8 @@ export type SmartSearchOptions = SearchDateOptions & SearchExifOptions & SearchOneToOneRelationOptions & SearchStatusOptions & - SearchUserIDOptions; + SearchUserIdOptions & + SearchPeopleOptions; export interface FaceEmbeddingSearch extends SearchEmbeddingOptions { hasPerson?: boolean; diff --git a/server/src/domain/search/dto/search.dto.ts b/server/src/domain/search/dto/search.dto.ts index a4e0396688..5aa73433d9 100644 --- a/server/src/domain/search/dto/search.dto.ts +++ b/server/src/domain/search/dto/search.dto.ts @@ -169,6 +169,12 @@ export class MetadataSearchDto extends BaseSearchDto { @Optional() @ApiProperty({ enumName: 'AssetOrder', enum: AssetOrder }) order?: AssetOrder; + + @QueryBoolean({ optional: true }) + isNotInAlbum?: boolean; + + @Optional() + personIds?: string[]; } export class SmartSearchDto extends BaseSearchDto { diff --git a/server/src/domain/search/search.service.ts b/server/src/domain/search/search.service.ts index 49cca2ab48..452c556f41 100644 --- a/server/src/domain/search/search.service.ts +++ b/server/src/domain/search/search.service.ts @@ -60,6 +60,7 @@ export class SearchService { async searchMetadata(auth: AuthDto, dto: MetadataSearchDto): Promise { let checksum: Buffer | undefined; + const userIds = await this.getUserIdsToSearch(auth); if (dto.checksum) { const encoding = dto.checksum.length === 28 ? 'base64' : 'hex'; @@ -74,7 +75,7 @@ export class SearchService { { ...dto, checksum, - ownerId: auth.user.id, + userIds, orderDirection: dto.order ? enumToOrder[dto.order] : 'DESC', }, ); diff --git a/server/src/immich/controllers/search.controller.ts b/server/src/immich/controllers/search.controller.ts index f8438b2e35..4e57cfaa62 100644 --- a/server/src/immich/controllers/search.controller.ts +++ b/server/src/immich/controllers/search.controller.ts @@ -10,7 +10,7 @@ import { SmartSearchDto, } from '@app/domain'; import { SearchSuggestionRequestDto } from '@app/domain/search/dto/search-suggestion.dto'; -import { Controller, Get, Query } from '@nestjs/common'; +import { Body, Controller, Get, Post, Query } from '@nestjs/common'; import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { Auth, Authenticated } from '../app.guard'; import { UseValidation } from '../app.utils'; @@ -22,13 +22,13 @@ import { UseValidation } from '../app.utils'; export class SearchController { constructor(private service: SearchService) {} - @Get('metadata') - searchMetadata(@Auth() auth: AuthDto, @Query() dto: MetadataSearchDto): Promise { + @Post('metadata') + searchMetadata(@Auth() auth: AuthDto, @Body() dto: MetadataSearchDto): Promise { return this.service.searchMetadata(auth, dto); } - @Get('smart') - searchSmart(@Auth() auth: AuthDto, @Query() dto: SmartSearchDto): Promise { + @Post('smart') + searchSmart(@Auth() auth: AuthDto, @Body() dto: SmartSearchDto): Promise { return this.service.searchSmart(auth, dto); } diff --git a/server/src/infra/infra.utils.ts b/server/src/infra/infra.utils.ts index 89bd319662..2b274cb12a 100644 --- a/server/src/infra/infra.utils.ts +++ b/server/src/infra/infra.utils.ts @@ -139,14 +139,27 @@ export function searchAssetBuilder( ); const exifInfo = _.omitBy(_.pick(options, ['city', 'country', 'lensModel', 'make', 'model', 'state']), _.isUndefined); - if (Object.keys(exifInfo).length > 0) { - builder.leftJoin(`${builder.alias}.exifInfo`, 'exifInfo'); + const hasExifQuery = Object.keys(exifInfo).length > 0; + + if (options.withExif && !hasExifQuery) { + builder.leftJoinAndSelect(`${builder.alias}.exifInfo`, 'exifInfo'); + } + + if (hasExifQuery) { + options.withExif + ? builder.leftJoinAndSelect(`${builder.alias}.exifInfo`, 'exifInfo') + : builder.leftJoin(`${builder.alias}.exifInfo`, 'exifInfo'); + builder.andWhere({ exifInfo }); } - const id = _.pick(options, ['checksum', 'deviceAssetId', 'deviceId', 'id', 'libraryId', 'ownerId']); + const id = _.pick(options, ['checksum', 'deviceAssetId', 'deviceId', 'id', 'libraryId']); builder.andWhere(_.omitBy(id, _.isUndefined)); + if (options.userIds) { + builder.andWhere(`${builder.alias}.ownerId IN (:...userIds)`, { userIds: options.userIds }); + } + const path = _.pick(options, ['encodedVideoPath', 'originalFileName', 'originalPath', 'resizePath', 'webpPath']); builder.andWhere(_.omitBy(path, _.isUndefined)); @@ -164,8 +177,8 @@ export function searchAssetBuilder( ), ); - if (options.withExif) { - builder.leftJoinAndSelect(`${builder.alias}.exifInfo`, 'exifInfo'); + if (options.isNotInAlbum) { + builder.leftJoin(`${builder.alias}.albums`, 'albums').andWhere('albums.id IS NULL'); } if (options.withFaces || options.withPeople) { @@ -180,6 +193,18 @@ export function searchAssetBuilder( builder.leftJoinAndSelect(`${builder.alias}.smartInfo`, 'smartInfo'); } + if (options.personIds && options.personIds.length > 0) { + builder + .leftJoin(`${builder.alias}.faces`, 'faces') + .andWhere('faces.personId IN (:...personIds)', { personIds: options.personIds }) + .addGroupBy(`${builder.alias}.id`) + .having('COUNT(faces.id) = :personCount', { personCount: options.personIds.length }); + + if (options.withExif) { + builder.addGroupBy('exifInfo.assetId'); + } + } + if (options.withStacked) { builder .leftJoinAndSelect(`${builder.alias}.stack`, 'stack') diff --git a/server/src/infra/repositories/search.repository.ts b/server/src/infra/repositories/search.repository.ts index 7d0421b05d..a30c96b10d 100644 --- a/server/src/infra/repositories/search.repository.ts +++ b/server/src/infra/repositories/search.repository.ts @@ -58,6 +58,7 @@ export class SearchRepository implements ISearchRepository { ownerId: DummyValue.UUID, withStacked: true, isFavorite: true, + ownerIds: [DummyValue.UUID], }, ], }) @@ -66,7 +67,6 @@ export class SearchRepository implements ISearchRepository { builder = searchAssetBuilder(builder, options); builder.orderBy('asset.fileCreatedAt', options.orderDirection ?? 'DESC'); - return paginatedBuilder(builder, { mode: PaginationMode.SKIP_TAKE, skip: (pagination.page - 1) * pagination.size, diff --git a/server/src/infra/sql/search.repository.sql b/server/src/infra/sql/search.repository.sql index 538a854094..ebae46f65b 100644 --- a/server/src/infra/sql/search.repository.sql +++ b/server/src/infra/sql/search.repository.sql @@ -77,9 +77,9 @@ FROM ( "asset"."fileCreatedAt" >= $1 AND "exifInfo"."lensModel" = $2 - AND "asset"."ownerId" = $3 AND 1 = 1 - AND "asset"."isFavorite" = $4 + AND 1 = 1 + AND "asset"."isFavorite" = $3 AND ( "stack"."primaryAssetId" = "asset"."id" OR "asset"."stackId" IS NULL diff --git a/web/.eslintrc.cjs b/web/.eslintrc.cjs index de62060e0f..ef17242c8e 100644 --- a/web/.eslintrc.cjs +++ b/web/.eslintrc.cjs @@ -38,6 +38,7 @@ module.exports = { 'unicorn/prevent-abbreviations': 'off', 'unicorn/no-nested-ternary': 'off', 'unicorn/consistent-function-scoping': 'off', + 'unicorn/prefer-top-level-await': 'off', '@typescript-eslint/no-unused-vars': [ 'warn', { diff --git a/web/src/lib/components/memory-page/memory-viewer.svelte b/web/src/lib/components/memory-page/memory-viewer.svelte index af26a7bffa..397c167d16 100644 --- a/web/src/lib/components/memory-page/memory-viewer.svelte +++ b/web/src/lib/components/memory-page/memory-viewer.svelte @@ -7,6 +7,7 @@ import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte'; import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte'; import { AppRoute, QueryParameter } from '$lib/constants'; + import type { Viewport } from '$lib/stores/assets.store'; import { memoryStore } from '$lib/stores/memory.store'; import { getAssetThumbnailUrl } from '$lib/utils'; import { fromLocalDateTime } from '$lib/utils/timeline-util'; @@ -34,6 +35,7 @@ $: canGoForward = !!(nextMemory || nextAsset); $: canGoBack = !!(previousMemory || previousAsset); + const viewport: Viewport = { width: 0, height: 0 }; const toNextMemory = () => goto(`?${QueryParameter.MEMORY_INDEX}=${memoryIndex + 1}`); const toPreviousMemory = () => goto(`?${QueryParameter.MEMORY_INDEX}=${memoryIndex - 1}`); @@ -251,7 +253,7 @@ -
+
(galleryInView = false)} bottom={-200} > -
diff --git a/web/src/lib/components/photos-page/asset-date-group.svelte b/web/src/lib/components/photos-page/asset-date-group.svelte index a38708e881..04fb872116 100644 --- a/web/src/lib/components/photos-page/asset-date-group.svelte +++ b/web/src/lib/components/photos-page/asset-date-group.svelte @@ -5,7 +5,12 @@ import type { AssetStore, Viewport } from '$lib/stores/assets.store'; import { locale } from '$lib/stores/preferences.store'; import { getAssetRatio } from '$lib/utils/asset-utils'; - import { formatGroupTitle, fromLocalDateTime, splitBucketIntoDateGroups } from '$lib/utils/timeline-util'; + import { + calculateWidth, + formatGroupTitle, + fromLocalDateTime, + splitBucketIntoDateGroups, + } from '$lib/utils/timeline-util'; import type { AssetResponseDto } from '@immich/sdk'; import { mdiCheckCircle, mdiCircleOutline } from '@mdi/js'; import justifiedLayout from 'justified-layout'; @@ -36,12 +41,6 @@ let actualBucketHeight: number; let hoveredDateGroup = ''; - interface LayoutBox { - top: number; - left: number; - width: number; - } - $: assetsGroupByDate = splitBucketIntoDateGroups(assets, $locale); $: geometry = (() => { @@ -80,17 +79,6 @@ }); } - const calculateWidth = (boxes: LayoutBox[]): number => { - let width = 0; - for (const box of boxes) { - if (box.top < 100) { - width = box.left + box.width; - } - } - - return width; - }; - const assetClickHandler = (asset: AssetResponseDto, assetsInDateGroup: AssetResponseDto[], groupTitle: string) => { if (isSelectionMode || $isMultiSelectState) { assetSelectHandler(asset, assetsInDateGroup, groupTitle); diff --git a/web/src/lib/components/share-page/individual-shared-viewer.svelte b/web/src/lib/components/share-page/individual-shared-viewer.svelte index 37b2983ae1..0036331378 100644 --- a/web/src/lib/components/share-page/individual-shared-viewer.svelte +++ b/web/src/lib/components/share-page/individual-shared-viewer.svelte @@ -16,10 +16,12 @@ import GalleryViewer from '../shared-components/gallery-viewer/gallery-viewer.svelte'; import ImmichLogo from '../shared-components/immich-logo.svelte'; import { NotificationType, notificationController } from '../shared-components/notification/notification'; + import type { Viewport } from '$lib/stores/assets.store'; export let sharedLink: SharedLinkResponseDto; export let isOwned: boolean; + const viewport: Viewport = { width: 0, height: 0 }; let selectedAssets: Set = new Set(); $: assets = sharedLink.assets; @@ -97,7 +99,7 @@ {/if} -
- +
+
diff --git a/web/src/lib/components/shared-components/control-app-bar.svelte b/web/src/lib/components/shared-components/control-app-bar.svelte index e8d56b742c..bdb2aed709 100644 --- a/web/src/lib/components/shared-components/control-app-bar.svelte +++ b/web/src/lib/components/shared-components/control-app-bar.svelte @@ -51,7 +51,7 @@
diff --git a/web/src/lib/components/shared-components/gallery-viewer/gallery-viewer.svelte b/web/src/lib/components/shared-components/gallery-viewer/gallery-viewer.svelte index fa1d7d6732..2fb4feb67a 100644 --- a/web/src/lib/components/shared-components/gallery-viewer/gallery-viewer.svelte +++ b/web/src/lib/components/shared-components/gallery-viewer/gallery-viewer.svelte @@ -2,13 +2,14 @@ import { page } from '$app/stores'; import Thumbnail from '$lib/components/assets/thumbnail/thumbnail.svelte'; import { assetViewingStore } from '$lib/stores/asset-viewing.store'; - import type { BucketPosition } from '$lib/stores/assets.store'; + import type { BucketPosition, Viewport } from '$lib/stores/assets.store'; import { handleError } from '$lib/utils/handle-error'; - import { getThumbnailSize } from '$lib/utils/thumbnail-util'; - import { ThumbnailFormat, type AssetResponseDto } from '@immich/sdk'; + import { type AssetResponseDto } from '@immich/sdk'; import { createEventDispatcher, onDestroy } from 'svelte'; - import { flip } from 'svelte/animate'; import AssetViewer from '../../asset-viewer/asset-viewer.svelte'; + import justifiedLayout from 'justified-layout'; + import { getAssetRatio } from '$lib/utils/asset-utils'; + import { calculateWidth } from '$lib/utils/timeline-util'; const dispatch = createEventDispatcher<{ intersected: { container: HTMLDivElement; position: BucketPosition } }>(); @@ -16,14 +17,12 @@ export let selectedAssets: Set = new Set(); export let disableAssetSelect = false; export let showArchiveIcon = false; + export let viewport: Viewport; let { isViewing: showAssetViewer } = assetViewingStore; let selectedAsset: AssetResponseDto; let currentViewAssetIndex = 0; - let viewWidth: number; - $: thumbnailSize = getThumbnailSize(assets.length, viewWidth); - $: isMultiSelectionMode = selectedAssets.size > 0; const viewAssetHandler = (event: CustomEvent) => { @@ -86,23 +85,45 @@ onDestroy(() => { $showAssetViewer = false; }); + + $: geometry = (() => { + const justifiedLayoutResult = justifiedLayout( + assets.map((asset) => getAssetRatio(asset)), + { + boxSpacing: 2, + containerWidth: Math.floor(viewport.width), + containerPadding: 0, + targetRowHeightTolerance: 0.15, + targetRowHeight: 235, + }, + ); + + return { + ...justifiedLayoutResult, + containerWidth: calculateWidth(justifiedLayoutResult.boxes), + }; + })(); {#if assets.length > 0} -
- {#each assets as asset, i (asset.id)} -
+
+ {#each assets as asset, i (i)} +
(isMultiSelectionMode ? selectAssetHandler(e) : viewAssetHandler(e))} on:select={selectAssetHandler} on:intersected={(event) => i === Math.max(1, assets.length - 7) ? dispatch('intersected', event.detail) : undefined} selected={selectedAssets.has(asset)} {showArchiveIcon} + thumbnailWidth={geometry.boxes[i].width} + thumbnailHeight={geometry.boxes[i].height} />
{/each} diff --git a/web/src/lib/components/shared-components/search-bar/search-bar.svelte b/web/src/lib/components/shared-components/search-bar/search-bar.svelte index 8dfba184ad..62e950566d 100644 --- a/web/src/lib/components/shared-components/search-bar/search-bar.svelte +++ b/web/src/lib/components/shared-components/search-bar/search-bar.svelte @@ -2,12 +2,18 @@ import { AppRoute } from '$lib/constants'; import Icon from '$lib/components/elements/icon.svelte'; import { goto } from '$app/navigation'; - import { isSearchEnabled, preventRaceConditionSearchBar, savedSearchTerms } from '$lib/stores/search.store'; + import { + isSearchEnabled, + preventRaceConditionSearchBar, + savedSearchTerms, + searchQuery, + } from '$lib/stores/search.store'; import { clickOutside } from '$lib/utils/click-outside'; import { mdiClose, mdiMagnify, mdiTune } from '@mdi/js'; import IconButton from '$lib/components/elements/buttons/icon-button.svelte'; import SearchHistoryBox from './search-history-box.svelte'; import SearchFilterBox from './search-filter-box.svelte'; + import type { MetadataSearchDto, SmartSearchDto } from '@immich/sdk'; export let value = ''; export let grayTheme: boolean; @@ -17,28 +23,17 @@ let showFilter = false; $: showClearIcon = value.length > 0; - function onSearch() { - let smartSearch = 'true'; - let searchValue = value; - - if (value.slice(0, 2) == 'm:') { - smartSearch = 'false'; - searchValue = value.slice(2); - } - - $savedSearchTerms = $savedSearchTerms.filter((item) => item !== value); - saveSearchTerm(value); - + const onSearch = (payload: SmartSearchDto | MetadataSearchDto) => { const parameters = new URLSearchParams({ - q: searchValue, - smart: smartSearch, - take: '100', + query: JSON.stringify(payload), }); showHistory = false; + showFilter = false; $isSearchEnabled = false; + $searchQuery = payload; goto(`${AppRoute.SEARCH}?${parameters}`, { invalidateAll: true }); - } + }; const clearSearchTerm = (searchTerm: string) => { input.focus(); @@ -70,6 +65,26 @@ showHistory = false; $isSearchEnabled = false; + showFilter = false; + }; + + const onHistoryTermClick = (searchTerm: string) => { + const searchPayload = { query: searchTerm }; + onSearch(searchPayload); + }; + + const onFilterClick = () => { + showFilter = !showFilter; + value = ''; + + if (showFilter) { + showHistory = false; + } + }; + + const onSubmit = () => { + onSearch({ query: value }); + saveSearchTerm(value); }; @@ -80,7 +95,7 @@ class="relative select-text text-sm" action={AppRoute.SEARCH} on:reset={() => (value = '')} - on:submit|preventDefault={() => onSearch()} + on:submit|preventDefault={onSubmit} >
-
+{#if terms} +
+ {#each Object.keys(terms) as key, index (index)} +
+
+ {getHumanReadableSearchKey(key)} +
+ + {#if terms[key] !== true} +
+ {#if key === 'takenAfter' || key === 'takenBefore'} + {getHumanReadableDate(terms[key])} + {:else if key === 'personIds'} + {#await getPersonName(terms[key]) then personName} + {personName} + {/await} + {:else} + {terms[key]} + {/if} +
+ {/if} +
+ {/each} +
+{/if} + +
{#if albums && albums.length > 0}
@@ -193,14 +317,13 @@ {/if}
{#if searchResultAssets && searchResultAssets.length > 0} -
- -
+ {:else}
diff --git a/web/src/routes/(user)/search/+page.ts b/web/src/routes/(user)/search/+page.ts index e3c99b007b..b2997e70b0 100644 --- a/web/src/routes/(user)/search/+page.ts +++ b/web/src/routes/(user)/search/+page.ts @@ -1,6 +1,13 @@ import { QueryParameter } from '$lib/constants'; +import { searchQuery } from '$lib/stores/search.store'; import { authenticate } from '$lib/utils/auth'; -import { search, type AssetResponseDto, type SearchResponseDto } from '@immich/sdk'; +import { + searchMetadata, + searchSmart, + type MetadataSearchDto, + type SearchResponseDto, + type SmartSearchDto, +} from '@immich/sdk'; import type { PageLoad } from './$types'; export const load = (async (data) => { @@ -10,22 +17,13 @@ export const load = (async (data) => { url.searchParams.get(QueryParameter.SEARCH_TERM) || url.searchParams.get(QueryParameter.QUERY) || undefined; let results: SearchResponseDto | null = null; if (term) { - let params = {}; - for (const [key, value] of data.url.searchParams) { - params = { ...params, [key]: value }; - } - const response = await search({ ...params }); - let items: AssetResponseDto[] = (data as unknown as { results: SearchResponseDto }).results?.assets.items; - if (items) { - items.push(...response.assets.items); - } else { - items = response.assets.items; - } - const assets = { ...response.assets, items }; - results = { - assets, - albums: response.albums, - }; + const payload = JSON.parse(term) as SmartSearchDto | MetadataSearchDto; + searchQuery.set(payload); + + results = + payload && 'query' in payload + ? await searchSmart({ smartSearchDto: { ...payload, withExif: true } }) + : await searchMetadata({ metadataSearchDto: { ...payload, withExif: true } }); } return {