prelude-sdk 0.2.0 → 0.3.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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/client.rb +7 -0
  5. data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +13 -11
  6. data/lib/prelude_sdk/internal/util.rb +39 -3
  7. data/lib/prelude_sdk/models/lookup_lookup_params.rb +9 -1
  8. data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +7 -1
  9. data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +7 -1
  10. data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +8 -1
  11. data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +8 -1
  12. data/lib/prelude_sdk/models/notify_send_batch_params.rb +32 -1
  13. data/lib/prelude_sdk/models/notify_send_batch_response.rb +39 -1
  14. data/lib/prelude_sdk/models/notify_send_params.rb +32 -1
  15. data/lib/prelude_sdk/models/notify_send_response.rb +36 -1
  16. data/lib/prelude_sdk/models/transactional_send_params.rb +32 -1
  17. data/lib/prelude_sdk/models/verification_create_params.rb +35 -48
  18. data/lib/prelude_sdk/models/verification_create_response.rb +15 -0
  19. data/lib/prelude_sdk/models/verification_management_delete_phone_number_params.rb +8 -1
  20. data/lib/prelude_sdk/models/verification_management_list_phone_numbers_params.rb +7 -1
  21. data/lib/prelude_sdk/models/verification_management_set_phone_number_params.rb +8 -1
  22. data/lib/prelude_sdk/models/watch_predict_params.rb +16 -12
  23. data/lib/prelude_sdk/models/watch_predict_response.rb +51 -1
  24. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +1 -128
  25. data/lib/prelude_sdk/resources/lookup.rb +4 -1
  26. data/lib/prelude_sdk/resources/notify.rb +13 -5
  27. data/lib/prelude_sdk/resources/transactional.rb +4 -1
  28. data/lib/prelude_sdk/resources/verification.rb +1 -0
  29. data/lib/prelude_sdk/resources/verification_management.rb +1 -0
  30. data/lib/prelude_sdk/resources/watch.rb +1 -0
  31. data/lib/prelude_sdk/version.rb +1 -1
  32. data/rbi/prelude_sdk/client.rbi +7 -0
  33. data/rbi/prelude_sdk/internal/util.rbi +21 -1
  34. data/rbi/prelude_sdk/models/lookup_lookup_params.rbi +8 -0
  35. data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +13 -5
  36. data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +10 -2
  37. data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +6 -0
  38. data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +6 -0
  39. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +50 -0
  40. data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +80 -0
  41. data/rbi/prelude_sdk/models/notify_send_params.rbi +48 -0
  42. data/rbi/prelude_sdk/models/notify_send_response.rbi +75 -0
  43. data/rbi/prelude_sdk/models/transactional_send_params.rbi +50 -0
  44. data/rbi/prelude_sdk/models/verification_create_params.rbi +53 -93
  45. data/rbi/prelude_sdk/models/verification_create_response.rbi +26 -0
  46. data/rbi/prelude_sdk/models/verification_management_delete_phone_number_params.rbi +16 -1
  47. data/rbi/prelude_sdk/models/verification_management_list_phone_numbers_params.rbi +21 -4
  48. data/rbi/prelude_sdk/models/verification_management_set_phone_number_params.rbi +16 -1
  49. data/rbi/prelude_sdk/models/watch_predict_params.rbi +24 -16
  50. data/rbi/prelude_sdk/models/watch_predict_response.rbi +152 -3
  51. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +3 -243
  52. data/rbi/prelude_sdk/resources/lookup.rbi +2 -0
  53. data/rbi/prelude_sdk/resources/notify.rbi +9 -0
  54. data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
  55. data/rbi/prelude_sdk/resources/verification.rbi +1 -0
  56. data/rbi/prelude_sdk/resources/verification_management.rbi +1 -0
  57. data/rbi/prelude_sdk/resources/watch.rbi +1 -0
  58. data/sig/prelude_sdk/internal/util.rbs +10 -0
  59. data/sig/prelude_sdk/models/lookup_lookup_params.rbs +8 -1
  60. data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +11 -3
  61. data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +6 -1
  62. data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +10 -1
  63. data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +5 -0
  64. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +21 -0
  65. data/sig/prelude_sdk/models/notify_send_batch_response.rbs +27 -0
  66. data/sig/prelude_sdk/models/notify_send_params.rbs +21 -0
  67. data/sig/prelude_sdk/models/notify_send_response.rbs +27 -0
  68. data/sig/prelude_sdk/models/transactional_send_params.rbs +21 -0
  69. data/sig/prelude_sdk/models/verification_create_params.rbs +2 -21
  70. data/sig/prelude_sdk/models/verification_create_response.rbs +2 -1
  71. data/sig/prelude_sdk/models/verification_management_delete_phone_number_params.rbs +9 -1
  72. data/sig/prelude_sdk/models/verification_management_list_phone_numbers_params.rbs +14 -3
  73. data/sig/prelude_sdk/models/verification_management_set_phone_number_params.rbs +9 -1
  74. data/sig/prelude_sdk/models/watch_predict_response.rbs +41 -3
  75. data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +3 -110
  76. data/sig/prelude_sdk/resources/notify.rbs +2 -0
  77. data/sig/prelude_sdk/resources/transactional.rbs +1 -0
  78. metadata +16 -2
