From 58c6df8daa482d630d2c102db46535b1cc527858 Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Thu, 17 Oct 2024 10:46:25 +0530 Subject: [PATCH] SMS-7107: Add fraud_check param support --- CHANGELOG.md | 7 ++++++- Makefile | 6 +++++- lib/resources/verify.js | 8 ++++++-- package.json | 2 +- setup_sdk.sh | 10 ++++------ 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdf1f6fb..071073ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,14 @@ # Change Log +## [v4.69.2](https://github.com/plivo/plivo-node/tree/v4.69.2) (2024-10-16) +**Feature - FraudCheck param in Create, Get and List Session** +- Support for the `fraud_check` parameter in sms verify session request +- Added support for `fraud_check` in GET and LIST verify session. + ## [v4.69.1](https://github.com/plivo/plivo-node/tree/v4.69.1) (2024-10-10) **Feature - Dtmf param in Create, Get and List Session** - Support for the `dtmf` parameter in voice verify session request - Added support for `dtmf` in GET and LIST verify session. -- + ## [v4.69.0](https://github.com/plivo/plivo-node/tree/v4.69.0) (2024-09-30) **Feature - Adding new param support for Number Masking session with single party ** - Added `create_session_with_single_party`, `virtual_number_cooloff_period` and `force_pin_authentication` attributes in Masking Session diff --git a/Makefile b/Makefile index d7d18431..16771d8d 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,11 @@ build: start: docker-compose up --build --remove-orphans --detach - docker attach $(shell docker-compose ps -q nodeSDK) + # Wait for the container to be running before attaching + @while [ -z "$$(docker-compose ps -q nodeSDK)" ]; do \ + sleep 1; \ + done + docker attach $$(docker-compose ps -q nodeSDK) test: @[ "${CONTAINER}" ] && \ diff --git a/lib/resources/verify.js b/lib/resources/verify.js index 4b2a1aab..0a8eebb6 100644 --- a/lib/resources/verify.js +++ b/lib/resources/verify.js @@ -140,7 +140,7 @@ export class SessionInterface extends PlivoResourceInterface { create(sessionReq){ var isObject = arguments.length; - var app_uuid, recipient, url, method, channel, locale , brand_name, app_hash , code_length, dtmf + var app_uuid, recipient, url, method, channel, locale , brand_name, app_hash , code_length, dtmf, fraud_check if (isObject === 1) { app_uuid = sessionReq.app_uuid @@ -153,6 +153,7 @@ export class SessionInterface extends PlivoResourceInterface { app_hash = sessionReq.app_hash code_length = sessionReq.code_length dtmf = sessionReq.dtmf + fraud_check = sessionReq.fraud_check } let errors = validate([{ @@ -195,9 +196,12 @@ export class SessionInterface extends PlivoResourceInterface { if (code_length) { params.code_length = code_length } - if (dtmf){ + if (dtmf) { params.dtmf = dtmf } + if (fraud_check) { + params.fraud_check = fraud_check + } } let client = this[clientKey]; diff --git a/package.json b/package.json index d1e065ec..0a17825c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.69.1", + "version": "4.69.2", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [ diff --git a/setup_sdk.sh b/setup_sdk.sh index a6a9fe16..f6a8e9d6 100755 --- a/setup_sdk.sh +++ b/setup_sdk.sh @@ -15,10 +15,10 @@ cd /usr/src/app echo "Setting plivo-api endpoint to dev..." find /usr/src/app/lib/rest -type f -exec sed -i "s/$PLIVO_API_PROD_HOST/$PLIVO_API_DEV_HOST/g" {} \; -echo "Packaging SDK..." -echo "npm install" && npm install +echo "Preparing SDK..." +rm -rf node_modules package-lock.json +echo "npm install" && npm install --no-package-lock echo "npm run prepublish" && npm run prepublish -echo "npm pack | tail -n 1" && package=$( npm pack | tail -n 1 ) if [ ! -d $testDir ]; then echo "Creating test dir..." @@ -32,12 +32,10 @@ if [ ! -f $testDir/test.js ]; then fi echo "Installing dependencies for testing..." -mv $package $testDir cd $testDir rm -rf package*.json node_modules npm init -y -npm install $package -rm $package +npm install /usr/src/app/ cd - echo -e "\n\nSDK setup complete! You can test changes either on host or inside the docker container:"