late-sdk 0.0.121 → 0.0.123

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.
data/openapi.yaml CHANGED
@@ -1985,11 +1985,31 @@ components:
1985
1985
 
1986
1986
  TikTokPlatformData:
1987
1987
  type: object
1988
- description: Photo carousels up to 35 images. Video titles up to 2200 chars, photo titles truncated to 90 chars. privacyLevel must match creator_info options. Both camelCase and snake_case accepted.
1988
+ description: |
1989
+ Photo carousels up to 35 images. Video titles up to 2200 chars, photo titles truncated to 90 chars.
1990
+ privacyLevel must match creator_info options. Both camelCase and snake_case accepted.
1991
+
1992
+ **Creator Inbox (draft mode):** Set `draft: true` to send content to the TikTok Creator Inbox
1993
+ instead of publishing immediately. The creator receives an inbox notification and completes
1994
+ the post using TikTok's editing flow. This maps to TikTok's `post_mode: "MEDIA_UPLOAD"` internally.
1995
+
1996
+ **Important:** The field `publish_type` is NOT supported. Use `draft: true` for Creator Inbox flow.
1997
+
1998
+ **Photo drafts** use the `/v2/post/publish/content/init/` endpoint with `post_mode: "MEDIA_UPLOAD"`.
1999
+ **Video drafts** use the dedicated `/v2/post/publish/inbox/video/init/` endpoint.
2000
+
2001
+ When `draft: true`, the `video.upload` scope is required. When `draft` is false or omitted
2002
+ (direct post), the `video.publish` scope is required. For Creator Inbox, TikTok app version
2003
+ must be 31.8 or higher.
1989
2004
  properties:
1990
2005
  draft:
1991
2006
  type: boolean
1992
- description: When true, sends the post to the TikTok Creator Inbox as a draft instead of publishing immediately.
2007
+ description: |
2008
+ When true, sends the post to the TikTok Creator Inbox as a draft instead of publishing
2009
+ immediately. The creator receives an inbox notification to complete posting via TikTok's
2010
+ editing flow. Maps to TikTok API `post_mode: "MEDIA_UPLOAD"` (photos) or the dedicated
2011
+ inbox endpoint (videos). When false or omitted, publishes directly via `post_mode: "DIRECT_POST"`.
2012
+ Note: `publish_type` is not a supported field. Use this field instead.
1993
2013
  privacyLevel:
1994
2014
  type: string
1995
2015
  description: One of the values returned by the TikTok creator info API for the account
@@ -2186,7 +2206,9 @@ components:
2186
2206
  type: object
2187
2207
  properties:
2188
2208
  _id: { type: string }
2189
- platform: { type: string }
2209
+ platform:
2210
+ type: string
2211
+ enum: [tiktok, instagram, facebook, youtube, linkedin, twitter, threads, pinterest, reddit, bluesky, googlebusiness, telegram, snapchat, whatsapp, linkedinads, metaads, pinterestads, tiktokads, xads, googleads]
2190
2212
  profileId:
2191
2213
  oneOf:
2192
2214
  - type: string
@@ -2204,11 +2226,29 @@ components:
2204
2226
  type: string
2205
2227
  format: date-time
2206
2228
  description: Last time follower count was updated (only included if user has analytics add-on)
2229
+ parentAccountId:
2230
+ type: string
2231
+ nullable: true
2232
+ description: |
2233
+ Reference to the parent posting SocialAccount. Set for ads accounts that share
2234
+ or derive from a posting account's OAuth token. null for standalone ads (Google Ads)
2235
+ and all posting accounts.
2236
+ enabled:
2237
+ type: boolean
2238
+ description: |
2239
+ Whether the user explicitly activated this account. false means the account was
2240
+ created as a side effect (e.g., posting account auto-created when user connected
2241
+ ads first). Posting UI and scheduler ignore accounts with enabled: false.
2207
2242
  adsStatus:
2208
2243
  type: string
2209
2244
  enum: [connected, not_connected, not_available]
2245
+ deprecated: true
2210
2246
  description: |
2211
- Ads connection status for this account.
2247
+ **Deprecated.** With the new ads account model, ads accounts are separate SocialAccount
2248
+ documents. Check for accounts with ads platform values (metaads, linkedinads, pinterestads,
2249
+ tiktokads, xads, googleads) instead.
2250
+
2251
+ Legacy behavior:
2212
2252
  - `connected`: Ads are ready to use (same-token platforms like Meta/LinkedIn, or separate ads token is present).
2213
2253
  - `not_connected`: Platform supports ads but requires a separate ads OAuth. Use `GET /v1/connect/{platform}/ads` to connect.
2214
2254
  - `not_available`: Platform does not support ads (e.g., YouTube, Reddit, Bluesky).
