@crosspost/types 0.2.9 → 0.2.11

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 CHANGED
@@ -555,6 +555,7 @@ var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
555
555
  TimePeriod2["MONTHLY"] = "month";
556
556
  TimePeriod2["WEEKLY"] = "week";
557
557
  TimePeriod2["DAILY"] = "day";
558
+ TimePeriod2["CUSTOM"] = "custom";
558
559
  return TimePeriod2;
559
560
  })(TimePeriod || {});
560
561
  var FilterSchema = import_zod8.z.object({
@@ -582,20 +583,19 @@ var FilterSchema = import_zod8.z.object({
582
583
  }).pipe(
583
584
  import_zod8.z.array(import_zod8.z.nativeEnum(ActivityType)).optional()
584
585
  ).describe("Filter by activity types (comma-separated list, optional)"),
585
- timeframe: import_zod8.z.nativeEnum(TimePeriod).optional().transform((val) => {
586
- if (!val) return "all" /* ALL */;
587
- return val;
588
- }).describe(
586
+ timeframe: import_zod8.z.nativeEnum(TimePeriod).optional().describe(
589
587
  "Timeframe for filtering (optional)"
590
- )
588
+ ),
589
+ startDate: import_zod8.z.string().datetime().optional().describe("Start date for custom timeframe (ISO 8601 format, optional - defaults to beginning when timeframe=custom)"),
590
+ endDate: import_zod8.z.string().datetime().optional().describe("End date for custom timeframe (ISO 8601 format, optional - defaults to now when timeframe=custom)")
591
591
  }).describe("Filter parameters");
592
592
  var PaginationSchema = import_zod8.z.object({
593
593
  limit: import_zod8.z.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(import_zod8.z.number().min(1).max(100).optional()).describe("Maximum number of results to return (1-100)"),
594
594
  offset: import_zod8.z.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(import_zod8.z.number().min(0).optional()).describe("Offset for pagination")
595
595
  }).describe("Pagination parameters");
