From 71df3e15660026ddfba775aeff35cf83715f72eb Mon Sep 17 00:00:00 2001
From: YuzuRyo61 <cyberman.craft@gmail.com>
Date: Mon, 15 Apr 2019 23:26:20 +0900
Subject: [PATCH] =?UTF-8?q?API=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?=
 =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E8=AA=AC=E6=98=8E=E3=81=A8=E3=81=8B?=
 =?UTF-8?q?=E4=B8=80=E9=83=A8=E8=BF=BD=E8=A8=98=20(#4702)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Define description in generate.ts

* Add description in create.ts
---
 src/server/api/endpoints/app/create.ts        | 52 +++++++++++++++++--
 .../api/endpoints/auth/session/generate.ts    |  5 ++
 2 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/src/server/api/endpoints/app/create.ts b/src/server/api/endpoints/app/create.ts
index ba366cdeb8..9db60d2661 100644
--- a/src/server/api/endpoints/app/create.ts
+++ b/src/server/api/endpoints/app/create.ts
@@ -9,25 +9,69 @@ export const meta = {
 	tags: ['app'],
 
 	requireCredential: false,
+	
+	desc: {
+		'ja-JP': 'アプリを作成します。',
+		'en-US': 'Create a application.'
+	},
 
 	params: {
 		name: {
-			validator: $.str
+			validator: $.str,
+			desc: {
+				'ja-JP': 'アプリの名前',
+				'en-US': 'Name of application'
+			}
 		},
 
 		description: {
-			validator: $.str
+			validator: $.str,
+			desc: {
+				'ja-JP': 'アプリの説明',
+				'en-US': 'Description of application'
+			}
 		},
 
 		permission: {
-			validator: $.arr($.str).unique()
+			validator: $.arr($.str).unique(),
+			desc: {
+				'ja-JP': 'このアプリに割り当てる権限(権限については"Permissions"を参照)',
+				'en-US': 'Permissions assigned to this app (see "Permissions" for the permissions)'
+			}
 		},
 
 		// TODO: Check it is valid url
 		callbackUrl: {
 			validator: $.optional.nullable.str,
-			default: null as any
+			default: null as any,
+			desc: {
+				'ja-JP': 'アプリ認証時にコールバックするURL',
+				'en-US': 'URL to call back at app authentication'
+			}
 		},
+	},
+	
+	res: {
+		type: 'object',
+		properties: {
+			id: {
+				type: 'string',
+				description: 'アプリケーションのID'
+			},
+			name: {
+				type: 'string',
+				description: 'アプリケーションの名前'
+			},
+			callbackUrl: {
+				type: 'string',
+				nullable: true,
+				description: 'コールバックするURL'
+			},
+			secret: {
+				type: 'string',
+				description: 'アプリケーションのシークレットキー'
+			}
+		}
 	}
 };
 
diff --git a/src/server/api/endpoints/auth/session/generate.ts b/src/server/api/endpoints/auth/session/generate.ts
index 5a9bfe6451..bca8d33483 100644
--- a/src/server/api/endpoints/auth/session/generate.ts
+++ b/src/server/api/endpoints/auth/session/generate.ts
@@ -10,6 +10,11 @@ export const meta = {
 	tags: ['auth'],
 
 	requireCredential: false,
+	
+	desc: {
+		'ja-JP': 'アプリを認証するためのトークンを作成します。',
+		'en-US': 'Generate a token for authorize application.'
+	},
 
 	params: {
 		appSecret: {