@@ -5394,7 +5434,12 @@ paths:
5394
5434
  - "Don't miss our essential guide!"
5395
5435
  - "Our most popular guide, updated!"
5396
5436
  tiktokPhotoCarousel:
5397
- summary: TikTok photo carousel with draft mode
5437
+ summary: TikTok photo carousel (Creator Inbox draft)
5438
+ description: |
5439
+ Sends photos to TikTok Creator Inbox as a draft. The creator receives an inbox
5440
+ notification and completes the post via TikTok's editing flow. Uses draft: true
5441
+ which maps to TikTok API post_mode MEDIA_UPLOAD. Note: publish_type is not a
5442
+ supported field; use draft instead.
5398
5443
  value:
5399
5444
  content: "Check out these photos!"
5400
5445
  mediaItems:
@@ -5409,6 +5454,30 @@ paths:
5409
5454
  draft: true
5410
5455
  privacyLevel: "PUBLIC_TO_EVERYONE"
5411
5456
  allowComment: true
5457
+ photoCoverIndex: 0
5458
+ autoAddMusic: false
5459
+ contentPreviewConfirmed: true
5460
+ expressConsentGiven: true
5461
+ tiktokPhotoDirect:
5462
+ summary: TikTok photo carousel (direct publish)
5463
+ description: |
5464
+ Publishes photos directly to TikTok. With draft omitted or false, the post is
5465
+ published immediately via TikTok API post_mode DIRECT_POST.
5466
+ value:
5467
+ content: "Check out these photos!"
5468
+ mediaItems:
5469
+ - type: image
5470
+ url: "https://example.com/photo1.jpg"
5471
+ - type: image
5472
+ url: "https://example.com/photo2.jpg"
5473
+ platforms:
5474
+ - platform: tiktok
5475
+ accountId: "64e1f0a9e2b5af0012ab34cd"
5476
+ tiktokSettings:
5477
+ privacyLevel: "PUBLIC_TO_EVERYONE"
5478
+ allowComment: true
5479
+ photoCoverIndex: 0
5480
+ autoAddMusic: false
5412
5481
  contentPreviewConfirmed: true
5413
5482
  expressConsentGiven: true
5414
5483
  tiktokVideo:
@@ -5429,6 +5498,25 @@ paths:
5429
5498
  commercialContentType: "none"
5430
5499
  contentPreviewConfirmed: true
5431
5500
  expressConsentGiven: true
5501
+ tiktokVideoDraft:
5502
+ summary: TikTok video post (Creator Inbox draft)
5503
+ description: |
5504
+ Sends a video to TikTok Creator Inbox as a draft. Video drafts use a dedicated
5505
+ TikTok endpoint (/v2/post/publish/inbox/video/init/) that only accepts source_info,
5506
+ so post_info fields (privacyLevel, allowComment, etc.) are set by the creator
5507
+ during TikTok's editing flow.
5508
+ value:
5509
+ content: "New video draft!"
5510
+ mediaItems:
5511
+ - type: video
5512
+ url: "https://example.com/video.mp4"
5513
+ platforms:
5514
+ - platform: tiktok
5515
+ accountId: "64e1f0a9e2b5af0012ab34cd"
5516
+ tiktokSettings:
5517
+ draft: true
5518
+ contentPreviewConfirmed: true
5519
+ expressConsentGiven: true
5432
5520
  multiPlatform:
5433
5521
  summary: Multi-platform post (Twitter + LinkedIn)
5434
5522
  value:
@@ -6636,32 +6724,27 @@ paths:
6636
6724
  operationId: disconnectAds
6637
6725
  tags: [Accounts]
6638
6726
  summary: Disconnect ads from an account
6727
+ deprecated: true
6639
6728
  description: |
6640
- Disconnects ads from a social account without removing the posting connection.
6641
-
6642
- **Same-token platforms** (metaads, linkedinads, pinterestads): Sets an `adsOptOut` flag. The posting account and OAuth token are preserved. Reconnecting ads clears the flag.
6729
+ **Deprecated.** Ads accounts are now standalone SocialAccount documents. Use `DELETE /v1/accounts/{accountId}` instead, passing the ads account's own ID.
6643
6730
 
6644
- **Separate-token platforms** (tiktokads, xads): Clears the ads-specific metadata (marketing API tokens). The posting account stays intact.
6645
-
6646
- **Standalone platforms** (googleads): Do not use this endpoint. Use `DELETE /v1/accounts/{accountId}` instead, since Google Ads accounts are standalone.
6731
+ This endpoint is kept for backward compatibility. It soft-deletes the ads SocialAccount identified by `accountId` (which must be an ads account, not a posting account). The parent posting account is left untouched.
6647
6732
  parameters:
