From df42352f84914be26826fdaaa62a28f94a3f681e Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 17 May 2024 09:58:55 -0500 Subject: [PATCH] chore(server): openapi generation (#9554) --- mobile/openapi/README.md | 1 - mobile/openapi/doc/AssetApi.md | 38 ------------------ mobile/openapi/lib/api/asset_api.dart | 44 --------------------- mobile/openapi/test/asset_api_test.dart | 5 --- open-api/immich-openapi-specs.json | 24 ----------- open-api/typescript-sdk/src/fetch-client.ts | 8 ---- 6 files changed, 120 deletions(-) diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 4afeb179a4afd..b5a49aa26c262 100644 --- a/mobile/openapi/README.md +++ b/mobile/openapi/README.md @@ -98,7 +98,6 @@ Class | Method | HTTP request | Description *AssetApi* | [**deleteAssets**](doc//AssetApi.md#deleteassets) | **DELETE** /asset | *AssetApi* | [**getAllAssets**](doc//AssetApi.md#getallassets) | **GET** /asset | *AssetApi* | [**getAllUserAssetsByDeviceId**](doc//AssetApi.md#getalluserassetsbydeviceid) | **GET** /asset/device/{deviceId} | -*AssetApi* | [**getAssetDuplicates**](doc//AssetApi.md#getassetduplicates) | **GET** /asset/duplicates | *AssetApi* | [**getAssetInfo**](doc//AssetApi.md#getassetinfo) | **GET** /asset/{id} | *AssetApi* | [**getAssetStatistics**](doc//AssetApi.md#getassetstatistics) | **GET** /asset/statistics | *AssetApi* | [**getAssetThumbnail**](doc//AssetApi.md#getassetthumbnail) | **GET** /asset/thumbnail/{id} | diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index da070ccfc4f41..a1491c79a2d81 100644 --- a/mobile/openapi/doc/AssetApi.md +++ b/mobile/openapi/doc/AssetApi.md @@ -14,7 +14,6 @@ Method | HTTP request | Description [**deleteAssets**](AssetApi.md#deleteassets) | **DELETE** /asset | [**getAllAssets**](AssetApi.md#getallassets) | **GET** /asset | [**getAllUserAssetsByDeviceId**](AssetApi.md#getalluserassetsbydeviceid) | **GET** /asset/device/{deviceId} | -[**getAssetDuplicates**](AssetApi.md#getassetduplicates) | **GET** /asset/duplicates | [**getAssetInfo**](AssetApi.md#getassetinfo) | **GET** /asset/{id} | [**getAssetStatistics**](AssetApi.md#getassetstatistics) | **GET** /asset/statistics | [**getAssetThumbnail**](AssetApi.md#getassetthumbnail) | **GET** /asset/thumbnail/{id} | @@ -325,43 +324,6 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **getAssetDuplicates** -> List getAssetDuplicates() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api_instance = AssetApi(); - -try { - final result = api_instance.getAssetDuplicates(); - print(result); -} catch (e) { - print('Exception when calling AssetApi->getAssetDuplicates: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**List**](AssetResponseDto.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **getAssetInfo** > AssetResponseDto getAssetInfo(id, key) diff --git a/mobile/openapi/lib/api/asset_api.dart b/mobile/openapi/lib/api/asset_api.dart index 5c81b89c58a3f..dba33fc181ba9 100644 --- a/mobile/openapi/lib/api/asset_api.dart +++ b/mobile/openapi/lib/api/asset_api.dart @@ -326,50 +326,6 @@ class AssetApi { return null; } - /// Performs an HTTP 'GET /asset/duplicates' operation and returns the [Response]. - Future getAssetDuplicatesWithHttpInfo() async { - // ignore: prefer_const_declarations - final path = r'/asset/duplicates'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - path, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - Future?> getAssetDuplicates() async { - final response = await getAssetDuplicatesWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - // When a remote server returns no body with a status of 204, we shall not decode it. - // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" - // FormatException when trying to decode an empty string. - if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { - final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, 'List') as List) - .cast() - .toList(growable: false); - - } - return null; - } - /// Performs an HTTP 'GET /asset/{id}' operation and returns the [Response]. /// Parameters: /// diff --git a/mobile/openapi/test/asset_api_test.dart b/mobile/openapi/test/asset_api_test.dart index 4ab806f35b573..de84e53546274 100644 --- a/mobile/openapi/test/asset_api_test.dart +++ b/mobile/openapi/test/asset_api_test.dart @@ -50,11 +50,6 @@ void main() { // TODO }); - //Future> getAssetDuplicates() async - test('test getAssetDuplicates', () async { - // TODO - }); - //Future getAssetInfo(String id, { String key }) async test('test getAssetInfo', () async { // TODO diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 425bf81714eef..f59bc7a0ad92a 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -1194,30 +1194,6 @@ ] } }, - "/asset/duplicates": { - "get": { - "operationId": "getAssetDuplicates", - "parameters": [], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/AssetResponseDto" - }, - "type": "array" - } - } - }, - "description": "" - } - }, - "tags": [ - "Asset" - ] - } - }, "/asset/exist": { "post": { "description": "Checks if multiple assets exist on the server and returns all existing - used by background backup", diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index 020188c8a84ae..996f69de83f5a 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -1407,14 +1407,6 @@ export function getAllUserAssetsByDeviceId({ deviceId }: { ...opts })); } -export function getAssetDuplicates(opts?: Oazapfts.RequestOpts) { - return oazapfts.ok(oazapfts.fetchJson<{ - status: 200; - data: AssetResponseDto[]; - }>("/asset/duplicates", { - ...opts - })); -} /** * Checks if multiple assets exist on the server and returns all existing - used by background backup */