@visulima/api-platform 2.0.12 → 2.0.14

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 (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{chunk-4D6JZ4TL.js → chunk-3XT5P2HO.js} +1 -1
  3. package/dist/{chunk-XIJ2ZQRX.mjs → chunk-HTAA47WA.mjs} +1 -1
  4. package/dist/{chunk-LMQRJM6U.mjs → chunk-MP2YXEO2.mjs} +2 -2
  5. package/dist/{chunk-A2BEEKWN.js → chunk-XW6G4X7P.js} +3 -3
  6. package/dist/framework/cli/commander/index.js +1 -1
  7. package/dist/framework/cli/commander/index.mjs +1 -1
  8. package/dist/framework/cli/index.js +1 -1
  9. package/dist/framework/cli/index.mjs +1 -1
  10. package/dist/framework/next/index-browser.js +1 -1
  11. package/dist/framework/next/index-browser.mjs +1 -1
  12. package/dist/framework/next/index-server.d.mts +1 -1
  13. package/dist/framework/next/index-server.d.ts +1 -1
  14. package/dist/framework/next/index-server.js +1 -1
  15. package/dist/framework/next/index-server.mjs +1 -1
  16. package/dist/framework/next/routes/pages/redoc/index.d.ts +1 -1
  17. package/dist/framework/next/routes/pages/redoc/index.js +3 -1
  18. package/dist/framework/next/routes/pages/redoc/index.mjs +1 -1
  19. package/dist/framework/next/routes/pages/swagger/index.d.ts +1 -1
  20. package/dist/framework/next/routes/pages/swagger/index.js +3 -1
  21. package/dist/framework/next/routes/pages/swagger/index.mjs +1 -1
  22. package/dist/{index-browser-48644724.d.ts → index-browser-siaokSlR.d.mts} +1 -4
  23. package/dist/index-browser-siaokSlR.d.ts +30 -0
  24. package/dist/index-browser.d.mts +1 -1
  25. package/dist/index-browser.d.ts +1 -1
  26. package/dist/index-browser.js +3 -3
  27. package/dist/index-browser.mjs +2 -2
  28. package/dist/index-server.d.mts +3 -3
  29. package/dist/index-server.d.ts +3 -3
  30. package/dist/index-server.js +5 -5
  31. package/dist/index-server.mjs +2 -2
  32. package/dist/{swagger-handler-1f05481b.d.ts → swagger-handler-8nZe5uiR.d.mts} +1 -1
  33. package/dist/swagger-handler-8nZe5uiR.d.ts +17 -0
  34. package/package.json +22 -20
  35. /package/dist/{chunk-4D6JZ4TL.js.map → chunk-3XT5P2HO.js.map} +0 -0
  36. /package/dist/{chunk-XIJ2ZQRX.mjs.map → chunk-HTAA47WA.mjs.map} +0 -0
  37. /package/dist/{chunk-LMQRJM6U.mjs.map → chunk-MP2YXEO2.mjs.map} +0 -0
  38. /package/dist/{chunk-A2BEEKWN.js.map → chunk-XW6G4X7P.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## @visulima/api-platform [2.0.14](https://github.com/visulima/visulima/compare/@visulima/api-platform@2.0.13...@visulima/api-platform@2.0.14) (2023-12-06)
2
+
3
+
4
+
5
+ ### Dependencies
6
+
7
+ * **@visulima/connect:** upgraded to 2.1.11
8
+
9
+ ## @visulima/api-platform [2.0.13](https://github.com/visulima/visulima/compare/@visulima/api-platform@2.0.12...@visulima/api-platform@2.0.13) (2023-11-30)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * updated dep versions ([ed70375](https://github.com/visulima/visulima/commit/ed7037584477dbda4a8a6405a1104876e8a6c703))
15
+
16
+
17
+
18
+ ### Dependencies
19
+
20
+ * **@visulima/connect:** upgraded to 2.1.10
21
+ * **@visulima/jsdoc-open-api:** upgraded to 2.0.11
22
+ * **@visulima/crud:** upgraded to 2.0.10
23
+ * **@visulima/readdir:** upgraded to 2.0.10
24
+
1
25
  ## @visulima/api-platform [2.0.12](https://github.com/visulima/visulima/compare/@visulima/api-platform@2.0.11...@visulima/api-platform@2.0.12) (2023-11-30)
2
26
 
3
27
 
@@ -4,4 +4,4 @@ var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumera
4
4
 
5
5
  exports.a = e;
6
6
  //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-4D6JZ4TL.js.map
7
+ //# sourceMappingURL=chunk-3XT5P2HO.js.map
@@ -2,4 +2,4 @@ var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumera
2
2
 
3
3
  export { e as a };
4
4
  //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-XIJ2ZQRX.mjs.map
5
+ //# sourceMappingURL=chunk-HTAA47WA.mjs.map
@@ -1,4 +1,4 @@
1
- import { a } from './chunk-XIJ2ZQRX.mjs';
1
+ import { a } from './chunk-HTAA47WA.mjs';
2
2
  import { withGetType } from 'zod-to-ts';
3
3
  import { ZodType, ZodParsedType, addIssueToContext, ZodIssueCode, INVALID } from 'zod';
4
4
 
@@ -6,4 +6,4 @@ var l={};a(l,{dateIn:()=>O,dateOut:()=>z});var P="ZodDateIn",v=/^\d{4}-\d{2}-\d{
6
6
 
7
7
  export { O as a, z as b, l as c };
8
8
  //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-LMQRJM6U.mjs.map
9
+ //# sourceMappingURL=chunk-MP2YXEO2.mjs.map
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk4D6JZ4TL_js = require('./chunk-4D6JZ4TL.js');
3
+ var chunk3XT5P2HO_js = require('./chunk-3XT5P2HO.js');
4
4
  var zodToTs = require('zod-to-ts');
5
5
  var zod = require('zod');
6
6
 
7
- var Z={};chunk4D6JZ4TL_js.a(Z,{dateIn:()=>w,dateOut:()=>O});var N="ZodDateIn",P=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?)?Z?$/,d=class d extends zod.ZodType{_parse(t){let{ctx:e,status:a}=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;P.test(e.data)||(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_string,validation:"regex"}),a.dirty());let u=new Date(e.data);return Number.isNaN(u.getTime())?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_date}),zod.INVALID):{status:a.value,value:u}}};d.create=()=>new d({typeName:N});var r=d;var K="ZodDateOut",s=class s extends zod.ZodType{_parse(t){let{ctx:e,status:a}=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:a.value,value:e.data.toISOString()}}};s.create=()=>new s({typeName:K});var o=s;var w=(...n)=>zodToTs.withGetType(r.create(...n),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword)),O=(...n)=>zodToTs.withGetType(o.create(...n),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword));
7
+ var Z={};chunk3XT5P2HO_js.a(Z,{dateIn:()=>w,dateOut:()=>O});var N="ZodDateIn",P=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?)?Z?$/,d=class d extends zod.ZodType{_parse(t){let{ctx:e,status:a}=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;P.test(e.data)||(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_string,validation:"regex"}),a.dirty());let u=new Date(e.data);return Number.isNaN(u.getTime())?(zod.addIssueToContext(e,{code:zod.ZodIssueCode.invalid_date}),zod.INVALID):{status:a.value,value:u}}};d.create=()=>new d({typeName:N});var r=d;var K="ZodDateOut",s=class s extends zod.ZodType{_parse(t){let{ctx:e,status:a}=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:a.value,value:e.data.toISOString()}}};s.create=()=>new s({typeName:K});var o=s;var w=(...n)=>zodToTs.withGetType(r.create(...n),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword)),O=(...n)=>zodToTs.withGetType(o.create(...n),t=>t.factory.createKeywordTypeNode(t.SyntaxKind.StringKeyword));
8
8
 
