@crosspost/types 0.2.0 → 0.2.1
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.cjs +65 -29
- package/dist/index.d.cts +172 -65
- package/dist/index.d.ts +172 -65
- package/dist/index.js +62 -29
- package/package.json +1 -1
- package/src/activity.ts +87 -28
- package/src/response.ts +1 -6
package/dist/index.d.ts
CHANGED
@@ -104,32 +104,17 @@ declare const ResponseMetaSchema: z.ZodObject<{
|
|
104
104
|
reset: number;
|
105
105
|
}>>;
|
106
106
|
pagination: z.ZodOptional<z.ZodObject<{
|
107
|
-
page: z.ZodOptional<z.ZodNumber>;
|
108
|
-
perPage: z.ZodOptional<z.ZodNumber>;
|
109
|
-
total: z.ZodOptional<z.ZodNumber>;
|
110
107
|
limit: z.ZodOptional<z.ZodNumber>;
|
111
108
|
offset: z.ZodOptional<z.ZodNumber>;
|
112
|
-
|
113
|
-
nextCursor: z.ZodOptional<z.ZodString>;
|
114
|
-
prevCursor: z.ZodOptional<z.ZodString>;
|
109
|
+
total: z.ZodOptional<z.ZodNumber>;
|
115
110
|
}, "strip", z.ZodTypeAny, {
|
116
111
|
limit?: number | undefined;
|
117
|
-
page?: number | undefined;
|
118
|
-
perPage?: number | undefined;
|
119
|
-
total?: number | undefined;
|
120
112
|
offset?: number | undefined;
|
121
|
-
|
122
|
-
nextCursor?: string | undefined;
|
123
|
-
prevCursor?: string | undefined;
|
113
|
+
total?: number | undefined;
|
124
114
|
}, {
|
125
115
|
limit?: number | undefined;
|
126
|
-
page?: number | undefined;
|
127
|
-
perPage?: number | undefined;
|
128
|
-
total?: number | undefined;
|
129
116
|
offset?: number | undefined;
|
130
|
-
|
131
|
-
nextCursor?: string | undefined;
|
132
|
-
prevCursor?: string | undefined;
|
117
|
+
total?: number | undefined;
|
133
118
|
}>>;
|
134
119
|
}, "strip", z.ZodTypeAny, {
|
135
120
|
requestId: string;
|
@@ -141,13 +126,8 @@ declare const ResponseMetaSchema: z.ZodObject<{
|
|
141
126
|
} | undefined;
|
142
127
|
pagination?: {
|
143
128
|
limit?: number | undefined;
|
144
|
-
page?: number | undefined;
|
145
|
-
perPage?: number | undefined;
|
146
|
-
total?: number | undefined;
|
147
129
|
offset?: number | undefined;
|
148
|
-
|
149
|
-
nextCursor?: string | undefined;
|
150
|
-
prevCursor?: string | undefined;
|
130
|
+
total?: number | undefined;
|
151
131
|
} | undefined;
|
152
132
|
}, {
|
153
133
|
requestId: string;
|
@@ -159,13 +139,8 @@ declare const ResponseMetaSchema: z.ZodObject<{
|
|
159
139
|
} | undefined;
|
160
140
|
pagination?: {
|
161
141
|
limit?: number | undefined;
|
162
|
-
page?: number | undefined;
|
163
|
-
perPage?: number | undefined;
|
164
|
-
total?: number | undefined;
|
165
142
|
offset?: number | undefined;
|
166
|
-
|
167
|
-
nextCursor?: string | undefined;
|
168
|
-
prevCursor?: string | undefined;
|
143
|
+
total?: number | undefined;
|
169
144
|
} | undefined;
|
170
145
|
}>;
|
171
146
|
declare const SuccessDetailSchema: z.ZodObject<{
|
@@ -2589,6 +2564,15 @@ type AllRateLimitsResponse = z.infer<typeof AllRateLimitsResponseSchema>;
|
|
2589
2564
|
type RateLimitResponse = z.infer<typeof RateLimitResponseSchema>;
|
2590
2565
|
type EndpointRateLimitResponse = z.infer<typeof EndpointRateLimitResponseSchema>;
|
2591
2566
|
|
2567
|
+
declare enum ActivityType {
|
2568
|
+
POST = "post",
|
2569
|
+
REPOST = "repost",
|
2570
|
+
REPLY = "reply",
|
2571
|
+
QUOTE = "quote",
|
2572
|
+
LIKE = "like",
|
2573
|
+
UNLIKE = "unlike",
|
2574
|
+
DELETE = "delete"
|
2575
|
+
}
|
2592
2576
|
declare enum TimePeriod {
|
2593
2577
|
ALL = "all",
|
2594
2578
|
YEARLY = "year",
|
@@ -2596,18 +2580,72 @@ declare enum TimePeriod {
|
|
2596
2580
|
WEEKLY = "week",
|
2597
2581
|
DAILY = "day"
|
2598
2582
|
}
|
2599
|
-
|
2600
|
-
|
2583
|
+
/**
|
2584
|
+
* Schema for filtering by platform, activity type, and timeframe
|
2585
|
+
* Handles comma-separated lists for platforms and types
|
2586
|
+
*/
|
2587
|
+
declare const FilterSchema: z.ZodObject<{
|
2588
|
+
platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
|
2589
|
+
types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
|
2590
|
+
timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
|
2591
|
+
}, "strip", z.ZodTypeAny, {
|
2592
|
+
timeframe: TimePeriod;
|
2593
|
+
platforms?: Platform[] | undefined;
|
2594
|
+
types?: ActivityType[] | undefined;
|
2595
|
+
}, {
|
2596
|
+
platforms?: string | undefined;
|
2597
|
+
types?: string | undefined;
|
2598
|
+
timeframe?: TimePeriod | undefined;
|
2599
|
+
}>;
|
2600
|
+
/**
|
2601
|
+
* Common pagination schema used across queries
|
2602
|
+
*/
|
2603
|
+
declare const PaginationSchema: z.ZodObject<{
|
2601
2604
|
limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2602
2605
|
offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2603
2606
|
}, "strip", z.ZodTypeAny, {
|
2604
2607
|
limit?: number | undefined;
|
2605
2608
|
offset?: number | undefined;
|
2606
|
-
timeframe?: TimePeriod | undefined;
|
2607
2609
|
}, {
|
2608
2610
|
limit?: string | undefined;
|
2609
2611
|
offset?: string | undefined;
|
2610
|
-
|
2612
|
+
}>;
|
2613
|
+
/**
|
2614
|
+
* Query schema for leaderboard endpoints
|
2615
|
+
*/
|
2616
|
+
declare const ActivityLeaderboardQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
|
2617
|
+
filter: z.ZodOptional<z.ZodObject<{
|
2618
|
+
platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
|
2619
|
+
types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
|
2620
|
+
timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
|
2621
|
+
}, "strip", z.ZodTypeAny, {
|
2622
|
+
timeframe: TimePeriod;
|
2623
|
+
platforms?: Platform[] | undefined;
|
2624
|
+
types?: ActivityType[] | undefined;
|
2625
|
+
}, {
|
2626
|
+
platforms?: string | undefined;
|
2627
|
+
types?: string | undefined;
|
2628
|
+
timeframe?: TimePeriod | undefined;
|
2629
|
+
}>>;
|
2630
|
+
}, {
|
2631
|
+
limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2632
|
+
offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2633
|
+
}>, "strip", z.ZodTypeAny, {
|
2634
|
+
filter?: {
|
2635
|
+
timeframe: TimePeriod;
|
2636
|
+
platforms?: Platform[] | undefined;
|
2637
|
+
types?: ActivityType[] | undefined;
|
2638
|
+
} | undefined;
|
2639
|
+
limit?: number | undefined;
|
2640
|
+
offset?: number | undefined;
|
2641
|
+
}, {
|
2642
|
+
filter?: {
|
2643
|
+
platforms?: string | undefined;
|
2644
|
+
types?: string | undefined;
|
2645
|
+
timeframe?: TimePeriod | undefined;
|
2646
|
+
} | undefined;
|
2647
|
+
limit?: string | undefined;
|
2648
|
+
offset?: string | undefined;
|
2611
2649
|
}>;
|
2612
2650
|
declare const AccountActivityEntrySchema: z.ZodObject<{
|
2613
2651
|
signerId: z.ZodString;
|
@@ -2619,6 +2657,7 @@ declare const AccountActivityEntrySchema: z.ZodObject<{
|
|
2619
2657
|
totalScore: z.ZodNumber;
|
2620
2658
|
rank: z.ZodNumber;
|
2621
2659
|
lastActive: z.ZodString;
|
2660
|
+
firstPostTimestamp: z.ZodString;
|
2622
2661
|
}, "strip", z.ZodTypeAny, {
|
2623
2662
|
signerId: string;
|
2624
2663
|
totalPosts: number;
|
@@ -2629,6 +2668,7 @@ declare const AccountActivityEntrySchema: z.ZodObject<{
|
|
2629
2668
|
totalScore: number;
|
2630
2669
|
rank: number;
|
2631
2670
|
lastActive: string;
|
2671
|
+
firstPostTimestamp: string;
|
2632
2672
|
}, {
|
2633
2673
|
signerId: string;
|
2634
2674
|
totalPosts: number;
|
@@ -2639,6 +2679,7 @@ declare const AccountActivityEntrySchema: z.ZodObject<{
|
|
2639
2679
|
totalScore: number;
|
2640
2680
|
rank: number;
|
2641
2681
|
lastActive: string;
|
2682
|
+
firstPostTimestamp: string;
|
2642
2683
|
}>;
|
2643
2684
|
declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
|
2644
2685
|
timeframe: z.ZodNativeEnum<typeof TimePeriod>;
|
@@ -2652,6 +2693,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
|
|
2652
2693
|
totalScore: z.ZodNumber;
|
2653
2694
|
rank: z.ZodNumber;
|
2654
2695
|
lastActive: z.ZodString;
|
2696
|
+
firstPostTimestamp: z.ZodString;
|
2655
2697
|
}, "strip", z.ZodTypeAny, {
|
2656
2698
|
signerId: string;
|
2657
2699
|
totalPosts: number;
|
@@ -2662,6 +2704,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
|
|
2662
2704
|
totalScore: number;
|
2663
2705
|
rank: number;
|
2664
2706
|
lastActive: string;
|
2707
|
+
firstPostTimestamp: string;
|
2665
2708
|
}, {
|
2666
2709
|
signerId: string;
|
2667
2710
|
totalPosts: number;
|
@@ -2672,9 +2715,10 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
|
|
2672
2715
|
totalScore: number;
|
2673
2716
|
rank: number;
|
2674
2717
|
lastActive: string;
|
2718
|
+
firstPostTimestamp: string;
|
2675
2719
|
}>, "many">;
|
2676
2720
|
generatedAt: z.ZodString;
|
2677
|
-
|
2721
|
+
platforms: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>;
|
2678
2722
|
}, "strip", z.ZodTypeAny, {
|
2679
2723
|
entries: {
|
2680
2724
|
signerId: string;
|
@@ -2686,10 +2730,11 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
|
|
2686
2730
|
totalScore: number;
|
2687
2731
|
rank: number;
|
2688
2732
|
lastActive: string;
|
2733
|
+
firstPostTimestamp: string;
|
2689
2734
|
}[];
|
2690
2735
|
timeframe: TimePeriod;
|
2691
2736
|
generatedAt: string;
|
2692
|
-
|
2737
|
+
platforms?: Platform[] | undefined;
|
2693
2738
|
}, {
|
2694
2739
|
entries: {
|
2695
2740
|
signerId: string;
|
@@ -2701,10 +2746,11 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
|
|
2701
2746
|
totalScore: number;
|
2702
2747
|
rank: number;
|
2703
2748
|
lastActive: string;
|
2749
|
+
firstPostTimestamp: string;
|
2704
2750
|
}[];
|
2705
2751
|
timeframe: TimePeriod;
|
2706
2752
|
generatedAt: string;
|
2707
|
-
|
2753
|
+
platforms?: Platform[] | undefined;
|
2708
2754
|
}>;
|
2709
2755
|
declare const AccountActivityParamsSchema: z.ZodObject<{
|
2710
2756
|
signerId: z.ZodString;
|
@@ -2713,12 +2759,42 @@ declare const AccountActivityParamsSchema: z.ZodObject<{
|
|
2713
2759
|
}, {
|
2714
2760
|
signerId: string;
|
2715
2761
|
}>;
|
2716
|
-
|
2717
|
-
|
2718
|
-
|
2719
|
-
|
2762
|
+
/**
|
2763
|
+
* Query schema for account activity endpoints
|
2764
|
+
*/
|
2765
|
+
declare const AccountActivityQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
|
2766
|
+
filter: z.ZodOptional<z.ZodObject<{
|
2767
|
+
platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
|
2768
|
+
types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
|
2769
|
+
timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
|
2770
|
+
}, "strip", z.ZodTypeAny, {
|
2771
|
+
timeframe: TimePeriod;
|
2772
|
+
platforms?: Platform[] | undefined;
|
2773
|
+
types?: ActivityType[] | undefined;
|
2774
|
+
}, {
|
2775
|
+
platforms?: string | undefined;
|
2776
|
+
types?: string | undefined;
|
2777
|
+
timeframe?: TimePeriod | undefined;
|
2778
|
+
}>>;
|
2720
2779
|
}, {
|
2721
|
-
|
2780
|
+
limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2781
|
+
offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2782
|
+
}>, "strip", z.ZodTypeAny, {
|
2783
|
+
filter?: {
|
2784
|
+
timeframe: TimePeriod;
|
2785
|
+
platforms?: Platform[] | undefined;
|
2786
|
+
types?: ActivityType[] | undefined;
|
2787
|
+
} | undefined;
|
2788
|
+
limit?: number | undefined;
|
2789
|
+
offset?: number | undefined;
|
2790
|
+
}, {
|
2791
|
+
filter?: {
|
2792
|
+
platforms?: string | undefined;
|
2793
|
+
types?: string | undefined;
|
2794
|
+
timeframe?: TimePeriod | undefined;
|
2795
|
+
} | undefined;
|
2796
|
+
limit?: string | undefined;
|
2797
|
+
offset?: string | undefined;
|
2722
2798
|
}>;
|
2723
2799
|
declare const PlatformActivitySchema: z.ZodObject<{
|
2724
2800
|
platform: z.ZodNativeEnum<typeof Platform>;
|
@@ -2837,26 +2913,48 @@ declare const AccountPostsParamsSchema: z.ZodObject<{
|
|
2837
2913
|
}, {
|
2838
2914
|
signerId: string;
|
2839
2915
|
}>;
|
2840
|
-
|
2841
|
-
|
2916
|
+
/**
|
2917
|
+
* Query schema for account posts endpoints
|
2918
|
+
*/
|
2919
|
+
declare const AccountPostsQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
|
2920
|
+
filter: z.ZodOptional<z.ZodObject<{
|
2921
|
+
platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
|
2922
|
+
types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
|
2923
|
+
timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
|
2924
|
+
}, "strip", z.ZodTypeAny, {
|
2925
|
+
timeframe: TimePeriod;
|
2926
|
+
platforms?: Platform[] | undefined;
|
2927
|
+
types?: ActivityType[] | undefined;
|
2928
|
+
}, {
|
2929
|
+
platforms?: string | undefined;
|
2930
|
+
types?: string | undefined;
|
2931
|
+
timeframe?: TimePeriod | undefined;
|
2932
|
+
}>>;
|
2933
|
+
}, {
|
2842
2934
|
limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2843
2935
|
offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2936
|
+
}>, "strip", z.ZodTypeAny, {
|
2937
|
+
filter?: {
|
2938
|
+
timeframe: TimePeriod;
|
2939
|
+
platforms?: Platform[] | undefined;
|
2940
|
+
types?: ActivityType[] | undefined;
|
2941
|
+
} | undefined;
|
2848
2942
|
limit?: number | undefined;
|
2849
2943
|
offset?: number | undefined;
|
2850
2944
|
}, {
|
2851
|
-
|
2852
|
-
|
2945
|
+
filter?: {
|
2946
|
+
platforms?: string | undefined;
|
2947
|
+
types?: string | undefined;
|
2948
|
+
timeframe?: TimePeriod | undefined;
|
2949
|
+
} | undefined;
|
2853
2950
|
limit?: string | undefined;
|
2854
2951
|
offset?: string | undefined;
|
2855
2952
|
}>;
|
2856
2953
|
declare const AccountPostSchema: z.ZodObject<{
|
2857
2954
|
id: z.ZodString;
|
2858
2955
|
platform: z.ZodNativeEnum<typeof Platform>;
|
2859
|
-
|
2956
|
+
userId: z.ZodString;
|
2957
|
+
type: z.ZodNativeEnum<typeof ActivityType>;
|
2860
2958
|
content: z.ZodOptional<z.ZodString>;
|
2861
2959
|
url: z.ZodOptional<z.ZodString>;
|
2862
2960
|
createdAt: z.ZodString;
|
@@ -2879,8 +2977,9 @@ declare const AccountPostSchema: z.ZodObject<{
|
|
2879
2977
|
inReplyToId: z.ZodOptional<z.ZodString>;
|
2880
2978
|
quotedPostId: z.ZodOptional<z.ZodString>;
|
2881
2979
|
}, "strip", z.ZodTypeAny, {
|
2882
|
-
type:
|
2980
|
+
type: ActivityType;
|
2883
2981
|
platform: Platform;
|
2982
|
+
userId: string;
|
2884
2983
|
id: string;
|
2885
2984
|
createdAt: string;
|
2886
2985
|
url?: string | undefined;
|
@@ -2894,8 +2993,9 @@ declare const AccountPostSchema: z.ZodObject<{
|
|
2894
2993
|
quotedPostId?: string | undefined;
|
2895
2994
|
content?: string | undefined;
|
2896
2995
|
}, {
|
2897
|
-
type:
|
2996
|
+
type: ActivityType;
|
2898
2997
|
platform: Platform;
|
2998
|
+
userId: string;
|
2899
2999
|
id: string;
|
2900
3000
|
createdAt: string;
|
2901
3001
|
url?: string | undefined;
|
@@ -2914,7 +3014,8 @@ declare const AccountPostsResponseSchema: z.ZodObject<{
|
|
2914
3014
|
posts: z.ZodArray<z.ZodObject<{
|
2915
3015
|
id: z.ZodString;
|
2916
3016
|
platform: z.ZodNativeEnum<typeof Platform>;
|
2917
|
-
|
3017
|
+
userId: z.ZodString;
|
3018
|
+
type: z.ZodNativeEnum<typeof ActivityType>;
|
2918
3019
|
content: z.ZodOptional<z.ZodString>;
|
2919
3020
|
url: z.ZodOptional<z.ZodString>;
|
2920
3021
|
createdAt: z.ZodString;
|
@@ -2937,8 +3038,9 @@ declare const AccountPostsResponseSchema: z.ZodObject<{
|
|
2937
3038
|
inReplyToId: z.ZodOptional<z.ZodString>;
|
2938
3039
|
quotedPostId: z.ZodOptional<z.ZodString>;
|
2939
3040
|
}, "strip", z.ZodTypeAny, {
|
2940
|
-
type:
|
3041
|
+
type: ActivityType;
|
2941
3042
|
platform: Platform;
|
3043
|
+
userId: string;
|
2942
3044
|
id: string;
|
2943
3045
|
createdAt: string;
|
2944
3046
|
url?: string | undefined;
|
@@ -2952,8 +3054,9 @@ declare const AccountPostsResponseSchema: z.ZodObject<{
|
|
2952
3054
|
quotedPostId?: string | undefined;
|
2953
3055
|
content?: string | undefined;
|
2954
3056
|
}, {
|
2955
|
-
type:
|
3057
|
+
type: ActivityType;
|
2956
3058
|
platform: Platform;
|
3059
|
+
userId: string;
|
2957
3060
|
id: string;
|
2958
3061
|
createdAt: string;
|
2959
3062
|
url?: string | undefined;
|
@@ -2967,12 +3070,13 @@ declare const AccountPostsResponseSchema: z.ZodObject<{
|
|
2967
3070
|
quotedPostId?: string | undefined;
|
2968
3071
|
content?: string | undefined;
|
2969
3072
|
}>, "many">;
|
2970
|
-
|
2971
|
-
|
3073
|
+
platforms: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
3074
|
+
types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
2972
3075
|
}, "strip", z.ZodTypeAny, {
|
2973
3076
|
posts: {
|
2974
|
-
type:
|
3077
|
+
type: ActivityType;
|
2975
3078
|
platform: Platform;
|
3079
|
+
userId: string;
|
2976
3080
|
id: string;
|
2977
3081
|
createdAt: string;
|
2978
3082
|
url?: string | undefined;
|
@@ -2987,12 +3091,13 @@ declare const AccountPostsResponseSchema: z.ZodObject<{
|
|
2987
3091
|
content?: string | undefined;
|
2988
3092
|
}[];
|
2989
3093
|
signerId: string;
|
2990
|
-
|
2991
|
-
|
3094
|
+
platforms?: string[] | undefined;
|
3095
|
+
types?: string[] | undefined;
|
2992
3096
|
}, {
|
2993
3097
|
posts: {
|
2994
|
-
type:
|
3098
|
+
type: ActivityType;
|
2995
3099
|
platform: Platform;
|
3100
|
+
userId: string;
|
2996
3101
|
id: string;
|
2997
3102
|
createdAt: string;
|
2998
3103
|
url?: string | undefined;
|
@@ -3007,8 +3112,8 @@ declare const AccountPostsResponseSchema: z.ZodObject<{
|
|
3007
3112
|
content?: string | undefined;
|
3008
3113
|
}[];
|
3009
3114
|
signerId: string;
|
3010
|
-
|
3011
|
-
|
3115
|
+
platforms?: string[] | undefined;
|
3116
|
+
types?: string[] | undefined;
|
3012
3117
|
}>;
|
3013
3118
|
/**
|
3014
3119
|
* Interface for account activity Response
|
@@ -3033,6 +3138,7 @@ interface PostRecord {
|
|
3033
3138
|
p: string;
|
3034
3139
|
t: number;
|
3035
3140
|
u: string;
|
3141
|
+
ty: string;
|
3036
3142
|
}
|
3037
3143
|
type ActivityLeaderboardQuery = z.infer<typeof ActivityLeaderboardQuerySchema>;
|
3038
3144
|
type AccountActivityEntry = z.infer<typeof AccountActivityEntrySchema>;
|
@@ -3045,6 +3151,7 @@ type AccountPostsParams = z.infer<typeof AccountPostsParamsSchema>;
|
|
3045
3151
|
type AccountPostsQuery = z.infer<typeof AccountPostsQuerySchema>;
|
3046
3152
|
type AccountPost = z.infer<typeof AccountPostSchema>;
|
3047
3153
|
type AccountPostsResponse = z.infer<typeof AccountPostsResponseSchema>;
|
3154
|
+
type Filter = z.infer<typeof FilterSchema>;
|
3048
3155
|
|
3049
3156
|
declare const UserProfileSchema: z.ZodObject<{
|
3050
3157
|
userId: z.ZodString;
|
@@ -3121,4 +3228,4 @@ declare const ProfileRefreshResponseSchema: z.ZodObject<{
|
|
3121
3228
|
type UserProfile = z.infer<typeof UserProfileSchema>;
|
3122
3229
|
type ProfileRefreshResponse = z.infer<typeof ProfileRefreshResponseSchema>;
|
3123
3230
|
|
3124
|
-
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatus, type AuthStatusParams, AuthStatusParamsSchema, type AuthStatusResponse, AuthStatusResponseSchema, AuthStatusSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type HealthStatus, HealthStatusSchema, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type MultiStatusSummary, MultiStatusSummarySchema, type NearAuthorizationRequest, NearAuthorizationRequestSchema, type NearAuthorizationResponse, NearAuthorizationResponseSchema, type NearAuthorizationStatusResponse, NearAuthorizationStatusResponseSchema, type NearUnauthorizationResponse, NearUnauthorizationResponseSchema, Platform, type PlatformAccountActivity, type PlatformActivity, PlatformActivitySchema, type PlatformName, type PlatformParam, PlatformParamSchema, type PlatformRateLimit, PlatformRateLimitSchema, PlatformSchema, type Post, type PostContent, PostContentSchema, type PostMetrics, PostMetricsSchema, type PostRecord, PostResponseSchema, type PostResult, PostResultSchema, PostSchema, type PostToDelete, PostToDeleteSchema, type ProfileRefreshResponse, ProfileRefreshResponseSchema, type QuotePostRequest, QuotePostRequestSchema, type QuotePostResponse, QuotePostResponseSchema, type RateLimitEndpoint, type RateLimitEndpointParam, RateLimitEndpointParamSchema, RateLimitEndpointSchema, type RateLimitResponse, RateLimitResponseSchema, type RateLimitStatus, type RateLimitStatusResponse, RateLimitStatusResponseSchema, RateLimitStatusSchema, type ReplyToPostRequest, ReplyToPostRequestSchema, type ReplyToPostResponse, ReplyToPostResponseSchema, type RepostRequest, RepostRequestSchema, type RepostResponse, RepostResponseSchema, type ResponseMeta, ResponseMetaSchema, SUPPORTED_PLATFORMS, type SuccessDetail, SuccessDetailSchema, type SupportedPlatformName, SupportedPlatformSchema, type Target, TargetSchema, TimePeriod, type UnlikePostRequest, UnlikePostRequestSchema, type UnlikePostResponse, UnlikePostResponseSchema, type UsageRateLimit, UsageRateLimitSchema, type UserProfile, UserProfileSchema, errorCodeToStatusCode, isPlatformSupported };
|
3231
|
+
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, ActivityType, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatus, type AuthStatusParams, AuthStatusParamsSchema, type AuthStatusResponse, AuthStatusResponseSchema, AuthStatusSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type Filter, FilterSchema, type HealthStatus, HealthStatusSchema, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type MultiStatusSummary, MultiStatusSummarySchema, type NearAuthorizationRequest, NearAuthorizationRequestSchema, type NearAuthorizationResponse, NearAuthorizationResponseSchema, type NearAuthorizationStatusResponse, NearAuthorizationStatusResponseSchema, type NearUnauthorizationResponse, NearUnauthorizationResponseSchema, PaginationSchema, Platform, type PlatformAccountActivity, type PlatformActivity, PlatformActivitySchema, type PlatformName, type PlatformParam, PlatformParamSchema, type PlatformRateLimit, PlatformRateLimitSchema, PlatformSchema, type Post, type PostContent, PostContentSchema, type PostMetrics, PostMetricsSchema, type PostRecord, PostResponseSchema, type PostResult, PostResultSchema, PostSchema, type PostToDelete, PostToDeleteSchema, type ProfileRefreshResponse, ProfileRefreshResponseSchema, type QuotePostRequest, QuotePostRequestSchema, type QuotePostResponse, QuotePostResponseSchema, type RateLimitEndpoint, type RateLimitEndpointParam, RateLimitEndpointParamSchema, RateLimitEndpointSchema, type RateLimitResponse, RateLimitResponseSchema, type RateLimitStatus, type RateLimitStatusResponse, RateLimitStatusResponseSchema, RateLimitStatusSchema, type ReplyToPostRequest, ReplyToPostRequestSchema, type ReplyToPostResponse, ReplyToPostResponseSchema, type RepostRequest, RepostRequestSchema, type RepostResponse, RepostResponseSchema, type ResponseMeta, ResponseMetaSchema, SUPPORTED_PLATFORMS, type SuccessDetail, SuccessDetailSchema, type SupportedPlatformName, SupportedPlatformSchema, type Target, TargetSchema, TimePeriod, type UnlikePostRequest, UnlikePostRequestSchema, type UnlikePostResponse, UnlikePostResponseSchema, type UsageRateLimit, UsageRateLimitSchema, type UserProfile, UserProfileSchema, errorCodeToStatusCode, isPlatformSupported };
|
package/dist/index.js
CHANGED
@@ -88,14 +88,9 @@ var ResponseMetaSchema = z3.object({
|
|
88
88
|
reset: z3.number().int().positive().describe("Unix timestamp (seconds)")
|
89
89
|
}).optional().describe("Rate limit information if applicable"),
|
90
90
|
pagination: z3.object({
|
91
|
-
page: z3.number().int().positive().optional(),
|
92
|
-
perPage: z3.number().int().positive().optional(),
|
93
|
-
total: z3.number().int().nonnegative().optional(),
|
94
91
|
limit: z3.number().int().nonnegative().optional(),
|
95
92
|
offset: z3.number().int().nonnegative().optional(),
|
96
|
-
|
97
|
-
nextCursor: z3.string().optional(),
|
98
|
-
prevCursor: z3.string().optional()
|
93
|
+
total: z3.number().int().nonnegative().optional()
|
99
94
|
}).optional().describe("Pagination information if applicable")
|
100
95
|
});
|
101
96
|
var SuccessDetailSchema = z3.object({
|
@@ -434,6 +429,16 @@ var EndpointRateLimitResponseSchema = z7.object({
|
|
434
429
|
|
435
430
|
// src/activity.ts
|
436
431
|
import { z as z8 } from "zod";
|
432
|
+
var ActivityType = /* @__PURE__ */ ((ActivityType2) => {
|
433
|
+
ActivityType2["POST"] = "post";
|
434
|
+
ActivityType2["REPOST"] = "repost";
|
435
|
+
ActivityType2["REPLY"] = "reply";
|
436
|
+
ActivityType2["QUOTE"] = "quote";
|
437
|
+
ActivityType2["LIKE"] = "like";
|
438
|
+
ActivityType2["UNLIKE"] = "unlike";
|
439
|
+
ActivityType2["DELETE"] = "delete";
|
440
|
+
return ActivityType2;
|
441
|
+
})(ActivityType || {});
|
437
442
|
var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
|
438
443
|
TimePeriod2["ALL"] = "all";
|
439
444
|
TimePeriod2["YEARLY"] = "year";
|
@@ -442,13 +447,45 @@ var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
|
|
442
447
|
TimePeriod2["DAILY"] = "day";
|
443
448
|
return TimePeriod2;
|
444
449
|
})(TimePeriod || {});
|
445
|
-
var
|
446
|
-
|
447
|
-
|
448
|
-
|
450
|
+
var FilterSchema = z8.object({
|
451
|
+
platforms: z8.string().optional().transform((val) => {
|
452
|
+
if (!val) return void 0;
|
453
|
+
return val.split(",").map((p) => p.trim()).map((p) => {
|
454
|
+
try {
|
455
|
+
return Platform[p.toUpperCase()];
|
456
|
+
} catch (_e) {
|
457
|
+
return p;
|
458
|
+
}
|
459
|
+
});
|
460
|
+
}).pipe(
|
461
|
+
z8.array(z8.nativeEnum(Platform)).optional()
|
462
|
+
).describe("Filter by platforms (comma-separated list, optional)"),
|
463
|
+
types: z8.string().optional().transform((val) => {
|
464
|
+
if (!val) return void 0;
|
465
|
+
return val.split(",").map((t) => t.trim()).map((t) => {
|
466
|
+
try {
|
467
|
+
return ActivityType[t.toUpperCase()];
|
468
|
+
} catch (_e) {
|
469
|
+
return t;
|
470
|
+
}
|
471
|
+
});
|
472
|
+
}).pipe(
|
473
|
+
z8.array(z8.nativeEnum(ActivityType)).optional()
|
474
|
+
).describe("Filter by activity types (comma-separated list, optional)"),
|
475
|
+
timeframe: z8.nativeEnum(TimePeriod).optional().transform((val) => {
|
476
|
+
if (!val) return "all" /* ALL */;
|
477
|
+
return val;
|
478
|
+
}).describe(
|
479
|
+
"Timeframe for filtering (optional)"
|
480
|
+
)
|
481
|
+
}).describe("Filter parameters");
|
482
|
+
var PaginationSchema = z8.object({
|
449
483
|
limit: z8.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z8.number().min(1).max(100).optional()).describe("Maximum number of results to return (1-100)"),
|
450
484
|
offset: z8.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z8.number().min(0).optional()).describe("Offset for pagination")
|
451
|
-
}).describe("
|
485
|
+
}).describe("Pagination parameters");
|
486
|
+
var ActivityLeaderboardQuerySchema = z8.object({
|
487
|
+
filter: FilterSchema.optional()
|
488
|
+
}).describe("Account leaderboard query").merge(PaginationSchema);
|
452
489
|
var AccountActivityEntrySchema = z8.object({
|
453
490
|
signerId: z8.string().describe("NEAR account ID"),
|
454
491
|
totalPosts: z8.number().describe("Total number of posts"),
|
@@ -458,22 +495,21 @@ var AccountActivityEntrySchema = z8.object({
|
|
458
495
|
totalQuotes: z8.number().describe("Total number of quote posts"),
|
459
496
|
totalScore: z8.number().describe("Total activity score"),
|
460
497
|
rank: z8.number().describe("Rank on the leaderboard"),
|
461
|
-
lastActive: z8.string().datetime().describe("Timestamp of last activity")
|
498
|
+
lastActive: z8.string().datetime().describe("Timestamp of last activity"),
|
499
|
+
firstPostTimestamp: z8.string().datetime().describe("Timestamp of the first post")
|
462
500
|
}).describe("Account activity entry");
|
463
501
|
var ActivityLeaderboardResponseSchema = z8.object({
|
464
502
|
timeframe: z8.nativeEnum(TimePeriod).describe("Timeframe for the leaderboard"),
|
465
503
|
entries: z8.array(AccountActivityEntrySchema).describe("Leaderboard entries"),
|
466
504
|
generatedAt: z8.string().datetime().describe("Timestamp when the leaderboard was generated"),
|
467
|
-
|
505
|
+
platforms: z8.array(PlatformSchema).optional().describe("Platform filters (if applied)")
|
468
506
|
});
|
469
507
|
var AccountActivityParamsSchema = z8.object({
|
470
508
|
signerId: z8.string().describe("NEAR account ID")
|
471
509
|
}).describe("Account activity params");
|
472
510
|
var AccountActivityQuerySchema = z8.object({
|
473
|
-
|
474
|
-
|
475
|
-
)
|
476
|
-
}).describe("Account activity query");
|
511
|
+
filter: FilterSchema.optional()
|
512
|
+
}).describe("Account activity query").merge(PaginationSchema);
|
477
513
|
var PlatformActivitySchema = z8.object({
|
478
514
|
platform: PlatformSchema,
|
479
515
|
posts: z8.number().describe("Number of posts on this platform"),
|
@@ -501,17 +537,13 @@ var AccountPostsParamsSchema = z8.object({
|
|
501
537
|
signerId: z8.string().describe("NEAR account ID")
|
502
538
|
}).describe("Account posts params");
|
503
539
|
var AccountPostsQuerySchema = z8.object({
|
504
|
-
|
505
|
-
|
506
|
-
offset: z8.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z8.number().min(0).optional()).describe("Offset for pagination"),
|
507
|
-
type: z8.enum(["post", "repost", "reply", "quote", "like", "all"]).optional().describe(
|
508
|
-
"Filter by post type (optional)"
|
509
|
-
)
|
510
|
-
}).describe("Account posts query");
|
540
|
+
filter: FilterSchema.optional()
|
541
|
+
}).describe("Account posts query").merge(PaginationSchema);
|
511
542
|
var AccountPostSchema = z8.object({
|
512
543
|
id: z8.string().describe("Post ID"),
|
513
544
|
platform: PlatformSchema,
|
514
|
-
|
545
|
+
userId: z8.string().describe("User ID on the platform"),
|
546
|
+
type: z8.nativeEnum(ActivityType).describe("Type of post"),
|
515
547
|
content: z8.string().optional().describe("Post content (if available)"),
|
516
548
|
url: z8.string().url().optional().describe("URL to the post on the platform (if available)"),
|
517
549
|
createdAt: z8.string().datetime().describe("Timestamp when the post was created"),
|
@@ -527,10 +559,8 @@ var AccountPostSchema = z8.object({
|
|
527
559
|
var AccountPostsResponseSchema = z8.object({
|
528
560
|
signerId: z8.string().describe("NEAR account ID"),
|
529
561
|
posts: z8.array(AccountPostSchema).describe("List of posts"),
|
530
|
-
|
531
|
-
|
532
|
-
"Post type filter (if applied)"
|
533
|
-
)
|
562
|
+
platforms: z8.array(z8.string()).optional().describe("Platform filters (if applied)"),
|
563
|
+
types: z8.array(z8.string()).optional().describe("Post type filters (if applied)")
|
534
564
|
});
|
535
565
|
export {
|
536
566
|
AccountActivityEntrySchema,
|
@@ -540,6 +570,7 @@ export {
|
|
540
570
|
AccountPostsParamsSchema,
|
541
571
|
AccountPostsQuerySchema,
|
542
572
|
ActivityLeaderboardQuerySchema,
|
573
|
+
ActivityType,
|
543
574
|
AllRateLimitsResponseSchema,
|
544
575
|
ApiErrorCode,
|
545
576
|
ApiErrorCodeSchema,
|
@@ -561,6 +592,7 @@ export {
|
|
561
592
|
DeleteResultSchema,
|
562
593
|
EndpointRateLimitResponseSchema,
|
563
594
|
ErrorDetailSchema,
|
595
|
+
FilterSchema,
|
564
596
|
HealthStatusSchema,
|
565
597
|
LikePostRequestSchema,
|
566
598
|
LikePostResponseSchema,
|
@@ -573,6 +605,7 @@ export {
|
|
573
605
|
NearAuthorizationResponseSchema,
|
574
606
|
NearAuthorizationStatusResponseSchema,
|
575
607
|
NearUnauthorizationResponseSchema,
|
608
|
+
PaginationSchema,
|
576
609
|
Platform,
|
577
610
|
PlatformActivitySchema,
|
578
611
|
PlatformParamSchema,
|