@getlatedev/node 0.1.13 → 0.1.15

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.
@@ -93,10 +93,137 @@ export type ApiKey = {
93
93
  key?: string;
94
94
  };
95
95
 
96
+ /**
97
+ * Bluesky post settings:
98
+ * - Supports text posts with up to 4 images per post
99
+ * - Videos supported (single video per post)
100
+ * - threadItems creates a reply chain (Bluesky thread)
101
+ * - Images exceeding Bluesky's 1MB limit are automatically compressed
102
+ * - Alt text for images is supported via mediaItem properties
103
+ *
104
+ */
105
+ export type BlueskyPlatformData = {
106
+ /**
107
+ * Sequence of posts in a Bluesky thread (root then replies in order).
108
+ */
109
+ threadItems?: Array<{
110
+ content?: string;
111
+ mediaItems?: Array<MediaItem>;
112
+ }>;
113
+ };
114
+
96
115
  export type CaptionResponse = {
97
116
  caption?: string;
98
117
  };
99
118
 
119
+ /**
120
+ * Connection event log showing account connection/disconnection history
121
+ */
122
+ export type ConnectionLog = {
123
+ _id?: string;
124
+ /**
125
+ * User who owns the connection (may be null for early OAuth failures)
126
+ */
127
+ userId?: string;
128
+ profileId?: string;
129
+ /**
130
+ * The social account ID (present on successful connections and disconnects)
131
+ */
132
+ accountId?: string;
133
+ platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
134
+ /**
135
+ * Type of connection event:
136
+ * - `connect_success` - New account connected successfully
137
+ * - `connect_failed` - Connection attempt failed
138
+ * - `disconnect` - Account was disconnected
139
+ * - `reconnect_success` - Existing account reconnected successfully
140
+ * - `reconnect_failed` - Reconnection attempt failed
141
+ *
142
+ */
143
+ eventType?: 'connect_success' | 'connect_failed' | 'disconnect' | 'reconnect_success' | 'reconnect_failed';
144
+ /**
145
+ * How the connection was initiated
146
+ */
147
+ connectionMethod?: 'oauth' | 'credentials' | 'invitation';
148
+ /**
149
+ * Error details (present on failed events)
150
+ */
151
+ error?: {
152
+ /**
153
+ * Error code (e.g., oauth_denied, token_exchange_failed)
154
+ */
155
+ code?: string;
156
+ /**
157
+ * Human-readable error message
158
+ */
159
+ message?: string;
160
+ /**
161
+ * Raw error response (truncated to 2000 chars)
162
+ */
163
+ rawResponse?: string;
164
+ };
165
+ /**
166
+ * Success details (present on successful events)
167
+ */
168
+ success?: {
169
+ displayName?: string;
170
+ username?: string;
171
+ profilePicture?: string;
172
+ /**
173
+ * OAuth scopes/permissions granted
174
+ */
175
+ permissions?: Array<(string)>;
176
+ tokenExpiresAt?: string;
177
+ /**
178
+ * Account type (personal, business, organization)
179
+ */
180
+ accountType?: string;
181
+ };
182
+ /**
183
+ * Additional context about the connection attempt
184
+ */
185
+ context?: {
186
+ isHeadlessMode?: boolean;
187
+ hasCustomRedirectUrl?: boolean;
188
+ isReconnection?: boolean;
189
+ /**
190
+ * Using bring-your-own-keys
191
+ */
192
+ isBYOK?: boolean;
193
+ invitationToken?: string;
194
+ connectToken?: string;
195
+ };
196
+ /**
197
+ * How long the operation took in milliseconds
198
+ */
199
+ durationMs?: number;
200
+ /**
201
+ * Additional metadata
202
+ */
203
+ metadata?: {
204
+ [key: string]: unknown;
205
+ };
206
+ createdAt?: string;
207
+ };
208
+
209
+ export type platform = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
210
+
211
+ /**
212
+ * Type of connection event:
213
+ * - `connect_success` - New account connected successfully
214
+ * - `connect_failed` - Connection attempt failed
215
+ * - `disconnect` - Account was disconnected
216
+ * - `reconnect_success` - Existing account reconnected successfully
217
+ * - `reconnect_failed` - Reconnection attempt failed
218
+ *
219
+ */
220
+ export type eventType = 'connect_success' | 'connect_failed' | 'disconnect' | 'reconnect_success' | 'reconnect_failed';
221
+
222
+ /**
223
+ * How the connection was initiated
224
+ */
225
+ export type connectionMethod = 'oauth' | 'credentials' | 'invitation';
226
+
100
227
  export type DownloadFormat = {
101
228
  formatId?: string;
102
229
  ext?: string;
@@ -677,7 +804,7 @@ export type PlatformTarget = {
677
804
  /**
678
805
  * Platform-specific overrides and options.
679
806
  */
680
- platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | GoogleBusinessPlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData);
807
+ platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | GoogleBusinessPlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData | RedditPlatformData | BlueskyPlatformData);
681
808
  /**
682
809
  * Platform-specific status: pending, publishing, published, failed
683
810
  */