@@ -111,8 +111,8 @@ module PreludeSDK
111
111
 
112
112
  class Options < PreludeSDK::Internal::Type::BaseModel
113
113
  # @!attribute app_realm
114
- # This allows you to automatically retrieve and fill the OTP code on mobile apps.
115
- # Currently only Android devices are supported.
114
+ # This allows automatic OTP retrieval on mobile apps and web browsers. Supported
115
+ # platforms are Android (SMS Retriever API) and Web (WebOTP API).
116
116
  #
117
117
  # @return [PreludeSDK::Models::VerificationCreateParams::Options::AppRealm, nil]
118
118
  optional :app_realm, -> { PreludeSDK::VerificationCreateParams::Options::AppRealm }
@@ -140,12 +140,6 @@ module PreludeSDK
140
140
  # @return [String, nil]
141
141
  optional :custom_code, String
142
142
 
143
- # @!attribute integration
144
- # The integration that triggered the verification.
145
- #
146
- # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Integration, nil]
147
- optional :integration, enum: -> { PreludeSDK::VerificationCreateParams::Options::Integration }
148
-
149
143
  # @!attribute locale
150
144
  # A BCP-47 formatted locale string with the language the text message will be sent
151
145
  # to. If there's no locale set, the language will be determined by the country
@@ -195,13 +189,13 @@ module PreludeSDK
195
189
  # @return [Hash{Symbol=>String}, nil]
196
190
  optional :variables, PreludeSDK::Internal::Type::HashOf[String]
197
191
 
198
- # @!method initialize(app_realm: nil, callback_url: nil, code_size: nil, custom_code: nil, integration: nil, locale: nil, verification_method: nil, preferred_channel: nil, sender_id: nil, template_id: nil, variables: nil)
192
+ # @!method initialize(app_realm: nil, callback_url: nil, code_size: nil, custom_code: nil, locale: nil, verification_method: nil, preferred_channel: nil, sender_id: nil, template_id: nil, variables: nil)
199
193
  # Some parameter documentations has been truncated, see
200
194
  # {PreludeSDK::Models::VerificationCreateParams::Options} for more details.
201
195
  #
202
196
  # Verification options
203
197
  #
204
- # @param app_realm [PreludeSDK::Models::VerificationCreateParams::Options::AppRealm] This allows you to automatically retrieve and fill the OTP code on mobile apps.
198
+ # @param app_realm [PreludeSDK::Models::VerificationCreateParams::Options::AppRealm] This allows automatic OTP retrieval on mobile apps and web browsers. Supported p
205
199
  #
206
200
  # @param callback_url [String] The URL where webhooks will be sent when verification events occur, including ve
207
201
  #
@@ -209,8 +203,6 @@ module PreludeSDK
209
203
  #
210
204
  # @param custom_code [String] The custom code to use for OTP verification. To use the custom code feature, con
211
205
  #
212
- # @param integration [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Integration] The integration that triggered the verification.
213
- #
214
206
  # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
215
207
  #
216
208
  # @param verification_method [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::Method] The method used for verifying this phone number. The 'voice' option provides an
@@ -226,16 +218,19 @@ module PreludeSDK
226
218
  # @see PreludeSDK::Models::VerificationCreateParams::Options#app_realm
227
219
  class AppRealm < PreludeSDK::Internal::Type::BaseModel
228
220
  # @!attribute platform
