{"_id":"@appandflow/s-express","_rev":"41-c45d6f053e0267daf610c429ab63a18a","name":"@appandflow/s-express","dist-tags":{"latest":"1.1.0-beta.23","beta":"1.1.0-beta.27"},"versions":{"1.0.0":{"name":"@appandflow/s-express","version":"1.0.0","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.0","maintainers":[{"name":"valium","email":"vincent@appandflow.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"}],"dist":{"shasum":"00f53f2bd025a8748b40be60968c056857a6292c","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.0.tgz","fileCount":20,"integrity":"sha512-ADuv08NS8eN7wSW1zIgV6XljlnT6rNwgW/lX19GXTdaHPbHBGYGSWyeJ4AXb4motTEsVzgFneRwN5Ex1hErp8w==","signatures":[{"sig":"MEQCIBKjw18givYRSfINQod2BSURXdqt5l4U+QGJnquqY1mCAiBhD9aC91v+99A+LL1I7ZKarxIrdJIX40/4mj5RGntumA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjxocCRA9TVsSAnZWagAA3wgQAKFpZ65uZvloZQeFEHpq\nr67H9EZlDYfB4uTbsv0LOEKqm8CF8bzPQev84qLNWSupFlvAstxlPcXrxCuI\n3d6DkKMPPJE+TWmfmonbx9SPbPErA88FKCIIvHZbWD2sIhngTfBzb2DAyT7/\neElgUgsX8WpmKADpm43Ycl0cr6Naf0doOx7cGS0Sn2o/Pse78mz/VjuWKHfv\nekMHvns3YDhmxg7BkBLrtOhjTfA2mFL06nk8huDC4N+ZNDOU380BaFdN009+\nXhXDLdrI0W4Z5dch8Qe4Ug4RejM+3koCBs0FLTqiJIDVMi6QaO9T+7R2DTLB\nzEhL5ohqgaTEUSGcElx556tS90V1WDw5xiEyFYlzy9vZ5Sv19E/Qc17eXZwH\nyo4/YeXrzwIa1cSjOY3g2Ws/lHqs2oXS2K0nSDNP+XnVHYW5YVLkYx4n1L66\nNwMLCSHWui8wHJ5Q3v8CrK6NTYrW2KNZleJ4T+J+2oK7C8a/xMb72x/wOFih\nuAvIJF5VaWxGZinuVdKU4H1IVO3RrYmpJfBrw/bA2+CiQWfji8RUe0K606gx\nu/nreZZfh6LHwJAI4Vx08+U33QpG3JwyS2oOMc50PsGVKVkJfM3lA3qm2J/V\nBsQbwkCJ3KMtUUygVoB/qtPaeDBHPlgYCMJHsS+16/al2N+Xt0zrZY3iwx5A\nLJAC\r\n=gteF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"7c262a36108eb977c5ff8b834f80ab045aca05a2","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"_npmVersion":"6.14.5","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"14.5.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.0_1603213851606_0.24971487872600218","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@appandflow/s-express","version":"1.0.1","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.1","maintainers":[{"name":"valium","email":"vincent@appandflow.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"33bd4c86ee066f6af69b65265ec5d9112bc22e95","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.1.tgz","fileCount":20,"integrity":"sha512-lb6n0rVe33Vc8uoEi2zIrs/GFhsZshJxl1nNgxGsaPDat9TFJafCxD7mwWWw7PSVFCNBUYyMaY02OuDTrtuxXQ==","signatures":[{"sig":"MEYCIQCzJm3dU5/Nr3Eb50JzRGa5lH8Zx+NVf95yAOLJy1W4/AIhALhJCdSZ6HqmH9H8qGcH71NDNgJDkYugzeojSRLawN3y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjxtGCRA9TVsSAnZWagAA2F0P/0RtLC10A184Vd3pe9i1\nbC0GjZa3f8eH+Oa4yJT74d0ySOLl3mcR7nm2+zHBFzOdfCbIIwfsihlJDNYF\nH93E2QrOHVQKHydjlIyqSkp63HAs1NPCahMSQHtq7RFaxU3zrRtcoSv41GRp\nnqJCWj0qyX15TsLroHytLOoiGpeJ10QDzzzK2oJvKa5PuM+GRGp/HWnfb+Iw\nu5kPBqgDkZKP1v4qULMeCR8zh+C1Dybec+W5zf6YRfVkrV+lZovzEwyiEcIK\n1pn7/1dnVCEe7alyFFxYe9W36/bZDq6zZA+feuU9DwpZ7MVb0nG7Xjrk0/E1\nTSwEeD+d3Z91XsypJiZc8ibadWkiqg8OeIvC60Np7Nh2I4/7H3pXpGr1rCd8\ngwKb7xllJTi/70CsGafvSer3aTCP6EEhWlyWH3vjPMUXqmmJG1m2oFisZWWJ\n3oDsGuUpBoYYEPdRP08ZtmZDQZFMhWuunJ/HVMrzCE2nmaJJeAgOrC8nHqWC\n0DdGVZty9mtxu7rEHyr/vLmCTi3vyhd/+jqXDq3Gov9DT25FuyI51q3ijOeo\ntx1Wx+XYqwBoKTZZuGHncPfeZE2kKbF8fAC+zEOPyu3apWhvxHcqXGIE+qqy\nI3g78yXSYMyOO8pLWIjxUcYb8TOPuYcFiwMe31HaTCq+19oYIiCspQL/JOlR\nRCSp\r\n=fqhx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"f72283335415db9750c401bf419b3adc70766f84","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"6.14.5","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"14.5.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.1_1603214150128_0.5015775733163879","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@appandflow/s-express","version":"1.0.2","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.2","maintainers":[{"name":"valium","email":"vincent@appandflow.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"f1d928e4836e24e1ea35477edeb53406d5d667f2","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.2.tgz","fileCount":20,"integrity":"sha512-fRn7aoxER+Yhs/QNwQDzCJbGQ2vs5N5WMbsVlLfRBv5XOUSfkajeNj82N1YAhxSFuY7H1qzQRVhLjJ4xAMSq6A==","signatures":[{"sig":"MEUCIQC4b3Qc+Ovi4+Y5mFFaSc+6PhX1/lmAvs5JNMZYtQXpkAIgTjtV1kzg5yc7nct7an/EElAm3mSlMZb/+TN5AdkCy18=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm5MWCRA9TVsSAnZWagAAy24P/RkaKsYGvL0Ilib/LxEv\ngJtVVjzb1TaHhUW8hOJexqF8qD8SM9rl5toB0a4FuHe62qv3NKpFxlgM7uFE\n3v6waNkqoDomR10Aq0k9dubNdnrz7v+YXjczFAdTOWb+8tObEnNTVskVOpuq\nS7R7aX2kun5G2RxNvlaralrTRkPYQCuF9fJxXfyme96keMtEaLJdT7BTIoh4\njj4po1FVk0sJvupnExRZCrQ1SlGJ4rDidHa4WMiItNr29PRR/PnG1oABiNem\n71V3mQ1CcU1Q5bvnN1d6H36Pj3TpKCv+pnz3X9g7L+ANERNkPQHzx6kV2xAY\nJTCn7NewLcpK+UHacl3AEktzrxC6aOMOuovZTpmf80lt7QJatRQEs0W8qO35\nA5opbAPeY6AKEo/wWxpXbC90n6G63x8p4El8Fe789fZJAL3/CHtlSGi1Pp8F\nwHCPe8AKvUPMjE0H0wWV3BP7BtWn1NpPJri4vLT2wSH5+z0CmDHsb6pvhTsk\nIEIiqpZ0VUVBKh2NzmGgjVSI4KvBkic/Gh/GYvYvtaJempSvt8VLNSiXRZc1\nDbVr5BU8jcfUSraOhIGAbOs7IRJLA2MZUix4E0Xl197lCkOiTcfuKb/iDkTI\ncK7rZgiXaAiZGH4qjlTQhGyUhe15b1tRgr+/+Z1j/DODMCvd8YeVfZ+HP9tI\nqjHr\r\n=9z5Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"d9fb031722b6345c5a9e048147765c5af919ccf6","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"6.14.5","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"14.5.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.2_1604031254110_0.3911625349834644","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@appandflow/s-express","version":"1.0.3","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.3","maintainers":[{"name":"valium","email":"vincent@appandflow.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"38410444908e16f44b14afff69b0b13aa3e80d51","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.3.tgz","fileCount":20,"integrity":"sha512-ytr+GeNwjwCJyH8c1d4zQVcPmy6QirryPgP9ZW1MTIPtolOswaibmMV7EgtCUsLkrXwseBY4MtNpy/r2BjM5EQ==","signatures":[{"sig":"MEUCIQCa1NeS1ihUGYxuCNeAfyBtDCzieLIV0Iw2MnYZ4UXd9QIgd/TEOY4dwsp2mMncyHwgyLx0VNQzUNRpQUa719gxyxc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfm5U8CRA9TVsSAnZWagAANDAP/3mzxFDbZsThFpo5cTZT\nbB03uYik7R/T9smEA2VWMLSMN0gCNPLkUM69nTx6XYw/zGOjejOnbh2eGiFG\n9j2WLV3ctC7IcjARRG1CxzXnztcal0GyEK7lyuzcIvh8uREtPd/e3dko+YZG\neR8yv6CLgWdCiDIvIBvj3guJvXtKT7g2z+glEOgQOfe4Qrr9z8omWsSEPhSl\n2hxedrAMqMapUYfsC4iN8nNAqFi0CXO4uWVRmrMXSkceMOxwikm2jqNaYoj0\nJ1cjigvQBqtOTbnqdNKsPJLzNE6VAPH0soL/kQ4/H0YOMKLeeDErowBZHOen\nT00Dqqs5hTpQWpwRFrks31e+W6OdxQzVvnIU/natZ/LsNr8p4F/4zHIeLtJP\n0/l2/qoSZzxxGrPzFseiYZykq8FeLN5/ohuD/cuMMGgvEL5Hc3IIBpcq2nCv\ntYKtd5hmMRDTnumqkdRew2sxrGpFtp7YytCvXRYjGxxOifVH0lRSCLdEAjO6\nfntj4zUPRYxYkfHtvgSf7j6N15WEYHPWOCop4x3ZKlzdSRZpPYyh6WyGXY4M\n+u+NjDa958BUn/7+GZz5syCJXMT4ob20Ie+djrs80ETB/8h5T472NvHSgLfA\nWYj/Cq4+1Zza8nn/HeH2zFVPJ2JWy9qxF8Zoky6RQaEsRccYOFUpHRgIAFq6\nW3lP\r\n=YH7h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"d9fb031722b6345c5a9e048147765c5af919ccf6","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"6.14.5","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"14.5.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.3_1604031804115_0.18710559803190074","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@appandflow/s-express","version":"1.0.4","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.4","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"0d5918e60126ae058cc389e91127cc49054efb9e","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.4.tgz","fileCount":20,"integrity":"sha512-ZPjPc/wf0BElRoEMqUjBu4s9L412oM1/Hn8d8HDXFvYEzOmxGrWUA+kr/ukOej/zIMHSbcMxiBFZNDh+CmvsGg==","signatures":[{"sig":"MEYCIQCq17lbiuVy7WWw/YmvkKPfI8ZBHv8Tvmhqpsoty69v6gIhAPzLilUCIoTljjAZA0ZtH+y99Yku4kUog6dUve+afSBy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33146},"main":"dist/index.js","gitHead":"4c8ae542daf54fd5f4e079b65c1f0bb8db6f2b1a","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"7.0.14","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"15.3.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.4_1632184024256_0.6191580256452676","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@appandflow/s-express","version":"1.0.5","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.5","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"a87c56e69446ec73f4d25a69f7cc15203c8f437c","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.5.tgz","fileCount":20,"integrity":"sha512-MsmHo9igltHHbaydHrpHSWVxpjOuRUKcOhje9P7bP9DhNvM6/PXpf4X5diF7I1CbLs1P4H6Fpsf3sSt7em9gAw==","signatures":[{"sig":"MEUCIA+1O/8akzoOmw8XK2sRV+DVmPOE7kCGAm4RV5+Ocl3/AiEAiO4MiirQG6mId+R5Y+VhprmMGkQ5cJcPS8sHAncTJf4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33168},"main":"dist/index.js","gitHead":"ceb082604bae68668618e7f3abba42fc1f355381","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"7.0.14","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"15.3.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.5_1632184749782_0.023859479475365486","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"@appandflow/s-express","version":"1.0.6","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.6","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"a59ebc2436202e8fb6371d575d25bfa36e950a56","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.6.tgz","fileCount":20,"integrity":"sha512-xddbRRIRxHVb3847T21cF9J8XYUWsNyI/czv8w4YvryNirY6A3FDAJFQB8gOj53SaQJsPp0FCizBOIQG9J7xig==","signatures":[{"sig":"MEYCIQDEGxqUug9CkVNQgLtLA780E9/HvBcmYk0BwlTATYhpqAIhALIuu19FuOL2xqQKr+xXYho7/WgGZhijSIiguHzt1b6X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33180},"main":"dist/index.js","gitHead":"04e475cc7d7285ccb575a109cd76f90cd037919e","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"7.0.14","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"15.3.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.6_1632354820482_0.43522808913127653","host":"s3://npm-registry-packages"}},"1.0.7":{"name":"@appandflow/s-express","version":"1.0.7","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.7","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"93a5fcadf93cf59eb53a2bf8752b8675f0a5c427","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.7.tgz","fileCount":20,"integrity":"sha512-ukWwALH1QZkAHVaaa64qk9cV2Hf58oax5o8iJPmt9CJk3BRBi45oi7a01k63xTkZQhJWMG5OVqvX9i6N2+DoZw==","signatures":[{"sig":"MEQCIEX5qWeqTok14fLdrw5Ix7X6odZB/hXEA6Wa0DNgSekrAiBQUu989zlY+YG+TL0PBngMUntaO4G3t81BNEUsHIF8hQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33184},"main":"dist/index.js","gitHead":"7b8f499ba194743a782e311d8b74dd77bbe24972","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.7_1636088535879_0.8188109185531363","host":"s3://npm-registry-packages"}},"1.0.8":{"name":"@appandflow/s-express","version":"1.0.8","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.8","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"6ae2f815e292ace11b816ae529e00ee0aa0e14ba","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.8.tgz","fileCount":20,"integrity":"sha512-Ll2ykDV+SSNvx6YBaF4nTEKaTNIFISbubloskKzKAQYKaXgoAcV7yZcV+v/y5sEezgSkydDgpFLHxyNSKexInw==","signatures":[{"sig":"MEQCICuOPH8utKLulDdKucZ/iDeFyWXA5YWpbCJShHZWsXQWAiAyBGZ4VAcirJY/wXRLtelN0qCYMcLXcffsYORU+oRHAA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33282},"main":"dist/index.js","gitHead":"820bdf187510a18ead0ec0662bd6830ced8bd414","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.8_1636444432315_0.4985730995115154","host":"s3://npm-registry-packages"}},"1.1.0-beta.0":{"name":"@appandflow/s-express","version":"1.1.0-beta.0","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.0","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"aa2006a616e9567cdf7169dbaa8bdde9dab03865","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.0.tgz","fileCount":34,"integrity":"sha512-N7thGgRvvWScrbP+7kOt9qHHhDGZ0alGitHL4J03D2s9MAi2o2GKd98S2MU99HhtDxCrbx3psHUllwdrLPUr4g==","signatures":[{"sig":"MEQCIBE6zgrwbSXwhYDXzcXfPuhQQxYCv2kTC12bRrqpfl6dAiAppakkv7OzxAgXNlGq7fW4YsctFWXVW7cLxE/B0Q1YSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60282},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"df854e89060aae2d24158a010dfff27d27f20fe9","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"klaw":"^1.3.1","eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.0_1636920429913_0.47712130001357544","host":"s3://npm-registry-packages"}},"1.1.0-beta.1":{"name":"@appandflow/s-express","version":"1.1.0-beta.1","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.1","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"c8ec8821a0464524b655eaf7bb873e704119c07b","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.1.tgz","fileCount":34,"integrity":"sha512-RPKbB/V3FR+UfL0vpZ9sCcGhGv8Ox5DmNs2AeARp09W3ENvrihPVWx1/Q4hS7L8o8X5oBF6oH2URdlqJ/u2VPg==","signatures":[{"sig":"MEYCIQCZXj98fjnh4zYFHpezinM4PMYLrktUWdAUTvKejW+U+gIhAMwgRKiZ6jDLfFbuRV8ArhrktXbitJ1Cb2dHH+brjJup","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60282},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"4828be685b420a936b90d66f6d2ac6515491d4ea","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.1_1636920769799_0.9068090184263999","host":"s3://npm-registry-packages"}},"1.1.0-beta.2":{"name":"@appandflow/s-express","version":"1.1.0-beta.2","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.2","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"5ce1195f7236dc1b2c6fd356ba52b1e69d1f5f13","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.2.tgz","fileCount":37,"integrity":"sha512-U3gUTaixVA6+EfQHiFLQ07VHEGcbD2YKx9814W0KXpqULZP7/hRsr8uArYub4L5zWDb5NNTyQYQlTQEvXfWgXA==","signatures":[{"sig":"MEYCIQDrA4GTXsTT/deDR5lAJk+P0Zd6t6sHiKandJkcXqy2MAIhALL9YHPQltK9GRwFyHqng023eBw1w+u7zBxyVjXEcigM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62762},"main":"dist/index.js","gitHead":"4828be685b420a936b90d66f6d2ac6515491d4ea","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.2_1636921291196_0.8659395072861222","host":"s3://npm-registry-packages"}},"1.1.0-beta.3":{"name":"@appandflow/s-express","version":"1.1.0-beta.3","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.3","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"f01ff7106bd86695e674505041b7dadb47943ab6","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.3.tgz","fileCount":37,"integrity":"sha512-o4NLjbGuIImv1DTB9XoZXsW0imEINeHXJ5S3S+b6fucuz7f7twQUXp3o85Hmw5uJaSsd+z762IHfbO/m4HuzsA==","signatures":[{"sig":"MEUCIEElux/MQPiFU1Dc04QhioEKLdYy/ceJTL3aMEc1fdH2AiEAitSzBpifxse6UumcYL+tYn6uLOqvXicN72Qfnee5sKs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62933},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"4e24ca80d1162cd0e119ea202555156f3591516b","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.3_1636922162815_0.23913338034210208","host":"s3://npm-registry-packages"}},"1.1.0-beta.4":{"name":"@appandflow/s-express","version":"1.1.0-beta.4","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.4","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"758554ef279bec3bebd11f062c34d0ce5636fb81","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.4.tgz","fileCount":37,"integrity":"sha512-O4/X/OvHTnoT1K6kzlAT98MdY+BGrQ31GeljrGMmlAKy6EN16fXOj5IpzZa+1+9je27g2jAbVs9pYHZmqLJSJQ==","signatures":[{"sig":"MEYCIQCnqzIAFuGhBATZJs/WegRQ6uAlHxpwbLsMigqgzlhpMwIhAO8f3Z5wBXwUF7DU4Tv+SJQyzFlTetAE9HiFT0i1U3Lc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":63020},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"8c1f62bc3ef9c2491cfae1a1f716eaf7f0d83c25","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.4_1636922409051_0.9215485851624161","host":"s3://npm-registry-packages"}},"1.1.0-beta.5":{"name":"@appandflow/s-express","version":"1.1.0-beta.5","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.5","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"484386c05c49081051b17fc9b8284761d68b3da7","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.5.tgz","fileCount":37,"integrity":"sha512-/fEldk8YHMiMrirLmk694u/huMLMjxjdEVqFKzw4Wy9xKj+6z6Hw+VH+2EuBqa9Bpou/OvwM9931TRzCe8xl2w==","signatures":[{"sig":"MEUCIQDgYmeASPvK5oQzSTKu0HGu09YUPF6dYszxJzAGdj219QIgWiz6GgxqOg1xDcQuMnhoLipTwDu2Fktmxge9c9TYzKA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64159},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"8c1f62bc3ef9c2491cfae1a1f716eaf7f0d83c25","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.5_1636926572464_0.7550932787919828","host":"s3://npm-registry-packages"}},"1.1.0-beta.6":{"name":"@appandflow/s-express","version":"1.1.0-beta.6","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.6","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"d4f7b99e2e1a9fe28bfba745356459247686bb16","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.6.tgz","fileCount":37,"integrity":"sha512-gSgguaaRpMWfgB83WIUyJf9G0wlgAWtfYKr1/w+hYP9szgcdy/QNawGNQ02EzFsieH2lrkRYgfOtfHX1ebGVIA==","signatures":[{"sig":"MEQCICiMM2+GVwIsO989V2N3Q8v/DKl6iSnn/PMjxQSWLh32AiASj41Z4zl3+JHeeEdzzUwg0k4/aZOd+j/2n2TKR1AkGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64155},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"753790c7d7028a4df88c113a50fcdd902c44e4fb","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.6_1636927559075_0.5431229329589844","host":"s3://npm-registry-packages"}},"1.1.0-beta.7":{"name":"@appandflow/s-express","version":"1.1.0-beta.7","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.7","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"b2fc0c449764df4833b377fd9f04db709dbc38b3","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.7.tgz","fileCount":37,"integrity":"sha512-0YexbrV7O9nGvQDOjg5uLMv1syyTc1q1sqUm46HPEJWHipl2+127m4ErOqdqGK+cr9+mMwq/Z+TPEKNxPsufpw==","signatures":[{"sig":"MEQCIDVW1vnGiu7IfeantEElqgNfDaGDq0U+KEKO+aBVSNiAAiBDCOSl0i85vxFmaW+DEDsBYkB1UVazkpM/FB8LKXvu9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64421},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"8153ea91f963b115146d32322168ac67ae6925ff","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.7_1636946760288_0.8860283954015873","host":"s3://npm-registry-packages"}},"1.1.0-beta.8":{"name":"@appandflow/s-express","version":"1.1.0-beta.8","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.8","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"422124274d62007ceecad90cb1481d8b3caf1307","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.8.tgz","fileCount":37,"integrity":"sha512-lnnTOrMmw/HQBrZnarljGGFactThIDGXrINkamtIKmD8t14WXz8st1U1t5XynILbnVe4b8JwfSmU9lZFQR/NCQ==","signatures":[{"sig":"MEUCIQC8H4W7CaAQX31sVkZSP4xtaasjgeNcUXIIFMEeyBH5mwIgfcS92n1YKFTtl/KeVsSfWD1kxhS6AfUwEJUdQJCX6b0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64576},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"219a96a8f2b2f39fba0404ff56186745531c8abd","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.8_1636948427670_0.5189106583404763","host":"s3://npm-registry-packages"}},"1.1.0-beta.9":{"name":"@appandflow/s-express","version":"1.1.0-beta.9","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.9","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"eb673f9b037c55af6bc2c7fb3ea794d8faa2fba9","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.9.tgz","fileCount":37,"integrity":"sha512-FaPQyawXV/UvnaILDtVKua38/6aFZ0F8uX9p0RoqgV6LZmqgaGnNmfcoXJbqvspgFbSOCT97/LrmFxt2kOfbRg==","signatures":[{"sig":"MEQCIHh68OTTI2jf3xpNF1mlWrsygCG88+jNAFogDQFJerjBAiALyjbzfrRJLbsMvcJvzC+54ugOeUAdaBYoiA0zeGXfoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64716},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"219a96a8f2b2f39fba0404ff56186745531c8abd","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.9_1636948697621_0.7104954220470565","host":"s3://npm-registry-packages"}},"1.1.0-beta.10":{"name":"@appandflow/s-express","version":"1.1.0-beta.10","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.10","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"451463e61279a947cecb13a949f1e10fe06231ab","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.10.tgz","fileCount":37,"integrity":"sha512-nJxKHbue7EcrNtX6Ce4ZHRfzVI4e9gSwF8euBR/rSazGCGTt5d+Bepmn3NAEabvAKoPdXYl9uOr/phi+mBCFjA==","signatures":[{"sig":"MEUCIQDatBYNmz2reem9xTxhISujMYiT8bQ1cnYThZaiKK+NTAIgBSGcYUJNSkeXm2/yRcyJkhKvsAoorN1nj3tZdtXQaJ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64851},"main":"dist/index.js","gitHead":"8be6a876bd716c9ff8344c6cd2acdeb8f9c44f76","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.10_1637040403483_0.00862282815803872","host":"s3://npm-registry-packages"}},"1.1.0-beta.11":{"name":"@appandflow/s-express","version":"1.1.0-beta.11","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.11","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"c722be8090af011b52eb4cd00d16c0a95d957314","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.11.tgz","fileCount":37,"integrity":"sha512-ATtNqec8leCAIBLsNIQq8nf50ge4KyfOTWgqoA5Lbbu1ilH+UtiBmHjXkJU6D4lKQ4WGZXcvV1UEm+1GD4fQbQ==","signatures":[{"sig":"MEQCIC+3YUfIADBnMmsM+Uww3I8OlIUBVtnkEF7f7XmRL1JZAiAgYh3MrsWKQsfim7sC7AvsNl7Prasp3CzHsgZEQcuqaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk0SbCRA9TVsSAnZWagAAdYEP/1LZ/JxKpXZ31uHi1P15\nUjiPPLg1l9RBMvCOSzrtoJSd1j8OVWZeGwxNy/YK5CnOwLvuvxA27zpcuF+B\nH7Jt/VizHSeWM/KOWfZX37PvVqoeZhQlcPJnsqLSD9FK7iEKNS8fK6A5eK6f\n+Je/rzT/4FmvHdzhUQxsKWSTuDTiQlxbViAziaiCwCdfxzzJkIFYCxZq+bvT\n22GZJIaXK2G9zylMB6I0hNcgmWKJbBlrJehpkpJD1X7GxbHU/oukmpWRaH/4\nrK3FdppK+Ke+YWFDK4Hc5HgzL5vnCiS4RrSMw+2UATVvnr35DbplepLShTyx\nKPKD95zLc3uBgk4u3oIZVt4aiPzADmMObaxbhsEk4vbXGibu9nHNa/h7C62F\n/pSK743RziIyPyvhrL4StjGgGrQzoUCRxzZgGIgmwbmS3UnvENI93NT6BXqZ\nkRMVlA//rjhpHSBlU5QmflAgUp9I5gqm0YY6kDMJqxezjVzZ2DZSdmk6Lwhu\nnxGcdqV/Vq2YCFja7aNZ9gMNdtLrVqkbM17Owmvk5hpRSjaopxqqTwMTA5YG\n5bFdu6QsGDay6hvX6ez1xaiQlsHeUWx643Dp4I9c3XykePRt13Jrfr7wqxau\n2UKhqbpgOc7gsmDhzmWjR4a5wL77+V3HuNetED+uS+PmgG+r/QAyYjl111xI\no8jj\r\n=zIGW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"8be6a876bd716c9ff8344c6cd2acdeb8f9c44f76","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.11_1637041307148_0.6777479959583406","host":"s3://npm-registry-packages"}},"1.1.0-beta.12":{"name":"@appandflow/s-express","version":"1.1.0-beta.12","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.12","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"5e412d700bafaf35a7b735c1af2f18bae095e8d4","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.12.tgz","fileCount":37,"integrity":"sha512-1QzE9T6Ah2rr5Wto2EOp/SDwuSLWIjcZDl//G+kdygIF0jS/o5hNjkJEuelp5AjpgVR5hnAtOsK4w8di+k0Ojg==","signatures":[{"sig":"MEUCIQCYKyfol2lDVdAArWBoB3OhoyMrQ/7rN4Mj0rY8mDMzHAIga7VmmecKxuqHlO/LVprz4hoc7iQxfDgO4487B78ob6g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk3PFCRA9TVsSAnZWagAApuIQAJmpLfA27+LCXSJc7pWF\nte0XtsbdbbHgW+0wn0rDRE+EJnmwdL7WQjj0GevhXujEsE74dK2LjmJoxlBQ\nKb1UheamTO80hdlOZmyHFI0K3kzXSwIHDxBkTIAARtbQx04NOxWxscdqADEC\nRi8VK8tK6U7pD8SYUxUJOHWtRfiX1+qGxa/sPKwo1R+rtTvNySFWYV1ByiB2\np/QCIqIYxp5jaJQEdbQdbUBe2c5AbBzN0VwCJ9bLqzn03qfT41IbS9ABNulY\n2wnjwojHPerh4UVOlnpgu9oItDlcvPhXmGurqLM4ehjjOkwH3sPWKNbR1ZN/\nbYUkRbKv2lWRkHDhq0tm2ptBe4wBE3xK0PSF+dUBPrm3buHmVhcMSPBo6RL6\nHgKUQOT+TvU4vPfpUBSwSswZd2JxNZc//qIpCt1esMPBnxp4rSsvi6w3lomw\nPimzHYZD1QRXdTguAQNs9krut+VUHhmtcY1C/t/SAt3Pf90g0NFRPzxMQbjk\nPzb9OIIsUZeGfj7TeUCvwz0Tpg4EfBCB6NWDgaRbmbUl5/YOs33Ay8cfrekL\n1OVTRgmLOfR3DtAglGD8ERpCJLmsP0r0nHKSOsdkXMws3FU7iz0v1kUUIro3\nBLVqpapWlslR/0ZeOsvJXxgZwCkaJtwZhTwQtzj9Zd0zMFbp0MlX+LuaKZ5w\nBXXu\r\n=x0UT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"a76b32e9fa95b557b2e935408bd5ca0c5a517d0a","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.12_1637053380864_0.865544768512025","host":"s3://npm-registry-packages"}},"1.0.9":{"name":"@appandflow/s-express","version":"1.0.9","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.0.9","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"1483e5dc1cd62ff565d25e5947ae3dbf69f7d3f7","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.0.9.tgz","fileCount":20,"integrity":"sha512-VnM7Lg1kCIdVLAdPxmhdiTleNy78ilcZqelzot+C7CYI+tyb+gti/ENcQopP4tO7BgIVeMAM9mlgGnOrbsiGew==","signatures":[{"sig":"MEYCIQCYi1mLO79OT1D/t8XnlbDDSc5yJa1Ke5eTPJocRfAelgIhAMVfkSUvMrX1/mtJmBZqEI2jrNpjHvSUfZ++osJj/Bs9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk3QVCRA9TVsSAnZWagAAzsIP/34ZSFtXyVtKvPChP1nF\nER91JQClkgupU2wpVau34QNpKpO6F0GtjfC3GMO/gkuANZWUinUQ4c0TUAA0\nVrbvhvildWTyawVkOwYOG+dLgD9tz/vTg0iqyvR9CiulaQW3IZTKDs+ipjpY\nE1C5CLm+yWFmDcNFohFvG3CUtY5+pWLysTBBTisE565PIiuGdL/AVQ78XTMn\nZ3U7vITMxkM/kF1kzdgUt3dlU4YdPh08dWliORC84ldsIoxSWDDU1gikOCMR\nvlzB+RgCQEiqQ+iIshOsoKaV77C0qTziuG51Q4kiaGeu3ZDXGGiGW39nGPX3\nvXRKO8MDCUA03JY+odNQ7WjTSBkr23FZcFLeWCnmAL3bHdQa8P9+hIKjeUSL\nCeikcckIqWYqyZ0b47ymJlz29OhiIF1AFAG8rjaUN+DOR21ph8Pn5BKV53S1\n5vxOgUIYvSeFVQ/JGOI+p+vmDP1YHn5jKiXGYjPYr1cHmCMMvfx6lSb2bIho\nBeFEfbW7cVmuRoec7YxjJYmgTNl+YQHN5XUr/uY2g2F14l3RMnRZHm9126fl\noUUGGnfb4vdPXBBe9JTOxPKwhbObjptih8pz947RDaidv8X7+4zjNaNhGmSu\nnE4m2Km2mFxeYzLc2E3pDQQ5pVkq5cdwcxufwydYWMyPGHvtVqKiIy2ju+AF\ngTUY\r\n=RRx/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"820bdf187510a18ead0ec0662bd6830ced8bd414","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.0.9_1637053461261_0.9385657768112154","host":"s3://npm-registry-packages"}},"1.1.0-beta.13":{"name":"@appandflow/s-express","version":"1.1.0-beta.13","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.13","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"b007a0542ebb364edffcbfc9d79661ae03c94091","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.13.tgz","fileCount":37,"integrity":"sha512-GlRNKC7HtOrxv3bVlE9BaTMlwwhW0ODlfEc++wT/pNEsPbwldoEkWRo1xw+R8TOFRODl1DMm/Drpa/eFLr1w1A==","signatures":[{"sig":"MEUCIQCUgzPYexVdILpHFjYI+v1/Zw9b39LF+l02mN/R1MlmngIgdRP1CtEp/MsN9widvUTAQB9LBrHUJTu8EZSsEG8C+OM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlYeFCRA9TVsSAnZWagAAKWEP/j/kq1el6dYfUXdhRR7y\ngFZoN4LcLukoEs/3OrqS02lJ9EpWRUUaU66VEgXmDPoNTHCG4u+SPg3iMXGR\nXRN9GLHaXZOLYLvSkDCrNkEJpGLO9h6jHYtXF34jB/yvIC6m6ArG4O4gYwxc\nsoeVOcsy3HGymwvqRbiKjGsSIhu/lnmPFUBiv/shWU/64X4QBuD7/6wBfv5Z\nOegtjlcn7xvg7fNR8T1KhI8PUIGYYFFu2TOxKFwzMJvNHTNxENVPQZNz5mSJ\n6BdHY0cDo5DH73y6k91gSd8qszo/ZsxAa+1Y6fBSCEXGn61cmO0/8JTOVk9q\n1bQgWg530eCKqiDRRUTkI9DhyhT1xxJ5SrXeD6fOZ5yxpd+CzLyhbB+uqsQ1\nRzsta9nT29K4kHPoBRPlqJAe2mpevC9rzwKn7bArcOkHJzHmgsGLVHKXUUcP\nm4Xe+MGu0e5a6per9KmjMtz9/u3OA4iqDN1TXlRBG0/2oQADDVHsMdHDmT2u\nfIre+TXETPctocyq9fGByFOuN2Euu5jt3unFCx1snTRXyjc1JejLr02kavop\na/0PEkbXASpKN1fCYjtbD5A2SlB/YhGhy+GLGPNBd+HyuH3tORRqOIOWlBaa\nI6Duv8WItueKUK2gAm6ozyZt45vLXRfZc84hBh+QDebW9vpYhLp1RjoMzanw\ne5Ol\r\n=UZqR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"22abe7e0f3229fe674d0dfff8513b5c90a07fe19","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.13_1637189509563_0.6626094366505488","host":"s3://npm-registry-packages"}},"1.1.0-beta.14":{"name":"@appandflow/s-express","version":"1.1.0-beta.14","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.14","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"84614e8345012c5f0dbd91abe3e445a457ef8417","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.14.tgz","fileCount":37,"integrity":"sha512-iUGDPectd+HtPGktDYhoBRJKAAA9cHJXI1ggCW2G+TI30ijiWHC9pOL0QX4sz+cqW+wS7QBAsEfxkjz5N5te+A==","signatures":[{"sig":"MEUCIQDaMjaZ7TkQozSCRDud5c8U6o7UH/xmfzusvqNERirA6AIgSdWmntX5MHNYvyyuA7XueYDZ2JMhGG5YYJEbbBY2Bw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhldjxCRA9TVsSAnZWagAA7IQP/joJWqsbCaUVDd/5y25h\nVViI8PsMOqj6IR41yMXxzES18C5KieB5/ccD2lf6XRDjKPzTifzrxN/k3kOi\nJyB43EDlUtt/yQtXxrMffchAd1NYl3MC2RZnZvuV1OqxA0AL7LivqxFHHb1V\n7/c9HRY7O7ADrtVkQEnwcqbDUIarzTBqRu+anlCVwDUODWi5H6/C+G50IE7O\nH044Q2JIEA28GtFmMoiMbzdS04iGECrK/dr4+Pw8zE1j4RGwuw/WLa9hqO+M\npG8yZX3Y//H0ESGaXtoHDFh0gOkFEKANCnvYYFeitYr2GmpEsXoSTIV2ThZG\na3pSFt2FxduD83wMGXDsvkY1B2+CgzmPFdk2FvK+QspQJ8FPs9/r+zYTBEGW\n6kGK+73vpznl+SP7zSK5BgEyxd4kLFA0FzHSK5F44/ph/lqq15kWRhpZR8B3\nbar4xbhmTabSVaSOttPEDlunhwJAEL1w4wKfiI7lV7Sqgnjy1rJrbKvBNMM0\nRyZ5GhOBiTMNE5RtMy8O/aMrCWOQ8vrKzKuemsaeerFrGv2y2HH0+fSm8+nW\nsdjUg/MKx/w5HFoeOGKmNPWodd0BBHnTlpE9w1akgE9vVsDjR5q5LPO9ZxQ0\nrgdB3eDw8j9lZr56kP+Cklm515Ur5mzD1lRvC4kVXq4qrFGT6cJ6xRNOS5jH\nbWsW\r\n=8vLi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"b05dc48266171f2d8e8c808374fb90daee9d729f","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.14_1637210353286_0.4529669638855991","host":"s3://npm-registry-packages"}},"1.1.0-beta.15":{"name":"@appandflow/s-express","version":"1.1.0-beta.15","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.15","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"2a12b8307e3fe01bbdfc8e1596d720ea12ba0da5","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.15.tgz","fileCount":37,"integrity":"sha512-wJPztllzoOWxMyjjgJxmPhxUiRyHOWvhdYRFQmkCA5WDC4R5d+vgqB0gltLL8YmN6NihPpmjMjFki/nGuHzl6w==","signatures":[{"sig":"MEUCIE9d6HZYuu3srrYhoVaySpW02VlLFKZfe+7HZPRuwK+hAiEA2q+TWPulGLRwvJFIjWzXevVOOSgE41VdDBClU0r+2rM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhldwKCRA9TVsSAnZWagAAOy8P/1AXs1rz0EOfHDNP4g94\nOHHXGPC/rgE2Zp84BBFIbOwLfli1oI9Nj0m1zdN4LYtmtnU0dX9J0dvTE6h2\nueXGJKDT3BIbi/ePR5TayzfgEGpH9yyZkwCebyv/IYov4e7skGQdWZYSfa2M\n+WPUJX3uruTsmsT4ls3AiNGEZIt8DJOVVCM4o791KGgIqAOCb1LT/EwHknA7\nyPHLG7aswmhHzLJR0k7UHSrzbDVdZdfIsS9IfjGQ/3iBhZO/KCzzXzC0UYOT\nwuDnpM3Tsvy6Ys9Mj5nZ5+66zZqUukIFpJIb3p7lyUFWyr4fai4DDgP9az23\nL1BbScs+2m/J8SEeqiznrGu+hji161mIWrCypVL39fGDfAKlr8KwWYowH755\neJ8cS9S5tNFW0F+r6XtqLQ26cJPafd1mP53IfIDs1TSs7oxhBK76CB/JieKh\nsopZAklbccBiyyp+Ad+rsrbEf1ufOaeiToLD8U9LRUAIxsgxgpL9ZjYg9po7\n+KDvkwHXdQshTPDrXVcobEm6uDbR1zDR8VMy3Q6GPkx9xfxFWoV9rc2Il52W\n3v2B1OGB+lzb12+SjR7Pn8st/cE1HI9zsVO+mvL5FBZgEyI98wuOj9kr6RBj\nNkOtufLjzTZUlc8ca4aai9b9VecxN/cY5QZ/l5AZzarL7cLONaYlmq1tcjHS\nFJ9P\r\n=STIM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"b05dc48266171f2d8e8c808374fb90daee9d729f","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.15_1637211146502_0.03464369637528364","host":"s3://npm-registry-packages"}},"1.1.0-beta.16":{"name":"@appandflow/s-express","version":"1.1.0-beta.16","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.16","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"b78157079ed85fe0db3436095d5d42099e446f1d","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.16.tgz","fileCount":37,"integrity":"sha512-zdDBPt02qyStgT37x2DyHKAFxHwTjBiBMHhyw9tx+H4DxfR8X53vTRDdsrKeL/6Jx5xBifYpc1Yp8+dO7SY4hg==","signatures":[{"sig":"MEQCIEW6blTrWaeZyMo+73qsGPk36Pwmxpmp428JqOvHhS0LAiA4OlQ0uvkF8oSBvVhBqQrxEK23ESkWZGH7rqGjvYMipg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhldzVCRA9TVsSAnZWagAAs+kP/0gu14FzZdgJaomlftlX\n8jy2w1VWq4KGFEtBRrx7fFjq87BLXY0X00+djleB/YJcB4bgbqn98CVcAvOn\n3pjZ9C23gefJ7sCstSHlGWm4oldm4VEfiu8bpbW/hp5bxMODSAaumLAY0Hg6\n+FIP+9gyXpFXYKDe7PtSa/uUrJxn3eMDw01ImSqxIvlPXuWthWi3I6kqEvmN\nKqeRVLX37CapFPFHq9peb7kMuKuxG2mNpcmj5D3NDNDltKtsfaAuecgTMOOu\nUKneVXIWznByH1Lll9Ob7Aryt6QMvJgKV6uEfY2VYR6uyiqM7LZcqUaV+/p0\nxz7K2RZKvRnpE4JXyhXYKciAV9fZ90trAjNnq5ldOqQnWkYmmlvveZRyWpxr\n5IrGdswrnUomjdwY1rw2mb9qcTGbPPRYpgd0FEUoQbNciMSxZU4jz/VqB34l\n1CGdx9s0kLCrQRGuciS3PVbJGV3cTt0wjykfFGuLy7o9j4xJ5EmYYJsTuSDT\nQcgw5SOKT8AujLOiSizobFtXZNrB6o1ZWJE+TlgIdgeD1SHUCrdHjaNxR7G6\nz2wd+jNiy3BpX4FSnyZ7z8haAULiFtWQfDA7t461rGoc4lSr/3aawHc5w9oK\ndYmTEwkdzmbNGNXvdJkZB4R8eVNAo9beKt25scA7IrD5xr4+/rso9A8tyuSb\n/1nJ\r\n=hj1h\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"b05dc48266171f2d8e8c808374fb90daee9d729f","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.16_1637211349455_0.8842868691210974","host":"s3://npm-registry-packages"}},"1.1.0-beta.17":{"name":"@appandflow/s-express","version":"1.1.0-beta.17","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.17","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"79b739950831340f42f77cff306b600b091970be","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.17.tgz","fileCount":37,"integrity":"sha512-e2ktjgvQszKgbZ+yq/9Qz5WXLBb7zNrwXJyJmPVUpx23fL5xD4Tavc55L60zdAt3R3+pwoZuTMg5hsQUZwGa5g==","signatures":[{"sig":"MEUCIAPYYTVmfIWUEDhbAO7Xh+avLlP9Vi+O8pZawdIUhxtNAiEArh6JjSbf8l4rmAnW/hxIx7GRq1qXNqbClXpTO+P8t8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhunRECRA9TVsSAnZWagAAWv8P/jcm1SfVpKiGzWqmoeWG\nCT2++boPMpAomM6JmVe+9UcQKSemcaSxQltHRCOwP1p6+ooNYebsu7/iuFCN\n9zoMdKwJ3hT3iss74GjCbB6GB/N+Cbc9+jF+isuEZsJxJ3jSSb0bFpeviJk2\nIlkPU0Mv+HYGXwD+FgxXQxWqijcEgGfPzUmfma+rK7638ISxN8OsgIxY3i4b\nmV1EXlkK9SXOQrGdV8pCUwZ3Xx0pZRjSpw/i66hZ1/EF4VAzhvTwqLkLeNUl\nYB2P9ctrVMUXMJ+MoyOXq08UvGAp5ywAPCeg+qMhB7tCtyIcFRTpJ9W/5oit\nsTV/HOO/X+FmIbKSK1g3H+Ry0y7aQMJ8xwO3wMu5m5ZuC/IP1922Kw4GjmQp\nHZEuycLadQfZGc+UbTsRrExpzxcDmuscQL+hLcz2/Iy/E07Z0eqw+AP4Evz/\nlCf93c4X2md80mPvIFF9AeERH3tBweyDt7LpGsuYDEpDA2ZNyevYqIY0lCAn\n3yRw0ZrwjKDksVZj1zxLOpAwK44j41DdtxXSdjW/AM3UEZA3SgKEkM1/cp4x\ndAnfD9jVrUAuEJa+gP/s1hhKC2lSPNJNRn6TCyoKuOUEznBalKUo+tlRsDPG\nz6aZZWvza6v1SNbhWFSvUD8DyIXG9x8eborGhKLW3rFuv1rmRfO+5o1SLE79\ngywr\r\n=dqdR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"b09f867c734967912c087ecde4ad14a396905c50","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.1.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.17_1639609412766_0.4837334082674525","host":"s3://npm-registry-packages"}},"1.1.0-beta.18":{"name":"@appandflow/s-express","version":"1.1.0-beta.18","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.18","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"e7899f6a1249011f2e315a95ce220cd5500a0ea2","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.18.tgz","fileCount":37,"integrity":"sha512-07wks04IUg7YuKFKkIJ7//j9AikQxe+n3ENCymPjT8y6wQXtfZ+3G+EL37y3+0EE6SHUyeK8+jvOjxxVPeZhVg==","signatures":[{"sig":"MEYCIQD3UpbLTbpDHZZFWIou33AKOTBODUUvj01hlOBfyYX1gAIhAJat0cbWu2xuXeh5Q3pVINKepLs/6CghTU5UR/N4mJTw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":69339,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNoIkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNTRAAjTr3oR2hWDfqZ2/5RkeDVpPeTFGoz9c2tpz4JUdq5JoxVBg0\r\nLkUfVRKJU72n0RFLCSlBo5udJM8P7GEt2xdNzac8Y26Fhd7reL0xVzFnxiu6\r\nbiM6WOCmlBMbnhJYyqEWCbNQFT7/aBlVfjtSK+rTvKx47rKkP2TBsJS9zpnm\r\n3kjKEnjRNgRozClJxU7ATPbPxJSBvy7Y9afCjRkM1THrtfSgdgMkul/rEFYN\r\nboIPs0Q1Kli/ztCQK3tSW8J7PlH+/c9GjFmjQ6MPq/t8xmK/dvmA1Ke827pb\r\nKfX1CGTQIT39VuiKDdZtMDf0df06A5h22DDWlHCbURx+ulYLFFXIsYJqSKDc\r\netOKtzvnBVac7Mf6KnznaKal2tR13kN2i7ZZI6xYWUNR/PwT7LOf/8Xoxrkv\r\nY9eyG6+ScpX4X6hoNYAdPPhoAPdpN7tld2jIrcaphewFEPRFwSYA6WaD3Ugc\r\nrh7cIhmVDV7BmUJDyHhnxkxZXZdQTEliYfKJeONkX2h7k0KC6fmUyzxX9vN1\r\nQxOwb/Y3whFClpGqTcN8ofWTm/xNTYg/EWh54Ir4UWcWPVtr8qjEujIKmwjf\r\nKyXoNUxSsMQPhXatHciabJ8uAEtp8I2C82RMt2HpkREZCLSvQ+ApwER/67E6\r\nCUjAlZp/egt/b1FXiBD7cCmOItLfI0fHpmU=\r\n=pNvX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"eb30d3d4279f32eeb91c1949735fafc614fc6a1c","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.5.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.18_1647739428100_0.9863490025678117","host":"s3://npm-registry-packages"}},"1.1.0-beta.19":{"name":"@appandflow/s-express","version":"1.1.0-beta.19","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.19","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"c8dca94dc7c2807621bb87c244caafe39cfe53fb","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.19.tgz","fileCount":37,"integrity":"sha512-iPgMlaWnMQd6V+3xcHRvfKeTnsRhFu2gLAB9VJV0CThaNdILdTUgOGidAIMq7VCSkPBebwpY+ylmpRapvFPJng==","signatures":[{"sig":"MEUCIQDEy+XMUG8ahRKeCwh7offZT7XPl1PujW3NuDrlUTQ6hAIgRUl7VnqvLrhEJebhk/ufQ3F9sOpwFxAr3RzbGHCm7zU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":69610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNqB4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojQw//fwfSf6KvIPAeJ1GxOmm+HZKaumjh07asAVrwRbI8qEp/k56U\r\nXwLN7apaPvQXumHusMxEPd1uW5ZC6THi8ttZfzdKu6RqeH70dDftYNhDVlo1\r\necVoBtExhi1rO1cUzTsajmtElMRy7E2kdGided12v1g/0MoUQqEQa2S15TwQ\r\nSWQP4euThVIdaz3XCrNW5KyqA1IvCyPINvjN+oVfz4ix9RxKHGeNfdF7iOG8\r\nF3LQOL5ar2npV3jnlZJLNIdeVwxl784l/xPu/VsEdQr4teXewgIIoPzzwv0H\r\nK6c0j7VdFHmGliGVzKlcwrqBeyURmwNes5iZuydTMNOmuZu2aCKlPXMfzd1W\r\n9pbWByWq4yt2lMk62E2Ohe+4xnJbgvqbQL0ue/L64e276/u5YFvg4xozFU7G\r\ne1KcKKfhvxbahyRn94IDNV1ds9LEfrJO48grDk966WJzS1lI/GRhI5UqYhRe\r\nGdzJaZuHx84zKqhVwL21npeYvxEcOWpFrusPjGNX+IahzlJrE5GmDZnIrsZA\r\nHIfe315RiH/vPYMx22RQshgFbAVLH0FvHu/QI+0wxq6YsHlTD+xDADA2hdsh\r\nqO7mj1gdTB8TclQdNCVHaaEZvuW7Dun30EMYcspZ2/fhNAjSk9YDRep0KhGJ\r\nnmKMhXs0WyMD9bJaKRt2ifo4DxqgaKNBLhg=\r\n=8P+4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"d51da50eee6f68ab41908aa3541304571edf521b","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.5.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.19_1647747192766_0.8888866299313429","host":"s3://npm-registry-packages"}},"1.1.0-beta.20":{"name":"@appandflow/s-express","version":"1.1.0-beta.20","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.20","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"d6ae8318e8570358b5846aaed7b3e80012e0aed7","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.20.tgz","fileCount":39,"integrity":"sha512-FSvPsNhSxR8CCCfvR8KswOAwKuJuU2RMFz76z6DQgUx3STGASCv+H54E3HgJUEWuCabI3EmNoijkBEwsZskjMg==","signatures":[{"sig":"MEUCIQCqfODerpx6A/nE4Hbu6v5yAcStRnFT1Z2w757CAr6upgIgEaRDJAht2R+RsJN+2/Sed9M4w9i6hrj6rmB3C8jCLvw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":71953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQ19ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9yQ/9FMg1Y6Xa4f6Kfjal58dWbA12PtVEgG7qSHfbmIRKxuU0M/6m\r\nNupG1qaPgF6BLxbB3FuvNxZDabHo8wH2o/yawticuVvo2tchx1jlX7Cg5HwM\r\nkv6Vn9gKA0cx1r8wcJM/ob4uNl8jnfe71M0uyAYR5R5pmpz2sCsWWXRDKoH3\r\n1TL/6KVsZ9FednJWwWknsRLB/91OR2/bXRi1ouNouwwSCnYxNx8Mlb9T76x2\r\nQ42FCRW7C3cKn5aW6JViURRK74Dn3jUA+yrOMgNf+Ud2aG9A+u+s3QvVRc/l\r\n+dyYro81Dv5/gOKI1b32acbY0FnUUSTZIO92SdRwGx1xr+CCgEJVdy+tZgfw\r\noDOFEplKAKSzdVrTAczf+TddGT50Za9CjJLDAGent8xiCzP5AMDTKo+Cb+wp\r\n67jxDnvsXDknAZvasWQhii6L8gjn6Nv6DZlP5zGbKcTbdmTy3pFH/Hl7D+o8\r\nXkxGZfZ4LjN8noYV4uR1CtpioeTHL6oKxlZnk/9eAo+jZZgAFpihHOScYXsM\r\neIL7Tew0N/aGZVVNUcB5ZV7m1zQ5ubD9eNMnb2P/Br1rcDgDH4CutbydLvND\r\nlT1uIZiVVaq6MxV7Vs7xkPhviKlreFFWfGNIDOcrqe6pb/fUBMlTh5I5OvHQ\r\nAiDppKHJexf3Ky1RBdT/MtXsU+9o83qqx+A=\r\n=kSY6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"2a0a3529a9ecd67ec8375e50b789fe9a20aa6340","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.5.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.20_1648582488906_0.8842449751308521","host":"s3://npm-registry-packages"}},"1.1.0-beta.21":{"name":"@appandflow/s-express","version":"1.1.0-beta.21","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.21","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"5cf29dc7ea97bac2ff247ba7781dbcc4891e734c","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.21.tgz","fileCount":41,"integrity":"sha512-+YMWvS4jMY1JLhbka/q35P7rklYv+ETPA73eEHSiPoDWtkllyiiS4gzxvy+Ljx//aQQZ5sGso0VKtbFV9BeR+w==","signatures":[{"sig":"MEUCIBeXjRAtW3VMagiOsuDiSxkMYtxN1/amqpDK5D9dwE+GAiEAjS37pgM+z+6n0IPik/U6CQkaQDLMh6nyLsgSnxVB6hs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibGSAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAcw//UtMxa2Rcd+mMm4V4m5udL+oWm3pMjkW0rvKhSwxQf825uPWd\r\nByeUEZipJGNgHLt48qdXoko8xi9EShDxvdiATCZR4t4eP6ZkVbj52jj0rlyP\r\nW96n04fCfGl00GcdF8vu2NAblKQxoAXsWbmn2dQp+GjI/ptuTxBJ6u7Ejmj2\r\nQ9bauz9twoz7IYoQiix/uFhQtwJtMthW7HbciOKm6evXyYZ7MHRvokcfr0tO\r\nr4CWCrsr4wqqswBgAVEk6OQtcvS/0/nJXO1Yhh0aEuJpk4r9WxCUVoVHGClm\r\nGnEK9Tb6j1ZfA+60rd6GO0+CztovsWRmE2TKogMHTEJaiiymJfn28SoeJDBt\r\nuIddQJaz5ciS9VED146tk0levI/Q4EAideRoB5NvUvypvJ//sBxypTY+teP8\r\nNnynZJeF18UJdqhiYy2C3WXD7lttEC7HYwy5TWcNvz2hozdp7nFCN5su+LD4\r\nJQWxO6wS0jvmeH99MQEQOKUS8zzv+rLeJ5L6h0DmWGpHuZphRIH3q1tAGA7Q\r\n0Ji3EA6n7zKwNhufHXczIe/a5heIxJcjsGDDjpP9T5H/hCRmiaa++EolQ1/v\r\ndOTuS5XILeHFjB8o/gQaH/wZB4MuSw3Apf73ef7Y5avHAa594WI6Ft5SHenb\r\nZINaf08DPa7F4B4eB+gJGgru0DjOq6TP0xg=\r\n=IQRZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"2a0a3529a9ecd67ec8375e50b789fe9a20aa6340","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.5.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","lru-cache":"^7.8.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.21_1651270784523_0.1169208046903798","host":"s3://npm-registry-packages"}},"1.1.0-beta.22":{"name":"@appandflow/s-express","version":"1.1.0-beta.22","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.22","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"979bb8f93945bebe4b899ea6286745bafbb43546","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.22.tgz","fileCount":41,"integrity":"sha512-aL+1qlljzMzluVUyxcxl1Jr+bmKqza0d/hCexJ2UFT4TAOA0SNPFrpq7FcyVx7w4LWO3lzxpS+I28ArKGVtI/g==","signatures":[{"sig":"MEQCIFNAZbSiTW6s2rbp3AK7zq7DH6TRN3kWCGtJpybx6xU7AiAbgpucIcUZqUMhZwqKeLtY8OpGccSFY9GJLnWgVdzNnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibGTyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6zA/+Oz3wwkiTYuHwMfIYauooZ6jYHGf4VQLimjAdLxby8U2RgGFA\r\nc2ssaPemZNWV4gBZp1ti1gqFSekyyWHecrYFW5bupMnb7/eBhdhq83ajuQH/\r\nf24f7vjyC4vL8WF8PUioS3U9t9e79v6WTSkzUuC2TNKbIpRseSsLVjlNxMam\r\nMnNTCn2AmigNL+NnJzNryW1uY1YukCF2yRUSQKFpdWVYLJV/l+9UnASlUvFZ\r\nw5HnABkWv+XfyH6/6AovBAWLWD55yEAIa1NSeeBzN7TYEdZYQQagvmdQYbm0\r\nC/udgjMq/y2p3WzK46MseE6mkAlz1HXjDxXoYlZDU93jMBcixhLNhBOOAAJk\r\nQh4xeiwV5dN/+/FmLBY1eg9ffSO2ta0Xaey625xFH1G9OJCiGVcb5O4W4989\r\nxVD7VOYDc7BneuJcGqu8tXV9zkR4smKGKPKOTQtZ1TKakZX0PfPzrZmvk+Sk\r\n5BC9Av1tyuLlLsbwQB23h0Nd6Y6dc4uRIwD3UQCaVuN402W44js0WygF2h1+\r\nSIY4FagCMqrhg7wp6Qg10T8J1iPLpl8R1L2zy+k94nwVHApf7+SF7G9aULCS\r\nlCdxSbx0ExjoMjoPBGNtGIxWDoTRIbM2FagqjpUMZsglodbJK3NOCjfh6904\r\nsuPGq0tcd9VxpCQb7W+0frJUX1gr16SssPA=\r\n=RivE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"2a0a3529a9ecd67ec8375e50b789fe9a20aa6340","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.5.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","lru-cache":"^7.8.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.22_1651270898203_0.85478999969517","host":"s3://npm-registry-packages"}},"1.1.0-beta.23":{"name":"@appandflow/s-express","version":"1.1.0-beta.23","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.23","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"5510d0b3f7947d4d9a775be8a5c33f986879ab4c","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.23.tgz","fileCount":41,"integrity":"sha512-KuSqj/fEdQu0fO9vMNjdbdWKFXI9YPZLMscZv7jiTBq4IvzCvm52iQ206WKBDRSCPb5+CuSe0dFyGcF5DG1jlw==","signatures":[{"sig":"MEUCIQCxAX78Pd6cpiLFLOugdQlHJV/rzZQOBgeK42hwxgWHUAIgPJuO+yGNROaRO8zfLAutmcGU/ot+pQsbFSjou4b6SCI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibGoZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouxQ/+J43VafQdZy7EiEmjqnw8MEA6Ff8zxInmfjbK4YFtptQekdHe\r\nMA4DuDlWpj2igDVOTG5xIODa8poD779xTqwzK1xOSVTaRaK/xMcR657k9SMO\r\ne9Q7MbthwIvxPqTTG49pja6rI42mJRMjtKC85Ytb0vF5itiirKlInzsUdh+D\r\nFDL066FmJcytjUH5Skypy8DT4QHhCGWkz3PDJIOxWmXbEQjCDqQjsVuYbLJM\r\nMgvH42WJLHXruu3dq2fHucv7ZBUVes+wdB/e6pdJTzd6DlxBzYJ6TA8QC/zM\r\ninWwObBmeIrqMzR3b0OnBn5Xdxg0/VJVvyWWccq9vjq2XGm0XP40erTMU9EX\r\n1/7DQxpsdvb5xhgoXiR2cs8O6mw+6bz0G7r+wploR/M3BU6/x4R+5dOFvYMA\r\nLpO9xfsicD7U9DaSd3BHnr7KRzBcTjK8QhU31y4ofXETWj+NJzlaBTR/Dmtx\r\nTbiVNx+cL/SDJrUwJn/LrNXcxm9oczRM1Ha4Izvnk67L1ZPYy8ZoJMv6H6CE\r\n0CN0XCJrx8aOzQRtMe4i70ug7TqJwyanQEkx/bVyb3GoWhE4z8At8TlsIeJW\r\ny1OYIybE3YYIy+2UWQGAHVPzljok9X2sTdVV8F+nEJCHDpQCil8n0NhV+7ka\r\njK1I4rZTg+Un0tCk6y8KSNtWukEZXfkBvSg=\r\n=jxyP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"2a0a3529a9ecd67ec8375e50b789fe9a20aa6340","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.5.0","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.13.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","lru-cache":"^7.8.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.23_1651272217467_0.4030884752123971","host":"s3://npm-registry-packages"}},"1.1.0-beta.24":{"name":"@appandflow/s-express","version":"1.1.0-beta.24","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.24","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"d34500837a80ddc0b9647030cc4741e649f31168","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.24.tgz","fileCount":43,"integrity":"sha512-eytqVGW7LCecfjm86lOYkbiCyao38yD4pMWnO8QypF5EGjzI9UmAQRiILSK6Fr7LCMnfciQ2CZ3Rn8iRS9qd7w==","signatures":[{"sig":"MEUCIBSETLE3gx11mhsGYBp1OkeGlnAMBrALfBNmVvllwZ+9AiEA4ivxTiIFuXD2VGCOndNtFJH9WGp2B4+Ixce6n1jSsAc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJju2hRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxJA//ccqprH/azeT27tk6t+6ng2VR1PFZ79wZ6JtHP5RDsqfwU2ul\r\nve/P4d4T1kyXcbmgeq+rORtcDLD7YAsJ3VtIHH8UmDrtS7vqXV25u343UGdE\r\n+QSB8PQvrXkUsXG9NwKgyuL56q95uJmkkJD2KDYEM95EoyUslU0v75f23q60\r\nNcgsOb6c2q5qslGTUVnFcgO8p+dndmsB7Z2wE30+md8TCkZoLT1WSZ4KNTSN\r\nIfew/9hlgU2dTv9P412HpkJf3Fi2gWYHnptQrcQ8anK609d5vg9eUAk4FBhC\r\n5yghc7NLeMVmbZN9HCCKcFXP8svAyEwkniPomh/PtIQDOls/FbzLrj0/TQt6\r\nd/ytx0jUn49kDbR+aEaGcZ6jCdTLvE3xSa1DjNI4kKjS6pkP69tUD7s1AHUN\r\nIcr711Q9fjw1IWj3s3t0nMeq1ElAPdPFnJQw1mkKAo6DQylYND+CayPsT8Ix\r\nnaQNXBpmBfC7swHpIVpnBrePHqU1s/TCp2H7H7AAxCClyxSQdTj92tvahUQN\r\nt10m/M3KNlaDJ1F+MNX2qS9CBHMe4rdHCvhTyHl3J1Plg5gMbqgb9o0Jono0\r\n/9seryTRpObRZ4c/TH3paBH04e3M3mt0brIuShKyUrrK0q2cAbDMwxpiwOqB\r\nBbMccRRgKXja5BHfnSod15tmdN39/DkePLw=\r\n=NIuj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"1816440b3e1186063d4408302991d0de2247bf4a","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.19.2","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.18.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","lru-cache":"^7.8.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.24_1673226321705_0.7123004999991742","host":"s3://npm-registry-packages"}},"1.1.0-beta.25":{"name":"@appandflow/s-express","version":"1.1.0-beta.25","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.25","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"6f59e654ea854d90134984c084efa107781946a4","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.25.tgz","fileCount":43,"integrity":"sha512-oIG4DhxKD2G0+uOpecoSplZGZULs3E9JuV+xnPqUy165+Mz2HjUkoBz4tl4zOAnxQnLLPukvn+UCoTcbiq8BsQ==","signatures":[{"sig":"MEUCICZKBnoH4jKW2uGye0Cxsa98QfA0cqqWu8fZ95BLjGZOAiEApy/AAjjeWjC5EkKjGiBFkaly2xiCWfNI2nzMtkDq+wU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/SoYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuHg//TvxoTjN29+Owj8fAE7UW38G6xy9PO47Rdvs4O0fStZ8oG50h\r\nvsis0AYIJfNqkwAg0aYBgouo/jnVbJpWDixftyhDuiVwAJnyuEerHpjKajga\r\niMhI/kOx6JVYT+fexBHyLe8bndeVLg/mqn9YRRR/JXTJpZ8Gi+QxG++BK0O5\r\nAa7IC4shQ6eaqWMBn4yhaJPoNjmmji9qiV9g/2VcbTGnX2TEuwzZjBbPNRuR\r\nmy0EhkUyRUPpA0dvI4ee1YRnyzAWfgxtwJBqkqTfdrvuzV+8sVq+j8Ne3v16\r\nz9lDoDVfrl5xBhwWO+8BtOx/DDa7idVk0S/MZBJCOdXR4ckKLCPaZWMgqic6\r\nZ1c5LAoLi6H+jQW9Cq0a+cx5gD8zFHtx28FmmYzCZj8dVhonQ6EzyI9bWGY6\r\nu4lShFdp0FU+6wxwET44U3Mg5b8fdiYycU1tN34gjKItYXPWcMmsa0F0F5C6\r\nLXjbau8Y4YRKKSfm0+XCfnHCh/dDsKs+l/sAAztOEna2aVSiXerkX6/5PQWS\r\nUggei9tP6xprsJGEM02lTMZ00L/fFutPW97mOqvIZLww2dc0AmFnwf4a883F\r\ni6t0VY0yKylGGU+ov79tLTF0y2YK+COzP2fmNFboopLoltUh+9UzERAud7gk\r\nj4oNP1e2+LawyjTYPkys+KMA8NpAwbL1BC4=\r\n=xMOU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"6b68d62aee65f66b6d5ad971503978ea84e371c8","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"8.19.2","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"16.18.0","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","lru-cache":"^7.8.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.25_1677535768491_0.15971982875810697","host":"s3://npm-registry-packages"}},"1.1.0-beta.26":{"name":"@appandflow/s-express","version":"1.1.0-beta.26","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.26","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"f1fe5db3966ab6cf506368e056997cf83966909d","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.26.tgz","fileCount":43,"integrity":"sha512-5OwVAPoeDYXaavPWVtPk0XToyziR0hBa1d+S3GuzXjn80E5dNuL38VrtIdtPekuhJfEloE2WP88eQUUCk1Uarg==","signatures":[{"sig":"MEUCIQDD2TetfxsrcA6XR61ULu97+P+rCQQwhwZkYD5LJcorEAIgTjGh/MHNIC3zegU5mvt2HQqRO54Vq+HcQzSpOvCsNFo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81211},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"6b68d62aee65f66b6d5ad971503978ea84e371c8","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"9.5.1","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"18.16.1","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","lru-cache":"^7.8.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.26_1697484204333_0.4054056855609678","host":"s3://npm-registry-packages"}},"1.1.0-beta.27":{"name":"@appandflow/s-express","version":"1.1.0-beta.27","author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"_id":"@appandflow/s-express@1.1.0-beta.27","maintainers":[{"name":"appandflow-user","email":"janic@appandflow.com"},{"name":"equimper","email":"quimperemanuel@gmail.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"teamappandflow","email":"team@appandflow.com"},{"name":"valium","email":"vincent@appandflow.com"}],"homepage":"https://github.com/AppAndFlow/s-express#readme","bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"dist":{"shasum":"157bbf5cb8bff3a6fa99d56bd580a22659c99257","tarball":"https://registry.npmjs.org/@appandflow/s-express/-/s-express-1.1.0-beta.27.tgz","fileCount":47,"integrity":"sha512-n2mk3Ws1jern1TBXnkuxGCEtCl4Zu07Kj6/hRlTOcI1WInRToB/wKYIP26Cwrlo/qzqPyQwEsDE28BuAECeYKg==","signatures":[{"sig":"MEYCIQC3a5cUtyI4oM2axaUNROxYtkQuYKVaPyv1/e2YaiuHbgIhAO5PTcLssSxBnACpX3kZV2Ax5O7sUoV+jyvdX2G70Wmj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89465},"main":"dist/index.js","readme":"# s-express\n\n<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\"\n/>\n\n[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/s-express.svg)](https://www.npmjs.com/package/@appandflow/s-express)\n\n## Features\n\n- **Generates OpenApi documentation at runtime in .yaml, .json and .md**\n- **Handles async errors globally out of the box**\n- **Dead simple API and almost no config required**\n- **Provides a simple wrapper around Error**\n- **Fully backward compatible with exppres.js**\n- **Enforce json response aka contentType: application/json**\n\nIt's basically express.js with a bit more sugar and opinionated stuff. I just wanted\nsomething that would automatically generate openApi documentation based on my app\nendpoints. I know there's a lot of solutions out there for that,\nbut I wanted something with almost no config and a super simple API not far from express. Hence why I made this little package.\n\n### Installation\n\n```\n  npm i @appandflow/s-express\n```\n\n### API\n\n**Creating a server (minimal example)**\n\nYou might wanna do this in your index.ts\n\n`index.ts`\n\n```TS\nimport { createServer } from '@appandflow/s-express'\nconst IamAnExpressAppBasically = createServer()\n\n\n// Don't forget to require the files where you\n// used \"addRoute\"\nrequire('./controller');\n\n```\n\nThe returned value is basically an Express app.\nYou can of course pass some configs to `createServer(config)`.\n\n```TS\ninterface Config {\n  port?: string | number;   // default is 1337\n  useCors?: boolean;        // default is true\n  readyMessage?: string;\n  dotenvConfig?: dotenv.DotenvConfigOptions;\n  auth?: {\n    // You can provide a middleware\n    // that will be use on each routes\n    authMiddleware: RequestHandler;\n    // You can specify if you want the middleware\n    // to be active on each of your routes.\n    secureAllRoutes?: boolean;\n  };\n  doc?: {\n    // These infos will be use\n    // for the openApi doc.\n    version?: string;\n    title?: string;\n    description?: string;\n    servers?: DocServer[];\n    headers?: any[];\n  };\n  morgan?: {\n    format: string;\n    options?: morgan.Options<any, any>;\n  };\n  // list of app.use stuff that you want when the app boot\n  uses?: any[];\n\n  controllersPath?: string; // this is the URI to access your controllers folder i.e: \"src/controllers\". If you don't provide this, you'll need to require those files/folder by yourself. \n}\n\n// the server object you wish to expose in your openApi doc.\ninterface DocServer {\n  url: string;\n  description: string;\n}\n\n```\n\n**Adding a route to our server (minimal example)**\n\nYou can do this everywhere and the way you wish\nbut I'll suggest using a classic controller pattern.\n\n`controller.ts`\n\n```TS\nimport { addRoute } from '@appandflow/s-express'\n\n// First you got your callback à la express.js\n// but we slightly modificated signature\n\n// As you can see you still have access to req and res from express\n// if you really need them.\n// However now, note that any data passed towards your api\n// will be in `data`. Even if it's a GET, POST, PUT etc.., it doesn't matter\n// it all goes into `data`.\n// You can access the query params on `params` if needed.\naddRoute(({ data, req, res, params }) => {\n  // The returned value(s) is what will be send as a json response.\n  return {any: object, you: wish, to: 'return to you client'}\n}, config)\n\n\nconst config: AddRouteConfig = {...}\n\nexport interface AddRouteConfig {\n  method?: HttpMethod; // default is GET\n\n  path?: string;      // default is \"/\"\n\n  middlewares?: RequestHandler[]; // any middleware you wish to add to this endpoint\n\n  secure?: boolean; // if you provided an authMiddleware when you created the server, you can specify if it applies or not to this endpoint.\n\n  fields?: Field[]; // any fields you expect for this endpoint\n  // i.e: fields: [\"id!\", \"firstName\"]\n  // You can add a \"!\" at the end of the name of the field, this means\n  // that this field is mandatory. S-express will validate that the required fields\n  // are not undefined. Also it will be use to generate the openApi Docs.\n\n  summary?: string; // You can add a summary for this endpoint.\n  // It will be use for the openApi Docs.\n\n  description?: string; // You can add a description for this endpoint.\n  // It will be use for the openApi Docs.\n}\n\n```\n\n**SexpressError a basic Error wrapper.**\n\ntodo.\n\n```TS\nimport { SexpressError } from '@appandflow/s-express'\nthrow new SexpressError({\n    message: \"Dev error msg, this will be remove when env === production if you specify a prodMessage,\",\n    restCode: 422,\n    prodMessage: \"If you wish to have another error for once env === production.\",\n    data: {msg: \"any data you wish to add, this will be remove when env === production.\"}\n})\n\n```\n\n**Generating OpenApi Doc**\n\nYou have to set the env variable `DOC_MODE` to `true`.\nThe app will then start in doc mode and every declared endpoint\nthroughout the app will be hit by a request and capturing it returned value(s)\n\nDocumentation will be generated under `/docs`.\nYou can see an example <a href=\"https://github.com/AppAndFlow/s-express/blob/master/openApiDocExample\">Here</a>\n\nI suggest adding this your scripts in your package.json\n\ni.e: `openApiDoc: \"rm -rf docs && tsc && DOC_MODE=true node dist/index.js\"`\n\n## Todo(s)\n\n- **Write better documentation**\n- **Add support for authenticated api calls when generating OpenApi Doc**\n\n## This is an experimental package. Use at your own risk.\n\n## Thanks\n\n- Thanks to <a href=\"https://github.com/alexcrist/json-to-pretty-yaml\">json-to-pretty-yaml<a/>\n\n- Thanks to <a href=\"https://github.com/theBenForce/openapi-markdown\">openapi-markdown<a/>\n\n- And of course to any other open source libs used by my package.\n","gitHead":"83f10f0461cb2be5d09501eec72040a656fdfe0a","scripts":{"dev":"nodemon --ignore /tmp --ext ts --exec 'tsc && node dist/index.js'","gen":"rm -rf docs && tsc && DOC_MODE=true node dist/index.js","tsc":"tsc --noEmit","lint":"eslint . --ext .js,.jsx,.ts,.tsx","build":"tsc","start":"NODE_ENV=production node dist/index.js","prettier":"prettier --write '**/*'","buildStart":"npm run build && NODE_ENV=production node dist/index.js","generateClient":"rm -rf sexpressClient && tsc -declaration && CLIENT_MODE=true node dist/index.js"},"typings":"dist/index.d.ts","_npmUser":{"name":"valium","email":"vincent@appandflow.com"},"repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"_npmVersion":"9.5.1","description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","directories":{},"_nodeVersion":"18.16.1","dependencies":{"cors":"^2.8.5","klaw":"^1.3.1","execa":"^4.0.3","dotenv":"^8.2.0","morgan":"^1.10.0","express":"^4.17.1","js-yaml":"^3.14.0","fs-extra":"^9.0.1","lru-cache":"^7.8.1","quicktype":"^15.0.258","node-fetch":"^2.6.1","@types/klaw":"^3.0.3","require-dir":"^1.2.0","jsonwebtoken":"^8.5.1","ts-to-openapi":"^1.2.0","quicktype-core":"^6.0.69","openapi-markdown":"^1.2.3","json-to-pretty-yaml":"^1.2.2","express-async-errors":"^3.1.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^6.8.0","nodemon":"^2.0.2","prettier":"^1.19.1","typescript":"^4.0.3","@types/cors":"^2.8.6","@types/morgan":"^1.9.1","@types/express":"^4.17.2","@types/js-yaml":"^3.12.5","@types/fs-extra":"^9.0.2","@types/node-fetch":"^2.5.7","@types/require-dir":"^1.0.1","@types/jsonwebtoken":"^8.3.5","eslint-plugin-import":"^2.19.1","@typescript-eslint/parser":"^2.15.0","@typescript-eslint/eslint-plugin":"^2.15.0"},"_npmOperationalInternal":{"tmp":"tmp/s-express_1.1.0-beta.27_1709140020566_0.9341533982752284","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-10-20T17:10:51.349Z","modified":"2025-06-09T18:07:37.795Z","1.0.0":"2020-10-20T17:10:51.756Z","1.0.1":"2020-10-20T17:15:50.300Z","1.0.2":"2020-10-30T04:14:14.277Z","1.0.3":"2020-10-30T04:23:24.388Z","1.0.4":"2021-09-21T00:27:04.392Z","1.0.5":"2021-09-21T00:39:09.947Z","1.0.6":"2021-09-22T23:53:40.733Z","1.0.7":"2021-11-05T05:02:16.032Z","1.0.8":"2021-11-09T07:53:52.449Z","1.1.0-beta.0":"2021-11-14T20:07:10.077Z","1.1.0-beta.1":"2021-11-14T20:12:49.929Z","1.1.0-beta.2":"2021-11-14T20:21:31.415Z","1.1.0-beta.3":"2021-11-14T20:36:03.082Z","1.1.0-beta.4":"2021-11-14T20:40:09.229Z","1.1.0-beta.5":"2021-11-14T21:49:32.599Z","1.1.0-beta.6":"2021-11-14T22:05:59.201Z","1.1.0-beta.7":"2021-11-15T03:26:00.458Z","1.1.0-beta.8":"2021-11-15T03:53:47.789Z","1.1.0-beta.9":"2021-11-15T03:58:17.881Z","1.1.0-beta.10":"2021-11-16T05:26:43.658Z","1.1.0-beta.11":"2021-11-16T05:41:47.315Z","1.1.0-beta.12":"2021-11-16T09:03:01.120Z","1.0.9":"2021-11-16T09:04:21.629Z","1.1.0-beta.13":"2021-11-17T22:51:49.808Z","1.1.0-beta.14":"2021-11-18T04:39:13.458Z","1.1.0-beta.15":"2021-11-18T04:52:26.647Z","1.1.0-beta.16":"2021-11-18T04:55:49.602Z","1.1.0-beta.17":"2021-12-15T23:03:32.924Z","1.1.0-beta.18":"2022-03-20T01:23:48.272Z","1.1.0-beta.19":"2022-03-20T03:33:12.942Z","1.1.0-beta.20":"2022-03-29T19:34:49.107Z","1.1.0-beta.21":"2022-04-29T22:19:44.666Z","1.1.0-beta.22":"2022-04-29T22:21:38.362Z","1.1.0-beta.23":"2022-04-29T22:43:37.640Z","1.1.0-beta.24":"2023-01-09T01:05:21.880Z","1.1.0-beta.25":"2023-02-27T22:09:28.676Z","1.1.0-beta.26":"2023-10-16T19:23:24.627Z","1.1.0-beta.27":"2024-02-28T17:07:00.714Z"},"bugs":{"url":"https://github.com/AppAndFlow/s-express/issues"},"author":{"name":"Vincent de Lafontaine","email":"vincent@appandflow.com"},"homepage":"https://github.com/AppAndFlow/s-express#readme","repository":{"url":"git+https://github.com/AppAndFlow/s-express.git"},"description":"<img src=\"https://cdn.discordapp.com/attachments/688484592348561446/766241998868709406/unknown.png\" />","maintainers":[{"email":"quimperemanuel@gmail.com","name":"equimper"},{"email":"janicduplessis@gmail.com","name":"janicduplessis"},{"email":"team@appandflow.com","name":"teamappandflow"},{"email":"vincent@appandflow.com","name":"valium"},{"email":"vinettecharles@gmail.com","name":"charlesvinette"}],"readme":"","readmeFilename":""}