9
9
  exports.a = w;
10
10
  exports.b = O;
11
11
  exports.c = Z;
12
12
  //# sourceMappingURL=out.js.map
13
- //# sourceMappingURL=chunk-A2BEEKWN.js.map
13
+ //# sourceMappingURL=chunk-XW6G4X7P.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkG343CC5Z_js = require('../../../chunk-G343CC5Z.js');
4
- require('../../../chunk-4D6JZ4TL.js');
4
+ require('../../../chunk-3XT5P2HO.js');
5
5
  var process = require('process');
6
6
 
7
7
  var p=(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.",!1).action(async e=>{try{await chunkG343CC5Z_js.a(e.framework,e.path,{excludePaths:e.excludePaths,group:e.group,includePaths:e.includePath,verbose:e.verbose});}catch(n){console.log(),console.error(n),process.exit(1);}});},d=p;
@@ -1,5 +1,5 @@
1
1
  import { a } from '../../../chunk-FFCKRGJ3.mjs';
2
- import '../../../chunk-XIJ2ZQRX.mjs';
2
+ import '../../../chunk-HTAA47WA.mjs';
3
3
  import { exit } from 'process';
4
4
 
5
5
  var d=(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.",!1).action(async e=>{try{await a(e.framework,e.path,{excludePaths:e.excludePaths,group:e.group,includePaths:e.includePath,verbose:e.verbose});}catch(n){console.log(),console.error(n),exit(1);}});},m=d;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkG343CC5Z_js = require('../../chunk-G343CC5Z.js');
4
- require('../../chunk-4D6JZ4TL.js');
4
+ require('../../chunk-3XT5P2HO.js');
5
5
 
6
6
 
7
7
 
@@ -1,4 +1,4 @@
1
1
  export { a as listCommand } from '../../chunk-FFCKRGJ3.mjs';
2
- import '../../chunk-XIJ2ZQRX.mjs';
2
+ import '../../chunk-HTAA47WA.mjs';
3
3
  //# sourceMappingURL=out.js.map
4
4
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkMYU5ZKUN_js = require('../../chunk-MYU5ZKUN.js');
4
- require('../../chunk-4D6JZ4TL.js');
4
+ require('../../chunk-3XT5P2HO.js');
5
5
 
6
6
 
7
7
 
@@ -1,4 +1,4 @@
1
1
  export { a as getSwaggerStaticProps } from '../../chunk-GI7VS3DY.mjs';
2
- import '../../chunk-XIJ2ZQRX.mjs';
2
+ import '../../chunk-HTAA47WA.mjs';
3
3
  //# sourceMappingURL=out.js.map
4
4
  //# 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-1f05481b.js';
2
+ import { S as SwaggerHandlerOptions } from '../../swagger-handler-8nZe5uiR.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-1f05481b.js';
2
+ import { S as SwaggerHandlerOptions } from '../../swagger-handler-8nZe5uiR.js';
3
3
  import { BaseDefinition } from '@visulima/jsdoc-open-api';
4
4
  import { NextConfig } from 'next/types';
5
5
  import 'node:http';
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkNPG5BMQQ_js = require('../../chunk-NPG5BMQQ.js');
4
4
  var chunkMYU5ZKUN_js = require('../../chunk-MYU5ZKUN.js');
5
- require('../../chunk-4D6JZ4TL.js');
5
+ require('../../chunk-3XT5P2HO.js');
6
6
  var d = require('fs');
7
7
  var w = require('path');
8
8
  var jsdocOpenApi = require('@visulima/jsdoc-open-api');
@@ -1,6 +1,6 @@
1
1
  import { c } from '../../chunk-K5YEO46P.mjs';
2
2
  export { a as getSwaggerStaticProps } from '../../chunk-GI7VS3DY.mjs';
3
- import '../../chunk-XIJ2ZQRX.mjs';
3
+ import '../../chunk-HTAA47WA.mjs';
4
4
  import w from 'fs';
5
5
  import c$1 from 'path';
6
6
  import { SwaggerCompilerPlugin } from '@visulima/jsdoc-open-api';
@@ -5,4 +5,4 @@ declare const RedocApiDocument: (name: string, swagger?: Exclude<{
5
5
  specUrl?: string;
6
6
  }, "spec">) => NextPage<InferGetStaticPropsType<typeof getStaticProps>>;
7
7
 
8
- export { RedocApiDocument as default };
8
+ export = RedocApiDocument;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('../../../../../chunk-4D6JZ4TL.js');
3
+ require('../../../../../chunk-3XT5P2HO.js');
4
4
  var a = require('next/head');
5
5
  var redoc = require('redoc');
6
6
  var jsxRuntime = require('react/jsx-runtime');
@@ -17,4 +17,6 @@ body {
17
17
 
18
18
  module.exports = y;
19
19
  //# sourceMappingURL=out.js.map
20
+
21
+ module.exports = exports.default;
20
22
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import '../../../../../chunk-XIJ2ZQRX.mjs';
1
+ import '../../../../../chunk-HTAA47WA.mjs';
2
2
  import a from 'next/head';
3
3
  import { RedocStandalone } from 'redoc';
4
4
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -4,4 +4,4 @@ import { getSwaggerStaticProps as getStaticProps } from '../../../index-browser.
4
4
 
5
5
  declare const SwaggerApiDocument: (name: string, swagger?: Exclude<SwaggerUIProps, "spec">) => NextPage<InferGetStaticPropsType<typeof getStaticProps>>;
6
6
 
7
- export { SwaggerApiDocument as default };
7
+ export = SwaggerApiDocument;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('../../../../../chunk-4D6JZ4TL.js');
3
+ require('../../../../../chunk-3XT5P2HO.js');
4
4
  var o = require('next/dynamic');
5
5
  var s = require('next/head');
6
6
  var jsxRuntime = require('react/jsx-runtime');
@@ -18,4 +18,6 @@ body {
18
18
 
19
19
  module.exports = n;
20
20
  //# sourceMappingURL=out.js.map
21
+
22
+ module.exports = exports.default;
21
23
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import '../../../../../chunk-XIJ2ZQRX.mjs';
1
+ import '../../../../../chunk-HTAA47WA.mjs';
2
2
  import o from 'next/dynamic';
3
3
  import s from 'next/head';
4
4
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -24,10 +24,7 @@ declare const dateOut: () => ZodDateOut;
24
24
  declare const index_dateIn: typeof dateIn;
25
25
  declare const index_dateOut: typeof dateOut;
26
26
  declare namespace index {
27
- export {
28
- index_dateIn as dateIn,
29
- index_dateOut as dateOut,
30
- };
27
+ export { index_dateIn as dateIn, index_dateOut as dateOut };
31
28
  }
32
29
 
33
30
  export { dateOut as a, dateIn as d, index as i };
@@ -0,0 +1,30 @@
1
+ import { ZodType, ParseInput, ParseReturnType, ZodTypeDef } from 'zod';
2
+
3
+ declare const zodDateInKind = "ZodDateIn";
4
+ interface ZodDateInDef extends ZodTypeDef {
5
+ typeName: typeof zodDateInKind;
6
+ }
7
+ declare class ZodDateIn extends ZodType<Date, ZodDateInDef, string> {
8
+ static create: () => ZodDateIn;
9
+ _parse(input: ParseInput): ParseReturnType<Date>;
10
+ }
11
+
12
+ declare const zodDateOutKind = "ZodDateOut";
13
+ interface ZodDateOutDef extends ZodTypeDef {
14
+ typeName: typeof zodDateOutKind;
15
+ }
16
+ declare class ZodDateOut extends ZodType<string, ZodDateOutDef, Date> {
17
+ static create: () => ZodDateOut;
18
+ _parse(input: ParseInput): ParseReturnType<string>;
19
+ }
20
+
21
+ declare const dateIn: () => ZodDateIn;
22
+ declare const dateOut: () => ZodDateOut;
23
+
24
+ declare const index_dateIn: typeof dateIn;
25
+ declare const index_dateOut: typeof dateOut;
26
+ declare namespace index {
27
+ export { index_dateIn as dateIn, index_dateOut as dateOut };
28
+ }
29
+
30
+ export { dateOut as a, dateIn as d, index as i };
@@ -1,2 +1,2 @@
1
- export { i as zod } from './index-browser-48644724.js';
1
+ export { i as zod } from './index-browser-siaokSlR.mjs';
2
2
  import 'zod';
@@ -1,2 +1,2 @@
1
- export { i as zod } from './index-browser-48644724.js';
1
+ export { i as zod } from './index-browser-siaokSlR.js';
2
2
  import 'zod';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkA2BEEKWN_js = require('./chunk-A2BEEKWN.js');
4
- require('./chunk-4D6JZ4TL.js');
3
+ var chunkXW6G4X7P_js = require('./chunk-XW6G4X7P.js');
4
+ require('./chunk-3XT5P2HO.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, 'zod', {
9
9
  enumerable: true,
10
- get: function () { return chunkA2BEEKWN_js.c; }
10
+ get: function () { return chunkXW6G4X7P_js.c; }
11
11
  });
12
12
  //# sourceMappingURL=out.js.map
13
13
  //# sourceMappingURL=index-browser.js.map
@@ -1,4 +1,4 @@
1
- export { c as zod } from './chunk-LMQRJM6U.mjs';
2
- import './chunk-XIJ2ZQRX.mjs';
1
+ export { c as zod } from './chunk-MP2YXEO2.mjs';
2
+ import './chunk-HTAA47WA.mjs';
3
3
  //# sourceMappingURL=out.js.map
4
4
  //# sourceMappingURL=index-browser.mjs.map
@@ -7,8 +7,8 @@ export { EdgeRequestHandler, EdgeRouter, ExpressRequestHandler, FindResult, Func
7
7
  import { CorsOptions, CorsOptionsDelegate } from 'cors';
8
8
  import { NextApiResponse } from 'next/types';
9
9
  import { RateLimiterAbstract, RateLimiterRes } from 'rate-limiter-flexible';
10
- export { d as dateIn, a as dateOut, i as zod } from './index-browser-48644724.js';
11
- export { s as swaggerHandler } from './swagger-handler-1f05481b.js';
10
+ export { d as dateIn, a as dateOut, i as zod } from './index-browser-siaokSlR.mjs';
11
+ export { s as swaggerHandler } from './swagger-handler-8nZe5uiR.mjs';
12
12
  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';
13
13
  import '@visulima/crud';
14
14
  import 'openapi-types';
@@ -81,4 +81,4 @@ declare const rateLimiterMiddleware: (rateLimiter: RateLimiterAbstract, headers?
81
81
 
82
82
  declare const serializersMiddleware: (serializers?: Serializers, defaultContentType?: string) => <Request_1 extends IncomingMessage, Response_1 extends ServerResponse<IncomingMessage>>(request: Request_1, response: Response_1 | NextApiResponse, next: NextHandler) => Promise<ValueOrPromise<void>>;
83
83
 
84
- export { Serializer, Serializers, corsMiddleware, createNodeRouter, httpHeaderNormalizerMiddleware, onError, onNoMatch, rateLimiterMiddleware, serialize, serializersMiddleware, xmlTransformer, yamlTransformer };
84
+ export { type Serializer, type Serializers, corsMiddleware, createNodeRouter, httpHeaderNormalizerMiddleware, onError, onNoMatch, rateLimiterMiddleware, serialize, serializersMiddleware, xmlTransformer, yamlTransformer };
@@ -7,8 +7,8 @@ export { EdgeRequestHandler, EdgeRouter, ExpressRequestHandler, FindResult, Func
7
7
  import { CorsOptions, CorsOptionsDelegate } from 'cors';
8
8
  import { NextApiResponse } from 'next/types';
9
9
  import { RateLimiterAbstract, RateLimiterRes } from 'rate-limiter-flexible';
10
- export { d as dateIn, a as dateOut, i as zod } from './index-browser-48644724.js';
11
- export { s as swaggerHandler } from './swagger-handler-1f05481b.js';
10
+ export { d as dateIn, a as dateOut, i as zod } from './index-browser-siaokSlR.js';
11
+ export { s as swaggerHandler } from './swagger-handler-8nZe5uiR.js';
12
12
  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';
13
13
  import '@visulima/crud';
14
14
  import 'openapi-types';
@@ -81,4 +81,4 @@ declare const rateLimiterMiddleware: (rateLimiter: RateLimiterAbstract, headers?
81
81
 
82
82
  declare const serializersMiddleware: (serializers?: Serializers, defaultContentType?: string) => <Request_1 extends IncomingMessage, Response_1 extends ServerResponse<IncomingMessage>>(request: Request_1, response: Response_1 | NextApiResponse, next: NextHandler) => Promise<ValueOrPromise<void>>;
83
83
 
84
- export { Serializer, Serializers, corsMiddleware, createNodeRouter, httpHeaderNormalizerMiddleware, onError, onNoMatch, rateLimiterMiddleware, serialize, serializersMiddleware, xmlTransformer, yamlTransformer };
84
+ export { type Serializer, type Serializers, corsMiddleware, createNodeRouter, httpHeaderNormalizerMiddleware, onError, onNoMatch, rateLimiterMiddleware, serialize, serializersMiddleware, xmlTransformer, yamlTransformer };
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkA2BEEKWN_js = require('./chunk-A2BEEKWN.js');
3
+ var chunkXW6G4X7P_js = require('./chunk-XW6G4X7P.js');
4
4
  var chunkNPG5BMQQ_js = require('./chunk-NPG5BMQQ.js');
5
- require('./chunk-4D6JZ4TL.js');
5
+ require('./chunk-3XT5P2HO.js');
6
6
  var connect = require('@visulima/connect');
7
7
  var q = require('http-errors');
8
8
  var httpStatusCodes = require('http-status-codes');
@@ -24,15 +24,15 @@ var u=(e,o)=>{let t=o.headers??{};Object.keys(t).forEach(r=>{e.setHeader(r,t[r])
24
24
 
25
25
  Object.defineProperty(exports, 'dateIn', {
26
26
  enumerable: true,
27
- get: function () { return chunkA2BEEKWN_js.a; }
27
+ get: function () { return chunkXW6G4X7P_js.a; }
28
28
  });
29
29
  Object.defineProperty(exports, 'dateOut', {
30
30
  enumerable: true,
31
- get: function () { return chunkA2BEEKWN_js.b; }
31
+ get: function () { return chunkXW6G4X7P_js.b; }
32
32
  });
33
33
  Object.defineProperty(exports, 'zod', {
34
34
  enumerable: true,
35
- get: function () { return chunkA2BEEKWN_js.c; }
35
+ get: function () { return chunkXW6G4X7P_js.c; }
36
36
  });
37
37
  Object.defineProperty(exports, 'swaggerHandler', {
38
38
  enumerable: true,
@@ -1,7 +1,7 @@
1
- export { a as dateIn, b as dateOut, c as zod } from './chunk-LMQRJM6U.mjs';
1
+ export { a as dateIn, b as dateOut, c as zod } from './chunk-MP2YXEO2.mjs';
2
2
  import { b, a } from './chunk-K5YEO46P.mjs';
3
3
  export { c as swaggerHandler, b as yamlTransformer } from './chunk-K5YEO46P.mjs';
4
- import './chunk-XIJ2ZQRX.mjs';
4
+ import './chunk-HTAA47WA.mjs';
5
5
  import { NodeRouter, expressWrapper } from '@visulima/connect';
6
6
  export { EdgeRouter, NodeRouter, Router, createEdgeRouter, expressWrapper, sendJson, withZod } from '@visulima/connect';
7
7
  import P, { HttpError } from 'http-errors';
@@ -14,4 +14,4 @@ interface SwaggerHandlerOptions<M extends string, PrismaClient> {
14
14
  swaggerFilePath: string;
15
15
  }
16
16
 
17
- export { SwaggerHandlerOptions as S, swaggerHandler as s };
17
+ export { type SwaggerHandlerOptions as S, swaggerHandler as s };
@@ -0,0 +1,17 @@
1
+ import { IncomingMessage, ServerResponse } from 'node:http';
2
+ import { ModelsToOpenApiParameters, SwaggerModelsConfig } from '@visulima/crud';
3
+ import { OpenAPIV3 } from 'openapi-types';
4
+
5
+ declare const swaggerHandler: <M extends string, PrismaClient>(options?: Partial<SwaggerHandlerOptions<M, PrismaClient>>) => (request: IncomingMessage, response: ServerResponse) => Promise<void>;
6
+ interface SwaggerHandlerOptions<M extends string, PrismaClient> {
7
+ allowedMediaTypes: Record<string, boolean>;
8
+ crud: Exclude<ModelsToOpenApiParameters<M, PrismaClient>, "swagger"> & {
9
+ swagger?: {
10
+ models?: SwaggerModelsConfig<M>;
11
+ };
12
+ };
13
+ specs?: Partial<OpenAPIV3.Document>[];
14
+ swaggerFilePath: string;
15
+ }
16
+
17
+ export { type SwaggerHandlerOptions as S, swaggerHandler as s };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/api-platform",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "Visulima API platform is a set of tools to build and consume web APIs",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -129,7 +129,6 @@
129
129
  "build": "rimraf dist && cross-env NODE_ENV=development tsup",
130
130
  "build:prod": "rimraf dist && cross-env NODE_ENV=production tsup",
131
131
  "clean": "rimraf node_modules dist .eslintcache",
132
- "coverage": "vitest run --coverage",
133
132
  "dev": "pnpm run build --watch",
134
133
  "lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.js",
135
134
  "lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.js --fix",
@@ -138,11 +137,13 @@
138
137
  "lint:prettier:fix": "prettier --config=.prettierrc.js --write .",
139
138
  "lint:types": "tsc --noEmit --project tsconfig.json",
140
139
  "test": "vitest run",
140
+ "test:coverage": "vitest run --coverage",
141
+ "test:ui": "vitest --ui --coverage.enabled=true",
141
142
  "test:watch": "vitest"
142
143
  },
143
144
  "dependencies": {
144
- "@visulima/connect": "2.1.9",
145
- "@visulima/jsdoc-open-api": "2.0.10",
145
+ "@visulima/connect": "2.1.11",
146
+ "@visulima/jsdoc-open-api": "2.0.11",
146
147
  "accepts": "^1.3.8",
147
148
  "debug": "^4.3.4",
148
149
  "http-errors": "^2.0.0",
@@ -158,11 +159,11 @@
158
159
  "@anolilab/eslint-config": "^15.0.2",
159
160
  "@anolilab/prettier-config": "^5.0.13",
160
161
  "@anolilab/semantic-release-preset": "^8.0.2",
161
- "@arthurgeron/eslint-plugin-react-usememo": "^2.1.4",
162
- "@babel/core": "^7.23.3",
162
+ "@arthurgeron/eslint-plugin-react-usememo": "^2.2.1",
163
+ "@babel/core": "^7.23.5",
163
164
  "@hapi/hapi": "^21.3.2",
164
165
  "@koa/router": "^12.0.1",
165
- "@secretlint/secretlint-rule-preset-recommend": "^7.2.0",
166
+ "@secretlint/secretlint-rule-preset-recommend": "^8.0.0",
166
167
  "@testing-library/react": "^14.1.2",
167
168
  "@total-typescript/ts-reset": "^0.5.1",
168
169
  "@types/accepts": "^1.3.7",
@@ -178,19 +179,20 @@
178
179
  "@types/lodash.set": "^4.3.9",
179
180
  "@types/node": "18.18.8",
180
181
  "@types/qs": "^6.9.10",
181
- "@types/react": "^18.2.39",
182
+ "@types/react": "^18.2.42",
182
183
  "@types/react-dom": "^18.2.17",
183
184
  "@types/swagger-ui-react": "^4.18.2",
184
185
  "@types/webpack": "^5.28.5",
185
- "@visulima/crud": "2.0.9",
186
- "@visulima/readdir": "2.0.9",
187
- "@vitest/coverage-v8": "^0.34.6",
186
+ "@visulima/crud": "2.0.10",
187
+ "@visulima/readdir": "2.0.10",
188
+ "@vitest/coverage-v8": "^1.0.1",
189
+ "@vitest/ui": "^1.0.1",
188
190
  "chalk": "5.3.0",
189
191
  "commander": "^11.1.0",
190
- "core-js": "^3.33.3",
192
+ "core-js": "^3.34.0",
191
193
  "cors": "^2.8.5",
192
194
  "cross-env": "^7.0.3",
193
- "eslint": "^8.54.0",
195
+ "eslint": "^8.55.0",
194
196
  "eslint-plugin-deprecation": "^2.0.0",
195
197
  "eslint-plugin-etc": "^2.0.3",
196
198
  "eslint-plugin-import": "npm:eslint-plugin-i@^2.29.0",
@@ -218,29 +220,29 @@
218
220
  "react-dom": "^18.2.0",
219
221
  "redoc": "^2.1.3",
220
222
  "rimraf": "^5.0.5",
221
- "secretlint": "7.2.0",
222
- "semantic-release": "^22.0.8",
223
+ "secretlint": "8.0.0",
224
+ "semantic-release": "^22.0.9",
223
225
  "sort-package-json": "^2.6.0",
224
226
  "styled-components": "^6.1.1",
225
227
  "swagger-ui-dist": "^4.19.1",
226
228
  "swagger-ui-react": "^4.19.1",
227
229
  "tsup": "^8.0.1",
228
- "type-fest": "^4.8.2",
230
+ "type-fest": "^4.8.3",
229
231
  "typescript": "^5.3.2",
230
- "vitest": "^0.34.6",
232
+ "vitest": "^1.0.1",
231
233
  "webpack": "^5.89.0",
232
234
  "zod": "^3.22.4"
233
235
  },
234
236
  "peerDependencies": {
235
237
  "react": "^18.2.0",
236
238
  "react-dom": "^18.2.0",
237
- "zod": "^3.19.1"
239
+ "zod": "^3.22.4"
238
240
  },
239
241
  "optionalDependencies": {
240
242
  "@hapi/hapi": "^21.3.2",
241
243
  "@koa/router": "^12.0.1",
242
- "@visulima/crud": "2.0.9",
243
- "@visulima/readdir": "2.0.9",
244
+ "@visulima/crud": "2.0.10",
245
+ "@visulima/readdir": "2.0.10",
244
246
  "chalk": "5.3.0",
245
247
  "commander": "^11.1.0",
246
248
  "cors": "^2.8.5",