Files
wehub-resource-sync 9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:48 +08:00

31 lines
1.8 KiB
JavaScript

import { cli, Strategy } from '@jackwener/opencli/registry';
import { normalizeLimit, readTeamMatches } from './utils.js';
cli({
site: 'hltv',
name: 'team-matches',
description: 'Read recent HLTV team map results from the stats team matches page',
access: 'read',
example: 'opencli hltv team-matches 6667/falcons --limit 10 -f json',
domain: 'www.hltv.org',
strategy: Strategy.UI,
browser: true,
navigateBefore: false,
args: [
{ name: 'team', type: 'string', positional: true, required: true, help: 'Team ref: 6667/falcons, team URL, or stats team URL' },
{ name: 'period', type: 'string', default: 'all', help: 'all / lastMonth / last3Months / last6Months / last12Months / YYYY / YYYY-MM-DD:YYYY-MM-DD' },
{ name: 'eventType', type: 'string', default: 'all', help: 'all / majors / bigEvents / mvpEvents / lan / online' },
{ name: 'event', type: 'string', default: 'all', help: 'all / event id / /events/:id URL / stats URL with event=' },
{ name: 'ranking', type: 'string', default: 'all', help: 'all / top5 / top10 / top20 / top30 / top50' },
{ name: 'map', type: 'string', default: 'all', help: 'all / ancient / anubis / dust2 / inferno / mirage / nuke / overpass / cache / cobblestone / season / train / tuscan / vertigo' },
{ name: 'version', type: 'string', default: 'both', help: 'both / cs2 / csgo' },
{ name: 'offset', type: 'int', default: 0, help: 'Pagination offset; must be a multiple of 100' },
{ name: 'limit', type: 'int', default: 100, help: 'Rows to return from the current page (max 100)' },
],
columns: ['rank', 'date', 'team', 'opponent', 'map', 'result', 'teamId', 'matchStatsId', 'details'],
func: async (page, args) => {
const limit = normalizeLimit(args.limit, 100, 100);
return readTeamMatches(page, args, limit);
},
});