summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/admin/relays
diff options
context:
space:
mode:
authorYuzuRyo61 <yuzuryo61@yuzulia.work>2021-03-06 22:34:11 +0900
committerGitHub <noreply@github.com>2021-03-06 22:34:11 +0900
commita07d753da84191bc8c185a7bcd6d73fab9529b5d (patch)
tree085bc62b1f979020796a73373c3050f4948ed2bd /src/server/api/endpoints/admin/relays
parentfeat: video play inline (using video tag) (#7242) (diff)
downloadsharkey-a07d753da84191bc8c185a7bcd6d73fab9529b5d.tar.gz
sharkey-a07d753da84191bc8c185a7bcd6d73fab9529b5d.tar.bz2
sharkey-a07d753da84191bc8c185a7bcd6d73fab9529b5d.zip
APIドキュメントの改善 (#6757)
* Update api document in admin/announcements * Update api document in announcements * Update api document in i/read-announcements * Update api document in username/available * Update api document & Fix typo in API 403 error * Update api document * Update api document * Update api document * Fix API permission definition * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Fix bug in users (api) * Apply reviews #6757 * Apply reviews #6757 Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'src/server/api/endpoints/admin/relays')
-rw-r--r--src/server/api/endpoints/admin/relays/add.ts30
-rw-r--r--src/server/api/endpoints/admin/relays/list.ts34
-rw-r--r--src/server/api/endpoints/admin/relays/remove.ts3
3 files changed, 64 insertions, 3 deletions
diff --git a/src/server/api/endpoints/admin/relays/add.ts b/src/server/api/endpoints/admin/relays/add.ts
index bcda1050e8..831e05c835 100644
--- a/src/server/api/endpoints/admin/relays/add.ts
+++ b/src/server/api/endpoints/admin/relays/add.ts
@@ -5,7 +5,8 @@ import { ApiError } from '../../../error';
export const meta = {
desc: {
- 'ja-JP': 'Add relay'
+ 'ja-JP': 'リレーを追加します。',
+ 'en-US': 'Add relay'
},
tags: ['admin'],
@@ -25,6 +26,33 @@ export const meta = {
code: 'INVALID_URL',
id: 'fb8c92d3-d4e5-44e7-b3d4-800d5cef8b2c'
},
+ },
+
+ res: {
+ type: 'object' as const,
+ optional: false as const, nullable: false as const,
+ properties: {
+ id: {
+ type: 'string' as const,
+ optional: false as const, nullable: false as const,
+ format: 'id'
+ },
+ inbox: {
+ type: 'string' as const,
+ optional: false as const, nullable: false as const,
+ format: 'url'
+ },
+ status: {
+ type: 'string' as const,
+ optional: false as const, nullable: false as const,
+ default: 'requesting',
+ enum: [
+ 'requesting',
+ 'accepted',
+ 'rejected'
+ ]
+ }
+ }
}
};
diff --git a/src/server/api/endpoints/admin/relays/list.ts b/src/server/api/endpoints/admin/relays/list.ts
index 3b132f73b3..da05ac0a24 100644
--- a/src/server/api/endpoints/admin/relays/list.ts
+++ b/src/server/api/endpoints/admin/relays/list.ts
@@ -3,7 +3,8 @@ import { listRelay } from '../../../../../services/relay';
export const meta = {
desc: {
- 'ja-JP': 'List relay'
+ 'ja-JP': 'リレー一覧を表示します。',
+ 'en-US': 'List relay'
},
tags: ['admin'],
@@ -13,6 +14,37 @@ export const meta = {
params: {
},
+
+ res: {
+ type: 'array' as const,
+ optional: false as const, nullable: false as const,
+ items: {
+ type: 'object' as const,
+ optional: false as const, nullable: false as const,
+ properties: {
+ id: {
+ type: 'string' as const,
+ optional: false as const, nullable: false as const,
+ format: 'id'
+ },
+ inbox: {
+ type: 'string' as const,
+ optional: false as const, nullable: false as const,
+ format: 'url'
+ },
+ status: {
+ type: 'string' as const,
+ optional: false as const, nullable: false as const,
+ default: 'requesting',
+ enum: [
+ 'requesting',
+ 'accepted',
+ 'rejected'
+ ]
+ }
+ }
+ }
+ }
};
export default define(meta, async (ps, user) => {
diff --git a/src/server/api/endpoints/admin/relays/remove.ts b/src/server/api/endpoints/admin/relays/remove.ts
index df95e0329a..572d51cfca 100644
--- a/src/server/api/endpoints/admin/relays/remove.ts
+++ b/src/server/api/endpoints/admin/relays/remove.ts
@@ -4,7 +4,8 @@ import { removeRelay } from '../../../../../services/relay';
export const meta = {
desc: {
- 'ja-JP': 'Remove relay'
+ 'ja-JP': 'リレーを削除します。',
+ 'en-US': 'Remove relay'
},
tags: ['admin'],