@visulima/api-platform 3.0.48 → 3.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/chunk-3QFJM3GS.js +2 -0
  3. package/dist/chunk-3QFJM3GS.js.map +1 -0
  4. package/dist/{chunk-GI7VS3DY.mjs → chunk-5DME62EW.mjs} +2 -2
  5. package/dist/chunk-5DME62EW.mjs.map +1 -0
  6. package/dist/{chunk-66EUOAFS.mjs → chunk-BJSUSPWM.mjs} +2 -2
  7. package/dist/{chunk-66EUOAFS.mjs.map → chunk-BJSUSPWM.mjs.map} +1 -1
  8. package/dist/{chunk-MYU5ZKUN.js → chunk-EEEP2HBM.js} +2 -2
  9. package/dist/chunk-EEEP2HBM.js.map +1 -0
  10. package/dist/chunk-EMGG2IOR.js +3 -0
  11. package/dist/chunk-EMGG2IOR.js.map +1 -0
  12. package/dist/chunk-FVUS6T4L.js +6 -0
  13. package/dist/chunk-FVUS6T4L.js.map +1 -0
  14. package/dist/chunk-IIZJ6MH4.mjs +6 -0
  15. package/dist/chunk-IIZJ6MH4.mjs.map +1 -0
  16. package/dist/chunk-KG2WICAI.mjs +3 -0
  17. package/dist/chunk-KG2WICAI.mjs.map +1 -0
  18. package/dist/chunk-MZZ3R2JF.mjs +2 -0
  19. package/dist/chunk-MZZ3R2JF.mjs.map +1 -0
  20. package/dist/{chunk-UPRO35MO.js → chunk-NCNFFJRK.js} +2 -2
  21. package/dist/{chunk-UPRO35MO.js.map → chunk-NCNFFJRK.js.map} +1 -1
  22. package/dist/framework/cli/commander/index.js +1 -1
  23. package/dist/framework/cli/commander/index.js.map +1 -1
  24. package/dist/framework/cli/commander/index.mjs +1 -1
  25. package/dist/framework/cli/commander/index.mjs.map +1 -1
  26. package/dist/framework/cli/index.js +1 -1
  27. package/dist/framework/cli/index.mjs +1 -1
  28. package/dist/framework/next/index-browser.js +1 -1
  29. package/dist/framework/next/index-browser.mjs +1 -1
  30. package/dist/framework/next/index-server.d.mts +1 -1
  31. package/dist/framework/next/index-server.d.ts +1 -1
  32. package/dist/framework/next/index-server.js +1 -1
  33. package/dist/framework/next/index-server.js.map +1 -1
  34. package/dist/framework/next/index-server.mjs +1 -1
  35. package/dist/framework/next/index-server.mjs.map +1 -1
  36. package/dist/framework/next/routes/pages/redoc/index.js.map +1 -1
  37. package/dist/framework/next/routes/pages/redoc/index.mjs.map +1 -1
  38. package/dist/framework/next/routes/pages/swagger/index.js.map +1 -1
  39. package/dist/framework/next/routes/pages/swagger/index.mjs.map +1 -1
  40. package/dist/index-browser.js +1 -1
  41. package/dist/index-browser.mjs +1 -1
  42. package/dist/index-server.d.mts +2 -2
  43. package/dist/index-server.d.ts +2 -2
  44. package/dist/index-server.js +2 -2
  45. package/dist/index-server.js.map +1 -1
  46. package/dist/index-server.mjs +1 -1
  47. package/dist/index-server.mjs.map +1 -1
  48. package/dist/{swagger-handler-CsN63rqo.d.mts → swagger-handler-BPZJNDgC.d.mts} +1 -1
  49. package/dist/{swagger-handler-CsN63rqo.d.ts → swagger-handler-BPZJNDgC.d.ts} +1 -1
  50. package/package.json +8 -9
  51. package/recipes/api/swagger.ts +1 -1
  52. package/dist/chunk-67LLYNYS.mjs +0 -2
  53. package/dist/chunk-67LLYNYS.mjs.map +0 -1
  54. package/dist/chunk-GI7VS3DY.mjs.map +0 -1
  55. package/dist/chunk-MYU5ZKUN.js.map +0 -1
  56. package/dist/chunk-OSYBNW3V.js +0 -6
  57. package/dist/chunk-OSYBNW3V.js.map +0 -1
  58. package/dist/chunk-TEWEO624.mjs +0 -6
  59. package/dist/chunk-TEWEO624.mjs.map +0 -1
  60. package/dist/chunk-YG667K32.js +0 -2
  61. package/dist/chunk-YG667K32.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/framework/cli/command/list/routes/express/map-keys-to-path.ts","../src/framework/cli/command/list/routes/express/path-regex-parser.ts","../src/framework/cli/command/list/routes/express/express-path-parser.ts","../src/framework/cli/command/list/routes/express-routes.ts","../src/framework/cli/command/list/routes/fastify-routes.ts","../src/framework/cli/command/list/routes/hapi-routes.ts","../src/framework/cli/command/list/routes/koa-routes.ts","../src/framework/cli/command/list/routes/next/api-route-file-parser.ts","../../../node_modules/.pnpm/@visulima+fs@3.1.9_yaml@2.8.1/node_modules/@visulima/fs/dist/packem_shared/assertValidFileOrDirectoryPath-DgPIPmZT.mjs","../../../node_modules/.pnpm/@visulima+path@1.4.0/node_modules/@visulima/path/dist/utils.mjs","../../../node_modules/.pnpm/@visulima+fs@3.1.9_yaml@2.8.1/node_modules/@visulima/fs/dist/packem_shared/WalkError-BsngoIKJ.mjs","../../../node_modules/.pnpm/@visulima+fs@3.1.9_yaml@2.8.1/node_modules/@visulima/fs/dist/packem_shared/walk-include-C9pVST87.mjs","../../../node_modules/.pnpm/@visulima+fs@3.1.9_yaml@2.8.1/node_modules/@visulima/fs/dist/packem_shared/walk-BZTXbT87.mjs","../../../node_modules/.pnpm/@visulima+fs@3.1.9_yaml@2.8.1/node_modules/@visulima/fs/dist/packem_shared/collect-CyYPQFMs.mjs","../src/framework/cli/command/list/utils.ts","../src/framework/cli/command/list/routes/next/collect-api-route-files.ts","../src/framework/cli/command/list/get-routes.ts","../src/framework/cli/command/list/routes/routes-group-by.ts","../src/framework/cli/command/list/routes/routes-render.ts","../src/framework/cli/command/list/list-command.ts"],"names":["mapKeysToPath","layerRegexPath","keys","convertedSubPath","key","map_keys_to_path_default","pathRegexParser","mappedPath","match","path_regex_parser_default","parseRouteLayer","layer","basePath","lastRequestHandler","pathParameters","filtered","element","path","traverse","routes","l","expressPathParser","app","router","express_path_parser_default","expressRoutes","route","express_routes_default","getSegment","line","getMethod","fastifyRoutes","lines","segments","allSegments","index","segment","entries","item","methods","spaces","depth","isRoute","seg","_index","previousArray","r","method","fastify_routes_default","hapiRoutes","coreRoutes","hapi_routes_default","koaRoutes","middlewareFunction","koa_routes_default","extensionRegex","apiRouteFileParser","apiRouteFile","cwd","verbose","toNamespacedPath","cwdPath","nodeCwd","specs","parsedJsDocumentFile","parseFile","jsDocumentCommentsToOpenApi","parsedSwaggerJsDocumentFile","swaggerJsDocumentCommentsToOpenApi","readFileSync","spec","pathSpec","methodSpec","api_route_file_parser_default","a","t","n","o","s","getDefaultExportFromCjs","x","binaryExtensions$1","hasRequiredBinaryExtensions","requireBinaryExtensions","binaryExtensionsExports","binaryExtensions","__defProp","__name","target","value","toPath","urlOrPath","normalizeWindowsPath","fileURLToPath","c","g","p","i","D","y","O","P","normalize","basename","w","f","d","u","resolve","F","join","h","e","ALLOWED_EXTENSIONS","getAppWorkingDirectoryPath","appFilePath","lastParsedPath","parse","readdirSync","getFrameworkName","directory","packageJSONFilePath","dependencies","getApp","appExport","frameworkName","isDirectory","statSync","collectApiRouteFiles","apiFolderPath","collect_api_route_files_default","getRoutes","appOrPath","apiRouteFiles","routesGroupBy","list","keyGetter","map","collection","routes_group_by_default","renderRoute","routePath","colorMap","chalk","methodText","coloredMethod","spacesCount","dotsCount","dots","routeText","routesRender","routesMap","options","routes_render_default","listCommand","framework","frameworkPath","process","existsSync","appWorkingDirectoryPath","extname","environmentFilePath","isTypeScriptApp","tscPath","execSync","error","rmSync","appJsFilePath","defaultExport","ipath","epath","groupedMap","counter","groupedRoutes","renderedRoute","list_command_default"],"mappings":"wZAQA,IAAMA,EAAAA,CAAgB,CAACC,CAAAA,CAA8BC,CAAAA,GAAwB,CACzE,GAAIA,EAAK,MAAA,GAAW,CAAA,CAChB,MAAM,IAAI,KAAA,CAAM,sCAAsC,CAAA,CAG1D,IAAIC,CAAAA,CAAmBF,CAAAA,CAAe,QAAA,EAAS,CAE/C,OAAAC,CAAAA,CAAK,OAAA,CAASE,CAAAA,EAAQ,CAClBD,CAAAA,CAAmBC,CAAAA,CAAI,SACjBD,CAAAA,CAAiB,OAAA,CAAQ,sBAAA,CAAwB,CAAA,EAAA,EAAKC,CAAAA,CAAI,IAAI,GAAG,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A,WAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MAAA,CACA,KAAA,CACA,MACA,KAAA,CACA,IAAA,CACA,KAAA,CACA,MAAA,CACA,SAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MACA,KAAA,CACA,IAAA,CACA,IAAA,CACA,KAAA,CACA,SAAA,CACA,IAAA,CACA,MAAA,CACA,MAAA,CACA,OACA,MAAA,CACA,MAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,OACA,KAAA,CACA,MAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MACA,IAAA,CACA,KAAA,CACA,MAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,MAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,OACA,KAAA,CACA,OAAA,CACA,KAAA,CACA,KAAA,CACA,MAAA,CACA,MAAA,CACA,KAAA,CACA,MAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,SAAA,CACA,OAAA,CACA,GAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,OAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MAAA,CACA,MAAA,CACA,MACA,MAAA,CACA,KAAA,CACA,KAAA,CACA,MAAA,CACA,MAAA,CACA,KAAA,CACA,MAAA,CACA,MAAA,CACA,MACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,IAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,YACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,KAAA,CACA,MAAA,CACA,KAAA,CAC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J6MH4.mjs","sourcesContent":["import type { ExpressRegex, Key } from \"./types\";\n\n/**\n * Map's the keys/path variables to the regex inside a given path\n * @param layerRegexPath The regex for a router with path parameters\n * @param keys The keys that represent the path parameters\n * @returns The regex for a path variable converted to original string on the express route\n */\nconst mapKeysToPath = (layerRegexPath: ExpressRegex, keys: Key[]): string => {\n if (keys.length === 0) {\n throw new Error(\"must include at least one key to map\");\n }\n\n let convertedSubPath = layerRegexPath.toString();\n\n keys.forEach((key) => {\n convertedSubPath = key.optional\n ? convertedSubPath.replace(\"(?:\\\\/([^\\\\/]+?))?\\\\\", `/:${key.name}?`)\n : convertedSubPath.replace(String.raw`(?:([^\\/]+?))`, `:${key.name}`);\n });\n\n return convertedSubPath\n .replace(String.raw`/?(?=\\/|$)/i`, \"\")\n .replace(\"/^\", \"\")\n .replaceAll(\"\\\\\", \"\")\n .replaceAll(/\\/{2,}/gu, \"/\");\n};\n\nexport default mapKeysToPath;\n","import mapKeysToPath from \"./map-keys-to-path\";\nimport type { ExpressRegex, Key } from \"./types\";\n\n/**\n * Parses an express layer's regex and converts it to the original format seen in code.\n * @param layerRegexPath The layer's regex pattern\n * @param keys The keys that represent the layer's path parameters\n * @returns The path string for that layer\n * Code inspired and modify from:\n * https://github.com/expressjs/express/issues/3308#issuecomment-300957572\n */\nconst pathRegexParser = (layerRegexPath: ExpressRegex | string, keys: Key[]): string => {\n if (typeof layerRegexPath === \"string\") {\n return layerRegexPath;\n }\n\n if (layerRegexPath.fast_slash) {\n return \"\";\n }\n\n if (layerRegexPath.fast_star) {\n return \"*\";\n }\n\n let mappedPath = \"\";\n\n if (keys.length > 0) {\n mappedPath = mapKeysToPath(layerRegexPath, keys);\n }\n\n const match = /^\\/\\^((?:\\\\[$()*+./?[\\\\\\]^{|}]|[^$()*+./?[\\\\\\]^{|}])*)\\$\\//u.exec(\n layerRegexPath.toString().replace(String.raw`\\/?`, \"\").replace(String.raw`(?=\\/|$)`, \"$\"),\n ) as string[];\n\n if (Array.isArray(match) && match.length > 1) {\n return (match[1] as string).replaceAll(/\\\\(.)/gu, \"$1\").slice(1);\n }\n\n if (mappedPath) {\n return mappedPath.slice(1);\n }\n\n return layerRegexPath.toString();\n};\n\nexport default pathRegexParser;\n","import type { Express, Router } from \"express\";\n\nimport pathRegexParser from \"./path-regex-parser\";\nimport type { Key, Layer, Parameter, Route, RouteMetaData } from \"./types\";\n\n/**\n * Parses a route object. Route objects are the leafs of an express router tree\n * @param layer The layer of this route object - represents the stack of middleware and other metadata\n * @param keys The full set of keys for this particular route\n * @param basePath The base path as it was initial declared for this route\n * @returns A ExpressPath object holding the metadata for a given route\n */\nconst parseRouteLayer = (layer: Required<Layer>, keys: Key[], basePath: string): RouteMetaData => {\n const lastRequestHandler = layer.route.stack.at(-1) as Layer;\n const pathParameters: Parameter[] = keys.map((key) => {\n return { in: \"path\", name: key.name, required: !key.optional };\n });\n\n const filtered = layer.route.stack.filter((element) => (element.handle as Route).metadata);\n\n if (filtered.length > 1) {\n throw new Error(\"Only one metadata middleware is allowed per route\");\n }\n\n const path = (basePath + layer.route.path).replaceAll(/\\/{2,}/gu, \"/\");\n\n if (filtered.length === 0) {\n return { method: lastRequestHandler.method, path, pathParams: pathParameters };\n }\n\n return {\n metadata: ((filtered[0] as Layer).handle as Route).metadata,\n method: lastRequestHandler.method,\n path,\n pathParams: pathParameters,\n };\n};\n\n/**\n * Recursive traversal method for the express router and middleware tree.\n * @param routes The array of routes to add to\n * @param path The current path segment that we have traversed so far\n * @param layer The current 'layer' of the router tree\n * @param keys The keys for the parameter's in the current path branch of the traversal\n * @returns void - base case saves result to internal object\n */\nconst traverse = (routes: RouteMetaData[], path: string, layer: Layer, keys: Key[]): void => {\n // eslint-disable-next-line no-param-reassign\n keys = [...keys, ...layer.keys];\n\n if (layer.name === \"router\" && layer.handle?.stack !== undefined) {\n for (const l of layer.handle.stack) {\n // eslint-disable-next-line no-param-reassign\n path = path || \"\";\n\n traverse(routes, `${path}/${pathRegexParser(layer.regexp, layer.keys)}`, l as Layer, keys);\n }\n }\n\n if (!layer.route || layer.route.stack.length === 0) {\n return;\n }\n\n routes.push(parseRouteLayer(layer as Required<Layer>, keys, path));\n};\n\n// @TODO use this to parse the express swagger\n\n/**\n * Parses an Express app and generates list of routes with metadata.\n *\n * Can Parse:\n * - Nested Routers and Complex Express Projects\n * - Optional parameters e.g. /:name?\n * - Complex Matching routes e.g. /ma*tch, /ex(ab)?mple\n * - Regex routes e.g. /\\/abc|\\/xyz/\n * - Array of paths e.g. app.get(['/abc', '/xyz']) -> /abc,xyz/\n * @param app The Express app reference. Must be used after all routes have been attached\n * @returns List of routes for this express app with meta-data that has been picked up\n */\nconst expressPathParser = (app: Express): RouteMetaData[] => {\n // eslint-disable-next-line no-underscore-dangle\n const router: Router = app._router || app.router;\n const routes: RouteMetaData[] = [];\n\n for (const layer of router.stack) {\n // @TODO: revisit this type assertion\n traverse(routes, \"\", layer as unknown as Layer, []);\n }\n\n return routes;\n};\n\nexport default expressPathParser;\n","import type { Express } from \"express\";\n\nimport expressPathParser from \"./express/express-path-parser\";\nimport type { RouteMetaData } from \"./express/types\";\nimport type { Route } from \"./types\";\n\nconst expressRoutes = (app: Express): Route[] => {\n const routes: Route[] = [];\n\n expressPathParser(app).forEach((route: RouteMetaData) => {\n routes.push({\n file: \"unknown\",\n method: route.method.toUpperCase(),\n path: route.path,\n tags: [],\n });\n });\n\n return routes;\n};\n\nexport default expressRoutes;\n","import type { FastifyInstance } from \"fastify\";\n\nimport type { Route } from \"./types\";\n\n// \"<spaces> activity (GET)\" -> \"activity\"\nconst getSegment = (line: string) => line.replaceAll(/ \\(.*\\)/gu, \"\").trim();\n\n// \"<spaces> activity (GET)\" -> \"GET\"\nconst getMethod = (line: string) => (line.trim().split(\" \")[1] as string).slice(1, -1);\n\ninterface Segment {\n depth: number;\n index: number;\n isRoute: boolean;\n methods: string[] | null;\n segment: string;\n}\n\nconst fastifyRoutes = (app: FastifyInstance): Route[] => {\n const printedRoutes = app\n .printRoutes()\n .replaceAll(/[─│└├]/gu, \" \")\n .trimEnd();\n\n const lines = printedRoutes.split(\"\\n\");\n\n // eslint-disable-next-line unicorn/no-array-reduce\n const segments = lines.reduce((allSegments: Segment[], line, index) => {\n const segment = getSegment(line);\n const previousSegment = getSegment(lines[index - 1] ?? \"\");\n\n if (previousSegment === segment) {\n const entries: Segment[] = allSegments.filter((item) => item.index < index && item.segment === segment);\n\n const { methods } = entries.at(-1) as Segment;\n\n if (methods !== null) {\n methods.push(getMethod(line));\n }\n\n return allSegments;\n }\n\n // spaces preceding segment / not counting single space between segment and (METHOD)\n const spaces = line.replaceAll(/ \\(.*\\)/gu, \"\").match(/ /gu);\n\n if (spaces === null) {\n throw new Error(\"Invalid spaces\");\n }\n\n const depth = spaces.length / 4;\n const isRoute = line.includes(\"(\");\n const methods = isRoute ? [getMethod(line)] : null;\n\n allSegments.push({\n depth,\n index,\n isRoute,\n methods,\n segment,\n });\n\n return allSegments;\n }, []);\n\n const routes: Route[] = [];\n\n segments\n .filter((item) => item.isRoute)\n .forEach((item) => {\n const ancestorSegments = segments\n .filter((seg) => seg.index < item.index && seg.depth < item.depth)\n // eslint-disable-next-line unicorn/prefer-array-some\n .filter((seg, _index, previousArray) => !previousArray.find((segment) => segment.depth === seg.depth && segment.index > seg.index));\n\n const route = [...ancestorSegments.map((r) => r.segment), item.segment].join(\"\");\n\n if (item.methods === null) {\n throw new Error(\"Invalid methods\");\n }\n\n item.methods.forEach((method: string) => {\n routes.push({\n file: \"unknown\",\n method: method.toUpperCase(),\n path: route,\n tags: [],\n });\n });\n });\n\n return routes;\n};\n\nexport default fastifyRoutes;\n","import type { Server } from \"@hapi/hapi\";\n\nimport type { Route } from \"./types\";\n\nconst hapiRoutes = (app: Server): Route[] => {\n // @ts-expect-error TS2339: Property '_core' does not exist on type 'Server'. Internal API.\n // eslint-disable-next-line no-underscore-dangle\n const core = app._core as any;\n const coreRoutes = core.router.routes;\n const routes: Route[] = [];\n\n [...coreRoutes.keys()].forEach((method: string) => {\n coreRoutes.get(method).routes.forEach((route: any) => {\n routes.push({\n file: \"unknown\",\n method: route.route.method.toUpperCase(),\n path: route.path,\n tags: [],\n });\n });\n });\n\n return routes;\n};\n\nexport default hapiRoutes;\n","import type Koa from \"koa\";\n\nimport type { Route } from \"./types\";\n\nconst koaRoutes = (app: Koa): Route[] => {\n const routes: Route[] = [];\n\n app.middleware\n .filter((middlewareFunction) => (middlewareFunction as any).router)\n\n .flatMap((middlewareFunction) => (middlewareFunction as any).router.stack)\n .forEach((route) => {\n routes.push({\n file: \"unknown\",\n method: route.methods.join(\"|\").toUpperCase(),\n path: route.path,\n tags: [],\n });\n });\n\n return routes;\n};\n\nexport default koaRoutes;\n","import { readFileSync } from \"node:fs\";\nimport { cwd as nodeCwd } from \"node:process\";\n\nimport type { OpenApiObject } from \"@visulima/jsdoc-open-api\";\nimport { jsDocumentCommentsToOpenApi, parseFile, swaggerJsDocumentCommentsToOpenApi } from \"@visulima/jsdoc-open-api\";\nimport { toNamespacedPath } from \"@visulima/path\";\n\nimport type { Route } from \"../types\";\n\nconst extensionRegex = /\\.(js|ts|mjs|cjs)$/u;\n\nconst apiRouteFileParser = (apiRouteFile: string, cwd: string, verbose = false): Route[] => {\n // eslint-disable-next-line no-param-reassign\n apiRouteFile = toNamespacedPath(apiRouteFile);\n\n const cwdPath = toNamespacedPath(nodeCwd());\n\n let specs: OpenApiObject[] = [];\n\n const parsedJsDocumentFile = parseFile(apiRouteFile, jsDocumentCommentsToOpenApi, verbose);\n\n specs = [...specs, ...parsedJsDocumentFile.map((item) => item.spec)];\n\n const parsedSwaggerJsDocumentFile = parseFile(apiRouteFile, swaggerJsDocumentCommentsToOpenApi, verbose);\n\n specs = [...specs, ...parsedSwaggerJsDocumentFile.map((item) => item.spec)];\n\n const routes: Route[] = [];\n\n if (specs.length === 0) {\n const apiRouteFileContent = readFileSync(apiRouteFile, \"utf8\");\n\n apiRouteFileContent.split(/\\r?\\n/u).forEach((line) => {\n const match = /[=aces|]+\\s[\"'|](GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS)[\"'|]/u.exec(line);\n\n if (match) {\n let [, method] = match;\n\n if (method === \"GET\") {\n method = \"GET|HEAD\";\n }\n\n routes.push({\n file: apiRouteFile.replace(`${cwdPath}/`, \"\"),\n method: method as string,\n path: toNamespacedPath(apiRouteFile.replace(cwd, \"\").replace(extensionRegex, \"\")),\n tags: [],\n });\n }\n });\n\n if (routes.length === 0) {\n routes.push({\n file: apiRouteFile.replace(`${cwdPath}/`, \"\"),\n method: \"GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS\",\n path: toNamespacedPath(apiRouteFile.replace(cwd, \"\").replace(extensionRegex, \"\")),\n tags: [],\n });\n }\n\n return routes;\n }\n\n specs.forEach((spec) => {\n const paths = Object.entries(spec?.paths ?? {});\n\n paths.forEach(([path, pathSpec]) => {\n const methods = Object.entries(pathSpec);\n\n methods.forEach(([method, methodSpec]) => {\n routes.push({\n file: apiRouteFile.replace(`${cwdPath}/`, \"\"),\n method: method.toUpperCase(),\n path: toNamespacedPath(path),\n tags: methodSpec.tags,\n });\n });\n });\n });\n\n return routes;\n};\n\nexport default apiRouteFileParser;\n","var a=Object.defineProperty;var t=(e,r)=>a(e,\"name\",{value:r,configurable:!0});var n=Object.defineProperty,o=t((e,r)=>n(e,\"name\",{value:r,configurable:!0}),\"n\");const s=o(e=>{if(!e||!(e instanceof URL)&&typeof e!=\"string\")throw new TypeError(\"Path must be a non-empty string or URL.\")},\"assertValidFileOrDirectoryPath\");export{s as default};\n","import { fileURLToPath } from 'node:url';\nimport { k as normalizeWindowsPath, j as join, e as extname } from './packem_shared/path-lU4hG9gZ.mjs';\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar binaryExtensions$1;\nvar hasRequiredBinaryExtensions;\n\nfunction requireBinaryExtensions () {\n\tif (hasRequiredBinaryExtensions) return binaryExtensions$1;\n\thasRequiredBinaryExtensions = 1;\n\tbinaryExtensions$1 = [\n\t\t\"3dm\",\n\t\t\"3ds\",\n\t\t\"3g2\",\n\t\t\"3gp\",\n\t\t\"7z\",\n\t\t\"a\",\n\t\t\"aac\",\n\t\t\"adp\",\n\t\t\"afdesign\",\n\t\t\"afphoto\",\n\t\t\"afpub\",\n\t\t\"ai\",\n\t\t\"aif\",\n\t\t\"aiff\",\n\t\t\"alz\",\n\t\t\"ape\",\n\t\t\"apk\",\n\t\t\"appimage\",\n\t\t\"ar\",\n\t\t\"arj\",\n\t\t\"asf\",\n\t\t\"au\",\n\t\t\"avi\",\n\t\t\"bak\",\n\t\t\"baml\",\n\t\t\"bh\",\n\t\t\"bin\",\n\t\t\"bk\",\n\t\t\"bmp\",\n\t\t\"btif\",\n\t\t\"bz2\",\n\t\t\"bzip2\",\n\t\t\"cab\",\n\t\t\"caf\",\n\t\t\"cgm\",\n\t\t\"class\",\n\t\t\"cmx\",\n\t\t\"cpio\",\n\t\t\"cr2\",\n\t\t\"cr3\",\n\t\t\"cur\",\n\t\t\"dat\",\n\t\t\"dcm\",\n\t\t\"deb\",\n\t\t\"dex\",\n\t\t\"djvu\",\n\t\t\"dll\",\n\t\t\"dmg\",\n\t\t\"dng\",\n\t\t\"doc\",\n\t\t\"docm\",\n\t\t\"docx\",\n\t\t\"dot\",\n\t\t\"dotm\",\n\t\t\"dra\",\n\t\t\"DS_Store\",\n\t\t\"dsk\",\n\t\t\"dts\",\n\t\t\"dtshd\",\n\t\t\"dvb\",\n\t\t\"dwg\",\n\t\t\"dxf\",\n\t\t\"ecelp4800\",\n\t\t\"ecelp7470\",\n\t\t\"ecelp9600\",\n\t\t\"egg\",\n\t\t\"eol\",\n\t\t\"eot\",\n\t\t\"epub\",\n\t\t\"exe\",\n\t\t\"f4v\",\n\t\t\"fbs\",\n\t\t\"fh\",\n\t\t\"fla\",\n\t\t\"flac\",\n\t\t\"flatpak\",\n\t\t\"fli\",\n\t\t\"flv\",\n\t\t\"fpx\",\n\t\t\"fst\",\n\t\t\"fvt\",\n\t\t\"g3\",\n\t\t\"gh\",\n\t\t\"gif\",\n\t\t\"graffle\",\n\t\t\"gz\",\n\t\t\"gzip\",\n\t\t\"h261\",\n\t\t\"h263\",\n\t\t\"h264\",\n\t\t\"icns\",\n\t\t\"ico\",\n\t\t\"ief\",\n\t\t\"img\",\n\t\t\"ipa\",\n\t\t\"iso\",\n\t\t\"jar\",\n\t\t\"jpeg\",\n\t\t\"jpg\",\n\t\t\"jpgv\",\n\t\t\"jpm\",\n\t\t\"jxr\",\n\t\t\"key\",\n\t\t\"ktx\",\n\t\t\"lha\",\n\t\t\"lib\",\n\t\t\"lvp\",\n\t\t\"lz\",\n\t\t\"lzh\",\n\t\t\"lzma\",\n\t\t\"lzo\",\n\t\t\"m3u\",\n\t\t\"m4a\",\n\t\t\"m4v\",\n\t\t\"mar\",\n\t\t\"mdi\",\n\t\t\"mht\",\n\t\t\"mid\",\n\t\t\"midi\",\n\t\t\"mj2\",\n\t\t\"mka\",\n\t\t\"mkv\",\n\t\t\"mmr\",\n\t\t\"mng\",\n\t\t\"mobi\",\n\t\t\"mov\",\n\t\t\"movie\",\n\t\t\"mp3\",\n\t\t\"mp4\",\n\t\t\"mp4a\",\n\t\t\"mpeg\",\n\t\t\"mpg\",\n\t\t\"mpga\",\n\t\t\"mxu\",\n\t\t\"nef\",\n\t\t\"npx\",\n\t\t\"numbers\",\n\t\t\"nupkg\",\n\t\t\"o\",\n\t\t\"odp\",\n\t\t\"ods\",\n\t\t\"odt\",\n\t\t\"oga\",\n\t\t\"ogg\",\n\t\t\"ogv\",\n\t\t\"otf\",\n\t\t\"ott\",\n\t\t\"pages\",\n\t\t\"pbm\",\n\t\t\"pcx\",\n\t\t\"pdb\",\n\t\t\"pdf\",\n\t\t\"pea\",\n\t\t\"pgm\",\n\t\t\"pic\",\n\t\t\"png\",\n\t\t\"pnm\",\n\t\t\"pot\",\n\t\t\"potm\",\n\t\t\"potx\",\n\t\t\"ppa\",\n\t\t\"ppam\",\n\t\t\"ppm\",\n\t\t\"pps\",\n\t\t\"ppsm\",\n\t\t\"ppsx\",\n\t\t\"ppt\",\n\t\t\"pptm\",\n\t\t\"pptx\",\n\t\t\"psd\",\n\t\t\"pya\",\n\t\t\"pyc\",\n\t\t\"pyo\",\n\t\t\"pyv\",\n\t\t\"qt\",\n\t\t\"rar\",\n\t\t\"ras\",\n\t\t\"raw\",\n\t\t\"resources\",\n\t\t\"rgb\",\n\t\t\"rip\",\n\t\t\"rlc\",\n\t\t\"rmf\",\n\t\t\"rmvb\",\n\t\t\"rpm\",\n\t\t\"rtf\",\n\t\t\"rz\",\n\t\t\"s3m\",\n\t\t\"s7z\",\n\t\t\"scpt\",\n\t\t\"sgi\",\n\t\t\"shar\",\n\t\t\"snap\",\n\t\t\"sil\",\n\t\t\"sketch\",\n\t\t\"slk\",\n\t\t\"smv\",\n\t\t\"snk\",\n\t\t\"so\",\n\t\t\"stl\",\n\t\t\"suo\",\n\t\t\"sub\",\n\t\t\"swf\",\n\t\t\"tar\",\n\t\t\"tbz\",\n\t\t\"tbz2\",\n\t\t\"tga\",\n\t\t\"tgz\",\n\t\t\"thmx\",\n\t\t\"tif\",\n\t\t\"tiff\",\n\t\t\"tlz\",\n\t\t\"ttc\",\n\t\t\"ttf\",\n\t\t\"txz\",\n\t\t\"udf\",\n\t\t\"uvh\",\n\t\t\"uvi\",\n\t\t\"uvm\",\n\t\t\"uvp\",\n\t\t\"uvs\",\n\t\t\"uvu\",\n\t\t\"viv\",\n\t\t\"vob\",\n\t\t\"war\",\n\t\t\"wav\",\n\t\t\"wax\",\n\t\t\"wbmp\",\n\t\t\"wdp\",\n\t\t\"weba\",\n\t\t\"webm\",\n\t\t\"webp\",\n\t\t\"whl\",\n\t\t\"wim\",\n\t\t\"wm\",\n\t\t\"wma\",\n\t\t\"wmv\",\n\t\t\"wmx\",\n\t\t\"woff\",\n\t\t\"woff2\",\n\t\t\"wrm\",\n\t\t\"wvx\",\n\t\t\"xbm\",\n\t\t\"xif\",\n\t\t\"xla\",\n\t\t\"xlam\",\n\t\t\"xls\",\n\t\t\"xlsb\",\n\t\t\"xlsm\",\n\t\t\"xlsx\",\n\t\t\"xlt\",\n\t\t\"xltm\",\n\t\t\"xltx\",\n\t\t\"xm\",\n\t\t\"xmind\",\n\t\t\"xpi\",\n\t\t\"xpm\",\n\t\t\"xwd\",\n\t\t\"xz\",\n\t\t\"z\",\n\t\t\"zip\",\n\t\t\"zipx\"\n\t];\n\treturn binaryExtensions$1;\n}\n\nvar binaryExtensionsExports = /*@__PURE__*/ requireBinaryExtensions();\nconst binaryExtensions = /*@__PURE__*/getDefaultExportFromCjs(binaryExtensionsExports);\n\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nconst extensions = new Set(binaryExtensions);\nconst pathSeparators = /* @__PURE__ */ new Set([\"/\", \"\\\\\", void 0]);\nconst normalizedAliasSymbol = Symbol.for(\"pathe:normalizedAlias\");\nconst FILENAME_RE = /(^|[/\\\\])([^/\\\\]+?)(?=(?:\\.[^.]+)?$)/;\nconst compareAliases = /* @__PURE__ */ __name((a, b) => b.split(\"/\").length - a.split(\"/\").length, \"compareAliases\");\nconst hasTrailingSlash = /* @__PURE__ */ __name((path = \"/\") => {\n const lastChar = path.at(-1);\n return lastChar === \"/\" || lastChar === \"\\\\\";\n}, \"hasTrailingSlash\");\nconst normalizeAliases = /* @__PURE__ */ __name((_aliases) => {\n if (_aliases[normalizedAliasSymbol]) {\n return _aliases;\n }\n const aliases = Object.fromEntries(Object.entries(_aliases).sort(([a], [b]) => compareAliases(a, b)));\n for (const key in aliases) {\n for (const alias in aliases) {\n if (alias === key || key.startsWith(alias)) {\n continue;\n }\n if (aliases[key].startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {\n aliases[key] = aliases[alias] + aliases[key].slice(alias.length);\n }\n }\n }\n Object.defineProperty(aliases, normalizedAliasSymbol, {\n enumerable: false,\n value: true\n });\n return aliases;\n}, \"normalizeAliases\");\nconst resolveAlias = /* @__PURE__ */ __name((path, aliases) => {\n path = normalizeWindowsPath(path);\n aliases = normalizeAliases(aliases);\n for (const [alias, to] of Object.entries(aliases)) {\n if (!path.startsWith(alias)) {\n continue;\n }\n const stripedAlias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;\n if (hasTrailingSlash(path[stripedAlias.length])) {\n return join(to, path.slice(alias.length));\n }\n }\n return path;\n}, \"resolveAlias\");\nconst filename = /* @__PURE__ */ __name((path) => FILENAME_RE.exec(path)?.[2], \"filename\");\nconst reverseResolveAlias = /* @__PURE__ */ __name((path, aliases) => {\n path = normalizeWindowsPath(path);\n aliases = normalizeAliases(aliases);\n for (const [to, alias] of Object.entries(aliases).reverse()) {\n if (!path.startsWith(alias)) {\n continue;\n }\n const stripedAlias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;\n if (hasTrailingSlash(path[stripedAlias.length])) {\n return join(to, path.slice(alias.length));\n }\n }\n return path;\n}, \"reverseResolveAlias\");\nconst isRelative = /* @__PURE__ */ __name((path) => /^(?:\\.?\\.[/\\\\]|\\.\\.\\B)/.test(path) || path === \"..\", \"isRelative\");\nconst isBinaryPath = /* @__PURE__ */ __name((path) => extensions.has(extname(path).slice(1).toLowerCase()), \"isBinaryPath\");\nconst toPath = /* @__PURE__ */ __name((urlOrPath) => normalizeWindowsPath(urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath), \"toPath\");\nconst isWindows = /* @__PURE__ */ __name(() => {\n if (!globalThis?.process) {\n return false;\n }\n if (globalThis?.process?.platform === \"win32\" || globalThis?.process?.platform === \"cygwin\") {\n return true;\n }\n const osType = globalThis?.process?.env.OSTYPE;\n if (!(typeof osType === \"string\")) {\n return false;\n }\n return /^(?:msys|cygwin)$/.test(osType);\n}, \"isWindows\");\n\nexport { filename, isBinaryPath, isRelative, isWindows, normalizeAliases, resolveAlias, reverseResolveAlias, toPath };\n","var o=Object.defineProperty;var t=(e,r)=>o(e,\"name\",{value:r,configurable:!0});var n=Object.defineProperty,s=t((e,r)=>n(e,\"name\",{value:r,configurable:!0}),\"t\");class c extends Error{static{t(this,\"i\")}static{s(this,\"WalkError\")}root;constructor(r,a){super(`${r instanceof Error?r.message:r} for path \"${a}\"`),this.cause=r,this.root=a}get name(){return\"WalkError\"}set name(r){throw new Error(\"Cannot overwrite name of WalkError\")}}export{c as default};\n","var g=Object.defineProperty;var c=(e,r)=>g(e,\"name\",{value:r,configurable:!0});var n=Object.defineProperty,p=c((e,r)=>n(e,\"name\",{value:r,configurable:!0}),\"r\");const i=p(e=>{const r=e.replace(/\\.\\*/g,\".([^/]*)\").replace(/\\*\\*/g,\"(.*)\").replace(/(?<!\\.)\\*(?!\\*)/g,\"([^/]*)\").replace(/\\?/g,\"[^/]\").replace(/\\.(?!\\*)/g,\"\\\\.\").replace(/\\{/g,\"(\").replace(/\\}/g,\")\").replace(/,/g,\"|\").replace(/\\[!(.*?)\\]/g,\"[^$1]\");return new RegExp(`^${r}$`)},\"globToRegExp\");var o=Object.defineProperty,s=c((e,r)=>o(e,\"name\",{value:r,configurable:!0}),\"n\");const v=s((e,r,l,t)=>Array.isArray(r)&&r.length>0&&!r.some(a=>e.endsWith(a))||l&&!l.some(a=>a.test(e))?!1:!t?.some(a=>a.test(e)),\"walkInclude\");export{v as a,i as c};\n","var D=Object.defineProperty;var y=(e,r)=>D(e,\"name\",{value:r,configurable:!0});import{readdir as F,realpath as h,stat as w}from\"node:fs/promises\";import{resolve as L,join as v,normalize as x,basename as I}from\"@visulima/path\";import{toPath as g}from\"@visulima/path/utils\";import k from\"./WalkError-BsngoIKJ.mjs\";import N from\"./assertValidFileOrDirectoryPath-DgPIPmZT.mjs\";import{c as S,a as m}from\"./walk-include-C9pVST87.mjs\";var O=Object.defineProperty,s=y((e,r)=>O(e,\"name\",{value:r,configurable:!0}),\"r\");const P=s(async e=>{const r=x(e),l=I(r),t=await w(r);return{isDirectory:s(()=>t.isDirectory(),\"isDirectory\"),isFile:s(()=>t.isFile(),\"isFile\"),isSymbolicLink:s(()=>t.isSymbolicLink(),\"isSymbolicLink\"),name:l,path:r}},\"_createWalkEntry\");async function*b(e,{extensions:r,followSymlinks:l=!1,includeDirs:t=!0,includeFiles:f=!0,includeSymlinks:p=!0,match:d,maxDepth:c=Number.POSITIVE_INFINITY,skip:u}={}){if(N(e),c<0)return;const a=d?d.map(i=>typeof i==\"string\"?S(i):i):void 0,n=u?u.map(i=>typeof i==\"string\"?S(i):i):void 0;if(e=L(g(e)),t&&m(e,r,a,n)&&(yield await P(e)),!(c<1||!m(e,void 0,void 0,n)))try{for await(const i of await F(e,{withFileTypes:!0})){let o=v(e,i.name);if(i.isSymbolicLink())if(l)o=await h(o);else if(p&&m(o,r,a,n))yield{isDirectory:i.isDirectory,isFile:i.isFile,isSymbolicLink:i.isSymbolicLink,name:i.name,path:o};else continue;i.isSymbolicLink()||i.isDirectory()?yield*b(o,{extensions:r,followSymlinks:l,includeDirs:t,includeFiles:f,includeSymlinks:p,match:a,maxDepth:c-1,skip:n}):i.isFile()&&f&&m(o,r,a,n)&&(yield{isDirectory:s(()=>i.isDirectory(),\"isDirectory\"),isFile:s(()=>i.isFile(),\"isFile\"),isSymbolicLink:s(()=>i.isSymbolicLink(),\"isSymbolicLink\"),name:i.name,path:o})}}catch(i){throw i instanceof k?i:new k(i,e)}}y(b,\"d\");s(b,\"walk\");export{b as default};\n","var n=Object.defineProperty;var a=(r,e)=>n(r,\"name\",{value:e,configurable:!0});import o from\"./walk-BZTXbT87.mjs\";var c=Object.defineProperty,i=a((r,e)=>c(r,\"name\",{value:e,configurable:!0}),\"e\");const l=i(async(r,e={})=>{Array.isArray(e.extensions)||(e.extensions=[\"js\",\"mjs\",\"cjs\",\"ts\"]);const s=[];for await(const t of o(r,e))s.push(t.path);return s},\"collect\");export{l as default};\n","import { readdirSync, readFileSync } from \"node:fs\";\n\nimport { parse } from \"@visulima/path\";\nimport type { PackageJson } from \"type-fest\";\n\ninterface AppExport {\n [key: string]: any;\n app?: string | { app?: string };\n}\n\nexport const ALLOWED_EXTENSIONS = [\".js\", \".ts\", \".mjs\", \".cjs\"];\n\nexport const getAppWorkingDirectoryPath = (appFilePath: string): string | null => {\n let lastParsedPath = parse(appFilePath);\n\n // Once the following condition returns false it means we traversed the whole file system\n // eslint-disable-next-line no-loops/no-loops\n while (lastParsedPath.base && lastParsedPath.root !== lastParsedPath.dir) {\n const parentDirectionItems = readdirSync(lastParsedPath.dir);\n\n const packageJSON = parentDirectionItems.find((item) => item === \"package.json\");\n\n if (packageJSON) {\n return lastParsedPath.dir;\n }\n\n lastParsedPath = parse(lastParsedPath.dir);\n }\n\n return null;\n};\n\nexport const getFrameworkName = (directory: string): \"express\" | \"fastify\" | \"hapi\" | \"koa\" | \"next\" | null => {\n const packageJSONFilePath = `${directory}/package.json`;\n\n const { dependencies } = JSON.parse(readFileSync(packageJSONFilePath).toString()) as PackageJson;\n\n if (dependencies?.express) {\n return \"express\";\n }\n\n if (dependencies?.koa && (dependencies[\"@koa/router\"] || dependencies[\"koa-router\"])) {\n return \"koa\";\n }\n\n if (dependencies?.next) {\n return \"next\";\n }\n\n if (dependencies?.[\"@hapi/hapi\"]) {\n return \"hapi\";\n }\n\n if (dependencies?.fastify) {\n return \"fastify\";\n }\n\n return null;\n};\n\nexport const getApp = (appExport: AppExport, frameworkName: \"express\" | \"fastify\" | \"hapi\" | \"koa\" | \"next\" | null): AppExport | string | null => {\n const isExportEmpty = Object.keys(appExport).length === 0;\n\n if (isExportEmpty) {\n return null;\n }\n\n if (frameworkName === \"hapi\") {\n if (typeof (appExport.app as { app?: string }).app === \"string\") {\n return appExport.app as { app: string };\n }\n\n return appExport;\n }\n\n return appExport.app ?? appExport;\n};\n","import { statSync } from \"node:fs\";\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { collect } from \"@visulima/fs\";\nimport { join } from \"@visulima/path\";\n\nimport { ALLOWED_EXTENSIONS } from \"../../utils\";\n\nconst isDirectory = (path: string): boolean => {\n try {\n return statSync(path).isDirectory();\n } catch {\n return false;\n }\n};\n\nconst collectApiRouteFiles = async (path = \"\"): Promise<string[]> => {\n let apiFolderPath = join(path, \"pages/api\");\n\n // src/pages will be ignored if pages is present in the root directory\n if (!isDirectory(apiFolderPath)) {\n apiFolderPath = join(path, \"src/pages/api\");\n\n if (!isDirectory(apiFolderPath)) {\n return [];\n }\n }\n\n return collect(apiFolderPath, {\n extensions: ALLOWED_EXTENSIONS,\n includeDirs: false,\n });\n};\n\nexport default collectApiRouteFiles;\n","import type { Server } from \"@hapi/hapi\";\nimport type { Express } from \"express\";\nimport type { FastifyInstance } from \"fastify\";\nimport type Koa from \"koa\";\n\nimport expressRoutes from \"./routes/express-routes\";\nimport fastifyRoutes from \"./routes/fastify-routes\";\nimport hapiRoutes from \"./routes/hapi-routes\";\nimport koaRoutes from \"./routes/koa-routes\";\nimport apiRouteFileParser from \"./routes/next/api-route-file-parser\";\nimport collectApiRouteFiles from \"./routes/next/collect-api-route-files\";\nimport type { Route } from \"./routes/types\";\n\nexport type FrameworkName = \"express\" | \"fastify\" | \"hapi\" | \"koa\" | \"next\" | \"unknown\";\nexport const getRoutes = async (\n appOrPath: Express | FastifyInstance | Koa | Server | string,\n frameworkName: FrameworkName,\n verbose: boolean,\n): Promise<Route[] | null> => {\n if (frameworkName === \"express\") {\n return expressRoutes(appOrPath as Express);\n }\n\n if (frameworkName === \"koa\") {\n return koaRoutes(appOrPath as Koa);\n }\n\n if (frameworkName === \"hapi\") {\n return hapiRoutes(appOrPath as Server);\n }\n\n if (frameworkName === \"fastify\") {\n return fastifyRoutes(appOrPath as FastifyInstance);\n }\n\n if (frameworkName === \"next\") {\n const apiRouteFiles = await collectApiRouteFiles(appOrPath as string);\n\n if (apiRouteFiles.length === 0) {\n throw new Error(`No API routes found, in \"${appOrPath}\".`);\n }\n\n return apiRouteFiles.flatMap((apiRouteFile) => apiRouteFileParser(apiRouteFile, appOrPath as string, verbose));\n }\n\n return null;\n};\n","import type { Route } from \"./types\";\n\nconst routesGroupBy = (list: Route[], keyGetter: (item: Route) => keyof Route): Map<string, Route[]> => {\n const map = new Map<string, Route[]>();\n\n list.forEach((item) => {\n const key = keyGetter(item);\n const collection = map.get(key);\n\n if (collection) {\n collection.push(item);\n } else {\n map.set(key, [item]);\n }\n });\n\n return map;\n};\n\nexport default routesGroupBy;\n","import chalk from \"chalk\";\n\nimport type { Route } from \"./types\";\n\nconst renderRoute = (method: string, routePath: string): string => {\n const colorMap = {\n ANY: chalk.redBright,\n DELETE: chalk.redBright,\n GET: chalk.blue,\n HEAD: chalk.hex(\"#6C7280\"),\n OPTIONS: chalk.hex(\"#6C7280\"),\n PATCH: chalk.yellow,\n POST: chalk.yellow,\n PUT: chalk.yellow,\n };\n\n let methodText: string;\n\n if (method === \"GET|HEAD\") {\n methodText = `${chalk.blue(\"GET\")}${chalk.grey(\"|HEAD\")}`;\n } else {\n const coloredMethod = colorMap[method as keyof typeof colorMap](method);\n\n methodText = method === \"GET\" ? `${coloredMethod}${chalk.grey(\"|HEAD\")}` : coloredMethod;\n }\n\n const spacesCount = method === \"GET\" ? 6 : 14 - method.length;\n const spaces = Array.from({ length: spacesCount }).fill(\" \").join(\"\");\n\n const dotsCount = process.stdout.columns - 16 - routePath.length - 4;\n const dots = dotsCount > 0 ? Array.from({ length: dotsCount }).fill(\".\").join(\"\") : \"\";\n\n const routeText = routePath\n .split(\"/\")\n .map((segment) => {\n const isDynamicSegment = [\":\", \"[\"].includes(segment[0] ?? \"\");\n\n return isDynamicSegment ? chalk.yellowBright(segment) : segment;\n })\n .join(\"/\");\n\n return ` ${methodText}${spaces}${routeText}${chalk.grey(dots)}`;\n};\n\nconst routesRender = (routesMap: Route[], options: { methods?: string[] } = {}): (string | undefined)[] =>\n routesMap\n .map((route) => {\n if (Array.isArray(options.methods) && options.methods.includes(route.method)) {\n return;\n }\n\n if (route.method === \"GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS\") {\n // eslint-disable-next-line no-param-reassign\n route.method = \"ANY\";\n }\n\n // eslint-disable-next-line consistent-return\n return renderRoute(route.method, route.path.replace(\"/pages\", \"\"));\n })\n .filter(Boolean);\n\nexport default routesRender;\n","import { execSync } from \"node:child_process\";\nimport { existsSync, rmSync, statSync } from \"node:fs\";\nimport process from \"node:process\";\n\nimport { extname, join } from \"@visulima/path\";\nimport chalk from \"chalk\";\n\nimport { getRoutes } from \"./get-routes\";\nimport routesGroupBy from \"./routes/routes-group-by\";\nimport routesRender from \"./routes/routes-render\";\nimport type { Route } from \"./routes/types\";\nimport { ALLOWED_EXTENSIONS, getApp, getAppWorkingDirectoryPath, getFrameworkName } from \"./utils\";\n\ninterface RenderOptions {\n excludePaths: string[];\n group: string;\n includePaths: string[];\n methods: string[];\n verbose: boolean;\n}\n\nconst listCommand = async (\n framework: \"express\" | \"fastify\" | \"hapi\" | \"koa\" | \"next\" | undefined,\n path: string,\n options: Partial<RenderOptions> = {},\n // eslint-disable-next-line sonarjs/cognitive-complexity\n): Promise<void> => {\n const frameworkPath = join(process.cwd(), path);\n\n if (!existsSync(frameworkPath)) {\n throw new Error(\"No such file, invalid path provided.\");\n }\n\n const appWorkingDirectoryPath = getAppWorkingDirectoryPath(frameworkPath);\n\n if (!appWorkingDirectoryPath) {\n throw new Error(\"Please initialize local package.json.\");\n }\n\n if (framework === undefined) {\n const frameworkName = getFrameworkName(appWorkingDirectoryPath);\n\n if (!frameworkName) {\n throw new Error(\"Couldn't detect supported back-end framework.\");\n }\n\n // eslint-disable-next-line no-param-reassign\n framework = frameworkName;\n }\n\n let routes: Route[] | null = null;\n\n if (framework === \"next\") {\n routes = await getRoutes(frameworkPath, \"next\", options.verbose ?? false);\n } else {\n if (!statSync(frameworkPath).isFile()) {\n throw new Error(`${frameworkPath} is directory, but file expected.`);\n }\n\n if (!ALLOWED_EXTENSIONS.includes(extname(frameworkPath))) {\n throw new Error(\"Please specify application .ts/.js/.mjs/.cjs file.\");\n }\n\n const environmentFilePath = `${appWorkingDirectoryPath}/.env`;\n\n if (existsSync(environmentFilePath)) {\n // Loads environment vars in the current process so application\n // that depends on them can be loaded properly below\n const dotEnvironmentFilePath = `${appWorkingDirectoryPath}/node_modules/dotenv/lib/main.js`;\n const dotenv = await import(dotEnvironmentFilePath);\n\n dotenv.config({ path: environmentFilePath });\n }\n\n const isTypeScriptApp = extname(frameworkPath) === \".ts\";\n const tscPath = join(appWorkingDirectoryPath, \"node_modules/.bin/tsc\");\n\n if (isTypeScriptApp && !existsSync(tscPath)) {\n throw new Error(`Please install typescript in ${appWorkingDirectoryPath}`);\n }\n\n try {\n if (isTypeScriptApp) {\n // || rm -r ./framework-list removes framework-list directory in case tsc fails\n\n try {\n execSync(`${tscPath} --outDir framework-list >&2`, { cwd: appWorkingDirectoryPath });\n } catch (error: any) {\n // eslint-disable-next-line no-console\n console.log(\"TSC compilation failed. Please resolve issues in your project.\\n\");\n // eslint-disable-next-line no-console\n console.log(error);\n\n rmSync(join(appWorkingDirectoryPath, \"framework-list\"), { recursive: true });\n }\n }\n\n const appJsFilePath = isTypeScriptApp\n ? join(appWorkingDirectoryPath, \"framework-list\", frameworkPath.replace(appWorkingDirectoryPath, \"\").replace(\".ts\", \".js\"))\n : frameworkPath;\n\n const { default: defaultExport } = await import(appJsFilePath);\n\n routes = await getRoutes(\n [\"AsyncFunction\", \"Function\"].includes(defaultExport.constructor.name as string) ? await defaultExport() : getApp(defaultExport, framework),\n framework,\n options.verbose ?? false,\n );\n } finally {\n if (isTypeScriptApp) {\n rmSync(join(appWorkingDirectoryPath, \"framework-list\"), { recursive: true });\n }\n }\n }\n\n if (routes === null) {\n throw new Error(`Framework \"${framework}\" is not supported.`);\n }\n\n if (Array.isArray(options.includePaths) && options.includePaths.length > 0) {\n routes = options.includePaths.flatMap((ipath) => (routes as Route[]).filter((route) => route.path.startsWith(ipath)));\n }\n\n if (Array.isArray(options.excludePaths) && options.excludePaths.length > 0) {\n routes = options.excludePaths.flatMap((epath) => (routes as Route[]).filter((route) => !route.path.startsWith(epath)));\n }\n\n if (typeof options.group === \"string\" && options.group !== \"\") {\n // eslint-disable-next-line no-console\n console.log();\n\n const groupedMap = routesGroupBy(routes, (route) => {\n if (options.group === \"path\") {\n return route.path.replace(\"/pages\", \"\").split(\"/\")[1];\n }\n\n return route.tags[0] ?? \"unsorted\";\n });\n\n let counter = 0;\n\n groupedMap.forEach((groupedRoutes, key) => {\n if (counter > 0) {\n // eslint-disable-next-line no-console\n console.log();\n }\n\n const dotsCount = (process.stdout.columns - 16 - key.length) / 2;\n const dots = dotsCount > 0 ? Array.from({ length: dotsCount }).fill(\" \").join(\"\") : \"\";\n\n // eslint-disable-next-line no-console\n console.log(dots + chalk.bold.underline(key));\n\n routesRender(groupedRoutes, options).forEach((renderedRoute) => {\n // eslint-disable-next-line no-console\n console.log(renderedRoute);\n });\n\n counter += 1;\n });\n } else {\n // eslint-disable-next-line no-console\n console.log();\n\n routesRender(routes, options).forEach((renderedRoute) => {\n // eslint-disable-next-line no-console\n console.log(renderedRoute);\n });\n }\n\n // eslint-disable-next-line no-console\n console.log(`\\n Listed ${chalk.greenBright(String(routes.length))} HTTP ${routes.length === 1 ? \"route\" : \"routes\"}.\\n`);\n};\n\nexport default listCommand;\n"]}
