From 90a7f16817f3416ff3a9406413298590a1602eba Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Thu, 8 Feb 2024 16:57:54 -0500 Subject: [PATCH] chore(server): remove deprecated endpoints (#6984) * chore: remove deprecated endpoints * chore: open api --- .../services/asset_description.service.dart | 2 +- .../services/image_viewer.service.dart | 8 +- .../services/backup_verification.service.dart | 6 +- .../modules/trash/services/trash.service.dart | 6 +- mobile/lib/shared/services/api.service.dart | 4 + mobile/lib/shared/services/asset.service.dart | 2 +- mobile/lib/shared/services/share.service.dart | 4 +- mobile/openapi/.openapi-generator/FILES | 3 - mobile/openapi/README.md | Bin 24949 -> 24057 bytes mobile/openapi/doc/AssetApi.md | Bin 71577 -> 57403 bytes mobile/openapi/doc/OAuthApi.md | Bin 8254 -> 7105 bytes mobile/openapi/doc/OAuthConfigResponseDto.md | Bin 585 -> 0 bytes mobile/openapi/lib/api.dart | Bin 8310 -> 8264 bytes mobile/openapi/lib/api/asset_api.dart | Bin 69046 -> 58921 bytes mobile/openapi/lib/api/o_auth_api.dart | Bin 9459 -> 7687 bytes mobile/openapi/lib/api_client.dart | Bin 23515 -> 23419 bytes .../lib/model/o_auth_config_response_dto.dart | Bin 5317 -> 0 bytes mobile/openapi/test/asset_api_test.dart | Bin 6696 -> 5691 bytes mobile/openapi/test/o_auth_api_test.dart | Bin 1378 -> 1148 bytes .../test/o_auth_config_response_dto_test.dart | Bin 1008 -> 0 bytes open-api/immich-openapi-specs.json | 348 -------- open-api/typescript-sdk/axios-client/api.ts | 758 ------------------ .../fetch-client/.openapi-generator/FILES | 1 - .../fetch-client/apis/AssetApi.ts | 334 -------- .../fetch-client/apis/OAuthApi.ts | 42 - .../fetch-client/models/index.ts | 1 - server/e2e/api/specs/asset.e2e-spec.ts | 190 ++--- server/e2e/api/specs/download.e2e-spec.ts | 89 ++ server/e2e/client/asset-api.ts | 6 +- server/src/domain/auth/auth.dto.ts | 9 - server/src/domain/auth/auth.service.spec.ts | 21 - server/src/domain/auth/auth.service.ts | 23 - .../system-config/system-config.core.ts | 2 - .../immich/api-v1/asset/asset.controller.ts | 20 +- .../immich/controllers/asset.controller.ts | 88 +- .../immich/controllers/oauth.controller.ts | 8 - 36 files changed, 168 insertions(+), 1807 deletions(-) delete mode 100644 mobile/openapi/doc/OAuthConfigResponseDto.md delete mode 100644 mobile/openapi/lib/model/o_auth_config_response_dto.dart delete mode 100644 mobile/openapi/test/o_auth_config_response_dto_test.dart create mode 100644 server/e2e/api/specs/download.e2e-spec.ts diff --git a/mobile/lib/modules/asset_viewer/services/asset_description.service.dart b/mobile/lib/modules/asset_viewer/services/asset_description.service.dart index 9abf69a93a..09de411e5d 100644 --- a/mobile/lib/modules/asset_viewer/services/asset_description.service.dart +++ b/mobile/lib/modules/asset_viewer/services/asset_description.service.dart @@ -36,7 +36,7 @@ class AssetDescriptionService { Future readLatest(String assetRemoteId, int localExifId) async { final latestAssetFromServer = - await _api.assetApi.getAssetById(assetRemoteId); + await _api.assetApi.getAssetInfo(assetRemoteId); final localExifInfo = await _db.exifInfos.get(localExifId); if (latestAssetFromServer != null && localExifInfo != null) { diff --git a/mobile/lib/modules/asset_viewer/services/image_viewer.service.dart b/mobile/lib/modules/asset_viewer/services/image_viewer.service.dart index 301fbdfe29..db527c6e23 100644 --- a/mobile/lib/modules/asset_viewer/services/image_viewer.service.dart +++ b/mobile/lib/modules/asset_viewer/services/image_viewer.service.dart @@ -25,12 +25,12 @@ class ImageViewerService { // Download LivePhotos image and motion part if (asset.isImage && asset.livePhotoVideoId != null && Platform.isIOS) { var imageResponse = - await _apiService.assetApi.downloadFileOldWithHttpInfo( + await _apiService.downloadApi.downloadFileWithHttpInfo( asset.remoteId!, ); var motionReponse = - await _apiService.assetApi.downloadFileOldWithHttpInfo( + await _apiService.downloadApi.downloadFileWithHttpInfo( asset.livePhotoVideoId!, ); @@ -71,8 +71,8 @@ class ImageViewerService { return entity != null; } else { - var res = await _apiService.assetApi - .downloadFileOldWithHttpInfo(asset.remoteId!); + var res = await _apiService.downloadApi + .downloadFileWithHttpInfo(asset.remoteId!); if (res.statusCode != 200) { _log.severe( diff --git a/mobile/lib/modules/backup/services/backup_verification.service.dart b/mobile/lib/modules/backup/services/backup_verification.service.dart index 1447abe90a..95e3a8d58b 100644 --- a/mobile/lib/modules/backup/services/backup_verification.service.dart +++ b/mobile/lib/modules/backup/services/backup_verification.service.dart @@ -136,7 +136,7 @@ class BackupVerificationService { ExifInfo? exif = remote.exifInfo; if (exif != null && exif.lat != null) return false; if (exif == null || exif.fileSize == null) { - final dto = await apiService.assetApi.getAssetById(remote.remoteId!); + final dto = await apiService.assetApi.getAssetInfo(remote.remoteId!); if (dto != null && dto.exifInfo != null) { exif = ExifInfo.fromDto(dto.exifInfo!); } @@ -165,8 +165,8 @@ class BackupVerificationService { // (skip first few KBs containing metadata) final Uint64List localImage = _fakeDecodeImg(local, await file.readAsBytes()); - final res = await apiService.assetApi - .downloadFileOldWithHttpInfo(remote.remoteId!); + final res = await apiService.downloadApi + .downloadFileWithHttpInfo(remote.remoteId!); final Uint64List remoteImage = _fakeDecodeImg(remote, res.bodyBytes); final eq = const ListEquality().equals(remoteImage, localImage); diff --git a/mobile/lib/modules/trash/services/trash.service.dart b/mobile/lib/modules/trash/services/trash.service.dart index cfcae27653..9a9ff5d0b6 100644 --- a/mobile/lib/modules/trash/services/trash.service.dart +++ b/mobile/lib/modules/trash/services/trash.service.dart @@ -22,7 +22,7 @@ class TrashService { try { List remoteIds = assetList.where((a) => a.isRemote).map((e) => e.remoteId!).toList(); - await _apiService.assetApi.restoreAssetsOld(BulkIdsDto(ids: remoteIds)); + await _apiService.trashApi.restoreAssets(BulkIdsDto(ids: remoteIds)); return true; } catch (error, stack) { _log.severe("Cannot restore assets ${error.toString()}", error, stack); @@ -32,7 +32,7 @@ class TrashService { Future emptyTrash() async { try { - await _apiService.assetApi.emptyTrashOld(); + await _apiService.trashApi.emptyTrash(); } catch (error, stack) { _log.severe("Cannot empty trash ${error.toString()}", error, stack); } @@ -40,7 +40,7 @@ class TrashService { Future restoreTrash() async { try { - await _apiService.assetApi.restoreTrashOld(); + await _apiService.trashApi.restoreTrash(); } catch (error, stack) { _log.severe("Cannot restore trash ${error.toString()}", error, stack); } diff --git a/mobile/lib/shared/services/api.service.dart b/mobile/lib/shared/services/api.service.dart index 2df1ec857f..9e44136fe7 100644 --- a/mobile/lib/shared/services/api.service.dart +++ b/mobile/lib/shared/services/api.service.dart @@ -24,6 +24,8 @@ class ApiService { late SharedLinkApi sharedLinkApi; late SystemConfigApi systemConfigApi; late ActivityApi activityApi; + late DownloadApi downloadApi; + late TrashApi trashApi; ApiService() { final endpoint = Store.tryGet(StoreKey.serverEndpoint); @@ -51,6 +53,8 @@ class ApiService { sharedLinkApi = SharedLinkApi(_apiClient); systemConfigApi = SystemConfigApi(_apiClient); activityApi = ActivityApi(_apiClient); + downloadApi = DownloadApi(_apiClient); + trashApi = TrashApi(_apiClient); } Future resolveAndSetEndpoint(String serverUrl) async { diff --git a/mobile/lib/shared/services/asset.service.dart b/mobile/lib/shared/services/asset.service.dart index 737d4d56ad..48f8c63524 100644 --- a/mobile/lib/shared/services/asset.service.dart +++ b/mobile/lib/shared/services/asset.service.dart @@ -129,7 +129,7 @@ class AssetService { // fileSize is always filled on the server but not set on client if (a.exifInfo?.fileSize == null) { if (a.isRemote) { - final dto = await _apiService.assetApi.getAssetById(a.remoteId!); + final dto = await _apiService.assetApi.getAssetInfo(a.remoteId!); if (dto != null && dto.exifInfo != null) { final newExif = Asset.remote(dto).exifInfo!.copyWith(id: a.id); if (newExif != a.exifInfo) { diff --git a/mobile/lib/shared/services/share.service.dart b/mobile/lib/shared/services/share.service.dart index d503910797..20ee40d588 100644 --- a/mobile/lib/shared/services/share.service.dart +++ b/mobile/lib/shared/services/share.service.dart @@ -31,8 +31,8 @@ class ShareService { final tempDir = await getTemporaryDirectory(); final fileName = asset.fileName; final tempFile = await File('${tempDir.path}/$fileName').create(); - final res = await _apiService.assetApi - .downloadFileOldWithHttpInfo(asset.remoteId!); + final res = await _apiService.downloadApi + .downloadFileWithHttpInfo(asset.remoteId!); if (res.statusCode != 200) { _log.severe( diff --git a/mobile/openapi/.openapi-generator/FILES b/mobile/openapi/.openapi-generator/FILES index 6fc968a491..186e3675c4 100644 --- a/mobile/openapi/.openapi-generator/FILES +++ b/mobile/openapi/.openapi-generator/FILES @@ -95,7 +95,6 @@ doc/OAuthApi.md doc/OAuthAuthorizeResponseDto.md doc/OAuthCallbackDto.md doc/OAuthConfigDto.md -doc/OAuthConfigResponseDto.md doc/PartnerApi.md doc/PartnerResponseDto.md doc/PathEntityType.md @@ -292,7 +291,6 @@ lib/model/model_type.dart lib/model/o_auth_authorize_response_dto.dart lib/model/o_auth_callback_dto.dart lib/model/o_auth_config_dto.dart -lib/model/o_auth_config_response_dto.dart lib/model/partner_response_dto.dart lib/model/path_entity_type.dart lib/model/path_type.dart @@ -462,7 +460,6 @@ test/o_auth_api_test.dart test/o_auth_authorize_response_dto_test.dart test/o_auth_callback_dto_test.dart test/o_auth_config_dto_test.dart -test/o_auth_config_response_dto_test.dart test/partner_api_test.dart test/partner_response_dto_test.dart test/path_entity_type_test.dart diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index ac05f83b69fcd6580457fe3ae1d8e90e68f56420..3c662af41f09e5e1e839f71240027b2b8351ad35 100644 GIT binary patch delta 38 wcmV+>0NMZb!U6fa0k9MilTQ-dvyBsX0<&@!*a5Q^8LJJmDksz^vpP^a5k$KW761SM delta 500 zcmeyloAK)*#tkBZldsD1Gx_ICZV(g`O35$J%gIknNi0gv$Sh0E&qT5G-e!yjqS2;xkFO+cNXg@}YL|!rZ105(L?{IbGxiBVTH9Nq$kPBgo)lh&u&} zAYx$4ilN%sAcEk)fXX9zjUOt6>^UBY=Meff+lj5=6;4mhOD#$)N%eOuEy-}s&r8cp zpPZl~stXg(PXvl5gT*0U5AY8L`yDKy50Tk?P5FfeH?k3WKH_Xp(*kToHt+MX76bq_ C-n170 diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index dbff762d30881b55e630987447c550d7737fea55..a7ea1c07c79a60173cc840c8ced111a7aef8b7b9 100644 GIT binary patch delta 55 zcmV-70LcHDuLQfm1F*^glMn+2lhp#Uv)2O)0<%5_egU&&2(B8FaAO3cy*U%Jwp8#f Nv+Rn@FSFOk!cKKx7<&K! delta 1711 zcmah}-%Aux7-e*d5>smlWJ|rG=fb-Bnhj{0nJ3tr+ zHJ8GY(`r()dTkST4M-xa*6!(WV-!cupl&2ZP9sI}BOv^g;n!g2F0z1zu9j;kyL3P5 zN)tEEA!0gTwSt*l2Jv$Q(%VsJNgjsfcV9qhjKbpkZ}og4=2JRlp%%j=LnD)oi*P>H zSHfS3jg(;7r3JXK5r&!VHd+razk4m9fOBik6eAKwV@)EgH8s{1F(tV4Jbs`Eg6tB4 z)w6L>w$|Zc;s~@n`3gJz;z@LG7~8sIbW^Q zLe!YKv}zk>2H)L>M5v2Ba5Yw9qwb&LX~OvTsW$>%@7_7q-&=euWSI=bvCFzOZDuT; z*aA)HHiy{-lK9$b%$;*G022H7j}aQPPyl5%l3V;Zxm&>^#783~H!CC>m^9lL;ziRs%QjonO55&PoR&mCer3+O)M zsK?ECD{%q%_qa72kmf3cORdxptU}zh(CLZu;k^oU2o~XntxchwDR?iA*E`2NH}iUh S3~i!5AW_cI`1YgCi~j+Qigc|2 diff --git a/mobile/openapi/doc/OAuthApi.md b/mobile/openapi/doc/OAuthApi.md index fa6b19df5388421c9e4b026aa4f9760ef69e8b88..ce36f7163a86264644d3b56bfb262f03d02045ab 100644 GIT binary patch delta 17 YcmdnzaL{~%JmcmvMkUtG`?wlJ0X~=e?JPXr0 z@(iQX{q4zj(tG#7=&nZxr=^dNo(%@EP%Xj-tlwR~GxEr=tLo~?L!rqc8; zEu>T((@b@?tfh>&lzXCPI7YRhAxkw|i0Hm!CcDNrKB3R-jjb-jv1$7T^##-Dd4lPBi9U05tERKOc!pB00PmZ0njsO4v diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index 8b9a320566443558a86babea1f9d6595d6105eb6..48305a98043cad291a7b13704fabc13f1c740cf7 100644 GIT binary patch delta 12 Tcmez7aKd53aly@B1snMQEKvpz delta 30 mcmX@%@XcYvaY5ev_{7qZjQHgIytK^p$&MU~n~w`N@&N$N^$b7& diff --git a/mobile/openapi/lib/api/asset_api.dart b/mobile/openapi/lib/api/asset_api.dart index 67127392c6bcd318375fc961a44c813a8b41b5d5..7f4528c12f048d2426690759657c76e98cd69a19 100644 GIT binary patch delta 41 ucmdlsn`Px0<_!j-n|subi%b?!7MdK;#l5-Msa*ri2rA+-+ibg`G8O<=w-65i delta 1564 zcma)6&ubGw6ecyLO-q_m6RS-VrxIxzlO_eN)@owX8VwZ_YQP^@Fg9zmG|7hSv{Jl@ zpteOT4+Qlf9u#ts>Vh7dQc#d89{dCJ;6+61#gl@&Gds;@8>^RP=FNNG``)+nO=)$@ ziwDNVfDOLSw{<4sr;^B@5=9RC)57I^R!F7&sp5EspXT64Fb0-|`mM3FIE;lcMAGO6 zK8Y?^2yGu=MPXVK&!$iFICC81LM(qtaEBFSTB0rYqAT!l$N|n|sFfkCw_VN+Hlf2T z9SpPcVD@78x;g@R<2|@=)&37wEpTS2)yHrv%rTJ2g|xR??%elAzQGw>`rXeO(q5>)tf^_^?hW-RAc;Axvv zrF0h@@doR(z^8+#s?H7JmEAh1+p$M*>y1eY*j`)FF%F{?68Zc@mZQJ5TSUBkJ&L&$ z=7l_*FpZNLE3+bFWF|%wG7;Iyt|HM}c;9KVZw7hC)(5{Mj&U6bq zdiOY4t%ggtw@1DzWE}YUxewNQT+)-#rv8Q^Ct{&U9;dd*RCba*P8Z1<%5xpyyV=}J zv&i!!>giO<5Umnn?Ny@D&!A diff --git a/mobile/openapi/lib/api/o_auth_api.dart b/mobile/openapi/lib/api/o_auth_api.dart index c0d6bc06e0619721a5b7c7f65df1407ce1f9a44e..03373847980cc6d7da1b8c643734ecf7bcc9732e 100644 GIT binary patch delta 20 ccmezD*>1BznqzXEsLnyWaxv4 z{G!aNR4xSteSLihsoIbwsT3pU4X{wM0i#0GU}poBP#Stt>- J*^=X&C;%#Zc*+0( diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index a305ded56a9f193ab45ef5393bdabf220b7980d7..9643a90424b2074b02e199714d8d27dd1cabc433 100644 GIT binary patch delta 14 Vcmcb;o$>cJ#tm9#o4d>cRRK0f20s7* delta 34 qcmeypjq&z&#tm9#lNC%^C*L<^n;hgNKlzU-_vA)Z?af+dfvN!dT@3mF diff --git a/mobile/openapi/lib/model/o_auth_config_response_dto.dart b/mobile/openapi/lib/model/o_auth_config_response_dto.dart deleted file mode 100644 index 83fd87b6c8a44a1f13a9e545932745c3a89bb180..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5317 zcmeHLQE%He5PtWsxD-L{V5+nAX-I3Q#gY!~(s*dI0fP}3v_#u#71ATAdPbW6zVArM zlxsQ725e7#h$E4A$K!q99Zx(y?i?S}%ipd>PkuhXJb(A{>impey}me4=xjunqbqtl zI(z-7<3QmPRj2xA;k`Sw4R!?GkIsGpFgc zLv)NVypygp%90=@S2S*yzNXx}n#w-Z+GTodk;pA_+ZUzN7ot?@B8h|3(mAcJky0Fw%rYemeH%6O)wWzz^uT9lbY z{4zNcW#Q=0tIS(n8n}>ZSiUK( zqnRiQnu_!z0Xz83wgFk?GP(8AL&JyyYYRph5?L0+S{#7idp777fIg-XGL9Z&4#W7J zYF(UCME6_7eGdJH5r6LtFg&H0JU-?O1XU>$2ig+l8$|yXM5seP*e^8F+8~3fgyE`; z+}4H$gWhQRL8hqHC@$uR215$9KNUrf^DU`oK7S5RgdA+IxAgci7N8*3sJK|Ak)hjC zkwq-kc-yj7@rp(2$F2D`nz3-}_?9L@#DZ;+%9W$Jbf|3>rxnW2VCc8EIjQ-8Rx*{= z3bW<|7H8%{+T41vUMxzy0vAR)rSIva5sQOw{=J3$-#Ob!vVjKf8IE>Fp1MR_K++9*bJUFa&m9*kGIBeS+nj}*U z4)Jr{^AN}cpW-~S*}DuA237%+L6A!d*-3ZXXG=Y$?Ssw zY;B0Vk+JEW;zF>m*bOUy4_`t=gRGyWj+^nw+82 z_D#AeQ`B!e;mSTi&+hVcg7$u)Gp;^iU{9Go^`7_ys1hQ0Sd*9|9y&%;dbm}O6S~bt zo_LXdDy-Ydm|kdn`7Een+FluYp3p27bK`_=#PWA;SVyxf^pMZFu^9F^ITPAStfSDG zvwGy}j(W)bXdsGq8wM)Q?r3i>UQ_+(ATHg;+^?8vQ|UHsf}lGlzT5|sc(Vb-o5OJD zf2)w!?DjOS2yu}Et#&MiRABNIIJ(7*5cgZ(-OY_&@#hE%8k&DAle?N4ffzCmS1ss;3lzY z?+lx$!o?wrWZ$VRJRP>w$9GFeiH2qfb{+Js&{tac;>6~9b=Xd*e)3kDxHJ!`J+b4o zXho-vL3xEiczz! zQSI|vE^WOhh9K>MJNCXyc&xQLg#C_WFUV?7}@zL$z^MFi2d@eXMk7 ztXH{PV2HDeFGSiAc@l)7TOAkt&5I9szD0q}Skm7%+8JiozEm5s8Vj^?CZUIAG;B24 zbnk-yhEoru%R{JF9VLxw@l|GFciXVHW7B8oHeqZKEZHP>z`H3lxMadbNWvTu-DH@K&#i=EpDa9@&`3i{$ z_T=?!>Oz>xCm$3xob1IRzz>sh%gg~8GkGbSA%@sNVI#iO+=7zIkfOxm43K4$Kd_7Q zAPY@yVA9>3#3IL}sNkMjqL8RioSB!NlL~Q(da*)gURr)pZemGhe%@q$X3@#*Y*H*v zm7XB`EFlb_gEqIZO=Na=f%+{dwYVTZuQ(OxAv=Zi)DoDuC(tO68<6=RPs4lyk_YmE z9@pYWRs-@K$k%qfY@21c0$CJOi%as0Qo-R?3^LHEG$$JxfJtEH?%m4rY diff --git a/mobile/openapi/test/o_auth_api_test.dart b/mobile/openapi/test/o_auth_api_test.dart index 52326d423f6a4f98ad3a22a1c43529fa05f8a06c..055963aaecb7158cf4bdaafcb831bab9385b8fb0 100644 GIT binary patch delta 12 TcmaFF^@n3aDAQ(ZW_2b2A=LyD delta 168 zcmeyv@rY|fC{w+HLrQ8vQEGBxNotBhX>qDTT54iRX%UdlNlY(RNX$!7(9cgSEy>Ua z5&1=#RjFJGK%lP=rQAwE%5D4|fzroXy W*pufnYYJmgGx-9u^X6P8ekK5?(>t30 diff --git a/mobile/openapi/test/o_auth_config_response_dto_test.dart b/mobile/openapi/test/o_auth_config_response_dto_test.dart deleted file mode 100644 index fd10307b31692a08d71e8e695fd88849ae99eb68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1008 zcmb7BPfy!06u;+Fyq#L4LN-nl2#IP56H*}(3kOcdOfsB+M&xBHJzbohd^^p? zQT4`p6rJ^=QyR}8ni#MZsBwjcX0NkaIqPXBL+WR_4#Gte9{)t;nQr8YS0_FH34LI3 zA9m9lYXV6_LbYtDI)y&b!%j1;3$@x17VW50mUIC-&I0xV>fodLU_+d?_`a2AclVU+Od$Ov9l~iVW1phJs=5)$P z4JuV>5H3ETPLIwrCiLD$H=T?|9{?va*or6lrL`JlB)gE&Gy_XOipd%_ZGZ*@=ee?{ zH9WpSA2&)etWA@`j#Lg@S4EX%UN(`^;V<&a^stOX*3|fy_8PrG4>C%9_;r>V+r1uJ o+~EdJhVX2CyRf}7Ckq)xnUSjlmZ!^YxPMVd{JH2H80ptTcQvd(} diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index b031456a2a..4c6317c2c2 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -1055,58 +1055,6 @@ ] } }, - "/asset/assetById/{id}": { - "get": { - "deprecated": true, - "description": "Get a single asset's information", - "operationId": "getAssetById", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "format": "uuid", - "type": "string" - } - }, - { - "name": "key", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AssetResponseDto" - } - } - }, - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, "/asset/bulk-upload-check": { "post": { "description": "Checks if assets exist by checksums", @@ -1265,160 +1213,6 @@ ] } }, - "/asset/download/archive": { - "post": { - "operationId": "downloadArchiveOld", - "parameters": [ - { - "name": "key", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AssetIdsDto" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, - "/asset/download/info": { - "post": { - "operationId": "getDownloadInfoOld", - "parameters": [ - { - "name": "key", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DownloadInfoDto" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DownloadResponseDto" - } - } - }, - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, - "/asset/download/{id}": { - "post": { - "operationId": "downloadFileOld", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "format": "uuid", - "type": "string" - } - }, - { - "name": "key", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, "/asset/exist": { "post": { "description": "Checks if multiple assets exist on the server and returns all existing - used by background backup", @@ -1732,41 +1526,6 @@ ] } }, - "/asset/restore": { - "post": { - "operationId": "restoreAssetsOld", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BulkIdsDto" - } - } - }, - "required": true - }, - "responses": { - "204": { - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, "/asset/search-terms": { "get": { "operationId": "getAssetSearchTerms", @@ -2217,56 +1976,6 @@ ] } }, - "/asset/trash/empty": { - "post": { - "operationId": "emptyTrashOld", - "parameters": [], - "responses": { - "204": { - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, - "/asset/trash/restore": { - "post": { - "operationId": "restoreTrashOld", - "parameters": [], - "responses": { - "204": { - "description": "" - } - }, - "security": [ - { - "bearer": [] - }, - { - "cookie": [] - }, - { - "api_key": [] - } - ], - "tags": [ - "Asset" - ] - } - }, "/asset/upload": { "post": { "operationId": "uploadFile", @@ -3935,39 +3644,6 @@ ] } }, - "/oauth/config": { - "post": { - "deprecated": true, - "description": "@deprecated use feature flags and /oauth/authorize", - "operationId": "generateOAuthConfig", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OAuthConfigDto" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OAuthConfigResponseDto" - } - } - }, - "description": "" - } - }, - "tags": [ - "OAuth" - ] - } - }, "/oauth/link": { "post": { "operationId": "linkOAuthAccount", @@ -8399,30 +8075,6 @@ ], "type": "object" }, - "OAuthConfigResponseDto": { - "properties": { - "autoLaunch": { - "type": "boolean" - }, - "buttonText": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "passwordLoginEnabled": { - "type": "boolean" - }, - "url": { - "type": "string" - } - }, - "required": [ - "enabled", - "passwordLoginEnabled" - ], - "type": "object" - }, "PartnerResponseDto": { "properties": { "avatarColor": { diff --git a/open-api/typescript-sdk/axios-client/api.ts b/open-api/typescript-sdk/axios-client/api.ts index f8866b7904..542fa0580e 100644 --- a/open-api/typescript-sdk/axios-client/api.ts +++ b/open-api/typescript-sdk/axios-client/api.ts @@ -2383,43 +2383,6 @@ export interface OAuthConfigDto { */ 'redirectUri': string; } -/** - * - * @export - * @interface OAuthConfigResponseDto - */ -export interface OAuthConfigResponseDto { - /** - * - * @type {boolean} - * @memberof OAuthConfigResponseDto - */ - 'autoLaunch'?: boolean; - /** - * - * @type {string} - * @memberof OAuthConfigResponseDto - */ - 'buttonText'?: string; - /** - * - * @type {boolean} - * @memberof OAuthConfigResponseDto - */ - 'enabled': boolean; - /** - * - * @type {boolean} - * @memberof OAuthConfigResponseDto - */ - 'passwordLoginEnabled': boolean; - /** - * - * @type {string} - * @memberof OAuthConfigResponseDto - */ - 'url'?: string; -} /** * * @export @@ -6981,140 +6944,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * - * @param {AssetIdsDto} assetIdsDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - downloadArchiveOld: async (assetIdsDto: AssetIdsDto, key?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'assetIdsDto' is not null or undefined - assertParamExists('downloadArchiveOld', 'assetIdsDto', assetIdsDto) - const localVarPath = `/asset/download/archive`; - // 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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (key !== undefined) { - localVarQueryParameter['key'] = key; - } - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(assetIdsDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @param {string} id - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - downloadFileOld: async (id: string, key?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('downloadFileOld', 'id', id) - const localVarPath = `/asset/download/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // 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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (key !== undefined) { - localVarQueryParameter['key'] = key; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - emptyTrashOld: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/asset/trash/empty`; - // 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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * Get all AssetEntity belong to the user * @param {string} [ifNoneMatch] ETag of data already cached on the client @@ -7230,54 +7059,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a single asset\'s information - * @param {string} id - * @param {string} [key] - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - getAssetById: async (id: string, key?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('getAssetById', 'id', id) - const localVarPath = `/asset/assetById/{id}` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // 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: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (key !== undefined) { - localVarQueryParameter['key'] = key; - } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -7553,55 +7334,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * - * @param {DownloadInfoDto} downloadInfoDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDownloadInfoOld: async (downloadInfoDto: DownloadInfoDto, key?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'downloadInfoDto' is not null or undefined - assertParamExists('getDownloadInfoOld', 'downloadInfoDto', downloadInfoDto) - const localVarPath = `/asset/download/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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (key !== undefined) { - localVarQueryParameter['key'] = key; - } - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(downloadInfoDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @param {string} [fileCreatedAfter] @@ -7937,88 +7669,6 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @param {BulkIdsDto} bulkIdsDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - restoreAssetsOld: async (bulkIdsDto: BulkIdsDto, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'bulkIdsDto' is not null or undefined - assertParamExists('restoreAssetsOld', 'bulkIdsDto', bulkIdsDto) - const localVarPath = `/asset/restore`; - // 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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // 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(bulkIdsDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - restoreTrashOld: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/asset/trash/restore`; - // 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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -8697,43 +8347,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const operationBasePath = operationServerMap['AssetApi.deleteAssets']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, - /** - * - * @param {AssetIdsDto} assetIdsDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async downloadArchiveOld(assetIdsDto: AssetIdsDto, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.downloadArchiveOld(assetIdsDto, key, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['AssetApi.downloadArchiveOld']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * - * @param {string} id - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async downloadFileOld(id: string, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFileOld(id, key, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['AssetApi.downloadFileOld']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async emptyTrashOld(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.emptyTrashOld(options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['AssetApi.emptyTrashOld']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, /** * Get all AssetEntity belong to the user * @param {string} [ifNoneMatch] ETag of data already cached on the client @@ -8765,20 +8378,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const operationBasePath = operationServerMap['AssetApi.getAllUserAssetsByDeviceId']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, - /** - * Get a single asset\'s information - * @param {string} id - * @param {string} [key] - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - async getAssetById(id: string, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetById(id, key, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['AssetApi.getAssetById']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, /** * * @param {string} id @@ -8853,19 +8452,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const operationBasePath = operationServerMap['AssetApi.getCuratedObjects']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, - /** - * - * @param {DownloadInfoDto} downloadInfoDto - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getDownloadInfoOld(downloadInfoDto: DownloadInfoDto, key?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDownloadInfoOld(downloadInfoDto, key, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['AssetApi.getDownloadInfoOld']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, /** * * @param {string} [fileCreatedAfter] @@ -8949,29 +8535,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const operationBasePath = operationServerMap['AssetApi.getTimeBuckets']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, - /** - * - * @param {BulkIdsDto} bulkIdsDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async restoreAssetsOld(bulkIdsDto: BulkIdsDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.restoreAssetsOld(bulkIdsDto, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['AssetApi.restoreAssetsOld']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async restoreTrashOld(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.restoreTrashOld(options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['AssetApi.restoreTrashOld']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, /** * * @param {AssetJobsDto} assetJobsDto @@ -9151,32 +8714,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath deleteAssets(requestParameters: AssetApiDeleteAssetsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteAssets(requestParameters.assetBulkDeleteDto, options).then((request) => request(axios, basePath)); }, - /** - * - * @param {AssetApiDownloadArchiveOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - downloadArchiveOld(requestParameters: AssetApiDownloadArchiveOldRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.downloadArchiveOld(requestParameters.assetIdsDto, requestParameters.key, options).then((request) => request(axios, basePath)); - }, - /** - * - * @param {AssetApiDownloadFileOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - downloadFileOld(requestParameters: AssetApiDownloadFileOldRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.downloadFileOld(requestParameters.id, requestParameters.key, options).then((request) => request(axios, basePath)); - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - emptyTrashOld(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.emptyTrashOld(options).then((request) => request(axios, basePath)); - }, /** * Get all AssetEntity belong to the user * @param {AssetApiGetAllAssetsRequest} requestParameters Request parameters. @@ -9195,16 +8732,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath getAllUserAssetsByDeviceId(requestParameters: AssetApiGetAllUserAssetsByDeviceIdRequest, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getAllUserAssetsByDeviceId(requestParameters.deviceId, options).then((request) => request(axios, basePath)); }, - /** - * Get a single asset\'s information - * @param {AssetApiGetAssetByIdRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - getAssetById(requestParameters: AssetApiGetAssetByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getAssetById(requestParameters.id, requestParameters.key, options).then((request) => request(axios, basePath)); - }, /** * * @param {AssetApiGetAssetInfoRequest} requestParameters Request parameters. @@ -9256,15 +8783,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath getCuratedObjects(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getCuratedObjects(options).then((request) => request(axios, basePath)); }, - /** - * - * @param {AssetApiGetDownloadInfoOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getDownloadInfoOld(requestParameters: AssetApiGetDownloadInfoOldRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getDownloadInfoOld(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(axios, basePath)); - }, /** * * @param {AssetApiGetMapMarkersRequest} requestParameters Request parameters. @@ -9310,23 +8828,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath getTimeBuckets(requestParameters: AssetApiGetTimeBucketsRequest, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getTimeBuckets(requestParameters.size, requestParameters.albumId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.key, requestParameters.personId, requestParameters.userId, requestParameters.withPartners, requestParameters.withStacked, options).then((request) => request(axios, basePath)); }, - /** - * - * @param {AssetApiRestoreAssetsOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - restoreAssetsOld(requestParameters: AssetApiRestoreAssetsOldRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.restoreAssetsOld(requestParameters.bulkIdsDto, options).then((request) => request(axios, basePath)); - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - restoreTrashOld(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.restoreTrashOld(options).then((request) => request(axios, basePath)); - }, /** * * @param {AssetApiRunAssetJobsRequest} requestParameters Request parameters. @@ -9435,48 +8936,6 @@ export interface AssetApiDeleteAssetsRequest { readonly assetBulkDeleteDto: AssetBulkDeleteDto } -/** - * Request parameters for downloadArchiveOld operation in AssetApi. - * @export - * @interface AssetApiDownloadArchiveOldRequest - */ -export interface AssetApiDownloadArchiveOldRequest { - /** - * - * @type {AssetIdsDto} - * @memberof AssetApiDownloadArchiveOld - */ - readonly assetIdsDto: AssetIdsDto - - /** - * - * @type {string} - * @memberof AssetApiDownloadArchiveOld - */ - readonly key?: string -} - -/** - * Request parameters for downloadFileOld operation in AssetApi. - * @export - * @interface AssetApiDownloadFileOldRequest - */ -export interface AssetApiDownloadFileOldRequest { - /** - * - * @type {string} - * @memberof AssetApiDownloadFileOld - */ - readonly id: string - - /** - * - * @type {string} - * @memberof AssetApiDownloadFileOld - */ - readonly key?: string -} - /** * Request parameters for getAllAssets operation in AssetApi. * @export @@ -9554,27 +9013,6 @@ export interface AssetApiGetAllUserAssetsByDeviceIdRequest { readonly deviceId: string } -/** - * Request parameters for getAssetById operation in AssetApi. - * @export - * @interface AssetApiGetAssetByIdRequest - */ -export interface AssetApiGetAssetByIdRequest { - /** - * - * @type {string} - * @memberof AssetApiGetAssetById - */ - readonly id: string - - /** - * - * @type {string} - * @memberof AssetApiGetAssetById - */ - readonly key?: string -} - /** * Request parameters for getAssetInfo operation in AssetApi. * @export @@ -9652,27 +9090,6 @@ export interface AssetApiGetAssetThumbnailRequest { readonly key?: string } -/** - * Request parameters for getDownloadInfoOld operation in AssetApi. - * @export - * @interface AssetApiGetDownloadInfoOldRequest - */ -export interface AssetApiGetDownloadInfoOldRequest { - /** - * - * @type {DownloadInfoDto} - * @memberof AssetApiGetDownloadInfoOld - */ - readonly downloadInfoDto: DownloadInfoDto - - /** - * - * @type {string} - * @memberof AssetApiGetDownloadInfoOld - */ - readonly key?: string -} - /** * Request parameters for getMapMarkers operation in AssetApi. * @export @@ -9904,20 +9321,6 @@ export interface AssetApiGetTimeBucketsRequest { readonly withStacked?: boolean } -/** - * Request parameters for restoreAssetsOld operation in AssetApi. - * @export - * @interface AssetApiRestoreAssetsOldRequest - */ -export interface AssetApiRestoreAssetsOldRequest { - /** - * - * @type {BulkIdsDto} - * @memberof AssetApiRestoreAssetsOld - */ - readonly bulkIdsDto: BulkIdsDto -} - /** * Request parameters for runAssetJobs operation in AssetApi. * @export @@ -10462,38 +9865,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).deleteAssets(requestParameters.assetBulkDeleteDto, options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @param {AssetApiDownloadArchiveOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public downloadArchiveOld(requestParameters: AssetApiDownloadArchiveOldRequest, options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).downloadArchiveOld(requestParameters.assetIdsDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @param {AssetApiDownloadFileOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public downloadFileOld(requestParameters: AssetApiDownloadFileOldRequest, options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).downloadFileOld(requestParameters.id, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public emptyTrashOld(options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).emptyTrashOld(options).then((request) => request(this.axios, this.basePath)); - } - /** * Get all AssetEntity belong to the user * @param {AssetApiGetAllAssetsRequest} requestParameters Request parameters. @@ -10516,18 +9887,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).getAllUserAssetsByDeviceId(requestParameters.deviceId, options).then((request) => request(this.axios, this.basePath)); } - /** - * Get a single asset\'s information - * @param {AssetApiGetAssetByIdRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - * @memberof AssetApi - */ - public getAssetById(requestParameters: AssetApiGetAssetByIdRequest, options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).getAssetById(requestParameters.id, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {AssetApiGetAssetInfoRequest} requestParameters Request parameters. @@ -10591,17 +9950,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).getCuratedObjects(options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @param {AssetApiGetDownloadInfoOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public getDownloadInfoOld(requestParameters: AssetApiGetDownloadInfoOldRequest, options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).getDownloadInfoOld(requestParameters.downloadInfoDto, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {AssetApiGetMapMarkersRequest} requestParameters Request parameters. @@ -10657,27 +10005,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).getTimeBuckets(requestParameters.size, requestParameters.albumId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.key, requestParameters.personId, requestParameters.userId, requestParameters.withPartners, requestParameters.withStacked, options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @param {AssetApiRestoreAssetsOldRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public restoreAssetsOld(requestParameters: AssetApiRestoreAssetsOldRequest, options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).restoreAssetsOld(requestParameters.bulkIdsDto, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public restoreTrashOld(options?: RawAxiosRequestConfig) { - return AssetApiFp(this.configuration).restoreTrashOld(options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {AssetApiRunAssetJobsRequest} requestParameters Request parameters. @@ -13391,42 +12718,6 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * @deprecated use feature flags and /oauth/authorize - * @param {OAuthConfigDto} oAuthConfigDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - generateOAuthConfig: async (oAuthConfigDto: OAuthConfigDto, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'oAuthConfigDto' is not null or undefined - assertParamExists('generateOAuthConfig', 'oAuthConfigDto', oAuthConfigDto) - const localVarPath = `/oauth/config`; - // 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; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(oAuthConfigDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @param {OAuthCallbackDto} oAuthCallbackDto @@ -13595,19 +12886,6 @@ export const OAuthApiFp = function(configuration?: Configuration) { const operationBasePath = operationServerMap['OAuthApi.finishOAuth']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, - /** - * @deprecated use feature flags and /oauth/authorize - * @param {OAuthConfigDto} oAuthConfigDto - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - async generateOAuthConfig(oAuthConfigDto: OAuthConfigDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.generateOAuthConfig(oAuthConfigDto, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['OAuthApi.generateOAuthConfig']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, /** * * @param {OAuthCallbackDto} oAuthCallbackDto @@ -13673,16 +12951,6 @@ export const OAuthApiFactory = function (configuration?: Configuration, basePath finishOAuth(requestParameters: OAuthApiFinishOAuthRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); }, - /** - * @deprecated use feature flags and /oauth/authorize - * @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - */ - generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); - }, /** * * @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters. @@ -13734,20 +13002,6 @@ export interface OAuthApiFinishOAuthRequest { readonly oAuthCallbackDto: OAuthCallbackDto } -/** - * Request parameters for generateOAuthConfig operation in OAuthApi. - * @export - * @interface OAuthApiGenerateOAuthConfigRequest - */ -export interface OAuthApiGenerateOAuthConfigRequest { - /** - * - * @type {OAuthConfigDto} - * @memberof OAuthApiGenerateOAuthConfig - */ - readonly oAuthConfigDto: OAuthConfigDto -} - /** * Request parameters for linkOAuthAccount operation in OAuthApi. * @export @@ -13794,18 +13048,6 @@ export class OAuthApi extends BaseAPI { return OAuthApiFp(this.configuration).finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); } - /** - * @deprecated use feature flags and /oauth/authorize - * @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @deprecated - * @throws {RequiredError} - * @memberof OAuthApi - */ - public generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: RawAxiosRequestConfig) { - return OAuthApiFp(this.configuration).generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters. diff --git a/open-api/typescript-sdk/fetch-client/.openapi-generator/FILES b/open-api/typescript-sdk/fetch-client/.openapi-generator/FILES index 3f9fcad44e..404449e74d 100644 --- a/open-api/typescript-sdk/fetch-client/.openapi-generator/FILES +++ b/open-api/typescript-sdk/fetch-client/.openapi-generator/FILES @@ -101,7 +101,6 @@ models/ModelType.ts models/OAuthAuthorizeResponseDto.ts models/OAuthCallbackDto.ts models/OAuthConfigDto.ts -models/OAuthConfigResponseDto.ts models/PartnerResponseDto.ts models/PathEntityType.ts models/PathType.ts diff --git a/open-api/typescript-sdk/fetch-client/apis/AssetApi.ts b/open-api/typescript-sdk/fetch-client/apis/AssetApi.ts index 5d5ea1b170..38f7babb47 100644 --- a/open-api/typescript-sdk/fetch-client/apis/AssetApi.ts +++ b/open-api/typescript-sdk/fetch-client/apis/AssetApi.ts @@ -20,19 +20,15 @@ import type { AssetBulkUploadCheckDto, AssetBulkUploadCheckResponseDto, AssetFileUploadResponseDto, - AssetIdsDto, AssetJobsDto, AssetOrder, AssetResponseDto, AssetStatsResponseDto, AssetTypeEnum, - BulkIdsDto, CheckExistingAssetsDto, CheckExistingAssetsResponseDto, CuratedLocationsResponseDto, CuratedObjectsResponseDto, - DownloadInfoDto, - DownloadResponseDto, MapMarkerResponseDto, MemoryLaneResponseDto, ThumbnailFormat, @@ -52,8 +48,6 @@ import { AssetBulkUploadCheckResponseDtoToJSON, AssetFileUploadResponseDtoFromJSON, AssetFileUploadResponseDtoToJSON, - AssetIdsDtoFromJSON, - AssetIdsDtoToJSON, AssetJobsDtoFromJSON, AssetJobsDtoToJSON, AssetOrderFromJSON, @@ -64,8 +58,6 @@ import { AssetStatsResponseDtoToJSON, AssetTypeEnumFromJSON, AssetTypeEnumToJSON, - BulkIdsDtoFromJSON, - BulkIdsDtoToJSON, CheckExistingAssetsDtoFromJSON, CheckExistingAssetsDtoToJSON, CheckExistingAssetsResponseDtoFromJSON, @@ -74,10 +66,6 @@ import { CuratedLocationsResponseDtoToJSON, CuratedObjectsResponseDtoFromJSON, CuratedObjectsResponseDtoToJSON, - DownloadInfoDtoFromJSON, - DownloadInfoDtoToJSON, - DownloadResponseDtoFromJSON, - DownloadResponseDtoToJSON, MapMarkerResponseDtoFromJSON, MapMarkerResponseDtoToJSON, MemoryLaneResponseDtoFromJSON, @@ -106,16 +94,6 @@ export interface DeleteAssetsRequest { assetBulkDeleteDto: AssetBulkDeleteDto; } -export interface DownloadArchiveOldRequest { - assetIdsDto: AssetIdsDto; - key?: string; -} - -export interface DownloadFileOldRequest { - id: string; - key?: string; -} - export interface GetAllAssetsRequest { ifNoneMatch?: string; isArchived?: boolean; @@ -131,11 +109,6 @@ export interface GetAllUserAssetsByDeviceIdRequest { deviceId: string; } -export interface GetAssetByIdRequest { - id: string; - key?: string; -} - export interface GetAssetInfoRequest { id: string; key?: string; @@ -153,11 +126,6 @@ export interface GetAssetThumbnailRequest { key?: string; } -export interface GetDownloadInfoOldRequest { - downloadInfoDto: DownloadInfoDto; - key?: string; -} - export interface GetMapMarkersRequest { fileCreatedAfter?: Date; fileCreatedBefore?: Date; @@ -201,10 +169,6 @@ export interface GetTimeBucketsRequest { withStacked?: boolean; } -export interface RestoreAssetsOldRequest { - bulkIdsDto: BulkIdsDto; -} - export interface RunAssetJobsRequest { assetJobsDto: AssetJobsDto; } @@ -428,132 +392,6 @@ export class AssetApi extends runtime.BaseAPI { await this.deleteAssetsRaw(requestParameters, initOverrides); } - /** - */ - async downloadArchiveOldRaw(requestParameters: DownloadArchiveOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.assetIdsDto === null || requestParameters.assetIdsDto === undefined) { - throw new runtime.RequiredError('assetIdsDto','Required parameter requestParameters.assetIdsDto was null or undefined when calling downloadArchiveOld.'); - } - - const queryParameters: any = {}; - - if (requestParameters.key !== undefined) { - queryParameters['key'] = requestParameters.key; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication - } - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearer", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const response = await this.request({ - path: `/asset/download/archive`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: AssetIdsDtoToJSON(requestParameters.assetIdsDto), - }, initOverrides); - - return new runtime.BlobApiResponse(response); - } - - /** - */ - async downloadArchiveOld(requestParameters: DownloadArchiveOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.downloadArchiveOldRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - */ - async downloadFileOldRaw(requestParameters: DownloadFileOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling downloadFileOld.'); - } - - const queryParameters: any = {}; - - if (requestParameters.key !== undefined) { - queryParameters['key'] = requestParameters.key; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication - } - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearer", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const response = await this.request({ - path: `/asset/download/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.BlobApiResponse(response); - } - - /** - */ - async downloadFileOld(requestParameters: DownloadFileOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.downloadFileOldRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - */ - async emptyTrashOldRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication - } - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearer", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const response = await this.request({ - path: `/asset/trash/empty`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - */ - async emptyTrashOld(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.emptyTrashOldRaw(initOverrides); - } - /** * Get all AssetEntity belong to the user */ @@ -666,54 +504,6 @@ export class AssetApi extends runtime.BaseAPI { return await response.value(); } - /** - * Get a single asset\'s information - * @deprecated - */ - async getAssetByIdRaw(requestParameters: GetAssetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.id === null || requestParameters.id === undefined) { - throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getAssetById.'); - } - - const queryParameters: any = {}; - - if (requestParameters.key !== undefined) { - queryParameters['key'] = requestParameters.key; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication - } - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearer", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const response = await this.request({ - path: `/asset/assetById/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => AssetResponseDtoFromJSON(jsonValue)); - } - - /** - * Get a single asset\'s information - * @deprecated - */ - async getAssetById(requestParameters: GetAssetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getAssetByIdRaw(requestParameters, initOverrides); - return await response.value(); - } - /** */ async getAssetInfoRaw(requestParameters: GetAssetInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -962,53 +752,6 @@ export class AssetApi extends runtime.BaseAPI { return await response.value(); } - /** - */ - async getDownloadInfoOldRaw(requestParameters: GetDownloadInfoOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.downloadInfoDto === null || requestParameters.downloadInfoDto === undefined) { - throw new runtime.RequiredError('downloadInfoDto','Required parameter requestParameters.downloadInfoDto was null or undefined when calling getDownloadInfoOld.'); - } - - const queryParameters: any = {}; - - if (requestParameters.key !== undefined) { - queryParameters['key'] = requestParameters.key; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication - } - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearer", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const response = await this.request({ - path: `/asset/download/info`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: DownloadInfoDtoToJSON(requestParameters.downloadInfoDto), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => DownloadResponseDtoFromJSON(jsonValue)); - } - - /** - */ - async getDownloadInfoOld(requestParameters: GetDownloadInfoOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getDownloadInfoOldRaw(requestParameters, initOverrides); - return await response.value(); - } - /** */ async getMapMarkersRaw(requestParameters: GetMapMarkersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { @@ -1321,83 +1064,6 @@ export class AssetApi extends runtime.BaseAPI { return await response.value(); } - /** - */ - async restoreAssetsOldRaw(requestParameters: RestoreAssetsOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.bulkIdsDto === null || requestParameters.bulkIdsDto === undefined) { - throw new runtime.RequiredError('bulkIdsDto','Required parameter requestParameters.bulkIdsDto was null or undefined when calling restoreAssetsOld.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication - } - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearer", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const response = await this.request({ - path: `/asset/restore`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: BulkIdsDtoToJSON(requestParameters.bulkIdsDto), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - */ - async restoreAssetsOld(requestParameters: RestoreAssetsOldRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.restoreAssetsOldRaw(requestParameters, initOverrides); - } - - /** - */ - async restoreTrashOldRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["x-api-key"] = this.configuration.apiKey("x-api-key"); // api_key authentication - } - - if (this.configuration && this.configuration.accessToken) { - const token = this.configuration.accessToken; - const tokenString = await token("bearer", []); - - if (tokenString) { - headerParameters["Authorization"] = `Bearer ${tokenString}`; - } - } - const response = await this.request({ - path: `/asset/trash/restore`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - */ - async restoreTrashOld(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.restoreTrashOldRaw(initOverrides); - } - /** */ async runAssetJobsRaw(requestParameters: RunAssetJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { diff --git a/open-api/typescript-sdk/fetch-client/apis/OAuthApi.ts b/open-api/typescript-sdk/fetch-client/apis/OAuthApi.ts index 60e30d4e0c..295ebbebfd 100644 --- a/open-api/typescript-sdk/fetch-client/apis/OAuthApi.ts +++ b/open-api/typescript-sdk/fetch-client/apis/OAuthApi.ts @@ -19,7 +19,6 @@ import type { OAuthAuthorizeResponseDto, OAuthCallbackDto, OAuthConfigDto, - OAuthConfigResponseDto, UserResponseDto, } from '../models/index'; import { @@ -31,8 +30,6 @@ import { OAuthCallbackDtoToJSON, OAuthConfigDtoFromJSON, OAuthConfigDtoToJSON, - OAuthConfigResponseDtoFromJSON, - OAuthConfigResponseDtoToJSON, UserResponseDtoFromJSON, UserResponseDtoToJSON, } from '../models/index'; @@ -41,10 +38,6 @@ export interface FinishOAuthRequest { oAuthCallbackDto: OAuthCallbackDto; } -export interface GenerateOAuthConfigRequest { - oAuthConfigDto: OAuthConfigDto; -} - export interface LinkOAuthAccountRequest { oAuthCallbackDto: OAuthCallbackDto; } @@ -89,41 +82,6 @@ export class OAuthApi extends runtime.BaseAPI { return await response.value(); } - /** - * @deprecated use feature flags and /oauth/authorize - * @deprecated - */ - async generateOAuthConfigRaw(requestParameters: GenerateOAuthConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.oAuthConfigDto === null || requestParameters.oAuthConfigDto === undefined) { - throw new runtime.RequiredError('oAuthConfigDto','Required parameter requestParameters.oAuthConfigDto was null or undefined when calling generateOAuthConfig.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/oauth/config`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: OAuthConfigDtoToJSON(requestParameters.oAuthConfigDto), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => OAuthConfigResponseDtoFromJSON(jsonValue)); - } - - /** - * @deprecated use feature flags and /oauth/authorize - * @deprecated - */ - async generateOAuthConfig(requestParameters: GenerateOAuthConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.generateOAuthConfigRaw(requestParameters, initOverrides); - return await response.value(); - } - /** */ async linkOAuthAccountRaw(requestParameters: LinkOAuthAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { diff --git a/open-api/typescript-sdk/fetch-client/models/index.ts b/open-api/typescript-sdk/fetch-client/models/index.ts index ce30d3afe8..19e4f387fe 100644 --- a/open-api/typescript-sdk/fetch-client/models/index.ts +++ b/open-api/typescript-sdk/fetch-client/models/index.ts @@ -81,7 +81,6 @@ export * from './ModelType'; export * from './OAuthAuthorizeResponseDto'; export * from './OAuthCallbackDto'; export * from './OAuthConfigDto'; -export * from './OAuthConfigResponseDto'; export * from './PartnerResponseDto'; export * from './PathEntityType'; export * from './PathType'; diff --git a/server/e2e/api/specs/asset.e2e-spec.ts b/server/e2e/api/specs/asset.e2e-spec.ts index e38f08d0ca..6f6bc88903 100644 --- a/server/e2e/api/specs/asset.e2e-spec.ts +++ b/server/e2e/api/specs/asset.e2e-spec.ts @@ -14,7 +14,7 @@ import { AssetEntity, AssetStackEntity, AssetType, SharedLinkType } from '@app/i import { AssetRepository } from '@app/infra/repositories'; import { INestApplication } from '@nestjs/common'; import { errorStub, userDto, uuidStub } from '@test/fixtures'; -import { randomBytes } from 'crypto'; +import { randomBytes } from 'node:crypto'; import request from 'supertest'; import { api } from '../../client'; import { generateAsset, testApp, today, yesterday } from '../utils'; @@ -517,91 +517,6 @@ describe(`${AssetController.name} (e2e)`, () => { } }); - // TODO remove with deprecated endpoint - describe('GET /asset/assetById/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(server).get(`/asset/assetById/${uuidStub.notFound}`); - expect(body).toEqual(errorStub.unauthorized); - expect(status).toBe(401); - }); - - it('should require a valid id', async () => { - const { status, body } = await request(server) - .get(`/asset/assetById/${uuidStub.invalid}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorStub.badRequest(['id must be a UUID'])); - }); - - it('should require access', async () => { - const { status, body } = await request(server) - .get(`/asset/assetById/${asset4.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorStub.noPermission); - }); - - it('should get the asset info', async () => { - const { status, body } = await request(server) - .get(`/asset/assetById/${asset1.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toMatchObject({ id: asset1.id }); - }); - - it('should work with a shared link', async () => { - const sharedLink = await api.sharedLinkApi.create(server, user1.accessToken, { - type: SharedLinkType.INDIVIDUAL, - assetIds: [asset1.id], - }); - - const { status, body } = await request(server).get(`/asset/assetById/${asset1.id}?key=${sharedLink.key}`); - expect(status).toBe(200); - expect(body).toMatchObject({ id: asset1.id }); - }); - - it('should not send people data for shared links for un-authenticated users', async () => { - const personRepository = app.get(IPersonRepository); - const person = await personRepository.create({ ownerId: asset1.ownerId, name: 'Test Person' }); - - await personRepository.createFaces([ - { - assetId: asset1.id, - personId: person.id, - embedding: Array.from({ length: 512 }, Math.random), - }, - ]); - - const { status, body } = await request(server) - .put(`/asset/${asset1.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ isFavorite: true }); - expect(status).toEqual(200); - expect(body).toMatchObject({ - id: asset1.id, - isFavorite: true, - people: [ - { - birthDate: null, - id: expect.any(String), - isHidden: false, - name: 'Test Person', - thumbnailPath: '', - }, - ], - }); - - const sharedLink = await api.sharedLinkApi.create(server, user1.accessToken, { - type: SharedLinkType.INDIVIDUAL, - assetIds: [asset1.id], - }); - - const data = await request(server).get(`/asset/assetById/${asset1.id}?key=${sharedLink.key}`); - expect(data.status).toBe(200); - expect(data.body).toMatchObject({ people: [] }); - }); - }); - describe('GET /asset/:id', () => { it('should require authentication', async () => { const { status, body } = await request(server).get(`/asset/${uuidStub.notFound}`); @@ -643,6 +558,47 @@ describe(`${AssetController.name} (e2e)`, () => { expect(status).toBe(200); expect(body).toMatchObject({ id: asset1.id }); }); + + it('should not send people data for shared links for un-authenticated users', async () => { + const personRepository = app.get(IPersonRepository); + const person = await personRepository.create({ ownerId: asset1.ownerId, name: 'Test Person' }); + + await personRepository.createFaces([ + { + assetId: asset1.id, + personId: person.id, + embedding: Array.from({ length: 512 }, Math.random), + }, + ]); + + const { status, body } = await request(server) + .put(`/asset/${asset1.id}`) + .set('Authorization', `Bearer ${user1.accessToken}`) + .send({ isFavorite: true }); + expect(status).toEqual(200); + expect(body).toMatchObject({ + id: asset1.id, + isFavorite: true, + people: [ + { + birthDate: null, + id: expect.any(String), + isHidden: false, + name: 'Test Person', + thumbnailPath: '', + }, + ], + }); + + const sharedLink = await api.sharedLinkApi.create(server, user1.accessToken, { + type: SharedLinkType.INDIVIDUAL, + assetIds: [asset1.id], + }); + + const data = await request(server).get(`/asset/${asset1.id}?key=${sharedLink.key}`); + expect(data.status).toBe(200); + expect(data.body).toMatchObject({ people: [] }); + }); }); describe('POST /asset/upload', () => { @@ -920,46 +876,6 @@ describe(`${AssetController.name} (e2e)`, () => { }); }); - describe('POST /asset/download/info', () => { - it('should require authentication', async () => { - const { status, body } = await request(server) - .post(`/asset/download/info`) - .send({ assetIds: [asset1.id] }); - - expect(status).toBe(401); - expect(body).toEqual(errorStub.unauthorized); - }); - - it('should download info', async () => { - const { status, body } = await request(server) - .post('/asset/download/info') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset1.id] }); - - expect(status).toBe(201); - expect(body).toEqual(expect.objectContaining({ archives: [expect.objectContaining({ assetIds: [asset1.id] })] })); - }); - }); - - describe('POST /asset/download/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(server).post(`/asset/download/${asset1.id}`); - - expect(status).toBe(401); - expect(body).toEqual(errorStub.unauthorized); - }); - - it('should download file', async () => { - const asset = await api.assetApi.upload(server, user1.accessToken, 'example'); - const response = await request(server) - .post(`/asset/download/${asset.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(response.status).toBe(200); - expect(response.headers['content-type']).toEqual('image/jpeg'); - }); - }); - describe('GET /asset/statistics', () => { beforeEach(async () => { await api.assetApi.upload(server, user1.accessToken, 'favored_asset', { isFavorite: true }); @@ -1459,20 +1375,20 @@ describe(`${AssetController.name} (e2e)`, () => { }); }); + const getAssetIdsWithoutFaces = async () => { + const assetPagination = usePagination(10, (pagination) => + assetRepository.getWithout(pagination, WithoutProperty.FACES), + ); + let assets: AssetEntity[] = []; + for await (const assetsPage of assetPagination) { + assets = [...assets, ...assetsPage]; + } + return assets.map((a) => a.id); + }; + describe(AssetRepository.name, () => { describe('getWithout', () => { describe('WithoutProperty.FACES', () => { - const getAssetIdsWithoutFaces = async () => { - const assetPagination = usePagination(10, (pagination) => - assetRepository.getWithout(pagination, WithoutProperty.FACES), - ); - let assets: AssetEntity[] = []; - for await (const assetsPage of assetPagination) { - assets = [...assets, ...assetsPage]; - } - return assets.map((a) => a.id); - }; - beforeEach(async () => { await assetRepository.save({ id: asset1.id, resizePath: '/path/to/resize' }); expect(await getAssetIdsWithoutFaces()).toContain(asset1.id); diff --git a/server/e2e/api/specs/download.e2e-spec.ts b/server/e2e/api/specs/download.e2e-spec.ts new file mode 100644 index 0000000000..9f8c477df9 --- /dev/null +++ b/server/e2e/api/specs/download.e2e-spec.ts @@ -0,0 +1,89 @@ +import { AssetResponseDto, IAssetRepository, LibraryResponseDto, LoginResponseDto, mapAsset } from '@app/domain'; +import { AssetController } from '@app/immich'; +import { AssetEntity } from '@app/infra/entities'; +import { INestApplication } from '@nestjs/common'; +import { errorStub, userDto } from '@test/fixtures'; +import request from 'supertest'; +import { api } from '../../client'; +import { generateAsset, testApp } from '../utils'; + +describe(`${AssetController.name} (e2e)`, () => { + let app: INestApplication; + let server: any; + let assetRepository: IAssetRepository; + let user1: LoginResponseDto; + let libraries: LibraryResponseDto[]; + let asset1: AssetResponseDto; + + const createAsset = async ( + loginResponse: LoginResponseDto, + fileCreatedAt: Date, + other: Partial = {}, + ) => { + const asset = await assetRepository.create( + generateAsset(loginResponse.userId, libraries, { fileCreatedAt, ...other }), + ); + + return mapAsset(asset); + }; + + beforeAll(async () => { + app = await testApp.create(); + server = app.getHttpServer(); + assetRepository = app.get(IAssetRepository); + + await testApp.reset(); + + await api.authApi.adminSignUp(server); + const admin = await api.authApi.adminLogin(server); + + await api.userApi.create(server, admin.accessToken, userDto.user1); + user1 = await api.authApi.login(server, userDto.user1); + libraries = await api.libraryApi.getAll(server, user1.accessToken); + asset1 = await createAsset(user1, new Date('1970-01-01')); + }); + + afterAll(async () => { + await testApp.teardown(); + }); + + describe('POST /download/info', () => { + it('should require authentication', async () => { + const { status, body } = await request(server) + .post(`/download/info`) + .send({ assetIds: [asset1.id] }); + + expect(status).toBe(401); + expect(body).toEqual(errorStub.unauthorized); + }); + + it('should download info', async () => { + const { status, body } = await request(server) + .post('/download/info') + .set('Authorization', `Bearer ${user1.accessToken}`) + .send({ assetIds: [asset1.id] }); + + expect(status).toBe(201); + expect(body).toEqual(expect.objectContaining({ archives: [expect.objectContaining({ assetIds: [asset1.id] })] })); + }); + }); + + describe('POST /download/asset/:id', () => { + it('should require authentication', async () => { + const { status, body } = await request(server).post(`/download/asset/${asset1.id}`); + + expect(status).toBe(401); + expect(body).toEqual(errorStub.unauthorized); + }); + + it('should download file', async () => { + const asset = await api.assetApi.upload(server, user1.accessToken, 'example'); + const response = await request(server) + .post(`/download/asset/${asset.id}`) + .set('Authorization', `Bearer ${user1.accessToken}`); + + expect(response.status).toBe(200); + expect(response.headers['content-type']).toEqual('image/jpeg'); + }); + }); +}); diff --git a/server/e2e/client/asset-api.ts b/server/e2e/client/asset-api.ts index b9ae897b33..8d2a1b79bc 100644 --- a/server/e2e/client/asset-api.ts +++ b/server/e2e/client/asset-api.ts @@ -1,7 +1,7 @@ import { AssetResponseDto } from '@app/domain'; import { CreateAssetDto } from '@app/immich/api-v1/asset/dto/create-asset.dto'; import { AssetFileUploadResponseDto } from '@app/immich/api-v1/asset/response-dto/asset-file-upload-response.dto'; -import { randomBytes } from 'crypto'; +import { randomBytes } from 'node:crypto'; import request from 'supertest'; type UploadDto = Partial & { content?: Buffer; filename?: string }; @@ -34,9 +34,7 @@ export const assetApi = { return body as AssetResponseDto; }, get: async (server: any, accessToken: string, id: string): Promise => { - const { body, status } = await request(server) - .get(`/asset/assetById/${id}`) - .set('Authorization', `Bearer ${accessToken}`); + const { body, status } = await request(server).get(`/asset/${id}`).set('Authorization', `Bearer ${accessToken}`); expect(status).toBe(200); return body as AssetResponseDto; }, diff --git a/server/src/domain/auth/auth.dto.ts b/server/src/domain/auth/auth.dto.ts index 854ac99963..2f6f4b4b72 100644 --- a/server/src/domain/auth/auth.dto.ts +++ b/server/src/domain/auth/auth.dto.ts @@ -106,15 +106,6 @@ export class OAuthConfigDto { redirectUri!: string; } -/** @deprecated use oauth authorize */ -export class OAuthConfigResponseDto { - enabled!: boolean; - passwordLoginEnabled!: boolean; - url?: string; - buttonText?: string; - autoLaunch?: boolean; -} - export class OAuthAuthorizeResponseDto { url!: string; } diff --git a/server/src/domain/auth/auth.service.spec.ts b/server/src/domain/auth/auth.service.spec.ts index 78462cb490..8ebb75857a 100644 --- a/server/src/domain/auth/auth.service.spec.ts +++ b/server/src/domain/auth/auth.service.spec.ts @@ -429,27 +429,6 @@ describe('AuthService', () => { }); }); - describe('generateConfig', () => { - it('should work when oauth is not configured', async () => { - configMock.load.mockResolvedValue(systemConfigStub.disabled); - await expect(sut.generateConfig({ redirectUri: 'http://callback' })).resolves.toEqual({ - enabled: false, - passwordLoginEnabled: false, - }); - }); - - it('should generate the config', async () => { - configMock.load.mockResolvedValue(systemConfigStub.enabled); - await expect(sut.generateConfig({ redirectUri: 'http://redirect' })).resolves.toEqual({ - enabled: true, - buttonText: 'OAuth', - url: 'http://authorization-url', - autoLaunch: false, - passwordLoginEnabled: true, - }); - }); - }); - describe('callback', () => { it('should throw an error if OAuth is not enabled', async () => { await expect(sut.callback({ url: '' }, loginDetails)).rejects.toBeInstanceOf(BadRequestException); diff --git a/server/src/domain/auth/auth.service.ts b/server/src/domain/auth/auth.service.ts index 2acade6365..d4c2e4e189 100644 --- a/server/src/domain/auth/auth.service.ts +++ b/server/src/domain/auth/auth.service.ts @@ -42,7 +42,6 @@ import { OAuthAuthorizeResponseDto, OAuthCallbackDto, OAuthConfigDto, - OAuthConfigResponseDto, SignUpDto, mapLoginResponse, mapUserToken, @@ -201,28 +200,6 @@ export class AuthService { return `${MOBILE_REDIRECT}?${url.split('?')[1] || ''}`; } - async generateConfig(dto: OAuthConfigDto): Promise { - const config = await this.configCore.getConfig(); - const response = { - enabled: config.oauth.enabled, - passwordLoginEnabled: config.passwordLogin.enabled, - }; - - if (!response.enabled) { - return response; - } - - const { scope, buttonText, autoLaunch } = config.oauth; - const oauthClient = await this.getOAuthClient(config); - const url = oauthClient.authorizationUrl({ - redirect_uri: this.normalize(config, dto.redirectUri), - scope, - state: generators.state(), - }); - - return { ...response, buttonText, url, autoLaunch }; - } - async authorize(dto: OAuthConfigDto): Promise { const config = await this.configCore.getConfig(); if (!config.oauth.enabled) { diff --git a/server/src/domain/system-config/system-config.core.ts b/server/src/domain/system-config/system-config.core.ts index 0516e04043..1591e87d63 100644 --- a/server/src/domain/system-config/system-config.core.ts +++ b/server/src/domain/system-config/system-config.core.ts @@ -230,8 +230,6 @@ export class SystemConfigCore { [FeatureFlag.SIDECAR]: true, [FeatureFlag.SEARCH]: true, [FeatureFlag.TRASH]: config.trash.enabled, - - // TODO: use these instead of `POST oauth/config` [FeatureFlag.OAUTH]: config.oauth.enabled, [FeatureFlag.OAUTH_AUTO_LAUNCH]: config.oauth.autoLaunch, [FeatureFlag.PASSWORD_LOGIN]: config.passwordLogin.enabled, diff --git a/server/src/immich/api-v1/asset/asset.controller.ts b/server/src/immich/api-v1/asset/asset.controller.ts index ddcb8417c8..bc59e2dfef 100644 --- a/server/src/immich/api-v1/asset/asset.controller.ts +++ b/server/src/immich/api-v1/asset/asset.controller.ts @@ -1,4 +1,4 @@ -import { AssetResponseDto, AssetService, AuthDto } from '@app/domain'; +import { AssetResponseDto, AuthDto } from '@app/domain'; import { Body, Controller, @@ -18,7 +18,7 @@ import { import { ApiBody, ApiConsumes, ApiHeader, ApiTags } from '@nestjs/swagger'; import { NextFunction, Response } from 'express'; import { Auth, Authenticated, FileResponse, SharedLinkRoute } from '../../app.guard'; -import { UseValidation, sendFile } from '../../app.utils'; +import { sendFile } from '../../app.utils'; import { UUIDParamDto } from '../../controllers/dto/uuid-param.dto'; import { FileUploadInterceptor, ImmichFile, Route, mapToUploadFile } from '../../interceptors'; import FileNotEmptyValidator from '../validation/file-not-empty-validator'; @@ -45,10 +45,7 @@ interface UploadFiles { @Controller(Route.ASSET) @Authenticated() export class AssetController { - constructor( - private serviceV1: AssetServiceV1, - private service: AssetService, - ) {} + constructor(private serviceV1: AssetServiceV1) {} @SharedLinkRoute() @Post('upload') @@ -143,17 +140,6 @@ export class AssetController { return this.serviceV1.getAllAssets(auth, dto); } - /** - * Get a single asset's information - * @deprecated Use `/asset/:id` - */ - @SharedLinkRoute() - @UseValidation() - @Get('/assetById/:id') - getAssetById(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise { - return this.service.get(auth, id) as Promise; - } - /** * Checks if multiple assets exist on the server and returns all existing - used by background backup */ diff --git a/server/src/immich/controllers/asset.controller.ts b/server/src/immich/controllers/asset.controller.ts index 86a2b155ab..ad29ff080d 100644 --- a/server/src/immich/controllers/asset.controller.ts +++ b/server/src/immich/controllers/asset.controller.ts @@ -1,7 +1,6 @@ import { AssetBulkDeleteDto, AssetBulkUpdateDto, - AssetIdsDto, AssetJobsDto, AssetResponseDto, AssetSearchDto, @@ -9,10 +8,7 @@ import { AssetStatsDto, AssetStatsResponseDto, AuthDto, - BulkIdsDto, DeviceIdDto, - DownloadInfoDto, - DownloadResponseDto, DownloadService, MapMarkerDto, MapMarkerResponseDto, @@ -26,25 +22,10 @@ import { UpdateAssetDto as UpdateDto, UpdateStackParentDto, } from '@app/domain'; -import { - Body, - Controller, - Delete, - Get, - HttpCode, - HttpStatus, - Next, - Param, - Post, - Put, - Query, - Res, - StreamableFile, -} from '@nestjs/common'; +import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { NextFunction, Response } from 'express'; -import { Auth, Authenticated, FileResponse, SharedLinkRoute } from '../app.guard'; -import { UseValidation, asStreamableFile, sendFile } from '../app.utils'; +import { Auth, Authenticated, SharedLinkRoute } from '../app.guard'; +import { UseValidation } from '../app.utils'; import { Route } from '../interceptors'; import { UUIDParamDto } from './dto/uuid-param.dto'; @@ -87,42 +68,6 @@ export class AssetController { return this.service.getRandom(auth, dto.count ?? 1); } - /** - * @deprecated use `/download/info` - */ - @SharedLinkRoute() - @Post('download/info') - getDownloadInfoOld(@Auth() auth: AuthDto, @Body() dto: DownloadInfoDto): Promise { - return this.downloadService.getDownloadInfo(auth, dto); - } - - /** - * @deprecated use `/download/archive` - */ - @SharedLinkRoute() - @Post('download/archive') - @HttpCode(HttpStatus.OK) - @FileResponse() - downloadArchiveOld(@Auth() auth: AuthDto, @Body() dto: AssetIdsDto): Promise { - return this.downloadService.downloadArchive(auth, dto).then(asStreamableFile); - } - - /** - * @deprecated use `/download/:id` - */ - @SharedLinkRoute() - @Post('download/:id') - @HttpCode(HttpStatus.OK) - @FileResponse() - async downloadFileOld( - @Res() res: Response, - @Next() next: NextFunction, - @Auth() auth: AuthDto, - @Param() { id }: UUIDParamDto, - ) { - await sendFile(res, next, () => this.downloadService.downloadFile(auth, id)); - } - /** * Get all asset of a device that are in the database, ID only. */ @@ -166,33 +111,6 @@ export class AssetController { return this.service.deleteAll(auth, dto); } - /** - * @deprecated use `POST /trash/restore/assets` - */ - @Post('restore') - @HttpCode(HttpStatus.NO_CONTENT) - restoreAssetsOld(@Auth() auth: AuthDto, @Body() dto: BulkIdsDto): Promise { - return this.trashService.restoreAssets(auth, dto); - } - - /** - * @deprecated use `POST /trash/empty` - */ - @Post('trash/empty') - @HttpCode(HttpStatus.NO_CONTENT) - emptyTrashOld(@Auth() auth: AuthDto): Promise { - return this.trashService.empty(auth); - } - - /** - * @deprecated use `POST /trash/restore` - */ - @Post('trash/restore') - @HttpCode(HttpStatus.NO_CONTENT) - restoreTrashOld(@Auth() auth: AuthDto): Promise { - return this.trashService.restore(auth); - } - @Put('stack/parent') @HttpCode(HttpStatus.OK) updateStackParent(@Auth() auth: AuthDto, @Body() dto: UpdateStackParentDto): Promise { diff --git a/server/src/immich/controllers/oauth.controller.ts b/server/src/immich/controllers/oauth.controller.ts index 678e4a4f3c..a62458715b 100644 --- a/server/src/immich/controllers/oauth.controller.ts +++ b/server/src/immich/controllers/oauth.controller.ts @@ -6,7 +6,6 @@ import { OAuthAuthorizeResponseDto, OAuthCallbackDto, OAuthConfigDto, - OAuthConfigResponseDto, UserResponseDto, } from '@app/domain'; import { Body, Controller, Get, HttpStatus, Post, Redirect, Req, Res } from '@nestjs/common'; @@ -32,13 +31,6 @@ export class OAuthController { }; } - /** @deprecated use feature flags and /oauth/authorize */ - @PublicRoute() - @Post('config') - generateOAuthConfig(@Body() dto: OAuthConfigDto): Promise { - return this.service.generateConfig(dto); - } - @PublicRoute() @Post('authorize') startOAuth(@Body() dto: OAuthConfigDto): Promise {