mirror of
https://github.com/hansputera/tiktok-dl.git
synced 2026-04-05 19:51:57 +02:00
feat(apps.web#api.providers): added "type (param data type)" in "params"
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
committed by
GitHub
parent
d7d11479a1
commit
33b8560b5e
@@ -1,6 +1,7 @@
|
||||
import type {NextApiRequest, NextApiResponse} from 'next';
|
||||
import {Providers} from 'tiktok-dl-core';
|
||||
import {ratelimitMiddleware} from '../../middleware/ratelimit';
|
||||
import type {Shape} from 'ow';
|
||||
|
||||
export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
await ratelimitMiddleware(req, res);
|
||||
@@ -9,7 +10,10 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
name: p.resourceName(),
|
||||
url: p.client?.defaults.options.prefixUrl,
|
||||
maintenance: p.maintenance,
|
||||
params: p.getParams() ?? {},
|
||||
params: p.getParams() ? Object.keys(p.getParams()!).map((x) => ({
|
||||
name: x,
|
||||
type: (p.getParams()![x] as Shape).type,
|
||||
})) : {},
|
||||
}));
|
||||
|
||||
return res.send(providers);
|
||||
|
||||
Reference in New Issue
Block a user