6648
6733
  - name: accountId
6649
6734
  in: path
6650
6735
  required: true
6651
6736
  schema: { type: string }
6652
- description: The SocialAccount ID (parent posting account for same-token/separate-token platforms)
6737
+ description: The ads SocialAccount ID to disconnect
6653
6738
  requestBody:
6654
- required: true
6655
6739
  content:
6656
6740
  application/json:
6657
6741
  schema:
6658
6742
  type: object
6659
- required: [adsPlatform]
6660
6743
  properties:
6661
6744
  adsPlatform:
6662
6745
  type: string
6663
6746
  enum: [metaads, linkedinads, pinterestads, tiktokads, xads]
6664
- description: The ads platform to disconnect
6747
+ description: The ads platform (optional, used for logging only)
6665
6748
  example:
6666
6749
  adsPlatform: "tiktokads"
6667
6750
  security:
@@ -7249,15 +7332,15 @@ paths:
7249
7332
  tags: [Connect]
7250
7333
  summary: Connect ads for a platform
7251
7334
  description: |
7252
- Unified ads connection endpoint. Handles all platforms through a single route:
7335
+ Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform.
7253
7336
 
7254
- **Same-token platforms** (facebook, instagram, linkedin, pinterest): If a posting account already exists, returns `alreadyConnected: true` immediately (no extra OAuth needed). If not, starts the normal OAuth flow, and the resulting account supports both posting and ads.
7337
+ **Same-token platforms** (facebook, instagram, linkedin, pinterest): Creates an ads SocialAccount (`metaads`, `linkedinads`, `pinterestads`) with a copied OAuth token from the parent posting account. If the ads account already exists, returns `alreadyConnected: true`. No extra OAuth needed.
7255
7338
 
7256
- **Separate-token platforms** (tiktok, twitter): Requires an existing posting account (`accountId` param). If ads are already connected, returns `alreadyConnected: true`. Otherwise, starts the platform-specific marketing API OAuth flow.
7339
+ **Separate-token platforms** (tiktok, twitter): Starts the platform-specific marketing API OAuth flow and creates an ads SocialAccount (`tiktokads`, `xads`) with its own token. Requires an existing posting account (`accountId` param). If the ads account already exists, returns `alreadyConnected: true`.
7257
7340
 
7258
- **Ads-only platforms** (googleads): If a Google Ads account exists, returns `alreadyConnected: true`. Otherwise, starts the Google Ads OAuth flow.
7341
+ **Standalone platforms** (googleads): Starts the Google Ads OAuth flow and creates a standalone ads SocialAccount (`googleads`) with no parent. If the account already exists, returns `alreadyConnected: true`.
7259
7342
 
7260
- Use the `adsStatus` field from `GET /v1/accounts` to check which accounts need ads connection.
7343
+ Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., `metaads`, `tiktokads`) in `GET /v1/accounts`.
7261
7344
  parameters:
7262
7345
  - name: platform
7263
7346
  in: path
@@ -7274,7 +7357,7 @@ paths:
7274
7357
  - name: accountId
7275
7358
  in: query
7276
7359
  schema: { type: string }
7277
- description: Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter). Ignored for same-token and ads-only platforms.
7360
+ description: Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter). Ignored for same-token and standalone platforms.
7278
7361
  - name: redirect_url
7279
7362
  in: query
7280
7363
  schema: { type: string, format: uri }
@@ -46,10 +46,10 @@ describe 'AccountsApi' do
46
46
 
47
47
  # unit tests for disconnect_ads
48
48
  # Disconnect ads from an account
49
- # Disconnects ads from a social account without removing the posting connection. **Same-token platforms** (metaads, linkedinads, pinterestads): Sets an `adsOptOut` flag. The posting account and OAuth token are preserved. Reconnecting ads clears the flag. **Separate-token platforms** (tiktokads, xads): Clears the ads-specific metadata (marketing API tokens). The posting account stays intact. **Standalone platforms** (googleads): Do not use this endpoint. Use `DELETE /v1/accounts/{accountId}` instead, since Google Ads accounts are standalone.
50
- # @param account_id The SocialAccount ID (parent posting account for same-token/separate-token platforms)
51
- # @param disconnect_ads_request
49
+ # **Deprecated.** Ads accounts are now standalone SocialAccount documents. Use `DELETE /v1/accounts/{accountId}` instead, passing the ads account's own ID. This endpoint is kept for backward compatibility. It soft-deletes the ads SocialAccount identified by `accountId` (which must be an ads account, not a posting account). The parent posting account is left untouched.
50
+ # @param account_id The ads SocialAccount ID to disconnect
52
51
  # @param [Hash] opts the optional parameters
