diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-02 03:32:24 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-02 03:32:24 +0900 |
| commit | 931bdc6aace5e7aa71ffdfb470e208ead78a2a53 (patch) | |
| tree | eee6d7bf5f5480b883bb601517b4d9db03f31e9f /src/server/api/endpoints/notes/timeline.ts | |
| parent | Refactoring (diff) | |
| download | sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.tar.gz sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.tar.bz2 sharkey-931bdc6aace5e7aa71ffdfb470e208ead78a2a53.zip | |
Refactoring, Clean up and bug fixes
Diffstat (limited to 'src/server/api/endpoints/notes/timeline.ts')
| -rw-r--r-- | src/server/api/endpoints/notes/timeline.ts | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index 31a4978407..8834645fc8 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -1,4 +1,4 @@ -import $ from 'cafy'; import ID from '../../../../misc/cafy-id'; +import $ from 'cafy'; import ID, { transform } from '../../../../misc/cafy-id'; import Note from '../../../../models/note'; import Mute from '../../../../models/mute'; import { getFriends } from '../../common/get-friends'; @@ -16,69 +16,81 @@ export const meta = { requireCredential: true, params: { - limit: $.num.optional.range(1, 100).note({ + limit: { + validator: $.num.optional.range(1, 100), default: 10, desc: { 'ja-JP': '最大数' } - }), + }, - sinceId: $.type(ID).optional.note({ + sinceId: { + validator: $.type(ID).optional, + transform: transform, desc: { 'ja-JP': '指定すると、この投稿を基点としてより新しい投稿を取得します' } - }), + }, - untilId: $.type(ID).optional.note({ + untilId: { + validator: $.type(ID).optional, + transform: transform, desc: { 'ja-JP': '指定すると、この投稿を基点としてより古い投稿を取得します' } - }), + }, - sinceDate: $.num.optional.note({ + sinceDate: { + validator: $.num.optional, desc: { 'ja-JP': '指定した時間を基点としてより新しい投稿を取得します。数値は、1970年1月1日 00:00:00 UTC から指定した日時までの経過時間をミリ秒単位で表します。' } - }), + }, - untilDate: $.num.optional.note({ + untilDate: { + validator: $.num.optional, desc: { 'ja-JP': '指定した時間を基点としてより古い投稿を取得します。数値は、1970年1月1日 00:00:00 UTC から指定した日時までの経過時間をミリ秒単位で表します。' } - }), + }, - includeMyRenotes: $.bool.optional.note({ + includeMyRenotes: { + validator: $.bool.optional, default: true, desc: { 'ja-JP': '自分の行ったRenoteを含めるかどうか' } - }), + }, - includeRenotedMyNotes: $.bool.optional.note({ + includeRenotedMyNotes: { + validator: $.bool.optional, default: true, desc: { 'ja-JP': 'Renoteされた自分の投稿を含めるかどうか' } - }), + }, - includeLocalRenotes: $.bool.optional.note({ + includeLocalRenotes: { + validator: $.bool.optional, default: true, desc: { 'ja-JP': 'Renoteされたローカルの投稿を含めるかどうか' } - }), + }, - withFiles: $.bool.optional.note({ + withFiles: { + validator: $.bool.optional, desc: { 'ja-JP': 'true にすると、ファイルが添付された投稿だけ取得します' } - }), + }, - mediaOnly: $.bool.optional.note({ + mediaOnly: { + validator: $.bool.optional, desc: { 'ja-JP': 'true にすると、ファイルが添付された投稿だけ取得します (このパラメータは廃止予定です。代わりに withFiles を使ってください。)' } - }), + }, } }; |