mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-29 20:23:09 +02:00
c1b264e4e9
* wip * wip * wip * wip * wip * wip * wip * Update core.ts * wip * wip * #7361 * delete network chart * federationChart強化 apRequestChart追加 * tweak
36 lines
814 B
TypeScript
36 lines
814 B
TypeScript
import $ from 'cafy';
|
|
import define from '../../../define';
|
|
import { ID } from '@/misc/cafy-id';
|
|
import { convertLog } from '@/services/chart/core';
|
|
import { perUserReactionsChart } from '@/services/chart/index';
|
|
|
|
export const meta = {
|
|
tags: ['charts', 'users', 'reactions'],
|
|
|
|
params: {
|
|
span: {
|
|
validator: $.str.or(['day', 'hour']),
|
|
},
|
|
|
|
limit: {
|
|
validator: $.optional.num.range(1, 500),
|
|
default: 30,
|
|
},
|
|
|
|
offset: {
|
|
validator: $.optional.nullable.num,
|
|
default: null,
|
|
},
|
|
|
|
userId: {
|
|
validator: $.type(ID),
|
|
},
|
|
},
|
|
|
|
// TODO: response definition
|
|
} as const;
|
|
|
|
// eslint-disable-next-line import/no-default-export
|
|
export default define(meta, async (ps) => {
|
|
return await perUserReactionsChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
|
|
});
|