229
- # The platform the SMS will be sent to. We are currently only supporting
230
- # "android".
221
+ # The platform for automatic OTP retrieval. Use "android" for the SMS Retriever
222
+ # API or "web" for the WebOTP API.
231
223
  #
232
224
  # @return [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::AppRealm::Platform]
233
225
  required :platform, enum: -> { PreludeSDK::VerificationCreateParams::Options::AppRealm::Platform }
234
226
 
235
227
  # @!attribute value
236
- # The Android SMS Retriever API hash code that identifies your app. For more
237
- # information, see
238
- # [Google documentation](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string).
228
+ # The value depends on the platform:
229
+ #
230
+ # - For Android: The SMS Retriever API hash code (11 characters). See
231
+ # [Google documentation](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string).
232
+ # - For Web: The origin domain (e.g., "example.com" or "www.example.com"). See
233
+ # [WebOTP API documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebOTP_API).
239
234
  #
240
235
  # @return [String]
241
236
  required :value, String
@@ -245,40 +240,28 @@ module PreludeSDK
245
240
  # {PreludeSDK::Models::VerificationCreateParams::Options::AppRealm} for more
246
241
  # details.
247
242
  #
248
- # This allows you to automatically retrieve and fill the OTP code on mobile apps.
249
- # Currently only Android devices are supported.
243
+ # This allows automatic OTP retrieval on mobile apps and web browsers. Supported
244
+ # platforms are Android (SMS Retriever API) and Web (WebOTP API).
250
245
  #
251
- # @param platform [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::AppRealm::Platform] The platform the SMS will be sent to. We are currently only supporting "android"
246
+ # @param platform [Symbol, PreludeSDK::Models::VerificationCreateParams::Options::AppRealm::Platform] The platform for automatic OTP retrieval. Use "android" for the SMS Retriever AP
252
247
  #
253
- # @param value [String] The Android SMS Retriever API hash code that identifies your app.
248
+ # @param value [String] The value depends on the platform:
254
249
 
255
- # The platform the SMS will be sent to. We are currently only supporting
256
- # "android".
250
+ # The platform for automatic OTP retrieval. Use "android" for the SMS Retriever
251
+ # API or "web" for the WebOTP API.
257
252
  #
258
253
  # @see PreludeSDK::Models::VerificationCreateParams::Options::AppRealm#platform
259
254
  module Platform
260
255
  extend PreludeSDK::Internal::Type::Enum
261
256
 
262
257
  ANDROID = :android
258
+ WEB = :web
263
259
 
264
260
  # @!method self.values
265
261
  # @return [Array<Symbol>]
266
262
  end
267
263
  end
268
264
 
269
- # The integration that triggered the verification.
270
- #
271
- # @see PreludeSDK::Models::VerificationCreateParams::Options#integration
272
- module Integration
273
- extend PreludeSDK::Internal::Type::Enum
274
-
275
- AUTH0 = :auth0
276
- SUPABASE = :supabase
277
-
278
- # @!method self.values
279
- # @return [Array<Symbol>]
280
- end
281
-
282
265
  # The method used for verifying this phone number. The 'voice' option provides an
283
266
  # accessible alternative for visually impaired users by delivering the
284
267
  # verification code through a phone call rather than a text message. It also
@@ -325,8 +308,9 @@ module PreludeSDK
325
308
  optional :app_version, String
326
309
 
327
310
  # @!attribute device_id
328
- # The unique identifier for the user's device. For Android, this corresponds to
329
- # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
311
+ # A unique ID for the user's device. You should ensure that each user device has a
312
+ # unique `device_id` value. Ideally, for Android, this corresponds to the
313
+ # `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
330
314
  #
331
315
  # @return [String, nil]
332
316
  optional :device_id, String
@@ -344,23 +328,26 @@ module PreludeSDK
344
328
  optional :device_platform, enum: -> { PreludeSDK::VerificationCreateParams::Signals::DevicePlatform }
345
329
 
346
330
  # @!attribute ip
347
- # The IP address of the user's device.
331
+ # The public IP v4 or v6 address of the end-user's device. You should collect this
332
+ # from your backend. If your backend is behind a proxy, use the `X-Forwarded-For`,
333
+ # `Forwarded`, `True-Client-IP`, `CF-Connecting-IP` or an equivalent header to get
334
+ # the actual public IP of the end-user's device.
348
335
  #
