@dracoonghost/trndup-sdk 1.4.0 → 1.5.0

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.
package/dist/index.d.mts CHANGED
@@ -2694,6 +2694,156 @@ declare class InsightsModule {
2694
2694
  * GET /v1/insights/youtube/all
2695
2695
  */
2696
2696
  getYouTubeAllInsights(): Promise<Insights.AllInsightsResponse>;
2697
+ /**
2698
+ * Instagram insights sub-module
2699
+ */
2700
+ instagram: {
2701
+ /**
2702
+ * Get all Instagram insights in one call
2703
+ *
2704
+ * Efficient for dashboard display - fetches all insights in parallel.
2705
+ *
2706
+ * @example
2707
+ * ```typescript
2708
+ * const all = await client.insights.instagram.getAll({ range: '30d' });
2709
+ *
2710
+ * // Check which insights are available
2711
+ * if (all.data.health.hasData) {
2712
+ * console.log(`Health Score: ${all.data.health.data.overall}/100`);
2713
+ * }
2714
+ *
2715
+ * if (all.data.bestPost.hasData) {
2716
+ * console.log(`Best Post: ${all.data.bestPost.data.post.caption}`);
2717
+ * }
2718
+ * ```
2719
+ *
2720
+ * GET /v1/insights/instagram
2721
+ */
2722
+ getAll: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.InstagramAllInsightsResponse>;
2723
+ /**
2724
+ * Get Instagram health score
2725
+ *
2726
+ * Overall account health based on consistency, engagement, growth, and reach.
2727
+ * Score ranges from 0-100 with labels: excellent, good, fair, needs_attention, poor.
2728
+ *
2729
+ * @example
2730
+ * ```typescript
2731
+ * const health = await client.insights.instagram.getHealthScore({ range: '30d' });
2732
+ *
2733
+ * if (health.hasData) {
2734
+ * console.log(`Score: ${health.data.overall}/100 (${health.data.label})`);
2735
+ * console.log(`Consistency: ${health.data.components.consistency.score}`);
2736
+ * console.log(`Engagement: ${health.data.components.engagement.score}`);
2737
+ * console.log(`Growth: ${health.data.components.growth.score}`);
2738
+ * console.log(`Reach: ${health.data.components.reach.score}`);
2739
+ * }
2740
+ * ```
2741
+ *
2742
+ * GET /v1/insights/instagram/health
2743
+ */
2744
+ getHealthScore: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.InstagramHealthScoreResponse>;
2745
+ /**
2746
+ * Get best performing post
2747
+ *
2748
+ * Identifies the top performing post in the period based on engagement rate.
2749
+ * Includes analysis of why it worked and comparison to average.
2750
+ *
2751
+ * @example
2752
+ * ```typescript
2753
+ * const best = await client.insights.instagram.getBestPost({ range: '30d' });
2754
+ *
2755
+ * if (best.hasData) {
2756
+ * console.log(`Post: ${best.data.post.caption}`);
2757
+ * console.log(`Engagement: ${best.data.post.metrics.engagementRate}%`);
2758
+ * console.log(`Above average: ${best.data.comparison.vsAverage.engagement}%`);
2759
+ * }
2760
+ * ```
2761
+ *
2762
+ * GET /v1/insights/instagram/best-post
2763
+ */
2764
+ getBestPost: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.BestPerformingPostResponse>;
2765
+ /**
2766
+ * Get posting consistency analysis
2767
+ *
2768
+ * Analyzes posting frequency patterns and consistency.
2769
+ * Identifies best posting days and gaps in schedule.
2770
+ *
2771
+ * @example
2772
+ * ```typescript
2773
+ * const consistency = await client.insights.instagram.getConsistency({ range: '90d' });
2774
+ *
2775
+ * if (consistency.hasData) {
2776
+ * console.log(`Posts/week: ${consistency.data.frequency.current.postsPerWeek}`);
2777
+ * console.log(`Score: ${consistency.data.consistency.score}/100`);
2778
+ * console.log(`Best day: ${consistency.data.patterns.mostActiveDay}`);
2779
+ * }
2780
+ * ```
2781
+ *
2782
+ * GET /v1/insights/instagram/consistency
2783
+ */
2784
+ getConsistency: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.PostingConsistencyResponse>;
2785
+ /**
2786
+ * Get follower quality analysis
2787
+ *
2788
+ * Measures the quality and engagement of followers.
2789
+ * Shows growth metrics and engagement rates.
2790
+ *
2791
+ * @example
2792
+ * ```typescript
2793
+ * const quality = await client.insights.instagram.getFollowerQuality({ range: '30d' });
2794
+ *
2795
+ * if (quality.hasData) {
2796
+ * console.log(`Quality: ${quality.data.qualityScore}/100`);
2797
+ * console.log(`Engagement rate: ${quality.data.metrics.engagementRate}%`);
2798
+ * console.log(`Growth: +${quality.data.growth.netChange} followers`);
2799
+ * }
2800
+ * ```
2801
+ *
2802
+ * GET /v1/insights/instagram/follower-quality
2803
+ */
2804
+ getFollowerQuality: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.FollowerQualityResponse>;
2805
+ /**
2806
+ * Get account momentum
2807
+ *
2808
+ * Shows current account trajectory: surging, growing, stable, declining, or stalling.
2809
+ * Compares recent performance to previous periods.
2810
+ *
2811
+ * @example
2812
+ * ```typescript
2813
+ * const momentum = await client.insights.instagram.getMomentum();
2814
+ *
2815
+ * if (momentum.hasData) {
2816
+ * console.log(`Status: ${momentum.data.current.status}`);
2817
+ * console.log(`Score: ${momentum.data.current.score}`);
2818
+ * console.log(`vs Last Week: ${momentum.data.comparison.vsLastWeek}%`);
2819
+ * }
2820
+ * ```
2821
+ *
2822
+ * GET /v1/insights/instagram/momentum
2823
+ */
2824
+ getMomentum: () => Promise<Insights.InstagramMomentumResponse>;
2825
+ /**
2826
+ * Get engagement breakdown
2827
+ *
2828
+ * Breaks down engagement by type: likes, comments, shares, saves.
2829
+ * Identifies engagement style and opportunities.
2830
+ *
2831
+ * @example
2832
+ * ```typescript
2833
+ * const engagement = await client.insights.instagram.getEngagement({ range: '30d' });
2834
+ *
2835
+ * if (engagement.hasData) {
2836
+ * console.log(`Total: ${engagement.data.totalEngagement}`);
2837
+ * console.log(`Style: ${engagement.data.engagementStyle}`);
2838
+ * console.log(`Likes: ${engagement.data.breakdown.likes.percent}%`);
2839
+ * console.log(`Comments: ${engagement.data.breakdown.comments.percent}%`);
2840
+ * }
2841
+ * ```
2842
+ *
2843
+ * GET /v1/insights/instagram/engagement
2844
+ */
2845
+ getEngagement: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.EngagementBreakdownResponse>;
2846
+ };
2697
2847
  }
