Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional streaming feature using Chat API.
Update package.json Update aws packages to v3.620.0 Fix event streaming bug with ChatAPI. Bugfix here: https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.620.0 Prereq for Chat API feature. Update IAM permissions for Chat API Add Chat to IAM role. Prereq for Chat API streaming feature. Add slack-stream-event lambda handler To allow the optional streaming feature of ChatAPI we add an additional lambda handler. Admin can choose between which endpoint will handle slack events. Modify helper functions to fit both ChatSync & Chat Keep code DRY by not remaking each helper function. 1. Add "commandType" to chat & callClient to determine return type. 2. Modify getResponseAsBlocks inputs to fit Chat API outputstream. 3. Add optional MetadataEvent typing to saveMessageMetadata & getFeedbackBlocks for ChatAPI. Remove `chat` function and directly use client calls 1. Remove chat function to avoid double conditionals 2. Add the sendChatSyncCommand & sendChatCommand functions to dependencies. Add updated unit tests for ChatSync & Chat 1. Add mock responses for Chat API 2. Modify mocks to have two separate calls for ChatSync/Chat. 3. Modify unit tests to fit (2). 4. Create new unit test file for slack-stream-event-handler.ts. All the tests are the same as slack-event-handler.test.ts except for the 5 that start with "Should chat" -> Modified to fit Chat API output. refactor: remove 'any' type from input object in sendChatSyncCommand Update slack event handler to use modified helpers Create slack-stream-event-handler 1. Optional event subscription endpoint for slack. 2. Code is identical to slack-event-handler.ts until line 334. Update READMEs with chat stream feature setup Remove unnecessary variable `latestTextEvent` Previous implementations required the latestTextEvent for future references after loop -> this is no longer required. Update CHANGELOG date Modify `sendChatSyncCommand` and `sendChatCommand` to be thin wrappers 1. Moved the try catch & truncating to amazon-q-helpers.ts & dumbed logic down in amazon-q-client.ts functions to only be thing wrappers. Modify functions to fit `callChatSyncCommand` & `callChatCommand`
- Loading branch information