post-for-me 0.1.0.pre.alpha.7 → 0.1.0.pre.alpha.9

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.md +1 -1
  4. data/lib/post_for_me/errors.rb +25 -11
  5. data/lib/post_for_me/file_part.rb +10 -7
  6. data/lib/post_for_me/internal/transport/base_client.rb +11 -7
  7. data/lib/post_for_me/internal/transport/pooled_net_requester.rb +7 -10
  8. data/lib/post_for_me/internal/type/base_page.rb +1 -1
  9. data/lib/post_for_me/internal/type/file_input.rb +7 -4
  10. data/lib/post_for_me/internal/util.rb +3 -2
  11. data/lib/post_for_me/models/bluesky_configuration_dto.rb +118 -3
  12. data/lib/post_for_me/models/create_social_post.rb +221 -2
  13. data/lib/post_for_me/models/facebook_configuration_dto.rb +137 -4
  14. data/lib/post_for_me/models/instagram_configuration_dto.rb +135 -4
  15. data/lib/post_for_me/models/linkedin_configuration_dto.rb +118 -3
  16. data/lib/post_for_me/models/pinterest_configuration_dto.rb +118 -3
  17. data/lib/post_for_me/models/social_account_create_auth_url_params.rb +43 -1
  18. data/lib/post_for_me/models/social_post.rb +221 -2
  19. data/lib/post_for_me/models/threads_configuration_dto.rb +118 -3
  20. data/lib/post_for_me/models/tiktok_configuration.rb +127 -4
  21. data/lib/post_for_me/models/twitter_configuration_dto.rb +211 -4
  22. data/lib/post_for_me/models/youtube_configuration_dto.rb +118 -3
  23. data/lib/post_for_me/version.rb +1 -1
  24. data/rbi/post_for_me/errors.rbi +29 -2
  25. data/rbi/post_for_me/file_part.rbi +1 -1
  26. data/rbi/post_for_me/internal/transport/base_client.rbi +4 -5
  27. data/rbi/post_for_me/internal/type/base_page.rbi +1 -1
  28. data/rbi/post_for_me/internal/util.rbi +1 -1
  29. data/rbi/post_for_me/models/bluesky_configuration_dto.rbi +243 -3
  30. data/rbi/post_for_me/models/create_social_post.rbi +424 -0
  31. data/rbi/post_for_me/models/facebook_configuration_dto.rbi +258 -3
  32. data/rbi/post_for_me/models/instagram_configuration_dto.rbi +267 -6
  33. data/rbi/post_for_me/models/linkedin_configuration_dto.rbi +245 -3
  34. data/rbi/post_for_me/models/pinterest_configuration_dto.rbi +246 -3
  35. data/rbi/post_for_me/models/social_account_create_auth_url_params.rbi +104 -0
  36. data/rbi/post_for_me/models/social_post.rbi +414 -0
  37. data/rbi/post_for_me/models/threads_configuration_dto.rbi +240 -3
  38. data/rbi/post_for_me/models/tiktok_configuration.rbi +237 -3
  39. data/rbi/post_for_me/models/twitter_configuration_dto.rbi +452 -4
  40. data/rbi/post_for_me/models/youtube_configuration_dto.rbi +240 -3
  41. data/sig/post_for_me/errors.rbs +7 -0
  42. data/sig/post_for_me/file_part.rbs +1 -1
  43. data/sig/post_for_me/models/bluesky_configuration_dto.rbs +109 -4
  44. data/sig/post_for_me/models/create_social_post.rbs +180 -1
  45. data/sig/post_for_me/models/facebook_configuration_dto.rbs +109 -4
  46. data/sig/post_for_me/models/instagram_configuration_dto.rbs +112 -7
  47. data/sig/post_for_me/models/linkedin_configuration_dto.rbs +109 -4
  48. data/sig/post_for_me/models/pinterest_configuration_dto.rbs +99 -4
  49. data/sig/post_for_me/models/social_account_create_auth_url_params.rbs +37 -0
  50. data/sig/post_for_me/models/social_post.rbs +180 -1
  51. data/sig/post_for_me/models/threads_configuration_dto.rbs +99 -4
  52. data/sig/post_for_me/models/tiktok_configuration.rbs +104 -4
  53. data/sig/post_for_me/models/twitter_configuration_dto.rbs +196 -4
  54. data/sig/post_for_me/models/youtube_configuration_dto.rbs +107 -4
  55. metadata +2 -2
