post-for-me 0.1.0.pre.alpha.8 → 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 +30 -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 +87 -1
  12. data/lib/post_for_me/models/create_social_post.rb +221 -2
  13. data/lib/post_for_me/models/facebook_configuration_dto.rb +106 -2
  14. data/lib/post_for_me/models/instagram_configuration_dto.rb +104 -2
  15. data/lib/post_for_me/models/linkedin_configuration_dto.rb +87 -1
  16. data/lib/post_for_me/models/pinterest_configuration_dto.rb +87 -1
  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 +87 -1
  20. data/lib/post_for_me/models/tiktok_configuration.rb +96 -2
  21. data/lib/post_for_me/models/twitter_configuration_dto.rb +180 -2
  22. data/lib/post_for_me/models/youtube_configuration_dto.rb +87 -1
  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 +180 -0
  30. data/rbi/post_for_me/models/create_social_post.rbi +424 -0
  31. data/rbi/post_for_me/models/facebook_configuration_dto.rbi +198 -0
  32. data/rbi/post_for_me/models/instagram_configuration_dto.rbi +205 -3
  33. data/rbi/post_for_me/models/linkedin_configuration_dto.rbi +182 -0
  34. data/rbi/post_for_me/models/pinterest_configuration_dto.rbi +184 -0
  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 +180 -0
  38. data/rbi/post_for_me/models/tiktok_configuration.rbi +180 -0
  39. data/rbi/post_for_me/models/twitter_configuration_dto.rbi +390 -2
  40. data/rbi/post_for_me/models/youtube_configuration_dto.rbi +180 -0
  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 +73 -1
  44. data/sig/post_for_me/models/create_social_post.rbs +180 -1
  45. data/sig/post_for_me/models/facebook_configuration_dto.rbs +83 -1
  46. data/sig/post_for_me/models/instagram_configuration_dto.rbs +86 -4
  47. data/sig/post_for_me/models/linkedin_configuration_dto.rbs +73 -1
  48. data/sig/post_for_me/models/pinterest_configuration_dto.rbs +73 -1
  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 +73 -1
  52. data/sig/post_for_me/models/tiktok_configuration.rbs +78 -1
  53. data/sig/post_for_me/models/twitter_configuration_dto.rbs +163 -4
  54. data/sig/post_for_me/models/youtube_configuration_dto.rbs +73 -1
  55. metadata +2 -2
@@ -84,10 +84,9 @@ module PostForMe
84
84
 
85
85
  # @api private
86
86
  sig do
87
- params(
88
- status: Integer,
89
- headers: T.any(T::Hash[String, String], Net::HTTPHeader)
90
- ).returns(T::Boolean)
87
+ params(status: Integer, headers: T::Hash[String, String]).returns(
88
+ T::Boolean
89
+ )
91
90
  end
92
91
  def should_retry?(status, headers:)
93
92
  end
@@ -97,7 +96,7 @@ module PostForMe
97
96
  params(
98
97
  request: PostForMe::Internal::Transport::BaseClient::RequestInput,
99
98
  status: Integer,
100
- response_headers: T.any(T::Hash[String, String], Net::HTTPHeader)
99
+ response_headers: T::Hash[String, String]
101
100
  ).returns(PostForMe::Internal::Transport::BaseClient::RequestInput)
102
101
  end
103
102
  def follow_redirect(request, status:, response_headers:)
@@ -30,7 +30,7 @@ module PostForMe
30
30
  params(
31
31
  client: PostForMe::Internal::Transport::BaseClient,
32
32
  req: PostForMe::Internal::Transport::BaseClient::RequestComponents,
33
- headers: T.any(T::Hash[String, String], Net::HTTPHeader),
33
+ headers: T::Hash[String, String],
34
34
  page_data: T.anything
35
35
  ).void
36
36
  end
@@ -361,7 +361,7 @@ module PostForMe
361
361
  # Assumes each chunk in stream has `Encoding::BINARY`.
362
362
  sig do
363
363
  params(
364
- headers: T.any(T::Hash[String, String], Net::HTTPHeader),
364
+ headers: T::Hash[String, String],
365
365
  stream: T::Enumerable[String],
366
366
  suppress_error: T::Boolean
367
367
  ).returns(T.anything)
@@ -63,6 +63,14 @@ module PostForMe
63
63
  sig { returns(String) }
64
64
  attr_accessor :url
65
65
 
66
+ # List of tags to attach to the media
67
+ sig do
68
+ returns(
69
+ T.nilable(T::Array[PostForMe::BlueskyConfigurationDto::Media::Tag])
70
+ )
71
+ end
72
+ attr_accessor :tags
73
+
66
74
  # Timestamp in milliseconds of frame to use as thumbnail for the media
67
75
  sig { returns(T.nilable(T.anything)) }
68
76
  attr_accessor :thumbnail_timestamp_ms
@@ -74,6 +82,10 @@ module PostForMe
74
82
  sig do
75
83
  params(
76
84
  url: String,
85
+ tags:
86
+ T.nilable(
87
+ T::Array[PostForMe::BlueskyConfigurationDto::Media::Tag::OrHash]
88
+ ),
77
89
  thumbnail_timestamp_ms: T.nilable(T.anything),
78
90
  thumbnail_url: T.nilable(T.anything)
79
91
  ).returns(T.attached_class)
