@crosspost/types 0.1.4 → 0.1.5

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
@@ -759,15 +759,15 @@ var EndpointRateLimitResponseSchema = import_zod5.z.object({
759
759
  // src/activity.ts
760
760
  var import_zod6 = require("zod");
761
761
  var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
762
- TimePeriod2["ALL_TIME"] = "all";
763
- TimePeriod2["YEARLY"] = "yearly";
764
- TimePeriod2["MONTHLY"] = "monthly";
765
- TimePeriod2["WEEKLY"] = "weekly";
766
- TimePeriod2["DAILY"] = "daily";
762
+ TimePeriod2["ALL"] = "all";
763
+ TimePeriod2["YEARLY"] = "year";
764
+ TimePeriod2["MONTHLY"] = "month";
765
+ TimePeriod2["WEEKLY"] = "week";
766
+ TimePeriod2["DAILY"] = "day";
767
767
  return TimePeriod2;
768
768
  })(TimePeriod || {});
769
769
  var ActivityLeaderboardQuerySchema = import_zod6.z.object({
770
- timeframe: import_zod6.z.enum(["day", "week", "month", "all"]).optional().describe(
770
+ timeframe: import_zod6.z.nativeEnum(TimePeriod).optional().describe(
771
771
  "Timeframe for the leaderboard"
772
772
  ),
773
773
  limit: import_zod6.z.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(import_zod6.z.number().min(1).max(100).optional()).describe("Maximum number of results to return (1-100)"),
@@ -786,7 +786,7 @@ var AccountActivityEntrySchema = import_zod6.z.object({
786
786
  }).describe("Account activity entry");
787
787
  var ActivityLeaderboardResponseSchema = EnhancedResponseSchema(
788
788
  import_zod6.z.object({
789
- timeframe: import_zod6.z.enum(["day", "week", "month", "all"]).describe("Timeframe for the leaderboard"),
789
+ timeframe: import_zod6.z.nativeEnum(TimePeriod).describe("Timeframe for the leaderboard"),
790
790
  entries: import_zod6.z.array(AccountActivityEntrySchema).describe("Leaderboard entries"),
791
791
  total: import_zod6.z.number().describe("Total number of entries in the leaderboard"),
792
792
  limit: import_zod6.z.number().describe("Maximum number of results returned"),
@@ -798,7 +798,7 @@ var AccountActivityParamsSchema = import_zod6.z.object({
798
798
  signerId: import_zod6.z.string().describe("NEAR account ID")
799
799
  }).describe("Account activity params");
800
800
  var AccountActivityQuerySchema = import_zod6.z.object({
801
- timeframe: import_zod6.z.enum(["day", "week", "month", "all"]).optional().describe(
801
+ timeframe: import_zod6.z.nativeEnum(TimePeriod).optional().describe(
802
802
  "Timeframe for the activity"
803
803
  )
804
804
  }).describe("Account activity query");
@@ -815,7 +815,7 @@ var PlatformActivitySchema = import_zod6.z.object({
815
815
  var AccountActivityResponseSchema = EnhancedResponseSchema(
816
816
  import_zod6.z.object({
817
817
  signerId: import_zod6.z.string().describe("NEAR account ID"),
818
- timeframe: import_zod6.z.enum(["day", "week", "month", "all"]).describe("Timeframe for the activity"),
818
+ timeframe: import_zod6.z.nativeEnum(TimePeriod).describe("Timeframe for the activity"),
819
819
  totalPosts: import_zod6.z.number().describe("Total number of posts across all platforms"),
820
820
  totalLikes: import_zod6.z.number().describe("Total number of likes across all platforms"),
821
821
  totalReposts: import_zod6.z.number().describe("Total number of reposts across all platforms"),
package/dist/index.d.cts CHANGED
@@ -6188,26 +6188,26 @@ type EndpointRateLimitResponse = z.infer<typeof EndpointRateLimitResponseSchema>
6188
6188
  * Time periods for activity filtering
6189
6189
  */
6190
6190
  declare enum TimePeriod {
6191
- ALL_TIME = "all",
6192
- YEARLY = "yearly",
6193
- MONTHLY = "monthly",
6194
- WEEKLY = "weekly",
6195
- DAILY = "daily"
6191
+ ALL = "all",
6192
+ YEARLY = "year",
6193
+ MONTHLY = "month",
6194
+ WEEKLY = "week",
6195
+ DAILY = "day"
6196
6196
  }
6197
6197
  /**
6198
6198
  * Activity leaderboard query schema
6199
6199
  */
6200
6200
  declare const ActivityLeaderboardQuerySchema: z.ZodObject<{
6201
- timeframe: z.ZodOptional<z.ZodEnum<["day", "week", "month", "all"]>>;
6201
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
6202
6202
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
6203
6203
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
6204
6204
  }, "strip", z.ZodTypeAny, {
6205
6205
  limit?: number | undefined;
6206
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6206
+ timeframe?: TimePeriod | undefined;
6207
6207
  offset?: number | undefined;
6208
6208
  }, {
6209
6209
  limit?: string | undefined;
6210
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6210
+ timeframe?: TimePeriod | undefined;
6211
6211
  offset?: string | undefined;
6212
6212
  }>;
6213
6213
  /**
@@ -6250,7 +6250,7 @@ declare const AccountActivityEntrySchema: z.ZodObject<{
6250
6250
  declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6251
6251
  success: z.ZodBoolean;
6252
6252
  data: z.ZodObject<{
6253
- timeframe: z.ZodEnum<["day", "week", "month", "all"]>;
6253
+ timeframe: z.ZodNativeEnum<typeof TimePeriod>;
6254
6254
  entries: z.ZodArray<z.ZodObject<{
6255
6255
  signerId: z.ZodString;
6256
6256
  totalPosts: z.ZodNumber;
@@ -6300,7 +6300,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6300
6300
  lastActive: string;
6301
6301
  }[];
6302
6302
  total: number;
6303
- timeframe: "all" | "day" | "week" | "month";
6303
+ timeframe: TimePeriod;
6304
6304
  offset: number;
6305
6305
  generatedAt: string;
6306
6306
  }, {
@@ -6317,7 +6317,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6317
6317
  lastActive: string;
6318
6318
  }[];
6319
6319
  total: number;
6320
- timeframe: "all" | "day" | "week" | "month";
6320
+ timeframe: TimePeriod;
6321
6321
  offset: number;
6322
6322
  generatedAt: string;
6323
6323
  }>;
@@ -6407,7 +6407,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6407
6407
  lastActive: string;
6408
6408
  }[];
6409
6409
  total: number;
6410
- timeframe: "all" | "day" | "week" | "month";
6410
+ timeframe: TimePeriod;
6411
6411
  offset: number;
6412
6412
  generatedAt: string;
6413
6413
  };
@@ -6444,7 +6444,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6444
6444
  lastActive: string;
6445
6445
  }[];
6446
6446
  total: number;
6447
- timeframe: "all" | "day" | "week" | "month";
6447
+ timeframe: TimePeriod;
6448
6448
  offset: number;
6449
6449
  generatedAt: string;
6450
6450
  };
@@ -6481,11 +6481,11 @@ declare const AccountActivityParamsSchema: z.ZodObject<{
6481
6481
  * Account activity query schema
6482
6482
  */
6483
6483
  declare const AccountActivityQuerySchema: z.ZodObject<{
6484
- timeframe: z.ZodOptional<z.ZodEnum<["day", "week", "month", "all"]>>;
6484
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
6485
6485
  }, "strip", z.ZodTypeAny, {
6486
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6486
+ timeframe?: TimePeriod | undefined;
6487
6487
  }, {
6488
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6488
+ timeframe?: TimePeriod | undefined;
6489
6489
  }>;
6490
6490
  /**
6491
6491
  * Platform activity schema
@@ -6525,7 +6525,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6525
6525
  success: z.ZodBoolean;
6526
6526
  data: z.ZodObject<{
6527
6527
  signerId: z.ZodString;
6528
- timeframe: z.ZodEnum<["day", "week", "month", "all"]>;
6528
+ timeframe: z.ZodNativeEnum<typeof TimePeriod>;
6529
6529
  totalPosts: z.ZodNumber;
6530
6530
  totalLikes: z.ZodNumber;
6531
6531
  totalReposts: z.ZodNumber;
@@ -6574,7 +6574,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6574
6574
  score: number;
6575
6575
  }[];
6576
6576
  signerId: string;
6577
- timeframe: "all" | "day" | "week" | "month";
6577
+ timeframe: TimePeriod;
6578
6578
  totalPosts: number;
6579
6579
  totalLikes: number;
6580
6580
  totalReposts: number;
@@ -6595,7 +6595,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6595
6595
  score: number;
6596
6596
  }[];
6597
6597
  signerId: string;
6598
- timeframe: "all" | "day" | "week" | "month";
6598
+ timeframe: TimePeriod;
6599
6599
  totalPosts: number;
6600
6600
  totalLikes: number;
6601
6601
  totalReposts: number;
@@ -6689,7 +6689,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6689
6689
  score: number;
6690
6690
  }[];
6691
6691
  signerId: string;
6692
- timeframe: "all" | "day" | "week" | "month";
6692
+ timeframe: TimePeriod;
6693
6693
  totalPosts: number;
6694
6694
  totalLikes: number;
6695
6695
  totalReposts: number;
@@ -6730,7 +6730,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6730
6730
  score: number;
6731
6731
  }[];
6732
6732
  signerId: string;
6733
- timeframe: "all" | "day" | "week" | "month";
6733
+ timeframe: TimePeriod;
6734
6734
  totalPosts: number;
6735
6735
  totalLikes: number;
6736
6736
  totalReposts: number;
package/dist/index.d.ts CHANGED
@@ -6188,26 +6188,26 @@ type EndpointRateLimitResponse = z.infer<typeof EndpointRateLimitResponseSchema>
6188
6188
  * Time periods for activity filtering
6189
6189
  */
6190
6190
  declare enum TimePeriod {
6191
- ALL_TIME = "all",
6192
- YEARLY = "yearly",
6193
- MONTHLY = "monthly",
6194
- WEEKLY = "weekly",
6195
- DAILY = "daily"
6191
+ ALL = "all",
6192
+ YEARLY = "year",
6193
+ MONTHLY = "month",
6194
+ WEEKLY = "week",
6195
+ DAILY = "day"
6196
6196
  }
6197
6197
  /**
6198
6198
  * Activity leaderboard query schema
6199
6199
  */
6200
6200
  declare const ActivityLeaderboardQuerySchema: z.ZodObject<{
6201
- timeframe: z.ZodOptional<z.ZodEnum<["day", "week", "month", "all"]>>;
6201
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
6202
6202
  limit: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
6203
6203
  offset: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, number | undefined, string | undefined>, z.ZodOptional<z.ZodNumber>>;
6204
6204
  }, "strip", z.ZodTypeAny, {
6205
6205
  limit?: number | undefined;
6206
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6206
+ timeframe?: TimePeriod | undefined;
6207
6207
  offset?: number | undefined;
6208
6208
  }, {
6209
6209
  limit?: string | undefined;
6210
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6210
+ timeframe?: TimePeriod | undefined;
6211
6211
  offset?: string | undefined;
6212
6212
  }>;
6213
6213
  /**
@@ -6250,7 +6250,7 @@ declare const AccountActivityEntrySchema: z.ZodObject<{
6250
6250
  declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6251
6251
  success: z.ZodBoolean;
6252
6252
  data: z.ZodObject<{
6253
- timeframe: z.ZodEnum<["day", "week", "month", "all"]>;
6253
+ timeframe: z.ZodNativeEnum<typeof TimePeriod>;
6254
6254
  entries: z.ZodArray<z.ZodObject<{
6255
6255
  signerId: z.ZodString;
6256
6256
  totalPosts: z.ZodNumber;
@@ -6300,7 +6300,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6300
6300
  lastActive: string;
6301
6301
  }[];
6302
6302
  total: number;
6303
- timeframe: "all" | "day" | "week" | "month";
6303
+ timeframe: TimePeriod;
6304
6304
  offset: number;
6305
6305
  generatedAt: string;
6306
6306
  }, {
@@ -6317,7 +6317,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6317
6317
  lastActive: string;
6318
6318
  }[];
6319
6319
  total: number;
6320
- timeframe: "all" | "day" | "week" | "month";
6320
+ timeframe: TimePeriod;
6321
6321
  offset: number;
6322
6322
  generatedAt: string;
6323
6323
  }>;
@@ -6407,7 +6407,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6407
6407
  lastActive: string;
6408
6408
  }[];
6409
6409
  total: number;
6410
- timeframe: "all" | "day" | "week" | "month";
6410
+ timeframe: TimePeriod;
6411
6411
  offset: number;
6412
6412
  generatedAt: string;
6413
6413
  };
@@ -6444,7 +6444,7 @@ declare const ActivityLeaderboardResponseSchema: z.ZodObject<{
6444
6444
  lastActive: string;
6445
6445
  }[];
6446
6446
  total: number;
6447
- timeframe: "all" | "day" | "week" | "month";
6447
+ timeframe: TimePeriod;
6448
6448
  offset: number;
6449
6449
  generatedAt: string;
6450
6450
  };
@@ -6481,11 +6481,11 @@ declare const AccountActivityParamsSchema: z.ZodObject<{
6481
6481
  * Account activity query schema
6482
6482
  */
6483
6483
  declare const AccountActivityQuerySchema: z.ZodObject<{
6484
- timeframe: z.ZodOptional<z.ZodEnum<["day", "week", "month", "all"]>>;
6484
+ timeframe: z.ZodOptional<z.ZodNativeEnum<typeof TimePeriod>>;
6485
6485
  }, "strip", z.ZodTypeAny, {
6486
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6486
+ timeframe?: TimePeriod | undefined;
6487
6487
  }, {
6488
- timeframe?: "all" | "day" | "week" | "month" | undefined;
6488
+ timeframe?: TimePeriod | undefined;
6489
6489
  }>;
6490
6490
  /**
6491
6491
  * Platform activity schema
@@ -6525,7 +6525,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6525
6525
  success: z.ZodBoolean;
6526
6526
  data: z.ZodObject<{
6527
6527
  signerId: z.ZodString;
6528
- timeframe: z.ZodEnum<["day", "week", "month", "all"]>;
6528
+ timeframe: z.ZodNativeEnum<typeof TimePeriod>;
6529
6529
  totalPosts: z.ZodNumber;
6530
6530
  totalLikes: z.ZodNumber;
6531
6531
  totalReposts: z.ZodNumber;
@@ -6574,7 +6574,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6574
6574
  score: number;
6575
6575
  }[];
6576
6576
  signerId: string;
6577
- timeframe: "all" | "day" | "week" | "month";
6577
+ timeframe: TimePeriod;
6578
6578
  totalPosts: number;
6579
6579
  totalLikes: number;
6580
6580
  totalReposts: number;
@@ -6595,7 +6595,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6595
6595
  score: number;
6596
6596
  }[];
6597
6597
  signerId: string;
6598
- timeframe: "all" | "day" | "week" | "month";
6598
+ timeframe: TimePeriod;
6599
6599
  totalPosts: number;
6600
6600
  totalLikes: number;
6601
6601
  totalReposts: number;
@@ -6689,7 +6689,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6689
6689
  score: number;
6690
6690
  }[];
6691
6691
  signerId: string;
6692
- timeframe: "all" | "day" | "week" | "month";
6692
+ timeframe: TimePeriod;
6693
6693
  totalPosts: number;
6694
6694
  totalLikes: number;
6695
6695
  totalReposts: number;
@@ -6730,7 +6730,7 @@ declare const AccountActivityResponseSchema: z.ZodObject<{
6730
6730
  score: number;
6731
6731
  }[];
6732
6732
  signerId: string;
6733
- timeframe: "all" | "day" | "week" | "month";
6733
+ timeframe: TimePeriod;
6734
6734
  totalPosts: number;
6735
6735
  totalLikes: number;
6736
6736
  totalReposts: number;
package/dist/index.js CHANGED
@@ -644,15 +644,15 @@ var EndpointRateLimitResponseSchema = z5.object({
644
644
  // src/activity.ts
645
645
  import { z as z6 } from "zod";
646
646
  var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
647
- TimePeriod2["ALL_TIME"] = "all";
648
- TimePeriod2["YEARLY"] = "yearly";
649
- TimePeriod2["MONTHLY"] = "monthly";
650
- TimePeriod2["WEEKLY"] = "weekly";
651
- TimePeriod2["DAILY"] = "daily";
647
+ TimePeriod2["ALL"] = "all";
648
+ TimePeriod2["YEARLY"] = "year";
649
+ TimePeriod2["MONTHLY"] = "month";
650
+ TimePeriod2["WEEKLY"] = "week";
651
+ TimePeriod2["DAILY"] = "day";
652
652
  return TimePeriod2;
653
653
  })(TimePeriod || {});
654
654
  var ActivityLeaderboardQuerySchema = z6.object({
655
- timeframe: z6.enum(["day", "week", "month", "all"]).optional().describe(
655
+ timeframe: z6.nativeEnum(TimePeriod).optional().describe(
656
656
  "Timeframe for the leaderboard"
657
657
  ),
658
658
  limit: z6.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z6.number().min(1).max(100).optional()).describe("Maximum number of results to return (1-100)"),
@@ -671,7 +671,7 @@ var AccountActivityEntrySchema = z6.object({
671
671
  }).describe("Account activity entry");
672
672
  var ActivityLeaderboardResponseSchema = EnhancedResponseSchema(
673
673
  z6.object({
674
- timeframe: z6.enum(["day", "week", "month", "all"]).describe("Timeframe for the leaderboard"),
674
+ timeframe: z6.nativeEnum(TimePeriod).describe("Timeframe for the leaderboard"),
675
675
  entries: z6.array(AccountActivityEntrySchema).describe("Leaderboard entries"),
676
676
  total: z6.number().describe("Total number of entries in the leaderboard"),
677
677
  limit: z6.number().describe("Maximum number of results returned"),
@@ -683,7 +683,7 @@ var AccountActivityParamsSchema = z6.object({
683
683
  signerId: z6.string().describe("NEAR account ID")
684
684
  }).describe("Account activity params");
685
685
  var AccountActivityQuerySchema = z6.object({
686
- timeframe: z6.enum(["day", "week", "month", "all"]).optional().describe(
686
+ timeframe: z6.nativeEnum(TimePeriod).optional().describe(
687
687
  "Timeframe for the activity"
688
688
  )
689
689
  }).describe("Account activity query");
@@ -700,7 +700,7 @@ var PlatformActivitySchema = z6.object({
700
700
  var AccountActivityResponseSchema = EnhancedResponseSchema(
701
701
  z6.object({
702
702
  signerId: z6.string().describe("NEAR account ID"),
703
- timeframe: z6.enum(["day", "week", "month", "all"]).describe("Timeframe for the activity"),
703
+ timeframe: z6.nativeEnum(TimePeriod).describe("Timeframe for the activity"),
704
704
  totalPosts: z6.number().describe("Total number of posts across all platforms"),
705
705
  totalLikes: z6.number().describe("Total number of likes across all platforms"),
706
706
  totalReposts: z6.number().describe("Total number of reposts across all platforms"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crosspost/types",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Shared type definitions for Crosspost API",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
package/src/activity.ts CHANGED
@@ -12,18 +12,18 @@ import { PlatformSchema } from './common.ts';
12
12
  * Time periods for activity filtering
13
13
  */
14
14
  export enum TimePeriod {
15
- ALL_TIME = 'all',
16
- YEARLY = 'yearly',
17
- MONTHLY = 'monthly',
18
- WEEKLY = 'weekly',
19
- DAILY = 'daily',
15
+ ALL = 'all',
16
+ YEARLY = 'year',
17
+ MONTHLY = 'month',
18
+ WEEKLY = 'week',
19
+ DAILY = 'day',
20
20
  }
21
21
 
22
22
  /**
23
23
  * Activity leaderboard query schema
24
24
  */
25
25
  export const ActivityLeaderboardQuerySchema = z.object({
26
- timeframe: z.enum(['day', 'week', 'month', 'all']).optional().describe(
26
+ timeframe: z.nativeEnum(TimePeriod).optional().describe(
27
27
  'Timeframe for the leaderboard',
28
28
  ),
29
29
  limit: z.string().optional()
@@ -56,7 +56,7 @@ export const AccountActivityEntrySchema = z.object({
56
56
  */
57
57
  export const ActivityLeaderboardResponseSchema = EnhancedResponseSchema(
58
58
  z.object({
59
- timeframe: z.enum(['day', 'week', 'month', 'all']).describe('Timeframe for the leaderboard'),
59
+ timeframe: z.nativeEnum(TimePeriod).describe('Timeframe for the leaderboard'),
60
60
  entries: z.array(AccountActivityEntrySchema).describe('Leaderboard entries'),
61
61
  total: z.number().describe('Total number of entries in the leaderboard'),
62
62
  limit: z.number().describe('Maximum number of results returned'),
@@ -76,7 +76,7 @@ export const AccountActivityParamsSchema = z.object({
76
76
  * Account activity query schema
77
77
  */
78
78
  export const AccountActivityQuerySchema = z.object({
79
- timeframe: z.enum(['day', 'week', 'month', 'all']).optional().describe(
79
+ timeframe: z.nativeEnum(TimePeriod).optional().describe(
80
80
  'Timeframe for the activity',
81
81
  ),
82
82
  }).describe('Account activity query');
@@ -101,7 +101,7 @@ export const PlatformActivitySchema = z.object({
101
101
  export const AccountActivityResponseSchema = EnhancedResponseSchema(
102
102
  z.object({
103
103
  signerId: z.string().describe('NEAR account ID'),
104
- timeframe: z.enum(['day', 'week', 'month', 'all']).describe('Timeframe for the activity'),
104
+ timeframe: z.nativeEnum(TimePeriod).describe('Timeframe for the activity'),
105
105
  totalPosts: z.number().describe('Total number of posts across all platforms'),
106
106
  totalLikes: z.number().describe('Total number of likes across all platforms'),
107
107
  totalReposts: z.number().describe('Total number of reposts across all platforms'),
@@ -1,179 +0,0 @@
1
- /**
2
- * Leaderboard Schemas and Types
3
- * Defines Zod schemas for leaderboard-related requests and responses
4
- * TypeScript types are derived from Zod schemas for type safety
5
- */
6
-
7
- import { z } from 'zod';
8
- import { EnhancedResponseSchema } from './response.ts';
9
- import { PlatformSchema } from './common.ts';
10
-
11
- /**
12
- * Leaderboard query schema
13
- */
14
- export const LeaderboardQuerySchema = z.object({
15
- timeframe: z.enum(['day', 'week', 'month', 'all']).optional().describe(
16
- 'Timeframe for the leaderboard',
17
- ),
18
- limit: z.string().optional()
19
- .transform((val) => val ? parseInt(val, 10) : undefined)
20
- .pipe(z.number().min(1).max(100).optional())
21
- .describe('Maximum number of results to return (1-100)'),
22
- offset: z.string().optional()
23
- .transform((val) => val ? parseInt(val, 10) : undefined)
24
- .pipe(z.number().min(0).optional())
25
- .describe('Offset for pagination'),
26
- }).describe('Leaderboard query');
27
-
28
- /**
29
- * Account activity entry schema
30
- */
31
- export const AccountActivityEntrySchema = z.object({
32
- signerId: z.string().describe('NEAR account ID'),
33
- totalPosts: z.number().describe('Total number of posts'),
34
- totalLikes: z.number().describe('Total number of likes'),
35
- totalReposts: z.number().describe('Total number of reposts'),
36
- totalReplies: z.number().describe('Total number of replies'),
37
- totalQuotes: z.number().describe('Total number of quote posts'),
38
- totalScore: z.number().describe('Total activity score'),
39
- rank: z.number().describe('Rank on the leaderboard'),
40
- lastActive: z.string().datetime().describe('Timestamp of last activity'),
41
- }).describe('Account activity entry');
42
-
43
- /**
44
- * Leaderboard response schema
45
- */
46
- export const LeaderboardResponseSchema = EnhancedResponseSchema(
47
- z.object({
48
- timeframe: z.enum(['day', 'week', 'month', 'all']).describe('Timeframe for the leaderboard'),
49
- entries: z.array(AccountActivityEntrySchema).describe('Leaderboard entries'),
50
- total: z.number().describe('Total number of entries in the leaderboard'),
51
- limit: z.number().describe('Maximum number of results returned'),
52
- offset: z.number().describe('Offset for pagination'),
53
- generatedAt: z.string().datetime().describe('Timestamp when the leaderboard was generated'),
54
- }),
55
- ).describe('Leaderboard response');
56
-
57
- /**
58
- * Account activity params schema
59
- */
60
- export const AccountActivityParamsSchema = z.object({
61
- signerId: z.string().describe('NEAR account ID'),
62
- }).describe('Account activity params');
63
-
64
- /**
65
- * Account activity query schema
66
- */
67
- export const AccountActivityQuerySchema = z.object({
68
- timeframe: z.enum(['day', 'week', 'month', 'all']).optional().describe(
69
- 'Timeframe for the activity',
70
- ),
71
- }).describe('Account activity query');
72
-
73
- /**
74
- * Platform activity schema
75
- */
76
- export const PlatformActivitySchema = z.object({
77
- platform: PlatformSchema,
78
- posts: z.number().describe('Number of posts on this platform'),
79
- likes: z.number().describe('Number of likes on this platform'),
80
- reposts: z.number().describe('Number of reposts on this platform'),
81
- replies: z.number().describe('Number of replies on this platform'),
82
- quotes: z.number().describe('Number of quote posts on this platform'),
83
- score: z.number().describe('Activity score on this platform'),
84
- lastActive: z.string().datetime().describe('Timestamp of last activity on this platform'),
85
- }).describe('Platform activity');
86
-
87
- /**
88
- * Account activity response schema
89
- */
90
- export const AccountActivityResponseSchema = EnhancedResponseSchema(
91
- z.object({
92
- signerId: z.string().describe('NEAR account ID'),
93
- timeframe: z.enum(['day', 'week', 'month', 'all']).describe('Timeframe for the activity'),
94
- totalPosts: z.number().describe('Total number of posts across all platforms'),
95
- totalLikes: z.number().describe('Total number of likes across all platforms'),
96
- totalReposts: z.number().describe('Total number of reposts across all platforms'),
97
- totalReplies: z.number().describe('Total number of replies across all platforms'),
98
- totalQuotes: z.number().describe('Total number of quote posts across all platforms'),
99
- totalScore: z.number().describe('Total activity score across all platforms'),
100
- rank: z.number().describe('Rank on the leaderboard'),
101
- lastActive: z.string().datetime().describe('Timestamp of last activity across all platforms'),
102
- platforms: z.array(PlatformActivitySchema).describe('Activity breakdown by platform'),
103
- }),
104
- ).describe('Account activity response');
105
-
106
- /**
107
- * Account posts params schema
108
- */
109
- export const AccountPostsParamsSchema = z.object({
110
- signerId: z.string().describe('NEAR account ID'),
111
- }).describe('Account posts params');
112
-
113
- /**
114
- * Account posts query schema
115
- */
116
- export const AccountPostsQuerySchema = z.object({
117
- platform: z.string().optional().describe('Filter by platform (optional)'),
118
- limit: z.string().optional()
119
- .transform((val) => val ? parseInt(val, 10) : undefined)
120
- .pipe(z.number().min(1).max(100).optional())
121
- .describe('Maximum number of results to return (1-100)'),
122
- offset: z.string().optional()
123
- .transform((val) => val ? parseInt(val, 10) : undefined)
124
- .pipe(z.number().min(0).optional())
125
- .describe('Offset for pagination'),
126
- type: z.enum(['post', 'repost', 'reply', 'quote', 'like', 'all']).optional().describe(
127
- 'Filter by post type (optional)',
128
- ),
129
- }).describe('Account posts query');
130
-
131
- /**
132
- * Account post schema
133
- */
134
- export const AccountPostSchema = z.object({
135
- id: z.string().describe('Post ID'),
136
- platform: PlatformSchema,
137
- type: z.enum(['post', 'repost', 'reply', 'quote', 'like']).describe('Type of post'),
138
- content: z.string().optional().describe('Post content (if available)'),
139
- url: z.string().url().optional().describe('URL to the post on the platform (if available)'),
140
- createdAt: z.string().datetime().describe('Timestamp when the post was created'),
141
- metrics: z.object({
142
- likes: z.number().optional().describe('Number of likes (if available)'),
143
- reposts: z.number().optional().describe('Number of reposts (if available)'),
144
- replies: z.number().optional().describe('Number of replies (if available)'),
145
- quotes: z.number().optional().describe('Number of quotes (if available)'),
146
- }).optional().describe('Post metrics (if available)'),
147
- inReplyToId: z.string().optional().describe('ID of the post this is a reply to (if applicable)'),
148
- quotedPostId: z.string().optional().describe('ID of the post this is quoting (if applicable)'),
149
- }).describe('Account post');
150
-
151
- /**
152
- * Account posts response schema
153
- */
154
- export const AccountPostsResponseSchema = EnhancedResponseSchema(
155
- z.object({
156
- signerId: z.string().describe('NEAR account ID'),
157
- posts: z.array(AccountPostSchema).describe('List of posts'),
158
- total: z.number().describe('Total number of posts matching the query'),
159
- limit: z.number().describe('Maximum number of results returned'),
160
- offset: z.number().describe('Offset for pagination'),
161
- platform: z.string().optional().describe('Platform filter (if applied)'),
162
- type: z.enum(['post', 'repost', 'reply', 'quote', 'like', 'all']).optional().describe(
163
- 'Post type filter (if applied)',
164
- ),
165
- }),
166
- ).describe('Account posts response');
167
-
168
- // Derive TypeScript types from Zod schemas
169
- export type LeaderboardQuery = z.infer<typeof LeaderboardQuerySchema>;
170
- export type AccountActivityEntry = z.infer<typeof AccountActivityEntrySchema>;
171
- export type LeaderboardResponse = z.infer<typeof LeaderboardResponseSchema>;
172
- export type AccountActivityParams = z.infer<typeof AccountActivityParamsSchema>;
173
- export type AccountActivityQuery = z.infer<typeof AccountActivityQuerySchema>;
174
- export type PlatformActivity = z.infer<typeof PlatformActivitySchema>;
175
- export type AccountActivityResponse = z.infer<typeof AccountActivityResponseSchema>;
176
- export type AccountPostsParams = z.infer<typeof AccountPostsParamsSchema>;
177
- export type AccountPostsQuery = z.infer<typeof AccountPostsQuerySchema>;
178
- export type AccountPost = z.infer<typeof AccountPostSchema>;
179
- export type AccountPostsResponse = z.infer<typeof AccountPostsResponseSchema>;