moderation_api 2.20.0 → 2.22.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 +16 -0
- data/README.md +1 -1
- data/lib/moderation_api/models/content_submit_params.rb +86 -1
- data/lib/moderation_api/models/content_submit_response.rb +1 -0
- data/lib/moderation_api/models/webhook_event.rb +376 -4
- data/lib/moderation_api/resources/content.rb +3 -1
- data/lib/moderation_api/version.rb +1 -1
- data/rbi/moderation_api/models/content_submit_params.rbi +191 -0
- data/rbi/moderation_api/models/content_submit_response.rbi +5 -0
- data/rbi/moderation_api/models/webhook_event.rbi +824 -0
- data/rbi/moderation_api/resources/content.rbi +6 -0
- data/sig/moderation_api/models/content_submit_params.rbs +72 -0
- data/sig/moderation_api/models/content_submit_response.rbs +2 -0
- data/sig/moderation_api/models/webhook_event.rbs +292 -0
- data/sig/moderation_api/resources/content.rbs +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 702ad6b875faa58c838f59c5232b99a125ed63502886583bbfa3236e0e447bb2
|
|
4
|
+
data.tar.gz: c7c420f51bf7be8c8f5442b854f4061df43ae5ffa343303d60db1855ac5beb68
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4428e4355dc7b2b8e9b5bcf0a2929c36eb5078d02812dff5f1f52d932a38303b5d8bac87167d968475035a5919e037037fe71d4790ad464bee2f90f67460e2fe
|
|
7
|
+
data.tar.gz: 1383d052a974cf8fbfa1c00f800b1cc7cb2e47790b5efeb517792d97e099d2e800711ac8280f56bdbf37c70ceb6a6220f0b4b8c8be596c8c0f321c769bed0927
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.22.0 (2026-06-02)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.21.0...v2.22.0](https://github.com/moderation-api/sdk-ruby/compare/v2.21.0...v2.22.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([f04cbbf](https://github.com/moderation-api/sdk-ruby/commit/f04cbbf7be3373c6a08b3e0192e5ba45690e962f))
|
|
10
|
+
|
|
11
|
+
## 2.21.0 (2026-06-02)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v2.20.0...v2.21.0](https://github.com/moderation-api/sdk-ruby/compare/v2.20.0...v2.21.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([250e1b4](https://github.com/moderation-api/sdk-ruby/commit/250e1b4849fff5f9dfe39c267b4641c23fc46358))
|
|
18
|
+
|
|
3
19
|
## 2.20.0 (2026-06-01)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v2.19.0...v2.20.0](https://github.com/moderation-api/sdk-ruby/compare/v2.19.0...v2.20.0)
|
data/README.md
CHANGED
|
@@ -26,6 +26,18 @@ module ModerationAPI
|
|
|
26
26
|
# @return [String, nil]
|
|
27
27
|
optional :channel, String
|
|
28
28
|
|
|
29
|
+
# @!attribute client_action
|
|
30
|
+
# A recommendation from your own client-side flagging (e.g. a banned-IP list or a
|
|
31
|
+
# third-party tool). Feeds the rules engine and can escalate or override the
|
|
32
|
+
# recommended action. Does not change whether our analysis flagged the content.
|
|
33
|
+
#
|
|
34
|
+
# @return [ModerationAPI::Models::ContentSubmitParams::ClientAction, nil]
|
|
35
|
+
optional :client_action,
|
|
36
|
+
-> {
|
|
37
|
+
ModerationAPI::ContentSubmitParams::ClientAction
|
|
38
|
+
},
|
|
39
|
+
api_name: :clientAction
|
|
40
|
+
|
|
29
41
|
# @!attribute content_id
|
|
30
42
|
# The unique ID of the content in your database.
|
|
31
43
|
#
|
|
@@ -70,7 +82,7 @@ module ModerationAPI
|
|
|
70
82
|
# @return [Float, nil]
|
|
71
83
|
optional :timestamp, Float
|
|
72
84
|
|
|
73
|
-
# @!method initialize(content:, author_id: nil, channel: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
|
|
85
|
+
# @!method initialize(content:, author_id: nil, channel: nil, client_action: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
|
|
74
86
|
# Some parameter documentations has been truncated, see
|
|
75
87
|
# {ModerationAPI::Models::ContentSubmitParams} for more details.
|
|
76
88
|
#
|
|
@@ -80,6 +92,8 @@ module ModerationAPI
|
|
|
80
92
|
#
|
|
81
93
|
# @param channel [String] Provide a channel ID or key. Will use the project's default channel if not provi
|
|
82
94
|
#
|
|
95
|
+
# @param client_action [ModerationAPI::Models::ContentSubmitParams::ClientAction] A recommendation from your own client-side flagging (e.g. a banned-IP list or a
|
|
96
|
+
#
|
|
83
97
|
# @param content_id [String] The unique ID of the content in your database.
|
|
84
98
|
#
|
|
85
99
|
# @param conversation_id [String] For example the ID of a chat room or a post
|
|
@@ -345,6 +359,77 @@ module ModerationAPI
|
|
|
345
359
|
# @return [Array(ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object)]
|
|
346
360
|
end
|
|
347
361
|
|
|
362
|
+
class ClientAction < ModerationAPI::Internal::Type::BaseModel
|
|
363
|
+
# @!attribute action
|
|
364
|
+
# Your recommendation for the content: allow, review, or reject.
|
|
365
|
+
#
|
|
366
|
+
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action]
|
|
367
|
+
required :action, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Action }
|
|
368
|
+
|
|
369
|
+
# @!attribute behavior
|
|
370
|
+
# How your recommendation combines with ours. Defaults to 'escalate', which only
|
|
371
|
+
# applies it when stricter than ours; 'override' replaces ours outright.
|
|
372
|
+
#
|
|
373
|
+
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior, nil]
|
|
374
|
+
optional :behavior, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Behavior }
|
|
375
|
+
|
|
376
|
+
# @!attribute reason
|
|
377
|
+
# A human-readable explanation for your recommendation.
|
|
378
|
+
#
|
|
379
|
+
# @return [String, nil]
|
|
380
|
+
optional :reason, String
|
|
381
|
+
|
|
382
|
+
# @!attribute source
|
|
383
|
+
# Where your recommendation came from, e.g. "banned-ip".
|
|
384
|
+
#
|
|
385
|
+
# @return [String, nil]
|
|
386
|
+
optional :source, String
|
|
387
|
+
|
|
388
|
+
# @!method initialize(action:, behavior: nil, reason: nil, source: nil)
|
|
389
|
+
# Some parameter documentations has been truncated, see
|
|
390
|
+
# {ModerationAPI::Models::ContentSubmitParams::ClientAction} for more details.
|
|
391
|
+
#
|
|
392
|
+
# A recommendation from your own client-side flagging (e.g. a banned-IP list or a
|
|
393
|
+
# third-party tool). Feeds the rules engine and can escalate or override the
|
|
394
|
+
# recommended action. Does not change whether our analysis flagged the content.
|
|
395
|
+
#
|
|
396
|
+
# @param action [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
|
|
397
|
+
#
|
|
398
|
+
# @param behavior [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
|
|
399
|
+
#
|
|
400
|
+
# @param reason [String] A human-readable explanation for your recommendation.
|
|
401
|
+
#
|
|
402
|
+
# @param source [String] Where your recommendation came from, e.g. "banned-ip".
|
|
403
|
+
|
|
404
|
+
# Your recommendation for the content: allow, review, or reject.
|
|
405
|
+
#
|
|
406
|
+
# @see ModerationAPI::Models::ContentSubmitParams::ClientAction#action
|
|
407
|
+
module Action
|
|
408
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
409
|
+
|
|
410
|
+
REVIEW = :review
|
|
411
|
+
ALLOW = :allow
|
|
412
|
+
REJECT = :reject
|
|
413
|
+
|
|
414
|
+
# @!method self.values
|
|
415
|
+
# @return [Array<Symbol>]
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
# How your recommendation combines with ours. Defaults to 'escalate', which only
|
|
419
|
+
# applies it when stricter than ours; 'override' replaces ours outright.
|
|
420
|
+
#
|
|
421
|
+
# @see ModerationAPI::Models::ContentSubmitParams::ClientAction#behavior
|
|
422
|
+
module Behavior
|
|
423
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
424
|
+
|
|
425
|
+
OVERRIDE = :override
|
|
426
|
+
ESCALATE = :escalate
|
|
427
|
+
|
|
428
|
+
# @!method self.values
|
|
429
|
+
# @return [Array<Symbol>]
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
|
|
348
433
|
# The meta type of content being moderated
|
|
349
434
|
module MetaType
|
|
350
435
|
extend ModerationAPI::Internal::Type::Enum
|