post-for-me 0.1.0.pre.alpha.17 → 0.1.0.pre.alpha.18

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/post_for_me/client.rb +56 -0
  5. data/lib/post_for_me/internal/util.rb +53 -7
  6. data/lib/post_for_me/models/social_account_disconnect_params.rb +7 -1
  7. data/lib/post_for_me/models/social_account_feed_list_params.rb +8 -1
  8. data/lib/post_for_me/models/social_account_retrieve_params.rb +7 -1
  9. data/lib/post_for_me/models/social_account_update_params.rb +8 -1
  10. data/lib/post_for_me/models/social_post_delete_params.rb +7 -1
  11. data/lib/post_for_me/models/social_post_result_retrieve_params.rb +7 -1
  12. data/lib/post_for_me/models/social_post_retrieve_params.rb +7 -1
  13. data/lib/post_for_me/models/social_post_update_params.rb +7 -1
  14. data/lib/post_for_me/resources/media.rb +8 -0
  15. data/lib/post_for_me/resources/social_account_feeds.rb +29 -1
  16. data/lib/post_for_me/resources/social_accounts.rb +6 -1
  17. data/lib/post_for_me/resources/social_post_results.rb +8 -1
  18. data/lib/post_for_me/resources/social_posts.rb +13 -1
  19. data/lib/post_for_me/version.rb +1 -1
  20. data/rbi/post_for_me/client.rbi +56 -0
  21. data/rbi/post_for_me/internal/util.rbi +28 -0
  22. data/rbi/post_for_me/models/social_account_disconnect_params.rbi +13 -5
  23. data/rbi/post_for_me/models/social_account_feed_list_params.rbi +6 -0
  24. data/rbi/post_for_me/models/social_account_retrieve_params.rbi +13 -5
  25. data/rbi/post_for_me/models/social_account_update_params.rbi +6 -0
  26. data/rbi/post_for_me/models/social_post_delete_params.rbi +13 -5
  27. data/rbi/post_for_me/models/social_post_result_retrieve_params.rbi +13 -5
  28. data/rbi/post_for_me/models/social_post_retrieve_params.rbi +13 -5
  29. data/rbi/post_for_me/models/social_post_update_params.rbi +13 -5
  30. data/rbi/post_for_me/resources/media.rbi +8 -0
  31. data/rbi/post_for_me/resources/social_account_feeds.rbi +27 -0
  32. data/rbi/post_for_me/resources/social_accounts.rbi +4 -0
  33. data/rbi/post_for_me/resources/social_post_results.rbi +6 -0
  34. data/rbi/post_for_me/resources/social_posts.rbi +11 -0
  35. data/sig/post_for_me/internal/util.rbs +14 -0
  36. data/sig/post_for_me/models/social_account_disconnect_params.rbs +8 -3
  37. data/sig/post_for_me/models/social_account_feed_list_params.rbs +5 -0
  38. data/sig/post_for_me/models/social_account_retrieve_params.rbs +8 -3
  39. data/sig/post_for_me/models/social_account_update_params.rbs +5 -1
  40. data/sig/post_for_me/models/social_post_delete_params.rbs +8 -3
  41. data/sig/post_for_me/models/social_post_result_retrieve_params.rbs +8 -3
  42. data/sig/post_for_me/models/social_post_retrieve_params.rbs +8 -3
  43. data/sig/post_for_me/models/social_post_update_params.rbs +10 -3
  44. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0aa7eb0890e81b6319514e88ed70753a3258bf72d6febfb380f2b0980367c465
4
- data.tar.gz: d9bffe74e4a802265752d621d67819a9c1ae68ae267f18e56a94a303cb20b2cd
3
+ metadata.gz: 9eed2cd59d70c8ae5e1ea6cfd03e89c0f110611e2bb3831e7501e08e15ea10d6
4
+ data.tar.gz: 158166b3b8406e1a13a49f3bd042a4643f53c5605445f0b2a7440944d4f37cac
5
5
  SHA512:
