@getlatedev/node 0.1.12 → 0.1.14

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;
@@ -665,6 +792,9 @@ export type PlatformTarget = {
665
792
  */
666
793
  platform?: string;
667
794
  accountId?: (string | SocialAccount);
795
+ /**
796
+ * Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters).
797
+ */
668
798
  customContent?: string;
669
799
  customMedia?: Array<MediaItem>;
670
800
  /**
@@ -674,7 +804,7 @@ export type PlatformTarget = {
674
804
  /**
675
805
  * Platform-specific overrides and options.
676
806
  */
677
- 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);
678
808
  /**
679
809
  * Platform-specific status: pending, publishing, published, failed
680
810
  */
@@ -910,8 +1040,6 @@ export type PostLog = {
910
1040
  createdAt?: string;
911
1041
  };
912
1042
 
913
- export type platform = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat';
914
-
915
1043
  /**
916
1044
  * Type of action logged:
917
1045
  * - `publish` - Initial publish attempt
@@ -1084,6 +1212,38 @@ export type QueueUpdateResponse = {
1084
1212
  reshuffledCount?: number;
1085
1213
  };
1086
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
+
1087
1247
  /**
1088
1248
  * Snapchat Public Profile API constraints:
1089
1249
  *
@@ -2302,6 +2462,9 @@ export type CreatePostData = {
2302
2462
  platforms?: Array<{
2303
2463
  platform?: string;
2304
2464
  accountId?: string;
2465
+ /**
2466
+ * Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters).
2467
+ */
2305
2468
  customContent?: string;
2306
2469
  customMedia?: Array<{
2307
2470
  type?: 'image' | 'video' | 'gif' | 'document';
@@ -2311,7 +2474,7 @@ export type CreatePostData = {
2311
2474
  * Optional per-platform scheduled time override. When omitted, the top-level scheduledFor is used.
2312
2475
  */
2313
2476
  scheduledFor?: string;
2314
- 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);
2315
2478
  }>;
2316
2479
  scheduledFor?: string;
2317
2480
  publishNow?: boolean;
@@ -4988,6 +5151,106 @@ export type GetLogError = ({
4988
5151
  error?: string;
4989
5152
  } | unknown);
4990
5153
 
5154
+ export type ListPostsLogsData = {
5155
+ query?: {
5156
+ /**
5157
+ * Filter by action type
5158
+ */
5159
+ action?: 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled' | 'all';
5160
+ /**
5161
+ * Number of days to look back (max 7)
5162
+ */
5163
+ days?: number;
5164
+ /**
5165
+ * Maximum number of logs to return (max 100)
5166
+ */
5167
+ limit?: number;
5168
+ /**
5169
+ * Filter by platform
5170
+ */
5171
+ platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
5172
+ /**
5173
+ * Number of logs to skip (for pagination)
5174
+ */
5175
+ skip?: number;
5176
+ /**
5177
+ * Filter by log status
5178
+ */
5179
+ status?: 'success' | 'failed' | 'pending' | 'skipped' | 'all';
5180
+ };
5181
+ };
5182
+
5183
+ export type ListPostsLogsResponse = ({
5184
+ logs?: Array<PostLog>;
5185
+ pagination?: {
5186
+ /**
5187
+ * Total number of logs matching the query
5188
+ */
5189
+ total?: number;
5190
+ limit?: number;
5191
+ skip?: number;
5192
+ /**
5193
+ * Total number of pages
5194
+ */
5195
+ pages?: number;
5196
+ hasMore?: boolean;
5197
+ };
5198
+ });
5199
+
5200
+ export type ListPostsLogsError = ({
5201
+ error?: string;
5202
+ });
5203
+
5204
+ export type ListConnectionLogsData = {
5205
+ query?: {
5206
+ /**
5207
+ * Number of days to look back (max 7)
5208
+ */
5209
+ days?: number;
5210
+ /**
5211
+ * Filter by event type
5212
+ */
5213
+ eventType?: 'connect_success' | 'connect_failed' | 'disconnect' | 'reconnect_success' | 'reconnect_failed' | 'all';
5214
+ /**
5215
+ * Maximum number of logs to return (max 100)
5216
+ */
5217
+ limit?: number;
5218
+ /**
5219
+ * Filter by platform
5220
+ */
5221
+ platform?: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'all';
5222
+ /**
5223
+ * Number of logs to skip (for pagination)
5224
+ */
5225
+ skip?: number;
5226
+ /**
5227
+ * Filter by status (shorthand for event types)
5228
+ */
5229
+ status?: 'success' | 'failed' | 'all';
5230
+ };
5231
+ };
5232
+
5233
+ export type ListConnectionLogsResponse = ({
5234
+ logs?: Array<ConnectionLog>;
5235
+ pagination?: {
5236
+ /**
5237
+ * Total number of logs matching the query
5238
+ */
5239
+ total?: number;
5240
+ limit?: number;
5241
+ skip?: number;
5242
+ /**
5243
+ * Total number of pages
5244
+ */
5245
+ pages?: number;
5246
+ hasMore?: boolean;
5247
+ };
5248
+ });
5249
+
5250
+ export type ListConnectionLogsError = ({
5251
+ error?: string;
5252
+ });
5253
+
4991
5254
  export type GetPostLogsData = {
4992
5255
  path: {
4993
5256
  /**
@@ -5357,6 +5620,9 @@ export type ListInboxCommentsError = ({
5357
5620
 
5358
5621
  export type GetInboxPostCommentsData = {
5359
5622
  path: {
5623
+ /**
5624
+ * 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).
5625
+ */
5360
5626
  postId: string;
5361
5627
  };
5362
5628
  query: {
@@ -5491,6 +5757,9 @@ export type ReplyToInboxPostData = {
5491
5757
  rootCid?: string;
5492
5758
  };
5493
5759
  path: {
5760
+ /**
5761
+ * The post identifier. Accepts a Late post ID or a platform-specific post ID.
5762
+ */
5494
5763
  postId: string;
5495
5764
  };
5496
5765
  };
@@ -5513,6 +5782,9 @@ export type ReplyToInboxPostError = ({
5513
5782
 
5514
5783
  export type DeleteInboxCommentData = {
5515
5784
  path: {
5785
+ /**
5786
+ * The post identifier. Accepts a Late post ID or a platform-specific post ID.
5787
+ */
5516
5788
  postId: string;
5517
5789
  };
5518
5790
  query: {