@visulima/api-platform 4.0.0-alpha.3 → 4.0.0-alpha.5
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/CHANGELOG.md +31 -0
- package/LICENSE.md +1 -1
- package/dist/index-server.mjs +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
## @visulima/api-platform [4.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/api-platform@4.0.0-alpha.4...@visulima/api-platform@4.0.0-alpha.5) (2026-03-06)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* **api-platform:** update dependencies ([da57fe3](https://github.com/visulima/visulima/commit/da57fe35fa242e43d1990c7bb8a887d23c3b1ea1))
|
|
6
|
+
* **api:** update dependencies ([f3b6f7c](https://github.com/visulima/visulima/commit/f3b6f7c956e8ae2c0da67773b3790f159c07de29))
|
|
7
|
+
* move top-level examples into their respective packages ([3bf7105](https://github.com/visulima/visulima/commit/3bf7105a56db6383ae65d5e28dea9a2c18af791a))
|
|
8
|
+
* moved examples ([bb07290](https://github.com/visulima/visulima/commit/bb07290fba65a83aaad8f0ef62d1c244d1610002))
|
|
9
|
+
* update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
|
|
10
|
+
* year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* **@visulima/connect:** upgraded to 4.0.0-alpha.5
|
|
16
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.4
|
|
17
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.5
|
|
18
|
+
* **@visulima/crud:** upgraded to 3.0.0-alpha.6
|
|
19
|
+
|
|
20
|
+
## @visulima/api-platform [4.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/api-platform@4.0.0-alpha.3...@visulima/api-platform@4.0.0-alpha.4) (2026-01-17)
|
|
21
|
+
|
|
22
|
+
### Miscellaneous Chores
|
|
23
|
+
|
|
24
|
+
* **api-platform:** update dependencies ([a1ab3ac](https://github.com/visulima/visulima/commit/a1ab3ac8a4a9521c7dddb7357a378873ebcf97f2))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* **@visulima/jsdoc-open-api:** upgraded to 3.0.0-alpha.4
|
|
30
|
+
* **@visulima/crud:** upgraded to 3.0.0-alpha.5
|
|
31
|
+
|
|
1
32
|
## @visulima/api-platform [4.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/api-platform@4.0.0-alpha.2...@visulima/api-platform@4.0.0-alpha.3) (2025-12-27)
|
|
2
33
|
|
|
3
34
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
package/dist/index-server.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export{a as dateIn,b as dateOut,c as zod}from'./chunk-BJSUSPWM.mjs';import {b,a}from'./chunk-LTU4LAD7.mjs';export{c as swaggerHandler,b as yamlTransformer}from'./chunk-LTU4LAD7.mjs';import'./chunk-HZWWJL43.mjs';import {expressWrapper
|
|
1
|
+
export{a as dateIn,b as dateOut,c as zod}from'./chunk-BJSUSPWM.mjs';import {b,a}from'./chunk-LTU4LAD7.mjs';export{c as swaggerHandler,b as yamlTransformer}from'./chunk-LTU4LAD7.mjs';import'./chunk-HZWWJL43.mjs';import {NodeRouter,expressWrapper}from'@visulima/connect';export{EdgeRouter,NodeRouter,Router,createEdgeRouter,expressWrapper,sendJson,withZod}from'@visulima/connect';import P,{HttpError}from'http-errors';export{BadGateway,BadRequest,BandwidthLimitExceeded,Conflict,ExpectationFailed,FailedDependency,Forbidden,GatewayTimeout,Gone,HTTPVersionNotSupported,ImATeapot,InsufficientStorage,InternalServerError,LengthRequired,Locked,LoopDetected,MethodNotAllowed,MisdirectedRequest,NetworkAuthenticationRequire,NotAcceptable,NotExtended,NotFound,NotImplemented,PayloadTooLarge,PaymentRequired,PreconditionFailed,PreconditionRequired,ProxyAuthenticationRequired,RangeNotSatisfiable,RequestHeaderFieldsTooLarge,RequestTimeout,ServiceUnavailable,TooManyRequests,URITooLong,Unauthorized,UnavailableForLegalReasons,UnprocessableEntity,UnsupportedMediaType,UpgradeRequired,VariantAlsoNegotiates,default as createHttpError}from'http-errors';import {getReasonPhrase,StatusCodes}from'http-status-codes';import h from'ts-japi';import te from'debug';import Y from'accepts';import {toXML}from'jstoxml';import de from'cors';var R=(e,o)=>{let t=o.headers??{};Object.keys(t).forEach(r=>{e.setHeader(r,t[r]);});},c=(e,o)=>{e.setHeader("content-type","application/json; charset=utf-8"),e.end(JSON.stringify(o));},y=(e,o)=>{o.statusCode!==void 0&&(e.statusCode=o.statusCode),o.status!==void 0&&(e.statusCode=o.status),e.statusCode<400&&(e.statusCode=StatusCodes.INTERNAL_SERVER_ERROR);};var T="An error occurred",W=(e,o,t)=>{if(y(t,e),R(t,e),e instanceof h.JapiError||h.JapiError.isLikeJapiError(e)){let r=new h.ErrorSerializer;c(t,r.serialize(e));}else if(e instanceof HttpError){let{message:r,statusCode:n,title:a}=e;c(t,{errors:[{code:n,title:a||getReasonPhrase(n)||T,detail:r}]});}else {let{message:r}=e;c(t,{errors:[{code:"500",title:getReasonPhrase(t.statusCode)||T,detail:r}]});}},A=W;var C="https://tools.ietf.org/html/rfc2616#section-10",I="An error occurred",X=(e,o,t)=>{let{message:r,stack:n}=e;if(e instanceof HttpError){let{expose:a,statusCode:s,title:i,type:d}=e;t.statusCode=s,R(t,e),c(t,{type:d||C,title:i||getReasonPhrase(s)||I,details:r,...a?{trace:n}:{}});}else y(t,e),c(t,{type:C,title:getReasonPhrase(t.statusCode)||I,details:r,...e.expose?{trace:n}:{}});},O=X;var H=(e,o)=>async(t,r,n)=>{let a=r.headers.accept,s=O;a==="application/vnd.api+json"&&(s=A);for(let{handler:i,regex:d}of e)if(d.test(a)){s=i;break}t.expose=o,s(t,r,n);},S=async(e,o,t)=>{let r=[...new Set(t.map(n=>n.method))].join(", ");throw o.setHeader("Allow",r),o.statusCode=405,P(405,`No route with [${e.method}] method found.`)};var q={alpn:"ALPN","c-pep":"C-PEP","c-pep-info":"C-PEP-Info","caldav-timezones":"CalDAV-Timezones","content-id":"Content-ID","content-md5":"Content-MD5",dasl:"DASL",dav:"DAV",dnt:"DNT",etag:"ETag",getprofile:"GetProfile","http2-settings":"HTTP2-Settings","last-event-id":"Last-Event-ID","mime-version":"MIME-Version","optional-www-authenticate":"Optional-WWW-Authenticate","sec-websocket-accept":"Sec-WebSocket-Accept","sec-websocket-extensions":"Sec-WebSocket-Extensions","sec-webSocket-key":"Sec-WebSocket-Key","sec-webSocket-protocol":"Sec-WebSocket-Protocol","sec-webSocket-version":"Sec-WebSocket-Version",slug:"SLUG",tcn:"TCN",te:"TE",ttl:"TTL","www-authenticate":"WWW-Authenticate","x-att-deviceid":"X-ATT-DeviceId","x-dnsprefetch-control":"X-DNSPrefetch-Control","x-uidh":"X-UIDH"},Z=(e,o)=>{let t=e.toLowerCase();return o?q[t]?q[t]:t.split("-").map(r=>r[0]?.toUpperCase()+r.slice(1)).join("-"):t},B={canonical:false,normalizeHeaderKey:Z},G=e=>{let o={...B,...e};return async(t,r,n)=>{let a={},s={};return Object.keys(t.headers).forEach(i=>{a[i]=t.headers[i];let d=o.normalizeHeaderKey(i,o.canonical);d&&(s[d]=t.headers[i]);}),t.headers=s,t.rawHeaders=a,n()}},E=G;var _=e=>{if(typeof e!="string")return false;try{let o=JSON.parse(e),t=Object.prototype.toString.call(o);return t==="[object Object]"||t==="[object Array]"}catch{return false}},w=_;var Q=e=>toXML(e,{header:true,indent:" "}),g=Q;var x="Content-Type",ee=(e,o,t,r,n)=>{if(typeof t.getHeader(x)=="string")return r;let i=[...Y(o).types(),n.defaultContentType],d=r,b$1=false;return i.forEach(m=>{e.forEach(({regex:k,serializer:L})=>{k.test(m)&&(t.setHeader(x,m),d=L(d),b$1=true);}),b$1||(/yaml|yml/.test(m)?(t.setHeader(x,m),d=b(w(r)?JSON.parse(r):r)):m.includes("xml")&&(t.setHeader(x,m),d=g({[a(`${o.url?.replace("/api/","")}`.trim())]:w(r)?JSON.parse(r):r})));}),d},f=ee;var re=te("api-platform:connect:serializers-middleware"),oe=(e=[],o="application/json; charset=utf-8")=>async(t,r,n)=>{if(typeof r.send=="function"){let a=r.send;r.send=s=>{r.send=a,s=f(e,t,r,s,{defaultContentType:o}),r.send(s);};}else if(typeof r.json=="function")re("response.json() is not supported by @visulima/api-platform serializer. Use response.send() or response.end() instead.");else {let a=r.end;r.end=(s,...i)=>(r.end=a,s=f(e,t,r,s,{defaultContentType:o}),r.end(s,...i));}return n()},N=oe;var ne=(e={})=>new NodeRouter({onError:H(e.errorHandlers??[],e.showTrace??false),onNoMatch:S}).use(E(e.middlewares?.["http-header-normalizer"]??{})).use(N(e.middlewares?.serializers?.serializers??[],e.middlewares?.serializers?.defaultContentType??"application/json; charset=utf-8")),ae=ne;var pe=e=>expressWrapper(de(e)),le=pe;var ce=e=>e.ip??e.headers["x-forwarded-for"]??e.headers["x-real-ip"]??e.socket.remoteAddress,me=(e,o)=>async(t,r,n)=>{let a=ce(t);if(a===void 0)throw P(400,"Missing IP");try{let s=await e.consume(a),i={"Retry-After":Math.round(s.msBeforeNext/1e3)||1,"X-RateLimit-Remaining":s.remainingPoints,"X-RateLimit-Reset":new Date(Date.now()+s.msBeforeNext).toISOString(),...o};Object.keys(i).forEach(d=>{r.setHeader(d,i[d]);}),await n();}catch{throw P(429,"Too Many Requests")}},fe=me;
|
|
2
2
|
export{le as corsMiddleware,ae as createNodeRouter,E as httpHeaderNormalizerMiddleware,H as onError,S as onNoMatch,fe as rateLimiterMiddleware,f as serialize,N as serializersMiddleware,g as xmlTransformer};//# sourceMappingURL=index-server.mjs.map
|
|
3
3
|
//# sourceMappingURL=index-server.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/api-platform",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.5",
|
|
4
4
|
"description": "Visulima API platform is a set of tools to build and consume web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -125,15 +125,15 @@
|
|
|
125
125
|
"LICENSE.md"
|
|
126
126
|
],
|
|
127
127
|
"dependencies": {
|
|
128
|
-
"@visulima/connect": "4.0.0-alpha.
|
|
129
|
-
"@visulima/fs": "5.0.0-alpha.
|
|
130
|
-
"@visulima/jsdoc-open-api": "3.0.0-alpha.
|
|
131
|
-
"@visulima/path": "3.0.0-alpha.
|
|
128
|
+
"@visulima/connect": "4.0.0-alpha.5",
|
|
129
|
+
"@visulima/fs": "5.0.0-alpha.4",
|
|
130
|
+
"@visulima/jsdoc-open-api": "3.0.0-alpha.4",
|
|
131
|
+
"@visulima/path": "3.0.0-alpha.5",
|
|
132
132
|
"accepts": "^1.3.8",
|
|
133
133
|
"debug": "^4.4.3",
|
|
134
134
|
"http-errors": "^2.0.1",
|
|
135
135
|
"http-status-codes": "^2.3.0",
|
|
136
|
-
"jstoxml": "^7.0
|
|
136
|
+
"jstoxml": "^7.1.0",
|
|
137
137
|
"lodash.merge": "^4.6.2",
|
|
138
138
|
"schema-dts": "^1.1.5",
|
|
139
139
|
"ts-japi": "^1.12.1",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"peerDependencies": {
|
|
144
144
|
"@hapi/hapi": "^21.4.3",
|
|
145
145
|
"@koa/router": "^12.0.1",
|
|
146
|
-
"@visulima/crud": "3.0.0-alpha.
|
|
146
|
+
"@visulima/crud": "3.0.0-alpha.6",
|
|
147
147
|
"chalk": "5.6.2",
|
|
148
148
|
"commander": "^12.1.0",
|
|
149
149
|
"cors": "^2.8.5",
|