@@ -913,8 +1040,6 @@ export type PostLog = {
913
1040
  createdAt?: string;
914
1041
  };
915
1042
 
916
- export type platform = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
917
-
918
1043
  /**
919
1044
  * Type of action logged:
920
1045
  * - `publish` - Initial publish attempt
@@ -1087,6 +1212,38 @@ export type QueueUpdateResponse = {
1087
1212
  reshuffledCount?: number;
1088
1213
  };
1089
1214
 
1215
+ /**
1216
+ * Reddit post settings:
1217
+ * - Posts are either "link" (with URL/media) or "self" (text-only)
1218
+ * - If media is provided, the first media item's URL is used as the link
1219
+ * - Use forceSelf to override and create a text post with the URL in the body
1220
+ * - Subreddit defaults to the account's configured subreddit if omitted
1221
+ * - Use the same accountId multiple times with different subreddit values in platformSpecificData to post to multiple subreddits
1222
+ * - Images are automatically compressed if they exceed Reddit's 20MB limit
1223
+ *
1224
+ */
1225
+ export type RedditPlatformData = {
1226
+ /**
1227
+ * Target subreddit name (without "r/" prefix).
1228
+ * Overrides the default subreddit configured on the account connection.
1229
+ * Use GET /api/v1/accounts/{id}/reddit-subreddits to list available subreddits.
1230
+ *
1231
+ */
1232
+ subreddit?: string;
1233
+ /**
1234
+ * Post title. Defaults to the first line of content, truncated to 300 characters.
1235
+ */
1236
+ title?: string;
1237
+ /**
1238
+ * URL for link posts. If provided (and forceSelf is not true), creates a link post instead of a text post.
1239
+ */
1240
+ url?: string;
1241
+ /**
1242
+ * When true, creates a text/self post even when a URL or media is provided.
1243
+ */
1244
+ forceSelf?: boolean;
1245
+ };
1246
+
1090
1247
  /**
1091
1248
  * Snapchat Public Profile API constraints:
1092
1249
  *
@@ -2317,7 +2474,7 @@ export type CreatePostData = {
2317
2474
  * Optional per-platform scheduled time override. When omitted, the top-level scheduledFor is used.
2318
2475
  */
2319
2476
  scheduledFor?: string;
2320
- platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData);
2477
+ platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | GoogleBusinessPlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData | RedditPlatformData | BlueskyPlatformData);
2321
2478
  }>;
2322
2479
  scheduledFor?: string;
2323
2480
  publishNow?: boolean;
