plivo 4.35.0 → 4.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +10 -0
- data/Dockerfile +12 -0
- data/Makefile +7 -0
- data/README.md +21 -1
- data/docker-compose.yml +18 -0
- data/lib/plivo/resources/messages.rb +9 -2
- data/lib/plivo/version.rb +1 -1
- data/setup_sdk.sh +45 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bce183c37b08afe3c1c818c760ea19e23d59aa0
|
4
|
+
data.tar.gz: 758f85c1a34e730fdb6319f504b325f563087613
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12826d9c8f1e56072dabf04120e67df56d6e1a7d5a0c6385c59ae8c419139d5c6d31c46543b1a17a6d21acdb84c31424de2d5be448dd88face0933e4d0b88452
|
7
|
+
data.tar.gz: 2e06406a3690697d405b1cb89dae6bebc5bc3bace1a3f463fa665ef36e62c43179838436abc56478614bfed1f9772ea3bb4c4f272389aa0cb35e6e7493a94d08
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,18 @@
|
|
1
1
|
# Change Log
|
2
|
+
## [4.37.0](https://github.com/plivo/plivo-ruby/tree/v4.37.0) (2023-02-23)
|
3
|
+
**Feature - Enhance MDR filtering capabilities **
|
4
|
+
- Added new fields on MDR object response
|
5
|
+
|
6
|
+
|
7
|
+
## [4.36.0](https://github.com/plivo/plivo-ruby/tree/v4.36.0) (2022-01-25)
|
8
|
+
**Adding new attribute - 'requester_ip' in Get Message and List Mssage APIs**
|
9
|
+
- Add `requester_ip` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message)
|
10
|
+
|
2
11
|
## [4.35.0](https://github.com/plivo/plivo-ruby/tree/v4.35.0) (2022-01-18)
|
3
12
|
**Adding new attribute - 'message_expiry' in Send Message API**
|
4
13
|
- Added new attribute - message_expiry in Send Message API
|
5
14
|
|
15
|
+
|
6
16
|
## [4.34.0](https://github.com/plivo/plivo-ruby/tree/v4.34.0) (2022-12-16)
|
7
17
|
**10DLC: Update Campaign API**
|
8
18
|
- Added Update Campaign API
|
data/Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
FROM ruby:3.0.1-alpine
|
2
|
+
|
3
|
+
RUN apk update && apk add git vim bash make gcc musl-dev
|
4
|
+
|
5
|
+
WORKDIR /usr/src/app
|
6
|
+
RUN gem install json --source 'https://rubygems.org/'
|
7
|
+
|
8
|
+
# Copy setup script
|
9
|
+
COPY setup_sdk.sh /usr/src/app/
|
10
|
+
RUN chmod a+x /usr/src/app/setup_sdk.sh
|
11
|
+
|
12
|
+
ENTRYPOINT [ "/usr/src/app/setup_sdk.sh" ]
|
data/Makefile
ADDED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'plivo', '>= 4.
|
12
|
+
gem 'plivo', '>= 4.37.0'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -173,3 +173,23 @@ More examples are available [here](https://github.com/plivo/plivo-examples-ruby)
|
|
173
173
|
|
174
174
|
## Reporting issues
|
175
175
|
Report any feedback or problems with this version by [opening an issue on Github](https://github.com/plivo/plivo-ruby/issues).
|
176
|
+
|
177
|
+
## Local Development
|
178
|
+
> Note: Requires latest versions of Docker & Docker-Compose. If you're on MacOS, ensure Docker Desktop is running.
|
179
|
+
1. Export the following environment variables in your host machine:
|
180
|
+
```bash
|
181
|
+
export PLIVO_AUTH_ID=<your_auth_id>
|
182
|
+
export PLIVO_AUTH_TOKEN=<your_auth_token>
|
183
|
+
export PLIVO_API_DEV_HOST=<plivoapi_dev_endpoint>
|
184
|
+
export PLIVO_API_PROD_HOST=<plivoapi_public_endpoint>
|
185
|
+
```
|
186
|
+
2. Run `make build`. This will create a docker container in which the sdk will be setup and dependencies will be installed.
|
187
|
+
> The entrypoint of the docker container will be the `setup_sdk.sh` script. The script will handle all the necessary changes required for local development.
|
188
|
+
3. The above command will print the docker container id (and instructions to connect to it) to stdout.
|
189
|
+
4. The testing code can be added to `<sdk_dir_path>/ruby-sdk-test/test.rb` in host
|
190
|
+
(or `/usr/src/app/ruby-sdk-test/test.rb` in container)
|
191
|
+
5. The sdk directory will be mounted as a volume in the container. So any changes in the sdk code will also be reflected inside the container.
|
192
|
+
> To use the local code in the test file, import the sdk in test file using:
|
193
|
+
`require "/usr/src/app/lib/plivo.rb"`
|
194
|
+
6. To run unit tests, run `make test CONTAINER=<cont_id>` in host, where `<cont_id>` is the docker container id created in 2.
|
195
|
+
(The docker container should be running)
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
version: '3'
|
2
|
+
|
3
|
+
services:
|
4
|
+
|
5
|
+
rubySDK:
|
6
|
+
build:
|
7
|
+
context: .
|
8
|
+
image: rubysdk
|
9
|
+
container_name: rubySDK
|
10
|
+
environment:
|
11
|
+
- PLIVO_AUTH_ID=${PLIVO_AUTH_ID}
|
12
|
+
- PLIVO_AUTH_TOKEN=${PLIVO_AUTH_TOKEN}
|
13
|
+
- PLIVO_API_DEV_HOST=${PLIVO_API_DEV_HOST}
|
14
|
+
- PLIVO_API_PROD_HOST=${PLIVO_API_PROD_HOST}
|
15
|
+
volumes:
|
16
|
+
- .:/usr/src/app
|
17
|
+
stdin_open: true
|
18
|
+
tty: true
|
@@ -30,7 +30,11 @@ module Plivo
|
|
30
30
|
total_amount: @total_amount,
|
31
31
|
total_rate: @total_rate,
|
32
32
|
powerpack_id: @powerpack_id,
|
33
|
-
units: @units
|
33
|
+
units: @units,
|
34
|
+
tendlc_campaign_id: @tendlc_campaign_id,
|
35
|
+
destination_country_iso2: @destination_country_iso2,
|
36
|
+
tendlc_registration_status: @tendlc_registration_status
|
37
|
+
requester_ip: @requester_ip
|
34
38
|
}.to_s
|
35
39
|
end
|
36
40
|
end
|
@@ -255,6 +259,9 @@ module Plivo
|
|
255
259
|
# @option options[List]: media_urls Minimum one media url should be present in Media urls list to send mms. Maximum allowd 10 media urls inside the list (e.g, media_urls : ['https//example.com/test.jpg', 'https://example.com/abcd.gif'])
|
256
260
|
# @option options[List]: media_ids Minimum one media ids should be present in Media ids list to send mms. Maximum allowd 10 media ids inside the list (e.g, media_ids : ['1fs211ba-355b-11ea-bbc9-02121c1190q7'])
|
257
261
|
# @option options [String] :powerpack_id Filter the results by powerpack id
|
262
|
+
# @option options [string]: tendlc_campaign_id - exact tendlc campaign id search
|
263
|
+
# @option options [string]:destination_country_iso2 - valid 2 character country_iso2
|
264
|
+
# @option options [string] : tendlc_registration_status - registered or unregistered enum allowed
|
258
265
|
def list(options = nil)
|
259
266
|
return perform_list if options.nil?
|
260
267
|
valid_param?(:options, options, Hash, true)
|
@@ -262,7 +269,7 @@ module Plivo
|
|
262
269
|
params = {}
|
263
270
|
params_expected = %i[
|
264
271
|
subaccount message_time message_time__gt message_time__gte
|
265
|
-
message_time__lt message_time__lte error_code powerpack_id
|
272
|
+
message_time__lt message_time__lte error_code powerpack_id tendlc_campaign_id tendlc_registration_status destination_country_iso2
|
266
273
|
]
|
267
274
|
params_expected.each do |param|
|
268
275
|
if options.key?(param) &&
|
data/lib/plivo/version.rb
CHANGED
data/setup_sdk.sh
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
testDir="ruby-sdk-test"
|
5
|
+
GREEN="\033[0;32m"
|
6
|
+
NC="\033[0m"
|
7
|
+
|
8
|
+
if [ ! $PLIVO_API_PROD_HOST ] || [ ! $PLIVO_API_DEV_HOST ] || [ ! $PLIVO_AUTH_ID ] || [ ! $PLIVO_AUTH_TOKEN ]; then
|
9
|
+
echo "Environment variables not properly set! Please refer to Local Development section in README!"
|
10
|
+
exit 126
|
11
|
+
fi
|
12
|
+
|
13
|
+
cd /usr/src/app
|
14
|
+
|
15
|
+
echo "Setting plivo-api endpoint to dev..."
|
16
|
+
find /usr/src/app/lib/ -type f -exec sed -i "s/$PLIVO_API_PROD_HOST/$PLIVO_API_DEV_HOST/g" {} \;
|
17
|
+
|
18
|
+
bundle install
|
19
|
+
|
20
|
+
if [ ! -d $testDir ]; then
|
21
|
+
echo "Creating test dir..."
|
22
|
+
mkdir -p $testDir
|
23
|
+
fi
|
24
|
+
|
25
|
+
if [ ! -f $testDir/test.rb ]; then
|
26
|
+
echo "Creating test file..."
|
27
|
+
cd $testDir
|
28
|
+
echo -e "require \"rubygems\"" > test.rb
|
29
|
+
echo -e "require \"/usr/src/app/lib/plivo.rb\"" >> test.rb
|
30
|
+
echo -e "include Plivo\n" >> test.rb
|
31
|
+
echo -e "api = RestClient.new(ENV[\"PLIVO_AUTH_ID\"], ENV[\"PLIVO_AUTH_TOKEN\"])" >> test.rb
|
32
|
+
cd -
|
33
|
+
fi
|
34
|
+
|
35
|
+
echo -e "\n\nSDK setup complete!"
|
36
|
+
echo "To test your changes:"
|
37
|
+
echo -e "\t1. Add your test code in <path_to_cloned_sdk>/$testDir/test.rb on host (or /usr/src/app/$testDir/test.rb in the container)"
|
38
|
+
echo -e "\t\tNote: To use sdk in test file, import using $GREEN require \"/usr/src/app/lib/plivo.rb\"$NC"
|
39
|
+
echo -e "\t2. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC"
|
40
|
+
echo -e "\t3. Navigate to the test directory: $GREEN cd /usr/src/app/$testDir$NC"
|
41
|
+
echo -e "\t4. Run your test file: $GREEN ruby test.rb$NC"
|
42
|
+
echo -e "\t5. For running unit tests, run on host: $GREEN make test CONTAINER=$HOSTNAME$NC"
|
43
|
+
|
44
|
+
# To keep the container running post setup
|
45
|
+
/bin/bash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Plivo SDKs Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -157,12 +157,15 @@ files:
|
|
157
157
|
- ".rspec"
|
158
158
|
- AUTHORS.md
|
159
159
|
- CHANGELOG.md
|
160
|
+
- Dockerfile
|
160
161
|
- Gemfile
|
161
162
|
- Jenkinsfile
|
162
163
|
- LICENSE.txt
|
164
|
+
- Makefile
|
163
165
|
- README.md
|
164
166
|
- Rakefile
|
165
167
|
- ci/config.yml
|
168
|
+
- docker-compose.yml
|
166
169
|
- examples/conference_bridge.rb
|
167
170
|
- examples/jwt.rb
|
168
171
|
- examples/lookup.rb
|
@@ -238,6 +241,7 @@ files:
|
|
238
241
|
- lib/plivo/xml/w.rb
|
239
242
|
- lib/plivo/xml/wait.rb
|
240
243
|
- plivo.gemspec
|
244
|
+
- setup_sdk.sh
|
241
245
|
homepage: https://github.com/plivo/plivo-ruby
|
242
246
|
licenses:
|
243
247
|
- MIT
|