telesign 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/telesign/constants.rb +1 -1
- data/lib/telesign/score.rb +20 -9
- data/lib/telesign.rb +0 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fd71cf30411fbac6eb0f77fc9a754115256a4f422799028616fae7aede6d8cc2
|
|
4
|
+
data.tar.gz: 9746cacd6c130ae1783235e709d8f53c15a2983a89b15f4b508dd73b35ec4e08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a8b14a63688997e1505e27567cb6f70eac8c2139d1ae1d78277ad0a90bf255640ad854b1b02eb747fb6bd6ca242ba626857fde94dfcad117053e6a650963cd1
|
|
7
|
+
data.tar.gz: 5041f1435071369f916e15338a12fd7bdb1854ba019ecfd991d6ba3d9e4211528972a6de14830e505a88efce251d991ca7fcf4632239e9fead0ec4f0889405a1
|
data/lib/telesign/constants.rb
CHANGED
data/lib/telesign/score.rb
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
require 'telesign/rest'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DETECT_HOST = 'https://detect.telesign.com'
|
|
4
|
+
INTELLIGENCE_RESOURCE = '/intelligence/phone'
|
|
4
5
|
|
|
5
6
|
module Telesign
|
|
6
7
|
|
|
7
|
-
#
|
|
8
|
+
# Obtain a risk recommendation for a phone number using TeleSign Intelligence Cloud API.
|
|
9
|
+
# Supports POST /intelligence/phone endpoint (Cloud migration).
|
|
10
|
+
# Sends phone number and parameters in request body as form-urlencoded.
|
|
11
|
+
# See https://developer.telesign.com/enterprise/reference/submitphonenumberforintelligencecloud for detailed API documentation.
|
|
8
12
|
class ScoreClient < RestClient
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
def initialize(customer_id, api_key, rest_endpoint: DETECT_HOST, **kwargs)
|
|
15
|
+
super(customer_id, api_key, rest_endpoint: rest_endpoint, **kwargs)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Required parameters:
|
|
19
|
+
# - phone_number
|
|
20
|
+
# - account_lifecycle_event ("create", "sign-in", "transact", "update", "delete")
|
|
21
|
+
# Optional parameters: account_id, device_id, email_address, external_id, originating_ip, etc.
|
|
14
22
|
def score(phone_number, account_lifecycle_event, **params)
|
|
23
|
+
raise ArgumentError, 'phone_number cannot be null or empty' if phone_number.nil? || phone_number.empty?
|
|
24
|
+
raise ArgumentError, 'account_lifecycle_event cannot be null or empty' if account_lifecycle_event.nil? || account_lifecycle_event.empty?
|
|
25
|
+
|
|
26
|
+
params[:phone_number] = phone_number
|
|
27
|
+
params[:account_lifecycle_event] = account_lifecycle_event
|
|
15
28
|
|
|
16
|
-
self.post(
|
|
17
|
-
account_lifecycle_event: account_lifecycle_event,
|
|
18
|
-
**params)
|
|
29
|
+
self.post(INTELLIGENCE_RESOURCE, **params)
|
|
19
30
|
end
|
|
20
31
|
end
|
|
21
32
|
end
|
data/lib/telesign.rb
CHANGED
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: telesign
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Telesign
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2017-05-25 00:00:00.000000000 Z
|
|
@@ -146,7 +146,7 @@ homepage: http://rubygems.org/gems/telesign
|
|
|
146
146
|
licenses:
|
|
147
147
|
- MIT
|
|
148
148
|
metadata: {}
|
|
149
|
-
post_install_message:
|
|
149
|
+
post_install_message:
|
|
150
150
|
rdoc_options: []
|
|
151
151
|
require_paths:
|
|
152
152
|
- lib
|
|
@@ -161,8 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
161
161
|
- !ruby/object:Gem::Version
|
|
162
162
|
version: '0'
|
|
163
163
|
requirements: []
|
|
164
|
-
rubygems_version: 3.
|
|
165
|
-
signing_key:
|
|
164
|
+
rubygems_version: 3.4.10
|
|
165
|
+
signing_key:
|
|
166
166
|
specification_version: 4
|
|
167
167
|
summary: Telesign Ruby SDK
|
|
168
168
|
test_files: []
|