{"_id":"@ahmedrowaihi/openapi-ts-paths","_rev":"3-0969fc8530015d3506ab71cf17723c96","name":"@ahmedrowaihi/openapi-ts-paths","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@ahmedrowaihi/openapi-ts-paths","version":"1.0.0","keywords":["openapi","openapi-ts","routes","router","matcher","url-pattern","typescript","codegen","type-safe","plugin"],"author":{"name":"Ahmed Rowaihi","email":"ahmedrowaihi@gmail.com"},"license":"MIT","_id":"@ahmedrowaihi/openapi-ts-paths@1.0.0","maintainers":[{"name":"ahmedrowaihi","email":"ahmedrowaihi1@gmail.com"}],"homepage":"https://github.com/ahmedrowaihi/contract-kit/tree/main/packages/openapi-ts-plugins/paths","bugs":{"url":"https://github.com/ahmedrowaihi/contract-kit/issues"},"dist":{"shasum":"ab3fc3159846bf0dc35263d9573dc61baa95231a","tarball":"https://registry.npmjs.org/@ahmedrowaihi/openapi-ts-paths/-/openapi-ts-paths-1.0.0.tgz","fileCount":18,"integrity":"sha512-6+0QQANvnXIN+0vxwBeDTqYFi7m63+tiq7j6asBJIugNYabjcpatHiA7UGaOBronl3Gc+iQiUIUE8tP0Y6BWXg==","signatures":[{"sig":"MEUCIQDnuyuPSPpTkiHUIs9FiRszEBXTPFGnO4jnCVHnNglG0QIgEzWDxFwMKXgEes1TEC7Mr4jhUnJXO9rF8FBeODMhI70=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ahmedrowaihi%2fopenapi-ts-paths@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9965},"main":"./dist/index.js","type":"module","_from":"file:ahmedrowaihi-openapi-ts-paths-1.0.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"dev":"tsc --watch","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ahmedrowaihi","email":"ahmedrowaihi1@gmail.com"},"_resolved":"/tmp/ff10e9b723ea6d9c570768faea94e717/ahmedrowaihi-openapi-ts-paths-1.0.0.tgz","_integrity":"sha512-6+0QQANvnXIN+0vxwBeDTqYFi7m63+tiq7j6asBJIugNYabjcpatHiA7UGaOBronl3Gc+iQiUIUE8tP0Y6BWXg==","repository":{"url":"git+https://github.com/ahmedrowaihi/contract-kit.git","type":"git","directory":"packages/openapi-ts-plugins/paths"},"_npmVersion":"10.8.2","description":"Plugin for @hey-api/openapi-ts — emit per-operation route consts (spec template, URLPattern, method, operationId) for tree-shakable runtime routing and matching","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22","@hey-api/shared":"^0.4.1","@hey-api/openapi-ts":"^0.96.1","@hey-api/codegen-core":"^0.8.0","@contract-kit/tsconfig":"0.0.0"},"peerDependencies":{"@hey-api/shared":">=0.3.0","@hey-api/openapi-ts":">=0.95.0","@hey-api/codegen-core":">=0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/openapi-ts-paths_1.0.0_1777318978499_0.3489751340492895","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Moved to @ir-kit/openapi-ts-paths. See https://github.com/ir-kit/ir-kit for migration."},"1.0.1":{"name":"@ahmedrowaihi/openapi-ts-paths","version":"1.0.1","keywords":["openapi","openapi-ts","routes","router","matcher","url-pattern","typescript","codegen","type-safe","plugin"],"author":{"name":"Ahmed Rowaihi","email":"ahmedrowaihi@gmail.com"},"license":"MIT","_id":"@ahmedrowaihi/openapi-ts-paths@1.0.1","maintainers":[{"name":"ahmedrowaihi","email":"ahmedrowaihi1@gmail.com"}],"homepage":"https://github.com/ahmedrowaihi/contract-kit/tree/main/packages/openapi/plugins/paths","bugs":{"url":"https://github.com/ahmedrowaihi/contract-kit/issues"},"dist":{"shasum":"38f76f5eb00eec7fe3883e9e0aa1dbc8cc6a8111","tarball":"https://registry.npmjs.org/@ahmedrowaihi/openapi-ts-paths/-/openapi-ts-paths-1.0.1.tgz","fileCount":19,"integrity":"sha512-ZUZNfJbd1B4sJGDvL4Ti3/tYM+X0qMyyhj+/ct/n415q8d7ZjVHstIdkMxsBP2FsoCaMPaXnZa98IwS+FiFhiA==","signatures":[{"sig":"MEYCIQDMdgn95m+72LRcaU5r42Jvmw2WcSpckbb8gdtDl6udEQIhAKRHBNadrUSnhsOHSsHhc2dYbOHo8R4/RQjFZo9hDAOx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ahmedrowaihi%2fopenapi-ts-paths@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12163},"main":"./dist/index.js","type":"module","_from":"file:ahmedrowaihi-openapi-ts-paths-1.0.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"dev":"tsc --watch","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ahmedrowaihi","email":"ahmedrowaihi1@gmail.com"},"_resolved":"/tmp/788ce9f515c3e908db5815613cd90917/ahmedrowaihi-openapi-ts-paths-1.0.1.tgz","_integrity":"sha512-ZUZNfJbd1B4sJGDvL4Ti3/tYM+X0qMyyhj+/ct/n415q8d7ZjVHstIdkMxsBP2FsoCaMPaXnZa98IwS+FiFhiA==","repository":{"url":"git+https://github.com/ahmedrowaihi/contract-kit.git","type":"git","directory":"packages/openapi/plugins/paths"},"_npmVersion":"10.8.2","description":"Plugin for @hey-api/openapi-ts — emit per-operation route consts (spec template, URLPattern, method, operationId) for tree-shakable runtime routing and matching","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22","@hey-api/shared":"^0.4.2","@hey-api/openapi-ts":"^0.97.0","@hey-api/codegen-core":"^0.8.1","@ahmedrowaihi/tsconfig":"0.0.0"},"peerDependencies":{"@hey-api/shared":">=0.3.0","@hey-api/openapi-ts":">=0.95.0","@hey-api/codegen-core":">=0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/openapi-ts-paths_1.0.1_1777638932365_0.3121269257525954","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Moved to @ir-kit/openapi-ts-paths. See https://github.com/ir-kit/ir-kit for migration."}},"time":{"created":"2026-04-27T19:42:58.428Z","modified":"2026-05-21T09:19:44.605Z","1.0.0":"2026-04-27T19:42:58.657Z","1.0.1":"2026-05-01T12:35:32.542Z"},"bugs":{"url":"https://github.com/ahmedrowaihi/contract-kit/issues"},"author":{"name":"Ahmed Rowaihi","email":"ahmedrowaihi@gmail.com"},"license":"MIT","homepage":"https://github.com/ahmedrowaihi/contract-kit/tree/main/packages/openapi/plugins/paths","keywords":["openapi","openapi-ts","routes","router","matcher","url-pattern","typescript","codegen","type-safe","plugin"],"repository":{"url":"git+https://github.com/ahmedrowaihi/contract-kit.git","type":"git","directory":"packages/openapi/plugins/paths"},"description":"Plugin for @hey-api/openapi-ts — emit per-operation route consts (spec template, URLPattern, method, operationId) for tree-shakable runtime routing and matching","maintainers":[{"name":"ahmedrowaihi","email":"ahmedrowaihi1@gmail.com"}],"readme":"# @ahmedrowaihi/openapi-ts-paths\n\nPer-operation route consts emitted from an OpenAPI spec — spec template, URLPattern-style pattern, method, and operationId, ready for tree-shakable runtime routing and matching. Plugin for [`@hey-api/openapi-ts`](https://heyapi.dev).\n\n## Install\n\n```bash\nnpm install -D @ahmedrowaihi/openapi-ts-paths @hey-api/openapi-ts\n```\n\n## Use\n\n```ts\nimport { defineConfig } from \"@hey-api/openapi-ts\";\nimport { defineConfig as definePathsConfig } from \"@ahmedrowaihi/openapi-ts-paths\";\n\nexport default defineConfig({\n  input: \"openapi.yaml\",\n  output: { path: \"./generated\" },\n  plugins: [\n    \"@hey-api/typescript\",\n    definePathsConfig({\n      output: \"paths\",                // → generated/paths.ts\n      naming: { casing: \"camelCase\", suffix: \"Route\" },\n    }),\n  ],\n});\n```\n\n## Output\n\nFor each operation that has a `path` and an `operationId`, the plugin emits:\n\n```ts\nexport const getPetByIdRoute = {\n  spec: \"/pets/{id}\",\n  pattern: \"/pets/:id\",\n  method: \"get\",\n  operationId: \"getPetById\",\n} as const;\n```\n\n- `spec` — the original `{param}` template, useful when re-issuing the request.\n- `pattern` — `:param` form, ready to feed `URLPattern`, `path-to-regexp`, your router of choice.\n- `method` — lower-case verb.\n- `operationId` — the OpenAPI id when present.\n\n`as const` keeps every value literal-typed so downstream code can narrow on `route.method`, etc.\n\n## Why route consts (instead of runtime routing)\n\nTree-shakable: only the routes you import end up in the bundle. Pair with the matchers in [`@ahmedrowaihi/openapi-tools`](../../openapi-tools) for client-side dispatch:\n\n```ts\nimport { match } from \"@ahmedrowaihi/openapi-tools/match\";\nimport { getPetByIdRoute } from \"./generated/paths\";\n\nconst params = match(getPetByIdRoute.pattern, \"/pets/42\"); // { id: \"42\" }\n```\n\nOr feed them to a router framework that takes pattern strings.\n\n## Options\n\n```ts\ndefinePathsConfig({\n  output: \"paths\",                    // filename (no extension). Default: \"paths\"\n  naming: {\n    casing: \"camelCase\",              // any @hey-api/shared NamingRule | Casing\n    suffix: \"Route\",                  // appended to each const name\n  },\n});\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}