6
- metadata.gz: 4b71518922b6811f7221ae34ef93cea419d650204a1b18c255d9807af47499f4c0cdd616bea296e3d541a3c2857cedbbf84ae24d6cdcf3d7f08a72d1f1d5779b
7
- data.tar.gz: 69b4f5a5e35ecfeb45bda718ca05c2406c54148035584a7217d2e306d3db577144aaebbb59bab47413d512e299ab5bb869329c6c759fdd438b00a5a07f205f06
6
+ metadata.gz: d183c77fab58c6f4bec0864c088c2b612a802ecf3b40fdada9b3404ef76ae18534f9bbe929012890161c5c399b487bcfeecd2319930e00562ff19b99b63396d5
7
+ data.tar.gz: 39352e27642ba2394a662e6aff18a249bfde42cb77bc3eb59d945e0213a486aab6c25a34ff93cd83db951a7be85f7358dda4e282e9e034dd99f2deeee6c38f6c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.18 (2026-04-09)
4
+
5
+ Full Changelog: [v0.1.0-alpha.17...v0.1.0-alpha.18](https://github.com/DayMoonDevelopment/post-for-me-ruby/compare/v0.1.0-alpha.17...v0.1.0-alpha.18)
6
+
7
+ ### Bug Fixes
8
+
9
+ * align path encoding with RFC 3986 section 3.3 ([5e8429d](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/5e8429d974824fbc4d847413b3e8bd612dbcd851))
10
+ * **internal:** correct multipart form field name encoding ([f133b65](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/f133b650007ec201c8dbe3dbf5854c0400088adc))
11
+ * multipart encoding for file arrays ([05c4d34](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/05c4d34882e35d2b8a94cd1ecfc2695d7aefb79b))
12
+ * variable name typo ([607afe2](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/607afe2816f91dc50d1cbf7880daf4014d1f89cb))
13
+
14
+
15
+ ### Chores
16
+
17
+ * **ci:** add build step ([6391f3c](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/6391f3c681af595c2f73cddaace104dce2b15e12))
18
+ * **ci:** skip lint on metadata-only changes ([58ef31a](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/58ef31a5a6c62da6fd037362968fa9e15d93d60b))
19
+ * **ci:** skip uploading artifacts on stainless-internal branches ([46e23f9](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/46e23f927077632b32e60b5467b9e9c057031185))
20
+ * **ci:** support opting out of skipping builds on metadata-only commits ([796b828](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/796b828074976fed14ae192391168fc5aa403fcb))
21
+ * **internal:** codegen related update ([f3c84a7](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/f3c84a76a70aa10335a783f0d98adc7e52c499fd))
22
+ * **internal:** codegen related update ([1c6520b](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/1c6520b949d3cb853ec7ee8b46b0f4c55c655e9f))
23
+ * **internal:** tweak CI branches ([6a53792](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/6a53792c6e565f0ec0ff0f68761aed6eac1e8006))
24
+ * **internal:** update gitignore ([1a1a97b](https://github.com/DayMoonDevelopment/post-for-me-ruby/commit/1a1a97b214f5772b50803f6109a3a3b484a36906))
25
+
3
26
  ## 0.1.0-alpha.17 (2026-02-27)
4
27
 
5
28
  Full Changelog: [v0.1.0-alpha.16...v0.1.0-alpha.17](https://github.com/DayMoonDevelopment/post-for-me-ruby/compare/v0.1.0-alpha.16...v0.1.0-alpha.17)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "post-for-me", "~> 0.1.0.pre.alpha.17"
29
+ gem "post-for-me", "~> 0.1.0.pre.alpha.18"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -18,18 +18,74 @@ module PostForMe
18
18
  # @return [String]
19
19
  attr_reader :api_key
20
20
 
21
+ # Media are media assets (images, videos, etc.) that can be attached to posts
22
+ # using the media url. These endpoints are only needed if your media is not
23
+ # already available on a publicly accessible URL. Media assets are stored
24
+ # temporarily and are automatically deleted in the following scenarios:
25
+ #
26
+ # - When the associated post is published
27
+ # - After 24 hours if not attached to any post
28
+ # - When the scheduled post is deleted
21
29
  # @return [PostForMe::Resources::Media]
22
30
  attr_reader :media
23
31
 
32
+ # Posts represent content that can be published across multiple social media
33
+ # platforms. Each post can have platform-specific content variations, allowing
34
+ # customization for different platforms and accounts. Content can be defined at
35
+ # three levels:
36
+ #
37
+ # 1. Default content for all platforms
38
+ # 2. Platform-specific content overrides
39
+ # 3. Account-specific content overrides
40
+ #
41
+ # The system will use the most specific content override available when publishing
42
+ # to each platform and account.
24
43
  # @return [PostForMe::Resources::SocialPosts]
25
44
  attr_reader :social_posts
26
45
 
46
+ # Post results represent the outcome of publishing content to various social media
47
+ # platforms. They provide comprehensive information including:
48
+ #
49
+ # - Publication status (success/failure)
50
+ # - Any errors or issues encountered during posting
51
+ # - Platform url to view the published post
27
52
  # @return [PostForMe::Resources::SocialPostResults]
28
53
  attr_reader :social_post_results
29
54
 
55
+ # Social accounts represent platform-specific accounts (e.g. Twitter, LinkedIn,
56
+ # Facebook) that are used for publishing posts. Each social account has a unique
57
+ # `id` that can be referenced when creating or scheduling posts to specify which
58
+ # platforms the content should be published to.
30
59
  # @return [PostForMe::Resources::SocialAccounts]
31
60
  attr_reader :social_accounts
32
61
 
62
+ # The social account feed is every post made for the social account, including
63
+ # posts not made through our API. Use this endpoint to get the platform details
64
+ # for any post made under the connected account. To use this endpoint accounts
65
+ # must be connected with the **"feeds" permission**.
66
+ #
67
+ # Details will include:
68
+ #
69
+ # - Post information including caption, url, media, etc..
70
+ # - When passing **expand=metrics**, Metrics information including views, likes,
71
+ # follows, etc..
72
+ #
73
+ # Note: Currently the following platforms are supported:
74
+ #
75
+ # - **Instagram**, may take up to 48 hours for some metrics to be avaialbe
76
+ # - **Facebook**
77
+ # - **TikTok**, consumer API exposes less analytics for more details connect
78
+ # through TikTok Business
79
+ # - **TikTok Business**,
80
+ # - **Youtube**
81
+ # - **Threads**, If using our Quickstart project then metrics are currently
82
+ # unavailable.
83
+ # - **X (Twitter)**
84
+ # - **Bluesky**, Bluesky does not expose views or impressions through their API.
85
+ # - **Pinterest**
86
+ # - **LinkedIn**, metrics are only available for company pages. LinkedIn has
87
+ # currently stopped giving permission for personal page analytics, we are on the
88
+ # waitlist for when they resume.
33
89
  # @return [PostForMe::Resources::SocialAccountFeeds]
34
90
  attr_reader :social_account_feeds
35
91
 
@@ -157,7 +157,7 @@ module PostForMe
157
157
  in Hash | nil => coerced
158
158
  coerced
159
159
  else
160
- message = "Expected a #{Hash} or #{PostForMe::Internal::Type::BaseModel}, got #{data.inspect}"
160
+ message = "Expected a #{Hash} or #{PostForMe::Internal::Type::BaseModel}, got #{input.inspect}"
161
161
  raise ArgumentError.new(message)
162
162
  end
163
163
  end
@@ -237,6 +237,11 @@ module PostForMe
237
237
  end
238
238
  end
239
239
 
240
+ # @type [Regexp]
241
+ #
242
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
243
+ RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
244
+
240
245
  class << self
241
246
  # @api private
242
247
  #
@@ -247,6 +252,15 @@ module PostForMe
247
252
  "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248
253
  end
249
254
 
255
+ # @api private
256
+ #
257
+ # @param path [String, Integer]
258
+ #
259
+ # @return [String]
260
+ def encode_path(path)
261
+ path.to_s.gsub(PostForMe::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
262
+ end
263
+
250
264
  # @api private
251
265
  #
252
266
  # @param path [String, Array<String>]
@@ -259,7 +273,7 @@ module PostForMe
259
273
  in []
260
274
  ""
261
275
  in [String => p, *interpolations]
262
- encoded = interpolations.map { ERB::Util.url_encode(_1) }
276
+ encoded = interpolations.map { encode_path(_1) }
263
277
  format(p, *encoded)
264
278
  end
265
279
  end
@@ -490,6 +504,37 @@ module PostForMe
490
504
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
505
 
492
506
  class << self
507
+ # @api private
508
+ #
509
+ # @param query [Hash{Symbol=>Object}]
510
+ #
511
+ # @return [Hash{Symbol=>Object}]
512
+ def encode_query_params(query)
513
+ out = {}
514
+ query.each { write_query_param_element!(out, _1, _2) }
515
+ out
516
+ end
517
+
518
+ # @api private
519
+ #
520
+ # @param collection [Hash{Symbol=>Object}]
521
+ # @param key [String]
522
+ # @param element [Object]
523
+ #
524
+ # @return [nil]
525
+ private def write_query_param_element!(collection, key, element)
526
+ case element
527
+ in Hash
528
+ element.each do |name, value|
529
+ write_query_param_element!(collection, "#{key}[#{name}]", value)
530
+ end
531
+ in Array
532
+ collection[key] = element.map(&:to_s).join(",")
533
+ else
534
+ collection[key] = element.to_s
535
+ end
536
+ end
537
+
493
538
  # @api private
494
539
  #
495
540
  # @param y [Enumerator::Yielder]
@@ -540,16 +585,15 @@ module PostForMe
540
585
  y << "Content-Disposition: form-data"
541
586
 
542
587
  unless key.nil?
543
- name = ERB::Util.url_encode(key.to_s)
544
- y << "; name=\"#{name}\""
588
+ y << "; name=\"#{key}\""
545
589
  end
546
590
 
547
591
  case val
548
592
  in PostForMe::FilePart unless val.filename.nil?
549
- filename = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
550
594
  y << "; filename=\"#{filename}\""
551
595
  in Pathname | IO
552
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
553
597
  y << "; filename=\"#{filename}\""
554
598
  else
555
599
  end
@@ -566,6 +610,7 @@ module PostForMe
566
610
  #
567
611
  # @return [Array(String, Enumerable<String>)]
568
612
  private def encode_multipart_streaming(body)
613
+ # rubocop:disable Style/CaseEquality
569
614
  # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
570
615
  boundary = SecureRandom.urlsafe_base64(46)
571
616
 
@@ -575,7 +620,7 @@ module PostForMe
575
620
  in Hash
576
621
  body.each do |key, val|
577
622
  case val
578
- in Array if val.all? { primitive?(_1) }
623
+ in Array if val.all? { primitive?(_1) || PostForMe::Internal::Type::FileInput === _1 }
579
624
  val.each do |v|
580
625
  write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
581
626
  end
@@ -591,6 +636,7 @@ module PostForMe
591
636
 
592
637
  fused_io = fused_enum(strio) { closing.each(&:call) }
593
638
  [boundary, fused_io]
639
+ # rubocop:enable Style/CaseEquality
594
640
  end
595
641
 
596
642
  # @api private
@@ -7,7 +7,13 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
11
17
  # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -7,6 +7,11 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute social_account_id
11
+ #
12
+ # @return [String]
13
+ required :social_account_id, String
14
+
10
15
  # @!attribute cursor
11
16
  # Cursor identifying next page of results
12
17
  #
@@ -50,10 +55,12 @@ module PostForMe
50
55
  # @return [Array<String>, nil]
51
56
  optional :social_post_id, PostForMe::Internal::Type::ArrayOf[String]
52
57
 
53
- # @!method initialize(cursor: nil, expand: nil, external_post_id: nil, limit: nil, platform_post_id: nil, social_post_id: nil, request_options: {})
58
+ # @!method initialize(social_account_id:, cursor: nil, expand: nil, external_post_id: nil, limit: nil, platform_post_id: nil, social_post_id: nil, request_options: {})
54
59
  # Some parameter documentations has been truncated, see
55
60
  # {PostForMe::Models::SocialAccountFeedListParams} for more details.
56
61
  #
62
+ # @param social_account_id [String]
63
+ #
57
64
  # @param cursor [String] Cursor identifying next page of results
58
65
  #
59
66
  # @param expand [Array<Symbol, PostForMe::Models::SocialAccountFeedListParams::Expand>] Expand additional data in the response. Currently supports: "metrics" to include
@@ -7,7 +7,13 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
11
17
  # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -7,6 +7,11 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
10
15
  # @!attribute external_id
11
16
  # The platform's external id of the social account
12
17
  #
@@ -19,7 +24,9 @@ module PostForMe
19
24
  # @return [String, nil]
20
25
  optional :username, String
21
26
 
22
- # @!method initialize(external_id: nil, username: nil, request_options: {})
27
+ # @!method initialize(id:, external_id: nil, username: nil, request_options: {})
28
+ # @param id [String]
29
+ #
23
30
  # @param external_id [String] The platform's external id of the social account
24
31
  #
25
32
  # @param username [String] The platform's username of the social account
@@ -7,7 +7,13 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
11
17
  # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -7,7 +7,13 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
11
17
  # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -7,7 +7,13 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
11
17
  # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -7,7 +7,13 @@ module PostForMe
7
7
  extend PostForMe::Internal::Type::RequestParameters::Converter
8
8
  include PostForMe::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
11
17
  # @param request_options [PostForMe::RequestOptions, Hash{Symbol=>Object}]
12
18
  end
13
19
  end
@@ -2,6 +2,14 @@
2
2
 
3
3
  module PostForMe
4
4
  module Resources
5
+ # Media are media assets (images, videos, etc.) that can be attached to posts
6
+ # using the media url. These endpoints are only needed if your media is not
7
+ # already available on a publicly accessible URL. Media assets are stored
8
+ # temporarily and are automatically deleted in the following scenarios:
9
+ #
10
+ # - When the associated post is published
11
+ # - After 24 hours if not attached to any post
12
+ # - When the scheduled post is deleted
5
13
  class Media
6
14
  # To upload media to attach to your post, make a `POST` request to the
7
15
  # `/media/create-upload-url` endpoint.
@@ -2,6 +2,33 @@
2
2
 
3
3
  module PostForMe
4
4
  module Resources
5
+ # The social account feed is every post made for the social account, including
6
+ # posts not made through our API. Use this endpoint to get the platform details
7
+ # for any post made under the connected account. To use this endpoint accounts
8
+ # must be connected with the **"feeds" permission**.
9
+ #
10
+ # Details will include:
11
+ #
12
+ # - Post information including caption, url, media, etc..
13
+ # - When passing **expand=metrics**, Metrics information including views, likes,
14
+ # follows, etc..
15
+ #
16
+ # Note: Currently the following platforms are supported:
17
+ #
18
+ # - **Instagram**, may take up to 48 hours for some metrics to be avaialbe
19
+ # - **Facebook**
20
+ # - **TikTok**, consumer API exposes less analytics for more details connect
21
+ # through TikTok Business
22
+ # - **TikTok Business**,
23
+ # - **Youtube**
24
+ # - **Threads**, If using our Quickstart project then metrics are currently
25
+ # unavailable.
26
+ # - **X (Twitter)**
27
+ # - **Bluesky**, Bluesky does not expose views or impressions through their API.
28
+ # - **Pinterest**
29
+ # - **LinkedIn**, metrics are only available for company pages. LinkedIn has
30
+ # currently stopped giving permission for personal page analytics, we are on the
31
+ # waitlist for when they resume.
5
32
  class SocialAccountFeeds
6
33
  # Some parameter documentations has been truncated, see
7
34
  # {PostForMe::Models::SocialAccountFeedListParams} for more details.
@@ -31,10 +58,11 @@ module PostForMe
31
58
  # @see PostForMe::Models::SocialAccountFeedListParams
32
59
  def list(social_account_id, params = {})
33
60
  parsed, options = PostForMe::SocialAccountFeedListParams.dump_request(params)
61
+ query = PostForMe::Internal::Util.encode_query_params(parsed)
34
62
  @client.request(
35
63
  method: :get,
36
64
  path: ["v1/social-account-feeds/%1$s", social_account_id],
37
- query: parsed,
65
+ query: query,
38
66
  model: PostForMe::Models::SocialAccountFeedListResponse,
39
67
  options: options
40
68
  )
@@ -2,6 +2,10 @@
2
2
 
3
3
  module PostForMe
4
4
  module Resources
5
+ # Social accounts represent platform-specific accounts (e.g. Twitter, LinkedIn,
6
+ # Facebook) that are used for publishing posts. Each social account has a unique
7
+ # `id` that can be referenced when creating or scheduling posts to specify which
8
+ # platforms the content should be published to.
5
9
  class SocialAccounts
6
10
  # If a social account with the same platform and user_id already exists, it will
7
11
  # be updated. If not, a new social account will be created.
@@ -114,10 +118,11 @@ module PostForMe
114
118
  # @see PostForMe::Models::SocialAccountListParams
115
119
  def list(params = {})
116
120
  parsed, options = PostForMe::SocialAccountListParams.dump_request(params)
121
+ query = PostForMe::Internal::Util.encode_query_params(parsed)
117
122
  @client.request(
118
123
  method: :get,
119
124
  path: "v1/social-accounts",
120
- query: parsed,
125
+ query: query,
121
126
  model: PostForMe::Models::SocialAccountListResponse,
122
127
  options: options
123
128
  )
@@ -2,6 +2,12 @@
2
2
 
3
3
  module PostForMe
4
4
  module Resources
5
+ # Post results represent the outcome of publishing content to various social media
6
+ # platforms. They provide comprehensive information including:
7
+ #
8
+ # - Publication status (success/failure)
9
+ # - Any errors or issues encountered during posting
10
+ # - Platform url to view the published post
5
11
  class SocialPostResults
6
12
  # Get post result by ID
7
13
  #
@@ -47,10 +53,11 @@ module PostForMe
47
53
  # @see PostForMe::Models::SocialPostResultListParams
48
54
  def list(params = {})
49
55
  parsed, options = PostForMe::SocialPostResultListParams.dump_request(params)
56
+ query = PostForMe::Internal::Util.encode_query_params(parsed)
50
57
  @client.request(
51
58
  method: :get,
52
59
  path: "v1/social-post-results",
53
- query: parsed,
60
+ query: query,
54
61
  model: PostForMe::Models::SocialPostResultListResponse,
55
62
  options: options
56
63
  )
@@ -2,6 +2,17 @@
2
2
 
3
3
  module PostForMe
4
4
  module Resources
5
+ # Posts represent content that can be published across multiple social media
6
+ # platforms. Each post can have platform-specific content variations, allowing
7
+ # customization for different platforms and accounts. Content can be defined at
8
+ # three levels:
9
+ #
10
+ # 1. Default content for all platforms
11
+ # 2. Platform-specific content overrides
12
+ # 3. Account-specific content overrides
13
+ #
14
+ # The system will use the most specific content override available when publishing
15
+ # to each platform and account.
5
16
  class SocialPosts
6
17
  # Some parameter documentations has been truncated, see
7
18
  # {PostForMe::Models::SocialPostCreateParams} for more details.
@@ -126,10 +137,11 @@ module PostForMe
126
137
  # @see PostForMe::Models::SocialPostListParams
127
138
  def list(params = {})
128
139
  parsed, options = PostForMe::SocialPostListParams.dump_request(params)
140
+ query = PostForMe::Internal::Util.encode_query_params(parsed)
129
141
  @client.request(
130
142
  method: :get,
131
143
  path: "v1/social-posts",
132
- query: parsed,
144
+ query: query,
133
145
  model: PostForMe::Models::SocialPostListResponse,
134
146
  options: options
135
147
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostForMe
4
- VERSION = "0.1.0.pre.alpha.17"
4
+ VERSION = "0.1.0.pre.alpha.18"
5
5
  end
@@ -13,18 +13,74 @@ module PostForMe
13
13
  sig { returns(String) }
14
14
  attr_reader :api_key
15
15
 
16
+ # Media are media assets (images, videos, etc.) that can be attached to posts
17
+ # using the media url. These endpoints are only needed if your media is not
18
+ # already available on a publicly accessible URL. Media assets are stored
19
+ # temporarily and are automatically deleted in the following scenarios:
20
+ #
21
+ # - When the associated post is published
22
+ # - After 24 hours if not attached to any post
23
+ # - When the scheduled post is deleted
16
24
  sig { returns(PostForMe::Resources::Media) }
17
25
  attr_reader :media
18
26
 
27
+ # Posts represent content that can be published across multiple social media
28
+ # platforms. Each post can have platform-specific content variations, allowing
29
+ # customization for different platforms and accounts. Content can be defined at
30
+ # three levels:
31
+ #
32
+ # 1. Default content for all platforms
33
+ # 2. Platform-specific content overrides
34
+ # 3. Account-specific content overrides
35
+ #
36
+ # The system will use the most specific content override available when publishing
37
+ # to each platform and account.
19
38
  sig { returns(PostForMe::Resources::SocialPosts) }
20
39
  attr_reader :social_posts
21
40
 
41
+ # Post results represent the outcome of publishing content to various social media
42
+ # platforms. They provide comprehensive information including:
43
+ #
44
+ # - Publication status (success/failure)
45
+ # - Any errors or issues encountered during posting
46
+ # - Platform url to view the published post
22
47
  sig { returns(PostForMe::Resources::SocialPostResults) }
23
48
  attr_reader :social_post_results
24
49
 
50
+ # Social accounts represent platform-specific accounts (e.g. Twitter, LinkedIn,
51
+ # Facebook) that are used for publishing posts. Each social account has a unique
52
+ # `id` that can be referenced when creating or scheduling posts to specify which
53
+ # platforms the content should be published to.
25
54
  sig { returns(PostForMe::Resources::SocialAccounts) }
26
55
  attr_reader :social_accounts
27
56
 
57
+ # The social account feed is every post made for the social account, including
58
+ # posts not made through our API. Use this endpoint to get the platform details
59
+ # for any post made under the connected account. To use this endpoint accounts
60
+ # must be connected with the **"feeds" permission**.
61
+ #
62
+ # Details will include:
63
+ #
64
+ # - Post information including caption, url, media, etc..
65
+ # - When passing **expand=metrics**, Metrics information including views, likes,
66
+ # follows, etc..
67
+ #
68
+ # Note: Currently the following platforms are supported:
69
+ #
70
+ # - **Instagram**, may take up to 48 hours for some metrics to be avaialbe
71
+ # - **Facebook**
72
+ # - **TikTok**, consumer API exposes less analytics for more details connect
73
+ # through TikTok Business
74
+ # - **TikTok Business**,
75
+ # - **Youtube**
76
+ # - **Threads**, If using our Quickstart project then metrics are currently
77
+ # unavailable.
78
+ # - **X (Twitter)**
79
+ # - **Bluesky**, Bluesky does not expose views or impressions through their API.
80
+ # - **Pinterest**
81
+ # - **LinkedIn**, metrics are only available for company pages. LinkedIn has
82
+ # currently stopped giving permission for personal page analytics, we are on the
83
+ # waitlist for when they resume.
28
84
  sig { returns(PostForMe::Resources::SocialAccountFeeds) }
29
85
  attr_reader :social_account_feeds
30
86