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
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module XTwitterScraper
4
+ module Models
5
+ module X
6
+ class AccountConnectionAttemptRetrieveParams < XTwitterScraper::Internal::Type::BaseModel
7
+ extend XTwitterScraper::Internal::Type::RequestParameters::Converter
8
+ include XTwitterScraper::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ XTwitterScraper::X::AccountConnectionAttemptRetrieveParams,
14
+ XTwitterScraper::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ sig do
22
+ params(
23
+ id: String,
24
+ request_options: XTwitterScraper::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { id: String, request_options: XTwitterScraper::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,317 @@
1
+ # typed: strong
2
+
3
+ module XTwitterScraper
4
+ module Models
5
+ module X
6
+ # The connection is still in progress.
7
+ module AccountConnectionAttemptRetrieveResponse
8
+ extend XTwitterScraper::Internal::Type::Union
9
+
10
+ Variants =
11
+ T.type_alias do
12
+ T.any(
13
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending,
14
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess,
15
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed,
16
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge
17
+ )
18
+ end
19
+
20
+ class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel
21
+ OrHash =
22
+ T.type_alias do
23
+ T.any(
24
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending,
25
+ XTwitterScraper::Internal::AnyHash
26
+ )
27
+ end
28
+
29
+ sig { returns(String) }
30
+ attr_accessor :id
31
+
32
+ sig { returns(Symbol) }
33
+ attr_accessor :object
34
+
35
+ sig { returns(Integer) }
36
+ attr_accessor :poll_after_ms
37
+
38
+ sig { returns(Symbol) }
39
+ attr_accessor :status
40
+
41
+ # The connection is still in progress.
42
+ sig do
43
+ params(
44
+ id: String,
45
+ poll_after_ms: Integer,
46
+ object: Symbol,
47
+ status: Symbol
48
+ ).returns(T.attached_class)
49
+ end
50
+ def self.new(
51
+ id:,
52
+ poll_after_ms:,
53
+ object: :x_account_connection_attempt,
54
+ status: :pending
55
+ )
56
+ end
57
+
58
+ sig do
59
+ override.returns(
60
+ {
61
+ id: String,
62
+ object: Symbol,
63
+ poll_after_ms: Integer,
64
+ status: Symbol
65
+ }
66
+ )
67
+ end
68
+ def to_hash
69
+ end
70
+ end
71
+
72
+ class XAccountConnectionAttemptSuccess < XTwitterScraper::Internal::Type::BaseModel
73
+ OrHash =
74
+ T.type_alias do
75
+ T.any(
76
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess,
77
+ XTwitterScraper::Internal::AnyHash
78
+ )
79
+ end
80
+
81
+ sig { returns(String) }
82
+ attr_accessor :id
83
+
84
+ sig { returns(Symbol) }
85
+ attr_accessor :object
86
+
87
+ sig { returns(Symbol) }
88
+ attr_accessor :status
89
+
90
+ # The account connected successfully.
91
+ sig do
92
+ params(id: String, object: Symbol, status: Symbol).returns(
93
+ T.attached_class
94
+ )
95
+ end
96
+ def self.new(
97
+ id:,
98
+ object: :x_account_connection_attempt,
99
+ status: :success
100
+ )
101
+ end
102
+
103
+ sig do
104
+ override.returns({ id: String, object: Symbol, status: Symbol })
105
+ end
106
+ def to_hash
107
+ end
108
+ end
109
+
110
+ class XAccountConnectionAttemptFailed < XTwitterScraper::Internal::Type::BaseModel
111
+ OrHash =
112
+ T.type_alias do
113
+ T.any(
114
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed,
115
+ XTwitterScraper::Internal::AnyHash
116
+ )
117
+ end
118
+
119
+ sig { returns(String) }
120
+ attr_accessor :id
121
+
122
+ sig { returns(String) }
123
+ attr_accessor :error
124
+
125
+ sig { returns(Symbol) }
126
+ attr_accessor :object
127
+
128
+ sig { returns(T::Boolean) }
129
+ attr_accessor :retryable
130
+
131
+ sig { returns(Symbol) }
132
+ attr_accessor :status
133
+
134
+ sig { returns(T.nilable(String)) }
135
+ attr_reader :reason
136
+
137
+ sig { params(reason: String).void }
138
+ attr_writer :reason
139
+
140
+ # The connection reached a final failure.
141
+ sig do
142
+ params(
143
+ id: String,
144
+ error: String,
145
+ retryable: T::Boolean,
146
+ reason: String,
147
+ object: Symbol,
148
+ status: Symbol
149
+ ).returns(T.attached_class)
150
+ end
151
+ def self.new(
152
+ id:,
153
+ error:,
154
+ retryable:,
155
+ reason: nil,
156
+ object: :x_account_connection_attempt,
157
+ status: :failed
158
+ )
159
+ end
160
+
161
+ sig do
162
+ override.returns(
163
+ {
164
+ id: String,
165
+ error: String,
166
+ object: Symbol,
167
+ retryable: T::Boolean,
168
+ status: Symbol,
169
+ reason: String
170
+ }
171
+ )
172
+ end
173
+ def to_hash
174
+ end
175
+ end
176
+
177
+ class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel
178
+ OrHash =
179
+ T.type_alias do
180
+ T.any(
181
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge,
182
+ XTwitterScraper::Internal::AnyHash
183
+ )
184
+ end
185
+
186
+ sig { returns(String) }
187
+ attr_accessor :id
188
+
189
+ sig { returns(Time) }
190
+ attr_accessor :expires_at
191
+
192
+ sig { returns(String) }
193
+ attr_accessor :message
194
+
195
+ sig do
196
+ returns(
197
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol
198
+ )
199
+ end
200
+ attr_accessor :object
201
+
202
+ sig do
203
+ returns(
204
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol
205
+ )
206
+ end
207
+ attr_accessor :status
208
+
209
+ sig { returns(String) }
210
+ attr_accessor :username
211
+
212
+ # Resumable account connection challenge. Submit the email code to finish the same
213
+ # connection attempt.
214
+ sig do
215
+ params(
216
+ id: String,
217
+ expires_at: Time,
218
+ message: String,
219
+ object:
220
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::OrSymbol,
221
+ status:
222
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::OrSymbol,
223
+ username: String
224
+ ).returns(T.attached_class)
225
+ end
226
+ def self.new(id:, expires_at:, message:, object:, status:, username:)
227
+ end
228
+
229
+ sig do
230
+ override.returns(
231
+ {
232
+ id: String,
233
+ expires_at: Time,
234
+ message: String,
235
+ object:
236
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol,
237
+ status:
238
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol,
239
+ username: String
240
+ }
241
+ )
242
+ end
243
+ def to_hash
244
+ end
245
+
246
+ module Object
247
+ extend XTwitterScraper::Internal::Type::Enum
248
+
249
+ TaggedSymbol =
250
+ T.type_alias do
251
+ T.all(
252
+ Symbol,
253
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object
254
+ )
255
+ end
256
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
257
+
258
+ X_ACCOUNT_CONNECTION_CHALLENGE =
259
+ T.let(
260
+ :x_account_connection_challenge,
261
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol
262
+ )
263
+
264
+ sig do
265
+ override.returns(
266
+ T::Array[
267
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol
268
+ ]
269
+ )
270
+ end
271
+ def self.values
272
+ end
273
+ end
274
+
275
+ module Status
276
+ extend XTwitterScraper::Internal::Type::Enum
277
+
278
+ TaggedSymbol =
279
+ T.type_alias do
280
+ T.all(
281
+ Symbol,
282
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status
283
+ )
284
+ end
285
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
286
+
287
+ REQUIRES_EMAIL_CODE =
288
+ T.let(
289
+ :requires_email_code,
290
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol
291
+ )
292
+
293
+ sig do
294
+ override.returns(
295
+ T::Array[
296
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol
297
+ ]
298
+ )
299
+ end
300
+ def self.values
301
+ end
302
+ end
303
+ end
304
+
305
+ sig do
306
+ override.returns(
307
+ T::Array[
308
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Variants
309
+ ]
310
+ )
311
+ end
312
+ def self.variants
313
+ end
314
+ end
315
+ end
316
+ end
317
+ end
@@ -27,23 +27,20 @@ module XTwitterScraper
27
27
  sig { returns(String) }
28
28
  attr_accessor :password
29
29
 
30
+ # Authenticator App TOTP secret required for durable login
31
+ sig { returns(String) }
32
+ attr_accessor :totp_secret
33
+
30
34
  # X username
31
35
  sig { returns(String) }
32
36
  attr_accessor :username
33
37
 
34
- # TOTP secret for 2FA
35
- sig { returns(T.nilable(String)) }
36
- attr_reader :totp_secret
37
-
38
- sig { params(totp_secret: String).void }
39
- attr_writer :totp_secret
40
-
41
38
  sig do
42
39
  params(
43
40
  email: String,
44
41
  password: String,
45
- username: String,
46
42
  totp_secret: String,
43
+ username: String,
47
44
  request_options: XTwitterScraper::RequestOptions::OrHash
48
45
  ).returns(T.attached_class)
49
46
  end
@@ -52,10 +49,10 @@ module XTwitterScraper
52
49
  email:,
53
50
  # Account password
54
51
  password:,
52
+ # Authenticator App TOTP secret required for durable login
53
+ totp_secret:,
55
54
  # X username
56
55
  username:,
57
- # TOTP secret for 2FA
58
- totp_secret: nil,
59
56
  request_options: {}
60
57
  )
61
58
  end
@@ -65,8 +62,8 @@ module XTwitterScraper
65
62
  {
66
63
  email: String,
67
64
  password: String,
68
- username: String,
69
65
  totp_secret: String,
66
+ username: String,
70
67
  request_options: XTwitterScraper::RequestOptions
71
68
  }
72
69
  )
