x-twitter-scraper 0.5.5 → 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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/lib/x_twitter_scraper/models/compose_create_response.rb +62 -1
  5. data/lib/x_twitter_scraper/models/radar_item.rb +144 -7
  6. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rb +22 -0
  7. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +190 -0
  8. data/lib/x_twitter_scraper/models/x/account_create_params.rb +9 -9
  9. data/lib/x_twitter_scraper/models/x/account_create_response.rb +2 -57
  10. data/lib/x_twitter_scraper/models/x/account_reauth_params.rb +2 -2
  11. data/lib/x_twitter_scraper/models/x/x_account.rb +9 -9
  12. data/lib/x_twitter_scraper/resources/compose.rb +4 -4
  13. data/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +37 -0
  14. data/lib/x_twitter_scraper/resources/x/accounts.rb +6 -6
  15. data/lib/x_twitter_scraper/resources/x.rb +6 -0
  16. data/lib/x_twitter_scraper/version.rb +1 -1
  17. data/lib/x_twitter_scraper.rb +3 -0
  18. data/rbi/x_twitter_scraper/models/compose_create_response.rbi +142 -0
  19. data/rbi/x_twitter_scraper/models/radar_item.rbi +245 -8
  20. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rbi +40 -0
  21. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +317 -0
  22. data/rbi/x_twitter_scraper/models/x/account_create_params.rbi +8 -11
  23. data/rbi/x_twitter_scraper/models/x/account_create_response.rbi +2 -123
  24. data/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi +2 -2
  25. data/rbi/x_twitter_scraper/models/x/x_account.rbi +12 -12
  26. data/rbi/x_twitter_scraper/resources/compose.rbi +4 -4
  27. data/rbi/x_twitter_scraper/resources/x/account_connection_attempts.rbi +33 -0
  28. data/rbi/x_twitter_scraper/resources/x/accounts.rbi +5 -5
  29. data/rbi/x_twitter_scraper/resources/x.rbi +4 -0
  30. data/sig/x_twitter_scraper/models/compose_create_response.rbs +60 -0
  31. data/sig/x_twitter_scraper/models/radar_item.rbs +100 -4
  32. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rbs +25 -0
  33. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +182 -0
  34. data/sig/x_twitter_scraper/models/x/account_create_params.rbs +6 -8
  35. data/sig/x_twitter_scraper/models/x/account_create_response.rbs +1 -62
  36. data/sig/x_twitter_scraper/resources/x/account_connection_attempts.rbs +14 -0
  37. data/sig/x_twitter_scraper/resources/x/accounts.rbs +2 -2
  38. data/sig/x_twitter_scraper/resources/x.rbs +2 -0
  39. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 507ab6a6c95d37cb384e2f58798114aa6c6eb9e1b96f9e93b68a1b055505fe45
4
- data.tar.gz: df6cd93380b6b3879eab159fe27a9c93df488cf2f1909986d233a84aa5160bdb
3
+ metadata.gz: f77c7d16b32e28457098d4f022f31953508d3daa2c132fd88351825b689f6741
4
+ data.tar.gz: 5183d601d54d0a035443e1cafb2dceceb4278130a0a9674b128b39f91f6f6fca
5
5
  SHA512:
