diff --git a/backend/src/collections/apikey-db/apikey-db.service.ts b/backend/src/collections/apikey-db/apikey-db.service.ts index 85d089b8..ae6a3197 100644 --- a/backend/src/collections/apikey-db/apikey-db.service.ts +++ b/backend/src/collections/apikey-db/apikey-db.service.ts @@ -5,7 +5,7 @@ import { FindResult } from 'picsur-shared/dist/types/find-result'; import { generateRandomString } from 'picsur-shared/dist/util/random'; import { Repository } from 'typeorm'; import { EApiKeyBackend } from '../../database/entities/apikey.entity'; -import { EUserBackend } from '../../database/entities/user.entity'; +import { EUserBackend } from '../../database/entities/users/user.entity'; @Injectable() export class ApiKeyDbService { diff --git a/backend/src/collections/image-db/image-db.module.ts b/backend/src/collections/image-db/image-db.module.ts index 48e51f53..c19ed1d4 100644 --- a/backend/src/collections/image-db/image-db.module.ts +++ b/backend/src/collections/image-db/image-db.module.ts @@ -1,8 +1,8 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { EImageDerivativeBackend } from '../../database/entities/image-derivative.entity'; -import { EImageFileBackend } from '../../database/entities/image-file.entity'; -import { EImageBackend } from '../../database/entities/image.entity'; +import { EImageDerivativeBackend } from '../../database/entities/images/image-derivative.entity'; +import { EImageFileBackend } from '../../database/entities/images/image-file.entity'; +import { EImageBackend } from '../../database/entities/images/image.entity'; import { ImageDBService } from './image-db.service'; import { ImageFileDBService } from './image-file-db.service'; diff --git a/backend/src/collections/image-db/image-db.service.ts b/backend/src/collections/image-db/image-db.service.ts index 64c82546..870b07ba 100644 --- a/backend/src/collections/image-db/image-db.service.ts +++ b/backend/src/collections/image-db/image-db.service.ts @@ -4,7 +4,7 @@ import { AsyncFailable, Fail, FT } from 'picsur-shared/dist/types'; import { FindResult } from 'picsur-shared/dist/types/find-result'; import { generateRandomString } from 'picsur-shared/dist/util/random'; import { In, LessThan, Repository } from 'typeorm'; -import { EImageBackend } from '../../database/entities/image.entity'; +import { EImageBackend } from '../../database/entities/images/image.entity'; @Injectable() export class ImageDBService { diff --git a/backend/src/collections/image-db/image-file-db.service.ts b/backend/src/collections/image-db/image-file-db.service.ts index ca7cd9c0..00b46a7e 100644 --- a/backend/src/collections/image-db/image-file-db.service.ts +++ b/backend/src/collections/image-db/image-file-db.service.ts @@ -3,8 +3,8 @@ import { InjectRepository } from '@nestjs/typeorm'; import { ImageEntryVariant } from 'picsur-shared/dist/dto/image-entry-variant.enum'; import { AsyncFailable, Fail, FT } from 'picsur-shared/dist/types'; import { LessThan, Repository } from 'typeorm'; -import { EImageDerivativeBackend } from '../../database/entities/image-derivative.entity'; -import { EImageFileBackend } from '../../database/entities/image-file.entity'; +import { EImageDerivativeBackend } from '../../database/entities/images/image-derivative.entity'; +import { EImageFileBackend } from '../../database/entities/images/image-file.entity'; const A_DAY_IN_SECONDS = 24 * 60 * 60; diff --git a/backend/src/collections/preference-db/preference-db.module.ts b/backend/src/collections/preference-db/preference-db.module.ts index 34ca89b8..8f932ed4 100644 --- a/backend/src/collections/preference-db/preference-db.module.ts +++ b/backend/src/collections/preference-db/preference-db.module.ts @@ -1,8 +1,8 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { EarlyConfigModule } from '../../config/early/early-config.module'; -import { ESysPreferenceBackend } from '../../database/entities/sys-preference.entity'; -import { EUsrPreferenceBackend } from '../../database/entities/usr-preference.entity'; +import { ESysPreferenceBackend } from '../../database/entities/system/sys-preference.entity'; +import { EUsrPreferenceBackend } from '../../database/entities/system/usr-preference.entity'; import { PreferenceCommonService } from './preference-common.service'; import { PreferenceDefaultsService } from './preference-defaults.service'; import { SysPreferenceDbService } from './sys-preference-db.service'; diff --git a/backend/src/collections/preference-db/sys-preference-db.service.ts b/backend/src/collections/preference-db/sys-preference-db.service.ts index d79eaf6d..98ac1672 100644 --- a/backend/src/collections/preference-db/sys-preference-db.service.ts +++ b/backend/src/collections/preference-db/sys-preference-db.service.ts @@ -3,20 +3,17 @@ import { InjectRepository } from '@nestjs/typeorm'; import { DecodedSysPref, PrefValueType, - PrefValueTypeStrings, + PrefValueTypeStrings } from 'picsur-shared/dist/dto/preferences.dto'; import { SysPreference, SysPreferenceList, SysPreferenceValidators, - SysPreferenceValueTypes, + SysPreferenceValueTypes } from 'picsur-shared/dist/dto/sys-preferences.enum'; import { AsyncFailable, Fail, FT, HasFailed } from 'picsur-shared/dist/types'; import { Repository } from 'typeorm'; -import { - ESysPreferenceBackend, - ESysPreferenceSchema, -} from '../../database/entities/sys-preference.entity'; +import { ESysPreferenceBackend, ESysPreferenceSchema } from '../../database/entities/system/sys-preference.entity'; import { MutexFallBack } from '../../util/mutex-fallback'; import { PreferenceCommonService } from './preference-common.service'; import { PreferenceDefaultsService } from './preference-defaults.service'; diff --git a/backend/src/collections/preference-db/usr-preference-db.service.ts b/backend/src/collections/preference-db/usr-preference-db.service.ts index 1fdf8a29..40dcb60c 100644 --- a/backend/src/collections/preference-db/usr-preference-db.service.ts +++ b/backend/src/collections/preference-db/usr-preference-db.service.ts @@ -3,20 +3,20 @@ import { InjectRepository } from '@nestjs/typeorm'; import { DecodedUsrPref, PrefValueType, - PrefValueTypeStrings, + PrefValueTypeStrings } from 'picsur-shared/dist/dto/preferences.dto'; import { UsrPreference, UsrPreferenceList, UsrPreferenceValidators, - UsrPreferenceValueTypes, + UsrPreferenceValueTypes } from 'picsur-shared/dist/dto/usr-preferences.enum'; import { AsyncFailable, Fail, FT, HasFailed } from 'picsur-shared/dist/types'; import { Repository } from 'typeorm'; import { EUsrPreferenceBackend, - EUsrPreferenceSchema, -} from '../../database/entities/usr-preference.entity'; + EUsrPreferenceSchema +} from '../../database/entities/system/usr-preference.entity'; import { MutexFallBack } from '../../util/mutex-fallback'; import { PreferenceCommonService } from './preference-common.service'; import { PreferenceDefaultsService } from './preference-defaults.service'; diff --git a/backend/src/collections/role-db/role-db.module.ts b/backend/src/collections/role-db/role-db.module.ts index d7fa828b..9f919b89 100644 --- a/backend/src/collections/role-db/role-db.module.ts +++ b/backend/src/collections/role-db/role-db.module.ts @@ -3,11 +3,11 @@ import { TypeOrmModule } from '@nestjs/typeorm'; import { HasFailed } from 'picsur-shared/dist/types'; import { EarlyConfigModule } from '../../config/early/early-config.module'; import { HostConfigService } from '../../config/early/host.config.service'; -import { ERoleBackend } from '../../database/entities/role.entity'; +import { ERoleBackend } from '../../database/entities/users/role.entity'; import { ImmutableRolesList, SystemRoleDefaults, - SystemRolesList, + SystemRolesList } from '../../models/constants/roles.const'; import { RoleDbService } from './role-db.service'; diff --git a/backend/src/collections/role-db/role-db.service.ts b/backend/src/collections/role-db/role-db.service.ts index 00b3c965..c827dfc2 100644 --- a/backend/src/collections/role-db/role-db.service.ts +++ b/backend/src/collections/role-db/role-db.service.ts @@ -6,15 +6,15 @@ import { Fail, FT, HasFailed, - HasSuccess, + HasSuccess } from 'picsur-shared/dist/types'; import { makeUnique } from 'picsur-shared/dist/util/unique'; import { In, Repository } from 'typeorm'; -import { ERoleBackend } from '../../database/entities/role.entity'; +import { ERoleBackend } from '../../database/entities/users/role.entity'; import { Permissions } from '../../models/constants/permissions.const'; import { ImmutableRolesList, - UndeletableRolesList, + UndeletableRolesList } from '../../models/constants/roles.const'; @Injectable() diff --git a/backend/src/collections/system-state-db/system-state-db.module.ts b/backend/src/collections/system-state-db/system-state-db.module.ts index 757517b2..b814b5db 100644 --- a/backend/src/collections/system-state-db/system-state-db.module.ts +++ b/backend/src/collections/system-state-db/system-state-db.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { ESystemStateBackend } from '../../database/entities/system-state.entity'; +import { ESystemStateBackend } from '../../database/entities/system/system-state.entity'; import { SystemStateDbService } from './system-state-db.service'; @Module({ diff --git a/backend/src/collections/system-state-db/system-state-db.service.ts b/backend/src/collections/system-state-db/system-state-db.service.ts index 48c106cf..28a4be30 100644 --- a/backend/src/collections/system-state-db/system-state-db.service.ts +++ b/backend/src/collections/system-state-db/system-state-db.service.ts @@ -2,7 +2,7 @@ import { Injectable, Logger } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { AsyncFailable, Fail, FT } from 'picsur-shared/dist/types'; import { Repository } from 'typeorm'; -import { ESystemStateBackend } from '../../database/entities/system-state.entity'; +import { ESystemStateBackend } from '../../database/entities/system/system-state.entity'; @Injectable() export class SystemStateDbService { diff --git a/backend/src/collections/user-db/user-db.module.ts b/backend/src/collections/user-db/user-db.module.ts index b8c71271..e405e114 100644 --- a/backend/src/collections/user-db/user-db.module.ts +++ b/backend/src/collections/user-db/user-db.module.ts @@ -4,7 +4,7 @@ import { HasFailed } from 'picsur-shared/dist/types'; import { generateRandomString } from 'picsur-shared/dist/util/random'; import { AuthConfigService } from '../../config/early/auth.config.service'; import { EarlyConfigModule } from '../../config/early/early-config.module'; -import { EUserBackend } from '../../database/entities/user.entity'; +import { EUserBackend } from '../../database/entities/users/user.entity'; import { PreferenceDbModule } from '../preference-db/preference-db.module'; import { RoleDbModule } from '../role-db/role-db.module'; import { UserDbService } from './user-db.service'; diff --git a/backend/src/collections/user-db/user-db.service.ts b/backend/src/collections/user-db/user-db.service.ts index d034b74e..d24c218f 100644 --- a/backend/src/collections/user-db/user-db.service.ts +++ b/backend/src/collections/user-db/user-db.service.ts @@ -7,21 +7,21 @@ import { Fail, FT, HasFailed, - HasSuccess, + HasSuccess } from 'picsur-shared/dist/types'; import { FindResult } from 'picsur-shared/dist/types/find-result'; import { makeUnique } from 'picsur-shared/dist/util/unique'; import { Repository } from 'typeorm'; -import { EUserBackend } from '../../database/entities/user.entity'; +import { EUserBackend } from '../../database/entities/users/user.entity'; import { Permissions } from '../../models/constants/permissions.const'; import { DefaultRolesList, - SoulBoundRolesList, + SoulBoundRolesList } from '../../models/constants/roles.const'; import { ImmutableUsersList, LockedLoginUsersList, - UndeletableUsersList, + UndeletableUsersList } from '../../models/constants/special-users.const'; import { GetCols } from '../../util/collection'; import { SysPreferenceDbService } from '../preference-db/sys-preference-db.service'; diff --git a/backend/src/database/entities/apikey.entity.ts b/backend/src/database/entities/apikey.entity.ts index 32c1125e..7f86cd70 100644 --- a/backend/src/database/entities/apikey.entity.ts +++ b/backend/src/database/entities/apikey.entity.ts @@ -4,10 +4,10 @@ import { Entity, Index, ManyToOne, - PrimaryGeneratedColumn, + PrimaryGeneratedColumn } from 'typeorm'; import { z } from 'zod'; -import { EUserBackend } from './user.entity'; +import { EUserBackend } from './users/user.entity'; const OverriddenEApiKeySchema = EApiKeySchema.omit({ user: true }).merge( z.object({ diff --git a/backend/src/database/entities/image-derivative.entity.ts b/backend/src/database/entities/images/image-derivative.entity.ts similarity index 98% rename from backend/src/database/entities/image-derivative.entity.ts rename to backend/src/database/entities/images/image-derivative.entity.ts index 51ca6d34..3d1cc39c 100644 --- a/backend/src/database/entities/image-derivative.entity.ts +++ b/backend/src/database/entities/images/image-derivative.entity.ts @@ -5,7 +5,7 @@ import { JoinColumn, ManyToOne, PrimaryGeneratedColumn, - Unique, + Unique } from 'typeorm'; import { EImageBackend } from './image.entity'; diff --git a/backend/src/database/entities/image-file.entity.ts b/backend/src/database/entities/images/image-file.entity.ts similarity index 100% rename from backend/src/database/entities/image-file.entity.ts rename to backend/src/database/entities/images/image-file.entity.ts diff --git a/backend/src/database/entities/image.entity.ts b/backend/src/database/entities/images/image.entity.ts similarity index 100% rename from backend/src/database/entities/image.entity.ts rename to backend/src/database/entities/images/image.entity.ts diff --git a/backend/src/database/entities/index.ts b/backend/src/database/entities/index.ts index 2202c7d6..9515ac2f 100644 --- a/backend/src/database/entities/index.ts +++ b/backend/src/database/entities/index.ts @@ -1,12 +1,12 @@ import { EApiKeyBackend } from './apikey.entity'; -import { EImageDerivativeBackend } from './image-derivative.entity'; -import { EImageFileBackend } from './image-file.entity'; -import { EImageBackend } from './image.entity'; -import { ERoleBackend } from './role.entity'; -import { ESysPreferenceBackend } from './sys-preference.entity'; -import { ESystemStateBackend } from './system-state.entity'; -import { EUserBackend } from './user.entity'; -import { EUsrPreferenceBackend } from './usr-preference.entity'; +import { EImageDerivativeBackend } from './images/image-derivative.entity'; +import { EImageFileBackend } from './images/image-file.entity'; +import { EImageBackend } from './images/image.entity'; +import { ESysPreferenceBackend } from './system/sys-preference.entity'; +import { ESystemStateBackend } from './system/system-state.entity'; +import { EUsrPreferenceBackend } from './system/usr-preference.entity'; +import { ERoleBackend } from './users/role.entity'; +import { EUserBackend } from './users/user.entity'; export const EntityList = [ EImageBackend, diff --git a/backend/src/database/entities/sys-preference.entity.ts b/backend/src/database/entities/system/sys-preference.entity.ts similarity index 100% rename from backend/src/database/entities/sys-preference.entity.ts rename to backend/src/database/entities/system/sys-preference.entity.ts diff --git a/backend/src/database/entities/system-state.entity.ts b/backend/src/database/entities/system/system-state.entity.ts similarity index 100% rename from backend/src/database/entities/system-state.entity.ts rename to backend/src/database/entities/system/system-state.entity.ts diff --git a/backend/src/database/entities/usr-preference.entity.ts b/backend/src/database/entities/system/usr-preference.entity.ts similarity index 93% rename from backend/src/database/entities/usr-preference.entity.ts rename to backend/src/database/entities/system/usr-preference.entity.ts index 55cf17a9..6f123a12 100644 --- a/backend/src/database/entities/usr-preference.entity.ts +++ b/backend/src/database/entities/system/usr-preference.entity.ts @@ -6,10 +6,10 @@ import { JoinColumn, ManyToOne, PrimaryGeneratedColumn, - Unique, + Unique } from 'typeorm'; import z from 'zod'; -import { EUserBackend } from './user.entity'; +import { EUserBackend } from '../users/user.entity'; export const EUsrPreferenceSchema = z.object({ id: IsEntityID().optional(), diff --git a/backend/src/database/entities/role.entity.ts b/backend/src/database/entities/users/role.entity.ts similarity index 83% rename from backend/src/database/entities/role.entity.ts rename to backend/src/database/entities/users/role.entity.ts index 9f7cc0da..14061834 100644 --- a/backend/src/database/entities/role.entity.ts +++ b/backend/src/database/entities/users/role.entity.ts @@ -1,6 +1,6 @@ import { ERole } from 'picsur-shared/dist/entities/role.entity'; import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm'; -import type { Permissions } from '../../models/constants/permissions.const'; +import type { Permissions } from '../../../models/constants/permissions.const'; @Entity() export class ERoleBackend implements ERole { diff --git a/backend/src/database/entities/user.entity.ts b/backend/src/database/entities/users/user.entity.ts similarity index 87% rename from backend/src/database/entities/user.entity.ts rename to backend/src/database/entities/users/user.entity.ts index 41407157..e039b538 100644 --- a/backend/src/database/entities/user.entity.ts +++ b/backend/src/database/entities/users/user.entity.ts @@ -4,11 +4,11 @@ import { Entity, Index, OneToMany, - PrimaryGeneratedColumn, + PrimaryGeneratedColumn } from 'typeorm'; import { z } from 'zod'; -import { EApiKeyBackend } from './apikey.entity'; -import { EUsrPreferenceBackend } from './usr-preference.entity'; +import { EApiKeyBackend } from '../apikey.entity'; +import { EUsrPreferenceBackend } from '../system/usr-preference.entity'; // Different data for public and private const OverriddenEUserSchema = EUserSchema.omit({ hashedPassword: true }).merge( diff --git a/backend/src/managers/auth/guest.service.ts b/backend/src/managers/auth/guest.service.ts index 7e677f1d..d81abcec 100644 --- a/backend/src/managers/auth/guest.service.ts +++ b/backend/src/managers/auth/guest.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { HasFailed } from 'picsur-shared/dist/types'; import { UserDbService } from '../../collections/user-db/user-db.service'; -import { EUserBackend } from '../../database/entities/user.entity'; +import { EUserBackend } from '../../database/entities/users/user.entity'; @Injectable() export class GuestService { diff --git a/backend/src/managers/image/image.service.ts b/backend/src/managers/image/image.service.ts index a26b69d1..734c53bb 100644 --- a/backend/src/managers/image/image.service.ts +++ b/backend/src/managers/image/image.service.ts @@ -5,10 +5,8 @@ import { ImageRequestParams } from 'picsur-shared/dist/dto/api/image.dto'; import { ImageEntryVariant } from 'picsur-shared/dist/dto/image-entry-variant.enum'; import { AnimFileType, - FileType, - FileType2Mime, - ImageFileType, - Mime2FileType, + FileType, ImageFileType, + Mime2FileType } from 'picsur-shared/dist/dto/mimes.dto'; import { SysPreference } from 'picsur-shared/dist/dto/sys-preferences.enum'; import { UsrPreference } from 'picsur-shared/dist/dto/usr-preferences.enum'; @@ -20,9 +18,9 @@ import { ImageDBService } from '../../collections/image-db/image-db.service'; import { ImageFileDBService } from '../../collections/image-db/image-file-db.service'; import { SysPreferenceDbService } from '../../collections/preference-db/sys-preference-db.service'; import { UsrPreferenceDbService } from '../../collections/preference-db/usr-preference-db.service'; -import { EImageDerivativeBackend } from '../../database/entities/image-derivative.entity'; -import { EImageFileBackend } from '../../database/entities/image-file.entity'; -import { EImageBackend } from '../../database/entities/image.entity'; +import { EImageDerivativeBackend } from '../../database/entities/images/image-derivative.entity'; +import { EImageFileBackend } from '../../database/entities/images/image-file.entity'; +import { EImageBackend } from '../../database/entities/images/image.entity'; import { MutexFallBack } from '../../util/mutex-fallback'; import { ImageConverterService } from './image-converter.service'; import { ImageProcessorService } from './image-processor.service'; diff --git a/backend/src/models/transformers/user.transformer.ts b/backend/src/models/transformers/user.transformer.ts index e16cb55f..a9c10c1c 100644 --- a/backend/src/models/transformers/user.transformer.ts +++ b/backend/src/models/transformers/user.transformer.ts @@ -1,5 +1,5 @@ import { EUser } from 'picsur-shared/dist/entities/user.entity'; -import { EUserBackend } from '../../database/entities/user.entity'; +import { EUserBackend } from '../../database/entities/users/user.entity'; export function EUserBackend2EUser(eUser: EUserBackend): EUser { if (eUser.hashed_password === undefined) return eUser as EUser; diff --git a/frontend/src/app/routes/images/images.component.ts b/frontend/src/app/routes/images/images.component.ts index 22338f25..a11e29b3 100644 --- a/frontend/src/app/routes/images/images.component.ts +++ b/frontend/src/app/routes/images/images.component.ts @@ -11,7 +11,7 @@ import { merge, Observable, switchMap, - timer, + timer } from 'rxjs'; import { ImageService } from 'src/app/services/api/image.service'; import { UserService } from 'src/app/services/api/user.service'; diff --git a/frontend/src/app/routes/view/view-speeddial/view-speeddial.component.ts b/frontend/src/app/routes/view/view-speeddial/view-speeddial.component.ts index 54b1632a..0cc646dd 100644 --- a/frontend/src/app/routes/view/view-speeddial/view-speeddial.component.ts +++ b/frontend/src/app/routes/view/view-speeddial/view-speeddial.component.ts @@ -17,11 +17,11 @@ import { ErrorService } from 'src/app/util/error-manager/error.service'; import { UtilService } from 'src/app/util/util.service'; import { CustomizeDialogComponent, - CustomizeDialogData, + CustomizeDialogData } from '../customize-dialog/customize-dialog.component'; import { EditDialogComponent, - EditDialogData, + EditDialogData } from '../edit-dialog/edit-dialog.component'; @Component({ diff --git a/frontend/src/app/routes/view/view.component.ts b/frontend/src/app/routes/view/view.component.ts index b7a4be60..02502b73 100644 --- a/frontend/src/app/routes/view/view.component.ts +++ b/frontend/src/app/routes/view/view.component.ts @@ -3,7 +3,7 @@ import { ChangeDetectorRef, Component, OnDestroy, - OnInit, + OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { ImageMetaResponse } from 'picsur-shared/dist/dto/api/image.dto'; @@ -11,7 +11,7 @@ import { ImageLinks } from 'picsur-shared/dist/dto/image-links.class'; import { AnimFileType, ImageFileType, - SupportedFileTypeCategory, + SupportedFileTypeCategory } from 'picsur-shared/dist/dto/mimes.dto'; import { EImage } from 'picsur-shared/dist/entities/image.entity'; import { EUser } from 'picsur-shared/dist/entities/user.entity'; diff --git a/frontend/src/app/services/api/image.service.ts b/frontend/src/app/services/api/image.service.ts index 0f6e4560..7997727b 100644 --- a/frontend/src/app/services/api/image.service.ts +++ b/frontend/src/app/services/api/image.service.ts @@ -6,11 +6,11 @@ import { ImageListResponse, ImageUpdateRequest, ImageUpdateResponse, - ImageUploadResponse, + ImageUploadResponse } from 'picsur-shared/dist/dto/api/image-manage.dto'; import { ImageMetaResponse, - ImageRequestParams, + ImageRequestParams } from 'picsur-shared/dist/dto/api/image.dto'; import { ImageLinks } from 'picsur-shared/dist/dto/image-links.class'; import { FileType2Ext } from 'picsur-shared/dist/dto/mimes.dto'; @@ -21,7 +21,7 @@ import { FT, HasFailed, HasSuccess, - Open, + Open } from 'picsur-shared/dist/types/failable'; import { ImageUploadRequest } from '../../models/dto/image-upload-request.dto'; import { ApiService } from './api.service';