feat: expanded parameters data

This commit is contained in:
DIYgod
2024-06-26 18:11:19 +08:00
parent ffbd61b2fc
commit cf1c9c98ff
9 changed files with 225 additions and 20 deletions
+8 -3
View File
@@ -4,10 +4,15 @@ import { fetchArticle } from './utils';
const HOME_PAGE = 'https://apnews.com';
export const route: Route = {
path: '/rss/:rss?',
path: '/rss/:category?',
categories: ['traditional-media', 'popular'],
example: '/apnews/rss/business',
parameters: { rss: 'Route name from the first segment of the corresponding site, or `index` for the front page(default).' },
parameters: {
category: {
description: 'Category from the first segment of the corresponding site, or `index` for the front page.',
default: 'index',
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
@@ -22,7 +27,7 @@ export const route: Route = {
target: '/rss/:rss',
},
],
name: 'RSS',
name: 'News',
maintainers: ['zoenglinghou', 'mjysci', 'TonyRL'],
handler,
};
+96 -7
View File
@@ -9,14 +9,103 @@ export const route: Route = {
categories: ['social-media', 'popular'],
example: '/bilibili/ranking/0/3/1',
parameters: {
rid: '排行榜分区 id, 默认 0',
day: '时间跨度, 可为 1 3 7 30',
arc_type: '投稿时间, 可为 0(全部投稿) 1(近期投稿) , 默认 1',
disableEmbed: '默认为开启内嵌视频, 任意值为关闭',
rid: {
description: '排行榜分区 id',
default: '0',
options: [
{
label: '全站',
value: '0',
},
{
label: '动画',
value: '1',
},
{
label: '国创相关',
value: '168',
},
{
label: '音乐',
value: '3',
},
{
label: '舞蹈',
value: '129',
},
{
label: '游戏',
value: '4',
},
{
label: '科技',
value: '36',
},
{
label: '数码',
value: '188',
},
{
label: '生活',
value: '160',
},
{
label: '鬼畜',
value: '119',
},
{
label: '时尚',
value: '155',
},
{
label: '娱乐',
value: '5',
},
{
label: '影视',
value: '181',
},
],
},
day: {
description: '时间跨度',
options: [
{
value: '1',
label: '1日',
},
{
value: '3',
label: '3日',
},
{
value: '7',
label: '7日',
},
{
value: '30',
label: '30日',
},
],
},
arc_type: {
description: '投稿时间',
default: '1',
options: [
{
value: '0',
label: '全部投稿',
},
{
value: '1',
label: '近期投稿',
},
],
},
disableEmbed: {
description: '默认为开启内嵌视频, 任意值为关闭',
},
},
description: `| 全站 | 动画 | 国创相关 | 音乐 | 舞蹈 | 游戏 | 科技 | 数码 | 生活 | 鬼畜 | 时尚 | 娱乐 | 影视 |
| ---- | ---- | -------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| 0 | 1 | 168 | 3 | 129 | 4 | 36 | 188 | 160 | 119 | 155 | 5 | 181 |`,
handler,
};
+8 -1
View File
@@ -6,7 +6,14 @@ export const route: Route = {
path: '/build/:owner/:image/:tag?',
categories: ['program-update', 'popular'],
example: '/dockerhub/build/wangqiru/ttrss',
parameters: { owner: 'Image owner', image: 'Image name', tag: 'Image tag,default to latest' },
parameters: {
owner: 'Image owner',
image: 'Image name',
tag: {
description: 'Image tag',
default: 'latest',
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
+20 -1
View File
@@ -7,7 +7,26 @@ export const route: Route = {
path: '/group/:groupid/:type?',
categories: ['social-media', 'popular'],
example: '/douban/group/648102',
parameters: { groupid: '豆瓣小组的 id', type: '缺省 最新,essence 最热,elite 精华' },
parameters: {
groupid: '豆瓣小组的 id',
type: {
description: '类型',
options: [
{
label: '最新',
value: '',
},
{
label: '最热',
value: 'essence',
},
{
label: '精华',
value: 'elite',
},
],
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
+23 -1
View File
@@ -13,7 +13,29 @@ export const route: Route = {
path: '/issue/:user/:repo/:state?/:labels?',
categories: ['programming', 'popular'],
example: '/github/issue/vuejs/core/all/wontfix',
parameters: { user: 'GitHub username', repo: 'GitHub repo name', state: 'the state of the issues. Can be either `open`, `closed`, or `all`. Default: `open`.', labels: 'a list of comma separated label names' },
parameters: {
user: 'GitHub username',
repo: 'GitHub repo name',
state: {
description: 'the state of the issues.',
default: 'open',
options: [
{
label: 'Open',
value: 'open',
},
{
label: 'Closed',
value: 'closed',
},
{
label: 'All',
value: 'all',
},
],
},
labels: 'a list of comma separated label names',
},
radar: [
{
source: ['github.com/:user/:repo/issues', 'github.com/:user/:repo/issues/:id', 'github.com/:user/:repo'],
+6
View File
@@ -32,6 +32,12 @@ export const route: Route = {
categories: ['multimedia', 'popular'],
handler,
url: 'www.javbus.com',
example: '/javbus/star/rwt',
parameters: {
path: {
description: 'Any path of list page on javbus',
},
},
};
async function handler(ctx) {
+36 -5
View File
@@ -11,8 +11,42 @@ import ConfigNotFoundError from '@/errors/types/config-not-found';
export const route: Route = {
path: '/search/:keyword/:order?/:mode?',
categories: ['social-media', 'popular'],
example: '/pixiv/search/Nezuko/popular/2',
parameters: { keyword: 'keyword', order: 'rank mode, empty or other for time order, popular for popular order', mode: 'filte R18 content' },
example: '/pixiv/search/Nezuko/popular',
parameters: {
keyword: 'keyword',
order: {
description: 'rank mode, empty or other for time order, popular for popular order',
default: 'date',
options: [
{
label: 'time order',
value: 'date',
},
{
label: 'popular order',
value: 'popular',
},
],
},
mode: {
description: 'filte R18 content',
default: 'no',
options: [
{
label: 'only not R18',
value: 'safe',
},
{
label: 'only R18',
value: 'r18',
},
{
label: 'no filter',
value: 'no',
},
],
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
@@ -24,9 +58,6 @@ export const route: Route = {
name: 'Keyword',
maintainers: ['DIYgod'],
handler,
description: `| only not R18 | only R18 | no filter |
| ------------ | -------- | -------------- |
| safe | r18 | empty or other |`,
};
async function handler(ctx) {
+16 -1
View File
@@ -6,7 +6,22 @@ export const route: Route = {
path: '/routes/:lang?',
categories: ['program-update', 'popular'],
example: '/rsshub/routes/en',
parameters: { lang: 'Language, `zh` means Chinese docs, other values or null means English docs, `en` by default' },
parameters: {
lang: {
description: 'Language',
options: [
{
label: 'Chinese',
value: 'zh',
},
{
label: 'English',
value: 'en',
},
],
default: 'en',
},
},
radar: [
{
source: ['docs.rsshub.app/*'],
+12 -1
View File
@@ -161,7 +161,18 @@ interface RouteItem {
/**
* The description of the route parameters
*/
parameters?: Record<string, string>;
parameters?: Record<
string,
| string
| {
description: string;
default?: string;
options?: {
value: string;
label: string;
}[];
}
>;
/**
* Hints and additional explanations for users using this route, it will be appended after the route component, supports markdown