refactor: adapt models to the new api
This commit is contained in:
parent
99958a2383
commit
21f89132ff
5
src/shared/requests/v1/CreateUserRequest.ts
Normal file
5
src/shared/requests/v1/CreateUserRequest.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface CreateUserRequest {
|
||||||
|
email: string;
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
4
src/shared/requests/v1/LoginRequest.ts
Normal file
4
src/shared/requests/v1/LoginRequest.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface LoginRequest {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
7
src/shared/requests/v1/ScheduleRequest.ts
Normal file
7
src/shared/requests/v1/ScheduleRequest.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface ScheduleRequest {
|
||||||
|
groups?: Array<number>;
|
||||||
|
isEven?: boolean;
|
||||||
|
disciplines?: Array<number>;
|
||||||
|
professors?: Array<number>;
|
||||||
|
lectureHalls?: Array<number>;
|
||||||
|
}
|
@ -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;
|
|
||||||
}
|
|
5
src/shared/requests/v1/configuration/cacheRequest.ts
Normal file
5
src/shared/requests/v1/configuration/cacheRequest.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface CacheRequest {
|
||||||
|
server: string;
|
||||||
|
port: number;
|
||||||
|
password?: string;
|
||||||
|
}
|
8
src/shared/requests/v1/configuration/databaseRequest.ts
Normal file
8
src/shared/requests/v1/configuration/databaseRequest.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export interface DatabaseRequest {
|
||||||
|
server: string;
|
||||||
|
port: number;
|
||||||
|
database: string;
|
||||||
|
user: string;
|
||||||
|
ssl: boolean;
|
||||||
|
password?: string;
|
||||||
|
}
|
8
src/shared/requests/v1/configuration/emailRequest.ts
Normal file
8
src/shared/requests/v1/configuration/emailRequest.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export interface EmailRequest {
|
||||||
|
server: string;
|
||||||
|
from: string;
|
||||||
|
password: string;
|
||||||
|
port: number;
|
||||||
|
ssl: boolean;
|
||||||
|
user: string;
|
||||||
|
}
|
5
src/shared/requests/v1/configuration/loggingRequest.ts
Normal file
5
src/shared/requests/v1/configuration/loggingRequest.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface LoggingRequest {
|
||||||
|
enableLogToFile: boolean;
|
||||||
|
logFileName?: string;
|
||||||
|
logFilePath?: string;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
export interface ScheduleConfigurationRequest {
|
||||||
|
cronUpdateSchedule?: string;
|
||||||
|
startTerm: string;
|
||||||
|
}
|
@ -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;
|
|
||||||
}
|
|
@ -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;
|
|
||||||
}
|
|
@ -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;
|
|
||||||
}
|
|
6
src/shared/requests/v1/twoFactorAuthRequest.ts
Normal file
6
src/shared/requests/v1/twoFactorAuthRequest.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import {TwoFactorAuthentication} from "@model/twoFactorAuthentication";
|
||||||
|
|
||||||
|
export interface TwoFactorAuthRequest {
|
||||||
|
code: string;
|
||||||
|
method: TwoFactorAuthentication;
|
||||||
|
}
|
5
src/shared/responses/v1/CampusBasicInfoResponse.ts
Normal file
5
src/shared/responses/v1/CampusBasicInfoResponse.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface CampusBasicInfoResponse {
|
||||||
|
id: number;
|
||||||
|
codeName: string;
|
||||||
|
fullName?: string;
|
||||||
|
}
|
6
src/shared/responses/v1/CampusDetailsResponse.ts
Normal file
6
src/shared/responses/v1/CampusDetailsResponse.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export interface CampusDetailsResponse {
|
||||||
|
id: number;
|
||||||
|
codeName: string;
|
||||||
|
fullName?: string;
|
||||||
|
address?: string;
|
||||||
|
}
|
4
src/shared/responses/v1/DisciplineResponse.ts
Normal file
4
src/shared/responses/v1/DisciplineResponse.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface DisciplineResponse {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
4
src/shared/responses/v1/ErrorResponse.ts
Normal file
4
src/shared/responses/v1/ErrorResponse.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface ErrorResponse {
|
||||||
|
error: string;
|
||||||
|
code: number;
|
||||||
|
}
|
4
src/shared/responses/v1/FacultyResponse.ts
Normal file
4
src/shared/responses/v1/FacultyResponse.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface FacultyResponse {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
7
src/shared/responses/v1/GroupDetailsResponse.ts
Normal file
7
src/shared/responses/v1/GroupDetailsResponse.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface GroupDetailsResponse {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
courseNumber: number;
|
||||||
|
facultyId?: number;
|
||||||
|
facultyName?: string;
|
||||||
|
}
|
6
src/shared/responses/v1/GroupResponse.ts
Normal file
6
src/shared/responses/v1/GroupResponse.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export interface GroupResponse {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
courseNumber: number;
|
||||||
|
facultyId?: number;
|
||||||
|
}
|
7
src/shared/responses/v1/LectureHallDetailsResponse.ts
Normal file
7
src/shared/responses/v1/LectureHallDetailsResponse.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface LectureHallDetailsResponse {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
campusId: number;
|
||||||
|
campusName?: string;
|
||||||
|
campusCode?: string;
|
||||||
|
}
|
5
src/shared/responses/v1/LectureHallResponse.ts
Normal file
5
src/shared/responses/v1/LectureHallResponse.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface LectureHallResponse {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
campusId: number;
|
||||||
|
}
|
5
src/shared/responses/v1/ProfessorResponse.ts
Normal file
5
src/shared/responses/v1/ProfessorResponse.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface ProfessorResponse {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
altName?: string;
|
||||||
|
}
|
21
src/shared/responses/v1/ScheduleResponse.ts
Normal file
21
src/shared/responses/v1/ScheduleResponse.ts
Normal file
@ -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<number>;
|
||||||
|
typeOfOccupations: Array<string>;
|
||||||
|
group: string;
|
||||||
|
groupId: number;
|
||||||
|
lectureHalls: Array<string | null>;
|
||||||
|
lectureHallsId: Array<number | null>;
|
||||||
|
professors: Array<string | null>;
|
||||||
|
professorsId: Array<number | null>;
|
||||||
|
campus: Array<string | null>;
|
||||||
|
campusId: Array<number | null>;
|
||||||
|
linkToMeet: Array<string | null>;
|
||||||
|
}
|
7
src/shared/responses/v1/availableProvidersResponse.ts
Normal file
7
src/shared/responses/v1/availableProvidersResponse.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import {OAuthProvider} from "@model/oAuthProvider";
|
||||||
|
|
||||||
|
export interface AvailableOAuthProvidersResponse {
|
||||||
|
providerName: string;
|
||||||
|
provider: OAuthProvider;
|
||||||
|
redirect: string;
|
||||||
|
}
|
8
src/shared/responses/v1/configuration/cacheResponse.ts
Normal file
8
src/shared/responses/v1/configuration/cacheResponse.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import {CacheType} from "@model/cacheType";
|
||||||
|
|
||||||
|
export interface CacheResponse {
|
||||||
|
type: CacheType;
|
||||||
|
server?: string;
|
||||||
|
port: number;
|
||||||
|
password?: string;
|
||||||
|
}
|
12
src/shared/responses/v1/configuration/databaseResponse.ts
Normal file
12
src/shared/responses/v1/configuration/databaseResponse.ts
Normal file
@ -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;
|
||||||
|
}
|
@ -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;
|
|
||||||
}
|
|
@ -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;
|
|
||||||
}
|
|
8
src/shared/responses/v1/userResponse.ts
Normal file
8
src/shared/responses/v1/userResponse.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import {OAuthProvider} from "@model/oAuthProvider";
|
||||||
|
|
||||||
|
export interface UserResponse {
|
||||||
|
email: string;
|
||||||
|
username: string;
|
||||||
|
twoFactorAuthenticatorEnabled: boolean;
|
||||||
|
usedOAuthProviders: OAuthProvider[];
|
||||||
|
}
|
4
src/shared/structs/CacheType.ts
Normal file
4
src/shared/structs/CacheType.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export enum CacheType {
|
||||||
|
Memcached,
|
||||||
|
Redis
|
||||||
|
}
|
5
src/shared/structs/DatabaseType.ts
Normal file
5
src/shared/structs/DatabaseType.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export enum DatabaseType {
|
||||||
|
Mysql,
|
||||||
|
Sqlite,
|
||||||
|
PostgresSql
|
||||||
|
}
|
9
src/shared/structs/DayOfWeek.ts
Normal file
9
src/shared/structs/DayOfWeek.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export enum DayOfWeek {
|
||||||
|
Sunday,
|
||||||
|
Monday,
|
||||||
|
Tuesday,
|
||||||
|
Wednesday,
|
||||||
|
Thursday,
|
||||||
|
Friday,
|
||||||
|
Saturday
|
||||||
|
}
|
5
src/shared/structs/OAuthProvider.ts
Normal file
5
src/shared/structs/OAuthProvider.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export enum OAuthProvider {
|
||||||
|
Google,
|
||||||
|
Yandex,
|
||||||
|
MailRu
|
||||||
|
}
|
4
src/shared/structs/PairPeriodTime.ts
Normal file
4
src/shared/structs/PairPeriodTime.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export interface PairPeriodTime {
|
||||||
|
start: string;
|
||||||
|
end: string;
|
||||||
|
}
|
7
src/shared/structs/PasswordPolicy.ts
Normal file
7
src/shared/structs/PasswordPolicy.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export interface PasswordPolicy {
|
||||||
|
minimumLength: number;
|
||||||
|
requireLetter: boolean;
|
||||||
|
requireLettersDifferentCase: boolean;
|
||||||
|
requireDigit: boolean;
|
||||||
|
requireSpecialCharacter: boolean;
|
||||||
|
}
|
4
src/shared/structs/TwoFactorAuthentication.ts
Normal file
4
src/shared/structs/TwoFactorAuthentication.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export enum TwoFactorAuthentication {
|
||||||
|
None,
|
||||||
|
TotpRequired
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user