2698
2848
 
2699
2849
  /**
package/dist/index.d.ts CHANGED
@@ -2694,6 +2694,156 @@ declare class InsightsModule {
2694
2694
  * GET /v1/insights/youtube/all
2695
2695
  */
2696
2696
  getYouTubeAllInsights(): Promise<Insights.AllInsightsResponse>;
2697
+ /**
2698
+ * Instagram insights sub-module
2699
+ */
2700
+ instagram: {
2701
+ /**
2702
+ * Get all Instagram insights in one call
2703
+ *
2704
+ * Efficient for dashboard display - fetches all insights in parallel.
2705
+ *
2706
+ * @example
2707
+ * ```typescript
2708
+ * const all = await client.insights.instagram.getAll({ range: '30d' });
2709
+ *
2710
+ * // Check which insights are available
2711
+ * if (all.data.health.hasData) {
2712
+ * console.log(`Health Score: ${all.data.health.data.overall}/100`);
2713
+ * }
2714
+ *
2715
+ * if (all.data.bestPost.hasData) {
2716
+ * console.log(`Best Post: ${all.data.bestPost.data.post.caption}`);
2717
+ * }
2718
+ * ```
2719
+ *
2720
+ * GET /v1/insights/instagram
2721
+ */
2722
+ getAll: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.InstagramAllInsightsResponse>;
2723
+ /**
2724
+ * Get Instagram health score
2725
+ *
2726
+ * Overall account health based on consistency, engagement, growth, and reach.
2727
+ * Score ranges from 0-100 with labels: excellent, good, fair, needs_attention, poor.
2728
+ *
2729
+ * @example
2730
+ * ```typescript
2731
+ * const health = await client.insights.instagram.getHealthScore({ range: '30d' });
2732
+ *
2733
+ * if (health.hasData) {
2734
+ * console.log(`Score: ${health.data.overall}/100 (${health.data.label})`);
2735
+ * console.log(`Consistency: ${health.data.components.consistency.score}`);
2736
+ * console.log(`Engagement: ${health.data.components.engagement.score}`);
2737
+ * console.log(`Growth: ${health.data.components.growth.score}`);
2738
+ * console.log(`Reach: ${health.data.components.reach.score}`);
2739
+ * }
2740
+ * ```
2741
+ *
2742
+ * GET /v1/insights/instagram/health
2743
+ */
2744
+ getHealthScore: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.InstagramHealthScoreResponse>;
2745
+ /**
2746
+ * Get best performing post
2747
+ *
2748
+ * Identifies the top performing post in the period based on engagement rate.
2749
+ * Includes analysis of why it worked and comparison to average.
2750
+ *
2751
+ * @example
2752
+ * ```typescript
2753
+ * const best = await client.insights.instagram.getBestPost({ range: '30d' });
2754
+ *
2755
+ * if (best.hasData) {
2756
+ * console.log(`Post: ${best.data.post.caption}`);
2757
+ * console.log(`Engagement: ${best.data.post.metrics.engagementRate}%`);
2758
+ * console.log(`Above average: ${best.data.comparison.vsAverage.engagement}%`);
2759
+ * }
2760
+ * ```
2761
+ *
2762
+ * GET /v1/insights/instagram/best-post
2763
+ */
2764
+ getBestPost: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.BestPerformingPostResponse>;
2765
+ /**
2766
+ * Get posting consistency analysis
2767
+ *
2768
+ * Analyzes posting frequency patterns and consistency.
2769
+ * Identifies best posting days and gaps in schedule.
2770
+ *
2771
+ * @example
2772
+ * ```typescript
2773
+ * const consistency = await client.insights.instagram.getConsistency({ range: '90d' });
2774
+ *
2775
+ * if (consistency.hasData) {
2776
+ * console.log(`Posts/week: ${consistency.data.frequency.current.postsPerWeek}`);
2777
+ * console.log(`Score: ${consistency.data.consistency.score}/100`);
2778
+ * console.log(`Best day: ${consistency.data.patterns.mostActiveDay}`);
2779
+ * }
2780
+ * ```
2781
+ *
2782
+ * GET /v1/insights/instagram/consistency
2783
+ */
2784
+ getConsistency: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.PostingConsistencyResponse>;
2785
+ /**
2786
+ * Get follower quality analysis
2787
+ *
2788
+ * Measures the quality and engagement of followers.
2789
+ * Shows growth metrics and engagement rates.
2790
+ *
2791
+ * @example
2792
+ * ```typescript
2793
+ * const quality = await client.insights.instagram.getFollowerQuality({ range: '30d' });
2794
+ *
2795
+ * if (quality.hasData) {
2796
+ * console.log(`Quality: ${quality.data.qualityScore}/100`);
2797
+ * console.log(`Engagement rate: ${quality.data.metrics.engagementRate}%`);
2798
+ * console.log(`Growth: +${quality.data.growth.netChange} followers`);
2799
+ * }
2800
+ * ```
2801
+ *
2802
+ * GET /v1/insights/instagram/follower-quality
2803
+ */
2804
+ getFollowerQuality: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.FollowerQualityResponse>;
2805
+ /**
2806
+ * Get account momentum
2807
+ *
2808
+ * Shows current account trajectory: surging, growing, stable, declining, or stalling.
2809
+ * Compares recent performance to previous periods.
2810
+ *
2811
+ * @example
2812
+ * ```typescript
2813
+ * const momentum = await client.insights.instagram.getMomentum();
2814
+ *
2815
+ * if (momentum.hasData) {
2816
+ * console.log(`Status: ${momentum.data.current.status}`);
2817
+ * console.log(`Score: ${momentum.data.current.score}`);
2818
+ * console.log(`vs Last Week: ${momentum.data.comparison.vsLastWeek}%`);
2819
+ * }
2820
+ * ```
2821
+ *
2822
+ * GET /v1/insights/instagram/momentum
2823
+ */
2824
+ getMomentum: () => Promise<Insights.InstagramMomentumResponse>;
2825
+ /**
2826
+ * Get engagement breakdown
2827
+ *
2828
+ * Breaks down engagement by type: likes, comments, shares, saves.
2829
+ * Identifies engagement style and opportunities.
2830
+ *
2831
+ * @example
2832
+ * ```typescript
2833
+ * const engagement = await client.insights.instagram.getEngagement({ range: '30d' });
2834
+ *
2835
+ * if (engagement.hasData) {
2836
+ * console.log(`Total: ${engagement.data.totalEngagement}`);
2837
+ * console.log(`Style: ${engagement.data.engagementStyle}`);
2838
+ * console.log(`Likes: ${engagement.data.breakdown.likes.percent}%`);
2839
+ * console.log(`Comments: ${engagement.data.breakdown.comments.percent}%`);
2840
+ * }
2841
+ * ```
2842
+ *
2843
+ * GET /v1/insights/instagram/engagement
2844
+ */
2845
+ getEngagement: (params?: Insights.GetInstagramInsightParams) => Promise<Insights.EngagementBreakdownResponse>;
2846
+ };
2697
2847
  }
