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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -0
- data/README.md +1 -1
- data/lib/post_for_me/errors.rb +25 -11
- data/lib/post_for_me/file_part.rb +10 -7
- data/lib/post_for_me/internal/transport/base_client.rb +11 -7
- data/lib/post_for_me/internal/transport/pooled_net_requester.rb +7 -10
- data/lib/post_for_me/internal/type/base_page.rb +1 -1
- data/lib/post_for_me/internal/type/file_input.rb +7 -4
- data/lib/post_for_me/internal/util.rb +3 -2
- data/lib/post_for_me/models/bluesky_configuration_dto.rb +118 -3
- data/lib/post_for_me/models/create_social_post.rb +221 -2
- data/lib/post_for_me/models/facebook_configuration_dto.rb +137 -4
- data/lib/post_for_me/models/instagram_configuration_dto.rb +135 -4
- data/lib/post_for_me/models/linkedin_configuration_dto.rb +118 -3
- data/lib/post_for_me/models/pinterest_configuration_dto.rb +118 -3
- data/lib/post_for_me/models/social_account_create_auth_url_params.rb +43 -1
- data/lib/post_for_me/models/social_post.rb +221 -2
- data/lib/post_for_me/models/threads_configuration_dto.rb +118 -3
- data/lib/post_for_me/models/tiktok_configuration.rb +127 -4
- data/lib/post_for_me/models/twitter_configuration_dto.rb +211 -4
- data/lib/post_for_me/models/youtube_configuration_dto.rb +118 -3
- data/lib/post_for_me/version.rb +1 -1
- data/rbi/post_for_me/errors.rbi +29 -2
- data/rbi/post_for_me/file_part.rbi +1 -1
- data/rbi/post_for_me/internal/transport/base_client.rbi +4 -5
- data/rbi/post_for_me/internal/type/base_page.rbi +1 -1
- data/rbi/post_for_me/internal/util.rbi +1 -1
- data/rbi/post_for_me/models/bluesky_configuration_dto.rbi +243 -3
- data/rbi/post_for_me/models/create_social_post.rbi +424 -0
- data/rbi/post_for_me/models/facebook_configuration_dto.rbi +258 -3
- data/rbi/post_for_me/models/instagram_configuration_dto.rbi +267 -6
- data/rbi/post_for_me/models/linkedin_configuration_dto.rbi +245 -3
- data/rbi/post_for_me/models/pinterest_configuration_dto.rbi +246 -3
- data/rbi/post_for_me/models/social_account_create_auth_url_params.rbi +104 -0
- data/rbi/post_for_me/models/social_post.rbi +414 -0
- data/rbi/post_for_me/models/threads_configuration_dto.rbi +240 -3
- data/rbi/post_for_me/models/tiktok_configuration.rbi +237 -3
- data/rbi/post_for_me/models/twitter_configuration_dto.rbi +452 -4
- data/rbi/post_for_me/models/youtube_configuration_dto.rbi +240 -3
- data/sig/post_for_me/errors.rbs +7 -0
- data/sig/post_for_me/file_part.rbs +1 -1
- data/sig/post_for_me/models/bluesky_configuration_dto.rbs +109 -4
- data/sig/post_for_me/models/create_social_post.rbs +180 -1
- data/sig/post_for_me/models/facebook_configuration_dto.rbs +109 -4
- data/sig/post_for_me/models/instagram_configuration_dto.rbs +112 -7
- data/sig/post_for_me/models/linkedin_configuration_dto.rbs +109 -4
- data/sig/post_for_me/models/pinterest_configuration_dto.rbs +99 -4
- data/sig/post_for_me/models/social_account_create_auth_url_params.rbs +37 -0
- data/sig/post_for_me/models/social_post.rbs +180 -1
- data/sig/post_for_me/models/threads_configuration_dto.rbs +99 -4
- data/sig/post_for_me/models/tiktok_configuration.rbs +104 -4
- data/sig/post_for_me/models/twitter_configuration_dto.rbs +196 -4
- data/sig/post_for_me/models/youtube_configuration_dto.rbs +107 -4
- metadata +2 -2
data/rbi/post_for_me/errors.rbi
CHANGED
|
@@ -33,6 +33,9 @@ module PostForMe
|
|
|
33
33
|
sig { returns(T.nilable(Integer)) }
|
|
34
34
|
attr_accessor :status
|
|
35
35
|
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
37
|
+
attr_accessor :headers
|
|
38
|
+
|
|
36
39
|
sig { returns(T.nilable(T.anything)) }
|
|
37
40
|
attr_accessor :body
|
|
38
41
|
|
|
@@ -41,6 +44,7 @@ module PostForMe
|
|
|
41
44
|
params(
|
|
42
45
|
url: URI::Generic,
|
|
43
46
|
status: T.nilable(Integer),
|
|
47
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
44
48
|
body: T.nilable(Object),
|
|
45
49
|
request: NilClass,
|
|
46
50
|
response: NilClass,
|
|
@@ -50,6 +54,7 @@ module PostForMe
|
|
|
50
54
|
def self.new(
|
|
51
55
|
url:,
|
|
52
56
|
status: nil,
|
|
57
|
+
headers: nil,
|
|
53
58
|
body: nil,
|
|
54
59
|
request: nil,
|
|
55
60
|
response: nil,
|
|
@@ -70,6 +75,7 @@ module PostForMe
|
|
|
70
75
|
params(
|
|
71
76
|
url: URI::Generic,
|
|
72
77
|
status: NilClass,
|
|
78
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
73
79
|
body: NilClass,
|
|
74
80
|
request: NilClass,
|
|
75
81
|
response: NilClass,
|
|
@@ -79,6 +85,7 @@ module PostForMe
|
|
|
79
85
|
def self.new(
|
|
80
86
|
url:,
|
|
81
87
|
status: nil,
|
|
88
|
+
headers: nil,
|
|
82
89
|
body: nil,
|
|
83
90
|
request: nil,
|
|
84
91
|
response: nil,
|
|
@@ -93,6 +100,7 @@ module PostForMe
|
|
|
93
100
|
params(
|
|
94
101
|
url: URI::Generic,
|
|
95
102
|
status: NilClass,
|
|
103
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
96
104
|
body: NilClass,
|
|
97
105
|
request: NilClass,
|
|
98
106
|
response: NilClass,
|
|
@@ -102,6 +110,7 @@ module PostForMe
|
|
|
102
110
|
def self.new(
|
|
103
111
|
url:,
|
|
104
112
|
status: nil,
|
|
113
|
+
headers: nil,
|
|
105
114
|
body: nil,
|
|
106
115
|
request: nil,
|
|
107
116
|
response: nil,
|
|
@@ -116,13 +125,22 @@ module PostForMe
|
|
|
116
125
|
params(
|
|
117
126
|
url: URI::Generic,
|
|
118
127
|
status: Integer,
|
|
128
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
119
129
|
body: T.nilable(Object),
|
|
120
130
|
request: NilClass,
|
|
121
131
|
response: NilClass,
|
|
122
132
|
message: T.nilable(String)
|
|
123
133
|
).returns(T.attached_class)
|
|
124
134
|
end
|
|
125
|
-
def self.for(
|
|
135
|
+
def self.for(
|
|
136
|
+
url:,
|
|
137
|
+
status:,
|
|
138
|
+
headers:,
|
|
139
|
+
body:,
|
|
140
|
+
request:,
|
|
141
|
+
response:,
|
|
142
|
+
message: nil
|
|
143
|
+
)
|
|
126
144
|
end
|
|
127
145
|
|
|
128
146
|
sig { returns(Integer) }
|
|
@@ -133,13 +151,22 @@ module PostForMe
|
|
|
133
151
|
params(
|
|
134
152
|
url: URI::Generic,
|
|
135
153
|
status: Integer,
|
|
154
|
+
headers: T.nilable(T::Hash[String, String]),
|
|
136
155
|
body: T.nilable(Object),
|
|
137
156
|
request: NilClass,
|
|
138
157
|
response: NilClass,
|
|
139
158
|
message: T.nilable(String)
|
|
140
159
|
).returns(T.attached_class)
|
|
141
160
|
end
|
|
142
|
-
def self.new(
|
|
161
|
+
def self.new(
|
|
162
|
+
url:,
|
|
163
|
+
status:,
|
|
164
|
+
headers:,
|
|
165
|
+
body:,
|
|
166
|
+
request:,
|
|
167
|
+
response:,
|
|
168
|
+
message: nil
|
|
169
|
+
)
|
|
143
170
|
end
|
|
144
171
|
end
|
|
145
172
|
|
|
@@ -84,10 +84,9 @@ module PostForMe
|
|
|
84
84
|
|
|
85
85
|
# @api private
|
|
86
86
|
sig do
|
|
87
|
-
params(
|
|
88
|
-
|
|
89
|
-
|
|
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
|
|
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
|
|
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
|
|
364
|
+
headers: T::Hash[String, String],
|
|
365
365
|
stream: T::Enumerable[String],
|
|
366
366
|
suppress_error: T::Boolean
|
|
367
367
|
).returns(T.anything)
|
|
@@ -16,13 +16,18 @@ module PostForMe
|
|
|
16
16
|
attr_accessor :caption
|
|
17
17
|
|
|
18
18
|
# Overrides the `media` from the post
|
|
19
|
-
sig
|
|
19
|
+
sig do
|
|
20
|
+
returns(T.nilable(T::Array[PostForMe::BlueskyConfigurationDto::Media]))
|
|
21
|
+
end
|
|
20
22
|
attr_accessor :media
|
|
21
23
|
|
|
22
24
|
sig do
|
|
23
25
|
params(
|
|
24
26
|
caption: T.nilable(T.anything),
|
|
25
|
-
media:
|
|
27
|
+
media:
|
|
28
|
+
T.nilable(
|
|
29
|
+
T::Array[PostForMe::BlueskyConfigurationDto::Media::OrHash]
|
|
30
|
+
)
|
|
26
31
|
).returns(T.attached_class)
|
|
27
32
|
end
|
|
28
33
|
def self.new(
|
|
@@ -35,11 +40,246 @@ module PostForMe
|
|
|
35
40
|
|
|
36
41
|
sig do
|
|
37
42
|
override.returns(
|
|
38
|
-
{
|
|
43
|
+
{
|
|
44
|
+
caption: T.nilable(T.anything),
|
|
45
|
+
media:
|
|
46
|
+
T.nilable(T::Array[PostForMe::BlueskyConfigurationDto::Media])
|
|
47
|
+
}
|
|
39
48
|
)
|
|
40
49
|
end
|
|
41
50
|
def to_hash
|
|
42
51
|
end
|
|
52
|
+
|
|
53
|
+
class Media < PostForMe::Internal::Type::BaseModel
|
|
54
|
+
OrHash =
|
|
55
|
+
T.type_alias do
|
|
56
|
+
T.any(
|
|
57
|
+
PostForMe::BlueskyConfigurationDto::Media,
|
|
58
|
+
PostForMe::Internal::AnyHash
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Public URL of the media
|
|
63
|
+
sig { returns(String) }
|
|
64
|
+
attr_accessor :url
|
|
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
|
+
|
|
74
|
+
# Timestamp in milliseconds of frame to use as thumbnail for the media
|
|
75
|
+
sig { returns(T.nilable(T.anything)) }
|
|
76
|
+
attr_accessor :thumbnail_timestamp_ms
|
|
77
|
+
|
|
78
|
+
# Public URL of the thumbnail for the media
|
|
79
|
+
sig { returns(T.nilable(T.anything)) }
|
|
80
|
+
attr_accessor :thumbnail_url
|
|
81
|
+
|
|
82
|
+
sig do
|
|
83
|
+
params(
|
|
84
|
+
url: String,
|
|
85
|
+
tags:
|
|
86
|
+
T.nilable(
|
|
87
|
+
T::Array[PostForMe::BlueskyConfigurationDto::Media::Tag::OrHash]
|
|
88
|
+
),
|
|
89
|
+
thumbnail_timestamp_ms: T.nilable(T.anything),
|
|
90
|
+
thumbnail_url: T.nilable(T.anything)
|
|
91
|
+
).returns(T.attached_class)
|
|
92
|
+
end
|
|
93
|
+
def self.new(
|
|
94
|
+
# Public URL of the media
|
|
95
|
+
url:,
|
|
96
|
+
# List of tags to attach to the media
|
|
97
|
+
tags: nil,
|
|
98
|
+
# Timestamp in milliseconds of frame to use as thumbnail for the media
|
|
99
|
+
thumbnail_timestamp_ms: nil,
|
|
100
|
+
# Public URL of the thumbnail for the media
|
|
101
|
+
thumbnail_url: nil
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
sig do
|
|
106
|
+
override.returns(
|
|
107
|
+
{
|
|
108
|
+
url: String,
|
|
109
|
+
tags:
|
|
110
|
+
T.nilable(
|
|
111
|
+
T::Array[PostForMe::BlueskyConfigurationDto::Media::Tag]
|
|
112
|
+
),
|
|
113
|
+
thumbnail_timestamp_ms: T.nilable(T.anything),
|
|
114
|
+
thumbnail_url: T.nilable(T.anything)
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
def to_hash
|
|
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
|
|
282
|
+
end
|
|
43
283
|
end
|
|
44
284
|
end
|
|
45
285
|
end
|