-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: events and directive #55
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.
Looks like prototype tool doesn't work with Event
, I guess it can be fixed on the front-end by sending another request type
import { Command, Context, extractFrameCommand } from '@voiceflow/client'; | ||
|
||
import { EventRequest, RequestType } from '@/lib/services/voiceflow/types'; | ||
// import { mapSlots } from '@/lib/services/voiceflow/utils'; |
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.
can be removed
// export enum Request { | ||
// INTENT = 'IntentRequest', | ||
// } |
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.
can be removed
const utilsObj = { | ||
buildContext, | ||
getEvent, | ||
// handleEvent, |
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.
can be removed
// export const EventHandlerGenerator = (utils: typeof utilsObj): RequestHandler => ({ | ||
// async canHandle(input: HandlerInput): Promise<boolean> { | ||
// const context = await utils.buildContext(input); | ||
// return !!getEvent(context); | ||
// }, | ||
// async handle(input: HandlerInput) { | ||
// const context = await utils.buildContext(input); | ||
// // based on the event, modify the context | ||
// await handleEvent(context); | ||
// input.attributesManager.setPersistentAttributes(context.getRawState()); | ||
|
||
// return IntentHandler.handle(input); | ||
// }, | ||
// }); |
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.
can be removed
Codecov Report
@@ Coverage Diff @@
## master #55 +/- ##
==========================================
- Coverage 97.65% 95.65% -2.00%
==========================================
Files 88 92 +4
Lines 1578 1658 +80
Branches 260 273 +13
==========================================
+ Hits 1541 1586 +45
- Misses 27 62 +35
Partials 10 10
Continue to review full report at Codecov.
|
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.
great job! There's a lot of comments to cleanup and there's no tests for the new event handler (in case time is tight, let's create a ticket in Jira for adding tests)
@@ -0,0 +1,50 @@ | |||
import { HandlerFactory } from '@voiceflow/client'; | |||
import { Directive } from 'ask-sdk-model'; | |||
import _isString from 'lodash/isString'; |
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.
nice
🎉 This PR is included in version 1.12.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* wip: add directive handlers * chore: handlers * chore: event setup * wip: event implementation * chore: fixed tests * test: add directive handler tests * chore: update client to make tests pass * chore: remove comments and clean up * chore: variable mapping Co-authored-by: leartgjoni-voiceflow <[email protected]>
contingent on:
voiceflow/database
: https://github.com/voiceflow/database/pull/41voiceflow/app
: https://github.com/voiceflow/creator-app/pull/1612voiceflow/api
: https://github.com/voiceflow/creator-api/pull/359renamed previous
eventHandler
topermissionHandler
the new
eventHandler
is for the event block, and attempts to intercept and modify the stack (like the intent block) but at the Alexa Handler level, not the Voiceflow Client Handler level.