MCPcopy Create free account
hub / github.com/vercel/vercel / printTagOperationResolveError

Function printTagOperationResolveError

packages/cli/src/commands/api/index.ts:557–587  ·  view source on GitHub ↗
(
  result: Extract<ResolveByTagOperationResult, { ok: false }>,
  allEndpoints: EndpointInfo[]
)

Source from the content-addressed store, hash-verified

555}
556
557function printTagOperationResolveError(
558 result: Extract<ResolveByTagOperationResult, { ok: false }>,
559 allEndpoints: EndpointInfo[]
560): void {
561 if (result.reason === 'no_tag') {
562 const tags = [...new Set(allEndpoints.flatMap(ep => ep.tags || []))].sort();
563 const preview = tags.slice(0, 25).join(', ');
564 output.error(
565 `No operations use tag "${result.tag}".${tags.length > 0 ? ` Example tags: ${preview}${tags.length > 25 ? ', …' : ''}.` : ''} Run \`vercel api ls --format json\` to inspect tags.`
566 );
567 return;
568 }
569
570 if (result.reason === 'no_operation') {
571 const ids = result.tagMatches
572 .map(ep => ep.operationId)
573 .filter(Boolean)
574 .sort();
575 output.error(
576 `No operation matches "${result.operationHint}" under tag "${result.tag}".${ids.length > 0 ? ` Operations include: ${ids.slice(0, 20).join(', ')}${ids.length > 20 ? ', …' : ''}.` : ''}`
577 );
578 return;
579 }
580
581 const lines = result.tagMatches.map(
582 ep => ` ${ep.operationId} ${ep.method} ${ep.path}`
583 );
584 output.error(
585 `Multiple operations match "${result.operationHint}" under tag "${result.tag}":\n${lines.join('\n')}`
586 );
587}
588
589async function executeApiRequest(
590 client: Client,

Callers 2

runTagOperationFunction · 0.85

Calls 4

sortMethod · 0.80
errorMethod · 0.80
filterMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected