telesign 3.0.0 → 4.0.1
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 +16 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc7b8143157d884928abd019f1f3863f69e7a2ff986b25eab7249349777b4126
|
|
4
|
+
data.tar.gz: 35abd521b325046a1e900f221057abaf1a569572dd86b6fa719468a2fa9203b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92f77aff036b7f3da712be4e430012725aef4ffd0b82e2de9b8b617750f1151cd156b0ac6f6e10bdc7cd5a5a185639cc7e368379a7f48e76d6cb9c3c9d641a52
|
|
7
|
+
data.tar.gz: 1194677d0e8c1fff6ed3b96d156095ab6fddfc7c23ee51f2b78ab95c896831d6fe8740c91a412d06d17e538150b026863a9320274a9dad147bd981cb25e50389
|
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,10 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: telesign
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Telesign
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
10
|
date: 2017-05-25 00:00:00.000000000 Z
|
|
@@ -30,6 +29,20 @@ dependencies:
|
|
|
30
29
|
- - "<"
|
|
31
30
|
- !ruby/object:Gem::Version
|
|
32
31
|
version: '5.0'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: base64
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
33
46
|
- !ruby/object:Gem::Dependency
|
|
34
47
|
name: rake
|
|
35
48
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -146,7 +159,6 @@ homepage: http://rubygems.org/gems/telesign
|
|
|
146
159
|
licenses:
|
|
147
160
|
- MIT
|
|
148
161
|
metadata: {}
|
|
149
|
-
post_install_message:
|
|
150
162
|
rdoc_options: []
|
|
151
163
|
require_paths:
|
|
152
164
|
- lib
|
|
@@ -161,8 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
161
173
|
- !ruby/object:Gem::Version
|
|
162
174
|
version: '0'
|
|
163
175
|
requirements: []
|
|
164
|
-
rubygems_version: 3.
|
|
165
|
-
signing_key:
|
|
176
|
+
rubygems_version: 3.6.2
|
|
166
177
|
specification_version: 4
|
|
167
178
|
summary: Telesign Ruby SDK
|
|
168
179
|
test_files: []
|