349
336
  # @return [String, nil]
350
337
  optional :ip, String
351
338
 
352
339
  # @!attribute is_trusted_user
353
- # This signal should provide a higher level of trust, indicating that the user is
354
- # genuine. Contact us to discuss your use case. For more details, refer to
340
+ # This signal should indicate a higher level of trust, explicitly stating that the
341
+ # user is genuine. Contact us to discuss your use case. For more details, refer to
355
342
  # [Signals](/verify/v2/documentation/prevent-fraud#signals).
356
343
  #
357
344
  # @return [Boolean, nil]
358
345
  optional :is_trusted_user, PreludeSDK::Internal::Type::Boolean
359
346
 
360
347
  # @!attribute ja4_fingerprint
361
- # The JA4 fingerprint observed for the connection. Prelude will infer it
362
- # automatically when requests go through our client SDK (which uses Prelude's
363
- # edge), but you can also provide it explicitly if you terminate TLS yourself.
348
+ # The JA4 fingerprint observed for the end-user's connection. Prelude will infer
349
+ # it automatically when you use our Frontend SDKs (which use Prelude's edge
350
+ # network), but you can also forward the value if you terminate TLS yourself.
364
351
  #
365
352
  # @return [String, nil]
366
353
  optional :ja4_fingerprint, String
@@ -388,17 +375,17 @@ module PreludeSDK
388
375
  #
389
376
  # @param app_version [String] The version of your application.
390
377
  #
391
- # @param device_id [String] The unique identifier for the user's device. For Android, this corresponds to th
378
+ # @param device_id [String] A unique ID for the user's device. You should ensure that each user device has a
392
379
  #
393
380
  # @param device_model [String] The model of the user's device.
394
381
  #
395
382
  # @param device_platform [Symbol, PreludeSDK::Models::VerificationCreateParams::Signals::DevicePlatform] The type of the user's device.
396
383
  #
397
- # @param ip [String] The IP address of the user's device.
384
+ # @param ip [String] The public IP v4 or v6 address of the end-user's device. You should collect this
398
385
  #
399
- # @param is_trusted_user [Boolean] This signal should provide a higher level of trust, indicating that the user is
386
+ # @param is_trusted_user [Boolean] This signal should indicate a higher level of trust, explicitly stating that the
400
387
  #
401
- # @param ja4_fingerprint [String] The JA4 fingerprint observed for the connection. Prelude will infer it automatic
388
+ # @param ja4_fingerprint [String] The JA4 fingerprint observed for the end-user's connection. Prelude will infer i
402
389
  #
403
390
  # @param os_version [String] The version of the user's device operating system.
404
391
  #
@@ -21,6 +21,13 @@ module PreludeSDK
21
21
  # @!attribute status
22
22
  # The status of the verification.
23
23
  #
24
+ # - `success` - A new verification window was created.
25
+ # - `retry` - A new attempt was created for an existing verification window.
26
+ # - `challenged` - The verification is suspicious and is restricted to non-SMS and
27
+ # non-voice channels only. This mode must be enabled for your customer account
28
+ # by Prelude support.
29
+ # - `blocked` - The verification was blocked.
30
+ #
24
31
  # @return [Symbol, PreludeSDK::Models::VerificationCreateResponse::Status]
25
32
  required :status, enum: -> { PreludeSDK::Models::VerificationCreateResponse::Status }
26
33
 
@@ -105,12 +112,20 @@ module PreludeSDK
105
112
 
106
113
  # The status of the verification.
107
114
  #
115
+ # - `success` - A new verification window was created.
116
+ # - `retry` - A new attempt was created for an existing verification window.
117
+ # - `challenged` - The verification is suspicious and is restricted to non-SMS and
118
+ # non-voice channels only. This mode must be enabled for your customer account
119
+ # by Prelude support.
120
+ # - `blocked` - The verification was blocked.
121
+ #
108
122
  # @see PreludeSDK::Models::VerificationCreateResponse#status
109
123
  module Status
110
124
  extend PreludeSDK::Internal::Type::Enum
111
125
 
112
126
  SUCCESS = :success
113
127
  RETRY = :retry
128
+ CHALLENGED = :challenged
114
129
  BLOCKED = :blocked
115
130
 
116
131
  # @!method self.values
@@ -7,13 +7,20 @@ module PreludeSDK
7
7
  extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
8
  include PreludeSDK::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute action
