wip
This commit is contained in:
parent
7492a158d2
commit
024af04b4f
3
packages/backend/src/misc/id-schema.ts
Normal file
3
packages/backend/src/misc/id-schema.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export const idSchema = {
|
||||||
|
type: 'string',
|
||||||
|
} as const;
|
@ -1,44 +1,22 @@
|
|||||||
import $ from 'cafy';
|
|
||||||
import { ID } from '@/misc/cafy-id';
|
|
||||||
import define from '../define';
|
import define from '../define';
|
||||||
import { makePaginationQuery } from '../common/make-pagination-query';
|
import { makePaginationQuery } from '../common/make-pagination-query';
|
||||||
import { Notes } from '@/models/index';
|
import { Notes } from '@/models/index';
|
||||||
|
import { idSchema } from '@/misc/id-schema';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['notes'],
|
tags: ['notes'],
|
||||||
|
|
||||||
params: {
|
params: {
|
||||||
local: {
|
type: 'object',
|
||||||
validator: $.optional.bool,
|
properties: {
|
||||||
},
|
local: { type: 'boolean' },
|
||||||
|
reply: { type: 'boolean' },
|
||||||
reply: {
|
renote: { type: 'boolean' },
|
||||||
validator: $.optional.bool,
|
withFiles: { type: 'boolean' },
|
||||||
},
|
poll: { type: 'boolean' },
|
||||||
|
limit: { type: 'number', minimum: 1, maximum: 100, default: 10 },
|
||||||
renote: {
|
sinceId: idSchema,
|
||||||
validator: $.optional.bool,
|
untilId: idSchema,
|
||||||
},
|
|
||||||
|
|
||||||
withFiles: {
|
|
||||||
validator: $.optional.bool,
|
|
||||||
},
|
|
||||||
|
|
||||||
poll: {
|
|
||||||
validator: $.optional.bool,
|
|
||||||
},
|
|
||||||
|
|
||||||
limit: {
|
|
||||||
validator: $.optional.num.range(1, 100),
|
|
||||||
default: 10,
|
|
||||||
},
|
|
||||||
|
|
||||||
sinceId: {
|
|
||||||
validator: $.optional.type(ID),
|
|
||||||
},
|
|
||||||
|
|
||||||
untilId: {
|
|
||||||
validator: $.optional.type(ID),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user