@@ -7,129 +7,8 @@
7
7
  module XTwitterScraper
8
8
  module Models
9
9
  module X
10
- class AccountCreateResponse < XTwitterScraper::Internal::Type::BaseModel
11
- OrHash =
12
- T.type_alias do
13
- T.any(
14
- XTwitterScraper::Models::X::AccountCreateResponse,
15
- XTwitterScraper::Internal::AnyHash
16
- )
17
- end
18
-
19
- sig { returns(String) }
20
- attr_accessor :id
21
-
22
- sig { returns(Time) }
23
- attr_accessor :created_at
24
-
25
- sig do
26
- returns(
27
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
28
- )
29
- end
30
- attr_accessor :health
31
-
32
- sig { returns(String) }
33
- attr_accessor :status
34
-
35
- sig { returns(String) }
36
- attr_accessor :x_user_id
37
-
38
- sig { returns(String) }
39
- attr_accessor :x_username
40
-
41
- # Sanitized X account summary returned by connect and reauth.
42
- sig do
43
- params(
44
- id: String,
45
- created_at: Time,
46
- health:
47
- XTwitterScraper::Models::X::AccountCreateResponse::Health::OrSymbol,
48
- status: String,
49
- x_user_id: String,
50
- x_username: String
51
- ).returns(T.attached_class)
52
- end
53
- def self.new(
54
- id:,
55
- created_at:,
56
- health:,
57
- status:,
58
- x_user_id:,
59
- x_username:
60
- )
61
- end
62
-
63
- sig do
64
- override.returns(
65
- {
66
- id: String,
67
- created_at: Time,
68
- health:
69
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol,
70
- status: String,
71
- x_user_id: String,
72
- x_username: String
73
- }
74
- )
75
- end
76
- def to_hash
77
- end
78
-
79
- module Health
80
- extend XTwitterScraper::Internal::Type::Enum
81
-
82
- TaggedSymbol =
83
- T.type_alias do
84
- T.all(
85
- Symbol,
86
- XTwitterScraper::Models::X::AccountCreateResponse::Health
87
- )
88
- end
89
- OrSymbol = T.type_alias { T.any(Symbol, String) }
90
-
91
- HEALTHY =
92
- T.let(
93
- :healthy,
94
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
95
- )
96
- LOCKED =
97
- T.let(
98
- :locked,
99
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
100
- )
101
- NEEDS_REAUTH =
102
- T.let(
103
- :needsReauth,
104
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
105
- )
106
- RECOVERING =
107
- T.let(
108
- :recovering,
109
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
110
- )
111
- SUSPENDED =
112
- T.let(
113
- :suspended,
114
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
115
- )
116
- TEMPORARY_ISSUE =
117
- T.let(
118
- :temporaryIssue,
119
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
120
- )
121
-
122
- sig do
123
- override.returns(
124
- T::Array[
125
- XTwitterScraper::Models::X::AccountCreateResponse::Health::TaggedSymbol
126
- ]
127
- )
128
- end
129
- def self.values
130
- end
131
- end
132
- end
10
+ AccountCreateResponse =
11
+ T.let(T.anything, XTwitterScraper::Internal::Type::Converter)
133
12
  end
