diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-09 01:01:48 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-09 01:01:48 +0900 |
| commit | 3eafe8b87d36eb542b39ab88f7c86e93aca4b154 (patch) | |
| tree | 60c94b3b2825612590c021016f0d6af184d5732a /src/server | |
| parent | Improve theme (diff) | |
| download | sharkey-3eafe8b87d36eb542b39ab88f7c86e93aca4b154.tar.gz sharkey-3eafe8b87d36eb542b39ab88f7c86e93aca4b154.tar.bz2 sharkey-3eafe8b87d36eb542b39ab88f7c86e93aca4b154.zip | |
Better api definition
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/api/endpoints/meta.ts | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index c76d7f2e8f..152559337d 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -1,6 +1,3 @@ -/** - * Module dependencies - */ import * as os from 'os'; import config from '../../../config'; import Meta from '../../../models/meta'; @@ -9,9 +6,17 @@ import { ILocalUser } from '../../../models/user'; const pkg = require('../../../../package.json'); const client = require('../../../../built/client/meta.json'); -/** - * Show core info - */ +export const meta = { + desc: { + 'ja-JP': 'インスタンス情報を取得します。', + 'en-US': 'Get the information of this instance.' + }, + + requireCredential: false, + + params: {}, +}; + export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => { const meta: any = (await Meta.findOne()) || {}; @@ -28,10 +33,12 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => machine: os.hostname(), os: os.platform(), node: process.version, + cpu: { model: os.cpus()[0].model, cores: os.cpus().length }, + broadcasts: meta.broadcasts || [], disableRegistration: meta.disableRegistration, disableLocalTimeline: meta.disableLocalTimeline, @@ -40,6 +47,7 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => swPublickey: config.sw ? config.sw.public_key : null, hidedTags: (me && me.isAdmin) ? meta.hidedTags : undefined, bannerUrl: meta.bannerUrl, + features: { registration: !meta.disableRegistration, localTimeLine: !meta.disableLocalTimeline, |