diff --git a/.claude/settings.local.json b/.claude/settings.local.json index d7cffefe..84eea3a4 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -8,9 +8,18 @@ "Bash(./gradlew:*)", "Bash(docker-compose up:*)", "Bash(docker-compose:*)", - "Bash(docker logs:*)" + "Bash(docker logs:*)", + "mcp__serena__get_current_config", + "mcp__serena__check_onboarding_performed", + "mcp__serena__onboarding", + "mcp__serena__list_dir", + "mcp__serena__find_file", + "mcp__serena__write_memory", + "mcp__serena__think_about_whether_you_are_done", + "mcp__serena__search_for_pattern", + "Bash(cat:*)" ], "deny": [], "ask": [] } -} \ No newline at end of file +} diff --git a/.github/linters/.redocly.yaml b/.github/linters/.redocly.yaml new file mode 100644 index 00000000..976079dc --- /dev/null +++ b/.github/linters/.redocly.yaml @@ -0,0 +1,5 @@ +apis: + main: + root: api-spec/root.json +rules: + no-unresolved-refs: off diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28d54d5a..87e35e55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,11 @@ jobs: filters: | backend: - 'backend/**' + - 'api-spec/**' - '.github/workflows/**' frontend: - 'frontend/**' + - 'api-spec/**' - '.github/workflows/**' backend_lint: diff --git a/.gitignore b/.gitignore index 6c3aca4e..4e0904c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.serena +# Serena memory files (local AI assistant context) +.serena/ diff --git a/backend/src/main/resources/api-spec/headers/set-cookie.json b/api-spec/headers/set-cookie.json similarity index 100% rename from backend/src/main/resources/api-spec/headers/set-cookie.json rename to api-spec/headers/set-cookie.json diff --git a/backend/src/main/resources/api-spec/model/accountLink.json b/api-spec/model/accountLink.json similarity index 90% rename from backend/src/main/resources/api-spec/model/accountLink.json rename to api-spec/model/accountLink.json index 2191ed22..cb0fc3c9 100644 --- a/backend/src/main/resources/api-spec/model/accountLink.json +++ b/api-spec/model/accountLink.json @@ -9,7 +9,7 @@ }, "linking": { "type": "boolean", - "example": "true" + "example": true } }, "required": [ diff --git a/backend/src/main/resources/api-spec/model/comment.json b/api-spec/model/comment.json similarity index 100% rename from backend/src/main/resources/api-spec/model/comment.json rename to api-spec/model/comment.json diff --git a/backend/src/main/resources/api-spec/model/comments.json b/api-spec/model/comments.json similarity index 100% rename from backend/src/main/resources/api-spec/model/comments.json rename to api-spec/model/comments.json diff --git a/backend/src/main/resources/api-spec/model/entries.json b/api-spec/model/entries.json similarity index 100% rename from backend/src/main/resources/api-spec/model/entries.json rename to api-spec/model/entries.json diff --git a/backend/src/main/resources/api-spec/model/entry.json b/api-spec/model/entry.json similarity index 100% rename from backend/src/main/resources/api-spec/model/entry.json rename to api-spec/model/entry.json diff --git a/backend/src/main/resources/api-spec/model/error/error400.json b/api-spec/model/error/error400.json similarity index 84% rename from backend/src/main/resources/api-spec/model/error/error400.json rename to api-spec/model/error/error400.json index ab30a6f0..e2fe69be 100644 --- a/backend/src/main/resources/api-spec/model/error/error400.json +++ b/api-spec/model/error/error400.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 400 + "enum": [400] }, "description": { "type": "string", - "const": "BadRequest" + "enum": ["BadRequest"] } }, "required": [ diff --git a/backend/src/main/resources/api-spec/model/error/error401.json b/api-spec/model/error/error401.json similarity index 83% rename from backend/src/main/resources/api-spec/model/error/error401.json rename to api-spec/model/error/error401.json index adba8259..791ccc4a 100644 --- a/backend/src/main/resources/api-spec/model/error/error401.json +++ b/api-spec/model/error/error401.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 401 + "enum": [401] }, "description": { "type": "string", - "const": "Unauthorized" + "enum": ["Unauthorized"] } }, "required": [ diff --git a/api-spec/model/error/error403.json b/api-spec/model/error/error403.json new file mode 100644 index 00000000..927b35f4 --- /dev/null +++ b/api-spec/model/error/error403.json @@ -0,0 +1,25 @@ +{ + "allOf": [ + { + "$ref": "./errorBase.json" + } + ], + "type": "object", + "properties": { + "status": { + "type": "integer", + "enum": [403] + }, + "description": { + "type": "string", + "enum": ["Forbidden"] + }, + "cause": { + "$ref": "./error403Cause.json" + } + }, + "required": [ + "status", + "description" + ] +} diff --git a/api-spec/model/error/error403Cause.json b/api-spec/model/error/error403Cause.json new file mode 100644 index 00000000..bef5afd8 --- /dev/null +++ b/api-spec/model/error/error403Cause.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "CsrfTokenRequired", + "CsrfHeaderRequired", + "InvalidOrigin" + ] + } + }, + "required": [ + "kind" + ] +} diff --git a/backend/src/main/resources/api-spec/model/error/error404.json b/api-spec/model/error/error404.json similarity index 84% rename from backend/src/main/resources/api-spec/model/error/error404.json rename to api-spec/model/error/error404.json index 0232fc11..7c909d60 100644 --- a/backend/src/main/resources/api-spec/model/error/error404.json +++ b/api-spec/model/error/error404.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 404 + "enum": [404] }, "description": { "type": "string", - "const": "NotFound" + "enum": ["NotFound"] } }, "required": [ diff --git a/backend/src/main/resources/api-spec/model/error/error409.json b/api-spec/model/error/error409.json similarity index 84% rename from backend/src/main/resources/api-spec/model/error/error409.json rename to api-spec/model/error/error409.json index 816da4b7..93bf577e 100644 --- a/backend/src/main/resources/api-spec/model/error/error409.json +++ b/api-spec/model/error/error409.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 409 + "enum": [409] }, "description": { "type": "string", - "const": "Conflict" + "enum": ["Conflict"] } }, "required": [ diff --git a/backend/src/main/resources/api-spec/model/error/errorBase.json b/api-spec/model/error/errorBase.json similarity index 91% rename from backend/src/main/resources/api-spec/model/error/errorBase.json rename to api-spec/model/error/errorBase.json index b786eb7e..bf57f89b 100644 --- a/backend/src/main/resources/api-spec/model/error/errorBase.json +++ b/api-spec/model/error/errorBase.json @@ -4,7 +4,7 @@ "status": { "type": "integer", "minimum": 400, - "exclusiveMaximum": 600, + "maximum": 599, "example": 401 }, "description": { diff --git a/backend/src/main/resources/api-spec/model/error/errorCause.json b/api-spec/model/error/errorCause.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/errorCause.json rename to api-spec/model/error/errorCause.json diff --git a/backend/src/main/resources/api-spec/model/health.json b/api-spec/model/health.json similarity index 100% rename from backend/src/main/resources/api-spec/model/health.json rename to api-spec/model/health.json diff --git a/backend/src/main/resources/api-spec/model/user.json b/api-spec/model/user.json similarity index 100% rename from backend/src/main/resources/api-spec/model/user.json rename to api-spec/model/user.json diff --git a/backend/src/main/resources/api-spec/model/userDetail.json b/api-spec/model/userDetail.json similarity index 100% rename from backend/src/main/resources/api-spec/model/userDetail.json rename to api-spec/model/userDetail.json diff --git a/backend/src/main/resources/api-spec/model/users.json b/api-spec/model/users.json similarity index 100% rename from backend/src/main/resources/api-spec/model/users.json rename to api-spec/model/users.json diff --git a/backend/src/main/resources/api-spec/path/comments/comments.json b/api-spec/path/comments/comments.json similarity index 100% rename from backend/src/main/resources/api-spec/path/comments/comments.json rename to api-spec/path/comments/comments.json diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/_serialNumber.json b/api-spec/path/entries/_serialNumber/_serialNumber.json similarity index 98% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/_serialNumber.json rename to api-spec/path/entries/_serialNumber/_serialNumber.json index fa018fa0..4dd01cc5 100644 --- a/backend/src/main/resources/api-spec/path/entries/_serialNumber/_serialNumber.json +++ b/api-spec/path/entries/_serialNumber/_serialNumber.json @@ -52,6 +52,7 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json b/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json similarity index 96% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json rename to api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json index 8a8f11f0..d10b9d62 100644 --- a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json +++ b/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json @@ -12,6 +12,7 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/comments.json b/api-spec/path/entries/_serialNumber/comments/comments.json similarity index 90% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/comments.json rename to api-spec/path/entries/_serialNumber/comments/comments.json index ed8d6081..197db55b 100644 --- a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/comments.json +++ b/api-spec/path/entries/_serialNumber/comments/comments.json @@ -28,7 +28,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Comments" + "$ref": "../../../../model/comments.json" } } } @@ -42,7 +42,7 @@ "content": { "application/json": { "schema": { - "$ref": "path/entries/_serialNumber/comments/commentsPostRequest.json" + "$ref": "./commentsPostRequest.json" } } } @@ -53,7 +53,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Comment" + "$ref": "../../../../model/comment.json" } } } @@ -65,6 +65,7 @@ "description": "unauthorized to create a new comment" }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json b/api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json rename to api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json b/api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json rename to api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json diff --git a/backend/src/main/resources/api-spec/path/entries/entries.json b/api-spec/path/entries/entries.json similarity index 98% rename from backend/src/main/resources/api-spec/path/entries/entries.json rename to api-spec/path/entries/entries.json index f8e6ff14..d95b269e 100644 --- a/backend/src/main/resources/api-spec/path/entries/entries.json +++ b/api-spec/path/entries/entries.json @@ -79,6 +79,7 @@ } }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/backend/src/main/resources/api-spec/path/entries/entriesPostRequest.json b/api-spec/path/entries/entriesPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/entriesPostRequest.json rename to api-spec/path/entries/entriesPostRequest.json diff --git a/backend/src/main/resources/api-spec/path/health/health.json b/api-spec/path/health/health.json similarity index 100% rename from backend/src/main/resources/api-spec/path/health/health.json rename to api-spec/path/health/health.json diff --git a/backend/src/main/resources/api-spec/path/sign-in/sign-in.json b/api-spec/path/sign-in/sign-in.json similarity index 92% rename from backend/src/main/resources/api-spec/path/sign-in/sign-in.json rename to api-spec/path/sign-in/sign-in.json index 550745d9..442e6308 100644 --- a/backend/src/main/resources/api-spec/path/sign-in/sign-in.json +++ b/api-spec/path/sign-in/sign-in.json @@ -29,6 +29,7 @@ } }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { @@ -38,6 +39,7 @@ } }, "404": { + "description": "Not Found", "content": { "application/json": { "schema": { @@ -47,6 +49,7 @@ } }, "409": { + "description": "Conflict", "content": { "application/json": { "schema": { diff --git a/backend/src/main/resources/api-spec/path/sign-in/sign-inPostRequest.json b/api-spec/path/sign-in/sign-inPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/sign-in/sign-inPostRequest.json rename to api-spec/path/sign-in/sign-inPostRequest.json diff --git a/backend/src/main/resources/api-spec/path/sign-out/responseOkHeaderSetCookie.json b/api-spec/path/sign-out/responseOkHeaderSetCookie.json similarity index 100% rename from backend/src/main/resources/api-spec/path/sign-out/responseOkHeaderSetCookie.json rename to api-spec/path/sign-out/responseOkHeaderSetCookie.json diff --git a/backend/src/main/resources/api-spec/path/sign-out/sign-out.json b/api-spec/path/sign-out/sign-out.json similarity index 76% rename from backend/src/main/resources/api-spec/path/sign-out/sign-out.json rename to api-spec/path/sign-out/sign-out.json index 0dcb32dd..9316e408 100644 --- a/backend/src/main/resources/api-spec/path/sign-out/sign-out.json +++ b/api-spec/path/sign-out/sign-out.json @@ -12,9 +12,12 @@ } }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../model/error/error403.json" + "schema": { + "$ref": "../../model/error/error403.json" + } } } } diff --git a/backend/src/main/resources/api-spec/path/users/_id/_id.json b/api-spec/path/users/_id/_id.json similarity index 89% rename from backend/src/main/resources/api-spec/path/users/_id/_id.json rename to api-spec/path/users/_id/_id.json index b83f17fd..31739116 100644 --- a/backend/src/main/resources/api-spec/path/users/_id/_id.json +++ b/api-spec/path/users/_id/_id.json @@ -58,9 +58,12 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../../model/error/error403.json" + "schema": { + "$ref": "../../../model/error/error403.json" + } } } } @@ -84,9 +87,12 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../../model/error/error403.json" + "schema": { + "$ref": "../../../model/error/error403.json" + } } } } diff --git a/backend/src/main/resources/api-spec/path/users/_id/usersIdPatchRequest.json b/api-spec/path/users/_id/usersIdPatchRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/_id/usersIdPatchRequest.json rename to api-spec/path/users/_id/usersIdPatchRequest.json diff --git a/backend/src/main/resources/api-spec/path/users/admins/admin.json b/api-spec/path/users/admins/admin.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/admins/admin.json rename to api-spec/path/users/admins/admin.json diff --git a/backend/src/main/resources/api-spec/path/users/admins/admins.json b/api-spec/path/users/admins/admins.json similarity index 91% rename from backend/src/main/resources/api-spec/path/users/admins/admins.json rename to api-spec/path/users/admins/admins.json index bd05c9ad..08f5ff61 100644 --- a/backend/src/main/resources/api-spec/path/users/admins/admins.json +++ b/api-spec/path/users/admins/admins.json @@ -39,9 +39,12 @@ "description": "Bad Request" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../../model/error/error403.json" + "schema": { + "$ref": "../../../model/error/error403.json" + } } } } diff --git a/backend/src/main/resources/api-spec/path/users/admins/adminsGetResponse.json b/api-spec/path/users/admins/adminsGetResponse.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/admins/adminsGetResponse.json rename to api-spec/path/users/admins/adminsGetResponse.json diff --git a/backend/src/main/resources/api-spec/path/users/current/current.json b/api-spec/path/users/current/current.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/current/current.json rename to api-spec/path/users/current/current.json diff --git a/backend/src/main/resources/api-spec/path/users/users.json b/api-spec/path/users/users.json similarity index 90% rename from backend/src/main/resources/api-spec/path/users/users.json rename to api-spec/path/users/users.json index 5a4cd400..68b3d0e1 100644 --- a/backend/src/main/resources/api-spec/path/users/users.json +++ b/api-spec/path/users/users.json @@ -54,9 +54,12 @@ "description": "Bad Request. Maybe screen name is duplicated" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../model/error/error403.json" + "schema": { + "$ref": "../../model/error/error403.json" + } } } } diff --git a/backend/src/main/resources/api-spec/path/users/usersPostRequest.json b/api-spec/path/users/usersPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/usersPostRequest.json rename to api-spec/path/users/usersPostRequest.json diff --git a/backend/src/main/resources/api-spec/root.json b/api-spec/root.json similarity index 100% rename from backend/src/main/resources/api-spec/root.json rename to api-spec/root.json diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 6d698912..842e30e4 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -45,7 +45,7 @@ application { // https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/kotlin-server.md openApiGenerate { generatorName.set("kotlin-server") - inputSpec.set("$rootDir/src/main/resources/api-spec/root.json") + inputSpec.set("$rootDir/../api-spec/root.json") val generatedDirPath = layout .buildDirectory diff --git a/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt b/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt index b95d6cd7..67dc46b7 100644 --- a/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt +++ b/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt @@ -8,14 +8,14 @@ import com.github.hmiyado.kottage.openapi.models.Error409 object ErrorFactory { fun create400(description: String = "BadRequest") = Error400( - status = 400, - description = description, + status = Error400.Status._400, + description = Error400.Description.BadRequest, ) fun create403(kind: Error403Cause.Kind? = null) = Error403( - status = 403, - description = "Forbidden", + status = Error403.Status._403, + description = Error403.Description.Forbidden, cause = kind?.let { Error403Cause( @@ -26,7 +26,7 @@ object ErrorFactory { fun create409() = Error409( - status = 409, - description = "Conflict", + status = Error409.Status._409, + description = Error409.Description.Conflict, ) } diff --git a/backend/src/main/resources/api-spec/model/error/error403.json b/backend/src/main/resources/api-spec/model/error/error403.json deleted file mode 100644 index e2533cf7..00000000 --- a/backend/src/main/resources/api-spec/model/error/error403.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "type": "object", - "properties": { - "status": { - "type": "integer", - "const": 403 - }, - "description": { - "type": "string", - "const": "Forbidden" - }, - "cause": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "CsrfTokenRequired", - "CsrfHeaderRequired", - "InvalidOrigin" - ] - } - }, - "required": [ - "kind" - ] - } - }, - "required": [ - "status", - "description" - ] -} diff --git a/frontend/.gitignore b/frontend/.gitignore index f519984c..3bc438a9 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -53,3 +53,6 @@ yarn-error.log* # switch tsconfig.json by environment and replace default config tsconfig.json tsconfig.tsbuildinfo + +# OpenAPI Generator metadata +src/repository/openapi/generated/.openapi-generator/ diff --git a/frontend/openapitools.json b/frontend/openapitools.json index 8526c4b3..4d7f2307 100644 --- a/frontend/openapitools.json +++ b/frontend/openapitools.json @@ -6,8 +6,8 @@ "generators": { "v1.0": { "generatorName": "typescript-fetch", - "inputSpec": "#{cwd}/../backend/src/main/resources/api-spec/root.json", - "glob": "../backend/src/main/resources/api-spec/*.json", + "inputSpec": "#{cwd}/../api-spec/root.json", + "glob": "../api-spec/*.json", "output": "#{cwd}/src/repository/openapi/generated", "ignoreFileOverride": "#{cwd}/src/repository/openapi/.openapi-generator-ignore", "additionalProperties": { diff --git a/frontend/src/repository/openapi/generated/.openapi-generator/FILES b/frontend/src/repository/openapi/generated/.openapi-generator/FILES deleted file mode 100644 index 65d266bc..00000000 --- a/frontend/src/repository/openapi/generated/.openapi-generator/FILES +++ /dev/null @@ -1,31 +0,0 @@ -.openapi-generator-ignore -apis/DefaultApi.ts -apis/index.ts -index.ts -models/AccountLink.ts -models/Admin.ts -models/AdminsGetResponse.ts -models/Comment.ts -models/Comments.ts -models/CommentsPostRequest.ts -models/Entries.ts -models/EntriesPostRequest.ts -models/EntriesSerialNumberPatchRequest.ts -models/Entry.ts -models/Error400.ts -models/Error401.ts -models/Error403.ts -models/Error403Cause.ts -models/Error404.ts -models/Error409.ts -models/ErrorBase.ts -models/ErrorCause.ts -models/Health.ts -models/SignInPostRequest.ts -models/User.ts -models/UserDetail.ts -models/Users.ts -models/UsersIdPatchRequest.ts -models/UsersPostRequest.ts -models/index.ts -runtime.ts diff --git a/frontend/src/repository/openapi/generated/.openapi-generator/VERSION b/frontend/src/repository/openapi/generated/.openapi-generator/VERSION deleted file mode 100644 index 368fd8fd..00000000 --- a/frontend/src/repository/openapi/generated/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.15.0 diff --git a/frontend/src/repository/openapi/generated/apis/DefaultApi.ts b/frontend/src/repository/openapi/generated/apis/DefaultApi.ts index 71a7d2f1..abcd6422 100644 --- a/frontend/src/repository/openapi/generated/apis/DefaultApi.ts +++ b/frontend/src/repository/openapi/generated/apis/DefaultApi.ts @@ -26,6 +26,7 @@ import type { Error400, Error401, Error403, + Error4031, Error404, Error409, Health, @@ -61,6 +62,8 @@ import { Error401ToJSON, Error403FromJSON, Error403ToJSON, + Error4031FromJSON, + Error4031ToJSON, Error404FromJSON, Error404ToJSON, Error409FromJSON, diff --git a/frontend/src/repository/openapi/generated/models/Error400.ts b/frontend/src/repository/openapi/generated/models/Error400.ts index 781e19ef..479b4950 100644 --- a/frontend/src/repository/openapi/generated/models/Error400.ts +++ b/frontend/src/repository/openapi/generated/models/Error400.ts @@ -32,13 +32,13 @@ export interface Error400 { * @type {number} * @memberof Error400 */ - status: number + status: Error400StatusEnum /** * * @type {string} * @memberof Error400 */ - description: string + description: Error400DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error400 { cause?: ErrorCause } +/** + * @export + */ +export const Error400StatusEnum = { + NUMBER_400: 400, +} as const +export type Error400StatusEnum = + (typeof Error400StatusEnum)[keyof typeof Error400StatusEnum] + +/** + * @export + */ +export const Error400DescriptionEnum = { + BadRequest: 'BadRequest', +} as const +export type Error400DescriptionEnum = + (typeof Error400DescriptionEnum)[keyof typeof Error400DescriptionEnum] + /** * Check if a given object implements the Error400 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/Error401.ts b/frontend/src/repository/openapi/generated/models/Error401.ts index f1f0b724..75c5cb3f 100644 --- a/frontend/src/repository/openapi/generated/models/Error401.ts +++ b/frontend/src/repository/openapi/generated/models/Error401.ts @@ -32,13 +32,13 @@ export interface Error401 { * @type {number} * @memberof Error401 */ - status: number + status: Error401StatusEnum /** * * @type {string} * @memberof Error401 */ - description: string + description: Error401DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error401 { cause?: ErrorCause } +/** + * @export + */ +export const Error401StatusEnum = { + NUMBER_401: 401, +} as const +export type Error401StatusEnum = + (typeof Error401StatusEnum)[keyof typeof Error401StatusEnum] + +/** + * @export + */ +export const Error401DescriptionEnum = { + Unauthorized: 'Unauthorized', +} as const +export type Error401DescriptionEnum = + (typeof Error401DescriptionEnum)[keyof typeof Error401DescriptionEnum] + /** * Check if a given object implements the Error401 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/Error403.ts b/frontend/src/repository/openapi/generated/models/Error403.ts index e0752448..fa7a60bc 100644 --- a/frontend/src/repository/openapi/generated/models/Error403.ts +++ b/frontend/src/repository/openapi/generated/models/Error403.ts @@ -13,6 +13,13 @@ */ import { mapValues } from '../runtime' +import type { ErrorCause } from './ErrorCause' +import { + ErrorCauseFromJSON, + ErrorCauseFromJSONTyped, + ErrorCauseToJSON, + ErrorCauseToJSONTyped, +} from './ErrorCause' import type { Error403Cause } from './Error403Cause' import { Error403CauseFromJSON, @@ -32,13 +39,13 @@ export interface Error403 { * @type {number} * @memberof Error403 */ - status: number + status: Error403StatusEnum /** * * @type {string} * @memberof Error403 */ - description: string + description: Error403DescriptionEnum /** * * @type {Error403Cause} @@ -47,6 +54,24 @@ export interface Error403 { cause?: Error403Cause } +/** + * @export + */ +export const Error403StatusEnum = { + NUMBER_403: 403, +} as const +export type Error403StatusEnum = + (typeof Error403StatusEnum)[keyof typeof Error403StatusEnum] + +/** + * @export + */ +export const Error403DescriptionEnum = { + Forbidden: 'Forbidden', +} as const +export type Error403DescriptionEnum = + (typeof Error403DescriptionEnum)[keyof typeof Error403DescriptionEnum] + /** * Check if a given object implements the Error403 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/Error4031.ts b/frontend/src/repository/openapi/generated/models/Error4031.ts new file mode 100644 index 00000000..5030f914 --- /dev/null +++ b/frontend/src/repository/openapi/generated/models/Error4031.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * kottage + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 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 { ErrorCause } from './ErrorCause' +import { + ErrorCauseFromJSON, + ErrorCauseFromJSONTyped, + ErrorCauseToJSON, + ErrorCauseToJSONTyped, +} from './ErrorCause' +import type { Error403Cause } from './Error403Cause' +import { + Error403CauseFromJSON, + Error403CauseFromJSONTyped, + Error403CauseToJSON, + Error403CauseToJSONTyped, +} from './Error403Cause' + +/** + * + * @export + * @interface Error4031 + */ +export interface Error4031 { + /** + * + * @type {number} + * @memberof Error4031 + */ + status: Error4031StatusEnum + /** + * + * @type {string} + * @memberof Error4031 + */ + description: Error4031DescriptionEnum + /** + * + * @type {Error403Cause} + * @memberof Error4031 + */ + cause?: Error403Cause +} + +/** + * @export + */ +export const Error4031StatusEnum = { + NUMBER_403: 403, +} as const +export type Error4031StatusEnum = + (typeof Error4031StatusEnum)[keyof typeof Error4031StatusEnum] + +/** + * @export + */ +export const Error4031DescriptionEnum = { + Forbidden: 'Forbidden', +} as const +export type Error4031DescriptionEnum = + (typeof Error4031DescriptionEnum)[keyof typeof Error4031DescriptionEnum] + +/** + * Check if a given object implements the Error4031 interface. + */ +export function instanceOfError4031(value: object): value is Error4031 { + if (!('status' in value) || value['status'] === undefined) return false + if (!('description' in value) || value['description'] === undefined) + return false + return true +} + +export function Error4031FromJSON(json: any): Error4031 { + return Error4031FromJSONTyped(json, false) +} + +export function Error4031FromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Error4031 { + if (json == null) { + return json + } + return { + status: json['status'], + description: json['description'], + cause: + json['cause'] == null ? undefined : Error403CauseFromJSON(json['cause']), + } +} + +export function Error4031ToJSON(json: any): Error4031 { + return Error4031ToJSONTyped(json, false) +} + +export function Error4031ToJSONTyped( + value?: Error4031 | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + status: value['status'], + description: value['description'], + cause: Error403CauseToJSON(value['cause']), + } +} diff --git a/frontend/src/repository/openapi/generated/models/Error404.ts b/frontend/src/repository/openapi/generated/models/Error404.ts index ab8c0a13..2311469d 100644 --- a/frontend/src/repository/openapi/generated/models/Error404.ts +++ b/frontend/src/repository/openapi/generated/models/Error404.ts @@ -32,13 +32,13 @@ export interface Error404 { * @type {number} * @memberof Error404 */ - status: number + status: Error404StatusEnum /** * * @type {string} * @memberof Error404 */ - description: string + description: Error404DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error404 { cause?: ErrorCause } +/** + * @export + */ +export const Error404StatusEnum = { + NUMBER_404: 404, +} as const +export type Error404StatusEnum = + (typeof Error404StatusEnum)[keyof typeof Error404StatusEnum] + +/** + * @export + */ +export const Error404DescriptionEnum = { + NotFound: 'NotFound', +} as const +export type Error404DescriptionEnum = + (typeof Error404DescriptionEnum)[keyof typeof Error404DescriptionEnum] + /** * Check if a given object implements the Error404 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/Error409.ts b/frontend/src/repository/openapi/generated/models/Error409.ts index 51f50de5..851ef94b 100644 --- a/frontend/src/repository/openapi/generated/models/Error409.ts +++ b/frontend/src/repository/openapi/generated/models/Error409.ts @@ -32,13 +32,13 @@ export interface Error409 { * @type {number} * @memberof Error409 */ - status: number + status: Error409StatusEnum /** * * @type {string} * @memberof Error409 */ - description: string + description: Error409DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error409 { cause?: ErrorCause } +/** + * @export + */ +export const Error409StatusEnum = { + NUMBER_409: 409, +} as const +export type Error409StatusEnum = + (typeof Error409StatusEnum)[keyof typeof Error409StatusEnum] + +/** + * @export + */ +export const Error409DescriptionEnum = { + Conflict: 'Conflict', +} as const +export type Error409DescriptionEnum = + (typeof Error409DescriptionEnum)[keyof typeof Error409DescriptionEnum] + /** * Check if a given object implements the Error409 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/index.ts b/frontend/src/repository/openapi/generated/models/index.ts index 66e9de0c..c2f4bbb4 100644 --- a/frontend/src/repository/openapi/generated/models/index.ts +++ b/frontend/src/repository/openapi/generated/models/index.ts @@ -13,6 +13,7 @@ export * from './Entry' export * from './Error400' export * from './Error401' export * from './Error403' +export * from './Error4031' export * from './Error403Cause' export * from './Error404' export * from './Error409'