Wrong `PromptAttributes` interface implementation
Problem
Issue Summary Right now I'm following the docs to use `Pay.Prompt` noun but there is a problem while using TypeScript. The interface includes the following: [code block] And as we can see the attribute is `for_` (with the `_`) and inside the docs: https://www.twilio.com/es-mx/docs/voice/twiml/pay/prompt#for It's `for` only (without the `_`), if we try to use `Pay.Prompt` like the following: [code block] It throws an error: `Argument of type '{ for: string; }' is not assignable to parameter of type 'PromptAttributes'.` So, we need to use `for_` but the Twilio parser does not detect `for_`. Another thing is that it looks like the docs are also out of date: The errorTypes are: [code block] And there is no `invalid-postal-code` for example when the current docs state that it is actually there. Maybe it could be another good idea to add the usage of the errorTypes inside the docs? so we know it's an array and how to use it with `cardType` could be really useful. Steps to Reproduce 1. Create a Twilio Serverless function 2. Add TS support 3. Use the `Pay` verb 4. Add the `Prompt` noun support Code Snippet [code block] Exception/Log [code block] Technical details: twilio-node version: ^3.80.0 twilio/runtime-handler: ^1.25.0 node version: 16.16.0 typescript: 4.0.0 ts-node: 10.7.0 @types/node 17.0.21 Workaround: There is a workaround by adding `// @ts-ignore` above the line like: [code block]
Error Output
error:
`Argument of type '{ for: string; }' is not assignable to parameter of type 'PromptAttributes'.`
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Wrong `PromptAttributes` interface implementation
Hi @asfo , I've tried to recreate your issue but did not get the same error. In order to properly debug this issue, please file a support ticket.
Trust Score
1 verification
- 1
Hi @asfo , I've tried to recreate your issue but did not get the same error. In
Hi @asfo , I've tried to recreate your issue but did not get the same error. In order to properly debug this issue, please file a support ticket.
Validation
Resolved in twilio/twilio-node GitHub issue #825. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep