Skip to content
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

SMS-7107: Add fraud_check param support #347

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
8 changes: 6 additions & 2 deletions lib/resources/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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([{
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
10 changes: 4 additions & 6 deletions setup_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand All @@ -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:"
Expand Down
Loading