11
+ #
12
+ # @return [Symbol, PreludeSDK::Models::VerificationManagementDeletePhoneNumberParams::Action]
13
+ required :action, enum: -> { PreludeSDK::VerificationManagementDeletePhoneNumberParams::Action }
14
+
10
15
  # @!attribute phone_number
11
16
  # An E.164 formatted phone number to remove from the list.
12
17
  #
13
18
  # @return [String]
14
19
  required :phone_number, String
15
20
 
16
- # @!method initialize(phone_number:, request_options: {})
21
+ # @!method initialize(action:, phone_number:, request_options: {})
22
+ # @param action [Symbol, PreludeSDK::Models::VerificationManagementDeletePhoneNumberParams::Action]
23
+ #
17
24
  # @param phone_number [String] An E.164 formatted phone number to remove from the list.
18
25
  #
19
26
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
@@ -7,7 +7,13 @@ module PreludeSDK
7
7
  extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
8
  include PreludeSDK::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute action
11
+ #
12
+ # @return [Symbol, PreludeSDK::Models::VerificationManagementListPhoneNumbersParams::Action]
13
+ required :action, enum: -> { PreludeSDK::VerificationManagementListPhoneNumbersParams::Action }
14
+
15
+ # @!method initialize(action:, request_options: {})
16
+ # @param action [Symbol, PreludeSDK::Models::VerificationManagementListPhoneNumbersParams::Action]
11
17
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
12
18
 
13
19
  module Action
@@ -7,13 +7,20 @@ module PreludeSDK
7
7
  extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
8
  include PreludeSDK::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute action
11
+ #
12
+ # @return [Symbol, PreludeSDK::Models::VerificationManagementSetPhoneNumberParams::Action]
13
+ required :action, enum: -> { PreludeSDK::VerificationManagementSetPhoneNumberParams::Action }
14
+
10
15
  # @!attribute phone_number
11
16
  # An E.164 formatted phone number to add to the list.
12
17
  #
13
18
  # @return [String]
14
19
  required :phone_number, String
15
20
 
16
- # @!method initialize(phone_number:, request_options: {})
21
+ # @!method initialize(action:, phone_number:, request_options: {})
22
+ # @param action [Symbol, PreludeSDK::Models::VerificationManagementSetPhoneNumberParams::Action]
23
+ #
17
24
  # @param phone_number [String] An E.164 formatted phone number to add to the list.
18
25
  #
19
26
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
@@ -105,8 +105,9 @@ module PreludeSDK
105
105
  optional :app_version, String
106
106
 
107
107
  # @!attribute device_id
108
- # The unique identifier for the user's device. For Android, this corresponds to
109
- # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
108
+ # A unique ID for the user's device. You should ensure that each user device has a
109
+ # unique `device_id` value. Ideally, for Android, this corresponds to the
110
+ # `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
110
111
  #
111
112
  # @return [String, nil]
112
113
  optional :device_id, String
@@ -124,23 +125,26 @@ module PreludeSDK
124
125
  optional :device_platform, enum: -> { PreludeSDK::WatchPredictParams::Signals::DevicePlatform }
125
126
 
126
127
  # @!attribute ip
127
- # The IP address of the user's device.
128
+ # The public IP v4 or v6 address of the end-user's device. You should collect this
129
+ # from your backend. If your backend is behind a proxy, use the `X-Forwarded-For`,
130
+ # `Forwarded`, `True-Client-IP`, `CF-Connecting-IP` or an equivalent header to get
131
+ # the actual public IP of the end-user's device.
128
132
  #
129
133
  # @return [String, nil]
130
134
  optional :ip, String
131
135
 
132
136
  # @!attribute is_trusted_user
133
- # This signal should provide a higher level of trust, indicating that the user is
134
- # genuine. Contact us to discuss your use case. For more details, refer to
137
+ # This signal should indicate a higher level of trust, explicitly stating that the
138
+ # user is genuine. Contact us to discuss your use case. For more details, refer to
135
139
  # [Signals](/verify/v2/documentation/prevent-fraud#signals).
136
140
  #
137
141
  # @return [Boolean, nil]
138
142
  optional :is_trusted_user, PreludeSDK::Internal::Type::Boolean
139
143
 
140
144
  # @!attribute ja4_fingerprint