6
- metadata.gz: 9bdbb2173f56c8e71cd9b9706e6f91b56789aa6e51caf2c0ad0a91e67f20425b32c2dae8e2297ea6bf51de7e3f71263fe5c81237caf8477b094df7fc976c4a96
7
- data.tar.gz: 17ca5beb6af7e1d70495acd86fd58276ec22148a49afc03e79b6213ac79b73cb15cf7e2484985c58a409777583070e6e93ba3e684ba5133e8fc77b4b5b5b33ff
6
+ metadata.gz: 660c20843ae2f9af5cc1f8fb4a528949ff568a161b6da850cb0f25f38e12fcdc1c8880dc96b8b3313d9d9149a52fcf3e025bcdfc65b9a2fb252cadfee2acf887
7
+ data.tar.gz: 02cb56fce3643f7c066f819ce6f7e36c88537d67e7fb2424292af59fb5e0eb75c2536f24b5ec2528c319d5ba8d61ba42b9f6de9b3a553936a31f654207bbe510
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 (2026-07-29)
4
+
5
+ Full Changelog: [v0.5.7...v0.6.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.5.7...v0.6.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([d172abc](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/d172abc0808630d97fdf92e38903f60519a34ae1))
10
+ * **api:** api update ([7696e0c](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/7696e0cb8c594b5c71fe1813dc84012100afb3fc))
11
+
12
+ ## 0.5.7 (2026-07-28)
13
+
14
+ Full Changelog: [v0.5.6...v0.5.7](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.5.6...v0.5.7)
15
+
16
+ ### Chores
17
+
18
+ * **deps:** bump actions/checkout from 6.0.2 to 7.0.1 ([#22](https://github.com/Xquik-dev/x-twitter-scraper-ruby/issues/22)) ([6dac448](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/6dac44882cefffee705e4dbf465f03983ca4cdc4))
19
+ * **deps:** bump ruby/setup-ruby from 1.306.0 to 1.319.0 ([#23](https://github.com/Xquik-dev/x-twitter-scraper-ruby/issues/23)) ([d4137aa](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/d4137aadaaa8ac17c3b7bd425106b094951d9870))
20
+
21
+ ## 0.5.6 (2026-07-24)
22
+
23
+ Full Changelog: [v0.5.5...v0.5.6](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.5.5...v0.5.6)
24
+
3
25
  ## 0.5.5 (2026-07-24)
4
26
 
5
27
  Full Changelog: [v0.5.4...v0.5.5](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.5.4...v0.5.5)
data/README.md CHANGED
@@ -35,7 +35,7 @@ Add the gem to your `Gemfile`:
35
35
  <!-- x-release-please-start-version -->
36
36
 
37
37
  ```ruby
38
- gem "x-twitter-scraper", "~> 0.5.5"
38
+ gem "x-twitter-scraper", "~> 0.6.0"
39
39
  ```
40
40
 
41
41
  <!-- x-release-please-end -->
@@ -57,6 +57,14 @@ module XTwitterScraper
57
57
  # @return [String]
58
58
  required :next_step, String, api_name: :nextStep
59
59
 
60
+ # @!attribute radar_recommendations
61
+ # Sources and guidance for researching a fresh post angle.
62
+ #
63
+ # @return [Array<XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::RadarRecommendation>]
64
+ required :radar_recommendations,
65
+ -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::RadarRecommendation] },
66
+ api_name: :radarRecommendations
67
+
60
68
  # @!attribute scorer_weights
61
69
  # Published signal names with unpublished weights as null.
62
70
  #
@@ -97,7 +105,7 @@ module XTwitterScraper
97
105
  # @return [Array<String>, nil]
98
106
  optional :style_tweets, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :styleTweets
99
107
 
100
- # @!method initialize(content_rules:, engagement_multipliers:, engagement_velocity:, follow_up_questions:, intent_url:, next_step:, scorer_weights:, source:, top_penalties:, saved_styles: nil, style_note: nil, style_tweets: nil)
108
+ # @!method initialize(content_rules:, engagement_multipliers:, engagement_velocity:, follow_up_questions:, intent_url:, next_step:, radar_recommendations:, scorer_weights:, source:, top_penalties:, saved_styles: nil, style_note: nil, style_tweets: nil)
101
109
  # Some parameter documentations has been truncated, see
102
110
  # {XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult} for more
103
111
  # details.
@@ -114,6 +122,8 @@ module XTwitterScraper
114
122
  #
115
123
  # @param next_step [String]
116
124
  #
125
+ # @param radar_recommendations [Array<XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::RadarRecommendation>] Sources and guidance for researching a fresh post angle.
126
+ #
117
127
  # @param scorer_weights [Array<XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::ScorerWeight>] Published signal names with unpublished weights as null.
118
128
  #
119
129
  # @param source [String] Signal source and evidence limits.
@@ -154,6 +164,57 @@ module XTwitterScraper
154
164
  # @param multiplier [Symbol, :"Production weight not published by X"]
155
165
  end
156
166
 
167
+ class RadarRecommendation < XTwitterScraper::Internal::Type::BaseModel
168
+ # @!attribute endpoint
169
+ # Radar endpoint for this source.
170
+ #
171
+ # @return [String]
172
+ required :endpoint, String
173
+
174
+ # @!attribute guidance
175
+ # Source-specific drafting guidance.
176
+ #
177
+ # @return [String]
178
+ required :guidance, String
179
+
180
+ # @!attribute source
181
+ #
182
+ # @return [Symbol, XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::RadarRecommendation::Source]
183
+ required :source,
184
+ enum: -> { XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::RadarRecommendation::Source }
185
+
186
+ # @!attribute use_for
187
+ # Current-topic research this source supports.
188
+ #
189
+ # @return [String]
190
+ required :use_for, String, api_name: :useFor
191
+
192
+ # @!method initialize(endpoint:, guidance:, source:, use_for:)
193
+ # @param endpoint [String] Radar endpoint for this source.
194
+ #
195
+ # @param guidance [String] Source-specific drafting guidance.
196
+ #
197
+ # @param source [Symbol, XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::RadarRecommendation::Source]
198
+ #
199
+ # @param use_for [String] Current-topic research this source supports.
200
+
201
+ # @see XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult::RadarRecommendation#source
202
+ module Source
203
+ extend XTwitterScraper::Internal::Type::Enum
204
+
205
+ REDDIT = :reddit
206
+ GITHUB = :github
207
+ TRUSTMRR = :trustmrr
208
+ HACKER_NEWS = :hacker_news
209
+ GOOGLE_TRENDS = :google_trends
210
+ WIKIPEDIA = :wikipedia
211
+ POLYMARKET = :polymarket
212
+
213
+ # @!method self.values
214
+ # @return [Array<Symbol>]
215
+ end
216
+ end
217
+
157
218
  class ScorerWeight < XTwitterScraper::Internal::Type::BaseModel
158
219
  # @!attribute context
159
220
  # Signal direction and publication limit.
@@ -24,6 +24,7 @@ module XTwitterScraper
24
24
  required :created_at, Time, api_name: :createdAt
25
25
 
26
26
  # @!attribute language
27
+ # BCP-47 language code. und means the source did not identify a language.
27
28
  #
28
29
  # @return [String]
29
30
  required :language, String
@@ -31,7 +32,18 @@ module XTwitterScraper
31
32
  # @!attribute metadata
32
33
  # Source-specific fields. Shape varies per source:
33
34
  #
34
- # - reddit: { subreddit: string, author: string }
35
+ # - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
36
+ # sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
37
+ # numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
38
+ # postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
39
+ # editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
40
+ # isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
41
+ # isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
42
+ # public net score. Exact public upvote and downvote counts are not available.
43
+ # Estimated counts derive from the public score and upvote ratio, which Reddit
44
+ # may fuzz. Comment bodies are not included. Current items combine public
45
+ # listing discovery with server-rendered post data and use `sourceFormat: html`;
46
+ # `json` and `rss` remain for legacy rows.
35
47
  # - github: { starsToday: number }
36
48
  # - hacker_news: { points: number, numberComments: number }
37
49
  # - google_trends: { approxTraffic: number }
@@ -39,10 +51,15 @@ module XTwitterScraper
39
51
  # - wikipedia: { views: number }
40
52
  # - trustmrr: { mrr, growthPercent, last30Days, total, customers,
41
53
  # activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
42
- # growthMrrPercent?, multiple?, paymentProvider?, rank? }
54
+ # foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
55
+ # multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
56
+ # revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
57
+ # growth source, xHandle is the founder's X username without @. The rank field
58
+ # is the source's revenue rank. Result order represents reported 30-day
59
+ # revenue-growth rank.
43
60
  #
44
- # @return [Hash{Symbol=>Object}]
45
- required :metadata, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]
61
+ # @return [XTwitterScraper::Models::RadarItem::Metadata]
62
+ required :metadata, -> { XTwitterScraper::RadarItem::Metadata }
46
63
 
47
64
  # @!attribute published_at
48
65
  #
@@ -81,6 +98,7 @@ module XTwitterScraper
81
98
  optional :description, String
82
99
 
83
100
  # @!attribute image_url
101
+ # Source image. Startup growth items return the logo here.
84
102
  #
85
103
  # @return [String, nil]
86
104
  optional :image_url, String, api_name: :imageUrl
@@ -103,9 +121,9 @@ module XTwitterScraper
103
121
  #
104
122
  # @param created_at [Time]
105
123
  #
106
- # @param language [String]
124
+ # @param language [String] BCP-47 language code. und means the source did not identify a language.
107
125
  #
108
- # @param metadata [Hash{Symbol=>Object}] Source-specific fields. Shape varies per source:
126
+ # @param metadata [XTwitterScraper::Models::RadarItem::Metadata] Source-specific fields. Shape varies per source:
109
127
  #
110
128
  # @param published_at [Time]
111
129
  #
@@ -121,7 +139,7 @@ module XTwitterScraper
121
139
  #
122
140
  # @param description [String]
123
141
  #
124
- # @param image_url [String]
142
+ # @param image_url [String] Source image. Startup growth items return the logo here.
125
143
  #
126
144
  # @param url [String]
127
145
 
@@ -142,6 +160,125 @@ module XTwitterScraper
142
160
  # @return [Array<Symbol>]
143
161
  end
144
162
 
163
+ # @see XTwitterScraper::Models::RadarItem#metadata
164
+ class Metadata < XTwitterScraper::Internal::Type::BaseModel
165
+ # @!attribute author
166
+ #
167
+ # @return [String, nil]
168
+ optional :author, String
169
+
170
+ # @!attribute content_url
171
+ #
172
+ # @return [String, nil]
173
+ optional :content_url, String, api_name: :contentUrl
174
+
175
+ # @!attribute estimated_downvotes
176
+ #
177
+ # @return [Integer, nil]
178
+ optional :estimated_downvotes, Integer, api_name: :estimatedDownvotes
179
+
180
+ # @!attribute estimated_upvotes
181
+ #
182
+ # @return [Integer, nil]
183
+ optional :estimated_upvotes, Integer, api_name: :estimatedUpvotes
184
+
185
+ # @!attribute number_comments
186
+ #
187
+ # @return [Integer, nil]
188
+ optional :number_comments, Integer, api_name: :numberComments
189
+
190
+ # @!attribute score
191
+ #
192
+ # @return [Integer, nil]
193
+ optional :score, Integer
194
+
195
+ # @!attribute selftext
196
+ #
197
+ # @return [String, nil]
198
+ optional :selftext, String
199
+
200
+ # @!attribute source_format
201
+ # Current items use html. json and rss are retained for legacy rows.
202
+ #
203
+ # @return [Symbol, XTwitterScraper::Models::RadarItem::Metadata::SourceFormat, nil]
204
+ optional :source_format,
205
+ enum: -> { XTwitterScraper::RadarItem::Metadata::SourceFormat },
206
+ api_name: :sourceFormat
207
+
208
+ # @!attribute subreddit
209
+ #
210
+ # @return [String, nil]
211
+ optional :subreddit, String
212
+
213
+ # @!attribute upvote_ratio
214
+ #
215
+ # @return [Float, nil]
216
+ optional :upvote_ratio, Float, api_name: :upvoteRatio
217
+
218
+ # @!method initialize(author: nil, content_url: nil, estimated_downvotes: nil, estimated_upvotes: nil, number_comments: nil, score: nil, selftext: nil, source_format: nil, subreddit: nil, upvote_ratio: nil)
219
+ # Source-specific fields. Shape varies per source:
220
+ #
221
+ # - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
222
+ # sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
223
+ # numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
224
+ # postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
225
+ # editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
226
+ # isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
227
+ # isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
228
+ # public net score. Exact public upvote and downvote counts are not available.
229
+ # Estimated counts derive from the public score and upvote ratio, which Reddit
230
+ # may fuzz. Comment bodies are not included. Current items combine public
231
+ # listing discovery with server-rendered post data and use `sourceFormat: html`;
232
+ # `json` and `rss` remain for legacy rows.
233
+ # - github: { starsToday: number }
234
+ # - hacker_news: { points: number, numberComments: number }
235
+ # - google_trends: { approxTraffic: number }
236
+ # - polymarket: { volume24hr: number }
237
+ # - wikipedia: { views: number }
238
+ # - trustmrr: { mrr, growthPercent, last30Days, total, customers,
239
+ # activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
240
+ # foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
241
+ # multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
242
+ # revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
243
+ # growth source, xHandle is the founder's X username without @. The rank field
244
+ # is the source's revenue rank. Result order represents reported 30-day
245
+ # revenue-growth rank.
246
+ #
247
+ # @param author [String]
248
+ #
249
+ # @param content_url [String]
250
+ #
251
+ # @param estimated_downvotes [Integer]
252
+ #
253
+ # @param estimated_upvotes [Integer]
254
+ #
255
+ # @param number_comments [Integer]
256
+ #
257
+ # @param score [Integer]
258
+ #
259
+ # @param selftext [String]
260
+ #
261
+ # @param source_format [Symbol, XTwitterScraper::Models::RadarItem::Metadata::SourceFormat] Current items use html. json and rss are retained for legacy rows.
262
+ #
263
+ # @param subreddit [String]
264
+ #
265
+ # @param upvote_ratio [Float]
266
+
267
+ # Current items use html. json and rss are retained for legacy rows.
268
+ #
269
+ # @see XTwitterScraper::Models::RadarItem::Metadata#source_format
270
+ module SourceFormat
271
+ extend XTwitterScraper::Internal::Type::Enum
272
+
273
+ HTML = :html
274
+ JSON = :json
275
+ RSS = :rss
276
+
277
+ # @!method self.values
278
+ # @return [Array<Symbol>]
279
+ end
280
+ end
281
+
145
282
  # @see XTwitterScraper::Models::RadarItem#source
146
283
  module Source
147
284
  extend XTwitterScraper::Internal::Type::Enum
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module XTwitterScraper
4
+ module Models
5
+ module X
6
+ # @see XTwitterScraper::Resources::X::AccountConnectionAttempts#retrieve
7
+ class AccountConnectionAttemptRetrieveParams < XTwitterScraper::Internal::Type::BaseModel
8
+ extend XTwitterScraper::Internal::Type::RequestParameters::Converter
9
+ include XTwitterScraper::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!method initialize(id:, request_options: {})
17
+ # @param id [String]
18
+ # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,190 @@
1
+ # frozen_string_literal: true
2
+
3
+ module XTwitterScraper
4
+ module Models
5
+ module X
6
+ # The connection is still in progress.
7
+ #
8
+ # @see XTwitterScraper::Resources::X::AccountConnectionAttempts#retrieve
9
+ module AccountConnectionAttemptRetrieveResponse
10
+ extend XTwitterScraper::Internal::Type::Union
11
+
12
+ # The connection is still in progress.
13
+ variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending }
14
+
15
+ # The account connected successfully.
16
+ variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess }
17
+
18
+ # The connection reached a final failure.
19
+ variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed }
20
+
21
+ # Resumable account connection challenge. Submit the email code to finish the same connection attempt.
22
+ variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge }
23
+
24
+ class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel
25
+ # @!attribute id
26
+ #
27
+ # @return [String]
28
+ required :id, String
29
+
30
+ # @!attribute object
31
+ #
32
+ # @return [Symbol, :x_account_connection_attempt]
33
+ required :object, const: :x_account_connection_attempt
34
+
35
+ # @!attribute poll_after_ms
36
+ #
37
+ # @return [Integer]
38
+ required :poll_after_ms, Integer, api_name: :pollAfterMs
39
+
40
+ # @!attribute status
41
+ #
42
+ # @return [Symbol, :pending]
43
+ required :status, const: :pending
44
+
45
+ # @!method initialize(id:, poll_after_ms:, object: :x_account_connection_attempt, status: :pending)
46
+ # The connection is still in progress.
47
+ #
48
+ # @param id [String]
49
+ # @param poll_after_ms [Integer]
50
+ # @param object [Symbol, :x_account_connection_attempt]
51
+ # @param status [Symbol, :pending]
52
+ end
53
+
54
+ class XAccountConnectionAttemptSuccess < XTwitterScraper::Internal::Type::BaseModel
55
+ # @!attribute id
56
+ #
57
+ # @return [String]
58
+ required :id, String
59
+
60
+ # @!attribute object
61
+ #
62
+ # @return [Symbol, :x_account_connection_attempt]
63
+ required :object, const: :x_account_connection_attempt
64
+
65
+ # @!attribute status
66
+ #
67
+ # @return [Symbol, :success]
68
+ required :status, const: :success
69
+
70
+ # @!method initialize(id:, object: :x_account_connection_attempt, status: :success)
71
+ # The account connected successfully.
72
+ #
73
+ # @param id [String]
74
+ # @param object [Symbol, :x_account_connection_attempt]
75
+ # @param status [Symbol, :success]
76
+ end
77
+
78
+ class XAccountConnectionAttemptFailed < XTwitterScraper::Internal::Type::BaseModel
79
+ # @!attribute id
80
+ #
81
+ # @return [String]
82
+ required :id, String
83
+
84
+ # @!attribute error
85
+ #
86
+ # @return [String]
87
+ required :error, String
88
+
89
+ # @!attribute object
90
+ #
91
+ # @return [Symbol, :x_account_connection_attempt]
92
+ required :object, const: :x_account_connection_attempt
93
+
94
+ # @!attribute retryable
95
+ #
96
+ # @return [Boolean]
97
+ required :retryable, XTwitterScraper::Internal::Type::Boolean
98
+
99
+ # @!attribute status
100
+ #
101
+ # @return [Symbol, :failed]
102
+ required :status, const: :failed
103
+
104
+ # @!attribute reason
105
+ #
106
+ # @return [String, nil]
107
+ optional :reason, String
108
+
109
+ # @!method initialize(id:, error:, retryable:, reason: nil, object: :x_account_connection_attempt, status: :failed)
110
+ # The connection reached a final failure.
111
+ #
112
+ # @param id [String]
113
+ # @param error [String]
114
+ # @param retryable [Boolean]
115
+ # @param reason [String]
116
+ # @param object [Symbol, :x_account_connection_attempt]
117
+ # @param status [Symbol, :failed]
118
+ end
119
+
120
+ class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel
121
+ # @!attribute id
122
+ #
123
+ # @return [String]
124
+ required :id, String
125
+
126
+ # @!attribute expires_at
127
+ #
128
+ # @return [Time]
129
+ required :expires_at, Time, api_name: :expiresAt
130
+
131
+ # @!attribute message
132
+ #
133
+ # @return [String]
134
+ required :message, String
135
+
136
+ # @!attribute object
137
+ #
138
+ # @return [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object]
139
+ required :object,
140
+ enum: -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object }
141
+
142
+ # @!attribute status
143
+ #
144
+ # @return [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status]
145
+ required :status,
146
+ enum: -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status }
147
+
148
+ # @!attribute username
149
+ #
150
+ # @return [String]
151
+ required :username, String
152
+
153
+ # @!method initialize(id:, expires_at:, message:, object:, status:, username:)
154
+ # Resumable account connection challenge. Submit the email code to finish the same
155
+ # connection attempt.
156
+ #
157
+ # @param id [String]
158
+ # @param expires_at [Time]
159
+ # @param message [String]
160
+ # @param object [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object]
161
+ # @param status [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status]
162
+ # @param username [String]
163
+
164
+ # @see XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge#object
165
+ module Object
166
+ extend XTwitterScraper::Internal::Type::Enum
167
+
168
+ X_ACCOUNT_CONNECTION_CHALLENGE = :x_account_connection_challenge
169
+
170
+ # @!method self.values
171
+ # @return [Array<Symbol>]
172
+ end
173
+
174
+ # @see XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge#status
175
+ module Status
176
+ extend XTwitterScraper::Internal::Type::Enum
177
+
178
+ REQUIRES_EMAIL_CODE = :requires_email_code
179
+
180
+ # @!method self.values
181
+ # @return [Array<Symbol>]
182
+ end
183
+ end
184
+
185
+ # @!method self.variants
186
+ # @return [Array(XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge)]
187
+ end
188
+ end
189
+ end
190
+ end
@@ -24,26 +24,26 @@ module XTwitterScraper
24
24
  # @return [String]