@@ -15,31 +15,479 @@ module PostForMe
15
15
  sig { returns(T.nilable(T.anything)) }
16
16
  attr_accessor :caption
17
17
 
18
+ # Id of the community to post to
19
+ sig { returns(T.nilable(String)) }
20
+ attr_reader :community_id
21
+
22
+ sig { params(community_id: String).void }
23
+ attr_writer :community_id
24
+
18
25
  # Overrides the `media` from the post
19
- sig { returns(T.nilable(T::Array[String])) }
26
+ sig do
27
+ returns(T.nilable(T::Array[PostForMe::TwitterConfigurationDto::Media]))
28
+ end
20
29
  attr_accessor :media
21
30
 
31
+ # Poll options for the tweet
32
+ sig { returns(T.nilable(PostForMe::TwitterConfigurationDto::Poll)) }
33
+ attr_reader :poll
34
+
35
+ sig do
36
+ params(poll: PostForMe::TwitterConfigurationDto::Poll::OrHash).void
37
+ end
38
+ attr_writer :poll
39
+
40
+ # Id of the tweet you want to quote
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :quote_tweet_id
43
+
44
+ sig { params(quote_tweet_id: String).void }
45
+ attr_writer :quote_tweet_id
46
+
47
+ # Who can reply to the tweet
48
+ sig do
49
+ returns(
50
+ T.nilable(PostForMe::TwitterConfigurationDto::ReplySettings::OrSymbol)
51
+ )
52
+ end
53
+ attr_accessor :reply_settings
54
+
22
55
  sig do
23
56
  params(
24
57
  caption: T.nilable(T.anything),
25
- media: T.nilable(T::Array[String])
58
+ community_id: String,
59
+ media:
60
+ T.nilable(
61
+ T::Array[PostForMe::TwitterConfigurationDto::Media::OrHash]
62
+ ),
63
+ poll: PostForMe::TwitterConfigurationDto::Poll::OrHash,
64
+ quote_tweet_id: String,
65
+ reply_settings:
66
+ T.nilable(
67
+ PostForMe::TwitterConfigurationDto::ReplySettings::OrSymbol
68
+ )
26
69
  ).returns(T.attached_class)
27
70
  end
28
71
  def self.new(
29
72
  # Overrides the `caption` from the post
30
73
  caption: nil,
74
+ # Id of the community to post to
75
+ community_id: nil,
31
76
  # Overrides the `media` from the post
32
- media: nil
77
+ media: nil,
78
+ # Poll options for the tweet
79
+ poll: nil,
80
+ # Id of the tweet you want to quote
81
+ quote_tweet_id: nil,
82
+ # Who can reply to the tweet
83
+ reply_settings: nil
33
84
  )
34
85
  end
35
86
 
36
87
  sig do
37
88
  override.returns(
38
- { caption: T.nilable(T.anything), media: T.nilable(T::Array[String]) }
89
+ {
90
+ caption: T.nilable(T.anything),
91
+ community_id: String,
92
+ media:
93
+ T.nilable(T::Array[PostForMe::TwitterConfigurationDto::Media]),
94
+ poll: PostForMe::TwitterConfigurationDto::Poll,
95
+ quote_tweet_id: String,
96
+ reply_settings:
97
+ T.nilable(
98
+ PostForMe::TwitterConfigurationDto::ReplySettings::OrSymbol
99
+ )
100
+ }
39
101
  )
40
102
  end
41
103
  def to_hash
42
104
  end