141
- # The JA4 fingerprint observed for the connection. Prelude will infer it
142
- # automatically when requests go through our client SDK (which uses Prelude's
143
- # edge), but you can also provide it explicitly if you terminate TLS yourself.
145
+ # The JA4 fingerprint observed for the end-user's connection. Prelude will infer
146
+ # it automatically when you use our Frontend SDKs (which use Prelude's edge
147
+ # network), but you can also forward the value if you terminate TLS yourself.
144
148
  #
145
149
  # @return [String, nil]
146
150
  optional :ja4_fingerprint, String
@@ -168,17 +172,17 @@ module PreludeSDK
168
172
  #
169
173
  # @param app_version [String] The version of your application.
170
174
  #
171
- # @param device_id [String] The unique identifier for the user's device. For Android, this corresponds to th
175
+ # @param device_id [String] A unique ID for the user's device. You should ensure that each user device has a
172
176
  #
173
177
  # @param device_model [String] The model of the user's device.
174
178
  #
175
179
  # @param device_platform [Symbol, PreludeSDK::Models::WatchPredictParams::Signals::DevicePlatform] The type of the user's device.
176
180
  #
177
- # @param ip [String] The IP address of the user's device.
181
+ # @param ip [String] The public IP v4 or v6 address of the end-user's device. You should collect this
178
182
  #
179
- # @param is_trusted_user [Boolean] This signal should provide a higher level of trust, indicating that the user is
183
+ # @param is_trusted_user [Boolean] This signal should indicate a higher level of trust, explicitly stating that the
180
184
  #
181
- # @param ja4_fingerprint [String] The JA4 fingerprint observed for the connection. Prelude will infer it automatic
185
+ # @param ja4_fingerprint [String] The JA4 fingerprint observed for the end-user's connection. Prelude will infer i
182
186
  #
183
187
  # @param os_version [String] The version of the user's device operating system.
184
188
  #
@@ -23,7 +23,37 @@ module PreludeSDK
23
23
  # @return [String]
24
24
  required :request_id, String
25
25
 
26
- # @!method initialize(id:, prediction:, request_id:)
26
+ # @!attribute risk_factors
27
+ # The risk factors that contributed to the suspicious prediction. Only present
28
+ # when prediction is "suspicious" and the anti-fraud system detected specific risk
29
+ # signals.
30
+ #
31
+ # - `behavioral_pattern` - The phone number past behavior during verification
32
+ # flows exhibits suspicious patterns.
33
+ # - `device_attribute` - The device exhibits characteristics associated with
34
+ # suspicious activity patterns.
35
+ # - `fraud_database` - The phone number has been flagged as suspicious in one or
36
+ # more of our fraud databases.
37
+ # - `location_discrepancy` - The phone number prefix and IP address discrepancy
38
+ # indicates potential fraud.
39
+ # - `network_fingerprint` - The network connection exhibits characteristics
40
+ # associated with suspicious activity patterns.
41
+ # - `poor_conversion_history` - The phone number has a history of poorly
42
+ # converting to a verified phone number.
43
+ # - `prefix_concentration` - The phone number is part of a range known to be
44
+ # associated with suspicious activity patterns.
45
+ # - `suspected_request_tampering` - The SDK signature is invalid and the request
46
+ # is considered to be tampered with.
47
+ # - `suspicious_ip_address` - The IP address is deemed to be associated with
48
+ # suspicious activity patterns.
49
+ # - `temporary_phone_number` - The phone number is known to be a temporary or
50
+ # disposable number.
51
+ #
52
+ # @return [Array<Symbol, PreludeSDK::Models::WatchPredictResponse::RiskFactor>, nil]
53
+ optional :risk_factors,
54
+ -> { PreludeSDK::Internal::Type::ArrayOf[enum: PreludeSDK::Models::WatchPredictResponse::RiskFactor] }
55
+
56
+ # @!method initialize(id:, prediction:, request_id:, risk_factors: nil)
27
57
  # Some parameter documentations has been truncated, see
28
58
  # {PreludeSDK::Models::WatchPredictResponse} for more details.
29
59
  #
@@ -32,6 +62,8 @@ module PreludeSDK
32
62
  # @param prediction [Symbol, PreludeSDK::Models::WatchPredictResponse::Prediction] The prediction outcome.
33
63
  #
34
64
  # @param request_id [String] A string that identifies this specific request. Report it back to us to help us
