mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 00:43:09 +02:00
2756f553c6
* wip
* wip
* wip
* Update attached_notes.ts
* wip
* Refactor
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update call.ts
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* ✌️
* Fix
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import $ from 'cafy';
|
|
import define from '../../../define';
|
|
import perUserFollowingChart from '../../../../../services/chart/per-user-following';
|
|
import ID, { transform } from '../../../../../misc/cafy-id';
|
|
|
|
export const meta = {
|
|
stability: 'stable',
|
|
|
|
desc: {
|
|
'ja-JP': 'ユーザーごとのフォロー/フォロワーのチャートを取得します。'
|
|
},
|
|
|
|
params: {
|
|
span: {
|
|
validator: $.str.or(['day', 'hour']),
|
|
desc: {
|
|
'ja-JP': '集計のスパン (day または hour)'
|
|
}
|
|
},
|
|
|
|
limit: {
|
|
validator: $.optional.num.range(1, 500),
|
|
default: 30,
|
|
desc: {
|
|
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
|
|
}
|
|
},
|
|
|
|
userId: {
|
|
validator: $.type(ID),
|
|
transform: transform,
|
|
desc: {
|
|
'ja-JP': '対象のユーザーのID',
|
|
'en-US': 'Target user ID'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
export default define(meta, async (ps) => {
|
|
return await perUserFollowingChart.getChart(ps.span as any, ps.limit, ps.userId);
|
|
});
|