@crosspost/types 0.1.7 → 0.1.8
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 +19 -0
- package/dist/index.d.cts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +16 -0
- package/package.json +1 -1
- package/src/auth.ts +12 -0
- package/src/response.ts +7 -0
package/dist/index.cjs
CHANGED
@@ -34,6 +34,7 @@ __export(index_exports, {
|
|
34
34
|
AuthCallbackResponseSchema: () => AuthCallbackResponseSchema,
|
35
35
|
AuthInitRequestSchema: () => AuthInitRequestSchema,
|
36
36
|
AuthRevokeResponseSchema: () => AuthRevokeResponseSchema,
|
37
|
+
AuthStatusParamsSchema: () => AuthStatusParamsSchema,
|
37
38
|
AuthStatusResponseSchema: () => AuthStatusResponseSchema,
|
38
39
|
AuthTokenRequestSchema: () => AuthTokenRequestSchema,
|
39
40
|
AuthUrlResponseSchema: () => AuthUrlResponseSchema,
|
@@ -46,6 +47,7 @@ __export(index_exports, {
|
|
46
47
|
DeleteResultSchema: () => DeleteResultSchema,
|
47
48
|
EndpointRateLimitResponseSchema: () => EndpointRateLimitResponseSchema,
|
48
49
|
ErrorDetailSchema: () => ErrorDetailSchema,
|
50
|
+
HealthStatusSchema: () => HealthStatusSchema,
|
49
51
|
LikePostRequestSchema: () => LikePostRequestSchema,
|
50
52
|
LikePostResponseSchema: () => LikePostResponseSchema,
|
51
53
|
LikeResultSchema: () => LikeResultSchema,
|
@@ -55,6 +57,7 @@ __export(index_exports, {
|
|
55
57
|
NearAuthorizationRequestSchema: () => NearAuthorizationRequestSchema,
|
56
58
|
NearAuthorizationResponseSchema: () => NearAuthorizationResponseSchema,
|
57
59
|
NearAuthorizationStatusResponseSchema: () => NearAuthorizationStatusResponseSchema,
|
60
|
+
NearUnauthorizationResponseSchema: () => NearUnauthorizationResponseSchema,
|
58
61
|
Platform: () => Platform,
|
59
62
|
PlatformActivitySchema: () => PlatformActivitySchema,
|
60
63
|
PlatformParamSchema: () => PlatformParamSchema,
|
@@ -195,6 +198,11 @@ var SuccessDetailSchema = import_zod3.z.object({
|
|
195
198
|
additionalData: import_zod3.z.any().optional(),
|
196
199
|
status: import_zod3.z.literal("success")
|
197
200
|
}).catchall(import_zod3.z.any());
|
201
|
+
var HealthStatusSchema = import_zod3.z.object({
|
202
|
+
status: import_zod3.z.string().describe("Health status of the API"),
|
203
|
+
version: import_zod3.z.string().optional().describe("API version"),
|
204
|
+
timestamp: import_zod3.z.string().datetime().describe("Current server time")
|
205
|
+
}).describe("Health status response");
|
198
206
|
var MultiStatusDataSchema = import_zod3.z.object({
|
199
207
|
summary: import_zod3.z.object({
|
200
208
|
total: import_zod3.z.number().int().nonnegative(),
|
@@ -230,6 +238,14 @@ var AuthCallbackResponseSchema = import_zod4.z.object({
|
|
230
238
|
userId: import_zod4.z.string().describe("User ID"),
|
231
239
|
redirectUrl: import_zod4.z.string().optional().describe("URL to redirect the user to after authentication")
|
232
240
|
}).describe("Auth callback response");
|
241
|
+
var AuthStatusParamsSchema = import_zod4.z.object({
|
242
|
+
platform: import_zod4.z.string().describe("Social media platform"),
|
243
|
+
userId: import_zod4.z.string().describe("User ID on the platform")
|
244
|
+
}).describe("Token status parameters");
|
245
|
+
var NearUnauthorizationResponseSchema = import_zod4.z.object({
|
246
|
+
success: import_zod4.z.boolean().describe("Whether the unauthorized operation was successful"),
|
247
|
+
nearAccount: import_zod4.z.string().describe("NEAR account ID that was unauthorized")
|
248
|
+
}).describe("NEAR unauthorized response");
|
233
249
|
var AuthStatusResponseSchema = import_zod4.z.object({
|
234
250
|
platform: PlatformSchema,
|
235
251
|
userId: import_zod4.z.string().describe("User ID"),
|
@@ -633,6 +649,7 @@ var ProfileRefreshResponseSchema = import_zod8.z.object({
|
|
633
649
|
AuthCallbackResponseSchema,
|
634
650
|
AuthInitRequestSchema,
|
635
651
|
AuthRevokeResponseSchema,
|
652
|
+
AuthStatusParamsSchema,
|
636
653
|
AuthStatusResponseSchema,
|
637
654
|
AuthTokenRequestSchema,
|
638
655
|
AuthUrlResponseSchema,
|
@@ -645,6 +662,7 @@ var ProfileRefreshResponseSchema = import_zod8.z.object({
|
|
645
662
|
DeleteResultSchema,
|
646
663
|
EndpointRateLimitResponseSchema,
|
647
664
|
ErrorDetailSchema,
|
665
|
+
HealthStatusSchema,
|
648
666
|
LikePostRequestSchema,
|
649
667
|
LikePostResponseSchema,
|
650
668
|
LikeResultSchema,
|
@@ -654,6 +672,7 @@ var ProfileRefreshResponseSchema = import_zod8.z.object({
|
|
654
672
|
NearAuthorizationRequestSchema,
|
655
673
|
NearAuthorizationResponseSchema,
|
656
674
|
NearAuthorizationStatusResponseSchema,
|
675
|
+
NearUnauthorizationResponseSchema,
|
657
676
|
Platform,
|
658
677
|
PlatformActivitySchema,
|
659
678
|
PlatformParamSchema,
|
package/dist/index.d.cts
CHANGED
@@ -181,6 +181,19 @@ declare const SuccessDetailSchema: z.ZodObject<{
|
|
181
181
|
additionalData: z.ZodOptional<z.ZodAny>;
|
182
182
|
status: z.ZodLiteral<"success">;
|
183
183
|
}, z.ZodAny, "strip">>;
|
184
|
+
declare const HealthStatusSchema: z.ZodObject<{
|
185
|
+
status: z.ZodString;
|
186
|
+
version: z.ZodOptional<z.ZodString>;
|
187
|
+
timestamp: z.ZodString;
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
189
|
+
status: string;
|
190
|
+
timestamp: string;
|
191
|
+
version?: string | undefined;
|
192
|
+
}, {
|
193
|
+
status: string;
|
194
|
+
timestamp: string;
|
195
|
+
version?: string | undefined;
|
196
|
+
}>;
|
184
197
|
declare const MultiStatusDataSchema: z.ZodObject<{
|
185
198
|
summary: z.ZodObject<{
|
186
199
|
total: z.ZodNumber;
|
@@ -273,6 +286,7 @@ interface ApiResponse<T> {
|
|
273
286
|
type ResponseMeta = z.infer<typeof ResponseMetaSchema>;
|
274
287
|
type SuccessDetail = z.infer<typeof SuccessDetailSchema>;
|
275
288
|
type MultiStatusData = z.infer<typeof MultiStatusDataSchema>;
|
289
|
+
type HealthStatus = z.infer<typeof HealthStatusSchema>;
|
276
290
|
|
277
291
|
declare const PlatformParamSchema: z.ZodObject<{
|
278
292
|
platform: z.ZodString;
|
@@ -327,6 +341,26 @@ declare const AuthCallbackResponseSchema: z.ZodObject<{
|
|
327
341
|
userId: string;
|
328
342
|
redirectUrl?: string | undefined;
|
329
343
|
}>;
|
344
|
+
declare const AuthStatusParamsSchema: z.ZodObject<{
|
345
|
+
platform: z.ZodString;
|
346
|
+
userId: z.ZodString;
|
347
|
+
}, "strip", z.ZodTypeAny, {
|
348
|
+
platform: string;
|
349
|
+
userId: string;
|
350
|
+
}, {
|
351
|
+
platform: string;
|
352
|
+
userId: string;
|
353
|
+
}>;
|
354
|
+
declare const NearUnauthorizationResponseSchema: z.ZodObject<{
|
355
|
+
success: z.ZodBoolean;
|
356
|
+
nearAccount: z.ZodString;
|
357
|
+
}, "strip", z.ZodTypeAny, {
|
358
|
+
success: boolean;
|
359
|
+
nearAccount: string;
|
360
|
+
}, {
|
361
|
+
success: boolean;
|
362
|
+
nearAccount: string;
|
363
|
+
}>;
|
330
364
|
declare const AuthStatusResponseSchema: z.ZodObject<{
|
331
365
|
platform: z.ZodNativeEnum<typeof Platform>;
|
332
366
|
userId: z.ZodString;
|
@@ -455,6 +489,8 @@ type NearAuthorizationRequest = z.infer<typeof NearAuthorizationRequestSchema>;
|
|
455
489
|
type NearAuthorizationResponse = z.infer<typeof NearAuthorizationResponseSchema>;
|
456
490
|
type NearAuthorizationStatusResponse = z.infer<typeof NearAuthorizationStatusResponseSchema>;
|
457
491
|
type AuthTokenRequest = z.infer<typeof AuthTokenRequestSchema>;
|
492
|
+
type AuthStatusParams = z.infer<typeof AuthStatusParamsSchema>;
|
493
|
+
type NearUnauthorizationResponse = z.infer<typeof NearUnauthorizationResponseSchema>;
|
458
494
|
|
459
495
|
declare const MediaContentSchema: z.ZodObject<{
|
460
496
|
data: z.ZodUnion<[z.ZodString, z.ZodType<buffer.Blob, z.ZodTypeDef, buffer.Blob>]>;
|
@@ -3038,4 +3074,4 @@ declare const ProfileRefreshResponseSchema: z.ZodObject<{
|
|
3038
3074
|
type UserProfile = z.infer<typeof UserProfileSchema>;
|
3039
3075
|
type ProfileRefreshResponse = z.infer<typeof ProfileRefreshResponseSchema>;
|
3040
3076
|
|
3041
|
-
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatusResponse, AuthStatusResponseSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type NearAuthorizationRequest, NearAuthorizationRequestSchema, type NearAuthorizationResponse, NearAuthorizationResponseSchema, type NearAuthorizationStatusResponse, NearAuthorizationStatusResponseSchema, Platform, type PlatformAccountActivity, type PlatformActivity, PlatformActivitySchema, type PlatformName, type PlatformParam, PlatformParamSchema, type PlatformRateLimit, PlatformRateLimitSchema, PlatformSchema, type Post, type PostContent, PostContentSchema, type PostMetrics, PostMetricsSchema, type PostMultiStatusResponse, PostMultiStatusResponseSchema, type PostRecord, type PostResponse, PostResponseSchema, type PostResult, PostResultSchema, PostSchema, type PostSuccessDetail, PostSuccessDetailSchema, type PostToDelete, PostToDeleteSchema, type ProfileRefreshResponse, ProfileRefreshResponseSchema, type QuotePostRequest, QuotePostRequestSchema, type QuotePostResponse, QuotePostResponseSchema, type RateLimitEndpoint, type RateLimitEndpointParam, RateLimitEndpointParamSchema, RateLimitEndpointSchema, type RateLimitResponse, RateLimitResponseSchema, type RateLimitStatus, type RateLimitStatusResponse, RateLimitStatusResponseSchema, RateLimitStatusSchema, type ReplyToPostRequest, ReplyToPostRequestSchema, type ReplyToPostResponse, ReplyToPostResponseSchema, type RepostRequest, RepostRequestSchema, type RepostResponse, RepostResponseSchema, type ResponseMeta, ResponseMetaSchema, SUPPORTED_PLATFORMS, type SuccessDetail, SuccessDetailSchema, type SupportedPlatformName, SupportedPlatformSchema, type Target, TargetSchema, TimePeriod, type UnlikePostRequest, UnlikePostRequestSchema, type UnlikePostResponse, UnlikePostResponseSchema, type UsageRateLimit, UsageRateLimitSchema, type UserProfile, UserProfileSchema, errorCodeToStatusCode, isPlatformSupported };
|
3077
|
+
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatusParams, AuthStatusParamsSchema, type AuthStatusResponse, AuthStatusResponseSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type HealthStatus, HealthStatusSchema, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type NearAuthorizationRequest, NearAuthorizationRequestSchema, type NearAuthorizationResponse, NearAuthorizationResponseSchema, type NearAuthorizationStatusResponse, NearAuthorizationStatusResponseSchema, type NearUnauthorizationResponse, NearUnauthorizationResponseSchema, Platform, type PlatformAccountActivity, type PlatformActivity, PlatformActivitySchema, type PlatformName, type PlatformParam, PlatformParamSchema, type PlatformRateLimit, PlatformRateLimitSchema, PlatformSchema, type Post, type PostContent, PostContentSchema, type PostMetrics, PostMetricsSchema, type PostMultiStatusResponse, PostMultiStatusResponseSchema, type PostRecord, type PostResponse, PostResponseSchema, type PostResult, PostResultSchema, PostSchema, type PostSuccessDetail, PostSuccessDetailSchema, type PostToDelete, PostToDeleteSchema, type ProfileRefreshResponse, ProfileRefreshResponseSchema, type QuotePostRequest, QuotePostRequestSchema, type QuotePostResponse, QuotePostResponseSchema, type RateLimitEndpoint, type RateLimitEndpointParam, RateLimitEndpointParamSchema, RateLimitEndpointSchema, type RateLimitResponse, RateLimitResponseSchema, type RateLimitStatus, type RateLimitStatusResponse, RateLimitStatusResponseSchema, RateLimitStatusSchema, type ReplyToPostRequest, ReplyToPostRequestSchema, type ReplyToPostResponse, ReplyToPostResponseSchema, type RepostRequest, RepostRequestSchema, type RepostResponse, RepostResponseSchema, type ResponseMeta, ResponseMetaSchema, SUPPORTED_PLATFORMS, type SuccessDetail, SuccessDetailSchema, type SupportedPlatformName, SupportedPlatformSchema, type Target, TargetSchema, TimePeriod, type UnlikePostRequest, UnlikePostRequestSchema, type UnlikePostResponse, UnlikePostResponseSchema, type UsageRateLimit, UsageRateLimitSchema, type UserProfile, UserProfileSchema, errorCodeToStatusCode, isPlatformSupported };
|
package/dist/index.d.ts
CHANGED
@@ -181,6 +181,19 @@ declare const SuccessDetailSchema: z.ZodObject<{
|
|
181
181
|
additionalData: z.ZodOptional<z.ZodAny>;
|
182
182
|
status: z.ZodLiteral<"success">;
|
183
183
|
}, z.ZodAny, "strip">>;
|
184
|
+
declare const HealthStatusSchema: z.ZodObject<{
|
185
|
+
status: z.ZodString;
|
186
|
+
version: z.ZodOptional<z.ZodString>;
|
187
|
+
timestamp: z.ZodString;
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
189
|
+
status: string;
|
190
|
+
timestamp: string;
|
191
|
+
version?: string | undefined;
|
192
|
+
}, {
|
193
|
+
status: string;
|
194
|
+
timestamp: string;
|
195
|
+
version?: string | undefined;
|
196
|
+
}>;
|
184
197
|
declare const MultiStatusDataSchema: z.ZodObject<{
|
185
198
|
summary: z.ZodObject<{
|
186
199
|
total: z.ZodNumber;
|
@@ -273,6 +286,7 @@ interface ApiResponse<T> {
|
|
273
286
|
type ResponseMeta = z.infer<typeof ResponseMetaSchema>;
|
274
287
|
type SuccessDetail = z.infer<typeof SuccessDetailSchema>;
|
275
288
|
type MultiStatusData = z.infer<typeof MultiStatusDataSchema>;
|
289
|
+
type HealthStatus = z.infer<typeof HealthStatusSchema>;
|
276
290
|
|
277
291
|
declare const PlatformParamSchema: z.ZodObject<{
|
278
292
|
platform: z.ZodString;
|
@@ -327,6 +341,26 @@ declare const AuthCallbackResponseSchema: z.ZodObject<{
|
|
327
341
|
userId: string;
|
328
342
|
redirectUrl?: string | undefined;
|
329
343
|
}>;
|
344
|
+
declare const AuthStatusParamsSchema: z.ZodObject<{
|
345
|
+
platform: z.ZodString;
|
346
|
+
userId: z.ZodString;
|
347
|
+
}, "strip", z.ZodTypeAny, {
|
348
|
+
platform: string;
|
349
|
+
userId: string;
|
350
|
+
}, {
|
351
|
+
platform: string;
|
352
|
+
userId: string;
|
353
|
+
}>;
|
354
|
+
declare const NearUnauthorizationResponseSchema: z.ZodObject<{
|
355
|
+
success: z.ZodBoolean;
|
356
|
+
nearAccount: z.ZodString;
|
357
|
+
}, "strip", z.ZodTypeAny, {
|
358
|
+
success: boolean;
|
359
|
+
nearAccount: string;
|
360
|
+
}, {
|
361
|
+
success: boolean;
|
362
|
+
nearAccount: string;
|
363
|
+
}>;
|
330
364
|
declare const AuthStatusResponseSchema: z.ZodObject<{
|
331
365
|
platform: z.ZodNativeEnum<typeof Platform>;
|
332
366
|
userId: z.ZodString;
|
@@ -455,6 +489,8 @@ type NearAuthorizationRequest = z.infer<typeof NearAuthorizationRequestSchema>;
|
|
455
489
|
type NearAuthorizationResponse = z.infer<typeof NearAuthorizationResponseSchema>;
|
456
490
|
type NearAuthorizationStatusResponse = z.infer<typeof NearAuthorizationStatusResponseSchema>;
|
457
491
|
type AuthTokenRequest = z.infer<typeof AuthTokenRequestSchema>;
|
492
|
+
type AuthStatusParams = z.infer<typeof AuthStatusParamsSchema>;
|
493
|
+
type NearUnauthorizationResponse = z.infer<typeof NearUnauthorizationResponseSchema>;
|
458
494
|
|
459
495
|
declare const MediaContentSchema: z.ZodObject<{
|
460
496
|
data: z.ZodUnion<[z.ZodString, z.ZodType<buffer.Blob, z.ZodTypeDef, buffer.Blob>]>;
|
@@ -3038,4 +3074,4 @@ declare const ProfileRefreshResponseSchema: z.ZodObject<{
|
|
3038
3074
|
type UserProfile = z.infer<typeof UserProfileSchema>;
|
3039
3075
|
type ProfileRefreshResponse = z.infer<typeof ProfileRefreshResponseSchema>;
|
3040
3076
|
|
3041
|
-
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatusResponse, AuthStatusResponseSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type NearAuthorizationRequest, NearAuthorizationRequestSchema, type NearAuthorizationResponse, NearAuthorizationResponseSchema, type NearAuthorizationStatusResponse, NearAuthorizationStatusResponseSchema, Platform, type PlatformAccountActivity, type PlatformActivity, PlatformActivitySchema, type PlatformName, type PlatformParam, PlatformParamSchema, type PlatformRateLimit, PlatformRateLimitSchema, PlatformSchema, type Post, type PostContent, PostContentSchema, type PostMetrics, PostMetricsSchema, type PostMultiStatusResponse, PostMultiStatusResponseSchema, type PostRecord, type PostResponse, PostResponseSchema, type PostResult, PostResultSchema, PostSchema, type PostSuccessDetail, PostSuccessDetailSchema, type PostToDelete, PostToDeleteSchema, type ProfileRefreshResponse, ProfileRefreshResponseSchema, type QuotePostRequest, QuotePostRequestSchema, type QuotePostResponse, QuotePostResponseSchema, type RateLimitEndpoint, type RateLimitEndpointParam, RateLimitEndpointParamSchema, RateLimitEndpointSchema, type RateLimitResponse, RateLimitResponseSchema, type RateLimitStatus, type RateLimitStatusResponse, RateLimitStatusResponseSchema, RateLimitStatusSchema, type ReplyToPostRequest, ReplyToPostRequestSchema, type ReplyToPostResponse, ReplyToPostResponseSchema, type RepostRequest, RepostRequestSchema, type RepostResponse, RepostResponseSchema, type ResponseMeta, ResponseMetaSchema, SUPPORTED_PLATFORMS, type SuccessDetail, SuccessDetailSchema, type SupportedPlatformName, SupportedPlatformSchema, type Target, TargetSchema, TimePeriod, type UnlikePostRequest, UnlikePostRequestSchema, type UnlikePostResponse, UnlikePostResponseSchema, type UsageRateLimit, UsageRateLimitSchema, type UserProfile, UserProfileSchema, errorCodeToStatusCode, isPlatformSupported };
|
3077
|
+
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatusParams, AuthStatusParamsSchema, type AuthStatusResponse, AuthStatusResponseSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type HealthStatus, HealthStatusSchema, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type NearAuthorizationRequest, NearAuthorizationRequestSchema, type NearAuthorizationResponse, NearAuthorizationResponseSchema, type NearAuthorizationStatusResponse, NearAuthorizationStatusResponseSchema, type NearUnauthorizationResponse, NearUnauthorizationResponseSchema, Platform, type PlatformAccountActivity, type PlatformActivity, PlatformActivitySchema, type PlatformName, type PlatformParam, PlatformParamSchema, type PlatformRateLimit, PlatformRateLimitSchema, PlatformSchema, type Post, type PostContent, PostContentSchema, type PostMetrics, PostMetricsSchema, type PostMultiStatusResponse, PostMultiStatusResponseSchema, type PostRecord, type PostResponse, PostResponseSchema, type PostResult, PostResultSchema, PostSchema, type PostSuccessDetail, PostSuccessDetailSchema, type PostToDelete, PostToDeleteSchema, type ProfileRefreshResponse, ProfileRefreshResponseSchema, type QuotePostRequest, QuotePostRequestSchema, type QuotePostResponse, QuotePostResponseSchema, type RateLimitEndpoint, type RateLimitEndpointParam, RateLimitEndpointParamSchema, RateLimitEndpointSchema, type RateLimitResponse, RateLimitResponseSchema, type RateLimitStatus, type RateLimitStatusResponse, RateLimitStatusResponseSchema, RateLimitStatusSchema, type ReplyToPostRequest, ReplyToPostRequestSchema, type ReplyToPostResponse, ReplyToPostResponseSchema, type RepostRequest, RepostRequestSchema, type RepostResponse, RepostResponseSchema, type ResponseMeta, ResponseMetaSchema, SUPPORTED_PLATFORMS, type SuccessDetail, SuccessDetailSchema, type SupportedPlatformName, SupportedPlatformSchema, type Target, TargetSchema, TimePeriod, type UnlikePostRequest, UnlikePostRequestSchema, type UnlikePostResponse, UnlikePostResponseSchema, type UsageRateLimit, UsageRateLimitSchema, type UserProfile, UserProfileSchema, errorCodeToStatusCode, isPlatformSupported };
|
package/dist/index.js
CHANGED
@@ -98,6 +98,11 @@ var SuccessDetailSchema = z3.object({
|
|
98
98
|
additionalData: z3.any().optional(),
|
99
99
|
status: z3.literal("success")
|
100
100
|
}).catchall(z3.any());
|
101
|
+
var HealthStatusSchema = z3.object({
|
102
|
+
status: z3.string().describe("Health status of the API"),
|
103
|
+
version: z3.string().optional().describe("API version"),
|
104
|
+
timestamp: z3.string().datetime().describe("Current server time")
|
105
|
+
}).describe("Health status response");
|
101
106
|
var MultiStatusDataSchema = z3.object({
|
102
107
|
summary: z3.object({
|
103
108
|
total: z3.number().int().nonnegative(),
|
@@ -133,6 +138,14 @@ var AuthCallbackResponseSchema = z4.object({
|
|
133
138
|
userId: z4.string().describe("User ID"),
|
134
139
|
redirectUrl: z4.string().optional().describe("URL to redirect the user to after authentication")
|
135
140
|
}).describe("Auth callback response");
|
141
|
+
var AuthStatusParamsSchema = z4.object({
|
142
|
+
platform: z4.string().describe("Social media platform"),
|
143
|
+
userId: z4.string().describe("User ID on the platform")
|
144
|
+
}).describe("Token status parameters");
|
145
|
+
var NearUnauthorizationResponseSchema = z4.object({
|
146
|
+
success: z4.boolean().describe("Whether the unauthorized operation was successful"),
|
147
|
+
nearAccount: z4.string().describe("NEAR account ID that was unauthorized")
|
148
|
+
}).describe("NEAR unauthorized response");
|
136
149
|
var AuthStatusResponseSchema = z4.object({
|
137
150
|
platform: PlatformSchema,
|
138
151
|
userId: z4.string().describe("User ID"),
|
@@ -535,6 +548,7 @@ export {
|
|
535
548
|
AuthCallbackResponseSchema,
|
536
549
|
AuthInitRequestSchema,
|
537
550
|
AuthRevokeResponseSchema,
|
551
|
+
AuthStatusParamsSchema,
|
538
552
|
AuthStatusResponseSchema,
|
539
553
|
AuthTokenRequestSchema,
|
540
554
|
AuthUrlResponseSchema,
|
@@ -547,6 +561,7 @@ export {
|
|
547
561
|
DeleteResultSchema,
|
548
562
|
EndpointRateLimitResponseSchema,
|
549
563
|
ErrorDetailSchema,
|
564
|
+
HealthStatusSchema,
|
550
565
|
LikePostRequestSchema,
|
551
566
|
LikePostResponseSchema,
|
552
567
|
LikeResultSchema,
|
@@ -556,6 +571,7 @@ export {
|
|
556
571
|
NearAuthorizationRequestSchema,
|
557
572
|
NearAuthorizationResponseSchema,
|
558
573
|
NearAuthorizationStatusResponseSchema,
|
574
|
+
NearUnauthorizationResponseSchema,
|
559
575
|
Platform,
|
560
576
|
PlatformActivitySchema,
|
561
577
|
PlatformParamSchema,
|
package/package.json
CHANGED
package/src/auth.ts
CHANGED
@@ -29,6 +29,16 @@ export const AuthCallbackResponseSchema = z.object({
|
|
29
29
|
redirectUrl: z.string().optional().describe('URL to redirect the user to after authentication'),
|
30
30
|
}).describe('Auth callback response');
|
31
31
|
|
32
|
+
export const AuthStatusParamsSchema = z.object({
|
33
|
+
platform: z.string().describe('Social media platform'),
|
34
|
+
userId: z.string().describe('User ID on the platform'),
|
35
|
+
}).describe('Token status parameters');
|
36
|
+
|
37
|
+
export const NearUnauthorizationResponseSchema = z.object({
|
38
|
+
success: z.boolean().describe('Whether the unauthorized operation was successful'),
|
39
|
+
nearAccount: z.string().describe('NEAR account ID that was unauthorized'),
|
40
|
+
}).describe('NEAR unauthorized response');
|
41
|
+
|
32
42
|
export const AuthStatusResponseSchema = z.object({
|
33
43
|
platform: PlatformSchema,
|
34
44
|
userId: z.string().describe('User ID'),
|
@@ -89,3 +99,5 @@ export type NearAuthorizationRequest = z.infer<typeof NearAuthorizationRequestSc
|
|
89
99
|
export type NearAuthorizationResponse = z.infer<typeof NearAuthorizationResponseSchema>;
|
90
100
|
export type NearAuthorizationStatusResponse = z.infer<typeof NearAuthorizationStatusResponseSchema>;
|
91
101
|
export type AuthTokenRequest = z.infer<typeof AuthTokenRequestSchema>;
|
102
|
+
export type AuthStatusParams = z.infer<typeof AuthStatusParamsSchema>;
|
103
|
+
export type NearUnauthorizationResponse = z.infer<typeof NearUnauthorizationResponseSchema>;
|
package/src/response.ts
CHANGED
@@ -28,6 +28,12 @@ export const SuccessDetailSchema = z.object({
|
|
28
28
|
status: z.literal('success'),
|
29
29
|
}).catchall(z.any());
|
30
30
|
|
31
|
+
export const HealthStatusSchema = z.object({
|
32
|
+
status: z.string().describe('Health status of the API'),
|
33
|
+
version: z.string().optional().describe('API version'),
|
34
|
+
timestamp: z.string().datetime().describe('Current server time'),
|
35
|
+
}).describe('Health status response');
|
36
|
+
|
31
37
|
export const MultiStatusDataSchema = z.object({
|
32
38
|
summary: z.object({
|
33
39
|
total: z.number().int().nonnegative(),
|
@@ -48,3 +54,4 @@ export interface ApiResponse<T> {
|
|
48
54
|
export type ResponseMeta = z.infer<typeof ResponseMetaSchema>;
|
49
55
|
export type SuccessDetail = z.infer<typeof SuccessDetailSchema>;
|
50
56
|
export type MultiStatusData = z.infer<typeof MultiStatusDataSchema>;
|
57
|
+
export type HealthStatus = z.infer<typeof HealthStatusSchema>;
|