High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
chore(server): remove user count endpoint (#4724)
Jason Rasmussen8dcd159bd6bf
diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.tsindex b1714e2764..e79388602d 100644--- a/cli/src/api/open-api/api.ts+++ b/cli/src/api/open-api/api.ts@@ -3964,6 +3964,7 @@ export const TranscodeHWAccel = {Nvenc: 'nvenc',Qsv: 'qsv',Vaapi: 'vaapi',+ Rkmpp: 'rkmpp',Disabled: 'disabled'} as const;@@ -4209,19 +4210,6 @@ export interface UsageByUserDto {*/'videos': number;}-/**- *- * @export- * @interface UserCountResponseDto- */-export interface UserCountResponseDto {- /**- *- * @type {number}- * @memberof UserCountResponseDto- */- 'userCount': number;-}/**** @export@@ -15742,49 +15730,6 @@ export const UserApiAxiosParamCreator = 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 {boolean} [admin]- * @param {*} [options] Override http request option.- * @throws {RequiredError}- */- getUserCount: async (admin?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {- const localVarPath = `/user/count`;- // 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 (admin !== undefined) {- localVarQueryParameter['admin'] = admin;- }---setSearchParams(localVarUrlObj, localVarQueryParameter);let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};@@ -15959,16 +15904,6 @@ export const UserApiFp = function(configuration?: Configuration) {const localVarAxiosArgs = await localVarAxiosParamCreator.getUserById(id, options);return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);},- /**- *- * @param {boolean} [admin]- * @param {*} [options] Override http request option.- * @throws {RequiredError}- */- async getUserCount(admin?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserCountResponseDto>> {- const localVarAxiosArgs = await localVarAxiosParamCreator.getUserCount(admin, options);- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);- },/**** @param {string} id@@ -16061,15 +15996,6 @@ export const UserApiFactory = function (configuration?: Configuration, basePath?getUserById(requestParameters: UserApiGetUserByIdRequest, options?: AxiosRequestConfig): AxiosPromise<UserResponseDto> {return localVarFp.getUserById(requestParameters.id, options).then((request) => request(axios, basePath));},- /**- *- * @param {UserApiGetUserCountRequest} requestParameters Request parameters.- * @param {*} [options] Override http request option.- * @throws {RequiredError}- */- getUserCount(requestParameters: UserApiGetUserCountRequest = {}, options?: AxiosRequestConfig): AxiosPromise<UserCountResponseDto> {- return localVarFp.getUserCount(requestParameters.admin, options).then((request) => request(axios, basePath));- },/**** @param {UserApiRestoreUserRequest} requestParameters Request parameters.@@ -16175,20 +16101,6 @@ export interface UserApiGetUserByIdRequest {readonly id: string}-/**- * Request parameters for getUserCount operation in UserApi.- * @export- * @interface UserApiGetUserCountRequest- */-export interface UserApiGetUserCountRequest {- /**- *- * @type {boolean}- * @memberof UserApiGetUserCount- */- readonly admin?: boolean-}-/*** Request parameters for restoreUser operation in UserApi.* @export@@ -16300,17 +16212,6 @@ export class UserApi extends BaseAPI {return UserApiFp(this.configuration).getUserById(requestParameters.id, options).then((request) => request(this.axios, this.basePath));}- /**- *- * @param {UserApiGetUserCountRequest} requestParameters Request parameters.- * @param {*} [options] Override http request option.- * @throws {RequiredError}- * @memberof UserApi- */- public getUserCount(requestParameters: UserApiGetUserCountRequest = {}, options?: AxiosRequestConfig) {- return UserApiFp(this.configuration).getUserCount(requestParameters.admin, options).then((request) => request(this.axios, this.basePath));- }-/**** @param {UserApiRestoreUserRequest} requestParameters Request parameters.diff --git a/mobile/openapi/.openapi-generator/FILES b/mobile/openapi/.openapi-generator/FILESindex cbad0876c7..6350677f1e 100644--- a/mobile/openapi/.openapi-generator/FILES+++ b/mobile/openapi/.openapi-generator/FILES@@ -156,7 +156,6 @@ doc/UpdateTagDto.mddoc/UpdateUserDto.mddoc/UsageByUserDto.mddoc/UserApi.md-doc/UserCountResponseDto.mddoc/UserResponseDto.mddoc/ValidateAccessTokenResponseDto.mddoc/VideoCodec.md@@ -323,7 +322,6 @@ lib/model/update_stack_parent_dto.dartlib/model/update_tag_dto.dartlib/model/update_user_dto.dartlib/model/usage_by_user_dto.dart-lib/model/user_count_response_dto.dartlib/model/user_response_dto.dartlib/model/validate_access_token_response_dto.dartlib/model/video_codec.dart@@ -481,7 +479,6 @@ test/update_tag_dto_test.darttest/update_user_dto_test.darttest/usage_by_user_dto_test.darttest/user_api_test.dart-test/user_count_response_dto_test.darttest/user_response_dto_test.darttest/validate_access_token_response_dto_test.darttest/video_codec_test.dartdiff --git a/mobile/openapi/README.md b/mobile/openapi/README.mdindex 29572ead25..6ec6039620 100644--- a/mobile/openapi/README.md+++ b/mobile/openapi/README.md@@ -194,7 +194,6 @@ Class | Method | HTTP request | Description*UserApi* | [**getMyUserInfo**](doc//UserApi.md#getmyuserinfo) | **GET** /user/me |*UserApi* | [**getProfileImage**](doc//UserApi.md#getprofileimage) | **GET** /user/profile-image/{id} |*UserApi* | [**getUserById**](doc//UserApi.md#getuserbyid) | **GET** /user/info/{id} |-*UserApi* | [**getUserCount**](doc//UserApi.md#getusercount) | **GET** /user/count |*UserApi* | [**restoreUser**](doc//UserApi.md#restoreuser) | **POST** /user/{id}/restore |*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user |@@ -338,7 +337,6 @@ Class | Method | HTTP request | Description- [UpdateTagDto](doc//UpdateTagDto.md)- [UpdateUserDto](doc//UpdateUserDto.md)- [UsageByUserDto](doc//UsageByUserDto.md)- - [UserCountResponseDto](doc//UserCountResponseDto.md)- [UserResponseDto](doc//UserResponseDto.md)- [ValidateAccessTokenResponseDto](doc//ValidateAccessTokenResponseDto.md)- [VideoCodec](doc//VideoCodec.md)diff --git a/mobile/openapi/doc/UserApi.md b/mobile/openapi/doc/UserApi.mdindex 165a543352..fb88d53bdd 100644--- a/mobile/openapi/doc/UserApi.md+++ b/mobile/openapi/doc/UserApi.md@@ -16,7 +16,6 @@ Method | HTTP request | Description[**getMyUserInfo**](UserApi.md#getmyuserinfo) | **GET** /user/me |[**getProfileImage**](UserApi.md#getprofileimage) | **GET** /user/profile-image/{id} |[**getUserById**](UserApi.md#getuserbyid) | **GET** /user/info/{id} |-[**getUserCount**](UserApi.md#getusercount) | **GET** /user/count |[**restoreUser**](UserApi.md#restoreuser) | **POST** /user/{id}/restore |[**updateUser**](UserApi.md#updateuser) | **PUT** /user |@@ -402,61 +401,6 @@ Name | Type | Description | Notes[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)-# **getUserCount**-> UserCountResponseDto getUserCount(admin)----### Example-```dart-import 'package:openapi/api.dart';-// TODO Configure API key authorization: cookie-//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';-// uncomment below to setup prefix (e.g. Bearer) for API key, if needed-//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';-// TODO Configure API key authorization: api_key-//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';-// uncomment below to setup prefix (e.g. Bearer) for API key, if needed-//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';-// TODO Configure HTTP Bearer authorization: bearer-// Case 1. Use String Token-//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');-// Case 2. Use Function which generate token.-// String yourTokenGeneratorFunction() { ... }-//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);--final api_instance = UserApi();-final admin = true; // bool |--try {- final result = api_instance.getUserCount(admin);- print(result);-} catch (e) {- print('Exception when calling UserApi->getUserCount: $e\n');-}-```--### Parameters--Name | Type | Description | Notes-------------- | ------------- | ------------- | -------------- **admin** | **bool**| | [optional] [default to false]--### Return type--[**UserCountResponseDto**](UserCountResponseDto.md)--### Authorization--[cookie](../README.md#cookie), [api_key](../README.md#api_key), [bearer](../README.md#bearer)--### HTTP request headers-- - **Content-Type**: Not defined- - **Accept**: application/json--[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)-# **restoreUser**> UserResponseDto restoreUser(id)diff --git a/mobile/openapi/doc/UserCountResponseDto.md b/mobile/openapi/doc/UserCountResponseDto.mddeleted file mode 100644index 65dab56866..0000000000--- a/mobile/openapi/doc/UserCountResponseDto.md+++ /dev/null@@ -1,15 +0,0 @@-# openapi.model.UserCountResponseDto--## Load the model package-```dart-import 'package:openapi/api.dart';-```--## Properties-Name | Type | Description | Notes------------- | ------------- | ------------- | --------------**userCount** | **int** | |--[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)--diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dartindex 22c4a23e61..7a621b7f47 100644--- a/mobile/openapi/lib/api.dart+++ b/mobile/openapi/lib/api.dart@@ -182,7 +182,6 @@ part 'model/update_stack_parent_dto.dart';part 'model/update_tag_dto.dart';part 'model/update_user_dto.dart';part 'model/usage_by_user_dto.dart';-part 'model/user_count_response_dto.dart';part 'model/user_response_dto.dart';part 'model/validate_access_token_response_dto.dart';part 'model/video_codec.dart';diff --git a/mobile/openapi/lib/api/user_api.dart b/mobile/openapi/lib/api/user_api.dartindex 110528d40c..23f25492ce 100644--- a/mobile/openapi/lib/api/user_api.dart+++ b/mobile/openapi/lib/api/user_api.dart@@ -357,57 +357,6 @@ class UserApi {return null;}- /// Performs an HTTP 'GET /user/count' operation and returns the [Response].- /// Parameters:- ///- /// * [bool] admin:- Future<Response> getUserCountWithHttpInfo({ bool? admin, }) async {- // ignore: prefer_const_declarations- final path = r'/user/count';-- // ignore: prefer_final_locals- Object? postBody;-- final queryParams = <QueryParam>[];- final headerParams = <String, String>{};- final formParams = <String, String>{};-- if (admin != null) {- queryParams.addAll(_queryParams('', 'admin', admin));- }-- const contentTypes = <String>[];--- return apiClient.invokeAPI(- path,- 'GET',- queryParams,- postBody,- headerParams,- formParams,- contentTypes.isEmpty ? null : contentTypes.first,- );- }-- /// Parameters:- ///- /// * [bool] admin:- Future<UserCountResponseDto?> getUserCount({ bool? admin, }) async {- final response = await getUserCountWithHttpInfo( admin: admin, );- if (response.statusCode >= HttpStatus.badRequest) {- throw ApiException(response.statusCode, await _decodeBodyBytes(response));- }- // When a remote server returns no body with a status of 204, we shall not decode it.- // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"- // FormatException when trying to decode an empty string.- if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {- return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserCountResponseDto',) as UserCountResponseDto;-- }- return null;- }-/// Performs an HTTP 'POST /user/{id}/restore' operation and returns the [Response]./// Parameters:///diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dartindex 2bd9411af8..fa16b0d601 100644--- a/mobile/openapi/lib/api_client.dart+++ b/mobile/openapi/lib/api_client.dart@@ -455,8 +455,6 @@ class ApiClient {return UpdateUserDto.fromJson(value);case 'UsageByUserDto':return UsageByUserDto.fromJson(value);- case 'UserCountResponseDto':- return UserCountResponseDto.fromJson(value);case 'UserResponseDto':return UserResponseDto.fromJson(value);case 'ValidateAccessTokenResponseDto':diff --git a/mobile/openapi/lib/model/user_count_response_dto.dart b/mobile/openapi/lib/model/user_count_response_dto.dartdeleted file mode 100644index ecdcd6e468..0000000000--- a/mobile/openapi/lib/model/user_count_response_dto.dart+++ /dev/null@@ -1,98 +0,0 @@-//-// AUTO-GENERATED FILE, DO NOT MODIFY!-//-// @dart=2.12--// ignore_for_file: unused_element, unused_import-// ignore_for_file: always_put_required_named_parameters_first-// ignore_for_file: constant_identifier_names-// ignore_for_file: lines_longer_than_80_chars--part of openapi.api;--class UserCountResponseDto {- /// Returns a new [UserCountResponseDto] instance.- UserCountResponseDto({- required this.userCount,- });-- int userCount;-- @override- bool operator ==(Object other) => identical(this, other) || other is UserCountResponseDto &&- other.userCount == userCount;-- @override- int get hashCode =>- // ignore: unnecessary_parenthesis- (userCount.hashCode);-- @override- String toString() => 'UserCountResponseDto[userCount=$userCount]';-- Map<String, dynamic> toJson() {- final json = <String, dynamic>{};- json[r'userCount'] = this.userCount;- return json;- }-- /// Returns a new [UserCountResponseDto] instance and imports its values from- /// [value] if it's a [Map], null otherwise.- // ignore: prefer_constructors_over_static_methods- static UserCountResponseDto? fromJson(dynamic value) {- if (value is Map) {- final json = value.cast<String, dynamic>();-- return UserCountResponseDto(- userCount: mapValueOfType<int>(json, r'userCount')!,- );- }- return null;- }-- static List<UserCountResponseDto> listFromJson(dynamic json, {bool growable = false,}) {- final result = <UserCountResponseDto>[];- if (json is List && json.isNotEmpty) {- for (final row in json) {- final value = UserCountResponseDto.fromJson(row);- if (value != null) {- result.add(value);- }- }- }- return result.toList(growable: growable);- }-- static Map<String, UserCountResponseDto> mapFromJson(dynamic json) {- final map = <String, UserCountResponseDto>{};- if (json is Map && json.isNotEmpty) {- json = json.cast<String, dynamic>(); // ignore: parameter_assignments- for (final entry in json.entries) {- final value = UserCountResponseDto.fromJson(entry.value);- if (value != null) {- map[entry.key] = value;- }- }- }- return map;- }-- // maps a json object with a list of UserCountResponseDto-objects as value to a dart map- static Map<String, List<UserCountResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {- final map = <String, List<UserCountResponseDto>>{};- if (json is Map && json.isNotEmpty) {- // ignore: parameter_assignments- json = json.cast<String, dynamic>();- for (final entry in json.entries) {- map[entry.key] = UserCountResponseDto.listFromJson(entry.value, growable: growable,);- }- }- return map;- }-- /// The list of required keys that must be present in a JSON.- static const requiredKeys = <String>{- 'userCount',- };-}-diff --git a/mobile/openapi/test/user_api_test.dart b/mobile/openapi/test/user_api_test.dartindex 1cb9379741..86c33c7e0e 100644--- a/mobile/openapi/test/user_api_test.dart+++ b/mobile/openapi/test/user_api_test.dart@@ -52,11 +52,6 @@ void main() {// TODO});- //Future<UserCountResponseDto> getUserCount({ bool admin }) async- test('test getUserCount', () async {- // TODO- });-//Future<UserResponseDto> restoreUser(String id) asynctest('test restoreUser', () async {// TODOdiff --git a/mobile/openapi/test/user_count_response_dto_test.dart b/mobile/openapi/test/user_count_response_dto_test.dartdeleted file mode 100644index 5c46cd3598..0000000000--- a/mobile/openapi/test/user_count_response_dto_test.dart+++ /dev/null@@ -1,27 +0,0 @@-//-// AUTO-GENERATED FILE, DO NOT MODIFY!-//-// @dart=2.12--// ignore_for_file: unused_element, unused_import-// ignore_for_file: always_put_required_named_parameters_first-// ignore_for_file: constant_identifier_names-// ignore_for_file: lines_longer_than_80_chars--import 'package:openapi/api.dart';-import 'package:test/test.dart';--// tests for UserCountResponseDto-void main() {- // final instance = UserCountResponseDto();-- group('test UserCountResponseDto', () {- // int userCount- test('to test the property `userCount`', () async {- // TODO- });--- });--}diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.jsonindex bd99bd8d7e..49567f7f60 100644--- a/server/immich-openapi-specs.json+++ b/server/immich-openapi-specs.json@@ -5177,48 +5177,6 @@]}},- "/user/count": {- "get": {- "operationId": "getUserCount",- "parameters": [- {- "name": "admin",- "required": false,- "in": "query",- "schema": {- "default": false,- "type": "boolean"- }- }- ],- "responses": {- "200": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/UserCountResponseDto"- }- }- },- "description": ""- }- },- "security": [- {- "bearer": []- },- {- "cookie": []- },- {- "api_key": []- }- ],- "tags": [- "User"- ]- }- },"/user/info/{id}": {"get": {"operationId": "getUserById",@@ -8769,17 +8727,6 @@],"type": "object"},- "UserCountResponseDto": {- "properties": {- "userCount": {- "type": "integer"- }- },- "required": [- "userCount"- ],- "type": "object"- },"UserResponseDto": {"properties": {"createdAt": {diff --git a/server/src/domain/user/dto/index.ts b/server/src/domain/user/dto/index.tsindex f20bb94b0a..09d7998e8e 100644--- a/server/src/domain/user/dto/index.ts+++ b/server/src/domain/user/dto/index.ts@@ -1,4 +1,3 @@export * from './create-profile-image.dto';export * from './create-user.dto';export * from './update-user.dto';-export * from './user-count.dto';diff --git a/server/src/domain/user/dto/user-count.dto.ts b/server/src/domain/user/dto/user-count.dto.tsdeleted file mode 100644index c07fc2f20f..0000000000--- a/server/src/domain/user/dto/user-count.dto.ts+++ /dev/null@@ -1,13 +0,0 @@-import { Transform } from 'class-transformer';-import { IsBoolean } from 'class-validator';-import { Optional } from '../../domain.util';--export class UserCountDto {- @IsBoolean()- @Optional()- @Transform(({ value }) => value === 'true')- /**- * When true, return the number of admins accounts- */- admin?: boolean = false;-}diff --git a/server/src/domain/user/response-dto/index.ts b/server/src/domain/user/response-dto/index.tsindex eea5d8c779..8c550a4ff7 100644--- a/server/src/domain/user/response-dto/index.ts+++ b/server/src/domain/user/response-dto/index.ts@@ -1,3 +1,2 @@export * from './create-profile-image-response.dto';-export * from './user-count-response.dto';export * from './user-response.dto';diff --git a/server/src/domain/user/response-dto/user-count-response.dto.ts b/server/src/domain/user/response-dto/user-count-response.dto.tsdeleted file mode 100644index bcdc3a5b78..0000000000--- a/server/src/domain/user/response-dto/user-count-response.dto.ts+++ /dev/null@@ -1,12 +0,0 @@-import { ApiProperty } from '@nestjs/swagger';--export class UserCountResponseDto {- @ApiProperty({ type: 'integer' })- userCount!: number;-}--export function mapUserCountResponse(count: number): UserCountResponseDto {- return {- userCount: count,- };-}diff --git a/server/src/domain/user/user.service.spec.ts b/server/src/domain/user/user.service.spec.tsindex 308a2856ca..16cf68320c 100644--- a/server/src/domain/user/user.service.spec.ts+++ b/server/src/domain/user/user.service.spec.ts@@ -220,24 +220,6 @@ describe(UserService.name, () => {});});- describe('getCount', () => {- it('should get the user count', async () => {- userMock.getList.mockResolvedValue([adminUser]);-- const response = await sut.getCount({});-- expect(userMock.getList).toHaveBeenCalled();- expect(response).toEqual({ userCount: 1 });- });-- it('should get the user count of all admin users', async () => {- userMock.getList.mockResolvedValue([adminUser, immichUser]);-- await expect(sut.getCount({ admin: true })).resolves.toEqual({ userCount: 1 });- expect(userMock.getList).toHaveBeenCalled();- });- });-describe('update', () => {it('should update user', async () => {const update: UpdateUserDto = {diff --git a/server/src/domain/user/user.service.ts b/server/src/domain/user/user.service.tsindex 8e4e6cac95..df58276f76 100644--- a/server/src/domain/user/user.service.ts+++ b/server/src/domain/user/user.service.ts@@ -14,15 +14,8 @@ import {IUserRepository,} from '../repositories';import { StorageCore, StorageFolder } from '../storage';-import { CreateUserDto, UpdateUserDto, UserCountDto } from './dto';-import {- CreateProfileImageResponseDto,- UserCountResponseDto,- UserResponseDto,- mapCreateProfileImageResponse,- mapUser,- mapUserCountResponse,-} from './response-dto';+import { CreateUserDto, UpdateUserDto } from './dto';+import { CreateProfileImageResponseDto, UserResponseDto, mapCreateProfileImageResponse, mapUser } from './response-dto';import { UserCore } from './user.core';@Injectable()@@ -64,16 +57,6 @@ export class UserService {return mapUser(user);}- async getCount(dto: UserCountDto): Promise<UserCountResponseDto> {- let users = await this.userCore.getList();-- if (dto.admin) {- users = users.filter((user) => user.isAdmin);- }-- return mapUserCountResponse(users.length);- }-async create(createUserDto: CreateUserDto): Promise<UserResponseDto> {const createdUser = await this.userCore.createUser(createUserDto);return mapUser(createdUser);diff --git a/server/src/immich/controllers/user.controller.ts b/server/src/immich/controllers/user.controller.tsindex 01bc676c5e..254aa0525e 100644--- a/server/src/immich/controllers/user.controller.ts+++ b/server/src/immich/controllers/user.controller.ts@@ -1,11 +1,9 @@import {AuthUserDto,- UserCountDto as CountDto,CreateUserDto as CreateDto,CreateProfileImageDto,CreateProfileImageResponseDto,UpdateUserDto as UpdateDto,- UserCountResponseDto,UserResponseDto,UserService,} from '@app/domain';@@ -59,12 +57,6 @@ export class UserController {return this.service.create(createUserDto);}- @AdminRoute()- @Get('count')- getUserCount(@Query() dto: CountDto): Promise<UserCountResponseDto> {- return this.service.getCount(dto);- }-@AdminRoute()@Delete(':id')deleteUser(@AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto): Promise<UserResponseDto> {diff --git a/server/test/e2e/user.e2e-spec.ts b/server/test/e2e/user.e2e-spec.tsindex d20ac729f6..02b03e9bab 100644--- a/server/test/e2e/user.e2e-spec.ts+++ b/server/test/e2e/user.e2e-spec.ts@@ -312,32 +312,4 @@ describe(`${UserController.name}`, () => {expect(before.updatedAt).not.toEqual(after.updatedAt);});});-- describe('GET /user/count', () => {- it('should require authentication', async () => {- const { status, body } = await request(server).get(`/user/count`);- expect(status).toBe(401);- expect(body).toEqual(errorStub.unauthorized);- });-- it('should start with just the admin', async () => {- const { status, body } = await request(server).get(`/user/count`).set('Authorization', `Bearer ${accessToken}`);- expect(status).toBe(200);- expect(body).toEqual({ userCount: 1 });- });-- it('should return the total user count', async () => {- for (let i = 0; i < 5; i++) {- await api.userApi.create(server, accessToken, {- email: `user${i + 1}@immich.app`,- password: 'Password123',- firstName: `User ${i + 1}`,- lastName: 'Test',- });- }- const { status, body } = await request(server).get(`/user/count`).set('Authorization', `Bearer ${accessToken}`);- expect(status).toBe(200);- expect(body).toEqual({ userCount: 6 });- });- });});diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.tsindex 76c16e8bcf..e79388602d 100644--- a/web/src/api/open-api/api.ts+++ b/web/src/api/open-api/api.ts@@ -4210,19 +4210,6 @@ export interface UsageByUserDto {*/'videos': number;}-/**- *- * @export- * @interface UserCountResponseDto- */-export interface UserCountResponseDto {- /**- *- * @type {number}- * @memberof UserCountResponseDto- */- 'userCount': number;-}/**** @export@@ -15743,49 +15730,6 @@ export const UserApiAxiosParamCreator = 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 {boolean} [admin]- * @param {*} [options] Override http request option.- * @throws {RequiredError}- */- getUserCount: async (admin?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {- const localVarPath = `/user/count`;- // 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 (admin !== undefined) {- localVarQueryParameter['admin'] = admin;- }---setSearchParams(localVarUrlObj, localVarQueryParameter);let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};@@ -15960,16 +15904,6 @@ export const UserApiFp = function(configuration?: Configuration) {const localVarAxiosArgs = await localVarAxiosParamCreator.getUserById(id, options);return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);},- /**- *- * @param {boolean} [admin]- * @param {*} [options] Override http request option.- * @throws {RequiredError}- */- async getUserCount(admin?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserCountResponseDto>> {- const localVarAxiosArgs = await localVarAxiosParamCreator.getUserCount(admin, options);- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);- },/**** @param {string} id@@ -16062,15 +15996,6 @@ export const UserApiFactory = function (configuration?: Configuration, basePath?getUserById(requestParameters: UserApiGetUserByIdRequest, options?: AxiosRequestConfig): AxiosPromise<UserResponseDto> {return localVarFp.getUserById(requestParameters.id, options).then((request) => request(axios, basePath));},- /**- *- * @param {UserApiGetUserCountRequest} requestParameters Request parameters.- * @param {*} [options] Override http request option.- * @throws {RequiredError}- */- getUserCount(requestParameters: UserApiGetUserCountRequest = {}, options?: AxiosRequestConfig): AxiosPromise<UserCountResponseDto> {- return localVarFp.getUserCount(requestParameters.admin, options).then((request) => request(axios, basePath));- },/**** @param {UserApiRestoreUserRequest} requestParameters Request parameters.@@ -16176,20 +16101,6 @@ export interface UserApiGetUserByIdRequest {readonly id: string}-/**- * Request parameters for getUserCount operation in UserApi.- * @export- * @interface UserApiGetUserCountRequest- */-export interface UserApiGetUserCountRequest {- /**- *- * @type {boolean}- * @memberof UserApiGetUserCount- */- readonly admin?: boolean-}-/*** Request parameters for restoreUser operation in UserApi.* @export@@ -16301,17 +16212,6 @@ export class UserApi extends BaseAPI {return UserApiFp(this.configuration).getUserById(requestParameters.id, options).then((request) => request(this.axios, this.basePath));}- /**- *- * @param {UserApiGetUserCountRequest} requestParameters Request parameters.- * @param {*} [options] Override http request option.- * @throws {RequiredError}- * @memberof UserApi- */- public getUserCount(requestParameters: UserApiGetUserCountRequest = {}, options?: AxiosRequestConfig) {- return UserApiFp(this.configuration).getUserCount(requestParameters.admin, options).then((request) => request(this.axios, this.basePath));- }-/**** @param {UserApiRestoreUserRequest} requestParameters Request parameters.