telesign 2.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d45ef76f17a53eea559db29de43136a77ad3b1de673deb28cddccb2e8fd9179a
4
- data.tar.gz: 022c7286d6171f6f84f18512ccfc5eb62499e8e9dc346297a5f4a8db388e8216
3
+ metadata.gz: fd71cf30411fbac6eb0f77fc9a754115256a4f422799028616fae7aede6d8cc2
4
+ data.tar.gz: 9746cacd6c130ae1783235e709d8f53c15a2983a89b15f4b508dd73b35ec4e08
5
5
  SHA512:
6
- metadata.gz: d3c6836d6e9029a1a35ffd35cda96792bc0881fccd90d11903ab6e32183a3a83c575b6f9dc8cb28cca553643b777a3a56c8f177836bbf7230550f8958377d96c
7
- data.tar.gz: b1a3dd4a06c4af9d92d6b07bc080ca06c60c6c5d99ffa197d21e04851b30444013b670cb5a45e87c43130187529cbbff59d80c9f7cc6e9174036f99c4c16186e
6
+ metadata.gz: 6a8b14a63688997e1505e27567cb6f70eac8c2139d1ae1d78277ad0a90bf255640ad854b1b02eb747fb6bd6ca242ba626857fde94dfcad117053e6a650963cd1
7
+ data.tar.gz: 5041f1435071369f916e15338a12fd7bdb1854ba019ecfd991d6ba3d9e4211528972a6de14830e505a88efce251d991ca7fcf4632239e9fead0ec4f0889405a1
@@ -1,3 +1,3 @@
1
1
  module Telesign
2
- SDK_VERSION = '2.4.0'
2
+ SDK_VERSION = '4.0.0'
3
3
  end
@@ -1,21 +1,32 @@
1
1
  require 'telesign/rest'
2
2
 
3
- SCORE_RESOURCE = '/v1/score/%{phone_number}'
3
+ DETECT_HOST = 'https://detect.telesign.com'
4
+ INTELLIGENCE_RESOURCE = '/intelligence/phone'
4
5
 
5
6
  module Telesign
6
7
 
7
- # Score provides risk information about a specified phone number.
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
- # Score is an API that delivers reputation scoring based on phone number intelligence, traffic patterns, machine
11
- # learning, and a global data consortium.
12
- #
13
- # See https://developer.telesign.com/docs/score-api for detailed API documentation.
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(SCORE_RESOURCE % {:phone_number => phone_number},
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
@@ -1,4 +1,3 @@
1
- require 'telesign/appverify'
2
1
  require 'telesign/messaging'
3
2
  require 'telesign/phoneid'
4
3
  require 'telesign/rest'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telesign
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Telesign
@@ -135,7 +135,6 @@ extensions: []
135
135
  extra_rdoc_files: []
136
136
  files:
137
137
  - lib/telesign.rb
138
- - lib/telesign/appverify.rb
139
138
  - lib/telesign/constants.rb
140
139
  - lib/telesign/messaging.rb
141
140
  - lib/telesign/phoneid.rb
@@ -1,24 +0,0 @@
1
- require 'telesign/rest'
2
-
3
- APPVERIFY_STATUS_RESOURCE = '/v1/mobile/verification/status/%{external_id}'
4
-
5
- module Telesign
6
-
7
- # App Verify is a secure, lightweight SDK that integrates a frictionless user verification process into existing
8
- # native mobile applications.
9
- class AppVerifyClient < RestClient
10
-
11
- # Retrieves the verification result for an App Verify transaction by external_id. To ensure a secure verification
12
- # flow you must check the status using TeleSign's servers on your backend. Do not rely on the SDK alone to
13
- # indicate a successful verification.
14
- #
15
- # See https://developer.telesign.com/docs/app-verify-android-sdk-self#section-get-status-service or
16
- # https://developer.telesign.com/docs/app-verify-ios-sdk-self#section-get-status-service for detailed
17
- # API documentation.
18
- def status(external_id, **params)
19
-
20
- self.get(APPVERIFY_STATUS_RESOURCE % {:external_id => external_id},
21
- **params)
22
- end
23
- end
24
- end