@crosspost/types 0.1.9 → 0.1.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.js CHANGED
@@ -116,195 +116,214 @@ var MultiStatusDataSchema = z3.object({
116
116
  });
117
117
 
118
118
  // src/auth.ts
119
+ import { z as z5 } from "zod";
120
+
121
+ // src/user-profile.ts
119
122
  import { z as z4 } from "zod";
120
- var PlatformParamSchema = z4.object({
121
- platform: z4.string().describe("Social media platform")
123
+ var UserProfileSchema = z4.object({
124
+ userId: z4.string().describe("User ID on the platform"),
125
+ username: z4.string().describe("Username on the platform"),
126
+ url: z4.string().url().optional().describe("URL to the user profile"),
127
+ profileImageUrl: z4.string().describe("URL to the user profile image"),
128
+ isPremium: z4.boolean().optional().describe("Whether the user has a premium account"),
129
+ platform: PlatformSchema.describe("The platform the user profile is from"),
130
+ lastUpdated: z4.number().describe("Timestamp when the profile was last updated")
131
+ }).describe("User profile");
132
+ var ProfileRefreshResponseSchema = z4.object({
133
+ profile: UserProfileSchema.optional().describe("The refreshed user profile (if successful)")
134
+ }).describe("Profile refresh response");
135
+
136
+ // src/auth.ts
137
+ var PlatformParamSchema = z5.object({
138
+ platform: z5.string().describe("Social media platform")
122
139
  }).describe("Platform parameter");
123
- var AuthInitRequestSchema = z4.object({
124
- successUrl: z4.string().url().optional().describe(
140
+ var AuthInitRequestSchema = z5.object({
141
+ successUrl: z5.string().url().optional().describe(
125
142
  "URL to redirect to on successful authentication"
126
143
  ),
127
- errorUrl: z4.string().url().optional().describe("URL to redirect to on authentication error")
144
+ errorUrl: z5.string().url().optional().describe("URL to redirect to on authentication error"),
145
+ redirect: z5.boolean().optional().default(false).describe(
146
+ "Whether to redirect to successUrl/errorUrl (true) or return data directly (false)"
147
+ )
128
148
  }).describe("Auth initialization request");
129
- var AuthUrlResponseSchema = z4.object({
130
- url: z4.string().describe("Authentication URL to redirect the user to"),
131
- state: z4.string().describe("State parameter for CSRF protection"),
149
+ var AuthUrlResponseSchema = z5.object({
150
+ url: z5.string().describe("Authentication URL to redirect the user to"),
151
+ state: z5.string().describe("State parameter for CSRF protection"),
132
152
  platform: PlatformSchema
133
153
  }).describe("Auth URL response");
134
- var AuthCallbackQuerySchema = z4.object({
135
- code: z4.string().describe("Authorization code from OAuth provider"),
136
- state: z4.string().describe("State parameter for CSRF protection")
154
+ var AuthCallbackQuerySchema = z5.object({
155
+ code: z5.string().describe("Authorization code from OAuth provider"),
156
+ state: z5.string().describe("State parameter for CSRF protection")
137
157
  }).describe("Auth callback query");
138
- var AuthCallbackResponseSchema = z4.object({
158
+ var AuthCallbackResponseSchema = z5.object({
139
159
  platform: PlatformSchema,
140
- userId: z4.string().describe("User ID"),
141
- redirectUrl: z4.string().optional().describe("URL to redirect the user to after authentication")
160
+ userId: z5.string().describe("User ID"),
161
+ redirectUrl: z5.string().optional().describe("URL to redirect the user to after authentication")
142
162
  }).describe("Auth callback response");
143
- var AuthStatusParamsSchema = z4.object({
144
- platform: z4.string().describe("Social media platform"),
145
- userId: z4.string().describe("User ID on the platform")
163
+ var AuthStatusParamsSchema = z5.object({
164
+ platform: z5.string().describe("Social media platform"),
165
+ userId: z5.string().describe("User ID on the platform")
146
166
  }).describe("Token status parameters");
147
- var NearUnauthorizationResponseSchema = z4.object({
148
- success: z4.boolean().describe("Whether the unauthorized operation was successful"),
149
- nearAccount: z4.string().describe("NEAR account ID that was unauthorized")
167
+ var NearUnauthorizationResponseSchema = z5.object({
168
+ success: z5.boolean().describe("Whether the unauthorized operation was successful"),
169
+ nearAccount: z5.string().describe("NEAR account ID that was unauthorized")
150
170
  }).describe("NEAR unauthorized response");
151
- var AuthStatusResponseSchema = z4.object({
171
+ var AuthStatusResponseSchema = z5.object({
152
172
  platform: PlatformSchema,
153
- userId: z4.string().describe("User ID"),
154
- authenticated: z4.boolean().describe("Whether the user is authenticated"),
155
- tokenStatus: z4.object({
156
- valid: z4.boolean().describe("Whether the token is valid"),
157
- expired: z4.boolean().describe("Whether the token is expired"),
158
- expiresAt: z4.string().optional().describe("When the token expires")
173
+ userId: z5.string().describe("User ID"),
174
+ authenticated: z5.boolean().describe("Whether the user is authenticated"),
175
+ tokenStatus: z5.object({
176
+ valid: z5.boolean().describe("Whether the token is valid"),
177
+ expired: z5.boolean().describe("Whether the token is expired"),
178
+ expiresAt: z5.string().optional().describe("When the token expires")
159
179
  })
160
180
  }).describe("Auth status response");
161
- var AuthTokenRequestSchema = z4.object({
162
- userId: z4.string().describe("User ID on the platform")
181
+ var AuthTokenRequestSchema = z5.object({
182
+ userId: z5.string().describe("User ID on the platform")
163
183
  }).describe("Auth token request");
164
- var AuthRevokeResponseSchema = z4.object({
184
+ var AuthRevokeResponseSchema = z5.object({
165
185
  platform: PlatformSchema,
166
- userId: z4.string().describe("User ID")
186
+ userId: z5.string().describe("User ID")
167
187
  }).describe("Auth revoke response");
168
- var ConnectedAccountSchema = z4.object({
188
+ var ConnectedAccountSchema = z5.object({
169
189
  platform: PlatformSchema,
170
- userId: z4.string().describe("User ID on the platform"),
171
- username: z4.string().optional().describe("Username on the platform (if available)"),
172
- profileUrl: z4.string().optional().describe("URL to the user profile"),
173
- connectedAt: z4.string().optional().describe("When the account was connected")
190
+ userId: z5.string().describe("User ID on the platform"),
191
+ connectedAt: z5.string().describe("When the account was connected"),
192
+ profile: UserProfileSchema.nullable().describe("Full user profile data")
174
193
  }).describe("Connected account");
175
- var ConnectedAccountsResponseSchema = z4.array(ConnectedAccountSchema).describe(
176
- "Connected accounts response"
177
- );
178
- var NearAuthorizationRequestSchema = z4.object({
194
+ var ConnectedAccountsResponseSchema = z5.object({
195
+ accounts: z5.array(ConnectedAccountSchema)
196
+ }).describe("Response containing an array of connected accounts");
197
+ var NearAuthorizationRequestSchema = z5.object({
179
198
  // No additional parameters needed, as the NEAR account ID is extracted from the signature
180
199
  }).describe("NEAR authorization request");
181
- var NearAuthorizationResponseSchema = z4.object({
182
- nearAccount: z4.string().describe("NEAR account ID"),
183
- authorized: z4.boolean().describe("Whether the account is authorized")
200
+ var NearAuthorizationResponseSchema = z5.object({
201
+ nearAccount: z5.string().describe("NEAR account ID"),
202
+ authorized: z5.boolean().describe("Whether the account is authorized")
184
203
  }).describe("NEAR authorization response");
185
- var NearAuthorizationStatusResponseSchema = z4.object({
186
- nearAccount: z4.string().describe("NEAR account ID"),
187
- authorized: z4.boolean().describe("Whether the account is authorized"),
188
- authorizedAt: z4.string().optional().describe("When the account was authorized")
204
+ var NearAuthorizationStatusResponseSchema = z5.object({
205
+ nearAccount: z5.string().describe("NEAR account ID"),
206
+ authorized: z5.boolean().describe("Whether the account is authorized"),
207
+ authorizedAt: z5.string().optional().describe("When the account was authorized")
189
208
  }).describe("NEAR authorization status response");
190
209
 
191
210
  // src/post.ts
192
- import { z as z5 } from "zod";
193
- var MediaContentSchema = z5.object({
194
- data: z5.union([z5.string(), z5.instanceof(Blob)]).describe("Media data as string or Blob"),
195
- mimeType: z5.string().optional().describe("Media MIME type"),
196
- altText: z5.string().optional().describe("Alt text for the media")
211
+ import { z as z6 } from "zod";
212
+ var MediaContentSchema = z6.object({
213
+ data: z6.union([z6.string(), z6.instanceof(Blob)]).describe("Media data as string or Blob"),
214
+ mimeType: z6.string().optional().describe("Media MIME type"),
215
+ altText: z6.string().optional().describe("Alt text for the media")
197
216
  }).describe("Media content object");
198
- var MediaSchema = z5.object({
199
- id: z5.string().describe("Media ID"),
200
- type: z5.enum(["image", "video", "gif"]).describe("Media type"),
201
- url: z5.string().optional().describe("Media URL"),
202
- altText: z5.string().optional().describe("Alt text for the media")
217
+ var MediaSchema = z6.object({
218
+ id: z6.string().describe("Media ID"),
219
+ type: z6.enum(["image", "video", "gif"]).describe("Media type"),
220
+ url: z6.string().optional().describe("Media URL"),
221
+ altText: z6.string().optional().describe("Alt text for the media")
203
222
  }).describe("Media object");
204
- var PostMetricsSchema = z5.object({
205
- retweets: z5.number().describe("Number of retweets"),
206
- quotes: z5.number().describe("Number of quotes"),
207
- likes: z5.number().describe("Number of likes"),
208
- replies: z5.number().describe("Number of replies")
223
+ var PostMetricsSchema = z6.object({
224
+ retweets: z6.number().describe("Number of retweets"),
225
+ quotes: z6.number().describe("Number of quotes"),
226
+ likes: z6.number().describe("Number of likes"),
227
+ replies: z6.number().describe("Number of replies")
209
228
  }).describe("Post metrics");
210
- var PostSchema = z5.object({
211
- id: z5.string().describe("Post ID"),
212
- text: z5.string().describe("Post text content"),
213
- createdAt: z5.string().describe("Post creation date"),
214
- authorId: z5.string().describe("Author ID"),
215
- media: z5.array(MediaSchema).optional().describe("Media attached to the post"),
229
+ var PostSchema = z6.object({
230
+ id: z6.string().describe("Post ID"),
231
+ text: z6.string().describe("Post text content"),
232
+ createdAt: z6.string().describe("Post creation date"),
233
+ authorId: z6.string().describe("Author ID"),
234
+ media: z6.array(MediaSchema).optional().describe("Media attached to the post"),
216
235
  metrics: PostMetricsSchema.optional().describe("Post metrics"),
217
- inReplyToId: z5.string().optional().describe("ID of the post this is a reply to"),
218
- quotedPostId: z5.string().optional().describe("ID of the post this is quoting")
236
+ inReplyToId: z6.string().optional().describe("ID of the post this is a reply to"),
237
+ quotedPostId: z6.string().optional().describe("ID of the post this is quoting")
219
238
  }).describe("Post object");
220
- var PostContentSchema = z5.object({
221
- text: z5.string().optional().describe("Text content for the post"),
222
- media: z5.array(MediaContentSchema).optional().describe("Media attachments for the post")
239
+ var PostContentSchema = z6.object({
240
+ text: z6.string().optional().describe("Text content for the post"),
241
+ media: z6.array(MediaContentSchema).optional().describe("Media attachments for the post")
223
242
  }).describe("Post content");
224
- var PostResultSchema = z5.object({
225
- id: z5.string().describe("Post ID"),
226
- text: z5.string().optional().describe("Post text content"),
227
- createdAt: z5.string().describe("Post creation date"),
228
- mediaIds: z5.array(z5.string()).optional().describe("Media IDs attached to the post"),
229
- threadIds: z5.array(z5.string()).optional().describe("Thread IDs for threaded posts"),
230
- quotedPostId: z5.string().optional().describe("ID of the post this is quoting"),
231
- inReplyToId: z5.string().optional().describe("ID of the post this is a reply to"),
232
- success: z5.boolean().optional().describe("Whether the operation was successful")
233
- }).catchall(z5.any()).describe("Post result");
234
- var DeleteResultSchema = z5.object({
235
- success: z5.boolean().describe("Whether the deletion was successful"),
236
- id: z5.string().describe("ID of the deleted post")
243
+ var PostResultSchema = z6.object({
244
+ id: z6.string().describe("Post ID"),
245
+ text: z6.string().optional().describe("Post text content"),
246
+ createdAt: z6.string().describe("Post creation date"),
247
+ mediaIds: z6.array(z6.string()).optional().describe("Media IDs attached to the post"),
248
+ threadIds: z6.array(z6.string()).optional().describe("Thread IDs for threaded posts"),
249
+ quotedPostId: z6.string().optional().describe("ID of the post this is quoting"),
250
+ inReplyToId: z6.string().optional().describe("ID of the post this is a reply to"),
251
+ success: z6.boolean().optional().describe("Whether the operation was successful")
252
+ }).catchall(z6.any()).describe("Post result");
253
+ var DeleteResultSchema = z6.object({
254
+ success: z6.boolean().describe("Whether the deletion was successful"),
255
+ id: z6.string().describe("ID of the deleted post")
237
256
  }).describe("Delete result");
238
- var LikeResultSchema = z5.object({
239
- success: z5.boolean().describe("Whether the like was successful"),
240
- id: z5.string().describe("ID of the liked post")
257
+ var LikeResultSchema = z6.object({
258
+ success: z6.boolean().describe("Whether the like was successful"),
259
+ id: z6.string().describe("ID of the liked post")
241
260
  }).describe("Like result");
242
- var PostSuccessDetailSchema = z5.object({
261
+ var PostSuccessDetailSchema = z6.object({
243
262
  platform: PlatformSchema,
244
- userId: z5.string().describe("User ID"),
245
- status: z5.literal("success"),
246
- postId: z5.string().optional().describe("Post ID"),
247
- postUrl: z5.string().optional().describe("URL to the post")
248
- }).catchall(z5.any()).describe("Post success detail");
249
- var TargetSchema = z5.object({
263
+ userId: z6.string().describe("User ID"),
264
+ status: z6.literal("success"),
265
+ postId: z6.string().optional().describe("Post ID"),
266
+ postUrl: z6.string().optional().describe("URL to the post")
267
+ }).catchall(z6.any()).describe("Post success detail");
268
+ var TargetSchema = z6.object({
250
269
  platform: PlatformSchema.describe('The platform to post to (e.g., "twitter")'),
251
- userId: z5.string().describe("User ID on the platform")
270
+ userId: z6.string().describe("User ID on the platform")
252
271
  }).describe("Target for posting operations");
253
- var CreatePostRequestSchema = z5.object({
254
- targets: z5.array(TargetSchema).describe("Array of targets to post to (can be a single target)"),
255
- content: z5.array(PostContentSchema).describe(
272
+ var CreatePostRequestSchema = z6.object({
273
+ targets: z6.array(TargetSchema).describe("Array of targets to post to (can be a single target)"),
274
+ content: z6.array(PostContentSchema).describe(
256
275
  "The content of the post, always an array of PostContent objects, even for a single post"
257
276
  )
258
277
  }).describe("Create post request");
259
- var RepostRequestSchema = z5.object({
260
- targets: z5.array(TargetSchema).describe("Array of targets to post to"),
278
+ var RepostRequestSchema = z6.object({
279
+ targets: z6.array(TargetSchema).describe("Array of targets to post to"),
261
280
  platform: PlatformSchema.describe("Platform of the post being reposted"),
262
- postId: z5.string().describe("ID of the post to repost")
281
+ postId: z6.string().describe("ID of the post to repost")
263
282
  }).describe("Repost request");
264
- var QuotePostRequestSchema = z5.object({
265
- targets: z5.array(TargetSchema).describe(
283
+ var QuotePostRequestSchema = z6.object({
284
+ targets: z6.array(TargetSchema).describe(
266
285
  "Array of targets to post to (must be on the same platform as the post being quoted)"
267
286
  ),
268
287
  platform: PlatformSchema.describe("Platform of the post being quoted"),
269
- postId: z5.string().describe("ID of the post to quote"),
270
- content: z5.array(PostContentSchema).describe(
288
+ postId: z6.string().describe("ID of the post to quote"),
289
+ content: z6.array(PostContentSchema).describe(
271
290
  "Content for the quote post(s), always an array, even for a single post"
272
291
  )
273
292
  }).describe("Quote post request");
274
- var ReplyToPostRequestSchema = z5.object({
275
- targets: z5.array(TargetSchema).describe(
293
+ var ReplyToPostRequestSchema = z6.object({
294
+ targets: z6.array(TargetSchema).describe(
276
295
  "Array of targets to post to (must be on the same platform as the post being replied to)"
277
296
  ),
278
297
  platform: PlatformSchema.describe("Platform of the post being replied to"),
279
- postId: z5.string().describe("ID of the post to reply to"),
280
- content: z5.array(PostContentSchema).describe(
298
+ postId: z6.string().describe("ID of the post to reply to"),
299
+ content: z6.array(PostContentSchema).describe(
281
300
  "Content for the reply post(s), always an array, even for a single post"
282
301
  )
283
302
  }).describe("Reply to post request");
284
- var PostToDeleteSchema = z5.object({
303
+ var PostToDeleteSchema = z6.object({
285
304
  platform: PlatformSchema.describe("Platform of the post to delete"),
286
- userId: z5.string().describe("User ID on the platform"),
287
- postId: z5.string().describe("ID of the post to delete")
305
+ userId: z6.string().describe("User ID on the platform"),
306
+ postId: z6.string().describe("ID of the post to delete")
288
307
  }).describe("Post to delete");
289
- var DeletePostRequestSchema = z5.object({
290
- targets: z5.array(TargetSchema).describe("Array of targets to delete posts"),
291
- posts: z5.array(PostToDeleteSchema).describe("Array of posts to delete")
308
+ var DeletePostRequestSchema = z6.object({
309
+ targets: z6.array(TargetSchema).describe("Array of targets to delete posts"),
310
+ posts: z6.array(PostToDeleteSchema).describe("Array of posts to delete")
292
311
  }).describe("Delete post request");
293
- var LikePostRequestSchema = z5.object({
294
- targets: z5.array(TargetSchema).describe(
312
+ var LikePostRequestSchema = z6.object({
313
+ targets: z6.array(TargetSchema).describe(
295
314
  "Array of targets to like the post (must be on the same platform as the post being liked)"
296
315
  ),
297
316
  platform: PlatformSchema.describe("Platform of the post being liked"),
298
- postId: z5.string().describe("ID of the post to like")
317
+ postId: z6.string().describe("ID of the post to like")
299
318
  }).describe("Like post request");
300
- var UnlikePostRequestSchema = z5.object({
301
- targets: z5.array(TargetSchema).describe(
319
+ var UnlikePostRequestSchema = z6.object({
320
+ targets: z6.array(TargetSchema).describe(
302
321
  "Array of targets to unlike the post (must be on the same platform as the post being unliked)"
303
322
  ),
304
323
  platform: PlatformSchema.describe("Platform of the post being unliked"),
305
- postId: z5.string().describe("ID of the post to unlike")
324
+ postId: z6.string().describe("ID of the post to unlike")
306
325
  }).describe("Unlike post request");
307
- var PostResponseSchema = z5.union([PostSchema, z5.array(PostSchema)]).describe(
326
+ var PostResponseSchema = z6.union([PostSchema, z6.array(PostSchema)]).describe(
308
327
  "Post response"
309
328
  );
310
329
  var CreatePostResponseSchema = PostResponseSchema.describe(
@@ -313,115 +332,115 @@ var CreatePostResponseSchema = PostResponseSchema.describe(
313
332
  var RepostResponseSchema = PostResponseSchema.describe("Repost response");
314
333
  var QuotePostResponseSchema = PostResponseSchema.describe("Quote post response");
315
334
  var ReplyToPostResponseSchema = PostResponseSchema.describe("Reply to post response");
316
- var DeletePostResponseSchema = z5.object({
317
- id: z5.string().describe("ID of the deleted post")
335
+ var DeletePostResponseSchema = z6.object({
336
+ id: z6.string().describe("ID of the deleted post")
318
337
  }).describe("Delete post response");
319
- var LikePostResponseSchema = z5.object({
320
- id: z5.string().describe("ID of the liked post")
338
+ var LikePostResponseSchema = z6.object({
339
+ id: z6.string().describe("ID of the liked post")
321
340
  }).describe("Like post response");
322
- var UnlikePostResponseSchema = z5.object({
323
- id: z5.string().describe("ID of the unliked post")
341
+ var UnlikePostResponseSchema = z6.object({
342
+ id: z6.string().describe("ID of the unliked post")
324
343
  }).describe("Unlike post response");
325
- var PostMultiStatusResponseSchema = z5.object({
326
- summary: z5.object({
327
- total: z5.number().describe("Total number of operations"),
328
- succeeded: z5.number().describe("Number of successful operations"),
329
- failed: z5.number().describe("Number of failed operations")
344
+ var PostMultiStatusResponseSchema = z6.object({
345
+ summary: z6.object({
346
+ total: z6.number().describe("Total number of operations"),
347
+ succeeded: z6.number().describe("Number of successful operations"),
348
+ failed: z6.number().describe("Number of failed operations")
330
349
  }),
331
- results: z5.array(PostSuccessDetailSchema).describe("Successful operations"),
332
- errors: z5.array(ErrorDetailSchema).describe("Failed operations")
350
+ results: z6.array(PostSuccessDetailSchema).describe("Successful operations"),
351
+ errors: z6.array(ErrorDetailSchema).describe("Failed operations")
333
352
  }).describe("Multi-status response for post operations");
334
353
 
335
354
  // src/rate-limit.ts
336
- import { z as z6 } from "zod";
337
- var RateLimitEndpointParamSchema = z6.object({
338
- endpoint: z6.string().optional().describe(
355
+ import { z as z7 } from "zod";
356
+ var RateLimitEndpointParamSchema = z7.object({
357
+ endpoint: z7.string().optional().describe(
339
358
  "Specific endpoint to get rate limit information for (optional)"
340
359
  )
341
360
  }).describe("Rate limit endpoint parameter");
342
- var RateLimitEndpointSchema = z6.object({
343
- endpoint: z6.string().describe("API endpoint"),
344
- method: z6.enum(["GET", "POST", "PUT", "DELETE"]).describe("HTTP method"),
345
- limit: z6.number().describe("Rate limit"),
346
- remaining: z6.number().describe("Remaining requests"),
347
- reset: z6.number().describe("Reset timestamp (Unix timestamp in seconds)"),
348
- resetDate: z6.string().describe("Reset date (ISO string)")
361
+ var RateLimitEndpointSchema = z7.object({
362
+ endpoint: z7.string().describe("API endpoint"),
363
+ method: z7.enum(["GET", "POST", "PUT", "DELETE"]).describe("HTTP method"),
364
+ limit: z7.number().describe("Rate limit"),
365
+ remaining: z7.number().describe("Remaining requests"),
366
+ reset: z7.number().describe("Reset timestamp (Unix timestamp in seconds)"),
367
+ resetDate: z7.string().describe("Reset date (ISO string)")
349
368
  }).describe("Rate limit endpoint");
350
- var RateLimitStatusSchema = z6.object({
351
- endpoint: z6.string().describe("API endpoint or action"),
352
- limit: z6.number().describe("Maximum number of requests allowed in the time window"),
353
- remaining: z6.number().describe("Number of requests remaining in the current time window"),
354
- reset: z6.string().datetime().describe("Timestamp when the rate limit will reset"),
355
- resetSeconds: z6.number().describe("Seconds until the rate limit will reset")
369
+ var RateLimitStatusSchema = z7.object({
370
+ endpoint: z7.string().describe("API endpoint or action"),
371
+ limit: z7.number().describe("Maximum number of requests allowed in the time window"),
372
+ remaining: z7.number().describe("Number of requests remaining in the current time window"),
373
+ reset: z7.string().datetime().describe("Timestamp when the rate limit will reset"),
374
+ resetSeconds: z7.number().describe("Seconds until the rate limit will reset")
356
375
  }).describe("Rate limit status");
357
- var PlatformRateLimitSchema = z6.object({
376
+ var PlatformRateLimitSchema = z7.object({
358
377
  platform: PlatformSchema,
359
- endpoints: z6.record(z6.string(), RateLimitStatusSchema).describe(
378
+ endpoints: z7.record(z7.string(), RateLimitStatusSchema).describe(
360
379
  "Rate limit status for each endpoint"
361
380
  )
362
381
  }).describe("Platform-specific rate limit");
363
- var UsageRateLimitSchema = z6.object({
364
- endpoint: z6.string().describe("API endpoint or action"),
365
- limit: z6.number().describe("Maximum number of requests allowed in the time window"),
366
- remaining: z6.number().describe("Number of requests remaining in the current time window"),
367
- reset: z6.string().datetime().describe("Timestamp when the rate limit will reset"),
368
- resetSeconds: z6.number().describe("Seconds until the rate limit will reset"),
369
- timeWindow: z6.string().describe("Time window for the rate limit")
382
+ var UsageRateLimitSchema = z7.object({
383
+ endpoint: z7.string().describe("API endpoint or action"),
384
+ limit: z7.number().describe("Maximum number of requests allowed in the time window"),
385
+ remaining: z7.number().describe("Number of requests remaining in the current time window"),
386
+ reset: z7.string().datetime().describe("Timestamp when the rate limit will reset"),
387
+ resetSeconds: z7.number().describe("Seconds until the rate limit will reset"),
388
+ timeWindow: z7.string().describe("Time window for the rate limit")
370
389
  }).describe("Usage rate limit");
371
- var RateLimitStatusResponseSchema = z6.object({
390
+ var RateLimitStatusResponseSchema = z7.object({
372
391
  platform: PlatformSchema,
373
- userId: z6.string().optional().describe("User ID"),
374
- endpoints: z6.array(RateLimitEndpointSchema).describe("Rate limits for specific endpoints"),
375
- app: z6.object({
376
- limit: z6.number().describe("App-wide rate limit"),
377
- remaining: z6.number().describe("Remaining requests"),
378
- reset: z6.number().describe("Reset timestamp (Unix timestamp in seconds)"),
379
- resetDate: z6.string().describe("Reset date (ISO string)")
392
+ userId: z7.string().optional().describe("User ID"),
393
+ endpoints: z7.array(RateLimitEndpointSchema).describe("Rate limits for specific endpoints"),
394
+ app: z7.object({
395
+ limit: z7.number().describe("App-wide rate limit"),
396
+ remaining: z7.number().describe("Remaining requests"),
397
+ reset: z7.number().describe("Reset timestamp (Unix timestamp in seconds)"),
398
+ resetDate: z7.string().describe("Reset date (ISO string)")
380
399
  }).optional().describe("App-wide rate limits")
381
400
  }).describe("Rate limit status response");
382
- var AllRateLimitsResponseSchema = z6.object({
383
- platforms: z6.record(
401
+ var AllRateLimitsResponseSchema = z7.object({
402
+ platforms: z7.record(
384
403
  PlatformSchema,
385
- z6.object({
386
- users: z6.record(
387
- z6.string(),
388
- z6.object({
389
- endpoints: z6.array(RateLimitEndpointSchema).describe(
404
+ z7.object({
405
+ users: z7.record(
406
+ z7.string(),
407
+ z7.object({
408
+ endpoints: z7.array(RateLimitEndpointSchema).describe(
390
409
  "Rate limits for specific endpoints"
391
410
  ),
392
- lastUpdated: z6.string().describe("Last updated date (ISO string)")
411
+ lastUpdated: z7.string().describe("Last updated date (ISO string)")
393
412
  })
394
413
  ).describe("User-specific rate limits"),
395
- app: z6.object({
396
- limit: z6.number().describe("App-wide rate limit"),
397
- remaining: z6.number().describe("Remaining requests"),
398
- reset: z6.number().describe("Reset timestamp (Unix timestamp in seconds)"),
399
- resetDate: z6.string().describe("Reset date (ISO string)")
414
+ app: z7.object({
415
+ limit: z7.number().describe("App-wide rate limit"),
416
+ remaining: z7.number().describe("Remaining requests"),
417
+ reset: z7.number().describe("Reset timestamp (Unix timestamp in seconds)"),
418
+ resetDate: z7.string().describe("Reset date (ISO string)")
400
419
  }).optional().describe("App-wide rate limits")
401
420
  })
402
421
  ).describe("Rate limits by platform")
403
422
  }).describe("All rate limits response");
404
- var RateLimitResponseSchema = z6.object({
405
- platformLimits: z6.array(PlatformRateLimitSchema).describe("Platform-specific rate limits"),
406
- usageLimits: z6.record(z6.string(), UsageRateLimitSchema).describe(
423
+ var RateLimitResponseSchema = z7.object({
424
+ platformLimits: z7.array(PlatformRateLimitSchema).describe("Platform-specific rate limits"),
425
+ usageLimits: z7.record(z7.string(), UsageRateLimitSchema).describe(
407
426
  "Usage-based rate limits for the NEAR account"
408
427
  ),
409
- signerId: z6.string().describe("NEAR account ID")
428
+ signerId: z7.string().describe("NEAR account ID")
410
429
  }).describe("Rate limit response");
411
- var EndpointRateLimitResponseSchema = z6.object({
412
- platformLimits: z6.array(
413
- z6.object({
430
+ var EndpointRateLimitResponseSchema = z7.object({
431
+ platformLimits: z7.array(
432
+ z7.object({
414
433
  platform: PlatformSchema,
415
434
  status: RateLimitStatusSchema.describe("Rate limit status for the endpoint")
416
435
  })
417
436
  ).describe("Platform-specific rate limits for the endpoint"),
418
437
  usageLimit: UsageRateLimitSchema.describe("Usage-based rate limit for the NEAR account"),
419
- endpoint: z6.string().describe("API endpoint or action"),
420
- signerId: z6.string().describe("NEAR account ID")
438
+ endpoint: z7.string().describe("API endpoint or action"),
439
+ signerId: z7.string().describe("NEAR account ID")
421
440
  }).describe("Endpoint rate limit response");
422
441
 
423
442
  // src/activity.ts
424
- import { z as z7 } from "zod";
443
+ import { z as z8 } from "zod";
425
444
  var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
426
445
  TimePeriod2["ALL"] = "all";
427
446
  TimePeriod2["YEARLY"] = "year";
@@ -430,111 +449,96 @@ var TimePeriod = /* @__PURE__ */ ((TimePeriod2) => {
430
449
  TimePeriod2["DAILY"] = "day";
431
450
  return TimePeriod2;
432
451
  })(TimePeriod || {});
433
- var ActivityLeaderboardQuerySchema = z7.object({
434
- timeframe: z7.nativeEnum(TimePeriod).optional().describe(
452
+ var ActivityLeaderboardQuerySchema = z8.object({
453
+ timeframe: z8.nativeEnum(TimePeriod).optional().describe(
435
454
  "Timeframe for the leaderboard"
436
455
  ),
437
- limit: z7.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z7.number().min(1).max(100).optional()).describe("Maximum number of results to return (1-100)"),
438
- offset: z7.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z7.number().min(0).optional()).describe("Offset for pagination")
456
+ 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)"),
457
+ offset: z8.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z8.number().min(0).optional()).describe("Offset for pagination")
439
458
  }).describe("Activity leaderboard query");
440
- var AccountActivityEntrySchema = z7.object({
441
- signerId: z7.string().describe("NEAR account ID"),
442
- totalPosts: z7.number().describe("Total number of posts"),
443
- totalLikes: z7.number().describe("Total number of likes"),
444
- totalReposts: z7.number().describe("Total number of reposts"),
445
- totalReplies: z7.number().describe("Total number of replies"),
446
- totalQuotes: z7.number().describe("Total number of quote posts"),
447
- totalScore: z7.number().describe("Total activity score"),
448
- rank: z7.number().describe("Rank on the leaderboard"),
449
- lastActive: z7.string().datetime().describe("Timestamp of last activity")
459
+ var AccountActivityEntrySchema = z8.object({
460
+ signerId: z8.string().describe("NEAR account ID"),
461
+ totalPosts: z8.number().describe("Total number of posts"),
462
+ totalLikes: z8.number().describe("Total number of likes"),
463
+ totalReposts: z8.number().describe("Total number of reposts"),
464
+ totalReplies: z8.number().describe("Total number of replies"),
465
+ totalQuotes: z8.number().describe("Total number of quote posts"),
466
+ totalScore: z8.number().describe("Total activity score"),
467
+ rank: z8.number().describe("Rank on the leaderboard"),
468
+ lastActive: z8.string().datetime().describe("Timestamp of last activity")
450
469
  }).describe("Account activity entry");
451
- var ActivityLeaderboardResponseSchema = z7.object({
452
- timeframe: z7.nativeEnum(TimePeriod).describe("Timeframe for the leaderboard"),
453
- entries: z7.array(AccountActivityEntrySchema).describe("Leaderboard entries"),
454
- generatedAt: z7.string().datetime().describe("Timestamp when the leaderboard was generated"),
470
+ var ActivityLeaderboardResponseSchema = z8.object({
471
+ timeframe: z8.nativeEnum(TimePeriod).describe("Timeframe for the leaderboard"),
472
+ entries: z8.array(AccountActivityEntrySchema).describe("Leaderboard entries"),
473
+ generatedAt: z8.string().datetime().describe("Timestamp when the leaderboard was generated"),
455
474
  platform: PlatformSchema.optional().describe("Platform filter (if applied)")
456
475
  });
457
- var AccountActivityParamsSchema = z7.object({
458
- signerId: z7.string().describe("NEAR account ID")
476
+ var AccountActivityParamsSchema = z8.object({
477
+ signerId: z8.string().describe("NEAR account ID")
459
478
  }).describe("Account activity params");
460
- var AccountActivityQuerySchema = z7.object({
461
- timeframe: z7.nativeEnum(TimePeriod).optional().describe(
479
+ var AccountActivityQuerySchema = z8.object({
480
+ timeframe: z8.nativeEnum(TimePeriod).optional().describe(
462
481
  "Timeframe for the activity"
463
482
  )
464
483
  }).describe("Account activity query");
465
- var PlatformActivitySchema = z7.object({
484
+ var PlatformActivitySchema = z8.object({
466
485
  platform: PlatformSchema,
467
- posts: z7.number().describe("Number of posts on this platform"),
468
- likes: z7.number().describe("Number of likes on this platform"),
469
- reposts: z7.number().describe("Number of reposts on this platform"),
470
- replies: z7.number().describe("Number of replies on this platform"),
471
- quotes: z7.number().describe("Number of quote posts on this platform"),
472
- score: z7.number().describe("Activity score on this platform"),
473
- lastActive: z7.string().datetime().describe("Timestamp of last activity on this platform")
486
+ posts: z8.number().describe("Number of posts on this platform"),
487
+ likes: z8.number().describe("Number of likes on this platform"),
488
+ reposts: z8.number().describe("Number of reposts on this platform"),
489
+ replies: z8.number().describe("Number of replies on this platform"),
490
+ quotes: z8.number().describe("Number of quote posts on this platform"),
491
+ score: z8.number().describe("Activity score on this platform"),
492
+ lastActive: z8.string().datetime().describe("Timestamp of last activity on this platform")
474
493
  }).describe("Platform activity");
475
- var AccountActivityResponseSchema = z7.object({
476
- signerId: z7.string().describe("NEAR account ID"),
477
- timeframe: z7.nativeEnum(TimePeriod).describe("Timeframe for the activity"),
478
- totalPosts: z7.number().describe("Total number of posts across all platforms"),
479
- totalLikes: z7.number().describe("Total number of likes across all platforms"),
480
- totalReposts: z7.number().describe("Total number of reposts across all platforms"),
481
- totalReplies: z7.number().describe("Total number of replies across all platforms"),
482
- totalQuotes: z7.number().describe("Total number of quote posts across all platforms"),
483
- totalScore: z7.number().describe("Total activity score across all platforms"),
484
- rank: z7.number().describe("Rank on the leaderboard"),
485
- lastActive: z7.string().datetime().describe("Timestamp of last activity across all platforms"),
486
- platforms: z7.array(PlatformActivitySchema).describe("Activity breakdown by platform")
494
+ var AccountActivityResponseSchema = z8.object({
495
+ signerId: z8.string().describe("NEAR account ID"),
496
+ timeframe: z8.nativeEnum(TimePeriod).describe("Timeframe for the activity"),
497
+ totalPosts: z8.number().describe("Total number of posts across all platforms"),
498
+ totalLikes: z8.number().describe("Total number of likes across all platforms"),
499
+ totalReposts: z8.number().describe("Total number of reposts across all platforms"),
500
+ totalReplies: z8.number().describe("Total number of replies across all platforms"),
501
+ totalQuotes: z8.number().describe("Total number of quote posts across all platforms"),
502
+ totalScore: z8.number().describe("Total activity score across all platforms"),
503
+ rank: z8.number().describe("Rank on the leaderboard"),
504
+ lastActive: z8.string().datetime().describe("Timestamp of last activity across all platforms"),
505
+ platforms: z8.array(PlatformActivitySchema).describe("Activity breakdown by platform")
487
506
  });
488
- var AccountPostsParamsSchema = z7.object({
489
- signerId: z7.string().describe("NEAR account ID")
507
+ var AccountPostsParamsSchema = z8.object({
508
+ signerId: z8.string().describe("NEAR account ID")
490
509
  }).describe("Account posts params");
491
- var AccountPostsQuerySchema = z7.object({
492
- platform: z7.string().optional().describe("Filter by platform (optional)"),
493
- limit: z7.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z7.number().min(1).max(100).optional()).describe("Maximum number of results to return (1-100)"),
494
- offset: z7.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z7.number().min(0).optional()).describe("Offset for pagination"),
495
- type: z7.enum(["post", "repost", "reply", "quote", "like", "all"]).optional().describe(
510
+ var AccountPostsQuerySchema = z8.object({
511
+ platform: z8.string().optional().describe("Filter by platform (optional)"),
512
+ 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)"),
513
+ offset: z8.string().optional().transform((val) => val ? parseInt(val, 10) : void 0).pipe(z8.number().min(0).optional()).describe("Offset for pagination"),
514
+ type: z8.enum(["post", "repost", "reply", "quote", "like", "all"]).optional().describe(
496
515
  "Filter by post type (optional)"
497
516
  )
498
517
  }).describe("Account posts query");
499
- var AccountPostSchema = z7.object({
500
- id: z7.string().describe("Post ID"),
518
+ var AccountPostSchema = z8.object({
519
+ id: z8.string().describe("Post ID"),
501
520
  platform: PlatformSchema,
502
- type: z7.enum(["post", "repost", "reply", "quote", "like"]).describe("Type of post"),
503
- content: z7.string().optional().describe("Post content (if available)"),
504
- url: z7.string().url().optional().describe("URL to the post on the platform (if available)"),
505
- createdAt: z7.string().datetime().describe("Timestamp when the post was created"),
506
- metrics: z7.object({
507
- likes: z7.number().optional().describe("Number of likes (if available)"),
508
- reposts: z7.number().optional().describe("Number of reposts (if available)"),
509
- replies: z7.number().optional().describe("Number of replies (if available)"),
510
- quotes: z7.number().optional().describe("Number of quotes (if available)")
521
+ type: z8.enum(["post", "repost", "reply", "quote", "like"]).describe("Type of post"),
522
+ content: z8.string().optional().describe("Post content (if available)"),
523
+ url: z8.string().url().optional().describe("URL to the post on the platform (if available)"),
524
+ createdAt: z8.string().datetime().describe("Timestamp when the post was created"),
525
+ metrics: z8.object({
526
+ likes: z8.number().optional().describe("Number of likes (if available)"),
527
+ reposts: z8.number().optional().describe("Number of reposts (if available)"),
528
+ replies: z8.number().optional().describe("Number of replies (if available)"),
529
+ quotes: z8.number().optional().describe("Number of quotes (if available)")
511
530
  }).optional().describe("Post metrics (if available)"),
512
- inReplyToId: z7.string().optional().describe("ID of the post this is a reply to (if applicable)"),
513
- quotedPostId: z7.string().optional().describe("ID of the post this is quoting (if applicable)")
531
+ inReplyToId: z8.string().optional().describe("ID of the post this is a reply to (if applicable)"),
532
+ quotedPostId: z8.string().optional().describe("ID of the post this is quoting (if applicable)")
514
533
  }).describe("Account post");
515
- var AccountPostsResponseSchema = z7.object({
516
- signerId: z7.string().describe("NEAR account ID"),
517
- posts: z7.array(AccountPostSchema).describe("List of posts"),
518
- platform: z7.string().optional().describe("Platform filter (if applied)"),
519
- type: z7.enum(["post", "repost", "reply", "quote", "like", "all"]).optional().describe(
534
+ var AccountPostsResponseSchema = z8.object({
535
+ signerId: z8.string().describe("NEAR account ID"),
536
+ posts: z8.array(AccountPostSchema).describe("List of posts"),
537
+ platform: z8.string().optional().describe("Platform filter (if applied)"),
538
+ type: z8.enum(["post", "repost", "reply", "quote", "like", "all"]).optional().describe(
520
539
  "Post type filter (if applied)"
521
540
  )
522
541
  });
523
-
524
- // src/user-profile.ts
525
- import { z as z8 } from "zod";
526
- var UserProfileSchema = z8.object({
527
- userId: z8.string().describe("User ID on the platform"),
528
- username: z8.string().describe("Username on the platform"),
529
- url: z8.string().url().optional().describe("URL to the user profile"),
530
- profileImageUrl: z8.string().describe("URL to the user profile image"),
531
- isPremium: z8.boolean().optional().describe("Whether the user has a premium account"),
532
- platform: PlatformSchema.describe("The platform the user profile is from"),
533
- lastUpdated: z8.number().describe("Timestamp when the profile was last updated")
534
- }).describe("User profile");
535
- var ProfileRefreshResponseSchema = z8.object({
536
- profile: UserProfileSchema.optional().describe("The refreshed user profile (if successful)")
537
- }).describe("Profile refresh response");
538
542
  export {
539
543
  AccountActivityEntrySchema,
540
544
  AccountActivityParamsSchema,