@@ -2400,7 +2557,16 @@ export type GetPostError = ({
2400
2557
 
2401
2558
  export type UpdatePostData = {
2402
2559
  body: {
2403
- [key: string]: unknown;
2560
+ content?: string;
2561
+ scheduledFor?: string;
2562
+ /**
2563
+ * Root-level TikTok settings applied to all TikTok platforms in the request.
2564
+ * This is a convenience shorthand. Settings here are merged into each TikTok
2565
+ * platform's platformSpecificData, with platform-specific settings taking precedence.
2566
+ *
2567
+ */
2568
+ tiktokSettings?: TikTokPlatformData;
2569
+ [key: string]: unknown | string | TikTokPlatformData;
2404
2570
  };
2405
2571
  path: {
2406
2572
  postId: string;
@@ -4994,6 +5160,106 @@ export type GetLogError = ({
4994
5160
  error?: string;
4995
5161
  } | unknown);
4996
5162
 
5163
+ export type ListPostsLogsData = {
5164
+ query?: {
5165
+ /**
5166
+ * Filter by action type
5167
+ */
5168
+ action?: 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled' | 'all';
5169
+ /**
5170
+ * Number of days to look back (max 7)
5171
+ */
5172
+ days?: number;
5173
+ /**
5174
+ * Maximum number of logs to return (max 100)
5175
+ */
5176
+ limit?: number;
5177
+ /**
5178
+ * Filter by platform
5179
+ */
5180
+ platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
5181
+ /**
5182
+ * Number of logs to skip (for pagination)
5183
+ */
5184
+ skip?: number;
5185
+ /**
5186
+ * Filter by log status
5187
+ */
5188
+ status?: 'success' | 'failed' | 'pending' | 'skipped' | 'all';
5189
+ };
5190
+ };
5191
+
5192
+ export type ListPostsLogsResponse = ({
5193
+ logs?: Array<PostLog>;
5194
+ pagination?: {
5195
+ /**
5196
+ * Total number of logs matching the query
5197
+ */
5198
+ total?: number;
5199
+ limit?: number;
5200
+ skip?: number;
5201
+ /**
5202
+ * Total number of pages
5203
+ */
5204
+ pages?: number;
5205
+ hasMore?: boolean;
5206
+ };
5207
+ });
5208
+
5209
+ export type ListPostsLogsError = ({
5210
+ error?: string;
5211
+ });
5212
+
5213
+ export type ListConnectionLogsData = {
5214
+ query?: {
5215
+ /**
5216
+ * Number of days to look back (max 7)
5217
+ */
5218
+ days?: number;
5219
+ /**
5220
+ * Filter by event type
5221
+ */
5222
+ eventType?: 'connect_success' | 'connect_failed' | 'disconnect' | 'reconnect_success' | 'reconnect_failed' | 'all';
5223
+ /**
5224
+ * Maximum number of logs to return (max 100)
5225
+ */
5226
+ limit?: number;
5227
+ /**
5228
+ * Filter by platform
5229
+ */
5230
+ platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
5231
+ /**
5232
+ * Number of logs to skip (for pagination)
5233
+ */
5234
+ skip?: number;
5235
+ /**
5236
+ * Filter by status (shorthand for event types)
5237
+ */
5238
+ status?: 'success' | 'failed' | 'all';
5239
+ };
5240
+ };
5241
+
5242
+ export type ListConnectionLogsResponse = ({
5243
+ logs?: Array<ConnectionLog>;
5244
+ pagination?: {
5245
+ /**
5246
+ * Total number of logs matching the query
5247
+ */
5248
+ total?: number;
5249
+ limit?: number;
5250
+ skip?: number;
5251
+ /**
5252
+ * Total number of pages
5253
+ */
5254
+ pages?: number;
5255
+ hasMore?: boolean;
5256
+ };
5257
+ });
5258
+
5259
+ export type ListConnectionLogsError = ({
5260
+ error?: string;
5261
+ });
5262
+
4997
5263
  export type GetPostLogsData = {
4998
5264
  path: {
4999
5265
  /**
@@ -5363,6 +5629,9 @@ export type ListInboxCommentsError = ({
5363
5629
 
5364
5630
  export type GetInboxPostCommentsData = {
5365
5631
  path: {
5632
+ /**
5633
+ * The post identifier. Accepts a Late post ID (MongoDB ObjectId) which is automatically resolved to the platform-specific post ID, or a platform-specific post ID directly (e.g. tweet ID, Facebook Graph ID, YouTube video ID).
5634
+ */
5366
5635
  postId: string;
5367
5636
  };
5368
5637
  query: {
@@ -5497,6 +5766,9 @@ export type ReplyToInboxPostData = {
5497
5766
  rootCid?: string;
5498
5767
  };
5499
5768
  path: {
5769
+ /**
5770
+ * The post identifier. Accepts a Late post ID or a platform-specific post ID.
5771
+ */
5500
5772
  postId: string;
5501
5773
  };
5502
5774
  };
@@ -5519,6 +5791,9 @@ export type ReplyToInboxPostError = ({
5519
5791
 
5520
5792
  export type DeleteInboxCommentData = {
5521
5793
  path: {
5794
+ /**
5795
+ * The post identifier. Accepts a Late post ID or a platform-specific post ID.
5796
+ */
5522
5797
  postId: string;
5523
5798
  };
5524
5799
  query: {