105
+
106
+ class Media < PostForMe::Internal::Type::BaseModel
107
+ OrHash =
108
+ T.type_alias do
109
+ T.any(
110
+ PostForMe::TwitterConfigurationDto::Media,
111
+ PostForMe::Internal::AnyHash
112
+ )
113
+ end
114
+
115
+ # Public URL of the media
116
+ sig { returns(String) }
117
+ attr_accessor :url
118
+
119
+ # List of tags to attach to the media
120
+ sig do
121
+ returns(
122
+ T.nilable(T::Array[PostForMe::TwitterConfigurationDto::Media::Tag])
123
+ )
124
+ end
125
+ attr_accessor :tags
126
+
127
+ # Timestamp in milliseconds of frame to use as thumbnail for the media
128
+ sig { returns(T.nilable(T.anything)) }
129
+ attr_accessor :thumbnail_timestamp_ms
130
+
131
+ # Public URL of the thumbnail for the media
132
+ sig { returns(T.nilable(T.anything)) }
133
+ attr_accessor :thumbnail_url
134
+
135
+ sig do
136
+ params(
137
+ url: String,
138
+ tags:
139
+ T.nilable(
140
+ T::Array[PostForMe::TwitterConfigurationDto::Media::Tag::OrHash]
141
+ ),
142
+ thumbnail_timestamp_ms: T.nilable(T.anything),
143
+ thumbnail_url: T.nilable(T.anything)
144
+ ).returns(T.attached_class)
145
+ end
146
+ def self.new(
147
+ # Public URL of the media
148
+ url:,
149
+ # List of tags to attach to the media
150
+ tags: nil,
151
+ # Timestamp in milliseconds of frame to use as thumbnail for the media
152
+ thumbnail_timestamp_ms: nil,
153
+ # Public URL of the thumbnail for the media
154
+ thumbnail_url: nil
155
+ )
156
+ end
157
+
158
+ sig do
159
+ override.returns(
160
+ {
161
+ url: String,
162
+ tags:
163
+ T.nilable(
164
+ T::Array[PostForMe::TwitterConfigurationDto::Media::Tag]
165
+ ),
166
+ thumbnail_timestamp_ms: T.nilable(T.anything),
167
+ thumbnail_url: T.nilable(T.anything)
168
+ }
169
+ )
170
+ end
171
+ def to_hash
172
+ end
173
+
174
+ class Tag < PostForMe::Internal::Type::BaseModel
175
+ OrHash =
176
+ T.type_alias do
177
+ T.any(
178
+ PostForMe::TwitterConfigurationDto::Media::Tag,
179
+ PostForMe::Internal::AnyHash
180
+ )
181
+ end
182
+
183
+ # Facebook User ID, Instagram Username or Instagram product id to tag
184
+ sig { returns(String) }
185
+ attr_accessor :id
186
+
187
+ # The platform for the tags
188
+ sig do
189
+ returns(
190
+ PostForMe::TwitterConfigurationDto::Media::Tag::Platform::OrSymbol
191
+ )
192
+ end
193
+ attr_accessor :platform
194
+
195
+ # The type of tag, user to tag accounts, product to tag products (only supported
196
+ # for instagram)
197
+ sig do
198
+ returns(
199
+ PostForMe::TwitterConfigurationDto::Media::Tag::Type::OrSymbol
200
+ )
201
+ end
202
+ attr_accessor :type
203
+
204
+ # Percentage distance from left edge of the image, Not required for videos or
205
+ # stories
206
+ sig { returns(T.nilable(Float)) }
207
+ attr_reader :x
208
+
209
+ sig { params(x: Float).void }
210
+ attr_writer :x
211
+
212
+ # Percentage distance from top edge of the image, Not required for videos or
213
+ # stories
214
+ sig { returns(T.nilable(Float)) }
215
+ attr_reader :y_
216
+
217
+ sig { params(y_: Float).void }
218
+ attr_writer :y_
219
+
220
+ sig do
221
+ params(
222
+ id: String,
223
+ platform:
224
+ PostForMe::TwitterConfigurationDto::Media::Tag::Platform::OrSymbol,
225
+ type:
226
+ PostForMe::TwitterConfigurationDto::Media::Tag::Type::OrSymbol,
227
+ x: Float,
228
+ y_: Float
229
+ ).returns(T.attached_class)
230
+ end
231
+ def self.new(
232
+ # Facebook User ID, Instagram Username or Instagram product id to tag
233
+ id:,
234
+ # The platform for the tags
235
+ platform:,
236
+ # The type of tag, user to tag accounts, product to tag products (only supported
237
+ # for instagram)
238
+ type:,
239
+ # Percentage distance from left edge of the image, Not required for videos or
240
+ # stories
241
+ x: nil,
242
+ # Percentage distance from top edge of the image, Not required for videos or
243
+ # stories
244
+ y_: nil
245
+ )
246
+ end
247
+
248
+ sig do
249
+ override.returns(
250
+ {
251
+ id: String,
252
+ platform:
253
+ PostForMe::TwitterConfigurationDto::Media::Tag::Platform::OrSymbol,
254
+ type:
255
+ PostForMe::TwitterConfigurationDto::Media::Tag::Type::OrSymbol,
256
+ x: Float,
257
+ y_: Float
258
+ }
259
+ )
260
+ end
261
+ def to_hash
262
+ end
263
+
264
+ # The platform for the tags
265
+ module Platform
266
+ extend PostForMe::Internal::Type::Enum
267
+
268
+ TaggedSymbol =
269
+ T.type_alias do
270
+ T.all(
271
+ Symbol,
272
+ PostForMe::TwitterConfigurationDto::Media::Tag::Platform
273
+ )
274
+ end
275
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
276
+
277
+ FACEBOOK =
278
+ T.let(
279
+ :facebook,
280
+ PostForMe::TwitterConfigurationDto::Media::Tag::Platform::TaggedSymbol
281
+ )
282
+ INSTAGRAM =
283
+ T.let(
284
+ :instagram,
285
+ PostForMe::TwitterConfigurationDto::Media::Tag::Platform::TaggedSymbol
286
+ )
287
+
288
+ sig do
289
+ override.returns(
290
+ T::Array[
291
+ PostForMe::TwitterConfigurationDto::Media::Tag::Platform::TaggedSymbol
292
+ ]
293
+ )
294
+ end
295
+ def self.values
296
+ end
297
+ end
298
+
299
+ # The type of tag, user to tag accounts, product to tag products (only supported
300
+ # for instagram)
301
+ module Type
302
+ extend PostForMe::Internal::Type::Enum
303
+
304
+ TaggedSymbol =
305
+ T.type_alias do
306
+ T.all(
307
+ Symbol,
308
+ PostForMe::TwitterConfigurationDto::Media::Tag::Type
309
+ )
310
+ end
311
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
312
+
313
+ USER =
314
+ T.let(
315
+ :user,
316
+ PostForMe::TwitterConfigurationDto::Media::Tag::Type::TaggedSymbol
317
+ )
318
+ PRODUCT =
319
+ T.let(
320
+ :product,
321
+ PostForMe::TwitterConfigurationDto::Media::Tag::Type::TaggedSymbol
322
+ )
323
+
324
+ sig do
325
+ override.returns(
326
+ T::Array[
327
+ PostForMe::TwitterConfigurationDto::Media::Tag::Type::TaggedSymbol
328
+ ]
329
+ )
330
+ end
331
+ def self.values
332
+ end
333
+ end
334
+ end
335
+ end
336
+
337
+ class Poll < PostForMe::Internal::Type::BaseModel
338
+ OrHash =
339
+ T.type_alias do
340
+ T.any(
341
+ PostForMe::TwitterConfigurationDto::Poll,
342
+ PostForMe::Internal::AnyHash
343
+ )
344
+ end
345
+
346
+ # Duration of the poll in minutes
347
+ sig { returns(Float) }
348
+ attr_accessor :duration_minutes
349
+
350
+ # The choices of the poll, requiring 2-4 options
351
+ sig { returns(T::Array[String]) }
352
+ attr_accessor :options
353
+
354
+ # Who can reply to the tweet
355
+ sig do
356
+ returns(
357
+ T.nilable(
358
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::OrSymbol
359
+ )
360
+ )
361
+ end
362
+ attr_reader :reply_settings
363
+
364
+ sig do
365
+ params(
366
+ reply_settings:
367
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::OrSymbol
368
+ ).void
369
+ end
370
+ attr_writer :reply_settings
371
+
372
+ # Poll options for the tweet
373
+ sig do
374
+ params(
375
+ duration_minutes: Float,
376
+ options: T::Array[String],
377
+ reply_settings:
378
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::OrSymbol
379
+ ).returns(T.attached_class)
380
+ end
381
+ def self.new(
382
+ # Duration of the poll in minutes
383
+ duration_minutes:,
384
+ # The choices of the poll, requiring 2-4 options
385
+ options:,
386
+ # Who can reply to the tweet
387
+ reply_settings: nil
388
+ )
389
+ end
390
+
391
+ sig do
392
+ override.returns(
393
+ {
394
+ duration_minutes: Float,
395
+ options: T::Array[String],
396
+ reply_settings:
397
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::OrSymbol
398
+ }
399
+ )
400
+ end
401
+ def to_hash
402
+ end
403
+
404
+ # Who can reply to the tweet
405
+ module ReplySettings
406
+ extend PostForMe::Internal::Type::Enum
407
+
408
+ TaggedSymbol =
409
+ T.type_alias do
410
+ T.all(
411
+ Symbol,
412
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings
413
+ )
414
+ end
415
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
416
+
417
+ FOLLOWING =
418
+ T.let(
419
+ :following,
420
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::TaggedSymbol
421
+ )
422
+ MENTIONED_USERS =
423
+ T.let(
424
+ :mentionedUsers,
425
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::TaggedSymbol
426
+ )
427
+ SUBSCRIBERS =
428
+ T.let(
429
+ :subscribers,
430
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::TaggedSymbol
431
+ )
432
+ VERIFIED =
433
+ T.let(
434
+ :verified,
435
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::TaggedSymbol
436
+ )
437
+
438
+ sig do
439
+ override.returns(
440
+ T::Array[
441
+ PostForMe::TwitterConfigurationDto::Poll::ReplySettings::TaggedSymbol
442
+ ]
443
+ )
444
+ end
445
+ def self.values
446
+ end
447
+ end
448
+ end
449
+
450
+ # Who can reply to the tweet
451
+ module ReplySettings
452
+ extend PostForMe::Internal::Type::Enum
453
+
454
+ TaggedSymbol =
455
+ T.type_alias do
456
+ T.all(Symbol, PostForMe::TwitterConfigurationDto::ReplySettings)
457
+ end
458
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
459
+
460
+ FOLLOWING =
461
+ T.let(
462
+ :following,
463
+ PostForMe::TwitterConfigurationDto::ReplySettings::TaggedSymbol
464
+ )
465
+ MENTIONED_USERS =
466
+ T.let(
467
+ :mentionedUsers,
468
+ PostForMe::TwitterConfigurationDto::ReplySettings::TaggedSymbol
469
+ )
470
+ SUBSCRIBERS =
471
+ T.let(
472
+ :subscribers,
473
+ PostForMe::TwitterConfigurationDto::ReplySettings::TaggedSymbol
474
+ )
475
+ VERIFIED =
476
+ T.let(
477
+ :verified,
478
+ PostForMe::TwitterConfigurationDto::ReplySettings::TaggedSymbol
479
+ )
480
+
481
+ sig do
482
+ override.returns(
483
+ T::Array[
484
+ PostForMe::TwitterConfigurationDto::ReplySettings::TaggedSymbol
485
+ ]
486
+ )
487
+ end
488
+ def self.values
489
+ end
490
+ end
43
491
  end
44
492
  end
45
493
  end