x-twitter-scraper 0.4.5 → 0.5.2
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 +33 -0
- data/README.md +8 -41
- data/lib/x_twitter_scraper/client.rb +1 -1
- data/lib/x_twitter_scraper/internal/type/union.rb +13 -0
- data/lib/x_twitter_scraper/models/account_retrieve_response.rb +4 -4
- data/lib/x_twitter_scraper/models/compose_create_params.rb +194 -122
- data/lib/x_twitter_scraper/models/compose_create_response.rb +326 -33
- data/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb +2 -2
- data/lib/x_twitter_scraper/models/error.rb +99 -3
- data/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb +8 -8
- data/lib/x_twitter_scraper/models/guest_wallet_create_params.rb +2 -2
- data/lib/x_twitter_scraper/models/guest_wallet_create_response.rb +27 -7
- data/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb +2 -2
- data/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb +27 -7
- data/lib/x_twitter_scraper/models/search_tweet.rb +12 -12
- data/lib/x_twitter_scraper/models/support/ticket_create_params.rb +7 -1
- data/lib/x_twitter_scraper/models/support/ticket_create_response.rb +40 -3
- data/lib/x_twitter_scraper/models/support/ticket_reply_params.rb +7 -1
- data/lib/x_twitter_scraper/models/support/ticket_reply_response.rb +40 -3
- data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +114 -1
- data/lib/x_twitter_scraper/models/x/communities/join_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/communities/join_create_response.rb +577 -4
- data/lib/x_twitter_scraper/models/x/communities/join_delete_all_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb +585 -4
- data/lib/x_twitter_scraper/models/x/community_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/community_create_response.rb +568 -8
- data/lib/x_twitter_scraper/models/x/community_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/community_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/dm_send_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/dm_send_response.rb +573 -7
- data/lib/x_twitter_scraper/models/x/media_upload_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/media_upload_response.rb +568 -11
- data/lib/x_twitter_scraper/models/x/profile_update_avatar_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/profile_update_avatar_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/profile_update_banner_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/profile_update_banner_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/profile_update_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/profile_update_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweet_author.rb +1 -14
- data/lib/x_twitter_scraper/models/x/tweet_create_params.rb +5 -5
- data/lib/x_twitter_scraper/models/x/tweet_create_response.rb +551 -12
- data/lib/x_twitter_scraper/models/x/tweet_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweet_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/like_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/like_create_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/like_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/like_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/retweet_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/retweet_create_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/retweet_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/retweet_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/user_retrieve_following_params.rb +2 -2
- data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +2 -2
- data/lib/x_twitter_scraper/models/x/users/follow_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/users/follow_create_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/users/follow_delete_all_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/users/follow_delete_all_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb +469 -52
- data/lib/x_twitter_scraper/models/x/x_account.rb +7 -7
- data/lib/x_twitter_scraper/models/x/x_account_detail.rb +1 -1
- data/lib/x_twitter_scraper/resources/compose.rb +8 -26
- data/lib/x_twitter_scraper/resources/credits.rb +1 -1
- data/lib/x_twitter_scraper/resources/extractions.rb +4 -4
- data/lib/x_twitter_scraper/resources/guest_wallets.rb +2 -2
- data/lib/x_twitter_scraper/resources/monitors/keywords.rb +4 -5
- data/lib/x_twitter_scraper/resources/monitors.rb +3 -3
- data/lib/x_twitter_scraper/resources/support/tickets.rb +24 -8
- data/lib/x_twitter_scraper/resources/trends.rb +1 -1
- data/lib/x_twitter_scraper/resources/x/communities/join.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/communities.rb +25 -11
- data/lib/x_twitter_scraper/resources/x/dm.rb +13 -6
- data/lib/x_twitter_scraper/resources/x/media.rb +17 -7
- data/lib/x_twitter_scraper/resources/x/profile.rb +46 -17
- data/lib/x_twitter_scraper/resources/x/tweets/like.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/tweets/retweet.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/tweets.rb +31 -16
- data/lib/x_twitter_scraper/resources/x/users/follow.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/users.rb +16 -9
- data/lib/x_twitter_scraper/resources/x.rb +1 -2
- data/lib/x_twitter_scraper/version.rb +1 -1
- data/rbi/x_twitter_scraper/client.rbi +1 -1
- data/rbi/x_twitter_scraper/models/account_retrieve_response.rbi +4 -4
- data/rbi/x_twitter_scraper/models/compose_create_params.rbi +392 -215
- data/rbi/x_twitter_scraper/models/compose_create_response.rbi +537 -48
- data/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/error.rbi +379 -13
- data/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi +8 -8
- data/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi +87 -5
- data/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi +87 -5
- data/rbi/x_twitter_scraper/models/search_tweet.rbi +12 -12
- data/rbi/x_twitter_scraper/models/support/ticket_create_params.rbi +9 -1
- data/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi +113 -7
- data/rbi/x_twitter_scraper/models/support/ticket_reply_params.rbi +9 -1
- data/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi +113 -7
- data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +276 -5
- data/rbi/x_twitter_scraper/models/x/communities/join_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/communities/join_delete_all_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/community_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/community_create_response.rbi +1127 -5
- data/rbi/x_twitter_scraper/models/x/community_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/community_delete_response.rbi +1148 -3
- data/rbi/x_twitter_scraper/models/x/dm_send_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/dm_send_response.rbi +1112 -6
- data/rbi/x_twitter_scraper/models/x/media_upload_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/media_upload_response.rbi +1124 -9
- data/rbi/x_twitter_scraper/models/x/profile_update_avatar_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/profile_update_avatar_response.rbi +1152 -3
- data/rbi/x_twitter_scraper/models/x/profile_update_banner_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/profile_update_banner_response.rbi +1152 -3
- data/rbi/x_twitter_scraper/models/x/profile_update_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/profile_update_response.rbi +1144 -3
- data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +3 -13
- data/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi +5 -8
- data/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi +1108 -14
- data/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweet_delete_response.rbi +1140 -3
- data/rbi/x_twitter_scraper/models/x/tweets/like_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/like_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/tweets/like_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/like_delete_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi +1152 -3
- data/rbi/x_twitter_scraper/models/x/user_retrieve_following_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/x/users/follow_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/users/follow_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/users/follow_delete_all_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/users/follow_delete_all_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi +930 -66
- data/rbi/x_twitter_scraper/models/x/x_account.rbi +9 -9
- data/rbi/x_twitter_scraper/models/x/x_account_detail.rbi +1 -1
- data/rbi/x_twitter_scraper/resources/compose.rbi +12 -38
- data/rbi/x_twitter_scraper/resources/credits.rbi +1 -1
- data/rbi/x_twitter_scraper/resources/extractions.rbi +4 -4
- data/rbi/x_twitter_scraper/resources/guest_wallets.rbi +2 -2
- data/rbi/x_twitter_scraper/resources/monitors/keywords.rbi +4 -5
- data/rbi/x_twitter_scraper/resources/monitors.rbi +3 -3
- data/rbi/x_twitter_scraper/resources/support/tickets.rbi +17 -2
- data/rbi/x_twitter_scraper/resources/trends.rbi +1 -1
- data/rbi/x_twitter_scraper/resources/x/communities/join.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/communities.rbi +19 -7
- data/rbi/x_twitter_scraper/resources/x/dm.rbi +10 -3
- data/rbi/x_twitter_scraper/resources/x/media.rbi +9 -4
- data/rbi/x_twitter_scraper/resources/x/profile.rbi +27 -8
- data/rbi/x_twitter_scraper/resources/x/tweets/like.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/tweets.rbi +31 -12
- data/rbi/x_twitter_scraper/resources/x/users/follow.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/users.rbi +13 -7
- data/rbi/x_twitter_scraper/resources/x.rbi +1 -2
- data/sig/x_twitter_scraper/models/compose_create_params.rbs +150 -90
- data/sig/x_twitter_scraper/models/compose_create_response.rbs +249 -27
- data/sig/x_twitter_scraper/models/error.rbs +170 -7
- data/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs +35 -5
- data/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs +35 -5
- data/sig/x_twitter_scraper/models/support/ticket_create_params.rbs +7 -1
- data/sig/x_twitter_scraper/models/support/ticket_create_response.rbs +49 -5
- data/sig/x_twitter_scraper/models/support/ticket_reply_params.rbs +7 -1
- data/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs +49 -5
- data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +113 -2
- data/sig/x_twitter_scraper/models/x/communities/join_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/communities/join_delete_all_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/community_create_params.rbs +10 -1
- data/sig/x_twitter_scraper/models/x/community_create_response.rbs +528 -7
- data/sig/x_twitter_scraper/models/x/community_delete_params.rbs +10 -1
- data/sig/x_twitter_scraper/models/x/community_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/dm_send_params.rbs +5 -0
- data/sig/x_twitter_scraper/models/x/dm_send_response.rbs +539 -5
- data/sig/x_twitter_scraper/models/x/media_upload_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/media_upload_response.rbs +534 -7
- data/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/profile_update_avatar_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/profile_update_banner_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/profile_update_params.rbs +5 -0
- data/sig/x_twitter_scraper/models/x/profile_update_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweet_author.rbs +3 -11
- data/sig/x_twitter_scraper/models/x/tweet_create_params.rbs +4 -6
- data/sig/x_twitter_scraper/models/x/tweet_create_response.rbs +518 -11
- data/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweet_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/like_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/like_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/like_delete_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/like_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/retweet_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/retweet_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/users/follow_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/users/follow_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/users/follow_delete_all_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/users/follow_delete_all_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs +428 -54
- data/sig/x_twitter_scraper/resources/compose.rbs +2 -12
- data/sig/x_twitter_scraper/resources/support/tickets.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/communities/join.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/communities.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/dm.rbs +1 -0
- data/sig/x_twitter_scraper/resources/x/media.rbs +1 -0
- data/sig/x_twitter_scraper/resources/x/profile.rbs +3 -0
- data/sig/x_twitter_scraper/resources/x/tweets/like.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/tweets.rbs +2 -1
- data/sig/x_twitter_scraper/resources/x/users/follow.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/users.rbs +1 -0
- metadata +17 -26
|
@@ -14,150 +14,40 @@ module XTwitterScraper
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
# Workflow step
|
|
18
|
-
sig { returns(XTwitterScraper::ComposeCreateParams::Step::OrSymbol) }
|
|
19
|
-
attr_accessor :step
|
|
20
|
-
|
|
21
|
-
# Extra context or URLs (refine)
|
|
22
|
-
sig { returns(T.nilable(String)) }
|
|
23
|
-
attr_reader :additional_context
|
|
24
|
-
|
|
25
|
-
sig { params(additional_context: String).void }
|
|
26
|
-
attr_writer :additional_context
|
|
27
|
-
|
|
28
|
-
# Desired call to action (refine)
|
|
29
|
-
sig { returns(T.nilable(String)) }
|
|
30
|
-
attr_reader :call_to_action
|
|
31
|
-
|
|
32
|
-
sig { params(call_to_action: String).void }
|
|
33
|
-
attr_writer :call_to_action
|
|
34
|
-
|
|
35
|
-
# Tweet draft text to evaluate (score)
|
|
36
|
-
sig { returns(T.nilable(String)) }
|
|
37
|
-
attr_reader :draft
|
|
38
|
-
|
|
39
|
-
sig { params(draft: String).void }
|
|
40
|
-
attr_writer :draft
|
|
41
|
-
|
|
42
|
-
# Optimization goal
|
|
43
|
-
sig do
|
|
44
|
-
returns(T.nilable(XTwitterScraper::ComposeCreateParams::Goal::OrSymbol))
|
|
45
|
-
end
|
|
46
|
-
attr_reader :goal
|
|
47
|
-
|
|
48
|
-
sig do
|
|
49
|
-
params(goal: XTwitterScraper::ComposeCreateParams::Goal::OrSymbol).void
|
|
50
|
-
end
|
|
51
|
-
attr_writer :goal
|
|
52
|
-
|
|
53
|
-
# Whether a link is attached (score)
|
|
54
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
55
|
-
attr_reader :has_link
|
|
56
|
-
|
|
57
|
-
sig { params(has_link: T::Boolean).void }
|
|
58
|
-
attr_writer :has_link
|
|
59
|
-
|
|
60
|
-
# Whether media is attached (score)
|
|
61
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
62
|
-
attr_reader :has_media
|
|
63
|
-
|
|
64
|
-
sig { params(has_media: T::Boolean).void }
|
|
65
|
-
attr_writer :has_media
|
|
66
|
-
|
|
67
|
-
# Media type (refine)
|
|
68
17
|
sig do
|
|
69
18
|
returns(
|
|
70
|
-
T.
|
|
19
|
+
T.any(
|
|
20
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest,
|
|
21
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest,
|
|
22
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest
|
|
23
|
+
)
|
|
71
24
|
)
|
|
72
25
|
end
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
sig do
|
|
76
|
-
params(
|
|
77
|
-
media_type: XTwitterScraper::ComposeCreateParams::MediaType::OrSymbol
|
|
78
|
-
).void
|
|
79
|
-
end
|
|
80
|
-
attr_writer :media_type
|
|
81
|
-
|
|
82
|
-
# Cached style username for voice matching (compose)
|
|
83
|
-
sig { returns(T.nilable(String)) }
|
|
84
|
-
attr_reader :style_username
|
|
85
|
-
|
|
86
|
-
sig { params(style_username: String).void }
|
|
87
|
-
attr_writer :style_username
|
|
88
|
-
|
|
89
|
-
# Desired tone (refine)
|
|
90
|
-
sig { returns(T.nilable(String)) }
|
|
91
|
-
attr_reader :tone
|
|
92
|
-
|
|
93
|
-
sig { params(tone: String).void }
|
|
94
|
-
attr_writer :tone
|
|
95
|
-
|
|
96
|
-
# Tweet topic (compose, refine)
|
|
97
|
-
sig { returns(T.nilable(String)) }
|
|
98
|
-
attr_reader :topic
|
|
99
|
-
|
|
100
|
-
sig { params(topic: String).void }
|
|
101
|
-
attr_writer :topic
|
|
26
|
+
attr_accessor :body
|
|
102
27
|
|
|
103
28
|
sig do
|
|
104
29
|
params(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
has_media: T::Boolean,
|
|
112
|
-
media_type: XTwitterScraper::ComposeCreateParams::MediaType::OrSymbol,
|
|
113
|
-
style_username: String,
|
|
114
|
-
tone: String,
|
|
115
|
-
topic: String,
|
|
30
|
+
body:
|
|
31
|
+
T.any(
|
|
32
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::OrHash,
|
|
33
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::OrHash,
|
|
34
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest::OrHash
|
|
35
|
+
),
|
|
116
36
|
request_options: XTwitterScraper::RequestOptions::OrHash
|
|
117
37
|
).returns(T.attached_class)
|
|
118
38
|
end
|
|
119
|
-
def self.new(
|
|
120
|
-
# Workflow step
|
|
121
|
-
step:,
|
|
122
|
-
# Extra context or URLs (refine)
|
|
123
|
-
additional_context: nil,
|
|
124
|
-
# Desired call to action (refine)
|
|
125
|
-
call_to_action: nil,
|
|
126
|
-
# Tweet draft text to evaluate (score)
|
|
127
|
-
draft: nil,
|
|
128
|
-
# Optimization goal
|
|
129
|
-
goal: nil,
|
|
130
|
-
# Whether a link is attached (score)
|
|
131
|
-
has_link: nil,
|
|
132
|
-
# Whether media is attached (score)
|
|
133
|
-
has_media: nil,
|
|
134
|
-
# Media type (refine)
|
|
135
|
-
media_type: nil,
|
|
136
|
-
# Cached style username for voice matching (compose)
|
|
137
|
-
style_username: nil,
|
|
138
|
-
# Desired tone (refine)
|
|
139
|
-
tone: nil,
|
|
140
|
-
# Tweet topic (compose, refine)
|
|
141
|
-
topic: nil,
|
|
142
|
-
request_options: {}
|
|
143
|
-
)
|
|
39
|
+
def self.new(body:, request_options: {})
|
|
144
40
|
end
|
|
145
41
|
|
|
146
42
|
sig do
|
|
147
43
|
override.returns(
|
|
148
44
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
has_media: T::Boolean,
|
|
156
|
-
media_type:
|
|
157
|
-
XTwitterScraper::ComposeCreateParams::MediaType::OrSymbol,
|
|
158
|
-
style_username: String,
|
|
159
|
-
tone: String,
|
|
160
|
-
topic: String,
|
|
45
|
+
body:
|
|
46
|
+
T.any(
|
|
47
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest,
|
|
48
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest,
|
|
49
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest
|
|
50
|
+
),
|
|
161
51
|
request_options: XTwitterScraper::RequestOptions
|
|
162
52
|
}
|
|
163
53
|
)
|
|
@@ -165,115 +55,402 @@ module XTwitterScraper
|
|
|
165
55
|
def to_hash
|
|
166
56
|
end
|
|
167
57
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
extend XTwitterScraper::Internal::Type::Enum
|
|
58
|
+
module Body
|
|
59
|
+
extend XTwitterScraper::Internal::Type::Union
|
|
171
60
|
|
|
172
|
-
|
|
61
|
+
Variants =
|
|
173
62
|
T.type_alias do
|
|
174
|
-
T.
|
|
63
|
+
T.any(
|
|
64
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest,
|
|
65
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest,
|
|
66
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest
|
|
67
|
+
)
|
|
175
68
|
end
|
|
176
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
177
69
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
70
|
+
class ComposePrepareRequest < XTwitterScraper::Internal::Type::BaseModel
|
|
71
|
+
OrHash =
|
|
72
|
+
T.type_alias do
|
|
73
|
+
T.any(
|
|
74
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest,
|
|
75
|
+
XTwitterScraper::Internal::AnyHash
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
sig { returns(Symbol) }
|
|
80
|
+
attr_accessor :step
|
|
81
|
+
|
|
82
|
+
# Subject for the post.
|
|
83
|
+
sig { returns(String) }
|
|
84
|
+
attr_accessor :topic
|
|
85
|
+
|
|
86
|
+
# Editorial goal used to order the rules and questions.
|
|
87
|
+
sig do
|
|
88
|
+
returns(
|
|
89
|
+
T.nilable(
|
|
90
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::OrSymbol
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
attr_reader :goal
|
|
193
95
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
96
|
+
sig do
|
|
97
|
+
params(
|
|
98
|
+
goal:
|
|
99
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::OrSymbol
|
|
100
|
+
).void
|
|
101
|
+
end
|
|
102
|
+
attr_writer :goal
|
|
103
|
+
|
|
104
|
+
# Username from a style analysis saved to this account.
|
|
105
|
+
sig { returns(T.nilable(String)) }
|
|
106
|
+
attr_reader :style_username
|
|
107
|
+
|
|
108
|
+
sig { params(style_username: String).void }
|
|
109
|
+
attr_writer :style_username
|
|
110
|
+
|
|
111
|
+
sig do
|
|
112
|
+
params(
|
|
113
|
+
topic: String,
|
|
114
|
+
goal:
|
|
115
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::OrSymbol,
|
|
116
|
+
style_username: String,
|
|
117
|
+
step: Symbol
|
|
118
|
+
).returns(T.attached_class)
|
|
119
|
+
end
|
|
120
|
+
def self.new(
|
|
121
|
+
# Subject for the post.
|
|
122
|
+
topic:,
|
|
123
|
+
# Editorial goal used to order the rules and questions.
|
|
124
|
+
goal: nil,
|
|
125
|
+
# Username from a style analysis saved to this account.
|
|
126
|
+
style_username: nil,
|
|
127
|
+
step: :compose
|
|
197
128
|
)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
sig do
|
|
132
|
+
override.returns(
|
|
133
|
+
{
|
|
134
|
+
step: Symbol,
|
|
135
|
+
topic: String,
|
|
136
|
+
goal:
|
|
137
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::OrSymbol,
|
|
138
|
+
style_username: String
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
def to_hash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Editorial goal used to order the rules and questions.
|
|
146
|
+
module Goal
|
|
147
|
+
extend XTwitterScraper::Internal::Type::Enum
|
|
148
|
+
|
|
149
|
+
TaggedSymbol =
|
|
150
|
+
T.type_alias do
|
|
151
|
+
T.all(
|
|
152
|
+
Symbol,
|
|
153
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
157
|
+
|
|
158
|
+
ENGAGEMENT =
|
|
159
|
+
T.let(
|
|
160
|
+
:engagement,
|
|
161
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::TaggedSymbol
|
|
162
|
+
)
|
|
163
|
+
FOLLOWERS =
|
|
164
|
+
T.let(
|
|
165
|
+
:followers,
|
|
166
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::TaggedSymbol
|
|
167
|
+
)
|
|
168
|
+
AUTHORITY =
|
|
169
|
+
T.let(
|
|
170
|
+
:authority,
|
|
171
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::TaggedSymbol
|
|
172
|
+
)
|
|
173
|
+
CONVERSATION =
|
|
174
|
+
T.let(
|
|
175
|
+
:conversation,
|
|
176
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::TaggedSymbol
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
sig do
|
|
180
|
+
override.returns(
|
|
181
|
+
T::Array[
|
|
182
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest::Goal::TaggedSymbol
|
|
183
|
+
]
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
def self.values
|
|
187
|
+
end
|
|
188
|
+
end
|
|
198
189
|
end
|
|
199
|
-
def self.values
|
|
200
|
-
end
|
|
201
|
-
end
|
|
202
190
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
191
|
+
class ComposeRefineRequest < XTwitterScraper::Internal::Type::BaseModel
|
|
192
|
+
OrHash =
|
|
193
|
+
T.type_alias do
|
|
194
|
+
T.any(
|
|
195
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest,
|
|
196
|
+
XTwitterScraper::Internal::AnyHash
|
|
197
|
+
)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Editorial goal for the guidance.
|
|
201
|
+
sig do
|
|
202
|
+
returns(
|
|
203
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::OrSymbol
|
|
204
|
+
)
|
|
205
|
+
end
|
|
206
|
+
attr_accessor :goal
|
|
206
207
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
sig { returns(Symbol) }
|
|
209
|
+
attr_accessor :step
|
|
210
|
+
|
|
211
|
+
# Requested writing tone.
|
|
212
|
+
sig { returns(String) }
|
|
213
|
+
attr_accessor :tone
|
|
214
|
+
|
|
215
|
+
# Subject for the post.
|
|
216
|
+
sig { returns(String) }
|
|
217
|
+
attr_accessor :topic
|
|
218
|
+
|
|
219
|
+
# Audience, constraints, sources, or other writing context.
|
|
220
|
+
sig { returns(T.nilable(String)) }
|
|
221
|
+
attr_reader :additional_context
|
|
222
|
+
|
|
223
|
+
sig { params(additional_context: String).void }
|
|
224
|
+
attr_writer :additional_context
|
|
225
|
+
|
|
226
|
+
# Specific action the draft should request.
|
|
227
|
+
sig { returns(T.nilable(String)) }
|
|
228
|
+
attr_reader :call_to_action
|
|
229
|
+
|
|
230
|
+
sig { params(call_to_action: String).void }
|
|
231
|
+
attr_writer :call_to_action
|
|
232
|
+
|
|
233
|
+
# Planned media type.
|
|
234
|
+
sig do
|
|
235
|
+
returns(
|
|
236
|
+
T.nilable(
|
|
237
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::OrSymbol
|
|
238
|
+
)
|
|
239
|
+
)
|
|
210
240
|
end
|
|
211
|
-
|
|
241
|
+
attr_reader :media_type
|
|
212
242
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
243
|
+
sig do
|
|
244
|
+
params(
|
|
245
|
+
media_type:
|
|
246
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::OrSymbol
|
|
247
|
+
).void
|
|
248
|
+
end
|
|
249
|
+
attr_writer :media_type
|
|
250
|
+
|
|
251
|
+
sig do
|
|
252
|
+
params(
|
|
253
|
+
goal:
|
|
254
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::OrSymbol,
|
|
255
|
+
tone: String,
|
|
256
|
+
topic: String,
|
|
257
|
+
additional_context: String,
|
|
258
|
+
call_to_action: String,
|
|
259
|
+
media_type:
|
|
260
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::OrSymbol,
|
|
261
|
+
step: Symbol
|
|
262
|
+
).returns(T.attached_class)
|
|
263
|
+
end
|
|
264
|
+
def self.new(
|
|
265
|
+
# Editorial goal for the guidance.
|
|
266
|
+
goal:,
|
|
267
|
+
# Requested writing tone.
|
|
268
|
+
tone:,
|
|
269
|
+
# Subject for the post.
|
|
270
|
+
topic:,
|
|
271
|
+
# Audience, constraints, sources, or other writing context.
|
|
272
|
+
additional_context: nil,
|
|
273
|
+
# Specific action the draft should request.
|
|
274
|
+
call_to_action: nil,
|
|
275
|
+
# Planned media type.
|
|
276
|
+
media_type: nil,
|
|
277
|
+
step: :refine
|
|
232
278
|
)
|
|
279
|
+
end
|
|
233
280
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
281
|
+
sig do
|
|
282
|
+
override.returns(
|
|
283
|
+
{
|
|
284
|
+
goal:
|
|
285
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::OrSymbol,
|
|
286
|
+
step: Symbol,
|
|
287
|
+
tone: String,
|
|
288
|
+
topic: String,
|
|
289
|
+
additional_context: String,
|
|
290
|
+
call_to_action: String,
|
|
291
|
+
media_type:
|
|
292
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::OrSymbol
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
end
|
|
296
|
+
def to_hash
|
|
297
|
+
end
|
|
242
298
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
299
|
+
# Editorial goal for the guidance.
|
|
300
|
+
module Goal
|
|
301
|
+
extend XTwitterScraper::Internal::Type::Enum
|
|
302
|
+
|
|
303
|
+
TaggedSymbol =
|
|
304
|
+
T.type_alias do
|
|
305
|
+
T.all(
|
|
306
|
+
Symbol,
|
|
307
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal
|
|
308
|
+
)
|
|
309
|
+
end
|
|
310
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
311
|
+
|
|
312
|
+
ENGAGEMENT =
|
|
313
|
+
T.let(
|
|
314
|
+
:engagement,
|
|
315
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::TaggedSymbol
|
|
316
|
+
)
|
|
317
|
+
FOLLOWERS =
|
|
318
|
+
T.let(
|
|
319
|
+
:followers,
|
|
320
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::TaggedSymbol
|
|
321
|
+
)
|
|
322
|
+
AUTHORITY =
|
|
323
|
+
T.let(
|
|
324
|
+
:authority,
|
|
325
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::TaggedSymbol
|
|
326
|
+
)
|
|
327
|
+
CONVERSATION =
|
|
328
|
+
T.let(
|
|
329
|
+
:conversation,
|
|
330
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::TaggedSymbol
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
sig do
|
|
334
|
+
override.returns(
|
|
335
|
+
T::Array[
|
|
336
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::Goal::TaggedSymbol
|
|
337
|
+
]
|
|
338
|
+
)
|
|
339
|
+
end
|
|
340
|
+
def self.values
|
|
341
|
+
end
|
|
342
|
+
end
|
|
246
343
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
344
|
+
# Planned media type.
|
|
345
|
+
module MediaType
|
|
346
|
+
extend XTwitterScraper::Internal::Type::Enum
|
|
347
|
+
|
|
348
|
+
TaggedSymbol =
|
|
349
|
+
T.type_alias do
|
|
350
|
+
T.all(
|
|
351
|
+
Symbol,
|
|
352
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType
|
|
353
|
+
)
|
|
354
|
+
end
|
|
355
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
356
|
+
|
|
357
|
+
PHOTO =
|
|
358
|
+
T.let(
|
|
359
|
+
:photo,
|
|
360
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::TaggedSymbol
|
|
361
|
+
)
|
|
362
|
+
VIDEO =
|
|
363
|
+
T.let(
|
|
364
|
+
:video,
|
|
365
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::TaggedSymbol
|
|
366
|
+
)
|
|
367
|
+
NONE =
|
|
368
|
+
T.let(
|
|
369
|
+
:none,
|
|
370
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::TaggedSymbol
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
sig do
|
|
374
|
+
override.returns(
|
|
375
|
+
T::Array[
|
|
376
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest::MediaType::TaggedSymbol
|
|
377
|
+
]
|
|
378
|
+
)
|
|
379
|
+
end
|
|
380
|
+
def self.values
|
|
381
|
+
end
|
|
250
382
|
end
|
|
251
|
-
|
|
383
|
+
end
|
|
252
384
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
385
|
+
class ComposeScoreRequest < XTwitterScraper::Internal::Type::BaseModel
|
|
386
|
+
OrHash =
|
|
387
|
+
T.type_alias do
|
|
388
|
+
T.any(
|
|
389
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest,
|
|
390
|
+
XTwitterScraper::Internal::AnyHash
|
|
391
|
+
)
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# Full post text for deterministic editorial checks.
|
|
395
|
+
sig { returns(String) }
|
|
396
|
+
attr_accessor :draft
|
|
397
|
+
|
|
398
|
+
sig { returns(Symbol) }
|
|
399
|
+
attr_accessor :step
|
|
400
|
+
|
|
401
|
+
# True when a separate link card is attached.
|
|
402
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
403
|
+
attr_reader :has_link
|
|
404
|
+
|
|
405
|
+
sig { params(has_link: T::Boolean).void }
|
|
406
|
+
attr_writer :has_link
|
|
407
|
+
|
|
408
|
+
# Accepted for backward compatibility. Text checks ignore this field.
|
|
409
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
410
|
+
attr_reader :has_media
|
|
411
|
+
|
|
412
|
+
sig { params(has_media: T::Boolean).void }
|
|
413
|
+
attr_writer :has_media
|
|
414
|
+
|
|
415
|
+
sig do
|
|
416
|
+
params(
|
|
417
|
+
draft: String,
|
|
418
|
+
has_link: T::Boolean,
|
|
419
|
+
has_media: T::Boolean,
|
|
420
|
+
step: Symbol
|
|
421
|
+
).returns(T.attached_class)
|
|
422
|
+
end
|
|
423
|
+
def self.new(
|
|
424
|
+
# Full post text for deterministic editorial checks.
|
|
425
|
+
draft:,
|
|
426
|
+
# True when a separate link card is attached.
|
|
427
|
+
has_link: nil,
|
|
428
|
+
# Accepted for backward compatibility. Text checks ignore this field.
|
|
429
|
+
has_media: nil,
|
|
430
|
+
step: :score
|
|
267
431
|
)
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
sig do
|
|
435
|
+
override.returns(
|
|
436
|
+
{
|
|
437
|
+
draft: String,
|
|
438
|
+
step: Symbol,
|
|
439
|
+
has_link: T::Boolean,
|
|
440
|
+
has_media: T::Boolean
|
|
441
|
+
}
|
|
442
|
+
)
|
|
443
|
+
end
|
|
444
|
+
def to_hash
|
|
445
|
+
end
|
|
446
|
+
end
|
|
268
447
|
|
|
269
448
|
sig do
|
|
270
449
|
override.returns(
|
|
271
|
-
T::Array[
|
|
272
|
-
XTwitterScraper::ComposeCreateParams::MediaType::TaggedSymbol
|
|
273
|
-
]
|
|
450
|
+
T::Array[XTwitterScraper::ComposeCreateParams::Body::Variants]
|
|
274
451
|
)
|
|
275
452
|
end
|
|
276
|
-
def self.
|
|
453
|
+
def self.variants
|
|
277
454
|
end
|
|
278
455
|
end
|
|
279
456
|
end
|