@@ -0,0 +1,3 @@
1
+ var b=Object.defineProperty,v=(e,n)=>b(e,"name",{value:n,configurable:true}),y=/^[A-Z]:\//i,u=v((e="")=>e&&e.replaceAll("\\","/").replace(y,n=>n.toUpperCase()),"normalizeWindowsPath"),A=Object.defineProperty,i=(e,n)=>A(e,"name",{value:n,configurable:true}),z=/^[/\\]{2}/,w=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,d=/^[A-Z]:$/i;var E=/.(\.[^./]+)$/,j=/^[/\\]|^[a-z]:[/\\]/i,M=i(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd");/^win/i.test(globalThis.process?.platform)?";":":";var f=i((e,n)=>{let t="",r=0,s=-1,a=0,c=null;for(let o=0;o<=e.length;++o){if(o<e.length)c=e[o];else {if(c==="/")break;c="/";}if(c==="/"){if(!(s===o-1||a===1))if(a===2){if(t.length<2||r!==2||!t.endsWith(".")||t.at(-2)!=="."){if(t.length>2){let p=t.lastIndexOf("/");p===-1?(t="",r=0):(t=t.slice(0,p),r=t.length-1-t.lastIndexOf("/")),s=o,a=0;continue}else if(t.length>0){t="",r=0,s=o,a=0;continue}}n&&(t+=t.length>0?"/..":"..",r=2);}else t.length>0?t+=`/${e.slice(s+1,o)}`:t=e.slice(s+1,o),r=o-s-1;s=o,a=0;}else c==="."&&a!==-1?++a:a=-1;}return t},"normalizeString"),l=i(e=>w.test(e),"isAbsolute"),h=i(function(e){if(e.length===0)return ".";e=u(e);let n=z.exec(e),t=l(e),r=e.at(-1)==="/";return e=f(e,!t),e.length===0?t?"/":r?"./":".":(r&&(e+="/"),d.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!l(e)?`/${e}`:e)},"normalize"),R=i((...e)=>{let n="";for(let t of e)if(t)if(n.length>0){let r=n[n.length-1]==="/",s=t[0]==="/";r&&s?n+=t.slice(1):n+=r||s?t:`/${t}`;}else n+=t;return h(n)},"join"),O=i(function(...e){e=e.map(r=>u(r));let n="",t=false;for(let r=e.length-1;r>=-1&&!t;r--){let s=r>=0?e[r]:M();!s||s.length===0||(n=`${s}/${n}`,t=l(s));}return n=f(n,!t),t&&!l(n)?`/${n}`:n.length>0?n:"."},"resolve"),S=i(function(e){return u(e)},"toNamespacedPath"),m=i(function(e){return E.exec(u(e))?.[1]??""},"extname");var g=i(e=>{let n=u(e).replace(/\/$/,"").split("/").slice(0,-1);return n.length===1&&d.test(n[0])&&(n[0]+="/"),n.join("/")||(l(e)?"/":".")},"dirname");var x=i((e,n)=>{let t=u(e).split("/").pop();return n&&t.endsWith(n)?t.slice(0,-n.length):t},"basename"),T=i(function(e){let n=j.exec(e)?.[0]?.replace(/\\/g,"/")??"",t=x(e),r=m(t);return {base:t,dir:g(e),ext:r,name:t.slice(0,t.length-r.length),root:n}},"parse");
2
+ export{u as a,h as b,R as c,O as d,S as e,m as f,x as g,T as h};//# sourceMappingURL=chunk-KG2WICAI.mjs.map
3
+ //# sourceMappingURL=chunk-KG2WICAI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@visulima+path@1.4.0/node_modules/@visulima/path/dist/packem_shared/path-lU4hG9gZ.mjs"],"names":["__defProp$1","__name$1","target","value","DRIVE_LETTER_START_RE","normalizeWindowsPath","input","r","__defProp","__name","UNC_REGEX","IS_ABSOLUTE_RE","DRIVE_LETTER_RE","EXTNAME_RE","PATH_ROOT_RE","cwd","normalizeString","path","allowAboveRoot","result","lastSegmentLength","lastSlash","dots","char","index","lastSlashIndex","isAbsolute","normalize","isUNCPath","isPathAbsolute","trailingSeparator","join","segments","seg","pathTrailing","segLeading","resolve","arguments_","argument","resolvedPath","resolvedAbsolute","toNamespacedPath","p","extname","dirname","basename","extension","lastSegment","parse","root","base"],"mappings":"AA4MA,IAAIA,EAAc,MAAA,CAAO,cAAA,CACrBC,CAAAA,CAAW,CAACC,EAAQC,CAAAA,GAAUH,CAAAA,CAAYE,CAAAA,CAAQ,MAAA,CAAQ,CAAE,KAAA,CAAAC,CAAAA,CAAO,YAAA,CAAc,IAAK,CAAC,CAAA,CACrFC,CAAAA,CAAwB,YAAA,CACxBC,CAAAA,CAAuCJ,EAAS,CAACK,CAAAA,CAAQ,EAAA,GACxDA,CAAAA,EAGEA,EAAM,UAAA,CAAW,IAAA,CAAM,GAAG,CAAA,CAAE,QAAQF,CAAAA,CAAwBG,CAAAA,EAAMA,CAAAA,CAAE,WAAA,EAAa,CAAA,CACvF,sBAAsB,CAAA,CAErBC,CAAAA,CAAY,OAAO,cAAA,CACnBC,CAAAA,CAAS,CAACP,CAAAA,CAAQC,IAAUK,CAAAA,CAAUN,CAAAA,CAAQ,MAAA,CAAQ,CAAE,MAAAC,CAAAA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AAA,CACL,IAAA,CAAMI,EAAK,KAAA,CAAM,CAAA,CAAGA,CAAAA,CAAK,MAAA,CAASJ,EAAU,MAAM,CAAA,CAClD,KAAAG,CACF,CACF,EAAG,OAAO","file":"chunk-KG2WICAI.mjs","sourcesContent":["var __defProp$2 = Object.defineProperty;\nvar __name$2 = (target, value) => __defProp$2(target, \"name\", { value, configurable: true });\nlet _lazyMatch = /* @__PURE__ */ __name$2(() => {\n var __lib__ = (() => {\n var y = Object.defineProperty, G = Object.getOwnPropertyDescriptor, Q = Object.getOwnPropertyNames, H = Object.prototype.hasOwnProperty, J = /* @__PURE__ */ __name$2((r, e) => {\n for (var t in e) y(r, t, { get: e[t], enumerable: true });\n }, \"J\"), T = /* @__PURE__ */ __name$2((r, e, t, a) => {\n if (e && typeof e == \"object\" || typeof e == \"function\") for (let n of Q(e)) !H.call(r, n) && n !== t && y(r, n, { get: /* @__PURE__ */ __name$2(() => e[n], \"get\"), enumerable: !(a = G(e, n)) || a.enumerable });\n return r;\n }, \"T\"), W = /* @__PURE__ */ __name$2((r) => T(y({}, \"__esModule\", { value: true }), r), \"W\"), b = {};\n J(b, { zeptomatch: /* @__PURE__ */ __name$2(() => ne, \"zeptomatch\") });\n var k = /* @__PURE__ */ __name$2((r) => Array.isArray(r), \"k\"), x = /* @__PURE__ */ __name$2((r) => typeof r == \"function\", \"x\"), K = /* @__PURE__ */ __name$2((r) => r.length === 0, \"K\"), X = (() => {\n const { toString: r } = Function.prototype, e = /(?:^\\(\\s*(?:[^,.()]|\\.(?!\\.\\.))*\\s*\\)\\s*=>|^\\s*[a-zA-Z$_][a-zA-Z0-9$_]*\\s*=>)/;\n return (t) => (t.length === 0 || t.length === 1) && e.test(r.call(t));\n })(), Y = /* @__PURE__ */ __name$2((r) => typeof r == \"number\", \"Y\"), rr = /* @__PURE__ */ __name$2((r) => typeof r == \"object\" && r !== null, \"rr\"), er = /* @__PURE__ */ __name$2((r) => r instanceof RegExp, \"er\"), tr = /* @__PURE__ */ (() => {\n const r = /\\\\\\(|\\((?!\\?(?::|=|!|<=|<!))/;\n return (e) => r.test(e.source);\n })(), nr = /* @__PURE__ */ (() => {\n const r = /^[a-zA-Z0-9_-]+$/;\n return (e) => r.test(e.source) && !e.flags.includes(\"i\");\n })(), M = /* @__PURE__ */ __name$2((r) => typeof r == \"string\", \"M\"), f = /* @__PURE__ */ __name$2((r) => r === void 0, \"f\"), ar = /* @__PURE__ */ __name$2((r) => {\n const e = /* @__PURE__ */ new Map();\n return (t) => {\n const a = e.get(t);\n if (a !== void 0) return a;\n const n = r(t);\n return e.set(t, n), n;\n };\n }, \"ar\"), or = /* @__PURE__ */ __name$2((r, e, t = {}) => {\n const a = { cache: {}, input: r, index: 0, indexBacktrackMax: 0, options: t, output: [] }, n = d(e)(a), s = Math.max(a.index, a.indexBacktrackMax);\n if (n && a.index === r.length) return a.output;\n throw new Error(`Failed to parse at index ${s}`);\n }, \"or\"), o = /* @__PURE__ */ __name$2((r, e) => k(r) ? ir(r, e) : M(r) ? R(r, e) : ur(r, e), \"o\"), ir = /* @__PURE__ */ __name$2((r, e) => {\n const t = {};\n for (const a of r) {\n if (a.length !== 1) throw new Error(`Invalid character: \"${a}\"`);\n const n = a.charCodeAt(0);\n t[n] = true;\n }\n return (a) => {\n const n = a.input;\n let s = a.index, i = s;\n for (; i < n.length && n.charCodeAt(i) in t; ) i += 1;\n if (i > s) {\n if (!f(e) && !a.options.silent) {\n const u = n.slice(s, i), c = x(e) ? e(u, n, `${s}`) : e;\n f(c) || a.output.push(c);\n }\n a.index = i;\n }\n return true;\n };\n }, \"ir\"), ur = /* @__PURE__ */ __name$2((r, e) => {\n if (nr(r)) return R(r.source, e);\n {\n const t = r.source, a = r.flags.replace(/y|$/, \"y\"), n = new RegExp(t, a);\n return tr(r) && x(e) && !X(e) ? sr(n, e) : cr(n, e);\n }\n }, \"ur\"), sr = /* @__PURE__ */ __name$2((r, e) => (t) => {\n const a = t.index, n = t.input;\n r.lastIndex = a;\n const s = r.exec(n);\n if (s) {\n const i = r.lastIndex;\n if (!t.options.silent) {\n const u = e(...s, n, `${a}`);\n f(u) || t.output.push(u);\n }\n return t.index = i, true;\n } else return false;\n }, \"sr\"), cr = /* @__PURE__ */ __name$2((r, e) => (t) => {\n const a = t.index, n = t.input;\n if (r.lastIndex = a, r.test(n)) {\n const i = r.lastIndex;\n if (!f(e) && !t.options.silent) {\n const u = x(e) ? e(n.slice(a, i), n, `${a}`) : e;\n f(u) || t.output.push(u);\n }\n return t.index = i, true;\n } else return false;\n }, \"cr\"), R = /* @__PURE__ */ __name$2((r, e) => (t) => {\n const a = t.index, n = t.input;\n if (n.startsWith(r, a)) {\n if (!f(e) && !t.options.silent) {\n const i = x(e) ? e(r, n, `${a}`) : e;\n f(i) || t.output.push(i);\n }\n return t.index += r.length, true;\n } else return false;\n }, \"R\"), O = /* @__PURE__ */ __name$2((r, e, t, a) => {\n const n = d(r), s = e > 1;\n return w(C(P((i) => {\n let u = 0;\n for (; u < t; ) {\n const c = i.index;\n if (!n(i) || (u += 1, i.index === c)) break;\n }\n return u >= e;\n }, s), a));\n }, \"O\"), lr = /* @__PURE__ */ __name$2((r, e) => O(r, 0, 1, e), \"lr\"), m = /* @__PURE__ */ __name$2((r, e) => O(r, 0, 1 / 0, e), \"m\"), _ = /* @__PURE__ */ __name$2((r, e) => {\n const t = r.map(d);\n return w(C(P((a) => {\n for (let n = 0, s = t.length; n < s; n++) if (!t[n](a)) return false;\n return true;\n }), e));\n }, \"_\"), p = /* @__PURE__ */ __name$2((r, e) => {\n const t = r.map(d);\n return w(C((a) => {\n for (let n = 0, s = t.length; n < s; n++) if (t[n](a)) return true;\n return false;\n }, e));\n }, \"p\"), P = /* @__PURE__ */ __name$2((r, e = true, t = false) => {\n const a = d(r);\n return e ? (n) => {\n const s = n.index, i = n.output.length, u = a(n);\n return !u && !t && (n.indexBacktrackMax = Math.max(n.indexBacktrackMax, n.index)), (!u || t) && (n.index = s, n.output.length !== i && (n.output.length = i)), u;\n } : a;\n }, \"P\"), C = /* @__PURE__ */ __name$2((r, e) => {\n const t = d(r);\n return e ? (a) => {\n if (a.options.silent) return t(a);\n const n = a.output.length;\n if (t(a)) {\n const i = a.output.splice(n, 1 / 0), u = e(i);\n return f(u) || a.output.push(u), true;\n } else return false;\n } : t;\n }, \"C\"), w = /* @__PURE__ */ (() => {\n let r = 0;\n return (e) => {\n const t = d(e), a = r += 1;\n return (n) => {\n var s;\n if (n.options.memoization === false) return t(n);\n const i = n.index, u = (s = n.cache)[a] || (s[a] = { indexMax: -1, queue: [] }), c = u.queue;\n if (i <= u.indexMax) {\n const g = u.store || (u.store = /* @__PURE__ */ new Map());\n if (c.length) {\n for (let h = 0, ie = c.length; h < ie; h += 2) {\n const ue = c[h * 2], se = c[h * 2 + 1];\n g.set(ue, se);\n }\n c.length = 0;\n }\n const l = g.get(i);\n if (l === false) return false;\n if (Y(l)) return n.index = l, true;\n if (l) return n.index = l.index, l.output?.length && n.output.push(...l.output), true;\n }\n const V = n.output.length, oe = t(n);\n if (u.indexMax = Math.max(u.indexMax, i), oe) {\n const g = n.index, l = n.output.length;\n if (l > V) {\n const h = n.output.slice(V, l);\n c.push(i, { index: g, output: h });\n } else c.push(i, g);\n return true;\n } else return c.push(i, false), false;\n };\n };\n })(), A = /* @__PURE__ */ __name$2((r) => {\n let e;\n return (t) => (e || (e = d(r())), e(t));\n }, \"A\"), d = ar((r) => {\n if (x(r)) return K(r) ? A(r) : r;\n if (M(r) || er(r)) return o(r);\n if (k(r)) return _(r);\n if (rr(r)) return p(Object.values(r));\n throw new Error(\"Invalid rule\");\n }), v = /* @__PURE__ */ __name$2((r) => r, \"v\"), z = /* @__PURE__ */ __name$2((r) => (e) => or(e, r, { memoization: false }).join(\"\"), \"z\"), pr = /* @__PURE__ */ __name$2((r) => {\n const e = {};\n return (t) => e[t] ?? (e[t] = r(t));\n }, \"pr\"), B = \"abcdefghijklmnopqrstuvwxyz\", vr = /* @__PURE__ */ __name$2((r) => {\n let e = \"\";\n for (; r > 0; ) {\n const t = (r - 1) % 26;\n e = B[t] + e, r = Math.floor((r - 1) / 26);\n }\n return e;\n }, \"vr\"), N = /* @__PURE__ */ __name$2((r) => {\n let e = 0;\n for (let t = 0, a = r.length; t < a; t++) e = e * 26 + B.indexOf(r[t]) + 1;\n return e;\n }, \"N\"), $ = /* @__PURE__ */ __name$2((r, e) => {\n if (e < r) return $(e, r);\n const t = [];\n for (; r <= e; ) t.push(r++);\n return t;\n }, \"$\"), fr = /* @__PURE__ */ __name$2((r, e, t) => $(r, e).map((a) => String(a).padStart(t, \"0\")), \"fr\"), j = /* @__PURE__ */ __name$2((r, e) => $(N(r), N(e)).map(vr), \"j\"), E = o(/\\\\./, v), dr = o(/[$.*+?^(){}[\\]\\|]/, (r) => `\\\\${r}`), hr = o(/./, v), xr = o(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${q(e)}$).*?`), gr = o(/^(!!)+/, \"\"), mr = p([xr, gr]), _r = o(/\\/(\\*\\*\\/)+/, \"(?:[\\\\\\\\/].+[\\\\\\\\/]|[\\\\\\\\/])\"), Sr = o(/^(\\*\\*\\/)+/, \"(?:^|.*[\\\\\\\\/])\"), yr = o(/\\/(\\*\\*)$/, \"(?:[\\\\\\\\/].*|$)\"), Cr = o(/\\*\\*/, \".*\"), I = p([_r, Sr, yr, Cr]), wr = o(/\\*\\/(?!\\*\\*\\/|\\*$)/, \"[^\\\\\\\\/]*[\\\\\\\\/]\"), $r = o(/\\*/, \"[^\\\\\\\\/]*\"), L = p([wr, $r]), F = o(\"?\", \"[^\\\\\\\\/]\"), Er = o(\"[\", v), br = o(\"]\", v), kr = o(/[!^]/, \"^\\\\\\\\/\"), Mr = o(/[a-z]-[a-z]|[0-9]-[0-9]/i, v), Rr = o(/[$.*+?^(){}[\\|]/, (r) => `\\\\${r}`), Or = o(/[^\\]]/, v), Pr = p([E, Rr, Mr, Or]), U = _([Er, lr(kr), m(Pr), br]), Ar = o(\"{\", \"(?:\"), zr = o(\"}\", \")\"), Br = o(/(\\d+)\\.\\.(\\d+)/, (r, e, t) => fr(+e, +t, Math.min(e.length, t.length)).join(\"|\")), Nr = o(/([a-z]+)\\.\\.([a-z]+)/, (r, e, t) => j(e, t).join(\"|\")), jr = o(/([A-Z]+)\\.\\.([A-Z]+)/, (r, e, t) => j(e.toLowerCase(), t.toLowerCase()).join(\"|\").toUpperCase()), Ir = p([Br, Nr, jr]), Z = _([Ar, Ir, zr]), Lr = o(\"{\", \"(?:\"), Fr = o(\"}\", \")\"), Ur = o(\",\", \"|\"), Zr = o(/[$.*+?^(){[\\]\\|]/, (r) => `\\\\${r}`), Dr = o(/[^}]/, v), qr = A(() => D), Vr = p([I, L, F, U, Z, qr, E, Zr, Ur, Dr]), D = _([Lr, m(Vr), Fr]), Gr = m(p([mr, I, L, F, U, Z, D, E, dr, hr])), Qr = Gr, Hr = z(Qr), q = Hr, Jr = o(/\\\\./, v), Tr = o(/./, v), Wr = o(/\\*\\*\\*+/, \"*\"), Kr = o(/([^/{[(!])\\*\\*/, (r, e) => `${e}*`), Xr = o(/(^|.)\\*\\*(?=[^*/)\\]}])/, (r, e) => `${e}*`), Yr = m(p([Jr, Wr, Kr, Xr, Tr])), re = Yr, ee = z(re), te = ee, S = /* @__PURE__ */ __name$2((r, e) => Array.isArray(r) ? r.map(S.compile).some((n) => n.test(e)) : S.compile(r).test(e), \"S\");\n S.compile = pr((r) => new RegExp(`^${q(te(r))}[\\\\\\\\/]?$`, \"s\"));\n var ne = S;\n return W(b);\n })();\n return __lib__.default || __lib__;\n}, \"_lazyMatch\");\nlet _match;\nconst zeptomatch = /* @__PURE__ */ __name$2((path, pattern) => {\n if (!_match) {\n _match = _lazyMatch();\n _lazyMatch = null;\n }\n return _match(path, pattern);\n}, \"default\");\n\nvar __defProp$1 = Object.defineProperty;\nvar __name$1 = (target, value) => __defProp$1(target, \"name\", { value, configurable: true });\nconst DRIVE_LETTER_START_RE = /^[A-Z]:\\//i;\nconst normalizeWindowsPath = /* @__PURE__ */ __name$1((input = \"\") => {\n if (!input) {\n return input;\n }\n return input.replaceAll(\"\\\\\", \"/\").replace(DRIVE_LETTER_START_RE, (r) => r.toUpperCase());\n}, \"normalizeWindowsPath\");\n\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nconst UNC_REGEX = /^[/\\\\]{2}/;\nconst IS_ABSOLUTE_RE = /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Z]:[/\\\\]/i;\nconst DRIVE_LETTER_RE = /^[A-Z]:$/i;\nconst ROOT_FOLDER_RE = /^\\/([A-Z]:)?$/i;\nconst EXTNAME_RE = /.(\\.[^./]+)$/;\nconst PATH_ROOT_RE = /^[/\\\\]|^[a-z]:[/\\\\]/i;\nconst cwd = /* @__PURE__ */ __name(() => {\n if (typeof process.cwd === \"function\") {\n return process.cwd().replaceAll(\"\\\\\", \"/\");\n }\n return \"/\";\n}, \"cwd\");\nconst sep = \"/\";\nconst delimiter = /^win/i.test(globalThis.process?.platform) ? \";\" : \":\";\nconst normalizeString = /* @__PURE__ */ __name((path, allowAboveRoot) => {\n let result = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n char = path[index];\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {\n if (result.length < 2 || lastSegmentLength !== 2 || !result.endsWith(\".\") || result.at(-2) !== \".\") {\n if (result.length > 2) {\n const lastSlashIndex = result.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n result = \"\";\n lastSegmentLength = 0;\n } else {\n result = result.slice(0, lastSlashIndex);\n lastSegmentLength = result.length - 1 - result.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (result.length > 0) {\n result = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n result += result.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (result.length > 0) {\n result += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n result = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return result;\n}, \"normalizeString\");\nconst isAbsolute = /* @__PURE__ */ __name((path) => IS_ABSOLUTE_RE.test(path), \"isAbsolute\");\nconst normalize = /* @__PURE__ */ __name(function(path) {\n if (path.length === 0) {\n return \".\";\n }\n path = normalizeWindowsPath(path);\n const isUNCPath = UNC_REGEX.exec(path);\n const isPathAbsolute = isAbsolute(path);\n const trailingSeparator = path.at(-1) === \"/\";\n path = normalizeString(path, !isPathAbsolute);\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n if (trailingSeparator) {\n path += \"/\";\n }\n if (DRIVE_LETTER_RE.test(path)) {\n path += \"/\";\n }\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n}, \"normalize\");\nconst join = /* @__PURE__ */ __name((...segments) => {\n let path = \"\";\n for (const seg of segments) {\n if (!seg) {\n continue;\n }\n if (path.length > 0) {\n const pathTrailing = path[path.length - 1] === \"/\";\n const segLeading = seg[0] === \"/\";\n const both = pathTrailing && segLeading;\n if (both) {\n path += seg.slice(1);\n } else {\n path += pathTrailing || segLeading ? seg : `/${seg}`;\n }\n } else {\n path += seg;\n }\n }\n return normalize(path);\n}, \"join\");\nconst resolve = /* @__PURE__ */ __name(function(...arguments_) {\n arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));\n let resolvedPath = \"\";\n let resolvedAbsolute = false;\n for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {\n const path = index >= 0 ? arguments_[index] : cwd();\n if (!path || path.length === 0) {\n continue;\n }\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = isAbsolute(path);\n }\n resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);\n if (resolvedAbsolute && !isAbsolute(resolvedPath)) {\n return `/${resolvedPath}`;\n }\n return resolvedPath.length > 0 ? resolvedPath : \".\";\n}, \"resolve\");\nconst toNamespacedPath = /* @__PURE__ */ __name(function(p) {\n return normalizeWindowsPath(p);\n}, \"toNamespacedPath\");\nconst extname = /* @__PURE__ */ __name(function(p) {\n const match = EXTNAME_RE.exec(normalizeWindowsPath(p));\n return match?.[1] ?? \"\";\n}, \"extname\");\nconst relative = /* @__PURE__ */ __name(function(from, to) {\n const splitFrom = resolve(from).replace(ROOT_FOLDER_RE, \"$1\").split(\"/\");\n const splitTo = resolve(to).replace(ROOT_FOLDER_RE, \"$1\").split(\"/\");\n if (splitTo[0][1] === \":\" && splitFrom[0][1] === \":\" && splitFrom[0] !== splitTo[0]) {\n return splitTo.join(\"/\");\n }\n const fromCopy = [...splitFrom];\n for (const segment of fromCopy) {\n if (splitTo[0] !== segment) {\n break;\n }\n splitFrom.shift();\n splitTo.shift();\n }\n return [...splitFrom.map(() => \"..\"), ...splitTo].join(\"/\");\n}, \"relative\");\nconst dirname = /* @__PURE__ */ __name((path) => {\n const segments = normalizeWindowsPath(path).replace(/\\/$/, \"\").split(\"/\").slice(0, -1);\n if (segments.length === 1 && DRIVE_LETTER_RE.test(segments[0])) {\n segments[0] += \"/\";\n }\n return segments.join(\"/\") || (isAbsolute(path) ? \"/\" : \".\");\n}, \"dirname\");\nconst format = /* @__PURE__ */ __name(function(pathObject) {\n const segments = [pathObject.root, pathObject.dir, pathObject.base ?? pathObject.name + pathObject.ext].filter(Boolean);\n return normalizeWindowsPath(pathObject.root ? resolve(...segments) : segments.join(\"/\"));\n}, \"format\");\nconst basename = /* @__PURE__ */ __name((path, extension) => {\n const lastSegment = normalizeWindowsPath(path).split(\"/\").pop();\n if (extension && lastSegment.endsWith(extension)) {\n return lastSegment.slice(0, -extension.length);\n }\n return lastSegment;\n}, \"basename\");\nconst parse = /* @__PURE__ */ __name(function(p) {\n const root = PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\\\/g, \"/\") ?? \"\";\n const base = basename(p);\n const extension = extname(base);\n return {\n base,\n dir: dirname(p),\n ext: extension,\n name: base.slice(0, base.length - extension.length),\n root\n };\n}, \"parse\");\nconst matchesGlob = /* @__PURE__ */ __name((path, pattern) => (\n // https://github.com/nodejs/node/blob/main/lib/internal/fs/glob.js#L660\n zeptomatch(pattern, normalize(path))\n), \"matchesGlob\");\n\nconst path = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n basename,\n delimiter,\n dirname,\n extname,\n format,\n isAbsolute,\n join,\n matchesGlob,\n normalize,\n normalizeString,\n parse,\n relative,\n resolve,\n sep,\n toNamespacedPath\n}, Symbol.toStringTag, { value: 'Module' });\n\nexport { dirname as a, basename as b, normalizeString as c, delimiter as d, extname as e, format as f, parse as g, resolve as h, isAbsolute as i, join as j, normalizeWindowsPath as k, matchesGlob as m, normalize as n, path as p, relative as r, sep as s, toNamespacedPath as t };\n"]}
@@ -0,0 +1,2 @@
1
+ import {c}from'./chunk-KG2WICAI.mjs';import {stringify}from'yaml';import {existsSync,readFileSync}from'fs';import {modelsToOpenApi}from'@visulima/crud';import J from'debug';import V from'lodash.merge';import {toXML}from'jstoxml';import'url';var x=e=>stringify(e,{indent:2}),u=x;var j=e=>e.toLowerCase().replaceAll(/[^\s\w]/gu," ").trimEnd().replaceAll(/\s+|_/gu,"-").replaceAll(/\b\w/gu,n=>n.toUpperCase());var P="application/json",A=(e,n,s)=>{e.responses[n].content===void 0&&(e.responses[n].content={}),e.responses[n].content?.[s]===void 0&&(e.responses[n].content[s]={});},E=(e,n,s)=>{typeof e.components!="object"&&(e.components={}),typeof e.components.schemas!="object"&&(e.components.schemas={}),e.components.schemas[n]===void 0&&(e.components.schemas[n]=s);},M=(e,n,s,o,f)=>{A(e,n,s),e.responses[n].content?.[s]?.schema===void 0&&(e.responses[n].content[s].schema={}),e.responses[n].content[s].schema=f?{items:{$ref:`#/components/schemas/${o}`},type:"array"}:{$ref:`#/components/schemas/${o}`};},T=(e,n,s,o,f,p)=>{let a,t;return Object.entries(n.content).forEach(([c,r])=>{if(typeof r.schema=="object"){let{schema:i}=r;c===P&&r.examples!==void 0?t=r.examples:c===P&&r.example!==void 0&&(a=r.example);let l=i.type==="array";Object.entries(s??{}).forEach(([O,R])=>{if(!R)return;let g;i?.$ref===void 0?(g=`${j(o.trim().replace("/",""))}${O==="application/ld+json"?".jsonld":""}`,E(f,g,i)):g=i.$ref.replace("#/components/schemas/",""),M(e,p,O,g,l);});}}),{example:a,examples:t}},C=(e,n,s,o,f,p)=>{Object.keys(n.content).forEach(a=>{a!==P&&Object.entries(o??{}).forEach(([t,c])=>{if(!c)return;A(e,s,t),e.responses[s].content?.[t]?.example===void 0&&(e.responses[s].content[t].example={});let r=false;f.forEach(({regex:i,transformer:l})=>{!r&&i.test(t)&&(e.responses[s].content[t].example=l(p),r=true);}),r||(e.responses[s].content[t].example=p);});});},k=(e,n,s)=>{typeof e.components!="object"&&(e.components={}),typeof e.components.examples!="object"&&(e.components.examples={}),e.components.examples[n]===void 0&&s[n]!==void 0&&(e.components.examples[n]=s[n]);},v=(e,n,s,o,f,p)=>{A(n,s,o),n.responses[s].content?.[o]?.examples===void 0&&(n.responses[s].content[o].examples={});let a={};Object.entries(p).forEach(([t,c])=>{let r=false;f.forEach(({regex:i,transformer:l})=>{if(!r&&i.test(o)){let O="";e.components?.examples?.[t]?O=e.components.examples[t].value:c.$ref?O=(e.components?.examples?.[c.$ref.replace("#/components/examples/","")]).value:typeof c.value=="string"&&(O=c.value),a[t]={value:l(O)},r=true;}}),r||(a[t]=e.components?.examples?.[t]===void 0?c:{$ref:`#/components/examples/${t}`});}),n.responses[s].content[o].examples=a;},$=(e,n,s,o,f,p,a,t)=>{let c=j(p.trim().replace("/",""));Object.keys(o.content).forEach(r=>{r!==P&&Object.entries(f??{}).forEach(([i,l])=>{l&&(k(e,c,t),v(e,n,s,i,a,t));});});};function m(e,n,s=[{regex:/xml/u,transformer:o=>toXML(o,{header:true,indent:" "})},{regex:/yaml|yml/,transformer:o=>stringify(o,{indent:2})}]){return typeof e=="object"&&typeof e.paths=="object"&&Object.entries(e.paths).forEach(([o,f])=>{Object.values(f).forEach(p=>{typeof p.responses=="object"&&Object.entries(p.responses).forEach(([a,t])=>{if(typeof t.content=="object"){let{example:c,examples:r}=T(p,t,n,o,e,a);c!==void 0?C(p,t,a,n,s,c):r!==void 0&&$(e,p,a,t,n,o,s,r);}});});}),e}var X=J("visulima:api-platform:swagger:crud:get-static-properties-swagger"),q=(e={})=>{let{allowedMediaTypes:n={"application/json":true},crud:s,specs:o,swaggerFilePath:f}=e;return async(p,a)=>{let t=c(process.cwd(),f??"swagger/swagger.json");if(!existsSync(t))throw new Error(`Swagger file not found at "${t}".`);let c$1=readFileSync(t,"utf8"),r=m(JSON.parse(c$1),n),i={};if(s!==void 0)try{let O=await modelsToOpenApi(s);i={components:{examples:O.examples,schemas:O.schemas},paths:O.paths,tags:O.tags},i=m(i,n),X(JSON.stringify(i,null,2)),r=V(r,i);}catch(O){throw console.log(O),new Error("Please install @visulima/crud to use the crud swagger generator.")}Array.isArray(o)&&o.forEach(O=>{r=V(r,m(O,n));});let l;typeof p.headers.accept=="string"&&/yaml|yml/.test(p.headers.accept)?(a.setHeader("Content-Type",p.headers.accept),l=u(r)):(a.setHeader("Content-Type","application/json"),l=JSON.stringify(r,null,2)),a.statusCode=200,a.end(l);}},ae=q;export{j as a,u as b,ae as c};//# sourceMappingURL=chunk-MZZ3R2JF.mjs.map
2
+ //# sourceMappingURL=chunk-MZZ3R2JF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/serializers/transformer/yaml.ts","../src/utils.ts","../src/swagger/extend-swagger-spec.ts","../src/swagger/api/swagger-handler.ts"],"names":["yamlTransformer","data","stringify","yaml_default","toHeaderCase","string_","c","jsonMediaType","prepareStatusContent","methodSpec","status","mediaType","extendComponentSchemas","spec","schemaName","schema","extendResponseSchema","schemaIsArray","extendSwaggerWithMediaTypeSchema","responseSpec","allowedMediaTypes","pathKey","example","examples","mediaName","contentSpec","allowed","extendSwaggerWithMediaTypeExample","transformers","transformed","regex","transformer","extendComponentExamples","exampleName","prepareResponseExamples","transformedExamples","extendSwaggerWithMediaTypeExamples","examplesName","extendSwaggerSpec","value","toXML","pathSpec","swaggerCrudDebug","debug","swaggerHandler","options","crud","specs","swaggerFilePath","request","response","swaggerPath","join","existsSync","fileContents","readFileSync","crudSwagger","modelsOpenApi","modelsToOpenApi","merge","error","swagger_handler_default"],"mappings":"iPAIA,IAAMA,CAAAA,CAA+BC,CAAAA,EAASC,SAAAA,CAAUD,CAAAA,CAAM,CAAE,MAAA,CAAQ,CAAE,CAAC,CAAA,CAEpEE,CAAAA,CAAQH,ECwCR,IAAMI,CAAAA,CAAgBC,CAAAA,EACzBA,CAAAA,CACK,WAAA,EAAY,CACZ,UAAA,CAAW,WAAA,CAAa,GAAG,CAAA,CAC3B,OAAA,EAAQ,CACR,UAAA,CAAW,SAAA,CAAW,GAAG,CAAA,CACzB,UAAA,CAAW,QAAA,CAAWC,CAAAA,EAAMA,CAAAA,CAAE,WAAA,EAAa,EC3CpD,IAAMC,CAAAA,CAAgB,kBAAA,CAEhBC,CAAAA,CAAuB,CAACC,CAAAA,CAAuCC,CAAAA,CAAgBC,CAAAA,GAAsB,CACjGF,CAAAA,CAAW,SAAA,CAAmDC,CAAM,CAAA,CAA+B,OAAA,GAAY,MAAA,GAE/GD,CAAAA,CAAW,SAAA,CAAmDC,CAAM,CAAA,CAA+B,OAAA,CAAU,EAAC,CAAA,CAG9GD,CAAAA,CAAW,SAAA,CAAmDC,CAAM,CAAA,CAA+B,OAAA,GAAUC,CAAS,C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,QAAA,EAAY,UAAA,CAAW,IAAA,CAAKA,CAAAA,CAAQ,OAAA,CAAQ,MAAM,CAAA,EACpFC,CAAAA,CAAS,SAAA,CAAU,cAAA,CAAgBD,CAAAA,CAAQ,OAAA,CAAQ,MAAM,CAAA,CAEzDhD,CAAAA,CAAOE,CAAAA,CAAgBU,CAAI,CAAA,GAE3BqC,CAAAA,CAAS,SAAA,CAAU,cAAA,CAAgB,kBAAkB,CAAA,CAErDjD,CAAAA,CAAO,IAAA,CAAK,SAAA,CAAUY,CAAAA,CAAM,IAAA,CAAM,CAAC,CAAA,CAAA,CAGvCqC,CAAAA,CAAS,UAAA,CAAa,GAAA,CACtBA,CAAAA,CAAS,GAAA,CAAIjD,CAAI,EACrB,CACJ,CAAA,CAaO4D,EAAAA,CAAQjB","file":"chunk-MZZ3R2JF.mjs","sourcesContent":["import { stringify } from \"yaml\";\n\nimport type { Serializer } from \"../types\";\n\nconst yamlTransformer: Serializer = (data) => stringify(data, { indent: 2 });\n\nexport default yamlTransformer;\n","import type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { URL } from \"node:url\";\n\ntype IncomingApiRequest<TApiRequest = IncomingMessage> = TApiRequest & {\n body?: any;\n query?: any;\n};\n\nexport const jsonResponse = (response: ServerResponse, status: number, data?: unknown): void => {\n response.statusCode = status;\n response.setHeader(\"Content-Type\", \"application/json\");\n response.end(data ? JSON.stringify(data) : \"\");\n};\n\nexport const parseBody = async (request: IncomingApiRequest): Promise<any> => {\n if (request.body) {\n return request.body;\n }\n\n const buffers = [];\n\n // eslint-disable-next-line no-loops/no-loops\n for await (const chunk of request) {\n buffers.push(chunk);\n }\n\n const data = Buffer.concat(buffers).toString();\n\n return data ? JSON.parse(data) : null;\n};\n\nexport const parseQuery = (request: IncomingApiRequest): Record<string, unknown> => {\n if (request.query) {\n return request.query;\n }\n\n if (!request.url) {\n return {};\n }\n\n // Note: Fake protocol is required to parse query string\n const url = new URL(`https://${request.headers.host?.replace(/\\/$/u, \"\")}/${request.url}`);\n\n return Object.fromEntries(url.searchParams.entries());\n};\n\nexport const toHeaderCase = (string_: string): string =>\n string_\n .toLowerCase()\n .replaceAll(/[^\\s\\w]/gu, \" \") // Remove all non-word characters\n .trimEnd() // Remove trailing spaces\n .replaceAll(/\\s+|_/gu, \"-\") // Replace multiple spaces or underline with a single hyphen\n .replaceAll(/\\b\\w/gu, (c) => c.toUpperCase());\n","import type { XmlElement } from \"jstoxml\";\nimport { toXML } from \"jstoxml\";\nimport type { OpenAPIV3 } from \"openapi-types\";\nimport { stringify } from \"yaml\";\n\nimport { toHeaderCase } from \"../utils\";\n\ntype Transformers = { regex: RegExp; transformer: (data: any) => string }[];\n\nconst jsonMediaType = \"application/json\";\n\nconst prepareStatusContent = (methodSpec: OpenAPIV3.OperationObject, status: string, mediaType: string) => {\n if (((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content === undefined) {\n // eslint-disable-next-line no-param-reassign\n ((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content = {};\n }\n\n if (((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content?.[mediaType] === undefined) {\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n (((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] = {} as OpenAPIV3.MediaTypeObject;\n }\n};\n\nconst extendComponentSchemas = (spec: Partial<OpenAPIV3.Document>, schemaName: string, schema: OpenAPIV3.SchemaObject) => {\n if (typeof spec.components !== \"object\") {\n // eslint-disable-next-line no-param-reassign\n spec.components = {};\n }\n\n if (typeof spec.components.schemas !== \"object\") {\n // eslint-disable-next-line no-param-reassign\n spec.components.schemas = {};\n }\n\n if (spec.components.schemas[schemaName] === undefined) {\n // eslint-disable-next-line no-param-reassign\n spec.components.schemas[schemaName] = schema;\n }\n};\n\nconst extendResponseSchema = (methodSpec: OpenAPIV3.OperationObject, status: string, mediaType: string, schemaName: string, schemaIsArray: boolean) => {\n prepareStatusContent(methodSpec, status, mediaType);\n\n if (((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content?.[mediaType]?.schema === undefined) {\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n ((((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] as OpenAPIV3.MediaTypeObject).schema\n = {} as OpenAPIV3.SchemaObject;\n }\n\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n ((((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] as OpenAPIV3.MediaTypeObject).schema\n = schemaIsArray\n ? {\n items: {\n $ref: `#/components/schemas/${schemaName}`,\n },\n type: \"array\",\n }\n : {\n $ref: `#/components/schemas/${schemaName}`,\n };\n};\n\nconst extendSwaggerWithMediaTypeSchema = (\n methodSpec: OpenAPIV3.OperationObject,\n responseSpec: OpenAPIV3.ResponseObject,\n allowedMediaTypes: Record<string, boolean> | undefined,\n pathKey: string,\n spec: Partial<OpenAPIV3.Document>,\n status: string,\n): {\n example?: any;\n examples?: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject>;\n} => {\n let example: any | undefined;\n let examples: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject> | undefined;\n\n Object.entries(responseSpec.content as object).forEach(([mediaName, contentSpec]) => {\n if (typeof contentSpec.schema === \"object\") {\n const { schema } = contentSpec;\n\n if (mediaName === jsonMediaType && contentSpec.examples !== undefined) {\n examples = contentSpec.examples;\n } else if (mediaName === jsonMediaType && contentSpec.example !== undefined) {\n example = contentSpec.example;\n }\n\n const schemaIsArray = (schema as OpenAPIV3.SchemaObject).type === \"array\";\n\n Object.entries(allowedMediaTypes ?? {}).forEach(([mediaType, allowed]) => {\n if (!allowed) {\n return;\n }\n\n let schemaName: string;\n\n if (schema?.$ref === undefined) {\n schemaName = `${toHeaderCase(pathKey.trim().replace(\"/\", \"\"))}${mediaType === \"application/ld+json\" ? \".jsonld\" : \"\"}`;\n\n extendComponentSchemas(spec as OpenAPIV3.Document, schemaName, schema as OpenAPIV3.SchemaObject);\n } else {\n schemaName = (schema as OpenAPIV3.ReferenceObject).$ref.replace(\"#/components/schemas/\", \"\");\n }\n\n extendResponseSchema(methodSpec, status, mediaType, schemaName, schemaIsArray);\n });\n }\n });\n\n return { example, examples };\n};\n\nconst extendSwaggerWithMediaTypeExample = (\n methodSpec: OpenAPIV3.OperationObject,\n responseSpec: OpenAPIV3.ResponseObject,\n status: string,\n allowedMediaTypes: Record<string, boolean> | undefined,\n transformers: Transformers,\n example: any,\n) => {\n Object.keys(responseSpec.content as object).forEach((mediaName) => {\n if (mediaName === jsonMediaType) {\n return;\n }\n\n Object.entries(allowedMediaTypes ?? {}).forEach(([mediaType, allowed]) => {\n if (!allowed) {\n return;\n }\n\n prepareStatusContent(methodSpec, status, mediaType);\n\n if (\n ((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content?.[mediaType]?.example === undefined\n ) {\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n ((((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] as OpenAPIV3.MediaTypeObject).example\n = {};\n }\n\n let transformed = false;\n\n transformers.forEach(({ regex, transformer }) => {\n if (!transformed && regex.test(mediaType)) {\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n ((((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] as OpenAPIV3.MediaTypeObject).example\n = transformer(example);\n\n transformed = true;\n }\n });\n\n if (!transformed) {\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n ((((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] as OpenAPIV3.MediaTypeObject).example\n = example;\n }\n });\n });\n};\n\nconst extendComponentExamples = (\n spec: Partial<OpenAPIV3.Document>,\n exampleName: string,\n examples: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject>,\n) => {\n if (typeof spec.components !== \"object\") {\n // eslint-disable-next-line no-param-reassign\n spec.components = {};\n }\n\n if (typeof spec.components.examples !== \"object\") {\n // eslint-disable-next-line no-param-reassign\n spec.components.examples = {};\n }\n\n if (spec.components.examples[exampleName] === undefined && examples[exampleName] !== undefined) {\n // eslint-disable-next-line no-param-reassign\n spec.components.examples[exampleName] = examples[exampleName] as OpenAPIV3.ExampleObject;\n }\n};\n\nconst prepareResponseExamples = (\n spec: Partial<OpenAPIV3.Document>,\n methodSpec: OpenAPIV3.OperationObject,\n status: string,\n mediaType: string,\n transformers: Transformers,\n examples: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject>,\n\n) => {\n prepareStatusContent(methodSpec, status, mediaType);\n\n if (((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content?.[mediaType]?.examples === undefined) {\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n ((((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] as OpenAPIV3.MediaTypeObject).examples\n = {};\n }\n\n const transformedExamples: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject> = {};\n\n Object.entries(examples).forEach(([exampleName, example]) => {\n let transformed = false;\n\n transformers.forEach(({ regex, transformer }) => {\n if (!transformed && regex.test(mediaType)) {\n let data: any = \"\";\n\n if (spec.components?.examples?.[exampleName]) {\n data = (spec.components.examples[exampleName] as OpenAPIV3.ExampleObject).value;\n } else if ((example as OpenAPIV3.ReferenceObject).$ref) {\n data = (\n spec.components?.examples?.[\n (example as OpenAPIV3.ReferenceObject).$ref.replace(\"#/components/examples/\", \"\")\n ] as OpenAPIV3.ExampleObject\n ).value;\n } else if (typeof (example as OpenAPIV3.ExampleObject).value === \"string\") {\n data = (example as OpenAPIV3.ExampleObject).value;\n }\n\n transformedExamples[exampleName] = {\n value: transformer(data),\n };\n\n transformed = true;\n }\n });\n\n if (!transformed) {\n transformedExamples[exampleName]\n = spec.components?.examples?.[exampleName] === undefined\n ? example\n : {\n $ref: `#/components/examples/${exampleName}`,\n };\n }\n });\n\n // prettier-ignore\n // eslint-disable-next-line no-param-reassign\n ((((methodSpec.responses as unknown as OpenAPIV3.ResponsesObject)[status] as OpenAPIV3.ResponseObject).content as Record<\n string,\n OpenAPIV3.MediaTypeObject\n >)[\n mediaType\n ] as OpenAPIV3.MediaTypeObject).examples\n = transformedExamples;\n};\n\nconst extendSwaggerWithMediaTypeExamples = (\n spec: Partial<OpenAPIV3.Document>,\n methodSpec: OpenAPIV3.OperationObject,\n status: string,\n responseSpec: OpenAPIV3.ResponseObject,\n allowedMediaTypes: Record<string, boolean> | undefined,\n pathKey: string,\n transformers: Transformers,\n examples: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject>,\n) => {\n const examplesName = toHeaderCase(pathKey.trim().replace(\"/\", \"\"));\n\n Object.keys(responseSpec.content as object).forEach((mediaName) => {\n if (mediaName === jsonMediaType) {\n return;\n }\n\n Object.entries(allowedMediaTypes ?? {}).forEach(([mediaType, allowed]) => {\n if (!allowed) {\n return;\n }\n\n extendComponentExamples(spec, examplesName, examples);\n\n prepareResponseExamples(spec, methodSpec, status, mediaType, transformers, examples);\n });\n });\n};\n\nexport default function extendSwaggerSpec(\n spec: Partial<OpenAPIV3.Document>,\n allowedMediaTypes?: Record<string, boolean>,\n transformers: Transformers = [\n {\n regex: /xml/u,\n transformer: (value: XmlElement | XmlElement[] | undefined) =>\n toXML(value, {\n header: true,\n indent: \" \",\n }),\n },\n {\n regex: /yaml|yml/,\n transformer: (value) => stringify(value, { indent: 2 }),\n },\n ],\n): Partial<OpenAPIV3.Document> {\n if (typeof spec === \"object\" && typeof spec.paths === \"object\") {\n Object.entries(spec.paths).forEach(([pathKey, pathSpec]) => {\n Object.values(pathSpec as OpenAPIV3.OperationObject & OpenAPIV3.PathsObject).forEach((methodSpec) => {\n if (typeof (methodSpec as OpenAPIV3.OperationObject).responses === \"object\") {\n Object.entries((methodSpec as OpenAPIV3.OperationObject).responses).forEach(([status, responseSpec]) => {\n if (typeof (responseSpec as OpenAPIV3.ResponseObject).content === \"object\") {\n const { example, examples } = extendSwaggerWithMediaTypeSchema(\n methodSpec as OpenAPIV3.OperationObject,\n responseSpec as OpenAPIV3.ResponseObject,\n allowedMediaTypes,\n pathKey,\n spec,\n status,\n );\n\n if (example !== undefined) {\n extendSwaggerWithMediaTypeExample(\n methodSpec as OpenAPIV3.OperationObject,\n responseSpec as OpenAPIV3.ResponseObject,\n status,\n allowedMediaTypes,\n transformers,\n example,\n );\n } else if (examples !== undefined) {\n extendSwaggerWithMediaTypeExamples(\n spec,\n methodSpec as OpenAPIV3.OperationObject,\n status,\n responseSpec as OpenAPIV3.ResponseObject,\n allowedMediaTypes,\n pathKey,\n transformers,\n examples,\n );\n }\n }\n });\n }\n });\n });\n }\n\n return spec;\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport type { IncomingMessage, ServerResponse } from \"node:http\";\n\nimport type { ModelsToOpenApiParameters, SwaggerModelsConfig } from \"@visulima/crud\";\nimport { modelsToOpenApi } from \"@visulima/crud\";\nimport { join } from \"@visulima/path\";\nimport debug from \"debug\";\n// eslint-disable-next-line no-restricted-imports\nimport merge from \"lodash.merge\";\nimport type { OpenAPIV3 } from \"openapi-types\";\n\nimport yamlTransformer from \"../../serializers/transformer/yaml\";\nimport extendSwaggerSpec from \"../extend-swagger-spec\";\n\nconst swaggerCrudDebug = debug(\"visulima:api-platform:swagger:crud:get-static-properties-swagger\");\n\nconst swaggerHandler = <M extends string, PrismaClient>(\n options: Partial<SwaggerHandlerOptions<M, PrismaClient>> = {},\n): (request: IncomingMessage, response: ServerResponse) => Promise<void> => {\n const {\n allowedMediaTypes = {\n \"application/json\": true,\n },\n crud,\n specs,\n swaggerFilePath,\n } = options;\n\n return async <Request extends IncomingMessage, Response extends ServerResponse>(request: Request, response: Response) => {\n const swaggerPath = join(process.cwd(), swaggerFilePath ?? \"swagger/swagger.json\");\n\n if (!existsSync(swaggerPath)) {\n throw new Error(`Swagger file not found at \"${swaggerPath}\".`);\n }\n\n const fileContents = readFileSync(swaggerPath, \"utf8\");\n\n let spec = extendSwaggerSpec(JSON.parse(fileContents) as OpenAPIV3.Document, allowedMediaTypes) as OpenAPIV3.Document;\n let crudSwagger: Partial<OpenAPIV3.Document> = {};\n\n if (crud !== undefined) {\n try {\n const modelsOpenApi = await modelsToOpenApi(crud);\n\n crudSwagger = {\n components: { examples: modelsOpenApi.examples, schemas: modelsOpenApi.schemas },\n paths: modelsOpenApi.paths,\n tags: modelsOpenApi.tags,\n };\n\n crudSwagger = extendSwaggerSpec(crudSwagger, allowedMediaTypes);\n\n swaggerCrudDebug(JSON.stringify(crudSwagger, null, 2));\n\n spec = merge(spec, crudSwagger);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.log(error);\n\n throw new Error(\"Please install @visulima/crud to use the crud swagger generator.\");\n }\n }\n\n if (Array.isArray(specs)) {\n specs.forEach((value) => {\n spec = merge(spec, extendSwaggerSpec(value, allowedMediaTypes));\n });\n }\n\n let data: Buffer | Uint8Array | string;\n\n if (typeof request.headers.accept === \"string\" && /yaml|yml/.test(request.headers.accept)) {\n response.setHeader(\"Content-Type\", request.headers.accept);\n\n data = yamlTransformer(spec);\n } else {\n response.setHeader(\"Content-Type\", \"application/json\");\n\n data = JSON.stringify(spec, null, 2);\n }\n\n response.statusCode = 200;\n response.end(data);\n };\n};\n\nexport interface SwaggerHandlerOptions<M extends string, PrismaClient> {\n allowedMediaTypes: Record<string, boolean>;\n crud: Exclude<ModelsToOpenApiParameters<M, PrismaClient>, \"swagger\"> & {\n swagger?: {\n models?: SwaggerModelsConfig<M>;\n };\n };\n specs?: Partial<OpenAPIV3.Document>[];\n swaggerFilePath: string;\n}\n\nexport default swaggerHandler;\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk4C666HHU_js=require('./chunk-4C666HHU.js'),zodToTs=require('zod-to-ts'),zod=require('zod');var I={};chunk4C666HHU_js.a(I,{dateIn:()=>v,dateOut:()=>K});var l="ZodDateIn",g=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?)?Z?$/,d=class a extends zod.ZodType{static create=()=>new a({typeName:l});_parse(t){let{ctx:e,status:r}=this._processInputParams(t);if(e.parsedType!==zod.ZodParsedType.string)return zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_type,expected:zod.ZodParsedType.string,received:e.parsedType}),zod.INVALID;g.test(e.data)||(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_string,validation:"regex"}),r.dirty());let i=new Date(e.data);return Number.isNaN(i.getTime())?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_date}),zod.INVALID):{status:r.value,value:i}}};var P="ZodDateOut",o=class a extends zod.ZodType{static create=()=>new a({typeName:P});_parse(t){let{ctx:e,status:r}=this._processInputParams(t);return e.parsedType!==zod.ZodParsedType.date?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_type,expected:zod.ZodParsedType.date,received:e.parsedType}),zod.INVALID):Number.isNaN(e.data.getTime())?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_date}),zod.INVALID):{status:r.value,value:e.data.toISOString()}}};var v=(...a)=>zodToTs.withGetType(d.create(...a),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword)),K=(...a)=>zodToTs.withGetType(o.create(...a),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword));exports.a=v;exports.b=K;exports.c=I;//# sourceMappingURL=chunk-UPRO35MO.js.map
2
- //# sourceMappingURL=chunk-UPRO35MO.js.map
1
+ 'use strict';var chunk4C666HHU_js=require('./chunk-4C666HHU.js'),zodToTs=require('zod-to-ts'),zod=require('zod');var I={};chunk4C666HHU_js.a(I,{dateIn:()=>v,dateOut:()=>K});var l="ZodDateIn",g=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?)?Z?$/,d=class a extends zod.ZodType{static create=()=>new a({typeName:l});_parse(t){let{ctx:e,status:r}=this._processInputParams(t);if(e.parsedType!==zod.ZodParsedType.string)return zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_type,expected:zod.ZodParsedType.string,received:e.parsedType}),zod.INVALID;g.test(e.data)||(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_string,validation:"regex"}),r.dirty());let i=new Date(e.data);return Number.isNaN(i.getTime())?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_date}),zod.INVALID):{status:r.value,value:i}}};var P="ZodDateOut",o=class a extends zod.ZodType{static create=()=>new a({typeName:P});_parse(t){let{ctx:e,status:r}=this._processInputParams(t);return e.parsedType!==zod.ZodParsedType.date?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_type,expected:zod.ZodParsedType.date,received:e.parsedType}),zod.INVALID):Number.isNaN(e.data.getTime())?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_date}),zod.INVALID):{status:r.value,value:e.data.toISOString()}}};var v=(...a)=>zodToTs.withGetType(d.create(...a),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword)),K=(...a)=>zodToTs.withGetType(o.create(...a),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword));exports.a=v;exports.b=K;exports.c=I;//# sourceMappingURL=chunk-NCNFFJRK.js.map
2
+ //# sourceMappingURL=chunk-NCNFFJRK.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/zod/index.ts","../src/zod/date-in-schema.ts","../src/zod/date-out-schema.ts"],"names":["zod_exports","__export","dateIn","dateOut","zodDateInKind","isoDateRegex","ZodDateIn","_ZodDateIn","ZodType","input","ctx","status","ZodParsedType","addIssueToContext","ZodIssueCode","INVALID","date","zodDateOutKind","ZodDateOut","_ZodDateOut","parameters","withGetType","ts"],"mappings":"iHAAA,IAAAA,CAAAA,CAAA,GAAAC,kBAAAA,CAAAD,CAAAA,CAAA,CAAA,MAAA,CAAA,IAAAE,CAAAA,CAAA,OAAA,CAAA,IAAAC,CAAAA,CAAAA,CAAAA,CCGA,IAAMC,CAAAA,CAAgB,WAAA,CAQTC,CAAAA,CAAe,sDAAA,CAOfC,CAAAA,CAAN,MAAMC,CAAAA,SAAkBC,WAAoC,CAC/D,OAAc,MAAA,CAAS,IACnB,IAAID,CAAAA,CAAU,CACV,QAAA,CAAUH,CACd,CAAC,CAAA,CAGE,MAAA,CAAOK,CAAAA,CAA0C,CAEpD,GAAM,CAAE,GAAA,CAAAC,CAAAA,CAAK,MAAA,CAAAC,CAAO,CAAA,CAAI,IAAA,CAAK,mBAAA,CAAoBF,CAAK,CAAA,CACtD,GAAIC,CAAAA,CAAI,aAAeE,iBAAAA,CAAc,MAAA,CACjC,OAAAC,qBAAAA,CAAkBH,CAAAA,CAAK,CACnB,IAAA,CAAMI,gBAAAA,CAAa,YAAA,CACnB,QAAA,CAAUF,iBAAAA,CAAc,MAAA,CACxB,QAAA,CAAUF,CAAAA,CAAI,UAClB,CAAC,CAAA,CACMK,WAAAA,CAGNV,CAAAA,CAAa,IAAA,CAAKK,CAAAA,CAAI,IAAc,CAAA,GACrCG,qBAAAA,CAAkBH,CAAAA,CAA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KAAA,CAAO,KAAA,CAAQD,CAAAA,CAAI,IAAA,CAAc,WAAA,EAAc,CAC3E,CACJ,CAAA,CFjCO,IAAMR,CAAAA,CAAS,CAAA,GAAIkB,CAAAA,GACtBC,mBAAAA,CAAYf,CAAAA,CAAU,MAAA,CAAO,GAAGc,CAAU,CAAA,CAAIE,CAAAA,EAAOA,CAAAA,CAAG,OAAA,CAAQ,qBAAA,CAAsBA,CAAAA,CAAG,UAAA,CAAW,aAAa,CAAC,CAAA,CAEzGnB,CAAAA,CAAU,CAAA,GAAIiB,CAAAA,GACvBC,mBAAAA,CAAYH,CAAAA,CAAW,MAAA,CAAO,GAAGE,CAAU,CAAA,CAAIE,CAAAA,EAAOA,CAAAA,CAAG,OAAA,CAAQ,qBAAA,CAAsBA,CAAAA,CAAG,UAAA,CAAW,aAAa,CAAC","file":"chunk-UPRO35MO.js","sourcesContent":["import { withGetType } from \"zod-to-ts\";\n\nimport { ZodDateIn } from \"./date-in-schema\";\nimport { ZodDateOut } from \"./date-out-schema\";\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const dateIn = (...parameters: Parameters<typeof ZodDateIn.create>) =>\n withGetType(ZodDateIn.create(...parameters), (ts) => ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword));\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const dateOut = (...parameters: Parameters<typeof ZodDateOut.create>) =>\n withGetType(ZodDateOut.create(...parameters), (ts) => ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword));\n","import type { ParseInput, ParseReturnType, ZodTypeDef } from \"zod\";\nimport { addIssueToContext, INVALID, ZodIssueCode, ZodParsedType, ZodType } from \"zod\";\n\nconst zodDateInKind = \"ZodDateIn\";\n\n// simple regex for ISO date, supports the following formats:\n// 2021-01-01T00:00:00.000Z\n// 2021-01-01T00:00:00Z\n// 2021-01-01T00:00:00\n// 2021-01-01\n// eslint-disable-next-line security/detect-unsafe-regex\nexport const isoDateRegex = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?)?Z?$/;\n\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport interface ZodDateInDef extends ZodTypeDef {\n typeName: typeof zodDateInKind;\n}\n\nexport class ZodDateIn extends ZodType<Date, ZodDateInDef, string> {\n public static create = (): ZodDateIn =>\n new ZodDateIn({\n typeName: zodDateInKind,\n });\n\n // eslint-disable-next-line no-underscore-dangle\n public _parse(input: ParseInput): ParseReturnType<Date> {\n // eslint-disable-next-line no-underscore-dangle\n const { ctx, status } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.string) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n\n if (!isoDateRegex.test(ctx.data as string)) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"regex\",\n });\n status.dirty();\n }\n\n const date = new Date(ctx.data as string);\n\n if (Number.isNaN(date.getTime())) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n\n return { status: status.value, value: date };\n }\n}\n","import type { ParseInput, ParseReturnType, ZodTypeDef } from \"zod\";\nimport { addIssueToContext, INVALID, ZodIssueCode, ZodParsedType, ZodType } from \"zod\";\n\nconst zodDateOutKind = \"ZodDateOut\";\n\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport interface ZodDateOutDef extends ZodTypeDef {\n typeName: typeof zodDateOutKind;\n}\n\nexport class ZodDateOut extends ZodType<string, ZodDateOutDef, Date> {\n public static create = (): ZodDateOut =>\n new ZodDateOut({\n typeName: zodDateOutKind,\n });\n\n // eslint-disable-next-line no-underscore-dangle\n public _parse(input: ParseInput): ParseReturnType<string> {\n // eslint-disable-next-line no-underscore-dangle\n const { ctx, status } = this._processInputParams(input);\n\n if (ctx.parsedType !== ZodParsedType.date) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n\n if (Number.isNaN(ctx.data.getTime())) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n\n return { status: status.value, value: (ctx.data as Date).toISOString() };\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/zod/index.ts","../src/zod/date-in-schema.ts","../src/zod/date-out-schema.ts"],"names":["zod_exports","__export","dateIn","dateOut","zodDateInKind","isoDateRegex","ZodDateIn","_ZodDateIn","ZodType","input","ctx","status","ZodParsedType","addIssueToContext","ZodIssueCode","INVALID","date","zodDateOutKind","ZodDateOut","_ZodDateOut","parameters","withGetType","ts"],"mappings":"iHAAA,IAAAA,CAAAA,CAAA,GAAAC,kBAAAA,CAAAD,CAAAA,CAAA,CAAA,MAAA,CAAA,IAAAE,CAAAA,CAAA,OAAA,CAAA,IAAAC,CAAAA,CAAAA,CAAAA,CCGA,IAAMC,CAAAA,CAAgB,WAAA,CAQTC,CAAAA,CAAe,sDAAA,CAOfC,CAAAA,CAAN,MAAMC,CAAAA,SAAkBC,WAAoC,CAC/D,OAAc,MAAA,CAAS,IACnB,IAAID,CAAAA,CAAU,CACV,QAAA,CAAUH,CACd,CAAC,CAAA,CAGE,MAAA,CAAOK,CAAAA,CAA0C,CAEpD,GAAM,CAAE,GAAA,CAAAC,CAAAA,CAAK,MAAA,CAAAC,CAAO,CAAA,CAAI,IAAA,CAAK,mBAAA,CAAoBF,CAAK,CAAA,CAEtD,GAAIC,CAAAA,CAAI,aAAeE,iBAAAA,CAAc,MAAA,CACjC,OAAAC,qBAAAA,CAAkBH,CAAAA,CAAK,CACnB,IAAA,CAAMI,gBAAAA,CAAa,YAAA,CACnB,QAAA,CAAUF,iBAAAA,CAAc,MAAA,CACxB,QAAA,CAAUF,CAAAA,CAAI,UAClB,CAAC,CAAA,CAEMK,WAAAA,CAGNV,CAAAA,CAAa,IAAA,CAAKK,CAAAA,CAAI,IAA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AAAA,EAGJ,CAAE,MAAA,CAAQJ,CAAAA,CAAO,KAAA,CAAO,KAAA,CAAQD,CAAAA,CAAI,IAAA,CAAc,WAAA,EAAc,CAC3E,CACJ,CAAA,CFnCO,IAAMR,CAAAA,CAAS,CAAA,GAAIkB,CAAAA,GACtBC,mBAAAA,CAAYf,CAAAA,CAAU,MAAA,CAAO,GAAGc,CAAU,CAAA,CAAIE,CAAAA,EAAOA,CAAAA,CAAG,OAAA,CAAQ,qBAAA,CAAsBA,CAAAA,CAAG,UAAA,CAAW,aAAa,CAAC,CAAA,CAEzGnB,CAAAA,CAAU,CAAA,GAAIiB,CAAAA,GACvBC,mBAAAA,CAAYH,CAAAA,CAAW,MAAA,CAAO,GAAGE,CAAU,CAAA,CAAIE,CAAAA,EAAOA,CAAAA,CAAG,OAAA,CAAQ,qBAAA,CAAsBA,CAAAA,CAAG,UAAA,CAAW,aAAa,CAAC","file":"chunk-NCNFFJRK.js","sourcesContent":["import { withGetType } from \"zod-to-ts\";\n\nimport { ZodDateIn } from \"./date-in-schema\";\nimport { ZodDateOut } from \"./date-out-schema\";\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const dateIn = (...parameters: Parameters<typeof ZodDateIn.create>) =>\n withGetType(ZodDateIn.create(...parameters), (ts) => ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword));\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const dateOut = (...parameters: Parameters<typeof ZodDateOut.create>) =>\n withGetType(ZodDateOut.create(...parameters), (ts) => ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword));\n","import type { ParseInput, ParseReturnType, ZodTypeDef } from \"zod\";\nimport { addIssueToContext, INVALID, ZodIssueCode, ZodParsedType, ZodType } from \"zod\";\n\nconst zodDateInKind = \"ZodDateIn\";\n\n// simple regex for ISO date, supports the following formats:\n// 2021-01-01T00:00:00.000Z\n// 2021-01-01T00:00:00Z\n// 2021-01-01T00:00:00\n// 2021-01-01\n// eslint-disable-next-line security/detect-unsafe-regex\nexport const isoDateRegex = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?)?Z?$/;\n\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport interface ZodDateInDef extends ZodTypeDef {\n typeName: typeof zodDateInKind;\n}\n\nexport class ZodDateIn extends ZodType<Date, ZodDateInDef, string> {\n public static create = (): ZodDateIn =>\n new ZodDateIn({\n typeName: zodDateInKind,\n });\n\n // eslint-disable-next-line no-underscore-dangle\n public _parse(input: ParseInput): ParseReturnType<Date> {\n // eslint-disable-next-line no-underscore-dangle\n const { ctx, status } = this._processInputParams(input);\n\n if (ctx.parsedType !== ZodParsedType.string) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n\n return INVALID;\n }\n\n if (!isoDateRegex.test(ctx.data as string)) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"regex\",\n });\n status.dirty();\n }\n\n const date = new Date(ctx.data as string);\n\n if (Number.isNaN(date.getTime())) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n\n return INVALID;\n }\n\n return { status: status.value, value: date };\n }\n}\n","import type { ParseInput, ParseReturnType, ZodTypeDef } from \"zod\";\nimport { addIssueToContext, INVALID, ZodIssueCode, ZodParsedType, ZodType } from \"zod\";\n\nconst zodDateOutKind = \"ZodDateOut\";\n\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport interface ZodDateOutDef extends ZodTypeDef {\n typeName: typeof zodDateOutKind;\n}\n\nexport class ZodDateOut extends ZodType<string, ZodDateOutDef, Date> {\n public static create = (): ZodDateOut =>\n new ZodDateOut({\n typeName: zodDateOutKind,\n });\n\n // eslint-disable-next-line no-underscore-dangle\n public _parse(input: ParseInput): ParseReturnType<string> {\n // eslint-disable-next-line no-underscore-dangle\n const { ctx, status } = this._processInputParams(input);\n\n if (ctx.parsedType !== ZodParsedType.date) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n\n return INVALID;\n }\n\n if (Number.isNaN(ctx.data.getTime())) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n\n return INVALID;\n }\n\n return { status: status.value, value: (ctx.data as Date).toISOString() };\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkOSYBNW3V_js=require('../../../chunk-OSYBNW3V.js');require('../../../chunk-4C666HHU.js');var process=require('process');var i=(o,t="list",r="List all available API routes; Supported frameworks are next, express, koa, hapi and fastify")=>{o.command(t).description(r).option("--framework <framework>","Framework to use, choose from next, express, koa, hapi and fastify").option("-p, --path [path]","...").option("--group [type]","Groups routes. Supported: path, tag").option("--include-path [path]","Includes only routes which contain a given path element. (comma-separated values)",[]).option("--exclude-path [path]","Excludes routes which contain a given path element. (comma-separated values)",[]).option("-v, --verbose","Verbose output.",false).action(async e=>{try{await chunkOSYBNW3V_js.a(e.framework,e.path,{excludePaths:e.excludePaths??[],group:e.group,includePaths:e.includePath??[],verbose:e.verbose});}catch(s){console.log(),console.error(s),process.exit(1);}});},m=i;exports.listCommand=m;//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkFVUS6T4L_js=require('../../../chunk-FVUS6T4L.js');require('../../../chunk-EMGG2IOR.js'),require('../../../chunk-4C666HHU.js');var process=require('process');var i=(o,t="list",r="List all available API routes; Supported frameworks are next, express, koa, hapi and fastify")=>{o.command(t).description(r).option("--framework <framework>","Framework to use, choose from next, express, koa, hapi and fastify").option("-p, --path [path]","...").option("--group [type]","Groups routes. Supported: path, tag").option("--include-path [path]","Includes only routes which contain a given path element. (comma-separated values)",[]).option("--exclude-path [path]","Excludes routes which contain a given path element. (comma-separated values)",[]).option("-v, --verbose","Verbose output.",false).action(async e=>{try{await chunkFVUS6T4L_js.a(e.framework,e.path,{excludePaths:e.excludePaths??[],group:e.group,includePaths:e.includePath??[],verbose:e.verbose});}catch(s){console.log(),console.error(s),process.exit(1);}});},m=i;exports.listCommand=m;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/framework/cli/commander/command/list-command.ts"],"names":["listCommand","program","commandName","description","options","list_command_default","error","exit"],"mappings":"6IAMA,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,kBAAAA,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,YAAAA,CAAK,CAAC,EACV,CACJ,CACJ,EACR,CAAA,CAEOF,CAAAA,CAAQL","file":"index.js","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"]}
1
+ {"version":3,"sources":["../../../../src/framework/cli/commander/command/list-command.ts"],"names":["listCommand","program","commandName","description","options","list_command_default","error","exit"],"mappings":"mLAMA,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,kBAAAA,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,YAAAA,CAAK,CAAC,EACV,CACJ,CACJ,EACR,CAAA,CAEOF,CAAAA,CAAQL","file":"index.js","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"]}
@@ -1,2 +1,2 @@
1
- import {a}from'../../../chunk-TEWEO624.mjs';import'../../../chunk-HZWWJL43.mjs';import {exit}from'process';var m=(o,t="list",r="List all available API routes; Supported frameworks are next, express, koa, hapi and fastify")=>{o.command(t).description(r).option("--framework <framework>","Framework to use, choose from next, express, koa, hapi and fastify").option("-p, --path [path]","...").option("--group [type]","Groups routes. Supported: path, tag").option("--include-path [path]","Includes only routes which contain a given path element. (comma-separated values)",[]).option("--exclude-path [path]","Excludes routes which contain a given path element. (comma-separated values)",[]).option("-v, --verbose","Verbose output.",false).action(async e=>{try{await a(e.framework,e.path,{excludePaths:e.excludePaths??[],group:e.group,includePaths:e.includePath??[],verbose:e.verbose});}catch(s){console.log(),console.error(s),exit(1);}});},l=m;export{l as listCommand};//# sourceMappingURL=index.mjs.map
1
+ import {a}from'../../../chunk-IIZJ6MH4.mjs';import'../../../chunk-KG2WICAI.mjs';import'../../../chunk-HZWWJL43.mjs';import {exit}from'process';var m=(o,t="list",r="List all available API routes; Supported frameworks are next, express, koa, hapi and fastify")=>{o.command(t).description(r).option("--framework <framework>","Framework to use, choose from next, express, koa, hapi and fastify").option("-p, --path [path]","...").option("--group [type]","Groups routes. Supported: path, tag").option("--include-path [path]","Includes only routes which contain a given path element. (comma-separated values)",[]).option("--exclude-path [path]","Excludes routes which contain a given path element. (comma-separated values)",[]).option("-v, --verbose","Verbose output.",false).action(async e=>{try{await a(e.framework,e.path,{excludePaths:e.excludePaths??[],group:e.group,includePaths:e.includePath??[],verbose:e.verbose});}catch(s){console.log(),console.error(s),exit(1);}});},l=m;export{l as listCommand};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"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"]}
1
+ {"version":3,"sources":["../../../../src/framework/cli/commander/command/list-command.ts"],"names":["listCommand","program","commandName","description","options","list_command_default","error","exit"],"mappings":"+IAMA,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"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkOSYBNW3V_js=require('../../chunk-OSYBNW3V.js');require('../../chunk-4C666HHU.js');Object.defineProperty(exports,"listCommand",{enumerable:true,get:function(){return chunkOSYBNW3V_js.a}});//# sourceMappingURL=index.js.map
1
+ 'use strict';var chunkFVUS6T4L_js=require('../../chunk-FVUS6T4L.js');require('../../chunk-EMGG2IOR.js'),require('../../chunk-4C666HHU.js');Object.defineProperty(exports,"listCommand",{enumerable:true,get:function(){return chunkFVUS6T4L_js.a}});//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{a as listCommand}from'../../chunk-TEWEO624.mjs';import'../../chunk-HZWWJL43.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{a as listCommand}from'../../chunk-IIZJ6MH4.mjs';import'../../chunk-KG2WICAI.mjs';import'../../chunk-HZWWJL43.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkMYU5ZKUN_js=require('../../chunk-MYU5ZKUN.js');require('../../chunk-4C666HHU.js');Object.defineProperty(exports,"getSwaggerStaticProps",{enumerable:true,get:function(){return chunkMYU5ZKUN_js.a}});//# sourceMappingURL=index-browser.js.map
1
+ 'use strict';var chunkEEEP2HBM_js=require('../../chunk-EEEP2HBM.js');require('../../chunk-4C666HHU.js');Object.defineProperty(exports,"getSwaggerStaticProps",{enumerable:true,get:function(){return chunkEEEP2HBM_js.a}});//# sourceMappingURL=index-browser.js.map
2
2
  //# sourceMappingURL=index-browser.js.map
@@ -1,2 +1,2 @@
1
- export{a as getSwaggerStaticProps}from'../../chunk-GI7VS3DY.mjs';import'../../chunk-HZWWJL43.mjs';//# sourceMappingURL=index-browser.mjs.map
1
+ export{a as getSwaggerStaticProps}from'../../chunk-5DME62EW.mjs';import'../../chunk-HZWWJL43.mjs';//# sourceMappingURL=index-browser.mjs.map
2
2
  //# sourceMappingURL=index-browser.mjs.map
@@ -1,5 +1,5 @@
1
1
  export { getSwaggerStaticProps } from './index-browser.mjs';
2
- import { S as SwaggerHandlerOptions } from '../../swagger-handler-CsN63rqo.mjs';
2
+ import { S as SwaggerHandlerOptions } from '../../swagger-handler-BPZJNDgC.mjs';
3
3
  import { BaseDefinition } from '@visulima/jsdoc-open-api';
4
4
  import { NextConfig } from 'next/types';
5
5
  import 'node:http';
@@ -1,5 +1,5 @@
1
1
  export { getSwaggerStaticProps } from './index-browser.js';
2
- import { S as SwaggerHandlerOptions } from '../../swagger-handler-CsN63rqo.js';
2
+ import { S as SwaggerHandlerOptions } from '../../swagger-handler-BPZJNDgC.js';
3
3
  import { BaseDefinition } from '@visulima/jsdoc-open-api';
4
4
  import { NextConfig } from 'next/types';
5
5
  import 'node:http';
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkYG667K32_js=require('../../chunk-YG667K32.js'),chunkMYU5ZKUN_js=require('../../chunk-MYU5ZKUN.js');require('../../chunk-4C666HHU.js');var d=require('fs'),jsdocOpenApi=require('@visulima/jsdoc-open-api'),path=require('@visulima/path');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var m=(i={})=>chunkYG667K32_js.c(i),l=m;var u=({definition:i,output:r="swagger/swagger.json",sources:p,verbose:g})=>o=>({...o,webpack:(e,t)=>{if(!t.isServer)return e;if(r.startsWith("/")&&(r=r.slice(1)),!r.endsWith(".json"))throw new Error("The output path must end with .json");return e={...e,plugins:[...e.plugins,new jsdocOpenApi.SwaggerCompilerPlugin(`${t.dir}/${r}`,p.map(f=>{let n=path.join(t.dir,f.replace("./",""));return d__default.default.lstatSync(n).isDirectory(),n}),{openapi:"3.0.0",...i},{verbose:g})]},typeof o.webpack=="function"?o.webpack(e,t):e}}),x=u;Object.defineProperty(exports,"getSwaggerStaticProps",{enumerable:true,get:function(){return chunkMYU5ZKUN_js.a}});exports.swaggerApiRoute=l;exports.withOpenApi=x;//# sourceMappingURL=index-server.js.map
1
+ 'use strict';var chunk3QFJM3GS_js=require('../../chunk-3QFJM3GS.js'),chunkEEEP2HBM_js=require('../../chunk-EEEP2HBM.js'),chunkEMGG2IOR_js=require('../../chunk-EMGG2IOR.js');require('../../chunk-4C666HHU.js');var w=require('fs'),jsdocOpenApi=require('@visulima/jsdoc-open-api');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var w__default=/*#__PURE__*/_interopDefault(w);var l=(i={})=>chunk3QFJM3GS_js.c(i),d=l;var u=({definition:i,output:r="swagger/swagger.json",sources:g,verbose:f})=>o=>({...o,webpack:(e,t)=>{if(!t.isServer)return e;if(r.startsWith("/")&&(r=r.slice(1)),!r.endsWith(".json"))throw new Error("The output path must end with .json");return e={...e,plugins:[...e.plugins,new jsdocOpenApi.SwaggerCompilerPlugin(`${t.dir}/${r}`,g.map(m=>{let n=chunkEMGG2IOR_js.c(t.dir,m.replace("./",""));return w__default.default.lstatSync(n).isDirectory(),n}),{openapi:"3.0.0",...i},{verbose:f})]},typeof o.webpack=="function"?o.webpack(e,t):e}}),x=u;Object.defineProperty(exports,"getSwaggerStaticProps",{enumerable:true,get:function(){return chunkEEEP2HBM_js.a}});exports.swaggerApiRoute=d;exports.withOpenApi=x;//# sourceMappingURL=index-server.js.map
2
2
  //# sourceMappingURL=index-server.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/framework/next/routes/api/swagger.ts","../../../src/framework/next/webpack/with-open-api.ts"],"names":["swaggerApiRoute","options","swagger_handler_default","swagger_default","withOpenApi","definition","output","sources","verbose","nextConfig","config","SwaggerCompilerPlugin","source","combinedPath","join","fs","with_open_api_default"],"mappings":"gXAOA,IAAMA,CAAAA,CAAsH,CAACC,CAAAA,CAAU,EAAC,GACpIC,kBAAAA,CAAeD,CAAO,CAAA,CAGnBE,CAAAA,CAAQH,MCFTI,CAAAA,CACF,CAAC,CACG,UAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CAAS,sBAAA,CACT,QAAAC,CAAAA,CACA,OAAA,CAAAC,CACJ,CAAA,GAMCC,CAAAA,GACI,CACG,GAAGA,CAAAA,CACH,QAAS,CAACC,CAAAA,CAAuBT,CAAAA,GAAkC,CAC/D,GAAI,CAACA,CAAAA,CAAQ,QAAA,CACT,OAAOS,CAAAA,CAQX,GALIJ,CAAAA,CAAO,UAAA,CAAW,GAAG,CAAA,GAErBA,CAAAA,CAASA,CAAAA,CAAO,MAAM,CAAC,CAAA,CAAA,CAGvB,CAACA,CAAAA,CAAO,QAAA,CAAS,OAAO,CAAA,CACxB,MAAM,IAAI,KAAA,CAAM,qCAAqC,CAAA,CA6BzD,OAzBAI,CAAAA,CAAS,CACL,GAAGA,CAAAA,CACH,OAAA,CAAS,CAEL,GAAGA,CAAAA,CAAO,OAAA,CACV,IAAIC,kCAAAA,CACA,CAAA,EAAGV,EAAQ,GAAG,CAAA,CAAA,EAAIK,CAAM,CAAA,CAAA,CACxBC,CAAAA,CAAQ,GAAA,CAAKK,CAAAA,EAAW,CACpB,IAAMC,CAAAA,CAAeC,SAAAA,CAAKb,CAAAA,CAAQ,GAAA,CAAeW,CAAAA,CAAO,OAAA,CAAQ,IAAA,CAAM,EAAE,CAAC,CAAA,CAGzE,OAAAG,kBAAAA,CAAG,SAAA,CAAUF,CAAY,CAAA,CAAE,WAAA,EAAY,CAEhCA,CACX,CAAC,CAAA,CACD,CAEI,OAAA,CAAS,OAAA,CACT,GAAGR,CACP,CAAA,CACA,CAAE,OAAA,CAAAG,CAAQ,CACd,CACJ,CACJ,CAAA,CAEI,OAAOC,CAAAA,CAAW,SAAY,UAAA,CACvBA,CAAAA,CAAW,OAAA,CAAQC,CAAAA,CAAQT,CAAO,CAAA,CAGtCS,CACX,CACJ,GAEDM,CAAAA,CAAQZ","file":"index-server.js","sourcesContent":["import type { SwaggerHandlerOptions } from \"../../../../swagger/api/swagger-handler\";\nimport swaggerHandler from \"../../../../swagger/api/swagger-handler\";\n\n/**\n * @deprecated Use `import { swaggerHandler } from \"@visulima/api-platform\"` instead.\n */\n\nconst swaggerApiRoute: <M extends string, PrismaClient>(options: Partial<SwaggerHandlerOptions<M, PrismaClient>>) => void = (options = {}) =>\n swaggerHandler(options);\n\n// eslint-disable-next-line deprecation/deprecation\nexport default swaggerApiRoute;\n","import fs from \"node:fs\";\n\nimport type { BaseDefinition } from \"@visulima/jsdoc-open-api\";\nimport { SwaggerCompilerPlugin } from \"@visulima/jsdoc-open-api\";\nimport { join } from \"@visulima/path\";\nimport type { NextJsWebpackConfig, WebpackConfigContext } from \"next/dist/server/config-shared\";\nimport type { NextConfig } from \"next/types\";\nimport type { Configuration } from \"webpack\";\n\nconst withOpenApi =\n ({\n definition,\n output = \"swagger/swagger.json\",\n sources,\n verbose,\n }: {\n definition: Exclude<BaseDefinition, \"openapi\"> & { openapi?: string };\n output: string;\n sources: string[];\n verbose?: boolean;\n }) =>\n (nextConfig: NextConfig): NextConfig =>\n ({\n ...nextConfig,\n webpack: (config: Configuration, options: WebpackConfigContext) => {\n if (!options.isServer) {\n return config;\n }\n\n if (output.startsWith(\"/\")) {\n // eslint-disable-next-line no-param-reassign\n output = output.slice(1);\n }\n\n if (!output.endsWith(\".json\")) {\n throw new Error(\"The output path must end with .json\");\n }\n\n // eslint-disable-next-line no-param-reassign\n config = {\n ...config,\n plugins: [\n // @ts-expect-error: ignore\n ...config.plugins,\n new SwaggerCompilerPlugin(\n `${options.dir}/${output}`,\n sources.map((source) => {\n const combinedPath = join(options.dir as string, source.replace(\"./\", \"\"));\n\n // Check if the path is a directory\n fs.lstatSync(combinedPath).isDirectory();\n\n return combinedPath;\n }),\n {\n // @ts-expect-error: This property should be overwritten\n openapi: \"3.0.0\",\n ...definition,\n },\n { verbose },\n ),\n ],\n };\n\n if (typeof nextConfig.webpack === \"function\") {\n return nextConfig.webpack(config, options) as NextJsWebpackConfig;\n }\n\n return config as NextJsWebpackConfig;\n },\n }) as NextConfig;\n\nexport default withOpenApi;\n"]}
1
+ {"version":3,"sources":["../../../src/framework/next/routes/api/swagger.ts","../../../src/framework/next/webpack/with-open-api.ts"],"names":["swaggerApiRoute","options","swagger_handler_default","swagger_default","withOpenApi","definition","output","sources","verbose","nextConfig","config","SwaggerCompilerPlugin","source","combinedPath","join","fs","with_open_api_default"],"mappings":"qYAOA,IAAMA,CAAAA,CAAsH,CAACC,CAAAA,CAAU,EAAC,GACpIC,kBAAAA,CAAeD,CAAO,CAAA,CAGnBE,CAAAA,CAAQH,ECFf,IAAMI,CAAAA,CACA,CAAC,CACC,UAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CAAS,sBAAA,CACT,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CACJ,CAAA,GAMKC,CAAAA,GACI,CACG,GAAGA,CAAAA,CACH,OAAA,CAAS,CAACC,CAAAA,CAAuBT,CAAAA,GAAkC,CAC/D,GAAI,CAACA,CAAAA,CAAQ,QAAA,CACT,OAAOS,CAAAA,CAQX,GALIJ,CAAAA,CAAO,UAAA,CAAW,GAAG,CAAA,GAErBA,CAAAA,CAASA,CAAAA,CAAO,KAAA,CAAM,CAAC,GAGvB,CAACA,CAAAA,CAAO,QAAA,CAAS,OAAO,CAAA,CACxB,MAAM,IAAI,KAAA,CAAM,qCAAqC,CAAA,CA6BzD,OAzBAI,CAAAA,CAAS,CACL,GAAGA,CAAAA,CACH,OAAA,CAAS,CAEL,GAAGA,CAAAA,CAAO,OAAA,CACV,IAAIC,kCAAAA,CACA,CAAA,EAAGV,CAAAA,CAAQ,GAAG,IAAIK,CAAM,CAAA,CAAA,CACxBC,CAAAA,CAAQ,GAAA,CAAKK,CAAAA,EAAW,CACpB,IAAMC,CAAAA,CAAeC,kBAAAA,CAAKb,CAAAA,CAAQ,GAAA,CAAeW,CAAAA,CAAO,OAAA,CAAQ,IAAA,CAAM,EAAE,CAAC,EAGzE,OAAAG,kBAAAA,CAAG,SAAA,CAAUF,CAAY,CAAA,CAAE,WAAA,EAAY,CAEhCA,CACX,CAAC,CAAA,CACD,CAEI,OAAA,CAAS,OAAA,CACT,GAAGR,CACP,CAAA,CACA,CAAE,OAAA,CAAAG,CAAQ,CACd,CACJ,CACJ,CAAA,CAEI,OAAOC,CAAAA,CAAW,SAAY,UAAA,CACvBA,CAAAA,CAAW,OAAA,CAAQC,CAAAA,CAAQT,CAAO,CAAA,CAGtCS,CACX,CACJ,GAELM,CAAAA,CAAQZ","file":"index-server.js","sourcesContent":["import type { SwaggerHandlerOptions } from \"../../../../swagger/api/swagger-handler\";\nimport swaggerHandler from \"../../../../swagger/api/swagger-handler\";\n\n/**\n * @deprecated Use `import { swaggerHandler } from \"@visulima/api-platform\"` instead.\n */\n\nconst swaggerApiRoute: <M extends string, PrismaClient>(options: Partial<SwaggerHandlerOptions<M, PrismaClient>>) => void = (options = {}) =>\n swaggerHandler(options);\n\n// eslint-disable-next-line deprecation/deprecation\nexport default swaggerApiRoute;\n","import fs from \"node:fs\";\n\nimport type { BaseDefinition } from \"@visulima/jsdoc-open-api\";\nimport { SwaggerCompilerPlugin } from \"@visulima/jsdoc-open-api\";\nimport { join } from \"@visulima/path\";\nimport type { NextJsWebpackConfig, WebpackConfigContext } from \"next/dist/server/config-shared\";\nimport type { NextConfig } from \"next/types\";\nimport type { Configuration } from \"webpack\";\n\nconst withOpenApi\n = ({\n definition,\n output = \"swagger/swagger.json\",\n sources,\n verbose,\n }: {\n definition: Exclude<BaseDefinition, \"openapi\"> & { openapi?: string };\n output: string;\n sources: string[];\n verbose?: boolean;\n }) =>\n (nextConfig: NextConfig): NextConfig =>\n ({\n ...nextConfig,\n webpack: (config: Configuration, options: WebpackConfigContext) => {\n if (!options.isServer) {\n return config;\n }\n\n if (output.startsWith(\"/\")) {\n // eslint-disable-next-line no-param-reassign\n output = output.slice(1);\n }\n\n if (!output.endsWith(\".json\")) {\n throw new Error(\"The output path must end with .json\");\n }\n\n // eslint-disable-next-line no-param-reassign\n config = {\n ...config,\n plugins: [\n // @ts-expect-error: ignore\n ...config.plugins,\n new SwaggerCompilerPlugin(\n `${options.dir}/${output}`,\n sources.map((source) => {\n const combinedPath = join(options.dir as string, source.replace(\"./\", \"\"));\n\n // Check if the path is a directory\n fs.lstatSync(combinedPath).isDirectory();\n\n return combinedPath;\n }),\n {\n // @ts-expect-error: This property should be overwritten\n openapi: \"3.0.0\",\n ...definition,\n },\n { verbose },\n ),\n ],\n };\n\n if (typeof nextConfig.webpack === \"function\") {\n return nextConfig.webpack(config, options) as NextJsWebpackConfig;\n }\n\n return config as NextJsWebpackConfig;\n },\n }) as NextConfig;\n\nexport default withOpenApi;\n"]}
@@ -1,2 +1,2 @@
1
- import {c}from'../../chunk-67LLYNYS.mjs';export{a as getSwaggerStaticProps}from'../../chunk-GI7VS3DY.mjs';import'../../chunk-HZWWJL43.mjs';import w from'fs';import {SwaggerCompilerPlugin}from'@visulima/jsdoc-open-api';import {join}from'@visulima/path';var l=(i={})=>c(i),d=l;var x=({definition:i,output:r="swagger/swagger.json",sources:g,verbose:f})=>o=>({...o,webpack:(e,t)=>{if(!t.isServer)return e;if(r.startsWith("/")&&(r=r.slice(1)),!r.endsWith(".json"))throw new Error("The output path must end with .json");return e={...e,plugins:[...e.plugins,new SwaggerCompilerPlugin(`${t.dir}/${r}`,g.map(m=>{let n=join(t.dir,m.replace("./",""));return w.lstatSync(n).isDirectory(),n}),{openapi:"3.0.0",...i},{verbose:f})]},typeof o.webpack=="function"?o.webpack(e,t):e}}),C=x;export{d as swaggerApiRoute,C as withOpenApi};//# sourceMappingURL=index-server.mjs.map
1
+ import {c}from'../../chunk-MZZ3R2JF.mjs';export{a as getSwaggerStaticProps}from'../../chunk-5DME62EW.mjs';import {c as c$1}from'../../chunk-KG2WICAI.mjs';import'../../chunk-HZWWJL43.mjs';import c$2 from'fs';import {SwaggerCompilerPlugin}from'@visulima/jsdoc-open-api';var d=(i={})=>c(i),w=d;var x=({definition:i,output:r="swagger/swagger.json",sources:f,verbose:m})=>o=>({...o,webpack:(e,t)=>{if(!t.isServer)return e;if(r.startsWith("/")&&(r=r.slice(1)),!r.endsWith(".json"))throw new Error("The output path must end with .json");return e={...e,plugins:[...e.plugins,new SwaggerCompilerPlugin(`${t.dir}/${r}`,f.map(l=>{let n=c$1(t.dir,l.replace("./",""));return c$2.lstatSync(n).isDirectory(),n}),{openapi:"3.0.0",...i},{verbose:m})]},typeof o.webpack=="function"?o.webpack(e,t):e}}),C=x;export{w as swaggerApiRoute,C as withOpenApi};//# sourceMappingURL=index-server.mjs.map
2
2
  //# sourceMappingURL=index-server.mjs.map