596
- var ActivityLeaderboardQuerySchema = import_zod8.z.object({
597
- filter: FilterSchema.optional()
598
- }).describe("Account leaderboard query").merge(PaginationSchema);
596
+ var ActivityLeaderboardQuerySchema = FilterSchema.merge(PaginationSchema).describe(
597
+ "Account leaderboard query"
598
+ );
599
599
  var AccountActivityEntrySchema = import_zod8.z.object({
600
600
  signerId: import_zod8.z.string().describe("NEAR account ID"),
601
601
  totalPosts: import_zod8.z.number().describe("Total number of posts"),
@@ -617,9 +617,9 @@ var ActivityLeaderboardResponseSchema = import_zod8.z.object({
617
617
  var AccountActivityParamsSchema = import_zod8.z.object({
618
618
  signerId: import_zod8.z.string().describe("NEAR account ID")
619
619
  }).describe("Account activity params");
620
- var AccountActivityQuerySchema = import_zod8.z.object({
621
- filter: FilterSchema.optional()
622
- }).describe("Account activity query").merge(PaginationSchema);
620
+ var AccountActivityQuerySchema = FilterSchema.merge(PaginationSchema).describe(
621
+ "Account activity query"
622
+ );
623
623
  var PlatformActivitySchema = import_zod8.z.object({
624
624
  platform: PlatformSchema,
625
625
  posts: import_zod8.z.number().describe("Number of posts on this platform"),
@@ -646,9 +646,9 @@ var AccountActivityResponseSchema = import_zod8.z.object({
646
646
  var AccountPostsParamsSchema = import_zod8.z.object({
647
647
  signerId: import_zod8.z.string().describe("NEAR account ID")
648
648
  }).describe("Account posts params");
649
- var AccountPostsQuerySchema = import_zod8.z.object({
650
- filter: FilterSchema.optional()
651
- }).describe("Account posts query").merge(PaginationSchema);
649
+ var AccountPostsQuerySchema = FilterSchema.merge(PaginationSchema).describe(
650
+ "Account posts query"
651
+ );
652
652
  var AccountPostSchema = import_zod8.z.object({
653
653
  id: import_zod8.z.string().describe("Post ID"),
654
654
  platform: PlatformSchema,
package/dist/index.d.cts CHANGED
@@ -2708,7 +2708,8 @@ declare enum TimePeriod {
2708
2708
  YEARLY = "year",
2709
2709
  MONTHLY = "month",
2710
2710
  WEEKLY = "week",
2711
- DAILY = "day"
2711
+ DAILY = "day",
2712
+ CUSTOM = "custom"
2712
2713
  }
2713
2714
  /**
2714
2715
  * Schema for filtering by platform, activity type, and timeframe
@@ -2717,15 +2718,21 @@ declare enum TimePeriod {
2717
2718
  declare const FilterSchema: z.ZodObject<{
2718
2719
  platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2719
2720
  types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2720
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
2721
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
2722
+ startDate: z.ZodOptional<z.ZodString>;
2723
+ endDate: z.ZodOptional<z.ZodString>;
2721
2724
  }, "strip", z.ZodTypeAny, {
2722
- timeframe: TimePeriod;
2723
2725
  platforms?: Platform[] | undefined;
2724
2726
  types?: ActivityType[] | undefined;
2727
+ timeframe?: TimePeriod | undefined;
2728
+ startDate?: string | undefined;
2729
+ endDate?: string | undefined;
2725
2730
  }, {
2726
2731
  platforms?: string | undefined;
2727
2732
  types?: string | undefined;
2728
2733
  timeframe?: TimePeriod | undefined;
2734
+ startDate?: string | undefined;
2735
+ endDate?: string | undefined;
2729
2736
  }>;
2730
2737
  /**
2731
2738
  * Common pagination schema used across queries
@@ -2744,38 +2751,30 @@ declare const PaginationSchema: z.ZodObject<{
2744
2751
  * Query schema for leaderboard endpoints
2745
2752
  */
2746
2753
  declare const ActivityLeaderboardQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
2747
- filter: z.ZodOptional<z.ZodObject<{
2748
- platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2749
- types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2750
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
2751
- }, "strip", z.ZodTypeAny, {
2752
- timeframe: TimePeriod;
2753
- platforms?: Platform[] | undefined;
2754
- types?: ActivityType[] | undefined;
2755
- }, {
2756
- platforms?: string | undefined;
2757
- types?: string | undefined;
2758
- timeframe?: TimePeriod | undefined;
2759
- }>>;
2754
+ platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2755
+ types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2756
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
2757
+ startDate: z.ZodOptional<z.ZodString>;
2758
+ endDate: z.ZodOptional<z.ZodString>;
2760
2759
  }, {
2761
2760
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2762
2761
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2763
2762
  }>, "strip", z.ZodTypeAny, {
2764
- filter?: {
2765
- timeframe: TimePeriod;
2766
- platforms?: Platform[] | undefined;
2767
- types?: ActivityType[] | undefined;
2768
- } | undefined;
2769
2763
  limit?: number | undefined;
2770
2764
  offset?: number | undefined;
2765
+ platforms?: Platform[] | undefined;
2766
+ types?: ActivityType[] | undefined;
2767
+ timeframe?: TimePeriod | undefined;
2768
+ startDate?: string | undefined;
2769
+ endDate?: string | undefined;
2771
2770
  }, {
2772
- filter?: {
2773
- platforms?: string | undefined;
2774
- types?: string | undefined;
2775
- timeframe?: TimePeriod | undefined;
2776
- } | undefined;
2777
2771
  limit?: string | undefined;
2778
2772
  offset?: string | undefined;
2773
+ platforms?: string | undefined;
2774
+ types?: string | undefined;
2775
+ timeframe?: TimePeriod | undefined;
2776
+ startDate?: string | undefined;
2777
+ endDate?: string | undefined;
2779
2778
  }>;
2780
2779
  declare const AccountActivityEntrySchema: z.ZodObject<{
2781
2780
  signerId: z.ZodString;
@@ -2893,38 +2892,30 @@ declare const AccountActivityParamsSchema: z.ZodObject<{
2893
2892
  * Query schema for account activity endpoints
2894
2893
  */
2895
2894
  declare const AccountActivityQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
2896
- filter: z.ZodOptional<z.ZodObject<{
2897
- platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2898
- types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2899
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
2900
- }, "strip", z.ZodTypeAny, {
2901
- timeframe: TimePeriod;
2902
- platforms?: Platform[] | undefined;
2903
- types?: ActivityType[] | undefined;
2904
- }, {
2905
- platforms?: string | undefined;
2906
- types?: string | undefined;
2907
- timeframe?: TimePeriod | undefined;
2908
- }>>;
2895
+ platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2896
+ types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2897
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
2898
+ startDate: z.ZodOptional<z.ZodString>;
2899
+ endDate: z.ZodOptional<z.ZodString>;
2909
2900
  }, {
2910
2901
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2911
2902
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2912
2903
  }>, "strip", z.ZodTypeAny, {
2913
- filter?: {
2914
- timeframe: TimePeriod;
2915
- platforms?: Platform[] | undefined;
2916
- types?: ActivityType[] | undefined;
2917
- } | undefined;
2918
2904
  limit?: number | undefined;
2919
2905
  offset?: number | undefined;
2906
+ platforms?: Platform[] | undefined;
2907
+ types?: ActivityType[] | undefined;
2908
+ timeframe?: TimePeriod | undefined;
2909
+ startDate?: string | undefined;
2910
+ endDate?: string | undefined;
2920
2911
  }, {
2921
- filter?: {
2922
- platforms?: string | undefined;
2923
- types?: string | undefined;
2924
- timeframe?: TimePeriod | undefined;
2925
- } | undefined;
2926
2912
  limit?: string | undefined;
2927
2913
  offset?: string | undefined;
2914
+ platforms?: string | undefined;
2915
+ types?: string | undefined;
2916
+ timeframe?: TimePeriod | undefined;
2917
+ startDate?: string | undefined;
2918
+ endDate?: string | undefined;
2928
2919
  }>;
2929
2920
  declare const PlatformActivitySchema: z.ZodObject<{
2930
2921
  platform: z.ZodNativeEnum<typeof Platform>;
@@ -3047,38 +3038,30 @@ declare const AccountPostsParamsSchema: z.ZodObject<{
3047
3038
  * Query schema for account posts endpoints
3048
3039
  */
3049
3040
  declare const AccountPostsQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
3050
- filter: z.ZodOptional<z.ZodObject<{
3051
- platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
3052
- types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
3053
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
3054
- }, "strip", z.ZodTypeAny, {
3055
- timeframe: TimePeriod;
3056
- platforms?: Platform[] | undefined;
3057
- types?: ActivityType[] | undefined;
3058
- }, {
3059
- platforms?: string | undefined;
3060
- types?: string | undefined;
3061
- timeframe?: TimePeriod | undefined;
3062
- }>>;
3041
+ platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
3042
+ types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
3043
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
3044
+ startDate: z.ZodOptional<z.ZodString>;
3045
+ endDate: z.ZodOptional<z.ZodString>;
3063
3046
  }, {
3064
3047
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
3065
3048
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
3066
3049
  }>, "strip", z.ZodTypeAny, {
3067
- filter?: {
3068
- timeframe: TimePeriod;
3069
- platforms?: Platform[] | undefined;
3070
- types?: ActivityType[] | undefined;
3071
- } | undefined;
3072
3050
  limit?: number | undefined;
3073
3051
  offset?: number | undefined;
3052
+ platforms?: Platform[] | undefined;
3053
+ types?: ActivityType[] | undefined;
3054
+ timeframe?: TimePeriod | undefined;
3055
+ startDate?: string | undefined;
3056
+ endDate?: string | undefined;
3074
3057
  }, {
3075
- filter?: {
3076
- platforms?: string | undefined;
3077
- types?: string | undefined;
3078
- timeframe?: TimePeriod | undefined;
3079
- } | undefined;
3080
3058
  limit?: string | undefined;
3081
3059
  offset?: string | undefined;
3060
+ platforms?: string | undefined;
3061
+ types?: string | undefined;
3062
+ timeframe?: TimePeriod | undefined;
3063
+ startDate?: string | undefined;
3064
+ endDate?: string | undefined;
3082
3065
  }>;
3083
3066
  declare const AccountPostSchema: z.ZodObject<{
3084
3067
  id: z.ZodString;
package/dist/index.d.ts CHANGED
@@ -2708,7 +2708,8 @@ declare enum TimePeriod {
2708
2708
  YEARLY = "year",
2709
2709
  MONTHLY = "month",
2710
2710
  WEEKLY = "week",
2711
- DAILY = "day"
2711
+ DAILY = "day",
2712
+ CUSTOM = "custom"
2712
2713
  }
2713
2714
  /**
2714
2715
  * Schema for filtering by platform, activity type, and timeframe
@@ -2717,15 +2718,21 @@ declare enum TimePeriod {
2717
2718
  declare const FilterSchema: z.ZodObject<{
2718
2719
  platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2719
2720
  types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2720
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
2721
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
2722
+ startDate: z.ZodOptional<z.ZodString>;
2723
+ endDate: z.ZodOptional<z.ZodString>;
2721
2724
  }, "strip", z.ZodTypeAny, {
2722
- timeframe: TimePeriod;
2723
2725
  platforms?: Platform[] | undefined;
2724
2726
  types?: ActivityType[] | undefined;
2727
+ timeframe?: TimePeriod | undefined;
2728
+ startDate?: string | undefined;
2729
+ endDate?: string | undefined;
2725
2730
  }, {
2726
2731
  platforms?: string | undefined;
2727
2732
  types?: string | undefined;
2728
2733
  timeframe?: TimePeriod | undefined;
2734
+ startDate?: string | undefined;
2735
+ endDate?: string | undefined;
2729
2736
  }>;
2730
2737
  /**
2731
2738
  * Common pagination schema used across queries
@@ -2744,38 +2751,30 @@ declare const PaginationSchema: z.ZodObject<{
2744
2751
  * Query schema for leaderboard endpoints
2745
2752
  */
2746
2753
  declare const ActivityLeaderboardQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
2747
- filter: z.ZodOptional<z.ZodObject<{
2748
- platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2749
- types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2750
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
2751
- }, "strip", z.ZodTypeAny, {
2752
- timeframe: TimePeriod;
2753
- platforms?: Platform[] | undefined;
2754
- types?: ActivityType[] | undefined;
2755
- }, {
2756
- platforms?: string | undefined;
2757
- types?: string | undefined;
2758
- timeframe?: TimePeriod | undefined;
2759
- }>>;
2754
+ platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2755
+ types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2756
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
2757
+ startDate: z.ZodOptional<z.ZodString>;
2758
+ endDate: z.ZodOptional<z.ZodString>;
2760
2759
  }, {
2761
2760
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2762
2761
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2763
2762
  }>, "strip", z.ZodTypeAny, {
2764
- filter?: {
2765
- timeframe: TimePeriod;
2766
- platforms?: Platform[] | undefined;
2767
- types?: ActivityType[] | undefined;
2768
- } | undefined;
2769
2763
  limit?: number | undefined;
2770
2764
  offset?: number | undefined;
2765
+ platforms?: Platform[] | undefined;
2766
+ types?: ActivityType[] | undefined;
2767
+ timeframe?: TimePeriod | undefined;
2768
+ startDate?: string | undefined;
2769
+ endDate?: string | undefined;
2771
2770
  }, {
2772
- filter?: {
2773
- platforms?: string | undefined;
2774
- types?: string | undefined;
2775
- timeframe?: TimePeriod | undefined;
2776
- } | undefined;
2777
2771
  limit?: string | undefined;
2778
2772
  offset?: string | undefined;
2773
+ platforms?: string | undefined;
2774
+ types?: string | undefined;
2775
+ timeframe?: TimePeriod | undefined;
2776
+ startDate?: string | undefined;
2777
+ endDate?: string | undefined;
2779
2778
  }>;
2780
2779
  declare const AccountActivityEntrySchema: z.ZodObject<{
2781
2780
  signerId: z.ZodString;
@@ -2893,38 +2892,30 @@ declare const AccountActivityParamsSchema: z.ZodObject<{
2893
2892
  * Query schema for account activity endpoints
2894
2893
  */
2895
2894
  declare const AccountActivityQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
2896
- filter: z.ZodOptional<z.ZodObject<{
2897
- platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2898
- types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2899
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
2900
- }, "strip", z.ZodTypeAny, {
2901
- timeframe: TimePeriod;
2902
- platforms?: Platform[] | undefined;
2903
- types?: ActivityType[] | undefined;
2904
- }, {
2905
- platforms?: string | undefined;
2906
- types?: string | undefined;
2907
- timeframe?: TimePeriod | undefined;
2908
- }>>;
2895
+ platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
2896
+ types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
2897
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
2898
+ startDate: z.ZodOptional<z.ZodString>;
2899
+ endDate: z.ZodOptional<z.ZodString>;
2909
2900
  }, {
2910
2901
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2911
2902
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
2912
2903
  }>, "strip", z.ZodTypeAny, {
2913
- filter?: {
2914
- timeframe: TimePeriod;
2915
- platforms?: Platform[] | undefined;
2916
- types?: ActivityType[] | undefined;
2917
- } | undefined;
2918
2904
  limit?: number | undefined;
2919
2905
  offset?: number | undefined;
2906
+ platforms?: Platform[] | undefined;
2907
+ types?: ActivityType[] | undefined;
2908
+ timeframe?: TimePeriod | undefined;
2909
+ startDate?: string | undefined;
2910
+ endDate?: string | undefined;
2920
2911
  }, {
2921
- filter?: {
2922
- platforms?: string | undefined;
2923
- types?: string | undefined;
2924
- timeframe?: TimePeriod | undefined;
2925
- } | undefined;
2926
2912
  limit?: string | undefined;
2927
2913
  offset?: string | undefined;
2914
+ platforms?: string | undefined;
2915
+ types?: string | undefined;
2916
+ timeframe?: TimePeriod | undefined;
2917
+ startDate?: string | undefined;
2918
+ endDate?: string | undefined;
2928
2919
  }>;
2929
2920
  declare const PlatformActivitySchema: z.ZodObject<{
2930
2921
  platform: z.ZodNativeEnum<typeof Platform>;
@@ -3047,38 +3038,30 @@ declare const AccountPostsParamsSchema: z.ZodObject<{
3047
3038
  * Query schema for account posts endpoints
3048
3039
  */
3049
3040
  declare const AccountPostsQuerySchema: z.ZodObject<z.objectUtil.extendShape<{
3050
- filter: z.ZodOptional<z.ZodObject<{
3051
- platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
3052
- types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
3053
- timeframe: z.ZodEffects<z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>, TimePeriod, TimePeriod | undefined>;
3054
- }, "strip", z.ZodTypeAny, {
3055
- timeframe: TimePeriod;
3056
- platforms?: Platform[] | undefined;
3057
- types?: ActivityType[] | undefined;
3058
- }, {
3059
- platforms?: string | undefined;
3060
- types?: string | undefined;
3061
- timeframe?: TimePeriod | undefined;
3062
- }>>;
3041
+ platforms: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Platform>, "many">>>;
3042
+ types: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof ActivityType>, "many">>>;
3043
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
3044
+ startDate: z.ZodOptional<z.ZodString>;
3045
+ endDate: z.ZodOptional<z.ZodString>;
3063
3046
  }, {
3064
3047
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
3065
3048
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
3066
3049
  }>, "strip", z.ZodTypeAny, {
3067
- filter?: {
3068
- timeframe: TimePeriod;
3069
- platforms?: Platform[] | undefined;
3070
- types?: ActivityType[] | undefined;
3071
- } | undefined;
3072
3050
  limit?: number | undefined;
3073
3051
  offset?: number | undefined;
3052
+ platforms?: Platform[] | undefined;
3053
+ types?: ActivityType[] | undefined;
3054
+ timeframe?: TimePeriod | undefined;
3055
+ startDate?: string | undefined;
3056
+ endDate?: string | undefined;
3074
3057
  }, {
3075
- filter?: {
3076
- platforms?: string | undefined;
3077
- types?: string | undefined;
3078
- timeframe?: TimePeriod | undefined;
3079
- } | undefined;
3080
3058
  limit?: string | undefined;
3081
3059
  offset?: string | undefined;
3060
+ platforms?: string | undefined;
3061
+ types?: string | undefined;
3062
+ timeframe?: TimePeriod | undefined;
3063
+ startDate?: string | undefined;
3064
+ endDate?: string | undefined;
3082
3065
  }>;
3083
3066
  declare const AccountPostSchema: z.ZodObject<{
3084
3067
  id: z.ZodString;
package/dist/index.js CHANGED
@@ -450,6 +450,7 @@ var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
450
450
  TimePeriod2["MONTHLY"] = "month";
451
451
  TimePeriod2["WEEKLY"] = "week";
452
452
  TimePeriod2["DAILY"] = "day";
453
+ TimePeriod2["CUSTOM"] = "custom";
453
454
  return TimePeriod2;
454
455
  })(TimePeriod || {});
455
456
  var FilterSchema = z8.object({
@@ -477,20 +478,19 @@ var FilterSchema = z8.object({
477
478
  }).pipe(
478
479
  z8.array(z8.nativeEnum(ActivityType)).optional()
479
480
  ).describe("Filter by activity types (comma-separated list, optional)"),
480
- timeframe: z8.nativeEnum(TimePeriod).optional().transform((val) => {
481
- if (!val) return "all" /* ALL */;
482
- return val;
483
- }).describe(
481
+ timeframe: z8.nativeEnum(TimePeriod).optional().describe(
484
482
  "Timeframe for filtering (optional)"
485
- )
483
+ ),
484
+ startDate: z8.string().datetime().optional().describe("Start date for custom timeframe (ISO 8601 format, optional - defaults to beginning when timeframe=custom)"),
485
+ endDate: z8.string().datetime().optional().describe("End date for custom timeframe (ISO 8601 format, optional - defaults to now when timeframe=custom)")
486
486
  }).describe("Filter parameters");
487
487
  var PaginationSchema = z8.object({
488
488
  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)"),
489
489
  offset: z8.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z8.number().min(0).optional()).describe("Offset for pagination")
490
490
  }).describe("Pagination parameters");
491
- var ActivityLeaderboardQuerySchema = z8.object({
492
- filter: FilterSchema.optional()
493
- }).describe("Account leaderboard query").merge(PaginationSchema);
491
+ var ActivityLeaderboardQuerySchema = FilterSchema.merge(PaginationSchema).describe(
492
+ "Account leaderboard query"
493
+ );
494
494
  var AccountActivityEntrySchema = z8.object({
495
495
  signerId: z8.string().describe("NEAR account ID"),
496
496
  totalPosts: z8.number().describe("Total number of posts"),
@@ -512,9 +512,9 @@ var ActivityLeaderboardResponseSchema = z8.object({
512
512
  var AccountActivityParamsSchema = z8.object({
513
513
  signerId: z8.string().describe("NEAR account ID")
514
514
  }).describe("Account activity params");
515
- var AccountActivityQuerySchema = z8.object({
516
- filter: FilterSchema.optional()
517
- }).describe("Account activity query").merge(PaginationSchema);
515
+ var AccountActivityQuerySchema = FilterSchema.merge(PaginationSchema).describe(
516
+ "Account activity query"
517
+ );
518
518
  var PlatformActivitySchema = z8.object({
519
519
  platform: PlatformSchema,
520
520
  posts: z8.number().describe("Number of posts on this platform"),
@@ -541,9 +541,9 @@ var AccountActivityResponseSchema = z8.object({
541
541
  var AccountPostsParamsSchema = z8.object({
542
542
  signerId: z8.string().describe("NEAR account ID")
543
543
  }).describe("Account posts params");
544
- var AccountPostsQuerySchema = z8.object({
545
- filter: FilterSchema.optional()
546
- }).describe("Account posts query").merge(PaginationSchema);
544
+ var AccountPostsQuerySchema = FilterSchema.merge(PaginationSchema).describe(
545
+ "Account posts query"
546
+ );
547
547
  var AccountPostSchema = z8.object({
548
548
  id: z8.string().describe("Post ID"),
549
549
  platform: PlatformSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crosspost/types",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Shared type definitions for Crosspost API",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
package/src/activity.ts CHANGED
@@ -17,6 +17,7 @@ export enum TimePeriod {
17
17
  MONTHLY = 'month',
18
18
  WEEKLY = 'week',
19
19
  DAILY = 'day',
20
+ CUSTOM = 'custom',
20
21
  }
21
22
 
22
23
  /**
@@ -58,12 +59,13 @@ export const FilterSchema = z.object({
58
59
  z.array(z.nativeEnum(ActivityType)).optional(),
59
60
  )
60
61
  .describe('Filter by activity types (comma-separated list, optional)'),
61
- timeframe: z.nativeEnum(TimePeriod).optional().transform((val) => {
62
- if (!val) return TimePeriod.ALL;
63
- return val;
64
- }).describe(
62
+ timeframe: z.nativeEnum(TimePeriod).optional().describe(
65
63
  'Timeframe for filtering (optional)',
66
64
  ),
65
+ startDate: z.string().datetime().optional()
66
+ .describe('Start date for custom timeframe (ISO 8601 format, optional - defaults to beginning when timeframe=custom)'),
67
+ endDate: z.string().datetime().optional()
68
+ .describe('End date for custom timeframe (ISO 8601 format, optional - defaults to now when timeframe=custom)'),
67
69
  }).describe('Filter parameters');
68
70
 
69
71
  /**
@@ -83,9 +85,9 @@ export const PaginationSchema = z.object({
83
85
  /**
84
86
  * Query schema for leaderboard endpoints
85
87
  */
86
- export const ActivityLeaderboardQuerySchema = z.object({
87
- filter: FilterSchema.optional(),
88
- }).describe('Account leaderboard query').merge(PaginationSchema);
88
+ export const ActivityLeaderboardQuerySchema = FilterSchema.merge(PaginationSchema).describe(
89
+ 'Account leaderboard query',
90
+ );
89
91
 
90
92
  export const AccountActivityEntrySchema = z.object({
91
93
  signerId: z.string().describe('NEAR account ID'),
@@ -114,9 +116,9 @@ export const AccountActivityParamsSchema = z.object({
114
116
  /**
115
117
  * Query schema for account activity endpoints
116
118
  */
117
- export const AccountActivityQuerySchema = z.object({
118
- filter: FilterSchema.optional(),
119
- }).describe('Account activity query').merge(PaginationSchema);
119
+ export const AccountActivityQuerySchema = FilterSchema.merge(PaginationSchema).describe(
120
+ 'Account activity query',
121
+ );
120
122
 
121
123
  export const PlatformActivitySchema = z.object({
122
124
  platform: PlatformSchema,
@@ -150,9 +152,9 @@ export const AccountPostsParamsSchema = z.object({
150
152
  /**
151
153
  * Query schema for account posts endpoints
152
154
  */
153
- export const AccountPostsQuerySchema = z.object({
154
- filter: FilterSchema.optional(),
155
- }).describe('Account posts query').merge(PaginationSchema);
155
+ export const AccountPostsQuerySchema = FilterSchema.merge(PaginationSchema).describe(
156
+ 'Account posts query',
157
+ );
156
158
 
157
159
  export const AccountPostSchema = z.object({
158
160
  id: z.string().describe('Post ID'),