From ee2dff42a61f66677e4b09bcc1f3b513ba8e7422 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:00:35 +0000 Subject: [PATCH] 2024-03-07 - Updated --- docs/cuculus-openapi.yaml | 933 +++++++++++++++----------------------- 1 file changed, 368 insertions(+), 565 deletions(-) diff --git a/docs/cuculus-openapi.yaml b/docs/cuculus-openapi.yaml index dbae3e9..f4ac360 100644 --- a/docs/cuculus-openapi.yaml +++ b/docs/cuculus-openapi.yaml @@ -188,7 +188,7 @@ paths: /v0/users/{id}/follow: post: operationId: createFollow - summary: ユーザーIDをフォローする + summary: ユーザーIDをフォローする。またはフォローリクエストを送る parameters: - name: id required: true @@ -228,251 +228,136 @@ paths: - users security: - bearer: [] - /v0/auth/pre-sign-up: - post: - operationId: postPreSignUp - summary: 仮登録API - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PreUserRequest' - responses: - '201': - description: 仮登録成功。認証コードをメールで送信します。 - '409': - description: 既に登録済みのユーザー - tags: - - auth - /v0/auth/pre-sign-up/verify-code: - post: - operationId: postPreSignUpVerifyCode - summary: 認証コードの確認 - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/VerifyCodeRequest' + /v0/users/{id}/relationship: + get: + operationId: getRelationShip + summary: ユーザーIDとの関係を取得する + parameters: + - name: id + required: true + in: path + schema: + type: number responses: '200': - description: 認証OK - '400': - description: 認証コードが違います。 - '403': - description: 認証コードを間違えすぎた。 - '404': - description: ユーザーが見つかりませんでした。 - tags: - - auth - /v0/auth/sign-up: - post: - operationId: postSignUp - summary: 本登録API - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UserRequest' - responses: - '201': - description: アカウント作成成功。 - headers: - Set-Cookie: - description: auth_tokenを返却します。 - schema: - type: string - example: >- - auth_token=abcde12345; Domain=.localhost; Path=/; HttpOnly; - Secure; + description: ユーザーとの関係性 content: application/json: schema: - $ref: '#/components/schemas/AuthToken' + $ref: '#/components/schemas/Relationship' '400': - description: 認証コードが違います。 - '403': - description: 認証コードを間違えすぎた。 + description: 自身を参照することは出来ません。 + '401': + description: JWTが無効、または期限切れ '404': description: ユーザーが見つかりませんでした。 - '409': - description: 既に登録済みもしくは使用済みのID tags: - - auth - /v0/auth/sign-in: - post: - operationId: postSignIn - summary: ログインAPI - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LoginRequest' + - users + security: + - bearer: [] + /v0/timelines/home: + get: + operationId: getHomeTimeline + summary: ホームタイムラインの取得 + parameters: + - name: max_id + required: false + in: query + example: '26439435541307392' + description: このIDを上限として、より小さいIDの投稿を取得します。 + schema: + type: string + - name: since_id + required: false + in: query + example: '26439435541307392' + description: このIDを下限として、より大きいIDの投稿を取得します。(min_idと併用不可) + schema: + type: string + - name: min_id + required: false + in: query + example: '26439435541307392' + description: このIDを下限として、直後からの投稿を取得します。(since_idと併用不可) + schema: + type: string + - name: limit + required: false + in: query + example: 20 + description: 取得件数 + schema: + minimum: 1 + maximum: 40 + default: 20 + type: number responses: '200': - description: web用にauth_tokenはset-cookieでも返却します。 - headers: - Set-Cookie: - description: auth_tokenを返却します。 - schema: - type: string - example: >- - auth_token=abcde12345; Domain=.localhost; Path=/; HttpOnly; - Secure; + description: ポスト一覧 content: application/json: schema: - $ref: '#/components/schemas/AuthToken' + type: array + items: + $ref: '#/components/schemas/UserPost' '400': - description: ユーザー名またはパスワードが間違っている。 - tags: - - auth - /v0/auth/token/refresh: - post: - operationId: postTokenRefresh - summary: アクセストークンの再発行(現在はCookieのみ対応) - parameters: [] - responses: - '201': - description: 発行されたアクセストークン - content: - application/json: - schema: - $ref: '#/components/schemas/AccessToken' - '401': - description: auth_tokenが無効、または期限切れ - tags: - - auth - security: - - cookie: [] - /v0/auth/sign-out: - post: - operationId: postSignOut - summary: ログアウトAPI - parameters: [] - responses: - '200': - description: ログアウト成功 + description: min_idとsince_idは同時に指定できません tags: - - auth + - timelines security: - - cookie: [] - /health: + - bearer: [] + /v0/timelines/public: get: - operationId: HealthController_check - parameters: [] - responses: - '200': - description: The Health Check is successful - content: - application/json: - schema: - type: object - properties: - status: - type: string - example: ok - info: - type: object - example: - database: - status: up - additionalProperties: - type: object - required: - - status - properties: - status: - type: string - additionalProperties: true - nullable: true - error: - type: object - example: {} - additionalProperties: - type: object - required: - - status - properties: - status: - type: string - additionalProperties: true - nullable: true - details: - type: object - example: - database: - status: up - additionalProperties: - type: object - required: - - status - properties: - status: - type: string - additionalProperties: true - '503': - description: The Health Check is not successful - content: - application/json: - schema: - type: object - properties: - status: - type: string - example: error - info: - type: object - example: - database: - status: up - additionalProperties: - type: object - required: - - status - properties: - status: - type: string - additionalProperties: true - nullable: true - error: - type: object - example: - redis: - status: down - message: Could not connect - additionalProperties: - type: object - required: - - status - properties: - status: - type: string - additionalProperties: true - nullable: true - details: - type: object - example: - database: - status: up - redis: - status: down - message: Could not connect - additionalProperties: - type: object - required: - - status - properties: - status: - type: string - additionalProperties: true + operationId: getPublicTimeline + summary: 全体タイムラインの取得(廃止予定) + parameters: + - name: max_id + required: false + in: query + example: '26439435541307392' + description: このIDを上限として、より小さいIDの投稿を取得します。 + schema: + type: string + - name: since_id + required: false + in: query + example: '26439435541307392' + description: このIDを下限として、より大きいIDの投稿を取得します。(min_idと併用不可) + schema: + type: string + - name: min_id + required: false + in: query + example: '26439435541307392' + description: このIDを下限として、直後からの投稿を取得します。(since_idと併用不可) + schema: + type: string + - name: limit + required: false + in: query + example: 20 + description: 取得件数 + schema: + minimum: 1 + maximum: 40 + default: 20 + type: number + responses: + '200': + description: ポスト一覧 + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserPost' + '400': + description: min_idとsince_idは同時に指定できません + tags: + - timelines + security: + - {} + - bearer: [] /v0/posts: post: operationId: createPost @@ -514,6 +399,8 @@ paths: application/json: schema: $ref: '#/components/schemas/UserPost' + '401': + description: 閲覧権限がありません '404': description: 投稿が見つかりませんでした。 tags: @@ -665,109 +552,251 @@ paths: - posts security: - bearer: [] - /v0/timelines/home: - get: - operationId: getHomeTimeline - summary: ホームタイムラインの取得 - parameters: - - name: max_id - required: false - in: query - example: '26439435541307392' - description: このIDを上限として、より小さいIDの投稿を取得します。 - schema: - type: string - - name: since_id - required: false - in: query - example: '26439435541307392' - description: このIDを下限として、より大きいIDの投稿を取得します。(min_idと併用不可) - schema: - type: string - - name: min_id - required: false - in: query - example: '26439435541307392' - description: このIDを下限として、直後からの投稿を取得します。(since_idと併用不可) - schema: - type: string - - name: limit - required: false - in: query - example: 20 - description: 取得件数 - schema: - minimum: 1 - maximum: 40 - default: 20 - type: number + /v0/auth/pre-sign-up: + post: + operationId: postPreSignUp + summary: 仮登録API + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PreUserRequest' + responses: + '201': + description: 仮登録成功。認証コードをメールで送信します。 + '409': + description: 既に登録済みのユーザー + tags: + - auth + /v0/auth/pre-sign-up/verify-code: + post: + operationId: postPreSignUpVerifyCode + summary: 認証コードの確認 + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyCodeRequest' responses: '200': - description: ポスト一覧 + description: 認証OK + '400': + description: 認証コードが違います。 + '403': + description: 認証コードを間違えすぎた。 + '404': + description: ユーザーが見つかりませんでした。 + tags: + - auth + /v0/auth/sign-up: + post: + operationId: postSignUp + summary: 本登録API + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserRequest' + responses: + '201': + description: アカウント作成成功。 + headers: + Set-Cookie: + description: auth_tokenを返却します。 + schema: + type: string + example: >- + auth_token=abcde12345; Domain=.localhost; Path=/; HttpOnly; + Secure; content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/UserPost' + $ref: '#/components/schemas/AuthToken' '400': - description: min_idとsince_idは同時に指定できません + description: 認証コードが違います。 + '403': + description: 認証コードを間違えすぎた。 + '404': + description: ユーザーが見つかりませんでした。 + '409': + description: 既に登録済みもしくは使用済みのID tags: - - timelines + - auth + /v0/auth/sign-in: + post: + operationId: postSignIn + summary: ログインAPI + parameters: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LoginRequest' + responses: + '200': + description: web用にauth_tokenはset-cookieでも返却します。 + headers: + Set-Cookie: + description: auth_tokenを返却します。 + schema: + type: string + example: >- + auth_token=abcde12345; Domain=.localhost; Path=/; HttpOnly; + Secure; + content: + application/json: + schema: + $ref: '#/components/schemas/AuthToken' + '400': + description: ユーザー名またはパスワードが間違っている。 + tags: + - auth + /v0/auth/token/refresh: + post: + operationId: postTokenRefresh + summary: アクセストークンの再発行(現在はCookieのみ対応) + parameters: [] + responses: + '201': + description: 発行されたアクセストークン + content: + application/json: + schema: + $ref: '#/components/schemas/AccessToken' + '401': + description: auth_tokenが無効、または期限切れ + tags: + - auth security: - - bearer: [] - /v0/timelines/public: + - cookie: [] + /v0/auth/sign-out: + post: + operationId: postSignOut + summary: ログアウトAPI + parameters: [] + responses: + '200': + description: ログアウト成功 + tags: + - auth + security: + - cookie: [] + /health: get: - operationId: getPublicTimeline - summary: 全体タイムラインの取得(廃止予定) - parameters: - - name: max_id - required: false - in: query - example: '26439435541307392' - description: このIDを上限として、より小さいIDの投稿を取得します。 - schema: - type: string - - name: since_id - required: false - in: query - example: '26439435541307392' - description: このIDを下限として、より大きいIDの投稿を取得します。(min_idと併用不可) - schema: - type: string - - name: min_id - required: false - in: query - example: '26439435541307392' - description: このIDを下限として、直後からの投稿を取得します。(since_idと併用不可) - schema: - type: string - - name: limit - required: false - in: query - example: 20 - description: 取得件数 - schema: - minimum: 1 - maximum: 40 - default: 20 - type: number + operationId: HealthController_check + parameters: [] responses: '200': - description: ポスト一覧 + description: The Health Check is successful + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: ok + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: {} + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + '503': + description: The Health Check is not successful content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/UserPost' - '400': - description: min_idとsince_idは同時に指定できません - tags: - - timelines - security: - - {} - - bearer: [] + type: object + properties: + status: + type: string + example: error + info: + type: object + example: + database: + status: up + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + error: + type: object + example: + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true + nullable: true + details: + type: object + example: + database: + status: up + redis: + status: down + message: Could not connect + additionalProperties: + type: object + required: + - status + properties: + status: + type: string + additionalProperties: true /v0/invitations/verify-code: post: operationId: postInvitationVerifyCode @@ -911,155 +940,6 @@ paths: - accounts security: - bearer: [] - /.well-known/host-meta: - get: - operationId: WellKnownController_getHostMeta - parameters: [] - responses: - '200': - description: '' - tags: - - activity-pub - /.well-known/host-meta.json: - get: - operationId: WellKnownController_getHostMetaJson - parameters: [] - responses: - '200': - description: '' - tags: - - activity-pub - /.well-known/nodeinfo: - get: - operationId: WellKnownController_getNodeInfo - parameters: [] - responses: - '200': - description: '' - tags: - - activity-pub - /.well-known/webfinger: - get: - operationId: WellKnownController_getWebFinger - parameters: - - name: resource - required: true - in: query - schema: - type: string - responses: - '200': - description: '' - tags: - - activity-pub - /nodeinfo/2.0: - get: - operationId: NodeinfoController_getNodeInfo2_0 - parameters: [] - responses: - '200': - description: nodeinfo - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NodeInfo' - tags: - - activity-pub - /nodeinfo/2.1: - get: - operationId: NodeinfoController_getNodeInfo2_1 - parameters: [] - responses: - '200': - description: nodeinfo - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/NodeInfo' - tags: - - activity-pub - /users/{id}: - get: - operationId: getUserActivity - summary: ActivityPub向けのユーザー情報(実装中) - parameters: - - name: id - required: true - in: path - schema: - type: number - responses: - '200': - description: ユーザー情報 - content: - application/json: - schema: - $ref: '#/components/schemas/PersonActor' - '302': - description: acceptヘッダがjsonではない場合リダイレクト - '404': - description: ユーザーが見つかりませんでした。 - tags: - - activity-pub - /users/{id}/inbox: - post: - operationId: postUserInbox - summary: ActivityPub向け(実装中) - parameters: - - name: id - required: true - in: path - schema: - type: number - responses: - '404': - description: ユーザーが見つかりませんでした。 - tags: - - activity-pub - /users/{id}/outbox: - get: - operationId: getUserOutbox - summary: ActivityPub向け(実装中) - parameters: - - name: id - required: true - in: path - schema: - type: number - responses: - '404': - description: ユーザーが見つかりませんでした。 - tags: - - activity-pub - /users/{id}/collections/featured: - get: - operationId: getUserFeatured - summary: ActivityPub向け(実装中) - parameters: - - name: id - required: true - in: path - schema: - type: number - responses: - '404': - description: ユーザーが見つかりませんでした。 - tags: - - activity-pub - /inbox: - post: - operationId: postInbox - summary: 共通のInbox - parameters: [] - responses: - '201': - description: '' - tags: - - activity-pub info: title: Cuculus API description: The Cuculus API description @@ -1106,8 +986,9 @@ components: type: string profile_image_url: type: string - protected: + is_private: type: boolean + description: 非公開アカウントかどうか url: type: string verified: @@ -1119,7 +1000,7 @@ components: - created_at - bio - profile_image_url - - protected + - is_private - url - verified UserWithFollows: @@ -1138,8 +1019,9 @@ components: type: string profile_image_url: type: string - protected: + is_private: type: boolean + description: 非公開アカウントかどうか url: type: string verified: @@ -1159,7 +1041,7 @@ components: - created_at - bio - profile_image_url - - protected + - is_private - url - verified Post: @@ -1249,9 +1131,25 @@ components: type: number following: type: boolean + description: フォロー中 + follow_requested: + type: boolean + description: フォローリクエスト中 required: - id - following + - follow_requested + CreatePost: + type: object + properties: + original_post_id: + type: string + description: 引用元ID + example: '26439435541307392' + text: + type: string + description: 本文 + example: Hello, World! PreUserRequest: type: object properties: @@ -1344,17 +1242,6 @@ components: type: string required: - access_token - CreatePost: - type: object - properties: - original_post_id: - type: string - description: 引用元ID - example: '26439435541307392' - text: - type: string - description: 本文 - example: Hello, World! InvitationCodeRequest: type: object properties: @@ -1410,87 +1297,3 @@ components: type: string description: bio example: ククルスへようこそ。 - NodeInfo: - type: object - properties: - version: - type: string - software: - type: object - protocols: - type: array - items: - type: string - services: - type: object - openRegistrations: - type: boolean - usage: - type: object - metadata: - type: object - required: - - version - - software - - protocols - - services - - openRegistrations - - usage - - metadata - PersonActor: - type: object - properties: - '@context': - type: array - items: - type: string - id: - type: string - type: - type: string - inbox: - type: string - outbox: - type: string - following: - type: string - followers: - type: string - featured: - type: string - sharedInbox: - type: string - endpoints: - type: object - preferredUsername: - type: string - name: - type: string - summary: - type: object - url: - type: string - publicKey: - type: object - icon: - type: object - discoverable: - type: boolean - required: - - '@context' - - id - - type - - inbox - - outbox - - following - - followers - - featured - - sharedInbox - - endpoints - - preferredUsername - - name - - summary - - url - - publicKey - - icon - - discoverable