25
25
  required :password, String
26
26
 
27
+ # @!attribute totp_secret
28
+ # Authenticator App TOTP secret required for durable login
29
+ #
30
+ # @return [String]
31
+ required :totp_secret, String
32
+
27
33
  # @!attribute username
28
34
  # X username
29
35
  #
30
36
  # @return [String]
31
37
  required :username, String
32
38
 
33
- # @!attribute totp_secret
34
- # TOTP secret for 2FA
35
- #
36
- # @return [String, nil]
37
- optional :totp_secret, String
38
-
39
- # @!method initialize(email:, password:, username:, totp_secret: nil, request_options: {})
39
+ # @!method initialize(email:, password:, totp_secret:, username:, request_options: {})
40
40
  # @param email [String] Account email
41
41
  #
42
42
  # @param password [String] Account password
43
43
  #
44
- # @param username [String] X username
44
+ # @param totp_secret [String] Authenticator App TOTP secret required for durable login
45
45
  #
46
- # @param totp_secret [String] TOTP secret for 2FA
46
+ # @param username [String] X username
47
47
  #
48
48
  # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}]
49
49
  end
@@ -7,63 +7,8 @@
7
7
  module XTwitterScraper
8
8
  module Models
9
9
  module X
10
- # @see XTwitterScraper::Resources::X::Accounts#create
11
- class AccountCreateResponse < XTwitterScraper::Internal::Type::BaseModel
12
- # @!attribute id
13
- #
14
- # @return [String]
15
- required :id, String
16
-
17
- # @!attribute created_at
18
- #
19
- # @return [Time]
20
- required :created_at, Time, api_name: :createdAt
21
-
22
- # @!attribute health
23
- #
24
- # @return [Symbol, XTwitterScraper::Models::X::AccountCreateResponse::Health]
25
- required :health, enum: -> { XTwitterScraper::Models::X::AccountCreateResponse::Health }
26
-
27
- # @!attribute status
28
- #
29
- # @return [String]
30
- required :status, String
31
-
32
- # @!attribute x_user_id
33
- #
34
- # @return [String]
35
- required :x_user_id, String, api_name: :xUserId
36
-
37
- # @!attribute x_username
38
- #
39
- # @return [String]
40
- required :x_username, String, api_name: :xUsername
41
-
42
- # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:)
43
- # Sanitized X account summary returned by connect and reauth.
44
- #
45
- # @param id [String]
46
- # @param created_at [Time]
47
- # @param health [Symbol, XTwitterScraper::Models::X::AccountCreateResponse::Health]
48
- # @param status [String]
49
- # @param x_user_id [String]
50
- # @param x_username [String]
51
-
52
- # @see XTwitterScraper::Models::X::AccountCreateResponse#health
53
- module Health
54
- extend XTwitterScraper::Internal::Type::Enum
55
-
56
- HEALTHY = :healthy
57
- LOCKED = :locked
58
- NEEDS_REAUTH = :needsReauth
59
- RECOVERING = :recovering
60
- SUSPENDED = :suspended
61
- TEMPORARY_ISSUE = :temporaryIssue
62
-
63
- # @!method self.values
64
- # @return [Array<Symbol>]
65
- end
66
- end
10
+ # @type [XTwitterScraper::Internal::Type::Converter]
11
+ AccountCreateResponse = XTwitterScraper::Internal::Type::Unknown
67
12
  end
68
13
  end
69
14
  end
@@ -30,7 +30,7 @@ module XTwitterScraper
30
30
  optional :email, String
31
31
 
32
32
  # @!attribute totp_secret
33
- # TOTP secret for 2FA re-authentication
33
+ # Replacement Authenticator App TOTP secret. Omit it to reuse the saved secret.
34
34
  #
35
35
  # @return [String, nil]
36
36
  optional :totp_secret, String
@@ -42,7 +42,7 @@ module XTwitterScraper
42
42
  #
43
43
  # @param email [String] Email for the X account (updates stored email)
44
44
  #
45
- # @param totp_secret [String] TOTP secret for 2FA re-authentication
45
+ # @param totp_secret [String] Replacement Authenticator App TOTP secret. Omit it to reuse the saved secret.
46
46
  #
47
47
  # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}]
48
48
  end