@dracoonghost/trndup-sdk 1.3.26 → 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
@@ -1754,6 +1754,172 @@ declare namespace Activity {
1754
1754
  limit?: number;
1755
1755
  }
1756
1756
  }
1757
+ declare namespace Trends {
1758
+ /** Trend categories */
1759
+ type Category = 'SPORTS' | 'NEWS' | 'TECH' | 'ENTERTAINMENT' | 'GAMING' | 'LIFESTYLE' | 'FINANCE' | 'EDUCATION' | 'OTHER';
1760
+ /** How fast the trend is growing */
1761
+ type Velocity = 'SLOW' | 'MEDIUM' | 'FAST' | 'VIRAL';
1762
+ /** Predicted viral potential */
1763
+ type ViralPrediction = 'LOW' | 'MEDIUM' | 'HIGH_VIRAL';
1764
+ /** Current trend status */
1765
+ type Status = 'NEW' | 'TRENDING' | 'PEAKING' | 'COOLING';
1766
+ /** Content idea difficulty level */
1767
+ type Difficulty = 'EASY' | 'MEDIUM' | 'HARD';
1768
+ /**
1769
+ * Content idea for a trend
1770
+ */
1771
+ interface ContentIdea {
1772
+ /** How hard it is to create */
1773
+ difficulty: Difficulty;
1774
+ /** Idea title */
1775
+ title: string;
1776
+ /** Detailed description */
1777
+ description: string;
1778
+ }
1779
+ /**
1780
+ * Example content from other creators
1781
+ */
1782
+ interface TopExample {
1783
+ /** Link to the video */
1784
+ videoUrl: string;
1785
+ /** Creator's name */
1786
+ creatorName?: string;
1787
+ /** View count display (e.g., "1.2M views") */
1788
+ views?: string;
1789
+ /** Thumbnail image URL */
1790
+ thumbnail?: string;
1791
+ }
1792
+ /**
1793
+ * Trend list item (compact)
1794
+ */
1795
+ interface TrendListItem {
1796
+ /** Unique trend ID */
1797
+ id: string;
1798
+ /** Trend topic title */
1799
+ topic: string;
1800
+ /** Brief summary */
1801
+ summary: string;
1802
+ /** Content category */
1803
+ category: Category;
1804
+ /** Growth velocity */
1805
+ velocity: Velocity;
1806
+ /** Viral potential prediction */
1807
+ viralPrediction: ViralPrediction;
1808
+ /** Relevance score (0-100) */
1809
+ relevanceScore: number;
1810
+ /** Current status */
1811
+ status: Status;
1812
+ /** Growth label (e.g., "🔥 Viral") */
1813
+ growthLabel: string;
1814
+ /** Peak timing hint (e.g., "🎯 Peak NOW") */
1815
+ peakWindow: string | null;
1816
+ /** Relevant platforms */
1817
+ platforms: string[];
1818
+ /** Related hashtags */
1819
+ hashtags: string[];
1820
+ /** When first detected */
1821
+ firstSeen: string;
1822
+ /** Number of content ideas */
1823
+ contentIdeasCount: number;
1824
+ }
1825
+ /**
1826
+ * Full trend details
1827
+ */
1828
+ interface TrendDetail {
1829
+ /** Unique trend ID */
1830
+ id: string;
1831
+ /** Trend topic title */
1832
+ topic: string;
1833
+ /** Detailed summary */
1834
+ summary: string;
1835
+ /** Content category */
1836
+ category: Category;
1837
+ /** Growth velocity */
1838
+ velocity: Velocity;
1839
+ /** Viral potential prediction */
1840
+ viralPrediction: ViralPrediction;
1841
+ /** Relevance score (0-100) */
1842
+ relevanceScore: number;
1843
+ /** Number of times spotted */
1844
+ sightingCount: number;
1845
+ /** Peak strength (1-5) */
1846
+ peakStrength: number;
1847
+ /** Current status */
1848
+ status: Status;
1849
+ /** Growth label */
1850
+ growthLabel: string;
1851
+ /** Peak timing hint */
1852
+ peakWindow: string | null;
1853
+ /** When first detected */
1854
+ firstSeen: string;
1855
+ /** Last activity timestamp */
1856
+ lastActivity: string;
1857
+ /** Relevant platforms */
1858
+ platforms: string[];
1859
+ /** Related hashtags */
1860
+ hashtags: string[];
1861
+ /** Target creator types */
1862
+ targetCreators: string[];
1863
+ /** Content ideas */
1864
+ contentIdeas: ContentIdea[];
1865
+ /** Example content */
1866
+ topExamples: TopExample[];
1867
+ /** Recommended video duration */
1868
+ recommendedDuration: string | null;
1869
+ /** Last updated */
1870
+ updatedAt: string;
1871
+ }
1872
+ /**
1873
+ * Response for list trends endpoint
1874
+ */
1875
+ interface ListResponse {
1876
+ trends: TrendListItem[];
1877
+ total: number;
1878
+ limit: number;
1879
+ offset: number;
1880
+ }
1881
+ /**
1882
+ * Category with trend count
1883
+ */
1884
+ interface CategoryCount {
1885
+ category: string;
1886
+ count: number;
1887
+ }
1888
+ /**
1889
+ * Platform with trend count
1890
+ */
1891
+ interface PlatformCount {
1892
+ platform: string;
1893
+ count: number;
1894
+ }
1895
+ /**
1896
+ * Sync status info
1897
+ */
1898
+ interface SyncStatus {
1899
+ lastSyncedAt: string | null;
1900
+ lastSyncStatus: 'SUCCESS' | 'FAILED' | null;
1901
+ trendsProcessed: number;
1902
+ trendsDeleted: number;
1903
+ totalTrends: number;
1904
+ }
1905
+ /**
1906
+ * Parameters for listing trends
1907
+ */
1908
+ interface ListParams {
1909
+ /** Filter by category */
1910
+ category?: Category;
1911
+ /** Filter by velocity */
1912
+ velocity?: Velocity;
1913
+ /** Filter by status */
1914
+ status?: Status;
1915
+ /** Filter by platform */
1916
+ platform?: string;
1917
+ /** Max results (default: 20, max: 100) */
1918
+ limit?: number;
1919
+ /** Pagination offset */
1920
+ offset?: number;
1921
+ }
1922
+ }
1757
1923
 
