@crosspost/types 0.1.13 → 0.1.14
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 +9 -1
- package/dist/index.d.cts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +8 -1
- package/package.json +1 -1
- package/src/auth.ts +8 -0
package/dist/index.cjs
CHANGED
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
36
36
|
AuthRevokeResponseSchema: () => AuthRevokeResponseSchema,
|
37
37
|
AuthStatusParamsSchema: () => AuthStatusParamsSchema,
|
38
38
|
AuthStatusResponseSchema: () => AuthStatusResponseSchema,
|
39
|
+
AuthStatusSchema: () => AuthStatusSchema,
|
39
40
|
AuthTokenRequestSchema: () => AuthTokenRequestSchema,
|
40
41
|
AuthUrlResponseSchema: () => AuthUrlResponseSchema,
|
41
42
|
ConnectedAccountSchema: () => ConnectedAccountSchema,
|
@@ -237,6 +238,11 @@ var ProfileRefreshResponseSchema = import_zod4.z.object({
|
|
237
238
|
var PlatformParamSchema = import_zod5.z.object({
|
238
239
|
platform: import_zod5.z.string().describe("Social media platform")
|
239
240
|
}).describe("Platform parameter");
|
241
|
+
var AuthStatusSchema = import_zod5.z.object({
|
242
|
+
message: import_zod5.z.string().describe("User-friendly status message"),
|
243
|
+
code: import_zod5.z.string().describe("Status code for programmatic handling"),
|
244
|
+
details: import_zod5.z.string().optional().describe("Additional status details")
|
245
|
+
}).describe("Authentication status information");
|
240
246
|
var AuthInitRequestSchema = import_zod5.z.object({
|
241
247
|
successUrl: import_zod5.z.string().url().optional().describe(
|
242
248
|
"URL to redirect to on successful authentication"
|
@@ -256,7 +262,8 @@ var AuthCallbackQuerySchema = import_zod5.z.object({
|
|
256
262
|
var AuthCallbackResponseSchema = import_zod5.z.object({
|
257
263
|
platform: PlatformSchema,
|
258
264
|
userId: import_zod5.z.string().describe("User ID"),
|
259
|
-
redirectUrl: import_zod5.z.string().optional().describe("URL to redirect the user to after authentication")
|
265
|
+
redirectUrl: import_zod5.z.string().optional().describe("URL to redirect the user to after authentication"),
|
266
|
+
status: AuthStatusSchema.describe("Authentication status information")
|
260
267
|
}).describe("Auth callback response");
|
261
268
|
var AuthStatusParamsSchema = import_zod5.z.object({
|
262
269
|
platform: import_zod5.z.string().describe("Social media platform"),
|
@@ -655,6 +662,7 @@ var AccountPostsResponseSchema = import_zod8.z.object({
|
|
655
662
|
AuthRevokeResponseSchema,
|
656
663
|
AuthStatusParamsSchema,
|
657
664
|
AuthStatusResponseSchema,
|
665
|
+
AuthStatusSchema,
|
658
666
|
AuthTokenRequestSchema,
|
659
667
|
AuthUrlResponseSchema,
|
660
668
|
ConnectedAccountSchema,
|
package/dist/index.d.cts
CHANGED
@@ -296,6 +296,19 @@ declare const PlatformParamSchema: z.ZodObject<{
|
|
296
296
|
}, {
|
297
297
|
platform: string;
|
298
298
|
}>;
|
299
|
+
declare const AuthStatusSchema: z.ZodObject<{
|
300
|
+
message: z.ZodString;
|
301
|
+
code: z.ZodString;
|
302
|
+
details: z.ZodOptional<z.ZodString>;
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
304
|
+
code: string;
|
305
|
+
message: string;
|
306
|
+
details?: string | undefined;
|
307
|
+
}, {
|
308
|
+
code: string;
|
309
|
+
message: string;
|
310
|
+
details?: string | undefined;
|
311
|
+
}>;
|
299
312
|
declare const AuthInitRequestSchema: z.ZodObject<{
|
300
313
|
successUrl: z.ZodOptional<z.ZodString>;
|
301
314
|
errorUrl: z.ZodOptional<z.ZodString>;
|
@@ -330,11 +343,34 @@ declare const AuthCallbackResponseSchema: z.ZodObject<{
|
|
330
343
|
platform: z.ZodNativeEnum<typeof Platform>;
|
331
344
|
userId: z.ZodString;
|
332
345
|
redirectUrl: z.ZodOptional<z.ZodString>;
|
346
|
+
status: z.ZodObject<{
|
347
|
+
message: z.ZodString;
|
348
|
+
code: z.ZodString;
|
349
|
+
details: z.ZodOptional<z.ZodString>;
|
350
|
+
}, "strip", z.ZodTypeAny, {
|
351
|
+
code: string;
|
352
|
+
message: string;
|
353
|
+
details?: string | undefined;
|
354
|
+
}, {
|
355
|
+
code: string;
|
356
|
+
message: string;
|
357
|
+
details?: string | undefined;
|
358
|
+
}>;
|
333
359
|
}, "strip", z.ZodTypeAny, {
|
360
|
+
status: {
|
361
|
+
code: string;
|
362
|
+
message: string;
|
363
|
+
details?: string | undefined;
|
364
|
+
};
|
334
365
|
platform: Platform;
|
335
366
|
userId: string;
|
336
367
|
redirectUrl?: string | undefined;
|
337
368
|
}, {
|
369
|
+
status: {
|
370
|
+
code: string;
|
371
|
+
message: string;
|
372
|
+
details?: string | undefined;
|
373
|
+
};
|
338
374
|
platform: Platform;
|
339
375
|
userId: string;
|
340
376
|
redirectUrl?: string | undefined;
|
@@ -595,6 +631,7 @@ type NearAuthorizationStatusResponse = z.infer<typeof NearAuthorizationStatusRes
|
|
595
631
|
type AuthTokenRequest = z.infer<typeof AuthTokenRequestSchema>;
|
596
632
|
type AuthStatusParams = z.infer<typeof AuthStatusParamsSchema>;
|
597
633
|
type NearUnauthorizationResponse = z.infer<typeof NearUnauthorizationResponseSchema>;
|
634
|
+
type AuthStatus = z.infer<typeof AuthStatusSchema>;
|
598
635
|
|
599
636
|
declare const MediaContentSchema: z.ZodObject<{
|
600
637
|
data: z.ZodUnion<[z.ZodString, z.ZodType<buffer.Blob, z.ZodTypeDef, buffer.Blob>]>;
|
@@ -3178,4 +3215,4 @@ declare const ProfileRefreshResponseSchema: z.ZodObject<{
|
|
3178
3215
|
type UserProfile = z.infer<typeof UserProfileSchema>;
|
3179
3216
|
type ProfileRefreshResponse = z.infer<typeof ProfileRefreshResponseSchema>;
|
3180
3217
|
|
3181
|
-
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 };
|
3218
|
+
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatus, type AuthStatusParams, AuthStatusParamsSchema, type AuthStatusResponse, AuthStatusResponseSchema, AuthStatusSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type HealthStatus, HealthStatusSchema, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type 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
@@ -296,6 +296,19 @@ declare const PlatformParamSchema: z.ZodObject<{
|
|
296
296
|
}, {
|
297
297
|
platform: string;
|
298
298
|
}>;
|
299
|
+
declare const AuthStatusSchema: z.ZodObject<{
|
300
|
+
message: z.ZodString;
|
301
|
+
code: z.ZodString;
|
302
|
+
details: z.ZodOptional<z.ZodString>;
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
304
|
+
code: string;
|
305
|
+
message: string;
|
306
|
+
details?: string | undefined;
|
307
|
+
}, {
|
308
|
+
code: string;
|
309
|
+
message: string;
|
310
|
+
details?: string | undefined;
|
311
|
+
}>;
|
299
312
|
declare const AuthInitRequestSchema: z.ZodObject<{
|
300
313
|
successUrl: z.ZodOptional<z.ZodString>;
|
301
314
|
errorUrl: z.ZodOptional<z.ZodString>;
|
@@ -330,11 +343,34 @@ declare const AuthCallbackResponseSchema: z.ZodObject<{
|
|
330
343
|
platform: z.ZodNativeEnum<typeof Platform>;
|
331
344
|
userId: z.ZodString;
|
332
345
|
redirectUrl: z.ZodOptional<z.ZodString>;
|
346
|
+
status: z.ZodObject<{
|
347
|
+
message: z.ZodString;
|
348
|
+
code: z.ZodString;
|
349
|
+
details: z.ZodOptional<z.ZodString>;
|
350
|
+
}, "strip", z.ZodTypeAny, {
|
351
|
+
code: string;
|
352
|
+
message: string;
|
353
|
+
details?: string | undefined;
|
354
|
+
}, {
|
355
|
+
code: string;
|
356
|
+
message: string;
|
357
|
+
details?: string | undefined;
|
358
|
+
}>;
|
333
359
|
}, "strip", z.ZodTypeAny, {
|
360
|
+
status: {
|
361
|
+
code: string;
|
362
|
+
message: string;
|
363
|
+
details?: string | undefined;
|
364
|
+
};
|
334
365
|
platform: Platform;
|
335
366
|
userId: string;
|
336
367
|
redirectUrl?: string | undefined;
|
337
368
|
}, {
|
369
|
+
status: {
|
370
|
+
code: string;
|
371
|
+
message: string;
|
372
|
+
details?: string | undefined;
|
373
|
+
};
|
338
374
|
platform: Platform;
|
339
375
|
userId: string;
|
340
376
|
redirectUrl?: string | undefined;
|
@@ -595,6 +631,7 @@ type NearAuthorizationStatusResponse = z.infer<typeof NearAuthorizationStatusRes
|
|
595
631
|
type AuthTokenRequest = z.infer<typeof AuthTokenRequestSchema>;
|
596
632
|
type AuthStatusParams = z.infer<typeof AuthStatusParamsSchema>;
|
597
633
|
type NearUnauthorizationResponse = z.infer<typeof NearUnauthorizationResponseSchema>;
|
634
|
+
type AuthStatus = z.infer<typeof AuthStatusSchema>;
|
598
635
|
|
599
636
|
declare const MediaContentSchema: z.ZodObject<{
|
600
637
|
data: z.ZodUnion<[z.ZodString, z.ZodType<buffer.Blob, z.ZodTypeDef, buffer.Blob>]>;
|
@@ -3178,4 +3215,4 @@ declare const ProfileRefreshResponseSchema: z.ZodObject<{
|
|
3178
3215
|
type UserProfile = z.infer<typeof UserProfileSchema>;
|
3179
3216
|
type ProfileRefreshResponse = z.infer<typeof ProfileRefreshResponseSchema>;
|
3180
3217
|
|
3181
|
-
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 };
|
3218
|
+
export { type AccountActivity, type AccountActivityEntry, AccountActivityEntrySchema, type AccountActivityParams, AccountActivityParamsSchema, type AccountActivityQuery, AccountActivityQuerySchema, type AccountActivityResponse, type AccountPost, AccountPostSchema, type AccountPostsParams, AccountPostsParamsSchema, type AccountPostsQuery, AccountPostsQuerySchema, type AccountPostsResponse, type ActivityLeaderboardQuery, ActivityLeaderboardQuerySchema, type ActivityLeaderboardResponse, type AllRateLimitsResponse, AllRateLimitsResponseSchema, ApiErrorCode, ApiErrorCodeSchema, type ApiErrorResponse, type ApiResponse, type AuthCallbackQuery, AuthCallbackQuerySchema, type AuthCallbackResponse, AuthCallbackResponseSchema, type AuthInitRequest, AuthInitRequestSchema, type AuthRevokeResponse, AuthRevokeResponseSchema, type AuthStatus, type AuthStatusParams, AuthStatusParamsSchema, type AuthStatusResponse, AuthStatusResponseSchema, AuthStatusSchema, type AuthTokenRequest, AuthTokenRequestSchema, type AuthUrlResponse, AuthUrlResponseSchema, type ConnectedAccount, ConnectedAccountSchema, type ConnectedAccountsResponse, ConnectedAccountsResponseSchema, type CreatePostRequest, CreatePostRequestSchema, type CreatePostResponse, CreatePostResponseSchema, type DeletePostRequest, DeletePostRequestSchema, type DeletePostResponse, DeletePostResponseSchema, type DeleteResult, DeleteResultSchema, type EndpointRateLimitResponse, EndpointRateLimitResponseSchema, type ErrorDetail, ErrorDetailSchema, type ErrorDetails, type HealthStatus, HealthStatusSchema, type LikePostRequest, LikePostRequestSchema, type LikePostResponse, LikePostResponseSchema, type LikeResult, LikeResultSchema, type Media, type MediaContent, MediaContentSchema, MediaSchema, type MultiStatusData, MultiStatusDataSchema, type 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
@@ -137,6 +137,11 @@ var ProfileRefreshResponseSchema = z4.object({
|
|
137
137
|
var PlatformParamSchema = z5.object({
|
138
138
|
platform: z5.string().describe("Social media platform")
|
139
139
|
}).describe("Platform parameter");
|
140
|
+
var AuthStatusSchema = z5.object({
|
141
|
+
message: z5.string().describe("User-friendly status message"),
|
142
|
+
code: z5.string().describe("Status code for programmatic handling"),
|
143
|
+
details: z5.string().optional().describe("Additional status details")
|
144
|
+
}).describe("Authentication status information");
|
140
145
|
var AuthInitRequestSchema = z5.object({
|
141
146
|
successUrl: z5.string().url().optional().describe(
|
142
147
|
"URL to redirect to on successful authentication"
|
@@ -156,7 +161,8 @@ var AuthCallbackQuerySchema = z5.object({
|
|
156
161
|
var AuthCallbackResponseSchema = z5.object({
|
157
162
|
platform: PlatformSchema,
|
158
163
|
userId: z5.string().describe("User ID"),
|
159
|
-
redirectUrl: z5.string().optional().describe("URL to redirect the user to after authentication")
|
164
|
+
redirectUrl: z5.string().optional().describe("URL to redirect the user to after authentication"),
|
165
|
+
status: AuthStatusSchema.describe("Authentication status information")
|
160
166
|
}).describe("Auth callback response");
|
161
167
|
var AuthStatusParamsSchema = z5.object({
|
162
168
|
platform: z5.string().describe("Social media platform"),
|
@@ -554,6 +560,7 @@ export {
|
|
554
560
|
AuthRevokeResponseSchema,
|
555
561
|
AuthStatusParamsSchema,
|
556
562
|
AuthStatusResponseSchema,
|
563
|
+
AuthStatusSchema,
|
557
564
|
AuthTokenRequestSchema,
|
558
565
|
AuthUrlResponseSchema,
|
559
566
|
ConnectedAccountSchema,
|
package/package.json
CHANGED
package/src/auth.ts
CHANGED
@@ -6,6 +6,12 @@ export const PlatformParamSchema = z.object({
|
|
6
6
|
platform: z.string().describe('Social media platform'),
|
7
7
|
}).describe('Platform parameter');
|
8
8
|
|
9
|
+
export const AuthStatusSchema = z.object({
|
10
|
+
message: z.string().describe('User-friendly status message'),
|
11
|
+
code: z.string().describe('Status code for programmatic handling'),
|
12
|
+
details: z.string().optional().describe('Additional status details'),
|
13
|
+
}).describe('Authentication status information');
|
14
|
+
|
9
15
|
export const AuthInitRequestSchema = z.object({
|
10
16
|
successUrl: z.string().url().optional().describe(
|
11
17
|
'URL to redirect to on successful authentication',
|
@@ -29,6 +35,7 @@ export const AuthCallbackResponseSchema = z.object({
|
|
29
35
|
platform: PlatformSchema,
|
30
36
|
userId: z.string().describe('User ID'),
|
31
37
|
redirectUrl: z.string().optional().describe('URL to redirect the user to after authentication'),
|
38
|
+
status: AuthStatusSchema.describe('Authentication status information'),
|
32
39
|
}).describe('Auth callback response');
|
33
40
|
|
34
41
|
export const AuthStatusParamsSchema = z.object({
|
@@ -102,3 +109,4 @@ export type NearAuthorizationStatusResponse = z.infer<typeof NearAuthorizationSt
|
|
102
109
|
export type AuthTokenRequest = z.infer<typeof AuthTokenRequestSchema>;
|
103
110
|
export type AuthStatusParams = z.infer<typeof AuthStatusParamsSchema>;
|
104
111
|
export type NearUnauthorizationResponse = z.infer<typeof NearUnauthorizationResponseSchema>;
|
112
|
+
export type AuthStatus = z.infer<typeof AuthStatusSchema>;
|