52
+ # @option opts [DisconnectAdsRequest] :disconnect_ads_request
53
53
  # @return [DeleteAccountGroup200Response]
54
54
  describe 'disconnect_ads test' do
55
55
  it 'should work' do
@@ -46,11 +46,11 @@ describe 'ConnectApi' do
46
46
 
47
47
  # unit tests for connect_ads
48
48
  # Connect ads for a platform
49
- # Unified ads connection endpoint. Handles all platforms through a single route: **Same-token platforms** (facebook, instagram, linkedin, pinterest): If a posting account already exists, returns `alreadyConnected: true` immediately (no extra OAuth needed). If not, starts the normal OAuth flow, and the resulting account supports both posting and ads. **Separate-token platforms** (tiktok, twitter): Requires an existing posting account (`accountId` param). If ads are already connected, returns `alreadyConnected: true`. Otherwise, starts the platform-specific marketing API OAuth flow. **Ads-only platforms** (googleads): If a Google Ads account exists, returns `alreadyConnected: true`. Otherwise, starts the Google Ads OAuth flow. Use the `adsStatus` field from `GET /v1/accounts` to check which accounts need ads connection.
49
+ # Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. **Same-token platforms** (facebook, instagram, linkedin, pinterest): Creates an ads SocialAccount (`metaads`, `linkedinads`, `pinterestads`) with a copied OAuth token from the parent posting account. If the ads account already exists, returns `alreadyConnected: true`. No extra OAuth needed. **Separate-token platforms** (tiktok, twitter): Starts the platform-specific marketing API OAuth flow and creates an ads SocialAccount (`tiktokads`, `xads`) with its own token. Requires an existing posting account (`accountId` param). If the ads account already exists, returns `alreadyConnected: true`. **Standalone platforms** (googleads): Starts the Google Ads OAuth flow and creates a standalone ads SocialAccount (`googleads`) with no parent. If the account already exists, returns `alreadyConnected: true`. Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., `metaads`, `tiktokads`) in `GET /v1/accounts`.
50
50
  # @param platform Platform to connect ads for. Only platforms with ads support are accepted.
51
51
  # @param profile_id Your Zernio profile ID
52
52
  # @param [Hash] opts the optional parameters
53
- # @option opts [String] :account_id Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter). Ignored for same-token and ads-only platforms.
53
+ # @option opts [String] :account_id Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter). Ignored for same-token and standalone platforms.
54
54
  # @option opts [String] :redirect_url Custom redirect URL after OAuth completes (same-token platforms only)
55
55
  # @option opts [Boolean] :headless Enable headless mode (same-token platforms only)
56
56
  # @return [ConnectAds200Response]
@@ -36,6 +36,10 @@ describe Late::AccountWithFollowerStats do
36
36
  describe 'test attribute "platform"' do
37
37
  it 'should work' do
38
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["tiktok", "instagram", "facebook", "youtube", "linkedin", "twitter", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "whatsapp", "linkedinads", "metaads", "pinterestads", "tiktokads", "xads", "googleads"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.platform = value }.not_to raise_error
42
+ # end
39
43
  end
40
44
  end
41
45
 
@@ -81,6 +85,18 @@ describe Late::AccountWithFollowerStats do
81
85
  end
82
86
  end
83
87
 
88
+ describe 'test attribute "parent_account_id"' do
89
+ it 'should work' do
90
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
91
+ end
92
+ end
93
+
94
+ describe 'test attribute "enabled"' do
95
+ it 'should work' do
96
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
97
+ end
98
+ end
99
+
84
100
  describe 'test attribute "ads_status"' do
85
101
  it 'should work' do
86
102
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -36,6 +36,10 @@ describe Late::SocialAccount do
36
36
  describe 'test attribute "platform"' do
37
37
  it 'should work' do
38
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["tiktok", "instagram", "facebook", "youtube", "linkedin", "twitter", "threads", "pinterest", "reddit", "bluesky", "googlebusiness", "telegram", "snapchat", "whatsapp", "linkedinads", "metaads", "pinterestads", "tiktokads", "xads", "googleads"])
40
+ # validator.allowable_values.each do |value|
41
+ # expect { instance.platform = value }.not_to raise_error
42
+ # end
39
43
  end
40
44
  end
41
45
 
@@ -81,6 +85,18 @@ describe Late::SocialAccount do
81
85
  end
82
86
  end
83
87
 
88
+ describe 'test attribute "parent_account_id"' do
89
+ it 'should work' do
90
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
91
+ end
92
+ end
93
+
94
+ describe 'test attribute "enabled"' do
95
+ it 'should work' do
96
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
97
+ end
98
+ end
99
+
84
100
  describe 'test attribute "ads_status"' do
85
101
  it 'should work' do
86
102
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
Binary file