@@ -81,6 +93,8 @@ module PostForMe
81
93
  def self.new(
82
94
  # Public URL of the media
83
95
  url:,
96
+ # List of tags to attach to the media
97
+ tags: nil,
84
98
  # Timestamp in milliseconds of frame to use as thumbnail for the media
85
99
  thumbnail_timestamp_ms: nil,
86
100
  # Public URL of the thumbnail for the media
@@ -92,6 +106,10 @@ module PostForMe
92
106
  override.returns(
93
107
  {
94
108
  url: String,
109
+ tags:
110
+ T.nilable(
111
+ T::Array[PostForMe::BlueskyConfigurationDto::Media::Tag]
112
+ ),
95
113
  thumbnail_timestamp_ms: T.nilable(T.anything),
96
114
  thumbnail_url: T.nilable(T.anything)
97
115
  }
@@ -99,6 +117,168 @@ module PostForMe
99
117
  end
100
118
  def to_hash
101
119
  end
120
+
121
+ class Tag < PostForMe::Internal::Type::BaseModel
122
+ OrHash =
123
+ T.type_alias do
124
+ T.any(
125
+ PostForMe::BlueskyConfigurationDto::Media::Tag,
126
+ PostForMe::Internal::AnyHash
127
+ )
128
+ end
129
+
130
+ # Facebook User ID, Instagram Username or Instagram product id to tag
131
+ sig { returns(String) }
132
+ attr_accessor :id
133
+
134
+ # The platform for the tags
135
+ sig do
136
+ returns(
137
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Platform::OrSymbol
138
+ )
139
+ end
140
+ attr_accessor :platform
141
+
142
+ # The type of tag, user to tag accounts, product to tag products (only supported
143
+ # for instagram)
144
+ sig do
145
+ returns(
146
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Type::OrSymbol
147
+ )
148
+ end
149
+ attr_accessor :type
150
+
151
+ # Percentage distance from left edge of the image, Not required for videos or
152
+ # stories
153
+ sig { returns(T.nilable(Float)) }
154
+ attr_reader :x
155
+
156
+ sig { params(x: Float).void }
157
+ attr_writer :x
158
+
159
+ # Percentage distance from top edge of the image, Not required for videos or
160
+ # stories
161
+ sig { returns(T.nilable(Float)) }
162
+ attr_reader :y_
163
+
164
+ sig { params(y_: Float).void }
165
+ attr_writer :y_
166
+
167
+ sig do
168
+ params(
169
+ id: String,
170
+ platform:
171
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Platform::OrSymbol,
172
+ type:
173
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Type::OrSymbol,
174
+ x: Float,
175
+ y_: Float
176
+ ).returns(T.attached_class)
177
+ end
178
+ def self.new(
179
+ # Facebook User ID, Instagram Username or Instagram product id to tag
180
+ id:,
181
+ # The platform for the tags
182
+ platform:,
183
+ # The type of tag, user to tag accounts, product to tag products (only supported
184
+ # for instagram)
185
+ type:,
186
+ # Percentage distance from left edge of the image, Not required for videos or
187
+ # stories
188
+ x: nil,
189
+ # Percentage distance from top edge of the image, Not required for videos or
190
+ # stories
191
+ y_: nil
192
+ )
193
+ end
194
+
195
+ sig do
196
+ override.returns(
197
+ {
198
+ id: String,
199
+ platform:
200
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Platform::OrSymbol,
201
+ type:
202
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Type::OrSymbol,
203
+ x: Float,
204
+ y_: Float
205
+ }
206
+ )
207
+ end
208
+ def to_hash
209
+ end
210
+
211
+ # The platform for the tags
212
+ module Platform
213
+ extend PostForMe::Internal::Type::Enum
214
+
215
+ TaggedSymbol =
216
+ T.type_alias do
217
+ T.all(
218
+ Symbol,
219
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Platform
220
+ )
221
+ end
222
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
223
+
224
+ FACEBOOK =
225
+ T.let(
226
+ :facebook,
227
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Platform::TaggedSymbol
228
+ )
229
+ INSTAGRAM =
230
+ T.let(
231
+ :instagram,
232
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Platform::TaggedSymbol
233
+ )
234
+
235
+ sig do
236
+ override.returns(
237
+ T::Array[
238
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Platform::TaggedSymbol
239
+ ]
240
+ )
241
+ end
242
+ def self.values
243
+ end
244
+ end
245
+
246
+ # The type of tag, user to tag accounts, product to tag products (only supported
247
+ # for instagram)
248
+ module Type
249
+ extend PostForMe::Internal::Type::Enum
250
+
251
+ TaggedSymbol =
252
+ T.type_alias do
253
+ T.all(
254
+ Symbol,
255
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Type
256
+ )
257
+ end
258
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
259
+
260
+ USER =
261
+ T.let(
262
+ :user,
263
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Type::TaggedSymbol
264
+ )
265
+ PRODUCT =
266
+ T.let(
267
+ :product,
268
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Type::TaggedSymbol
269
+ )
270
+
271
+ sig do
272
+ override.returns(
273
+ T::Array[
274
+ PostForMe::BlueskyConfigurationDto::Media::Tag::Type::TaggedSymbol
275
+ ]
276
+ )
277
+ end
278
+ def self.values
279
+ end
280
+ end
281
+ end
102
282
  end
103
283
  end
104
284
  end