diff --git a/src/shared/requests/v1/CreateUserRequest.ts b/src/shared/requests/v1/CreateUserRequest.ts new file mode 100644 index 0000000..12c9f7c --- /dev/null +++ b/src/shared/requests/v1/CreateUserRequest.ts @@ -0,0 +1,5 @@ +export interface CreateUserRequest { + email: string; + username: string; + password: string; +} diff --git a/src/shared/requests/v1/LoginRequest.ts b/src/shared/requests/v1/LoginRequest.ts new file mode 100644 index 0000000..eb97118 --- /dev/null +++ b/src/shared/requests/v1/LoginRequest.ts @@ -0,0 +1,4 @@ +export interface LoginRequest { + username: string; + password: string; +} diff --git a/src/shared/requests/v1/ScheduleRequest.ts b/src/shared/requests/v1/ScheduleRequest.ts new file mode 100644 index 0000000..741f70e --- /dev/null +++ b/src/shared/requests/v1/ScheduleRequest.ts @@ -0,0 +1,7 @@ +export interface ScheduleRequest { + groups?: Array; + isEven?: boolean; + disciplines?: Array; + professors?: Array; + lectureHalls?: Array; +} diff --git a/src/shared/requests/v1/cacheRequest.ts b/src/shared/requests/v1/cacheRequest.ts deleted file mode 100644 index 2e8f912..0000000 --- a/src/shared/requests/v1/cacheRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * MIREA Schedule Web API - * This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team. - * - * OpenAPI spec version: 1.0 - * Contact: support@winsomnia.net - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * Represents a request to configure cache settings. - */ -export interface CacheRequest { - /** - * Gets or sets the server address. - */ - server: string; - /** - * Gets or sets the port number. - */ - port: number; - /** - * Gets or sets the password. - */ - password?: string; -} \ No newline at end of file diff --git a/src/shared/requests/v1/configuration/cacheRequest.ts b/src/shared/requests/v1/configuration/cacheRequest.ts new file mode 100644 index 0000000..2ae0a24 --- /dev/null +++ b/src/shared/requests/v1/configuration/cacheRequest.ts @@ -0,0 +1,5 @@ +export interface CacheRequest { + server: string; + port: number; + password?: string; +} diff --git a/src/shared/requests/v1/configuration/databaseRequest.ts b/src/shared/requests/v1/configuration/databaseRequest.ts new file mode 100644 index 0000000..1fe1ec1 --- /dev/null +++ b/src/shared/requests/v1/configuration/databaseRequest.ts @@ -0,0 +1,8 @@ +export interface DatabaseRequest { + server: string; + port: number; + database: string; + user: string; + ssl: boolean; + password?: string; +} diff --git a/src/shared/requests/v1/configuration/emailRequest.ts b/src/shared/requests/v1/configuration/emailRequest.ts new file mode 100644 index 0000000..7846d90 --- /dev/null +++ b/src/shared/requests/v1/configuration/emailRequest.ts @@ -0,0 +1,8 @@ +export interface EmailRequest { + server: string; + from: string; + password: string; + port: number; + ssl: boolean; + user: string; +} diff --git a/src/shared/requests/v1/configuration/loggingRequest.ts b/src/shared/requests/v1/configuration/loggingRequest.ts new file mode 100644 index 0000000..e075ee8 --- /dev/null +++ b/src/shared/requests/v1/configuration/loggingRequest.ts @@ -0,0 +1,5 @@ +export interface LoggingRequest { + enableLogToFile: boolean; + logFileName?: string; + logFilePath?: string; +} diff --git a/src/shared/requests/v1/configuration/scheduleConfigurationRequest.ts b/src/shared/requests/v1/configuration/scheduleConfigurationRequest.ts new file mode 100644 index 0000000..0682da4 --- /dev/null +++ b/src/shared/requests/v1/configuration/scheduleConfigurationRequest.ts @@ -0,0 +1,4 @@ +export interface ScheduleConfigurationRequest { + cronUpdateSchedule?: string; + startTerm: string; +} diff --git a/src/shared/requests/v1/databaseRequest.ts b/src/shared/requests/v1/databaseRequest.ts deleted file mode 100644 index 11bab60..0000000 --- a/src/shared/requests/v1/databaseRequest.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * MIREA Schedule Web API - * This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team. - * - * OpenAPI spec version: 1.0 - * Contact: support@winsomnia.net - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * Represents a request to configure the database connection settings. - */ -export interface DatabaseRequest { - /** - * Gets or sets the server address. - */ - server: string; - /** - * Gets or sets the port number. - */ - port: number; - /** - * Gets or sets the database name. - */ - database: string; - /** - * Gets or sets the username. - */ - user: string; - /** - * Gets or sets a value indicating whether SSL is enabled. - */ - ssl: boolean; - /** - * Gets or sets the password. - */ - password?: string; -} \ No newline at end of file diff --git a/src/shared/requests/v1/loggingRequest.ts b/src/shared/requests/v1/loggingRequest.ts deleted file mode 100644 index 3f2d1cb..0000000 --- a/src/shared/requests/v1/loggingRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * MIREA Schedule Web API - * This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team. - * - * OpenAPI spec version: 1.0 - * Contact: support@winsomnia.net - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * Represents a request to configure logging settings. - */ -export interface LoggingRequest { - /** - * Gets or sets a value indicating whether logging to file is enabled. - */ - enableLogToFile: boolean; - /** - * Gets or sets the log file name. - */ - logFileName?: string; - /** - * Gets or sets the log file path. - */ - logFilePath?: string; -} \ No newline at end of file diff --git a/src/shared/requests/v1/scheduleConfigurationRequest.ts b/src/shared/requests/v1/scheduleConfigurationRequest.ts deleted file mode 100644 index 5a3af80..0000000 --- a/src/shared/requests/v1/scheduleConfigurationRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * MIREA Schedule Web API - * This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team. - * - * OpenAPI spec version: 1.0 - * Contact: support@winsomnia.net - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -/** - * Represents a request to configure the schedule settings. - */ -export interface ScheduleConfigurationRequest { - /** - * Gets or sets the cron expression for updating the schedule. - */ - cronUpdateSchedule?: string; - /** - * Gets or sets the start date of the term. - */ - startTerm: string; -} diff --git a/src/shared/requests/v1/twoFactorAuthRequest.ts b/src/shared/requests/v1/twoFactorAuthRequest.ts new file mode 100644 index 0000000..2b9a150 --- /dev/null +++ b/src/shared/requests/v1/twoFactorAuthRequest.ts @@ -0,0 +1,6 @@ +import {TwoFactorAuthentication} from "@model/twoFactorAuthentication"; + +export interface TwoFactorAuthRequest { + code: string; + method: TwoFactorAuthentication; +} diff --git a/src/shared/responses/v1/CampusBasicInfoResponse.ts b/src/shared/responses/v1/CampusBasicInfoResponse.ts new file mode 100644 index 0000000..f7734c3 --- /dev/null +++ b/src/shared/responses/v1/CampusBasicInfoResponse.ts @@ -0,0 +1,5 @@ +export interface CampusBasicInfoResponse { + id: number; + codeName: string; + fullName?: string; +} diff --git a/src/shared/responses/v1/CampusDetailsResponse.ts b/src/shared/responses/v1/CampusDetailsResponse.ts new file mode 100644 index 0000000..cd9af12 --- /dev/null +++ b/src/shared/responses/v1/CampusDetailsResponse.ts @@ -0,0 +1,6 @@ +export interface CampusDetailsResponse { + id: number; + codeName: string; + fullName?: string; + address?: string; +} diff --git a/src/shared/responses/v1/DisciplineResponse.ts b/src/shared/responses/v1/DisciplineResponse.ts new file mode 100644 index 0000000..e84be6b --- /dev/null +++ b/src/shared/responses/v1/DisciplineResponse.ts @@ -0,0 +1,4 @@ +export interface DisciplineResponse { + id: number; + name: string; +} diff --git a/src/shared/responses/v1/ErrorResponse.ts b/src/shared/responses/v1/ErrorResponse.ts new file mode 100644 index 0000000..64f24ff --- /dev/null +++ b/src/shared/responses/v1/ErrorResponse.ts @@ -0,0 +1,4 @@ +export interface ErrorResponse { + error: string; + code: number; +} diff --git a/src/shared/responses/v1/FacultyResponse.ts b/src/shared/responses/v1/FacultyResponse.ts new file mode 100644 index 0000000..33970ef --- /dev/null +++ b/src/shared/responses/v1/FacultyResponse.ts @@ -0,0 +1,4 @@ +export interface FacultyResponse { + id: number; + name: string; +} diff --git a/src/shared/responses/v1/GroupDetailsResponse.ts b/src/shared/responses/v1/GroupDetailsResponse.ts new file mode 100644 index 0000000..c65397a --- /dev/null +++ b/src/shared/responses/v1/GroupDetailsResponse.ts @@ -0,0 +1,7 @@ +export interface GroupDetailsResponse { + id: number; + name: string; + courseNumber: number; + facultyId?: number; + facultyName?: string; +} diff --git a/src/shared/responses/v1/GroupResponse.ts b/src/shared/responses/v1/GroupResponse.ts new file mode 100644 index 0000000..1f87bc9 --- /dev/null +++ b/src/shared/responses/v1/GroupResponse.ts @@ -0,0 +1,6 @@ +export interface GroupResponse { + id: number; + name: string; + courseNumber: number; + facultyId?: number; +} diff --git a/src/shared/responses/v1/LectureHallDetailsResponse.ts b/src/shared/responses/v1/LectureHallDetailsResponse.ts new file mode 100644 index 0000000..f731fcf --- /dev/null +++ b/src/shared/responses/v1/LectureHallDetailsResponse.ts @@ -0,0 +1,7 @@ +export interface LectureHallDetailsResponse { + id: number; + name: string; + campusId: number; + campusName?: string; + campusCode?: string; +} diff --git a/src/shared/responses/v1/LectureHallResponse.ts b/src/shared/responses/v1/LectureHallResponse.ts new file mode 100644 index 0000000..d951d85 --- /dev/null +++ b/src/shared/responses/v1/LectureHallResponse.ts @@ -0,0 +1,5 @@ +export interface LectureHallResponse { + id: number; + name: string; + campusId: number; +} diff --git a/src/shared/responses/v1/ProfessorResponse.ts b/src/shared/responses/v1/ProfessorResponse.ts new file mode 100644 index 0000000..50ad14d --- /dev/null +++ b/src/shared/responses/v1/ProfessorResponse.ts @@ -0,0 +1,5 @@ +export interface ProfessorResponse { + id: number; + name: string; + altName?: string; +} diff --git a/src/shared/responses/v1/ScheduleResponse.ts b/src/shared/responses/v1/ScheduleResponse.ts new file mode 100644 index 0000000..23dea16 --- /dev/null +++ b/src/shared/responses/v1/ScheduleResponse.ts @@ -0,0 +1,21 @@ +import {DayOfWeek} from "@model/dayOfWeek"; + +export interface ScheduleResponse { + dayOfWeek: DayOfWeek; + pairNumber: number; + isEven: boolean; + discipline: string; + disciplineId: number; + isExcludedWeeks?: boolean; + weeks?: Array; + typeOfOccupations: Array; + group: string; + groupId: number; + lectureHalls: Array; + lectureHallsId: Array; + professors: Array; + professorsId: Array; + campus: Array; + campusId: Array; + linkToMeet: Array; +} diff --git a/src/shared/responses/v1/availableProvidersResponse.ts b/src/shared/responses/v1/availableProvidersResponse.ts new file mode 100644 index 0000000..aa738a7 --- /dev/null +++ b/src/shared/responses/v1/availableProvidersResponse.ts @@ -0,0 +1,7 @@ +import {OAuthProvider} from "@model/oAuthProvider"; + +export interface AvailableOAuthProvidersResponse { + providerName: string; + provider: OAuthProvider; + redirect: string; +} diff --git a/src/shared/responses/v1/configuration/cacheResponse.ts b/src/shared/responses/v1/configuration/cacheResponse.ts new file mode 100644 index 0000000..c564a79 --- /dev/null +++ b/src/shared/responses/v1/configuration/cacheResponse.ts @@ -0,0 +1,8 @@ +import {CacheType} from "@model/cacheType"; + +export interface CacheResponse { + type: CacheType; + server?: string; + port: number; + password?: string; +} diff --git a/src/shared/responses/v1/configuration/databaseResponse.ts b/src/shared/responses/v1/configuration/databaseResponse.ts new file mode 100644 index 0000000..7bdd4b1 --- /dev/null +++ b/src/shared/responses/v1/configuration/databaseResponse.ts @@ -0,0 +1,12 @@ +import {DatabaseType} from "@model/databaseType"; + +export interface DatabaseResponse { + type: DatabaseType; + server?: string; + port: number; + database?: string; + user?: string; + ssl: boolean; + password?: string; + pathToDatabase?: string; +} diff --git a/src/shared/responses/v1/emailRequest.ts b/src/shared/responses/v1/emailRequest.ts deleted file mode 100644 index 02f5374..0000000 --- a/src/shared/responses/v1/emailRequest.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * MIREA Schedule Web API - * This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team. - * - * OpenAPI spec version: 1.0 - * Contact: support@winsomnia.net - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * Represents a request to configure email settings. - */ -export interface EmailRequest { - /** - * Gets or sets the server address. - */ - server: string; - /** - * Gets or sets the email address from which emails will be sent. - */ - from: string; - /** - * Gets or sets the password for the email account. - */ - password: string; - /** - * Gets or sets the port number. - */ - port: number; - /** - * Gets or sets a value indicating whether SSL is enabled. - */ - ssl: boolean; - /** - * Gets or sets the username. - */ - user: string; -} \ No newline at end of file diff --git a/src/shared/responses/v1/tokenResponse.ts b/src/shared/responses/v1/tokenResponse.ts deleted file mode 100644 index f683d5f..0000000 --- a/src/shared/responses/v1/tokenResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * MIREA Schedule Web API - * This API provides a convenient interface for retrieving data stored in the database. Special attention was paid to the lightweight and easy transfer of all necessary data. Made by the Winsomnia team. - * - * OpenAPI spec version: 1.0 - * Contact: support@winsomnia.net - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * - */ -export interface TokenResponse { - /** - * - */ - accessToken : string; - /** - * - */ - expiresIn: Date; -} diff --git a/src/shared/responses/v1/userResponse.ts b/src/shared/responses/v1/userResponse.ts new file mode 100644 index 0000000..dd48aba --- /dev/null +++ b/src/shared/responses/v1/userResponse.ts @@ -0,0 +1,8 @@ +import {OAuthProvider} from "@model/oAuthProvider"; + +export interface UserResponse { + email: string; + username: string; + twoFactorAuthenticatorEnabled: boolean; + usedOAuthProviders: OAuthProvider[]; +} diff --git a/src/shared/structs/CacheType.ts b/src/shared/structs/CacheType.ts new file mode 100644 index 0000000..a454c0f --- /dev/null +++ b/src/shared/structs/CacheType.ts @@ -0,0 +1,4 @@ +export enum CacheType { + Memcached, + Redis +} diff --git a/src/shared/structs/DatabaseType.ts b/src/shared/structs/DatabaseType.ts new file mode 100644 index 0000000..cb5e670 --- /dev/null +++ b/src/shared/structs/DatabaseType.ts @@ -0,0 +1,5 @@ +export enum DatabaseType { + Mysql, + Sqlite, + PostgresSql +} diff --git a/src/shared/structs/DayOfWeek.ts b/src/shared/structs/DayOfWeek.ts new file mode 100644 index 0000000..2bbafb7 --- /dev/null +++ b/src/shared/structs/DayOfWeek.ts @@ -0,0 +1,9 @@ +export enum DayOfWeek { + Sunday, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday +} diff --git a/src/shared/structs/OAuthProvider.ts b/src/shared/structs/OAuthProvider.ts new file mode 100644 index 0000000..6d79367 --- /dev/null +++ b/src/shared/structs/OAuthProvider.ts @@ -0,0 +1,5 @@ +export enum OAuthProvider { + Google, + Yandex, + MailRu +} diff --git a/src/shared/structs/PairPeriodTime.ts b/src/shared/structs/PairPeriodTime.ts new file mode 100644 index 0000000..378933d --- /dev/null +++ b/src/shared/structs/PairPeriodTime.ts @@ -0,0 +1,4 @@ +export interface PairPeriodTime { + start: string; + end: string; +} diff --git a/src/shared/structs/PasswordPolicy.ts b/src/shared/structs/PasswordPolicy.ts new file mode 100644 index 0000000..ced1f89 --- /dev/null +++ b/src/shared/structs/PasswordPolicy.ts @@ -0,0 +1,7 @@ +export interface PasswordPolicy { + minimumLength: number; + requireLetter: boolean; + requireLettersDifferentCase: boolean; + requireDigit: boolean; + requireSpecialCharacter: boolean; +} diff --git a/src/shared/structs/TwoFactorAuthentication.ts b/src/shared/structs/TwoFactorAuthentication.ts new file mode 100644 index 0000000..fa1a424 --- /dev/null +++ b/src/shared/structs/TwoFactorAuthentication.ts @@ -0,0 +1,4 @@ +export enum TwoFactorAuthentication { + None, + TotpRequired +}