@hedystia/swagger 1.9.9 → 1.10.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/readme.md +11 -4
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -542,4 +542,4 @@
|
|
|
542
542
|
handleResize();
|
|
543
543
|
</script>
|
|
544
544
|
</body>
|
|
545
|
-
</html>`}};function G(n={}){let e=new w(n),r=new B.Hedystia().get("/",()=>new Response(e.generateHTML(),{headers:{"Content-Type":"text/html"}})).get("/json",()=>
|
|
545
|
+
</html>`}};function G(n={}){let e=new w(n),r=new B.Hedystia().get("/",()=>new Response(e.generateHTML(),{headers:{"Content-Type":"text/html"}})).get("/json",()=>e.getSpec());function t(i){for(let s of i.routes)e.addRoute(s.method,s.path,{params:s.schema.params,query:s.schema.query,body:s.schema.body,response:s.schema.response},s.schema.description||`${s.method} ${s.path}`,s.schema.description,s.schema.tags);for(let s of i.staticRoutes)e.addRoute("GET",s.path,{},`Static route ${s.path}`);for(let[s]of i.wsRoutes)e.addRoute("WS",s,{},`WebSocket route ${s}`);for(let[s,p]of i.subscriptionHandlers)e.addRoute("SUB",s,{params:p.schema.params,query:p.schema.query,headers:p.schema.headers},p.schema.description||`SUB ${s}`,p.schema.description,p.schema.tags);return r}return{plugin:t,swagger:e}}0&&(module.exports={swagger});
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hedystia/swagger",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@types/bun": "^1.3.3",
|
|
6
6
|
"tsup": "^8.3.5"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@apidevtools/swagger-parser": "^10.1.1",
|
|
10
|
-
"hedystia": "^1.
|
|
10
|
+
"hedystia": "^1.10.0",
|
|
11
11
|
"openapi-types": "^12.1.3"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@apidevtools/swagger-parser": "^10.1.1",
|
|
15
15
|
"typescript": ">= 5.0.0",
|
|
16
|
-
"hedystia": ">= 1.
|
|
16
|
+
"hedystia": ">= 1.10.0",
|
|
17
17
|
"openapi-types": ">= 12.0.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependenciesMeta": {
|
package/readme.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
10
|
<p>
|
|
11
|
+
<a href="https://docs.hedystia.com"><img src="https://img.shields.io/badge/Docs-blue?style=flat-square" alt="Documentation"></a>
|
|
11
12
|
<a href="https://www.npmjs.com/package/hedystia"><img src="https://img.shields.io/npm/v/hedystia.svg?style=flat-square" alt="npm version"></a>
|
|
12
13
|
<a href="https://www.npmjs.com/package/hedystia"><img src="https://img.shields.io/npm/dm/hedystia.svg?style=flat-square" alt="npm downloads"></a>
|
|
13
14
|
<a href="LICENSE"><img src="https://img.shields.io/github/license/Hedystia/Framework.svg?style=flat-square" alt="license"></a>
|
|
@@ -141,10 +142,11 @@ app.listen(3000);
|
|
|
141
142
|
## 💼 Production Ready
|
|
142
143
|
```typescript
|
|
143
144
|
// Error handling
|
|
144
|
-
.onError((err) => {
|
|
145
|
-
|
|
145
|
+
.onError((err, ctx) => {
|
|
146
|
+
ctx.set.status(500);
|
|
147
|
+
return {
|
|
146
148
|
error: err.message
|
|
147
|
-
}
|
|
149
|
+
};
|
|
148
150
|
})
|
|
149
151
|
|
|
150
152
|
// Rate limiting macro
|
|
@@ -160,6 +162,11 @@ app.listen(3000);
|
|
|
160
162
|
## 📜 License
|
|
161
163
|
MIT License © 2025 Hedystia
|
|
162
164
|
|
|
163
|
-
##
|
|
165
|
+
## � Documentation
|
|
166
|
+
- [Full Documentation](https://docs.hedystia.com)
|
|
167
|
+
- [Getting Started Guide](https://docs.hedystia.com/framework/getting-started)
|
|
168
|
+
- [API Reference](https://docs.hedystia.com/framework/overview)
|
|
169
|
+
|
|
170
|
+
## �🗣️ Community
|
|
164
171
|
- [GitHub Issues](https://github.com/Hedystia/Framework/issues)
|
|
165
172
|
- [Discord Server](https://hedystia.com/support)
|