{"_id":"@corva/local-testing-framework","_rev":"56-446fadb5661af7bfa41d34722d893731","name":"@corva/local-testing-framework","dist-tags":{"latest":"4.0.0","next":"4.1.0-rc.2"},"versions":{"2.4.0":{"name":"@corva/local-testing-framework","version":"2.4.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@2.4.0","maintainers":[{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"}],"bin":{"corva":"bin/corva.js"},"dist":{"shasum":"cbfe8a097dbf1b4d8357599abd6d148664c10ddf","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-2.4.0.tgz","fileCount":24,"integrity":"sha512-NbmjbcmutEKD2Ioxu1BzbxNJ8IM1ULrYLbb6RexZKmIH5rw3H7m+rDfo1FjRfq2XQu2tyu3gA2vxwlpSk8s1NQ==","signatures":[{"sig":"MEUCIQC7ca8WNWNhZ+Ms6RV6+PX61FQmVyM1gTJlvW/GmUilTgIgWThN7X8+oCWEcpV4Jpi1zqxMvyxn1MEnEo1zXITlkgM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":590838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhCAwCRA9TVsSAnZWagAAMHMP/0KsF4Lgyq0LcicP4AvM\n4/tGuSWEa2KGfK9yZSulq0FZ/Vi95BvrK7+06sghJUSeswwWHVx7XXzTktSO\nXcYis2hAdCysagUUA3RDt866e6y+F3krVBNcbkwhoscVd6T9iDD9i0LZS4MO\nIFcrXWLVmnXS707Al3Tmt3OP54VewWAhGCCZJ/Lby+j+44DRp7W41gIiv65W\nxpnm67NMYBPVfX2L27lfrejHTbA1m7ipMdMBu7sJhQIFbTjtFvS8K4Z+lhD7\nfMEnwcZipyGPmFIpigslw+ixJ0u9nlZGoJG2LM8Wv28ZHeSvwWJp2YaB6pCp\nbvC4Gd2LuTi5TBCG0gBX8mcbE3wh49CBpzoOCChxb0XAWOukZ3X4LJPIRjnO\nGudjmdWmGMsob6zUBGkqGNae9t3pPo7Rds/ZGdlrEZzsRaj0VJjXJi7Sf0rI\n6Bs+F7YODQxQ3hTymPHGze6f9IWjalKP32B09PMhXY6drhllKBo8K5XLzgHh\nRwqKd7QyDg4XWpHBWeJ4BJ8M6WqUqGIBvhVCHjaaPFQrWHg96kQXvNd0V0ez\nUBq/QSuLbtbN44YIbtB2czhz3m59WAifWaJrPhphKBporGWBCyR6MXRHGciD\nScBnInLCzH+WomHG/jOHQHL1gXU2LsfPt/5N6R7ilLNiXQUhYErtAMrjjBsw\nUSMi\r\n=wThy\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"ca13a8b3c77ad7c277fe6398a6bf52ed24618a16","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run unit","unit":"exit 0","start":"node bin/run.js","release":"git add -A && standard-version -a","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.8","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.13.0","dependencies":{"rc":"^1.2.8","debug":"^4.1.1","yargs":"^15.3.1","config":"~3.2.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^2.0.0","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","jest-junit":"^10.0.0","typescript":"^4.0.3","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/yargs":"^15.0.5","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_2.4.0_1602494511991_0.8335083664060707","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.5.0":{"name":"@corva/local-testing-framework","version":"2.5.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@2.5.0","maintainers":[{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"}],"bin":{"corva":"bin/corva.js"},"dist":{"shasum":"30b1ec5468a5ccb756914fafc3e4bc5b7cc9cd4e","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-2.5.0.tgz","fileCount":24,"integrity":"sha512-vnyvQv3gryhFZ1MjqTbQRLJDtbt1gfmZUQwVbOlv8VTMC7H2VmUFTsll7P3I3zjXImkfuvdCNDwrTPHfVbnM0Q==","signatures":[{"sig":"MEQCIDgyA7fb88o5uAHfFwLv6BUD8qEnkPddd7O7aI6Dqgs/AiAMhAibTZ1K45YhBy9c4su2b9zGzsHgIjRR5mNWZBFKPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":591117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhXDjCRA9TVsSAnZWagAA7EgP+QBSa90y+8YEDmHZAS/g\n60U4DV8TSTekmS4IvYnOUrEEsRzPnyou5za6OeJzCa+jTB88+tQ4vUIS7e/v\nrJ9KHw+e7B7Y6uiUN8H36hgyJxNJTnfi151hqgiGkQxt5ZcuI8H0XGSOJOtd\nsDZ7lx/15DTc4iwigsLVzjVXh2HKGlBFD3wECxlBXoKfpELjQnK9kZdvUmwI\nveTqJRnEEmhNArmxXNNN4M9K1bWkbA/OmilhVnMQeupsbrRaLJCOMp+z/VhW\ngwsW/GY20T6SXS8eSCwHsjRS/Nhy3Xj8oJpTc0t5zcRjcKES0D8fLH8JKHsm\n8x5aEgChQUpFYploF0kDq4E6A+VpbtdQQw1zxSqsNlkzrhMSNB16afRePOq1\nRLllkYLmAP9dP94H0DqNAU9rIyzkjtQZm1UgP06TAMr6BbwKMpeycQWZVc2A\n40FnLrKCtfYp9f5qA2rTlUnvwxe6l0PM+Rv7GUvhLUXlltYor1IK+v9oK5Ei\nQrNV9A4sapelGqUxzgOmXdPvBNF6EeZniFTJkfpJqvYH1Da51tosgJFdHFTD\nvGFojFMCnEOwEeWFiY43lNQkdE837+mZyz8iOQTjwsihuVOyhOjdyQYa6g0Q\nSm8CLmAgjRBLAYg+n7pM4aYxO5dn1n01RHwP4hdF4+q2tItO6wWQfUJtmIEG\nwsmN\r\n=8CZD\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"51d73f786cc9bfd69a9f5ebeedec638611c9a8f4","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run unit","unit":"exit 0","start":"node bin/run.js","release":"git add -A && standard-version -a","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.8","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.13.0","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","config":"~3.2.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^2.0.0","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","jest-junit":"^10.0.0","typescript":"^4.0.3","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/yargs":"^15.0.5","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_2.5.0_1602580706845_0.6330606652134902","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.6.0":{"name":"@corva/local-testing-framework","version":"2.6.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@2.6.0","maintainers":[{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"}],"bin":{"corva":"bin/corva.js"},"dist":{"shasum":"3eefc373368ee003fec0c49278e5156a7ae66dad","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-2.6.0.tgz","fileCount":26,"integrity":"sha512-rRk78qD9IUT1obWFKi4L9ki70f7yFRXq1WSx0KlkCvKQOEaH4XWQgLo+LS0HJtO3C9iX7dQs7X6cVQhZvVFDxw==","signatures":[{"sig":"MEUCIQCTiJl2nUefDeUkdyvagLY/zMSCp0bU7JwsP/96TMGrsgIgP82OnmrNw75Ze9GxyKI2O+39S5odtBajeQ2Kti1+4g0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":602300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzzVFCRA9TVsSAnZWagAAVwIP/3IWWOdo6jk0U5/LS6yJ\nv8rgAU+EHS68KVo+dmypgspooW6pYyl8fcT6JBLDXodrzYbAmNr4AklkzsuG\nk2kQ4fnNRXDd4S9yqf/yV0gUzZRFGTCCJrGmqdfCSwt3JdfV9Yaq0qIjqmr9\nWVAbfUpbZdxs7vRuHV1TGjnKproWzzjoCmjPc/C/hZljQou06p+G62NtftFP\nIf0Jq/0oOzgIBW3Qm2egASy5bBBZ54rhosDggPao6pETghFKqFd6mPVY/Uxx\nmrffKgJgboZd2DZd/8cYyPuMoWqyzkXhiKJzWY2BT8cMdVb6ntVaUJsstAhQ\npScI2hBR34k0BAPHFDglqNwQotng/qpT9Y+ykekPk/F4WJ1HXGJ88giYr/Hn\ns/VS7sw5lUVxvrCl5L5DowiV925jssvr6CoAxWoRJFENaFpsn+Me3c75iXTU\nRmGRtrQb354vrxS8NWGlqAtiKn14dOiZccDAFSlBiyZZxGGg3x0Ikdrl2Ewu\n5IqUzsKmAF1cHJP8H3/oRrIdtSR+/tn1ctSHdhnUJF4gHiSSPZP5tO3yMHii\nh3ys1OJyKTbiLKoH+BqCxGwShJNaJgPy/4ggiGmpLoq4zyWP53CYuf+gr2lw\nRrjk5ZFVsMGr02Uw9dkdsDKdnoRaBrY5u+GFxdpuwr0LdYQggZ9nyTDSJzrN\nZbd8\r\n=Xr8R\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"9a58043ead55ed1ff3759d8a0d839a007d22d045","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run unit","unit":"exit 0","start":"node bin/run.js","release":"git add -A && standard-version -a","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.8","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.15.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","config":"~3.2.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^2.0.0","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","jest-junit":"^10.0.0","typescript":"^4.0.3","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/yargs":"^15.0.5","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_2.6.0_1607415108539_0.4717463107742761","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.6.1":{"name":"@corva/local-testing-framework","version":"2.6.1","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@2.6.1","maintainers":[{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"}],"bin":{"corva":"bin/corva.js"},"dist":{"shasum":"f097ef147c1d2c2399b6f7e21e27a9a1564cdd8e","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-2.6.1.tgz","fileCount":27,"integrity":"sha512-08PpwFUu9Jj8i4117OPah7R3zH1+BxG6C5QBOgqgGISclRxS3kLBrKHFk3r2fDLYFy9aCh3m4w3otK2NHq07Yw==","signatures":[{"sig":"MEUCIH3CT78J54qHJPvWsuJND4Nu2iYbNsrwj+1g+DhJQwmMAiEAtot5oBVMQrGAC08jz6s5jQUlr4rVjzDT2PAzZ9W0TKY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0jEGCRA9TVsSAnZWagAACaAP/itfU9XNmKikzPvNjB2e\nP645tFB2Yr4gRfi3dlFDFEyFMg8Jb699RfDbho4a1OhCAvBduzJe70QAaN0Z\ngCaoIQbpNbha/ak12Tl5rg09tEWVfm9sOtu/6Nj394SbsWNjlBRf7SUSrP4d\nfa26Ymq4FVA2salovEEtL2bkk4FsL0b26+paaICVS7x57ib1fi0pQKeZpwrP\nIbSU38Zc5Wv+vdNvorLq9bmZwjFf2i9jRrvM8rxuUX2ZWMdBPFNzPrwbdihD\npQ4BKV4GIuBNQI8c1Y1+NfVjX1dlTvoMlrfImg/I8ltNLo9wm1YYL6euYU5p\nfuGi4vH6Ipr/A04lcDp4G3Cv4INsHk1gHJgUF88sXstcAdP4EhNqsmjxsTan\nhn8cu4QBES0ufrvkaYSuQ9SsrJsxjHnEMeNr0eZaOrSBe9fH7crYNhPEBcHe\nxAeUW0zfd9xpOGKxreI9A58YKnKRRQta2BshoDxyjuyUkQRzvyUKP+vLifRP\np4/1KtAJ40WDXQU+3aQsInu7q7MP39I4DoVBw1cQo2zkzIGPlbkE4lr2IU3q\njjUMn6jxjkV+7trwO99eXyVDDoyF+xOtIJIy5/64/+kEaXsP0C3EkJGfYX1w\nR1pw/S4Z050N5fwJwMu7Lo/3G9qW3FGBsi0rpgMRplQYhKjz5/kUUlQnSPd7\n/jjw\r\n=Xqkf\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"391d28b80092432cc649d98a10caa5edcb65ac38","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run unit","unit":"exit 0","start":"node bin/run.js","release":"git add -A && standard-version -a","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.8","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.15.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","config":"~3.2.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^2.0.0","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","jest-junit":"^10.0.0","typescript":"^4.0.3","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/yargs":"^15.0.5","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_2.6.1_1607610629893_0.27592710709149193","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.6.2":{"name":"@corva/local-testing-framework","version":"2.6.2","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@2.6.2","maintainers":[{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"}],"bin":{"corva":"bin/corva.js"},"dist":{"shasum":"5c7f315b6a5df288b70673ce8ccbb600673db3f9","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-2.6.2.tgz","fileCount":27,"integrity":"sha512-hEnTOuqulQckEmdwVVqSb+PWCx/gr917H7Jk9YGR8/BdZVHBPqSPbIkztD/AhKc5tauRWvA6Cl7j0hshQatAdA==","signatures":[{"sig":"MEQCICwB0ltnVZR4too7XNEOi8lLOsoviFg7nPTDNA6FpUJiAiBtVaUYFT8gFziTxC3bTKXltIbDVyWHeYS670ezrB0EUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":603989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf01kICRA9TVsSAnZWagAA1s0QAJe82pLI2hWFpwSISb7u\ngCQ/Zb/uzf5z9SGAYgqPVJf9rCLj8toKUaV/T+yAW+bbEuh19Qnv/mWC9i5r\nbx6Iayu4XJWYUNpY83h1VNp4HldQ5fAiL29ixPOPeU9TlS32QzQhlZvd3gzL\n2BqNMW6cp04N8gJYCvBVDYDqpbFnCGDGY6KIWlGHAWj8DG7lqRWWCj6FIgJR\nwExKz1r3kpVwNUjz86FMZ0dwc9DdPNrw3uA5sbcE+ena9rMBxkD7unIrusbL\nrtq/cNp7QQV8NyBDZy91rK2dnip5Kcnky7iYYeeMrZ4NYTfat7gzfj3K3gZF\nAAZNbnaqDPZsyHbQnzaBY3mrheX7wJOyk4IVtZxK6FZ4zt8auUIWYCWBeyTn\n6ZYx5eXKTOMzJxXjxsYz51alb0cUVVpGeSnxXVJoYn293b+sdpkB3Jg6ItOH\njceL2dQPOLcp0dCtAyrqi5lLV7m+nkwlW1PEmYyBaDlB4cTpcFGWCdPwTdwD\nG5N3SumiYj0FnCExghpwxD0x4/zV+q46zItEIHryiHDL4K9M/vXIhuGUCorC\n3XAKWDtfwW+Mil1YikhKxRziyvR6RqLdZJTfvW91f65/WxUzSdW4i3ofH83f\nsaTBd9SG4WtFW3MVkUKD4k2nwETeFNflop/Oge8HXOc2iu4KiWywPllR6APt\nqT5b\r\n=AcQg\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"a5a12b958873ad2a169801fa35d5ee6edfa2fb2e","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run unit","unit":"exit 0","start":"node bin/run.js","release":"git add -A && standard-version -a","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.8","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.15.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","config":"~3.2.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^2.0.0","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","jest-junit":"^10.0.0","typescript":"^4.0.3","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/yargs":"^15.0.5","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_2.6.2_1607686407857_0.017642902515684344","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"2.6.3":{"name":"@corva/local-testing-framework","version":"2.6.3","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@2.6.3","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"bin/corva.js"},"dist":{"shasum":"141a29b99d2639200960109584a6ac2c6215d418","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-2.6.3.tgz","fileCount":27,"integrity":"sha512-9teuyM35UQwnSXM3mzap7ROMCBSHf64ftH1ctEIVP9WGEiCUahvoumz5PxlGgElPi/32sH3xFc1facobuujpSw==","signatures":[{"sig":"MEUCIQC1heTdqonfq/DQWk55AQWQl8vLjtvLKDSWpEh13bnxaAIgFbMuyQsZqmr409jGR0s8edpYPcXDxbv+TeQ3cL4JnkI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":604001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4hlFCRA9TVsSAnZWagAAa74QAJ5ulcBp/n/o0SL02E2e\nFK/F2V4LZb5+D1yTJxHa2qsn3gYjQntxkaVzYlZ/Z/OXoUk3iHtBam3qtEi+\ntBJdFZ4tUQaHIaG2jBQSFynwLvlBdV+2pjFzVmbxwh6GnPreTFBwoOYw/Xni\ndm6aQE41KbKqXmXAQdEquY5za0ySyOM+2wtgQJ2cvO1fciriBbxQS7EsW18h\nOwWbuHD1/6fjUzD+snm3gNBL7Q7BUYmiIj6CIIhgq9BD6ixK92qJehZ+Zzvt\nWmZSHuF50xQaytKq/Sx/dV9wHAhHbADXXW3FGgk87kAKSoX0nzPL6lE7adzc\nFTZchIH04Mo5hG0Le7KazFFCvsldB9NB4pM0vTim50bJvqkjrqc4Zt1obEpg\nMJ7kVpjvjCsn33M/KpRw/nniZ2gEONtWYAExw6mp0H+7ydhaYRFua9WaYysl\nCV2pPIK6IAHk574NjN4+vT/pi3MQqN1vv3bY3AlxuUkKfwBdO+J0n4M7cvsD\nX1EvOQa1rTJWpZC4gpRxIehMRLYLz3rq9Fxo5c6BMerUkVbsGtnUvR8+xqXk\nmJoUVv3up84ZLB7ZoZvzD+hCMUuwurivQZRQVgeyGOfsbZuE6JxfrfwnxbHL\nct1dJTXjN1sWWx0LW8L7mhAo36iTP1/nOz1foyypHG+bXVYmCB8BPFzOmamZ\nMW82\r\n=S9CE\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"d77cdc9e5f7bd53804dd1ec313ca20683d76e177","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run unit","unit":"exit 0","start":"node bin/run.js","release":"git add -A && standard-version -a","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.8","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.15.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","config":"~3.2.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^2.0.0","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","jest-junit":"^10.0.0","typescript":"^4.0.3","@types/jest":"^25.2.3","@types/node":"^14.0.6","@types/yargs":"^15.0.5","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_2.6.3_1608653124626_0.6746181960254058","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.0.0":{"name":"@corva/local-testing-framework","version":"3.0.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.0.0","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"c08ec82c4685dd8bb4ff397972b043e009adca03","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.0.0.tgz","fileCount":62,"integrity":"sha512-e4pR6aVLSnGbDhNoVaZD6AONZArjsoqOf4B2nG1BgD5WCgPIqHBPu72Dd42rq7A7t7zhymMhnAqmIFk97YBtDQ==","signatures":[{"sig":"MEQCIHcunEgGyEgj3DjiqE+mrQ5ey/5p068aMCRIjGb0stOrAiAAiDlQPgCRcLBUCeLn098xiEXW1TJzucp2Rjt5QyNdww==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSPBvCRA9TVsSAnZWagAA5DUP/33TO8aYfgRnURBKR0L/\nIk9gDio07tu8nSBnJO5Ptst0d4/nf72JuwWFuEkwtDT0SsxzpO6g685+Pcsv\nsuH31nnMPgTPeSxJw+nKb7uKOjHkx562swIcT5kxAiEmSqDNnsvrDv+RN+Tq\nm3L1zP4bVBByy0Yz4ZCz+ejdaiyjmaWVTs/D4jdxUt4VbTX9q1/rsiUWK7+Q\nXbzhLDKjWuPuNQclG8E72awSbhngq/qSaxikeJFCEe7ozoxTCVpb28FB+YGY\nTFmSfIEYJw4L5hMDGojNQuaVVKvOg1YyZIcKeTjx9ACbdWHfLhOcvgJ8LRGE\nciXtzC1TxmkyKOmq0v5p77AebfRyDmTmt8owpcbFtt4DLsiRUYpkuu2doRS6\nMNb+44X8wPtswR6NenOUlnTCVi/wpxsYwAmH6tK+iPYjUQvIV8fiSrLXW1dK\n+zS9m9WFq3hSXdETrjwzWeoSq64CPEkeBeU3d9PESDPMND/7PhIsQZY7zQAC\nzVNDFa5X4BgDGRHh8J2PoDlW0JvnugD1KUP0t6ja0z7rctjovs1zwBNkMMc4\nKW533hCMTK7YtceQXQgGZwU8J3StFTvdNAVjAgqaFEx0mr2HN5MYLD8GFjz9\nAZMGl8xof2P6wB6S7LEZMF3HXhGkS0rfyGo6SjxJ9anGdxgynCfqicEjgnBK\nGu6v\r\n=jyZf\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"add820ce567dc52945dda0869a78f09bafa21551","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.11","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.0","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.0.0_1615392879048_0.7226285318752279","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.0.1":{"name":"@corva/local-testing-framework","version":"3.0.1","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.0.1","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"7f27d1178cecee7796aa1d82bacf96e90d6a573f","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.0.1.tgz","fileCount":62,"integrity":"sha512-GNNiGJ3fgdd681e8n9HJYjL/fB/o/nIxXgnDReaFjRym8MQpkCiRXOHwhvLivgH+QyILAAyV9w/I2kcedHx2ug==","signatures":[{"sig":"MEUCIDKhT290jDWzBHxKNk9mp0c2OozI6UELydzHqb4vfrVaAiEA6hkxQ/SuxJewe1Fq96L8gO+BEo12OtrBhxtdRAoCWQk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSfT8CRA9TVsSAnZWagAAH7kQAIz2KO5NUMob/+EYn8Pc\ny00IswmrdBYz0qKFOiwkbYzY7DjCb0zKp6YtagCjqiFBNavy8oNX3vK9aVYr\n6RYOObk80KwIMcQEX1CipySyn2aMGiUMf6Mz7xs+nNDlrCxC4YBAE5O5WJDQ\nJzgIa02lcoUh8MRNOxSrg13sy8DvnTj/pv3652wP3rUbAgaNjA7Xyn4LUPOU\n/rJTQmbzwrkXSIiCcY0UmmZWPTitaHsfHt3kICcBUGUsbME8b5PcpZc7N6f7\nOLIwmN+sUlFOmAf6eFUFJr87dDiS7djIg4iT6vOro9X/98MBmEj0VAjXotTh\nRS3/vJ+RVxh2RUHZlxJU2S775+nFSpHbEaXVAY6u/hb0tlLYv9j4NBgFnwNz\nff9iFt07sQkogd4UJ8vQJRvKxPtU16zh9UDxuL097FuZ2onAV4FEciMb0iV2\na8DiEZ5SQ7cKjbLdHG9rQFIvpYVCNtgDLGCVlX6V+zxqCV78OnfQ2yJvUsqF\nP6YdMd0UKMLA0T8/7UdvTKZdx/OFJwVpZb0/MXJPEXiKorMAzgZDq5QkutIk\na+I8NBe9RZoaD0e3k0rO523SXWkfLLNAhNiAozzqIHptPw7wAz7VTXErHdP9\nnzk/Ipkxqn3u1ehXZYQ6GjNHVYrZ0OSQJTk90BSIna5UBI2qGliFBe9ke9Mc\nbxk3\r\n=ada0\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"6cbdfb0ab1f9503699e8a24bc5496bea46474d58","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.11","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.0","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.0.1_1615459580220_0.23541635739908062","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.0.2":{"name":"@corva/local-testing-framework","version":"3.0.2","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.0.2","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"c9d7706167c1652a3c529bd2767d1f5c7fb8ce94","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.0.2.tgz","fileCount":62,"integrity":"sha512-WgAbcbTQgZY6HbLG5osB6pJ+GuHf7Rq/+/1QyElpTXFZrodrjCCtuu+ELSjjgXj82A4nB4uBjkYcAFokMOglkA==","signatures":[{"sig":"MEYCIQDiiGEE+5JHhDK4tPlCKsoA4XhpSPmdsExwDxBVoRLh+gIhAOddfxlB4u+xqmpWnGhKHag8okuhxQ+rEtHvZHCag1HI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSgAGCRA9TVsSAnZWagAAAJAP/jSOaMcWplrZqdLiD44G\nmdGbKMv96ad86lgQ5sq1JbuCAhSCMbgvq02Pcg97FQSHWyBDeIyI+Ie2amOy\nqbPmANSg+68Oxi35nu9L0DzAIMUVQHUwAkhB3Hx1jAURuHuacwo7qdrOwDch\npBVhD8nIDhQLMwSD+0hz4JnDHxEJLXdEB1VXgbtxeHzGSQicdG/5jTpvvE3C\nhB/IFYQtwElC8xDTip8iiiYlKY35BoKkxhYvynRzk6/KmoCEXsdqJ5uSwCHf\nI3mHCGNWAFWZfkoFs5YMn/EoY8lsI0JixqNPjtRBWgflWQL8ELF/7IrWeJHo\nOmhVGCqpv97xByygd5ys8rMz40nKVe2qZA8ujrjaq/G5ovMIrFFy11Eorxnr\nxs1bJE4brO91UH9b1TserLgdVSG5ZKLDL+oPytu+tImjpWJL+wU0LxJIdTQ2\nvhdxnCZ1hSp7cYOixBWk20hFwpdPSH0eta5vU4ViLjRu67PquJKFoQf6+d64\nYBTcySGcA1f0Nr9YEyj8SWBG8w0+yBxiyYpplvJF7rTAXhluS7wUFfq7+mtE\n+KmOgXbiIx/+iEzy+PrJlIDXjYBpkN/LxWNocE89efBImB4KWoMm0NVZezLK\nXnKvsuFFUtfm+16cIe4cehoeyzHVAd2oRWgi5r64hiFdR+2OcYCEA6eBP59L\nwYoS\r\n=DJYK\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"5b4a452299dfd0a40eb287d8b46202a83e55f6be","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.11","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.0","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.0.2_1615462406022_0.13828054359316533","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.0":{"name":"@corva/local-testing-framework","version":"3.1.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.0","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"03eefdda90d3a88ceb1eb6f34e218b69cda883a8","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.0.tgz","fileCount":68,"integrity":"sha512-swX58FTCOaWlPVyZLCUX+1rj47yGb/WsdJYDrS9kxbBeEN5D9yC5x1YS41W++V+0dY/Wd7l4JZKAXUTtH8UJJQ==","signatures":[{"sig":"MEYCIQDwj0uoV2zpHQZDHk+z9i7gnE2OpALDj3XWy+7Yyvyy3AIhAJLZBSsZRo+BWehOlyfHHAQp01RDkNAR8f0Qrq0KdEXm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":701116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSitiCRA9TVsSAnZWagAAzyYQAI45C0BSWNge23wwmhXN\nD1DKuAY+wuiF9ysNfat2U+dcRO1Z0gVx3ukYJGzFEmV5qC+SLNGTIqjGEW0U\nVjnSnxrFNckrnl18C5m5qkS5CRGGPqZq0RAmXi2OEa4jmjhrjLmnr2K0vYrY\nPJKlzQh0aBZTF8T194wfuWpiKLuGVfE+TapWsx+Zcadq6YRD/t95e4MP3WMB\n3KyiePVO885tq9gcXVTrzhjN35d0OzCDeiXmQovJ3jZS7dP5i2jnzXKH71Od\nOSX0QuRrcK3Z1Qvpgcz5OA/1Yz6g4YHOX2+DACxzhbgetXNJxvzdujGxWAkt\nn4P6zn2iisQnVDaVqQBei7Ao3579djJczKtbiBpix4u+WwJ7TmCr29KlX45o\nBjnOCHoCRe0K73/X7zKo6Qtriysm0o+qRdwBjkfy8ti+wunCyfnmAiP727+k\neArrdG9NXTXNcs+BSxMLIw6ev8nwZ+1/eYFuR3K60f1l6zPREUF/R6h3ol4m\nJ4QPGDmAdQZWbUK2tN7ZCiZGvmg3hWIKxCk/CZNX1wOV3xNWUSk74ZOBpx0G\nTiVkSO0+yy7qJp1V7Q75NKsatop4vu0aFomVdRaDr7or4uYqzP4STyrsGN1H\nxMKygJYNwuFdpLNSoS7dHD8ukoA0Z0bwe11MSPj/C90wGv7nBl/2Y5tTVP3x\nRaiX\r\n=5MFb\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"d3bdbf393026d5fda165cc7e43e90197d5311df6","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.11","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.0","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.0_1615473505708_0.14279317446283146","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.1":{"name":"@corva/local-testing-framework","version":"3.1.1","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.1","maintainers":[{"name":"corva-devops-automation","email":"devops.automation@corva.ai"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"354fb4e09350882d6a99aaee253fc8254f07dd41","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.1.tgz","fileCount":68,"integrity":"sha512-cgiXDzb9Bh2htwZZ4T2NkWZxJaX+0pAGyhdXd/cS8VAJ4H33lB0Wliy/QgGnxOUtunSeYn5mhffIGC0NeeI7cA==","signatures":[{"sig":"MEUCIElJf+5X4nh2c9LJTiZyDYUuxKUBDujCrQks1TVp7YLgAiEAnTSEmt3HGkRMAkkQxJy0wQvfwtF7ypwS37GxMMxePLg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":701447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfau8CRA9TVsSAnZWagAACa8P/i7fQB7E67Xdq2B63UPm\n2Kl7oAp3BcDPr9OV00TSETVm2T9QdvLsKBk7MZWi/kDNkvxWMA6tuyta0UVr\nJv2OhFK7YRnCJ8eKXSwJXE8wxoCaFRxk5Ek7QVvjTP//9rdGbMKX4xLrNvSL\ncukzskbnufdCsb3qV849nkmO4t2Y3aXLXG9HmhaU8jI7+t69FVgnUSrTWu4y\nQ/tqwl086BOy52VxUBpQQ7kiQiuN41vk//Nq+/HfK97QsknGIrD4TTGWAGKn\nPDlBxvUbtUybtZ6WvR8C4cOETTncwfTITE3ZDAkheKn+8OAi36/8t3rjjNcN\nvWqMXo1SNLwjGdFZsYqIYSNZyoeBu1m0P8hvEEeVrooGkI7fq67hcXjSyeXE\nG4WPJterHDvV3Qj2LQHYFn4C0y5BGXD5HJ0ul31Tdpj2bSpAsVdRucH83gyZ\n3lUENQy57gidjvhIUt2lsvdNdVNDIXM4MWZgBXgYA7ZS2ERjagnc0F1pzYnF\nJqF1grcgAjvegqA7oetjsIfMhpo42MppmqYBCujiU5+jJYlD08qy39FFtEop\n7R9F9C1tRxWd055OjAYup6hr7qs1y1B5jV4DAEDKDhQLqSvoSzWCOSt5lk+z\nDJY/7dk+1yDehzN47UDzkS8wtAPNKiL9D1nfxlCcJzjTKxJ/jfw8Wq15lJvh\nXh+t\r\n=9Mdv\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"58a07d707f9f1b5e8040d534f4d7b8d99ba2ee60","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.12","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.1_1618848700017_0.9881000656666732","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.2":{"name":"@corva/local-testing-framework","version":"3.1.2","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.2","maintainers":[{"name":"corva-devops-automation","email":"devops.automation@corva.ai"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"54416767e6cefd41b4d3648df09124fd2fc83e7c","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.2.tgz","fileCount":68,"integrity":"sha512-Fb58VTq+hgaB+hWBSz7f/e9bRfffH8UjKIwdSNsmebBTSibKlAjsEXpVDhdohJR3wMINF00oVZD/8iNvMAUJ2g==","signatures":[{"sig":"MEUCIHPf5Oz2SuNSQgUzCjga+tZS2a6HkcEM/HM7hhuJ7WLZAiEAp6m69EKRBXdcLUCHVS/MU8QAD8HQKnv6tYSrwvYUl0I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":701496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgitcyCRA9TVsSAnZWagAAV1QP/AonKNYQihuAe8rpTIJQ\niWi+FYCtJ/tQPNDZAH+SZtP+1pc3TbvZX3uvCvPT0sOiirVQBWgB9/FJpLZm\nrFv0nDTy8f1ZOmgfWqUm5i3jnGhnFq7yCDL1iPULdwF4S61wo3xrjLXZf6o1\ngoIBNcZVpn5fQ1f5+ozaIYeG7alIU1QlVRNFGSqirIQvDsYTWWmfdKf6Zacj\nycFwWe7O7je5WCSLWhfsnOf92/66A4hySGjvodnWp+YcYpFc0YBuuWq3GxGV\nGqaN5yKnNxV1VXgUnjsBtQ7ATLIINTmPFRbcen/am39TqjoZUfHhKqqO8mFo\nHz1/9aXnTPXGyrJTaIRyRjuf5kBgChonn4gU+gBdpdjt/FXSqr32nhrp9m7X\nwXrtcwSFquGWv5mR9KIrIecVfDVdh/GuMrlgctVA0opstZ7TWUwGOJfxF+GO\nblBAiEt16pFnqfzy0T43jQe5RZYcfUuzOjVBUESnJOrJxFFVZsP7i69d3GDL\nqiTQmtRvQtRwtS2b1i9HFoOjVGtwTfhxx+YGYqxjTfuhr9a5S2mv1zeqDYZ/\nzkAV8coVq7Hfg4oUB7p0wnmBC0mgYAR1M8azU0GYJU30POMWHVf5Wrpm/rrg\nPOktQijmhZbqg6LBhkyWUQ+I9fDcCA50v5sqXs34Ml2K52xaqMR6pI4oihWS\nbNv8\r\n=YD0K\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"91e6157e2df98427726c98a64d45558925feb86d","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.12","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.2_1619711793859_0.8948287690656131","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.3":{"name":"@corva/local-testing-framework","version":"3.1.3","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.3","maintainers":[{"name":"corva-devops-automation","email":"devops.automation@corva.ai"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"3bee226aae8f80d7d95d30cc3ed17d85ee428380","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.3.tgz","fileCount":68,"integrity":"sha512-6Azly0DBVSN0GYUxm+vdi1Lnn0+XMm+74mlWttete5RrLT2p4B3cBPj6QytSGFIK3XePOTQlb9N9fkJcfKTNbQ==","signatures":[{"sig":"MEYCIQCWWcbnRx/4mutdAyQSGv4i+CV7ancFGyTUTwYE+jFtrAIhALrOzZqD5XHMYPiBG+cHdAw5CD3W0d5ysJiUG2LPohPH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":701482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkRL5CRA9TVsSAnZWagAAvdoP/RWIoxMdhZwM2HYXTUbf\nyjHZcEB59H/0ohXa+zoCZN5lWNm37M3mZthWF6wjB74NfNCGl7vL1tTkOtwD\n80Xt4s2a6Vjcvprm7deF38i9Oxw9H+v0r7ez4aMPeBQcEcteRaJAnmnSaYbL\nsVHZ4j7m4TPKDKxzaypKCVW705axQCTY5nNM4zGACglLl/acmEVwMnpS4g+z\nOXDi+vHeTL5PeCuuNVd0EnPVXxmS5nFkjCVK+zC35liXRCgkDJaJnsqa8yCP\ndBZHFHfZ76M6ypOLiAt3Z9kU1avGZuRicda6l9cxoTRo+I49px6Jfh+GsQ3z\nx1AqnE0AhVJT3k392bT2bwzP86kl3jLX0YqrJ4ylIZHjodmy31H3PCg5Vptm\nwZVlbnWDB+xUshtyNozHuUiYQarcHz6Hd2drW871OIii8VyVpr055FVq2OwL\nFnlgayZFKz7v8Bs49Lux1Yip8YelJF1OB1YjimK3/d0sBzpkX3akWW0GpxNY\nzP2VzUnfAC9usS8ZDUom904t41KBM++kKSwl+4rNNOjVsuVyU7AkyLhLn+Lh\nffcMwGRDzF0cEJIT3mtNpQ0YxAJrTnQfB1odP4uSFBukkft6lFC87jU29mjx\n69Tp6mhJ5vqCE8D9IOqPlhmXfjTEDnbi8A5RpY9nI9bSAkXhOCmWnUaeRyfS\nEg64\r\n=AhCC\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"561e861bd7dd7b1cfc5874c457b02b40ddd5a0e3","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.12","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.3_1620120312886_0.7988662874902992","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.5":{"name":"@corva/local-testing-framework","version":"3.1.5","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.5","maintainers":[{"name":"corva-devops-automation","email":"devops.automation@corva.ai"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"258ab3b48385c37071ac51fce3b986acc45f136b","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.5.tgz","fileCount":70,"integrity":"sha512-o6HN2immirIyNzWeoNXywJB30d5r/emybARbUKJCqKJjq2rSp4kHTM4wwMrmvOHWgJc85OgdYEUkgzMR6xrnqg==","signatures":[{"sig":"MEUCIAdQvNxoFgDo50VcTw50Mjauec54Iarqs/mbYDe2aUNyAiEAuXHcRpjnQ2c/XYUHnDRksFmOmj8J+26slda9ZQ6U4C4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":702603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgksSJCRA9TVsSAnZWagAAIW0P/3JI0shM+HCb2Zo6V3gK\nwFXpDxiD+F414IBE7dCX76zagMmsIaghC7YsAl6EkFKgbvtNH1zTKGQnSLLm\nEenkbJYrcoXIGcgpWx9rx5ehSFEl5zZIyPSyS3q0p8ABpwzMfA7Py8m8qm/B\nl9qGj2T4uPmajVtrAO3vfb8AZcE9dW9eousNAbtOAATO7WnKxVrSu+INekIn\nBLS38jGLHdJuHk/Zvo2EDH5jv9VPMfk9lzbbXWKd361H8W2i29JWsbeOK5Hd\nLL3gfC4IrtJibo6Vnp5ljaNTbvuq9mCcDP5zMHZmFDgkzaAWMmNmACY/wd8Q\nx7rgma7ievIIT4W+rs+AVlKi7S7xqzGXhG5Tifbnm5HHuHc4JacdnY3a0dvo\nL9YttLSPoJ0QHk+ZOqv6KU0F1r6jWNMHkiHZeQszSkQCts3mYWVLCSbqCEoQ\nmEAi/LJQhrfXS8Z6YXpvlAqdTR3jpUR5aItob8f6ULMv566XcdHWt3CXqSrY\nmCpUnFJxYAoCEkqORfEuu1/cf1y/d4WwSPE+lAuDGz5Y5/285vuLvAYI4ctC\nQNsO3H3xauKBRCrmgNC8vlrbtBQrovpEfpVM7xtgB0vISKvBbd4/uWyHQytx\nFjIJQd/e+iWw90w7m+vABE0Nh2GU/HtaDA3xAK0+uyZY6FIlF5CaPGQy/9Il\n6v8m\r\n=zyXZ\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"bc1af87959912a6c999821a3c5571bfd17c23f67","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.12","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.16.1","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.5_1620231304892_0.06768796724444393","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.6":{"name":"@corva/local-testing-framework","version":"3.1.6","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.6","maintainers":[{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"3d3ba4b86a6e103972b0ed9f4ce2db10ff916492","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.6.tgz","fileCount":70,"integrity":"sha512-Vu5y4TIKgkCBLY2EjYUDqMlGN0HnbXu9zMpQ0vaNxjPfzoDBM6pOrFTwwVLVyGisyk1OyZXaI9EaXVufjtaDlw==","signatures":[{"sig":"MEQCIBT9c1Gzyc6adQP7156VM4/h3MlqW2pv4Q0yPRnQr87pAiAYAYN9OOS7KIepe+5e7Dkcqm1IAset70egEpNHrYE11w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":697594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLKnQCRA9TVsSAnZWagAA3AIQAIHXhGXlIdK4ObSDXRUF\nCDaI1njyOFaTDZ338np+6L0zcLmgJ8Jz/ySfP7fMw7kIx+0sK+5jhT4Mty3e\nMhtuiLc3CzlZjkJ+gGLGOST9UXvP4p0gBrjqx+6m6JR5C2MrUQSn3SDAu98L\n7YjSx/3CaFBCkYL73ZPZhcEhnrmRR59vHoNii8dtVvu7DQkiOAPQaxzwii/i\nXrOhNo9NuIFnz0NGUGAs+9/UWZji4NXj12bq7upjwZMz6fFpEvolku8io/X1\nJw35dNhb+nbpyiMHdxGJs6VhIwYPfD8ec8K5NW65yHZG/8NjCFNjCeHJD6lp\nC/f4R1TF/VTqO95I5v/UpZmuJYyV1wQJ4PBh251urzZSGkJy6Jw8EgCFADy6\nTrkRodd3YlQ9mqa0ssVNLlns/sQ6M4Yyx1JkQrRNnnMfcpjTaLThd1/Hb1Wj\nh34PbDJ1HKMRKULnHNR9zjQHXK5B6RBCuJgtubae8ciknYwyJyhE1slo4TgO\nBPgb/FGKBVLdA757XwBmrH87w6ACHYVAKUBA26higOQs273lAx9GysuSH3Tx\nFzhmCOT3da/6Q4bwlgIgHJtRnnXFlEeDyHMfx9uAKLnA9sLcdGsHhW6RqfnF\nptZmmccZvf/OjtRQoi8CKiv8e1WE7MNuNN0bYWPZxX4kKf0ry+igc0hxdGVl\nz2Jh\r\n=KfYm\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"5614e3af6cddcf6d523d144e2ebf7c49230000d7","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.14","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.17.5","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.6_1630317008035_0.17151080796280804","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.7":{"name":"@corva/local-testing-framework","version":"3.1.7","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.7","maintainers":[{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"3cdd36f7dc828e167efa2a000731fffb7fb5191f","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.7.tgz","fileCount":70,"integrity":"sha512-Z6kg7TB09K7y60j7eysJbW5qWmVbXbLrWD13CfaLX2JtFgC5yeSovC4uT6GIqqv4NPu2R6z9Sjp8JLnP4ZL3IQ==","signatures":[{"sig":"MEQCICv3MnJ6Nv5eVuzNUksN6sXcTr14Mcr0Qap9byt2dZTPAiAQnXacnh6jmX05NidruTTf9ZIWosRNCW4KDmX4fQZMIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":702464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOif+CRA9TVsSAnZWagAA04IP/0Bd77xhBg6eKqq/t1IZ\nTvkOeJnHrb69JgaU0jQbRlV+LIhnAaHhoTyCv3uCRbENwn04KqlCizUXFdxG\nDNNKz1XQ9ZwgBTH5uaDEAp6XiTs06DPgD+muoHmsBFuWKQ94Cln9IF8pFprB\nWmsV8qSUvF95vyXyOkl53yXz3lGRByy8LHMWE0QJyd+xucCR9EjrtVlUij0c\nmCkseWmzr1mQH7qdE6uQZ8LVKXvC2k/+N1fUFEWJ9e6QY6O400BsySJJaGwb\nyTNTim0OJAKGewwAs2HMfyN97udlIOBDi9FOHoVpnXfhWns414CoggZ620lP\nHRN4fS+E5DGrPk9Ga6UZo6cV6Knukr/5UxsYJX67GieYyuGGzUMaXk81MORg\nQ2A2LeUjZCPmiNzbN7Bbx3NgggHRjY38GVMKsLAlWYn+8GBxR51rJnHs3b2c\nwfWaXGH0GzZhAXJ11i7GnzZS41CoS5YwdMIIoaUAlxuR9YmlBHlF31R9RKsX\ngXArez0PF2gkg//u2vft8zWnIkpfHqG4+wlIZI8Ci37AGVhjk7tI8RYmjC4w\nKgx9kMd3/+K8BtVExOC49H0+uTKAlNqpTMSDUMpBg0cIM82b9r9VN1sUg8q+\n/DQeKg4Td6oWVjvXUL+kBWYZkSQ0LEenfmcY2sT32tslgzrsU2MnhYfpaFbP\n9jLH\r\n=jAVs\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"a2db8f5f0cec9cf4fb97dfe45eda5eddefd43470","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.17.6","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.7_1631201278719_0.912373996854027","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.1.8":{"name":"@corva/local-testing-framework","version":"3.1.8","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.1.8","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"df27809809aa196e7746dc0e24a967d6f1e3da95","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.1.8.tgz","fileCount":70,"integrity":"sha512-wVEZqJQTgEHQ80Vk6VQFWtyfk+9INO99BQzkjPameLj3c3nc2SuQ5KjonqbyqWmSa059BnJPpeTWyA5mJJabaQ==","signatures":[{"sig":"MEUCIQDGHEdR25g916Ugm7nKiHz2GcTsrlcm33WfxcKWZXq1hgIgNl98A3TTeUDpFrxW1Z2RqXe6PiWM8RAWHhjtfHDu4UI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":702687},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"fbc1613d918e455d717bc9161a49dbd5ac45b824","scripts":{"lint":"eslint .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib","prerelease":"pretty-quick && npm run build","get-changelog":"conventional-changelog -r 2 -p angular"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.0","dependencies":{"rc":"^1.2.8","got":"^11.7.0","debug":"^4.1.1","yargs":"^15.3.1","aws-sdk":"^2.686.0","find-up":"^4.1.0","mongodb":"^3.6.2","dockerode":"^3.2.0","optionator":"^0.9.1","merge-options":"^3.0.4","docker-machine":"^3.0.1","@corva/node-logger":"^4.2.0","source-map-support":"^0.5.19","@corva/node-api-client":"^4.2.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.0","husky":"^4.0.0","eslint":"^7.11.0","ts-jest":"^26.5.2","jest-junit":"^10.0.0","typescript":"^4.2.2","@types/jest":"^25.2.3","@types/node":"^14.14.31","@types/debug":"^4.1.5","@types/yargs":"^15.0.5","@types/config":"0.0.38","@types/mongodb":"^3.6.8","@commitlint/cli":"^8.3.5","@types/dockerode":"^2.5.34","standard-version":"^8.0.0","@types/aws-lambda":"*","@corva/eslint-config-node":"^4.2.0","@commitlint/config-conventional":"^8.3.4"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.1.8_1633357422195_0.41152531764993183","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.2.0-rc.0":{"name":"@corva/local-testing-framework","version":"3.2.0-rc.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.2.0-rc.0","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"84aaacbbb4164525399e08c494fb1650865b73dd","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.2.0-rc.0.tgz","fileCount":75,"integrity":"sha512-C9Bq+xFPfA9abFujJ9Nj5qx1J/rUQ5Q7X4UBWvjhorA1bnzS74G6S58ykBgNh221yUknbcJri8nCYAEX4hbpjA==","signatures":[{"sig":"MEUCIFNT4M5JfJ8I14GIYQzJOkPhqHJZQDA/Jw41+c2Af5fHAiEAttS5VqRnYqw7m44D9nRaybESRi/hvx84QjDnuEyOMio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157707},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- `>=node.js-12.0.0`\n- `>=docker-18.0.0`\n- `>=docker-machine-0.13.0` - (optional) if you plan to launch lambdas on external machines (e.g. AWS EC2, DigitalOcean and so on)\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.enabled` to `false`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: false,\n        },\n    }\n}\n```\n\nAnd in `source.type` select `mongo` and provide connection string in its options\n\n```js\n{\n    source: {\n        type: 'mongo', // source for generating events\n        options: {\n            mongo: {\n                url: 'mongodb://external-mongo.com',\n                db: 'corva',\n            },\n        }\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.enabled` to `true`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: true,\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\nThen in settings, choose `directory` for `source.type` and provide a path to it, either absolute or relative, to the directory where you launched your app.\n\n```\n{\n    source: {\n        type: 'directory', // source for generating events\n        options: {\n            directory: {\n                // directories inside = database names\n                // files inside directories = collection names\n                path: './example/mongo/directory',\n            },\n        }\n    }\n}\n```\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n**NOTE**: During startup, MongoDB will execute files in alphabetical order. Use prefixes if you want to define some specific order.\n\n```js\n{\n    source: {\n        type: 'manual', // source for generating events\n        options: {\n            manual: {\n                path: './example/mongo/manual',\n            },\n        },\n    }\n}\n```\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n#### Building a Docker Image\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n\nIf you would like to build an image on each `local-testing-framework` run, you need to add `lambda.context` option into the corvarc file to point to the directory where the sources are.\n\n#### Container Registry\n\nIf you want to run your lambda on 3rd party servers (not locally), you'll need to push it to some external container registry from where your server could download an image.\n\nSee https://docs.docker.com/engine/reference/commandline/push/ and https://www.docker.com/blog/how-to-use-your-own-registry/ for more details\n\n### Preparing corva-api-lite\n\nIn order to avoid significant load on Corva API you should use corva-api-lite server that exposes the same HTTP interface as Corva API. It operates directly with the local MongoDB database.\n\n#### Building Docker Image for API lite\n\n1.  Install local-testing-framework `npm i -g @corva/corva-api-lite`\n2.  Build docker image using `docker build -t corva-api-lite .`\n3.  (Optionally) Push it to an external registry if you plan to run your app on a remote machine\n\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js local --help`\n\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo specify most options, you may create `.corvarc.js` or `corvarc.json` in your `$CWD`.\n\n```js\nmodule.exports = {\n  lambda: {\n    // image: 'app_name', // use this if you already have the prebuilt lambda docker image, can be overriden with CLI argument\n    // context: '.', // use this if you wish to build lambda image automatically on each run\n    type: 'stream',\n    handler: 'lambda_function.lambda_handler', // entrypoint of your lambda\n    env: ['A=B'], // command options will override it, not add\n  },\n  infra: {\n    stopContainers: true,\n    runner: 'local',\n    redis: {\n      enabled: true,\n      image: 'redis:latest',\n      // url: 'redis://127.0.0.1' // for external redis\n    },\n    apiLite: {\n      enabled: true,\n      image: 'corva-api-lite:latest',\n      source: 'mongo',\n    },\n    aws: {\n      region: 'us-east-1',\n      // secretAccessKey: 'xxx',\n      // accessKeyId: 'yyy',\n    },\n  },\n  source: {\n    type: 'mongo', // source for generating events\n    options: {\n      mongo: {\n        url: 'mongodb://127.0.0.1',\n        options: {\n          // useNewUrlParser: true,\n          // useUnifiedTopology: true,\n        },\n        db: 'corva',\n      },\n      limits: {\n        // source specific queries\n        timestamp: {\n          $gt: 0,\n        },\n      },\n    },\n    collection: 'corva#wits', // source collection\n  },\n  debugOutput: 'console', // console | file | none - write debug data to console or file\n  event: {\n    // json: '', // pass event json here to run single event\n    assetId: 1234,\n    companyId: 1,\n    sourceType: 'drilling',\n    appKey: 'app key used in lambda config',\n    limits: {\n      // specify limits for generated events (e.g. to skip some), format [key]: {...limits}\n      timestamp: {\n        $gt: 0,\n      },\n    },\n    config: {\n      batchSize: 10, // 4 stream events\n      interval: 300, // 4 scheduled events\n      start_time: 1602765873127, // optional, process events only occuring after this point of time\n      end_time: 1602765973127, // optional, process events only occuring before this point of time\n      start_depth: 10, // optional, process events only occuring after this hole depth\n      end_depth: 17000, // optional, process events only occuring before this hole depth\n    },\n    options: {\n      // additional stuff that could be passed to event\n      // useful for scheduled events for example\n      timezone: 'America/Chicago',\n      collection: 'corva#destination-collection', // 4 scheduled events\n    },\n  },\n  export: {\n    enabled: true,\n    format: 'json',\n    collections: ['corva#destination-collection'],\n  },\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\nnode bin/corva.js local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\nOr with LTF locally installed:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker using Docker machine or use local\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will be removed after the test run by default. To preserve containers running, please override the option `infra.stopContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"57d239e093b244048d7d1827f98773c090f7421f","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","dockerode":"^3.3.1","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.2.0-rc.0_1634803918074_0.8378617201250123","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.2.0-rc.1":{"name":"@corva/local-testing-framework","version":"3.2.0-rc.1","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.2.0-rc.1","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"402eb57b797730ef1f2b31b5241ba56aab5f3293","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.2.0-rc.1.tgz","fileCount":75,"integrity":"sha512-Hmvin4jMzw9DxfUhoLDFmtjD/j7MtNFAL0M42QHQGaalCl4vt62SC8paszR5EIRpe20DhiWYyktEG/zEvUuzgA==","signatures":[{"sig":"MEUCIQCeG/PHk6i/+QYi2ihi8HMa4/Tx6taDL5QUrcFfve/zVgIgF9QSLbl3heRdJRCHpmT2S+HFI1T7YOfti4Cl64xeBok=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157678},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- `>=node.js-12.0.0`\n- `>=docker-18.0.0`\n- `>=docker-machine-0.13.0` - (optional) if you plan to launch lambdas on external machines (e.g. AWS EC2, DigitalOcean and so on)\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.enabled` to `false`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: false,\n        },\n    }\n}\n```\n\nAnd in `source.type` select `mongo` and provide connection string in its options\n\n```js\n{\n    source: {\n        type: 'mongo', // source for generating events\n        options: {\n            mongo: {\n                url: 'mongodb://external-mongo.com',\n                db: 'corva',\n            },\n        }\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.enabled` to `true`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: true,\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\nThen in settings, choose `directory` for `source.type` and provide a path to it, either absolute or relative, to the directory where you launched your app.\n\n```\n{\n    source: {\n        type: 'directory', // source for generating events\n        options: {\n            directory: {\n                // directories inside = database names\n                // files inside directories = collection names\n                path: './example/mongo/directory',\n            },\n        }\n    }\n}\n```\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n**NOTE**: During startup, MongoDB will execute files in alphabetical order. Use prefixes if you want to define some specific order.\n\n```js\n{\n    source: {\n        type: 'manual', // source for generating events\n        options: {\n            manual: {\n                path: './example/mongo/manual',\n            },\n        },\n    }\n}\n```\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n#### Building a Docker Image\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n\nIf you would like to build an image on each `local-testing-framework` run, you need to add `lambda.context` option into the corvarc file to point to the directory where the sources are.\n\n#### Container Registry\n\nIf you want to run your lambda on 3rd party servers (not locally), you'll need to push it to some external container registry from where your server could download an image.\n\nSee https://docs.docker.com/engine/reference/commandline/push/ and https://www.docker.com/blog/how-to-use-your-own-registry/ for more details\n\n### Preparing corva-api-lite\n\nIn order to avoid significant load on Corva API you should use corva-api-lite server that exposes the same HTTP interface as Corva API. It operates directly with the local MongoDB database.\n\n#### Building Docker Image for API lite\n\n1.  Install local-testing-framework `npm i -g @corva/corva-api-lite`\n2.  Build docker image using `docker build -t corva-api-lite .`\n3.  (Optionally) Push it to an external registry if you plan to run your app on a remote machine\n\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js local --help`\n\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo specify most options, you may create `.corvarc.js` or `corvarc.json` in your `$CWD`.\n\n```js\nmodule.exports = {\n  lambda: {\n    // image: 'app_name', // use this if you already have the prebuilt lambda docker image, can be overriden with CLI argument\n    // context: '.', // use this if you wish to build lambda image automatically on each run\n    type: 'stream',\n    handler: 'lambda_function.lambda_handler', // entrypoint of your lambda\n    env: ['A=B'], // command options will override it, not add\n  },\n  infra: {\n    stopContainers: true,\n    runner: 'local',\n    redis: {\n      enabled: true,\n      image: 'redis:latest',\n      // url: 'redis://127.0.0.1' // for external redis\n    },\n    apiLite: {\n      enabled: true,\n      image: 'corva-api-lite:latest',\n      source: 'mongo',\n    },\n    aws: {\n      region: 'us-east-1',\n      // secretAccessKey: 'xxx',\n      // accessKeyId: 'yyy',\n    },\n  },\n  source: {\n    type: 'mongo', // source for generating events\n    options: {\n      mongo: {\n        url: 'mongodb://127.0.0.1',\n        options: {\n          // useNewUrlParser: true,\n          // useUnifiedTopology: true,\n        },\n        db: 'corva',\n      },\n      limits: {\n        // source specific queries\n        timestamp: {\n          $gt: 0,\n        },\n      },\n    },\n    collection: 'corva#wits', // source collection\n  },\n  debugOutput: 'console', // console | file | none - write debug data to console or file\n  event: {\n    // json: '', // pass event json here to run single event\n    assetId: 1234,\n    companyId: 1,\n    sourceType: 'drilling',\n    appKey: 'app key used in lambda config',\n    limits: {\n      // specify limits for generated events (e.g. to skip some), format [key]: {...limits}\n      timestamp: {\n        $gt: 0,\n      },\n    },\n    config: {\n      batchSize: 10, // 4 stream events\n      interval: 300, // 4 scheduled events\n      start_time: 1602765873127, // optional, process events only occuring after this point of time\n      end_time: 1602765973127, // optional, process events only occuring before this point of time\n      start_depth: 10, // optional, process events only occuring after this hole depth\n      end_depth: 17000, // optional, process events only occuring before this hole depth\n    },\n    options: {\n      // additional stuff that could be passed to event\n      // useful for scheduled events for example\n      timezone: 'America/Chicago',\n      collection: 'corva#destination-collection', // 4 scheduled events\n    },\n  },\n  export: {\n    enabled: true,\n    format: 'json',\n    collections: ['corva#destination-collection'],\n  },\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\nnode bin/corva.js local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\nOr with LTF locally installed:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker using Docker machine or use local\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will be removed after the test run by default. To preserve containers running, please override the option `infra.stopContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"c5b1e3bdd5696433f248c43b66fc454b4ce38e8d","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","dockerode":"^3.3.1","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.2.0-rc.1_1635253282949_0.24733655238674657","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.2.0-rc.2":{"name":"@corva/local-testing-framework","version":"3.2.0-rc.2","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.2.0-rc.2","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"a4d308acc09c204f7d3a28129edf6855a2e1644a","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.2.0-rc.2.tgz","fileCount":91,"integrity":"sha512-kDjgYbjDkQKIOkYTRg00uKouE1tiw+ayf3VEWS+0zkgbWJKO+hc5+wECeIRKuSq3eFiRRec9Wcqnh8Js25rVRA==","signatures":[{"sig":"MEQCIHYGQCxgkEqSyeSJa+TlwrBhiQMkULp/oc7jZLCB/g3bAiBZMA1R7qseRxvRhMF5GjxMt63K1kiPVK9dHAlTezf8AQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204379},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- `>=node.js-12.0.0`\n- `>=docker-18.0.0`\n- `>=docker-machine-0.13.0` - (optional) if you plan to launch lambdas on external machines (e.g. AWS EC2, DigitalOcean and so on)\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.enabled` to `false`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: false,\n        },\n    }\n}\n```\n\nAnd in `source.type` select `mongo` and provide connection string in its options\n\n```js\n{\n    source: {\n        type: 'mongo', // source for generating events\n        options: {\n            mongo: {\n                url: 'mongodb://external-mongo.com',\n                db: 'corva',\n            },\n        }\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.enabled` to `true`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: true,\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\nThen in settings, choose `directory` for `source.type` and provide a path to it, either absolute or relative, to the directory where you launched your app.\n\n```\n{\n    source: {\n        type: 'directory', // source for generating events\n        options: {\n            directory: {\n                // directories inside = database names\n                // files inside directories = collection names\n                path: './example/mongo/directory',\n            },\n        }\n    }\n}\n```\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n**NOTE**: During startup, MongoDB will execute files in alphabetical order. Use prefixes if you want to define some specific order.\n\n```js\n{\n    source: {\n        type: 'manual', // source for generating events\n        options: {\n            manual: {\n                path: './example/mongo/manual',\n            },\n        },\n    }\n}\n```\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n#### Building a Docker Image\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n\nIf you would like to build an image on each `local-testing-framework` run, you need to add `lambda.context` option into the corvarc file to point to the directory where the sources are.\n\n#### Container Registry\n\nIf you want to run your lambda on 3rd party servers (not locally), you'll need to push it to some external container registry from where your server could download an image.\n\nSee https://docs.docker.com/engine/reference/commandline/push/ and https://www.docker.com/blog/how-to-use-your-own-registry/ for more details\n\n### Preparing corva-api-lite\n\nIn order to avoid significant load on Corva API you should use corva-api-lite server that exposes the same HTTP interface as Corva API. It operates directly with the local MongoDB database.\n\n#### Building Docker Image for API lite\n\n1.  Install local-testing-framework `npm i -g @corva/corva-api-lite`\n2.  Build docker image using `docker build -t corva-api-lite .`\n3.  (Optionally) Push it to an external registry if you plan to run your app on a remote machine\n\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js local --help`\n\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo specify most options, you may create `.corvarc.js` or `corvarc.json` in your `$CWD`.\n\n```js\nmodule.exports = {\n  lambda: {\n    // image: 'app_name', // use this if you already have the prebuilt lambda docker image, can be overriden with CLI argument\n    // context: '.', // use this if you wish to build lambda image automatically on each run\n    type: 'stream',\n    handler: 'lambda_function.lambda_handler', // entrypoint of your lambda\n    env: ['A=B'], // command options will override it, not add\n  },\n  infra: {\n    stopContainers: true,\n    runner: 'local',\n    redis: {\n      enabled: true,\n      image: 'redis:latest',\n      // url: 'redis://127.0.0.1' // for external redis\n    },\n    apiLite: {\n      enabled: true,\n      image: 'corva-api-lite:latest',\n      source: 'mongo',\n    },\n    aws: {\n      region: 'us-east-1',\n      // secretAccessKey: 'xxx',\n      // accessKeyId: 'yyy',\n    },\n  },\n  source: {\n    type: 'mongo', // source for generating events\n    options: {\n      mongo: {\n        url: 'mongodb://127.0.0.1',\n        options: {\n          // useNewUrlParser: true,\n          // useUnifiedTopology: true,\n        },\n        db: 'corva',\n      },\n      limits: {\n        // source specific queries\n        timestamp: {\n          $gt: 0,\n        },\n      },\n    },\n    collection: 'corva#wits', // source collection\n  },\n  debugOutput: 'console', // console | file | none - write debug data to console or file\n  event: {\n    // json: '', // pass event json here to run single event\n    assetId: 1234,\n    companyId: 1,\n    sourceType: 'drilling',\n    appKey: 'app key used in lambda config',\n    limits: {\n      // specify limits for generated events (e.g. to skip some), format [key]: {...limits}\n      timestamp: {\n        $gt: 0,\n      },\n    },\n    config: {\n      batchSize: 10, // 4 stream events\n      interval: 300, // 4 scheduled events\n      start_time: 1602765873127, // optional, process events only occuring after this point of time\n      end_time: 1602765973127, // optional, process events only occuring before this point of time\n      start_depth: 10, // optional, process events only occuring after this hole depth\n      end_depth: 17000, // optional, process events only occuring before this hole depth\n    },\n    options: {\n      // additional stuff that could be passed to event\n      // useful for scheduled events for example\n      timezone: 'America/Chicago',\n      collection: 'corva#destination-collection', // 4 scheduled events\n    },\n  },\n  export: {\n    enabled: true,\n    format: 'json',\n    collections: ['corva#destination-collection'],\n  },\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\nnode bin/corva.js local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\nOr with LTF locally installed:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker using Docker machine or use local\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will be removed after the test run by default. To preserve containers running, please override the option `infra.stopContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"167a10f54f55743817810f9c594c9e285c200d0b","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.2.0-rc.2_1635253830109_0.9885691545121944","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"3.2.0-rc.3":{"name":"@corva/local-testing-framework","version":"3.2.0-rc.3","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@3.2.0-rc.3","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"5fb23bec56b58678571c1075647b4b0734e83cf5","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-3.2.0-rc.3.tgz","fileCount":89,"integrity":"sha512-hhGMfSbFxQmgQ3HqEbc21kdFYUqpjrD08zGVpyv040O210QRTWQD9yiAHWMkhfoNzZ/aHZJC2p8t5VhPNiJF/A==","signatures":[{"sig":"MEQCIB842kg3/XUlHuTJdFcoy1oY9ifhVMb8P/HclEG2CvfNAiAdAnRLfbb1XEKr+A+ojN8UfHhdXPk9NZjH5MHLtGmS0g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":209730},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- `>=node.js-12.0.0`\n- `>=docker-18.0.0`\n- `>=docker-machine-0.13.0` - (optional) if you plan to launch lambdas on external machines (e.g. AWS EC2, DigitalOcean and so on)\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.enabled` to `false`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: false,\n        },\n    }\n}\n```\n\nAnd in `source.type` select `mongo` and provide connection string in its options\n\n```js\n{\n    source: {\n        type: 'mongo', // source for generating events\n        options: {\n            mongo: {\n                url: 'mongodb://external-mongo.com',\n                db: 'corva',\n            },\n        }\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.enabled` to `true`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: true,\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\nThen in settings, choose `directory` for `source.type` and provide a path to it, either absolute or relative, to the directory where you launched your app.\n\n```\n{\n    source: {\n        type: 'directory', // source for generating events\n        options: {\n            directory: {\n                // directories inside = database names\n                // files inside directories = collection names\n                path: './example/mongo/directory',\n            },\n        }\n    }\n}\n```\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n**NOTE**: During startup, MongoDB will execute files in alphabetical order. Use prefixes if you want to define some specific order.\n\n```js\n{\n    source: {\n        type: 'manual', // source for generating events\n        options: {\n            manual: {\n                path: './example/mongo/manual',\n            },\n        },\n    }\n}\n```\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n#### Building a Docker Image\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n\nIf you would like to build an image on each `local-testing-framework` run, you need to add `lambda.context` option into the corvarc file to point to the directory where the sources are.\n\n#### Container Registry\n\nIf you want to run your lambda on 3rd party servers (not locally), you'll need to push it to some external container registry from where your server could download an image.\n\nSee https://docs.docker.com/engine/reference/commandline/push/ and https://www.docker.com/blog/how-to-use-your-own-registry/ for more details\n\n### Preparing corva-api-lite\n\nIn order to avoid significant load on Corva API you should use corva-api-lite server that exposes the same HTTP interface as Corva API. It operates directly with the local MongoDB database.\n\n#### Building Docker Image for API lite\n\n1.  Install local-testing-framework `npm i -g @corva/corva-api-lite`\n2.  Build docker image using `docker build -t corva-api-lite .`\n3.  (Optionally) Push it to an external registry if you plan to run your app on a remote machine\n\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js local --help`\n\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo specify most options, you may create `.corvarc.js` or `corvarc.json` in your `$CWD`.\n\n```js\nmodule.exports = {\n  lambda: {\n    // image: 'app_name', // use this if you already have the prebuilt lambda docker image, can be overriden with CLI argument\n    // context: '.', // use this if you wish to build lambda image automatically on each run\n    type: 'stream',\n    handler: 'lambda_function.lambda_handler', // entrypoint of your lambda\n    env: ['A=B'], // command options will override it, not add\n  },\n  infra: {\n    stopContainers: true,\n    runner: 'local',\n    redis: {\n      enabled: true,\n      image: 'redis:latest',\n      // url: 'redis://127.0.0.1' // for external redis\n    },\n    apiLite: {\n      enabled: true,\n      image: 'corva-api-lite:latest',\n      source: 'mongo',\n    },\n    aws: {\n      region: 'us-east-1',\n      // secretAccessKey: 'xxx',\n      // accessKeyId: 'yyy',\n    },\n  },\n  source: {\n    type: 'mongo', // source for generating events\n    options: {\n      mongo: {\n        url: 'mongodb://127.0.0.1',\n        options: {\n          // useNewUrlParser: true,\n          // useUnifiedTopology: true,\n        },\n        db: 'corva',\n      },\n      limits: {\n        // source specific queries\n        timestamp: {\n          $gt: 0,\n        },\n      },\n    },\n    collection: 'corva#wits', // source collection\n  },\n  debugOutput: 'console', // console | file | none - write debug data to console or file\n  event: {\n    // json: '', // pass event json here to run single event\n    assetId: 1234,\n    companyId: 1,\n    sourceType: 'drilling',\n    appKey: 'app key used in lambda config',\n    limits: {\n      // specify limits for generated events (e.g. to skip some), format [key]: {...limits}\n      timestamp: {\n        $gt: 0,\n      },\n    },\n    config: {\n      batchSize: 10, // 4 stream events\n      interval: 300, // 4 scheduled events\n      start_time: 1602765873127, // optional, process events only occuring after this point of time\n      end_time: 1602765973127, // optional, process events only occuring before this point of time\n      start_depth: 10, // optional, process events only occuring after this hole depth\n      end_depth: 17000, // optional, process events only occuring before this hole depth\n    },\n    options: {\n      // additional stuff that could be passed to event\n      // useful for scheduled events for example\n      timezone: 'America/Chicago',\n      collection: 'corva#destination-collection', // 4 scheduled events\n    },\n  },\n  export: {\n    enabled: true,\n    format: 'json',\n    collections: ['corva#destination-collection'],\n  },\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\nnode bin/corva.js local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\nOr with LTF locally installed:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker using Docker machine or use local\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will be removed after the test run by default. To preserve containers running, please override the option `infra.stopContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"09f80a9380f108fa4ee100bd7f20832dd4466b80","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_3.2.0-rc.3_1635512921380_0.2715592416056456","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.0.0-rc.0":{"name":"@corva/local-testing-framework","version":"4.0.0-rc.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.0.0-rc.0","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"db3d405d18af93d19910a43d729317e15de96f07","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.0.0-rc.0.tgz","fileCount":91,"integrity":"sha512-nVfAQkiX7PEV1N7OHA3HUadK3vyt8IslwnHazaShTGR9FXku+TLRzosTlorsJlDBSN42CnglV1AoRDHa3oUBeA==","signatures":[{"sig":"MEUCICVNfBzujR4HZLMULmyUuZgfNbJatdHe/pzWBVBa+b5bAiEAxjEjvPpGuGlnBnd1q9zL82q0bIzwyn+KW+nJcOGqr6M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":213840},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- `>=node.js-12.0.0`\n- `>=docker-18.0.0`\n- `>=docker-machine-0.13.0` - (optional) if you plan to launch lambdas on external machines (e.g. AWS EC2, DigitalOcean and so on)\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.enabled` to `false`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: false,\n        },\n    }\n}\n```\n\nAnd in `source.type` select `mongo` and provide connection string in its options\n\n```js\n{\n    source: {\n        type: 'mongo', // source for generating events\n        options: {\n            mongo: {\n                url: 'mongodb://external-mongo.com',\n                db: 'corva',\n            },\n        }\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.enabled` to `true`.\n\n```js\n{\n    infra: {\n        mongo: {\n            enabled: true,\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\nThen in settings, choose `directory` for `source.type` and provide a path to it, either absolute or relative, to the directory where you launched your app.\n\n```\n{\n    source: {\n        type: 'directory', // source for generating events\n        options: {\n            directory: {\n                // directories inside = database names\n                // files inside directories = collection names\n                path: './example/mongo/directory',\n            },\n        }\n    }\n}\n```\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n**NOTE**: During startup, MongoDB will execute files in alphabetical order. Use prefixes if you want to define some specific order.\n\n```js\n{\n    source: {\n        type: 'manual', // source for generating events\n        options: {\n            manual: {\n                path: './example/mongo/manual',\n            },\n        },\n    }\n}\n```\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n#### Building a Docker Image\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n\nIf you would like to build an image on each `local-testing-framework` run, you need to add `lambda.context` option into the corvarc file to point to the directory where the sources are.\n\n#### Container Registry\n\nIf you want to run your lambda on 3rd party servers (not locally), you'll need to push it to some external container registry from where your server could download an image.\n\nSee https://docs.docker.com/engine/reference/commandline/push/ and https://www.docker.com/blog/how-to-use-your-own-registry/ for more details\n\n### Preparing corva-api-lite\n\nIn order to avoid significant load on Corva API you should use corva-api-lite server that exposes the same HTTP interface as Corva API. It operates directly with the local MongoDB database.\n\n#### Building Docker Image for API lite\n\n1.  Install local-testing-framework `npm i -g @corva/corva-api-lite`\n2.  Build docker image using `docker build -t corva-api-lite .`\n3.  (Optionally) Push it to an external registry if you plan to run your app on a remote machine\n\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js local --help`\n\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo specify most options, you may create `.corvarc.js` or `corvarc.json` in your `$CWD`.\n\n```js\nmodule.exports = {\n  lambda: {\n    // image: 'app_name', // use this if you already have the prebuilt lambda docker image, can be overriden with CLI argument\n    // context: '.', // use this if you wish to build lambda image automatically on each run\n    type: 'stream',\n    handler: 'lambda_function.lambda_handler', // entrypoint of your lambda\n    env: ['A=B'], // command options will override it, not add\n  },\n  infra: {\n    stopContainers: true,\n    runner: 'local',\n    redis: {\n      enabled: true,\n      image: 'redis:latest',\n      // url: 'redis://127.0.0.1' // for external redis\n    },\n    apiLite: {\n      enabled: true,\n      image: 'corva-api-lite:latest',\n      source: 'mongo',\n    },\n    aws: {\n      region: 'us-east-1',\n      // secretAccessKey: 'xxx',\n      // accessKeyId: 'yyy',\n    },\n  },\n  source: {\n    type: 'mongo', // source for generating events\n    options: {\n      mongo: {\n        url: 'mongodb://127.0.0.1',\n        options: {\n          // useNewUrlParser: true,\n          // useUnifiedTopology: true,\n        },\n        db: 'corva',\n      },\n      limits: {\n        // source specific queries\n        timestamp: {\n          $gt: 0,\n        },\n      },\n    },\n    collection: 'corva#wits', // source collection\n  },\n  debugOutput: 'console', // console | file | none - write debug data to console or file\n  event: {\n    // json: '', // pass event json here to run single event\n    assetId: 1234,\n    companyId: 1,\n    sourceType: 'drilling',\n    appKey: 'app key used in lambda config',\n    limits: {\n      // specify limits for generated events (e.g. to skip some), format [key]: {...limits}\n      timestamp: {\n        $gt: 0,\n      },\n    },\n    config: {\n      batchSize: 10, // 4 stream events\n      interval: 300, // 4 scheduled events\n      start_time: 1602765873127, // optional, process events only occuring after this point of time\n      end_time: 1602765973127, // optional, process events only occuring before this point of time\n      start_depth: 10, // optional, process events only occuring after this hole depth\n      end_depth: 17000, // optional, process events only occuring before this hole depth\n    },\n    options: {\n      // additional stuff that could be passed to event\n      // useful for scheduled events for example\n      timezone: 'America/Chicago',\n      collection: 'corva#destination-collection', // 4 scheduled events\n    },\n  },\n  export: {\n    enabled: true,\n    format: 'json',\n    collections: ['corva#destination-collection'],\n  },\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\nnode bin/corva.js local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\nOr with LTF locally installed:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker using Docker machine or use local\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will be removed after the test run by default. To preserve containers running, please override the option `infra.stopContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"f6a800875ed009e7e2edbf4a9434b25f43213b8f","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.0.0-rc.0_1636038436179_0.7567093799104292","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.0.0-rc.1":{"name":"@corva/local-testing-framework","version":"4.0.0-rc.1","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.0.0-rc.1","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"6a44bb326c91dafa9c32c6b9977c4d7a645cf285","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.0.0-rc.1.tgz","fileCount":48,"integrity":"sha512-18QYlI0e7GeuUR15X/2L7pAi9C1KysWzspP9wcOLf01XmMWFPLapZOfPQGbGqi2cml0WT8auFUbCKG96xC3gRA==","signatures":[{"sig":"MEUCIQDoxOavWx7PkGG1jI8KRZQFT1c6uq+5NzTfxGZBxniqVwIgEglW7bwcSC5y+Yu8qjkfmlmUiHH0vBnBsLoJ9wRW/ec=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":207444},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- [NodeJs](https://nodejs.org/en/) >= 14\n- [Docker](https://www.docker.com/) >= 20\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n- [`mongo`](https://hub.docker.com/_/mongo) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.url`.\n\n```js\n{\n    infra: {\n        mongo: {\n           url: 'mongodb://external-mongo.com',\n        },\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.image` and `infra.mongo.port`.\n\n```js\n{\n    infra: {\n        mongo: {\n            image: 'mongo:latest',\n            port: 27018\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n**NOTE** `corva init` command can generate Dockerfile for you\n\n#### Building a Docker Image\n\nIf you want to use prebuilt image specify `lambda.image` option.\n\nIf no `lambda.image` option provided or no image found the LTF will try to build the image from sources on each run.\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js --help`\n\n#### Help command\n\n```sh\n$ corva --help\ncorva --help\ncorva <command>\n\nCommands:\n  corva.js init [cwd]  Generate .corvarc file\n  corva.js local       Run lambda function locally\n  corva.js completion  generate completion script\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number\n```\n\n#### Init command\n```sh\n$ corva init --help\ncorva init [cwd]\n\nGenerate .corvarc file\n\nPositionals:\n  cwd  Directory where to generate a .corvarc file                     [default: \".\"]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number                                                                                   [boolean]\n```\n\n#### Local command\n```sh\n$ corva local --help\ncorva.js local\n\nRun lambda function locally\n\nLambda options\n  --lambda.image    Lambda docker image                                                                                          [string]\n  --lambda.type     Lambda type                                          [string] [choices: \"scheduler\", \"stream\"] [default: \"scheduler\"]\n  --lambda.handler  Lambda handler function name                                                      [string] [default: \"index.handler\"]\n  --lambda.env      Additional env KEY=VALUE pairs that should be passed to lambda                 [array] [default: [\"LOG_LEVEL=DEBUG\"]]\n\nInfrastructure options\n  --infra.stopContainers  Decide to stop the containers after the test run                                     [boolean] [default: false]\n  --infra.redis.url       External Redis URL for lambda cache                                                                    [string]\n  --infra.redis.image     Docker image for Redis                                                       [string] [default: \"redis:latest\"]\n  --infra.redis.port      Docker port for redis                                                                  [string] [default: 6380]\n  --infra.mongo.url       External MongoDB URL for lambda cache                                                                  [string]\n  --infra.mongo.image     Docker image for MongoDB                                                            [string] [default: \"mongo\"]\n  --infra.mongo.port      Docker port for MongoDB                                                               [string] [default: 27018]\n\nSource options\n  --source.import      Should the test data be imported or not                                                  [boolean] [default: true]\n  --source.dir         Directory where the test-sources are located (relative to the project root)   [string] [default: \"./test-sources\"]\n  --source.database    Source database for events                                                             [string] [default: \"corva\"]\n  --source.collection  Events source collection                                                         [string] [default: \"runner#wits\"]\n\nEvent options\n  --event.json              Pass single event to lambda from provided file                                                       [string]\n  --event.assetId           Event asset id                                                                       [number] [default: 1234]\n  --event.companyId         Event company id                                                                        [number] [default: 1]\n  --event.appKey            App key                                                      [string] [default: \"my-company.my-drilling-app\"]\n  --event.sourceType        Event source type        [string] [choices: \"drilling\", \"drillout\", \"wireline\", \"frac\"] [default: \"drilling\"]\n  --event.config.batchSize  Max amount of records in event                                                         [number] [default: 10]\n  --event.config.interval   Event invocation interval in seconds (min 60):                                         [number] [default: 60]\n  --event.config.logType                                                                     [choices: \"time\", \"depth\"] [default: \"time\"]\n\nExport options\n  --export.enabled      Enables data exporting                                                                    [boolean] [default: false]\n  --export.collections  Collections to export                                                                [array] [default: []]\n  --export.format       Format for export                                             [string] [choices: \"json\", \"csv\"] [default: \"json\"]\n  --export.fields       Fields to be exported in csv                                                               [string] [default: {}]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n```\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo create .corvarc configuration file please run `corva init` in your $CWD\n\nExample:\n\n```json\n{\n  \"version\": 4,\n  \"lambda\": {\n    \"type\": \"scheduler\",\n    \"handler\": \"index.handler\",\n    \"env\": [\n      \"LOG_LEVEL=DEBUG\"\n    ],\n    \"port\": 9002\n  },\n  \"infra\": {\n    \"stopContainers\": false,\n    \"restartContainers\": false,\n    \"redis\": {\n      \"image\": \"redis:latest\",\n      \"port\": 6380\n    },\n    \"mongo\": {\n      \"image\": \"mongo\",\n      \"port\": 27018\n    },\n    \"apiLite\": {\n      \"image\": \"corva/corva-api-lite:latest\",\n      \"mode\": \"data\",\n      \"port\": 3008\n    }\n  },\n  \"source\": {\n    \"import\": true,\n    \"dir\": \"./test-sources\",\n    \"database\": \"corva\",\n    \"collection\": \"runner#wits\",\n    \"limits\": {}\n  },\n  \"event\": {\n    \"assetId\": 1234,\n    \"companyId\": 1,\n    \"sourceType\": \"drilling\",\n    \"config\": {\n      \"batchSize\": 10,\n      \"interval\": 60\n    },\n    \"appKey\": \"my-company.my-drilling-app\",\n    \"options\": {}\n  },\n  \"export\": {\n    \"enabled\": true,\n    \"format\": \"json\",\n    \"collections\": [\n      \"corva#destination-collection\"\n    ]\n  },\n  \"debugOutput\": \"file\"\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will not be removed after the test run by default. To remove containers, please override the option `infra.stopContainers` and set it to `true`.\n- Infrastructure containers like mongo, redis, etc., will not be removed before the test run by default. To preserve containers running, please override the option `infra.restartContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"aaba2a498fdf6e4c47c22e6ed5763ab050145d7b","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@tsconfig/node14":"^1.0.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.0.0-rc.1_1636366780040_0.9371317037663578","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.0.0-rc.2":{"name":"@corva/local-testing-framework","version":"4.0.0-rc.2","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.0.0-rc.2","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"810a7670de25f0a45cb532b45b42cc2f7706a3f8","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.0.0-rc.2.tgz","fileCount":50,"integrity":"sha512-+t5edDBcKa6LL93XnQoHbn2hp/Z8HBoLg5c9ijnaimvHNh13szbrWhJivZEGsZLX5FIcSX+ZJ2iYEaAMnz7Hmw==","signatures":[{"sig":"MEUCIQCcNv4LRNPVAcqrwplvDnZrt6T80MZHENpIvxqwGEE+PgIgBTWXmylcZMZgeqFmQHZSY4y20Hox2QlBpnAml614hbA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":207924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlUGXCRA9TVsSAnZWagAAe2EQAIBfgF/tn0lpDE7uz59X\nxYiqqJTEitdFnucMFXi3V32AxYx9fXUu+itb2fk293Q3SnRn2My6gx3idXTD\nISy+8Fprv9IFll5TSBcFTZr85voS7fj0Z07ybavMNnXftaqJ9a3iuFPl7sWC\n24dK7QQvxWUjOwQfLgWNOhkyJCbFCPJo6OxpEiH9DE8b5TlY7sHvpJJrWnHh\n7lLi3tIvyMh7Hkmr1s2sWdaWqWWoc8W1Mfcjdv7UjDBvp4kPsovLLH9nkzXB\nh7BNP5daQWEjggqMJeYykZINkn0A3G8p7mb4zscORMnCMA5Er++dBruAGjon\nHh6fxyKLvsq/ibq950B9Y2x6orVSGX4fwUQQcfS3CQ2O8rEsTv9wn35lBDv4\nAUgNfjb5/+82J3pcvdUhKaNjva0s+TXOjL4UI4oncNEp0Mt78p6b9euthlFV\nQiGFU1vjPA5zvYXk2Whbck0yV5XIR0ZtLw53KnX/e490LnWHIPQNzQhOOKK9\nGQ9L/ECWGbux/TLurN1TN2oiOBbueC3Y8K/adcBHtCc03yhxLwYql49COTwG\noiFdS7Cvzbmd8GO9DxzqqLHqD2BooSEt7XgO5juTSM65WsOsChSD08V0UEea\n2H2WO44WCx0jVN1unKF0XcBtx70EC+drndDAsyjb1IF3FF36xWcGzyxHnm1s\nJQFE\r\n=RPYd\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- [NodeJs](https://nodejs.org/en/) >= 14\n- [Docker](https://www.docker.com/) >= 20\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n- [`mongo`](https://hub.docker.com/_/mongo) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.url`.\n\n```js\n{\n    infra: {\n        mongo: {\n           url: 'mongodb://external-mongo.com',\n        },\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.image` and `infra.mongo.port`.\n\n```js\n{\n    infra: {\n        mongo: {\n            image: 'mongo:latest',\n            port: 27018\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n**NOTE** `corva init` command can generate Dockerfile for you\n\n#### Building a Docker Image\n\nIf you want to use prebuilt image specify `lambda.image` option.\n\nIf no `lambda.image` option provided or no image found the LTF will try to build the image from sources on each run.\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js --help`\n\n#### Help command\n\n```sh\n$ corva --help\ncorva --help\ncorva <command>\n\nCommands:\n  corva.js init [cwd]  Generate .corvarc file\n  corva.js local       Run lambda function locally\n  corva.js completion  generate completion script\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number\n```\n\n#### Init command\n```sh\n$ corva init --help\ncorva init [cwd]\n\nGenerate .corvarc file\n\nPositionals:\n  cwd  Directory where to generate a .corvarc file                     [default: \".\"]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number                                                                                   [boolean]\n```\n\n#### Local command\n```sh\n$ corva local --help\ncorva.js local\n\nRun lambda function locally\n\nLambda options\n  --lambda.image    Lambda docker image                                                                                          [string]\n  --lambda.type     Lambda type                                          [string] [choices: \"scheduler\", \"stream\"] [default: \"scheduler\"]\n  --lambda.handler  Lambda handler function name                                                      [string] [default: \"index.handler\"]\n  --lambda.env      Additional env KEY=VALUE pairs that should be passed to lambda                 [array] [default: [\"LOG_LEVEL=DEBUG\"]]\n\nInfrastructure options\n  --infra.stopContainers  Decide to stop the containers after the test run                                     [boolean] [default: false]\n  --infra.redis.url       External Redis URL for lambda cache                                                                    [string]\n  --infra.redis.image     Docker image for Redis                                                       [string] [default: \"redis:latest\"]\n  --infra.redis.port      Docker port for redis                                                                  [string] [default: 6380]\n  --infra.mongo.url       External MongoDB URL for lambda cache                                                                  [string]\n  --infra.mongo.image     Docker image for MongoDB                                                            [string] [default: \"mongo\"]\n  --infra.mongo.port      Docker port for MongoDB                                                               [string] [default: 27018]\n\nSource options\n  --source.import      Should the test data be imported or not                                                  [boolean] [default: true]\n  --source.dir         Directory where the test-sources are located (relative to the project root)   [string] [default: \"./test-sources\"]\n  --source.database    Source database for events                                                             [string] [default: \"corva\"]\n  --source.collection  Events source collection                                                         [string] [default: \"runner#wits\"]\n\nEvent options\n  --event.json              Pass single event to lambda from provided file                                                       [string]\n  --event.assetId           Event asset id                                                                       [number] [default: 1234]\n  --event.companyId         Event company id                                                                        [number] [default: 1]\n  --event.appKey            App key                                                      [string] [default: \"my-company.my-drilling-app\"]\n  --event.sourceType        Event source type        [string] [choices: \"drilling\", \"drillout\", \"wireline\", \"frac\"] [default: \"drilling\"]\n  --event.config.batchSize  Max amount of records in event                                                         [number] [default: 10]\n  --event.config.interval   Event invocation interval in seconds (min 60):                                         [number] [default: 60]\n  --event.config.logType                                                                     [choices: \"time\", \"depth\"] [default: \"time\"]\n\nExport options\n  --export.enabled      Enables data exporting                                                                    [boolean] [default: false]\n  --export.collections  Collections to export                                                                [array] [default: []]\n  --export.format       Format for export                                             [string] [choices: \"json\", \"csv\"] [default: \"json\"]\n  --export.fields       Fields to be exported in csv                                                               [string] [default: {}]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n```\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo create .corvarc configuration file please run `corva init` in your $CWD\n\nExample:\n\n```json\n{\n  \"version\": 4,\n  \"lambda\": {\n    \"type\": \"scheduler\",\n    \"handler\": \"index.handler\",\n    \"env\": [\n      \"LOG_LEVEL=DEBUG\"\n    ],\n    \"port\": 9002\n  },\n  \"infra\": {\n    \"stopContainers\": false,\n    \"restartContainers\": false,\n    \"redis\": {\n      \"image\": \"redis:latest\",\n      \"port\": 6380\n    },\n    \"mongo\": {\n      \"image\": \"mongo\",\n      \"port\": 27018\n    },\n    \"apiLite\": {\n      \"image\": \"corva/corva-api-lite:latest\",\n      \"mode\": \"data\",\n      \"port\": 3008\n    }\n  },\n  \"source\": {\n    \"import\": true,\n    \"dir\": \"./test-sources\",\n    \"database\": \"corva\",\n    \"collection\": \"runner#wits\",\n    \"limits\": {}\n  },\n  \"event\": {\n    \"assetId\": 1234,\n    \"companyId\": 1,\n    \"sourceType\": \"drilling\",\n    \"config\": {\n      \"batchSize\": 10,\n      \"interval\": 60\n    },\n    \"appKey\": \"my-company.my-drilling-app\",\n    \"options\": {}\n  },\n  \"export\": {\n    \"enabled\": true,\n    \"format\": \"json\",\n    \"collections\": [\n      \"corva#destination-collection\"\n    ]\n  },\n  \"debugOutput\": \"file\"\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will not be removed after the test run by default. To remove containers, please override the option `infra.stopContainers` and set it to `true`.\n- Infrastructure containers like mongo, redis, etc., will not be removed before the test run by default. To preserve containers running, please override the option `infra.restartContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"a801f930233d19c06cf9acf8f82a032b4e6fb8bf","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@tsconfig/node14":"^1.0.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.0.0-rc.2_1637171607772_0.3632361058849878","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.0.0-rc.3":{"name":"@corva/local-testing-framework","version":"4.0.0-rc.3","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.0.0-rc.3","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"a7cf1a49f37e3d7a315e1bcc4db6c439488f4013","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.0.0-rc.3.tgz","fileCount":50,"integrity":"sha512-XH49FdkUn58W0P0Nw8xaSd4qZnaXCndavMHwquWZQcv0x4MtJ/1Zwjg+LfGDRJscxK7NdaGdpgq69EYYD8jt+g==","signatures":[{"sig":"MEYCIQDmSs8thbzJ/61ANwN+pc90yC5hABEXN1RVVbVathLCWwIhALmWjwEryL6UkAklhODAPZ86SYql2z2eY4SGY/gXI2a/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":207930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlU2tCRA9TVsSAnZWagAApEgP/j7dzdmUNFxRFHd/tJNH\nrLRdJVTgot+a2YnvSHlMi0bKhQeJ+zsr2bS14/3Y2dT/ooX79foD0UXcXaTx\nmKF/wj/fz7Pnb9wqe1b0XYfUlSArASIwNOQQ63U4DJCAd7zW4VHNIPo4KLQh\nmsg4Uf3PTpljIyKicunq/5xnV0av4c17ekRF0XRQYhdfUeDBdY6K7ubwhsTM\nimAFgYiPIu/vT2r+jBnO5OAkoqlEm35jgqLz30OazekxBAll/RxaM7BGbYrx\n0dNxtshSbYF9mFJkDsnikVC/63glZY520Xx2ibtr6I1Rf0U0Kk6zzdiEEDtQ\n9riMl6CTxUTd6PjbNuEzD9/y6mnD63wvzY7fLL5DM8MdSUy87MiuhAmxj4yN\n2H36CF7RSzF/Qxgln3J0KnPngqVCfIz9DSlHa9A5NZqQ8e7LAd5WTY3Fyp/O\nm0NKXnQi8ULmJ8Jfsa1Pmbx0d6LsDCtDg08EH/190iBmlEtJMgY53d1FAm5y\nsQ3gFBQvyZenHN3uKyODnRweCA3lZUanKHwq1ZA3ITDnFgaSjkYGOYCjxBbc\nnZjypo93iyEMqYKrkiKBGFBrCIyxe+QFeIwhfEa8KvoGyBPmEzEiIZfgCy9C\nDywpoOtUJBwbowc7P0NcBcG7NnKxkG5kW1ugVUO+Pj7Z60iyFuqfTUM3c+Kd\nhq2/\r\n=EbAs\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- [NodeJs](https://nodejs.org/en/) >= 14\n- [Docker](https://www.docker.com/) >= 20\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n- [`mongo`](https://hub.docker.com/_/mongo) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.url`.\n\n```js\n{\n    infra: {\n        mongo: {\n           url: 'mongodb://external-mongo.com',\n        },\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.image` and `infra.mongo.port`.\n\n```js\n{\n    infra: {\n        mongo: {\n            image: 'mongo:latest',\n            port: 27018\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n**NOTE** `corva init` command can generate Dockerfile for you\n\n#### Building a Docker Image\n\nIf you want to use prebuilt image specify `lambda.image` option.\n\nIf no `lambda.image` option provided or no image found the LTF will try to build the image from sources on each run.\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js --help`\n\n#### Help command\n\n```sh\n$ corva --help\ncorva --help\ncorva <command>\n\nCommands:\n  corva.js init [cwd]  Generate .corvarc file\n  corva.js local       Run lambda function locally\n  corva.js completion  generate completion script\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number\n```\n\n#### Init command\n```sh\n$ corva init --help\ncorva init [cwd]\n\nGenerate .corvarc file\n\nPositionals:\n  cwd  Directory where to generate a .corvarc file                     [default: \".\"]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number                                                                                   [boolean]\n```\n\n#### Local command\n```sh\n$ corva local --help\ncorva.js local\n\nRun lambda function locally\n\nLambda options\n  --lambda.image    Lambda docker image                                                                                          [string]\n  --lambda.type     Lambda type                                          [string] [choices: \"scheduler\", \"stream\"] [default: \"scheduler\"]\n  --lambda.handler  Lambda handler function name                                                      [string] [default: \"index.handler\"]\n  --lambda.env      Additional env KEY=VALUE pairs that should be passed to lambda                 [array] [default: [\"LOG_LEVEL=DEBUG\"]]\n\nInfrastructure options\n  --infra.stopContainers  Decide to stop the containers after the test run                                     [boolean] [default: false]\n  --infra.redis.url       External Redis URL for lambda cache                                                                    [string]\n  --infra.redis.image     Docker image for Redis                                                       [string] [default: \"redis:latest\"]\n  --infra.redis.port      Docker port for redis                                                                  [string] [default: 6380]\n  --infra.mongo.url       External MongoDB URL for lambda cache                                                                  [string]\n  --infra.mongo.image     Docker image for MongoDB                                                            [string] [default: \"mongo\"]\n  --infra.mongo.port      Docker port for MongoDB                                                               [string] [default: 27018]\n\nSource options\n  --source.import      Should the test data be imported or not                                                  [boolean] [default: true]\n  --source.dir         Directory where the test-sources are located (relative to the project root)   [string] [default: \"./test-sources\"]\n  --source.database    Source database for events                                                             [string] [default: \"corva\"]\n  --source.collection  Events source collection                                                         [string] [default: \"runner#wits\"]\n\nEvent options\n  --event.json              Pass single event to lambda from provided file                                                       [string]\n  --event.assetId           Event asset id                                                                       [number] [default: 1234]\n  --event.companyId         Event company id                                                                        [number] [default: 1]\n  --event.appKey            App key                                                      [string] [default: \"my-company.my-drilling-app\"]\n  --event.sourceType        Event source type        [string] [choices: \"drilling\", \"drillout\", \"wireline\", \"frac\"] [default: \"drilling\"]\n  --event.config.batchSize  Max amount of records in event                                                         [number] [default: 10]\n  --event.config.interval   Event invocation interval in seconds (min 60):                                         [number] [default: 60]\n  --event.config.logType                                                                     [choices: \"time\", \"depth\"] [default: \"time\"]\n\nExport options\n  --export.enabled      Enables data exporting                                                                    [boolean] [default: false]\n  --export.collections  Collections to export                                                                [array] [default: []]\n  --export.format       Format for export                                             [string] [choices: \"json\", \"csv\"] [default: \"json\"]\n  --export.fields       Fields to be exported in csv                                                               [string] [default: {}]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n```\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo create .corvarc configuration file please run `corva init` in your $CWD\n\nExample:\n\n```json\n{\n  \"version\": 4,\n  \"lambda\": {\n    \"type\": \"scheduler\",\n    \"handler\": \"index.handler\",\n    \"env\": [\n      \"LOG_LEVEL=DEBUG\"\n    ],\n    \"port\": 9002\n  },\n  \"infra\": {\n    \"stopContainers\": false,\n    \"restartContainers\": false,\n    \"redis\": {\n      \"image\": \"redis:latest\",\n      \"port\": 6380\n    },\n    \"mongo\": {\n      \"image\": \"mongo\",\n      \"port\": 27018\n    },\n    \"apiLite\": {\n      \"image\": \"corva/corva-api-lite:latest\",\n      \"mode\": \"data\",\n      \"port\": 3008\n    }\n  },\n  \"source\": {\n    \"import\": true,\n    \"dir\": \"./test-sources\",\n    \"database\": \"corva\",\n    \"collection\": \"runner#wits\",\n    \"limits\": {}\n  },\n  \"event\": {\n    \"assetId\": 1234,\n    \"companyId\": 1,\n    \"sourceType\": \"drilling\",\n    \"config\": {\n      \"batchSize\": 10,\n      \"interval\": 60\n    },\n    \"appKey\": \"my-company.my-drilling-app\",\n    \"options\": {}\n  },\n  \"export\": {\n    \"enabled\": true,\n    \"format\": \"json\",\n    \"collections\": [\n      \"corva#destination-collection\"\n    ]\n  },\n  \"debugOutput\": \"file\"\n};\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will not be removed after the test run by default. To remove containers, please override the option `infra.stopContainers` and set it to `true`.\n- Infrastructure containers like mongo, redis, etc., will not be removed before the test run by default. To preserve containers running, please override the option `infra.restartContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"6f1a8383a2060ed36209134a552fd59f15028bdc","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@tsconfig/node14":"^1.0.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.0.0-rc.3_1637174701207_0.9606659292527464","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.0.0":{"name":"@corva/local-testing-framework","version":"4.0.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.0.0","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"8cb5bfc7b9642cb61db6c9e44bb55c099f46f3cb","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.0.0.tgz","fileCount":50,"integrity":"sha512-/5FdAWPf4I+cVAL1kPjdRRI2dFOccIEwhbLndqQjdLjHsEbT8Nb5rjy9mHaLjik2utZhqV009oCsRYY34qB3Dw==","signatures":[{"sig":"MEUCICHqYO8zx3gMykbxsfZJnjcOomX8aVoYuKgpzSHyr1a3AiEAtTRN48bX+DTuk1c0iYMdp4REXtyrmYICNZ03rualQnc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":207925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnQFzCRA9TVsSAnZWagAAlMcP/RqwMEHrE+rXF1UI8tSh\nkeHd74EezqxU/yVZ+vRvnZBC7jSAnZX/t8B43Y622n5LQVCmn++r+HRzT1vf\nKRB7tPDW9PrmEAOsiz87S+roLtVVKSLWuNQXZY9bdY4lUxMp0ohli95FAvRb\nKWEMgUi4Wz/BWugzoA5u7tlYKYh2evakSfeT+OysxCCXM7vuQupAGbcB4zc2\nO0WIW7GJsRSXIL68q0oXWvMHKqh0BkQV9nLqi0jUGMKfQFNVVFIX6jDxajlS\n5GuvQrD+RzMlRVBlkYLyNrcbVz7O2u4eijnj2doduHJkpM70tawNl0B4x/KP\ndEdHxNJaVtQPnqd0L33simRTl1APGAEcbBx5pGOYR8Gfe2Y1vTYUc40YWIqs\nWEXfQaf72gaLswo0dvq5pv1RGx5bfFF/ZN6QpEiDtHeeVwvo8AtGufOhNzuF\nqkMQyjaP71WGkRY9ztkUNzeFMKEf58WF+ZiNVctMkA6UfjlvS1MBY2tt/vH0\nNbmUdWjoL2qfZ93pLc2lmUFgFAF453nyYEGAf63YnkJ6WquVF6g95f9xwUQf\ngHBkk3TpkrsBe7tLZSyobqZW3Kdo6VzBzqrUTkMWokbsg3YVppKBeJh2R6tF\nBMjaN3ERRgNuMQrrSV+ABTtpBscvoDmZfjkqoIxClKUJjTDh5FW49XWRqKsK\nqe/N\r\n=3OBI\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"9639eb0a0d435202722386553b847763fd701193","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.1","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@tsconfig/node14":"^1.0.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.0.0_1637679475525_0.2668681134711539","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.1.0-rc.0":{"name":"@corva/local-testing-framework","version":"4.1.0-rc.0","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.1.0-rc.0","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"5b4d2f848550bc94f57c5d52192bf4abf96d61a5","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.1.0-rc.0.tgz","fileCount":51,"integrity":"sha512-CfGgSxqgk486lSKZj71BiHxTJx3e3P78dwhD3poLNLcne6cJ62mLjK1PZzZ6/nnE0wVupnHyxUK0nNN9dtA4aQ==","signatures":[{"sig":"MEQCIGN0eJsrmTl0GZBJmSxotV3acysA7DjxtoMIHutolBmyAiBK9UHf4qaxk7gVbBik5Rw8NqFVVU2/oAZvEnNr94MKKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":212631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAQtqCRA9TVsSAnZWagAATpIQAIRku5O1a6A/0FVn2YdB\nXAhgw4HfhFqlcqyCejuhQ4dPXETWdNFTckH1VZYXnHx+OMvAEJIxRrG6RMZt\n0z98hDG2rLQlVmCdDHvkeH+fMCDYbLwixu3a29qootjR/44y+VSrXLSIJtGE\nBONMHoa9KuxlDzT3mLZA+JIt/XBa9du0+pHC9wlznx+YP+bsRlEHuc8Puww2\nTfwfChYAkjmhZtxu/gKTZ9VMaFQQLUIHn1rDGI3XBqg3vcfopONQUSnV/LcR\njAieO3ebUagmwszvY8vGvNCFbzsZfQBdAsfVS3OYXeHxwJ6P9/s8jdJ4YNcw\nJ9IVK1CgYsQ//n6zgDK432c8d5rVG2ojSoZen3g7fmjo08sVghKJ0mZrzgWR\nGL6pIqlbymP+RSAl6OjXc1hua5trUbIc7F4yXNN1GXBX8Zb83wP5O450Tg/P\nGXi+5yuOVp5yHrAnSJNj7XX3X2gWTgmr8oZIW8rrZH0pJPxTMrTmlkIiZRng\nmq4B9phgPU30XQrKiX77UEzZtlKnB0pdnGd2W5UbITi9C2sKFDGDAi9Uz674\n446lXzMIfeAnJiSk2Kq9LddiDxfdqdeX5BfPwtjiOkdE5lKLY5q+9GDDuwRy\nZGhVrfnnNpf+kNlxdyoHviG8pScPwh+Rp1HcyBR5GkvkTMdDpuf1mgqBlZNv\nfZw+\r\n=PKwp\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- [NodeJs](https://nodejs.org/en/) >= 14\n- [Docker](https://www.docker.com/) >= 20\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n- [`mongo`](https://hub.docker.com/_/mongo) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.url`.\n\n```js\n{\n    infra: {\n        mongo: {\n           url: 'mongodb://external-mongo.com',\n        },\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.image` and `infra.mongo.port`.\n\n```js\n{\n    infra: {\n        mongo: {\n            image: 'mongo:latest',\n            port: 27018\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n**NOTE** `corva init` command can generate Dockerfile for you\n\n#### Building a Docker Image\n\nIf you want to use prebuilt image specify `lambda.image` option.\n\nIf no `lambda.image` option provided or no image found the LTF will try to build the image from sources on each run.\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js --help`\n\n#### Help command\n\n```sh\n$ corva --help\ncorva --help\ncorva <command>\n\nCommands:\n  corva.js init [cwd]  Generate .corvarc file\n  corva.js local       Run lambda function locally\n  corva.js completion  generate completion script\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number\n```\n\n#### Init command\n```sh\n$ corva init --help\ncorva init [cwd]\n\nGenerate .corvarc file\n\nPositionals:\n  cwd  Directory where to generate a .corvarc file                     [default: \".\"]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number                                                                                   [boolean]\n```\n\n#### Local command\n```sh\n$ corva local --help\ncorva.js local\n\nRun lambda function locally\n\nLambda options\n  --lambda.image    Lambda docker image                                                       [string]\n  --lambda.type     Lambda type          [string] [choices: \"scheduler\", \"stream\"] [default: \"stream\"]\n  --lambda.handler  Lambda handler function name                   [string] [default: \"index.handler\"]\n  --lambda.env      Additional env KEY=VALUE pairs that should be passed to lambda\n                                                                            [array] [default: [\"A=B\"]]\n  --lambda.secrets  Secrets to be resolved inside the lambda, KEY=VALUE pairs    [array] [default: []]\n\nInfrastructure options\n  --infra.stopContainers  Decide to stop the containers after the test run  [boolean] [default: false]\n  --infra.redis.url       External Redis URL for lambda cache                                 [string]\n  --infra.redis.image     Docker image for Redis                    [string] [default: \"redis:latest\"]\n  --infra.redis.port      Docker port for redis                               [string] [default: 6380]\n  --infra.mongo.url       External MongoDB URL for lambda cache                               [string]\n  --infra.mongo.image     Docker image for MongoDB                  [string] [default: \"mongo:latest\"]\n  --infra.mongo.port      Docker port for MongoDB                            [string] [default: 27020]\n\nSource options\n  --source.import      Should the test data be imported or not               [boolean] [default: true]\n  --source.dir         Directory where the test-sources are located (relative to the project root)\n                                                                                [string] [default: \"\"]\n  --source.database    Source database for events                               [string] [default: \"\"]\n  --source.collection  Events source collection                       [string] [default: \"corva#wits\"]\n\nEvent options\n  --event.json              Pass single event to lambda from provided file                    [string]\n  --event.assetId           Event asset id                                    [number] [default: 5195]\n  --event.companyId         Event company id                                     [number] [default: 1]\n  --event.appKey            App key                       [string] [default: \"some-provider.some-app\"]\n  --event.sourceType        Event source type\n                  [string] [choices: \"drilling\", \"drillout\", \"wireline\", \"frac\"] [default: \"drilling\"]\n  --event.config.batchSize  Max amount of records in event                      [number] [default: 10]\n  --event.config.interval   Event invocation interval in seconds (min 60):     [number] [default: 300]\n  --event.config.logType                                  [choices: \"time\", \"depth\"] [default: \"time\"]\n\nExport options\n  --export.enabled      Enables data exporting                                               [boolean]\n  --export.collections  Collections to export                                    [array] [default: \"\"]\n  --export.format       Format for export          [string] [choices: \"json\", \"csv\"] [default: \"json\"]\n  --export.fields       Fields to be exported in csv                            [string] [default: {}]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                 [boolean] [default: false]\n  --help                  Show help                                                          [boolean]\n```\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo create .corvarc configuration file please run `corva init` in your $CWD\n\nExample:\n\n```json\n{\n  \"version\": 4,\n  \"lambda\": {\n    \"type\": \"scheduler\",\n    \"handler\": \"index.handler\",\n    \"env\": [\n      \"LOG_LEVEL=DEBUG\"\n    ],\n    \"port\": 9002\n  },\n  \"infra\": {\n    \"stopContainers\": false,\n    \"restartContainers\": false,\n    \"redis\": {\n      \"image\": \"redis:latest\",\n      \"port\": 6380\n    },\n    \"mongo\": {\n      \"image\": \"mongo\",\n      \"port\": 27018\n    },\n    \"apiLite\": {\n      \"image\": \"corva/corva-api-lite:latest\",\n      \"mode\": \"data\",\n      \"port\": 3008\n    }\n  },\n  \"source\": {\n    \"import\": true,\n    \"dir\": \"./test-sources\",\n    \"database\": \"corva\",\n    \"collection\": \"runner#wits\",\n    \"limits\": {}\n  },\n  \"event\": {\n    \"assetId\": 1234,\n    \"companyId\": 1,\n    \"sourceType\": \"drilling\",\n    \"config\": {\n      \"batchSize\": 10,\n      \"interval\": 60\n    },\n    \"appKey\": \"my-company.my-drilling-app\",\n    \"options\": {}\n  },\n  \"export\": {\n    \"enabled\": true,\n    \"format\": \"json\",\n    \"collections\": [\n      \"corva#destination-collection\"\n    ]\n  },\n  \"debugOutput\": \"file\"\n};\n```\n\n#### App secrets\n\n##### Via `.env` file\n\nJust put all of you secret variables in `.env` file and prefix with `SECRETS_`.\n\nExample:\n```env\nSECRETS_api_token=foo # this will be available as `ctx.secrets.api_token` (Node SDK) / `secrets['api_token']` (Python SDK)\nAPI_TOKEN=bar # this won't be available as secret\n```\n\n##### Via CLI\n\nJust add `--lambda.secrets` argument.\n\nExample:\n\n```sh\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda --lambda.secrets api_key=\"foo\"\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will not be removed after the test run by default. To remove containers, please override the option `infra.stopContainers` and set it to `true`.\n- Infrastructure containers like mongo, redis, etc., will not be removed before the test run by default. To preserve containers running, please override the option `infra.restartContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"ab8dcd98f60fd0bb9f0fd68afe64ec21f84f2d2c","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.15","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.18.3","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@tsconfig/node14":"^1.0.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.1.0-rc.0_1644235626597_0.15528236991925848","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.1.0-rc.1":{"name":"@corva/local-testing-framework","version":"4.1.0-rc.1","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.1.0-rc.1","maintainers":[{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"d1da67c3a3ce677f6ce0177f07c76c8299581ae7","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.1.0-rc.1.tgz","fileCount":52,"integrity":"sha512-p6KRvs8JmSCzBe/aBktFBbXmM66t++QqEuqtU/633fzNyfVvaybUUhV+35Ysm1AcQXvP4lt5vs7LnH2INvDmWA==","signatures":[{"sig":"MEUCICPUoHEu3i2GPelkptpfBpGclwa/cBRL0DlkL1UhK58UAiEAicn9kUR3Swob3CXMOlmbPTjC+RBUQR8JIPjVeTxMBmI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":221165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiC7P4CRA9TVsSAnZWagAAkiIP/idHqmpX5i7w/AoCaUos\nbSDNnj8c+duKr3Q+y4q3Znu5v2VAoKuozy37vr/Q87eg4V9dFi4itXGyxJT2\nGWl1LytrKjFF4xapybjVGX/48Yf/s9SPpJofywzn4FfgEJTTTwfmnImbZcd/\naypntiv6REXalpA5GoHY29OhS5vEdOyhZ1hQ4jnQGigrY+oTNYOPr8FL5P7k\nnprY3aBotZyPKs7LTVqKwF1TZhQe31UQczr7/ePAxSmWO+yDiODqXS+Z1hJl\nx/1Q06y1VYk1MEDQuxeKfQZ/KkStFdT6jwpgL8RdEtCfJrISTYUzR76bT/9e\nXYFbay3hNiMTaxcc2Ylu0OuoPafKhyW9ek+Z3eMMUEjAzzl5XgS9J35gibTq\nIMDbQMwMEjGqVn3hX7f7dRCbiLVV9z6PubTKAx7Xw2RT9JBs9dteDK4tPaga\n/YesKnk9F9teAkPjWTug9vga8hQnzmKBBbZWZkdHRS6jNnvO04xdZOL2uHV9\n5/NzjGca46n4r65+bc7AQqiFzHX/r73BLMNtPN+q1pMrUSMlWN1nb1Ybh/bP\noDyXru23uedRtmiiBZigQR2hUYoHpSuw3ZybRgayD8uwx00N235cGDQSTH9N\nl4aLkMvz+euzOr9zRKWz2oPzHW30OY9kbxJJ3AEVKfoIr+0vCFzoysuIBMoA\nss73\r\n=ARtR\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- [NodeJs](https://nodejs.org/en/) >= 14\n- [Docker](https://www.docker.com/) >= 20\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n- [`mongo`](https://hub.docker.com/_/mongo) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.url`.\n\n```js\n{\n    infra: {\n        mongo: {\n           url: 'mongodb://external-mongo.com',\n        },\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.image` and `infra.mongo.port`.\n\n```js\n{\n    infra: {\n        mongo: {\n            image: 'mongo:latest',\n            port: 27018\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n**NOTE** `corva init` command can generate Dockerfile for you\n\n#### Building a Docker Image\n\nIf you want to use prebuilt image specify `lambda.image` option.\n\nIf no `lambda.image` option provided or no image found the LTF will try to build the image from sources on each run.\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js --help`\n\n#### Help command\n\n```sh\n$ corva --help\ncorva --help\ncorva <command>\n\nCommands:\n  corva.js init [cwd]  Generate .corvarc file\n  corva.js local       Run lambda function locally\n  corva.js completion  generate completion script\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number\n```\n\n#### Init command\n```sh\n$ corva init --help\ncorva init [cwd]\n\nGenerate .corvarc file\n\nPositionals:\n  cwd  Directory where to generate a .corvarc file                     [default: \".\"]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number                                                                                   [boolean]\n```\n\n#### Local command\n```sh\n$ corva local --help\ncorva.js local\n\nRun lambda function locally\n\nLambda options\n  --lambda.image    Lambda docker image                                                       [string]\n  --lambda.type     Lambda type          [string] [choices: \"scheduler\", \"stream\"] [default: \"stream\"]\n  --lambda.handler  Lambda handler function name                   [string] [default: \"index.handler\"]\n  --lambda.env      Additional env KEY=VALUE pairs that should be passed to lambda\n                                                                            [array] [default: [\"A=B\"]]\n  --lambda.secrets  Secrets to be resolved inside the lambda, KEY=VALUE pairs    [array] [default: []]\n\nInfrastructure options\n  --infra.stopContainers  Decide to stop the containers after the test run  [boolean] [default: false]\n  --infra.redis.url       External Redis URL for lambda cache                                 [string]\n  --infra.redis.image     Docker image for Redis                    [string] [default: \"redis:latest\"]\n  --infra.redis.port      Docker port for redis                               [string] [default: 6380]\n  --infra.mongo.url       External MongoDB URL for lambda cache                               [string]\n  --infra.mongo.image     Docker image for MongoDB                  [string] [default: \"mongo:latest\"]\n  --infra.mongo.port      Docker port for MongoDB                            [string] [default: 27020]\n\nSource options\n  --source.import      Should the test data be imported or not               [boolean] [default: true]\n  --source.dir         Directory where the test-sources are located (relative to the project root)\n                                                                                [string] [default: \"\"]\n  --source.database    Source database for events                               [string] [default: \"\"]\n  --source.collection  Events source collection                       [string] [default: \"corva#wits\"]\n\nEvent options\n  --event.json              Pass single event to lambda from provided file                    [string]\n  --event.assetId           Event asset id                                    [number] [default: 5195]\n  --event.companyId         Event company id                                     [number] [default: 1]\n  --event.appKey            App key                       [string] [default: \"some-provider.some-app\"]\n  --event.sourceType        Event source type\n                  [string] [choices: \"drilling\", \"drillout\", \"wireline\", \"frac\"] [default: \"drilling\"]\n  --event.config.batchSize  Max amount of records in event                      [number] [default: 10]\n  --event.config.interval   Event invocation interval in seconds (min 60):     [number] [default: 300]\n  --event.config.logType                                  [choices: \"time\", \"depth\"] [default: \"time\"]\n\nExport options\n  --export.enabled      Enables data exporting                                               [boolean]\n  --export.collections  Collections to export                                    [array] [default: \"\"]\n  --export.format       Format for export          [string] [choices: \"json\", \"csv\"] [default: \"json\"]\n  --export.fields       Fields to be exported in csv                            [string] [default: {}]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                 [boolean] [default: false]\n  --help                  Show help                                                          [boolean]\n```\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo create .corvarc configuration file please run `corva init` in your $CWD\n\nExample:\n\n```json\n{\n  \"version\": 4,\n  \"lambda\": {\n    \"type\": \"scheduler\",\n    \"handler\": \"index.handler\",\n    \"env\": [\n      \"LOG_LEVEL=DEBUG\"\n    ],\n    \"port\": 9002\n  },\n  \"infra\": {\n    \"stopContainers\": false,\n    \"restartContainers\": false,\n    \"redis\": {\n      \"image\": \"redis:latest\",\n      \"port\": 6380\n    },\n    \"mongo\": {\n      \"image\": \"mongo\",\n      \"port\": 27018\n    },\n    \"apiLite\": {\n      \"image\": \"corva/corva-api-lite:latest\",\n      \"mode\": \"data\",\n      \"port\": 3008\n    }\n  },\n  \"source\": {\n    \"import\": true,\n    \"dir\": \"./test-sources\",\n    \"database\": \"corva\",\n    \"collection\": \"runner#wits\",\n    \"limits\": {}\n  },\n  \"event\": {\n    \"assetId\": 1234,\n    \"companyId\": 1,\n    \"sourceType\": \"drilling\",\n    \"config\": {\n      \"batchSize\": 10,\n      \"interval\": 60\n    },\n    \"appKey\": \"my-company.my-drilling-app\",\n    \"options\": {}\n  },\n  \"export\": {\n    \"enabled\": true,\n    \"format\": \"json\",\n    \"collections\": [\n      \"corva#destination-collection\"\n    ]\n  },\n  \"debugOutput\": \"file\"\n};\n```\n\n#### App secrets\n\n##### Via `.env` file\n\nJust put all of you secret variables in `.env` file and prefix with `SECRETS_`.\n\nExample:\n```env\nSECRETS_api_token=foo # this will be available as `ctx.secrets.api_token` (Node SDK) / `secrets['api_token']` (Python SDK)\nAPI_TOKEN=bar # this won't be available as secret\n```\n\n##### Via CLI\n\nJust add `--lambda.secrets` argument.\n\nExample:\n\n```sh\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda --lambda.secrets api_key=\"foo\"\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will not be removed after the test run by default. To remove containers, please override the option `infra.stopContainers` and set it to `true`.\n- Infrastructure containers like mongo, redis, etc., will not be removed before the test run by default. To preserve containers running, please override the option `infra.restartContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"da97318cc88b072d8fb86a5f52b80814a85737a6","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.16","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.19.0","dependencies":{"got":"^11.8.2","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@tsconfig/node14":"^1.0.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.1.0-rc.1_1644934136579_0.05889209267903084","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"4.1.0-rc.2":{"name":"@corva/local-testing-framework","version":"4.1.0-rc.2","keywords":["lambda","local"],"author":{"name":"Corva LLC"},"license":"UNLICENSED","_id":"@corva/local-testing-framework@4.1.0-rc.2","maintainers":[{"name":"andysem","email":"andriy.semenchenko@corva.ai"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"semykin","email":"v.v.semykin@gmail.com"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"borisatcorva","email":"boris.zagorujko@corva.ai"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"}],"bin":{"corva":"lib/bin/corva.js"},"dist":{"shasum":"a9fa4d723d2fbdb004974c71b09b1541c9532605","tarball":"https://registry.npmjs.org/@corva/local-testing-framework/-/local-testing-framework-4.1.0-rc.2.tgz","fileCount":52,"integrity":"sha512-KKotHCc/M/UbdyaI3UfC02zopeusdOQZx75kbR1yMaIjZIqxAqvyoSQCeS/o37xFeYDxQ1ldarWqEqfHSyAvrw==","signatures":[{"sig":"MEQCIHUTMvtuqwPrdWSvfk+8ZVYCKCsOllbaQ055MejU0ehHAiAx0eDdMVSkS0CV83Ance1ODN8TS8hJox9851D+2Lxl3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":221165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiztLrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg1w/+OZ5uAINrR/2+hS4vBC3Oo//cA+yPHqZxU5slHLFSdNROWtuh\r\nxoEoaXKWD7QWEer15yEYCxFrPSm1hGhINIYn5AZGkvsecPnxJKkar3GuWcQD\r\njsvmVTpHZ2b8ux1Gt3DWc3lxjp7jKUlQdD4iysxI2SgWx0hNFbbqyV82XvKA\r\nMt04rgmt+GTfdsoNsuluKXyRKfiX/9r7ajVwj/hZaPSHhiMnVDyGT6zk3Lfp\r\n3sNXpFMvIoj6c9fevflw0gtGsAAqZdiLSIhHLrMuC4ZqRvU/WAO2DrKaaImY\r\n31R8oBs9TLunYqySN+FOAfad8FOdKF8E9B/qJuzPt24sgz2Vt58pHkP23M7T\r\nOQRZ4+p8kFWNAGVFEXVZv6JCzI1akdhh0aOmZ2mZgx6ViL1kldlsCznVV289\r\nU4FgX2l/KMqe3vQ5urnVofzD+xovdC88x22j7iTl5KidDMUA2KqSxe9CEa1z\r\npNvqC22FH8EHExMXuODjbl20BSsyO/lxZygA4MK+5RJTGsuM/qdxSMacQweY\r\nf9JvUHX3vyQxOxd3NdSrd9XOtcOLFDGm7zW2ssoI5YElfSCQTuH/rBPmZw5D\r\nHVRNJFCvrtq6v3INGsxcUP0mUAlUd6cjyIJ8hUn6PsSwvAYI/k1kqGPOAkMg\r\ni330R5XAl3SXrAt83by64LV1X3sFukaIoBc=\r\n=U97h\r\n-----END PGP SIGNATURE-----\r\n"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"pretty-quick --staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"# Local Testing Framework\n\nLocal Testing Framework (LTF) is designed to develop Corva Lambda applications and generate workload on the local environments and remote machines.\n\n## Table of Contents\n\n- [Local Testing Framework](#local-testing-framework)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Requirements](#requirements)\n    - [Software](#software)\n    - [Utility Docker Images](#utility-docker-images)\n  - [Usage](#usage)\n    - [Install](#install)\n    - [Update](#install)\n    - [Configuring datasources](#configuring-datasources)\n      - [External MongoDB](#external-mongodb)\n      - [Local MongoDB](#local-mongodb)\n        - [CSV JSON](#csv-json)\n        - [JS](#js)\n    - [Preparing your Lambda Application](#preparing-your-lambda-application)\n      - [Dockerizing](#dockerizing)\n      - [Building an Image](#building-an-image)\n      - [Container Registry](#container-registry)\n    - [Preparing corva-api-lite](#preparing-corva-api-lite)\n      - [Building Docker Image](#building-docker-image)\n    - [Prepare Local Testing Framework](#prepare-local-testing-framework)\n    - [Running your App](#running-your-app)\n      - [Config File](#config-file)\n      - [Running](#running)\n    - [Workflow](#workflow)\n    - [Exploring the outputs](#exploring-the-outputs)\n\n## Features\n\n- Support for the following app types:\n  - Real-Time (Stream, based on WITS data)\n  - Polling (Scheduled)\n- Languages: Javascript (Node.js), Python, .NET, Java, etc. (full list of supported languages: https://aws.amazon.com/lambda/faqs/)\n\n## Requirements\n\n### Software\n\n- [NodeJs](https://nodejs.org/en/) >= 14\n- [Docker](https://www.docker.com/) >= 20\n\n### Utility Docker Images\n\n- [`corva-api-lite`](https://hub.docker.com/r/corva/corva-api-lite) - simplified and fast Corva API.\n- [`redis`](https://hub.docker.com/_/redis) - for apps that need to save state between runs\n- [`mongo`](https://hub.docker.com/_/mongo) - for apps that need to save state between runs\n\n## Usage\n\n### Install\n\nUse npm to install the application globally:\n\n```sh\nnpm i -g @corva/local-testing-framework\n```\n\n### Update\n\nIf there are no [breaking changes](https://semver.org/#spec-item-8):\n\n```sh\nnpm update -g @corva/local-testing-framework\n```\n\nin other case you need to reinstall the LTF\n\n### Configuring data sources\n\nCurrently the app supports external MongoDB, local CSV, JSON files, and MongoDB's JS scripts.\n\n#### External MongoDB\n\nTo use external MongoDB, first of all, you should disable local MongoDB setup by setting `infra.mongo.url`.\n\n```js\n{\n    infra: {\n        mongo: {\n           url: 'mongodb://external-mongo.com',\n        },\n    }\n}\n```\n\n#### Local MongoDB\n\nTo use local MongoDB enable it's setup by setting `infra.mongo.image` and `infra.mongo.port`.\n\n```js\n{\n    infra: {\n        mongo: {\n            image: 'mongo:latest',\n            port: 27018\n        },\n    }\n}\n```\n\nThen you should specify the directory of file location with data you want to import.\n\n##### CSV JSON\n\nFor CSV (TSV) and JSON data, you need to specify the directory where the data you want to import is located. It should follow the next structure\n\n```\nimport-dir/\n├── database_1/\n│   ├── collection_1.csv\n│   ├── collection_2.json\n│   ├── collection_3.tsv\n│   └── collection_4.json\n└── database_2/\n    ├── collection_5.json\n    └── collection_6.tsv\n```\n\n**NOTE** if you're exporting JSON data from MongoDB, use `--jsonArray` flag to export valid JSON.\n\n\n##### JS\n\nThis app allows importing data into local MongoDB by writing MongoDB scripts. Comparing to CSV/JSON import, it will enable more advanced configuration of your data.\n\nHere's an example of such script:\n\n```js\n**\n * @var {import('mongodb').Db} db\n */\n\nvar error = true;\n\n/**\n * @type {import('mongodb').Db}\n */\n// @ts-ignore\nvar mydb = db.getSiblingDB('test-database');\n/**\n * @type {import('mongodb').Collection}\n */\n// @ts-ignore\nvar myCollection = mydb.testcollection;\n\nvar res = [\n    myCollection.drop(),\n    myCollection.createIndex({ myfield: 1 }, { unique: true }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.createIndex({ thatfield: 1 }),\n    myCollection.insert({ myfield: 'hello', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello2', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n    myCollection.insert({ myfield: 'hello3', thatfield: 'testing' }),\n];\n\n// @ts-ignore\nprintjson(res);\n\nif (error) {\n    // @ts-ignore\n    print('Error, exiting');\n    // @ts-ignore\n    quit(1);\n}\n\n```\n\nTo use this kind of import, you should provide the path to a directory with such JS files.\n\n### Preparing your Lambda Application\n\nFor Node.js based example see [project](./example/node12.x) in examples directory.\n\n#### Dockerizing\n\nTo run Lambda App via LTF, you'll need to create a Docker image. Use the following example:\n\n```Dockerfile\nFROM lambci/lambda:nodejs12.x\nCOPY . /var/task\n```\n\nIf you need other languages than Node, you can find them on [dockerhub](https://hub.docker.com/r/lambci/lambda/tags)\n\n**NOTE** `corva init` command can generate Dockerfile for you\n\n#### Building a Docker Image\n\nIf you want to use prebuilt image specify `lambda.image` option.\n\nIf no `lambda.image` option provided or no image found the LTF will try to build the image from sources on each run.\n\nTo build your image, you need to run the following command\n\n```sh\n docker build -t <lambda_name> .\n```\n\nReplace `<lambda_name>` with your actual Lambda App name, so it will be easier to recognize what images do you have.\n### Prepare Local Testing Framework\n\n1.  Install local-testing-framework `npm i -g @corva/local-testing-framework`\n2.  (Optionally) View cli app help via `node bin/corva.js --help` and `node bin/corva.js --help`\n\n#### Help command\n\n```sh\n$ corva --help\ncorva --help\ncorva <command>\n\nCommands:\n  corva.js init [cwd]  Generate .corvarc file\n  corva.js local       Run lambda function locally\n  corva.js completion  generate completion script\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number\n```\n\n#### Init command\n```sh\n$ corva init --help\ncorva init [cwd]\n\nGenerate .corvarc file\n\nPositionals:\n  cwd  Directory where to generate a .corvarc file                     [default: \".\"]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                                                    [boolean] [default: false]\n  --help                  Show help                                                                                             [boolean]\n  --version               Show version number                                                                                   [boolean]\n```\n\n#### Local command\n```sh\n$ corva local --help\ncorva.js local\n\nRun lambda function locally\n\nLambda options\n  --lambda.image    Lambda docker image                                                       [string]\n  --lambda.type     Lambda type          [string] [choices: \"scheduler\", \"stream\"] [default: \"stream\"]\n  --lambda.handler  Lambda handler function name                   [string] [default: \"index.handler\"]\n  --lambda.env      Additional env KEY=VALUE pairs that should be passed to lambda\n                                                                            [array] [default: [\"A=B\"]]\n  --lambda.secrets  Secrets to be resolved inside the lambda, KEY=VALUE pairs    [array] [default: []]\n\nInfrastructure options\n  --infra.stopContainers  Decide to stop the containers after the test run  [boolean] [default: false]\n  --infra.redis.url       External Redis URL for lambda cache                                 [string]\n  --infra.redis.image     Docker image for Redis                    [string] [default: \"redis:latest\"]\n  --infra.redis.port      Docker port for redis                               [string] [default: 6380]\n  --infra.mongo.url       External MongoDB URL for lambda cache                               [string]\n  --infra.mongo.image     Docker image for MongoDB                  [string] [default: \"mongo:latest\"]\n  --infra.mongo.port      Docker port for MongoDB                            [string] [default: 27020]\n\nSource options\n  --source.import      Should the test data be imported or not               [boolean] [default: true]\n  --source.dir         Directory where the test-sources are located (relative to the project root)\n                                                                                [string] [default: \"\"]\n  --source.database    Source database for events                               [string] [default: \"\"]\n  --source.collection  Events source collection                       [string] [default: \"corva#wits\"]\n\nEvent options\n  --event.json              Pass single event to lambda from provided file                    [string]\n  --event.assetId           Event asset id                                    [number] [default: 5195]\n  --event.companyId         Event company id                                     [number] [default: 1]\n  --event.appKey            App key                       [string] [default: \"some-provider.some-app\"]\n  --event.sourceType        Event source type\n                  [string] [choices: \"drilling\", \"drillout\", \"wireline\", \"frac\"] [default: \"drilling\"]\n  --event.config.batchSize  Max amount of records in event                      [number] [default: 10]\n  --event.config.interval   Event invocation interval in seconds (min 60):     [number] [default: 300]\n  --event.config.logType                                  [choices: \"time\", \"depth\"] [default: \"time\"]\n\nExport options\n  --export.enabled      Enables data exporting                                               [boolean]\n  --export.collections  Collections to export                                    [array] [default: \"\"]\n  --export.format       Format for export          [string] [choices: \"json\", \"csv\"] [default: \"json\"]\n  --export.fields       Fields to be exported in csv                            [string] [default: {}]\n\nOptions:\n  --skip-version-upgrade  Display warning on version update                 [boolean] [default: false]\n  --help                  Show help                                                          [boolean]\n```\n### Running your App\n\nBefore running your app you should decide what type of events does it consume. Currently, app re-runner supports Real-Time (Stream) and Polling (Scheduled) apps.\n\nHere are some examples of such events:\n\n**Stream Event**:\n\n```json\n[\n  {\n    \"metadata\": {\n      \"apps\": {\n        \"corva.wits-depth-summary\": {\n          \"app_connection_id\": 123\n        }\n      },\n      \"app_stream_id\": 456\n    },\n    \"records\": [\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Some unnecessary drilling that's excluded\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300800,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.4,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546300900,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301000,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 99.9,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301100,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.3,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301200,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.5,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      },\n      {\n        \"asset_id\": 1,\n        \"timestamp\": 1546301300,\n        \"company_id\": 24,\n        \"version\": 1,\n        \"data\": {\n          \"hole_depth\": 100.6,\n          \"weight_on_bit\": 1,\n          \"state\": \"Rotary Drilling\"\n        }\n      }\n    ]\n  }\n]\n```\n\n**Scheduled Event**:\n\n```json\n{\n  \"collection\": \"operations\",\n  \"source_type\": \"drilling\",\n  \"environment\": \"qa\",\n  \"interval\": 300,\n  \"schedule_start\": 1578420000000,\n  \"schedule_end\": 1578420300000,\n  \"asset_id\": 16280\n}\n```\n\nLTF based on app type generates one of those event types. By default, for streams, it queries WITS collection and creates events from it from the very beginning of the well until drilling is completed. For scheduled events, it gets intervals between first and last wits record and generates 300s events within a given interval.\n\nAlso, it's possible to launch the app for a single event. See LTF help for how to.\n\n#### Config File\n\nTo create .corvarc configuration file please run `corva init` in your $CWD\n\nExample:\n\n```json\n{\n  \"version\": 4,\n  \"lambda\": {\n    \"type\": \"scheduler\",\n    \"handler\": \"index.handler\",\n    \"env\": [\n      \"LOG_LEVEL=DEBUG\"\n    ],\n    \"port\": 9002\n  },\n  \"infra\": {\n    \"stopContainers\": false,\n    \"restartContainers\": false,\n    \"redis\": {\n      \"image\": \"redis:latest\",\n      \"port\": 6380\n    },\n    \"mongo\": {\n      \"image\": \"mongo\",\n      \"port\": 27018\n    },\n    \"apiLite\": {\n      \"image\": \"corva/corva-api-lite:latest\",\n      \"mode\": \"data\",\n      \"port\": 3008\n    }\n  },\n  \"source\": {\n    \"import\": true,\n    \"dir\": \"./test-sources\",\n    \"database\": \"corva\",\n    \"collection\": \"runner#wits\",\n    \"limits\": {}\n  },\n  \"event\": {\n    \"assetId\": 1234,\n    \"companyId\": 1,\n    \"sourceType\": \"drilling\",\n    \"config\": {\n      \"batchSize\": 10,\n      \"interval\": 60\n    },\n    \"appKey\": \"my-company.my-drilling-app\",\n    \"options\": {}\n  },\n  \"export\": {\n    \"enabled\": true,\n    \"format\": \"json\",\n    \"collections\": [\n      \"corva#destination-collection\"\n    ]\n  },\n  \"debugOutput\": \"file\"\n};\n```\n\n#### App secrets\n\n##### Via `.env` file\n\nJust put all of you secret variables in `.env` file and prefix with `SECRETS_`.\n\nExample:\n```env\nSECRETS_api_token=foo # this will be available as `ctx.secrets.api_token` (Node SDK) / `secrets['api_token']` (Python SDK)\nAPI_TOKEN=bar # this won't be available as secret\n```\n\n##### Via CLI\n\nJust add `--lambda.secrets` argument.\n\nExample:\n\n```sh\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda --lambda.secrets api_key=\"foo\"\n```\n\n#### Running\n\nHere's an example how to launch LTF:\n\n```\ncorva local --lambda.env MY_ENV_VARIABLE=\"<some_value>\" --lambda.image=test-lambda\n```\n\n1. `--lambda.image=test-lambda` - the name/uri of docker image of your application\n2. `--lambda.env MY_ENV_VARIABLE=\"<some_value>\"` - environment variables that will be passed to lambda docker container\n\nYou may override values from the config file with CLI options.\n\nUseful variables:\n\n- `LOG_LEVEL` controls on which log messages should be printed (`info` by default), e.g. `LOG_LEVEL=debug` will allow debug, info, warn and error messages, while `LOG_LEVEL=error` will permit error messages only\n- `LOG_THRESHOLD_MESSAGE_SIZE` controls on how many symbols will be printer per logger invocation (1000 by default), e.g. `LOG_THRESHOLD_MESSAGE_SIZE=10000`. This will not affect the deployed app.\n- `LOG_THRESHOLD_MESSAGE_COUNT` controls on how many log messages will be allowed to print per lambda invocation (15 by default), e.g. `LOG_THRESHOLD_MESSAGE_COUNT=100`. This will not affect the deployed app.\n\n**NOTES:**\n\nPriority of the environment variables:\n\n- CLI `lambda.env` options\n- `.corvarc` file `lambda.env` options\n- `settings.env` section from `manifest.json` file.\n\n- the CLI `lambda.env` options will replace `.corvarc` provided options\n- CLI/`corvarc` will extend `manifest.json` provided options\n- only `settings.env` section from `manifest.json` will be applied on app deployment\n\n### Workflow\n\nIn general, LTF follows the next steps\n\n1. Setup Docker\n2. Download/check for all needed images (`redis`, `mongo`, `corva-api-lite`, your app)\n3. Launch Mongo\n4. Launch Redis\n5. Launch `corva-api-lite`\n6. Prepare env variables for Lambda application\n7. Get WITS data and determine bounds for events\n8. Start loop\n   1. Create an event\n   2. Create a container for Lambda App\n   3. Pass env variables to the container\n   4. Run Lambda app container\n   5. Shutdown container\n   6. Back to 7.1\n9. (OPTIONAL) Export data to json/csv\n10. Shutdown all containers and exit\n\n### Exploring the outputs\n\n- Lambda run output is piped to the console stdout by default. It is possible to redirect output to file by setting the `debugOutput` config option to `file`.\n- Infrastructure containers like mongo, redis, etc., will not be removed after the test run by default. To remove containers, please override the option `infra.stopContainers` and set it to `true`.\n- Infrastructure containers like mongo, redis, etc., will not be removed before the test run by default. To preserve containers running, please override the option `infra.restartContainers` and set it to `true`.\n\n#### Exporting run data\n\nIt is possible to export the content of the MongoDB collections in JSON or CSV format.\n\nThe results of export will be available in `output` directory in your `$CWD`, the file format is $LAMBDA_NAME_$ASSET*ID*$TIMESTAMP_$COLLECTION.\\$FORMAT, e.g `dev-center-gamma-depth_1234_1615369834679_corva#data.drillstring.csv`\n\nTo export in JSON set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'json',\n  collections: ['corva#example1', 'corva#example2] // list of collections you want to export\n}\n```\n\nTo export in CSV set `export` property to\n\n```js\n{\n  enabled: true,\n  format: 'csv',\n  collections: ['corva#example1', 'corva#example2'] // list of collections you want to export\n  fields: {\n    'corva#example1': ['field1', 'field2', 'deep.structure.field'],\n    'corva#example2': ['some-other-field', 'field_with_dashes']\n  }\n}\n\n```\n","gitHead":"41bb59f7fcad8b922e81f09eaf12ce5b3b75f002","scripts":{"lint":"eslint --ext .ts .","test":"npm audit --production && npm run lint && npm run build && npm run unit","unit":"jest","build":"tsc -p tsconfig.build.json","release":"git add -A && standard-version -a","prebuild":"rm -rf lib/**/*.js lib/**/*.d.ts","prerelease":"pretty-quick && npm run build","release-rc":"git add -A && standard-version -a --prerelease rc --skip.changelog","get-changelog":"conventional-changelog -r 2 -p angular","prerelease-rc":"npm run prerelease"},"_npmUser":{"name":"villeti","email":"villeti@gmail.com"},"_npmVersion":"6.14.17","description":"Corva lambda local testing framework","directories":{},"_nodeVersion":"14.20.0","dependencies":{"got":"^11.8.5","chalk":"^4.1.2","debug":"^4.3.2","yargs":"^17.2.1","lodash":"^4.17.21","semver":"^7.3.5","aws-sdk":"^2.1009.0","find-up":"^4.1.0","mongodb":"^4.1.3","npm-api":"^1.0.1","inquirer":"^8.2.0","dockerode":"^3.3.1","micromatch":"^4.0.4","human-to-cron":"^0.3.1","merge-options":"^3.0.4","@corva/node-sdk":"^5.4.3","@corva/node-logger":"^4.2.1","source-map-support":"^0.5.20","@corva/node-api-client":"^6.0.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.3","husky":"^7.0.2","eslint":"^7.32.0","ts-jest":"^27.0.7","jest-junit":"^13.0.0","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.11.1","@types/debug":"^4.1.7","@types/yargs":"^17.0.4","@types/lodash":"^4.14.176","@types/semver":"^7.3.8","@types/mongodb":"^4.0.6","@commitlint/cli":"^13.2.1","@types/inquirer":"^8.1.3","@tsconfig/node14":"^1.0.1","@types/dockerode":"^3.3.0","standard-version":"^9.3.2","@types/micromatch":"^4.0.2","@types/human-to-cron":"^0.3.0","@corva/eslint-config-node":"^4.2.0","@typescript-eslint/parser":"^5.1.0","@commitlint/config-conventional":"^13.2.0","@typescript-eslint/eslint-plugin":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/local-testing-framework_4.1.0-rc.2_1657721578914_0.8931326602031242","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2020-10-12T09:21:51.805Z","modified":"2026-08-05T20:27:24.258Z","2.3.0":"2020-10-01T13:12:31.137Z","2.4.0":"2020-10-12T09:21:52.143Z","2.5.0":"2020-10-13T09:18:27.063Z","2.6.0":"2020-12-08T08:11:48.658Z","2.6.1":"2020-12-10T14:30:30.067Z","2.6.2":"2020-12-11T11:33:28.025Z","2.6.3":"2020-12-22T16:05:24.857Z","3.0.0":"2021-03-10T16:14:39.191Z","3.0.1":"2021-03-11T10:46:20.471Z","3.0.2":"2021-03-11T11:33:26.234Z","3.1.0":"2021-03-11T14:38:25.882Z","3.1.1":"2021-04-19T16:11:40.284Z","3.1.2":"2021-04-29T15:56:34.142Z","3.1.3":"2021-05-04T09:25:13.140Z","3.1.5":"2021-05-05T16:15:05.109Z","3.1.6":"2021-08-30T09:50:08.225Z","3.1.7":"2021-09-09T15:27:58.878Z","3.1.8":"2021-10-04T14:23:42.365Z","3.2.0-rc.0":"2021-10-21T08:11:58.228Z","3.2.0-rc.1":"2021-10-26T13:01:23.114Z","3.2.0-rc.2":"2021-10-26T13:10:30.285Z","3.2.0-rc.3":"2021-10-29T13:08:41.560Z","4.0.0-rc.0":"2021-11-04T15:07:16.328Z","4.0.0-rc.1":"2021-11-08T10:19:40.210Z","4.0.0-rc.2":"2021-11-17T17:53:27.978Z","4.0.0-rc.3":"2021-11-17T18:45:01.536Z","4.0.0":"2021-11-23T14:57:55.667Z","4.1.0-rc.0":"2022-02-07T12:07:06.747Z","4.1.0-rc.1":"2022-02-15T14:08:56.716Z","4.1.0-rc.2":"2022-07-13T14:12:59.108Z"},"author":{"name":"Corva LLC"},"license":"UNLICENSED","keywords":["lambda","local"],"description":"Corva lambda local testing framework","maintainers":[{"name":"andrii.koval","email":"andrii.koval@corva.ai"},{"name":"antonpyrlyk","email":"antonpyrlyk@gmail.com"},{"name":"bestfit","email":"bestfitforyou@hotmail.com"},{"name":"corva-devops-automation","email":"devops.automation@corva.ai"},{"name":"dumavit1","email":"vitalii.duma@corva.ai"},{"name":"jordanambra","email":"jordan@serenity.software"},{"name":"kostia.khozhay","email":"kostiantyn.khozhay@gmail.com"},{"name":"maksymozymok","email":"maksym.ozymok@corva.ai"},{"name":"mgdskr_corva","email":"oleksandr.maksymenko@corva.ai"},{"name":"oleksandr_krupko","email":"alex04949@gmail.com"},{"name":"ruslan.shukiurov","email":"ruslan.shukiurov@corva.ai"},{"name":"ryandawson","email":"ryan+npm@corva.ai"},{"name":"suchov","email":"artem.sychov@corva.ai"},{"name":"vasyl.skalozub","email":"vasyl.skalozub@corva.ai"},{"name":"villeti","email":"villeti@gmail.com"},{"name":"yuliiahryhorchuk","email":"julia.grygorchuk@corva.ai"}],"readme":"","readmeFilename":""}