From 89aff7764dfd7c3e85b1c12f79f363f06236b092 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Thu, 26 Jan 2023 21:51:22 -0500 Subject: [PATCH] chore(server): remove deprecated device endpoints (#1436) * chore: remove endpoints * chore: generate open-api --- mobile/openapi/README.md | Bin 13766 -> 13549 bytes mobile/openapi/doc/DeviceInfoApi.md | Bin 4788 -> 1733 bytes mobile/openapi/lib/api/device_info_api.dart | Bin 5600 -> 2137 bytes mobile/openapi/test/device_info_api_test.dart | Bin 1038 -> 650 bytes .../device-info/device-info.controller.ts | 20 +-- server/immich-openapi-specs.json | 72 --------- web/src/api/open-api/api.ts | 146 ------------------ 7 files changed, 1 insertion(+), 237 deletions(-) diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 30bcbc8b3f7737ad6f17330d77b8ec20106135dc..0d94740bd507e94acc1cf042cb4f205bd32930e1 100644 GIT binary patch delta 12 TcmX?>{Wf#MF0sv%#f{|vERF@X delta 119 zcmaExc`SRwE-|*`qSVBa)X4|LR5T&Xl+?1!a;?$y&i4Wx`uVysbtjIf=6#$U&3OfJ* delta 268 zcmX@gyG3=vZMNj1)Wnk1i4Wz?Agq+svdrYv%)GRGO@$f-Ev*3m;1De>1$~IPE=U3> z&K0etRa%e&)~ToqqA~P2hB$j*(>U3HQDovDVPD)&!{~4A&c;4C&p%0 E09Q&`EdT%j diff --git a/mobile/openapi/lib/api/device_info_api.dart b/mobile/openapi/lib/api/device_info_api.dart index 4cde7c5e4ab1cd2f62e5c1bfaedd5c70e2f66f6e..ac3c81842d79fe4487bb45a35ccf2090443221c6 100644 GIT binary patch delta 12 TcmaE$eN$k=CdSQ{{L9$@CAS3t delta 175 zcmca9@IZURCPr?Dl+=Qv)a1mH)Rf7a7+13;7o`H(lQ*!6Z?0n6!^q?xJlULOI*PJ$ zEOjttL97u_=H?Bo%bA3@6cqIJ^%YPJUCWY!Y$S_gh_lCJ3zlhUhBiQy1+hkf8DIk^ NA7>HSyq|Fv8vyvRKN|o5 diff --git a/mobile/openapi/test/device_info_api_test.dart b/mobile/openapi/test/device_info_api_test.dart index 5bfbb4c328eccb1a1499eebe65652a526f611642..94897849a9fbf9d0bd93186ff3b47e2c7748c4c6 100644 GIT binary patch delta 11 ScmeC<=wjV)iE(lm^9}$RL;RiILkOCAFX^H94^)HD&T8Mjf`~qEsMzG7FO@j2X;iD4?LAudjfrRF5SE PqR<<{04ke&mT@ltEG`|G diff --git a/server/apps/immich/src/api-v1/device-info/device-info.controller.ts b/server/apps/immich/src/api-v1/device-info/device-info.controller.ts index 3e57f47e5f..779b3fbe91 100644 --- a/server/apps/immich/src/api-v1/device-info/device-info.controller.ts +++ b/server/apps/immich/src/api-v1/device-info/device-info.controller.ts @@ -1,4 +1,4 @@ -import { Body, Controller, Patch, Post, Put, ValidationPipe } from '@nestjs/common'; +import { Body, Controller, Put, ValidationPipe } from '@nestjs/common'; import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; import { AuthUserDto, GetAuthUser } from '../../decorators/auth-user.decorator'; import { Authenticated } from '../../decorators/authenticated.decorator'; @@ -13,24 +13,6 @@ import { DeviceInfoResponseDto, mapDeviceInfoResponse } from './response-dto/dev export class DeviceInfoController { constructor(private readonly deviceInfoService: DeviceInfoService) {} - /** @deprecated */ - @Post() - public async createDeviceInfo( - @GetAuthUser() user: AuthUserDto, - @Body(ValidationPipe) dto: UpsertDeviceInfoDto, - ): Promise { - return this.upsertDeviceInfo(user, dto); - } - - /** @deprecated */ - @Patch() - public async updateDeviceInfo( - @GetAuthUser() user: AuthUserDto, - @Body(ValidationPipe) dto: UpsertDeviceInfoDto, - ): Promise { - return this.upsertDeviceInfo(user, dto); - } - @Put() public async upsertDeviceInfo( @GetAuthUser() user: AuthUserDto, diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index ca2277dec9..eedc18f5c2 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -2506,78 +2506,6 @@ } }, "/device-info": { - "post": { - "operationId": "createDeviceInfo", - "description": "@deprecated", - "deprecated": true, - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpsertDeviceInfoDto" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceInfoResponseDto" - } - } - } - } - }, - "tags": [ - "Device Info" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "patch": { - "operationId": "updateDeviceInfo", - "description": "@deprecated", - "deprecated": true, - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpsertDeviceInfoDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceInfoResponseDto" - } - } - } - } - }, - "tags": [ - "Device Info" - ], - "security": [ - { - "bearer": [] - } - ] - }, "put": { "operationId": "upsertDeviceInfo", "description": "", diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 9bacb5d165..f7333f306d 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -5487,86 +5487,6 @@ export class AuthenticationApi extends BaseAPI { */ export const DeviceInfoApiAxiosParamCreator = function (configuration?: Configuration) { return { - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - createDeviceInfo: async (upsertDeviceInfoDto: UpsertDeviceInfoDto, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'upsertDeviceInfoDto' is not null or undefined - assertParamExists('createDeviceInfo', 'upsertDeviceInfoDto', upsertDeviceInfoDto) - const localVarPath = `/device-info`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(upsertDeviceInfoDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - updateDeviceInfo: async (upsertDeviceInfoDto: UpsertDeviceInfoDto, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'upsertDeviceInfoDto' is not null or undefined - assertParamExists('updateDeviceInfo', 'upsertDeviceInfoDto', upsertDeviceInfoDto) - const localVarPath = `/device-info`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(upsertDeviceInfoDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto @@ -5616,28 +5536,6 @@ export const DeviceInfoApiAxiosParamCreator = function (configuration?: Configur export const DeviceInfoApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = DeviceInfoApiAxiosParamCreator(configuration) return { - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - async createDeviceInfo(upsertDeviceInfoDto: UpsertDeviceInfoDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createDeviceInfo(upsertDeviceInfoDto, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - async updateDeviceInfo(upsertDeviceInfoDto: UpsertDeviceInfoDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateDeviceInfo(upsertDeviceInfoDto, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto @@ -5658,26 +5556,6 @@ export const DeviceInfoApiFp = function(configuration?: Configuration) { export const DeviceInfoApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = DeviceInfoApiFp(configuration) return { - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - createDeviceInfo(upsertDeviceInfoDto: UpsertDeviceInfoDto, options?: any): AxiosPromise { - return localVarFp.createDeviceInfo(upsertDeviceInfoDto, options).then((request) => request(axios, basePath)); - }, - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - updateDeviceInfo(upsertDeviceInfoDto: UpsertDeviceInfoDto, options?: any): AxiosPromise { - return localVarFp.updateDeviceInfo(upsertDeviceInfoDto, options).then((request) => request(axios, basePath)); - }, /** * * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto @@ -5697,30 +5575,6 @@ export const DeviceInfoApiFactory = function (configuration?: Configuration, bas * @extends {BaseAPI} */ export class DeviceInfoApi extends BaseAPI { - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - * @memberof DeviceInfoApi - */ - public createDeviceInfo(upsertDeviceInfoDto: UpsertDeviceInfoDto, options?: AxiosRequestConfig) { - return DeviceInfoApiFp(this.configuration).createDeviceInfo(upsertDeviceInfoDto, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * @deprecated - * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - * @memberof DeviceInfoApi - */ - public updateDeviceInfo(upsertDeviceInfoDto: UpsertDeviceInfoDto, options?: AxiosRequestConfig) { - return DeviceInfoApiFp(this.configuration).updateDeviceInfo(upsertDeviceInfoDto, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {UpsertDeviceInfoDto} upsertDeviceInfoDto