prelude-sdk 0.4.0 → 0.6.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/CHANGELOG.md +37 -0
- data/README.md +1 -1
- data/lib/prelude_sdk/internal/transport/base_client.rb +5 -0
- data/lib/prelude_sdk/models/notify_send_batch_params.rb +13 -1
- data/lib/prelude_sdk/models/notify_send_params.rb +13 -38
- data/lib/prelude_sdk/models/transactional_send_params.rb +11 -1
- data/lib/prelude_sdk/models/verification_check_params.rb +44 -1
- data/lib/prelude_sdk/models/verification_check_response.rb +12 -3
- data/lib/prelude_sdk/models/verification_create_params.rb +82 -4
- data/lib/prelude_sdk/models/verification_create_response.rb +11 -4
- data/lib/prelude_sdk/models/watch_predict_params.rb +3 -3
- data/lib/prelude_sdk/models/watch_send_events_params.rb +22 -3
- data/lib/prelude_sdk/resources/notify.rb +6 -6
- data/lib/prelude_sdk/resources/transactional.rb +3 -1
- data/lib/prelude_sdk/resources/verification.rb +3 -1
- data/lib/prelude_sdk/resources/watch.rb +19 -6
- data/lib/prelude_sdk/version.rb +1 -1
- data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +19 -0
- data/rbi/prelude_sdk/models/notify_send_params.rbi +19 -59
- data/rbi/prelude_sdk/models/transactional_send_params.rbi +15 -0
- data/rbi/prelude_sdk/models/verification_check_params.rbi +68 -0
- data/rbi/prelude_sdk/models/verification_check_response.rbi +19 -3
- data/rbi/prelude_sdk/models/verification_create_params.rbi +184 -3
- data/rbi/prelude_sdk/models/verification_create_response.rbi +21 -7
- data/rbi/prelude_sdk/models/watch_predict_params.rbi +3 -3
- data/rbi/prelude_sdk/models/watch_send_events_params.rbi +27 -3
- data/rbi/prelude_sdk/resources/notify.rbi +14 -9
- data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
- data/rbi/prelude_sdk/resources/verification.rbi +6 -0
- data/rbi/prelude_sdk/resources/watch.rbi +19 -6
- data/sig/prelude_sdk/models/notify_send_batch_params.rbs +7 -0
- data/sig/prelude_sdk/models/notify_send_params.rbs +7 -26
- data/sig/prelude_sdk/models/transactional_send_params.rbs +7 -0
- data/sig/prelude_sdk/models/verification_check_params.rbs +31 -1
- data/sig/prelude_sdk/models/verification_check_response.rbs +8 -1
- data/sig/prelude_sdk/models/verification_create_params.rbs +38 -0
- data/sig/prelude_sdk/models/verification_create_response.rbs +2 -1
- data/sig/prelude_sdk/resources/notify.rbs +2 -2
- data/sig/prelude_sdk/resources/transactional.rbs +1 -0
- data/sig/prelude_sdk/resources/verification.rbs +1 -0
- metadata +2 -2
|
@@ -258,6 +258,37 @@ module PreludeSDK
|
|
|
258
258
|
sig { params(callback_url: String).void }
|
|
259
259
|
attr_writer :callback_url
|
|
260
260
|
|
|
261
|
+
# The channels this verification may use, in the order they are tried. Channels
|
|
262
|
+
# you omit are never used, including on retries. This option can only be set when
|
|
263
|
+
# the verification is created. The list is recorded on the verification and
|
|
264
|
+
# applies for its whole lifecycle, so `channels` sent while retrying an existing
|
|
265
|
+
# verification is ignored — unlike `preferred_channel`, which is honored on every
|
|
266
|
+
# retry. Every channel you list must be enabled on your account and active in the
|
|
267
|
+
# destination country, otherwise the request fails with
|
|
268
|
+
# `channel_not_enabled_in_region`. Prelude still picks the best provider within
|
|
269
|
+
# each channel. Cannot be combined with `preferred_channel`. Voice is requested
|
|
270
|
+
# through `method` instead. Disabled by default — contact support to enable it.
|
|
271
|
+
sig do
|
|
272
|
+
returns(
|
|
273
|
+
T.nilable(
|
|
274
|
+
T::Array[
|
|
275
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
|
|
276
|
+
]
|
|
277
|
+
)
|
|
278
|
+
)
|
|
279
|
+
end
|
|
280
|
+
attr_reader :channels
|
|
281
|
+
|
|
282
|
+
sig do
|
|
283
|
+
params(
|
|
284
|
+
channels:
|
|
285
|
+
T::Array[
|
|
286
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
|
|
287
|
+
]
|
|
288
|
+
).void
|
|
289
|
+
end
|
|
290
|
+
attr_writer :channels
|
|
291
|
+
|
|
261
292
|
# The size of the code generated. It should be between 4 and 8. Defaults to the
|
|
262
293
|
# code size specified from the Dashboard.
|
|
263
294
|
sig { returns(T.nilable(Integer)) }
|
|
@@ -275,6 +306,19 @@ module PreludeSDK
|
|
|
275
306
|
sig { params(custom_code: String).void }
|
|
276
307
|
attr_writer :custom_code
|
|
277
308
|
|
|
309
|
+
# When `true`, the verification is routed through challenge-safe channels
|
|
310
|
+
# (non-SMS/Voice) regardless of country eligibility or any antispam outcome. The
|
|
311
|
+
# resulting verification has `status: "challenged"`. Use this when you have your
|
|
312
|
+
# own signal that the request is suspicious and want stricter routing — the
|
|
313
|
+
# verification is **not** classified as fraud and does not contribute to
|
|
314
|
+
# anti-fraud counters or risk factors. This feature is disabled by default —
|
|
315
|
+
# contact Prelude support to enable it on your account.
|
|
316
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
317
|
+
attr_reader :force_challenge
|
|
318
|
+
|
|
319
|
+
sig { params(force_challenge: T::Boolean).void }
|
|
320
|
+
attr_writer :force_challenge
|
|
321
|
+
|
|
278
322
|
# A BCP-47 formatted locale string with the language the text message will be sent
|
|
279
323
|
# to. If there's no locale set, the language will be determined by the country
|
|
280
324
|
# code of the phone number. If the language specified doesn't exist, it defaults
|
|
@@ -285,6 +329,27 @@ module PreludeSDK
|
|
|
285
329
|
sig { params(locale: String).void }
|
|
286
330
|
attr_writer :locale
|
|
287
331
|
|
|
332
|
+
# Maximum number of delivery attempts Prelude may add on its own after the one you
|
|
333
|
+
# requested. `0` means a single attempt: if it cannot be delivered, Prelude
|
|
334
|
+
# neither tries another provider nor another channel, and does not retry
|
|
335
|
+
# automatically. `1` allows one additional attempt, and so on — a value larger
|
|
336
|
+
# than the number of routes available for the destination simply behaves like the
|
|
337
|
+
# default. When omitted, Prelude retries as your account is configured, across as
|
|
338
|
+
# many channels as the route offers.
|
|
339
|
+
#
|
|
340
|
+
# This option can only be set when the verification is created. The value is
|
|
341
|
+
# recorded on the verification and applies for its whole lifecycle, so a
|
|
342
|
+
# `max_auto_fallbacks` sent while retrying an existing verification is ignored —
|
|
343
|
+
# the limit cannot be raised or lowered after the fact. A retry you ask for is not
|
|
344
|
+
# an automatic attempt, so it gets a fresh allowance of the same limit. This
|
|
345
|
+
# option is disabled by default — contact Prelude support to enable it on your
|
|
346
|
+
# account.
|
|
347
|
+
sig { returns(T.nilable(Integer)) }
|
|
348
|
+
attr_reader :max_auto_fallbacks
|
|
349
|
+
|
|
350
|
+
sig { params(max_auto_fallbacks: Integer).void }
|
|
351
|
+
attr_writer :max_auto_fallbacks
|
|
352
|
+
|
|
288
353
|
# The method used for verifying this phone number. The 'voice' option provides an
|
|
289
354
|
# accessible alternative for visually impaired users by delivering the
|
|
290
355
|
# verification code through a phone call rather than a text message. It also
|
|
@@ -309,7 +374,12 @@ module PreludeSDK
|
|
|
309
374
|
end
|
|
310
375
|
attr_writer :verification_method
|
|
311
376
|
|
|
312
|
-
# The
|
|
377
|
+
# The channel to prioritize when delivering the verification. Prelude prioritizes
|
|
378
|
+
# this channel on the first attempt and continues to prefer it on retries while an
|
|
379
|
+
# untried route on that channel remains; once those are exhausted, retries fall
|
|
380
|
+
# back to the next best available route. If the channel is unavailable (for
|
|
381
|
+
# example, when a verification is challenged), Prelude uses the best available
|
|
382
|
+
# route instead. Cannot be combined with `channels`.
|
|
313
383
|
sig do
|
|
314
384
|
returns(
|
|
315
385
|
T.nilable(
|
|
@@ -356,9 +426,15 @@ module PreludeSDK
|
|
|
356
426
|
app_realm:
|
|
357
427
|
PreludeSDK::VerificationCreateParams::Options::AppRealm::OrHash,
|
|
358
428
|
callback_url: String,
|
|
429
|
+
channels:
|
|
430
|
+
T::Array[
|
|
431
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
|
|
432
|
+
],
|
|
359
433
|
code_size: Integer,
|
|
360
434
|
custom_code: String,
|
|
435
|
+
force_challenge: T::Boolean,
|
|
361
436
|
locale: String,
|
|
437
|
+
max_auto_fallbacks: Integer,
|
|
362
438
|
verification_method:
|
|
363
439
|
PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol,
|
|
364
440
|
preferred_channel:
|
|
@@ -376,6 +452,17 @@ module PreludeSDK
|
|
|
376
452
|
# verification creation, attempt creation, and delivery status changes. For more
|
|
377
453
|
# details, refer to [Webhook](/verify/v2/documentation/webhook).
|
|
378
454
|
callback_url: nil,
|
|
455
|
+
# The channels this verification may use, in the order they are tried. Channels
|
|
456
|
+
# you omit are never used, including on retries. This option can only be set when
|
|
457
|
+
# the verification is created. The list is recorded on the verification and
|
|
458
|
+
# applies for its whole lifecycle, so `channels` sent while retrying an existing
|
|
459
|
+
# verification is ignored — unlike `preferred_channel`, which is honored on every
|
|
460
|
+
# retry. Every channel you list must be enabled on your account and active in the
|
|
461
|
+
# destination country, otherwise the request fails with
|
|
462
|
+
# `channel_not_enabled_in_region`. Prelude still picks the best provider within
|
|
463
|
+
# each channel. Cannot be combined with `preferred_channel`. Voice is requested
|
|
464
|
+
# through `method` instead. Disabled by default — contact support to enable it.
|
|
465
|
+
channels: nil,
|
|
379
466
|
# The size of the code generated. It should be between 4 and 8. Defaults to the
|
|
380
467
|
# code size specified from the Dashboard.
|
|
381
468
|
code_size: nil,
|
|
@@ -383,11 +470,35 @@ module PreludeSDK
|
|
|
383
470
|
# contact us to enable it for your account. For more details, refer to
|
|
384
471
|
# [Custom Code](/verify/v2/documentation/custom-codes).
|
|
385
472
|
custom_code: nil,
|
|
473
|
+
# When `true`, the verification is routed through challenge-safe channels
|
|
474
|
+
# (non-SMS/Voice) regardless of country eligibility or any antispam outcome. The
|
|
475
|
+
# resulting verification has `status: "challenged"`. Use this when you have your
|
|
476
|
+
# own signal that the request is suspicious and want stricter routing — the
|
|
477
|
+
# verification is **not** classified as fraud and does not contribute to
|
|
478
|
+
# anti-fraud counters or risk factors. This feature is disabled by default —
|
|
479
|
+
# contact Prelude support to enable it on your account.
|
|
480
|
+
force_challenge: nil,
|
|
386
481
|
# A BCP-47 formatted locale string with the language the text message will be sent
|
|
387
482
|
# to. If there's no locale set, the language will be determined by the country
|
|
388
483
|
# code of the phone number. If the language specified doesn't exist, it defaults
|
|
389
484
|
# to US English.
|
|
390
485
|
locale: nil,
|
|
486
|
+
# Maximum number of delivery attempts Prelude may add on its own after the one you
|
|
487
|
+
# requested. `0` means a single attempt: if it cannot be delivered, Prelude
|
|
488
|
+
# neither tries another provider nor another channel, and does not retry
|
|
489
|
+
# automatically. `1` allows one additional attempt, and so on — a value larger
|
|
490
|
+
# than the number of routes available for the destination simply behaves like the
|
|
491
|
+
# default. When omitted, Prelude retries as your account is configured, across as
|
|
492
|
+
# many channels as the route offers.
|
|
493
|
+
#
|
|
494
|
+
# This option can only be set when the verification is created. The value is
|
|
495
|
+
# recorded on the verification and applies for its whole lifecycle, so a
|
|
496
|
+
# `max_auto_fallbacks` sent while retrying an existing verification is ignored —
|
|
497
|
+
# the limit cannot be raised or lowered after the fact. A retry you ask for is not
|
|
498
|
+
# an automatic attempt, so it gets a fresh allowance of the same limit. This
|
|
499
|
+
# option is disabled by default — contact Prelude support to enable it on your
|
|
500
|
+
# account.
|
|
501
|
+
max_auto_fallbacks: nil,
|
|
391
502
|
# The method used for verifying this phone number. The 'voice' option provides an
|
|
392
503
|
# accessible alternative for visually impaired users by delivering the
|
|
393
504
|
# verification code through a phone call rather than a text message. It also
|
|
@@ -396,7 +507,12 @@ module PreludeSDK
|
|
|
396
507
|
# skips silent verification, useful for scenarios requiring direct user
|
|
397
508
|
# interaction.
|
|
398
509
|
verification_method: nil,
|
|
399
|
-
# The
|
|
510
|
+
# The channel to prioritize when delivering the verification. Prelude prioritizes
|
|
511
|
+
# this channel on the first attempt and continues to prefer it on retries while an
|
|
512
|
+
# untried route on that channel remains; once those are exhausted, retries fall
|
|
513
|
+
# back to the next best available route. If the channel is unavailable (for
|
|
514
|
+
# example, when a verification is challenged), Prelude uses the best available
|
|
515
|
+
# route instead. Cannot be combined with `channels`.
|
|
400
516
|
preferred_channel: nil,
|
|
401
517
|
# The Sender ID to use for this message. The Sender ID needs to be enabled by
|
|
402
518
|
# Prelude.
|
|
@@ -415,9 +531,15 @@ module PreludeSDK
|
|
|
415
531
|
app_realm:
|
|
416
532
|
PreludeSDK::VerificationCreateParams::Options::AppRealm,
|
|
417
533
|
callback_url: String,
|
|
534
|
+
channels:
|
|
535
|
+
T::Array[
|
|
536
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::OrSymbol
|
|
537
|
+
],
|
|
418
538
|
code_size: Integer,
|
|
419
539
|
custom_code: String,
|
|
540
|
+
force_challenge: T::Boolean,
|
|
420
541
|
locale: String,
|
|
542
|
+
max_auto_fallbacks: Integer,
|
|
421
543
|
verification_method:
|
|
422
544
|
PreludeSDK::VerificationCreateParams::Options::Method::OrSymbol,
|
|
423
545
|
preferred_channel:
|
|
@@ -530,6 +652,60 @@ module PreludeSDK
|
|
|
530
652
|
end
|
|
531
653
|
end
|
|
532
654
|
|
|
655
|
+
module Channel
|
|
656
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
657
|
+
|
|
658
|
+
TaggedSymbol =
|
|
659
|
+
T.type_alias do
|
|
660
|
+
T.all(
|
|
661
|
+
Symbol,
|
|
662
|
+
PreludeSDK::VerificationCreateParams::Options::Channel
|
|
663
|
+
)
|
|
664
|
+
end
|
|
665
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
666
|
+
|
|
667
|
+
SMS =
|
|
668
|
+
T.let(
|
|
669
|
+
:sms,
|
|
670
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
|
|
671
|
+
)
|
|
672
|
+
RCS =
|
|
673
|
+
T.let(
|
|
674
|
+
:rcs,
|
|
675
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
|
|
676
|
+
)
|
|
677
|
+
WHATSAPP =
|
|
678
|
+
T.let(
|
|
679
|
+
:whatsapp,
|
|
680
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
|
|
681
|
+
)
|
|
682
|
+
VIBER =
|
|
683
|
+
T.let(
|
|
684
|
+
:viber,
|
|
685
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
|
|
686
|
+
)
|
|
687
|
+
ZALO =
|
|
688
|
+
T.let(
|
|
689
|
+
:zalo,
|
|
690
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
|
|
691
|
+
)
|
|
692
|
+
TELEGRAM =
|
|
693
|
+
T.let(
|
|
694
|
+
:telegram,
|
|
695
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
|
|
696
|
+
)
|
|
697
|
+
|
|
698
|
+
sig do
|
|
699
|
+
override.returns(
|
|
700
|
+
T::Array[
|
|
701
|
+
PreludeSDK::VerificationCreateParams::Options::Channel::TaggedSymbol
|
|
702
|
+
]
|
|
703
|
+
)
|
|
704
|
+
end
|
|
705
|
+
def self.values
|
|
706
|
+
end
|
|
707
|
+
end
|
|
708
|
+
|
|
533
709
|
# The method used for verifying this phone number. The 'voice' option provides an
|
|
534
710
|
# accessible alternative for visually impaired users by delivering the
|
|
535
711
|
# verification code through a phone call rather than a text message. It also
|
|
@@ -576,7 +752,12 @@ module PreludeSDK
|
|
|
576
752
|
end
|
|
577
753
|
end
|
|
578
754
|
|
|
579
|
-
# The
|
|
755
|
+
# The channel to prioritize when delivering the verification. Prelude prioritizes
|
|
756
|
+
# this channel on the first attempt and continues to prefer it on retries while an
|
|
757
|
+
# untried route on that channel remains; once those are exhausted, retries fall
|
|
758
|
+
# back to the next best available route. If the channel is unavailable (for
|
|
759
|
+
# example, when a verification is challenged), Prelude uses the best available
|
|
760
|
+
# route instead. Cannot be combined with `channels`.
|
|
580
761
|
module PreferredChannel
|
|
581
762
|
extend PreludeSDK::Internal::Type::Enum
|
|
582
763
|
|
|
@@ -31,6 +31,9 @@ module PreludeSDK
|
|
|
31
31
|
# non-voice channels only. This mode must be enabled for your customer account
|
|
32
32
|
# by Prelude support.
|
|
33
33
|
# - `blocked` - The verification was blocked.
|
|
34
|
+
# - `shadow_blocked` - The verification triggered a block rule but the decision
|
|
35
|
+
# was not enforced; this is used to dry-run anti-fraud configuration. This mode
|
|
36
|
+
# must be enabled for your customer account by Prelude support.
|
|
34
37
|
sig do
|
|
35
38
|
returns(
|
|
36
39
|
PreludeSDK::Models::VerificationCreateResponse::Status::TaggedSymbol
|
|
@@ -77,7 +80,7 @@ module PreludeSDK
|
|
|
77
80
|
attr_writer :metadata
|
|
78
81
|
|
|
79
82
|
# The reason why the verification was blocked. Only present when status is
|
|
80
|
-
# "blocked".
|
|
83
|
+
# "blocked" or "shadow_blocked".
|
|
81
84
|
#
|
|
82
85
|
# - `expired_signature` - The signature of the SDK signals is expired. They should
|
|
83
86
|
# be sent within the hour following their collection.
|
|
@@ -115,8 +118,8 @@ module PreludeSDK
|
|
|
115
118
|
attr_writer :request_id
|
|
116
119
|
|
|
117
120
|
# The risk factors that contributed to the verification being blocked. Only
|
|
118
|
-
# present when status is "blocked" and the anti-fraud system
|
|
119
|
-
# risk signals.
|
|
121
|
+
# present when status is "blocked" or "shadow_blocked" and the anti-fraud system
|
|
122
|
+
# detected specific risk signals.
|
|
120
123
|
#
|
|
121
124
|
# - `behavioral_pattern` - The phone number past behavior during verification
|
|
122
125
|
# flows exhibits suspicious patterns.
|
|
@@ -210,13 +213,16 @@ module PreludeSDK
|
|
|
210
213
|
# non-voice channels only. This mode must be enabled for your customer account
|
|
211
214
|
# by Prelude support.
|
|
212
215
|
# - `blocked` - The verification was blocked.
|
|
216
|
+
# - `shadow_blocked` - The verification triggered a block rule but the decision
|
|
217
|
+
# was not enforced; this is used to dry-run anti-fraud configuration. This mode
|
|
218
|
+
# must be enabled for your customer account by Prelude support.
|
|
213
219
|
status:,
|
|
214
220
|
# The ordered sequence of channels to be used for verification
|
|
215
221
|
channels: nil,
|
|
216
222
|
# The metadata for this verification.
|
|
217
223
|
metadata: nil,
|
|
218
224
|
# The reason why the verification was blocked. Only present when status is
|
|
219
|
-
# "blocked".
|
|
225
|
+
# "blocked" or "shadow_blocked".
|
|
220
226
|
#
|
|
221
227
|
# - `expired_signature` - The signature of the SDK signals is expired. They should
|
|
222
228
|
# be sent within the hour following their collection.
|
|
@@ -233,8 +239,8 @@ module PreludeSDK
|
|
|
233
239
|
reason: nil,
|
|
234
240
|
request_id: nil,
|
|
235
241
|
# The risk factors that contributed to the verification being blocked. Only
|
|
236
|
-
# present when status is "blocked" and the anti-fraud system
|
|
237
|
-
# risk signals.
|
|
242
|
+
# present when status is "blocked" or "shadow_blocked" and the anti-fraud system
|
|
243
|
+
# detected specific risk signals.
|
|
238
244
|
#
|
|
239
245
|
# - `behavioral_pattern` - The phone number past behavior during verification
|
|
240
246
|
# flows exhibits suspicious patterns.
|
|
@@ -342,6 +348,9 @@ module PreludeSDK
|
|
|
342
348
|
# non-voice channels only. This mode must be enabled for your customer account
|
|
343
349
|
# by Prelude support.
|
|
344
350
|
# - `blocked` - The verification was blocked.
|
|
351
|
+
# - `shadow_blocked` - The verification triggered a block rule but the decision
|
|
352
|
+
# was not enforced; this is used to dry-run anti-fraud configuration. This mode
|
|
353
|
+
# must be enabled for your customer account by Prelude support.
|
|
345
354
|
module Status
|
|
346
355
|
extend PreludeSDK::Internal::Type::Enum
|
|
347
356
|
|
|
@@ -374,6 +383,11 @@ module PreludeSDK
|
|
|
374
383
|
:blocked,
|
|
375
384
|
PreludeSDK::Models::VerificationCreateResponse::Status::TaggedSymbol
|
|
376
385
|
)
|
|
386
|
+
SHADOW_BLOCKED =
|
|
387
|
+
T.let(
|
|
388
|
+
:shadow_blocked,
|
|
389
|
+
PreludeSDK::Models::VerificationCreateResponse::Status::TaggedSymbol
|
|
390
|
+
)
|
|
377
391
|
|
|
378
392
|
sig do
|
|
379
393
|
override.returns(
|
|
@@ -482,7 +496,7 @@ module PreludeSDK
|
|
|
482
496
|
end
|
|
483
497
|
|
|
484
498
|
# The reason why the verification was blocked. Only present when status is
|
|
485
|
-
# "blocked".
|
|
499
|
+
# "blocked" or "shadow_blocked".
|
|
486
500
|
#
|
|
487
501
|
# - `expired_signature` - The signature of the SDK signals is expired. They should
|
|
488
502
|
# be sent within the hour following their collection.
|
|
@@ -11,7 +11,7 @@ module PreludeSDK
|
|
|
11
11
|
T.any(PreludeSDK::WatchPredictParams, PreludeSDK::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
# The
|
|
14
|
+
# The signup identifier to score — a phone number or email address.
|
|
15
15
|
sig { returns(PreludeSDK::WatchPredictParams::Target) }
|
|
16
16
|
attr_reader :target
|
|
17
17
|
|
|
@@ -56,7 +56,7 @@ module PreludeSDK
|
|
|
56
56
|
).returns(T.attached_class)
|
|
57
57
|
end
|
|
58
58
|
def self.new(
|
|
59
|
-
# The
|
|
59
|
+
# The signup identifier to score — a phone number or email address.
|
|
60
60
|
target:,
|
|
61
61
|
# The identifier of the dispatch that came from the front-end SDK.
|
|
62
62
|
dispatch_id: nil,
|
|
@@ -100,7 +100,7 @@ module PreludeSDK
|
|
|
100
100
|
sig { returns(String) }
|
|
101
101
|
attr_accessor :value
|
|
102
102
|
|
|
103
|
-
# The
|
|
103
|
+
# The signup identifier to score — a phone number or email address.
|
|
104
104
|
sig do
|
|
105
105
|
params(
|
|
106
106
|
type: PreludeSDK::WatchPredictParams::Target::Type::OrSymbol,
|
|
@@ -53,7 +53,15 @@ module PreludeSDK
|
|
|
53
53
|
)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
#
|
|
56
|
+
# How much this event tells us to trust the end-user's legitimacy — not how
|
|
57
|
+
# certain you are that the event occurred. In increasing order of trust:
|
|
58
|
+
# `minimum`, `low`, `neutral`, `high`, `maximum`.
|
|
59
|
+
#
|
|
60
|
+
# Use `minimum` for an event tied to a user you trust the least to be legitimate
|
|
61
|
+
# (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
|
|
62
|
+
# trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
|
|
63
|
+
# when scoring traffic: it filters out users tied to low-confidence events while
|
|
64
|
+
# preserving the experience for users tied to high-confidence ones.
|
|
57
65
|
sig do
|
|
58
66
|
returns(
|
|
59
67
|
PreludeSDK::WatchSendEventsParams::Event::Confidence::OrSymbol
|
|
@@ -85,7 +93,15 @@ module PreludeSDK
|
|
|
85
93
|
).returns(T.attached_class)
|
|
86
94
|
end
|
|
87
95
|
def self.new(
|
|
88
|
-
#
|
|
96
|
+
# How much this event tells us to trust the end-user's legitimacy — not how
|
|
97
|
+
# certain you are that the event occurred. In increasing order of trust:
|
|
98
|
+
# `minimum`, `low`, `neutral`, `high`, `maximum`.
|
|
99
|
+
#
|
|
100
|
+
# Use `minimum` for an event tied to a user you trust the least to be legitimate
|
|
101
|
+
# (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
|
|
102
|
+
# trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
|
|
103
|
+
# when scoring traffic: it filters out users tied to low-confidence events while
|
|
104
|
+
# preserving the experience for users tied to high-confidence ones.
|
|
89
105
|
confidence:,
|
|
90
106
|
# A label to describe what the event refers to.
|
|
91
107
|
label:,
|
|
@@ -107,7 +123,15 @@ module PreludeSDK
|
|
|
107
123
|
def to_hash
|
|
108
124
|
end
|
|
109
125
|
|
|
110
|
-
#
|
|
126
|
+
# How much this event tells us to trust the end-user's legitimacy — not how
|
|
127
|
+
# certain you are that the event occurred. In increasing order of trust:
|
|
128
|
+
# `minimum`, `low`, `neutral`, `high`, `maximum`.
|
|
129
|
+
#
|
|
130
|
+
# Use `minimum` for an event tied to a user you trust the least to be legitimate
|
|
131
|
+
# (e.g. a `payment.chargeback`), and `maximum` for an event tied to a highly
|
|
132
|
+
# trustworthy user (e.g. a confirmed 3DS payment). Prelude weights these signals
|
|
133
|
+
# when scoring traffic: it filters out users tied to low-confidence events while
|
|
134
|
+
# preserving the experience for users tied to high-confidence ones.
|
|
111
135
|
module Confidence
|
|
112
136
|
extend PreludeSDK::Internal::Type::Enum
|
|
113
137
|
|
|
@@ -121,16 +121,15 @@ module PreludeSDK
|
|
|
121
121
|
template_id: String,
|
|
122
122
|
to: String,
|
|
123
123
|
callback_url: String,
|
|
124
|
-
context: PreludeSDK::NotifySendParams::Context::OrHash,
|
|
125
124
|
correlation_id: String,
|
|
126
125
|
document: PreludeSDK::NotifySendParams::Document::OrHash,
|
|
127
126
|
expires_at: Time,
|
|
128
127
|
from: String,
|
|
129
128
|
locale: String,
|
|
129
|
+
max_auto_retries: Integer,
|
|
130
130
|
preferred_channel:
|
|
131
131
|
PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
|
|
132
132
|
schedule_at: Time,
|
|
133
|
-
text: String,
|
|
134
133
|
variables: T::Hash[Symbol, String],
|
|
135
134
|
request_options: PreludeSDK::RequestOptions::OrHash
|
|
136
135
|
).returns(PreludeSDK::Models::NotifySendResponse)
|
|
@@ -142,9 +141,6 @@ module PreludeSDK
|
|
|
142
141
|
to:,
|
|
143
142
|
# The URL where webhooks will be sent for message delivery events.
|
|
144
143
|
callback_url: nil,
|
|
145
|
-
# Context for replying to an inbound message. When provided, the message is sent
|
|
146
|
-
# as a WhatsApp reply within the 24-hour conversation window.
|
|
147
|
-
context: nil,
|
|
148
144
|
# A user-defined identifier to correlate this message with your internal systems.
|
|
149
145
|
# It is returned in the response and any webhook events that refer to this
|
|
150
146
|
# message.
|
|
@@ -170,6 +166,12 @@ module PreludeSDK
|
|
|
170
166
|
# code of the phone number. If the language specified doesn't exist, the default
|
|
171
167
|
# set on the template will be used.
|
|
172
168
|
locale: nil,
|
|
169
|
+
# Maximum number of automatic retry attempts across channels for this send, in
|
|
170
|
+
# addition to the first attempt. For example, `2` allows up to 3 total delivery
|
|
171
|
+
# attempts. Lower values reduce delivery cost on hard-to-reach numbers at the
|
|
172
|
+
# expense of deliverability. When omitted, your account's configured default
|
|
173
|
+
# applies.
|
|
174
|
+
max_auto_retries: nil,
|
|
173
175
|
# The preferred channel to be used in priority for message delivery. If the
|
|
174
176
|
# channel is unavailable, the system will fallback to other available channels.
|
|
175
177
|
preferred_channel: nil,
|
|
@@ -177,10 +179,6 @@ module PreludeSDK
|
|
|
177
179
|
# can be scheduled up to 90 days in advance and will be automatically adjusted for
|
|
178
180
|
# compliance with local time window restrictions.
|
|
179
181
|
schedule_at: nil,
|
|
180
|
-
# The reply message body. Required when `context.reply_to` is provided. Used for
|
|
181
|
-
# 2-way WhatsApp messaging to send free-form text replies within a conversation
|
|
182
|
-
# window.
|
|
183
|
-
text: nil,
|
|
184
182
|
# The variables to be replaced in the template.
|
|
185
183
|
variables: nil,
|
|
186
184
|
request_options: {}
|
|
@@ -198,6 +196,7 @@ module PreludeSDK
|
|
|
198
196
|
expires_at: Time,
|
|
199
197
|
from: String,
|
|
200
198
|
locale: String,
|
|
199
|
+
max_auto_retries: Integer,
|
|
201
200
|
preferred_channel:
|
|
202
201
|
PreludeSDK::NotifySendBatchParams::PreferredChannel::OrSymbol,
|
|
203
202
|
schedule_at: Time,
|
|
@@ -232,6 +231,12 @@ module PreludeSDK
|
|
|
232
231
|
from: nil,
|
|
233
232
|
# A BCP-47 formatted locale string.
|
|
234
233
|
locale: nil,
|
|
234
|
+
# Maximum number of automatic retry attempts across channels for each send in the
|
|
235
|
+
# batch, in addition to the first attempt. For example, `2` allows up to 3 total
|
|
236
|
+
# delivery attempts per recipient. Lower values reduce delivery cost on
|
|
237
|
+
# hard-to-reach numbers at the expense of deliverability. When omitted, your
|
|
238
|
+
# account's configured default applies.
|
|
239
|
+
max_auto_retries: nil,
|
|
235
240
|
# Preferred channel for delivery. If unavailable, automatic fallback applies.
|
|
236
241
|
preferred_channel: nil,
|
|
237
242
|
# Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply
|
|
@@ -16,6 +16,7 @@ module PreludeSDK
|
|
|
16
16
|
expires_at: String,
|
|
17
17
|
from: String,
|
|
18
18
|
locale: String,
|
|
19
|
+
max_auto_retries: Integer,
|
|
19
20
|
preferred_channel:
|
|
20
21
|
PreludeSDK::TransactionalSendParams::PreferredChannel::OrSymbol,
|
|
21
22
|
variables: T::Hash[Symbol, String],
|
|
@@ -53,6 +54,10 @@ module PreludeSDK
|
|
|
53
54
|
# code of the phone number. If the language specified doesn't exist, the default
|
|
54
55
|
# set on the template will be used.
|
|
55
56
|
locale: nil,
|
|
57
|
+
# Maximum number of automatic retry attempts across channels for this send, in
|
|
58
|
+
# addition to the first attempt. For example, `2` allows up to 3 total delivery
|
|
59
|
+
# attempts. When omitted, your account's configured default applies.
|
|
60
|
+
max_auto_retries: nil,
|
|
56
61
|
# The preferred delivery channel for the message. When specified, the system will
|
|
57
62
|
# prioritize sending via the requested channel if the template is configured for
|
|
58
63
|
# it.
|
|
@@ -40,6 +40,7 @@ module PreludeSDK
|
|
|
40
40
|
params(
|
|
41
41
|
code: String,
|
|
42
42
|
target: PreludeSDK::VerificationCheckParams::Target::OrHash,
|
|
43
|
+
psd2: PreludeSDK::VerificationCheckParams::Psd2::OrHash,
|
|
43
44
|
request_options: PreludeSDK::RequestOptions::OrHash
|
|
44
45
|
).returns(PreludeSDK::Models::VerificationCheckResponse)
|
|
45
46
|
end
|
|
@@ -49,6 +50,11 @@ module PreludeSDK
|
|
|
49
50
|
# The verification target. Either a phone number or an email address. To use the
|
|
50
51
|
# email verification feature contact us to discuss your use case.
|
|
51
52
|
target:,
|
|
53
|
+
# Required when checking a code issued under the `prelude:psd2` template. The
|
|
54
|
+
# submitted variables must match those provided at issuance; any mismatch
|
|
55
|
+
# invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
|
|
56
|
+
# non-PSD2 verifications.
|
|
57
|
+
psd2: nil,
|
|
52
58
|
request_options: {}
|
|
53
59
|
)
|
|
54
60
|
end
|
|
@@ -4,7 +4,12 @@ module PreludeSDK
|
|
|
4
4
|
module Resources
|
|
5
5
|
# Evaluate email addresses and phone numbers for trustworthiness.
|
|
6
6
|
class Watch
|
|
7
|
-
#
|
|
7
|
+
# At signup, score the user's phone number or email address (target) as legitimate
|
|
8
|
+
# or suspicious. Scoring-only — does not update counters by itself. When using
|
|
9
|
+
# Feedback, call predict before verification.started on the same target (and
|
|
10
|
+
# correlation_id when used) so feedback can warm Watch auth-start counters. Use
|
|
11
|
+
# Events for product fraud labels; use Feedback only if you run your own phone
|
|
12
|
+
# verification funnel outside Prelude Verify.
|
|
8
13
|
sig do
|
|
9
14
|
params(
|
|
10
15
|
target: PreludeSDK::WatchPredictParams::Target::OrHash,
|
|
@@ -15,7 +20,7 @@ module PreludeSDK
|
|
|
15
20
|
).returns(PreludeSDK::Models::WatchPredictResponse)
|
|
16
21
|
end
|
|
17
22
|
def predict(
|
|
18
|
-
# The
|
|
23
|
+
# The signup identifier to score — a phone number or email address.
|
|
19
24
|
target:,
|
|
20
25
|
# The identifier of the dispatch that came from the front-end SDK.
|
|
21
26
|
dispatch_id: nil,
|
|
@@ -28,8 +33,11 @@ module PreludeSDK
|
|
|
28
33
|
)
|
|
29
34
|
end
|
|
30
35
|
|
|
31
|
-
# Send
|
|
32
|
-
# Events
|
|
36
|
+
# Send custom fraud signals from your application (labels and confidence levels).
|
|
37
|
+
# Events capture product-specific risk patterns and are weighted when scoring
|
|
38
|
+
# traffic. Use without Predict or Feedback if you only need to report product-side
|
|
39
|
+
# abuse (for example account.banned). Feedback is a separate, optional endpoint
|
|
40
|
+
# for self-hosted phone verification funnels.
|
|
33
41
|
sig do
|
|
34
42
|
params(
|
|
35
43
|
events: T::Array[PreludeSDK::WatchSendEventsParams::Event::OrHash],
|
|
@@ -44,8 +52,13 @@ module PreludeSDK
|
|
|
44
52
|
)
|
|
45
53
|
end
|
|
46
54
|
|
|
47
|
-
#
|
|
48
|
-
#
|
|
55
|
+
# Optional. Report verification-funnel steps (verification.started,
|
|
56
|
+
# verification.completed) when you run phone verification outside Prelude Verify.
|
|
57
|
+
# Feeds Watch abuse-rate counters for your own flow. Call Predict on the same
|
|
58
|
+
# target before verification.started and reuse metadata.correlation_id so
|
|
59
|
+
# auth-start counters receive predict signals; without a linked predict, only
|
|
60
|
+
# attempt-rate counters update on started. Not required if you only use Events
|
|
61
|
+
# and/or Predict, or if Verify already handles verification for that traffic.
|
|
49
62
|
sig do
|
|
50
63
|
params(
|
|
51
64
|
feedbacks:
|
|
@@ -10,6 +10,7 @@ module PreludeSDK
|
|
|
10
10
|
expires_at: Time,
|
|
11
11
|
from: String,
|
|
12
12
|
locale: String,
|
|
13
|
+
max_auto_retries: Integer,
|
|
13
14
|
preferred_channel: PreludeSDK::Models::NotifySendBatchParams::preferred_channel,
|
|
14
15
|
schedule_at: Time,
|
|
15
16
|
variables: ::Hash[Symbol, String]
|
|
@@ -50,6 +51,10 @@ module PreludeSDK
|
|
|
50
51
|
|
|
51
52
|
def locale=: (String) -> String
|
|
52
53
|
|
|
54
|
+
attr_reader max_auto_retries: Integer?
|
|
55
|
+
|
|
56
|
+
def max_auto_retries=: (Integer) -> Integer
|
|
57
|
+
|
|
53
58
|
attr_reader preferred_channel: PreludeSDK::Models::NotifySendBatchParams::preferred_channel?
|
|
54
59
|
|
|
55
60
|
def preferred_channel=: (
|
|
@@ -73,6 +78,7 @@ module PreludeSDK
|
|
|
73
78
|
?expires_at: Time,
|
|
74
79
|
?from: String,
|
|
75
80
|
?locale: String,
|
|
81
|
+
?max_auto_retries: Integer,
|
|
76
82
|
?preferred_channel: PreludeSDK::Models::NotifySendBatchParams::preferred_channel,
|
|
77
83
|
?schedule_at: Time,
|
|
78
84
|
?variables: ::Hash[Symbol, String],
|
|
@@ -88,6 +94,7 @@ module PreludeSDK
|
|
|
88
94
|
expires_at: Time,
|
|
89
95
|
from: String,
|
|
90
96
|
locale: String,
|
|
97
|
+
max_auto_retries: Integer,
|
|
91
98
|
preferred_channel: PreludeSDK::Models::NotifySendBatchParams::preferred_channel,
|
|
92
99
|
schedule_at: Time,
|
|
93
100
|
variables: ::Hash[Symbol, String],
|