@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.cjs +279 -275
- package/dist/index.d.cts +147 -38
- package/dist/index.d.ts +147 -38
- package/dist/index.js +279 -275
- package/package.json +1 -1
- package/src/auth.ts +9 -6
package/package.json
CHANGED
package/src/auth.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { PlatformSchema } from './common.ts';
|
3
|
+
import { UserProfileSchema } from './user-profile.ts';
|
3
4
|
|
4
5
|
export const PlatformParamSchema = z.object({
|
5
6
|
platform: z.string().describe('Social media platform'),
|
@@ -10,6 +11,9 @@ export const AuthInitRequestSchema = z.object({
|
|
10
11
|
'URL to redirect to on successful authentication',
|
11
12
|
),
|
12
13
|
errorUrl: z.string().url().optional().describe('URL to redirect to on authentication error'),
|
14
|
+
redirect: z.boolean().optional().default(false).describe(
|
15
|
+
'Whether to redirect to successUrl/errorUrl (true) or return data directly (false)',
|
16
|
+
),
|
13
17
|
}).describe('Auth initialization request');
|
14
18
|
|
15
19
|
export const AuthUrlResponseSchema = z.object({
|
@@ -62,14 +66,13 @@ export const AuthRevokeResponseSchema = z.object({
|
|
62
66
|
export const ConnectedAccountSchema = z.object({
|
63
67
|
platform: PlatformSchema,
|
64
68
|
userId: z.string().describe('User ID on the platform'),
|
65
|
-
|
66
|
-
|
67
|
-
connectedAt: z.string().optional().describe('When the account was connected'),
|
69
|
+
connectedAt: z.string().describe('When the account was connected'),
|
70
|
+
profile: UserProfileSchema.nullable().describe('Full user profile data'),
|
68
71
|
}).describe('Connected account');
|
69
72
|
|
70
|
-
export const ConnectedAccountsResponseSchema = z.
|
71
|
-
|
72
|
-
);
|
73
|
+
export const ConnectedAccountsResponseSchema = z.object({
|
74
|
+
accounts: z.array(ConnectedAccountSchema),
|
75
|
+
}).describe('Response containing an array of connected accounts');
|
73
76
|
|
74
77
|
export const NearAuthorizationRequestSchema = z.object({
|
75
78
|
// No additional parameters needed, as the NEAR account ID is extracted from the signature
|