-
Notifications
You must be signed in to change notification settings - Fork 10
chore: Move chatbot handlers to Lambda [CHI-3218] #2929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nitpick about using the correct identifier types.
Honestly I didn't look in detail at the lex implementation itself, just more at how it's integrated into the lambda, which looks good
import { ErrorResult, newErr, newOk, Result } from '../Result'; | ||
import { HttpClientError } from '../httpErrors'; | ||
|
||
import { HrmAccountId, inferAccountSidFromHrmAccountId } from './hrmAccountId'; | ||
|
||
const requestFromInternalHrmEndpoint = async <TRequest, TResponse>( | ||
hrmAccountId: HrmAccountId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the correct type
memory: LexMemory; | ||
controlTask: TaskInstance; | ||
controlTaskAttributes: any; | ||
accountSid: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use correct type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the types niggle, otherwise looks good
This PR is related to techmatters/serverless#757 and https://github.com/techmatters/infrastructure-config/compare/master...gian_CHI-3218.
Description
This PR migrates all the chatbot handlers to the account scoped Twilio Lambda.
captureChannelWithBot
(/lambda/twilio/account-scoped/{accountSid}/channelCapture/captureChannelWithBot
).chatbotCallback
(/lambda/twilio/account-scoped/{accountSid}/channelCapture/chatbotCallback
).chatbotCallbackCleanup
(/lambda/twilio/account-scoped/{accountSid}/channelCapture/chatbotCallbackCleanup
).postSurveyListener
, a taskrouter event listener to trigger post survey.Migration
To Lex v2 migration, refer to techmatters/serverless#756.
Make HTTP Request
widget with the following configuration:captureChannelWithBot
.POST
.<hrm base url>/lambda/twilio/account-scoped/{%if trigger.conversation%}{{trigger.conversation.AccountSid}}{%else%}{{trigger.message.AccountSid}}{%endif%}/channelCapture/captureChannelWithBot
.Application/JSON
.Make HTTP Request
widget with the following configuration:chatbotCallbackCleanup2
.POST
.<hrm base url>/lambda/twilio/account-scoped/{%if trigger.conversation%}{{trigger.conversation.AccountSid}}{%else%}{{trigger.message.AccountSid}}{%endif%}/channelCapture/chatbotCallbackCleanup
.Application/JSON
.enable_lambda_post_survey_processing
feature flag.
Checklist
Other Related Issues
None
Verification steps
AFTER YOU MERGE
You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P