@zernio/node 0.2.87 → 0.2.89

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.
@@ -1322,13 +1322,24 @@ export type platform2 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp';
1322
1322
 
1323
1323
  export type direction = 'incoming' | 'outgoing';
1324
1324
 
1325
+ /**
1326
+ * Shared account-insights response envelope used by every platform-level
1327
+ * analytics endpoint (/v1/analytics/{facebook|instagram|youtube|linkedin|tiktok}*).
1328
+ * The name is historical - the shape was first shipped for Instagram and every
1329
+ * new platform endpoint reuses it for response-shape consistency. The platform
1330
+ * field echoes back which platform served the response.
1331
+ *
1332
+ */
1325
1333
  export type InstagramAccountInsightsResponse = {
1326
1334
  success?: boolean;
1327
1335
  /**
1328
1336
  * The Zernio SocialAccount ID
1329
1337
  */
1330
1338
  accountId?: string;
1331
- platform?: string;
1339
+ /**
1340
+ * Platform that served this response.
1341
+ */
1342
+ platform?: 'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok';
1332
1343
  dateRange?: {
1333
1344
  since?: string;
1334
1345
  until?: string;
@@ -1368,6 +1379,11 @@ export type InstagramAccountInsightsResponse = {
1368
1379
  dataDelay?: string;
1369
1380
  };
1370
1381
 
1382
+ /**
1383
+ * Platform that served this response.
1384
+ */
1385
+ export type platform3 = 'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok';
1386
+
1371
1387
  export type metricType = 'time_series' | 'total_value';
1372
1388
 
1373
1389
  export type InstagramDemographicsResponse = {
@@ -1518,6 +1534,20 @@ export type LinkedInAggregateAnalyticsDailyResponse = {
1518
1534
  date?: string;
1519
1535
  count?: number;
1520
1536
  }>;
1537
+ /**
1538
+ * Daily saves (personal accounts only)
1539
+ */
1540
+ saves?: Array<{
1541
+ date?: string;
1542
+ count?: number;
1543
+ }>;
1544
+ /**
1545
+ * Daily sends via LinkedIn messaging (personal accounts only)
1546
+ */
1547
+ sends?: Array<{
1548
+ date?: string;
1549
+ count?: number;
1550
+ }>;
1521
1551
  };
1522
1552
  /**
1523
1553
  * Metrics that were skipped due to API limitations
@@ -1563,6 +1593,14 @@ export type LinkedInAggregateAnalyticsTotalResponse = {
1563
1593
  * Total reshares across all posts
1564
1594
  */
1565
1595
  shares?: number;
1596
+ /**
1597
+ * Total times posts were saved (personal accounts only)
1598
+ */
1599
+ saves?: number;
1600
+ /**
1601
+ * Total times posts were sent via LinkedIn messaging (personal accounts only)
1602
+ */
1603
+ sends?: number;
1566
1604
  /**
1567
1605
  * Overall engagement rate as percentage
1568
1606
  */
@@ -2206,7 +2244,7 @@ export type ReviewWebhookReview = {
2206
2244
  /**
2207
2245
  * Platform the review originated on. Currently Google Business Profile only.
2208
2246
  */
2209
- export type platform3 = 'googlebusiness';
2247
+ export type platform4 = 'googlebusiness';
2210
2248
 
2211
2249
  /**
2212
2250
  * Requires a Public Profile. Single media item only. Content types: story (ephemeral 24h), saved_story (permanent, title max 45 chars), spotlight (video, max 160 chars).
@@ -2276,7 +2314,7 @@ export type SocialAccount = {
2276
2314
  };
2277
2315
  };
2278
2316
 
2279
- export type platform4 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads';
2317
+ export type platform5 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads';
2280
2318
 
2281
2319
  /**
2282
2320
  * Text, images (up to 10), videos (up to 10), and mixed media albums. Captions up to 1024 chars for media, 4096 for text-only.
@@ -2742,7 +2780,7 @@ export type WebhookPayloadComment = {
2742
2780
 
2743
2781
  export type event3 = 'comment.received';
2744
2782
 
2745
- export type platform5 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
2783
+ export type platform6 = 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit';
2746
2784
 
2747
2785
  /**
2748
2786
  * Webhook payload for message received events
@@ -3643,6 +3681,154 @@ export type GetAnalyticsError = ({
3643
3681
  code?: string;
3644
3682
  } | AnalyticsSinglePostResponse | ErrorResponse);
3645
3683
 
3684
+ export type GetYouTubeChannelInsightsData = {
3685
+ query: {
3686
+ /**
3687
+ * The Zernio SocialAccount ID for the YouTube account.
3688
+ */
3689
+ accountId: string;
3690
+ /**
3691
+ * Comma-separated list. Defaults to "views,estimatedMinutesWatched,subscribersGained,subscribersLost".
3692
+ *
3693
+ * Live YouTube Analytics v2 metrics:
3694
+ * - views
3695
+ * - estimatedMinutesWatched
3696
+ * - averageViewDuration (ratio - weighted mean computed across days)
3697
+ * - subscribersGained
3698
+ * - subscribersLost
3699
+ *
3700
+ * Zernio-synthesized from daily follower snapshots (cross-platform parity):
3701
+ * - followers_gained
3702
+ * - followers_lost
3703
+ *
3704
+ */
3705
+ metrics?: string;
3706
+ /**
3707
+ * "total_value" (default) returns aggregated totals.
3708
+ * "time_series" returns per-day values in the "values" array.
3709
+ *
3710
+ */
3711
+ metricType?: 'time_series' | 'total_value';
3712
+ /**
3713
+ * Start date (YYYY-MM-DD). Defaults to 30 days ago.
3714
+ */
3715
+ since?: string;
3716
+ /**
3717
+ * End date (YYYY-MM-DD). Defaults to today. YouTube Analytics has a 2-3 day delay,
3718
+ * so the fetch is internally clamped to 3 days ago; any requested range extending
3719
+ * beyond that returns zero values for the tail days. The response's dateRange.until
3720
+ * field reflects your requested value.
3721
+ *
3722
+ */
3723
+ until?: string;
3724
+ };
3725
+ };
3726
+
3727
+ export type GetYouTubeChannelInsightsResponse = (InstagramAccountInsightsResponse);
3728
+
3729
+ export type GetYouTubeChannelInsightsError = (unknown | {
3730
+ error?: string;
3731
+ } | YouTubeScopeMissingResponse);
3732
+
3733
+ export type GetLinkedInOrgAggregateAnalyticsData = {
3734
+ query: {
3735
+ /**
3736
+ * The Zernio SocialAccount ID for the LinkedIn organization account.
3737
+ */
3738
+ accountId: string;
3739
+ /**
3740
+ * Comma-separated list. Defaults to
3741
+ * "impressions,clicks,engagement_rate,organic_followers_gained,followers_gained,followers_lost".
3742
+ *
3743
+ * Share statistics (support both total_value and time_series):
3744
+ * - impressions
3745
+ * - unique_impressions
3746
+ * - clicks
3747
+ * - likes
3748
+ * - comments
3749
+ * - shares
3750
+ * - engagement_rate (0..1, LinkedIn-computed)
3751
+ *
3752
+ * Follower-gain statistics (support total_value and time_series):
3753
+ * - organic_followers_gained (per-day organic gains for time_series; sum of organic gains over the range for total_value)
3754
+ * - paid_followers_gained (per-day paid gains for time_series; sum of paid gains over the range for total_value)
3755
+ *
3756
+ * Page-view statistics (total_value ONLY - LinkedIn platform limit):
3757
+ * - page_views_total
3758
+ * - page_views_overview
3759
+ * - page_views_careers
3760
+ * - page_views_jobs
3761
+ * - page_views_life
3762
+ *
3763
+ * Zernio-synthesized from daily follower snapshots:
3764
+ * - followers_gained
3765
+ * - followers_lost
3766
+ *
3767
+ */
3768
+ metrics?: string;
3769
+ metricType?: 'time_series' | 'total_value';
3770
+ /**
3771
+ * Start date (YYYY-MM-DD). Defaults to 30 days ago.
3772
+ */
3773
+ since?: string;
3774
+ /**
3775
+ * End date (YYYY-MM-DD). Defaults to today.
3776
+ */
3777
+ until?: string;
3778
+ };
3779
+ };
3780
+
3781
+ export type GetLinkedInOrgAggregateAnalyticsResponse = (InstagramAccountInsightsResponse);
3782
+
3783
+ export type GetLinkedInOrgAggregateAnalyticsError = (unknown | {
3784
+ error?: string;
3785
+ });
3786
+
3787
+ export type GetTikTokAccountInsightsData = {
3788
+ query: {
3789
+ /**
3790
+ * The Zernio SocialAccount ID for the TikTok account.
3791
+ */
3792
+ accountId: string;
3793
+ /**
3794
+ * Comma-separated list. Defaults to
3795
+ * "follower_count,likes_count,video_count,followers_gained,followers_lost".
3796
+ *
3797
+ * Live from /v2/user/info/ (requires user.info.stats scope):
3798
+ * - follower_count (cumulative; time series joined from AccountStats)
3799
+ * - following_count (cumulative; time series joined from AccountStats.metadata)
3800
+ * - likes_count (cumulative; time series joined from AccountStats.metadata)
3801
+ * - video_count (cumulative; time series joined from AccountStats.metadata)
3802
+ *
3803
+ * Zernio-synthesized:
3804
+ * - followers_gained (sum of positive daily follower deltas)
3805
+ * - followers_lost (sum of absolute negative daily deltas)
3806
+ *
3807
+ */
3808
+ metrics?: string;
3809
+ /**
3810
+ * "total_value" returns the latest cumulative counter value.
3811
+ * "time_series" returns daily values joined from AccountStats snapshots.
3812
+ *
3813
+ */
3814
+ metricType?: 'time_series' | 'total_value';
3815
+ /**
3816
+ * Start date (YYYY-MM-DD). Defaults to 30 days ago.
3817
+ */
3818
+ since?: string;
3819
+ /**
3820
+ * End date (YYYY-MM-DD). Defaults to today.
3821
+ */
3822
+ until?: string;
3823
+ };
3824
+ };
3825
+
3826
+ export type GetTikTokAccountInsightsResponse = (InstagramAccountInsightsResponse);
3827
+
3828
+ export type GetTikTokAccountInsightsError = (unknown | {
3829
+ error?: string;
3830
+ });
3831
+
3646
3832
  export type GetYouTubeDailyViewsData = {
3647
3833
  query: {
3648
3834
  /**
@@ -3676,6 +3862,54 @@ export type GetYouTubeDailyViewsError = ({
3676
3862
  error?: string;
3677
3863
  });
3678
3864
 
3865
+ export type GetFacebookPageInsightsData = {
3866
+ query: {
3867
+ /**
3868
+ * The Zernio SocialAccount ID for the connected Facebook Page.
3869
+ */
3870
+ accountId: string;
3871
+ /**
3872
+ * Comma-separated list of metrics. Defaults to
3873
+ * "page_media_view,page_post_engagements,page_follows,followers_gained,followers_lost".
3874
+ *
3875
+ * Live Meta metrics (current names, post-Nov-2025):
3876
+ * - page_media_view (replaces deprecated page_impressions)
3877
+ * - page_views_total
3878
+ * - page_post_engagements
3879
+ * - page_video_views
3880
+ * - page_video_view_time
3881
+ * - page_follows (replaces deprecated page_fans)
3882
+ *
3883
+ * Zernio-synthesized from daily follower snapshots (filling the Nov-2025 gap
3884
+ * left by the page_fan_adds / page_fan_removes deprecation):
3885
+ * - followers_gained
3886
+ * - followers_lost
3887
+ *
3888
+ */
3889
+ metrics?: string;
3890
+ /**
3891
+ * "total_value" (default) returns aggregated totals only.
3892
+ * "time_series" returns daily values in the "values" array.
3893
+ *
3894
+ */
3895
+ metricType?: 'time_series' | 'total_value';
3896
+ /**
3897
+ * Start date (YYYY-MM-DD). Defaults to 30 days ago.
3898
+ */
3899
+ since?: string;
3900
+ /**
3901
+ * End date (YYYY-MM-DD). Defaults to today.
3902
+ */
3903
+ until?: string;
3904
+ };
3905
+ };
3906
+
3907
+ export type GetFacebookPageInsightsResponse = (InstagramAccountInsightsResponse);
3908
+
3909
+ export type GetFacebookPageInsightsError = (unknown | {
3910
+ error?: string;
3911
+ });
3912
+
3679
3913
  export type GetInstagramAccountInsightsData = {
3680
3914
  query: {
3681
3915
  /**
@@ -3692,7 +3926,10 @@ export type GetInstagramAccountInsightsData = {
3692
3926
  * Comma-separated list of metrics. Defaults to "reach,views,accounts_engaged,total_interactions".
3693
3927
  * Valid metrics: reach, views, accounts_engaged, total_interactions, comments, likes, saves, shares,
3694
3928
  * replies, reposts, follows_and_unfollows, profile_links_taps.
3695
- * Note: only "reach" supports metricType=time_series. All other metrics are total_value only.
3929
+ * Note: only "reach" supports metricType=time_series. All other metrics (including
3930
+ * follows_and_unfollows) are total_value only. This is an Instagram Graph API limitation,
3931
+ * not a Zernio limitation - the IG API does not return time-series data for these metrics.
3932
+ * For a daily running follower count, use /v1/analytics/instagram/follower-history instead.
3696
3933
  *
3697
3934
  */
3698
3935
  metrics?: string;
@@ -3722,6 +3959,43 @@ export type GetInstagramAccountInsightsError = ({
3722
3959
  code?: string;
3723
3960
  });
3724
3961
 
3962
+ export type GetInstagramFollowerHistoryData = {
3963
+ query: {
3964
+ /**
3965
+ * The Zernio SocialAccount ID for the Instagram account.
3966
+ */
3967
+ accountId: string;
3968
+ /**
3969
+ * Comma-separated list. Defaults to "follower_count,followers_gained,followers_lost".
3970
+ * - follower_count : per-day raw follower count
3971
+ * - followers_gained : sum of positive daily deltas
3972
+ * - followers_lost : sum of absolute negative daily deltas
3973
+ *
3974
+ */
3975
+ metrics?: string;
3976
+ /**
3977
+ * "total_value" returns aggregated totals (latest for follower_count, sum for gained/lost).
3978
+ * "time_series" returns per-day values in the "values" array.
3979
+ *
3980
+ */
3981
+ metricType?: 'time_series' | 'total_value';
3982
+ /**
3983
+ * Start date (YYYY-MM-DD). Defaults to 30 days ago.
3984
+ */
3985
+ since?: string;
3986
+ /**
3987
+ * End date (YYYY-MM-DD). Defaults to today.
3988
+ */
3989
+ until?: string;
3990
+ };
3991
+ };
3992
+
3993
+ export type GetInstagramFollowerHistoryResponse = (InstagramAccountInsightsResponse);
3994
+
3995
+ export type GetInstagramFollowerHistoryError = (unknown | {
3996
+ error?: string;
3997
+ });
3998
+
3725
3999
  export type GetInstagramDemographicsData = {
3726
4000
  query: {
3727
4001
  /**
@@ -6955,7 +7229,7 @@ export type GetLinkedInAggregateAnalyticsData = {
6955
7229
  */
6956
7230
  endDate?: string;
6957
7231
  /**
6958
- * Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE. Omit for all.
7232
+ * Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE, POST_SAVE, POST_SEND. Omit for all.
6959
7233
  */
6960
7234
  metrics?: string;
6961
7235
  /**
@@ -7025,6 +7299,14 @@ export type GetLinkedInPostAnalyticsResponse = ({
7025
7299
  * Reshares of the post
7026
7300
  */
7027
7301
  shares?: number;
7302
+ /**
7303
+ * Times the post was saved (personal accounts only; 0 for organization accounts)
7304
+ */
7305
+ saves?: number;
7306
+ /**
7307
+ * Times the post was sent via LinkedIn messaging (personal accounts only; 0 for organization accounts)
7308
+ */
7309
+ sends?: number;
7028
7310
  /**
7029
7311
  * Clicks on the post (organization accounts only)
7030
7312
  */
@@ -11910,8 +12192,22 @@ export type GetCommentAutomationResponse = ({
11910
12192
  commenterId?: string;
11911
12193
  commenterName?: string;
11912
12194
  commentText?: string;
12195
+ /**
12196
+ * DM outcome
12197
+ */
11913
12198
  status?: 'sent' | 'failed' | 'skipped';
12199
+ /**
12200
+ * DM error message if status is failed
12201
+ */
11914
12202
  error?: string;
12203
+ /**
12204
+ * Outcome of the optional public reply on the triggering comment. 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
12205
+ */
12206
+ commentReplyStatus?: 'sent' | 'failed' | 'skipped';
12207
+ /**
12208
+ * Public-reply error message if commentReplyStatus is failed
12209
+ */
12210
+ commentReplyError?: string;
11915
12211
  createdAt?: string;
11916
12212
  }>;
11917
12213
  });
@@ -11986,8 +12282,22 @@ export type ListCommentAutomationLogsResponse = ({
11986
12282
  commenterId?: string;
11987
12283
  commenterName?: string;
11988
12284
  commentText?: string;
12285
+ /**
12286
+ * DM outcome
12287
+ */
11989
12288
  status?: 'sent' | 'failed' | 'skipped';
12289
+ /**
12290
+ * DM error message if status is failed
12291
+ */
11990
12292
  error?: string;
12293
+ /**
12294
+ * Outcome of the optional public reply on the triggering comment. 'skipped' if no commentReply was configured or if the DM failed (the public reply is not attempted in that case).
12295
+ */
12296
+ commentReplyStatus?: 'sent' | 'failed' | 'skipped';
12297
+ /**
12298
+ * Public-reply error message if commentReplyStatus is failed
12299
+ */
12300
+ commentReplyError?: string;
11991
12301
  createdAt?: string;
11992
12302
  }>;
11993
12303
  pagination?: {