elastalert_server.ts
- Object is possibly null (check is vars like _testController are deffined corectly)server_config.ts
- Added JSON.parse - probably not neede check how it was done before (old joi autoparse to object)3)//"precommit": "./node_modules/eslint/bin/eslint.js ."
in package.json4)file_system.ts
getEmptyDirectoryIndex()
- add typecontrollers\rules\index.ts
- flat model for rules instead of{ rules: ["rule1", "rule2"]}
controllers\templates\index.ts
- flat model for rules instead of{ templates: ["template1", "template2"]}
controllers\rules\index.ts
andcontrollers\templates\index.ts
are almost the same make base class or somethingrequest_error.ts
data more specify- JOI for
TestRuleOptions
or find way to handling defaults statusHandler
nullable status?- Better implement
ConfigService
as singleton and refactor to not using config/index.ts - Refactor
rulesController.rule
metadataHandler
fixresp.hits.hits.map(h => h._source);
metadataHandler
fixgetQueryString
->(<any>request.query).rule_name)
15)scripts/replace_templates.sh
probably not needed- Better error handling and documentation - for now global error handling in
elastalert_server.ts
https://tsoa-community.github.io/docs/error-handling.html#setting-up-error-handling - Logging requst change RouteLogger to
morgan (https://rsbh.dev/blog/rest-api-with-express-typescript)bunyan-middleware (https://www.npmjs.com/package/bunyan-middleware) - Split logic form metadata.controller.ts to metadata.service.ts
- Migrate latest fixes from https://github.com/johnsusek/elastalert-server
20) Verify test rule on WS IMO something is wrong here: e84a3fa8fc79520eaddf701c220d3f92291bb9c9 Last catch in testRule() supresses all errors