@getlatedev/node 0.1.55 → 0.1.57

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.
@@ -88,6 +88,10 @@ export type AnalyticsListResponse = {
88
88
  overview?: AnalyticsOverview;
89
89
  posts?: Array<{
90
90
  _id?: string;
91
+ /**
92
+ * Original Late post ID if scheduled via Late
93
+ */
94
+ latePostId?: (string) | null;
91
95
  content?: string;
92
96
  scheduledFor?: string;
93
97
  publishedAt?: string;
@@ -97,6 +101,7 @@ export type AnalyticsListResponse = {
97
101
  platform?: string;
98
102
  platformPostUrl?: string;
99
103
  isExternal?: boolean;
104
+ profileId?: (string) | null;
100
105
  thumbnailUrl?: string;
101
106
  mediaType?: 'image' | 'video' | 'gif' | 'document' | 'carousel' | 'text';
102
107
  /**
@@ -129,20 +134,45 @@ export type AnalyticsOverview = {
129
134
  totalPosts?: number;
130
135
  publishedPosts?: number;
131
136
  scheduledPosts?: number;
132
- lastSync?: string;
137
+ lastSync?: (string) | null;
138
+ dataStaleness?: {
139
+ /**
140
+ * Number of accounts with stale analytics data
141
+ */
142
+ staleAccountCount?: number;
143
+ /**
144
+ * Whether a background sync was triggered for stale accounts
145
+ */
146
+ syncTriggered?: boolean;
147
+ };
133
148
  };
134
149
 
135
150
  export type AnalyticsSinglePostResponse = {
136
151
  postId?: string;
137
- status?: string;
152
+ /**
153
+ * Original Late post ID if scheduled via Late
154
+ */
155
+ latePostId?: (string) | null;
156
+ /**
157
+ * Overall post status. "partial" when some platforms published and others failed.
158
+ */
159
+ status?: 'published' | 'failed' | 'partial';
138
160
  content?: string;
139
161
  scheduledFor?: string;
140
- publishedAt?: string;
162
+ publishedAt?: (string) | null;
141
163
  analytics?: PostAnalytics;
142
164
  platformAnalytics?: Array<PlatformAnalytics>;
143
165
  platform?: string;
144
- platformPostUrl?: string;
166
+ platformPostUrl?: (string) | null;
145
167
  isExternal?: boolean;
168
+ /**
169
+ * Overall sync state across all platforms
170
+ */
171
+ syncStatus?: 'synced' | 'pending' | 'partial' | 'unavailable';
172
+ /**
173
+ * Human-readable status message for pending, partial, or failed states
174
+ */
175
+ message?: (string) | null;
146
176
  thumbnailUrl?: (string) | null;
147
177
  mediaType?: ('image' | 'video' | 'carousel' | 'text') | null;
148
178
  /**
@@ -161,6 +191,16 @@ export type AnalyticsSinglePostResponse = {
161
191
  }>;
162
192
  };
163
193
 
194
+ /**
195
+ * Overall post status. "partial" when some platforms published and others failed.
196
+ */
197
+ export type status = 'published' | 'failed' | 'partial';
198
+
199
+ /**
200
+ * Overall sync state across all platforms
201
+ */
202
+ export type syncStatus = 'synced' | 'pending' | 'partial' | 'unavailable';
203
+
164
204
  export type mediaType = 'image' | 'video' | 'carousel' | 'text';
165
205
 
166
206
  export type ApiKey = {
@@ -491,7 +531,7 @@ export type HashtagInfo = {
491
531
  postCount?: number;
492
532
  };
493
533
 
494
- export type status = 'safe' | 'banned' | 'restricted' | 'unknown';
534
+ export type status2 = 'safe' | 'banned' | 'restricted' | 'unknown';
495
535
 
496
536
  /**
497
537
  * Feed aspect ratio 0.8-1.91, carousels up to 10 items, stories require media (no captions). User tag coordinates 0.0-1.0 from top-left. Images over 8 MB and videos over platform limits are auto-compressed.
@@ -675,7 +715,7 @@ export type LinkedInPlatformData = {
675
715
  };
676
716
 
677
717
  /**
678
- * Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Late auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed).
718
+ * Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed).
679
719
  */
680
720
  export type MediaItem = {
681
721
  type?: 'image' | 'video' | 'gif' | 'document';
@@ -770,23 +810,28 @@ export type PinterestPlatformData = {
770
810
 
771
811
  export type PlatformAnalytics = {
772
812
  platform?: string;
773
- status?: string;
813
+ status?: 'published' | 'failed';
774
814
  accountId?: string;
775
- accountUsername?: string;
776
- analytics?: PostAnalytics;
777
- accountMetrics?: {
778
- /**
779
- * Followers/fans count (e.g., Instagram, Facebook Pages, Twitter)
780
- */
781
- followers?: (number) | null;
782
- /**
783
- * Subscribers count (e.g., YouTube)
784
- */
785
- subscribers?: (number) | null;
786
- lastUpdated?: (string) | null;
787
- } | null;
815
+ accountUsername?: (string) | null;
816
+ analytics?: (PostAnalytics) | null;
817
+ /**
818
+ * Sync state of analytics for this platform
819
+ */
820
+ syncStatus?: 'synced' | 'pending' | 'unavailable';
821
+ platformPostUrl?: (string) | null;
822
+ /**
823
+ * Error details when status is failed
824
+ */
825
+ errorMessage?: (string) | null;
788
826
  };
789
827
 
828
+ export type status3 = 'published' | 'failed';
829
+
830
+ /**
831
+ * Sync state of analytics for this platform
832
+ */
833
+ export type syncStatus2 = 'synced' | 'pending' | 'unavailable';
834
+
790
835
  export type PlatformTarget = {
791
836
  /**
792
837
  * Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram
@@ -827,22 +872,22 @@ export type PlatformTarget = {
827
872
  */
828
873
  errorMessage?: string;
829
874
  /**
830
- * Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Late infra), unknown
875
+ * Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Zernio infra), unknown
831
876
  */
832
877
  errorCategory?: 'auth_expired' | 'user_content' | 'user_abuse' | 'account_issue' | 'platform_rejected' | 'platform_error' | 'system_error' | 'unknown';
833
878
  /**
834
- * Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Late issue, rare)
879
+ * Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare)
835
880
  */
836
881
  errorSource?: 'user' | 'platform' | 'system';
837
882
  };
838
883
 
839
884
  /**
840
- * Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Late infra), unknown
885
+ * Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Zernio infra), unknown
841
886
  */
842
887
  export type errorCategory = 'auth_expired' | 'user_content' | 'user_abuse' | 'account_issue' | 'platform_rejected' | 'platform_error' | 'system_error' | 'unknown';
843
888
 
844
889
  /**
845
- * Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Late issue, rare)
890
+ * Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare)
846
891
  */
847
892
  export type errorSource = 'user' | 'platform' | 'system';
848
893
 
@@ -887,7 +932,7 @@ export type Post = {
887
932
  updatedAt?: string;
888
933
  };
889
934
 
890
- export type status2 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
935
+ export type status4 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
891
936
 
892
937
  export type visibility = 'public' | 'private' | 'unlisted';
893
938
 
@@ -1003,7 +1048,7 @@ export type PostLog = {
1003
1048
  */
1004
1049
  export type action = 'publish' | 'retry' | 'media_upload' | 'rate_limit_pause' | 'token_refresh' | 'cancelled';
1005
1050
 
1006
- export type status3 = 'success' | 'failed' | 'pending' | 'skipped';
1051
+ export type status5 = 'success' | 'failed' | 'pending' | 'skipped';
1007
1052
 
1008
1053
  export type PostRetryResponse = {
1009
1054
  message?: string;
@@ -1453,7 +1498,7 @@ export type UploadTokenResponse = {
1453
1498
  status?: 'pending' | 'completed' | 'expired';
1454
1499
  };
1455
1500
 
1456
- export type status4 = 'pending' | 'completed' | 'expired';
1501
+ export type status6 = 'pending' | 'completed' | 'expired';
1457
1502
 
1458
1503
  export type UploadTokenStatusResponse = {
1459
1504
  token?: string;
@@ -1592,7 +1637,7 @@ export type WebhookLog = {
1592
1637
 
1593
1638
  export type event = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.recycled' | 'account.connected' | 'account.disconnected' | 'message.received' | 'comment.received' | 'webhook.test';
1594
1639
 
1595
- export type status5 = 'success' | 'failed';
1640
+ export type status7 = 'success' | 'failed';
1596
1641
 
1597
1642
  /**
1598
1643
  * Webhook payload for account connected events
@@ -1838,7 +1883,7 @@ export type platform3 = 'instagram' | 'facebook' | 'telegram' | 'bluesky' | 'red
1838
1883
 
1839
1884
  export type direction = 'incoming';
1840
1885
 
1841
- export type status6 = 'active' | 'archived';
1886
+ export type status8 = 'active' | 'archived';
1842
1887
 
1843
1888
  /**
1844
1889
  * Webhook payload for post events
@@ -2310,7 +2355,7 @@ export type ValidateSubredditError = unknown;
2310
2355
  export type GetAnalyticsData = {
2311
2356
  query?: {
2312
2357
  /**
2313
- * Inclusive lower bound
2358
+ * Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days.
2314
2359
  */
2315
2360
  fromDate?: string;
2316
2361
  /**
@@ -2330,7 +2375,7 @@ export type GetAnalyticsData = {
2330
2375
  */
2331
2376
  platform?: string;
2332
2377
  /**
2333
- * Returns analytics for a single post. Accepts both Late Post IDs and External Post IDs. Late IDs are auto-resolved to External Post analytics.
2378
+ * Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics.
2334
2379
  */
2335
2380
  postId?: string;
2336
2381
  /**
@@ -2338,33 +2383,41 @@ export type GetAnalyticsData = {
2338
2383
  */
2339
2384
  profileId?: string;
2340
2385
  /**
2341
- * Sort by date or engagement
2386
+ * Sort by date, engagement, or a specific metric
2342
2387
  */
2343
- sortBy?: 'date' | 'engagement';
2388
+ sortBy?: 'date' | 'engagement' | 'impressions' | 'reach' | 'likes' | 'comments' | 'shares' | 'saves' | 'clicks' | 'views';
2344
2389
  /**
2345
- * Filter by post source: late (posted via Late API), external (synced from platform), all (default)
2390
+ * Filter by post source: late (posted via Zernio API), external (synced from platform), all (default)
2346
2391
  */
2347
2392
  source?: 'all' | 'late' | 'external';
2348
2393
  /**
2349
- * Inclusive upper bound
2394
+ * Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.
2350
2395
  */
2351
2396
  toDate?: string;
2352
2397
  };
2353
2398
  };
2354
2399
 
2355
- export type GetAnalyticsResponse = ((AnalyticsSinglePostResponse | AnalyticsListResponse));
2400
+ export type GetAnalyticsResponse = ((AnalyticsSinglePostResponse | AnalyticsListResponse) | AnalyticsSinglePostResponse);
2356
2401
 
2357
2402
  export type GetAnalyticsError = ({
2358
2403
  error?: string;
2404
+ /**
2405
+ * Detailed validation errors
2406
+ */
2407
+ details?: {
2408
+ [key: string]: unknown;
2409
+ };
2410
+ } | {
2411
+ error?: string;
2359
2412
  } | {
2360
2413
  error?: string;
2361
2414
  code?: string;
2362
- } | ErrorResponse);
2415
+ } | AnalyticsSinglePostResponse | ErrorResponse);
2363
2416
 
2364
2417
  export type GetYouTubeDailyViewsData = {
2365
2418
  query: {
2366
2419
  /**
2367
- * The Late account ID for the YouTube account
2420
+ * The Zernio account ID for the YouTube account
2368
2421
  */
2369
2422
  accountId: string;
2370
2423
  /**
@@ -2409,7 +2462,7 @@ export type GetDailyMetricsData = {
2409
2462
  */
2410
2463
  profileId?: string;
2411
2464
  /**
2412
- * Filter by post origin. "late" for posts published via Late, "external" for posts imported from platforms.
2465
+ * Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms.
2413
2466
  */
2414
2467
  source?: 'all' | 'late' | 'external';
2415
2468
  /**
@@ -2469,7 +2522,7 @@ export type GetBestTimeToPostData = {
2469
2522
  */
2470
2523
  profileId?: string;
2471
2524
  /**
2472
- * Filter by post origin. "late" for posts published via Late, "external" for posts imported from platforms.
2525
+ * Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms.
2473
2526
  */
2474
2527
  source?: 'all' | 'late' | 'external';
2475
2528
  };
@@ -2514,7 +2567,7 @@ export type GetContentDecayData = {
2514
2567
  */
2515
2568
  profileId?: string;
2516
2569
  /**
2517
- * Filter by post origin. "late" for posts published via Late, "external" for posts imported from platforms.
2570
+ * Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms.
2518
2571
  */
2519
2572
  source?: 'all' | 'late' | 'external';
2520
2573
  };
@@ -2559,7 +2612,7 @@ export type GetPostingFrequencyData = {
2559
2612
  */
2560
2613
  profileId?: string;
2561
2614
  /**
2562
- * Filter by post origin. "late" for posts published via Late, "external" for posts imported from platforms.
2615
+ * Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms.
2563
2616
  */
2564
2617
  source?: 'all' | 'late' | 'external';
2565
2618
  };
@@ -2601,7 +2654,7 @@ export type GetPostTimelineData = {
2601
2654
  */
2602
2655
  fromDate?: string;
2603
2656
  /**
2604
- * The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Late Post ID.
2657
+ * The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID.
2605
2658
  *
2606
2659
  */
2607
2660
  postId: string;
@@ -3512,11 +3565,11 @@ export type GetConnectUrlData = {
3512
3565
  };
3513
3566
  query: {
3514
3567
  /**
3515
- * When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Late's default account selection UI. Use this to build a custom connect experience.
3568
+ * When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Zernio's default account selection UI. Use this to build a custom connect experience.
3516
3569
  */
3517
3570
  headless?: boolean;
3518
3571
  /**
3519
- * Your Late profile ID (get from /v1/profiles)
3572
+ * Your Zernio profile ID (get from /v1/profiles)
3520
3573
  */
3521
3574
  profileId: string;
3522
3575
  /**
@@ -3770,7 +3823,7 @@ export type SelectGoogleBusinessLocationError = (unknown | {
3770
3823
  export type GetGoogleBusinessReviewsData = {
3771
3824
  path: {
3772
3825
  /**
3773
- * The Late account ID (from /v1/accounts)
3826
+ * The Zernio account ID (from /v1/accounts)
3774
3827
  */
3775
3828
  accountId: string;
3776
3829
  };
@@ -3851,7 +3904,7 @@ export type GetGoogleBusinessReviewsError = (ErrorResponse | {
3851
3904
  export type GetGoogleBusinessFoodMenusData = {
3852
3905
  path: {
3853
3906
  /**
3854
- * The Late account ID (from /v1/accounts)
3907
+ * The Zernio account ID (from /v1/accounts)
3855
3908
  */
3856
3909
  accountId: string;
3857
3910
  };
@@ -3891,7 +3944,7 @@ export type UpdateGoogleBusinessFoodMenusData = {
3891
3944
  };
3892
3945
  path: {
3893
3946
  /**
3894
- * The Late account ID (from /v1/accounts)
3947
+ * The Zernio account ID (from /v1/accounts)
3895
3948
  */
3896
3949
  accountId: string;
3897
3950
  };
@@ -3918,7 +3971,7 @@ export type UpdateGoogleBusinessFoodMenusError = (ErrorResponse | {
3918
3971
  export type GetGoogleBusinessLocationDetailsData = {
3919
3972
  path: {
3920
3973
  /**
3921
- * The Late account ID (from /v1/accounts)
3974
+ * The Zernio account ID (from /v1/accounts)
3922
3975
  */
3923
3976
  accountId: string;
3924
3977
  };
@@ -4140,7 +4193,7 @@ export type UpdateGoogleBusinessLocationDetailsData = {
4140
4193
  };
4141
4194
  path: {
4142
4195
  /**
4143
- * The Late account ID (from /v1/accounts)
4196
+ * The Zernio account ID (from /v1/accounts)
4144
4197
  */
4145
4198
  accountId: string;
4146
4199
  };
@@ -4451,7 +4504,7 @@ export type GetPendingOAuthDataResponse = ({
4451
4504
  */
4452
4505
  platform?: string;
4453
4506
  /**
4454
- * The Late profile ID
4507
+ * The Zernio profile ID
4455
4508
  */
4456
4509
  profileId?: string;
4457
4510
  /**
@@ -4587,7 +4640,7 @@ export type ListPinterestBoardsForSelectionData = {
4587
4640
  };
4588
4641
  query: {
4589
4642
  /**
4590
- * Your Late profile ID
4643
+ * Your Zernio profile ID
4591
4644
  */
4592
4645
  profileId: string;
4593
4646
  /**
@@ -4625,7 +4678,7 @@ export type ListPinterestBoardsForSelectionError = (unknown | {
4625
4678
  export type SelectPinterestBoardData = {
4626
4679
  body: {
4627
4680
  /**
4628
- * Your Late profile ID
4681
+ * Your Zernio profile ID
4629
4682
  */
4630
4683
  profileId: string;
4631
4684
  /**
@@ -4694,7 +4747,7 @@ export type ListSnapchatProfilesData = {
4694
4747
  };
4695
4748
  query: {
4696
4749
  /**
4697
- * Your Late profile ID
4750
+ * Your Zernio profile ID
4698
4751
  */
4699
4752
  profileId: string;
4700
4753
  /**
@@ -4736,7 +4789,7 @@ export type ListSnapchatProfilesError = (unknown | {
4736
4789
  export type SelectSnapchatProfileData = {
4737
4790
  body: {
4738
4791
  /**
4739
- * Your Late profile ID
4792
+ * Your Zernio profile ID
4740
4793
  */
4741
4794
  profileId: string;
4742
4795
  /**
@@ -6661,7 +6714,7 @@ export type ListInboxCommentsError = ({
6661
6714
  export type GetInboxPostCommentsData = {
6662
6715
  path: {
6663
6716
  /**
6664
- * Late post ID or platform-specific post ID. Late IDs are auto-resolved. LinkedIn third-party posts accept full activity URN or numeric ID.
6717
+ * Zernio post ID or platform-specific post ID. Zernio IDs are auto-resolved. LinkedIn third-party posts accept full activity URN or numeric ID.
6665
6718
  */
6666
6719
  postId: string;
6667
6720
  };
@@ -6794,7 +6847,7 @@ export type ReplyToInboxPostData = {
6794
6847
  };
6795
6848
  path: {
6796
6849
  /**
6797
- * Late post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.
6850
+ * Zernio post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.
6798
6851
  */
6799
6852
  postId: string;
6800
6853
  };
@@ -6819,7 +6872,7 @@ export type ReplyToInboxPostError = ({
6819
6872
  export type DeleteInboxCommentData = {
6820
6873
  path: {
6821
6874
  /**
6822
- * Late post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.
6875
+ * Zernio post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.
6823
6876
  */
6824
6877
  postId: string;
6825
6878
  };