1758
1924
  /**
1759
1925
  * TrndUp SDK - Base Client
@@ -2528,6 +2694,156 @@ declare class InsightsModule {
2528
2694
  * GET /v1/insights/youtube/all
2529
2695
  */
2530
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
+ };
2531
2847
  }
2532
2848
 
2533
2849
  /**
@@ -2587,6 +2903,114 @@ declare class ActivityModule {
2587
2903
  getLatest(jobType: Activity.JobType): Promise<Activity.LogEntry | null>;
2588
2904
  }
2589
2905
 
2906
+ /**
2907
+ * Trends Module
2908
+ *
2909
+ * Methods for fetching trending content ideas from TrendPulse.
2910
+ */
2911
+
2912
+ declare class TrendsModule {
2913
+ private client;
2914
+ constructor(client: TrndUpClient);
2915
+ /**
2916
+ * List trending topics with optional filters
2917
+ *
2918
+ * @param params - Filter and pagination options
2919
+ * @returns Paginated list of trends sorted by relevance
2920
+ *
2921
+ * @example
2922
+ * ```typescript
2923
+ * // Get top trends
2924
+ * const trends = await sdk.trends.list();
2925
+ *
2926
+ * // Filter by category
2927
+ * const sportsTrends = await sdk.trends.list({ category: 'SPORTS' });
2928
+ *
2929
+ * // Filter by velocity
2930
+ * const viralTrends = await sdk.trends.list({ velocity: 'VIRAL' });
2931
+ *
2932
+ * // Paginate
2933
+ * const page2 = await sdk.trends.list({ limit: 20, offset: 20 });
2934
+ * ```
2935
+ */
2936
+ list(params?: Trends.ListParams): Promise<Trends.ListResponse>;
2937
+ /**
2938
+ * Get full details of a specific trend
2939
+ *
2940
+ * @param trendId - The unique trend ID
2941
+ * @returns Full trend details including content ideas and examples
2942
+ *
2943
+ * @example
2944
+ * ```typescript
2945
+ * const trend = await sdk.trends.getById('trend_123');
2946
+ * console.log(trend.contentIdeas);
2947
+ * console.log(trend.topExamples);
2948
+ * ```
2949
+ */
2950
+ getById(trendId: string): Promise<Trends.TrendDetail>;
2951
+ /**
2952
+ * Get all categories with trend counts
2953
+ *
2954
+ * @returns List of categories and their trend counts
2955
+ *
2956
+ * @example
2957
+ * ```typescript
2958
+ * const categories = await sdk.trends.getCategories();
2959
+ * // [{ category: 'SPORTS', count: 15 }, { category: 'TECH', count: 12 }, ...]
2960
+ * ```
2961
+ */
2962
+ getCategories(): Promise<Trends.CategoryCount[]>;
2963
+ /**
2964
+ * Get all platforms with trend counts
2965
+ *
2966
+ * @returns List of platforms and their trend counts
2967
+ *
2968
+ * @example
2969
+ * ```typescript
2970
+ * const platforms = await sdk.trends.getPlatforms();
2971
+ * // [{ platform: 'YouTube', count: 25 }, { platform: 'Instagram', count: 18 }, ...]
2972
+ * ```
2973
+ */
2974
+ getPlatforms(): Promise<Trends.PlatformCount[]>;
2975
+ /**
2976
+ * Get sync status information
2977
+ *
2978
+ * @returns Current sync status and statistics
2979
+ *
2980
+ * @example
2981
+ * ```typescript
2982
+ * const status = await sdk.trends.getSyncStatus();
2983
+ * console.log(status.lastSyncedAt);
2984
+ * console.log(status.totalTrends);
2985
+ * ```
2986
+ */
2987
+ getSyncStatus(): Promise<Trends.SyncStatus>;
2988
+ /**
2989
+ * Get viral trends (velocity = VIRAL)
2990
+ * Convenience method for filtering viral trends
2991
+ *
2992
+ * @param limit - Max results (default: 10)
2993
+ * @returns List of viral trends
2994
+ */
2995
+ getViral(limit?: number): Promise<Trends.ListResponse>;
2996
+ /**
2997
+ * Get peaking trends (status = PEAKING)
2998
+ * Convenience method for filtering trends at peak
2999
+ *
3000
+ * @param limit - Max results (default: 10)
3001
+ * @returns List of peaking trends
3002
+ */
3003
+ getPeaking(limit?: number): Promise<Trends.ListResponse>;
3004
+ /**
3005
+ * Get trends for a specific platform
3006
+ *
3007
+ * @param platform - Platform name (e.g., 'YouTube', 'Instagram')
3008
+ * @param limit - Max results (default: 20)
3009
+ * @returns List of trends for the platform
3010
+ */
3011
+ getByPlatform(platform: string, limit?: number): Promise<Trends.ListResponse>;
3012
+ }
3013
+
2590
3014
  /**
2591
3015
  * TrndUp API SDK
2592
3016
  *
@@ -2632,9 +3056,10 @@ declare class TrndUpSDK extends TrndUpClient {
2632
3056
  social: SocialModule;
2633
3057
  insights: InsightsModule;
2634
3058
  activity: ActivityModule;
3059
+ trends: TrendsModule;
2635
3060
  constructor(config: TrndUpClientConfig);
2636
3061
  }
2637
3062
 
2638
3063
  declare const SDK_VERSION = "1.0.0";
2639
3064
 
2640
- export { Activity, Auth, INSTAGRAM_SCOPES, Insights, Instagram, type RequestOptions, SDK_VERSION, Social, TrndUpApiError, type TrndUpClientConfig, TrndUpNetworkError, TrndUpSDK, YOUTUBE_SCOPES, YouTube };
3065
+ export { Activity, Auth, INSTAGRAM_SCOPES, Insights, Instagram, type RequestOptions, SDK_VERSION, Social, Trends, TrndUpApiError, type TrndUpClientConfig, TrndUpNetworkError, TrndUpSDK, YOUTUBE_SCOPES, YouTube };