telvri_security 1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e6650b740eff6625789231b8409450339e67a929a57bef5c91dc588d9a6ab24b
4
+ data.tar.gz: a2f1cd60dd0cda77f071f4714fd4789e71b08600ccbacacfa9677c90ad1a5bed
5
+ SHA512:
6
+ metadata.gz: 8f07c1af6d82088f92aff09d261b7d254b9a17560f46eaacf176b5fc108d7bf61efc087fadd0d0e5440df6378871abd9f89423d568bad1bb11da08200a3f4e24
7
+ data.tar.gz: 0b94794033fa5bf0263589e85e83deb2b5601900b48dae509cb4b0d107404eefc978118152815a218d3f8e100a9573385852a4a87192a21744960aa27af6f8ba
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Telvri Security
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # telvri-ruby
2
+
3
+ Official Ruby SDK for the [Telvri Security API](https://telvrisecurity.vercel.app) — real-time SIM-swap and mobile identity risk checks for login recovery, payouts, and wallet protection.
4
+
5
+ ## Install
6
+
7
+ ### From GitHub (works now)
8
+
9
+ In your `Gemfile`:
10
+
11
+ ```ruby
12
+ gem 'telvri_security', git: 'https://github.com/Granville-Christopher/telvri-ruby', tag: 'v1.0.0'
13
+ ```
14
+
15
+ Then:
16
+
17
+ ```bash
18
+ bundle install
19
+ ```
20
+
21
+ Requires Ruby 2.7+.
22
+
23
+ ### RubyGems (after publish)
24
+
25
+ ```bash
26
+ gem install telvri_security
27
+ ```
28
+
29
+ Or in your `Gemfile`:
30
+
31
+ ```ruby
32
+ gem 'telvri_security', '~> 1.0.0'
33
+ ```
34
+
35
+ ## Quick start — SIM-swap check
36
+
37
+ ```ruby
38
+ require 'telvri_security'
39
+
40
+ TelvriSecurity.configure do |config|
41
+ config.api_key['X-API-Key'] = ENV.fetch('TELVRI_API_KEY')
42
+ end
43
+
44
+ api = TelvriSecurity::SIMSwapIntelligenceApi.new
45
+ dto = TelvriSecurity::CheckSimSwapDto.new(
46
+ phone_number: '+2348031234569',
47
+ max_age_hours: 24
48
+ )
49
+
50
+ result = api.sim_swap_controller_check_sim_swap(dto)
51
+
52
+ puts "swapped=#{result.swapped} provider=#{result.provider} operator=#{result.operator}"
53
+ ```
54
+
55
+ Set your key first:
56
+
57
+ ```bash
58
+ export TELVRI_API_KEY=rt_live_your_api_key
59
+ ```
60
+
61
+ ## API reference
62
+
63
+ All URIs are relative to `https://telvrisecurity.vercel.app`.
64
+
65
+ | Class | Method | HTTP request | Description |
66
+ |-------|--------|--------------|-------------|
67
+ | `SIMSwapIntelligenceApi` | `sim_swap_controller_check_sim_swap` | `POST /v1/security/sim-check` | Run a real-time SIM-swap risk check |
68
+ | `DeveloperAuthApi` | `auth_controller_login` | `POST /auth/login` | Authenticate a developer account |
69
+ | `DeveloperAuthApi` | `auth_controller_signup` | `POST /auth/signup` | Create a developer account |
70
+
71
+ ### Models
72
+
73
+ - `CheckSimSwapDto`
74
+ - `SimSwapResponseDto`
75
+ - `LoginDto`
76
+ - `SignupDto`
77
+
78
+ Full per-method and per-model docs are in the [`docs/`](./docs) folder.
79
+
80
+ ## Development
81
+
82
+ This SDK is generated from the Telvri Security OpenAPI contract using [OpenAPI Generator](https://openapi-generator.tech). To regenerate from the API project:
83
+
84
+ ```bash
85
+ npm run sdk:fetch-spec
86
+ npm run sdk:generate:ruby
87
+ ```
88
+
89
+ - API version: `1.0`
90
+ - Gem version: `1.0.0`
91
+ - Gem name: `telvri_security`
92
+ - Module: `TelvriSecurity`
93
+
94
+ ## License
95
+
96
+ MIT — see [LICENSE](./LICENSE).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
@@ -0,0 +1,20 @@
1
+ # TelvriSecurity::CheckSimSwapDto
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **phone_number** | **String** | Subscriber phone number in strict E.164 format. Supports global numbering plans (e.g. +1 US, +49 DE, +234 NG Airtel/MTN). | |
8
+ | **max_age_hours** | **Float** | Maximum acceptable age, in hours, for SIM-swap intelligence. | [optional][default to 24] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'telvri_security'
14
+
15
+ instance = TelvriSecurity::CheckSimSwapDto.new(
16
+ phone_number: +2348021234567,
17
+ max_age_hours: 24
18
+ )
19
+ ```
20
+
@@ -0,0 +1,206 @@
1
+ # TelvriSecurity::DeveloperAuthApi
2
+
3
+ All URIs are relative to *https://telvrisecurity.vercel.app*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**auth_controller_login**](DeveloperAuthApi.md#auth_controller_login) | **POST** /auth/login | Authenticate a developer account |
8
+ | [**auth_controller_logout**](DeveloperAuthApi.md#auth_controller_logout) | **POST** /auth/logout | Sign out of the developer dashboard |
9
+ | [**auth_controller_signup**](DeveloperAuthApi.md#auth_controller_signup) | **POST** /auth/signup | Create a developer account |
10
+
11
+
12
+ ## auth_controller_login
13
+
14
+ > auth_controller_login(email, password)
15
+
16
+ Authenticate a developer account
17
+
18
+ Accepts login credentials and redirects to the dashboard on success.
19
+
20
+ ### Examples
21
+
22
+ ```ruby
23
+ require 'time'
24
+ require 'telvri_security'
25
+
26
+ api_instance = TelvriSecurity::DeveloperAuthApi.new
27
+ email = 'email_example' # String | Developer account email address.
28
+ password = 'password_example' # String | Account password.
29
+
30
+ begin
31
+ # Authenticate a developer account
32
+ api_instance.auth_controller_login(email, password)
33
+ rescue TelvriSecurity::ApiError => e
34
+ puts "Error when calling DeveloperAuthApi->auth_controller_login: #{e}"
35
+ end
36
+ ```
37
+
38
+ #### Using the auth_controller_login_with_http_info variant
39
+
40
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
41
+
42
+ > <Array(nil, Integer, Hash)> auth_controller_login_with_http_info(email, password)
43
+
44
+ ```ruby
45
+ begin
46
+ # Authenticate a developer account
47
+ data, status_code, headers = api_instance.auth_controller_login_with_http_info(email, password)
48
+ p status_code # => 2xx
49
+ p headers # => { ... }
50
+ p data # => nil
51
+ rescue TelvriSecurity::ApiError => e
52
+ puts "Error when calling DeveloperAuthApi->auth_controller_login_with_http_info: #{e}"
53
+ end
54
+ ```
55
+
56
+ ### Parameters
57
+
58
+ | Name | Type | Description | Notes |
59
+ | ---- | ---- | ----------- | ----- |
60
+ | **email** | **String** | Developer account email address. | |
61
+ | **password** | **String** | Account password. | |
62
+
63
+ ### Return type
64
+
65
+ nil (empty response body)
66
+
67
+ ### Authorization
68
+
69
+ No authorization required
70
+
71
+ ### HTTP request headers
72
+
73
+ - **Content-Type**: application/x-www-form-urlencoded, application/json
74
+ - **Accept**: Not defined
75
+
76
+
77
+ ## auth_controller_logout
78
+
79
+ > auth_controller_logout
80
+
81
+ Sign out of the developer dashboard
82
+
83
+ ### Examples
84
+
85
+ ```ruby
86
+ require 'time'
87
+ require 'telvri_security'
88
+
89
+ api_instance = TelvriSecurity::DeveloperAuthApi.new
90
+
91
+ begin
92
+ # Sign out of the developer dashboard
93
+ api_instance.auth_controller_logout
94
+ rescue TelvriSecurity::ApiError => e
95
+ puts "Error when calling DeveloperAuthApi->auth_controller_logout: #{e}"
96
+ end
97
+ ```
98
+
99
+ #### Using the auth_controller_logout_with_http_info variant
100
+
101
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
102
+
103
+ > <Array(nil, Integer, Hash)> auth_controller_logout_with_http_info
104
+
105
+ ```ruby
106
+ begin
107
+ # Sign out of the developer dashboard
108
+ data, status_code, headers = api_instance.auth_controller_logout_with_http_info
109
+ p status_code # => 2xx
110
+ p headers # => { ... }
111
+ p data # => nil
112
+ rescue TelvriSecurity::ApiError => e
113
+ puts "Error when calling DeveloperAuthApi->auth_controller_logout_with_http_info: #{e}"
114
+ end
115
+ ```
116
+
117
+ ### Parameters
118
+
119
+ This endpoint does not need any parameter.
120
+
121
+ ### Return type
122
+
123
+ nil (empty response body)
124
+
125
+ ### Authorization
126
+
127
+ No authorization required
128
+
129
+ ### HTTP request headers
130
+
131
+ - **Content-Type**: Not defined
132
+ - **Accept**: Not defined
133
+
134
+
135
+ ## auth_controller_signup
136
+
137
+ > auth_controller_signup(full_name, email, password, confirm_password, opts)
138
+
139
+ Create a developer account
140
+
141
+ Registers a developer account and redirects to the dashboard on success.
142
+
143
+ ### Examples
144
+
145
+ ```ruby
146
+ require 'time'
147
+ require 'telvri_security'
148
+
149
+ api_instance = TelvriSecurity::DeveloperAuthApi.new
150
+ full_name = 'full_name_example' # String | Full name for the developer account.
151
+ email = 'email_example' # String | Work email used for dashboard access and API key delivery.
152
+ password = 'password_example' # String | Account password.
153
+ confirm_password = 'confirm_password_example' # String | Password confirmation.
154
+ opts = {
155
+ company: 'company_example' # String | Company or team name.
156
+ }
157
+
158
+ begin
159
+ # Create a developer account
160
+ api_instance.auth_controller_signup(full_name, email, password, confirm_password, opts)
161
+ rescue TelvriSecurity::ApiError => e
162
+ puts "Error when calling DeveloperAuthApi->auth_controller_signup: #{e}"
163
+ end
164
+ ```
165
+
166
+ #### Using the auth_controller_signup_with_http_info variant
167
+
168
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
169
+
170
+ > <Array(nil, Integer, Hash)> auth_controller_signup_with_http_info(full_name, email, password, confirm_password, opts)
171
+
172
+ ```ruby
173
+ begin
174
+ # Create a developer account
175
+ data, status_code, headers = api_instance.auth_controller_signup_with_http_info(full_name, email, password, confirm_password, opts)
176
+ p status_code # => 2xx
177
+ p headers # => { ... }
178
+ p data # => nil
179
+ rescue TelvriSecurity::ApiError => e
180
+ puts "Error when calling DeveloperAuthApi->auth_controller_signup_with_http_info: #{e}"
181
+ end
182
+ ```
183
+
184
+ ### Parameters
185
+
186
+ | Name | Type | Description | Notes |
187
+ | ---- | ---- | ----------- | ----- |
188
+ | **full_name** | **String** | Full name for the developer account. | |
189
+ | **email** | **String** | Work email used for dashboard access and API key delivery. | |
190
+ | **password** | **String** | Account password. | |
191
+ | **confirm_password** | **String** | Password confirmation. | |
192
+ | **company** | **String** | Company or team name. | [optional] |
193
+
194
+ ### Return type
195
+
196
+ nil (empty response body)
197
+
198
+ ### Authorization
199
+
200
+ No authorization required
201
+
202
+ ### HTTP request headers
203
+
204
+ - **Content-Type**: application/x-www-form-urlencoded, application/json
205
+ - **Accept**: Not defined
206
+
data/docs/LoginDto.md ADDED
@@ -0,0 +1,20 @@
1
+ # TelvriSecurity::LoginDto
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **email** | **String** | Developer account email address. | |
8
+ | **password** | **String** | Account password. | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'telvri_security'
14
+
15
+ instance = TelvriSecurity::LoginDto.new(
16
+ email: dev@telvri.security,
17
+ password: TelvriSecure123
18
+ )
19
+ ```
20
+
@@ -0,0 +1,86 @@
1
+ # TelvriSecurity::SIMSwapIntelligenceApi
2
+
3
+ All URIs are relative to *https://telvrisecurity.vercel.app*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**sim_swap_controller_check_sim_swap**](SIMSwapIntelligenceApi.md#sim_swap_controller_check_sim_swap) | **POST** /v1/security/sim-check | Run a real-time SIM-swap risk check |
8
+
9
+
10
+ ## sim_swap_controller_check_sim_swap
11
+
12
+ > <SimSwapResponseDto> sim_swap_controller_check_sim_swap(check_sim_swap_dto, opts)
13
+
14
+ Run a real-time SIM-swap risk check
15
+
16
+ Checks a subscriber phone number against mocked global telecom registry intelligence and returns whether recent SIM-swap activity is present. Carrier resolution uses national mobile prefixes worldwide (Nigeria MTN/Airtel/Glo/9mobile, Germany Telekom/Vodafone/O2, US AT&T/T-Mobile/Verizon, UK, India, UAE, and more). Mock rule: numbers ending in 9 report a swap within the last 2 hours.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'telvri_security'
23
+ # setup authorization
24
+ TelvriSecurity.configure do |config|
25
+ # Configure API key authorization: X-API-Key
26
+ config.api_key['X-API-Key'] = 'YOUR API KEY'
27
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
28
+ # config.api_key_prefix['X-API-Key'] = 'Bearer'
29
+
30
+ # Configure Bearer authorization (API Key): Bearer
31
+ config.access_token = 'YOUR_BEARER_TOKEN'
32
+ end
33
+
34
+ api_instance = TelvriSecurity::SIMSwapIntelligenceApi.new
35
+ check_sim_swap_dto = TelvriSecurity::CheckSimSwapDto.new({phone_number: '+2348021234567'}) # CheckSimSwapDto |
36
+ opts = {
37
+ x_api_key: 'x_api_key_example' # String | Developer API key. Alternative: Authorization: Bearer <KEY>.
38
+ }
39
+
40
+ begin
41
+ # Run a real-time SIM-swap risk check
42
+ result = api_instance.sim_swap_controller_check_sim_swap(check_sim_swap_dto, opts)
43
+ p result
44
+ rescue TelvriSecurity::ApiError => e
45
+ puts "Error when calling SIMSwapIntelligenceApi->sim_swap_controller_check_sim_swap: #{e}"
46
+ end
47
+ ```
48
+
49
+ #### Using the sim_swap_controller_check_sim_swap_with_http_info variant
50
+
51
+ This returns an Array which contains the response data, status code and headers.
52
+
53
+ > <Array(<SimSwapResponseDto>, Integer, Hash)> sim_swap_controller_check_sim_swap_with_http_info(check_sim_swap_dto, opts)
54
+
55
+ ```ruby
56
+ begin
57
+ # Run a real-time SIM-swap risk check
58
+ data, status_code, headers = api_instance.sim_swap_controller_check_sim_swap_with_http_info(check_sim_swap_dto, opts)
59
+ p status_code # => 2xx
60
+ p headers # => { ... }
61
+ p data # => <SimSwapResponseDto>
62
+ rescue TelvriSecurity::ApiError => e
63
+ puts "Error when calling SIMSwapIntelligenceApi->sim_swap_controller_check_sim_swap_with_http_info: #{e}"
64
+ end
65
+ ```
66
+
67
+ ### Parameters
68
+
69
+ | Name | Type | Description | Notes |
70
+ | ---- | ---- | ----------- | ----- |
71
+ | **check_sim_swap_dto** | [**CheckSimSwapDto**](CheckSimSwapDto.md) | | |
72
+ | **x_api_key** | **String** | Developer API key. Alternative: Authorization: Bearer &lt;KEY&gt;. | [optional] |
73
+
74
+ ### Return type
75
+
76
+ [**SimSwapResponseDto**](SimSwapResponseDto.md)
77
+
78
+ ### Authorization
79
+
80
+ [X-API-Key](../README.md#X-API-Key), [Bearer](../README.md#Bearer)
81
+
82
+ ### HTTP request headers
83
+
84
+ - **Content-Type**: application/json
85
+ - **Accept**: application/json
86
+
data/docs/SignupDto.md ADDED
@@ -0,0 +1,26 @@
1
+ # TelvriSecurity::SignupDto
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **full_name** | **String** | Full name for the developer account. | |
8
+ | **email** | **String** | Work email used for dashboard access and API key delivery. | |
9
+ | **company** | **String** | Company or team name. | [optional] |
10
+ | **password** | **String** | Account password. | |
11
+ | **confirm_password** | **String** | Password confirmation. | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'telvri_security'
17
+
18
+ instance = TelvriSecurity::SignupDto.new(
19
+ full_name: Ada Okonkwo,
20
+ email: ada@fintech.example,
21
+ company: Northwind Fintech,
22
+ password: TelvriSecure123,
23
+ confirm_password: TelvriSecure123
24
+ )
25
+ ```
26
+
@@ -0,0 +1,26 @@
1
+ # TelvriSecurity::SimSwapResponseDto
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **phone_number** | **String** | Subscriber phone number in E.164 format. | |
8
+ | **swapped** | **Boolean** | Whether the network registry indicates a recent SIM swap. | |
9
+ | **last_swapped_at** | **Time** | ISO-8601 timestamp of the most recent SIM-swap signal. | [optional] |
10
+ | **provider** | **String** | Resolved mobile network operator or telecom provider (global prefix catalog). | |
11
+ | **operator** | **String** | Resolved mobile network operator. Alias retained for telco domain consumers. | |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'telvri_security'
17
+
18
+ instance = TelvriSecurity::SimSwapResponseDto.new(
19
+ phone_number: +2348021234567,
20
+ swapped: false,
21
+ last_swapped_at: 2026-07-14T16:27Z,
22
+ provider: Airtel Nigeria,
23
+ operator: Airtel Nigeria
24
+ )
25
+ ```
26
+