summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/notes.ts')
-rw-r--r--src/server/api/endpoints/notes.ts47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/server/api/endpoints/notes.ts b/src/server/api/endpoints/notes.ts
index 4f5a211240..83776c59d0 100644
--- a/src/server/api/endpoints/notes.ts
+++ b/src/server/api/endpoints/notes.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, { packMany } from '../../../models/note';
import getParams from '../get-params';
@@ -8,49 +8,62 @@ export const meta = {
},
params: {
- local: $.bool.optional.note({
+ local: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'ローカルの投稿に限定するか否か'
}
- }),
+ },
- reply: $.bool.optional.note({
+ reply: {
+ validator: $.bool.optional,
desc: {
'ja-JP': '返信に限定するか否か'
}
- }),
+ },
- renote: $.bool.optional.note({
+ renote: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'Renoteに限定するか否か'
}
- }),
+ },
- withFiles: $.bool.optional.note({
+ withFiles: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'ファイルが添付された投稿に限定するか否か'
}
- }),
+ },
- media: $.bool.optional.note({
+ media: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'ファイルが添付された投稿に限定するか否か (このパラメータは廃止予定です。代わりに withFiles を使ってください。)'
}
- }),
+ },
- poll: $.bool.optional.note({
+ poll: {
+ validator: $.bool.optional,
desc: {
'ja-JP': 'アンケートが添付された投稿に限定するか否か'
}
- }),
+ },
- limit: $.num.optional.range(1, 100).note({
+ limit: {
+ validator: $.num.optional.range(1, 100),
default: 10
- }),
+ },
- sinceId: $.type(ID).optional.note({}),
+ sinceId: {
+ validator: $.type(ID).optional,
+ transform: transform,
+ },
- untilId: $.type(ID).optional.note({}),
+ untilId: {
+ validator: $.type(ID).optional,
+ transform: transform,
+ },
}
};