65
+ #
66
+ # @param risk_factors [Array<Symbol, PreludeSDK::Models::WatchPredictResponse::RiskFactor>] The risk factors that contributed to the suspicious prediction. Only present whe
35
67
 
36
68
  # The prediction outcome.
37
69
  #
@@ -45,6 +77,24 @@ module PreludeSDK
45
77
  # @!method self.values
46
78
  # @return [Array<Symbol>]
47
79
  end
80
+
81
+ module RiskFactor
82
+ extend PreludeSDK::Internal::Type::Enum
83
+
84
+ BEHAVIORAL_PATTERN = :behavioral_pattern
85
+ DEVICE_ATTRIBUTE = :device_attribute
86
+ FRAUD_DATABASE = :fraud_database
87
+ LOCATION_DISCREPANCY = :location_discrepancy
88
+ NETWORK_FINGERPRINT = :network_fingerprint
89
+ POOR_CONVERSION_HISTORY = :poor_conversion_history
90
+ PREFIX_CONCENTRATION = :prefix_concentration
91
+ SUSPECTED_REQUEST_TAMPERING = :suspected_request_tampering
92
+ SUSPICIOUS_IP_ADDRESS = :suspicious_ip_address
93
+ TEMPORARY_PHONE_NUMBER = :temporary_phone_number
94
+
95
+ # @!method self.values
96
+ # @return [Array<Symbol>]
97
+ end
48
98
  end
49
99
  end
50
100
  end
@@ -32,38 +32,18 @@ module PreludeSDK
32
32
  # @return [Symbol, PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Type]
33
33
  required :type, enum: -> { PreludeSDK::WatchSendFeedbacksParams::Feedback::Type }
34
34
 
35
- # @!attribute dispatch_id
36
- # The identifier of the dispatch that came from the front-end SDK.
37
- #
38
- # @return [String, nil]
39
- optional :dispatch_id, String
40
-
41
35
  # @!attribute metadata
42
36
  # The metadata for this feedback.
43
37
  #
44
38
  # @return [PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Metadata, nil]
45
39
  optional :metadata, -> { PreludeSDK::WatchSendFeedbacksParams::Feedback::Metadata }
46
40
 
47
- # @!attribute signals
48
- # The signals used for anti-fraud. For more details, refer to
49
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
50
- #
51
- # @return [PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Signals, nil]
52
- optional :signals, -> { PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals }
53
-
54
- # @!method initialize(target:, type:, dispatch_id: nil, metadata: nil, signals: nil)
55
- # Some parameter documentations has been truncated, see
56
- # {PreludeSDK::Models::WatchSendFeedbacksParams::Feedback} for more details.
57
- #
41
+ # @!method initialize(target:, type:, metadata: nil)
58
42
  # @param target [PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Target] The feedback target. Only supports phone numbers for now.
59
43
  #
60
44
  # @param type [Symbol, PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Type] The type of feedback.
61
45
  #
62
- # @param dispatch_id [String] The identifier of the dispatch that came from the front-end SDK.
63
- #
64
46
  # @param metadata [PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Metadata] The metadata for this feedback.
65
- #
66
- # @param signals [PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Signals] The signals used for anti-fraud. For more details, refer to [Signals](/verify/v2
67
47
 
68
48
  # @see PreludeSDK::Models::WatchSendFeedbacksParams::Feedback#target
69
49
  class Target < PreludeSDK::Internal::Type::BaseModel
@@ -131,113 +111,6 @@ module PreludeSDK
131
111
  #
132
112
  # @param correlation_id [String] A user-defined identifier to correlate this feedback with. It is returned in the
133
113
  end
