lib-connector v0.1.1-0
Connector Framework
Logging
Provide standard “ENTER” log statements in the ‘Connector’ library which would be printed consistently across all connectors
Provide standard “EXIT” log statements in the ‘Connector’ library which would be printed consistently across all connectors. This log statement should print the success/failure response code.
All log statements should print the following id(s) - CorrelationId (x-corr-id), MerchantId (extracted from the site context or from x-merchant-id header), transaction Id (unique id per each request)
Implement JSOn serialization for easy consumption on DataDog
AsyncLocalStorage to achieve the things above
Exception Handling
Global try/catch to handle and log all errors sent by the connector (including the stack trace)
Define standard Error Classes (SystemError, ApplicationError etc) for developers to use
Input validation
Implement input payload validation as done in Route library
Security
Implement basic token validation (Is x-api-key present?)
ToDo
- Implement API context
- Implement Data context / Mongo/Redis
- Implement Spec Validation
- Handle headers
- Describe interfaces
- Authorization / token handling
- SQS Handler
- Notification: Failing requests / Sucessful requests
- tests
- Documentation
- Publish to npm
Coding standards
https://yottadv.atlassian.net/wiki/spaces/all/pages/2138210375/Integrations+Coding+Standards