{"version":3,"sources":["../../../../src/framework/cli/commander/command/list-command.ts"],"names":["listCommand","program","commandName","description","options","list_command_default","error","exit"],"mappings":"2GAMA,IAAMA,EAAc,CAChBC,CAAAA,CACAC,EAAc,MAAA,CACdC,CAAAA,CAAc,iGACP,CACPF,CAAAA,CACK,QAAQC,CAAW,CAAA,CACnB,YAAYC,CAAW,CAAA,CACvB,MAAA,CAAO,yBAAA,CAA2B,oEAAoE,CAAA,CACtG,OAAO,mBAAA,CAAqB,KAAK,EACjC,MAAA,CAAO,gBAAA,CAAkB,qCAAqC,CAAA,CAC9D,MAAA,CAAO,wBAAyB,mFAAA,CAAqF,EAAE,CAAA,CACvH,MAAA,CAAO,wBAAyB,8EAAA,CAAgF,EAAE,CAAA,CAClH,MAAA,CAAO,eAAA,CAAiB,iBAAA,CAAmB,KAAK,CAAA,CAChD,OACG,MAAOC,CAAAA,EAOD,CACF,GAAI,CACA,MAAMC,CAAAA,CAAQD,CAAAA,CAAQ,UAAWA,CAAAA,CAAQ,IAAA,CAAM,CAC3C,YAAA,CAAcA,CAAAA,CAAQ,cAAgB,EAAC,CACvC,MAAOA,CAAAA,CAAQ,KAAA,CACf,YAAA,CAAcA,CAAAA,CAAQ,WAAA,EAAe,GACrC,OAAA,CAASA,CAAAA,CAAQ,OACrB,CAAC,EACL,OAASE,CAAAA,CAAY,CAEjB,QAAQ,GAAA,EAAI,CAEZ,QAAQ,KAAA,CAAMA,CAAK,EACnBC,IAAAA,CAAK,CAAC,EACV,CACJ,CACJ,EACR,CAAA,CAEOF,CAAAA,CAAQL","file":"index.mjs","sourcesContent":["import { exit } from \"node:process\";\n\nimport type { Command } from \"commander\";\n\nimport command from \"../../command/list/list-command\";\n\nconst listCommand = (\n    program: Command,\n    commandName = \"list\",\n    description = \"List all available API routes; Supported frameworks are next, express, koa, hapi and fastify\",\n): void => {\n    program\n        .command(commandName)\n        .description(description)\n        .option(\"--framework <framework>\", \"Framework to use, choose from next, express, koa, hapi and fastify\")\n        .option(\"-p, --path [path]\", \"...\")\n        .option(\"--group [type]\", \"Groups routes. Supported: path, tag\")\n        .option(\"--include-path [path]\", \"Includes only routes which contain a given path element. (comma-separated values)\", [])\n        .option(\"--exclude-path [path]\", \"Excludes routes which contain a given path element. (comma-separated values)\", [])\n        .option(\"-v, --verbose\", \"Verbose output.\", false)\n        .action(\n            async (options: {\n                excludePaths?: string[];\n                framework: \"express\" | \"fastify\" | \"hapi\" | \"koa\" | \"next\";\n                group?: string;\n                includePath?: string[];\n                path: string;\n                verbose?: boolean;\n            }) => {\n                try {\n                    await command(options.framework, options.path, {\n                        excludePaths: options.excludePaths ?? [],\n                        group: options.group,\n                        includePaths: options.includePath ?? [],\n                        verbose: options.verbose as boolean | undefined,\n                    });\n                } catch (error: any) {\n                    // eslint-disable-next-line no-console\n                    console.log();\n                    // eslint-disable-next-line no-console\n                    console.error(error);\n                    exit(1);\n                }\n            },\n        );\n};\n\nexport default listCommand;\n"]}