// Auto-generated by scripts/generate.ts — do not edit import { defineCommand } from 'citty'; import { callApi } from '../../lib/call.js'; import { resolveRepeatedFlag } from '../../lib/repeated-flags.js'; export default defineCommand({ meta: { name: 'workflow', description: 'Workflows Executions' }, args: { operation: { type: 'positional', description: 'operationId to call', required: false }, param: { type: 'string', alias: 'p', description: 'Parameter key=value' }, data: { type: 'string', alias: 'd', description: 'Request body JSON' }, header: { type: 'string', alias: 'H', description: 'Custom header' }, include: { type: 'boolean', alias: 'i', description: 'Include response headers' }, definition: { type: 'string', description: 'Override OpenAPI spec file/URL' }, server: { type: 'string', alias: 's', description: 'Override server base URL' }, 'use-dev': { type: 'boolean', description: 'Target dev environment' }, 'use-staging': { type: 'boolean', description: 'Target staging environment' }, profile: { type: 'string', description: 'Use a named profile' }, token: { type: 'string', alias: 't', description: 'Bearer token' }, json: { type: 'boolean', description: 'Output raw JSON' }, verbose: { type: 'boolean', alias: 'v', description: 'Verbose output' }, guided: { type: 'boolean', description: 'Prompt for all parameters interactively' }, interactive: { type: 'boolean', description: 'Interactive mode' }, jsonata: { type: 'string', description: 'JSONata expression to transform response' }, _ophelp: { type: 'boolean', description: 'Show operation help', required: false }, _apihelp: { type: 'boolean', description: 'Show API help', required: false }, }, run: ({ args, rawArgs }) => { // Extract additional positional args (after operationId) const positionalArgs: string[] = []; if (args.operation && rawArgs) { const opIdx = rawArgs.indexOf(args.operation); if (opIdx >= 0) { for (let i = opIdx + 1; i < rawArgs.length; i++) { const arg = rawArgs[i]; if (arg.startsWith('-')) break; positionalArgs.push(arg); } } } return callApi('workflow', { ...args, help: !!(args as Record)._ophelp, _apihelp: !!(args as Record)._apihelp, param: resolveRepeatedFlag({ rawArgs, names: ['-p', '--param'], parsed: args.param }), header: resolveRepeatedFlag({ rawArgs, names: ['-H', '--header'], parsed: args.header }), _args: positionalArgs, }); }, });