134
-
135
- # @see PreludeSDK::Models::WatchSendFeedbacksParams::Feedback#signals
136
- class Signals < PreludeSDK::Internal::Type::BaseModel
137
- # @!attribute app_version
138
- # The version of your application.
139
- #
140
- # @return [String, nil]
141
- optional :app_version, String
142
-
143
- # @!attribute device_id
144
- # The unique identifier for the user's device. For Android, this corresponds to
145
- # the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
146
- #
147
- # @return [String, nil]
148
- optional :device_id, String
149
-
150
- # @!attribute device_model
151
- # The model of the user's device.
152
- #
153
- # @return [String, nil]
154
- optional :device_model, String
155
-
156
- # @!attribute device_platform
157
- # The type of the user's device.
158
- #
159
- # @return [Symbol, PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform, nil]
160
- optional :device_platform,
161
- enum: -> { PreludeSDK::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform }
162
-
163
- # @!attribute ip
164
- # The IP address of the user's device.
165
- #
166
- # @return [String, nil]
167
- optional :ip, String
168
-
169
- # @!attribute is_trusted_user
170
- # This signal should provide a higher level of trust, indicating that the user is
171
- # genuine. Contact us to discuss your use case. For more details, refer to
172
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
173
- #
174
- # @return [Boolean, nil]
175
- optional :is_trusted_user, PreludeSDK::Internal::Type::Boolean
176
-
177
- # @!attribute ja4_fingerprint
178
- # The JA4 fingerprint observed for the connection. Prelude will infer it
179
- # automatically when requests go through our client SDK (which uses Prelude's
180
- # edge), but you can also provide it explicitly if you terminate TLS yourself.
181
- #
182
- # @return [String, nil]
183
- optional :ja4_fingerprint, String
184
-
185
- # @!attribute os_version
186
- # The version of the user's device operating system.
187
- #
188
- # @return [String, nil]
189
- optional :os_version, String
190
-
191
- # @!attribute user_agent
192
- # The user agent of the user's device. If the individual fields (os_version,
193
- # device_platform, device_model) are provided, we will prioritize those values
194
- # instead of parsing them from the user agent string.
195
- #
196
- # @return [String, nil]
197
- optional :user_agent, String
198
-
199
- # @!method initialize(app_version: nil, device_id: nil, device_model: nil, device_platform: nil, ip: nil, is_trusted_user: nil, ja4_fingerprint: nil, os_version: nil, user_agent: nil)
200
- # Some parameter documentations has been truncated, see
201
- # {PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Signals} for more
202
- # details.
203
- #
204
- # The signals used for anti-fraud. For more details, refer to
205
- # [Signals](/verify/v2/documentation/prevent-fraud#signals).
206
- #
207
- # @param app_version [String] The version of your application.
208
- #
209
- # @param device_id [String] The unique identifier for the user's device. For Android, this corresponds to th
210
- #
211
- # @param device_model [String] The model of the user's device.
212
- #
213
- # @param device_platform [Symbol, PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Signals::DevicePlatform] The type of the user's device.
214
- #
215
- # @param ip [String] The IP address of the user's device.
216
- #
217
- # @param is_trusted_user [Boolean] This signal should provide a higher level of trust, indicating that the user is
218
- #
219
- # @param ja4_fingerprint [String] The JA4 fingerprint observed for the connection. Prelude will infer it automatic
220
- #
221
- # @param os_version [String] The version of the user's device operating system.
222
- #
223
- # @param user_agent [String] The user agent of the user's device. If the individual fields (os_version, devic
224
-
225
- # The type of the user's device.
226
- #
227
- # @see PreludeSDK::Models::WatchSendFeedbacksParams::Feedback::Signals#device_platform
228
- module DevicePlatform
229
- extend PreludeSDK::Internal::Type::Enum
230
-
231
- ANDROID = :android
232
- IOS = :ios
233
- IPADOS = :ipados
234
- TVOS = :tvos
235
- WEB = :web
236
-
237
- # @!method self.values
238
- # @return [Array<Symbol>]
239
- end
240
- end
241
114
  end
242
115
  end
243
116
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module PreludeSDK
4
4
  module Resources
5
+ # Retrieve detailed information about a phone number including carrier data, line
6
+ # type, and portability status.
5
7
  class Lookup
6
8
  # Some parameter documentations has been truncated, see
7
9
  # {PreludeSDK::Models::LookupLookupParams} for more details.
@@ -22,10 +24,11 @@ module PreludeSDK
22
24
  # @see PreludeSDK::Models::LookupLookupParams
23
25
  def lookup(phone_number, params = {})
24
26
  parsed, options = PreludeSDK::LookupLookupParams.dump_request(params)
27
+ query = PreludeSDK::Internal::Util.encode_query_params(parsed)
25
28
  @client.request(
26
29
  method: :get,
27
30
  path: ["v2/lookup/%1$s", phone_number],
28
- query: parsed,
31
+ query: query,
29
32
  model: PreludeSDK::Models::LookupLookupResponse,
30
33
  options: options
31
34
  )