next-openapi-gen 0.10.4 → 1.0.0

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 (44) hide show
  1. package/dist/cli.d.ts +4 -0
  2. package/dist/cli.js +8599 -0
  3. package/dist/index.d.ts +18 -0
  4. package/dist/index.js +8645 -26
  5. package/dist/next/index.d.ts +1 -0
  6. package/dist/next/index.js +7965 -0
  7. package/dist/react-router/index.d.ts +1 -0
  8. package/dist/react-router/index.js +7134 -0
  9. package/dist/vite/index.d.ts +1 -0
  10. package/dist/vite/index.js +7134 -0
  11. package/package.json +102 -79
  12. package/{dist/components/rapidoc.js → templates/init/ui/nextjs/rapidoc.tsx} +16 -20
  13. package/templates/init/ui/nextjs/redoc.tsx +11 -0
  14. package/{dist/components/scalar.js → templates/init/ui/nextjs/scalar.tsx} +15 -21
  15. package/{dist/components/stoplight.js → templates/init/ui/nextjs/stoplight.tsx} +11 -17
  16. package/templates/init/ui/nextjs/swagger.tsx +17 -0
  17. package/templates/init/ui/reactrouter/rapidoc.tsx +15 -0
  18. package/templates/init/ui/reactrouter/redoc.tsx +9 -0
  19. package/templates/init/ui/reactrouter/scalar.tsx +14 -0
  20. package/templates/init/ui/reactrouter/stoplight.tsx +10 -0
  21. package/templates/init/ui/reactrouter/swagger.tsx +11 -0
  22. package/templates/init/ui/tanstack/rapidoc.tsx +21 -0
  23. package/templates/init/ui/tanstack/redoc.tsx +14 -0
  24. package/templates/init/ui/tanstack/scalar.tsx +19 -0
  25. package/templates/init/ui/tanstack/stoplight.tsx +15 -0
  26. package/templates/init/ui/tanstack/swagger.tsx +16 -0
  27. package/templates/init/ui/template-types.d.ts +9 -0
  28. package/README.md +0 -1047
  29. package/dist/commands/generate.js +0 -24
  30. package/dist/commands/init.js +0 -194
  31. package/dist/components/redoc.js +0 -17
  32. package/dist/components/swagger.js +0 -21
  33. package/dist/lib/app-router-strategy.js +0 -66
  34. package/dist/lib/drizzle-zod-processor.js +0 -329
  35. package/dist/lib/logger.js +0 -39
  36. package/dist/lib/openapi-generator.js +0 -171
  37. package/dist/lib/pages-router-strategy.js +0 -198
  38. package/dist/lib/route-processor.js +0 -347
  39. package/dist/lib/router-strategy.js +0 -1
  40. package/dist/lib/schema-processor.js +0 -1612
  41. package/dist/lib/utils.js +0 -284
  42. package/dist/lib/zod-converter.js +0 -2133
  43. package/dist/openapi-template.js +0 -99
  44. package/dist/types.js +0 -1
@@ -1,99 +0,0 @@
1
- export default {
2
- openapi: "3.0.0",
3
- info: {
4
- title: "API Documentation",
5
- version: "1.0.0",
6
- description: "This is the OpenAPI specification for your project.",
7
- },
8
- servers: [
9
- {
10
- url: "http://localhost:3000/api",
11
- description: "Local development server",
12
- },
13
- ],
14
- components: {
15
- securitySchemes: {
16
- BearerAuth: {
17
- type: "http",
18
- scheme: "bearer",
19
- bearerFormat: "JWT",
20
- },
21
- },
22
- },
23
- defaultResponseSet: "common",
24
- responseSets: {
25
- common: ["400", "500"],
26
- auth: ["400", "401", "403", "500"],
27
- public: ["400", "500"],
28
- },
29
- errorConfig: {
30
- template: {
31
- type: "object",
32
- properties: {
33
- error: {
34
- type: "string",
35
- example: "{{ERROR_MESSAGE}}",
36
- },
37
- code: {
38
- type: "string",
39
- example: "{{ERROR_CODE}}",
40
- },
41
- },
42
- },
43
- codes: {
44
- "400": {
45
- description: "Bad Request",
46
- variables: {
47
- ERROR_MESSAGE: "Invalid request parameters",
48
- ERROR_CODE: "BAD_REQUEST",
49
- },
50
- },
51
- "401": {
52
- description: "Unauthorized",
53
- variables: {
54
- ERROR_MESSAGE: "Authentication required",
55
- ERROR_CODE: "UNAUTHORIZED",
56
- },
57
- },
58
- "403": {
59
- description: "Forbidden",
60
- variables: {
61
- ERROR_MESSAGE: "Access denied",
62
- ERROR_CODE: "FORBIDDEN",
63
- },
64
- },
65
- "404": {
66
- description: "Not Found",
67
- variables: {
68
- ERROR_MESSAGE: "Resource not found",
69
- ERROR_CODE: "NOT_FOUND",
70
- },
71
- },
72
- "409": {
73
- description: "Conflict",
74
- variables: {
75
- ERROR_MESSAGE: "Resource already exists",
76
- ERROR_CODE: "CONFLICT",
77
- },
78
- },
79
- "500": {
80
- description: "Internal Server Error",
81
- variables: {
82
- ERROR_MESSAGE: "An unexpected error occurred",
83
- ERROR_CODE: "INTERNAL_ERROR",
84
- },
85
- },
86
- },
87
- },
88
- apiDir: "./src/app/api",
89
- schemaDir: "./src",
90
- schemaType: "zod", // or "typescript" or ["zod", "typescript"]
91
- schemaFiles: [], // Optional: ["./openapi-models.yaml", "./schemas.json"]
92
- docsUrl: "api-docs",
93
- ui: "scalar",
94
- outputFile: "openapi.json",
95
- outputDir: "./public",
96
- includeOpenApiRoutes: false,
97
- ignoreRoutes: [],
98
- debug: false,
99
- };
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export {};