From 2b1eb065232dccca29aae42260061d32c350e355 Mon Sep 17 00:00:00 2001 From: ZOI-dayo Date: Mon, 4 Nov 2024 00:04:20 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0=E3=83=BB=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/gen-api.sh | 6 + src/api/.openapi-generator-ignore | 23 + src/api/.openapi-generator/FILES | 49 ++ src/api/.openapi-generator/VERSION | 1 + src/api/apis/AuthenticationApi.ts | 249 ++++++++++ src/api/apis/EditorialsApi.ts | 240 ++++++++++ src/api/apis/EmailApi.ts | 63 +++ src/api/apis/LanguageApi.ts | 58 +++ src/api/apis/MeApi.ts | 170 +++++++ src/api/apis/Oauth2Api.ts | 218 +++++++++ src/api/apis/ProblemsApi.ts | 262 +++++++++++ src/api/apis/SubmissionsApi.ts | 209 +++++++++ src/api/apis/TestcasesApi.ts | 247 ++++++++++ src/api/apis/UsersApi.ts | 69 +++ src/api/apis/index.ts | 12 + src/api/index.ts | 5 + src/api/models/Editorial.ts | 113 +++++ src/api/models/EditorialSummary.ts | 100 ++++ src/api/models/Email.ts | 66 +++ .../models/GetGoogleAuthParams200Response.ts | 66 +++ .../models/GetGoogleAuthParams500Response.ts | 65 +++ src/api/models/JudgeResult.ts | 120 +++++ src/api/models/JudgeStatus.ts | 68 +++ src/api/models/Language.ts | 75 +++ src/api/models/PostEditorialRequest.ts | 78 ++++ src/api/models/PostProblemRequest.ts | 102 +++++ src/api/models/PostSubmissionRequest.ts | 73 +++ src/api/models/PostTestcaseRequestInner.ts | 84 ++++ src/api/models/Problem.ts | 176 +++++++ src/api/models/ProblemSummaries.ts | 83 ++++ src/api/models/ProblemSummary.ts | 150 ++++++ src/api/models/PutEditorialRequest.ts | 73 +++ src/api/models/PutMeRequest.ts | 97 ++++ src/api/models/PutPasswordRequest.ts | 75 +++ src/api/models/PutProblemRequest.ts | 113 +++++ src/api/models/PutTestcaseRequest.ts | 84 ++++ src/api/models/ResetPasswordRequest.ts | 75 +++ src/api/models/RevokeTraqAuth400Response.ts | 65 +++ src/api/models/RevokeTraqAuthRequest.ts | 66 +++ src/api/models/Role.ts | 58 +++ src/api/models/Signup.ts | 84 ++++ src/api/models/SignupRequest.ts | 66 +++ src/api/models/Submission.ts | 179 ++++++++ src/api/models/SubmissionSummaries.ts | 81 ++++ src/api/models/SubmissionSummary.ts | 166 +++++++ src/api/models/Testcase.ts | 111 +++++ src/api/models/TestcaseSummaries.ts | 73 +++ src/api/models/TestcaseSummary.ts | 89 ++++ src/api/models/User.ts | 190 ++++++++ src/api/models/UserEmailAndPassword.ts | 75 +++ src/api/models/index.ts | 36 ++ src/api/runtime.ts | 431 ++++++++++++++++++ 52 files changed, 5587 insertions(+) create mode 100755 scripts/gen-api.sh create mode 100644 src/api/.openapi-generator-ignore create mode 100644 src/api/.openapi-generator/FILES create mode 100644 src/api/.openapi-generator/VERSION create mode 100644 src/api/apis/AuthenticationApi.ts create mode 100644 src/api/apis/EditorialsApi.ts create mode 100644 src/api/apis/EmailApi.ts create mode 100644 src/api/apis/LanguageApi.ts create mode 100644 src/api/apis/MeApi.ts create mode 100644 src/api/apis/Oauth2Api.ts create mode 100644 src/api/apis/ProblemsApi.ts create mode 100644 src/api/apis/SubmissionsApi.ts create mode 100644 src/api/apis/TestcasesApi.ts create mode 100644 src/api/apis/UsersApi.ts create mode 100644 src/api/apis/index.ts create mode 100644 src/api/index.ts create mode 100644 src/api/models/Editorial.ts create mode 100644 src/api/models/EditorialSummary.ts create mode 100644 src/api/models/Email.ts create mode 100644 src/api/models/GetGoogleAuthParams200Response.ts create mode 100644 src/api/models/GetGoogleAuthParams500Response.ts create mode 100644 src/api/models/JudgeResult.ts create mode 100644 src/api/models/JudgeStatus.ts create mode 100644 src/api/models/Language.ts create mode 100644 src/api/models/PostEditorialRequest.ts create mode 100644 src/api/models/PostProblemRequest.ts create mode 100644 src/api/models/PostSubmissionRequest.ts create mode 100644 src/api/models/PostTestcaseRequestInner.ts create mode 100644 src/api/models/Problem.ts create mode 100644 src/api/models/ProblemSummaries.ts create mode 100644 src/api/models/ProblemSummary.ts create mode 100644 src/api/models/PutEditorialRequest.ts create mode 100644 src/api/models/PutMeRequest.ts create mode 100644 src/api/models/PutPasswordRequest.ts create mode 100644 src/api/models/PutProblemRequest.ts create mode 100644 src/api/models/PutTestcaseRequest.ts create mode 100644 src/api/models/ResetPasswordRequest.ts create mode 100644 src/api/models/RevokeTraqAuth400Response.ts create mode 100644 src/api/models/RevokeTraqAuthRequest.ts create mode 100644 src/api/models/Role.ts create mode 100644 src/api/models/Signup.ts create mode 100644 src/api/models/SignupRequest.ts create mode 100644 src/api/models/Submission.ts create mode 100644 src/api/models/SubmissionSummaries.ts create mode 100644 src/api/models/SubmissionSummary.ts create mode 100644 src/api/models/Testcase.ts create mode 100644 src/api/models/TestcaseSummaries.ts create mode 100644 src/api/models/TestcaseSummary.ts create mode 100644 src/api/models/User.ts create mode 100644 src/api/models/UserEmailAndPassword.ts create mode 100644 src/api/models/index.ts create mode 100644 src/api/runtime.ts diff --git a/scripts/gen-api.sh b/scripts/gen-api.sh new file mode 100755 index 0000000..e6ff110 --- /dev/null +++ b/scripts/gen-api.sh @@ -0,0 +1,6 @@ +#!/bin/bash -eux + +docker run --rm -v "$(dirname $0)/../:/local" -u $(id -u):$(id -g) openapitools/openapi-generator-cli generate \ + -i https://raw.githubusercontent.com/traP-jp/traO-Judge-docs/refs/tags/1.1.0/api/backend/frontend-backend.yaml \ + -g typescript-fetch \ + -o /local/src/api diff --git a/src/api/.openapi-generator-ignore b/src/api/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/src/api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/api/.openapi-generator/FILES b/src/api/.openapi-generator/FILES new file mode 100644 index 0000000..b3d7ab3 --- /dev/null +++ b/src/api/.openapi-generator/FILES @@ -0,0 +1,49 @@ +.openapi-generator-ignore +apis/AuthenticationApi.ts +apis/EditorialsApi.ts +apis/EmailApi.ts +apis/LanguageApi.ts +apis/MeApi.ts +apis/Oauth2Api.ts +apis/ProblemsApi.ts +apis/SubmissionsApi.ts +apis/TestcasesApi.ts +apis/UsersApi.ts +apis/index.ts +index.ts +models/Editorial.ts +models/EditorialSummary.ts +models/Email.ts +models/GetGoogleAuthParams200Response.ts +models/GetGoogleAuthParams500Response.ts +models/JudgeResult.ts +models/JudgeStatus.ts +models/Language.ts +models/PostEditorialRequest.ts +models/PostProblemRequest.ts +models/PostSubmissionRequest.ts +models/PostTestcaseRequestInner.ts +models/Problem.ts +models/ProblemSummaries.ts +models/ProblemSummary.ts +models/PutEditorialRequest.ts +models/PutMeRequest.ts +models/PutPasswordRequest.ts +models/PutProblemRequest.ts +models/PutTestcaseRequest.ts +models/ResetPasswordRequest.ts +models/RevokeTraqAuth400Response.ts +models/RevokeTraqAuthRequest.ts +models/Role.ts +models/Signup.ts +models/SignupRequest.ts +models/Submission.ts +models/SubmissionSummaries.ts +models/SubmissionSummary.ts +models/Testcase.ts +models/TestcaseSummaries.ts +models/TestcaseSummary.ts +models/User.ts +models/UserEmailAndPassword.ts +models/index.ts +runtime.ts diff --git a/src/api/.openapi-generator/VERSION b/src/api/.openapi-generator/VERSION new file mode 100644 index 0000000..6935482 --- /dev/null +++ b/src/api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0-SNAPSHOT diff --git a/src/api/apis/AuthenticationApi.ts b/src/api/apis/AuthenticationApi.ts new file mode 100644 index 0000000..88e481d --- /dev/null +++ b/src/api/apis/AuthenticationApi.ts @@ -0,0 +1,249 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + Email, + ResetPasswordRequest, + Signup, + SignupRequest, + UserEmailAndPassword, +} from '../models/index'; +import { + EmailFromJSON, + EmailToJSON, + ResetPasswordRequestFromJSON, + ResetPasswordRequestToJSON, + SignupFromJSON, + SignupToJSON, + SignupRequestFromJSON, + SignupRequestToJSON, + UserEmailAndPasswordFromJSON, + UserEmailAndPasswordToJSON, +} from '../models/index'; + +export interface PostLoginRequest { + userEmailAndPassword?: UserEmailAndPassword; +} + +export interface PostRequestResetPasswordRequest { + email?: Email; +} + +export interface PostResetPasswordRequest { + tokenWithUserid?: string; + resetPasswordRequest?: ResetPasswordRequest; +} + +export interface PostSignupRequest { + tokenWithoutUserid?: string; + signup?: Signup; +} + +export interface PostSignupRequestRequest { + signupRequest?: SignupRequest; +} + +/** + * + */ +export class AuthenticationApi extends runtime.BaseAPI { + + /** + * ログイン + * postLogin + */ + async postLoginRaw(requestParameters: PostLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/login`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserEmailAndPasswordToJSON(requestParameters['userEmailAndPassword']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * ログイン + * postLogin + */ + async postLogin(requestParameters: PostLoginRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.postLoginRaw(requestParameters, initOverrides); + } + + /** + * ログアウト + * postLogout + */ + async postLogoutRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/logout`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * ログアウト + * postLogout + */ + async postLogout(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.postLogoutRaw(initOverrides); + } + + /** + * パスワード変更のリクエスト リクエストを受け取ったら`/reset-password?token=JWT`のような形式のエンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそれをクリックするとリセット用画面に遷移する。 + * postResetPasswordReset + */ + async postRequestResetPasswordRaw(requestParameters: PostRequestResetPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/reset-password/request`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EmailToJSON(requestParameters['email']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * パスワード変更のリクエスト リクエストを受け取ったら`/reset-password?token=JWT`のような形式のエンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそれをクリックするとリセット用画面に遷移する。 + * postResetPasswordReset + */ + async postRequestResetPassword(requestParameters: PostRequestResetPasswordRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.postRequestResetPasswordRaw(requestParameters, initOverrides); + } + + /** + * 新しいパスワードをPOSTする + * postResetPassword + */ + async postResetPasswordRaw(requestParameters: PostResetPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['tokenWithUserid'] != null) { + queryParameters['token-with-userid'] = requestParameters['tokenWithUserid']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/reset-password`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ResetPasswordRequestToJSON(requestParameters['resetPasswordRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * 新しいパスワードをPOSTする + * postResetPassword + */ + async postResetPassword(requestParameters: PostResetPasswordRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.postResetPasswordRaw(requestParameters, initOverrides); + } + + /** + * email+passwordによるユーザー登録 クエリパラメタにtokenを持ち,それでメール情報を管理する リクエストを受け取ったら`/activate?payload=JWT`のような形式のメール有効化用エンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそのアドレスをクリックしたら,メール有効化処理をし,適切に終了したらログイン画面にリダイレクトする。 + * postSignup + */ + async postSignupRaw(requestParameters: PostSignupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['tokenWithoutUserid'] != null) { + queryParameters['token-without-userid'] = requestParameters['tokenWithoutUserid']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/signup`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SignupToJSON(requestParameters['signup']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * email+passwordによるユーザー登録 クエリパラメタにtokenを持ち,それでメール情報を管理する リクエストを受け取ったら`/activate?payload=JWT`のような形式のメール有効化用エンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそのアドレスをクリックしたら,メール有効化処理をし,適切に終了したらログイン画面にリダイレクトする。 + * postSignup + */ + async postSignup(requestParameters: PostSignupRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.postSignupRaw(requestParameters, initOverrides); + } + + /** + * メールアドレスを渡し,そこに認証用のリンクを送る。 + * postSignupRequest + */ + async postSignupRequestRaw(requestParameters: PostSignupRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/signup/request`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SignupRequestToJSON(requestParameters['signupRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * メールアドレスを渡し,そこに認証用のリンクを送る。 + * postSignupRequest + */ + async postSignupRequest(requestParameters: PostSignupRequestRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.postSignupRequestRaw(requestParameters, initOverrides); + } + +} diff --git a/src/api/apis/EditorialsApi.ts b/src/api/apis/EditorialsApi.ts new file mode 100644 index 0000000..1a1c5bc --- /dev/null +++ b/src/api/apis/EditorialsApi.ts @@ -0,0 +1,240 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + Editorial, + EditorialSummary, + PostEditorialRequest, + PutEditorialRequest, +} from '../models/index'; +import { + EditorialFromJSON, + EditorialToJSON, + EditorialSummaryFromJSON, + EditorialSummaryToJSON, + PostEditorialRequestFromJSON, + PostEditorialRequestToJSON, + PutEditorialRequestFromJSON, + PutEditorialRequestToJSON, +} from '../models/index'; + +export interface DeleteEditorialRequest { + editorialId: string; +} + +export interface GetEditorialRequest { + editorialId: string; +} + +export interface GetEditorialsOnProblemRequest { + problemId: string; +} + +export interface PostEditorialOperationRequest { + problemId: string; + postEditorialRequest?: PostEditorialRequest; +} + +export interface PutEditorialOperationRequest { + editorialId: string; + putEditorialRequest?: PutEditorialRequest; +} + +/** + * + */ +export class EditorialsApi extends runtime.BaseAPI { + + /** + * 個別の解説を削除する + * deleteEditorial + */ + async deleteEditorialRaw(requestParameters: DeleteEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['editorialId'] == null) { + throw new runtime.RequiredError( + 'editorialId', + 'Required parameter "editorialId" was null or undefined when calling deleteEditorial().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/editorials/{editorialId}`.replace(`{${"editorialId"}}`, encodeURIComponent(String(requestParameters['editorialId']))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * 個別の解説を削除する + * deleteEditorial + */ + async deleteEditorial(requestParameters: DeleteEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteEditorialRaw(requestParameters, initOverrides); + } + + /** + * 個別の解説を取得する + * getEditorial + */ + async getEditorialRaw(requestParameters: GetEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['editorialId'] == null) { + throw new runtime.RequiredError( + 'editorialId', + 'Required parameter "editorialId" was null or undefined when calling getEditorial().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/editorials/{editorialId}`.replace(`{${"editorialId"}}`, encodeURIComponent(String(requestParameters['editorialId']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EditorialFromJSON(jsonValue)); + } + + /** + * 個別の解説を取得する + * getEditorial + */ + async getEditorial(requestParameters: GetEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getEditorialRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * ある問題の全ての解説を取得する + * getEditorialsOnProblem + */ + async getEditorialsOnProblemRaw(requestParameters: GetEditorialsOnProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling getEditorialsOnProblem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/problems/{problemId}/editorials`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(EditorialSummaryFromJSON)); + } + + /** + * ある問題の全ての解説を取得する + * getEditorialsOnProblem + */ + async getEditorialsOnProblem(requestParameters: GetEditorialsOnProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getEditorialsOnProblemRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 解説を投稿する + * postEditorial + */ + async postEditorialRaw(requestParameters: PostEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling postEditorial().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/problems/{problemId}/editorials`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PostEditorialRequestToJSON(requestParameters['postEditorialRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EditorialFromJSON(jsonValue)); + } + + /** + * 解説を投稿する + * postEditorial + */ + async postEditorial(requestParameters: PostEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.postEditorialRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 個別の解説を変更する + * putEditorial + */ + async putEditorialRaw(requestParameters: PutEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['editorialId'] == null) { + throw new runtime.RequiredError( + 'editorialId', + 'Required parameter "editorialId" was null or undefined when calling putEditorial().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/editorials/{editorialId}`.replace(`{${"editorialId"}}`, encodeURIComponent(String(requestParameters['editorialId']))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PutEditorialRequestToJSON(requestParameters['putEditorialRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * 個別の解説を変更する + * putEditorial + */ + async putEditorial(requestParameters: PutEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.putEditorialRaw(requestParameters, initOverrides); + } + +} diff --git a/src/api/apis/EmailApi.ts b/src/api/apis/EmailApi.ts new file mode 100644 index 0000000..6f9a3ac --- /dev/null +++ b/src/api/apis/EmailApi.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; + +export interface GetActivateRequest { + tokenWithUserid?: string; + tokenWithoutUserid?: string; +} + +/** + * + */ +export class EmailApi extends runtime.BaseAPI { + + /** + * メールアドレスの有効化 + * getActivateEmailAddress + */ + async getActivateRaw(requestParameters: GetActivateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['tokenWithUserid'] != null) { + queryParameters['token-with-userid'] = requestParameters['tokenWithUserid']; + } + + if (requestParameters['tokenWithoutUserid'] != null) { + queryParameters['token-without-userid'] = requestParameters['tokenWithoutUserid']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/activate`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * メールアドレスの有効化 + * getActivateEmailAddress + */ + async getActivate(requestParameters: GetActivateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.getActivateRaw(requestParameters, initOverrides); + } + +} diff --git a/src/api/apis/LanguageApi.ts b/src/api/apis/LanguageApi.ts new file mode 100644 index 0000000..bfe6715 --- /dev/null +++ b/src/api/apis/LanguageApi.ts @@ -0,0 +1,58 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + Language, +} from '../models/index'; +import { + LanguageFromJSON, + LanguageToJSON, +} from '../models/index'; + +/** + * + */ +export class LanguageApi extends runtime.BaseAPI { + + /** + * 使用できる言語の一覧 + * getLanguages + */ + async getLanguagesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/languages`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LanguageFromJSON)); + } + + /** + * 使用できる言語の一覧 + * getLanguages + */ + async getLanguages(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getLanguagesRaw(initOverrides); + return await response.value(); + } + +} diff --git a/src/api/apis/MeApi.ts b/src/api/apis/MeApi.ts new file mode 100644 index 0000000..03688ee --- /dev/null +++ b/src/api/apis/MeApi.ts @@ -0,0 +1,170 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + Email, + PutMeRequest, + PutPasswordRequest, + User, +} from '../models/index'; +import { + EmailFromJSON, + EmailToJSON, + PutMeRequestFromJSON, + PutMeRequestToJSON, + PutPasswordRequestFromJSON, + PutPasswordRequestToJSON, + UserFromJSON, + UserToJSON, +} from '../models/index'; + +export interface PutMeEmailRequest { + email?: Email; +} + +export interface PutUsersMeIconRequest { + putMeRequest?: PutMeRequest; +} + +export interface PutUsersMePasswordRequest { + putPasswordRequest?: PutPasswordRequest; +} + +/** + * + */ +export class MeApi extends runtime.BaseAPI { + + /** + * 自身の情報を取得する + * getMe + */ + async getMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/users/me`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * 自身の情報を取得する + * getMe + */ + async getMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getMeRaw(initOverrides); + return await response.value(); + } + + /** + * メール情報を書き換える メール情報を書き換えた後はメール認証が必要である + * putMeEmail + */ + async putMeEmailRaw(requestParameters: PutMeEmailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/users/me/email`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: EmailToJSON(requestParameters['email']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * メール情報を書き換える メール情報を書き換えた後はメール認証が必要である + * putMeEmail + */ + async putMeEmail(requestParameters: PutMeEmailRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.putMeEmailRaw(requestParameters, initOverrides); + } + + /** + * アイコンなど自身に関連する情報の編集をします + * putMe + */ + async putUsersMeIconRaw(requestParameters: PutUsersMeIconRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/users/me`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PutMeRequestToJSON(requestParameters['putMeRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * アイコンなど自身に関連する情報の編集をします + * putMe + */ + async putUsersMeIcon(requestParameters: PutUsersMeIconRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.putUsersMeIconRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * ログイン後にパスワードを変更する + * putUserMePassword + */ + async putUsersMePasswordRaw(requestParameters: PutUsersMePasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/users/me/password`, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PutPasswordRequestToJSON(requestParameters['putPasswordRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * ログイン後にパスワードを変更する + * putUserMePassword + */ + async putUsersMePassword(requestParameters: PutUsersMePasswordRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.putUsersMePasswordRaw(requestParameters, initOverrides); + } + +} diff --git a/src/api/apis/Oauth2Api.ts b/src/api/apis/Oauth2Api.ts new file mode 100644 index 0000000..9c74ad9 --- /dev/null +++ b/src/api/apis/Oauth2Api.ts @@ -0,0 +1,218 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + GetGoogleAuthParams200Response, + GetGoogleAuthParams500Response, + RevokeTraqAuth400Response, + RevokeTraqAuthRequest, +} from '../models/index'; +import { + GetGoogleAuthParams200ResponseFromJSON, + GetGoogleAuthParams200ResponseToJSON, + GetGoogleAuthParams500ResponseFromJSON, + GetGoogleAuthParams500ResponseToJSON, + RevokeTraqAuth400ResponseFromJSON, + RevokeTraqAuth400ResponseToJSON, + RevokeTraqAuthRequestFromJSON, + RevokeTraqAuthRequestToJSON, +} from '../models/index'; + +export interface RevokeGithubAuthRequest { + revokeTraqAuthRequest: RevokeTraqAuthRequest; +} + +export interface RevokeGoogleAuthRequest { + revokeTraqAuthRequest: RevokeTraqAuthRequest; +} + +export interface RevokeTraqAuthOperationRequest { + revokeTraqAuthRequest: RevokeTraqAuthRequest; +} + +/** + * + */ +export class Oauth2Api extends runtime.BaseAPI { + + /** + * GoogleOAuthのためのエンドポイント + * getGoogleOAuth2Params + */ + async getGoogleAuthParamsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/google-oauth2/params`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetGoogleAuthParams200ResponseFromJSON(jsonValue)); + } + + /** + * GoogleOAuthのためのエンドポイント + * getGoogleOAuth2Params + */ + async getGoogleAuthParams(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getGoogleAuthParamsRaw(initOverrides); + return await response.value(); + } + + /** + * GitHubOAuthのためのエンドポイント + * getGithubOAuth2Params + */ + async getgithubAuthParamsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/github-oauth2/params`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GetGoogleAuthParams200ResponseFromJSON(jsonValue)); + } + + /** + * GitHubOAuthのためのエンドポイント + * getGithubOAuth2Params + */ + async getgithubAuthParams(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getgithubAuthParamsRaw(initOverrides); + return await response.value(); + } + + /** + * GithubOAuthのトークンを削除する + * postGithubOAuth2Revoke + */ + async revokeGithubAuthRaw(requestParameters: RevokeGithubAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['revokeTraqAuthRequest'] == null) { + throw new runtime.RequiredError( + 'revokeTraqAuthRequest', + 'Required parameter "revokeTraqAuthRequest" was null or undefined when calling revokeGithubAuth().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/github-oauth2/revoke`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RevokeTraqAuthRequestToJSON(requestParameters['revokeTraqAuthRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * GithubOAuthのトークンを削除する + * postGithubOAuth2Revoke + */ + async revokeGithubAuth(requestParameters: RevokeGithubAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.revokeGithubAuthRaw(requestParameters, initOverrides); + } + + /** + * GoogleOAuthのトークンを削除する + * postGoogleOAuth2Revoke + */ + async revokeGoogleAuthRaw(requestParameters: RevokeGoogleAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['revokeTraqAuthRequest'] == null) { + throw new runtime.RequiredError( + 'revokeTraqAuthRequest', + 'Required parameter "revokeTraqAuthRequest" was null or undefined when calling revokeGoogleAuth().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/google-oauth2/revoke`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RevokeTraqAuthRequestToJSON(requestParameters['revokeTraqAuthRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * GoogleOAuthのトークンを削除する + * postGoogleOAuth2Revoke + */ + async revokeGoogleAuth(requestParameters: RevokeGoogleAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.revokeGoogleAuthRaw(requestParameters, initOverrides); + } + + /** + * traQOAuthのトークンを削除する + * postTraqOAuth2Revoke + */ + async revokeTraqAuthRaw(requestParameters: RevokeTraqAuthOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['revokeTraqAuthRequest'] == null) { + throw new runtime.RequiredError( + 'revokeTraqAuthRequest', + 'Required parameter "revokeTraqAuthRequest" was null or undefined when calling revokeTraqAuth().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/traq-oauth2/revoke`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RevokeTraqAuthRequestToJSON(requestParameters['revokeTraqAuthRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * traQOAuthのトークンを削除する + * postTraqOAuth2Revoke + */ + async revokeTraqAuth(requestParameters: RevokeTraqAuthOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.revokeTraqAuthRaw(requestParameters, initOverrides); + } + +} diff --git a/src/api/apis/ProblemsApi.ts b/src/api/apis/ProblemsApi.ts new file mode 100644 index 0000000..9c56269 --- /dev/null +++ b/src/api/apis/ProblemsApi.ts @@ -0,0 +1,262 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + PostProblemRequest, + Problem, + ProblemSummaries, + PutProblemRequest, +} from '../models/index'; +import { + PostProblemRequestFromJSON, + PostProblemRequestToJSON, + ProblemFromJSON, + ProblemToJSON, + ProblemSummariesFromJSON, + ProblemSummariesToJSON, + PutProblemRequestFromJSON, + PutProblemRequestToJSON, +} from '../models/index'; + +export interface DeleteProblemRequest { + problemId: string; +} + +export interface GetProblemRequest { + problemId: string; +} + +export interface GetProblemsRequest { + limit?: number; + offset?: number; + orderBy?: GetProblemsOrderByEnum; + username?: string; + userId?: string; +} + +export interface PostProblemOperationRequest { + postProblemRequest?: PostProblemRequest; +} + +export interface PutProblemOperationRequest { + problemId: string; + putProblemRequest?: PutProblemRequest; +} + +/** + * + */ +export class ProblemsApi extends runtime.BaseAPI { + + /** + * 問題を削除する + * deleteProblem + */ + async deleteProblemRaw(requestParameters: DeleteProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling deleteProblem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/problems/{problemId}`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * 問題を削除する + * deleteProblem + */ + async deleteProblem(requestParameters: DeleteProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteProblemRaw(requestParameters, initOverrides); + } + + /** + * 個別の問題を取得する + * getProblem + */ + async getProblemRaw(requestParameters: GetProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling getProblem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/problems/{problemId}`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProblemFromJSON(jsonValue)); + } + + /** + * 個別の問題を取得する + * getProblem + */ + async getProblem(requestParameters: GetProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getProblemRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 問題一覧を取得する + * getProblems + */ + async getProblemsRaw(requestParameters: GetProblemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['username'] != null) { + queryParameters['username'] = requestParameters['username']; + } + + if (requestParameters['userId'] != null) { + queryParameters['userId'] = requestParameters['userId']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/problems`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProblemSummariesFromJSON(jsonValue)); + } + + /** + * 問題一覧を取得する + * getProblems + */ + async getProblems(requestParameters: GetProblemsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getProblemsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 問題を新規作成・投稿する このとき作成された問題は必ず非公開になる 公開する場合は PUT で変更する必要がある + * postProblem + */ + async postProblemRaw(requestParameters: PostProblemOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/problems`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PostProblemRequestToJSON(requestParameters['postProblemRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ProblemFromJSON(jsonValue)); + } + + /** + * 問題を新規作成・投稿する このとき作成された問題は必ず非公開になる 公開する場合は PUT で変更する必要がある + * postProblem + */ + async postProblem(requestParameters: PostProblemOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.postProblemRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 問題を修正する + * putProblem + */ + async putProblemRaw(requestParameters: PutProblemOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling putProblem().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/problems/{problemId}`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PutProblemRequestToJSON(requestParameters['putProblemRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * 問題を修正する + * putProblem + */ + async putProblem(requestParameters: PutProblemOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.putProblemRaw(requestParameters, initOverrides); + } + +} + +/** + * @export + */ +export const GetProblemsOrderByEnum = { + CreatedAtAsc: 'createdAtAsc', + CreatedAtDesc: 'createdAtDesc', + UpdatedAtAsc: 'updatedAtAsc', + UpdatedAtDesc: 'updatedAtDesc', + DifficultyAsc: 'difficultyAsc', + DifficultyDesc: 'difficultyDesc' +} as const; +export type GetProblemsOrderByEnum = typeof GetProblemsOrderByEnum[keyof typeof GetProblemsOrderByEnum]; diff --git a/src/api/apis/SubmissionsApi.ts b/src/api/apis/SubmissionsApi.ts new file mode 100644 index 0000000..eb98d37 --- /dev/null +++ b/src/api/apis/SubmissionsApi.ts @@ -0,0 +1,209 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + JudgeStatus, + PostSubmissionRequest, + Submission, + SubmissionSummaries, +} from '../models/index'; +import { + JudgeStatusFromJSON, + JudgeStatusToJSON, + PostSubmissionRequestFromJSON, + PostSubmissionRequestToJSON, + SubmissionFromJSON, + SubmissionToJSON, + SubmissionSummariesFromJSON, + SubmissionSummariesToJSON, +} from '../models/index'; + +export interface GetSubmissionRequest { + submissionId: number; +} + +export interface GetSubmissionsRequest { + orderBy?: GetSubmissionsOrderByEnum; + status?: JudgeStatus; + language?: string; + username?: string; + userId?: string; + limit?: number; + offset?: number; + problemIdInQuery?: string; +} + +export interface PostSubmissionOperationRequest { + problemId: number; + postSubmissionRequest?: PostSubmissionRequest; +} + +/** + * + */ +export class SubmissionsApi extends runtime.BaseAPI { + + /** + * 個別の提出を取得する + * getSubmission + */ + async getSubmissionRaw(requestParameters: GetSubmissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['submissionId'] == null) { + throw new runtime.RequiredError( + 'submissionId', + 'Required parameter "submissionId" was null or undefined when calling getSubmission().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/submissions/{submissionId}`.replace(`{${"submissionId"}}`, encodeURIComponent(String(requestParameters['submissionId']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionFromJSON(jsonValue)); + } + + /** + * 個別の提出を取得する + * getSubmission + */ + async getSubmission(requestParameters: GetSubmissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getSubmissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 全ての提出を取得 + * getSubmissions + */ + async getSubmissionsRaw(requestParameters: GetSubmissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['status'] != null) { + queryParameters['status'] = requestParameters['status']; + } + + if (requestParameters['language'] != null) { + queryParameters['language'] = requestParameters['language']; + } + + if (requestParameters['username'] != null) { + queryParameters['username'] = requestParameters['username']; + } + + if (requestParameters['userId'] != null) { + queryParameters['userId'] = requestParameters['userId']; + } + + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; + } + + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; + } + + if (requestParameters['problemIdInQuery'] != null) { + queryParameters['problemIdInQuery'] = requestParameters['problemIdInQuery']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/submissions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionSummariesFromJSON(jsonValue)); + } + + /** + * 全ての提出を取得 + * getSubmissions + */ + async getSubmissions(requestParameters: GetSubmissionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getSubmissionsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * ソースコードを提出する + * postSubmission + */ + async postSubmissionRaw(requestParameters: PostSubmissionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling postSubmission().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/problems/{problemId}/submissions`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PostSubmissionRequestToJSON(requestParameters['postSubmissionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionFromJSON(jsonValue)); + } + + /** + * ソースコードを提出する + * postSubmission + */ + async postSubmission(requestParameters: PostSubmissionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.postSubmissionRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const GetSubmissionsOrderByEnum = { + SubmittedAtAsc: 'submittedAtAsc', + SubmittedAtDesc: 'submittedAtDesc', + TimeConsumptionAsc: 'timeConsumptionAsc', + TimeConsumptionDesc: 'timeConsumptionDesc', + ScoreAsc: 'scoreAsc', + ScoreDesc: 'scoreDesc', + MemoryConsumptionAsc: 'memoryConsumptionAsc', + MemoryConsumptionDesc: 'memoryConsumptionDesc', + CodeLengthAsc: 'codeLengthAsc', + CodeLengthDesc: 'codeLengthDesc' +} as const; +export type GetSubmissionsOrderByEnum = typeof GetSubmissionsOrderByEnum[keyof typeof GetSubmissionsOrderByEnum]; diff --git a/src/api/apis/TestcasesApi.ts b/src/api/apis/TestcasesApi.ts new file mode 100644 index 0000000..cee2c68 --- /dev/null +++ b/src/api/apis/TestcasesApi.ts @@ -0,0 +1,247 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + PostTestcaseRequestInner, + PutTestcaseRequest, + Testcase, + TestcaseSummaries, +} from '../models/index'; +import { + PostTestcaseRequestInnerFromJSON, + PostTestcaseRequestInnerToJSON, + PutTestcaseRequestFromJSON, + PutTestcaseRequestToJSON, + TestcaseFromJSON, + TestcaseToJSON, + TestcaseSummariesFromJSON, + TestcaseSummariesToJSON, +} from '../models/index'; + +export interface DeleteTestcaseRequest { + testcaseId: string; +} + +export interface GetTestcaseRequest { + testcaseId: string; +} + +export interface GetTestcasesRequest { + problemId: string; +} + +export interface PostTestcasesRequest { + problemId: string; + postTestcaseRequestInner?: Array; +} + +export interface PutTestcaseOperationRequest { + testcaseId: string; + putTestcaseRequest: PutTestcaseRequest; +} + +/** + * + */ +export class TestcasesApi extends runtime.BaseAPI { + + /** + * 単一のテストケースの削除 + * deleteTestcase + */ + async deleteTestcaseRaw(requestParameters: DeleteTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['testcaseId'] == null) { + throw new runtime.RequiredError( + 'testcaseId', + 'Required parameter "testcaseId" was null or undefined when calling deleteTestcase().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/testcases/{testcaseId}`.replace(`{${"testcaseId"}}`, encodeURIComponent(String(requestParameters['testcaseId']))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * 単一のテストケースの削除 + * deleteTestcase + */ + async deleteTestcase(requestParameters: DeleteTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteTestcaseRaw(requestParameters, initOverrides); + } + + /** + * あるidのテストケースを取得 + * getTestcase + */ + async getTestcaseRaw(requestParameters: GetTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['testcaseId'] == null) { + throw new runtime.RequiredError( + 'testcaseId', + 'Required parameter "testcaseId" was null or undefined when calling getTestcase().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/testcases/{testcaseId}`.replace(`{${"testcaseId"}}`, encodeURIComponent(String(requestParameters['testcaseId']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TestcaseFromJSON(jsonValue)); + } + + /** + * あるidのテストケースを取得 + * getTestcase + */ + async getTestcase(requestParameters: GetTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTestcaseRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 全てのテストケースを取得 + * getTestcases + */ + async getTestcasesRaw(requestParameters: GetTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling getTestcases().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/problems/{problemId}/testcases`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TestcaseSummariesFromJSON(jsonValue)); + } + + /** + * 全てのテストケースを取得 + * getTestcases + */ + async getTestcases(requestParameters: GetTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getTestcasesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * テストケースを投稿する + * postTestcases + */ + async postTestcasesRaw(requestParameters: PostTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['problemId'] == null) { + throw new runtime.RequiredError( + 'problemId', + 'Required parameter "problemId" was null or undefined when calling postTestcases().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/problems/{problemId}/testcases`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['postTestcaseRequestInner']!.map(PostTestcaseRequestInnerToJSON), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TestcaseSummariesFromJSON(jsonValue)); + } + + /** + * テストケースを投稿する + * postTestcases + */ + async postTestcases(requestParameters: PostTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.postTestcasesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * 単体のテストケースの編集 + * putTestcase + */ + async putTestcaseRaw(requestParameters: PutTestcaseOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['testcaseId'] == null) { + throw new runtime.RequiredError( + 'testcaseId', + 'Required parameter "testcaseId" was null or undefined when calling putTestcase().' + ); + } + + if (requestParameters['putTestcaseRequest'] == null) { + throw new runtime.RequiredError( + 'putTestcaseRequest', + 'Required parameter "putTestcaseRequest" was null or undefined when calling putTestcase().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + const response = await this.request({ + path: `/testcases/{testcaseId}`.replace(`{${"testcaseId"}}`, encodeURIComponent(String(requestParameters['testcaseId']))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PutTestcaseRequestToJSON(requestParameters['putTestcaseRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * 単体のテストケースの編集 + * putTestcase + */ + async putTestcase(requestParameters: PutTestcaseOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.putTestcaseRaw(requestParameters, initOverrides); + } + +} diff --git a/src/api/apis/UsersApi.ts b/src/api/apis/UsersApi.ts new file mode 100644 index 0000000..09a83a9 --- /dev/null +++ b/src/api/apis/UsersApi.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + User, +} from '../models/index'; +import { + UserFromJSON, + UserToJSON, +} from '../models/index'; + +export interface GetUserRequest { + userId: string; +} + +/** + * + */ +export class UsersApi extends runtime.BaseAPI { + + /** + * 個別のユーザー情報を取得する + * getUser + */ + async getUserRaw(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['userId'] == null) { + throw new runtime.RequiredError( + 'userId', + 'Required parameter "userId" was null or undefined when calling getUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/users/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * 個別のユーザー情報を取得する + * getUser + */ + async getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getUserRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/api/apis/index.ts b/src/api/apis/index.ts new file mode 100644 index 0000000..98adf2e --- /dev/null +++ b/src/api/apis/index.ts @@ -0,0 +1,12 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AuthenticationApi'; +export * from './EditorialsApi'; +export * from './EmailApi'; +export * from './LanguageApi'; +export * from './MeApi'; +export * from './Oauth2Api'; +export * from './ProblemsApi'; +export * from './SubmissionsApi'; +export * from './TestcasesApi'; +export * from './UsersApi'; diff --git a/src/api/index.ts b/src/api/index.ts new file mode 100644 index 0000000..bebe8bb --- /dev/null +++ b/src/api/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/src/api/models/Editorial.ts b/src/api/models/Editorial.ts new file mode 100644 index 0000000..96de252 --- /dev/null +++ b/src/api/models/Editorial.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 解説の詳細 + * @export + * @interface Editorial + */ +export interface Editorial { + /** + * 解説ID + * @type {number} + * @memberof Editorial + */ + id: number; + /** + * 作成日時 + * @type {Date} + * @memberof Editorial + */ + createdAt: Date; + /** + * 更新日時 + * @type {Date} + * @memberof Editorial + */ + updatedAt?: Date; + /** + * 投稿者のユーザーID + * @type {number} + * @memberof Editorial + */ + authorId: number; + /** + * 解説本文 (HTML) + * @type {string} + * @memberof Editorial + */ + statement: string; + /** + * 解説が全体公開かどうか. + * + * * `true` - 公開 + * * `false` - 非公開 (問題の作者のみ閲覧可) + * @type {boolean} + * @memberof Editorial + */ + isPublic: boolean; +} + +/** + * Check if a given object implements the Editorial interface. + */ +export function instanceOfEditorial(value: object): value is Editorial { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('authorId' in value) || value['authorId'] === undefined) return false; + if (!('statement' in value) || value['statement'] === undefined) return false; + if (!('isPublic' in value) || value['isPublic'] === undefined) return false; + return true; +} + +export function EditorialFromJSON(json: any): Editorial { + return EditorialFromJSONTyped(json, false); +} + +export function EditorialFromJSONTyped(json: any, ignoreDiscriminator: boolean): Editorial { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'createdAt': (new Date(json['createdAt'])), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + 'authorId': json['authorId'], + 'statement': json['statement'], + 'isPublic': json['isPublic'], + }; +} + + export function EditorialToJSON(json: any): Editorial { + return EditorialToJSONTyped(json, false); + } + + export function EditorialToJSONTyped(value?: Editorial | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'createdAt': ((value['createdAt']).toISOString()), + 'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()), + 'authorId': value['authorId'], + 'statement': value['statement'], + 'isPublic': value['isPublic'], + }; +} + diff --git a/src/api/models/EditorialSummary.ts b/src/api/models/EditorialSummary.ts new file mode 100644 index 0000000..4a32283 --- /dev/null +++ b/src/api/models/EditorialSummary.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 解説 + * @export + * @interface EditorialSummary + */ +export interface EditorialSummary { + /** + * 解説ID + * @type {number} + * @memberof EditorialSummary + */ + id?: number; + /** + * 作成日時 + * @type {Date} + * @memberof EditorialSummary + */ + createdAt?: Date; + /** + * 更新日時 + * @type {Date} + * @memberof EditorialSummary + */ + updatedAt?: Date; + /** + * 投稿者のユーザーID + * @type {number} + * @memberof EditorialSummary + */ + authorId?: number; + /** + * 解説が全体公開かどうか. + * + * * `true` - 公開 + * * `false` - 非公開 (問題の作者のみ閲覧可) + * @type {boolean} + * @memberof EditorialSummary + */ + isPublic?: boolean; +} + +/** + * Check if a given object implements the EditorialSummary interface. + */ +export function instanceOfEditorialSummary(value: object): value is EditorialSummary { + return true; +} + +export function EditorialSummaryFromJSON(json: any): EditorialSummary { + return EditorialSummaryFromJSONTyped(json, false); +} + +export function EditorialSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): EditorialSummary { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + 'authorId': json['authorId'] == null ? undefined : json['authorId'], + 'isPublic': json['isPublic'] == null ? undefined : json['isPublic'], + }; +} + + export function EditorialSummaryToJSON(json: any): EditorialSummary { + return EditorialSummaryToJSONTyped(json, false); + } + + export function EditorialSummaryToJSONTyped(value?: EditorialSummary | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()), + 'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()), + 'authorId': value['authorId'], + 'isPublic': value['isPublic'], + }; +} + diff --git a/src/api/models/Email.ts b/src/api/models/Email.ts new file mode 100644 index 0000000..c249748 --- /dev/null +++ b/src/api/models/Email.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface Email + */ +export interface Email { + /** + * + * @type {string} + * @memberof Email + */ + email: string; +} + +/** + * Check if a given object implements the Email interface. + */ +export function instanceOfEmail(value: object): value is Email { + if (!('email' in value) || value['email'] === undefined) return false; + return true; +} + +export function EmailFromJSON(json: any): Email { + return EmailFromJSONTyped(json, false); +} + +export function EmailFromJSONTyped(json: any, ignoreDiscriminator: boolean): Email { + if (json == null) { + return json; + } + return { + + 'email': json['email'], + }; +} + + export function EmailToJSON(json: any): Email { + return EmailToJSONTyped(json, false); + } + + export function EmailToJSONTyped(value?: Email | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'email': value['email'], + }; +} + diff --git a/src/api/models/GetGoogleAuthParams200Response.ts b/src/api/models/GetGoogleAuthParams200Response.ts new file mode 100644 index 0000000..99cf631 --- /dev/null +++ b/src/api/models/GetGoogleAuthParams200Response.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GetGoogleAuthParams200Response + */ +export interface GetGoogleAuthParams200Response { + /** + * + * @type {string} + * @memberof GetGoogleAuthParams200Response + */ + url: string; +} + +/** + * Check if a given object implements the GetGoogleAuthParams200Response interface. + */ +export function instanceOfGetGoogleAuthParams200Response(value: object): value is GetGoogleAuthParams200Response { + if (!('url' in value) || value['url'] === undefined) return false; + return true; +} + +export function GetGoogleAuthParams200ResponseFromJSON(json: any): GetGoogleAuthParams200Response { + return GetGoogleAuthParams200ResponseFromJSONTyped(json, false); +} + +export function GetGoogleAuthParams200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetGoogleAuthParams200Response { + if (json == null) { + return json; + } + return { + + 'url': json['url'], + }; +} + + export function GetGoogleAuthParams200ResponseToJSON(json: any): GetGoogleAuthParams200Response { + return GetGoogleAuthParams200ResponseToJSONTyped(json, false); + } + + export function GetGoogleAuthParams200ResponseToJSONTyped(value?: GetGoogleAuthParams200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'url': value['url'], + }; +} + diff --git a/src/api/models/GetGoogleAuthParams500Response.ts b/src/api/models/GetGoogleAuthParams500Response.ts new file mode 100644 index 0000000..b70e70a --- /dev/null +++ b/src/api/models/GetGoogleAuthParams500Response.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GetGoogleAuthParams500Response + */ +export interface GetGoogleAuthParams500Response { + /** + * + * @type {string} + * @memberof GetGoogleAuthParams500Response + */ + message?: string; +} + +/** + * Check if a given object implements the GetGoogleAuthParams500Response interface. + */ +export function instanceOfGetGoogleAuthParams500Response(value: object): value is GetGoogleAuthParams500Response { + return true; +} + +export function GetGoogleAuthParams500ResponseFromJSON(json: any): GetGoogleAuthParams500Response { + return GetGoogleAuthParams500ResponseFromJSONTyped(json, false); +} + +export function GetGoogleAuthParams500ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetGoogleAuthParams500Response { + if (json == null) { + return json; + } + return { + + 'message': json['message'] == null ? undefined : json['message'], + }; +} + + export function GetGoogleAuthParams500ResponseToJSON(json: any): GetGoogleAuthParams500Response { + return GetGoogleAuthParams500ResponseToJSONTyped(json, false); + } + + export function GetGoogleAuthParams500ResponseToJSONTyped(value?: GetGoogleAuthParams500Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'message': value['message'], + }; +} + diff --git a/src/api/models/JudgeResult.ts b/src/api/models/JudgeResult.ts new file mode 100644 index 0000000..64468df --- /dev/null +++ b/src/api/models/JudgeResult.ts @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { JudgeStatus } from './JudgeStatus'; +import { + JudgeStatusFromJSON, + JudgeStatusFromJSONTyped, + JudgeStatusToJSON, + JudgeStatusToJSONTyped, +} from './JudgeStatus'; + +/** + * ジャッジ結果 + * @export + * @interface JudgeResult + */ +export interface JudgeResult { + /** + * + * @type {string} + * @memberof JudgeResult + */ + testcaseId: string; + /** + * + * @type {string} + * @memberof JudgeResult + */ + testcaseName?: string; + /** + * + * @type {JudgeStatus} + * @memberof JudgeResult + */ + judgeStatus: JudgeStatus; + /** + * + * @type {number} + * @memberof JudgeResult + */ + score: number; + /** + * + * @type {number} + * @memberof JudgeResult + */ + time: number; + /** + * + * @type {number} + * @memberof JudgeResult + */ + memory: number; +} + + + +/** + * Check if a given object implements the JudgeResult interface. + */ +export function instanceOfJudgeResult(value: object): value is JudgeResult { + if (!('testcaseId' in value) || value['testcaseId'] === undefined) return false; + if (!('judgeStatus' in value) || value['judgeStatus'] === undefined) return false; + if (!('score' in value) || value['score'] === undefined) return false; + if (!('time' in value) || value['time'] === undefined) return false; + if (!('memory' in value) || value['memory'] === undefined) return false; + return true; +} + +export function JudgeResultFromJSON(json: any): JudgeResult { + return JudgeResultFromJSONTyped(json, false); +} + +export function JudgeResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): JudgeResult { + if (json == null) { + return json; + } + return { + + 'testcaseId': json['testcaseId'], + 'testcaseName': json['testcaseName'] == null ? undefined : json['testcaseName'], + 'judgeStatus': JudgeStatusFromJSON(json['judgeStatus']), + 'score': json['score'], + 'time': json['time'], + 'memory': json['memory'], + }; +} + + export function JudgeResultToJSON(json: any): JudgeResult { + return JudgeResultToJSONTyped(json, false); + } + + export function JudgeResultToJSONTyped(value?: JudgeResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'testcaseId': value['testcaseId'], + 'testcaseName': value['testcaseName'], + 'judgeStatus': JudgeStatusToJSON(value['judgeStatus']), + 'score': value['score'], + 'time': value['time'], + 'memory': value['memory'], + }; +} + diff --git a/src/api/models/JudgeStatus.ts b/src/api/models/JudgeStatus.ts new file mode 100644 index 0000000..1cdf8c3 --- /dev/null +++ b/src/api/models/JudgeStatus.ts @@ -0,0 +1,68 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * ジャッジの状態 + * + * * `AC` - 正解 + * * `WA` - 不正解 + * * `CE` - コンパイルエラー + * * `IE` - 内部エラー + * * `MLE` - メモリ制限超過 + * * `RE` - 実行時エラー + * * `TLE` - 実行時間超過 + * * `WJ` - ジャッジ待ち + * @export + */ +export const JudgeStatus = { + Ac: 'AC', + Wa: 'WA', + Ce: 'CE', + Ie: 'IE', + Mle: 'MLE', + Re: 'RE', + Tle: 'TLE', + Wj: 'WJ' +} as const; +export type JudgeStatus = typeof JudgeStatus[keyof typeof JudgeStatus]; + + +export function instanceOfJudgeStatus(value: any): boolean { + for (const key in JudgeStatus) { + if (Object.prototype.hasOwnProperty.call(JudgeStatus, key)) { + if (JudgeStatus[key as keyof typeof JudgeStatus] === value) { + return true; + } + } + } + return false; +} + +export function JudgeStatusFromJSON(json: any): JudgeStatus { + return JudgeStatusFromJSONTyped(json, false); +} + +export function JudgeStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): JudgeStatus { + return json as JudgeStatus; +} + +export function JudgeStatusToJSON(value?: JudgeStatus | null): any { + return value as any; +} + +export function JudgeStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): JudgeStatus { + return value as JudgeStatus; +} + diff --git a/src/api/models/Language.ts b/src/api/models/Language.ts new file mode 100644 index 0000000..a65da8b --- /dev/null +++ b/src/api/models/Language.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * プログラミング言語についての情報 + * @export + * @interface Language + */ +export interface Language { + /** + * + * @type {number} + * @memberof Language + */ + id: number; + /** + * + * @type {string} + * @memberof Language + */ + name: string; +} + +/** + * Check if a given object implements the Language interface. + */ +export function instanceOfLanguage(value: object): value is Language { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function LanguageFromJSON(json: any): Language { + return LanguageFromJSONTyped(json, false); +} + +export function LanguageFromJSONTyped(json: any, ignoreDiscriminator: boolean): Language { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + }; +} + + export function LanguageToJSON(json: any): Language { + return LanguageToJSONTyped(json, false); + } + + export function LanguageToJSONTyped(value?: Language | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + }; +} + diff --git a/src/api/models/PostEditorialRequest.ts b/src/api/models/PostEditorialRequest.ts new file mode 100644 index 0000000..d3c59ea --- /dev/null +++ b/src/api/models/PostEditorialRequest.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 解説の作成リクエスト + * @export + * @interface PostEditorialRequest + */ +export interface PostEditorialRequest { + /** + * 解説本文 (HTML) + * @type {string} + * @memberof PostEditorialRequest + */ + statement: string; + /** + * 解説が全体公開かどうか. + * + * * `true` - 公開 + * * `false` - 非公開 (問題の作者のみ閲覧可) + * @type {boolean} + * @memberof PostEditorialRequest + */ + isPublic: boolean; +} + +/** + * Check if a given object implements the PostEditorialRequest interface. + */ +export function instanceOfPostEditorialRequest(value: object): value is PostEditorialRequest { + if (!('statement' in value) || value['statement'] === undefined) return false; + if (!('isPublic' in value) || value['isPublic'] === undefined) return false; + return true; +} + +export function PostEditorialRequestFromJSON(json: any): PostEditorialRequest { + return PostEditorialRequestFromJSONTyped(json, false); +} + +export function PostEditorialRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostEditorialRequest { + if (json == null) { + return json; + } + return { + + 'statement': json['statement'], + 'isPublic': json['isPublic'], + }; +} + + export function PostEditorialRequestToJSON(json: any): PostEditorialRequest { + return PostEditorialRequestToJSONTyped(json, false); + } + + export function PostEditorialRequestToJSONTyped(value?: PostEditorialRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statement': value['statement'], + 'isPublic': value['isPublic'], + }; +} + diff --git a/src/api/models/PostProblemRequest.ts b/src/api/models/PostProblemRequest.ts new file mode 100644 index 0000000..70b5dfc --- /dev/null +++ b/src/api/models/PostProblemRequest.ts @@ -0,0 +1,102 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 問題の投稿リクエスト + * @export + * @interface PostProblemRequest + */ +export interface PostProblemRequest { + /** + * 問題タイトル + * @type {string} + * @memberof PostProblemRequest + */ + title: string; + /** + * 難易度 + * @type {number} + * @memberof PostProblemRequest + */ + difficulty: number; + /** + * 問題文 (HTML形式) + * @type {string} + * @memberof PostProblemRequest + */ + statement: string; + /** + * 実行時間制限 (ms) + * @type {number} + * @memberof PostProblemRequest + */ + timeLimit: number; + /** + * メモリ制限 (MiB) + * @type {number} + * @memberof PostProblemRequest + */ + memoryLimit: number; +} + +/** + * Check if a given object implements the PostProblemRequest interface. + */ +export function instanceOfPostProblemRequest(value: object): value is PostProblemRequest { + if (!('title' in value) || value['title'] === undefined) return false; + if (!('difficulty' in value) || value['difficulty'] === undefined) return false; + if (!('statement' in value) || value['statement'] === undefined) return false; + if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; + if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; + return true; +} + +export function PostProblemRequestFromJSON(json: any): PostProblemRequest { + return PostProblemRequestFromJSONTyped(json, false); +} + +export function PostProblemRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostProblemRequest { + if (json == null) { + return json; + } + return { + + 'title': json['title'], + 'difficulty': json['difficulty'], + 'statement': json['statement'], + 'timeLimit': json['timeLimit'], + 'memoryLimit': json['memoryLimit'], + }; +} + + export function PostProblemRequestToJSON(json: any): PostProblemRequest { + return PostProblemRequestToJSONTyped(json, false); + } + + export function PostProblemRequestToJSONTyped(value?: PostProblemRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'title': value['title'], + 'difficulty': value['difficulty'], + 'statement': value['statement'], + 'timeLimit': value['timeLimit'], + 'memoryLimit': value['memoryLimit'], + }; +} + diff --git a/src/api/models/PostSubmissionRequest.ts b/src/api/models/PostSubmissionRequest.ts new file mode 100644 index 0000000..d6c01a3 --- /dev/null +++ b/src/api/models/PostSubmissionRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 回答の提出リクエスト + * @export + * @interface PostSubmissionRequest + */ +export interface PostSubmissionRequest { + /** + * 提出コードの言語ID + * @type {number} + * @memberof PostSubmissionRequest + */ + languageId?: number; + /** + * ソースコード + * @type {string} + * @memberof PostSubmissionRequest + */ + source?: string; +} + +/** + * Check if a given object implements the PostSubmissionRequest interface. + */ +export function instanceOfPostSubmissionRequest(value: object): value is PostSubmissionRequest { + return true; +} + +export function PostSubmissionRequestFromJSON(json: any): PostSubmissionRequest { + return PostSubmissionRequestFromJSONTyped(json, false); +} + +export function PostSubmissionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostSubmissionRequest { + if (json == null) { + return json; + } + return { + + 'languageId': json['languageId'] == null ? undefined : json['languageId'], + 'source': json['source'] == null ? undefined : json['source'], + }; +} + + export function PostSubmissionRequestToJSON(json: any): PostSubmissionRequest { + return PostSubmissionRequestToJSONTyped(json, false); + } + + export function PostSubmissionRequestToJSONTyped(value?: PostSubmissionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'languageId': value['languageId'], + 'source': value['source'], + }; +} + diff --git a/src/api/models/PostTestcaseRequestInner.ts b/src/api/models/PostTestcaseRequestInner.ts new file mode 100644 index 0000000..56a539c --- /dev/null +++ b/src/api/models/PostTestcaseRequestInner.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface PostTestcaseRequestInner + */ +export interface PostTestcaseRequestInner { + /** + * + * @type {string} + * @memberof PostTestcaseRequestInner + */ + name: string; + /** + * + * @type {string} + * @memberof PostTestcaseRequestInner + */ + testInput: string; + /** + * + * @type {string} + * @memberof PostTestcaseRequestInner + */ + testOutput: string; +} + +/** + * Check if a given object implements the PostTestcaseRequestInner interface. + */ +export function instanceOfPostTestcaseRequestInner(value: object): value is PostTestcaseRequestInner { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('testInput' in value) || value['testInput'] === undefined) return false; + if (!('testOutput' in value) || value['testOutput'] === undefined) return false; + return true; +} + +export function PostTestcaseRequestInnerFromJSON(json: any): PostTestcaseRequestInner { + return PostTestcaseRequestInnerFromJSONTyped(json, false); +} + +export function PostTestcaseRequestInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostTestcaseRequestInner { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'testInput': json['testInput'], + 'testOutput': json['testOutput'], + }; +} + + export function PostTestcaseRequestInnerToJSON(json: any): PostTestcaseRequestInner { + return PostTestcaseRequestInnerToJSONTyped(json, false); + } + + export function PostTestcaseRequestInnerToJSONTyped(value?: PostTestcaseRequestInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'testInput': value['testInput'], + 'testOutput': value['testOutput'], + }; +} + diff --git a/src/api/models/Problem.ts b/src/api/models/Problem.ts new file mode 100644 index 0000000..61c34c5 --- /dev/null +++ b/src/api/models/Problem.ts @@ -0,0 +1,176 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TestcaseSummaries } from './TestcaseSummaries'; +import { + TestcaseSummariesFromJSON, + TestcaseSummariesFromJSONTyped, + TestcaseSummariesToJSON, + TestcaseSummariesToJSONTyped, +} from './TestcaseSummaries'; + +/** + * 問題の詳細 + * @export + * @interface Problem + */ +export interface Problem { + /** + * 問題ID + * @type {string} + * @memberof Problem + */ + id: string; + /** + * 問題タイトル + * @type {string} + * @memberof Problem + */ + title: string; + /** + * 作問者のユーザーID + * @type {number} + * @memberof Problem + */ + authorId: number; + /** + * 問題が全体公開かどうか. + * + * * `true` - 公開 + * * `false` - 非公開 (問題の作者のみ閲覧可) + * @type {boolean} + * @memberof Problem + */ + isPublic: boolean; + /** + * 難易度 + * @type {number} + * @memberof Problem + */ + difficulty: number; + /** + * 問題文 (HTML形式) + * @type {string} + * @memberof Problem + */ + statement: string; + /** + * 実行時間制限 (ms) + * @type {number} + * @memberof Problem + */ + timeLimit: number; + /** + * メモリ制限 (MiB) + * @type {number} + * @memberof Problem + */ + memoryLimit: number; + /** + * + * @type {number} + * @memberof Problem + */ + solvedCount: number; + /** + * + * @type {Array} + * @memberof Problem + */ + testcases: Array; + /** + * + * @type {Date} + * @memberof Problem + */ + createdAt: Date; + /** + * + * @type {Date} + * @memberof Problem + */ + updatedAt: Date; +} + +/** + * Check if a given object implements the Problem interface. + */ +export function instanceOfProblem(value: object): value is Problem { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('title' in value) || value['title'] === undefined) return false; + if (!('authorId' in value) || value['authorId'] === undefined) return false; + if (!('isPublic' in value) || value['isPublic'] === undefined) return false; + if (!('difficulty' in value) || value['difficulty'] === undefined) return false; + if (!('statement' in value) || value['statement'] === undefined) return false; + if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; + if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; + if (!('solvedCount' in value) || value['solvedCount'] === undefined) return false; + if (!('testcases' in value) || value['testcases'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; + return true; +} + +export function ProblemFromJSON(json: any): Problem { + return ProblemFromJSONTyped(json, false); +} + +export function ProblemFromJSONTyped(json: any, ignoreDiscriminator: boolean): Problem { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'title': json['title'], + 'authorId': json['authorId'], + 'isPublic': json['isPublic'], + 'difficulty': json['difficulty'], + 'statement': json['statement'], + 'timeLimit': json['timeLimit'], + 'memoryLimit': json['memoryLimit'], + 'solvedCount': json['solvedCount'], + 'testcases': ((json['testcases'] as Array).map(TestcaseSummariesFromJSON)), + 'createdAt': (new Date(json['createdAt'])), + 'updatedAt': (new Date(json['updatedAt'])), + }; +} + + export function ProblemToJSON(json: any): Problem { + return ProblemToJSONTyped(json, false); + } + + export function ProblemToJSONTyped(value?: Problem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'title': value['title'], + 'authorId': value['authorId'], + 'isPublic': value['isPublic'], + 'difficulty': value['difficulty'], + 'statement': value['statement'], + 'timeLimit': value['timeLimit'], + 'memoryLimit': value['memoryLimit'], + 'solvedCount': value['solvedCount'], + 'testcases': ((value['testcases'] as Array).map(TestcaseSummariesToJSON)), + 'createdAt': ((value['createdAt']).toISOString()), + 'updatedAt': ((value['updatedAt']).toISOString()), + }; +} + diff --git a/src/api/models/ProblemSummaries.ts b/src/api/models/ProblemSummaries.ts new file mode 100644 index 0000000..c2e9242 --- /dev/null +++ b/src/api/models/ProblemSummaries.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { ProblemSummary } from './ProblemSummary'; +import { + ProblemSummaryFromJSON, + ProblemSummaryFromJSONTyped, + ProblemSummaryToJSON, + ProblemSummaryToJSONTyped, +} from './ProblemSummary'; + +/** + * + * @export + * @interface ProblemSummaries + */ +export interface ProblemSummaries { + /** + * + * @type {number} + * @memberof ProblemSummaries + */ + total: number; + /** + * + * @type {Array} + * @memberof ProblemSummaries + */ + problems: Array; +} + +/** + * Check if a given object implements the ProblemSummaries interface. + */ +export function instanceOfProblemSummaries(value: object): value is ProblemSummaries { + if (!('total' in value) || value['total'] === undefined) return false; + if (!('problems' in value) || value['problems'] === undefined) return false; + return true; +} + +export function ProblemSummariesFromJSON(json: any): ProblemSummaries { + return ProblemSummariesFromJSONTyped(json, false); +} + +export function ProblemSummariesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProblemSummaries { + if (json == null) { + return json; + } + return { + + 'total': json['total'], + 'problems': ((json['problems'] as Array).map(ProblemSummaryFromJSON)), + }; +} + + export function ProblemSummariesToJSON(json: any): ProblemSummaries { + return ProblemSummariesToJSONTyped(json, false); + } + + export function ProblemSummariesToJSONTyped(value?: ProblemSummaries | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'total': value['total'], + 'problems': ((value['problems'] as Array).map(ProblemSummaryToJSON)), + }; +} + diff --git a/src/api/models/ProblemSummary.ts b/src/api/models/ProblemSummary.ts new file mode 100644 index 0000000..81cddb9 --- /dev/null +++ b/src/api/models/ProblemSummary.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 問題の要約 + * @export + * @interface ProblemSummary + */ +export interface ProblemSummary { + /** + * 問題ID + * @type {string} + * @memberof ProblemSummary + */ + id: string; + /** + * 問題タイトル + * @type {string} + * @memberof ProblemSummary + */ + title: string; + /** + * 作問者のユーザーID + * @type {number} + * @memberof ProblemSummary + */ + authorId: number; + /** + * 問題が全体公開かどうか. + * + * * `true` - 公開 + * * `false` - 非公開 (問題の作者のみ閲覧可) + * @type {boolean} + * @memberof ProblemSummary + */ + isPublic: boolean; + /** + * 難易度 + * @type {number} + * @memberof ProblemSummary + */ + difficulty: number; + /** + * 実行時間制限 (ms) + * @type {number} + * @memberof ProblemSummary + */ + timeLimit: number; + /** + * メモリ制限 (MiB) + * @type {number} + * @memberof ProblemSummary + */ + memoryLimit: number; + /** + * + * @type {number} + * @memberof ProblemSummary + */ + solvedCount: number; + /** + * + * @type {Date} + * @memberof ProblemSummary + */ + createdAt: Date; + /** + * + * @type {Date} + * @memberof ProblemSummary + */ + updatedAt: Date; +} + +/** + * Check if a given object implements the ProblemSummary interface. + */ +export function instanceOfProblemSummary(value: object): value is ProblemSummary { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('title' in value) || value['title'] === undefined) return false; + if (!('authorId' in value) || value['authorId'] === undefined) return false; + if (!('isPublic' in value) || value['isPublic'] === undefined) return false; + if (!('difficulty' in value) || value['difficulty'] === undefined) return false; + if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; + if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; + if (!('solvedCount' in value) || value['solvedCount'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; + return true; +} + +export function ProblemSummaryFromJSON(json: any): ProblemSummary { + return ProblemSummaryFromJSONTyped(json, false); +} + +export function ProblemSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProblemSummary { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'title': json['title'], + 'authorId': json['authorId'], + 'isPublic': json['isPublic'], + 'difficulty': json['difficulty'], + 'timeLimit': json['timeLimit'], + 'memoryLimit': json['memoryLimit'], + 'solvedCount': json['solvedCount'], + 'createdAt': (new Date(json['createdAt'])), + 'updatedAt': (new Date(json['updatedAt'])), + }; +} + + export function ProblemSummaryToJSON(json: any): ProblemSummary { + return ProblemSummaryToJSONTyped(json, false); + } + + export function ProblemSummaryToJSONTyped(value?: ProblemSummary | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'title': value['title'], + 'authorId': value['authorId'], + 'isPublic': value['isPublic'], + 'difficulty': value['difficulty'], + 'timeLimit': value['timeLimit'], + 'memoryLimit': value['memoryLimit'], + 'solvedCount': value['solvedCount'], + 'createdAt': ((value['createdAt']).toISOString()), + 'updatedAt': ((value['updatedAt']).toISOString()), + }; +} + diff --git a/src/api/models/PutEditorialRequest.ts b/src/api/models/PutEditorialRequest.ts new file mode 100644 index 0000000..c436dd7 --- /dev/null +++ b/src/api/models/PutEditorialRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 解説の変更リクエスト. + * @export + * @interface PutEditorialRequest + */ +export interface PutEditorialRequest { + /** + * 解説本文 (HTML) + * @type {string} + * @memberof PutEditorialRequest + */ + statement?: string; + /** + * 公開されているかどうか + * @type {boolean} + * @memberof PutEditorialRequest + */ + isPublic?: boolean; +} + +/** + * Check if a given object implements the PutEditorialRequest interface. + */ +export function instanceOfPutEditorialRequest(value: object): value is PutEditorialRequest { + return true; +} + +export function PutEditorialRequestFromJSON(json: any): PutEditorialRequest { + return PutEditorialRequestFromJSONTyped(json, false); +} + +export function PutEditorialRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutEditorialRequest { + if (json == null) { + return json; + } + return { + + 'statement': json['statement'] == null ? undefined : json['statement'], + 'isPublic': json['isPublic'] == null ? undefined : json['isPublic'], + }; +} + + export function PutEditorialRequestToJSON(json: any): PutEditorialRequest { + return PutEditorialRequestToJSONTyped(json, false); + } + + export function PutEditorialRequestToJSONTyped(value?: PutEditorialRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statement': value['statement'], + 'isPublic': value['isPublic'], + }; +} + diff --git a/src/api/models/PutMeRequest.ts b/src/api/models/PutMeRequest.ts new file mode 100644 index 0000000..9ff660f --- /dev/null +++ b/src/api/models/PutMeRequest.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface PutMeRequest + */ +export interface PutMeRequest { + /** + * + * @type {string} + * @memberof PutMeRequest + */ + userName?: string; + /** + * + * @type {Blob} + * @memberof PutMeRequest + */ + icon?: Blob; + /** + * + * @type {string} + * @memberof PutMeRequest + */ + xLink?: string; + /** + * + * @type {string} + * @memberof PutMeRequest + */ + githubLink?: string; + /** + * + * @type {string} + * @memberof PutMeRequest + */ + selfIntroduction?: string; +} + +/** + * Check if a given object implements the PutMeRequest interface. + */ +export function instanceOfPutMeRequest(value: object): value is PutMeRequest { + return true; +} + +export function PutMeRequestFromJSON(json: any): PutMeRequest { + return PutMeRequestFromJSONTyped(json, false); +} + +export function PutMeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutMeRequest { + if (json == null) { + return json; + } + return { + + 'userName': json['userName'] == null ? undefined : json['userName'], + 'icon': json['icon'] == null ? undefined : json['icon'], + 'xLink': json['xLink'] == null ? undefined : json['xLink'], + 'githubLink': json['githubLink'] == null ? undefined : json['githubLink'], + 'selfIntroduction': json['selfIntroduction'] == null ? undefined : json['selfIntroduction'], + }; +} + + export function PutMeRequestToJSON(json: any): PutMeRequest { + return PutMeRequestToJSONTyped(json, false); + } + + export function PutMeRequestToJSONTyped(value?: PutMeRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'userName': value['userName'], + 'icon': value['icon'], + 'xLink': value['xLink'], + 'githubLink': value['githubLink'], + 'selfIntroduction': value['selfIntroduction'], + }; +} + diff --git a/src/api/models/PutPasswordRequest.ts b/src/api/models/PutPasswordRequest.ts new file mode 100644 index 0000000..2f9c236 --- /dev/null +++ b/src/api/models/PutPasswordRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * ログイン後のパスワード変更用 + * @export + * @interface PutPasswordRequest + */ +export interface PutPasswordRequest { + /** + * + * @type {string} + * @memberof PutPasswordRequest + */ + oldPassword: string; + /** + * + * @type {string} + * @memberof PutPasswordRequest + */ + newPassword: string; +} + +/** + * Check if a given object implements the PutPasswordRequest interface. + */ +export function instanceOfPutPasswordRequest(value: object): value is PutPasswordRequest { + if (!('oldPassword' in value) || value['oldPassword'] === undefined) return false; + if (!('newPassword' in value) || value['newPassword'] === undefined) return false; + return true; +} + +export function PutPasswordRequestFromJSON(json: any): PutPasswordRequest { + return PutPasswordRequestFromJSONTyped(json, false); +} + +export function PutPasswordRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutPasswordRequest { + if (json == null) { + return json; + } + return { + + 'oldPassword': json['oldPassword'], + 'newPassword': json['newPassword'], + }; +} + + export function PutPasswordRequestToJSON(json: any): PutPasswordRequest { + return PutPasswordRequestToJSONTyped(json, false); + } + + export function PutPasswordRequestToJSONTyped(value?: PutPasswordRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'oldPassword': value['oldPassword'], + 'newPassword': value['newPassword'], + }; +} + diff --git a/src/api/models/PutProblemRequest.ts b/src/api/models/PutProblemRequest.ts new file mode 100644 index 0000000..6eb9c38 --- /dev/null +++ b/src/api/models/PutProblemRequest.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 問題の変更リクエスト + * @export + * @interface PutProblemRequest + */ +export interface PutProblemRequest { + /** + * 問題タイトル + * @type {string} + * @memberof PutProblemRequest + */ + title: string; + /** + * 問題が全体公開かどうか. + * + * * `true` - 公開 + * * `false` - 非公開 (問題の作者のみ閲覧可) + * @type {boolean} + * @memberof PutProblemRequest + */ + isPublic: boolean; + /** + * 難易度 + * @type {number} + * @memberof PutProblemRequest + */ + difficulty: number; + /** + * 問題文 (HTML形式) + * @type {string} + * @memberof PutProblemRequest + */ + statement?: string; + /** + * 実行時間制限 (ms) + * @type {number} + * @memberof PutProblemRequest + */ + timeLimit: number; + /** + * メモリ制限 (MiB) + * @type {number} + * @memberof PutProblemRequest + */ + memoryLimit: number; +} + +/** + * Check if a given object implements the PutProblemRequest interface. + */ +export function instanceOfPutProblemRequest(value: object): value is PutProblemRequest { + if (!('title' in value) || value['title'] === undefined) return false; + if (!('isPublic' in value) || value['isPublic'] === undefined) return false; + if (!('difficulty' in value) || value['difficulty'] === undefined) return false; + if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; + if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; + return true; +} + +export function PutProblemRequestFromJSON(json: any): PutProblemRequest { + return PutProblemRequestFromJSONTyped(json, false); +} + +export function PutProblemRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutProblemRequest { + if (json == null) { + return json; + } + return { + + 'title': json['title'], + 'isPublic': json['isPublic'], + 'difficulty': json['difficulty'], + 'statement': json['statement'] == null ? undefined : json['statement'], + 'timeLimit': json['timeLimit'], + 'memoryLimit': json['memoryLimit'], + }; +} + + export function PutProblemRequestToJSON(json: any): PutProblemRequest { + return PutProblemRequestToJSONTyped(json, false); + } + + export function PutProblemRequestToJSONTyped(value?: PutProblemRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'title': value['title'], + 'isPublic': value['isPublic'], + 'difficulty': value['difficulty'], + 'statement': value['statement'], + 'timeLimit': value['timeLimit'], + 'memoryLimit': value['memoryLimit'], + }; +} + diff --git a/src/api/models/PutTestcaseRequest.ts b/src/api/models/PutTestcaseRequest.ts new file mode 100644 index 0000000..a83bd96 --- /dev/null +++ b/src/api/models/PutTestcaseRequest.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * 単体のテストケースの編集 + * @export + * @interface PutTestcaseRequest + */ +export interface PutTestcaseRequest { + /** + * + * @type {string} + * @memberof PutTestcaseRequest + */ + name: string; + /** + * + * @type {string} + * @memberof PutTestcaseRequest + */ + testInput: string; + /** + * + * @type {string} + * @memberof PutTestcaseRequest + */ + testOutput: string; +} + +/** + * Check if a given object implements the PutTestcaseRequest interface. + */ +export function instanceOfPutTestcaseRequest(value: object): value is PutTestcaseRequest { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('testInput' in value) || value['testInput'] === undefined) return false; + if (!('testOutput' in value) || value['testOutput'] === undefined) return false; + return true; +} + +export function PutTestcaseRequestFromJSON(json: any): PutTestcaseRequest { + return PutTestcaseRequestFromJSONTyped(json, false); +} + +export function PutTestcaseRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutTestcaseRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'testInput': json['testInput'], + 'testOutput': json['testOutput'], + }; +} + + export function PutTestcaseRequestToJSON(json: any): PutTestcaseRequest { + return PutTestcaseRequestToJSONTyped(json, false); + } + + export function PutTestcaseRequestToJSONTyped(value?: PutTestcaseRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'testInput': value['testInput'], + 'testOutput': value['testOutput'], + }; +} + diff --git a/src/api/models/ResetPasswordRequest.ts b/src/api/models/ResetPasswordRequest.ts new file mode 100644 index 0000000..25f1c06 --- /dev/null +++ b/src/api/models/ResetPasswordRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ResetPasswordRequest + */ +export interface ResetPasswordRequest { + /** + * + * @type {string} + * @memberof ResetPasswordRequest + */ + password: string; + /** + * + * @type {string} + * @memberof ResetPasswordRequest + */ + token: string; +} + +/** + * Check if a given object implements the ResetPasswordRequest interface. + */ +export function instanceOfResetPasswordRequest(value: object): value is ResetPasswordRequest { + if (!('password' in value) || value['password'] === undefined) return false; + if (!('token' in value) || value['token'] === undefined) return false; + return true; +} + +export function ResetPasswordRequestFromJSON(json: any): ResetPasswordRequest { + return ResetPasswordRequestFromJSONTyped(json, false); +} + +export function ResetPasswordRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResetPasswordRequest { + if (json == null) { + return json; + } + return { + + 'password': json['password'], + 'token': json['token'], + }; +} + + export function ResetPasswordRequestToJSON(json: any): ResetPasswordRequest { + return ResetPasswordRequestToJSONTyped(json, false); + } + + export function ResetPasswordRequestToJSONTyped(value?: ResetPasswordRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'password': value['password'], + 'token': value['token'], + }; +} + diff --git a/src/api/models/RevokeTraqAuth400Response.ts b/src/api/models/RevokeTraqAuth400Response.ts new file mode 100644 index 0000000..b725502 --- /dev/null +++ b/src/api/models/RevokeTraqAuth400Response.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RevokeTraqAuth400Response + */ +export interface RevokeTraqAuth400Response { + /** + * + * @type {string} + * @memberof RevokeTraqAuth400Response + */ + message?: string; +} + +/** + * Check if a given object implements the RevokeTraqAuth400Response interface. + */ +export function instanceOfRevokeTraqAuth400Response(value: object): value is RevokeTraqAuth400Response { + return true; +} + +export function RevokeTraqAuth400ResponseFromJSON(json: any): RevokeTraqAuth400Response { + return RevokeTraqAuth400ResponseFromJSONTyped(json, false); +} + +export function RevokeTraqAuth400ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevokeTraqAuth400Response { + if (json == null) { + return json; + } + return { + + 'message': json['message'] == null ? undefined : json['message'], + }; +} + + export function RevokeTraqAuth400ResponseToJSON(json: any): RevokeTraqAuth400Response { + return RevokeTraqAuth400ResponseToJSONTyped(json, false); + } + + export function RevokeTraqAuth400ResponseToJSONTyped(value?: RevokeTraqAuth400Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'message': value['message'], + }; +} + diff --git a/src/api/models/RevokeTraqAuthRequest.ts b/src/api/models/RevokeTraqAuthRequest.ts new file mode 100644 index 0000000..4d93373 --- /dev/null +++ b/src/api/models/RevokeTraqAuthRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RevokeTraqAuthRequest + */ +export interface RevokeTraqAuthRequest { + /** + * The access token to revoke + * @type {string} + * @memberof RevokeTraqAuthRequest + */ + token: string; +} + +/** + * Check if a given object implements the RevokeTraqAuthRequest interface. + */ +export function instanceOfRevokeTraqAuthRequest(value: object): value is RevokeTraqAuthRequest { + if (!('token' in value) || value['token'] === undefined) return false; + return true; +} + +export function RevokeTraqAuthRequestFromJSON(json: any): RevokeTraqAuthRequest { + return RevokeTraqAuthRequestFromJSONTyped(json, false); +} + +export function RevokeTraqAuthRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevokeTraqAuthRequest { + if (json == null) { + return json; + } + return { + + 'token': json['token'], + }; +} + + export function RevokeTraqAuthRequestToJSON(json: any): RevokeTraqAuthRequest { + return RevokeTraqAuthRequestToJSONTyped(json, false); + } + + export function RevokeTraqAuthRequestToJSONTyped(value?: RevokeTraqAuthRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'token': value['token'], + }; +} + diff --git a/src/api/models/Role.ts b/src/api/models/Role.ts new file mode 100644 index 0000000..774ab05 --- /dev/null +++ b/src/api/models/Role.ts @@ -0,0 +1,58 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * ユーザの役割 + * + * * `Admin` - Admin + * * `traPUser` - AdminでないtraP部員 + * * `CommonUser` - Adminでない一般ユーザー(traP部員以外のユーザー) + * @export + */ +export const Role = { + Admin: 'Admin', + TraPUser: 'traPUser', + CommonUser: 'CommonUser' +} as const; +export type Role = typeof Role[keyof typeof Role]; + + +export function instanceOfRole(value: any): boolean { + for (const key in Role) { + if (Object.prototype.hasOwnProperty.call(Role, key)) { + if (Role[key as keyof typeof Role] === value) { + return true; + } + } + } + return false; +} + +export function RoleFromJSON(json: any): Role { + return RoleFromJSONTyped(json, false); +} + +export function RoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Role { + return json as Role; +} + +export function RoleToJSON(value?: Role | null): any { + return value as any; +} + +export function RoleToJSONTyped(value: any, ignoreDiscriminator: boolean): Role { + return value as Role; +} + diff --git a/src/api/models/Signup.ts b/src/api/models/Signup.ts new file mode 100644 index 0000000..924e9e7 --- /dev/null +++ b/src/api/models/Signup.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * email+password登録 + * @export + * @interface Signup + */ +export interface Signup { + /** + * + * @type {string} + * @memberof Signup + */ + userName: string; + /** + * + * @type {string} + * @memberof Signup + */ + password: string; + /** + * + * @type {string} + * @memberof Signup + */ + token: string; +} + +/** + * Check if a given object implements the Signup interface. + */ +export function instanceOfSignup(value: object): value is Signup { + if (!('userName' in value) || value['userName'] === undefined) return false; + if (!('password' in value) || value['password'] === undefined) return false; + if (!('token' in value) || value['token'] === undefined) return false; + return true; +} + +export function SignupFromJSON(json: any): Signup { + return SignupFromJSONTyped(json, false); +} + +export function SignupFromJSONTyped(json: any, ignoreDiscriminator: boolean): Signup { + if (json == null) { + return json; + } + return { + + 'userName': json['userName'], + 'password': json['password'], + 'token': json['token'], + }; +} + + export function SignupToJSON(json: any): Signup { + return SignupToJSONTyped(json, false); + } + + export function SignupToJSONTyped(value?: Signup | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'userName': value['userName'], + 'password': value['password'], + 'token': value['token'], + }; +} + diff --git a/src/api/models/SignupRequest.ts b/src/api/models/SignupRequest.ts new file mode 100644 index 0000000..aa8034b --- /dev/null +++ b/src/api/models/SignupRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * Signupのリクエスト + * @export + * @interface SignupRequest + */ +export interface SignupRequest { + /** + * + * @type {string} + * @memberof SignupRequest + */ + email: string; +} + +/** + * Check if a given object implements the SignupRequest interface. + */ +export function instanceOfSignupRequest(value: object): value is SignupRequest { + if (!('email' in value) || value['email'] === undefined) return false; + return true; +} + +export function SignupRequestFromJSON(json: any): SignupRequest { + return SignupRequestFromJSONTyped(json, false); +} + +export function SignupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignupRequest { + if (json == null) { + return json; + } + return { + + 'email': json['email'], + }; +} + + export function SignupRequestToJSON(json: any): SignupRequest { + return SignupRequestToJSONTyped(json, false); + } + + export function SignupRequestToJSONTyped(value?: SignupRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'email': value['email'], + }; +} + diff --git a/src/api/models/Submission.ts b/src/api/models/Submission.ts new file mode 100644 index 0000000..7626142 --- /dev/null +++ b/src/api/models/Submission.ts @@ -0,0 +1,179 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { JudgeStatus } from './JudgeStatus'; +import { + JudgeStatusFromJSON, + JudgeStatusFromJSONTyped, + JudgeStatusToJSON, + JudgeStatusToJSONTyped, +} from './JudgeStatus'; +import type { JudgeResult } from './JudgeResult'; +import { + JudgeResultFromJSON, + JudgeResultFromJSONTyped, + JudgeResultToJSON, + JudgeResultToJSONTyped, +} from './JudgeResult'; + +/** + * 提出の詳細 + * @export + * @interface Submission + */ +export interface Submission { + /** + * 提出ID + * @type {string} + * @memberof Submission + */ + id: string; + /** + * 提出ユーザーID + * @type {number} + * @memberof Submission + */ + userId: number; + /** + * + * @type {string} + * @memberof Submission + */ + userName: string; + /** + * 問題ID + * @type {number} + * @memberof Submission + */ + problemId: number; + /** + * 提出日時 + * @type {Date} + * @memberof Submission + */ + submittedAt: Date; + /** + * 提出コードの言語ID + * @type {number} + * @memberof Submission + */ + languageId: number; + /** + * スコアの合計 + * @type {number} + * @memberof Submission + */ + totalScore: number; + /** + * 実行時間の最大値 (ms) + * @type {number} + * @memberof Submission + */ + maxTime: number; + /** + * メモリ使用量の最大値 (MiB) + * @type {number} + * @memberof Submission + */ + maxMemory: number; + /** + * + * @type {number} + * @memberof Submission + */ + codeLength?: number; + /** + * + * @type {JudgeStatus} + * @memberof Submission + */ + overallJudgeStatus?: JudgeStatus; + /** + * + * @type {Array} + * @memberof Submission + */ + judgeResults?: Array; +} + + + +/** + * Check if a given object implements the Submission interface. + */ +export function instanceOfSubmission(value: object): value is Submission { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + if (!('userName' in value) || value['userName'] === undefined) return false; + if (!('problemId' in value) || value['problemId'] === undefined) return false; + if (!('submittedAt' in value) || value['submittedAt'] === undefined) return false; + if (!('languageId' in value) || value['languageId'] === undefined) return false; + if (!('totalScore' in value) || value['totalScore'] === undefined) return false; + if (!('maxTime' in value) || value['maxTime'] === undefined) return false; + if (!('maxMemory' in value) || value['maxMemory'] === undefined) return false; + return true; +} + +export function SubmissionFromJSON(json: any): Submission { + return SubmissionFromJSONTyped(json, false); +} + +export function SubmissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Submission { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'userId': json['userId'], + 'userName': json['userName'], + 'problemId': json['problemId'], + 'submittedAt': (new Date(json['submittedAt'])), + 'languageId': json['languageId'], + 'totalScore': json['totalScore'], + 'maxTime': json['maxTime'], + 'maxMemory': json['maxMemory'], + 'codeLength': json['codeLength'] == null ? undefined : json['codeLength'], + 'overallJudgeStatus': json['overallJudgeStatus'] == null ? undefined : JudgeStatusFromJSON(json['overallJudgeStatus']), + 'judgeResults': json['judgeResults'] == null ? undefined : ((json['judgeResults'] as Array).map(JudgeResultFromJSON)), + }; +} + + export function SubmissionToJSON(json: any): Submission { + return SubmissionToJSONTyped(json, false); + } + + export function SubmissionToJSONTyped(value?: Submission | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'userId': value['userId'], + 'userName': value['userName'], + 'problemId': value['problemId'], + 'submittedAt': ((value['submittedAt']).toISOString()), + 'languageId': value['languageId'], + 'totalScore': value['totalScore'], + 'maxTime': value['maxTime'], + 'maxMemory': value['maxMemory'], + 'codeLength': value['codeLength'], + 'overallJudgeStatus': JudgeStatusToJSON(value['overallJudgeStatus']), + 'judgeResults': value['judgeResults'] == null ? undefined : ((value['judgeResults'] as Array).map(JudgeResultToJSON)), + }; +} + diff --git a/src/api/models/SubmissionSummaries.ts b/src/api/models/SubmissionSummaries.ts new file mode 100644 index 0000000..e08266f --- /dev/null +++ b/src/api/models/SubmissionSummaries.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { SubmissionSummary } from './SubmissionSummary'; +import { + SubmissionSummaryFromJSON, + SubmissionSummaryFromJSONTyped, + SubmissionSummaryToJSON, + SubmissionSummaryToJSONTyped, +} from './SubmissionSummary'; + +/** + * 提出一覧 + * @export + * @interface SubmissionSummaries + */ +export interface SubmissionSummaries { + /** + * + * @type {number} + * @memberof SubmissionSummaries + */ + total?: number; + /** + * + * @type {Array} + * @memberof SubmissionSummaries + */ + problems?: Array; +} + +/** + * Check if a given object implements the SubmissionSummaries interface. + */ +export function instanceOfSubmissionSummaries(value: object): value is SubmissionSummaries { + return true; +} + +export function SubmissionSummariesFromJSON(json: any): SubmissionSummaries { + return SubmissionSummariesFromJSONTyped(json, false); +} + +export function SubmissionSummariesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionSummaries { + if (json == null) { + return json; + } + return { + + 'total': json['total'] == null ? undefined : json['total'], + 'problems': json['problems'] == null ? undefined : ((json['problems'] as Array).map(SubmissionSummaryFromJSON)), + }; +} + + export function SubmissionSummariesToJSON(json: any): SubmissionSummaries { + return SubmissionSummariesToJSONTyped(json, false); + } + + export function SubmissionSummariesToJSONTyped(value?: SubmissionSummaries | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'total': value['total'], + 'problems': value['problems'] == null ? undefined : ((value['problems'] as Array).map(SubmissionSummaryToJSON)), + }; +} + diff --git a/src/api/models/SubmissionSummary.ts b/src/api/models/SubmissionSummary.ts new file mode 100644 index 0000000..b2ccd1b --- /dev/null +++ b/src/api/models/SubmissionSummary.ts @@ -0,0 +1,166 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { JudgeStatus } from './JudgeStatus'; +import { + JudgeStatusFromJSON, + JudgeStatusFromJSONTyped, + JudgeStatusToJSON, + JudgeStatusToJSONTyped, +} from './JudgeStatus'; + +/** + * 提出 + * @export + * @interface SubmissionSummary + */ +export interface SubmissionSummary { + /** + * 提出ID + * @type {string} + * @memberof SubmissionSummary + */ + id: string; + /** + * 問題ID + * @type {number} + * @memberof SubmissionSummary + */ + problemId: number; + /** + * 提出ユーザーID + * @type {number} + * @memberof SubmissionSummary + */ + userId: number; + /** + * + * @type {string} + * @memberof SubmissionSummary + */ + userName: string; + /** + * 提出日時 + * @type {Date} + * @memberof SubmissionSummary + */ + submittedAt: Date; + /** + * 提出コードの言語ID + * @type {number} + * @memberof SubmissionSummary + */ + languageId: number; + /** + * スコアの合計 + * @type {number} + * @memberof SubmissionSummary + */ + totalScore: number; + /** + * 実行時間の最大値 (ms) + * @type {number} + * @memberof SubmissionSummary + */ + maxTime: number; + /** + * メモリ使用量の最大値 (MiB) + * @type {number} + * @memberof SubmissionSummary + */ + maxMemory: number; + /** + * + * @type {number} + * @memberof SubmissionSummary + */ + codeLength: number; + /** + * + * @type {JudgeStatus} + * @memberof SubmissionSummary + */ + judgeStatus: JudgeStatus; +} + + + +/** + * Check if a given object implements the SubmissionSummary interface. + */ +export function instanceOfSubmissionSummary(value: object): value is SubmissionSummary { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('problemId' in value) || value['problemId'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + if (!('userName' in value) || value['userName'] === undefined) return false; + if (!('submittedAt' in value) || value['submittedAt'] === undefined) return false; + if (!('languageId' in value) || value['languageId'] === undefined) return false; + if (!('totalScore' in value) || value['totalScore'] === undefined) return false; + if (!('maxTime' in value) || value['maxTime'] === undefined) return false; + if (!('maxMemory' in value) || value['maxMemory'] === undefined) return false; + if (!('codeLength' in value) || value['codeLength'] === undefined) return false; + if (!('judgeStatus' in value) || value['judgeStatus'] === undefined) return false; + return true; +} + +export function SubmissionSummaryFromJSON(json: any): SubmissionSummary { + return SubmissionSummaryFromJSONTyped(json, false); +} + +export function SubmissionSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionSummary { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'problemId': json['problemId'], + 'userId': json['userId'], + 'userName': json['userName'], + 'submittedAt': (new Date(json['submittedAt'])), + 'languageId': json['languageId'], + 'totalScore': json['totalScore'], + 'maxTime': json['maxTime'], + 'maxMemory': json['maxMemory'], + 'codeLength': json['codeLength'], + 'judgeStatus': JudgeStatusFromJSON(json['judgeStatus']), + }; +} + + export function SubmissionSummaryToJSON(json: any): SubmissionSummary { + return SubmissionSummaryToJSONTyped(json, false); + } + + export function SubmissionSummaryToJSONTyped(value?: SubmissionSummary | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'problemId': value['problemId'], + 'userId': value['userId'], + 'userName': value['userName'], + 'submittedAt': ((value['submittedAt']).toISOString()), + 'languageId': value['languageId'], + 'totalScore': value['totalScore'], + 'maxTime': value['maxTime'], + 'maxMemory': value['maxMemory'], + 'codeLength': value['codeLength'], + 'judgeStatus': JudgeStatusToJSON(value['judgeStatus']), + }; +} + diff --git a/src/api/models/Testcase.ts b/src/api/models/Testcase.ts new file mode 100644 index 0000000..14a9f5f --- /dev/null +++ b/src/api/models/Testcase.ts @@ -0,0 +1,111 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * テストケース + * @export + * @interface Testcase + */ +export interface Testcase { + /** + * + * @type {string} + * @memberof Testcase + */ + name: string; + /** + * + * @type {string} + * @memberof Testcase + */ + id: string; + /** + * + * @type {string} + * @memberof Testcase + */ + testInput: string; + /** + * + * @type {string} + * @memberof Testcase + */ + testOutput: string; + /** + * + * @type {Date} + * @memberof Testcase + */ + createdAt: Date; + /** + * + * @type {Date} + * @memberof Testcase + */ + updatedAt: Date; +} + +/** + * Check if a given object implements the Testcase interface. + */ +export function instanceOfTestcase(value: object): value is Testcase { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('id' in value) || value['id'] === undefined) return false; + if (!('testInput' in value) || value['testInput'] === undefined) return false; + if (!('testOutput' in value) || value['testOutput'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; + return true; +} + +export function TestcaseFromJSON(json: any): Testcase { + return TestcaseFromJSONTyped(json, false); +} + +export function TestcaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Testcase { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'id': json['id'], + 'testInput': json['testInput'], + 'testOutput': json['testOutput'], + 'createdAt': (new Date(json['createdAt'])), + 'updatedAt': (new Date(json['updatedAt'])), + }; +} + + export function TestcaseToJSON(json: any): Testcase { + return TestcaseToJSONTyped(json, false); + } + + export function TestcaseToJSONTyped(value?: Testcase | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'id': value['id'], + 'testInput': value['testInput'], + 'testOutput': value['testOutput'], + 'createdAt': ((value['createdAt']).toISOString()), + 'updatedAt': ((value['updatedAt']).toISOString()), + }; +} + diff --git a/src/api/models/TestcaseSummaries.ts b/src/api/models/TestcaseSummaries.ts new file mode 100644 index 0000000..57a6947 --- /dev/null +++ b/src/api/models/TestcaseSummaries.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TestcaseSummary } from './TestcaseSummary'; +import { + TestcaseSummaryFromJSON, + TestcaseSummaryFromJSONTyped, + TestcaseSummaryToJSON, + TestcaseSummaryToJSONTyped, +} from './TestcaseSummary'; + +/** + * + * @export + * @interface TestcaseSummaries + */ +export interface TestcaseSummaries { + /** + * + * @type {Array} + * @memberof TestcaseSummaries + */ + testcaseSummaries?: Array; +} + +/** + * Check if a given object implements the TestcaseSummaries interface. + */ +export function instanceOfTestcaseSummaries(value: object): value is TestcaseSummaries { + return true; +} + +export function TestcaseSummariesFromJSON(json: any): TestcaseSummaries { + return TestcaseSummariesFromJSONTyped(json, false); +} + +export function TestcaseSummariesFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestcaseSummaries { + if (json == null) { + return json; + } + return { + + 'testcaseSummaries': json['testcaseSummaries'] == null ? undefined : ((json['testcaseSummaries'] as Array).map(TestcaseSummaryFromJSON)), + }; +} + + export function TestcaseSummariesToJSON(json: any): TestcaseSummaries { + return TestcaseSummariesToJSONTyped(json, false); + } + + export function TestcaseSummariesToJSONTyped(value?: TestcaseSummaries | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'testcaseSummaries': value['testcaseSummaries'] == null ? undefined : ((value['testcaseSummaries'] as Array).map(TestcaseSummaryToJSON)), + }; +} + diff --git a/src/api/models/TestcaseSummary.ts b/src/api/models/TestcaseSummary.ts new file mode 100644 index 0000000..624fa97 --- /dev/null +++ b/src/api/models/TestcaseSummary.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface TestcaseSummary + */ +export interface TestcaseSummary { + /** + * + * @type {string} + * @memberof TestcaseSummary + */ + id?: string; + /** + * + * @type {string} + * @memberof TestcaseSummary + */ + name?: string; + /** + * + * @type {Date} + * @memberof TestcaseSummary + */ + createdAt?: Date; + /** + * + * @type {Date} + * @memberof TestcaseSummary + */ + updatedAt?: Date; +} + +/** + * Check if a given object implements the TestcaseSummary interface. + */ +export function instanceOfTestcaseSummary(value: object): value is TestcaseSummary { + return true; +} + +export function TestcaseSummaryFromJSON(json: any): TestcaseSummary { + return TestcaseSummaryFromJSONTyped(json, false); +} + +export function TestcaseSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestcaseSummary { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + }; +} + + export function TestcaseSummaryToJSON(json: any): TestcaseSummary { + return TestcaseSummaryToJSONTyped(json, false); + } + + export function TestcaseSummaryToJSONTyped(value?: TestcaseSummary | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()), + 'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()), + }; +} + diff --git a/src/api/models/User.ts b/src/api/models/User.ts new file mode 100644 index 0000000..051cee5 --- /dev/null +++ b/src/api/models/User.ts @@ -0,0 +1,190 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Role } from './Role'; +import { + RoleFromJSON, + RoleFromJSONTyped, + RoleToJSON, + RoleToJSONTyped, +} from './Role'; +import type { SubmissionSummaries } from './SubmissionSummaries'; +import { + SubmissionSummariesFromJSON, + SubmissionSummariesFromJSONTyped, + SubmissionSummariesToJSON, + SubmissionSummariesToJSONTyped, +} from './SubmissionSummaries'; +import type { ProblemSummaries } from './ProblemSummaries'; +import { + ProblemSummariesFromJSON, + ProblemSummariesFromJSONTyped, + ProblemSummariesToJSON, + ProblemSummariesToJSONTyped, +} from './ProblemSummaries'; + +/** + * ユーザー情報 + * @export + * @interface User + */ +export interface User { + /** + * ユーザーID + * @type {string} + * @memberof User + */ + id: string; + /** + * ユーザー名 + * @type {string} + * @memberof User + */ + name: string; + /** + * traQのID + * @type {string} + * @memberof User + */ + traqId?: string; + /** + * GitHubのID + * @type {string} + * @memberof User + */ + githubId?: string; + /** + * + * @type {string} + * @memberof User + */ + iconUrl?: string; + /** + * + * @type {ProblemSummaries} + * @memberof User + */ + postProblems?: ProblemSummaries; + /** + * + * @type {SubmissionSummaries} + * @memberof User + */ + submitProblems?: SubmissionSummaries; + /** + * + * @type {string} + * @memberof User + */ + xLink?: string; + /** + * + * @type {string} + * @memberof User + */ + githubLink?: string; + /** + * + * @type {string} + * @memberof User + */ + selfIntroduction?: string; + /** + * + * @type {Role} + * @memberof User + */ + role: Role; + /** + * + * @type {Date} + * @memberof User + */ + createdAt: Date; + /** + * + * @type {Date} + * @memberof User + */ + updatedAt: Date; +} + + + +/** + * Check if a given object implements the User interface. + */ +export function instanceOfUser(value: object): value is User { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('role' in value) || value['role'] === undefined) return false; + if (!('createdAt' in value) || value['createdAt'] === undefined) return false; + if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; + return true; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'traqId': json['traqId'] == null ? undefined : json['traqId'], + 'githubId': json['githubId'] == null ? undefined : json['githubId'], + 'iconUrl': json['iconUrl'] == null ? undefined : json['iconUrl'], + 'postProblems': json['postProblems'] == null ? undefined : ProblemSummariesFromJSON(json['postProblems']), + 'submitProblems': json['submitProblems'] == null ? undefined : SubmissionSummariesFromJSON(json['submitProblems']), + 'xLink': json['xLink'] == null ? undefined : json['xLink'], + 'githubLink': json['githubLink'] == null ? undefined : json['githubLink'], + 'selfIntroduction': json['selfIntroduction'] == null ? undefined : json['selfIntroduction'], + 'role': RoleFromJSON(json['role']), + 'createdAt': (new Date(json['createdAt'])), + 'updatedAt': (new Date(json['updatedAt'])), + }; +} + + export function UserToJSON(json: any): User { + return UserToJSONTyped(json, false); + } + + export function UserToJSONTyped(value?: User | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'traqId': value['traqId'], + 'githubId': value['githubId'], + 'iconUrl': value['iconUrl'], + 'postProblems': ProblemSummariesToJSON(value['postProblems']), + 'submitProblems': SubmissionSummariesToJSON(value['submitProblems']), + 'xLink': value['xLink'], + 'githubLink': value['githubLink'], + 'selfIntroduction': value['selfIntroduction'], + 'role': RoleToJSON(value['role']), + 'createdAt': ((value['createdAt']).toISOString()), + 'updatedAt': ((value['updatedAt']).toISOString()), + }; +} + diff --git a/src/api/models/UserEmailAndPassword.ts b/src/api/models/UserEmailAndPassword.ts new file mode 100644 index 0000000..32c49b1 --- /dev/null +++ b/src/api/models/UserEmailAndPassword.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * login + * @export + * @interface UserEmailAndPassword + */ +export interface UserEmailAndPassword { + /** + * + * @type {string} + * @memberof UserEmailAndPassword + */ + email: string; + /** + * + * @type {string} + * @memberof UserEmailAndPassword + */ + password: string; +} + +/** + * Check if a given object implements the UserEmailAndPassword interface. + */ +export function instanceOfUserEmailAndPassword(value: object): value is UserEmailAndPassword { + if (!('email' in value) || value['email'] === undefined) return false; + if (!('password' in value) || value['password'] === undefined) return false; + return true; +} + +export function UserEmailAndPasswordFromJSON(json: any): UserEmailAndPassword { + return UserEmailAndPasswordFromJSONTyped(json, false); +} + +export function UserEmailAndPasswordFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserEmailAndPassword { + if (json == null) { + return json; + } + return { + + 'email': json['email'], + 'password': json['password'], + }; +} + + export function UserEmailAndPasswordToJSON(json: any): UserEmailAndPassword { + return UserEmailAndPasswordToJSONTyped(json, false); + } + + export function UserEmailAndPasswordToJSONTyped(value?: UserEmailAndPassword | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'email': value['email'], + 'password': value['password'], + }; +} + diff --git a/src/api/models/index.ts b/src/api/models/index.ts new file mode 100644 index 0000000..85031c1 --- /dev/null +++ b/src/api/models/index.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './Editorial'; +export * from './EditorialSummary'; +export * from './Email'; +export * from './GetGoogleAuthParams200Response'; +export * from './GetGoogleAuthParams500Response'; +export * from './JudgeResult'; +export * from './JudgeStatus'; +export * from './Language'; +export * from './PostEditorialRequest'; +export * from './PostProblemRequest'; +export * from './PostSubmissionRequest'; +export * from './PostTestcaseRequestInner'; +export * from './Problem'; +export * from './ProblemSummaries'; +export * from './ProblemSummary'; +export * from './PutEditorialRequest'; +export * from './PutMeRequest'; +export * from './PutPasswordRequest'; +export * from './PutProblemRequest'; +export * from './PutTestcaseRequest'; +export * from './ResetPasswordRequest'; +export * from './RevokeTraqAuth400Response'; +export * from './RevokeTraqAuthRequest'; +export * from './Role'; +export * from './Signup'; +export * from './SignupRequest'; +export * from './Submission'; +export * from './SubmissionSummaries'; +export * from './SubmissionSummary'; +export * from './Testcase'; +export * from './TestcaseSummaries'; +export * from './TestcaseSummary'; +export * from './User'; +export * from './UserEmailAndPassword'; diff --git a/src/api/runtime.ts b/src/api/runtime.ts new file mode 100644 index 0000000..82d88e5 --- /dev/null +++ b/src/api/runtime.ts @@ -0,0 +1,431 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * traO Judge API + * traO Judge API (front ↔ back) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} From a1efae6f369574b38761544aad07cfb6f5d0351e Mon Sep 17 00:00:00 2001 From: ZOI-dayo Date: Mon, 4 Nov 2024 00:18:22 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E8=87=AA=E5=8B=95=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92Prettier=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E3=81=8B=E3=82=89=E9=99=A4=E5=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..bc7f45b --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +src/api/ \ No newline at end of file From 811ff710bc24b81f74bb52ec154465b5325453c0 Mon Sep 17 00:00:00 2001 From: ZOI-dayo Date: Tue, 12 Nov 2024 10:10:32 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E8=87=AA=E5=8B=95=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92git=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=A4=96=E3=81=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + src/api/.openapi-generator-ignore | 23 - src/api/.openapi-generator/FILES | 49 -- src/api/.openapi-generator/VERSION | 1 - src/api/apis/AuthenticationApi.ts | 249 ---------- src/api/apis/EditorialsApi.ts | 240 ---------- src/api/apis/EmailApi.ts | 63 --- src/api/apis/LanguageApi.ts | 58 --- src/api/apis/MeApi.ts | 170 ------- src/api/apis/Oauth2Api.ts | 218 --------- src/api/apis/ProblemsApi.ts | 262 ----------- src/api/apis/SubmissionsApi.ts | 209 --------- src/api/apis/TestcasesApi.ts | 247 ---------- src/api/apis/UsersApi.ts | 69 --- src/api/apis/index.ts | 12 - src/api/index.ts | 5 - src/api/models/Editorial.ts | 113 ----- src/api/models/EditorialSummary.ts | 100 ---- src/api/models/Email.ts | 66 --- .../models/GetGoogleAuthParams200Response.ts | 66 --- .../models/GetGoogleAuthParams500Response.ts | 65 --- src/api/models/JudgeResult.ts | 120 ----- src/api/models/JudgeStatus.ts | 68 --- src/api/models/Language.ts | 75 --- src/api/models/PostEditorialRequest.ts | 78 ---- src/api/models/PostProblemRequest.ts | 102 ----- src/api/models/PostSubmissionRequest.ts | 73 --- src/api/models/PostTestcaseRequestInner.ts | 84 ---- src/api/models/Problem.ts | 176 ------- src/api/models/ProblemSummaries.ts | 83 ---- src/api/models/ProblemSummary.ts | 150 ------ src/api/models/PutEditorialRequest.ts | 73 --- src/api/models/PutMeRequest.ts | 97 ---- src/api/models/PutPasswordRequest.ts | 75 --- src/api/models/PutProblemRequest.ts | 113 ----- src/api/models/PutTestcaseRequest.ts | 84 ---- src/api/models/ResetPasswordRequest.ts | 75 --- src/api/models/RevokeTraqAuth400Response.ts | 65 --- src/api/models/RevokeTraqAuthRequest.ts | 66 --- src/api/models/Role.ts | 58 --- src/api/models/Signup.ts | 84 ---- src/api/models/SignupRequest.ts | 66 --- src/api/models/Submission.ts | 179 -------- src/api/models/SubmissionSummaries.ts | 81 ---- src/api/models/SubmissionSummary.ts | 166 ------- src/api/models/Testcase.ts | 111 ----- src/api/models/TestcaseSummaries.ts | 73 --- src/api/models/TestcaseSummary.ts | 89 ---- src/api/models/User.ts | 190 -------- src/api/models/UserEmailAndPassword.ts | 75 --- src/api/models/index.ts | 36 -- src/api/runtime.ts | 431 ------------------ 52 files changed, 2 insertions(+), 5581 deletions(-) delete mode 100644 src/api/.openapi-generator-ignore delete mode 100644 src/api/.openapi-generator/FILES delete mode 100644 src/api/.openapi-generator/VERSION delete mode 100644 src/api/apis/AuthenticationApi.ts delete mode 100644 src/api/apis/EditorialsApi.ts delete mode 100644 src/api/apis/EmailApi.ts delete mode 100644 src/api/apis/LanguageApi.ts delete mode 100644 src/api/apis/MeApi.ts delete mode 100644 src/api/apis/Oauth2Api.ts delete mode 100644 src/api/apis/ProblemsApi.ts delete mode 100644 src/api/apis/SubmissionsApi.ts delete mode 100644 src/api/apis/TestcasesApi.ts delete mode 100644 src/api/apis/UsersApi.ts delete mode 100644 src/api/apis/index.ts delete mode 100644 src/api/index.ts delete mode 100644 src/api/models/Editorial.ts delete mode 100644 src/api/models/EditorialSummary.ts delete mode 100644 src/api/models/Email.ts delete mode 100644 src/api/models/GetGoogleAuthParams200Response.ts delete mode 100644 src/api/models/GetGoogleAuthParams500Response.ts delete mode 100644 src/api/models/JudgeResult.ts delete mode 100644 src/api/models/JudgeStatus.ts delete mode 100644 src/api/models/Language.ts delete mode 100644 src/api/models/PostEditorialRequest.ts delete mode 100644 src/api/models/PostProblemRequest.ts delete mode 100644 src/api/models/PostSubmissionRequest.ts delete mode 100644 src/api/models/PostTestcaseRequestInner.ts delete mode 100644 src/api/models/Problem.ts delete mode 100644 src/api/models/ProblemSummaries.ts delete mode 100644 src/api/models/ProblemSummary.ts delete mode 100644 src/api/models/PutEditorialRequest.ts delete mode 100644 src/api/models/PutMeRequest.ts delete mode 100644 src/api/models/PutPasswordRequest.ts delete mode 100644 src/api/models/PutProblemRequest.ts delete mode 100644 src/api/models/PutTestcaseRequest.ts delete mode 100644 src/api/models/ResetPasswordRequest.ts delete mode 100644 src/api/models/RevokeTraqAuth400Response.ts delete mode 100644 src/api/models/RevokeTraqAuthRequest.ts delete mode 100644 src/api/models/Role.ts delete mode 100644 src/api/models/Signup.ts delete mode 100644 src/api/models/SignupRequest.ts delete mode 100644 src/api/models/Submission.ts delete mode 100644 src/api/models/SubmissionSummaries.ts delete mode 100644 src/api/models/SubmissionSummary.ts delete mode 100644 src/api/models/Testcase.ts delete mode 100644 src/api/models/TestcaseSummaries.ts delete mode 100644 src/api/models/TestcaseSummary.ts delete mode 100644 src/api/models/User.ts delete mode 100644 src/api/models/UserEmailAndPassword.ts delete mode 100644 src/api/models/index.ts delete mode 100644 src/api/runtime.ts diff --git a/.gitignore b/.gitignore index 8ee54e8..b3e890d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ coverage *.sw? *.tsbuildinfo + +src/api diff --git a/src/api/.openapi-generator-ignore b/src/api/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/src/api/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/src/api/.openapi-generator/FILES b/src/api/.openapi-generator/FILES deleted file mode 100644 index b3d7ab3..0000000 --- a/src/api/.openapi-generator/FILES +++ /dev/null @@ -1,49 +0,0 @@ -.openapi-generator-ignore -apis/AuthenticationApi.ts -apis/EditorialsApi.ts -apis/EmailApi.ts -apis/LanguageApi.ts -apis/MeApi.ts -apis/Oauth2Api.ts -apis/ProblemsApi.ts -apis/SubmissionsApi.ts -apis/TestcasesApi.ts -apis/UsersApi.ts -apis/index.ts -index.ts -models/Editorial.ts -models/EditorialSummary.ts -models/Email.ts -models/GetGoogleAuthParams200Response.ts -models/GetGoogleAuthParams500Response.ts -models/JudgeResult.ts -models/JudgeStatus.ts -models/Language.ts -models/PostEditorialRequest.ts -models/PostProblemRequest.ts -models/PostSubmissionRequest.ts -models/PostTestcaseRequestInner.ts -models/Problem.ts -models/ProblemSummaries.ts -models/ProblemSummary.ts -models/PutEditorialRequest.ts -models/PutMeRequest.ts -models/PutPasswordRequest.ts -models/PutProblemRequest.ts -models/PutTestcaseRequest.ts -models/ResetPasswordRequest.ts -models/RevokeTraqAuth400Response.ts -models/RevokeTraqAuthRequest.ts -models/Role.ts -models/Signup.ts -models/SignupRequest.ts -models/Submission.ts -models/SubmissionSummaries.ts -models/SubmissionSummary.ts -models/Testcase.ts -models/TestcaseSummaries.ts -models/TestcaseSummary.ts -models/User.ts -models/UserEmailAndPassword.ts -models/index.ts -runtime.ts diff --git a/src/api/.openapi-generator/VERSION b/src/api/.openapi-generator/VERSION deleted file mode 100644 index 6935482..0000000 --- a/src/api/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.10.0-SNAPSHOT diff --git a/src/api/apis/AuthenticationApi.ts b/src/api/apis/AuthenticationApi.ts deleted file mode 100644 index 88e481d..0000000 --- a/src/api/apis/AuthenticationApi.ts +++ /dev/null @@ -1,249 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - Email, - ResetPasswordRequest, - Signup, - SignupRequest, - UserEmailAndPassword, -} from '../models/index'; -import { - EmailFromJSON, - EmailToJSON, - ResetPasswordRequestFromJSON, - ResetPasswordRequestToJSON, - SignupFromJSON, - SignupToJSON, - SignupRequestFromJSON, - SignupRequestToJSON, - UserEmailAndPasswordFromJSON, - UserEmailAndPasswordToJSON, -} from '../models/index'; - -export interface PostLoginRequest { - userEmailAndPassword?: UserEmailAndPassword; -} - -export interface PostRequestResetPasswordRequest { - email?: Email; -} - -export interface PostResetPasswordRequest { - tokenWithUserid?: string; - resetPasswordRequest?: ResetPasswordRequest; -} - -export interface PostSignupRequest { - tokenWithoutUserid?: string; - signup?: Signup; -} - -export interface PostSignupRequestRequest { - signupRequest?: SignupRequest; -} - -/** - * - */ -export class AuthenticationApi extends runtime.BaseAPI { - - /** - * ログイン - * postLogin - */ - async postLoginRaw(requestParameters: PostLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/login`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: UserEmailAndPasswordToJSON(requestParameters['userEmailAndPassword']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * ログイン - * postLogin - */ - async postLogin(requestParameters: PostLoginRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.postLoginRaw(requestParameters, initOverrides); - } - - /** - * ログアウト - * postLogout - */ - async postLogoutRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/logout`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * ログアウト - * postLogout - */ - async postLogout(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.postLogoutRaw(initOverrides); - } - - /** - * パスワード変更のリクエスト リクエストを受け取ったら`/reset-password?token=JWT`のような形式のエンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそれをクリックするとリセット用画面に遷移する。 - * postResetPasswordReset - */ - async postRequestResetPasswordRaw(requestParameters: PostRequestResetPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/reset-password/request`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: EmailToJSON(requestParameters['email']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * パスワード変更のリクエスト リクエストを受け取ったら`/reset-password?token=JWT`のような形式のエンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそれをクリックするとリセット用画面に遷移する。 - * postResetPasswordReset - */ - async postRequestResetPassword(requestParameters: PostRequestResetPasswordRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.postRequestResetPasswordRaw(requestParameters, initOverrides); - } - - /** - * 新しいパスワードをPOSTする - * postResetPassword - */ - async postResetPasswordRaw(requestParameters: PostResetPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters['tokenWithUserid'] != null) { - queryParameters['token-with-userid'] = requestParameters['tokenWithUserid']; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/reset-password`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: ResetPasswordRequestToJSON(requestParameters['resetPasswordRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * 新しいパスワードをPOSTする - * postResetPassword - */ - async postResetPassword(requestParameters: PostResetPasswordRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.postResetPasswordRaw(requestParameters, initOverrides); - } - - /** - * email+passwordによるユーザー登録 クエリパラメタにtokenを持ち,それでメール情報を管理する リクエストを受け取ったら`/activate?payload=JWT`のような形式のメール有効化用エンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそのアドレスをクリックしたら,メール有効化処理をし,適切に終了したらログイン画面にリダイレクトする。 - * postSignup - */ - async postSignupRaw(requestParameters: PostSignupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters['tokenWithoutUserid'] != null) { - queryParameters['token-without-userid'] = requestParameters['tokenWithoutUserid']; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/signup`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: SignupToJSON(requestParameters['signup']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * email+passwordによるユーザー登録 クエリパラメタにtokenを持ち,それでメール情報を管理する リクエストを受け取ったら`/activate?payload=JWT`のような形式のメール有効化用エンドポイントを含むメールをバックエンドからユーザーに送る。 ユーザーがそのアドレスをクリックしたら,メール有効化処理をし,適切に終了したらログイン画面にリダイレクトする。 - * postSignup - */ - async postSignup(requestParameters: PostSignupRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.postSignupRaw(requestParameters, initOverrides); - } - - /** - * メールアドレスを渡し,そこに認証用のリンクを送る。 - * postSignupRequest - */ - async postSignupRequestRaw(requestParameters: PostSignupRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/signup/request`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: SignupRequestToJSON(requestParameters['signupRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * メールアドレスを渡し,そこに認証用のリンクを送る。 - * postSignupRequest - */ - async postSignupRequest(requestParameters: PostSignupRequestRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.postSignupRequestRaw(requestParameters, initOverrides); - } - -} diff --git a/src/api/apis/EditorialsApi.ts b/src/api/apis/EditorialsApi.ts deleted file mode 100644 index 1a1c5bc..0000000 --- a/src/api/apis/EditorialsApi.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - Editorial, - EditorialSummary, - PostEditorialRequest, - PutEditorialRequest, -} from '../models/index'; -import { - EditorialFromJSON, - EditorialToJSON, - EditorialSummaryFromJSON, - EditorialSummaryToJSON, - PostEditorialRequestFromJSON, - PostEditorialRequestToJSON, - PutEditorialRequestFromJSON, - PutEditorialRequestToJSON, -} from '../models/index'; - -export interface DeleteEditorialRequest { - editorialId: string; -} - -export interface GetEditorialRequest { - editorialId: string; -} - -export interface GetEditorialsOnProblemRequest { - problemId: string; -} - -export interface PostEditorialOperationRequest { - problemId: string; - postEditorialRequest?: PostEditorialRequest; -} - -export interface PutEditorialOperationRequest { - editorialId: string; - putEditorialRequest?: PutEditorialRequest; -} - -/** - * - */ -export class EditorialsApi extends runtime.BaseAPI { - - /** - * 個別の解説を削除する - * deleteEditorial - */ - async deleteEditorialRaw(requestParameters: DeleteEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['editorialId'] == null) { - throw new runtime.RequiredError( - 'editorialId', - 'Required parameter "editorialId" was null or undefined when calling deleteEditorial().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/editorials/{editorialId}`.replace(`{${"editorialId"}}`, encodeURIComponent(String(requestParameters['editorialId']))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * 個別の解説を削除する - * deleteEditorial - */ - async deleteEditorial(requestParameters: DeleteEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.deleteEditorialRaw(requestParameters, initOverrides); - } - - /** - * 個別の解説を取得する - * getEditorial - */ - async getEditorialRaw(requestParameters: GetEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['editorialId'] == null) { - throw new runtime.RequiredError( - 'editorialId', - 'Required parameter "editorialId" was null or undefined when calling getEditorial().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/editorials/{editorialId}`.replace(`{${"editorialId"}}`, encodeURIComponent(String(requestParameters['editorialId']))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => EditorialFromJSON(jsonValue)); - } - - /** - * 個別の解説を取得する - * getEditorial - */ - async getEditorial(requestParameters: GetEditorialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getEditorialRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * ある問題の全ての解説を取得する - * getEditorialsOnProblem - */ - async getEditorialsOnProblemRaw(requestParameters: GetEditorialsOnProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling getEditorialsOnProblem().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/problems/{problemId}/editorials`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(EditorialSummaryFromJSON)); - } - - /** - * ある問題の全ての解説を取得する - * getEditorialsOnProblem - */ - async getEditorialsOnProblem(requestParameters: GetEditorialsOnProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const response = await this.getEditorialsOnProblemRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 解説を投稿する - * postEditorial - */ - async postEditorialRaw(requestParameters: PostEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling postEditorial().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/problems/{problemId}/editorials`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: PostEditorialRequestToJSON(requestParameters['postEditorialRequest']), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => EditorialFromJSON(jsonValue)); - } - - /** - * 解説を投稿する - * postEditorial - */ - async postEditorial(requestParameters: PostEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.postEditorialRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 個別の解説を変更する - * putEditorial - */ - async putEditorialRaw(requestParameters: PutEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['editorialId'] == null) { - throw new runtime.RequiredError( - 'editorialId', - 'Required parameter "editorialId" was null or undefined when calling putEditorial().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/editorials/{editorialId}`.replace(`{${"editorialId"}}`, encodeURIComponent(String(requestParameters['editorialId']))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: PutEditorialRequestToJSON(requestParameters['putEditorialRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * 個別の解説を変更する - * putEditorial - */ - async putEditorial(requestParameters: PutEditorialOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.putEditorialRaw(requestParameters, initOverrides); - } - -} diff --git a/src/api/apis/EmailApi.ts b/src/api/apis/EmailApi.ts deleted file mode 100644 index 6f9a3ac..0000000 --- a/src/api/apis/EmailApi.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; - -export interface GetActivateRequest { - tokenWithUserid?: string; - tokenWithoutUserid?: string; -} - -/** - * - */ -export class EmailApi extends runtime.BaseAPI { - - /** - * メールアドレスの有効化 - * getActivateEmailAddress - */ - async getActivateRaw(requestParameters: GetActivateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters['tokenWithUserid'] != null) { - queryParameters['token-with-userid'] = requestParameters['tokenWithUserid']; - } - - if (requestParameters['tokenWithoutUserid'] != null) { - queryParameters['token-without-userid'] = requestParameters['tokenWithoutUserid']; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/activate`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * メールアドレスの有効化 - * getActivateEmailAddress - */ - async getActivate(requestParameters: GetActivateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.getActivateRaw(requestParameters, initOverrides); - } - -} diff --git a/src/api/apis/LanguageApi.ts b/src/api/apis/LanguageApi.ts deleted file mode 100644 index bfe6715..0000000 --- a/src/api/apis/LanguageApi.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - Language, -} from '../models/index'; -import { - LanguageFromJSON, - LanguageToJSON, -} from '../models/index'; - -/** - * - */ -export class LanguageApi extends runtime.BaseAPI { - - /** - * 使用できる言語の一覧 - * getLanguages - */ - async getLanguagesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/languages`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LanguageFromJSON)); - } - - /** - * 使用できる言語の一覧 - * getLanguages - */ - async getLanguages(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const response = await this.getLanguagesRaw(initOverrides); - return await response.value(); - } - -} diff --git a/src/api/apis/MeApi.ts b/src/api/apis/MeApi.ts deleted file mode 100644 index 03688ee..0000000 --- a/src/api/apis/MeApi.ts +++ /dev/null @@ -1,170 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - Email, - PutMeRequest, - PutPasswordRequest, - User, -} from '../models/index'; -import { - EmailFromJSON, - EmailToJSON, - PutMeRequestFromJSON, - PutMeRequestToJSON, - PutPasswordRequestFromJSON, - PutPasswordRequestToJSON, - UserFromJSON, - UserToJSON, -} from '../models/index'; - -export interface PutMeEmailRequest { - email?: Email; -} - -export interface PutUsersMeIconRequest { - putMeRequest?: PutMeRequest; -} - -export interface PutUsersMePasswordRequest { - putPasswordRequest?: PutPasswordRequest; -} - -/** - * - */ -export class MeApi extends runtime.BaseAPI { - - /** - * 自身の情報を取得する - * getMe - */ - async getMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/users/me`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); - } - - /** - * 自身の情報を取得する - * getMe - */ - async getMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getMeRaw(initOverrides); - return await response.value(); - } - - /** - * メール情報を書き換える メール情報を書き換えた後はメール認証が必要である - * putMeEmail - */ - async putMeEmailRaw(requestParameters: PutMeEmailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/users/me/email`, - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: EmailToJSON(requestParameters['email']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * メール情報を書き換える メール情報を書き換えた後はメール認証が必要である - * putMeEmail - */ - async putMeEmail(requestParameters: PutMeEmailRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.putMeEmailRaw(requestParameters, initOverrides); - } - - /** - * アイコンなど自身に関連する情報の編集をします - * putMe - */ - async putUsersMeIconRaw(requestParameters: PutUsersMeIconRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/users/me`, - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: PutMeRequestToJSON(requestParameters['putMeRequest']), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); - } - - /** - * アイコンなど自身に関連する情報の編集をします - * putMe - */ - async putUsersMeIcon(requestParameters: PutUsersMeIconRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.putUsersMeIconRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * ログイン後にパスワードを変更する - * putUserMePassword - */ - async putUsersMePasswordRaw(requestParameters: PutUsersMePasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/users/me/password`, - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: PutPasswordRequestToJSON(requestParameters['putPasswordRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * ログイン後にパスワードを変更する - * putUserMePassword - */ - async putUsersMePassword(requestParameters: PutUsersMePasswordRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.putUsersMePasswordRaw(requestParameters, initOverrides); - } - -} diff --git a/src/api/apis/Oauth2Api.ts b/src/api/apis/Oauth2Api.ts deleted file mode 100644 index 9c74ad9..0000000 --- a/src/api/apis/Oauth2Api.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - GetGoogleAuthParams200Response, - GetGoogleAuthParams500Response, - RevokeTraqAuth400Response, - RevokeTraqAuthRequest, -} from '../models/index'; -import { - GetGoogleAuthParams200ResponseFromJSON, - GetGoogleAuthParams200ResponseToJSON, - GetGoogleAuthParams500ResponseFromJSON, - GetGoogleAuthParams500ResponseToJSON, - RevokeTraqAuth400ResponseFromJSON, - RevokeTraqAuth400ResponseToJSON, - RevokeTraqAuthRequestFromJSON, - RevokeTraqAuthRequestToJSON, -} from '../models/index'; - -export interface RevokeGithubAuthRequest { - revokeTraqAuthRequest: RevokeTraqAuthRequest; -} - -export interface RevokeGoogleAuthRequest { - revokeTraqAuthRequest: RevokeTraqAuthRequest; -} - -export interface RevokeTraqAuthOperationRequest { - revokeTraqAuthRequest: RevokeTraqAuthRequest; -} - -/** - * - */ -export class Oauth2Api extends runtime.BaseAPI { - - /** - * GoogleOAuthのためのエンドポイント - * getGoogleOAuth2Params - */ - async getGoogleAuthParamsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/google-oauth2/params`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => GetGoogleAuthParams200ResponseFromJSON(jsonValue)); - } - - /** - * GoogleOAuthのためのエンドポイント - * getGoogleOAuth2Params - */ - async getGoogleAuthParams(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getGoogleAuthParamsRaw(initOverrides); - return await response.value(); - } - - /** - * GitHubOAuthのためのエンドポイント - * getGithubOAuth2Params - */ - async getgithubAuthParamsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/github-oauth2/params`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => GetGoogleAuthParams200ResponseFromJSON(jsonValue)); - } - - /** - * GitHubOAuthのためのエンドポイント - * getGithubOAuth2Params - */ - async getgithubAuthParams(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getgithubAuthParamsRaw(initOverrides); - return await response.value(); - } - - /** - * GithubOAuthのトークンを削除する - * postGithubOAuth2Revoke - */ - async revokeGithubAuthRaw(requestParameters: RevokeGithubAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['revokeTraqAuthRequest'] == null) { - throw new runtime.RequiredError( - 'revokeTraqAuthRequest', - 'Required parameter "revokeTraqAuthRequest" was null or undefined when calling revokeGithubAuth().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/github-oauth2/revoke`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: RevokeTraqAuthRequestToJSON(requestParameters['revokeTraqAuthRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * GithubOAuthのトークンを削除する - * postGithubOAuth2Revoke - */ - async revokeGithubAuth(requestParameters: RevokeGithubAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.revokeGithubAuthRaw(requestParameters, initOverrides); - } - - /** - * GoogleOAuthのトークンを削除する - * postGoogleOAuth2Revoke - */ - async revokeGoogleAuthRaw(requestParameters: RevokeGoogleAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['revokeTraqAuthRequest'] == null) { - throw new runtime.RequiredError( - 'revokeTraqAuthRequest', - 'Required parameter "revokeTraqAuthRequest" was null or undefined when calling revokeGoogleAuth().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/google-oauth2/revoke`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: RevokeTraqAuthRequestToJSON(requestParameters['revokeTraqAuthRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * GoogleOAuthのトークンを削除する - * postGoogleOAuth2Revoke - */ - async revokeGoogleAuth(requestParameters: RevokeGoogleAuthRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.revokeGoogleAuthRaw(requestParameters, initOverrides); - } - - /** - * traQOAuthのトークンを削除する - * postTraqOAuth2Revoke - */ - async revokeTraqAuthRaw(requestParameters: RevokeTraqAuthOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['revokeTraqAuthRequest'] == null) { - throw new runtime.RequiredError( - 'revokeTraqAuthRequest', - 'Required parameter "revokeTraqAuthRequest" was null or undefined when calling revokeTraqAuth().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/traq-oauth2/revoke`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: RevokeTraqAuthRequestToJSON(requestParameters['revokeTraqAuthRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * traQOAuthのトークンを削除する - * postTraqOAuth2Revoke - */ - async revokeTraqAuth(requestParameters: RevokeTraqAuthOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.revokeTraqAuthRaw(requestParameters, initOverrides); - } - -} diff --git a/src/api/apis/ProblemsApi.ts b/src/api/apis/ProblemsApi.ts deleted file mode 100644 index 9c56269..0000000 --- a/src/api/apis/ProblemsApi.ts +++ /dev/null @@ -1,262 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - PostProblemRequest, - Problem, - ProblemSummaries, - PutProblemRequest, -} from '../models/index'; -import { - PostProblemRequestFromJSON, - PostProblemRequestToJSON, - ProblemFromJSON, - ProblemToJSON, - ProblemSummariesFromJSON, - ProblemSummariesToJSON, - PutProblemRequestFromJSON, - PutProblemRequestToJSON, -} from '../models/index'; - -export interface DeleteProblemRequest { - problemId: string; -} - -export interface GetProblemRequest { - problemId: string; -} - -export interface GetProblemsRequest { - limit?: number; - offset?: number; - orderBy?: GetProblemsOrderByEnum; - username?: string; - userId?: string; -} - -export interface PostProblemOperationRequest { - postProblemRequest?: PostProblemRequest; -} - -export interface PutProblemOperationRequest { - problemId: string; - putProblemRequest?: PutProblemRequest; -} - -/** - * - */ -export class ProblemsApi extends runtime.BaseAPI { - - /** - * 問題を削除する - * deleteProblem - */ - async deleteProblemRaw(requestParameters: DeleteProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling deleteProblem().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/problems/{problemId}`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * 問題を削除する - * deleteProblem - */ - async deleteProblem(requestParameters: DeleteProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.deleteProblemRaw(requestParameters, initOverrides); - } - - /** - * 個別の問題を取得する - * getProblem - */ - async getProblemRaw(requestParameters: GetProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling getProblem().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/problems/{problemId}`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProblemFromJSON(jsonValue)); - } - - /** - * 個別の問題を取得する - * getProblem - */ - async getProblem(requestParameters: GetProblemRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getProblemRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 問題一覧を取得する - * getProblems - */ - async getProblemsRaw(requestParameters: GetProblemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters['limit'] != null) { - queryParameters['limit'] = requestParameters['limit']; - } - - if (requestParameters['offset'] != null) { - queryParameters['offset'] = requestParameters['offset']; - } - - if (requestParameters['orderBy'] != null) { - queryParameters['orderBy'] = requestParameters['orderBy']; - } - - if (requestParameters['username'] != null) { - queryParameters['username'] = requestParameters['username']; - } - - if (requestParameters['userId'] != null) { - queryParameters['userId'] = requestParameters['userId']; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/problems`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProblemSummariesFromJSON(jsonValue)); - } - - /** - * 問題一覧を取得する - * getProblems - */ - async getProblems(requestParameters: GetProblemsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getProblemsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 問題を新規作成・投稿する このとき作成された問題は必ず非公開になる 公開する場合は PUT で変更する必要がある - * postProblem - */ - async postProblemRaw(requestParameters: PostProblemOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/problems`, - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: PostProblemRequestToJSON(requestParameters['postProblemRequest']), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => ProblemFromJSON(jsonValue)); - } - - /** - * 問題を新規作成・投稿する このとき作成された問題は必ず非公開になる 公開する場合は PUT で変更する必要がある - * postProblem - */ - async postProblem(requestParameters: PostProblemOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.postProblemRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 問題を修正する - * putProblem - */ - async putProblemRaw(requestParameters: PutProblemOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling putProblem().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/problems/{problemId}`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: PutProblemRequestToJSON(requestParameters['putProblemRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * 問題を修正する - * putProblem - */ - async putProblem(requestParameters: PutProblemOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.putProblemRaw(requestParameters, initOverrides); - } - -} - -/** - * @export - */ -export const GetProblemsOrderByEnum = { - CreatedAtAsc: 'createdAtAsc', - CreatedAtDesc: 'createdAtDesc', - UpdatedAtAsc: 'updatedAtAsc', - UpdatedAtDesc: 'updatedAtDesc', - DifficultyAsc: 'difficultyAsc', - DifficultyDesc: 'difficultyDesc' -} as const; -export type GetProblemsOrderByEnum = typeof GetProblemsOrderByEnum[keyof typeof GetProblemsOrderByEnum]; diff --git a/src/api/apis/SubmissionsApi.ts b/src/api/apis/SubmissionsApi.ts deleted file mode 100644 index eb98d37..0000000 --- a/src/api/apis/SubmissionsApi.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - JudgeStatus, - PostSubmissionRequest, - Submission, - SubmissionSummaries, -} from '../models/index'; -import { - JudgeStatusFromJSON, - JudgeStatusToJSON, - PostSubmissionRequestFromJSON, - PostSubmissionRequestToJSON, - SubmissionFromJSON, - SubmissionToJSON, - SubmissionSummariesFromJSON, - SubmissionSummariesToJSON, -} from '../models/index'; - -export interface GetSubmissionRequest { - submissionId: number; -} - -export interface GetSubmissionsRequest { - orderBy?: GetSubmissionsOrderByEnum; - status?: JudgeStatus; - language?: string; - username?: string; - userId?: string; - limit?: number; - offset?: number; - problemIdInQuery?: string; -} - -export interface PostSubmissionOperationRequest { - problemId: number; - postSubmissionRequest?: PostSubmissionRequest; -} - -/** - * - */ -export class SubmissionsApi extends runtime.BaseAPI { - - /** - * 個別の提出を取得する - * getSubmission - */ - async getSubmissionRaw(requestParameters: GetSubmissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['submissionId'] == null) { - throw new runtime.RequiredError( - 'submissionId', - 'Required parameter "submissionId" was null or undefined when calling getSubmission().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/submissions/{submissionId}`.replace(`{${"submissionId"}}`, encodeURIComponent(String(requestParameters['submissionId']))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionFromJSON(jsonValue)); - } - - /** - * 個別の提出を取得する - * getSubmission - */ - async getSubmission(requestParameters: GetSubmissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getSubmissionRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 全ての提出を取得 - * getSubmissions - */ - async getSubmissionsRaw(requestParameters: GetSubmissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const queryParameters: any = {}; - - if (requestParameters['orderBy'] != null) { - queryParameters['orderBy'] = requestParameters['orderBy']; - } - - if (requestParameters['status'] != null) { - queryParameters['status'] = requestParameters['status']; - } - - if (requestParameters['language'] != null) { - queryParameters['language'] = requestParameters['language']; - } - - if (requestParameters['username'] != null) { - queryParameters['username'] = requestParameters['username']; - } - - if (requestParameters['userId'] != null) { - queryParameters['userId'] = requestParameters['userId']; - } - - if (requestParameters['limit'] != null) { - queryParameters['limit'] = requestParameters['limit']; - } - - if (requestParameters['offset'] != null) { - queryParameters['offset'] = requestParameters['offset']; - } - - if (requestParameters['problemIdInQuery'] != null) { - queryParameters['problemIdInQuery'] = requestParameters['problemIdInQuery']; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/submissions`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionSummariesFromJSON(jsonValue)); - } - - /** - * 全ての提出を取得 - * getSubmissions - */ - async getSubmissions(requestParameters: GetSubmissionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getSubmissionsRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * ソースコードを提出する - * postSubmission - */ - async postSubmissionRaw(requestParameters: PostSubmissionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling postSubmission().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/problems/{problemId}/submissions`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: PostSubmissionRequestToJSON(requestParameters['postSubmissionRequest']), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => SubmissionFromJSON(jsonValue)); - } - - /** - * ソースコードを提出する - * postSubmission - */ - async postSubmission(requestParameters: PostSubmissionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.postSubmissionRaw(requestParameters, initOverrides); - return await response.value(); - } - -} - -/** - * @export - */ -export const GetSubmissionsOrderByEnum = { - SubmittedAtAsc: 'submittedAtAsc', - SubmittedAtDesc: 'submittedAtDesc', - TimeConsumptionAsc: 'timeConsumptionAsc', - TimeConsumptionDesc: 'timeConsumptionDesc', - ScoreAsc: 'scoreAsc', - ScoreDesc: 'scoreDesc', - MemoryConsumptionAsc: 'memoryConsumptionAsc', - MemoryConsumptionDesc: 'memoryConsumptionDesc', - CodeLengthAsc: 'codeLengthAsc', - CodeLengthDesc: 'codeLengthDesc' -} as const; -export type GetSubmissionsOrderByEnum = typeof GetSubmissionsOrderByEnum[keyof typeof GetSubmissionsOrderByEnum]; diff --git a/src/api/apis/TestcasesApi.ts b/src/api/apis/TestcasesApi.ts deleted file mode 100644 index cee2c68..0000000 --- a/src/api/apis/TestcasesApi.ts +++ /dev/null @@ -1,247 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - PostTestcaseRequestInner, - PutTestcaseRequest, - Testcase, - TestcaseSummaries, -} from '../models/index'; -import { - PostTestcaseRequestInnerFromJSON, - PostTestcaseRequestInnerToJSON, - PutTestcaseRequestFromJSON, - PutTestcaseRequestToJSON, - TestcaseFromJSON, - TestcaseToJSON, - TestcaseSummariesFromJSON, - TestcaseSummariesToJSON, -} from '../models/index'; - -export interface DeleteTestcaseRequest { - testcaseId: string; -} - -export interface GetTestcaseRequest { - testcaseId: string; -} - -export interface GetTestcasesRequest { - problemId: string; -} - -export interface PostTestcasesRequest { - problemId: string; - postTestcaseRequestInner?: Array; -} - -export interface PutTestcaseOperationRequest { - testcaseId: string; - putTestcaseRequest: PutTestcaseRequest; -} - -/** - * - */ -export class TestcasesApi extends runtime.BaseAPI { - - /** - * 単一のテストケースの削除 - * deleteTestcase - */ - async deleteTestcaseRaw(requestParameters: DeleteTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['testcaseId'] == null) { - throw new runtime.RequiredError( - 'testcaseId', - 'Required parameter "testcaseId" was null or undefined when calling deleteTestcase().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/testcases/{testcaseId}`.replace(`{${"testcaseId"}}`, encodeURIComponent(String(requestParameters['testcaseId']))), - method: 'DELETE', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * 単一のテストケースの削除 - * deleteTestcase - */ - async deleteTestcase(requestParameters: DeleteTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.deleteTestcaseRaw(requestParameters, initOverrides); - } - - /** - * あるidのテストケースを取得 - * getTestcase - */ - async getTestcaseRaw(requestParameters: GetTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['testcaseId'] == null) { - throw new runtime.RequiredError( - 'testcaseId', - 'Required parameter "testcaseId" was null or undefined when calling getTestcase().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/testcases/{testcaseId}`.replace(`{${"testcaseId"}}`, encodeURIComponent(String(requestParameters['testcaseId']))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => TestcaseFromJSON(jsonValue)); - } - - /** - * あるidのテストケースを取得 - * getTestcase - */ - async getTestcase(requestParameters: GetTestcaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getTestcaseRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 全てのテストケースを取得 - * getTestcases - */ - async getTestcasesRaw(requestParameters: GetTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling getTestcases().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/problems/{problemId}/testcases`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => TestcaseSummariesFromJSON(jsonValue)); - } - - /** - * 全てのテストケースを取得 - * getTestcases - */ - async getTestcases(requestParameters: GetTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getTestcasesRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * テストケースを投稿する - * postTestcases - */ - async postTestcasesRaw(requestParameters: PostTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['problemId'] == null) { - throw new runtime.RequiredError( - 'problemId', - 'Required parameter "problemId" was null or undefined when calling postTestcases().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/problems/{problemId}/testcases`.replace(`{${"problemId"}}`, encodeURIComponent(String(requestParameters['problemId']))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: requestParameters['postTestcaseRequestInner']!.map(PostTestcaseRequestInnerToJSON), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => TestcaseSummariesFromJSON(jsonValue)); - } - - /** - * テストケースを投稿する - * postTestcases - */ - async postTestcases(requestParameters: PostTestcasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.postTestcasesRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - * 単体のテストケースの編集 - * putTestcase - */ - async putTestcaseRaw(requestParameters: PutTestcaseOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['testcaseId'] == null) { - throw new runtime.RequiredError( - 'testcaseId', - 'Required parameter "testcaseId" was null or undefined when calling putTestcase().' - ); - } - - if (requestParameters['putTestcaseRequest'] == null) { - throw new runtime.RequiredError( - 'putTestcaseRequest', - 'Required parameter "putTestcaseRequest" was null or undefined when calling putTestcase().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - const response = await this.request({ - path: `/testcases/{testcaseId}`.replace(`{${"testcaseId"}}`, encodeURIComponent(String(requestParameters['testcaseId']))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: PutTestcaseRequestToJSON(requestParameters['putTestcaseRequest']), - }, initOverrides); - - return new runtime.VoidApiResponse(response); - } - - /** - * 単体のテストケースの編集 - * putTestcase - */ - async putTestcase(requestParameters: PutTestcaseOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.putTestcaseRaw(requestParameters, initOverrides); - } - -} diff --git a/src/api/apis/UsersApi.ts b/src/api/apis/UsersApi.ts deleted file mode 100644 index 09a83a9..0000000 --- a/src/api/apis/UsersApi.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import * as runtime from '../runtime'; -import type { - User, -} from '../models/index'; -import { - UserFromJSON, - UserToJSON, -} from '../models/index'; - -export interface GetUserRequest { - userId: string; -} - -/** - * - */ -export class UsersApi extends runtime.BaseAPI { - - /** - * 個別のユーザー情報を取得する - * getUser - */ - async getUserRaw(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters['userId'] == null) { - throw new runtime.RequiredError( - 'userId', - 'Required parameter "userId" was null or undefined when calling getUser().' - ); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - const response = await this.request({ - path: `/users/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId']))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); - } - - /** - * 個別のユーザー情報を取得する - * getUser - */ - async getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.getUserRaw(requestParameters, initOverrides); - return await response.value(); - } - -} diff --git a/src/api/apis/index.ts b/src/api/apis/index.ts deleted file mode 100644 index 98adf2e..0000000 --- a/src/api/apis/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -export * from './AuthenticationApi'; -export * from './EditorialsApi'; -export * from './EmailApi'; -export * from './LanguageApi'; -export * from './MeApi'; -export * from './Oauth2Api'; -export * from './ProblemsApi'; -export * from './SubmissionsApi'; -export * from './TestcasesApi'; -export * from './UsersApi'; diff --git a/src/api/index.ts b/src/api/index.ts deleted file mode 100644 index bebe8bb..0000000 --- a/src/api/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -export * from './runtime'; -export * from './apis/index'; -export * from './models/index'; diff --git a/src/api/models/Editorial.ts b/src/api/models/Editorial.ts deleted file mode 100644 index 96de252..0000000 --- a/src/api/models/Editorial.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 解説の詳細 - * @export - * @interface Editorial - */ -export interface Editorial { - /** - * 解説ID - * @type {number} - * @memberof Editorial - */ - id: number; - /** - * 作成日時 - * @type {Date} - * @memberof Editorial - */ - createdAt: Date; - /** - * 更新日時 - * @type {Date} - * @memberof Editorial - */ - updatedAt?: Date; - /** - * 投稿者のユーザーID - * @type {number} - * @memberof Editorial - */ - authorId: number; - /** - * 解説本文 (HTML) - * @type {string} - * @memberof Editorial - */ - statement: string; - /** - * 解説が全体公開かどうか. - * - * * `true` - 公開 - * * `false` - 非公開 (問題の作者のみ閲覧可) - * @type {boolean} - * @memberof Editorial - */ - isPublic: boolean; -} - -/** - * Check if a given object implements the Editorial interface. - */ -export function instanceOfEditorial(value: object): value is Editorial { - if (!('id' in value) || value['id'] === undefined) return false; - if (!('createdAt' in value) || value['createdAt'] === undefined) return false; - if (!('authorId' in value) || value['authorId'] === undefined) return false; - if (!('statement' in value) || value['statement'] === undefined) return false; - if (!('isPublic' in value) || value['isPublic'] === undefined) return false; - return true; -} - -export function EditorialFromJSON(json: any): Editorial { - return EditorialFromJSONTyped(json, false); -} - -export function EditorialFromJSONTyped(json: any, ignoreDiscriminator: boolean): Editorial { - if (json == null) { - return json; - } - return { - - 'id': json['id'], - 'createdAt': (new Date(json['createdAt'])), - 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), - 'authorId': json['authorId'], - 'statement': json['statement'], - 'isPublic': json['isPublic'], - }; -} - - export function EditorialToJSON(json: any): Editorial { - return EditorialToJSONTyped(json, false); - } - - export function EditorialToJSONTyped(value?: Editorial | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'createdAt': ((value['createdAt']).toISOString()), - 'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()), - 'authorId': value['authorId'], - 'statement': value['statement'], - 'isPublic': value['isPublic'], - }; -} - diff --git a/src/api/models/EditorialSummary.ts b/src/api/models/EditorialSummary.ts deleted file mode 100644 index 4a32283..0000000 --- a/src/api/models/EditorialSummary.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 解説 - * @export - * @interface EditorialSummary - */ -export interface EditorialSummary { - /** - * 解説ID - * @type {number} - * @memberof EditorialSummary - */ - id?: number; - /** - * 作成日時 - * @type {Date} - * @memberof EditorialSummary - */ - createdAt?: Date; - /** - * 更新日時 - * @type {Date} - * @memberof EditorialSummary - */ - updatedAt?: Date; - /** - * 投稿者のユーザーID - * @type {number} - * @memberof EditorialSummary - */ - authorId?: number; - /** - * 解説が全体公開かどうか. - * - * * `true` - 公開 - * * `false` - 非公開 (問題の作者のみ閲覧可) - * @type {boolean} - * @memberof EditorialSummary - */ - isPublic?: boolean; -} - -/** - * Check if a given object implements the EditorialSummary interface. - */ -export function instanceOfEditorialSummary(value: object): value is EditorialSummary { - return true; -} - -export function EditorialSummaryFromJSON(json: any): EditorialSummary { - return EditorialSummaryFromJSONTyped(json, false); -} - -export function EditorialSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): EditorialSummary { - if (json == null) { - return json; - } - return { - - 'id': json['id'] == null ? undefined : json['id'], - 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), - 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), - 'authorId': json['authorId'] == null ? undefined : json['authorId'], - 'isPublic': json['isPublic'] == null ? undefined : json['isPublic'], - }; -} - - export function EditorialSummaryToJSON(json: any): EditorialSummary { - return EditorialSummaryToJSONTyped(json, false); - } - - export function EditorialSummaryToJSONTyped(value?: EditorialSummary | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()), - 'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()), - 'authorId': value['authorId'], - 'isPublic': value['isPublic'], - }; -} - diff --git a/src/api/models/Email.ts b/src/api/models/Email.ts deleted file mode 100644 index c249748..0000000 --- a/src/api/models/Email.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface Email - */ -export interface Email { - /** - * - * @type {string} - * @memberof Email - */ - email: string; -} - -/** - * Check if a given object implements the Email interface. - */ -export function instanceOfEmail(value: object): value is Email { - if (!('email' in value) || value['email'] === undefined) return false; - return true; -} - -export function EmailFromJSON(json: any): Email { - return EmailFromJSONTyped(json, false); -} - -export function EmailFromJSONTyped(json: any, ignoreDiscriminator: boolean): Email { - if (json == null) { - return json; - } - return { - - 'email': json['email'], - }; -} - - export function EmailToJSON(json: any): Email { - return EmailToJSONTyped(json, false); - } - - export function EmailToJSONTyped(value?: Email | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'email': value['email'], - }; -} - diff --git a/src/api/models/GetGoogleAuthParams200Response.ts b/src/api/models/GetGoogleAuthParams200Response.ts deleted file mode 100644 index 99cf631..0000000 --- a/src/api/models/GetGoogleAuthParams200Response.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface GetGoogleAuthParams200Response - */ -export interface GetGoogleAuthParams200Response { - /** - * - * @type {string} - * @memberof GetGoogleAuthParams200Response - */ - url: string; -} - -/** - * Check if a given object implements the GetGoogleAuthParams200Response interface. - */ -export function instanceOfGetGoogleAuthParams200Response(value: object): value is GetGoogleAuthParams200Response { - if (!('url' in value) || value['url'] === undefined) return false; - return true; -} - -export function GetGoogleAuthParams200ResponseFromJSON(json: any): GetGoogleAuthParams200Response { - return GetGoogleAuthParams200ResponseFromJSONTyped(json, false); -} - -export function GetGoogleAuthParams200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetGoogleAuthParams200Response { - if (json == null) { - return json; - } - return { - - 'url': json['url'], - }; -} - - export function GetGoogleAuthParams200ResponseToJSON(json: any): GetGoogleAuthParams200Response { - return GetGoogleAuthParams200ResponseToJSONTyped(json, false); - } - - export function GetGoogleAuthParams200ResponseToJSONTyped(value?: GetGoogleAuthParams200Response | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'url': value['url'], - }; -} - diff --git a/src/api/models/GetGoogleAuthParams500Response.ts b/src/api/models/GetGoogleAuthParams500Response.ts deleted file mode 100644 index b70e70a..0000000 --- a/src/api/models/GetGoogleAuthParams500Response.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface GetGoogleAuthParams500Response - */ -export interface GetGoogleAuthParams500Response { - /** - * - * @type {string} - * @memberof GetGoogleAuthParams500Response - */ - message?: string; -} - -/** - * Check if a given object implements the GetGoogleAuthParams500Response interface. - */ -export function instanceOfGetGoogleAuthParams500Response(value: object): value is GetGoogleAuthParams500Response { - return true; -} - -export function GetGoogleAuthParams500ResponseFromJSON(json: any): GetGoogleAuthParams500Response { - return GetGoogleAuthParams500ResponseFromJSONTyped(json, false); -} - -export function GetGoogleAuthParams500ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetGoogleAuthParams500Response { - if (json == null) { - return json; - } - return { - - 'message': json['message'] == null ? undefined : json['message'], - }; -} - - export function GetGoogleAuthParams500ResponseToJSON(json: any): GetGoogleAuthParams500Response { - return GetGoogleAuthParams500ResponseToJSONTyped(json, false); - } - - export function GetGoogleAuthParams500ResponseToJSONTyped(value?: GetGoogleAuthParams500Response | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'message': value['message'], - }; -} - diff --git a/src/api/models/JudgeResult.ts b/src/api/models/JudgeResult.ts deleted file mode 100644 index 64468df..0000000 --- a/src/api/models/JudgeResult.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { JudgeStatus } from './JudgeStatus'; -import { - JudgeStatusFromJSON, - JudgeStatusFromJSONTyped, - JudgeStatusToJSON, - JudgeStatusToJSONTyped, -} from './JudgeStatus'; - -/** - * ジャッジ結果 - * @export - * @interface JudgeResult - */ -export interface JudgeResult { - /** - * - * @type {string} - * @memberof JudgeResult - */ - testcaseId: string; - /** - * - * @type {string} - * @memberof JudgeResult - */ - testcaseName?: string; - /** - * - * @type {JudgeStatus} - * @memberof JudgeResult - */ - judgeStatus: JudgeStatus; - /** - * - * @type {number} - * @memberof JudgeResult - */ - score: number; - /** - * - * @type {number} - * @memberof JudgeResult - */ - time: number; - /** - * - * @type {number} - * @memberof JudgeResult - */ - memory: number; -} - - - -/** - * Check if a given object implements the JudgeResult interface. - */ -export function instanceOfJudgeResult(value: object): value is JudgeResult { - if (!('testcaseId' in value) || value['testcaseId'] === undefined) return false; - if (!('judgeStatus' in value) || value['judgeStatus'] === undefined) return false; - if (!('score' in value) || value['score'] === undefined) return false; - if (!('time' in value) || value['time'] === undefined) return false; - if (!('memory' in value) || value['memory'] === undefined) return false; - return true; -} - -export function JudgeResultFromJSON(json: any): JudgeResult { - return JudgeResultFromJSONTyped(json, false); -} - -export function JudgeResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): JudgeResult { - if (json == null) { - return json; - } - return { - - 'testcaseId': json['testcaseId'], - 'testcaseName': json['testcaseName'] == null ? undefined : json['testcaseName'], - 'judgeStatus': JudgeStatusFromJSON(json['judgeStatus']), - 'score': json['score'], - 'time': json['time'], - 'memory': json['memory'], - }; -} - - export function JudgeResultToJSON(json: any): JudgeResult { - return JudgeResultToJSONTyped(json, false); - } - - export function JudgeResultToJSONTyped(value?: JudgeResult | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'testcaseId': value['testcaseId'], - 'testcaseName': value['testcaseName'], - 'judgeStatus': JudgeStatusToJSON(value['judgeStatus']), - 'score': value['score'], - 'time': value['time'], - 'memory': value['memory'], - }; -} - diff --git a/src/api/models/JudgeStatus.ts b/src/api/models/JudgeStatus.ts deleted file mode 100644 index 1cdf8c3..0000000 --- a/src/api/models/JudgeStatus.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** - * ジャッジの状態 - * - * * `AC` - 正解 - * * `WA` - 不正解 - * * `CE` - コンパイルエラー - * * `IE` - 内部エラー - * * `MLE` - メモリ制限超過 - * * `RE` - 実行時エラー - * * `TLE` - 実行時間超過 - * * `WJ` - ジャッジ待ち - * @export - */ -export const JudgeStatus = { - Ac: 'AC', - Wa: 'WA', - Ce: 'CE', - Ie: 'IE', - Mle: 'MLE', - Re: 'RE', - Tle: 'TLE', - Wj: 'WJ' -} as const; -export type JudgeStatus = typeof JudgeStatus[keyof typeof JudgeStatus]; - - -export function instanceOfJudgeStatus(value: any): boolean { - for (const key in JudgeStatus) { - if (Object.prototype.hasOwnProperty.call(JudgeStatus, key)) { - if (JudgeStatus[key as keyof typeof JudgeStatus] === value) { - return true; - } - } - } - return false; -} - -export function JudgeStatusFromJSON(json: any): JudgeStatus { - return JudgeStatusFromJSONTyped(json, false); -} - -export function JudgeStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): JudgeStatus { - return json as JudgeStatus; -} - -export function JudgeStatusToJSON(value?: JudgeStatus | null): any { - return value as any; -} - -export function JudgeStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): JudgeStatus { - return value as JudgeStatus; -} - diff --git a/src/api/models/Language.ts b/src/api/models/Language.ts deleted file mode 100644 index a65da8b..0000000 --- a/src/api/models/Language.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * プログラミング言語についての情報 - * @export - * @interface Language - */ -export interface Language { - /** - * - * @type {number} - * @memberof Language - */ - id: number; - /** - * - * @type {string} - * @memberof Language - */ - name: string; -} - -/** - * Check if a given object implements the Language interface. - */ -export function instanceOfLanguage(value: object): value is Language { - if (!('id' in value) || value['id'] === undefined) return false; - if (!('name' in value) || value['name'] === undefined) return false; - return true; -} - -export function LanguageFromJSON(json: any): Language { - return LanguageFromJSONTyped(json, false); -} - -export function LanguageFromJSONTyped(json: any, ignoreDiscriminator: boolean): Language { - if (json == null) { - return json; - } - return { - - 'id': json['id'], - 'name': json['name'], - }; -} - - export function LanguageToJSON(json: any): Language { - return LanguageToJSONTyped(json, false); - } - - export function LanguageToJSONTyped(value?: Language | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'name': value['name'], - }; -} - diff --git a/src/api/models/PostEditorialRequest.ts b/src/api/models/PostEditorialRequest.ts deleted file mode 100644 index d3c59ea..0000000 --- a/src/api/models/PostEditorialRequest.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 解説の作成リクエスト - * @export - * @interface PostEditorialRequest - */ -export interface PostEditorialRequest { - /** - * 解説本文 (HTML) - * @type {string} - * @memberof PostEditorialRequest - */ - statement: string; - /** - * 解説が全体公開かどうか. - * - * * `true` - 公開 - * * `false` - 非公開 (問題の作者のみ閲覧可) - * @type {boolean} - * @memberof PostEditorialRequest - */ - isPublic: boolean; -} - -/** - * Check if a given object implements the PostEditorialRequest interface. - */ -export function instanceOfPostEditorialRequest(value: object): value is PostEditorialRequest { - if (!('statement' in value) || value['statement'] === undefined) return false; - if (!('isPublic' in value) || value['isPublic'] === undefined) return false; - return true; -} - -export function PostEditorialRequestFromJSON(json: any): PostEditorialRequest { - return PostEditorialRequestFromJSONTyped(json, false); -} - -export function PostEditorialRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostEditorialRequest { - if (json == null) { - return json; - } - return { - - 'statement': json['statement'], - 'isPublic': json['isPublic'], - }; -} - - export function PostEditorialRequestToJSON(json: any): PostEditorialRequest { - return PostEditorialRequestToJSONTyped(json, false); - } - - export function PostEditorialRequestToJSONTyped(value?: PostEditorialRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'statement': value['statement'], - 'isPublic': value['isPublic'], - }; -} - diff --git a/src/api/models/PostProblemRequest.ts b/src/api/models/PostProblemRequest.ts deleted file mode 100644 index 70b5dfc..0000000 --- a/src/api/models/PostProblemRequest.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 問題の投稿リクエスト - * @export - * @interface PostProblemRequest - */ -export interface PostProblemRequest { - /** - * 問題タイトル - * @type {string} - * @memberof PostProblemRequest - */ - title: string; - /** - * 難易度 - * @type {number} - * @memberof PostProblemRequest - */ - difficulty: number; - /** - * 問題文 (HTML形式) - * @type {string} - * @memberof PostProblemRequest - */ - statement: string; - /** - * 実行時間制限 (ms) - * @type {number} - * @memberof PostProblemRequest - */ - timeLimit: number; - /** - * メモリ制限 (MiB) - * @type {number} - * @memberof PostProblemRequest - */ - memoryLimit: number; -} - -/** - * Check if a given object implements the PostProblemRequest interface. - */ -export function instanceOfPostProblemRequest(value: object): value is PostProblemRequest { - if (!('title' in value) || value['title'] === undefined) return false; - if (!('difficulty' in value) || value['difficulty'] === undefined) return false; - if (!('statement' in value) || value['statement'] === undefined) return false; - if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; - if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; - return true; -} - -export function PostProblemRequestFromJSON(json: any): PostProblemRequest { - return PostProblemRequestFromJSONTyped(json, false); -} - -export function PostProblemRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostProblemRequest { - if (json == null) { - return json; - } - return { - - 'title': json['title'], - 'difficulty': json['difficulty'], - 'statement': json['statement'], - 'timeLimit': json['timeLimit'], - 'memoryLimit': json['memoryLimit'], - }; -} - - export function PostProblemRequestToJSON(json: any): PostProblemRequest { - return PostProblemRequestToJSONTyped(json, false); - } - - export function PostProblemRequestToJSONTyped(value?: PostProblemRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'title': value['title'], - 'difficulty': value['difficulty'], - 'statement': value['statement'], - 'timeLimit': value['timeLimit'], - 'memoryLimit': value['memoryLimit'], - }; -} - diff --git a/src/api/models/PostSubmissionRequest.ts b/src/api/models/PostSubmissionRequest.ts deleted file mode 100644 index d6c01a3..0000000 --- a/src/api/models/PostSubmissionRequest.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 回答の提出リクエスト - * @export - * @interface PostSubmissionRequest - */ -export interface PostSubmissionRequest { - /** - * 提出コードの言語ID - * @type {number} - * @memberof PostSubmissionRequest - */ - languageId?: number; - /** - * ソースコード - * @type {string} - * @memberof PostSubmissionRequest - */ - source?: string; -} - -/** - * Check if a given object implements the PostSubmissionRequest interface. - */ -export function instanceOfPostSubmissionRequest(value: object): value is PostSubmissionRequest { - return true; -} - -export function PostSubmissionRequestFromJSON(json: any): PostSubmissionRequest { - return PostSubmissionRequestFromJSONTyped(json, false); -} - -export function PostSubmissionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostSubmissionRequest { - if (json == null) { - return json; - } - return { - - 'languageId': json['languageId'] == null ? undefined : json['languageId'], - 'source': json['source'] == null ? undefined : json['source'], - }; -} - - export function PostSubmissionRequestToJSON(json: any): PostSubmissionRequest { - return PostSubmissionRequestToJSONTyped(json, false); - } - - export function PostSubmissionRequestToJSONTyped(value?: PostSubmissionRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'languageId': value['languageId'], - 'source': value['source'], - }; -} - diff --git a/src/api/models/PostTestcaseRequestInner.ts b/src/api/models/PostTestcaseRequestInner.ts deleted file mode 100644 index 56a539c..0000000 --- a/src/api/models/PostTestcaseRequestInner.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface PostTestcaseRequestInner - */ -export interface PostTestcaseRequestInner { - /** - * - * @type {string} - * @memberof PostTestcaseRequestInner - */ - name: string; - /** - * - * @type {string} - * @memberof PostTestcaseRequestInner - */ - testInput: string; - /** - * - * @type {string} - * @memberof PostTestcaseRequestInner - */ - testOutput: string; -} - -/** - * Check if a given object implements the PostTestcaseRequestInner interface. - */ -export function instanceOfPostTestcaseRequestInner(value: object): value is PostTestcaseRequestInner { - if (!('name' in value) || value['name'] === undefined) return false; - if (!('testInput' in value) || value['testInput'] === undefined) return false; - if (!('testOutput' in value) || value['testOutput'] === undefined) return false; - return true; -} - -export function PostTestcaseRequestInnerFromJSON(json: any): PostTestcaseRequestInner { - return PostTestcaseRequestInnerFromJSONTyped(json, false); -} - -export function PostTestcaseRequestInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostTestcaseRequestInner { - if (json == null) { - return json; - } - return { - - 'name': json['name'], - 'testInput': json['testInput'], - 'testOutput': json['testOutput'], - }; -} - - export function PostTestcaseRequestInnerToJSON(json: any): PostTestcaseRequestInner { - return PostTestcaseRequestInnerToJSONTyped(json, false); - } - - export function PostTestcaseRequestInnerToJSONTyped(value?: PostTestcaseRequestInner | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'name': value['name'], - 'testInput': value['testInput'], - 'testOutput': value['testOutput'], - }; -} - diff --git a/src/api/models/Problem.ts b/src/api/models/Problem.ts deleted file mode 100644 index 61c34c5..0000000 --- a/src/api/models/Problem.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { TestcaseSummaries } from './TestcaseSummaries'; -import { - TestcaseSummariesFromJSON, - TestcaseSummariesFromJSONTyped, - TestcaseSummariesToJSON, - TestcaseSummariesToJSONTyped, -} from './TestcaseSummaries'; - -/** - * 問題の詳細 - * @export - * @interface Problem - */ -export interface Problem { - /** - * 問題ID - * @type {string} - * @memberof Problem - */ - id: string; - /** - * 問題タイトル - * @type {string} - * @memberof Problem - */ - title: string; - /** - * 作問者のユーザーID - * @type {number} - * @memberof Problem - */ - authorId: number; - /** - * 問題が全体公開かどうか. - * - * * `true` - 公開 - * * `false` - 非公開 (問題の作者のみ閲覧可) - * @type {boolean} - * @memberof Problem - */ - isPublic: boolean; - /** - * 難易度 - * @type {number} - * @memberof Problem - */ - difficulty: number; - /** - * 問題文 (HTML形式) - * @type {string} - * @memberof Problem - */ - statement: string; - /** - * 実行時間制限 (ms) - * @type {number} - * @memberof Problem - */ - timeLimit: number; - /** - * メモリ制限 (MiB) - * @type {number} - * @memberof Problem - */ - memoryLimit: number; - /** - * - * @type {number} - * @memberof Problem - */ - solvedCount: number; - /** - * - * @type {Array} - * @memberof Problem - */ - testcases: Array; - /** - * - * @type {Date} - * @memberof Problem - */ - createdAt: Date; - /** - * - * @type {Date} - * @memberof Problem - */ - updatedAt: Date; -} - -/** - * Check if a given object implements the Problem interface. - */ -export function instanceOfProblem(value: object): value is Problem { - if (!('id' in value) || value['id'] === undefined) return false; - if (!('title' in value) || value['title'] === undefined) return false; - if (!('authorId' in value) || value['authorId'] === undefined) return false; - if (!('isPublic' in value) || value['isPublic'] === undefined) return false; - if (!('difficulty' in value) || value['difficulty'] === undefined) return false; - if (!('statement' in value) || value['statement'] === undefined) return false; - if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; - if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; - if (!('solvedCount' in value) || value['solvedCount'] === undefined) return false; - if (!('testcases' in value) || value['testcases'] === undefined) return false; - if (!('createdAt' in value) || value['createdAt'] === undefined) return false; - if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; - return true; -} - -export function ProblemFromJSON(json: any): Problem { - return ProblemFromJSONTyped(json, false); -} - -export function ProblemFromJSONTyped(json: any, ignoreDiscriminator: boolean): Problem { - if (json == null) { - return json; - } - return { - - 'id': json['id'], - 'title': json['title'], - 'authorId': json['authorId'], - 'isPublic': json['isPublic'], - 'difficulty': json['difficulty'], - 'statement': json['statement'], - 'timeLimit': json['timeLimit'], - 'memoryLimit': json['memoryLimit'], - 'solvedCount': json['solvedCount'], - 'testcases': ((json['testcases'] as Array).map(TestcaseSummariesFromJSON)), - 'createdAt': (new Date(json['createdAt'])), - 'updatedAt': (new Date(json['updatedAt'])), - }; -} - - export function ProblemToJSON(json: any): Problem { - return ProblemToJSONTyped(json, false); - } - - export function ProblemToJSONTyped(value?: Problem | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'title': value['title'], - 'authorId': value['authorId'], - 'isPublic': value['isPublic'], - 'difficulty': value['difficulty'], - 'statement': value['statement'], - 'timeLimit': value['timeLimit'], - 'memoryLimit': value['memoryLimit'], - 'solvedCount': value['solvedCount'], - 'testcases': ((value['testcases'] as Array).map(TestcaseSummariesToJSON)), - 'createdAt': ((value['createdAt']).toISOString()), - 'updatedAt': ((value['updatedAt']).toISOString()), - }; -} - diff --git a/src/api/models/ProblemSummaries.ts b/src/api/models/ProblemSummaries.ts deleted file mode 100644 index c2e9242..0000000 --- a/src/api/models/ProblemSummaries.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { ProblemSummary } from './ProblemSummary'; -import { - ProblemSummaryFromJSON, - ProblemSummaryFromJSONTyped, - ProblemSummaryToJSON, - ProblemSummaryToJSONTyped, -} from './ProblemSummary'; - -/** - * - * @export - * @interface ProblemSummaries - */ -export interface ProblemSummaries { - /** - * - * @type {number} - * @memberof ProblemSummaries - */ - total: number; - /** - * - * @type {Array} - * @memberof ProblemSummaries - */ - problems: Array; -} - -/** - * Check if a given object implements the ProblemSummaries interface. - */ -export function instanceOfProblemSummaries(value: object): value is ProblemSummaries { - if (!('total' in value) || value['total'] === undefined) return false; - if (!('problems' in value) || value['problems'] === undefined) return false; - return true; -} - -export function ProblemSummariesFromJSON(json: any): ProblemSummaries { - return ProblemSummariesFromJSONTyped(json, false); -} - -export function ProblemSummariesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProblemSummaries { - if (json == null) { - return json; - } - return { - - 'total': json['total'], - 'problems': ((json['problems'] as Array).map(ProblemSummaryFromJSON)), - }; -} - - export function ProblemSummariesToJSON(json: any): ProblemSummaries { - return ProblemSummariesToJSONTyped(json, false); - } - - export function ProblemSummariesToJSONTyped(value?: ProblemSummaries | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'total': value['total'], - 'problems': ((value['problems'] as Array).map(ProblemSummaryToJSON)), - }; -} - diff --git a/src/api/models/ProblemSummary.ts b/src/api/models/ProblemSummary.ts deleted file mode 100644 index 81cddb9..0000000 --- a/src/api/models/ProblemSummary.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 問題の要約 - * @export - * @interface ProblemSummary - */ -export interface ProblemSummary { - /** - * 問題ID - * @type {string} - * @memberof ProblemSummary - */ - id: string; - /** - * 問題タイトル - * @type {string} - * @memberof ProblemSummary - */ - title: string; - /** - * 作問者のユーザーID - * @type {number} - * @memberof ProblemSummary - */ - authorId: number; - /** - * 問題が全体公開かどうか. - * - * * `true` - 公開 - * * `false` - 非公開 (問題の作者のみ閲覧可) - * @type {boolean} - * @memberof ProblemSummary - */ - isPublic: boolean; - /** - * 難易度 - * @type {number} - * @memberof ProblemSummary - */ - difficulty: number; - /** - * 実行時間制限 (ms) - * @type {number} - * @memberof ProblemSummary - */ - timeLimit: number; - /** - * メモリ制限 (MiB) - * @type {number} - * @memberof ProblemSummary - */ - memoryLimit: number; - /** - * - * @type {number} - * @memberof ProblemSummary - */ - solvedCount: number; - /** - * - * @type {Date} - * @memberof ProblemSummary - */ - createdAt: Date; - /** - * - * @type {Date} - * @memberof ProblemSummary - */ - updatedAt: Date; -} - -/** - * Check if a given object implements the ProblemSummary interface. - */ -export function instanceOfProblemSummary(value: object): value is ProblemSummary { - if (!('id' in value) || value['id'] === undefined) return false; - if (!('title' in value) || value['title'] === undefined) return false; - if (!('authorId' in value) || value['authorId'] === undefined) return false; - if (!('isPublic' in value) || value['isPublic'] === undefined) return false; - if (!('difficulty' in value) || value['difficulty'] === undefined) return false; - if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; - if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; - if (!('solvedCount' in value) || value['solvedCount'] === undefined) return false; - if (!('createdAt' in value) || value['createdAt'] === undefined) return false; - if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; - return true; -} - -export function ProblemSummaryFromJSON(json: any): ProblemSummary { - return ProblemSummaryFromJSONTyped(json, false); -} - -export function ProblemSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProblemSummary { - if (json == null) { - return json; - } - return { - - 'id': json['id'], - 'title': json['title'], - 'authorId': json['authorId'], - 'isPublic': json['isPublic'], - 'difficulty': json['difficulty'], - 'timeLimit': json['timeLimit'], - 'memoryLimit': json['memoryLimit'], - 'solvedCount': json['solvedCount'], - 'createdAt': (new Date(json['createdAt'])), - 'updatedAt': (new Date(json['updatedAt'])), - }; -} - - export function ProblemSummaryToJSON(json: any): ProblemSummary { - return ProblemSummaryToJSONTyped(json, false); - } - - export function ProblemSummaryToJSONTyped(value?: ProblemSummary | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'title': value['title'], - 'authorId': value['authorId'], - 'isPublic': value['isPublic'], - 'difficulty': value['difficulty'], - 'timeLimit': value['timeLimit'], - 'memoryLimit': value['memoryLimit'], - 'solvedCount': value['solvedCount'], - 'createdAt': ((value['createdAt']).toISOString()), - 'updatedAt': ((value['updatedAt']).toISOString()), - }; -} - diff --git a/src/api/models/PutEditorialRequest.ts b/src/api/models/PutEditorialRequest.ts deleted file mode 100644 index c436dd7..0000000 --- a/src/api/models/PutEditorialRequest.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 解説の変更リクエスト. - * @export - * @interface PutEditorialRequest - */ -export interface PutEditorialRequest { - /** - * 解説本文 (HTML) - * @type {string} - * @memberof PutEditorialRequest - */ - statement?: string; - /** - * 公開されているかどうか - * @type {boolean} - * @memberof PutEditorialRequest - */ - isPublic?: boolean; -} - -/** - * Check if a given object implements the PutEditorialRequest interface. - */ -export function instanceOfPutEditorialRequest(value: object): value is PutEditorialRequest { - return true; -} - -export function PutEditorialRequestFromJSON(json: any): PutEditorialRequest { - return PutEditorialRequestFromJSONTyped(json, false); -} - -export function PutEditorialRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutEditorialRequest { - if (json == null) { - return json; - } - return { - - 'statement': json['statement'] == null ? undefined : json['statement'], - 'isPublic': json['isPublic'] == null ? undefined : json['isPublic'], - }; -} - - export function PutEditorialRequestToJSON(json: any): PutEditorialRequest { - return PutEditorialRequestToJSONTyped(json, false); - } - - export function PutEditorialRequestToJSONTyped(value?: PutEditorialRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'statement': value['statement'], - 'isPublic': value['isPublic'], - }; -} - diff --git a/src/api/models/PutMeRequest.ts b/src/api/models/PutMeRequest.ts deleted file mode 100644 index 9ff660f..0000000 --- a/src/api/models/PutMeRequest.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface PutMeRequest - */ -export interface PutMeRequest { - /** - * - * @type {string} - * @memberof PutMeRequest - */ - userName?: string; - /** - * - * @type {Blob} - * @memberof PutMeRequest - */ - icon?: Blob; - /** - * - * @type {string} - * @memberof PutMeRequest - */ - xLink?: string; - /** - * - * @type {string} - * @memberof PutMeRequest - */ - githubLink?: string; - /** - * - * @type {string} - * @memberof PutMeRequest - */ - selfIntroduction?: string; -} - -/** - * Check if a given object implements the PutMeRequest interface. - */ -export function instanceOfPutMeRequest(value: object): value is PutMeRequest { - return true; -} - -export function PutMeRequestFromJSON(json: any): PutMeRequest { - return PutMeRequestFromJSONTyped(json, false); -} - -export function PutMeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutMeRequest { - if (json == null) { - return json; - } - return { - - 'userName': json['userName'] == null ? undefined : json['userName'], - 'icon': json['icon'] == null ? undefined : json['icon'], - 'xLink': json['xLink'] == null ? undefined : json['xLink'], - 'githubLink': json['githubLink'] == null ? undefined : json['githubLink'], - 'selfIntroduction': json['selfIntroduction'] == null ? undefined : json['selfIntroduction'], - }; -} - - export function PutMeRequestToJSON(json: any): PutMeRequest { - return PutMeRequestToJSONTyped(json, false); - } - - export function PutMeRequestToJSONTyped(value?: PutMeRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'userName': value['userName'], - 'icon': value['icon'], - 'xLink': value['xLink'], - 'githubLink': value['githubLink'], - 'selfIntroduction': value['selfIntroduction'], - }; -} - diff --git a/src/api/models/PutPasswordRequest.ts b/src/api/models/PutPasswordRequest.ts deleted file mode 100644 index 2f9c236..0000000 --- a/src/api/models/PutPasswordRequest.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * ログイン後のパスワード変更用 - * @export - * @interface PutPasswordRequest - */ -export interface PutPasswordRequest { - /** - * - * @type {string} - * @memberof PutPasswordRequest - */ - oldPassword: string; - /** - * - * @type {string} - * @memberof PutPasswordRequest - */ - newPassword: string; -} - -/** - * Check if a given object implements the PutPasswordRequest interface. - */ -export function instanceOfPutPasswordRequest(value: object): value is PutPasswordRequest { - if (!('oldPassword' in value) || value['oldPassword'] === undefined) return false; - if (!('newPassword' in value) || value['newPassword'] === undefined) return false; - return true; -} - -export function PutPasswordRequestFromJSON(json: any): PutPasswordRequest { - return PutPasswordRequestFromJSONTyped(json, false); -} - -export function PutPasswordRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutPasswordRequest { - if (json == null) { - return json; - } - return { - - 'oldPassword': json['oldPassword'], - 'newPassword': json['newPassword'], - }; -} - - export function PutPasswordRequestToJSON(json: any): PutPasswordRequest { - return PutPasswordRequestToJSONTyped(json, false); - } - - export function PutPasswordRequestToJSONTyped(value?: PutPasswordRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'oldPassword': value['oldPassword'], - 'newPassword': value['newPassword'], - }; -} - diff --git a/src/api/models/PutProblemRequest.ts b/src/api/models/PutProblemRequest.ts deleted file mode 100644 index 6eb9c38..0000000 --- a/src/api/models/PutProblemRequest.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 問題の変更リクエスト - * @export - * @interface PutProblemRequest - */ -export interface PutProblemRequest { - /** - * 問題タイトル - * @type {string} - * @memberof PutProblemRequest - */ - title: string; - /** - * 問題が全体公開かどうか. - * - * * `true` - 公開 - * * `false` - 非公開 (問題の作者のみ閲覧可) - * @type {boolean} - * @memberof PutProblemRequest - */ - isPublic: boolean; - /** - * 難易度 - * @type {number} - * @memberof PutProblemRequest - */ - difficulty: number; - /** - * 問題文 (HTML形式) - * @type {string} - * @memberof PutProblemRequest - */ - statement?: string; - /** - * 実行時間制限 (ms) - * @type {number} - * @memberof PutProblemRequest - */ - timeLimit: number; - /** - * メモリ制限 (MiB) - * @type {number} - * @memberof PutProblemRequest - */ - memoryLimit: number; -} - -/** - * Check if a given object implements the PutProblemRequest interface. - */ -export function instanceOfPutProblemRequest(value: object): value is PutProblemRequest { - if (!('title' in value) || value['title'] === undefined) return false; - if (!('isPublic' in value) || value['isPublic'] === undefined) return false; - if (!('difficulty' in value) || value['difficulty'] === undefined) return false; - if (!('timeLimit' in value) || value['timeLimit'] === undefined) return false; - if (!('memoryLimit' in value) || value['memoryLimit'] === undefined) return false; - return true; -} - -export function PutProblemRequestFromJSON(json: any): PutProblemRequest { - return PutProblemRequestFromJSONTyped(json, false); -} - -export function PutProblemRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutProblemRequest { - if (json == null) { - return json; - } - return { - - 'title': json['title'], - 'isPublic': json['isPublic'], - 'difficulty': json['difficulty'], - 'statement': json['statement'] == null ? undefined : json['statement'], - 'timeLimit': json['timeLimit'], - 'memoryLimit': json['memoryLimit'], - }; -} - - export function PutProblemRequestToJSON(json: any): PutProblemRequest { - return PutProblemRequestToJSONTyped(json, false); - } - - export function PutProblemRequestToJSONTyped(value?: PutProblemRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'title': value['title'], - 'isPublic': value['isPublic'], - 'difficulty': value['difficulty'], - 'statement': value['statement'], - 'timeLimit': value['timeLimit'], - 'memoryLimit': value['memoryLimit'], - }; -} - diff --git a/src/api/models/PutTestcaseRequest.ts b/src/api/models/PutTestcaseRequest.ts deleted file mode 100644 index a83bd96..0000000 --- a/src/api/models/PutTestcaseRequest.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * 単体のテストケースの編集 - * @export - * @interface PutTestcaseRequest - */ -export interface PutTestcaseRequest { - /** - * - * @type {string} - * @memberof PutTestcaseRequest - */ - name: string; - /** - * - * @type {string} - * @memberof PutTestcaseRequest - */ - testInput: string; - /** - * - * @type {string} - * @memberof PutTestcaseRequest - */ - testOutput: string; -} - -/** - * Check if a given object implements the PutTestcaseRequest interface. - */ -export function instanceOfPutTestcaseRequest(value: object): value is PutTestcaseRequest { - if (!('name' in value) || value['name'] === undefined) return false; - if (!('testInput' in value) || value['testInput'] === undefined) return false; - if (!('testOutput' in value) || value['testOutput'] === undefined) return false; - return true; -} - -export function PutTestcaseRequestFromJSON(json: any): PutTestcaseRequest { - return PutTestcaseRequestFromJSONTyped(json, false); -} - -export function PutTestcaseRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutTestcaseRequest { - if (json == null) { - return json; - } - return { - - 'name': json['name'], - 'testInput': json['testInput'], - 'testOutput': json['testOutput'], - }; -} - - export function PutTestcaseRequestToJSON(json: any): PutTestcaseRequest { - return PutTestcaseRequestToJSONTyped(json, false); - } - - export function PutTestcaseRequestToJSONTyped(value?: PutTestcaseRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'name': value['name'], - 'testInput': value['testInput'], - 'testOutput': value['testOutput'], - }; -} - diff --git a/src/api/models/ResetPasswordRequest.ts b/src/api/models/ResetPasswordRequest.ts deleted file mode 100644 index 25f1c06..0000000 --- a/src/api/models/ResetPasswordRequest.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface ResetPasswordRequest - */ -export interface ResetPasswordRequest { - /** - * - * @type {string} - * @memberof ResetPasswordRequest - */ - password: string; - /** - * - * @type {string} - * @memberof ResetPasswordRequest - */ - token: string; -} - -/** - * Check if a given object implements the ResetPasswordRequest interface. - */ -export function instanceOfResetPasswordRequest(value: object): value is ResetPasswordRequest { - if (!('password' in value) || value['password'] === undefined) return false; - if (!('token' in value) || value['token'] === undefined) return false; - return true; -} - -export function ResetPasswordRequestFromJSON(json: any): ResetPasswordRequest { - return ResetPasswordRequestFromJSONTyped(json, false); -} - -export function ResetPasswordRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResetPasswordRequest { - if (json == null) { - return json; - } - return { - - 'password': json['password'], - 'token': json['token'], - }; -} - - export function ResetPasswordRequestToJSON(json: any): ResetPasswordRequest { - return ResetPasswordRequestToJSONTyped(json, false); - } - - export function ResetPasswordRequestToJSONTyped(value?: ResetPasswordRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'password': value['password'], - 'token': value['token'], - }; -} - diff --git a/src/api/models/RevokeTraqAuth400Response.ts b/src/api/models/RevokeTraqAuth400Response.ts deleted file mode 100644 index b725502..0000000 --- a/src/api/models/RevokeTraqAuth400Response.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface RevokeTraqAuth400Response - */ -export interface RevokeTraqAuth400Response { - /** - * - * @type {string} - * @memberof RevokeTraqAuth400Response - */ - message?: string; -} - -/** - * Check if a given object implements the RevokeTraqAuth400Response interface. - */ -export function instanceOfRevokeTraqAuth400Response(value: object): value is RevokeTraqAuth400Response { - return true; -} - -export function RevokeTraqAuth400ResponseFromJSON(json: any): RevokeTraqAuth400Response { - return RevokeTraqAuth400ResponseFromJSONTyped(json, false); -} - -export function RevokeTraqAuth400ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevokeTraqAuth400Response { - if (json == null) { - return json; - } - return { - - 'message': json['message'] == null ? undefined : json['message'], - }; -} - - export function RevokeTraqAuth400ResponseToJSON(json: any): RevokeTraqAuth400Response { - return RevokeTraqAuth400ResponseToJSONTyped(json, false); - } - - export function RevokeTraqAuth400ResponseToJSONTyped(value?: RevokeTraqAuth400Response | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'message': value['message'], - }; -} - diff --git a/src/api/models/RevokeTraqAuthRequest.ts b/src/api/models/RevokeTraqAuthRequest.ts deleted file mode 100644 index 4d93373..0000000 --- a/src/api/models/RevokeTraqAuthRequest.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface RevokeTraqAuthRequest - */ -export interface RevokeTraqAuthRequest { - /** - * The access token to revoke - * @type {string} - * @memberof RevokeTraqAuthRequest - */ - token: string; -} - -/** - * Check if a given object implements the RevokeTraqAuthRequest interface. - */ -export function instanceOfRevokeTraqAuthRequest(value: object): value is RevokeTraqAuthRequest { - if (!('token' in value) || value['token'] === undefined) return false; - return true; -} - -export function RevokeTraqAuthRequestFromJSON(json: any): RevokeTraqAuthRequest { - return RevokeTraqAuthRequestFromJSONTyped(json, false); -} - -export function RevokeTraqAuthRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevokeTraqAuthRequest { - if (json == null) { - return json; - } - return { - - 'token': json['token'], - }; -} - - export function RevokeTraqAuthRequestToJSON(json: any): RevokeTraqAuthRequest { - return RevokeTraqAuthRequestToJSONTyped(json, false); - } - - export function RevokeTraqAuthRequestToJSONTyped(value?: RevokeTraqAuthRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'token': value['token'], - }; -} - diff --git a/src/api/models/Role.ts b/src/api/models/Role.ts deleted file mode 100644 index 774ab05..0000000 --- a/src/api/models/Role.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** - * ユーザの役割 - * - * * `Admin` - Admin - * * `traPUser` - AdminでないtraP部員 - * * `CommonUser` - Adminでない一般ユーザー(traP部員以外のユーザー) - * @export - */ -export const Role = { - Admin: 'Admin', - TraPUser: 'traPUser', - CommonUser: 'CommonUser' -} as const; -export type Role = typeof Role[keyof typeof Role]; - - -export function instanceOfRole(value: any): boolean { - for (const key in Role) { - if (Object.prototype.hasOwnProperty.call(Role, key)) { - if (Role[key as keyof typeof Role] === value) { - return true; - } - } - } - return false; -} - -export function RoleFromJSON(json: any): Role { - return RoleFromJSONTyped(json, false); -} - -export function RoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Role { - return json as Role; -} - -export function RoleToJSON(value?: Role | null): any { - return value as any; -} - -export function RoleToJSONTyped(value: any, ignoreDiscriminator: boolean): Role { - return value as Role; -} - diff --git a/src/api/models/Signup.ts b/src/api/models/Signup.ts deleted file mode 100644 index 924e9e7..0000000 --- a/src/api/models/Signup.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * email+password登録 - * @export - * @interface Signup - */ -export interface Signup { - /** - * - * @type {string} - * @memberof Signup - */ - userName: string; - /** - * - * @type {string} - * @memberof Signup - */ - password: string; - /** - * - * @type {string} - * @memberof Signup - */ - token: string; -} - -/** - * Check if a given object implements the Signup interface. - */ -export function instanceOfSignup(value: object): value is Signup { - if (!('userName' in value) || value['userName'] === undefined) return false; - if (!('password' in value) || value['password'] === undefined) return false; - if (!('token' in value) || value['token'] === undefined) return false; - return true; -} - -export function SignupFromJSON(json: any): Signup { - return SignupFromJSONTyped(json, false); -} - -export function SignupFromJSONTyped(json: any, ignoreDiscriminator: boolean): Signup { - if (json == null) { - return json; - } - return { - - 'userName': json['userName'], - 'password': json['password'], - 'token': json['token'], - }; -} - - export function SignupToJSON(json: any): Signup { - return SignupToJSONTyped(json, false); - } - - export function SignupToJSONTyped(value?: Signup | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'userName': value['userName'], - 'password': value['password'], - 'token': value['token'], - }; -} - diff --git a/src/api/models/SignupRequest.ts b/src/api/models/SignupRequest.ts deleted file mode 100644 index aa8034b..0000000 --- a/src/api/models/SignupRequest.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * Signupのリクエスト - * @export - * @interface SignupRequest - */ -export interface SignupRequest { - /** - * - * @type {string} - * @memberof SignupRequest - */ - email: string; -} - -/** - * Check if a given object implements the SignupRequest interface. - */ -export function instanceOfSignupRequest(value: object): value is SignupRequest { - if (!('email' in value) || value['email'] === undefined) return false; - return true; -} - -export function SignupRequestFromJSON(json: any): SignupRequest { - return SignupRequestFromJSONTyped(json, false); -} - -export function SignupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignupRequest { - if (json == null) { - return json; - } - return { - - 'email': json['email'], - }; -} - - export function SignupRequestToJSON(json: any): SignupRequest { - return SignupRequestToJSONTyped(json, false); - } - - export function SignupRequestToJSONTyped(value?: SignupRequest | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'email': value['email'], - }; -} - diff --git a/src/api/models/Submission.ts b/src/api/models/Submission.ts deleted file mode 100644 index 7626142..0000000 --- a/src/api/models/Submission.ts +++ /dev/null @@ -1,179 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { JudgeStatus } from './JudgeStatus'; -import { - JudgeStatusFromJSON, - JudgeStatusFromJSONTyped, - JudgeStatusToJSON, - JudgeStatusToJSONTyped, -} from './JudgeStatus'; -import type { JudgeResult } from './JudgeResult'; -import { - JudgeResultFromJSON, - JudgeResultFromJSONTyped, - JudgeResultToJSON, - JudgeResultToJSONTyped, -} from './JudgeResult'; - -/** - * 提出の詳細 - * @export - * @interface Submission - */ -export interface Submission { - /** - * 提出ID - * @type {string} - * @memberof Submission - */ - id: string; - /** - * 提出ユーザーID - * @type {number} - * @memberof Submission - */ - userId: number; - /** - * - * @type {string} - * @memberof Submission - */ - userName: string; - /** - * 問題ID - * @type {number} - * @memberof Submission - */ - problemId: number; - /** - * 提出日時 - * @type {Date} - * @memberof Submission - */ - submittedAt: Date; - /** - * 提出コードの言語ID - * @type {number} - * @memberof Submission - */ - languageId: number; - /** - * スコアの合計 - * @type {number} - * @memberof Submission - */ - totalScore: number; - /** - * 実行時間の最大値 (ms) - * @type {number} - * @memberof Submission - */ - maxTime: number; - /** - * メモリ使用量の最大値 (MiB) - * @type {number} - * @memberof Submission - */ - maxMemory: number; - /** - * - * @type {number} - * @memberof Submission - */ - codeLength?: number; - /** - * - * @type {JudgeStatus} - * @memberof Submission - */ - overallJudgeStatus?: JudgeStatus; - /** - * - * @type {Array} - * @memberof Submission - */ - judgeResults?: Array; -} - - - -/** - * Check if a given object implements the Submission interface. - */ -export function instanceOfSubmission(value: object): value is Submission { - if (!('id' in value) || value['id'] === undefined) return false; - if (!('userId' in value) || value['userId'] === undefined) return false; - if (!('userName' in value) || value['userName'] === undefined) return false; - if (!('problemId' in value) || value['problemId'] === undefined) return false; - if (!('submittedAt' in value) || value['submittedAt'] === undefined) return false; - if (!('languageId' in value) || value['languageId'] === undefined) return false; - if (!('totalScore' in value) || value['totalScore'] === undefined) return false; - if (!('maxTime' in value) || value['maxTime'] === undefined) return false; - if (!('maxMemory' in value) || value['maxMemory'] === undefined) return false; - return true; -} - -export function SubmissionFromJSON(json: any): Submission { - return SubmissionFromJSONTyped(json, false); -} - -export function SubmissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Submission { - if (json == null) { - return json; - } - return { - - 'id': json['id'], - 'userId': json['userId'], - 'userName': json['userName'], - 'problemId': json['problemId'], - 'submittedAt': (new Date(json['submittedAt'])), - 'languageId': json['languageId'], - 'totalScore': json['totalScore'], - 'maxTime': json['maxTime'], - 'maxMemory': json['maxMemory'], - 'codeLength': json['codeLength'] == null ? undefined : json['codeLength'], - 'overallJudgeStatus': json['overallJudgeStatus'] == null ? undefined : JudgeStatusFromJSON(json['overallJudgeStatus']), - 'judgeResults': json['judgeResults'] == null ? undefined : ((json['judgeResults'] as Array).map(JudgeResultFromJSON)), - }; -} - - export function SubmissionToJSON(json: any): Submission { - return SubmissionToJSONTyped(json, false); - } - - export function SubmissionToJSONTyped(value?: Submission | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'userId': value['userId'], - 'userName': value['userName'], - 'problemId': value['problemId'], - 'submittedAt': ((value['submittedAt']).toISOString()), - 'languageId': value['languageId'], - 'totalScore': value['totalScore'], - 'maxTime': value['maxTime'], - 'maxMemory': value['maxMemory'], - 'codeLength': value['codeLength'], - 'overallJudgeStatus': JudgeStatusToJSON(value['overallJudgeStatus']), - 'judgeResults': value['judgeResults'] == null ? undefined : ((value['judgeResults'] as Array).map(JudgeResultToJSON)), - }; -} - diff --git a/src/api/models/SubmissionSummaries.ts b/src/api/models/SubmissionSummaries.ts deleted file mode 100644 index e08266f..0000000 --- a/src/api/models/SubmissionSummaries.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { SubmissionSummary } from './SubmissionSummary'; -import { - SubmissionSummaryFromJSON, - SubmissionSummaryFromJSONTyped, - SubmissionSummaryToJSON, - SubmissionSummaryToJSONTyped, -} from './SubmissionSummary'; - -/** - * 提出一覧 - * @export - * @interface SubmissionSummaries - */ -export interface SubmissionSummaries { - /** - * - * @type {number} - * @memberof SubmissionSummaries - */ - total?: number; - /** - * - * @type {Array} - * @memberof SubmissionSummaries - */ - problems?: Array; -} - -/** - * Check if a given object implements the SubmissionSummaries interface. - */ -export function instanceOfSubmissionSummaries(value: object): value is SubmissionSummaries { - return true; -} - -export function SubmissionSummariesFromJSON(json: any): SubmissionSummaries { - return SubmissionSummariesFromJSONTyped(json, false); -} - -export function SubmissionSummariesFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionSummaries { - if (json == null) { - return json; - } - return { - - 'total': json['total'] == null ? undefined : json['total'], - 'problems': json['problems'] == null ? undefined : ((json['problems'] as Array).map(SubmissionSummaryFromJSON)), - }; -} - - export function SubmissionSummariesToJSON(json: any): SubmissionSummaries { - return SubmissionSummariesToJSONTyped(json, false); - } - - export function SubmissionSummariesToJSONTyped(value?: SubmissionSummaries | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'total': value['total'], - 'problems': value['problems'] == null ? undefined : ((value['problems'] as Array).map(SubmissionSummaryToJSON)), - }; -} - diff --git a/src/api/models/SubmissionSummary.ts b/src/api/models/SubmissionSummary.ts deleted file mode 100644 index b2ccd1b..0000000 --- a/src/api/models/SubmissionSummary.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { JudgeStatus } from './JudgeStatus'; -import { - JudgeStatusFromJSON, - JudgeStatusFromJSONTyped, - JudgeStatusToJSON, - JudgeStatusToJSONTyped, -} from './JudgeStatus'; - -/** - * 提出 - * @export - * @interface SubmissionSummary - */ -export interface SubmissionSummary { - /** - * 提出ID - * @type {string} - * @memberof SubmissionSummary - */ - id: string; - /** - * 問題ID - * @type {number} - * @memberof SubmissionSummary - */ - problemId: number; - /** - * 提出ユーザーID - * @type {number} - * @memberof SubmissionSummary - */ - userId: number; - /** - * - * @type {string} - * @memberof SubmissionSummary - */ - userName: string; - /** - * 提出日時 - * @type {Date} - * @memberof SubmissionSummary - */ - submittedAt: Date; - /** - * 提出コードの言語ID - * @type {number} - * @memberof SubmissionSummary - */ - languageId: number; - /** - * スコアの合計 - * @type {number} - * @memberof SubmissionSummary - */ - totalScore: number; - /** - * 実行時間の最大値 (ms) - * @type {number} - * @memberof SubmissionSummary - */ - maxTime: number; - /** - * メモリ使用量の最大値 (MiB) - * @type {number} - * @memberof SubmissionSummary - */ - maxMemory: number; - /** - * - * @type {number} - * @memberof SubmissionSummary - */ - codeLength: number; - /** - * - * @type {JudgeStatus} - * @memberof SubmissionSummary - */ - judgeStatus: JudgeStatus; -} - - - -/** - * Check if a given object implements the SubmissionSummary interface. - */ -export function instanceOfSubmissionSummary(value: object): value is SubmissionSummary { - if (!('id' in value) || value['id'] === undefined) return false; - if (!('problemId' in value) || value['problemId'] === undefined) return false; - if (!('userId' in value) || value['userId'] === undefined) return false; - if (!('userName' in value) || value['userName'] === undefined) return false; - if (!('submittedAt' in value) || value['submittedAt'] === undefined) return false; - if (!('languageId' in value) || value['languageId'] === undefined) return false; - if (!('totalScore' in value) || value['totalScore'] === undefined) return false; - if (!('maxTime' in value) || value['maxTime'] === undefined) return false; - if (!('maxMemory' in value) || value['maxMemory'] === undefined) return false; - if (!('codeLength' in value) || value['codeLength'] === undefined) return false; - if (!('judgeStatus' in value) || value['judgeStatus'] === undefined) return false; - return true; -} - -export function SubmissionSummaryFromJSON(json: any): SubmissionSummary { - return SubmissionSummaryFromJSONTyped(json, false); -} - -export function SubmissionSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmissionSummary { - if (json == null) { - return json; - } - return { - - 'id': json['id'], - 'problemId': json['problemId'], - 'userId': json['userId'], - 'userName': json['userName'], - 'submittedAt': (new Date(json['submittedAt'])), - 'languageId': json['languageId'], - 'totalScore': json['totalScore'], - 'maxTime': json['maxTime'], - 'maxMemory': json['maxMemory'], - 'codeLength': json['codeLength'], - 'judgeStatus': JudgeStatusFromJSON(json['judgeStatus']), - }; -} - - export function SubmissionSummaryToJSON(json: any): SubmissionSummary { - return SubmissionSummaryToJSONTyped(json, false); - } - - export function SubmissionSummaryToJSONTyped(value?: SubmissionSummary | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'problemId': value['problemId'], - 'userId': value['userId'], - 'userName': value['userName'], - 'submittedAt': ((value['submittedAt']).toISOString()), - 'languageId': value['languageId'], - 'totalScore': value['totalScore'], - 'maxTime': value['maxTime'], - 'maxMemory': value['maxMemory'], - 'codeLength': value['codeLength'], - 'judgeStatus': JudgeStatusToJSON(value['judgeStatus']), - }; -} - diff --git a/src/api/models/Testcase.ts b/src/api/models/Testcase.ts deleted file mode 100644 index 14a9f5f..0000000 --- a/src/api/models/Testcase.ts +++ /dev/null @@ -1,111 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * テストケース - * @export - * @interface Testcase - */ -export interface Testcase { - /** - * - * @type {string} - * @memberof Testcase - */ - name: string; - /** - * - * @type {string} - * @memberof Testcase - */ - id: string; - /** - * - * @type {string} - * @memberof Testcase - */ - testInput: string; - /** - * - * @type {string} - * @memberof Testcase - */ - testOutput: string; - /** - * - * @type {Date} - * @memberof Testcase - */ - createdAt: Date; - /** - * - * @type {Date} - * @memberof Testcase - */ - updatedAt: Date; -} - -/** - * Check if a given object implements the Testcase interface. - */ -export function instanceOfTestcase(value: object): value is Testcase { - if (!('name' in value) || value['name'] === undefined) return false; - if (!('id' in value) || value['id'] === undefined) return false; - if (!('testInput' in value) || value['testInput'] === undefined) return false; - if (!('testOutput' in value) || value['testOutput'] === undefined) return false; - if (!('createdAt' in value) || value['createdAt'] === undefined) return false; - if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; - return true; -} - -export function TestcaseFromJSON(json: any): Testcase { - return TestcaseFromJSONTyped(json, false); -} - -export function TestcaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Testcase { - if (json == null) { - return json; - } - return { - - 'name': json['name'], - 'id': json['id'], - 'testInput': json['testInput'], - 'testOutput': json['testOutput'], - 'createdAt': (new Date(json['createdAt'])), - 'updatedAt': (new Date(json['updatedAt'])), - }; -} - - export function TestcaseToJSON(json: any): Testcase { - return TestcaseToJSONTyped(json, false); - } - - export function TestcaseToJSONTyped(value?: Testcase | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'name': value['name'], - 'id': value['id'], - 'testInput': value['testInput'], - 'testOutput': value['testOutput'], - 'createdAt': ((value['createdAt']).toISOString()), - 'updatedAt': ((value['updatedAt']).toISOString()), - }; -} - diff --git a/src/api/models/TestcaseSummaries.ts b/src/api/models/TestcaseSummaries.ts deleted file mode 100644 index 57a6947..0000000 --- a/src/api/models/TestcaseSummaries.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { TestcaseSummary } from './TestcaseSummary'; -import { - TestcaseSummaryFromJSON, - TestcaseSummaryFromJSONTyped, - TestcaseSummaryToJSON, - TestcaseSummaryToJSONTyped, -} from './TestcaseSummary'; - -/** - * - * @export - * @interface TestcaseSummaries - */ -export interface TestcaseSummaries { - /** - * - * @type {Array} - * @memberof TestcaseSummaries - */ - testcaseSummaries?: Array; -} - -/** - * Check if a given object implements the TestcaseSummaries interface. - */ -export function instanceOfTestcaseSummaries(value: object): value is TestcaseSummaries { - return true; -} - -export function TestcaseSummariesFromJSON(json: any): TestcaseSummaries { - return TestcaseSummariesFromJSONTyped(json, false); -} - -export function TestcaseSummariesFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestcaseSummaries { - if (json == null) { - return json; - } - return { - - 'testcaseSummaries': json['testcaseSummaries'] == null ? undefined : ((json['testcaseSummaries'] as Array).map(TestcaseSummaryFromJSON)), - }; -} - - export function TestcaseSummariesToJSON(json: any): TestcaseSummaries { - return TestcaseSummariesToJSONTyped(json, false); - } - - export function TestcaseSummariesToJSONTyped(value?: TestcaseSummaries | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'testcaseSummaries': value['testcaseSummaries'] == null ? undefined : ((value['testcaseSummaries'] as Array).map(TestcaseSummaryToJSON)), - }; -} - diff --git a/src/api/models/TestcaseSummary.ts b/src/api/models/TestcaseSummary.ts deleted file mode 100644 index 624fa97..0000000 --- a/src/api/models/TestcaseSummary.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * - * @export - * @interface TestcaseSummary - */ -export interface TestcaseSummary { - /** - * - * @type {string} - * @memberof TestcaseSummary - */ - id?: string; - /** - * - * @type {string} - * @memberof TestcaseSummary - */ - name?: string; - /** - * - * @type {Date} - * @memberof TestcaseSummary - */ - createdAt?: Date; - /** - * - * @type {Date} - * @memberof TestcaseSummary - */ - updatedAt?: Date; -} - -/** - * Check if a given object implements the TestcaseSummary interface. - */ -export function instanceOfTestcaseSummary(value: object): value is TestcaseSummary { - return true; -} - -export function TestcaseSummaryFromJSON(json: any): TestcaseSummary { - return TestcaseSummaryFromJSONTyped(json, false); -} - -export function TestcaseSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestcaseSummary { - if (json == null) { - return json; - } - return { - - 'id': json['id'] == null ? undefined : json['id'], - 'name': json['name'] == null ? undefined : json['name'], - 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), - 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), - }; -} - - export function TestcaseSummaryToJSON(json: any): TestcaseSummary { - return TestcaseSummaryToJSONTyped(json, false); - } - - export function TestcaseSummaryToJSONTyped(value?: TestcaseSummary | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'name': value['name'], - 'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()), - 'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()), - }; -} - diff --git a/src/api/models/User.ts b/src/api/models/User.ts deleted file mode 100644 index 051cee5..0000000 --- a/src/api/models/User.ts +++ /dev/null @@ -1,190 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -import type { Role } from './Role'; -import { - RoleFromJSON, - RoleFromJSONTyped, - RoleToJSON, - RoleToJSONTyped, -} from './Role'; -import type { SubmissionSummaries } from './SubmissionSummaries'; -import { - SubmissionSummariesFromJSON, - SubmissionSummariesFromJSONTyped, - SubmissionSummariesToJSON, - SubmissionSummariesToJSONTyped, -} from './SubmissionSummaries'; -import type { ProblemSummaries } from './ProblemSummaries'; -import { - ProblemSummariesFromJSON, - ProblemSummariesFromJSONTyped, - ProblemSummariesToJSON, - ProblemSummariesToJSONTyped, -} from './ProblemSummaries'; - -/** - * ユーザー情報 - * @export - * @interface User - */ -export interface User { - /** - * ユーザーID - * @type {string} - * @memberof User - */ - id: string; - /** - * ユーザー名 - * @type {string} - * @memberof User - */ - name: string; - /** - * traQのID - * @type {string} - * @memberof User - */ - traqId?: string; - /** - * GitHubのID - * @type {string} - * @memberof User - */ - githubId?: string; - /** - * - * @type {string} - * @memberof User - */ - iconUrl?: string; - /** - * - * @type {ProblemSummaries} - * @memberof User - */ - postProblems?: ProblemSummaries; - /** - * - * @type {SubmissionSummaries} - * @memberof User - */ - submitProblems?: SubmissionSummaries; - /** - * - * @type {string} - * @memberof User - */ - xLink?: string; - /** - * - * @type {string} - * @memberof User - */ - githubLink?: string; - /** - * - * @type {string} - * @memberof User - */ - selfIntroduction?: string; - /** - * - * @type {Role} - * @memberof User - */ - role: Role; - /** - * - * @type {Date} - * @memberof User - */ - createdAt: Date; - /** - * - * @type {Date} - * @memberof User - */ - updatedAt: Date; -} - - - -/** - * Check if a given object implements the User interface. - */ -export function instanceOfUser(value: object): value is User { - if (!('id' in value) || value['id'] === undefined) return false; - if (!('name' in value) || value['name'] === undefined) return false; - if (!('role' in value) || value['role'] === undefined) return false; - if (!('createdAt' in value) || value['createdAt'] === undefined) return false; - if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; - return true; -} - -export function UserFromJSON(json: any): User { - return UserFromJSONTyped(json, false); -} - -export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { - if (json == null) { - return json; - } - return { - - 'id': json['id'], - 'name': json['name'], - 'traqId': json['traqId'] == null ? undefined : json['traqId'], - 'githubId': json['githubId'] == null ? undefined : json['githubId'], - 'iconUrl': json['iconUrl'] == null ? undefined : json['iconUrl'], - 'postProblems': json['postProblems'] == null ? undefined : ProblemSummariesFromJSON(json['postProblems']), - 'submitProblems': json['submitProblems'] == null ? undefined : SubmissionSummariesFromJSON(json['submitProblems']), - 'xLink': json['xLink'] == null ? undefined : json['xLink'], - 'githubLink': json['githubLink'] == null ? undefined : json['githubLink'], - 'selfIntroduction': json['selfIntroduction'] == null ? undefined : json['selfIntroduction'], - 'role': RoleFromJSON(json['role']), - 'createdAt': (new Date(json['createdAt'])), - 'updatedAt': (new Date(json['updatedAt'])), - }; -} - - export function UserToJSON(json: any): User { - return UserToJSONTyped(json, false); - } - - export function UserToJSONTyped(value?: User | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'id': value['id'], - 'name': value['name'], - 'traqId': value['traqId'], - 'githubId': value['githubId'], - 'iconUrl': value['iconUrl'], - 'postProblems': ProblemSummariesToJSON(value['postProblems']), - 'submitProblems': SubmissionSummariesToJSON(value['submitProblems']), - 'xLink': value['xLink'], - 'githubLink': value['githubLink'], - 'selfIntroduction': value['selfIntroduction'], - 'role': RoleToJSON(value['role']), - 'createdAt': ((value['createdAt']).toISOString()), - 'updatedAt': ((value['updatedAt']).toISOString()), - }; -} - diff --git a/src/api/models/UserEmailAndPassword.ts b/src/api/models/UserEmailAndPassword.ts deleted file mode 100644 index 32c49b1..0000000 --- a/src/api/models/UserEmailAndPassword.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { mapValues } from '../runtime'; -/** - * login - * @export - * @interface UserEmailAndPassword - */ -export interface UserEmailAndPassword { - /** - * - * @type {string} - * @memberof UserEmailAndPassword - */ - email: string; - /** - * - * @type {string} - * @memberof UserEmailAndPassword - */ - password: string; -} - -/** - * Check if a given object implements the UserEmailAndPassword interface. - */ -export function instanceOfUserEmailAndPassword(value: object): value is UserEmailAndPassword { - if (!('email' in value) || value['email'] === undefined) return false; - if (!('password' in value) || value['password'] === undefined) return false; - return true; -} - -export function UserEmailAndPasswordFromJSON(json: any): UserEmailAndPassword { - return UserEmailAndPasswordFromJSONTyped(json, false); -} - -export function UserEmailAndPasswordFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserEmailAndPassword { - if (json == null) { - return json; - } - return { - - 'email': json['email'], - 'password': json['password'], - }; -} - - export function UserEmailAndPasswordToJSON(json: any): UserEmailAndPassword { - return UserEmailAndPasswordToJSONTyped(json, false); - } - - export function UserEmailAndPasswordToJSONTyped(value?: UserEmailAndPassword | null, ignoreDiscriminator: boolean = false): any { - if (value == null) { - return value; - } - - return { - - 'email': value['email'], - 'password': value['password'], - }; -} - diff --git a/src/api/models/index.ts b/src/api/models/index.ts deleted file mode 100644 index 85031c1..0000000 --- a/src/api/models/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -export * from './Editorial'; -export * from './EditorialSummary'; -export * from './Email'; -export * from './GetGoogleAuthParams200Response'; -export * from './GetGoogleAuthParams500Response'; -export * from './JudgeResult'; -export * from './JudgeStatus'; -export * from './Language'; -export * from './PostEditorialRequest'; -export * from './PostProblemRequest'; -export * from './PostSubmissionRequest'; -export * from './PostTestcaseRequestInner'; -export * from './Problem'; -export * from './ProblemSummaries'; -export * from './ProblemSummary'; -export * from './PutEditorialRequest'; -export * from './PutMeRequest'; -export * from './PutPasswordRequest'; -export * from './PutProblemRequest'; -export * from './PutTestcaseRequest'; -export * from './ResetPasswordRequest'; -export * from './RevokeTraqAuth400Response'; -export * from './RevokeTraqAuthRequest'; -export * from './Role'; -export * from './Signup'; -export * from './SignupRequest'; -export * from './Submission'; -export * from './SubmissionSummaries'; -export * from './SubmissionSummary'; -export * from './Testcase'; -export * from './TestcaseSummaries'; -export * from './TestcaseSummary'; -export * from './User'; -export * from './UserEmailAndPassword'; diff --git a/src/api/runtime.ts b/src/api/runtime.ts deleted file mode 100644 index 82d88e5..0000000 --- a/src/api/runtime.ts +++ /dev/null @@ -1,431 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * traO Judge API - * traO Judge API (front ↔ back) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); - -export interface ConfigurationParameters { - basePath?: string; // override base path - fetchApi?: FetchAPI; // override for fetch implementation - middleware?: Middleware[]; // middleware to apply before/after fetch requests - queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings - username?: string; // parameter for basic security - password?: string; // parameter for basic security - apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security - headers?: HTTPHeaders; //header params we want to use on every request - credentials?: RequestCredentials; //value for the credentials param we want to use on each request -} - -export class Configuration { - constructor(private configuration: ConfigurationParameters = {}) {} - - set config(configuration: Configuration) { - this.configuration = configuration; - } - - get basePath(): string { - return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; - } - - get fetchApi(): FetchAPI | undefined { - return this.configuration.fetchApi; - } - - get middleware(): Middleware[] { - return this.configuration.middleware || []; - } - - get queryParamsStringify(): (params: HTTPQuery) => string { - return this.configuration.queryParamsStringify || querystring; - } - - get username(): string | undefined { - return this.configuration.username; - } - - get password(): string | undefined { - return this.configuration.password; - } - - get apiKey(): ((name: string) => string | Promise) | undefined { - const apiKey = this.configuration.apiKey; - if (apiKey) { - return typeof apiKey === 'function' ? apiKey : () => apiKey; - } - return undefined; - } - - get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { - const accessToken = this.configuration.accessToken; - if (accessToken) { - return typeof accessToken === 'function' ? accessToken : async () => accessToken; - } - return undefined; - } - - get headers(): HTTPHeaders | undefined { - return this.configuration.headers; - } - - get credentials(): RequestCredentials | undefined { - return this.configuration.credentials; - } -} - -export const DefaultConfig = new Configuration(); - -/** - * This is the base class for all generated API classes. - */ -export class BaseAPI { - - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); - private middleware: Middleware[]; - - constructor(protected configuration = DefaultConfig) { - this.middleware = configuration.middleware; - } - - withMiddleware(this: T, ...middlewares: Middleware[]) { - const next = this.clone(); - next.middleware = next.middleware.concat(...middlewares); - return next; - } - - withPreMiddleware(this: T, ...preMiddlewares: Array) { - const middlewares = preMiddlewares.map((pre) => ({ pre })); - return this.withMiddleware(...middlewares); - } - - withPostMiddleware(this: T, ...postMiddlewares: Array) { - const middlewares = postMiddlewares.map((post) => ({ post })); - return this.withMiddleware(...middlewares); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - protected isJsonMime(mime: string | null | undefined): boolean { - if (!mime) { - return false; - } - return BaseAPI.jsonRegex.test(mime); - } - - protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { - const { url, init } = await this.createFetchParams(context, initOverrides); - const response = await this.fetchApi(url, init); - if (response && (response.status >= 200 && response.status < 300)) { - return response; - } - throw new ResponseError(response, 'Response returned an error code'); - } - - private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { - let url = this.configuration.basePath + context.path; - if (context.query !== undefined && Object.keys(context.query).length !== 0) { - // only add the querystring to the URL if there are query parameters. - // this is done to avoid urls ending with a "?" character which buggy webservers - // do not handle correctly sometimes. - url += '?' + this.configuration.queryParamsStringify(context.query); - } - - const headers = Object.assign({}, this.configuration.headers, context.headers); - Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); - - const initOverrideFn = - typeof initOverrides === "function" - ? initOverrides - : async () => initOverrides; - - const initParams = { - method: context.method, - headers, - body: context.body, - credentials: this.configuration.credentials, - }; - - const overriddenInit: RequestInit = { - ...initParams, - ...(await initOverrideFn({ - init: initParams, - context, - })) - }; - - let body: any; - if (isFormData(overriddenInit.body) - || (overriddenInit.body instanceof URLSearchParams) - || isBlob(overriddenInit.body)) { - body = overriddenInit.body; - } else if (this.isJsonMime(headers['Content-Type'])) { - body = JSON.stringify(overriddenInit.body); - } else { - body = overriddenInit.body; - } - - const init: RequestInit = { - ...overriddenInit, - body - }; - - return { url, init }; - } - - private fetchApi = async (url: string, init: RequestInit) => { - let fetchParams = { url, init }; - for (const middleware of this.middleware) { - if (middleware.pre) { - fetchParams = await middleware.pre({ - fetch: this.fetchApi, - ...fetchParams, - }) || fetchParams; - } - } - let response: Response | undefined = undefined; - try { - response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); - } catch (e) { - for (const middleware of this.middleware) { - if (middleware.onError) { - response = await middleware.onError({ - fetch: this.fetchApi, - url: fetchParams.url, - init: fetchParams.init, - error: e, - response: response ? response.clone() : undefined, - }) || response; - } - } - if (response === undefined) { - if (e instanceof Error) { - throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); - } else { - throw e; - } - } - } - for (const middleware of this.middleware) { - if (middleware.post) { - response = await middleware.post({ - fetch: this.fetchApi, - url: fetchParams.url, - init: fetchParams.init, - response: response.clone(), - }) || response; - } - } - return response; - } - - /** - * Create a shallow clone of `this` by constructing a new instance - * and then shallow cloning data members. - */ - private clone(this: T): T { - const constructor = this.constructor as any; - const next = new constructor(this.configuration); - next.middleware = this.middleware.slice(); - return next; - } -}; - -function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob; -} - -function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData; -} - -export class ResponseError extends Error { - override name: "ResponseError" = "ResponseError"; - constructor(public response: Response, msg?: string) { - super(msg); - } -} - -export class FetchError extends Error { - override name: "FetchError" = "FetchError"; - constructor(public cause: Error, msg?: string) { - super(msg); - } -} - -export class RequiredError extends Error { - override name: "RequiredError" = "RequiredError"; - constructor(public field: string, msg?: string) { - super(msg); - } -} - -export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -}; - -export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; - -export type Json = any; -export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; -export type HTTPHeaders = { [key: string]: string }; -export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; -export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; -export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; - -export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise - -export interface FetchParams { - url: string; - init: RequestInit; -} - -export interface RequestOpts { - path: string; - method: HTTPMethod; - headers: HTTPHeaders; - query?: HTTPQuery; - body?: HTTPBody; -} - -export function querystring(params: HTTPQuery, prefix: string = ''): string { - return Object.keys(params) - .map(key => querystringSingleKey(key, params[key], prefix)) - .filter(part => part.length > 0) - .join('&'); -} - -function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { - const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); - if (value instanceof Array) { - const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) - .join(`&${encodeURIComponent(fullKey)}=`); - return `${encodeURIComponent(fullKey)}=${multiValue}`; - } - if (value instanceof Set) { - const valueAsArray = Array.from(value); - return querystringSingleKey(key, valueAsArray, keyPrefix); - } - if (value instanceof Date) { - return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; - } - if (value instanceof Object) { - return querystring(value as HTTPQuery, fullKey); - } - return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; -} - -export function exists(json: any, key: string) { - const value = json[key]; - return value !== null && value !== undefined; -} - -export function mapValues(data: any, fn: (item: any) => any) { - return Object.keys(data).reduce( - (acc, key) => ({ ...acc, [key]: fn(data[key]) }), - {} - ); -} - -export function canConsumeForm(consumes: Consume[]): boolean { - for (const consume of consumes) { - if ('multipart/form-data' === consume.contentType) { - return true; - } - } - return false; -} - -export interface Consume { - contentType: string; -} - -export interface RequestContext { - fetch: FetchAPI; - url: string; - init: RequestInit; -} - -export interface ResponseContext { - fetch: FetchAPI; - url: string; - init: RequestInit; - response: Response; -} - -export interface ErrorContext { - fetch: FetchAPI; - url: string; - init: RequestInit; - error: unknown; - response?: Response; -} - -export interface Middleware { - pre?(context: RequestContext): Promise; - post?(context: ResponseContext): Promise; - onError?(context: ErrorContext): Promise; -} - -export interface ApiResponse { - raw: Response; - value(): Promise; -} - -export interface ResponseTransformer { - (json: any): T; -} - -export class JSONApiResponse { - constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} - - async value(): Promise { - return this.transformer(await this.raw.json()); - } -} - -export class VoidApiResponse { - constructor(public raw: Response) {} - - async value(): Promise { - return undefined; - } -} - -export class BlobApiResponse { - constructor(public raw: Response) {} - - async value(): Promise { - return await this.raw.blob(); - }; -} - -export class TextApiResponse { - constructor(public raw: Response) {} - - async value(): Promise { - return await this.raw.text(); - }; -}