File tree Expand file tree Collapse file tree 6 files changed +17
-8
lines changed
Expand file tree Collapse file tree 6 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 11# Change Log
22
3+ ## [ v4.72.0] ( https://github.com/plivo/plivo-node/tree/v4.72.0 ) (2025-06-16)
4+ ** Bug Fix - sendDigits validation issue**
5+ - Fixed ` isRequired ` validator to properly handle falsy values including the number ` 0 ` , resolving "Missing mandatory field: digits" error when sending digit "0"
6+ - Updated TypeScript definitions for ` sendDigits ` method to accept ` string ` instead of ` number ` to match API expectations and existing tests
7+
38## [ v4.71.0] ( https://github.com/plivo/plivo-node/tree/v4.71.0 ) (2025-06-13)
49** Bug Fix**
510- Added HTTP/HTTPS agent configuration with connection pooling to prevent progressive API latency increase.
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ export class Call extends PlivoResource {
459459 /**
460460 * Send digits on a call
461461 * @method
462- * @param {number } digits - digits to be send
462+ * @param {string } digits - digits to be send
463463 * @param {object } optionalParams - to send digits for call
464464 * @promise {object} returns PlivoGenericResponse Object
465465 * @fail {Error} returns Error
@@ -981,7 +981,7 @@ export class CallInterface extends PlivoResourceInterface {
981981 * Send digits on a call
982982 * @method
983983 * @param {string } callUUID - call uuid to send digits on a call
984- * @param {number } digits - digits to be send
984+ * @param {string } digits - digits to be send
985985 * @param {object } optionalParams - optional params to send digits
986986 * @promise {object} returns PlivoGenericResponse Object
987987 * @fail {Error} returns Error
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export let validate = (() => {
3434 // };
3535
3636 Validators . isRequired = field => {
37- return ! field ;
37+ return field === null || field === undefined || field === '' ;
3838 } ;
3939
4040 Validators . isTemplate = field => {
Original file line number Diff line number Diff line change 11{
22 "name" : " plivo" ,
3- "version" : " 4.71 .0" ,
3+ "version" : " 4.72 .0" ,
44 "description" : " A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML" ,
55 "homepage" : " https://github.com/plivo/plivo-node" ,
66 "files" : [
Original file line number Diff line number Diff line change @@ -152,6 +152,10 @@ describe('calls', function () {
152152 it ( 'should send digits' , function ( ) {
153153 return client . calls . sendDigits ( 'aaa-deeiei3-dfddd' , '123' ) ;
154154 } ) ;
155+
156+ it ( 'should send digits with zero' , function ( ) {
157+ return client . calls . sendDigits ( 'aaa-deeiei3-dfddd' , '0' ) ;
158+ } ) ;
155159 } ) ;
156160
157161 describe ( 'Play' , function ( ) {
Original file line number Diff line number Diff line change @@ -248,12 +248,12 @@ export class Call extends PlivoResource {
248248 /**
249249 * Send digits on a call
250250 * @method
251- * @param {number } digits - digits to be send
251+ * @param {string } digits - digits to be send
252252 * @param {object } optionalParams - to send digits for call
253253 * @promise {object} returns PlivoGenericResponse Object
254254 * @fail {Error} returns Error
255255 */
256- sendDigits ( digits : number , optionalParams : object ) : Promise < SendDigitsResponse > ;
256+ sendDigits ( digits : string , optionalParams : object ) : Promise < SendDigitsResponse > ;
257257 /**
258258 * Hangup a Call Request
259259 * @method
@@ -424,12 +424,12 @@ export class CallInterface extends PlivoResourceInterface {
424424 * Send digits on a call
425425 * @method
426426 * @param {string } callUUID - call uuid to send digits on a call
427- * @param {number } digits - digits to be send
427+ * @param {string } digits - digits to be send
428428 * @param {object } optionalParams - optional params to send digits
429429 * @promise {object} returns PlivoGenericResponse Object
430430 * @fail {Error} returns Error
431431 */
432- sendDigits ( callUUID : string , digits : number , optionalParams : object ) : Promise < any > ;
432+ sendDigits ( callUUID : string , digits : string , optionalParams : object ) : Promise < any > ;
433433 /**
434434 * Hangup a call request
435435 * @method
You can’t perform that action at this time.
0 commit comments