134
13
  end
135
14
  end
@@ -33,7 +33,7 @@ module XTwitterScraper
33
33
  sig { params(email: String).void }
34
34
  attr_writer :email
35
35
 
36
- # TOTP secret for 2FA re-authentication
36
+ # Replacement Authenticator App TOTP secret. Omit it to reuse the saved secret.
37
37
  sig { returns(T.nilable(String)) }
38
38
  attr_reader :totp_secret
39
39
 
@@ -55,7 +55,7 @@ module XTwitterScraper
55
55
  password:,
56
56
  # Email for the X account (updates stored email)
57
57
  email: nil,
58
- # TOTP secret for 2FA re-authentication
58
+ # Replacement Authenticator App TOTP secret. Omit it to reuse the saved secret.
59
59
  totp_secret: nil,
60
60
  request_options: {}
61
61
  )
@@ -24,11 +24,11 @@ module XTwitterScraper
24
24
  sig { returns(Time) }
25
25
  attr_accessor :created_at
26
26
 
27
- # Derived connection health. `healthy` = session active. `needsReauth` = user must
27
+ # Derived connection health. `healthy` = ready to use. `needsReauth` = user must
28
28
  # submit fresh credentials. `locked` = X locked the account; unlock on x.com
29
- # first. `suspended` = X banned the account. `recovering` = past cooldown, will
30
- # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
31
- # shortly.
29
+ # first. `suspended` = X banned the account. `recovering` = cooldown ended; the
30
+ # account can reconnect on its next use. `temporaryIssue` = temporary connection
31
+ # problem; wait before the next use.
32
32
  sig { returns(XTwitterScraper::X::XAccount::Health::TaggedSymbol) }
