mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
Move session entity to sessions folder
Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
eeef0ea025
commit
f362d27d3f
23 changed files with 26 additions and 26 deletions
|
@ -26,7 +26,7 @@ import { RegisterDto } from '../../../identity/local/register.dto';
|
||||||
import { UpdatePasswordDto } from '../../../identity/local/update-password.dto';
|
import { UpdatePasswordDto } from '../../../identity/local/update-password.dto';
|
||||||
import { SessionGuard } from '../../../identity/session.guard';
|
import { SessionGuard } from '../../../identity/session.guard';
|
||||||
import { ConsoleLoggerService } from '../../../logger/console-logger.service';
|
import { ConsoleLoggerService } from '../../../logger/console-logger.service';
|
||||||
import { SessionState } from '../../../session/session.service';
|
import { SessionState } from '../../../sessions/session.service';
|
||||||
import { User } from '../../../users/user.entity';
|
import { User } from '../../../users/user.entity';
|
||||||
import { UsersService } from '../../../users/users.service';
|
import { UsersService } from '../../../users/users.service';
|
||||||
import { makeUsernameLowercase } from '../../../utils/username';
|
import { makeUsernameLowercase } from '../../../utils/username';
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
import { Note } from '../../notes/note.entity';
|
import { Note } from '../../notes/note.entity';
|
||||||
import { SessionState } from '../../session/session.service';
|
import { SessionState } from '../../sessions/session.service';
|
||||||
import { User } from '../../users/user.entity';
|
import { User } from '../../users/user.entity';
|
||||||
|
|
||||||
export type CompleteRequest = Request & {
|
export type CompleteRequest = Request & {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { MediaConfig } from './config/media.config';
|
||||||
import { ErrorExceptionMapping } from './errors/error-mapping';
|
import { ErrorExceptionMapping } from './errors/error-mapping';
|
||||||
import { ConsoleLoggerService } from './logger/console-logger.service';
|
import { ConsoleLoggerService } from './logger/console-logger.service';
|
||||||
import { BackendType } from './media/backends/backend-type.enum';
|
import { BackendType } from './media/backends/backend-type.enum';
|
||||||
import { SessionService } from './session/session.service';
|
import { SessionService } from './sessions/session.service';
|
||||||
import { setupSpecialGroups } from './utils/createSpecialGroups';
|
import { setupSpecialGroups } from './utils/createSpecialGroups';
|
||||||
import { setupSessionMiddleware } from './utils/session';
|
import { setupSessionMiddleware } from './utils/session';
|
||||||
import { setupValidationPipe } from './utils/setup-pipes';
|
import { setupValidationPipe } from './utils/setup-pipes';
|
||||||
|
|
|
@ -37,7 +37,7 @@ import { NotesModule } from './notes/notes.module';
|
||||||
import { PermissionsModule } from './permissions/permissions.module';
|
import { PermissionsModule } from './permissions/permissions.module';
|
||||||
import { WebsocketModule } from './realtime/websocket/websocket.module';
|
import { WebsocketModule } from './realtime/websocket/websocket.module';
|
||||||
import { RevisionsModule } from './revisions/revisions.module';
|
import { RevisionsModule } from './revisions/revisions.module';
|
||||||
import { SessionModule } from './session/session.module';
|
import { SessionModule } from './sessions/session.module';
|
||||||
import { UsersModule } from './users/users.module';
|
import { UsersModule } from './users/users.module';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
} from '../errors/errors';
|
} from '../errors/errors';
|
||||||
import { Identity } from '../identity/identity.entity';
|
import { Identity } from '../identity/identity.entity';
|
||||||
import { LoggerModule } from '../logger/logger.module';
|
import { LoggerModule } from '../logger/logger.module';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { AuthToken } from './auth-token.entity';
|
import { AuthToken } from './auth-token.entity';
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
|
|
||||||
import { Edit } from '../revisions/edit.entity';
|
import { Edit } from '../revisions/edit.entity';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
|
|
||||||
export type AuthorColor = number;
|
export type AuthorColor = number;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import { Edit } from '../revisions/edit.entity';
|
||||||
import { Revision } from '../revisions/revision.entity';
|
import { Revision } from '../revisions/revision.entity';
|
||||||
import { RevisionsModule } from '../revisions/revisions.module';
|
import { RevisionsModule } from '../revisions/revisions.module';
|
||||||
import { RevisionsService } from '../revisions/revisions.service';
|
import { RevisionsService } from '../revisions/revisions.service';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { mockSelectQueryBuilderInRepo } from '../utils/test-utils/mockSelectQueryBuilder';
|
import { mockSelectQueryBuilderInRepo } from '../utils/test-utils/mockSelectQueryBuilder';
|
||||||
|
|
|
@ -30,7 +30,7 @@ import { NoteGroupPermission } from '../permissions/note-group-permission.entity
|
||||||
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
||||||
import { Edit } from '../revisions/edit.entity';
|
import { Edit } from '../revisions/edit.entity';
|
||||||
import { Revision } from '../revisions/revision.entity';
|
import { Revision } from '../revisions/revision.entity';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { BackendType } from './backends/backend-type.enum';
|
import { BackendType } from './backends/backend-type.enum';
|
||||||
|
|
|
@ -33,7 +33,7 @@ import { RealtimeNoteModule } from '../realtime/realtime-note/realtime-note.modu
|
||||||
import { Edit } from '../revisions/edit.entity';
|
import { Edit } from '../revisions/edit.entity';
|
||||||
import { Revision } from '../revisions/revision.entity';
|
import { Revision } from '../revisions/revision.entity';
|
||||||
import { RevisionsModule } from '../revisions/revisions.module';
|
import { RevisionsModule } from '../revisions/revisions.module';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { mockSelectQueryBuilderInRepo } from '../utils/test-utils/mockSelectQueryBuilder';
|
import { mockSelectQueryBuilderInRepo } from '../utils/test-utils/mockSelectQueryBuilder';
|
||||||
|
|
|
@ -45,7 +45,7 @@ import { Edit } from '../revisions/edit.entity';
|
||||||
import { Revision } from '../revisions/revision.entity';
|
import { Revision } from '../revisions/revision.entity';
|
||||||
import { RevisionsModule } from '../revisions/revisions.module';
|
import { RevisionsModule } from '../revisions/revisions.module';
|
||||||
import { RevisionsService } from '../revisions/revisions.service';
|
import { RevisionsService } from '../revisions/revisions.service';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { mockSelectQueryBuilderInRepo } from '../utils/test-utils/mockSelectQueryBuilder';
|
import { mockSelectQueryBuilderInRepo } from '../utils/test-utils/mockSelectQueryBuilder';
|
||||||
|
|
|
@ -40,7 +40,7 @@ import { NotesModule } from '../notes/notes.module';
|
||||||
import { Tag } from '../notes/tag.entity';
|
import { Tag } from '../notes/tag.entity';
|
||||||
import { Edit } from '../revisions/edit.entity';
|
import { Edit } from '../revisions/edit.entity';
|
||||||
import { Revision } from '../revisions/revision.entity';
|
import { Revision } from '../revisions/revision.entity';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { UsersModule } from '../users/users.module';
|
import { UsersModule } from '../users/users.module';
|
||||||
import { NoteGroupPermission } from './note-group-permission.entity';
|
import { NoteGroupPermission } from './note-group-permission.entity';
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { ScheduleModule } from '@nestjs/schedule';
|
||||||
import { LoggerModule } from '../../logger/logger.module';
|
import { LoggerModule } from '../../logger/logger.module';
|
||||||
import { PermissionsModule } from '../../permissions/permissions.module';
|
import { PermissionsModule } from '../../permissions/permissions.module';
|
||||||
import { RevisionsModule } from '../../revisions/revisions.module';
|
import { RevisionsModule } from '../../revisions/revisions.module';
|
||||||
import { SessionModule } from '../../session/session.module';
|
import { SessionModule } from '../../sessions/session.module';
|
||||||
import { UsersModule } from '../../users/users.module';
|
import { UsersModule } from '../../users/users.module';
|
||||||
import { RealtimeNoteStore } from './realtime-note-store';
|
import { RealtimeNoteStore } from './realtime-note-store';
|
||||||
import { RealtimeNoteService } from './realtime-note.service';
|
import { RealtimeNoteService } from './realtime-note.service';
|
||||||
|
|
|
@ -35,9 +35,9 @@ import { PermissionsModule } from '../../permissions/permissions.module';
|
||||||
import { PermissionsService } from '../../permissions/permissions.service';
|
import { PermissionsService } from '../../permissions/permissions.service';
|
||||||
import { Edit } from '../../revisions/edit.entity';
|
import { Edit } from '../../revisions/edit.entity';
|
||||||
import { Revision } from '../../revisions/revision.entity';
|
import { Revision } from '../../revisions/revision.entity';
|
||||||
import { SessionModule } from '../../session/session.module';
|
import { Session } from '../../sessions/session.entity';
|
||||||
import { SessionService } from '../../session/session.service';
|
import { SessionModule } from '../../sessions/session.module';
|
||||||
import { Session } from '../../users/session.entity';
|
import { SessionService } from '../../sessions/session.service';
|
||||||
import { User } from '../../users/user.entity';
|
import { User } from '../../users/user.entity';
|
||||||
import { UsersModule } from '../../users/users.module';
|
import { UsersModule } from '../../users/users.module';
|
||||||
import { UsersService } from '../../users/users.service';
|
import { UsersService } from '../../users/users.service';
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { ConsoleLoggerService } from '../../logger/console-logger.service';
|
||||||
import { NotesService } from '../../notes/notes.service';
|
import { NotesService } from '../../notes/notes.service';
|
||||||
import { NotePermission } from '../../permissions/note-permission.enum';
|
import { NotePermission } from '../../permissions/note-permission.enum';
|
||||||
import { PermissionsService } from '../../permissions/permissions.service';
|
import { PermissionsService } from '../../permissions/permissions.service';
|
||||||
import { SessionService } from '../../session/session.service';
|
import { SessionService } from '../../sessions/session.service';
|
||||||
import { User } from '../../users/user.entity';
|
import { User } from '../../users/user.entity';
|
||||||
import { UsersService } from '../../users/users.service';
|
import { UsersService } from '../../users/users.service';
|
||||||
import { RealtimeConnection } from '../realtime-note/realtime-connection';
|
import { RealtimeConnection } from '../realtime-note/realtime-connection';
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Module } from '@nestjs/common';
|
||||||
import { LoggerModule } from '../../logger/logger.module';
|
import { LoggerModule } from '../../logger/logger.module';
|
||||||
import { NotesModule } from '../../notes/notes.module';
|
import { NotesModule } from '../../notes/notes.module';
|
||||||
import { PermissionsModule } from '../../permissions/permissions.module';
|
import { PermissionsModule } from '../../permissions/permissions.module';
|
||||||
import { SessionModule } from '../../session/session.module';
|
import { SessionModule } from '../../sessions/session.module';
|
||||||
import { UsersModule } from '../../users/users.module';
|
import { UsersModule } from '../../users/users.module';
|
||||||
import { RealtimeNoteModule } from '../realtime-note/realtime-note.module';
|
import { RealtimeNoteModule } from '../realtime-note/realtime-note.module';
|
||||||
import { WebsocketGateway } from './websocket.gateway';
|
import { WebsocketGateway } from './websocket.gateway';
|
||||||
|
|
|
@ -27,7 +27,7 @@ import { NotesModule } from '../notes/notes.module';
|
||||||
import { Tag } from '../notes/tag.entity';
|
import { Tag } from '../notes/tag.entity';
|
||||||
import { NoteGroupPermission } from '../permissions/note-group-permission.entity';
|
import { NoteGroupPermission } from '../permissions/note-group-permission.entity';
|
||||||
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
import { NoteUserPermission } from '../permissions/note-user-permission.entity';
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from '../users/user.entity';
|
import { User } from '../users/user.entity';
|
||||||
import { Edit } from './edit.entity';
|
import { Edit } from './edit.entity';
|
||||||
import { EditService } from './edit.service';
|
import { EditService } from './edit.service';
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { NoteGroupPermission } from './permissions/note-group-permission.entity'
|
||||||
import { NoteUserPermission } from './permissions/note-user-permission.entity';
|
import { NoteUserPermission } from './permissions/note-user-permission.entity';
|
||||||
import { Edit } from './revisions/edit.entity';
|
import { Edit } from './revisions/edit.entity';
|
||||||
import { Revision } from './revisions/revision.entity';
|
import { Revision } from './revisions/revision.entity';
|
||||||
import { Session } from './users/session.entity';
|
import { Session } from './sessions/session.entity';
|
||||||
import { User } from './users/user.entity';
|
import { User } from './users/user.entity';
|
||||||
import { hashPassword } from './utils/password';
|
import { hashPassword } from './utils/password';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
|
||||||
import { Session } from '../users/session.entity';
|
import { Session } from './session.entity';
|
||||||
import { SessionService } from './session.service';
|
import { SessionService } from './session.service';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
|
@ -14,8 +14,8 @@ import { Repository } from 'typeorm';
|
||||||
import { AuthConfig } from '../config/auth.config';
|
import { AuthConfig } from '../config/auth.config';
|
||||||
import { DatabaseType } from '../config/database-type.enum';
|
import { DatabaseType } from '../config/database-type.enum';
|
||||||
import { DatabaseConfig } from '../config/database.config';
|
import { DatabaseConfig } from '../config/database.config';
|
||||||
import { Session } from '../users/session.entity';
|
|
||||||
import { HEDGEDOC_SESSION } from '../utils/session';
|
import { HEDGEDOC_SESSION } from '../utils/session';
|
||||||
|
import { Session } from './session.entity';
|
||||||
import { SessionService, SessionState } from './session.service';
|
import { SessionService, SessionState } from './session.service';
|
||||||
|
|
||||||
jest.mock('cookie');
|
jest.mock('cookie');
|
|
@ -17,9 +17,9 @@ import { DatabaseType } from '../config/database-type.enum';
|
||||||
import databaseConfiguration, {
|
import databaseConfiguration, {
|
||||||
DatabaseConfig,
|
DatabaseConfig,
|
||||||
} from '../config/database.config';
|
} from '../config/database.config';
|
||||||
import { Session } from '../users/session.entity';
|
|
||||||
import { HEDGEDOC_SESSION } from '../utils/session';
|
import { HEDGEDOC_SESSION } from '../utils/session';
|
||||||
import { Username } from '../utils/username';
|
import { Username } from '../utils/username';
|
||||||
|
import { Session } from './session.entity';
|
||||||
|
|
||||||
export interface SessionState {
|
export interface SessionState {
|
||||||
cookie: unknown;
|
cookie: unknown;
|
|
@ -8,12 +8,12 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
|
||||||
import { Identity } from '../identity/identity.entity';
|
import { Identity } from '../identity/identity.entity';
|
||||||
import { LoggerModule } from '../logger/logger.module';
|
import { LoggerModule } from '../logger/logger.module';
|
||||||
import { Session } from './session.entity';
|
import { Session } from '../sessions/session.entity';
|
||||||
import { User } from './user.entity';
|
import { User } from './user.entity';
|
||||||
import { UsersService } from './users.service';
|
import { UsersService } from './users.service';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [TypeOrmModule.forFeature([User, Identity, Session]), LoggerModule],
|
imports: [TypeOrmModule.forFeature([User, Identity]), LoggerModule, Session],
|
||||||
providers: [UsersService],
|
providers: [UsersService],
|
||||||
exports: [UsersService],
|
exports: [UsersService],
|
||||||
})
|
})
|
||||||
|
|
|
@ -77,8 +77,8 @@ import { PermissionsModule } from '../src/permissions/permissions.module';
|
||||||
import { PermissionsService } from '../src/permissions/permissions.service';
|
import { PermissionsService } from '../src/permissions/permissions.service';
|
||||||
import { RevisionsModule } from '../src/revisions/revisions.module';
|
import { RevisionsModule } from '../src/revisions/revisions.module';
|
||||||
import { RevisionsService } from '../src/revisions/revisions.service';
|
import { RevisionsService } from '../src/revisions/revisions.service';
|
||||||
import { SessionModule } from '../src/session/session.module';
|
import { SessionModule } from '../src/sessions/session.module';
|
||||||
import { SessionService } from '../src/session/session.service';
|
import { SessionService } from '../src/sessions/session.service';
|
||||||
import { User } from '../src/users/user.entity';
|
import { User } from '../src/users/user.entity';
|
||||||
import { UsersModule } from '../src/users/users.module';
|
import { UsersModule } from '../src/users/users.module';
|
||||||
import { UsersService } from '../src/users/users.service';
|
import { UsersService } from '../src/users/users.service';
|
||||||
|
|
Loading…
Reference in a new issue