2698
2848
 
2699
2849
  /**
package/dist/index.js CHANGED
@@ -729,6 +729,203 @@ var SocialModule = class {
729
729
  var InsightsModule = class {
730
730
  constructor(client) {
731
731
  this.client = client;
732
+ // =========================================================================
733
+ // INSTAGRAM INSIGHTS
734
+ // =========================================================================
735
+ /**
736
+ * Instagram insights sub-module
737
+ */
738
+ this.instagram = {
739
+ /**
740
+ * Get all Instagram insights in one call
741
+ *
742
+ * Efficient for dashboard display - fetches all insights in parallel.
743
+ *
744
+ * @example
745
+ * ```typescript
746
+ * const all = await client.insights.instagram.getAll({ range: '30d' });
747
+ *
748
+ * // Check which insights are available
749
+ * if (all.data.health.hasData) {
750
+ * console.log(`Health Score: ${all.data.health.data.overall}/100`);
751
+ * }
752
+ *
753
+ * if (all.data.bestPost.hasData) {
754
+ * console.log(`Best Post: ${all.data.bestPost.data.post.caption}`);
755
+ * }
756
+ * ```
757
+ *
758
+ * GET /v1/insights/instagram
759
+ */
760
+ getAll: (params) => {
761
+ const queryParams = new URLSearchParams();
762
+ if (params?.range) queryParams.set("range", params.range);
763
+ const query = queryParams.toString();
764
+ return this.client.get(
765
+ `/v1/insights/instagram${query ? `?${query}` : ""}`
766
+ );
767
+ },
768
+ /**
769
+ * Get Instagram health score
770
+ *
771
+ * Overall account health based on consistency, engagement, growth, and reach.
772
+ * Score ranges from 0-100 with labels: excellent, good, fair, needs_attention, poor.
773
+ *
774
+ * @example
775
+ * ```typescript
776
+ * const health = await client.insights.instagram.getHealthScore({ range: '30d' });
777
+ *
778
+ * if (health.hasData) {
779
+ * console.log(`Score: ${health.data.overall}/100 (${health.data.label})`);
780
+ * console.log(`Consistency: ${health.data.components.consistency.score}`);
781
+ * console.log(`Engagement: ${health.data.components.engagement.score}`);
782
+ * console.log(`Growth: ${health.data.components.growth.score}`);
783
+ * console.log(`Reach: ${health.data.components.reach.score}`);
784
+ * }
785
+ * ```
786
+ *
787
+ * GET /v1/insights/instagram/health
788
+ */
789
+ getHealthScore: (params) => {
790
+ const queryParams = new URLSearchParams();
791
+ if (params?.range) queryParams.set("range", params.range);
792
+ const query = queryParams.toString();
793
+ return this.client.get(
794
+ `/v1/insights/instagram/health${query ? `?${query}` : ""}`
795
+ );
796
+ },
797
+ /**
798
+ * Get best performing post
799
+ *
800
+ * Identifies the top performing post in the period based on engagement rate.
801
+ * Includes analysis of why it worked and comparison to average.
802
+ *
803
+ * @example
804
+ * ```typescript
805
+ * const best = await client.insights.instagram.getBestPost({ range: '30d' });
806
+ *
807
+ * if (best.hasData) {
808
+ * console.log(`Post: ${best.data.post.caption}`);
809
+ * console.log(`Engagement: ${best.data.post.metrics.engagementRate}%`);
810
+ * console.log(`Above average: ${best.data.comparison.vsAverage.engagement}%`);
811
+ * }
812
+ * ```
813
+ *
814
+ * GET /v1/insights/instagram/best-post
815
+ */
816
+ getBestPost: (params) => {
817
+ const queryParams = new URLSearchParams();
818
+ if (params?.range) queryParams.set("range", params.range);
819
+ const query = queryParams.toString();
820
+ return this.client.get(
821
+ `/v1/insights/instagram/best-post${query ? `?${query}` : ""}`
822
+ );
823
+ },
824
+ /**
825
+ * Get posting consistency analysis
826
+ *
827
+ * Analyzes posting frequency patterns and consistency.
828
+ * Identifies best posting days and gaps in schedule.
829
+ *
830
+ * @example
831
+ * ```typescript
832
+ * const consistency = await client.insights.instagram.getConsistency({ range: '90d' });
833
+ *
834
+ * if (consistency.hasData) {
835
+ * console.log(`Posts/week: ${consistency.data.frequency.current.postsPerWeek}`);
836
+ * console.log(`Score: ${consistency.data.consistency.score}/100`);
837
+ * console.log(`Best day: ${consistency.data.patterns.mostActiveDay}`);
838
+ * }
839
+ * ```
840
+ *
841
+ * GET /v1/insights/instagram/consistency
842
+ */
843
+ getConsistency: (params) => {
844
+ const queryParams = new URLSearchParams();
845
+ if (params?.range) queryParams.set("range", params.range);
846
+ const query = queryParams.toString();
847
+ return this.client.get(
848
+ `/v1/insights/instagram/consistency${query ? `?${query}` : ""}`
849
+ );
850
+ },
851
+ /**
852
+ * Get follower quality analysis
853
+ *
854
+ * Measures the quality and engagement of followers.
855
+ * Shows growth metrics and engagement rates.
856
+ *
857
+ * @example
858
+ * ```typescript
859
+ * const quality = await client.insights.instagram.getFollowerQuality({ range: '30d' });
860
+ *
861
+ * if (quality.hasData) {
862
+ * console.log(`Quality: ${quality.data.qualityScore}/100`);
863
+ * console.log(`Engagement rate: ${quality.data.metrics.engagementRate}%`);
864
+ * console.log(`Growth: +${quality.data.growth.netChange} followers`);
865
+ * }
866
+ * ```
867
+ *
868
+ * GET /v1/insights/instagram/follower-quality
869
+ */
870
+ getFollowerQuality: (params) => {
871
+ const queryParams = new URLSearchParams();
872
+ if (params?.range) queryParams.set("range", params.range);
873
+ const query = queryParams.toString();
874
+ return this.client.get(
875
+ `/v1/insights/instagram/follower-quality${query ? `?${query}` : ""}`
876
+ );
877
+ },
878
+ /**
879
+ * Get account momentum
880
+ *
881
+ * Shows current account trajectory: surging, growing, stable, declining, or stalling.
882
+ * Compares recent performance to previous periods.
883
+ *
884
+ * @example
885
+ * ```typescript
886
+ * const momentum = await client.insights.instagram.getMomentum();
887
+ *
888
+ * if (momentum.hasData) {
889
+ * console.log(`Status: ${momentum.data.current.status}`);
890
+ * console.log(`Score: ${momentum.data.current.score}`);
891
+ * console.log(`vs Last Week: ${momentum.data.comparison.vsLastWeek}%`);
892
+ * }
893
+ * ```
894
+ *
895
+ * GET /v1/insights/instagram/momentum
896
+ */
897
+ getMomentum: () => {
898
+ return this.client.get("/v1/insights/instagram/momentum");
899
+ },
900
+ /**
901
+ * Get engagement breakdown
902
+ *
903
+ * Breaks down engagement by type: likes, comments, shares, saves.
904
+ * Identifies engagement style and opportunities.
905
+ *
906
+ * @example
907
+ * ```typescript
908
+ * const engagement = await client.insights.instagram.getEngagement({ range: '30d' });
909
+ *
910
+ * if (engagement.hasData) {
911
+ * console.log(`Total: ${engagement.data.totalEngagement}`);
912
+ * console.log(`Style: ${engagement.data.engagementStyle}`);
913
+ * console.log(`Likes: ${engagement.data.breakdown.likes.percent}%`);
914
+ * console.log(`Comments: ${engagement.data.breakdown.comments.percent}%`);
915
+ * }
916
+ * ```
917
+ *
918
+ * GET /v1/insights/instagram/engagement
919
+ */
920
+ getEngagement: (params) => {
921
+ const queryParams = new URLSearchParams();
922
+ if (params?.range) queryParams.set("range", params.range);
923
+ const query = queryParams.toString();
924
+ return this.client.get(
925
+ `/v1/insights/instagram/engagement${query ? `?${query}` : ""}`
926
+ );
927
+ }
928
+ };
732
929
  }
733
930
  /**
734
931
  * Get cross-platform metrics