33
33
  attr_accessor :health
34
34
 
@@ -66,11 +66,11 @@ module XTwitterScraper
66
66
  def self.new(
67
67
  id:,
68
68
  created_at:,
69
- # Derived connection health. `healthy` = session active. `needsReauth` = user must
69
+ # Derived connection health. `healthy` = ready to use. `needsReauth` = user must
70
70
  # submit fresh credentials. `locked` = X locked the account; unlock on x.com
71
- # first. `suspended` = X banned the account. `recovering` = past cooldown, will
72
- # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
73
- # shortly.
71
+ # first. `suspended` = X banned the account. `recovering` = cooldown ended; the
72
+ # account can reconnect on its next use. `temporaryIssue` = temporary connection
73
+ # problem; wait before the next use.
74
74
  health:,
75
75
  status:,
76
76
  updated_at:,
@@ -97,11 +97,11 @@ module XTwitterScraper
97
97
  def to_hash
98
98
  end
99
99
 
100
- # Derived connection health. `healthy` = session active. `needsReauth` = user must
100
+ # Derived connection health. `healthy` = ready to use. `needsReauth` = user must
101
101
  # submit fresh credentials. `locked` = X locked the account; unlock on x.com
102
- # first. `suspended` = X banned the account. `recovering` = past cooldown, will
103
- # auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
104
- # shortly.
102
+ # first. `suspended` = X banned the account. `recovering` = cooldown ended; the
103
+ # account can reconnect on its next use. `temporaryIssue` = temporary connection
104
+ # problem; wait before the next use.
105
105
  module Health
106
106
  extend XTwitterScraper::Internal::Type::Enum
107
107
 
@@ -8,10 +8,10 @@ module XTwitterScraper
8
8
  module Resources
9
9
  # AI tweet composition, drafts, writing styles, and radar
10
10
  class Compose
11
- # Run one step of Xquik's three-step writing workflow. Compose returns questions
12
- # and editorial rules. Refine returns goal-specific guidance. Score applies
13
- # deterministic text checks. It does not predict reach or expose X ranking
14
- # weights.
11
+ # Run one step of Xquik's three-step writing workflow. Compose returns questions,
12
+ # editorial rules, and source-specific Radar recommendations. Refine returns
13
+ # goal-specific guidance. Score applies deterministic text checks. It does not
14
+ # predict reach or expose X ranking weights.
15
15
  sig do
16
16
  params(
17
17
  body:
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module XTwitterScraper
4
+ module Resources
5
+ class X
6
+ # Connected X account management
7
+ class AccountConnectionAttempts
8
+ # Get X account connection status
9
+ sig do
10
+ params(
11
+ id: String,
12
+ request_options: XTwitterScraper::RequestOptions::OrHash
13
+ ).returns(
14
+ XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Variants
15
+ )
16
+ end
17
+ def retrieve(
18
+ # Connection attempt ID returned by `POST /x/accounts`.
19
+ id,
20
+ request_options: {}
21
+ )
22
+ end
23
+
24
+ # @api private
25
+ sig do
26
+ params(client: XTwitterScraper::Client).returns(T.attached_class)
27
+ end
28
+ def self.new(client:)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -14,20 +14,20 @@ module XTwitterScraper
14
14
  params(
15
15
  email: String,
16
16
  password: String,
17
- username: String,
18
17
  totp_secret: String,
18
+ username: String,
19
19
  request_options: XTwitterScraper::RequestOptions::OrHash
20
- ).returns(XTwitterScraper::Models::X::AccountCreateResponse)
20
+ ).returns(T.anything)
21
21
  end
22
22
  def create(
23
23
  # Account email
24
24
  email:,
25
25
  # Account password
26
26
  password:,
27
+ # Authenticator App TOTP secret required for durable login
28
+ totp_secret:,
27
29
  # X username
28
30
  username:,
29
- # TOTP secret for 2FA
30
- totp_secret: nil,
31
31
  request_options: {}
32
32
  )
33
33
  end
@@ -96,7 +96,7 @@ module XTwitterScraper
96
96
  password:,
97
97
  # Email for the X account (updates stored email)
98
98
  email: nil,
99
- # TOTP secret for 2FA re-authentication
99
+ # Replacement Authenticator App TOTP secret. Omit it to reuse the saved secret.
100
100
  totp_secret: nil,
101
101
  request_options: {}
102
102
  )
@@ -44,6 +44,10 @@ module XTwitterScraper
44
44
  end
45
45
  attr_reader :account_connection_challenges
46
46
 
47
+ # Connected X account management
48
+ sig { returns(XTwitterScraper::Resources::X::AccountConnectionAttempts) }
49
+ attr_reader :account_connection_attempts
50
+
47
51
  # Look up, search, and analyze individual tweets
48
52
  sig { returns(XTwitterScraper::Resources::X::Bookmarks) }
49
53
  attr_reader :bookmarks